about summary refs log tree commit diff stats
path: root/subx/012indirect_addressing.cc
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-07-10 20:27:21 -0700
committerKartik Agaram <vc@akkartik.com>2018-07-10 20:27:21 -0700
commit1a48f95a870559112eb7d3a6ecf236c78db13f5b (patch)
tree36176d111b2d8d5c4c79c2018209b3db272da913 /subx/012indirect_addressing.cc
parent5e2e2eb5da2bcbb0d4e485ecc73bb9697afa1bac (diff)
downloadmu-1a48f95a870559112eb7d3a6ecf236c78db13f5b.tar.gz
4338 - preliminary support for data segments
Diffstat (limited to 'subx/012indirect_addressing.cc')
-rw-r--r--subx/012indirect_addressing.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/subx/012indirect_addressing.cc b/subx/012indirect_addressing.cc
index 2901f8d5..304467f7 100644
--- a/subx/012indirect_addressing.cc
+++ b/subx/012indirect_addressing.cc
@@ -1,12 +1,15 @@
 //: operating on memory at the address provided by some register
+//: we'll now start providing data in a separate segment
 
 :(scenario add_r32_to_mem_at_r32)
 % Reg[3].i = 0x10;
 % Reg[0].i = 0x60;
-% write_mem_i32(0x60, 1);
+== 0x01  # code segment
 # op  ModR/M  SIB   displacement  immediate
   01  18                                     # add EBX to *EAX
 # ModR/M in binary: 00 (indirect mode) 011 (src EAX) 000 (dest EAX)
+== 0x60  # data segment
+01 00 00 00  # 1
 +run: add EBX to r/m32
 +run: effective address is 0x60 (EAX)
 +run: storing 0x00000011