diff options
Diffstat (limited to 'src/display.rs')
| -rw-r--r-- | src/display.rs | 13 | 
1 files changed, 12 insertions, 1 deletions
| diff --git a/src/display.rs b/src/display.rs index b17cc90..fd9c101 100644 --- a/src/display.rs +++ b/src/display.rs @@ -935,7 +935,18 @@ impl fmt::Display for Operand {                  write!(f, "$+#{}", rel)              }              Operand::Gpr { reg } => { -                write!(f, "R{}", reg) +                const NAMES: [&'static str; 32] = [ +                    "R0", "R1", "R2", "R3", "R4", "R5", "R6", "R7", +                    "R8", "R9", "R10", "R11", "R12", "R13", "R14", "R15", +                    "R16", "R17", "R18", "R19", "R20", "R21", "R22", "R23", +                    "R24", "R25", "R26", "R27", +                    // the three R29 through R31 general registers support subroutines and the Software +                    // Stack. ... they have symbol aliases that indicate when these registers are accessed +                    // as subroutine and stack registers (V73 Section 2.1) +                    "R28", "SP", "FP", "LR", +                ]; + +                f.write_str(NAMES[*reg as usize])              }              Operand::Cr { reg } => {                  // V69 Table 2-2 Aliased control registers | 
