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


C# IInstruction.Disassemble方法代码示例

本文整理汇总了C#中IInstruction.Disassemble方法的典型用法代码示例。如果您正苦于以下问题:C# IInstruction.Disassemble方法的具体用法?C# IInstruction.Disassemble怎么用?C# IInstruction.Disassemble使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IInstruction的用法示例。


在下文中一共展示了IInstruction.Disassemble方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LogInstruction

 private void LogInstruction(IInstruction instruction, byte opCode)
 {
     var instructionSize = instruction.Variants[opCode].InstructionSize();
     var instructionBytes = mem.SequenceFrom(state.Pc).Take(instructionSize).ToArray();
     Console.WriteLine("{0:X2}  {1,-10}{2,-32}A:{3:X2} X:{4:X2} Y:{5:X2} P:{6:X2} SP:{7:X2}", // TODO: Cycle and scanline goes at the end
         state.Pc,
         string.Join(" ", instructionBytes.Select(x => x.ToString("X2"))),
         instruction.Disassemble(instructionBytes),
         state.A,
         state.X,
         state.Y,
         state.StatusRegister,
         state.Sp);
 }
开发者ID:Cyberlane,项目名称:LeetNES,代码行数:14,代码来源:Cpu.cs

示例2: LogInstruction

 private void LogInstruction(IInstruction instruction, byte opCode)
 {
     var instructionSize = instruction.Variants[opCode].InstructionSize();
     var instructionBytes = mem.SequenceFrom(state.Pc).Take(instructionSize).ToArray();
     //if (false)
     {
         var contents = String.Format("{0:X4}  {1,-10}{2,-32}A:{3:X2} X:{4:X2} Y:{5:X2} P:{6:X2} SP:{7:X2} CYC:{8,3} SL:{9}\n", // TODO: Cycle and scanline goes at the end
             state.Pc,
             string.Join(" ", instructionBytes.Select(x => x.ToString("X2"))),
             instruction.Disassemble(instructionBytes, mem, state),
             state.A,
             state.X,
             state.Y,
             state.StatusRegister,
             state.Sp,
             cycle,
             scanline);
         instructionLog.Add(contents);
     //                File.AppendAllText("log.txt",
       //                  contents);
     }
 }
开发者ID:Dervall,项目名称:LeetNES,代码行数:22,代码来源:Cpu.cs


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