summaryrefslogtreecommitdiff
path: root/src/display.rs
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2025-04-09 22:02:49 -0700
committeriximeow <me@iximeow.net>2025-04-09 22:02:49 -0700
commitb9520a10c6086f9aa0417c9f9fbec42029f0dd20 (patch)
tree937f398dd7c84729dbdf059b3381fd58adfe2aff /src/display.rs
parent8f485c856fae8fef283f5391b49fcc0db8288ea5 (diff)
control, gpr register names, readme
Diffstat (limited to 'src/display.rs')
-rw-r--r--src/display.rs13
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