本文整理汇总了C#中Reko.UnitTests.Mocks.ProcedureBuilder.Temp方法的典型用法代码示例。如果您正苦于以下问题:C# ProcedureBuilder.Temp方法的具体用法?C# ProcedureBuilder.Temp怎么用?C# ProcedureBuilder.Temp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Reko.UnitTests.Mocks.ProcedureBuilder
的用法示例。
在下文中一共展示了ProcedureBuilder.Temp方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VpLoadDpbSmallerCast
public void VpLoadDpbSmallerCast()
{
var m = new ProcedureBuilder();
var a2 = m.Reg32("a2", 10);
var d3 = m.Reg32("d3", 3);
var tmp = m.Temp(PrimitiveType.Word16, "tmp");
m.Assign(tmp, m.LoadW(a2));
m.Assign(d3, m.Dpb(d3, tmp, 0));
m.Store(m.IAdd(a2, 4), m.Cast(PrimitiveType.Byte, d3));
SsaState ssa = RunTest(m);
var sExp =
#region Expected
@"a2:a2
def: def a2
uses: tmp_2 = Mem0[a2:word16]
Mem5[a2 + 0x00000004:byte] = (byte) tmp_2
Mem0:Global memory
def: def Mem0
uses: tmp_2 = Mem0[a2:word16]
tmp_2: orig: tmp
def: tmp_2 = Mem0[a2:word16]
uses: d3_4 = DPB(d3, tmp_2, 0)
Mem5[a2 + 0x00000004:byte] = (byte) tmp_2
d3:d3
def: def d3
uses: d3_4 = DPB(d3, tmp_2, 0)
d3_4: orig: d3
def: d3_4 = DPB(d3, tmp_2, 0)
Mem5: orig: Mem0
def: Mem5[a2 + 0x00000004:byte] = (byte) tmp_2
// ProcedureBuilder
// Return size: 0
void ProcedureBuilder()
ProcedureBuilder_entry:
def a2
def Mem0
def d3
// succ: l1
l1:
tmp_2 = Mem0[a2:word16]
d3_4 = DPB(d3, tmp_2, 0)
Mem5[a2 + 0x00000004:byte] = (byte) tmp_2
ProcedureBuilder_exit:
";
#endregion
AssertStringsEqual(sExp, ssa);
}
示例2: CEB_SegmentedArray
public void CEB_SegmentedArray()
{
var m = new Reko.UnitTests.Mocks.ProcedureBuilder("CEB_SegmentedArray");
var aw = new ArrayType(PrimitiveType.Int16, 0);
var ds = m.Temp(PrimitiveType.SegmentSelector, "ds");
var bx = m.Temp(PrimitiveType.Word16, "bx");
var acc =
m.Array(
PrimitiveType.Word16,
m.Seq(
ds,
m.Word16(0x5388)),
m.IMul(bx, 2));
CreateTv(globals, Ptr32(factory.CreateStructureType()), Ptr32(factory.CreateStructureType()));
CreateTv(ds, Ptr16(factory.CreateStructureType()), Ptr16(factory.CreateStructureType()));
}