about summary refs log tree commit diff stats
path: root/subx/075array-equal.subx
diff options
context:
space:
mode:
Diffstat (limited to 'subx/075array-equal.subx')
-rw-r--r--subx/075array-equal.subx17
1 files changed, 17 insertions, 0 deletions
diff --git a/subx/075array-equal.subx b/subx/075array-equal.subx
index ebc446d8..24f99b0c 100644
--- a/subx/075array-equal.subx
+++ b/subx/075array-equal.subx
@@ -6,6 +6,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:
+    # 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-compare-inequal-arrays-equal-lengths/disp32
@@ -244,4 +253,12 @@ test-compare-inequal-arrays-equal-lengths:
     5d/pop-to-EBP
     c3/return
 
+== data
+
+Heap:
+  # curr
+  0/imm32
+  # limit
+  0/imm32
+
 # . . vim:nowrap:textwidth=0