about summary refs log tree commit diff stats
path: root/subx/072slice.subx
diff options
context:
space:
mode:
Diffstat (limited to 'subx/072slice.subx')
-rw-r--r--subx/072slice.subx16
1 files changed, 14 insertions, 2 deletions
diff --git a/subx/072slice.subx b/subx/072slice.subx
index 9c285097..683c4c7b 100644
--- a/subx/072slice.subx
+++ b/subx/072slice.subx
@@ -917,14 +917,26 @@ test-slice-to-string:
     # . prolog
     55/push-EBP
     89/copy                         3/mod/direct    5/rm32/EBP    .           .             .           4/r32/ESP   .               .                 # copy ESP to EBP
+    # var heap/EDX : (address allocation-descriptor) = {0, 0}
+    68/push  0/imm32/limit
+    68/push  0/imm32/curr
+    89/copy                         3/mod/direct    2/rm32/EDX    .           .             .           4/r32/ESP   .               .                 # copy ESP to EDX
+    # heap = new-segment(512)
+    # . . push args
+    52/push-EDX
+    68/push  0x200/imm32
+    # . . call
+    e8/call  new-segment/disp32
+    # . . discard args
+    81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
     # var slice/ECX = "Abc"
     68/push  _test-slice-data-3/imm32/end
     68/push  _test-slice-data-0/imm32/start
     89/copy                         3/mod/direct    1/rm32/ECX    .           .             .           4/r32/ESP   .               .                 # copy ESP to ECX
-    # EAX = slice-to-string(Heap, slice)
+    # EAX = slice-to-string(heap, slice)
     # . . push args
     51/push-ECX
-    68/push  Heap/imm32
+    52/push-EDX
     # . . call
     e8/call  slice-to-string/disp32
     # . . discard args