about summary refs log tree commit diff stats
path: root/subx/013indirect_addressing.cc
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-07-27 10:15:03 -0700
committerKartik Agaram <vc@akkartik.com>2018-07-27 10:15:03 -0700
commit3f4bbe9e5fd1389720c7adb5577edf2dc01d51e9 (patch)
tree61d80e20e59be711010dd4a1665afedc8d9bb93a /subx/013indirect_addressing.cc
parent667d21177b9d8fe3652710b818d13940b23511d7 (diff)
downloadmu-3f4bbe9e5fd1389720c7adb5577edf2dc01d51e9.tar.gz
4434
Key core data structures by hex bytes in text rather than opcode
numbers. Saves us round trips of having to parse and reparse strings,
and also allows us to more easily ignore unexpected non-hex words in
each transform. We'll use this ability next when we start inserting
labels.
Diffstat (limited to 'subx/013indirect_addressing.cc')
-rw-r--r--subx/013indirect_addressing.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/subx/013indirect_addressing.cc b/subx/013indirect_addressing.cc
index c192b35b..e908e17c 100644
--- a/subx/013indirect_addressing.cc
+++ b/subx/013indirect_addressing.cc
@@ -28,7 +28,7 @@ case 0:  // indirect addressing
 //:
 
 :(before "End Initialize Op Names(name)")
-put(name, 0x03, "add rm32 to r32");
+put(name, "03", "add rm32 to r32");
 
 :(scenario add_mem_at_r32_to_r32)
 % Reg[EAX].i = 0x60;
@@ -71,7 +71,7 @@ case 0x03: {  // add r/m32 to r32
 //:
 
 :(before "End Initialize Op Names(name)")
-put(name, 0x2b, "subtract rm32 from r32");
+put(name, "2b", "subtract rm32 from r32");
 
 :(scenario subtract_mem_at_r32_from_r32)
 % Reg[EAX].i = 0x60;
@@ -114,7 +114,7 @@ case 0x2b: {  // subtract r/m32 from r32
 //:
 
 :(before "End Initialize Op Names(name)")
-put(name, 0x23, "r32 = bitwise AND of r32 with rm32");
+put(name, "23", "r32 = bitwise AND of r32 with rm32");
 
 :(scenario and_mem_at_r32_with_r32)
 % Reg[EAX].i = 0x60;
@@ -157,7 +157,7 @@ case 0x23: {  // and r/m32 with r32
 //:
 
 :(before "End Initialize Op Names(name)")
-put(name, 0x0b, "r32 = bitwise OR of r32 with rm32");
+put(name, "0b", "r32 = bitwise OR of r32 with rm32");
 
 :(scenario or_mem_at_r32_with_r32)
 % Reg[EAX].i = 0x60;
@@ -200,7 +200,7 @@ case 0x0b: {  // or r/m32 with r32
 //:
 
 :(before "End Initialize Op Names(name)")
-put(name, 0x33, "r32 = bitwise XOR of r32 with rm32");
+put(name, "33", "r32 = bitwise XOR of r32 with rm32");
 
 :(scenario xor_mem_at_r32_with_r32)
 % Reg[EAX].i = 0x60;
@@ -283,7 +283,7 @@ ff 00 0f 0f  # 0x0f0f00ff
 //:
 
 :(before "End Initialize Op Names(name)")
-put(name, 0x3b, "set SF if rm32 > r32");
+put(name, "3b", "set SF if rm32 > r32");
 
 :(scenario compare_r32_with_mem_at_r32_greater)
 % Reg[EAX].i = 0x60;
@@ -356,7 +356,7 @@ case 0x3b: {  // set SF if r32 < r/m32
 //:
 
 :(before "End Initialize Op Names(name)")
-put(name, 0x8b, "copy rm32 to r32");
+put(name, "8b", "copy rm32 to r32");
 
 :(scenario copy_mem_at_r32_to_r32)
 % Reg[EAX].i = 0x60;
@@ -384,7 +384,7 @@ case 0x8b: {  // copy r32 to r/m32
 //:: jump
 
 :(before "End Initialize Op Names(name)")
-put(name, 0xff, "jump/push/call rm32 based on subop");
+put(name, "ff", "jump/push/call rm32 based on subop");
 
 :(scenario jump_mem_at_r32)
 % Reg[EAX].i = 0x60;
@@ -447,7 +447,7 @@ case 6: {  // push r/m32 to stack
 //:: pop
 
 :(before "End Initialize Op Names(name)")
-put(name, 0x8f, "pop top of stack to rm32");
+put(name, "8f", "pop top of stack to rm32");
 
 :(scenario pop_mem_at_r32)
 % Reg[EAX].i = 0x60;