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:21:17 -0700
committerKartik Agaram <vc@akkartik.com>2019-05-10 17:21:17 -0700
commitc12e85e1038f1118da0e22a810801b402a67a444 (patch)
treeb41ad0e2b9c6d90bed31a09e8ca1fe56438eeef8 /subx/apps/dquotes.subx
parent34a005d0fbe666a22d5fa164f9b7e466400c7d9d (diff)
parent1ebb7614921a2b426ed84c4c51b100176e2a4187 (diff)
downloadmu-c12e85e1038f1118da0e22a810801b402a67a444.tar.gz
Merge branch 'master' into dquotes-1
Segfault in this branch is now fixed.
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 514c2d06..e6b24698 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-emit-string-literal-data/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
@@ -1692,6 +1710,12 @@ Segment-size:
 Next-string-literal:  # tracks the next auto-generated variable name
   1/imm32
 
+Heap:
+  # curr
+  0/imm32
+  # limit
+  0/imm32
+
 # length-prefixed string containing just a single space
 Space:
     # size