protected override void DoRender(MachineInstructionRenderer renderer, MachineInstructionRendererOptions options) { var memop = Operands[0] as PICOperandBankedMemory ?? throw new InvalidOperationException($"Invalid memory operand: {Operands[0]}"); renderer.WriteMnemonic(Mnemonic.ToString()); renderer.Tab(); var bankmem = PICMemoryDescriptor.CreateBankedAddr(memop); if (PICRegisters.TryGetAlwaysAccessibleRegister(bankmem, out var reg)) { renderer.WriteString($"{reg.Name}"); } else { Operands[0].Render(renderer, options); } }
public override void Render(MachineInstructionWriter writer, MachineInstructionWriterOptions options) { var memop = op1 as PICOperandBankedMemory ?? throw new InvalidOperationException($"Invalid memory operand: {op1}"); writer.WriteOpcode(Opcode.ToString()); writer.Tab(); var bankmem = PICMemoryDescriptor.CreateBankedAddr(memop); if (PICRegisters.TryGetAlwaysAccessibleRegister(bankmem, out var reg)) { writer.WriteString($"{reg.Name}"); } else { op1.Write(writer, options); } }