本文整理汇总了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);
}
示例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);
}
}