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
9 11:38:57 -0700 committer Kartik Agaram <vc@akkartik.com> 2019-07-19 11:38:57 -0700 5420' href='/akkartik/mu/commit/subx/translate?h=main&id=a03bbc827dc432b664b15f1c2f4ee8a3dca5c9f6'>a03bbc82 ^
880464a7 ^







dff67029 ^
880464a7 ^
531f14c9 ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22