about summary refs log tree commit diff stats
path: root/subx/036global_variables.cc
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-09-28 23:08:27 -0700
committerKartik Agaram <vc@akkartik.com>2018-09-29 10:20:13 -0700
commit630433cd9cb97cf71d24bfc8fab6fb54ce40382a (patch)
treecf4cffae8599489e5efcbc18b965f804d5e3a8e8 /subx/036global_variables.cc
parentfd0cf1cd07ce01c3d6fe709d55b60ff9d1d5d44f (diff)
downloadmu-630433cd9cb97cf71d24bfc8fab6fb54ce40382a.tar.gz
4614 - redo simulated RAM
Now simulated 'Memory' isn't just a single flat array. Instead it knows
about segments and VMAs.

The code segment will always be first, and the data/heap segment will always
be second. The brk() syscall knows about the data segment.

One nice side-effect is that I no longer need to mess with Memory initialization
regardless of where I place my segments.
Diffstat (limited to 'subx/036global_variables.cc')
-rw-r--r--subx/036global_variables.cc6
1 files changed, 1 insertions, 5 deletions
diff --git a/subx/036global_variables.cc b/subx/036global_variables.cc
index 42790c0c..c565014f 100644
--- a/subx/036global_variables.cc
+++ b/subx/036global_variables.cc
@@ -7,8 +7,6 @@
 //: This layer much the same structure as rewriting labels.
 
 :(scenario global_variable)
-% Mem_offset = CODE_START;
-% Mem.resize(0x2000);
 == code
 b9/copy x/imm32  # copy to ECX
 == data
@@ -147,11 +145,9 @@ x:
 #? +error: can't call to the data segment ('x')
 
 :(scenario disp32_data_with_modrm)
-% Mem_offset = CODE_START;
-% Mem.resize(0x2000);
 == code
 8b/copy 0/mod/indirect 5/rm32/.disp32 2/r32/EDX x/disp32
-==
+== data
 x:
 00 00 00 00
 $error: 0