本文整理汇总了C#中Reko.Core.Frame.EnsureSequence方法的典型用法代码示例。如果您正苦于以下问题:C# Frame.EnsureSequence方法的具体用法?C# Frame.EnsureSequence怎么用?C# Frame.EnsureSequence使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Reko.Core.Frame
的用法示例。
在下文中一共展示了Frame.EnsureSequence方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SequenceTest
public void SequenceTest()
{
IntelArchitecture arch = new IntelArchitecture(ProcessorMode.Real);
Frame f = new Frame(PrimitiveType.Word16);
Identifier ax = f.EnsureRegister(Registers.ax);
Identifier dx = f.EnsureRegister(Registers.dx);
Identifier dxax = f.EnsureSequence(dx, ax, PrimitiveType.Word32);
using (FileUnitTester fut = new FileUnitTester("Core/SequenceTest.txt"))
{
f.Write(fut.TextWriter);
fut.AssertFilesEqual();
}
Identifier dxax2 = f.EnsureSequence(dx,ax, PrimitiveType.Word32);
Assert.IsTrue(dxax2 == dxax);
}
示例2: Deserialize
public override FunctionType Deserialize(SerializedSignature ss, Frame frame)
{
int ncrn = 0;
int nsaa = 0;
// mem arg forb ret val
var argser = new ArgumentDeserializer(
this,
Architecture,
frame,
Architecture.PointerType.Size,
Architecture.WordWidth.Size);
Identifier ret = null;
if (ss.ReturnValue != null)
{
ret = argser.DeserializeReturnValue(ss.ReturnValue);
}
var args = new List<Identifier>();
if (ss.Arguments != null)
{
foreach (var sArg in ss.Arguments)
{
var dt = sArg.Type.Accept(TypeLoader);
var sizeInWords = (dt.Size + 3) / 4;
if (sizeInWords == 2 && (ncrn & 1) == 1)
++ncrn;
Identifier arg;
if (sizeInWords <= 4 - ncrn)
{
if (sizeInWords == 2)
{
arg = frame.EnsureSequence(
Architecture.GetRegister(argRegs[ncrn]),
Architecture.GetRegister(argRegs[ncrn + 1]),
dt);
ncrn += 2;
}
else
{
arg = frame.EnsureRegister(
Architecture.GetRegister(argRegs[ncrn]));
ncrn += 1;
}
}
else
{
arg = frame.EnsureStackArgument(nsaa, dt);
nsaa += AlignedStackArgumentSize(dt);
}
args.Add(arg);
}
}
return new FunctionType(ret, args.ToArray());
}
示例3: FrSequenceAccess
public void FrSequenceAccess()
{
Frame f = new Frame(PrimitiveType.Word16);
Identifier ax = f.EnsureRegister(Registers.ax);
Identifier dx = f.EnsureRegister(Registers.dx);
Identifier dx_ax = f.EnsureSequence(dx, ax, PrimitiveType.Word32);
SequenceStorage vDx_ax = (SequenceStorage) dx_ax.Storage;
using (FileUnitTester fut = new FileUnitTester("Core/FrSequenceAccess.txt"))
{
f.Write(fut.TextWriter);
fut.TextWriter.WriteLine("Head({0}) = {1}", dx_ax.Name, vDx_ax.Head.Name);
fut.TextWriter.WriteLine("Tail({0}) = {1}", dx_ax.Name, vDx_ax.Tail.Name);
fut.AssertFilesEqual();
}
}