about summary refs log tree commit diff stats
path: root/subx/apps/crenshaw2-1b.subx
diff options
context:
space:
mode:
Diffstat (limited to 'subx/apps/crenshaw2-1b.subx')
-rw-r--r--subx/apps/crenshaw2-1b.subx9
1 files changed, 9 insertions, 0 deletions
diff --git a/subx/apps/crenshaw2-1b.subx b/subx/apps/crenshaw2-1b.subx
index 8dee0dbc..4f350cf4 100644
--- a/subx/apps/crenshaw2-1b.subx
+++ b/subx/apps/crenshaw2-1b.subx
@@ -31,6 +31,15 @@
 # . 1-3 bytes   3 bits              2 bits          3 bits        3 bits      3 bits        2 bits      2 bits      0/1/2/4 bytes   0/1/2/4 bytes
 
 Entry:  # run tests if necessary, call 'compile' if not
+    # initialize heap
+    # . Heap = new-segment(64KB)
+    # . . push args
+    68/push  Heap/imm32
+    68/push  0x10000/imm32/64KB
+    # . . call
+    e8/call  new-segment/disp32
+    # . . discard args
+    81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
 
 #?     # for debugging: run a single test; don't bother setting status code
 #?     e8/call test-get-num-reads-single-digit/disp32