本文整理汇总了C#中MachineCodeEmitter.Write方法的典型用法代码示例。如果您正苦于以下问题:C# MachineCodeEmitter.Write方法的具体用法?C# MachineCodeEmitter.Write怎么用?C# MachineCodeEmitter.Write使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MachineCodeEmitter
的用法示例。
在下文中一共展示了MachineCodeEmitter.Write方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Emit
/// <summary>
///
/// </summary>
/// <param name="ctx"></param>
/// <param name="emitter"></param>
protected override void Emit(Context ctx, MachineCodeEmitter emitter)
{
RegisterOperand rop = (RegisterOperand)ctx.Result;
MemoryOperand mop = (MemoryOperand)ctx.Operand1;
byte[] code;
if (null != mop.Base)
{
code = new byte[] {
0x8d,
0x84,
(4 << 3)
};
code[1] |= (byte)((rop.Register.RegisterCode & 0x7));
code[2] |= (byte)((mop.Base.RegisterCode & 0x7));
}
else
{
code = new byte[] { 0xb8 };
}
emitter.Write (code, 0, code.Length);
emitter.EmitImmediate (mop);
}
示例2: Emit
/// <summary>
///
/// </summary>
/// <param name="ctx"></param>
/// <param name="emitter"></param>
protected override void Emit(Context context, MachineCodeEmitter emitter)
{
Operand mop = context.Operand1;
byte[] code;
if (mop.Base != null)
{
code = new byte[] { 0x8D, 0x84, (4 << 3) };
code[1] |= (byte)((context.Result.Register.RegisterCode & 0x07));
code[2] |= (byte)((mop.Base.RegisterCode & 0x07));
emitter.Write(code, 0, code.Length);
emitter.EmitImmediate(mop);
}
else
{
emitter.Emit(opcode, context.Result, context.Operand1);
}
}
示例3: Emit
/// <summary>
/// Emits the specified platform instruction.
/// </summary>
/// <param name="context">The context.</param>
/// <param name="emitter">The emitter.</param>
protected override void Emit(Context context, MachineCodeEmitter emitter)
{
emitter.Write(0xD703);
}
示例4: Emit
/// <summary>
/// Emits the specified platform instruction.
/// </summary>
/// <param name="ctx">The context.</param>
/// <param name="emitter">The emitter.</param>
protected override void Emit(Context ctx, MachineCodeEmitter emitter)
{
emitter.WriteByte (0xe8);
emitter.Write (new byte[4], 0, 4);
emitter.Call (ctx.InvokeTarget);
}