本文整理汇总了C#中Reko.Core.Frame.Write方法的典型用法代码示例。如果您正苦于以下问题:C# Frame.Write方法的具体用法?C# Frame.Write怎么用?C# Frame.Write使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Reko.Core.Frame
的用法示例。
在下文中一共展示了Frame.Write方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FrGrfTest
public void FrGrfTest()
{
IntelArchitecture arch = new IntelArchitecture(ProcessorMode.Real);
Frame f = new Frame(PrimitiveType.Word16);
uint iSz = (uint) (FlagM.ZF|FlagM.SF);
Identifier grfSz = f.EnsureFlagGroup(Registers.eflags, iSz, arch.GrfToString(iSz), PrimitiveType.Byte);
using (FileUnitTester fut = new FileUnitTester("Core/FrGrfTest.txt"))
{
f.Write(fut.TextWriter);
fut.AssertFilesEqual();
}
}
示例2: 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);
}
示例3: FrBindMixedParameters
public void FrBindMixedParameters()
{
Frame f = new Frame(PrimitiveType.Word16);
Identifier ax = f.EnsureRegister(Registers.ax);
Identifier cx = f.EnsureRegister(Registers.cx);
int stack = PrimitiveType.Word16.Size;
Identifier arg1 = f.EnsureStackLocal(-stack, PrimitiveType.Word16);
ProcedureSignature sig = new ProcedureSignature(
ax,
cx,
new Identifier("arg0", PrimitiveType.Word16, new StackArgumentStorage(0, PrimitiveType.Word16)));
var cs = new CallSite(stack, 0);
ProcedureConstant fn = new ProcedureConstant(PrimitiveType.Pointer32, new PseudoProcedure("bar", sig));
ApplicationBuilder ab = new ApplicationBuilder(arch, f, cs, fn, sig, true);
Instruction instr = ab.CreateInstruction();
using (FileUnitTester fut = new FileUnitTester("Core/FrBindMixedParameters.txt"))
{
f.Write(fut.TextWriter);
fut.TextWriter.WriteLine(instr.ToString());
fut.AssertFilesEqual();
}
}
示例4: FrLocals
public void FrLocals()
{
Frame f = new Frame(PrimitiveType.Word16);
f.EnsureStackLocal(2, PrimitiveType.Word16);
f.EnsureStackLocal(4, PrimitiveType.Word32);
using (FileUnitTester fut = new FileUnitTester("Core/FrLocals.txt"))
{
f.Write(fut.TextWriter);
fut.AssertFilesEqual();
}
Assert.IsNotNull((StackLocalStorage) f.Identifiers[2].Storage);
}
示例5: FrFpuStack
public void FrFpuStack()
{
Frame f = new Frame(PrimitiveType.Word16);
f.EnsureFpuStackVariable(-1, PrimitiveType.Real64);
f.EnsureFpuStackVariable(-2, PrimitiveType.Real64);
f.EnsureFpuStackVariable(0, PrimitiveType.Real64);
using (FileUnitTester fut = new FileUnitTester("Core/FrFpuStack.txt"))
{
f.Write(fut.TextWriter);
fut.AssertFilesEqual();
}
}
示例6: FrBindStackParameters
public void FrBindStackParameters()
{
Frame f = new Frame(PrimitiveType.Word16);
f.ReturnAddressSize = 4; // far call.
int stack = 2;
Identifier loc02 = f.EnsureStackLocal(-stack, PrimitiveType.Word16, "wLoc02");
stack += loc02.DataType.Size;
Identifier loc04 = f.EnsureStackLocal(-stack, PrimitiveType.Word16, "wLoc04");
ProcedureSignature sig = new ProcedureSignature(
null, new Identifier[] {
new Identifier("arg0", PrimitiveType.Word16, new StackArgumentStorage(4, PrimitiveType.Word16)),
new Identifier("arg1", PrimitiveType.Word16, new StackArgumentStorage(6, PrimitiveType.Word16)) });
var cs = new CallSite(f.ReturnAddressSize + 2 * 4, 0);
var fn = new ProcedureConstant(PrimitiveType.Pointer32, new PseudoProcedure("foo", sig));
ApplicationBuilder ab = new ApplicationBuilder(arch, f, cs, fn, sig, true);
Instruction instr = ab.CreateInstruction();
using (FileUnitTester fut = new FileUnitTester("Core/FrBindStackParameters.txt"))
{
f.Write(fut.TextWriter);
fut.TextWriter.WriteLine(instr.ToString());
fut.AssertFilesEqual();
}
}
示例7: 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();
}
}