示例#1
0
文件: Dumper.cs 项目: qcyb/reko
        public bool DumpAssemblerLine(
            MemoryArea mem,
            IProcessorArchitecture arch,
            MachineInstruction instr,
            InstrWriter writer,
            MachineInstructionRendererOptions options)
        {
            var     instrAddress = instr.Address;
            Address addrBegin    = instrAddress;

            if (ShowAddresses)
            {
                writer.WriteFormat("{0} ", addrBegin);
            }
            if (ShowCodeBytes)
            {
                WriteOpcodes(mem, arch, instrAddress, instrAddress + instr.Length, writer);
                if (instr.Length * 3 < 16)
                {
                    writer.WriteString(new string(' ', 16 - (instr.Length * 3)));
                }
            }
            writer.WriteString("\t");
            instr.Render(writer, options);
            writer.WriteLine();
            return(true);
        }
示例#2
0
        public static LineSpan RenderAsmLine(Program program, MachineInstruction instr)
        {
            var line = new List <TextSpan>();
            var addr = instr.Address;

            line.Add(new AddressSpan(addr.ToString() + " ", addr, "link"));
            line.Add(new InstructionTextSpan(instr, BuildBytes(program, instr), "dasm-bytes"));
            var dfmt = new DisassemblyFormatter(program, instr, line);

            instr.Render(dfmt);
            dfmt.NewLine();
            return(new LineSpan(addr, line.ToArray()));
        }
示例#3
0
        public static LineSpan RenderAsmLine(
            object position,
            Program program,
            IProcessorArchitecture arch,
            MachineInstruction instr,
            MachineInstructionRendererOptions options)
        {
            var line = new List <TextSpan>();
            var addr = instr.Address;

            line.Add(new AddressSpan(addr.ToString() + " ", addr, "link"));
            line.Add(new InstructionTextSpan(instr, BuildBytes(program, arch, instr), "dasm-bytes"));
            var dfmt = new DisassemblyFormatter(program, arch, instr, line);

            instr.Render(dfmt, options);
            dfmt.NewLine();
            return(new LineSpan(position, line.ToArray()));
        }
示例#4
0
        public bool DumpAssemblerLine(MemoryArea mem, MachineInstruction instr, InstrWriter writer)
        {
            Address addrBegin = instr.Address;

            if (ShowAddresses)
            {
                writer.Write("{0} ", addrBegin);
            }
            if (ShowCodeBytes)
            {
                WriteByteRange(mem, instr.Address, instr.Address + instr.Length, writer);
                if (instr.Length * 3 < 16)
                {
                    writer.Write(new string(' ', 16 - (instr.Length * 3)));
                }
            }
            writer.Write("\t");
            instr.Render(writer);
            writer.WriteLine();
            return(true);
        }