当前位置: 首页>>代码示例>>C#>>正文


C# MachineInstructionWriter.WriteOpcode方法代码示例

本文整理汇总了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);
         }
     }
 }
开发者ID:killbug2004,项目名称:reko,代码行数:35,代码来源:M68kInstruction.cs

示例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);
 }
开发者ID:gh0std4ncer,项目名称:reko,代码行数:28,代码来源:Arm32Instruction.cs

示例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);
                     }
                 }
             }
         }
     }
 }
开发者ID:killbug2004,项目名称:reko,代码行数:32,代码来源:PowerPcInstruction.cs

示例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);
                 }
             }
         }
     }
 }
开发者ID:melbcat,项目名称:reko,代码行数:28,代码来源:ArmInstruction.cs

示例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);
 }
开发者ID:killbug2004,项目名称:reko,代码行数:8,代码来源:ShiftOperand.cs

示例6: Render

 public override void Render(MachineInstructionWriter writer)
 {
     writer.WriteOpcode(Code.ToString());
     if (Operand != null)
     {
         writer.Tab();
         Operand.Write(true, writer);
     }
 }
开发者ID:gitter-badger,项目名称:reko,代码行数:9,代码来源:Instruction.cs

示例7: Render

 public override void Render(MachineInstructionWriter writer)
 {
     try
     {
         writer.WriteOpcode(mpopcodetostring[Opcode]);
     }
     catch
     {
         throw new NotImplementedException("Lolwut: " + Opcode);
     }
 }
开发者ID:gh0std4ncer,项目名称:reko,代码行数:11,代码来源:CilInstruction.cs

示例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);
         }
     }
 }
开发者ID:gitter-badger,项目名称:reko,代码行数:21,代码来源:Z80Instruction.cs

示例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);
         }
     }
 }
开发者ID:gitter-badger,项目名称:reko,代码行数:14,代码来源:Pdp11Instruction.cs

示例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());
         }
     }
 }
开发者ID:uxmal,项目名称:reko,代码行数:14,代码来源:AvrInstruction.cs

示例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);
     }
 }
开发者ID:relaxar,项目名称:reko,代码行数:15,代码来源:VaxInstruction.cs

示例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);
 }
开发者ID:killbug2004,项目名称:reko,代码行数:16,代码来源:AArch64Instruction.cs

示例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);
             }
         }
     }
 }
开发者ID:gh0std4ncer,项目名称:reko,代码行数:19,代码来源:MipsInstruction.cs

示例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 = ",";
         }
     }
 }
开发者ID:relaxar,项目名称:reko,代码行数:20,代码来源:XtensaInstruction.cs

示例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);
 }
开发者ID:gitter-badger,项目名称:reko,代码行数:21,代码来源:AArch64Instruction.cs


注:本文中的MachineInstructionWriter.WriteOpcode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。