about summary refs log tree commit diff stats
path: root/subx/apps/survey.subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2019-07-22 01:25:33 -0700
committerKartik Agaram <vc@akkartik.com>2019-07-22 01:25:33 -0700
commit37cf4e0581b586f0b28ab96876f43794323d4b60 (patch)
tree01b59189d287598ed0488bc9b0141cb0d1d6d960 /subx/apps/survey.subx
parentf2d63490706bb042ccc5f99104b17c380246cb93 (diff)
downloadmu-37cf4e0581b586f0b28ab96876f43794323d4b60.tar.gz
5443 - standard library is now self-hosted
Translates 5k lines of input in 26 seconds.

I'm not sure why I need to grow the label table. It was already 512 entries
long, and I'm only using 373 so far.
Diffstat (limited to 'subx/apps/survey.subx')
-rw-r--r--subx/apps/survey.subx14
1 files changed, 11 insertions, 3 deletions
diff --git a/subx/apps/survey.subx b/subx/apps/survey.subx
index 9bee7e16..8af8204c 100644
--- a/subx/apps/survey.subx
+++ b/subx/apps/survey.subx
@@ -136,16 +136,24 @@ convert:  # infile : (address buffered-file), out : (address buffered-file) -> <
     68/push  0/imm32/read
     68/push  0/imm32/write
     89/copy                         3/mod/direct    1/rm32/ECX    .           .             .           4/r32/ESP   .               .                 # copy ESP to ECX
-    # var labels/EDX = stream(512 * 16)
-    81          5/subop/subtract    3/mod/direct    4/rm32/ESP    .           .             .           .           .               0x2000/imm32      # subtract from ESP
-    68/push  0x2000/imm32/length
+    # var labels/EDX = stream(1024 * 16)
+    # . data
+    2b/subtract                     0/mod/indirect  5/rm32/.disp32            .             .           4/r32/ESP   Max-labels/disp32                 # subtract *Max-labels from ESP
+    # . length
+    ff          6/subop/push        0/mod/indirect  5/rm32/.disp32            .             .           .           Max-labels/disp32                 # push *Max-labels
+    # . read
     68/push  0/imm32/read
+    # . write
     68/push  0/imm32/write
     89/copy                         3/mod/direct    2/rm32/EDX    .           .             .           4/r32/ESP   .               .                 # copy ESP to EDX
     # var in/ESI = stream(Input-size * 1)
+    # . data
     2b/subtract                     0/mod/indirect  5/rm32/.disp32            .             .           4/r32/ESP   Input-size/disp32                 # subtract *Input-size from ESP
+    # . length
     ff          6/subop/push        0/mod/indirect  5/rm32/.disp32            .             .           .           Input-size/disp32                 # push *Input-size
+    # . read
     68/push  0/imm32/read
+    # . write
     68/push  0/imm32/write
     89/copy                         3/mod/direct    6/rm32/ESI    .           .             .           4/r32/ESP   .               .                 # copy ESP to ESI
 #?     # dump labels->write {{{