about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--subx/012direct_addressing.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/subx/012direct_addressing.cc b/subx/012direct_addressing.cc
index d788904b..6352d90c 100644
--- a/subx/012direct_addressing.cc
+++ b/subx/012direct_addressing.cc
@@ -1,5 +1,14 @@
 //: operating directly on a register
 
+:(scenario add_r32_to_r32)
+% Reg[0].i = 0x10;
+% Reg[3].i = 1;
+# op  ModR/M  SIB   displacement  immediate
+  01  d8                                      # add EBX (reg 3) to EAX (reg 0)
++run: add reg 3 to effective address
++run: effective address is reg 0
++run: storing 0x00000011
+
 :(before "End Mod Special-cases")
 case 3:
   // mod 3 is just register direct addressing
@@ -8,3 +17,12 @@ case 3:
   break;
 
 //:: subtract
+
+:(scenario subtract_r32_from_r32)
+% Reg[0].i = 10;
+% Reg[3].i = 1;
+# op  ModR/M  SIB   displacement  immediate
+  29  d8                                      # subtract EBX (reg 3) from EAX (reg 0)
++run: subtract reg 3 from effective address
++run: effective address is reg 0
++run: storing 0x00000009