本文整理汇总了C#中MachineInstructionWriter.WriteOpcode方法的典型用法代码示例。如果您正苦于以下问题:C# MachineInstructionWriter.WriteOpcode方法的具体用法?C# MachineInstructionWriter.WriteOpcode怎么用?C# MachineInstructionWriter.WriteOpcode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MachineInstructionWriter
的用法示例。
在下文中一共展示了MachineInstructionWriter.WriteOpcode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Render
public override void Render(MachineInstructionWriter writer)
{
if (code == Opcode.illegal && op1 != null && writer.Platform != null)
{
var imm = op1 as M68kImmediateOperand;
// MacOS uses invalid opcodes to invoke Macintosh Toolbox services.
// We may have to generalize the Platform API to allow specifying
// the opcode of the invoking instruction, to disambiguate from
// "legitimate" TRAP calls.
var svc = writer.Platform.FindService((int)imm.Constant.ToUInt32(), null);
if (svc != null)
{
writer.Write(svc.Name);
return;
}
}
if (dataWidth != null)
{
writer.WriteOpcode(string.Format("{0}{1}", code, DataSizeSuffix(dataWidth)));
}
else
{
writer.WriteOpcode(code.ToString());
}
writer.Tab();
if (op1 != null)
{
op1.Write(false, writer);
if (op2 != null)
{
writer.Write(',');
op2.Write(false, writer);
}
}
}
示例2: Render
public override void Render(MachineInstructionWriter writer)
{
if (instruction == null)
{
writer.Write("Invalid");
return;
}
writer.WriteOpcode(instruction.Mnemonic);
var ops = instruction.ArchitectureDetail.Operands;
if (ops.Length < 1)
return;
writer.Tab();
if (WriteRegisterSetInstruction(writer))
return;
Write(ops[0], writer);
if (ops.Length < 2)
return;
writer.Write(",");
Write(ops[1], writer);
if (ops.Length < 3)
return;
writer.Write(",");
Write(ops[2], writer);
if (ops.Length < 4)
return;
writer.Write(",");
Write(ops[3], writer);
}
示例3: Render
public override void Render(MachineInstructionWriter writer)
{
var op = string.Format("{0}{1}",
opcode,
setsCR0 ? "." : "");
writer.WriteOpcode(op);
if (op1 != null)
{
writer.Tab();
op1.Write(true, writer);
if (op2 != null)
{
writer.Write(',');
op2.Write(true, writer);
if (op3 != null)
{
writer.Write(',');
op3.Write(true, writer);
if (op4 != null)
{
writer.Write(",");
op4.Write(true, writer);
if (op5 != null)
{
writer.Write(",");
op5.Write(true, writer);
}
}
}
}
}
}
示例4: Render
public override void Render(MachineInstructionWriter writer)
{
writer.WriteOpcode(string.Format("{0}{1}{2}",
Opcode,
Cond != Condition.al ? Cond.ToString() : "",
OpFlags != OpFlags.None ? OpFlags.ToString().ToLower() : ""));
if (Dst != null)
{
writer.Tab();
Write(Dst, writer);
if (Update) writer.Write("!");
if (Src1 != null)
{
writer.Write(",");
Write(Src1, writer);
if (Src2 != null)
{
writer.Write(",");
Write(Src2, writer);
if (Src3 != null)
{
writer.Write(",");
Write(Src3, writer);
}
}
}
}
}
示例5: Write
public override void Write(bool fExplicit, MachineInstructionWriter writer)
{
Operand.Write(fExplicit, writer);
writer.Write(",");
writer.WriteOpcode(Opcode.ToString());
writer.Write(' ');
Shift.Write(fExplicit, writer);
}
示例6: Render
public override void Render(MachineInstructionWriter writer)
{
writer.WriteOpcode(Code.ToString());
if (Operand != null)
{
writer.Tab();
Operand.Write(true, writer);
}
}
示例7: Render
public override void Render(MachineInstructionWriter writer)
{
try
{
writer.WriteOpcode(mpopcodetostring[Opcode]);
}
catch
{
throw new NotImplementedException("Lolwut: " + Opcode);
}
}
示例8: Render
public override void Render(MachineInstructionWriter writer)
{
if (Code == Opcode.ex_af)
{
writer.WriteOpcode("ex");
writer.Tab();
writer.Write("af,af'");
return;
}
writer.WriteOpcode(Code.ToString());
if (Op1 != null)
{
writer.Tab();
Op1.Write(true, writer);
if (Op2 != null)
{
writer.Write(",");
Op2.Write(true, writer);
}
}
}
示例9: Render
public override void Render(MachineInstructionWriter writer)
{
writer.WriteOpcode(Opcode.ToString());
if (op1 != null)
{
writer.Tab();
OpToString(op1, writer);
if (op2 != null)
{
writer.Write(",");
OpToString(op2, writer);
}
}
}
示例10: Render
public override void Render(MachineInstructionWriter writer)
{
writer.WriteOpcode(opcode.ToString());
if (operands.Length > 0)
{
writer.Tab();
writer.Write(operands[0].ToString());
if (operands.Length > 1)
{
writer.Write(",");
writer.Write(operands[1].ToString());
}
}
}
示例11: Render
public override void Render(MachineInstructionWriter writer)
{
writer.WriteOpcode(this.Opcode.ToString());
writer.Tab();
bool sep = false;
foreach (var op in Operands)
{
if (sep)
writer.Write(',');
sep = true;
if (op is ImmediateOperand)
writer.Write('#');
op.Write(false, writer);
}
}
示例12: Render
public override void Render(MachineInstructionWriter writer)
{
writer.WriteOpcode(Opcode.ToString());
if (op1 == null)
return;
writer.Tab();
op1.Write(false, writer);
if (op2 == null)
return;
writer.Write(",");
op2.Write(false, writer);
if (op3 == null)
return;
writer.Write(",");
op3.Write(false, writer);
}
示例13: Render
public override void Render(MachineInstructionWriter writer)
{
writer.WriteOpcode(opcode.ToString());
if (op1 != null)
{
writer.Tab();
op1.Write(true, writer);
if (op2 != null)
{
writer.Write(',');
op2.Write(true, writer);
if (op3 != null)
{
writer.Write(',');
op3.Write(true, writer);
}
}
}
}
示例14: Render
public override void Render(MachineInstructionWriter writer)
{
string instrName;
if (!instrNames.TryGetValue(Opcode, out instrName))
{
instrName = Opcode.ToString();
}
writer.WriteOpcode(instrName);
writer.Tab();
var sep = "";
if (this.Operands != null)
{
foreach (var op in this.Operands)
{
writer.Write(sep);
op.Write(false, writer);
sep = ",";
}
}
}
示例15: Render
public override void Render(MachineInstructionWriter writer)
{
writer.WriteOpcode(instruction.Mnemonic);
var ops = Internal.ArchitectureDetail.Operands;
if (ops.Length < 1)
return;
writer.Tab();
Write(ops[0], writer);
if (ops.Length < 2)
return;
writer.Write(",");
Write(ops[1], writer);
if (ops.Length < 3)
return;
writer.Write(",");
Write(ops[2], writer);
if (ops.Length < 4)
return;
writer.Write(",");
Write(ops[3], writer);
}