当前位置: 首页>>代码示例>>C#>>正文


C# ProcedureBuilder.SegMem方法代码示例

本文整理汇总了C#中Reko.UnitTests.Mocks.ProcedureBuilder.SegMem方法的典型用法代码示例。如果您正苦于以下问题:C# ProcedureBuilder.SegMem方法的具体用法?C# ProcedureBuilder.SegMem怎么用?C# ProcedureBuilder.SegMem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Reko.UnitTests.Mocks.ProcedureBuilder的用法示例。


在下文中一共展示了ProcedureBuilder.SegMem方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: VpUndoUnnecessarySlicingOfSegmentPointer

        public void VpUndoUnnecessarySlicingOfSegmentPointer()
        {
            var m = new ProcedureBuilder();
            var es = m.Reg16("es", 1);
            var bx = m.Reg16("bx", 3);
            var es_bx = m.Frame.EnsureSequence(es.Storage, bx.Storage, PrimitiveType.Word32);

            m.Assign(es_bx, m.SegMem(PrimitiveType.Word32, es, bx));
            m.Assign(es, m.Slice(PrimitiveType.Word16, es_bx, 16));
            m.Assign(bx, m.Cast(PrimitiveType.Word16, es_bx));
            m.SegStore(es, m.IAdd(bx, 4), m.Byte(3));

            var ssa = RunTest(m);

            var sExp =
            #region Expected
@"es:es
    def:  def es
    uses: es_bx_3 = Mem0[es:bx:word32]
bx:bx
    def:  def bx
    uses: es_bx_3 = Mem0[es:bx:word32]
Mem0:Global memory
    def:  def Mem0
    uses: es_bx_3 = Mem0[es:bx:word32]
es_bx_3: orig: es_bx
    def:  es_bx_3 = Mem0[es:bx:word32]
    uses: es_4 = SLICE(es_bx_3, word16, 16)
          bx_5 = (word16) es_bx_3
          Mem0[es_bx_3 + 0x0004:byte] = 0x03
es_4: orig: es
    def:  es_4 = SLICE(es_bx_3, word16, 16)
bx_5: orig: bx
    def:  bx_5 = (word16) es_bx_3
Mem6: orig: Mem0
    def:  Mem0[es_bx_3 + 0x0004:byte] = 0x03
// ProcedureBuilder
// Return size: 0
void ProcedureBuilder()
ProcedureBuilder_entry:
	def es
	def bx
	def Mem0
	// succ:  l1
l1:
	es_bx_3 = Mem0[es:bx:word32]
	es_4 = SLICE(es_bx_3, word16, 16)
	bx_5 = (word16) es_bx_3
	Mem0[es_bx_3 + 0x0004:byte] = 0x03
ProcedureBuilder_exit:
";
            #endregion

            AssertStringsEqual(sExp, ssa);
        }
开发者ID:uxmal,项目名称:reko,代码行数:55,代码来源:ValuePropagationTests.cs

示例2: TrcoSegmentedDirectAddress

		public void TrcoSegmentedDirectAddress()
		{
            Program prog = CreateProgram();
			prog.TypeStore.EnsureExpressionTypeVariable(prog.TypeFactory, prog.Globals);

            ProcedureBuilder m = new ProcedureBuilder();
            Identifier ds = m.Local16("ds");
			Expression e = m.SegMem(PrimitiveType.Byte, ds, m.Int16(0x0200));

            coll = CreateCollector(prog);
			e = e.Accept(en);
			e.Accept(eqb);
			e.Accept(coll);
			Verify(null, "Typing/TrcoSegmentedDirectAddress.txt");
		}
开发者ID:gitter-badger,项目名称:reko,代码行数:15,代码来源:TraitCollectorTests.cs

示例3: TrcoSegmentedAccess

		public void TrcoSegmentedAccess()
		{
			ProcedureBuilder m = new ProcedureBuilder();
			Identifier ds = m.Local16("ds");
			Identifier bx = m.Local16("bx");
			Identifier ax = m.Local16("ax");
			Expression e = m.SegMem(PrimitiveType.Word16, ds, m.IAdd(bx, 4));

            coll = CreateCollector();
			e = e.Accept(en);
			e.Accept(eqb);
			e.Accept(coll);
			Verify(null, "Typing/TrcoSegmentedAccess.txt");
		}
开发者ID:gitter-badger,项目名称:reko,代码行数:14,代码来源:TraitCollectorTests.cs

示例4: DtbSignedCompare

        public void DtbSignedCompare()
        {
            ProcedureBuilder m = new ProcedureBuilder();
            Identifier p = m.Local32("p");
            Identifier ds = m.Local16("ds");
            ds.DataType = PrimitiveType.SegmentSelector;
            Identifier ds2 = m.Local16("ds2");
            ds.DataType = PrimitiveType.SegmentSelector;
            m.Assign(ds2, ds);
            m.Store(
                m.SegMem(PrimitiveType.Bool, ds, m.Word16(0x5400)),
                m.Lt(m.SegMemW(ds, m.Word16(0x5404)), m.Word16(20)));
            m.Store(m.SegMemW(ds2, m.Word16(0x5404)), m.Word16(0));

            ProgramBuilder prog = new ProgramBuilder();
            prog.Add(m);
            RunTest(prog.BuildProgram(), "Typing/DtbSignedCompare.txt");
        }
开发者ID:melbcat,项目名称:reko,代码行数:18,代码来源:DataTypeBuilderTests.cs

示例5: DtbSegmentedDirectAddress

        public void DtbSegmentedDirectAddress()
        {
            ProcedureBuilder m = new ProcedureBuilder();
            var arch = new Reko.Arch.X86.X86ArchitectureReal();
            var prog = new Program
            {
                Architecture = arch,
                Platform = new DefaultPlatform(null, arch)
            };
            store.EnsureExpressionTypeVariable(factory, prog.Globals);

            Identifier ds = m.Local16("ds");
            Expression e = m.SegMem(PrimitiveType.Byte, ds, m.Int16(0x0200));

            TraitCollector coll = new TraitCollector(factory, store, dtb, prog);
            e = e.Accept(aen);
            e.Accept(eqb);
            e.Accept(coll);
            dtb.BuildEquivalenceClassDataTypes();
            Verify("Typing/DtbSegmentedDirectAddress.txt");
        }
开发者ID:melbcat,项目名称:reko,代码行数:21,代码来源:DataTypeBuilderTests.cs

示例6: DtbSegmentedAccess

        public void DtbSegmentedAccess()
        {
            ProcedureBuilder m = new ProcedureBuilder();

            Identifier ds = m.Local16("ds");
            Identifier bx = m.Local16("bx");
            Expression e = m.SegMem(bx.DataType, ds, m.IAdd(bx, 4));
            var arch = new Reko.Arch.X86.X86ArchitectureReal();
            Program prog = new Program
            {
                Architecture = arch,
                Platform = new DefaultPlatform(null, arch),
            };
            TraitCollector trco = new TraitCollector(factory, store, dtb, prog);
            e = e.Accept(aen);
            e.Accept(eqb);
            e.Accept(trco);
            dtb.BuildEquivalenceClassDataTypes();
            Verify("Typing/DtbSegmentedAccess.txt");
        }
开发者ID:melbcat,项目名称:reko,代码行数:20,代码来源:DataTypeBuilderTests.cs


注:本文中的Reko.UnitTests.Mocks.ProcedureBuilder.SegMem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。