about summary refs log tree commit diff stats
path: root/subx/apps/pack.subx
diff options
context:
space:
mode:
Diffstat (limited to 'subx/apps/pack.subx')
-rw-r--r--subx/apps/pack.subx9
1 files changed, 9 insertions, 0 deletions
diff --git a/subx/apps/pack.subx b/subx/apps/pack.subx
index c035c361..74c21e88 100644
--- a/subx/apps/pack.subx
+++ b/subx/apps/pack.subx
@@ -19,6 +19,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, convert stdin 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
 #?     e8/call test-emit-non-number-with-all-hex-digits-and-metadata/disp32