about summary refs log tree commit diff stats
path: root/subx/apps/dquotes.subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2019-05-10 17:14:07 -0700
committerKartik Agaram <vc@akkartik.com>2019-05-10 17:14:07 -0700
commitd3862d2b31fbe950c7c5687ca65edd6a7c13f65f (patch)
tree715387c512ad870189cee85b6513e8acb1d946ec /subx/apps/dquotes.subx
parent7e8dd370be9e53d1d02b37ebf129306c57966c3e (diff)
parent1ebb7614921a2b426ed84c4c51b100176e2a4187 (diff)
downloadmu-d3862d2b31fbe950c7c5687ca65edd6a7c13f65f.tar.gz
Merge branch 'master' into dquotes
apps/dquotes still segfaulting on native run.
Diffstat (limited to 'subx/apps/dquotes.subx')
-rw-r--r--subx/apps/dquotes.subx24
1 files changed, 24 insertions, 0 deletions
diff --git a/subx/apps/dquotes.subx b/subx/apps/dquotes.subx
index 715ec949..cd376f5d 100644
--- a/subx/apps/dquotes.subx
+++ b/subx/apps/dquotes.subx
@@ -22,12 +22,30 @@
 Entry:  # run tests if necessary, convert stdin if not
 
     # for debugging: run a single test
+#?     # . Heap = new-segment(4096)
+#?     # . . push args
+#?     68/push  Heap/imm32
+#?     68/push  0x1000/imm32
+#?     # . . call
+#?     e8/call  new-segment/disp32
+#?     # . . discard args
+#?     81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
+#?     # . test()
 #?     e8/call test-next-word-returns-string-with-escapes/disp32
 #?     8b/copy                         0/mod/indirect  5/rm32/.disp32            .             .           3/r32/EBX   Num-test-failures/disp32          # copy *Num-test-failures to EBX
 #?     eb/jump  $main:end/disp8
 
     # . prolog
     89/copy                         3/mod/direct    5/rm32/EBP    .           .             .           4/r32/ESP   .               .                 # copy ESP to EBP
+    # initialize heap
+    # . Heap = new-segment(4096)
+    # . . push args
+    68/push  Heap/imm32
+    68/push  0x1000/imm32
+    # . . call
+    e8/call  new-segment/disp32
+    # . . discard args
+    81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
     # - if argc > 1 and argv[1] == "test", then return run_tests()
     # . argc > 1
     81          7/subop/compare     1/mod/*+disp8   5/rm32/EBP    .           .             .           .           0/disp8         1/imm32           # compare *EBP
@@ -1532,6 +1550,12 @@ Segment-size:
 Next-string-literal:  # tracks the next auto-generated variable name
   1/imm32
 
+Heap:
+  # curr
+  0/imm32
+  # limit
+  0/imm32
+
 # abc/def/ghi
 _test-slice-word:
   61/a 62/b 63/c  # abc