public override void Write(MachineInstructionWriter writer, MachineInstructionWriterOptions options) { if (Index != null) { writer.WriteString("@"); writer.WriteString(Register.Name); writer.WriteString("+"); writer.WriteString(Index.Name); } else { if (DirectAddress != null) { writer.WriteString("["); if (DirectAddress is Constant c) { writer.WriteString(c.ToUInt16().ToString("X4")); } else { writer.WriteString(DirectAddress.ToString()); } writer.WriteString("]"); } else { writer.WriteString($"@{Register.Name}"); } } }
protected override void DoRender(MachineInstructionRenderer renderer, MachineInstructionRendererOptions options) { if (Index != null) { renderer.WriteString("@"); renderer.WriteString(Register !.Name); renderer.WriteString("+"); renderer.WriteString(Index.Name); } else { if (DirectAddress != null) { renderer.WriteString("["); if (DirectAddress is Constant c) { renderer.WriteString(c.ToUInt16().ToString("X4")); } else { renderer.WriteString(DirectAddress.ToString()); } renderer.WriteString("]"); } else { renderer.WriteString($"@{Register!.Name}"); } } }