From ec73ed1230d75deb0f913a32617c9f1e0a5ca640 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Fri, 10 Jul 2020 23:44:10 -0700 Subject: [PATCH] 6631 --- html/080zero-out.subx.html | 147 - ...50_write.subx.html => 101_write.subx.html} | 4 +- html/{051test.subx.html => 102test.subx.html} | 16 +- ....html => 103kernel-string-equal.subx.html} | 50 +- html/103screen.subx.html | 400 - ...ent.subx.html => 104new-segment.subx.html} | 8 +- ...al.subx.html => 105string-equal.subx.html} | 34 +- ...55stream.subx.html => 106stream.subx.html} | 4 +- ...{056trace.subx.html => 107trace.subx.html} | 212 +- ...{057write.subx.html => 108write.subx.html} | 36 +- ...al.subx.html => 109stream-equal.subx.html} | 140 +- html/{059stop.subx.html => 110stop.subx.html} | 16 +- html/{060read.subx.html => 111read.subx.html} | 94 +- ...-byte.subx.html => 112read-byte.subx.html} | 78 +- ...am.subx.html => 113write-stream.subx.html} | 66 +- ...{063error.subx.html => 114error.subx.html} | 14 +- ...byte.subx.html => 115write-byte.subx.html} | 66 +- ....subx.html => 116write-buffered.subx.html} | 48 +- ...x.subx.html => 117write-int-hex.subx.html} | 92 +- ...e-hex.subx.html => 118parse-hex.subx.html} | 116 +- ...byte.subx.html => 119error-byte.subx.html} | 20 +- ...locate.subx.html => 120allocate.subx.html} | 170 +- ...ream.subx.html => 121new-stream.subx.html} | 24 +- ...-line.subx.html => 122read-line.subx.html} | 104 +- ...{072slice.subx.html => 123slice.subx.html} | 128 +- ...oken.subx.html => 124next-token.subx.html} | 382 +- ...bx.html => 125write-stream-data.subx.html} | 34 +- ...bx.html => 126write-int-decimal.subx.html} | 106 +- ...-word.subx.html => 127next-word.subx.html} | 66 +- ...ords.subx.html => 128subx-words.subx.html} | 74 +- ...it-hex.subx.html => 129emit-hex.subx.html} | 86 +- html/{079emit.subx.html => 130emit.subx.html} | 130 +- ...{081table.subx.html => 131table.subx.html} | 456 +- ...{082slurp.subx.html => 132slurp.subx.html} | 34 +- ...ths.subx.html => 133subx-widths.subx.html} | 60 +- ....subx.html => 134emit-hex-array.subx.html} | 24 +- ....html => 135next-word-or-string.subx.html} | 128 +- ....subx.html => 201register-names.subx.html} | 4 +- ...e-int.subx.html => 202write-int.subx.html} | 34 +- ...{092stack.subx.html => 203stack.subx.html} | 90 +- ...ual.subx.html => 301array-equal.subx.html} | 74 +- ....subx.html => 302stack_allocate.subx.html} | 14 +- ...g.subx.html => 303kernel-string.subx.html} | 10 +- html/304screen.subx.html | 401 + ...yboard.subx.html => 305keyboard.subx.html} | 28 +- ...{105files.subx.html => 306files.subx.html} | 12 +- html/{106size.subx.html => 307size.subx.html} | 4 +- html/apps/arith.mu.html | 84 +- html/apps/assort.subx.html | 166 +- html/apps/braces.subx.html | 106 +- html/apps/browse.mu.html | 38 +- html/apps/calls.subx.html | 400 +- html/apps/crenshaw2-1.subx.html | 98 +- html/apps/crenshaw2-1b.subx.html | 162 +- html/apps/dquotes.subx.html | 394 +- html/apps/ex2.mu.html | 2 +- html/apps/ex2.subx.html | 10 +- html/apps/factorial.mu.html | 4 +- html/apps/factorial.subx.html | 20 +- html/apps/factorial2.subx.html | 12 +- html/apps/factorial3.subx.html | 8 +- html/apps/factorial4.subx.html | 8 +- html/apps/hex.subx.html | 342 +- html/apps/mu.subx.html | 38129 ++++++++-------- html/apps/mulisp.subx.html | 22 +- html/apps/pack.subx.html | 1356 +- html/apps/parse-int.mu.html | 4 +- html/apps/print-file.mu.html | 10 +- html/apps/random.subx.html | 10 +- html/apps/sigils.subx.html | 896 +- html/apps/survey.subx.html | 744 +- html/apps/tests.subx.html | 52 +- html/apps/tui.mu.html | 42 +- html/mu-init-test.subx.html | 4 +- html/mu-init.subx.html | 10 +- html/run_one_test.subx.html | 10 +- 76 files changed, 23830 insertions(+), 23651 deletions(-) delete mode 100644 html/080zero-out.subx.html rename html/{050_write.subx.html => 101_write.subx.html} (98%) rename html/{051test.subx.html => 102test.subx.html} (95%) rename html/{052kernel-string-equal.subx.html => 103kernel-string-equal.subx.html} (95%) delete mode 100644 html/103screen.subx.html rename html/{053new-segment.subx.html => 104new-segment.subx.html} (97%) rename html/{054string-equal.subx.html => 105string-equal.subx.html} (97%) rename html/{055stream.subx.html => 106stream.subx.html} (98%) rename html/{056trace.subx.html => 107trace.subx.html} (95%) rename html/{057write.subx.html => 108write.subx.html} (94%) rename html/{058stream-equal.subx.html => 109stream-equal.subx.html} (95%) rename html/{059stop.subx.html => 110stop.subx.html} (98%) rename html/{060read.subx.html => 111read.subx.html} (96%) rename html/{061read-byte.subx.html => 112read-byte.subx.html} (94%) rename html/{062write-stream.subx.html => 113write-stream.subx.html} (94%) rename html/{063error.subx.html => 114error.subx.html} (93%) rename html/{064write-byte.subx.html => 115write-byte.subx.html} (96%) rename html/{065write-buffered.subx.html => 116write-buffered.subx.html} (95%) rename html/{066write-int-hex.subx.html => 117write-int-hex.subx.html} (94%) rename html/{067parse-hex.subx.html => 118parse-hex.subx.html} (97%) rename html/{068error-byte.subx.html => 119error-byte.subx.html} (93%) rename html/{069allocate.subx.html => 120allocate.subx.html} (96%) rename html/{070new-stream.subx.html => 121new-stream.subx.html} (95%) rename html/{071read-line.subx.html => 122read-line.subx.html} (94%) rename html/{072slice.subx.html => 123slice.subx.html} (98%) rename html/{073next-token.subx.html => 124next-token.subx.html} (96%) rename html/{074write-stream-data.subx.html => 125write-stream-data.subx.html} (90%) rename html/{075write-int-decimal.subx.html => 126write-int-decimal.subx.html} (95%) rename html/{076next-word.subx.html => 127next-word.subx.html} (95%) rename html/{077subx-words.subx.html => 128subx-words.subx.html} (97%) rename html/{078emit-hex.subx.html => 129emit-hex.subx.html} (91%) rename html/{079emit.subx.html => 130emit.subx.html} (94%) rename html/{081table.subx.html => 131table.subx.html} (96%) rename html/{082slurp.subx.html => 132slurp.subx.html} (95%) rename html/{083subx-widths.subx.html => 133subx-widths.subx.html} (94%) rename html/{084emit-hex-array.subx.html => 134emit-hex-array.subx.html} (93%) rename html/{085next-word-or-string.subx.html => 135next-word-or-string.subx.html} (94%) rename html/{090register-names.subx.html => 201register-names.subx.html} (98%) rename html/{091write-int.subx.html => 202write-int.subx.html} (91%) rename html/{092stack.subx.html => 203stack.subx.html} (95%) rename html/{100array-equal.subx.html => 301array-equal.subx.html} (92%) rename html/{101stack_allocate.subx.html => 302stack_allocate.subx.html} (93%) rename html/{102kernel-string.subx.html => 303kernel-string.subx.html} (96%) create mode 100644 html/304screen.subx.html rename html/{104keyboard.subx.html => 305keyboard.subx.html} (95%) rename html/{105files.subx.html => 306files.subx.html} (93%) rename html/{106size.subx.html => 307size.subx.html} (94%) diff --git a/html/080zero-out.subx.html b/html/080zero-out.subx.html deleted file mode 100644 index 1c4b1fae..00000000 --- a/html/080zero-out.subx.html +++ /dev/null @@ -1,147 +0,0 @@ - - - - -Mu - 080zero-out.subx - - - - - - - - - - -https://github.com/akkartik/mu/blob/master/080zero-out.subx -
- 1 # Fill a region of memory with zeroes.
- 2 
- 3 == code
- 4 #   instruction                     effective address                                                   register    displacement    immediate
- 5 # . op          subop               mod             rm32          base        index         scale       r32
- 6 # . 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
- 7 
- 8 zero-out:  # start: (addr byte), len: int
- 9     # pseudocode:
-10     #   curr/esi = start
-11     #   i/ecx = 0
-12     #   while true
-13     #     if (i >= len) break
-14     #     *curr = 0
-15     #     ++curr
-16     #     ++i
-17     #
-18     # . prologue
-19     55/push-ebp
-20     89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
-21     # . save registers
-22     50/push-eax
-23     51/push-ecx
-24     52/push-edx
-25     56/push-esi
-26     # curr/esi = start
-27     8b/copy                         1/mod/*+disp8   5/rm32/ebp    .           .             .           6/r32/esi   8/disp8         .                 # copy *(ebp+8) to esi
-28     # var i/ecx: int = 0
-29     31/xor                          3/mod/direct    1/rm32/ecx    .           .             .           1/r32/ecx   .               .                 # clear ecx
-30     # edx = len
-31     8b/copy                         1/mod/*+disp8   5/rm32/ebp    .           .             .           2/r32/edx   0xc/disp8       .                 # copy *(ebp+12) to edx
-32 $zero-out:loop:
-33     # if (i >= len) break
-34     39/compare                      3/mod/direct    1/rm32/ecx    .           .             .           2/r32/edx   .               .                 # compare ecx with edx
-35     7d/jump-if->=  $zero-out:end/disp8
-36     # *curr = 0
-37     c6          0/subop/copy        0/mod/direct    6/rm32/esi    .           .             .           .           .               0/imm8            # copy byte to *esi
-38     # ++curr
-39     46/increment-esi
-40     # ++i
-41     41/increment-ecx
-42     eb/jump  $zero-out:loop/disp8
-43 $zero-out:end:
-44     # . restore registers
-45     5e/pop-to-esi
-46     5a/pop-to-edx
-47     59/pop-to-ecx
-48     58/pop-to-eax
-49     # . epilogue
-50     89/copy                         3/mod/direct    4/rm32/esp    .           .             .           5/r32/ebp   .               .                 # copy ebp to esp
-51     5d/pop-to-ebp
-52     c3/return
-53 
-54 test-zero-out:
-55     # . prologue
-56     55/push-ebp
-57     89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
-58     # region/ecx = 34, 35, 36, 37
-59     68/push  0x37363534/imm32
-60     89/copy                         3/mod/direct    1/rm32/ecx    .           .             .           4/r32/esp   .               .                 # copy esp to ecx
-61     # zero-out(ecx, 3)
-62     # . . push args
-63     68/push  3/imm32/len
-64     51/push-ecx
-65     # . . call
-66     e8/call  zero-out/disp32
-67     # . . discard args
-68     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
-69     # first 3 bytes cleared, fourth left alone
-70     # . check-ints-equal(*ecx, 0x37000000, msg)
-71     # . . push args
-72     68/push  "F - test-zero-out"/imm32
-73     68/push  0x37000000/imm32
-74     ff          6/subop/push        0/mod/indirect  1/rm32/ecx    .           .             .           .           .               .                 # push *ecx
-75     # . . call
-76     e8/call  check-ints-equal/disp32
-77     # . . discard args
-78     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
-79     # . epilogue
-80     89/copy                         3/mod/direct    4/rm32/esp    .           .             .           5/r32/ebp   .               .                 # copy ebp to esp
-81     5d/pop-to-ebp
-82     c3/return
-83 
-84 # . . vim:nowrap:textwidth=0
-
- - - diff --git a/html/050_write.subx.html b/html/101_write.subx.html similarity index 98% rename from html/050_write.subx.html rename to html/101_write.subx.html index 455e3886..7cc43cea 100644 --- a/html/050_write.subx.html +++ b/html/101_write.subx.html @@ -2,7 +2,7 @@ -Mu - 050_write.subx +Mu - 101_write.subx @@ -55,7 +55,7 @@ if ('onhashchange' in window) { -https://github.com/akkartik/mu/blob/master/050_write.subx +https://github.com/akkartik/mu/blob/master/101_write.subx
  1 # _write: write to a file descriptor (fd)
  2 
diff --git a/html/051test.subx.html b/html/102test.subx.html
similarity index 95%
rename from html/051test.subx.html
rename to html/102test.subx.html
index 04c1a2a7..dbd86b08 100644
--- a/html/051test.subx.html
+++ b/html/102test.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 051test.subx
+Mu - 102test.subx
 
 
 
@@ -55,7 +55,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/051test.subx
+https://github.com/akkartik/mu/blob/master/102test.subx
 
   1 # Rudimentary test harness
   2 
@@ -71,7 +71,7 @@ if ('onhashchange' in window) {
  12     68/push  34/imm32
  13     68/push  34/imm32
  14     # . . call
- 15     e8/call  check-ints-equal/disp32
+ 15     e8/call  check-ints-equal/disp32
  16     # . . discard args
  17     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  18     # syscall(exit, 0)
@@ -98,7 +98,7 @@ if ('onhashchange' in window) {
  39     68/push  "."/imm32
  40     68/push  2/imm32/stderr
  41     # . . call
- 42     e8/call  _write/disp32
+ 42     e8/call  _write/disp32
  43     # . . discard args
  44     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  45     # . return
@@ -111,19 +111,19 @@ if ('onhashchange' in window) {
  52     51/push-ecx
  53     68/push  2/imm32/stderr
  54     # . . call
- 55     e8/call  _write/disp32
+ 55     e8/call  _write/disp32
  56     # . . discard args
  57     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  58     # . _write(2/stderr, Newline)
  59     # . . push args
- 60     68/push  Newline/imm32
+ 60     68/push  Newline/imm32
  61     68/push  2/imm32/stderr
  62     # . . call
- 63     e8/call  _write/disp32
+ 63     e8/call  _write/disp32
  64     # . . discard args
  65     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  66     # increment Num-test-failures
- 67     ff          0/subop/increment   0/mod/indirect  5/rm32/.disp32            .             .           .           Num-test-failures/disp32          # increment *Num-test-failures
+ 67     ff          0/subop/increment   0/mod/indirect  5/rm32/.disp32            .             .           .           Num-test-failures/disp32          # increment *Num-test-failures
  68 $check-ints-equal:end:
  69     # . restore registers
  70     5b/pop-to-ebx
diff --git a/html/052kernel-string-equal.subx.html b/html/103kernel-string-equal.subx.html
similarity index 95%
rename from html/052kernel-string-equal.subx.html
rename to html/103kernel-string-equal.subx.html
index c6e76bf2..349ea4af 100644
--- a/html/052kernel-string-equal.subx.html
+++ b/html/103kernel-string-equal.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 052kernel-string-equal.subx
+Mu - 103kernel-string-equal.subx
 
 
 
@@ -58,7 +58,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/052kernel-string-equal.subx
+https://github.com/akkartik/mu/blob/master/103kernel-string-equal.subx
 
   1 # Checking null-terminated strings.
   2 #
@@ -87,10 +87,10 @@ if ('onhashchange' in window) {
  25 Entry:  # run all tests
  26     e8/call  run-tests/disp32  # 'run-tests' is a function created automatically by SubX. It calls all functions that start with 'test-'.
  27     # syscall(exit, Num-test-failures)
- 28     8b/copy                         0/mod/indirect  5/rm32/.disp32            .             .           3/r32/ebx   Num-test-failures/disp32          # copy *Num-test-failures to ebx
+ 28     8b/copy                         0/mod/indirect  5/rm32/.disp32            .             .           3/r32/ebx   Num-test-failures/disp32          # copy *Num-test-failures to ebx
  29     e8/call  syscall_exit/disp32
  30 
- 31 kernel-string-equal?:  # s: (addr kernel-string), benchmark: (addr array byte) -> eax: boolean
+ 31 kernel-string-equal?:  # s: (addr kernel-string), benchmark: (addr array byte) -> result/eax: boolean
  32     # pseudocode:
  33     #   n = benchmark->size
  34     #   s1 = s
@@ -184,9 +184,9 @@ if ('onhashchange' in window) {
 122     # eax = kernel-string-equal?(Null-kernel-string, "")
 123     # . . push args
 124     68/push  ""/imm32
-125     68/push  Null-kernel-string/imm32
+125     68/push  Null-kernel-string/imm32
 126     # . . call
-127     e8/call  kernel-string-equal?/disp32
+127     e8/call  kernel-string-equal?/disp32
 128     # . . discard args
 129     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 130     # check-ints-equal(eax, 1, msg)
@@ -195,7 +195,7 @@ if ('onhashchange' in window) {
 133     68/push  1/imm32/true
 134     50/push-eax
 135     # . . call
-136     e8/call  check-ints-equal/disp32
+136     e8/call  check-ints-equal/disp32
 137     # . . discard args
 138     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 139     c3/return
@@ -204,9 +204,9 @@ if ('onhashchange' in window) {
 142     # eax = kernel-string-equal?(Null-kernel-string, "Abc")
 143     # . . push args
 144     68/push  "Abc"/imm32
-145     68/push  Null-kernel-string/imm32
+145     68/push  Null-kernel-string/imm32
 146     # . . call
-147     e8/call  kernel-string-equal?/disp32
+147     e8/call  kernel-string-equal?/disp32
 148     # . . discard args
 149     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 150     # check-ints-equal(eax, 0, msg)
@@ -215,7 +215,7 @@ if ('onhashchange' in window) {
 153     68/push  0/imm32/false
 154     50/push-eax
 155     # . . call
-156     e8/call  check-ints-equal/disp32
+156     e8/call  check-ints-equal/disp32
 157     # . . discard args
 158     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 159     c3/return
@@ -224,9 +224,9 @@ if ('onhashchange' in window) {
 162     # eax = kernel-string-equal?(_test-Abc-kernel-string, "Abc")
 163     # . . push args
 164     68/push  "Abc"/imm32
-165     68/push  _test-Abc-kernel-string/imm32
+165     68/push  _test-Abc-kernel-string/imm32
 166     # . . call
-167     e8/call  kernel-string-equal?/disp32
+167     e8/call  kernel-string-equal?/disp32
 168     # . . discard args
 169     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 170     # check-ints-equal(eax, 1, msg)
@@ -235,7 +235,7 @@ if ('onhashchange' in window) {
 173     68/push  1/imm32/true
 174     50/push-eax
 175     # . . call
-176     e8/call  check-ints-equal/disp32
+176     e8/call  check-ints-equal/disp32
 177     # . . discard args
 178     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 179     c3/return
@@ -244,9 +244,9 @@ if ('onhashchange' in window) {
 182     # eax = kernel-string-equal?(_test-Abc-kernel-string, "Adc")
 183     # . . push args
 184     68/push  "Adc"/imm32
-185     68/push  _test-Abc-kernel-string/imm32
+185     68/push  _test-Abc-kernel-string/imm32
 186     # . . call
-187     e8/call  kernel-string-equal?/disp32
+187     e8/call  kernel-string-equal?/disp32
 188     # . . discard args
 189     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 190     # check-ints-equal(eax, 0, msg)
@@ -255,7 +255,7 @@ if ('onhashchange' in window) {
 193     68/push  0/imm32/false
 194     50/push-eax
 195     # . . call
-196     e8/call  check-ints-equal/disp32
+196     e8/call  check-ints-equal/disp32
 197     # . . discard args
 198     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 199     c3/return
@@ -264,9 +264,9 @@ if ('onhashchange' in window) {
 202     # eax = kernel-string-equal?(_test-Abc-kernel-string, "")
 203     # . . push args
 204     68/push  ""/imm32
-205     68/push  _test-Abc-kernel-string/imm32
+205     68/push  _test-Abc-kernel-string/imm32
 206     # . . call
-207     e8/call  kernel-string-equal?/disp32
+207     e8/call  kernel-string-equal?/disp32
 208     # . . discard args
 209     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 210     # check-ints-equal(eax, 0, msg)
@@ -275,7 +275,7 @@ if ('onhashchange' in window) {
 213     68/push  0/imm32/false
 214     50/push-eax
 215     # . . call
-216     e8/call  check-ints-equal/disp32
+216     e8/call  check-ints-equal/disp32
 217     # . . discard args
 218     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 219     c3/return
@@ -284,9 +284,9 @@ if ('onhashchange' in window) {
 222     # eax = kernel-string-equal?(_test-Abc-kernel-string, "Ab")
 223     # . . push args
 224     68/push  "Ab"/imm32
-225     68/push  _test-Abc-kernel-string/imm32
+225     68/push  _test-Abc-kernel-string/imm32
 226     # . . call
-227     e8/call  kernel-string-equal?/disp32
+227     e8/call  kernel-string-equal?/disp32
 228     # . . discard args
 229     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 230     # check-ints-equal(eax, 0, msg)
@@ -295,7 +295,7 @@ if ('onhashchange' in window) {
 233     68/push  0/imm32/false
 234     50/push-eax
 235     # . . call
-236     e8/call  check-ints-equal/disp32
+236     e8/call  check-ints-equal/disp32
 237     # . . discard args
 238     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 239     c3/return
@@ -304,9 +304,9 @@ if ('onhashchange' in window) {
 242     # eax = kernel-string-equal?(_test-Abc-kernel-string, "Abcd")
 243     # . . push args
 244     68/push  "Abcd"/imm32
-245     68/push  _test-Abc-kernel-string/imm32
+245     68/push  _test-Abc-kernel-string/imm32
 246     # . . call
-247     e8/call  kernel-string-equal?/disp32
+247     e8/call  kernel-string-equal?/disp32
 248     # . . discard args
 249     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 250     # check-ints-equal(eax, 0, msg)
@@ -315,7 +315,7 @@ if ('onhashchange' in window) {
 253     68/push  0/imm32/false
 254     50/push-eax
 255     # . . call
-256     e8/call  check-ints-equal/disp32
+256     e8/call  check-ints-equal/disp32
 257     # . . discard args
 258     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 259     c3/return
diff --git a/html/103screen.subx.html b/html/103screen.subx.html
deleted file mode 100644
index d84f6248..00000000
--- a/html/103screen.subx.html
+++ /dev/null
@@ -1,400 +0,0 @@
-
-
-
-
-Mu - 103screen.subx
-
-
-
-
-
-
-
-
-
-
-https://github.com/akkartik/mu/blob/master/103screen.subx
-
-  1 # Primitives for screen control.
-  2 # Require Linux and a modern terminal.
-  3 
-  4 == code
-  5 
-  6 enable-screen-grid-mode:
-  7     # . prologue
-  8     55/push-ebp
-  9     89/<- %ebp 4/r32/esp
- 10     #
- 11     (flush Stdout)
- 12     (flush Stderr)
- 13     # switch to second screen buffer
- 14     (write 2 Esc)
- 15     (write 2 "[?1049h")
- 16     #
- 17     (clear-screen)
- 18 $enable-screen-grid-mode:end:
- 19     # . epilogue
- 20     89/<- %esp 5/r32/ebp
- 21     5d/pop-to-ebp
- 22     c3/return
- 23 
- 24 enable-screen-type-mode:
- 25     # . prologue
- 26     55/push-ebp
- 27     89/<- %ebp 4/r32/esp
- 28     # switch to first screen buffer
- 29     (write 2 Esc)
- 30     (write 2 "[?1049l")
- 31 $enable-screen-type-mode:end:
- 32     # . epilogue
- 33     89/<- %esp 5/r32/ebp
- 34     5d/pop-to-ebp
- 35     c3/return
- 36 
- 37 screen-size:  # -> nrows/eax: int, ncols/ecx: int
- 38     # . prologue
- 39     55/push-ebp
- 40     89/<- %ebp 4/r32/esp
- 41     # . save registers
- 42     52/push-edx
- 43     53/push-ebx
- 44     56/push-esi
- 45     57/push-edi
- 46     #
- 47     (_maybe-open-terminal)
- 48     # var window-size-info/esi: (addr winsize)
- 49     # winsize is a type from the Linux kernel. We don't care how large it is.
- 50     81 5/subop/subtract %esp 0x40/imm32
- 51     89/<- %esi 4/r32/esp
- 52     # ioctl(*Terminal-file-descriptor, TIOCGWINSZ, window-size-info)
- 53     89/<- %edx 6/r32/esi
- 54     b9/copy-to-ecx 0x5413/imm32/TIOCGWINSZ
- 55     8b/-> *Terminal-file-descriptor 3/r32/ebx
- 56     e8/call syscall_ioctl/disp32
- 57     # some bitworking to extract 2 16-bit shorts
- 58     8b/-> *esi 0/r32/eax
- 59     81 4/subop/and %eax 0xffff/imm32
- 60     8b/-> *esi 1/r32/ecx
- 61     c1/shift 5/subop/logical-right %ecx 0x10/imm8
- 62 $screen-size:end:
- 63     # . reclaim locals
- 64     81 0/subop/add %esp 0x40/imm32
- 65     # . restore registers
- 66     5f/pop-to-edi
- 67     5e/pop-to-esi
- 68     5b/pop-to-ebx
- 69     5a/pop-to-edx
- 70     # . epilogue
- 71     89/<- %esp 5/r32/ebp
- 72     5d/pop-to-ebp
- 73     c3/return
- 74 
- 75 clear-screen:
- 76     # . prologue
- 77     55/push-ebp
- 78     89/<- %ebp 4/r32/esp
- 79     #
- 80     (write 2 Esc)
- 81     (write 2 "[H")
- 82     (write 2 Esc)
- 83     (write 2 "[2J")
- 84 $clear-screen:end:
- 85     # . epilogue
- 86     89/<- %esp 5/r32/ebp
- 87     5d/pop-to-ebp
- 88     c3/return
- 89 
- 90 # row and col count from the top-left as (1, 1)
- 91 move-cursor-on-screen:  # row: int, column: int
- 92     # . prologue
- 93     55/push-ebp
- 94     89/<- %ebp 4/r32/esp
- 95     # . save registers
- 96     51/push-ecx
- 97     # var buf/ecx: (stream byte 32)
- 98     81 5/subop/subtract %esp 0x20/imm32
- 99     68/push 0x20/imm32/size
-100     68/push 0/imm32/read
-101     68/push 0/imm32/write
-102     89/<- %ecx 4/r32/esp
-103     # construct directive in buf
-104     (write %ecx Esc)
-105     (write %ecx "[")
-106     (write-int32-decimal %ecx *(ebp+8))
-107     (write %ecx ";")
-108     (write-int32-decimal %ecx *(ebp+0xc))
-109     (write %ecx "H")
-110     # flush
-111     (write-stream 2 %ecx)
-112 $move-cursor-on-screen:end:
-113     # . reclaim locals
-114     81 0/subop/add %esp 0x2c/imm32
-115     # . restore registers
-116     59/pop-to-ecx
-117     # . epilogue
-118     89/<- %esp 5/r32/ebp
-119     5d/pop-to-ebp
-120     c3/return
-121 
-122 print-string-to-screen:  # s: (addr array byte)
-123     # . prologue
-124     55/push-ebp
-125     89/<- %ebp 4/r32/esp
-126     #
-127     (write 2 *(ebp+8))
-128 $print-string-to-screen:end:
-129     # . epilogue
-130     89/<- %esp 5/r32/ebp
-131     5d/pop-to-ebp
-132     c3/return
-133 
-134 # just because Mu has no support for global variables yet
-135 print-byte-to-screen:  # c: byte
-136     # . prologue
-137     55/push-ebp
-138     89/<- %ebp 4/r32/esp
-139     # . save registers
-140     51/push-ecx
-141     # var s/ecx: (addr array byte)
-142     ff 6/subop/push *(ebp+8)
-143     68/push 4/imm32/size
-144     89/<- %ecx 4/r32/esp
-145     (write 2 %ecx)
-146 $print-byte-to-screen:end:
-147     # . reclaim locals
-148     81 0/subop/add %esp 8/imm32
-149     # . restore registers
-150     59/pop-to-ecx
-151     # . epilogue
-152     89/<- %esp 5/r32/ebp
-153     5d/pop-to-ebp
-154     c3/return
-155 
-156 # just because Mu has no support for global variables yet
-157 print-int32-hex-to-screen:  # n: int
-158     # . prologue
-159     55/push-ebp
-160     89/<- %ebp 4/r32/esp
-161     #
-162     (write-int32-hex-buffered Stdout *(ebp+8))
-163     (flush Stdout)
-164 $print-int32-hex-to-screen:end:
-165     # . epilogue
-166     89/<- %esp 5/r32/ebp
-167     5d/pop-to-ebp
-168     c3/return
-169 
-170 reset-formatting-on-screen:
-171     # . prologue
-172     55/push-ebp
-173     89/<- %ebp 4/r32/esp
-174     #
-175     (write 2 Esc)
-176     (write 2 "(B")
-177     (write 2 Esc)
-178     (write 2 "[m")
-179 $reset-formatting-on-screen:end:
-180     # . epilogue
-181     89/<- %esp 5/r32/ebp
-182     5d/pop-to-ebp
-183     c3/return
-184 
-185 start-color-on-screen:  # fg: int, bg: int
-186     # . prologue
-187     55/push-ebp
-188     89/<- %ebp 4/r32/esp
-189     # . save registers
-190     51/push-ecx
-191     # var buf/ecx: (stream byte 32)
-192     81 5/subop/subtract %esp 0x20/imm32
-193     68/push 0x20/imm32/size
-194     68/push 0/imm32/read
-195     68/push 0/imm32/write
-196     89/<- %ecx 4/r32/esp
-197     # construct directive in buf
-198     # . set fg
-199     (write %ecx Esc)
-200     (write %ecx "[38;5;")
-201     (write-int32-decimal %ecx *(ebp+8))
-202     (write %ecx "m")
-203     # . set bg
-204     (write %ecx Esc)
-205     (write %ecx "[48;5;")
-206     (write-int32-decimal %ecx *(ebp+0xc))
-207     (write %ecx "m")
-208     # flush
-209     (write-stream 2 %ecx)
-210 $start-color-on-screen:end:
-211     # . reclaim locals
-212     81 0/subop/add %esp 0x2c/imm32
-213     # . restore registers
-214     59/pop-to-ecx
-215     # . epilogue
-216     89/<- %esp 5/r32/ebp
-217     5d/pop-to-ebp
-218     c3/return
-219 
-220 start-bold-on-screen:
-221     # . prologue
-222     55/push-ebp
-223     89/<- %ebp 4/r32/esp
-224     #
-225     (write 2 Esc)
-226     (write 2 "[1m")
-227 $start-bold-on-screen:end:
-228     # . epilogue
-229     89/<- %esp 5/r32/ebp
-230     5d/pop-to-ebp
-231     c3/return
-232 
-233 start-underline-on-screen:
-234     # . prologue
-235     55/push-ebp
-236     89/<- %ebp 4/r32/esp
-237     #
-238     (write 2 Esc)
-239     (write 2 "[4m")
-240 $start-underline-on-screen:end:
-241     # . epilogue
-242     89/<- %esp 5/r32/ebp
-243     5d/pop-to-ebp
-244     c3/return
-245 
-246 start-reverse-video-on-screen:
-247     # . prologue
-248     55/push-ebp
-249     89/<- %ebp 4/r32/esp
-250     #
-251     (write 2 Esc)
-252     (write 2 "[7m")
-253 $start-reverse-video-on-screen:end:
-254     # . epilogue
-255     89/<- %esp 5/r32/ebp
-256     5d/pop-to-ebp
-257     c3/return
-258 
-259 # might require enabling blinking in your terminal program
-260 start-blinking-on-screen:
-261     # . prologue
-262     55/push-ebp
-263     89/<- %ebp 4/r32/esp
-264     #
-265     (write 2 Esc)
-266     (write 2 "[5m")
-267 $start-blinking-on-screen:end:
-268     # . epilogue
-269     89/<- %esp 5/r32/ebp
-270     5d/pop-to-ebp
-271     c3/return
-272 
-273 hide-cursor-on-screen:
-274     # . prologue
-275     55/push-ebp
-276     89/<- %ebp 4/r32/esp
-277     #
-278     (write 2 Esc)
-279     (write 2 "[?25l")
-280 $hide-cursor-on-screen:end:
-281     # . epilogue
-282     89/<- %esp 5/r32/ebp
-283     5d/pop-to-ebp
-284     c3/return
-285 
-286 show-cursor-on-screen:
-287     # . prologue
-288     55/push-ebp
-289     89/<- %ebp 4/r32/esp
-290     #
-291     (write 2 Esc)
-292     (write 2 "[?12l")
-293     (write 2 Esc)
-294     (write 2 "[?25h")
-295 $show-cursor-on-screen:end:
-296     # . epilogue
-297     89/<- %esp 5/r32/ebp
-298     5d/pop-to-ebp
-299     c3/return
-300 
-301 # This is a low-level detail; I don't think everything should be a file.
-302 #
-303 # Open "/dev/tty" if necessary and cache its file descriptor in Terminal-file-descriptor
-304 # where later primitives can use it.
-305 _maybe-open-terminal:
-306     81 7/subop/compare *Terminal-file-descriptor -1/imm32
-307     75/jump-if-!= $_maybe-open-terminal:epilogue/disp8
-308     # . save registers
-309     50/push-eax
-310     51/push-ecx
-311     53/push-ebx
-312     # open("/dev/tty", O_RDWR)
-313     bb/copy-to-ebx Terminal-filename/imm32
-314     b9/copy-to-ecx 2/imm32/O_RDWR
-315     e8/call syscall_open/disp32
-316     89/<- *Terminal-file-descriptor 0/r32/eax
-317 $_maybe-open-terminal:end:
-318     # . restore registers
-319     5b/pop-to-ebx
-320     59/pop-to-ecx
-321     58/pop-to-eax
-322 $_maybe-open-terminal:epilogue:
-323     c3/return
-324 
-325 == data
-326 
-327 Terminal-file-descriptor:  # (addr int)
-328   -1/imm32
-329 
-330 Esc:  # (addr array byte)
-331   # size
-332   1/imm32
-333   # data
-334   0x1b
-335 
-336 Terminal-filename:  # (addr kernel-string)
-337   # "/dev/null"
-338   2f/slash 64/d 65/e 76/v 2f/slash 74/t 74/t 79/y 0/nul
-
- - - diff --git a/html/053new-segment.subx.html b/html/104new-segment.subx.html similarity index 97% rename from html/053new-segment.subx.html rename to html/104new-segment.subx.html index 8a9c8c1f..12967d38 100644 --- a/html/053new-segment.subx.html +++ b/html/104new-segment.subx.html @@ -2,7 +2,7 @@ -Mu - 053new-segment.subx +Mu - 104new-segment.subx @@ -56,7 +56,7 @@ if ('onhashchange' in window) { -https://github.com/akkartik/mu/blob/master/053new-segment.subx +https://github.com/akkartik/mu/blob/master/104new-segment.subx
  1 # Create a new segment (pool of memory for allocating chunks from) in the form
  2 # of an *allocation descriptor* that can be passed to the memory allocator
@@ -86,7 +86,7 @@ if ('onhashchange' in window) {
 26     51/push-ecx
 27     68/push  0x1000/imm32
 28     # . . call
-29     e8/call  new-segment/disp32
+29     e8/call  new-segment/disp32
 30     # . . discard args
 31     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 32     # var eax: (addr _) = ad->curr
@@ -108,7 +108,7 @@ if ('onhashchange' in window) {
 48     8b/copy                         1/mod/*+disp8   5/rm32/ebp    .           .             .           0/r32/eax   8/disp8         .                 # copy *(ebp+8) to eax
 49     89/copy                         0/mod/indirect  5/rm32/.disp32            .             .           0/r32/eax   $_mmap-new-segment:len/disp32     # copy eax to *$_mmap-new-segment:len
 50     # mmap(_mmap-new-segment)
-51     bb/copy-to-ebx  _mmap-new-segment/imm32
+51     bb/copy-to-ebx  _mmap-new-segment/imm32
 52     e8/call  syscall_mmap/disp32
 53     # copy {eax, eax+len} to *ad
 54     # . ebx = ad
diff --git a/html/054string-equal.subx.html b/html/105string-equal.subx.html
similarity index 97%
rename from html/054string-equal.subx.html
rename to html/105string-equal.subx.html
index c12a032b..ee06a1fb 100644
--- a/html/054string-equal.subx.html
+++ b/html/105string-equal.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 054string-equal.subx
+Mu - 105string-equal.subx
 
 
 
@@ -58,7 +58,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/054string-equal.subx
+https://github.com/akkartik/mu/blob/master/105string-equal.subx
 
   1 # Comparing 'regular' size-prefixed strings.
   2 
@@ -71,10 +71,10 @@ if ('onhashchange' in window) {
   9 #?     e8/call test-compare-equal-strings/disp32
  10     e8/call  run-tests/disp32  # 'run-tests' is a function created automatically by SubX. It calls all functions that start with 'test-'.
  11     # syscall(exit, Num-test-failures)
- 12     8b/copy                         0/mod/indirect  5/rm32/.disp32            .             .           3/r32/ebx   Num-test-failures/disp32          # copy *Num-test-failures to ebx
+ 12     8b/copy                         0/mod/indirect  5/rm32/.disp32            .             .           3/r32/ebx   Num-test-failures/disp32          # copy *Num-test-failures to ebx
  13     e8/call  syscall_exit/disp32
  14 
- 15 string-equal?:  # s: (addr array byte), benchmark: (addr array byte) -> eax: boolean
+ 15 string-equal?:  # s: (addr array byte), benchmark: (addr array byte) -> result/eax: boolean
  16     # pseudocode:
  17     #   if (s->size != benchmark->size) return false
  18     #   return string-starts-with?(s, benchmark)
@@ -103,7 +103,7 @@ if ('onhashchange' in window) {
  41     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
  42     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
  43     # . . call
- 44     e8/call  string-starts-with?/disp32
+ 44     e8/call  string-starts-with?/disp32
  45     # . . discard args
  46     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  47 $string-equal?:end:
@@ -116,7 +116,7 @@ if ('onhashchange' in window) {
  54     5d/pop-to-ebp
  55     c3/return
  56 
- 57 string-starts-with?:  # s: (addr array byte), benchmark: (addr array byte) -> eax: boolean
+ 57 string-starts-with?:  # s: (addr array byte), benchmark: (addr array byte) -> result/eax: boolean
  58     # pseudocode:
  59     #   if (s->size < benchmark->size) return false
  60     #   currs = s->data
@@ -204,7 +204,7 @@ if ('onhashchange' in window) {
 142     68/push  ""/imm32
 143     68/push  ""/imm32
 144     # . . call
-145     e8/call  string-equal?/disp32
+145     e8/call  string-equal?/disp32
 146     # . . discard args
 147     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 148     # check-ints-equal(eax, 1, msg)
@@ -213,7 +213,7 @@ if ('onhashchange' in window) {
 151     68/push  1/imm32/true
 152     50/push-eax
 153     # . . call
-154     e8/call  check-ints-equal/disp32
+154     e8/call  check-ints-equal/disp32
 155     # . . discard args
 156     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 157     c3/return
@@ -224,7 +224,7 @@ if ('onhashchange' in window) {
 162     68/push  "Abc"/imm32
 163     68/push  ""/imm32
 164     # . . call
-165     e8/call  string-equal?/disp32
+165     e8/call  string-equal?/disp32
 166     # . . discard args
 167     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 168     # check-ints-equal(eax, 0, msg)
@@ -233,7 +233,7 @@ if ('onhashchange' in window) {
 171     68/push  0/imm32/false
 172     50/push-eax
 173     # . . call
-174     e8/call  check-ints-equal/disp32
+174     e8/call  check-ints-equal/disp32
 175     # . . discard args
 176     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 177     c3/return
@@ -244,7 +244,7 @@ if ('onhashchange' in window) {
 182     68/push  "Abc"/imm32
 183     68/push  "Abc"/imm32
 184     # . . call
-185     e8/call  string-equal?/disp32
+185     e8/call  string-equal?/disp32
 186     # . . discard args
 187     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 188     # check-ints-equal(eax, 1, msg)
@@ -253,7 +253,7 @@ if ('onhashchange' in window) {
 191     68/push  1/imm32/true
 192     50/push-eax
 193     # . . call
-194     e8/call  check-ints-equal/disp32
+194     e8/call  check-ints-equal/disp32
 195     # . . discard args
 196     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 197     c3/return
@@ -264,7 +264,7 @@ if ('onhashchange' in window) {
 202     68/push  "Adc"/imm32
 203     68/push  "Abc"/imm32
 204     # . . call
-205     e8/call  string-equal?/disp32
+205     e8/call  string-equal?/disp32
 206     # . . discard args
 207     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 208     # check-ints-equal(eax, 0, msg)
@@ -273,7 +273,7 @@ if ('onhashchange' in window) {
 211     68/push  0/imm32/false
 212     50/push-eax
 213     # . . call
-214     e8/call  check-ints-equal/disp32
+214     e8/call  check-ints-equal/disp32
 215     # . . discard args
 216     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 217     c3/return
@@ -290,7 +290,7 @@ if ('onhashchange' in window) {
 228     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
 229     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
 230     # . . call
-231     e8/call  string-equal?/disp32
+231     e8/call  string-equal?/disp32
 232     # . . discard args
 233     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 234     # check-ints-equal(eax, 1, msg)
@@ -299,7 +299,7 @@ if ('onhashchange' in window) {
 237     68/push  1/imm32
 238     50/push-eax
 239     # . . call
-240     e8/call  check-ints-equal/disp32
+240     e8/call  check-ints-equal/disp32
 241     # . . discard args
 242     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 243 $check-strings-equal:end:
@@ -317,7 +317,7 @@ if ('onhashchange' in window) {
 255     68/push  "Abc"/imm32
 256     68/push  "Abc"/imm32
 257     # . . call
-258     e8/call  check-strings-equal/disp32
+258     e8/call  check-strings-equal/disp32
 259     # . . discard args
 260     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 261     c3/return
diff --git a/html/055stream.subx.html b/html/106stream.subx.html
similarity index 98%
rename from html/055stream.subx.html
rename to html/106stream.subx.html
index 50f3253d..f92d4a20 100644
--- a/html/055stream.subx.html
+++ b/html/106stream.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 055stream.subx
+Mu - 106stream.subx
 
 
 
@@ -55,7 +55,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/055stream.subx
+https://github.com/akkartik/mu/blob/master/106stream.subx
 
  1 # streams: data structure for operating on arrays in a stateful manner
  2 #
diff --git a/html/056trace.subx.html b/html/107trace.subx.html
similarity index 95%
rename from html/056trace.subx.html
rename to html/107trace.subx.html
index 3cb25ace..ce07967e 100644
--- a/html/056trace.subx.html
+++ b/html/107trace.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 056trace.subx
+Mu - 107trace.subx
 
 
 
@@ -59,7 +59,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/056trace.subx
+https://github.com/akkartik/mu/blob/master/107trace.subx
 
   1 # primitives for emitting traces to a 'trace' stream, and for tests to make assertions on its contents
   2 #
@@ -119,17 +119,17 @@ if ('onhashchange' in window) {
  56     8b/copy                         1/mod/*+disp8   5/rm32/ebp    .           .             .           1/r32/ecx   8/disp8         .                 # copy *(ebp+8) to ecx
  57     # Trace-segment = new-segment(n)
  58     # . . push args
- 59     68/push  Trace-segment/imm32
+ 59     68/push  Trace-segment/imm32
  60     51/push-ecx
  61     # . . call
- 62     e8/call  new-segment/disp32
+ 62     e8/call  new-segment/disp32
  63     # . . discard args
  64     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  65     # copy Trace-segment->curr to *Trace-stream
- 66     8b/copy                         0/mod/indirect  5/rm32/.disp32            .             .           0/r32/eax   Trace-segment/disp32              # copy *Trace-segment to eax
+ 66     8b/copy                         0/mod/indirect  5/rm32/.disp32            .             .           0/r32/eax   Trace-segment/disp32              # copy *Trace-segment to eax
  67 #?     # watch point to catch Trace-stream leaks
  68 #? $watch-1:
- 69     89/copy                         0/mod/indirect  5/rm32/.disp32            .             .           0/r32/eax   Trace-stream/disp32               # copy eax to *Trace-stream
+ 69     89/copy                         0/mod/indirect  5/rm32/.disp32            .             .           0/r32/eax   Trace-stream/disp32               # copy eax to *Trace-stream
  70     # Trace-stream->size = n - 12
  71     # . ecx -= 12
  72     81          5/subop/subtract    3/mod/direct    1/rm32/ecx    .           .             .           .           .               0xc/imm32         # subtract from ecx
@@ -158,7 +158,7 @@ if ('onhashchange' in window) {
  95     56/push-esi
  96     57/push-edi
  97     # var edi: (addr stream byte) = *Trace-stream
- 98     8b/copy                         0/mod/indirect  5/rm32/.disp32            .             .           7/r32/edi   Trace-stream/disp32               # copy *Trace-stream to edi
+ 98     8b/copy                         0/mod/indirect  5/rm32/.disp32            .             .           7/r32/edi   Trace-stream/disp32               # copy *Trace-stream to edi
  99     # esi = line
 100     8b/copy                         1/mod/*+disp8   5/rm32/ebp    .           .                         6/r32/esi   8/disp8         .                 # copy *(ebp+8) to esi
 101     # var ecx: int = t->write
@@ -175,7 +175,7 @@ if ('onhashchange' in window) {
 112     8d/copy-address                 1/mod/*+disp8   4/rm32/sib    7/base/edi  1/index/ecx   .           3/r32/ebx   0xc/disp8       .                 # copy edi+ecx+12 to ebx
 113     53/push-ebx
 114     # . . call
-115     e8/call  _append-3/disp32
+115     e8/call  _append-3/disp32
 116     # . . discard args
 117     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 118     # if (eax == 0) return
@@ -187,7 +187,7 @@ if ('onhashchange' in window) {
 124     8b/copy                         0/mod/indirect  7/rm32/edi    .           .             .           1/r32/ecx   .               .                 # copy *edi to ecx
 125     # eax = _append-3(&t->data[t->write], &t->data[t->size], line)
 126     # . . push line
-127     68/push  Newline/imm32
+127     68/push  Newline/imm32
 128     # . . push &t->data[t->size]
 129     8d/copy-address                 1/mod/*+disp8   4/rm32/sib    7/base/edi  2/index/edx   .           3/r32/ebx   0xc/disp8       .                 # copy edi+edx+12 to ebx
 130     53/push-ebx
@@ -195,7 +195,7 @@ if ('onhashchange' in window) {
 132     8d/copy-address                 1/mod/*+disp8   4/rm32/sib    7/base/edi  1/index/ecx   .           3/r32/ebx   0xc/disp8       .                 # copy edi+ecx+12 to ebx
 133     53/push-ebx
 134     # . . call
-135     e8/call  _append-3/disp32
+135     e8/call  _append-3/disp32
 136     # . . discard args
 137     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 138     # t->write += eax
@@ -215,17 +215,17 @@ if ('onhashchange' in window) {
 152 
 153 test-trace-single:
 154     # push *Trace-stream
-155     ff          6/subop/push        0/mod/indirect  5/rm32/.disp32            .             .           .           Trace-stream/disp32               # push *Trace-stream
+155     ff          6/subop/push        0/mod/indirect  5/rm32/.disp32            .             .           .           Trace-stream/disp32               # push *Trace-stream
 156     # *Trace-stream = _test-trace-stream
-157     b8/copy-to-eax  _test-trace-stream/imm32
-158     89/copy                         0/mod/indirect  5/rm32/.disp32            .             .           0/r32/eax   Trace-stream/disp32               # copy eax to *Trace-stream
+157     b8/copy-to-eax  _test-trace-stream/imm32
+158     89/copy                         0/mod/indirect  5/rm32/.disp32            .             .           0/r32/eax   Trace-stream/disp32               # copy eax to *Trace-stream
 159     # clear-trace-stream()
-160     e8/call  clear-trace-stream/disp32
+160     e8/call  clear-trace-stream/disp32
 161     # trace("Ab")
 162     # . . push args
 163     68/push  "Ab"/imm32
 164     # . . call
-165     e8/call  trace/disp32
+165     e8/call  trace/disp32
 166     # . . discard args
 167     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 168     # check-ints-equal(*_test-trace-stream->data, 41/A 62/b 0a/newline 00, msg)
@@ -233,37 +233,37 @@ if ('onhashchange' in window) {
 170     68/push  "F - test-trace-single"/imm32
 171     68/push  0x0a6241/imm32/Ab-newline
 172     # . . push *_test-trace-stream->data
-173     b8/copy-to-eax  _test-trace-stream/imm32
+173     b8/copy-to-eax  _test-trace-stream/imm32
 174     ff          6/subop/push        1/mod/*+disp8   0/rm32/eax    .           .             .           .           0xc/disp8       .                 # push *(eax+12)
 175     # . . call
-176     e8/call  check-ints-equal/disp32
+176     e8/call  check-ints-equal/disp32
 177     # . . discard args
 178     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 179     # pop into *Trace-stream
-180     8f          0/subop/pop         0/mod/indirect  5/rm32/.disp32            .             .           .           Trace-stream/disp32               # pop into *Trace-stream
+180     8f          0/subop/pop         0/mod/indirect  5/rm32/.disp32            .             .           .           Trace-stream/disp32               # pop into *Trace-stream
 181     # end
 182     c3/return
 183 
 184 test-trace-appends:
 185     # push *Trace-stream
-186     ff          6/subop/push        0/mod/indirect  5/rm32/.disp32            .             .           .           Trace-stream/disp32               # push *Trace-stream
+186     ff          6/subop/push        0/mod/indirect  5/rm32/.disp32            .             .           .           Trace-stream/disp32               # push *Trace-stream
 187     # *Trace-stream = _test-trace-stream
-188     b8/copy-to-eax  _test-trace-stream/imm32
-189     89/copy                         0/mod/indirect  5/rm32/.disp32            .             .           0/r32/eax   Trace-stream/disp32               # copy eax to *Trace-stream
+188     b8/copy-to-eax  _test-trace-stream/imm32
+189     89/copy                         0/mod/indirect  5/rm32/.disp32            .             .           0/r32/eax   Trace-stream/disp32               # copy eax to *Trace-stream
 190     # clear-trace-stream()
-191     e8/call  clear-trace-stream/disp32
+191     e8/call  clear-trace-stream/disp32
 192     # trace("C")
 193     # . . push args
 194     68/push  "C"/imm32
 195     # . . call
-196     e8/call  trace/disp32
+196     e8/call  trace/disp32
 197     # . . discard args
 198     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 199     # trace("D")
 200     # . . push args
 201     68/push  "D"/imm32
 202     # . . call
-203     e8/call  trace/disp32
+203     e8/call  trace/disp32
 204     # . . discard args
 205     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 206     # check-ints-equal(*_test-trace-stream->data, 43/C 0a/newline 44/D 0a/newline, msg)
@@ -271,30 +271,30 @@ if ('onhashchange' in window) {
 208     68/push  "F - test-trace-appends"/imm32
 209     68/push  0x0a440a43/imm32/C-newline-D-newline
 210     # . . push *_test-trace-stream->data
-211     b8/copy-to-eax  _test-trace-stream/imm32
+211     b8/copy-to-eax  _test-trace-stream/imm32
 212     ff          6/subop/push        1/mod/*+disp8   0/rm32/eax    .           .             .           .           0xc/disp8       .                 # push *(eax+12)
 213     # . . call
-214     e8/call  check-ints-equal/disp32
+214     e8/call  check-ints-equal/disp32
 215     # . . discard args
 216     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 217     # pop into *Trace-stream
-218     8f          0/subop/pop         0/mod/indirect  5/rm32/.disp32            .             .           .           Trace-stream/disp32               # pop into *Trace-stream
+218     8f          0/subop/pop         0/mod/indirect  5/rm32/.disp32            .             .           .           Trace-stream/disp32               # pop into *Trace-stream
 219     # end
 220     c3/return
 221 
 222 test-trace-empty-line:
 223     # push *Trace-stream
-224     ff          6/subop/push        0/mod/indirect  5/rm32/.disp32            .             .           .           Trace-stream/disp32               # push *Trace-stream
+224     ff          6/subop/push        0/mod/indirect  5/rm32/.disp32            .             .           .           Trace-stream/disp32               # push *Trace-stream
 225     # *Trace-stream = _test-trace-stream
-226     b8/copy-to-eax  _test-trace-stream/imm32
-227     89/copy                         0/mod/indirect  5/rm32/.disp32            .             .           0/r32/eax   Trace-stream/disp32               # copy eax to *Trace-stream
+226     b8/copy-to-eax  _test-trace-stream/imm32
+227     89/copy                         0/mod/indirect  5/rm32/.disp32            .             .           0/r32/eax   Trace-stream/disp32               # copy eax to *Trace-stream
 228     # clear-trace-stream()
-229     e8/call  clear-trace-stream/disp32
+229     e8/call  clear-trace-stream/disp32
 230     # trace("")
 231     # . . push args
 232     68/push  ""/imm32
 233     # . . call
-234     e8/call  trace/disp32
+234     e8/call  trace/disp32
 235     # . . discard args
 236     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 237     # check-ints-equal(*_test-trace-stream->data, 0, msg)
@@ -302,14 +302,14 @@ if ('onhashchange' in window) {
 239     68/push  "F - test-trace-empty-line"/imm32
 240     68/push  0/imm32
 241     # . . push *_test-trace-stream->data
-242     b8/copy-to-eax  _test-trace-stream/imm32
+242     b8/copy-to-eax  _test-trace-stream/imm32
 243     ff          6/subop/push        1/mod/*+disp8   0/rm32/eax    .           .             .           .           0xc/disp8       .                 # push *(eax+12)
 244     # . . call
-245     e8/call  check-ints-equal/disp32
+245     e8/call  check-ints-equal/disp32
 246     # . . discard args
 247     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 248     # pop into *Trace-stream
-249     8f          0/subop/pop         0/mod/indirect  5/rm32/.disp32            .             .           .           Trace-stream/disp32               # pop into *Trace-stream
+249     8f          0/subop/pop         0/mod/indirect  5/rm32/.disp32            .             .           .           Trace-stream/disp32               # pop into *Trace-stream
 250     # end
 251     c3/return
 252 
@@ -319,9 +319,9 @@ if ('onhashchange' in window) {
 256     89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
 257     # rewind-stream(*Trace-stream)
 258     # . . push args
-259     ff          6/subop/push        0/mod/indirect  5/rm32/.disp32            .             .           .           Trace-stream/disp32               # push *Trace-stream
+259     ff          6/subop/push        0/mod/indirect  5/rm32/.disp32            .             .           .           Trace-stream/disp32               # push *Trace-stream
 260     # . . call
-261     e8/call  rewind-stream/disp32
+261     e8/call  rewind-stream/disp32
 262     # . . discard args
 263     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 264     # check-trace-scans-to(line, msg)
@@ -329,7 +329,7 @@ if ('onhashchange' in window) {
 266     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
 267     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
 268     # . . call
-269     e8/call  check-trace-scans-to/disp32
+269     e8/call  check-trace-scans-to/disp32
 270     # . . discard args
 271     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 272 $check-trace-contains:end:
@@ -348,7 +348,7 @@ if ('onhashchange' in window) {
 285     # . . push args
 286     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
 287     # . . call
-288     e8/call  trace-scan/disp32
+288     e8/call  trace-scan/disp32
 289     # . . discard args
 290     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 291     # check-ints-equal(eax, 1, msg)
@@ -357,7 +357,7 @@ if ('onhashchange' in window) {
 294     68/push  1/imm32
 295     50/push-eax
 296     # . . call
-297     e8/call check-ints-equal/disp32
+297     e8/call check-ints-equal/disp32
 298     # . . discard args
 299     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 300 $check-trace-scans-to:end:
@@ -390,7 +390,7 @@ if ('onhashchange' in window) {
 327     51/push-ecx
 328     56/push-esi
 329     # esi = *Trace-stream
-330     8b/copy                         0/mod/indirect  5/rm32/.disp32            .             .           6/r32/esi   Trace-stream/disp32               # copy *Trace-stream to esi
+330     8b/copy                         0/mod/indirect  5/rm32/.disp32            .             .           6/r32/esi   Trace-stream/disp32               # copy *Trace-stream to esi
 331     # ecx = Trace-stream->write
 332     8b/copy                         0/mod/indirect  6/rm32/esi    .           .             .           1/r32/ecx                   .                 # copy *esi to ecx
 333     # push Trace-stream->read
@@ -404,7 +404,7 @@ if ('onhashchange' in window) {
 341     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
 342     56/push-esi
 343     # . . call
-344     e8/call  next-line-matches?/disp32
+344     e8/call  next-line-matches?/disp32
 345     # . . discard args
 346     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 347     # if (eax == false) continue
@@ -415,7 +415,7 @@ if ('onhashchange' in window) {
 352     # . . push args
 353     56/push-esi
 354     # . . call
-355     e8/call  skip-next-line/disp32
+355     e8/call  skip-next-line/disp32
 356     # . . discard args
 357     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 358     # dump saved copy of Trace-stream->read
@@ -428,7 +428,7 @@ if ('onhashchange' in window) {
 365     # . . push args
 366     56/push-esi
 367     # . . call
-368     e8/call  skip-next-line/disp32
+368     e8/call  skip-next-line/disp32
 369     # . . discard args
 370     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 371     eb/jump  $trace-scan:loop/disp8
@@ -447,25 +447,25 @@ if ('onhashchange' in window) {
 384 
 385 test-trace-scan-first:
 386     # push *Trace-stream
-387     ff          6/subop/push        0/mod/indirect  5/rm32/.disp32            .             .           .           Trace-stream/disp32               # push *Trace-stream
+387     ff          6/subop/push        0/mod/indirect  5/rm32/.disp32            .             .           .           Trace-stream/disp32               # push *Trace-stream
 388     # setup
 389     # . *Trace-stream = _test-trace-stream
-390     b8/copy-to-eax  _test-trace-stream/imm32
-391     89/copy                         0/mod/indirect  5/rm32/.disp32            .             .           0/r32/eax   Trace-stream/disp32               # copy eax to *Trace-stream
+390     b8/copy-to-eax  _test-trace-stream/imm32
+391     89/copy                         0/mod/indirect  5/rm32/.disp32            .             .           0/r32/eax   Trace-stream/disp32               # copy eax to *Trace-stream
 392     # . clear-trace-stream()
-393     e8/call  clear-trace-stream/disp32
+393     e8/call  clear-trace-stream/disp32
 394     # . trace("Ab")
 395     # . . push args
 396     68/push  "Ab"/imm32
 397     # . . call
-398     e8/call  trace/disp32
+398     e8/call  trace/disp32
 399     # . . discard args
 400     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 401     # eax = trace-scan("Ab")
 402     # . . push args
 403     68/push  "Ab"/imm32
 404     # . . call
-405     e8/call  trace-scan/disp32
+405     e8/call  trace-scan/disp32
 406     # . . discard args
 407     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 408     # check-ints-equal(eax, 1, msg)
@@ -474,42 +474,42 @@ if ('onhashchange' in window) {
 411     68/push  1/imm32
 412     50/push-eax
 413     # . . call
-414     e8/call check-ints-equal/disp32
+414     e8/call check-ints-equal/disp32
 415     # . . discard args
 416     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 417     # pop into *Trace-stream
-418     8f          0/subop/pop         0/mod/indirect  5/rm32/.disp32            .             .           .           Trace-stream/disp32               # pop into *Trace-stream
+418     8f          0/subop/pop         0/mod/indirect  5/rm32/.disp32            .             .           .           Trace-stream/disp32               # pop into *Trace-stream
 419     # . end
 420     c3/return
 421 
 422 test-trace-scan-skips-lines-until-found:
 423     # push *Trace-stream
-424     ff          6/subop/push        0/mod/indirect  5/rm32/.disp32            .             .           .           Trace-stream/disp32               # push *Trace-stream
+424     ff          6/subop/push        0/mod/indirect  5/rm32/.disp32            .             .           .           Trace-stream/disp32               # push *Trace-stream
 425     # setup
 426     # . *Trace-stream = _test-trace-stream
-427     b8/copy-to-eax  _test-trace-stream/imm32
-428     89/copy                         0/mod/indirect  5/rm32/.disp32            .             .           0/r32/eax   Trace-stream/disp32               # copy eax to *Trace-stream
+427     b8/copy-to-eax  _test-trace-stream/imm32
+428     89/copy                         0/mod/indirect  5/rm32/.disp32            .             .           0/r32/eax   Trace-stream/disp32               # copy eax to *Trace-stream
 429     # . clear-trace-stream()
-430     e8/call  clear-trace-stream/disp32
+430     e8/call  clear-trace-stream/disp32
 431     # . trace("Ab")
 432     # . . push args
 433     68/push  "Ab"/imm32
 434     # . . call
-435     e8/call  trace/disp32
+435     e8/call  trace/disp32
 436     # . . discard args
 437     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 438     # . trace("cd")
 439     # . . push args
 440     68/push  "cd"/imm32
 441     # . . call
-442     e8/call  trace/disp32
+442     e8/call  trace/disp32
 443     # . . discard args
 444     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 445     # eax = trace-scan("cd")
 446     # . . push args
 447     68/push  "cd"/imm32
 448     # . . call
-449     e8/call  trace-scan/disp32
+449     e8/call  trace-scan/disp32
 450     # . . discard args
 451     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 452     # check-ints-equal(eax, 1, msg)
@@ -518,35 +518,35 @@ if ('onhashchange' in window) {
 455     68/push  1/imm32
 456     50/push-eax
 457     # . . call
-458     e8/call check-ints-equal/disp32
+458     e8/call check-ints-equal/disp32
 459     # . . discard args
 460     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 461     # pop into *Trace-stream
-462     8f          0/subop/pop         0/mod/indirect  5/rm32/.disp32            .             .           .           Trace-stream/disp32               # pop into *Trace-stream
+462     8f          0/subop/pop         0/mod/indirect  5/rm32/.disp32            .             .           .           Trace-stream/disp32               # pop into *Trace-stream
 463     # . end
 464     c3/return
 465 
 466 test-trace-second-scan-starts-where-first-left-off:
 467     # push *Trace-stream
-468     ff          6/subop/push        0/mod/indirect  5/rm32/.disp32            .             .           .           Trace-stream/disp32               # push *Trace-stream
+468     ff          6/subop/push        0/mod/indirect  5/rm32/.disp32            .             .           .           Trace-stream/disp32               # push *Trace-stream
 469     # setup
 470     # . *Trace-stream = _test-trace-stream
-471     b8/copy-to-eax  _test-trace-stream/imm32
-472     89/copy                         0/mod/indirect  5/rm32/.disp32            .             .           0/r32/eax   Trace-stream/disp32               # copy eax to *Trace-stream
+471     b8/copy-to-eax  _test-trace-stream/imm32
+472     89/copy                         0/mod/indirect  5/rm32/.disp32            .             .           0/r32/eax   Trace-stream/disp32               # copy eax to *Trace-stream
 473     # . clear-trace-stream()
-474     e8/call  clear-trace-stream/disp32
+474     e8/call  clear-trace-stream/disp32
 475     # . trace("Ab")
 476     # . . push args
 477     68/push  "Ab"/imm32
 478     # . . call
-479     e8/call  trace/disp32
+479     e8/call  trace/disp32
 480     # . . discard args
 481     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 482     # . eax = trace-scan("Ab")
 483     # . . push args
 484     68/push  "Ab"/imm32
 485     # . . call
-486     e8/call  trace-scan/disp32
+486     e8/call  trace-scan/disp32
 487     # . . discard args
 488     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 489     # second scan fails
@@ -554,7 +554,7 @@ if ('onhashchange' in window) {
 491     # . . push args
 492     68/push  "Ab"/imm32
 493     # . . call
-494     e8/call  trace-scan/disp32
+494     e8/call  trace-scan/disp32
 495     # . . discard args
 496     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 497     # check-ints-equal(eax, 0, msg)
@@ -563,38 +563,38 @@ if ('onhashchange' in window) {
 500     68/push  0/imm32
 501     50/push-eax
 502     # . . call
-503     e8/call check-ints-equal/disp32
+503     e8/call check-ints-equal/disp32
 504     # . . discard args
 505     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 506     # pop into *Trace-stream
-507     8f          0/subop/pop         0/mod/indirect  5/rm32/.disp32            .             .           .           Trace-stream/disp32               # pop into *Trace-stream
+507     8f          0/subop/pop         0/mod/indirect  5/rm32/.disp32            .             .           .           Trace-stream/disp32               # pop into *Trace-stream
 508     # . end
 509     c3/return
 510 
 511 test-trace-scan-failure-leaves-read-index-untouched:
 512     # push *Trace-stream
-513     ff          6/subop/push        0/mod/indirect  5/rm32/.disp32            .             .           .           Trace-stream/disp32               # push *Trace-stream
+513     ff          6/subop/push        0/mod/indirect  5/rm32/.disp32            .             .           .           Trace-stream/disp32               # push *Trace-stream
 514     # setup
 515     # . *Trace-stream = _test-trace-stream
-516     b8/copy-to-eax  _test-trace-stream/imm32
-517     89/copy                         0/mod/indirect  5/rm32/.disp32            .             .           0/r32/eax   Trace-stream/disp32               # copy eax to *Trace-stream
+516     b8/copy-to-eax  _test-trace-stream/imm32
+517     89/copy                         0/mod/indirect  5/rm32/.disp32            .             .           0/r32/eax   Trace-stream/disp32               # copy eax to *Trace-stream
 518     # . clear-trace-stream()
-519     e8/call  clear-trace-stream/disp32
+519     e8/call  clear-trace-stream/disp32
 520     # . trace("Ab")
 521     # . . push args
 522     68/push  "Ab"/imm32
 523     # . . call
-524     e8/call  trace/disp32
+524     e8/call  trace/disp32
 525     # . . discard args
 526     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 527     # . check-ints-equal(_test-trace-stream->read, 0, msg)
 528     # . . push args
-529     68/push  "F - test-trace-second-scan-starts-where-first-left-off/precondition-failure"/imm32
+529     68/push  "F - test-trace-second-scan-starts-where-first-left-off/precondition-failure"/imm32
 530     68/push  0/imm32
-531     b8/copy-to-eax  _test-trace-stream/imm32
+531     b8/copy-to-eax  _test-trace-stream/imm32
 532     ff          6/subop/push        1/mod/*+disp8   0/rm32/eax    .           .             .           .           4/disp8         .                 # push *(eax+4)
 533     # . . call
-534     e8/call check-ints-equal/disp32
+534     e8/call check-ints-equal/disp32
 535     # . . discard args
 536     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 537     # perform a failing scan
@@ -602,7 +602,7 @@ if ('onhashchange' in window) {
 539     # . . push args
 540     68/push  "Ax"/imm32
 541     # . . call
-542     e8/call  trace-scan/disp32
+542     e8/call  trace-scan/disp32
 543     # . . discard args
 544     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 545     # no change in read index
@@ -610,14 +610,14 @@ if ('onhashchange' in window) {
 547     # . . push args
 548     68/push  "F - test-trace-second-scan-starts-where-first-left-off"/imm32
 549     68/push  0/imm32
-550     b8/copy-to-eax  _test-trace-stream/imm32
+550     b8/copy-to-eax  _test-trace-stream/imm32
 551     ff          6/subop/push        1/mod/*+disp8   0/rm32/eax    .           .             .           .           4/disp8         .                 # push *(eax+4)
 552     # . . call
-553     e8/call check-ints-equal/disp32
+553     e8/call check-ints-equal/disp32
 554     # . . discard args
 555     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 556     # pop into *Trace-stream
-557     8f          0/subop/pop         0/mod/indirect  5/rm32/.disp32            .             .           .           Trace-stream/disp32               # pop into *Trace-stream
+557     8f          0/subop/pop         0/mod/indirect  5/rm32/.disp32            .             .           .           Trace-stream/disp32               # pop into *Trace-stream
 558     # . end
 559     c3/return
 560 
@@ -717,9 +717,9 @@ if ('onhashchange' in window) {
 654     # . eax = next-line-matches?(_test-stream-line-ABABA, "blah blah")
 655     # . . push args
 656     68/push  "blah blah"/imm32
-657     68/push  _test-stream-line-ABABA/imm32
+657     68/push  _test-stream-line-ABABA/imm32
 658     # . . call
-659     e8/call  next-line-matches?/disp32
+659     e8/call  next-line-matches?/disp32
 660     # . . discard args
 661     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 662     # . check-ints-equal(eax, 0, msg)
@@ -728,7 +728,7 @@ if ('onhashchange' in window) {
 665     68/push  0/imm32
 666     50/push-eax
 667     # . . call
-668     e8/call  check-ints-equal/disp32
+668     e8/call  check-ints-equal/disp32
 669     # . . discard args
 670     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 671     c3/return
@@ -738,9 +738,9 @@ if ('onhashchange' in window) {
 675     # . eax = next-line-matches?(_test-stream-line-ABABA, "")
 676     # . . push args
 677     68/push  ""/imm32
-678     68/push  _test-stream-line-ABABA/imm32
+678     68/push  _test-stream-line-ABABA/imm32
 679     # . . call
-680     e8/call  next-line-matches?/disp32
+680     e8/call  next-line-matches?/disp32
 681     # . . discard args
 682     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 683     # . check-ints-equal(eax, 0, msg)
@@ -749,7 +749,7 @@ if ('onhashchange' in window) {
 686     68/push  0/imm32
 687     50/push-eax
 688     # . . call
-689     e8/call  check-ints-equal/disp32
+689     e8/call  check-ints-equal/disp32
 690     # . . discard args
 691     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 692     c3/return
@@ -759,9 +759,9 @@ if ('onhashchange' in window) {
 696     # . eax = next-line-matches?(_test-stream-line-ABABA, "AA")
 697     # . . push args
 698     68/push  "AA"/imm32
-699     68/push  _test-stream-line-ABABA/imm32
+699     68/push  _test-stream-line-ABABA/imm32
 700     # . . call
-701     e8/call  next-line-matches?/disp32
+701     e8/call  next-line-matches?/disp32
 702     # . . discard args
 703     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 704     # . check-ints-equal(eax, 0, msg)
@@ -770,7 +770,7 @@ if ('onhashchange' in window) {
 707     68/push  0/imm32
 708     50/push-eax
 709     # . . call
-710     e8/call  check-ints-equal/disp32
+710     e8/call  check-ints-equal/disp32
 711     # . . discard args
 712     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 713     c3/return
@@ -780,9 +780,9 @@ if ('onhashchange' in window) {
 717     # . eax = next-line-matches?(_test-stream-line-ABABA, "ABABA")
 718     # . . push args
 719     68/push  "ABABA"/imm32
-720     68/push  _test-stream-line-ABABA/imm32
+720     68/push  _test-stream-line-ABABA/imm32
 721     # . . call
-722     e8/call  next-line-matches?/disp32
+722     e8/call  next-line-matches?/disp32
 723     # . . discard args
 724     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 725     # . check-ints-equal(eax, 1, msg)
@@ -791,7 +791,7 @@ if ('onhashchange' in window) {
 728     68/push  1/imm32
 729     50/push-eax
 730     # . . call
-731     e8/call  check-ints-equal/disp32
+731     e8/call  check-ints-equal/disp32
 732     # . . discard args
 733     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 734     c3/return
@@ -865,20 +865,20 @@ if ('onhashchange' in window) {
 802     # skipping next line in empty stream leaves read pointer at 0
 803     # . skip-next-line(_test-stream-empty)
 804     # . . push args
-805     68/push  _test-stream-empty/imm32
+805     68/push  _test-stream-empty/imm32
 806     # . . call
-807     e8/call  skip-next-line/disp32
+807     e8/call  skip-next-line/disp32
 808     # . . discard args
 809     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 810     # . check-ints-equal(_test-stream-empty->read, 0, msg)
 811     # . . push args
 812     68/push  "F - test-skip-next-line-empty"/imm32
 813     68/push  0/imm32
-814     b8/copy-to-eax  _test-stream-empty/imm32
+814     b8/copy-to-eax  _test-stream-empty/imm32
 815     8b/copy                         1/mod/*+disp8   0/rm32/eax    .           .             .           0/r32/eax   4/disp8         .                 # copy *(eax+4) to eax
 816     50/push-eax
 817     # . . call
-818     e8/call  check-ints-equal/disp32
+818     e8/call  check-ints-equal/disp32
 819     # . . discard args
 820     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 821     c3/return
@@ -887,20 +887,20 @@ if ('onhashchange' in window) {
 824     # skipping next line increments read pointer by length of line + 1 (for newline)
 825     # . skip-next-line(_test-stream-filled)
 826     # . . push args
-827     68/push  _test-stream-filled/imm32
+827     68/push  _test-stream-filled/imm32
 828     # . . call
-829     e8/call  skip-next-line/disp32
+829     e8/call  skip-next-line/disp32
 830     # . . discard args
 831     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 832     # . check-ints-equal(_test-stream-filled->read, 5, msg)
 833     # . . push args
 834     68/push  "F - test-skip-next-line-filled"/imm32
 835     68/push  5/imm32
-836     b8/copy-to-eax  _test-stream-filled/imm32
+836     b8/copy-to-eax  _test-stream-filled/imm32
 837     8b/copy                         1/mod/*+disp8   0/rm32/eax    .           .             .           0/r32/eax   4/disp8         .                 # copy *(eax+4) to eax
 838     50/push-eax
 839     # . . call
-840     e8/call  check-ints-equal/disp32
+840     e8/call  check-ints-equal/disp32
 841     # . . discard args
 842     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 843     c3/return
@@ -911,9 +911,9 @@ if ('onhashchange' in window) {
 848     89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
 849     # clear-stream(*Trace-stream)
 850     # . . push args
-851     ff          6/subop/push        0/mod/indirect  5/rm32/.disp32            .             .           .           Trace-stream/disp32               # push *Trace-stream
+851     ff          6/subop/push        0/mod/indirect  5/rm32/.disp32            .             .           .           Trace-stream/disp32               # push *Trace-stream
 852     # . . call
-853     e8/call  clear-stream/disp32
+853     e8/call  clear-stream/disp32
 854     # . . discard args
 855     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 856 $clear-trace-stream:end:
@@ -945,7 +945,7 @@ if ('onhashchange' in window) {
 882     # . . push out
 883     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
 884     # . . call
-885     e8/call  _append-4/disp32
+885     e8/call  _append-4/disp32
 886     # . . discard args
 887     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
 888 $_append-3:end:
@@ -1012,7 +1012,7 @@ if ('onhashchange' in window) {
 949     68/push  "stream overflow\n"/imm32
 950     68/push  2/imm32/stderr
 951     # . . call
-952     e8/call  _write/disp32
+952     e8/call  _write/disp32
 953     # . . discard args
 954     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 955     # . syscall(exit, 1)
diff --git a/html/057write.subx.html b/html/108write.subx.html
similarity index 94%
rename from html/057write.subx.html
rename to html/108write.subx.html
index 84323fa5..6760ec55 100644
--- a/html/057write.subx.html
+++ b/html/108write.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 057write.subx
+Mu - 108write.subx
 
 
 
@@ -56,7 +56,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/057write.subx
+https://github.com/akkartik/mu/blob/master/108write.subx
 
   1 # write: like _write, but also support in-memory streams in addition to file
   2 # descriptors.
@@ -92,7 +92,7 @@ if ('onhashchange' in window) {
  32     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
  33     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
  34     # . . call
- 35     e8/call  _write/disp32
+ 35     e8/call  _write/disp32
  36     # . . discard args
  37     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  38     eb/jump  $write:end/disp8
@@ -119,7 +119,7 @@ if ('onhashchange' in window) {
  59     8d/copy-address                 1/mod/*+disp8   4/rm32/sib    1/base/ecx  2/index/edx   .           3/r32/ebx   0xc/disp8       .                 # copy ecx+edx+12 to ebx
  60     53/push-ebx
  61     # . . call
- 62     e8/call  _append-3/disp32
+ 62     e8/call  _append-3/disp32
  63     # . . discard args
  64     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  65     # f->write += eax
@@ -138,17 +138,17 @@ if ('onhashchange' in window) {
  78 test-write-single:
  79     # clear-stream(_test-stream)
  80     # . . push args
- 81     68/push  _test-stream/imm32
+ 81     68/push  _test-stream/imm32
  82     # . . call
- 83     e8/call  clear-stream/disp32
+ 83     e8/call  clear-stream/disp32
  84     # . . discard args
  85     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  86     # write(_test-stream, "Ab")
  87     # . . push args
  88     68/push  "Ab"/imm32
- 89     68/push  _test-stream/imm32
+ 89     68/push  _test-stream/imm32
  90     # . . call
- 91     e8/call  write/disp32
+ 91     e8/call  write/disp32
  92     # . . discard args
  93     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  94     # check-ints-equal(*_test-stream->data, 41/A 62/b 00 00, msg)
@@ -156,10 +156,10 @@ if ('onhashchange' in window) {
  96     68/push  "F - test-write-single"/imm32
  97     68/push  0x006241/imm32/Ab
  98     # . . push *_test-stream->data
- 99     b8/copy-to-eax  _test-stream/imm32
+ 99     b8/copy-to-eax  _test-stream/imm32
 100     ff          6/subop/push        1/mod/*+disp8   0/rm32/eax    .           .             .           .           0xc/disp8       .                 # push *(eax+12)
 101     # . . call
-102     e8/call  check-ints-equal/disp32
+102     e8/call  check-ints-equal/disp32
 103     # . . discard args
 104     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 105     # end
@@ -168,25 +168,25 @@ if ('onhashchange' in window) {
 108 test-write-appends:
 109     # clear-stream(_test-stream)
 110     # . . push args
-111     68/push  _test-stream/imm32
+111     68/push  _test-stream/imm32
 112     # . . call
-113     e8/call  clear-stream/disp32
+113     e8/call  clear-stream/disp32
 114     # . . discard args
 115     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 116     # write(_test-stream, "C")
 117     # . . push args
 118     68/push  "C"/imm32
-119     68/push  _test-stream/imm32
+119     68/push  _test-stream/imm32
 120     # . . call
-121     e8/call  write/disp32
+121     e8/call  write/disp32
 122     # . . discard args
 123     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 124     # write(_test-stream, "D")
 125     # . . push args
 126     68/push  "D"/imm32
-127     68/push  _test-stream/imm32
+127     68/push  _test-stream/imm32
 128     # . . call
-129     e8/call  write/disp32
+129     e8/call  write/disp32
 130     # . . discard args
 131     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 132     # check-ints-equal(*_test-stream->data, 43/C 44/D 00 00, msg)
@@ -194,10 +194,10 @@ if ('onhashchange' in window) {
 134     68/push  "F - test-write-appends"/imm32
 135     68/push  0x00004443/imm32/C-D
 136     # . . push *_test-stream->data
-137     b8/copy-to-eax  _test-stream/imm32
+137     b8/copy-to-eax  _test-stream/imm32
 138     ff          6/subop/push        1/mod/*+disp8   0/rm32/eax    .           .             .           .           0xc/disp8       .                 # push *(eax+12)
 139     # . . call
-140     e8/call  check-ints-equal/disp32
+140     e8/call  check-ints-equal/disp32
 141     # . . discard args
 142     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 143     # end
diff --git a/html/058stream-equal.subx.html b/html/109stream-equal.subx.html
similarity index 95%
rename from html/058stream-equal.subx.html
rename to html/109stream-equal.subx.html
index eafe819c..7c5a78f0 100644
--- a/html/058stream-equal.subx.html
+++ b/html/109stream-equal.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 058stream-equal.subx
+Mu - 109stream-equal.subx
 
 
 
@@ -55,7 +55,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/058stream-equal.subx
+https://github.com/akkartik/mu/blob/master/109stream-equal.subx
 
   1 # some primitives for checking stream contents
   2 
@@ -65,7 +65,7 @@ if ('onhashchange' in window) {
   6 # . 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
   7 
   8 # compare all the data in a stream (ignoring the read pointer)
-  9 stream-data-equal?:  # f: (addr stream byte), s: (addr array byte) -> eax: boolean
+  9 stream-data-equal?:  # f: (addr stream byte), s: (addr array byte) -> result/eax: boolean
  10     # . prologue
  11     55/push-ebp
  12     89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
@@ -132,25 +132,25 @@ if ('onhashchange' in window) {
  73     89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
  74     # clear-stream(_test-stream)
  75     # . . push args
- 76     68/push  _test-stream/imm32
+ 76     68/push  _test-stream/imm32
  77     # . . call
- 78     e8/call  clear-stream/disp32
+ 78     e8/call  clear-stream/disp32
  79     # . . discard args
  80     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  81     # write(_test-stream, "Abc")
  82     # . . push args
  83     68/push  "Abc"/imm32
- 84     68/push  _test-stream/imm32
+ 84     68/push  _test-stream/imm32
  85     # . . call
- 86     e8/call  write/disp32
+ 86     e8/call  write/disp32
  87     # . . discard args
  88     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  89     # eax = stream-data-equal?(_test-stream, "Abc")
  90     # . . push args
  91     68/push  "Abc"/imm32
- 92     68/push  _test-stream/imm32
+ 92     68/push  _test-stream/imm32
  93     # . . call
- 94     e8/call  stream-data-equal?/disp32
+ 94     e8/call  stream-data-equal?/disp32
  95     # . . discard args
  96     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  97     # check-ints-equal(eax, 1, msg)
@@ -159,7 +159,7 @@ if ('onhashchange' in window) {
 100     68/push  1/imm32
 101     50/push-eax
 102     # . . call
-103     e8/call  check-ints-equal/disp32
+103     e8/call  check-ints-equal/disp32
 104     # . . discard args
 105     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 106     # . epilogue
@@ -173,25 +173,25 @@ if ('onhashchange' in window) {
 114     89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
 115     # clear-stream(_test-stream)
 116     # . . push args
-117     68/push  _test-stream/imm32
+117     68/push  _test-stream/imm32
 118     # . . call
-119     e8/call  clear-stream/disp32
+119     e8/call  clear-stream/disp32
 120     # . . discard args
 121     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 122     # write(_test-stream, "Abc")
 123     # . . push args
 124     68/push  "Abc"/imm32
-125     68/push  _test-stream/imm32
+125     68/push  _test-stream/imm32
 126     # . . call
-127     e8/call  write/disp32
+127     e8/call  write/disp32
 128     # . . discard args
 129     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 130     # eax = stream-data-equal?(_test-stream, "Abd")
 131     # . . push args
 132     68/push  "Abd"/imm32
-133     68/push  _test-stream/imm32
+133     68/push  _test-stream/imm32
 134     # . . call
-135     e8/call  stream-data-equal?/disp32
+135     e8/call  stream-data-equal?/disp32
 136     # . . discard args
 137     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 138     # check-ints-equal(eax, 0, msg)
@@ -200,7 +200,7 @@ if ('onhashchange' in window) {
 141     68/push  0/imm32
 142     50/push-eax
 143     # . . call
-144     e8/call  check-ints-equal/disp32
+144     e8/call  check-ints-equal/disp32
 145     # . . discard args
 146     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 147     # . epilogue
@@ -214,25 +214,25 @@ if ('onhashchange' in window) {
 155     89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
 156     # clear-stream(_test-stream)
 157     # . . push args
-158     68/push  _test-stream/imm32
+158     68/push  _test-stream/imm32
 159     # . . call
-160     e8/call  clear-stream/disp32
+160     e8/call  clear-stream/disp32
 161     # . . discard args
 162     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 163     # write(_test-stream, "Abc")
 164     # . . push args
 165     68/push  "Abc"/imm32
-166     68/push  _test-stream/imm32
+166     68/push  _test-stream/imm32
 167     # . . call
-168     e8/call  write/disp32
+168     e8/call  write/disp32
 169     # . . discard args
 170     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 171     # eax = stream-data-equal?(_test-stream, "Abcd")
 172     # . . push args
 173     68/push  "Abcd"/imm32
-174     68/push  _test-stream/imm32
+174     68/push  _test-stream/imm32
 175     # . . call
-176     e8/call  stream-data-equal?/disp32
+176     e8/call  stream-data-equal?/disp32
 177     # . . discard args
 178     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 179     # check-ints-equal(eax, 0, msg)
@@ -241,7 +241,7 @@ if ('onhashchange' in window) {
 182     68/push  0/imm32
 183     50/push-eax
 184     # . . call
-185     e8/call  check-ints-equal/disp32
+185     e8/call  check-ints-equal/disp32
 186     # . . discard args
 187     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 188     # . epilogue
@@ -261,7 +261,7 @@ if ('onhashchange' in window) {
 202     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
 203     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
 204     # . . call
-205     e8/call  stream-data-equal?/disp32
+205     e8/call  stream-data-equal?/disp32
 206     # . . discard args
 207     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 208     # check-ints-equal(eax, 1, msg)
@@ -270,7 +270,7 @@ if ('onhashchange' in window) {
 211     68/push  1/imm32
 212     50/push-eax
 213     # . . call
-214     e8/call  check-ints-equal/disp32
+214     e8/call  check-ints-equal/disp32
 215     # . . discard args
 216     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 217 $check-stream-equal:end:
@@ -286,7 +286,7 @@ if ('onhashchange' in window) {
 227 # on success, set f->read to after the next newline
 228 # on failure, leave f->read unmodified
 229 # this function is usually used only in tests, so we repeatedly write f->read
-230 next-stream-line-equal?:  # f: (addr stream byte), s: (addr array byte) -> eax: boolean
+230 next-stream-line-equal?:  # f: (addr stream byte), s: (addr array byte) -> result/eax: boolean
 231     # pseudocode:
 232     #   currf = f->read  # bound: f->write
 233     #   currs = 0  # bound: s->size
@@ -395,25 +395,25 @@ if ('onhashchange' in window) {
 336     89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
 337     # clear-stream(_test-stream)
 338     # . . push args
-339     68/push  _test-stream/imm32
+339     68/push  _test-stream/imm32
 340     # . . call
-341     e8/call  clear-stream/disp32
+341     e8/call  clear-stream/disp32
 342     # . . discard args
 343     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 344     # write(_test-stream, "Abc\ndef")
 345     # . . push args
 346     68/push  "Abc\ndef"/imm32
-347     68/push  _test-stream/imm32
+347     68/push  _test-stream/imm32
 348     # . . call
-349     e8/call  write/disp32
+349     e8/call  write/disp32
 350     # . . discard args
 351     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 352     # eax = next-stream-line-equal?(_test-stream, "Abc")
 353     # . . push args
 354     68/push  "Abc"/imm32
-355     68/push  _test-stream/imm32
+355     68/push  _test-stream/imm32
 356     # . . call
-357     e8/call  next-stream-line-equal?/disp32
+357     e8/call  next-stream-line-equal?/disp32
 358     # . . discard args
 359     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 360     # check-ints-equal(eax, 1, msg)
@@ -422,7 +422,7 @@ if ('onhashchange' in window) {
 363     68/push  1/imm32
 364     50/push-eax
 365     # . . call
-366     e8/call  check-ints-equal/disp32
+366     e8/call  check-ints-equal/disp32
 367     # . . discard args
 368     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 369     # . epilogue
@@ -436,25 +436,25 @@ if ('onhashchange' in window) {
 377     89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
 378     # clear-stream(_test-stream)
 379     # . . push args
-380     68/push  _test-stream/imm32
+380     68/push  _test-stream/imm32
 381     # . . call
-382     e8/call  clear-stream/disp32
+382     e8/call  clear-stream/disp32
 383     # . . discard args
 384     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 385     # write(_test-stream, "Abc\ndef")
 386     # . . push args
 387     68/push  "Abc\ndef"/imm32
-388     68/push  _test-stream/imm32
+388     68/push  _test-stream/imm32
 389     # . . call
-390     e8/call  write/disp32
+390     e8/call  write/disp32
 391     # . . discard args
 392     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 393     # eax = next-stream-line-equal?(_test-stream, "def")
 394     # . . push args
 395     68/push  "def"/imm32
-396     68/push  _test-stream/imm32
+396     68/push  _test-stream/imm32
 397     # . . call
-398     e8/call  next-stream-line-equal?/disp32
+398     e8/call  next-stream-line-equal?/disp32
 399     # . . discard args
 400     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 401     # check-ints-equal(eax, 0, msg)
@@ -463,7 +463,7 @@ if ('onhashchange' in window) {
 404     68/push  0/imm32
 405     50/push-eax
 406     # . . call
-407     e8/call  check-ints-equal/disp32
+407     e8/call  check-ints-equal/disp32
 408     # . . discard args
 409     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 410     # . epilogue
@@ -477,33 +477,33 @@ if ('onhashchange' in window) {
 418     89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
 419     # clear-stream(_test-stream)
 420     # . . push args
-421     68/push  _test-stream/imm32
+421     68/push  _test-stream/imm32
 422     # . . call
-423     e8/call  clear-stream/disp32
+423     e8/call  clear-stream/disp32
 424     # . . discard args
 425     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 426     # write(_test-stream, "Abc\ndef\n")
 427     # . . push args
 428     68/push  "Abc\ndef\n"/imm32
-429     68/push  _test-stream/imm32
+429     68/push  _test-stream/imm32
 430     # . . call
-431     e8/call  write/disp32
+431     e8/call  write/disp32
 432     # . . discard args
 433     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 434     # next-stream-line-equal?(_test-stream, "Abc")
 435     # . . push args
 436     68/push  "Abc"/imm32
-437     68/push  _test-stream/imm32
+437     68/push  _test-stream/imm32
 438     # . . call
-439     e8/call  next-stream-line-equal?/disp32
+439     e8/call  next-stream-line-equal?/disp32
 440     # . . discard args
 441     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 442     # eax = next-stream-line-equal?(_test-stream, "def")
 443     # . . push args
 444     68/push  "def"/imm32
-445     68/push  _test-stream/imm32
+445     68/push  _test-stream/imm32
 446     # . . call
-447     e8/call  next-stream-line-equal?/disp32
+447     e8/call  next-stream-line-equal?/disp32
 448     # . . discard args
 449     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 450     # check-ints-equal(eax, 1, msg)
@@ -512,7 +512,7 @@ if ('onhashchange' in window) {
 453     68/push  1/imm32
 454     50/push-eax
 455     # . . call
-456     e8/call  check-ints-equal/disp32
+456     e8/call  check-ints-equal/disp32
 457     # . . discard args
 458     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 459     # . epilogue
@@ -526,33 +526,33 @@ if ('onhashchange' in window) {
 467     89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
 468     # clear-stream(_test-stream)
 469     # . . push args
-470     68/push  _test-stream/imm32
+470     68/push  _test-stream/imm32
 471     # . . call
-472     e8/call  clear-stream/disp32
+472     e8/call  clear-stream/disp32
 473     # . . discard args
 474     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 475     # write(_test-stream, "Abc\ndef")
 476     # . . push args
 477     68/push  "Abc\ndef"/imm32
-478     68/push  _test-stream/imm32
+478     68/push  _test-stream/imm32
 479     # . . call
-480     e8/call  write/disp32
+480     e8/call  write/disp32
 481     # . . discard args
 482     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 483     # next-stream-line-equal?(_test-stream, "Abc")
 484     # . . push args
 485     68/push  "Abc"/imm32
-486     68/push  _test-stream/imm32
+486     68/push  _test-stream/imm32
 487     # . . call
-488     e8/call  next-stream-line-equal?/disp32
+488     e8/call  next-stream-line-equal?/disp32
 489     # . . discard args
 490     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 491     # eax = next-stream-line-equal?(_test-stream, "def")
 492     # . . push args
 493     68/push  "def"/imm32
-494     68/push  _test-stream/imm32
+494     68/push  _test-stream/imm32
 495     # . . call
-496     e8/call  next-stream-line-equal?/disp32
+496     e8/call  next-stream-line-equal?/disp32
 497     # . . discard args
 498     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 499     # check-ints-equal(eax, 1, msg)
@@ -561,7 +561,7 @@ if ('onhashchange' in window) {
 502     68/push  1/imm32
 503     50/push-eax
 504     # . . call
-505     e8/call  check-ints-equal/disp32
+505     e8/call  check-ints-equal/disp32
 506     # . . discard args
 507     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 508     # . epilogue
@@ -575,18 +575,18 @@ if ('onhashchange' in window) {
 516     89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
 517     # clear-stream(_test-stream)
 518     # . . push args
-519     68/push  _test-stream/imm32
+519     68/push  _test-stream/imm32
 520     # . . call
-521     e8/call  clear-stream/disp32
+521     e8/call  clear-stream/disp32
 522     # . . discard args
 523     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 524     # write nothing
 525     # eax = next-stream-line-equal?(_test-stream, "")
 526     # . . push args
 527     68/push  ""/imm32
-528     68/push  _test-stream/imm32
+528     68/push  _test-stream/imm32
 529     # . . call
-530     e8/call  next-stream-line-equal?/disp32
+530     e8/call  next-stream-line-equal?/disp32
 531     # . . discard args
 532     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 533     # check-ints-equal(eax, 0, msg)
@@ -595,24 +595,24 @@ if ('onhashchange' in window) {
 536     68/push  1/imm32
 537     50/push-eax
 538     # . . call
-539     e8/call  check-ints-equal/disp32
+539     e8/call  check-ints-equal/disp32
 540     # . . discard args
 541     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 542     # eax = next-stream-line-equal?(_test-stream, "")
 543     # . . push args
 544     68/push  ""/imm32
-545     68/push  _test-stream/imm32
+545     68/push  _test-stream/imm32
 546     # . . call
-547     e8/call  next-stream-line-equal?/disp32
+547     e8/call  next-stream-line-equal?/disp32
 548     # . . discard args
 549     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 550     # check-ints-equal(eax, 0, msg)
 551     # . . push args
-552     68/push  "F - test-next-stream-line-equal-always-fails-after-Eof/2"/imm32
+552     68/push  "F - test-next-stream-line-equal-always-fails-after-Eof/2"/imm32
 553     68/push  1/imm32
 554     50/push-eax
 555     # . . call
-556     e8/call  check-ints-equal/disp32
+556     e8/call  check-ints-equal/disp32
 557     # . . discard args
 558     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 559     # . epilogue
@@ -632,7 +632,7 @@ if ('onhashchange' in window) {
 573     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
 574     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
 575     # . . call
-576     e8/call  next-stream-line-equal?/disp32
+576     e8/call  next-stream-line-equal?/disp32
 577     # . . discard args
 578     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 579     # check-ints-equal(eax, 1, msg)
@@ -641,7 +641,7 @@ if ('onhashchange' in window) {
 582     68/push  1/imm32
 583     50/push-eax
 584     # . . call
-585     e8/call  check-ints-equal/disp32
+585     e8/call  check-ints-equal/disp32
 586     # . . discard args
 587     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 588     # . restore registers
diff --git a/html/059stop.subx.html b/html/110stop.subx.html
similarity index 98%
rename from html/059stop.subx.html
rename to html/110stop.subx.html
index b694cf6a..54e37eab 100644
--- a/html/059stop.subx.html
+++ b/html/110stop.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 059stop.subx
+Mu - 110stop.subx
 
 
 
@@ -57,7 +57,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/059stop.subx
+https://github.com/akkartik/mu/blob/master/110stop.subx
 
   1 # stop: dependency-injected wrapper around the exit() syscall
   2 #
@@ -200,14 +200,14 @@ if ('onhashchange' in window) {
 139     68/push  4/imm32/nbytes-of-args-for-_test-stop-1
 140     50/push-eax
 141     # . . call
-142     e8/call  tailor-exit-descriptor/disp32
+142     e8/call  tailor-exit-descriptor/disp32
 143     # . . discard args
 144     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 145     # . _test-stop-1(ed)
 146     # . . push args
 147     50/push-eax
 148     # . . call
-149     e8/call  _test-stop-1/disp32
+149     e8/call  _test-stop-1/disp32
 150     # registers except esp may be clobbered at this point
 151     # restore args
 152     58/pop-to-eax
@@ -219,7 +219,7 @@ if ('onhashchange' in window) {
 158     # . . push ed->value
 159     ff          6/subop/push        1/mod/*+disp8   0/rm32/eax    .           .             .           .           4/disp8         .                 # push *(eax+4)
 160     # . . call
-161     e8/call  check-ints-equal/disp32
+161     e8/call  check-ints-equal/disp32
 162     # . . discard args
 163     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 164     # . epilogue
@@ -236,7 +236,7 @@ if ('onhashchange' in window) {
 175     # . . push args
 176     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
 177     # . . call
-178     e8/call  _test-stop-2/disp32
+178     e8/call  _test-stop-2/disp32
 179     # should never get past this point
 180 $_test-stop-1:dead-end:
 181     # . . discard args
@@ -247,7 +247,7 @@ if ('onhashchange' in window) {
 186     68/push  0/imm32
 187     68/push  1/imm32
 188     # . . call
-189     e8/call  check-ints-equal/disp32
+189     e8/call  check-ints-equal/disp32
 190     # . . discard args
 191     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 192     # . epilogue
@@ -264,7 +264,7 @@ if ('onhashchange' in window) {
 203     68/push  1/imm32
 204     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
 205     # . . call
-206     e8/call  stop/disp32
+206     e8/call  stop/disp32
 207     # should never get past this point
 208 $_test-stop-2:dead-end:
 209     # . epilogue
diff --git a/html/060read.subx.html b/html/111read.subx.html
similarity index 96%
rename from html/060read.subx.html
rename to html/111read.subx.html
index 153aace7..2a4ec303 100644
--- a/html/060read.subx.html
+++ b/html/111read.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 060read.subx
+Mu - 111read.subx
 
 
 
@@ -57,7 +57,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/060read.subx
+https://github.com/akkartik/mu/blob/master/111read.subx
 
   1 # read: analogously to write, support reading from in-memory streams in
   2 # addition to file descriptors.
@@ -117,7 +117,7 @@ if ('onhashchange' in window) {
  56     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
  57     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
  58     # . . call
- 59     e8/call  _read/disp32
+ 59     e8/call  _read/disp32
  60     # . . discard args
  61     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  62     # return
@@ -150,7 +150,7 @@ if ('onhashchange' in window) {
  89     8d/copy-address                 1/mod/*+disp8   4/rm32/sib    7/base/edi  0/index/eax   .           0/r32/eax   0xc/disp8       .                 # copy edi+eax+12 to eax
  90     50/push-eax
  91     # . . call
- 92     e8/call  _buffer-4/disp32
+ 92     e8/call  _buffer-4/disp32
  93     # . . discard args
  94     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
  95     # s->write += eax
@@ -191,7 +191,7 @@ if ('onhashchange' in window) {
 130     # . . push out
 131     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
 132     # . . call
-133     e8/call  _buffer-4/disp32
+133     e8/call  _buffer-4/disp32
 134     # . . discard args
 135     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
 136 $_buffer-3:end:
@@ -320,50 +320,50 @@ if ('onhashchange' in window) {
 259     # - write a single character into _test-stream, then read from it
 260     # clear-stream(_test-stream)
 261     # . . push args
-262     68/push  _test-stream/imm32
+262     68/push  _test-stream/imm32
 263     # . . call
-264     e8/call  clear-stream/disp32
+264     e8/call  clear-stream/disp32
 265     # . . discard args
 266     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 267     # clear-stream(_test-tmp-stream)
 268     # . . push args
-269     68/push  _test-tmp-stream/imm32
+269     68/push  _test-tmp-stream/imm32
 270     # . . call
-271     e8/call  clear-stream/disp32
+271     e8/call  clear-stream/disp32
 272     # . . discard args
 273     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 274     # write(_test-stream, "Ab")
 275     # . . push args
 276     68/push  "Ab"/imm32
-277     68/push  _test-stream/imm32
+277     68/push  _test-stream/imm32
 278     # . . call
-279     e8/call  write/disp32
+279     e8/call  write/disp32
 280     # . . discard args
 281     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 282     # eax = read(_test-stream, _test-tmp-stream)
 283     # . . push args
-284     68/push  _test-tmp-stream/imm32
-285     68/push  _test-stream/imm32
+284     68/push  _test-tmp-stream/imm32
+285     68/push  _test-stream/imm32
 286     # . . call
-287     e8/call  read/disp32
+287     e8/call  read/disp32
 288     # . . discard args
 289     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 290     # check-ints-equal(eax, 2, msg)
 291     # . . push args
-292     68/push  "F - test-read-single: return value"/imm32
+292     68/push  "F - test-read-single: return value"/imm32
 293     68/push  2/imm32
 294     50/push-eax
 295     # . . call
-296     e8/call  check-ints-equal/disp32
+296     e8/call  check-ints-equal/disp32
 297     # . . discard args
 298     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 299     # check-stream-equal(_test-tmp-stream, "Ab", msg)
 300     # . . push args
 301     68/push  "F - test-read-single"/imm32
 302     68/push  "Ab"/imm32
-303     68/push  _test-tmp-stream/imm32
+303     68/push  _test-tmp-stream/imm32
 304     # . . call
-305     e8/call  check-stream-equal/disp32
+305     e8/call  check-stream-equal/disp32
 306     # . . discard args
 307     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 308     # end
@@ -373,57 +373,57 @@ if ('onhashchange' in window) {
 312     # - make two consecutive reads, check that their results are appended
 313     # clear-stream(_test-stream)
 314     # . . push args
-315     68/push  _test-stream/imm32
+315     68/push  _test-stream/imm32
 316     # . . call
-317     e8/call  clear-stream/disp32
+317     e8/call  clear-stream/disp32
 318     # . . discard args
 319     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 320     # clear-stream(_test-tmp-stream)
 321     # . . push args
-322     68/push  _test-tmp-stream/imm32
+322     68/push  _test-tmp-stream/imm32
 323     # . . call
-324     e8/call  clear-stream/disp32
+324     e8/call  clear-stream/disp32
 325     # . . discard args
 326     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 327     # write(_test-stream, "C")
 328     # . . push args
 329     68/push  "C"/imm32
-330     68/push  _test-stream/imm32
+330     68/push  _test-stream/imm32
 331     # . . call
-332     e8/call  write/disp32
+332     e8/call  write/disp32
 333     # . . discard args
 334     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 335     # read(_test-stream, _test-tmp-stream)
 336     # . . push args
-337     68/push  _test-tmp-stream/imm32
-338     68/push  _test-stream/imm32
+337     68/push  _test-tmp-stream/imm32
+338     68/push  _test-stream/imm32
 339     # . . call
-340     e8/call  read/disp32
+340     e8/call  read/disp32
 341     # . . discard args
 342     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 343     # write(_test-stream, "D")
 344     # . . push args
 345     68/push  "D"/imm32
-346     68/push  _test-stream/imm32
+346     68/push  _test-stream/imm32
 347     # . . call
-348     e8/call  write/disp32
+348     e8/call  write/disp32
 349     # . . discard args
 350     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 351     # read(_test-stream, _test-tmp-stream)
 352     # . . push args
-353     68/push  _test-tmp-stream/imm32
-354     68/push  _test-stream/imm32
+353     68/push  _test-tmp-stream/imm32
+354     68/push  _test-stream/imm32
 355     # . . call
-356     e8/call  read/disp32
+356     e8/call  read/disp32
 357     # . . discard args
 358     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 359     # check-stream-equal(_test-tmp-stream, "CD", msg)
 360     # . . push args
 361     68/push  "F - test-read-is-stateful"/imm32
 362     68/push  "CD"/imm32
-363     68/push  _test-tmp-stream/imm32
+363     68/push  _test-tmp-stream/imm32
 364     # . . call
-365     e8/call  check-stream-equal/disp32
+365     e8/call  check-stream-equal/disp32
 366     # . . discard args
 367     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 368     # end
@@ -434,42 +434,42 @@ if ('onhashchange' in window) {
 373     # setup
 374     # . clear-stream(_test-stream)
 375     # . . push args
-376     68/push  _test-stream/imm32
+376     68/push  _test-stream/imm32
 377     # . . call
-378     e8/call  clear-stream/disp32
+378     e8/call  clear-stream/disp32
 379     # . . discard args
 380     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 381     # . clear-stream(_test-tmp-stream)
 382     # . . push args
-383     68/push  _test-tmp-stream/imm32
+383     68/push  _test-tmp-stream/imm32
 384     # . . call
-385     e8/call  clear-stream/disp32
+385     e8/call  clear-stream/disp32
 386     # . . discard args
 387     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 388     # . write(_test-stream, "Ab")
 389     # . . push args
 390     68/push  "Ab"/imm32
-391     68/push  _test-stream/imm32
+391     68/push  _test-stream/imm32
 392     # . . call
-393     e8/call  write/disp32
+393     e8/call  write/disp32
 394     # . . discard args
 395     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 396     # first read gets to end-of-file
 397     # . read(_test-stream, _test-tmp-stream)
 398     # . . push args
-399     68/push  _test-tmp-stream/imm32
-400     68/push  _test-stream/imm32
+399     68/push  _test-tmp-stream/imm32
+400     68/push  _test-stream/imm32
 401     # . . call
-402     e8/call  read/disp32
+402     e8/call  read/disp32
 403     # . . discard args
 404     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 405     # second read
 406     # . read(_test-stream, _test-tmp-stream)
 407     # . . push args
-408     68/push  _test-tmp-stream/imm32
-409     68/push  _test-stream/imm32
+408     68/push  _test-tmp-stream/imm32
+409     68/push  _test-stream/imm32
 410     # . . call
-411     e8/call  read/disp32
+411     e8/call  read/disp32
 412     # . . discard args
 413     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 414     # check-ints-equal(eax, 0, msg)
@@ -478,7 +478,7 @@ if ('onhashchange' in window) {
 417     68/push  0/imm32
 418     50/push-eax
 419     # . . call
-420     e8/call  check-ints-equal/disp32
+420     e8/call  check-ints-equal/disp32
 421     # . . discard args
 422     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 423     # end
diff --git a/html/061read-byte.subx.html b/html/112read-byte.subx.html
similarity index 94%
rename from html/061read-byte.subx.html
rename to html/112read-byte.subx.html
index 3ee85b4a..fcf6d917 100644
--- a/html/061read-byte.subx.html
+++ b/html/112read-byte.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 061read-byte.subx
+Mu - 112read-byte.subx
 
 
 
@@ -58,7 +58,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/061read-byte.subx
+https://github.com/akkartik/mu/blob/master/112read-byte.subx
 
   1 # read-byte-buffered: one higher-level abstraction atop 'read'.
   2 #
@@ -116,7 +116,7 @@ if ('onhashchange' in window) {
  54     8d/copy-address                 1/mod/*+disp8   6/rm32/esi    .           .             .           0/r32/eax   4/disp8         .                 # copy esi+4 to eax
  55     50/push-eax
  56     # . . call
- 57     e8/call  clear-stream/disp32
+ 57     e8/call  clear-stream/disp32
  58     # . . discard args
  59     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  60     # . f->read must now be 0; update its cache at ecx
@@ -126,7 +126,7 @@ if ('onhashchange' in window) {
  64     50/push-eax
  65     ff          6/subop/push        0/mod/indirect  6/rm32/esi    .           .             .           .           .               .                 # push *esi
  66     # . . call
- 67     e8/call  read/disp32
+ 67     e8/call  read/disp32
  68     # . . discard args
  69     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  70     # if (eax == 0) return 0xffffffff
@@ -156,31 +156,31 @@ if ('onhashchange' in window) {
  94     # setup
  95     # . clear-stream(_test-stream)
  96     # . . push args
- 97     68/push  _test-stream/imm32
+ 97     68/push  _test-stream/imm32
  98     # . . call
- 99     e8/call  clear-stream/disp32
+ 99     e8/call  clear-stream/disp32
 100     # . . discard args
 101     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 102     # . clear-stream(_test-buffered-file->buffer)
 103     # . . push args
 104     68/push  $_test-buffered-file->buffer/imm32
 105     # . . call
-106     e8/call  clear-stream/disp32
+106     e8/call  clear-stream/disp32
 107     # . . discard args
 108     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 109     # . write(_test-stream, "Ab")
 110     # . . push args
 111     68/push  "Ab"/imm32
-112     68/push  _test-stream/imm32
+112     68/push  _test-stream/imm32
 113     # . . call
-114     e8/call  write/disp32
+114     e8/call  write/disp32
 115     # . . discard args
 116     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 117     # read-byte-buffered(_test-buffered-file)
 118     # . . push args
-119     68/push  _test-buffered-file/imm32
+119     68/push  _test-buffered-file/imm32
 120     # . . call
-121     e8/call  read-byte-buffered/disp32
+121     e8/call  read-byte-buffered/disp32
 122     # . . discard args
 123     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 124     # check-ints-equal(eax, 'A', msg)
@@ -189,7 +189,7 @@ if ('onhashchange' in window) {
 127     68/push  0x41/imm32
 128     50/push-eax
 129     # . . call
-130     e8/call  check-ints-equal/disp32
+130     e8/call  check-ints-equal/disp32
 131     # . . discard args
 132     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 133     # . end
@@ -200,38 +200,38 @@ if ('onhashchange' in window) {
 138     # setup
 139     # . clear-stream(_test-stream)
 140     # . . push args
-141     68/push  _test-stream/imm32
+141     68/push  _test-stream/imm32
 142     # . . call
-143     e8/call  clear-stream/disp32
+143     e8/call  clear-stream/disp32
 144     # . . discard args
 145     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 146     # . clear-stream($_test-buffered-file->buffer)
 147     # . . push args
 148     68/push  $_test-buffered-file->buffer/imm32
 149     # . . call
-150     e8/call  clear-stream/disp32
+150     e8/call  clear-stream/disp32
 151     # . . discard args
 152     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 153     # . write(_test-stream, "Ab")
 154     # . . push args
 155     68/push  "Ab"/imm32
-156     68/push  _test-stream/imm32
+156     68/push  _test-stream/imm32
 157     # . . call
-158     e8/call  write/disp32
+158     e8/call  write/disp32
 159     # . . discard args
 160     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 161     # read-byte-buffered(_test-buffered-file)
 162     # . . push args
-163     68/push  _test-buffered-file/imm32
+163     68/push  _test-buffered-file/imm32
 164     # . . call
-165     e8/call  read-byte-buffered/disp32
+165     e8/call  read-byte-buffered/disp32
 166     # . . discard args
 167     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 168     # read-byte-buffered(_test-buffered-file)
 169     # . . push args
-170     68/push  _test-buffered-file/imm32
+170     68/push  _test-buffered-file/imm32
 171     # . . call
-172     e8/call  read-byte-buffered/disp32
+172     e8/call  read-byte-buffered/disp32
 173     # . . discard args
 174     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 175     # check-ints-equal(eax, 'b', msg)
@@ -240,7 +240,7 @@ if ('onhashchange' in window) {
 178     68/push  0x62/imm32
 179     50/push-eax
 180     # . . call
-181     e8/call  check-ints-equal/disp32
+181     e8/call  check-ints-equal/disp32
 182     # . . discard args
 183     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 184     # . end
@@ -251,23 +251,23 @@ if ('onhashchange' in window) {
 189     # setup
 190     # . clear-stream(_test-stream)
 191     # . . push args
-192     68/push  _test-stream/imm32
+192     68/push  _test-stream/imm32
 193     # . . call
-194     e8/call  clear-stream/disp32
+194     e8/call  clear-stream/disp32
 195     # . . discard args
 196     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 197     # . clear-stream($_test-buffered-file->buffer)
 198     # . . push args
 199     68/push  $_test-buffered-file->buffer/imm32
 200     # . . call
-201     e8/call  clear-stream/disp32
+201     e8/call  clear-stream/disp32
 202     # . . discard args
 203     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 204     # read-byte-buffered(_test-buffered-file)
 205     # . . push args
-206     68/push  _test-buffered-file/imm32
+206     68/push  _test-buffered-file/imm32
 207     # . . call
-208     e8/call  read-byte-buffered/disp32
+208     e8/call  read-byte-buffered/disp32
 209     # . . discard args
 210     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 211     # check-ints-equal(eax, 0xffffffff, msg)
@@ -276,7 +276,7 @@ if ('onhashchange' in window) {
 214     68/push  0xffffffff/imm32/Eof
 215     50/push-eax
 216     # . . call
-217     e8/call  check-ints-equal/disp32
+217     e8/call  check-ints-equal/disp32
 218     # . . discard args
 219     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 220     # . end
@@ -287,35 +287,35 @@ if ('onhashchange' in window) {
 225     # setup
 226     # . clear-stream(_test-stream)
 227     # . . push args
-228     68/push  _test-stream/imm32
+228     68/push  _test-stream/imm32
 229     # . . call
-230     e8/call  clear-stream/disp32
+230     e8/call  clear-stream/disp32
 231     # . . discard args
 232     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 233     # . clear-stream($_test-buffered-file->buffer)
 234     # . . push args
 235     68/push  $_test-buffered-file->buffer/imm32
 236     # . . call
-237     e8/call  clear-stream/disp32
+237     e8/call  clear-stream/disp32
 238     # . . discard args
 239     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 240     # . write(_test-stream, "Abcdefgh")
 241     # . . push args
 242     68/push  "Abcdefgh"/imm32
-243     68/push  _test-stream/imm32
+243     68/push  _test-stream/imm32
 244     # . . call
-245     e8/call  write/disp32
+245     e8/call  write/disp32
 246     # . . discard args
 247     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 248     # pretend buffer is full
 249     # . _test-buffered-file->read = 6  # >= _test-buffered-file->size
-250     b8/copy-to-eax  _test-buffered-file/imm32
+250     b8/copy-to-eax  _test-buffered-file/imm32
 251     c7          0/subop/copy        1/mod/*+disp8   0/rm32/eax    .           .             .           .           8/disp8         6/imm32           # copy to *(eax+8)
 252     # read-byte-buffered(_test-buffered-file)
 253     # . . push args
-254     68/push  _test-buffered-file/imm32
+254     68/push  _test-buffered-file/imm32
 255     # . . call
-256     e8/call  read-byte-buffered/disp32
+256     e8/call  read-byte-buffered/disp32
 257     # . . discard args
 258     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 259     # check-ints-equal(eax, 'A', msg)
@@ -324,7 +324,7 @@ if ('onhashchange' in window) {
 262     68/push  0x41/imm32
 263     50/push-eax
 264     # . . call
-265     e8/call  check-ints-equal/disp32
+265     e8/call  check-ints-equal/disp32
 266     # . . discard args
 267     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 268     # . end
@@ -335,7 +335,7 @@ if ('onhashchange' in window) {
 273 # a test buffered file for _test-stream
 274 _test-buffered-file:  # buffered-file
 275     # file descriptor or (addr stream byte)
-276     _test-stream/imm32
+276     _test-stream/imm32
 277 $_test-buffered-file->buffer:
 278     # current write index
 279     0/imm32
@@ -374,7 +374,7 @@ if ('onhashchange' in window) {
 312 # a test buffered file for _test-input-stream
 313 _test-input-buffered-file:  # buffered-file
 314     # file descriptor or (addr stream byte)
-315     _test-input-stream/imm32
+315     _test-input-stream/imm32
 316 $_test-input-buffered-file->buffer:
 317     # current write index
 318     0/imm32
diff --git a/html/062write-stream.subx.html b/html/113write-stream.subx.html
similarity index 94%
rename from html/062write-stream.subx.html
rename to html/113write-stream.subx.html
index 337dbf46..ceeb6bc6 100644
--- a/html/062write-stream.subx.html
+++ b/html/113write-stream.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 062write-stream.subx
+Mu - 113write-stream.subx
 
 
 
@@ -57,7 +57,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/062write-stream.subx
+https://github.com/akkartik/mu/blob/master/113write-stream.subx
 
   1 # write-stream: like write, but write streams rather than strings
   2 
@@ -86,7 +86,7 @@ if ('onhashchange' in window) {
  25     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
  26     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
  27     # . . call
- 28     e8/call  _write-stream/disp32
+ 28     e8/call  _write-stream/disp32
  29     # . . discard args
  30     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  31     eb/jump  $write-stream:end/disp8
@@ -118,7 +118,7 @@ if ('onhashchange' in window) {
  57     8d/copy-address                 1/mod/*+disp8   4/rm32/sib    7/base/edi  0/index/eax   .           0/r32/eax   0xc/disp8       .                 # copy edi+eax+12 to eax
  58     50/push-eax
  59     # . . call
- 60     e8/call  _append-4/disp32
+ 60     e8/call  _append-4/disp32
  61     # . . discard args
  62     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
  63     # f->write += eax
@@ -181,10 +181,10 @@ if ('onhashchange' in window) {
 120 $_write-stream:abort:
 121     # . _write(2/stderr, error)
 122     # . . push args
-123     68/push  "_write-stream: failed to write to file\n"/imm32
+123     68/push  "_write-stream: failed to write to file\n"/imm32
 124     68/push  2/imm32/stderr
 125     # . . call
-126     e8/call  _write/disp32
+126     e8/call  _write/disp32
 127     # . . discard args
 128     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 129     # . syscall(exit, 1)
@@ -196,41 +196,41 @@ if ('onhashchange' in window) {
 135     # setup
 136     # . clear-stream(_test-stream)
 137     # . . push args
-138     68/push  _test-stream/imm32
+138     68/push  _test-stream/imm32
 139     # . . call
-140     e8/call  clear-stream/disp32
+140     e8/call  clear-stream/disp32
 141     # . . discard args
 142     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 143     # . clear-stream(_test-stream2)
 144     # . . push args
-145     68/push  _test-stream2/imm32
+145     68/push  _test-stream2/imm32
 146     # . . call
-147     e8/call  clear-stream/disp32
+147     e8/call  clear-stream/disp32
 148     # . . discard args
 149     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 150     # . write(_test-stream2, "Ab")
 151     # . . push args
 152     68/push  "Ab"/imm32
-153     68/push  _test-stream2/imm32
+153     68/push  _test-stream2/imm32
 154     # . . call
-155     e8/call  write/disp32
+155     e8/call  write/disp32
 156     # . . discard args
 157     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 158     # write-stream(_test-stream, _test-stream2)
 159     # . . push args
-160     68/push  _test-stream2/imm32
-161     68/push  _test-stream/imm32
+160     68/push  _test-stream2/imm32
+161     68/push  _test-stream/imm32
 162     # . . call
-163     e8/call  write-stream/disp32
+163     e8/call  write-stream/disp32
 164     # . . discard args
 165     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 166     # check-stream-equal(_test-stream, "Ab", msg)
 167     # . . push args
 168     68/push  "F - test-write-stream-single"/imm32
 169     68/push  "Ab"/imm32
-170     68/push  _test-stream/imm32
+170     68/push  _test-stream/imm32
 171     # . . call
-172     e8/call  check-stream-equal/disp32
+172     e8/call  check-stream-equal/disp32
 173     # . . discard args
 174     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 175     # . end
@@ -240,59 +240,59 @@ if ('onhashchange' in window) {
 179     # setup
 180     # . clear-stream(_test-stream)
 181     # . . push args
-182     68/push  _test-stream/imm32
+182     68/push  _test-stream/imm32
 183     # . . call
-184     e8/call  clear-stream/disp32
+184     e8/call  clear-stream/disp32
 185     # . . discard args
 186     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 187     # . clear-stream(_test-stream2)
 188     # . . push args
-189     68/push  _test-stream2/imm32
+189     68/push  _test-stream2/imm32
 190     # . . call
-191     e8/call  clear-stream/disp32
+191     e8/call  clear-stream/disp32
 192     # . . discard args
 193     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 194     # . write(_test-stream2, "C")
 195     # . . push args
 196     68/push  "C"/imm32
-197     68/push  _test-stream2/imm32
+197     68/push  _test-stream2/imm32
 198     # . . call
-199     e8/call  write/disp32
+199     e8/call  write/disp32
 200     # . . discard args
 201     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 202     # first write
 203     # . write-stream(_test-stream, _test-stream2)
 204     # . . push args
-205     68/push  _test-stream2/imm32
-206     68/push  _test-stream/imm32
+205     68/push  _test-stream2/imm32
+206     68/push  _test-stream/imm32
 207     # . . call
-208     e8/call  write-stream/disp32
+208     e8/call  write-stream/disp32
 209     # . . discard args
 210     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 211     # second write
 212     # . write(_test-stream2, "D")
 213     # . . push args
 214     68/push  "D"/imm32
-215     68/push  _test-stream2/imm32
+215     68/push  _test-stream2/imm32
 216     # . . call
-217     e8/call  write/disp32
+217     e8/call  write/disp32
 218     # . . discard args
 219     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 220     # . write-stream(_test-stream, _test-stream2)
 221     # . . push args
-222     68/push  _test-stream2/imm32
-223     68/push  _test-stream/imm32
+222     68/push  _test-stream2/imm32
+223     68/push  _test-stream/imm32
 224     # . . call
-225     e8/call  write-stream/disp32
+225     e8/call  write-stream/disp32
 226     # . . discard args
 227     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 228     # check-stream-equal(_test-stream, "CD", msg)
 229     # . . push args
 230     68/push  "F - test-write-stream-appends"/imm32
 231     68/push  "CD"/imm32
-232     68/push  _test-stream/imm32
+232     68/push  _test-stream/imm32
 233     # . . call
-234     e8/call  check-stream-equal/disp32
+234     e8/call  check-stream-equal/disp32
 235     # . . discard args
 236     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 237     # . end
diff --git a/html/063error.subx.html b/html/114error.subx.html
similarity index 93%
rename from html/063error.subx.html
rename to html/114error.subx.html
index 7916ef06..009111bd 100644
--- a/html/063error.subx.html
+++ b/html/114error.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 063error.subx
+Mu - 114error.subx
 
 
 
@@ -55,7 +55,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/063error.subx
+https://github.com/akkartik/mu/blob/master/114error.subx
 
  1 # Print an error message and exit.
  2 
@@ -74,7 +74,7 @@ if ('onhashchange' in window) {
 15     68/push  "Error: "/imm32
 16     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
 17     # . . call
-18     e8/call  write/disp32
+18     e8/call  write/disp32
 19     # . . discard args
 20     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 21     # write(out, msg)
@@ -82,15 +82,15 @@ if ('onhashchange' in window) {
 23     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0x10/disp8      .                 # push *(ebp+16)
 24     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
 25     # . . call
-26     e8/call  write/disp32
+26     e8/call  write/disp32
 27     # . . discard args
 28     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 29     # write(out, "\n")
 30     # . . push args
-31     68/push  Newline/imm32
+31     68/push  Newline/imm32
 32     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
 33     # . . call
-34     e8/call  write/disp32
+34     e8/call  write/disp32
 35     # . . discard args
 36     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 37     # stop(ed, 1)
@@ -98,7 +98,7 @@ if ('onhashchange' in window) {
 39     68/push  1/imm32
 40     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
 41     # . . call
-42     e8/call  stop/disp32
+42     e8/call  stop/disp32
 43     # should never get past this point
 44 $error:dead-end:
 45     # . epilogue
diff --git a/html/064write-byte.subx.html b/html/115write-byte.subx.html
similarity index 96%
rename from html/064write-byte.subx.html
rename to html/115write-byte.subx.html
index f8c6d6f4..b28af487 100644
--- a/html/064write-byte.subx.html
+++ b/html/115write-byte.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 064write-byte.subx
+Mu - 115write-byte.subx
 
 
 
@@ -58,7 +58,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/064write-byte.subx
+https://github.com/akkartik/mu/blob/master/115write-byte.subx
 
   1 # write-byte-buffered: add a single byte to a buffered-file.
   2 # flush: write out any buffered writes to disk.
@@ -110,7 +110,7 @@ if ('onhashchange' in window) {
  48     # . . push args
  49     57/push-edi
  50     # . . call
- 51     e8/call  flush/disp32
+ 51     e8/call  flush/disp32
  52     # . . discard args
  53     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  54     # . clear-stream(stream = f+4)
@@ -118,7 +118,7 @@ if ('onhashchange' in window) {
  56     8d/copy-address                 1/mod/*+disp8   7/rm32/edi    .           .             .           0/r32/eax   4/disp8         .                 # copy edi+4 to eax
  57     50/push-eax
  58     # . . call
- 59     e8/call  clear-stream/disp32
+ 59     e8/call  clear-stream/disp32
  60     # . . discard args
  61     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  62     # . f->write must now be 0; update its cache at ecx
@@ -155,7 +155,7 @@ if ('onhashchange' in window) {
  93     51/push-ecx
  94     ff          6/subop/push        0/mod/indirect  0/rm32/eax    .           .             .           .           .               .                 # push *eax
  95       # . . call
- 96     e8/call  write-stream/disp32
+ 96     e8/call  write-stream/disp32
  97       # . . discard args
  98     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  99 $flush:end:
@@ -172,40 +172,40 @@ if ('onhashchange' in window) {
 110     # setup
 111     # . clear-stream(_test-stream)
 112     # . . push args
-113     68/push  _test-stream/imm32
+113     68/push  _test-stream/imm32
 114     # . . call
-115     e8/call  clear-stream/disp32
+115     e8/call  clear-stream/disp32
 116     # . . discard args
 117     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 118     # . clear-stream($_test-buffered-file->buffer)
 119     # . . push args
 120     68/push  $_test-buffered-file->buffer/imm32
 121     # . . call
-122     e8/call  clear-stream/disp32
+122     e8/call  clear-stream/disp32
 123     # . . discard args
 124     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 125     # write-byte-buffered(_test-buffered-file, 'A')
 126     # . . push args
 127     68/push  0x41/imm32
-128     68/push  _test-buffered-file/imm32
+128     68/push  _test-buffered-file/imm32
 129     # . . call
-130     e8/call  write-byte-buffered/disp32
+130     e8/call  write-byte-buffered/disp32
 131     # . . discard args
 132     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 133     # flush(_test-buffered-file)
 134     # . . push args
-135     68/push  _test-buffered-file/imm32
+135     68/push  _test-buffered-file/imm32
 136     # . . call
-137     e8/call  flush/disp32
+137     e8/call  flush/disp32
 138     # . . discard args
 139     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 140     # check-stream-equal(_test-stream, "A", msg)
 141     # . . push args
 142     68/push  "F - test-write-byte-buffered-single"/imm32
 143     68/push  "A"/imm32
-144     68/push  _test-stream/imm32
+144     68/push  _test-stream/imm32
 145     # . . call
-146     e8/call  check-stream-equal/disp32
+146     e8/call  check-stream-equal/disp32
 147     # . . discard args
 148     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 149     # . end
@@ -216,16 +216,16 @@ if ('onhashchange' in window) {
 154     # setup
 155     # . clear-stream(_test-stream)
 156     # . . push args
-157     68/push  _test-stream/imm32
+157     68/push  _test-stream/imm32
 158     # . . call
-159     e8/call  clear-stream/disp32
+159     e8/call  clear-stream/disp32
 160     # . . discard args
 161     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 162     # . clear-stream($_test-buffered-file->buffer)
 163     # . . push args
 164     68/push  $_test-buffered-file->buffer/imm32
 165     # . . call
-166     e8/call  clear-stream/disp32
+166     e8/call  clear-stream/disp32
 167     # . . discard args
 168     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 169     # fill up the buffer for _test-buffered-file
@@ -234,31 +234,31 @@ if ('onhashchange' in window) {
 172     68/push  "abcdef"/imm32
 173     68/push  $_test-buffered-file->buffer/imm32
 174     # . . call
-175     e8/call  write/disp32
+175     e8/call  write/disp32
 176     # . . discard args
 177     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 178     # write-byte-buffered(_test-buffered-file, 'g')
 179     # . . push args
 180     68/push  0x67/imm32
-181     68/push  _test-buffered-file/imm32
+181     68/push  _test-buffered-file/imm32
 182     # . . call
-183     e8/call  write-byte-buffered/disp32
+183     e8/call  write-byte-buffered/disp32
 184     # . . discard args
 185     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 186     # flush(_test-buffered-file)
 187     # . . push args
-188     68/push  _test-buffered-file/imm32
+188     68/push  _test-buffered-file/imm32
 189     # . . call
-190     e8/call  flush/disp32
+190     e8/call  flush/disp32
 191     # . . discard args
 192     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 193     # check-stream-equal(_test-stream, "abcdefg", msg)
 194     # . . push args
 195     68/push  "F - test-write-byte-buffered-multiple-flushes"/imm32
 196     68/push  "abcdefg"/imm32
-197     68/push  _test-stream/imm32
+197     68/push  _test-stream/imm32
 198     # . . call
-199     e8/call  check-stream-equal/disp32
+199     e8/call  check-stream-equal/disp32
 200     # . . discard args
 201     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 202     # . end
@@ -304,7 +304,7 @@ if ('onhashchange' in window) {
 242     68/push  "append-byte: out of space\n"/imm32
 243     68/push  2/imm32/stderr
 244     # . . call
-245     e8/call  _write/disp32
+245     e8/call  _write/disp32
 246     # . . discard args
 247     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 248     # . syscall(exit, 1)
@@ -317,26 +317,26 @@ if ('onhashchange' in window) {
 255     # setup
 256     # . clear-stream(_test-stream)
 257     # . . push args
-258     68/push  _test-stream/imm32
+258     68/push  _test-stream/imm32
 259     # . . call
-260     e8/call  clear-stream/disp32
+260     e8/call  clear-stream/disp32
 261     # . . discard args
 262     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 263     # append-byte(_test-stream, 'A')
 264     # . . push args
 265     68/push  0x41/imm32
-266     68/push  _test-stream/imm32
+266     68/push  _test-stream/imm32
 267     # . . call
-268     e8/call  append-byte/disp32
+268     e8/call  append-byte/disp32
 269     # . . discard args
 270     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 271     # check-stream-equal(_test-stream, "A", msg)
 272     # . . push args
 273     68/push  "F - test-append-byte-single"/imm32
 274     68/push  "A"/imm32
-275     68/push  _test-stream/imm32
+275     68/push  _test-stream/imm32
 276     # . . call
-277     e8/call  check-stream-equal/disp32
+277     e8/call  check-stream-equal/disp32
 278     # . . discard args
 279     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 280     # . end
@@ -420,7 +420,7 @@ if ('onhashchange' in window) {
 358 # a test buffered file for _test-output-stream
 359 _test-output-buffered-file:  # buffered-file
 360     # file descriptor or (addr stream byte)
-361     _test-output-stream/imm32
+361     _test-output-stream/imm32
 362 $_test-output-buffered-file->buffer:
 363     # current write index
 364     0/imm32
@@ -451,7 +451,7 @@ if ('onhashchange' in window) {
 389 # a test buffered file for _test-error-stream
 390 _test-error-buffered-file:  # buffered-file
 391     # file descriptor or (addr stream byte)
-392     _test-error-stream/imm32
+392     _test-error-stream/imm32
 393 $_test-error-buffered-file->buffer:
 394     # current write index
 395     0/imm32
diff --git a/html/065write-buffered.subx.html b/html/116write-buffered.subx.html
similarity index 95%
rename from html/065write-buffered.subx.html
rename to html/116write-buffered.subx.html
index 6a1d6c9f..09748741 100644
--- a/html/065write-buffered.subx.html
+++ b/html/116write-buffered.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 065write-buffered.subx
+Mu - 116write-buffered.subx
 
 
 
@@ -57,7 +57,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/065write-buffered.subx
+https://github.com/akkartik/mu/blob/master/116write-buffered.subx
 
   1 # write-buffered: like 'write', but for a buffered-file
   2 
@@ -123,7 +123,7 @@ if ('onhashchange' in window) {
  62     # . . push args
  63     57/push-edi
  64     # . . call
- 65     e8/call  flush/disp32
+ 65     e8/call  flush/disp32
  66     # . . discard args
  67     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  68     # . clear-stream(stream = f+4)
@@ -131,7 +131,7 @@ if ('onhashchange' in window) {
  70     8d/copy-address                 1/mod/*+disp8   7/rm32/edi    .           .             .           0/r32/eax   4/disp8         .                 # copy edi+4 to eax
  71     50/push-eax
  72     # . . call
- 73     e8/call  clear-stream/disp32
+ 73     e8/call  clear-stream/disp32
  74     # . . discard args
  75     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  76     # . f->write must now be 0; update its cache at ebx
@@ -170,40 +170,40 @@ if ('onhashchange' in window) {
 109     # setup
 110     # . clear-stream(_test-stream)
 111     # . . push args
-112     68/push  _test-stream/imm32
+112     68/push  _test-stream/imm32
 113     # . . call
-114     e8/call  clear-stream/disp32
+114     e8/call  clear-stream/disp32
 115     # . . discard args
 116     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 117     # . clear-stream($_test-buffered-file->buffer)
 118     # . . push args
 119     68/push  $_test-buffered-file->buffer/imm32
 120     # . . call
-121     e8/call  clear-stream/disp32
+121     e8/call  clear-stream/disp32
 122     # . . discard args
 123     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 124     # write-buffered(_test-buffered-file, "Abc")
 125     # . . push args
 126     68/push  "Abc"/imm32
-127     68/push  _test-buffered-file/imm32
+127     68/push  _test-buffered-file/imm32
 128     # . . call
-129     e8/call  write-buffered/disp32
+129     e8/call  write-buffered/disp32
 130     # . . discard args
 131     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 132     # flush(_test-buffered-file)
 133     # . . push args
-134     68/push  _test-buffered-file/imm32
+134     68/push  _test-buffered-file/imm32
 135     # . . call
-136     e8/call  flush/disp32
+136     e8/call  flush/disp32
 137     # . . discard args
 138     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 139     # check-stream-equal(_test-stream, "Abc", msg)
 140     # . . push args
 141     68/push  "F - test-write-buffered-single"/imm32
 142     68/push  "Abc"/imm32
-143     68/push  _test-stream/imm32
+143     68/push  _test-stream/imm32
 144     # . . call
-145     e8/call  check-stream-equal/disp32
+145     e8/call  check-stream-equal/disp32
 146     # . . discard args
 147     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 148     # . end
@@ -214,16 +214,16 @@ if ('onhashchange' in window) {
 153     # setup
 154     # . clear-stream(_test-stream)
 155     # . . push args
-156     68/push  _test-stream/imm32
+156     68/push  _test-stream/imm32
 157     # . . call
-158     e8/call  clear-stream/disp32
+158     e8/call  clear-stream/disp32
 159     # . . discard args
 160     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 161     # . clear-stream($_test-buffered-file->buffer)
 162     # . . push args
 163     68/push  $_test-buffered-file->buffer/imm32
 164     # . . call
-165     e8/call  clear-stream/disp32
+165     e8/call  clear-stream/disp32
 166     # . . discard args
 167     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 168     # _test-stream can hold 8 bytes, but _test-buffered-file can hold only 6.
@@ -231,34 +231,34 @@ if ('onhashchange' in window) {
 170     # . write-buffered(_test-buffered-file, "Abcdefg")
 171     # . . push args
 172     68/push  "Abcdefg"/imm32
-173     68/push  _test-buffered-file/imm32
+173     68/push  _test-buffered-file/imm32
 174     # . . call
-175     e8/call  write-buffered/disp32
+175     e8/call  write-buffered/disp32
 176     # . . discard args
 177     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 178     # don't flush
 179     # 6 bytes should still have gotten to _test-stream
 180     # . check-ints-equal(*_test-stream->write, 6, msg)
 181     # . . push args
-182     68/push  "F - test-write-buffered-with-intermediate-flush: flushed data"/imm32
+182     68/push  "F - test-write-buffered-with-intermediate-flush: flushed data"/imm32
 183     68/push  6/imm32
 184     # . . push *_test-stream->write
-185     b8/copy-to-eax  _test-stream/imm32
+185     b8/copy-to-eax  _test-stream/imm32
 186     ff          6/subop/push        0/mod/indirect  0/rm32/eax    .           .             .           .           .               .                 # push *eax
 187     # . . call
-188     e8/call  check-ints-equal/disp32
+188     e8/call  check-ints-equal/disp32
 189     # . . discard args
 190     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 191     # and 1 byte should still be in _test-buffered-file
 192     # . check-ints-equal(*_test-buffered-file->write, 1, msg)
 193     # . . push args
-194     68/push  "F - test-write-buffered-with-intermediate-flush: unflushed bytes"/imm32
+194     68/push  "F - test-write-buffered-with-intermediate-flush: unflushed bytes"/imm32
 195     68/push  1/imm32
 196     # . . push *_test-buffered-file->write
-197     b8/copy-to-eax  _test-buffered-file/imm32
+197     b8/copy-to-eax  _test-buffered-file/imm32
 198     ff          6/subop/push        1/mod/*+disp8   0/rm32/eax    .           .             .           .           4/disp8         .                 # push *(eax+4)
 199     # . . call
-200     e8/call  check-ints-equal/disp32
+200     e8/call  check-ints-equal/disp32
 201     # . . discard args
 202     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 203     # . end
diff --git a/html/066write-int-hex.subx.html b/html/117write-int-hex.subx.html
similarity index 94%
rename from html/066write-int-hex.subx.html
rename to html/117write-int-hex.subx.html
index 0a68e432..c8a81d18 100644
--- a/html/066write-int-hex.subx.html
+++ b/html/117write-int-hex.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 066write-int-hex.subx
+Mu - 117write-int-hex.subx
 
 
 
@@ -57,7 +57,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/066write-int-hex.subx
+https://github.com/akkartik/mu/blob/master/117write-int-hex.subx
 
   1 # Write out the (hex) textual representation of numbers.
   2 
@@ -90,26 +90,26 @@ if ('onhashchange' in window) {
  29     c1/shift    5/subop/logic-right 3/mod/direct    0/rm32/eax    .           .             .           .           .               4/imm8            # shift eax right by 4 bits, while padding zeroes
  30     25/and-eax  0xf/imm32
  31     # . AL = to-hex-char(AL)
- 32     e8/call  to-hex-char/disp32
+ 32     e8/call  to-hex-char/disp32
  33     # append-byte(f, AL)
  34     # . . push args
  35     50/push-eax
  36     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
  37     # . . call
- 38     e8/call  append-byte/disp32
+ 38     e8/call  append-byte/disp32
  39     # . . discard args
  40     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  41     # AL = convert lower nibble to hex
  42     8b/copy                         1/mod/*+disp8   5/rm32/ebp    .           .             .           0/r32/eax   0xc/disp8       .                 # copy *(ebp+12) to eax
  43     25/and-eax  0xf/imm32
  44     # . AL = to-hex-char(AL)
- 45     e8/call  to-hex-char/disp32
+ 45     e8/call  to-hex-char/disp32
  46     # append-byte(f, AL)
  47     # . . push args
  48     50/push-eax
  49     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
  50     # . . call
- 51     e8/call  append-byte/disp32
+ 51     e8/call  append-byte/disp32
  52     # . . discard args
  53     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  54 $append-byte-hex:end:
@@ -125,26 +125,26 @@ if ('onhashchange' in window) {
  64     # setup
  65     # . clear-stream(_test-stream)
  66     # . . push args
- 67     68/push  _test-stream/imm32
+ 67     68/push  _test-stream/imm32
  68     # . . call
- 69     e8/call  clear-stream/disp32
+ 69     e8/call  clear-stream/disp32
  70     # . . discard args
  71     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  72     # append-byte-hex(_test-stream, 0xa)  # exercises digit, non-digit as well as leading zero
  73     # . . push args
  74     68/push  0xa/imm32
- 75     68/push  _test-stream/imm32
+ 75     68/push  _test-stream/imm32
  76     # . . call
- 77     e8/call  append-byte-hex/disp32
+ 77     e8/call  append-byte-hex/disp32
  78     # . . discard args
  79     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  80     # check-stream-equal(_test-stream, "0a", msg)
  81     # . . push args
  82     68/push  "F - test-append-byte-hex"/imm32
  83     68/push  "0a"/imm32
- 84     68/push  _test-stream/imm32
+ 84     68/push  _test-stream/imm32
  85     # . . call
- 86     e8/call  check-stream-equal/disp32
+ 86     e8/call  check-stream-equal/disp32
  87     # . . discard args
  88     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  89     # . end
@@ -162,26 +162,26 @@ if ('onhashchange' in window) {
 101     c1/shift    5/subop/logic-right 3/mod/direct    0/rm32/eax    .           .             .           .           .               4/imm8            # shift eax right by 4 bits, while padding zeroes
 102     25/and-eax  0xf/imm32
 103     # . AL = to-hex-char(AL)
-104     e8/call  to-hex-char/disp32
+104     e8/call  to-hex-char/disp32
 105     # write-byte-buffered(f, AL)
 106     # . . push args
 107     50/push-eax
 108     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
 109     # . . call
-110     e8/call  write-byte-buffered/disp32
+110     e8/call  write-byte-buffered/disp32
 111     # . . discard args
 112     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 113     # AL = convert lower nibble to hex
 114     8b/copy                         1/mod/*+disp8   5/rm32/ebp    .           .             .           0/r32/eax   0xc/disp8       .                 # copy *(ebp+12) to eax
 115     25/and-eax  0xf/imm32
 116     # . AL = to-hex-char(AL)
-117     e8/call  to-hex-char/disp32
+117     e8/call  to-hex-char/disp32
 118     # write-byte-buffered(f, AL)
 119     # . . push args
 120     50/push-eax
 121     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
 122     # . . call
-123     e8/call  write-byte-buffered/disp32
+123     e8/call  write-byte-buffered/disp32
 124     # . . discard args
 125     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 126 $write-byte-hex-buffered:end:
@@ -197,40 +197,40 @@ if ('onhashchange' in window) {
 136     # setup
 137     # . clear-stream(_test-stream)
 138     # . . push args
-139     68/push  _test-stream/imm32
+139     68/push  _test-stream/imm32
 140     # . . call
-141     e8/call  clear-stream/disp32
+141     e8/call  clear-stream/disp32
 142     # . . discard args
 143     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 144     # . clear-stream($_test-buffered-file->buffer)
 145     # . . push args
 146     68/push  $_test-buffered-file->buffer/imm32
 147     # . . call
-148     e8/call  clear-stream/disp32
+148     e8/call  clear-stream/disp32
 149     # . . discard args
 150     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 151     # write-byte-hex-buffered(_test-buffered-file, 0xa)  # exercises digit, non-digit as well as leading zero
 152     # . . push args
 153     68/push  0xa/imm32
-154     68/push  _test-buffered-file/imm32
+154     68/push  _test-buffered-file/imm32
 155     # . . call
-156     e8/call  write-byte-hex-buffered/disp32
+156     e8/call  write-byte-hex-buffered/disp32
 157     # . . discard args
 158     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 159     # flush(_test-buffered-file)
 160     # . . push args
-161     68/push  _test-buffered-file/imm32
+161     68/push  _test-buffered-file/imm32
 162     # . . call
-163     e8/call  flush/disp32
+163     e8/call  flush/disp32
 164     # . . discard args
 165     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 166     # check-stream-equal(_test-stream, "0a", msg)
 167     # . . push args
 168     68/push  "F - test-write-byte-hex-buffered"/imm32
 169     68/push  "0a"/imm32
-170     68/push  _test-stream/imm32
+170     68/push  _test-stream/imm32
 171     # . . call
-172     e8/call  check-stream-equal/disp32
+172     e8/call  check-stream-equal/disp32
 173     # . . discard args
 174     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 175     # . end
@@ -261,7 +261,7 @@ if ('onhashchange' in window) {
 200     68/push  "0x"/imm32
 201     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
 202     # . . call
-203     e8/call  write/disp32
+203     e8/call  write/disp32
 204     # . . discard args
 205     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 206 $write-int32-hex:loop:
@@ -273,13 +273,13 @@ if ('onhashchange' in window) {
 212     d3/>>ecx    5/subop/pad-zeroes  3/mod/direct    0/rm32/eax    .           .             .           .           .               .                 # shift eax right by ecx bits, padding zeroes
 213     # eax = to-hex-char(AL)
 214     25/and-eax  0xf/imm32
-215     e8/call  to-hex-char/disp32
+215     e8/call  to-hex-char/disp32
 216     # append-byte(f, AL)
 217     # . . push args
 218     50/push-eax
 219     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
 220     # . . call
-221     e8/call  append-byte/disp32
+221     e8/call  append-byte/disp32
 222     # . . discard args
 223     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 224     # ecx -= 4
@@ -299,26 +299,26 @@ if ('onhashchange' in window) {
 238     # setup
 239     # . clear-stream(_test-stream)
 240     # . . push args
-241     68/push  _test-stream/imm32
+241     68/push  _test-stream/imm32
 242     # . . call
-243     e8/call  clear-stream/disp32
+243     e8/call  clear-stream/disp32
 244     # . . discard args
 245     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 246     # write-int32-hex(_test-stream, 0x8899aa)
 247     # . . push args
 248     68/push  0x8899aa/imm32
-249     68/push  _test-stream/imm32
+249     68/push  _test-stream/imm32
 250     # . . call
-251     e8/call  write-int32-hex/disp32
+251     e8/call  write-int32-hex/disp32
 252     # . . discard args
 253     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 254     # check-stream-equal(_test-stream, "0x008899aa", msg)
 255     # . . push args
 256     68/push  "F - test-write-int32-hex"/imm32
 257     68/push  "0x008899aa"/imm32
-258     68/push  _test-stream/imm32
+258     68/push  _test-stream/imm32
 259     # . . call
-260     e8/call  check-stream-equal/disp32
+260     e8/call  check-stream-equal/disp32
 261     # . . discard args
 262     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 263     # . end
@@ -349,7 +349,7 @@ if ('onhashchange' in window) {
 288     68/push  "0x"/imm32
 289     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
 290     # . . call
-291     e8/call  write-buffered/disp32
+291     e8/call  write-buffered/disp32
 292     # . . discard args
 293     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 294 $write-int32-hex-buffered:loop:
@@ -361,13 +361,13 @@ if ('onhashchange' in window) {
 300     d3/>>ecx    5/subop/pad-zeroes  3/mod/direct    0/rm32/eax    .           .             .           .           .               .                 # shift eax right by ecx bits, padding zeroes
 301     # eax = to-hex-char(AL)
 302     25/and-eax  0xf/imm32
-303     e8/call  to-hex-char/disp32
+303     e8/call  to-hex-char/disp32
 304     # write-byte-buffered(f, AL)
 305     # . . push args
 306     50/push-eax
 307     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
 308     # . . call
-309     e8/call  write-byte-buffered/disp32
+309     e8/call  write-byte-buffered/disp32
 310     # . . discard args
 311     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 312     # ecx -= 4
@@ -387,31 +387,31 @@ if ('onhashchange' in window) {
 326     # setup
 327     # . clear-stream(_test-stream)
 328     # . . push args
-329     68/push  _test-stream/imm32
+329     68/push  _test-stream/imm32
 330     # . . call
-331     e8/call  clear-stream/disp32
+331     e8/call  clear-stream/disp32
 332     # . . discard args
 333     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 334     # . clear-stream($_test-buffered-file->buffer)
 335     # . . push args
 336     68/push  $_test-buffered-file->buffer/imm32
 337     # . . call
-338     e8/call  clear-stream/disp32
+338     e8/call  clear-stream/disp32
 339     # . . discard args
 340     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 341     # write-int32-hex-buffered(_test-buffered-file, 0x8899aa)
 342     # . . push args
 343     68/push  0x8899aa/imm32
-344     68/push  _test-buffered-file/imm32
+344     68/push  _test-buffered-file/imm32
 345     # . . call
-346     e8/call  write-int32-hex-buffered/disp32
+346     e8/call  write-int32-hex-buffered/disp32
 347     # . . discard args
 348     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 349     # flush(_test-buffered-file)
 350     # . . push args
-351     68/push  _test-buffered-file/imm32
+351     68/push  _test-buffered-file/imm32
 352     # . . call
-353     e8/call  flush/disp32
+353     e8/call  flush/disp32
 354     # . . discard args
 355     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 356 +-- 18 lines: #?     # dump line --------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -419,9 +419,9 @@ if ('onhashchange' in window) {
 375     # . . push args
 376     68/push  "F - test-write-int32-hex-buffered"/imm32
 377     68/push  "0x008899aa"/imm32
-378     68/push  _test-stream/imm32
+378     68/push  _test-stream/imm32
 379     # . . call
-380     e8/call  check-stream-equal/disp32
+380     e8/call  check-stream-equal/disp32
 381     # . . discard args
 382     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 383     # . end
diff --git a/html/067parse-hex.subx.html b/html/118parse-hex.subx.html
similarity index 97%
rename from html/067parse-hex.subx.html
rename to html/118parse-hex.subx.html
index 73cc6428..96cf9f27 100644
--- a/html/067parse-hex.subx.html
+++ b/html/118parse-hex.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 067parse-hex.subx
+Mu - 118parse-hex.subx
 
 
 
@@ -56,7 +56,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/067parse-hex.subx
+https://github.com/akkartik/mu/blob/master/118parse-hex.subx
 
   1 # some utilities for converting numbers from hex
   2 # lowercase letters only for now
@@ -66,7 +66,7 @@ if ('onhashchange' in window) {
   6 # . op          subop               mod             rm32          base        index         scale       r32
   7 # . 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
   8 
-  9 is-hex-int?:  # in: (addr slice) -> eax: boolean
+  9 is-hex-int?:  # in: (addr slice) -> result/eax: boolean
  10     # . prologue
  11     55/push-ebp
  12     89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
@@ -121,7 +121,7 @@ if ('onhashchange' in window) {
  61     8a/copy-byte                    0/mod/indirect  1/rm32/ecx    .           .             .           0/r32/AL    .               .                 # copy byte at *ecx to AL
  62     50/push-eax
  63     # . . call
- 64     e8/call  is-hex-digit?/disp32
+ 64     e8/call  is-hex-digit?/disp32
  65     # . . discard args
  66     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  67     # if (eax == false) return false
@@ -161,7 +161,7 @@ if ('onhashchange' in window) {
 101     # . . push args
 102     51/push-ecx
 103     # . . call
-104     e8/call  is-hex-int?/disp32
+104     e8/call  is-hex-int?/disp32
 105     # . . discard args
 106     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 107     # check-ints-equal(eax, 1, msg)
@@ -170,7 +170,7 @@ if ('onhashchange' in window) {
 110     68/push  1/imm32/true
 111     50/push-eax
 112     # . . call
-113     e8/call  check-ints-equal/disp32
+113     e8/call  check-ints-equal/disp32
 114     # . . discard args
 115     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 116     # . epilogue
@@ -195,7 +195,7 @@ if ('onhashchange' in window) {
 135     # . . push args
 136     51/push-ecx
 137     # . . call
-138     e8/call  is-hex-int?/disp32
+138     e8/call  is-hex-int?/disp32
 139     # . . discard args
 140     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 141     # check-ints-equal(eax, 1, msg)
@@ -204,7 +204,7 @@ if ('onhashchange' in window) {
 144     68/push  1/imm32/true
 145     50/push-eax
 146     # . . call
-147     e8/call  check-ints-equal/disp32
+147     e8/call  check-ints-equal/disp32
 148     # . . discard args
 149     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 150     # . epilogue
@@ -229,7 +229,7 @@ if ('onhashchange' in window) {
 169     # . . push args
 170     51/push-ecx
 171     # . . call
-172     e8/call  is-hex-int?/disp32
+172     e8/call  is-hex-int?/disp32
 173     # . . discard args
 174     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 175     # check-ints-equal(eax, 0, msg)
@@ -238,7 +238,7 @@ if ('onhashchange' in window) {
 178     68/push  0/imm32/false
 179     50/push-eax
 180     # . . call
-181     e8/call  check-ints-equal/disp32
+181     e8/call  check-ints-equal/disp32
 182     # . . discard args
 183     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 184     # . epilogue
@@ -263,7 +263,7 @@ if ('onhashchange' in window) {
 203     # . . push args
 204     51/push-ecx
 205     # . . call
-206     e8/call  is-hex-int?/disp32
+206     e8/call  is-hex-int?/disp32
 207     # . . discard args
 208     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 209     # check-ints-equal(eax, 0, msg)
@@ -272,7 +272,7 @@ if ('onhashchange' in window) {
 212     68/push  0/imm32/false
 213     50/push-eax
 214     # . . call
-215     e8/call  check-ints-equal/disp32
+215     e8/call  check-ints-equal/disp32
 216     # . . discard args
 217     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 218     # . epilogue
@@ -292,7 +292,7 @@ if ('onhashchange' in window) {
 232     # . . push args
 233     51/push-ecx
 234     # . . call
-235     e8/call  is-hex-int?/disp32
+235     e8/call  is-hex-int?/disp32
 236     # . . discard args
 237     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 238     # check-ints-equal(eax, 0, msg)
@@ -301,7 +301,7 @@ if ('onhashchange' in window) {
 241     68/push  0/imm32/false
 242     50/push-eax
 243     # . . call
-244     e8/call  check-ints-equal/disp32
+244     e8/call  check-ints-equal/disp32
 245     # . . discard args
 246     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 247     # . epilogue
@@ -326,7 +326,7 @@ if ('onhashchange' in window) {
 266     # . . push args
 267     51/push-ecx
 268     # . . call
-269     e8/call  is-hex-int?/disp32
+269     e8/call  is-hex-int?/disp32
 270     # . . discard args
 271     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 272     # check-ints-equal(eax, 1, msg)
@@ -335,7 +335,7 @@ if ('onhashchange' in window) {
 275     68/push  1/imm32/true
 276     50/push-eax
 277     # . . call
-278     e8/call  check-ints-equal/disp32
+278     e8/call  check-ints-equal/disp32
 279     # . . discard args
 280     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 281     # . epilogue
@@ -360,7 +360,7 @@ if ('onhashchange' in window) {
 300     # . . push args
 301     51/push-ecx
 302     # . . call
-303     e8/call  is-hex-int?/disp32
+303     e8/call  is-hex-int?/disp32
 304     # . . discard args
 305     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 306     # check-ints-equal(eax, 1, msg)
@@ -369,7 +369,7 @@ if ('onhashchange' in window) {
 309     68/push  1/imm32/true
 310     50/push-eax
 311     # . . call
-312     e8/call  check-ints-equal/disp32
+312     e8/call  check-ints-equal/disp32
 313     # . . discard args
 314     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 315     # . epilogue
@@ -394,7 +394,7 @@ if ('onhashchange' in window) {
 334     # . . push args
 335     51/push-ecx
 336     # . . call
-337     e8/call  is-hex-int?/disp32
+337     e8/call  is-hex-int?/disp32
 338     # . . discard args
 339     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 340     # check-ints-equal(eax, 1, msg)
@@ -403,7 +403,7 @@ if ('onhashchange' in window) {
 343     68/push  1/imm32/true
 344     50/push-eax
 345     # . . call
-346     e8/call  check-ints-equal/disp32
+346     e8/call  check-ints-equal/disp32
 347     # . . discard args
 348     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 349     # . epilogue
@@ -432,7 +432,7 @@ if ('onhashchange' in window) {
 372     52/push-edx
 373     51/push-ecx
 374     # . . call
-375     e8/call  parse-hex-int-helper/disp32
+375     e8/call  parse-hex-int-helper/disp32
 376     # . . discard args
 377     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 378 $parse-hex-int:end:
@@ -462,7 +462,7 @@ if ('onhashchange' in window) {
 402     52/push-edx
 403     51/push-ecx
 404     # . . call
-405     e8/call  parse-hex-int-helper/disp32
+405     e8/call  parse-hex-int-helper/disp32
 406     # . . discard args
 407     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 408 $parse-hex-int-from-slice:end:
@@ -528,7 +528,7 @@ if ('onhashchange' in window) {
 468     # . . copy arg to eax
 469     8a/copy-byte                    0/mod/indirect  1/rm32/ecx    .           .             .           0/r32/AL    .               .                 # copy byte at *ecx to AL
 470     # . . call
-471     e8/call  from-hex-char/disp32
+471     e8/call  from-hex-char/disp32
 472     # result = result * 16 + eax
 473     c1/shift    4/subop/left        3/mod/direct    3/rm32/ebx    .           .             .           .           .               4/imm8            # shift ebx left by 4 bits
 474     01/add                          3/mod/direct    3/rm32/ebx    .           .             .           0/r32/eax   .               .                 # add eax to ebx
@@ -571,7 +571,7 @@ if ('onhashchange' in window) {
 511     # . . push args
 512     51/push-ecx
 513     # . . call
-514     e8/call  parse-hex-int-from-slice/disp32
+514     e8/call  parse-hex-int-from-slice/disp32
 515     # . . discard args
 516     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 517     # check-ints-equal(eax, 0xa, msg)
@@ -580,7 +580,7 @@ if ('onhashchange' in window) {
 520     68/push  0xa/imm32
 521     50/push-eax
 522     # . . call
-523     e8/call  check-ints-equal/disp32
+523     e8/call  check-ints-equal/disp32
 524     # . . discard args
 525     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 526     # . epilogue
@@ -605,7 +605,7 @@ if ('onhashchange' in window) {
 545     # . . push args
 546     51/push-ecx
 547     # . . call
-548     e8/call  parse-hex-int-from-slice/disp32
+548     e8/call  parse-hex-int-from-slice/disp32
 549     # . . discard args
 550     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 551     # check-ints-equal(eax, 0x34a, msg)
@@ -614,7 +614,7 @@ if ('onhashchange' in window) {
 554     68/push  0x34a/imm32
 555     50/push-eax
 556     # . . call
-557     e8/call  check-ints-equal/disp32
+557     e8/call  check-ints-equal/disp32
 558     # . . discard args
 559     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 560     # . epilogue
@@ -639,7 +639,7 @@ if ('onhashchange' in window) {
 579     # . . push args
 580     51/push-ecx
 581     # . . call
-582     e8/call  parse-hex-int-from-slice/disp32
+582     e8/call  parse-hex-int-from-slice/disp32
 583     # . . discard args
 584     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 585     # check-ints-equal(eax, 0x34a, msg)
@@ -648,7 +648,7 @@ if ('onhashchange' in window) {
 588     68/push  0x34/imm32
 589     50/push-eax
 590     # . . call
-591     e8/call  check-ints-equal/disp32
+591     e8/call  check-ints-equal/disp32
 592     # . . discard args
 593     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 594     # . epilogue
@@ -673,7 +673,7 @@ if ('onhashchange' in window) {
 613     # . . push args
 614     51/push-ecx
 615     # . . call
-616     e8/call  parse-hex-int-from-slice/disp32
+616     e8/call  parse-hex-int-from-slice/disp32
 617     # . . discard args
 618     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 619     # check-ints-equal(eax, 0x34a, msg)
@@ -682,7 +682,7 @@ if ('onhashchange' in window) {
 622     68/push  0/imm32
 623     50/push-eax
 624     # . . call
-625     e8/call  check-ints-equal/disp32
+625     e8/call  check-ints-equal/disp32
 626     # . . discard args
 627     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 628     # . epilogue
@@ -707,7 +707,7 @@ if ('onhashchange' in window) {
 647     # . . push args
 648     51/push-ecx
 649     # . . call
-650     e8/call  parse-hex-int-from-slice/disp32
+650     e8/call  parse-hex-int-from-slice/disp32
 651     # . . discard args
 652     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 653     # check-ints-equal(eax, 0x3, msg)
@@ -716,7 +716,7 @@ if ('onhashchange' in window) {
 656     68/push  0x3/imm32
 657     50/push-eax
 658     # . . call
-659     e8/call  check-ints-equal/disp32
+659     e8/call  check-ints-equal/disp32
 660     # . . discard args
 661     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 662     # . epilogue
@@ -741,7 +741,7 @@ if ('onhashchange' in window) {
 681     # . . push args
 682     51/push-ecx
 683     # . . call
-684     e8/call  parse-hex-int-from-slice/disp32
+684     e8/call  parse-hex-int-from-slice/disp32
 685     # . . discard args
 686     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 687     # check-ints-equal(eax, -3, msg)
@@ -750,7 +750,7 @@ if ('onhashchange' in window) {
 690     68/push  -3/imm32
 691     50/push-eax
 692     # . . call
-693     e8/call  check-ints-equal/disp32
+693     e8/call  check-ints-equal/disp32
 694     # . . discard args
 695     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 696     # . epilogue
@@ -758,7 +758,7 @@ if ('onhashchange' in window) {
 698     5d/pop-to-ebp
 699     c3/return
 700 
-701 is-hex-digit?:  # c: byte -> eax: boolean
+701 is-hex-digit?:  # c: byte -> result/eax: boolean
 702     # . prologue
 703     55/push-ebp
 704     89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
@@ -799,7 +799,7 @@ if ('onhashchange' in window) {
 739     # . . push args
 740     68/push  0x2f/imm32
 741     # . . call
-742     e8/call  is-hex-digit?/disp32
+742     e8/call  is-hex-digit?/disp32
 743     # . . discard args
 744     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 745     # check-ints-equal(eax, 0, msg)
@@ -808,7 +808,7 @@ if ('onhashchange' in window) {
 748     68/push  0/imm32/false
 749     50/push-eax
 750     # . . call
-751     e8/call  check-ints-equal/disp32
+751     e8/call  check-ints-equal/disp32
 752     # . . discard args
 753     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 754     c3/return
@@ -818,7 +818,7 @@ if ('onhashchange' in window) {
 758     # . . push args
 759     68/push  0x30/imm32
 760     # . . call
-761     e8/call  is-hex-digit?/disp32
+761     e8/call  is-hex-digit?/disp32
 762     # . . discard args
 763     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 764     # check-ints-equal(eax, 1, msg)
@@ -827,14 +827,14 @@ if ('onhashchange' in window) {
 767     68/push  1/imm32/true
 768     50/push-eax
 769     # . . call
-770     e8/call  check-ints-equal/disp32
+770     e8/call  check-ints-equal/disp32
 771     # . . discard args
 772     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 773     # eax = is-hex-digit?(0x39)
 774     # . . push args
 775     68/push  0x39/imm32
 776     # . . call
-777     e8/call  is-hex-digit?/disp32
+777     e8/call  is-hex-digit?/disp32
 778     # . . discard args
 779     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 780     # check-ints-equal(eax, 1, msg)
@@ -843,7 +843,7 @@ if ('onhashchange' in window) {
 783     68/push  1/imm32/true
 784     50/push-eax
 785     # . . call
-786     e8/call  check-ints-equal/disp32
+786     e8/call  check-ints-equal/disp32
 787     # . . discard args
 788     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 789     c3/return
@@ -853,7 +853,7 @@ if ('onhashchange' in window) {
 793     # . . push args
 794     68/push  0x3a/imm32
 795     # . . call
-796     e8/call  is-hex-digit?/disp32
+796     e8/call  is-hex-digit?/disp32
 797     # . . discard args
 798     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 799     # check-ints-equal(eax, 0, msg)
@@ -862,7 +862,7 @@ if ('onhashchange' in window) {
 802     68/push  0/imm32/false
 803     50/push-eax
 804     # . . call
-805     e8/call  check-ints-equal/disp32
+805     e8/call  check-ints-equal/disp32
 806     # . . discard args
 807     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 808     c3/return
@@ -872,7 +872,7 @@ if ('onhashchange' in window) {
 812     # . . push args
 813     68/push  0x61/imm32
 814     # . . call
-815     e8/call  is-hex-digit?/disp32
+815     e8/call  is-hex-digit?/disp32
 816     # . . discard args
 817     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 818     # check-ints-equal(eax, 1, msg)
@@ -881,14 +881,14 @@ if ('onhashchange' in window) {
 821     68/push  1/imm32/true
 822     50/push-eax
 823     # . . call
-824     e8/call  check-ints-equal/disp32
+824     e8/call  check-ints-equal/disp32
 825     # . . discard args
 826     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 827     # eax = is-hex-digit?(0x66)
 828     # . . push args
 829     68/push  0x66/imm32
 830     # . . call
-831     e8/call  is-hex-digit?/disp32
+831     e8/call  is-hex-digit?/disp32
 832     # . . discard args
 833     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 834     # check-ints-equal(eax, 1, msg)
@@ -897,7 +897,7 @@ if ('onhashchange' in window) {
 837     68/push  1/imm32/true
 838     50/push-eax
 839     # . . call
-840     e8/call  check-ints-equal/disp32
+840     e8/call  check-ints-equal/disp32
 841     # . . discard args
 842     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 843     c3/return
@@ -907,7 +907,7 @@ if ('onhashchange' in window) {
 847     # . . push args
 848     68/push  0x67/imm32
 849     # . . call
-850     e8/call  is-hex-digit?/disp32
+850     e8/call  is-hex-digit?/disp32
 851     # . . discard args
 852     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 853     # check-ints-equal(eax, 0, msg)
@@ -916,7 +916,7 @@ if ('onhashchange' in window) {
 856     68/push  0/imm32/false
 857     50/push-eax
 858     # . . call
-859     e8/call  check-ints-equal/disp32
+859     e8/call  check-ints-equal/disp32
 860     # . . discard args
 861     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 862     c3/return
@@ -953,7 +953,7 @@ if ('onhashchange' in window) {
 893     68/push  "invalid hex char: "/imm32
 894     68/push  2/imm32/stderr
 895     # . . call
-896     e8/call  _write/disp32
+896     e8/call  _write/disp32
 897     # . . discard args
 898     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 899     # . clear-stream($Stderr->buffer)
@@ -962,7 +962,7 @@ if ('onhashchange' in window) {
 902     # . . push args
 903     68/push  $Stderr->buffer/imm32
 904     # . . call
-905     e8/call  clear-stream/disp32
+905     e8/call  clear-stream/disp32
 906     # . . discard args
 907     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 908     # . . restore eax
@@ -970,24 +970,24 @@ if ('onhashchange' in window) {
 910     # . write-int32-hex-buffered(Stderr, eax)
 911     # . . push args
 912     50/push-eax
-913     68/push  Stderr/imm32
+913     68/push  Stderr/imm32
 914     # . . call
-915     e8/call  write-int32-hex-buffered/disp32
+915     e8/call  write-int32-hex-buffered/disp32
 916     # . . discard args
 917     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 918     # . flush(Stderr)
 919     # . . push args
-920     68/push  Stderr/imm32
+920     68/push  Stderr/imm32
 921     # . . call
-922     e8/call  flush/disp32
+922     e8/call  flush/disp32
 923     # . . discard args
 924     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 925     # . _write(2/stderr, "\n")
 926     # . . push args
-927     68/push  Newline/imm32
+927     68/push  Newline/imm32
 928     68/push  2/imm32/stderr
 929     # . . call
-930     e8/call  _write/disp32
+930     e8/call  _write/disp32
 931     # . . discard args
 932     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 933     # . syscall(exit, 1)
diff --git a/html/068error-byte.subx.html b/html/119error-byte.subx.html
similarity index 93%
rename from html/068error-byte.subx.html
rename to html/119error-byte.subx.html
index b726153f..c228e7fe 100644
--- a/html/068error-byte.subx.html
+++ b/html/119error-byte.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 068error-byte.subx
+Mu - 119error-byte.subx
 
 
 
@@ -56,7 +56,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/068error-byte.subx
+https://github.com/akkartik/mu/blob/master/119error-byte.subx
 
  1 # Print an error message followed by the text representation of a byte. Then exit.
  2 
@@ -92,7 +92,7 @@ if ('onhashchange' in window) {
 32     68/push  "Error: "/imm32
 33     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
 34     # . . call
-35     e8/call  write-buffered/disp32
+35     e8/call  write-buffered/disp32
 36     # . . discard args
 37     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 38     # write-buffered(out, msg)
@@ -100,7 +100,7 @@ if ('onhashchange' in window) {
 40     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0x10/disp8      .                 # push *(ebp+16)
 41     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
 42     # . . call
-43     e8/call  write-buffered/disp32
+43     e8/call  write-buffered/disp32
 44     # . . discard args
 45     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 46     # write-buffered(out, ": ")
@@ -108,7 +108,7 @@ if ('onhashchange' in window) {
 48     68/push  ": "/imm32
 49     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
 50     # . . call
-51     e8/call  write-buffered/disp32
+51     e8/call  write-buffered/disp32
 52     # . . discard args
 53     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 54     # write-byte-hex-buffered(out, byte)
@@ -116,22 +116,22 @@ if ('onhashchange' in window) {
 56     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0x14/disp8      .                 # push *(ebp+20)
 57     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
 58     # . . call
-59     e8/call  write-byte-hex-buffered/disp32
+59     e8/call  write-byte-hex-buffered/disp32
 60     # . . discard args
 61     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 62     # write-buffered(out, Newline)
 63     # . . push args
-64     68/push  Newline/imm32
+64     68/push  Newline/imm32
 65     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
 66     # . . call
-67     e8/call  write-buffered/disp32
+67     e8/call  write-buffered/disp32
 68     # . . discard args
 69     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 70     # flush(out)
 71     # . . push args
 72     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
 73     # . . call
-74     e8/call  flush/disp32
+74     e8/call  flush/disp32
 75     # . . discard args
 76     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 77     # stop(ed, 1)
@@ -139,7 +139,7 @@ if ('onhashchange' in window) {
 79     68/push  1/imm32
 80     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
 81     # . . call
-82     e8/call  stop/disp32
+82     e8/call  stop/disp32
 83     # should never get past this point
 84 $error-byte:dead-end:
 85     # . epilogue
diff --git a/html/069allocate.subx.html b/html/120allocate.subx.html
similarity index 96%
rename from html/069allocate.subx.html
rename to html/120allocate.subx.html
index 004c8816..02fd970e 100644
--- a/html/069allocate.subx.html
+++ b/html/120allocate.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 069allocate.subx
+Mu - 120allocate.subx
 
 
 
@@ -57,7 +57,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/069allocate.subx
+https://github.com/akkartik/mu/blob/master/120allocate.subx
 
   1 # Helper to dynamically allocate memory on the heap.
   2 #
@@ -109,17 +109,17 @@ if ('onhashchange' in window) {
  48     # initialize heap
  49     # . Heap = new-segment(Heap-size)
  50     # . . push args
- 51     68/push  Heap/imm32
- 52     ff          6/subop/push        0/mod/indirect  5/rm32/.disp32            .             .           .           Heap-size/disp32                  # push *Heap-size
+ 51     68/push  Heap/imm32
+ 52     ff          6/subop/push        0/mod/indirect  5/rm32/.disp32            .             .           .           Heap-size/disp32                  # push *Heap-size
  53     # . . call
- 54     e8/call  new-segment/disp32
+ 54     e8/call  new-segment/disp32
  55     # . . discard args
  56     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  57 
  58     e8/call  run-tests/disp32  # 'run-tests' is a function created automatically by SubX. It calls all functions that start with 'test-'.
  59 $array-equal-main:end:
  60     # syscall(exit, Num-test-failures)
- 61     8b/copy                         0/mod/indirect  5/rm32/.disp32            .             .           3/r32/ebx   Num-test-failures/disp32          # copy *Num-test-failures to ebx
+ 61     8b/copy                         0/mod/indirect  5/rm32/.disp32            .             .           3/r32/ebx   Num-test-failures/disp32          # copy *Num-test-failures to ebx
  62     e8/call  syscall_exit/disp32
  63 
  64 # Allocate and clear 'n' bytes of memory from an allocation-descriptor 'ad'.
@@ -136,7 +136,7 @@ if ('onhashchange' in window) {
  75     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
  76     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
  77     # . . call
- 78     e8/call  allocate-raw/disp32
+ 78     e8/call  allocate-raw/disp32
  79     # . . discard args
  80     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  81     # eax = out->payload + 4
@@ -148,7 +148,7 @@ if ('onhashchange' in window) {
  87     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
  88     50/push-eax
  89     # . . call
- 90     e8/call  zero-out/disp32
+ 90     e8/call  zero-out/disp32
  91     # . . discard args
  92     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  93 $allocate:end:
@@ -179,7 +179,7 @@ if ('onhashchange' in window) {
 118     # ebx = n
 119     8b/copy                         1/mod/*+disp8   5/rm32/ebp    .           .             .           3/r32/ebx   0xc/disp8       .                 # copy *(ebp+12) to ebx
 120     # out->alloc-id = Next-alloc-id
-121     8b/copy                         0/mod/indirect  5/rm32/.disp32            .             .           0/r32/eax   Next-alloc-id/disp32              # copy *Next-alloc-id to eax
+121     8b/copy                         0/mod/indirect  5/rm32/.disp32            .             .           0/r32/eax   Next-alloc-id/disp32              # copy *Next-alloc-id to eax
 122     89/copy                         0/mod/indirect  2/rm32/edx    .           .             .           0/r32/eax   .               .                 # copy eax to *edx
 123     # out->payload = ad->curr
 124     8b/copy                         0/mod/indirect  1/rm32/ecx    .           .             .           0/r32/eax   .               .                 # copy *ecx to eax
@@ -187,11 +187,11 @@ if ('onhashchange' in window) {
 126     89/copy                         1/mod/*+disp8   2/rm32/edx    .           .             .           0/r32/eax   4/disp8         .                 # copy eax to *(edx+4)
 127     # *out->payload = Next-alloc-id
 128     8b/copy                         1/mod/*+disp8   2/rm32/edx    .           .             .           7/r32/edi   4/disp8         .                 # copy *(edx+4) to edi
-129     8b/copy                         0/mod/indirect  5/rm32/.disp32            .             .           6/r32/esi   Next-alloc-id/disp32              # copy *Next-alloc-id to esi
+129     8b/copy                         0/mod/indirect  5/rm32/.disp32            .             .           6/r32/esi   Next-alloc-id/disp32              # copy *Next-alloc-id to esi
 130     89/copy                         0/mod/indirect  7/rm32/edi    .           .             .           6/r32/esi   .               .                 # copy esi to *edi
 131 $allocate-raw:increment-next-alloc-id:
 132     # increment *Next-alloc-id
-133     ff          0/subop/increment   0/mod/indirect  5/rm32/.disp32            .             .           .           Next-alloc-id/disp32              # increment *Next-alloc-id
+133     ff          0/subop/increment   0/mod/indirect  5/rm32/.disp32            .             .           .           Next-alloc-id/disp32              # increment *Next-alloc-id
 134     # check if there's enough space
 135     # TODO: move this check up before any state updates when we support error recovery
 136     8d/copy-address                 1/mod/*+disp8   4/rm32/sib    0/base/eax  3/index/ebx   .           0/r32/eax   4/disp8         .                 # copy eax+ebx+4 to eax
@@ -219,7 +219,7 @@ if ('onhashchange' in window) {
 158     68/push  "allocate: failed\n"/imm32
 159     68/push  2/imm32/stderr
 160     # . . call
-161     e8/call  _write/disp32
+161     e8/call  _write/disp32
 162     # . . discard args
 163     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 164     # . syscall(exit, 1)
@@ -240,7 +240,7 @@ if ('onhashchange' in window) {
 179     51/push-ecx
 180     68/push  0x200/imm32
 181     # . . call
-182     e8/call  new-segment/disp32
+182     e8/call  new-segment/disp32
 183     # . . discard args
 184     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 185     # var expected-payload/ebx = ad->curr
@@ -250,71 +250,71 @@ if ('onhashchange' in window) {
 189     68/push  0/imm32
 190     89/copy                         3/mod/direct    2/rm32/edx    .           .             .           4/r32/esp   .               .                 # copy esp to edx
 191     # *Next-alloc-id = 0x34
-192     c7          0/subop/copy        0/mod/indirect  5/rm32/.disp32            .             .           .           Next-alloc-id/disp32  0x34/imm32  # copy to *Next-alloc-id
+192     c7          0/subop/copy        0/mod/indirect  5/rm32/.disp32            .             .           .           Next-alloc-id/disp32  0x34/imm32  # copy to *Next-alloc-id
 193     # allocate-raw(ad, 3, h)
 194     # . . push args
 195     52/push-edx
 196     68/push  3/imm32
 197     51/push-ecx
 198     # . . call
-199     e8/call  allocate-raw/disp32
+199     e8/call  allocate-raw/disp32
 200     # . . discard args
 201     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 202     # check-ints-equal(h->alloc-id, 0x34, msg)
 203     # . . push args
-204     68/push  "F - test-allocate-raw-success: sets alloc-id in handle"/imm32
+204     68/push  "F - test-allocate-raw-success: sets alloc-id in handle"/imm32
 205     68/push  0x34/imm32
 206     ff          6/subop/push        0/mod/indirect  2/rm32/edx    .           .             .           .           .               .                 # push *edx
 207     # . . call
-208     e8/call  check-ints-equal/disp32
+208     e8/call  check-ints-equal/disp32
 209     # . . discard args
 210     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 211     # check-ints-equal(h->payload, expected-payload, msg)
 212     # . . push args
-213     68/push  "F - test-allocate-raw-success: sets payload in handle"/imm32
+213     68/push  "F - test-allocate-raw-success: sets payload in handle"/imm32
 214     53/push-ebx
 215     ff          6/subop/push        1/mod/*+disp8   2/rm32/edx    .           .             .           .           4/disp8         .                 # push *(edx+4)
 216     # . . call
-217     e8/call  check-ints-equal/disp32
+217     e8/call  check-ints-equal/disp32
 218     # . . discard args
 219     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 220     # check-ints-equal(h->payload->alloc-id, 0x34, msg)
 221     # . . push args
-222     68/push  "F - test-allocate-raw-success: sets alloc-id in payload"/imm32
+222     68/push  "F - test-allocate-raw-success: sets alloc-id in payload"/imm32
 223     68/push  0x34/imm32
 224     ff          6/subop/push        0/mod/indirect  3/rm32/ebx    .           .             .           .           .               .                 # push *ebx
 225     # . . call
-226     e8/call  check-ints-equal/disp32
+226     e8/call  check-ints-equal/disp32
 227     # . . discard args
 228     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 229     # check-ints-equal(*Next-alloc-id, 0x35, msg)
 230     # . . push args
-231     68/push  "F - test-allocate-raw-success: increments Next-alloc-id"/imm32
+231     68/push  "F - test-allocate-raw-success: increments Next-alloc-id"/imm32
 232     68/push  0x35/imm32
-233     ff          6/subop/push        0/mod/indirect  5/rm32/.disp32            .             .           .           Next-alloc-id/disp32              # push *Next-alloc-id
+233     ff          6/subop/push        0/mod/indirect  5/rm32/.disp32            .             .           .           Next-alloc-id/disp32              # push *Next-alloc-id
 234     # . . call
-235     e8/call  check-ints-equal/disp32
+235     e8/call  check-ints-equal/disp32
 236     # . . discard args
 237     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 238     # check-ints-equal(ad->curr - expected-payload, 3 + 4 for alloc-id, msg)
 239     # . . push args
-240     68/push  "F - test-allocate-raw-success: updates allocation descriptor"/imm32
+240     68/push  "F - test-allocate-raw-success: updates allocation descriptor"/imm32
 241     68/push  7/imm32
 242     8b/copy                         0/mod/indirect  1/rm32/ecx    .           .             .           0/r32/eax   .               .                 # copy *ecx to eax
 243     29/subtract                     3/mod/direct    0/rm32/eax    .           .             .           3/r32/ebx   .               .                 # subtract ebx from eax
 244     50/push-eax
 245     # . . call
-246     e8/call  check-ints-equal/disp32
+246     e8/call  check-ints-equal/disp32
 247     # . . discard args
 248     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 249     # clean up
-250     c7          0/subop/copy        0/mod/indirect  5/rm32/.disp32            .             .           .           Next-alloc-id/disp32  0x100/imm32 # copy to *Next-alloc-id
+250     c7          0/subop/copy        0/mod/indirect  5/rm32/.disp32            .             .           .           Next-alloc-id/disp32  0x100/imm32 # copy to *Next-alloc-id
 251     # . epilogue
 252     89/copy                         3/mod/direct    4/rm32/esp    .           .             .           5/r32/ebp   .               .                 # copy ebp to esp
 253     5d/pop-to-ebp
 254     c3/return
 255 
-256 lookup:  # h: (handle T) -> eax: (addr T)
+256 lookup:  # h: (handle T) -> result/eax: (addr T)
 257     # . prologue
 258     55/push-ebp
 259     89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
@@ -348,7 +348,7 @@ if ('onhashchange' in window) {
 287     68/push  "lookup failed\n"/imm32
 288     68/push  2/imm32/stderr
 289     # . . call
-290     e8/call  _write/disp32
+290     e8/call  _write/disp32
 291     # . . discard args
 292     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 293     # . syscall(exit, 1)
@@ -368,7 +368,7 @@ if ('onhashchange' in window) {
 307     53/push-ebx
 308     68/push  0x200/imm32
 309     # . . call
-310     e8/call  new-segment/disp32
+310     e8/call  new-segment/disp32
 311     # . . discard args
 312     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 313     # var handle/ecx: handle
@@ -383,7 +383,7 @@ if ('onhashchange' in window) {
 322     68/push  2/imm32/size
 323     53/push-ebx
 324     # . . call
-325     e8/call  allocate-raw/disp32
+325     e8/call  allocate-raw/disp32
 326     # . . discard args
 327     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 328     # eax = lookup(handle)
@@ -391,7 +391,7 @@ if ('onhashchange' in window) {
 330     ff          6/subop/push        1/mod/*+disp8   1/rm32/ecx    .           .             .           .           4/disp8         .                 # push *(ecx+4)
 331     ff          6/subop/push        0/mod/indirect  1/rm32/ecx    .           .             .           .           .               .                 # push *ecx
 332     # . . call
-333     e8/call  lookup/disp32
+333     e8/call  lookup/disp32
 334     # . . discard args
 335     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 336     # eax contains old top of heap, except skipping the alloc-id in the payload
@@ -402,11 +402,11 @@ if ('onhashchange' in window) {
 341     52/push-edx
 342     50/push-eax
 343     # . . call
-344     e8/call  check-ints-equal/disp32
+344     e8/call  check-ints-equal/disp32
 345     # . . discard args
 346     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 347     # clean up
-348     c7          0/subop/copy        0/mod/indirect  5/rm32/.disp32            .             .           .           Next-alloc-id/disp32  0x100/imm32 # copy to *Next-alloc-id
+348     c7          0/subop/copy        0/mod/indirect  5/rm32/.disp32            .             .           .           Next-alloc-id/disp32  0x100/imm32 # copy to *Next-alloc-id
 349     # . epilogue
 350     89/copy                         3/mod/direct    4/rm32/esp    .           .             .           5/r32/ebp   .               .                 # copy ebp to esp
 351     5d/pop-to-ebp
@@ -425,7 +425,7 @@ if ('onhashchange' in window) {
 364     ff          6/subop/push        1/mod/*+disp8   1/rm32/ecx    .           .             .           .           4/disp8         .                 # push *(ecx+4)
 365     ff          6/subop/push        0/mod/indirect  1/rm32/ecx    .           .             .           .           .               .                 # push *ecx
 366     # . . call
-367     e8/call  lookup/disp32
+367     e8/call  lookup/disp32
 368     # . . discard args
 369     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 370     # check-ints-equal(eax, 0, msg)
@@ -434,7 +434,7 @@ if ('onhashchange' in window) {
 373     68/push  0/imm32
 374     50/push-eax
 375     # . . call
-376     e8/call  check-ints-equal/disp32
+376     e8/call  check-ints-equal/disp32
 377     # . . discard args
 378     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 379     # . epilogue
@@ -455,7 +455,7 @@ if ('onhashchange' in window) {
 394     56/push-esi
 395     68/push  0x200/imm32
 396     # . . call
-397     e8/call  new-segment/disp32
+397     e8/call  new-segment/disp32
 398     # . . discard args
 399     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 400     # var h1/ecx: handle
@@ -471,7 +471,7 @@ if ('onhashchange' in window) {
 410     68/push  2/imm32/size
 411     56/push-esi
 412     # . . call
-413     e8/call  allocate/disp32
+413     e8/call  allocate/disp32
 414     # . . discard args
 415     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 416     # reset heap->curr to mimic reclamation
@@ -487,7 +487,7 @@ if ('onhashchange' in window) {
 426     68/push  2/imm32/size
 427     56/push-esi
 428     # . . call
-429     e8/call  allocate/disp32
+429     e8/call  allocate/disp32
 430     # . . discard args
 431     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 432     # check-ints-equal(h1->address, h2->address, msg)
@@ -496,7 +496,7 @@ if ('onhashchange' in window) {
 435     ff          6/subop/push        1/mod/*+disp8   2/rm32/ecx    .           .             .           .           4/disp8         .                 # push *(edx+4)
 436     ff          6/subop/push        1/mod/*+disp8   1/rm32/ecx    .           .             .           .           4/disp8         .                 # push *(ecx+4)
 437     # . . call
-438     e8/call  check-ints-equal/disp32
+438     e8/call  check-ints-equal/disp32
 439     # . . discard args
 440     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 441     # lookup(h1) should crash
@@ -504,19 +504,19 @@ if ('onhashchange' in window) {
 443     ff          6/subop/push        1/mod/*+disp8   1/rm32/ecx    .           .             .           .           4/disp8         .                 # push *(ecx+4)
 444     ff          6/subop/push        0/mod/indirect  1/rm32/ecx    .           .             .           .           .               .                 # push *ecx
 445     # . . call
-446     e8/call  lookup/disp32
+446     e8/call  lookup/disp32
 447     # should never get past this point
 448     # . . discard args
 449     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 450     # clean up
-451     c7          0/subop/copy        0/mod/indirect  5/rm32/.disp32            .             .           .           Next-alloc-id/disp32  0x100/imm32 # copy to *Next-alloc-id
+451     c7          0/subop/copy        0/mod/indirect  5/rm32/.disp32            .             .           .           Next-alloc-id/disp32  0x100/imm32 # copy to *Next-alloc-id
 452     # . epilogue
 453     89/copy                         3/mod/direct    4/rm32/esp    .           .             .           5/r32/ebp   .               .                 # copy ebp to esp
 454     5d/pop-to-ebp
 455     c3/return
 456 
 457 # when comparing handles, just treat them as pure values
-458 handle-equal?:  # a: handle, b: handle -> eax: boolean
+458 handle-equal?:  # a: handle, b: handle -> result/eax: boolean
 459     # . prologue
 460     55/push-ebp
 461     89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
@@ -584,7 +584,7 @@ if ('onhashchange' in window) {
 523     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
 524     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
 525     # . . call
-526     e8/call  allocate/disp32
+526     e8/call  allocate/disp32
 527     # . . discard args
 528     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 529     # eax = out->payload
@@ -624,7 +624,7 @@ if ('onhashchange' in window) {
 563     68/push  "allocate-region: failed to allocate\n"/imm32
 564     68/push  2/imm32/stderr
 565     # . . call
-566     e8/call  _write/disp32
+566     e8/call  _write/disp32
 567     # . . discard args
 568     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 569     # . syscall(exit, 1)
@@ -652,7 +652,7 @@ if ('onhashchange' in window) {
 591     52/push-edx
 592     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
 593     # . . call
-594     e8/call  allocate/disp32
+594     e8/call  allocate/disp32
 595     # . . discard args
 596     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 597     # *out->payload = n
@@ -685,7 +685,7 @@ if ('onhashchange' in window) {
 624     51/push-ecx
 625     68/push  0x200/imm32
 626     # . . call
-627     e8/call  new-segment/disp32
+627     e8/call  new-segment/disp32
 628     # . . discard args
 629     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 630     # var expected-payload/ebx = ad->curr
@@ -695,74 +695,74 @@ if ('onhashchange' in window) {
 634     68/push  0/imm32
 635     89/copy                         3/mod/direct    2/rm32/edx    .           .             .           4/r32/esp   .               .                 # copy esp to edx
 636     # *Next-alloc-id = 0x34
-637     c7          0/subop/copy        0/mod/indirect  5/rm32/.disp32            .             .           .           Next-alloc-id/disp32  0x34/imm32  # copy to *Next-alloc-id
+637     c7          0/subop/copy        0/mod/indirect  5/rm32/.disp32            .             .           .           Next-alloc-id/disp32  0x34/imm32  # copy to *Next-alloc-id
 638     # allocate-array(ad, 3, h)
 639     # . . push args
 640     52/push-edx
 641     68/push  3/imm32
 642     51/push-ecx
 643     # . . call
-644     e8/call  allocate-array/disp32
+644     e8/call  allocate-array/disp32
 645     # . . discard args
 646     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 647     # check-ints-equal(h->alloc-id, 0x34, msg)
 648     # . . push args
-649     68/push  "F - test-allocate-array: sets alloc-id in handle"/imm32
+649     68/push  "F - test-allocate-array: sets alloc-id in handle"/imm32
 650     68/push  0x34/imm32
 651     ff          6/subop/push        0/mod/indirect  2/rm32/edx    .           .             .           .           .               .                 # push *edx
 652     # . . call
-653     e8/call  check-ints-equal/disp32
+653     e8/call  check-ints-equal/disp32
 654     # . . discard args
 655     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 656     # check-ints-equal(h->payload, expected-payload, msg)
 657     # . . push args
-658     68/push  "F - test-allocate-array: sets payload in handle"/imm32
+658     68/push  "F - test-allocate-array: sets payload in handle"/imm32
 659     53/push-ebx
 660     ff          6/subop/push        1/mod/*+disp8   2/rm32/edx    .           .             .           .           4/disp8         .                 # push *(edx+4)
 661     # . . call
-662     e8/call  check-ints-equal/disp32
+662     e8/call  check-ints-equal/disp32
 663     # . . discard args
 664     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 665     # check-ints-equal(h->payload->alloc-id, 0x34, msg)
 666     # . . push args
-667     68/push  "F - test-allocate-array: sets alloc-id in payload"/imm32
+667     68/push  "F - test-allocate-array: sets alloc-id in payload"/imm32
 668     68/push  0x34/imm32
 669     ff          6/subop/push        0/mod/indirect  3/rm32/ebx    .           .             .           .           .               .                 # push *ebx
 670     # . . call
-671     e8/call  check-ints-equal/disp32
+671     e8/call  check-ints-equal/disp32
 672     # . . discard args
 673     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 674     # check-ints-equal(h->payload->size, 3, msg)
 675     # . . push args
-676     68/push  "F - test-allocate-array: sets array size in payload"/imm32
+676     68/push  "F - test-allocate-array: sets array size in payload"/imm32
 677     68/push  3/imm32
 678     ff          6/subop/push        1/mod/*+disp8   3/rm32/ebx    .           .             .           .           4/disp8         .                 # push *(ebx+4)
 679     # . . call
-680     e8/call  check-ints-equal/disp32
+680     e8/call  check-ints-equal/disp32
 681     # . . discard args
 682     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 683     # check-ints-equal(*Next-alloc-id, 0x35, msg)
 684     # . . push args
-685     68/push  "F - test-allocate-array: increments Next-alloc-id"/imm32
+685     68/push  "F - test-allocate-array: increments Next-alloc-id"/imm32
 686     68/push  0x35/imm32
-687     ff          6/subop/push        0/mod/indirect  5/rm32/.disp32            .             .           .           Next-alloc-id/disp32              # push *Next-alloc-id
+687     ff          6/subop/push        0/mod/indirect  5/rm32/.disp32            .             .           .           Next-alloc-id/disp32              # push *Next-alloc-id
 688     # . . call
-689     e8/call  check-ints-equal/disp32
+689     e8/call  check-ints-equal/disp32
 690     # . . discard args
 691     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 692     # check-ints-equal(ad->curr - expected-payload, 3 + 4 for alloc-id + 4 for array size, msg)
 693     # . . push args
-694     68/push  "F - test-allocate-array: updates allocation descriptor"/imm32
+694     68/push  "F - test-allocate-array: updates allocation descriptor"/imm32
 695     68/push  0xb/imm32
 696     8b/copy                         0/mod/indirect  1/rm32/ecx    .           .             .           0/r32/eax   .               .                 # copy *ecx to eax
 697     29/subtract                     3/mod/direct    0/rm32/eax    .           .             .           3/r32/ebx   .               .                 # subtract ebx from eax
 698     50/push-eax
 699     # . . call
-700     e8/call  check-ints-equal/disp32
+700     e8/call  check-ints-equal/disp32
 701     # . . discard args
 702     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 703     # clean up
-704     c7          0/subop/copy        0/mod/indirect  5/rm32/.disp32            .             .           .           Next-alloc-id/disp32  1/imm32     # copy to *Next-alloc-id
+704     c7          0/subop/copy        0/mod/indirect  5/rm32/.disp32            .             .           .           Next-alloc-id/disp32  1/imm32     # copy to *Next-alloc-id
 705     # . epilogue
 706     89/copy                         3/mod/direct    4/rm32/esp    .           .             .           5/r32/ebp   .               .                 # copy ebp to esp
 707     5d/pop-to-ebp
@@ -788,7 +788,7 @@ if ('onhashchange' in window) {
 727     51/push-ecx
 728     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
 729     # . . call
-730     e8/call  allocate/disp32
+730     e8/call  allocate/disp32
 731     # . . discard args
 732     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 733     # var payload/eax: (addr byte) = out->payload
@@ -810,7 +810,7 @@ if ('onhashchange' in window) {
 749     # . . push payload
 750     50/push-eax
 751     # . . call
-752     e8/call  _append-4/disp32
+752     e8/call  _append-4/disp32
 753     # . . discard args
 754     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
 755 $copy-array:end:
@@ -843,7 +843,7 @@ if ('onhashchange' in window) {
 782     51/push-ecx
 783     68/push  0x200/imm32
 784     # . . call
-785     e8/call  new-segment/disp32
+785     e8/call  new-segment/disp32
 786     # . . discard args
 787     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 788     # var expected-payload/ebx = ad->curr
@@ -853,41 +853,41 @@ if ('onhashchange' in window) {
 792     68/push  0/imm32
 793     89/copy                         3/mod/direct    2/rm32/edx    .           .             .           4/r32/esp   .               .                 # copy esp to edx
 794     # *Next-alloc-id = 0x34
-795     c7          0/subop/copy        0/mod/indirect  5/rm32/.disp32            .             .           .           Next-alloc-id/disp32  0x34/imm32  # copy to *Next-alloc-id
+795     c7          0/subop/copy        0/mod/indirect  5/rm32/.disp32            .             .           .           Next-alloc-id/disp32  0x34/imm32  # copy to *Next-alloc-id
 796     # copy-array(ad, src, h)
 797     # . . push args
 798     52/push-edx
 799     56/push-esi
 800     51/push-ecx
 801     # . . call
-802     e8/call  copy-array/disp32
+802     e8/call  copy-array/disp32
 803     # . . discard args
 804     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 805     # check-ints-equal(h->alloc-id, 0x34, msg)
 806     # . . push args
-807     68/push  "F - test-copy-array: sets alloc-id in handle"/imm32
+807     68/push  "F - test-copy-array: sets alloc-id in handle"/imm32
 808     68/push  0x34/imm32
 809     ff          6/subop/push        0/mod/indirect  2/rm32/edx    .           .             .           .           .               .                 # push *edx
 810     # . . call
-811     e8/call  check-ints-equal/disp32
+811     e8/call  check-ints-equal/disp32
 812     # . . discard args
 813     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 814     # check-ints-equal(h->payload, expected-payload, msg)
 815     # . . push args
-816     68/push  "F - test-copy-array: sets payload in handle"/imm32
+816     68/push  "F - test-copy-array: sets payload in handle"/imm32
 817     53/push-ebx
 818     ff          6/subop/push        1/mod/*+disp8   2/rm32/edx    .           .             .           .           4/disp8         .                 # push *(edx+4)
 819     # . . call
-820     e8/call  check-ints-equal/disp32
+820     e8/call  check-ints-equal/disp32
 821     # . . discard args
 822     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 823     # check-ints-equal(h->payload->alloc-id, 0x34, msg)
 824     # . . push args
-825     68/push  "F - test-copy-array: sets alloc-id in payload"/imm32
+825     68/push  "F - test-copy-array: sets alloc-id in payload"/imm32
 826     68/push  0x34/imm32
 827     ff          6/subop/push        0/mod/indirect  2/rm32/edx    .           .             .           .           .               .                 # push *edx
 828     # . . call
-829     e8/call  check-ints-equal/disp32
+829     e8/call  check-ints-equal/disp32
 830     # . . discard args
 831     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 832     # var payload/eax: (addr int) = lookup(h)
@@ -895,40 +895,40 @@ if ('onhashchange' in window) {
 834     ff          6/subop/push        1/mod/*+disp8   2/rm32/edx    .           .             .           .           4/disp8         .                 # push *(edx+4)
 835     ff          6/subop/push        0/mod/indirect  2/rm32/edx    .           .             .           .           .               .                 # push *edx
 836     # . . call
-837     e8/call  lookup/disp32
+837     e8/call  lookup/disp32
 838     # . . discard args
 839     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 840     # check-ints-equal(payload->size, 0xc, msg)
 841     # . . push args
-842     68/push  "F - test-copy-array: sets array size in payload"/imm32
+842     68/push  "F - test-copy-array: sets array size in payload"/imm32
 843     68/push  0xc/imm32
 844     ff          6/subop/push        0/mod/indirect  0/rm32/eax    .           .             .           .           .               .                 # push *eax
 845     # . . call
-846     e8/call  check-ints-equal/disp32
+846     e8/call  check-ints-equal/disp32
 847     # . . discard args
 848     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 849     # check-ints-equal(*Next-alloc-id, 0x35, msg)
 850     # . . push args
-851     68/push  "F - test-copy-array: increments Next-alloc-id"/imm32
+851     68/push  "F - test-copy-array: increments Next-alloc-id"/imm32
 852     68/push  0x35/imm32
-853     ff          6/subop/push        0/mod/indirect  5/rm32/.disp32            .             .           .           Next-alloc-id/disp32              # push *Next-alloc-id
+853     ff          6/subop/push        0/mod/indirect  5/rm32/.disp32            .             .           .           Next-alloc-id/disp32              # push *Next-alloc-id
 854     # . . call
-855     e8/call  check-ints-equal/disp32
+855     e8/call  check-ints-equal/disp32
 856     # . . discard args
 857     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 858     # check-ints-equal(ad->curr - expected-payload, 12 + 4 for alloc-id + 4 for length, msg)
 859     # . . push args
-860     68/push  "F - test-copy-array: updates allocation descriptor"/imm32
+860     68/push  "F - test-copy-array: updates allocation descriptor"/imm32
 861     68/push  0x14/imm32
 862     8b/copy                         0/mod/indirect  1/rm32/ecx    .           .             .           0/r32/eax   .               .                 # copy *ecx to eax
 863     29/subtract                     3/mod/direct    0/rm32/eax    .           .             .           3/r32/ebx   .               .                 # subtract ebx from eax
 864     50/push-eax
 865     # . . call
-866     e8/call  check-ints-equal/disp32
+866     e8/call  check-ints-equal/disp32
 867     # . . discard args
 868     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 869     # clean up
-870     c7          0/subop/copy        0/mod/indirect  5/rm32/.disp32            .             .           .           Next-alloc-id/disp32  1/imm32     # copy to *Next-alloc-id
+870     c7          0/subop/copy        0/mod/indirect  5/rm32/.disp32            .             .           .           Next-alloc-id/disp32  1/imm32     # copy to *Next-alloc-id
 871     # . epilogue
 872     89/copy                         3/mod/direct    4/rm32/esp    .           .             .           5/r32/ebp   .               .                 # copy ebp to esp
 873     5d/pop-to-ebp
@@ -993,7 +993,7 @@ if ('onhashchange' in window) {
 932     68/push  3/imm32/len
 933     51/push-ecx
 934     # . . call
-935     e8/call  zero-out/disp32
+935     e8/call  zero-out/disp32
 936     # . . discard args
 937     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 938     # first 3 bytes cleared, fourth left alone
@@ -1003,7 +1003,7 @@ if ('onhashchange' in window) {
 942     68/push  0x37000000/imm32
 943     ff          6/subop/push        0/mod/indirect  1/rm32/ecx    .           .             .           .           .               .                 # push *ecx
 944     # . . call
-945     e8/call  check-ints-equal/disp32
+945     e8/call  check-ints-equal/disp32
 946     # . . discard args
 947     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 948     # . epilogue
diff --git a/html/070new-stream.subx.html b/html/121new-stream.subx.html
similarity index 95%
rename from html/070new-stream.subx.html
rename to html/121new-stream.subx.html
index a9752192..54680d2c 100644
--- a/html/070new-stream.subx.html
+++ b/html/121new-stream.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 070new-stream.subx
+Mu - 121new-stream.subx
 
 
 
@@ -55,7 +55,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/070new-stream.subx
+https://github.com/akkartik/mu/blob/master/121new-stream.subx
 
   1 # Helper to allocate a stream on the heap.
   2 
@@ -90,7 +90,7 @@ if ('onhashchange' in window) {
  31     50/push-eax
  32     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
  33     # . . call
- 34     e8/call  allocate/disp32
+ 34     e8/call  allocate/disp32
  35     # . . discard args
  36     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  37     # eax = out->payload
@@ -104,7 +104,7 @@ if ('onhashchange' in window) {
  45     # . . push args
  46     50/push-eax
  47     # . . call
- 48     e8/call  clear-stream/disp32
+ 48     e8/call  clear-stream/disp32
  49     # . . discard args
  50     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  51 $new-stream:end:
@@ -119,10 +119,10 @@ if ('onhashchange' in window) {
  60 $new-stream:abort:
  61     # . _write(2/stderr, error)
  62     # . . push args
- 63     68/push  "new-stream: size too large\n"/imm32
+ 63     68/push  "new-stream: size too large\n"/imm32
  64     68/push  2/imm32/stderr
  65     # . . call
- 66     e8/call  _write/disp32
+ 66     e8/call  _write/disp32
  67     # . . discard args
  68     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  69     # . syscall(exit, 1)
@@ -143,7 +143,7 @@ if ('onhashchange' in window) {
  84     51/push-ecx
  85     68/push  0x200/imm32
  86     # . . call
- 87     e8/call  new-segment/disp32
+ 87     e8/call  new-segment/disp32
  88     # . . discard args
  89     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  90     # var start/edx = ad->curr
@@ -159,29 +159,29 @@ if ('onhashchange' in window) {
 100     68/push  3/imm32
 101     51/push-ecx
 102     # . . call
-103     e8/call  new-stream/disp32
+103     e8/call  new-stream/disp32
 104     # . . discard args
 105     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
 106     # eax = out->payload
 107     8b/copy                         1/mod/*+disp8   3/rm32/ebx    .           .             .           0/r32/eax   4/disp8         .                 # copy *(ebx+4) to eax
 108     # check-ints-equal(eax, edx, msg)
 109     # . . push args
-110     68/push  "F - test-new-stream: returns current pointer of allocation descriptor"/imm32
+110     68/push  "F - test-new-stream: returns current pointer of allocation descriptor"/imm32
 111     52/push-edx
 112     50/push-eax
 113     # . . call
-114     e8/call  check-ints-equal/disp32
+114     e8/call  check-ints-equal/disp32
 115     # . . discard args
 116     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 117     # skip payload->allocid
 118     05/add-to-eax  4/imm32
 119     # check-ints-equal(eax->size, 6, msg)
 120     # . . push args
-121     68/push  "F - test-new-stream: sets size correctly"/imm32
+121     68/push  "F - test-new-stream: sets size correctly"/imm32
 122     68/push  6/imm32
 123     ff          6/subop/push        1/mod/*+disp8   0/rm32/eax    .           .             .           .           .               8/disp8           # push *(eax+8)
 124     # . . call
-125     e8/call  check-ints-equal/disp32
+125     e8/call  check-ints-equal/disp32
 126     # . . discard args
 127     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 128     # the rest is delegated to clear-stream() so we won't bother checking it
diff --git a/html/071read-line.subx.html b/html/122read-line.subx.html
similarity index 94%
rename from html/071read-line.subx.html
rename to html/122read-line.subx.html
index e32ae83c..0f403ccd 100644
--- a/html/071read-line.subx.html
+++ b/html/122read-line.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 071read-line.subx
+Mu - 122read-line.subx
 
 
 
@@ -56,7 +56,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/071read-line.subx
+https://github.com/akkartik/mu/blob/master/122read-line.subx
 
   1 == code
   2 #   instruction                     effective address                                                   register    displacement    immediate
@@ -106,7 +106,7 @@ if ('onhashchange' in window) {
  46     8d/copy-address                 1/mod/*+disp8   6/rm32/esi    .           .             .           0/r32/eax   4/disp8         .                 # copy esi+4 to eax
  47     50/push-eax
  48     # . . call
- 49     e8/call  clear-stream/disp32
+ 49     e8/call  clear-stream/disp32
  50     # . . discard args
  51     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  52     # . f->read must now be 0; update its cache at ecx
@@ -116,7 +116,7 @@ if ('onhashchange' in window) {
  56     50/push-eax
  57     ff          6/subop/push        0/mod/indirect  6/rm32/esi    .           .             .           .           .               .                 # push *esi
  58     # . . call
- 59     e8/call  read/disp32
+ 59     e8/call  read/disp32
  60     # . . discard args
  61     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  62     # if (f->write == 0) break
@@ -159,7 +159,7 @@ if ('onhashchange' in window) {
  99     68/push  "read-line-buffered: line too long\n"/imm32
 100     68/push  2/imm32/stderr
 101     # . . call
-102     e8/call  _write/disp32
+102     e8/call  _write/disp32
 103     # . . discard args
 104     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 105     # . syscall(exit, 1)
@@ -172,49 +172,49 @@ if ('onhashchange' in window) {
 112     # setup
 113     # . clear-stream(_test-stream)
 114     # . . push args
-115     68/push  _test-stream/imm32
+115     68/push  _test-stream/imm32
 116     # . . call
-117     e8/call  clear-stream/disp32
+117     e8/call  clear-stream/disp32
 118     # . . discard args
 119     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 120     # . clear-stream($_test-buffered-file->buffer)
 121     # . . push args
 122     68/push  $_test-buffered-file->buffer/imm32
 123     # . . call
-124     e8/call  clear-stream/disp32
+124     e8/call  clear-stream/disp32
 125     # . . discard args
 126     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 127     # . clear-stream(_test-tmp-stream)
 128     # . . push args
-129     68/push  _test-tmp-stream/imm32
+129     68/push  _test-tmp-stream/imm32
 130     # . . call
-131     e8/call  clear-stream/disp32
+131     e8/call  clear-stream/disp32
 132     # . . discard args
 133     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 134     # write(_test-stream, "ab\ncd")
 135     # . . push args
 136     68/push  "ab\ncd"/imm32
-137     68/push  _test-stream/imm32
+137     68/push  _test-stream/imm32
 138     # . . call
-139     e8/call  write/disp32
+139     e8/call  write/disp32
 140     # . . discard args
 141     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 142     # read a line from _test-stream (buffered by _test-buffered-file) into _test-tmp-stream
 143     # . eax = read-line-buffered(_test-buffered-file, _test-tmp-stream)
 144     # . . push args
-145     68/push  _test-tmp-stream/imm32
-146     68/push  _test-buffered-file/imm32
+145     68/push  _test-tmp-stream/imm32
+146     68/push  _test-buffered-file/imm32
 147     # . . call
-148     e8/call  read-line-buffered/disp32
+148     e8/call  read-line-buffered/disp32
 149     # . . discard args
 150     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 151     # check-next-stream-line-equal(_test-tmp-stream, "ab", msg)
 152     # . . push args
 153     68/push  "F - test-read-line-buffered"/imm32
 154     68/push  "ab"/imm32
-155     68/push  _test-tmp-stream/imm32
+155     68/push  _test-tmp-stream/imm32
 156     # . . call
-157     e8/call  check-next-stream-line-equal/disp32
+157     e8/call  check-next-stream-line-equal/disp32
 158     # . . discard args
 159     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 160     # end
@@ -224,49 +224,49 @@ if ('onhashchange' in window) {
 164     # setup
 165     # . clear-stream(_test-stream)
 166     # . . push args
-167     68/push  _test-stream/imm32
+167     68/push  _test-stream/imm32
 168     # . . call
-169     e8/call  clear-stream/disp32
+169     e8/call  clear-stream/disp32
 170     # . . discard args
 171     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 172     # . clear-stream($_test-buffered-file->buffer)
 173     # . . push args
 174     68/push  $_test-buffered-file->buffer/imm32
 175     # . . call
-176     e8/call  clear-stream/disp32
+176     e8/call  clear-stream/disp32
 177     # . . discard args
 178     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 179     # . clear-stream(_test-tmp-stream)
 180     # . . push args
-181     68/push  _test-tmp-stream/imm32
+181     68/push  _test-tmp-stream/imm32
 182     # . . call
-183     e8/call  clear-stream/disp32
+183     e8/call  clear-stream/disp32
 184     # . . discard args
 185     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 186     # write(_test-stream, "cd")
 187     # . . push args
 188     68/push  "cd"/imm32
-189     68/push  _test-stream/imm32
+189     68/push  _test-stream/imm32
 190     # . . call
-191     e8/call  write/disp32
+191     e8/call  write/disp32
 192     # . . discard args
 193     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 194     # read a line from _test-stream (buffered by _test-buffered-file) into _test-tmp-stream
 195     # . eax = read-line-buffered(_test-buffered-file, _test-tmp-stream)
 196     # . . push args
-197     68/push  _test-tmp-stream/imm32
-198     68/push  _test-buffered-file/imm32
+197     68/push  _test-tmp-stream/imm32
+198     68/push  _test-buffered-file/imm32
 199     # . . call
-200     e8/call  read-line-buffered/disp32
+200     e8/call  read-line-buffered/disp32
 201     # . . discard args
 202     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 203     # check-stream-equal(_test-tmp-stream, "cd", msg)
 204     # . . push args
 205     68/push  "F - test-read-line-buffered-reads-final-line-until-Eof"/imm32
 206     68/push  "cd"/imm32
-207     68/push  _test-tmp-stream/imm32
+207     68/push  _test-tmp-stream/imm32
 208     # . . call
-209     e8/call  check-stream-equal/disp32
+209     e8/call  check-stream-equal/disp32
 210     # . . discard args
 211     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 212     # end
@@ -343,7 +343,7 @@ if ('onhashchange' in window) {
 283     68/push  "read-line: line too long\n"/imm32
 284     68/push  2/imm32/stderr
 285     # . . call
-286     e8/call  _write/disp32
+286     e8/call  _write/disp32
 287     # . . discard args
 288     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 289     # . syscall(exit, 1)
@@ -356,42 +356,42 @@ if ('onhashchange' in window) {
 296     # setup
 297     # . clear-stream(_test-stream)
 298     # . . push args
-299     68/push  _test-stream/imm32
+299     68/push  _test-stream/imm32
 300     # . . call
-301     e8/call  clear-stream/disp32
+301     e8/call  clear-stream/disp32
 302     # . . discard args
 303     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 304     # . clear-stream(_test-tmp-stream)
 305     # . . push args
-306     68/push  _test-tmp-stream/imm32
+306     68/push  _test-tmp-stream/imm32
 307     # . . call
-308     e8/call  clear-stream/disp32
+308     e8/call  clear-stream/disp32
 309     # . . discard args
 310     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 311     # write(_test-stream, "ab\ncd")
 312     # . . push args
 313     68/push  "ab\ncd"/imm32
-314     68/push  _test-stream/imm32
+314     68/push  _test-stream/imm32
 315     # . . call
-316     e8/call  write/disp32
+316     e8/call  write/disp32
 317     # . . discard args
 318     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 319     # read a line from _test-stream into _test-tmp-stream
 320     # . eax = read-line(_test-stream, _test-tmp-stream)
 321     # . . push args
-322     68/push  _test-tmp-stream/imm32
-323     68/push  _test-stream/imm32
+322     68/push  _test-tmp-stream/imm32
+323     68/push  _test-stream/imm32
 324     # . . call
-325     e8/call  read-line/disp32
+325     e8/call  read-line/disp32
 326     # . . discard args
 327     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 328     # check-next-stream-line-equal(_test-tmp-stream, "ab", msg)
 329     # . . push args
 330     68/push  "F - test-read-line"/imm32
 331     68/push  "ab"/imm32
-332     68/push  _test-tmp-stream/imm32
+332     68/push  _test-tmp-stream/imm32
 333     # . . call
-334     e8/call  check-next-stream-line-equal/disp32
+334     e8/call  check-next-stream-line-equal/disp32
 335     # . . discard args
 336     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 337     # end
@@ -401,42 +401,42 @@ if ('onhashchange' in window) {
 341     # setup
 342     # . clear-stream(_test-stream)
 343     # . . push args
-344     68/push  _test-stream/imm32
+344     68/push  _test-stream/imm32
 345     # . . call
-346     e8/call  clear-stream/disp32
+346     e8/call  clear-stream/disp32
 347     # . . discard args
 348     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 349     # . clear-stream(_test-tmp-stream)
 350     # . . push args
-351     68/push  _test-tmp-stream/imm32
+351     68/push  _test-tmp-stream/imm32
 352     # . . call
-353     e8/call  clear-stream/disp32
+353     e8/call  clear-stream/disp32
 354     # . . discard args
 355     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 356     # write(_test-stream, "cd")
 357     # . . push args
 358     68/push  "cd"/imm32
-359     68/push  _test-stream/imm32
+359     68/push  _test-stream/imm32
 360     # . . call
-361     e8/call  write/disp32
+361     e8/call  write/disp32
 362     # . . discard args
 363     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 364     # read a line from _test-stream into _test-tmp-stream
 365     # . eax = read-line(_test-stream, _test-tmp-stream)
 366     # . . push args
-367     68/push  _test-tmp-stream/imm32
-368     68/push  _test-stream/imm32
+367     68/push  _test-tmp-stream/imm32
+368     68/push  _test-stream/imm32
 369     # . . call
-370     e8/call  read-line/disp32
+370     e8/call  read-line/disp32
 371     # . . discard args
 372     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 373     # check-stream-equal(_test-tmp-stream, "cd", msg)
 374     # . . push args
 375     68/push  "F - test-read-line-reads-final-line-until-Eof"/imm32
 376     68/push  "cd"/imm32
-377     68/push  _test-tmp-stream/imm32
+377     68/push  _test-tmp-stream/imm32
 378     # . . call
-379     e8/call  check-stream-equal/disp32
+379     e8/call  check-stream-equal/disp32
 380     # . . discard args
 381     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 382     # end
diff --git a/html/072slice.subx.html b/html/123slice.subx.html
similarity index 98%
rename from html/072slice.subx.html
rename to html/123slice.subx.html
index fce52641..3edd7130 100644
--- a/html/072slice.subx.html
+++ b/html/123slice.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 072slice.subx
+Mu - 123slice.subx
 
 
 
@@ -57,7 +57,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/072slice.subx
+https://github.com/akkartik/mu/blob/master/123slice.subx
 
    1 # new data structure: a slice is an open interval of addresses [start, end)
    2 # that includes 'start' but not 'end'
@@ -67,7 +67,7 @@ if ('onhashchange' in window) {
    6 # . op          subop               mod             rm32          base        index         scale       r32
    7 # . 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
    8 
-   9 slice-empty?:  # s: (addr slice) -> eax: boolean
+   9 slice-empty?:  # s: (addr slice) -> result/eax: boolean
   10     # . prologue
   11     55/push-ebp
   12     89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
@@ -103,7 +103,7 @@ if ('onhashchange' in window) {
   42     # . . push args
   43     51/push-ecx
   44     # . . call
-  45     e8/call  slice-empty?/disp32
+  45     e8/call  slice-empty?/disp32
   46     # . . discard args
   47     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
   48     # check-ints-equal(eax, 1, msg)
@@ -112,7 +112,7 @@ if ('onhashchange' in window) {
   51     68/push  1/imm32
   52     50/push-eax
   53     # . . call
-  54     e8/call  check-ints-equal/disp32
+  54     e8/call  check-ints-equal/disp32
   55     # . . discard args
   56     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
   57     # . epilogue
@@ -132,7 +132,7 @@ if ('onhashchange' in window) {
   71     # . . push args
   72     51/push-ecx
   73     # . . call
-  74     e8/call  slice-empty?/disp32
+  74     e8/call  slice-empty?/disp32
   75     # . . discard args
   76     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
   77     # check-ints-equal(eax, 0, msg)
@@ -141,7 +141,7 @@ if ('onhashchange' in window) {
   80     68/push  0/imm32
   81     50/push-eax
   82     # . . call
-  83     e8/call  check-ints-equal/disp32
+  83     e8/call  check-ints-equal/disp32
   84     # . . discard args
   85     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
   86     # . epilogue
@@ -161,7 +161,7 @@ if ('onhashchange' in window) {
  100     # . . push args
  101     51/push-ecx
  102     # . . call
- 103     e8/call  slice-empty?/disp32
+ 103     e8/call  slice-empty?/disp32
  104     # . . discard args
  105     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  106     # check-ints-equal(eax, 1, msg)
@@ -170,7 +170,7 @@ if ('onhashchange' in window) {
  109     68/push  1/imm32
  110     50/push-eax
  111     # . . call
- 112     e8/call  check-ints-equal/disp32
+ 112     e8/call  check-ints-equal/disp32
  113     # . . discard args
  114     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  115     # . epilogue
@@ -178,7 +178,7 @@ if ('onhashchange' in window) {
  117     5d/pop-to-ebp
  118     c3/return
  119 
- 120 slice-equal?:  # s: (addr slice), p: (addr array byte) -> eax: boolean
+ 120 slice-equal?:  # s: (addr slice), p: (addr array byte) -> result/eax: boolean
  121     # pseudocode:
  122     #   if (p == 0) return (s == 0)
  123     #   currs = s->start
@@ -286,7 +286,7 @@ if ('onhashchange' in window) {
  225     68/push  "Abc"/imm32
  226     51/push-ecx
  227     # . . call
- 228     e8/call  slice-equal?/disp32
+ 228     e8/call  slice-equal?/disp32
  229     # . . discard args
  230     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  231     # check-ints-equal(eax, 1, msg)
@@ -295,7 +295,7 @@ if ('onhashchange' in window) {
  234     68/push  1/imm32
  235     50/push-eax
  236     # . . call
- 237     e8/call  check-ints-equal/disp32
+ 237     e8/call  check-ints-equal/disp32
  238     # . . discard args
  239     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  240     # . epilogue
@@ -322,7 +322,7 @@ if ('onhashchange' in window) {
  261     68/push  "Abc"/imm32
  262     51/push-ecx
  263     # . . call
- 264     e8/call  slice-equal?/disp32
+ 264     e8/call  slice-equal?/disp32
  265     # . . discard args
  266     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  267     # check-ints-equal(eax, 0, msg)
@@ -331,7 +331,7 @@ if ('onhashchange' in window) {
  270     68/push  0/imm32
  271     50/push-eax
  272     # . . call
- 273     e8/call  check-ints-equal/disp32
+ 273     e8/call  check-ints-equal/disp32
  274     # . . discard args
  275     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  276     # . epilogue
@@ -358,7 +358,7 @@ if ('onhashchange' in window) {
  297     68/push  "Abc"/imm32
  298     51/push-ecx
  299     # . . call
- 300     e8/call  slice-equal?/disp32
+ 300     e8/call  slice-equal?/disp32
  301     # . . discard args
  302     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  303     # check-ints-equal(eax, 0, msg)
@@ -367,7 +367,7 @@ if ('onhashchange' in window) {
  306     68/push  0/imm32
  307     50/push-eax
  308     # . . call
- 309     e8/call  check-ints-equal/disp32
+ 309     e8/call  check-ints-equal/disp32
  310     # . . discard args
  311     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  312     # . epilogue
@@ -394,7 +394,7 @@ if ('onhashchange' in window) {
  333     68/push  "Abc"/imm32
  334     51/push-ecx
  335     # . . call
- 336     e8/call  slice-equal?/disp32
+ 336     e8/call  slice-equal?/disp32
  337     # . . discard args
  338     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  339     # check-ints-equal(eax, 0, msg)
@@ -403,7 +403,7 @@ if ('onhashchange' in window) {
  342     68/push  0/imm32
  343     50/push-eax
  344     # . . call
- 345     e8/call  check-ints-equal/disp32
+ 345     e8/call  check-ints-equal/disp32
  346     # . . discard args
  347     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  348     # . epilogue
@@ -425,7 +425,7 @@ if ('onhashchange' in window) {
  364     68/push  "Abc"/imm32
  365     51/push-ecx
  366     # . . call
- 367     e8/call  slice-equal?/disp32
+ 367     e8/call  slice-equal?/disp32
  368     # . . discard args
  369     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  370     # check-ints-equal(eax, 0, msg)
@@ -434,7 +434,7 @@ if ('onhashchange' in window) {
  373     68/push  0/imm32
  374     50/push-eax
  375     # . . call
- 376     e8/call  check-ints-equal/disp32
+ 376     e8/call  check-ints-equal/disp32
  377     # . . discard args
  378     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  379     # . epilogue
@@ -461,7 +461,7 @@ if ('onhashchange' in window) {
  400     68/push  ""/imm32
  401     51/push-ecx
  402     # . . call
- 403     e8/call  slice-equal?/disp32
+ 403     e8/call  slice-equal?/disp32
  404     # . . discard args
  405     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  406     # check-ints-equal(eax, 0, msg)
@@ -470,7 +470,7 @@ if ('onhashchange' in window) {
  409     68/push  0/imm32
  410     50/push-eax
  411     # . . call
- 412     e8/call  check-ints-equal/disp32
+ 412     e8/call  check-ints-equal/disp32
  413     # . . discard args
  414     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  415     # . epilogue
@@ -492,7 +492,7 @@ if ('onhashchange' in window) {
  431     68/push  ""/imm32
  432     51/push-ecx
  433     # . . call
- 434     e8/call  slice-equal?/disp32
+ 434     e8/call  slice-equal?/disp32
  435     # . . discard args
  436     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  437     # check-ints-equal(eax, 1, msg)
@@ -501,7 +501,7 @@ if ('onhashchange' in window) {
  440     68/push  1/imm32
  441     50/push-eax
  442     # . . call
- 443     e8/call  check-ints-equal/disp32
+ 443     e8/call  check-ints-equal/disp32
  444     # . . discard args
  445     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  446     # . epilogue
@@ -528,7 +528,7 @@ if ('onhashchange' in window) {
  467     68/push  0/imm32
  468     51/push-ecx
  469     # . . call
- 470     e8/call  slice-equal?/disp32
+ 470     e8/call  slice-equal?/disp32
  471     # . . discard args
  472     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  473     # check-ints-equal(eax, 0, msg)
@@ -537,7 +537,7 @@ if ('onhashchange' in window) {
  476     68/push  0/imm32
  477     50/push-eax
  478     # . . call
- 479     e8/call  check-ints-equal/disp32
+ 479     e8/call  check-ints-equal/disp32
  480     # . . discard args
  481     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  482     # . epilogue
@@ -545,7 +545,7 @@ if ('onhashchange' in window) {
  484     5d/pop-to-ebp
  485     c3/return
  486 
- 487 slice-starts-with?:  # s: (addr slice), head: (addr array byte) -> eax: boolean
+ 487 slice-starts-with?:  # s: (addr slice), head: (addr array byte) -> result/eax: boolean
  488     # pseudocode
  489     #   hsize = head->size
  490     #   if (hsize > s->end - s->start) return false
@@ -652,7 +652,7 @@ if ('onhashchange' in window) {
  591     68/push  "A"/imm32
  592     51/push-ecx
  593     # . . call
- 594     e8/call  slice-starts-with?/disp32
+ 594     e8/call  slice-starts-with?/disp32
  595     # . . discard args
  596     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  597     # check-ints-equal(eax, 1, msg)
@@ -661,7 +661,7 @@ if ('onhashchange' in window) {
  600     68/push  1/imm32
  601     50/push-eax
  602     # . . call
- 603     e8/call  check-ints-equal/disp32
+ 603     e8/call  check-ints-equal/disp32
  604     # . . discard args
  605     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  606     # . epilogue
@@ -688,7 +688,7 @@ if ('onhashchange' in window) {
  627     68/push  ""/imm32
  628     51/push-ecx
  629     # . . call
- 630     e8/call  slice-starts-with?/disp32
+ 630     e8/call  slice-starts-with?/disp32
  631     # . . discard args
  632     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  633     # check-ints-equal(eax, 1, msg)
@@ -697,7 +697,7 @@ if ('onhashchange' in window) {
  636     68/push  1/imm32
  637     50/push-eax
  638     # . . call
- 639     e8/call  check-ints-equal/disp32
+ 639     e8/call  check-ints-equal/disp32
  640     # . . discard args
  641     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  642     # . epilogue
@@ -724,7 +724,7 @@ if ('onhashchange' in window) {
  663     68/push  "Ab"/imm32
  664     51/push-ecx
  665     # . . call
- 666     e8/call  slice-starts-with?/disp32
+ 666     e8/call  slice-starts-with?/disp32
  667     # . . discard args
  668     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  669     # check-ints-equal(eax, 1, msg)
@@ -733,7 +733,7 @@ if ('onhashchange' in window) {
  672     68/push  1/imm32
  673     50/push-eax
  674     # . . call
- 675     e8/call  check-ints-equal/disp32
+ 675     e8/call  check-ints-equal/disp32
  676     # . . discard args
  677     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  678     # . epilogue
@@ -760,7 +760,7 @@ if ('onhashchange' in window) {
  699     68/push  "Abc"/imm32
  700     51/push-ecx
  701     # . . call
- 702     e8/call  slice-starts-with?/disp32
+ 702     e8/call  slice-starts-with?/disp32
  703     # . . discard args
  704     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  705     # check-ints-equal(eax, 1, msg)
@@ -769,7 +769,7 @@ if ('onhashchange' in window) {
  708     68/push  1/imm32
  709     50/push-eax
  710     # . . call
- 711     e8/call  check-ints-equal/disp32
+ 711     e8/call  check-ints-equal/disp32
  712     # . . discard args
  713     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  714     # . epilogue
@@ -796,7 +796,7 @@ if ('onhashchange' in window) {
  735     68/push  "Abd"/imm32
  736     51/push-ecx
  737     # . . call
- 738     e8/call  slice-starts-with?/disp32
+ 738     e8/call  slice-starts-with?/disp32
  739     # . . discard args
  740     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  741     # check-ints-equal(eax, 0, msg)
@@ -805,7 +805,7 @@ if ('onhashchange' in window) {
  744     68/push  0/imm32
  745     50/push-eax
  746     # . . call
- 747     e8/call  check-ints-equal/disp32
+ 747     e8/call  check-ints-equal/disp32
  748     # . . discard args
  749     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  750     # . epilogue
@@ -832,7 +832,7 @@ if ('onhashchange' in window) {
  771     68/push  "Ac"/imm32
  772     51/push-ecx
  773     # . . call
- 774     e8/call  slice-starts-with?/disp32
+ 774     e8/call  slice-starts-with?/disp32
  775     # . . discard args
  776     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  777     # check-ints-equal(eax, 0, msg)
@@ -841,7 +841,7 @@ if ('onhashchange' in window) {
  780     68/push  0/imm32
  781     50/push-eax
  782     # . . call
- 783     e8/call  check-ints-equal/disp32
+ 783     e8/call  check-ints-equal/disp32
  784     # . . discard args
  785     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  786     # . epilogue
@@ -914,7 +914,7 @@ if ('onhashchange' in window) {
  853     68/push  "write-slice: out of space"/imm32
  854     68/push  2/imm32/stderr
  855     # . . call
- 856     e8/call  _write/disp32
+ 856     e8/call  _write/disp32
  857     # . . discard args
  858     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  859     # . syscall(exit, 1)
@@ -929,9 +929,9 @@ if ('onhashchange' in window) {
  868     # setup
  869     # . clear-stream(_test-stream)
  870     # . . push args
- 871     68/push  _test-stream/imm32
+ 871     68/push  _test-stream/imm32
  872     # . . call
- 873     e8/call  clear-stream/disp32
+ 873     e8/call  clear-stream/disp32
  874     # . . discard args
  875     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  876     # (eax..ecx) = "Abc"
@@ -946,18 +946,18 @@ if ('onhashchange' in window) {
  885     # write-slice(_test-stream, slice)
  886     # . . push args
  887     51/push-ecx
- 888     68/push  _test-stream/imm32
+ 888     68/push  _test-stream/imm32
  889     # . . call
- 890     e8/call  write-slice/disp32
+ 890     e8/call  write-slice/disp32
  891     # . . discard args
  892     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  893     # check-stream-equal(_test-stream, "Abc", msg)
  894     # . . push args
  895     68/push  "F - test-write-slice"/imm32
  896     68/push  "Abc"/imm32
- 897     68/push  _test-stream/imm32
+ 897     68/push  _test-stream/imm32
  898     # . . call
- 899     e8/call  check-stream-equal/disp32
+ 899     e8/call  check-stream-equal/disp32
  900     # . . discard args
  901     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  902     # . epilogue
@@ -1002,7 +1002,7 @@ if ('onhashchange' in window) {
  941     # . . push args
  942     57/push-edi
  943     # . . call
- 944     e8/call  flush/disp32
+ 944     e8/call  flush/disp32
  945     # . . discard args
  946     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  947     # . clear-stream(stream = out+4)
@@ -1010,7 +1010,7 @@ if ('onhashchange' in window) {
  949     8d/copy-address                 1/mod/*+disp8   7/rm32/edi    .           .             .           0/r32/eax   4/disp8         .                 # copy edi+4 to eax
  950     50/push-eax
  951     # . . call
- 952     e8/call  clear-stream/disp32
+ 952     e8/call  clear-stream/disp32
  953     # . . discard args
  954     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  955     # . out->write must now be 0; update its cache at ebx
@@ -1050,16 +1050,16 @@ if ('onhashchange' in window) {
  989     # setup
  990     # . clear-stream(_test-stream)
  991     # . . push args
- 992     68/push  _test-stream/imm32
+ 992     68/push  _test-stream/imm32
  993     # . . call
- 994     e8/call  clear-stream/disp32
+ 994     e8/call  clear-stream/disp32
  995     # . . discard args
  996     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  997     # . clear-stream($_test-buffered-file->buffer)
  998     # . . push args
  999     68/push  $_test-buffered-file->buffer/imm32
 1000     # . . call
-1001     e8/call  clear-stream/disp32
+1001     e8/call  clear-stream/disp32
 1002     # . . discard args
 1003     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 1004     # (eax..ecx) = "Abc"
@@ -1074,25 +1074,25 @@ if ('onhashchange' in window) {
 1013     # write-slice-buffered(_test-buffered-file, slice)
 1014     # . . push args
 1015     51/push-ecx
-1016     68/push  _test-buffered-file/imm32
+1016     68/push  _test-buffered-file/imm32
 1017     # . . call
-1018     e8/call  write-slice-buffered/disp32
+1018     e8/call  write-slice-buffered/disp32
 1019     # . . discard args
 1020     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1021     # flush(_test-buffered-file)
 1022     # . . push args
-1023     68/push  _test-buffered-file/imm32
+1023     68/push  _test-buffered-file/imm32
 1024     # . . call
-1025     e8/call  flush/disp32
+1025     e8/call  flush/disp32
 1026     # . . discard args
 1027     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 1028     # check-stream-equal(_test-stream, "Abc", msg)
 1029     # . . push args
 1030     68/push  "F - test-write-slice-buffered"/imm32
 1031     68/push  "Abc"/imm32
-1032     68/push  _test-stream/imm32
+1032     68/push  _test-stream/imm32
 1033     # . . call
-1034     e8/call  check-stream-equal/disp32
+1034     e8/call  check-stream-equal/disp32
 1035     # . . discard args
 1036     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1037     # . epilogue
@@ -1127,7 +1127,7 @@ if ('onhashchange' in window) {
 1066     51/push-ecx
 1067     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
 1068     # . . call
-1069     e8/call  allocate/disp32
+1069     e8/call  allocate/disp32
 1070     # . . discard args
 1071     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1072     # eax = out->payload
@@ -1155,7 +1155,7 @@ if ('onhashchange' in window) {
 1094     81          0/subop/add         3/mod/direct    0/rm32/eax    .           .             .           .           .               4/imm32           # add to eax
 1095     50/push-eax
 1096     # . . call
-1097     e8/call  _append-4/disp32
+1097     e8/call  _append-4/disp32
 1098     # . . discard args
 1099     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
 1100     # restore out (assumes _append-4 can't error)
@@ -1178,7 +1178,7 @@ if ('onhashchange' in window) {
 1117     68/push  "slice-to-string: out of space\n"/imm32
 1118     68/push  2/imm32/stderr
 1119     # . . call
-1120     e8/call  _write/disp32
+1120     e8/call  _write/disp32
 1121     # . . discard args
 1122     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1123     # . syscall(exit, 1)
@@ -1199,7 +1199,7 @@ if ('onhashchange' in window) {
 1138     52/push-edx
 1139     68/push  0x200/imm32
 1140     # . . call
-1141     e8/call  new-segment/disp32
+1141     e8/call  new-segment/disp32
 1142     # . . discard args
 1143     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1144     # (eax..ecx) = "Abc"
@@ -1221,7 +1221,7 @@ if ('onhashchange' in window) {
 1160     51/push-ecx
 1161     52/push-edx
 1162     # . . call
-1163     e8/call  slice-to-string/disp32
+1163     e8/call  slice-to-string/disp32
 1164     # . . discard args
 1165     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1166     # eax = h->payload
@@ -1234,7 +1234,7 @@ if ('onhashchange' in window) {
 1198     68/push  "Abc"/imm32
 1199     50/push-eax
 1200     # . . call
-1201     e8/call  string-equal?/disp32
+1201     e8/call  string-equal?/disp32
 1202     # . . discard args
 1203     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1204     # check-ints-equal(eax, 1, msg)
@@ -1243,7 +1243,7 @@ if ('onhashchange' in window) {
 1207     68/push  1/imm32/true
 1208     50/push-eax
 1209     # . . call
-1210     e8/call  check-ints-equal/disp32
+1210     e8/call  check-ints-equal/disp32
 1211     # . . discard args
 1212     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1213     # . reclaim locals
diff --git a/html/073next-token.subx.html b/html/124next-token.subx.html
similarity index 96%
rename from html/073next-token.subx.html
rename to html/124next-token.subx.html
index 88ed6459..a14c0fb8 100644
--- a/html/073next-token.subx.html
+++ b/html/124next-token.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 073next-token.subx
+Mu - 124next-token.subx
 
 
 
@@ -55,7 +55,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/073next-token.subx
+https://github.com/akkartik/mu/blob/master/124next-token.subx
 
    1 # Some tokenization primitives.
    2 
@@ -84,7 +84,7 @@ if ('onhashchange' in window) {
   25     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
   26     56/push-esi
   27     # . . call
-  28     e8/call  skip-chars-matching/disp32
+  28     e8/call  skip-chars-matching/disp32
   29     # . . discard args
   30     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
   31     # out->start = &in->data[in->read]
@@ -96,7 +96,7 @@ if ('onhashchange' in window) {
   37     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
   38     56/push-esi
   39     # . . call
-  40     e8/call  skip-chars-not-matching/disp32
+  40     e8/call  skip-chars-not-matching/disp32
   41     # . . discard args
   42     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
   43     # out->end = &in->data[in->read]
@@ -120,9 +120,9 @@ if ('onhashchange' in window) {
   61     # setup
   62     # . clear-stream(_test-stream)
   63     # . . push args
-  64     68/push  _test-stream/imm32
+  64     68/push  _test-stream/imm32
   65     # . . call
-  66     e8/call  clear-stream/disp32
+  66     e8/call  clear-stream/disp32
   67     # . . discard args
   68     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
   69     # var slice/ecx: slice
@@ -132,44 +132,44 @@ if ('onhashchange' in window) {
   73     # write(_test-stream, "  ab")
   74     # . . push args
   75     68/push  "  ab"/imm32
-  76     68/push  _test-stream/imm32
+  76     68/push  _test-stream/imm32
   77     # . . call
-  78     e8/call  write/disp32
+  78     e8/call  write/disp32
   79     # . . discard args
   80     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
   81     # next-token(_test-stream, 0x20/space, slice)
   82     # . . push args
   83     51/push-ecx
   84     68/push  0x20/imm32
-  85     68/push  _test-stream/imm32
+  85     68/push  _test-stream/imm32
   86     # . . call
-  87     e8/call  next-token/disp32
+  87     e8/call  next-token/disp32
   88     # . . discard args
   89     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
   90     # check-ints-equal(slice->start - _test-stream->data, 2, msg)
   91     # . check-ints-equal(slice->start - _test-stream, 14, msg)
   92     # . . push args
-  93     68/push  "F - test-next-token: start"/imm32
+  93     68/push  "F - test-next-token: start"/imm32
   94     68/push  0xe/imm32
   95     # . . push slice->start - _test-stream
   96     8b/copy                         0/mod/indirect  1/rm32/ecx    .           .             .           0/r32/eax   .               .                 # copy *ecx to eax
-  97     81          5/subop/subtract    3/mod/direct    0/rm32/eax    .           .             .           .           .               _test-stream/imm32 # subtract from eax
+  97     81          5/subop/subtract    3/mod/direct    0/rm32/eax    .           .             .           .           .               _test-stream/imm32 # subtract from eax
   98     50/push-eax
   99     # . . call
- 100     e8/call  check-ints-equal/disp32
+ 100     e8/call  check-ints-equal/disp32
  101     # . . discard args
  102     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  103     # check-ints-equal(slice->end - _test-stream->data, 4, msg)
  104     # . check-ints-equal(slice->end - _test-stream, 16, msg)
  105     # . . push args
- 106     68/push  "F - test-next-token: end"/imm32
+ 106     68/push  "F - test-next-token: end"/imm32
  107     68/push  0x10/imm32
  108     # . . push slice->end - _test-stream
  109     8b/copy                         1/mod/*+disp8   1/rm32/ecx    .           .             .           0/r32/eax   4/disp8         .                 # copy *(ecx+4) to eax
- 110     81          5/subop/subtract    3/mod/direct    0/rm32/eax    .           .             .           .           .               _test-stream/imm32 # subtract from eax
+ 110     81          5/subop/subtract    3/mod/direct    0/rm32/eax    .           .             .           .           .               _test-stream/imm32 # subtract from eax
  111     50/push-eax
  112     # . . call
- 113     e8/call  check-ints-equal/disp32
+ 113     e8/call  check-ints-equal/disp32
  114     # . . discard args
  115     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  116     # . epilogue
@@ -184,9 +184,9 @@ if ('onhashchange' in window) {
  125     # setup
  126     # . clear-stream(_test-stream)
  127     # . . push args
- 128     68/push  _test-stream/imm32
+ 128     68/push  _test-stream/imm32
  129     # . . call
- 130     e8/call  clear-stream/disp32
+ 130     e8/call  clear-stream/disp32
  131     # . . discard args
  132     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  133     # var slice/ecx: slice
@@ -198,9 +198,9 @@ if ('onhashchange' in window) {
  139     # . . push args
  140     51/push-ecx
  141     68/push  0x20/imm32
- 142     68/push  _test-stream/imm32
+ 142     68/push  _test-stream/imm32
  143     # . . call
- 144     e8/call  next-token/disp32
+ 144     e8/call  next-token/disp32
  145     # . . discard args
  146     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  147     # check-ints-equal(slice->end, slice->start, msg)
@@ -209,7 +209,7 @@ if ('onhashchange' in window) {
  150     ff          6/subop/push        1/mod/*+disp8   1/rm32/ecx    .           .             .           .           4/disp8         .                 # push *(ecx+4)
  151     ff          6/subop/push        0/mod/indirect  1/rm32/ecx    .           .             .           .           .               .                 # push *ecx
  152     # . . call
- 153     e8/call  check-ints-equal/disp32
+ 153     e8/call  check-ints-equal/disp32
  154     # . . discard args
  155     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  156     # . epilogue
@@ -240,7 +240,7 @@ if ('onhashchange' in window) {
  181     51/push-ecx
  182     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
  183     # . . call
- 184     e8/call  skip-chars-matching-in-slice/disp32
+ 184     e8/call  skip-chars-matching-in-slice/disp32
  185     # . . discard args
  186     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  187     # out->start = eax
@@ -251,7 +251,7 @@ if ('onhashchange' in window) {
  192     51/push-ecx
  193     50/push-eax
  194     # . . call
- 195     e8/call  skip-chars-not-matching-in-slice/disp32
+ 195     e8/call  skip-chars-not-matching-in-slice/disp32
  196     # . . discard args
  197     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  198     # out->end = eax
@@ -286,33 +286,33 @@ if ('onhashchange' in window) {
  227     51/push-ecx
  228     50/push-eax
  229     # . . call
- 230     e8/call  next-token-from-slice/disp32
+ 230     e8/call  next-token-from-slice/disp32
  231     # . . discard args
  232     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
  233     # out->start should be at the 'a'
  234     # . check-ints-equal(out->start - in->start, 2, msg)
  235     # . . push args
- 236     68/push  "F - test-next-token-from-slice: start"/imm32
+ 236     68/push  "F - test-next-token-from-slice: start"/imm32
  237     68/push  2/imm32
  238     # . . push out->start - in->start
  239     8b/copy                         0/mod/indirect  7/rm32/edi    .           .             .           1/r32/ecx   .               .                 # copy *edi to ecx
  240     2b/subtract                     3/mod/direct    0/rm32/eax    .           .             .           1/r32/ecx   .               .                 # subtract eax from ecx
  241     51/push-ecx
  242     # . . call
- 243     e8/call  check-ints-equal/disp32
+ 243     e8/call  check-ints-equal/disp32
  244     # . . discard args
  245     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  246     # out->end should be after the 'b'
  247     # check-ints-equal(out->end - in->start, 4, msg)
  248     # . . push args
- 249     68/push  "F - test-next-token-from-slice: end"/imm32
+ 249     68/push  "F - test-next-token-from-slice: end"/imm32
  250     68/push  4/imm32
  251     # . . push out->end - in->start
  252     8b/copy                         1/mod/*+disp8   7/rm32/edi    .           .             .           1/r32/ecx   4/disp8         .                 # copy *(edi+4) to ecx
  253     2b/subtract                     3/mod/direct    0/rm32/eax    .           .             .           1/r32/ecx   .               .                 # subtract eax from ecx
  254     51/push-ecx
  255     # . . call
- 256     e8/call  check-ints-equal/disp32
+ 256     e8/call  check-ints-equal/disp32
  257     # . . discard args
  258     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  259     # . epilogue
@@ -335,7 +335,7 @@ if ('onhashchange' in window) {
  276     68/push  0/imm32
  277     68/push  0/imm32
  278     # . . call
- 279     e8/call  next-token-from-slice/disp32
+ 279     e8/call  next-token-from-slice/disp32
  280     # . . discard args
  281     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
  282     # out should be empty
@@ -348,7 +348,7 @@ if ('onhashchange' in window) {
  289     2b/subtract                     0/mod/indirect  7/rm32/edi    .           .             .           1/r32/ecx   .               .                 # subtract *edi from ecx
  290     51/push-ecx
  291     # . . call
- 292     e8/call  check-ints-equal/disp32
+ 292     e8/call  check-ints-equal/disp32
  293     # . . discard args
  294     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  295     # . epilogue
@@ -376,7 +376,7 @@ if ('onhashchange' in window) {
  317     51/push-ecx
  318     50/push-eax
  319     # . . call
- 320     e8/call  next-token-from-slice/disp32
+ 320     e8/call  next-token-from-slice/disp32
  321     # . . discard args
  322     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
  323     # out should be empty
@@ -389,7 +389,7 @@ if ('onhashchange' in window) {
  330     2b/subtract                     0/mod/indirect  7/rm32/edi    .           .             .           1/r32/ecx   .               .                 # subtract *edi from ecx
  331     51/push-ecx
  332     # . . call
- 333     e8/call  check-ints-equal/disp32
+ 333     e8/call  check-ints-equal/disp32
  334     # . . discard args
  335     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  336     # . epilogue
@@ -446,25 +446,25 @@ if ('onhashchange' in window) {
  387     # setup
  388     # . clear-stream(_test-stream)
  389     # . . push args
- 390     68/push  _test-stream/imm32
+ 390     68/push  _test-stream/imm32
  391     # . . call
- 392     e8/call  clear-stream/disp32
+ 392     e8/call  clear-stream/disp32
  393     # . . discard args
  394     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  395     # write(_test-stream, "  ab")
  396     # . . push args
  397     68/push  "  ab"/imm32
- 398     68/push  _test-stream/imm32
+ 398     68/push  _test-stream/imm32
  399     # . . call
- 400     e8/call  write/disp32
+ 400     e8/call  write/disp32
  401     # . . discard args
  402     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  403     # skip-chars-matching(_test-stream, 0x20/space)
  404     # . . push args
  405     68/push  0x20/imm32
- 406     68/push  _test-stream/imm32
+ 406     68/push  _test-stream/imm32
  407     # . . call
- 408     e8/call  skip-chars-matching/disp32
+ 408     e8/call  skip-chars-matching/disp32
  409     # . . discard args
  410     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  411     # check-ints-equal(_test-stream->read, 2, msg)
@@ -472,10 +472,10 @@ if ('onhashchange' in window) {
  413     68/push  "F - test-skip-chars-matching"/imm32
  414     68/push  2/imm32
  415     # . . push *_test-stream->read
- 416     b8/copy-to-eax  _test-stream/imm32
+ 416     b8/copy-to-eax  _test-stream/imm32
  417     ff          6/subop/push        1/mod/*+disp8   0/rm32/eax    .           .             .           .           4/disp8         .                 # push *(eax+4)
  418     # . . call
- 419     e8/call  check-ints-equal/disp32
+ 419     e8/call  check-ints-equal/disp32
  420     # . . discard args
  421     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  422     # end
@@ -485,25 +485,25 @@ if ('onhashchange' in window) {
  426     # setup
  427     # . clear-stream(_test-stream)
  428     # . . push args
- 429     68/push  _test-stream/imm32
+ 429     68/push  _test-stream/imm32
  430     # . . call
- 431     e8/call  clear-stream/disp32
+ 431     e8/call  clear-stream/disp32
  432     # . . discard args
  433     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  434     # write(_test-stream, "ab")
  435     # . . push args
  436     68/push  "ab"/imm32
- 437     68/push  _test-stream/imm32
+ 437     68/push  _test-stream/imm32
  438     # . . call
- 439     e8/call  write/disp32
+ 439     e8/call  write/disp32
  440     # . . discard args
  441     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  442     # skip-chars-matching(_test-stream, 0x20/space)
  443     # . . push args
  444     68/push  0x20/imm32
- 445     68/push  _test-stream/imm32
+ 445     68/push  _test-stream/imm32
  446     # . . call
- 447     e8/call  skip-chars-matching/disp32
+ 447     e8/call  skip-chars-matching/disp32
  448     # . . discard args
  449     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  450     # check-ints-equal(_test-stream->read, 0, msg)
@@ -511,10 +511,10 @@ if ('onhashchange' in window) {
  452     68/push  "F - test-skip-chars-matching-none"/imm32
  453     68/push  0/imm32
  454     # . . push *_test-stream->read
- 455     b8/copy-to-eax  _test-stream/imm32
+ 455     b8/copy-to-eax  _test-stream/imm32
  456     ff          6/subop/push        1/mod/*+disp8   0/rm32/eax    .           .             .           .           4/disp8         .                 # push *(eax+4)
  457     # . . call
- 458     e8/call  check-ints-equal/disp32
+ 458     e8/call  check-ints-equal/disp32
  459     # . . discard args
  460     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  461     # end
@@ -575,24 +575,24 @@ if ('onhashchange' in window) {
  516     # setup
  517     # . clear-stream(_test-stream)
  518     # . . push args
- 519     68/push  _test-stream/imm32
+ 519     68/push  _test-stream/imm32
  520     # . . call
- 521     e8/call  clear-stream/disp32
+ 521     e8/call  clear-stream/disp32
  522     # . . discard args
  523     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  524     # write(_test-stream, " \nab")
  525     # . . push args
  526     68/push  " \nab"/imm32
- 527     68/push  _test-stream/imm32
+ 527     68/push  _test-stream/imm32
  528     # . . call
- 529     e8/call  write/disp32
+ 529     e8/call  write/disp32
  530     # . . discard args
  531     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  532     # skip-chars-matching-whitespace(_test-stream)
  533     # . . push args
- 534     68/push  _test-stream/imm32
+ 534     68/push  _test-stream/imm32
  535     # . . call
- 536     e8/call  skip-chars-matching-whitespace/disp32
+ 536     e8/call  skip-chars-matching-whitespace/disp32
  537     # . . discard args
  538     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  539     # check-ints-equal(_test-stream->read, 2, msg)
@@ -600,10 +600,10 @@ if ('onhashchange' in window) {
  541     68/push  "F - test-skip-chars-matching-whitespace"/imm32
  542     68/push  2/imm32
  543     # . . push *_test-stream->read
- 544     b8/copy-to-eax  _test-stream/imm32
+ 544     b8/copy-to-eax  _test-stream/imm32
  545     ff          6/subop/push        1/mod/*+disp8   0/rm32/eax    .           .             .           .           4/disp8         .                 # push *(eax+4)
  546     # . . call
- 547     e8/call  check-ints-equal/disp32
+ 547     e8/call  check-ints-equal/disp32
  548     # . . discard args
  549     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  550     # end
@@ -659,25 +659,25 @@ if ('onhashchange' in window) {
  600     # setup
  601     # . clear-stream(_test-stream)
  602     # . . push args
- 603     68/push  _test-stream/imm32
+ 603     68/push  _test-stream/imm32
  604     # . . call
- 605     e8/call  clear-stream/disp32
+ 605     e8/call  clear-stream/disp32
  606     # . . discard args
  607     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  608     # write(_test-stream, "ab ")
  609     # . . push args
  610     68/push  "ab "/imm32
- 611     68/push  _test-stream/imm32
+ 611     68/push  _test-stream/imm32
  612     # . . call
- 613     e8/call  write/disp32
+ 613     e8/call  write/disp32
  614     # . . discard args
  615     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  616     # skip-chars-not-matching(_test-stream, 0x20/space)
  617     # . . push args
  618     68/push  0x20/imm32
- 619     68/push  _test-stream/imm32
+ 619     68/push  _test-stream/imm32
  620     # . . call
- 621     e8/call  skip-chars-not-matching/disp32
+ 621     e8/call  skip-chars-not-matching/disp32
  622     # . . discard args
  623     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  624     # check-ints-equal(_test-stream->read, 2, msg)
@@ -685,10 +685,10 @@ if ('onhashchange' in window) {
  626     68/push  "F - test-skip-chars-not-matching"/imm32
  627     68/push  2/imm32
  628     # . . push *_test-stream->read
- 629     b8/copy-to-eax  _test-stream/imm32
+ 629     b8/copy-to-eax  _test-stream/imm32
  630     ff          6/subop/push        1/mod/*+disp8   0/rm32/eax    .           .             .           .           4/disp8         .                 # push *(eax+4)
  631     # . . call
- 632     e8/call  check-ints-equal/disp32
+ 632     e8/call  check-ints-equal/disp32
  633     # . . discard args
  634     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  635     # end
@@ -698,25 +698,25 @@ if ('onhashchange' in window) {
  639     # setup
  640     # . clear-stream(_test-stream)
  641     # . . push args
- 642     68/push  _test-stream/imm32
+ 642     68/push  _test-stream/imm32
  643     # . . call
- 644     e8/call  clear-stream/disp32
+ 644     e8/call  clear-stream/disp32
  645     # . . discard args
  646     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  647     # write(_test-stream, " ab")
  648     # . . push args
  649     68/push  " ab"/imm32
- 650     68/push  _test-stream/imm32
+ 650     68/push  _test-stream/imm32
  651     # . . call
- 652     e8/call  write/disp32
+ 652     e8/call  write/disp32
  653     # . . discard args
  654     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  655     # skip-chars-not-matching(_test-stream, 0x20/space)
  656     # . . push args
  657     68/push  0x20/imm32
- 658     68/push  _test-stream/imm32
+ 658     68/push  _test-stream/imm32
  659     # . . call
- 660     e8/call  skip-chars-not-matching/disp32
+ 660     e8/call  skip-chars-not-matching/disp32
  661     # . . discard args
  662     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  663     # check-ints-equal(_test-stream->read, 0, msg)
@@ -724,10 +724,10 @@ if ('onhashchange' in window) {
  665     68/push  "F - test-skip-chars-not-matching-none"/imm32
  666     68/push  0/imm32
  667     # . . push *_test-stream->read
- 668     b8/copy-to-eax  _test-stream/imm32
+ 668     b8/copy-to-eax  _test-stream/imm32
  669     ff          6/subop/push        1/mod/*+disp8   0/rm32/eax    .           .             .           .           4/disp8         .                 # push *(eax+4)
  670     # . . call
- 671     e8/call  check-ints-equal/disp32
+ 671     e8/call  check-ints-equal/disp32
  672     # . . discard args
  673     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  674     # end
@@ -737,25 +737,25 @@ if ('onhashchange' in window) {
  678     # setup
  679     # . clear-stream(_test-stream)
  680     # . . push args
- 681     68/push  _test-stream/imm32
+ 681     68/push  _test-stream/imm32
  682     # . . call
- 683     e8/call  clear-stream/disp32
+ 683     e8/call  clear-stream/disp32
  684     # . . discard args
  685     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  686     # write(_test-stream, "ab")
  687     # . . push args
  688     68/push  "ab"/imm32
- 689     68/push  _test-stream/imm32
+ 689     68/push  _test-stream/imm32
  690     # . . call
- 691     e8/call  write/disp32
+ 691     e8/call  write/disp32
  692     # . . discard args
  693     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  694     # skip-chars-not-matching(_test-stream, 0x20/space)
  695     # . . push args
  696     68/push  0x20/imm32
- 697     68/push  _test-stream/imm32
+ 697     68/push  _test-stream/imm32
  698     # . . call
- 699     e8/call  skip-chars-not-matching/disp32
+ 699     e8/call  skip-chars-not-matching/disp32
  700     # . . discard args
  701     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  702     # check-ints-equal(_test-stream->read, 2, msg)
@@ -763,10 +763,10 @@ if ('onhashchange' in window) {
  704     68/push  "F - test-skip-chars-not-matching-all"/imm32
  705     68/push  2/imm32
  706     # . . push *_test-stream->read
- 707     b8/copy-to-eax  _test-stream/imm32
+ 707     b8/copy-to-eax  _test-stream/imm32
  708     ff          6/subop/push        1/mod/*+disp8   0/rm32/eax    .           .             .           .           4/disp8         .                 # push *(eax+4)
  709     # . . call
- 710     e8/call  check-ints-equal/disp32
+ 710     e8/call  check-ints-equal/disp32
  711     # . . discard args
  712     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  713     # end
@@ -826,24 +826,24 @@ if ('onhashchange' in window) {
  767     # setup
  768     # . clear-stream(_test-stream)
  769     # . . push args
- 770     68/push  _test-stream/imm32
+ 770     68/push  _test-stream/imm32
  771     # . . call
- 772     e8/call  clear-stream/disp32
+ 772     e8/call  clear-stream/disp32
  773     # . . discard args
  774     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  775     # write(_test-stream, "ab\n")
  776     # . . push args
  777     68/push  "ab\n"/imm32
- 778     68/push  _test-stream/imm32
+ 778     68/push  _test-stream/imm32
  779     # . . call
- 780     e8/call  write/disp32
+ 780     e8/call  write/disp32
  781     # . . discard args
  782     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  783     # skip-chars-not-matching-whitespace(_test-stream)
  784     # . . push args
- 785     68/push  _test-stream/imm32
+ 785     68/push  _test-stream/imm32
  786     # . . call
- 787     e8/call  skip-chars-not-matching-whitespace/disp32
+ 787     e8/call  skip-chars-not-matching-whitespace/disp32
  788     # . . discard args
  789     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  790     # check-ints-equal(_test-stream->read, 2, msg)
@@ -851,10 +851,10 @@ if ('onhashchange' in window) {
  792     68/push  "F - test-skip-chars-not-matching-whitespace"/imm32
  793     68/push  2/imm32
  794     # . . push *_test-stream->read
- 795     b8/copy-to-eax  _test-stream/imm32
+ 795     b8/copy-to-eax  _test-stream/imm32
  796     ff          6/subop/push        1/mod/*+disp8   0/rm32/eax    .           .             .           .           4/disp8         .                 # push *(eax+4)
  797     # . . call
- 798     e8/call  check-ints-equal/disp32
+ 798     e8/call  check-ints-equal/disp32
  799     # . . discard args
  800     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  801     # end
@@ -910,7 +910,7 @@ if ('onhashchange' in window) {
  851     51/push-ecx
  852     50/push-eax
  853     # . . call
- 854     e8/call  skip-chars-matching-in-slice/disp32
+ 854     e8/call  skip-chars-matching-in-slice/disp32
  855     # . . discard args
  856     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  857     # check-ints-equal(ecx-eax, 2, msg)
@@ -921,7 +921,7 @@ if ('onhashchange' in window) {
  862     29/subtract                     3/mod/direct    1/rm32/ecx    .           .             .           0/r32/eax   .               .                 # subtract eax from ecx
  863     51/push-ecx
  864     # . . call
- 865     e8/call  check-ints-equal/disp32
+ 865     e8/call  check-ints-equal/disp32
  866     # . . discard args
  867     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  868     # end
@@ -939,7 +939,7 @@ if ('onhashchange' in window) {
  880     51/push-ecx
  881     50/push-eax
  882     # . . call
- 883     e8/call  skip-chars-matching-in-slice/disp32
+ 883     e8/call  skip-chars-matching-in-slice/disp32
  884     # . . discard args
  885     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  886     # check-ints-equal(ecx-eax, 2, msg)
@@ -950,7 +950,7 @@ if ('onhashchange' in window) {
  891     29/subtract                     3/mod/direct    1/rm32/ecx    .           .             .           0/r32/eax   .               .                 # subtract eax from ecx
  892     51/push-ecx
  893     # . . call
- 894     e8/call  check-ints-equal/disp32
+ 894     e8/call  check-ints-equal/disp32
  895     # . . discard args
  896     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  897     # end
@@ -1011,7 +1011,7 @@ if ('onhashchange' in window) {
  952     51/push-ecx
  953     50/push-eax
  954     # . . call
- 955     e8/call  skip-chars-matching-whitespace-in-slice/disp32
+ 955     e8/call  skip-chars-matching-whitespace-in-slice/disp32
  956     # . . discard args
  957     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  958     # check-ints-equal(ecx-eax, 2, msg)
@@ -1022,7 +1022,7 @@ if ('onhashchange' in window) {
  963     29/subtract                     3/mod/direct    1/rm32/ecx    .           .             .           0/r32/eax   .               .                 # subtract eax from ecx
  964     51/push-ecx
  965     # . . call
- 966     e8/call  check-ints-equal/disp32
+ 966     e8/call  check-ints-equal/disp32
  967     # . . discard args
  968     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  969     # end
@@ -1079,7 +1079,7 @@ if ('onhashchange' in window) {
 1020     51/push-ecx
 1021     50/push-eax
 1022     # . . call
-1023     e8/call  skip-chars-not-matching-in-slice/disp32
+1023     e8/call  skip-chars-not-matching-in-slice/disp32
 1024     # . . discard args
 1025     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1026     # check-ints-equal(ecx-eax, 1, msg)
@@ -1090,7 +1090,7 @@ if ('onhashchange' in window) {
 1031     29/subtract                     3/mod/direct    1/rm32/ecx    .           .             .           0/r32/eax   .               .                 # subtract eax from ecx
 1032     51/push-ecx
 1033     # . . call
-1034     e8/call  check-ints-equal/disp32
+1034     e8/call  check-ints-equal/disp32
 1035     # . . discard args
 1036     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1037     # end
@@ -1108,7 +1108,7 @@ if ('onhashchange' in window) {
 1049     51/push-ecx
 1050     50/push-eax
 1051     # . . call
-1052     e8/call  skip-chars-not-matching-in-slice/disp32
+1052     e8/call  skip-chars-not-matching-in-slice/disp32
 1053     # . . discard args
 1054     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1055     # check-ints-equal(ecx-eax, 3, msg)
@@ -1119,7 +1119,7 @@ if ('onhashchange' in window) {
 1060     29/subtract                     3/mod/direct    1/rm32/ecx    .           .             .           0/r32/eax   .               .                 # subtract eax from ecx
 1061     51/push-ecx
 1062     # . . call
-1063     e8/call  check-ints-equal/disp32
+1063     e8/call  check-ints-equal/disp32
 1064     # . . discard args
 1065     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1066     # end
@@ -1137,7 +1137,7 @@ if ('onhashchange' in window) {
 1078     51/push-ecx
 1079     50/push-eax
 1080     # . . call
-1081     e8/call  skip-chars-not-matching-in-slice/disp32
+1081     e8/call  skip-chars-not-matching-in-slice/disp32
 1082     # . . discard args
 1083     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1084     # check-ints-equal(ecx-eax, 0, msg)
@@ -1148,7 +1148,7 @@ if ('onhashchange' in window) {
 1089     29/subtract                     3/mod/direct    1/rm32/ecx    .           .             .           0/r32/eax   .               .                 # subtract eax from ecx
 1090     51/push-ecx
 1091     # . . call
-1092     e8/call  check-ints-equal/disp32
+1092     e8/call  check-ints-equal/disp32
 1093     # . . discard args
 1094     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1095     # end
@@ -1208,7 +1208,7 @@ if ('onhashchange' in window) {
 1149     51/push-ecx
 1150     50/push-eax
 1151     # . . call
-1152     e8/call  skip-chars-not-matching-whitespace-in-slice/disp32
+1152     e8/call  skip-chars-not-matching-whitespace-in-slice/disp32
 1153     # . . discard args
 1154     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1155     # check-ints-equal(ecx-eax, 1, msg)
@@ -1219,7 +1219,7 @@ if ('onhashchange' in window) {
 1160     29/subtract                     3/mod/direct    1/rm32/ecx    .           .             .           0/r32/eax   .               .                 # subtract eax from ecx
 1161     51/push-ecx
 1162     # . . call
-1163     e8/call  check-ints-equal/disp32
+1163     e8/call  check-ints-equal/disp32
 1164     # . . discard args
 1165     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1166     # end
@@ -1247,7 +1247,7 @@ if ('onhashchange' in window) {
 1188     8d/copy-address                 1/mod/*+disp8   4/rm32/sib    1/base/ecx  2/index/edx   .           2/r32/edx   0xc/disp8       .                 # copy ecx+edx+12 to edx
 1189     52/push-edx
 1190     # . . call
-1191     e8/call  skip-string-in-slice/disp32
+1191     e8/call  skip-string-in-slice/disp32
 1192     # . . discard args
 1193     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1194     # line->read = eax - line->data
@@ -1271,45 +1271,45 @@ if ('onhashchange' in window) {
 1212     # setup
 1213     # . clear-stream(_test-input-stream)
 1214     # . . push args
-1215     68/push  _test-input-stream/imm32
+1215     68/push  _test-input-stream/imm32
 1216     # . . call
-1217     e8/call  clear-stream/disp32
+1217     e8/call  clear-stream/disp32
 1218     # . . discard args
 1219     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 1220     # . write(_test-input-stream, "\"abc\" def")
 1221     # .                   indices:  0123 45
 1222     # . . push args
 1223     68/push  "\"abc\" def"/imm32
-1224     68/push  _test-input-stream/imm32
+1224     68/push  _test-input-stream/imm32
 1225     # . . call
-1226     e8/call  write/disp32
+1226     e8/call  write/disp32
 1227     # . . discard args
 1228     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1229     # precondition: line->read == 0
 1230     # . . push args
-1231     68/push  "F - test-skip-string/precondition"/imm32
+1231     68/push  "F - test-skip-string/precondition"/imm32
 1232     68/push  0/imm32
-1233     b8/copy-to-eax  _test-input-stream/imm32
+1233     b8/copy-to-eax  _test-input-stream/imm32
 1234     ff          6/subop/push        1/mod/*+disp8   0/rm32/eax    .           .             .           .           4/disp8         .                 # push *(eax+4)
 1235     # . . call
-1236     e8/call  check-ints-equal/disp32
+1236     e8/call  check-ints-equal/disp32
 1237     # . . discard args
 1238     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1239     # skip-string(_test-input-stream)
 1240     # . . push args
-1241     68/push  _test-input-stream/imm32
+1241     68/push  _test-input-stream/imm32
 1242     # . . call
-1243     e8/call  skip-string/disp32
+1243     e8/call  skip-string/disp32
 1244     # . . discard args
 1245     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 1246     # check-ints-equal(line->read, 5, msg)
 1247     # . . push args
 1248     68/push  "F - test-skip-string"/imm32
 1249     68/push  5/imm32
-1250     b8/copy-to-eax  _test-input-stream/imm32
+1250     b8/copy-to-eax  _test-input-stream/imm32
 1251     ff          6/subop/push        1/mod/*+disp8   0/rm32/eax    .           .             .           .           4/disp8         .                 # push *(eax+4)
 1252     # . . call
-1253     e8/call  check-ints-equal/disp32
+1253     e8/call  check-ints-equal/disp32
 1254     # . . discard args
 1255     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1256     # . epilogue
@@ -1324,45 +1324,45 @@ if ('onhashchange' in window) {
 1265     # setup
 1266     # . clear-stream(_test-input-stream)
 1267     # . . push args
-1268     68/push  _test-input-stream/imm32
+1268     68/push  _test-input-stream/imm32
 1269     # . . call
-1270     e8/call  clear-stream/disp32
+1270     e8/call  clear-stream/disp32
 1271     # . . discard args
 1272     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 1273     # . write(_test-input-stream, "\"a b\"/yz")
 1274     # .                   indices:  0123 45
 1275     # . . push args
 1276     68/push  "\"a b\"/yz"/imm32
-1277     68/push  _test-input-stream/imm32
+1277     68/push  _test-input-stream/imm32
 1278     # . . call
-1279     e8/call  write/disp32
+1279     e8/call  write/disp32
 1280     # . . discard args
 1281     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1282     # precondition: line->read == 0
 1283     # . . push args
-1284     68/push  "F - test-skip-string-ignores-spaces/precondition"/imm32
+1284     68/push  "F - test-skip-string-ignores-spaces/precondition"/imm32
 1285     68/push  0/imm32
-1286     b8/copy-to-eax  _test-input-stream/imm32
+1286     b8/copy-to-eax  _test-input-stream/imm32
 1287     ff          6/subop/push        1/mod/*+disp8   0/rm32/eax    .           .             .           .           4/disp8         .                 # push *(eax+4)
 1288     # . . call
-1289     e8/call  check-ints-equal/disp32
+1289     e8/call  check-ints-equal/disp32
 1290     # . . discard args
 1291     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1292     # skip-string(_test-input-stream)
 1293     # . . push args
-1294     68/push  _test-input-stream/imm32
+1294     68/push  _test-input-stream/imm32
 1295     # . . call
-1296     e8/call  skip-string/disp32
+1296     e8/call  skip-string/disp32
 1297     # . . discard args
 1298     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 1299     # check-ints-equal(line->read, 5, msg)
 1300     # . . push args
 1301     68/push  "F - test-skip-string-ignores-spaces"/imm32
 1302     68/push  5/imm32
-1303     b8/copy-to-eax  _test-input-stream/imm32
+1303     b8/copy-to-eax  _test-input-stream/imm32
 1304     ff          6/subop/push        1/mod/*+disp8   0/rm32/eax    .           .             .           .           4/disp8         .                 # push *(eax+4)
 1305     # . . call
-1306     e8/call  check-ints-equal/disp32
+1306     e8/call  check-ints-equal/disp32
 1307     # . . discard args
 1308     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1309     # . epilogue
@@ -1377,45 +1377,45 @@ if ('onhashchange' in window) {
 1318     # setup
 1319     # . clear-stream(_test-input-stream)
 1320     # . . push args
-1321     68/push  _test-input-stream/imm32
+1321     68/push  _test-input-stream/imm32
 1322     # . . call
-1323     e8/call  clear-stream/disp32
+1323     e8/call  clear-stream/disp32
 1324     # . . discard args
 1325     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 1326     # . write(_test-input-stream, "\"a\\\"b\"/yz")
 1327     # .                   indices:  01 2 34 56
 1328     # . . push args
 1329     68/push  "\"a\\\"b\"/yz"/imm32
-1330     68/push  _test-input-stream/imm32
+1330     68/push  _test-input-stream/imm32
 1331     # . . call
-1332     e8/call  write/disp32
+1332     e8/call  write/disp32
 1333     # . . discard args
 1334     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1335     # precondition: line->read == 0
 1336     # . . push args
-1337     68/push  "F - test-skip-string-ignores-escapes/precondition"/imm32
+1337     68/push  "F - test-skip-string-ignores-escapes/precondition"/imm32
 1338     68/push  0/imm32
-1339     b8/copy-to-eax  _test-input-stream/imm32
+1339     b8/copy-to-eax  _test-input-stream/imm32
 1340     ff          6/subop/push        1/mod/*+disp8   0/rm32/eax    .           .             .           .           4/disp8         .                 # push *(eax+4)
 1341     # . . call
-1342     e8/call  check-ints-equal/disp32
+1342     e8/call  check-ints-equal/disp32
 1343     # . . discard args
 1344     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1345     # skip-string(_test-input-stream)
 1346     # . . push args
-1347     68/push  _test-input-stream/imm32
+1347     68/push  _test-input-stream/imm32
 1348     # . . call
-1349     e8/call  skip-string/disp32
+1349     e8/call  skip-string/disp32
 1350     # . . discard args
 1351     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 1352     # check-ints-equal(line->read, 6, msg)
 1353     # . . push args
 1354     68/push  "F - test-skip-string-ignores-escapes"/imm32
 1355     68/push  6/imm32
-1356     b8/copy-to-eax  _test-input-stream/imm32
+1356     b8/copy-to-eax  _test-input-stream/imm32
 1357     ff          6/subop/push        1/mod/*+disp8   0/rm32/eax    .           .             .           .           4/disp8         .                 # push *(eax+4)
 1358     # . . call
-1359     e8/call  check-ints-equal/disp32
+1359     e8/call  check-ints-equal/disp32
 1360     # . . discard args
 1361     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1362     # . epilogue
@@ -1430,38 +1430,38 @@ if ('onhashchange' in window) {
 1371     # setup
 1372     # . clear-stream(_test-input-stream)
 1373     # . . push args
-1374     68/push  _test-input-stream/imm32
+1374     68/push  _test-input-stream/imm32
 1375     # . . call
-1376     e8/call  clear-stream/disp32
+1376     e8/call  clear-stream/disp32
 1377     # . . discard args
 1378     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 1379     # . write(_test-input-stream, "0 \"a\\\"b\"/yz")
 1380     # .                   indices:  01 2 34 56
 1381     # . . push args
 1382     68/push  "0 \"a\\\"b\"/yz"/imm32
-1383     68/push  _test-input-stream/imm32
+1383     68/push  _test-input-stream/imm32
 1384     # . . call
-1385     e8/call  write/disp32
+1385     e8/call  write/disp32
 1386     # . . discard args
 1387     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1388     # precondition: line->read == 2
-1389     b8/copy-to-eax  _test-input-stream/imm32
+1389     b8/copy-to-eax  _test-input-stream/imm32
 1390     c7          0/subop/copy        1/mod/*+disp8   0/rm32/eax    .           .             .           .           4/disp8         2/imm32           # copy to *(eax+4)
 1391     # skip-string(_test-input-stream)
 1392     # . . push args
-1393     68/push  _test-input-stream/imm32
+1393     68/push  _test-input-stream/imm32
 1394     # . . call
-1395     e8/call  skip-string/disp32
+1395     e8/call  skip-string/disp32
 1396     # . . discard args
 1397     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 1398     # check-ints-equal(line->read, 8, msg)
 1399     # . . push args
 1400     68/push  "F - test-skip-string-works-from-mid-stream"/imm32
 1401     68/push  8/imm32
-1402     b8/copy-to-eax  _test-input-stream/imm32
+1402     b8/copy-to-eax  _test-input-stream/imm32
 1403     ff          6/subop/push        1/mod/*+disp8   0/rm32/eax    .           .             .           .           4/disp8         .                 # push *(eax+4)
 1404     # . . call
-1405     e8/call  check-ints-equal/disp32
+1405     e8/call  check-ints-equal/disp32
 1406     # . . discard args
 1407     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1408     # . epilogue
@@ -1535,7 +1535,7 @@ if ('onhashchange' in window) {
 1476     51/push-ecx
 1477     50/push-eax
 1478     # . . call
-1479     e8/call  skip-string-in-slice/disp32
+1479     e8/call  skip-string-in-slice/disp32
 1480     # . . discard args
 1481     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1482     # check-ints-equal(ecx-eax, 4, msg)  # number of chars remaining after the string literal
@@ -1546,7 +1546,7 @@ if ('onhashchange' in window) {
 1487     29/subtract                     3/mod/direct    1/rm32/ecx    .           .             .           0/r32/eax   .               .                 # subtract eax from ecx
 1488     51/push-ecx
 1489     # . . call
-1490     e8/call  check-ints-equal/disp32
+1490     e8/call  check-ints-equal/disp32
 1491     # . . discard args
 1492     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1493     # . epilogue
@@ -1568,7 +1568,7 @@ if ('onhashchange' in window) {
 1509     51/push-ecx
 1510     50/push-eax
 1511     # . . call
-1512     e8/call  skip-string-in-slice/disp32
+1512     e8/call  skip-string-in-slice/disp32
 1513     # . . discard args
 1514     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1515     # check-ints-equal(ecx-eax, 3, msg)  # number of chars remaining after the string literal
@@ -1579,7 +1579,7 @@ if ('onhashchange' in window) {
 1520     29/subtract                     3/mod/direct    1/rm32/ecx    .           .             .           0/r32/eax   .               .                 # subtract eax from ecx
 1521     51/push-ecx
 1522     # . . call
-1523     e8/call  check-ints-equal/disp32
+1523     e8/call  check-ints-equal/disp32
 1524     # . . discard args
 1525     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1526     # . epilogue
@@ -1601,7 +1601,7 @@ if ('onhashchange' in window) {
 1542     51/push-ecx
 1543     50/push-eax
 1544     # . . call
-1545     e8/call  skip-string-in-slice/disp32
+1545     e8/call  skip-string-in-slice/disp32
 1546     # . . discard args
 1547     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1548     # check-ints-equal(ecx-eax, 3, msg)  # number of chars remaining after the string literal
@@ -1612,7 +1612,7 @@ if ('onhashchange' in window) {
 1553     29/subtract                     3/mod/direct    1/rm32/ecx    .           .             .           0/r32/eax   .               .                 # subtract eax from ecx
 1554     51/push-ecx
 1555     # . . call
-1556     e8/call  check-ints-equal/disp32
+1556     e8/call  check-ints-equal/disp32
 1557     # . . discard args
 1558     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1559     # . epilogue
@@ -1634,7 +1634,7 @@ if ('onhashchange' in window) {
 1575     51/push-ecx
 1576     50/push-eax
 1577     # . . call
-1578     e8/call  skip-string-in-slice/disp32
+1578     e8/call  skip-string-in-slice/disp32
 1579     # . . discard args
 1580     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1581     # check-ints-equal(ecx-eax, 0, msg)  # skipped to end of slice
@@ -1645,7 +1645,7 @@ if ('onhashchange' in window) {
 1586     29/subtract                     3/mod/direct    1/rm32/ecx    .           .             .           0/r32/eax   .               .                 # subtract eax from ecx
 1587     51/push-ecx
 1588     # . . call
-1589     e8/call  check-ints-equal/disp32
+1589     e8/call  check-ints-equal/disp32
 1590     # . . discard args
 1591     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1592     # . epilogue
@@ -1675,7 +1675,7 @@ if ('onhashchange' in window) {
 1616     8d/copy-address                 1/mod/*+disp8   4/rm32/sib    1/base/ecx  2/index/edx   .           2/r32/edx   0xc/disp8       .                 # copy ecx+edx+12 to edx
 1617     52/push-edx
 1618     # . . call
-1619     e8/call  skip-until-close-paren-in-slice/disp32
+1619     e8/call  skip-until-close-paren-in-slice/disp32
 1620     # . . discard args
 1621     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1622     # line->read = eax - line->data
@@ -1699,45 +1699,45 @@ if ('onhashchange' in window) {
 1640     # setup
 1641     # . clear-stream(_test-input-stream)
 1642     # . . push args
-1643     68/push  _test-input-stream/imm32
+1643     68/push  _test-input-stream/imm32
 1644     # . . call
-1645     e8/call  clear-stream/disp32
+1645     e8/call  clear-stream/disp32
 1646     # . . discard args
 1647     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 1648     # . write(_test-input-stream, "*(abc) def")
 1649     # .                   indices:  0123 45
 1650     # . . push args
 1651     68/push  "*(abc) def"/imm32
-1652     68/push  _test-input-stream/imm32
+1652     68/push  _test-input-stream/imm32
 1653     # . . call
-1654     e8/call  write/disp32
+1654     e8/call  write/disp32
 1655     # . . discard args
 1656     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1657     # precondition: line->read == 0
 1658     # . . push args
-1659     68/push  "F - test-skip-until-close-paren/precondition"/imm32
+1659     68/push  "F - test-skip-until-close-paren/precondition"/imm32
 1660     68/push  0/imm32
-1661     b8/copy-to-eax  _test-input-stream/imm32
+1661     b8/copy-to-eax  _test-input-stream/imm32
 1662     ff          6/subop/push        1/mod/*+disp8   0/rm32/eax    .           .             .           .           4/disp8         .                 # push *(eax+4)
 1663     # . . call
-1664     e8/call  check-ints-equal/disp32
+1664     e8/call  check-ints-equal/disp32
 1665     # . . discard args
 1666     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1667     # skip-until-close-paren(_test-input-stream)
 1668     # . . push args
-1669     68/push  _test-input-stream/imm32
+1669     68/push  _test-input-stream/imm32
 1670     # . . call
-1671     e8/call  skip-until-close-paren/disp32
+1671     e8/call  skip-until-close-paren/disp32
 1672     # . . discard args
 1673     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 1674     # check-ints-equal(line->read, 5, msg)
 1675     # . . push args
 1676     68/push  "F - test-skip-until-close-paren"/imm32
 1677     68/push  5/imm32
-1678     b8/copy-to-eax  _test-input-stream/imm32
+1678     b8/copy-to-eax  _test-input-stream/imm32
 1679     ff          6/subop/push        1/mod/*+disp8   0/rm32/eax    .           .             .           .           4/disp8         .                 # push *(eax+4)
 1680     # . . call
-1681     e8/call  check-ints-equal/disp32
+1681     e8/call  check-ints-equal/disp32
 1682     # . . discard args
 1683     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1684     # . epilogue
@@ -1752,44 +1752,44 @@ if ('onhashchange' in window) {
 1693     # setup
 1694     # . clear-stream(_test-input-stream)
 1695     # . . push args
-1696     68/push  _test-input-stream/imm32
+1696     68/push  _test-input-stream/imm32
 1697     # . . call
-1698     e8/call  clear-stream/disp32
+1698     e8/call  clear-stream/disp32
 1699     # . . discard args
 1700     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 1701     # . write(_test-input-stream, "*(a b)/yz")
 1702     # . . push args
 1703     68/push  "*(a b)/yz"/imm32
-1704     68/push  _test-input-stream/imm32
+1704     68/push  _test-input-stream/imm32
 1705     # . . call
-1706     e8/call  write/disp32
+1706     e8/call  write/disp32
 1707     # . . discard args
 1708     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1709     # precondition: line->read == 0
 1710     # . . push args
-1711     68/push  "F - test-skip-until-close-paren-ignores-spaces/precondition"/imm32
+1711     68/push  "F - test-skip-until-close-paren-ignores-spaces/precondition"/imm32
 1712     68/push  0/imm32
-1713     b8/copy-to-eax  _test-input-stream/imm32
+1713     b8/copy-to-eax  _test-input-stream/imm32
 1714     ff          6/subop/push        1/mod/*+disp8   0/rm32/eax    .           .             .           .           4/disp8         .                 # push *(eax+4)
 1715     # . . call
-1716     e8/call  check-ints-equal/disp32
+1716     e8/call  check-ints-equal/disp32
 1717     # . . discard args
 1718     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1719     # skip-until-close-paren(_test-input-stream)
 1720     # . . push args
-1721     68/push  _test-input-stream/imm32
+1721     68/push  _test-input-stream/imm32
 1722     # . . call
-1723     e8/call  skip-until-close-paren/disp32
+1723     e8/call  skip-until-close-paren/disp32
 1724     # . . discard args
 1725     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 1726     # check-ints-equal(line->read, 5, msg)
 1727     # . . push args
 1728     68/push  "F - test-skip-until-close-paren-ignores-spaces"/imm32
 1729     68/push  5/imm32
-1730     b8/copy-to-eax  _test-input-stream/imm32
+1730     b8/copy-to-eax  _test-input-stream/imm32
 1731     ff          6/subop/push        1/mod/*+disp8   0/rm32/eax    .           .             .           .           4/disp8         .                 # push *(eax+4)
 1732     # . . call
-1733     e8/call  check-ints-equal/disp32
+1733     e8/call  check-ints-equal/disp32
 1734     # . . discard args
 1735     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1736     # . epilogue
@@ -1804,37 +1804,37 @@ if ('onhashchange' in window) {
 1745     # setup
 1746     # . clear-stream(_test-input-stream)
 1747     # . . push args
-1748     68/push  _test-input-stream/imm32
+1748     68/push  _test-input-stream/imm32
 1749     # . . call
-1750     e8/call  clear-stream/disp32
+1750     e8/call  clear-stream/disp32
 1751     # . . discard args
 1752     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 1753     # . write(_test-input-stream, "0 *(a b)/yz")
 1754     # . . push args
 1755     68/push  "0 *(a b)/yz"/imm32
-1756     68/push  _test-input-stream/imm32
+1756     68/push  _test-input-stream/imm32
 1757     # . . call
-1758     e8/call  write/disp32
+1758     e8/call  write/disp32
 1759     # . . discard args
 1760     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1761     # precondition: _test-input-stream->read == 2
-1762     b8/copy-to-eax  _test-input-stream/imm32
+1762     b8/copy-to-eax  _test-input-stream/imm32
 1763     c7          0/subop/copy        1/mod/*+disp8   0/rm32/eax    .           .             .           .           4/disp8         2/imm32           # copy to *(eax+4)
 1764     # skip-until-close-paren(_test-input-stream)
 1765     # . . push args
-1766     68/push  _test-input-stream/imm32
+1766     68/push  _test-input-stream/imm32
 1767     # . . call
-1768     e8/call  skip-until-close-paren/disp32
+1768     e8/call  skip-until-close-paren/disp32
 1769     # . . discard args
 1770     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 1771     # check-ints-equal(_test-input-stream->read, 7, msg)
 1772     # . . push args
 1773     68/push  "F - test-skip-until-close-paren-works-from-mid-stream"/imm32
 1774     68/push  7/imm32
-1775     b8/copy-to-eax  _test-input-stream/imm32
+1775     b8/copy-to-eax  _test-input-stream/imm32
 1776     ff          6/subop/push        1/mod/*+disp8   0/rm32/eax    .           .             .           .           4/disp8         .                 # push *(eax+4)
 1777     # . . call
-1778     e8/call  check-ints-equal/disp32
+1778     e8/call  check-ints-equal/disp32
 1779     # . . discard args
 1780     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1781     # . epilogue
@@ -1896,7 +1896,7 @@ if ('onhashchange' in window) {
 1837     51/push-ecx
 1838     50/push-eax
 1839     # . . call
-1840     e8/call  skip-until-close-paren-in-slice/disp32
+1840     e8/call  skip-until-close-paren-in-slice/disp32
 1841     # . . discard args
 1842     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1843     # check-ints-equal(ecx-eax, 5, msg)  # eax is at the ')'
@@ -1907,7 +1907,7 @@ if ('onhashchange' in window) {
 1848     29/subtract                     3/mod/direct    1/rm32/ecx    .           .             .           0/r32/eax   .               .                 # subtract eax from ecx
 1849     51/push-ecx
 1850     # . . call
-1851     e8/call  check-ints-equal/disp32
+1851     e8/call  check-ints-equal/disp32
 1852     # . . discard args
 1853     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1854     # . epilogue
@@ -1929,7 +1929,7 @@ if ('onhashchange' in window) {
 1870     51/push-ecx
 1871     50/push-eax
 1872     # . . call
-1873     e8/call  skip-until-close-paren-in-slice/disp32
+1873     e8/call  skip-until-close-paren-in-slice/disp32
 1874     # . . discard args
 1875     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1876     # check-ints-equal(ecx-eax, 4, msg)  # eax is at the ')'
@@ -1940,7 +1940,7 @@ if ('onhashchange' in window) {
 1881     29/subtract                     3/mod/direct    1/rm32/ecx    .           .             .           0/r32/eax   .               .                 # subtract eax from ecx
 1882     51/push-ecx
 1883     # . . call
-1884     e8/call  check-ints-equal/disp32
+1884     e8/call  check-ints-equal/disp32
 1885     # . . discard args
 1886     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1887     # . epilogue
@@ -1962,7 +1962,7 @@ if ('onhashchange' in window) {
 1903     51/push-ecx
 1904     50/push-eax
 1905     # . . call
-1906     e8/call  skip-until-close-paren-in-slice/disp32
+1906     e8/call  skip-until-close-paren-in-slice/disp32
 1907     # . . discard args
 1908     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1909     # check-ints-equal(ecx-eax, 0, msg)  # skipped to end of slice
@@ -1973,7 +1973,7 @@ if ('onhashchange' in window) {
 1914     29/subtract                     3/mod/direct    1/rm32/ecx    .           .             .           0/r32/eax   .               .                 # subtract eax from ecx
 1915     51/push-ecx
 1916     # . . call
-1917     e8/call  check-ints-equal/disp32
+1917     e8/call  check-ints-equal/disp32
 1918     # . . discard args
 1919     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1920     # . epilogue
diff --git a/html/074write-stream-data.subx.html b/html/125write-stream-data.subx.html
similarity index 90%
rename from html/074write-stream-data.subx.html
rename to html/125write-stream-data.subx.html
index 4b04a455..fdd4aa0e 100644
--- a/html/074write-stream-data.subx.html
+++ b/html/125write-stream-data.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 074write-stream-data.subx
+Mu - 125write-stream-data.subx
 
 
 
@@ -55,7 +55,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/074write-stream-data.subx
+https://github.com/akkartik/mu/blob/master/125write-stream-data.subx
 
   1 == code
   2 #   instruction                     effective address                                                   register    displacement    immediate
@@ -92,7 +92,7 @@ if ('onhashchange' in window) {
  33     51/push-ecx
  34     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
  35     # . . call
- 36     e8/call  write-slice-buffered/disp32
+ 36     e8/call  write-slice-buffered/disp32
  37     # . . discard args
  38     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  39 $write-stream-data:end:
@@ -114,57 +114,57 @@ if ('onhashchange' in window) {
  55     # setup
  56     # . clear-stream(_test-output-stream)
  57     # . . push args
- 58     68/push  _test-output-stream/imm32
+ 58     68/push  _test-output-stream/imm32
  59     # . . call
- 60     e8/call  clear-stream/disp32
+ 60     e8/call  clear-stream/disp32
  61     # . . discard args
  62     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  63     # . clear-stream($_test-output-buffered-file->buffer)
  64     # . . push args
  65     68/push  $_test-output-buffered-file->buffer/imm32
  66     # . . call
- 67     e8/call  clear-stream/disp32
+ 67     e8/call  clear-stream/disp32
  68     # . . discard args
  69     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  70     # . clear-stream(_test-input-stream)
  71     # . . push args
- 72     68/push  _test-input-stream/imm32
+ 72     68/push  _test-input-stream/imm32
  73     # . . call
- 74     e8/call  clear-stream/disp32
+ 74     e8/call  clear-stream/disp32
  75     # . . discard args
  76     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  77     # initialize input
  78     # . write(_test-input-stream, "abcd")
  79     # . . push args
  80     68/push  "abcd"/imm32
- 81     68/push  _test-input-stream/imm32
+ 81     68/push  _test-input-stream/imm32
  82     # . . call
- 83     e8/call  write/disp32
+ 83     e8/call  write/disp32
  84     # . . discard args
  85     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  86     # write-stream-data(_test-output-buffered-file, _test-input-stream)
  87     # . . push args
- 88     68/push  _test-input-stream/imm32
- 89     68/push  _test-output-buffered-file/imm32
+ 88     68/push  _test-input-stream/imm32
+ 89     68/push  _test-output-buffered-file/imm32
  90     # . . call
- 91     e8/call  write-stream-data/disp32
+ 91     e8/call  write-stream-data/disp32
  92     # . . discard args
  93     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  94     # check that the write happened as expected
  95     # . flush(_test-output-buffered-file)
  96     # . . push args
- 97     68/push  _test-output-buffered-file/imm32
+ 97     68/push  _test-output-buffered-file/imm32
  98     # . . call
- 99     e8/call  flush/disp32
+ 99     e8/call  flush/disp32
 100     # . . discard args
 101     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 102     # . check-stream-equal(_test-output-stream, "abcd", msg)
 103     # . . push args
 104     68/push  "F - test-write-stream-data"/imm32
 105     68/push  "abcd"/imm32
-106     68/push  _test-output-stream/imm32
+106     68/push  _test-output-stream/imm32
 107     # . . call
-108     e8/call  check-stream-equal/disp32
+108     e8/call  check-stream-equal/disp32
 109     # . . discard args
 110     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 111     # . epilogue
diff --git a/html/075write-int-decimal.subx.html b/html/126write-int-decimal.subx.html
similarity index 95%
rename from html/075write-int-decimal.subx.html
rename to html/126write-int-decimal.subx.html
index 97059ffa..14c151ee 100644
--- a/html/075write-int-decimal.subx.html
+++ b/html/126write-int-decimal.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 075write-int-decimal.subx
+Mu - 126write-int-decimal.subx
 
 
 
@@ -59,7 +59,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/075write-int-decimal.subx
+https://github.com/akkartik/mu/blob/master/126write-int-decimal.subx
 
   1 # Helper to print an int32 in decimal.
   2 
@@ -131,10 +131,10 @@ if ('onhashchange' in window) {
  68 $write-int32-decimal:read-break:
  69     # if (n < 0) push('-')
  70     81          7/subop/compare     1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       0/imm32           # compare *(ebp+12)
- 71     7d/jump-if->=  $write-int32-decimal:write/disp8
+ 71     7d/jump-if->=  $write-int32-decimal:write/disp8
  72 $write-int32-decimal:push-negative:
  73     68/push  0x2d/imm32/-
- 74 $write-int32-decimal:write:
+ 74 $write-int32-decimal:write:
  75     # edi = out
  76     8b/copy                         1/mod/*+disp8   5/rm32/ebp    .           .             .           7/r32/edi   8/disp8         .                 # copy *(ebp+8) to edi
  77     # var w/edx: int = out->write
@@ -182,7 +182,7 @@ if ('onhashchange' in window) {
 119     68/push  "write-int32-decimal: out of space\n"/imm32
 120     68/push  2/imm32/stderr
 121     # . . call
-122     e8/call  _write/disp32
+122     e8/call  _write/disp32
 123     # . . discard args
 124     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 125     # . syscall(exit, 1)
@@ -195,26 +195,26 @@ if ('onhashchange' in window) {
 132     # setup
 133     # . clear-stream(_test-stream)
 134     # . . push args
-135     68/push  _test-stream/imm32
+135     68/push  _test-stream/imm32
 136     # . . call
-137     e8/call  clear-stream/disp32
+137     e8/call  clear-stream/disp32
 138     # . . discard args
 139     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 140     # write-int32-decimal(_test-stream, 9)
 141     # . . push args
 142     68/push  9/imm32
-143     68/push  _test-stream/imm32
+143     68/push  _test-stream/imm32
 144     # . . call
-145     e8/call  write-int32-decimal/disp32
+145     e8/call  write-int32-decimal/disp32
 146     # . . discard args
 147     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 148     # check-stream-equal(_test-stream, "9", msg)
 149     # . . push args
 150     68/push  "F - test-write-int32-decimal"/imm32
 151     68/push  "9"/imm32
-152     68/push  _test-stream/imm32
+152     68/push  _test-stream/imm32
 153     # . . call
-154     e8/call  check-stream-equal/disp32
+154     e8/call  check-stream-equal/disp32
 155     # . . discard args
 156     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 157     # . end
@@ -225,26 +225,26 @@ if ('onhashchange' in window) {
 162     # setup
 163     # . clear-stream(_test-stream)
 164     # . . push args
-165     68/push  _test-stream/imm32
+165     68/push  _test-stream/imm32
 166     # . . call
-167     e8/call  clear-stream/disp32
+167     e8/call  clear-stream/disp32
 168     # . . discard args
 169     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 170     # write-int32-decimal(_test-stream, 0)
 171     # . . push args
 172     68/push  0/imm32
-173     68/push  _test-stream/imm32
+173     68/push  _test-stream/imm32
 174     # . . call
-175     e8/call  write-int32-decimal/disp32
+175     e8/call  write-int32-decimal/disp32
 176     # . . discard args
 177     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 178     # check-stream-equal(_test-stream, "0", msg)
 179     # . . push args
 180     68/push  "F - test-write-int32-decimal-zero"/imm32
 181     68/push  "0"/imm32
-182     68/push  _test-stream/imm32
+182     68/push  _test-stream/imm32
 183     # . . call
-184     e8/call  check-stream-equal/disp32
+184     e8/call  check-stream-equal/disp32
 185     # . . discard args
 186     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 187     # . end
@@ -255,26 +255,26 @@ if ('onhashchange' in window) {
 192     # setup
 193     # . clear-stream(_test-stream)
 194     # . . push args
-195     68/push  _test-stream/imm32
+195     68/push  _test-stream/imm32
 196     # . . call
-197     e8/call  clear-stream/disp32
+197     e8/call  clear-stream/disp32
 198     # . . discard args
 199     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 200     # write-int32-decimal(_test-stream, 10)
 201     # . . push args
 202     68/push  0xa/imm32
-203     68/push  _test-stream/imm32
+203     68/push  _test-stream/imm32
 204     # . . call
-205     e8/call  write-int32-decimal/disp32
+205     e8/call  write-int32-decimal/disp32
 206     # . . discard args
 207     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 208     # check-stream-equal(_test-stream, "10", msg)
 209     # . . push args
 210     68/push  "F - test-write-int32-decimal-multiple-digits"/imm32
 211     68/push  "10"/imm32
-212     68/push  _test-stream/imm32
+212     68/push  _test-stream/imm32
 213     # . . call
-214     e8/call  check-stream-equal/disp32
+214     e8/call  check-stream-equal/disp32
 215     # . . discard args
 216     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 217     # . end
@@ -285,17 +285,17 @@ if ('onhashchange' in window) {
 222     # setup
 223     # . clear-stream(_test-stream)
 224     # . . push args
-225     68/push  _test-stream/imm32
+225     68/push  _test-stream/imm32
 226     # . . call
-227     e8/call  clear-stream/disp32
+227     e8/call  clear-stream/disp32
 228     # . . discard args
 229     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 230     # write-int32-decimal(_test-stream, -9)
 231     # . . push args
 232     68/push  -9/imm32
-233     68/push  _test-stream/imm32
+233     68/push  _test-stream/imm32
 234     # . . call
-235     e8/call  write-int32-decimal/disp32
+235     e8/call  write-int32-decimal/disp32
 236     # . . discard args
 237     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 238 +-- 26 lines: #?     # dump _test-stream ------------------------------------------------------------------------------------------------------------------------------------------------
@@ -303,9 +303,9 @@ if ('onhashchange' in window) {
 265     # . . push args
 266     68/push  "F - test-write-int32-decimal-negative"/imm32
 267     68/push  "-9"/imm32
-268     68/push  _test-stream/imm32
+268     68/push  _test-stream/imm32
 269     # . . call
-270     e8/call  check-stream-equal/disp32
+270     e8/call  check-stream-equal/disp32
 271     # . . discard args
 272     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 273     # . end
@@ -316,32 +316,32 @@ if ('onhashchange' in window) {
 278     # setup
 279     # . clear-stream(_test-stream)
 280     # . . push args
-281     68/push  _test-stream/imm32
+281     68/push  _test-stream/imm32
 282     # . . call
-283     e8/call  clear-stream/disp32
+283     e8/call  clear-stream/disp32
 284     # . . discard args
 285     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 286     # write-int32-decimal(_test-stream, -10)
 287     # . . push args
 288     68/push  -0xa/imm32
-289     68/push  _test-stream/imm32
+289     68/push  _test-stream/imm32
 290     # . . call
-291     e8/call  write-int32-decimal/disp32
+291     e8/call  write-int32-decimal/disp32
 292     # . . discard args
 293     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 294     # check-stream-equal(_test-stream, "-10", msg)
 295     # . . push args
 296     68/push  "F - test-write-int32-decimal-negative-multiple-digits"/imm32
 297     68/push  "-10"/imm32
-298     68/push  _test-stream/imm32
+298     68/push  _test-stream/imm32
 299     # . . call
-300     e8/call  check-stream-equal/disp32
+300     e8/call  check-stream-equal/disp32
 301     # . . discard args
 302     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 303     # . end
 304     c3/return
 305 
-306 is-decimal-digit?:  # c: byte -> eax: boolean
+306 is-decimal-digit?:  # c: byte -> result/eax: boolean
 307     # . prologue
 308     55/push-ebp
 309     89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
@@ -372,7 +372,7 @@ if ('onhashchange' in window) {
 334     # . . push args
 335     68/push  0x2f/imm32
 336     # . . call
-337     e8/call  is-decimal-digit?/disp32
+337     e8/call  is-decimal-digit?/disp32
 338     # . . discard args
 339     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 340     # check-ints-equal(eax, 0, msg)
@@ -381,7 +381,7 @@ if ('onhashchange' in window) {
 343     68/push  0/imm32/false
 344     50/push-eax
 345     # . . call
-346     e8/call  check-ints-equal/disp32
+346     e8/call  check-ints-equal/disp32
 347     # . . discard args
 348     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 349     c3/return
@@ -391,7 +391,7 @@ if ('onhashchange' in window) {
 353     # . . push args
 354     68/push  0x30/imm32
 355     # . . call
-356     e8/call  is-decimal-digit?/disp32
+356     e8/call  is-decimal-digit?/disp32
 357     # . . discard args
 358     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 359     # check-ints-equal(eax, 1, msg)
@@ -400,14 +400,14 @@ if ('onhashchange' in window) {
 362     68/push  1/imm32/true
 363     50/push-eax
 364     # . . call
-365     e8/call  check-ints-equal/disp32
+365     e8/call  check-ints-equal/disp32
 366     # . . discard args
 367     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 368     # eax = is-decimal-digit?(0x39)
 369     # . . push args
 370     68/push  0x39/imm32
 371     # . . call
-372     e8/call  is-decimal-digit?/disp32
+372     e8/call  is-decimal-digit?/disp32
 373     # . . discard args
 374     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 375     # check-ints-equal(eax, 1, msg)
@@ -416,7 +416,7 @@ if ('onhashchange' in window) {
 378     68/push  1/imm32/true
 379     50/push-eax
 380     # . . call
-381     e8/call  check-ints-equal/disp32
+381     e8/call  check-ints-equal/disp32
 382     # . . discard args
 383     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 384     c3/return
@@ -426,7 +426,7 @@ if ('onhashchange' in window) {
 388     # . . push args
 389     68/push  0x3a/imm32
 390     # . . call
-391     e8/call  is-decimal-digit?/disp32
+391     e8/call  is-decimal-digit?/disp32
 392     # . . discard args
 393     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 394     # check-ints-equal(eax, 0, msg)
@@ -435,7 +435,7 @@ if ('onhashchange' in window) {
 397     68/push  0/imm32/false
 398     50/push-eax
 399     # . . call
-400     e8/call  check-ints-equal/disp32
+400     e8/call  check-ints-equal/disp32
 401     # . . discard args
 402     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 403     c3/return
@@ -467,33 +467,33 @@ if ('onhashchange' in window) {
 429     # . write-buffered(stderr, error)
 430     # . . push args
 431     68/push  "to-decimal-digit: not a digit character: "/imm32
-432     68/push  Stderr/imm32
+432     68/push  Stderr/imm32
 433     # . . call
-434     e8/call  write-buffered/disp32
+434     e8/call  write-buffered/disp32
 435     # . . discard args
 436     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 437     # . write-byte-buffered(stderr, %eax)
 438     # . . push args
 439     50/push-eax
-440     68/push  Stderr/imm32
+440     68/push  Stderr/imm32
 441     # . . call
 442 #?     e8/call  write-byte-buffered/disp32
-443     e8/call  write-int32-hex-buffered/disp32
+443     e8/call  write-int32-hex-buffered/disp32
 444     # . . discard args
 445     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 446     # . write-buffered(stderr, "\n")
 447     # . . push args
-448     68/push  Newline/imm32
-449     68/push  Stderr/imm32
+448     68/push  Newline/imm32
+449     68/push  Stderr/imm32
 450     # . . call
-451     e8/call  write-buffered/disp32
+451     e8/call  write-buffered/disp32
 452     # . . discard args
 453     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 454     # . flush(Stderr)
 455     # . . push args
-456     68/push  Stderr/imm32
+456     68/push  Stderr/imm32
 457     # . . call
-458     e8/call  flush/disp32
+458     e8/call  flush/disp32
 459     # . . discard args
 460     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 461     # . syscall(exit, 1)
diff --git a/html/076next-word.subx.html b/html/127next-word.subx.html
similarity index 95%
rename from html/076next-word.subx.html
rename to html/127next-word.subx.html
index d05e391d..e7b79e9a 100644
--- a/html/076next-word.subx.html
+++ b/html/127next-word.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 076next-word.subx
+Mu - 127next-word.subx
 
 
 
@@ -55,7 +55,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/076next-word.subx
+https://github.com/akkartik/mu/blob/master/127next-word.subx
 
   1 # Tokenize by whitespace.
   2 
@@ -84,7 +84,7 @@ if ('onhashchange' in window) {
  25     68/push  0x20/imm32/space
  26     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
  27     # . . call
- 28     e8/call  skip-chars-matching/disp32
+ 28     e8/call  skip-chars-matching/disp32
  29     # . . discard args
  30     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  31 $next-word:check0:
@@ -124,7 +124,7 @@ if ('onhashchange' in window) {
  65     # . . push args
  66     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
  67     # . . call
- 68     e8/call  skip-chars-not-matching-whitespace/disp32
+ 68     e8/call  skip-chars-not-matching-whitespace/disp32
  69     # . . discard args
  70     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  71     # out->end = &line->data[line->read]
@@ -149,9 +149,9 @@ if ('onhashchange' in window) {
  90     # setup
  91     # . clear-stream(_test-stream)
  92     # . . push args
- 93     68/push  _test-stream/imm32
+ 93     68/push  _test-stream/imm32
  94     # . . call
- 95     e8/call  clear-stream/disp32
+ 95     e8/call  clear-stream/disp32
  96     # . . discard args
  97     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  98     # var slice/ecx: slice
@@ -161,43 +161,43 @@ if ('onhashchange' in window) {
 102     # write(_test-stream, "  ab")
 103     # . . push args
 104     68/push  "  ab"/imm32
-105     68/push  _test-stream/imm32
+105     68/push  _test-stream/imm32
 106     # . . call
-107     e8/call  write/disp32
+107     e8/call  write/disp32
 108     # . . discard args
 109     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 110     # next-word(_test-stream, slice)
 111     # . . push args
 112     51/push-ecx
-113     68/push  _test-stream/imm32
+113     68/push  _test-stream/imm32
 114     # . . call
-115     e8/call  next-word/disp32
+115     e8/call  next-word/disp32
 116     # . . discard args
 117     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 118     # check-ints-equal(slice->start - _test-stream->data, 2, msg)
 119     # . check-ints-equal(slice->start - _test-stream, 14, msg)
 120     # . . push args
-121     68/push  "F - test-next-word: start"/imm32
+121     68/push  "F - test-next-word: start"/imm32
 122     68/push  0xe/imm32
 123     # . . push slice->start - _test-stream
 124     8b/copy                         0/mod/indirect  1/rm32/ecx    .           .             .           0/r32/eax   .               .                 # copy *ecx to eax
-125     81          5/subop/subtract    3/mod/direct    0/rm32/eax    .           .             .           .           .               _test-stream/imm32 # subtract from eax
+125     81          5/subop/subtract    3/mod/direct    0/rm32/eax    .           .             .           .           .               _test-stream/imm32 # subtract from eax
 126     50/push-eax
 127     # . . call
-128     e8/call  check-ints-equal/disp32
+128     e8/call  check-ints-equal/disp32
 129     # . . discard args
 130     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 131     # check-ints-equal(slice->end - _test-stream->data, 4, msg)
 132     # . check-ints-equal(slice->end - _test-stream, 16, msg)
 133     # . . push args
-134     68/push  "F - test-next-word: end"/imm32
+134     68/push  "F - test-next-word: end"/imm32
 135     68/push  0x10/imm32
 136     # . . push slice->end - _test-stream
 137     8b/copy                         1/mod/*+disp8   1/rm32/ecx    .           .             .           0/r32/eax   4/disp8         .                 # copy *(ecx+4) to eax
-138     81          5/subop/subtract    3/mod/direct    0/rm32/eax    .           .             .           .           .               _test-stream/imm32 # subtract from eax
+138     81          5/subop/subtract    3/mod/direct    0/rm32/eax    .           .             .           .           .               _test-stream/imm32 # subtract from eax
 139     50/push-eax
 140     # . . call
-141     e8/call  check-ints-equal/disp32
+141     e8/call  check-ints-equal/disp32
 142     # . . discard args
 143     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 144     # . epilogue
@@ -212,9 +212,9 @@ if ('onhashchange' in window) {
 153     # setup
 154     # . clear-stream(_test-stream)
 155     # . . push args
-156     68/push  _test-stream/imm32
+156     68/push  _test-stream/imm32
 157     # . . call
-158     e8/call  clear-stream/disp32
+158     e8/call  clear-stream/disp32
 159     # . . discard args
 160     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 161     # var slice/ecx: slice
@@ -224,43 +224,43 @@ if ('onhashchange' in window) {
 165     # write(_test-stream, "  # a")
 166     # . . push args
 167     68/push  "  # a"/imm32
-168     68/push  _test-stream/imm32
+168     68/push  _test-stream/imm32
 169     # . . call
-170     e8/call  write/disp32
+170     e8/call  write/disp32
 171     # . . discard args
 172     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 173     # next-word(_test-stream, slice)
 174     # . . push args
 175     51/push-ecx
-176     68/push  _test-stream/imm32
+176     68/push  _test-stream/imm32
 177     # . . call
-178     e8/call  next-word/disp32
+178     e8/call  next-word/disp32
 179     # . . discard args
 180     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 181     # check-ints-equal(slice->start - _test-stream->data, 2, msg)
 182     # . check-ints-equal(slice->start - _test-stream, 14, msg)
 183     # . . push args
-184     68/push  "F - test-next-word-returns-whole-comment: start"/imm32
+184     68/push  "F - test-next-word-returns-whole-comment: start"/imm32
 185     68/push  0xe/imm32
 186     # . . push slice->start - _test-stream
 187     8b/copy                         0/mod/indirect  1/rm32/ecx    .           .             .           0/r32/eax   .               .                 # copy *ecx to eax
-188     81          5/subop/subtract    3/mod/direct    0/rm32/eax    .           .             .           .           .               _test-stream/imm32 # subtract from eax
+188     81          5/subop/subtract    3/mod/direct    0/rm32/eax    .           .             .           .           .               _test-stream/imm32 # subtract from eax
 189     50/push-eax
 190     # . . call
-191     e8/call  check-ints-equal/disp32
+191     e8/call  check-ints-equal/disp32
 192     # . . discard args
 193     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 194     # check-ints-equal(slice->end - _test-stream->data, 5, msg)
 195     # . check-ints-equal(slice->end - _test-stream, 17, msg)
 196     # . . push args
-197     68/push  "F - test-next-word-returns-whole-comment: end"/imm32
+197     68/push  "F - test-next-word-returns-whole-comment: end"/imm32
 198     68/push  0x11/imm32
 199     # . . push slice->end - _test-stream
 200     8b/copy                         1/mod/*+disp8   1/rm32/ecx    .           .             .           0/r32/eax   4/disp8         .                 # copy *(ecx+4) to eax
-201     81          5/subop/subtract    3/mod/direct    0/rm32/eax    .           .             .           .           .               _test-stream/imm32 # subtract from eax
+201     81          5/subop/subtract    3/mod/direct    0/rm32/eax    .           .             .           .           .               _test-stream/imm32 # subtract from eax
 202     50/push-eax
 203     # . . call
-204     e8/call  check-ints-equal/disp32
+204     e8/call  check-ints-equal/disp32
 205     # . . discard args
 206     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 207     # . epilogue
@@ -275,9 +275,9 @@ if ('onhashchange' in window) {
 216     # setup
 217     # . clear-stream(_test-stream)
 218     # . . push args
-219     68/push  _test-stream/imm32
+219     68/push  _test-stream/imm32
 220     # . . call
-221     e8/call  clear-stream/disp32
+221     e8/call  clear-stream/disp32
 222     # . . discard args
 223     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 224     # var slice/ecx: slice
@@ -288,9 +288,9 @@ if ('onhashchange' in window) {
 229     # next-word(_test-stream, slice)
 230     # . . push args
 231     51/push-ecx
-232     68/push  _test-stream/imm32
+232     68/push  _test-stream/imm32
 233     # . . call
-234     e8/call  next-word/disp32
+234     e8/call  next-word/disp32
 235     # . . discard args
 236     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 237     # check-ints-equal(slice->end - slice->start, 0, msg)
@@ -302,7 +302,7 @@ if ('onhashchange' in window) {
 243     2b/subtract                     0/mod/indirect  1/rm32/ecx    .           .             .           0/r32/eax   .               .                 # subtract *ecx from eax
 244     50/push-eax
 245     # . . call
-246     e8/call  check-ints-equal/disp32
+246     e8/call  check-ints-equal/disp32
 247     # . . discard args
 248     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 249     # . epilogue
diff --git a/html/077subx-words.subx.html b/html/128subx-words.subx.html
similarity index 97%
rename from html/077subx-words.subx.html
rename to html/128subx-words.subx.html
index b7cf4972..ad7abbaa 100644
--- a/html/077subx-words.subx.html
+++ b/html/128subx-words.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 077subx-words.subx
+Mu - 128subx-words.subx
 
 
 
@@ -55,7 +55,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/077subx-words.subx
+https://github.com/akkartik/mu/blob/master/128subx-words.subx
 
   1 # Helpers for parsing SubX words, with their rules for hex, labels and metadata.
   2 
@@ -64,7 +64,7 @@ if ('onhashchange' in window) {
   5 # . op          subop               mod             rm32          base        index         scale       r32
   6 # . 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
   7 
-  8 has-metadata?:  # word: (addr slice), s: (addr string) -> eax: boolean
+  8 has-metadata?:  # word: (addr slice), s: (addr string) -> result/eax: boolean
   9     # pseudocode:
  10     #   var twig: &slice = next-token-from-slice(word->start, word->end, '/')  # skip name
  11     #   curr = twig->end
@@ -97,7 +97,7 @@ if ('onhashchange' in window) {
  38     52/push-edx
  39     ff          6/subop/push        0/mod/indirect  6/rm32/esi    .           .             .           .           .               .                 # push *esi
  40     # . . call
- 41     e8/call  next-token-from-slice/disp32
+ 41     e8/call  next-token-from-slice/disp32
  42     # . . discard args
  43     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
  44 $has-metadata?:loop:
@@ -108,7 +108,7 @@ if ('onhashchange' in window) {
  49     52/push-edx
  50     ff          6/subop/push        1/mod/*+disp8   7/rm32/edi    .           .             .           .           4/disp8         .                 # push *(edi+4)
  51     # . . call
- 52     e8/call  next-token-from-slice/disp32
+ 52     e8/call  next-token-from-slice/disp32
  53     # . . discard args
  54     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
  55     # if (slice-empty?(twig)) return false
@@ -116,7 +116,7 @@ if ('onhashchange' in window) {
  57     # . . push args
  58     57/push-edi
  59     # . . call
- 60     e8/call  slice-empty?/disp32
+ 60     e8/call  slice-empty?/disp32
  61     # . . discard args
  62     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  63     # . if (eax != false) return false
@@ -128,7 +128,7 @@ if ('onhashchange' in window) {
  69     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
  70     57/push-edi
  71     # . . call
- 72     e8/call  slice-equal?/disp32
+ 72     e8/call  slice-equal?/disp32
  73     # . . discard args
  74     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  75     # . if (eax != false) return true
@@ -169,7 +169,7 @@ if ('onhashchange' in window) {
 110     68/push  "imm32"/imm32
 111     56/push-esi
 112     # . . call
-113     e8/call  has-metadata?/disp32
+113     e8/call  has-metadata?/disp32
 114     # . . discard args
 115     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 116     # check-ints-equal(eax, 1, msg)
@@ -178,7 +178,7 @@ if ('onhashchange' in window) {
 119     68/push  1/imm32/true
 120     50/push-eax
 121     # . . call
-122     e8/call  check-ints-equal/disp32
+122     e8/call  check-ints-equal/disp32
 123     # . . discard args
 124     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 125     # . epilogue
@@ -204,7 +204,7 @@ if ('onhashchange' in window) {
 145     68/push  "d"/imm32
 146     56/push-esi
 147     # . . call
-148     e8/call  has-metadata?/disp32
+148     e8/call  has-metadata?/disp32
 149     # . . discard args
 150     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 151     # check-ints-equal(eax, 0, msg)
@@ -213,7 +213,7 @@ if ('onhashchange' in window) {
 154     68/push  0/imm32/false
 155     50/push-eax
 156     # . . call
-157     e8/call  check-ints-equal/disp32
+157     e8/call  check-ints-equal/disp32
 158     # . . discard args
 159     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 160     # . epilogue
@@ -239,7 +239,7 @@ if ('onhashchange' in window) {
 180     68/push  "a"/imm32
 181     56/push-esi
 182     # . . call
-183     e8/call  has-metadata?/disp32
+183     e8/call  has-metadata?/disp32
 184     # . . discard args
 185     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 186     # check-ints-equal(eax, 0, msg)
@@ -248,7 +248,7 @@ if ('onhashchange' in window) {
 189     68/push  0/imm32/false
 190     50/push-eax
 191     # . . call
-192     e8/call  check-ints-equal/disp32
+192     e8/call  check-ints-equal/disp32
 193     # . . discard args
 194     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 195     # . epilogue
@@ -274,7 +274,7 @@ if ('onhashchange' in window) {
 215     68/push  "c"/imm32
 216     56/push-esi
 217     # . . call
-218     e8/call  has-metadata?/disp32
+218     e8/call  has-metadata?/disp32
 219     # . . discard args
 220     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 221     # check-ints-equal(eax, 1, msg)
@@ -283,7 +283,7 @@ if ('onhashchange' in window) {
 224     68/push  1/imm32/true
 225     50/push-eax
 226     # . . call
-227     e8/call  check-ints-equal/disp32
+227     e8/call  check-ints-equal/disp32
 228     # . . discard args
 229     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 230     # . epilogue
@@ -309,7 +309,7 @@ if ('onhashchange' in window) {
 250     68/push  "d"/imm32
 251     56/push-esi
 252     # . . call
-253     e8/call  has-metadata?/disp32
+253     e8/call  has-metadata?/disp32
 254     # . . discard args
 255     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 256     # check-ints-equal(eax, 0, msg)
@@ -318,7 +318,7 @@ if ('onhashchange' in window) {
 259     68/push  0/imm32/false
 260     50/push-eax
 261     # . . call
-262     e8/call  check-ints-equal/disp32
+262     e8/call  check-ints-equal/disp32
 263     # . . discard args
 264     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 265     # . epilogue
@@ -334,7 +334,7 @@ if ('onhashchange' in window) {
 275 #: - if it starts with '0x' it's treated as a number. (redundant)
 276 #: - if it's two characters long, it can't be a name. Either it's a hex
 277 #:   byte, or it raises an error.
-278 is-valid-name?:  # in: (addr slice) -> eax: boolean
+278 is-valid-name?:  # in: (addr slice) -> result/eax: boolean
 279     # . prologue
 280     55/push-ebp
 281     89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
@@ -404,7 +404,7 @@ if ('onhashchange' in window) {
 345     # . . push args
 346     51/push-ecx
 347     # . . call
-348     e8/call  is-valid-name?/disp32
+348     e8/call  is-valid-name?/disp32
 349     # . . discard args
 350     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 351     # check-ints-equal(eax, 0, msg)
@@ -413,7 +413,7 @@ if ('onhashchange' in window) {
 354     68/push  0/imm32/false
 355     50/push-eax
 356     # . . call
-357     e8/call  check-ints-equal/disp32
+357     e8/call  check-ints-equal/disp32
 358     # . . discard args
 359     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 360     # . epilogue
@@ -438,7 +438,7 @@ if ('onhashchange' in window) {
 379     # . . push args
 380     51/push-ecx
 381     # . . call
-382     e8/call  is-valid-name?/disp32
+382     e8/call  is-valid-name?/disp32
 383     # . . discard args
 384     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 385     # check-ints-equal(eax, 0, msg)
@@ -447,7 +447,7 @@ if ('onhashchange' in window) {
 388     68/push  0/imm32/false
 389     50/push-eax
 390     # . . call
-391     e8/call  check-ints-equal/disp32
+391     e8/call  check-ints-equal/disp32
 392     # . . discard args
 393     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 394     # . epilogue
@@ -472,7 +472,7 @@ if ('onhashchange' in window) {
 413     # . . push args
 414     51/push-ecx
 415     # . . call
-416     e8/call  is-valid-name?/disp32
+416     e8/call  is-valid-name?/disp32
 417     # . . discard args
 418     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 419     # check-ints-equal(eax, 0, msg)
@@ -481,7 +481,7 @@ if ('onhashchange' in window) {
 422     68/push  0/imm32/false
 423     50/push-eax
 424     # . . call
-425     e8/call  check-ints-equal/disp32
+425     e8/call  check-ints-equal/disp32
 426     # . . discard args
 427     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 428     # . epilogue
@@ -506,7 +506,7 @@ if ('onhashchange' in window) {
 447     # . . push args
 448     51/push-ecx
 449     # . . call
-450     e8/call  is-valid-name?/disp32
+450     e8/call  is-valid-name?/disp32
 451     # . . discard args
 452     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 453     # check-ints-equal(eax, 1, msg)
@@ -515,7 +515,7 @@ if ('onhashchange' in window) {
 456     68/push  1/imm32/true
 457     50/push-eax
 458     # . . call
-459     e8/call  check-ints-equal/disp32
+459     e8/call  check-ints-equal/disp32
 460     # . . discard args
 461     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 462     # . epilogue
@@ -540,7 +540,7 @@ if ('onhashchange' in window) {
 481     # . . push args
 482     51/push-ecx
 483     # . . call
-484     e8/call  is-valid-name?/disp32
+484     e8/call  is-valid-name?/disp32
 485     # . . discard args
 486     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 487     # check-ints-equal(eax, 1, msg)
@@ -549,7 +549,7 @@ if ('onhashchange' in window) {
 490     68/push  1/imm32/true
 491     50/push-eax
 492     # . . call
-493     e8/call  check-ints-equal/disp32
+493     e8/call  check-ints-equal/disp32
 494     # . . discard args
 495     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 496     # . epilogue
@@ -574,7 +574,7 @@ if ('onhashchange' in window) {
 515     # . . push args
 516     51/push-ecx
 517     # . . call
-518     e8/call  is-valid-name?/disp32
+518     e8/call  is-valid-name?/disp32
 519     # . . discard args
 520     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 521     # check-ints-equal(eax, 0, msg)
@@ -583,7 +583,7 @@ if ('onhashchange' in window) {
 524     68/push  0/imm32/false
 525     50/push-eax
 526     # . . call
-527     e8/call  check-ints-equal/disp32
+527     e8/call  check-ints-equal/disp32
 528     # . . discard args
 529     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 530     # . epilogue
@@ -591,7 +591,7 @@ if ('onhashchange' in window) {
 532     5d/pop-to-ebp
 533     c3/return
 534 
-535 is-label?: # word: (addr slice) -> eax: boolean
+535 is-label?: # word: (addr slice) -> result/eax: boolean
 536     # . prologue
 537     55/push-ebp
 538     89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
@@ -636,16 +636,16 @@ if ('onhashchange' in window) {
 577     # . . push args
 578     51/push-ecx
 579     # . . call
-580     e8/call  is-label?/disp32
+580     e8/call  is-label?/disp32
 581     # . . discard args
 582     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 583     # check-ints-equal(eax, 1, msg)
 584     # . . push args
-585     68/push  "F - test-is-label?:true"/imm32
+585     68/push  "F - test-is-label?:true"/imm32
 586     68/push  1/imm32
 587     50/push-eax
 588     # . . call
-589     e8/call  check-ints-equal/disp32
+589     e8/call  check-ints-equal/disp32
 590     # . . discard args
 591     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 592 $test-is-label?:false:
@@ -662,16 +662,16 @@ if ('onhashchange' in window) {
 603     # . . push args
 604     51/push-ecx
 605     # . . call
-606     e8/call  is-label?/disp32
+606     e8/call  is-label?/disp32
 607     # . . discard args
 608     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 609     # check-ints-equal(eax, 0, msg)
 610     # . . push args
-611     68/push  "F - test-is-label?:false"/imm32
+611     68/push  "F - test-is-label?:false"/imm32
 612     68/push  0/imm32
 613     50/push-eax
 614     # . . call
-615     e8/call  check-ints-equal/disp32
+615     e8/call  check-ints-equal/disp32
 616     # . . discard args
 617     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 618     # . epilogue
diff --git a/html/078emit-hex.subx.html b/html/129emit-hex.subx.html
similarity index 91%
rename from html/078emit-hex.subx.html
rename to html/129emit-hex.subx.html
index 445e51c8..331cd4eb 100644
--- a/html/078emit-hex.subx.html
+++ b/html/129emit-hex.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 078emit-hex.subx
+Mu - 129emit-hex.subx
 
 
 
@@ -55,7 +55,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/078emit-hex.subx
+https://github.com/akkartik/mu/blob/master/129emit-hex.subx
 
   1 == code
   2 #   instruction                     effective address                                                   register    displacement    immediate
@@ -90,7 +90,7 @@ if ('onhashchange' in window) {
  31     53/push-ebx
  32     57/push-edi
  33     # . . call
- 34     e8/call  write-byte-hex-buffered/disp32
+ 34     e8/call  write-byte-hex-buffered/disp32
  35     # . . discard args
  36     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  37     # write-byte-buffered(out, ' ')
@@ -98,7 +98,7 @@ if ('onhashchange' in window) {
  39     68/push  0x20/imm32/space
  40     57/push-edi
  41     # . . call
- 42     e8/call  write-byte-buffered/disp32
+ 42     e8/call  write-byte-buffered/disp32
  43     # . . discard args
  44     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  45     # ebx = ebx >> 8
@@ -123,32 +123,32 @@ if ('onhashchange' in window) {
  64     # setup
  65     # . clear-stream(_test-output-stream)
  66     # . . push args
- 67     68/push  _test-output-stream/imm32
+ 67     68/push  _test-output-stream/imm32
  68     # . . call
- 69     e8/call  clear-stream/disp32
+ 69     e8/call  clear-stream/disp32
  70     # . . discard args
  71     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  72     # . clear-stream($_test-output-buffered-file->buffer)
  73     # . . push args
  74     68/push  $_test-output-buffered-file->buffer/imm32
  75     # . . call
- 76     e8/call  clear-stream/disp32
+ 76     e8/call  clear-stream/disp32
  77     # . . discard args
  78     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  79     # emit-hex(_test-output-buffered-file, 0xab, 1)
  80     # . . push args
  81     68/push  1/imm32
  82     68/push  0xab/imm32
- 83     68/push  _test-output-buffered-file/imm32
+ 83     68/push  _test-output-buffered-file/imm32
  84     # . . call
- 85     e8/call  emit-hex/disp32
+ 85     e8/call  emit-hex/disp32
  86     # . . discard args
  87     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  88     # flush(_test-output-buffered-file)
  89     # . . push args
- 90     68/push  _test-output-buffered-file/imm32
+ 90     68/push  _test-output-buffered-file/imm32
  91     # . . call
- 92     e8/call  flush/disp32
+ 92     e8/call  flush/disp32
  93     # . . discard args
  94     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  95     # check-ints-equal(*_test-output-stream->data, 'ab ', msg)
@@ -156,10 +156,10 @@ if ('onhashchange' in window) {
  97     68/push  "F - test-emit-hex-single-byte"/imm32
  98     68/push  0x206261/imm32
  99     # . . push *_test-output-stream->data
-100     b8/copy-to-eax  _test-output-stream/imm32
+100     b8/copy-to-eax  _test-output-stream/imm32
 101     ff          6/subop/push        1/mod/*+disp8   0/rm32/eax    .           .             .           .           0xc/disp8       .                 # push *(eax+12)
 102     # . . call
-103     e8/call  check-ints-equal/disp32
+103     e8/call  check-ints-equal/disp32
 104     # . . discard args
 105     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 106     # . end
@@ -169,41 +169,41 @@ if ('onhashchange' in window) {
 110     # setup
 111     # . clear-stream(_test-output-stream)
 112     # . . push args
-113     68/push  _test-output-stream/imm32
+113     68/push  _test-output-stream/imm32
 114     # . . call
-115     e8/call  clear-stream/disp32
+115     e8/call  clear-stream/disp32
 116     # . . discard args
 117     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 118     # . clear-stream($_test-output-buffered-file->buffer)
 119     # . . push args
 120     68/push  $_test-output-buffered-file->buffer/imm32
 121     # . . call
-122     e8/call  clear-stream/disp32
+122     e8/call  clear-stream/disp32
 123     # . . discard args
 124     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 125     # emit-hex(_test-output-buffered-file, 0x1234, 2)
 126     # . . push args
 127     68/push  2/imm32
 128     68/push  0x1234/imm32
-129     68/push  _test-output-buffered-file/imm32
+129     68/push  _test-output-buffered-file/imm32
 130     # . . call
-131     e8/call  emit-hex/disp32
+131     e8/call  emit-hex/disp32
 132     # . . discard args
 133     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 134     # flush(_test-output-buffered-file)
 135     # . . push args
-136     68/push  _test-output-buffered-file/imm32
+136     68/push  _test-output-buffered-file/imm32
 137     # . . call
-138     e8/call  flush/disp32
+138     e8/call  flush/disp32
 139     # . . discard args
 140     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 141     # check-stream-equal(_test-output-stream, "34 12 ", msg)
 142     # . . push args
-143     68/push  "F - test-emit-hex-multiple-byte/1"/imm32
+143     68/push  "F - test-emit-hex-multiple-byte/1"/imm32
 144     68/push  "34 12 "/imm32
-145     68/push  _test-output-stream/imm32
+145     68/push  _test-output-stream/imm32
 146     # . . call
-147     e8/call  check-stream-equal/disp32
+147     e8/call  check-stream-equal/disp32
 148     # . . discard args
 149     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 150     # . end
@@ -213,41 +213,41 @@ if ('onhashchange' in window) {
 154     # setup
 155     # . clear-stream(_test-output-stream)
 156     # . . push args
-157     68/push  _test-output-stream/imm32
+157     68/push  _test-output-stream/imm32
 158     # . . call
-159     e8/call  clear-stream/disp32
+159     e8/call  clear-stream/disp32
 160     # . . discard args
 161     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 162     # . clear-stream($_test-output-buffered-file->buffer)
 163     # . . push args
 164     68/push  $_test-output-buffered-file->buffer/imm32
 165     # . . call
-166     e8/call  clear-stream/disp32
+166     e8/call  clear-stream/disp32
 167     # . . discard args
 168     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 169     # emit-hex(_test-output-buffered-file, 0xab, 2)
 170     # . . push args
 171     68/push  2/imm32
 172     68/push  0xab/imm32
-173     68/push  _test-output-buffered-file/imm32
+173     68/push  _test-output-buffered-file/imm32
 174     # . . call
-175     e8/call  emit-hex/disp32
+175     e8/call  emit-hex/disp32
 176     # . . discard args
 177     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 178     # flush(_test-output-buffered-file)
 179     # . . push args
-180     68/push  _test-output-buffered-file/imm32
+180     68/push  _test-output-buffered-file/imm32
 181     # . . call
-182     e8/call  flush/disp32
+182     e8/call  flush/disp32
 183     # . . discard args
 184     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 185     # check(_test-output-stream->data == 'ab 00 ')
 186     # . . push args
-187     68/push  "F - test-emit-hex-zero-pad/1"/imm32
+187     68/push  "F - test-emit-hex-zero-pad/1"/imm32
 188     68/push  "ab 00 "/imm32
-189     68/push  _test-output-stream/imm32
+189     68/push  _test-output-stream/imm32
 190     # . . call
-191     e8/call  check-stream-equal/disp32
+191     e8/call  check-stream-equal/disp32
 192     # . . discard args
 193     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 194     # . end
@@ -257,41 +257,41 @@ if ('onhashchange' in window) {
 198     # setup
 199     # . clear-stream(_test-output-stream)
 200     # . . push args
-201     68/push  _test-output-stream/imm32
+201     68/push  _test-output-stream/imm32
 202     # . . call
-203     e8/call  clear-stream/disp32
+203     e8/call  clear-stream/disp32
 204     # . . discard args
 205     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 206     # . clear-stream($_test-output-buffered-file->buffer)
 207     # . . push args
 208     68/push  $_test-output-buffered-file->buffer/imm32
 209     # . . call
-210     e8/call  clear-stream/disp32
+210     e8/call  clear-stream/disp32
 211     # . . discard args
 212     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 213     # emit-hex(_test-output-buffered-file, -1, 2)
 214     # . . push args
 215     68/push  2/imm32
 216     68/push  -1/imm32
-217     68/push  _test-output-buffered-file/imm32
+217     68/push  _test-output-buffered-file/imm32
 218     # . . call
-219     e8/call  emit-hex/disp32
+219     e8/call  emit-hex/disp32
 220     # . . discard args
 221     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 222     # flush(_test-output-buffered-file)
 223     # . . push args
-224     68/push  _test-output-buffered-file/imm32
+224     68/push  _test-output-buffered-file/imm32
 225     # . . call
-226     e8/call  flush/disp32
+226     e8/call  flush/disp32
 227     # . . discard args
 228     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 229     # check-stream-equal(_test-output-stream == "ff ff ")
 230     # . . push args
-231     68/push  "F - test-emit-hex-negative/1"/imm32
+231     68/push  "F - test-emit-hex-negative/1"/imm32
 232     68/push  "ff ff "/imm32
-233     68/push  _test-output-stream/imm32
+233     68/push  _test-output-stream/imm32
 234     # . . call
-235     e8/call  check-stream-equal/disp32
+235     e8/call  check-stream-equal/disp32
 236     # . . discard args
 237     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 238     # . end
diff --git a/html/079emit.subx.html b/html/130emit.subx.html
similarity index 94%
rename from html/079emit.subx.html
rename to html/130emit.subx.html
index 839298cf..95279c9f 100644
--- a/html/079emit.subx.html
+++ b/html/130emit.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 079emit.subx
+Mu - 130emit.subx
 
 
 
@@ -57,7 +57,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/079emit.subx
+https://github.com/akkartik/mu/blob/master/130emit.subx
 
   1 == code
   2 #   instruction                     effective address                                                   register    displacement    immediate
@@ -89,7 +89,7 @@ if ('onhashchange' in window) {
  28     ff          6/subop/push        1/mod/*+disp8   6/rm32/esi    .           .             .           .           4/disp8         .                 # push *(esi+4)
  29     ff          6/subop/push        0/mod/indirect  6/rm32/esi    .           .             .           .           .               .                 # push *esi
  30     # . . call
- 31     e8/call  next-token-from-slice/disp32
+ 31     e8/call  next-token-from-slice/disp32
  32     # . . discard args
  33     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
  34     # if (is-valid-name?(datum)) write-slice-buffered(out, word) and return
@@ -97,7 +97,7 @@ if ('onhashchange' in window) {
  36     # . . push args
  37     57/push-edi
  38     # . . call
- 39     e8/call  is-valid-name?/disp32
+ 39     e8/call  is-valid-name?/disp32
  40     # . . discard args
  41     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  42     # . if (eax != false)
@@ -109,15 +109,15 @@ if ('onhashchange' in window) {
  48     56/push-esi
  49     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
  50     # . . call
- 51     e8/call  write-slice-buffered/disp32
+ 51     e8/call  write-slice-buffered/disp32
  52     # . . discard args
  53     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  54     # . write-buffered(out, " ")
  55     # . . push args
- 56     68/push  Space/imm32
+ 56     68/push  Space/imm32
  57     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
  58     # . . call
- 59     e8/call  write-buffered/disp32
+ 59     e8/call  write-buffered/disp32
  60     # . . discard args
  61     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  62     # . return
@@ -133,7 +133,7 @@ if ('onhashchange' in window) {
  72     # . . push args
  73     57/push-edi
  74     # . . call
- 75     e8/call  parse-hex-int-from-slice/disp32
+ 75     e8/call  parse-hex-int-from-slice/disp32
  76     # . . discard args
  77     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  78     # . emit-hex(out, value, width)
@@ -142,7 +142,7 @@ if ('onhashchange' in window) {
  81     50/push-eax
  82     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
  83     # . . call
- 84     e8/call  emit-hex/disp32
+ 84     e8/call  emit-hex/disp32
  85     # . . discard args
  86     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  87 $emit:end:
@@ -164,16 +164,16 @@ if ('onhashchange' in window) {
 103     # setup
 104     # . clear-stream(_test-output-stream)
 105     # . . push args
-106     68/push  _test-output-stream/imm32
+106     68/push  _test-output-stream/imm32
 107     # . . call
-108     e8/call  clear-stream/disp32
+108     e8/call  clear-stream/disp32
 109     # . . discard args
 110     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 111     # . clear-stream($_test-output-buffered-file->buffer)
 112     # . . push args
 113     68/push  $_test-output-buffered-file->buffer/imm32
 114     # . . call
-115     e8/call  clear-stream/disp32
+115     e8/call  clear-stream/disp32
 116     # . . discard args
 117     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 118     # (eax..ecx) = "30"
@@ -189,25 +189,25 @@ if ('onhashchange' in window) {
 128     # . . push args
 129     68/push  1/imm32
 130     51/push-ecx
-131     68/push  _test-output-buffered-file/imm32
+131     68/push  _test-output-buffered-file/imm32
 132     # . . call
-133     e8/call  emit/disp32
+133     e8/call  emit/disp32
 134     # . . discard args
 135     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 136     # flush(_test-output-buffered-file)
 137     # . . push args
-138     68/push  _test-output-buffered-file/imm32
+138     68/push  _test-output-buffered-file/imm32
 139     # . . call
-140     e8/call  flush/disp32
+140     e8/call  flush/disp32
 141     # . . discard args
 142     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 143     # check-stream-equal(_test-output-stream, "30 ", msg)
 144     # . . push args
-145     68/push  "F - test-emit-number/1"/imm32
+145     68/push  "F - test-emit-number/1"/imm32
 146     68/push  "30 "/imm32
-147     68/push  _test-output-stream/imm32
+147     68/push  _test-output-stream/imm32
 148     # . . call
-149     e8/call  check-stream-equal/disp32
+149     e8/call  check-stream-equal/disp32
 150     # . . discard args
 151     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 152     # . epilogue
@@ -223,16 +223,16 @@ if ('onhashchange' in window) {
 162     # setup
 163     # . clear-stream(_test-output-stream)
 164     # . . push args
-165     68/push  _test-output-stream/imm32
+165     68/push  _test-output-stream/imm32
 166     # . . call
-167     e8/call  clear-stream/disp32
+167     e8/call  clear-stream/disp32
 168     # . . discard args
 169     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 170     # . clear-stream($_test-output-buffered-file->buffer)
 171     # . . push args
 172     68/push  $_test-output-buffered-file->buffer/imm32
 173     # . . call
-174     e8/call  clear-stream/disp32
+174     e8/call  clear-stream/disp32
 175     # . . discard args
 176     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 177     # (eax..ecx) = "-2"
@@ -248,25 +248,25 @@ if ('onhashchange' in window) {
 187     # . . push args
 188     68/push  2/imm32
 189     51/push-ecx
-190     68/push  _test-output-buffered-file/imm32
+190     68/push  _test-output-buffered-file/imm32
 191     # . . call
-192     e8/call  emit/disp32
+192     e8/call  emit/disp32
 193     # . . discard args
 194     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 195     # flush(_test-output-buffered-file)
 196     # . . push args
-197     68/push  _test-output-buffered-file/imm32
+197     68/push  _test-output-buffered-file/imm32
 198     # . . call
-199     e8/call  flush/disp32
+199     e8/call  flush/disp32
 200     # . . discard args
 201     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 202     # check-stream-equal(_test-output-stream, "fe ff ", msg)
 203     # . . push args
-204     68/push  "F - test-emit-number/1"/imm32
+204     68/push  "F - test-emit-number/1"/imm32
 205     68/push  "fe ff "/imm32
-206     68/push  _test-output-stream/imm32
+206     68/push  _test-output-stream/imm32
 207     # . . call
-208     e8/call  check-stream-equal/disp32
+208     e8/call  check-stream-equal/disp32
 209     # . . discard args
 210     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 211     # . epilogue
@@ -281,16 +281,16 @@ if ('onhashchange' in window) {
 220     # setup
 221     # . clear-stream(_test-output-stream)
 222     # . . push args
-223     68/push  _test-output-stream/imm32
+223     68/push  _test-output-stream/imm32
 224     # . . call
-225     e8/call  clear-stream/disp32
+225     e8/call  clear-stream/disp32
 226     # . . discard args
 227     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 228     # . clear-stream($_test-output-buffered-file->buffer)
 229     # . . push args
 230     68/push  $_test-output-buffered-file->buffer/imm32
 231     # . . call
-232     e8/call  clear-stream/disp32
+232     e8/call  clear-stream/disp32
 233     # . . discard args
 234     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 235     # (eax..ecx) = "-2/foo"
@@ -306,16 +306,16 @@ if ('onhashchange' in window) {
 245     # . . push args
 246     68/push  2/imm32
 247     51/push-ecx
-248     68/push  _test-output-buffered-file/imm32
+248     68/push  _test-output-buffered-file/imm32
 249     # . . call
-250     e8/call  emit/disp32
+250     e8/call  emit/disp32
 251     # . . discard args
 252     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 253     # flush(_test-output-buffered-file)
 254     # . . push args
-255     68/push  _test-output-buffered-file/imm32
+255     68/push  _test-output-buffered-file/imm32
 256     # . . call
-257     e8/call  flush/disp32
+257     e8/call  flush/disp32
 258     # . . discard args
 259     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 260     # the '/foo' will have no impact on the output
@@ -323,9 +323,9 @@ if ('onhashchange' in window) {
 262     # . . push args
 263     68/push  "F - test-emit-number-with-metadata"/imm32
 264     68/push  "fe ff "/imm32
-265     68/push  _test-output-stream/imm32
+265     68/push  _test-output-stream/imm32
 266     # . . call
-267     e8/call  check-stream-equal/disp32
+267     e8/call  check-stream-equal/disp32
 268     # . . discard args
 269     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 270     # . epilogue
@@ -340,16 +340,16 @@ if ('onhashchange' in window) {
 279     # setup
 280     # . clear-stream(_test-output-stream)
 281     # . . push args
-282     68/push  _test-output-stream/imm32
+282     68/push  _test-output-stream/imm32
 283     # . . call
-284     e8/call  clear-stream/disp32
+284     e8/call  clear-stream/disp32
 285     # . . discard args
 286     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 287     # . clear-stream($_test-output-buffered-file->buffer)
 288     # . . push args
 289     68/push  $_test-output-buffered-file->buffer/imm32
 290     # . . call
-291     e8/call  clear-stream/disp32
+291     e8/call  clear-stream/disp32
 292     # . . discard args
 293     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 294     # (eax..ecx) = "xyz"
@@ -365,25 +365,25 @@ if ('onhashchange' in window) {
 304     # . . push args
 305     68/push  2/imm32
 306     51/push-ecx
-307     68/push  _test-output-buffered-file/imm32
+307     68/push  _test-output-buffered-file/imm32
 308     # . . call
-309     e8/call  emit/disp32
+309     e8/call  emit/disp32
 310     # . . discard args
 311     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 312     # flush(_test-output-buffered-file)
 313     # . . push args
-314     68/push  _test-output-buffered-file/imm32
+314     68/push  _test-output-buffered-file/imm32
 315     # . . call
-316     e8/call  flush/disp32
+316     e8/call  flush/disp32
 317     # . . discard args
 318     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 319     # check-stream-equal(_test-output-stream, "xyz", msg)
 320     # . . push args
 321     68/push  "F - test-emit-non-number"/imm32
 322     68/push  "xyz "/imm32
-323     68/push  _test-output-stream/imm32
+323     68/push  _test-output-stream/imm32
 324     # . . call
-325     e8/call  check-stream-equal/disp32
+325     e8/call  check-stream-equal/disp32
 326     # . . discard args
 327     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 328     # . epilogue
@@ -398,16 +398,16 @@ if ('onhashchange' in window) {
 337     # setup
 338     # . clear-stream(_test-output-stream)
 339     # . . push args
-340     68/push  _test-output-stream/imm32
+340     68/push  _test-output-stream/imm32
 341     # . . call
-342     e8/call  clear-stream/disp32
+342     e8/call  clear-stream/disp32
 343     # . . discard args
 344     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 345     # . clear-stream($_test-output-buffered-file->buffer)
 346     # . . push args
 347     68/push  $_test-output-buffered-file->buffer/imm32
 348     # . . call
-349     e8/call  clear-stream/disp32
+349     e8/call  clear-stream/disp32
 350     # . . discard args
 351     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 352     # (eax..ecx) = "xyz/"
@@ -423,25 +423,25 @@ if ('onhashchange' in window) {
 362     # . . push args
 363     68/push  2/imm32
 364     51/push-ecx
-365     68/push  _test-output-buffered-file/imm32
+365     68/push  _test-output-buffered-file/imm32
 366     # . . call
-367     e8/call  emit/disp32
+367     e8/call  emit/disp32
 368     # . . discard args
 369     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 370     # flush(_test-output-buffered-file)
 371     # . . push args
-372     68/push  _test-output-buffered-file/imm32
+372     68/push  _test-output-buffered-file/imm32
 373     # . . call
-374     e8/call  flush/disp32
+374     e8/call  flush/disp32
 375     # . . discard args
 376     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 377     # check-stream-equal(_test-output-stream, "xyz/", msg)
 378     # . . push args
 379     68/push  "F - test-emit-non-number-with-metadata"/imm32
 380     68/push  "xyz/ "/imm32
-381     68/push  _test-output-stream/imm32
+381     68/push  _test-output-stream/imm32
 382     # . . call
-383     e8/call  check-stream-equal/disp32
+383     e8/call  check-stream-equal/disp32
 384     # . . discard args
 385     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 386     # . epilogue
@@ -456,16 +456,16 @@ if ('onhashchange' in window) {
 395     # setup
 396     # . clear-stream(_test-output-stream)
 397     # . . push args
-398     68/push  _test-output-stream/imm32
+398     68/push  _test-output-stream/imm32
 399     # . . call
-400     e8/call  clear-stream/disp32
+400     e8/call  clear-stream/disp32
 401     # . . discard args
 402     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 403     # . clear-stream($_test-output-buffered-file->buffer)
 404     # . . push args
 405     68/push  $_test-output-buffered-file->buffer/imm32
 406     # . . call
-407     e8/call  clear-stream/disp32
+407     e8/call  clear-stream/disp32
 408     # . . discard args
 409     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 410     # (eax..ecx) = "abcd/xyz"
@@ -481,16 +481,16 @@ if ('onhashchange' in window) {
 420     # . . push args
 421     68/push  2/imm32
 422     51/push-ecx
-423     68/push  _test-output-buffered-file/imm32
+423     68/push  _test-output-buffered-file/imm32
 424     # . . call
-425     e8/call  emit/disp32
+425     e8/call  emit/disp32
 426     # . . discard args
 427     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 428     # flush(_test-output-buffered-file)
 429     # . . push args
-430     68/push  _test-output-buffered-file/imm32
+430     68/push  _test-output-buffered-file/imm32
 431     # . . call
-432     e8/call  flush/disp32
+432     e8/call  flush/disp32
 433     # . . discard args
 434     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 435 +-- 26 lines: #?     # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -498,9 +498,9 @@ if ('onhashchange' in window) {
 462     # . . push args
 463     68/push  "F - test-emit-non-number-with-all-hex-digits"/imm32
 464     68/push  "abcd/xyz "/imm32
-465     68/push  _test-output-stream/imm32
+465     68/push  _test-output-stream/imm32
 466     # . . call
-467     e8/call  check-stream-equal/disp32
+467     e8/call  check-stream-equal/disp32
 468     # . . discard args
 469     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 470     # . epilogue
diff --git a/html/081table.subx.html b/html/131table.subx.html
similarity index 96%
rename from html/081table.subx.html
rename to html/131table.subx.html
index 59c8020b..719b91b3 100644
--- a/html/081table.subx.html
+++ b/html/131table.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 081table.subx
+Mu - 131table.subx
 
 
 
@@ -57,7 +57,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/081table.subx
+https://github.com/akkartik/mu/blob/master/131table.subx
 
    1 # A table is a stream of (key, value) rows.
    2 #
@@ -84,7 +84,7 @@ if ('onhashchange' in window) {
   23 # . 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
   24 
   25 # if no row is found, abort
-  26 get:  # table: (addr stream {(handle array byte), T}), key: (addr array byte), row-size: int, abort-message-prefix: (addr array byte) -> eax: (addr T)
+  26 get:  # table: (addr stream {(handle array byte), T}), key: (addr array byte), row-size: int, abort-message-prefix: (addr array byte) -> result/eax: (addr T)
   27     # pseudocode:
   28     #   curr = table->data
   29     #   max = &table->data[table->write]
@@ -118,7 +118,7 @@ if ('onhashchange' in window) {
   57     ff          6/subop/push        1/mod/*+disp8   1/rm32/ecx    .           .             .           .           4/disp8         .                 # push *(ecx+4)
   58     ff          6/subop/push        0/mod/indirect  1/rm32/ecx    .           .             .           .           .               .                 # push *ecx
   59     # . . call
-  60     e8/call  lookup/disp32
+  60     e8/call  lookup/disp32
   61     # . . discard args
   62     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
   63     # if (string-equal?(key, c)) return curr+8
@@ -127,7 +127,7 @@ if ('onhashchange' in window) {
   66     50/push-eax
   67     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
   68     # . . call
-  69     e8/call  string-equal?/disp32
+  69     e8/call  string-equal?/disp32
   70     # . . discard args
   71     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
   72     # . if (eax != false) return eax = curr+8
@@ -156,15 +156,15 @@ if ('onhashchange' in window) {
   95     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0x14/disp8      .                 # push *(ebp+20)
   96     68/push  2/imm32/stderr
   97     # . . call
-  98     e8/call  _write/disp32
+  98     e8/call  _write/disp32
   99     # . . discard args
  100     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  101     # . _write(2/stderr, error)
  102     # . . push args
- 103     68/push  ": get: key not found: "/imm32
+ 103     68/push  ": get: key not found: "/imm32
  104     68/push  2/imm32/stderr
  105     # . . call
- 106     e8/call  _write/disp32
+ 106     e8/call  _write/disp32
  107     # . . discard args
  108     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  109     # . _write(2/stderr, key)
@@ -172,15 +172,15 @@ if ('onhashchange' in window) {
  111     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
  112     68/push  2/imm32/stderr
  113     # . . call
- 114     e8/call  _write/disp32
+ 114     e8/call  _write/disp32
  115     # . . discard args
  116     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  117     # . _write(2/stderr, "\n")
  118     # . . push args
- 119     68/push  Newline/imm32
+ 119     68/push  Newline/imm32
  120     68/push  2/imm32/stderr
  121     # . . call
- 122     e8/call  _write/disp32
+ 122     e8/call  _write/disp32
  123     # . . discard args
  124     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  125     # . syscall(exit, 1)
@@ -201,22 +201,22 @@ if ('onhashchange' in window) {
  140     89/copy                         3/mod/direct    1/rm32/ecx    .           .             .           4/r32/esp   .               .                 # copy esp to ecx
  141     # insert(table, "code", 12 bytes/row, Heap)
  142     # . . push args
- 143     68/push  Heap/imm32
+ 143     68/push  Heap/imm32
  144     68/push  0xc/imm32/row-size
  145     68/push  "code"/imm32
  146     51/push-ecx
  147     # . . call
- 148     e8/call  get-or-insert/disp32
+ 148     e8/call  get-or-insert/disp32
  149     # . . discard args
  150     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
  151     # insert(table, "data", 12 bytes/row, Heap)
  152     # . . push args
- 153     68/push  Heap/imm32
+ 153     68/push  Heap/imm32
  154     68/push  0xc/imm32/row-size
  155     68/push  "data"/imm32
  156     51/push-ecx
  157     # . . call
- 158     e8/call  get-or-insert/disp32
+ 158     e8/call  get-or-insert/disp32
  159     # . . discard args
  160     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
  161 $test-get:check1:
@@ -226,18 +226,18 @@ if ('onhashchange' in window) {
  165     68/push  "code"/imm32
  166     51/push-ecx
  167     # . . call
- 168     e8/call  get/disp32
+ 168     e8/call  get/disp32
  169     # . . discard args
  170     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  171     # check-ints-equal(eax - table->data, 8, msg)
  172     # . check-ints-equal(eax - table, 20, msg)
  173     # . . push args
- 174     68/push  "F - test-get/0"/imm32
+ 174     68/push  "F - test-get/0"/imm32
  175     68/push  0x14/imm32
  176     29/subtract                     3/mod/direct    0/rm32/eax    .           .             .           1/r32/ecx   .               .                 # subtract ecx from eax
  177     50/push-eax
  178     # . . call
- 179     e8/call  check-ints-equal/disp32
+ 179     e8/call  check-ints-equal/disp32
  180     # . . discard args
  181     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  182 $test-get:check2:
@@ -247,18 +247,18 @@ if ('onhashchange' in window) {
  186     68/push  "data"/imm32
  187     51/push-ecx
  188     # . . call
- 189     e8/call  get/disp32
+ 189     e8/call  get/disp32
  190     # . . discard args
  191     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  192     # check-ints-equal(eax - table->data, 20, msg)
  193     # . check-ints-equal(eax - table, 32, msg)
  194     # . . push args
- 195     68/push  "F - test-get/1"/imm32
+ 195     68/push  "F - test-get/1"/imm32
  196     68/push  0x20/imm32
  197     29/subtract                     3/mod/direct    0/rm32/eax    .           .             .           1/r32/ecx   .               .                 # subtract ecx from eax
  198     50/push-eax
  199     # . . call
- 200     e8/call  check-ints-equal/disp32
+ 200     e8/call  check-ints-equal/disp32
  201     # . . discard args
  202     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  203 $test-get:end:
@@ -268,7 +268,7 @@ if ('onhashchange' in window) {
  207     c3/return
  208 
  209 # if no row is found, abort
- 210 get-slice:  # table: (addr stream {(handle array byte), T}), key: (addr slice), row-size: int, abort-message-prefix: (addr array byte) -> eax: (addr T)
+ 210 get-slice:  # table: (addr stream {(handle array byte), T}), key: (addr slice), row-size: int, abort-message-prefix: (addr array byte) -> result/eax: (addr T)
  211     # pseudocode:
  212     #   curr = table->data
  213     #   max = &table->data[table->write]
@@ -302,7 +302,7 @@ if ('onhashchange' in window) {
  241     ff          6/subop/push        1/mod/*+disp8   1/rm32/ecx    .           .             .           .           4/disp8         .                 # push *(ecx+4)
  242     ff          6/subop/push        0/mod/indirect  1/rm32/ecx    .           .             .           .           .               .                 # push *ecx
  243     # . . call
- 244     e8/call  lookup/disp32
+ 244     e8/call  lookup/disp32
  245     # . . discard args
  246     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  247     # if (slice-equal?(key, c)) return curr+8
@@ -311,7 +311,7 @@ if ('onhashchange' in window) {
  250     50/push-eax
  251     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
  252     # . . call
- 253     e8/call  slice-equal?/disp32
+ 253     e8/call  slice-equal?/disp32
  254     # . . discard args
  255     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  256     # . if (eax != false) return eax = curr+8
@@ -340,38 +340,38 @@ if ('onhashchange' in window) {
  279     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0x14/disp8      .                 # push *(ebp+20)
  280     68/push  2/imm32/stderr
  281     # . . call
- 282     e8/call  _write/disp32
+ 282     e8/call  _write/disp32
  283     # . . discard args
  284     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  285     # . _write(2/stderr, error)
  286     # . . push args
- 287     68/push  ": get-slice: key not found: "/imm32
+ 287     68/push  ": get-slice: key not found: "/imm32
  288     68/push  2/imm32/stderr
  289     # . . call
- 290     e8/call  _write/disp32
+ 290     e8/call  _write/disp32
  291     # . . discard args
  292     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  293     # . write-slice-buffered(Stderr, key)
  294     # . . push args
  295     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
- 296     68/push  Stderr/imm32
+ 296     68/push  Stderr/imm32
  297     # . . call
- 298     e8/call  write-slice-buffered/disp32
+ 298     e8/call  write-slice-buffered/disp32
  299     # . . discard args
  300     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  301     # . flush(Stderr)
  302     # . . push args
- 303     68/push  Stderr/imm32
+ 303     68/push  Stderr/imm32
  304     # . . call
- 305     e8/call  flush/disp32
+ 305     e8/call  flush/disp32
  306     # . . discard args
  307     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  308     # . _write(2/stderr, "\n")
  309     # . . push args
- 310     68/push  Newline/imm32
+ 310     68/push  Newline/imm32
  311     68/push  2/imm32/stderr
  312     # . . call
- 313     e8/call  _write/disp32
+ 313     e8/call  _write/disp32
  314     # . . discard args
  315     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  316     # . syscall(exit, 1)
@@ -392,22 +392,22 @@ if ('onhashchange' in window) {
  331     89/copy                         3/mod/direct    1/rm32/ecx    .           .             .           4/r32/esp   .               .                 # copy esp to ecx
  332     # insert(table, "code", 12 bytes/row, Heap)
  333     # . . push args
- 334     68/push  Heap/imm32
+ 334     68/push  Heap/imm32
  335     68/push  0xc/imm32/row-size
  336     68/push  "code"/imm32
  337     51/push-ecx
  338     # . . call
- 339     e8/call  get-or-insert/disp32
+ 339     e8/call  get-or-insert/disp32
  340     # . . discard args
  341     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
  342     # insert(table, "data", 12 bytes/row, Heap)
  343     # . . push args
- 344     68/push  Heap/imm32
+ 344     68/push  Heap/imm32
  345     68/push  0xc/imm32/row-size
  346     68/push  "data"/imm32
  347     51/push-ecx
  348     # . . call
- 349     e8/call  get-or-insert/disp32
+ 349     e8/call  get-or-insert/disp32
  350     # . . discard args
  351     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
  352 $test-get-slice:check1:
@@ -426,18 +426,18 @@ if ('onhashchange' in window) {
  365     52/push-edx
  366     51/push-ecx
  367     # . . call
- 368     e8/call  get-slice/disp32
+ 368     e8/call  get-slice/disp32
  369     # . . discard args
  370     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  371     # check-ints-equal(eax - table->data, 8, msg)  # first row's value slot returned
  372     # . check-ints-equal(eax - table, 20, msg)
  373     # . . push args
- 374     68/push  "F - test-get-slice/0"/imm32
+ 374     68/push  "F - test-get-slice/0"/imm32
  375     68/push  0x14/imm32
  376     29/subtract                     3/mod/direct    0/rm32/eax    .           .             .           1/r32/ecx   .               .                 # subtract ecx from eax
  377     50/push-eax
  378     # . . call
- 379     e8/call  check-ints-equal/disp32
+ 379     e8/call  check-ints-equal/disp32
  380     # . . discard args
  381     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  382 $test-get-slice:check2:
@@ -456,18 +456,18 @@ if ('onhashchange' in window) {
  395     52/push-edx
  396     51/push-ecx
  397     # . . call
- 398     e8/call  get-slice/disp32
+ 398     e8/call  get-slice/disp32
  399     # . . discard args
  400     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  401     # check-ints-equal(eax - table->data, 20, msg)
  402     # . check-ints-equal(eax - table, 32, msg)
  403     # . . push args
- 404     68/push  "F - test-get-slice/1"/imm32
+ 404     68/push  "F - test-get-slice/1"/imm32
  405     68/push  0x20/imm32
  406     29/subtract                     3/mod/direct    0/rm32/eax    .           .             .           1/r32/ecx   .               .                 # subtract ecx from eax
  407     50/push-eax
  408     # . . call
- 409     e8/call  check-ints-equal/disp32
+ 409     e8/call  check-ints-equal/disp32
  410     # . . discard args
  411     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  412 $test-get-slice:end:
@@ -479,7 +479,7 @@ if ('onhashchange' in window) {
  418 # if no row is found, save 'key' to the next available row
  419 # if there are no rows free, abort
  420 # return the address of the value
- 421 get-or-insert:  # table: (addr stream {(handle array byte), T}), key: (addr array byte), row-size: int, ad: (addr allocation-descriptor) -> eax: (addr T)
+ 421 get-or-insert:  # table: (addr stream {(handle array byte), T}), key: (addr array byte), row-size: int, ad: (addr allocation-descriptor) -> result/eax: (addr T)
  422     # pseudocode:
  423     #   curr = table->data
  424     #   max = &table->data[table->write]
@@ -518,7 +518,7 @@ if ('onhashchange' in window) {
  457     ff          6/subop/push        1/mod/*+disp8   1/rm32/ecx    .           .             .           .           4/disp8         .                 # push *(ecx+4)
  458     ff          6/subop/push        0/mod/indirect  1/rm32/ecx    .           .             .           .           .               .                 # push *ecx
  459     # . . call
- 460     e8/call  lookup/disp32
+ 460     e8/call  lookup/disp32
  461     # . . discard args
  462     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  463     # if (string-equal?(key, c)) return curr+8
@@ -527,7 +527,7 @@ if ('onhashchange' in window) {
  466     50/push-eax
  467     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
  468     # . . call
- 469     e8/call  string-equal?/disp32
+ 469     e8/call  string-equal?/disp32
  470     # . . discard args
  471     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  472     # . if (eax != false) return eax = curr+8
@@ -550,7 +550,7 @@ if ('onhashchange' in window) {
  489     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0x10/disp8      .                 # push *(ebp+16)
  490     52/push-edx
  491     # . . call
- 492     e8/call  zero-out/disp32
+ 492     e8/call  zero-out/disp32
  493     # . . discard args
  494     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  495     # copy-array(ad, key, max)
@@ -559,7 +559,7 @@ if ('onhashchange' in window) {
  498     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
  499     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0x14/disp8      .                 # push *(ebp+20)
  500     # . . call
- 501     e8/call  copy-array/disp32
+ 501     e8/call  copy-array/disp32
  502     # . . discard args
  503     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  504     # table->write += row-size
@@ -588,7 +588,7 @@ if ('onhashchange' in window) {
  527     68/push  "get-or-insert: table is full\n"/imm32
  528     68/push  2/imm32/stderr
  529     # . . call
- 530     e8/call  _write/disp32
+ 530     e8/call  _write/disp32
  531     # . . discard args
  532     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  533     # . syscall(exit, 1)
@@ -610,32 +610,32 @@ if ('onhashchange' in window) {
  549     # - start with an empty table, insert one key, verify that it was inserted
  550     # eax = get-or-insert(table, "code", 12 bytes/row, Heap)
  551     # . . push args
- 552     68/push  Heap/imm32
+ 552     68/push  Heap/imm32
  553     68/push  0xc/imm32/row-size
  554     68/push  "code"/imm32
  555     51/push-ecx
  556     # . . call
- 557     e8/call  get-or-insert/disp32
+ 557     e8/call  get-or-insert/disp32
  558     # . . discard args
  559     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
  560     # check-ints-equal(eax - table->data, 8, msg)  # first row's value slot returned
  561     # . check-ints-equal(eax - table, 20, msg)
  562     # . . push args
- 563     68/push  "F - test-get-or-insert/0"/imm32
+ 563     68/push  "F - test-get-or-insert/0"/imm32
  564     68/push  0x14/imm32
  565     29/subtract                     3/mod/direct    0/rm32/eax    .           .             .           1/r32/ecx   .               .                 # subtract ecx from eax
  566     50/push-eax
  567     # . . call
- 568     e8/call  check-ints-equal/disp32
+ 568     e8/call  check-ints-equal/disp32
  569     # . . discard args
  570     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  571     # check-ints-equal(table->write, row-size = 12, msg)
  572     # . . push args
- 573     68/push  "F - test-get-or-insert/1"/imm32
+ 573     68/push  "F - test-get-or-insert/1"/imm32
  574     68/push  0xc/imm32/row-size
  575     ff          6/subop/push        0/mod/indirect  1/rm32/ecx    .           .             .           .           .               .                 # push *ecx
  576     # . . call
- 577     e8/call  check-ints-equal/disp32
+ 577     e8/call  check-ints-equal/disp32
  578     # . . discard args
  579     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  580     # var curr-addr/eax: (addr array byte) = lookup(table->data)
@@ -643,49 +643,49 @@ if ('onhashchange' in window) {
  582     ff          6/subop/push        1/mod/*+disp8   1/rm32/ecx    .           .             .           .           0x10/disp8      .                 # push *(ecx+16)
  583     ff          6/subop/push        1/mod/*+disp8   1/rm32/ecx    .           .             .           .           0xc/disp8       .                 # push *(ecx+12)
  584     # . . call
- 585     e8/call  lookup/disp32
+ 585     e8/call  lookup/disp32
  586     # . . discard args
  587     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  588     # check-strings-equal(curr-addr, "code", msg)
  589     # . . push args
- 590     68/push  "F - test-get-or-insert/2"/imm32
+ 590     68/push  "F - test-get-or-insert/2"/imm32
  591     68/push  "code"/imm32
  592     50/push-eax
  593     # . . call
- 594     e8/call  check-strings-equal/disp32
+ 594     e8/call  check-strings-equal/disp32
  595     # . . discard args
  596     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  597 $test-get-or-insert:second-call:
  598     # - insert the same key again, verify that it was reused
  599     # eax = get-or-insert(table, "code", 12 bytes/row, Heap)
  600     # . . push args
- 601     68/push  Heap/imm32
+ 601     68/push  Heap/imm32
  602     68/push  0xc/imm32/row-size
  603     68/push  "code"/imm32
  604     51/push-ecx
  605     # . . call
- 606     e8/call  get-or-insert/disp32
+ 606     e8/call  get-or-insert/disp32
  607     # . . discard args
  608     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
  609     # check-ints-equal(eax - table->data, 8, msg)
  610     # . check-ints-equal(eax - table, 20, msg)
  611     # . . push args
- 612     68/push  "F - test-get-or-insert/3"/imm32
+ 612     68/push  "F - test-get-or-insert/3"/imm32
  613     68/push  0x14/imm32
  614     29/subtract                     3/mod/direct    0/rm32/eax    .           .             .           1/r32/ecx   .               .                 # subtract ecx from eax
  615     50/push-eax
  616     # . . call
- 617     e8/call  check-ints-equal/disp32
+ 617     e8/call  check-ints-equal/disp32
  618     # . . discard args
  619     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  620     # no new row inserted
  621     # . check-ints-equal(table->write, row-size = 12, msg)
  622     # . . push args
- 623     68/push  "F - test-get-or-insert/4"/imm32
+ 623     68/push  "F - test-get-or-insert/4"/imm32
  624     68/push  0xc/imm32/row-size
  625     ff          6/subop/push        0/mod/indirect  1/rm32/ecx    .           .             .           .           .               .                 # push *ecx
  626     # . . call
- 627     e8/call  check-ints-equal/disp32
+ 627     e8/call  check-ints-equal/disp32
  628     # . . discard args
  629     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  630     # curr-addr = lookup(table->data)
@@ -693,49 +693,49 @@ if ('onhashchange' in window) {
  632     ff          6/subop/push        1/mod/*+disp8   1/rm32/ecx    .           .             .           .           0x10/disp8      .                 # push *(ecx+16)
  633     ff          6/subop/push        1/mod/*+disp8   1/rm32/ecx    .           .             .           .           0xc/disp8       .                 # push *(ecx+12)
  634     # . . call
- 635     e8/call  lookup/disp32
+ 635     e8/call  lookup/disp32
  636     # . . discard args
  637     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  638     # check-strings-equal(curr-addr, "code", msg)
  639     # . . push args
- 640     68/push  "F - test-get-or-insert/5"/imm32
+ 640     68/push  "F - test-get-or-insert/5"/imm32
  641     68/push  "code"/imm32
  642     50/push-eax
  643     # . . call
- 644     e8/call  check-strings-equal/disp32
+ 644     e8/call  check-strings-equal/disp32
  645     # . . discard args
  646     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  647 $test-get-or-insert:third-call:
  648     # - insert a new key, verify that it was inserted
  649     # eax = get-or-insert(table, "data", 12 bytes/row, Heap)
  650     # . . push args
- 651     68/push  Heap/imm32
+ 651     68/push  Heap/imm32
  652     68/push  0xc/imm32/row-size
  653     68/push  "data"/imm32
  654     51/push-ecx
  655     # . . call
- 656     e8/call  get-or-insert/disp32
+ 656     e8/call  get-or-insert/disp32
  657     # . . discard args
  658     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
  659     # table gets a new row
  660     # check-ints-equal(eax - table->data, 20, msg)  # second row's value slot returned
  661     # . check-ints-equal(eax - table, 32, msg)
  662     # . . push args
- 663     68/push  "F - test-get-or-insert/6"/imm32
+ 663     68/push  "F - test-get-or-insert/6"/imm32
  664     68/push  0x20/imm32
  665     29/subtract                     3/mod/direct    0/rm32/eax    .           .             .           1/r32/ecx   .               .                 # subtract ecx from eax
  666     50/push-eax
  667     # . . call
- 668     e8/call  check-ints-equal/disp32
+ 668     e8/call  check-ints-equal/disp32
  669     # . . discard args
  670     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  671     # check-ints-equal(table->write, 2 rows = 24, msg)
  672     # . . push args
- 673     68/push  "F - test-get-or-insert/7"/imm32
+ 673     68/push  "F - test-get-or-insert/7"/imm32
  674     68/push  0x18/imm32/two-rows
  675     ff          6/subop/push        0/mod/indirect  1/rm32/ecx    .           .             .           .           .               .                 # push *ecx
  676     # . . call
- 677     e8/call  check-ints-equal/disp32
+ 677     e8/call  check-ints-equal/disp32
  678     # . . discard args
  679     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  680     # curr-addr = lookup(table->data+12)
@@ -743,16 +743,16 @@ if ('onhashchange' in window) {
  682     ff          6/subop/push        1/mod/*+disp8   1/rm32/ecx    .           .             .           .           0x1c/disp8      .                 # push *(ecx+28)
  683     ff          6/subop/push        1/mod/*+disp8   1/rm32/ecx    .           .             .           .           0x18/disp8      .                 # push *(ecx+24)
  684     # . . call
- 685     e8/call  lookup/disp32
+ 685     e8/call  lookup/disp32
  686     # . . discard args
  687     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  688     # check-strings-equal(curr-addr, "data", msg)
  689     # . . push args
- 690     68/push  "F - test-get-or-insert/8"/imm32
+ 690     68/push  "F - test-get-or-insert/8"/imm32
  691     68/push  "data"/imm32
  692     50/push-eax
  693     # . . call
- 694     e8/call  check-strings-equal/disp32
+ 694     e8/call  check-strings-equal/disp32
  695     # . . discard args
  696     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  697 $test-get-or-insert:end:
@@ -764,7 +764,7 @@ if ('onhashchange' in window) {
  703 # if no row is found, save 'key' to the next available row
  704 # if there are no rows free, abort
  705 # return the address of the value
- 706 get-or-insert-handle:  # table: (addr stream {(handle array byte), T}), key: (handle array byte), row-size: int -> eax: (addr T)
+ 706 get-or-insert-handle:  # table: (addr stream {(handle array byte), T}), key: (handle array byte), row-size: int -> result/eax: (addr T)
  707     # pseudocode:
  708     #   var curr: (addr handle stream) = table->data
  709     #   var max: (addr byte) = &table->data[table->write]
@@ -796,7 +796,7 @@ if ('onhashchange' in window) {
  735     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0x10/disp8      .                 # push *(ebp+16)
  736     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
  737     # . . call
- 738     e8/call  lookup/disp32
+ 738     e8/call  lookup/disp32
  739     # . . discard args
  740     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  741     # . ebx = eax
@@ -815,7 +815,7 @@ if ('onhashchange' in window) {
  754     ff          6/subop/push        1/mod/*+disp8   1/rm32/ecx    .           .             .           .           4/disp8         .                 # push *(ecx+4)
  755     ff          6/subop/push        0/mod/indirect  1/rm32/ecx    .           .             .           .           .               .                 # push *ecx
  756     # . . call
- 757     e8/call  lookup/disp32
+ 757     e8/call  lookup/disp32
  758     # . . discard args
  759     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  760     # if (string-equal?(k, c)) return curr+8
@@ -824,7 +824,7 @@ if ('onhashchange' in window) {
  763     50/push-eax
  764     53/push-ebx
  765     # . . call
- 766     e8/call  string-equal?/disp32
+ 766     e8/call  string-equal?/disp32
  767     # . . discard args
  768     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  769     # . if (eax != false) return eax = curr+8
@@ -874,7 +874,7 @@ if ('onhashchange' in window) {
  813     68/push  "get-or-insert-handle: table is full\n"/imm32
  814     68/push  2/imm32/stderr
  815     # . . call
- 816     e8/call  _write/disp32
+ 816     e8/call  _write/disp32
  817     # . . discard args
  818     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  819     # . syscall(exit, 1)
@@ -902,9 +902,9 @@ if ('onhashchange' in window) {
  841     # . . push args
  842     52/push-edx
  843     68/push  "code"/imm32
- 844     68/push  Heap/imm32
+ 844     68/push  Heap/imm32
  845     # . . call
- 846     e8/call  copy-array/disp32
+ 846     e8/call  copy-array/disp32
  847     # . . discard args
  848     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  849     # eax = get-or-insert-handle(table, h, 12 bytes/row)
@@ -914,27 +914,27 @@ if ('onhashchange' in window) {
  853     ff          6/subop/push        0/mod/indirect  2/rm32/edx    .           .             .           .           .               .                 # push *edx
  854     51/push-ecx
  855     # . . call
- 856     e8/call  get-or-insert-handle/disp32
+ 856     e8/call  get-or-insert-handle/disp32
  857     # . . discard args
  858     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
  859     # check-ints-equal(eax - table->data, 8, msg)  # first row's value slot returned
  860     # . check-ints-equal(eax - table, 20, msg)
  861     # . . push args
- 862     68/push  "F - test-get-or-insert-handle/0"/imm32
+ 862     68/push  "F - test-get-or-insert-handle/0"/imm32
  863     68/push  0x14/imm32
  864     29/subtract                     3/mod/direct    0/rm32/eax    .           .             .           1/r32/ecx   .               .                 # subtract ecx from eax
  865     50/push-eax
  866     # . . call
- 867     e8/call  check-ints-equal/disp32
+ 867     e8/call  check-ints-equal/disp32
  868     # . . discard args
  869     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  870     # check-ints-equal(table->write, row-size = 12, msg)
  871     # . . push args
- 872     68/push  "F - test-get-or-insert-handle/1"/imm32
+ 872     68/push  "F - test-get-or-insert-handle/1"/imm32
  873     68/push  0xc/imm32/row-size
  874     ff          6/subop/push        0/mod/indirect  1/rm32/ecx    .           .             .           .           .               .                 # push *ecx
  875     # . . call
- 876     e8/call  check-ints-equal/disp32
+ 876     e8/call  check-ints-equal/disp32
  877     # . . discard args
  878     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  879     # var curr-addr/eax: (addr array byte) = lookup(table->data)
@@ -942,16 +942,16 @@ if ('onhashchange' in window) {
  881     ff          6/subop/push        1/mod/*+disp8   1/rm32/ecx    .           .             .           .           0x10/disp8      .                 # push *(ecx+16)
  882     ff          6/subop/push        1/mod/*+disp8   1/rm32/ecx    .           .             .           .           0xc/disp8       .                 # push *(ecx+12)
  883     # . . call
- 884     e8/call  lookup/disp32
+ 884     e8/call  lookup/disp32
  885     # . . discard args
  886     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  887     # check-strings-equal(curr-addr, "code", msg)
  888     # . . push args
- 889     68/push  "F - test-get-or-insert-handle/2"/imm32
+ 889     68/push  "F - test-get-or-insert-handle/2"/imm32
  890     68/push  "code"/imm32
  891     50/push-eax
  892     # . . call
- 893     e8/call  check-strings-equal/disp32
+ 893     e8/call  check-strings-equal/disp32
  894     # . . discard args
  895     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  896 $test-get-or-insert-handle:second-call:
@@ -960,9 +960,9 @@ if ('onhashchange' in window) {
  899     # . . push args
  900     52/push-edx
  901     68/push  "code"/imm32
- 902     68/push  Heap/imm32
+ 902     68/push  Heap/imm32
  903     # . . call
- 904     e8/call  copy-array/disp32
+ 904     e8/call  copy-array/disp32
  905     # . . discard args
  906     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  907     # eax = get-or-insert-handle(table, h, 12 bytes/row)
@@ -972,28 +972,28 @@ if ('onhashchange' in window) {
  911     ff          6/subop/push        0/mod/indirect  2/rm32/edx    .           .             .           .           .               .                 # push *edx
  912     51/push-ecx
  913     # . . call
- 914     e8/call  get-or-insert-handle/disp32
+ 914     e8/call  get-or-insert-handle/disp32
  915     # . . discard args
  916     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
  917     # check-ints-equal(eax - table->data, 8, msg)
  918     # . check-ints-equal(eax - table, 20, msg)
  919     # . . push args
- 920     68/push  "F - test-get-or-insert-handle/3"/imm32
+ 920     68/push  "F - test-get-or-insert-handle/3"/imm32
  921     68/push  0x14/imm32
  922     29/subtract                     3/mod/direct    0/rm32/eax    .           .             .           1/r32/ecx   .               .                 # subtract ecx from eax
  923     50/push-eax
  924     # . . call
- 925     e8/call  check-ints-equal/disp32
+ 925     e8/call  check-ints-equal/disp32
  926     # . . discard args
  927     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  928     # no new row inserted
  929     # . check-ints-equal(table->write, row-size = 12, msg)
  930     # . . push args
- 931     68/push  "F - test-get-or-insert-handle/4"/imm32
+ 931     68/push  "F - test-get-or-insert-handle/4"/imm32
  932     68/push  0xc/imm32/row-size
  933     ff          6/subop/push        0/mod/indirect  1/rm32/ecx    .           .             .           .           .               .                 # push *ecx
  934     # . . call
- 935     e8/call  check-ints-equal/disp32
+ 935     e8/call  check-ints-equal/disp32
  936     # . . discard args
  937     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  938     # curr-addr = lookup(table->data)
@@ -1001,16 +1001,16 @@ if ('onhashchange' in window) {
  940     ff          6/subop/push        1/mod/*+disp8   1/rm32/ecx    .           .             .           .           0x10/disp8      .                 # push *(ecx+16)
  941     ff          6/subop/push        1/mod/*+disp8   1/rm32/ecx    .           .             .           .           0xc/disp8       .                 # push *(ecx+12)
  942     # . . call
- 943     e8/call  lookup/disp32
+ 943     e8/call  lookup/disp32
  944     # . . discard args
  945     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  946     # check-strings-equal(curr-addr, "code", msg)
  947     # . . push args
- 948     68/push  "F - test-get-or-insert-handle/5"/imm32
+ 948     68/push  "F - test-get-or-insert-handle/5"/imm32
  949     68/push  "code"/imm32
  950     50/push-eax
  951     # . . call
- 952     e8/call  check-strings-equal/disp32
+ 952     e8/call  check-strings-equal/disp32
  953     # . . discard args
  954     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  955 $test-get-or-insert-handle:third-call:
@@ -1019,9 +1019,9 @@ if ('onhashchange' in window) {
  958     # . . push args
  959     52/push-edx
  960     68/push  "data"/imm32
- 961     68/push  Heap/imm32
+ 961     68/push  Heap/imm32
  962     # . . call
- 963     e8/call  copy-array/disp32
+ 963     e8/call  copy-array/disp32
  964     # . . discard args
  965     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  966     # eax = get-or-insert-handle(table, h, 12 bytes/row)
@@ -1031,28 +1031,28 @@ if ('onhashchange' in window) {
  970     ff          6/subop/push        0/mod/indirect  2/rm32/edx    .           .             .           .           .               .                 # push *edx
  971     51/push-ecx
  972     # . . call
- 973     e8/call  get-or-insert-handle/disp32
+ 973     e8/call  get-or-insert-handle/disp32
  974     # . . discard args
  975     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
  976     # table gets a new row
  977     # check-ints-equal(eax - table->data, 20, msg)  # second row's value slot returned
  978     # . check-ints-equal(eax - table, 32, msg)
  979     # . . push args
- 980     68/push  "F - test-get-or-insert-handle/6"/imm32
+ 980     68/push  "F - test-get-or-insert-handle/6"/imm32
  981     68/push  0x20/imm32
  982     29/subtract                     3/mod/direct    0/rm32/eax    .           .             .           1/r32/ecx   .               .                 # subtract ecx from eax
  983     50/push-eax
  984     # . . call
- 985     e8/call  check-ints-equal/disp32
+ 985     e8/call  check-ints-equal/disp32
  986     # . . discard args
  987     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  988     # check-ints-equal(table->write, 2 rows = 24, msg)
  989     # . . push args
- 990     68/push  "F - test-get-or-insert-handle/7"/imm32
+ 990     68/push  "F - test-get-or-insert-handle/7"/imm32
  991     68/push  0x18/imm32/two-rows
  992     ff          6/subop/push        0/mod/indirect  1/rm32/ecx    .           .             .           .           .               .                 # push *ecx
  993     # . . call
- 994     e8/call  check-ints-equal/disp32
+ 994     e8/call  check-ints-equal/disp32
  995     # . . discard args
  996     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  997     # curr-addr = lookup(table->data+12)
@@ -1060,16 +1060,16 @@ if ('onhashchange' in window) {
  999     ff          6/subop/push        1/mod/*+disp8   1/rm32/ecx    .           .             .           .           0x1c/disp8      .                 # push *(ecx+28)
 1000     ff          6/subop/push        1/mod/*+disp8   1/rm32/ecx    .           .             .           .           0x18/disp8      .                 # push *(ecx+24)
 1001     # . . call
-1002     e8/call  lookup/disp32
+1002     e8/call  lookup/disp32
 1003     # . . discard args
 1004     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1005     # check-strings-equal(curr-addr, "data", msg)
 1006     # . . push args
-1007     68/push  "F - test-get-or-insert-handle/8"/imm32
+1007     68/push  "F - test-get-or-insert-handle/8"/imm32
 1008     68/push  "data"/imm32
 1009     50/push-eax
 1010     # . . call
-1011     e8/call  check-strings-equal/disp32
+1011     e8/call  check-strings-equal/disp32
 1012     # . . discard args
 1013     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1014 $test-get-or-insert-handle:end:
@@ -1080,7 +1080,7 @@ if ('onhashchange' in window) {
 1019 
 1020 # if no row is found, save 'key' in the next available row
 1021 # if there are no rows free, abort
-1022 get-or-insert-slice:  # table: (addr stream {(handle array byte), T}), key: (addr slice), row-size: int, ad: (addr allocation-descriptor) -> eax: (addr T)
+1022 get-or-insert-slice:  # table: (addr stream {(handle array byte), T}), key: (addr slice), row-size: int, ad: (addr allocation-descriptor) -> result/eax: (addr T)
 1023     # pseudocode:
 1024     #   curr = table->data
 1025     #   max = &table->data[table->write]
@@ -1119,7 +1119,7 @@ if ('onhashchange' in window) {
 1058     ff          6/subop/push        1/mod/*+disp8   1/rm32/ecx    .           .             .           .           4/disp8         .                 # push *(ecx+4)
 1059     ff          6/subop/push        0/mod/indirect  1/rm32/ecx    .           .             .           .           .               .                 # push *ecx
 1060     # . . call
-1061     e8/call  lookup/disp32
+1061     e8/call  lookup/disp32
 1062     # . . discard args
 1063     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1064     # if (slice-equal?(key, c)) return curr+4
@@ -1128,7 +1128,7 @@ if ('onhashchange' in window) {
 1067     50/push-eax
 1068     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
 1069     # . . call
-1070     e8/call  slice-equal?/disp32
+1070     e8/call  slice-equal?/disp32
 1071     # . . discard args
 1072     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1073     # . if (eax != false) return eax = curr+8
@@ -1153,7 +1153,7 @@ if ('onhashchange' in window) {
 1092     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0x10/disp8      .                 # push *(ebp+16)
 1093     52/push-edx
 1094     # . . call
-1095     e8/call  zero-out/disp32
+1095     e8/call  zero-out/disp32
 1096     # . . discard args
 1097     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1098     # slice-to-string(ad, key, max)
@@ -1162,7 +1162,7 @@ if ('onhashchange' in window) {
 1101     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
 1102     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0x14/disp8      .                 # push *(ebp+20)
 1103     # . . call
-1104     e8/call  slice-to-string/disp32
+1104     e8/call  slice-to-string/disp32
 1105     # . . discard args
 1106     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1107     # table->write += row-size
@@ -1191,7 +1191,7 @@ if ('onhashchange' in window) {
 1130     68/push  "get-or-insert-slice: table is full\n"/imm32
 1131     68/push  2/imm32/stderr
 1132     # . . call
-1133     e8/call  _write/disp32
+1133     e8/call  _write/disp32
 1134     # . . discard args
 1135     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1136     # . syscall(exit, 1)
@@ -1222,32 +1222,32 @@ if ('onhashchange' in window) {
 1161     # - start with an empty table, insert one key, verify that it was inserted
 1162     # eax = get-or-insert-slice(table, "code" slice, 12 bytes/row, Heap)
 1163     # . . push args
-1164     68/push  Heap/imm32
+1164     68/push  Heap/imm32
 1165     68/push  0xc/imm32/row-size
 1166     52/push-edx
 1167     51/push-ecx
 1168     # . . call
-1169     e8/call  get-or-insert-slice/disp32
+1169     e8/call  get-or-insert-slice/disp32
 1170     # . . discard args
 1171     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
 1172     # check-ints-equal(eax - table->data, 8, msg)  # first row's value slot returned
 1173     # . check-ints-equal(eax - table, 20, msg)
 1174     # . . push args
-1175     68/push  "F - test-get-or-insert-slice/0"/imm32
+1175     68/push  "F - test-get-or-insert-slice/0"/imm32
 1176     68/push  0x14/imm32
 1177     29/subtract                     3/mod/direct    0/rm32/eax    .           .             .           1/r32/ecx   .               .                 # subtract ecx from eax
 1178     50/push-eax
 1179     # . . call
-1180     e8/call  check-ints-equal/disp32
+1180     e8/call  check-ints-equal/disp32
 1181     # . . discard args
 1182     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1183     # check-ints-equal(table->write, row-size = 12, msg)
 1184     # . . push args
-1185     68/push  "F - test-get-or-insert-slice/1"/imm32
+1185     68/push  "F - test-get-or-insert-slice/1"/imm32
 1186     68/push  0xc/imm32/row-size
 1187     ff          6/subop/push        0/mod/indirect  1/rm32/ecx    .           .             .           .           .               .                 # push *ecx
 1188     # . . call
-1189     e8/call  check-ints-equal/disp32
+1189     e8/call  check-ints-equal/disp32
 1190     # . . discard args
 1191     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1192     # var curr-addr/eax: (addr array byte) = lookup(table->data)
@@ -1255,49 +1255,49 @@ if ('onhashchange' in window) {
 1194     ff          6/subop/push        1/mod/*+disp8   1/rm32/ecx    .           .             .           .           0x10/disp8      .                 # push *(ecx+16)
 1195     ff          6/subop/push        1/mod/*+disp8   1/rm32/ecx    .           .             .           .           0xc/disp8       .                 # push *(ecx+12)
 1196     # . . call
-1197     e8/call  lookup/disp32
+1197     e8/call  lookup/disp32
 1198     # . . discard args
 1199     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1200     # check-strings-equal(curr-addr, "code", msg)
 1201     # . . push args
-1202     68/push  "F - test-get-or-insert-slice/2"/imm32
+1202     68/push  "F - test-get-or-insert-slice/2"/imm32
 1203     68/push  "code"/imm32
 1204     50/push-eax
 1205     # . . call
-1206     e8/call  check-strings-equal/disp32
+1206     e8/call  check-strings-equal/disp32
 1207     # . . discard args
 1208     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1209 $test-get-or-insert-slice:second-call:
 1210     # - insert the same key again, verify that it was reused
 1211     # eax = get-or-insert-slice(table, "code" slice, 12 bytes/row)
 1212     # . . push args
-1213     68/push  Heap/imm32
+1213     68/push  Heap/imm32
 1214     68/push  0xc/imm32/row-size
 1215     52/push-edx
 1216     51/push-ecx
 1217     # . . call
-1218     e8/call  get-or-insert-slice/disp32
+1218     e8/call  get-or-insert-slice/disp32
 1219     # . . discard args
 1220     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
 1221     # check-ints-equal(eax - table->data, 8, msg)
 1222     # . check-ints-equal(eax - table, 20, msg)
 1223     # . . push args
-1224     68/push  "F - test-get-or-insert-slice/3"/imm32
+1224     68/push  "F - test-get-or-insert-slice/3"/imm32
 1225     68/push  0x14/imm32
 1226     29/subtract                     3/mod/direct    0/rm32/eax    .           .             .           1/r32/ecx   .               .                 # subtract ecx from eax
 1227     50/push-eax
 1228     # . . call
-1229     e8/call  check-ints-equal/disp32
+1229     e8/call  check-ints-equal/disp32
 1230     # . . discard args
 1231     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1232     # no new row inserted
 1233     # . check-ints-equal(table->write, row-size = 12, msg)
 1234     # . . push args
-1235     68/push  "F - test-get-or-insert-slice/4"/imm32
+1235     68/push  "F - test-get-or-insert-slice/4"/imm32
 1236     68/push  0xc/imm32/row-size
 1237     ff          6/subop/push        0/mod/indirect  1/rm32/ecx    .           .             .           .           .               .                 # push *ecx
 1238     # . . call
-1239     e8/call  check-ints-equal/disp32
+1239     e8/call  check-ints-equal/disp32
 1240     # . . discard args
 1241     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1242     # curr-addr = lookup(table->data)
@@ -1305,16 +1305,16 @@ if ('onhashchange' in window) {
 1244     ff          6/subop/push        1/mod/*+disp8   1/rm32/ecx    .           .             .           .           0x10/disp8      .                 # push *(ecx+16)
 1245     ff          6/subop/push        1/mod/*+disp8   1/rm32/ecx    .           .             .           .           0xc/disp8       .                 # push *(ecx+12)
 1246     # . . call
-1247     e8/call  lookup/disp32
+1247     e8/call  lookup/disp32
 1248     # . . discard args
 1249     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1250     # check-strings-equal(curr-addr, "code", msg)
 1251     # . . push args
-1252     68/push  "F - test-get-or-insert-slice/5"/imm32
+1252     68/push  "F - test-get-or-insert-slice/5"/imm32
 1253     68/push  "code"/imm32
 1254     50/push-eax
 1255     # . . call
-1256     e8/call  check-strings-equal/disp32
+1256     e8/call  check-strings-equal/disp32
 1257     # . . discard args
 1258     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1259 $test-get-or-insert-slice:third-call:
@@ -1330,33 +1330,33 @@ if ('onhashchange' in window) {
 1269     89/copy                         3/mod/direct    2/rm32/edx    .           .             .           4/r32/esp   .               .                 # copy esp to edx
 1270     # eax = get-or-insert-slice(table, "data" slice, 12 bytes/row)
 1271     # . . push args
-1272     68/push  Heap/imm32
+1272     68/push  Heap/imm32
 1273     68/push  0xc/imm32/row-size
 1274     52/push-edx
 1275     51/push-ecx
 1276     # . . call
-1277     e8/call  get-or-insert-slice/disp32
+1277     e8/call  get-or-insert-slice/disp32
 1278     # . . discard args
 1279     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
 1280     # table gets a new row
 1281     # check-ints-equal(eax - table->data, 20, msg)  # second row's value slot returned
 1282     # . check-ints-equal(eax - table, 32, msg)
 1283     # . . push args
-1284     68/push  "F - test-get-or-insert-slice/6"/imm32
+1284     68/push  "F - test-get-or-insert-slice/6"/imm32
 1285     68/push  0x20/imm32
 1286     29/subtract                     3/mod/direct    0/rm32/eax    .           .             .           1/r32/ecx   .               .                 # subtract ecx from eax
 1287     50/push-eax
 1288     # . . call
-1289     e8/call  check-ints-equal/disp32
+1289     e8/call  check-ints-equal/disp32
 1290     # . . discard args
 1291     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1292     # check-ints-equal(table->write, 2 rows = 24, msg)
 1293     # . . push args
-1294     68/push  "F - test-get-or-insert-slice/7"/imm32
+1294     68/push  "F - test-get-or-insert-slice/7"/imm32
 1295     68/push  0x18/imm32/two-rows
 1296     ff          6/subop/push        0/mod/indirect  1/rm32/ecx    .           .             .           .           .               .                 # push *ecx
 1297     # . . call
-1298     e8/call  check-ints-equal/disp32
+1298     e8/call  check-ints-equal/disp32
 1299     # . . discard args
 1300     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1301     # curr-addr = lookup(table->data+12)
@@ -1364,16 +1364,16 @@ if ('onhashchange' in window) {
 1303     ff          6/subop/push        1/mod/*+disp8   1/rm32/ecx    .           .             .           .           0x1c/disp8      .                 # push *(ecx+28)
 1304     ff          6/subop/push        1/mod/*+disp8   1/rm32/ecx    .           .             .           .           0x18/disp8      .                 # push *(ecx+24)
 1305     # . . call
-1306     e8/call  lookup/disp32
+1306     e8/call  lookup/disp32
 1307     # . . discard args
 1308     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1309     # check-strings-equal(curr-addr, "data", msg)
 1310     # . . push args
-1311     68/push  "F - test-get-or-insert-slice/8"/imm32
+1311     68/push  "F - test-get-or-insert-slice/8"/imm32
 1312     68/push  "data"/imm32
 1313     50/push-eax
 1314     # . . call
-1315     e8/call  check-strings-equal/disp32
+1315     e8/call  check-strings-equal/disp32
 1316     # . . discard args
 1317     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1318 $test-get-or-insert-slice:end:
@@ -1385,7 +1385,7 @@ if ('onhashchange' in window) {
 1324 # if no row is found, stop(ed)
 1325 get-or-stop:  # table: (addr stream {(handle array byte), T}), key: (addr array byte), row-size: int,
 1326               # abort-message-prefix: (addr array byte), err: (addr buffered-file), ed: (addr exit-descriptor)
-1327               # -> eax: (addr T)
+1327               # -> result/eax: (addr T)
 1328     # pseudocode:
 1329     #   curr = table->data
 1330     #   max = &table->data[table->write]
@@ -1414,13 +1414,13 @@ if ('onhashchange' in window) {
 1353 $get-or-stop:search-loop:
 1354     # if (curr >= max) stop(ed)
 1355     39/compare                      3/mod/direct    1/rm32/ecx    .           .             .           2/r32/edx   .               .                 # compare ecx with edx
-1356     73/jump-if-addr>=  $get-or-stop:stop/disp8
+1356     73/jump-if-addr>=  $get-or-stop:stop/disp8
 1357     # var c/eax: (addr array byte) = lookup(*curr)
 1358     # . . push args
 1359     ff          6/subop/push        1/mod/*+disp8   1/rm32/ecx    .           .             .           .           4/disp8         .                 # push *(ecx+4)
 1360     ff          6/subop/push        0/mod/indirect  1/rm32/ecx    .           .             .           .           .               .                 # push *ecx
 1361     # . . call
-1362     e8/call  lookup/disp32
+1362     e8/call  lookup/disp32
 1363     # . . discard args
 1364     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1365     # if (string-equal?(key, c)) return curr+8
@@ -1429,7 +1429,7 @@ if ('onhashchange' in window) {
 1368     50/push-eax
 1369     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
 1370     # . . call
-1371     e8/call  string-equal?/disp32
+1371     e8/call  string-equal?/disp32
 1372     # . . discard args
 1373     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1374     # . if (eax != false) return eax = curr+8
@@ -1452,21 +1452,21 @@ if ('onhashchange' in window) {
 1391     5d/pop-to-ebp
 1392     c3/return
 1393 
-1394 $get-or-stop:stop:
+1394 $get-or-stop:stop:
 1395     # . write-buffered(err, abort-message-prefix)
 1396     # . . push args
 1397     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0x14/disp8      .                 # push *(ebp+20)
 1398     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0x18/disp8      .                 # push *(ebp+24)
 1399     # . . call
-1400     e8/call  write-buffered/disp32
+1400     e8/call  write-buffered/disp32
 1401     # . . discard args
 1402     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1403     # . write-buffered(err, error)
 1404     # . . push args
-1405     68/push  ": get-or-stop: key not found: "/imm32
+1405     68/push  ": get-or-stop: key not found: "/imm32
 1406     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0x18/disp8      .                 # push *(ebp+24)
 1407     # . . call
-1408     e8/call  write-buffered/disp32
+1408     e8/call  write-buffered/disp32
 1409     # . . discard args
 1410     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1411     # . write-buffered(err, key)
@@ -1474,15 +1474,15 @@ if ('onhashchange' in window) {
 1413     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
 1414     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0x18/disp8      .                 # push *(ebp+24)
 1415     # . . call
-1416     e8/call  write-buffered/disp32
+1416     e8/call  write-buffered/disp32
 1417     # . . discard args
 1418     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1419     # . write-buffered(err, "\n")
 1420     # . . push args
-1421     68/push  Newline/imm32
+1421     68/push  Newline/imm32
 1422     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0x18/disp8      .                 # push *(ebp+24)
 1423     # . . call
-1424     e8/call  write-buffered/disp32
+1424     e8/call  write-buffered/disp32
 1425     # . . discard args
 1426     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1427     # . stop(ed, 1)
@@ -1490,7 +1490,7 @@ if ('onhashchange' in window) {
 1429     68/push  1/imm32
 1430     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0x1c/disp8      .                 # push *(ebp+28)
 1431     # . . call
-1432     e8/call  stop/disp32
+1432     e8/call  stop/disp32
 1433     # never gets here
 1434 $get-or-stop:terminus:
 1435     # . . discard args
@@ -1507,16 +1507,16 @@ if ('onhashchange' in window) {
 1446     # setup
 1447     # . clear-stream(_test-error-stream)
 1448     # . . push args
-1449     68/push  _test-error-stream/imm32
+1449     68/push  _test-error-stream/imm32
 1450     # . . call
-1451     e8/call  clear-stream/disp32
+1451     e8/call  clear-stream/disp32
 1452     # . . discard args
 1453     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 1454     # . clear-stream($_test-error-buffered-file->buffer)
 1455     # . . push args
 1456     68/push  $_test-error-buffered-file->buffer/imm32
 1457     # . . call
-1458     e8/call  clear-stream/disp32
+1458     e8/call  clear-stream/disp32
 1459     # . . discard args
 1460     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 1461     # var table/ecx: (stream {string, number} 24)  # 2 rows * 12 bytes/row
@@ -1535,55 +1535,55 @@ if ('onhashchange' in window) {
 1474     68/push  0x18/imm32/nbytes-of-args-for-get-or-stop
 1475     52/push-edx
 1476     # . . call
-1477     e8/call  tailor-exit-descriptor/disp32
+1477     e8/call  tailor-exit-descriptor/disp32
 1478     # . . discard args
 1479     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1480     # insert(table, "code", 12 bytes/row, Heap)
 1481     # . . push args
-1482     68/push  Heap/imm32
+1482     68/push  Heap/imm32
 1483     68/push  0xc/imm32/row-size
 1484     68/push  "code"/imm32
 1485     51/push-ecx
 1486     # . . call
-1487     e8/call  get-or-insert/disp32
+1487     e8/call  get-or-insert/disp32
 1488     # . . discard args
 1489     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
 1490 $test-get-or-stop:success:
 1491     # eax = get-or-stop(table, "code", row-size=12, msg, _test-error-buffered-file, ed)
 1492     # . . push args
 1493     52/push-edx/ed
-1494     68/push  _test-error-buffered-file/imm32
+1494     68/push  _test-error-buffered-file/imm32
 1495     68/push  "foo"/imm32/abort-prefix
 1496     68/push  0xc/imm32/row-size
 1497     68/push  "code"/imm32
 1498     51/push-ecx
 1499     # . . call
-1500     e8/call  get-or-stop/disp32
+1500     e8/call  get-or-stop/disp32
 1501     # . . discard args
 1502     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x18/imm32        # add to esp
 1503 $test-get-or-stop:success-assertion:
 1504     # check-ints-equal(eax - table->data, 8, msg)
 1505     # . check-ints-equal(eax - table, 20, msg)
 1506     # . . push args
-1507     68/push  "F - test-get-or-stop/0"/imm32
+1507     68/push  "F - test-get-or-stop/0"/imm32
 1508     68/push  0x14/imm32
 1509     29/subtract                     3/mod/direct    0/rm32/eax    .           .             .           1/r32/ecx   .               .                 # subtract ecx from eax
 1510     50/push-eax
 1511     # . . call
-1512     e8/call  check-ints-equal/disp32
+1512     e8/call  check-ints-equal/disp32
 1513     # . . discard args
 1514     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1515 $test-get-or-stop:failure:
 1516     # eax = get-or-stop(table, "data", row-size=12, msg, _test-error-buffered-file, ed)
 1517     # . . push args
 1518     52/push-edx/ed
-1519     68/push  _test-error-buffered-file/imm32
+1519     68/push  _test-error-buffered-file/imm32
 1520     68/push  "foo"/imm32/abort-prefix
 1521     68/push  0xc/imm32/row-size
 1522     68/push  "data"/imm32
 1523     51/push-ecx
 1524     # . . call
-1525     e8/call  get-or-stop/disp32
+1525     e8/call  get-or-stop/disp32
 1526     # registers except esp may be clobbered at this point
 1527     # restore register args, discard others
 1528     59/pop-to-ecx
@@ -1593,12 +1593,12 @@ if ('onhashchange' in window) {
 1532     # check that get-or-stop tried to call stop(1)
 1533     # . check-ints-equal(ed->value, 2, msg)
 1534     # . . push args
-1535     68/push  "F - test-get-or-stop/1"/imm32
+1535     68/push  "F - test-get-or-stop/1"/imm32
 1536     68/push  2/imm32
 1537     # . . push ed->value
 1538     ff          6/subop/push        1/mod/*+disp8   2/rm32/edx    .           .             .           .           4/disp8         .                 # push *(edx+4)
 1539     # . . call
-1540     e8/call  check-ints-equal/disp32
+1540     e8/call  check-ints-equal/disp32
 1541     # . . discard args
 1542     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1543 $test-get-or-stop:end:
@@ -1611,7 +1611,7 @@ if ('onhashchange' in window) {
 1550 # if no row is found, stop(ed)
 1551 get-slice-or-stop:  # table: (addr stream {(handle array byte), _}), key: (addr slice), row-size: int,
 1552                     # abort-message-prefix: (addr string), err: (addr buffered-file), ed: (addr exit-descriptor)
-1553                     # -> eax: (addr _)
+1553                     # -> result/eax: (addr _)
 1554     # pseudocode:
 1555     #   curr = table->data
 1556     #   max = &table->data[table->write]
@@ -1640,13 +1640,13 @@ if ('onhashchange' in window) {
 1579 $get-slice-or-stop:search-loop:
 1580     # if (curr >= max) stop(ed)
 1581     39/compare                      3/mod/direct    1/rm32/ecx    .           .             .           2/r32/edx   .               .                 # compare ecx with edx
-1582     73/jump-if-addr>=  $get-slice-or-stop:stop/disp8
+1582     73/jump-if-addr>=  $get-slice-or-stop:stop/disp8
 1583     # var c/eax: (addr array byte) = lookup(*curr)
 1584     # . . push args
 1585     ff          6/subop/push        1/mod/*+disp8   1/rm32/ecx    .           .             .           .           4/disp8         .                 # push *(ecx+4)
 1586     ff          6/subop/push        0/mod/indirect  1/rm32/ecx    .           .             .           .           .               .                 # push *ecx
 1587     # . . call
-1588     e8/call  lookup/disp32
+1588     e8/call  lookup/disp32
 1589     # . . discard args
 1590     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1591     # if (slice-equal?(key, c)) return curr+4
@@ -1655,7 +1655,7 @@ if ('onhashchange' in window) {
 1594     50/push-eax
 1595     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
 1596     # . . call
-1597     e8/call  slice-equal?/disp32
+1597     e8/call  slice-equal?/disp32
 1598     # . . discard args
 1599     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1600     # . if (eax != false) return eax = curr+8
@@ -1678,21 +1678,21 @@ if ('onhashchange' in window) {
 1617     5d/pop-to-ebp
 1618     c3/return
 1619 
-1620 $get-slice-or-stop:stop:
+1620 $get-slice-or-stop:stop:
 1621     # . write-buffered(err, abort-message-prefix)
 1622     # . . push args
 1623     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0x14/disp8      .                 # push *(ebp+20)
 1624     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0x18/disp8      .                 # push *(ebp+24)
 1625     # . . call
-1626     e8/call  write-buffered/disp32
+1626     e8/call  write-buffered/disp32
 1627     # . . discard args
 1628     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1629     # . write-buffered(err, error)
 1630     # . . push args
-1631     68/push  ": get-slice-or-stop: key not found: "/imm32
+1631     68/push  ": get-slice-or-stop: key not found: "/imm32
 1632     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0x18/disp8      .                 # push *(ebp+24)
 1633     # . . call
-1634     e8/call  write-buffered/disp32
+1634     e8/call  write-buffered/disp32
 1635     # . . discard args
 1636     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1637     # . write-slice-buffered(err, key)
@@ -1700,15 +1700,15 @@ if ('onhashchange' in window) {
 1639     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
 1640     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0x18/disp8      .                 # push *(ebp+24)
 1641     # . . call
-1642     e8/call  write-slice-buffered/disp32
+1642     e8/call  write-slice-buffered/disp32
 1643     # . . discard args
 1644     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1645     # . write-buffered(err, "\n")
 1646     # . . push args
-1647     68/push  Newline/imm32
+1647     68/push  Newline/imm32
 1648     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0x18/disp8      .                 # push *(ebp+24)
 1649     # . . call
-1650     e8/call  write-buffered/disp32
+1650     e8/call  write-buffered/disp32
 1651     # . . discard args
 1652     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1653     # . stop(ed, 1)
@@ -1716,7 +1716,7 @@ if ('onhashchange' in window) {
 1655     68/push  1/imm32
 1656     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0x1c/disp8      .                 # push *(ebp+28)
 1657     # . . call
-1658     e8/call  stop/disp32
+1658     e8/call  stop/disp32
 1659     # never gets here
 1660 $get-slice-or-stop:terminus:
 1661     # . . discard args
@@ -1733,16 +1733,16 @@ if ('onhashchange' in window) {
 1672     # setup
 1673     # . clear-stream(_test-error-stream)
 1674     # . . push args
-1675     68/push  _test-error-stream/imm32
+1675     68/push  _test-error-stream/imm32
 1676     # . . call
-1677     e8/call  clear-stream/disp32
+1677     e8/call  clear-stream/disp32
 1678     # . . discard args
 1679     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 1680     # . clear-stream($_test-error-buffered-file->buffer)
 1681     # . . push args
 1682     68/push  $_test-error-buffered-file->buffer/imm32
 1683     # . . call
-1684     e8/call  clear-stream/disp32
+1684     e8/call  clear-stream/disp32
 1685     # . . discard args
 1686     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 1687     # var table/ecx: (stream {string, number} 24)  # 2 rows * 12 bytes/row
@@ -1771,30 +1771,30 @@ if ('onhashchange' in window) {
 1710     68/push  0x18/imm32/nbytes-of-args-for-get-or-stop
 1711     52/push-edx
 1712     # . . call
-1713     e8/call  tailor-exit-descriptor/disp32
+1713     e8/call  tailor-exit-descriptor/disp32
 1714     # . . discard args
 1715     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1716     # insert(table, "code", 12 bytes/row, Heap)
 1717     # . . push args
-1718     68/push  Heap/imm32
+1718     68/push  Heap/imm32
 1719     68/push  0xc/imm32/row-size
 1720     68/push  "code"/imm32
 1721     51/push-ecx
 1722     # . . call
-1723     e8/call  get-or-insert/disp32
+1723     e8/call  get-or-insert/disp32
 1724     # . . discard args
 1725     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
 1726 $test-get-slice-or-stop:success:
 1727     # eax = get-slice-or-stop(table, slice, row-size=12, msg, _test-error-buffered-file, ed)
 1728     # . . push args
 1729     52/push-edx/ed
-1730     68/push  _test-error-buffered-file/imm32
+1730     68/push  _test-error-buffered-file/imm32
 1731     68/push  "foo"/imm32/abort-prefix
 1732     68/push  0xc/imm32/row-size
 1733     53/push-ebx/slice
 1734     51/push-ecx
 1735     # . . call
-1736     e8/call  get-slice-or-stop/disp32
+1736     e8/call  get-slice-or-stop/disp32
 1737     # registers except esp may be clobbered at this point
 1738     # restore register args, discard others
 1739     59/pop-to-ecx
@@ -1805,12 +1805,12 @@ if ('onhashchange' in window) {
 1744     # check-ints-equal(eax - table->data, 8, msg)  # first row's value slot returned
 1745     # . check-ints-equal(eax - table, 20, msg)
 1746     # . . push args
-1747     68/push  "F - test-get-slice-or-stop/0"/imm32
+1747     68/push  "F - test-get-slice-or-stop/0"/imm32
 1748     68/push  0x14/imm32
 1749     29/subtract                     3/mod/direct    0/rm32/eax    .           .             .           1/r32/ecx   .               .                 # subtract ecx from eax
 1750     50/push-eax
 1751     # . . call
-1752     e8/call  check-ints-equal/disp32
+1752     e8/call  check-ints-equal/disp32
 1753     # . . discard args
 1754     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1755 $test-get-slice-or-stop:failure:
@@ -1825,13 +1825,13 @@ if ('onhashchange' in window) {
 1764     # eax = get-slice-or-stop(table, slice, row-size=12, msg, _test-error-buffered-file, ed)
 1765     # . . push args
 1766     52/push-edx/ed
-1767     68/push  _test-error-buffered-file/imm32
+1767     68/push  _test-error-buffered-file/imm32
 1768     68/push  "foo"/imm32/abort-prefix
 1769     68/push  0xc/imm32/row-size
 1770     53/push-ebx/slice
 1771     51/push-ecx
 1772     # . . call
-1773     e8/call  get-slice-or-stop/disp32
+1773     e8/call  get-slice-or-stop/disp32
 1774     # registers except esp may be clobbered at this point
 1775     # restore register args, discard others
 1776     59/pop-to-ecx
@@ -1842,12 +1842,12 @@ if ('onhashchange' in window) {
 1781     # check that get-or-stop tried to call stop(1)
 1782     # . check-ints-equal(ed->value, 2, msg)
 1783     # . . push args
-1784     68/push  "F - test-get-or-stop/1"/imm32
+1784     68/push  "F - test-get-or-stop/1"/imm32
 1785     68/push  2/imm32
 1786     # . . push ed->value
 1787     ff          6/subop/push        1/mod/*+disp8   2/rm32/edx    .           .             .           .           4/disp8         .                 # push *(edx+4)
 1788     # . . call
-1789     e8/call  check-ints-equal/disp32
+1789     e8/call  check-ints-equal/disp32
 1790     # . . discard args
 1791     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1792 $test-get-slice-or-stop:end:
@@ -1858,7 +1858,7 @@ if ('onhashchange' in window) {
 1797     c3/return
 1798 
 1799 # if no row is found, return null (0)
-1800 maybe-get:  # table: (addr stream {(handle array byte), T}), key: (addr array byte), row-size: int -> eax: (addr T)
+1800 maybe-get:  # table: (addr stream {(handle array byte), T}), key: (addr array byte), row-size: int -> result/eax: (addr T)
 1801     # pseudocode:
 1802     #   curr = table->data
 1803     #   max = &table->data[table->write]
@@ -1892,7 +1892,7 @@ if ('onhashchange' in window) {
 1831     ff          6/subop/push        1/mod/*+disp8   1/rm32/ecx    .           .             .           .           4/disp8         .                 # push *(ecx+4)
 1832     ff          6/subop/push        0/mod/indirect  1/rm32/ecx    .           .             .           .           .               .                 # push *ecx
 1833     # . . call
-1834     e8/call  lookup/disp32
+1834     e8/call  lookup/disp32
 1835     # . . discard args
 1836     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1837     # if (string-equal?(key, c)) return curr+4
@@ -1901,7 +1901,7 @@ if ('onhashchange' in window) {
 1840     50/push-eax
 1841     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
 1842     # . . call
-1843     e8/call  string-equal?/disp32
+1843     e8/call  string-equal?/disp32
 1844     # . . discard args
 1845     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1846     # . if (eax != false) return eax = curr+8
@@ -1939,12 +1939,12 @@ if ('onhashchange' in window) {
 1878     89/copy                         3/mod/direct    1/rm32/ecx    .           .             .           4/r32/esp   .               .                 # copy esp to ecx
 1879     # eax = get-or-insert(table, "code", 12 bytes/row, Heap)
 1880     # . . push args
-1881     68/push  Heap/imm32
+1881     68/push  Heap/imm32
 1882     68/push  0xc/imm32/row-size
 1883     68/push  "code"/imm32
 1884     51/push-ecx
 1885     # . . call
-1886     e8/call  get-or-insert/disp32
+1886     e8/call  get-or-insert/disp32
 1887     # . . discard args
 1888     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
 1889 $test-maybe-get:success:
@@ -1955,28 +1955,28 @@ if ('onhashchange' in window) {
 1894     68/push  "code"/imm32
 1895     51/push-ecx
 1896     # . . call
-1897     e8/call  maybe-get/disp32
+1897     e8/call  maybe-get/disp32
 1898     # . . discard args
 1899     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1900     # check-ints-equal(eax - table->data, 8, msg)
 1901     # . check-ints-equal(eax - table, 20, msg)
 1902     # . . push args
-1903     68/push  "F - test-maybe-get/0"/imm32
+1903     68/push  "F - test-maybe-get/0"/imm32
 1904     68/push  0x14/imm32
 1905     29/subtract                     3/mod/direct    0/rm32/eax    .           .             .           1/r32/ecx   .               .                 # subtract ecx from eax
 1906     50/push-eax
 1907     # . . call
-1908     e8/call  check-ints-equal/disp32
+1908     e8/call  check-ints-equal/disp32
 1909     # . . discard args
 1910     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1911     # no new row inserted
 1912     # . check-ints-equal(table->write, row-size = 12, msg)
 1913     # . . push args
-1914     68/push  "F - test-maybe-get/1"/imm32
+1914     68/push  "F - test-maybe-get/1"/imm32
 1915     68/push  0xc/imm32/row-size
 1916     ff          6/subop/push        0/mod/indirect  1/rm32/ecx    .           .             .           .           .               .                 # push *ecx
 1917     # . . call
-1918     e8/call  check-ints-equal/disp32
+1918     e8/call  check-ints-equal/disp32
 1919     # . . discard args
 1920     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1921     # var curr-addr/eax: (addr array byte) = lookup(table->data)
@@ -1984,16 +1984,16 @@ if ('onhashchange' in window) {
 1923     ff          6/subop/push        1/mod/*+disp8   1/rm32/ecx    .           .             .           .           0x10/disp8      .                 # push *(ecx+16)
 1924     ff          6/subop/push        1/mod/*+disp8   1/rm32/ecx    .           .             .           .           0xc/disp8       .                 # push *(ecx+12)
 1925     # . . call
-1926     e8/call  lookup/disp32
+1926     e8/call  lookup/disp32
 1927     # . . discard args
 1928     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1929     # check-strings-equal(curr-addr, "code", msg)
 1930     # . . push args
-1931     68/push  "F - test-maybe-get/2"/imm32
+1931     68/push  "F - test-maybe-get/2"/imm32
 1932     68/push  "code"/imm32
 1933     50/push-eax
 1934     # . . call
-1935     e8/call  check-strings-equal/disp32
+1935     e8/call  check-strings-equal/disp32
 1936     # . . discard args
 1937     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1938 $test-maybe-get:failure:
@@ -2004,16 +2004,16 @@ if ('onhashchange' in window) {
 1943     68/push  "data"/imm32
 1944     51/push-ecx
 1945     # . . call
-1946     e8/call  maybe-get/disp32
+1946     e8/call  maybe-get/disp32
 1947     # . . discard args
 1948     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1949     # check-ints-equal(eax, 0, msg)
 1950     # . . push args
-1951     68/push  "F - test-maybe-get/3"/imm32
+1951     68/push  "F - test-maybe-get/3"/imm32
 1952     68/push  0/imm32
 1953     50/push-eax
 1954     # . . call
-1955     e8/call  check-ints-equal/disp32
+1955     e8/call  check-ints-equal/disp32
 1956     # . . discard args
 1957     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 1958 $test-maybe-get:end:
@@ -2023,7 +2023,7 @@ if ('onhashchange' in window) {
 1962     c3/return
 1963 
 1964 # if no row is found, return null (0)
-1965 maybe-get-slice:  # table: (addr stream {(handle array byte), T}), key: (addr slice), row-size: int -> eax: (addr T)
+1965 maybe-get-slice:  # table: (addr stream {(handle array byte), T}), key: (addr slice), row-size: int -> result/eax: (addr T)
 1966     # pseudocode:
 1967     #   curr = table->data
 1968     #   max = &table->data[table->write]
@@ -2057,7 +2057,7 @@ if ('onhashchange' in window) {
 1996     ff          6/subop/push        1/mod/*+disp8   1/rm32/ecx    .           .             .           .           4/disp8         .                 # push *(ecx+4)
 1997     ff          6/subop/push        0/mod/indirect  1/rm32/ecx    .           .             .           .           .               .                 # push *ecx
 1998     # . . call
-1999     e8/call  lookup/disp32
+1999     e8/call  lookup/disp32
 2000     # . . discard args
 2001     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 2002     # if (slice-equal?(key, c)) return curr+4
@@ -2066,7 +2066,7 @@ if ('onhashchange' in window) {
 2005     50/push-eax
 2006     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
 2007     # . . call
-2008     e8/call  slice-equal?/disp32
+2008     e8/call  slice-equal?/disp32
 2009     # . . discard args
 2010     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 2011     # . if (eax != false) return eax = curr+8
@@ -2104,12 +2104,12 @@ if ('onhashchange' in window) {
 2043     89/copy                         3/mod/direct    1/rm32/ecx    .           .             .           4/r32/esp   .               .                 # copy esp to ecx
 2044     # insert(table, "code", 12 bytes/row, Heap)
 2045     # . . push args
-2046     68/push  Heap/imm32
+2046     68/push  Heap/imm32
 2047     68/push  0xc/imm32/row-size
 2048     68/push  "code"/imm32
 2049     51/push-ecx
 2050     # . . call
-2051     e8/call  get-or-insert/disp32
+2051     e8/call  get-or-insert/disp32
 2052     # . . discard args
 2053     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
 2054 $test-maybe-get-slice:success:
@@ -2129,28 +2129,28 @@ if ('onhashchange' in window) {
 2068     52/push-edx
 2069     51/push-ecx
 2070     # . . call
-2071     e8/call  maybe-get-slice/disp32
+2071     e8/call  maybe-get-slice/disp32
 2072     # . . discard args
 2073     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 2074     # check-ints-equal(eax - table->data, 8, msg)
 2075     # . check-ints-equal(eax - table, 20, msg)
 2076     # . . push args
-2077     68/push  "F - test-maybe-get-slice/0"/imm32
+2077     68/push  "F - test-maybe-get-slice/0"/imm32
 2078     68/push  0x14/imm32
 2079     29/subtract                     3/mod/direct    0/rm32/eax    .           .             .           1/r32/ecx   .               .                 # subtract ecx from eax
 2080     50/push-eax
 2081     # . . call
-2082     e8/call  check-ints-equal/disp32
+2082     e8/call  check-ints-equal/disp32
 2083     # . . discard args
 2084     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 2085     # no new row inserted
 2086     # . check-ints-equal(table->write, row-size = 12, msg)
 2087     # . . push args
-2088     68/push  "F - test-maybe-get-slice/1"/imm32
+2088     68/push  "F - test-maybe-get-slice/1"/imm32
 2089     68/push  0xc/imm32/row-size
 2090     ff          6/subop/push        0/mod/indirect  1/rm32/ecx    .           .             .           .           .               .                 # push *ecx
 2091     # . . call
-2092     e8/call  check-ints-equal/disp32
+2092     e8/call  check-ints-equal/disp32
 2093     # . . discard args
 2094     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 2095     # var curr-addr/eax: (addr array byte) = lookup(table->data)
@@ -2158,16 +2158,16 @@ if ('onhashchange' in window) {
 2097     ff          6/subop/push        1/mod/*+disp8   1/rm32/ecx    .           .             .           .           0x10/disp8      .                 # push *(ecx+16)
 2098     ff          6/subop/push        1/mod/*+disp8   1/rm32/ecx    .           .             .           .           0xc/disp8       .                 # push *(ecx+12)
 2099     # . . call
-2100     e8/call  lookup/disp32
+2100     e8/call  lookup/disp32
 2101     # . . discard args
 2102     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 2103     # check-strings-equal(curr-addr, "code", msg)
 2104     # . . push args
-2105     68/push  "F - test-maybe-get-slice/2"/imm32
+2105     68/push  "F - test-maybe-get-slice/2"/imm32
 2106     68/push  "code"/imm32
 2107     50/push-eax
 2108     # . . call
-2109     e8/call  check-strings-equal/disp32
+2109     e8/call  check-strings-equal/disp32
 2110     # . . discard args
 2111     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 2112 $test-maybe-get-slice:failure:
@@ -2187,16 +2187,16 @@ if ('onhashchange' in window) {
 2126     52/push-edx
 2127     51/push-ecx
 2128     # . . call
-2129     e8/call  maybe-get-slice/disp32
+2129     e8/call  maybe-get-slice/disp32
 2130     # . . discard args
 2131     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 2132     # check-ints-equal(eax, 0, msg)
 2133     # . . push args
-2134     68/push  "F - test-maybe-get-slice/3"/imm32
+2134     68/push  "F - test-maybe-get-slice/3"/imm32
 2135     68/push  0/imm32
 2136     50/push-eax
 2137     # . . call
-2138     e8/call  check-ints-equal/disp32
+2138     e8/call  check-ints-equal/disp32
 2139     # . . discard args
 2140     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 2141 $test-maybe-get-slice:end:
diff --git a/html/082slurp.subx.html b/html/132slurp.subx.html
similarity index 95%
rename from html/082slurp.subx.html
rename to html/132slurp.subx.html
index 5442d4ab..705f8a4e 100644
--- a/html/082slurp.subx.html
+++ b/html/132slurp.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 082slurp.subx
+Mu - 132slurp.subx
 
 
 
@@ -55,7 +55,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/082slurp.subx
+https://github.com/akkartik/mu/blob/master/132slurp.subx
 
   1 == code
   2 #   instruction                     effective address                                                   register    displacement    immediate
@@ -103,7 +103,7 @@ if ('onhashchange' in window) {
  44     8d/copy-address                 1/mod/*+disp8   6/rm32/esi    .           .             .           0/r32/eax   4/disp8         .                 # copy esi+4 to eax
  45     50/push-eax
  46     # . . call
- 47     e8/call  clear-stream/disp32
+ 47     e8/call  clear-stream/disp32
  48     # . . discard args
  49     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  50     # . f->read must now be 0; update its cache at ecx
@@ -113,7 +113,7 @@ if ('onhashchange' in window) {
  54     50/push-eax
  55     ff          6/subop/push        0/mod/indirect  6/rm32/esi    .           .             .           .           .               .                 # push *esi
  56     # . . call
- 57     e8/call  read/disp32
+ 57     e8/call  read/disp32
  58     # . . discard args
  59     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  60     # if (f->write == 0) break
@@ -154,7 +154,7 @@ if ('onhashchange' in window) {
  95     68/push  "slurp: destination too small\n"/imm32
  96     68/push  2/imm32/stderr
  97     # . . call
- 98     e8/call  _write/disp32
+ 98     e8/call  _write/disp32
  99     # . . discard args
 100     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 101     # . syscall(exit, 1)
@@ -166,49 +166,49 @@ if ('onhashchange' in window) {
 107     # setup
 108     # . clear-stream(_test-stream)
 109     # . . push args
-110     68/push  _test-stream/imm32
+110     68/push  _test-stream/imm32
 111     # . . call
-112     e8/call  clear-stream/disp32
+112     e8/call  clear-stream/disp32
 113     # . . discard args
 114     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 115     # . clear-stream($_test-buffered-file->buffer)
 116     # . . push args
 117     68/push  $_test-buffered-file->buffer/imm32
 118     # . . call
-119     e8/call  clear-stream/disp32
+119     e8/call  clear-stream/disp32
 120     # . . discard args
 121     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 122     # . clear-stream(_test-tmp-stream)
 123     # . . push args
-124     68/push  _test-tmp-stream/imm32
+124     68/push  _test-tmp-stream/imm32
 125     # . . call
-126     e8/call  clear-stream/disp32
+126     e8/call  clear-stream/disp32
 127     # . . discard args
 128     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 129     # write(_test-stream, "ab\ncd")
 130     # . . push args
 131     68/push  "ab\ncd"/imm32
-132     68/push  _test-stream/imm32
+132     68/push  _test-stream/imm32
 133     # . . call
-134     e8/call  write/disp32
+134     e8/call  write/disp32
 135     # . . discard args
 136     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 137     # read a line from _test-stream (buffered by _test-buffered-file) into _test-tmp-stream
 138     # . eax = slurp(_test-buffered-file, _test-tmp-stream)
 139     # . . push args
-140     68/push  _test-tmp-stream/imm32
-141     68/push  _test-buffered-file/imm32
+140     68/push  _test-tmp-stream/imm32
+141     68/push  _test-buffered-file/imm32
 142     # . . call
-143     e8/call  slurp/disp32
+143     e8/call  slurp/disp32
 144     # . . discard args
 145     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 146     # check-stream-equal(_test-tmp-stream, "ab\ncd", msg)
 147     # . . push args
 148     68/push  "F - test-slurp"/imm32
 149     68/push  "ab\ncd"/imm32
-150     68/push  _test-tmp-stream/imm32
+150     68/push  _test-tmp-stream/imm32
 151     # . . call
-152     e8/call  check-stream-equal/disp32
+152     e8/call  check-stream-equal/disp32
 153     # . . discard args
 154     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 155     # end
diff --git a/html/083subx-widths.subx.html b/html/133subx-widths.subx.html
similarity index 94%
rename from html/083subx-widths.subx.html
rename to html/133subx-widths.subx.html
index eaa3fb2a..5e1ce8b4 100644
--- a/html/083subx-widths.subx.html
+++ b/html/133subx-widths.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 083subx-widths.subx
+Mu - 133subx-widths.subx
 
 
 
@@ -55,7 +55,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/083subx-widths.subx
+https://github.com/akkartik/mu/blob/master/133subx-widths.subx
 
   1 # Helpers to compute widths of SubX arguments based on their metadata.
   2 #   /imm8 => 1 byte,
@@ -67,7 +67,7 @@ if ('onhashchange' in window) {
   8 # . op          subop               mod             rm32          base        index         scale       r32
   9 # . 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
  10 
- 11 compute-width: # word: (addr array byte) -> eax: int
+ 11 compute-width: # word: (addr array byte) -> result/eax: int
  12     # . prologue
  13     55/push-ebp
  14     89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
@@ -88,7 +88,7 @@ if ('onhashchange' in window) {
  29     # . . push args
  30     51/push-ecx
  31     # . . call
- 32     e8/call  compute-width-of-slice/disp32
+ 32     e8/call  compute-width-of-slice/disp32
  33     # . . discard args
  34     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  35 $compute-width:end:
@@ -101,7 +101,7 @@ if ('onhashchange' in window) {
  42     5d/pop-to-ebp
  43     c3/return
  44 
- 45 compute-width-of-slice: # s: (addr slice) -> eax: int
+ 45 compute-width-of-slice: # s: (addr slice) -> result/eax: int
  46     # . prologue
  47     55/push-ebp
  48     89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
@@ -115,7 +115,7 @@ if ('onhashchange' in window) {
  56     68/push  "imm32"/imm32
  57     51/push-ecx
  58     # . . call
- 59     e8/call  has-metadata?/disp32
+ 59     e8/call  has-metadata?/disp32
  60     # . . discard args
  61     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  62     # . if (eax != false) return 4
@@ -128,7 +128,7 @@ if ('onhashchange' in window) {
  69     68/push  "disp32"/imm32
  70     51/push-ecx
  71     # . . call
- 72     e8/call  has-metadata?/disp32
+ 72     e8/call  has-metadata?/disp32
  73     # . . discard args
  74     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  75     # . if (eax != false) return 4
@@ -141,7 +141,7 @@ if ('onhashchange' in window) {
  82     68/push  "imm16"/imm32
  83     51/push-ecx
  84     # . . call
- 85     e8/call  has-metadata?/disp32
+ 85     e8/call  has-metadata?/disp32
  86     # . . discard args
  87     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  88     # . if (eax != false) return 2
@@ -154,7 +154,7 @@ if ('onhashchange' in window) {
  95     68/push  "disp16"/imm32
  96     51/push-ecx
  97     # . . call
- 98     e8/call  has-metadata?/disp32
+ 98     e8/call  has-metadata?/disp32
  99     # . . discard args
 100     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 101     # . if (eax != false) return 2
@@ -180,16 +180,16 @@ if ('onhashchange' in window) {
 121     # . . push args
 122     68/push  "0x2/imm8"/imm32
 123     # . . call
-124     e8/call  compute-width/disp32
+124     e8/call  compute-width/disp32
 125     # . . discard args
 126     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 127     # check-ints-equal(eax, 1, msg)
 128     # . . push args
-129     68/push  "F - test-compute-width: 0x2/imm8"/imm32
+129     68/push  "F - test-compute-width: 0x2/imm8"/imm32
 130     50/push-eax
 131     68/push  1/imm32
 132     # . . call
-133     e8/call  check-ints-equal/disp32
+133     e8/call  check-ints-equal/disp32
 134     # . . discard args
 135     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 136 $test-compute-width:imm16:
@@ -197,16 +197,16 @@ if ('onhashchange' in window) {
 138     # . . push args
 139     68/push  "4/imm16"/imm32
 140     # . . call
-141     e8/call  compute-width/disp32
+141     e8/call  compute-width/disp32
 142     # . . discard args
 143     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 144     # check-ints-equal(eax, 2, msg)
 145     # . . push args
-146     68/push  "F - test-compute-width: 4/imm16"/imm32
+146     68/push  "F - test-compute-width: 4/imm16"/imm32
 147     50/push-eax
 148     68/push  2/imm32
 149     # . . call
-150     e8/call  check-ints-equal/disp32
+150     e8/call  check-ints-equal/disp32
 151     # . . discard args
 152     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 153 $test-compute-width:imm32:
@@ -214,16 +214,16 @@ if ('onhashchange' in window) {
 155     # . . push args
 156     68/push  "4/imm32"/imm32
 157     # . . call
-158     e8/call  compute-width/disp32
+158     e8/call  compute-width/disp32
 159     # . . discard args
 160     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 161     # check-ints-equal(eax, 4, msg)
 162     # . . push args
-163     68/push  "F - test-compute-width: 4/imm32"/imm32
+163     68/push  "F - test-compute-width: 4/imm32"/imm32
 164     50/push-eax
 165     68/push  4/imm32
 166     # . . call
-167     e8/call  check-ints-equal/disp32
+167     e8/call  check-ints-equal/disp32
 168     # . . discard args
 169     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 170 $test-compute-width:disp8:
@@ -231,16 +231,16 @@ if ('onhashchange' in window) {
 172     # . . push args
 173     68/push  "foo/disp8"/imm32
 174     # . . call
-175     e8/call  compute-width/disp32
+175     e8/call  compute-width/disp32
 176     # . . discard args
 177     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 178     # check-ints-equal(eax, 1, msg)
 179     # . . push args
-180     68/push  "F - test-compute-width: foo/disp8"/imm32
+180     68/push  "F - test-compute-width: foo/disp8"/imm32
 181     50/push-eax
 182     68/push  1/imm32
 183     # . . call
-184     e8/call  check-ints-equal/disp32
+184     e8/call  check-ints-equal/disp32
 185     # . . discard args
 186     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 187 $test-compute-width:disp16:
@@ -248,16 +248,16 @@ if ('onhashchange' in window) {
 189     # . . push args
 190     68/push  "foo/disp16"/imm32
 191     # . . call
-192     e8/call  compute-width/disp32
+192     e8/call  compute-width/disp32
 193     # . . discard args
 194     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 195     # check-ints-equal(eax, 2, msg)
 196     # . . push args
-197     68/push  "F - test-compute-width: foo/disp16"/imm32
+197     68/push  "F - test-compute-width: foo/disp16"/imm32
 198     50/push-eax
 199     68/push  2/imm32
 200     # . . call
-201     e8/call  check-ints-equal/disp32
+201     e8/call  check-ints-equal/disp32
 202     # . . discard args
 203     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 204 $test-compute-width:disp32:
@@ -265,16 +265,16 @@ if ('onhashchange' in window) {
 206     # . . push args
 207     68/push  "foo/disp32"/imm32
 208     # . . call
-209     e8/call  compute-width/disp32
+209     e8/call  compute-width/disp32
 210     # . . discard args
 211     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 212     # check-ints-equal(eax, 4, msg)
 213     # . . push args
-214     68/push  "F - test-compute-width: foo/disp32"/imm32
+214     68/push  "F - test-compute-width: foo/disp32"/imm32
 215     50/push-eax
 216     68/push  4/imm32
 217     # . . call
-218     e8/call  check-ints-equal/disp32
+218     e8/call  check-ints-equal/disp32
 219     # . . discard args
 220     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 221 $test-compute-width:no-metadata:
@@ -282,16 +282,16 @@ if ('onhashchange' in window) {
 223     # . . push args
 224     68/push  "45"/imm32
 225     # . . call
-226     e8/call  compute-width/disp32
+226     e8/call  compute-width/disp32
 227     # . . discard args
 228     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 229     # check-ints-equal(eax, 1, msg)
 230     # . . push args
-231     68/push  "F - test-compute-width: 45 (no metadata)"/imm32
+231     68/push  "F - test-compute-width: 45 (no metadata)"/imm32
 232     50/push-eax
 233     68/push  1/imm32
 234     # . . call
-235     e8/call  check-ints-equal/disp32
+235     e8/call  check-ints-equal/disp32
 236     # . . discard args
 237     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 238     # . epilogue
diff --git a/html/084emit-hex-array.subx.html b/html/134emit-hex-array.subx.html
similarity index 93%
rename from html/084emit-hex-array.subx.html
rename to html/134emit-hex-array.subx.html
index a9d7e826..d1c7015d 100644
--- a/html/084emit-hex-array.subx.html
+++ b/html/134emit-hex-array.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 084emit-hex-array.subx
+Mu - 134emit-hex-array.subx
 
 
 
@@ -56,7 +56,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/084emit-hex-array.subx
+https://github.com/akkartik/mu/blob/master/134emit-hex-array.subx
 
   1 == code
   2 #   instruction                     effective address                                                   register    displacement    immediate
@@ -95,7 +95,7 @@ if ('onhashchange' in window) {
  35     50/push-eax
  36     57/push-edi
  37     # . . call
- 38     e8/call  emit-hex/disp32
+ 38     e8/call  emit-hex/disp32
  39     # . . discard args
  40     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  41     # ++curr
@@ -119,16 +119,16 @@ if ('onhashchange' in window) {
  59     # setup
  60     # . clear-stream(_test-output-stream)
  61     # . . push args
- 62     68/push  _test-output-stream/imm32
+ 62     68/push  _test-output-stream/imm32
  63     # . . call
- 64     e8/call  clear-stream/disp32
+ 64     e8/call  clear-stream/disp32
  65     # . . discard args
  66     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  67     # . clear-stream($_test-output-buffered-file->buffer)
  68     # . . push args
  69     68/push  $_test-output-buffered-file->buffer/imm32
  70     # . . call
- 71     e8/call  clear-stream/disp32
+ 71     e8/call  clear-stream/disp32
  72     # . . discard args
  73     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  74     # var arr/ecx (array byte) = [01, 02, 03]
@@ -138,16 +138,16 @@ if ('onhashchange' in window) {
  78     # emit-hex-array(_test-output-buffered-file, arr)
  79     # . . push args
  80     51/push-ecx
- 81     68/push  _test-output-buffered-file/imm32
+ 81     68/push  _test-output-buffered-file/imm32
  82     # . . call
- 83     e8/call  emit-hex-array/disp32
+ 83     e8/call  emit-hex-array/disp32
  84     # . . discard args
  85     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  86     # . flush(_test-output-buffered-file)
  87     # . . push args
- 88     68/push  _test-output-buffered-file/imm32
+ 88     68/push  _test-output-buffered-file/imm32
  89     # . . call
- 90     e8/call  flush/disp32
+ 90     e8/call  flush/disp32
  91     # . . discard args
  92     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  93 +-- 33 lines: #?     # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -155,9 +155,9 @@ if ('onhashchange' in window) {
 127     # . . push args
 128     68/push  "F - test-emit-hex-array"/imm32
 129     68/push  "01 02 03 "/imm32
-130     68/push  _test-output-stream/imm32
+130     68/push  _test-output-stream/imm32
 131     # . . call
-132     e8/call  check-next-stream-line-equal/disp32
+132     e8/call  check-next-stream-line-equal/disp32
 133     # . . discard args
 134     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 135     # . epilogue
diff --git a/html/085next-word-or-string.subx.html b/html/135next-word-or-string.subx.html
similarity index 94%
rename from html/085next-word-or-string.subx.html
rename to html/135next-word-or-string.subx.html
index 7837d7f6..735f8694 100644
--- a/html/085next-word-or-string.subx.html
+++ b/html/135next-word-or-string.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 085next-word-or-string.subx
+Mu - 135next-word-or-string.subx
 
 
 
@@ -55,7 +55,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/085next-word-or-string.subx
+https://github.com/akkartik/mu/blob/master/135next-word-or-string.subx
 
   1 == code
   2 #   instruction                     effective address                                                   register    displacement    immediate
@@ -82,7 +82,7 @@ if ('onhashchange' in window) {
  23     68/push  0x20/imm32/space
  24     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
  25     # . . call
- 26     e8/call  skip-chars-matching/disp32
+ 26     e8/call  skip-chars-matching/disp32
  27     # . . discard args
  28     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  29 $next-word-or-string:check0:
@@ -131,7 +131,7 @@ if ('onhashchange' in window) {
  72     # . . push args
  73     56/push-esi
  74     # . . call
- 75     e8/call  skip-string/disp32
+ 75     e8/call  skip-string/disp32
  76     # . . discard args
  77     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  78     # fall through
@@ -140,7 +140,7 @@ if ('onhashchange' in window) {
  81     # . . push args
  82     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
  83     # . . call
- 84     e8/call  skip-chars-not-matching-whitespace/disp32
+ 84     e8/call  skip-chars-not-matching-whitespace/disp32
  85     # . . discard args
  86     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  87     # out->end = &line->data[line->read]
@@ -165,9 +165,9 @@ if ('onhashchange' in window) {
 106     # setup
 107     # . clear-stream(_test-input-stream)
 108     # . . push args
-109     68/push  _test-input-stream/imm32
+109     68/push  _test-input-stream/imm32
 110     # . . call
-111     e8/call  clear-stream/disp32
+111     e8/call  clear-stream/disp32
 112     # . . discard args
 113     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 114     # var slice/ecx: slice
@@ -177,53 +177,53 @@ if ('onhashchange' in window) {
 118     # write(_test-input-stream, "  ab")
 119     # . . push args
 120     68/push  "  ab"/imm32
-121     68/push  _test-input-stream/imm32
+121     68/push  _test-input-stream/imm32
 122     # . . call
-123     e8/call  write/disp32
+123     e8/call  write/disp32
 124     # . . discard args
 125     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 126     # next-word-or-string(_test-input-stream, slice)
 127     # . . push args
 128     51/push-ecx
-129     68/push  _test-input-stream/imm32
+129     68/push  _test-input-stream/imm32
 130     # . . call
-131     e8/call  next-word-or-string/disp32
+131     e8/call  next-word-or-string/disp32
 132     # . . discard args
 133     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 134     # check-ints-equal(_test-input-stream->read, 4, msg)
 135     # . . push args
-136     68/push  "F - test-next-word-or-string/updates-stream-read-correctly"/imm32
+136     68/push  "F - test-next-word-or-string/updates-stream-read-correctly"/imm32
 137     68/push  4/imm32
-138     b8/copy-to-eax  _test-input-stream/imm32
+138     b8/copy-to-eax  _test-input-stream/imm32
 139     ff          6/subop/push        1/mod/*+disp8   0/rm32/eax    .           .             .           .           4/disp8         .                 # push *(eax+4)
 140     # . . call
-141     e8/call  check-ints-equal/disp32
+141     e8/call  check-ints-equal/disp32
 142     # . . discard args
 143     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 144     # check-ints-equal(slice->start - _test-input-stream->data, 2, msg)
 145     # . check-ints-equal(slice->start - _test-input-stream, 14, msg)
 146     # . . push args
-147     68/push  "F - test-next-word-or-string: start"/imm32
+147     68/push  "F - test-next-word-or-string: start"/imm32
 148     68/push  0xe/imm32
 149     # . . push slice->start - _test-input-stream
 150     8b/copy                         0/mod/indirect  1/rm32/ecx    .           .             .           0/r32/eax   .               .                 # copy *ecx to eax
-151     81          5/subop/subtract    3/mod/direct    0/rm32/eax    .           .             .           .           .               _test-input-stream/imm32 # subtract from eax
+151     81          5/subop/subtract    3/mod/direct    0/rm32/eax    .           .             .           .           .               _test-input-stream/imm32 # subtract from eax
 152     50/push-eax
 153     # . . call
-154     e8/call  check-ints-equal/disp32
+154     e8/call  check-ints-equal/disp32
 155     # . . discard args
 156     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 157     # check-ints-equal(slice->end - _test-input-stream->data, 4, msg)
 158     # . check-ints-equal(slice->end - _test-input-stream, 16, msg)
 159     # . . push args
-160     68/push  "F - test-next-word-or-string: end"/imm32
+160     68/push  "F - test-next-word-or-string: end"/imm32
 161     68/push  0x10/imm32
 162     # . . push slice->end - _test-input-stream
 163     8b/copy                         1/mod/*+disp8   1/rm32/ecx    .           .             .           0/r32/eax   4/disp8         .                 # copy *(ecx+4) to eax
-164     81          5/subop/subtract    3/mod/direct    0/rm32/eax    .           .             .           .           .               _test-input-stream/imm32 # subtract from eax
+164     81          5/subop/subtract    3/mod/direct    0/rm32/eax    .           .             .           .           .               _test-input-stream/imm32 # subtract from eax
 165     50/push-eax
 166     # . . call
-167     e8/call  check-ints-equal/disp32
+167     e8/call  check-ints-equal/disp32
 168     # . . discard args
 169     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 170     # . epilogue
@@ -238,9 +238,9 @@ if ('onhashchange' in window) {
 179     # setup
 180     # . clear-stream(_test-input-stream)
 181     # . . push args
-182     68/push  _test-input-stream/imm32
+182     68/push  _test-input-stream/imm32
 183     # . . call
-184     e8/call  clear-stream/disp32
+184     e8/call  clear-stream/disp32
 185     # . . discard args
 186     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 187     # var slice/ecx: slice
@@ -250,53 +250,53 @@ if ('onhashchange' in window) {
 191     # write(_test-input-stream, "  # a")
 192     # . . push args
 193     68/push  "  # a"/imm32
-194     68/push  _test-input-stream/imm32
+194     68/push  _test-input-stream/imm32
 195     # . . call
-196     e8/call  write/disp32
+196     e8/call  write/disp32
 197     # . . discard args
 198     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 199     # next-word-or-string(_test-input-stream, slice)
 200     # . . push args
 201     51/push-ecx
-202     68/push  _test-input-stream/imm32
+202     68/push  _test-input-stream/imm32
 203     # . . call
-204     e8/call  next-word-or-string/disp32
+204     e8/call  next-word-or-string/disp32
 205     # . . discard args
 206     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 207     # check-ints-equal(_test-input-stream->read, 5, msg)
 208     # . . push args
-209     68/push  "F - test-next-word-or-string-returns-whole-comment/updates-stream-read-correctly"/imm32
+209     68/push  "F - test-next-word-or-string-returns-whole-comment/updates-stream-read-correctly"/imm32
 210     68/push  5/imm32
-211     b8/copy-to-eax  _test-input-stream/imm32
+211     b8/copy-to-eax  _test-input-stream/imm32
 212     ff          6/subop/push        1/mod/*+disp8   0/rm32/eax    .           .             .           .           4/disp8         .                 # push *(eax+4)
 213     # . . call
-214     e8/call  check-ints-equal/disp32
+214     e8/call  check-ints-equal/disp32
 215     # . . discard args
 216     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 217     # check-ints-equal(slice->start - _test-input-stream->data, 2, msg)
 218     # . check-ints-equal(slice->start - _test-input-stream, 14, msg)
 219     # . . push args
-220     68/push  "F - test-next-word-or-string-returns-whole-comment: start"/imm32
+220     68/push  "F - test-next-word-or-string-returns-whole-comment: start"/imm32
 221     68/push  0xe/imm32
 222     # . . push slice->start - _test-input-stream
 223     8b/copy                         0/mod/indirect  1/rm32/ecx    .           .             .           0/r32/eax   .               .                 # copy *ecx to eax
-224     81          5/subop/subtract    3/mod/direct    0/rm32/eax    .           .             .           .           .               _test-input-stream/imm32 # subtract from eax
+224     81          5/subop/subtract    3/mod/direct    0/rm32/eax    .           .             .           .           .               _test-input-stream/imm32 # subtract from eax
 225     50/push-eax
 226     # . . call
-227     e8/call  check-ints-equal/disp32
+227     e8/call  check-ints-equal/disp32
 228     # . . discard args
 229     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 230     # check-ints-equal(slice->end - _test-input-stream->data, 5, msg)
 231     # . check-ints-equal(slice->end - _test-input-stream, 17, msg)
 232     # . . push args
-233     68/push  "F - test-next-word-or-string-returns-whole-comment: end"/imm32
+233     68/push  "F - test-next-word-or-string-returns-whole-comment: end"/imm32
 234     68/push  0x11/imm32
 235     # . . push slice->end - _test-input-stream
 236     8b/copy                         1/mod/*+disp8   1/rm32/ecx    .           .             .           0/r32/eax   4/disp8         .                 # copy *(ecx+4) to eax
-237     81          5/subop/subtract    3/mod/direct    0/rm32/eax    .           .             .           .           .               _test-input-stream/imm32 # subtract from eax
+237     81          5/subop/subtract    3/mod/direct    0/rm32/eax    .           .             .           .           .               _test-input-stream/imm32 # subtract from eax
 238     50/push-eax
 239     # . . call
-240     e8/call  check-ints-equal/disp32
+240     e8/call  check-ints-equal/disp32
 241     # . . discard args
 242     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 243     # . epilogue
@@ -311,9 +311,9 @@ if ('onhashchange' in window) {
 252     # setup
 253     # . clear-stream(_test-input-stream)
 254     # . . push args
-255     68/push  _test-input-stream/imm32
+255     68/push  _test-input-stream/imm32
 256     # . . call
-257     e8/call  clear-stream/disp32
+257     e8/call  clear-stream/disp32
 258     # . . discard args
 259     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 260     # var slice/ecx: slice
@@ -324,9 +324,9 @@ if ('onhashchange' in window) {
 265     # next-word-or-string(_test-input-stream, slice)
 266     # . . push args
 267     51/push-ecx
-268     68/push  _test-input-stream/imm32
+268     68/push  _test-input-stream/imm32
 269     # . . call
-270     e8/call  next-word-or-string/disp32
+270     e8/call  next-word-or-string/disp32
 271     # . . discard args
 272     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 273     # check-ints-equal(slice->end - slice->start, 0, msg)
@@ -338,7 +338,7 @@ if ('onhashchange' in window) {
 279     2b/subtract                     0/mod/indirect  1/rm32/ecx    .           .             .           0/r32/eax   .               .                 # subtract *ecx from eax
 280     50/push-eax
 281     # . . call
-282     e8/call  check-ints-equal/disp32
+282     e8/call  check-ints-equal/disp32
 283     # . . discard args
 284     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 285     # . epilogue
@@ -353,9 +353,9 @@ if ('onhashchange' in window) {
 294     # setup
 295     # . clear-stream(_test-input-stream)
 296     # . . push args
-297     68/push  _test-input-stream/imm32
+297     68/push  _test-input-stream/imm32
 298     # . . call
-299     e8/call  clear-stream/disp32
+299     e8/call  clear-stream/disp32
 300     # . . discard args
 301     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 302     # var slice/ecx: slice
@@ -365,43 +365,43 @@ if ('onhashchange' in window) {
 306     # write(_test-input-stream, " \"a b\"/imm32 ")
 307     # . . push args
 308     68/push  " \"a b\"/imm32 "/imm32
-309     68/push  _test-input-stream/imm32
+309     68/push  _test-input-stream/imm32
 310     # . . call
-311     e8/call  write/disp32
+311     e8/call  write/disp32
 312     # . . discard args
 313     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 314     # next-word-or-string(_test-input-stream, slice)
 315     # . . push args
 316     51/push-ecx
-317     68/push  _test-input-stream/imm32
+317     68/push  _test-input-stream/imm32
 318     # . . call
-319     e8/call  next-word-or-string/disp32
+319     e8/call  next-word-or-string/disp32
 320     # . . discard args
 321     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 322     # check-ints-equal(slice->start - _test-input-stream->data, 1, msg)
 323     # . check-ints-equal(slice->start - _test-input-stream, 13, msg)
 324     # . . push args
-325     68/push  "F - test-next-word-or-string-returns-string-literal: start"/imm32
+325     68/push  "F - test-next-word-or-string-returns-string-literal: start"/imm32
 326     68/push  0xd/imm32
 327     # . . push slice->start - _test-input-stream
 328     8b/copy                         0/mod/indirect  1/rm32/ecx    .           .             .           0/r32/eax   .               .                 # copy *ecx to eax
-329     81          5/subop/subtract    3/mod/direct    0/rm32/eax    .           .             .           .           .               _test-input-stream/imm32 # subtract from eax
+329     81          5/subop/subtract    3/mod/direct    0/rm32/eax    .           .             .           .           .               _test-input-stream/imm32 # subtract from eax
 330     50/push-eax
 331     # . . call
-332     e8/call  check-ints-equal/disp32
+332     e8/call  check-ints-equal/disp32
 333     # . . discard args
 334     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 335     # check-ints-equal(slice->end - _test-input-stream->data, 12, msg)
 336     # . check-ints-equal(slice->end - _test-input-stream, 24, msg)
 337     # . . push args
-338     68/push  "F - test-next-word-or-string-returns-string-literal: end"/imm32
+338     68/push  "F - test-next-word-or-string-returns-string-literal: end"/imm32
 339     68/push  0x18/imm32
 340     # . . push slice->end - _test-input-stream
 341     8b/copy                         1/mod/*+disp8   1/rm32/ecx    .           .             .           0/r32/eax   4/disp8         .                 # copy *(ecx+4) to eax
-342     81          5/subop/subtract    3/mod/direct    0/rm32/eax    .           .             .           .           .               _test-input-stream/imm32 # subtract from eax
+342     81          5/subop/subtract    3/mod/direct    0/rm32/eax    .           .             .           .           .               _test-input-stream/imm32 # subtract from eax
 343     50/push-eax
 344     # . . call
-345     e8/call  check-ints-equal/disp32
+345     e8/call  check-ints-equal/disp32
 346     # . . discard args
 347     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 348     # . epilogue
@@ -416,9 +416,9 @@ if ('onhashchange' in window) {
 357     # setup
 358     # . clear-stream(_test-input-stream)
 359     # . . push args
-360     68/push  _test-input-stream/imm32
+360     68/push  _test-input-stream/imm32
 361     # . . call
-362     e8/call  clear-stream/disp32
+362     e8/call  clear-stream/disp32
 363     # . . discard args
 364     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 365     # var slice/ecx: slice
@@ -428,43 +428,43 @@ if ('onhashchange' in window) {
 369     # write(_test-input-stream, " \"a\\\"b\"/x")
 370     # . . push args
 371     68/push  " \"a\\\"b\"/x"/imm32
-372     68/push  _test-input-stream/imm32
+372     68/push  _test-input-stream/imm32
 373     # . . call
-374     e8/call  write/disp32
+374     e8/call  write/disp32
 375     # . . discard args
 376     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 377     # next-word-or-string(_test-input-stream, slice)
 378     # . . push args
 379     51/push-ecx
-380     68/push  _test-input-stream/imm32
+380     68/push  _test-input-stream/imm32
 381     # . . call
-382     e8/call  next-word-or-string/disp32
+382     e8/call  next-word-or-string/disp32
 383     # . . discard args
 384     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 385     # check-ints-equal(slice->start - _test-input-stream->data, 1, msg)
 386     # . check-ints-equal(slice->start - _test-input-stream, 13, msg)
 387     # . . push args
-388     68/push  "F - test-next-word-or-string-returns-string-with-escapes: start"/imm32
+388     68/push  "F - test-next-word-or-string-returns-string-with-escapes: start"/imm32
 389     68/push  0xd/imm32
 390     # . . push slice->start - _test-input-stream
 391     8b/copy                         0/mod/indirect  1/rm32/ecx    .           .             .           0/r32/eax   .               .                 # copy *ecx to eax
-392     81          5/subop/subtract    3/mod/direct    0/rm32/eax    .           .             .           .           .               _test-input-stream/imm32 # subtract from eax
+392     81          5/subop/subtract    3/mod/direct    0/rm32/eax    .           .             .           .           .               _test-input-stream/imm32 # subtract from eax
 393     50/push-eax
 394     # . . call
-395     e8/call  check-ints-equal/disp32
+395     e8/call  check-ints-equal/disp32
 396     # . . discard args
 397     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 398     # check-ints-equal(slice->end - _test-input-stream->data, 9, msg)
 399     # . check-ints-equal(slice->end - _test-input-stream, 21, msg)
 400     # . . push args
-401     68/push  "F - test-next-word-or-string-returns-string-with-escapes: end"/imm32
+401     68/push  "F - test-next-word-or-string-returns-string-with-escapes: end"/imm32
 402     68/push  0x15/imm32
 403     # . . push slice->end - _test-input-stream
 404     8b/copy                         1/mod/*+disp8   1/rm32/ecx    .           .             .           0/r32/eax   4/disp8         .                 # copy *(ecx+4) to eax
-405     81          5/subop/subtract    3/mod/direct    0/rm32/eax    .           .             .           .           .               _test-input-stream/imm32 # subtract from eax
+405     81          5/subop/subtract    3/mod/direct    0/rm32/eax    .           .             .           .           .               _test-input-stream/imm32 # subtract from eax
 406     50/push-eax
 407     # . . call
-408     e8/call  check-ints-equal/disp32
+408     e8/call  check-ints-equal/disp32
 409     # . . discard args
 410     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 411     # . epilogue
diff --git a/html/090register-names.subx.html b/html/201register-names.subx.html
similarity index 98%
rename from html/090register-names.subx.html
rename to html/201register-names.subx.html
index 510dbe76..02f21c25 100644
--- a/html/090register-names.subx.html
+++ b/html/201register-names.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 090register-names.subx
+Mu - 201register-names.subx
 
 
 
@@ -51,7 +51,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/090register-names.subx
+https://github.com/akkartik/mu/blob/master/201register-names.subx
 
   1 == data
   2 Registers:  # (addr stream {(handle array byte), int})
diff --git a/html/091write-int.subx.html b/html/202write-int.subx.html
similarity index 91%
rename from html/091write-int.subx.html
rename to html/202write-int.subx.html
index 67168f07..89204fbc 100644
--- a/html/091write-int.subx.html
+++ b/html/202write-int.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 091write-int.subx
+Mu - 202write-int.subx
 
 
 
@@ -56,7 +56,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/091write-int.subx
+https://github.com/akkartik/mu/blob/master/202write-int.subx
 
   1 # write-int: add (the binary representation of) a single int to a stream
   2 
@@ -102,7 +102,7 @@ if ('onhashchange' in window) {
  42     68/push  "write-int: out of space\n"/imm32
  43     68/push  2/imm32/stderr
  44     # . . call
- 45     e8/call  _write/disp32
+ 45     e8/call  _write/disp32
  46     # . . discard args
  47     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  48     # . syscall(exit, 1)
@@ -115,26 +115,26 @@ if ('onhashchange' in window) {
  55     # setup
  56     # . clear-stream(_test-stream)
  57     # . . push args
- 58     68/push  _test-stream/imm32
+ 58     68/push  _test-stream/imm32
  59     # . . call
- 60     e8/call  clear-stream/disp32
+ 60     e8/call  clear-stream/disp32
  61     # . . discard args
  62     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  63     # write-int(_test-stream, "abcd")
  64     # . . push args
  65     68/push  0x64636261/imm32
- 66     68/push  _test-stream/imm32
+ 66     68/push  _test-stream/imm32
  67     # . . call
- 68     e8/call  write-int/disp32
+ 68     e8/call  write-int/disp32
  69     # . . discard args
  70     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  71     # check-stream-equal(_test-stream, "abcd", msg)
  72     # . . push args
  73     68/push  "F - test-write-int-single"/imm32
  74     68/push  "abcd"/imm32
- 75     68/push  _test-stream/imm32
+ 75     68/push  _test-stream/imm32
  76     # . . call
- 77     e8/call  check-stream-equal/disp32
+ 77     e8/call  check-stream-equal/disp32
  78     # . . discard args
  79     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  80     # . end
@@ -145,34 +145,34 @@ if ('onhashchange' in window) {
  85     # setup
  86     # . clear-stream(_test-stream)
  87     # . . push args
- 88     68/push  _test-stream/imm32
+ 88     68/push  _test-stream/imm32
  89     # . . call
- 90     e8/call  clear-stream/disp32
+ 90     e8/call  clear-stream/disp32
  91     # . . discard args
  92     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  93     # write-int(_test-stream, "abcd")
  94     # . . push args
  95     68/push  0x64636261/imm32
- 96     68/push  _test-stream/imm32
+ 96     68/push  _test-stream/imm32
  97     # . . call
- 98     e8/call  write-int/disp32
+ 98     e8/call  write-int/disp32
  99     # . . discard args
 100     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 101     # write-int(_test-stream, "efgh")
 102     # . . push args
 103     68/push  0x68676665/imm32
-104     68/push  _test-stream/imm32
+104     68/push  _test-stream/imm32
 105     # . . call
-106     e8/call  write-int/disp32
+106     e8/call  write-int/disp32
 107     # . . discard args
 108     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 109     # check-stream-equal(_test-stream, "abcdefgh", msg)
 110     # . . push args
 111     68/push  "F - test-write-byte-buffered-multiple"/imm32
 112     68/push  "abcdefgh"/imm32
-113     68/push  _test-stream/imm32
+113     68/push  _test-stream/imm32
 114     # . . call
-115     e8/call  check-stream-equal/disp32
+115     e8/call  check-stream-equal/disp32
 116     # . . discard args
 117     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 118     # . end
diff --git a/html/092stack.subx.html b/html/203stack.subx.html
similarity index 95%
rename from html/092stack.subx.html
rename to html/203stack.subx.html
index 69df5b8a..b32c4143 100644
--- a/html/092stack.subx.html
+++ b/html/203stack.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 092stack.subx
+Mu - 203stack.subx
 
 
 
@@ -56,7 +56,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/092stack.subx
+https://github.com/akkartik/mu/blob/master/203stack.subx
 
   1 # A stack looks like this:
   2 #   top: int
@@ -118,51 +118,51 @@ if ('onhashchange' in window) {
  58     # . . push args
  59     51/push-ecx
  60     # . . call
- 61     e8/call  clear-stack/disp32
+ 61     e8/call  clear-stack/disp32
  62     # . . discard args
  63     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  64     # top should be 0
  65     58/pop-to-eax
  66     # . check-ints-equal(eax, 0, msg)
  67     # . . push args
- 68     68/push  "F - test-clear-stack: top"/imm32
+ 68     68/push  "F - test-clear-stack: top"/imm32
  69     68/push  0/imm32
  70     50/push-eax
  71     # . . call
- 72     e8/call  check-ints-equal/disp32
+ 72     e8/call  check-ints-equal/disp32
  73     # . . discard args
  74     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  75     # size should remain 8
  76     58/pop-to-eax
  77     # . check-ints-equal(eax, 8, msg)
  78     # . . push args
- 79     68/push  "F - test-clear-stack: size"/imm32
+ 79     68/push  "F - test-clear-stack: size"/imm32
  80     68/push  8/imm32
  81     50/push-eax
  82     # . . call
- 83     e8/call  check-ints-equal/disp32
+ 83     e8/call  check-ints-equal/disp32
  84     # . . discard args
  85     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  86     # first word is 0
  87     58/pop-to-eax
  88     # . check-ints-equal(eax, 0, msg)
  89     # . . push args
- 90     68/push  "F - test-clear-stack: data[0..3]"/imm32
+ 90     68/push  "F - test-clear-stack: data[0..3]"/imm32
  91     68/push  0/imm32
  92     50/push-eax
  93     # . . call
- 94     e8/call  check-ints-equal/disp32
+ 94     e8/call  check-ints-equal/disp32
  95     # . . discard args
  96     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  97     # second word is 0
  98     58/pop-to-eax
  99     # . check-ints-equal(eax, 0, msg)
 100     # . . push args
-101     68/push  "F - test-clear-stack: data[4..7]"/imm32
+101     68/push  "F - test-clear-stack: data[4..7]"/imm32
 102     68/push  0/imm32
 103     50/push-eax
 104     # . . call
-105     e8/call  check-ints-equal/disp32
+105     e8/call  check-ints-equal/disp32
 106     # . . discard args
 107     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 108     # . epilogue
@@ -205,17 +205,17 @@ if ('onhashchange' in window) {
 145     # print(stderr, "error: push: no space left")
 146     # . write-buffered(Stderr, "error: push: no space left")
 147     # . . push args
-148     68/push  "error: push: no space left"/imm32
-149     68/push  Stderr/imm32
+148     68/push  "error: push: no space left"/imm32
+149     68/push  Stderr/imm32
 150     # . . call
-151     e8/call  write-buffered/disp32
+151     e8/call  write-buffered/disp32
 152     # . . discard args
 153     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 154     # . flush(Stderr)
 155     # . . push args
-156     68/push  Stderr/imm32
+156     68/push  Stderr/imm32
 157     # . . call
-158     e8/call  flush/disp32
+158     e8/call  flush/disp32
 159     # . . discard args
 160     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 161     # . syscall(exit, 1)
@@ -238,51 +238,51 @@ if ('onhashchange' in window) {
 178     68/push  0x42/imm32
 179     51/push-ecx
 180     # . . call
-181     e8/call  push/disp32
+181     e8/call  push/disp32
 182     # . . discard args
 183     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 184     # check top
 185     58/pop-to-eax
 186     # . check-ints-equal(eax, 4, msg)
 187     # . . push args
-188     68/push  "F - test-push: top"/imm32
+188     68/push  "F - test-push: top"/imm32
 189     68/push  4/imm32
 190     50/push-eax
 191     # . . call
-192     e8/call  check-ints-equal/disp32
+192     e8/call  check-ints-equal/disp32
 193     # . . discard args
 194     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 195     # check size
 196     58/pop-to-eax
 197     # . check-ints-equal(eax, 8, msg)
 198     # . . push args
-199     68/push  "F - test-push: size"/imm32
+199     68/push  "F - test-push: size"/imm32
 200     68/push  8/imm32
 201     50/push-eax
 202     # . . call
-203     e8/call  check-ints-equal/disp32
+203     e8/call  check-ints-equal/disp32
 204     # . . discard args
 205     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 206     # first word is 0x42
 207     58/pop-to-eax
 208     # . check-ints-equal(eax, 0x42, msg)
 209     # . . push args
-210     68/push  "F - test-push: data[0..3]"/imm32
+210     68/push  "F - test-push: data[0..3]"/imm32
 211     68/push  0x42/imm32
 212     50/push-eax
 213     # . . call
-214     e8/call  check-ints-equal/disp32
+214     e8/call  check-ints-equal/disp32
 215     # . . discard args
 216     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 217     # second word is 0
 218     58/pop-to-eax
 219     # . check-ints-equal(eax, 0, msg)
 220     # . . push args
-221     68/push  "F - test-push: data[4..7]"/imm32
+221     68/push  "F - test-push: data[4..7]"/imm32
 222     68/push  0/imm32
 223     50/push-eax
 224     # . . call
-225     e8/call  check-ints-equal/disp32
+225     e8/call  check-ints-equal/disp32
 226     # . . discard args
 227     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 228     # . epilogue
@@ -323,17 +323,17 @@ if ('onhashchange' in window) {
 263     # print(stderr, "error: pop: nothing left in stack")
 264     # . write-buffered(Stderr, "error: pop: nothing left in stack")
 265     # . . push args
-266     68/push  "error: pop: nothing left in stack"/imm32
-267     68/push  Stderr/imm32
+266     68/push  "error: pop: nothing left in stack"/imm32
+267     68/push  Stderr/imm32
 268     # . . call
-269     e8/call  write-buffered/disp32
+269     e8/call  write-buffered/disp32
 270     # . . discard args
 271     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 272     # . flush(Stderr)
 273     # . . push args
-274     68/push  Stderr/imm32
+274     68/push  Stderr/imm32
 275     # . . call
-276     e8/call  flush/disp32
+276     e8/call  flush/disp32
 277     # . . discard args
 278     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 279     # . syscall(exit, 1)
@@ -355,38 +355,38 @@ if ('onhashchange' in window) {
 295     # . . push args
 296     51/push-ecx
 297     # . . call
-298     e8/call  pop/disp32
+298     e8/call  pop/disp32
 299     # . . discard args
 300     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 301     # check-ints-equal(eax, 0x42, msg)
 302     # . . push args
-303     68/push  "F - test-pop: result"/imm32
+303     68/push  "F - test-pop: result"/imm32
 304     68/push  0x42/imm32
 305     50/push-eax
 306     # . . call
-307     e8/call  check-ints-equal/disp32
+307     e8/call  check-ints-equal/disp32
 308     # . . discard args
 309     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 310     # check top
 311     58/pop-to-eax
 312     # . check-ints-equal(eax, 0, msg)
 313     # . . push args
-314     68/push  "F - test-pop: top"/imm32
+314     68/push  "F - test-pop: top"/imm32
 315     68/push  0/imm32
 316     50/push-eax
 317     # . . call
-318     e8/call  check-ints-equal/disp32
+318     e8/call  check-ints-equal/disp32
 319     # . . discard args
 320     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 321     # check size
 322     58/pop-to-eax
 323     # . check-ints-equal(eax, 8, msg)
 324     # . . push args
-325     68/push  "F - test-pop: size"/imm32
+325     68/push  "F - test-pop: size"/imm32
 326     68/push  8/imm32
 327     50/push-eax
 328     # . . call
-329     e8/call  check-ints-equal/disp32
+329     e8/call  check-ints-equal/disp32
 330     # . . discard args
 331     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 332     # . epilogue
@@ -424,17 +424,17 @@ if ('onhashchange' in window) {
 364     # print(stderr, "error: top: nothing left in stack")
 365     # . write-buffered(Stderr, "error: top: nothing left in stack")
 366     # . . push args
-367     68/push  "error: top: nothing left in stack"/imm32
-368     68/push  Stderr/imm32
+367     68/push  "error: top: nothing left in stack"/imm32
+368     68/push  Stderr/imm32
 369     # . . call
-370     e8/call  write-buffered/disp32
+370     e8/call  write-buffered/disp32
 371     # . . discard args
 372     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 373     # . flush(Stderr)
 374     # . . push args
-375     68/push  Stderr/imm32
+375     68/push  Stderr/imm32
 376     # . . call
-377     e8/call  flush/disp32
+377     e8/call  flush/disp32
 378     # . . discard args
 379     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 380     # . syscall(exit, 1)
@@ -456,16 +456,16 @@ if ('onhashchange' in window) {
 396     # . . push args
 397     51/push-ecx
 398     # . . call
-399     e8/call  top/disp32
+399     e8/call  top/disp32
 400     # . . discard args
 401     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 402     # check-ints-equal(eax, 42, msg")
 403     # . . push args
-404     68/push  "F - test-top: result"/imm32
+404     68/push  "F - test-top: result"/imm32
 405     68/push  0x42/imm32
 406     50/push-eax
 407     # . . call
-408     e8/call  check-ints-equal/disp32
+408     e8/call  check-ints-equal/disp32
 409     # . . discard args
 410     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 411     # . epilogue
diff --git a/html/100array-equal.subx.html b/html/301array-equal.subx.html
similarity index 92%
rename from html/100array-equal.subx.html
rename to html/301array-equal.subx.html
index 080c7501..7eaf513d 100644
--- a/html/100array-equal.subx.html
+++ b/html/301array-equal.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 100array-equal.subx
+Mu - 301array-equal.subx
 
 
 
@@ -56,13 +56,13 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/100array-equal.subx
+https://github.com/akkartik/mu/blob/master/301array-equal.subx
 
   1 # Comparing arrays of numbers.
   2 
   3 == code
   4 
-  5 array-equal?:  # a: (addr array int), b: (addr array int) -> eax: boolean
+  5 array-equal?:  # a: (addr array int), b: (addr array int) -> result/eax: boolean
   6     # pseudocode:
   7     #   asize = a->size
   8     #   if (asize != b->size) return false
@@ -157,8 +157,8 @@ if ('onhashchange' in window) {
  97     68/push 0/imm32/size
  98     89/<- %edx 4/r32/esp
  99     #
-100     (array-equal? %ecx %edx)  # => eax
-101     (check-ints-equal %eax 1 "F - test-compare-empty-with-empty-array")
+100     (array-equal? %ecx %edx)  # => eax
+101     (check-ints-equal %eax 1 "F - test-compare-empty-with-empty-array")
 102     # . epilogue
 103     89/<- %esp 5/r32/ebp
 104     5d/pop-to-ebp
@@ -176,8 +176,8 @@ if ('onhashchange' in window) {
 116     68/push 0/imm32/size
 117     89/<- %edx 4/r32/esp
 118     #
-119     (array-equal? %ecx %edx)  # => eax
-120     (check-ints-equal %eax 0 "F - test-compare-empty-with-non-empty-array")
+119     (array-equal? %ecx %edx)  # => eax
+120     (check-ints-equal %eax 0 "F - test-compare-empty-with-non-empty-array")
 121     # . epilogue
 122     89/<- %esp 5/r32/ebp
 123     5d/pop-to-ebp
@@ -200,8 +200,8 @@ if ('onhashchange' in window) {
 140     68/push 0xc/imm32/size
 141     89/<- %edx 4/r32/esp
 142     #
-143     (array-equal? %ecx %edx)  # => eax
-144     (check-ints-equal %eax 1 "F - test-compare-equal-arrays")
+143     (array-equal? %ecx %edx)  # => eax
+144     (check-ints-equal %eax 1 "F - test-compare-equal-arrays")
 145     # . epilogue
 146     89/<- %esp 5/r32/ebp
 147     5d/pop-to-ebp
@@ -224,8 +224,8 @@ if ('onhashchange' in window) {
 164     68/push 0xc/imm32/size
 165     89/<- %edx 4/r32/esp
 166     #
-167     (array-equal? %ecx %edx)  # => eax
-168     (check-ints-equal %eax 0 "F - test-compare-inequal-arrays-equal-sizes")
+167     (array-equal? %ecx %edx)  # => eax
+168     (check-ints-equal %eax 0 "F - test-compare-inequal-arrays-equal-sizes")
 169     # . epilogue
 170     89/<- %esp 5/r32/ebp
 171     5d/pop-to-ebp
@@ -281,19 +281,19 @@ if ('onhashchange' in window) {
 221     39/compare %ecx 2/r32/edx
 222     73/jump-if-addr>= $parse-array-of-ints:break1/disp8
 223     # curr = skip-chars-matching-in-slice(curr, end, ' ')
-224     (skip-chars-matching-in-slice %ecx %edx 0x20)  # => eax
+224     (skip-chars-matching-in-slice %ecx %edx 0x20)  # => eax
 225     89/<- %ecx 0/r32/eax
 226     # if (curr >= end) break
 227     39/compare %ecx 2/r32/edx
 228     73/jump-if-addr>= $parse-array-of-ints:break1/disp8
 229     # curr = skip-chars-not-matching-in-slice(curr, end, ' ')
-230     (skip-chars-not-matching-in-slice %ecx %edx 0x20)  # => eax
+230     (skip-chars-not-matching-in-slice %ecx %edx 0x20)  # => eax
 231     89/<- %ecx 0/r32/eax
 232     # size += 4
 233     81 0/subop/add %ebx 4/imm32
 234     eb/jump $parse-array-of-ints:loop1/disp8
 235 $parse-array-of-ints:break1:
-236     (allocate-array *(ebp+8) %ebx *(ebp+0x10))
+236     (allocate-array *(ebp+8) %ebx *(ebp+0x10))
 237 $parse-array-of-ints:pass2:
 238     # var slice/edi: slice = {s->data, 0}
 239     68/push 0/imm32/end
@@ -302,23 +302,23 @@ if ('onhashchange' in window) {
 242     89/<- %edi 4/r32/esp
 243     # curr = lookup(out)->data
 244     8b/-> *(ebp+0x10) 0/r32/eax
-245     (lookup *eax *(eax+4))  # => eax
+245     (lookup *eax *(eax+4))  # => eax
 246     8d/copy-address *(eax+4) 1/r32/ecx
 247 $parse-array-of-ints:loop2:
 248     # if (slice->start >= end) break
 249     39/compare *edi 2/r32/edx
 250     73/jump-if-addr>= $parse-array-of-ints:end/disp8
 251     # slice->start = skip-chars-matching-in-slice(slice->start, end, ' ')
-252     (skip-chars-matching-in-slice *edi %edx 0x20)  # => eax
+252     (skip-chars-matching-in-slice *edi %edx 0x20)  # => eax
 253     89/<- *edi 0/r32/eax
 254     # if (slice->start >= end) break
 255     39/compare *edi 2/r32/edx
 256     73/jump-if-addr>= $parse-array-of-ints:end/disp8
 257     # slice->end = skip-chars-not-matching-in-slice(slice->start, end, ' ')
-258     (skip-chars-not-matching-in-slice *edi %edx 0x20)  # => eax
+258     (skip-chars-not-matching-in-slice *edi %edx 0x20)  # => eax
 259     89/<- *(edi+4) 0/r32/eax
 260     # *curr = parse-hex-int-from-slice(slice)
-261     (parse-hex-int-from-slice %edi)
+261     (parse-hex-int-from-slice %edi)
 262     89/<- *ecx 0/r32/eax
 263     # curr += 4
 264     81 0/subop/add %ecx 4/imm32
@@ -356,10 +356,10 @@ if ('onhashchange' in window) {
 296     68/push 0xc/imm32/size
 297     89/<- %ecx 4/r32/esp
 298     #
-299     (parse-array-of-ints Heap "1 2 3" %esi)
-300     (lookup *esi *(esi+4))  # => eax
-301     (array-equal? %ecx %eax)  # => eax
-302     (check-ints-equal %eax 1 "F - test-parse-array-of-ints")
+299     (parse-array-of-ints Heap "1 2 3" %esi)
+300     (lookup *esi *(esi+4))  # => eax
+301     (array-equal? %ecx %eax)  # => eax
+302     (check-ints-equal %eax 1 "F - test-parse-array-of-ints")
 303     # . epilogue
 304     89/<- %esp 5/r32/ebp
 305     5d/pop-to-ebp
@@ -375,9 +375,9 @@ if ('onhashchange' in window) {
 315     68/push 0/imm32
 316     89/<- %esi 4/r32/esp
 317     #
-318     (parse-array-of-ints Heap "" %esi)
-319     (lookup *esi *(esi+4))  # => eax
-320     (check-ints-equal *eax 0 "F - test-parse-array-of-ints-empty")
+318     (parse-array-of-ints Heap "" %esi)
+319     (lookup *esi *(esi+4))  # => eax
+320     (check-ints-equal *eax 0 "F - test-parse-array-of-ints-empty")
 321     # . epilogue
 322     89/<- %esp 5/r32/ebp
 323     5d/pop-to-ebp
@@ -393,9 +393,9 @@ if ('onhashchange' in window) {
 333     68/push 0/imm32
 334     89/<- %esi 4/r32/esp
 335     #
-336     (parse-array-of-ints Heap Space %esi)
-337     (lookup *esi *(esi+4))  # => eax
-338     (check-ints-equal *eax 0 "F - test-parse-array-of-ints-just-whitespace")
+336     (parse-array-of-ints Heap Space %esi)
+337     (lookup *esi *(esi+4))  # => eax
+338     (check-ints-equal *eax 0 "F - test-parse-array-of-ints-just-whitespace")
 339     # . epilogue
 340     89/<- %esp 5/r32/ebp
 341     5d/pop-to-ebp
@@ -416,10 +416,10 @@ if ('onhashchange' in window) {
 356     68/push 0xc/imm32/size
 357     89/<- %ecx 4/r32/esp
 358     #
-359     (parse-array-of-ints Heap " 1 2  3  " %esi)
-360     (lookup *esi *(esi+4))  # => eax
-361     (array-equal? %ecx %eax)  # => eax
-362     (check-ints-equal %eax 1 "F - test-parse-array-of-ints-extra-whitespace")
+359     (parse-array-of-ints Heap " 1 2  3  " %esi)
+360     (lookup *esi *(esi+4))  # => eax
+361     (array-equal? %ecx %eax)  # => eax
+362     (check-ints-equal %eax 1 "F - test-parse-array-of-ints-extra-whitespace")
 363     # . epilogue
 364     89/<- %esp 5/r32/ebp
 365     5d/pop-to-ebp
@@ -439,11 +439,11 @@ if ('onhashchange' in window) {
 379     68/push 0/imm32
 380     89/<- %esi 4/r32/esp
 381     # var b/eax: (addr array int) = parse-array-of-ints(Heap, expected)
-382     (parse-array-of-ints Heap *(ebp+0xc) %esi)
-383     (lookup *esi *(esi+4))  # => eax
+382     (parse-array-of-ints Heap *(ebp+0xc) %esi)
+383     (lookup *esi *(esi+4))  # => eax
 384     #
-385     (array-equal? *(ebp+8) %eax)
-386     (check-ints-equal %eax 1 *(ebp+0x10))
+385     (array-equal? *(ebp+8) %eax)
+386     (check-ints-equal %eax 1 *(ebp+0x10))
 387 $check-array-equal:end:
 388     # . restore registers
 389     5e/pop-to-esi
@@ -464,7 +464,7 @@ if ('onhashchange' in window) {
 404     68/push 0xc/imm32/size
 405     89/<- %ecx 4/r32/esp
 406     #
-407     (check-array-equal %ecx "1 2 3" "F - test-check-array-equal")
+407     (check-array-equal %ecx "1 2 3" "F - test-check-array-equal")
 408     # . epilogue
 409     89/<- %esp 5/r32/ebp
 410     5d/pop-to-ebp
diff --git a/html/101stack_allocate.subx.html b/html/302stack_allocate.subx.html
similarity index 93%
rename from html/101stack_allocate.subx.html
rename to html/302stack_allocate.subx.html
index 92c20f05..550952fc 100644
--- a/html/101stack_allocate.subx.html
+++ b/html/302stack_allocate.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 101stack_allocate.subx
+Mu - 302stack_allocate.subx
 
 
 
@@ -53,7 +53,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/101stack_allocate.subx
+https://github.com/akkartik/mu/blob/master/302stack_allocate.subx
 
  1 # A function which pushes n zeros on the stack.
  2 # Not really useful to call manually.
@@ -90,7 +90,7 @@ if ('onhashchange' in window) {
 33 # n must be positive
 34 push-n-zero-bytes:  # n: int
 35 $push-n-zero-bytes:prologue:
-36     89/<- *Push-n-zero-bytes-ebp 5/r32/ebp  # spill ebp without affecting stack
+36     89/<- *Push-n-zero-bytes-ebp 5/r32/ebp  # spill ebp without affecting stack
 37     89/<- %ebp 4/r32/esp
 38 $push-n-zero-bytes:copy-ra:
 39     # -- esp = ebp
@@ -104,12 +104,12 @@ if ('onhashchange' in window) {
 47     58/pop-to-eax
 48     # -- esp+n = ebp
 49 $push-n-zero-bytes:bulk-cleaning:
-50     89/<- *Push-n-zero-bytes-esp 4/r32/esp
-51     81 0/subop/add *Push-n-zero-bytes-esp 4/imm32
+50     89/<- *Push-n-zero-bytes-esp 4/r32/esp
+51     81 0/subop/add *Push-n-zero-bytes-esp 4/imm32
 52     81 0/subop/add *(ebp+4) 4/imm32
-53     (zero-out *Push-n-zero-bytes-esp *(ebp+4))  # n+4
+53     (zero-out *Push-n-zero-bytes-esp *(ebp+4))  # n+4
 54 $push-n-zero-bytes:epilogue:
-55     8b/-> *Push-n-zero-bytes-ebp 5/r32/ebp  # restore spill
+55     8b/-> *Push-n-zero-bytes-ebp 5/r32/ebp  # restore spill
 56     c3/return
 57 
 58 == data
diff --git a/html/102kernel-string.subx.html b/html/303kernel-string.subx.html
similarity index 96%
rename from html/102kernel-string.subx.html
rename to html/303kernel-string.subx.html
index 49dec25a..f03dd4c9 100644
--- a/html/102kernel-string.subx.html
+++ b/html/303kernel-string.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 102kernel-string.subx
+Mu - 303kernel-string.subx
 
 
 
@@ -52,7 +52,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/102kernel-string.subx
+https://github.com/akkartik/mu/blob/master/303kernel-string.subx
 
  1 # We can't really do much with null-terminated kernel strings, and we don't
  2 # want to. Let's turn them into regular length-prefixed strings at the first
@@ -71,17 +71,17 @@ if ('onhashchange' in window) {
 15     56/push-esi
 16     57/push-edi
 17     # var len/ecx: int = length(in)
-18     (kernel-string-length *(ebp+0xc))
+18     (kernel-string-length *(ebp+0xc))
 19     89/<- %ecx 0/r32/eax
 20     # result = allocate-array(ad, len)
-21     (allocate-array *(ebp+8) %ecx *(ebp+0x10))
+21     (allocate-array *(ebp+8) %ecx *(ebp+0x10))
 22     # var c/edx: byte = 0
 23     ba/copy-to-edx 0/imm32
 24     # var src/esi: (addr byte) = in
 25     8b/-> *(ebp+0xc) 6/r32/esi
 26     # var dest/edi: (addr byte) = result->data
 27     8b/-> *(ebp+0x10) 7/r32/edi
-28     (lookup *edi *(edi+4))  # => eax
+28     (lookup *edi *(edi+4))  # => eax
 29     8d/copy-address *(eax+4) 7/r32/edi
 30     {
 31 $kernel-string-to-string:loop:
diff --git a/html/304screen.subx.html b/html/304screen.subx.html
new file mode 100644
index 00000000..28e957ef
--- /dev/null
+++ b/html/304screen.subx.html
@@ -0,0 +1,401 @@
+
+
+
+
+Mu - 304screen.subx
+
+
+
+
+
+
+
+
+
+
+https://github.com/akkartik/mu/blob/master/304screen.subx
+
+  1 # Primitives for screen control.
+  2 # Require Linux and a modern terminal.
+  3 
+  4 == code
+  5 
+  6 enable-screen-grid-mode:
+  7     # . prologue
+  8     55/push-ebp
+  9     89/<- %ebp 4/r32/esp
+ 10     #
+ 11     (flush Stdout)
+ 12     (flush Stderr)
+ 13     # switch to second screen buffer
+ 14     (write 2 Esc)
+ 15     (write 2 "[?1049h")
+ 16     #
+ 17     (clear-screen)
+ 18 $enable-screen-grid-mode:end:
+ 19     # . epilogue
+ 20     89/<- %esp 5/r32/ebp
+ 21     5d/pop-to-ebp
+ 22     c3/return
+ 23 
+ 24 enable-screen-type-mode:
+ 25     # . prologue
+ 26     55/push-ebp
+ 27     89/<- %ebp 4/r32/esp
+ 28     # switch to first screen buffer
+ 29     (write 2 Esc)
+ 30     (write 2 "[?1049l")
+ 31 $enable-screen-type-mode:end:
+ 32     # . epilogue
+ 33     89/<- %esp 5/r32/ebp
+ 34     5d/pop-to-ebp
+ 35     c3/return
+ 36 
+ 37 screen-size:  # -> nrows/eax: int, ncols/ecx: int
+ 38     # . prologue
+ 39     55/push-ebp
+ 40     89/<- %ebp 4/r32/esp
+ 41     # . save registers
+ 42     52/push-edx
+ 43     53/push-ebx
+ 44     56/push-esi
+ 45     57/push-edi
+ 46     #
+ 47     (_maybe-open-terminal)
+ 48     # var window-size-info/esi: (addr winsize)
+ 49     # winsize is a type from the Linux kernel. We don't care how large it is.
+ 50     81 5/subop/subtract %esp 0x40/imm32
+ 51     89/<- %esi 4/r32/esp
+ 52     # ioctl(*Terminal-file-descriptor, TIOCGWINSZ, window-size-info)
+ 53     89/<- %edx 6/r32/esi
+ 54     b9/copy-to-ecx 0x5413/imm32/TIOCGWINSZ
+ 55     8b/-> *Terminal-file-descriptor 3/r32/ebx
+ 56     e8/call syscall_ioctl/disp32
+ 57     # some bitworking to extract 2 16-bit shorts
+ 58     8b/-> *esi 0/r32/eax
+ 59     81 4/subop/and %eax 0xffff/imm32
+ 60     8b/-> *esi 1/r32/ecx
+ 61     c1/shift 5/subop/logical-right %ecx 0x10/imm8
+ 62 $screen-size:end:
+ 63     # . reclaim locals
+ 64     81 0/subop/add %esp 0x40/imm32
+ 65     # . restore registers
+ 66     5f/pop-to-edi
+ 67     5e/pop-to-esi
+ 68     5b/pop-to-ebx
+ 69     5a/pop-to-edx
+ 70     # . epilogue
+ 71     89/<- %esp 5/r32/ebp
+ 72     5d/pop-to-ebp
+ 73     c3/return
+ 74 
+ 75 clear-screen:
+ 76     # . prologue
+ 77     55/push-ebp
+ 78     89/<- %ebp 4/r32/esp
+ 79     #
+ 80     (write 2 Esc)
+ 81     (write 2 "[H")
+ 82     (write 2 Esc)
+ 83     (write 2 "[2J")
+ 84 $clear-screen:end:
+ 85     # . epilogue
+ 86     89/<- %esp 5/r32/ebp
+ 87     5d/pop-to-ebp
+ 88     c3/return
+ 89 
+ 90 # row and col count from the top-left as (1, 1)
+ 91 move-cursor-on-screen:  # row: int, column: int
+ 92     # . prologue
+ 93     55/push-ebp
+ 94     89/<- %ebp 4/r32/esp
+ 95     # . save registers
+ 96     51/push-ecx
+ 97     # var buf/ecx: (stream byte 32)
+ 98     81 5/subop/subtract %esp 0x20/imm32
+ 99     68/push 0x20/imm32/size
+100     68/push 0/imm32/read
+101     68/push 0/imm32/write
+102     89/<- %ecx 4/r32/esp
+103     # construct directive in buf
+104     (write %ecx Esc)
+105     (write %ecx "[")
+106     (write-int32-decimal %ecx *(ebp+8))
+107     (write %ecx ";")
+108     (write-int32-decimal %ecx *(ebp+0xc))
+109     (write %ecx "H")
+110     # flush
+111     (write-stream 2 %ecx)
+112 $move-cursor-on-screen:end:
+113     # . reclaim locals
+114     81 0/subop/add %esp 0x2c/imm32
+115     # . restore registers
+116     59/pop-to-ecx
+117     # . epilogue
+118     89/<- %esp 5/r32/ebp
+119     5d/pop-to-ebp
+120     c3/return
+121 
+122 # just because Mu has no support for global variables yet
+123 print-string-to-screen:  # s: (addr array byte)
+124     # . prologue
+125     55/push-ebp
+126     89/<- %ebp 4/r32/esp
+127     #
+128     (write 2 *(ebp+8))
+129 $print-string-to-screen:end:
+130     # . epilogue
+131     89/<- %esp 5/r32/ebp
+132     5d/pop-to-ebp
+133     c3/return
+134 
+135 # just because Mu has no support for global variables yet
+136 print-byte-to-screen:  # c: byte
+137     # . prologue
+138     55/push-ebp
+139     89/<- %ebp 4/r32/esp
+140     # . save registers
+141     51/push-ecx
+142     # var s/ecx: (addr array byte)
+143     ff 6/subop/push *(ebp+8)
+144     68/push 4/imm32/size
+145     89/<- %ecx 4/r32/esp
+146     (write 2 %ecx)
+147 $print-byte-to-screen:end:
+148     # . reclaim locals
+149     81 0/subop/add %esp 8/imm32
+150     # . restore registers
+151     59/pop-to-ecx
+152     # . epilogue
+153     89/<- %esp 5/r32/ebp
+154     5d/pop-to-ebp
+155     c3/return
+156 
+157 # just because Mu has no support for global variables yet
+158 print-int32-hex-to-screen:  # n: int
+159     # . prologue
+160     55/push-ebp
+161     89/<- %ebp 4/r32/esp
+162     #
+163     (write-int32-hex-buffered Stdout *(ebp+8))
+164     (flush Stdout)
+165 $print-int32-hex-to-screen:end:
+166     # . epilogue
+167     89/<- %esp 5/r32/ebp
+168     5d/pop-to-ebp
+169     c3/return
+170 
+171 reset-formatting-on-screen:
+172     # . prologue
+173     55/push-ebp
+174     89/<- %ebp 4/r32/esp
+175     #
+176     (write 2 Esc)
+177     (write 2 "(B")
+178     (write 2 Esc)
+179     (write 2 "[m")
+180 $reset-formatting-on-screen:end:
+181     # . epilogue
+182     89/<- %esp 5/r32/ebp
+183     5d/pop-to-ebp
+184     c3/return
+185 
+186 start-color-on-screen:  # fg: int, bg: int
+187     # . prologue
+188     55/push-ebp
+189     89/<- %ebp 4/r32/esp
+190     # . save registers
+191     51/push-ecx
+192     # var buf/ecx: (stream byte 32)
+193     81 5/subop/subtract %esp 0x20/imm32
+194     68/push 0x20/imm32/size
+195     68/push 0/imm32/read
+196     68/push 0/imm32/write
+197     89/<- %ecx 4/r32/esp
+198     # construct directive in buf
+199     # . set fg
+200     (write %ecx Esc)
+201     (write %ecx "[38;5;")
+202     (write-int32-decimal %ecx *(ebp+8))
+203     (write %ecx "m")
+204     # . set bg
+205     (write %ecx Esc)
+206     (write %ecx "[48;5;")
+207     (write-int32-decimal %ecx *(ebp+0xc))
+208     (write %ecx "m")
+209     # flush
+210     (write-stream 2 %ecx)
+211 $start-color-on-screen:end:
+212     # . reclaim locals
+213     81 0/subop/add %esp 0x2c/imm32
+214     # . restore registers
+215     59/pop-to-ecx
+216     # . epilogue
+217     89/<- %esp 5/r32/ebp
+218     5d/pop-to-ebp
+219     c3/return
+220 
+221 start-bold-on-screen:
+222     # . prologue
+223     55/push-ebp
+224     89/<- %ebp 4/r32/esp
+225     #
+226     (write 2 Esc)
+227     (write 2 "[1m")
+228 $start-bold-on-screen:end:
+229     # . epilogue
+230     89/<- %esp 5/r32/ebp
+231     5d/pop-to-ebp
+232     c3/return
+233 
+234 start-underline-on-screen:
+235     # . prologue
+236     55/push-ebp
+237     89/<- %ebp 4/r32/esp
+238     #
+239     (write 2 Esc)
+240     (write 2 "[4m")
+241 $start-underline-on-screen:end:
+242     # . epilogue
+243     89/<- %esp 5/r32/ebp
+244     5d/pop-to-ebp
+245     c3/return
+246 
+247 start-reverse-video-on-screen:
+248     # . prologue
+249     55/push-ebp
+250     89/<- %ebp 4/r32/esp
+251     #
+252     (write 2 Esc)
+253     (write 2 "[7m")
+254 $start-reverse-video-on-screen:end:
+255     # . epilogue
+256     89/<- %esp 5/r32/ebp
+257     5d/pop-to-ebp
+258     c3/return
+259 
+260 # might require enabling blinking in your terminal program
+261 start-blinking-on-screen:
+262     # . prologue
+263     55/push-ebp
+264     89/<- %ebp 4/r32/esp
+265     #
+266     (write 2 Esc)
+267     (write 2 "[5m")
+268 $start-blinking-on-screen:end:
+269     # . epilogue
+270     89/<- %esp 5/r32/ebp
+271     5d/pop-to-ebp
+272     c3/return
+273 
+274 hide-cursor-on-screen:
+275     # . prologue
+276     55/push-ebp
+277     89/<- %ebp 4/r32/esp
+278     #
+279     (write 2 Esc)
+280     (write 2 "[?25l")
+281 $hide-cursor-on-screen:end:
+282     # . epilogue
+283     89/<- %esp 5/r32/ebp
+284     5d/pop-to-ebp
+285     c3/return
+286 
+287 show-cursor-on-screen:
+288     # . prologue
+289     55/push-ebp
+290     89/<- %ebp 4/r32/esp
+291     #
+292     (write 2 Esc)
+293     (write 2 "[?12l")
+294     (write 2 Esc)
+295     (write 2 "[?25h")
+296 $show-cursor-on-screen:end:
+297     # . epilogue
+298     89/<- %esp 5/r32/ebp
+299     5d/pop-to-ebp
+300     c3/return
+301 
+302 # This is a low-level detail; I don't think everything should be a file.
+303 #
+304 # Open "/dev/tty" if necessary and cache its file descriptor in Terminal-file-descriptor
+305 # where later primitives can use it.
+306 _maybe-open-terminal:
+307     81 7/subop/compare *Terminal-file-descriptor -1/imm32
+308     75/jump-if-!= $_maybe-open-terminal:epilogue/disp8
+309     # . save registers
+310     50/push-eax
+311     51/push-ecx
+312     53/push-ebx
+313     # open("/dev/tty", O_RDWR)
+314     bb/copy-to-ebx Terminal-filename/imm32
+315     b9/copy-to-ecx 2/imm32/O_RDWR
+316     e8/call syscall_open/disp32
+317     89/<- *Terminal-file-descriptor 0/r32/eax
+318 $_maybe-open-terminal:end:
+319     # . restore registers
+320     5b/pop-to-ebx
+321     59/pop-to-ecx
+322     58/pop-to-eax
+323 $_maybe-open-terminal:epilogue:
+324     c3/return
+325 
+326 == data
+327 
+328 Terminal-file-descriptor:  # (addr int)
+329   -1/imm32
+330 
+331 Esc:  # (addr array byte)
+332   # size
+333   1/imm32
+334   # data
+335   0x1b
+336 
+337 Terminal-filename:  # (addr kernel-string)
+338   # "/dev/null"
+339   2f/slash 64/d 65/e 76/v 2f/slash 74/t 74/t 79/y 0/nul
+
+ + + diff --git a/html/104keyboard.subx.html b/html/305keyboard.subx.html similarity index 95% rename from html/104keyboard.subx.html rename to html/305keyboard.subx.html index 35952e38..afc38518 100644 --- a/html/104keyboard.subx.html +++ b/html/305keyboard.subx.html @@ -2,7 +2,7 @@ -Mu - 104keyboard.subx +Mu - 305keyboard.subx @@ -54,7 +54,7 @@ if ('onhashchange' in window) { -https://github.com/akkartik/mu/blob/master/104keyboard.subx +https://github.com/akkartik/mu/blob/master/305keyboard.subx
   1 # Primitives for keyboard control.
   2 # Require Linux and a modern terminal.
@@ -73,7 +73,7 @@ if ('onhashchange' in window) {
  15     56/push-esi
  16     57/push-edi
  17     #
- 18     (_maybe-open-terminal)
+ 18     (_maybe-open-terminal)
  19     # var terminal-info/esi: (addr termios)
  20     # termios is a type from the Linux kernel. We don't care how large it is.
  21     81 5/subop/subtract %esp 0x100/imm32
@@ -81,7 +81,7 @@ if ('onhashchange' in window) {
  23     # ioctl(*Terminal-file-descriptor, TCGETS, terminal-info)
  24     89/<- %edx 6/r32/esi
  25     b9/copy-to-ecx 0x5401/imm32/TCGETS
- 26     8b/-> *Terminal-file-descriptor 3/r32/ebx
+ 26     8b/-> *Terminal-file-descriptor 3/r32/ebx
  27     e8/call syscall_ioctl/disp32
  28     # terminal-info->c_iflags &= Keyboard-immediate-mode-iflags
  29 #?     (write-buffered Stderr "iflags before: ")
@@ -89,7 +89,7 @@ if ('onhashchange' in window) {
  31 #?     (write-buffered Stderr Newline)
  32 #?     (flush Stderr)
  33     8b/-> *esi 0/r32/eax  # Termios-c_iflag
- 34     23/and *Keyboard-immediate-mode-iflags 0/r32/eax
+ 34     23/and *Keyboard-immediate-mode-iflags 0/r32/eax
  35     89/<- *esi 0/r32/eax  # Termios-c_iflag
  36 #?     (write-buffered Stderr "iflags after: ")
  37 #?     (write-int32-hex-buffered Stderr *esi)
@@ -101,7 +101,7 @@ if ('onhashchange' in window) {
  43 #?     (write-buffered Stderr Newline)
  44 #?     (flush Stderr)
  45     8b/-> *(esi+0xc) 0/r32/eax  # Termios-c_lflag
- 46     23/and *Keyboard-immediate-mode-lflags 0/r32/eax
+ 46     23/and *Keyboard-immediate-mode-lflags 0/r32/eax
  47     89/<- *(esi+0xc) 0/r32/eax  # Termios-c_lflag
  48 #?     (write-buffered Stderr "lflags after: ")
  49 #?     (write-int32-hex-buffered Stderr *(esi+0xc))
@@ -110,7 +110,7 @@ if ('onhashchange' in window) {
  52     # ioctl(*Terminal-file-descriptor, TCSETS, terminal-info)
  53     89/<- %edx 6/r32/esi
  54     b9/copy-to-ecx 0x5402/imm32/TCSETS
- 55     8b/-> *Terminal-file-descriptor 3/r32/ebx
+ 55     8b/-> *Terminal-file-descriptor 3/r32/ebx
  56     e8/call syscall_ioctl/disp32
  57 $enable-keyboard-immediate-mode:end:
  58     # . reclaim locals
@@ -139,7 +139,7 @@ if ('onhashchange' in window) {
  81     56/push-esi
  82     57/push-edi
  83     #
- 84     (_maybe-open-terminal)
+ 84     (_maybe-open-terminal)
  85     # var terminal-info/esi: (addr termios)
  86     # termios is a type from the Linux kernel. We don't care how large it is.
  87     81 5/subop/subtract %esp 0x100/imm32
@@ -147,20 +147,20 @@ if ('onhashchange' in window) {
  89     # ioctl(*Terminal-file-descriptor, TCGETS, terminal-info)
  90     89/<- %edx 6/r32/esi
  91     b9/copy-to-ecx 0x5401/imm32/TCGETS
- 92     8b/-> *Terminal-file-descriptor 3/r32/ebx
+ 92     8b/-> *Terminal-file-descriptor 3/r32/ebx
  93     e8/call syscall_ioctl/disp32
  94     # terminal-info->c_iflags |= Keyboard-type-mode-iflags
  95     8b/-> *esi 0/r32/eax  # Termios-c_iflag
- 96     0b/or *Keyboard-type-mode-iflags 0/r32/eax
+ 96     0b/or *Keyboard-type-mode-iflags 0/r32/eax
  97     89/<- *esi 0/r32/eax  # Termios-c_iflag
  98     # terminal-info->c_lflags |= Keyboard-type-mode-lflags
  99     8b/-> *(esi+0xc) 0/r32/eax  # Termios-c_lflag
-100     0b/or *Keyboard-type-mode-lflags 0/r32/eax
+100     0b/or *Keyboard-type-mode-lflags 0/r32/eax
 101     89/<- *(esi+0xc) 0/r32/eax  # Termios-c_lflag
 102     # ioctl(*Terminal-file-descriptor, TCSETS, terminal-info)
 103     89/<- %edx 6/r32/esi
 104     b9/copy-to-ecx 0x5402/imm32/TCSETS
-105     8b/-> *Terminal-file-descriptor 3/r32/ebx
+105     8b/-> *Terminal-file-descriptor 3/r32/ebx
 106     e8/call syscall_ioctl/disp32
 107 $enable-keyboard-type-mode:end:
 108     # . reclaim locals
@@ -177,7 +177,7 @@ if ('onhashchange' in window) {
 119     5d/pop-to-ebp
 120     c3/return
 121 
-122 read-key:  # -> eax: byte
+122 read-key:  # -> result/eax: byte
 123     # . prologue
 124     55/push-ebp
 125     89/<- %ebp 4/r32/esp
@@ -190,7 +190,7 @@ if ('onhashchange' in window) {
 132     68/push 0/imm32/write
 133     89/<- %ecx 4/r32/esp
 134     #
-135     (read 2 %ecx)  # => eax
+135     (read 2 %ecx)  # => eax
 136     8b/-> *(ecx+0xc) 0/r32/eax
 137 $read-key:end:
 138     # . reclaim locals
diff --git a/html/105files.subx.html b/html/306files.subx.html
similarity index 93%
rename from html/105files.subx.html
rename to html/306files.subx.html
index 251d0a96..02841f28 100644
--- a/html/105files.subx.html
+++ b/html/306files.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 105files.subx
+Mu - 306files.subx
 
 
 
@@ -53,7 +53,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/105files.subx
+https://github.com/akkartik/mu/blob/master/306files.subx
 
  1 == code
  2 
@@ -81,8 +81,8 @@ if ('onhashchange' in window) {
 24     68/push 0/imm32/write
 25     89/<- %esi 4/r32/esp
 26     # copy filename and a final null character
-27     (clear-stream %esi)
-28     (write %esi %ecx)
+27     (clear-stream %esi)
+28     (write %esi %ecx)
 29     # spill edx
 30     52/push-edx
 31     # var fd/ecx: fd = open(filename)
@@ -94,10 +94,10 @@ if ('onhashchange' in window) {
 37     # restore edx
 38     5a/pop-to-edx
 39     # allocate a buffered-file
-40     (allocate Heap 0x1010 *(ebp+0x10))  # file-buffer-size + 16 for other fields
+40     (allocate Heap 0x1010 *(ebp+0x10))  # file-buffer-size + 16 for other fields
 41     # var out-addr/edi: (addr buffered-file)
 42     8b/-> *(ebp+0x10) 7/r32/edi
-43     (lookup *edi *(edi+4))  # => eax
+43     (lookup *edi *(edi+4))  # => eax
 44     89/<- %edi 0/r32/eax
 45     # out-addr->size = 4KB
 46     c7 0/subop/copy *(edi+0xc) 0x1000/imm32/file-buffer-size  # Stream-size + 4 for fd
diff --git a/html/106size.subx.html b/html/307size.subx.html
similarity index 94%
rename from html/106size.subx.html
rename to html/307size.subx.html
index 549d44ef..32296163 100644
--- a/html/106size.subx.html
+++ b/html/307size.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 106size.subx
+Mu - 307size.subx
 
 
 
@@ -52,7 +52,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/106size.subx
+https://github.com/akkartik/mu/blob/master/307size.subx
 
  1 # Size of an array in bytes.
  2 
diff --git a/html/apps/arith.mu.html b/html/apps/arith.mu.html
index 78f4f026..842235c0 100644
--- a/html/apps/arith.mu.html
+++ b/html/apps/arith.mu.html
@@ -94,41 +94,41 @@ if ('onhashchange' in window) {
  35 fn main -> exit-status/ebx: int {
  36   var look/esi: byte <- copy 0  # lookahead
  37   var n/eax: int <- copy 0  # result of each expression
- 38   print-string-to-screen "press ctrl-c or ctrl-d to exit\n"
+ 38   print-string-to-screen "press ctrl-c or ctrl-d to exit\n"
  39   # read-eval-print loop
  40   {
  41     # print prompt
- 42     print-string-to-screen "> "
+ 42     print-string-to-screen "> "
  43     # read and eval
- 44     n, look <- simplify  # we explicitly thread 'look' everywhere
+ 44     n, look <- simplify  # we explicitly thread 'look' everywhere
  45     # if (look == 0) break
  46     compare look, 0
  47     break-if-=
  48     # print
- 49     print-int32-hex-to-screen n
- 50     print-string-to-screen "\n"
+ 49     print-int32-hex-to-screen n
+ 50     print-string-to-screen "\n"
  51     #
  52     loop
  53   }
  54   exit-status <- copy 0
  55 }
  56 
- 57 fn simplify -> result/eax: int, look/esi: byte {
+ 57 fn simplify -> result/eax: int, look/esi: byte {
  58   # prime the pump
- 59   look <- get-char
+ 59   look <- get-char
  60   # do it
- 61   result, look <- expression look
+ 61   result, look <- expression look
  62 }
  63 
- 64 fn expression _look: byte -> result/eax: int, look/esi: byte {
+ 64 fn expression _look: byte -> result/eax: int, look/esi: byte {
  65   look <- copy _look  # should be a no-op
  66   # read arg
- 67   result, look <- term look
+ 67   result, look <- term look
  68   $expression:loop: {
  69     # while next non-space char in ['+', '-']
- 70     look <- skip-spaces look
+ 70     look <- skip-spaces look
  71     {
- 72       var continue?/eax: boolean <- is-add-or-sub? look
+ 72       var continue?/eax: boolean <- is-add-or-sub? look
  73       compare continue?, 0  # false
  74       break-if-= $expression:loop
  75     }
@@ -137,10 +137,10 @@ if ('onhashchange' in window) {
  78     op, look <- operator look
  79     # read next arg
  80     var second/edx: int <- copy 0
- 81     look <- skip-spaces look
+ 81     look <- skip-spaces look
  82     {
  83       var tmp/eax: int <- copy 0
- 84       tmp, look <- term look
+ 84       tmp, look <- term look
  85       second <- copy tmp
  86     }
  87     # reduce
@@ -160,19 +160,19 @@ if ('onhashchange' in window) {
 101     }
 102     loop
 103   }
-104   look <- skip-spaces look
+104   look <- skip-spaces look
 105 }
 106 
-107 fn term _look: byte -> result/eax: int, look/esi: byte {
+107 fn term _look: byte -> result/eax: int, look/esi: byte {
 108   look <- copy _look  # should be a no-op
 109   # read arg
-110   look <- skip-spaces look
-111   result, look <- factor look
+110   look <- skip-spaces look
+111   result, look <- factor look
 112   $term:loop: {
 113     # while next non-space char in ['*', '/']
-114     look <- skip-spaces look
+114     look <- skip-spaces look
 115     {
-116       var continue?/eax: boolean <- is-mul-or-div? look
+116       var continue?/eax: boolean <- is-mul-or-div? look
 117       compare continue?, 0  # false
 118       break-if-= $term:loop
 119     }
@@ -181,10 +181,10 @@ if ('onhashchange' in window) {
 122     op, look <- operator look
 123     # read next arg
 124     var second/edx: int <- copy 0
-125     look <- skip-spaces look
+125     look <- skip-spaces look
 126     {
 127       var tmp/eax: int <- copy 0
-128       tmp, look <- factor look
+128       tmp, look <- factor look
 129       second <- copy tmp
 130     }
 131     # reduce
@@ -206,26 +206,26 @@ if ('onhashchange' in window) {
 147   }
 148 }
 149 
-150 fn factor _look: byte -> result/eax: int, look/esi: byte {
+150 fn factor _look: byte -> result/eax: int, look/esi: byte {
 151 $factor:body: {
 152   look <- copy _look  # should be a no-op
-153   look <- skip-spaces look
+153   look <- skip-spaces look
 154   # if next char is not '(', parse a number
 155   compare look, 0x28  # '('
 156   {
 157     break-if-=
-158     result, look <- num look
+158     result, look <- num look
 159     break $factor:body
 160   }
 161   # otherwise recurse
-162   look <- get-char  # '('
-163   result, look <- expression look
-164   look <- skip-spaces look
-165   look <- get-char  # ')'
+162   look <- get-char  # '('
+163   result, look <- expression look
+164   look <- skip-spaces look
+165   look <- get-char  # ')'
 166 }  # $factor:body
 167 }
 168 
-169 fn is-mul-or-div? c: byte -> result/eax: boolean {
+169 fn is-mul-or-div? c: byte -> result/eax: boolean {
 170 $is-mul-or-div?:body: {
 171   compare c, 0x2a  # '*'
 172   {
@@ -243,7 +243,7 @@ if ('onhashchange' in window) {
 184 }  # $is-mul-or-div?:body
 185 }
 186 
-187 fn is-add-or-sub? c: byte -> result/eax: boolean {
+187 fn is-add-or-sub? c: byte -> result/eax: boolean {
 188 $is-add-or-sub?:body: {
 189   compare c, 0x2b  # '+'
 190   {
@@ -263,20 +263,20 @@ if ('onhashchange' in window) {
 204 
 205 fn operator _look: byte -> op/ecx: byte, look/esi: byte {
 206   op <- copy _look
-207   look <- get-char
+207   look <- get-char
 208 }
 209 
-210 fn num _look: byte -> result/eax: int, look/esi: byte {
+210 fn num _look: byte -> result/eax: int, look/esi: byte {
 211   look <- copy _look  # should be a no-op
 212   var out/edi: int <- copy 0
 213   {
-214     var first-digit/eax: int <- to-decimal-digit look
+214     var first-digit/eax: int <- to-decimal-digit look
 215     out <- copy first-digit
 216   }
 217   {
-218     look <- get-char
+218     look <- get-char
 219     # done?
-220     var digit?/eax: boolean <- is-decimal-digit? look
+220     var digit?/eax: boolean <- is-decimal-digit? look
 221     compare digit?, 0  # false
 222     break-if-=
 223     # out *= 10
@@ -285,30 +285,30 @@ if ('onhashchange' in window) {
 226       out <- multiply ten
 227     }
 228     # out += digit(look)
-229     var digit/eax: int <- to-decimal-digit look
+229     var digit/eax: int <- to-decimal-digit look
 230     out <- add digit
 231     loop
 232   }
 233   result <- copy out
 234 }
 235 
-236 fn skip-spaces _look: byte -> look/esi: byte {
+236 fn skip-spaces _look: byte -> look/esi: byte {
 237   look <- copy _look  # should be a no-op
 238   {
 239     compare look, 0x20
 240     break-if-!=
-241     look <- get-char
+241     look <- get-char
 242     loop
 243   }
 244 }
 245 
-246 fn get-char -> look/esi: byte {
-247   var tmp/eax: byte <- read-key
+246 fn get-char -> look/esi: byte {
+247   var tmp/eax: byte <- read-key
 248   look <- copy tmp
 249   compare look, 0
 250   {
 251     break-if-!=
-252     print-string-to-screen "^D\n"
+252     print-string-to-screen "^D\n"
 253     syscall_exit
 254   }
 255 }
diff --git a/html/apps/assort.subx.html b/html/apps/assort.subx.html
index cd170945..16aeb653 100644
--- a/html/apps/assort.subx.html
+++ b/html/apps/assort.subx.html
@@ -92,10 +92,10 @@ if ('onhashchange' in window) {
   30     # initialize heap
   31     # . Heap = new-segment(Heap-size)
   32     # . . push args
-  33     68/push  Heap/imm32
-  34     ff          6/subop/push        0/mod/indirect  5/rm32/.disp32            .             .           .           Heap-size/disp32                  # push *Heap-size
+  33     68/push  Heap/imm32
+  34     ff          6/subop/push        0/mod/indirect  5/rm32/.disp32            .             .           .           Heap-size/disp32                  # push *Heap-size
   35     # . . call
-  36     e8/call  new-segment/disp32
+  36     e8/call  new-segment/disp32
   37     # . . discard args
   38     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
   39 
@@ -109,7 +109,7 @@ if ('onhashchange' in window) {
   47     68/push  "test"/imm32
   48     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
   49     # . . call
-  50     e8/call  kernel-string-equal?/disp32
+  50     e8/call  kernel-string-equal?/disp32
   51     # . . discard args
   52     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
   53     # . if (eax == false) goto interactive
@@ -118,7 +118,7 @@ if ('onhashchange' in window) {
   56     # run-tests()
   57     e8/call  run-tests/disp32
   58     # syscall(exit, *Num-test-failures)
-  59     8b/copy                         0/mod/indirect  5/rm32/.disp32            .             .           3/r32/ebx   Num-test-failures/disp32          # copy *Num-test-failures to ebx
+  59     8b/copy                         0/mod/indirect  5/rm32/.disp32            .             .           3/r32/ebx   Num-test-failures/disp32          # copy *Num-test-failures to ebx
   60     eb/jump  $subx-assort-main:end/disp8
   61 $subx-assort-main:interactive:
   62     # - otherwise convert stdin
@@ -131,9 +131,9 @@ if ('onhashchange' in window) {
   69     # subx-assort(Stdin, Stdout, Stderr, ed)
   70     # . . push args
   71     50/push-eax/ed
-  72     68/push  Stderr/imm32
-  73     68/push  Stdout/imm32
-  74     68/push  Stdin/imm32
+  72     68/push  Stderr/imm32
+  73     68/push  Stdout/imm32
+  74     68/push  Stdin/imm32
   75     # . . call
   76     e8/call  subx-assort/disp32
   77     # . . discard args
@@ -168,10 +168,10 @@ if ('onhashchange' in window) {
  106     # . . push args
  107     51/push-ecx
  108     # . . call
- 109     e8/call  clear-stream/disp32
+ 109     e8/call  clear-stream/disp32
  110     # . . discard args
  111     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
- 112 $subx-assort:read:
+ 112 $subx-assort:read:
  113 +--  9 lines: #?     # print("read\n") --------------------------------------------------------------------------------------------------------------------------------------------------
  122     # read-segments(in, table)
  123     # . . push args
@@ -181,7 +181,7 @@ if ('onhashchange' in window) {
  127     e8/call  read-segments/disp32
  128     # . . discard args
  129     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
- 130 $subx-assort:write:
+ 130 $subx-assort:write:
  131 +--  9 lines: #?     # print("write\n") -------------------------------------------------------------------------------------------------------------------------------------------------
  140     # write-segments(out, table)
  141     # . . push args
@@ -208,30 +208,30 @@ if ('onhashchange' in window) {
  162     # setup
  163     # . clear-stream(_test-input-stream)
  164     # . . push args
- 165     68/push  _test-input-stream/imm32
+ 165     68/push  _test-input-stream/imm32
  166     # . . call
- 167     e8/call  clear-stream/disp32
+ 167     e8/call  clear-stream/disp32
  168     # . . discard args
  169     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  170     # . clear-stream($_test-input-buffered-file->buffer)
  171     # . . push args
  172     68/push  $_test-input-buffered-file->buffer/imm32
  173     # . . call
- 174     e8/call  clear-stream/disp32
+ 174     e8/call  clear-stream/disp32
  175     # . . discard args
  176     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  177     # . clear-stream(_test-output-stream)
  178     # . . push args
- 179     68/push  _test-output-stream/imm32
+ 179     68/push  _test-output-stream/imm32
  180     # . . call
- 181     e8/call  clear-stream/disp32
+ 181     e8/call  clear-stream/disp32
  182     # . . discard args
  183     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  184     # . clear-stream($_test-output-buffered-file->buffer)
  185     # . . push args
  186     68/push  $_test-output-buffered-file->buffer/imm32
  187     # . . call
- 188     e8/call  clear-stream/disp32
+ 188     e8/call  clear-stream/disp32
  189     # . . discard args
  190     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  191     # initialize input (meta comments in parens)
@@ -252,128 +252,128 @@ if ('onhashchange' in window) {
  206     # . write(_test-input-stream, "# comment 1\n")
  207     # . . push args
  208     68/push  "# comment 1\n"/imm32
- 209     68/push  _test-input-stream/imm32
+ 209     68/push  _test-input-stream/imm32
  210     # . . call
- 211     e8/call  write/disp32
+ 211     e8/call  write/disp32
  212     # . . discard args
  213     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  214     # . write(_test-input-stream, "  # comment 2 indented\n")
  215     # . . push args
  216     68/push  "  # comment 2 indented\n"/imm32
- 217     68/push  _test-input-stream/imm32
+ 217     68/push  _test-input-stream/imm32
  218     # . . call
- 219     e8/call  write/disp32
+ 219     e8/call  write/disp32
  220     # . . discard args
  221     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  222     # . write(_test-input-stream, "== code 0x09000000\n")
  223     # . . push args
  224     68/push  "== code 0x09000000\n"/imm32
- 225     68/push  _test-input-stream/imm32
+ 225     68/push  _test-input-stream/imm32
  226     # . . call
- 227     e8/call  write/disp32
+ 227     e8/call  write/disp32
  228     # . . discard args
  229     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  230     # . write(_test-input-stream, "# comment 3 inside a segment\n")
  231     # . . push args
  232     68/push  "# comment 3 inside a segment\n"/imm32
- 233     68/push  _test-input-stream/imm32
+ 233     68/push  _test-input-stream/imm32
  234     # . . call
- 235     e8/call  write/disp32
+ 235     e8/call  write/disp32
  236     # . . discard args
  237     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  238     # . write(_test-input-stream, "1\n")
  239     # . . push args
  240     68/push  "1\n"/imm32
- 241     68/push  _test-input-stream/imm32
+ 241     68/push  _test-input-stream/imm32
  242     # . . call
- 243     e8/call  write/disp32
+ 243     e8/call  write/disp32
  244     # . . discard args
  245     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  246     # . write(_test-input-stream, "\n")  # empty line
  247     # . . push args
- 248     68/push  Newline/imm32
- 249     68/push  _test-input-stream/imm32
+ 248     68/push  Newline/imm32
+ 249     68/push  _test-input-stream/imm32
  250     # . . call
- 251     e8/call  write/disp32
+ 251     e8/call  write/disp32
  252     # . . discard args
  253     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  254     # . write(_test-input-stream, "2 3 # comment 4 inline with other contents\n")
  255     # . . push args
  256     68/push  "2 3 # comment 4 inline with other contents\n"/imm32
- 257     68/push  _test-input-stream/imm32
+ 257     68/push  _test-input-stream/imm32
  258     # . . call
- 259     e8/call  write/disp32
+ 259     e8/call  write/disp32
  260     # . . discard args
  261     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  262     # . write(_test-input-stream, "== data 0x0a000000\n")
  263     # . . push args
  264     68/push  "== data 0x0a000000\n"/imm32
- 265     68/push  _test-input-stream/imm32
+ 265     68/push  _test-input-stream/imm32
  266     # . . call
- 267     e8/call  write/disp32
+ 267     e8/call  write/disp32
  268     # . . discard args
  269     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  270     # . write(_test-input-stream, "4 5/imm32\n")
  271     # . . push args
  272     68/push  "4 5/imm32\n"/imm32
- 273     68/push  _test-input-stream/imm32
+ 273     68/push  _test-input-stream/imm32
  274     # . . call
- 275     e8/call  write/disp32
+ 275     e8/call  write/disp32
  276     # . . discard args
  277     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  278     # . write(_test-input-stream, "== code\n")
  279     # . . push args
  280     68/push  "== code\n"/imm32
- 281     68/push  _test-input-stream/imm32
+ 281     68/push  _test-input-stream/imm32
  282     # . . call
- 283     e8/call  write/disp32
+ 283     e8/call  write/disp32
  284     # . . discard args
  285     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  286     # . write(_test-input-stream, "6 7\n")
  287     # . . push args
  288     68/push  "6 7\n"/imm32
- 289     68/push  _test-input-stream/imm32
+ 289     68/push  _test-input-stream/imm32
  290     # . . call
- 291     e8/call  write/disp32
+ 291     e8/call  write/disp32
  292     # . . discard args
  293     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  294     # . write(_test-input-stream, "8 9\n")
  295     # . . push args
  296     68/push  "8 9\n"/imm32
- 297     68/push  _test-input-stream/imm32
+ 297     68/push  _test-input-stream/imm32
  298     # . . call
- 299     e8/call  write/disp32
+ 299     e8/call  write/disp32
  300     # . . discard args
  301     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  302     # . write(_test-input-stream, "== code\n")
  303     # . . push args
  304     68/push  "== code\n"/imm32
- 305     68/push  _test-input-stream/imm32
+ 305     68/push  _test-input-stream/imm32
  306     # . . call
- 307     e8/call  write/disp32
+ 307     e8/call  write/disp32
  308     # . . discard args
  309     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  310     # . write(_test-input-stream, "10 11\n")
  311     # . . push args
  312     68/push  "10 11\n"/imm32
- 313     68/push  _test-input-stream/imm32
+ 313     68/push  _test-input-stream/imm32
  314     # . . call
- 315     e8/call  write/disp32
+ 315     e8/call  write/disp32
  316     # . . discard args
  317     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  318     # subx-assort(_test-input-buffered-file, _test-output-buffered-file)
  319     # . . push args
- 320     68/push  _test-output-buffered-file/imm32
- 321     68/push  _test-input-buffered-file/imm32
+ 320     68/push  _test-output-buffered-file/imm32
+ 321     68/push  _test-input-buffered-file/imm32
  322     # . . call
  323     e8/call  subx-assort/disp32
  324     # . . discard args
  325     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  326     # . flush(_test-output-buffered-file)
  327     # . . push args
- 328     68/push  _test-output-buffered-file/imm32
+ 328     68/push  _test-output-buffered-file/imm32
  329     # . . call
- 330     e8/call  flush/disp32
+ 330     e8/call  flush/disp32
  331     # . . discard args
  332     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  333     # check output
@@ -390,72 +390,72 @@ if ('onhashchange' in window) {
  376     # . . push args
  377     68/push  "F - test-subx-assort/0"/imm32
  378     68/push  "== code 0x09000000"/imm32
- 379     68/push  _test-output-stream/imm32
+ 379     68/push  _test-output-stream/imm32
  380     # . . call
- 381     e8/call  check-next-stream-line-equal/disp32
+ 381     e8/call  check-next-stream-line-equal/disp32
  382     # . . discard args
  383     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  384     # . check-next-stream-line-equal(_test-output-stream, "1", msg)
  385     # . . push args
  386     68/push  "F - test-subx-assort/1"/imm32
  387     68/push  "1"/imm32
- 388     68/push  _test-output-stream/imm32
+ 388     68/push  _test-output-stream/imm32
  389     # . . call
- 390     e8/call  check-next-stream-line-equal/disp32
+ 390     e8/call  check-next-stream-line-equal/disp32
  391     # . . discard args
  392     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  393     # . check-next-stream-line-equal(_test-output-stream, "2 3 # comment 4 inline with other contents", msg)
  394     # . . push args
  395     68/push  "F - test-subx-assort/2"/imm32
  396     68/push  "2 3 # comment 4 inline with other contents"/imm32
- 397     68/push  _test-output-stream/imm32
+ 397     68/push  _test-output-stream/imm32
  398     # . . call
- 399     e8/call  check-next-stream-line-equal/disp32
+ 399     e8/call  check-next-stream-line-equal/disp32
  400     # . . discard args
  401     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  402     # . check-next-stream-line-equal(_test-output-stream, "6 7", msg)
  403     # . . push args
  404     68/push  "F - test-subx-assort/3"/imm32
  405     68/push  "6 7"/imm32
- 406     68/push  _test-output-stream/imm32
+ 406     68/push  _test-output-stream/imm32
  407     # . . call
- 408     e8/call  check-next-stream-line-equal/disp32
+ 408     e8/call  check-next-stream-line-equal/disp32
  409     # . . discard args
  410     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  411     # . check-next-stream-line-equal(_test-output-stream, "8 9", msg)
  412     # . . push args
  413     68/push  "F - test-subx-assort/4"/imm32
  414     68/push  "8 9"/imm32
- 415     68/push  _test-output-stream/imm32
+ 415     68/push  _test-output-stream/imm32
  416     # . . call
- 417     e8/call  check-next-stream-line-equal/disp32
+ 417     e8/call  check-next-stream-line-equal/disp32
  418     # . . discard args
  419     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  420     # . check-next-stream-line-equal(_test-output-stream, "10 11", msg)
  421     # . . push args
  422     68/push  "F - test-subx-assort/5"/imm32
  423     68/push  "10 11"/imm32
- 424     68/push  _test-output-stream/imm32
+ 424     68/push  _test-output-stream/imm32
  425     # . . call
- 426     e8/call  check-next-stream-line-equal/disp32
+ 426     e8/call  check-next-stream-line-equal/disp32
  427     # . . discard args
  428     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  429     # . check-next-stream-line-equal(_test-output-stream, "== data 0x0a000000", msg)
  430     # . . push args
  431     68/push  "F - test-subx-assort/6"/imm32
  432     68/push  "== data 0x0a000000"/imm32
- 433     68/push  _test-output-stream/imm32
+ 433     68/push  _test-output-stream/imm32
  434     # . . call
- 435     e8/call  check-next-stream-line-equal/disp32
+ 435     e8/call  check-next-stream-line-equal/disp32
  436     # . . discard args
  437     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  438     # . check-next-stream-line-equal(_test-output-stream, "4 5/imm32", msg)
  439     # . . push args
  440     68/push  "F - test-subx-assort/7"/imm32
  441     68/push  "4 5/imm32"/imm32
- 442     68/push  _test-output-stream/imm32
+ 442     68/push  _test-output-stream/imm32
  443     # . . call
- 444     e8/call  check-next-stream-line-equal/disp32
+ 444     e8/call  check-next-stream-line-equal/disp32
  445     # . . discard args
  446     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
  447     # . epilogue
@@ -522,7 +522,7 @@ if ('onhashchange' in window) {
  508     # . . push args
  509     51/push-ecx
  510     # . . call
- 511     e8/call  clear-stream/disp32
+ 511     e8/call  clear-stream/disp32
  512     # . . discard args
  513     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  514     # read-line-buffered(in, line)
@@ -530,7 +530,7 @@ if ('onhashchange' in window) {
  516     51/push-ecx
  517     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
  518     # . . call
- 519     e8/call  read-line-buffered/disp32
+ 519     e8/call  read-line-buffered/disp32
  520     # . . discard args
  521     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  522 $read-segments:check0:
@@ -543,7 +543,7 @@ if ('onhashchange' in window) {
  561     52/push-edx
  562     51/push-ecx
  563     # . . call
- 564     e8/call  next-word-or-string/disp32
+ 564     e8/call  next-word-or-string/disp32
  565     # . . discard args
  566     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  567 $read-segments:check1:
@@ -553,7 +553,7 @@ if ('onhashchange' in window) {
  579     # . . push args
  580     52/push-edx
  581     # . . call
- 582     e8/call  slice-empty?/disp32
+ 582     e8/call  slice-empty?/disp32
  583     # . . discard args
  584     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  585     # . if (eax != false) continue
@@ -579,7 +579,7 @@ if ('onhashchange' in window) {
  660     68/push  "=="/imm32
  661     52/push-edx
  662     # . . call
- 663     e8/call  slice-equal?/disp32
+ 663     e8/call  slice-equal?/disp32
  664     # . . discard args
  665     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  666     # . if (eax == false) goto next check
@@ -590,19 +590,19 @@ if ('onhashchange' in window) {
  671     52/push-edx
  672     51/push-ecx
  673     # . . call
- 674     e8/call  next-word-or-string/disp32
+ 674     e8/call  next-word-or-string/disp32
  675     # . . discard args
  676     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  677 +-- 40 lines: #?     # dump segment name ------------------------------------------------------------------------------------------------------------------------------------------------
  717     # var segment-slot/edi: (addr handle stream byte) = get-or-insert-slice(table, segment-name, row-size=16, Heap)
  718     # . eax = get-or-insert-slice(table, segment-name, row-size=16, Heap)
  719     # . . push args
- 720     68/push  Heap/imm32
+ 720     68/push  Heap/imm32
  721     68/push  0x10/imm32/row-size
  722     52/push-edx
  723     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
  724     # . . call
- 725     e8/call  get-or-insert-slice/disp32
+ 725     e8/call  get-or-insert-slice/disp32
  726     # . . discard args
  727     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
  728     # . edi = eax
@@ -617,7 +617,7 @@ if ('onhashchange' in window) {
  769     ff          6/subop/push        1/mod/*+disp8   7/rm32/edi    .           .             .           .           4/disp8         .                 # push *(edi+4)
  770     ff          6/subop/push        0/mod/indirect  7/rm32/edi    .           .             .           .           .               .                 # push *edi
  771     # . . call
- 772     e8/call  lookup/disp32
+ 772     e8/call  lookup/disp32
  773     # . . discard args
  774     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  775     # . ebx = eax
@@ -630,9 +630,9 @@ if ('onhashchange' in window) {
  782     57/push-edi
  783     68/push  1/imm32
  784     ff          6/subop/push        0/mod/indirect  5/rm32/.disp32            .             .           .           Segment-size/disp32               # push *Segment-size
- 785     68/push  Heap/imm32
+ 785     68/push  Heap/imm32
  786     # . . call
- 787     e8/call  new-stream/disp32
+ 787     e8/call  new-stream/disp32
  788     # . . discard args
  789     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
  790     # var curr-segment/ebx: (addr stream byte) = lookup(*segment-slot)
@@ -641,7 +641,7 @@ if ('onhashchange' in window) {
  793     ff          6/subop/push        1/mod/*+disp8   7/rm32/edi    .           .             .           .           4/disp8         .                 # push *(edi+4)
  794     ff          6/subop/push        0/mod/indirect  7/rm32/edi    .           .             .           .           .               .                 # push *edi
  795     # . . call
- 796     e8/call  lookup/disp32
+ 796     e8/call  lookup/disp32
  797     # . . discard args
  798     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  799     # . ebx = eax
@@ -657,7 +657,7 @@ if ('onhashchange' in window) {
  945     # . . push args
  946     51/push-ecx
  947     # . . call
- 948     e8/call  rewind-stream/disp32
+ 948     e8/call  rewind-stream/disp32
  949     # . . discard args
  950     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
  951 +--  9 lines: #?     # print("write stream\n") ------------------------------------------------------------------------------------------------------------------------------------------
@@ -666,7 +666,7 @@ if ('onhashchange' in window) {
  962     51/push-ecx
  963     53/push-ebx
  964     # . . call
- 965     e8/call  write-stream/disp32
+ 965     e8/call  write-stream/disp32
  966     # . . discard args
  967     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  968     # loop
@@ -722,7 +722,7 @@ if ('onhashchange' in window) {
 1026     ff          6/subop/push        1/mod/*+disp8   6/rm32/esi    .           .             .           .           0xc/disp8       .                 # push *(esi+12)
 1027     ff          6/subop/push        1/mod/*+disp8   6/rm32/esi    .           .             .           .           8/disp8         .                 # push *(esi+8)
 1028     # . . call
-1029     e8/call  lookup/disp32
+1029     e8/call  lookup/disp32
 1030     # . . discard args
 1031     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1032     # write-stream-data(out, stream)
@@ -730,7 +730,7 @@ if ('onhashchange' in window) {
 1034     50/push-eax
 1035     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
 1036     # . . call
-1037     e8/call  write-stream-data/disp32
+1037     e8/call  write-stream-data/disp32
 1038     # . . discard args
 1039     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 1040 $write-segments:continue:
@@ -742,7 +742,7 @@ if ('onhashchange' in window) {
 1046     # . . push args
 1047     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
 1048     # . . call
-1049     e8/call  flush/disp32
+1049     e8/call  flush/disp32
 1050     # . . discard args
 1051     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 1052 $write-segments:end:
diff --git a/html/apps/braces.subx.html b/html/apps/braces.subx.html
index 2155eafb..147a0fae 100644
--- a/html/apps/braces.subx.html
+++ b/html/apps/braces.subx.html
@@ -113,21 +113,21 @@ if ('onhashchange' in window) {
  54     # . prologue
  55     89/<- %ebp 4/r32/esp
  56     # initialize heap
- 57     (new-segment *Heap-size Heap)
+ 57     (new-segment *Heap-size Heap)
  58     # if (argc <= 1) goto interactive
  59     81 7/subop/compare *ebp 1/imm32
  60     7e/jump-if-<= $subx-braces-main:interactive/disp8
  61     # if (argv[1] != "test")) goto interactive
- 62     (kernel-string-equal? *(ebp+8) "test")  # => eax
+ 62     (kernel-string-equal? *(ebp+8) "test")  # => eax
  63     3d/compare-eax-and 0/imm32/false
  64     74/jump-if-= $subx-braces-main:interactive/disp8
  65     #
  66     (run-tests)
  67     # syscall(exit, *Num-test-failures)
- 68     8b/-> *Num-test-failures 3/r32/ebx
+ 68     8b/-> *Num-test-failures 3/r32/ebx
  69     eb/jump $subx-braces-main:end/disp8
  70 $subx-braces-main:interactive:
- 71     (subx-braces Stdin Stdout)
+ 71     (subx-braces Stdin Stdout)
  72     # syscall(exit, 0)
  73     bb/copy-to-ebx 0/imm32
  74 $subx-braces-main:end:
@@ -199,13 +199,13 @@ if ('onhashchange' in window) {
 140     68/push 0/imm32/start
 141     89/<- %edi 4/r32/esp
 142 $subx-braces:line-loop:
-143     (clear-stream %ecx)
-144     (read-line-buffered %esi %ecx)
+143     (clear-stream %ecx)
+144     (read-line-buffered %esi %ecx)
 145 $subx-braces:check0:
 146     # if (line->write == 0) break
 147     81 7/subop/compare *ecx 0/imm32
 148     0f 84/jump-if-=  $subx-braces:break/disp32
-149     (skip-chars-matching-whitespace %ecx)
+149     (skip-chars-matching-whitespace %ecx)
 150 $subx-braces:check-for-curly-open:
 151     # if (line->data[line->read] != '{') goto next check
 152     # . eax = line->data[line->read]
@@ -217,11 +217,11 @@ if ('onhashchange' in window) {
 158     0f 85/jump-if-!= $subx-braces:check-for-curly-closed/disp32
 159 $subx-braces:emit-curly-open:
 160     # print(out, "_loop" next-label-id ":")
-161     (write-buffered *(ebp+0xc) "_loop")
-162     (write-int32-hex-buffered *(ebp+0xc) %ebx)
-163     (write-buffered *(ebp+0xc) ":")
+161     (write-buffered *(ebp+0xc) "_loop")
+162     (write-int32-hex-buffered *(ebp+0xc) %ebx)
+163     (write-buffered *(ebp+0xc) ":")
 164     # push(label-stack, next-label-id)
-165     (push %edx %ebx)
+165     (push %edx %ebx)
 166     # ++next-label-id
 167     ff 0/subop/increment %ebx
 168     # continue
@@ -232,18 +232,18 @@ if ('onhashchange' in window) {
 173     0f 85/jump-if-= $subx-braces:word-loop/disp32
 174 $subx-braces:emit-curly-closed:
 175     # eax = pop(label-stack)
-176     (pop %edx)
+176     (pop %edx)
 177     # print(out, "_break" eax ":")
-178     (write-buffered *(ebp+0xc) "_break")
-179     (write-int32-hex-buffered *(ebp+0xc) %eax)
-180     (write-buffered *(ebp+0xc) ":")
+178     (write-buffered *(ebp+0xc) "_break")
+179     (write-int32-hex-buffered *(ebp+0xc) %eax)
+180     (write-buffered *(ebp+0xc) ":")
 181     # continue
 182     e9/jump  $subx-braces:next-line/disp32
 183 $subx-braces:word-loop:
-184     (next-word-or-string %ecx %edi)
+184     (next-word-or-string %ecx %edi)
 185 $subx-braces:check1:
 186     # if (slice-empty?(word-slice)) break
-187     (slice-empty? %edi)
+187     (slice-empty? %edi)
 188     3d/compare-eax-and 0/imm32/false
 189     0f 85/jump-if-!= $subx-braces:next-line/disp32
 190 $subx-braces:check-for-comment:
@@ -258,15 +258,15 @@ if ('onhashchange' in window) {
 199 $subx-braces:check-for-break:
 200     # if (!slice-starts-with?(word-slice, "break/")) goto next check
 201     # . eax = slice-starts-with?(word-slice, "break/")
-202     (slice-starts-with? %edi "break/")
+202     (slice-starts-with? %edi "break/")
 203     # . if (eax == false) goto next check
 204     3d/compare-eax-and 0/imm32/false
 205     74/jump-if-= $subx-braces:check-for-loop/disp8
 206 $subx-braces:emit-break:
-207     (top %edx)
+207     (top %edx)
 208     # print(out, "_break" eax)
-209     (write-buffered *(ebp+0xc) "_break")
-210     (write-int32-hex-buffered *(ebp+0xc) %eax)
+209     (write-buffered *(ebp+0xc) "_break")
+210     (write-int32-hex-buffered *(ebp+0xc) %eax)
 211     # word-slice->start += len("break")
 212     81 0/subop/add *edi 5/imm32/strlen
 213     # emit rest of word as usual
@@ -274,31 +274,31 @@ if ('onhashchange' in window) {
 215 $subx-braces:check-for-loop:
 216     # if (!slice-starts-with?(word-slice, "loop/")) emit word
 217     # . eax = slice-starts-with?(word-slice, "loop/")
-218     (slice-starts-with? %edi "loop/")
+218     (slice-starts-with? %edi "loop/")
 219     # . if (eax == false) goto next check
 220     3d/compare-eax-and 0/imm32/false
 221     74/jump-if-= $subx-braces:emit-word-slice/disp8
 222 $subx-braces:emit-loop:
-223     (top %edx)
+223     (top %edx)
 224     # print(out, "_loop" eax)
-225     (write-buffered *(ebp+0xc) "_loop")
-226     (write-int32-hex-buffered *(ebp+0xc) %eax)
+225     (write-buffered *(ebp+0xc) "_loop")
+226     (write-int32-hex-buffered *(ebp+0xc) %eax)
 227     # word-slice->start += len("loop")
 228     81 0/subop/add *edi 4/imm32/strlen
 229     # fall through
 230 $subx-braces:emit-word-slice:
 231     # print(out, word-slice " ")
-232     (write-slice-buffered *(ebp+0xc) %edi)
-233     (write-buffered *(ebp+0xc) Space)
+232     (write-slice-buffered *(ebp+0xc) %edi)
+233     (write-buffered *(ebp+0xc) Space)
 234     # loop to next word
 235     e9/jump $subx-braces:word-loop/disp32
 236 $subx-braces:next-line:
 237     # print(out, "\n")
-238     (write-buffered *(ebp+0xc) Newline)
+238     (write-buffered *(ebp+0xc) Newline)
 239     # loop to next line
 240     e9/jump $subx-braces:line-loop/disp32
 241 $subx-braces:break:
-242     (flush *(ebp+0xc))
+242     (flush *(ebp+0xc))
 243 $subx-braces:end:
 244     # . reclaim locals
 245     81 0/subop/add %esp 0x29c/imm32
@@ -319,17 +319,17 @@ if ('onhashchange' in window) {
 260     55/push-ebp
 261     89/<- %ebp 4/r32/esp
 262     # setup
-263     (clear-stream _test-input-stream)
-264     (clear-stream _test-output-stream)
-265     (clear-stream $_test-input-buffered-file->buffer)
-266     (clear-stream $_test-output-buffered-file->buffer)
+263     (clear-stream _test-input-stream)
+264     (clear-stream _test-output-stream)
+265     (clear-stream $_test-input-buffered-file->buffer)
+266     (clear-stream $_test-output-buffered-file->buffer)
 267     # test
-268     (write _test-input-stream "== abcd 0x1")
-269     (subx-braces _test-input-buffered-file _test-output-buffered-file)
+268     (write _test-input-stream "== abcd 0x1")
+269     (subx-braces _test-input-buffered-file _test-output-buffered-file)
 270     # check that the line just passed through
-271     (flush _test-output-buffered-file)
+271     (flush _test-output-buffered-file)
 272 +--  5 lines: #?     # dump _test-output-stream -----------------------------------------------------------------------------------------------------------------------------------------
-277     (check-stream-equal _test-output-stream "== abcd 0x1 \n" "F - test-subx-braces-passes-most-words-through")
+277     (check-stream-equal _test-output-stream "== abcd 0x1 \n" "F - test-subx-braces-passes-most-words-through")
 278     # . epilogue
 279     89/<- %esp 5/r32/ebp
 280     5d/pop-to-ebp
@@ -352,17 +352,17 @@ if ('onhashchange' in window) {
 297     55/push-ebp
 298     89/<- %ebp 4/r32/esp
 299     # setup
-300     (clear-stream _test-input-stream)
-301     (clear-stream _test-output-stream)
-302     (clear-stream $_test-input-buffered-file->buffer)
-303     (clear-stream $_test-output-buffered-file->buffer)
+300     (clear-stream _test-input-stream)
+301     (clear-stream _test-output-stream)
+302     (clear-stream $_test-input-buffered-file->buffer)
+303     (clear-stream $_test-output-buffered-file->buffer)
 304     # test
-305     (write _test-input-stream "{\nab break/imm32\ncd loop/imm32\n}")
-306     (subx-braces _test-input-buffered-file _test-output-buffered-file)
+305     (write _test-input-stream "{\nab break/imm32\ncd loop/imm32\n}")
+306     (subx-braces _test-input-buffered-file _test-output-buffered-file)
 307     # check that the line just passed through
-308     (flush _test-output-buffered-file)
+308     (flush _test-output-buffered-file)
 309 +--  5 lines: #?     # dump _test-output-stream -----------------------------------------------------------------------------------------------------------------------------------------
-314     (check-stream-equal _test-output-stream "_loop0x00000001:\nab _break0x00000001/imm32 \ncd _loop0x00000001/imm32 \n_break0x00000001:\n" "F - test-subx-braces-1")
+314     (check-stream-equal _test-output-stream "_loop0x00000001:\nab _break0x00000001/imm32 \ncd _loop0x00000001/imm32 \n_break0x00000001:\n" "F - test-subx-braces-1")
 315     # . epilogue
 316     89/<- %esp 5/r32/ebp
 317     5d/pop-to-ebp
@@ -389,17 +389,17 @@ if ('onhashchange' in window) {
 338     55/push-ebp
 339     89/<- %ebp 4/r32/esp
 340     # setup
-341     (clear-stream _test-input-stream)
-342     (clear-stream _test-output-stream)
-343     (clear-stream $_test-input-buffered-file->buffer)
-344     (clear-stream $_test-output-buffered-file->buffer)
+341     (clear-stream _test-input-stream)
+342     (clear-stream _test-output-stream)
+343     (clear-stream $_test-input-buffered-file->buffer)
+344     (clear-stream $_test-output-buffered-file->buffer)
 345     # test
-346     (write _test-input-stream "{\n{\nab break/imm32\n}\ncd loop/imm32\n}")
-347     (subx-braces _test-input-buffered-file _test-output-buffered-file)
+346     (write _test-input-stream "{\n{\nab break/imm32\n}\ncd loop/imm32\n}")
+347     (subx-braces _test-input-buffered-file _test-output-buffered-file)
 348     # check that the line just passed through
-349     (flush _test-output-buffered-file)
+349     (flush _test-output-buffered-file)
 350 +--  5 lines: #?     # dump _test-output-stream -----------------------------------------------------------------------------------------------------------------------------------------
-355     (check-stream-equal _test-output-stream "_loop0x00000001:\n_loop0x00000002:\nab _break0x00000002/imm32 \n_break0x00000002:\ncd _loop0x00000001/imm32 \n_break0x00000001:\n" "F - test-subx-braces-2")
+355     (check-stream-equal _test-output-stream "_loop0x00000001:\n_loop0x00000002:\nab _break0x00000002/imm32 \n_break0x00000002:\ncd _loop0x00000001/imm32 \n_break0x00000001:\n" "F - test-subx-braces-2")
 356     # . epilogue
 357     89/<- %esp 5/r32/ebp
 358     5d/pop-to-ebp
diff --git a/html/apps/browse.mu.html b/html/apps/browse.mu.html
index b7314157..a587f8d5 100644
--- a/html/apps/browse.mu.html
+++ b/html/apps/browse.mu.html
@@ -67,19 +67,19 @@ if ('onhashchange' in window) {
   8 
   9 fn main args-on-stack: (addr array (addr array byte)) -> exit-status/ebx: int {
  10 +-- 20 lines: # var file/esi: (addr buffered-file) = open args-on-stack[1] for reading --------------------------------------------------------------------------------------------------
- 30   enable-screen-grid-mode
+ 30   enable-screen-grid-mode
  31   var nrows/eax: int <- copy 0
  32   var ncols/ecx: int <- copy 0
- 33   nrows, ncols <- screen-size
- 34   enable-keyboard-immediate-mode
+ 33   nrows, ncols <- screen-size
+ 34   enable-keyboard-immediate-mode
  35   {
  36     render file, nrows, ncols
- 37     var key/eax: byte <- read-key
+ 37     var key/eax: byte <- read-key
  38     compare key, 0x71  # 'q'
  39     loop-if-!=
  40   }
- 41   enable-keyboard-type-mode
- 42   enable-screen-type-mode
+ 41   enable-keyboard-type-mode
+ 42   enable-screen-type-mode
  43   exit-status <- copy 0
  44 }
  45 
@@ -105,7 +105,7 @@ if ('onhashchange' in window) {
  65   var leftcol/edx: int <- copy 5  # page-margin
  66   var rightcol/ebx: int <- copy leftcol
  67   rightcol <- add 0x40  # page-width = 64 characters
- 68   start-color-on-screen 0xec, 7  # 236 = darkish gray
+ 68   start-color-on-screen 0xec, 7  # 236 = darkish gray
  69   {
  70     compare rightcol, ncols
  71     break-if->=
@@ -126,17 +126,17 @@ if ('onhashchange' in window) {
  86     compare row, botrow
  87     break-if->=
  88     var col/edx: int <- copy leftcol
- 89     move-cursor-on-screen row, col
+ 89     move-cursor-on-screen row, col
  90     {
  91       compare col, rightcol
  92       break-if->=
- 93       var c/eax: byte <- read-byte-buffered in
+ 93       var c/eax: byte <- read-byte-buffered in
  94       compare c, 0xffffffff  # EOF marker
  95       break-if-= $line-loop
  96       update-attributes c, r
  97       compare c, 0xa  # newline
  98       break-if-=  # no need to print newlines
- 99       print-byte-to-screen c
+ 99       print-byte-to-screen c
 100       col <- increment
 101       loop
 102     }
@@ -147,7 +147,7 @@ if ('onhashchange' in window) {
 107 
 108 fn update-attributes c: byte, _r: (addr render-state) {
 109   var r/edi: (addr render-state) <- copy _r
-110   var state/esi: (addr int) <- get r, current-state
+110   var state/esi: (addr int) <- get r, current-state
 111 $update-attributes:check-state: {
 112     compare *state, 0  # normal
 113     {
@@ -156,7 +156,7 @@ if ('onhashchange' in window) {
 116       {
 117         break-if-!=
 118         # r->current-state == 0 && c == '*'
-119         start-bold-on-screen
+119         start-bold-on-screen
 120         copy-to *state, 1
 121         break $update-attributes:check-state
 122       }
@@ -164,7 +164,7 @@ if ('onhashchange' in window) {
 124       {
 125         break-if-!=
 126         # r->current-state == 0 && c == '_'
-127         start-bold-on-screen
+127         start-bold-on-screen
 128         copy-to *state, 1
 129         break $update-attributes:check-state
 130       }
@@ -176,7 +176,7 @@ if ('onhashchange' in window) {
 136       {
 137         break-if-!=
 138         # r->current-state == 1 && c == '*'
-139         reset-formatting-on-screen
+139         reset-formatting-on-screen
 140         copy-to *state, 0
 141         break $update-attributes:check-state
 142       }
@@ -184,7 +184,7 @@ if ('onhashchange' in window) {
 144       {
 145         break-if-!=
 146         # r->current-state == 1 && c == '_'
-147         reset-formatting-on-screen
+147         reset-formatting-on-screen
 148         copy-to *state, 0
 149         break $update-attributes:check-state
 150       }
@@ -199,11 +199,11 @@ if ('onhashchange' in window) {
 159     compare row, botrow
 160     break-if->=
 161     var col/edx: int <- copy leftcol
-162     move-cursor-on-screen row, col
+162     move-cursor-on-screen row, col
 163     {
 164       compare col, rightcol
 165       break-if->=
-166       print-string-to-screen " "
+166       print-string-to-screen " "
 167       col <- increment
 168       loop
 169     }
@@ -213,10 +213,10 @@ if ('onhashchange' in window) {
 173 }
 174 
 175 fn dump in: (addr buffered-file) {
-176   var c/eax: byte <- read-byte-buffered in
+176   var c/eax: byte <- read-byte-buffered in
 177   compare c, 0xffffffff  # EOF marker
 178   break-if-=
-179   print-byte-to-screen c
+179   print-byte-to-screen c
 180   loop
 181 }
 
diff --git a/html/apps/calls.subx.html b/html/apps/calls.subx.html index d80ca4b0..1058a91f 100644 --- a/html/apps/calls.subx.html +++ b/html/apps/calls.subx.html @@ -92,10 +92,10 @@ if ('onhashchange' in window) { 31 # initialize heap 32 # . Heap = new-segment(Heap-size) 33 # . . push args - 34 68/push Heap/imm32 - 35 ff 6/subop/push *Heap-size + 34 68/push Heap/imm32 + 35 ff 6/subop/push *Heap-size 36 # . . call - 37 e8/call new-segment/disp32 + 37 e8/call new-segment/disp32 38 # . . discard args 39 81 0/subop/add %esp 8/imm32 40 @@ -109,7 +109,7 @@ if ('onhashchange' in window) { 48 68/push "test"/imm32 49 ff 6/subop/push *(ebp+8) 50 # . . call - 51 e8/call kernel-string-equal?/disp32 + 51 e8/call kernel-string-equal?/disp32 52 # . . discard args 53 81 0/subop/add %esp 8/imm32 54 # . if (eax == false) goto run-main @@ -118,14 +118,14 @@ if ('onhashchange' in window) { 57 # run-tests() 58 e8/call run-tests/disp32 59 # syscall(exit, *Num-test-failures) - 60 8b/-> *Num-test-failures 3/r32/ebx + 60 8b/-> *Num-test-failures 3/r32/ebx 61 eb/jump $subx-calls-main:end/disp8 62 $subx-calls-main:interactive: 63 # - otherwise convert stdin 64 # subx-calls(Stdin, Stdout) 65 # . . push args - 66 68/push Stdout/imm32 - 67 68/push Stdin/imm32 + 66 68/push Stdout/imm32 + 67 68/push Stdin/imm32 68 # . . call 69 e8/call subx-calls/disp32 70 # . . discard args @@ -182,7 +182,7 @@ if ('onhashchange' in window) { 121 # . . push args 122 56/push-esi 123 # . . call - 124 e8/call clear-stream/disp32 + 124 e8/call clear-stream/disp32 125 # . . discard args 126 81 0/subop/add %esp 4/imm32 127 # read-line-buffered(in, line) @@ -190,7 +190,7 @@ if ('onhashchange' in window) { 129 56/push-esi 130 ff 6/subop/push *(ebp+8) 131 # . . call - 132 e8/call read-line-buffered/disp32 + 132 e8/call read-line-buffered/disp32 133 # . . discard args 134 81 0/subop/add %esp 8/imm32 135 $subx-calls:check0: @@ -202,7 +202,7 @@ if ('onhashchange' in window) { 141 68/push 0x20/imm32/space 142 56/push-esi 143 # . . call - 144 e8/call skip-chars-matching/disp32 + 144 e8/call skip-chars-matching/disp32 145 # . . discard args 146 81 0/subop/add %esp 8/imm32 147 # if (line->data[line->read] == '(') goto convert-call @@ -220,7 +220,7 @@ if ('onhashchange' in window) { 159 56/push-esi 160 ff 6/subop/push *(ebp+0xc) 161 # . . call - 162 e8/call write-stream-data/disp32 + 162 e8/call write-stream-data/disp32 163 # . . discard args 164 81 0/subop/add %esp 8/imm32 165 # continue @@ -232,7 +232,7 @@ if ('onhashchange' in window) { 171 68/push "# . "/imm32 172 ff 6/subop/push *(ebp+0xc) 173 # . . call - 174 e8/call write-buffered/disp32 + 174 e8/call write-buffered/disp32 175 # . . discard args 176 81 0/subop/add %esp 8/imm32 177 # write-stream-data(out, line) @@ -240,7 +240,7 @@ if ('onhashchange' in window) { 179 56/push-esi 180 ff 6/subop/push *(ebp+0xc) 181 # . . call - 182 e8/call write-stream-data/disp32 + 182 e8/call write-stream-data/disp32 183 # . . discard args 184 81 0/subop/add %esp 8/imm32 185 # - emit code @@ -250,7 +250,7 @@ if ('onhashchange' in window) { 189 # . . push args 190 52/push-edx 191 # . . call - 192 e8/call clear-stream/disp32 + 192 e8/call clear-stream/disp32 193 # . . discard args 194 81 0/subop/add %esp 4/imm32 195 # words = parse-line(line) @@ -276,7 +276,7 @@ if ('onhashchange' in window) { 215 # . . push args 216 ff 6/subop/push *(ebp+0xc) 217 # . . call - 218 e8/call flush/disp32 + 218 e8/call flush/disp32 219 # . . discard args 220 81 0/subop/add %esp 4/imm32 221 $subx-calls:end: @@ -326,7 +326,7 @@ if ('onhashchange' in window) { 265 # . . push args 266 51/push-ecx 267 # . . call - 268 e8/call slice-empty?/disp32 + 268 e8/call slice-empty?/disp32 269 # . . discard args 270 81 0/subop/add %esp 4/imm32 271 # . if (eax != false) break @@ -339,7 +339,7 @@ if ('onhashchange' in window) { 317 ff 6/subop/push *ecx 318 ff 6/subop/push *(ebp+0xc) 319 # . . call - 320 e8/call write-int/disp32 + 320 e8/call write-int/disp32 321 # . . discard args 322 81 0/subop/add %esp 8/imm32 323 # write-int(words, word-slice->end) @@ -347,7 +347,7 @@ if ('onhashchange' in window) { 325 ff 6/subop/push *(ecx+4) 326 ff 6/subop/push *(ebp+0xc) 327 # . . call - 328 e8/call write-int/disp32 + 328 e8/call write-int/disp32 329 # . . discard args 330 81 0/subop/add %esp 8/imm32 331 # loop @@ -429,7 +429,7 @@ if ('onhashchange' in window) { 407 68/push "68/push "/imm32 408 ff 6/subop/push *(ebp+8) 409 # . . call - 410 e8/call write-buffered/disp32 + 410 e8/call write-buffered/disp32 411 # . . discard args 412 81 0/subop/add %esp 8/imm32 413 # write-slice-buffered(out, curr) @@ -437,14 +437,14 @@ if ('onhashchange' in window) { 415 51/push-ecx 416 ff 6/subop/push *(ebp+8) 417 # . . call - 418 e8/call write-slice-buffered/disp32 + 418 e8/call write-slice-buffered/disp32 419 # . . discard args 420 81 0/subop/add %esp 8/imm32 421 # write-buffered(out, "/imm32\n") 422 68/push "/imm32\n"/imm32 423 ff 6/subop/push *(ebp+8) 424 # . . call - 425 e8/call write-buffered/disp32 + 425 e8/call write-buffered/disp32 426 # . . discard args 427 81 0/subop/add %esp 8/imm32 428 # continue @@ -455,7 +455,7 @@ if ('onhashchange' in window) { 433 68/push "ff 6/subop/push "/imm32 434 ff 6/subop/push *(ebp+8) 435 # . . call - 436 e8/call write-buffered/disp32 + 436 e8/call write-buffered/disp32 437 # . . discard args 438 81 0/subop/add %esp 8/imm32 439 # write-slice-buffered(out, curr) @@ -463,14 +463,14 @@ if ('onhashchange' in window) { 441 51/push-ecx 442 ff 6/subop/push *(ebp+8) 443 # . . call - 444 e8/call write-slice-buffered/disp32 + 444 e8/call write-slice-buffered/disp32 445 # . . discard args 446 81 0/subop/add %esp 8/imm32 447 # write-buffered(out, "\n") - 448 68/push Newline/imm32 + 448 68/push Newline/imm32 449 ff 6/subop/push *(ebp+8) 450 # . . call - 451 e8/call write-buffered/disp32 + 451 e8/call write-buffered/disp32 452 # . . discard args 453 81 0/subop/add %esp 8/imm32 454 $emit-call:next-push: @@ -483,7 +483,7 @@ if ('onhashchange' in window) { 461 68/push "e8/call "/imm32 462 ff 6/subop/push *(ebp+8) 463 # . . call - 464 e8/call write-buffered/disp32 + 464 e8/call write-buffered/disp32 465 # . . discard args 466 81 0/subop/add %esp 8/imm32 467 # write-slice-buffered(out, curr) @@ -491,14 +491,14 @@ if ('onhashchange' in window) { 469 51/push-ecx 470 ff 6/subop/push *(ebp+8) 471 # . . call - 472 e8/call write-slice-buffered/disp32 + 472 e8/call write-slice-buffered/disp32 473 # . . discard args 474 81 0/subop/add %esp 8/imm32 475 # write-buffered(out, "/disp32\n") 476 68/push "/disp32\n"/imm32 477 ff 6/subop/push *(ebp+8) 478 # . . call - 479 e8/call write-buffered/disp32 + 479 e8/call write-buffered/disp32 480 # . . discard args 481 81 0/subop/add %esp 8/imm32 482 $emit-call:pop-instruction: @@ -506,7 +506,7 @@ if ('onhashchange' in window) { 484 68/push "81 0/subop/add %esp "/imm32 485 ff 6/subop/push *(ebp+8) 486 # . . call - 487 e8/call write-buffered/disp32 + 487 e8/call write-buffered/disp32 488 # . . discard args 489 81 0/subop/add %esp 8/imm32 490 # write-int32-hex-buffered(out, words->write >> 1 - 4) @@ -517,14 +517,14 @@ if ('onhashchange' in window) { 495 50/push-eax 496 ff 6/subop/push *(ebp+8) 497 # . . call - 498 e8/call write-int32-hex-buffered/disp32 + 498 e8/call write-int32-hex-buffered/disp32 499 # . . discard args 500 81 0/subop/add %esp 8/imm32 501 # write-buffered(out, "/imm32\n") 502 68/push "/imm32\n"/imm32 503 ff 6/subop/push *(ebp+8) 504 # . . call - 505 e8/call write-buffered/disp32 + 505 e8/call write-buffered/disp32 506 # . . discard args 507 81 0/subop/add %esp 8/imm32 508 $emit-call:end: @@ -543,16 +543,16 @@ if ('onhashchange' in window) { 521 # . write-buffered(Stderr, "error: calls.subx: '()' is not a valid call") 522 # . . push args 523 68/push "error: calls.subx: '()' is not a valid call"/imm32 - 524 68/push Stderr/imm32 + 524 68/push Stderr/imm32 525 # . . call - 526 e8/call write-buffered/disp32 + 526 e8/call write-buffered/disp32 527 # . . discard args 528 81 0/subop/add %esp 8/imm32 529 # . flush(Stderr) 530 # . . push args - 531 68/push Stderr/imm32 + 531 68/push Stderr/imm32 532 # . . call - 533 e8/call flush/disp32 + 533 e8/call flush/disp32 534 # . . discard args 535 81 0/subop/add %esp 4/imm32 536 # . syscall(exit, 1) @@ -567,44 +567,44 @@ if ('onhashchange' in window) { 545 # setup 546 # . clear-stream(_test-input-stream) 547 # . . push args - 548 68/push _test-input-stream/imm32 + 548 68/push _test-input-stream/imm32 549 # . . call - 550 e8/call clear-stream/disp32 + 550 e8/call clear-stream/disp32 551 # . . discard args 552 81 0/subop/add %esp 4/imm32 553 # . clear-stream($_test-input-buffered-file->buffer) 554 # . . push args 555 68/push $_test-input-buffered-file->buffer/imm32 556 # . . call - 557 e8/call clear-stream/disp32 + 557 e8/call clear-stream/disp32 558 # . . discard args 559 81 0/subop/add %esp 4/imm32 560 # . clear-stream(_test-output-stream) 561 # . . push args - 562 68/push _test-output-stream/imm32 + 562 68/push _test-output-stream/imm32 563 # . . call - 564 e8/call clear-stream/disp32 + 564 e8/call clear-stream/disp32 565 # . . discard args 566 81 0/subop/add %esp 4/imm32 567 # . clear-stream($_test-output-buffered-file->buffer) 568 # . . push args 569 68/push $_test-output-buffered-file->buffer/imm32 570 # . . call - 571 e8/call clear-stream/disp32 + 571 e8/call clear-stream/disp32 572 # . . discard args 573 81 0/subop/add %esp 4/imm32 574 # . write(_test-input-stream, "== abcd 0x1\n") 575 # . . push args 576 68/push "== abcd 0x1\n"/imm32 - 577 68/push _test-input-stream/imm32 + 577 68/push _test-input-stream/imm32 578 # . . call - 579 e8/call write/disp32 + 579 e8/call write/disp32 580 # . . discard args 581 81 0/subop/add %esp 8/imm32 582 # subx-calls(_test-input-buffered-file, _test-output-buffered-file) 583 # . . push args - 584 68/push _test-output-buffered-file/imm32 - 585 68/push _test-input-buffered-file/imm32 + 584 68/push _test-output-buffered-file/imm32 + 585 68/push _test-input-buffered-file/imm32 586 # . . call 587 e8/call subx-calls/disp32 588 # . . discard args @@ -612,18 +612,18 @@ if ('onhashchange' in window) { 590 # check that the line just passed through 591 # . flush(_test-output-buffered-file) 592 # . . push args - 593 68/push _test-output-buffered-file/imm32 + 593 68/push _test-output-buffered-file/imm32 594 # . . call - 595 e8/call flush/disp32 + 595 e8/call flush/disp32 596 # . . discard args 597 81 0/subop/add %esp 4/imm32 598 # . check-stream-equal(_test-output-stream, "== abcd 0x1\n", msg) 599 # . . push args 600 68/push "F - test-subx-calls-passes-most-lines-through"/imm32 601 68/push "== abcd 0x1\n"/imm32 - 602 68/push _test-output-stream/imm32 + 602 68/push _test-output-stream/imm32 603 # . . call - 604 e8/call check-stream-equal/disp32 + 604 e8/call check-stream-equal/disp32 605 # . . discard args 606 81 0/subop/add %esp 0xc/imm32 607 # . epilogue @@ -638,44 +638,44 @@ if ('onhashchange' in window) { 616 # setup 617 # . clear-stream(_test-input-stream) 618 # . . push args - 619 68/push _test-input-stream/imm32 + 619 68/push _test-input-stream/imm32 620 # . . call - 621 e8/call clear-stream/disp32 + 621 e8/call clear-stream/disp32 622 # . . discard args 623 81 0/subop/add %esp 4/imm32 624 # . clear-stream($_test-input-buffered-file->buffer) 625 # . . push args 626 68/push $_test-input-buffered-file->buffer/imm32 627 # . . call - 628 e8/call clear-stream/disp32 + 628 e8/call clear-stream/disp32 629 # . . discard args 630 81 0/subop/add %esp 4/imm32 631 # . clear-stream(_test-output-stream) 632 # . . push args - 633 68/push _test-output-stream/imm32 + 633 68/push _test-output-stream/imm32 634 # . . call - 635 e8/call clear-stream/disp32 + 635 e8/call clear-stream/disp32 636 # . . discard args 637 81 0/subop/add %esp 4/imm32 638 # . clear-stream($_test-output-buffered-file->buffer) 639 # . . push args 640 68/push $_test-output-buffered-file->buffer/imm32 641 # . . call - 642 e8/call clear-stream/disp32 + 642 e8/call clear-stream/disp32 643 # . . discard args 644 81 0/subop/add %esp 4/imm32 645 # . write(_test-input-stream, "(foo %eax)\n") 646 # . . push args 647 68/push "(foo %eax)\n"/imm32 - 648 68/push _test-input-stream/imm32 + 648 68/push _test-input-stream/imm32 649 # . . call - 650 e8/call write/disp32 + 650 e8/call write/disp32 651 # . . discard args 652 81 0/subop/add %esp 8/imm32 653 # subx-calls(_test-input-buffered-file, _test-output-buffered-file) 654 # . . push args - 655 68/push _test-output-buffered-file/imm32 - 656 68/push _test-input-buffered-file/imm32 + 655 68/push _test-output-buffered-file/imm32 + 656 68/push _test-input-buffered-file/imm32 657 # . . call 658 e8/call subx-calls/disp32 659 # . . discard args @@ -683,9 +683,9 @@ if ('onhashchange' in window) { 661 # check that the line just passed through 662 # . flush(_test-output-buffered-file) 663 # . . push args - 664 68/push _test-output-buffered-file/imm32 + 664 68/push _test-output-buffered-file/imm32 665 # . . call - 666 e8/call flush/disp32 + 666 e8/call flush/disp32 667 # . . discard args 668 81 0/subop/add %esp 4/imm32 669 +-- 33 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- @@ -693,36 +693,36 @@ if ('onhashchange' in window) { 703 # . . push args 704 68/push "F - test-subx-calls-processes-calls: comment"/imm32 705 68/push "# . (foo %eax)"/imm32 - 706 68/push _test-output-stream/imm32 + 706 68/push _test-output-stream/imm32 707 # . . call - 708 e8/call check-next-stream-line-equal/disp32 + 708 e8/call check-next-stream-line-equal/disp32 709 # . . discard args 710 81 0/subop/add %esp 0xc/imm32 711 # . check-next-stream-line-equal(_test-output-stream, "ff 6/subop/push %eax", msg) 712 # . . push args 713 68/push "F - test-subx-calls-processes-calls: arg 0"/imm32 714 68/push "ff 6/subop/push %eax"/imm32 - 715 68/push _test-output-stream/imm32 + 715 68/push _test-output-stream/imm32 716 # . . call - 717 e8/call check-next-stream-line-equal/disp32 + 717 e8/call check-next-stream-line-equal/disp32 718 # . . discard args 719 81 0/subop/add %esp 0xc/imm32 720 # . check-next-stream-line-equal(_test-output-stream, "e8/call foo/disp32", msg) 721 # . . push args 722 68/push "F - test-subx-calls-processes-calls: call"/imm32 723 68/push "e8/call foo/disp32"/imm32 - 724 68/push _test-output-stream/imm32 + 724 68/push _test-output-stream/imm32 725 # . . call - 726 e8/call check-next-stream-line-equal/disp32 + 726 e8/call check-next-stream-line-equal/disp32 727 # . . discard args 728 81 0/subop/add %esp 0xc/imm32 729 # . check-next-stream-line-equal(_test-output-stream, "81 0/subop/add %esp 4/imm32", msg) 730 # . . push args 731 68/push "F - test-subx-calls-processes-calls: pops"/imm32 732 68/push "81 0/subop/add %esp 0x00000004/imm32"/imm32 - 733 68/push _test-output-stream/imm32 + 733 68/push _test-output-stream/imm32 734 # . . call - 735 e8/call check-next-stream-line-equal/disp32 + 735 e8/call check-next-stream-line-equal/disp32 736 # . . discard args 737 81 0/subop/add %esp 0xc/imm32 738 # . epilogue @@ -804,7 +804,7 @@ if ('onhashchange' in window) { 814 68/push 0x20/imm32/space 815 ff 6/subop/push *(ebp+8) 816 # . . call - 817 e8/call skip-chars-matching/disp32 + 817 e8/call skip-chars-matching/disp32 818 # . . discard args 819 81 0/subop/add %esp 8/imm32 820 $next-word-string-or-expression-without-metadata:check0: @@ -844,7 +844,7 @@ if ('onhashchange' in window) { 854 # . . push args 855 56/push-esi 856 # . . call - 857 e8/call skip-string/disp32 + 857 e8/call skip-string/disp32 858 # . . discard args 859 81 0/subop/add %esp 4/imm32 860 # out->end = &line->data[line->read] @@ -869,7 +869,7 @@ if ('onhashchange' in window) { 879 # . . push args 880 56/push-esi 881 # . . call - 882 e8/call skip-until-close-paren/disp32 + 882 e8/call skip-until-close-paren/disp32 883 # . . discard args 884 81 0/subop/add %esp 4/imm32 885 # if (line->data[line->read] != ')') goto error2 @@ -910,7 +910,7 @@ if ('onhashchange' in window) { 920 # . . push args 921 56/push-esi 922 # . . call - 923 e8/call skip-chars-matching-whitespace/disp32 + 923 e8/call skip-chars-matching-whitespace/disp32 924 # . . discard args 925 81 0/subop/add %esp 4/imm32 926 # if (line->read >= line->write) return out = {0, 0} @@ -978,32 +978,32 @@ if ('onhashchange' in window) { 988 # . write-buffered(Stderr, "error: missing final ')' in '") 989 # . . push args 990 68/push "error: missing final ')' in '"/imm32 - 991 68/push Stderr/imm32 + 991 68/push Stderr/imm32 992 # . . call - 993 e8/call write-buffered/disp32 + 993 e8/call write-buffered/disp32 994 # . . discard args 995 81 0/subop/add %esp 8/imm32 996 # . write-stream-data(Stderr, line) 997 # . . push args 998 56/push-esi - 999 68/push Stderr/imm32 + 999 68/push Stderr/imm32 1000 # . . call -1001 e8/call write-stream-data/disp32 +1001 e8/call write-stream-data/disp32 1002 # . . discard args 1003 81 0/subop/add %esp 8/imm32 1004 # . write-buffered(Stderr, "'") 1005 # . . push args 1006 68/push "'"/imm32 -1007 68/push Stderr/imm32 +1007 68/push Stderr/imm32 1008 # . . call -1009 e8/call write-buffered/disp32 +1009 e8/call write-buffered/disp32 1010 # . . discard args 1011 81 0/subop/add %esp 8/imm32 1012 # . flush(Stderr) 1013 # . . push args -1014 68/push Stderr/imm32 +1014 68/push Stderr/imm32 1015 # . . call -1016 e8/call flush/disp32 +1016 e8/call flush/disp32 1017 # . . discard args 1018 81 0/subop/add %esp 4/imm32 1019 # . syscall(exit, 1) @@ -1016,32 +1016,32 @@ if ('onhashchange' in window) { 1026 # . write-buffered(Stderr, "error: no space allowed after '*' in '") 1027 # . . push args 1028 68/push "error: no space allowed after '*' in '"/imm32 -1029 68/push Stderr/imm32 +1029 68/push Stderr/imm32 1030 # . . call -1031 e8/call write-buffered/disp32 +1031 e8/call write-buffered/disp32 1032 # . . discard args 1033 81 0/subop/add %esp 8/imm32 1034 # . write-stream-data(Stderr, line) 1035 # . . push args 1036 56/push-esi -1037 68/push Stderr/imm32 +1037 68/push Stderr/imm32 1038 # . . call -1039 e8/call write-stream-data/disp32 +1039 e8/call write-stream-data/disp32 1040 # . . discard args 1041 81 0/subop/add %esp 8/imm32 1042 # . write-buffered(Stderr, "'") 1043 # . . push args 1044 68/push "'"/imm32 -1045 68/push Stderr/imm32 +1045 68/push Stderr/imm32 1046 # . . call -1047 e8/call write-buffered/disp32 +1047 e8/call write-buffered/disp32 1048 # . . discard args 1049 81 0/subop/add %esp 8/imm32 1050 # . flush(Stderr) 1051 # . . push args -1052 68/push Stderr/imm32 +1052 68/push Stderr/imm32 1053 # . . call -1054 e8/call flush/disp32 +1054 e8/call flush/disp32 1055 # . . discard args 1056 81 0/subop/add %esp 4/imm32 1057 # . syscall(exit, 1) @@ -1054,32 +1054,32 @@ if ('onhashchange' in window) { 1064 # . write-buffered(Stderr, "error: *(...) expression must be all on a single line in '") 1065 # . . push args 1066 68/push "error: *(...) expression must be all on a single line in '"/imm32 -1067 68/push Stderr/imm32 +1067 68/push Stderr/imm32 1068 # . . call -1069 e8/call write-buffered/disp32 +1069 e8/call write-buffered/disp32 1070 # . . discard args 1071 81 0/subop/add %esp 8/imm32 1072 # . write-stream-data(Stderr, line) 1073 # . . push args 1074 56/push-esi -1075 68/push Stderr/imm32 +1075 68/push Stderr/imm32 1076 # . . call -1077 e8/call write-stream-data/disp32 +1077 e8/call write-stream-data/disp32 1078 # . . discard args 1079 81 0/subop/add %esp 8/imm32 1080 # . write-buffered(Stderr, "'") 1081 # . . push args 1082 68/push "'"/imm32 -1083 68/push Stderr/imm32 +1083 68/push Stderr/imm32 1084 # . . call -1085 e8/call write-buffered/disp32 +1085 e8/call write-buffered/disp32 1086 # . . discard args 1087 81 0/subop/add %esp 8/imm32 1088 # . flush(Stderr) 1089 # . . push args -1090 68/push Stderr/imm32 +1090 68/push Stderr/imm32 1091 # . . call -1092 e8/call flush/disp32 +1092 e8/call flush/disp32 1093 # . . discard args 1094 81 0/subop/add %esp 4/imm32 1095 # . syscall(exit, 1) @@ -1092,32 +1092,32 @@ if ('onhashchange' in window) { 1102 # . write-buffered(Stderr, "error: no metadata after calls; just use a comment (in '") 1103 # . . push args 1104 68/push "error: no metadata after calls; just use a comment (in '"/imm32 -1105 68/push Stderr/imm32 +1105 68/push Stderr/imm32 1106 # . . call -1107 e8/call write-buffered/disp32 +1107 e8/call write-buffered/disp32 1108 # . . discard args 1109 81 0/subop/add %esp 8/imm32 1110 # . write-stream-data(Stderr, line) 1111 # . . push args 1112 56/push-esi -1113 68/push Stderr/imm32 +1113 68/push Stderr/imm32 1114 # . . call -1115 e8/call write-stream-data/disp32 +1115 e8/call write-stream-data/disp32 1116 # . . discard args 1117 81 0/subop/add %esp 8/imm32 1118 # . write-buffered(Stderr, "')") 1119 # . . push args 1120 68/push "')"/imm32 -1121 68/push Stderr/imm32 +1121 68/push Stderr/imm32 1122 # . . call -1123 e8/call write-buffered/disp32 +1123 e8/call write-buffered/disp32 1124 # . . discard args 1125 81 0/subop/add %esp 8/imm32 1126 # . flush(Stderr) 1127 # . . push args -1128 68/push Stderr/imm32 +1128 68/push Stderr/imm32 1129 # . . call -1130 e8/call flush/disp32 +1130 e8/call flush/disp32 1131 # . . discard args 1132 81 0/subop/add %esp 4/imm32 1133 # . syscall(exit, 1) @@ -1130,32 +1130,32 @@ if ('onhashchange' in window) { 1140 # . write-buffered(Stderr, "error: unexpected text after end of call in '") 1141 # . . push args 1142 68/push "error: unexpected text after end of call in '"/imm32 -1143 68/push Stderr/imm32 +1143 68/push Stderr/imm32 1144 # . . call -1145 e8/call write-buffered/disp32 +1145 e8/call write-buffered/disp32 1146 # . . discard args 1147 81 0/subop/add %esp 8/imm32 1148 # . write-stream-data(Stderr, line) 1149 # . . push args 1150 56/push-esi -1151 68/push Stderr/imm32 +1151 68/push Stderr/imm32 1152 # . . call -1153 e8/call write-stream-data/disp32 +1153 e8/call write-stream-data/disp32 1154 # . . discard args 1155 81 0/subop/add %esp 8/imm32 1156 # . write-buffered(Stderr, "'") 1157 # . . push args 1158 68/push "'"/imm32 -1159 68/push Stderr/imm32 +1159 68/push Stderr/imm32 1160 # . . call -1161 e8/call write-buffered/disp32 +1161 e8/call write-buffered/disp32 1162 # . . discard args 1163 81 0/subop/add %esp 8/imm32 1164 # . flush(Stderr) 1165 # . . push args -1166 68/push Stderr/imm32 +1166 68/push Stderr/imm32 1167 # . . call -1168 e8/call flush/disp32 +1168 e8/call flush/disp32 1169 # . . discard args 1170 81 0/subop/add %esp 4/imm32 1171 # . syscall(exit, 1) @@ -1168,32 +1168,32 @@ if ('onhashchange' in window) { 1178 # . write-buffered(Stderr, "error: no metadata anywhere in calls (in '") 1179 # . . push args 1180 68/push "error: no metadata anywhere in calls (in '"/imm32 -1181 68/push Stderr/imm32 +1181 68/push Stderr/imm32 1182 # . . call -1183 e8/call write-buffered/disp32 +1183 e8/call write-buffered/disp32 1184 # . . discard args 1185 81 0/subop/add %esp 8/imm32 1186 # . write-stream-data(Stderr, line) 1187 # . . push args 1188 56/push-esi -1189 68/push Stderr/imm32 +1189 68/push Stderr/imm32 1190 # . . call -1191 e8/call write-stream-data/disp32 +1191 e8/call write-stream-data/disp32 1192 # . . discard args 1193 81 0/subop/add %esp 8/imm32 1194 # . write-buffered(Stderr, "')") 1195 # . . push args 1196 68/push "')"/imm32 -1197 68/push Stderr/imm32 +1197 68/push Stderr/imm32 1198 # . . call -1199 e8/call write-buffered/disp32 +1199 e8/call write-buffered/disp32 1200 # . . discard args 1201 81 0/subop/add %esp 8/imm32 1202 # . flush(Stderr) 1203 # . . push args -1204 68/push Stderr/imm32 +1204 68/push Stderr/imm32 1205 # . . call -1206 e8/call flush/disp32 +1206 e8/call flush/disp32 1207 # . . discard args 1208 81 0/subop/add %esp 4/imm32 1209 # . syscall(exit, 1) @@ -1208,9 +1208,9 @@ if ('onhashchange' in window) { 1218 # setup 1219 # . clear-stream(_test-input-stream) 1220 # . . push args -1221 68/push _test-input-stream/imm32 +1221 68/push _test-input-stream/imm32 1222 # . . call -1223 e8/call clear-stream/disp32 +1223 e8/call clear-stream/disp32 1224 # . . discard args 1225 81 0/subop/add %esp 4/imm32 1226 # var slice/ecx: slice @@ -1220,15 +1220,15 @@ if ('onhashchange' in window) { 1230 # write(_test-input-stream, " ab") 1231 # . . push args 1232 68/push " ab"/imm32 -1233 68/push _test-input-stream/imm32 +1233 68/push _test-input-stream/imm32 1234 # . . call -1235 e8/call write/disp32 +1235 e8/call write/disp32 1236 # . . discard args 1237 81 0/subop/add %esp 8/imm32 1238 # next-word-string-or-expression-without-metadata(_test-input-stream, slice) 1239 # . . push args 1240 51/push-ecx -1241 68/push _test-input-stream/imm32 +1241 68/push _test-input-stream/imm32 1242 # . . call 1243 e8/call next-word-string-or-expression-without-metadata/disp32 1244 # . . discard args @@ -1237,10 +1237,10 @@ if ('onhashchange' in window) { 1247 # . . push args 1248 68/push "F - test-next-word-string-or-expression-without-metadata/updates-stream-read-correctly"/imm32 1249 68/push 4/imm32 -1250 b8/copy-to-eax _test-input-stream/imm32 +1250 b8/copy-to-eax _test-input-stream/imm32 1251 ff 6/subop/push *(eax+4) 1252 # . . call -1253 e8/call check-ints-equal/disp32 +1253 e8/call check-ints-equal/disp32 1254 # . . discard args 1255 81 0/subop/add %esp 0xc/imm32 1256 # check-ints-equal(slice->start - _test-input-stream->data, 2, msg) @@ -1250,10 +1250,10 @@ if ('onhashchange' in window) { 1260 68/push 0xe/imm32 1261 # . . push slice->start - _test-input-stream 1262 8b/-> *ecx 0/r32/eax -1263 81 5/subop/subtract %eax _test-input-stream/imm32 +1263 81 5/subop/subtract %eax _test-input-stream/imm32 1264 50/push-eax 1265 # . . call -1266 e8/call check-ints-equal/disp32 +1266 e8/call check-ints-equal/disp32 1267 # . . discard args 1268 81 0/subop/add %esp 0xc/imm32 1269 # check-ints-equal(slice->end - _test-input-stream->data, 4, msg) @@ -1263,10 +1263,10 @@ if ('onhashchange' in window) { 1273 68/push 0x10/imm32 1274 # . . push slice->end - _test-input-stream 1275 8b/-> *(ecx+4) 0/r32/eax -1276 81 5/subop/subtract %eax _test-input-stream/imm32 +1276 81 5/subop/subtract %eax _test-input-stream/imm32 1277 50/push-eax 1278 # . . call -1279 e8/call check-ints-equal/disp32 +1279 e8/call check-ints-equal/disp32 1280 # . . discard args 1281 81 0/subop/add %esp 0xc/imm32 1282 # . epilogue @@ -1281,9 +1281,9 @@ if ('onhashchange' in window) { 1291 # setup 1292 # . clear-stream(_test-input-stream) 1293 # . . push args -1294 68/push _test-input-stream/imm32 +1294 68/push _test-input-stream/imm32 1295 # . . call -1296 e8/call clear-stream/disp32 +1296 e8/call clear-stream/disp32 1297 # . . discard args 1298 81 0/subop/add %esp 4/imm32 1299 # var slice/ecx: slice @@ -1293,15 +1293,15 @@ if ('onhashchange' in window) { 1303 # write(_test-input-stream, " # a") 1304 # . . push args 1305 68/push " # a"/imm32 -1306 68/push _test-input-stream/imm32 +1306 68/push _test-input-stream/imm32 1307 # . . call -1308 e8/call write/disp32 +1308 e8/call write/disp32 1309 # . . discard args 1310 81 0/subop/add %esp 8/imm32 1311 # next-word-string-or-expression-without-metadata(_test-input-stream, slice) 1312 # . . push args 1313 51/push-ecx -1314 68/push _test-input-stream/imm32 +1314 68/push _test-input-stream/imm32 1315 # . . call 1316 e8/call next-word-string-or-expression-without-metadata/disp32 1317 # . . discard args @@ -1310,10 +1310,10 @@ if ('onhashchange' in window) { 1320 # . . push args 1321 68/push "F - test-next-word-string-or-expression-without-metadata-returns-whole-comment/updates-stream-read-correctly"/imm32 1322 68/push 5/imm32 -1323 b8/copy-to-eax _test-input-stream/imm32 +1323 b8/copy-to-eax _test-input-stream/imm32 1324 ff 6/subop/push *(eax+4) 1325 # . . call -1326 e8/call check-ints-equal/disp32 +1326 e8/call check-ints-equal/disp32 1327 # . . discard args 1328 81 0/subop/add %esp 0xc/imm32 1329 # check-ints-equal(slice->start - _test-input-stream->data, 2, msg) @@ -1323,10 +1323,10 @@ if ('onhashchange' in window) { 1333 68/push 0xe/imm32 1334 # . . push slice->start - _test-input-stream 1335 8b/-> *ecx 0/r32/eax -1336 81 5/subop/subtract %eax _test-input-stream/imm32 +1336 81 5/subop/subtract %eax _test-input-stream/imm32 1337 50/push-eax 1338 # . . call -1339 e8/call check-ints-equal/disp32 +1339 e8/call check-ints-equal/disp32 1340 # . . discard args 1341 81 0/subop/add %esp 0xc/imm32 1342 # check-ints-equal(slice->end - _test-input-stream->data, 5, msg) @@ -1336,10 +1336,10 @@ if ('onhashchange' in window) { 1346 68/push 0x11/imm32 1347 # . . push slice->end - _test-input-stream 1348 8b/-> *(ecx+4) 0/r32/eax -1349 81 5/subop/subtract %eax _test-input-stream/imm32 +1349 81 5/subop/subtract %eax _test-input-stream/imm32 1350 50/push-eax 1351 # . . call -1352 e8/call check-ints-equal/disp32 +1352 e8/call check-ints-equal/disp32 1353 # . . discard args 1354 81 0/subop/add %esp 0xc/imm32 1355 # . epilogue @@ -1354,9 +1354,9 @@ if ('onhashchange' in window) { 1364 # setup 1365 # . clear-stream(_test-input-stream) 1366 # . . push args -1367 68/push _test-input-stream/imm32 +1367 68/push _test-input-stream/imm32 1368 # . . call -1369 e8/call clear-stream/disp32 +1369 e8/call clear-stream/disp32 1370 # . . discard args 1371 81 0/subop/add %esp 4/imm32 1372 # var slice/ecx: slice @@ -1366,15 +1366,15 @@ if ('onhashchange' in window) { 1376 # write(_test-input-stream, " \"a b\" ") 1377 # . . push args 1378 68/push " \"a b\" "/imm32 -1379 68/push _test-input-stream/imm32 +1379 68/push _test-input-stream/imm32 1380 # . . call -1381 e8/call write/disp32 +1381 e8/call write/disp32 1382 # . . discard args 1383 81 0/subop/add %esp 8/imm32 1384 # next-word-string-or-expression-without-metadata(_test-input-stream, slice) 1385 # . . push args 1386 51/push-ecx -1387 68/push _test-input-stream/imm32 +1387 68/push _test-input-stream/imm32 1388 # . . call 1389 e8/call next-word-string-or-expression-without-metadata/disp32 1390 # . . discard args @@ -1386,10 +1386,10 @@ if ('onhashchange' in window) { 1396 68/push 0xd/imm32 1397 # . . push slice->start - _test-input-stream 1398 8b/-> *ecx 0/r32/eax -1399 81 5/subop/subtract %eax _test-input-stream/imm32 +1399 81 5/subop/subtract %eax _test-input-stream/imm32 1400 50/push-eax 1401 # . . call -1402 e8/call check-ints-equal/disp32 +1402 e8/call check-ints-equal/disp32 1403 # . . discard args 1404 81 0/subop/add %esp 0xc/imm32 1405 # check-ints-equal(slice->end - _test-input-stream->data, 6, msg) @@ -1399,10 +1399,10 @@ if ('onhashchange' in window) { 1409 68/push 0x12/imm32 1410 # . . push slice->end - _test-input-stream 1411 8b/-> *(ecx+4) 0/r32/eax -1412 81 5/subop/subtract %eax _test-input-stream/imm32 +1412 81 5/subop/subtract %eax _test-input-stream/imm32 1413 50/push-eax 1414 # . . call -1415 e8/call check-ints-equal/disp32 +1415 e8/call check-ints-equal/disp32 1416 # . . discard args 1417 81 0/subop/add %esp 0xc/imm32 1418 # . epilogue @@ -1417,9 +1417,9 @@ if ('onhashchange' in window) { 1427 # setup 1428 # . clear-stream(_test-input-stream) 1429 # . . push args -1430 68/push _test-input-stream/imm32 +1430 68/push _test-input-stream/imm32 1431 # . . call -1432 e8/call clear-stream/disp32 +1432 e8/call clear-stream/disp32 1433 # . . discard args 1434 81 0/subop/add %esp 4/imm32 1435 # var slice/ecx: slice @@ -1429,15 +1429,15 @@ if ('onhashchange' in window) { 1439 # write(_test-input-stream, " \"a\\\"b\"") 1440 # . . push args 1441 68/push " \"a\\\"b\""/imm32 -1442 68/push _test-input-stream/imm32 +1442 68/push _test-input-stream/imm32 1443 # . . call -1444 e8/call write/disp32 +1444 e8/call write/disp32 1445 # . . discard args 1446 81 0/subop/add %esp 8/imm32 1447 # next-word-string-or-expression-without-metadata(_test-input-stream, slice) 1448 # . . push args 1449 51/push-ecx -1450 68/push _test-input-stream/imm32 +1450 68/push _test-input-stream/imm32 1451 # . . call 1452 e8/call next-word-string-or-expression-without-metadata/disp32 1453 # . . discard args @@ -1449,10 +1449,10 @@ if ('onhashchange' in window) { 1459 68/push 0xd/imm32 1460 # . . push slice->start - _test-input-stream 1461 8b/-> *ecx 0/r32/eax -1462 81 5/subop/subtract %eax _test-input-stream/imm32 +1462 81 5/subop/subtract %eax _test-input-stream/imm32 1463 50/push-eax 1464 # . . call -1465 e8/call check-ints-equal/disp32 +1465 e8/call check-ints-equal/disp32 1466 # . . discard args 1467 81 0/subop/add %esp 0xc/imm32 1468 # check-ints-equal(slice->end - _test-input-stream->data, 7, msg) @@ -1462,10 +1462,10 @@ if ('onhashchange' in window) { 1472 68/push 0x13/imm32 1473 # . . push slice->end - _test-input-stream 1474 8b/-> *(ecx+4) 0/r32/eax -1475 81 5/subop/subtract %eax _test-input-stream/imm32 +1475 81 5/subop/subtract %eax _test-input-stream/imm32 1476 50/push-eax 1477 # . . call -1478 e8/call check-ints-equal/disp32 +1478 e8/call check-ints-equal/disp32 1479 # . . discard args 1480 81 0/subop/add %esp 0xc/imm32 1481 # . epilogue @@ -1480,9 +1480,9 @@ if ('onhashchange' in window) { 1490 # setup 1491 # . clear-stream(_test-input-stream) 1492 # . . push args -1493 68/push _test-input-stream/imm32 +1493 68/push _test-input-stream/imm32 1494 # . . call -1495 e8/call clear-stream/disp32 +1495 e8/call clear-stream/disp32 1496 # . . discard args 1497 81 0/subop/add %esp 4/imm32 1498 # var slice/ecx: slice @@ -1492,15 +1492,15 @@ if ('onhashchange' in window) { 1502 # write(_test-input-stream, " *(a b) ") 1503 # . . push args 1504 68/push " *(a b) "/imm32 -1505 68/push _test-input-stream/imm32 +1505 68/push _test-input-stream/imm32 1506 # . . call -1507 e8/call write/disp32 +1507 e8/call write/disp32 1508 # . . discard args 1509 81 0/subop/add %esp 8/imm32 1510 # next-word-string-or-expression-without-metadata(_test-input-stream, slice) 1511 # . . push args 1512 51/push-ecx -1513 68/push _test-input-stream/imm32 +1513 68/push _test-input-stream/imm32 1514 # . . call 1515 e8/call next-word-string-or-expression-without-metadata/disp32 1516 # . . discard args @@ -1512,10 +1512,10 @@ if ('onhashchange' in window) { 1522 68/push 0xd/imm32 1523 # . . push slice->start - _test-input-stream 1524 8b/-> *ecx 0/r32/eax -1525 81 5/subop/subtract %eax _test-input-stream/imm32 +1525 81 5/subop/subtract %eax _test-input-stream/imm32 1526 50/push-eax 1527 # . . call -1528 e8/call check-ints-equal/disp32 +1528 e8/call check-ints-equal/disp32 1529 # . . discard args 1530 81 0/subop/add %esp 0xc/imm32 1531 # check-ints-equal(slice->end - _test-input-stream->data, 7, msg) @@ -1525,10 +1525,10 @@ if ('onhashchange' in window) { 1535 68/push 0x13/imm32 1536 # . . push slice->end - _test-input-stream 1537 8b/-> *(ecx+4) 0/r32/eax -1538 81 5/subop/subtract %eax _test-input-stream/imm32 +1538 81 5/subop/subtract %eax _test-input-stream/imm32 1539 50/push-eax 1540 # . . call -1541 e8/call check-ints-equal/disp32 +1541 e8/call check-ints-equal/disp32 1542 # . . discard args 1543 81 0/subop/add %esp 0xc/imm32 1544 # . epilogue @@ -1543,9 +1543,9 @@ if ('onhashchange' in window) { 1553 # setup 1554 # . clear-stream(_test-input-stream) 1555 # . . push args -1556 68/push _test-input-stream/imm32 +1556 68/push _test-input-stream/imm32 1557 # . . call -1558 e8/call clear-stream/disp32 +1558 e8/call clear-stream/disp32 1559 # . . discard args 1560 81 0/subop/add %esp 4/imm32 1561 # var slice/ecx: slice @@ -1555,15 +1555,15 @@ if ('onhashchange' in window) { 1565 # write(_test-input-stream, " ) ") 1566 # . . push args 1567 68/push " ) "/imm32 -1568 68/push _test-input-stream/imm32 +1568 68/push _test-input-stream/imm32 1569 # . . call -1570 e8/call write/disp32 +1570 e8/call write/disp32 1571 # . . discard args 1572 81 0/subop/add %esp 8/imm32 1573 # next-word-string-or-expression-without-metadata(_test-input-stream, slice) 1574 # . . push args 1575 51/push-ecx -1576 68/push _test-input-stream/imm32 +1576 68/push _test-input-stream/imm32 1577 # . . call 1578 e8/call next-word-string-or-expression-without-metadata/disp32 1579 # . . discard args @@ -1574,7 +1574,7 @@ if ('onhashchange' in window) { 1584 68/push 0/imm32 1585 ff 6/subop/push *ecx 1586 # . . call -1587 e8/call check-ints-equal/disp32 +1587 e8/call check-ints-equal/disp32 1588 # . . discard args 1589 81 0/subop/add %esp 0xc/imm32 1590 # check-ints-equal(slice->end, 0, msg) @@ -1583,7 +1583,7 @@ if ('onhashchange' in window) { 1593 68/push 0/imm32 1594 ff 6/subop/push *(ecx+4) 1595 # . . call -1596 e8/call check-ints-equal/disp32 +1596 e8/call check-ints-equal/disp32 1597 # . . discard args 1598 81 0/subop/add %esp 0xc/imm32 1599 # . epilogue @@ -1598,9 +1598,9 @@ if ('onhashchange' in window) { 1608 # setup 1609 # . clear-stream(_test-input-stream) 1610 # . . push args -1611 68/push _test-input-stream/imm32 +1611 68/push _test-input-stream/imm32 1612 # . . call -1613 e8/call clear-stream/disp32 +1613 e8/call clear-stream/disp32 1614 # . . discard args 1615 81 0/subop/add %esp 4/imm32 1616 # var slice/ecx: slice @@ -1610,15 +1610,15 @@ if ('onhashchange' in window) { 1620 # write(_test-input-stream, " ) # abc ") 1621 # . . push args 1622 68/push " ) # abc "/imm32 -1623 68/push _test-input-stream/imm32 +1623 68/push _test-input-stream/imm32 1624 # . . call -1625 e8/call write/disp32 +1625 e8/call write/disp32 1626 # . . discard args 1627 81 0/subop/add %esp 8/imm32 1628 # next-word-string-or-expression-without-metadata(_test-input-stream, slice) 1629 # . . push args 1630 51/push-ecx -1631 68/push _test-input-stream/imm32 +1631 68/push _test-input-stream/imm32 1632 # . . call 1633 e8/call next-word-string-or-expression-without-metadata/disp32 1634 # . . discard args @@ -1629,7 +1629,7 @@ if ('onhashchange' in window) { 1639 68/push 0/imm32 1640 ff 6/subop/push *ecx 1641 # . . call -1642 e8/call check-ints-equal/disp32 +1642 e8/call check-ints-equal/disp32 1643 # . . discard args 1644 81 0/subop/add %esp 0xc/imm32 1645 # check-ints-equal(slice->end, 0, msg) @@ -1638,7 +1638,7 @@ if ('onhashchange' in window) { 1648 68/push 0/imm32 1649 ff 6/subop/push *(ecx+4) 1650 # . . call -1651 e8/call check-ints-equal/disp32 +1651 e8/call check-ints-equal/disp32 1652 # . . discard args 1653 81 0/subop/add %esp 0xc/imm32 1654 # . epilogue @@ -1653,9 +1653,9 @@ if ('onhashchange' in window) { 1663 # setup 1664 # . clear-stream(_test-input-stream) 1665 # . . push args -1666 68/push _test-input-stream/imm32 +1666 68/push _test-input-stream/imm32 1667 # . . call -1668 e8/call clear-stream/disp32 +1668 e8/call clear-stream/disp32 1669 # . . discard args 1670 81 0/subop/add %esp 4/imm32 1671 # var slice/ecx: slice @@ -1665,15 +1665,15 @@ if ('onhashchange' in window) { 1675 # write(_test-input-stream, " )\n") 1676 # . . push args 1677 68/push " )\n"/imm32 -1678 68/push _test-input-stream/imm32 +1678 68/push _test-input-stream/imm32 1679 # . . call -1680 e8/call write/disp32 +1680 e8/call write/disp32 1681 # . . discard args 1682 81 0/subop/add %esp 8/imm32 1683 # next-word-string-or-expression-without-metadata(_test-input-stream, slice) 1684 # . . push args 1685 51/push-ecx -1686 68/push _test-input-stream/imm32 +1686 68/push _test-input-stream/imm32 1687 # . . call 1688 e8/call next-word-string-or-expression-without-metadata/disp32 1689 # . . discard args @@ -1684,7 +1684,7 @@ if ('onhashchange' in window) { 1694 68/push 0/imm32 1695 ff 6/subop/push *ecx 1696 # . . call -1697 e8/call check-ints-equal/disp32 +1697 e8/call check-ints-equal/disp32 1698 # . . discard args 1699 81 0/subop/add %esp 0xc/imm32 1700 # check-ints-equal(slice->end, 0, msg) @@ -1693,7 +1693,7 @@ if ('onhashchange' in window) { 1703 68/push 0/imm32 1704 ff 6/subop/push *(ecx+4) 1705 # . . call -1706 e8/call check-ints-equal/disp32 +1706 e8/call check-ints-equal/disp32 1707 # . . discard args 1708 81 0/subop/add %esp 0xc/imm32 1709 # . epilogue @@ -1708,9 +1708,9 @@ if ('onhashchange' in window) { 1718 # setup 1719 # . clear-stream(_test-input-stream) 1720 # . . push args -1721 68/push _test-input-stream/imm32 +1721 68/push _test-input-stream/imm32 1722 # . . call -1723 e8/call clear-stream/disp32 +1723 e8/call clear-stream/disp32 1724 # . . discard args 1725 81 0/subop/add %esp 4/imm32 1726 # var slice/ecx: slice @@ -1720,15 +1720,15 @@ if ('onhashchange' in window) { 1730 # write(_test-input-stream, " abc) # def") 1731 # . . push args 1732 68/push " abc) # def"/imm32 -1733 68/push _test-input-stream/imm32 +1733 68/push _test-input-stream/imm32 1734 # . . call -1735 e8/call write/disp32 +1735 e8/call write/disp32 1736 # . . discard args 1737 81 0/subop/add %esp 8/imm32 1738 # next-word-string-or-expression-without-metadata(_test-input-stream, slice) 1739 # . . push args 1740 51/push-ecx -1741 68/push _test-input-stream/imm32 +1741 68/push _test-input-stream/imm32 1742 # . . call 1743 e8/call next-word-string-or-expression-without-metadata/disp32 1744 # . . discard args @@ -1740,10 +1740,10 @@ if ('onhashchange' in window) { 1750 68/push 0xd/imm32 1751 # . . push slice->start - _test-input-stream 1752 8b/-> *ecx 0/r32/eax -1753 81 5/subop/subtract %eax _test-input-stream/imm32 +1753 81 5/subop/subtract %eax _test-input-stream/imm32 1754 50/push-eax 1755 # . . call -1756 e8/call check-ints-equal/disp32 +1756 e8/call check-ints-equal/disp32 1757 # . . discard args 1758 81 0/subop/add %esp 0xc/imm32 1759 # check-ints-equal(slice->end - _test-input-stream->data, 4, msg) @@ -1753,10 +1753,10 @@ if ('onhashchange' in window) { 1763 68/push 0x10/imm32 1764 # . . push slice->end - _test-input-stream 1765 8b/-> *(ecx+4) 0/r32/eax -1766 81 5/subop/subtract %eax _test-input-stream/imm32 +1766 81 5/subop/subtract %eax _test-input-stream/imm32 1767 50/push-eax 1768 # . . call -1769 e8/call check-ints-equal/disp32 +1769 e8/call check-ints-equal/disp32 1770 # . . discard args 1771 81 0/subop/add %esp 0xc/imm32 1772 # . epilogue diff --git a/html/apps/crenshaw2-1.subx.html b/html/apps/crenshaw2-1.subx.html index e94dadba..e21e94bb 100644 --- a/html/apps/crenshaw2-1.subx.html +++ b/html/apps/crenshaw2-1.subx.html @@ -98,10 +98,10 @@ if ('onhashchange' in window) { 37 # initialize heap 38 # . Heap = new-segment(Heap-size) 39 # . . push args - 40 68/push Heap/imm32 - 41 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Heap-size/disp32 # push *Heap-size + 40 68/push Heap/imm32 + 41 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Heap-size/disp32 # push *Heap-size 42 # . . call - 43 e8/call new-segment/disp32 + 43 e8/call new-segment/disp32 44 # . . discard args 45 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 46 @@ -115,7 +115,7 @@ if ('onhashchange' in window) { 54 68/push "test"/imm32 55 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 56 # . . call - 57 e8/call kernel-string-equal?/disp32 + 57 e8/call kernel-string-equal?/disp32 58 # . . discard args 59 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 60 # . if (eax == false) goto run-main @@ -124,7 +124,7 @@ if ('onhashchange' in window) { 63 # run-tests() 64 e8/call run-tests/disp32 65 # syscall(exit, *Num-test-failures) - 66 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/ebx Num-test-failures/disp32 # copy *Num-test-failures to ebx + 66 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/ebx Num-test-failures/disp32 # copy *Num-test-failures to ebx 67 eb/jump $main:end/disp8 68 $run-main: 69 # - otherwise read a program from stdin and emit its translation to stdout @@ -133,7 +133,7 @@ if ('onhashchange' in window) { 72 68/push 0/imm32/exit-descriptor 73 68/push 2/imm32/stderr 74 68/push 1/imm32/stdout - 75 68/push Stdin/imm32 + 75 68/push Stdin/imm32 76 # . . call 77 e8/call compile/disp32 78 # . . discard args @@ -173,7 +173,7 @@ if ('onhashchange' in window) { 112 # . . push args 113 51/push-ecx 114 # . . call -115 e8/call clear-stream/disp32 +115 e8/call clear-stream/disp32 116 # . . discard args 117 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 118 # read a digit from 'in' into 'num' @@ -197,7 +197,7 @@ if ('onhashchange' in window) { 136 68/push "bb/copy-to-ebx "/imm32 137 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 138 # . . call -139 e8/call write/disp32 +139 e8/call write/disp32 140 # . . discard args 141 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 142 # . write-stream(out, num) @@ -205,15 +205,15 @@ if ('onhashchange' in window) { 144 51/push-ecx/num 145 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 146 # . . call -147 e8/call write-stream/disp32 +147 e8/call write-stream/disp32 148 # . . discard args 149 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 150 # . write(out, Newline) 151 # . . push args -152 68/push Newline/imm32 +152 68/push Newline/imm32 153 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 154 # . . call -155 e8/call write/disp32 +155 e8/call write/disp32 156 # . . discard args 157 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 158 # . write(out, "b8/copy-to-eax 1/imm32/exit\n") @@ -221,7 +221,7 @@ if ('onhashchange' in window) { 160 68/push "b8/copy-to-eax 1/imm32/exit\n"/imm32 161 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 162 # . . call -163 e8/call write/disp32 +163 e8/call write/disp32 164 # . . discard args 165 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 166 # . write(out, "cd/syscall 0x80/imm8\n") @@ -229,7 +229,7 @@ if ('onhashchange' in window) { 168 68/push "cd/syscall 0x80/imm8\n"/imm32 169 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 170 # . . call -171 e8/call write/disp32 +171 e8/call write/disp32 172 # . . discard args 173 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 174 $compile:end: @@ -316,7 +316,7 @@ if ('onhashchange' in window) { 255 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x10/disp8 . # push *(ebp+16) 256 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x14/disp8 . # push *(ebp+20) 257 # . . call -258 e8/call error/disp32 # never returns +258 e8/call error/disp32 # never returns 259 # . . discard args 260 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 261 $get-num:stage2: @@ -357,39 +357,39 @@ if ('onhashchange' in window) { 296 # clear all streams 297 # . clear-stream(_test-stream) 298 # . . push args -299 68/push _test-stream/imm32 +299 68/push _test-stream/imm32 300 # . . call -301 e8/call clear-stream/disp32 +301 e8/call clear-stream/disp32 302 # . . discard args 303 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 304 # . clear-stream($_test-buffered-file->buffer) 305 # . . push args 306 68/push $_test-buffered-file->buffer/imm32 307 # . . call -308 e8/call clear-stream/disp32 +308 e8/call clear-stream/disp32 309 # . . discard args 310 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 311 # . clear-stream(_test-output-stream) 312 # . . push args -313 68/push _test-output-stream/imm32 +313 68/push _test-output-stream/imm32 314 # . . call -315 e8/call clear-stream/disp32 +315 e8/call clear-stream/disp32 316 # . . discard args 317 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 318 # . clear-stream(_test-error-stream) 319 # . . push args -320 68/push _test-error-stream/imm32 +320 68/push _test-error-stream/imm32 321 # . . call -322 e8/call clear-stream/disp32 +322 e8/call clear-stream/disp32 323 # . . discard args 324 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 325 # initialize 'in' 326 # . write(_test-stream, "3") 327 # . . push args 328 68/push "3"/imm32 -329 68/push _test-stream/imm32 +329 68/push _test-stream/imm32 330 # . . call -331 e8/call write/disp32 +331 e8/call write/disp32 332 # . . discard args 333 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 334 # initialize exit-descriptor 'ed' for the call to 'get-num' below @@ -401,13 +401,13 @@ if ('onhashchange' in window) { 340 68/push 0x10/imm32/nbytes-of-args-for-get-num 341 50/push-eax/ed 342 # . . call -343 e8/call tailor-exit-descriptor/disp32 +343 e8/call tailor-exit-descriptor/disp32 344 # . . discard args 345 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 346 # prime the pump 347 # . get-char(_test-buffered-file) 348 # . . push args -349 68/push _test-buffered-file/imm32 +349 68/push _test-buffered-file/imm32 350 # . . call 351 e8/call get-char/disp32 352 # . . discard args @@ -415,9 +415,9 @@ if ('onhashchange' in window) { 354 # get-num(in, out, err, ed) 355 # . . push args 356 50/push-eax/ed -357 68/push _test-error-stream/imm32 -358 68/push _test-output-stream/imm32 -359 68/push _test-buffered-file/imm32 +357 68/push _test-error-stream/imm32 +358 68/push _test-output-stream/imm32 +359 68/push _test-buffered-file/imm32 360 # . . call 361 e8/call get-num/disp32 362 # registers except esp may be clobbered at this point @@ -427,10 +427,10 @@ if ('onhashchange' in window) { 366 # . . push args 367 68/push "F - test-get-num-reads-single-digit"/imm32 368 68/push 0x33/imm32 -369 b8/copy-to-eax _test-output-stream/imm32 +369 b8/copy-to-eax _test-output-stream/imm32 370 ff 6/subop/push 1/mod/*+disp8 0/rm32/eax . . . . 0xc/disp8 . # push *(eax+12) 371 # . . call -372 e8/call check-ints-equal/disp32 +372 e8/call check-ints-equal/disp32 373 # . . discard args 374 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 375 # . reclaim locals @@ -446,39 +446,39 @@ if ('onhashchange' in window) { 385 # clear all streams 386 # . clear-stream(_test-stream) 387 # . . push args -388 68/push _test-stream/imm32 +388 68/push _test-stream/imm32 389 # . . call -390 e8/call clear-stream/disp32 +390 e8/call clear-stream/disp32 391 # . . discard args 392 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 393 # . clear-stream($_test-buffered-file->buffer) 394 # . . push args 395 68/push $_test-buffered-file->buffer/imm32 396 # . . call -397 e8/call clear-stream/disp32 +397 e8/call clear-stream/disp32 398 # . . discard args 399 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 400 # . clear-stream(_test-output-stream) 401 # . . push args -402 68/push _test-output-stream/imm32 +402 68/push _test-output-stream/imm32 403 # . . call -404 e8/call clear-stream/disp32 +404 e8/call clear-stream/disp32 405 # . . discard args 406 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 407 # . clear-stream(_test-error-stream) 408 # . . push args -409 68/push _test-error-stream/imm32 +409 68/push _test-error-stream/imm32 410 # . . call -411 e8/call clear-stream/disp32 +411 e8/call clear-stream/disp32 412 # . . discard args 413 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 414 # initialize 'in' 415 # . write(_test-stream, "3") 416 # . . push args 417 68/push "3"/imm32 -418 68/push _test-stream/imm32 +418 68/push _test-stream/imm32 419 # . . call -420 e8/call write/disp32 +420 e8/call write/disp32 421 # . . discard args 422 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 423 # initialize exit-descriptor 'ed' for the call to 'get-num' below @@ -490,16 +490,16 @@ if ('onhashchange' in window) { 429 68/push 0x10/imm32/nbytes-of-args-for-get-num 430 50/push-eax/ed 431 # . . call -432 e8/call tailor-exit-descriptor/disp32 +432 e8/call tailor-exit-descriptor/disp32 433 # . . discard args 434 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 435 # *don't* prime the pump 436 # get-num(in, out, err, ed) 437 # . . push args 438 50/push-eax/ed -439 68/push _test-error-stream/imm32 -440 68/push _test-output-stream/imm32 -441 68/push _test-buffered-file/imm32 +439 68/push _test-error-stream/imm32 +440 68/push _test-output-stream/imm32 +441 68/push _test-buffered-file/imm32 442 # . . call 443 e8/call get-num/disp32 444 # registers except esp may be clobbered at this point @@ -513,7 +513,7 @@ if ('onhashchange' in window) { 452 # . . push ed->value 453 ff 6/subop/push 1/mod/*+disp8 0/rm32/eax . . . . 4/disp8 . # push *(eax+4) 454 # . . call -455 e8/call check-ints-equal/disp32 +455 e8/call check-ints-equal/disp32 456 # . . discard args 457 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 458 # . reclaim locals @@ -533,7 +533,7 @@ if ('onhashchange' in window) { 472 68/push "Error: "/imm32 473 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 474 # . . call -475 e8/call write/disp32 +475 e8/call write/disp32 476 # . . discard args 477 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 478 # write(f, s) @@ -541,7 +541,7 @@ if ('onhashchange' in window) { 480 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x10/disp8 . # push *(ebp+16) 481 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 482 # . . call -483 e8/call write/disp32 +483 e8/call write/disp32 484 # . . discard args 485 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 486 # write(f, " expected\n") @@ -549,7 +549,7 @@ if ('onhashchange' in window) { 488 68/push " expected\n"/imm32 489 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 490 # . . call -491 e8/call write/disp32 +491 e8/call write/disp32 492 # . . discard args 493 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 494 # stop(ed, 1) @@ -557,7 +557,7 @@ if ('onhashchange' in window) { 496 68/push 1/imm32 497 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 498 # . . call -499 e8/call stop/disp32 +499 e8/call stop/disp32 500 # should never get past this point 501 $expected:dead-end: 502 # . epilogue @@ -576,7 +576,7 @@ if ('onhashchange' in window) { 515 # . . push args 516 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 517 # . . call -518 e8/call read-byte-buffered/disp32 +518 e8/call read-byte-buffered/disp32 519 # . . discard args 520 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 521 # save eax to Look diff --git a/html/apps/crenshaw2-1b.subx.html b/html/apps/crenshaw2-1b.subx.html index 803246d4..ee5a830c 100644 --- a/html/apps/crenshaw2-1b.subx.html +++ b/html/apps/crenshaw2-1b.subx.html @@ -98,10 +98,10 @@ if ('onhashchange' in window) { 37 # initialize heap 38 # . Heap = new-segment(Heap-size) 39 # . . push args - 40 68/push Heap/imm32 - 41 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Heap-size/disp32 # push *Heap-size + 40 68/push Heap/imm32 + 41 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Heap-size/disp32 # push *Heap-size 42 # . . call - 43 e8/call new-segment/disp32 + 43 e8/call new-segment/disp32 44 # . . discard args 45 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 46 @@ -115,7 +115,7 @@ if ('onhashchange' in window) { 54 68/push "test"/imm32 55 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 56 # . . call - 57 e8/call kernel-string-equal?/disp32 + 57 e8/call kernel-string-equal?/disp32 58 # . . discard args 59 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 60 # . if (eax == false) goto run-main @@ -124,7 +124,7 @@ if ('onhashchange' in window) { 63 # run-tests() 64 e8/call run-tests/disp32 65 # syscall(exit, *Num-test-failures) - 66 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/ebx Num-test-failures/disp32 # copy *Num-test-failures to ebx + 66 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/ebx Num-test-failures/disp32 # copy *Num-test-failures to ebx 67 eb/jump $main:end/disp8 68 $run-main: 69 # - otherwise read a program from stdin and emit its translation to stdout @@ -133,7 +133,7 @@ if ('onhashchange' in window) { 72 68/push 0/imm32/exit-descriptor 73 68/push 2/imm32/stderr 74 68/push 1/imm32/stdout - 75 68/push Stdin/imm32 + 75 68/push Stdin/imm32 76 # . . call 77 e8/call compile/disp32 78 # . . discard args @@ -173,7 +173,7 @@ if ('onhashchange' in window) { 112 # . . push args 113 51/push-ecx 114 # . . call -115 e8/call clear-stream/disp32 +115 e8/call clear-stream/disp32 116 # . . discard args 117 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 118 # read a digit from 'in' into 'num' @@ -197,7 +197,7 @@ if ('onhashchange' in window) { 136 68/push "bb/copy-to-ebx "/imm32 137 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 138 # . . call -139 e8/call write/disp32 +139 e8/call write/disp32 140 # . . discard args 141 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 142 # . write-stream(out, num) @@ -205,15 +205,15 @@ if ('onhashchange' in window) { 144 51/push-ecx/num 145 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 146 # . . call -147 e8/call write-stream/disp32 +147 e8/call write-stream/disp32 148 # . . discard args 149 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 150 # . write(out, Newline) 151 # . . push args -152 68/push Newline/imm32 +152 68/push Newline/imm32 153 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 154 # . . call -155 e8/call write/disp32 +155 e8/call write/disp32 156 # . . discard args 157 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 158 # . write(out, "b8/copy-to-eax 1/imm32/exit\n") @@ -221,7 +221,7 @@ if ('onhashchange' in window) { 160 68/push "b8/copy-to-eax 1/imm32/exit\n"/imm32 161 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 162 # . . call -163 e8/call write/disp32 +163 e8/call write/disp32 164 # . . discard args 165 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 166 # . write(out, "cd/syscall 0x80/imm8\n") @@ -229,7 +229,7 @@ if ('onhashchange' in window) { 168 68/push "cd/syscall 0x80/imm8\n"/imm32 169 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 170 # . . call -171 e8/call write/disp32 +171 e8/call write/disp32 172 # . . discard args 173 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 174 $compile:end: @@ -321,7 +321,7 @@ if ('onhashchange' in window) { 260 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x10/disp8 . # push *(ebp+16) 261 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x14/disp8 . # push *(ebp+20) 262 # . . call -263 e8/call error/disp32 # never returns +263 e8/call error/disp32 # never returns 264 # . . discard args 265 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 266 $get-num:loop-stage2: @@ -373,39 +373,39 @@ if ('onhashchange' in window) { 312 # clear all streams 313 # . clear-stream(_test-stream) 314 # . . push args -315 68/push _test-stream/imm32 +315 68/push _test-stream/imm32 316 # . . call -317 e8/call clear-stream/disp32 +317 e8/call clear-stream/disp32 318 # . . discard args 319 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 320 # . clear-stream($_test-buffered-file->buffer) 321 # . . push args 322 68/push $_test-buffered-file->buffer/imm32 323 # . . call -324 e8/call clear-stream/disp32 +324 e8/call clear-stream/disp32 325 # . . discard args 326 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 327 # . clear-stream(_test-output-stream) 328 # . . push args -329 68/push _test-output-stream/imm32 +329 68/push _test-output-stream/imm32 330 # . . call -331 e8/call clear-stream/disp32 +331 e8/call clear-stream/disp32 332 # . . discard args 333 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 334 # . clear-stream(_test-error-stream) 335 # . . push args -336 68/push _test-error-stream/imm32 +336 68/push _test-error-stream/imm32 337 # . . call -338 e8/call clear-stream/disp32 +338 e8/call clear-stream/disp32 339 # . . discard args 340 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 341 # initialize 'in' 342 # . write(_test-stream, "3") 343 # . . push args 344 68/push "3"/imm32 -345 68/push _test-stream/imm32 +345 68/push _test-stream/imm32 346 # . . call -347 e8/call write/disp32 +347 e8/call write/disp32 348 # . . discard args 349 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 350 # initialize exit-descriptor 'ed' for the call to 'get-num' below @@ -417,13 +417,13 @@ if ('onhashchange' in window) { 356 68/push 0x10/imm32/nbytes-of-args-for-get-num 357 50/push-eax/ed 358 # . . call -359 e8/call tailor-exit-descriptor/disp32 +359 e8/call tailor-exit-descriptor/disp32 360 # . . discard args 361 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 362 # prime the pump 363 # . get-char(_test-buffered-file) 364 # . . push args -365 68/push _test-buffered-file/imm32 +365 68/push _test-buffered-file/imm32 366 # . . call 367 e8/call get-char/disp32 368 # . . discard args @@ -431,9 +431,9 @@ if ('onhashchange' in window) { 370 # get-num(in, out, err, ed) 371 # . . push args 372 50/push-eax/ed -373 68/push _test-error-stream/imm32 -374 68/push _test-output-stream/imm32 -375 68/push _test-buffered-file/imm32 +373 68/push _test-error-stream/imm32 +374 68/push _test-output-stream/imm32 +375 68/push _test-buffered-file/imm32 376 # . . call 377 e8/call get-num/disp32 378 # registers except esp may be clobbered at this point @@ -443,10 +443,10 @@ if ('onhashchange' in window) { 382 # . . push args 383 68/push "F - test-get-num-reads-single-digit"/imm32 384 68/push 0x33/imm32 -385 b8/copy-to-eax _test-output-stream/imm32 +385 b8/copy-to-eax _test-output-stream/imm32 386 ff 6/subop/push 1/mod/*+disp8 0/rm32/eax . . . . 0xc/disp8 . # push *(eax+12) 387 # . . call -388 e8/call check-ints-equal/disp32 +388 e8/call check-ints-equal/disp32 389 # . . discard args 390 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 391 # . reclaim locals @@ -462,39 +462,39 @@ if ('onhashchange' in window) { 401 # clear all streams 402 # . clear-stream(_test-stream) 403 # . . push args -404 68/push _test-stream/imm32 +404 68/push _test-stream/imm32 405 # . . call -406 e8/call clear-stream/disp32 +406 e8/call clear-stream/disp32 407 # . . discard args 408 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 409 # . clear-stream($_test-buffered-file->buffer) 410 # . . push args 411 68/push $_test-buffered-file->buffer/imm32 412 # . . call -413 e8/call clear-stream/disp32 +413 e8/call clear-stream/disp32 414 # . . discard args 415 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 416 # . clear-stream(_test-output-stream) 417 # . . push args -418 68/push _test-output-stream/imm32 +418 68/push _test-output-stream/imm32 419 # . . call -420 e8/call clear-stream/disp32 +420 e8/call clear-stream/disp32 421 # . . discard args 422 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 423 # . clear-stream(_test-error-stream) 424 # . . push args -425 68/push _test-error-stream/imm32 +425 68/push _test-error-stream/imm32 426 # . . call -427 e8/call clear-stream/disp32 +427 e8/call clear-stream/disp32 428 # . . discard args 429 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 430 # initialize 'in' 431 # . write(_test-stream, "3") 432 # . . push args 433 68/push "3"/imm32 -434 68/push _test-stream/imm32 +434 68/push _test-stream/imm32 435 # . . call -436 e8/call write/disp32 +436 e8/call write/disp32 437 # . . discard args 438 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 439 # initialize exit-descriptor 'ed' for the call to 'get-num' below @@ -506,16 +506,16 @@ if ('onhashchange' in window) { 445 68/push 0x10/imm32/nbytes-of-args-for-get-num 446 50/push-eax/ed 447 # . . call -448 e8/call tailor-exit-descriptor/disp32 +448 e8/call tailor-exit-descriptor/disp32 449 # . . discard args 450 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 451 # *don't* prime the pump 452 # get-num(in, out, err, ed) 453 # . . push args 454 50/push-eax/ed -455 68/push _test-error-stream/imm32 -456 68/push _test-output-stream/imm32 -457 68/push _test-buffered-file/imm32 +455 68/push _test-error-stream/imm32 +456 68/push _test-output-stream/imm32 +457 68/push _test-buffered-file/imm32 458 # . . call 459 e8/call get-num/disp32 460 # registers except esp may be clobbered at this point @@ -529,7 +529,7 @@ if ('onhashchange' in window) { 468 # . . push ed->value 469 ff 6/subop/push 1/mod/*+disp8 0/rm32/eax . . . . 4/disp8 . # push *(eax+4) 470 # . . call -471 e8/call check-ints-equal/disp32 +471 e8/call check-ints-equal/disp32 472 # . . discard args 473 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 474 # . reclaim locals @@ -545,39 +545,39 @@ if ('onhashchange' in window) { 484 # clear all streams 485 # . clear-stream(_test-stream) 486 # . . push args -487 68/push _test-stream/imm32 +487 68/push _test-stream/imm32 488 # . . call -489 e8/call clear-stream/disp32 +489 e8/call clear-stream/disp32 490 # . . discard args 491 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 492 # . clear-stream($_test-buffered-file->buffer) 493 # . . push args 494 68/push $_test-buffered-file->buffer/imm32 495 # . . call -496 e8/call clear-stream/disp32 +496 e8/call clear-stream/disp32 497 # . . discard args 498 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 499 # . clear-stream(_test-output-stream) 500 # . . push args -501 68/push _test-output-stream/imm32 +501 68/push _test-output-stream/imm32 502 # . . call -503 e8/call clear-stream/disp32 +503 e8/call clear-stream/disp32 504 # . . discard args 505 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 506 # . clear-stream(_test-error-stream) 507 # . . push args -508 68/push _test-error-stream/imm32 +508 68/push _test-error-stream/imm32 509 # . . call -510 e8/call clear-stream/disp32 +510 e8/call clear-stream/disp32 511 # . . discard args 512 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 513 # initialize 'in' 514 # . write(_test-stream, "3456 x") 515 # . . push args 516 68/push "3456"/imm32 -517 68/push _test-stream/imm32 +517 68/push _test-stream/imm32 518 # . . call -519 e8/call write/disp32 +519 e8/call write/disp32 520 # . . discard args 521 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 522 # initialize exit-descriptor 'ed' for the call to 'get-num' below @@ -589,13 +589,13 @@ if ('onhashchange' in window) { 528 68/push 0x10/imm32/nbytes-of-args-for-get-num 529 50/push-eax/ed 530 # . . call -531 e8/call tailor-exit-descriptor/disp32 +531 e8/call tailor-exit-descriptor/disp32 532 # . . discard args 533 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 534 # prime the pump 535 # . get-char(_test-buffered-file) 536 # . . push args -537 68/push _test-buffered-file/imm32 +537 68/push _test-buffered-file/imm32 538 # . . call 539 e8/call get-char/disp32 540 # . . discard args @@ -603,9 +603,9 @@ if ('onhashchange' in window) { 542 # get-num(in, out, err, ed) 543 # . . push args 544 50/push-eax/ed -545 68/push _test-error-stream/imm32 -546 68/push _test-output-stream/imm32 -547 68/push _test-buffered-file/imm32 +545 68/push _test-error-stream/imm32 +546 68/push _test-output-stream/imm32 +547 68/push _test-buffered-file/imm32 548 # . . call 549 e8/call get-num/disp32 550 # registers except esp may be clobbered at this point @@ -615,10 +615,10 @@ if ('onhashchange' in window) { 554 # . . push args 555 68/push "F - test-get-num-reads-multiple-digits"/imm32 556 68/push 0x36353433/imm32 -557 b8/copy-to-eax _test-output-stream/imm32 +557 b8/copy-to-eax _test-output-stream/imm32 558 ff 6/subop/push 1/mod/*+disp8 0/rm32/eax . . . . 0xc/disp8 . # push *(eax+12) 559 # . . call -560 e8/call check-ints-equal/disp32 +560 e8/call check-ints-equal/disp32 561 # . . discard args 562 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 563 # . reclaim locals @@ -634,39 +634,39 @@ if ('onhashchange' in window) { 573 # clear all streams 574 # . clear-stream(_test-stream) 575 # . . push args -576 68/push _test-stream/imm32 +576 68/push _test-stream/imm32 577 # . . call -578 e8/call clear-stream/disp32 +578 e8/call clear-stream/disp32 579 # . . discard args 580 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 581 # . clear-stream($_test-buffered-file->buffer) 582 # . . push args 583 68/push $_test-buffered-file->buffer/imm32 584 # . . call -585 e8/call clear-stream/disp32 +585 e8/call clear-stream/disp32 586 # . . discard args 587 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 588 # . clear-stream(_test-output-stream) 589 # . . push args -590 68/push _test-output-stream/imm32 +590 68/push _test-output-stream/imm32 591 # . . call -592 e8/call clear-stream/disp32 +592 e8/call clear-stream/disp32 593 # . . discard args 594 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 595 # . clear-stream(_test-error-stream) 596 # . . push args -597 68/push _test-error-stream/imm32 +597 68/push _test-error-stream/imm32 598 # . . call -599 e8/call clear-stream/disp32 +599 e8/call clear-stream/disp32 600 # . . discard args 601 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 602 # initialize 'in' 603 # . write(_test-stream, "3456 x") 604 # . . push args 605 68/push "3456 x"/imm32 -606 68/push _test-stream/imm32 +606 68/push _test-stream/imm32 607 # . . call -608 e8/call write/disp32 +608 e8/call write/disp32 609 # . . discard args 610 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 611 # initialize exit-descriptor 'ed' for the call to 'get-num' below @@ -678,13 +678,13 @@ if ('onhashchange' in window) { 617 68/push 0x10/imm32/nbytes-of-args-for-get-num 618 50/push-eax/ed 619 # . . call -620 e8/call tailor-exit-descriptor/disp32 +620 e8/call tailor-exit-descriptor/disp32 621 # . . discard args 622 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 623 # prime the pump 624 # . get-char(_test-buffered-file) 625 # . . push args -626 68/push _test-buffered-file/imm32 +626 68/push _test-buffered-file/imm32 627 # . . call 628 e8/call get-char/disp32 629 # . . discard args @@ -692,9 +692,9 @@ if ('onhashchange' in window) { 631 # get-num(in, out, err, ed) 632 # . . push args 633 50/push-eax/ed -634 68/push _test-error-stream/imm32 -635 68/push _test-output-stream/imm32 -636 68/push _test-buffered-file/imm32 +634 68/push _test-error-stream/imm32 +635 68/push _test-output-stream/imm32 +636 68/push _test-buffered-file/imm32 637 # . . call 638 e8/call get-num/disp32 639 # registers except esp may be clobbered at this point @@ -704,10 +704,10 @@ if ('onhashchange' in window) { 643 # . . push args 644 68/push "F - test-get-num-reads-multiple-digits-followed-by-nondigit"/imm32 645 68/push 0x36353433/imm32 -646 b8/copy-to-eax _test-output-stream/imm32 +646 b8/copy-to-eax _test-output-stream/imm32 647 ff 6/subop/push 1/mod/*+disp8 0/rm32/eax . . . . 0xc/disp8 . # push *(eax+12) 648 # . . call -649 e8/call check-ints-equal/disp32 +649 e8/call check-ints-equal/disp32 650 # . . discard args 651 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 652 # . reclaim locals @@ -727,7 +727,7 @@ if ('onhashchange' in window) { 666 68/push "Error: "/imm32 667 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 668 # . . call -669 e8/call write/disp32 +669 e8/call write/disp32 670 # . . discard args 671 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 672 # write(f, s) @@ -735,7 +735,7 @@ if ('onhashchange' in window) { 674 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x10/disp8 . # push *(ebp+16) 675 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 676 # . . call -677 e8/call write/disp32 +677 e8/call write/disp32 678 # . . discard args 679 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 680 # write(f, " expected\n") @@ -743,7 +743,7 @@ if ('onhashchange' in window) { 682 68/push " expected\n"/imm32 683 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 684 # . . call -685 e8/call write/disp32 +685 e8/call write/disp32 686 # . . discard args 687 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 688 # stop(ed, 1) @@ -751,7 +751,7 @@ if ('onhashchange' in window) { 690 68/push 1/imm32 691 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 692 # . . call -693 e8/call stop/disp32 +693 e8/call stop/disp32 694 # should never get past this point 695 $expected:dead-end: 696 # . epilogue @@ -770,7 +770,7 @@ if ('onhashchange' in window) { 709 # . . push args 710 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 711 # . . call -712 e8/call read-byte-buffered/disp32 +712 e8/call read-byte-buffered/disp32 713 # . . discard args 714 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 715 # save eax to Look diff --git a/html/apps/dquotes.subx.html b/html/apps/dquotes.subx.html index 56ced9e6..24826f4f 100644 --- a/html/apps/dquotes.subx.html +++ b/html/apps/dquotes.subx.html @@ -89,10 +89,10 @@ if ('onhashchange' in window) { 26 # initialize heap 27 # . Heap = new-segment(Heap-size) 28 # . . push args - 29 68/push Heap/imm32 - 30 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Heap-size/disp32 # push *Heap-size + 29 68/push Heap/imm32 + 30 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Heap-size/disp32 # push *Heap-size 31 # . . call - 32 e8/call new-segment/disp32 + 32 e8/call new-segment/disp32 33 # . . discard args 34 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 35 @@ -106,7 +106,7 @@ if ('onhashchange' in window) { 43 68/push "test"/imm32 44 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 45 # . . call - 46 e8/call kernel-string-equal?/disp32 + 46 e8/call kernel-string-equal?/disp32 47 # . . discard args 48 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 49 # . if (eax == false) goto interactive @@ -115,7 +115,7 @@ if ('onhashchange' in window) { 52 # run-tests() 53 e8/call run-tests/disp32 54 # syscall(exit, *Num-test-failures) - 55 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/ebx Num-test-failures/disp32 # copy *Num-test-failures to ebx + 55 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/ebx Num-test-failures/disp32 # copy *Num-test-failures to ebx 56 eb/jump $subx-dquotes-main:end/disp8 57 $subx-dquotes-main:interactive: 58 # - otherwise convert stdin @@ -128,9 +128,9 @@ if ('onhashchange' in window) { 65 # subx-dquotes(Stdin, Stdout, Stderr, ed) 66 # . . push args 67 50/push-eax/ed - 68 68/push Stderr/imm32 - 69 68/push Stdout/imm32 - 70 68/push Stdin/imm32 + 68 68/push Stderr/imm32 + 69 68/push Stdout/imm32 + 70 68/push Stdin/imm32 71 # . . call 72 e8/call subx-dquotes/disp32 73 # . . discard args @@ -208,9 +208,9 @@ if ('onhashchange' in window) { 145 57/push-edi 146 68/push 1/imm32 147 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Segment-size/disp32 # push *Segment-size - 148 68/push Heap/imm32 + 148 68/push Heap/imm32 149 # . . call - 150 e8/call new-stream/disp32 + 150 e8/call new-stream/disp32 151 # . . discard args 152 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32 # add to esp 153 # var new-data-segment/edi: (addr stream byte) = lookup(*new-data-segment-handle) @@ -219,7 +219,7 @@ if ('onhashchange' in window) { 156 ff 6/subop/push 1/mod/*+disp8 7/rm32/edi . . . . 4/disp8 . # push *(edi+4) 157 ff 6/subop/push 0/mod/indirect 7/rm32/edi . . . . . . # push *edi 158 # . . call - 159 e8/call lookup/disp32 + 159 e8/call lookup/disp32 160 # . . discard args 161 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 162 # . new-data-segment = eax @@ -229,7 +229,7 @@ if ('onhashchange' in window) { 166 68/push "== data\n"/imm32 167 57/push-edi 168 # . . call - 169 e8/call write/disp32 + 169 e8/call write/disp32 170 # . . discard args 171 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 172 $subx-dquotes:line-loop: @@ -237,7 +237,7 @@ if ('onhashchange' in window) { 174 # . . push args 175 51/push-ecx 176 # . . call - 177 e8/call clear-stream/disp32 + 177 e8/call clear-stream/disp32 178 # . . discard args 179 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 180 # read-line-buffered(in, line) @@ -245,7 +245,7 @@ if ('onhashchange' in window) { 182 51/push-ecx 183 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 184 # . . call - 185 e8/call read-line-buffered/disp32 + 185 e8/call read-line-buffered/disp32 186 # . . discard args 187 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 188 $subx-dquotes:check0: @@ -258,7 +258,7 @@ if ('onhashchange' in window) { 195 52/push-edx 196 51/push-ecx 197 # . . call - 198 e8/call next-word-or-string/disp32 + 198 e8/call next-word-or-string/disp32 199 # . . discard args 200 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 201 $subx-dquotes:check1: @@ -267,7 +267,7 @@ if ('onhashchange' in window) { 204 # . . push args 205 52/push-edx 206 # . . call - 207 e8/call slice-empty?/disp32 + 207 e8/call slice-empty?/disp32 208 # . . discard args 209 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 210 # . if (eax != false) break @@ -298,24 +298,24 @@ if ('onhashchange' in window) { 235 # . . discard args 236 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 237 # continue - 238 eb/jump $subx-dquotes:next-word/disp8 + 238 eb/jump $subx-dquotes:next-word/disp8 239 $subx-dquotes:regular-word: 240 # write-slice-buffered(out, word-slice) 241 # . . push args 242 52/push-edx 243 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 244 # . . call - 245 e8/call write-slice-buffered/disp32 + 245 e8/call write-slice-buffered/disp32 246 # . . discard args 247 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 248 # fall through - 249 $subx-dquotes:next-word: + 249 $subx-dquotes:next-word: 250 # write-buffered(out, " ") 251 # . . push args - 252 68/push Space/imm32 + 252 68/push Space/imm32 253 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 254 # . . call - 255 e8/call write-buffered/disp32 + 255 e8/call write-buffered/disp32 256 # . . discard args 257 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 258 # loop @@ -323,10 +323,10 @@ if ('onhashchange' in window) { 260 $subx-dquotes:next-line: 261 # write-buffered(out, "\n") 262 # . . push args - 263 68/push Newline/imm32 + 263 68/push Newline/imm32 264 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 265 # . . call - 266 e8/call write-buffered/disp32 + 266 e8/call write-buffered/disp32 267 # . . discard args 268 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 269 # loop @@ -337,14 +337,14 @@ if ('onhashchange' in window) { 274 57/push-edi 275 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 276 # . . call - 277 e8/call write-stream-data/disp32 + 277 e8/call write-stream-data/disp32 278 # . . discard args 279 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 280 # flush(out) 281 # . . push args 282 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 283 # . . call - 284 e8/call flush/disp32 + 284 e8/call flush/disp32 285 # . . discard args 286 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 287 $subx-dquotes:end: @@ -389,7 +389,7 @@ if ('onhashchange' in window) { 326 68/push "_string"/imm32 327 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x10/disp8 . # push *(ebp+16) 328 # . . call - 329 e8/call write/disp32 + 329 e8/call write/disp32 330 # . . discard args 331 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 332 # . write-int32-decimal(out-segment, *Next-string-literal) @@ -397,7 +397,7 @@ if ('onhashchange' in window) { 334 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Next-string-literal/disp32 # push *Next-string-literal 335 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x10/disp8 . # push *(ebp+16) 336 # . . call - 337 e8/call write-int32-decimal/disp32 + 337 e8/call write-int32-decimal/disp32 338 # . . discard args 339 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 340 # . write(out-segment, ":\n") @@ -405,7 +405,7 @@ if ('onhashchange' in window) { 342 68/push ":\n"/imm32 343 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x10/disp8 . # push *(ebp+16) 344 # . . call - 345 e8/call write/disp32 + 345 e8/call write/disp32 346 # . . discard args 347 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 348 # emit-string-literal-data(out-segment, string-literal) @@ -418,10 +418,10 @@ if ('onhashchange' in window) { 355 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 356 # write(out-segment, "\n") 357 # . . push args - 358 68/push Newline/imm32 + 358 68/push Newline/imm32 359 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x10/disp8 . # push *(ebp+16) 360 # . . call - 361 e8/call write/disp32 + 361 e8/call write/disp32 362 # . . discard args 363 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 364 # print(out, "_string#{Next-string-literal}") @@ -430,7 +430,7 @@ if ('onhashchange' in window) { 367 68/push "_string"/imm32 368 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 369 # . . call - 370 e8/call write-buffered/disp32 + 370 e8/call write-buffered/disp32 371 # . . discard args 372 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 373 # . write-int32-decimal(int32-stream, *Next-string-literal) @@ -438,7 +438,7 @@ if ('onhashchange' in window) { 375 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Next-string-literal/disp32 # push *Next-string-literal 376 51/push-ecx 377 # . . call - 378 e8/call write-int32-decimal/disp32 + 378 e8/call write-int32-decimal/disp32 379 # . . discard args 380 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 381 # . write-stream-data(out, int32-stream) @@ -446,7 +446,7 @@ if ('onhashchange' in window) { 383 51/push-ecx 384 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 385 # . . call - 386 e8/call write-stream-data/disp32 + 386 e8/call write-stream-data/disp32 387 # . . discard args 388 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 389 # emit-metadata(out, string-literal) @@ -476,30 +476,30 @@ if ('onhashchange' in window) { 413 # setup 414 # . clear-stream(_test-input-stream) 415 # . . push args - 416 68/push _test-input-stream/imm32 + 416 68/push _test-input-stream/imm32 417 # . . call - 418 e8/call clear-stream/disp32 + 418 e8/call clear-stream/disp32 419 # . . discard args 420 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 421 # . clear-stream($_test-input-buffered-file->buffer) 422 # . . push args 423 68/push $_test-input-buffered-file->buffer/imm32 424 # . . call - 425 e8/call clear-stream/disp32 + 425 e8/call clear-stream/disp32 426 # . . discard args 427 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 428 # . clear-stream(_test-output-stream) 429 # . . push args - 430 68/push _test-output-stream/imm32 + 430 68/push _test-output-stream/imm32 431 # . . call - 432 e8/call clear-stream/disp32 + 432 e8/call clear-stream/disp32 433 # . . discard args 434 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 435 # . clear-stream($_test-output-buffered-file->buffer) 436 # . . push args 437 68/push $_test-output-buffered-file->buffer/imm32 438 # . . call - 439 e8/call clear-stream/disp32 + 439 e8/call clear-stream/disp32 440 # . . discard args 441 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 442 # initialize input (meta comments in parens) @@ -515,88 +515,88 @@ if ('onhashchange' in window) { 452 # . write(_test-input-stream, "# comment 1\n") 453 # . . push args 454 68/push "# comment 1\n"/imm32 - 455 68/push _test-input-stream/imm32 + 455 68/push _test-input-stream/imm32 456 # . . call - 457 e8/call write/disp32 + 457 e8/call write/disp32 458 # . . discard args 459 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 460 # . write(_test-input-stream, " # comment 2 indented\n") 461 # . . push args 462 68/push " # comment 2 indented\n"/imm32 - 463 68/push _test-input-stream/imm32 + 463 68/push _test-input-stream/imm32 464 # . . call - 465 e8/call write/disp32 + 465 e8/call write/disp32 466 # . . discard args 467 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 468 # . write(_test-input-stream, "== code 0x1\n") 469 # . . push args 470 68/push "== code 0x1\n"/imm32 - 471 68/push _test-input-stream/imm32 + 471 68/push _test-input-stream/imm32 472 # . . call - 473 e8/call write/disp32 + 473 e8/call write/disp32 474 # . . discard args 475 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 476 # . write(_test-input-stream, "# comment 3 inside a segment\n") 477 # . . push args 478 68/push "# comment 3 inside a segment\n"/imm32 - 479 68/push _test-input-stream/imm32 + 479 68/push _test-input-stream/imm32 480 # . . call - 481 e8/call write/disp32 + 481 e8/call write/disp32 482 # . . discard args 483 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 484 # . write(_test-input-stream, "1\n") 485 # . . push args 486 68/push "1\n"/imm32 - 487 68/push _test-input-stream/imm32 + 487 68/push _test-input-stream/imm32 488 # . . call - 489 e8/call write/disp32 + 489 e8/call write/disp32 490 # . . discard args 491 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 492 # . write(_test-input-stream, "\n") # empty line 493 # . . push args - 494 68/push Newline/imm32 - 495 68/push _test-input-stream/imm32 + 494 68/push Newline/imm32 + 495 68/push _test-input-stream/imm32 496 # . . call - 497 e8/call write/disp32 + 497 e8/call write/disp32 498 # . . discard args 499 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 500 # . write(_test-input-stream, "2 3 # comment 4 inline with other contents\n") 501 # . . push args 502 68/push "2 3 # comment 4 inline with other contents\n"/imm32 - 503 68/push _test-input-stream/imm32 + 503 68/push _test-input-stream/imm32 504 # . . call - 505 e8/call write/disp32 + 505 e8/call write/disp32 506 # . . discard args 507 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 508 # . write(_test-input-stream, "== data 0x2\n") 509 # . . push args 510 68/push "== data 0x2\n"/imm32 - 511 68/push _test-input-stream/imm32 + 511 68/push _test-input-stream/imm32 512 # . . call - 513 e8/call write/disp32 + 513 e8/call write/disp32 514 # . . discard args 515 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 516 # . write(_test-input-stream, "4 5/imm32\n") 517 # . . push args 518 68/push "4 5/imm32\n"/imm32 - 519 68/push _test-input-stream/imm32 + 519 68/push _test-input-stream/imm32 520 # . . call - 521 e8/call write/disp32 + 521 e8/call write/disp32 522 # . . discard args 523 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 524 # subx-dquotes(_test-input-buffered-file, _test-output-buffered-file) 525 # . . push args - 526 68/push _test-output-buffered-file/imm32 - 527 68/push _test-input-buffered-file/imm32 + 526 68/push _test-output-buffered-file/imm32 + 527 68/push _test-input-buffered-file/imm32 528 # . . call 529 e8/call subx-dquotes/disp32 530 # . . discard args 531 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 532 # . flush(_test-output-buffered-file) 533 # . . push args - 534 68/push _test-output-buffered-file/imm32 + 534 68/push _test-output-buffered-file/imm32 535 # . . call - 536 e8/call flush/disp32 + 536 e8/call flush/disp32 537 # . . discard args 538 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 539 # check output @@ -615,81 +615,81 @@ if ('onhashchange' in window) { 577 # . . push args 578 68/push "F - test-subx-dquotes-is-idempotent-by-default/0"/imm32 579 68/push ""/imm32 - 580 68/push _test-output-stream/imm32 + 580 68/push _test-output-stream/imm32 581 # . . call - 582 e8/call check-next-stream-line-equal/disp32 + 582 e8/call check-next-stream-line-equal/disp32 583 # . . discard args 584 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 585 # . check-next-stream-line-equal(_test-output-stream, "", msg) 586 # . . push args 587 68/push "F - test-subx-dquotes-is-idempotent-by-default/1"/imm32 588 68/push ""/imm32 - 589 68/push _test-output-stream/imm32 + 589 68/push _test-output-stream/imm32 590 # . . call - 591 e8/call check-next-stream-line-equal/disp32 + 591 e8/call check-next-stream-line-equal/disp32 592 # . . discard args 593 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 594 # . check-next-stream-line-equal(_test-output-stream, "== code 0x1 ", msg) 595 # . . push args 596 68/push "F - test-subx-dquotes-is-idempotent-by-default/2"/imm32 597 68/push "== code 0x1 "/imm32 - 598 68/push _test-output-stream/imm32 + 598 68/push _test-output-stream/imm32 599 # . . call - 600 e8/call check-next-stream-line-equal/disp32 + 600 e8/call check-next-stream-line-equal/disp32 601 # . . discard args 602 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 603 # . check-next-stream-line-equal(_test-output-stream, "", msg) 604 # . . push args 605 68/push "F - test-subx-dquotes-is-idempotent-by-default/3"/imm32 606 68/push ""/imm32 - 607 68/push _test-output-stream/imm32 + 607 68/push _test-output-stream/imm32 608 # . . call - 609 e8/call check-next-stream-line-equal/disp32 + 609 e8/call check-next-stream-line-equal/disp32 610 # . . discard args 611 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 612 # . check-next-stream-line-equal(_test-output-stream, "1 ", msg) 613 # . . push args 614 68/push "F - test-subx-dquotes-is-idempotent-by-default/4"/imm32 615 68/push "1 "/imm32 - 616 68/push _test-output-stream/imm32 + 616 68/push _test-output-stream/imm32 617 # . . call - 618 e8/call check-next-stream-line-equal/disp32 + 618 e8/call check-next-stream-line-equal/disp32 619 # . . discard args 620 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 621 # . check-next-stream-line-equal(_test-output-stream, "", msg) 622 # . . push args 623 68/push "F - test-subx-dquotes-is-idempotent-by-default/5"/imm32 624 68/push ""/imm32 - 625 68/push _test-output-stream/imm32 + 625 68/push _test-output-stream/imm32 626 # . . call - 627 e8/call check-next-stream-line-equal/disp32 + 627 e8/call check-next-stream-line-equal/disp32 628 # . . discard args 629 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 630 # . check-next-stream-line-equal(_test-output-stream, "2 3 ", msg) 631 # . . push args 632 68/push "F - test-subx-dquotes-is-idempotent-by-default/6"/imm32 633 68/push "2 3 "/imm32 - 634 68/push _test-output-stream/imm32 + 634 68/push _test-output-stream/imm32 635 # . . call - 636 e8/call check-next-stream-line-equal/disp32 + 636 e8/call check-next-stream-line-equal/disp32 637 # . . discard args 638 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 639 # . check-next-stream-line-equal(_test-output-stream, "== data 0x2 ", msg) 640 # . . push args 641 68/push "F - test-subx-dquotes-is-idempotent-by-default/7"/imm32 642 68/push "== data 0x2 "/imm32 - 643 68/push _test-output-stream/imm32 + 643 68/push _test-output-stream/imm32 644 # . . call - 645 e8/call check-next-stream-line-equal/disp32 + 645 e8/call check-next-stream-line-equal/disp32 646 # . . discard args 647 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 648 # . check-next-stream-line-equal(_test-output-stream, "4 5/imm32 ", msg) 649 # . . push args 650 68/push "F - test-subx-dquotes-is-idempotent-by-default/8"/imm32 651 68/push "4 5/imm32 "/imm32 - 652 68/push _test-output-stream/imm32 + 652 68/push _test-output-stream/imm32 653 # . . call - 654 e8/call check-next-stream-line-equal/disp32 + 654 e8/call check-next-stream-line-equal/disp32 655 # . . discard args 656 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 657 # . epilogue @@ -704,30 +704,30 @@ if ('onhashchange' in window) { 666 # setup 667 # . clear-stream(_test-input-stream) 668 # . . push args - 669 68/push _test-input-stream/imm32 + 669 68/push _test-input-stream/imm32 670 # . . call - 671 e8/call clear-stream/disp32 + 671 e8/call clear-stream/disp32 672 # . . discard args 673 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 674 # . clear-stream($_test-input-buffered-file->buffer) 675 # . . push args 676 68/push $_test-input-buffered-file->buffer/imm32 677 # . . call - 678 e8/call clear-stream/disp32 + 678 e8/call clear-stream/disp32 679 # . . discard args 680 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 681 # . clear-stream(_test-output-stream) 682 # . . push args - 683 68/push _test-output-stream/imm32 + 683 68/push _test-output-stream/imm32 684 # . . call - 685 e8/call clear-stream/disp32 + 685 e8/call clear-stream/disp32 686 # . . discard args 687 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 688 # . clear-stream($_test-output-buffered-file->buffer) 689 # . . push args 690 68/push $_test-output-buffered-file->buffer/imm32 691 # . . call - 692 e8/call clear-stream/disp32 + 692 e8/call clear-stream/disp32 693 # . . discard args 694 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 695 # initialize input (meta comments in parens) @@ -735,40 +735,40 @@ if ('onhashchange' in window) { 697 # 1 "a"/x 698 # 2 "bc"/y 699 68/push "== code 0x1\n"/imm32 - 700 68/push _test-input-stream/imm32 + 700 68/push _test-input-stream/imm32 701 # . . call - 702 e8/call write/disp32 + 702 e8/call write/disp32 703 # . . discard args 704 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 705 # . write(_test-input-stream, "1 \"a\"/x\n") 706 # . . push args 707 68/push "1 \"a\"/x\n"/imm32 - 708 68/push _test-input-stream/imm32 + 708 68/push _test-input-stream/imm32 709 # . . call - 710 e8/call write/disp32 + 710 e8/call write/disp32 711 # . . discard args 712 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 713 # . write(_test-input-stream, "2 \"bc\"/y\n") 714 # . . push args 715 68/push "2 \"bc\"/y\n"/imm32 - 716 68/push _test-input-stream/imm32 + 716 68/push _test-input-stream/imm32 717 # . . call - 718 e8/call write/disp32 + 718 e8/call write/disp32 719 # . . discard args 720 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 721 # subx-dquotes(_test-input-buffered-file, _test-output-buffered-file) 722 # . . push args - 723 68/push _test-output-buffered-file/imm32 - 724 68/push _test-input-buffered-file/imm32 + 723 68/push _test-output-buffered-file/imm32 + 724 68/push _test-input-buffered-file/imm32 725 # . . call 726 e8/call subx-dquotes/disp32 727 # . . discard args 728 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 729 # . flush(_test-output-buffered-file) 730 # . . push args - 731 68/push _test-output-buffered-file/imm32 + 731 68/push _test-output-buffered-file/imm32 732 # . . call - 733 e8/call flush/disp32 + 733 e8/call flush/disp32 734 # . . discard args 735 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 736 # check output @@ -792,72 +792,72 @@ if ('onhashchange' in window) { 786 # . . push args 787 68/push "F - test-subx-dquotes-processes-string-literals/0"/imm32 788 68/push "== code 0x1 "/imm32 - 789 68/push _test-output-stream/imm32 + 789 68/push _test-output-stream/imm32 790 # . . call - 791 e8/call check-next-stream-line-equal/disp32 + 791 e8/call check-next-stream-line-equal/disp32 792 # . . discard args 793 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 794 # . check-next-stream-line-equal(_test-output-stream, "1 _string1/x ", msg) 795 # . . push args 796 68/push "F - test-subx-dquotes-processes-string-literals/1"/imm32 797 68/push "1 _string1/x "/imm32 - 798 68/push _test-output-stream/imm32 + 798 68/push _test-output-stream/imm32 799 # . . call - 800 e8/call check-next-stream-line-equal/disp32 + 800 e8/call check-next-stream-line-equal/disp32 801 # . . discard args 802 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 803 # . check-next-stream-line-equal(_test-output-stream, "2 _string2/y ", msg) 804 # . . push args 805 68/push "F - test-subx-dquotes-processes-string-literals/2"/imm32 806 68/push "2 _string2/y "/imm32 - 807 68/push _test-output-stream/imm32 + 807 68/push _test-output-stream/imm32 808 # . . call - 809 e8/call check-next-stream-line-equal/disp32 + 809 e8/call check-next-stream-line-equal/disp32 810 # . . discard args 811 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 812 # . check-next-stream-line-equal(_test-output-stream, "== data", msg) 813 # . . push args 814 68/push "F - test-subx-dquotes-processes-string-literals/3"/imm32 815 68/push "== data"/imm32 - 816 68/push _test-output-stream/imm32 + 816 68/push _test-output-stream/imm32 817 # . . call - 818 e8/call check-next-stream-line-equal/disp32 + 818 e8/call check-next-stream-line-equal/disp32 819 # . . discard args 820 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 821 # . check-next-stream-line-equal(_test-output-stream, "_string1: ", msg) 822 # . . push args 823 68/push "F - test-subx-dquotes-processes-string-literals/4"/imm32 824 68/push "_string1:"/imm32 - 825 68/push _test-output-stream/imm32 + 825 68/push _test-output-stream/imm32 826 # . . call - 827 e8/call check-next-stream-line-equal/disp32 + 827 e8/call check-next-stream-line-equal/disp32 828 # . . discard args 829 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 830 # . check-next-stream-line-equal(_test-output-stream, "1/imm32 61/a ", msg) 831 # . . push args 832 68/push "F - test-subx-dquotes-processes-string-literals/5"/imm32 833 68/push "0x00000001/imm32 61/a "/imm32 - 834 68/push _test-output-stream/imm32 + 834 68/push _test-output-stream/imm32 835 # . . call - 836 e8/call check-next-stream-line-equal/disp32 + 836 e8/call check-next-stream-line-equal/disp32 837 # . . discard args 838 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 839 # . check-next-stream-line-equal(_test-output-stream, "_string2: ", msg) 840 # . . push args 841 68/push "F - test-subx-dquotes-processes-string-literals/6"/imm32 842 68/push "_string2:"/imm32 - 843 68/push _test-output-stream/imm32 + 843 68/push _test-output-stream/imm32 844 # . . call - 845 e8/call check-next-stream-line-equal/disp32 + 845 e8/call check-next-stream-line-equal/disp32 846 # . . discard args 847 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 848 # . check-next-stream-line-equal(_test-output-stream, "2/imm32 62/b 63/c ", msg) 849 # . . push args 850 68/push "F - test-subx-dquotes-processes-string-literals/7"/imm32 851 68/push "0x00000002/imm32 62/b 63/c "/imm32 - 852 68/push _test-output-stream/imm32 + 852 68/push _test-output-stream/imm32 853 # . . call - 854 e8/call check-next-stream-line-equal/disp32 + 854 e8/call check-next-stream-line-equal/disp32 855 # . . discard args 856 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 857 # . epilogue @@ -926,7 +926,7 @@ if ('onhashchange' in window) { 920 50/push-eax 921 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 922 # . . call - 923 e8/call write-int32-hex/disp32 + 923 e8/call write-int32-hex/disp32 924 # . . discard args 925 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 926 # . write(out, "/imm32 ") @@ -934,7 +934,7 @@ if ('onhashchange' in window) { 928 68/push "/imm32 "/imm32 929 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 930 # . . call - 931 e8/call write/disp32 + 931 e8/call write/disp32 932 # . . discard args 933 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 934 $emit-string-literal-data:loop-init: @@ -953,7 +953,7 @@ if ('onhashchange' in window) { 947 0f 84/jump-if-= $emit-string-literal-data:end/disp32 948 # if (c != '\') goto emit 949 81 7/subop/compare 3/mod/direct 1/rm32/ecx . . . . . 0x5c/imm32/backslash # compare ecx - 950 75/jump-if-!= $emit-string-literal-data:emit/disp8 + 950 75/jump-if-!= $emit-string-literal-data:emit/disp8 951 # ++curr 952 42/increment-edx 953 # if (curr >= max) break @@ -963,15 +963,15 @@ if ('onhashchange' in window) { 957 8a/copy-byte 0/mod/indirect 2/rm32/edx . . . 1/r32/CL . . # copy byte at *edx to CL 958 # if (c == 'n') c = newline 959 81 7/subop/compare 3/mod/direct 1/rm32/ecx . . . . . 0x6e/imm32/n # compare ecx - 960 75/jump-if-!= $emit-string-literal-data:emit/disp8 + 960 75/jump-if-!= $emit-string-literal-data:emit/disp8 961 b9/copy-to-ecx 0x0a/imm32/newline - 962 $emit-string-literal-data:emit: + 962 $emit-string-literal-data:emit: 963 # append-byte-hex(out, CL) 964 # . . push args 965 51/push-ecx 966 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 967 # . . call - 968 e8/call append-byte-hex/disp32 + 968 e8/call append-byte-hex/disp32 969 # . . discard args 970 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 971 # if (is-alphanumeric?(*curr)) print(out, "/#{*curr}") @@ -987,10 +987,10 @@ if ('onhashchange' in window) { 981 74/jump-if-= $emit-string-literal-data:char-done/disp8 982 # . write(out, "/") 983 # . . push args - 984 68/push Slash/imm32 + 984 68/push Slash/imm32 985 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 986 # . . call - 987 e8/call write/disp32 + 987 e8/call write/disp32 988 # . . discard args 989 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 990 # . append-byte(out, *curr) @@ -998,16 +998,16 @@ if ('onhashchange' in window) { 992 51/push-ecx 993 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 994 # . . call - 995 e8/call append-byte/disp32 + 995 e8/call append-byte/disp32 996 # . . discard args 997 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 998 $emit-string-literal-data:char-done: 999 # write(out, " ") 1000 # . . push args -1001 68/push Space/imm32 +1001 68/push Space/imm32 1002 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 1003 # . . call -1004 e8/call write/disp32 +1004 e8/call write/disp32 1005 # . . discard args 1006 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1007 # ++curr @@ -1021,10 +1021,10 @@ if ('onhashchange' in window) { 1015 31/xor 3/mod/direct 3/rm32/ebx . . . 3/r32/ebx . . # clear ebx 1016 # write(out, "\n") 1017 # . . push args -1018 68/push Newline/imm32 +1018 68/push Newline/imm32 1019 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 1020 # . . call -1021 e8/call write/disp32 +1021 e8/call write/disp32 1022 # . . discard args 1023 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1024 $emit-string-literal-data:next-char: @@ -1084,9 +1084,9 @@ if ('onhashchange' in window) { 1078 # setup 1079 # . clear-stream(_test-output-stream) 1080 # . . push args -1081 68/push _test-output-stream/imm32 +1081 68/push _test-output-stream/imm32 1082 # . . call -1083 e8/call clear-stream/disp32 +1083 e8/call clear-stream/disp32 1084 # . . discard args 1085 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1086 # var slice/ecx = '"abc"/d' @@ -1096,7 +1096,7 @@ if ('onhashchange' in window) { 1090 # emit-string-literal-data(_test-output-stream, slice) 1091 # . . push args 1092 51/push-ecx -1093 68/push _test-output-stream/imm32 +1093 68/push _test-output-stream/imm32 1094 # . . call 1095 e8/call emit-string-literal-data/disp32 1096 # . . discard args @@ -1106,9 +1106,9 @@ if ('onhashchange' in window) { 1125 # . . push args 1126 68/push "F - test-emit-string-literal-data"/imm32 1127 68/push "0x00000003/imm32 61/a 62/b 63/c "/imm32 -1128 68/push _test-output-stream/imm32 +1128 68/push _test-output-stream/imm32 1129 # . . call -1130 e8/call check-stream-equal/disp32 +1130 e8/call check-stream-equal/disp32 1131 # . . discard args 1132 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1133 # . epilogue @@ -1123,9 +1123,9 @@ if ('onhashchange' in window) { 1142 # setup 1143 # . clear-stream(_test-output-stream) 1144 # . . push args -1145 68/push _test-output-stream/imm32 +1145 68/push _test-output-stream/imm32 1146 # . . call -1147 e8/call clear-stream/disp32 +1147 e8/call clear-stream/disp32 1148 # . . discard args 1149 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1150 # var slice/ecx = '""' @@ -1135,7 +1135,7 @@ if ('onhashchange' in window) { 1154 # emit-string-literal-data(_test-output-stream, slice) 1155 # . . push args 1156 51/push-ecx -1157 68/push _test-output-stream/imm32 +1157 68/push _test-output-stream/imm32 1158 # . . call 1159 e8/call emit-string-literal-data/disp32 1160 # . . discard args @@ -1145,9 +1145,9 @@ if ('onhashchange' in window) { 1189 # . . push args 1190 68/push "F - test-emit-string-literal-data-empty"/imm32 1191 68/push "0x00000000/imm32 "/imm32 -1192 68/push _test-output-stream/imm32 +1192 68/push _test-output-stream/imm32 1193 # . . call -1194 e8/call check-stream-equal/disp32 +1194 e8/call check-stream-equal/disp32 1195 # . . discard args 1196 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1197 # . epilogue @@ -1163,9 +1163,9 @@ if ('onhashchange' in window) { 1207 # setup 1208 # . clear-stream(_test-output-stream) 1209 # . . push args -1210 68/push _test-output-stream/imm32 +1210 68/push _test-output-stream/imm32 1211 # . . call -1212 e8/call clear-stream/disp32 +1212 e8/call clear-stream/disp32 1213 # . . discard args 1214 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1215 # var slice/ecx = '"a b"' @@ -1175,7 +1175,7 @@ if ('onhashchange' in window) { 1219 # emit-string-literal-data(_test-output-stream, slice) 1220 # . . push args 1221 51/push-ecx -1222 68/push _test-output-stream/imm32 +1222 68/push _test-output-stream/imm32 1223 # . . call 1224 e8/call emit-string-literal-data/disp32 1225 # . . discard args @@ -1185,9 +1185,9 @@ if ('onhashchange' in window) { 1254 # . . push args 1255 68/push "F - test-emit-string-literal-data-no-metadata-for-non-alphanumerics"/imm32 1256 68/push "0x00000003/imm32 61/a 20 62/b "/imm32 -1257 68/push _test-output-stream/imm32 +1257 68/push _test-output-stream/imm32 1258 # . . call -1259 e8/call check-stream-equal/disp32 +1259 e8/call check-stream-equal/disp32 1260 # . . discard args 1261 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1262 # . epilogue @@ -1202,9 +1202,9 @@ if ('onhashchange' in window) { 1271 # setup 1272 # . clear-stream(_test-output-stream) 1273 # . . push args -1274 68/push _test-output-stream/imm32 +1274 68/push _test-output-stream/imm32 1275 # . . call -1276 e8/call clear-stream/disp32 +1276 e8/call clear-stream/disp32 1277 # . . discard args 1278 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1279 # var slice/ecx = '"a\"b"' @@ -1214,7 +1214,7 @@ if ('onhashchange' in window) { 1283 # emit-string-literal-data(_test-output-stream, slice) 1284 # . . push args 1285 51/push-ecx -1286 68/push _test-output-stream/imm32 +1286 68/push _test-output-stream/imm32 1287 # . . call 1288 e8/call emit-string-literal-data/disp32 1289 # . . discard args @@ -1224,9 +1224,9 @@ if ('onhashchange' in window) { 1318 # . . push args 1319 68/push "F - test-emit-string-literal-data-handles-escape-sequences"/imm32 1320 68/push "0x00000003/imm32 61/a 22 62/b "/imm32 -1321 68/push _test-output-stream/imm32 +1321 68/push _test-output-stream/imm32 1322 # . . call -1323 e8/call check-stream-equal/disp32 +1323 e8/call check-stream-equal/disp32 1324 # . . discard args 1325 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1326 # . epilogue @@ -1241,9 +1241,9 @@ if ('onhashchange' in window) { 1335 # setup 1336 # . clear-stream(_test-output-stream) 1337 # . . push args -1338 68/push _test-output-stream/imm32 +1338 68/push _test-output-stream/imm32 1339 # . . call -1340 e8/call clear-stream/disp32 +1340 e8/call clear-stream/disp32 1341 # . . discard args 1342 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1343 # var slice/ecx = '"a\nb"' @@ -1253,7 +1253,7 @@ if ('onhashchange' in window) { 1347 # emit-string-literal-data(_test-output-stream, slice) 1348 # . . push args 1349 51/push-ecx -1350 68/push _test-output-stream/imm32 +1350 68/push _test-output-stream/imm32 1351 # . . call 1352 e8/call emit-string-literal-data/disp32 1353 # . . discard args @@ -1263,9 +1263,9 @@ if ('onhashchange' in window) { 1382 # . . push args 1383 68/push "F - test-emit-string-literal-data-handles-newline-escape"/imm32 1384 68/push "0x00000003/imm32 61/a 0a 62/b "/imm32 -1385 68/push _test-output-stream/imm32 +1385 68/push _test-output-stream/imm32 1386 # . . call -1387 e8/call check-stream-equal/disp32 +1387 e8/call check-stream-equal/disp32 1388 # . . discard args 1389 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1390 # . epilogue @@ -1322,12 +1322,12 @@ if ('onhashchange' in window) { 1441 52/push-edx 1442 51/push-ecx 1443 # . . call -1444 e8/call skip-string-in-slice/disp32 +1444 e8/call skip-string-in-slice/disp32 1445 # . . discard args 1446 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1447 # . curr = eax 1448 89/copy 3/mod/direct 1/rm32/ecx . . . 0/r32/eax . . # copy eax to ecx -1449 eb/jump $emit-metadata:emit/disp8 +1449 eb/jump $emit-metadata:emit/disp8 1450 $emit-metadata:skip-datum-loop: 1451 # - otherwise scan for '/' 1452 # if (curr == end) return @@ -1336,11 +1336,11 @@ if ('onhashchange' in window) { 1455 # if (*curr == '/') break 1456 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 0/r32/AL . . # copy byte at *ecx to AL 1457 3d/compare-eax-and 0x2f/imm32/slash -1458 74/jump-if-= $emit-metadata:emit/disp8 +1458 74/jump-if-= $emit-metadata:emit/disp8 1459 # ++curr 1460 41/increment-ecx 1461 eb/jump $emit-metadata:skip-datum-loop/disp8 -1462 $emit-metadata:emit: +1462 $emit-metadata:emit: 1463 # slice->start = ecx 1464 89/copy 0/mod/indirect 3/rm32/ebx . . . 1/r32/ecx . . # copy ecx to *ebx 1465 # write-slice-buffered(out, slice) @@ -1348,7 +1348,7 @@ if ('onhashchange' in window) { 1467 53/push-ebx 1468 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 1469 # . . call -1470 e8/call write-slice-buffered/disp32 +1470 e8/call write-slice-buffered/disp32 1471 # . . discard args 1472 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . 8/imm32 . # add to esp 1473 $emit-metadata:end: @@ -1372,16 +1372,16 @@ if ('onhashchange' in window) { 1491 # setup 1492 # . clear-stream(_test-output-stream) 1493 # . . push args -1494 68/push _test-output-stream/imm32 +1494 68/push _test-output-stream/imm32 1495 # . . call -1496 e8/call clear-stream/disp32 +1496 e8/call clear-stream/disp32 1497 # . . discard args 1498 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1499 # . clear-stream($_test-output-buffered-file->buffer) 1500 # . . push args 1501 68/push $_test-output-buffered-file->buffer/imm32 1502 # . . call -1503 e8/call clear-stream/disp32 +1503 e8/call clear-stream/disp32 1504 # . . discard args 1505 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1506 # (eax..ecx) = "abc/def" @@ -1396,25 +1396,25 @@ if ('onhashchange' in window) { 1515 # emit-metadata(_test-output-buffered-file, slice) 1516 # . . push args 1517 51/push-ecx -1518 68/push _test-output-buffered-file/imm32 +1518 68/push _test-output-buffered-file/imm32 1519 # . . call 1520 e8/call emit-metadata/disp32 1521 # . . discard args 1522 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1523 # flush(_test-output-buffered-file) 1524 # . . push args -1525 68/push _test-output-buffered-file/imm32 +1525 68/push _test-output-buffered-file/imm32 1526 # . . call -1527 e8/call flush/disp32 +1527 e8/call flush/disp32 1528 # . . discard args 1529 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1530 # check-stream-equal(_test-output-stream, "/def", msg) # important that there's no leading space 1531 # . . push args 1532 68/push "F - test-emit-metadata"/imm32 1533 68/push "/def"/imm32 -1534 68/push _test-output-stream/imm32 +1534 68/push _test-output-stream/imm32 1535 # . . call -1536 e8/call check-stream-equal/disp32 +1536 e8/call check-stream-equal/disp32 1537 # . . discard args 1538 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1539 # . epilogue @@ -1429,16 +1429,16 @@ if ('onhashchange' in window) { 1548 # setup 1549 # . clear-stream(_test-output-stream) 1550 # . . push args -1551 68/push _test-output-stream/imm32 +1551 68/push _test-output-stream/imm32 1552 # . . call -1553 e8/call clear-stream/disp32 +1553 e8/call clear-stream/disp32 1554 # . . discard args 1555 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1556 # . clear-stream($_test-output-buffered-file->buffer) 1557 # . . push args 1558 68/push $_test-output-buffered-file->buffer/imm32 1559 # . . call -1560 e8/call clear-stream/disp32 +1560 e8/call clear-stream/disp32 1561 # . . discard args 1562 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1563 # (eax..ecx) = "abc" @@ -1453,25 +1453,25 @@ if ('onhashchange' in window) { 1572 # emit-metadata(_test-output-buffered-file, slice) 1573 # . . push args 1574 51/push-ecx -1575 68/push _test-output-buffered-file/imm32 +1575 68/push _test-output-buffered-file/imm32 1576 # . . call 1577 e8/call emit-metadata/disp32 1578 # . . discard args 1579 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1580 # flush(_test-output-buffered-file) 1581 # . . push args -1582 68/push _test-output-buffered-file/imm32 +1582 68/push _test-output-buffered-file/imm32 1583 # . . call -1584 e8/call flush/disp32 +1584 e8/call flush/disp32 1585 # . . discard args 1586 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1587 # check-stream-equal(_test-output-stream, "", msg) 1588 # . . push args 1589 68/push "F - test-emit-metadata-none"/imm32 1590 68/push ""/imm32 -1591 68/push _test-output-stream/imm32 +1591 68/push _test-output-stream/imm32 1592 # . . call -1593 e8/call check-stream-equal/disp32 +1593 e8/call check-stream-equal/disp32 1594 # . . discard args 1595 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1596 # . epilogue @@ -1486,16 +1486,16 @@ if ('onhashchange' in window) { 1605 # setup 1606 # . clear-stream(_test-output-stream) 1607 # . . push args -1608 68/push _test-output-stream/imm32 +1608 68/push _test-output-stream/imm32 1609 # . . call -1610 e8/call clear-stream/disp32 +1610 e8/call clear-stream/disp32 1611 # . . discard args 1612 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1613 # . clear-stream($_test-output-buffered-file->buffer) 1614 # . . push args 1615 68/push $_test-output-buffered-file->buffer/imm32 1616 # . . call -1617 e8/call clear-stream/disp32 +1617 e8/call clear-stream/disp32 1618 # . . discard args 1619 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1620 # (eax..ecx) = "abc/def/ghi" @@ -1510,25 +1510,25 @@ if ('onhashchange' in window) { 1629 # emit-metadata(_test-output-buffered-file, slice) 1630 # . . push args 1631 51/push-ecx -1632 68/push _test-output-buffered-file/imm32 +1632 68/push _test-output-buffered-file/imm32 1633 # . . call 1634 e8/call emit-metadata/disp32 1635 # . . discard args 1636 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1637 # flush(_test-output-buffered-file) 1638 # . . push args -1639 68/push _test-output-buffered-file/imm32 +1639 68/push _test-output-buffered-file/imm32 1640 # . . call -1641 e8/call flush/disp32 +1641 e8/call flush/disp32 1642 # . . discard args 1643 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1644 # check-stream-equal(_test-output-stream, "/def/ghi", msg) # important that there's no leading space 1645 # . . push args 1646 68/push "F - test-emit-metadata-multiple"/imm32 1647 68/push "/def/ghi"/imm32 -1648 68/push _test-output-stream/imm32 +1648 68/push _test-output-stream/imm32 1649 # . . call -1650 e8/call check-stream-equal/disp32 +1650 e8/call check-stream-equal/disp32 1651 # . . discard args 1652 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1653 # . epilogue @@ -1543,16 +1543,16 @@ if ('onhashchange' in window) { 1662 # setup 1663 # . clear-stream(_test-output-stream) 1664 # . . push args -1665 68/push _test-output-stream/imm32 +1665 68/push _test-output-stream/imm32 1666 # . . call -1667 e8/call clear-stream/disp32 +1667 e8/call clear-stream/disp32 1668 # . . discard args 1669 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1670 # . clear-stream($_test-output-buffered-file->buffer) 1671 # . . push args 1672 68/push $_test-output-buffered-file->buffer/imm32 1673 # . . call -1674 e8/call clear-stream/disp32 +1674 e8/call clear-stream/disp32 1675 # . . discard args 1676 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1677 # var slice/ecx = "/abc" @@ -1569,25 +1569,25 @@ if ('onhashchange' in window) { 1688 # emit-metadata(_test-output-buffered-file, slice) 1689 # . . push args 1690 51/push-ecx -1691 68/push _test-output-buffered-file/imm32 +1691 68/push _test-output-buffered-file/imm32 1692 # . . call 1693 e8/call emit-metadata/disp32 1694 # . . discard args 1695 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1696 # flush(_test-output-buffered-file) 1697 # . . push args -1698 68/push _test-output-buffered-file/imm32 +1698 68/push _test-output-buffered-file/imm32 1699 # . . call -1700 e8/call flush/disp32 +1700 e8/call flush/disp32 1701 # . . discard args 1702 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1703 # check-stream-equal(_test-output-stream, "/abc", msg) # nothing skipped 1704 # . . push args 1705 68/push "F - test-emit-metadata-when-no-datum"/imm32 1706 68/push "/abc"/imm32 -1707 68/push _test-output-stream/imm32 +1707 68/push _test-output-stream/imm32 1708 # . . call -1709 e8/call check-stream-equal/disp32 +1709 e8/call check-stream-equal/disp32 1710 # . . discard args 1711 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1712 # . epilogue @@ -1602,16 +1602,16 @@ if ('onhashchange' in window) { 1721 # setup 1722 # . clear-stream(_test-output-stream) 1723 # . . push args -1724 68/push _test-output-stream/imm32 +1724 68/push _test-output-stream/imm32 1725 # . . call -1726 e8/call clear-stream/disp32 +1726 e8/call clear-stream/disp32 1727 # . . discard args 1728 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1729 # . clear-stream($_test-output-buffered-file->buffer) 1730 # . . push args 1731 68/push $_test-output-buffered-file->buffer/imm32 1732 # . . call -1733 e8/call clear-stream/disp32 +1733 e8/call clear-stream/disp32 1734 # . . discard args 1735 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1736 # var slice/ecx = "\"abc/def\"/ghi" @@ -1621,16 +1621,16 @@ if ('onhashchange' in window) { 1740 # emit-metadata(_test-output-buffered-file, slice) 1741 # . . push args 1742 51/push-ecx -1743 68/push _test-output-buffered-file/imm32 +1743 68/push _test-output-buffered-file/imm32 1744 # . . call 1745 e8/call emit-metadata/disp32 1746 # . . discard args 1747 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1748 # flush(_test-output-buffered-file) 1749 # . . push args -1750 68/push _test-output-buffered-file/imm32 +1750 68/push _test-output-buffered-file/imm32 1751 # . . call -1752 e8/call flush/disp32 +1752 e8/call flush/disp32 1753 # . . discard args 1754 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1755 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -1638,9 +1638,9 @@ if ('onhashchange' in window) { 1782 # . . push args 1783 68/push "F - test-emit-metadata-in-string-literal"/imm32 1784 68/push "/ghi"/imm32 -1785 68/push _test-output-stream/imm32 +1785 68/push _test-output-stream/imm32 1786 # . . call -1787 e8/call check-stream-equal/disp32 +1787 e8/call check-stream-equal/disp32 1788 # . . discard args 1789 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1790 # . epilogue @@ -1722,7 +1722,7 @@ if ('onhashchange' in window) { 1866 68/push 3/imm32 1867 50/push-eax 1868 # . . call -1869 e8/call check-ints-equal/disp32 +1869 e8/call check-ints-equal/disp32 1870 # . . discard args 1871 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1872 # . epilogue @@ -1753,7 +1753,7 @@ if ('onhashchange' in window) { 1897 68/push 3/imm32 1898 50/push-eax 1899 # . . call -1900 e8/call check-ints-equal/disp32 +1900 e8/call check-ints-equal/disp32 1901 # . . discard args 1902 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1903 # . epilogue diff --git a/html/apps/ex2.mu.html b/html/apps/ex2.mu.html index d891a1f6..e3410433 100644 --- a/html/apps/ex2.mu.html +++ b/html/apps/ex2.mu.html @@ -56,7 +56,7 @@ if ('onhashchange' in window) { https://github.com/akkartik/mu/blob/master/apps/ex2.mu
- 1 # Add two numbers, and return the result in the exit code.
+ 1 # Add 3 and 4, and return the result in the exit code.
  2 #
  3 # To run:
  4 #   $ ./translate_mu apps/ex2.mu
diff --git a/html/apps/ex2.subx.html b/html/apps/ex2.subx.html
index 392f5440..4ff62017 100644
--- a/html/apps/ex2.subx.html
+++ b/html/apps/ex2.subx.html
@@ -53,7 +53,7 @@ if ('onhashchange' in window) {
 
 https://github.com/akkartik/mu/blob/master/apps/ex2.subx
 
- 1 # Add 1 and 1, and return the result in the exit code.
+ 1 # Add 3 and 4, and return the result in the exit code.
  2 #
  3 # To run:
  4 #   $ ./bootstrap translate init.linux apps/ex2.subx -o apps/ex2
@@ -65,10 +65,10 @@ if ('onhashchange' in window) {
 10 == code
 11 
 12 Entry:
-13 # ebx = 1
-14 bb/copy-to-ebx  1/imm32
-15 # increment ebx
-16 43/increment-ebx
+13 # ebx = 3
+14 bb/copy-to-ebx  3/imm32
+15 # add 4 to ebx
+16 81 0/subop/add 3/mod/direct 3/rm32/ebx 4/imm32
 17 # exit(ebx)
 18 e8/call  syscall_exit/disp32
 19 
diff --git a/html/apps/factorial.mu.html b/html/apps/factorial.mu.html
index 25a0fa2f..e735e68e 100644
--- a/html/apps/factorial.mu.html
+++ b/html/apps/factorial.mu.html
@@ -87,7 +87,7 @@ if ('onhashchange' in window) {
 28 
 29 fn test-factorial {
 30   var result/eax: int <- factorial 5
-31   check-ints-equal result 0x78 "F - test-factorial"
+31   check-ints-equal result 0x78 "F - test-factorial"
 32 }
 33 
 34 fn main args-on-stack: (addr array (addr array byte)) -> exit-status/ebx: int {
@@ -104,7 +104,7 @@ if ('onhashchange' in window) {
 45     }
 46     # if (args[1] == "test") run-tests()
 47     var tmp2/ecx: (addr addr array byte) <- index args, 1
-48     var tmp3/eax: boolean <- string-equal? *tmp2, "test"
+48     var tmp3/eax: boolean <- string-equal? *tmp2, "test"
 49     compare tmp3, 0
 50     {
 51       break-if-=
diff --git a/html/apps/factorial.subx.html b/html/apps/factorial.subx.html
index 8abcdfbc..f76c776b 100644
--- a/html/apps/factorial.subx.html
+++ b/html/apps/factorial.subx.html
@@ -86,10 +86,10 @@ if ('onhashchange' in window) {
  25     # initialize heap
  26     # . Heap = new-segment(Heap-size)
  27     # . . push args
- 28     68/push  Heap/imm32
- 29     ff          6/subop/push        0/mod/indirect  5/rm32/.disp32            .             .           .           Heap-size/disp32                  # push *Heap-size
+ 28     68/push  Heap/imm32
+ 29     ff          6/subop/push        0/mod/indirect  5/rm32/.disp32            .             .           .           Heap-size/disp32                  # push *Heap-size
  30     # . . call
- 31     e8/call  new-segment/disp32
+ 31     e8/call  new-segment/disp32
  32     # . . discard args
  33     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  34 
@@ -103,7 +103,7 @@ if ('onhashchange' in window) {
  42     68/push  "test"/imm32
  43     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
  44     # . . call
- 45     e8/call  kernel-string-equal?/disp32
+ 45     e8/call  kernel-string-equal?/disp32
  46     # . . discard args
  47     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  48     # . if (eax == false) goto run-main
@@ -112,7 +112,7 @@ if ('onhashchange' in window) {
  51     # run-tests()
  52     e8/call  run-tests/disp32
  53     # syscall(exit, *Num-test-failures)
- 54     8b/copy                         0/mod/indirect  5/rm32/.disp32            .             .           3/r32/ebx   Num-test-failures/disp32          # copy *Num-test-failures to ebx
+ 54     8b/copy                         0/mod/indirect  5/rm32/.disp32            .             .           3/r32/ebx   Num-test-failures/disp32          # copy *Num-test-failures to ebx
  55     eb/jump  $main:end/disp8
  56 $run-main:
  57     # - otherwise print factorial(5)
@@ -134,7 +134,7 @@ if ('onhashchange' in window) {
  73     50/push-eax
  74     51/push-ecx
  75     # . . call
- 76     e8/call  write-int32-decimal/disp32
+ 76     e8/call  write-int32-decimal/disp32
  77     # . . discard args
  78     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  79     # write-stream(stderr, buffer)
@@ -142,15 +142,15 @@ if ('onhashchange' in window) {
  81     51/push-ecx
  82     68/push  2/imm32/stderr
  83     # . . call
- 84     e8/call  write-stream/disp32
+ 84     e8/call  write-stream/disp32
  85     # . . discard args
  86     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  87     # write(stderr, Newline)
  88     # . . push args
- 89     68/push  Newline/imm32
+ 89     68/push  Newline/imm32
  90     68/push  2/imm32/stderr
  91     # . . call
- 92     e8/call  write/disp32
+ 92     e8/call  write/disp32
  93     # . . discard args
  94     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  95     # syscall(exit, eax)
@@ -201,7 +201,7 @@ if ('onhashchange' in window) {
 140     68/push  0x78/imm32/expected-120
 141     50/push-eax
 142     # . . call
-143     e8/call  check-ints-equal/disp32
+143     e8/call  check-ints-equal/disp32
 144     # . . discard args
 145     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 146     # end
diff --git a/html/apps/factorial2.subx.html b/html/apps/factorial2.subx.html
index 628bb7c2..109ce199 100644
--- a/html/apps/factorial2.subx.html
+++ b/html/apps/factorial2.subx.html
@@ -85,10 +85,10 @@ if ('onhashchange' in window) {
  25     # initialize heap
  26     # . Heap = new-segment(Heap-size)
  27     # . . push args
- 28     68/push Heap/imm32
- 29     ff 6/subop/push *Heap-size
+ 28     68/push Heap/imm32
+ 29     ff 6/subop/push *Heap-size
  30     # . . call
- 31     e8/call new-segment/disp32
+ 31     e8/call new-segment/disp32
  32     # . . discard args
  33     81 0/subop/add %esp 8/imm32
  34 
@@ -102,7 +102,7 @@ if ('onhashchange' in window) {
  42     68/push "test"/imm32
  43     ff 6/subop/push *(ebp+8)
  44     # . . call
- 45     e8/call kernel-string-equal?/disp32
+ 45     e8/call kernel-string-equal?/disp32
  46     # . . discard args
  47     81 0/subop/add %esp 8/imm32
  48     # . if (eax == false) goto run-main
@@ -111,7 +111,7 @@ if ('onhashchange' in window) {
  51     # run-tests()
  52     e8/call run-tests/disp32
  53     # syscall(exit, *Num-test-failures)
- 54     8b/-> *Num-test-failures 3/r32/ebx
+ 54     8b/-> *Num-test-failures 3/r32/ebx
  55     eb/jump $main:end/disp8
  56 $run-main:
  57     # - otherwise return factorial(5)
@@ -170,7 +170,7 @@ if ('onhashchange' in window) {
 110     68/push 0x78/imm32/expected-120
 111     50/push-eax
 112     # . . call
-113     e8/call check-ints-equal/disp32
+113     e8/call check-ints-equal/disp32
 114     # . . discard args
 115     81 0/subop/add %esp 0xc/imm32
 116     # end
diff --git a/html/apps/factorial3.subx.html b/html/apps/factorial3.subx.html
index 1077de96..e8c1a117 100644
--- a/html/apps/factorial3.subx.html
+++ b/html/apps/factorial3.subx.html
@@ -83,21 +83,21 @@ if ('onhashchange' in window) {
 24     89/<- %ebp 4/r32/esp
 25 
 26     # initialize heap
-27     (new-segment *Heap-size Heap)
+27     (new-segment *Heap-size Heap)
 28 
 29     # - if argc > 1 and argv[1] == "test", then return run_tests()
 30     # if (argc <= 1) goto run-main
 31     81 7/subop/compare *ebp 1/imm32
 32     7e/jump-if-<= $run-main/disp8
 33     # if (!kernel-string-equal?(argv[1], "test")) goto run-main
-34     (kernel-string-equal? *(ebp+8) "test")  # => eax
+34     (kernel-string-equal? *(ebp+8) "test")  # => eax
 35     # . if (eax == false) goto run-main
 36     3d/compare-eax-and 0/imm32/false
 37     74/jump-if-= $run-main/disp8
 38     #
 39     (run-tests)
 40     # syscall(exit, *Num-test-failures)
-41     8b/-> *Num-test-failures 3/r32/ebx
+41     8b/-> *Num-test-failures 3/r32/ebx
 42     eb/jump $main:end/disp8
 43 $run-main:
 44     # - otherwise
@@ -135,7 +135,7 @@ if ('onhashchange' in window) {
 76 
 77 test-factorial:
 78     (factorial 5)
-79     (check-ints-equal %eax 0x78 "F - test-factorial")
+79     (check-ints-equal %eax 0x78 "F - test-factorial")
 80     c3/return
 
diff --git a/html/apps/factorial4.subx.html b/html/apps/factorial4.subx.html index 4886a698..df467f04 100644 --- a/html/apps/factorial4.subx.html +++ b/html/apps/factorial4.subx.html @@ -84,7 +84,7 @@ if ('onhashchange' in window) { 25 89/<- %ebp 4/r32/esp 26 27 # initialize heap -28 (new-segment *Heap-size Heap) +28 (new-segment *Heap-size Heap) 29 30 # - if argc > 1, then return run_tests() 31 { @@ -92,13 +92,13 @@ if ('onhashchange' in window) { 33 81 7/subop/compare *ebp 1/imm32 34 7e/jump-if-<= break/disp8 35 # if (!kernel-string-equal?(argv[1], "test")) break -36 (kernel-string-equal? *(ebp+8) "test") # => eax +36 (kernel-string-equal? *(ebp+8) "test") # => eax 37 3d/compare-eax-and 0/imm32/false 38 74/jump-if-= break/disp8 39 # 40 (run-tests) 41 # eax = *Num-test-failures -42 8b/-> *Num-test-failures 3/r32/ebx +42 8b/-> *Num-test-failures 3/r32/ebx 43 } 44 # if (argc <= 1) factorial(5) 45 { @@ -143,7 +143,7 @@ if ('onhashchange' in window) { 84 85 test-factorial: 86 (factorial 5) -87 (check-ints-equal %eax 0x78 "F - test-factorial") +87 (check-ints-equal %eax 0x78 "F - test-factorial") 88 c3/return
diff --git a/html/apps/hex.subx.html b/html/apps/hex.subx.html index 99496926..5f6189c1 100644 --- a/html/apps/hex.subx.html +++ b/html/apps/hex.subx.html @@ -85,10 +85,10 @@ if ('onhashchange' in window) { 24 # initialize heap 25 # . Heap = new-segment(Heap-size) 26 # . . push args - 27 68/push Heap/imm32 - 28 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Heap-size/disp32 # push *Heap-size + 27 68/push Heap/imm32 + 28 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Heap-size/disp32 # push *Heap-size 29 # . . call - 30 e8/call new-segment/disp32 + 30 e8/call new-segment/disp32 31 # . . discard args 32 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 33 @@ -102,7 +102,7 @@ if ('onhashchange' in window) { 41 68/push "test"/imm32 42 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 43 # . . call - 44 e8/call kernel-string-equal?/disp32 + 44 e8/call kernel-string-equal?/disp32 45 # . . discard args 46 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 47 # . if (eax == false) goto interactive @@ -111,16 +111,16 @@ if ('onhashchange' in window) { 50 # run-tests() 51 e8/call run-tests/disp32 52 # syscall(exit, *Num-test-failures) - 53 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/ebx Num-test-failures/disp32 # copy *Num-test-failures to ebx + 53 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/ebx Num-test-failures/disp32 # copy *Num-test-failures to ebx 54 eb/jump $subx-hex-main:end/disp8 55 $subx-hex-main:interactive: 56 # - otherwise convert stdin 57 # . subx-hex(Stdin, Stdout, Stderr, 0) 58 # . . push args 59 68/push 0/imm32/exit-descriptor - 60 68/push Stderr/imm32 - 61 68/push Stdout/imm32 - 62 68/push Stdin/imm32 + 60 68/push Stderr/imm32 + 61 68/push Stdout/imm32 + 62 68/push Stdin/imm32 63 # . . call 64 e8/call subx-hex/disp32 65 # . . discard args @@ -162,7 +162,7 @@ if ('onhashchange' in window) { 101 50/push-eax 102 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 103 # . . call - 104 e8/call write-byte-buffered/disp32 + 104 e8/call write-byte-buffered/disp32 105 # . . discard args 106 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 107 # loop @@ -172,7 +172,7 @@ if ('onhashchange' in window) { 111 # . . push args 112 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 113 # . . call - 114 e8/call flush/disp32 + 114 e8/call flush/disp32 115 # . . discard args 116 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 117 $subx-hex:end: @@ -218,7 +218,7 @@ if ('onhashchange' in window) { 157 3d/compare-eax-and 0xffffffff/imm32/Eof 158 74/jump-if-= $convert-next-octet:end/disp8 159 # eax = from-hex-char(eax) - 160 e8/call from-hex-char/disp32 + 160 e8/call from-hex-char/disp32 161 # ecx = eax 162 89/copy 3/mod/direct 1/rm32/ecx . . . 0/r32/eax . . # copy eax to ecx 163 # eax = scan-next-byte(in, err, ed) @@ -240,10 +240,10 @@ if ('onhashchange' in window) { 179 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 180 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x10/disp8 . # push *(ebp+16) 181 # . . call - 182 e8/call error-byte/disp32 # never returns + 182 e8/call error-byte/disp32 # never returns 183 $convert-next-octet:convert: 184 # eax = from-hex-char(eax) - 185 e8/call from-hex-char/disp32 + 185 e8/call from-hex-char/disp32 186 # eax = (ecx << 4) | eax 187 # . ecx <<= 4 188 c1/shift 4/subop/left 3/mod/direct 1/rm32/ecx . . . . . 4/imm8 # shift ecx left by 4 bits @@ -265,39 +265,39 @@ if ('onhashchange' in window) { 204 # clear all streams 205 # . clear-stream(_test-stream) 206 # . . push args - 207 68/push _test-stream/imm32 + 207 68/push _test-stream/imm32 208 # . . call - 209 e8/call clear-stream/disp32 + 209 e8/call clear-stream/disp32 210 # . . discard args 211 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 212 # . clear-stream($_test-buffered-file->buffer) 213 # . . push args 214 68/push $_test-buffered-file->buffer/imm32 215 # . . call - 216 e8/call clear-stream/disp32 + 216 e8/call clear-stream/disp32 217 # . . discard args 218 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 219 # . clear-stream(_test-error-stream) 220 # . . push args - 221 68/push _test-error-stream/imm32 + 221 68/push _test-error-stream/imm32 222 # . . call - 223 e8/call clear-stream/disp32 + 223 e8/call clear-stream/disp32 224 # . . discard args 225 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 226 # . clear-stream($_test-error-buffered-file->buffer) 227 # . . push args 228 68/push $_test-error-buffered-file->buffer/imm32 229 # . . call - 230 e8/call clear-stream/disp32 + 230 e8/call clear-stream/disp32 231 # . . discard args 232 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 233 # initialize '_test-stream' to "abc" 234 # . write(_test-stream, "abc") 235 # . . push args 236 68/push "abc"/imm32 - 237 68/push _test-stream/imm32 + 237 68/push _test-stream/imm32 238 # . . call - 239 e8/call write/disp32 + 239 e8/call write/disp32 240 # . . discard args 241 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 242 # initialize exit-descriptor 'ed' for the call to 'convert-next-octet' below @@ -309,14 +309,14 @@ if ('onhashchange' in window) { 248 68/push 0xc/imm32/nbytes-of-args-for-convert-next-octet 249 51/push-ecx/ed 250 # . . call - 251 e8/call tailor-exit-descriptor/disp32 + 251 e8/call tailor-exit-descriptor/disp32 252 # . . discard args 253 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 254 # eax = convert-next-octet(_test-buffered-file, _test-error-buffered-file, ed) 255 # . . push args 256 51/push-ecx/ed - 257 68/push _test-error-buffered-file/imm32 - 258 68/push _test-buffered-file/imm32 + 257 68/push _test-error-buffered-file/imm32 + 258 68/push _test-buffered-file/imm32 259 # . . call 260 e8/call convert-next-octet/disp32 261 # registers except esp may be clobbered at this point @@ -333,7 +333,7 @@ if ('onhashchange' in window) { 272 # . . push ed->value 273 ff 6/subop/push 1/mod/*+disp8 1/rm32/ecx . . . . 4/disp8 . # push *(ecx+4) 274 # . . call - 275 e8/call check-ints-equal/disp32 + 275 e8/call check-ints-equal/disp32 276 # . . discard args 277 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 278 # return if abort @@ -345,7 +345,7 @@ if ('onhashchange' in window) { 284 68/push 0xab/imm32/ab 285 50/push-eax 286 # . . call - 287 e8/call check-ints-equal/disp32 + 287 e8/call check-ints-equal/disp32 288 # . . discard args 289 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 290 $test-convert-next-octet:end: @@ -363,30 +363,30 @@ if ('onhashchange' in window) { 302 # clear all streams 303 # . clear-stream(_test-stream) 304 # . . push args - 305 68/push _test-stream/imm32 + 305 68/push _test-stream/imm32 306 # . . call - 307 e8/call clear-stream/disp32 + 307 e8/call clear-stream/disp32 308 # . . discard args 309 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 310 # . clear-stream($_test-buffered-file->buffer) 311 # . . push args 312 68/push $_test-buffered-file->buffer/imm32 313 # . . call - 314 e8/call clear-stream/disp32 + 314 e8/call clear-stream/disp32 315 # . . discard args 316 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 317 # . clear-stream(_test-error-stream) 318 # . . push args - 319 68/push _test-error-stream/imm32 + 319 68/push _test-error-stream/imm32 320 # . . call - 321 e8/call clear-stream/disp32 + 321 e8/call clear-stream/disp32 322 # . . discard args 323 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 324 # . clear-stream($_test-error-buffered-file->buffer) 325 # . . push args 326 68/push $_test-error-buffered-file->buffer/imm32 327 # . . call - 328 e8/call clear-stream/disp32 + 328 e8/call clear-stream/disp32 329 # . . discard args 330 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 331 # don't initialize '_test-stream' @@ -399,14 +399,14 @@ if ('onhashchange' in window) { 338 68/push 0xc/imm32/nbytes-of-args-for-convert-next-octet 339 51/push-ecx/ed 340 # . . call - 341 e8/call tailor-exit-descriptor/disp32 + 341 e8/call tailor-exit-descriptor/disp32 342 # . . discard args 343 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 344 # eax = convert-next-octet(_test-buffered-file, _test-error-buffered-file, ed) 345 # . . push args 346 51/push-ecx/ed - 347 68/push _test-error-buffered-file/imm32 - 348 68/push _test-buffered-file/imm32 + 347 68/push _test-error-buffered-file/imm32 + 348 68/push _test-buffered-file/imm32 349 # . . call 350 e8/call convert-next-octet/disp32 351 # registers except esp may be clobbered at this point @@ -423,7 +423,7 @@ if ('onhashchange' in window) { 362 # . . push ed->value 363 ff 6/subop/push 1/mod/*+disp8 1/rm32/ecx . . . . 4/disp8 . # push *(ecx+4) 364 # . . call - 365 e8/call check-ints-equal/disp32 + 365 e8/call check-ints-equal/disp32 366 # . . discard args 367 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 368 # return if abort @@ -435,7 +435,7 @@ if ('onhashchange' in window) { 374 68/push 0xffffffff/imm32/Eof 375 50/push-eax 376 # . . call - 377 e8/call check-ints-equal/disp32 + 377 e8/call check-ints-equal/disp32 378 # . . discard args 379 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 380 $test-convert-next-octet-handles-Eof:end: @@ -453,39 +453,39 @@ if ('onhashchange' in window) { 392 # clear all streams 393 # . clear-stream(_test-stream) 394 # . . push args - 395 68/push _test-stream/imm32 + 395 68/push _test-stream/imm32 396 # . . call - 397 e8/call clear-stream/disp32 + 397 e8/call clear-stream/disp32 398 # . . discard args 399 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 400 # . clear-stream($_test-buffered-file->buffer) 401 # . . push args 402 68/push $_test-buffered-file->buffer/imm32 403 # . . call - 404 e8/call clear-stream/disp32 + 404 e8/call clear-stream/disp32 405 # . . discard args 406 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 407 # . clear-stream(_test-error-stream) 408 # . . push args - 409 68/push _test-error-stream/imm32 + 409 68/push _test-error-stream/imm32 410 # . . call - 411 e8/call clear-stream/disp32 + 411 e8/call clear-stream/disp32 412 # . . discard args 413 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 414 # . clear-stream($_test-error-buffered-file->buffer) 415 # . . push args 416 68/push $_test-error-buffered-file->buffer/imm32 417 # . . call - 418 e8/call clear-stream/disp32 + 418 e8/call clear-stream/disp32 419 # . . discard args 420 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 421 # initialize '_test-stream' to "a" 422 # . write(_test-stream, "a") 423 # . . push args 424 68/push "a"/imm32 - 425 68/push _test-stream/imm32 + 425 68/push _test-stream/imm32 426 # . . call - 427 e8/call write/disp32 + 427 e8/call write/disp32 428 # . . discard args 429 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 430 # initialize exit-descriptor 'ed' for the call to 'convert-next-octet' below @@ -497,14 +497,14 @@ if ('onhashchange' in window) { 436 68/push 0xc/imm32/nbytes-of-args-for-convert-next-octet 437 51/push-ecx/ed 438 # . . call - 439 e8/call tailor-exit-descriptor/disp32 + 439 e8/call tailor-exit-descriptor/disp32 440 # . . discard args 441 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 442 # eax = convert-next-octet(_test-buffered-file, _test-error-buffered-file, ed) 443 # . . push args 444 51/push-ecx/ed - 445 68/push _test-error-buffered-file/imm32 - 446 68/push _test-buffered-file/imm32 + 445 68/push _test-error-buffered-file/imm32 + 446 68/push _test-buffered-file/imm32 447 # . . call 448 e8/call convert-next-octet/disp32 449 # registers except esp may be clobbered at this point @@ -521,7 +521,7 @@ if ('onhashchange' in window) { 460 # . . push ed->value 461 ff 6/subop/push 1/mod/*+disp8 1/rm32/ecx . . . . 4/disp8 . # push *(ecx+4) 462 # . . call - 463 e8/call check-ints-equal/disp32 + 463 e8/call check-ints-equal/disp32 464 # . . discard args 465 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 466 $test-convert-next-octet-aborts-on-single-hex-byte:end: @@ -554,7 +554,7 @@ if ('onhashchange' in window) { 493 # . . push args 494 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 495 # . . call - 496 e8/call read-byte-buffered/disp32 + 496 e8/call read-byte-buffered/disp32 497 # . . discard args 498 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 499 # if (eax == Eof) return eax @@ -567,7 +567,7 @@ if ('onhashchange' in window) { 506 # . . push args 507 50/push-eax 508 # . . call - 509 e8/call is-hex-digit?/disp32 + 509 e8/call is-hex-digit?/disp32 510 # . . discard args 511 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 512 # . compare with 'false' @@ -606,7 +606,7 @@ if ('onhashchange' in window) { 545 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 546 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x10/disp8 . # push *(ebp+16) 547 # . . call - 548 e8/call error-byte/disp32 # never returns + 548 e8/call error-byte/disp32 # never returns 549 $scan-next-byte:end: 550 # . restore registers 551 # . epilogue @@ -622,39 +622,39 @@ if ('onhashchange' in window) { 561 # clear all streams 562 # . clear-stream(_test-stream) 563 # . . push args - 564 68/push _test-stream/imm32 + 564 68/push _test-stream/imm32 565 # . . call - 566 e8/call clear-stream/disp32 + 566 e8/call clear-stream/disp32 567 # . . discard args 568 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 569 # . clear-stream($_test-buffered-file->buffer) 570 # . . push args 571 68/push $_test-buffered-file->buffer/imm32 572 # . . call - 573 e8/call clear-stream/disp32 + 573 e8/call clear-stream/disp32 574 # . . discard args 575 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 576 # . clear-stream(_test-error-stream) 577 # . . push args - 578 68/push _test-error-stream/imm32 + 578 68/push _test-error-stream/imm32 579 # . . call - 580 e8/call clear-stream/disp32 + 580 e8/call clear-stream/disp32 581 # . . discard args 582 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 583 # . clear-stream($_test-error-buffered-file->buffer) 584 # . . push args 585 68/push $_test-error-buffered-file->buffer/imm32 586 # . . call - 587 e8/call clear-stream/disp32 + 587 e8/call clear-stream/disp32 588 # . . discard args 589 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 590 # initialize '_test-stream' to "abc" 591 # . write(_test-stream, "abc") 592 # . . push args 593 68/push "abc"/imm32 - 594 68/push _test-stream/imm32 + 594 68/push _test-stream/imm32 595 # . . call - 596 e8/call write/disp32 + 596 e8/call write/disp32 597 # . . discard args 598 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 599 # initialize exit-descriptor 'ed' for the call to 'scan-next-byte' below @@ -666,14 +666,14 @@ if ('onhashchange' in window) { 605 68/push 0xc/imm32/nbytes-of-args-for-scan-next-byte 606 51/push-ecx/ed 607 # . . call - 608 e8/call tailor-exit-descriptor/disp32 + 608 e8/call tailor-exit-descriptor/disp32 609 # . . discard args 610 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 611 # eax = scan-next-byte(_test-buffered-file, _test-error-buffered-file, ed) 612 # . . push args 613 51/push-ecx/ed - 614 68/push _test-error-buffered-file/imm32 - 615 68/push _test-buffered-file/imm32 + 614 68/push _test-error-buffered-file/imm32 + 615 68/push _test-buffered-file/imm32 616 # . . call 617 e8/call scan-next-byte/disp32 618 # registers except esp may be clobbered at this point @@ -690,7 +690,7 @@ if ('onhashchange' in window) { 629 # . . push ed->value 630 ff 6/subop/push 1/mod/*+disp8 1/rm32/ecx . . . . 4/disp8 . # push *(ecx+4) 631 # . . call - 632 e8/call check-ints-equal/disp32 + 632 e8/call check-ints-equal/disp32 633 # . . discard args 634 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 635 # return if abort @@ -702,7 +702,7 @@ if ('onhashchange' in window) { 641 68/push 0x61/imm32/a 642 50/push-eax 643 # . . call - 644 e8/call check-ints-equal/disp32 + 644 e8/call check-ints-equal/disp32 645 # . . discard args 646 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 647 $test-scan-next-byte:end: @@ -720,39 +720,39 @@ if ('onhashchange' in window) { 659 # clear all streams 660 # . clear-stream(_test-stream) 661 # . . push args - 662 68/push _test-stream/imm32 + 662 68/push _test-stream/imm32 663 # . . call - 664 e8/call clear-stream/disp32 + 664 e8/call clear-stream/disp32 665 # . . discard args 666 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 667 # . clear-stream($_test-buffered-file->buffer) 668 # . . push args 669 68/push $_test-buffered-file->buffer/imm32 670 # . . call - 671 e8/call clear-stream/disp32 + 671 e8/call clear-stream/disp32 672 # . . discard args 673 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 674 # . clear-stream(_test-error-stream) 675 # . . push args - 676 68/push _test-error-stream/imm32 + 676 68/push _test-error-stream/imm32 677 # . . call - 678 e8/call clear-stream/disp32 + 678 e8/call clear-stream/disp32 679 # . . discard args 680 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 681 # . clear-stream($_test-error-buffered-file->buffer) 682 # . . push args 683 68/push $_test-error-buffered-file->buffer/imm32 684 # . . call - 685 e8/call clear-stream/disp32 + 685 e8/call clear-stream/disp32 686 # . . discard args 687 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 688 # initialize '_test-stream' to input with leading whitespace 689 # . write(_test-stream, text) 690 # . . push args 691 68/push " abc"/imm32 - 692 68/push _test-stream/imm32 + 692 68/push _test-stream/imm32 693 # . . call - 694 e8/call write/disp32 + 694 e8/call write/disp32 695 # . . discard args 696 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 697 # initialize exit-descriptor 'ed' for the call to 'scan-next-byte' below @@ -764,14 +764,14 @@ if ('onhashchange' in window) { 703 68/push 0xc/imm32/nbytes-of-args-for-scan-next-byte 704 51/push-ecx/ed 705 # . . call - 706 e8/call tailor-exit-descriptor/disp32 + 706 e8/call tailor-exit-descriptor/disp32 707 # . . discard args 708 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 709 # eax = scan-next-byte(_test-buffered-file, _test-error-buffered-file, ed) 710 # . . push args 711 51/push-ecx/ed - 712 68/push _test-error-buffered-file/imm32 - 713 68/push _test-buffered-file/imm32 + 712 68/push _test-error-buffered-file/imm32 + 713 68/push _test-buffered-file/imm32 714 # . . call 715 e8/call scan-next-byte/disp32 716 # registers except esp may be clobbered at this point @@ -788,7 +788,7 @@ if ('onhashchange' in window) { 727 # . . push ed->value 728 ff 6/subop/push 1/mod/*+disp8 1/rm32/ecx . . . . 4/disp8 . # push *(ecx+4) 729 # . . call - 730 e8/call check-ints-equal/disp32 + 730 e8/call check-ints-equal/disp32 731 # . . discard args 732 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 733 # return if abort @@ -800,7 +800,7 @@ if ('onhashchange' in window) { 739 68/push 0x61/imm32/a 740 50/push-eax 741 # . . call - 742 e8/call check-ints-equal/disp32 + 742 e8/call check-ints-equal/disp32 743 # . . discard args 744 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 745 $test-scan-next-byte-skips-whitespace:end: @@ -818,47 +818,47 @@ if ('onhashchange' in window) { 757 # clear all streams 758 # . clear-stream(_test-stream) 759 # . . push args - 760 68/push _test-stream/imm32 + 760 68/push _test-stream/imm32 761 # . . call - 762 e8/call clear-stream/disp32 + 762 e8/call clear-stream/disp32 763 # . . discard args 764 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 765 # . clear-stream($_test-buffered-file->buffer) 766 # . . push args 767 68/push $_test-buffered-file->buffer/imm32 768 # . . call - 769 e8/call clear-stream/disp32 + 769 e8/call clear-stream/disp32 770 # . . discard args 771 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 772 # . clear-stream(_test-error-stream) 773 # . . push args - 774 68/push _test-error-stream/imm32 + 774 68/push _test-error-stream/imm32 775 # . . call - 776 e8/call clear-stream/disp32 + 776 e8/call clear-stream/disp32 777 # . . discard args 778 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 779 # . clear-stream($_test-error-buffered-file->buffer) 780 # . . push args 781 68/push $_test-error-buffered-file->buffer/imm32 782 # . . call - 783 e8/call clear-stream/disp32 + 783 e8/call clear-stream/disp32 784 # . . discard args 785 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 786 # initialize '_test-stream' to input with leading comment 787 # . write(_test-stream, comment) 788 # . . push args 789 68/push "#x\n"/imm32 - 790 68/push _test-stream/imm32 + 790 68/push _test-stream/imm32 791 # . . call - 792 e8/call write/disp32 + 792 e8/call write/disp32 793 # . . discard args 794 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 795 # . write(_test-stream, real text) 796 # . . push args 797 68/push "ab"/imm32 - 798 68/push _test-stream/imm32 + 798 68/push _test-stream/imm32 799 # . . call - 800 e8/call write/disp32 + 800 e8/call write/disp32 801 # . . discard args 802 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 803 # initialize exit-descriptor 'ed' for the call to 'scan-next-byte' below @@ -870,14 +870,14 @@ if ('onhashchange' in window) { 809 68/push 0xc/imm32/nbytes-of-args-for-scan-next-byte 810 51/push-ecx/ed 811 # . . call - 812 e8/call tailor-exit-descriptor/disp32 + 812 e8/call tailor-exit-descriptor/disp32 813 # . . discard args 814 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 815 # eax = scan-next-byte(_test-buffered-file, _test-error-buffered-file, ed) 816 # . . push args 817 51/push-ecx/ed - 818 68/push _test-error-buffered-file/imm32 - 819 68/push _test-buffered-file/imm32 + 818 68/push _test-error-buffered-file/imm32 + 819 68/push _test-buffered-file/imm32 820 # . . call 821 e8/call scan-next-byte/disp32 822 # registers except esp may be clobbered at this point @@ -894,7 +894,7 @@ if ('onhashchange' in window) { 833 # . . push ed->value 834 ff 6/subop/push 1/mod/*+disp8 1/rm32/ecx . . . . 4/disp8 . # push *(ecx+4) 835 # . . call - 836 e8/call check-ints-equal/disp32 + 836 e8/call check-ints-equal/disp32 837 # . . discard args 838 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 839 # return if abort @@ -906,7 +906,7 @@ if ('onhashchange' in window) { 845 68/push 0x61/imm32/a 846 50/push-eax 847 # . . call - 848 e8/call check-ints-equal/disp32 + 848 e8/call check-ints-equal/disp32 849 # . . discard args 850 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 851 $test-scan-next-byte-skips-comment:end: @@ -924,47 +924,47 @@ if ('onhashchange' in window) { 863 # clear all streams 864 # . clear-stream(_test-stream) 865 # . . push args - 866 68/push _test-stream/imm32 + 866 68/push _test-stream/imm32 867 # . . call - 868 e8/call clear-stream/disp32 + 868 e8/call clear-stream/disp32 869 # . . discard args 870 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 871 # . clear-stream($_test-buffered-file->buffer) 872 # . . push args 873 68/push $_test-buffered-file->buffer/imm32 874 # . . call - 875 e8/call clear-stream/disp32 + 875 e8/call clear-stream/disp32 876 # . . discard args 877 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 878 # . clear-stream(_test-error-stream) 879 # . . push args - 880 68/push _test-error-stream/imm32 + 880 68/push _test-error-stream/imm32 881 # . . call - 882 e8/call clear-stream/disp32 + 882 e8/call clear-stream/disp32 883 # . . discard args 884 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 885 # . clear-stream($_test-error-buffered-file->buffer) 886 # . . push args 887 68/push $_test-error-buffered-file->buffer/imm32 888 # . . call - 889 e8/call clear-stream/disp32 + 889 e8/call clear-stream/disp32 890 # . . discard args 891 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 892 # initialize '_test-stream' to input with leading comment and more whitespace after newline 893 # . write(_test-stream, comment) 894 # . . push args 895 68/push "#x\n"/imm32 - 896 68/push _test-stream/imm32 + 896 68/push _test-stream/imm32 897 # . . call - 898 e8/call write/disp32 + 898 e8/call write/disp32 899 # . . discard args 900 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 901 # . write(_test-stream, real text) 902 # . . push args 903 68/push " ab"/imm32 - 904 68/push _test-stream/imm32 + 904 68/push _test-stream/imm32 905 # . . call - 906 e8/call write/disp32 + 906 e8/call write/disp32 907 # . . discard args 908 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 909 # initialize exit-descriptor 'ed' for the call to 'scan-next-byte' below @@ -976,14 +976,14 @@ if ('onhashchange' in window) { 915 68/push 0xc/imm32/nbytes-of-args-for-scan-next-byte 916 51/push-ecx/ed 917 # . . call - 918 e8/call tailor-exit-descriptor/disp32 + 918 e8/call tailor-exit-descriptor/disp32 919 # . . discard args 920 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 921 # eax = scan-next-byte(_test-buffered-file, _test-error-buffered-file, ed) 922 # . . push args 923 51/push-ecx/ed - 924 68/push _test-error-buffered-file/imm32 - 925 68/push _test-buffered-file/imm32 + 924 68/push _test-error-buffered-file/imm32 + 925 68/push _test-buffered-file/imm32 926 # . . call 927 e8/call scan-next-byte/disp32 928 # registers except esp may be clobbered at this point @@ -1000,7 +1000,7 @@ if ('onhashchange' in window) { 939 # . . push ed->value 940 ff 6/subop/push 1/mod/*+disp8 1/rm32/ecx . . . . 4/disp8 . # push *(ecx+4) 941 # . . call - 942 e8/call check-ints-equal/disp32 + 942 e8/call check-ints-equal/disp32 943 # . . discard args 944 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 945 # return if abort @@ -1012,7 +1012,7 @@ if ('onhashchange' in window) { 951 68/push 0x61/imm32/a 952 50/push-eax 953 # . . call - 954 e8/call check-ints-equal/disp32 + 954 e8/call check-ints-equal/disp32 955 # . . discard args 956 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 957 $test-scan-next-byte-skips-comment-and-whitespace:end: @@ -1030,49 +1030,49 @@ if ('onhashchange' in window) { 969 # clear all streams 970 # . clear-stream(_test-stream) 971 # . . push args - 972 68/push _test-stream/imm32 + 972 68/push _test-stream/imm32 973 # . . call - 974 e8/call clear-stream/disp32 + 974 e8/call clear-stream/disp32 975 # . . discard args 976 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 977 # . clear-stream($_test-buffered-file->buffer) 978 # . . push args - 979 b8/copy-to-eax _test-buffered-file/imm32 + 979 b8/copy-to-eax _test-buffered-file/imm32 980 05/add-to-eax 4/imm32 981 50/push-eax 982 # . . call - 983 e8/call clear-stream/disp32 + 983 e8/call clear-stream/disp32 984 # . . discard args 985 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 986 # . clear-stream(_test-error-stream) 987 # . . push args - 988 68/push _test-error-stream/imm32 + 988 68/push _test-error-stream/imm32 989 # . . call - 990 e8/call clear-stream/disp32 + 990 e8/call clear-stream/disp32 991 # . . discard args 992 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 993 # . clear-stream($_test-error-buffered-file->buffer) 994 # . . push args 995 68/push $_test-error-buffered-file->buffer/imm32 996 # . . call - 997 e8/call clear-stream/disp32 + 997 e8/call clear-stream/disp32 998 # . . discard args 999 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1000 # initialize '_test-stream' to input with leading whitespace and comment 1001 # . write(_test-stream, comment) 1002 # . . push args 1003 68/push " #x\n"/imm32 -1004 68/push _test-stream/imm32 +1004 68/push _test-stream/imm32 1005 # . . call -1006 e8/call write/disp32 +1006 e8/call write/disp32 1007 # . . discard args 1008 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1009 # . write(_test-stream, real text) 1010 # . . push args 1011 68/push "ab"/imm32 -1012 68/push _test-stream/imm32 +1012 68/push _test-stream/imm32 1013 # . . call -1014 e8/call write/disp32 +1014 e8/call write/disp32 1015 # . . discard args 1016 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1017 # initialize exit-descriptor 'ed' for the call to 'scan-next-byte' below @@ -1084,14 +1084,14 @@ if ('onhashchange' in window) { 1023 68/push 0xc/imm32/nbytes-of-args-for-scan-next-byte 1024 51/push-ecx/ed 1025 # . . call -1026 e8/call tailor-exit-descriptor/disp32 +1026 e8/call tailor-exit-descriptor/disp32 1027 # . . discard args 1028 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1029 # eax = scan-next-byte(_test-buffered-file, _test-error-buffered-file, ed) 1030 # . . push args 1031 51/push-ecx/ed -1032 68/push _test-error-buffered-file/imm32 -1033 68/push _test-buffered-file/imm32 +1032 68/push _test-error-buffered-file/imm32 +1033 68/push _test-buffered-file/imm32 1034 # . . call 1035 e8/call scan-next-byte/disp32 1036 # registers except esp may be clobbered at this point @@ -1108,7 +1108,7 @@ if ('onhashchange' in window) { 1047 # . . push ed->value 1048 ff 6/subop/push 1/mod/*+disp8 1/rm32/ecx . . . . 4/disp8 . # push *(ecx+4) 1049 # . . call -1050 e8/call check-ints-equal/disp32 +1050 e8/call check-ints-equal/disp32 1051 # . . discard args 1052 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1053 # return if abort @@ -1120,7 +1120,7 @@ if ('onhashchange' in window) { 1059 68/push 0x61/imm32/a 1060 50/push-eax 1061 # . . call -1062 e8/call check-ints-equal/disp32 +1062 e8/call check-ints-equal/disp32 1063 # . . discard args 1064 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1065 $test-scan-next-byte-skips-whitespace-and-comment:end: @@ -1138,39 +1138,39 @@ if ('onhashchange' in window) { 1077 # clear all streams 1078 # . clear-stream(_test-stream) 1079 # . . push args -1080 68/push _test-stream/imm32 +1080 68/push _test-stream/imm32 1081 # . . call -1082 e8/call clear-stream/disp32 +1082 e8/call clear-stream/disp32 1083 # . . discard args 1084 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1085 # . clear-stream($_test-buffered-file->buffer) 1086 # . . push args 1087 68/push $_test-buffered-file->buffer/imm32 1088 # . . call -1089 e8/call clear-stream/disp32 +1089 e8/call clear-stream/disp32 1090 # . . discard args 1091 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1092 # . clear-stream(_test-error-stream) 1093 # . . push args -1094 68/push _test-error-stream/imm32 +1094 68/push _test-error-stream/imm32 1095 # . . call -1096 e8/call clear-stream/disp32 +1096 e8/call clear-stream/disp32 1097 # . . discard args 1098 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1099 # . clear-stream($_test-error-buffered-file->buffer) 1100 # . . push args 1101 68/push $_test-error-buffered-file->buffer/imm32 1102 # . . call -1103 e8/call clear-stream/disp32 +1103 e8/call clear-stream/disp32 1104 # . . discard args 1105 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1106 # initialize '_test-stream' to input with single character 1107 # . write(_test-stream, character) 1108 # . . push args 1109 68/push "a"/imm32 -1110 68/push _test-stream/imm32 +1110 68/push _test-stream/imm32 1111 # . . call -1112 e8/call write/disp32 +1112 e8/call write/disp32 1113 # . . discard args 1114 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1115 # initialize exit-descriptor 'ed' for the call to 'scan-next-byte' below @@ -1182,14 +1182,14 @@ if ('onhashchange' in window) { 1121 68/push 0xc/imm32/nbytes-of-args-for-scan-next-byte 1122 51/push-ecx/ed 1123 # . . call -1124 e8/call tailor-exit-descriptor/disp32 +1124 e8/call tailor-exit-descriptor/disp32 1125 # . . discard args 1126 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1127 # eax = scan-next-byte(_test-buffered-file, _test-error-buffered-file, ed) 1128 # . . push args 1129 51/push-ecx/ed -1130 68/push _test-error-buffered-file/imm32 -1131 68/push _test-buffered-file/imm32 +1130 68/push _test-error-buffered-file/imm32 +1131 68/push _test-buffered-file/imm32 1132 # . . call 1133 e8/call scan-next-byte/disp32 1134 # registers except esp may be clobbered at this point @@ -1206,7 +1206,7 @@ if ('onhashchange' in window) { 1145 # . . push ed->value 1146 ff 6/subop/push 1/mod/*+disp8 1/rm32/ecx . . . . 4/disp8 . # push *(ecx+4) 1147 # . . call -1148 e8/call check-ints-equal/disp32 +1148 e8/call check-ints-equal/disp32 1149 # . . discard args 1150 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1151 # return if abort @@ -1218,7 +1218,7 @@ if ('onhashchange' in window) { 1157 68/push 0x61/imm32/a 1158 50/push-eax 1159 # . . call -1160 e8/call check-ints-equal/disp32 +1160 e8/call check-ints-equal/disp32 1161 # . . discard args 1162 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1163 $test-scan-next-byte-reads-final-byte:end: @@ -1236,30 +1236,30 @@ if ('onhashchange' in window) { 1175 # clear all streams 1176 # . clear-stream(_test-stream) 1177 # . . push args -1178 68/push _test-stream/imm32 +1178 68/push _test-stream/imm32 1179 # . . call -1180 e8/call clear-stream/disp32 +1180 e8/call clear-stream/disp32 1181 # . . discard args 1182 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1183 # . clear-stream($_test-buffered-file->buffer) 1184 # . . push args 1185 68/push $_test-buffered-file->buffer/imm32 1186 # . . call -1187 e8/call clear-stream/disp32 +1187 e8/call clear-stream/disp32 1188 # . . discard args 1189 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1190 # . clear-stream(_test-error-stream) 1191 # . . push args -1192 68/push _test-error-stream/imm32 +1192 68/push _test-error-stream/imm32 1193 # . . call -1194 e8/call clear-stream/disp32 +1194 e8/call clear-stream/disp32 1195 # . . discard args 1196 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1197 # . clear-stream($_test-error-buffered-file->buffer) 1198 # . . push args 1199 68/push $_test-error-buffered-file->buffer/imm32 1200 # . . call -1201 e8/call clear-stream/disp32 +1201 e8/call clear-stream/disp32 1202 # . . discard args 1203 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1204 # leave '_test-stream' empty @@ -1272,14 +1272,14 @@ if ('onhashchange' in window) { 1211 68/push 0xc/imm32/nbytes-of-args-for-scan-next-byte 1212 51/push-ecx/ed 1213 # . . call -1214 e8/call tailor-exit-descriptor/disp32 +1214 e8/call tailor-exit-descriptor/disp32 1215 # . . discard args 1216 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1217 # eax = scan-next-byte(_test-buffered-file, _test-error-buffered-file, ed) 1218 # . . push args 1219 51/push-ecx/ed -1220 68/push _test-error-buffered-file/imm32 -1221 68/push _test-buffered-file/imm32 +1220 68/push _test-error-buffered-file/imm32 +1221 68/push _test-buffered-file/imm32 1222 # . . call 1223 e8/call scan-next-byte/disp32 1224 # registers except esp may be clobbered at this point @@ -1296,7 +1296,7 @@ if ('onhashchange' in window) { 1235 # . . push ed->value 1236 ff 6/subop/push 1/mod/*+disp8 1/rm32/ecx . . . . 4/disp8 . # push *(ecx+4) 1237 # . . call -1238 e8/call check-ints-equal/disp32 +1238 e8/call check-ints-equal/disp32 1239 # . . discard args 1240 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1241 # return if abort @@ -1308,7 +1308,7 @@ if ('onhashchange' in window) { 1247 68/push 0xffffffff/imm32/Eof 1248 50/push-eax 1249 # . . call -1250 e8/call check-ints-equal/disp32 +1250 e8/call check-ints-equal/disp32 1251 # . . discard args 1252 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1253 $test-scan-next-byte-handles-Eof:end: @@ -1326,39 +1326,39 @@ if ('onhashchange' in window) { 1265 # clear all streams 1266 # . clear-stream(_test-stream) 1267 # . . push args -1268 68/push _test-stream/imm32 +1268 68/push _test-stream/imm32 1269 # . . call -1270 e8/call clear-stream/disp32 +1270 e8/call clear-stream/disp32 1271 # . . discard args 1272 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1273 # . clear-stream($_test-buffered-file->buffer) 1274 # . . push args 1275 68/push $_test-buffered-file->buffer/imm32 1276 # . . call -1277 e8/call clear-stream/disp32 +1277 e8/call clear-stream/disp32 1278 # . . discard args 1279 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1280 # . clear-stream(_test-error-stream) 1281 # . . push args -1282 68/push _test-error-stream/imm32 +1282 68/push _test-error-stream/imm32 1283 # . . call -1284 e8/call clear-stream/disp32 +1284 e8/call clear-stream/disp32 1285 # . . discard args 1286 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1287 # . clear-stream($_test-error-buffered-file->buffer) 1288 # . . push args 1289 68/push $_test-error-buffered-file->buffer/imm32 1290 # . . call -1291 e8/call clear-stream/disp32 +1291 e8/call clear-stream/disp32 1292 # . . discard args 1293 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1294 # initialize '_test-stream' to "x" 1295 # . write(_test-stream, "x") 1296 # . . push args 1297 68/push "x"/imm32 -1298 68/push _test-stream/imm32 +1298 68/push _test-stream/imm32 1299 # . . call -1300 e8/call write/disp32 +1300 e8/call write/disp32 1301 # . . discard args 1302 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1303 # initialize exit-descriptor 'ed' for the call to 'scan-next-byte' below @@ -1370,14 +1370,14 @@ if ('onhashchange' in window) { 1309 68/push 0xc/imm32/nbytes-of-args-for-scan-next-byte 1310 51/push-ecx/ed 1311 # . . call -1312 e8/call tailor-exit-descriptor/disp32 +1312 e8/call tailor-exit-descriptor/disp32 1313 # . . discard args 1314 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1315 # eax = scan-next-byte(_test-buffered-file, _test-error-buffered-file, ed) 1316 # . . push args 1317 51/push-ecx/ed -1318 68/push _test-error-buffered-file/imm32 -1319 68/push _test-buffered-file/imm32 +1318 68/push _test-error-buffered-file/imm32 +1319 68/push _test-buffered-file/imm32 1320 # . . call 1321 e8/call scan-next-byte/disp32 1322 # registers except esp may be clobbered at this point @@ -1394,7 +1394,7 @@ if ('onhashchange' in window) { 1333 # . . push ed->value 1334 ff 6/subop/push 1/mod/*+disp8 1/rm32/ecx . . . . 4/disp8 . # push *(ecx+4) 1335 # . . call -1336 e8/call check-ints-equal/disp32 +1336 e8/call check-ints-equal/disp32 1337 # . . discard args 1338 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1339 $test-scan-next-byte-aborts-on-invalid-byte:end: @@ -1422,7 +1422,7 @@ if ('onhashchange' in window) { 1361 # . . push args 1362 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 1363 # . . call -1364 e8/call read-byte-buffered/disp32 +1364 e8/call read-byte-buffered/disp32 1365 # . . discard args 1366 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1367 # . if (eax == Eof) break @@ -1444,38 +1444,38 @@ if ('onhashchange' in window) { 1383 # setup 1384 # . clear-stream(_test-stream) 1385 # . . push args -1386 68/push _test-stream/imm32 +1386 68/push _test-stream/imm32 1387 # . . call -1388 e8/call clear-stream/disp32 +1388 e8/call clear-stream/disp32 1389 # . . discard args 1390 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1391 # . clear-stream($_test-buffered-file->buffer) 1392 # . . push args 1393 68/push $_test-buffered-file->buffer/imm32 1394 # . . call -1395 e8/call clear-stream/disp32 +1395 e8/call clear-stream/disp32 1396 # . . discard args 1397 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1398 # initialize '_test-stream' to "abc\nde" 1399 # . write(_test-stream, "abc") 1400 # . . push args 1401 68/push "abc\n"/imm32 -1402 68/push _test-stream/imm32 +1402 68/push _test-stream/imm32 1403 # . . call -1404 e8/call write/disp32 +1404 e8/call write/disp32 1405 # . . discard args 1406 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1407 # . write(_test-stream, "de") 1408 # . . push args 1409 68/push "de"/imm32 -1410 68/push _test-stream/imm32 +1410 68/push _test-stream/imm32 1411 # . . call -1412 e8/call write/disp32 +1412 e8/call write/disp32 1413 # . . discard args 1414 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1415 # skip-until-newline(_test-buffered-file) 1416 # . . push args -1417 68/push _test-buffered-file/imm32 +1417 68/push _test-buffered-file/imm32 1418 # . . call 1419 e8/call skip-until-newline/disp32 1420 # . . discard args @@ -1484,10 +1484,10 @@ if ('onhashchange' in window) { 1423 # . . push args 1424 68/push "F - test-skip-until-newline"/imm32 1425 68/push 4/imm32 -1426 b8/copy-to-eax _test-buffered-file/imm32 +1426 b8/copy-to-eax _test-buffered-file/imm32 1427 ff 6/subop/push 1/mod/*+disp8 0/rm32/eax . . . . 8/disp8 . # push *(eax+8) 1428 # . . call -1429 e8/call check-ints-equal/disp32 +1429 e8/call check-ints-equal/disp32 1430 # . . discard args 1431 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1432 # . end diff --git a/html/apps/mu.subx.html b/html/apps/mu.subx.html index a2fdb58e..10d87927 100644 --- a/html/apps/mu.subx.html +++ b/html/apps/mu.subx.html @@ -155,7 +155,7 @@ if ('onhashchange' in window) { 93 # body: (handle block) 94 # A var-type contains: 95 # name: (handle array byte) - 96 # type: (handle tree type-id) + 96 # type: (handle type-tree) 97 # 98 # A statement can be: 99 # tag 0: a block @@ -177,12 +177,12 @@ if ('onhashchange' in window) { 115 # A variable defined on the stack contains: 116 # tag: 2 117 # name: (handle array byte) - 118 # type: (handle tree type-id) + 118 # type: (handle type-tree) 119 # 120 # A variable defined in a register contains: 121 # tag: 3 122 # name: (handle array byte) - 123 # type: (handle tree type-id) + 123 # type: (handle type-tree) 124 # reg: (handle array byte) 125 126 # == Translation: managing the stack @@ -208,7 +208,7 @@ if ('onhashchange' in window) { 146 # live-vars: stack of vars 147 # var: 148 # name: (handle array byte) - 149 # type: (handle tree type-id) + 149 # type: (handle type-tree) 150 # block: int 151 # stack-offset: int (added to ebp) 152 # register: (handle array byte) @@ -305,12235 +305,12223 @@ if ('onhashchange' in window) { 243 0/imm32 244 _Program-types->payload: 245 0/imm32 - 246 - 247 # Some constants for simulating the data structures described above. - 248 # Many constants here come with a type in a comment. - 249 # - 250 # Sometimes the type is of the value at that offset for the given type. For - 251 # example, if you start at a function record and move forward Function-inouts - 252 # bytes, you'll find a (handle list var). + 246 _Program-signatures: # (handle function) + 247 0/imm32 + 248 _Program-signatures->payload: + 249 0/imm32 + 250 + 251 # Some constants for simulating the data structures described above. + 252 # Many constants here come with a type in a comment. 253 # - 254 # At other times, the type is of the constant itself. For example, the type of - 255 # the constant Function-size is (addr int). To get the size of a function, - 256 # look in *Function-size. - 257 - 258 Function-name: # (handle array byte) - 259 0/imm32 - 260 Function-inouts: # (handle list var) - 261 8/imm32 - 262 Function-outputs: # (handle list var) - 263 0x10/imm32 - 264 Function-body: # (handle block) - 265 0x18/imm32 - 266 Function-next: # (handle function) - 267 0x20/imm32 - 268 Function-size: # (addr int) - 269 0x28/imm32/40 - 270 - 271 Primitive-name: # (handle array byte) - 272 0/imm32 - 273 Primitive-inouts: # (handle list var) - 274 8/imm32 - 275 Primitive-outputs: # (handle list var) - 276 0x10/imm32 - 277 Primitive-subx-name: # (handle array byte) - 278 0x18/imm32 - 279 Primitive-subx-rm32: # enum arg-location - 280 0x20/imm32 - 281 Primitive-subx-r32: # enum arg-location - 282 0x24/imm32 - 283 Primitive-subx-imm32: # enum arg-location - 284 0x28/imm32 - 285 Primitive-subx-disp32: # enum arg-location -- only for branches - 286 0x2c/imm32 - 287 Primitive-output-is-write-only: # boolean - 288 0x30/imm32 - 289 Primitive-next: # (handle function) - 290 0x34/imm32 - 291 Primitive-size: # (addr int) - 292 0x3c/imm32/60 - 293 - 294 Stmt-tag: # int - 295 0/imm32 - 296 - 297 Block-stmts: # (handle list stmt) - 298 4/imm32 - 299 Block-var: # (handle var) - 300 0xc/imm32 - 301 - 302 Stmt1-operation: # (handle array byte) - 303 4/imm32 - 304 Stmt1-inouts: # (handle stmt-var) - 305 0xc/imm32 - 306 Stmt1-outputs: # (handle stmt-var) - 307 0x14/imm32 - 308 - 309 Vardef-var: # (handle var) - 310 4/imm32 - 311 - 312 Regvardef-operation: # (handle array byte) - 313 4/imm32 - 314 Regvardef-inouts: # (handle stmt-var) - 315 0xc/imm32 - 316 Regvardef-outputs: # (handle stmt-var) # will have exactly one element - 317 0x14/imm32 - 318 - 319 Stmt-size: # (addr int) - 320 0x1c/imm32 - 321 - 322 Var-name: # (handle array byte) - 323 0/imm32 - 324 Var-type: # (handle tree type-id) - 325 8/imm32 - 326 Var-block-depth: # int -- not available until code-generation time - 327 0x10/imm32 - 328 Var-offset: # int -- not available until code-generation time - 329 0x14/imm32 - 330 Var-register: # (handle array byte) -- name of a register - 331 0x18/imm32 - 332 Var-size: # (addr int) - 333 0x20/imm32 - 334 - 335 List-value: # (handle _) - 336 0/imm32 - 337 List-next: # (handle list _) - 338 8/imm32 - 339 List-size: # (addr int) - 340 0x10/imm32 - 341 - 342 # A stmt-var is like a list of vars with call-site specific metadata - 343 Stmt-var-value: # (handle var) - 344 0/imm32 - 345 Stmt-var-next: # (handle stmt-var) - 346 8/imm32 - 347 Stmt-var-is-deref: # boolean - 348 0x10/imm32 - 349 Stmt-var-size: # (addr int) - 350 0x14/imm32 - 351 - 352 # A live-var is a var augmented with information needed for tracking live - 353 # variables. - 354 Live-var-value: # (handle var) - 355 0/imm32 - 356 Live-var-register-spilled: # boolean; only used if value is in a register, and only during code-gen - 357 8/imm32 - 358 Live-var-size: # (addr int) - 359 0xc/imm32 - 360 - 361 # Types are expressed as trees (s-expressions) of type-ids (ints). - 362 - 363 Tree-is-atom: # boolean - 364 0/imm32 - 365 # if left-is-atom? - 366 Tree-value: # type-id - 367 4/imm32 - 368 # unless left-is-atom? - 369 Tree-left: # (addr tree type-id) - 370 4/imm32 - 371 Tree-right: # (addr tree type-id) - 372 0xc/imm32 - 373 # - 374 Tree-size: # (addr int) - 375 0x14/imm32 - 376 - 377 # Types - 378 - 379 # TODO: Turn this data structure into valid Mu, with (fake) handles rather than addrs. - 380 Type-id: # (stream (addr array byte)) - 381 0/imm32/write # initialized later from Primitive-type-ids - 382 0/imm32/read - 383 0x100/imm32/size - 384 # data - 385 "literal"/imm32 # 0: value is just the name - 386 "int"/imm32 # 1 - 387 "addr"/imm32 # 2 - 388 "array"/imm32 # 3 - 389 "handle"/imm32 # 4 - 390 "boolean"/imm32 # 5 - 391 "constant"/imm32 # 6: like a literal, but value is an int in Var-offset - 392 "offset"/imm32 # 7: (offset T) is guaranteed to be a 32-bit multiple of size-of(T) - 393 # 0x20 - 394 "byte"/imm32 # 8 - 395 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 - 396 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 - 397 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 - 398 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 - 399 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 - 400 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 - 401 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 - 402 - 403 Primitive-type-ids: # (addr int) - 404 0x24 - 405 - 406 # == Type definitions - 407 # Program->types contains some typeinfo for each type definition. - 408 # Types contain vars with types, but can't specify registers. - 409 Typeinfo-id: # type-id - 410 0/imm32 - 411 Typeinfo-fields: # (handle table (handle array byte) (handle typeinfo-entry)) - 412 4/imm32 - 413 # Total size must be >= 0 - 414 # During parsing it may take on two additional values: - 415 # -2: not yet initialized - 416 # -1: in process of being computed - 417 # See populate-mu-type-sizes for details. - 418 Typeinfo-total-size-in-bytes: # int - 419 0xc/imm32 - 420 Typeinfo-next: # (handle typeinfo) - 421 0x10/imm32 - 422 Typeinfo-size: # (addr int) - 423 0x18/imm32 - 424 - 425 # Each entry in the typeinfo->fields table has a pointer to a string and a - 426 # pointer to a typeinfo-entry. - 427 Typeinfo-fields-row-size: # (addr int) - 428 0x10/imm32 - 429 - 430 # typeinfo-entry objects have information about a field in a single record type - 431 # - 432 # each field of a type is represented using two var's: - 433 # 1. the input var: expected type of the field; convenient for creating using parse-var-with-type - 434 # 2. the output var: a constant containing the byte offset; convenient for code-generation - 435 # computing the output happens after parsing; in the meantime we preserve the - 436 # order of fields in the 'index' field. - 437 Typeinfo-entry-input-var: # (handle var) - 438 0/imm32 - 439 Typeinfo-entry-index: # int - 440 8/imm32 - 441 Typeinfo-entry-output-var: # (handle var) - 442 0xc/imm32 - 443 Typeinfo-entry-size: # (addr int) - 444 0x14/imm32 - 445 - 446 == code - 447 - 448 Entry: - 449 # . prologue - 450 89/<- %ebp 4/r32/esp - 451 (new-segment *Heap-size Heap) - 452 # if (argv[1] == "test') run-tests() - 453 { - 454 # if (argc <= 1) break - 455 81 7/subop/compare *ebp 1/imm32 - 456 7e/jump-if-<= break/disp8 - 457 # if (argv[1] != "test") break - 458 (kernel-string-equal? *(ebp+8) "test") # => eax - 459 3d/compare-eax-and 0/imm32/false - 460 74/jump-if-= break/disp8 - 461 # - 462 (run-tests) - 463 # syscall(exit, *Num-test-failures) - 464 8b/-> *Num-test-failures 3/r32/ebx - 465 eb/jump $mu-main:end/disp8 - 466 } - 467 # otherwise convert Stdin - 468 (convert-mu Stdin Stdout Stderr 0) - 469 (flush Stdout) - 470 # syscall(exit, 0) - 471 bb/copy-to-ebx 0/imm32 - 472 $mu-main:end: - 473 e8/call syscall_exit/disp32 - 474 - 475 convert-mu: # in: (addr buffered-file), out: (addr buffered-file), err: (addr buffered-file), ed: (addr exit-descriptor) - 476 # . prologue - 477 55/push-ebp - 478 89/<- %ebp 4/r32/esp - 479 # . save registers - 480 50/push-eax - 481 # initialize global data structures - 482 c7 0/subop/copy *Next-block-index 1/imm32 - 483 8b/-> *Primitive-type-ids 0/r32/eax - 484 89/<- *Type-id 0/r32/eax # stream-write - 485 c7 0/subop/copy *_Program-functions 0/imm32 - 486 c7 0/subop/copy *_Program-functions->payload 0/imm32 - 487 c7 0/subop/copy *_Program-types 0/imm32 - 488 c7 0/subop/copy *_Program-types->payload 0/imm32 - 489 # - 490 (parse-mu *(ebp+8) *(ebp+0x10) *(ebp+0x14)) - 491 (populate-mu-type-sizes *(ebp+0x10) *(ebp+0x14)) - 492 #? (dump-typeinfos "=== typeinfos\n") - 493 (check-mu-types *(ebp+0x10) *(ebp+0x14)) - 494 (emit-subx *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) - 495 $convert-mu:end: - 496 # . restore registers - 497 58/pop-to-eax - 498 # . epilogue - 499 89/<- %esp 5/r32/ebp - 500 5d/pop-to-ebp - 501 c3/return - 502 - 503 test-convert-empty-input: - 504 # empty input => empty output - 505 # . prologue - 506 55/push-ebp - 507 89/<- %ebp 4/r32/esp - 508 # setup - 509 (clear-stream _test-input-stream) - 510 (clear-stream $_test-input-buffered-file->buffer) - 511 (clear-stream _test-output-stream) - 512 (clear-stream $_test-output-buffered-file->buffer) - 513 # - 514 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 515 (flush _test-output-buffered-file) - 516 (check-stream-equal _test-output-stream "" "F - test-convert-empty-input") - 517 # . epilogue - 518 89/<- %esp 5/r32/ebp - 519 5d/pop-to-ebp - 520 c3/return - 521 - 522 test-convert-function-skeleton: - 523 # . prologue - 524 55/push-ebp - 525 89/<- %ebp 4/r32/esp - 526 # setup - 527 (clear-stream _test-input-stream) - 528 (clear-stream $_test-input-buffered-file->buffer) - 529 (clear-stream _test-output-stream) - 530 (clear-stream $_test-output-buffered-file->buffer) - 531 # - 532 (write _test-input-stream "fn foo {\n") - 533 (write _test-input-stream "}\n") - 534 # convert - 535 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 536 (flush _test-output-buffered-file) - 537 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 543 # check output - 544 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-skeleton/0") - 545 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-skeleton/1") - 546 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-skeleton/2") - 547 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-skeleton/3") - 548 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-skeleton/4") - 549 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-skeleton/5") - 550 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-skeleton/6") - 551 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-skeleton/7") - 552 # . epilogue - 553 89/<- %esp 5/r32/ebp - 554 5d/pop-to-ebp - 555 c3/return - 556 - 557 test-convert-multiple-function-skeletons: - 558 # . prologue - 559 55/push-ebp - 560 89/<- %ebp 4/r32/esp - 561 # setup - 562 (clear-stream _test-input-stream) - 563 (clear-stream $_test-input-buffered-file->buffer) - 564 (clear-stream _test-output-stream) - 565 (clear-stream $_test-output-buffered-file->buffer) - 566 # - 567 (write _test-input-stream "fn foo {\n") - 568 (write _test-input-stream "}\n") - 569 (write _test-input-stream "fn bar {\n") - 570 (write _test-input-stream "}\n") - 571 # convert - 572 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 573 (flush _test-output-buffered-file) - 574 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 580 # check first function - 581 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-multiple-function-skeletons/0") - 582 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-multiple-function-skeletons/1") - 583 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-multiple-function-skeletons/2") - 584 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-multiple-function-skeletons/3") - 585 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-multiple-function-skeletons/4") - 586 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-multiple-function-skeletons/5") - 587 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-multiple-function-skeletons/6") - 588 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-multiple-function-skeletons/7") - 589 # check second function - 590 (check-next-stream-line-equal _test-output-stream "bar:" "F - test-convert-multiple-function-skeletons/10") - 591 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-multiple-function-skeletons/11") - 592 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-multiple-function-skeletons/12") - 593 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-multiple-function-skeletons/13") - 594 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-multiple-function-skeletons/14") - 595 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-multiple-function-skeletons/15") - 596 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-multiple-function-skeletons/16") - 597 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-multiple-function-skeletons/17") - 598 # . epilogue - 599 89/<- %esp 5/r32/ebp - 600 5d/pop-to-ebp - 601 c3/return - 602 - 603 test-convert-function-with-arg: - 604 # . prologue - 605 55/push-ebp - 606 89/<- %ebp 4/r32/esp - 607 # setup - 608 (clear-stream _test-input-stream) - 609 (clear-stream $_test-input-buffered-file->buffer) - 610 (clear-stream _test-output-stream) - 611 (clear-stream $_test-output-buffered-file->buffer) - 612 # - 613 (write _test-input-stream "fn foo n: int {\n") - 614 (write _test-input-stream "}\n") - 615 # convert - 616 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 617 (flush _test-output-buffered-file) - 618 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 624 # check output - 625 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-arg/0") - 626 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-arg/1") - 627 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-arg/2") - 628 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-arg/3") - 629 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-arg/4") - 630 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-arg/5") - 631 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-arg/6") - 632 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-arg/7") - 633 # . epilogue - 634 89/<- %esp 5/r32/ebp - 635 5d/pop-to-ebp - 636 c3/return - 637 - 638 test-convert-function-with-arg-and-body: - 639 # . prologue - 640 55/push-ebp - 641 89/<- %ebp 4/r32/esp - 642 # setup - 643 (clear-stream _test-input-stream) - 644 (clear-stream $_test-input-buffered-file->buffer) - 645 (clear-stream _test-output-stream) - 646 (clear-stream $_test-output-buffered-file->buffer) - 647 # - 648 (write _test-input-stream "fn foo n: int {\n") - 649 (write _test-input-stream " increment n\n") - 650 (write _test-input-stream "}\n") - 651 # convert - 652 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 653 (flush _test-output-buffered-file) - 654 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 660 # check output - 661 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-arg-and-body/0") - 662 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-arg-and-body/1") - 663 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-arg-and-body/2") - 664 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-arg-and-body/3") - 665 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-arg-and-body/4") - 666 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-arg-and-body/5") - 667 (check-next-stream-line-equal _test-output-stream " ff 0/subop/increment *(ebp+0x00000008)" "F - test-convert-function-with-arg-and-body/6") - 668 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-arg-and-body/7") - 669 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-arg-and-body/8") - 670 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-arg-and-body/9") - 671 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-arg-and-body/10") - 672 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-arg-and-body/11") - 673 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-arg-and-body/12") - 674 # . epilogue - 675 89/<- %esp 5/r32/ebp - 676 5d/pop-to-ebp - 677 c3/return - 678 - 679 test-convert-function-distinguishes-args: - 680 # . prologue - 681 55/push-ebp - 682 89/<- %ebp 4/r32/esp - 683 # setup - 684 (clear-stream _test-input-stream) - 685 (clear-stream $_test-input-buffered-file->buffer) - 686 (clear-stream _test-output-stream) - 687 (clear-stream $_test-output-buffered-file->buffer) - 688 # - 689 (write _test-input-stream "fn foo a: int, b: int {\n") - 690 (write _test-input-stream " increment b\n") - 691 (write _test-input-stream "}\n") - 692 # convert - 693 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 694 (flush _test-output-buffered-file) - 695 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 701 # check output - 702 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-distinguishes-args/0") - 703 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-distinguishes-args/1") - 704 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-distinguishes-args/2") - 705 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-distinguishes-args/3") - 706 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-distinguishes-args/4") - 707 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-distinguishes-args/5") - 708 (check-next-stream-line-equal _test-output-stream " ff 0/subop/increment *(ebp+0x0000000c)" "F - test-convert-function-distinguishes-args/6") - 709 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-distinguishes-args/7") - 710 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-distinguishes-args/8") - 711 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-distinguishes-args/9") - 712 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-distinguishes-args/10") - 713 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-distinguishes-args/11") - 714 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-distinguishes-args/12") - 715 # . epilogue - 716 89/<- %esp 5/r32/ebp - 717 5d/pop-to-ebp - 718 c3/return - 719 - 720 test-convert-function-returns-result: - 721 # . prologue - 722 55/push-ebp - 723 89/<- %ebp 4/r32/esp - 724 # setup - 725 (clear-stream _test-input-stream) - 726 (clear-stream $_test-input-buffered-file->buffer) - 727 (clear-stream _test-output-stream) - 728 (clear-stream $_test-output-buffered-file->buffer) - 729 # - 730 (write _test-input-stream "fn foo a: int, b: int -> result/eax: int {\n") - 731 (write _test-input-stream " result <- copy a\n") - 732 (write _test-input-stream " result <- increment\n") - 733 (write _test-input-stream "}\n") - 734 # convert - 735 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 736 (flush _test-output-buffered-file) - 737 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 743 # check output - 744 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-returns-result/0") - 745 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-returns-result/1") - 746 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-returns-result/2") - 747 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-returns-result/3") - 748 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-returns-result/4") - 749 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-returns-result/5") - 750 (check-next-stream-line-equal _test-output-stream " 8b/-> *(ebp+0x00000008) 0x00000000/r32" "F - test-convert-function-returns-result/6") - 751 (check-next-stream-line-equal _test-output-stream " 40/increment-eax" "F - test-convert-function-returns-result/7") - 752 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-returns-result/8") - 753 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-returns-result/9") - 754 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-returns-result/10") - 755 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-returns-result/11") - 756 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-returns-result/12") - 757 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-returns-result/13") - 758 # . epilogue - 759 89/<- %esp 5/r32/ebp - 760 5d/pop-to-ebp - 761 c3/return - 762 - 763 test-convert-function-with-literal-arg: - 764 # . prologue - 765 55/push-ebp - 766 89/<- %ebp 4/r32/esp - 767 # setup - 768 (clear-stream _test-input-stream) - 769 (clear-stream $_test-input-buffered-file->buffer) - 770 (clear-stream _test-output-stream) - 771 (clear-stream $_test-output-buffered-file->buffer) - 772 # - 773 (write _test-input-stream "fn foo a: int, b: int -> result/eax: int {\n") - 774 (write _test-input-stream " result <- copy a\n") - 775 (write _test-input-stream " result <- add 1\n") - 776 (write _test-input-stream "}\n") - 777 # convert - 778 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 779 (flush _test-output-buffered-file) - 780 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 786 # check output - 787 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-literal-arg/0") - 788 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-literal-arg/1") - 789 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-literal-arg/2") - 790 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-literal-arg/3") - 791 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-literal-arg/4") - 792 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-literal-arg/5") - 793 (check-next-stream-line-equal _test-output-stream " 8b/-> *(ebp+0x00000008) 0x00000000/r32" "F - test-convert-function-with-literal-arg/6") - 794 (check-next-stream-line-equal _test-output-stream " 05/add-to-eax 1/imm32" "F - test-convert-function-with-literal-arg/7") - 795 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-literal-arg/8") - 796 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-literal-arg/9") - 797 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-literal-arg/10") - 798 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-literal-arg/11") - 799 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-literal-arg/12") - 800 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-literal-arg/13") - 801 # . epilogue - 802 89/<- %esp 5/r32/ebp - 803 5d/pop-to-ebp - 804 c3/return - 805 - 806 test-convert-function-with-literal-arg-2: - 807 # . prologue - 808 55/push-ebp - 809 89/<- %ebp 4/r32/esp - 810 # setup - 811 (clear-stream _test-input-stream) - 812 (clear-stream $_test-input-buffered-file->buffer) - 813 (clear-stream _test-output-stream) - 814 (clear-stream $_test-output-buffered-file->buffer) - 815 # - 816 (write _test-input-stream "fn foo a: int, b: int -> result/ebx: int {\n") - 817 (write _test-input-stream " result <- copy a\n") - 818 (write _test-input-stream " result <- add 1\n") - 819 (write _test-input-stream "}\n") - 820 # convert - 821 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 822 (flush _test-output-buffered-file) - 823 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 829 # check output - 830 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-literal-arg-2/0") - 831 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-literal-arg-2/1") - 832 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-literal-arg-2/2") - 833 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-literal-arg-2/3") - 834 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-literal-arg-2/4") - 835 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-literal-arg-2/5") - 836 (check-next-stream-line-equal _test-output-stream " 8b/-> *(ebp+0x00000008) 0x00000003/r32" "F - test-convert-function-with-literal-arg-2/6") - 837 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %ebx 1/imm32" "F - test-convert-function-with-literal-arg-2/7") - 838 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-literal-arg-2/8") - 839 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-literal-arg-2/9") - 840 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-literal-arg-2/10") - 841 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-literal-arg-2/11") - 842 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-literal-arg-2/12") - 843 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-literal-arg-2/13") - 844 # . epilogue - 845 89/<- %esp 5/r32/ebp - 846 5d/pop-to-ebp - 847 c3/return - 848 - 849 # HERE - 850 test-convert-function-call-with-literal-arg: - 851 # . prologue - 852 55/push-ebp - 853 89/<- %ebp 4/r32/esp - 854 # setup - 855 (clear-stream _test-input-stream) - 856 (clear-stream $_test-input-buffered-file->buffer) - 857 (clear-stream _test-output-stream) - 858 (clear-stream $_test-output-buffered-file->buffer) - 859 # - 860 (write _test-input-stream "fn main -> result/ebx: int {\n") - 861 (write _test-input-stream " result <- do-add 3 4\n") - 862 (write _test-input-stream "}\n") - 863 (write _test-input-stream "fn do-add a: int, b: int -> result/ebx: int {\n") - 864 (write _test-input-stream " result <- copy a\n") - 865 (write _test-input-stream " result <- add b\n") - 866 (write _test-input-stream "}\n") - 867 # convert - 868 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 869 (flush _test-output-buffered-file) - 870 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 876 # check output - 877 (check-next-stream-line-equal _test-output-stream "main:" "F - test-convert-function-call-with-literal-arg/0") - 878 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-call-with-literal-arg/1") - 879 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-call-with-literal-arg/2") - 880 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-call-with-literal-arg/3") - 881 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-call-with-literal-arg/4") - 882 (check-next-stream-line-equal _test-output-stream "$main:0x00000001:loop:" "F - test-convert-function-call-with-literal-arg/5") - 883 (check-next-stream-line-equal _test-output-stream " (do-add 3 4)" "F - test-convert-function-call-with-literal-arg/6") - 884 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-call-with-literal-arg/7") - 885 (check-next-stream-line-equal _test-output-stream "$main:0x00000001:break:" "F - test-convert-function-call-with-literal-arg/8") - 886 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-call-with-literal-arg/9") - 887 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-call-with-literal-arg/10") - 888 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-call-with-literal-arg/11") - 889 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-call-with-literal-arg/12") - 890 (check-next-stream-line-equal _test-output-stream "do-add:" "F - test-convert-function-call-with-literal-arg/13") - 891 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-call-with-literal-arg/14") - 892 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-call-with-literal-arg/15") - 893 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-call-with-literal-arg/16") - 894 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-call-with-literal-arg/17") - 895 (check-next-stream-line-equal _test-output-stream "$do-add:0x00000002:loop:" "F - test-convert-function-call-with-literal-arg/18") - 896 (check-next-stream-line-equal _test-output-stream " 8b/-> *(ebp+0x00000008) 0x00000003/r32" "F - test-convert-function-call-with-literal-arg/19") - 897 (check-next-stream-line-equal _test-output-stream " 03/add *(ebp+0x0000000c) 0x00000003/r32" "F - test-convert-function-call-with-literal-arg/20") - 898 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-call-with-literal-arg/21") - 899 (check-next-stream-line-equal _test-output-stream "$do-add:0x00000002:break:" "F - test-convert-function-call-with-literal-arg/22") - 900 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-call-with-literal-arg/23") - 901 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-call-with-literal-arg/24") - 902 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-call-with-literal-arg/25") - 903 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-call-with-literal-arg/26") - 904 # . epilogue - 905 89/<- %esp 5/r32/ebp - 906 5d/pop-to-ebp - 907 c3/return - 908 - 909 test-convert-function-with-local-var-in-mem: - 910 # . prologue - 911 55/push-ebp - 912 89/<- %ebp 4/r32/esp - 913 # setup - 914 (clear-stream _test-input-stream) - 915 (clear-stream $_test-input-buffered-file->buffer) - 916 (clear-stream _test-output-stream) - 917 (clear-stream $_test-output-buffered-file->buffer) - 918 # - 919 (write _test-input-stream "fn foo {\n") - 920 (write _test-input-stream " var x: int\n") - 921 (write _test-input-stream " increment x\n") - 922 (write _test-input-stream "}\n") - 923 # convert - 924 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 925 (flush _test-output-buffered-file) - 926 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 932 # check output - 933 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-local-var-in-mem/0") - 934 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-local-var-in-mem/1") - 935 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-local-var-in-mem/2") - 936 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-local-var-in-mem/3") - 937 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-local-var-in-mem/4") - 938 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-local-var-in-mem/5") - 939 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-local-var-in-mem/6") - 940 (check-next-stream-line-equal _test-output-stream " ff 0/subop/increment *(ebp+0xfffffffc)" "F - test-convert-function-with-local-var-in-mem/7") - 941 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-local-var-in-mem/8") - 942 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-local-var-in-mem/9") - 943 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-local-var-in-mem/10") - 944 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-local-var-in-mem/11") - 945 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-local-var-in-mem/12") - 946 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-local-var-in-mem/13") - 947 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-local-var-in-mem/14") - 948 # . epilogue - 949 89/<- %esp 5/r32/ebp - 950 5d/pop-to-ebp - 951 c3/return - 952 - 953 test-local-var-in-mem-has-no-initializer: - 954 # . prologue - 955 55/push-ebp - 956 89/<- %ebp 4/r32/esp - 957 # setup - 958 (clear-stream _test-input-stream) - 959 (clear-stream $_test-input-buffered-file->buffer) - 960 (clear-stream _test-output-stream) - 961 (clear-stream $_test-output-buffered-file->buffer) - 962 (clear-stream _test-error-stream) - 963 (clear-stream $_test-error-buffered-file->buffer) - 964 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) - 965 68/push 0/imm32 - 966 68/push 0/imm32 - 967 89/<- %edx 4/r32/esp - 968 (tailor-exit-descriptor %edx 0x10) - 969 # - 970 (write _test-input-stream "fn foo {\n") - 971 (write _test-input-stream " var x: int <- copy 0\n") - 972 (write _test-input-stream " increment x\n") - 973 (write _test-input-stream "}\n") - 974 # convert - 975 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) - 976 # registers except esp clobbered at this point - 977 # restore ed - 978 89/<- %edx 4/r32/esp - 979 (flush _test-output-buffered-file) - 980 (flush _test-error-buffered-file) - 981 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ - 987 # check output - 988 (check-stream-equal _test-output-stream "" "F - test-var-in-mem-has-no-initializer: output should be empty") - 989 (check-next-stream-line-equal _test-error-stream "fn foo: var x: variables on the stack can't take an initializer" "F - test-var-in-mem-has-no-initializer: error message") - 990 # check that stop(1) was called - 991 (check-ints-equal *(edx+4) 2 "F - test-var-in-mem-has-no-initializer: exit status") - 992 # don't restore from ebp - 993 81 0/subop/add %esp 8/imm32 - 994 # . epilogue - 995 5d/pop-to-ebp - 996 c3/return - 997 - 998 test-convert-function-with-local-var-with-compound-type-in-mem: - 999 # . prologue - 1000 55/push-ebp - 1001 89/<- %ebp 4/r32/esp - 1002 # setup - 1003 (clear-stream _test-input-stream) - 1004 (clear-stream $_test-input-buffered-file->buffer) - 1005 (clear-stream _test-output-stream) - 1006 (clear-stream $_test-output-buffered-file->buffer) - 1007 # - 1008 (write _test-input-stream "fn foo {\n") - 1009 (write _test-input-stream " var x: (addr int)\n") - 1010 (write _test-input-stream " copy-to x, 0\n") - 1011 (write _test-input-stream "}\n") - 1012 # convert - 1013 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 1014 (flush _test-output-buffered-file) - 1015 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 1021 # check output - 1022 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-local-var-with-compound-type-in-mem/0") - 1023 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-local-var-with-compound-type-in-mem/1") - 1024 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-local-var-with-compound-type-in-mem/2") - 1025 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-local-var-with-compound-type-in-mem/3") - 1026 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-local-var-with-compound-type-in-mem/4") - 1027 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-local-var-with-compound-type-in-mem/5") - 1028 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-local-var-with-compound-type-in-mem/6") - 1029 (check-next-stream-line-equal _test-output-stream " c7 0/subop/copy *(ebp+0xfffffffc) 0/imm32" "F - test-convert-function-with-local-var-with-compound-type-in-mem/7") - 1030 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-local-var-with-compound-type-in-mem/8") - 1031 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-local-var-with-compound-type-in-mem/9") - 1032 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-local-var-with-compound-type-in-mem/10") - 1033 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-local-var-with-compound-type-in-mem/11") - 1034 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-local-var-with-compound-type-in-mem/12") - 1035 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-local-var-with-compound-type-in-mem/13") - 1036 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-local-var-with-compound-type-in-mem/14") - 1037 # . epilogue - 1038 89/<- %esp 5/r32/ebp - 1039 5d/pop-to-ebp - 1040 c3/return - 1041 - 1042 test-convert-function-with-local-var-in-reg: - 1043 # . prologue - 1044 55/push-ebp - 1045 89/<- %ebp 4/r32/esp - 1046 # setup - 1047 (clear-stream _test-input-stream) - 1048 (clear-stream $_test-input-buffered-file->buffer) - 1049 (clear-stream _test-output-stream) - 1050 (clear-stream $_test-output-buffered-file->buffer) - 1051 # - 1052 (write _test-input-stream "fn foo {\n") - 1053 (write _test-input-stream " var x/ecx: int <- copy 3\n") - 1054 (write _test-input-stream " x <- increment\n") - 1055 (write _test-input-stream "}\n") - 1056 # convert - 1057 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 1058 (flush _test-output-buffered-file) - 1059 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 1065 # check output - 1066 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-local-var-in-reg/0") - 1067 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-local-var-in-reg/1") - 1068 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-local-var-in-reg/2") - 1069 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-local-var-in-reg/3") - 1070 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-local-var-in-reg/4") - 1071 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-local-var-in-reg/5") - 1072 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-convert-function-with-local-var-in-reg/6") - 1073 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 3/imm32" "F - test-convert-function-with-local-var-in-reg/7") - 1074 (check-next-stream-line-equal _test-output-stream " 41/increment-ecx" "F - test-convert-function-with-local-var-in-reg/8") - 1075 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-convert-function-with-local-var-in-reg/9") - 1076 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-local-var-in-reg/10") - 1077 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-local-var-in-reg/11") - 1078 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-local-var-in-reg/12") - 1079 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-local-var-in-reg/13") - 1080 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-local-var-in-reg/14") - 1081 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-local-var-in-reg/15") - 1082 # . epilogue - 1083 89/<- %esp 5/r32/ebp - 1084 5d/pop-to-ebp - 1085 c3/return - 1086 - 1087 test-convert-function-with-second-local-var-in-same-reg: - 1088 # . prologue - 1089 55/push-ebp - 1090 89/<- %ebp 4/r32/esp - 1091 # setup - 1092 (clear-stream _test-input-stream) - 1093 (clear-stream $_test-input-buffered-file->buffer) - 1094 (clear-stream _test-output-stream) - 1095 (clear-stream $_test-output-buffered-file->buffer) - 1096 # - 1097 (write _test-input-stream "fn foo {\n") - 1098 (write _test-input-stream " var x/ecx: int <- copy 3\n") - 1099 (write _test-input-stream " var y/ecx: int <- copy 4\n") - 1100 (write _test-input-stream " y <- increment\n") - 1101 (write _test-input-stream "}\n") - 1102 # convert - 1103 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 1104 (flush _test-output-buffered-file) - 1105 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 1111 # check output - 1112 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-second-local-var-in-same-reg/0") - 1113 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-second-local-var-in-same-reg/1") - 1114 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-second-local-var-in-same-reg/2") - 1115 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-second-local-var-in-same-reg/3") - 1116 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-second-local-var-in-same-reg/4") - 1117 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-second-local-var-in-same-reg/5") - 1118 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-convert-function-with-second-local-var-in-same-reg/6") - 1119 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 3/imm32" "F - test-convert-function-with-second-local-var-in-same-reg/7") - 1120 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 4/imm32" "F - test-convert-function-with-second-local-var-in-same-reg/8") - 1121 (check-next-stream-line-equal _test-output-stream " 41/increment-ecx" "F - test-convert-function-with-second-local-var-in-same-reg/9") - 1122 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-convert-function-with-second-local-var-in-same-reg/10") - 1123 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-second-local-var-in-same-reg/11") - 1124 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-second-local-var-in-same-reg/12") - 1125 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-second-local-var-in-same-reg/13") - 1126 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-second-local-var-in-same-reg/14") - 1127 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-second-local-var-in-same-reg/15") - 1128 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-second-local-var-in-same-reg/16") - 1129 # . epilogue - 1130 89/<- %esp 5/r32/ebp - 1131 5d/pop-to-ebp - 1132 c3/return - 1133 - 1134 test-read-clobbered-reg-var: - 1135 # . prologue - 1136 55/push-ebp - 1137 89/<- %ebp 4/r32/esp - 1138 # setup - 1139 (clear-stream _test-input-stream) - 1140 (clear-stream $_test-input-buffered-file->buffer) - 1141 (clear-stream _test-output-stream) - 1142 (clear-stream $_test-output-buffered-file->buffer) - 1143 (clear-stream _test-error-stream) - 1144 (clear-stream $_test-error-buffered-file->buffer) - 1145 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) # bytes of args in call to convert-mu - 1146 68/push 0/imm32 - 1147 68/push 0/imm32 - 1148 89/<- %edx 4/r32/esp - 1149 (tailor-exit-descriptor %edx 0x10) - 1150 # - 1151 (write _test-input-stream "fn foo {\n") - 1152 (write _test-input-stream " var x/ecx: int <- copy 3\n") - 1153 (write _test-input-stream " var y/ecx: int <- copy 4\n") - 1154 (write _test-input-stream " x <- increment\n") - 1155 (write _test-input-stream "}\n") - 1156 # convert - 1157 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) - 1158 # registers except esp clobbered at this point - 1159 # restore ed - 1160 89/<- %edx 4/r32/esp - 1161 (flush _test-output-buffered-file) - 1162 (flush _test-error-buffered-file) - 1163 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ - 1169 # check output - 1170 (check-stream-equal _test-output-stream "" "F - test-read-clobbered-reg-var: output should be empty") - 1171 (check-next-stream-line-equal _test-error-stream "fn foo: register ecx reads var 'x' after writing var 'y'" "F - test-read-clobbered-reg-var: error message") - 1172 # check that stop(1) was called - 1173 (check-ints-equal *(edx+4) 2 "F - test-read-clobbered-reg-var: exit status") - 1174 # don't restore from ebp - 1175 81 0/subop/add %esp 8/imm32 - 1176 # . epilogue - 1177 5d/pop-to-ebp - 1178 c3/return - 1179 - 1180 test-convert-function-call: - 1181 # . prologue - 1182 55/push-ebp - 1183 89/<- %ebp 4/r32/esp - 1184 # setup - 1185 (clear-stream _test-input-stream) - 1186 (clear-stream $_test-input-buffered-file->buffer) - 1187 (clear-stream _test-output-stream) - 1188 (clear-stream $_test-output-buffered-file->buffer) - 1189 # - 1190 (write _test-input-stream "fn main -> result/ebx: int {\n") - 1191 (write _test-input-stream " result <- foo\n") - 1192 (write _test-input-stream "}\n") - 1193 (write _test-input-stream "fn foo -> result/ebx: int {\n") - 1194 (write _test-input-stream " result <- copy 3\n") - 1195 (write _test-input-stream "}\n") - 1196 # convert - 1197 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 1198 (flush _test-output-buffered-file) - 1199 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 1205 # check output - 1206 (check-next-stream-line-equal _test-output-stream "main:" "F - test-convert-function-call/0") - 1207 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-call/1") - 1208 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-call/2") - 1209 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-call/3") - 1210 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-call/4") - 1211 (check-next-stream-line-equal _test-output-stream "$main:0x00000001:loop:" "F - test-convert-function-call/5") - 1212 (check-next-stream-line-equal _test-output-stream " (foo)" "F - test-convert-function-call/6") - 1213 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-call/7") - 1214 (check-next-stream-line-equal _test-output-stream "$main:0x00000001:break:" "F - test-convert-function-call/8") - 1215 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-call/9") - 1216 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-call/10") - 1217 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-call/11") - 1218 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-call/12") - 1219 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-call/13") - 1220 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-call/14") - 1221 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-call/15") - 1222 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-call/16") - 1223 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-call/17") - 1224 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:loop:" "F - test-convert-function-call/18") - 1225 (check-next-stream-line-equal _test-output-stream " bb/copy-to-ebx 3/imm32" "F - test-convert-function-call/19") - 1226 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-call/20") - 1227 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:break:" "F - test-convert-function-call/21") - 1228 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-call/22") - 1229 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-call/23") - 1230 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-call/24") - 1231 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-call/25") - 1232 # . epilogue - 1233 89/<- %esp 5/r32/ebp - 1234 5d/pop-to-ebp - 1235 c3/return - 1236 - 1237 test-convert-function-call-with-incorrect-inout-type: - 1238 # . prologue - 1239 55/push-ebp - 1240 89/<- %ebp 4/r32/esp - 1241 # setup - 1242 (clear-stream _test-input-stream) - 1243 (clear-stream $_test-input-buffered-file->buffer) - 1244 (clear-stream _test-output-stream) - 1245 (clear-stream $_test-output-buffered-file->buffer) - 1246 (clear-stream _test-error-stream) - 1247 (clear-stream $_test-error-buffered-file->buffer) - 1248 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) - 1249 68/push 0/imm32 - 1250 68/push 0/imm32 - 1251 89/<- %edx 4/r32/esp - 1252 (tailor-exit-descriptor %edx 0x10) - 1253 # - 1254 (write _test-input-stream "fn f {\n") - 1255 (write _test-input-stream " var x: int\n") - 1256 (write _test-input-stream " g x\n") - 1257 (write _test-input-stream "}\n") - 1258 (write _test-input-stream "fn g a: foo {\n") - 1259 (write _test-input-stream "}\n") - 1260 # convert - 1261 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) - 1262 # registers except esp clobbered at this point - 1263 # restore ed - 1264 89/<- %edx 4/r32/esp - 1265 (flush _test-output-buffered-file) - 1266 (flush _test-error-buffered-file) - 1267 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ - 1273 # check output - 1274 (check-stream-equal _test-output-stream "" "F - test-convert-function-call-with-incorrect-inout-type: output should be empty") - 1275 (check-next-stream-line-equal _test-error-stream "fn f: call g: type for inout 'x' is not right" "F - test-convert-function-call-with-incorrect-inout-type: error message") - 1276 # check that stop(1) was called - 1277 (check-ints-equal *(edx+4) 2 "F - test-convert-function-call-with-incorrect-inout-type: exit status") - 1278 # don't restore from ebp - 1279 81 0/subop/add %esp 8/imm32 - 1280 5d/pop-to-ebp - 1281 c3/return - 1282 - 1283 test-convert-function-call-with-too-few-inouts: - 1284 # . prologue - 1285 55/push-ebp - 1286 89/<- %ebp 4/r32/esp - 1287 # setup - 1288 (clear-stream _test-input-stream) - 1289 (clear-stream $_test-input-buffered-file->buffer) - 1290 (clear-stream _test-output-stream) - 1291 (clear-stream $_test-output-buffered-file->buffer) - 1292 (clear-stream _test-error-stream) - 1293 (clear-stream $_test-error-buffered-file->buffer) - 1294 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) - 1295 68/push 0/imm32 - 1296 68/push 0/imm32 - 1297 89/<- %edx 4/r32/esp - 1298 (tailor-exit-descriptor %edx 0x10) - 1299 # - 1300 (write _test-input-stream "fn f {\n") - 1301 (write _test-input-stream " g\n") - 1302 (write _test-input-stream "}\n") - 1303 (write _test-input-stream "fn g a: int {\n") - 1304 (write _test-input-stream "}\n") - 1305 # convert - 1306 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) - 1307 # registers except esp clobbered at this point - 1308 # restore ed - 1309 89/<- %edx 4/r32/esp - 1310 (flush _test-output-buffered-file) - 1311 (flush _test-error-buffered-file) - 1312 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ - 1318 # check output - 1319 (check-stream-equal _test-output-stream "" "F - test-convert-function-call-with-too-few-inouts: output should be empty") - 1320 (check-next-stream-line-equal _test-error-stream "fn f: call g: too few inouts" "F - test-convert-function-call-with-too-few-inouts: error message") - 1321 # check that stop(1) was called - 1322 (check-ints-equal *(edx+4) 2 "F - test-convert-function-call-with-too-few-inouts: exit status") - 1323 # don't restore from ebp - 1324 81 0/subop/add %esp 8/imm32 - 1325 5d/pop-to-ebp - 1326 c3/return - 1327 - 1328 test-convert-function-call-with-too-many-inouts: - 1329 # . prologue - 1330 55/push-ebp - 1331 89/<- %ebp 4/r32/esp - 1332 # setup - 1333 (clear-stream _test-input-stream) - 1334 (clear-stream $_test-input-buffered-file->buffer) - 1335 (clear-stream _test-output-stream) - 1336 (clear-stream $_test-output-buffered-file->buffer) - 1337 (clear-stream _test-error-stream) - 1338 (clear-stream $_test-error-buffered-file->buffer) - 1339 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) - 1340 68/push 0/imm32 - 1341 68/push 0/imm32 - 1342 89/<- %edx 4/r32/esp - 1343 (tailor-exit-descriptor %edx 0x10) - 1344 # - 1345 (write _test-input-stream "fn f {\n") - 1346 (write _test-input-stream " var x: int\n") - 1347 (write _test-input-stream " g x\n") - 1348 (write _test-input-stream "}\n") - 1349 (write _test-input-stream "fn g {\n") - 1350 (write _test-input-stream "}\n") - 1351 # convert - 1352 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) - 1353 # registers except esp clobbered at this point - 1354 # restore ed - 1355 89/<- %edx 4/r32/esp - 1356 (flush _test-output-buffered-file) - 1357 (flush _test-error-buffered-file) - 1358 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ - 1364 # check output - 1365 (check-stream-equal _test-output-stream "" "F - test-convert-function-call-with-too-many-inouts: output should be empty") - 1366 (check-next-stream-line-equal _test-error-stream "fn f: call g: too many inouts" "F - test-convert-function-call-with-too-many-inouts: error message") - 1367 # check that stop(1) was called - 1368 (check-ints-equal *(edx+4) 2 "F - test-convert-function-call-with-too-many-inouts: exit status") - 1369 # don't restore from ebp - 1370 81 0/subop/add %esp 8/imm32 - 1371 5d/pop-to-ebp - 1372 c3/return - 1373 - 1374 test-convert-function-call-with-incorrect-output-type: - 1375 # . prologue - 1376 55/push-ebp - 1377 89/<- %ebp 4/r32/esp - 1378 # setup - 1379 (clear-stream _test-input-stream) - 1380 (clear-stream $_test-input-buffered-file->buffer) - 1381 (clear-stream _test-output-stream) - 1382 (clear-stream $_test-output-buffered-file->buffer) - 1383 (clear-stream _test-error-stream) - 1384 (clear-stream $_test-error-buffered-file->buffer) - 1385 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) - 1386 68/push 0/imm32 - 1387 68/push 0/imm32 - 1388 89/<- %edx 4/r32/esp - 1389 (tailor-exit-descriptor %edx 0x10) - 1390 # - 1391 (write _test-input-stream "fn f {\n") - 1392 (write _test-input-stream " var x/eax: int <- g\n") - 1393 (write _test-input-stream "}\n") - 1394 (write _test-input-stream "fn g -> a/eax: foo {\n") - 1395 (write _test-input-stream "}\n") - 1396 # convert - 1397 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) - 1398 # registers except esp clobbered at this point - 1399 # restore ed - 1400 89/<- %edx 4/r32/esp - 1401 (flush _test-output-buffered-file) - 1402 (flush _test-error-buffered-file) - 1403 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ - 1409 # check output - 1410 (check-stream-equal _test-output-stream "" "F - test-convert-function-call-with-incorrect-output-type: output should be empty") - 1411 (check-next-stream-line-equal _test-error-stream "fn f: call g: type for output 'x' is not right" "F - test-convert-function-call-with-incorrect-output-type: error message") - 1412 # check that stop(1) was called - 1413 (check-ints-equal *(edx+4) 2 "F - test-convert-function-call-with-incorrect-output-type: exit status") - 1414 # don't restore from ebp - 1415 81 0/subop/add %esp 8/imm32 - 1416 5d/pop-to-ebp - 1417 c3/return - 1418 - 1419 test-convert-function-call-with-too-few-outputs: - 1420 # . prologue - 1421 55/push-ebp - 1422 89/<- %ebp 4/r32/esp - 1423 # setup - 1424 (clear-stream _test-input-stream) - 1425 (clear-stream $_test-input-buffered-file->buffer) - 1426 (clear-stream _test-output-stream) - 1427 (clear-stream $_test-output-buffered-file->buffer) - 1428 (clear-stream _test-error-stream) - 1429 (clear-stream $_test-error-buffered-file->buffer) - 1430 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) - 1431 68/push 0/imm32 - 1432 68/push 0/imm32 - 1433 89/<- %edx 4/r32/esp - 1434 (tailor-exit-descriptor %edx 0x10) - 1435 # - 1436 (write _test-input-stream "fn f {\n") - 1437 (write _test-input-stream " g\n") - 1438 (write _test-input-stream "}\n") - 1439 (write _test-input-stream "fn g -> a/eax: int {\n") - 1440 (write _test-input-stream "}\n") - 1441 # convert - 1442 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) - 1443 # registers except esp clobbered at this point - 1444 # restore ed - 1445 89/<- %edx 4/r32/esp - 1446 (flush _test-output-buffered-file) - 1447 (flush _test-error-buffered-file) - 1448 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ - 1454 # check output - 1455 (check-stream-equal _test-output-stream "" "F - test-convert-function-call-with-too-few-outputs: output should be empty") - 1456 (check-next-stream-line-equal _test-error-stream "fn f: call g: too few outputs" "F - test-convert-function-call-with-too-few-outputs: error message") - 1457 # check that stop(1) was called - 1458 (check-ints-equal *(edx+4) 2 "F - test-convert-function-call-with-too-few-outputs: exit status") - 1459 # don't restore from ebp - 1460 81 0/subop/add %esp 8/imm32 - 1461 5d/pop-to-ebp - 1462 c3/return - 1463 - 1464 test-convert-function-call-with-too-many-outputs: - 1465 # . prologue - 1466 55/push-ebp - 1467 89/<- %ebp 4/r32/esp - 1468 # setup - 1469 (clear-stream _test-input-stream) - 1470 (clear-stream $_test-input-buffered-file->buffer) - 1471 (clear-stream _test-output-stream) - 1472 (clear-stream $_test-output-buffered-file->buffer) - 1473 (clear-stream _test-error-stream) - 1474 (clear-stream $_test-error-buffered-file->buffer) - 1475 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) - 1476 68/push 0/imm32 - 1477 68/push 0/imm32 - 1478 89/<- %edx 4/r32/esp - 1479 (tailor-exit-descriptor %edx 0x10) - 1480 # - 1481 (write _test-input-stream "fn f {\n") - 1482 (write _test-input-stream " var x/eax: int <- g\n") - 1483 (write _test-input-stream "}\n") - 1484 (write _test-input-stream "fn g {\n") - 1485 (write _test-input-stream "}\n") - 1486 # convert - 1487 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) - 1488 # registers except esp clobbered at this point - 1489 # restore ed - 1490 89/<- %edx 4/r32/esp - 1491 (flush _test-output-buffered-file) - 1492 (flush _test-error-buffered-file) - 1493 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ - 1499 # check output - 1500 (check-stream-equal _test-output-stream "" "F - test-convert-function-call-with-too-many-outputs: output should be empty") - 1501 (check-next-stream-line-equal _test-error-stream "fn f: call g: too many outputs" "F - test-convert-function-call-with-too-many-outputs: error message") - 1502 # check that stop(1) was called - 1503 (check-ints-equal *(edx+4) 2 "F - test-convert-function-call-with-too-many-outputs: exit status") - 1504 # don't restore from ebp - 1505 81 0/subop/add %esp 8/imm32 - 1506 5d/pop-to-ebp - 1507 c3/return - 1508 - 1509 test-convert-function-call-with-incorrect-output-register: - 1510 # . prologue - 1511 55/push-ebp - 1512 89/<- %ebp 4/r32/esp - 1513 # setup - 1514 (clear-stream _test-input-stream) - 1515 (clear-stream $_test-input-buffered-file->buffer) - 1516 (clear-stream _test-output-stream) - 1517 (clear-stream $_test-output-buffered-file->buffer) - 1518 (clear-stream _test-error-stream) - 1519 (clear-stream $_test-error-buffered-file->buffer) - 1520 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) - 1521 68/push 0/imm32 - 1522 68/push 0/imm32 - 1523 89/<- %edx 4/r32/esp - 1524 (tailor-exit-descriptor %edx 0x10) - 1525 # - 1526 (write _test-input-stream "fn f {\n") - 1527 (write _test-input-stream " var x/ecx: int <- g\n") - 1528 (write _test-input-stream "}\n") - 1529 (write _test-input-stream "fn g -> a/eax: int {\n") - 1530 (write _test-input-stream "}\n") - 1531 # convert - 1532 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) - 1533 # registers except esp clobbered at this point - 1534 # restore ed - 1535 89/<- %edx 4/r32/esp - 1536 (flush _test-output-buffered-file) - 1537 (flush _test-error-buffered-file) - 1538 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ - 1544 # check output - 1545 (check-stream-equal _test-output-stream "" "F - test-convert-function-call-with-incorrect-output-register: output should be empty") - 1546 (check-next-stream-line-equal _test-error-stream "fn f: call g: register for output 'x' is not right" "F - test-convert-function-call-with-incorrect-output-register: error message") - 1547 # check that stop(1) was called - 1548 (check-ints-equal *(edx+4) 2 "F - test-convert-function-call-with-incorrect-output-register: exit status") - 1549 # don't restore from ebp - 1550 81 0/subop/add %esp 8/imm32 - 1551 5d/pop-to-ebp - 1552 c3/return - 1553 - 1554 test-convert-function-with-local-var-dereferenced: - 1555 # . prologue - 1556 55/push-ebp - 1557 89/<- %ebp 4/r32/esp - 1558 # setup - 1559 (clear-stream _test-input-stream) - 1560 (clear-stream $_test-input-buffered-file->buffer) - 1561 (clear-stream _test-output-stream) - 1562 (clear-stream $_test-output-buffered-file->buffer) - 1563 # - 1564 (write _test-input-stream "fn foo {\n") - 1565 (write _test-input-stream " var x/ecx: (addr int) <- copy 0\n") - 1566 (write _test-input-stream " increment *x\n") - 1567 (write _test-input-stream "}\n") - 1568 # convert - 1569 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 1570 (flush _test-output-buffered-file) - 1571 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 1577 # check output - 1578 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-local-var-dereferenced/0") - 1579 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-local-var-dereferenced/1") - 1580 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-local-var-dereferenced/2") - 1581 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-local-var-dereferenced/3") - 1582 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-local-var-dereferenced/4") - 1583 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-local-var-dereferenced/5") - 1584 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-convert-function-with-local-var-dereferenced/6") - 1585 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 0/imm32" "F - test-convert-function-with-local-var-dereferenced/7") - 1586 (check-next-stream-line-equal _test-output-stream " ff 0/subop/increment *ecx" "F - test-convert-function-with-local-var-dereferenced/8") - 1587 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-convert-function-with-local-var-dereferenced/9") - 1588 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-local-var-dereferenced/10") - 1589 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-local-var-dereferenced/11") - 1590 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-local-var-dereferenced/12") - 1591 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-local-var-dereferenced/13") - 1592 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-local-var-dereferenced/14") - 1593 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-local-var-dereferenced/15") - 1594 # . epilogue - 1595 89/<- %esp 5/r32/ebp - 1596 5d/pop-to-ebp - 1597 c3/return - 1598 - 1599 # variables of type 'byte' are not allowed on the stack - 1600 test-convert-function-with-byte-operations: - 1601 # . prologue - 1602 55/push-ebp - 1603 89/<- %ebp 4/r32/esp - 1604 # setup - 1605 (clear-stream _test-input-stream) - 1606 (clear-stream $_test-input-buffered-file->buffer) - 1607 (clear-stream _test-output-stream) - 1608 (clear-stream $_test-output-buffered-file->buffer) - 1609 # - 1610 (write _test-input-stream "fn foo {\n") - 1611 (write _test-input-stream " var x/eax: byte <- copy 0\n") - 1612 (write _test-input-stream " var y/ecx: byte <- copy 0\n") - 1613 (write _test-input-stream " y <- copy-byte x\n") - 1614 (write _test-input-stream " var z/edx: (addr byte) <- copy 0\n") - 1615 (write _test-input-stream " y <- copy-byte *z\n") - 1616 (write _test-input-stream " copy-byte-to *z, x\n") - 1617 (write _test-input-stream "}\n") - 1618 # convert - 1619 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 1620 (flush _test-output-buffered-file) - 1621 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 1627 # check output - 1628 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-byte-operations/0") - 1629 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-byte-operations/1") - 1630 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-byte-operations/2") - 1631 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-byte-operations/3") - 1632 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-byte-operations/4") - 1633 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-byte-operations/5") - 1634 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-function-with-byte-operations/6") - 1635 (check-next-stream-line-equal _test-output-stream " b8/copy-to-eax 0/imm32" "F - test-convert-function-with-byte-operations/7") - 1636 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-convert-function-with-byte-operations/8") - 1637 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 0/imm32" "F - test-convert-function-with-byte-operations/9") - 1638 (check-next-stream-line-equal _test-output-stream " 8a/byte-> %eax 0x00000001/r32" "F - test-convert-function-with-byte-operations/10") - 1639 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %edx" "F - test-convert-function-with-byte-operations/11") - 1640 (check-next-stream-line-equal _test-output-stream " ba/copy-to-edx 0/imm32" "F - test-convert-function-with-byte-operations/12") - 1641 (check-next-stream-line-equal _test-output-stream " 8a/byte-> *edx 0x00000001/r32" "F - test-convert-function-with-byte-operations/13") - 1642 (check-next-stream-line-equal _test-output-stream " 88/byte<- *edx 0x00000000/r32" "F - test-convert-function-with-byte-operations/14") - 1643 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %edx" "F - test-convert-function-with-byte-operations/15") - 1644 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-convert-function-with-byte-operations/16") - 1645 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-function-with-byte-operations/17") - 1646 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-byte-operations/18") - 1647 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-byte-operations/19") - 1648 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-byte-operations/20") - 1649 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-byte-operations/21") - 1650 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-byte-operations/22") - 1651 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-byte-operations/23") - 1652 # . epilogue - 1653 89/<- %esp 5/r32/ebp - 1654 5d/pop-to-ebp - 1655 c3/return - 1656 - 1657 # variables of type 'byte' _can_ be function args. They then occupy 4 bytes. - 1658 test-copy-byte-var-from-fn-arg: - 1659 # . prologue - 1660 55/push-ebp - 1661 89/<- %ebp 4/r32/esp - 1662 # setup - 1663 (clear-stream _test-input-stream) - 1664 (clear-stream $_test-input-buffered-file->buffer) - 1665 (clear-stream _test-output-stream) - 1666 (clear-stream $_test-output-buffered-file->buffer) - 1667 # - 1668 (write _test-input-stream "fn foo x: byte, y: int {\n") - 1669 (write _test-input-stream " var a/eax: byte <- copy x\n") - 1670 (write _test-input-stream " var b/eax: int <- copy y\n") - 1671 (write _test-input-stream "}\n") - 1672 # convert - 1673 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 1674 (flush _test-output-buffered-file) - 1675 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 1681 # check output - 1682 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-copy-byte-from-fn-arg/0") - 1683 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-copy-byte-from-fn-arg/1") - 1684 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-copy-byte-from-fn-arg/2") - 1685 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-copy-byte-from-fn-arg/3") - 1686 (check-next-stream-line-equal _test-output-stream " {" "F - test-copy-byte-from-fn-arg/4") - 1687 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-copy-byte-from-fn-arg/5") - 1688 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-copy-byte-from-fn-arg/6") - 1689 (check-next-stream-line-equal _test-output-stream " 8b/-> *(ebp+0x00000008) 0x00000000/r32" "F - test-copy-byte-from-fn-arg/7") - 1690 (check-next-stream-line-equal _test-output-stream " 8b/-> *(ebp+0x0000000c) 0x00000000/r32" "F - test-copy-byte-from-fn-arg/8") - 1691 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-copy-byte-from-fn-arg/9") - 1692 (check-next-stream-line-equal _test-output-stream " }" "F - test-copy-byte-from-fn-arg/10") - 1693 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-copy-byte-from-fn-arg/11") - 1694 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-copy-byte-from-fn-arg/12") - 1695 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-copy-byte-from-fn-arg/13") - 1696 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-copy-byte-from-fn-arg/14") - 1697 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-copy-byte-from-fn-arg/15") - 1698 # . epilogue - 1699 89/<- %esp 5/r32/ebp - 1700 5d/pop-to-ebp - 1701 c3/return - 1702 - 1703 test-convert-compare-register-with-literal: - 1704 # . prologue - 1705 55/push-ebp - 1706 89/<- %ebp 4/r32/esp - 1707 # setup - 1708 (clear-stream _test-input-stream) - 1709 (clear-stream $_test-input-buffered-file->buffer) - 1710 (clear-stream _test-output-stream) - 1711 (clear-stream $_test-output-buffered-file->buffer) - 1712 # - 1713 (write _test-input-stream "fn foo {\n") - 1714 (write _test-input-stream " var x/ecx: int <- copy 0\n") - 1715 (write _test-input-stream " compare x, 0\n") - 1716 (write _test-input-stream "}\n") - 1717 # convert - 1718 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 1719 (flush _test-output-buffered-file) - 1720 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 1726 # check output - 1727 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-compare-register-with-literal/0") - 1728 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-compare-register-with-literal/1") - 1729 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-compare-register-with-literal/2") - 1730 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-compare-register-with-literal/3") - 1731 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-compare-register-with-literal/4") - 1732 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-compare-register-with-literal/5") - 1733 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-convert-compare-register-with-literal/6") - 1734 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 0/imm32" "F - test-convert-compare-register-with-literal/7") - 1735 (check-next-stream-line-equal _test-output-stream " 81 7/subop/compare %ecx 0/imm32" "F - test-convert-compare-register-with-literal/8") - 1736 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-convert-compare-register-with-literal/9") - 1737 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-compare-register-with-literal/10") - 1738 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-compare-register-with-literal/11") - 1739 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-compare-register-with-literal/12") - 1740 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-compare-register-with-literal/13") - 1741 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-compare-register-with-literal/14") - 1742 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-compare-register-with-literal/15") - 1743 # . epilogue - 1744 89/<- %esp 5/r32/ebp - 1745 5d/pop-to-ebp - 1746 c3/return - 1747 - 1748 test-unknown-variable: - 1749 # . prologue - 1750 55/push-ebp - 1751 89/<- %ebp 4/r32/esp - 1752 # setup - 1753 (clear-stream _test-input-stream) - 1754 (clear-stream $_test-input-buffered-file->buffer) - 1755 (clear-stream _test-output-stream) - 1756 (clear-stream $_test-output-buffered-file->buffer) - 1757 (clear-stream _test-error-stream) - 1758 (clear-stream $_test-error-buffered-file->buffer) - 1759 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) - 1760 68/push 0/imm32 - 1761 68/push 0/imm32 - 1762 89/<- %edx 4/r32/esp - 1763 (tailor-exit-descriptor %edx 0x10) - 1764 # - 1765 (write _test-input-stream "fn foo {\n") - 1766 (write _test-input-stream " compare x, 0\n") - 1767 (write _test-input-stream "}\n") - 1768 # convert - 1769 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) - 1770 # registers except esp clobbered at this point - 1771 # restore ed - 1772 89/<- %edx 4/r32/esp - 1773 (flush _test-output-buffered-file) - 1774 (flush _test-error-buffered-file) - 1775 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ - 1781 # check output - 1782 (check-stream-equal _test-output-stream "" "F - test-unknown-variable: output should be empty") - 1783 (check-next-stream-line-equal _test-error-stream "fn foo: unknown variable 'x'" "F - test-unknown-variable: error message") - 1784 # check that stop(1) was called - 1785 (check-ints-equal *(edx+4) 2 "F - test-unknown-variable: exit status") - 1786 # don't restore from ebp - 1787 81 0/subop/add %esp 8/imm32 - 1788 # . epilogue - 1789 5d/pop-to-ebp - 1790 c3/return - 1791 - 1792 test-convert-function-with-local-var-in-block: - 1793 # . prologue - 1794 55/push-ebp - 1795 89/<- %ebp 4/r32/esp - 1796 # setup - 1797 (clear-stream _test-input-stream) - 1798 (clear-stream $_test-input-buffered-file->buffer) - 1799 (clear-stream _test-output-stream) - 1800 (clear-stream $_test-output-buffered-file->buffer) - 1801 # - 1802 (write _test-input-stream "fn foo {\n") - 1803 (write _test-input-stream " {\n") - 1804 (write _test-input-stream " var x: int\n") - 1805 (write _test-input-stream " increment x\n") - 1806 (write _test-input-stream " }\n") - 1807 (write _test-input-stream "}\n") - 1808 # convert - 1809 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 1810 (flush _test-output-buffered-file) - 1811 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 1817 # check output - 1818 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-local-var-in-block/0") - 1819 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-local-var-in-block/1") - 1820 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-local-var-in-block/2") - 1821 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-local-var-in-block/3") - 1822 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-local-var-in-block/4") - 1823 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-local-var-in-block/5") - 1824 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-local-var-in-block/6") - 1825 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:loop:" "F - test-convert-function-with-local-var-in-block/7") - 1826 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-local-var-in-block/8") - 1827 (check-next-stream-line-equal _test-output-stream " ff 0/subop/increment *(ebp+0xfffffffc)" "F - test-convert-function-with-local-var-in-block/9") - 1828 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-local-var-in-block/10") - 1829 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-local-var-in-block/11") - 1830 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:break:" "F - test-convert-function-with-local-var-in-block/12") - 1831 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-local-var-in-block/13") - 1832 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-local-var-in-block/14") - 1833 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-local-var-in-block/15") - 1834 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-local-var-in-block/16") - 1835 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-local-var-in-block/17") - 1836 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-local-var-in-block/18") + 254 # Sometimes the type is of the value at that offset for the given type. For + 255 # example, if you start at a function record and move forward Function-inouts + 256 # bytes, you'll find a (handle list var). + 257 # + 258 # At other times, the type is of the constant itself. For example, the type of + 259 # the constant Function-size is (addr int). To get the size of a function, + 260 # look in *Function-size. + 261 + 262 Function-name: # (handle array byte) + 263 0/imm32 + 264 Function-inouts: # (handle list var) + 265 8/imm32 + 266 Function-outputs: # (handle list var) + 267 0x10/imm32 + 268 Function-body: # (handle block) + 269 0x18/imm32 + 270 Function-next: # (handle function) + 271 0x20/imm32 + 272 Function-size: # (addr int) + 273 0x28/imm32/40 + 274 + 275 Primitive-name: # (handle array byte) + 276 0/imm32 + 277 Primitive-inouts: # (handle list var) + 278 8/imm32 + 279 Primitive-outputs: # (handle list var) + 280 0x10/imm32 + 281 Primitive-subx-name: # (handle array byte) + 282 0x18/imm32 + 283 Primitive-subx-rm32: # enum arg-location + 284 0x20/imm32 + 285 Primitive-subx-r32: # enum arg-location + 286 0x24/imm32 + 287 Primitive-subx-imm32: # enum arg-location + 288 0x28/imm32 + 289 Primitive-subx-disp32: # enum arg-location -- only for branches + 290 0x2c/imm32 + 291 Primitive-output-is-write-only: # boolean + 292 0x30/imm32 + 293 Primitive-next: # (handle function) + 294 0x34/imm32 + 295 Primitive-size: # (addr int) + 296 0x3c/imm32/60 + 297 + 298 Stmt-tag: # int + 299 0/imm32 + 300 + 301 Block-stmts: # (handle list stmt) + 302 4/imm32 + 303 Block-var: # (handle var) + 304 0xc/imm32 + 305 + 306 Stmt1-operation: # (handle array byte) + 307 4/imm32 + 308 Stmt1-inouts: # (handle stmt-var) + 309 0xc/imm32 + 310 Stmt1-outputs: # (handle stmt-var) + 311 0x14/imm32 + 312 + 313 Vardef-var: # (handle var) + 314 4/imm32 + 315 + 316 Regvardef-operation: # (handle array byte) + 317 4/imm32 + 318 Regvardef-inouts: # (handle stmt-var) + 319 0xc/imm32 + 320 Regvardef-outputs: # (handle stmt-var) # will have exactly one element + 321 0x14/imm32 + 322 + 323 Stmt-size: # (addr int) + 324 0x1c/imm32 + 325 + 326 Var-name: # (handle array byte) + 327 0/imm32 + 328 Var-type: # (handle type-tree) + 329 8/imm32 + 330 Var-block-depth: # int -- not available until code-generation time + 331 0x10/imm32 + 332 Var-offset: # int -- not available until code-generation time + 333 0x14/imm32 + 334 Var-register: # (handle array byte) -- name of a register + 335 0x18/imm32 + 336 Var-size: # (addr int) + 337 0x20/imm32 + 338 + 339 List-value: # (handle _) + 340 0/imm32 + 341 List-next: # (handle list _) + 342 8/imm32 + 343 List-size: # (addr int) + 344 0x10/imm32 + 345 + 346 # A stmt-var is like a list of vars with call-site specific metadata + 347 Stmt-var-value: # (handle var) + 348 0/imm32 + 349 Stmt-var-next: # (handle stmt-var) + 350 8/imm32 + 351 Stmt-var-is-deref: # boolean + 352 0x10/imm32 + 353 Stmt-var-size: # (addr int) + 354 0x14/imm32 + 355 + 356 # A live-var is a var augmented with information needed for tracking live + 357 # variables. + 358 Live-var-value: # (handle var) + 359 0/imm32 + 360 Live-var-register-spilled: # boolean; only used if value is in a register, and only during code-gen + 361 8/imm32 + 362 Live-var-size: # (addr int) + 363 0xc/imm32 + 364 + 365 # Types are expressed as trees (s-expressions) of type-ids (ints). + 366 + 367 Type-tree-is-atom: # boolean + 368 0/imm32 + 369 # if left-is-atom? + 370 Type-tree-value: # type-id + 371 4/imm32 + 372 Type-tree-value-size: # int (for static data structure sizes) + 373 8/imm32 + 374 # unless left-is-atom? + 375 Type-tree-left: # (addr type-tree) + 376 4/imm32 + 377 Type-tree-right: # (addr type-tree) + 378 0xc/imm32 + 379 # + 380 Type-tree-size: # (addr int) + 381 0x14/imm32 + 382 + 383 # Types + 384 + 385 # TODO: Turn this data structure into valid Mu, with (fake) handles rather than addrs. + 386 Type-id: # (stream (addr array byte)) + 387 0/imm32/write # initialized later from Primitive-type-ids + 388 0/imm32/read + 389 0x100/imm32/size + 390 # data + 391 "literal"/imm32 # 0: value is just the name + 392 "int"/imm32 # 1 + 393 "addr"/imm32 # 2 + 394 "array"/imm32 # 3 + 395 "handle"/imm32 # 4 + 396 "boolean"/imm32 # 5 + 397 "constant"/imm32 # 6: like a literal, but value is an int in Var-offset + 398 "offset"/imm32 # 7: (offset T) is guaranteed to be a 32-bit multiple of size-of(T) + 399 # 0x20 + 400 "byte"/imm32 # 8 + 401 0/imm32 # 9 reserved for array-capacity; value is in Type-tree-size + 402 # Not to be used directly, so we don't include a name here. + 403 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 + 404 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 + 405 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 + 406 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 + 407 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 + 408 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 + 409 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 + 410 + 411 Primitive-type-ids: # (addr int) + 412 0x24 + 413 + 414 # == Type definitions + 415 # Program->types contains some typeinfo for each type definition. + 416 # Types contain vars with types, but can't specify registers. + 417 Typeinfo-id: # type-id + 418 0/imm32 + 419 Typeinfo-fields: # (handle table (handle array byte) (handle typeinfo-entry)) + 420 4/imm32 + 421 # Total size must be >= 0 + 422 # During parsing it may take on two additional values: + 423 # -2: not yet initialized + 424 # -1: in process of being computed + 425 # See populate-mu-type-sizes for details. + 426 Typeinfo-total-size-in-bytes: # int + 427 0xc/imm32 + 428 Typeinfo-next: # (handle typeinfo) + 429 0x10/imm32 + 430 Typeinfo-size: # (addr int) + 431 0x18/imm32 + 432 + 433 # Each entry in the typeinfo->fields table has a pointer to a string and a + 434 # pointer to a typeinfo-entry. + 435 Typeinfo-fields-row-size: # (addr int) + 436 0x10/imm32 + 437 + 438 # typeinfo-entry objects have information about a field in a single record type + 439 # + 440 # each field of a type is represented using two var's: + 441 # 1. the input var: expected type of the field; convenient for creating using parse-var-with-type + 442 # 2. the output var: a constant containing the byte offset; convenient for code-generation + 443 # computing the output happens after parsing; in the meantime we preserve the + 444 # order of fields in the 'index' field. + 445 Typeinfo-entry-input-var: # (handle var) + 446 0/imm32 + 447 Typeinfo-entry-index: # int + 448 8/imm32 + 449 Typeinfo-entry-output-var: # (handle var) + 450 0xc/imm32 + 451 Typeinfo-entry-size: # (addr int) + 452 0x14/imm32 + 453 + 454 == code + 455 + 456 Entry: + 457 # . prologue + 458 89/<- %ebp 4/r32/esp + 459 (new-segment *Heap-size Heap) + 460 # if (argv[1] == "test') run-tests() + 461 { + 462 # if (argc <= 1) break + 463 81 7/subop/compare *ebp 1/imm32 + 464 7e/jump-if-<= break/disp8 + 465 # if (argv[1] != "test") break + 466 (kernel-string-equal? *(ebp+8) "test") # => eax + 467 3d/compare-eax-and 0/imm32/false + 468 74/jump-if-= break/disp8 + 469 # + 470 (run-tests) + 471 # syscall(exit, *Num-test-failures) + 472 8b/-> *Num-test-failures 3/r32/ebx + 473 eb/jump $mu-main:end/disp8 + 474 } + 475 # otherwise convert Stdin + 476 (convert-mu Stdin Stdout Stderr 0) + 477 (flush Stdout) + 478 # syscall(exit, 0) + 479 bb/copy-to-ebx 0/imm32 + 480 $mu-main:end: + 481 e8/call syscall_exit/disp32 + 482 + 483 convert-mu: # in: (addr buffered-file), out: (addr buffered-file), err: (addr buffered-file), ed: (addr exit-descriptor) + 484 # . prologue + 485 55/push-ebp + 486 89/<- %ebp 4/r32/esp + 487 # . save registers + 488 50/push-eax + 489 # initialize global data structures + 490 c7 0/subop/copy *Next-block-index 1/imm32 + 491 8b/-> *Primitive-type-ids 0/r32/eax + 492 89/<- *Type-id 0/r32/eax # stream-write + 493 c7 0/subop/copy *_Program-functions 0/imm32 + 494 c7 0/subop/copy *_Program-functions->payload 0/imm32 + 495 c7 0/subop/copy *_Program-types 0/imm32 + 496 c7 0/subop/copy *_Program-types->payload 0/imm32 + 497 # + 498 (parse-mu *(ebp+8) *(ebp+0x10) *(ebp+0x14)) + 499 (populate-mu-type-sizes *(ebp+0x10) *(ebp+0x14)) + 500 #? (dump-typeinfos "=== typeinfos\n") + 501 (check-mu-types *(ebp+0x10) *(ebp+0x14)) + 502 (emit-subx *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) + 503 $convert-mu:end: + 504 # . restore registers + 505 58/pop-to-eax + 506 # . epilogue + 507 89/<- %esp 5/r32/ebp + 508 5d/pop-to-ebp + 509 c3/return + 510 + 511 test-convert-empty-input: + 512 # empty input => empty output + 513 # . prologue + 514 55/push-ebp + 515 89/<- %ebp 4/r32/esp + 516 # setup + 517 (clear-stream _test-input-stream) + 518 (clear-stream $_test-input-buffered-file->buffer) + 519 (clear-stream _test-output-stream) + 520 (clear-stream $_test-output-buffered-file->buffer) + 521 # + 522 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 523 (flush _test-output-buffered-file) + 524 (check-stream-equal _test-output-stream "" "F - test-convert-empty-input") + 525 # . epilogue + 526 89/<- %esp 5/r32/ebp + 527 5d/pop-to-ebp + 528 c3/return + 529 + 530 test-convert-function-skeleton: + 531 # . prologue + 532 55/push-ebp + 533 89/<- %ebp 4/r32/esp + 534 # setup + 535 (clear-stream _test-input-stream) + 536 (clear-stream $_test-input-buffered-file->buffer) + 537 (clear-stream _test-output-stream) + 538 (clear-stream $_test-output-buffered-file->buffer) + 539 # + 540 (write _test-input-stream "fn foo {\n") + 541 (write _test-input-stream "}\n") + 542 # convert + 543 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 544 (flush _test-output-buffered-file) + 545 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 551 # check output + 552 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-skeleton/0") + 553 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-skeleton/1") + 554 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-skeleton/2") + 555 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-skeleton/3") + 556 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-skeleton/4") + 557 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-skeleton/5") + 558 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-skeleton/6") + 559 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-skeleton/7") + 560 # . epilogue + 561 89/<- %esp 5/r32/ebp + 562 5d/pop-to-ebp + 563 c3/return + 564 + 565 test-convert-multiple-function-skeletons: + 566 # . prologue + 567 55/push-ebp + 568 89/<- %ebp 4/r32/esp + 569 # setup + 570 (clear-stream _test-input-stream) + 571 (clear-stream $_test-input-buffered-file->buffer) + 572 (clear-stream _test-output-stream) + 573 (clear-stream $_test-output-buffered-file->buffer) + 574 # + 575 (write _test-input-stream "fn foo {\n") + 576 (write _test-input-stream "}\n") + 577 (write _test-input-stream "fn bar {\n") + 578 (write _test-input-stream "}\n") + 579 # convert + 580 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 581 (flush _test-output-buffered-file) + 582 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 588 # check first function + 589 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-multiple-function-skeletons/0") + 590 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-multiple-function-skeletons/1") + 591 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-multiple-function-skeletons/2") + 592 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-multiple-function-skeletons/3") + 593 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-multiple-function-skeletons/4") + 594 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-multiple-function-skeletons/5") + 595 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-multiple-function-skeletons/6") + 596 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-multiple-function-skeletons/7") + 597 # check second function + 598 (check-next-stream-line-equal _test-output-stream "bar:" "F - test-convert-multiple-function-skeletons/10") + 599 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-multiple-function-skeletons/11") + 600 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-multiple-function-skeletons/12") + 601 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-multiple-function-skeletons/13") + 602 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-multiple-function-skeletons/14") + 603 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-multiple-function-skeletons/15") + 604 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-multiple-function-skeletons/16") + 605 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-multiple-function-skeletons/17") + 606 # . epilogue + 607 89/<- %esp 5/r32/ebp + 608 5d/pop-to-ebp + 609 c3/return + 610 + 611 test-convert-function-with-arg: + 612 # . prologue + 613 55/push-ebp + 614 89/<- %ebp 4/r32/esp + 615 # setup + 616 (clear-stream _test-input-stream) + 617 (clear-stream $_test-input-buffered-file->buffer) + 618 (clear-stream _test-output-stream) + 619 (clear-stream $_test-output-buffered-file->buffer) + 620 # + 621 (write _test-input-stream "fn foo n: int {\n") + 622 (write _test-input-stream "}\n") + 623 # convert + 624 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 625 (flush _test-output-buffered-file) + 626 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 632 # check output + 633 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-arg/0") + 634 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-arg/1") + 635 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-arg/2") + 636 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-arg/3") + 637 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-arg/4") + 638 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-arg/5") + 639 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-arg/6") + 640 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-arg/7") + 641 # . epilogue + 642 89/<- %esp 5/r32/ebp + 643 5d/pop-to-ebp + 644 c3/return + 645 + 646 test-convert-function-with-arg-and-body: + 647 # . prologue + 648 55/push-ebp + 649 89/<- %ebp 4/r32/esp + 650 # setup + 651 (clear-stream _test-input-stream) + 652 (clear-stream $_test-input-buffered-file->buffer) + 653 (clear-stream _test-output-stream) + 654 (clear-stream $_test-output-buffered-file->buffer) + 655 # + 656 (write _test-input-stream "fn foo n: int {\n") + 657 (write _test-input-stream " increment n\n") + 658 (write _test-input-stream "}\n") + 659 # convert + 660 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 661 (flush _test-output-buffered-file) + 662 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 668 # check output + 669 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-arg-and-body/0") + 670 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-arg-and-body/1") + 671 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-arg-and-body/2") + 672 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-arg-and-body/3") + 673 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-arg-and-body/4") + 674 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-arg-and-body/5") + 675 (check-next-stream-line-equal _test-output-stream " ff 0/subop/increment *(ebp+0x00000008)" "F - test-convert-function-with-arg-and-body/6") + 676 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-arg-and-body/7") + 677 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-arg-and-body/8") + 678 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-arg-and-body/9") + 679 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-arg-and-body/10") + 680 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-arg-and-body/11") + 681 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-arg-and-body/12") + 682 # . epilogue + 683 89/<- %esp 5/r32/ebp + 684 5d/pop-to-ebp + 685 c3/return + 686 + 687 test-convert-function-distinguishes-args: + 688 # . prologue + 689 55/push-ebp + 690 89/<- %ebp 4/r32/esp + 691 # setup + 692 (clear-stream _test-input-stream) + 693 (clear-stream $_test-input-buffered-file->buffer) + 694 (clear-stream _test-output-stream) + 695 (clear-stream $_test-output-buffered-file->buffer) + 696 # + 697 (write _test-input-stream "fn foo a: int, b: int {\n") + 698 (write _test-input-stream " increment b\n") + 699 (write _test-input-stream "}\n") + 700 # convert + 701 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 702 (flush _test-output-buffered-file) + 703 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 709 # check output + 710 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-distinguishes-args/0") + 711 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-distinguishes-args/1") + 712 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-distinguishes-args/2") + 713 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-distinguishes-args/3") + 714 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-distinguishes-args/4") + 715 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-distinguishes-args/5") + 716 (check-next-stream-line-equal _test-output-stream " ff 0/subop/increment *(ebp+0x0000000c)" "F - test-convert-function-distinguishes-args/6") + 717 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-distinguishes-args/7") + 718 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-distinguishes-args/8") + 719 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-distinguishes-args/9") + 720 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-distinguishes-args/10") + 721 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-distinguishes-args/11") + 722 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-distinguishes-args/12") + 723 # . epilogue + 724 89/<- %esp 5/r32/ebp + 725 5d/pop-to-ebp + 726 c3/return + 727 + 728 test-convert-function-returns-result: + 729 # . prologue + 730 55/push-ebp + 731 89/<- %ebp 4/r32/esp + 732 # setup + 733 (clear-stream _test-input-stream) + 734 (clear-stream $_test-input-buffered-file->buffer) + 735 (clear-stream _test-output-stream) + 736 (clear-stream $_test-output-buffered-file->buffer) + 737 # + 738 (write _test-input-stream "fn foo a: int, b: int -> result/eax: int {\n") + 739 (write _test-input-stream " result <- copy a\n") + 740 (write _test-input-stream " result <- increment\n") + 741 (write _test-input-stream "}\n") + 742 # convert + 743 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 744 (flush _test-output-buffered-file) + 745 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 751 # check output + 752 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-returns-result/0") + 753 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-returns-result/1") + 754 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-returns-result/2") + 755 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-returns-result/3") + 756 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-returns-result/4") + 757 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-returns-result/5") + 758 (check-next-stream-line-equal _test-output-stream " 8b/-> *(ebp+0x00000008) 0x00000000/r32" "F - test-convert-function-returns-result/6") + 759 (check-next-stream-line-equal _test-output-stream " 40/increment-eax" "F - test-convert-function-returns-result/7") + 760 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-returns-result/8") + 761 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-returns-result/9") + 762 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-returns-result/10") + 763 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-returns-result/11") + 764 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-returns-result/12") + 765 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-returns-result/13") + 766 # . epilogue + 767 89/<- %esp 5/r32/ebp + 768 5d/pop-to-ebp + 769 c3/return + 770 + 771 test-convert-function-with-literal-arg: + 772 # . prologue + 773 55/push-ebp + 774 89/<- %ebp 4/r32/esp + 775 # setup + 776 (clear-stream _test-input-stream) + 777 (clear-stream $_test-input-buffered-file->buffer) + 778 (clear-stream _test-output-stream) + 779 (clear-stream $_test-output-buffered-file->buffer) + 780 # + 781 (write _test-input-stream "fn foo a: int, b: int -> result/eax: int {\n") + 782 (write _test-input-stream " result <- copy a\n") + 783 (write _test-input-stream " result <- add 1\n") + 784 (write _test-input-stream "}\n") + 785 # convert + 786 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 787 (flush _test-output-buffered-file) + 788 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 794 # check output + 795 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-literal-arg/0") + 796 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-literal-arg/1") + 797 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-literal-arg/2") + 798 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-literal-arg/3") + 799 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-literal-arg/4") + 800 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-literal-arg/5") + 801 (check-next-stream-line-equal _test-output-stream " 8b/-> *(ebp+0x00000008) 0x00000000/r32" "F - test-convert-function-with-literal-arg/6") + 802 (check-next-stream-line-equal _test-output-stream " 05/add-to-eax 1/imm32" "F - test-convert-function-with-literal-arg/7") + 803 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-literal-arg/8") + 804 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-literal-arg/9") + 805 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-literal-arg/10") + 806 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-literal-arg/11") + 807 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-literal-arg/12") + 808 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-literal-arg/13") + 809 # . epilogue + 810 89/<- %esp 5/r32/ebp + 811 5d/pop-to-ebp + 812 c3/return + 813 + 814 test-convert-function-with-literal-arg-2: + 815 # . prologue + 816 55/push-ebp + 817 89/<- %ebp 4/r32/esp + 818 # setup + 819 (clear-stream _test-input-stream) + 820 (clear-stream $_test-input-buffered-file->buffer) + 821 (clear-stream _test-output-stream) + 822 (clear-stream $_test-output-buffered-file->buffer) + 823 # + 824 (write _test-input-stream "fn foo a: int, b: int -> result/ebx: int {\n") + 825 (write _test-input-stream " result <- copy a\n") + 826 (write _test-input-stream " result <- add 1\n") + 827 (write _test-input-stream "}\n") + 828 # convert + 829 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 830 (flush _test-output-buffered-file) + 831 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 837 # check output + 838 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-literal-arg-2/0") + 839 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-literal-arg-2/1") + 840 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-literal-arg-2/2") + 841 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-literal-arg-2/3") + 842 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-literal-arg-2/4") + 843 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-literal-arg-2/5") + 844 (check-next-stream-line-equal _test-output-stream " 8b/-> *(ebp+0x00000008) 0x00000003/r32" "F - test-convert-function-with-literal-arg-2/6") + 845 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %ebx 1/imm32" "F - test-convert-function-with-literal-arg-2/7") + 846 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-literal-arg-2/8") + 847 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-literal-arg-2/9") + 848 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-literal-arg-2/10") + 849 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-literal-arg-2/11") + 850 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-literal-arg-2/12") + 851 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-literal-arg-2/13") + 852 # . epilogue + 853 89/<- %esp 5/r32/ebp + 854 5d/pop-to-ebp + 855 c3/return + 856 + 857 test-convert-function-call-with-literal-arg: + 858 # . prologue + 859 55/push-ebp + 860 89/<- %ebp 4/r32/esp + 861 # setup + 862 (clear-stream _test-input-stream) + 863 (clear-stream $_test-input-buffered-file->buffer) + 864 (clear-stream _test-output-stream) + 865 (clear-stream $_test-output-buffered-file->buffer) + 866 # + 867 (write _test-input-stream "fn main -> result/ebx: int {\n") + 868 (write _test-input-stream " result <- do-add 3 4\n") + 869 (write _test-input-stream "}\n") + 870 (write _test-input-stream "fn do-add a: int, b: int -> result/ebx: int {\n") + 871 (write _test-input-stream " result <- copy a\n") + 872 (write _test-input-stream " result <- add b\n") + 873 (write _test-input-stream "}\n") + 874 # convert + 875 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 876 (flush _test-output-buffered-file) + 877 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 883 # check output + 884 (check-next-stream-line-equal _test-output-stream "main:" "F - test-convert-function-call-with-literal-arg/0") + 885 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-call-with-literal-arg/1") + 886 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-call-with-literal-arg/2") + 887 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-call-with-literal-arg/3") + 888 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-call-with-literal-arg/4") + 889 (check-next-stream-line-equal _test-output-stream "$main:0x00000001:loop:" "F - test-convert-function-call-with-literal-arg/5") + 890 (check-next-stream-line-equal _test-output-stream " (do-add 3 4)" "F - test-convert-function-call-with-literal-arg/6") + 891 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-call-with-literal-arg/7") + 892 (check-next-stream-line-equal _test-output-stream "$main:0x00000001:break:" "F - test-convert-function-call-with-literal-arg/8") + 893 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-call-with-literal-arg/9") + 894 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-call-with-literal-arg/10") + 895 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-call-with-literal-arg/11") + 896 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-call-with-literal-arg/12") + 897 (check-next-stream-line-equal _test-output-stream "do-add:" "F - test-convert-function-call-with-literal-arg/13") + 898 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-call-with-literal-arg/14") + 899 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-call-with-literal-arg/15") + 900 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-call-with-literal-arg/16") + 901 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-call-with-literal-arg/17") + 902 (check-next-stream-line-equal _test-output-stream "$do-add:0x00000002:loop:" "F - test-convert-function-call-with-literal-arg/18") + 903 (check-next-stream-line-equal _test-output-stream " 8b/-> *(ebp+0x00000008) 0x00000003/r32" "F - test-convert-function-call-with-literal-arg/19") + 904 (check-next-stream-line-equal _test-output-stream " 03/add *(ebp+0x0000000c) 0x00000003/r32" "F - test-convert-function-call-with-literal-arg/20") + 905 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-call-with-literal-arg/21") + 906 (check-next-stream-line-equal _test-output-stream "$do-add:0x00000002:break:" "F - test-convert-function-call-with-literal-arg/22") + 907 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-call-with-literal-arg/23") + 908 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-call-with-literal-arg/24") + 909 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-call-with-literal-arg/25") + 910 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-call-with-literal-arg/26") + 911 # . epilogue + 912 89/<- %esp 5/r32/ebp + 913 5d/pop-to-ebp + 914 c3/return + 915 + 916 test-convert-function-call-with-signature: + 917 # . prologue + 918 55/push-ebp + 919 89/<- %ebp 4/r32/esp + 920 # setup + 921 (clear-stream _test-input-stream) + 922 (clear-stream $_test-input-buffered-file->buffer) + 923 (clear-stream _test-output-stream) + 924 (clear-stream $_test-output-buffered-file->buffer) + 925 # + 926 (write _test-input-stream "fn main -> result/ebx: int {\n") + 927 (write _test-input-stream " result <- do-add 3 4\n") + 928 (write _test-input-stream "}\n") + 929 (write _test-input-stream "sig do-add a: int, b: int -> result/ebx: int\n") + 930 # convert + 931 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 932 (flush _test-output-buffered-file) + 933 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 939 # check output + 940 (check-next-stream-line-equal _test-output-stream "main:" "F - test-convert-function-call-with-signature/0") + 941 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-call-with-signature/1") + 942 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-call-with-signature/2") + 943 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-call-with-signature/3") + 944 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-call-with-signature/4") + 945 (check-next-stream-line-equal _test-output-stream "$main:0x00000001:loop:" "F - test-convert-function-call-with-signature/5") + 946 (check-next-stream-line-equal _test-output-stream " (do-add 3 4)" "F - test-convert-function-call-with-signature/6") + 947 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-call-with-signature/7") + 948 (check-next-stream-line-equal _test-output-stream "$main:0x00000001:break:" "F - test-convert-function-call-with-signature/8") + 949 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-call-with-signature/9") + 950 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-call-with-signature/10") + 951 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-call-with-signature/11") + 952 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-call-with-signature/12") + 953 # . epilogue + 954 89/<- %esp 5/r32/ebp + 955 5d/pop-to-ebp + 956 c3/return + 957 + 958 test-convert-function-with-local-var-in-mem: + 959 # . prologue + 960 55/push-ebp + 961 89/<- %ebp 4/r32/esp + 962 # setup + 963 (clear-stream _test-input-stream) + 964 (clear-stream $_test-input-buffered-file->buffer) + 965 (clear-stream _test-output-stream) + 966 (clear-stream $_test-output-buffered-file->buffer) + 967 # + 968 (write _test-input-stream "fn foo {\n") + 969 (write _test-input-stream " var x: int\n") + 970 (write _test-input-stream " increment x\n") + 971 (write _test-input-stream "}\n") + 972 # convert + 973 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 974 (flush _test-output-buffered-file) + 975 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 981 # check output + 982 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-local-var-in-mem/0") + 983 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-local-var-in-mem/1") + 984 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-local-var-in-mem/2") + 985 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-local-var-in-mem/3") + 986 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-local-var-in-mem/4") + 987 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-local-var-in-mem/5") + 988 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-local-var-in-mem/6") + 989 (check-next-stream-line-equal _test-output-stream " ff 0/subop/increment *(ebp+0xfffffffc)" "F - test-convert-function-with-local-var-in-mem/7") + 990 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-local-var-in-mem/8") + 991 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-local-var-in-mem/9") + 992 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-local-var-in-mem/10") + 993 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-local-var-in-mem/11") + 994 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-local-var-in-mem/12") + 995 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-local-var-in-mem/13") + 996 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-local-var-in-mem/14") + 997 # . epilogue + 998 89/<- %esp 5/r32/ebp + 999 5d/pop-to-ebp + 1000 c3/return + 1001 + 1002 test-local-var-in-mem-has-no-initializer: + 1003 # . prologue + 1004 55/push-ebp + 1005 89/<- %ebp 4/r32/esp + 1006 # setup + 1007 (clear-stream _test-input-stream) + 1008 (clear-stream $_test-input-buffered-file->buffer) + 1009 (clear-stream _test-output-stream) + 1010 (clear-stream $_test-output-buffered-file->buffer) + 1011 (clear-stream _test-error-stream) + 1012 (clear-stream $_test-error-buffered-file->buffer) + 1013 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) + 1014 68/push 0/imm32 + 1015 68/push 0/imm32 + 1016 89/<- %edx 4/r32/esp + 1017 (tailor-exit-descriptor %edx 0x10) + 1018 # + 1019 (write _test-input-stream "fn foo {\n") + 1020 (write _test-input-stream " var x: int <- copy 0\n") + 1021 (write _test-input-stream " increment x\n") + 1022 (write _test-input-stream "}\n") + 1023 # convert + 1024 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) + 1025 # registers except esp clobbered at this point + 1026 # restore ed + 1027 89/<- %edx 4/r32/esp + 1028 (flush _test-output-buffered-file) + 1029 (flush _test-error-buffered-file) + 1030 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ + 1036 # check output + 1037 (check-stream-equal _test-output-stream "" "F - test-var-in-mem-has-no-initializer: output should be empty") + 1038 (check-next-stream-line-equal _test-error-stream "fn foo: var x: variables on the stack can't take an initializer" "F - test-var-in-mem-has-no-initializer: error message") + 1039 # check that stop(1) was called + 1040 (check-ints-equal *(edx+4) 2 "F - test-var-in-mem-has-no-initializer: exit status") + 1041 # don't restore from ebp + 1042 81 0/subop/add %esp 8/imm32 + 1043 # . epilogue + 1044 5d/pop-to-ebp + 1045 c3/return + 1046 + 1047 test-convert-function-with-local-var-with-compound-type-in-mem: + 1048 # . prologue + 1049 55/push-ebp + 1050 89/<- %ebp 4/r32/esp + 1051 # setup + 1052 (clear-stream _test-input-stream) + 1053 (clear-stream $_test-input-buffered-file->buffer) + 1054 (clear-stream _test-output-stream) + 1055 (clear-stream $_test-output-buffered-file->buffer) + 1056 # + 1057 (write _test-input-stream "fn foo {\n") + 1058 (write _test-input-stream " var x: (addr int)\n") + 1059 (write _test-input-stream " copy-to x, 0\n") + 1060 (write _test-input-stream "}\n") + 1061 # convert + 1062 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 1063 (flush _test-output-buffered-file) + 1064 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 1070 # check output + 1071 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-local-var-with-compound-type-in-mem/0") + 1072 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-local-var-with-compound-type-in-mem/1") + 1073 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-local-var-with-compound-type-in-mem/2") + 1074 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-local-var-with-compound-type-in-mem/3") + 1075 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-local-var-with-compound-type-in-mem/4") + 1076 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-local-var-with-compound-type-in-mem/5") + 1077 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-local-var-with-compound-type-in-mem/6") + 1078 (check-next-stream-line-equal _test-output-stream " c7 0/subop/copy *(ebp+0xfffffffc) 0/imm32" "F - test-convert-function-with-local-var-with-compound-type-in-mem/7") + 1079 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-local-var-with-compound-type-in-mem/8") + 1080 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-local-var-with-compound-type-in-mem/9") + 1081 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-local-var-with-compound-type-in-mem/10") + 1082 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-local-var-with-compound-type-in-mem/11") + 1083 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-local-var-with-compound-type-in-mem/12") + 1084 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-local-var-with-compound-type-in-mem/13") + 1085 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-local-var-with-compound-type-in-mem/14") + 1086 # . epilogue + 1087 89/<- %esp 5/r32/ebp + 1088 5d/pop-to-ebp + 1089 c3/return + 1090 + 1091 test-convert-function-with-local-var-in-reg: + 1092 # . prologue + 1093 55/push-ebp + 1094 89/<- %ebp 4/r32/esp + 1095 # setup + 1096 (clear-stream _test-input-stream) + 1097 (clear-stream $_test-input-buffered-file->buffer) + 1098 (clear-stream _test-output-stream) + 1099 (clear-stream $_test-output-buffered-file->buffer) + 1100 # + 1101 (write _test-input-stream "fn foo {\n") + 1102 (write _test-input-stream " var x/ecx: int <- copy 3\n") + 1103 (write _test-input-stream " x <- increment\n") + 1104 (write _test-input-stream "}\n") + 1105 # convert + 1106 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 1107 (flush _test-output-buffered-file) + 1108 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 1114 # check output + 1115 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-local-var-in-reg/0") + 1116 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-local-var-in-reg/1") + 1117 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-local-var-in-reg/2") + 1118 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-local-var-in-reg/3") + 1119 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-local-var-in-reg/4") + 1120 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-local-var-in-reg/5") + 1121 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-convert-function-with-local-var-in-reg/6") + 1122 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 3/imm32" "F - test-convert-function-with-local-var-in-reg/7") + 1123 (check-next-stream-line-equal _test-output-stream " 41/increment-ecx" "F - test-convert-function-with-local-var-in-reg/8") + 1124 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-convert-function-with-local-var-in-reg/9") + 1125 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-local-var-in-reg/10") + 1126 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-local-var-in-reg/11") + 1127 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-local-var-in-reg/12") + 1128 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-local-var-in-reg/13") + 1129 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-local-var-in-reg/14") + 1130 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-local-var-in-reg/15") + 1131 # . epilogue + 1132 89/<- %esp 5/r32/ebp + 1133 5d/pop-to-ebp + 1134 c3/return + 1135 + 1136 test-convert-function-with-second-local-var-in-same-reg: + 1137 # . prologue + 1138 55/push-ebp + 1139 89/<- %ebp 4/r32/esp + 1140 # setup + 1141 (clear-stream _test-input-stream) + 1142 (clear-stream $_test-input-buffered-file->buffer) + 1143 (clear-stream _test-output-stream) + 1144 (clear-stream $_test-output-buffered-file->buffer) + 1145 # + 1146 (write _test-input-stream "fn foo {\n") + 1147 (write _test-input-stream " var x/ecx: int <- copy 3\n") + 1148 (write _test-input-stream " var y/ecx: int <- copy 4\n") + 1149 (write _test-input-stream " y <- increment\n") + 1150 (write _test-input-stream "}\n") + 1151 # convert + 1152 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 1153 (flush _test-output-buffered-file) + 1154 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 1160 # check output + 1161 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-second-local-var-in-same-reg/0") + 1162 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-second-local-var-in-same-reg/1") + 1163 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-second-local-var-in-same-reg/2") + 1164 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-second-local-var-in-same-reg/3") + 1165 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-second-local-var-in-same-reg/4") + 1166 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-second-local-var-in-same-reg/5") + 1167 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-convert-function-with-second-local-var-in-same-reg/6") + 1168 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 3/imm32" "F - test-convert-function-with-second-local-var-in-same-reg/7") + 1169 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 4/imm32" "F - test-convert-function-with-second-local-var-in-same-reg/8") + 1170 (check-next-stream-line-equal _test-output-stream " 41/increment-ecx" "F - test-convert-function-with-second-local-var-in-same-reg/9") + 1171 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-convert-function-with-second-local-var-in-same-reg/10") + 1172 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-second-local-var-in-same-reg/11") + 1173 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-second-local-var-in-same-reg/12") + 1174 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-second-local-var-in-same-reg/13") + 1175 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-second-local-var-in-same-reg/14") + 1176 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-second-local-var-in-same-reg/15") + 1177 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-second-local-var-in-same-reg/16") + 1178 # . epilogue + 1179 89/<- %esp 5/r32/ebp + 1180 5d/pop-to-ebp + 1181 c3/return + 1182 + 1183 test-read-clobbered-reg-var: + 1184 # . prologue + 1185 55/push-ebp + 1186 89/<- %ebp 4/r32/esp + 1187 # setup + 1188 (clear-stream _test-input-stream) + 1189 (clear-stream $_test-input-buffered-file->buffer) + 1190 (clear-stream _test-output-stream) + 1191 (clear-stream $_test-output-buffered-file->buffer) + 1192 (clear-stream _test-error-stream) + 1193 (clear-stream $_test-error-buffered-file->buffer) + 1194 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) # bytes of args in call to convert-mu + 1195 68/push 0/imm32 + 1196 68/push 0/imm32 + 1197 89/<- %edx 4/r32/esp + 1198 (tailor-exit-descriptor %edx 0x10) + 1199 # + 1200 (write _test-input-stream "fn foo {\n") + 1201 (write _test-input-stream " var x/ecx: int <- copy 3\n") + 1202 (write _test-input-stream " var y/ecx: int <- copy 4\n") + 1203 (write _test-input-stream " x <- increment\n") + 1204 (write _test-input-stream "}\n") + 1205 # convert + 1206 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) + 1207 # registers except esp clobbered at this point + 1208 # restore ed + 1209 89/<- %edx 4/r32/esp + 1210 (flush _test-output-buffered-file) + 1211 (flush _test-error-buffered-file) + 1212 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ + 1218 # check output + 1219 (check-stream-equal _test-output-stream "" "F - test-read-clobbered-reg-var: output should be empty") + 1220 (check-next-stream-line-equal _test-error-stream "fn foo: register ecx reads var 'x' after writing var 'y'" "F - test-read-clobbered-reg-var: error message") + 1221 # check that stop(1) was called + 1222 (check-ints-equal *(edx+4) 2 "F - test-read-clobbered-reg-var: exit status") + 1223 # don't restore from ebp + 1224 81 0/subop/add %esp 8/imm32 + 1225 # . epilogue + 1226 5d/pop-to-ebp + 1227 c3/return + 1228 + 1229 test-convert-function-call: + 1230 # . prologue + 1231 55/push-ebp + 1232 89/<- %ebp 4/r32/esp + 1233 # setup + 1234 (clear-stream _test-input-stream) + 1235 (clear-stream $_test-input-buffered-file->buffer) + 1236 (clear-stream _test-output-stream) + 1237 (clear-stream $_test-output-buffered-file->buffer) + 1238 # + 1239 (write _test-input-stream "fn main -> result/ebx: int {\n") + 1240 (write _test-input-stream " result <- foo\n") + 1241 (write _test-input-stream "}\n") + 1242 (write _test-input-stream "fn foo -> result/ebx: int {\n") + 1243 (write _test-input-stream " result <- copy 3\n") + 1244 (write _test-input-stream "}\n") + 1245 # convert + 1246 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 1247 (flush _test-output-buffered-file) + 1248 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 1254 # check output + 1255 (check-next-stream-line-equal _test-output-stream "main:" "F - test-convert-function-call/0") + 1256 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-call/1") + 1257 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-call/2") + 1258 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-call/3") + 1259 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-call/4") + 1260 (check-next-stream-line-equal _test-output-stream "$main:0x00000001:loop:" "F - test-convert-function-call/5") + 1261 (check-next-stream-line-equal _test-output-stream " (foo)" "F - test-convert-function-call/6") + 1262 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-call/7") + 1263 (check-next-stream-line-equal _test-output-stream "$main:0x00000001:break:" "F - test-convert-function-call/8") + 1264 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-call/9") + 1265 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-call/10") + 1266 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-call/11") + 1267 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-call/12") + 1268 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-call/13") + 1269 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-call/14") + 1270 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-call/15") + 1271 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-call/16") + 1272 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-call/17") + 1273 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:loop:" "F - test-convert-function-call/18") + 1274 (check-next-stream-line-equal _test-output-stream " bb/copy-to-ebx 3/imm32" "F - test-convert-function-call/19") + 1275 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-call/20") + 1276 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:break:" "F - test-convert-function-call/21") + 1277 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-call/22") + 1278 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-call/23") + 1279 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-call/24") + 1280 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-call/25") + 1281 # . epilogue + 1282 89/<- %esp 5/r32/ebp + 1283 5d/pop-to-ebp + 1284 c3/return + 1285 + 1286 test-convert-function-call-with-incorrect-inout-type: + 1287 # . prologue + 1288 55/push-ebp + 1289 89/<- %ebp 4/r32/esp + 1290 # setup + 1291 (clear-stream _test-input-stream) + 1292 (clear-stream $_test-input-buffered-file->buffer) + 1293 (clear-stream _test-output-stream) + 1294 (clear-stream $_test-output-buffered-file->buffer) + 1295 (clear-stream _test-error-stream) + 1296 (clear-stream $_test-error-buffered-file->buffer) + 1297 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) + 1298 68/push 0/imm32 + 1299 68/push 0/imm32 + 1300 89/<- %edx 4/r32/esp + 1301 (tailor-exit-descriptor %edx 0x10) + 1302 # + 1303 (write _test-input-stream "fn f {\n") + 1304 (write _test-input-stream " var x: int\n") + 1305 (write _test-input-stream " g x\n") + 1306 (write _test-input-stream "}\n") + 1307 (write _test-input-stream "fn g a: foo {\n") + 1308 (write _test-input-stream "}\n") + 1309 # convert + 1310 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) + 1311 # registers except esp clobbered at this point + 1312 # restore ed + 1313 89/<- %edx 4/r32/esp + 1314 (flush _test-output-buffered-file) + 1315 (flush _test-error-buffered-file) + 1316 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ + 1322 # check output + 1323 (check-stream-equal _test-output-stream "" "F - test-convert-function-call-with-incorrect-inout-type: output should be empty") + 1324 (check-next-stream-line-equal _test-error-stream "fn f: call g: type for inout 'x' is not right" "F - test-convert-function-call-with-incorrect-inout-type: error message") + 1325 # check that stop(1) was called + 1326 (check-ints-equal *(edx+4) 2 "F - test-convert-function-call-with-incorrect-inout-type: exit status") + 1327 # don't restore from ebp + 1328 81 0/subop/add %esp 8/imm32 + 1329 5d/pop-to-ebp + 1330 c3/return + 1331 + 1332 test-convert-function-call-with-too-few-inouts: + 1333 # . prologue + 1334 55/push-ebp + 1335 89/<- %ebp 4/r32/esp + 1336 # setup + 1337 (clear-stream _test-input-stream) + 1338 (clear-stream $_test-input-buffered-file->buffer) + 1339 (clear-stream _test-output-stream) + 1340 (clear-stream $_test-output-buffered-file->buffer) + 1341 (clear-stream _test-error-stream) + 1342 (clear-stream $_test-error-buffered-file->buffer) + 1343 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) + 1344 68/push 0/imm32 + 1345 68/push 0/imm32 + 1346 89/<- %edx 4/r32/esp + 1347 (tailor-exit-descriptor %edx 0x10) + 1348 # + 1349 (write _test-input-stream "fn f {\n") + 1350 (write _test-input-stream " g\n") + 1351 (write _test-input-stream "}\n") + 1352 (write _test-input-stream "fn g a: int {\n") + 1353 (write _test-input-stream "}\n") + 1354 # convert + 1355 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) + 1356 # registers except esp clobbered at this point + 1357 # restore ed + 1358 89/<- %edx 4/r32/esp + 1359 (flush _test-output-buffered-file) + 1360 (flush _test-error-buffered-file) + 1361 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ + 1367 # check output + 1368 (check-stream-equal _test-output-stream "" "F - test-convert-function-call-with-too-few-inouts: output should be empty") + 1369 (check-next-stream-line-equal _test-error-stream "fn f: call g: too few inouts" "F - test-convert-function-call-with-too-few-inouts: error message") + 1370 # check that stop(1) was called + 1371 (check-ints-equal *(edx+4) 2 "F - test-convert-function-call-with-too-few-inouts: exit status") + 1372 # don't restore from ebp + 1373 81 0/subop/add %esp 8/imm32 + 1374 5d/pop-to-ebp + 1375 c3/return + 1376 + 1377 test-convert-function-call-with-too-many-inouts: + 1378 # . prologue + 1379 55/push-ebp + 1380 89/<- %ebp 4/r32/esp + 1381 # setup + 1382 (clear-stream _test-input-stream) + 1383 (clear-stream $_test-input-buffered-file->buffer) + 1384 (clear-stream _test-output-stream) + 1385 (clear-stream $_test-output-buffered-file->buffer) + 1386 (clear-stream _test-error-stream) + 1387 (clear-stream $_test-error-buffered-file->buffer) + 1388 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) + 1389 68/push 0/imm32 + 1390 68/push 0/imm32 + 1391 89/<- %edx 4/r32/esp + 1392 (tailor-exit-descriptor %edx 0x10) + 1393 # + 1394 (write _test-input-stream "fn f {\n") + 1395 (write _test-input-stream " var x: int\n") + 1396 (write _test-input-stream " g x\n") + 1397 (write _test-input-stream "}\n") + 1398 (write _test-input-stream "fn g {\n") + 1399 (write _test-input-stream "}\n") + 1400 # convert + 1401 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) + 1402 # registers except esp clobbered at this point + 1403 # restore ed + 1404 89/<- %edx 4/r32/esp + 1405 (flush _test-output-buffered-file) + 1406 (flush _test-error-buffered-file) + 1407 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ + 1413 # check output + 1414 (check-stream-equal _test-output-stream "" "F - test-convert-function-call-with-too-many-inouts: output should be empty") + 1415 (check-next-stream-line-equal _test-error-stream "fn f: call g: too many inouts" "F - test-convert-function-call-with-too-many-inouts: error message") + 1416 # check that stop(1) was called + 1417 (check-ints-equal *(edx+4) 2 "F - test-convert-function-call-with-too-many-inouts: exit status") + 1418 # don't restore from ebp + 1419 81 0/subop/add %esp 8/imm32 + 1420 5d/pop-to-ebp + 1421 c3/return + 1422 + 1423 test-convert-function-call-with-incorrect-output-type: + 1424 # . prologue + 1425 55/push-ebp + 1426 89/<- %ebp 4/r32/esp + 1427 # setup + 1428 (clear-stream _test-input-stream) + 1429 (clear-stream $_test-input-buffered-file->buffer) + 1430 (clear-stream _test-output-stream) + 1431 (clear-stream $_test-output-buffered-file->buffer) + 1432 (clear-stream _test-error-stream) + 1433 (clear-stream $_test-error-buffered-file->buffer) + 1434 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) + 1435 68/push 0/imm32 + 1436 68/push 0/imm32 + 1437 89/<- %edx 4/r32/esp + 1438 (tailor-exit-descriptor %edx 0x10) + 1439 # + 1440 (write _test-input-stream "fn f {\n") + 1441 (write _test-input-stream " var x/eax: int <- g\n") + 1442 (write _test-input-stream "}\n") + 1443 (write _test-input-stream "fn g -> a/eax: foo {\n") + 1444 (write _test-input-stream "}\n") + 1445 # convert + 1446 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) + 1447 # registers except esp clobbered at this point + 1448 # restore ed + 1449 89/<- %edx 4/r32/esp + 1450 (flush _test-output-buffered-file) + 1451 (flush _test-error-buffered-file) + 1452 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ + 1458 # check output + 1459 (check-stream-equal _test-output-stream "" "F - test-convert-function-call-with-incorrect-output-type: output should be empty") + 1460 (check-next-stream-line-equal _test-error-stream "fn f: call g: type for output 'x' is not right" "F - test-convert-function-call-with-incorrect-output-type: error message") + 1461 # check that stop(1) was called + 1462 (check-ints-equal *(edx+4) 2 "F - test-convert-function-call-with-incorrect-output-type: exit status") + 1463 # don't restore from ebp + 1464 81 0/subop/add %esp 8/imm32 + 1465 5d/pop-to-ebp + 1466 c3/return + 1467 + 1468 test-convert-function-call-with-too-few-outputs: + 1469 # . prologue + 1470 55/push-ebp + 1471 89/<- %ebp 4/r32/esp + 1472 # setup + 1473 (clear-stream _test-input-stream) + 1474 (clear-stream $_test-input-buffered-file->buffer) + 1475 (clear-stream _test-output-stream) + 1476 (clear-stream $_test-output-buffered-file->buffer) + 1477 (clear-stream _test-error-stream) + 1478 (clear-stream $_test-error-buffered-file->buffer) + 1479 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) + 1480 68/push 0/imm32 + 1481 68/push 0/imm32 + 1482 89/<- %edx 4/r32/esp + 1483 (tailor-exit-descriptor %edx 0x10) + 1484 # + 1485 (write _test-input-stream "fn f {\n") + 1486 (write _test-input-stream " g\n") + 1487 (write _test-input-stream "}\n") + 1488 (write _test-input-stream "fn g -> a/eax: int {\n") + 1489 (write _test-input-stream "}\n") + 1490 # convert + 1491 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) + 1492 # registers except esp clobbered at this point + 1493 # restore ed + 1494 89/<- %edx 4/r32/esp + 1495 (flush _test-output-buffered-file) + 1496 (flush _test-error-buffered-file) + 1497 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ + 1503 # check output + 1504 (check-stream-equal _test-output-stream "" "F - test-convert-function-call-with-too-few-outputs: output should be empty") + 1505 (check-next-stream-line-equal _test-error-stream "fn f: call g: too few outputs" "F - test-convert-function-call-with-too-few-outputs: error message") + 1506 # check that stop(1) was called + 1507 (check-ints-equal *(edx+4) 2 "F - test-convert-function-call-with-too-few-outputs: exit status") + 1508 # don't restore from ebp + 1509 81 0/subop/add %esp 8/imm32 + 1510 5d/pop-to-ebp + 1511 c3/return + 1512 + 1513 test-convert-function-call-with-too-many-outputs: + 1514 # . prologue + 1515 55/push-ebp + 1516 89/<- %ebp 4/r32/esp + 1517 # setup + 1518 (clear-stream _test-input-stream) + 1519 (clear-stream $_test-input-buffered-file->buffer) + 1520 (clear-stream _test-output-stream) + 1521 (clear-stream $_test-output-buffered-file->buffer) + 1522 (clear-stream _test-error-stream) + 1523 (clear-stream $_test-error-buffered-file->buffer) + 1524 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) + 1525 68/push 0/imm32 + 1526 68/push 0/imm32 + 1527 89/<- %edx 4/r32/esp + 1528 (tailor-exit-descriptor %edx 0x10) + 1529 # + 1530 (write _test-input-stream "fn f {\n") + 1531 (write _test-input-stream " var x/eax: int <- g\n") + 1532 (write _test-input-stream "}\n") + 1533 (write _test-input-stream "fn g {\n") + 1534 (write _test-input-stream "}\n") + 1535 # convert + 1536 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) + 1537 # registers except esp clobbered at this point + 1538 # restore ed + 1539 89/<- %edx 4/r32/esp + 1540 (flush _test-output-buffered-file) + 1541 (flush _test-error-buffered-file) + 1542 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ + 1548 # check output + 1549 (check-stream-equal _test-output-stream "" "F - test-convert-function-call-with-too-many-outputs: output should be empty") + 1550 (check-next-stream-line-equal _test-error-stream "fn f: call g: too many outputs" "F - test-convert-function-call-with-too-many-outputs: error message") + 1551 # check that stop(1) was called + 1552 (check-ints-equal *(edx+4) 2 "F - test-convert-function-call-with-too-many-outputs: exit status") + 1553 # don't restore from ebp + 1554 81 0/subop/add %esp 8/imm32 + 1555 5d/pop-to-ebp + 1556 c3/return + 1557 + 1558 test-convert-function-call-with-incorrect-output-register: + 1559 # . prologue + 1560 55/push-ebp + 1561 89/<- %ebp 4/r32/esp + 1562 # setup + 1563 (clear-stream _test-input-stream) + 1564 (clear-stream $_test-input-buffered-file->buffer) + 1565 (clear-stream _test-output-stream) + 1566 (clear-stream $_test-output-buffered-file->buffer) + 1567 (clear-stream _test-error-stream) + 1568 (clear-stream $_test-error-buffered-file->buffer) + 1569 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) + 1570 68/push 0/imm32 + 1571 68/push 0/imm32 + 1572 89/<- %edx 4/r32/esp + 1573 (tailor-exit-descriptor %edx 0x10) + 1574 # + 1575 (write _test-input-stream "fn f {\n") + 1576 (write _test-input-stream " var x/ecx: int <- g\n") + 1577 (write _test-input-stream "}\n") + 1578 (write _test-input-stream "fn g -> a/eax: int {\n") + 1579 (write _test-input-stream "}\n") + 1580 # convert + 1581 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) + 1582 # registers except esp clobbered at this point + 1583 # restore ed + 1584 89/<- %edx 4/r32/esp + 1585 (flush _test-output-buffered-file) + 1586 (flush _test-error-buffered-file) + 1587 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ + 1593 # check output + 1594 (check-stream-equal _test-output-stream "" "F - test-convert-function-call-with-incorrect-output-register: output should be empty") + 1595 (check-next-stream-line-equal _test-error-stream "fn f: call g: register for output 'x' is not right" "F - test-convert-function-call-with-incorrect-output-register: error message") + 1596 # check that stop(1) was called + 1597 (check-ints-equal *(edx+4) 2 "F - test-convert-function-call-with-incorrect-output-register: exit status") + 1598 # don't restore from ebp + 1599 81 0/subop/add %esp 8/imm32 + 1600 5d/pop-to-ebp + 1601 c3/return + 1602 + 1603 test-convert-function-with-local-var-dereferenced: + 1604 # . prologue + 1605 55/push-ebp + 1606 89/<- %ebp 4/r32/esp + 1607 # setup + 1608 (clear-stream _test-input-stream) + 1609 (clear-stream $_test-input-buffered-file->buffer) + 1610 (clear-stream _test-output-stream) + 1611 (clear-stream $_test-output-buffered-file->buffer) + 1612 # + 1613 (write _test-input-stream "fn foo {\n") + 1614 (write _test-input-stream " var x/ecx: (addr int) <- copy 0\n") + 1615 (write _test-input-stream " increment *x\n") + 1616 (write _test-input-stream "}\n") + 1617 # convert + 1618 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 1619 (flush _test-output-buffered-file) + 1620 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 1626 # check output + 1627 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-local-var-dereferenced/0") + 1628 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-local-var-dereferenced/1") + 1629 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-local-var-dereferenced/2") + 1630 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-local-var-dereferenced/3") + 1631 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-local-var-dereferenced/4") + 1632 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-local-var-dereferenced/5") + 1633 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-convert-function-with-local-var-dereferenced/6") + 1634 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 0/imm32" "F - test-convert-function-with-local-var-dereferenced/7") + 1635 (check-next-stream-line-equal _test-output-stream " ff 0/subop/increment *ecx" "F - test-convert-function-with-local-var-dereferenced/8") + 1636 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-convert-function-with-local-var-dereferenced/9") + 1637 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-local-var-dereferenced/10") + 1638 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-local-var-dereferenced/11") + 1639 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-local-var-dereferenced/12") + 1640 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-local-var-dereferenced/13") + 1641 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-local-var-dereferenced/14") + 1642 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-local-var-dereferenced/15") + 1643 # . epilogue + 1644 89/<- %esp 5/r32/ebp + 1645 5d/pop-to-ebp + 1646 c3/return + 1647 + 1648 # variables of type 'byte' are not allowed on the stack + 1649 test-convert-function-with-byte-operations: + 1650 # . prologue + 1651 55/push-ebp + 1652 89/<- %ebp 4/r32/esp + 1653 # setup + 1654 (clear-stream _test-input-stream) + 1655 (clear-stream $_test-input-buffered-file->buffer) + 1656 (clear-stream _test-output-stream) + 1657 (clear-stream $_test-output-buffered-file->buffer) + 1658 # + 1659 (write _test-input-stream "fn foo {\n") + 1660 (write _test-input-stream " var x/eax: byte <- copy 0\n") + 1661 (write _test-input-stream " var y/ecx: byte <- copy 0\n") + 1662 (write _test-input-stream " y <- copy-byte x\n") + 1663 (write _test-input-stream " var z/edx: (addr byte) <- copy 0\n") + 1664 (write _test-input-stream " y <- copy-byte *z\n") + 1665 (write _test-input-stream " copy-byte-to *z, x\n") + 1666 (write _test-input-stream "}\n") + 1667 # convert + 1668 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 1669 (flush _test-output-buffered-file) + 1670 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 1676 # check output + 1677 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-byte-operations/0") + 1678 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-byte-operations/1") + 1679 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-byte-operations/2") + 1680 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-byte-operations/3") + 1681 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-byte-operations/4") + 1682 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-byte-operations/5") + 1683 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-function-with-byte-operations/6") + 1684 (check-next-stream-line-equal _test-output-stream " b8/copy-to-eax 0/imm32" "F - test-convert-function-with-byte-operations/7") + 1685 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-convert-function-with-byte-operations/8") + 1686 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 0/imm32" "F - test-convert-function-with-byte-operations/9") + 1687 (check-next-stream-line-equal _test-output-stream " 8a/byte-> %eax 0x00000001/r32" "F - test-convert-function-with-byte-operations/10") + 1688 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %edx" "F - test-convert-function-with-byte-operations/11") + 1689 (check-next-stream-line-equal _test-output-stream " ba/copy-to-edx 0/imm32" "F - test-convert-function-with-byte-operations/12") + 1690 (check-next-stream-line-equal _test-output-stream " 8a/byte-> *edx 0x00000001/r32" "F - test-convert-function-with-byte-operations/13") + 1691 (check-next-stream-line-equal _test-output-stream " 88/byte<- *edx 0x00000000/r32" "F - test-convert-function-with-byte-operations/14") + 1692 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %edx" "F - test-convert-function-with-byte-operations/15") + 1693 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-convert-function-with-byte-operations/16") + 1694 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-function-with-byte-operations/17") + 1695 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-byte-operations/18") + 1696 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-byte-operations/19") + 1697 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-byte-operations/20") + 1698 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-byte-operations/21") + 1699 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-byte-operations/22") + 1700 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-byte-operations/23") + 1701 # . epilogue + 1702 89/<- %esp 5/r32/ebp + 1703 5d/pop-to-ebp + 1704 c3/return + 1705 + 1706 # variables of type 'byte' _can_ be function args. They then occupy 4 bytes. + 1707 test-copy-byte-var-from-fn-arg: + 1708 # . prologue + 1709 55/push-ebp + 1710 89/<- %ebp 4/r32/esp + 1711 # setup + 1712 (clear-stream _test-input-stream) + 1713 (clear-stream $_test-input-buffered-file->buffer) + 1714 (clear-stream _test-output-stream) + 1715 (clear-stream $_test-output-buffered-file->buffer) + 1716 # + 1717 (write _test-input-stream "fn foo x: byte, y: int {\n") + 1718 (write _test-input-stream " var a/eax: byte <- copy x\n") + 1719 (write _test-input-stream " var b/eax: int <- copy y\n") + 1720 (write _test-input-stream "}\n") + 1721 # convert + 1722 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 1723 (flush _test-output-buffered-file) + 1724 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 1730 # check output + 1731 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-copy-byte-from-fn-arg/0") + 1732 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-copy-byte-from-fn-arg/1") + 1733 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-copy-byte-from-fn-arg/2") + 1734 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-copy-byte-from-fn-arg/3") + 1735 (check-next-stream-line-equal _test-output-stream " {" "F - test-copy-byte-from-fn-arg/4") + 1736 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-copy-byte-from-fn-arg/5") + 1737 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-copy-byte-from-fn-arg/6") + 1738 (check-next-stream-line-equal _test-output-stream " 8b/-> *(ebp+0x00000008) 0x00000000/r32" "F - test-copy-byte-from-fn-arg/7") + 1739 (check-next-stream-line-equal _test-output-stream " 8b/-> *(ebp+0x0000000c) 0x00000000/r32" "F - test-copy-byte-from-fn-arg/8") + 1740 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-copy-byte-from-fn-arg/9") + 1741 (check-next-stream-line-equal _test-output-stream " }" "F - test-copy-byte-from-fn-arg/10") + 1742 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-copy-byte-from-fn-arg/11") + 1743 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-copy-byte-from-fn-arg/12") + 1744 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-copy-byte-from-fn-arg/13") + 1745 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-copy-byte-from-fn-arg/14") + 1746 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-copy-byte-from-fn-arg/15") + 1747 # . epilogue + 1748 89/<- %esp 5/r32/ebp + 1749 5d/pop-to-ebp + 1750 c3/return + 1751 + 1752 test-convert-compare-register-with-literal: + 1753 # . prologue + 1754 55/push-ebp + 1755 89/<- %ebp 4/r32/esp + 1756 # setup + 1757 (clear-stream _test-input-stream) + 1758 (clear-stream $_test-input-buffered-file->buffer) + 1759 (clear-stream _test-output-stream) + 1760 (clear-stream $_test-output-buffered-file->buffer) + 1761 # + 1762 (write _test-input-stream "fn foo {\n") + 1763 (write _test-input-stream " var x/ecx: int <- copy 0\n") + 1764 (write _test-input-stream " compare x, 0\n") + 1765 (write _test-input-stream "}\n") + 1766 # convert + 1767 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 1768 (flush _test-output-buffered-file) + 1769 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 1775 # check output + 1776 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-compare-register-with-literal/0") + 1777 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-compare-register-with-literal/1") + 1778 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-compare-register-with-literal/2") + 1779 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-compare-register-with-literal/3") + 1780 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-compare-register-with-literal/4") + 1781 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-compare-register-with-literal/5") + 1782 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-convert-compare-register-with-literal/6") + 1783 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 0/imm32" "F - test-convert-compare-register-with-literal/7") + 1784 (check-next-stream-line-equal _test-output-stream " 81 7/subop/compare %ecx 0/imm32" "F - test-convert-compare-register-with-literal/8") + 1785 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-convert-compare-register-with-literal/9") + 1786 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-compare-register-with-literal/10") + 1787 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-compare-register-with-literal/11") + 1788 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-compare-register-with-literal/12") + 1789 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-compare-register-with-literal/13") + 1790 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-compare-register-with-literal/14") + 1791 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-compare-register-with-literal/15") + 1792 # . epilogue + 1793 89/<- %esp 5/r32/ebp + 1794 5d/pop-to-ebp + 1795 c3/return + 1796 + 1797 test-unknown-variable: + 1798 # . prologue + 1799 55/push-ebp + 1800 89/<- %ebp 4/r32/esp + 1801 # setup + 1802 (clear-stream _test-input-stream) + 1803 (clear-stream $_test-input-buffered-file->buffer) + 1804 (clear-stream _test-output-stream) + 1805 (clear-stream $_test-output-buffered-file->buffer) + 1806 (clear-stream _test-error-stream) + 1807 (clear-stream $_test-error-buffered-file->buffer) + 1808 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) + 1809 68/push 0/imm32 + 1810 68/push 0/imm32 + 1811 89/<- %edx 4/r32/esp + 1812 (tailor-exit-descriptor %edx 0x10) + 1813 # + 1814 (write _test-input-stream "fn foo {\n") + 1815 (write _test-input-stream " compare x, 0\n") + 1816 (write _test-input-stream "}\n") + 1817 # convert + 1818 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) + 1819 # registers except esp clobbered at this point + 1820 # restore ed + 1821 89/<- %edx 4/r32/esp + 1822 (flush _test-output-buffered-file) + 1823 (flush _test-error-buffered-file) + 1824 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ + 1830 # check output + 1831 (check-stream-equal _test-output-stream "" "F - test-unknown-variable: output should be empty") + 1832 (check-next-stream-line-equal _test-error-stream "fn foo: unknown variable 'x'" "F - test-unknown-variable: error message") + 1833 # check that stop(1) was called + 1834 (check-ints-equal *(edx+4) 2 "F - test-unknown-variable: exit status") + 1835 # don't restore from ebp + 1836 81 0/subop/add %esp 8/imm32 1837 # . epilogue - 1838 89/<- %esp 5/r32/ebp - 1839 5d/pop-to-ebp - 1840 c3/return - 1841 - 1842 test-convert-function-with-local-var-in-named-block: - 1843 # . prologue - 1844 55/push-ebp - 1845 89/<- %ebp 4/r32/esp - 1846 # setup - 1847 (clear-stream _test-input-stream) - 1848 (clear-stream $_test-input-buffered-file->buffer) - 1849 (clear-stream _test-output-stream) - 1850 (clear-stream $_test-output-buffered-file->buffer) - 1851 # - 1852 (write _test-input-stream "fn foo {\n") - 1853 (write _test-input-stream " $bar: {\n") - 1854 (write _test-input-stream " var x: int\n") - 1855 (write _test-input-stream " increment x\n") - 1856 (write _test-input-stream " }\n") - 1857 (write _test-input-stream "}\n") - 1858 # convert - 1859 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 1860 (flush _test-output-buffered-file) - 1861 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 1867 # check output - 1868 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-local-var-in-named-block/0") - 1869 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-local-var-in-named-block/1") - 1870 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-local-var-in-named-block/2") - 1871 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-local-var-in-named-block/3") - 1872 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-local-var-in-named-block/4") - 1873 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-local-var-in-named-block/5") - 1874 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-local-var-in-named-block/6") - 1875 (check-next-stream-line-equal _test-output-stream "$bar:loop:" "F - test-convert-function-with-local-var-in-named-block/7") - 1876 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-local-var-in-named-block/8") - 1877 (check-next-stream-line-equal _test-output-stream " ff 0/subop/increment *(ebp+0xfffffffc)" "F - test-convert-function-with-local-var-in-named-block/9") - 1878 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-local-var-in-named-block/10") - 1879 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-local-var-in-named-block/11") - 1880 (check-next-stream-line-equal _test-output-stream "$bar:break:" "F - test-convert-function-with-local-var-in-named-block/12") - 1881 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-local-var-in-named-block/13") - 1882 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-local-var-in-named-block/14") - 1883 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-local-var-in-named-block/15") - 1884 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-local-var-in-named-block/16") - 1885 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-local-var-in-named-block/17") - 1886 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-local-var-in-named-block/18") - 1887 # . epilogue - 1888 89/<- %esp 5/r32/ebp - 1889 5d/pop-to-ebp - 1890 c3/return - 1891 - 1892 test-unknown-variable-in-named-block: - 1893 # . prologue - 1894 55/push-ebp - 1895 89/<- %ebp 4/r32/esp - 1896 # setup - 1897 (clear-stream _test-input-stream) - 1898 (clear-stream $_test-input-buffered-file->buffer) - 1899 (clear-stream _test-output-stream) - 1900 (clear-stream $_test-output-buffered-file->buffer) - 1901 (clear-stream _test-error-stream) - 1902 (clear-stream $_test-error-buffered-file->buffer) - 1903 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) - 1904 68/push 0/imm32 - 1905 68/push 0/imm32 - 1906 89/<- %edx 4/r32/esp - 1907 (tailor-exit-descriptor %edx 0x10) - 1908 # - 1909 (write _test-input-stream "fn foo {\n") - 1910 (write _test-input-stream " $a: {\n") - 1911 (write _test-input-stream " compare x, 0\n") - 1912 (write _test-input-stream " }\n") - 1913 (write _test-input-stream "}\n") - 1914 # convert - 1915 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) - 1916 # registers except esp clobbered at this point - 1917 # restore ed - 1918 89/<- %edx 4/r32/esp - 1919 (flush _test-output-buffered-file) - 1920 (flush _test-error-buffered-file) - 1921 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ - 1927 # check output - 1928 (check-stream-equal _test-output-stream "" "F - test-unknown-variable-in-named-block: output should be empty") - 1929 (check-next-stream-line-equal _test-error-stream "fn foo: unknown variable 'x'" "F - test-unknown-variable-in-named-block: error message") - 1930 # check that stop(1) was called - 1931 (check-ints-equal *(edx+4) 2 "F - test-unknown-variable-in-named-block: exit status") - 1932 # don't restore from ebp - 1933 81 0/subop/add %esp 8/imm32 - 1934 # . epilogue - 1935 5d/pop-to-ebp - 1936 c3/return - 1937 - 1938 test-always-shadow-outermost-reg-vars-in-function: - 1939 # . prologue - 1940 55/push-ebp - 1941 89/<- %ebp 4/r32/esp - 1942 # setup - 1943 (clear-stream _test-input-stream) - 1944 (clear-stream $_test-input-buffered-file->buffer) - 1945 (clear-stream _test-output-stream) - 1946 (clear-stream $_test-output-buffered-file->buffer) - 1947 # - 1948 (write _test-input-stream "fn foo {\n") - 1949 (write _test-input-stream " var x/ecx: int <- copy 3\n") - 1950 (write _test-input-stream "}\n") - 1951 # convert - 1952 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 1953 (flush _test-output-buffered-file) - 1954 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 1960 # check output - 1961 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-always-shadow-outermost-reg-vars-in-function/0") - 1962 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-always-shadow-outermost-reg-vars-in-function/1") - 1963 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-always-shadow-outermost-reg-vars-in-function/2") - 1964 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-always-shadow-outermost-reg-vars-in-function/3") - 1965 (check-next-stream-line-equal _test-output-stream " {" "F - test-always-shadow-outermost-reg-vars-in-function/4") - 1966 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-always-shadow-outermost-reg-vars-in-function/5") - 1967 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-convert-compare-register-with-literal/6") - 1968 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 3/imm32" "F - test-always-shadow-outermost-reg-vars-in-function/8") - 1969 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-convert-compare-register-with-literal/9") - 1970 (check-next-stream-line-equal _test-output-stream " }" "F - test-always-shadow-outermost-reg-vars-in-function/12") - 1971 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-always-shadow-outermost-reg-vars-in-function/13") - 1972 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-always-shadow-outermost-reg-vars-in-function/14") - 1973 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-always-shadow-outermost-reg-vars-in-function/15") - 1974 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-always-shadow-outermost-reg-vars-in-function/16") - 1975 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-always-shadow-outermost-reg-vars-in-function/17") - 1976 # . epilogue - 1977 89/<- %esp 5/r32/ebp - 1978 5d/pop-to-ebp - 1979 c3/return - 1980 - 1981 _pending-test-clobber-dead-local: - 1982 # . prologue - 1983 55/push-ebp - 1984 89/<- %ebp 4/r32/esp - 1985 # setup - 1986 (clear-stream _test-input-stream) - 1987 (clear-stream $_test-input-buffered-file->buffer) - 1988 (clear-stream _test-output-stream) - 1989 (clear-stream $_test-output-buffered-file->buffer) - 1990 # - 1991 (write _test-input-stream "fn foo {\n") - 1992 (write _test-input-stream " var x/ecx: int <- copy 3\n") - 1993 (write _test-input-stream " {\n") - 1994 (write _test-input-stream " var y/ecx: int <- copy 4\n") - 1995 (write _test-input-stream " }\n") - 1996 (write _test-input-stream "}\n") - 1997 # convert - 1998 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 1999 (flush _test-output-buffered-file) - 2000 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 2006 # check output - 2007 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-clobber-dead-local/0") - 2008 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-clobber-dead-local/1") - 2009 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-clobber-dead-local/2") - 2010 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-clobber-dead-local/3") - 2011 (check-next-stream-line-equal _test-output-stream " {" "F - test-clobber-dead-local/4") - 2012 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-clobber-dead-local/5") - 2013 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-clobber-dead-local/6") - 2014 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 3/imm32" "F - test-clobber-dead-local/7") - 2015 (check-next-stream-line-equal _test-output-stream " {" "F - test-clobber-dead-local/8") - 2016 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:loop:" "F - test-clobber-dead-local/9") - 2017 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 4/imm32" "F - test-clobber-dead-local/10") # no push/pop here - 2018 (check-next-stream-line-equal _test-output-stream " }" "F - test-clobber-dead-local/11") - 2019 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:break:" "F - test-clobber-dead-local/12") - 2020 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-clobber-dead-local/13") - 2021 (check-next-stream-line-equal _test-output-stream " }" "F - test-clobber-dead-local/14") - 2022 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-clobber-dead-local/15") - 2023 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-clobber-dead-local/16") - 2024 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-clobber-dead-local/17") - 2025 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-clobber-dead-local/18") - 2026 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-clobber-dead-local/19") - 2027 # . epilogue - 2028 89/<- %esp 5/r32/ebp - 2029 5d/pop-to-ebp - 2030 c3/return - 2031 - 2032 test-shadow-live-local: - 2033 # . prologue - 2034 55/push-ebp - 2035 89/<- %ebp 4/r32/esp - 2036 # setup - 2037 (clear-stream _test-input-stream) - 2038 (clear-stream $_test-input-buffered-file->buffer) - 2039 (clear-stream _test-output-stream) - 2040 (clear-stream $_test-output-buffered-file->buffer) - 2041 # - 2042 (write _test-input-stream "fn foo {\n") - 2043 (write _test-input-stream " var x/ecx: int <- copy 3\n") - 2044 (write _test-input-stream " {\n") - 2045 (write _test-input-stream " var y/ecx: int <- copy 4\n") - 2046 (write _test-input-stream " }\n") - 2047 (write _test-input-stream " x <- increment\n") - 2048 (write _test-input-stream "}\n") - 2049 # convert - 2050 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 2051 (flush _test-output-buffered-file) - 2052 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 2058 # check output - 2059 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-shadow-live-local/0") - 2060 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-shadow-live-local/1") - 2061 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-shadow-live-local/2") - 2062 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-shadow-live-local/3") - 2063 (check-next-stream-line-equal _test-output-stream " {" "F - test-shadow-live-local/4") - 2064 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-shadow-live-local/5") - 2065 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-shadow-live-local/6") - 2066 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 3/imm32" "F - test-shadow-live-local/7") - 2067 (check-next-stream-line-equal _test-output-stream " {" "F - test-shadow-live-local/8") - 2068 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:loop:" "F - test-shadow-live-local/9") - 2069 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-shadow-live-local/10") - 2070 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 4/imm32" "F - test-shadow-live-local/11") - 2071 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-shadow-live-local/12") - 2072 (check-next-stream-line-equal _test-output-stream " }" "F - test-shadow-live-local/13") - 2073 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:break:" "F - test-shadow-live-local/14") - 2074 (check-next-stream-line-equal _test-output-stream " 41/increment-ecx" "F - test-shadow-live-local/15") - 2075 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-shadow-live-local/16") - 2076 (check-next-stream-line-equal _test-output-stream " }" "F - test-shadow-live-local/17") - 2077 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-shadow-live-local/18") - 2078 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-shadow-live-local/19") - 2079 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-shadow-live-local/20") - 2080 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-shadow-live-local/21") - 2081 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-shadow-live-local/22") - 2082 # . epilogue - 2083 89/<- %esp 5/r32/ebp - 2084 5d/pop-to-ebp - 2085 c3/return - 2086 - 2087 test-shadow-name: - 2088 # . prologue - 2089 55/push-ebp - 2090 89/<- %ebp 4/r32/esp - 2091 # setup - 2092 (clear-stream _test-input-stream) - 2093 (clear-stream $_test-input-buffered-file->buffer) - 2094 (clear-stream _test-output-stream) - 2095 (clear-stream $_test-output-buffered-file->buffer) - 2096 # - 2097 (write _test-input-stream "fn foo {\n") - 2098 (write _test-input-stream " var x/ecx: int <- copy 3\n") - 2099 (write _test-input-stream " {\n") - 2100 (write _test-input-stream " var x/edx: int <- copy 4\n") - 2101 (write _test-input-stream " }\n") - 2102 (write _test-input-stream " x <- increment\n") - 2103 (write _test-input-stream "}\n") - 2104 # convert - 2105 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 2106 (flush _test-output-buffered-file) - 2107 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 2113 # check output - 2114 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-shadow-name/0") - 2115 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-shadow-name/1") - 2116 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-shadow-name/2") - 2117 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-shadow-name/3") - 2118 (check-next-stream-line-equal _test-output-stream " {" "F - test-shadow-name/4") - 2119 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-shadow-name/5") - 2120 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-shadow-name/6") - 2121 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 3/imm32" "F - test-shadow-name/7") - 2122 (check-next-stream-line-equal _test-output-stream " {" "F - test-shadow-name/8") - 2123 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:loop:" "F - test-shadow-name/9") - 2124 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %edx" "F - test-shadow-name/10") - 2125 (check-next-stream-line-equal _test-output-stream " ba/copy-to-edx 4/imm32" "F - test-shadow-name/11") - 2126 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %edx" "F - test-shadow-name/12") - 2127 (check-next-stream-line-equal _test-output-stream " }" "F - test-shadow-name/13") - 2128 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:break:" "F - test-shadow-name/14") - 2129 (check-next-stream-line-equal _test-output-stream " 41/increment-ecx" "F - test-shadow-name/15") - 2130 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-shadow-name/16") - 2131 (check-next-stream-line-equal _test-output-stream " }" "F - test-shadow-name/17") - 2132 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-shadow-name/18") - 2133 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-shadow-name/19") - 2134 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-shadow-name/20") - 2135 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-shadow-name/21") - 2136 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-shadow-name/22") - 2137 # . epilogue - 2138 89/<- %esp 5/r32/ebp - 2139 5d/pop-to-ebp - 2140 c3/return - 2141 - 2142 test-shadow-name-2: - 2143 # . prologue - 2144 55/push-ebp - 2145 89/<- %ebp 4/r32/esp - 2146 # setup - 2147 (clear-stream _test-input-stream) - 2148 (clear-stream $_test-input-buffered-file->buffer) - 2149 (clear-stream _test-output-stream) - 2150 (clear-stream $_test-output-buffered-file->buffer) - 2151 # - 2152 (write _test-input-stream "fn foo {\n") - 2153 (write _test-input-stream " var x/ecx: int <- copy 3\n") - 2154 (write _test-input-stream " {\n") - 2155 (write _test-input-stream " var x/edx: int <- copy 4\n") - 2156 (write _test-input-stream " var y/ecx: int <- copy 5\n") - 2157 (write _test-input-stream " }\n") - 2158 (write _test-input-stream " x <- increment\n") - 2159 (write _test-input-stream "}\n") - 2160 # convert - 2161 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 2162 (flush _test-output-buffered-file) - 2163 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 2169 # check output - 2170 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-shadow-name-2/0") - 2171 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-shadow-name-2/1") - 2172 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-shadow-name-2/2") - 2173 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-shadow-name-2/3") - 2174 (check-next-stream-line-equal _test-output-stream " {" "F - test-shadow-name-2/4") - 2175 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-shadow-name-2/5") - 2176 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-shadow-name-2/6") - 2177 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 3/imm32" "F - test-shadow-name-2/7") - 2178 (check-next-stream-line-equal _test-output-stream " {" "F - test-shadow-name-2/8") - 2179 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:loop:" "F - test-shadow-name-2/9") - 2180 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %edx" "F - test-shadow-name-2/10") - 2181 (check-next-stream-line-equal _test-output-stream " ba/copy-to-edx 4/imm32" "F - test-shadow-name-2/11") - 2182 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-shadow-name-2/12") - 2183 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 5/imm32" "F - test-shadow-name-2/13") - 2184 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-shadow-name-2/14") - 2185 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %edx" "F - test-shadow-name-2/15") - 2186 (check-next-stream-line-equal _test-output-stream " }" "F - test-shadow-name-2/16") - 2187 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:break:" "F - test-shadow-name-2/17") - 2188 (check-next-stream-line-equal _test-output-stream " 41/increment-ecx" "F - test-shadow-name-2/18") - 2189 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-shadow-name-2/19") - 2190 (check-next-stream-line-equal _test-output-stream " }" "F - test-shadow-name-2/20") - 2191 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-shadow-name-2/21") - 2192 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-shadow-name-2/22") - 2193 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-shadow-name-2/23") - 2194 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-shadow-name-2/24") - 2195 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-shadow-name-2/25") - 2196 # . epilogue - 2197 89/<- %esp 5/r32/ebp - 2198 5d/pop-to-ebp - 2199 c3/return - 2200 - 2201 test-do-not-spill-same-register-in-block: - 2202 # . prologue - 2203 55/push-ebp - 2204 89/<- %ebp 4/r32/esp - 2205 # setup - 2206 (clear-stream _test-input-stream) - 2207 (clear-stream $_test-input-buffered-file->buffer) - 2208 (clear-stream _test-output-stream) - 2209 (clear-stream $_test-output-buffered-file->buffer) - 2210 # - 2211 (write _test-input-stream "fn foo {\n") - 2212 (write _test-input-stream " var x/ecx: int <- copy 3\n") - 2213 (write _test-input-stream " var y/ecx: int <- copy 4\n") - 2214 (write _test-input-stream " y <- increment\n") - 2215 (write _test-input-stream "}\n") - 2216 # convert - 2217 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 2218 (flush _test-output-buffered-file) - 2219 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 2225 # check output - 2226 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-do-not-spill-same-register-in-block/0") - 2227 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-do-not-spill-same-register-in-block/1") - 2228 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-do-not-spill-same-register-in-block/2") - 2229 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-do-not-spill-same-register-in-block/3") - 2230 (check-next-stream-line-equal _test-output-stream " {" "F - test-do-not-spill-same-register-in-block/4") - 2231 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-do-not-spill-same-register-in-block/5") - 2232 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-do-not-spill-same-register-in-block/6") - 2233 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 3/imm32" "F - test-do-not-spill-same-register-in-block/7") - 2234 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 4/imm32" "F - test-do-not-spill-same-register-in-block/8") - 2235 (check-next-stream-line-equal _test-output-stream " 41/increment-ecx" "F - test-do-not-spill-same-register-in-block/9") - 2236 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-do-not-spill-same-register-in-block/10") - 2237 (check-next-stream-line-equal _test-output-stream " }" "F - test-do-not-spill-same-register-in-block/11") - 2238 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-do-not-spill-same-register-in-block/12") - 2239 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-do-not-spill-same-register-in-block/13") - 2240 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-do-not-spill-same-register-in-block/14") - 2241 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-do-not-spill-same-register-in-block/15") - 2242 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-do-not-spill-same-register-in-block/16") - 2243 # . epilogue - 2244 89/<- %esp 5/r32/ebp - 2245 5d/pop-to-ebp - 2246 c3/return - 2247 - 2248 test-spill-different-register-in-block: - 2249 # . prologue - 2250 55/push-ebp - 2251 89/<- %ebp 4/r32/esp - 2252 # setup - 2253 (clear-stream _test-input-stream) - 2254 (clear-stream $_test-input-buffered-file->buffer) - 2255 (clear-stream _test-output-stream) - 2256 (clear-stream $_test-output-buffered-file->buffer) - 2257 # - 2258 (write _test-input-stream "fn foo {\n") - 2259 (write _test-input-stream " var x/eax: int <- copy 3\n") - 2260 (write _test-input-stream " var y/ecx: int <- copy 4\n") - 2261 (write _test-input-stream " y <- increment\n") - 2262 (write _test-input-stream "}\n") - 2263 # convert - 2264 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 2265 (flush _test-output-buffered-file) - 2266 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 2272 # check output - 2273 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-spill-different-register-in-block/0") - 2274 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-spill-different-register-in-block/1") - 2275 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-spill-different-register-in-block/2") - 2276 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-spill-different-register-in-block/3") - 2277 (check-next-stream-line-equal _test-output-stream " {" "F - test-spill-different-register-in-block/4") - 2278 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-spill-different-register-in-block/5") - 2279 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-spill-different-register-in-block/6") - 2280 (check-next-stream-line-equal _test-output-stream " b8/copy-to-eax 3/imm32" "F - test-spill-different-register-in-block/7") - 2281 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-spill-different-register-in-block/8") - 2282 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 4/imm32" "F - test-spill-different-register-in-block/9") - 2283 (check-next-stream-line-equal _test-output-stream " 41/increment-ecx" "F - test-spill-different-register-in-block/10") - 2284 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-spill-different-register-in-block/11") - 2285 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-spill-different-register-in-block/12") - 2286 (check-next-stream-line-equal _test-output-stream " }" "F - test-spill-different-register-in-block/13") - 2287 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-spill-different-register-in-block/14") - 2288 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-spill-different-register-in-block/15") - 2289 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-spill-different-register-in-block/16") - 2290 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-spill-different-register-in-block/17") - 2291 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-spill-different-register-in-block/18") + 1838 5d/pop-to-ebp + 1839 c3/return + 1840 + 1841 test-convert-function-with-local-var-in-block: + 1842 # . prologue + 1843 55/push-ebp + 1844 89/<- %ebp 4/r32/esp + 1845 # setup + 1846 (clear-stream _test-input-stream) + 1847 (clear-stream $_test-input-buffered-file->buffer) + 1848 (clear-stream _test-output-stream) + 1849 (clear-stream $_test-output-buffered-file->buffer) + 1850 # + 1851 (write _test-input-stream "fn foo {\n") + 1852 (write _test-input-stream " {\n") + 1853 (write _test-input-stream " var x: int\n") + 1854 (write _test-input-stream " increment x\n") + 1855 (write _test-input-stream " }\n") + 1856 (write _test-input-stream "}\n") + 1857 # convert + 1858 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 1859 (flush _test-output-buffered-file) + 1860 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 1866 # check output + 1867 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-local-var-in-block/0") + 1868 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-local-var-in-block/1") + 1869 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-local-var-in-block/2") + 1870 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-local-var-in-block/3") + 1871 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-local-var-in-block/4") + 1872 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-local-var-in-block/5") + 1873 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-local-var-in-block/6") + 1874 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:loop:" "F - test-convert-function-with-local-var-in-block/7") + 1875 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-local-var-in-block/8") + 1876 (check-next-stream-line-equal _test-output-stream " ff 0/subop/increment *(ebp+0xfffffffc)" "F - test-convert-function-with-local-var-in-block/9") + 1877 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-local-var-in-block/10") + 1878 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-local-var-in-block/11") + 1879 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:break:" "F - test-convert-function-with-local-var-in-block/12") + 1880 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-local-var-in-block/13") + 1881 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-local-var-in-block/14") + 1882 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-local-var-in-block/15") + 1883 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-local-var-in-block/16") + 1884 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-local-var-in-block/17") + 1885 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-local-var-in-block/18") + 1886 # . epilogue + 1887 89/<- %esp 5/r32/ebp + 1888 5d/pop-to-ebp + 1889 c3/return + 1890 + 1891 test-convert-function-with-local-var-in-named-block: + 1892 # . prologue + 1893 55/push-ebp + 1894 89/<- %ebp 4/r32/esp + 1895 # setup + 1896 (clear-stream _test-input-stream) + 1897 (clear-stream $_test-input-buffered-file->buffer) + 1898 (clear-stream _test-output-stream) + 1899 (clear-stream $_test-output-buffered-file->buffer) + 1900 # + 1901 (write _test-input-stream "fn foo {\n") + 1902 (write _test-input-stream " $bar: {\n") + 1903 (write _test-input-stream " var x: int\n") + 1904 (write _test-input-stream " increment x\n") + 1905 (write _test-input-stream " }\n") + 1906 (write _test-input-stream "}\n") + 1907 # convert + 1908 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 1909 (flush _test-output-buffered-file) + 1910 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 1916 # check output + 1917 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-local-var-in-named-block/0") + 1918 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-local-var-in-named-block/1") + 1919 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-local-var-in-named-block/2") + 1920 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-local-var-in-named-block/3") + 1921 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-local-var-in-named-block/4") + 1922 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-local-var-in-named-block/5") + 1923 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-local-var-in-named-block/6") + 1924 (check-next-stream-line-equal _test-output-stream "$bar:loop:" "F - test-convert-function-with-local-var-in-named-block/7") + 1925 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-local-var-in-named-block/8") + 1926 (check-next-stream-line-equal _test-output-stream " ff 0/subop/increment *(ebp+0xfffffffc)" "F - test-convert-function-with-local-var-in-named-block/9") + 1927 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-local-var-in-named-block/10") + 1928 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-local-var-in-named-block/11") + 1929 (check-next-stream-line-equal _test-output-stream "$bar:break:" "F - test-convert-function-with-local-var-in-named-block/12") + 1930 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-local-var-in-named-block/13") + 1931 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-local-var-in-named-block/14") + 1932 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-local-var-in-named-block/15") + 1933 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-local-var-in-named-block/16") + 1934 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-local-var-in-named-block/17") + 1935 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-local-var-in-named-block/18") + 1936 # . epilogue + 1937 89/<- %esp 5/r32/ebp + 1938 5d/pop-to-ebp + 1939 c3/return + 1940 + 1941 test-unknown-variable-in-named-block: + 1942 # . prologue + 1943 55/push-ebp + 1944 89/<- %ebp 4/r32/esp + 1945 # setup + 1946 (clear-stream _test-input-stream) + 1947 (clear-stream $_test-input-buffered-file->buffer) + 1948 (clear-stream _test-output-stream) + 1949 (clear-stream $_test-output-buffered-file->buffer) + 1950 (clear-stream _test-error-stream) + 1951 (clear-stream $_test-error-buffered-file->buffer) + 1952 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) + 1953 68/push 0/imm32 + 1954 68/push 0/imm32 + 1955 89/<- %edx 4/r32/esp + 1956 (tailor-exit-descriptor %edx 0x10) + 1957 # + 1958 (write _test-input-stream "fn foo {\n") + 1959 (write _test-input-stream " $a: {\n") + 1960 (write _test-input-stream " compare x, 0\n") + 1961 (write _test-input-stream " }\n") + 1962 (write _test-input-stream "}\n") + 1963 # convert + 1964 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) + 1965 # registers except esp clobbered at this point + 1966 # restore ed + 1967 89/<- %edx 4/r32/esp + 1968 (flush _test-output-buffered-file) + 1969 (flush _test-error-buffered-file) + 1970 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ + 1976 # check output + 1977 (check-stream-equal _test-output-stream "" "F - test-unknown-variable-in-named-block: output should be empty") + 1978 (check-next-stream-line-equal _test-error-stream "fn foo: unknown variable 'x'" "F - test-unknown-variable-in-named-block: error message") + 1979 # check that stop(1) was called + 1980 (check-ints-equal *(edx+4) 2 "F - test-unknown-variable-in-named-block: exit status") + 1981 # don't restore from ebp + 1982 81 0/subop/add %esp 8/imm32 + 1983 # . epilogue + 1984 5d/pop-to-ebp + 1985 c3/return + 1986 + 1987 test-always-shadow-outermost-reg-vars-in-function: + 1988 # . prologue + 1989 55/push-ebp + 1990 89/<- %ebp 4/r32/esp + 1991 # setup + 1992 (clear-stream _test-input-stream) + 1993 (clear-stream $_test-input-buffered-file->buffer) + 1994 (clear-stream _test-output-stream) + 1995 (clear-stream $_test-output-buffered-file->buffer) + 1996 # + 1997 (write _test-input-stream "fn foo {\n") + 1998 (write _test-input-stream " var x/ecx: int <- copy 3\n") + 1999 (write _test-input-stream "}\n") + 2000 # convert + 2001 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 2002 (flush _test-output-buffered-file) + 2003 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 2009 # check output + 2010 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-always-shadow-outermost-reg-vars-in-function/0") + 2011 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-always-shadow-outermost-reg-vars-in-function/1") + 2012 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-always-shadow-outermost-reg-vars-in-function/2") + 2013 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-always-shadow-outermost-reg-vars-in-function/3") + 2014 (check-next-stream-line-equal _test-output-stream " {" "F - test-always-shadow-outermost-reg-vars-in-function/4") + 2015 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-always-shadow-outermost-reg-vars-in-function/5") + 2016 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-convert-compare-register-with-literal/6") + 2017 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 3/imm32" "F - test-always-shadow-outermost-reg-vars-in-function/8") + 2018 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-convert-compare-register-with-literal/9") + 2019 (check-next-stream-line-equal _test-output-stream " }" "F - test-always-shadow-outermost-reg-vars-in-function/12") + 2020 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-always-shadow-outermost-reg-vars-in-function/13") + 2021 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-always-shadow-outermost-reg-vars-in-function/14") + 2022 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-always-shadow-outermost-reg-vars-in-function/15") + 2023 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-always-shadow-outermost-reg-vars-in-function/16") + 2024 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-always-shadow-outermost-reg-vars-in-function/17") + 2025 # . epilogue + 2026 89/<- %esp 5/r32/ebp + 2027 5d/pop-to-ebp + 2028 c3/return + 2029 + 2030 _pending-test-clobber-dead-local: + 2031 # . prologue + 2032 55/push-ebp + 2033 89/<- %ebp 4/r32/esp + 2034 # setup + 2035 (clear-stream _test-input-stream) + 2036 (clear-stream $_test-input-buffered-file->buffer) + 2037 (clear-stream _test-output-stream) + 2038 (clear-stream $_test-output-buffered-file->buffer) + 2039 # + 2040 (write _test-input-stream "fn foo {\n") + 2041 (write _test-input-stream " var x/ecx: int <- copy 3\n") + 2042 (write _test-input-stream " {\n") + 2043 (write _test-input-stream " var y/ecx: int <- copy 4\n") + 2044 (write _test-input-stream " }\n") + 2045 (write _test-input-stream "}\n") + 2046 # convert + 2047 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 2048 (flush _test-output-buffered-file) + 2049 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 2055 # check output + 2056 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-clobber-dead-local/0") + 2057 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-clobber-dead-local/1") + 2058 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-clobber-dead-local/2") + 2059 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-clobber-dead-local/3") + 2060 (check-next-stream-line-equal _test-output-stream " {" "F - test-clobber-dead-local/4") + 2061 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-clobber-dead-local/5") + 2062 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-clobber-dead-local/6") + 2063 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 3/imm32" "F - test-clobber-dead-local/7") + 2064 (check-next-stream-line-equal _test-output-stream " {" "F - test-clobber-dead-local/8") + 2065 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:loop:" "F - test-clobber-dead-local/9") + 2066 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 4/imm32" "F - test-clobber-dead-local/10") # no push/pop here + 2067 (check-next-stream-line-equal _test-output-stream " }" "F - test-clobber-dead-local/11") + 2068 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:break:" "F - test-clobber-dead-local/12") + 2069 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-clobber-dead-local/13") + 2070 (check-next-stream-line-equal _test-output-stream " }" "F - test-clobber-dead-local/14") + 2071 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-clobber-dead-local/15") + 2072 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-clobber-dead-local/16") + 2073 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-clobber-dead-local/17") + 2074 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-clobber-dead-local/18") + 2075 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-clobber-dead-local/19") + 2076 # . epilogue + 2077 89/<- %esp 5/r32/ebp + 2078 5d/pop-to-ebp + 2079 c3/return + 2080 + 2081 test-shadow-live-local: + 2082 # . prologue + 2083 55/push-ebp + 2084 89/<- %ebp 4/r32/esp + 2085 # setup + 2086 (clear-stream _test-input-stream) + 2087 (clear-stream $_test-input-buffered-file->buffer) + 2088 (clear-stream _test-output-stream) + 2089 (clear-stream $_test-output-buffered-file->buffer) + 2090 # + 2091 (write _test-input-stream "fn foo {\n") + 2092 (write _test-input-stream " var x/ecx: int <- copy 3\n") + 2093 (write _test-input-stream " {\n") + 2094 (write _test-input-stream " var y/ecx: int <- copy 4\n") + 2095 (write _test-input-stream " }\n") + 2096 (write _test-input-stream " x <- increment\n") + 2097 (write _test-input-stream "}\n") + 2098 # convert + 2099 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 2100 (flush _test-output-buffered-file) + 2101 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 2107 # check output + 2108 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-shadow-live-local/0") + 2109 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-shadow-live-local/1") + 2110 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-shadow-live-local/2") + 2111 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-shadow-live-local/3") + 2112 (check-next-stream-line-equal _test-output-stream " {" "F - test-shadow-live-local/4") + 2113 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-shadow-live-local/5") + 2114 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-shadow-live-local/6") + 2115 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 3/imm32" "F - test-shadow-live-local/7") + 2116 (check-next-stream-line-equal _test-output-stream " {" "F - test-shadow-live-local/8") + 2117 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:loop:" "F - test-shadow-live-local/9") + 2118 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-shadow-live-local/10") + 2119 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 4/imm32" "F - test-shadow-live-local/11") + 2120 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-shadow-live-local/12") + 2121 (check-next-stream-line-equal _test-output-stream " }" "F - test-shadow-live-local/13") + 2122 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:break:" "F - test-shadow-live-local/14") + 2123 (check-next-stream-line-equal _test-output-stream " 41/increment-ecx" "F - test-shadow-live-local/15") + 2124 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-shadow-live-local/16") + 2125 (check-next-stream-line-equal _test-output-stream " }" "F - test-shadow-live-local/17") + 2126 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-shadow-live-local/18") + 2127 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-shadow-live-local/19") + 2128 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-shadow-live-local/20") + 2129 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-shadow-live-local/21") + 2130 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-shadow-live-local/22") + 2131 # . epilogue + 2132 89/<- %esp 5/r32/ebp + 2133 5d/pop-to-ebp + 2134 c3/return + 2135 + 2136 test-shadow-name: + 2137 # . prologue + 2138 55/push-ebp + 2139 89/<- %ebp 4/r32/esp + 2140 # setup + 2141 (clear-stream _test-input-stream) + 2142 (clear-stream $_test-input-buffered-file->buffer) + 2143 (clear-stream _test-output-stream) + 2144 (clear-stream $_test-output-buffered-file->buffer) + 2145 # + 2146 (write _test-input-stream "fn foo {\n") + 2147 (write _test-input-stream " var x/ecx: int <- copy 3\n") + 2148 (write _test-input-stream " {\n") + 2149 (write _test-input-stream " var x/edx: int <- copy 4\n") + 2150 (write _test-input-stream " }\n") + 2151 (write _test-input-stream " x <- increment\n") + 2152 (write _test-input-stream "}\n") + 2153 # convert + 2154 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 2155 (flush _test-output-buffered-file) + 2156 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 2162 # check output + 2163 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-shadow-name/0") + 2164 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-shadow-name/1") + 2165 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-shadow-name/2") + 2166 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-shadow-name/3") + 2167 (check-next-stream-line-equal _test-output-stream " {" "F - test-shadow-name/4") + 2168 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-shadow-name/5") + 2169 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-shadow-name/6") + 2170 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 3/imm32" "F - test-shadow-name/7") + 2171 (check-next-stream-line-equal _test-output-stream " {" "F - test-shadow-name/8") + 2172 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:loop:" "F - test-shadow-name/9") + 2173 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %edx" "F - test-shadow-name/10") + 2174 (check-next-stream-line-equal _test-output-stream " ba/copy-to-edx 4/imm32" "F - test-shadow-name/11") + 2175 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %edx" "F - test-shadow-name/12") + 2176 (check-next-stream-line-equal _test-output-stream " }" "F - test-shadow-name/13") + 2177 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:break:" "F - test-shadow-name/14") + 2178 (check-next-stream-line-equal _test-output-stream " 41/increment-ecx" "F - test-shadow-name/15") + 2179 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-shadow-name/16") + 2180 (check-next-stream-line-equal _test-output-stream " }" "F - test-shadow-name/17") + 2181 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-shadow-name/18") + 2182 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-shadow-name/19") + 2183 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-shadow-name/20") + 2184 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-shadow-name/21") + 2185 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-shadow-name/22") + 2186 # . epilogue + 2187 89/<- %esp 5/r32/ebp + 2188 5d/pop-to-ebp + 2189 c3/return + 2190 + 2191 test-shadow-name-2: + 2192 # . prologue + 2193 55/push-ebp + 2194 89/<- %ebp 4/r32/esp + 2195 # setup + 2196 (clear-stream _test-input-stream) + 2197 (clear-stream $_test-input-buffered-file->buffer) + 2198 (clear-stream _test-output-stream) + 2199 (clear-stream $_test-output-buffered-file->buffer) + 2200 # + 2201 (write _test-input-stream "fn foo {\n") + 2202 (write _test-input-stream " var x/ecx: int <- copy 3\n") + 2203 (write _test-input-stream " {\n") + 2204 (write _test-input-stream " var x/edx: int <- copy 4\n") + 2205 (write _test-input-stream " var y/ecx: int <- copy 5\n") + 2206 (write _test-input-stream " }\n") + 2207 (write _test-input-stream " x <- increment\n") + 2208 (write _test-input-stream "}\n") + 2209 # convert + 2210 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 2211 (flush _test-output-buffered-file) + 2212 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 2218 # check output + 2219 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-shadow-name-2/0") + 2220 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-shadow-name-2/1") + 2221 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-shadow-name-2/2") + 2222 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-shadow-name-2/3") + 2223 (check-next-stream-line-equal _test-output-stream " {" "F - test-shadow-name-2/4") + 2224 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-shadow-name-2/5") + 2225 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-shadow-name-2/6") + 2226 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 3/imm32" "F - test-shadow-name-2/7") + 2227 (check-next-stream-line-equal _test-output-stream " {" "F - test-shadow-name-2/8") + 2228 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:loop:" "F - test-shadow-name-2/9") + 2229 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %edx" "F - test-shadow-name-2/10") + 2230 (check-next-stream-line-equal _test-output-stream " ba/copy-to-edx 4/imm32" "F - test-shadow-name-2/11") + 2231 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-shadow-name-2/12") + 2232 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 5/imm32" "F - test-shadow-name-2/13") + 2233 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-shadow-name-2/14") + 2234 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %edx" "F - test-shadow-name-2/15") + 2235 (check-next-stream-line-equal _test-output-stream " }" "F - test-shadow-name-2/16") + 2236 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:break:" "F - test-shadow-name-2/17") + 2237 (check-next-stream-line-equal _test-output-stream " 41/increment-ecx" "F - test-shadow-name-2/18") + 2238 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-shadow-name-2/19") + 2239 (check-next-stream-line-equal _test-output-stream " }" "F - test-shadow-name-2/20") + 2240 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-shadow-name-2/21") + 2241 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-shadow-name-2/22") + 2242 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-shadow-name-2/23") + 2243 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-shadow-name-2/24") + 2244 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-shadow-name-2/25") + 2245 # . epilogue + 2246 89/<- %esp 5/r32/ebp + 2247 5d/pop-to-ebp + 2248 c3/return + 2249 + 2250 test-do-not-spill-same-register-in-block: + 2251 # . prologue + 2252 55/push-ebp + 2253 89/<- %ebp 4/r32/esp + 2254 # setup + 2255 (clear-stream _test-input-stream) + 2256 (clear-stream $_test-input-buffered-file->buffer) + 2257 (clear-stream _test-output-stream) + 2258 (clear-stream $_test-output-buffered-file->buffer) + 2259 # + 2260 (write _test-input-stream "fn foo {\n") + 2261 (write _test-input-stream " var x/ecx: int <- copy 3\n") + 2262 (write _test-input-stream " var y/ecx: int <- copy 4\n") + 2263 (write _test-input-stream " y <- increment\n") + 2264 (write _test-input-stream "}\n") + 2265 # convert + 2266 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 2267 (flush _test-output-buffered-file) + 2268 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 2274 # check output + 2275 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-do-not-spill-same-register-in-block/0") + 2276 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-do-not-spill-same-register-in-block/1") + 2277 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-do-not-spill-same-register-in-block/2") + 2278 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-do-not-spill-same-register-in-block/3") + 2279 (check-next-stream-line-equal _test-output-stream " {" "F - test-do-not-spill-same-register-in-block/4") + 2280 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-do-not-spill-same-register-in-block/5") + 2281 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-do-not-spill-same-register-in-block/6") + 2282 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 3/imm32" "F - test-do-not-spill-same-register-in-block/7") + 2283 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 4/imm32" "F - test-do-not-spill-same-register-in-block/8") + 2284 (check-next-stream-line-equal _test-output-stream " 41/increment-ecx" "F - test-do-not-spill-same-register-in-block/9") + 2285 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-do-not-spill-same-register-in-block/10") + 2286 (check-next-stream-line-equal _test-output-stream " }" "F - test-do-not-spill-same-register-in-block/11") + 2287 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-do-not-spill-same-register-in-block/12") + 2288 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-do-not-spill-same-register-in-block/13") + 2289 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-do-not-spill-same-register-in-block/14") + 2290 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-do-not-spill-same-register-in-block/15") + 2291 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-do-not-spill-same-register-in-block/16") 2292 # . epilogue 2293 89/<- %esp 5/r32/ebp 2294 5d/pop-to-ebp 2295 c3/return 2296 - 2297 test-shadow-live-output: + 2297 test-spill-different-register-in-block: 2298 # . prologue 2299 55/push-ebp 2300 89/<- %ebp 4/r32/esp 2301 # setup - 2302 (clear-stream _test-input-stream) - 2303 (clear-stream $_test-input-buffered-file->buffer) - 2304 (clear-stream _test-output-stream) - 2305 (clear-stream $_test-output-buffered-file->buffer) + 2302 (clear-stream _test-input-stream) + 2303 (clear-stream $_test-input-buffered-file->buffer) + 2304 (clear-stream _test-output-stream) + 2305 (clear-stream $_test-output-buffered-file->buffer) 2306 # - 2307 (write _test-input-stream "fn foo -> x/ecx: int {\n") - 2308 (write _test-input-stream " x <- copy 3\n") - 2309 (write _test-input-stream " {\n") - 2310 (write _test-input-stream " var y/ecx: int <- copy 4\n") - 2311 (write _test-input-stream " }\n") - 2312 (write _test-input-stream " x <- increment\n") - 2313 (write _test-input-stream "}\n") - 2314 # convert - 2315 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 2316 (flush _test-output-buffered-file) - 2317 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 2323 # check output - 2324 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-shadow-live-output/0") - 2325 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-shadow-live-output/1") - 2326 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-shadow-live-output/2") - 2327 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-shadow-live-output/3") - 2328 (check-next-stream-line-equal _test-output-stream " {" "F - test-shadow-live-output/4") - 2329 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-shadow-live-output/5") - 2330 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 3/imm32" "F - test-shadow-live-output/7") # no push because it's an output reg - 2331 (check-next-stream-line-equal _test-output-stream " {" "F - test-shadow-live-output/8") - 2332 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:loop:" "F - test-shadow-live-output/9") - 2333 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-shadow-live-output/10") - 2334 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 4/imm32" "F - test-shadow-live-output/11") - 2335 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-shadow-live-output/12") - 2336 (check-next-stream-line-equal _test-output-stream " }" "F - test-shadow-live-output/13") - 2337 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:break:" "F - test-shadow-live-output/14") - 2338 (check-next-stream-line-equal _test-output-stream " 41/increment-ecx" "F - test-shadow-live-output/15") - 2339 (check-next-stream-line-equal _test-output-stream " }" "F - test-shadow-live-output/17") - 2340 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-shadow-live-output/18") - 2341 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-shadow-live-output/19") - 2342 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-shadow-live-output/20") - 2343 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-shadow-live-output/21") - 2344 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-shadow-live-output/21") - 2345 # . epilogue - 2346 89/<- %esp 5/r32/ebp - 2347 5d/pop-to-ebp - 2348 c3/return - 2349 - 2350 test-stmt-defines-output-in-same-register-as-inout: - 2351 # . prologue - 2352 55/push-ebp - 2353 89/<- %ebp 4/r32/esp - 2354 # setup - 2355 (clear-stream _test-input-stream) - 2356 (clear-stream $_test-input-buffered-file->buffer) - 2357 (clear-stream _test-output-stream) - 2358 (clear-stream $_test-output-buffered-file->buffer) - 2359 (clear-stream _test-error-stream) - 2360 (clear-stream $_test-error-buffered-file->buffer) - 2361 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) - 2362 68/push 0/imm32 - 2363 68/push 0/imm32 - 2364 89/<- %edx 4/r32/esp - 2365 (tailor-exit-descriptor %edx 0x10) - 2366 # - 2367 (write _test-input-stream "fn foo -> x/ecx: int {\n") - 2368 (write _test-input-stream " var y/ecx: int <- copy 4\n") - 2369 (write _test-input-stream " x <- copy y\n") # writing to a fn output is currently the only way for a statement to define a new var - 2370 (write _test-input-stream "}\n") - 2371 # convert - 2372 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) - 2373 # registers except esp clobbered at this point - 2374 # restore ed - 2375 89/<- %edx 4/r32/esp - 2376 (flush _test-output-buffered-file) - 2377 (flush _test-error-buffered-file) - 2378 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 2384 # no error; we looked up 'y' correctly before pushing the binding for 'x' - 2385 (check-stream-equal _test-error-stream "" "F - test-stmt-defines-output-in-same-register-as-inout: error stream should be empty") - 2386 # don't bother checking the generated code; that's in the test 'test-local-clobbered-by-fn-output' below - 2387 # don't restore from ebp - 2388 81 0/subop/add %esp 8/imm32 - 2389 # . epilogue - 2390 5d/pop-to-ebp - 2391 c3/return - 2392 - 2393 test-local-clobbered-by-fn-output: - 2394 # . prologue - 2395 55/push-ebp - 2396 89/<- %ebp 4/r32/esp - 2397 # setup - 2398 (clear-stream _test-input-stream) - 2399 (clear-stream $_test-input-buffered-file->buffer) - 2400 (clear-stream _test-output-stream) - 2401 (clear-stream $_test-output-buffered-file->buffer) - 2402 # - 2403 (write _test-input-stream "fn foo -> x/ecx: int {\n") - 2404 (write _test-input-stream " var y/ecx: int <- copy 4\n") - 2405 (write _test-input-stream " x <- copy y\n") - 2406 (write _test-input-stream "}\n") - 2407 # convert - 2408 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 2409 (flush _test-output-buffered-file) - 2410 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 2416 # check output - 2417 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-local-clobbered-by-fn-output/0") - 2418 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-local-clobbered-by-fn-output/1") - 2419 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-local-clobbered-by-fn-output/2") - 2420 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-local-clobbered-by-fn-output/3") - 2421 (check-next-stream-line-equal _test-output-stream " {" "F - test-local-clobbered-by-fn-output/4") - 2422 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-local-clobbered-by-fn-output/5") - 2423 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 4/imm32" "F - test-local-clobbered-by-fn-output/6") # no push because it's an output reg - 2424 (check-next-stream-line-equal _test-output-stream " 89/<- %ecx 0x00000001/r32" "F - test-local-clobbered-by-fn-output/7") - 2425 (check-next-stream-line-equal _test-output-stream " }" "F - test-local-clobbered-by-fn-output/8") - 2426 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-local-clobbered-by-fn-output/9") - 2427 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-local-clobbered-by-fn-output/10") - 2428 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-local-clobbered-by-fn-output/11") - 2429 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-local-clobbered-by-fn-output/12") - 2430 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-local-clobbered-by-fn-output/13") - 2431 # . epilogue - 2432 89/<- %esp 5/r32/ebp - 2433 5d/pop-to-ebp - 2434 c3/return - 2435 - 2436 test-read-output: - 2437 # . prologue - 2438 55/push-ebp - 2439 89/<- %ebp 4/r32/esp - 2440 # setup - 2441 (clear-stream _test-input-stream) - 2442 (clear-stream $_test-input-buffered-file->buffer) - 2443 (clear-stream _test-output-stream) - 2444 (clear-stream $_test-output-buffered-file->buffer) - 2445 # - 2446 (write _test-input-stream "fn foo -> x/ecx: int {\n") - 2447 (write _test-input-stream " x <- copy 0x34\n") - 2448 (write _test-input-stream " compare x, 0x35\n") - 2449 (write _test-input-stream "}\n") - 2450 # convert - 2451 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 2452 (flush _test-output-buffered-file) - 2453 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 2459 # check output - 2460 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-read-output/0") - 2461 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-read-output/1") - 2462 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-read-output/2") - 2463 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-read-output/3") - 2464 (check-next-stream-line-equal _test-output-stream " {" "F - test-read-output/4") - 2465 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-read-output/5") - 2466 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 0x34/imm32" "F - test-read-output/6") - 2467 (check-next-stream-line-equal _test-output-stream " 81 7/subop/compare %ecx 0x35/imm32" "F - test-read-output/7") - 2468 (check-next-stream-line-equal _test-output-stream " }" "F - test-read-output/8") - 2469 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-read-output/9") - 2470 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-read-output/10") - 2471 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-read-output/11") - 2472 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-read-output/12") - 2473 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-read-output/13") - 2474 # . epilogue - 2475 89/<- %esp 5/r32/ebp - 2476 5d/pop-to-ebp - 2477 c3/return - 2478 - 2479 test-fn-output-written-in-inner-block: - 2480 # . prologue - 2481 55/push-ebp - 2482 89/<- %ebp 4/r32/esp - 2483 # setup - 2484 (clear-stream _test-input-stream) - 2485 (clear-stream $_test-input-buffered-file->buffer) - 2486 (clear-stream _test-output-stream) - 2487 (clear-stream $_test-output-buffered-file->buffer) - 2488 # - 2489 (write _test-input-stream "fn foo -> out/edi: int {\n") - 2490 (write _test-input-stream " var a/eax: int <- copy 3\n") # define outer local - 2491 (write _test-input-stream " {\n") - 2492 (write _test-input-stream " var a/ecx: int <- copy 4\n") # shadow outer local - 2493 (write _test-input-stream " out <- copy a\n") # write to fn output - 2494 (write _test-input-stream " }\n") - 2495 (write _test-input-stream " compare a, 0\n") # use outer local - 2496 (write _test-input-stream "}\n") - 2497 # convert - 2498 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 2499 (flush _test-output-buffered-file) - 2500 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 2506 # no error; defining 'out' didn't interfere with the reclamation of 'b' - 2507 # check output - 2508 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-fn-output-written-in-inner-block/0") - 2509 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-fn-output-written-in-inner-block/1") - 2510 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-fn-output-written-in-inner-block/2") - 2511 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-fn-output-written-in-inner-block/3") - 2512 (check-next-stream-line-equal _test-output-stream " {" "F - test-fn-output-written-in-inner-block/4") - 2513 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-fn-output-written-in-inner-block/5") - 2514 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-fn-output-written-in-inner-block/6") - 2515 (check-next-stream-line-equal _test-output-stream " b8/copy-to-eax 3/imm32" "F - test-fn-output-written-in-inner-block/7") - 2516 (check-next-stream-line-equal _test-output-stream " {" "F - test-fn-output-written-in-inner-block/8") - 2517 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:loop:" "F - test-fn-output-written-in-inner-block/9") - 2518 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-fn-output-written-in-inner-block/10") - 2519 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 4/imm32" "F - test-fn-output-written-in-inner-block/10") - 2520 (check-next-stream-line-equal _test-output-stream " 89/<- %edi 0x00000001/r32" "F - test-fn-output-written-in-inner-block/11") - 2521 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-fn-output-written-in-inner-block/12") - 2522 (check-next-stream-line-equal _test-output-stream " }" "F - test-fn-output-written-in-inner-block/13") - 2523 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:break:" "F - test-fn-output-written-in-inner-block/14") - 2524 (check-next-stream-line-equal _test-output-stream " 3d/compare-eax-with 0/imm32" "F - test-fn-output-written-in-inner-block/15") - 2525 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-fn-output-written-in-inner-block/16") - 2526 (check-next-stream-line-equal _test-output-stream " }" "F - test-fn-output-written-in-inner-block/17") - 2527 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-fn-output-written-in-inner-block/18") - 2528 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-fn-output-written-in-inner-block/19") - 2529 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-fn-output-written-in-inner-block/20") - 2530 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-fn-output-written-in-inner-block/21") - 2531 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-fn-output-written-in-inner-block/22") - 2532 # . epilogue - 2533 89/<- %esp 5/r32/ebp - 2534 5d/pop-to-ebp - 2535 c3/return - 2536 - 2537 test-convert-function-with-branches-in-block: - 2538 # . prologue - 2539 55/push-ebp - 2540 89/<- %ebp 4/r32/esp - 2541 # setup - 2542 (clear-stream _test-input-stream) - 2543 (clear-stream $_test-input-buffered-file->buffer) - 2544 (clear-stream _test-output-stream) - 2545 (clear-stream $_test-output-buffered-file->buffer) - 2546 # - 2547 (write _test-input-stream "fn foo x: int {\n") - 2548 (write _test-input-stream " {\n") - 2549 (write _test-input-stream " break-if->=\n") - 2550 (write _test-input-stream " loop-if-addr<\n") - 2551 (write _test-input-stream " increment x\n") - 2552 (write _test-input-stream " loop\n") - 2553 (write _test-input-stream " }\n") - 2554 (write _test-input-stream "}\n") - 2555 # convert - 2556 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 2557 (flush _test-output-buffered-file) - 2558 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 2564 # check output - 2565 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-branches-in-block/0") - 2566 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-branches-in-block/1") - 2567 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-branches-in-block/2") - 2568 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-branches-in-block/3") - 2569 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-branches-in-block/4") - 2570 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-branches-in-block/5") - 2571 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-branches-in-block/6") - 2572 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:loop:" "F - test-convert-function-with-branches-in-block/7") - 2573 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-branches-in-block/8") - 2574 (check-next-stream-line-equal _test-output-stream " 0f 8c/jump-if-< break/disp32" "F - test-convert-function-with-branches-in-block/9") - 2575 (check-next-stream-line-equal _test-output-stream " e9/jump $foo:0x00000002:break/disp32" "F - test-convert-function-with-branches-in-block/10") - 2576 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-branches-in-block/11") - 2577 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-branches-in-block/12") - 2578 (check-next-stream-line-equal _test-output-stream " 0f 83/jump-if-addr>= break/disp32" "F - test-convert-function-with-branches-in-block/13") - 2579 (check-next-stream-line-equal _test-output-stream " e9/jump $foo:0x00000002:loop/disp32" "F - test-convert-function-with-branches-in-block/14") - 2580 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-branches-in-block/15") - 2581 (check-next-stream-line-equal _test-output-stream " ff 0/subop/increment *(ebp+0x00000008)" "F - test-convert-function-with-branches-in-block/16") - 2582 (check-next-stream-line-equal _test-output-stream " e9/jump loop/disp32" "F - test-convert-function-with-branches-in-block/17") - 2583 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-branches-in-block/18") - 2584 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:break:" "F - test-convert-function-with-branches-in-block/19") - 2585 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-branches-in-block/20") - 2586 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-branches-in-block/21") - 2587 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-branches-in-block/22") - 2588 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-branches-in-block/23") - 2589 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-branches-in-block/24") - 2590 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-branches-in-block/25") - 2591 # . epilogue - 2592 89/<- %esp 5/r32/ebp - 2593 5d/pop-to-ebp - 2594 c3/return - 2595 - 2596 test-convert-function-with-branches-in-named-block: - 2597 # . prologue - 2598 55/push-ebp - 2599 89/<- %ebp 4/r32/esp - 2600 # setup - 2601 (clear-stream _test-input-stream) - 2602 (clear-stream $_test-input-buffered-file->buffer) - 2603 (clear-stream _test-output-stream) - 2604 (clear-stream $_test-output-buffered-file->buffer) - 2605 # - 2606 (write _test-input-stream "fn foo x: int {\n") - 2607 (write _test-input-stream " $bar: {\n") - 2608 (write _test-input-stream " break-if->= $bar\n") - 2609 (write _test-input-stream " loop-if-addr< $bar\n") - 2610 (write _test-input-stream " increment x\n") - 2611 (write _test-input-stream " loop\n") - 2612 (write _test-input-stream " }\n") - 2613 (write _test-input-stream "}\n") - 2614 # convert - 2615 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 2616 (flush _test-output-buffered-file) - 2617 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 2623 # check output - 2624 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-branches-in-named-block/0") - 2625 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-branches-in-named-block/1") - 2626 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-branches-in-named-block/2") - 2627 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-branches-in-named-block/3") - 2628 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-branches-in-named-block/4") - 2629 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-branches-in-named-block/5") - 2630 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-branches-in-named-block/6") - 2631 (check-next-stream-line-equal _test-output-stream "$bar:loop:" "F - test-convert-function-with-branches-in-named-block/7") - 2632 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-branches-in-named-block/8") - 2633 (check-next-stream-line-equal _test-output-stream " 0f 8c/jump-if-< break/disp32" "F - test-convert-function-with-branches-in-named-block/9") - 2634 (check-next-stream-line-equal _test-output-stream " e9/jump $bar:break/disp32" "F - test-convert-function-with-branches-in-named-block/10") - 2635 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-branches-in-named-block/11") - 2636 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-branches-in-named-block/12") - 2637 (check-next-stream-line-equal _test-output-stream " 0f 83/jump-if-addr>= break/disp32" "F - test-convert-function-with-branches-in-named-block/13") - 2638 (check-next-stream-line-equal _test-output-stream " e9/jump $bar:loop/disp32" "F - test-convert-function-with-branches-in-named-block/14") - 2639 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-branches-in-named-block/15") - 2640 (check-next-stream-line-equal _test-output-stream " ff 0/subop/increment *(ebp+0x00000008)" "F - test-convert-function-with-branches-in-named-block/16") - 2641 (check-next-stream-line-equal _test-output-stream " e9/jump loop/disp32" "F - test-convert-function-with-branches-in-named-block/17") - 2642 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-branches-in-named-block/18") - 2643 (check-next-stream-line-equal _test-output-stream "$bar:break:" "F - test-convert-function-with-branches-in-named-block/19") - 2644 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-branches-in-named-block/20") - 2645 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-branches-in-named-block/21") - 2646 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-branches-in-named-block/22") - 2647 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-branches-in-named-block/23") - 2648 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-branches-in-named-block/24") - 2649 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-branches-in-named-block/25") - 2650 # . epilogue - 2651 89/<- %esp 5/r32/ebp - 2652 5d/pop-to-ebp - 2653 c3/return - 2654 - 2655 test-convert-function-with-var-in-nested-block: - 2656 # . prologue - 2657 55/push-ebp - 2658 89/<- %ebp 4/r32/esp - 2659 # setup - 2660 (clear-stream _test-input-stream) - 2661 (clear-stream $_test-input-buffered-file->buffer) - 2662 (clear-stream _test-output-stream) - 2663 (clear-stream $_test-output-buffered-file->buffer) - 2664 # - 2665 (write _test-input-stream "fn foo x: int {\n") - 2666 (write _test-input-stream " {\n") - 2667 (write _test-input-stream " {\n") - 2668 (write _test-input-stream " var x: int\n") - 2669 (write _test-input-stream " increment x\n") - 2670 (write _test-input-stream " }\n") - 2671 (write _test-input-stream " }\n") - 2672 (write _test-input-stream "}\n") - 2673 # convert - 2674 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 2675 (flush _test-output-buffered-file) - 2676 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 2682 # check output - 2683 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-var-in-nested-block/0") - 2684 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-var-in-nested-block/1") - 2685 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-var-in-nested-block/2") - 2686 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-var-in-nested-block/3") - 2687 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-var-in-nested-block/4") - 2688 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-var-in-nested-block/5") - 2689 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-var-in-nested-block/6") - 2690 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:loop:" "F - test-convert-function-with-var-in-nested-block/7") - 2691 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-var-in-nested-block/8") - 2692 (check-next-stream-line-equal _test-output-stream "$foo:0x00000003:loop:" "F - test-convert-function-with-var-in-nested-block/9") - 2693 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-var-in-nested-block/10") - 2694 (check-next-stream-line-equal _test-output-stream " ff 0/subop/increment *(ebp+0xfffffffc)" "F - test-convert-function-with-var-in-nested-block/11") - 2695 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-var-in-nested-block/12") - 2696 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-var-in-nested-block/13") - 2697 (check-next-stream-line-equal _test-output-stream "$foo:0x00000003:break:" "F - test-convert-function-with-var-in-nested-block/14") - 2698 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-var-in-nested-block/15") - 2699 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:break:" "F - test-convert-function-with-var-in-nested-block/16") - 2700 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-var-in-nested-block/17") - 2701 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-var-in-nested-block/18") - 2702 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-var-in-nested-block/19") - 2703 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-var-in-nested-block/20") - 2704 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-var-in-nested-block/21") - 2705 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-var-in-nested-block/22") - 2706 # . epilogue - 2707 89/<- %esp 5/r32/ebp - 2708 5d/pop-to-ebp - 2709 c3/return - 2710 - 2711 test-convert-function-with-multiple-vars-in-nested-blocks: - 2712 # . prologue - 2713 55/push-ebp - 2714 89/<- %ebp 4/r32/esp - 2715 # setup - 2716 (clear-stream _test-input-stream) - 2717 (clear-stream $_test-input-buffered-file->buffer) - 2718 (clear-stream _test-output-stream) - 2719 (clear-stream $_test-output-buffered-file->buffer) - 2720 # - 2721 (write _test-input-stream "fn foo x: int {\n") - 2722 (write _test-input-stream " {\n") - 2723 (write _test-input-stream " var x/eax: int <- copy 0\n") - 2724 (write _test-input-stream " {\n") - 2725 (write _test-input-stream " var y: int\n") - 2726 (write _test-input-stream " x <- add y\n") - 2727 (write _test-input-stream " }\n") - 2728 (write _test-input-stream " }\n") - 2729 (write _test-input-stream "}\n") - 2730 # convert - 2731 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 2732 (flush _test-output-buffered-file) - 2733 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 2739 # check output - 2740 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-multiple-vars-in-nested-blocks/0") - 2741 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-multiple-vars-in-nested-blocks/1") - 2742 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-multiple-vars-in-nested-blocks/2") - 2743 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-multiple-vars-in-nested-blocks/3") - 2744 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-multiple-vars-in-nested-blocks/4") - 2745 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-multiple-vars-in-nested-blocks/5") - 2746 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-multiple-vars-in-nested-blocks/6") - 2747 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:loop:" "F - test-convert-function-with-multiple-vars-in-nested-blocks/7") - 2748 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-function-with-multiple-vars-in-nested-blocks/8") - 2749 (check-next-stream-line-equal _test-output-stream " b8/copy-to-eax 0/imm32" "F - test-convert-function-with-multiple-vars-in-nested-blocks/9") - 2750 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-multiple-vars-in-nested-blocks/10") - 2751 (check-next-stream-line-equal _test-output-stream "$foo:0x00000003:loop:" "F - test-convert-function-with-multiple-vars-in-nested-blocks/11") - 2752 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-multiple-vars-in-nested-blocks/12") - 2753 (check-next-stream-line-equal _test-output-stream " 03/add *(ebp+0xfffffff8) 0x00000000/r32" "F - test-convert-function-with-multiple-vars-in-nested-blocks/13") - 2754 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-multiple-vars-in-nested-blocks/14") - 2755 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-multiple-vars-in-nested-blocks/15") - 2756 (check-next-stream-line-equal _test-output-stream "$foo:0x00000003:break:" "F - test-convert-function-with-multiple-vars-in-nested-blocks/16") - 2757 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-function-with-multiple-vars-in-nested-blocks/17") - 2758 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-multiple-vars-in-nested-blocks/18") - 2759 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:break:" "F - test-convert-function-with-multiple-vars-in-nested-blocks/19") - 2760 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-multiple-vars-in-nested-blocks/20") - 2761 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-multiple-vars-in-nested-blocks/21") - 2762 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-multiple-vars-in-nested-blocks/22") - 2763 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-multiple-vars-in-nested-blocks/23") - 2764 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-multiple-vars-in-nested-blocks/24") - 2765 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-multiple-vars-in-nested-blocks/25") - 2766 # . epilogue - 2767 89/<- %esp 5/r32/ebp - 2768 5d/pop-to-ebp - 2769 c3/return - 2770 - 2771 test-convert-function-with-branches-and-local-vars: - 2772 # A conditional 'break' after a 'var' in a block is converted into a - 2773 # nested block that performs all necessary cleanup before jumping. This - 2774 # results in some ugly code duplication. - 2775 # . prologue - 2776 55/push-ebp - 2777 89/<- %ebp 4/r32/esp - 2778 # setup - 2779 (clear-stream _test-input-stream) - 2780 (clear-stream $_test-input-buffered-file->buffer) - 2781 (clear-stream _test-output-stream) - 2782 (clear-stream $_test-output-buffered-file->buffer) - 2783 # - 2784 (write _test-input-stream "fn foo {\n") - 2785 (write _test-input-stream " {\n") - 2786 (write _test-input-stream " var x: int\n") - 2787 (write _test-input-stream " break-if->=\n") - 2788 (write _test-input-stream " increment x\n") - 2789 (write _test-input-stream " }\n") - 2790 (write _test-input-stream "}\n") - 2791 # convert - 2792 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 2793 (flush _test-output-buffered-file) - 2794 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 2800 # check output - 2801 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-branches-and-local-vars/0") - 2802 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-branches-and-local-vars/1") - 2803 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-branches-and-local-vars/2") - 2804 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-branches-and-local-vars/3") - 2805 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-branches-and-local-vars/4") - 2806 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-branches-and-local-vars/5") - 2807 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-branches-and-local-vars/6") - 2808 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:loop:" "F - test-convert-function-with-branches-and-local-vars/7") - 2809 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-branches-and-local-vars/8") - 2810 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-branches-and-local-vars/9") - 2811 (check-next-stream-line-equal _test-output-stream " 0f 8c/jump-if-< break/disp32" "F - test-convert-function-with-branches-and-local-vars/10") - 2812 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-branches-and-local-vars/11") - 2813 (check-next-stream-line-equal _test-output-stream " e9/jump $foo:0x00000002:break/disp32" "F - test-convert-function-with-branches-and-local-vars/12") - 2814 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-branches-and-local-vars/13") - 2815 (check-next-stream-line-equal _test-output-stream " ff 0/subop/increment *(ebp+0xfffffffc)" "F - test-convert-function-with-branches-and-local-vars/14") - 2816 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-branches-and-local-vars/15") - 2817 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-branches-and-local-vars/16") - 2818 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:break:" "F - test-convert-function-with-branches-and-local-vars/17") - 2819 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-branches-and-local-vars/18") - 2820 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-branches-and-local-vars/19") - 2821 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-branches-and-local-vars/20") - 2822 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-branches-and-local-vars/21") - 2823 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-branches-and-local-vars/22") - 2824 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-branches-and-local-vars/23") - 2825 # . epilogue - 2826 89/<- %esp 5/r32/ebp - 2827 5d/pop-to-ebp - 2828 c3/return - 2829 - 2830 test-convert-function-with-conditional-loops-and-local-vars: - 2831 # A conditional 'loop' after a 'var' in a block is converted into a nested - 2832 # block that performs all necessary cleanup before jumping. This results - 2833 # in some ugly code duplication. - 2834 # . prologue - 2835 55/push-ebp - 2836 89/<- %ebp 4/r32/esp - 2837 # setup - 2838 (clear-stream _test-input-stream) - 2839 (clear-stream $_test-input-buffered-file->buffer) - 2840 (clear-stream _test-output-stream) - 2841 (clear-stream $_test-output-buffered-file->buffer) - 2842 # - 2843 (write _test-input-stream "fn foo {\n") - 2844 (write _test-input-stream " {\n") - 2845 (write _test-input-stream " var x: int\n") - 2846 (write _test-input-stream " loop-if->=\n") - 2847 (write _test-input-stream " increment x\n") - 2848 (write _test-input-stream " }\n") - 2849 (write _test-input-stream "}\n") - 2850 # convert - 2851 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 2852 (flush _test-output-buffered-file) - 2853 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 2859 # check output - 2860 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-conditional-loops-and-local-vars/0") - 2861 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-conditional-loops-and-local-vars/1") - 2862 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-conditional-loops-and-local-vars/2") - 2863 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-conditional-loops-and-local-vars/3") - 2864 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-conditional-loops-and-local-vars/4") - 2865 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-conditional-loops-and-local-vars/5") - 2866 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-conditional-loops-and-local-vars/6") - 2867 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:loop:" "F - test-convert-function-with-conditional-loops-and-local-vars/7") - 2868 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-conditional-loops-and-local-vars/8") - 2869 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-conditional-loops-and-local-vars/9") - 2870 (check-next-stream-line-equal _test-output-stream " 0f 8c/jump-if-< break/disp32" "F - test-convert-function-with-conditional-loops-and-local-vars/10") - 2871 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-conditional-loops-and-local-vars/11") - 2872 (check-next-stream-line-equal _test-output-stream " e9/jump $foo:0x00000002:loop/disp32" "F - test-convert-function-with-conditional-loops-and-local-vars/12") - 2873 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-conditional-loops-and-local-vars/13") - 2874 (check-next-stream-line-equal _test-output-stream " ff 0/subop/increment *(ebp+0xfffffffc)" "F - test-convert-function-with-conditional-loops-and-local-vars/14") - 2875 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-conditional-loops-and-local-vars/15") - 2876 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-conditional-loops-and-local-vars/16") - 2877 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:break:" "F - test-convert-function-with-conditional-loops-and-local-vars/17") - 2878 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-conditional-loops-and-local-vars/18") - 2879 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-conditional-loops-and-local-vars/19") - 2880 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-conditional-loops-and-local-vars/20") - 2881 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-conditional-loops-and-local-vars/21") - 2882 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-conditional-loops-and-local-vars/22") - 2883 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-conditional-loops-and-local-vars/23") - 2884 # . epilogue - 2885 89/<- %esp 5/r32/ebp - 2886 5d/pop-to-ebp - 2887 c3/return - 2888 - 2889 test-convert-function-with-unconditional-loops-and-local-vars: - 2890 # An unconditional 'loop' after a 'var' in a block is emitted _after_ the - 2891 # regular block cleanup. Any instructions after 'loop' are dead and - 2892 # therefore skipped. - 2893 # . prologue - 2894 55/push-ebp - 2895 89/<- %ebp 4/r32/esp - 2896 # setup - 2897 (clear-stream _test-input-stream) - 2898 (clear-stream $_test-input-buffered-file->buffer) - 2899 (clear-stream _test-output-stream) - 2900 (clear-stream $_test-output-buffered-file->buffer) - 2901 # - 2902 (write _test-input-stream "fn foo {\n") - 2903 (write _test-input-stream " {\n") - 2904 (write _test-input-stream " var x: int\n") - 2905 (write _test-input-stream " loop\n") - 2906 (write _test-input-stream " increment x\n") - 2907 (write _test-input-stream " }\n") - 2908 (write _test-input-stream "}\n") - 2909 # convert - 2910 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 2911 (flush _test-output-buffered-file) - 2912 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 2918 # check output - 2919 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-unconditional-loops-and-local-vars/0") - 2920 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-unconditional-loops-and-local-vars/1") - 2921 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-unconditional-loops-and-local-vars/2") - 2922 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-unconditional-loops-and-local-vars/3") - 2923 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-unconditional-loops-and-local-vars/4") - 2924 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-unconditional-loops-and-local-vars/5") - 2925 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-unconditional-loops-and-local-vars/6") - 2926 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:loop:" "F - test-convert-function-with-unconditional-loops-and-local-vars/7") - 2927 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-unconditional-loops-and-local-vars/8") - 2928 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-unconditional-loops-and-local-vars/9") - 2929 (check-next-stream-line-equal _test-output-stream " e9/jump loop/disp32" "F - test-convert-function-with-unconditional-loops-and-local-vars/10") - 2930 # not emitted: ff 0/subop/increment *(ebp+0xfffffffc) - 2931 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-unconditional-loops-and-local-vars/11") - 2932 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:break:" "F - test-convert-function-with-unconditional-loops-and-local-vars/12") - 2933 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-unconditional-loops-and-local-vars/13") - 2934 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-unconditional-loops-and-local-vars/14") - 2935 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-unconditional-loops-and-local-vars/15") - 2936 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-unconditional-loops-and-local-vars/16") - 2937 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-unconditional-loops-and-local-vars/17") - 2938 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-unconditional-loops-and-local-vars/18") - 2939 # . epilogue - 2940 89/<- %esp 5/r32/ebp - 2941 5d/pop-to-ebp - 2942 c3/return - 2943 - 2944 test-convert-function-with-branches-and-loops-and-local-vars: - 2945 # . prologue - 2946 55/push-ebp - 2947 89/<- %ebp 4/r32/esp - 2948 # setup - 2949 (clear-stream _test-input-stream) - 2950 (clear-stream $_test-input-buffered-file->buffer) - 2951 (clear-stream _test-output-stream) - 2952 (clear-stream $_test-output-buffered-file->buffer) - 2953 # - 2954 (write _test-input-stream "fn foo {\n") - 2955 (write _test-input-stream " {\n") - 2956 (write _test-input-stream " var x: int\n") - 2957 (write _test-input-stream " break-if->=\n") - 2958 (write _test-input-stream " increment x\n") - 2959 (write _test-input-stream " loop\n") - 2960 (write _test-input-stream " }\n") - 2961 (write _test-input-stream "}\n") - 2962 # convert - 2963 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 2964 (flush _test-output-buffered-file) - 2965 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 2971 # check output - 2972 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-branches-and-loops-and-local-vars/0") - 2973 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-branches-and-loops-and-local-vars/1") - 2974 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-branches-and-loops-and-local-vars/2") - 2975 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-branches-and-loops-and-local-vars/3") - 2976 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-branches-and-loops-and-local-vars/4") - 2977 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-branches-and-loops-and-local-vars/5") - 2978 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-branches-and-loops-and-local-vars/6") - 2979 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:loop:" "F - test-convert-function-with-branches-and-loops-and-local-vars/7") - 2980 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-branches-and-loops-and-local-vars/8") - 2981 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-branches-and-loops-and-local-vars/9") - 2982 (check-next-stream-line-equal _test-output-stream " 0f 8c/jump-if-< break/disp32" "F - test-convert-function-with-branches-and-loops-and-local-vars/10") - 2983 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-branches-and-loops-and-local-vars/11") - 2984 (check-next-stream-line-equal _test-output-stream " e9/jump $foo:0x00000002:break/disp32" "F - test-convert-function-with-branches-and-loops-and-local-vars/12") - 2985 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-branches-and-loops-and-local-vars/13") - 2986 (check-next-stream-line-equal _test-output-stream " ff 0/subop/increment *(ebp+0xfffffffc)" "F - test-convert-function-with-branches-and-loops-and-local-vars/14") - 2987 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-branches-and-loops-and-local-vars/15") - 2988 (check-next-stream-line-equal _test-output-stream " e9/jump loop/disp32" "F - test-convert-function-with-branches-and-loops-and-local-vars/16") - 2989 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-branches-and-loops-and-local-vars/17") - 2990 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:break:" "F - test-convert-function-with-branches-and-loops-and-local-vars/18") - 2991 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-branches-and-loops-and-local-vars/19") - 2992 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-branches-and-loops-and-local-vars/20") - 2993 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-branches-and-loops-and-local-vars/21") - 2994 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-branches-and-loops-and-local-vars/22") - 2995 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-branches-and-loops-and-local-vars/23") - 2996 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-branches-and-loops-and-local-vars/24") - 2997 # . epilogue - 2998 89/<- %esp 5/r32/ebp - 2999 5d/pop-to-ebp - 3000 c3/return - 3001 - 3002 test-convert-function-with-nonlocal-branches-and-loops-and-local-vars: - 3003 # . prologue - 3004 55/push-ebp - 3005 89/<- %ebp 4/r32/esp - 3006 # setup - 3007 (clear-stream _test-input-stream) - 3008 (clear-stream $_test-input-buffered-file->buffer) - 3009 (clear-stream _test-output-stream) - 3010 (clear-stream $_test-output-buffered-file->buffer) - 3011 # - 3012 (write _test-input-stream "fn foo {\n") - 3013 (write _test-input-stream " a: {\n") - 3014 (write _test-input-stream " var x: int\n") - 3015 (write _test-input-stream " {\n") - 3016 (write _test-input-stream " var y: int\n") - 3017 (write _test-input-stream " break-if->= a\n") - 3018 (write _test-input-stream " increment x\n") - 3019 (write _test-input-stream " loop\n") - 3020 (write _test-input-stream " }\n") - 3021 (write _test-input-stream " }\n") - 3022 (write _test-input-stream "}\n") - 3023 # convert - 3024 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 3025 (flush _test-output-buffered-file) - 3026 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 3032 # check output - 3033 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/0") - 3034 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/1") - 3035 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/2") - 3036 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/3") - 3037 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/4") - 3038 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/5") - 3039 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/6") - 3040 (check-next-stream-line-equal _test-output-stream "a:loop:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/7") - 3041 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/8") - 3042 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/9") - 3043 (check-next-stream-line-equal _test-output-stream "$foo:0x00000003:loop:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/10") - 3044 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/11") - 3045 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/12") - 3046 (check-next-stream-line-equal _test-output-stream " 0f 8c/jump-if-< break/disp32" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/13") - 3047 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/14") - 3048 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/15") - 3049 (check-next-stream-line-equal _test-output-stream " e9/jump a:break/disp32" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/16") - 3050 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/17") - 3051 (check-next-stream-line-equal _test-output-stream " ff 0/subop/increment *(ebp+0xfffffffc)" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/18") - 3052 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/19") - 3053 (check-next-stream-line-equal _test-output-stream " e9/jump loop/disp32" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/20") - 3054 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/21") - 3055 (check-next-stream-line-equal _test-output-stream "$foo:0x00000003:break:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/22") - 3056 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/23") - 3057 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/24") - 3058 (check-next-stream-line-equal _test-output-stream "a:break:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/25") - 3059 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/26") - 3060 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/27") - 3061 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/28") - 3062 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/29") - 3063 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/30") - 3064 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/31") - 3065 # . epilogue - 3066 89/<- %esp 5/r32/ebp - 3067 5d/pop-to-ebp - 3068 c3/return - 3069 - 3070 test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2: - 3071 # . prologue - 3072 55/push-ebp - 3073 89/<- %ebp 4/r32/esp - 3074 # setup - 3075 (clear-stream _test-input-stream) - 3076 (clear-stream $_test-input-buffered-file->buffer) - 3077 (clear-stream _test-output-stream) - 3078 (clear-stream $_test-output-buffered-file->buffer) - 3079 # non-local conditional branch from a block without a local variable, - 3080 # unwinding a local on the stack - 3081 (write _test-input-stream "fn foo {\n") - 3082 (write _test-input-stream " a: {\n") - 3083 (write _test-input-stream " var x: int\n") - 3084 (write _test-input-stream " {\n") - 3085 (write _test-input-stream " break-if->= a\n") - 3086 (write _test-input-stream " }\n") - 3087 (write _test-input-stream " }\n") - 3088 (write _test-input-stream "}\n") - 3089 # convert - 3090 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 3091 (flush _test-output-buffered-file) - 3092 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 3098 # check output - 3099 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/0") - 3100 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/1") - 3101 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/2") - 3102 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/3") - 3103 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/4") - 3104 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/5") - 3105 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/6") - 3106 (check-next-stream-line-equal _test-output-stream "a:loop:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/7") - 3107 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/8") - 3108 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/9") - 3109 (check-next-stream-line-equal _test-output-stream "$foo:0x00000003:loop:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/10") - 3110 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/11") - 3111 (check-next-stream-line-equal _test-output-stream " 0f 8c/jump-if-< break/disp32" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/12") - 3112 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/13") - 3113 (check-next-stream-line-equal _test-output-stream " e9/jump a:break/disp32" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/14") - 3114 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/15") - 3115 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/16") - 3116 (check-next-stream-line-equal _test-output-stream "$foo:0x00000003:break:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/17") - 3117 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/18") - 3118 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/19") - 3119 (check-next-stream-line-equal _test-output-stream "a:break:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/20") - 3120 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/21") - 3121 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/22") - 3122 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/23") - 3123 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/24") - 3124 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/25") - 3125 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/26") - 3126 # . epilogue - 3127 89/<- %esp 5/r32/ebp - 3128 5d/pop-to-ebp - 3129 c3/return - 3130 - 3131 test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3: - 3132 # . prologue - 3133 55/push-ebp - 3134 89/<- %ebp 4/r32/esp - 3135 # setup - 3136 (clear-stream _test-input-stream) - 3137 (clear-stream $_test-input-buffered-file->buffer) - 3138 (clear-stream _test-output-stream) - 3139 (clear-stream $_test-output-buffered-file->buffer) - 3140 # non-local unconditional branch from a block without a local variable, - 3141 # unwinding a local on the stack - 3142 (write _test-input-stream "fn foo {\n") - 3143 (write _test-input-stream " a: {\n") - 3144 (write _test-input-stream " var x: int\n") - 3145 (write _test-input-stream " {\n") - 3146 (write _test-input-stream " break a\n") - 3147 (write _test-input-stream " }\n") - 3148 (write _test-input-stream " }\n") - 3149 (write _test-input-stream "}\n") - 3150 # convert - 3151 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 3152 (flush _test-output-buffered-file) - 3153 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 3159 # check output - 3160 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/0") - 3161 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/1") - 3162 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/2") - 3163 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/3") - 3164 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/4") - 3165 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/5") - 3166 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/6") - 3167 (check-next-stream-line-equal _test-output-stream "a:loop:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/7") - 3168 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/8") - 3169 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/9") - 3170 (check-next-stream-line-equal _test-output-stream "$foo:0x00000003:loop:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/10") - 3171 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/11") - 3172 (check-next-stream-line-equal _test-output-stream " e9/jump a:break/disp32" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/12") - 3173 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/14") - 3174 (check-next-stream-line-equal _test-output-stream "$foo:0x00000003:break:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/15") - 3175 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/16") - 3176 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/17") - 3177 (check-next-stream-line-equal _test-output-stream "a:break:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/18") - 3178 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/19") - 3179 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/20") - 3180 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/21") - 3181 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/22") - 3182 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/23") - 3183 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/24") - 3184 # . epilogue - 3185 89/<- %esp 5/r32/ebp - 3186 5d/pop-to-ebp - 3187 c3/return - 3188 - 3189 test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4: - 3190 # . prologue - 3191 55/push-ebp - 3192 89/<- %ebp 4/r32/esp - 3193 # setup - 3194 (clear-stream _test-input-stream) - 3195 (clear-stream $_test-input-buffered-file->buffer) - 3196 (clear-stream _test-output-stream) - 3197 (clear-stream $_test-output-buffered-file->buffer) - 3198 # - 3199 (write _test-input-stream "fn foo {\n") - 3200 (write _test-input-stream " a: {\n") - 3201 (write _test-input-stream " var x/esi: int <- copy 0\n") - 3202 (write _test-input-stream " {\n") - 3203 (write _test-input-stream " break a\n") - 3204 (write _test-input-stream " }\n") - 3205 (write _test-input-stream " }\n") - 3206 (write _test-input-stream "}\n") - 3207 # convert - 3208 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 3209 (flush _test-output-buffered-file) - 3210 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 3216 # check output - 3217 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/0") - 3218 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/1") - 3219 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/2") - 3220 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/3") - 3221 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/4") - 3222 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/5") - 3223 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/6") - 3224 (check-next-stream-line-equal _test-output-stream "a:loop:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/7") - 3225 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %esi" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/8") - 3226 (check-next-stream-line-equal _test-output-stream " be/copy-to-esi 0/imm32" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/9") - 3227 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/10") - 3228 (check-next-stream-line-equal _test-output-stream "$foo:0x00000003:loop:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/11") - 3229 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %esi" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/12") - 3230 (check-next-stream-line-equal _test-output-stream " e9/jump a:break/disp32" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/13") - 3231 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/14") - 3232 (check-next-stream-line-equal _test-output-stream "$foo:0x00000003:break:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/15") - 3233 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %esi" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/16") - 3234 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/17") - 3235 (check-next-stream-line-equal _test-output-stream "a:break:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/18") - 3236 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/19") - 3237 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/20") - 3238 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/21") - 3239 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/22") - 3240 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/23") - 3241 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/24") - 3242 # . epilogue - 3243 89/<- %esp 5/r32/ebp - 3244 5d/pop-to-ebp - 3245 c3/return - 3246 - 3247 test-convert-function-with-nonlocal-unconditional-break-and-local-vars: - 3248 # . prologue - 3249 55/push-ebp - 3250 89/<- %ebp 4/r32/esp - 3251 # setup - 3252 (clear-stream _test-input-stream) - 3253 (clear-stream $_test-input-buffered-file->buffer) - 3254 (clear-stream _test-output-stream) - 3255 (clear-stream $_test-output-buffered-file->buffer) - 3256 # - 3257 (write _test-input-stream "fn foo {\n") - 3258 (write _test-input-stream " a: {\n") - 3259 (write _test-input-stream " var x: int\n") - 3260 (write _test-input-stream " {\n") - 3261 (write _test-input-stream " var y: int\n") - 3262 (write _test-input-stream " break a\n") - 3263 (write _test-input-stream " increment x\n") - 3264 (write _test-input-stream " }\n") - 3265 (write _test-input-stream " }\n") - 3266 (write _test-input-stream "}\n") - 3267 # convert - 3268 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 3269 (flush _test-output-buffered-file) - 3270 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 3276 # check output - 3277 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/0") - 3278 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/1") - 3279 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/2") - 3280 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/3") - 3281 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/4") - 3282 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/5") - 3283 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/6") - 3284 (check-next-stream-line-equal _test-output-stream "a:loop:" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/7") - 3285 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/8") - 3286 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/9") - 3287 (check-next-stream-line-equal _test-output-stream "$foo:0x00000003:loop:" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/10") - 3288 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/11") - 3289 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/12") - 3290 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/13") - 3291 (check-next-stream-line-equal _test-output-stream " e9/jump a:break/disp32" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/14") - 3292 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/15") - 3293 (check-next-stream-line-equal _test-output-stream "$foo:0x00000003:break:" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/16") - 3294 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/17") - 3295 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/18") - 3296 (check-next-stream-line-equal _test-output-stream "a:break:" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/19") - 3297 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/20") - 3298 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/21") - 3299 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/22") - 3300 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/23") - 3301 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/24") - 3302 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/25") - 3303 # . epilogue - 3304 89/<- %esp 5/r32/ebp - 3305 5d/pop-to-ebp - 3306 c3/return - 3307 - 3308 test-convert-function-with-unconditional-break-and-local-vars: - 3309 # . prologue - 3310 55/push-ebp - 3311 89/<- %ebp 4/r32/esp - 3312 # setup - 3313 (clear-stream _test-input-stream) - 3314 (clear-stream $_test-input-buffered-file->buffer) - 3315 (clear-stream _test-output-stream) - 3316 (clear-stream $_test-output-buffered-file->buffer) - 3317 # - 3318 (write _test-input-stream "fn foo {\n") - 3319 (write _test-input-stream " {\n") - 3320 (write _test-input-stream " var x: int\n") - 3321 (write _test-input-stream " {\n") - 3322 (write _test-input-stream " var y: int\n") - 3323 (write _test-input-stream " break\n") - 3324 (write _test-input-stream " increment x\n") - 3325 (write _test-input-stream " }\n") - 3326 (write _test-input-stream " }\n") - 3327 (write _test-input-stream "}\n") - 3328 # convert - 3329 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 3330 (flush _test-output-buffered-file) - 3331 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 3337 # check output - 3338 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-unconditional-break-and-local-vars/0") - 3339 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-unconditional-break-and-local-vars/1") - 3340 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-unconditional-break-and-local-vars/2") - 3341 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-unconditional-break-and-local-vars/3") - 3342 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-unconditional-break-and-local-vars/4") - 3343 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-unconditional-break-and-local-vars/5") - 3344 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-unconditional-break-and-local-vars/6") - 3345 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:loop:" "F - test-convert-function-with-unconditional-break-and-local-vars/7") - 3346 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-unconditional-break-and-local-vars/8") - 3347 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-unconditional-break-and-local-vars/9") - 3348 (check-next-stream-line-equal _test-output-stream "$foo:0x00000003:loop:" "F - test-convert-function-with-unconditional-break-and-local-vars/10") - 3349 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-unconditional-break-and-local-vars/11") - 3350 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-unconditional-break-and-local-vars/12") - 3351 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-unconditional-break-and-local-vars/13") - 3352 (check-next-stream-line-equal _test-output-stream "$foo:0x00000003:break:" "F - test-convert-function-with-unconditional-break-and-local-vars/14") - 3353 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-unconditional-break-and-local-vars/15") - 3354 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-unconditional-break-and-local-vars/16") - 3355 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:break:" "F - test-convert-function-with-unconditional-break-and-local-vars/17") - 3356 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-unconditional-break-and-local-vars/18") - 3357 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-unconditional-break-and-local-vars/19") - 3358 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-unconditional-break-and-local-vars/20") - 3359 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-unconditional-break-and-local-vars/21") - 3360 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-unconditional-break-and-local-vars/22") - 3361 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-unconditional-break-and-local-vars/23") - 3362 # . epilogue - 3363 89/<- %esp 5/r32/ebp - 3364 5d/pop-to-ebp - 3365 c3/return - 3366 - 3367 test-convert-function-with-nonlocal-unconditional-loop-and-local-vars: - 3368 # . prologue - 3369 55/push-ebp - 3370 89/<- %ebp 4/r32/esp - 3371 # setup - 3372 (clear-stream _test-input-stream) - 3373 (clear-stream $_test-input-buffered-file->buffer) - 3374 (clear-stream _test-output-stream) - 3375 (clear-stream $_test-output-buffered-file->buffer) - 3376 # - 3377 (write _test-input-stream "fn foo {\n") - 3378 (write _test-input-stream " a: {\n") - 3379 (write _test-input-stream " var x: int\n") - 3380 (write _test-input-stream " {\n") - 3381 (write _test-input-stream " var y: int\n") - 3382 (write _test-input-stream " loop a\n") - 3383 (write _test-input-stream " increment x\n") - 3384 (write _test-input-stream " }\n") - 3385 (write _test-input-stream " }\n") - 3386 (write _test-input-stream "}\n") - 3387 # convert - 3388 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 3389 (flush _test-output-buffered-file) - 3390 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 3396 # check output - 3397 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/0") - 3398 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/1") - 3399 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/2") - 3400 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/3") - 3401 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/4") - 3402 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/5") - 3403 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/6") - 3404 (check-next-stream-line-equal _test-output-stream "a:loop:" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/7") - 3405 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/8") - 3406 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/9") - 3407 (check-next-stream-line-equal _test-output-stream "$foo:0x00000003:loop:" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/10") - 3408 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/11") - 3409 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/12") - 3410 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/13") - 3411 (check-next-stream-line-equal _test-output-stream " e9/jump a:loop/disp32" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/14") - 3412 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/15") - 3413 (check-next-stream-line-equal _test-output-stream "$foo:0x00000003:break:" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/16") - 3414 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/17") - 3415 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/18") - 3416 (check-next-stream-line-equal _test-output-stream "a:break:" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/19") - 3417 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/20") - 3418 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/21") - 3419 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/22") - 3420 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/23") - 3421 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/24") - 3422 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/25") - 3423 # . epilogue - 3424 89/<- %esp 5/r32/ebp - 3425 5d/pop-to-ebp - 3426 c3/return - 3427 - 3428 test-convert-function-with-local-array-var-in-mem: - 3429 # . prologue - 3430 55/push-ebp - 3431 89/<- %ebp 4/r32/esp - 3432 # setup - 3433 (clear-stream _test-input-stream) - 3434 (clear-stream $_test-input-buffered-file->buffer) - 3435 (clear-stream _test-output-stream) - 3436 (clear-stream $_test-output-buffered-file->buffer) - 3437 # - 3438 (write _test-input-stream "fn foo {\n") - 3439 (write _test-input-stream " var x: (array int 3)\n") - 3440 (write _test-input-stream "}\n") - 3441 # convert - 3442 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 3443 (flush _test-output-buffered-file) - 3444 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 3450 # check output - 3451 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-local-array-var-in-mem/0") - 3452 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-local-array-var-in-mem/1") - 3453 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-local-array-var-in-mem/2") - 3454 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-local-array-var-in-mem/3") - 3455 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-local-array-var-in-mem/4") - 3456 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-local-array-var-in-mem/5") - 3457 # define x - 3458 (check-next-stream-line-equal _test-output-stream " (push-n-zero-bytes 0x0000000c)" "F - test-convert-function-with-local-array-var-in-mem/7") - 3459 (check-next-stream-line-equal _test-output-stream " 68/push 0x0000000c/imm32" "F - test-convert-function-with-local-array-var-in-mem/8") - 3460 # reclaim x - 3461 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000010/imm32" "F - test-convert-function-with-local-array-var-in-mem/9") - 3462 # - 3463 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-local-array-var-in-mem/10") - 3464 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-local-array-var-in-mem/11") - 3465 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-local-array-var-in-mem/12") - 3466 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-local-array-var-in-mem/13") - 3467 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-local-array-var-in-mem/14") - 3468 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-local-array-var-in-mem/15") - 3469 # . epilogue - 3470 89/<- %esp 5/r32/ebp - 3471 5d/pop-to-ebp - 3472 c3/return - 3473 - 3474 # special-case for size(byte) when allocating array - 3475 test-convert-function-with-local-array-of-bytes-in-mem: - 3476 # . prologue - 3477 55/push-ebp - 3478 89/<- %ebp 4/r32/esp - 3479 # setup - 3480 (clear-stream _test-input-stream) - 3481 (clear-stream $_test-input-buffered-file->buffer) - 3482 (clear-stream _test-output-stream) - 3483 (clear-stream $_test-output-buffered-file->buffer) - 3484 # - 3485 (write _test-input-stream "fn foo {\n") - 3486 (write _test-input-stream " var x: (array byte 3)\n") - 3487 (write _test-input-stream "}\n") - 3488 # convert - 3489 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 3490 (flush _test-output-buffered-file) - 3491 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 3497 # check output - 3498 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-local-array-of-bytes-in-mem/0") - 3499 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-local-array-of-bytes-in-mem/1") - 3500 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-local-array-of-bytes-in-mem/2") - 3501 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-local-array-of-bytes-in-mem/3") - 3502 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-local-array-of-bytes-in-mem/4") - 3503 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-local-array-of-bytes-in-mem/5") - 3504 # define x - 3505 (check-next-stream-line-equal _test-output-stream " (push-n-zero-bytes 0x00000003)" "F - test-convert-function-with-local-array-of-bytes-in-mem/7") - 3506 (check-next-stream-line-equal _test-output-stream " 68/push 0x00000003/imm32" "F - test-convert-function-with-local-array-of-bytes-in-mem/8") - 3507 # reclaim x - 3508 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000007/imm32" "F - test-convert-function-with-local-array-of-bytes-in-mem/9") - 3509 # - 3510 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-local-array-of-bytes-in-mem/10") - 3511 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-local-array-of-bytes-in-mem/11") - 3512 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-local-array-of-bytes-in-mem/12") - 3513 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-local-array-of-bytes-in-mem/13") - 3514 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-local-array-of-bytes-in-mem/14") - 3515 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-local-array-of-bytes-in-mem/15") - 3516 # . epilogue - 3517 89/<- %esp 5/r32/ebp - 3518 5d/pop-to-ebp - 3519 c3/return - 3520 - 3521 test-convert-address: - 3522 # . prologue - 3523 55/push-ebp - 3524 89/<- %ebp 4/r32/esp - 3525 # setup - 3526 (clear-stream _test-input-stream) - 3527 (clear-stream $_test-input-buffered-file->buffer) - 3528 (clear-stream _test-output-stream) - 3529 (clear-stream $_test-output-buffered-file->buffer) - 3530 # - 3531 (write _test-input-stream "fn foo {\n") - 3532 (write _test-input-stream " var a: int\n") - 3533 (write _test-input-stream " var b/eax: (addr int) <- address a\n") - 3534 (write _test-input-stream "}\n") - 3535 # convert - 3536 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 3537 (flush _test-output-buffered-file) - 3538 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 3544 # check output - 3545 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-address/0") - 3546 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-address/1") - 3547 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-address/2") - 3548 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-address/3") - 3549 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-address/4") - 3550 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-address/5") - 3551 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-address/6") - 3552 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-address/7") - 3553 (check-next-stream-line-equal _test-output-stream " 8d/copy-address *(ebp+0xfffffffc) 0x00000000/r32" "F - test-convert-address/8") - 3554 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-address/9") - 3555 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-address/10") - 3556 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-address/11") - 3557 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-address/12") - 3558 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-address/13") - 3559 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-address/14") - 3560 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-address/15") - 3561 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-address/16") - 3562 # . epilogue - 3563 89/<- %esp 5/r32/ebp - 3564 5d/pop-to-ebp - 3565 c3/return - 3566 - 3567 test-convert-length-of-array: - 3568 # . prologue - 3569 55/push-ebp - 3570 89/<- %ebp 4/r32/esp - 3571 # setup - 3572 (clear-stream _test-input-stream) - 3573 (clear-stream $_test-input-buffered-file->buffer) - 3574 (clear-stream _test-output-stream) - 3575 (clear-stream $_test-output-buffered-file->buffer) - 3576 # - 3577 (write _test-input-stream "fn foo a: (addr array int) {\n") - 3578 (write _test-input-stream " var b/eax: (addr array int) <- copy a\n") - 3579 (write _test-input-stream " var c/eax: int <- length b\n") - 3580 (write _test-input-stream "}\n") - 3581 # convert - 3582 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 3583 (flush _test-output-buffered-file) - 3584 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 3590 # check output - 3591 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-length-of-array/0") - 3592 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-length-of-array/1") - 3593 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-length-of-array/2") - 3594 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-length-of-array/3") - 3595 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-length-of-array/4") - 3596 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-length-of-array/5") - 3597 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-length-of-array/6") - 3598 (check-next-stream-line-equal _test-output-stream " 8b/-> *(ebp+0x00000008) 0x00000000/r32" "F - test-convert-length-of-array/7") - 3599 (check-next-stream-line-equal _test-output-stream " 8b/-> *eax 0x00000000/r32" "F - test-convert-length-of-array/8") - 3600 (check-next-stream-line-equal _test-output-stream " c1/shift 5/subop/>> %eax 0x00000002/imm8" "F - test-convert-length-of-array/9") - 3601 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-length-of-array/10") - 3602 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-length-of-array/11") - 3603 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-length-of-array/12") - 3604 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-length-of-array/13") - 3605 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-length-of-array/14") - 3606 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-length-of-array/15") - 3607 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-length-of-array/16") - 3608 # . epilogue - 3609 89/<- %esp 5/r32/ebp - 3610 5d/pop-to-ebp - 3611 c3/return - 3612 - 3613 # special-case for size(byte) when computing array length - 3614 test-convert-length-of-array-of-bytes: - 3615 # . prologue - 3616 55/push-ebp - 3617 89/<- %ebp 4/r32/esp - 3618 # setup - 3619 (clear-stream _test-input-stream) - 3620 (clear-stream $_test-input-buffered-file->buffer) - 3621 (clear-stream _test-output-stream) - 3622 (clear-stream $_test-output-buffered-file->buffer) - 3623 # - 3624 (write _test-input-stream "fn foo a: (addr array byte) {\n") - 3625 (write _test-input-stream " var b/eax: (addr array byte) <- copy a\n") - 3626 (write _test-input-stream " var c/eax: int <- length b\n") - 3627 (write _test-input-stream "}\n") - 3628 # convert - 3629 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 3630 (flush _test-output-buffered-file) - 3631 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 3637 # check output - 3638 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-length-of-array-of-bytes/0") - 3639 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-length-of-array-of-bytes/1") - 3640 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-length-of-array-of-bytes/2") - 3641 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-length-of-array-of-bytes/3") - 3642 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-length-of-array-of-bytes/4") - 3643 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-length-of-array-of-bytes/5") - 3644 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-length-of-array-of-bytes/6") - 3645 (check-next-stream-line-equal _test-output-stream " 8b/-> *(ebp+0x00000008) 0x00000000/r32" "F - test-convert-length-of-array-of-bytes/7") - 3646 (check-next-stream-line-equal _test-output-stream " 8b/-> *eax 0x00000000/r32" "F - test-convert-length-of-array-of-bytes/8") - 3647 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-length-of-array-of-bytes/9") - 3648 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-length-of-array-of-bytes/10") - 3649 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-length-of-array-of-bytes/11") - 3650 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-length-of-array-of-bytes/12") - 3651 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-length-of-array-of-bytes/13") - 3652 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-length-of-array-of-bytes/14") - 3653 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-length-of-array-of-bytes/15") - 3654 # . epilogue - 3655 89/<- %esp 5/r32/ebp - 3656 5d/pop-to-ebp - 3657 c3/return - 3658 - 3659 test-convert-length-of-array-on-stack: - 3660 # . prologue - 3661 55/push-ebp - 3662 89/<- %ebp 4/r32/esp - 3663 # setup - 3664 (clear-stream _test-input-stream) - 3665 (clear-stream $_test-input-buffered-file->buffer) - 3666 (clear-stream _test-output-stream) - 3667 (clear-stream $_test-output-buffered-file->buffer) - 3668 # - 3669 (write _test-input-stream "fn foo {\n") - 3670 (write _test-input-stream " var a: (array int 3)\n") - 3671 (write _test-input-stream " var b/eax: int <- length a\n") - 3672 (write _test-input-stream "}\n") - 3673 # convert - 3674 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 3675 (flush _test-output-buffered-file) - 3676 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 3682 # check output - 3683 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-length-of-array-on-stack/0") - 3684 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-length-of-array-on-stack/1") - 3685 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-length-of-array-on-stack/2") - 3686 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-length-of-array-on-stack/3") - 3687 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-length-of-array-on-stack/4") - 3688 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-length-of-array-on-stack/5") - 3689 # define x - 3690 (check-next-stream-line-equal _test-output-stream " (push-n-zero-bytes 0x0000000c)" "F - test-convert-length-of-array-on-stack/6") - 3691 (check-next-stream-line-equal _test-output-stream " 68/push 0x0000000c/imm32" "F - test-convert-length-of-array-on-stack/7") - 3692 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-length-of-array-on-stack/8") - 3693 (check-next-stream-line-equal _test-output-stream " 8b/-> *(ebp+0xfffffff0) 0x00000000/r32" "F - test-convert-length-of-array-on-stack/9") - 3694 (check-next-stream-line-equal _test-output-stream " c1/shift 5/subop/>> %eax 0x00000002/imm8" "F - test-convert-length-of-array-on-stack/10") - 3695 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-length-of-array-on-stack/11") - 3696 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000010/imm32" "F - test-convert-length-of-array-on-stack/12") - 3697 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-length-of-array-on-stack/13") - 3698 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-length-of-array-on-stack/14") - 3699 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-length-of-array-on-stack/15") - 3700 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-length-of-array-on-stack/16") - 3701 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-length-of-array-on-stack/17") - 3702 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-length-of-array-on-stack/18") + 2307 (write _test-input-stream "fn foo {\n") + 2308 (write _test-input-stream " var x/eax: int <- copy 3\n") + 2309 (write _test-input-stream " var y/ecx: int <- copy 4\n") + 2310 (write _test-input-stream " y <- increment\n") + 2311 (write _test-input-stream "}\n") + 2312 # convert + 2313 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 2314 (flush _test-output-buffered-file) + 2315 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 2321 # check output + 2322 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-spill-different-register-in-block/0") + 2323 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-spill-different-register-in-block/1") + 2324 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-spill-different-register-in-block/2") + 2325 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-spill-different-register-in-block/3") + 2326 (check-next-stream-line-equal _test-output-stream " {" "F - test-spill-different-register-in-block/4") + 2327 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-spill-different-register-in-block/5") + 2328 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-spill-different-register-in-block/6") + 2329 (check-next-stream-line-equal _test-output-stream " b8/copy-to-eax 3/imm32" "F - test-spill-different-register-in-block/7") + 2330 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-spill-different-register-in-block/8") + 2331 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 4/imm32" "F - test-spill-different-register-in-block/9") + 2332 (check-next-stream-line-equal _test-output-stream " 41/increment-ecx" "F - test-spill-different-register-in-block/10") + 2333 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-spill-different-register-in-block/11") + 2334 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-spill-different-register-in-block/12") + 2335 (check-next-stream-line-equal _test-output-stream " }" "F - test-spill-different-register-in-block/13") + 2336 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-spill-different-register-in-block/14") + 2337 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-spill-different-register-in-block/15") + 2338 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-spill-different-register-in-block/16") + 2339 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-spill-different-register-in-block/17") + 2340 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-spill-different-register-in-block/18") + 2341 # . epilogue + 2342 89/<- %esp 5/r32/ebp + 2343 5d/pop-to-ebp + 2344 c3/return + 2345 + 2346 test-shadow-live-output: + 2347 # . prologue + 2348 55/push-ebp + 2349 89/<- %ebp 4/r32/esp + 2350 # setup + 2351 (clear-stream _test-input-stream) + 2352 (clear-stream $_test-input-buffered-file->buffer) + 2353 (clear-stream _test-output-stream) + 2354 (clear-stream $_test-output-buffered-file->buffer) + 2355 # + 2356 (write _test-input-stream "fn foo -> x/ecx: int {\n") + 2357 (write _test-input-stream " x <- copy 3\n") + 2358 (write _test-input-stream " {\n") + 2359 (write _test-input-stream " var y/ecx: int <- copy 4\n") + 2360 (write _test-input-stream " }\n") + 2361 (write _test-input-stream " x <- increment\n") + 2362 (write _test-input-stream "}\n") + 2363 # convert + 2364 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 2365 (flush _test-output-buffered-file) + 2366 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 2372 # check output + 2373 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-shadow-live-output/0") + 2374 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-shadow-live-output/1") + 2375 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-shadow-live-output/2") + 2376 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-shadow-live-output/3") + 2377 (check-next-stream-line-equal _test-output-stream " {" "F - test-shadow-live-output/4") + 2378 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-shadow-live-output/5") + 2379 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 3/imm32" "F - test-shadow-live-output/7") # no push because it's an output reg + 2380 (check-next-stream-line-equal _test-output-stream " {" "F - test-shadow-live-output/8") + 2381 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:loop:" "F - test-shadow-live-output/9") + 2382 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-shadow-live-output/10") + 2383 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 4/imm32" "F - test-shadow-live-output/11") + 2384 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-shadow-live-output/12") + 2385 (check-next-stream-line-equal _test-output-stream " }" "F - test-shadow-live-output/13") + 2386 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:break:" "F - test-shadow-live-output/14") + 2387 (check-next-stream-line-equal _test-output-stream " 41/increment-ecx" "F - test-shadow-live-output/15") + 2388 (check-next-stream-line-equal _test-output-stream " }" "F - test-shadow-live-output/17") + 2389 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-shadow-live-output/18") + 2390 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-shadow-live-output/19") + 2391 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-shadow-live-output/20") + 2392 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-shadow-live-output/21") + 2393 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-shadow-live-output/21") + 2394 # . epilogue + 2395 89/<- %esp 5/r32/ebp + 2396 5d/pop-to-ebp + 2397 c3/return + 2398 + 2399 test-stmt-defines-output-in-same-register-as-inout: + 2400 # . prologue + 2401 55/push-ebp + 2402 89/<- %ebp 4/r32/esp + 2403 # setup + 2404 (clear-stream _test-input-stream) + 2405 (clear-stream $_test-input-buffered-file->buffer) + 2406 (clear-stream _test-output-stream) + 2407 (clear-stream $_test-output-buffered-file->buffer) + 2408 (clear-stream _test-error-stream) + 2409 (clear-stream $_test-error-buffered-file->buffer) + 2410 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) + 2411 68/push 0/imm32 + 2412 68/push 0/imm32 + 2413 89/<- %edx 4/r32/esp + 2414 (tailor-exit-descriptor %edx 0x10) + 2415 # + 2416 (write _test-input-stream "fn foo -> x/ecx: int {\n") + 2417 (write _test-input-stream " var y/ecx: int <- copy 4\n") + 2418 (write _test-input-stream " x <- copy y\n") # writing to a fn output is currently the only way for a statement to define a new var + 2419 (write _test-input-stream "}\n") + 2420 # convert + 2421 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) + 2422 # registers except esp clobbered at this point + 2423 # restore ed + 2424 89/<- %edx 4/r32/esp + 2425 (flush _test-output-buffered-file) + 2426 (flush _test-error-buffered-file) + 2427 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 2433 # no error; we looked up 'y' correctly before pushing the binding for 'x' + 2434 (check-stream-equal _test-error-stream "" "F - test-stmt-defines-output-in-same-register-as-inout: error stream should be empty") + 2435 # don't bother checking the generated code; that's in the test 'test-local-clobbered-by-fn-output' below + 2436 # don't restore from ebp + 2437 81 0/subop/add %esp 8/imm32 + 2438 # . epilogue + 2439 5d/pop-to-ebp + 2440 c3/return + 2441 + 2442 test-local-clobbered-by-fn-output: + 2443 # . prologue + 2444 55/push-ebp + 2445 89/<- %ebp 4/r32/esp + 2446 # setup + 2447 (clear-stream _test-input-stream) + 2448 (clear-stream $_test-input-buffered-file->buffer) + 2449 (clear-stream _test-output-stream) + 2450 (clear-stream $_test-output-buffered-file->buffer) + 2451 # + 2452 (write _test-input-stream "fn foo -> x/ecx: int {\n") + 2453 (write _test-input-stream " var y/ecx: int <- copy 4\n") + 2454 (write _test-input-stream " x <- copy y\n") + 2455 (write _test-input-stream "}\n") + 2456 # convert + 2457 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 2458 (flush _test-output-buffered-file) + 2459 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 2465 # check output + 2466 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-local-clobbered-by-fn-output/0") + 2467 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-local-clobbered-by-fn-output/1") + 2468 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-local-clobbered-by-fn-output/2") + 2469 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-local-clobbered-by-fn-output/3") + 2470 (check-next-stream-line-equal _test-output-stream " {" "F - test-local-clobbered-by-fn-output/4") + 2471 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-local-clobbered-by-fn-output/5") + 2472 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 4/imm32" "F - test-local-clobbered-by-fn-output/6") # no push because it's an output reg + 2473 (check-next-stream-line-equal _test-output-stream " 89/<- %ecx 0x00000001/r32" "F - test-local-clobbered-by-fn-output/7") + 2474 (check-next-stream-line-equal _test-output-stream " }" "F - test-local-clobbered-by-fn-output/8") + 2475 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-local-clobbered-by-fn-output/9") + 2476 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-local-clobbered-by-fn-output/10") + 2477 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-local-clobbered-by-fn-output/11") + 2478 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-local-clobbered-by-fn-output/12") + 2479 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-local-clobbered-by-fn-output/13") + 2480 # . epilogue + 2481 89/<- %esp 5/r32/ebp + 2482 5d/pop-to-ebp + 2483 c3/return + 2484 + 2485 test-read-output: + 2486 # . prologue + 2487 55/push-ebp + 2488 89/<- %ebp 4/r32/esp + 2489 # setup + 2490 (clear-stream _test-input-stream) + 2491 (clear-stream $_test-input-buffered-file->buffer) + 2492 (clear-stream _test-output-stream) + 2493 (clear-stream $_test-output-buffered-file->buffer) + 2494 # + 2495 (write _test-input-stream "fn foo -> x/ecx: int {\n") + 2496 (write _test-input-stream " x <- copy 0x34\n") + 2497 (write _test-input-stream " compare x, 0x35\n") + 2498 (write _test-input-stream "}\n") + 2499 # convert + 2500 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 2501 (flush _test-output-buffered-file) + 2502 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 2508 # check output + 2509 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-read-output/0") + 2510 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-read-output/1") + 2511 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-read-output/2") + 2512 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-read-output/3") + 2513 (check-next-stream-line-equal _test-output-stream " {" "F - test-read-output/4") + 2514 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-read-output/5") + 2515 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 0x34/imm32" "F - test-read-output/6") + 2516 (check-next-stream-line-equal _test-output-stream " 81 7/subop/compare %ecx 0x35/imm32" "F - test-read-output/7") + 2517 (check-next-stream-line-equal _test-output-stream " }" "F - test-read-output/8") + 2518 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-read-output/9") + 2519 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-read-output/10") + 2520 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-read-output/11") + 2521 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-read-output/12") + 2522 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-read-output/13") + 2523 # . epilogue + 2524 89/<- %esp 5/r32/ebp + 2525 5d/pop-to-ebp + 2526 c3/return + 2527 + 2528 test-fn-output-written-in-inner-block: + 2529 # . prologue + 2530 55/push-ebp + 2531 89/<- %ebp 4/r32/esp + 2532 # setup + 2533 (clear-stream _test-input-stream) + 2534 (clear-stream $_test-input-buffered-file->buffer) + 2535 (clear-stream _test-output-stream) + 2536 (clear-stream $_test-output-buffered-file->buffer) + 2537 # + 2538 (write _test-input-stream "fn foo -> out/edi: int {\n") + 2539 (write _test-input-stream " var a/eax: int <- copy 3\n") # define outer local + 2540 (write _test-input-stream " {\n") + 2541 (write _test-input-stream " var a/ecx: int <- copy 4\n") # shadow outer local + 2542 (write _test-input-stream " out <- copy a\n") # write to fn output + 2543 (write _test-input-stream " }\n") + 2544 (write _test-input-stream " compare a, 0\n") # use outer local + 2545 (write _test-input-stream "}\n") + 2546 # convert + 2547 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 2548 (flush _test-output-buffered-file) + 2549 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 2555 # no error; defining 'out' didn't interfere with the reclamation of 'b' + 2556 # check output + 2557 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-fn-output-written-in-inner-block/0") + 2558 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-fn-output-written-in-inner-block/1") + 2559 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-fn-output-written-in-inner-block/2") + 2560 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-fn-output-written-in-inner-block/3") + 2561 (check-next-stream-line-equal _test-output-stream " {" "F - test-fn-output-written-in-inner-block/4") + 2562 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-fn-output-written-in-inner-block/5") + 2563 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-fn-output-written-in-inner-block/6") + 2564 (check-next-stream-line-equal _test-output-stream " b8/copy-to-eax 3/imm32" "F - test-fn-output-written-in-inner-block/7") + 2565 (check-next-stream-line-equal _test-output-stream " {" "F - test-fn-output-written-in-inner-block/8") + 2566 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:loop:" "F - test-fn-output-written-in-inner-block/9") + 2567 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-fn-output-written-in-inner-block/10") + 2568 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 4/imm32" "F - test-fn-output-written-in-inner-block/10") + 2569 (check-next-stream-line-equal _test-output-stream " 89/<- %edi 0x00000001/r32" "F - test-fn-output-written-in-inner-block/11") + 2570 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-fn-output-written-in-inner-block/12") + 2571 (check-next-stream-line-equal _test-output-stream " }" "F - test-fn-output-written-in-inner-block/13") + 2572 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:break:" "F - test-fn-output-written-in-inner-block/14") + 2573 (check-next-stream-line-equal _test-output-stream " 3d/compare-eax-with 0/imm32" "F - test-fn-output-written-in-inner-block/15") + 2574 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-fn-output-written-in-inner-block/16") + 2575 (check-next-stream-line-equal _test-output-stream " }" "F - test-fn-output-written-in-inner-block/17") + 2576 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-fn-output-written-in-inner-block/18") + 2577 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-fn-output-written-in-inner-block/19") + 2578 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-fn-output-written-in-inner-block/20") + 2579 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-fn-output-written-in-inner-block/21") + 2580 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-fn-output-written-in-inner-block/22") + 2581 # . epilogue + 2582 89/<- %esp 5/r32/ebp + 2583 5d/pop-to-ebp + 2584 c3/return + 2585 + 2586 test-convert-function-with-branches-in-block: + 2587 # . prologue + 2588 55/push-ebp + 2589 89/<- %ebp 4/r32/esp + 2590 # setup + 2591 (clear-stream _test-input-stream) + 2592 (clear-stream $_test-input-buffered-file->buffer) + 2593 (clear-stream _test-output-stream) + 2594 (clear-stream $_test-output-buffered-file->buffer) + 2595 # + 2596 (write _test-input-stream "fn foo x: int {\n") + 2597 (write _test-input-stream " {\n") + 2598 (write _test-input-stream " break-if->=\n") + 2599 (write _test-input-stream " loop-if-addr<\n") + 2600 (write _test-input-stream " increment x\n") + 2601 (write _test-input-stream " loop\n") + 2602 (write _test-input-stream " }\n") + 2603 (write _test-input-stream "}\n") + 2604 # convert + 2605 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 2606 (flush _test-output-buffered-file) + 2607 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 2613 # check output + 2614 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-branches-in-block/0") + 2615 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-branches-in-block/1") + 2616 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-branches-in-block/2") + 2617 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-branches-in-block/3") + 2618 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-branches-in-block/4") + 2619 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-branches-in-block/5") + 2620 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-branches-in-block/6") + 2621 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:loop:" "F - test-convert-function-with-branches-in-block/7") + 2622 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-branches-in-block/8") + 2623 (check-next-stream-line-equal _test-output-stream " 0f 8c/jump-if-< break/disp32" "F - test-convert-function-with-branches-in-block/9") + 2624 (check-next-stream-line-equal _test-output-stream " e9/jump $foo:0x00000002:break/disp32" "F - test-convert-function-with-branches-in-block/10") + 2625 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-branches-in-block/11") + 2626 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-branches-in-block/12") + 2627 (check-next-stream-line-equal _test-output-stream " 0f 83/jump-if-addr>= break/disp32" "F - test-convert-function-with-branches-in-block/13") + 2628 (check-next-stream-line-equal _test-output-stream " e9/jump $foo:0x00000002:loop/disp32" "F - test-convert-function-with-branches-in-block/14") + 2629 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-branches-in-block/15") + 2630 (check-next-stream-line-equal _test-output-stream " ff 0/subop/increment *(ebp+0x00000008)" "F - test-convert-function-with-branches-in-block/16") + 2631 (check-next-stream-line-equal _test-output-stream " e9/jump loop/disp32" "F - test-convert-function-with-branches-in-block/17") + 2632 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-branches-in-block/18") + 2633 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:break:" "F - test-convert-function-with-branches-in-block/19") + 2634 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-branches-in-block/20") + 2635 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-branches-in-block/21") + 2636 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-branches-in-block/22") + 2637 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-branches-in-block/23") + 2638 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-branches-in-block/24") + 2639 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-branches-in-block/25") + 2640 # . epilogue + 2641 89/<- %esp 5/r32/ebp + 2642 5d/pop-to-ebp + 2643 c3/return + 2644 + 2645 test-convert-function-with-branches-in-named-block: + 2646 # . prologue + 2647 55/push-ebp + 2648 89/<- %ebp 4/r32/esp + 2649 # setup + 2650 (clear-stream _test-input-stream) + 2651 (clear-stream $_test-input-buffered-file->buffer) + 2652 (clear-stream _test-output-stream) + 2653 (clear-stream $_test-output-buffered-file->buffer) + 2654 # + 2655 (write _test-input-stream "fn foo x: int {\n") + 2656 (write _test-input-stream " $bar: {\n") + 2657 (write _test-input-stream " break-if->= $bar\n") + 2658 (write _test-input-stream " loop-if-addr< $bar\n") + 2659 (write _test-input-stream " increment x\n") + 2660 (write _test-input-stream " loop\n") + 2661 (write _test-input-stream " }\n") + 2662 (write _test-input-stream "}\n") + 2663 # convert + 2664 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 2665 (flush _test-output-buffered-file) + 2666 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 2672 # check output + 2673 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-branches-in-named-block/0") + 2674 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-branches-in-named-block/1") + 2675 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-branches-in-named-block/2") + 2676 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-branches-in-named-block/3") + 2677 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-branches-in-named-block/4") + 2678 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-branches-in-named-block/5") + 2679 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-branches-in-named-block/6") + 2680 (check-next-stream-line-equal _test-output-stream "$bar:loop:" "F - test-convert-function-with-branches-in-named-block/7") + 2681 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-branches-in-named-block/8") + 2682 (check-next-stream-line-equal _test-output-stream " 0f 8c/jump-if-< break/disp32" "F - test-convert-function-with-branches-in-named-block/9") + 2683 (check-next-stream-line-equal _test-output-stream " e9/jump $bar:break/disp32" "F - test-convert-function-with-branches-in-named-block/10") + 2684 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-branches-in-named-block/11") + 2685 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-branches-in-named-block/12") + 2686 (check-next-stream-line-equal _test-output-stream " 0f 83/jump-if-addr>= break/disp32" "F - test-convert-function-with-branches-in-named-block/13") + 2687 (check-next-stream-line-equal _test-output-stream " e9/jump $bar:loop/disp32" "F - test-convert-function-with-branches-in-named-block/14") + 2688 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-branches-in-named-block/15") + 2689 (check-next-stream-line-equal _test-output-stream " ff 0/subop/increment *(ebp+0x00000008)" "F - test-convert-function-with-branches-in-named-block/16") + 2690 (check-next-stream-line-equal _test-output-stream " e9/jump loop/disp32" "F - test-convert-function-with-branches-in-named-block/17") + 2691 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-branches-in-named-block/18") + 2692 (check-next-stream-line-equal _test-output-stream "$bar:break:" "F - test-convert-function-with-branches-in-named-block/19") + 2693 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-branches-in-named-block/20") + 2694 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-branches-in-named-block/21") + 2695 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-branches-in-named-block/22") + 2696 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-branches-in-named-block/23") + 2697 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-branches-in-named-block/24") + 2698 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-branches-in-named-block/25") + 2699 # . epilogue + 2700 89/<- %esp 5/r32/ebp + 2701 5d/pop-to-ebp + 2702 c3/return + 2703 + 2704 test-convert-function-with-var-in-nested-block: + 2705 # . prologue + 2706 55/push-ebp + 2707 89/<- %ebp 4/r32/esp + 2708 # setup + 2709 (clear-stream _test-input-stream) + 2710 (clear-stream $_test-input-buffered-file->buffer) + 2711 (clear-stream _test-output-stream) + 2712 (clear-stream $_test-output-buffered-file->buffer) + 2713 # + 2714 (write _test-input-stream "fn foo x: int {\n") + 2715 (write _test-input-stream " {\n") + 2716 (write _test-input-stream " {\n") + 2717 (write _test-input-stream " var x: int\n") + 2718 (write _test-input-stream " increment x\n") + 2719 (write _test-input-stream " }\n") + 2720 (write _test-input-stream " }\n") + 2721 (write _test-input-stream "}\n") + 2722 # convert + 2723 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 2724 (flush _test-output-buffered-file) + 2725 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 2731 # check output + 2732 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-var-in-nested-block/0") + 2733 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-var-in-nested-block/1") + 2734 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-var-in-nested-block/2") + 2735 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-var-in-nested-block/3") + 2736 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-var-in-nested-block/4") + 2737 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-var-in-nested-block/5") + 2738 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-var-in-nested-block/6") + 2739 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:loop:" "F - test-convert-function-with-var-in-nested-block/7") + 2740 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-var-in-nested-block/8") + 2741 (check-next-stream-line-equal _test-output-stream "$foo:0x00000003:loop:" "F - test-convert-function-with-var-in-nested-block/9") + 2742 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-var-in-nested-block/10") + 2743 (check-next-stream-line-equal _test-output-stream " ff 0/subop/increment *(ebp+0xfffffffc)" "F - test-convert-function-with-var-in-nested-block/11") + 2744 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-var-in-nested-block/12") + 2745 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-var-in-nested-block/13") + 2746 (check-next-stream-line-equal _test-output-stream "$foo:0x00000003:break:" "F - test-convert-function-with-var-in-nested-block/14") + 2747 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-var-in-nested-block/15") + 2748 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:break:" "F - test-convert-function-with-var-in-nested-block/16") + 2749 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-var-in-nested-block/17") + 2750 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-var-in-nested-block/18") + 2751 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-var-in-nested-block/19") + 2752 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-var-in-nested-block/20") + 2753 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-var-in-nested-block/21") + 2754 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-var-in-nested-block/22") + 2755 # . epilogue + 2756 89/<- %esp 5/r32/ebp + 2757 5d/pop-to-ebp + 2758 c3/return + 2759 + 2760 test-convert-function-with-multiple-vars-in-nested-blocks: + 2761 # . prologue + 2762 55/push-ebp + 2763 89/<- %ebp 4/r32/esp + 2764 # setup + 2765 (clear-stream _test-input-stream) + 2766 (clear-stream $_test-input-buffered-file->buffer) + 2767 (clear-stream _test-output-stream) + 2768 (clear-stream $_test-output-buffered-file->buffer) + 2769 # + 2770 (write _test-input-stream "fn foo x: int {\n") + 2771 (write _test-input-stream " {\n") + 2772 (write _test-input-stream " var x/eax: int <- copy 0\n") + 2773 (write _test-input-stream " {\n") + 2774 (write _test-input-stream " var y: int\n") + 2775 (write _test-input-stream " x <- add y\n") + 2776 (write _test-input-stream " }\n") + 2777 (write _test-input-stream " }\n") + 2778 (write _test-input-stream "}\n") + 2779 # convert + 2780 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 2781 (flush _test-output-buffered-file) + 2782 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 2788 # check output + 2789 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-multiple-vars-in-nested-blocks/0") + 2790 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-multiple-vars-in-nested-blocks/1") + 2791 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-multiple-vars-in-nested-blocks/2") + 2792 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-multiple-vars-in-nested-blocks/3") + 2793 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-multiple-vars-in-nested-blocks/4") + 2794 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-multiple-vars-in-nested-blocks/5") + 2795 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-multiple-vars-in-nested-blocks/6") + 2796 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:loop:" "F - test-convert-function-with-multiple-vars-in-nested-blocks/7") + 2797 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-function-with-multiple-vars-in-nested-blocks/8") + 2798 (check-next-stream-line-equal _test-output-stream " b8/copy-to-eax 0/imm32" "F - test-convert-function-with-multiple-vars-in-nested-blocks/9") + 2799 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-multiple-vars-in-nested-blocks/10") + 2800 (check-next-stream-line-equal _test-output-stream "$foo:0x00000003:loop:" "F - test-convert-function-with-multiple-vars-in-nested-blocks/11") + 2801 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-multiple-vars-in-nested-blocks/12") + 2802 (check-next-stream-line-equal _test-output-stream " 03/add *(ebp+0xfffffff8) 0x00000000/r32" "F - test-convert-function-with-multiple-vars-in-nested-blocks/13") + 2803 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-multiple-vars-in-nested-blocks/14") + 2804 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-multiple-vars-in-nested-blocks/15") + 2805 (check-next-stream-line-equal _test-output-stream "$foo:0x00000003:break:" "F - test-convert-function-with-multiple-vars-in-nested-blocks/16") + 2806 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-function-with-multiple-vars-in-nested-blocks/17") + 2807 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-multiple-vars-in-nested-blocks/18") + 2808 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:break:" "F - test-convert-function-with-multiple-vars-in-nested-blocks/19") + 2809 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-multiple-vars-in-nested-blocks/20") + 2810 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-multiple-vars-in-nested-blocks/21") + 2811 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-multiple-vars-in-nested-blocks/22") + 2812 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-multiple-vars-in-nested-blocks/23") + 2813 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-multiple-vars-in-nested-blocks/24") + 2814 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-multiple-vars-in-nested-blocks/25") + 2815 # . epilogue + 2816 89/<- %esp 5/r32/ebp + 2817 5d/pop-to-ebp + 2818 c3/return + 2819 + 2820 test-convert-function-with-branches-and-local-vars: + 2821 # A conditional 'break' after a 'var' in a block is converted into a + 2822 # nested block that performs all necessary cleanup before jumping. This + 2823 # results in some ugly code duplication. + 2824 # . prologue + 2825 55/push-ebp + 2826 89/<- %ebp 4/r32/esp + 2827 # setup + 2828 (clear-stream _test-input-stream) + 2829 (clear-stream $_test-input-buffered-file->buffer) + 2830 (clear-stream _test-output-stream) + 2831 (clear-stream $_test-output-buffered-file->buffer) + 2832 # + 2833 (write _test-input-stream "fn foo {\n") + 2834 (write _test-input-stream " {\n") + 2835 (write _test-input-stream " var x: int\n") + 2836 (write _test-input-stream " break-if->=\n") + 2837 (write _test-input-stream " increment x\n") + 2838 (write _test-input-stream " }\n") + 2839 (write _test-input-stream "}\n") + 2840 # convert + 2841 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 2842 (flush _test-output-buffered-file) + 2843 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 2849 # check output + 2850 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-branches-and-local-vars/0") + 2851 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-branches-and-local-vars/1") + 2852 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-branches-and-local-vars/2") + 2853 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-branches-and-local-vars/3") + 2854 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-branches-and-local-vars/4") + 2855 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-branches-and-local-vars/5") + 2856 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-branches-and-local-vars/6") + 2857 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:loop:" "F - test-convert-function-with-branches-and-local-vars/7") + 2858 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-branches-and-local-vars/8") + 2859 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-branches-and-local-vars/9") + 2860 (check-next-stream-line-equal _test-output-stream " 0f 8c/jump-if-< break/disp32" "F - test-convert-function-with-branches-and-local-vars/10") + 2861 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-branches-and-local-vars/11") + 2862 (check-next-stream-line-equal _test-output-stream " e9/jump $foo:0x00000002:break/disp32" "F - test-convert-function-with-branches-and-local-vars/12") + 2863 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-branches-and-local-vars/13") + 2864 (check-next-stream-line-equal _test-output-stream " ff 0/subop/increment *(ebp+0xfffffffc)" "F - test-convert-function-with-branches-and-local-vars/14") + 2865 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-branches-and-local-vars/15") + 2866 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-branches-and-local-vars/16") + 2867 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:break:" "F - test-convert-function-with-branches-and-local-vars/17") + 2868 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-branches-and-local-vars/18") + 2869 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-branches-and-local-vars/19") + 2870 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-branches-and-local-vars/20") + 2871 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-branches-and-local-vars/21") + 2872 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-branches-and-local-vars/22") + 2873 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-branches-and-local-vars/23") + 2874 # . epilogue + 2875 89/<- %esp 5/r32/ebp + 2876 5d/pop-to-ebp + 2877 c3/return + 2878 + 2879 test-convert-function-with-conditional-loops-and-local-vars: + 2880 # A conditional 'loop' after a 'var' in a block is converted into a nested + 2881 # block that performs all necessary cleanup before jumping. This results + 2882 # in some ugly code duplication. + 2883 # . prologue + 2884 55/push-ebp + 2885 89/<- %ebp 4/r32/esp + 2886 # setup + 2887 (clear-stream _test-input-stream) + 2888 (clear-stream $_test-input-buffered-file->buffer) + 2889 (clear-stream _test-output-stream) + 2890 (clear-stream $_test-output-buffered-file->buffer) + 2891 # + 2892 (write _test-input-stream "fn foo {\n") + 2893 (write _test-input-stream " {\n") + 2894 (write _test-input-stream " var x: int\n") + 2895 (write _test-input-stream " loop-if->=\n") + 2896 (write _test-input-stream " increment x\n") + 2897 (write _test-input-stream " }\n") + 2898 (write _test-input-stream "}\n") + 2899 # convert + 2900 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 2901 (flush _test-output-buffered-file) + 2902 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 2908 # check output + 2909 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-conditional-loops-and-local-vars/0") + 2910 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-conditional-loops-and-local-vars/1") + 2911 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-conditional-loops-and-local-vars/2") + 2912 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-conditional-loops-and-local-vars/3") + 2913 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-conditional-loops-and-local-vars/4") + 2914 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-conditional-loops-and-local-vars/5") + 2915 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-conditional-loops-and-local-vars/6") + 2916 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:loop:" "F - test-convert-function-with-conditional-loops-and-local-vars/7") + 2917 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-conditional-loops-and-local-vars/8") + 2918 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-conditional-loops-and-local-vars/9") + 2919 (check-next-stream-line-equal _test-output-stream " 0f 8c/jump-if-< break/disp32" "F - test-convert-function-with-conditional-loops-and-local-vars/10") + 2920 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-conditional-loops-and-local-vars/11") + 2921 (check-next-stream-line-equal _test-output-stream " e9/jump $foo:0x00000002:loop/disp32" "F - test-convert-function-with-conditional-loops-and-local-vars/12") + 2922 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-conditional-loops-and-local-vars/13") + 2923 (check-next-stream-line-equal _test-output-stream " ff 0/subop/increment *(ebp+0xfffffffc)" "F - test-convert-function-with-conditional-loops-and-local-vars/14") + 2924 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-conditional-loops-and-local-vars/15") + 2925 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-conditional-loops-and-local-vars/16") + 2926 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:break:" "F - test-convert-function-with-conditional-loops-and-local-vars/17") + 2927 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-conditional-loops-and-local-vars/18") + 2928 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-conditional-loops-and-local-vars/19") + 2929 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-conditional-loops-and-local-vars/20") + 2930 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-conditional-loops-and-local-vars/21") + 2931 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-conditional-loops-and-local-vars/22") + 2932 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-conditional-loops-and-local-vars/23") + 2933 # . epilogue + 2934 89/<- %esp 5/r32/ebp + 2935 5d/pop-to-ebp + 2936 c3/return + 2937 + 2938 test-convert-function-with-unconditional-loops-and-local-vars: + 2939 # An unconditional 'loop' after a 'var' in a block is emitted _after_ the + 2940 # regular block cleanup. Any instructions after 'loop' are dead and + 2941 # therefore skipped. + 2942 # . prologue + 2943 55/push-ebp + 2944 89/<- %ebp 4/r32/esp + 2945 # setup + 2946 (clear-stream _test-input-stream) + 2947 (clear-stream $_test-input-buffered-file->buffer) + 2948 (clear-stream _test-output-stream) + 2949 (clear-stream $_test-output-buffered-file->buffer) + 2950 # + 2951 (write _test-input-stream "fn foo {\n") + 2952 (write _test-input-stream " {\n") + 2953 (write _test-input-stream " var x: int\n") + 2954 (write _test-input-stream " loop\n") + 2955 (write _test-input-stream " increment x\n") + 2956 (write _test-input-stream " }\n") + 2957 (write _test-input-stream "}\n") + 2958 # convert + 2959 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 2960 (flush _test-output-buffered-file) + 2961 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 2967 # check output + 2968 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-unconditional-loops-and-local-vars/0") + 2969 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-unconditional-loops-and-local-vars/1") + 2970 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-unconditional-loops-and-local-vars/2") + 2971 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-unconditional-loops-and-local-vars/3") + 2972 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-unconditional-loops-and-local-vars/4") + 2973 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-unconditional-loops-and-local-vars/5") + 2974 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-unconditional-loops-and-local-vars/6") + 2975 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:loop:" "F - test-convert-function-with-unconditional-loops-and-local-vars/7") + 2976 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-unconditional-loops-and-local-vars/8") + 2977 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-unconditional-loops-and-local-vars/9") + 2978 (check-next-stream-line-equal _test-output-stream " e9/jump loop/disp32" "F - test-convert-function-with-unconditional-loops-and-local-vars/10") + 2979 # not emitted: ff 0/subop/increment *(ebp+0xfffffffc) + 2980 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-unconditional-loops-and-local-vars/11") + 2981 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:break:" "F - test-convert-function-with-unconditional-loops-and-local-vars/12") + 2982 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-unconditional-loops-and-local-vars/13") + 2983 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-unconditional-loops-and-local-vars/14") + 2984 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-unconditional-loops-and-local-vars/15") + 2985 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-unconditional-loops-and-local-vars/16") + 2986 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-unconditional-loops-and-local-vars/17") + 2987 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-unconditional-loops-and-local-vars/18") + 2988 # . epilogue + 2989 89/<- %esp 5/r32/ebp + 2990 5d/pop-to-ebp + 2991 c3/return + 2992 + 2993 test-convert-function-with-branches-and-loops-and-local-vars: + 2994 # . prologue + 2995 55/push-ebp + 2996 89/<- %ebp 4/r32/esp + 2997 # setup + 2998 (clear-stream _test-input-stream) + 2999 (clear-stream $_test-input-buffered-file->buffer) + 3000 (clear-stream _test-output-stream) + 3001 (clear-stream $_test-output-buffered-file->buffer) + 3002 # + 3003 (write _test-input-stream "fn foo {\n") + 3004 (write _test-input-stream " {\n") + 3005 (write _test-input-stream " var x: int\n") + 3006 (write _test-input-stream " break-if->=\n") + 3007 (write _test-input-stream " increment x\n") + 3008 (write _test-input-stream " loop\n") + 3009 (write _test-input-stream " }\n") + 3010 (write _test-input-stream "}\n") + 3011 # convert + 3012 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 3013 (flush _test-output-buffered-file) + 3014 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 3020 # check output + 3021 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-branches-and-loops-and-local-vars/0") + 3022 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-branches-and-loops-and-local-vars/1") + 3023 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-branches-and-loops-and-local-vars/2") + 3024 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-branches-and-loops-and-local-vars/3") + 3025 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-branches-and-loops-and-local-vars/4") + 3026 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-branches-and-loops-and-local-vars/5") + 3027 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-branches-and-loops-and-local-vars/6") + 3028 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:loop:" "F - test-convert-function-with-branches-and-loops-and-local-vars/7") + 3029 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-branches-and-loops-and-local-vars/8") + 3030 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-branches-and-loops-and-local-vars/9") + 3031 (check-next-stream-line-equal _test-output-stream " 0f 8c/jump-if-< break/disp32" "F - test-convert-function-with-branches-and-loops-and-local-vars/10") + 3032 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-branches-and-loops-and-local-vars/11") + 3033 (check-next-stream-line-equal _test-output-stream " e9/jump $foo:0x00000002:break/disp32" "F - test-convert-function-with-branches-and-loops-and-local-vars/12") + 3034 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-branches-and-loops-and-local-vars/13") + 3035 (check-next-stream-line-equal _test-output-stream " ff 0/subop/increment *(ebp+0xfffffffc)" "F - test-convert-function-with-branches-and-loops-and-local-vars/14") + 3036 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-branches-and-loops-and-local-vars/15") + 3037 (check-next-stream-line-equal _test-output-stream " e9/jump loop/disp32" "F - test-convert-function-with-branches-and-loops-and-local-vars/16") + 3038 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-branches-and-loops-and-local-vars/17") + 3039 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:break:" "F - test-convert-function-with-branches-and-loops-and-local-vars/18") + 3040 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-branches-and-loops-and-local-vars/19") + 3041 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-branches-and-loops-and-local-vars/20") + 3042 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-branches-and-loops-and-local-vars/21") + 3043 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-branches-and-loops-and-local-vars/22") + 3044 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-branches-and-loops-and-local-vars/23") + 3045 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-branches-and-loops-and-local-vars/24") + 3046 # . epilogue + 3047 89/<- %esp 5/r32/ebp + 3048 5d/pop-to-ebp + 3049 c3/return + 3050 + 3051 test-convert-function-with-nonlocal-branches-and-loops-and-local-vars: + 3052 # . prologue + 3053 55/push-ebp + 3054 89/<- %ebp 4/r32/esp + 3055 # setup + 3056 (clear-stream _test-input-stream) + 3057 (clear-stream $_test-input-buffered-file->buffer) + 3058 (clear-stream _test-output-stream) + 3059 (clear-stream $_test-output-buffered-file->buffer) + 3060 # + 3061 (write _test-input-stream "fn foo {\n") + 3062 (write _test-input-stream " a: {\n") + 3063 (write _test-input-stream " var x: int\n") + 3064 (write _test-input-stream " {\n") + 3065 (write _test-input-stream " var y: int\n") + 3066 (write _test-input-stream " break-if->= a\n") + 3067 (write _test-input-stream " increment x\n") + 3068 (write _test-input-stream " loop\n") + 3069 (write _test-input-stream " }\n") + 3070 (write _test-input-stream " }\n") + 3071 (write _test-input-stream "}\n") + 3072 # convert + 3073 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 3074 (flush _test-output-buffered-file) + 3075 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 3081 # check output + 3082 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/0") + 3083 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/1") + 3084 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/2") + 3085 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/3") + 3086 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/4") + 3087 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/5") + 3088 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/6") + 3089 (check-next-stream-line-equal _test-output-stream "a:loop:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/7") + 3090 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/8") + 3091 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/9") + 3092 (check-next-stream-line-equal _test-output-stream "$foo:0x00000003:loop:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/10") + 3093 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/11") + 3094 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/12") + 3095 (check-next-stream-line-equal _test-output-stream " 0f 8c/jump-if-< break/disp32" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/13") + 3096 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/14") + 3097 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/15") + 3098 (check-next-stream-line-equal _test-output-stream " e9/jump a:break/disp32" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/16") + 3099 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/17") + 3100 (check-next-stream-line-equal _test-output-stream " ff 0/subop/increment *(ebp+0xfffffffc)" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/18") + 3101 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/19") + 3102 (check-next-stream-line-equal _test-output-stream " e9/jump loop/disp32" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/20") + 3103 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/21") + 3104 (check-next-stream-line-equal _test-output-stream "$foo:0x00000003:break:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/22") + 3105 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/23") + 3106 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/24") + 3107 (check-next-stream-line-equal _test-output-stream "a:break:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/25") + 3108 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/26") + 3109 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/27") + 3110 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/28") + 3111 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/29") + 3112 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/30") + 3113 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars/31") + 3114 # . epilogue + 3115 89/<- %esp 5/r32/ebp + 3116 5d/pop-to-ebp + 3117 c3/return + 3118 + 3119 test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2: + 3120 # . prologue + 3121 55/push-ebp + 3122 89/<- %ebp 4/r32/esp + 3123 # setup + 3124 (clear-stream _test-input-stream) + 3125 (clear-stream $_test-input-buffered-file->buffer) + 3126 (clear-stream _test-output-stream) + 3127 (clear-stream $_test-output-buffered-file->buffer) + 3128 # non-local conditional branch from a block without a local variable, + 3129 # unwinding a local on the stack + 3130 (write _test-input-stream "fn foo {\n") + 3131 (write _test-input-stream " a: {\n") + 3132 (write _test-input-stream " var x: int\n") + 3133 (write _test-input-stream " {\n") + 3134 (write _test-input-stream " break-if->= a\n") + 3135 (write _test-input-stream " }\n") + 3136 (write _test-input-stream " }\n") + 3137 (write _test-input-stream "}\n") + 3138 # convert + 3139 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 3140 (flush _test-output-buffered-file) + 3141 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 3147 # check output + 3148 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/0") + 3149 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/1") + 3150 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/2") + 3151 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/3") + 3152 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/4") + 3153 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/5") + 3154 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/6") + 3155 (check-next-stream-line-equal _test-output-stream "a:loop:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/7") + 3156 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/8") + 3157 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/9") + 3158 (check-next-stream-line-equal _test-output-stream "$foo:0x00000003:loop:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/10") + 3159 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/11") + 3160 (check-next-stream-line-equal _test-output-stream " 0f 8c/jump-if-< break/disp32" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/12") + 3161 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/13") + 3162 (check-next-stream-line-equal _test-output-stream " e9/jump a:break/disp32" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/14") + 3163 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/15") + 3164 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/16") + 3165 (check-next-stream-line-equal _test-output-stream "$foo:0x00000003:break:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/17") + 3166 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/18") + 3167 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/19") + 3168 (check-next-stream-line-equal _test-output-stream "a:break:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/20") + 3169 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/21") + 3170 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/22") + 3171 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/23") + 3172 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/24") + 3173 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/25") + 3174 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-2/26") + 3175 # . epilogue + 3176 89/<- %esp 5/r32/ebp + 3177 5d/pop-to-ebp + 3178 c3/return + 3179 + 3180 test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3: + 3181 # . prologue + 3182 55/push-ebp + 3183 89/<- %ebp 4/r32/esp + 3184 # setup + 3185 (clear-stream _test-input-stream) + 3186 (clear-stream $_test-input-buffered-file->buffer) + 3187 (clear-stream _test-output-stream) + 3188 (clear-stream $_test-output-buffered-file->buffer) + 3189 # non-local unconditional branch from a block without a local variable, + 3190 # unwinding a local on the stack + 3191 (write _test-input-stream "fn foo {\n") + 3192 (write _test-input-stream " a: {\n") + 3193 (write _test-input-stream " var x: int\n") + 3194 (write _test-input-stream " {\n") + 3195 (write _test-input-stream " break a\n") + 3196 (write _test-input-stream " }\n") + 3197 (write _test-input-stream " }\n") + 3198 (write _test-input-stream "}\n") + 3199 # convert + 3200 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 3201 (flush _test-output-buffered-file) + 3202 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 3208 # check output + 3209 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/0") + 3210 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/1") + 3211 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/2") + 3212 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/3") + 3213 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/4") + 3214 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/5") + 3215 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/6") + 3216 (check-next-stream-line-equal _test-output-stream "a:loop:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/7") + 3217 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/8") + 3218 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/9") + 3219 (check-next-stream-line-equal _test-output-stream "$foo:0x00000003:loop:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/10") + 3220 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/11") + 3221 (check-next-stream-line-equal _test-output-stream " e9/jump a:break/disp32" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/12") + 3222 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/14") + 3223 (check-next-stream-line-equal _test-output-stream "$foo:0x00000003:break:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/15") + 3224 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/16") + 3225 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/17") + 3226 (check-next-stream-line-equal _test-output-stream "a:break:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/18") + 3227 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/19") + 3228 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/20") + 3229 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/21") + 3230 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/22") + 3231 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/23") + 3232 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-3/24") + 3233 # . epilogue + 3234 89/<- %esp 5/r32/ebp + 3235 5d/pop-to-ebp + 3236 c3/return + 3237 + 3238 test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4: + 3239 # . prologue + 3240 55/push-ebp + 3241 89/<- %ebp 4/r32/esp + 3242 # setup + 3243 (clear-stream _test-input-stream) + 3244 (clear-stream $_test-input-buffered-file->buffer) + 3245 (clear-stream _test-output-stream) + 3246 (clear-stream $_test-output-buffered-file->buffer) + 3247 # + 3248 (write _test-input-stream "fn foo {\n") + 3249 (write _test-input-stream " a: {\n") + 3250 (write _test-input-stream " var x/esi: int <- copy 0\n") + 3251 (write _test-input-stream " {\n") + 3252 (write _test-input-stream " break a\n") + 3253 (write _test-input-stream " }\n") + 3254 (write _test-input-stream " }\n") + 3255 (write _test-input-stream "}\n") + 3256 # convert + 3257 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 3258 (flush _test-output-buffered-file) + 3259 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 3265 # check output + 3266 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/0") + 3267 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/1") + 3268 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/2") + 3269 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/3") + 3270 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/4") + 3271 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/5") + 3272 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/6") + 3273 (check-next-stream-line-equal _test-output-stream "a:loop:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/7") + 3274 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %esi" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/8") + 3275 (check-next-stream-line-equal _test-output-stream " be/copy-to-esi 0/imm32" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/9") + 3276 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/10") + 3277 (check-next-stream-line-equal _test-output-stream "$foo:0x00000003:loop:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/11") + 3278 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %esi" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/12") + 3279 (check-next-stream-line-equal _test-output-stream " e9/jump a:break/disp32" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/13") + 3280 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/14") + 3281 (check-next-stream-line-equal _test-output-stream "$foo:0x00000003:break:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/15") + 3282 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %esi" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/16") + 3283 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/17") + 3284 (check-next-stream-line-equal _test-output-stream "a:break:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/18") + 3285 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/19") + 3286 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/20") + 3287 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/21") + 3288 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/22") + 3289 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/23") + 3290 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-nonlocal-branches-and-loops-and-local-vars-4/24") + 3291 # . epilogue + 3292 89/<- %esp 5/r32/ebp + 3293 5d/pop-to-ebp + 3294 c3/return + 3295 + 3296 test-convert-function-with-nonlocal-unconditional-break-and-local-vars: + 3297 # . prologue + 3298 55/push-ebp + 3299 89/<- %ebp 4/r32/esp + 3300 # setup + 3301 (clear-stream _test-input-stream) + 3302 (clear-stream $_test-input-buffered-file->buffer) + 3303 (clear-stream _test-output-stream) + 3304 (clear-stream $_test-output-buffered-file->buffer) + 3305 # + 3306 (write _test-input-stream "fn foo {\n") + 3307 (write _test-input-stream " a: {\n") + 3308 (write _test-input-stream " var x: int\n") + 3309 (write _test-input-stream " {\n") + 3310 (write _test-input-stream " var y: int\n") + 3311 (write _test-input-stream " break a\n") + 3312 (write _test-input-stream " increment x\n") + 3313 (write _test-input-stream " }\n") + 3314 (write _test-input-stream " }\n") + 3315 (write _test-input-stream "}\n") + 3316 # convert + 3317 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 3318 (flush _test-output-buffered-file) + 3319 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 3325 # check output + 3326 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/0") + 3327 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/1") + 3328 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/2") + 3329 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/3") + 3330 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/4") + 3331 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/5") + 3332 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/6") + 3333 (check-next-stream-line-equal _test-output-stream "a:loop:" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/7") + 3334 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/8") + 3335 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/9") + 3336 (check-next-stream-line-equal _test-output-stream "$foo:0x00000003:loop:" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/10") + 3337 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/11") + 3338 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/12") + 3339 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/13") + 3340 (check-next-stream-line-equal _test-output-stream " e9/jump a:break/disp32" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/14") + 3341 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/15") + 3342 (check-next-stream-line-equal _test-output-stream "$foo:0x00000003:break:" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/16") + 3343 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/17") + 3344 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/18") + 3345 (check-next-stream-line-equal _test-output-stream "a:break:" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/19") + 3346 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/20") + 3347 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/21") + 3348 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/22") + 3349 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/23") + 3350 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/24") + 3351 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-nonlocal-unconditional-break-and-local-vars/25") + 3352 # . epilogue + 3353 89/<- %esp 5/r32/ebp + 3354 5d/pop-to-ebp + 3355 c3/return + 3356 + 3357 test-convert-function-with-unconditional-break-and-local-vars: + 3358 # . prologue + 3359 55/push-ebp + 3360 89/<- %ebp 4/r32/esp + 3361 # setup + 3362 (clear-stream _test-input-stream) + 3363 (clear-stream $_test-input-buffered-file->buffer) + 3364 (clear-stream _test-output-stream) + 3365 (clear-stream $_test-output-buffered-file->buffer) + 3366 # + 3367 (write _test-input-stream "fn foo {\n") + 3368 (write _test-input-stream " {\n") + 3369 (write _test-input-stream " var x: int\n") + 3370 (write _test-input-stream " {\n") + 3371 (write _test-input-stream " var y: int\n") + 3372 (write _test-input-stream " break\n") + 3373 (write _test-input-stream " increment x\n") + 3374 (write _test-input-stream " }\n") + 3375 (write _test-input-stream " }\n") + 3376 (write _test-input-stream "}\n") + 3377 # convert + 3378 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 3379 (flush _test-output-buffered-file) + 3380 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 3386 # check output + 3387 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-unconditional-break-and-local-vars/0") + 3388 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-unconditional-break-and-local-vars/1") + 3389 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-unconditional-break-and-local-vars/2") + 3390 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-unconditional-break-and-local-vars/3") + 3391 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-unconditional-break-and-local-vars/4") + 3392 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-unconditional-break-and-local-vars/5") + 3393 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-unconditional-break-and-local-vars/6") + 3394 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:loop:" "F - test-convert-function-with-unconditional-break-and-local-vars/7") + 3395 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-unconditional-break-and-local-vars/8") + 3396 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-unconditional-break-and-local-vars/9") + 3397 (check-next-stream-line-equal _test-output-stream "$foo:0x00000003:loop:" "F - test-convert-function-with-unconditional-break-and-local-vars/10") + 3398 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-unconditional-break-and-local-vars/11") + 3399 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-unconditional-break-and-local-vars/12") + 3400 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-unconditional-break-and-local-vars/13") + 3401 (check-next-stream-line-equal _test-output-stream "$foo:0x00000003:break:" "F - test-convert-function-with-unconditional-break-and-local-vars/14") + 3402 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-unconditional-break-and-local-vars/15") + 3403 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-unconditional-break-and-local-vars/16") + 3404 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:break:" "F - test-convert-function-with-unconditional-break-and-local-vars/17") + 3405 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-unconditional-break-and-local-vars/18") + 3406 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-unconditional-break-and-local-vars/19") + 3407 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-unconditional-break-and-local-vars/20") + 3408 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-unconditional-break-and-local-vars/21") + 3409 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-unconditional-break-and-local-vars/22") + 3410 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-unconditional-break-and-local-vars/23") + 3411 # . epilogue + 3412 89/<- %esp 5/r32/ebp + 3413 5d/pop-to-ebp + 3414 c3/return + 3415 + 3416 test-convert-function-with-nonlocal-unconditional-loop-and-local-vars: + 3417 # . prologue + 3418 55/push-ebp + 3419 89/<- %ebp 4/r32/esp + 3420 # setup + 3421 (clear-stream _test-input-stream) + 3422 (clear-stream $_test-input-buffered-file->buffer) + 3423 (clear-stream _test-output-stream) + 3424 (clear-stream $_test-output-buffered-file->buffer) + 3425 # + 3426 (write _test-input-stream "fn foo {\n") + 3427 (write _test-input-stream " a: {\n") + 3428 (write _test-input-stream " var x: int\n") + 3429 (write _test-input-stream " {\n") + 3430 (write _test-input-stream " var y: int\n") + 3431 (write _test-input-stream " loop a\n") + 3432 (write _test-input-stream " increment x\n") + 3433 (write _test-input-stream " }\n") + 3434 (write _test-input-stream " }\n") + 3435 (write _test-input-stream "}\n") + 3436 # convert + 3437 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 3438 (flush _test-output-buffered-file) + 3439 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 3445 # check output + 3446 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/0") + 3447 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/1") + 3448 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/2") + 3449 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/3") + 3450 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/4") + 3451 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/5") + 3452 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/6") + 3453 (check-next-stream-line-equal _test-output-stream "a:loop:" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/7") + 3454 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/8") + 3455 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/9") + 3456 (check-next-stream-line-equal _test-output-stream "$foo:0x00000003:loop:" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/10") + 3457 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/11") + 3458 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/12") + 3459 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/13") + 3460 (check-next-stream-line-equal _test-output-stream " e9/jump a:loop/disp32" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/14") + 3461 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/15") + 3462 (check-next-stream-line-equal _test-output-stream "$foo:0x00000003:break:" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/16") + 3463 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/17") + 3464 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/18") + 3465 (check-next-stream-line-equal _test-output-stream "a:break:" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/19") + 3466 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/20") + 3467 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/21") + 3468 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/22") + 3469 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/23") + 3470 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/24") + 3471 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-nonlocal-unconditional-loop-and-local-vars/25") + 3472 # . epilogue + 3473 89/<- %esp 5/r32/ebp + 3474 5d/pop-to-ebp + 3475 c3/return + 3476 + 3477 test-convert-function-with-local-array-var-in-mem: + 3478 # . prologue + 3479 55/push-ebp + 3480 89/<- %ebp 4/r32/esp + 3481 # setup + 3482 (clear-stream _test-input-stream) + 3483 (clear-stream $_test-input-buffered-file->buffer) + 3484 (clear-stream _test-output-stream) + 3485 (clear-stream $_test-output-buffered-file->buffer) + 3486 # + 3487 (write _test-input-stream "fn foo {\n") + 3488 (write _test-input-stream " var x: (array int 3)\n") + 3489 (write _test-input-stream "}\n") + 3490 # convert + 3491 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 3492 (flush _test-output-buffered-file) + 3493 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 3499 # check output + 3500 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-local-array-var-in-mem/0") + 3501 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-local-array-var-in-mem/1") + 3502 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-local-array-var-in-mem/2") + 3503 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-local-array-var-in-mem/3") + 3504 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-local-array-var-in-mem/4") + 3505 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-local-array-var-in-mem/5") + 3506 # define x + 3507 (check-next-stream-line-equal _test-output-stream " (push-n-zero-bytes 0x0000000c)" "F - test-convert-function-with-local-array-var-in-mem/7") + 3508 (check-next-stream-line-equal _test-output-stream " 68/push 0x0000000c/imm32" "F - test-convert-function-with-local-array-var-in-mem/8") + 3509 # reclaim x + 3510 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000010/imm32" "F - test-convert-function-with-local-array-var-in-mem/9") + 3511 # + 3512 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-local-array-var-in-mem/10") + 3513 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-local-array-var-in-mem/11") + 3514 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-local-array-var-in-mem/12") + 3515 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-local-array-var-in-mem/13") + 3516 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-local-array-var-in-mem/14") + 3517 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-local-array-var-in-mem/15") + 3518 # . epilogue + 3519 89/<- %esp 5/r32/ebp + 3520 5d/pop-to-ebp + 3521 c3/return + 3522 + 3523 # special-case for size(byte) when allocating array + 3524 test-convert-function-with-local-array-of-bytes-in-mem: + 3525 # . prologue + 3526 55/push-ebp + 3527 89/<- %ebp 4/r32/esp + 3528 # setup + 3529 (clear-stream _test-input-stream) + 3530 (clear-stream $_test-input-buffered-file->buffer) + 3531 (clear-stream _test-output-stream) + 3532 (clear-stream $_test-output-buffered-file->buffer) + 3533 # + 3534 (write _test-input-stream "fn foo {\n") + 3535 (write _test-input-stream " var x: (array byte 3)\n") + 3536 (write _test-input-stream "}\n") + 3537 # convert + 3538 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 3539 (flush _test-output-buffered-file) + 3540 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 3546 # check output + 3547 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-local-array-of-bytes-in-mem/0") + 3548 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-local-array-of-bytes-in-mem/1") + 3549 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-local-array-of-bytes-in-mem/2") + 3550 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-local-array-of-bytes-in-mem/3") + 3551 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-local-array-of-bytes-in-mem/4") + 3552 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-local-array-of-bytes-in-mem/5") + 3553 # define x + 3554 (check-next-stream-line-equal _test-output-stream " (push-n-zero-bytes 0x00000003)" "F - test-convert-function-with-local-array-of-bytes-in-mem/7") + 3555 (check-next-stream-line-equal _test-output-stream " 68/push 0x00000003/imm32" "F - test-convert-function-with-local-array-of-bytes-in-mem/8") + 3556 # reclaim x + 3557 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000007/imm32" "F - test-convert-function-with-local-array-of-bytes-in-mem/9") + 3558 # + 3559 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-local-array-of-bytes-in-mem/10") + 3560 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-local-array-of-bytes-in-mem/11") + 3561 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-local-array-of-bytes-in-mem/12") + 3562 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-local-array-of-bytes-in-mem/13") + 3563 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-local-array-of-bytes-in-mem/14") + 3564 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-local-array-of-bytes-in-mem/15") + 3565 # . epilogue + 3566 89/<- %esp 5/r32/ebp + 3567 5d/pop-to-ebp + 3568 c3/return + 3569 + 3570 test-convert-address: + 3571 # . prologue + 3572 55/push-ebp + 3573 89/<- %ebp 4/r32/esp + 3574 # setup + 3575 (clear-stream _test-input-stream) + 3576 (clear-stream $_test-input-buffered-file->buffer) + 3577 (clear-stream _test-output-stream) + 3578 (clear-stream $_test-output-buffered-file->buffer) + 3579 # + 3580 (write _test-input-stream "fn foo {\n") + 3581 (write _test-input-stream " var a: int\n") + 3582 (write _test-input-stream " var b/eax: (addr int) <- address a\n") + 3583 (write _test-input-stream "}\n") + 3584 # convert + 3585 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 3586 (flush _test-output-buffered-file) + 3587 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 3593 # check output + 3594 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-address/0") + 3595 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-address/1") + 3596 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-address/2") + 3597 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-address/3") + 3598 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-address/4") + 3599 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-address/5") + 3600 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-address/6") + 3601 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-address/7") + 3602 (check-next-stream-line-equal _test-output-stream " 8d/copy-address *(ebp+0xfffffffc) 0x00000000/r32" "F - test-convert-address/8") + 3603 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-address/9") + 3604 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-address/10") + 3605 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-address/11") + 3606 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-address/12") + 3607 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-address/13") + 3608 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-address/14") + 3609 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-address/15") + 3610 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-address/16") + 3611 # . epilogue + 3612 89/<- %esp 5/r32/ebp + 3613 5d/pop-to-ebp + 3614 c3/return + 3615 + 3616 test-convert-length-of-array: + 3617 # . prologue + 3618 55/push-ebp + 3619 89/<- %ebp 4/r32/esp + 3620 # setup + 3621 (clear-stream _test-input-stream) + 3622 (clear-stream $_test-input-buffered-file->buffer) + 3623 (clear-stream _test-output-stream) + 3624 (clear-stream $_test-output-buffered-file->buffer) + 3625 # + 3626 (write _test-input-stream "fn foo a: (addr array int) {\n") + 3627 (write _test-input-stream " var b/eax: (addr array int) <- copy a\n") + 3628 (write _test-input-stream " var c/eax: int <- length b\n") + 3629 (write _test-input-stream "}\n") + 3630 # convert + 3631 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 3632 (flush _test-output-buffered-file) + 3633 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 3639 # check output + 3640 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-length-of-array/0") + 3641 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-length-of-array/1") + 3642 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-length-of-array/2") + 3643 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-length-of-array/3") + 3644 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-length-of-array/4") + 3645 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-length-of-array/5") + 3646 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-length-of-array/6") + 3647 (check-next-stream-line-equal _test-output-stream " 8b/-> *(ebp+0x00000008) 0x00000000/r32" "F - test-convert-length-of-array/7") + 3648 (check-next-stream-line-equal _test-output-stream " 8b/-> *eax 0x00000000/r32" "F - test-convert-length-of-array/8") + 3649 (check-next-stream-line-equal _test-output-stream " c1/shift 5/subop/>> %eax 0x00000002/imm8" "F - test-convert-length-of-array/9") + 3650 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-length-of-array/10") + 3651 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-length-of-array/11") + 3652 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-length-of-array/12") + 3653 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-length-of-array/13") + 3654 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-length-of-array/14") + 3655 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-length-of-array/15") + 3656 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-length-of-array/16") + 3657 # . epilogue + 3658 89/<- %esp 5/r32/ebp + 3659 5d/pop-to-ebp + 3660 c3/return + 3661 + 3662 # special-case for size(byte) when computing array length + 3663 test-convert-length-of-array-of-bytes: + 3664 # . prologue + 3665 55/push-ebp + 3666 89/<- %ebp 4/r32/esp + 3667 # setup + 3668 (clear-stream _test-input-stream) + 3669 (clear-stream $_test-input-buffered-file->buffer) + 3670 (clear-stream _test-output-stream) + 3671 (clear-stream $_test-output-buffered-file->buffer) + 3672 # + 3673 (write _test-input-stream "fn foo a: (addr array byte) {\n") + 3674 (write _test-input-stream " var b/eax: (addr array byte) <- copy a\n") + 3675 (write _test-input-stream " var c/eax: int <- length b\n") + 3676 (write _test-input-stream "}\n") + 3677 # convert + 3678 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 3679 (flush _test-output-buffered-file) + 3680 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 3686 # check output + 3687 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-length-of-array-of-bytes/0") + 3688 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-length-of-array-of-bytes/1") + 3689 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-length-of-array-of-bytes/2") + 3690 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-length-of-array-of-bytes/3") + 3691 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-length-of-array-of-bytes/4") + 3692 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-length-of-array-of-bytes/5") + 3693 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-length-of-array-of-bytes/6") + 3694 (check-next-stream-line-equal _test-output-stream " 8b/-> *(ebp+0x00000008) 0x00000000/r32" "F - test-convert-length-of-array-of-bytes/7") + 3695 (check-next-stream-line-equal _test-output-stream " 8b/-> *eax 0x00000000/r32" "F - test-convert-length-of-array-of-bytes/8") + 3696 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-length-of-array-of-bytes/9") + 3697 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-length-of-array-of-bytes/10") + 3698 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-length-of-array-of-bytes/11") + 3699 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-length-of-array-of-bytes/12") + 3700 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-length-of-array-of-bytes/13") + 3701 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-length-of-array-of-bytes/14") + 3702 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-length-of-array-of-bytes/15") 3703 # . epilogue 3704 89/<- %esp 5/r32/ebp 3705 5d/pop-to-ebp 3706 c3/return 3707 - 3708 test-reg-var-def-with-read-of-same-register: + 3708 test-convert-length-of-array-on-stack: 3709 # . prologue 3710 55/push-ebp 3711 89/<- %ebp 4/r32/esp 3712 # setup - 3713 (clear-stream _test-input-stream) - 3714 (clear-stream $_test-input-buffered-file->buffer) - 3715 (clear-stream _test-output-stream) - 3716 (clear-stream $_test-output-buffered-file->buffer) - 3717 (clear-stream _test-error-stream) - 3718 (clear-stream $_test-error-buffered-file->buffer) - 3719 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) # bytes of args in call to convert-mu - 3720 68/push 0/imm32 - 3721 68/push 0/imm32 - 3722 89/<- %edx 4/r32/esp - 3723 (tailor-exit-descriptor %edx 0x10) - 3724 # - 3725 (write _test-input-stream "fn foo {\n") - 3726 (write _test-input-stream " var arr/eax: (addr array int) <- copy 0\n") - 3727 (write _test-input-stream " var idx/ecx: int <- copy 3\n") - 3728 (write _test-input-stream " var x/eax: (addr int) <- index arr, idx\n") - 3729 (write _test-input-stream "}\n") - 3730 # convert - 3731 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) - 3732 # registers except esp could be clobbered at this point (though they shouldn't be) - 3733 # restore ed - 3734 89/<- %edx 4/r32/esp - 3735 (flush _test-output-buffered-file) - 3736 (flush _test-error-buffered-file) - 3737 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 3743 (check-stream-equal _test-error-stream "" "F - test-reg-var-def-with-read-of-same-register: error stream should be empty") - 3744 # check output - 3745 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-reg-var-def-with-read-of-same-register/0") - 3746 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-reg-var-def-with-read-of-same-register/1") - 3747 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-reg-var-def-with-read-of-same-register/2") - 3748 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-reg-var-def-with-read-of-same-register/3") - 3749 (check-next-stream-line-equal _test-output-stream " {" "F - test-reg-var-def-with-read-of-same-register/4") - 3750 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-reg-var-def-with-read-of-same-register/5") - 3751 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-reg-var-def-with-read-of-same-register/6") - 3752 (check-next-stream-line-equal _test-output-stream " b8/copy-to-eax 0/imm32" "F - test-reg-var-def-with-read-of-same-register/7") - 3753 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-reg-var-def-with-read-of-same-register/8") - 3754 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 3/imm32" "F - test-reg-var-def-with-read-of-same-register/9") - 3755 (check-next-stream-line-equal _test-output-stream " 8d/copy-address *(eax + ecx<<0x00000002 + 4) 0x00000000/r32" "F - test-reg-var-def-with-read-of-same-register/11") - 3756 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-reg-var-def-with-read-of-same-register/13") - 3757 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-reg-var-def-with-read-of-same-register/14") - 3758 (check-next-stream-line-equal _test-output-stream " }" "F - test-reg-var-def-with-read-of-same-register/15") - 3759 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-reg-var-def-with-read-of-same-register/16") - 3760 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-reg-var-def-with-read-of-same-register/17") - 3761 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-reg-var-def-with-read-of-same-register/18") - 3762 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-reg-var-def-with-read-of-same-register/19") - 3763 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-reg-var-def-with-read-of-same-register/20") - 3764 # don't restore from ebp - 3765 81 0/subop/add %esp 8/imm32 - 3766 # . epilogue - 3767 5d/pop-to-ebp - 3768 c3/return - 3769 - 3770 test-convert-index-into-array: - 3771 # . prologue - 3772 55/push-ebp - 3773 89/<- %ebp 4/r32/esp - 3774 # setup - 3775 (clear-stream _test-input-stream) - 3776 (clear-stream $_test-input-buffered-file->buffer) - 3777 (clear-stream _test-output-stream) - 3778 (clear-stream $_test-output-buffered-file->buffer) - 3779 # - 3780 (write _test-input-stream "fn foo {\n") - 3781 (write _test-input-stream " var arr/eax: (addr array int) <- copy 0\n") - 3782 (write _test-input-stream " var idx/ecx: int <- copy 3\n") - 3783 (write _test-input-stream " var x/eax: (addr int) <- index arr, idx\n") - 3784 (write _test-input-stream "}\n") - 3785 # convert - 3786 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 3787 (flush _test-output-buffered-file) - 3788 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 3794 # check output - 3795 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-index-into-array/0") - 3796 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-index-into-array/1") - 3797 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-index-into-array/2") - 3798 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-index-into-array/3") - 3799 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-index-into-array/4") - 3800 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-index-into-array/5") - 3801 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-index-into-array/6") - 3802 (check-next-stream-line-equal _test-output-stream " b8/copy-to-eax 0/imm32" "F - test-convert-index-into-array/7") - 3803 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-convert-index-into-array/8") - 3804 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 3/imm32" "F - test-convert-index-into-array/9") - 3805 (check-next-stream-line-equal _test-output-stream " 8d/copy-address *(eax + ecx<<0x00000002 + 4) 0x00000000/r32" "F - test-convert-index-into-array/10") - 3806 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-convert-index-into-array/11") - 3807 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-index-into-array/12") - 3808 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-index-into-array/13") - 3809 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-index-into-array/14") - 3810 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-index-into-array/15") - 3811 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-index-into-array/16") - 3812 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-index-into-array/17") - 3813 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-index-into-array/18") - 3814 # . epilogue - 3815 89/<- %esp 5/r32/ebp + 3713 (clear-stream _test-input-stream) + 3714 (clear-stream $_test-input-buffered-file->buffer) + 3715 (clear-stream _test-output-stream) + 3716 (clear-stream $_test-output-buffered-file->buffer) + 3717 # + 3718 (write _test-input-stream "fn foo {\n") + 3719 (write _test-input-stream " var a: (array int 3)\n") + 3720 (write _test-input-stream " var b/eax: int <- length a\n") + 3721 (write _test-input-stream "}\n") + 3722 # convert + 3723 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 3724 (flush _test-output-buffered-file) + 3725 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 3731 # check output + 3732 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-length-of-array-on-stack/0") + 3733 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-length-of-array-on-stack/1") + 3734 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-length-of-array-on-stack/2") + 3735 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-length-of-array-on-stack/3") + 3736 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-length-of-array-on-stack/4") + 3737 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-length-of-array-on-stack/5") + 3738 # define x + 3739 (check-next-stream-line-equal _test-output-stream " (push-n-zero-bytes 0x0000000c)" "F - test-convert-length-of-array-on-stack/6") + 3740 (check-next-stream-line-equal _test-output-stream " 68/push 0x0000000c/imm32" "F - test-convert-length-of-array-on-stack/7") + 3741 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-length-of-array-on-stack/8") + 3742 (check-next-stream-line-equal _test-output-stream " 8b/-> *(ebp+0xfffffff0) 0x00000000/r32" "F - test-convert-length-of-array-on-stack/9") + 3743 (check-next-stream-line-equal _test-output-stream " c1/shift 5/subop/>> %eax 0x00000002/imm8" "F - test-convert-length-of-array-on-stack/10") + 3744 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-length-of-array-on-stack/11") + 3745 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000010/imm32" "F - test-convert-length-of-array-on-stack/12") + 3746 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-length-of-array-on-stack/13") + 3747 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-length-of-array-on-stack/14") + 3748 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-length-of-array-on-stack/15") + 3749 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-length-of-array-on-stack/16") + 3750 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-length-of-array-on-stack/17") + 3751 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-length-of-array-on-stack/18") + 3752 # . epilogue + 3753 89/<- %esp 5/r32/ebp + 3754 5d/pop-to-ebp + 3755 c3/return + 3756 + 3757 test-reg-var-def-with-read-of-same-register: + 3758 # . prologue + 3759 55/push-ebp + 3760 89/<- %ebp 4/r32/esp + 3761 # setup + 3762 (clear-stream _test-input-stream) + 3763 (clear-stream $_test-input-buffered-file->buffer) + 3764 (clear-stream _test-output-stream) + 3765 (clear-stream $_test-output-buffered-file->buffer) + 3766 (clear-stream _test-error-stream) + 3767 (clear-stream $_test-error-buffered-file->buffer) + 3768 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) # bytes of args in call to convert-mu + 3769 68/push 0/imm32 + 3770 68/push 0/imm32 + 3771 89/<- %edx 4/r32/esp + 3772 (tailor-exit-descriptor %edx 0x10) + 3773 # + 3774 (write _test-input-stream "fn foo {\n") + 3775 (write _test-input-stream " var arr/eax: (addr array int) <- copy 0\n") + 3776 (write _test-input-stream " var idx/ecx: int <- copy 3\n") + 3777 (write _test-input-stream " var x/eax: (addr int) <- index arr, idx\n") + 3778 (write _test-input-stream "}\n") + 3779 # convert + 3780 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) + 3781 # registers except esp could be clobbered at this point (though they shouldn't be) + 3782 # restore ed + 3783 89/<- %edx 4/r32/esp + 3784 (flush _test-output-buffered-file) + 3785 (flush _test-error-buffered-file) + 3786 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 3792 (check-stream-equal _test-error-stream "" "F - test-reg-var-def-with-read-of-same-register: error stream should be empty") + 3793 # check output + 3794 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-reg-var-def-with-read-of-same-register/0") + 3795 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-reg-var-def-with-read-of-same-register/1") + 3796 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-reg-var-def-with-read-of-same-register/2") + 3797 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-reg-var-def-with-read-of-same-register/3") + 3798 (check-next-stream-line-equal _test-output-stream " {" "F - test-reg-var-def-with-read-of-same-register/4") + 3799 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-reg-var-def-with-read-of-same-register/5") + 3800 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-reg-var-def-with-read-of-same-register/6") + 3801 (check-next-stream-line-equal _test-output-stream " b8/copy-to-eax 0/imm32" "F - test-reg-var-def-with-read-of-same-register/7") + 3802 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-reg-var-def-with-read-of-same-register/8") + 3803 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 3/imm32" "F - test-reg-var-def-with-read-of-same-register/9") + 3804 (check-next-stream-line-equal _test-output-stream " 8d/copy-address *(eax + ecx<<0x00000002 + 4) 0x00000000/r32" "F - test-reg-var-def-with-read-of-same-register/11") + 3805 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-reg-var-def-with-read-of-same-register/13") + 3806 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-reg-var-def-with-read-of-same-register/14") + 3807 (check-next-stream-line-equal _test-output-stream " }" "F - test-reg-var-def-with-read-of-same-register/15") + 3808 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-reg-var-def-with-read-of-same-register/16") + 3809 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-reg-var-def-with-read-of-same-register/17") + 3810 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-reg-var-def-with-read-of-same-register/18") + 3811 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-reg-var-def-with-read-of-same-register/19") + 3812 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-reg-var-def-with-read-of-same-register/20") + 3813 # don't restore from ebp + 3814 81 0/subop/add %esp 8/imm32 + 3815 # . epilogue 3816 5d/pop-to-ebp 3817 c3/return 3818 - 3819 test-convert-index-into-array-of-bytes: + 3819 test-convert-index-into-array: 3820 # . prologue 3821 55/push-ebp 3822 89/<- %ebp 4/r32/esp 3823 # setup - 3824 (clear-stream _test-input-stream) - 3825 (clear-stream $_test-input-buffered-file->buffer) - 3826 (clear-stream _test-output-stream) - 3827 (clear-stream $_test-output-buffered-file->buffer) + 3824 (clear-stream _test-input-stream) + 3825 (clear-stream $_test-input-buffered-file->buffer) + 3826 (clear-stream _test-output-stream) + 3827 (clear-stream $_test-output-buffered-file->buffer) 3828 # - 3829 (write _test-input-stream "fn foo {\n") - 3830 (write _test-input-stream " var arr/eax: (addr array byte) <- copy 0\n") - 3831 (write _test-input-stream " var idx/ecx: int <- copy 3\n") - 3832 (write _test-input-stream " var x/eax: (addr byte) <- index arr, idx\n") - 3833 (write _test-input-stream "}\n") + 3829 (write _test-input-stream "fn foo {\n") + 3830 (write _test-input-stream " var arr/eax: (addr array int) <- copy 0\n") + 3831 (write _test-input-stream " var idx/ecx: int <- copy 3\n") + 3832 (write _test-input-stream " var x/eax: (addr int) <- index arr, idx\n") + 3833 (write _test-input-stream "}\n") 3834 # convert - 3835 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 3836 (flush _test-output-buffered-file) + 3835 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 3836 (flush _test-output-buffered-file) 3837 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- 3843 # check output - 3844 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-index-into-array-of-bytes/0") - 3845 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-index-into-array-of-bytes/1") - 3846 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-index-into-array-of-bytes/2") - 3847 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-index-into-array-of-bytes/3") - 3848 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-index-into-array-of-bytes/4") - 3849 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-index-into-array-of-bytes/5") - 3850 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-index-into-array-of-bytes/6") - 3851 (check-next-stream-line-equal _test-output-stream " b8/copy-to-eax 0/imm32" "F - test-convert-index-into-array-of-bytes/7") - 3852 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-convert-index-into-array-of-bytes/8") - 3853 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 3/imm32" "F - test-convert-index-into-array-of-bytes/9") - 3854 (check-next-stream-line-equal _test-output-stream " 8d/copy-address *(eax + ecx<<0x00000000 + 4) 0x00000000/r32" "F - test-convert-index-into-array-of-bytes/11") - 3855 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-convert-index-into-array-of-bytes/13") - 3856 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-index-into-array-of-bytes/14") - 3857 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-index-into-array-of-bytes/15") - 3858 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-index-into-array-of-bytes/16") - 3859 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-index-into-array-of-bytes/17") - 3860 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-index-into-array-of-bytes/18") - 3861 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-index-into-array-of-bytes/19") - 3862 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-index-into-array-of-bytes/20") + 3844 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-index-into-array/0") + 3845 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-index-into-array/1") + 3846 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-index-into-array/2") + 3847 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-index-into-array/3") + 3848 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-index-into-array/4") + 3849 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-index-into-array/5") + 3850 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-index-into-array/6") + 3851 (check-next-stream-line-equal _test-output-stream " b8/copy-to-eax 0/imm32" "F - test-convert-index-into-array/7") + 3852 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-convert-index-into-array/8") + 3853 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 3/imm32" "F - test-convert-index-into-array/9") + 3854 (check-next-stream-line-equal _test-output-stream " 8d/copy-address *(eax + ecx<<0x00000002 + 4) 0x00000000/r32" "F - test-convert-index-into-array/10") + 3855 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-convert-index-into-array/11") + 3856 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-index-into-array/12") + 3857 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-index-into-array/13") + 3858 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-index-into-array/14") + 3859 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-index-into-array/15") + 3860 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-index-into-array/16") + 3861 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-index-into-array/17") + 3862 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-index-into-array/18") 3863 # . epilogue 3864 89/<- %esp 5/r32/ebp 3865 5d/pop-to-ebp 3866 c3/return 3867 - 3868 test-convert-index-into-array-with-literal: + 3868 test-convert-index-into-array-of-bytes: 3869 # . prologue 3870 55/push-ebp 3871 89/<- %ebp 4/r32/esp 3872 # setup - 3873 (clear-stream _test-input-stream) - 3874 (clear-stream $_test-input-buffered-file->buffer) - 3875 (clear-stream _test-output-stream) - 3876 (clear-stream $_test-output-buffered-file->buffer) + 3873 (clear-stream _test-input-stream) + 3874 (clear-stream $_test-input-buffered-file->buffer) + 3875 (clear-stream _test-output-stream) + 3876 (clear-stream $_test-output-buffered-file->buffer) 3877 # - 3878 (write _test-input-stream "fn foo {\n") - 3879 (write _test-input-stream " var arr/eax: (addr array int) <- copy 0\n") - 3880 (write _test-input-stream " var x/eax: (addr int) <- index arr, 2\n") - 3881 (write _test-input-stream "}\n") - 3882 # convert - 3883 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 3884 (flush _test-output-buffered-file) - 3885 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 3891 # check output - 3892 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-index-into-array-with-literal/0") - 3893 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-index-into-array-with-literal/1") - 3894 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-index-into-array-with-literal/2") - 3895 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-index-into-array-with-literal/3") - 3896 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-index-into-array-with-literal/4") - 3897 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-index-into-array-with-literal/5") - 3898 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-index-into-array-with-literal/6") - 3899 (check-next-stream-line-equal _test-output-stream " b8/copy-to-eax 0/imm32" "F - test-convert-index-into-array-with-literal/7") - 3900 # 2 * 4 bytes/elem + 4 bytes for size = offset 12 - 3901 (check-next-stream-line-equal _test-output-stream " 8d/copy-address *(eax + 0x0000000c) 0x00000000/r32" "F - test-convert-index-into-array-with-literal/8") - 3902 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-index-into-array-with-literal/9") - 3903 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-index-into-array-with-literal/10") - 3904 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-index-into-array-with-literal/11") - 3905 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-index-into-array-with-literal/12") - 3906 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-index-into-array-with-literal/13") - 3907 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-index-into-array-with-literal/14") - 3908 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-index-into-array-with-literal/15") - 3909 # . epilogue - 3910 89/<- %esp 5/r32/ebp - 3911 5d/pop-to-ebp - 3912 c3/return - 3913 - 3914 test-convert-index-into-array-of-bytes-with-literal: - 3915 # . prologue - 3916 55/push-ebp - 3917 89/<- %ebp 4/r32/esp - 3918 # setup - 3919 (clear-stream _test-input-stream) - 3920 (clear-stream $_test-input-buffered-file->buffer) - 3921 (clear-stream _test-output-stream) - 3922 (clear-stream $_test-output-buffered-file->buffer) - 3923 # - 3924 (write _test-input-stream "fn foo {\n") - 3925 (write _test-input-stream " var arr/eax: (addr array byte) <- copy 0\n") - 3926 (write _test-input-stream " var x/eax: (addr byte) <- index arr, 2\n") - 3927 (write _test-input-stream "}\n") - 3928 # convert - 3929 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 3930 (flush _test-output-buffered-file) - 3931 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 3937 # check output - 3938 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-index-into-array-of-bytes-with-literal/0") - 3939 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-index-into-array-of-bytes-with-literal/1") - 3940 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-index-into-array-of-bytes-with-literal/2") - 3941 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-index-into-array-of-bytes-with-literal/3") - 3942 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-index-into-array-of-bytes-with-literal/4") - 3943 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-index-into-array-of-bytes-with-literal/5") - 3944 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-index-into-array-of-bytes-with-literal/6") - 3945 (check-next-stream-line-equal _test-output-stream " b8/copy-to-eax 0/imm32" "F - test-convert-index-into-array-of-bytes-with-literal/7") - 3946 # 2 * 1 byte/elem + 4 bytes for size = offset 6 - 3947 (check-next-stream-line-equal _test-output-stream " 8d/copy-address *(eax + 0x00000006) 0x00000000/r32" "F - test-convert-index-into-array-of-bytes-with-literal/8") - 3948 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-index-into-array-of-bytes-with-literal/9") - 3949 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-index-into-array-of-bytes-with-literal/10") - 3950 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-index-into-array-of-bytes-with-literal/11") - 3951 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-index-into-array-of-bytes-with-literal/12") - 3952 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-index-into-array-of-bytes-with-literal/13") - 3953 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-index-into-array-of-bytes-with-literal/14") - 3954 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-index-into-array-of-bytes-with-literal/15") - 3955 # . epilogue - 3956 89/<- %esp 5/r32/ebp - 3957 5d/pop-to-ebp - 3958 c3/return - 3959 - 3960 test-convert-index-into-array-on-stack: - 3961 # . prologue - 3962 55/push-ebp - 3963 89/<- %ebp 4/r32/esp - 3964 # setup - 3965 (clear-stream _test-input-stream) - 3966 (clear-stream $_test-input-buffered-file->buffer) - 3967 (clear-stream _test-output-stream) - 3968 (clear-stream $_test-output-buffered-file->buffer) - 3969 # - 3970 (write _test-input-stream "fn foo {\n") - 3971 (write _test-input-stream " var arr: (array int 3)\n") - 3972 (write _test-input-stream " var idx/eax: int <- copy 2\n") - 3973 (write _test-input-stream " var x/eax: (addr int) <- index arr, idx\n") - 3974 (write _test-input-stream "}\n") - 3975 # convert - 3976 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 3977 (flush _test-output-buffered-file) - 3978 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 3984 # check output - 3985 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-index-into-array-on-stack/0") - 3986 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-index-into-array-on-stack/1") - 3987 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-index-into-array-on-stack/2") - 3988 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-index-into-array-on-stack/3") - 3989 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-index-into-array-on-stack/4") - 3990 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-index-into-array-on-stack/5") - 3991 # var arr - 3992 (check-next-stream-line-equal _test-output-stream " (push-n-zero-bytes 0x0000000c)" "F - test-convert-index-into-array-on-stack/6") - 3993 (check-next-stream-line-equal _test-output-stream " 68/push 0x0000000c/imm32" "F - test-convert-index-into-array-on-stack/7") - 3994 # var idx - 3995 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-index-into-array-on-stack/8") - 3996 (check-next-stream-line-equal _test-output-stream " b8/copy-to-eax 2/imm32" "F - test-convert-index-into-array-on-stack/9") - 3997 # var x is at (ebp-0x10) + idx<<2 + 4 = ebp + idx<<2 - 0xc - 3998 (check-next-stream-line-equal _test-output-stream " 8d/copy-address *(ebp + eax<<0x00000002 + 0xfffffff4) 0x00000000/r32" "F - test-convert-index-into-array-on-stack/10") - 3999 # reclaim idx - 4000 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-index-into-array-on-stack/11") - 4001 # reclaim arr - 4002 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000010/imm32" "F - test-convert-index-into-array-on-stack/12") - 4003 # - 4004 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-index-into-array-on-stack/13") - 4005 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-index-into-array-on-stack/14") - 4006 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-index-into-array-on-stack/15") - 4007 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-index-into-array-on-stack/16") - 4008 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-index-into-array-on-stack/17") - 4009 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-index-into-array-on-stack/18") - 4010 # . epilogue - 4011 89/<- %esp 5/r32/ebp - 4012 5d/pop-to-ebp - 4013 c3/return - 4014 - 4015 test-convert-index-into-array-on-stack-with-literal: - 4016 # . prologue - 4017 55/push-ebp - 4018 89/<- %ebp 4/r32/esp - 4019 # setup - 4020 (clear-stream _test-input-stream) - 4021 (clear-stream $_test-input-buffered-file->buffer) - 4022 (clear-stream _test-output-stream) - 4023 (clear-stream $_test-output-buffered-file->buffer) - 4024 # - 4025 (write _test-input-stream "fn foo {\n") - 4026 (write _test-input-stream " var arr: (array int 3)\n") - 4027 (write _test-input-stream " var x/eax: (addr int) <- index arr, 2\n") - 4028 (write _test-input-stream "}\n") - 4029 # convert - 4030 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 4031 (flush _test-output-buffered-file) - 4032 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 4038 # check output - 4039 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-index-into-array-on-stack-with-literal/0") - 4040 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-index-into-array-on-stack-with-literal/1") - 4041 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-index-into-array-on-stack-with-literal/2") - 4042 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-index-into-array-on-stack-with-literal/3") - 4043 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-index-into-array-on-stack-with-literal/4") - 4044 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-index-into-array-on-stack-with-literal/5") - 4045 # var arr - 4046 (check-next-stream-line-equal _test-output-stream " (push-n-zero-bytes 0x0000000c)" "F - test-convert-index-into-array-on-stack-with-literal/6") - 4047 (check-next-stream-line-equal _test-output-stream " 68/push 0x0000000c/imm32" "F - test-convert-index-into-array-on-stack-with-literal/7") - 4048 # var x - 4049 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-index-into-array-on-stack-with-literal/8") - 4050 # x is at (ebp-0x10) + 4 + 2*4 = ebp-4 - 4051 (check-next-stream-line-equal _test-output-stream " 8d/copy-address *(ebp + 0xfffffffc) 0x00000000/r32" "F - test-convert-index-into-array-on-stack-with-literal/9") - 4052 # reclaim x - 4053 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-index-into-array-on-stack-with-literal/10") - 4054 # reclaim arr - 4055 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000010/imm32" "F - test-convert-index-into-array-on-stack-with-literal/11") - 4056 # - 4057 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-index-into-array-on-stack-with-literal/12") - 4058 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-index-into-array-on-stack-with-literal/13") - 4059 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-index-into-array-on-stack-with-literal/14") - 4060 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-index-into-array-on-stack-with-literal/15") - 4061 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-index-into-array-on-stack-with-literal/16") - 4062 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-index-into-array-on-stack-with-literal/17") - 4063 # . epilogue - 4064 89/<- %esp 5/r32/ebp - 4065 5d/pop-to-ebp - 4066 c3/return - 4067 - 4068 test-convert-index-into-array-of-bytes-on-stack-with-literal: - 4069 # . prologue - 4070 55/push-ebp - 4071 89/<- %ebp 4/r32/esp - 4072 # setup - 4073 (clear-stream _test-input-stream) - 4074 (clear-stream $_test-input-buffered-file->buffer) - 4075 (clear-stream _test-output-stream) - 4076 (clear-stream $_test-output-buffered-file->buffer) - 4077 # - 4078 (write _test-input-stream "fn foo {\n") - 4079 (write _test-input-stream " var arr: (array byte 3)\n") - 4080 (write _test-input-stream " var x/eax: (addr byte) <- index arr, 2\n") - 4081 (write _test-input-stream "}\n") - 4082 # convert - 4083 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 4084 (flush _test-output-buffered-file) - 4085 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 4091 # check output - 4092 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-index-into-array-of-bytes-on-stack-with-literal/0") - 4093 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-index-into-array-of-bytes-on-stack-with-literal/1") - 4094 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-index-into-array-of-bytes-on-stack-with-literal/2") - 4095 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-index-into-array-of-bytes-on-stack-with-literal/3") - 4096 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-index-into-array-of-bytes-on-stack-with-literal/4") - 4097 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-index-into-array-of-bytes-on-stack-with-literal/5") - 4098 # var arr - 4099 (check-next-stream-line-equal _test-output-stream " (push-n-zero-bytes 0x00000003)" "F - test-convert-index-into-array-of-bytes-on-stack-with-literal/6") - 4100 (check-next-stream-line-equal _test-output-stream " 68/push 0x00000003/imm32" "F - test-convert-index-into-array-of-bytes-on-stack-with-literal/7") - 4101 # var x - 4102 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-index-into-array-of-bytes-on-stack-with-literal/8") - 4103 # x is at (ebp-7) + 4 + 2 = ebp-1 - 4104 (check-next-stream-line-equal _test-output-stream " 8d/copy-address *(ebp + 0xffffffff) 0x00000000/r32" "F - test-convert-index-into-array-of-bytes-on-stack-with-literal/9") - 4105 # reclaim x - 4106 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-index-into-array-of-bytes-on-stack-with-literal/10") - 4107 # reclaim arr - 4108 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000007/imm32" "F - test-convert-index-into-array-of-bytes-on-stack-with-literal/11") - 4109 # - 4110 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-index-into-array-of-bytes-on-stack-with-literal/12") - 4111 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-index-into-array-of-bytes-on-stack-with-literal/13") - 4112 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-index-into-array-of-bytes-on-stack-with-literal/14") - 4113 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-index-into-array-of-bytes-on-stack-with-literal/15") - 4114 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-index-into-array-of-bytes-on-stack-with-literal/16") - 4115 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-index-into-array-of-bytes-on-stack-with-literal/17") - 4116 # . epilogue - 4117 89/<- %esp 5/r32/ebp - 4118 5d/pop-to-ebp - 4119 c3/return - 4120 - 4121 test-convert-index-into-array-using-offset: - 4122 # . prologue - 4123 55/push-ebp - 4124 89/<- %ebp 4/r32/esp - 4125 # setup - 4126 (clear-stream _test-input-stream) - 4127 (clear-stream $_test-input-buffered-file->buffer) - 4128 (clear-stream _test-output-stream) - 4129 (clear-stream $_test-output-buffered-file->buffer) - 4130 # - 4131 (write _test-input-stream "fn foo {\n") - 4132 (write _test-input-stream " var arr/eax: (addr array int) <- copy 0\n") - 4133 (write _test-input-stream " var idx/ecx: int <- copy 3\n") - 4134 (write _test-input-stream " var off/ecx: (offset int) <- compute-offset arr, idx\n") - 4135 (write _test-input-stream " var x/eax: (addr int) <- index arr, off\n") - 4136 (write _test-input-stream "}\n") - 4137 # convert - 4138 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 4139 (flush _test-output-buffered-file) - 4140 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 4146 # check output - 4147 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-index-into-array-using-offset/0") - 4148 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-index-into-array-using-offset/1") - 4149 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-index-into-array-using-offset/2") - 4150 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-index-into-array-using-offset/3") - 4151 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-index-into-array-using-offset/4") - 4152 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-index-into-array-using-offset/5") - 4153 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-index-into-array-using-offset/6") - 4154 (check-next-stream-line-equal _test-output-stream " b8/copy-to-eax 0/imm32" "F - test-convert-index-into-array-using-offset/7") - 4155 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-convert-index-into-array-using-offset/8") - 4156 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 3/imm32" "F - test-convert-index-into-array-using-offset/9") - 4157 (check-next-stream-line-equal _test-output-stream " 69/multiply %ecx 0x00000004/imm32 0x00000001/r32" "F - test-convert-index-into-array-using-offset/10") - 4158 (check-next-stream-line-equal _test-output-stream " 8d/copy-address *(eax + ecx + 4) 0x00000000/r32" "F - test-convert-index-into-array-using-offset/11") - 4159 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-convert-index-into-array-using-offset/12") - 4160 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-index-into-array-using-offset/13") - 4161 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-index-into-array-using-offset/14") - 4162 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-index-into-array-using-offset/15") - 4163 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-index-into-array-using-offset/16") - 4164 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-index-into-array-using-offset/17") - 4165 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-index-into-array-using-offset/18") - 4166 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-index-into-array-using-offset/19") - 4167 # . epilogue - 4168 89/<- %esp 5/r32/ebp - 4169 5d/pop-to-ebp - 4170 c3/return - 4171 - 4172 test-convert-index-into-array-of-bytes-using-offset: - 4173 # . prologue - 4174 55/push-ebp - 4175 89/<- %ebp 4/r32/esp - 4176 # setup - 4177 (clear-stream _test-input-stream) - 4178 (clear-stream $_test-input-buffered-file->buffer) - 4179 (clear-stream _test-output-stream) - 4180 (clear-stream $_test-output-buffered-file->buffer) - 4181 # - 4182 (write _test-input-stream "fn foo {\n") - 4183 (write _test-input-stream " var arr/eax: (addr array byte) <- copy 0\n") - 4184 (write _test-input-stream " var idx/ecx: int <- copy 3\n") - 4185 (write _test-input-stream " var off/ecx: (offset byte) <- compute-offset arr, idx\n") - 4186 (write _test-input-stream " var x/eax: (addr byte) <- index arr, off\n") - 4187 (write _test-input-stream "}\n") - 4188 # convert - 4189 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 4190 (flush _test-output-buffered-file) - 4191 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 4197 # check output - 4198 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-index-into-array-of-bytes-using-offset/0") - 4199 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-index-into-array-of-bytes-using-offset/1") - 4200 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-index-into-array-of-bytes-using-offset/2") - 4201 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-index-into-array-of-bytes-using-offset/3") - 4202 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-index-into-array-of-bytes-using-offset/4") - 4203 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-index-into-array-of-bytes-using-offset/5") - 4204 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-index-into-array-of-bytes-using-offset/6") - 4205 (check-next-stream-line-equal _test-output-stream " b8/copy-to-eax 0/imm32" "F - test-convert-index-into-array-of-bytes-using-offset/7") - 4206 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-convert-index-into-array-of-bytes-using-offset/8") - 4207 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 3/imm32" "F - test-convert-index-into-array-of-bytes-using-offset/9") - 4208 (check-next-stream-line-equal _test-output-stream " 69/multiply %ecx 0x00000001/imm32 0x00000001/r32" "F - test-convert-index-into-array-of-bytes-using-offset/10") - 4209 (check-next-stream-line-equal _test-output-stream " 8d/copy-address *(eax + ecx + 4) 0x00000000/r32" "F - test-convert-index-into-array-of-bytes-using-offset/11") - 4210 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-convert-index-into-array-of-bytes-using-offset/12") - 4211 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-index-into-array-of-bytes-using-offset/13") - 4212 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-index-into-array-of-bytes-using-offset/14") - 4213 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-index-into-array-of-bytes-using-offset/15") - 4214 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-index-into-array-of-bytes-using-offset/16") - 4215 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-index-into-array-of-bytes-using-offset/17") - 4216 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-index-into-array-of-bytes-using-offset/18") - 4217 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-index-into-array-of-bytes-using-offset/19") - 4218 # . epilogue - 4219 89/<- %esp 5/r32/ebp - 4220 5d/pop-to-ebp - 4221 c3/return - 4222 - 4223 test-convert-index-into-array-using-offset-on-stack: - 4224 # . prologue - 4225 55/push-ebp - 4226 89/<- %ebp 4/r32/esp - 4227 # setup - 4228 (clear-stream _test-input-stream) - 4229 (clear-stream $_test-input-buffered-file->buffer) - 4230 (clear-stream _test-output-stream) - 4231 (clear-stream $_test-output-buffered-file->buffer) - 4232 # - 4233 (write _test-input-stream "fn foo {\n") - 4234 (write _test-input-stream " var arr/eax: (addr array int) <- copy 0\n") - 4235 (write _test-input-stream " var idx: int\n") - 4236 (write _test-input-stream " var off/ecx: (offset int) <- compute-offset arr, idx\n") - 4237 (write _test-input-stream " var x/eax: (addr int) <- index arr, off\n") - 4238 (write _test-input-stream "}\n") - 4239 # convert - 4240 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 4241 (flush _test-output-buffered-file) - 4242 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 4248 # check output - 4249 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-index-into-array-using-offset-on-stack/0") - 4250 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-index-into-array-using-offset-on-stack/1") - 4251 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-index-into-array-using-offset-on-stack/2") - 4252 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-index-into-array-using-offset-on-stack/3") - 4253 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-index-into-array-using-offset-on-stack/4") - 4254 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-index-into-array-using-offset-on-stack/5") - 4255 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-index-into-array-using-offset-on-stack/6") - 4256 (check-next-stream-line-equal _test-output-stream " b8/copy-to-eax 0/imm32" "F - test-convert-index-into-array-using-offset-on-stack/7") - 4257 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-index-into-array-using-offset-on-stack/8") - 4258 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-convert-index-into-array-using-offset-on-stack/9") - 4259 (check-next-stream-line-equal _test-output-stream " 69/multiply *(ebp+0xfffffff8) 0x00000004/imm32 0x00000001/r32" "F - test-convert-index-into-array-using-offset-on-stack/10") - 4260 (check-next-stream-line-equal _test-output-stream " 8d/copy-address *(eax + ecx + 4) 0x00000000/r32" "F - test-convert-index-into-array-using-offset-on-stack/11") - 4261 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-convert-index-into-array-using-offset-on-stack/12") - 4262 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-index-into-array-using-offset-on-stack/13") - 4263 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-index-into-array-using-offset-on-stack/14") - 4264 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-index-into-array-using-offset-on-stack/15") - 4265 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-index-into-array-using-offset-on-stack/16") - 4266 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-index-into-array-using-offset-on-stack/17") - 4267 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-index-into-array-using-offset-on-stack/18") - 4268 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-index-into-array-using-offset-on-stack/19") - 4269 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-index-into-array-using-offset-on-stack/20") - 4270 # . epilogue - 4271 89/<- %esp 5/r32/ebp - 4272 5d/pop-to-ebp - 4273 c3/return - 4274 - 4275 test-convert-index-into-array-of-bytes-using-offset-on-stack: - 4276 # . prologue - 4277 55/push-ebp - 4278 89/<- %ebp 4/r32/esp - 4279 # setup - 4280 (clear-stream _test-input-stream) - 4281 (clear-stream $_test-input-buffered-file->buffer) - 4282 (clear-stream _test-output-stream) - 4283 (clear-stream $_test-output-buffered-file->buffer) - 4284 # - 4285 (write _test-input-stream "fn foo {\n") - 4286 (write _test-input-stream " var arr/eax: (addr array byte) <- copy 0\n") - 4287 (write _test-input-stream " var idx: int\n") - 4288 (write _test-input-stream " var off/ecx: (offset byte) <- compute-offset arr, idx\n") - 4289 (write _test-input-stream " var x/eax: (addr byte) <- index arr, off\n") - 4290 (write _test-input-stream "}\n") - 4291 # convert - 4292 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 4293 (flush _test-output-buffered-file) - 4294 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 4300 # check output - 4301 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/0") - 4302 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/1") - 4303 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/2") - 4304 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/3") - 4305 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/4") - 4306 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/5") - 4307 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/6") - 4308 (check-next-stream-line-equal _test-output-stream " b8/copy-to-eax 0/imm32" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/7") - 4309 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/8") - 4310 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/9") - 4311 (check-next-stream-line-equal _test-output-stream " 69/multiply *(ebp+0xfffffff8) 0x00000001/imm32 0x00000001/r32" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/10") - 4312 (check-next-stream-line-equal _test-output-stream " 8d/copy-address *(eax + ecx + 4) 0x00000000/r32" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/11") - 4313 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/12") - 4314 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/13") - 4315 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/14") - 4316 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/15") - 4317 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/16") - 4318 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/17") - 4319 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/18") - 4320 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/19") - 4321 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/20") - 4322 # . epilogue - 4323 89/<- %esp 5/r32/ebp - 4324 5d/pop-to-ebp - 4325 c3/return - 4326 - 4327 test-convert-function-and-type-definition: - 4328 # . prologue - 4329 55/push-ebp - 4330 89/<- %ebp 4/r32/esp - 4331 # setup - 4332 (clear-stream _test-input-stream) - 4333 (clear-stream $_test-input-buffered-file->buffer) - 4334 (clear-stream _test-output-stream) - 4335 (clear-stream $_test-output-buffered-file->buffer) - 4336 # - 4337 (write _test-input-stream "fn foo a: (addr t) {\n") - 4338 (write _test-input-stream " var _a/eax: (addr t) <- copy a\n") - 4339 (write _test-input-stream " var b/ecx: (addr int) <- get _a, x\n") - 4340 (write _test-input-stream " var c/ecx: (addr int) <- get _a, y\n") - 4341 (write _test-input-stream "}\n") - 4342 (write _test-input-stream "type t {\n") - 4343 (write _test-input-stream " x: int\n") - 4344 (write _test-input-stream " y: int\n") - 4345 (write _test-input-stream "}\n") - 4346 # convert - 4347 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 4348 (flush _test-output-buffered-file) - 4349 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 4355 # check output - 4356 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-and-type-definition/0") - 4357 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-and-type-definition/1") - 4358 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-and-type-definition/2") - 4359 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-and-type-definition/3") - 4360 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-and-type-definition/4") - 4361 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-and-type-definition/5") - 4362 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-function-and-type-definition/6") - 4363 (check-next-stream-line-equal _test-output-stream " 8b/-> *(ebp+0x00000008) 0x00000000/r32" "F - test-convert-function-and-type-definition/7") - 4364 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-convert-function-and-type-definition/8") - 4365 (check-next-stream-line-equal _test-output-stream " 8d/copy-address *(eax + 0x00000000) 0x00000001/r32" "F - test-convert-function-and-type-definition/9") - 4366 (check-next-stream-line-equal _test-output-stream " 8d/copy-address *(eax + 0x00000004) 0x00000001/r32" "F - test-convert-function-and-type-definition/11") - 4367 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-convert-function-and-type-definition/13") - 4368 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-function-and-type-definition/14") - 4369 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-and-type-definition/15") - 4370 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-and-type-definition/16") - 4371 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-and-type-definition/17") - 4372 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-and-type-definition/18") - 4373 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-and-type-definition/19") - 4374 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-and-type-definition/20") - 4375 # . epilogue - 4376 89/<- %esp 5/r32/ebp - 4377 5d/pop-to-ebp - 4378 c3/return - 4379 - 4380 test-convert-function-with-local-var-with-user-defined-type: - 4381 # . prologue - 4382 55/push-ebp - 4383 89/<- %ebp 4/r32/esp - 4384 # setup - 4385 (clear-stream _test-input-stream) - 4386 (clear-stream $_test-input-buffered-file->buffer) - 4387 (clear-stream _test-output-stream) - 4388 (clear-stream $_test-output-buffered-file->buffer) - 4389 # - 4390 (write _test-input-stream "fn foo {\n") - 4391 (write _test-input-stream " var a: t\n") - 4392 (write _test-input-stream "}\n") - 4393 (write _test-input-stream "type t {\n") - 4394 (write _test-input-stream " x: int\n") - 4395 (write _test-input-stream " y: int\n") - 4396 (write _test-input-stream "}\n") - 4397 # convert - 4398 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 4399 (flush _test-output-buffered-file) - 4400 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 4406 # check output - 4407 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-local-var-with-user-defined-type/0") - 4408 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-local-var-with-user-defined-type/1") - 4409 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-local-var-with-user-defined-type/2") - 4410 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-local-var-with-user-defined-type/3") - 4411 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-local-var-with-user-defined-type/4") - 4412 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-local-var-with-user-defined-type/5") - 4413 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-local-var-with-user-defined-type/6") - 4414 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-local-var-with-user-defined-type/7") - 4415 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000008/imm32" "F - test-convert-function-with-local-var-with-user-defined-type/8") - 4416 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-local-var-with-user-defined-type/9") - 4417 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-local-var-with-user-defined-type/10") - 4418 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-local-var-with-user-defined-type/11") - 4419 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-local-var-with-user-defined-type/12") - 4420 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-local-var-with-user-defined-type/13") - 4421 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-local-var-with-user-defined-type/14") - 4422 # . epilogue - 4423 89/<- %esp 5/r32/ebp - 4424 5d/pop-to-ebp - 4425 c3/return - 4426 - 4427 test-convert-function-call-with-arg-of-user-defined-type: - 4428 # . prologue - 4429 55/push-ebp - 4430 89/<- %ebp 4/r32/esp - 4431 # setup - 4432 (clear-stream _test-input-stream) - 4433 (clear-stream $_test-input-buffered-file->buffer) - 4434 (clear-stream _test-output-stream) - 4435 (clear-stream $_test-output-buffered-file->buffer) - 4436 # - 4437 (write _test-input-stream "fn f {\n") - 4438 (write _test-input-stream " var a: t\n") - 4439 (write _test-input-stream " foo a\n") - 4440 (write _test-input-stream "}\n") - 4441 (write _test-input-stream "fn foo x: t {\n") - 4442 (write _test-input-stream "}\n") - 4443 (write _test-input-stream "type t {\n") - 4444 (write _test-input-stream " x: int\n") - 4445 (write _test-input-stream " y: int\n") - 4446 (write _test-input-stream "}\n") - 4447 # convert - 4448 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 4449 (flush _test-output-buffered-file) - 4450 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 4456 # check output - 4457 (check-next-stream-line-equal _test-output-stream "f:" "F - test-convert-function-call-with-arg-of-user-defined-type/0") - 4458 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-call-with-arg-of-user-defined-type/1") - 4459 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-call-with-arg-of-user-defined-type/2") - 4460 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-call-with-arg-of-user-defined-type/3") - 4461 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-call-with-arg-of-user-defined-type/4") - 4462 (check-next-stream-line-equal _test-output-stream "$f:0x00000001:loop:" "F - test-convert-function-call-with-arg-of-user-defined-type/5") - 4463 # var a: t - 4464 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-call-with-arg-of-user-defined-type/6") - 4465 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-call-with-arg-of-user-defined-type/7") - 4466 # foo a - 4467 (check-next-stream-line-equal _test-output-stream " (foo *(ebp+0xfffffff8) *(ebp+0xfffffffc))" "F - test-convert-function-call-with-arg-of-user-defined-type/8") - 4468 # - 4469 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000008/imm32" "F - test-convert-function-call-with-arg-of-user-defined-type/9") - 4470 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-call-with-arg-of-user-defined-type/10") - 4471 (check-next-stream-line-equal _test-output-stream "$f:0x00000001:break:" "F - test-convert-function-call-with-arg-of-user-defined-type/11") - 4472 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-call-with-arg-of-user-defined-type/12") - 4473 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-call-with-arg-of-user-defined-type/13") - 4474 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-call-with-arg-of-user-defined-type/14") - 4475 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-call-with-arg-of-user-defined-type/15") - 4476 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-call-with-arg-of-user-defined-type/16") - 4477 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-call-with-arg-of-user-defined-type/17") - 4478 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-call-with-arg-of-user-defined-type/18") - 4479 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-call-with-arg-of-user-defined-type/19") - 4480 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-call-with-arg-of-user-defined-type/20") - 4481 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-call-with-arg-of-user-defined-type/21") - 4482 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-call-with-arg-of-user-defined-type/22") - 4483 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-call-with-arg-of-user-defined-type/23") - 4484 # . epilogue - 4485 89/<- %esp 5/r32/ebp - 4486 5d/pop-to-ebp - 4487 c3/return - 4488 - 4489 test-convert-function-call-with-arg-of-user-defined-type-register-indirect: - 4490 # . prologue - 4491 55/push-ebp - 4492 89/<- %ebp 4/r32/esp - 4493 # setup - 4494 (clear-stream _test-input-stream) - 4495 (clear-stream $_test-input-buffered-file->buffer) - 4496 (clear-stream _test-output-stream) - 4497 (clear-stream $_test-output-buffered-file->buffer) - 4498 # - 4499 (write _test-input-stream "fn f {\n") - 4500 (write _test-input-stream " var a/eax: (addr t) <- copy 0\n") - 4501 (write _test-input-stream " foo *a\n") - 4502 (write _test-input-stream "}\n") - 4503 (write _test-input-stream "fn foo x: t {\n") - 4504 (write _test-input-stream "}\n") - 4505 (write _test-input-stream "type t {\n") - 4506 (write _test-input-stream " x: int\n") - 4507 (write _test-input-stream " y: int\n") - 4508 (write _test-input-stream "}\n") - 4509 # convert - 4510 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 4511 (flush _test-output-buffered-file) - 4512 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 4518 # check output - 4519 (check-next-stream-line-equal _test-output-stream "f:" "F - test-convert-function-call-with-arg-of-user-defined-type/0") - 4520 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-call-with-arg-of-user-defined-type/1") - 4521 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-call-with-arg-of-user-defined-type/2") - 4522 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-call-with-arg-of-user-defined-type/3") - 4523 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-call-with-arg-of-user-defined-type/4") - 4524 (check-next-stream-line-equal _test-output-stream "$f:0x00000001:loop:" "F - test-convert-function-call-with-arg-of-user-defined-type/5") - 4525 # var a - 4526 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-function-call-with-arg-of-user-defined-type/6") - 4527 (check-next-stream-line-equal _test-output-stream " b8/copy-to-eax 0/imm32" "F - test-convert-function-call-with-arg-of-user-defined-type/7") - 4528 # foo a - 4529 (check-next-stream-line-equal _test-output-stream " (foo *(eax+0x00000000) *(eax+0x00000004))" "F - test-convert-function-call-with-arg-of-user-defined-type/8") - 4530 # - 4531 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-function-call-with-arg-of-user-defined-type/9") - 4532 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-call-with-arg-of-user-defined-type/10") - 4533 (check-next-stream-line-equal _test-output-stream "$f:0x00000001:break:" "F - test-convert-function-call-with-arg-of-user-defined-type/11") - 4534 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-call-with-arg-of-user-defined-type/12") - 4535 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-call-with-arg-of-user-defined-type/13") - 4536 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-call-with-arg-of-user-defined-type/14") - 4537 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-call-with-arg-of-user-defined-type/15") - 4538 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-call-with-arg-of-user-defined-type/16") - 4539 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-call-with-arg-of-user-defined-type/17") - 4540 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-call-with-arg-of-user-defined-type/18") - 4541 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-call-with-arg-of-user-defined-type/19") - 4542 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-call-with-arg-of-user-defined-type/20") - 4543 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-call-with-arg-of-user-defined-type/21") - 4544 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-call-with-arg-of-user-defined-type/22") - 4545 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-call-with-arg-of-user-defined-type/23") - 4546 # . epilogue - 4547 89/<- %esp 5/r32/ebp - 4548 5d/pop-to-ebp - 4549 c3/return - 4550 - 4551 # we don't have special support for call-by-reference; just explicitly create - 4552 # a new variable with the address of the arg - 4553 test-convert-function-call-with-arg-of-user-defined-type-by-reference: - 4554 # . prologue - 4555 55/push-ebp - 4556 89/<- %ebp 4/r32/esp - 4557 # setup - 4558 (clear-stream _test-input-stream) - 4559 (clear-stream $_test-input-buffered-file->buffer) - 4560 (clear-stream _test-output-stream) - 4561 (clear-stream $_test-output-buffered-file->buffer) - 4562 # - 4563 (write _test-input-stream "fn f {\n") - 4564 (write _test-input-stream " var a: t\n") - 4565 (write _test-input-stream " var b/eax: (addr t) <- address a\n") - 4566 (write _test-input-stream " foo b\n") - 4567 (write _test-input-stream "}\n") - 4568 (write _test-input-stream "fn foo x: (addr t) {\n") - 4569 (write _test-input-stream " var x/ecx: (addr int) <- copy x\n") - 4570 (write _test-input-stream " increment *x\n") - 4571 (write _test-input-stream "}\n") - 4572 (write _test-input-stream "type t {\n") - 4573 (write _test-input-stream " x: int\n") - 4574 (write _test-input-stream " y: int\n") - 4575 (write _test-input-stream "}\n") - 4576 # convert - 4577 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 4578 (flush _test-output-buffered-file) - 4579 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 4585 # check output - 4586 (check-next-stream-line-equal _test-output-stream "f:" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/0") - 4587 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/1") - 4588 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/2") - 4589 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/3") - 4590 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/4") - 4591 (check-next-stream-line-equal _test-output-stream "$f:0x00000001:loop:" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/5") - 4592 # var a: t - 4593 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/6") - 4594 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/7") - 4595 # var b/eax: (addr t) - 4596 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/8") - 4597 (check-next-stream-line-equal _test-output-stream " 8d/copy-address *(ebp+0xfffffff8) 0x00000000/r32" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/9") - 4598 # foo a - 4599 (check-next-stream-line-equal _test-output-stream " (foo %eax)" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/10") - 4600 # - 4601 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/11") - 4602 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000008/imm32" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/12") - 4603 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/13") - 4604 (check-next-stream-line-equal _test-output-stream "$f:0x00000001:break:" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/14") - 4605 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/15") - 4606 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/16") - 4607 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/17") - 4608 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/18") - 4609 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/19") - 4610 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/20") - 4611 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/21") - 4612 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/22") - 4613 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/23") - 4614 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:loop:" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/24") - 4615 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/25") - 4616 (check-next-stream-line-equal _test-output-stream " 8b/-> *(ebp+0x00000008) 0x00000001/r32" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/26") - 4617 (check-next-stream-line-equal _test-output-stream " ff 0/subop/increment *ecx" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/27") - 4618 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/28") - 4619 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/29") - 4620 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:break:" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/30") - 4621 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/31") - 4622 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/32") - 4623 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/33") - 4624 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/34") - 4625 # . epilogue - 4626 89/<- %esp 5/r32/ebp - 4627 5d/pop-to-ebp - 4628 c3/return - 4629 - 4630 test-convert-get-on-local-variable: - 4631 # . prologue - 4632 55/push-ebp - 4633 89/<- %ebp 4/r32/esp - 4634 # setup - 4635 (clear-stream _test-input-stream) - 4636 (clear-stream $_test-input-buffered-file->buffer) - 4637 (clear-stream _test-output-stream) - 4638 (clear-stream $_test-output-buffered-file->buffer) - 4639 # - 4640 (write _test-input-stream "fn foo {\n") - 4641 (write _test-input-stream " var a: t\n") - 4642 (write _test-input-stream " var c/ecx: (addr int) <- get a, y\n") - 4643 (write _test-input-stream "}\n") - 4644 (write _test-input-stream "type t {\n") - 4645 (write _test-input-stream " x: int\n") - 4646 (write _test-input-stream " y: int\n") - 4647 (write _test-input-stream "}\n") - 4648 # convert - 4649 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 4650 (flush _test-output-buffered-file) - 4651 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 4657 # check output - 4658 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-get-on-local-variable/0") - 4659 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-get-on-local-variable/1") - 4660 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-get-on-local-variable/2") - 4661 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-get-on-local-variable/3") - 4662 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-get-on-local-variable/4") - 4663 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-get-on-local-variable/5") - 4664 # var a - 4665 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-get-on-local-variable/6") - 4666 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-get-on-local-variable/7") - 4667 # var c - 4668 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-convert-get-on-local-variable/8") - 4669 # get - 4670 (check-next-stream-line-equal _test-output-stream " 8d/copy-address *(ebp+0xfffffffc) 0x00000001/r32" "F - test-convert-get-on-local-variable/9") - 4671 # reclaim c - 4672 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-convert-get-on-local-variable/10") - 4673 # reclaim a - 4674 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000008/imm32" "F - test-convert-get-on-local-variable/11") - 4675 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-get-on-local-variable/12") - 4676 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-get-on-local-variable/13") - 4677 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-get-on-local-variable/14") - 4678 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-get-on-local-variable/15") - 4679 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-get-on-local-variable/16") - 4680 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-get-on-local-variable/17") - 4681 # . epilogue - 4682 89/<- %esp 5/r32/ebp - 4683 5d/pop-to-ebp - 4684 c3/return - 4685 - 4686 test-convert-get-on-function-argument: - 4687 # . prologue - 4688 55/push-ebp - 4689 89/<- %ebp 4/r32/esp - 4690 # setup - 4691 (clear-stream _test-input-stream) - 4692 (clear-stream $_test-input-buffered-file->buffer) - 4693 (clear-stream _test-output-stream) - 4694 (clear-stream $_test-output-buffered-file->buffer) - 4695 # - 4696 (write _test-input-stream "fn foo a: t {\n") - 4697 (write _test-input-stream " var c/ecx: (addr int) <- get a, y\n") - 4698 (write _test-input-stream "}\n") - 4699 (write _test-input-stream "type t {\n") - 4700 (write _test-input-stream " x: int\n") - 4701 (write _test-input-stream " y: int\n") - 4702 (write _test-input-stream "}\n") - 4703 # convert - 4704 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 4705 (flush _test-output-buffered-file) - 4706 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 4712 # check output - 4713 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-get-on-function-argument/0") - 4714 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-get-on-function-argument/1") - 4715 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-get-on-function-argument/2") - 4716 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-get-on-function-argument/3") - 4717 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-get-on-function-argument/4") - 4718 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-get-on-function-argument/5") - 4719 # var c - 4720 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-convert-get-on-function-argument/6") - 4721 # get - 4722 (check-next-stream-line-equal _test-output-stream " 8d/copy-address *(ebp+0x0000000c) 0x00000001/r32" "F - test-convert-get-on-function-argument/7") - 4723 # reclaim c - 4724 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-convert-get-on-function-argument/8") - 4725 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-get-on-function-argument/9") - 4726 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-get-on-function-argument/10") - 4727 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-get-on-function-argument/11") - 4728 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-get-on-function-argument/12") - 4729 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-get-on-function-argument/13") - 4730 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-get-on-function-argument/14") - 4731 # . epilogue - 4732 89/<- %esp 5/r32/ebp - 4733 5d/pop-to-ebp - 4734 c3/return - 4735 - 4736 test-convert-get-on-function-argument-with-known-type: - 4737 # . prologue - 4738 55/push-ebp - 4739 89/<- %ebp 4/r32/esp - 4740 # setup - 4741 (clear-stream _test-input-stream) - 4742 (clear-stream $_test-input-buffered-file->buffer) - 4743 (clear-stream _test-output-stream) - 4744 (clear-stream $_test-output-buffered-file->buffer) - 4745 # - 4746 (write _test-input-stream "type t {\n") - 4747 (write _test-input-stream " x: int\n") - 4748 (write _test-input-stream " y: int\n") - 4749 (write _test-input-stream "}\n") - 4750 (write _test-input-stream "fn foo a: t {\n") - 4751 (write _test-input-stream " var c/ecx: (addr int) <- get a, y\n") - 4752 (write _test-input-stream "}\n") - 4753 # convert - 4754 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 4755 (flush _test-output-buffered-file) - 4756 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 4762 # check output - 4763 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-get-on-function-argument-with-known-type/0") - 4764 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-get-on-function-argument-with-known-type/1") - 4765 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-get-on-function-argument-with-known-type/2") - 4766 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-get-on-function-argument-with-known-type/3") - 4767 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-get-on-function-argument-with-known-type/4") - 4768 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-get-on-function-argument-with-known-type/5") - 4769 # var c - 4770 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-convert-get-on-function-argument-with-known-type/6") - 4771 # get - 4772 (check-next-stream-line-equal _test-output-stream " 8d/copy-address *(ebp+0x0000000c) 0x00000001/r32" "F - test-convert-get-on-function-argument-with-known-type/7") - 4773 # reclaim c - 4774 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-convert-get-on-function-argument-with-known-type/8") - 4775 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-get-on-function-argument-with-known-type/9") - 4776 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-get-on-function-argument-with-known-type/10") - 4777 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-get-on-function-argument-with-known-type/11") - 4778 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-get-on-function-argument-with-known-type/12") - 4779 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-get-on-function-argument-with-known-type/13") - 4780 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-get-on-function-argument-with-known-type/14") - 4781 # . epilogue - 4782 89/<- %esp 5/r32/ebp - 4783 5d/pop-to-ebp - 4784 c3/return - 4785 - 4786 test-add-with-too-many-inouts: - 4787 # . prologue - 4788 55/push-ebp - 4789 89/<- %ebp 4/r32/esp - 4790 # setup - 4791 (clear-stream _test-input-stream) - 4792 (clear-stream $_test-input-buffered-file->buffer) - 4793 (clear-stream _test-output-stream) - 4794 (clear-stream $_test-output-buffered-file->buffer) - 4795 (clear-stream _test-error-stream) - 4796 (clear-stream $_test-error-buffered-file->buffer) - 4797 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) - 4798 68/push 0/imm32 - 4799 68/push 0/imm32 - 4800 89/<- %edx 4/r32/esp - 4801 (tailor-exit-descriptor %edx 0x10) - 4802 # - 4803 (write _test-input-stream "fn foo {\n") - 4804 (write _test-input-stream " var a: int\n") - 4805 (write _test-input-stream " var b/ecx: int <- add a, 0\n") - 4806 (write _test-input-stream "}\n") - 4807 # convert - 4808 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) - 4809 # registers except esp clobbered at this point - 4810 # restore ed - 4811 89/<- %edx 4/r32/esp - 4812 (flush _test-output-buffered-file) - 4813 (flush _test-error-buffered-file) - 4814 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ - 4820 # check output - 4821 (check-stream-equal _test-output-stream "" "F - test-add-with-too-many-inouts: output should be empty") - 4822 (check-next-stream-line-equal _test-error-stream "fn foo: stmt add: too many inouts; most primitives support at most two arguments, across inouts and outputs" "F - test-add-with-too-many-inouts: error message") - 4823 # check that stop(1) was called - 4824 (check-ints-equal *(edx+4) 2 "F - test-add-with-too-many-inouts: exit status") - 4825 # don't restore from ebp - 4826 81 0/subop/add %esp 8/imm32 - 4827 # . epilogue - 4828 5d/pop-to-ebp - 4829 c3/return - 4830 - 4831 test-add-with-too-many-inouts-2: - 4832 # . prologue - 4833 55/push-ebp - 4834 89/<- %ebp 4/r32/esp - 4835 # setup - 4836 (clear-stream _test-input-stream) - 4837 (clear-stream $_test-input-buffered-file->buffer) - 4838 (clear-stream _test-output-stream) - 4839 (clear-stream $_test-output-buffered-file->buffer) - 4840 (clear-stream _test-error-stream) - 4841 (clear-stream $_test-error-buffered-file->buffer) - 4842 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) - 4843 68/push 0/imm32 - 4844 68/push 0/imm32 - 4845 89/<- %edx 4/r32/esp - 4846 (tailor-exit-descriptor %edx 0x10) - 4847 # - 4848 (write _test-input-stream "fn foo {\n") - 4849 (write _test-input-stream " var a: int\n") - 4850 (write _test-input-stream " add-to a, 0, 1\n") - 4851 (write _test-input-stream "}\n") - 4852 # convert - 4853 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) - 4854 # registers except esp clobbered at this point - 4855 # restore ed - 4856 89/<- %edx 4/r32/esp - 4857 (flush _test-output-buffered-file) - 4858 (flush _test-error-buffered-file) - 4859 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ - 4865 # check output - 4866 (check-stream-equal _test-output-stream "" "F - test-add-with-too-many-inouts-2: output should be empty") - 4867 (check-next-stream-line-equal _test-error-stream "fn foo: stmt add-to: too many inouts; most primitives support at most two arguments, across inouts and outputs" "F - test-add-with-too-many-inouts-2: error message") - 4868 # check that stop(1) was called - 4869 (check-ints-equal *(edx+4) 2 "F - test-add-with-too-many-inouts-2: exit status") - 4870 # don't restore from ebp - 4871 81 0/subop/add %esp 8/imm32 - 4872 # . epilogue - 4873 5d/pop-to-ebp - 4874 c3/return - 4875 - 4876 test-add-with-too-many-outputs: - 4877 # . prologue - 4878 55/push-ebp - 4879 89/<- %ebp 4/r32/esp - 4880 # setup - 4881 (clear-stream _test-input-stream) - 4882 (clear-stream $_test-input-buffered-file->buffer) - 4883 (clear-stream _test-output-stream) - 4884 (clear-stream $_test-output-buffered-file->buffer) - 4885 (clear-stream _test-error-stream) - 4886 (clear-stream $_test-error-buffered-file->buffer) - 4887 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) - 4888 68/push 0/imm32 - 4889 68/push 0/imm32 - 4890 89/<- %edx 4/r32/esp - 4891 (tailor-exit-descriptor %edx 0x10) - 4892 # - 4893 (write _test-input-stream "fn foo {\n") - 4894 (write _test-input-stream " var a/eax: int <- copy 0\n") - 4895 (write _test-input-stream " var b/ebx: int <- copy 0\n") - 4896 (write _test-input-stream " var c/ecx: int <- copy 0\n") - 4897 (write _test-input-stream " c, b <- add a\n") - 4898 (write _test-input-stream "}\n") - 4899 # convert - 4900 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) - 4901 # registers except esp clobbered at this point - 4902 # restore ed - 4903 89/<- %edx 4/r32/esp - 4904 (flush _test-output-buffered-file) - 4905 (flush _test-error-buffered-file) - 4906 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ - 4912 # check output - 4913 (check-stream-equal _test-output-stream "" "F - test-add-with-too-many-outputs: output should be empty") - 4914 (check-next-stream-line-equal _test-error-stream "fn foo: stmt add: too many outputs; most primitives support at most one output" "F - test-add-with-too-many-outputs: error message") - 4915 # check that stop(1) was called - 4916 (check-ints-equal *(edx+4) 2 "F - test-add-with-too-many-outputs: exit status") - 4917 # don't restore from ebp - 4918 81 0/subop/add %esp 8/imm32 - 4919 # . epilogue - 4920 5d/pop-to-ebp - 4921 c3/return - 4922 - 4923 test-add-with-non-number: - 4924 # . prologue - 4925 55/push-ebp - 4926 89/<- %ebp 4/r32/esp - 4927 # setup - 4928 (clear-stream _test-input-stream) - 4929 (clear-stream $_test-input-buffered-file->buffer) - 4930 (clear-stream _test-output-stream) - 4931 (clear-stream $_test-output-buffered-file->buffer) - 4932 (clear-stream _test-error-stream) - 4933 (clear-stream $_test-error-buffered-file->buffer) - 4934 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) - 4935 68/push 0/imm32 - 4936 68/push 0/imm32 - 4937 89/<- %edx 4/r32/esp - 4938 (tailor-exit-descriptor %edx 0x10) - 4939 # - 4940 (write _test-input-stream "fn foo {\n") - 4941 (write _test-input-stream " var a: int\n") - 4942 (write _test-input-stream " var b/ecx: (addr int) <- add a\n") - 4943 (write _test-input-stream "}\n") - 4944 # convert - 4945 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) - 4946 # registers except esp clobbered at this point - 4947 # restore ed - 4948 89/<- %edx 4/r32/esp - 4949 (flush _test-output-buffered-file) - 4950 (flush _test-error-buffered-file) - 4951 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ - 4957 # check output - 4958 (check-stream-equal _test-output-stream "" "F - test-add-with-non-number: output should be empty") - 4959 (check-next-stream-line-equal _test-error-stream "fn foo: stmt add: only non-addr scalar args permitted" "F - test-add-with-non-number: error message") - 4960 # check that stop(1) was called - 4961 (check-ints-equal *(edx+4) 2 "F - test-add-with-non-number: exit status") - 4962 # don't restore from ebp - 4963 81 0/subop/add %esp 8/imm32 - 4964 # . epilogue - 4965 5d/pop-to-ebp - 4966 c3/return - 4967 - 4968 test-add-with-addr-dereferenced: - 4969 # . prologue - 4970 55/push-ebp - 4971 89/<- %ebp 4/r32/esp - 4972 # setup - 4973 (clear-stream _test-input-stream) - 4974 (clear-stream $_test-input-buffered-file->buffer) - 4975 (clear-stream _test-output-stream) - 4976 (clear-stream $_test-output-buffered-file->buffer) - 4977 # - 4978 (write _test-input-stream "fn foo {\n") - 4979 (write _test-input-stream " var a/eax: (addr int) <- copy 0\n") - 4980 (write _test-input-stream " add-to *a, 1\n") - 4981 (write _test-input-stream "}\n") - 4982 # convert - 4983 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 4984 (flush _test-output-buffered-file) - 4985 # no error - 4986 # . epilogue - 4987 89/<- %esp 5/r32/ebp - 4988 5d/pop-to-ebp - 4989 c3/return - 4990 - 4991 test-get-with-wrong-field: - 4992 # . prologue - 4993 55/push-ebp - 4994 89/<- %ebp 4/r32/esp - 4995 # setup - 4996 (clear-stream _test-input-stream) - 4997 (clear-stream $_test-input-buffered-file->buffer) - 4998 (clear-stream _test-output-stream) - 4999 (clear-stream $_test-output-buffered-file->buffer) - 5000 (clear-stream _test-error-stream) - 5001 (clear-stream $_test-error-buffered-file->buffer) - 5002 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) - 5003 68/push 0/imm32 - 5004 68/push 0/imm32 - 5005 89/<- %edx 4/r32/esp - 5006 (tailor-exit-descriptor %edx 0x10) - 5007 # - 5008 (write _test-input-stream "fn foo {\n") - 5009 (write _test-input-stream " var a: t\n") - 5010 (write _test-input-stream " var c/ecx: (addr int) <- get a, y\n") - 5011 (write _test-input-stream "}\n") - 5012 (write _test-input-stream "type t {\n") - 5013 (write _test-input-stream " x: int\n") - 5014 (write _test-input-stream "}\n") - 5015 # convert - 5016 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) - 5017 # registers except esp clobbered at this point - 5018 # restore ed - 5019 89/<- %edx 4/r32/esp - 5020 (flush _test-output-buffered-file) - 5021 (flush _test-error-buffered-file) - 5022 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ - 5028 # check output - 5029 (check-stream-equal _test-output-stream "" "F - test-get-with-wrong-field: output should be empty") - 5030 (check-next-stream-line-equal _test-error-stream "fn foo: stmt get: type 't' has no member called 'y'" "F - test-get-with-wrong-field: error message") - 5031 # check that stop(1) was called - 5032 (check-ints-equal *(edx+4) 2 "F - test-get-with-wrong-field: exit status") - 5033 # don't restore from ebp - 5034 81 0/subop/add %esp 8/imm32 + 3878 (write _test-input-stream "fn foo {\n") + 3879 (write _test-input-stream " var arr/eax: (addr array byte) <- copy 0\n") + 3880 (write _test-input-stream " var idx/ecx: int <- copy 3\n") + 3881 (write _test-input-stream " var x/eax: (addr byte) <- index arr, idx\n") + 3882 (write _test-input-stream "}\n") + 3883 # convert + 3884 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 3885 (flush _test-output-buffered-file) + 3886 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 3892 # check output + 3893 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-index-into-array-of-bytes/0") + 3894 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-index-into-array-of-bytes/1") + 3895 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-index-into-array-of-bytes/2") + 3896 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-index-into-array-of-bytes/3") + 3897 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-index-into-array-of-bytes/4") + 3898 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-index-into-array-of-bytes/5") + 3899 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-index-into-array-of-bytes/6") + 3900 (check-next-stream-line-equal _test-output-stream " b8/copy-to-eax 0/imm32" "F - test-convert-index-into-array-of-bytes/7") + 3901 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-convert-index-into-array-of-bytes/8") + 3902 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 3/imm32" "F - test-convert-index-into-array-of-bytes/9") + 3903 (check-next-stream-line-equal _test-output-stream " 8d/copy-address *(eax + ecx<<0x00000000 + 4) 0x00000000/r32" "F - test-convert-index-into-array-of-bytes/11") + 3904 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-convert-index-into-array-of-bytes/13") + 3905 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-index-into-array-of-bytes/14") + 3906 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-index-into-array-of-bytes/15") + 3907 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-index-into-array-of-bytes/16") + 3908 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-index-into-array-of-bytes/17") + 3909 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-index-into-array-of-bytes/18") + 3910 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-index-into-array-of-bytes/19") + 3911 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-index-into-array-of-bytes/20") + 3912 # . epilogue + 3913 89/<- %esp 5/r32/ebp + 3914 5d/pop-to-ebp + 3915 c3/return + 3916 + 3917 test-convert-index-into-array-with-literal: + 3918 # . prologue + 3919 55/push-ebp + 3920 89/<- %ebp 4/r32/esp + 3921 # setup + 3922 (clear-stream _test-input-stream) + 3923 (clear-stream $_test-input-buffered-file->buffer) + 3924 (clear-stream _test-output-stream) + 3925 (clear-stream $_test-output-buffered-file->buffer) + 3926 # + 3927 (write _test-input-stream "fn foo {\n") + 3928 (write _test-input-stream " var arr/eax: (addr array int) <- copy 0\n") + 3929 (write _test-input-stream " var x/eax: (addr int) <- index arr, 2\n") + 3930 (write _test-input-stream "}\n") + 3931 # convert + 3932 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 3933 (flush _test-output-buffered-file) + 3934 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 3940 # check output + 3941 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-index-into-array-with-literal/0") + 3942 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-index-into-array-with-literal/1") + 3943 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-index-into-array-with-literal/2") + 3944 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-index-into-array-with-literal/3") + 3945 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-index-into-array-with-literal/4") + 3946 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-index-into-array-with-literal/5") + 3947 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-index-into-array-with-literal/6") + 3948 (check-next-stream-line-equal _test-output-stream " b8/copy-to-eax 0/imm32" "F - test-convert-index-into-array-with-literal/7") + 3949 # 2 * 4 bytes/elem + 4 bytes for size = offset 12 + 3950 (check-next-stream-line-equal _test-output-stream " 8d/copy-address *(eax + 0x0000000c) 0x00000000/r32" "F - test-convert-index-into-array-with-literal/8") + 3951 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-index-into-array-with-literal/9") + 3952 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-index-into-array-with-literal/10") + 3953 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-index-into-array-with-literal/11") + 3954 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-index-into-array-with-literal/12") + 3955 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-index-into-array-with-literal/13") + 3956 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-index-into-array-with-literal/14") + 3957 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-index-into-array-with-literal/15") + 3958 # . epilogue + 3959 89/<- %esp 5/r32/ebp + 3960 5d/pop-to-ebp + 3961 c3/return + 3962 + 3963 test-convert-index-into-array-of-bytes-with-literal: + 3964 # . prologue + 3965 55/push-ebp + 3966 89/<- %ebp 4/r32/esp + 3967 # setup + 3968 (clear-stream _test-input-stream) + 3969 (clear-stream $_test-input-buffered-file->buffer) + 3970 (clear-stream _test-output-stream) + 3971 (clear-stream $_test-output-buffered-file->buffer) + 3972 # + 3973 (write _test-input-stream "fn foo {\n") + 3974 (write _test-input-stream " var arr/eax: (addr array byte) <- copy 0\n") + 3975 (write _test-input-stream " var x/eax: (addr byte) <- index arr, 2\n") + 3976 (write _test-input-stream "}\n") + 3977 # convert + 3978 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 3979 (flush _test-output-buffered-file) + 3980 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 3986 # check output + 3987 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-index-into-array-of-bytes-with-literal/0") + 3988 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-index-into-array-of-bytes-with-literal/1") + 3989 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-index-into-array-of-bytes-with-literal/2") + 3990 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-index-into-array-of-bytes-with-literal/3") + 3991 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-index-into-array-of-bytes-with-literal/4") + 3992 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-index-into-array-of-bytes-with-literal/5") + 3993 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-index-into-array-of-bytes-with-literal/6") + 3994 (check-next-stream-line-equal _test-output-stream " b8/copy-to-eax 0/imm32" "F - test-convert-index-into-array-of-bytes-with-literal/7") + 3995 # 2 * 1 byte/elem + 4 bytes for size = offset 6 + 3996 (check-next-stream-line-equal _test-output-stream " 8d/copy-address *(eax + 0x00000006) 0x00000000/r32" "F - test-convert-index-into-array-of-bytes-with-literal/8") + 3997 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-index-into-array-of-bytes-with-literal/9") + 3998 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-index-into-array-of-bytes-with-literal/10") + 3999 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-index-into-array-of-bytes-with-literal/11") + 4000 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-index-into-array-of-bytes-with-literal/12") + 4001 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-index-into-array-of-bytes-with-literal/13") + 4002 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-index-into-array-of-bytes-with-literal/14") + 4003 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-index-into-array-of-bytes-with-literal/15") + 4004 # . epilogue + 4005 89/<- %esp 5/r32/ebp + 4006 5d/pop-to-ebp + 4007 c3/return + 4008 + 4009 test-convert-index-into-array-on-stack: + 4010 # . prologue + 4011 55/push-ebp + 4012 89/<- %ebp 4/r32/esp + 4013 # setup + 4014 (clear-stream _test-input-stream) + 4015 (clear-stream $_test-input-buffered-file->buffer) + 4016 (clear-stream _test-output-stream) + 4017 (clear-stream $_test-output-buffered-file->buffer) + 4018 # + 4019 (write _test-input-stream "fn foo {\n") + 4020 (write _test-input-stream " var arr: (array int 3)\n") + 4021 (write _test-input-stream " var idx/eax: int <- copy 2\n") + 4022 (write _test-input-stream " var x/eax: (addr int) <- index arr, idx\n") + 4023 (write _test-input-stream "}\n") + 4024 # convert + 4025 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 4026 (flush _test-output-buffered-file) + 4027 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 4033 # check output + 4034 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-index-into-array-on-stack/0") + 4035 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-index-into-array-on-stack/1") + 4036 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-index-into-array-on-stack/2") + 4037 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-index-into-array-on-stack/3") + 4038 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-index-into-array-on-stack/4") + 4039 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-index-into-array-on-stack/5") + 4040 # var arr + 4041 (check-next-stream-line-equal _test-output-stream " (push-n-zero-bytes 0x0000000c)" "F - test-convert-index-into-array-on-stack/6") + 4042 (check-next-stream-line-equal _test-output-stream " 68/push 0x0000000c/imm32" "F - test-convert-index-into-array-on-stack/7") + 4043 # var idx + 4044 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-index-into-array-on-stack/8") + 4045 (check-next-stream-line-equal _test-output-stream " b8/copy-to-eax 2/imm32" "F - test-convert-index-into-array-on-stack/9") + 4046 # var x is at (ebp-0x10) + idx<<2 + 4 = ebp + idx<<2 - 0xc + 4047 (check-next-stream-line-equal _test-output-stream " 8d/copy-address *(ebp + eax<<0x00000002 + 0xfffffff4) 0x00000000/r32" "F - test-convert-index-into-array-on-stack/10") + 4048 # reclaim idx + 4049 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-index-into-array-on-stack/11") + 4050 # reclaim arr + 4051 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000010/imm32" "F - test-convert-index-into-array-on-stack/12") + 4052 # + 4053 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-index-into-array-on-stack/13") + 4054 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-index-into-array-on-stack/14") + 4055 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-index-into-array-on-stack/15") + 4056 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-index-into-array-on-stack/16") + 4057 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-index-into-array-on-stack/17") + 4058 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-index-into-array-on-stack/18") + 4059 # . epilogue + 4060 89/<- %esp 5/r32/ebp + 4061 5d/pop-to-ebp + 4062 c3/return + 4063 + 4064 test-convert-index-into-array-on-stack-with-literal: + 4065 # . prologue + 4066 55/push-ebp + 4067 89/<- %ebp 4/r32/esp + 4068 # setup + 4069 (clear-stream _test-input-stream) + 4070 (clear-stream $_test-input-buffered-file->buffer) + 4071 (clear-stream _test-output-stream) + 4072 (clear-stream $_test-output-buffered-file->buffer) + 4073 # + 4074 (write _test-input-stream "fn foo {\n") + 4075 (write _test-input-stream " var arr: (array int 3)\n") + 4076 (write _test-input-stream " var x/eax: (addr int) <- index arr, 2\n") + 4077 (write _test-input-stream "}\n") + 4078 # convert + 4079 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 4080 (flush _test-output-buffered-file) + 4081 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 4087 # check output + 4088 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-index-into-array-on-stack-with-literal/0") + 4089 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-index-into-array-on-stack-with-literal/1") + 4090 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-index-into-array-on-stack-with-literal/2") + 4091 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-index-into-array-on-stack-with-literal/3") + 4092 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-index-into-array-on-stack-with-literal/4") + 4093 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-index-into-array-on-stack-with-literal/5") + 4094 # var arr + 4095 (check-next-stream-line-equal _test-output-stream " (push-n-zero-bytes 0x0000000c)" "F - test-convert-index-into-array-on-stack-with-literal/6") + 4096 (check-next-stream-line-equal _test-output-stream " 68/push 0x0000000c/imm32" "F - test-convert-index-into-array-on-stack-with-literal/7") + 4097 # var x + 4098 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-index-into-array-on-stack-with-literal/8") + 4099 # x is at (ebp-0x10) + 4 + 2*4 = ebp-4 + 4100 (check-next-stream-line-equal _test-output-stream " 8d/copy-address *(ebp + 0xfffffffc) 0x00000000/r32" "F - test-convert-index-into-array-on-stack-with-literal/9") + 4101 # reclaim x + 4102 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-index-into-array-on-stack-with-literal/10") + 4103 # reclaim arr + 4104 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000010/imm32" "F - test-convert-index-into-array-on-stack-with-literal/11") + 4105 # + 4106 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-index-into-array-on-stack-with-literal/12") + 4107 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-index-into-array-on-stack-with-literal/13") + 4108 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-index-into-array-on-stack-with-literal/14") + 4109 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-index-into-array-on-stack-with-literal/15") + 4110 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-index-into-array-on-stack-with-literal/16") + 4111 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-index-into-array-on-stack-with-literal/17") + 4112 # . epilogue + 4113 89/<- %esp 5/r32/ebp + 4114 5d/pop-to-ebp + 4115 c3/return + 4116 + 4117 test-convert-index-into-array-of-bytes-on-stack-with-literal: + 4118 # . prologue + 4119 55/push-ebp + 4120 89/<- %ebp 4/r32/esp + 4121 # setup + 4122 (clear-stream _test-input-stream) + 4123 (clear-stream $_test-input-buffered-file->buffer) + 4124 (clear-stream _test-output-stream) + 4125 (clear-stream $_test-output-buffered-file->buffer) + 4126 # + 4127 (write _test-input-stream "fn foo {\n") + 4128 (write _test-input-stream " var arr: (array byte 3)\n") + 4129 (write _test-input-stream " var x/eax: (addr byte) <- index arr, 2\n") + 4130 (write _test-input-stream "}\n") + 4131 # convert + 4132 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 4133 (flush _test-output-buffered-file) + 4134 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 4140 # check output + 4141 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-index-into-array-of-bytes-on-stack-with-literal/0") + 4142 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-index-into-array-of-bytes-on-stack-with-literal/1") + 4143 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-index-into-array-of-bytes-on-stack-with-literal/2") + 4144 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-index-into-array-of-bytes-on-stack-with-literal/3") + 4145 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-index-into-array-of-bytes-on-stack-with-literal/4") + 4146 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-index-into-array-of-bytes-on-stack-with-literal/5") + 4147 # var arr + 4148 (check-next-stream-line-equal _test-output-stream " (push-n-zero-bytes 0x00000003)" "F - test-convert-index-into-array-of-bytes-on-stack-with-literal/6") + 4149 (check-next-stream-line-equal _test-output-stream " 68/push 0x00000003/imm32" "F - test-convert-index-into-array-of-bytes-on-stack-with-literal/7") + 4150 # var x + 4151 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-index-into-array-of-bytes-on-stack-with-literal/8") + 4152 # x is at (ebp-7) + 4 + 2 = ebp-1 + 4153 (check-next-stream-line-equal _test-output-stream " 8d/copy-address *(ebp + 0xffffffff) 0x00000000/r32" "F - test-convert-index-into-array-of-bytes-on-stack-with-literal/9") + 4154 # reclaim x + 4155 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-index-into-array-of-bytes-on-stack-with-literal/10") + 4156 # reclaim arr + 4157 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000007/imm32" "F - test-convert-index-into-array-of-bytes-on-stack-with-literal/11") + 4158 # + 4159 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-index-into-array-of-bytes-on-stack-with-literal/12") + 4160 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-index-into-array-of-bytes-on-stack-with-literal/13") + 4161 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-index-into-array-of-bytes-on-stack-with-literal/14") + 4162 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-index-into-array-of-bytes-on-stack-with-literal/15") + 4163 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-index-into-array-of-bytes-on-stack-with-literal/16") + 4164 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-index-into-array-of-bytes-on-stack-with-literal/17") + 4165 # . epilogue + 4166 89/<- %esp 5/r32/ebp + 4167 5d/pop-to-ebp + 4168 c3/return + 4169 + 4170 test-convert-index-into-array-using-offset: + 4171 # . prologue + 4172 55/push-ebp + 4173 89/<- %ebp 4/r32/esp + 4174 # setup + 4175 (clear-stream _test-input-stream) + 4176 (clear-stream $_test-input-buffered-file->buffer) + 4177 (clear-stream _test-output-stream) + 4178 (clear-stream $_test-output-buffered-file->buffer) + 4179 # + 4180 (write _test-input-stream "fn foo {\n") + 4181 (write _test-input-stream " var arr/eax: (addr array int) <- copy 0\n") + 4182 (write _test-input-stream " var idx/ecx: int <- copy 3\n") + 4183 (write _test-input-stream " var off/ecx: (offset int) <- compute-offset arr, idx\n") + 4184 (write _test-input-stream " var x/eax: (addr int) <- index arr, off\n") + 4185 (write _test-input-stream "}\n") + 4186 # convert + 4187 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 4188 (flush _test-output-buffered-file) + 4189 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 4195 # check output + 4196 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-index-into-array-using-offset/0") + 4197 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-index-into-array-using-offset/1") + 4198 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-index-into-array-using-offset/2") + 4199 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-index-into-array-using-offset/3") + 4200 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-index-into-array-using-offset/4") + 4201 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-index-into-array-using-offset/5") + 4202 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-index-into-array-using-offset/6") + 4203 (check-next-stream-line-equal _test-output-stream " b8/copy-to-eax 0/imm32" "F - test-convert-index-into-array-using-offset/7") + 4204 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-convert-index-into-array-using-offset/8") + 4205 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 3/imm32" "F - test-convert-index-into-array-using-offset/9") + 4206 (check-next-stream-line-equal _test-output-stream " 69/multiply %ecx 0x00000004/imm32 0x00000001/r32" "F - test-convert-index-into-array-using-offset/10") + 4207 (check-next-stream-line-equal _test-output-stream " 8d/copy-address *(eax + ecx + 4) 0x00000000/r32" "F - test-convert-index-into-array-using-offset/11") + 4208 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-convert-index-into-array-using-offset/12") + 4209 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-index-into-array-using-offset/13") + 4210 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-index-into-array-using-offset/14") + 4211 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-index-into-array-using-offset/15") + 4212 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-index-into-array-using-offset/16") + 4213 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-index-into-array-using-offset/17") + 4214 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-index-into-array-using-offset/18") + 4215 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-index-into-array-using-offset/19") + 4216 # . epilogue + 4217 89/<- %esp 5/r32/ebp + 4218 5d/pop-to-ebp + 4219 c3/return + 4220 + 4221 test-convert-index-into-array-of-bytes-using-offset: + 4222 # . prologue + 4223 55/push-ebp + 4224 89/<- %ebp 4/r32/esp + 4225 # setup + 4226 (clear-stream _test-input-stream) + 4227 (clear-stream $_test-input-buffered-file->buffer) + 4228 (clear-stream _test-output-stream) + 4229 (clear-stream $_test-output-buffered-file->buffer) + 4230 # + 4231 (write _test-input-stream "fn foo {\n") + 4232 (write _test-input-stream " var arr/eax: (addr array byte) <- copy 0\n") + 4233 (write _test-input-stream " var idx/ecx: int <- copy 3\n") + 4234 (write _test-input-stream " var off/ecx: (offset byte) <- compute-offset arr, idx\n") + 4235 (write _test-input-stream " var x/eax: (addr byte) <- index arr, off\n") + 4236 (write _test-input-stream "}\n") + 4237 # convert + 4238 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 4239 (flush _test-output-buffered-file) + 4240 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 4246 # check output + 4247 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-index-into-array-of-bytes-using-offset/0") + 4248 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-index-into-array-of-bytes-using-offset/1") + 4249 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-index-into-array-of-bytes-using-offset/2") + 4250 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-index-into-array-of-bytes-using-offset/3") + 4251 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-index-into-array-of-bytes-using-offset/4") + 4252 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-index-into-array-of-bytes-using-offset/5") + 4253 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-index-into-array-of-bytes-using-offset/6") + 4254 (check-next-stream-line-equal _test-output-stream " b8/copy-to-eax 0/imm32" "F - test-convert-index-into-array-of-bytes-using-offset/7") + 4255 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-convert-index-into-array-of-bytes-using-offset/8") + 4256 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 3/imm32" "F - test-convert-index-into-array-of-bytes-using-offset/9") + 4257 (check-next-stream-line-equal _test-output-stream " 69/multiply %ecx 0x00000001/imm32 0x00000001/r32" "F - test-convert-index-into-array-of-bytes-using-offset/10") + 4258 (check-next-stream-line-equal _test-output-stream " 8d/copy-address *(eax + ecx + 4) 0x00000000/r32" "F - test-convert-index-into-array-of-bytes-using-offset/11") + 4259 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-convert-index-into-array-of-bytes-using-offset/12") + 4260 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-index-into-array-of-bytes-using-offset/13") + 4261 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-index-into-array-of-bytes-using-offset/14") + 4262 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-index-into-array-of-bytes-using-offset/15") + 4263 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-index-into-array-of-bytes-using-offset/16") + 4264 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-index-into-array-of-bytes-using-offset/17") + 4265 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-index-into-array-of-bytes-using-offset/18") + 4266 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-index-into-array-of-bytes-using-offset/19") + 4267 # . epilogue + 4268 89/<- %esp 5/r32/ebp + 4269 5d/pop-to-ebp + 4270 c3/return + 4271 + 4272 test-convert-index-into-array-using-offset-on-stack: + 4273 # . prologue + 4274 55/push-ebp + 4275 89/<- %ebp 4/r32/esp + 4276 # setup + 4277 (clear-stream _test-input-stream) + 4278 (clear-stream $_test-input-buffered-file->buffer) + 4279 (clear-stream _test-output-stream) + 4280 (clear-stream $_test-output-buffered-file->buffer) + 4281 # + 4282 (write _test-input-stream "fn foo {\n") + 4283 (write _test-input-stream " var arr/eax: (addr array int) <- copy 0\n") + 4284 (write _test-input-stream " var idx: int\n") + 4285 (write _test-input-stream " var off/ecx: (offset int) <- compute-offset arr, idx\n") + 4286 (write _test-input-stream " var x/eax: (addr int) <- index arr, off\n") + 4287 (write _test-input-stream "}\n") + 4288 # convert + 4289 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 4290 (flush _test-output-buffered-file) + 4291 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 4297 # check output + 4298 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-index-into-array-using-offset-on-stack/0") + 4299 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-index-into-array-using-offset-on-stack/1") + 4300 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-index-into-array-using-offset-on-stack/2") + 4301 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-index-into-array-using-offset-on-stack/3") + 4302 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-index-into-array-using-offset-on-stack/4") + 4303 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-index-into-array-using-offset-on-stack/5") + 4304 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-index-into-array-using-offset-on-stack/6") + 4305 (check-next-stream-line-equal _test-output-stream " b8/copy-to-eax 0/imm32" "F - test-convert-index-into-array-using-offset-on-stack/7") + 4306 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-index-into-array-using-offset-on-stack/8") + 4307 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-convert-index-into-array-using-offset-on-stack/9") + 4308 (check-next-stream-line-equal _test-output-stream " 69/multiply *(ebp+0xfffffff8) 0x00000004/imm32 0x00000001/r32" "F - test-convert-index-into-array-using-offset-on-stack/10") + 4309 (check-next-stream-line-equal _test-output-stream " 8d/copy-address *(eax + ecx + 4) 0x00000000/r32" "F - test-convert-index-into-array-using-offset-on-stack/11") + 4310 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-convert-index-into-array-using-offset-on-stack/12") + 4311 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-index-into-array-using-offset-on-stack/13") + 4312 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-index-into-array-using-offset-on-stack/14") + 4313 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-index-into-array-using-offset-on-stack/15") + 4314 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-index-into-array-using-offset-on-stack/16") + 4315 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-index-into-array-using-offset-on-stack/17") + 4316 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-index-into-array-using-offset-on-stack/18") + 4317 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-index-into-array-using-offset-on-stack/19") + 4318 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-index-into-array-using-offset-on-stack/20") + 4319 # . epilogue + 4320 89/<- %esp 5/r32/ebp + 4321 5d/pop-to-ebp + 4322 c3/return + 4323 + 4324 test-convert-index-into-array-of-bytes-using-offset-on-stack: + 4325 # . prologue + 4326 55/push-ebp + 4327 89/<- %ebp 4/r32/esp + 4328 # setup + 4329 (clear-stream _test-input-stream) + 4330 (clear-stream $_test-input-buffered-file->buffer) + 4331 (clear-stream _test-output-stream) + 4332 (clear-stream $_test-output-buffered-file->buffer) + 4333 # + 4334 (write _test-input-stream "fn foo {\n") + 4335 (write _test-input-stream " var arr/eax: (addr array byte) <- copy 0\n") + 4336 (write _test-input-stream " var idx: int\n") + 4337 (write _test-input-stream " var off/ecx: (offset byte) <- compute-offset arr, idx\n") + 4338 (write _test-input-stream " var x/eax: (addr byte) <- index arr, off\n") + 4339 (write _test-input-stream "}\n") + 4340 # convert + 4341 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 4342 (flush _test-output-buffered-file) + 4343 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 4349 # check output + 4350 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/0") + 4351 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/1") + 4352 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/2") + 4353 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/3") + 4354 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/4") + 4355 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/5") + 4356 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/6") + 4357 (check-next-stream-line-equal _test-output-stream " b8/copy-to-eax 0/imm32" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/7") + 4358 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/8") + 4359 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/9") + 4360 (check-next-stream-line-equal _test-output-stream " 69/multiply *(ebp+0xfffffff8) 0x00000001/imm32 0x00000001/r32" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/10") + 4361 (check-next-stream-line-equal _test-output-stream " 8d/copy-address *(eax + ecx + 4) 0x00000000/r32" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/11") + 4362 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/12") + 4363 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000004/imm32" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/13") + 4364 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/14") + 4365 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/15") + 4366 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/16") + 4367 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/17") + 4368 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/18") + 4369 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/19") + 4370 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-index-into-array-of-bytes-using-offset-on-stack/20") + 4371 # . epilogue + 4372 89/<- %esp 5/r32/ebp + 4373 5d/pop-to-ebp + 4374 c3/return + 4375 + 4376 test-convert-function-and-type-definition: + 4377 # . prologue + 4378 55/push-ebp + 4379 89/<- %ebp 4/r32/esp + 4380 # setup + 4381 (clear-stream _test-input-stream) + 4382 (clear-stream $_test-input-buffered-file->buffer) + 4383 (clear-stream _test-output-stream) + 4384 (clear-stream $_test-output-buffered-file->buffer) + 4385 # + 4386 (write _test-input-stream "fn foo a: (addr t) {\n") + 4387 (write _test-input-stream " var _a/eax: (addr t) <- copy a\n") + 4388 (write _test-input-stream " var b/ecx: (addr int) <- get _a, x\n") + 4389 (write _test-input-stream " var c/ecx: (addr int) <- get _a, y\n") + 4390 (write _test-input-stream "}\n") + 4391 (write _test-input-stream "type t {\n") + 4392 (write _test-input-stream " x: int\n") + 4393 (write _test-input-stream " y: int\n") + 4394 (write _test-input-stream "}\n") + 4395 # convert + 4396 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 4397 (flush _test-output-buffered-file) + 4398 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 4404 # check output + 4405 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-and-type-definition/0") + 4406 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-and-type-definition/1") + 4407 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-and-type-definition/2") + 4408 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-and-type-definition/3") + 4409 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-and-type-definition/4") + 4410 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-and-type-definition/5") + 4411 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-function-and-type-definition/6") + 4412 (check-next-stream-line-equal _test-output-stream " 8b/-> *(ebp+0x00000008) 0x00000000/r32" "F - test-convert-function-and-type-definition/7") + 4413 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-convert-function-and-type-definition/8") + 4414 (check-next-stream-line-equal _test-output-stream " 8d/copy-address *(eax + 0x00000000) 0x00000001/r32" "F - test-convert-function-and-type-definition/9") + 4415 (check-next-stream-line-equal _test-output-stream " 8d/copy-address *(eax + 0x00000004) 0x00000001/r32" "F - test-convert-function-and-type-definition/11") + 4416 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-convert-function-and-type-definition/13") + 4417 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-function-and-type-definition/14") + 4418 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-and-type-definition/15") + 4419 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-and-type-definition/16") + 4420 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-and-type-definition/17") + 4421 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-and-type-definition/18") + 4422 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-and-type-definition/19") + 4423 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-and-type-definition/20") + 4424 # . epilogue + 4425 89/<- %esp 5/r32/ebp + 4426 5d/pop-to-ebp + 4427 c3/return + 4428 + 4429 test-convert-function-with-local-var-with-user-defined-type: + 4430 # . prologue + 4431 55/push-ebp + 4432 89/<- %ebp 4/r32/esp + 4433 # setup + 4434 (clear-stream _test-input-stream) + 4435 (clear-stream $_test-input-buffered-file->buffer) + 4436 (clear-stream _test-output-stream) + 4437 (clear-stream $_test-output-buffered-file->buffer) + 4438 # + 4439 (write _test-input-stream "fn foo {\n") + 4440 (write _test-input-stream " var a: t\n") + 4441 (write _test-input-stream "}\n") + 4442 (write _test-input-stream "type t {\n") + 4443 (write _test-input-stream " x: int\n") + 4444 (write _test-input-stream " y: int\n") + 4445 (write _test-input-stream "}\n") + 4446 # convert + 4447 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 4448 (flush _test-output-buffered-file) + 4449 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 4455 # check output + 4456 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-local-var-with-user-defined-type/0") + 4457 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-with-local-var-with-user-defined-type/1") + 4458 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-with-local-var-with-user-defined-type/2") + 4459 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-with-local-var-with-user-defined-type/3") + 4460 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-with-local-var-with-user-defined-type/4") + 4461 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-function-with-local-var-with-user-defined-type/5") + 4462 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-local-var-with-user-defined-type/6") + 4463 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-with-local-var-with-user-defined-type/7") + 4464 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000008/imm32" "F - test-convert-function-with-local-var-with-user-defined-type/8") + 4465 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-with-local-var-with-user-defined-type/9") + 4466 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-function-with-local-var-with-user-defined-type/10") + 4467 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-with-local-var-with-user-defined-type/11") + 4468 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-with-local-var-with-user-defined-type/12") + 4469 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-with-local-var-with-user-defined-type/13") + 4470 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-with-local-var-with-user-defined-type/14") + 4471 # . epilogue + 4472 89/<- %esp 5/r32/ebp + 4473 5d/pop-to-ebp + 4474 c3/return + 4475 + 4476 test-convert-function-call-with-arg-of-user-defined-type: + 4477 # . prologue + 4478 55/push-ebp + 4479 89/<- %ebp 4/r32/esp + 4480 # setup + 4481 (clear-stream _test-input-stream) + 4482 (clear-stream $_test-input-buffered-file->buffer) + 4483 (clear-stream _test-output-stream) + 4484 (clear-stream $_test-output-buffered-file->buffer) + 4485 # + 4486 (write _test-input-stream "fn f {\n") + 4487 (write _test-input-stream " var a: t\n") + 4488 (write _test-input-stream " foo a\n") + 4489 (write _test-input-stream "}\n") + 4490 (write _test-input-stream "fn foo x: t {\n") + 4491 (write _test-input-stream "}\n") + 4492 (write _test-input-stream "type t {\n") + 4493 (write _test-input-stream " x: int\n") + 4494 (write _test-input-stream " y: int\n") + 4495 (write _test-input-stream "}\n") + 4496 # convert + 4497 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 4498 (flush _test-output-buffered-file) + 4499 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 4505 # check output + 4506 (check-next-stream-line-equal _test-output-stream "f:" "F - test-convert-function-call-with-arg-of-user-defined-type/0") + 4507 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-call-with-arg-of-user-defined-type/1") + 4508 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-call-with-arg-of-user-defined-type/2") + 4509 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-call-with-arg-of-user-defined-type/3") + 4510 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-call-with-arg-of-user-defined-type/4") + 4511 (check-next-stream-line-equal _test-output-stream "$f:0x00000001:loop:" "F - test-convert-function-call-with-arg-of-user-defined-type/5") + 4512 # var a: t + 4513 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-call-with-arg-of-user-defined-type/6") + 4514 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-call-with-arg-of-user-defined-type/7") + 4515 # foo a + 4516 (check-next-stream-line-equal _test-output-stream " (foo *(ebp+0xfffffff8) *(ebp+0xfffffffc))" "F - test-convert-function-call-with-arg-of-user-defined-type/8") + 4517 # + 4518 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000008/imm32" "F - test-convert-function-call-with-arg-of-user-defined-type/9") + 4519 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-call-with-arg-of-user-defined-type/10") + 4520 (check-next-stream-line-equal _test-output-stream "$f:0x00000001:break:" "F - test-convert-function-call-with-arg-of-user-defined-type/11") + 4521 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-call-with-arg-of-user-defined-type/12") + 4522 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-call-with-arg-of-user-defined-type/13") + 4523 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-call-with-arg-of-user-defined-type/14") + 4524 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-call-with-arg-of-user-defined-type/15") + 4525 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-call-with-arg-of-user-defined-type/16") + 4526 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-call-with-arg-of-user-defined-type/17") + 4527 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-call-with-arg-of-user-defined-type/18") + 4528 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-call-with-arg-of-user-defined-type/19") + 4529 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-call-with-arg-of-user-defined-type/20") + 4530 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-call-with-arg-of-user-defined-type/21") + 4531 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-call-with-arg-of-user-defined-type/22") + 4532 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-call-with-arg-of-user-defined-type/23") + 4533 # . epilogue + 4534 89/<- %esp 5/r32/ebp + 4535 5d/pop-to-ebp + 4536 c3/return + 4537 + 4538 test-convert-function-call-with-arg-of-user-defined-type-register-indirect: + 4539 # . prologue + 4540 55/push-ebp + 4541 89/<- %ebp 4/r32/esp + 4542 # setup + 4543 (clear-stream _test-input-stream) + 4544 (clear-stream $_test-input-buffered-file->buffer) + 4545 (clear-stream _test-output-stream) + 4546 (clear-stream $_test-output-buffered-file->buffer) + 4547 # + 4548 (write _test-input-stream "fn f {\n") + 4549 (write _test-input-stream " var a/eax: (addr t) <- copy 0\n") + 4550 (write _test-input-stream " foo *a\n") + 4551 (write _test-input-stream "}\n") + 4552 (write _test-input-stream "fn foo x: t {\n") + 4553 (write _test-input-stream "}\n") + 4554 (write _test-input-stream "type t {\n") + 4555 (write _test-input-stream " x: int\n") + 4556 (write _test-input-stream " y: int\n") + 4557 (write _test-input-stream "}\n") + 4558 # convert + 4559 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 4560 (flush _test-output-buffered-file) + 4561 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 4567 # check output + 4568 (check-next-stream-line-equal _test-output-stream "f:" "F - test-convert-function-call-with-arg-of-user-defined-type/0") + 4569 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-call-with-arg-of-user-defined-type/1") + 4570 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-call-with-arg-of-user-defined-type/2") + 4571 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-call-with-arg-of-user-defined-type/3") + 4572 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-call-with-arg-of-user-defined-type/4") + 4573 (check-next-stream-line-equal _test-output-stream "$f:0x00000001:loop:" "F - test-convert-function-call-with-arg-of-user-defined-type/5") + 4574 # var a + 4575 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-function-call-with-arg-of-user-defined-type/6") + 4576 (check-next-stream-line-equal _test-output-stream " b8/copy-to-eax 0/imm32" "F - test-convert-function-call-with-arg-of-user-defined-type/7") + 4577 # foo a + 4578 (check-next-stream-line-equal _test-output-stream " (foo *(eax+0x00000000) *(eax+0x00000004))" "F - test-convert-function-call-with-arg-of-user-defined-type/8") + 4579 # + 4580 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-function-call-with-arg-of-user-defined-type/9") + 4581 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-call-with-arg-of-user-defined-type/10") + 4582 (check-next-stream-line-equal _test-output-stream "$f:0x00000001:break:" "F - test-convert-function-call-with-arg-of-user-defined-type/11") + 4583 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-call-with-arg-of-user-defined-type/12") + 4584 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-call-with-arg-of-user-defined-type/13") + 4585 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-call-with-arg-of-user-defined-type/14") + 4586 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-call-with-arg-of-user-defined-type/15") + 4587 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-call-with-arg-of-user-defined-type/16") + 4588 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-call-with-arg-of-user-defined-type/17") + 4589 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-call-with-arg-of-user-defined-type/18") + 4590 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-call-with-arg-of-user-defined-type/19") + 4591 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-call-with-arg-of-user-defined-type/20") + 4592 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-call-with-arg-of-user-defined-type/21") + 4593 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-call-with-arg-of-user-defined-type/22") + 4594 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-call-with-arg-of-user-defined-type/23") + 4595 # . epilogue + 4596 89/<- %esp 5/r32/ebp + 4597 5d/pop-to-ebp + 4598 c3/return + 4599 + 4600 # we don't have special support for call-by-reference; just explicitly create + 4601 # a new variable with the address of the arg + 4602 test-convert-function-call-with-arg-of-user-defined-type-by-reference: + 4603 # . prologue + 4604 55/push-ebp + 4605 89/<- %ebp 4/r32/esp + 4606 # setup + 4607 (clear-stream _test-input-stream) + 4608 (clear-stream $_test-input-buffered-file->buffer) + 4609 (clear-stream _test-output-stream) + 4610 (clear-stream $_test-output-buffered-file->buffer) + 4611 # + 4612 (write _test-input-stream "fn f {\n") + 4613 (write _test-input-stream " var a: t\n") + 4614 (write _test-input-stream " var b/eax: (addr t) <- address a\n") + 4615 (write _test-input-stream " foo b\n") + 4616 (write _test-input-stream "}\n") + 4617 (write _test-input-stream "fn foo x: (addr t) {\n") + 4618 (write _test-input-stream " var x/ecx: (addr int) <- copy x\n") + 4619 (write _test-input-stream " increment *x\n") + 4620 (write _test-input-stream "}\n") + 4621 (write _test-input-stream "type t {\n") + 4622 (write _test-input-stream " x: int\n") + 4623 (write _test-input-stream " y: int\n") + 4624 (write _test-input-stream "}\n") + 4625 # convert + 4626 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 4627 (flush _test-output-buffered-file) + 4628 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 4634 # check output + 4635 (check-next-stream-line-equal _test-output-stream "f:" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/0") + 4636 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/1") + 4637 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/2") + 4638 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/3") + 4639 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/4") + 4640 (check-next-stream-line-equal _test-output-stream "$f:0x00000001:loop:" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/5") + 4641 # var a: t + 4642 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/6") + 4643 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/7") + 4644 # var b/eax: (addr t) + 4645 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/8") + 4646 (check-next-stream-line-equal _test-output-stream " 8d/copy-address *(ebp+0xfffffff8) 0x00000000/r32" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/9") + 4647 # foo a + 4648 (check-next-stream-line-equal _test-output-stream " (foo %eax)" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/10") + 4649 # + 4650 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/11") + 4651 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000008/imm32" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/12") + 4652 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/13") + 4653 (check-next-stream-line-equal _test-output-stream "$f:0x00000001:break:" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/14") + 4654 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/15") + 4655 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/16") + 4656 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/17") + 4657 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/18") + 4658 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/19") + 4659 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/20") + 4660 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/21") + 4661 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/22") + 4662 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/23") + 4663 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:loop:" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/24") + 4664 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/25") + 4665 (check-next-stream-line-equal _test-output-stream " 8b/-> *(ebp+0x00000008) 0x00000001/r32" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/26") + 4666 (check-next-stream-line-equal _test-output-stream " ff 0/subop/increment *ecx" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/27") + 4667 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/28") + 4668 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/29") + 4669 (check-next-stream-line-equal _test-output-stream "$foo:0x00000002:break:" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/30") + 4670 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/31") + 4671 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/32") + 4672 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/33") + 4673 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-function-call-with-arg-of-user-defined-type-by-reference/34") + 4674 # . epilogue + 4675 89/<- %esp 5/r32/ebp + 4676 5d/pop-to-ebp + 4677 c3/return + 4678 + 4679 test-convert-get-on-local-variable: + 4680 # . prologue + 4681 55/push-ebp + 4682 89/<- %ebp 4/r32/esp + 4683 # setup + 4684 (clear-stream _test-input-stream) + 4685 (clear-stream $_test-input-buffered-file->buffer) + 4686 (clear-stream _test-output-stream) + 4687 (clear-stream $_test-output-buffered-file->buffer) + 4688 # + 4689 (write _test-input-stream "fn foo {\n") + 4690 (write _test-input-stream " var a: t\n") + 4691 (write _test-input-stream " var c/ecx: (addr int) <- get a, y\n") + 4692 (write _test-input-stream "}\n") + 4693 (write _test-input-stream "type t {\n") + 4694 (write _test-input-stream " x: int\n") + 4695 (write _test-input-stream " y: int\n") + 4696 (write _test-input-stream "}\n") + 4697 # convert + 4698 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 4699 (flush _test-output-buffered-file) + 4700 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 4706 # check output + 4707 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-get-on-local-variable/0") + 4708 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-get-on-local-variable/1") + 4709 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-get-on-local-variable/2") + 4710 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-get-on-local-variable/3") + 4711 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-get-on-local-variable/4") + 4712 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-get-on-local-variable/5") + 4713 # var a + 4714 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-get-on-local-variable/6") + 4715 (check-next-stream-line-equal _test-output-stream " 68/push 0/imm32" "F - test-convert-get-on-local-variable/7") + 4716 # var c + 4717 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-convert-get-on-local-variable/8") + 4718 # get + 4719 (check-next-stream-line-equal _test-output-stream " 8d/copy-address *(ebp+0xfffffffc) 0x00000001/r32" "F - test-convert-get-on-local-variable/9") + 4720 # reclaim c + 4721 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-convert-get-on-local-variable/10") + 4722 # reclaim a + 4723 (check-next-stream-line-equal _test-output-stream " 81 0/subop/add %esp 0x00000008/imm32" "F - test-convert-get-on-local-variable/11") + 4724 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-get-on-local-variable/12") + 4725 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-get-on-local-variable/13") + 4726 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-get-on-local-variable/14") + 4727 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-get-on-local-variable/15") + 4728 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-get-on-local-variable/16") + 4729 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-get-on-local-variable/17") + 4730 # . epilogue + 4731 89/<- %esp 5/r32/ebp + 4732 5d/pop-to-ebp + 4733 c3/return + 4734 + 4735 test-convert-get-on-function-argument: + 4736 # . prologue + 4737 55/push-ebp + 4738 89/<- %ebp 4/r32/esp + 4739 # setup + 4740 (clear-stream _test-input-stream) + 4741 (clear-stream $_test-input-buffered-file->buffer) + 4742 (clear-stream _test-output-stream) + 4743 (clear-stream $_test-output-buffered-file->buffer) + 4744 # + 4745 (write _test-input-stream "fn foo a: t {\n") + 4746 (write _test-input-stream " var c/ecx: (addr int) <- get a, y\n") + 4747 (write _test-input-stream "}\n") + 4748 (write _test-input-stream "type t {\n") + 4749 (write _test-input-stream " x: int\n") + 4750 (write _test-input-stream " y: int\n") + 4751 (write _test-input-stream "}\n") + 4752 # convert + 4753 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 4754 (flush _test-output-buffered-file) + 4755 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 4761 # check output + 4762 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-get-on-function-argument/0") + 4763 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-get-on-function-argument/1") + 4764 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-get-on-function-argument/2") + 4765 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-get-on-function-argument/3") + 4766 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-get-on-function-argument/4") + 4767 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-get-on-function-argument/5") + 4768 # var c + 4769 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-convert-get-on-function-argument/6") + 4770 # get + 4771 (check-next-stream-line-equal _test-output-stream " 8d/copy-address *(ebp+0x0000000c) 0x00000001/r32" "F - test-convert-get-on-function-argument/7") + 4772 # reclaim c + 4773 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-convert-get-on-function-argument/8") + 4774 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-get-on-function-argument/9") + 4775 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-get-on-function-argument/10") + 4776 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-get-on-function-argument/11") + 4777 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-get-on-function-argument/12") + 4778 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-get-on-function-argument/13") + 4779 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-get-on-function-argument/14") + 4780 # . epilogue + 4781 89/<- %esp 5/r32/ebp + 4782 5d/pop-to-ebp + 4783 c3/return + 4784 + 4785 test-convert-get-on-function-argument-with-known-type: + 4786 # . prologue + 4787 55/push-ebp + 4788 89/<- %ebp 4/r32/esp + 4789 # setup + 4790 (clear-stream _test-input-stream) + 4791 (clear-stream $_test-input-buffered-file->buffer) + 4792 (clear-stream _test-output-stream) + 4793 (clear-stream $_test-output-buffered-file->buffer) + 4794 # + 4795 (write _test-input-stream "type t {\n") + 4796 (write _test-input-stream " x: int\n") + 4797 (write _test-input-stream " y: int\n") + 4798 (write _test-input-stream "}\n") + 4799 (write _test-input-stream "fn foo a: t {\n") + 4800 (write _test-input-stream " var c/ecx: (addr int) <- get a, y\n") + 4801 (write _test-input-stream "}\n") + 4802 # convert + 4803 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 4804 (flush _test-output-buffered-file) + 4805 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 4811 # check output + 4812 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-get-on-function-argument-with-known-type/0") + 4813 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-get-on-function-argument-with-known-type/1") + 4814 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-get-on-function-argument-with-known-type/2") + 4815 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-get-on-function-argument-with-known-type/3") + 4816 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-get-on-function-argument-with-known-type/4") + 4817 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-get-on-function-argument-with-known-type/5") + 4818 # var c + 4819 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-convert-get-on-function-argument-with-known-type/6") + 4820 # get + 4821 (check-next-stream-line-equal _test-output-stream " 8d/copy-address *(ebp+0x0000000c) 0x00000001/r32" "F - test-convert-get-on-function-argument-with-known-type/7") + 4822 # reclaim c + 4823 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-convert-get-on-function-argument-with-known-type/8") + 4824 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-get-on-function-argument-with-known-type/9") + 4825 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-get-on-function-argument-with-known-type/10") + 4826 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-get-on-function-argument-with-known-type/11") + 4827 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-get-on-function-argument-with-known-type/12") + 4828 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-get-on-function-argument-with-known-type/13") + 4829 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-get-on-function-argument-with-known-type/14") + 4830 # . epilogue + 4831 89/<- %esp 5/r32/ebp + 4832 5d/pop-to-ebp + 4833 c3/return + 4834 + 4835 test-add-with-too-many-inouts: + 4836 # . prologue + 4837 55/push-ebp + 4838 89/<- %ebp 4/r32/esp + 4839 # setup + 4840 (clear-stream _test-input-stream) + 4841 (clear-stream $_test-input-buffered-file->buffer) + 4842 (clear-stream _test-output-stream) + 4843 (clear-stream $_test-output-buffered-file->buffer) + 4844 (clear-stream _test-error-stream) + 4845 (clear-stream $_test-error-buffered-file->buffer) + 4846 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) + 4847 68/push 0/imm32 + 4848 68/push 0/imm32 + 4849 89/<- %edx 4/r32/esp + 4850 (tailor-exit-descriptor %edx 0x10) + 4851 # + 4852 (write _test-input-stream "fn foo {\n") + 4853 (write _test-input-stream " var a: int\n") + 4854 (write _test-input-stream " var b/ecx: int <- add a, 0\n") + 4855 (write _test-input-stream "}\n") + 4856 # convert + 4857 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) + 4858 # registers except esp clobbered at this point + 4859 # restore ed + 4860 89/<- %edx 4/r32/esp + 4861 (flush _test-output-buffered-file) + 4862 (flush _test-error-buffered-file) + 4863 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ + 4869 # check output + 4870 (check-stream-equal _test-output-stream "" "F - test-add-with-too-many-inouts: output should be empty") + 4871 (check-next-stream-line-equal _test-error-stream "fn foo: stmt add: too many inouts; most primitives support at most two arguments, across inouts and outputs" "F - test-add-with-too-many-inouts: error message") + 4872 # check that stop(1) was called + 4873 (check-ints-equal *(edx+4) 2 "F - test-add-with-too-many-inouts: exit status") + 4874 # don't restore from ebp + 4875 81 0/subop/add %esp 8/imm32 + 4876 # . epilogue + 4877 5d/pop-to-ebp + 4878 c3/return + 4879 + 4880 test-add-with-too-many-inouts-2: + 4881 # . prologue + 4882 55/push-ebp + 4883 89/<- %ebp 4/r32/esp + 4884 # setup + 4885 (clear-stream _test-input-stream) + 4886 (clear-stream $_test-input-buffered-file->buffer) + 4887 (clear-stream _test-output-stream) + 4888 (clear-stream $_test-output-buffered-file->buffer) + 4889 (clear-stream _test-error-stream) + 4890 (clear-stream $_test-error-buffered-file->buffer) + 4891 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) + 4892 68/push 0/imm32 + 4893 68/push 0/imm32 + 4894 89/<- %edx 4/r32/esp + 4895 (tailor-exit-descriptor %edx 0x10) + 4896 # + 4897 (write _test-input-stream "fn foo {\n") + 4898 (write _test-input-stream " var a: int\n") + 4899 (write _test-input-stream " add-to a, 0, 1\n") + 4900 (write _test-input-stream "}\n") + 4901 # convert + 4902 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) + 4903 # registers except esp clobbered at this point + 4904 # restore ed + 4905 89/<- %edx 4/r32/esp + 4906 (flush _test-output-buffered-file) + 4907 (flush _test-error-buffered-file) + 4908 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ + 4914 # check output + 4915 (check-stream-equal _test-output-stream "" "F - test-add-with-too-many-inouts-2: output should be empty") + 4916 (check-next-stream-line-equal _test-error-stream "fn foo: stmt add-to: too many inouts; most primitives support at most two arguments, across inouts and outputs" "F - test-add-with-too-many-inouts-2: error message") + 4917 # check that stop(1) was called + 4918 (check-ints-equal *(edx+4) 2 "F - test-add-with-too-many-inouts-2: exit status") + 4919 # don't restore from ebp + 4920 81 0/subop/add %esp 8/imm32 + 4921 # . epilogue + 4922 5d/pop-to-ebp + 4923 c3/return + 4924 + 4925 test-add-with-too-many-outputs: + 4926 # . prologue + 4927 55/push-ebp + 4928 89/<- %ebp 4/r32/esp + 4929 # setup + 4930 (clear-stream _test-input-stream) + 4931 (clear-stream $_test-input-buffered-file->buffer) + 4932 (clear-stream _test-output-stream) + 4933 (clear-stream $_test-output-buffered-file->buffer) + 4934 (clear-stream _test-error-stream) + 4935 (clear-stream $_test-error-buffered-file->buffer) + 4936 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) + 4937 68/push 0/imm32 + 4938 68/push 0/imm32 + 4939 89/<- %edx 4/r32/esp + 4940 (tailor-exit-descriptor %edx 0x10) + 4941 # + 4942 (write _test-input-stream "fn foo {\n") + 4943 (write _test-input-stream " var a/eax: int <- copy 0\n") + 4944 (write _test-input-stream " var b/ebx: int <- copy 0\n") + 4945 (write _test-input-stream " var c/ecx: int <- copy 0\n") + 4946 (write _test-input-stream " c, b <- add a\n") + 4947 (write _test-input-stream "}\n") + 4948 # convert + 4949 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) + 4950 # registers except esp clobbered at this point + 4951 # restore ed + 4952 89/<- %edx 4/r32/esp + 4953 (flush _test-output-buffered-file) + 4954 (flush _test-error-buffered-file) + 4955 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ + 4961 # check output + 4962 (check-stream-equal _test-output-stream "" "F - test-add-with-too-many-outputs: output should be empty") + 4963 (check-next-stream-line-equal _test-error-stream "fn foo: stmt add: too many outputs; most primitives support at most one output" "F - test-add-with-too-many-outputs: error message") + 4964 # check that stop(1) was called + 4965 (check-ints-equal *(edx+4) 2 "F - test-add-with-too-many-outputs: exit status") + 4966 # don't restore from ebp + 4967 81 0/subop/add %esp 8/imm32 + 4968 # . epilogue + 4969 5d/pop-to-ebp + 4970 c3/return + 4971 + 4972 test-add-with-non-number: + 4973 # . prologue + 4974 55/push-ebp + 4975 89/<- %ebp 4/r32/esp + 4976 # setup + 4977 (clear-stream _test-input-stream) + 4978 (clear-stream $_test-input-buffered-file->buffer) + 4979 (clear-stream _test-output-stream) + 4980 (clear-stream $_test-output-buffered-file->buffer) + 4981 (clear-stream _test-error-stream) + 4982 (clear-stream $_test-error-buffered-file->buffer) + 4983 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) + 4984 68/push 0/imm32 + 4985 68/push 0/imm32 + 4986 89/<- %edx 4/r32/esp + 4987 (tailor-exit-descriptor %edx 0x10) + 4988 # + 4989 (write _test-input-stream "fn foo {\n") + 4990 (write _test-input-stream " var a: int\n") + 4991 (write _test-input-stream " var b/ecx: (addr int) <- add a\n") + 4992 (write _test-input-stream "}\n") + 4993 # convert + 4994 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) + 4995 # registers except esp clobbered at this point + 4996 # restore ed + 4997 89/<- %edx 4/r32/esp + 4998 (flush _test-output-buffered-file) + 4999 (flush _test-error-buffered-file) + 5000 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ + 5006 # check output + 5007 (check-stream-equal _test-output-stream "" "F - test-add-with-non-number: output should be empty") + 5008 (check-next-stream-line-equal _test-error-stream "fn foo: stmt add: only non-addr scalar args permitted" "F - test-add-with-non-number: error message") + 5009 # check that stop(1) was called + 5010 (check-ints-equal *(edx+4) 2 "F - test-add-with-non-number: exit status") + 5011 # don't restore from ebp + 5012 81 0/subop/add %esp 8/imm32 + 5013 # . epilogue + 5014 5d/pop-to-ebp + 5015 c3/return + 5016 + 5017 test-add-with-addr-dereferenced: + 5018 # . prologue + 5019 55/push-ebp + 5020 89/<- %ebp 4/r32/esp + 5021 # setup + 5022 (clear-stream _test-input-stream) + 5023 (clear-stream $_test-input-buffered-file->buffer) + 5024 (clear-stream _test-output-stream) + 5025 (clear-stream $_test-output-buffered-file->buffer) + 5026 # + 5027 (write _test-input-stream "fn foo {\n") + 5028 (write _test-input-stream " var a/eax: (addr int) <- copy 0\n") + 5029 (write _test-input-stream " add-to *a, 1\n") + 5030 (write _test-input-stream "}\n") + 5031 # convert + 5032 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 5033 (flush _test-output-buffered-file) + 5034 # no error 5035 # . epilogue - 5036 5d/pop-to-ebp - 5037 c3/return - 5038 - 5039 test-get-with-wrong-base-type: - 5040 # . prologue - 5041 55/push-ebp - 5042 89/<- %ebp 4/r32/esp - 5043 # setup - 5044 (clear-stream _test-input-stream) - 5045 (clear-stream $_test-input-buffered-file->buffer) - 5046 (clear-stream _test-output-stream) - 5047 (clear-stream $_test-output-buffered-file->buffer) - 5048 (clear-stream _test-error-stream) - 5049 (clear-stream $_test-error-buffered-file->buffer) - 5050 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) - 5051 68/push 0/imm32 + 5036 89/<- %esp 5/r32/ebp + 5037 5d/pop-to-ebp + 5038 c3/return + 5039 + 5040 test-get-with-wrong-field: + 5041 # . prologue + 5042 55/push-ebp + 5043 89/<- %ebp 4/r32/esp + 5044 # setup + 5045 (clear-stream _test-input-stream) + 5046 (clear-stream $_test-input-buffered-file->buffer) + 5047 (clear-stream _test-output-stream) + 5048 (clear-stream $_test-output-buffered-file->buffer) + 5049 (clear-stream _test-error-stream) + 5050 (clear-stream $_test-error-buffered-file->buffer) + 5051 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) 5052 68/push 0/imm32 - 5053 89/<- %edx 4/r32/esp - 5054 (tailor-exit-descriptor %edx 0x10) - 5055 # - 5056 (write _test-input-stream "fn foo {\n") - 5057 (write _test-input-stream " var a: int\n") - 5058 (write _test-input-stream " var c/ecx: (addr int) <- get a, y\n") - 5059 (write _test-input-stream "}\n") - 5060 # convert - 5061 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) - 5062 # registers except esp clobbered at this point - 5063 # restore ed - 5064 89/<- %edx 4/r32/esp - 5065 (flush _test-output-buffered-file) - 5066 (flush _test-error-buffered-file) - 5067 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ - 5073 # check output - 5074 (check-stream-equal _test-output-stream "" "F - test-get-with-wrong-base-type: output should be empty") - 5075 (check-next-stream-line-equal _test-error-stream "fn foo: stmt get: var 'a' must have a 'type' definition" "F - test-get-with-wrong-base-type: error message") - 5076 # check that stop(1) was called - 5077 (check-ints-equal *(edx+4) 2 "F - test-get-with-wrong-base-type: exit status") - 5078 # don't restore from ebp - 5079 81 0/subop/add %esp 8/imm32 - 5080 # . epilogue - 5081 5d/pop-to-ebp - 5082 c3/return - 5083 - 5084 test-get-with-wrong-base-type-2: - 5085 # . prologue - 5086 55/push-ebp - 5087 89/<- %ebp 4/r32/esp - 5088 # setup - 5089 (clear-stream _test-input-stream) - 5090 (clear-stream $_test-input-buffered-file->buffer) - 5091 (clear-stream _test-output-stream) - 5092 (clear-stream $_test-output-buffered-file->buffer) - 5093 (clear-stream _test-error-stream) - 5094 (clear-stream $_test-error-buffered-file->buffer) - 5095 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) - 5096 68/push 0/imm32 - 5097 68/push 0/imm32 - 5098 89/<- %edx 4/r32/esp - 5099 (tailor-exit-descriptor %edx 0x10) - 5100 # - 5101 (write _test-input-stream "fn foo {\n") - 5102 (write _test-input-stream " var a: (addr t)\n") - 5103 (write _test-input-stream " var c/ecx: (addr int) <- get a, y\n") - 5104 (write _test-input-stream "}\n") - 5105 (write _test-input-stream "type t {\n") - 5106 (write _test-input-stream " x: int\n") - 5107 (write _test-input-stream "}\n") - 5108 # convert - 5109 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) - 5110 # registers except esp clobbered at this point - 5111 # restore ed - 5112 89/<- %edx 4/r32/esp - 5113 (flush _test-output-buffered-file) - 5114 (flush _test-error-buffered-file) - 5115 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ - 5121 # check output - 5122 (check-stream-equal _test-output-stream "" "F - test-get-with-wrong-base-type-2: output should be empty") - 5123 (check-next-stream-line-equal _test-error-stream "fn foo: stmt get: var 'a' is an 'addr' type, and so must live in a register" "F - test-get-with-wrong-base-type-2: error message") - 5124 # check that stop(1) was called - 5125 (check-ints-equal *(edx+4) 2 "F - test-get-with-wrong-base-type-2: exit status") - 5126 # don't restore from ebp - 5127 81 0/subop/add %esp 8/imm32 - 5128 # . epilogue - 5129 5d/pop-to-ebp - 5130 c3/return - 5131 - 5132 test-get-with-wrong-offset-type: - 5133 # . prologue - 5134 55/push-ebp - 5135 89/<- %ebp 4/r32/esp - 5136 # setup - 5137 (clear-stream _test-input-stream) - 5138 (clear-stream $_test-input-buffered-file->buffer) - 5139 (clear-stream _test-output-stream) - 5140 (clear-stream $_test-output-buffered-file->buffer) - 5141 (clear-stream _test-error-stream) - 5142 (clear-stream $_test-error-buffered-file->buffer) - 5143 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) - 5144 68/push 0/imm32 + 5053 68/push 0/imm32 + 5054 89/<- %edx 4/r32/esp + 5055 (tailor-exit-descriptor %edx 0x10) + 5056 # + 5057 (write _test-input-stream "fn foo {\n") + 5058 (write _test-input-stream " var a: t\n") + 5059 (write _test-input-stream " var c/ecx: (addr int) <- get a, y\n") + 5060 (write _test-input-stream "}\n") + 5061 (write _test-input-stream "type t {\n") + 5062 (write _test-input-stream " x: int\n") + 5063 (write _test-input-stream "}\n") + 5064 # convert + 5065 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) + 5066 # registers except esp clobbered at this point + 5067 # restore ed + 5068 89/<- %edx 4/r32/esp + 5069 (flush _test-output-buffered-file) + 5070 (flush _test-error-buffered-file) + 5071 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ + 5077 # check output + 5078 (check-stream-equal _test-output-stream "" "F - test-get-with-wrong-field: output should be empty") + 5079 (check-next-stream-line-equal _test-error-stream "fn foo: stmt get: type 't' has no member called 'y'" "F - test-get-with-wrong-field: error message") + 5080 # check that stop(1) was called + 5081 (check-ints-equal *(edx+4) 2 "F - test-get-with-wrong-field: exit status") + 5082 # don't restore from ebp + 5083 81 0/subop/add %esp 8/imm32 + 5084 # . epilogue + 5085 5d/pop-to-ebp + 5086 c3/return + 5087 + 5088 test-get-with-wrong-base-type: + 5089 # . prologue + 5090 55/push-ebp + 5091 89/<- %ebp 4/r32/esp + 5092 # setup + 5093 (clear-stream _test-input-stream) + 5094 (clear-stream $_test-input-buffered-file->buffer) + 5095 (clear-stream _test-output-stream) + 5096 (clear-stream $_test-output-buffered-file->buffer) + 5097 (clear-stream _test-error-stream) + 5098 (clear-stream $_test-error-buffered-file->buffer) + 5099 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) + 5100 68/push 0/imm32 + 5101 68/push 0/imm32 + 5102 89/<- %edx 4/r32/esp + 5103 (tailor-exit-descriptor %edx 0x10) + 5104 # + 5105 (write _test-input-stream "fn foo {\n") + 5106 (write _test-input-stream " var a: int\n") + 5107 (write _test-input-stream " var c/ecx: (addr int) <- get a, y\n") + 5108 (write _test-input-stream "}\n") + 5109 # convert + 5110 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) + 5111 # registers except esp clobbered at this point + 5112 # restore ed + 5113 89/<- %edx 4/r32/esp + 5114 (flush _test-output-buffered-file) + 5115 (flush _test-error-buffered-file) + 5116 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ + 5122 # check output + 5123 (check-stream-equal _test-output-stream "" "F - test-get-with-wrong-base-type: output should be empty") + 5124 (check-next-stream-line-equal _test-error-stream "fn foo: stmt get: var 'a' must have a 'type' definition" "F - test-get-with-wrong-base-type: error message") + 5125 # check that stop(1) was called + 5126 (check-ints-equal *(edx+4) 2 "F - test-get-with-wrong-base-type: exit status") + 5127 # don't restore from ebp + 5128 81 0/subop/add %esp 8/imm32 + 5129 # . epilogue + 5130 5d/pop-to-ebp + 5131 c3/return + 5132 + 5133 test-get-with-wrong-base-type-2: + 5134 # . prologue + 5135 55/push-ebp + 5136 89/<- %ebp 4/r32/esp + 5137 # setup + 5138 (clear-stream _test-input-stream) + 5139 (clear-stream $_test-input-buffered-file->buffer) + 5140 (clear-stream _test-output-stream) + 5141 (clear-stream $_test-output-buffered-file->buffer) + 5142 (clear-stream _test-error-stream) + 5143 (clear-stream $_test-error-buffered-file->buffer) + 5144 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) 5145 68/push 0/imm32 - 5146 89/<- %edx 4/r32/esp - 5147 (tailor-exit-descriptor %edx 0x10) - 5148 # - 5149 (write _test-input-stream "fn foo {\n") - 5150 (write _test-input-stream " var a: t\n") - 5151 (write _test-input-stream " var b: int\n") - 5152 (write _test-input-stream " var c/ecx: (addr int) <- get a, b\n") - 5153 (write _test-input-stream "}\n") - 5154 (write _test-input-stream "type t {\n") - 5155 (write _test-input-stream " x: int\n") - 5156 (write _test-input-stream "}\n") + 5146 68/push 0/imm32 + 5147 89/<- %edx 4/r32/esp + 5148 (tailor-exit-descriptor %edx 0x10) + 5149 # + 5150 (write _test-input-stream "fn foo {\n") + 5151 (write _test-input-stream " var a: (addr t)\n") + 5152 (write _test-input-stream " var c/ecx: (addr int) <- get a, y\n") + 5153 (write _test-input-stream "}\n") + 5154 (write _test-input-stream "type t {\n") + 5155 (write _test-input-stream " x: int\n") + 5156 (write _test-input-stream "}\n") 5157 # convert - 5158 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) + 5158 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) 5159 # registers except esp clobbered at this point 5160 # restore ed 5161 89/<- %edx 4/r32/esp - 5162 (flush _test-output-buffered-file) - 5163 (flush _test-error-buffered-file) + 5162 (flush _test-output-buffered-file) + 5163 (flush _test-error-buffered-file) 5164 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ 5170 # check output - 5171 (check-stream-equal _test-output-stream "" "F - test-get-with-wrong-offset-type: output should be empty") - 5172 (check-next-stream-line-equal _test-error-stream "fn foo: stmt get: type 't' has no member called 'b'" "F - test-get-with-wrong-offset-type: error message") + 5171 (check-stream-equal _test-output-stream "" "F - test-get-with-wrong-base-type-2: output should be empty") + 5172 (check-next-stream-line-equal _test-error-stream "fn foo: stmt get: var 'a' is an 'addr' type, and so must live in a register" "F - test-get-with-wrong-base-type-2: error message") 5173 # check that stop(1) was called - 5174 (check-ints-equal *(edx+4) 2 "F - test-get-with-wrong-offset-type: exit status") + 5174 (check-ints-equal *(edx+4) 2 "F - test-get-with-wrong-base-type-2: exit status") 5175 # don't restore from ebp 5176 81 0/subop/add %esp 8/imm32 5177 # . epilogue 5178 5d/pop-to-ebp 5179 c3/return 5180 - 5181 test-get-with-wrong-output-type: + 5181 test-get-with-wrong-offset-type: 5182 # . prologue 5183 55/push-ebp 5184 89/<- %ebp 4/r32/esp 5185 # setup - 5186 (clear-stream _test-input-stream) - 5187 (clear-stream $_test-input-buffered-file->buffer) - 5188 (clear-stream _test-output-stream) - 5189 (clear-stream $_test-output-buffered-file->buffer) - 5190 (clear-stream _test-error-stream) - 5191 (clear-stream $_test-error-buffered-file->buffer) + 5186 (clear-stream _test-input-stream) + 5187 (clear-stream $_test-input-buffered-file->buffer) + 5188 (clear-stream _test-output-stream) + 5189 (clear-stream $_test-output-buffered-file->buffer) + 5190 (clear-stream _test-error-stream) + 5191 (clear-stream $_test-error-buffered-file->buffer) 5192 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) 5193 68/push 0/imm32 5194 68/push 0/imm32 5195 89/<- %edx 4/r32/esp - 5196 (tailor-exit-descriptor %edx 0x10) + 5196 (tailor-exit-descriptor %edx 0x10) 5197 # - 5198 (write _test-input-stream "fn foo {\n") - 5199 (write _test-input-stream " var a: t\n") - 5200 (write _test-input-stream " var c: (addr int)\n") - 5201 (write _test-input-stream " c <- get a, x\n") - 5202 (write _test-input-stream "}\n") - 5203 (write _test-input-stream "type t {\n") - 5204 (write _test-input-stream " x: int\n") - 5205 (write _test-input-stream "}\n") + 5198 (write _test-input-stream "fn foo {\n") + 5199 (write _test-input-stream " var a: t\n") + 5200 (write _test-input-stream " var b: int\n") + 5201 (write _test-input-stream " var c/ecx: (addr int) <- get a, b\n") + 5202 (write _test-input-stream "}\n") + 5203 (write _test-input-stream "type t {\n") + 5204 (write _test-input-stream " x: int\n") + 5205 (write _test-input-stream "}\n") 5206 # convert - 5207 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) + 5207 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) 5208 # registers except esp clobbered at this point 5209 # restore ed 5210 89/<- %edx 4/r32/esp - 5211 (flush _test-output-buffered-file) - 5212 (flush _test-error-buffered-file) + 5211 (flush _test-output-buffered-file) + 5212 (flush _test-error-buffered-file) 5213 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ 5219 # check output - 5220 (check-stream-equal _test-output-stream "" "F - test-get-with-wrong-output-type: output should be empty") - 5221 (check-next-stream-line-equal _test-error-stream "fn foo: stmt get: output 'c' is not in a register" "F - test-get-with-wrong-output-type: error message") + 5220 (check-stream-equal _test-output-stream "" "F - test-get-with-wrong-offset-type: output should be empty") + 5221 (check-next-stream-line-equal _test-error-stream "fn foo: stmt get: type 't' has no member called 'b'" "F - test-get-with-wrong-offset-type: error message") 5222 # check that stop(1) was called - 5223 (check-ints-equal *(edx+4) 2 "F - test-get-with-wrong-output-type: exit status") + 5223 (check-ints-equal *(edx+4) 2 "F - test-get-with-wrong-offset-type: exit status") 5224 # don't restore from ebp 5225 81 0/subop/add %esp 8/imm32 5226 # . epilogue 5227 5d/pop-to-ebp 5228 c3/return 5229 - 5230 test-get-with-wrong-output-type-2: + 5230 test-get-with-wrong-output-type: 5231 # . prologue 5232 55/push-ebp 5233 89/<- %ebp 4/r32/esp 5234 # setup - 5235 (clear-stream _test-input-stream) - 5236 (clear-stream $_test-input-buffered-file->buffer) - 5237 (clear-stream _test-output-stream) - 5238 (clear-stream $_test-output-buffered-file->buffer) - 5239 (clear-stream _test-error-stream) - 5240 (clear-stream $_test-error-buffered-file->buffer) + 5235 (clear-stream _test-input-stream) + 5236 (clear-stream $_test-input-buffered-file->buffer) + 5237 (clear-stream _test-output-stream) + 5238 (clear-stream $_test-output-buffered-file->buffer) + 5239 (clear-stream _test-error-stream) + 5240 (clear-stream $_test-error-buffered-file->buffer) 5241 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) 5242 68/push 0/imm32 5243 68/push 0/imm32 5244 89/<- %edx 4/r32/esp - 5245 (tailor-exit-descriptor %edx 0x10) + 5245 (tailor-exit-descriptor %edx 0x10) 5246 # - 5247 (write _test-input-stream "fn foo {\n") - 5248 (write _test-input-stream " var a: t\n") - 5249 (write _test-input-stream " var c/ecx: int <- get a, x\n") - 5250 (write _test-input-stream "}\n") - 5251 (write _test-input-stream "type t {\n") - 5252 (write _test-input-stream " x: int\n") - 5253 (write _test-input-stream "}\n") - 5254 # convert - 5255 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) - 5256 # registers except esp clobbered at this point - 5257 # restore ed - 5258 89/<- %edx 4/r32/esp - 5259 (flush _test-output-buffered-file) - 5260 (flush _test-error-buffered-file) - 5261 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ - 5267 # check output - 5268 (check-stream-equal _test-output-stream "" "F - test-get-with-wrong-output-type-2: output should be empty") - 5269 (check-next-stream-line-equal _test-error-stream "fn foo: stmt get: output must be an address" "F - test-get-with-wrong-output-type-2: error message") - 5270 # check that stop(1) was called - 5271 (check-ints-equal *(edx+4) 2 "F - test-get-with-wrong-output-type-2: exit status") - 5272 # don't restore from ebp - 5273 81 0/subop/add %esp 8/imm32 - 5274 # . epilogue - 5275 5d/pop-to-ebp - 5276 c3/return - 5277 - 5278 test-get-with-wrong-output-type-3: - 5279 # . prologue - 5280 55/push-ebp - 5281 89/<- %ebp 4/r32/esp - 5282 # setup - 5283 (clear-stream _test-input-stream) - 5284 (clear-stream $_test-input-buffered-file->buffer) - 5285 (clear-stream _test-output-stream) - 5286 (clear-stream $_test-output-buffered-file->buffer) - 5287 (clear-stream _test-error-stream) - 5288 (clear-stream $_test-error-buffered-file->buffer) - 5289 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) - 5290 68/push 0/imm32 + 5247 (write _test-input-stream "fn foo {\n") + 5248 (write _test-input-stream " var a: t\n") + 5249 (write _test-input-stream " var c: (addr int)\n") + 5250 (write _test-input-stream " c <- get a, x\n") + 5251 (write _test-input-stream "}\n") + 5252 (write _test-input-stream "type t {\n") + 5253 (write _test-input-stream " x: int\n") + 5254 (write _test-input-stream "}\n") + 5255 # convert + 5256 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) + 5257 # registers except esp clobbered at this point + 5258 # restore ed + 5259 89/<- %edx 4/r32/esp + 5260 (flush _test-output-buffered-file) + 5261 (flush _test-error-buffered-file) + 5262 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ + 5268 # check output + 5269 (check-stream-equal _test-output-stream "" "F - test-get-with-wrong-output-type: output should be empty") + 5270 (check-next-stream-line-equal _test-error-stream "fn foo: stmt get: output 'c' is not in a register" "F - test-get-with-wrong-output-type: error message") + 5271 # check that stop(1) was called + 5272 (check-ints-equal *(edx+4) 2 "F - test-get-with-wrong-output-type: exit status") + 5273 # don't restore from ebp + 5274 81 0/subop/add %esp 8/imm32 + 5275 # . epilogue + 5276 5d/pop-to-ebp + 5277 c3/return + 5278 + 5279 test-get-with-wrong-output-type-2: + 5280 # . prologue + 5281 55/push-ebp + 5282 89/<- %ebp 4/r32/esp + 5283 # setup + 5284 (clear-stream _test-input-stream) + 5285 (clear-stream $_test-input-buffered-file->buffer) + 5286 (clear-stream _test-output-stream) + 5287 (clear-stream $_test-output-buffered-file->buffer) + 5288 (clear-stream _test-error-stream) + 5289 (clear-stream $_test-error-buffered-file->buffer) + 5290 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) 5291 68/push 0/imm32 - 5292 89/<- %edx 4/r32/esp - 5293 (tailor-exit-descriptor %edx 0x10) - 5294 # - 5295 (write _test-input-stream "fn foo {\n") - 5296 (write _test-input-stream " var a: t\n") - 5297 (write _test-input-stream " var c/ecx: (array int) <- get a, x\n") - 5298 (write _test-input-stream "}\n") - 5299 (write _test-input-stream "type t {\n") - 5300 (write _test-input-stream " x: int\n") - 5301 (write _test-input-stream "}\n") - 5302 # convert - 5303 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) - 5304 # registers except esp clobbered at this point - 5305 # restore ed - 5306 89/<- %edx 4/r32/esp - 5307 (flush _test-output-buffered-file) - 5308 (flush _test-error-buffered-file) - 5309 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ - 5315 # check output - 5316 (check-stream-equal _test-output-stream "" "F - test-get-with-wrong-output-type-3: output should be empty") - 5317 (check-next-stream-line-equal _test-error-stream "fn foo: stmt get: output must be an address" "F - test-get-with-wrong-output-type-3: error message") - 5318 # check that stop(1) was called - 5319 (check-ints-equal *(edx+4) 2 "F - test-get-with-wrong-output-type-3: exit status") - 5320 # don't restore from ebp - 5321 81 0/subop/add %esp 8/imm32 - 5322 # . epilogue - 5323 5d/pop-to-ebp - 5324 c3/return - 5325 - 5326 test-get-with-wrong-output-type-4: - 5327 # . prologue - 5328 55/push-ebp - 5329 89/<- %ebp 4/r32/esp - 5330 # setup - 5331 (clear-stream _test-input-stream) - 5332 (clear-stream $_test-input-buffered-file->buffer) - 5333 (clear-stream _test-output-stream) - 5334 (clear-stream $_test-output-buffered-file->buffer) - 5335 (clear-stream _test-error-stream) - 5336 (clear-stream $_test-error-buffered-file->buffer) - 5337 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) - 5338 68/push 0/imm32 + 5292 68/push 0/imm32 + 5293 89/<- %edx 4/r32/esp + 5294 (tailor-exit-descriptor %edx 0x10) + 5295 # + 5296 (write _test-input-stream "fn foo {\n") + 5297 (write _test-input-stream " var a: t\n") + 5298 (write _test-input-stream " var c/ecx: int <- get a, x\n") + 5299 (write _test-input-stream "}\n") + 5300 (write _test-input-stream "type t {\n") + 5301 (write _test-input-stream " x: int\n") + 5302 (write _test-input-stream "}\n") + 5303 # convert + 5304 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) + 5305 # registers except esp clobbered at this point + 5306 # restore ed + 5307 89/<- %edx 4/r32/esp + 5308 (flush _test-output-buffered-file) + 5309 (flush _test-error-buffered-file) + 5310 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ + 5316 # check output + 5317 (check-stream-equal _test-output-stream "" "F - test-get-with-wrong-output-type-2: output should be empty") + 5318 (check-next-stream-line-equal _test-error-stream "fn foo: stmt get: output must be an address" "F - test-get-with-wrong-output-type-2: error message") + 5319 # check that stop(1) was called + 5320 (check-ints-equal *(edx+4) 2 "F - test-get-with-wrong-output-type-2: exit status") + 5321 # don't restore from ebp + 5322 81 0/subop/add %esp 8/imm32 + 5323 # . epilogue + 5324 5d/pop-to-ebp + 5325 c3/return + 5326 + 5327 test-get-with-wrong-output-type-3: + 5328 # . prologue + 5329 55/push-ebp + 5330 89/<- %ebp 4/r32/esp + 5331 # setup + 5332 (clear-stream _test-input-stream) + 5333 (clear-stream $_test-input-buffered-file->buffer) + 5334 (clear-stream _test-output-stream) + 5335 (clear-stream $_test-output-buffered-file->buffer) + 5336 (clear-stream _test-error-stream) + 5337 (clear-stream $_test-error-buffered-file->buffer) + 5338 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) 5339 68/push 0/imm32 - 5340 89/<- %edx 4/r32/esp - 5341 (tailor-exit-descriptor %edx 0x10) - 5342 # - 5343 (write _test-input-stream "fn foo {\n") - 5344 (write _test-input-stream " var a: t\n") - 5345 (write _test-input-stream " var c/ecx: (addr boolean) <- get a, x\n") - 5346 (write _test-input-stream "}\n") - 5347 (write _test-input-stream "type t {\n") - 5348 (write _test-input-stream " x: int\n") - 5349 (write _test-input-stream "}\n") - 5350 # convert - 5351 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) - 5352 # registers except esp clobbered at this point - 5353 # restore ed - 5354 89/<- %edx 4/r32/esp - 5355 (flush _test-output-buffered-file) - 5356 (flush _test-error-buffered-file) - 5357 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ - 5363 # check output - 5364 (check-stream-equal _test-output-stream "" "F - test-get-with-wrong-output-type-4: output should be empty") - 5365 (check-next-stream-line-equal _test-error-stream "fn foo: stmt get: wrong output type for member 'x' of type 't'" "F - test-get-with-wrong-output-type-4: error message") - 5366 # check that stop(1) was called - 5367 (check-ints-equal *(edx+4) 2 "F - test-get-with-wrong-output-type-4: exit status") - 5368 # don't restore from ebp - 5369 81 0/subop/add %esp 8/imm32 - 5370 # . epilogue - 5371 5d/pop-to-ebp - 5372 c3/return - 5373 - 5374 test-get-with-wrong-output-type-5: - 5375 # . prologue - 5376 55/push-ebp - 5377 89/<- %ebp 4/r32/esp - 5378 # setup - 5379 (clear-stream _test-input-stream) - 5380 (clear-stream $_test-input-buffered-file->buffer) - 5381 (clear-stream _test-output-stream) - 5382 (clear-stream $_test-output-buffered-file->buffer) - 5383 # - 5384 (write _test-input-stream "fn foo {\n") - 5385 (write _test-input-stream " var a: t\n") - 5386 (write _test-input-stream " var c/ecx: (addr handle int) <- get a, x\n") - 5387 (write _test-input-stream "}\n") - 5388 (write _test-input-stream "type t {\n") - 5389 (write _test-input-stream " x: (handle int)\n") - 5390 (write _test-input-stream "}\n") - 5391 # convert - 5392 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 5393 (flush _test-output-buffered-file) - 5394 # no errors - 5395 # . epilogue - 5396 89/<- %esp 5/r32/ebp - 5397 5d/pop-to-ebp - 5398 c3/return - 5399 - 5400 test-get-with-too-few-inouts: - 5401 # . prologue - 5402 55/push-ebp - 5403 89/<- %ebp 4/r32/esp - 5404 # setup - 5405 (clear-stream _test-input-stream) - 5406 (clear-stream $_test-input-buffered-file->buffer) - 5407 (clear-stream _test-output-stream) - 5408 (clear-stream $_test-output-buffered-file->buffer) - 5409 (clear-stream _test-error-stream) - 5410 (clear-stream $_test-error-buffered-file->buffer) - 5411 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) - 5412 68/push 0/imm32 - 5413 68/push 0/imm32 - 5414 89/<- %edx 4/r32/esp - 5415 (tailor-exit-descriptor %edx 0x10) - 5416 # - 5417 (write _test-input-stream "fn foo {\n") - 5418 (write _test-input-stream " var a: t\n") - 5419 (write _test-input-stream " var c/ecx: (addr int) <- get a\n") - 5420 (write _test-input-stream "}\n") - 5421 (write _test-input-stream "type t {\n") - 5422 (write _test-input-stream " x: int\n") - 5423 (write _test-input-stream "}\n") - 5424 # convert - 5425 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) - 5426 # registers except esp clobbered at this point - 5427 # restore ed - 5428 89/<- %edx 4/r32/esp - 5429 (flush _test-output-buffered-file) - 5430 (flush _test-error-buffered-file) - 5431 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ - 5437 # check output - 5438 (check-stream-equal _test-output-stream "" "F - test-get-with-too-few-inouts: output should be empty") - 5439 (check-next-stream-line-equal _test-error-stream "fn foo: stmt get: too few inouts (2 required)" "F - test-get-with-too-few-inouts: error message") - 5440 # check that stop(1) was called - 5441 (check-ints-equal *(edx+4) 2 "F - test-get-with-too-few-inouts: exit status") - 5442 # don't restore from ebp - 5443 81 0/subop/add %esp 8/imm32 + 5340 68/push 0/imm32 + 5341 89/<- %edx 4/r32/esp + 5342 (tailor-exit-descriptor %edx 0x10) + 5343 # + 5344 (write _test-input-stream "fn foo {\n") + 5345 (write _test-input-stream " var a: t\n") + 5346 (write _test-input-stream " var c/ecx: (array int) <- get a, x\n") + 5347 (write _test-input-stream "}\n") + 5348 (write _test-input-stream "type t {\n") + 5349 (write _test-input-stream " x: int\n") + 5350 (write _test-input-stream "}\n") + 5351 # convert + 5352 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) + 5353 # registers except esp clobbered at this point + 5354 # restore ed + 5355 89/<- %edx 4/r32/esp + 5356 (flush _test-output-buffered-file) + 5357 (flush _test-error-buffered-file) + 5358 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ + 5364 # check output + 5365 (check-stream-equal _test-output-stream "" "F - test-get-with-wrong-output-type-3: output should be empty") + 5366 (check-next-stream-line-equal _test-error-stream "fn foo: stmt get: output must be an address" "F - test-get-with-wrong-output-type-3: error message") + 5367 # check that stop(1) was called + 5368 (check-ints-equal *(edx+4) 2 "F - test-get-with-wrong-output-type-3: exit status") + 5369 # don't restore from ebp + 5370 81 0/subop/add %esp 8/imm32 + 5371 # . epilogue + 5372 5d/pop-to-ebp + 5373 c3/return + 5374 + 5375 test-get-with-wrong-output-type-4: + 5376 # . prologue + 5377 55/push-ebp + 5378 89/<- %ebp 4/r32/esp + 5379 # setup + 5380 (clear-stream _test-input-stream) + 5381 (clear-stream $_test-input-buffered-file->buffer) + 5382 (clear-stream _test-output-stream) + 5383 (clear-stream $_test-output-buffered-file->buffer) + 5384 (clear-stream _test-error-stream) + 5385 (clear-stream $_test-error-buffered-file->buffer) + 5386 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) + 5387 68/push 0/imm32 + 5388 68/push 0/imm32 + 5389 89/<- %edx 4/r32/esp + 5390 (tailor-exit-descriptor %edx 0x10) + 5391 # + 5392 (write _test-input-stream "fn foo {\n") + 5393 (write _test-input-stream " var a: t\n") + 5394 (write _test-input-stream " var c/ecx: (addr boolean) <- get a, x\n") + 5395 (write _test-input-stream "}\n") + 5396 (write _test-input-stream "type t {\n") + 5397 (write _test-input-stream " x: int\n") + 5398 (write _test-input-stream "}\n") + 5399 # convert + 5400 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) + 5401 # registers except esp clobbered at this point + 5402 # restore ed + 5403 89/<- %edx 4/r32/esp + 5404 (flush _test-output-buffered-file) + 5405 (flush _test-error-buffered-file) + 5406 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ + 5412 # check output + 5413 (check-stream-equal _test-output-stream "" "F - test-get-with-wrong-output-type-4: output should be empty") + 5414 (check-next-stream-line-equal _test-error-stream "fn foo: stmt get: wrong output type for member 'x' of type 't'" "F - test-get-with-wrong-output-type-4: error message") + 5415 # check that stop(1) was called + 5416 (check-ints-equal *(edx+4) 2 "F - test-get-with-wrong-output-type-4: exit status") + 5417 # don't restore from ebp + 5418 81 0/subop/add %esp 8/imm32 + 5419 # . epilogue + 5420 5d/pop-to-ebp + 5421 c3/return + 5422 + 5423 test-get-with-wrong-output-type-5: + 5424 # . prologue + 5425 55/push-ebp + 5426 89/<- %ebp 4/r32/esp + 5427 # setup + 5428 (clear-stream _test-input-stream) + 5429 (clear-stream $_test-input-buffered-file->buffer) + 5430 (clear-stream _test-output-stream) + 5431 (clear-stream $_test-output-buffered-file->buffer) + 5432 # + 5433 (write _test-input-stream "fn foo {\n") + 5434 (write _test-input-stream " var a: t\n") + 5435 (write _test-input-stream " var c/ecx: (addr handle int) <- get a, x\n") + 5436 (write _test-input-stream "}\n") + 5437 (write _test-input-stream "type t {\n") + 5438 (write _test-input-stream " x: (handle int)\n") + 5439 (write _test-input-stream "}\n") + 5440 # convert + 5441 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 5442 (flush _test-output-buffered-file) + 5443 # no errors 5444 # . epilogue - 5445 5d/pop-to-ebp - 5446 c3/return - 5447 - 5448 test-get-with-too-many-inouts: - 5449 # . prologue - 5450 55/push-ebp - 5451 89/<- %ebp 4/r32/esp - 5452 # setup - 5453 (clear-stream _test-input-stream) - 5454 (clear-stream $_test-input-buffered-file->buffer) - 5455 (clear-stream _test-output-stream) - 5456 (clear-stream $_test-output-buffered-file->buffer) - 5457 (clear-stream _test-error-stream) - 5458 (clear-stream $_test-error-buffered-file->buffer) - 5459 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) - 5460 68/push 0/imm32 + 5445 89/<- %esp 5/r32/ebp + 5446 5d/pop-to-ebp + 5447 c3/return + 5448 + 5449 test-get-with-too-few-inouts: + 5450 # . prologue + 5451 55/push-ebp + 5452 89/<- %ebp 4/r32/esp + 5453 # setup + 5454 (clear-stream _test-input-stream) + 5455 (clear-stream $_test-input-buffered-file->buffer) + 5456 (clear-stream _test-output-stream) + 5457 (clear-stream $_test-output-buffered-file->buffer) + 5458 (clear-stream _test-error-stream) + 5459 (clear-stream $_test-error-buffered-file->buffer) + 5460 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) 5461 68/push 0/imm32 - 5462 89/<- %edx 4/r32/esp - 5463 (tailor-exit-descriptor %edx 0x10) - 5464 # - 5465 (write _test-input-stream "fn foo {\n") - 5466 (write _test-input-stream " var a: t\n") - 5467 (write _test-input-stream " var c/ecx: (addr int) <- get a, x, 0\n") - 5468 (write _test-input-stream "}\n") - 5469 (write _test-input-stream "type t {\n") - 5470 (write _test-input-stream " x: int\n") - 5471 (write _test-input-stream "}\n") - 5472 # convert - 5473 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) - 5474 # registers except esp clobbered at this point - 5475 # restore ed - 5476 89/<- %edx 4/r32/esp - 5477 (flush _test-output-buffered-file) - 5478 (flush _test-error-buffered-file) - 5479 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ - 5485 # check output - 5486 (check-stream-equal _test-output-stream "" "F - test-get-with-too-many-inouts: output should be empty") - 5487 (check-next-stream-line-equal _test-error-stream "fn foo: stmt get: too many inouts (2 required)" "F - test-get-with-too-many-inouts: error message") - 5488 # check that stop(1) was called - 5489 (check-ints-equal *(edx+4) 2 "F - test-get-with-too-many-inouts: exit status") - 5490 # don't restore from ebp - 5491 81 0/subop/add %esp 8/imm32 - 5492 # . epilogue - 5493 5d/pop-to-ebp - 5494 c3/return - 5495 - 5496 test-get-with-no-output: - 5497 # . prologue - 5498 55/push-ebp - 5499 89/<- %ebp 4/r32/esp - 5500 # setup - 5501 (clear-stream _test-input-stream) - 5502 (clear-stream $_test-input-buffered-file->buffer) - 5503 (clear-stream _test-output-stream) - 5504 (clear-stream $_test-output-buffered-file->buffer) - 5505 (clear-stream _test-error-stream) - 5506 (clear-stream $_test-error-buffered-file->buffer) - 5507 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) - 5508 68/push 0/imm32 + 5462 68/push 0/imm32 + 5463 89/<- %edx 4/r32/esp + 5464 (tailor-exit-descriptor %edx 0x10) + 5465 # + 5466 (write _test-input-stream "fn foo {\n") + 5467 (write _test-input-stream " var a: t\n") + 5468 (write _test-input-stream " var c/ecx: (addr int) <- get a\n") + 5469 (write _test-input-stream "}\n") + 5470 (write _test-input-stream "type t {\n") + 5471 (write _test-input-stream " x: int\n") + 5472 (write _test-input-stream "}\n") + 5473 # convert + 5474 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) + 5475 # registers except esp clobbered at this point + 5476 # restore ed + 5477 89/<- %edx 4/r32/esp + 5478 (flush _test-output-buffered-file) + 5479 (flush _test-error-buffered-file) + 5480 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ + 5486 # check output + 5487 (check-stream-equal _test-output-stream "" "F - test-get-with-too-few-inouts: output should be empty") + 5488 (check-next-stream-line-equal _test-error-stream "fn foo: stmt get: too few inouts (2 required)" "F - test-get-with-too-few-inouts: error message") + 5489 # check that stop(1) was called + 5490 (check-ints-equal *(edx+4) 2 "F - test-get-with-too-few-inouts: exit status") + 5491 # don't restore from ebp + 5492 81 0/subop/add %esp 8/imm32 + 5493 # . epilogue + 5494 5d/pop-to-ebp + 5495 c3/return + 5496 + 5497 test-get-with-too-many-inouts: + 5498 # . prologue + 5499 55/push-ebp + 5500 89/<- %ebp 4/r32/esp + 5501 # setup + 5502 (clear-stream _test-input-stream) + 5503 (clear-stream $_test-input-buffered-file->buffer) + 5504 (clear-stream _test-output-stream) + 5505 (clear-stream $_test-output-buffered-file->buffer) + 5506 (clear-stream _test-error-stream) + 5507 (clear-stream $_test-error-buffered-file->buffer) + 5508 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) 5509 68/push 0/imm32 - 5510 89/<- %edx 4/r32/esp - 5511 (tailor-exit-descriptor %edx 0x10) - 5512 # - 5513 (write _test-input-stream "fn foo {\n") - 5514 (write _test-input-stream " var a: t\n") - 5515 (write _test-input-stream " get a, x\n") - 5516 (write _test-input-stream "}\n") - 5517 (write _test-input-stream "type t {\n") - 5518 (write _test-input-stream " x: int\n") - 5519 (write _test-input-stream "}\n") - 5520 # convert - 5521 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) - 5522 # registers except esp clobbered at this point - 5523 # restore ed - 5524 89/<- %edx 4/r32/esp - 5525 (flush _test-output-buffered-file) - 5526 (flush _test-error-buffered-file) - 5527 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ - 5533 # check output - 5534 (check-stream-equal _test-output-stream "" "F - test-get-with-no-output: output should be empty") - 5535 (check-next-stream-line-equal _test-error-stream "fn foo: stmt get: must have an output" "F - test-get-with-no-output: error message") - 5536 # check that stop(1) was called - 5537 (check-ints-equal *(edx+4) 2 "F - test-get-with-no-output: exit status") - 5538 # don't restore from ebp - 5539 81 0/subop/add %esp 8/imm32 - 5540 # . epilogue - 5541 5d/pop-to-ebp - 5542 c3/return - 5543 - 5544 test-get-with-too-many-outputs: - 5545 # . prologue - 5546 55/push-ebp - 5547 89/<- %ebp 4/r32/esp - 5548 # setup - 5549 (clear-stream _test-input-stream) - 5550 (clear-stream $_test-input-buffered-file->buffer) - 5551 (clear-stream _test-output-stream) - 5552 (clear-stream $_test-output-buffered-file->buffer) - 5553 (clear-stream _test-error-stream) - 5554 (clear-stream $_test-error-buffered-file->buffer) - 5555 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) - 5556 68/push 0/imm32 + 5510 68/push 0/imm32 + 5511 89/<- %edx 4/r32/esp + 5512 (tailor-exit-descriptor %edx 0x10) + 5513 # + 5514 (write _test-input-stream "fn foo {\n") + 5515 (write _test-input-stream " var a: t\n") + 5516 (write _test-input-stream " var c/ecx: (addr int) <- get a, x, 0\n") + 5517 (write _test-input-stream "}\n") + 5518 (write _test-input-stream "type t {\n") + 5519 (write _test-input-stream " x: int\n") + 5520 (write _test-input-stream "}\n") + 5521 # convert + 5522 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) + 5523 # registers except esp clobbered at this point + 5524 # restore ed + 5525 89/<- %edx 4/r32/esp + 5526 (flush _test-output-buffered-file) + 5527 (flush _test-error-buffered-file) + 5528 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ + 5534 # check output + 5535 (check-stream-equal _test-output-stream "" "F - test-get-with-too-many-inouts: output should be empty") + 5536 (check-next-stream-line-equal _test-error-stream "fn foo: stmt get: too many inouts (2 required)" "F - test-get-with-too-many-inouts: error message") + 5537 # check that stop(1) was called + 5538 (check-ints-equal *(edx+4) 2 "F - test-get-with-too-many-inouts: exit status") + 5539 # don't restore from ebp + 5540 81 0/subop/add %esp 8/imm32 + 5541 # . epilogue + 5542 5d/pop-to-ebp + 5543 c3/return + 5544 + 5545 test-get-with-no-output: + 5546 # . prologue + 5547 55/push-ebp + 5548 89/<- %ebp 4/r32/esp + 5549 # setup + 5550 (clear-stream _test-input-stream) + 5551 (clear-stream $_test-input-buffered-file->buffer) + 5552 (clear-stream _test-output-stream) + 5553 (clear-stream $_test-output-buffered-file->buffer) + 5554 (clear-stream _test-error-stream) + 5555 (clear-stream $_test-error-buffered-file->buffer) + 5556 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) 5557 68/push 0/imm32 - 5558 89/<- %edx 4/r32/esp - 5559 (tailor-exit-descriptor %edx 0x10) - 5560 # - 5561 (write _test-input-stream "fn foo {\n") - 5562 (write _test-input-stream " var a: t\n") - 5563 (write _test-input-stream " var b: int\n") - 5564 (write _test-input-stream " var c/eax: (addr int) <- copy 0\n") - 5565 (write _test-input-stream " c, b <- get a, x\n") - 5566 (write _test-input-stream "}\n") - 5567 (write _test-input-stream "type t {\n") - 5568 (write _test-input-stream " x: int\n") - 5569 (write _test-input-stream "}\n") - 5570 # convert - 5571 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) - 5572 # registers except esp clobbered at this point - 5573 # restore ed - 5574 89/<- %edx 4/r32/esp - 5575 (flush _test-output-buffered-file) - 5576 (flush _test-error-buffered-file) - 5577 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ - 5583 # check output - 5584 (check-stream-equal _test-output-stream "" "F - test-get-with-too-many-outputs: output should be empty") - 5585 (check-next-stream-line-equal _test-error-stream "fn foo: stmt get: too many outputs (1 required)" "F - test-get-with-too-many-outputs: error message") - 5586 # check that stop(1) was called - 5587 (check-ints-equal *(edx+4) 2 "F - test-get-with-too-many-outputs: exit status") - 5588 # don't restore from ebp - 5589 81 0/subop/add %esp 8/imm32 - 5590 # . epilogue - 5591 5d/pop-to-ebp - 5592 c3/return - 5593 - 5594 test-convert-array-of-user-defined-types: - 5595 # . prologue - 5596 55/push-ebp - 5597 89/<- %ebp 4/r32/esp - 5598 # setup - 5599 (clear-stream _test-input-stream) - 5600 (clear-stream $_test-input-buffered-file->buffer) - 5601 (clear-stream _test-output-stream) - 5602 (clear-stream $_test-output-buffered-file->buffer) - 5603 # - 5604 (write _test-input-stream "type t {\n") # each t is 8 bytes, which is a power of 2 - 5605 (write _test-input-stream " x: int\n") - 5606 (write _test-input-stream " y: int\n") - 5607 (write _test-input-stream "}\n") - 5608 (write _test-input-stream "fn foo {\n") - 5609 (write _test-input-stream " var arr/eax: (addr array t) <- copy 0\n") - 5610 (write _test-input-stream " var idx/ecx: int <- copy 3\n") - 5611 (write _test-input-stream " var x/eax: (addr int) <- index arr, idx\n") - 5612 (write _test-input-stream "}\n") - 5613 # convert - 5614 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 5615 (flush _test-output-buffered-file) - 5616 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 5622 # check output - 5623 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-array-of-user-defined-types/0") - 5624 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-array-of-user-defined-types/1") - 5625 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-array-of-user-defined-types/2") - 5626 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-array-of-user-defined-types/3") - 5627 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-array-of-user-defined-types/4") - 5628 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-array-of-user-defined-types/5") - 5629 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-array-of-user-defined-types/6") - 5630 (check-next-stream-line-equal _test-output-stream " b8/copy-to-eax 0/imm32" "F - test-convert-array-of-user-defined-types/7") - 5631 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-convert-array-of-user-defined-types/8") - 5632 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 3/imm32" "F - test-convert-array-of-user-defined-types/9") - 5633 (check-next-stream-line-equal _test-output-stream " 8d/copy-address *(eax + ecx<<0x00000003 + 4) 0x00000000/r32" "F - test-convert-array-of-user-defined-types/11") - 5634 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-convert-array-of-user-defined-types/13") - 5635 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-array-of-user-defined-types/14") - 5636 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-array-of-user-defined-types/15") - 5637 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-array-of-user-defined-types/16") - 5638 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-array-of-user-defined-types/17") - 5639 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-array-of-user-defined-types/18") - 5640 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-array-of-user-defined-types/19") - 5641 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-array-of-user-defined-types/20") - 5642 # . epilogue - 5643 89/<- %esp 5/r32/ebp - 5644 5d/pop-to-ebp - 5645 c3/return - 5646 - 5647 test-convert-length-of-array-of-user-defined-types-to-eax: - 5648 # . prologue - 5649 55/push-ebp - 5650 89/<- %ebp 4/r32/esp - 5651 # setup - 5652 (clear-stream _test-input-stream) - 5653 (clear-stream $_test-input-buffered-file->buffer) - 5654 (clear-stream _test-output-stream) - 5655 (clear-stream $_test-output-buffered-file->buffer) - 5656 # - 5657 (write _test-input-stream "type t {\n") # size = 12, which is not a power of 2 - 5658 (write _test-input-stream " x: int\n") - 5659 (write _test-input-stream " y: int\n") - 5660 (write _test-input-stream " z: int\n") - 5661 (write _test-input-stream "}\n") - 5662 (write _test-input-stream "fn foo {\n") - 5663 (write _test-input-stream " var arr/eax: (addr array t) <- copy 0\n") - 5664 (write _test-input-stream " var x/eax: (addr t) <- length arr\n") - 5665 (write _test-input-stream "}\n") - 5666 # convert - 5667 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 5668 (flush _test-output-buffered-file) - 5669 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 5675 # check output - 5676 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-length-of-array-of-user-defined-types-to-eax/0") - 5677 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-length-of-array-of-user-defined-types-to-eax/1") - 5678 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-length-of-array-of-user-defined-types-to-eax/2") - 5679 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-length-of-array-of-user-defined-types-to-eax/3") - 5680 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-length-of-array-of-user-defined-types-to-eax/4") - 5681 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-length-of-array-of-user-defined-types-to-eax/5") - 5682 # var arr - 5683 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-length-of-array-of-user-defined-types-to-eax/6") - 5684 (check-next-stream-line-equal _test-output-stream " b8/copy-to-eax 0/imm32" "F - test-convert-length-of-array-of-user-defined-types-to-eax/7") - 5685 # length instruction - 5686 (check-next-stream-line-equal _test-output-stream " 51/push-ecx" "F - test-convert-length-of-array-of-user-defined-types-to-eax/8") - 5687 (check-next-stream-line-equal _test-output-stream " 52/push-edx" "F - test-convert-length-of-array-of-user-defined-types-to-eax/9") - 5688 (check-next-stream-line-equal _test-output-stream " 8b/-> *eax 0x00000000/r32" "F - test-convert-length-of-array-of-user-defined-types-to-eax/10") - 5689 (check-next-stream-line-equal _test-output-stream " 31/xor %edx 2/r32/edx" "F - test-convert-length-of-array-of-user-defined-types-to-eax/11") - 5690 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 0x0000000c/imm32" "F - test-convert-length-of-array-of-user-defined-types-to-eax/12") - 5691 (check-next-stream-line-equal _test-output-stream " f7 7/subop/idiv-eax-edx-by %ecx" "F - test-convert-length-of-array-of-user-defined-types-to-eax/13") - 5692 (check-next-stream-line-equal _test-output-stream " 5a/pop-to-edx" "F - test-convert-length-of-array-of-user-defined-types-to-eax/14") - 5693 (check-next-stream-line-equal _test-output-stream " 59/pop-to-ecx" "F - test-convert-length-of-array-of-user-defined-types-to-eax/15") - 5694 # reclaim arr - 5695 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-length-of-array-of-user-defined-types-to-eax/16") - 5696 # - 5697 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-length-of-array-of-user-defined-types-to-eax/17") - 5698 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-length-of-array-of-user-defined-types-to-eax/18") - 5699 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-length-of-array-of-user-defined-types-to-eax/19") - 5700 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-length-of-array-of-user-defined-types-to-eax/20") - 5701 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-length-of-array-of-user-defined-types-to-eax/21") - 5702 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-length-of-array-of-user-defined-types-to-eax/22") - 5703 # . epilogue - 5704 89/<- %esp 5/r32/ebp - 5705 5d/pop-to-ebp - 5706 c3/return - 5707 - 5708 test-convert-length-of-array-of-user-defined-types-to-ecx: - 5709 # . prologue - 5710 55/push-ebp - 5711 89/<- %ebp 4/r32/esp - 5712 # setup - 5713 (clear-stream _test-input-stream) - 5714 (clear-stream $_test-input-buffered-file->buffer) - 5715 (clear-stream _test-output-stream) - 5716 (clear-stream $_test-output-buffered-file->buffer) - 5717 # - 5718 (write _test-input-stream "type t {\n") # size = 12, which is not a power of 2 - 5719 (write _test-input-stream " x: int\n") - 5720 (write _test-input-stream " y: int\n") - 5721 (write _test-input-stream " z: int\n") - 5722 (write _test-input-stream "}\n") - 5723 (write _test-input-stream "fn foo {\n") - 5724 (write _test-input-stream " var arr/eax: (addr array t) <- copy 0\n") - 5725 (write _test-input-stream " var x/ecx: (addr t) <- length arr\n") - 5726 (write _test-input-stream "}\n") - 5727 # convert - 5728 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 5729 (flush _test-output-buffered-file) - 5730 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 5736 # check output - 5737 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/0") - 5738 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/1") - 5739 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/2") - 5740 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/3") - 5741 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/4") - 5742 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/5") - 5743 # var a - 5744 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/6") - 5745 (check-next-stream-line-equal _test-output-stream " b8/copy-to-eax 0/imm32" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/7") - 5746 # var x - 5747 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/8") - 5748 # length instruction - 5749 (check-next-stream-line-equal _test-output-stream " 50/push-eax" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/9") - 5750 (check-next-stream-line-equal _test-output-stream " 52/push-edx" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/10") - 5751 (check-next-stream-line-equal _test-output-stream " 8b/-> *eax 0x00000000/r32" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/11") - 5752 (check-next-stream-line-equal _test-output-stream " 31/xor %edx 2/r32/edx" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/12") - 5753 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 0x0000000c/imm32" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/13") - 5754 (check-next-stream-line-equal _test-output-stream " f7 7/subop/idiv-eax-edx-by %ecx" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/14") - 5755 (check-next-stream-line-equal _test-output-stream " 89/<- %ecx 0/r32/eax" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/15") - 5756 (check-next-stream-line-equal _test-output-stream " 5a/pop-to-edx" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/16") - 5757 (check-next-stream-line-equal _test-output-stream " 58/pop-to-eax" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/17") - 5758 # reclaim x - 5759 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/18") - 5760 # reclaim a - 5761 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/19") - 5762 # - 5763 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/20") - 5764 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/21") - 5765 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/22") - 5766 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/23") - 5767 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/24") - 5768 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/25") - 5769 # . epilogue - 5770 89/<- %esp 5/r32/ebp - 5771 5d/pop-to-ebp - 5772 c3/return - 5773 - 5774 test-convert-length-of-array-of-user-defined-types-to-edx: - 5775 # . prologue - 5776 55/push-ebp - 5777 89/<- %ebp 4/r32/esp - 5778 # setup - 5779 (clear-stream _test-input-stream) - 5780 (clear-stream $_test-input-buffered-file->buffer) - 5781 (clear-stream _test-output-stream) - 5782 (clear-stream $_test-output-buffered-file->buffer) - 5783 # - 5784 (write _test-input-stream "type t {\n") # size = 12, which is not a power of 2 - 5785 (write _test-input-stream " x: int\n") - 5786 (write _test-input-stream " y: int\n") - 5787 (write _test-input-stream " z: int\n") - 5788 (write _test-input-stream "}\n") - 5789 (write _test-input-stream "fn foo {\n") - 5790 (write _test-input-stream " var arr/eax: (addr array t) <- copy 0\n") - 5791 (write _test-input-stream " var x/edx: (addr t) <- length arr\n") - 5792 (write _test-input-stream "}\n") - 5793 # convert - 5794 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 5795 (flush _test-output-buffered-file) - 5796 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 5802 # check output - 5803 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-length-of-array-of-user-defined-types-to-edx/0") - 5804 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-length-of-array-of-user-defined-types-to-edx/1") - 5805 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-length-of-array-of-user-defined-types-to-edx/2") - 5806 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-length-of-array-of-user-defined-types-to-edx/3") - 5807 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-length-of-array-of-user-defined-types-to-edx/4") - 5808 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-length-of-array-of-user-defined-types-to-edx/5") - 5809 # var a - 5810 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-length-of-array-of-user-defined-types-to-edx/6") - 5811 (check-next-stream-line-equal _test-output-stream " b8/copy-to-eax 0/imm32" "F - test-convert-length-of-array-of-user-defined-types-to-edx/7") - 5812 # var x - 5813 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %edx" "F - test-convert-length-of-array-of-user-defined-types-to-edx/8") - 5814 # length instruction - 5815 (check-next-stream-line-equal _test-output-stream " 50/push-eax" "F - test-convert-length-of-array-of-user-defined-types-to-edx/9") - 5816 (check-next-stream-line-equal _test-output-stream " 51/push-ecx" "F - test-convert-length-of-array-of-user-defined-types-to-edx/10") - 5817 (check-next-stream-line-equal _test-output-stream " 8b/-> *eax 0x00000000/r32" "F - test-convert-length-of-array-of-user-defined-types-to-edx/11") - 5818 (check-next-stream-line-equal _test-output-stream " 31/xor %edx 2/r32/edx" "F - test-convert-length-of-array-of-user-defined-types-to-edx/12") - 5819 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 0x0000000c/imm32" "F - test-convert-length-of-array-of-user-defined-types-to-edx/13") - 5820 (check-next-stream-line-equal _test-output-stream " f7 7/subop/idiv-eax-edx-by %ecx" "F - test-convert-length-of-array-of-user-defined-types-to-edx/14") - 5821 (check-next-stream-line-equal _test-output-stream " 89/<- %edx 0/r32/eax" "F - test-convert-length-of-array-of-user-defined-types-to-edx/15") - 5822 (check-next-stream-line-equal _test-output-stream " 59/pop-to-ecx" "F - test-convert-length-of-array-of-user-defined-types-to-edx/16") - 5823 (check-next-stream-line-equal _test-output-stream " 58/pop-to-eax" "F - test-convert-length-of-array-of-user-defined-types-to-edx/17") - 5824 # reclaim x - 5825 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %edx" "F - test-convert-length-of-array-of-user-defined-types-to-edx/18") - 5826 # reclaim a - 5827 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-length-of-array-of-user-defined-types-to-edx/19") - 5828 # - 5829 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-length-of-array-of-user-defined-types-to-edx/20") - 5830 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-length-of-array-of-user-defined-types-to-edx/21") - 5831 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-length-of-array-of-user-defined-types-to-edx/22") - 5832 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-length-of-array-of-user-defined-types-to-edx/23") - 5833 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-length-of-array-of-user-defined-types-to-edx/24") - 5834 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-length-of-array-of-user-defined-types-to-edx/25") - 5835 # . epilogue - 5836 89/<- %esp 5/r32/ebp - 5837 5d/pop-to-ebp - 5838 c3/return - 5839 - 5840 test-convert-length-of-array-of-user-defined-types: - 5841 # . prologue - 5842 55/push-ebp - 5843 89/<- %ebp 4/r32/esp - 5844 # setup - 5845 (clear-stream _test-input-stream) - 5846 (clear-stream $_test-input-buffered-file->buffer) - 5847 (clear-stream _test-output-stream) - 5848 (clear-stream $_test-output-buffered-file->buffer) - 5849 # - 5850 (write _test-input-stream "type t {\n") # each t is 8 bytes, which is a power of 2 - 5851 (write _test-input-stream " x: int\n") - 5852 (write _test-input-stream " y: int\n") - 5853 (write _test-input-stream " z: int\n") - 5854 (write _test-input-stream "}\n") - 5855 (write _test-input-stream "fn foo {\n") - 5856 (write _test-input-stream " var arr/eax: (addr array t) <- copy 0\n") - 5857 (write _test-input-stream " var x/ebx: (addr t) <- length arr\n") - 5858 (write _test-input-stream "}\n") - 5859 # convert - 5860 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) - 5861 (flush _test-output-buffered-file) - 5862 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- - 5868 # check output - 5869 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-length-of-array-of-user-defined-types/0") - 5870 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-length-of-array-of-user-defined-types/1") - 5871 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-length-of-array-of-user-defined-types/2") - 5872 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-length-of-array-of-user-defined-types/3") - 5873 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-length-of-array-of-user-defined-types/4") - 5874 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-length-of-array-of-user-defined-types/5") - 5875 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-length-of-array-of-user-defined-types/6") - 5876 (check-next-stream-line-equal _test-output-stream " b8/copy-to-eax 0/imm32" "F - test-convert-length-of-array-of-user-defined-types/7") - 5877 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ebx" "F - test-convert-length-of-array-of-user-defined-types/8") - 5878 (check-next-stream-line-equal _test-output-stream " 50/push-eax" "F - test-convert-length-of-array-of-user-defined-types/9") - 5879 (check-next-stream-line-equal _test-output-stream " 51/push-ecx" "F - test-convert-length-of-array-of-user-defined-types/10") - 5880 (check-next-stream-line-equal _test-output-stream " 52/push-edx" "F - test-convert-length-of-array-of-user-defined-types/11") - 5881 (check-next-stream-line-equal _test-output-stream " 8b/-> *eax 0x00000000/r32" "F - test-convert-length-of-array-of-user-defined-types/12") - 5882 (check-next-stream-line-equal _test-output-stream " 31/xor %edx 2/r32/edx" "F - test-convert-length-of-array-of-user-defined-types/13") - 5883 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 0x0000000c/imm32" "F - test-convert-length-of-array-of-user-defined-types/14") - 5884 (check-next-stream-line-equal _test-output-stream " f7 7/subop/idiv-eax-edx-by %ecx" "F - test-convert-length-of-array-of-user-defined-types/15") - 5885 (check-next-stream-line-equal _test-output-stream " 89/<- %ebx 0/r32/eax" "F - test-convert-length-of-array-of-user-defined-types/16") - 5886 (check-next-stream-line-equal _test-output-stream " 5a/pop-to-edx" "F - test-convert-length-of-array-of-user-defined-types/17") - 5887 (check-next-stream-line-equal _test-output-stream " 59/pop-to-ecx" "F - test-convert-length-of-array-of-user-defined-types/18") - 5888 (check-next-stream-line-equal _test-output-stream " 58/pop-to-eax" "F - test-convert-length-of-array-of-user-defined-types/19") - 5889 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ebx" "F - test-convert-length-of-array-of-user-defined-types/20") - 5890 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-length-of-array-of-user-defined-types/21") - 5891 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-length-of-array-of-user-defined-types/22") - 5892 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-length-of-array-of-user-defined-types/23") - 5893 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-length-of-array-of-user-defined-types/24") - 5894 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-length-of-array-of-user-defined-types/25") - 5895 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-length-of-array-of-user-defined-types/26") - 5896 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-length-of-array-of-user-defined-types/27") - 5897 # . epilogue - 5898 89/<- %esp 5/r32/ebp - 5899 5d/pop-to-ebp - 5900 c3/return - 5901 - 5902 ####################################################### - 5903 # Parsing - 5904 ####################################################### - 5905 - 5906 == data - 5907 - 5908 # Global state added to each var record when parsing a function - 5909 Next-block-index: # (addr int) - 5910 1/imm32 - 5911 - 5912 Curr-block-depth: # (addr int) - 5913 1/imm32 - 5914 - 5915 == code - 5916 - 5917 parse-mu: # in: (addr buffered-file), err: (addr buffered-file), ed: (addr exit-descriptor) - 5918 # pseudocode - 5919 # var curr-function: (addr handle function) = Program->functions - 5920 # var curr-type: (addr handle typeinfo) = Program->types - 5921 # var line: (stream byte 512) - 5922 # var word-slice: slice - 5923 # while true # line loop - 5924 # clear-stream(line) - 5925 # read-line-buffered(in, line) - 5926 # if (line->write == 0) break # end of file - 5927 # word-slice = next-mu-token(line) - 5928 # if slice-empty?(word-slice) # end of line - 5929 # continue - 5930 # else if slice-starts-with?(word-slice, "#") # comment - 5931 # continue # end of line - 5932 # else if slice-equal?(word-slice, "fn") - 5933 # var new-function: (handle function) = allocate(function) - 5934 # var vars: (stack live-var 256) - 5935 # populate-mu-function-header(line, new-function, vars) - 5936 # populate-mu-function-body(in, new-function, vars) - 5937 # assert(vars->top == 0) - 5938 # *curr-function = new-function - 5939 # curr-function = &new-function->next - 5940 # else if slice-equal?(word-slice, "type") - 5941 # word-slice = next-mu-token(line) - 5942 # type-id = pos-or-insert-slice(Type-id, word-slice) - 5943 # var new-type: (handle typeinfo) = find-or-create-typeinfo(type-id) - 5944 # assert(next-word(line) == "{") - 5945 # populate-mu-type(in, new-type) - 5946 # else - 5947 # abort() - 5948 # - 5949 # . prologue - 5950 55/push-ebp - 5951 89/<- %ebp 4/r32/esp - 5952 # . save registers - 5953 50/push-eax - 5954 51/push-ecx - 5955 52/push-edx - 5956 53/push-ebx - 5957 56/push-esi - 5958 57/push-edi - 5959 # var line/ecx: (stream byte 512) - 5960 81 5/subop/subtract %esp 0x200/imm32 - 5961 68/push 0x200/imm32/size - 5962 68/push 0/imm32/read - 5963 68/push 0/imm32/write - 5964 89/<- %ecx 4/r32/esp - 5965 # var word-slice/edx: slice - 5966 68/push 0/imm32/end - 5967 68/push 0/imm32/start - 5968 89/<- %edx 4/r32/esp - 5969 # var curr-function/edi: (addr handle function) - 5970 bf/copy-to-edi _Program-functions/imm32 - 5971 # var vars/ebx: (stack live-var 256) - 5972 81 5/subop/subtract %esp 0xc00/imm32 - 5973 68/push 0xc00/imm32/size - 5974 68/push 0/imm32/top - 5975 89/<- %ebx 4/r32/esp - 5976 { - 5977 $parse-mu:line-loop: - 5978 (clear-stream %ecx) - 5979 (read-line-buffered *(ebp+8) %ecx) - 5980 # if (line->write == 0) break - 5981 81 7/subop/compare *ecx 0/imm32 - 5982 0f 84/jump-if-= break/disp32 - 5983 +-- 6 lines: #? # dump line ------------------------------------------------------------------------------------------------------------------------------------------------------ - 5989 (next-mu-token %ecx %edx) - 5990 # if slice-empty?(word-slice) continue - 5991 (slice-empty? %edx) # => eax - 5992 3d/compare-eax-and 0/imm32/false - 5993 0f 85/jump-if-!= loop/disp32 - 5994 # if (*word-slice->start == "#") continue - 5995 # . eax = *word-slice->start - 5996 8b/-> *edx 0/r32/eax - 5997 8a/copy-byte *eax 0/r32/AL - 5998 81 4/subop/and %eax 0xff/imm32 - 5999 # . if (eax == '#') continue - 6000 3d/compare-eax-and 0x23/imm32/hash - 6001 0f 84/jump-if-= loop/disp32 - 6002 # if (slice-equal?(word-slice, "fn")) parse a function - 6003 { - 6004 $parse-mu:fn: - 6005 (slice-equal? %edx "fn") # => eax - 6006 3d/compare-eax-and 0/imm32/false - 6007 0f 84/jump-if-= break/disp32 - 6008 # var new-function/esi: (handle function) - 6009 68/push 0/imm32 - 6010 68/push 0/imm32 - 6011 89/<- %esi 4/r32/esp - 6012 # populate-mu-function(line, in, vars, new-function) - 6013 (allocate Heap *Function-size %esi) - 6014 # var new-function-addr/eax: (addr function) - 6015 (lookup *esi *(esi+4)) # => eax - 6016 (clear-stack %ebx) - 6017 (populate-mu-function-header %ecx %eax %ebx *(ebp+0xc) *(ebp+0x10)) - 6018 (populate-mu-function-body *(ebp+8) %eax %ebx *(ebp+0xc) *(ebp+0x10)) - 6019 # *curr-function = new-function - 6020 8b/-> *esi 0/r32/eax - 6021 89/<- *edi 0/r32/eax - 6022 8b/-> *(esi+4) 0/r32/eax - 6023 89/<- *(edi+4) 0/r32/eax - 6024 # curr-function = &new-function->next - 6025 # . var tmp/eax: (addr function) = lookup(new-function) - 6026 (lookup *esi *(esi+4)) # => eax - 6027 # . curr-function = &tmp->next - 6028 8d/copy-address *(eax+0x20) 7/r32/edi # Function-next - 6029 # reclaim new-function - 6030 81 0/subop/add %esp 8/imm32 - 6031 # - 6032 e9/jump $parse-mu:line-loop/disp32 - 6033 } - 6034 # if (slice-equal?(word-slice, "type")) parse a type (struct/record) definition - 6035 { - 6036 $parse-mu:type: - 6037 (slice-equal? %edx "type") # => eax - 6038 3d/compare-eax-and 0/imm32 - 6039 0f 84/jump-if-= break/disp32 - 6040 (next-mu-token %ecx %edx) - 6041 # var type-id/eax: int - 6042 (pos-or-insert-slice Type-id %edx) # => eax - 6043 # spill - 6044 51/push-ecx - 6045 # var new-type/ecx: (handle typeinfo) - 6046 68/push 0/imm32 - 6047 68/push 0/imm32 - 6048 89/<- %ecx 4/r32/esp - 6049 (find-or-create-typeinfo %eax %ecx) - 6050 # - 6051 (lookup *ecx *(ecx+4)) # => eax - 6052 # TODO: ensure that 'line' has nothing else but '{' - 6053 #? (dump-typeinfos "=== aaa\n") - 6054 (populate-mu-type *(ebp+8) %eax *(ebp+0xc) *(ebp+0x10)) # => eax - 6055 #? (dump-typeinfos "=== zzz\n") - 6056 # reclaim new-type - 6057 81 0/subop/add %esp 8/imm32 - 6058 # restore - 6059 59/pop-to-ecx - 6060 e9/jump $parse-mu:line-loop/disp32 - 6061 } - 6062 # otherwise abort - 6063 e9/jump $parse-mu:error1/disp32 - 6064 } # end line loop - 6065 $parse-mu:end: - 6066 # . reclaim locals - 6067 81 0/subop/add %esp 0xe1c/imm32 - 6068 # . restore registers - 6069 5f/pop-to-edi - 6070 5e/pop-to-esi - 6071 5b/pop-to-ebx - 6072 5a/pop-to-edx - 6073 59/pop-to-ecx - 6074 58/pop-to-eax - 6075 # . epilogue - 6076 89/<- %esp 5/r32/ebp - 6077 5d/pop-to-ebp - 6078 c3/return - 6079 - 6080 $parse-mu:error1: - 6081 # error("unexpected top-level command: " word-slice "\n") - 6082 (write-buffered *(ebp+0xc) "unexpected top-level command: ") - 6083 (write-slice-buffered *(ebp+0xc) %edx) - 6084 (write-buffered *(ebp+0xc) "\n") - 6085 (flush *(ebp+0xc)) - 6086 (stop *(ebp+0x10) 1) - 6087 # never gets here - 6088 - 6089 $parse-mu:error2: - 6090 # error(vars->top " vars not reclaimed after fn '" new-function->name "'\n") - 6091 (write-int32-hex-buffered *(ebp+0xc) *ebx) - 6092 (write-buffered *(ebp+0xc) " vars not reclaimed after fn '") - 6093 (write-slice-buffered *(ebp+0xc) *eax) # Function-name - 6094 (write-buffered *(ebp+0xc) "'\n") - 6095 (flush *(ebp+0xc)) - 6096 (stop *(ebp+0x10) 1) - 6097 # never gets here - 6098 - 6099 # scenarios considered: - 6100 # ✗ fn foo # no block - 6101 # ✓ fn foo { - 6102 # ✗ fn foo { { - 6103 # ✗ fn foo { } - 6104 # ✗ fn foo { } { - 6105 # ✗ fn foo x { - 6106 # ✗ fn foo x: { - 6107 # ✓ fn foo x: int { - 6108 # ✓ fn foo x: int { - 6109 # ✓ fn foo x: int -> y/eax: int { - 6110 # TODO: - 6111 # disallow outputs of type `(... addr ...)` - 6112 # disallow inputs of type `(... addr ... addr ...)` - 6113 populate-mu-function-header: # first-line: (addr stream byte), out: (addr function), vars: (addr stack live-var), err: (addr buffered-file), ed: (addr exit-descriptor) - 6114 # pseudocode: - 6115 # var name: slice - 6116 # next-mu-token(first-line, name) - 6117 # assert(name not in '{' '}' '->') - 6118 # out->name = slice-to-string(name) - 6119 # ## inouts - 6120 # while true - 6121 # ## name - 6122 # name = next-mu-token(first-line) - 6123 # if (name == '{') goto done - 6124 # if (name == '->') break - 6125 # assert(name != '}') - 6126 # var v: (handle var) = parse-var-with-type(name, first-line) - 6127 # assert(v->register == null) - 6128 # # v->block-depth is implicitly 0 - 6129 # out->inouts = append(v, out->inouts) - 6130 # push(vars, {v, false}) - 6131 # ## outputs - 6132 # while true - 6133 # ## name - 6134 # name = next-mu-token(first-line) - 6135 # assert(name not in '{' '}' '->') - 6136 # var v: (handle var) = parse-var-with-type(name, first-line) - 6137 # assert(v->register != null) - 6138 # out->outputs = append(v, out->outputs) - 6139 # done: - 6140 # - 6141 # . prologue - 6142 55/push-ebp - 6143 89/<- %ebp 4/r32/esp - 6144 # . save registers - 6145 50/push-eax - 6146 51/push-ecx - 6147 52/push-edx - 6148 53/push-ebx - 6149 57/push-edi - 6150 # edi = out - 6151 8b/-> *(ebp+0xc) 7/r32/edi - 6152 # var word-slice/ecx: slice - 6153 68/push 0/imm32/end - 6154 68/push 0/imm32/start - 6155 89/<- %ecx 4/r32/esp - 6156 # var v/ebx: (handle var) - 6157 68/push 0/imm32 - 6158 68/push 0/imm32 - 6159 89/<- %ebx 4/r32/esp - 6160 # read function name - 6161 (next-mu-token *(ebp+8) %ecx) - 6162 # error checking - 6163 # TODO: error if name starts with 'break' or 'loop' - 6164 # if (word-slice == '{') abort - 6165 (slice-equal? %ecx "{") # => eax - 6166 3d/compare-eax-and 0/imm32/false - 6167 0f 85/jump-if-!= $populate-mu-function-header:error1/disp32 - 6168 # if (word-slice == '->') abort - 6169 (slice-equal? %ecx "->") # => eax - 6170 3d/compare-eax-and 0/imm32/false - 6171 0f 85/jump-if-!= $populate-mu-function-header:error1/disp32 - 6172 # if (word-slice == '}') abort - 6173 (slice-equal? %ecx "}") # => eax - 6174 3d/compare-eax-and 0/imm32/false - 6175 0f 85/jump-if-!= $populate-mu-function-header:error1/disp32 - 6176 # save function name - 6177 (slice-to-string Heap %ecx %edi) # Function-name - 6178 # save function inouts - 6179 { - 6180 $populate-mu-function-header:check-for-inout: - 6181 (next-mu-token *(ebp+8) %ecx) - 6182 # if (word-slice == '{') goto done - 6183 (slice-equal? %ecx "{") # => eax - 6184 3d/compare-eax-and 0/imm32/false - 6185 0f 85/jump-if-!= $populate-mu-function-header:done/disp32 - 6186 # if (word-slice == '->') break - 6187 (slice-equal? %ecx "->") # => eax - 6188 3d/compare-eax-and 0/imm32/false - 6189 0f 85/jump-if-!= break/disp32 - 6190 # if (word-slice == '}') abort - 6191 (slice-equal? %ecx "}") # => eax - 6192 3d/compare-eax-and 0/imm32/false - 6193 0f 85/jump-if-!= $populate-mu-function-header:error1/disp32 - 6194 # v = parse-var-with-type(word-slice, first-line) - 6195 (parse-var-with-type %ecx *(ebp+8) %ebx *(ebp+0x14) *(ebp+0x18)) - 6196 # assert(v->register == null) - 6197 # . eax: (addr var) = lookup(v) - 6198 (lookup *ebx *(ebx+4)) # => eax - 6199 81 7/subop/compare *(eax+0x18) 0/imm32 # Var-register - 6200 0f 85/jump-if-!= $populate-mu-function-header:error2/disp32 - 6201 # v->block-depth is implicitly 0 - 6202 # - 6203 # out->inouts = append(v, out->inouts) - 6204 8d/copy-address *(edi+8) 0/r32/eax # Function-inouts - 6205 (append-list Heap *ebx *(ebx+4) *(edi+8) *(edi+0xc) %eax) # Function-inouts, Function-inouts - 6206 # push(vars, {v, false}) - 6207 (push *(ebp+0x10) *ebx) - 6208 (push *(ebp+0x10) *(ebx+4)) - 6209 (push *(ebp+0x10) 0) # false - 6210 # - 6211 e9/jump loop/disp32 - 6212 } - 6213 # save function outputs - 6214 { - 6215 $populate-mu-function-header:check-for-out: - 6216 (next-mu-token *(ebp+8) %ecx) - 6217 # if (word-slice == '{') break - 6218 (slice-equal? %ecx "{") # => eax - 6219 3d/compare-eax-and 0/imm32/false - 6220 0f 85/jump-if-!= break/disp32 - 6221 # if (word-slice == '->') abort - 6222 (slice-equal? %ecx "->") # => eax - 6223 3d/compare-eax-and 0/imm32/false - 6224 0f 85/jump-if-!= $populate-mu-function-header:error1/disp32 - 6225 # if (word-slice == '}') abort - 6226 (slice-equal? %ecx "}") # => eax - 6227 3d/compare-eax-and 0/imm32/false - 6228 0f 85/jump-if-!= $populate-mu-function-header:error1/disp32 - 6229 # v = parse-var-with-type(word-slice, first-line) - 6230 (parse-var-with-type %ecx *(ebp+8) %ebx *(ebp+0x14) *(ebp+0x18)) - 6231 # assert(var->register != null) - 6232 # . eax: (addr var) = lookup(v) - 6233 (lookup *ebx *(ebx+4)) # => eax - 6234 81 7/subop/compare *(eax+0x18) 0/imm32 # Var-register - 6235 0f 84/jump-if-= $populate-mu-function-header:error3/disp32 - 6236 # out->outputs = append(v, out->outputs) - 6237 8d/copy-address *(edi+0x10) 0/r32/eax # Function-outputs - 6238 (append-list Heap *ebx *(ebx+4) *(edi+0x10) *(edi+0x14) %eax) # Function-outputs, Function-outputs - 6239 # - 6240 e9/jump loop/disp32 - 6241 } - 6242 $populate-mu-function-header:done: - 6243 (check-no-tokens-left *(ebp+8)) - 6244 $populate-mu-function-header:end: - 6245 # . reclaim locals - 6246 81 0/subop/add %esp 0x10/imm32 - 6247 # . restore registers - 6248 5f/pop-to-edi - 6249 5b/pop-to-ebx - 6250 5a/pop-to-edx - 6251 59/pop-to-ecx - 6252 58/pop-to-eax - 6253 # . epilogue - 6254 89/<- %esp 5/r32/ebp - 6255 5d/pop-to-ebp - 6256 c3/return - 6257 - 6258 $populate-mu-function-header:error1: - 6259 # error("function header not in form 'fn <name> {'") - 6260 (write-buffered *(ebp+0x14) "function header not in form 'fn <name> [inouts] [-> outputs] {' -- '") - 6261 (flush *(ebp+0x14)) - 6262 (rewind-stream *(ebp+8)) - 6263 (write-stream-data *(ebp+0x14) *(ebp+8)) - 6264 (write-buffered *(ebp+0x14) "'\n") - 6265 (flush *(ebp+0x14)) - 6266 (stop *(ebp+0x18) 1) - 6267 # never gets here - 6268 - 6269 $populate-mu-function-header:error2: - 6270 # error("function inout '" var "' cannot be in a register") - 6271 (write-buffered *(ebp+0x14) "function inout '") - 6272 (write-buffered *(ebp+0x14) *ebx) # Var-name - 6273 (write-buffered *(ebp+0x14) "' cannot be in a register") - 6274 (flush *(ebp+0x14)) - 6275 (stop *(ebp+0x18) 1) - 6276 # never gets here - 6277 - 6278 $populate-mu-function-header:error3: - 6279 # error("function output '" var "' must be in a register") - 6280 (write-buffered *(ebp+0x14) "function output '") - 6281 (lookup *ebx *(ebx+4)) # => eax - 6282 (lookup *eax *(eax+4)) # Var-name Var-name => eax - 6283 (write-buffered *(ebp+0x14) %eax) - 6284 (write-buffered *(ebp+0x14) "' must be in a register, in instruction '") - 6285 (rewind-stream *(ebp+8)) - 6286 (write-stream-data *(ebp+0x14) *(ebp+8)) - 6287 (write-buffered *(ebp+0x14) "'\n") - 6288 (flush *(ebp+0x14)) - 6289 (stop *(ebp+0x18) 1) - 6290 # never gets here - 6291 - 6292 test-function-header-with-arg: - 6293 # . prologue - 6294 55/push-ebp - 6295 89/<- %ebp 4/r32/esp - 6296 # setup - 6297 (clear-stream _test-input-stream) - 6298 (write _test-input-stream "foo n: int {\n") - 6299 # var result/ecx: function - 6300 2b/subtract *Function-size 4/r32/esp - 6301 89/<- %ecx 4/r32/esp - 6302 (zero-out %ecx *Function-size) - 6303 # var vars/ebx: (stack live-var 16) - 6304 81 5/subop/subtract %esp 0xc0/imm32 - 6305 68/push 0xc0/imm32/size - 6306 68/push 0/imm32/top - 6307 89/<- %ebx 4/r32/esp - 6308 # convert - 6309 (populate-mu-function-header _test-input-stream %ecx %ebx Stderr 0) - 6310 # check result->name - 6311 (lookup *ecx *(ecx+4)) # Function-name Function-name => eax - 6312 (check-strings-equal %eax "foo" "F - test-function-header-with-arg/name") - 6313 # var v/edx: (addr var) = result->inouts->value - 6314 (lookup *(ecx+8) *(ecx+0xc)) # Function-inouts Function-inouts => eax - 6315 (lookup *eax *(eax+4)) # List-value List-value => eax - 6316 89/<- %edx 0/r32/eax - 6317 # check v->name - 6318 (lookup *edx *(edx+4)) # Var-name Var-name => eax - 6319 (check-strings-equal %eax "n" "F - test-function-header-with-arg/inout:0") - 6320 # check v->type - 6321 (lookup *(edx+8) *(edx+0xc)) # Var-type Var-type => eax - 6322 (check-ints-equal *eax 1 "F - test-function-header-with-arg/inout:0/type:0") # Tree-is-atom - 6323 (check-ints-equal *(eax+4) 1 "F - test-function-header-with-arg/inout:0/type:1") # Tree-value - 6324 (check-ints-equal *(eax+0xc) 0 "F - test-function-header-with-arg/inout:0/type:2") # Tree-right - 6325 # . epilogue - 6326 89/<- %esp 5/r32/ebp - 6327 5d/pop-to-ebp - 6328 c3/return - 6329 - 6330 test-function-header-with-multiple-args: - 6331 # . prologue - 6332 55/push-ebp - 6333 89/<- %ebp 4/r32/esp - 6334 # setup - 6335 (clear-stream _test-input-stream) - 6336 (write _test-input-stream "foo a: int, b: int c: int {\n") - 6337 # result/ecx: function - 6338 2b/subtract *Function-size 4/r32/esp - 6339 89/<- %ecx 4/r32/esp - 6340 (zero-out %ecx *Function-size) - 6341 # var vars/ebx: (stack live-var 16) - 6342 81 5/subop/subtract %esp 0xc0/imm32 - 6343 68/push 0xc0/imm32/size - 6344 68/push 0/imm32/top - 6345 89/<- %ebx 4/r32/esp - 6346 # convert - 6347 (populate-mu-function-header _test-input-stream %ecx %ebx Stderr 0) - 6348 # check result->name - 6349 (lookup *ecx *(ecx+4)) # Function-name Function-name => eax - 6350 (check-strings-equal %eax "foo" "F - test-function-header-with-multiple-args/name") - 6351 # var inouts/edx: (addr list var) = lookup(result->inouts) - 6352 (lookup *(ecx+8) *(ecx+0xc)) # Function-inouts Function-inouts => eax - 6353 89/<- %edx 0/r32/eax - 6354 $test-function-header-with-multiple-args:inout0: - 6355 # var v/ebx: (addr var) = lookup(inouts->value) - 6356 (lookup *edx *(edx+4)) # List-value List-value => eax - 6357 89/<- %ebx 0/r32/eax - 6358 # check v->name - 6359 (lookup *ebx *(ebx+4)) # Var-name Var-name => eax - 6360 (check-strings-equal %eax "a" "F - test-function-header-with-multiple-args/inout:0") # Var-name - 6361 # check v->type - 6362 (lookup *(ebx+8) *(ebx+0xc)) # Var-type Var-type => eax - 6363 (check-ints-equal *eax 1 "F - test-function-header-with-multiple-args/inout:0/type:0") # Tree-is-atom - 6364 (check-ints-equal *(eax+4) 1 "F - test-function-header-with-multiple-args/inout:0/type:1") # Tree-value - 6365 (check-ints-equal *(eax+0xc) 0 "F - test-function-header-with-multiple-args/inout:0/type:2") # Tree-right - 6366 $test-function-header-with-multiple-args:inout1: - 6367 # inouts = lookup(inouts->next) - 6368 (lookup *(edx+8) *(edx+0xc)) # List-next List-next => eax - 6369 89/<- %edx 0/r32/eax - 6370 # v = lookup(inouts->value) - 6371 (lookup *edx *(edx+4)) # List-value List-value => eax - 6372 89/<- %ebx 0/r32/eax - 6373 # check v->name - 6374 (lookup *ebx *(ebx+4)) # Var-name Var-name => eax - 6375 (check-strings-equal %eax "b" "F - test-function-header-with-multiple-args/inout:1") # Var-name - 6376 # check v->type - 6377 (lookup *(ebx+8) *(ebx+0xc)) # Var-type Var-type => eax - 6378 (check-ints-equal *eax 1 "F - test-function-header-with-multiple-args/inout:1/type:0") # Tree-is-atom - 6379 (check-ints-equal *(eax+4) 1 "F - test-function-header-with-multiple-args/inout:1/type:1") # Tree-value - 6380 (check-ints-equal *(eax+0xc) 0 "F - test-function-header-with-multiple-args/inout:1/type:2") # Tree-right - 6381 $test-function-header-with-multiple-args:inout2: - 6382 # inouts = lookup(inouts->next) - 6383 (lookup *(edx+8) *(edx+0xc)) # List-next List-next => eax - 6384 89/<- %edx 0/r32/eax - 6385 # v = lookup(inouts->value) - 6386 (lookup *edx *(edx+4)) # List-value List-value => eax - 6387 89/<- %ebx 0/r32/eax - 6388 # check v->name - 6389 (lookup *ebx *(ebx+4)) # Var-name Var-name => eax - 6390 (check-strings-equal %eax "c" "F - test-function-header-with-multiple-args/inout:2") # Var-name - 6391 # check v->type - 6392 (lookup *(ebx+8) *(ebx+0xc)) # Var-type Var-type => eax - 6393 (check-ints-equal *eax 1 "F - test-function-header-with-multiple-args/inout:2/type:0") # Tree-is-atom - 6394 (check-ints-equal *(eax+4) 1 "F - test-function-header-with-multiple-args/inout:2/type:1") # Tree-value - 6395 (check-ints-equal *(eax+0xc) 0 "F - test-function-header-with-multiple-args/inout:2/type:2") # Tree-right - 6396 # . epilogue - 6397 89/<- %esp 5/r32/ebp - 6398 5d/pop-to-ebp - 6399 c3/return - 6400 - 6401 test-function-header-with-multiple-args-and-outputs: - 6402 # . prologue - 6403 55/push-ebp - 6404 89/<- %ebp 4/r32/esp - 6405 # setup - 6406 (clear-stream _test-input-stream) - 6407 (write _test-input-stream "foo a: int, b: int, c: int -> x/ecx: int y/edx: int {\n") - 6408 # result/ecx: function - 6409 2b/subtract *Function-size 4/r32/esp - 6410 89/<- %ecx 4/r32/esp - 6411 (zero-out %ecx *Function-size) - 6412 # var vars/ebx: (stack live-var 16) - 6413 81 5/subop/subtract %esp 0xc0/imm32 - 6414 68/push 0xc0/imm32/size - 6415 68/push 0/imm32/top - 6416 89/<- %ebx 4/r32/esp - 6417 # convert - 6418 (populate-mu-function-header _test-input-stream %ecx %ebx Stderr 0) - 6419 # check result->name - 6420 (lookup *ecx *(ecx+4)) # Function-name Function-name => eax - 6421 (check-strings-equal %eax "foo" "F - test-function-header-with-multiple-args-and-outputs/name") - 6422 # var inouts/edx: (addr list var) = lookup(result->inouts) - 6423 (lookup *(ecx+8) *(ecx+0xc)) # Function-inouts Function-inouts => eax - 6424 89/<- %edx 0/r32/eax - 6425 $test-function-header-with-multiple-args-and-outputs:inout0: - 6426 # var v/ebx: (addr var) = lookup(inouts->value) - 6427 (lookup *edx *(edx+4)) # List-value List-value => eax - 6428 89/<- %ebx 0/r32/eax - 6429 # check v->name - 6430 (lookup *ebx *(ebx+4)) # Var-name Var-name => eax - 6431 (check-strings-equal %eax "a" "F - test-function-header-with-multiple-args-and-outputs/inout:0") - 6432 # check v->type - 6433 (lookup *(ebx+8) *(ebx+0xc)) # Var-type Var-type => eax - 6434 (check-ints-equal *eax 1 "F - test-function-header-with-multiple-args-and-outputs/inout:0/type:0") # Tree-is-atom - 6435 (check-ints-equal *(eax+4) 1 "F - test-function-header-with-multiple-args-and-outputs/inout:0/type:1") # Tree-value - 6436 (check-ints-equal *(eax+0xc) 0 "F - test-function-header-with-multiple-args-and-outputs/inout:0/type:2") # Tree-right - 6437 $test-function-header-with-multiple-args-and-outputs:inout1: - 6438 # inouts = lookup(inouts->next) - 6439 (lookup *(edx+8) *(edx+0xc)) # List-next List-next => eax - 6440 89/<- %edx 0/r32/eax - 6441 # v = lookup(inouts->value) - 6442 (lookup *edx *(edx+4)) # List-value List-value => eax - 6443 89/<- %ebx 0/r32/eax - 6444 # check v->name - 6445 (lookup *ebx *(ebx+4)) # Var-name Var-name => eax - 6446 (check-strings-equal %eax "b" "F - test-function-header-with-multiple-args-and-outputs/inout:1") - 6447 # check v->type - 6448 (lookup *(ebx+8) *(ebx+0xc)) # Var-type Var-type => eax - 6449 (check-ints-equal *eax 1 "F - test-function-header-with-multiple-args-and-outputs/inout:1/type:0") # Tree-is-atom - 6450 (check-ints-equal *(eax+4) 1 "F - test-function-header-with-multiple-args-and-outputs/inout:1/type:1") # Tree-value - 6451 (check-ints-equal *(eax+0xc) 0 "F - test-function-header-with-multiple-args-and-outputs/inout:1/type:2") # Tree-right - 6452 $test-function-header-with-multiple-args-and-outputs:inout2: - 6453 # inouts = lookup(inouts->next) - 6454 (lookup *(edx+8) *(edx+0xc)) # List-next List-next => eax - 6455 89/<- %edx 0/r32/eax - 6456 # v = lookup(inouts->value) - 6457 (lookup *edx *(edx+4)) # List-value List-value => eax - 6458 89/<- %ebx 0/r32/eax - 6459 # check v->name - 6460 (lookup *ebx *(ebx+4)) # Var-name Var-name => eax - 6461 (check-strings-equal %eax "c" "F - test-function-header-with-multiple-args-and-outputs/inout:2") - 6462 # check v->type - 6463 (lookup *(ebx+8) *(ebx+0xc)) # Var-type Var-type => eax - 6464 (check-ints-equal *eax 1 "F - test-function-header-with-multiple-args-and-outputs/inout:2/type:0") # Tree-is-atom - 6465 (check-ints-equal *(eax+4) 1 "F - test-function-header-with-multiple-args-and-outputs/inout:2/type:1") # Tree-value - 6466 (check-ints-equal *(eax+0xc) 0 "F - test-function-header-with-multiple-args-and-outputs/inout:2/type:2") # Tree-right - 6467 $test-function-header-with-multiple-args-and-outputs:out0: - 6468 # var outputs/edx: (addr list var) = lookup(result->outputs) - 6469 (lookup *(ecx+0x10) *(ecx+0x14)) # Function-outputs Function-outputs => eax - 6470 89/<- %edx 0/r32/eax - 6471 # v = lookup(outputs->value) - 6472 (lookup *edx *(edx+4)) # List-value List-value => eax - 6473 89/<- %ebx 0/r32/eax - 6474 # check v->name - 6475 (lookup *ebx *(ebx+4)) # Var-name Var-name => eax - 6476 (check-strings-equal %eax "x" "F - test-function-header-with-multiple-args-and-outputs/output:0") - 6477 # check v->register - 6478 (lookup *(ebx+0x18) *(ebx+0x1c)) # Var-register Var-register => eax - 6479 (check-strings-equal %eax "ecx" "F - test-function-header-with-multiple-args-and-outputs/output:0/register") - 6480 # check v->type - 6481 (lookup *(ebx+8) *(ebx+0xc)) # Var-type Var-type => eax - 6482 (check-ints-equal *eax 1 "F - test-function-header-with-multiple-args-and-outputs/output:0/type:0") # Tree-is-atom - 6483 (check-ints-equal *(eax+4) 1 "F - test-function-header-with-multiple-args-and-outputs/output:0/type:1") # Tree-value - 6484 (check-ints-equal *(eax+0xc) 0 "F - test-function-header-with-multiple-args-and-outputs/output:0/type:2") # Tree-right - 6485 $test-function-header-with-multiple-args-and-outputs:out1: - 6486 # outputs = lookup(outputs->next) - 6487 (lookup *(edx+8) *(edx+0xc)) # List-next List-next => eax - 6488 89/<- %edx 0/r32/eax - 6489 # v = lookup(inouts->value) - 6490 (lookup *edx *(edx+4)) # List-value List-value => eax - 6491 89/<- %ebx 0/r32/eax - 6492 # check v->name - 6493 (lookup *ebx *(ebx+4)) # Var-name Var-name => eax - 6494 (check-strings-equal %eax "y" "F - test-function-header-with-multiple-args-and-outputs/output:1") - 6495 # check v->register - 6496 (lookup *(ebx+0x18) *(ebx+0x1c)) # Var-register Var-register => eax - 6497 (check-strings-equal %eax "edx" "F - test-function-header-with-multiple-args-and-outputs/output:1/register") - 6498 # check v->type - 6499 (lookup *(ebx+8) *(ebx+0xc)) # Var-type Var-type => eax - 6500 (check-ints-equal *eax 1 "F - test-function-header-with-multiple-args-and-outputs/output:1/type:0") # Tree-is-atom - 6501 (check-ints-equal *(eax+4) 1 "F - test-function-header-with-multiple-args-and-outputs/output:1/type:1") # Tree-value - 6502 (check-ints-equal *(eax+0c) 0 "F - test-function-header-with-multiple-args-and-outputs/output:1/type:2") # Tree-right - 6503 # . epilogue - 6504 89/<- %esp 5/r32/ebp - 6505 5d/pop-to-ebp - 6506 c3/return - 6507 - 6508 # format for variables with types - 6509 # x: int - 6510 # x: int, - 6511 # x/eax: int - 6512 # x/eax: int, - 6513 # ignores at most one trailing comma - 6514 # WARNING: modifies name - 6515 parse-var-with-type: # name: (addr slice), first-line: (addr stream byte), out: (addr handle var), err: (addr buffered-file), ed: (addr exit-descriptor) - 6516 # pseudocode: - 6517 # var s: slice - 6518 # if (!slice-ends-with(name, ":")) - 6519 # abort - 6520 # --name->end to skip ':' - 6521 # next-token-from-slice(name->start, name->end, '/', s) - 6522 # new-var-from-slice(s, out) - 6523 # ## register - 6524 # next-token-from-slice(s->end, name->end, '/', s) - 6525 # if (!slice-empty?(s)) - 6526 # out->register = slice-to-string(s) - 6527 # ## type - 6528 # var type: (handle tree type-id) = parse-type(first-line) - 6529 # out->type = type - 6530 # - 6531 # . prologue - 6532 55/push-ebp - 6533 89/<- %ebp 4/r32/esp - 6534 # . save registers - 6535 50/push-eax - 6536 51/push-ecx - 6537 52/push-edx - 6538 53/push-ebx - 6539 56/push-esi - 6540 57/push-edi - 6541 # esi = name - 6542 8b/-> *(ebp+8) 6/r32/esi - 6543 # if (!slice-ends-with?(name, ":")) abort - 6544 8b/-> *(esi+4) 1/r32/ecx # Slice-end - 6545 49/decrement-ecx - 6546 8a/copy-byte *ecx 1/r32/CL - 6547 81 4/subop/and %ecx 0xff/imm32 - 6548 81 7/subop/compare %ecx 0x3a/imm32/colon - 6549 0f 85/jump-if-!= $parse-var-with-type:abort/disp32 - 6550 # --name->end to skip ':' - 6551 ff 1/subop/decrement *(esi+4) - 6552 # var s/ecx: slice - 6553 68/push 0/imm32/end - 6554 68/push 0/imm32/start - 6555 89/<- %ecx 4/r32/esp - 6556 $parse-var-with-type:parse-name: - 6557 (next-token-from-slice *esi *(esi+4) 0x2f %ecx) # Slice-start, Slice-end, '/' - 6558 $parse-var-with-type:create-var: - 6559 # new-var-from-slice(s, out) - 6560 (new-var-from-slice Heap %ecx *(ebp+0x10)) - 6561 # save out->register - 6562 $parse-var-with-type:save-register: - 6563 # . var out-addr/edi: (addr var) = lookup(*out) - 6564 8b/-> *(ebp+0x10) 7/r32/edi - 6565 (lookup *edi *(edi+4)) # => eax - 6566 89/<- %edi 0/r32/eax - 6567 # . s = next-token(...) - 6568 (next-token-from-slice *(ecx+4) *(esi+4) 0x2f %ecx) # s->end, name->end, '/' - 6569 # . if (!slice-empty?(s)) out->register = slice-to-string(s) - 6570 { - 6571 $parse-var-with-type:write-register: - 6572 (slice-empty? %ecx) # => eax - 6573 3d/compare-eax-and 0/imm32/false - 6574 75/jump-if-!= break/disp8 - 6575 # out->register = slice-to-string(s) - 6576 8d/copy-address *(edi+0x18) 0/r32/eax # Var-register - 6577 (slice-to-string Heap %ecx %eax) - 6578 } - 6579 $parse-var-with-type:save-type: - 6580 8d/copy-address *(edi+8) 0/r32/eax # Var-type - 6581 (parse-type Heap *(ebp+0xc) %eax *(ebp+0x14) *(ebp+0x18)) - 6582 $parse-var-with-type:end: - 6583 # . reclaim locals - 6584 81 0/subop/add %esp 8/imm32 - 6585 # . restore registers - 6586 5f/pop-to-edi - 6587 5e/pop-to-esi - 6588 5b/pop-to-ebx - 6589 5a/pop-to-edx - 6590 59/pop-to-ecx - 6591 58/pop-to-eax - 6592 # . epilogue - 6593 89/<- %esp 5/r32/ebp - 6594 5d/pop-to-ebp - 6595 c3/return - 6596 - 6597 $parse-var-with-type:abort: - 6598 # error("var should have form 'name: type' in '" line "'\n") - 6599 (write-buffered *(ebp+0x14) "var should have form 'name: type' in '") - 6600 (flush *(ebp+0x14)) - 6601 (rewind-stream *(ebp+0xc)) - 6602 (write-stream-data *(ebp+0x14) *(ebp+0xc)) - 6603 (write-buffered *(ebp+0x14) "'\n") - 6604 (flush *(ebp+0x14)) - 6605 (stop *(ebp+0x18) 1) - 6606 # never gets here - 6607 - 6608 parse-type: # ad: (addr allocation-descriptor), in: (addr stream byte), out: (addr handle tree type-id), err: (addr buffered-file), ed: (addr exit-descriptor) - 6609 # pseudocode: - 6610 # var s: slice = next-mu-token(in) - 6611 # assert s != "" - 6612 # assert s != "->" - 6613 # assert s != "{" - 6614 # assert s != "}" - 6615 # if s == ")" - 6616 # return - 6617 # out = allocate(Tree) - 6618 # if s != "(" - 6619 # HACK: if s is an int, parse and return it - 6620 # out->left-is-atom? = true - 6621 # out->value = pos-or-insert-slice(Type-id, s) - 6622 # return - 6623 # out->left = parse-type(ad, in) - 6624 # out->right = parse-type-tree(ad, in) - 6625 # - 6626 # . prologue - 6627 55/push-ebp - 6628 89/<- %ebp 4/r32/esp - 6629 # . save registers - 6630 50/push-eax - 6631 51/push-ecx - 6632 52/push-edx - 6633 # clear out - 6634 (zero-out *(ebp+0x10) *Handle-size) - 6635 # var s/ecx: slice - 6636 68/push 0/imm32 - 6637 68/push 0/imm32 - 6638 89/<- %ecx 4/r32/esp - 6639 # s = next-mu-token(in) - 6640 (next-mu-token *(ebp+0xc) %ecx) - 6641 #? (write-buffered Stderr "tok: ") - 6642 #? (write-slice-buffered Stderr %ecx) - 6643 #? (write-buffered Stderr "$\n") - 6644 #? (flush Stderr) - 6645 # assert s != "" - 6646 (slice-equal? %ecx "") # => eax - 6647 3d/compare-eax-and 0/imm32/false - 6648 0f 85/jump-if-!= $parse-type:abort/disp32 - 6649 # assert s != "{" - 6650 (slice-equal? %ecx "{") # => eax - 6651 3d/compare-eax-and 0/imm32/false - 6652 0f 85/jump-if-!= $parse-type:abort/disp32 - 6653 # assert s != "}" - 6654 (slice-equal? %ecx "}") # => eax - 6655 3d/compare-eax-and 0/imm32/false - 6656 0f 85/jump-if-!= $parse-type:abort/disp32 - 6657 # assert s != "->" - 6658 (slice-equal? %ecx "->") # => eax - 6659 3d/compare-eax-and 0/imm32/false - 6660 0f 85/jump-if-!= $parse-type:abort/disp32 - 6661 # if (s == ")") return - 6662 (slice-equal? %ecx ")") # => eax - 6663 3d/compare-eax-and 0/imm32/false - 6664 0f 85/jump-if-!= $parse-type:end/disp32 - 6665 # out = new tree - 6666 (allocate *(ebp+8) *Tree-size *(ebp+0x10)) - 6667 # var out-addr/edx: (addr tree type-id) = lookup(*out) - 6668 8b/-> *(ebp+0x10) 2/r32/edx - 6669 (lookup *edx *(edx+4)) # => eax - 6670 89/<- %edx 0/r32/eax - 6671 { - 6672 # if (s != "(") break - 6673 (slice-equal? %ecx "(") # => eax - 6674 3d/compare-eax-and 0/imm32/false - 6675 75/jump-if-!= break/disp8 - 6676 # EGREGIOUS HACK for static array sizes: if s is a number, parse it - 6677 { - 6678 $parse-type:check-for-int: - 6679 (is-hex-int? %ecx) # => eax - 6680 3d/compare-eax-and 0/imm32/false - 6681 74/jump-if-= break/disp8 - 6682 $parse-type:int: - 6683 (parse-hex-int-from-slice %ecx) # => eax - 6684 89/<- *(edx+4) 0/r32/eax # Tree-value - 6685 e9/jump $parse-type:end/disp32 - 6686 } - 6687 $parse-type:atom: - 6688 # out->left-is-atom? = true - 6689 c7 0/subop/copy *edx 1/imm32/true # Tree-is-atom - 6690 # out->value = pos-or-insert-slice(Type-id, s) - 6691 (pos-or-insert-slice Type-id %ecx) # => eax - 6692 89/<- *(edx+4) 0/r32/eax # Tree-value - 6693 e9/jump $parse-type:end/disp32 - 6694 } - 6695 $parse-type:non-atom: - 6696 # otherwise s == "(" - 6697 # out->left = parse-type(ad, in) - 6698 8d/copy-address *(edx+4) 0/r32/eax # Tree-left - 6699 (parse-type *(ebp+8) *(ebp+0xc) %eax *(ebp+0x14) *(ebp+0x18)) - 6700 # out->right = parse-type-tree(ad, in) - 6701 8d/copy-address *(edx+0xc) 0/r32/eax # Tree-right - 6702 (parse-type-tree *(ebp+8) *(ebp+0xc) %eax *(ebp+0x14) *(ebp+0x18)) - 6703 $parse-type:end: - 6704 # . reclaim locals - 6705 81 0/subop/add %esp 8/imm32 - 6706 # . restore registers - 6707 5a/pop-to-edx - 6708 59/pop-to-ecx - 6709 58/pop-to-eax - 6710 # . epilogue - 6711 89/<- %esp 5/r32/ebp - 6712 5d/pop-to-ebp - 6713 c3/return - 6714 - 6715 $parse-type:abort: - 6716 # error("unexpected token when parsing type: '" s "'\n") - 6717 (write-buffered *(ebp+0x14) "unexpected token when parsing type: '") - 6718 (write-slice-buffered *(ebp+0x14) %ecx) - 6719 (write-buffered *(ebp+0x14) "'\n") - 6720 (flush *(ebp+0x14)) - 6721 (stop *(ebp+0x18) 1) - 6722 # never gets here - 6723 - 6724 parse-type-tree: # ad: (addr allocation-descriptor), in: (addr stream byte), out: (addr handle tree type-id), err: (addr buffered-file), ed: (addr exit-descriptor) - 6725 # pseudocode: - 6726 # var tmp: (handle tree type-id) = parse-type(ad, in) - 6727 # if tmp == 0 - 6728 # return 0 - 6729 # out = allocate(Tree) - 6730 # out->left = tmp - 6731 # out->right = parse-type-tree(ad, in) - 6732 # - 6733 # . prologue - 6734 55/push-ebp - 6735 89/<- %ebp 4/r32/esp - 6736 # . save registers - 6737 50/push-eax - 6738 51/push-ecx - 6739 52/push-edx - 6740 # - 6741 (zero-out *(ebp+0x10) *Handle-size) - 6742 # var tmp/ecx: (handle tree type-id) - 6743 68/push 0/imm32 - 6744 68/push 0/imm32 - 6745 89/<- %ecx 4/r32/esp - 6746 # tmp = parse-type(ad, in) - 6747 (parse-type *(ebp+8) *(ebp+0xc) %ecx *(ebp+0x14) *(ebp+0x18)) - 6748 # if (tmp == 0) return - 6749 81 7/subop/compare *ecx 0/imm32 - 6750 74/jump-if-= $parse-type-tree:end/disp8 - 6751 # out = new tree - 6752 (allocate *(ebp+8) *Tree-size *(ebp+0x10)) - 6753 # var out-addr/edx: (addr tree) = lookup(*out) - 6754 8b/-> *(ebp+0x10) 2/r32/edx - 6755 (lookup *edx *(edx+4)) # => eax - 6756 89/<- %edx 0/r32/eax - 6757 # out->left = tmp - 6758 8b/-> *ecx 0/r32/eax - 6759 89/<- *(edx+4) 0/r32/eax # Tree-left - 6760 8b/-> *(ecx+4) 0/r32/eax - 6761 89/<- *(edx+8) 0/r32/eax # Tree-left - 6762 # out->right = parse-type-tree(ad, in) - 6763 8d/copy-address *(edx+0xc) 0/r32/eax # Tree-right - 6764 (parse-type-tree *(ebp+8) *(ebp+0xc) %eax *(ebp+0x14) *(ebp+0x18)) - 6765 $parse-type-tree:end: - 6766 # . reclaim locals - 6767 81 0/subop/add %esp 8/imm32 - 6768 # . restore registers - 6769 5a/pop-to-edx - 6770 59/pop-to-ecx - 6771 58/pop-to-eax - 6772 # . epilogue - 6773 89/<- %esp 5/r32/ebp - 6774 5d/pop-to-ebp - 6775 c3/return - 6776 - 6777 next-mu-token: # in: (addr stream byte), out: (addr slice) - 6778 # pseudocode: - 6779 # start: - 6780 # skip-chars-matching-whitespace(in) - 6781 # if in->read >= in->write # end of in - 6782 # out = {0, 0} - 6783 # return - 6784 # out->start = &in->data[in->read] - 6785 # var curr-byte/eax: byte = in->data[in->read] - 6786 # if curr->byte == ',' # comment token - 6787 # ++in->read - 6788 # goto start - 6789 # if curr-byte == '#' # comment - 6790 # goto done # treat as eof - 6791 # if curr-byte == '"' # string literal - 6792 # skip-string(in) - 6793 # goto done # no metadata - 6794 # if curr-byte == '(' - 6795 # ++in->read - 6796 # goto done - 6797 # if curr-byte == ')' - 6798 # ++in->read - 6799 # goto done - 6800 # # read a word - 6801 # while true - 6802 # if in->read >= in->write - 6803 # break - 6804 # curr-byte = in->data[in->read] - 6805 # if curr-byte == ' ' - 6806 # break - 6807 # if curr-byte == '\r' - 6808 # break - 6809 # if curr-byte == '\n' - 6810 # break - 6811 # if curr-byte == '(' - 6812 # break - 6813 # if curr-byte == ')' - 6814 # break - 6815 # if curr-byte == ',' - 6816 # break - 6817 # ++in->read - 6818 # done: - 6819 # out->end = &in->data[in->read] - 6820 # - 6821 # . prologue - 6822 55/push-ebp - 6823 89/<- %ebp 4/r32/esp - 6824 # . save registers - 6825 50/push-eax - 6826 51/push-ecx - 6827 56/push-esi - 6828 57/push-edi - 6829 # esi = in - 6830 8b/-> *(ebp+8) 6/r32/esi - 6831 # edi = out - 6832 8b/-> *(ebp+0xc) 7/r32/edi - 6833 $next-mu-token:start: - 6834 (skip-chars-matching-whitespace %esi) - 6835 $next-mu-token:check0: - 6836 # if (in->read >= in->write) return out = {0, 0} - 6837 # . ecx = in->read - 6838 8b/-> *(esi+4) 1/r32/ecx - 6839 # . if (ecx >= in->write) return out = {0, 0} - 6840 3b/compare<- *esi 1/r32/ecx - 6841 c7 0/subop/copy *edi 0/imm32 - 6842 c7 0/subop/copy *(edi+4) 0/imm32 - 6843 0f 8d/jump-if->= $next-mu-token:end/disp32 - 6844 # out->start = &in->data[in->read] - 6845 8d/copy-address *(esi+ecx+0xc) 0/r32/eax - 6846 89/<- *edi 0/r32/eax - 6847 # var curr-byte/eax: byte = in->data[in->read] - 6848 31/xor-with %eax 0/r32/eax - 6849 8a/copy-byte *(esi+ecx+0xc) 0/r32/AL - 6850 { - 6851 $next-mu-token:check-for-comma: - 6852 # if (curr-byte != ',') break - 6853 3d/compare-eax-and 0x2c/imm32/comma - 6854 75/jump-if-!= break/disp8 - 6855 # ++in->read - 6856 ff 0/subop/increment *(esi+4) - 6857 # restart - 6858 e9/jump $next-mu-token:start/disp32 - 6859 } - 6860 { - 6861 $next-mu-token:check-for-comment: - 6862 # if (curr-byte != '#') break - 6863 3d/compare-eax-and 0x23/imm32/pound - 6864 75/jump-if-!= break/disp8 - 6865 # return eof - 6866 e9/jump $next-mu-token:done/disp32 - 6867 } - 6868 { - 6869 $next-mu-token:check-for-string-literal: - 6870 # if (curr-byte != '"') break - 6871 3d/compare-eax-and 0x22/imm32/dquote - 6872 75/jump-if-!= break/disp8 - 6873 (skip-string %esi) - 6874 # return - 6875 e9/jump $next-mu-token:done/disp32 - 6876 } - 6877 { - 6878 $next-mu-token:check-for-open-paren: - 6879 # if (curr-byte != '(') break - 6880 3d/compare-eax-and 0x28/imm32/open-paren - 6881 75/jump-if-!= break/disp8 - 6882 # ++in->read - 6883 ff 0/subop/increment *(esi+4) - 6884 # return - 6885 e9/jump $next-mu-token:done/disp32 - 6886 } - 6887 { - 6888 $next-mu-token:check-for-close-paren: - 6889 # if (curr-byte != ')') break - 6890 3d/compare-eax-and 0x29/imm32/close-paren - 6891 75/jump-if-!= break/disp8 - 6892 # ++in->read - 6893 ff 0/subop/increment *(esi+4) - 6894 # return - 6895 e9/jump $next-mu-token:done/disp32 - 6896 } - 6897 { - 6898 $next-mu-token:regular-word-without-metadata: - 6899 # if (in->read >= in->write) break - 6900 # . ecx = in->read - 6901 8b/-> *(esi+4) 1/r32/ecx - 6902 # . if (ecx >= in->write) break - 6903 3b/compare<- *esi 1/r32/ecx - 6904 7d/jump-if->= break/disp8 - 6905 # var c/eax: byte = in->data[in->read] - 6906 31/xor-with %eax 0/r32/eax - 6907 8a/copy-byte *(esi+ecx+0xc) 0/r32/AL - 6908 # if (c == ' ') break - 6909 3d/compare-eax-and 0x20/imm32/space - 6910 74/jump-if-= break/disp8 - 6911 # if (c == '\r') break - 6912 3d/compare-eax-and 0xd/imm32/carriage-return - 6913 74/jump-if-= break/disp8 - 6914 # if (c == '\n') break - 6915 3d/compare-eax-and 0xa/imm32/newline - 6916 74/jump-if-= break/disp8 - 6917 # if (c == '(') break - 6918 3d/compare-eax-and 0x28/imm32/open-paren - 6919 0f 84/jump-if-= break/disp32 - 6920 # if (c == ')') break - 6921 3d/compare-eax-and 0x29/imm32/close-paren - 6922 0f 84/jump-if-= break/disp32 - 6923 # if (c == ',') break - 6924 3d/compare-eax-and 0x2c/imm32/comma - 6925 0f 84/jump-if-= break/disp32 - 6926 # ++in->read - 6927 ff 0/subop/increment *(esi+4) - 6928 # - 6929 e9/jump loop/disp32 - 6930 } - 6931 $next-mu-token:done: - 6932 # out->end = &in->data[in->read] - 6933 8b/-> *(esi+4) 1/r32/ecx - 6934 8d/copy-address *(esi+ecx+0xc) 0/r32/eax - 6935 89/<- *(edi+4) 0/r32/eax - 6936 $next-mu-token:end: - 6937 # . restore registers - 6938 5f/pop-to-edi - 6939 5e/pop-to-esi - 6940 59/pop-to-ecx - 6941 58/pop-to-eax - 6942 # . epilogue - 6943 89/<- %esp 5/r32/ebp - 6944 5d/pop-to-ebp - 6945 c3/return - 6946 - 6947 pos-or-insert-slice: # arr: (addr stream (addr array byte)), s: (addr slice) -> index/eax: int - 6948 # . prologue - 6949 55/push-ebp - 6950 89/<- %ebp 4/r32/esp - 6951 # if (pos-slice(arr, s) != -1) return it - 6952 (pos-slice *(ebp+8) *(ebp+0xc)) # => eax - 6953 3d/compare-eax-and -1/imm32 - 6954 75/jump-if-!= $pos-or-insert-slice:end/disp8 - 6955 $pos-or-insert-slice:insert: - 6956 # var s2/eax: (handle array byte) - 6957 68/push 0/imm32 - 6958 68/push 0/imm32 - 6959 89/<- %eax 4/r32/esp - 6960 (slice-to-string Heap *(ebp+0xc) %eax) - 6961 # throw away alloc-id - 6962 (lookup *eax *(eax+4)) # => eax - 6963 (write-int *(ebp+8) %eax) - 6964 (pos-slice *(ebp+8) *(ebp+0xc)) # => eax - 6965 $pos-or-insert-slice:end: - 6966 # . reclaim locals - 6967 81 0/subop/add %esp 8/imm32 - 6968 # . epilogue - 6969 89/<- %esp 5/r32/ebp - 6970 5d/pop-to-ebp - 6971 c3/return - 6972 - 6973 # return the index in an array of strings matching 's', -1 if not found - 6974 # index is denominated in elements, not bytes - 6975 pos-slice: # arr: (addr stream (addr array byte)), s: (addr slice) -> index/eax: int - 6976 # . prologue - 6977 55/push-ebp - 6978 89/<- %ebp 4/r32/esp - 6979 # . save registers - 6980 51/push-ecx - 6981 52/push-edx - 6982 53/push-ebx - 6983 56/push-esi - 6984 #? (write-buffered Stderr "pos-slice: ") - 6985 #? (write-slice-buffered Stderr *(ebp+0xc)) - 6986 #? (write-buffered Stderr "\n") - 6987 #? (flush Stderr) - 6988 # esi = arr - 6989 8b/-> *(ebp+8) 6/r32/esi - 6990 # var index/ecx: int = 0 - 6991 b9/copy-to-ecx 0/imm32 - 6992 # var curr/edx: (addr (addr array byte)) = arr->data - 6993 8d/copy-address *(esi+0xc) 2/r32/edx - 6994 # var max/ebx: (addr (addr array byte)) = &arr->data[arr->write] - 6995 8b/-> *esi 3/r32/ebx - 6996 8d/copy-address *(esi+ebx+0xc) 3/r32/ebx - 6997 { - 6998 #? (write-buffered Stderr " ") - 6999 #? (write-int32-hex-buffered Stderr %ecx) - 7000 #? (write-buffered Stderr "\n") - 7001 #? (flush Stderr) - 7002 # if (curr >= max) return -1 - 7003 39/compare %edx 3/r32/ebx - 7004 b8/copy-to-eax -1/imm32 - 7005 73/jump-if-addr>= $pos-slice:end/disp8 - 7006 # if (slice-equal?(s, *curr)) break - 7007 (slice-equal? *(ebp+0xc) *edx) # => eax - 7008 3d/compare-eax-and 0/imm32/false - 7009 75/jump-if-!= break/disp8 - 7010 # ++index - 7011 41/increment-ecx - 7012 # curr += 4 - 7013 81 0/subop/add %edx 4/imm32 - 7014 # - 7015 eb/jump loop/disp8 - 7016 } - 7017 # return index - 7018 89/<- %eax 1/r32/ecx - 7019 $pos-slice:end: - 7020 #? (write-buffered Stderr "=> ") - 7021 #? (write-int32-hex-buffered Stderr %eax) - 7022 #? (write-buffered Stderr "\n") - 7023 # . restore registers - 7024 5e/pop-to-esi - 7025 5b/pop-to-ebx - 7026 5a/pop-to-edx - 7027 59/pop-to-ecx - 7028 # . epilogue - 7029 89/<- %esp 5/r32/ebp - 7030 5d/pop-to-ebp - 7031 c3/return - 7032 - 7033 test-parse-var-with-type: - 7034 # . prologue - 7035 55/push-ebp - 7036 89/<- %ebp 4/r32/esp - 7037 # (eax..ecx) = "x:" - 7038 b8/copy-to-eax "x:"/imm32 - 7039 8b/-> *eax 1/r32/ecx - 7040 8d/copy-address *(eax+ecx+4) 1/r32/ecx - 7041 05/add-to-eax 4/imm32 - 7042 # var slice/ecx: slice = {eax, ecx} - 7043 51/push-ecx - 7044 50/push-eax - 7045 89/<- %ecx 4/r32/esp - 7046 # _test-input-stream contains "int" - 7047 (clear-stream _test-input-stream) - 7048 (write _test-input-stream "int") - 7049 # var v/edx: (handle var) - 7050 68/push 0/imm32 - 7051 68/push 0/imm32 - 7052 89/<- %edx 4/r32/esp - 7053 # - 7054 (parse-var-with-type %ecx _test-input-stream %edx Stderr 0) - 7055 # var v-addr/edx: (addr var) = lookup(v) - 7056 (lookup *edx *(edx+4)) # => eax - 7057 89/<- %edx 0/r32/eax - 7058 # check v-addr->name - 7059 (lookup *edx *(edx+4)) # Var-name Var-name => eax - 7060 (check-strings-equal %eax "x" "F - test-parse-var-with-type/name") - 7061 # check v-addr->type - 7062 (lookup *(edx+8) *(edx+0xc)) # Var-type Var-type => eax - 7063 (check-ints-equal *eax 1 "F - test-parse-var-with-type/type:0") # Tree-is-atom - 7064 (check-ints-equal *(eax+4) 1 "F - test-parse-var-with-type/type:1") # Tree-value - 7065 (check-ints-equal *(eax+0xc) 0 "F - test-parse-var-with-type/type:2") # Tree-right - 7066 # . epilogue - 7067 89/<- %esp 5/r32/ebp - 7068 5d/pop-to-ebp - 7069 c3/return - 7070 - 7071 test-parse-var-with-type-and-register: - 7072 # . prologue - 7073 55/push-ebp - 7074 89/<- %ebp 4/r32/esp - 7075 # (eax..ecx) = "x/eax:" - 7076 b8/copy-to-eax "x/eax:"/imm32 - 7077 8b/-> *eax 1/r32/ecx - 7078 8d/copy-address *(eax+ecx+4) 1/r32/ecx - 7079 05/add-to-eax 4/imm32 - 7080 # var slice/ecx: slice = {eax, ecx} - 7081 51/push-ecx - 7082 50/push-eax - 7083 89/<- %ecx 4/r32/esp - 7084 # _test-input-stream contains "int" - 7085 (clear-stream _test-input-stream) - 7086 (write _test-input-stream "int") - 7087 # var v/edx: (handle var) - 7088 68/push 0/imm32 - 7089 68/push 0/imm32 - 7090 89/<- %edx 4/r32/esp - 7091 # - 7092 (parse-var-with-type %ecx _test-input-stream %edx Stderr 0) - 7093 # var v-addr/edx: (addr var) = lookup(v) - 7094 (lookup *edx *(edx+4)) # => eax - 7095 89/<- %edx 0/r32/eax - 7096 # check v-addr->name - 7097 (lookup *edx *(edx+4)) # Var-name Var-name => eax - 7098 (check-strings-equal %eax "x" "F - test-parse-var-with-type-and-register/name") - 7099 # check v-addr->register - 7100 (lookup *(edx+0x18) *(edx+0x1c)) # Var-register Var-register => eax - 7101 (check-strings-equal %eax "eax" "F - test-parse-var-with-type-and-register/register") - 7102 # check v-addr->type - 7103 (lookup *(edx+8) *(edx+0xc)) # Var-type Var-type => eax - 7104 (check-ints-equal *eax 1 "F - test-parse-var-with-type-and-register/type:0") # Tree-is-atom - 7105 (check-ints-equal *(eax+4) 1 "F - test-parse-var-with-type-and-register/type:1") # Tree-left - 7106 (check-ints-equal *(eax+0xc) 0 "F - test-parse-var-with-type-and-register/type:2") # Tree-right - 7107 # . epilogue - 7108 89/<- %esp 5/r32/ebp - 7109 5d/pop-to-ebp - 7110 c3/return - 7111 - 7112 test-parse-var-with-trailing-characters: - 7113 # . prologue - 7114 55/push-ebp - 7115 89/<- %ebp 4/r32/esp - 7116 # (eax..ecx) = "x:" - 7117 b8/copy-to-eax "x:"/imm32 - 7118 8b/-> *eax 1/r32/ecx - 7119 8d/copy-address *(eax+ecx+4) 1/r32/ecx - 7120 05/add-to-eax 4/imm32 - 7121 # var slice/ecx: slice = {eax, ecx} - 7122 51/push-ecx - 7123 50/push-eax - 7124 89/<- %ecx 4/r32/esp - 7125 # _test-input-stream contains "int," - 7126 (clear-stream _test-input-stream) - 7127 (write _test-input-stream "int,") - 7128 # var v/edx: (handle var) - 7129 68/push 0/imm32 - 7130 68/push 0/imm32 - 7131 89/<- %edx 4/r32/esp - 7132 # - 7133 (parse-var-with-type %ecx _test-input-stream %edx Stderr 0) - 7134 # var v-addr/edx: (addr var) = lookup(v) - 7135 (lookup *edx *(edx+4)) # => eax - 7136 89/<- %edx 0/r32/eax - 7137 # check v-addr->name - 7138 (lookup *edx *(edx+4)) # Var-name Var-name => eax - 7139 (check-strings-equal %eax "x" "F - test-parse-var-with-trailing-characters/name") - 7140 # check v-addr->register - 7141 (check-ints-equal *(edx+0x18) 0 "F - test-parse-var-with-trailing-characters/register") # Var-register - 7142 # check v-addr->type - 7143 (lookup *(edx+8) *(edx+0xc)) # Var-type Var-type => eax - 7144 (check-ints-equal *eax 1 "F - test-parse-var-with-trailing-characters/type:0") # Tree-is-atom - 7145 (check-ints-equal *(eax+4) 1 "F - test-parse-var-with-trailing-characters/type:1") # Tree-left - 7146 (check-ints-equal *(eax+0xc) 0 "F - test-parse-var-with-trailing-characters/type:1") # Tree-right - 7147 # . epilogue - 7148 89/<- %esp 5/r32/ebp - 7149 5d/pop-to-ebp - 7150 c3/return - 7151 - 7152 test-parse-var-with-register-and-trailing-characters: - 7153 # . prologue - 7154 55/push-ebp - 7155 89/<- %ebp 4/r32/esp - 7156 # (eax..ecx) = "x/eax:" - 7157 b8/copy-to-eax "x/eax:"/imm32 - 7158 8b/-> *eax 1/r32/ecx - 7159 8d/copy-address *(eax+ecx+4) 1/r32/ecx - 7160 05/add-to-eax 4/imm32 - 7161 # var slice/ecx: slice = {eax, ecx} - 7162 51/push-ecx - 7163 50/push-eax - 7164 89/<- %ecx 4/r32/esp - 7165 # _test-input-stream contains "int," - 7166 (clear-stream _test-input-stream) - 7167 (write _test-input-stream "int,") - 7168 # var v/edx: (handle var) - 7169 68/push 0/imm32 - 7170 68/push 0/imm32 - 7171 89/<- %edx 4/r32/esp - 7172 # - 7173 (parse-var-with-type %ecx _test-input-stream %edx Stderr 0) - 7174 # var v-addr/edx: (addr var) = lookup(v) - 7175 (lookup *edx *(edx+4)) # => eax - 7176 89/<- %edx 0/r32/eax - 7177 # check v-addr->name - 7178 (lookup *edx *(edx+4)) # Var-name Var-name => eax - 7179 (check-strings-equal %eax "x" "F - test-parse-var-with-register-and-trailing-characters/name") - 7180 # check v-addr->register - 7181 (lookup *(edx+0x18) *(edx+0x1c)) # Var-register Var-register => eax - 7182 (check-strings-equal %eax "eax" "F - test-parse-var-with-register-and-trailing-characters/register") - 7183 # check v-addr->type - 7184 (lookup *(edx+8) *(edx+0xc)) # Var-type Var-type => eax - 7185 (check-ints-equal *eax 1 "F - test-parse-var-with-register-and-trailing-characters/type:0") # Tree-is-atom - 7186 (check-ints-equal *(eax+4) 1 "F - test-parse-var-with-register-and-trailing-characters/type:1") # Tree-left - 7187 (check-ints-equal *(eax+0xc) 0 "F - test-parse-var-with-register-and-trailing-characters/type:2") # Tree-right - 7188 # . epilogue - 7189 89/<- %esp 5/r32/ebp - 7190 5d/pop-to-ebp - 7191 c3/return - 7192 - 7193 test-parse-var-with-compound-type: - 7194 # . prologue - 7195 55/push-ebp - 7196 89/<- %ebp 4/r32/esp - 7197 # (eax..ecx) = "x:" - 7198 b8/copy-to-eax "x:"/imm32 - 7199 8b/-> *eax 1/r32/ecx - 7200 8d/copy-address *(eax+ecx+4) 1/r32/ecx - 7201 05/add-to-eax 4/imm32 - 7202 # var slice/ecx: slice = {eax, ecx} - 7203 51/push-ecx - 7204 50/push-eax - 7205 89/<- %ecx 4/r32/esp - 7206 # _test-input-stream contains "(addr int)" - 7207 (clear-stream _test-input-stream) - 7208 (write _test-input-stream "(addr int)") - 7209 # var v/edx: (handle var) - 7210 68/push 0/imm32 - 7211 68/push 0/imm32 - 7212 89/<- %edx 4/r32/esp - 7213 # - 7214 (parse-var-with-type %ecx _test-input-stream %edx Stderr 0) - 7215 # var v-addr/edx: (addr var) = lookup(v) - 7216 (lookup *edx *(edx+4)) # => eax - 7217 89/<- %edx 0/r32/eax - 7218 # check v-addr->name - 7219 (lookup *edx *(edx+4)) # Var-name Var-name => eax - 7220 (check-strings-equal %eax "x" "F - test-parse-var-with-compound-type/name") - 7221 # check v-addr->register - 7222 (check-ints-equal *(edx+0x18) 0 "F - test-parse-var-with-compound-type/register") # Var-register - 7223 # - check v-addr->type - 7224 # var type/edx: (addr tree type-id) = var->type - 7225 (lookup *(edx+8) *(edx+0xc)) # Var-type Var-type => eax - 7226 89/<- %edx 0/r32/eax - 7227 # type is a non-atom - 7228 (check-ints-equal *edx 0 "F - test-parse-var-with-compound-type/type:0") # Tree-is-atom - 7229 # type->left == atom(addr) - 7230 (lookup *(edx+4) *(edx+8)) # Tree-left Tree-left => eax - 7231 (check-ints-equal *eax 1 "F - test-parse-var-with-compound-type/type:1") # Tree-is-atom - 7232 (check-ints-equal *(eax+4) 2 "F - test-parse-var-with-compound-type/type:2") # Tree-value - 7233 # type->right->left == atom(int) - 7234 (lookup *(edx+0xc) *(edx+0x10)) # Tree-right Tree-right => eax - 7235 (lookup *(eax+4) *(eax+8)) # Tree-left Tree-left => eax - 7236 (check-ints-equal *eax 1 "F - test-parse-var-with-compound-type/type:3") # Tree-is-atom - 7237 (check-ints-equal *(eax+4) 1 "F - test-parse-var-with-compound-type/type:4") # Tree-value - 7238 # type->right->right == null - 7239 (check-ints-equal *(eax+0xc) 0 "F - test-parse-var-with-compound-type/type:5") # Tree-right - 7240 # . epilogue - 7241 89/<- %esp 5/r32/ebp - 7242 5d/pop-to-ebp - 7243 c3/return - 7244 - 7245 # identifier starts with a letter or '$' or '_' - 7246 # no constraints at the moment on later letters - 7247 # all we really want to do so far is exclude '{', '}' and '->' - 7248 is-identifier?: # in: (addr slice) -> result/eax: boolean - 7249 # . prologue - 7250 55/push-ebp - 7251 89/<- %ebp 4/r32/esp - 7252 # if (slice-empty?(in)) return false - 7253 (slice-empty? *(ebp+8)) # => eax - 7254 3d/compare-eax-and 0/imm32/false - 7255 75/jump-if-!= $is-identifier?:false/disp8 - 7256 # var c/eax: byte = *in->start - 7257 8b/-> *(ebp+8) 0/r32/eax - 7258 8b/-> *eax 0/r32/eax - 7259 8a/copy-byte *eax 0/r32/AL - 7260 81 4/subop/and %eax 0xff/imm32 - 7261 # if (c == '$') return true - 7262 3d/compare-eax-and 0x24/imm32/$ - 7263 74/jump-if-= $is-identifier?:true/disp8 - 7264 # if (c == '_') return true - 7265 3d/compare-eax-and 0x5f/imm32/_ - 7266 74/jump-if-= $is-identifier?:true/disp8 - 7267 # drop case - 7268 25/and-eax-with 0x5f/imm32 - 7269 # if (c < 'A') return false - 7270 3d/compare-eax-and 0x41/imm32/A - 7271 7c/jump-if-< $is-identifier?:false/disp8 - 7272 # if (c > 'Z') return false - 7273 3d/compare-eax-and 0x5a/imm32/Z - 7274 7f/jump-if-> $is-identifier?:false/disp8 - 7275 # otherwise return true - 7276 $is-identifier?:true: - 7277 b8/copy-to-eax 1/imm32/true - 7278 eb/jump $is-identifier?:end/disp8 - 7279 $is-identifier?:false: - 7280 b8/copy-to-eax 0/imm32/false - 7281 $is-identifier?:end: - 7282 # . epilogue - 7283 89/<- %esp 5/r32/ebp - 7284 5d/pop-to-ebp - 7285 c3/return - 7286 - 7287 test-is-identifier-dollar: - 7288 # . prologue - 7289 55/push-ebp - 7290 89/<- %ebp 4/r32/esp - 7291 # (eax..ecx) = "$a" - 7292 b8/copy-to-eax "$a"/imm32 - 7293 8b/-> *eax 1/r32/ecx - 7294 8d/copy-address *(eax+ecx+4) 1/r32/ecx - 7295 05/add-to-eax 4/imm32 - 7296 # var slice/ecx: slice = {eax, ecx} - 7297 51/push-ecx - 7298 50/push-eax - 7299 89/<- %ecx 4/r32/esp - 7300 # - 7301 (is-identifier? %ecx) - 7302 (check-ints-equal %eax 1 "F - test-is-identifier-dollar") - 7303 # . epilogue - 7304 89/<- %esp 5/r32/ebp - 7305 5d/pop-to-ebp - 7306 c3/return - 7307 - 7308 test-is-identifier-underscore: - 7309 # . prologue - 7310 55/push-ebp - 7311 89/<- %ebp 4/r32/esp - 7312 # (eax..ecx) = "_a" - 7313 b8/copy-to-eax "_a"/imm32 - 7314 8b/-> *eax 1/r32/ecx - 7315 8d/copy-address *(eax+ecx+4) 1/r32/ecx - 7316 05/add-to-eax 4/imm32 - 7317 # var slice/ecx: slice = {eax, ecx} - 7318 51/push-ecx - 7319 50/push-eax - 7320 89/<- %ecx 4/r32/esp - 7321 # - 7322 (is-identifier? %ecx) - 7323 (check-ints-equal %eax 1 "F - test-is-identifier-underscore") - 7324 # . epilogue - 7325 89/<- %esp 5/r32/ebp - 7326 5d/pop-to-ebp - 7327 c3/return - 7328 - 7329 test-is-identifier-a: - 7330 # . prologue - 7331 55/push-ebp - 7332 89/<- %ebp 4/r32/esp - 7333 # (eax..ecx) = "a$" - 7334 b8/copy-to-eax "a$"/imm32 - 7335 8b/-> *eax 1/r32/ecx - 7336 8d/copy-address *(eax+ecx+4) 1/r32/ecx - 7337 05/add-to-eax 4/imm32 - 7338 # var slice/ecx: slice = {eax, ecx} - 7339 51/push-ecx - 7340 50/push-eax - 7341 89/<- %ecx 4/r32/esp - 7342 # - 7343 (is-identifier? %ecx) - 7344 (check-ints-equal %eax 1 "F - test-is-identifier-a") - 7345 # . epilogue - 7346 89/<- %esp 5/r32/ebp - 7347 5d/pop-to-ebp - 7348 c3/return - 7349 - 7350 test-is-identifier-z: - 7351 # . prologue - 7352 55/push-ebp - 7353 89/<- %ebp 4/r32/esp - 7354 # (eax..ecx) = "z$" - 7355 b8/copy-to-eax "z$"/imm32 - 7356 8b/-> *eax 1/r32/ecx - 7357 8d/copy-address *(eax+ecx+4) 1/r32/ecx - 7358 05/add-to-eax 4/imm32 - 7359 # var slice/ecx: slice = {eax, ecx} - 7360 51/push-ecx - 7361 50/push-eax - 7362 89/<- %ecx 4/r32/esp + 5558 68/push 0/imm32 + 5559 89/<- %edx 4/r32/esp + 5560 (tailor-exit-descriptor %edx 0x10) + 5561 # + 5562 (write _test-input-stream "fn foo {\n") + 5563 (write _test-input-stream " var a: t\n") + 5564 (write _test-input-stream " get a, x\n") + 5565 (write _test-input-stream "}\n") + 5566 (write _test-input-stream "type t {\n") + 5567 (write _test-input-stream " x: int\n") + 5568 (write _test-input-stream "}\n") + 5569 # convert + 5570 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) + 5571 # registers except esp clobbered at this point + 5572 # restore ed + 5573 89/<- %edx 4/r32/esp + 5574 (flush _test-output-buffered-file) + 5575 (flush _test-error-buffered-file) + 5576 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ + 5582 # check output + 5583 (check-stream-equal _test-output-stream "" "F - test-get-with-no-output: output should be empty") + 5584 (check-next-stream-line-equal _test-error-stream "fn foo: stmt get: must have an output" "F - test-get-with-no-output: error message") + 5585 # check that stop(1) was called + 5586 (check-ints-equal *(edx+4) 2 "F - test-get-with-no-output: exit status") + 5587 # don't restore from ebp + 5588 81 0/subop/add %esp 8/imm32 + 5589 # . epilogue + 5590 5d/pop-to-ebp + 5591 c3/return + 5592 + 5593 test-get-with-too-many-outputs: + 5594 # . prologue + 5595 55/push-ebp + 5596 89/<- %ebp 4/r32/esp + 5597 # setup + 5598 (clear-stream _test-input-stream) + 5599 (clear-stream $_test-input-buffered-file->buffer) + 5600 (clear-stream _test-output-stream) + 5601 (clear-stream $_test-output-buffered-file->buffer) + 5602 (clear-stream _test-error-stream) + 5603 (clear-stream $_test-error-buffered-file->buffer) + 5604 # var ed/edx: exit-descriptor = tailor-exit-descriptor(16) + 5605 68/push 0/imm32 + 5606 68/push 0/imm32 + 5607 89/<- %edx 4/r32/esp + 5608 (tailor-exit-descriptor %edx 0x10) + 5609 # + 5610 (write _test-input-stream "fn foo {\n") + 5611 (write _test-input-stream " var a: t\n") + 5612 (write _test-input-stream " var b: int\n") + 5613 (write _test-input-stream " var c/eax: (addr int) <- copy 0\n") + 5614 (write _test-input-stream " c, b <- get a, x\n") + 5615 (write _test-input-stream "}\n") + 5616 (write _test-input-stream "type t {\n") + 5617 (write _test-input-stream " x: int\n") + 5618 (write _test-input-stream "}\n") + 5619 # convert + 5620 (convert-mu _test-input-buffered-file _test-output-buffered-file _test-error-buffered-file %edx) + 5621 # registers except esp clobbered at this point + 5622 # restore ed + 5623 89/<- %edx 4/r32/esp + 5624 (flush _test-output-buffered-file) + 5625 (flush _test-error-buffered-file) + 5626 +-- 6 lines: #? # dump _test-error-stream ------------------------------------------------------------------------------------------------------------------------------------------ + 5632 # check output + 5633 (check-stream-equal _test-output-stream "" "F - test-get-with-too-many-outputs: output should be empty") + 5634 (check-next-stream-line-equal _test-error-stream "fn foo: stmt get: too many outputs (1 required)" "F - test-get-with-too-many-outputs: error message") + 5635 # check that stop(1) was called + 5636 (check-ints-equal *(edx+4) 2 "F - test-get-with-too-many-outputs: exit status") + 5637 # don't restore from ebp + 5638 81 0/subop/add %esp 8/imm32 + 5639 # . epilogue + 5640 5d/pop-to-ebp + 5641 c3/return + 5642 + 5643 test-convert-array-of-user-defined-types: + 5644 # . prologue + 5645 55/push-ebp + 5646 89/<- %ebp 4/r32/esp + 5647 # setup + 5648 (clear-stream _test-input-stream) + 5649 (clear-stream $_test-input-buffered-file->buffer) + 5650 (clear-stream _test-output-stream) + 5651 (clear-stream $_test-output-buffered-file->buffer) + 5652 # + 5653 (write _test-input-stream "type t {\n") # each t is 8 bytes, which is a power of 2 + 5654 (write _test-input-stream " x: int\n") + 5655 (write _test-input-stream " y: int\n") + 5656 (write _test-input-stream "}\n") + 5657 (write _test-input-stream "fn foo {\n") + 5658 (write _test-input-stream " var arr/eax: (addr array t) <- copy 0\n") + 5659 (write _test-input-stream " var idx/ecx: int <- copy 3\n") + 5660 (write _test-input-stream " var x/eax: (addr int) <- index arr, idx\n") + 5661 (write _test-input-stream "}\n") + 5662 # convert + 5663 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 5664 (flush _test-output-buffered-file) + 5665 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 5671 # check output + 5672 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-array-of-user-defined-types/0") + 5673 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-array-of-user-defined-types/1") + 5674 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-array-of-user-defined-types/2") + 5675 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-array-of-user-defined-types/3") + 5676 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-array-of-user-defined-types/4") + 5677 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-array-of-user-defined-types/5") + 5678 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-array-of-user-defined-types/6") + 5679 (check-next-stream-line-equal _test-output-stream " b8/copy-to-eax 0/imm32" "F - test-convert-array-of-user-defined-types/7") + 5680 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-convert-array-of-user-defined-types/8") + 5681 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 3/imm32" "F - test-convert-array-of-user-defined-types/9") + 5682 (check-next-stream-line-equal _test-output-stream " 8d/copy-address *(eax + ecx<<0x00000003 + 4) 0x00000000/r32" "F - test-convert-array-of-user-defined-types/11") + 5683 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-convert-array-of-user-defined-types/13") + 5684 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-array-of-user-defined-types/14") + 5685 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-array-of-user-defined-types/15") + 5686 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-array-of-user-defined-types/16") + 5687 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-array-of-user-defined-types/17") + 5688 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-array-of-user-defined-types/18") + 5689 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-array-of-user-defined-types/19") + 5690 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-array-of-user-defined-types/20") + 5691 # . epilogue + 5692 89/<- %esp 5/r32/ebp + 5693 5d/pop-to-ebp + 5694 c3/return + 5695 + 5696 test-convert-length-of-array-of-user-defined-types-to-eax: + 5697 # . prologue + 5698 55/push-ebp + 5699 89/<- %ebp 4/r32/esp + 5700 # setup + 5701 (clear-stream _test-input-stream) + 5702 (clear-stream $_test-input-buffered-file->buffer) + 5703 (clear-stream _test-output-stream) + 5704 (clear-stream $_test-output-buffered-file->buffer) + 5705 # + 5706 (write _test-input-stream "type t {\n") # size = 12, which is not a power of 2 + 5707 (write _test-input-stream " x: int\n") + 5708 (write _test-input-stream " y: int\n") + 5709 (write _test-input-stream " z: int\n") + 5710 (write _test-input-stream "}\n") + 5711 (write _test-input-stream "fn foo {\n") + 5712 (write _test-input-stream " var arr/eax: (addr array t) <- copy 0\n") + 5713 (write _test-input-stream " var x/eax: (addr t) <- length arr\n") + 5714 (write _test-input-stream "}\n") + 5715 # convert + 5716 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 5717 (flush _test-output-buffered-file) + 5718 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 5724 # check output + 5725 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-length-of-array-of-user-defined-types-to-eax/0") + 5726 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-length-of-array-of-user-defined-types-to-eax/1") + 5727 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-length-of-array-of-user-defined-types-to-eax/2") + 5728 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-length-of-array-of-user-defined-types-to-eax/3") + 5729 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-length-of-array-of-user-defined-types-to-eax/4") + 5730 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-length-of-array-of-user-defined-types-to-eax/5") + 5731 # var arr + 5732 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-length-of-array-of-user-defined-types-to-eax/6") + 5733 (check-next-stream-line-equal _test-output-stream " b8/copy-to-eax 0/imm32" "F - test-convert-length-of-array-of-user-defined-types-to-eax/7") + 5734 # length instruction + 5735 (check-next-stream-line-equal _test-output-stream " 51/push-ecx" "F - test-convert-length-of-array-of-user-defined-types-to-eax/8") + 5736 (check-next-stream-line-equal _test-output-stream " 52/push-edx" "F - test-convert-length-of-array-of-user-defined-types-to-eax/9") + 5737 (check-next-stream-line-equal _test-output-stream " 8b/-> *eax 0x00000000/r32" "F - test-convert-length-of-array-of-user-defined-types-to-eax/10") + 5738 (check-next-stream-line-equal _test-output-stream " 31/xor %edx 2/r32/edx" "F - test-convert-length-of-array-of-user-defined-types-to-eax/11") + 5739 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 0x0000000c/imm32" "F - test-convert-length-of-array-of-user-defined-types-to-eax/12") + 5740 (check-next-stream-line-equal _test-output-stream " f7 7/subop/idiv-eax-edx-by %ecx" "F - test-convert-length-of-array-of-user-defined-types-to-eax/13") + 5741 (check-next-stream-line-equal _test-output-stream " 5a/pop-to-edx" "F - test-convert-length-of-array-of-user-defined-types-to-eax/14") + 5742 (check-next-stream-line-equal _test-output-stream " 59/pop-to-ecx" "F - test-convert-length-of-array-of-user-defined-types-to-eax/15") + 5743 # reclaim arr + 5744 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-length-of-array-of-user-defined-types-to-eax/16") + 5745 # + 5746 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-length-of-array-of-user-defined-types-to-eax/17") + 5747 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-length-of-array-of-user-defined-types-to-eax/18") + 5748 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-length-of-array-of-user-defined-types-to-eax/19") + 5749 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-length-of-array-of-user-defined-types-to-eax/20") + 5750 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-length-of-array-of-user-defined-types-to-eax/21") + 5751 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-length-of-array-of-user-defined-types-to-eax/22") + 5752 # . epilogue + 5753 89/<- %esp 5/r32/ebp + 5754 5d/pop-to-ebp + 5755 c3/return + 5756 + 5757 test-convert-length-of-array-of-user-defined-types-to-ecx: + 5758 # . prologue + 5759 55/push-ebp + 5760 89/<- %ebp 4/r32/esp + 5761 # setup + 5762 (clear-stream _test-input-stream) + 5763 (clear-stream $_test-input-buffered-file->buffer) + 5764 (clear-stream _test-output-stream) + 5765 (clear-stream $_test-output-buffered-file->buffer) + 5766 # + 5767 (write _test-input-stream "type t {\n") # size = 12, which is not a power of 2 + 5768 (write _test-input-stream " x: int\n") + 5769 (write _test-input-stream " y: int\n") + 5770 (write _test-input-stream " z: int\n") + 5771 (write _test-input-stream "}\n") + 5772 (write _test-input-stream "fn foo {\n") + 5773 (write _test-input-stream " var arr/eax: (addr array t) <- copy 0\n") + 5774 (write _test-input-stream " var x/ecx: (addr t) <- length arr\n") + 5775 (write _test-input-stream "}\n") + 5776 # convert + 5777 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 5778 (flush _test-output-buffered-file) + 5779 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 5785 # check output + 5786 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/0") + 5787 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/1") + 5788 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/2") + 5789 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/3") + 5790 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/4") + 5791 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/5") + 5792 # var a + 5793 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/6") + 5794 (check-next-stream-line-equal _test-output-stream " b8/copy-to-eax 0/imm32" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/7") + 5795 # var x + 5796 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ecx" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/8") + 5797 # length instruction + 5798 (check-next-stream-line-equal _test-output-stream " 50/push-eax" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/9") + 5799 (check-next-stream-line-equal _test-output-stream " 52/push-edx" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/10") + 5800 (check-next-stream-line-equal _test-output-stream " 8b/-> *eax 0x00000000/r32" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/11") + 5801 (check-next-stream-line-equal _test-output-stream " 31/xor %edx 2/r32/edx" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/12") + 5802 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 0x0000000c/imm32" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/13") + 5803 (check-next-stream-line-equal _test-output-stream " f7 7/subop/idiv-eax-edx-by %ecx" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/14") + 5804 (check-next-stream-line-equal _test-output-stream " 89/<- %ecx 0/r32/eax" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/15") + 5805 (check-next-stream-line-equal _test-output-stream " 5a/pop-to-edx" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/16") + 5806 (check-next-stream-line-equal _test-output-stream " 58/pop-to-eax" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/17") + 5807 # reclaim x + 5808 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ecx" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/18") + 5809 # reclaim a + 5810 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/19") + 5811 # + 5812 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/20") + 5813 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/21") + 5814 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/22") + 5815 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/23") + 5816 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/24") + 5817 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-length-of-array-of-user-defined-types-to-ecx/25") + 5818 # . epilogue + 5819 89/<- %esp 5/r32/ebp + 5820 5d/pop-to-ebp + 5821 c3/return + 5822 + 5823 test-convert-length-of-array-of-user-defined-types-to-edx: + 5824 # . prologue + 5825 55/push-ebp + 5826 89/<- %ebp 4/r32/esp + 5827 # setup + 5828 (clear-stream _test-input-stream) + 5829 (clear-stream $_test-input-buffered-file->buffer) + 5830 (clear-stream _test-output-stream) + 5831 (clear-stream $_test-output-buffered-file->buffer) + 5832 # + 5833 (write _test-input-stream "type t {\n") # size = 12, which is not a power of 2 + 5834 (write _test-input-stream " x: int\n") + 5835 (write _test-input-stream " y: int\n") + 5836 (write _test-input-stream " z: int\n") + 5837 (write _test-input-stream "}\n") + 5838 (write _test-input-stream "fn foo {\n") + 5839 (write _test-input-stream " var arr/eax: (addr array t) <- copy 0\n") + 5840 (write _test-input-stream " var x/edx: (addr t) <- length arr\n") + 5841 (write _test-input-stream "}\n") + 5842 # convert + 5843 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 5844 (flush _test-output-buffered-file) + 5845 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 5851 # check output + 5852 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-length-of-array-of-user-defined-types-to-edx/0") + 5853 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-length-of-array-of-user-defined-types-to-edx/1") + 5854 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-length-of-array-of-user-defined-types-to-edx/2") + 5855 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-length-of-array-of-user-defined-types-to-edx/3") + 5856 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-length-of-array-of-user-defined-types-to-edx/4") + 5857 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-length-of-array-of-user-defined-types-to-edx/5") + 5858 # var a + 5859 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-length-of-array-of-user-defined-types-to-edx/6") + 5860 (check-next-stream-line-equal _test-output-stream " b8/copy-to-eax 0/imm32" "F - test-convert-length-of-array-of-user-defined-types-to-edx/7") + 5861 # var x + 5862 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %edx" "F - test-convert-length-of-array-of-user-defined-types-to-edx/8") + 5863 # length instruction + 5864 (check-next-stream-line-equal _test-output-stream " 50/push-eax" "F - test-convert-length-of-array-of-user-defined-types-to-edx/9") + 5865 (check-next-stream-line-equal _test-output-stream " 51/push-ecx" "F - test-convert-length-of-array-of-user-defined-types-to-edx/10") + 5866 (check-next-stream-line-equal _test-output-stream " 8b/-> *eax 0x00000000/r32" "F - test-convert-length-of-array-of-user-defined-types-to-edx/11") + 5867 (check-next-stream-line-equal _test-output-stream " 31/xor %edx 2/r32/edx" "F - test-convert-length-of-array-of-user-defined-types-to-edx/12") + 5868 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 0x0000000c/imm32" "F - test-convert-length-of-array-of-user-defined-types-to-edx/13") + 5869 (check-next-stream-line-equal _test-output-stream " f7 7/subop/idiv-eax-edx-by %ecx" "F - test-convert-length-of-array-of-user-defined-types-to-edx/14") + 5870 (check-next-stream-line-equal _test-output-stream " 89/<- %edx 0/r32/eax" "F - test-convert-length-of-array-of-user-defined-types-to-edx/15") + 5871 (check-next-stream-line-equal _test-output-stream " 59/pop-to-ecx" "F - test-convert-length-of-array-of-user-defined-types-to-edx/16") + 5872 (check-next-stream-line-equal _test-output-stream " 58/pop-to-eax" "F - test-convert-length-of-array-of-user-defined-types-to-edx/17") + 5873 # reclaim x + 5874 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %edx" "F - test-convert-length-of-array-of-user-defined-types-to-edx/18") + 5875 # reclaim a + 5876 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-length-of-array-of-user-defined-types-to-edx/19") + 5877 # + 5878 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-length-of-array-of-user-defined-types-to-edx/20") + 5879 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-length-of-array-of-user-defined-types-to-edx/21") + 5880 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-length-of-array-of-user-defined-types-to-edx/22") + 5881 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-length-of-array-of-user-defined-types-to-edx/23") + 5882 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-length-of-array-of-user-defined-types-to-edx/24") + 5883 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-length-of-array-of-user-defined-types-to-edx/25") + 5884 # . epilogue + 5885 89/<- %esp 5/r32/ebp + 5886 5d/pop-to-ebp + 5887 c3/return + 5888 + 5889 test-convert-length-of-array-of-user-defined-types: + 5890 # . prologue + 5891 55/push-ebp + 5892 89/<- %ebp 4/r32/esp + 5893 # setup + 5894 (clear-stream _test-input-stream) + 5895 (clear-stream $_test-input-buffered-file->buffer) + 5896 (clear-stream _test-output-stream) + 5897 (clear-stream $_test-output-buffered-file->buffer) + 5898 # + 5899 (write _test-input-stream "type t {\n") # each t is 8 bytes, which is a power of 2 + 5900 (write _test-input-stream " x: int\n") + 5901 (write _test-input-stream " y: int\n") + 5902 (write _test-input-stream " z: int\n") + 5903 (write _test-input-stream "}\n") + 5904 (write _test-input-stream "fn foo {\n") + 5905 (write _test-input-stream " var arr/eax: (addr array t) <- copy 0\n") + 5906 (write _test-input-stream " var x/ebx: (addr t) <- length arr\n") + 5907 (write _test-input-stream "}\n") + 5908 # convert + 5909 (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + 5910 (flush _test-output-buffered-file) + 5911 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- + 5917 # check output + 5918 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-length-of-array-of-user-defined-types/0") + 5919 (check-next-stream-line-equal _test-output-stream " # . prologue" "F - test-convert-length-of-array-of-user-defined-types/1") + 5920 (check-next-stream-line-equal _test-output-stream " 55/push-ebp" "F - test-convert-length-of-array-of-user-defined-types/2") + 5921 (check-next-stream-line-equal _test-output-stream " 89/<- %ebp 4/r32/esp" "F - test-convert-length-of-array-of-user-defined-types/3") + 5922 (check-next-stream-line-equal _test-output-stream " {" "F - test-convert-length-of-array-of-user-defined-types/4") + 5923 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:loop:" "F - test-convert-length-of-array-of-user-defined-types/5") + 5924 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %eax" "F - test-convert-length-of-array-of-user-defined-types/6") + 5925 (check-next-stream-line-equal _test-output-stream " b8/copy-to-eax 0/imm32" "F - test-convert-length-of-array-of-user-defined-types/7") + 5926 (check-next-stream-line-equal _test-output-stream " ff 6/subop/push %ebx" "F - test-convert-length-of-array-of-user-defined-types/8") + 5927 (check-next-stream-line-equal _test-output-stream " 50/push-eax" "F - test-convert-length-of-array-of-user-defined-types/9") + 5928 (check-next-stream-line-equal _test-output-stream " 51/push-ecx" "F - test-convert-length-of-array-of-user-defined-types/10") + 5929 (check-next-stream-line-equal _test-output-stream " 52/push-edx" "F - test-convert-length-of-array-of-user-defined-types/11") + 5930 (check-next-stream-line-equal _test-output-stream " 8b/-> *eax 0x00000000/r32" "F - test-convert-length-of-array-of-user-defined-types/12") + 5931 (check-next-stream-line-equal _test-output-stream " 31/xor %edx 2/r32/edx" "F - test-convert-length-of-array-of-user-defined-types/13") + 5932 (check-next-stream-line-equal _test-output-stream " b9/copy-to-ecx 0x0000000c/imm32" "F - test-convert-length-of-array-of-user-defined-types/14") + 5933 (check-next-stream-line-equal _test-output-stream " f7 7/subop/idiv-eax-edx-by %ecx" "F - test-convert-length-of-array-of-user-defined-types/15") + 5934 (check-next-stream-line-equal _test-output-stream " 89/<- %ebx 0/r32/eax" "F - test-convert-length-of-array-of-user-defined-types/16") + 5935 (check-next-stream-line-equal _test-output-stream " 5a/pop-to-edx" "F - test-convert-length-of-array-of-user-defined-types/17") + 5936 (check-next-stream-line-equal _test-output-stream " 59/pop-to-ecx" "F - test-convert-length-of-array-of-user-defined-types/18") + 5937 (check-next-stream-line-equal _test-output-stream " 58/pop-to-eax" "F - test-convert-length-of-array-of-user-defined-types/19") + 5938 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %ebx" "F - test-convert-length-of-array-of-user-defined-types/20") + 5939 (check-next-stream-line-equal _test-output-stream " 8f 0/subop/pop %eax" "F - test-convert-length-of-array-of-user-defined-types/21") + 5940 (check-next-stream-line-equal _test-output-stream " }" "F - test-convert-length-of-array-of-user-defined-types/22") + 5941 (check-next-stream-line-equal _test-output-stream "$foo:0x00000001:break:" "F - test-convert-length-of-array-of-user-defined-types/23") + 5942 (check-next-stream-line-equal _test-output-stream " # . epilogue" "F - test-convert-length-of-array-of-user-defined-types/24") + 5943 (check-next-stream-line-equal _test-output-stream " 89/<- %esp 5/r32/ebp" "F - test-convert-length-of-array-of-user-defined-types/25") + 5944 (check-next-stream-line-equal _test-output-stream " 5d/pop-to-ebp" "F - test-convert-length-of-array-of-user-defined-types/26") + 5945 (check-next-stream-line-equal _test-output-stream " c3/return" "F - test-convert-length-of-array-of-user-defined-types/27") + 5946 # . epilogue + 5947 89/<- %esp 5/r32/ebp + 5948 5d/pop-to-ebp + 5949 c3/return + 5950 + 5951 ####################################################### + 5952 # Parsing + 5953 ####################################################### + 5954 + 5955 == data + 5956 + 5957 # Global state added to each var record when parsing a function + 5958 Next-block-index: # (addr int) + 5959 1/imm32 + 5960 + 5961 Curr-block-depth: # (addr int) + 5962 1/imm32 + 5963 + 5964 == code + 5965 + 5966 parse-mu: # in: (addr buffered-file), err: (addr buffered-file), ed: (addr exit-descriptor) + 5967 # pseudocode + 5968 # var curr-function: (addr handle function) = Program->functions + 5969 # var curr-signature: (addr handle function) = Program->signatures + 5970 # var curr-type: (addr handle typeinfo) = Program->types + 5971 # var line: (stream byte 512) + 5972 # var word-slice: slice + 5973 # while true # line loop + 5974 # clear-stream(line) + 5975 # read-line-buffered(in, line) + 5976 # if (line->write == 0) break # end of file + 5977 # word-slice = next-mu-token(line) + 5978 # if slice-empty?(word-slice) # end of line + 5979 # continue + 5980 # else if slice-starts-with?(word-slice, "#") # comment + 5981 # continue # end of line + 5982 # else if slice-equal?(word-slice, "fn") + 5983 # var new-function: (handle function) = allocate(function) + 5984 # var vars: (stack live-var 256) + 5985 # populate-mu-function-header(line, new-function, vars) + 5986 # populate-mu-function-body(in, new-function, vars) + 5987 # assert(vars->top == 0) + 5988 # *curr-function = new-function + 5989 # curr-function = &new-function->next + 5990 # else if slice-equal?(word-slice, "sig") + 5991 # var new-function: (handle function) = allocate(function) + 5992 # populate-mu-function-signature(line, new-function) + 5993 # *curr-signature = new-function + 5994 # curr-signature = &new-function->next + 5995 # else if slice-equal?(word-slice, "type") + 5996 # word-slice = next-mu-token(line) + 5997 # type-id = pos-or-insert-slice(Type-id, word-slice) + 5998 # var new-type: (handle typeinfo) = find-or-create-typeinfo(type-id) + 5999 # assert(next-word(line) == "{") + 6000 # populate-mu-type(in, new-type) + 6001 # else + 6002 # abort() + 6003 # + 6004 # . prologue + 6005 55/push-ebp + 6006 89/<- %ebp 4/r32/esp + 6007 # var curr-signature: (addr handle function) at *(ebp-4) + 6008 68/push _Program-signatures/imm32 + 6009 # . save registers + 6010 50/push-eax + 6011 51/push-ecx + 6012 52/push-edx + 6013 53/push-ebx + 6014 56/push-esi + 6015 57/push-edi + 6016 # var line/ecx: (stream byte 512) + 6017 81 5/subop/subtract %esp 0x200/imm32 + 6018 68/push 0x200/imm32/size + 6019 68/push 0/imm32/read + 6020 68/push 0/imm32/write + 6021 89/<- %ecx 4/r32/esp + 6022 # var word-slice/edx: slice + 6023 68/push 0/imm32/end + 6024 68/push 0/imm32/start + 6025 89/<- %edx 4/r32/esp + 6026 # var curr-function/edi: (addr handle function) + 6027 bf/copy-to-edi _Program-functions/imm32 + 6028 # var vars/ebx: (stack live-var 256) + 6029 81 5/subop/subtract %esp 0xc00/imm32 + 6030 68/push 0xc00/imm32/size + 6031 68/push 0/imm32/top + 6032 89/<- %ebx 4/r32/esp + 6033 { + 6034 $parse-mu:line-loop: + 6035 (clear-stream %ecx) + 6036 (read-line-buffered *(ebp+8) %ecx) + 6037 # if (line->write == 0) break + 6038 81 7/subop/compare *ecx 0/imm32 + 6039 0f 84/jump-if-= break/disp32 + 6040 +-- 6 lines: #? # dump line ------------------------------------------------------------------------------------------------------------------------------------------------------ + 6046 (next-mu-token %ecx %edx) + 6047 # if slice-empty?(word-slice) continue + 6048 (slice-empty? %edx) # => eax + 6049 3d/compare-eax-and 0/imm32/false + 6050 0f 85/jump-if-!= loop/disp32 + 6051 # if (*word-slice->start == "#") continue + 6052 # . eax = *word-slice->start + 6053 8b/-> *edx 0/r32/eax + 6054 8a/copy-byte *eax 0/r32/AL + 6055 81 4/subop/and %eax 0xff/imm32 + 6056 # . if (eax == '#') continue + 6057 3d/compare-eax-and 0x23/imm32/hash + 6058 0f 84/jump-if-= loop/disp32 + 6059 # if (slice-equal?(word-slice, "fn")) parse a function + 6060 { + 6061 $parse-mu:fn: + 6062 (slice-equal? %edx "fn") # => eax + 6063 3d/compare-eax-and 0/imm32/false + 6064 0f 84/jump-if-= break/disp32 + 6065 # var new-function/esi: (handle function) + 6066 68/push 0/imm32 + 6067 68/push 0/imm32 + 6068 89/<- %esi 4/r32/esp + 6069 # populate-mu-function(line, in, vars, new-function) + 6070 (allocate Heap *Function-size %esi) + 6071 # var new-function-addr/eax: (addr function) + 6072 (lookup *esi *(esi+4)) # => eax + 6073 # initialize vars + 6074 (clear-stack %ebx) + 6075 # + 6076 (populate-mu-function-header %ecx %eax %ebx *(ebp+0xc) *(ebp+0x10)) + 6077 (populate-mu-function-body *(ebp+8) %eax %ebx *(ebp+0xc) *(ebp+0x10)) + 6078 # *curr-function = new-function + 6079 8b/-> *esi 0/r32/eax + 6080 89/<- *edi 0/r32/eax + 6081 8b/-> *(esi+4) 0/r32/eax + 6082 89/<- *(edi+4) 0/r32/eax + 6083 # curr-function = &new-function->next + 6084 # . var tmp/eax: (addr function) = lookup(new-function) + 6085 (lookup *esi *(esi+4)) # => eax + 6086 # . curr-function = &tmp->next + 6087 8d/copy-address *(eax+0x20) 7/r32/edi # Function-next + 6088 # reclaim new-function + 6089 81 0/subop/add %esp 8/imm32 + 6090 # + 6091 e9/jump $parse-mu:line-loop/disp32 + 6092 } + 6093 # if (slice-equal?(word-slice, "sig")) parse a function signature + 6094 # Function signatures are for providing types to SubX functions. + 6095 { + 6096 $parse-mu:sig: + 6097 (slice-equal? %edx "sig") # => eax + 6098 3d/compare-eax-and 0/imm32/false + 6099 0f 84/jump-if-= break/disp32 + 6100 # edi = curr-function + 6101 57/push-edi + 6102 $bb: + 6103 8b/-> *(ebp-4) 7/r32/edi + 6104 # var new-function/esi: (handle function) + 6105 68/push 0/imm32 + 6106 68/push 0/imm32 + 6107 89/<- %esi 4/r32/esp + 6108 # populate-mu-function(line, in, vars, new-function) + 6109 (allocate Heap *Function-size %esi) + 6110 # var new-function-addr/eax: (addr function) + 6111 (lookup *esi *(esi+4)) # => eax + 6112 # + 6113 (populate-mu-function-signature %ecx %eax *(ebp+0xc) *(ebp+0x10)) + 6114 # *curr-signature = new-function + 6115 8b/-> *esi 0/r32/eax + 6116 89/<- *edi 0/r32/eax + 6117 8b/-> *(esi+4) 0/r32/eax + 6118 89/<- *(edi+4) 0/r32/eax + 6119 # curr-signature = &new-function->next + 6120 # . var tmp/eax: (addr function) = lookup(new-function) + 6121 (lookup *esi *(esi+4)) # => eax + 6122 # . curr-function = &tmp->next + 6123 8d/copy-address *(eax+0x20) 7/r32/edi # Function-next + 6124 # reclaim new-function + 6125 81 0/subop/add %esp 8/imm32 + 6126 # save curr-function + 6127 89/<- *(ebp-4) 7/r32/edi + 6128 # restore edi + 6129 5f/pop-to-edi + 6130 # + 6131 e9/jump $parse-mu:line-loop/disp32 + 6132 } + 6133 # if (slice-equal?(word-slice, "type")) parse a type (struct/record) definition + 6134 { + 6135 $parse-mu:type: + 6136 (slice-equal? %edx "type") # => eax + 6137 3d/compare-eax-and 0/imm32 + 6138 0f 84/jump-if-= break/disp32 + 6139 (next-mu-token %ecx %edx) + 6140 # var type-id/eax: int + 6141 (pos-or-insert-slice Type-id %edx) # => eax + 6142 # spill + 6143 51/push-ecx + 6144 # var new-type/ecx: (handle typeinfo) + 6145 68/push 0/imm32 + 6146 68/push 0/imm32 + 6147 89/<- %ecx 4/r32/esp + 6148 (find-or-create-typeinfo %eax %ecx) + 6149 # + 6150 (lookup *ecx *(ecx+4)) # => eax + 6151 # TODO: ensure that 'line' has nothing else but '{' + 6152 #? (dump-typeinfos "=== aaa\n") + 6153 (populate-mu-type *(ebp+8) %eax *(ebp+0xc) *(ebp+0x10)) # => eax + 6154 #? (dump-typeinfos "=== zzz\n") + 6155 # reclaim new-type + 6156 81 0/subop/add %esp 8/imm32 + 6157 # restore + 6158 59/pop-to-ecx + 6159 e9/jump $parse-mu:line-loop/disp32 + 6160 } + 6161 # otherwise abort + 6162 e9/jump $parse-mu:error1/disp32 + 6163 } # end line loop + 6164 $parse-mu:end: + 6165 # . reclaim locals + 6166 81 0/subop/add %esp 0x20c/imm32 # line + 6167 81 0/subop/add %esp 0xc08/imm32 # vars + 6168 81 0/subop/add %esp 8/imm32 + 6169 # . restore registers + 6170 5f/pop-to-edi + 6171 5e/pop-to-esi + 6172 5b/pop-to-ebx + 6173 5a/pop-to-edx + 6174 59/pop-to-ecx + 6175 58/pop-to-eax + 6176 # . reclaim local + 6177 81 0/subop/add %esp 4/imm32 + 6178 # . epilogue + 6179 89/<- %esp 5/r32/ebp + 6180 5d/pop-to-ebp + 6181 c3/return + 6182 + 6183 $parse-mu:error1: + 6184 # error("unexpected top-level command: " word-slice "\n") + 6185 (write-buffered *(ebp+0xc) "unexpected top-level command: ") + 6186 (write-slice-buffered *(ebp+0xc) %edx) + 6187 (write-buffered *(ebp+0xc) "\n") + 6188 (flush *(ebp+0xc)) + 6189 (stop *(ebp+0x10) 1) + 6190 # never gets here + 6191 + 6192 $parse-mu:error2: + 6193 # error(vars->top " vars not reclaimed after fn '" new-function->name "'\n") + 6194 (write-int32-hex-buffered *(ebp+0xc) *ebx) + 6195 (write-buffered *(ebp+0xc) " vars not reclaimed after fn '") + 6196 (write-slice-buffered *(ebp+0xc) *eax) # Function-name + 6197 (write-buffered *(ebp+0xc) "'\n") + 6198 (flush *(ebp+0xc)) + 6199 (stop *(ebp+0x10) 1) + 6200 # never gets here + 6201 + 6202 # scenarios considered: + 6203 # ✗ fn foo # no block + 6204 # ✓ fn foo { + 6205 # ✗ fn foo { { + 6206 # ✗ fn foo { } + 6207 # ✗ fn foo { } { + 6208 # ✗ fn foo x { + 6209 # ✗ fn foo x: { + 6210 # ✓ fn foo x: int { + 6211 # ✓ fn foo x: int { + 6212 # ✓ fn foo x: int -> y/eax: int { + 6213 # TODO: + 6214 # disallow outputs of type `(... addr ...)` + 6215 # disallow inputs of type `(... addr ... addr ...)` + 6216 populate-mu-function-header: # first-line: (addr stream byte), out: (addr function), vars: (addr stack live-var), err: (addr buffered-file), ed: (addr exit-descriptor) + 6217 # pseudocode: + 6218 # var word-slice: slice + 6219 # next-mu-token(first-line, word-slice) + 6220 # assert(word-slice not in '{' '}' '->') + 6221 # out->name = slice-to-string(word-slice) + 6222 # ## inouts + 6223 # while true + 6224 # word-slice = next-mu-token(first-line) + 6225 # if (word-slice == '{') goto done + 6226 # if (word-slice == '->') break + 6227 # assert(word-slice != '}') + 6228 # var v: (handle var) = parse-var-with-type(word-slice, first-line) + 6229 # assert(v->register == null) + 6230 # # v->block-depth is implicitly 0 + 6231 # out->inouts = append(v, out->inouts) + 6232 # push(vars, {v, false}) + 6233 # ## outputs + 6234 # while true + 6235 # word-slice = next-mu-token(first-line) + 6236 # if (word-slice == '{') break + 6237 # assert(word-slice not in '}' '->') + 6238 # var v: (handle var) = parse-var-with-type(word-slice, first-line) + 6239 # assert(v->register != null) + 6240 # out->outputs = append(v, out->outputs) + 6241 # done: + 6242 # + 6243 # . prologue + 6244 55/push-ebp + 6245 89/<- %ebp 4/r32/esp + 6246 # . save registers + 6247 50/push-eax + 6248 51/push-ecx + 6249 52/push-edx + 6250 53/push-ebx + 6251 57/push-edi + 6252 # edi = out + 6253 8b/-> *(ebp+0xc) 7/r32/edi + 6254 # var word-slice/ecx: slice + 6255 68/push 0/imm32/end + 6256 68/push 0/imm32/start + 6257 89/<- %ecx 4/r32/esp + 6258 # var v/ebx: (handle var) + 6259 68/push 0/imm32 + 6260 68/push 0/imm32 + 6261 89/<- %ebx 4/r32/esp + 6262 # read function name + 6263 (next-mu-token *(ebp+8) %ecx) + 6264 # error checking + 6265 # if (word-slice == '{') abort + 6266 (slice-equal? %ecx "{") # => eax + 6267 3d/compare-eax-and 0/imm32/false + 6268 0f 85/jump-if-!= $populate-mu-function-header:error1/disp32 + 6269 # if (word-slice == '->') abort + 6270 (slice-equal? %ecx "->") # => eax + 6271 3d/compare-eax-and 0/imm32/false + 6272 0f 85/jump-if-!= $populate-mu-function-header:error1/disp32 + 6273 # if (word-slice == '}') abort + 6274 (slice-equal? %ecx "}") # => eax + 6275 3d/compare-eax-and 0/imm32/false + 6276 0f 85/jump-if-!= $populate-mu-function-header:error1/disp32 + 6277 # save function name + 6278 (slice-to-string Heap %ecx %edi) # Function-name + 6279 # save function inouts + 6280 { + 6281 $populate-mu-function-header:check-for-inout: + 6282 (next-mu-token *(ebp+8) %ecx) + 6283 # if (word-slice == '{') goto done + 6284 (slice-equal? %ecx "{") # => eax + 6285 3d/compare-eax-and 0/imm32/false + 6286 0f 85/jump-if-!= $populate-mu-function-header:done/disp32 + 6287 # if (word-slice == '->') break + 6288 (slice-equal? %ecx "->") # => eax + 6289 3d/compare-eax-and 0/imm32/false + 6290 0f 85/jump-if-!= break/disp32 + 6291 # if (word-slice == '}') abort + 6292 (slice-equal? %ecx "}") # => eax + 6293 3d/compare-eax-and 0/imm32/false + 6294 0f 85/jump-if-!= $populate-mu-function-header:error1/disp32 + 6295 # v = parse-var-with-type(word-slice, first-line) + 6296 (parse-var-with-type %ecx *(ebp+8) %ebx *(ebp+0x14) *(ebp+0x18)) + 6297 # assert(v->register == null) + 6298 # . eax: (addr var) = lookup(v) + 6299 (lookup *ebx *(ebx+4)) # => eax + 6300 81 7/subop/compare *(eax+0x18) 0/imm32 # Var-register + 6301 0f 85/jump-if-!= $populate-mu-function-header:error2/disp32 + 6302 # v->block-depth is implicitly 0 + 6303 # + 6304 # out->inouts = append(v, out->inouts) + 6305 8d/copy-address *(edi+8) 0/r32/eax # Function-inouts + 6306 (append-list Heap *ebx *(ebx+4) *(edi+8) *(edi+0xc) %eax) # Function-inouts, Function-inouts + 6307 # push(vars, {v, false}) + 6308 (push *(ebp+0x10) *ebx) + 6309 (push *(ebp+0x10) *(ebx+4)) + 6310 (push *(ebp+0x10) 0) # false + 6311 # + 6312 e9/jump loop/disp32 + 6313 } + 6314 # save function outputs + 6315 { + 6316 $populate-mu-function-header:check-for-out: + 6317 (next-mu-token *(ebp+8) %ecx) + 6318 # if (word-slice == '{') break + 6319 (slice-equal? %ecx "{") # => eax + 6320 3d/compare-eax-and 0/imm32/false + 6321 0f 85/jump-if-!= break/disp32 + 6322 # if (word-slice == '->') abort + 6323 (slice-equal? %ecx "->") # => eax + 6324 3d/compare-eax-and 0/imm32/false + 6325 0f 85/jump-if-!= $populate-mu-function-header:error1/disp32 + 6326 # if (word-slice == '}') abort + 6327 (slice-equal? %ecx "}") # => eax + 6328 3d/compare-eax-and 0/imm32/false + 6329 0f 85/jump-if-!= $populate-mu-function-header:error1/disp32 + 6330 # v = parse-var-with-type(word-slice, first-line) + 6331 (parse-var-with-type %ecx *(ebp+8) %ebx *(ebp+0x14) *(ebp+0x18)) + 6332 # assert(var->register != null) + 6333 # . eax: (addr var) = lookup(v) + 6334 (lookup *ebx *(ebx+4)) # => eax + 6335 81 7/subop/compare *(eax+0x18) 0/imm32 # Var-register + 6336 0f 84/jump-if-= $populate-mu-function-header:error3/disp32 + 6337 # out->outputs = append(v, out->outputs) + 6338 8d/copy-address *(edi+0x10) 0/r32/eax # Function-outputs + 6339 (append-list Heap *ebx *(ebx+4) *(edi+0x10) *(edi+0x14) %eax) # Function-outputs, Function-outputs + 6340 # + 6341 e9/jump loop/disp32 + 6342 } + 6343 $populate-mu-function-header:done: + 6344 (check-no-tokens-left *(ebp+8)) + 6345 $populate-mu-function-header:end: + 6346 # . reclaim locals + 6347 81 0/subop/add %esp 0x10/imm32 + 6348 # . restore registers + 6349 5f/pop-to-edi + 6350 5b/pop-to-ebx + 6351 5a/pop-to-edx + 6352 59/pop-to-ecx + 6353 58/pop-to-eax + 6354 # . epilogue + 6355 89/<- %esp 5/r32/ebp + 6356 5d/pop-to-ebp + 6357 c3/return + 6358 + 6359 $populate-mu-function-header:error1: + 6360 # error("function header not in form 'fn <name> {'") + 6361 (write-buffered *(ebp+0x14) "function header not in form 'fn <name> [inouts] [-> outputs] {' -- '") + 6362 (flush *(ebp+0x14)) + 6363 (rewind-stream *(ebp+8)) + 6364 (write-stream-data *(ebp+0x14) *(ebp+8)) + 6365 (write-buffered *(ebp+0x14) "'\n") + 6366 (flush *(ebp+0x14)) + 6367 (stop *(ebp+0x18) 1) + 6368 # never gets here + 6369 + 6370 $populate-mu-function-header:error2: + 6371 # error("fn " fn ": function inout '" var "' cannot be in a register") + 6372 (write-buffered *(ebp+0x14) "fn ") + 6373 50/push-eax + 6374 (lookup *edi *(edi+4)) # Function-name Function-name => eax + 6375 (write-buffered *(ebp+0x14) %eax) + 6376 58/pop-to-eax + 6377 (write-buffered *(ebp+0x14) ": function inout '") + 6378 (lookup *eax *(eax+4)) # Var-name Var-name => eax + 6379 (write-buffered *(ebp+0x10) %eax) + 6380 (write-buffered *(ebp+0x14) "' cannot be in a register") + 6381 (flush *(ebp+0x14)) + 6382 (stop *(ebp+0x18) 1) + 6383 # never gets here + 6384 + 6385 $populate-mu-function-header:error3: + 6386 # error("fn " fn ": function output '" var "' must be in a register") + 6387 (write-buffered *(ebp+0x14) "fn ") + 6388 50/push-eax + 6389 (lookup *edi *(edi+4)) # Function-name Function-name => eax + 6390 (write-buffered *(ebp+0x14) %eax) + 6391 58/pop-to-eax + 6392 (write-buffered *(ebp+0x14) ": function output '") + 6393 (lookup *ebx *(ebx+4)) # => eax + 6394 (lookup *eax *(eax+4)) # Var-name Var-name => eax + 6395 (write-buffered *(ebp+0x14) %eax) + 6396 (write-buffered *(ebp+0x14) "' must be in a register, in instruction '") + 6397 (rewind-stream *(ebp+8)) + 6398 (write-stream-data *(ebp+0x14) *(ebp+8)) + 6399 (write-buffered *(ebp+0x14) "'\n") + 6400 (flush *(ebp+0x14)) + 6401 (stop *(ebp+0x18) 1) + 6402 # never gets here + 6403 + 6404 # scenarios considered: + 6405 # ✓ fn foo + 6406 # ✗ fn foo { + 6407 # ✓ fn foo x + 6408 # ✓ fn foo x: int + 6409 # ✓ fn foo x: int -> y/eax: int + 6410 # TODO: + 6411 # disallow outputs of type `(... addr ...)` + 6412 # disallow inputs of type `(... addr ... addr ...)` + 6413 populate-mu-function-signature: # first-line: (addr stream byte), out: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) + 6414 # pseudocode: + 6415 # var word-slice: slice + 6416 # next-mu-token(first-line, word-slice) + 6417 # assert(word-slice not in '{' '}' '->') + 6418 # out->name = slice-to-string(word-slice) + 6419 # ## inouts + 6420 # while true + 6421 # word-slice = next-mu-token(first-line) + 6422 # if slice-empty?(word-slice) break + 6423 # if (word-slice == '->') break + 6424 # assert(word-slice not in '{' '}') + 6425 # var v: (handle var) = parse-var-with-type(word-slice, first-line) + 6426 # assert(v->register == null) + 6427 # # v->block-depth is implicitly 0 + 6428 # out->inouts = append(v, out->inouts) + 6429 # ## outputs + 6430 # while true + 6431 # word-slice = next-mu-token(first-line) + 6432 # if slice-empty?(word-slice) break + 6433 # assert(word-slice not in '{' '}' '->') + 6434 # var v: (handle var) = parse-var-with-type(word-slice, first-line) + 6435 # assert(v->register != null) + 6436 # out->outputs = append(v, out->outputs) + 6437 # + 6438 # . prologue + 6439 55/push-ebp + 6440 89/<- %ebp 4/r32/esp + 6441 # . save registers + 6442 50/push-eax + 6443 51/push-ecx + 6444 52/push-edx + 6445 53/push-ebx + 6446 57/push-edi + 6447 # edi = out + 6448 8b/-> *(ebp+0xc) 7/r32/edi + 6449 # var word-slice/ecx: slice + 6450 68/push 0/imm32/end + 6451 68/push 0/imm32/start + 6452 89/<- %ecx 4/r32/esp + 6453 # var v/ebx: (handle var) + 6454 68/push 0/imm32 + 6455 68/push 0/imm32 + 6456 89/<- %ebx 4/r32/esp + 6457 # read function name + 6458 (next-mu-token *(ebp+8) %ecx) + 6459 # error checking + 6460 # if (word-slice == '{') abort + 6461 (slice-equal? %ecx "{") # => eax + 6462 3d/compare-eax-and 0/imm32/false + 6463 0f 85/jump-if-!= $populate-mu-function-signature:error1/disp32 + 6464 # if (word-slice == '->') abort + 6465 (slice-equal? %ecx "->") # => eax + 6466 3d/compare-eax-and 0/imm32/false + 6467 0f 85/jump-if-!= $populate-mu-function-signature:error1/disp32 + 6468 # if (word-slice == '}') abort + 6469 (slice-equal? %ecx "}") # => eax + 6470 3d/compare-eax-and 0/imm32/false + 6471 0f 85/jump-if-!= $populate-mu-function-signature:error1/disp32 + 6472 # save function name + 6473 (slice-to-string Heap %ecx %edi) # Function-name + 6474 # save function inouts + 6475 { + 6476 $populate-mu-function-signature:check-for-inout: + 6477 (next-mu-token *(ebp+8) %ecx) + 6478 (slice-empty? %ecx) # => eax + 6479 3d/compare-eax-and 0/imm32/false + 6480 0f 85/jump-if-!= break/disp32 + 6481 # if (word-slice == '->') break + 6482 (slice-equal? %ecx "->") # => eax + 6483 3d/compare-eax-and 0/imm32/false + 6484 0f 85/jump-if-!= break/disp32 + 6485 # if (word-slice == '{') abort + 6486 (slice-equal? %ecx "{") # => eax + 6487 3d/compare-eax-and 0/imm32/false + 6488 0f 85/jump-if-!= $populate-mu-function-signature:error1/disp32 + 6489 # if (word-slice == '}') abort + 6490 (slice-equal? %ecx "}") # => eax + 6491 3d/compare-eax-and 0/imm32/false + 6492 0f 85/jump-if-!= $populate-mu-function-signature:error1/disp32 + 6493 # v = parse-var-with-type(word-slice, first-line) + 6494 (parse-var-with-type %ecx *(ebp+8) %ebx *(ebp+0x10) *(ebp+0x14)) + 6495 # assert(v->register == null) + 6496 # . eax: (addr var) = lookup(v) + 6497 (lookup *ebx *(ebx+4)) # => eax + 6498 81 7/subop/compare *(eax+0x18) 0/imm32 # Var-register + 6499 0f 85/jump-if-!= $populate-mu-function-signature:error2/disp32 + 6500 # v->block-depth is implicitly 0 + 6501 # + 6502 # out->inouts = append(v, out->inouts) + 6503 8d/copy-address *(edi+8) 0/r32/eax # Function-inouts + 6504 (append-list Heap *ebx *(ebx+4) *(edi+8) *(edi+0xc) %eax) # Function-inouts, Function-inouts + 6505 # + 6506 e9/jump loop/disp32 + 6507 } + 6508 # save function outputs + 6509 { + 6510 $populate-mu-function-signature:check-for-out: + 6511 (next-mu-token *(ebp+8) %ecx) + 6512 (slice-empty? %ecx) # => eax + 6513 3d/compare-eax-and 0/imm32/false + 6514 0f 85/jump-if-!= break/disp32 + 6515 # if (word-slice == '{') abort + 6516 (slice-equal? %ecx "{") # => eax + 6517 3d/compare-eax-and 0/imm32/false + 6518 0f 85/jump-if-!= $populate-mu-function-signature:error1/disp32 + 6519 # if (word-slice == '->') abort + 6520 (slice-equal? %ecx "->") # => eax + 6521 3d/compare-eax-and 0/imm32/false + 6522 0f 85/jump-if-!= $populate-mu-function-signature:error1/disp32 + 6523 # if (word-slice == '}') abort + 6524 (slice-equal? %ecx "}") # => eax + 6525 3d/compare-eax-and 0/imm32/false + 6526 0f 85/jump-if-!= $populate-mu-function-signature:error1/disp32 + 6527 # v = parse-var-with-type(word-slice, first-line) + 6528 (parse-var-with-type %ecx *(ebp+8) %ebx *(ebp+0x10) *(ebp+0x14)) + 6529 # assert(var->register != null) + 6530 # . eax: (addr var) = lookup(v) + 6531 (lookup *ebx *(ebx+4)) # => eax + 6532 81 7/subop/compare *(eax+0x18) 0/imm32 # Var-register + 6533 0f 84/jump-if-= $populate-mu-function-signature:error3/disp32 + 6534 # out->outputs = append(v, out->outputs) + 6535 8d/copy-address *(edi+0x10) 0/r32/eax # Function-outputs + 6536 (append-list Heap *ebx *(ebx+4) *(edi+0x10) *(edi+0x14) %eax) # Function-outputs, Function-outputs + 6537 # + 6538 e9/jump loop/disp32 + 6539 } + 6540 $populate-mu-function-signature:done: + 6541 (check-no-tokens-left *(ebp+8)) + 6542 $populate-mu-function-signature:end: + 6543 # . reclaim locals + 6544 81 0/subop/add %esp 0x10/imm32 + 6545 # . restore registers + 6546 5f/pop-to-edi + 6547 5b/pop-to-ebx + 6548 5a/pop-to-edx + 6549 59/pop-to-ecx + 6550 58/pop-to-eax + 6551 # . epilogue + 6552 89/<- %esp 5/r32/ebp + 6553 5d/pop-to-ebp + 6554 c3/return + 6555 + 6556 $populate-mu-function-signature:error1: + 6557 # error("function signature not in form 'fn <name> {'") + 6558 (write-buffered *(ebp+0x10) "function signature not in form 'fn <name> [inouts] [-> outputs] {' -- '") + 6559 (flush *(ebp+0x10)) + 6560 (rewind-stream *(ebp+8)) + 6561 (write-stream-data *(ebp+0x10) *(ebp+8)) + 6562 (write-buffered *(ebp+0x10) "'\n") + 6563 (flush *(ebp+0x10)) + 6564 (stop *(ebp+0x14) 1) + 6565 # never gets here + 6566 + 6567 $populate-mu-function-signature:error2: + 6568 # error("fn " fn ": function inout '" var "' cannot be in a register") + 6569 (write-buffered *(ebp+0x10) "fn ") + 6570 50/push-eax + 6571 (lookup *edi *(edi+4)) # Function-name Function-name => eax + 6572 (write-buffered *(ebp+0x10) %eax) + 6573 58/pop-to-eax + 6574 (write-buffered *(ebp+0x10) ": function inout '") + 6575 (lookup *eax *(eax+4)) # Var-name Var-name => eax + 6576 (write-buffered *(ebp+0x10) %eax) + 6577 (write-buffered *(ebp+0x10) "' cannot be in a register") + 6578 (flush *(ebp+0x10)) + 6579 (stop *(ebp+0x14) 1) + 6580 # never gets here + 6581 + 6582 $populate-mu-function-signature:error3: + 6583 # error("fn " fn ": function output '" var "' must be in a register") + 6584 (write-buffered *(ebp+0x10) "fn ") + 6585 50/push-eax + 6586 (lookup *edi *(edi+4)) # Function-name Function-name => eax + 6587 (write-buffered *(ebp+0x10) %eax) + 6588 58/pop-to-eax + 6589 (write-buffered *(ebp+0x10) ": function output '") + 6590 (lookup *ebx *(ebx+4)) # => eax + 6591 (lookup *eax *(eax+4)) # Var-name Var-name => eax + 6592 (write-buffered *(ebp+0x10) %eax) + 6593 (write-buffered *(ebp+0x10) "' must be in a register, in instruction '") + 6594 (rewind-stream *(ebp+8)) + 6595 (write-stream-data *(ebp+0x10) *(ebp+8)) + 6596 (write-buffered *(ebp+0x10) "'\n") + 6597 (flush *(ebp+0x10)) + 6598 (stop *(ebp+0x14) 1) + 6599 # never gets here + 6600 + 6601 test-function-header-with-arg: + 6602 # . prologue + 6603 55/push-ebp + 6604 89/<- %ebp 4/r32/esp + 6605 # setup + 6606 (clear-stream _test-input-stream) + 6607 (write _test-input-stream "foo n: int {\n") + 6608 # var result/ecx: function + 6609 2b/subtract *Function-size 4/r32/esp + 6610 89/<- %ecx 4/r32/esp + 6611 (zero-out %ecx *Function-size) + 6612 # var vars/ebx: (stack live-var 16) + 6613 81 5/subop/subtract %esp 0xc0/imm32 + 6614 68/push 0xc0/imm32/size + 6615 68/push 0/imm32/top + 6616 89/<- %ebx 4/r32/esp + 6617 # convert + 6618 (populate-mu-function-header _test-input-stream %ecx %ebx Stderr 0) + 6619 # check result->name + 6620 (lookup *ecx *(ecx+4)) # Function-name Function-name => eax + 6621 (check-strings-equal %eax "foo" "F - test-function-header-with-arg/name") + 6622 # var v/edx: (addr var) = result->inouts->value + 6623 (lookup *(ecx+8) *(ecx+0xc)) # Function-inouts Function-inouts => eax + 6624 (lookup *eax *(eax+4)) # List-value List-value => eax + 6625 89/<- %edx 0/r32/eax + 6626 # check v->name + 6627 (lookup *edx *(edx+4)) # Var-name Var-name => eax + 6628 (check-strings-equal %eax "n" "F - test-function-header-with-arg/inout:0") + 6629 # check v->type + 6630 (lookup *(edx+8) *(edx+0xc)) # Var-type Var-type => eax + 6631 (check-ints-equal *eax 1 "F - test-function-header-with-arg/inout:0/type:0") # Type-tree-is-atom + 6632 (check-ints-equal *(eax+4) 1 "F - test-function-header-with-arg/inout:0/type:1") # Type-tree-value + 6633 (check-ints-equal *(eax+0xc) 0 "F - test-function-header-with-arg/inout:0/type:2") # Type-tree-right + 6634 # . epilogue + 6635 89/<- %esp 5/r32/ebp + 6636 5d/pop-to-ebp + 6637 c3/return + 6638 + 6639 test-function-header-with-multiple-args: + 6640 # . prologue + 6641 55/push-ebp + 6642 89/<- %ebp 4/r32/esp + 6643 # setup + 6644 (clear-stream _test-input-stream) + 6645 (write _test-input-stream "foo a: int, b: int c: int {\n") + 6646 # result/ecx: function + 6647 2b/subtract *Function-size 4/r32/esp + 6648 89/<- %ecx 4/r32/esp + 6649 (zero-out %ecx *Function-size) + 6650 # var vars/ebx: (stack live-var 16) + 6651 81 5/subop/subtract %esp 0xc0/imm32 + 6652 68/push 0xc0/imm32/size + 6653 68/push 0/imm32/top + 6654 89/<- %ebx 4/r32/esp + 6655 # convert + 6656 (populate-mu-function-header _test-input-stream %ecx %ebx Stderr 0) + 6657 # check result->name + 6658 (lookup *ecx *(ecx+4)) # Function-name Function-name => eax + 6659 (check-strings-equal %eax "foo" "F - test-function-header-with-multiple-args/name") + 6660 # var inouts/edx: (addr list var) = lookup(result->inouts) + 6661 (lookup *(ecx+8) *(ecx+0xc)) # Function-inouts Function-inouts => eax + 6662 89/<- %edx 0/r32/eax + 6663 $test-function-header-with-multiple-args:inout0: + 6664 # var v/ebx: (addr var) = lookup(inouts->value) + 6665 (lookup *edx *(edx+4)) # List-value List-value => eax + 6666 89/<- %ebx 0/r32/eax + 6667 # check v->name + 6668 (lookup *ebx *(ebx+4)) # Var-name Var-name => eax + 6669 (check-strings-equal %eax "a" "F - test-function-header-with-multiple-args/inout:0") # Var-name + 6670 # check v->type + 6671 (lookup *(ebx+8) *(ebx+0xc)) # Var-type Var-type => eax + 6672 (check-ints-equal *eax 1 "F - test-function-header-with-multiple-args/inout:0/type:0") # Type-tree-is-atom + 6673 (check-ints-equal *(eax+4) 1 "F - test-function-header-with-multiple-args/inout:0/type:1") # Type-tree-value + 6674 (check-ints-equal *(eax+0xc) 0 "F - test-function-header-with-multiple-args/inout:0/type:2") # Type-tree-right + 6675 $test-function-header-with-multiple-args:inout1: + 6676 # inouts = lookup(inouts->next) + 6677 (lookup *(edx+8) *(edx+0xc)) # List-next List-next => eax + 6678 89/<- %edx 0/r32/eax + 6679 # v = lookup(inouts->value) + 6680 (lookup *edx *(edx+4)) # List-value List-value => eax + 6681 89/<- %ebx 0/r32/eax + 6682 # check v->name + 6683 (lookup *ebx *(ebx+4)) # Var-name Var-name => eax + 6684 (check-strings-equal %eax "b" "F - test-function-header-with-multiple-args/inout:1") # Var-name + 6685 # check v->type + 6686 (lookup *(ebx+8) *(ebx+0xc)) # Var-type Var-type => eax + 6687 (check-ints-equal *eax 1 "F - test-function-header-with-multiple-args/inout:1/type:0") # Type-tree-is-atom + 6688 (check-ints-equal *(eax+4) 1 "F - test-function-header-with-multiple-args/inout:1/type:1") # Type-tree-value + 6689 (check-ints-equal *(eax+0xc) 0 "F - test-function-header-with-multiple-args/inout:1/type:2") # Type-tree-right + 6690 $test-function-header-with-multiple-args:inout2: + 6691 # inouts = lookup(inouts->next) + 6692 (lookup *(edx+8) *(edx+0xc)) # List-next List-next => eax + 6693 89/<- %edx 0/r32/eax + 6694 # v = lookup(inouts->value) + 6695 (lookup *edx *(edx+4)) # List-value List-value => eax + 6696 89/<- %ebx 0/r32/eax + 6697 # check v->name + 6698 (lookup *ebx *(ebx+4)) # Var-name Var-name => eax + 6699 (check-strings-equal %eax "c" "F - test-function-header-with-multiple-args/inout:2") # Var-name + 6700 # check v->type + 6701 (lookup *(ebx+8) *(ebx+0xc)) # Var-type Var-type => eax + 6702 (check-ints-equal *eax 1 "F - test-function-header-with-multiple-args/inout:2/type:0") # Type-tree-is-atom + 6703 (check-ints-equal *(eax+4) 1 "F - test-function-header-with-multiple-args/inout:2/type:1") # Type-tree-value + 6704 (check-ints-equal *(eax+0xc) 0 "F - test-function-header-with-multiple-args/inout:2/type:2") # Type-tree-right + 6705 # . epilogue + 6706 89/<- %esp 5/r32/ebp + 6707 5d/pop-to-ebp + 6708 c3/return + 6709 + 6710 test-function-header-with-multiple-args-and-outputs: + 6711 # . prologue + 6712 55/push-ebp + 6713 89/<- %ebp 4/r32/esp + 6714 # setup + 6715 (clear-stream _test-input-stream) + 6716 (write _test-input-stream "foo a: int, b: int, c: int -> x/ecx: int y/edx: int {\n") + 6717 # result/ecx: function + 6718 2b/subtract *Function-size 4/r32/esp + 6719 89/<- %ecx 4/r32/esp + 6720 (zero-out %ecx *Function-size) + 6721 # var vars/ebx: (stack live-var 16) + 6722 81 5/subop/subtract %esp 0xc0/imm32 + 6723 68/push 0xc0/imm32/size + 6724 68/push 0/imm32/top + 6725 89/<- %ebx 4/r32/esp + 6726 # convert + 6727 (populate-mu-function-header _test-input-stream %ecx %ebx Stderr 0) + 6728 # check result->name + 6729 (lookup *ecx *(ecx+4)) # Function-name Function-name => eax + 6730 (check-strings-equal %eax "foo" "F - test-function-header-with-multiple-args-and-outputs/name") + 6731 # var inouts/edx: (addr list var) = lookup(result->inouts) + 6732 (lookup *(ecx+8) *(ecx+0xc)) # Function-inouts Function-inouts => eax + 6733 89/<- %edx 0/r32/eax + 6734 $test-function-header-with-multiple-args-and-outputs:inout0: + 6735 # var v/ebx: (addr var) = lookup(inouts->value) + 6736 (lookup *edx *(edx+4)) # List-value List-value => eax + 6737 89/<- %ebx 0/r32/eax + 6738 # check v->name + 6739 (lookup *ebx *(ebx+4)) # Var-name Var-name => eax + 6740 (check-strings-equal %eax "a" "F - test-function-header-with-multiple-args-and-outputs/inout:0") + 6741 # check v->type + 6742 (lookup *(ebx+8) *(ebx+0xc)) # Var-type Var-type => eax + 6743 (check-ints-equal *eax 1 "F - test-function-header-with-multiple-args-and-outputs/inout:0/type:0") # Type-tree-is-atom + 6744 (check-ints-equal *(eax+4) 1 "F - test-function-header-with-multiple-args-and-outputs/inout:0/type:1") # Type-tree-value + 6745 (check-ints-equal *(eax+0xc) 0 "F - test-function-header-with-multiple-args-and-outputs/inout:0/type:2") # Type-tree-right + 6746 $test-function-header-with-multiple-args-and-outputs:inout1: + 6747 # inouts = lookup(inouts->next) + 6748 (lookup *(edx+8) *(edx+0xc)) # List-next List-next => eax + 6749 89/<- %edx 0/r32/eax + 6750 # v = lookup(inouts->value) + 6751 (lookup *edx *(edx+4)) # List-value List-value => eax + 6752 89/<- %ebx 0/r32/eax + 6753 # check v->name + 6754 (lookup *ebx *(ebx+4)) # Var-name Var-name => eax + 6755 (check-strings-equal %eax "b" "F - test-function-header-with-multiple-args-and-outputs/inout:1") + 6756 # check v->type + 6757 (lookup *(ebx+8) *(ebx+0xc)) # Var-type Var-type => eax + 6758 (check-ints-equal *eax 1 "F - test-function-header-with-multiple-args-and-outputs/inout:1/type:0") # Type-tree-is-atom + 6759 (check-ints-equal *(eax+4) 1 "F - test-function-header-with-multiple-args-and-outputs/inout:1/type:1") # Type-tree-value + 6760 (check-ints-equal *(eax+0xc) 0 "F - test-function-header-with-multiple-args-and-outputs/inout:1/type:2") # Type-tree-right + 6761 $test-function-header-with-multiple-args-and-outputs:inout2: + 6762 # inouts = lookup(inouts->next) + 6763 (lookup *(edx+8) *(edx+0xc)) # List-next List-next => eax + 6764 89/<- %edx 0/r32/eax + 6765 # v = lookup(inouts->value) + 6766 (lookup *edx *(edx+4)) # List-value List-value => eax + 6767 89/<- %ebx 0/r32/eax + 6768 # check v->name + 6769 (lookup *ebx *(ebx+4)) # Var-name Var-name => eax + 6770 (check-strings-equal %eax "c" "F - test-function-header-with-multiple-args-and-outputs/inout:2") + 6771 # check v->type + 6772 (lookup *(ebx+8) *(ebx+0xc)) # Var-type Var-type => eax + 6773 (check-ints-equal *eax 1 "F - test-function-header-with-multiple-args-and-outputs/inout:2/type:0") # Type-tree-is-atom + 6774 (check-ints-equal *(eax+4) 1 "F - test-function-header-with-multiple-args-and-outputs/inout:2/type:1") # Type-tree-value + 6775 (check-ints-equal *(eax+0xc) 0 "F - test-function-header-with-multiple-args-and-outputs/inout:2/type:2") # Type-tree-right + 6776 $test-function-header-with-multiple-args-and-outputs:out0: + 6777 # var outputs/edx: (addr list var) = lookup(result->outputs) + 6778 (lookup *(ecx+0x10) *(ecx+0x14)) # Function-outputs Function-outputs => eax + 6779 89/<- %edx 0/r32/eax + 6780 # v = lookup(outputs->value) + 6781 (lookup *edx *(edx+4)) # List-value List-value => eax + 6782 89/<- %ebx 0/r32/eax + 6783 # check v->name + 6784 (lookup *ebx *(ebx+4)) # Var-name Var-name => eax + 6785 (check-strings-equal %eax "x" "F - test-function-header-with-multiple-args-and-outputs/output:0") + 6786 # check v->register + 6787 (lookup *(ebx+0x18) *(ebx+0x1c)) # Var-register Var-register => eax + 6788 (check-strings-equal %eax "ecx" "F - test-function-header-with-multiple-args-and-outputs/output:0/register") + 6789 # check v->type + 6790 (lookup *(ebx+8) *(ebx+0xc)) # Var-type Var-type => eax + 6791 (check-ints-equal *eax 1 "F - test-function-header-with-multiple-args-and-outputs/output:0/type:0") # Type-tree-is-atom + 6792 (check-ints-equal *(eax+4) 1 "F - test-function-header-with-multiple-args-and-outputs/output:0/type:1") # Type-tree-value + 6793 (check-ints-equal *(eax+0xc) 0 "F - test-function-header-with-multiple-args-and-outputs/output:0/type:2") # Type-tree-right + 6794 $test-function-header-with-multiple-args-and-outputs:out1: + 6795 # outputs = lookup(outputs->next) + 6796 (lookup *(edx+8) *(edx+0xc)) # List-next List-next => eax + 6797 89/<- %edx 0/r32/eax + 6798 # v = lookup(inouts->value) + 6799 (lookup *edx *(edx+4)) # List-value List-value => eax + 6800 89/<- %ebx 0/r32/eax + 6801 # check v->name + 6802 (lookup *ebx *(ebx+4)) # Var-name Var-name => eax + 6803 (check-strings-equal %eax "y" "F - test-function-header-with-multiple-args-and-outputs/output:1") + 6804 # check v->register + 6805 (lookup *(ebx+0x18) *(ebx+0x1c)) # Var-register Var-register => eax + 6806 (check-strings-equal %eax "edx" "F - test-function-header-with-multiple-args-and-outputs/output:1/register") + 6807 # check v->type + 6808 (lookup *(ebx+8) *(ebx+0xc)) # Var-type Var-type => eax + 6809 (check-ints-equal *eax 1 "F - test-function-header-with-multiple-args-and-outputs/output:1/type:0") # Type-tree-is-atom + 6810 (check-ints-equal *(eax+4) 1 "F - test-function-header-with-multiple-args-and-outputs/output:1/type:1") # Type-tree-value + 6811 (check-ints-equal *(eax+0c) 0 "F - test-function-header-with-multiple-args-and-outputs/output:1/type:2") # Type-tree-right + 6812 # . epilogue + 6813 89/<- %esp 5/r32/ebp + 6814 5d/pop-to-ebp + 6815 c3/return + 6816 + 6817 # format for variables with types + 6818 # x: int + 6819 # x: int, + 6820 # x/eax: int + 6821 # x/eax: int, + 6822 # ignores at most one trailing comma + 6823 # WARNING: modifies name + 6824 parse-var-with-type: # name: (addr slice), first-line: (addr stream byte), out: (addr handle var), err: (addr buffered-file), ed: (addr exit-descriptor) + 6825 # pseudocode: + 6826 # var s: slice + 6827 # if (!slice-ends-with(name, ":")) + 6828 # abort + 6829 # --name->end to skip ':' + 6830 # next-token-from-slice(name->start, name->end, '/', s) + 6831 # new-var-from-slice(s, out) + 6832 # ## register + 6833 # next-token-from-slice(s->end, name->end, '/', s) + 6834 # if (!slice-empty?(s)) + 6835 # out->register = slice-to-string(s) + 6836 # ## type + 6837 # var type: (handle type-tree) = parse-type(first-line) + 6838 # out->type = type + 6839 # + 6840 # . prologue + 6841 55/push-ebp + 6842 89/<- %ebp 4/r32/esp + 6843 # . save registers + 6844 50/push-eax + 6845 51/push-ecx + 6846 52/push-edx + 6847 53/push-ebx + 6848 56/push-esi + 6849 57/push-edi + 6850 # esi = name + 6851 8b/-> *(ebp+8) 6/r32/esi + 6852 # if (!slice-ends-with?(name, ":")) abort + 6853 8b/-> *(esi+4) 1/r32/ecx # Slice-end + 6854 49/decrement-ecx + 6855 8a/copy-byte *ecx 1/r32/CL + 6856 81 4/subop/and %ecx 0xff/imm32 + 6857 81 7/subop/compare %ecx 0x3a/imm32/colon + 6858 0f 85/jump-if-!= $parse-var-with-type:abort/disp32 + 6859 # --name->end to skip ':' + 6860 ff 1/subop/decrement *(esi+4) + 6861 # var s/ecx: slice + 6862 68/push 0/imm32/end + 6863 68/push 0/imm32/start + 6864 89/<- %ecx 4/r32/esp + 6865 $parse-var-with-type:parse-name: + 6866 (next-token-from-slice *esi *(esi+4) 0x2f %ecx) # Slice-start, Slice-end, '/' + 6867 $parse-var-with-type:create-var: + 6868 # new-var-from-slice(s, out) + 6869 (new-var-from-slice Heap %ecx *(ebp+0x10)) + 6870 # save out->register + 6871 $parse-var-with-type:save-register: + 6872 # . var out-addr/edi: (addr var) = lookup(*out) + 6873 8b/-> *(ebp+0x10) 7/r32/edi + 6874 (lookup *edi *(edi+4)) # => eax + 6875 89/<- %edi 0/r32/eax + 6876 # . s = next-token(...) + 6877 (next-token-from-slice *(ecx+4) *(esi+4) 0x2f %ecx) # s->end, name->end, '/' + 6878 # . if (!slice-empty?(s)) out->register = slice-to-string(s) + 6879 { + 6880 $parse-var-with-type:write-register: + 6881 (slice-empty? %ecx) # => eax + 6882 3d/compare-eax-and 0/imm32/false + 6883 75/jump-if-!= break/disp8 + 6884 # out->register = slice-to-string(s) + 6885 8d/copy-address *(edi+0x18) 0/r32/eax # Var-register + 6886 (slice-to-string Heap %ecx %eax) + 6887 } + 6888 $parse-var-with-type:save-type: + 6889 8d/copy-address *(edi+8) 0/r32/eax # Var-type + 6890 (parse-type Heap *(ebp+0xc) %eax *(ebp+0x14) *(ebp+0x18)) + 6891 $parse-var-with-type:end: + 6892 # . reclaim locals + 6893 81 0/subop/add %esp 8/imm32 + 6894 # . restore registers + 6895 5f/pop-to-edi + 6896 5e/pop-to-esi + 6897 5b/pop-to-ebx + 6898 5a/pop-to-edx + 6899 59/pop-to-ecx + 6900 58/pop-to-eax + 6901 # . epilogue + 6902 89/<- %esp 5/r32/ebp + 6903 5d/pop-to-ebp + 6904 c3/return + 6905 + 6906 $parse-var-with-type:abort: + 6907 # error("var should have form 'name: type' in '" line "'\n") + 6908 (write-buffered *(ebp+0x14) "var should have form 'name: type' in '") + 6909 (flush *(ebp+0x14)) + 6910 (rewind-stream *(ebp+0xc)) + 6911 (write-stream-data *(ebp+0x14) *(ebp+0xc)) + 6912 (write-buffered *(ebp+0x14) "'\n") + 6913 (flush *(ebp+0x14)) + 6914 (stop *(ebp+0x18) 1) + 6915 # never gets here + 6916 + 6917 parse-type: # ad: (addr allocation-descriptor), in: (addr stream byte), out: (addr handle type-tree), err: (addr buffered-file), ed: (addr exit-descriptor) + 6918 # pseudocode: + 6919 # var s: slice = next-mu-token(in) + 6920 # assert s != "" + 6921 # assert s != "->" + 6922 # assert s != "{" + 6923 # assert s != "}" + 6924 # if s == ")" + 6925 # return + 6926 # out = allocate(Type-tree) + 6927 # if s != "(" + 6928 # HACK: if s is an int, parse and return it + 6929 # out->left-is-atom? = true + 6930 # out->value = pos-or-insert-slice(Type-id, s) + 6931 # return + 6932 # out->left = parse-type(ad, in) + 6933 # out->right = parse-type-tree(ad, in) + 6934 # + 6935 # . prologue + 6936 55/push-ebp + 6937 89/<- %ebp 4/r32/esp + 6938 # . save registers + 6939 50/push-eax + 6940 51/push-ecx + 6941 52/push-edx + 6942 # clear out + 6943 (zero-out *(ebp+0x10) *Handle-size) + 6944 # var s/ecx: slice + 6945 68/push 0/imm32 + 6946 68/push 0/imm32 + 6947 89/<- %ecx 4/r32/esp + 6948 # s = next-mu-token(in) + 6949 (next-mu-token *(ebp+0xc) %ecx) + 6950 #? (write-buffered Stderr "tok: ") + 6951 #? (write-slice-buffered Stderr %ecx) + 6952 #? (write-buffered Stderr "$\n") + 6953 #? (flush Stderr) + 6954 # assert s != "" + 6955 (slice-equal? %ecx "") # => eax + 6956 3d/compare-eax-and 0/imm32/false + 6957 0f 85/jump-if-!= $parse-type:abort/disp32 + 6958 # assert s != "{" + 6959 (slice-equal? %ecx "{") # => eax + 6960 3d/compare-eax-and 0/imm32/false + 6961 0f 85/jump-if-!= $parse-type:abort/disp32 + 6962 # assert s != "}" + 6963 (slice-equal? %ecx "}") # => eax + 6964 3d/compare-eax-and 0/imm32/false + 6965 0f 85/jump-if-!= $parse-type:abort/disp32 + 6966 # assert s != "->" + 6967 (slice-equal? %ecx "->") # => eax + 6968 3d/compare-eax-and 0/imm32/false + 6969 0f 85/jump-if-!= $parse-type:abort/disp32 + 6970 # if (s == ")") return + 6971 (slice-equal? %ecx ")") # => eax + 6972 3d/compare-eax-and 0/imm32/false + 6973 0f 85/jump-if-!= $parse-type:end/disp32 + 6974 # out = new tree + 6975 (allocate *(ebp+8) *Type-tree-size *(ebp+0x10)) + 6976 # var out-addr/edx: (addr type-tree) = lookup(*out) + 6977 8b/-> *(ebp+0x10) 2/r32/edx + 6978 (lookup *edx *(edx+4)) # => eax + 6979 89/<- %edx 0/r32/eax + 6980 { + 6981 # if (s != "(") break + 6982 (slice-equal? %ecx "(") # => eax + 6983 3d/compare-eax-and 0/imm32/false + 6984 75/jump-if-!= break/disp8 + 6985 # if s is a number, store it in the type's size field + 6986 { + 6987 $parse-type:check-for-int: + 6988 (is-hex-int? %ecx) # => eax + 6989 3d/compare-eax-and 0/imm32/false + 6990 74/jump-if-= break/disp8 + 6991 $parse-type:int: + 6992 (parse-hex-int-from-slice %ecx) # => eax + 6993 c7 0/subop/copy *(edx+4) 9/imm32/type-id-array-capacity # Type-tree-value + 6994 89/<- *(edx+8) 0/r32/eax # Type-tree-value-size + 6995 e9/jump $parse-type:end/disp32 + 6996 } + 6997 $parse-type:atom: + 6998 # out->left-is-atom? = true + 6999 c7 0/subop/copy *edx 1/imm32/true # Type-tree-is-atom + 7000 # out->value = pos-or-insert-slice(Type-id, s) + 7001 (pos-or-insert-slice Type-id %ecx) # => eax + 7002 89/<- *(edx+4) 0/r32/eax # Type-tree-value + 7003 e9/jump $parse-type:end/disp32 + 7004 } + 7005 $parse-type:non-atom: + 7006 # otherwise s == "(" + 7007 # out->left = parse-type(ad, in) + 7008 8d/copy-address *(edx+4) 0/r32/eax # Type-tree-left + 7009 (parse-type *(ebp+8) *(ebp+0xc) %eax *(ebp+0x14) *(ebp+0x18)) + 7010 # out->right = parse-type-tree(ad, in) + 7011 8d/copy-address *(edx+0xc) 0/r32/eax # Type-tree-right + 7012 (parse-type-tree *(ebp+8) *(ebp+0xc) %eax *(ebp+0x14) *(ebp+0x18)) + 7013 $parse-type:end: + 7014 # . reclaim locals + 7015 81 0/subop/add %esp 8/imm32 + 7016 # . restore registers + 7017 5a/pop-to-edx + 7018 59/pop-to-ecx + 7019 58/pop-to-eax + 7020 # . epilogue + 7021 89/<- %esp 5/r32/ebp + 7022 5d/pop-to-ebp + 7023 c3/return + 7024 + 7025 $parse-type:abort: + 7026 # error("unexpected token when parsing type: '" s "'\n") + 7027 (write-buffered *(ebp+0x14) "unexpected token when parsing type: '") + 7028 (write-slice-buffered *(ebp+0x14) %ecx) + 7029 (write-buffered *(ebp+0x14) "'\n") + 7030 (flush *(ebp+0x14)) + 7031 (stop *(ebp+0x18) 1) + 7032 # never gets here + 7033 + 7034 parse-type-tree: # ad: (addr allocation-descriptor), in: (addr stream byte), out: (addr handle type-tree), err: (addr buffered-file), ed: (addr exit-descriptor) + 7035 # pseudocode: + 7036 # var tmp: (handle type-tree) = parse-type(ad, in) + 7037 # if tmp == 0 + 7038 # return 0 + 7039 # out = allocate(Type-tree) + 7040 # out->left = tmp + 7041 # out->right = parse-type-tree(ad, in) + 7042 # + 7043 # . prologue + 7044 55/push-ebp + 7045 89/<- %ebp 4/r32/esp + 7046 # . save registers + 7047 50/push-eax + 7048 51/push-ecx + 7049 52/push-edx + 7050 # + 7051 (zero-out *(ebp+0x10) *Handle-size) + 7052 # var tmp/ecx: (handle type-tree) + 7053 68/push 0/imm32 + 7054 68/push 0/imm32 + 7055 89/<- %ecx 4/r32/esp + 7056 # tmp = parse-type(ad, in) + 7057 (parse-type *(ebp+8) *(ebp+0xc) %ecx *(ebp+0x14) *(ebp+0x18)) + 7058 # if (tmp == 0) return + 7059 81 7/subop/compare *ecx 0/imm32 + 7060 74/jump-if-= $parse-type-tree:end/disp8 + 7061 # out = new tree + 7062 (allocate *(ebp+8) *Type-tree-size *(ebp+0x10)) + 7063 # var out-addr/edx: (addr tree) = lookup(*out) + 7064 8b/-> *(ebp+0x10) 2/r32/edx + 7065 (lookup *edx *(edx+4)) # => eax + 7066 89/<- %edx 0/r32/eax + 7067 # out->left = tmp + 7068 8b/-> *ecx 0/r32/eax + 7069 89/<- *(edx+4) 0/r32/eax # Type-tree-left + 7070 8b/-> *(ecx+4) 0/r32/eax + 7071 89/<- *(edx+8) 0/r32/eax # Type-tree-left + 7072 # out->right = parse-type-tree(ad, in) + 7073 8d/copy-address *(edx+0xc) 0/r32/eax # Type-tree-right + 7074 (parse-type-tree *(ebp+8) *(ebp+0xc) %eax *(ebp+0x14) *(ebp+0x18)) + 7075 $parse-type-tree:end: + 7076 # . reclaim locals + 7077 81 0/subop/add %esp 8/imm32 + 7078 # . restore registers + 7079 5a/pop-to-edx + 7080 59/pop-to-ecx + 7081 58/pop-to-eax + 7082 # . epilogue + 7083 89/<- %esp 5/r32/ebp + 7084 5d/pop-to-ebp + 7085 c3/return + 7086 + 7087 next-mu-token: # in: (addr stream byte), out: (addr slice) + 7088 # pseudocode: + 7089 # start: + 7090 # skip-chars-matching-whitespace(in) + 7091 # if in->read >= in->write # end of in + 7092 # out = {0, 0} + 7093 # return + 7094 # out->start = &in->data[in->read] + 7095 # var curr-byte/eax: byte = in->data[in->read] + 7096 # if curr->byte == ',' # comment token + 7097 # ++in->read + 7098 # goto start + 7099 # if curr-byte == '#' # comment + 7100 # goto done # treat as eof + 7101 # if curr-byte == '"' # string literal + 7102 # skip-string(in) + 7103 # goto done # no metadata + 7104 # if curr-byte == '(' + 7105 # ++in->read + 7106 # goto done + 7107 # if curr-byte == ')' + 7108 # ++in->read + 7109 # goto done + 7110 # # read a word + 7111 # while true + 7112 # if in->read >= in->write + 7113 # break + 7114 # curr-byte = in->data[in->read] + 7115 # if curr-byte == ' ' + 7116 # break + 7117 # if curr-byte == '\r' + 7118 # break + 7119 # if curr-byte == '\n' + 7120 # break + 7121 # if curr-byte == '(' + 7122 # break + 7123 # if curr-byte == ')' + 7124 # break + 7125 # if curr-byte == ',' + 7126 # break + 7127 # ++in->read + 7128 # done: + 7129 # out->end = &in->data[in->read] + 7130 # + 7131 # . prologue + 7132 55/push-ebp + 7133 89/<- %ebp 4/r32/esp + 7134 # . save registers + 7135 50/push-eax + 7136 51/push-ecx + 7137 56/push-esi + 7138 57/push-edi + 7139 # esi = in + 7140 8b/-> *(ebp+8) 6/r32/esi + 7141 # edi = out + 7142 8b/-> *(ebp+0xc) 7/r32/edi + 7143 $next-mu-token:start: + 7144 (skip-chars-matching-whitespace %esi) + 7145 $next-mu-token:check0: + 7146 # if (in->read >= in->write) return out = {0, 0} + 7147 # . ecx = in->read + 7148 8b/-> *(esi+4) 1/r32/ecx + 7149 # . if (ecx >= in->write) return out = {0, 0} + 7150 3b/compare<- *esi 1/r32/ecx + 7151 c7 0/subop/copy *edi 0/imm32 + 7152 c7 0/subop/copy *(edi+4) 0/imm32 + 7153 0f 8d/jump-if->= $next-mu-token:end/disp32 + 7154 # out->start = &in->data[in->read] + 7155 8d/copy-address *(esi+ecx+0xc) 0/r32/eax + 7156 89/<- *edi 0/r32/eax + 7157 # var curr-byte/eax: byte = in->data[in->read] + 7158 31/xor-with %eax 0/r32/eax + 7159 8a/copy-byte *(esi+ecx+0xc) 0/r32/AL + 7160 { + 7161 $next-mu-token:check-for-comma: + 7162 # if (curr-byte != ',') break + 7163 3d/compare-eax-and 0x2c/imm32/comma + 7164 75/jump-if-!= break/disp8 + 7165 # ++in->read + 7166 ff 0/subop/increment *(esi+4) + 7167 # restart + 7168 e9/jump $next-mu-token:start/disp32 + 7169 } + 7170 { + 7171 $next-mu-token:check-for-comment: + 7172 # if (curr-byte != '#') break + 7173 3d/compare-eax-and 0x23/imm32/pound + 7174 75/jump-if-!= break/disp8 + 7175 # return eof + 7176 e9/jump $next-mu-token:done/disp32 + 7177 } + 7178 { + 7179 $next-mu-token:check-for-string-literal: + 7180 # if (curr-byte != '"') break + 7181 3d/compare-eax-and 0x22/imm32/dquote + 7182 75/jump-if-!= break/disp8 + 7183 (skip-string %esi) + 7184 # return + 7185 e9/jump $next-mu-token:done/disp32 + 7186 } + 7187 { + 7188 $next-mu-token:check-for-open-paren: + 7189 # if (curr-byte != '(') break + 7190 3d/compare-eax-and 0x28/imm32/open-paren + 7191 75/jump-if-!= break/disp8 + 7192 # ++in->read + 7193 ff 0/subop/increment *(esi+4) + 7194 # return + 7195 e9/jump $next-mu-token:done/disp32 + 7196 } + 7197 { + 7198 $next-mu-token:check-for-close-paren: + 7199 # if (curr-byte != ')') break + 7200 3d/compare-eax-and 0x29/imm32/close-paren + 7201 75/jump-if-!= break/disp8 + 7202 # ++in->read + 7203 ff 0/subop/increment *(esi+4) + 7204 # return + 7205 e9/jump $next-mu-token:done/disp32 + 7206 } + 7207 { + 7208 $next-mu-token:regular-word-without-metadata: + 7209 # if (in->read >= in->write) break + 7210 # . ecx = in->read + 7211 8b/-> *(esi+4) 1/r32/ecx + 7212 # . if (ecx >= in->write) break + 7213 3b/compare<- *esi 1/r32/ecx + 7214 7d/jump-if->= break/disp8 + 7215 # var c/eax: byte = in->data[in->read] + 7216 31/xor-with %eax 0/r32/eax + 7217 8a/copy-byte *(esi+ecx+0xc) 0/r32/AL + 7218 # if (c == ' ') break + 7219 3d/compare-eax-and 0x20/imm32/space + 7220 74/jump-if-= break/disp8 + 7221 # if (c == '\r') break + 7222 3d/compare-eax-and 0xd/imm32/carriage-return + 7223 74/jump-if-= break/disp8 + 7224 # if (c == '\n') break + 7225 3d/compare-eax-and 0xa/imm32/newline + 7226 74/jump-if-= break/disp8 + 7227 # if (c == '(') break + 7228 3d/compare-eax-and 0x28/imm32/open-paren + 7229 0f 84/jump-if-= break/disp32 + 7230 # if (c == ')') break + 7231 3d/compare-eax-and 0x29/imm32/close-paren + 7232 0f 84/jump-if-= break/disp32 + 7233 # if (c == ',') break + 7234 3d/compare-eax-and 0x2c/imm32/comma + 7235 0f 84/jump-if-= break/disp32 + 7236 # ++in->read + 7237 ff 0/subop/increment *(esi+4) + 7238 # + 7239 e9/jump loop/disp32 + 7240 } + 7241 $next-mu-token:done: + 7242 # out->end = &in->data[in->read] + 7243 8b/-> *(esi+4) 1/r32/ecx + 7244 8d/copy-address *(esi+ecx+0xc) 0/r32/eax + 7245 89/<- *(edi+4) 0/r32/eax + 7246 $next-mu-token:end: + 7247 # . restore registers + 7248 5f/pop-to-edi + 7249 5e/pop-to-esi + 7250 59/pop-to-ecx + 7251 58/pop-to-eax + 7252 # . epilogue + 7253 89/<- %esp 5/r32/ebp + 7254 5d/pop-to-ebp + 7255 c3/return + 7256 + 7257 pos-or-insert-slice: # arr: (addr stream (addr array byte)), s: (addr slice) -> index/eax: int + 7258 # . prologue + 7259 55/push-ebp + 7260 89/<- %ebp 4/r32/esp + 7261 # if (pos-slice(arr, s) != -1) return it + 7262 (pos-slice *(ebp+8) *(ebp+0xc)) # => eax + 7263 3d/compare-eax-and -1/imm32 + 7264 75/jump-if-!= $pos-or-insert-slice:end/disp8 + 7265 $pos-or-insert-slice:insert: + 7266 # var s2/eax: (handle array byte) + 7267 68/push 0/imm32 + 7268 68/push 0/imm32 + 7269 89/<- %eax 4/r32/esp + 7270 (slice-to-string Heap *(ebp+0xc) %eax) + 7271 # throw away alloc-id + 7272 (lookup *eax *(eax+4)) # => eax + 7273 (write-int *(ebp+8) %eax) + 7274 (pos-slice *(ebp+8) *(ebp+0xc)) # => eax + 7275 $pos-or-insert-slice:end: + 7276 # . reclaim locals + 7277 81 0/subop/add %esp 8/imm32 + 7278 # . epilogue + 7279 89/<- %esp 5/r32/ebp + 7280 5d/pop-to-ebp + 7281 c3/return + 7282 + 7283 # return the index in an array of strings matching 's', -1 if not found + 7284 # index is denominated in elements, not bytes + 7285 pos-slice: # arr: (addr stream (addr array byte)), s: (addr slice) -> index/eax: int + 7286 # . prologue + 7287 55/push-ebp + 7288 89/<- %ebp 4/r32/esp + 7289 # . save registers + 7290 51/push-ecx + 7291 52/push-edx + 7292 53/push-ebx + 7293 56/push-esi + 7294 #? (write-buffered Stderr "pos-slice: ") + 7295 #? (write-slice-buffered Stderr *(ebp+0xc)) + 7296 #? (write-buffered Stderr "\n") + 7297 #? (flush Stderr) + 7298 # esi = arr + 7299 8b/-> *(ebp+8) 6/r32/esi + 7300 # var index/ecx: int = 0 + 7301 b9/copy-to-ecx 0/imm32 + 7302 # var curr/edx: (addr (addr array byte)) = arr->data + 7303 8d/copy-address *(esi+0xc) 2/r32/edx + 7304 # var max/ebx: (addr (addr array byte)) = &arr->data[arr->write] + 7305 8b/-> *esi 3/r32/ebx + 7306 8d/copy-address *(esi+ebx+0xc) 3/r32/ebx + 7307 { + 7308 #? (write-buffered Stderr " ") + 7309 #? (write-int32-hex-buffered Stderr %ecx) + 7310 #? (write-buffered Stderr "\n") + 7311 #? (flush Stderr) + 7312 # if (curr >= max) return -1 + 7313 39/compare %edx 3/r32/ebx + 7314 b8/copy-to-eax -1/imm32 + 7315 73/jump-if-addr>= $pos-slice:end/disp8 + 7316 # if (slice-equal?(s, *curr)) break + 7317 (slice-equal? *(ebp+0xc) *edx) # => eax + 7318 3d/compare-eax-and 0/imm32/false + 7319 75/jump-if-!= break/disp8 + 7320 # ++index + 7321 41/increment-ecx + 7322 # curr += 4 + 7323 81 0/subop/add %edx 4/imm32 + 7324 # + 7325 eb/jump loop/disp8 + 7326 } + 7327 # return index + 7328 89/<- %eax 1/r32/ecx + 7329 $pos-slice:end: + 7330 #? (write-buffered Stderr "=> ") + 7331 #? (write-int32-hex-buffered Stderr %eax) + 7332 #? (write-buffered Stderr "\n") + 7333 # . restore registers + 7334 5e/pop-to-esi + 7335 5b/pop-to-ebx + 7336 5a/pop-to-edx + 7337 59/pop-to-ecx + 7338 # . epilogue + 7339 89/<- %esp 5/r32/ebp + 7340 5d/pop-to-ebp + 7341 c3/return + 7342 + 7343 test-parse-var-with-type: + 7344 # . prologue + 7345 55/push-ebp + 7346 89/<- %ebp 4/r32/esp + 7347 # (eax..ecx) = "x:" + 7348 b8/copy-to-eax "x:"/imm32 + 7349 8b/-> *eax 1/r32/ecx + 7350 8d/copy-address *(eax+ecx+4) 1/r32/ecx + 7351 05/add-to-eax 4/imm32 + 7352 # var slice/ecx: slice = {eax, ecx} + 7353 51/push-ecx + 7354 50/push-eax + 7355 89/<- %ecx 4/r32/esp + 7356 # _test-input-stream contains "int" + 7357 (clear-stream _test-input-stream) + 7358 (write _test-input-stream "int") + 7359 # var v/edx: (handle var) + 7360 68/push 0/imm32 + 7361 68/push 0/imm32 + 7362 89/<- %edx 4/r32/esp 7363 # - 7364 (is-identifier? %ecx) - 7365 (check-ints-equal %eax 1 "F - test-is-identifier-z") - 7366 # . epilogue - 7367 89/<- %esp 5/r32/ebp - 7368 5d/pop-to-ebp - 7369 c3/return - 7370 - 7371 test-is-identifier-A: - 7372 # . prologue - 7373 55/push-ebp - 7374 89/<- %ebp 4/r32/esp - 7375 # (eax..ecx) = "A$" - 7376 b8/copy-to-eax "A$"/imm32 - 7377 8b/-> *eax 1/r32/ecx - 7378 8d/copy-address *(eax+ecx+4) 1/r32/ecx - 7379 05/add-to-eax 4/imm32 - 7380 # var slice/ecx: slice = {eax, ecx} - 7381 51/push-ecx - 7382 50/push-eax - 7383 89/<- %ecx 4/r32/esp - 7384 # - 7385 (is-identifier? %ecx) - 7386 (check-ints-equal %eax 1 "F - test-is-identifier-A") - 7387 # . epilogue - 7388 89/<- %esp 5/r32/ebp - 7389 5d/pop-to-ebp - 7390 c3/return - 7391 - 7392 test-is-identifier-Z: - 7393 # . prologue - 7394 55/push-ebp - 7395 89/<- %ebp 4/r32/esp - 7396 # (eax..ecx) = "Z$" - 7397 b8/copy-to-eax "Z$"/imm32 - 7398 8b/-> *eax 1/r32/ecx - 7399 8d/copy-address *(eax+ecx+4) 1/r32/ecx - 7400 05/add-to-eax 4/imm32 - 7401 # var slice/ecx: slice = {eax, ecx} - 7402 51/push-ecx - 7403 50/push-eax - 7404 89/<- %ecx 4/r32/esp - 7405 # - 7406 (is-identifier? %ecx) - 7407 (check-ints-equal %eax 1 "F - test-is-identifier-Z") - 7408 # . epilogue - 7409 89/<- %esp 5/r32/ebp - 7410 5d/pop-to-ebp - 7411 c3/return - 7412 - 7413 test-is-identifier-at: - 7414 # character before 'A' is invalid - 7415 # . prologue - 7416 55/push-ebp - 7417 89/<- %ebp 4/r32/esp - 7418 # (eax..ecx) = "@a" - 7419 b8/copy-to-eax "@a"/imm32 - 7420 8b/-> *eax 1/r32/ecx - 7421 8d/copy-address *(eax+ecx+4) 1/r32/ecx - 7422 05/add-to-eax 4/imm32 - 7423 # var slice/ecx: slice = {eax, ecx} - 7424 51/push-ecx - 7425 50/push-eax - 7426 89/<- %ecx 4/r32/esp - 7427 # - 7428 (is-identifier? %ecx) - 7429 (check-ints-equal %eax 0 "F - test-is-identifier-@") - 7430 # . epilogue - 7431 89/<- %esp 5/r32/ebp - 7432 5d/pop-to-ebp - 7433 c3/return - 7434 - 7435 test-is-identifier-square-bracket: - 7436 # character after 'Z' is invalid - 7437 # . prologue - 7438 55/push-ebp - 7439 89/<- %ebp 4/r32/esp - 7440 # (eax..ecx) = "[a" - 7441 b8/copy-to-eax "[a"/imm32 - 7442 8b/-> *eax 1/r32/ecx - 7443 8d/copy-address *(eax+ecx+4) 1/r32/ecx - 7444 05/add-to-eax 4/imm32 - 7445 # var slice/ecx: slice = {eax, ecx} - 7446 51/push-ecx - 7447 50/push-eax - 7448 89/<- %ecx 4/r32/esp - 7449 # - 7450 (is-identifier? %ecx) - 7451 (check-ints-equal %eax 0 "F - test-is-identifier-@") - 7452 # . epilogue - 7453 89/<- %esp 5/r32/ebp - 7454 5d/pop-to-ebp - 7455 c3/return - 7456 - 7457 test-is-identifier-backtick: - 7458 # character before 'a' is invalid - 7459 # . prologue - 7460 55/push-ebp - 7461 89/<- %ebp 4/r32/esp - 7462 # (eax..ecx) = "`a" - 7463 b8/copy-to-eax "`a"/imm32 - 7464 8b/-> *eax 1/r32/ecx - 7465 8d/copy-address *(eax+ecx+4) 1/r32/ecx - 7466 05/add-to-eax 4/imm32 - 7467 # var slice/ecx: slice = {eax, ecx} - 7468 51/push-ecx - 7469 50/push-eax - 7470 89/<- %ecx 4/r32/esp - 7471 # - 7472 (is-identifier? %ecx) - 7473 (check-ints-equal %eax 0 "F - test-is-identifier-backtick") - 7474 # . epilogue - 7475 89/<- %esp 5/r32/ebp - 7476 5d/pop-to-ebp - 7477 c3/return - 7478 - 7479 test-is-identifier-curly-brace-open: - 7480 # character after 'z' is invalid; also used for blocks - 7481 # . prologue - 7482 55/push-ebp - 7483 89/<- %ebp 4/r32/esp - 7484 # (eax..ecx) = "{a" - 7485 b8/copy-to-eax "{a"/imm32 - 7486 8b/-> *eax 1/r32/ecx - 7487 8d/copy-address *(eax+ecx+4) 1/r32/ecx - 7488 05/add-to-eax 4/imm32 - 7489 # var slice/ecx: slice = {eax, ecx} - 7490 51/push-ecx - 7491 50/push-eax - 7492 89/<- %ecx 4/r32/esp - 7493 # - 7494 (is-identifier? %ecx) - 7495 (check-ints-equal %eax 0 "F - test-is-identifier-curly-brace-open") - 7496 # . epilogue - 7497 89/<- %esp 5/r32/ebp - 7498 5d/pop-to-ebp - 7499 c3/return - 7500 - 7501 test-is-identifier-curly-brace-close: - 7502 # . prologue - 7503 55/push-ebp - 7504 89/<- %ebp 4/r32/esp - 7505 # (eax..ecx) = "}a" - 7506 b8/copy-to-eax "}a"/imm32 - 7507 8b/-> *eax 1/r32/ecx - 7508 8d/copy-address *(eax+ecx+4) 1/r32/ecx - 7509 05/add-to-eax 4/imm32 - 7510 # var slice/ecx: slice = {eax, ecx} - 7511 51/push-ecx - 7512 50/push-eax - 7513 89/<- %ecx 4/r32/esp - 7514 # - 7515 (is-identifier? %ecx) - 7516 (check-ints-equal %eax 0 "F - test-is-identifier-curly-brace-close") - 7517 # . epilogue - 7518 89/<- %esp 5/r32/ebp - 7519 5d/pop-to-ebp - 7520 c3/return - 7521 - 7522 test-is-identifier-hyphen: - 7523 # disallow leading '-' since '->' has special meaning - 7524 # . prologue - 7525 55/push-ebp - 7526 89/<- %ebp 4/r32/esp - 7527 # (eax..ecx) = "-a" - 7528 b8/copy-to-eax "-a"/imm32 - 7529 8b/-> *eax 1/r32/ecx - 7530 8d/copy-address *(eax+ecx+4) 1/r32/ecx - 7531 05/add-to-eax 4/imm32 - 7532 # var slice/ecx: slice = {eax, ecx} - 7533 51/push-ecx - 7534 50/push-eax - 7535 89/<- %ecx 4/r32/esp - 7536 # - 7537 (is-identifier? %ecx) - 7538 (check-ints-equal %eax 0 "F - test-is-identifier-hyphen") - 7539 # . epilogue - 7540 89/<- %esp 5/r32/ebp - 7541 5d/pop-to-ebp - 7542 c3/return - 7543 - 7544 populate-mu-function-body: # in: (addr buffered-file), out: (addr function), vars: (addr stack live-var), err: (addr buffered-file), ed: (addr exit-descriptor) - 7545 # . prologue - 7546 55/push-ebp - 7547 89/<- %ebp 4/r32/esp - 7548 # . save registers - 7549 50/push-eax - 7550 56/push-esi - 7551 57/push-edi - 7552 # esi = in - 7553 8b/-> *(ebp+8) 6/r32/esi - 7554 # edi = out - 7555 8b/-> *(ebp+0xc) 7/r32/edi - 7556 # initialize some global state - 7557 c7 0/subop/copy *Curr-block-depth 1/imm32 - 7558 # parse-mu-block(in, vars, out, out->body) - 7559 8d/copy-address *(edi+0x18) 0/r32/eax # Function-body - 7560 (parse-mu-block %esi *(ebp+0x10) %edi %eax *(ebp+0x14) *(ebp+0x18)) - 7561 $populate-mu-function-body:end: - 7562 # . restore registers - 7563 5f/pop-to-edi - 7564 5e/pop-to-esi - 7565 58/pop-to-eax - 7566 # . epilogue - 7567 89/<- %esp 5/r32/ebp - 7568 5d/pop-to-ebp - 7569 c3/return - 7570 - 7571 # parses a block, assuming that the leading '{' has already been read by the caller - 7572 parse-mu-block: # in: (addr buffered-file), vars: (addr stack live-var), fn: (addr function), out: (addr handle block), err: (addr buffered-file), ed: (addr exit-descriptor) - 7573 # pseudocode: - 7574 # var line: (stream byte 512) - 7575 # var word-slice: slice - 7576 # allocate(Heap, Stmt-size, out) - 7577 # var out-addr: (addr block) = lookup(*out) - 7578 # out-addr->tag = 0/block - 7579 # out-addr->var = some unique name - 7580 # push(vars, {out-addr->var, false}) - 7581 # while true # line loop - 7582 # clear-stream(line) - 7583 # read-line-buffered(in, line) - 7584 # if (line->write == 0) break # end of file - 7585 # word-slice = next-mu-token(line) - 7586 # if slice-empty?(word-slice) # end of line - 7587 # continue - 7588 # else if slice-starts-with?(word-slice, "#") - 7589 # continue - 7590 # else if slice-equal?(word-slice, "{") - 7591 # assert(no-tokens-in(line)) - 7592 # block = parse-mu-block(in, vars, fn) - 7593 # append-to-block(out-addr, block) - 7594 # else if slice-equal?(word-slice, "}") - 7595 # break - 7596 # else if slice-ends-with?(word-slice, ":") - 7597 # # TODO: error-check the rest of 'line' - 7598 # --word-slice->end to skip ':' - 7599 # named-block = parse-mu-named-block(word-slice, in, vars, fn) - 7600 # append-to-block(out-addr, named-block) - 7601 # else if slice-equal?(word-slice, "var") - 7602 # var-def = parse-mu-var-def(line, vars, fn) - 7603 # append-to-block(out-addr, var-def) - 7604 # else - 7605 # stmt = parse-mu-stmt(line, vars, fn) - 7606 # append-to-block(out-addr, stmt) - 7607 # pop(vars) - 7608 # - 7609 # . prologue - 7610 55/push-ebp - 7611 89/<- %ebp 4/r32/esp - 7612 # . save registers - 7613 50/push-eax - 7614 51/push-ecx - 7615 52/push-edx - 7616 53/push-ebx - 7617 57/push-edi - 7618 # var line/ecx: (stream byte 512) - 7619 81 5/subop/subtract %esp 0x200/imm32 - 7620 68/push 0x200/imm32/size - 7621 68/push 0/imm32/read - 7622 68/push 0/imm32/write - 7623 89/<- %ecx 4/r32/esp - 7624 # var word-slice/edx: slice - 7625 68/push 0/imm32/end - 7626 68/push 0/imm32/start - 7627 89/<- %edx 4/r32/esp - 7628 # allocate into out - 7629 (allocate Heap *Stmt-size *(ebp+0x14)) - 7630 # var out-addr/edi: (addr block) = lookup(*out) - 7631 8b/-> *(ebp+0x14) 7/r32/edi - 7632 (lookup *edi *(edi+4)) # => eax - 7633 89/<- %edi 0/r32/eax - 7634 # out-addr->tag is 0 (block) by default - 7635 # set out-addr->var - 7636 8d/copy-address *(edi+0xc) 0/r32/eax # Block-var - 7637 (new-block-name *(ebp+0x10) %eax) - 7638 # push(vars, out-addr->var) - 7639 (push *(ebp+0xc) *(edi+0xc)) # Block-var - 7640 (push *(ebp+0xc) *(edi+0x10)) # Block-var - 7641 (push *(ebp+0xc) 0) # false - 7642 # increment *Curr-block-depth - 7643 ff 0/subop/increment *Curr-block-depth - 7644 { - 7645 $parse-mu-block:line-loop: - 7646 # line = read-line-buffered(in) - 7647 (clear-stream %ecx) - 7648 (read-line-buffered *(ebp+8) %ecx) - 7649 #? (write-buffered Stderr "line: ") - 7650 #? (write-stream-data Stderr %ecx) - 7651 #? #? (write-buffered Stderr Newline) # line has its own newline - 7652 #? (flush Stderr) - 7653 #? (rewind-stream %ecx) - 7654 # if (line->write == 0) break - 7655 81 7/subop/compare *ecx 0/imm32 - 7656 0f 84/jump-if-= break/disp32 - 7657 #? (write-buffered Stderr "vars:\n") - 7658 #? (dump-vars *(ebp+0xc)) - 7659 # word-slice = next-mu-token(line) - 7660 (next-mu-token %ecx %edx) - 7661 #? (write-buffered Stderr "word: ") - 7662 #? (write-slice-buffered Stderr %edx) - 7663 #? (write-buffered Stderr Newline) - 7664 #? (flush Stderr) - 7665 # if slice-empty?(word-slice) continue - 7666 (slice-empty? %edx) - 7667 3d/compare-eax-and 0/imm32/false - 7668 0f 85/jump-if-!= loop/disp32 - 7669 # if (slice-starts-with?(word-slice, '#') continue - 7670 # . eax = *word-slice->start - 7671 8b/-> *edx 0/r32/eax - 7672 8a/copy-byte *eax 0/r32/AL - 7673 81 4/subop/and %eax 0xff/imm32 - 7674 # . if (eax == '#') continue - 7675 3d/compare-eax-and 0x23/imm32/hash - 7676 0f 84/jump-if-= loop/disp32 - 7677 # if slice-equal?(word-slice, "{") - 7678 { - 7679 $parse-mu-block:check-for-block: - 7680 (slice-equal? %edx "{") - 7681 3d/compare-eax-and 0/imm32/false - 7682 74/jump-if-= break/disp8 - 7683 (check-no-tokens-left %ecx) - 7684 # parse new block and append - 7685 # . var tmp/eax: (handle block) - 7686 68/push 0/imm32 - 7687 68/push 0/imm32 - 7688 89/<- %eax 4/r32/esp - 7689 # . - 7690 (parse-mu-block *(ebp+8) *(ebp+0xc) *(ebp+0x10) %eax *(ebp+0x18) *(ebp+0x1c)) - 7691 (append-to-block Heap %edi *eax *(eax+4)) - 7692 # . reclaim tmp - 7693 81 0/subop/add %esp 8/imm32 - 7694 # . - 7695 e9/jump $parse-mu-block:line-loop/disp32 - 7696 } - 7697 # if slice-equal?(word-slice, "}") break - 7698 $parse-mu-block:check-for-end: - 7699 (slice-equal? %edx "}") - 7700 3d/compare-eax-and 0/imm32/false - 7701 0f 85/jump-if-!= break/disp32 - 7702 # if slice-ends-with?(word-slice, ":") parse named block and append - 7703 { - 7704 $parse-mu-block:check-for-named-block: - 7705 # . eax = *(word-slice->end-1) - 7706 8b/-> *(edx+4) 0/r32/eax - 7707 48/decrement-eax - 7708 8a/copy-byte *eax 0/r32/AL - 7709 81 4/subop/and %eax 0xff/imm32 - 7710 # . if (eax != ':') break - 7711 3d/compare-eax-and 0x3a/imm32/colon - 7712 0f 85/jump-if-!= break/disp32 - 7713 # TODO: error-check the rest of 'line' - 7714 # - 7715 # skip ':' - 7716 ff 1/subop/decrement *(edx+4) # Slice-end - 7717 # var tmp/eax: (handle block) - 7718 68/push 0/imm32 - 7719 68/push 0/imm32 - 7720 89/<- %eax 4/r32/esp - 7721 # - 7722 (parse-mu-named-block %edx *(ebp+8) *(ebp+0xc) *(ebp+0x10) %eax *(ebp+0x18) *(ebp+0x1c)) - 7723 (append-to-block Heap %edi *eax *(eax+4)) - 7724 # reclaim tmp - 7725 81 0/subop/add %esp 8/imm32 - 7726 # - 7727 e9/jump $parse-mu-block:line-loop/disp32 - 7728 } - 7729 # if slice-equal?(word-slice, "var") - 7730 { - 7731 $parse-mu-block:check-for-var: - 7732 (slice-equal? %edx "var") - 7733 3d/compare-eax-and 0/imm32/false - 7734 74/jump-if-= break/disp8 - 7735 # var tmp/eax: (handle block) - 7736 68/push 0/imm32 - 7737 68/push 0/imm32 - 7738 89/<- %eax 4/r32/esp - 7739 # - 7740 (parse-mu-var-def %ecx *(ebp+0xc) %eax *(ebp+0x10) *(ebp+0x18) *(ebp+0x1c)) - 7741 (append-to-block Heap %edi *eax *(eax+4)) - 7742 # reclaim tmp - 7743 81 0/subop/add %esp 8/imm32 - 7744 # - 7745 e9/jump $parse-mu-block:line-loop/disp32 - 7746 } - 7747 $parse-mu-block:regular-stmt: - 7748 # otherwise - 7749 # var tmp/eax: (handle block) - 7750 68/push 0/imm32 - 7751 68/push 0/imm32 - 7752 89/<- %eax 4/r32/esp - 7753 # - 7754 (parse-mu-stmt %ecx *(ebp+0xc) *(ebp+0x10) %eax *(ebp+0x18) *(ebp+0x1c)) - 7755 (append-to-block Heap %edi *eax *(eax+4)) - 7756 # reclaim tmp - 7757 81 0/subop/add %esp 8/imm32 - 7758 # - 7759 e9/jump loop/disp32 - 7760 } # end line loop - 7761 (clean-up-blocks *(ebp+0xc) *Curr-block-depth *(ebp+0x10)) - 7762 # decrement *Curr-block-depth - 7763 ff 1/subop/decrement *Curr-block-depth - 7764 # pop(vars) - 7765 (pop *(ebp+0xc)) # => eax - 7766 (pop *(ebp+0xc)) # => eax - 7767 (pop *(ebp+0xc)) # => eax - 7768 $parse-mu-block:end: - 7769 # . reclaim locals - 7770 81 0/subop/add %esp 0x214/imm32 - 7771 # . restore registers - 7772 5f/pop-to-edi - 7773 5b/pop-to-ebx - 7774 5a/pop-to-edx - 7775 59/pop-to-ecx - 7776 58/pop-to-eax - 7777 # . epilogue - 7778 89/<- %esp 5/r32/ebp - 7779 5d/pop-to-ebp - 7780 c3/return - 7781 - 7782 $parse-mu-block:abort: - 7783 # error("'{' or '}' should be on its own line, but got '") - 7784 (write-buffered *(ebp+0x18) "'{' or '}' should be on its own line, but got '") - 7785 (rewind-stream %ecx) - 7786 (write-stream-data *(ebp+0x18) %ecx) - 7787 (write-buffered *(ebp+0x18) "'\n") - 7788 (flush *(ebp+0x18)) - 7789 (stop *(ebp+0x1c) 1) - 7790 # never gets here - 7791 - 7792 new-block-name: # fn: (addr function), out: (addr handle var) - 7793 # . prologue - 7794 55/push-ebp - 7795 89/<- %ebp 4/r32/esp - 7796 # . save registers - 7797 50/push-eax - 7798 51/push-ecx - 7799 52/push-edx - 7800 # var n/ecx: int = len(fn->name) + 10 for an int + 2 for '$:' - 7801 8b/-> *(ebp+8) 0/r32/eax - 7802 (lookup *eax *(eax+4)) # Function-name Function-name => eax - 7803 8b/-> *eax 0/r32/eax # String-size - 7804 05/add-to-eax 0xd/imm32 # 10 + 2 for '$:' - 7805 89/<- %ecx 0/r32/eax - 7806 # var name/edx: (stream byte n) - 7807 29/subtract-from %esp 1/r32/ecx - 7808 ff 6/subop/push %ecx - 7809 68/push 0/imm32/read - 7810 68/push 0/imm32/write - 7811 89/<- %edx 4/r32/esp - 7812 (clear-stream %edx) - 7813 # eax = fn->name - 7814 8b/-> *(ebp+8) 0/r32/eax - 7815 (lookup *eax *(eax+4)) # Function-name Function-name => eax - 7816 # construct result using Next-block-index (and increment it) - 7817 (write %edx "$") - 7818 (write %edx %eax) - 7819 (write %edx ":") - 7820 (write-int32-hex %edx *Next-block-index) - 7821 ff 0/subop/increment *Next-block-index - 7822 # var s/eax: slice = {name->data, name->data + name->write} (clobbering edx) - 7823 # . eax = name->write - 7824 8b/-> *edx 0/r32/eax - 7825 # . edx = name->data - 7826 8d/copy-address *(edx+0xc) 2/r32/edx - 7827 # . eax = name->write + name->data - 7828 01/add-to %eax 2/r32/edx - 7829 # . push {edx, eax} - 7830 ff 6/subop/push %eax - 7831 ff 6/subop/push %edx - 7832 89/<- %eax 4/r32/esp - 7833 # out = new literal(s) - 7834 (new-literal Heap %eax *(ebp+0xc)) - 7835 #? 8b/-> *(ebp+0xc) 0/r32/eax - 7836 #? (write-buffered Stderr "type allocid in caller after new-literal: ") - 7837 #? (write-int32-hex-buffered Stderr *(eax+8)) - 7838 #? (write-buffered Stderr " for var ") - 7839 #? (write-int32-hex-buffered Stderr %eax) - 7840 #? (write-buffered Stderr Newline) - 7841 #? (flush Stderr) - 7842 $new-block-name:end: - 7843 # . reclaim locals - 7844 81 0/subop/add %ecx 0xc/imm32 # name.{read/write/len} - 7845 81 0/subop/add %ecx 8/imm32 # slice - 7846 01/add-to %esp 1/r32/ecx - 7847 # . restore registers - 7848 5a/pop-to-edx - 7849 59/pop-to-ecx - 7850 58/pop-to-eax - 7851 # . epilogue - 7852 89/<- %esp 5/r32/ebp - 7853 5d/pop-to-ebp - 7854 c3/return - 7855 - 7856 check-no-tokens-left: # line: (addr stream byte) - 7857 # . prologue - 7858 55/push-ebp - 7859 89/<- %ebp 4/r32/esp - 7860 # . save registers - 7861 50/push-eax - 7862 51/push-ecx - 7863 # var s/ecx: slice - 7864 68/push 0/imm32/end - 7865 68/push 0/imm32/start - 7866 89/<- %ecx 4/r32/esp - 7867 # - 7868 (next-mu-token *(ebp+8) %ecx) - 7869 # if slice-empty?(s) return - 7870 (slice-empty? %ecx) - 7871 3d/compare-eax-and 0/imm32/false - 7872 75/jump-if-!= $check-no-tokens-left:end/disp8 - 7873 # if (slice-starts-with?(s, '#') return - 7874 # . eax = *s->start - 7875 8b/-> *edx 0/r32/eax - 7876 8a/copy-byte *eax 0/r32/AL - 7877 81 4/subop/and %eax 0xff/imm32 - 7878 # . if (eax == '#') continue - 7879 3d/compare-eax-and 0x23/imm32/hash - 7880 74/jump-if-= $check-no-tokens-left:end/disp8 - 7881 # abort - 7882 (write-buffered Stderr "'{' or '}' should be on its own line, but got '") - 7883 (rewind-stream %ecx) - 7884 (write-stream 2 %ecx) - 7885 (write-buffered Stderr "'\n") - 7886 (flush Stderr) - 7887 # . syscall(exit, 1) - 7888 bb/copy-to-ebx 1/imm32 - 7889 e8/call syscall_exit/disp32 - 7890 # never gets here - 7891 $check-no-tokens-left:end: - 7892 # . reclaim locals - 7893 81 0/subop/add %esp 8/imm32 - 7894 # . restore registers - 7895 59/pop-to-ecx - 7896 58/pop-to-eax - 7897 # . epilogue - 7898 89/<- %esp 5/r32/ebp - 7899 5d/pop-to-ebp - 7900 c3/return - 7901 - 7902 parse-mu-named-block: # name: (addr slice), in: (addr buffered-file), vars: (addr stack live-var), fn: (addr function), out: (addr handle stmt), err: (addr buffered-file), ed: (addr exit-descriptor) - 7903 # pseudocode: - 7904 # var v: (handle var) - 7905 # new-literal(name, v) - 7906 # push(vars, {v, false}) - 7907 # parse-mu-block(in, vars, fn, out) - 7908 # pop(vars) - 7909 # out->tag = block - 7910 # out->var = v - 7911 # - 7912 # . prologue - 7913 55/push-ebp - 7914 89/<- %ebp 4/r32/esp - 7915 # . save registers - 7916 50/push-eax - 7917 51/push-ecx - 7918 57/push-edi - 7919 # var v/ecx: (handle var) - 7920 68/push 0/imm32 - 7921 68/push 0/imm32 - 7922 89/<- %ecx 4/r32/esp - 7923 # - 7924 (new-literal Heap *(ebp+8) %ecx) - 7925 # push(vars, v) - 7926 (push *(ebp+0x10) *ecx) - 7927 (push *(ebp+0x10) *(ecx+4)) - 7928 (push *(ebp+0x10) 0) # false - 7929 # - 7930 (parse-mu-block *(ebp+0xc) *(ebp+0x10) *(ebp+0x14) *(ebp+0x18) *(ebp+0x1c) *(ebp+0x20)) - 7931 # pop v off vars - 7932 (pop *(ebp+0x10)) # => eax - 7933 (pop *(ebp+0x10)) # => eax - 7934 (pop *(ebp+0x10)) # => eax - 7935 # var out-addr/edi: (addr stmt) = lookup(*out) - 7936 8b/-> *(ebp+0x18) 7/r32/edi - 7937 (lookup *edi *(edi+4)) # => eax - 7938 89/<- %edi 0/r32/eax - 7939 # out-addr->tag = named-block - 7940 c7 0/subop/copy *edi 0/imm32/block # Stmt-tag - 7941 # out-addr->var = v - 7942 8b/-> *ecx 0/r32/eax - 7943 89/<- *(edi+0xc) 0/r32/eax # Block-var - 7944 8b/-> *(ecx+4) 0/r32/eax - 7945 89/<- *(edi+0x10) 0/r32/eax # Block-var - 7946 $parse-mu-named-block:end: - 7947 # . reclaim locals - 7948 81 0/subop/add %esp 8/imm32 - 7949 # . restore registers - 7950 5f/pop-to-edi - 7951 59/pop-to-ecx - 7952 58/pop-to-eax - 7953 # . epilogue - 7954 89/<- %esp 5/r32/ebp - 7955 5d/pop-to-ebp - 7956 c3/return - 7957 - 7958 parse-mu-var-def: # line: (addr stream byte), vars: (addr stack live-var), out: (addr handle stmt), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) - 7959 # . prologue - 7960 55/push-ebp - 7961 89/<- %ebp 4/r32/esp - 7962 # . save registers - 7963 50/push-eax - 7964 51/push-ecx - 7965 52/push-edx - 7966 53/push-ebx - 7967 57/push-edi - 7968 # edi = out - 7969 8b/-> *(ebp+0x10) 7/r32/edi - 7970 # var word-slice/ecx: slice - 7971 68/push 0/imm32/end - 7972 68/push 0/imm32/start - 7973 89/<- %ecx 4/r32/esp - 7974 # var v/edx: (handle var) - 7975 68/push 0/imm32 - 7976 68/push 0/imm32 - 7977 89/<- %edx 4/r32/esp - 7978 # v = parse-var-with-type(next-mu-token(line)) - 7979 (next-mu-token *(ebp+8) %ecx) - 7980 (parse-var-with-type %ecx *(ebp+8) %edx *(ebp+0x18) *(ebp+0x1c)) - 7981 # var v-addr/eax: (addr var) - 7982 (lookup *edx *(edx+4)) # => eax - 7983 # v->block-depth = *Curr-block-depth - 7984 8b/-> *Curr-block-depth 3/r32/ebx - 7985 89/<- *(eax+0x10) 3/r32/ebx # Var-block-depth - 7986 # either v has no register and there's no more to this line - 7987 8b/-> *(eax+0x18) 0/r32/eax # Var-register - 7988 3d/compare-eax-and 0/imm32 - 7989 { - 7990 75/jump-if-!= break/disp8 - 7991 # TODO: disallow vars of type 'byte' on the stack - 7992 # ensure that there's nothing else on this line - 7993 (next-mu-token *(ebp+8) %ecx) - 7994 (slice-empty? %ecx) # => eax - 7995 3d/compare-eax-and 0/imm32/false - 7996 0f 84/jump-if-= $parse-mu-var-def:error2/disp32 - 7997 # - 7998 (new-var-def Heap *edx *(edx+4) %edi) - 7999 e9/jump $parse-mu-var-def:update-vars/disp32 - 8000 } - 8001 # or v has a register and there's more to this line - 8002 { - 8003 0f 84/jump-if-= break/disp32 - 8004 # TODO: disallow vars of type 'byte' in registers 'esi' or 'edi' - 8005 # TODO: vars of type 'byte' should only be initialized by clearing to 0 - 8006 # ensure that the next word is '<-' - 8007 (next-mu-token *(ebp+8) %ecx) - 8008 (slice-equal? %ecx "<-") # => eax - 8009 3d/compare-eax-and 0/imm32/false - 8010 0f 84/jump-if-= $parse-mu-var-def:error1/disp32 - 8011 # - 8012 (new-reg-var-def Heap *edx *(edx+4) %edi) - 8013 (lookup *edi *(edi+4)) # => eax - 8014 (add-operation-and-inputs-to-stmt %eax *(ebp+8) *(ebp+0xc) *(ebp+0x14) *(ebp+0x18) *(ebp+0x1c)) - 8015 } - 8016 $parse-mu-var-def:update-vars: - 8017 # push 'v' at end of function - 8018 (push *(ebp+0xc) *edx) - 8019 (push *(ebp+0xc) *(edx+4)) - 8020 (push *(ebp+0xc) 0) # Live-var-register-spilled is unused during parsing - 8021 $parse-mu-var-def:end: - 8022 # . reclaim locals - 8023 81 0/subop/add %esp 0x10/imm32 - 8024 # . restore registers - 8025 5f/pop-to-edi - 8026 5b/pop-to-ebx - 8027 5a/pop-to-edx - 8028 59/pop-to-ecx - 8029 58/pop-to-eax - 8030 # . epilogue - 8031 89/<- %esp 5/r32/ebp - 8032 5d/pop-to-ebp - 8033 c3/return - 8034 - 8035 $parse-mu-var-def:error1: - 8036 (rewind-stream *(ebp+8)) - 8037 # error("register variable requires a valid instruction to initialize but got '" line "'\n") - 8038 (write-buffered *(ebp+0x18) "register variable requires a valid instruction to initialize but got '") - 8039 (flush *(ebp+0x18)) - 8040 (write-stream-data *(ebp+0x18) *(ebp+8)) - 8041 (write-buffered *(ebp+0x18) "'\n") - 8042 (flush *(ebp+0x18)) - 8043 (stop *(ebp+0x1c) 1) - 8044 # never gets here - 8045 - 8046 $parse-mu-var-def:error2: - 8047 (rewind-stream *(ebp+8)) - 8048 # error("fn " fn ": var " var ": variables on the stack can't take an initializer\n") - 8049 (write-buffered *(ebp+0x18) "fn ") - 8050 8b/-> *(ebp+0x14) 0/r32/eax - 8051 (lookup *eax *(eax+4)) # Function-name Function-name => eax - 8052 (write-buffered *(ebp+0x18) %eax) - 8053 (write-buffered *(ebp+0x18) ": var ") - 8054 # var v-addr/eax: (addr var) = lookup(v) - 8055 (lookup *edx *(edx+4)) # => eax - 8056 (lookup *eax *(eax+4)) # Var-name Var-name => eax - 8057 (write-buffered *(ebp+0x18) %eax) - 8058 (write-buffered *(ebp+0x18) ": variables on the stack can't take an initializer\n") - 8059 (flush *(ebp+0x18)) - 8060 (stop *(ebp+0x1c) 1) - 8061 # never gets here - 8062 - 8063 test-parse-mu-var-def: - 8064 # 'var n: int' - 8065 # . prologue - 8066 55/push-ebp - 8067 89/<- %ebp 4/r32/esp - 8068 # setup - 8069 (clear-stream _test-input-stream) - 8070 (write _test-input-stream "n: int\n") # caller has consumed the 'var' - 8071 c7 0/subop/copy *Curr-block-depth 1/imm32 - 8072 # var out/esi: (handle stmt) - 8073 68/push 0/imm32 - 8074 68/push 0/imm32 - 8075 89/<- %esi 4/r32/esp - 8076 # var vars/ecx: (stack (addr var) 16) - 8077 81 5/subop/subtract %esp 0xc0/imm32 - 8078 68/push 0xc0/imm32/size - 8079 68/push 0/imm32/top - 8080 89/<- %ecx 4/r32/esp - 8081 (clear-stack %ecx) - 8082 # convert - 8083 (parse-mu-var-def _test-input-stream %ecx %esi 0 Stderr 0) - 8084 # var out-addr/esi: (addr stmt) - 8085 (lookup *esi *(esi+4)) # => eax - 8086 89/<- %esi 0/r32/eax - 8087 # - 8088 (check-ints-equal *esi 2 "F - test-parse-mu-var-def/tag") # Stmt-tag is var-def - 8089 # var v/ecx: (addr var) = lookup(out->var) - 8090 (lookup *(esi+4) *(esi+8)) # Vardef-var Vardef-var => eax - 8091 89/<- %ecx 0/r32/eax - 8092 # v->name - 8093 (lookup *ecx *(ecx+4)) # Var-name Var-name => eax - 8094 (check-strings-equal %eax "n" "F - test-parse-mu-var-def/var-name") - 8095 # v->register - 8096 (check-ints-equal *(ecx+0x18) 0 "F - test-parse-mu-var-def/var-register") # Var-register - 8097 # v->block-depth - 8098 (check-ints-equal *(ecx+0x10) 1 "F - test-parse-mu-var-def/output-block-depth") # Var-block-depth - 8099 # v->type == int - 8100 (lookup *(ecx+8) *(ecx+0xc)) # Var-type Var-type => eax - 8101 (check-ints-equal *eax 1 "F - test-parse-mu-var-def/var-type:0") # Tree-is-atom - 8102 (check-ints-equal *(eax+4) 1 "F - test-parse-mu-var-def/var-type:1") # Tree-value - 8103 (check-ints-equal *(eax+0xc) 0 "F - test-parse-mu-var-def/var-type:2") # Tree-right - 8104 # . epilogue - 8105 89/<- %esp 5/r32/ebp - 8106 5d/pop-to-ebp - 8107 c3/return - 8108 - 8109 test-parse-mu-reg-var-def: - 8110 # 'var n/eax: int <- copy 0' - 8111 # . prologue - 8112 55/push-ebp - 8113 89/<- %ebp 4/r32/esp - 8114 # setup - 8115 (clear-stream _test-input-stream) - 8116 (write _test-input-stream "n/eax: int <- copy 0\n") # caller has consumed the 'var' - 8117 c7 0/subop/copy *Curr-block-depth 1/imm32 - 8118 # var out/esi: (handle stmt) - 8119 68/push 0/imm32 - 8120 68/push 0/imm32 - 8121 89/<- %esi 4/r32/esp - 8122 # var vars/ecx: (stack (addr var) 16) - 8123 81 5/subop/subtract %esp 0xc0/imm32 - 8124 68/push 0xc0/imm32/size - 8125 68/push 0/imm32/top - 8126 89/<- %ecx 4/r32/esp - 8127 (clear-stack %ecx) - 8128 # convert - 8129 (parse-mu-var-def _test-input-stream %ecx %esi 0 Stderr 0) - 8130 # var out-addr/esi: (addr stmt) - 8131 (lookup *esi *(esi+4)) # => eax - 8132 89/<- %esi 0/r32/eax - 8133 # - 8134 (check-ints-equal *esi 3 "F - test-parse-mu-reg-var-def/tag") # Stmt-tag is reg-var-def - 8135 # var v/ecx: (addr var) = lookup(out->outputs->value) - 8136 # . eax: (addr stmt-var) = lookup(out->outputs) - 8137 (lookup *(esi+0x14) *(esi+0x18)) # Regvardef-outputs Regvardef-outputs => eax - 8138 # . - 8139 (check-ints-equal *(eax+8) 0 "F - test-parse-mu-reg-var-def/single-output") # Stmt-var-next - 8140 # . eax: (addr var) = lookup(eax->value) - 8141 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax - 8142 # . ecx = eax - 8143 89/<- %ecx 0/r32/eax - 8144 # v->name - 8145 (lookup *ecx *(ecx+4)) # Var-name Var-name => eax - 8146 (check-strings-equal %eax "n" "F - test-parse-mu-reg-var-def/output-name") # Var-name - 8147 # v->register - 8148 (lookup *(ecx+0x18) *(ecx+0x1c)) # Var-register Var-register => eax - 8149 (check-strings-equal %eax "eax" "F - test-parse-mu-reg-var-def/output-register") - 8150 # v->block-depth - 8151 (check-ints-equal *(ecx+0x10) 1 "F - test-parse-mu-reg-var-def/output-block-depth") # Var-block-depth - 8152 # v->type == int - 8153 (lookup *(ecx+8) *(ecx+0xc)) # Var-type Var-type => eax - 8154 (check-ints-equal *eax 1 "F - test-parse-mu-reg-var-def/output-type:0") # Tree-is-atom - 8155 (check-ints-equal *(eax+4) 1 "F - test-parse-mu-reg-var-def/output-type:1") # Tree-value - 8156 (check-ints-equal *(eax+0xc) 0 "F - test-parse-mu-reg-var-def/output-type:2") # Tree-right - 8157 # . epilogue - 8158 89/<- %esp 5/r32/ebp - 8159 5d/pop-to-ebp - 8160 c3/return - 8161 - 8162 parse-mu-stmt: # line: (addr stream byte), vars: (addr stack live-var), fn: (addr function), out: (addr handle stmt), err: (addr buffered-file), ed: (addr exit-descriptor) - 8163 # Carefully push any outputs on the vars stack _after_ reading the inputs - 8164 # that may conflict with them. - 8165 # - 8166 # The only situation in which outputs are pushed here (when it's not a - 8167 # 'var' vardef stmt), and so can possibly conflict with inputs, is if the - 8168 # output is a function output. - 8169 # - 8170 # pseudocode: - 8171 # var name: slice - 8172 # allocate(Heap, Stmt-size, out) - 8173 # var out-addr: (addr stmt) = lookup(*out) - 8174 # out-addr->tag = stmt - 8175 # if stmt-has-outputs?(line) - 8176 # while true - 8177 # name = next-mu-token(line) - 8178 # if (name == '<-') break - 8179 # assert(is-identifier?(name)) - 8180 # var v: (handle var) = lookup-var-or-find-in-fn-outputs(name, vars, fn) - 8181 # out-addr->outputs = append(v, out-addr->outputs) - 8182 # add-operation-and-inputs-to-stmt(out-addr, line, vars) - 8183 # for output in stmt->outputs: - 8184 # maybe-define-var(output, vars) - 8185 # - 8186 # . prologue - 8187 55/push-ebp - 8188 89/<- %ebp 4/r32/esp - 8189 # . save registers - 8190 50/push-eax - 8191 51/push-ecx - 8192 52/push-edx - 8193 53/push-ebx - 8194 57/push-edi - 8195 # var name/ecx: slice - 8196 68/push 0/imm32/end - 8197 68/push 0/imm32/start - 8198 89/<- %ecx 4/r32/esp - 8199 # var is-deref?/edx: boolean = false - 8200 ba/copy-to-edx 0/imm32/false - 8201 # var v: (handle var) - 8202 68/push 0/imm32 - 8203 68/push 0/imm32 - 8204 89/<- %ebx 4/r32/esp - 8205 # - 8206 (allocate Heap *Stmt-size *(ebp+0x14)) - 8207 # var out-addr/edi: (addr stmt) = lookup(*out) - 8208 8b/-> *(ebp+0x14) 7/r32/edi - 8209 (lookup *edi *(edi+4)) # => eax - 8210 89/<- %edi 0/r32/eax - 8211 # out-addr->tag = 1/stmt - 8212 c7 0/subop/copy *edi 1/imm32/stmt1 # Stmt-tag - 8213 { - 8214 (stmt-has-outputs? *(ebp+8)) - 8215 3d/compare-eax-and 0/imm32/false - 8216 0f 84/jump-if-= break/disp32 - 8217 { - 8218 $parse-mu-stmt:read-outputs: - 8219 # name = next-mu-token(line) - 8220 (next-mu-token *(ebp+8) %ecx) - 8221 # if slice-empty?(word-slice) break - 8222 (slice-empty? %ecx) # => eax - 8223 3d/compare-eax-and 0/imm32/false - 8224 0f 85/jump-if-!= break/disp32 - 8225 # if (name == "<-") break - 8226 (slice-equal? %ecx "<-") # => eax - 8227 3d/compare-eax-and 0/imm32/false - 8228 0f 85/jump-if-!= break/disp32 - 8229 # is-deref? = false - 8230 ba/copy-to-edx 0/imm32/false - 8231 # if (slice-starts-with?(name, '*')) ++name->start and set is-deref? - 8232 8b/-> *ecx 0/r32/eax # Slice-start - 8233 8a/copy-byte *eax 0/r32/AL - 8234 81 4/subop/and %eax 0xff/imm32 - 8235 3d/compare-eax-and 0x2a/imm32/asterisk - 8236 { - 8237 75/jump-if-!= break/disp8 - 8238 ff 0/subop/increment *ecx - 8239 ba/copy-to-edx 1/imm32/true - 8240 } - 8241 # assert(is-identifier?(name)) - 8242 (is-identifier? %ecx) # => eax - 8243 3d/compare-eax-and 0/imm32/false - 8244 0f 84/jump-if-= $parse-mu-stmt:abort/disp32 - 8245 # - 8246 (lookup-var-or-find-in-fn-outputs %ecx *(ebp+0xc) *(ebp+0x10) %ebx *(ebp+0x18) *(ebp+0x1c)) - 8247 8d/copy-address *(edi+0x14) 0/r32/eax # Stmt1-outputs - 8248 (append-stmt-var Heap *ebx *(ebx+4) *(edi+0x14) *(edi+0x18) %edx %eax) # Stmt1-outputs - 8249 # - 8250 e9/jump loop/disp32 - 8251 } - 8252 } - 8253 (add-operation-and-inputs-to-stmt %edi *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x18) *(ebp+0x1c)) - 8254 $parse-mu-stmt:define-outputs: - 8255 # var output/edi: (addr stmt-var) = lookup(out-addr->outputs) - 8256 (lookup *(edi+0x14) *(edi+0x18)) # Stmt1-outputs Stmt1-outputs => eax - 8257 89/<- %edi 0/r32/eax - 8258 { - 8259 $parse-mu-stmt:define-outputs-loop: - 8260 # if (output == null) break - 8261 81 7/subop/compare %edi 0/imm32 - 8262 74/jump-if-= break/disp8 - 8263 # - 8264 (maybe-define-var *edi *(edi+4) *(ebp+0xc)) # if output is a deref, then it's already been defined, - 8265 # and must be in vars. This call will be a no-op, but safe. - 8266 # output = output->next - 8267 (lookup *(edi+8) *(edi+0xc)) # Stmt-var-next Stmt-var-next => eax - 8268 89/<- %edi 0/r32/eax - 8269 # - 8270 eb/jump loop/disp8 - 8271 } - 8272 $parse-mu-stmt:end: - 8273 # . reclaim locals - 8274 81 0/subop/add %esp 0x10/imm32 - 8275 # . restore registers - 8276 5f/pop-to-edi - 8277 5b/pop-to-ebx - 8278 5a/pop-to-edx - 8279 59/pop-to-ecx - 8280 58/pop-to-eax - 8281 # . epilogue - 8282 89/<- %esp 5/r32/ebp - 8283 5d/pop-to-ebp - 8284 c3/return - 8285 - 8286 $parse-mu-stmt:abort: - 8287 # error("invalid identifier '" name "'\n") - 8288 (write-buffered *(ebp+0x18) "invalid identifier '") - 8289 (write-slice-buffered *(ebp+0x18) %ecx) - 8290 (write-buffered *(ebp+0x18) "'\n") - 8291 (flush *(ebp+0x18)) - 8292 (stop *(ebp+0x1c) 1) - 8293 # never gets here - 8294 - 8295 add-operation-and-inputs-to-stmt: # stmt: (addr stmt), line: (addr stream byte), vars: (addr stack live-var), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) - 8296 # pseudocode: - 8297 # stmt->name = slice-to-string(next-mu-token(line)) - 8298 # while true - 8299 # name = next-mu-token(line) - 8300 # v = lookup-var-or-literal(name) - 8301 # stmt->inouts = append(v, stmt->inouts) - 8302 # - 8303 # . prologue - 8304 55/push-ebp - 8305 89/<- %ebp 4/r32/esp - 8306 # . save registers - 8307 50/push-eax - 8308 51/push-ecx - 8309 52/push-edx - 8310 53/push-ebx - 8311 56/push-esi - 8312 57/push-edi - 8313 # edi = stmt - 8314 8b/-> *(ebp+8) 7/r32/edi - 8315 # var name/ecx: slice - 8316 68/push 0/imm32/end - 8317 68/push 0/imm32/start - 8318 89/<- %ecx 4/r32/esp - 8319 # var is-deref?/edx: boolean = false - 8320 ba/copy-to-edx 0/imm32/false - 8321 # var v/esi: (handle var) - 8322 68/push 0/imm32 - 8323 68/push 0/imm32 - 8324 89/<- %esi 4/r32/esp - 8325 $add-operation-and-inputs-to-stmt:read-operation: - 8326 (next-mu-token *(ebp+0xc) %ecx) - 8327 8d/copy-address *(edi+4) 0/r32/eax # Stmt1-operation or Regvardef-operationStmt1-operation or Regvardef-operation - 8328 (slice-to-string Heap %ecx %eax) - 8329 # var is-get?/ebx: boolean = (name == "get") - 8330 (slice-equal? %ecx "get") # => eax - 8331 89/<- %ebx 0/r32/eax - 8332 { - 8333 $add-operation-and-inputs-to-stmt:read-inouts: - 8334 # name = next-mu-token(line) - 8335 (next-mu-token *(ebp+0xc) %ecx) - 8336 # if slice-empty?(word-slice) break - 8337 (slice-empty? %ecx) # => eax - 8338 3d/compare-eax-and 0/imm32/false - 8339 0f 85/jump-if-!= break/disp32 - 8340 # if (name == "<-") abort - 8341 (slice-equal? %ecx "<-") - 8342 3d/compare-eax-and 0/imm32/false - 8343 0f 85/jump-if-!= $add-operation-and-inputs-to-stmt:abort/disp32 - 8344 # if (is-get? && second operand) lookup or create offset - 8345 { - 8346 81 7/subop/compare %ebx 0/imm32/false - 8347 74/jump-if-= break/disp8 - 8348 (lookup *(edi+0xc) *(edi+0x10)) # Stmt1-inouts Stmt1-inouts => eax - 8349 3d/compare-eax-and 0/imm32 - 8350 74/jump-if-= break/disp8 - 8351 (lookup-or-create-constant %eax %ecx %esi) - 8352 #? (lookup *esi *(esi+4)) - 8353 #? (write-buffered Stderr "creating new output var ") - 8354 #? (write-int32-hex-buffered Stderr %eax) - 8355 #? (write-buffered Stderr " for field called ") - 8356 #? (write-slice-buffered Stderr %ecx) - 8357 #? (write-buffered Stderr "; var name ") - 8358 #? (lookup *eax *(eax+4)) # Var-name - 8359 #? (write-buffered Stderr %eax) - 8360 #? (write-buffered Stderr Newline) - 8361 #? (flush Stderr) - 8362 e9/jump $add-operation-and-inputs-to-stmt:save-var/disp32 - 8363 } - 8364 # is-deref? = false - 8365 ba/copy-to-edx 0/imm32/false - 8366 # if (slice-starts-with?(name, '*')) ++name->start and set is-deref? - 8367 8b/-> *ecx 0/r32/eax # Slice-start - 8368 8a/copy-byte *eax 0/r32/AL - 8369 81 4/subop/and %eax 0xff/imm32 - 8370 3d/compare-eax-and 0x2a/imm32/asterisk - 8371 { - 8372 75/jump-if-!= break/disp8 - 8373 $add-operation-and-inputs-to-stmt:inout-is-deref: - 8374 ff 0/subop/increment *ecx - 8375 ba/copy-to-edx 1/imm32/true - 8376 } - 8377 (lookup-var-or-literal %ecx *(ebp+0x10) %esi *(ebp+0x14) *(ebp+0x18) *(ebp+0x1c)) - 8378 $add-operation-and-inputs-to-stmt:save-var: - 8379 8d/copy-address *(edi+0xc) 0/r32/eax - 8380 (append-stmt-var Heap *esi *(esi+4) *(edi+0xc) *(edi+0x10) %edx %eax) # Stmt1-inouts or Regvardef-inouts - 8381 # - 8382 e9/jump loop/disp32 - 8383 } - 8384 $add-operation-and-inputs-to-stmt:end: - 8385 # . reclaim locals - 8386 81 0/subop/add %esp 0x10/imm32 - 8387 # . restore registers - 8388 5f/pop-to-edi - 8389 5e/pop-to-esi - 8390 5b/pop-to-ebx - 8391 5a/pop-to-edx - 8392 59/pop-to-ecx - 8393 58/pop-to-eax - 8394 # . epilogue - 8395 89/<- %esp 5/r32/ebp - 8396 5d/pop-to-ebp - 8397 c3/return - 8398 - 8399 $add-operation-and-inputs-to-stmt:abort: - 8400 # error("fn ___: invalid identifier in '" line "'\n") - 8401 (write-buffered *(ebp+0x18) "fn ") - 8402 8b/-> *(ebp+0x14) 0/r32/eax - 8403 (lookup *eax *(eax+4)) # Function-name Function-name => eax - 8404 (write-buffered *(ebp+0x18) %eax) - 8405 (rewind-stream *(ebp+0xc)) - 8406 (write-buffered *(ebp+0x18) ": invalid identifier in '") - 8407 (write-stream-data *(ebp+0x18) *(ebp+0xc)) - 8408 (write-buffered *(ebp+0x18) "'\n") - 8409 (flush *(ebp+0x18)) - 8410 (stop *(ebp+0x1c) 1) - 8411 # never gets here - 8412 - 8413 stmt-has-outputs?: # line: (addr stream byte) -> result/eax: boolean - 8414 # . prologue - 8415 55/push-ebp - 8416 89/<- %ebp 4/r32/esp - 8417 # . save registers - 8418 51/push-ecx - 8419 # var word-slice/ecx: slice - 8420 68/push 0/imm32/end - 8421 68/push 0/imm32/start - 8422 89/<- %ecx 4/r32/esp - 8423 # result = false - 8424 b8/copy-to-eax 0/imm32/false - 8425 (rewind-stream *(ebp+8)) - 8426 { - 8427 (next-mu-token *(ebp+8) %ecx) - 8428 # if slice-empty?(word-slice) break - 8429 (slice-empty? %ecx) - 8430 3d/compare-eax-and 0/imm32/false - 8431 b8/copy-to-eax 0/imm32/false/result # restore result (if we're here it's still false) - 8432 0f 85/jump-if-!= break/disp32 - 8433 # if slice-starts-with?(word-slice, '#') break - 8434 # . eax = *word-slice->start - 8435 8b/-> *ecx 0/r32/eax - 8436 8a/copy-byte *eax 0/r32/AL - 8437 81 4/subop/and %eax 0xff/imm32 - 8438 # . if (eax == '#') break - 8439 3d/compare-eax-and 0x23/imm32/hash - 8440 b8/copy-to-eax 0/imm32/false/result # restore result (if we're here it's still false) - 8441 0f 84/jump-if-= break/disp32 - 8442 # if slice-equal?(word-slice, '<-') return true - 8443 (slice-equal? %ecx "<-") - 8444 3d/compare-eax-and 0/imm32/false - 8445 74/jump-if-= loop/disp8 - 8446 b8/copy-to-eax 1/imm32/true - 8447 } - 8448 $stmt-has-outputs:end: - 8449 (rewind-stream *(ebp+8)) - 8450 # . reclaim locals - 8451 81 0/subop/add %esp 8/imm32 - 8452 # . restore registers - 8453 59/pop-to-ecx - 8454 # . epilogue - 8455 89/<- %esp 5/r32/ebp - 8456 5d/pop-to-ebp - 8457 c3/return - 8458 - 8459 # if 'name' starts with a digit, create a new literal var for it - 8460 # otherwise return first 'name' from the top (back) of 'vars' and abort if not found - 8461 lookup-var-or-literal: # name: (addr slice), vars: (addr stack live-var), out: (addr handle var), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) - 8462 # . prologue - 8463 55/push-ebp - 8464 89/<- %ebp 4/r32/esp - 8465 # . save registers - 8466 50/push-eax - 8467 51/push-ecx - 8468 56/push-esi - 8469 # esi = name - 8470 8b/-> *(ebp+8) 6/r32/esi - 8471 # if slice-empty?(name) abort - 8472 (slice-empty? %esi) # => eax - 8473 3d/compare-eax-and 0/imm32/false - 8474 0f 85/jump-if-!= $lookup-var-or-literal:abort/disp32 - 8475 # var c/ecx: byte = *name->start - 8476 8b/-> *esi 1/r32/ecx - 8477 8a/copy-byte *ecx 1/r32/CL - 8478 81 4/subop/and %ecx 0xff/imm32 - 8479 # if is-decimal-digit?(c) return new var(name) - 8480 { - 8481 (is-decimal-digit? %ecx) # => eax - 8482 3d/compare-eax-and 0/imm32/false - 8483 74/jump-if-= break/disp8 - 8484 $lookup-var-or-literal:literal: - 8485 (new-literal-integer Heap %esi *(ebp+0x10) *(ebp+0x18) *(ebp+0x1c)) - 8486 eb/jump $lookup-var-or-literal:end/disp8 - 8487 } - 8488 # else if (c == '"') return new var(name) - 8489 { - 8490 81 7/subop/compare %ecx 0x22/imm32/dquote - 8491 75/jump-if-!= break/disp8 - 8492 $lookup-var-or-literal:literal-string: - 8493 (new-literal Heap %esi *(ebp+0x10)) - 8494 eb/jump $lookup-var-or-literal:end/disp8 - 8495 } - 8496 # otherwise return lookup-var(name, vars) - 8497 { - 8498 $lookup-var-or-literal:var: - 8499 (lookup-var %esi *(ebp+0xc) *(ebp+0x10) *(ebp+0x14) *(ebp+0x18) *(ebp+0x1c)) - 8500 } - 8501 $lookup-var-or-literal:end: - 8502 # . restore registers - 8503 5e/pop-to-esi - 8504 59/pop-to-ecx - 8505 58/pop-to-eax - 8506 # . epilogue - 8507 89/<- %esp 5/r32/ebp - 8508 5d/pop-to-ebp - 8509 c3/return - 8510 - 8511 $lookup-var-or-literal:abort: - 8512 (write-buffered *(ebp+0x18) "fn ") - 8513 8b/-> *(ebp+0x14) 0/r32/eax - 8514 (lookup *eax *(eax+4)) # Function-name Function-name => eax - 8515 (write-buffered *(ebp+0x18) %eax) - 8516 (write-buffered *(ebp+0x18) ": empty variable!") - 8517 (flush *(ebp+0x18)) - 8518 (stop *(ebp+0x1c) 1) - 8519 # never gets here - 8520 - 8521 # return first 'name' from the top (back) of 'vars' and abort if not found - 8522 lookup-var: # name: (addr slice), vars: (addr stack live-var), out: (addr handle var), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) - 8523 # . prologue - 8524 55/push-ebp - 8525 89/<- %ebp 4/r32/esp - 8526 # . save registers - 8527 50/push-eax - 8528 # - 8529 (lookup-var-helper *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14) *(ebp+0x18) *(ebp+0x1c)) - 8530 # if (*out == 0) abort - 8531 8b/-> *(ebp+0x10) 0/r32/eax - 8532 81 7/subop/compare *eax 0/imm32 - 8533 74/jump-if-= $lookup-var:abort/disp8 - 8534 $lookup-var:end: - 8535 # . restore registers - 8536 58/pop-to-eax - 8537 # . epilogue - 8538 89/<- %esp 5/r32/ebp - 8539 5d/pop-to-ebp - 8540 c3/return - 8541 - 8542 $lookup-var:abort: - 8543 (write-buffered *(ebp+0x18) "fn ") - 8544 8b/-> *(ebp+0x14) 0/r32/eax - 8545 (lookup *eax *(eax+4)) # Function-name Function-name => eax - 8546 (write-buffered *(ebp+0x18) %eax) - 8547 (write-buffered *(ebp+0x18) ": unknown variable '") - 8548 (write-slice-buffered *(ebp+0x18) *(ebp+8)) - 8549 (write-buffered *(ebp+0x18) "'\n") - 8550 (flush *(ebp+0x18)) - 8551 (stop *(ebp+0x1c) 1) - 8552 # never gets here - 8553 - 8554 # return first 'name' from the top (back) of 'vars', and 0/null if not found - 8555 # ensure that 'name' if in a register is the topmost variable in that register - 8556 lookup-var-helper: # name: (addr slice), vars: (addr stack live-var), out: (addr handle var), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) - 8557 # pseudocode: - 8558 # var curr: (addr handle var) = &vars->data[vars->top - 12] - 8559 # var min = vars->data - 8560 # while curr >= min - 8561 # var v: (handle var) = *curr - 8562 # if v->name == name - 8563 # return - 8564 # curr -= 12 - 8565 # - 8566 # . prologue - 8567 55/push-ebp - 8568 89/<- %ebp 4/r32/esp - 8569 # . save registers - 8570 50/push-eax - 8571 51/push-ecx - 8572 52/push-edx - 8573 53/push-ebx - 8574 56/push-esi - 8575 57/push-edi - 8576 # clear out - 8577 (zero-out *(ebp+0x10) *Handle-size) - 8578 # esi = vars - 8579 8b/-> *(ebp+0xc) 6/r32/esi - 8580 # ebx = vars->top - 8581 8b/-> *esi 3/r32/ebx - 8582 # if (vars->top > vars->size) abort - 8583 3b/compare<- *(esi+4) 0/r32/eax - 8584 0f 8f/jump-if-> $lookup-var-helper:error1/disp32 - 8585 # var min/edx: (addr handle var) = vars->data - 8586 8d/copy-address *(esi+8) 2/r32/edx - 8587 # var curr/ebx: (addr handle var) = &vars->data[vars->top - 12] - 8588 8d/copy-address *(esi+ebx-4) 3/r32/ebx # vars + 8 + vars->type - 12 - 8589 # var var-in-reg/edi: 8 addrs - 8590 68/push 0/imm32 - 8591 68/push 0/imm32 - 8592 68/push 0/imm32 - 8593 68/push 0/imm32 - 8594 68/push 0/imm32 - 8595 68/push 0/imm32 - 8596 68/push 0/imm32 - 8597 68/push 0/imm32 - 8598 89/<- %edi 4/r32/esp - 8599 { - 8600 $lookup-var-helper:loop: - 8601 # if (curr < min) return - 8602 39/compare %ebx 2/r32/edx - 8603 0f 82/jump-if-addr< break/disp32 - 8604 # var v/ecx: (addr var) = lookup(*curr) - 8605 (lookup *ebx *(ebx+4)) # => eax - 8606 89/<- %ecx 0/r32/eax - 8607 # var vn/eax: (addr array byte) = lookup(v->name) - 8608 (lookup *ecx *(ecx+4)) # Var-name Var-name => eax - 8609 # if (vn == name) return curr - 8610 (slice-equal? *(ebp+8) %eax) # => eax - 8611 3d/compare-eax-and 0/imm32/false - 8612 { - 8613 74/jump-if-= break/disp8 - 8614 $lookup-var-helper:found: - 8615 # var vr/eax: (addr array byte) = lookup(v->register) - 8616 (lookup *(ecx+0x18) *(ecx+0x1c)) # Var-register Var-register => eax - 8617 3d/compare-eax-and 0/imm32 - 8618 { - 8619 74/jump-if-= break/disp8 - 8620 $lookup-var-helper:found-register: - 8621 # var reg/eax: int = get(Registers, vr) - 8622 (get Mu-registers %eax 0xc "Mu-registers") # => eax - 8623 8b/-> *eax 0/r32/eax - 8624 # if (var-in-reg[reg]) error - 8625 8b/-> *(edi+eax<<2) 0/r32/eax - 8626 3d/compare-eax-and 0/imm32 - 8627 0f 85/jump-if-!= $lookup-var-helper:error2/disp32 - 8628 } - 8629 $lookup-var-helper:return: - 8630 # esi = out - 8631 8b/-> *(ebp+0x10) 6/r32/esi - 8632 # *out = *curr - 8633 8b/-> *ebx 0/r32/eax - 8634 89/<- *esi 0/r32/eax - 8635 8b/-> *(ebx+4) 0/r32/eax - 8636 89/<- *(esi+4) 0/r32/eax - 8637 # return - 8638 eb/jump $lookup-var-helper:end/disp8 - 8639 } - 8640 # 'name' not yet found; update var-in-reg if v in register - 8641 # . var vr/eax: (addr array byte) = lookup(v->register) - 8642 (lookup *(ecx+0x18) *(ecx+0x1c)) # Var-register Var-register => eax - 8643 # . if (var == 0) continue - 8644 3d/compare-eax-and 0/imm32 - 8645 74/jump-if-= $lookup-var-helper:continue/disp8 - 8646 # . var reg/eax: int = get(Registers, vr) - 8647 (get Mu-registers %eax 0xc "Mu-registers") # => eax - 8648 8b/-> *eax 0/r32/eax - 8649 # . if (var-in-reg[reg] == 0) var-in-reg[reg] = v - 8650 81 7/subop/compare *(edi+eax<<2) 0/imm32 - 8651 75/jump-if-!= $lookup-var-helper:continue/disp8 - 8652 89/<- *(edi+eax<<2) 1/r32/ecx - 8653 $lookup-var-helper:continue: - 8654 # curr -= 12 - 8655 81 5/subop/subtract %ebx 0xc/imm32 - 8656 e9/jump loop/disp32 - 8657 } - 8658 $lookup-var-helper:end: - 8659 # . reclaim locals - 8660 81 0/subop/add %esp 0x20/imm32 - 8661 # . restore registers - 8662 5f/pop-to-edi - 8663 5e/pop-to-esi - 8664 5b/pop-to-ebx - 8665 5a/pop-to-edx - 8666 59/pop-to-ecx - 8667 58/pop-to-eax - 8668 # . epilogue - 8669 89/<- %esp 5/r32/ebp - 8670 5d/pop-to-ebp - 8671 c3/return - 8672 - 8673 $lookup-var-helper:error1: - 8674 (write-buffered *(ebp+0x18) "fn ") - 8675 8b/-> *(ebp+0x14) 0/r32/eax - 8676 (lookup *eax *(eax+4)) # Function-name Function-name => eax - 8677 (write-buffered *(ebp+0x18) %eax) - 8678 (write-buffered *(ebp+0x18) ": malformed stack when looking up '") - 8679 (write-slice-buffered *(ebp+0x18) *(ebp+8)) - 8680 (write-buffered *(ebp+0x18) "'\n") - 8681 (flush *(ebp+0x18)) - 8682 (stop *(ebp+0x1c) 1) - 8683 # never gets here - 8684 - 8685 $lookup-var-helper:error2: - 8686 # eax contains the conflicting var at this point - 8687 (write-buffered *(ebp+0x18) "fn ") - 8688 50/push-eax - 8689 8b/-> *(ebp+0x14) 0/r32/eax - 8690 (lookup *eax *(eax+4)) # Function-name Function-name => eax - 8691 (write-buffered *(ebp+0x18) %eax) - 8692 58/pop-eax - 8693 (write-buffered *(ebp+0x18) ": register ") - 8694 50/push-eax - 8695 (lookup *(eax+0x18) *(eax+0x1c)) # Var-register Var-register => eax - 8696 (write-buffered *(ebp+0x18) %eax) - 8697 58/pop-to-eax - 8698 (write-buffered *(ebp+0x18) " reads var '") - 8699 (write-slice-buffered *(ebp+0x18) *(ebp+8)) - 8700 (write-buffered *(ebp+0x18) "' after writing var '") - 8701 (lookup *eax *(eax+4)) # Var-name Var-name => eax - 8702 (write-buffered *(ebp+0x18) %eax) - 8703 (write-buffered *(ebp+0x18) "'\n") - 8704 (flush *(ebp+0x18)) - 8705 (stop *(ebp+0x1c) 1) - 8706 # never gets here - 8707 - 8708 dump-vars: # vars: (addr stack live-var) - 8709 # pseudocode: - 8710 # var curr: (addr handle var) = &vars->data[vars->top - 12] - 8711 # var min = vars->data - 8712 # while curr >= min - 8713 # var v: (handle var) = *curr - 8714 # print v - 8715 # curr -= 12 - 8716 # - 8717 # . prologue - 8718 55/push-ebp - 8719 89/<- %ebp 4/r32/esp - 8720 # . save registers - 8721 52/push-edx - 8722 53/push-ebx - 8723 56/push-esi - 8724 # esi = vars - 8725 8b/-> *(ebp+8) 6/r32/esi - 8726 # ebx = vars->top - 8727 8b/-> *esi 3/r32/ebx - 8728 # var min/edx: (addr handle var) = vars->data - 8729 8d/copy-address *(esi+8) 2/r32/edx - 8730 # var curr/ebx: (addr handle var) = &vars->data[vars->top - 12] - 8731 8d/copy-address *(esi+ebx-4) 3/r32/ebx # vars + 8 + vars->type - 12 - 8732 { - 8733 $dump-vars:loop: - 8734 # if (curr < min) return - 8735 39/compare %ebx 2/r32/edx - 8736 0f 82/jump-if-addr< break/disp32 - 8737 # - 8738 (write-buffered Stderr " var@") - 8739 (dump-var 2 %ebx) - 8740 # curr -= 12 - 8741 81 5/subop/subtract %ebx 0xc/imm32 - 8742 e9/jump loop/disp32 - 8743 } - 8744 $dump-vars:end: - 8745 # . restore registers - 8746 5e/pop-to-esi - 8747 5b/pop-to-ebx - 8748 5a/pop-to-edx - 8749 # . epilogue - 8750 89/<- %esp 5/r32/ebp - 8751 5d/pop-to-ebp - 8752 c3/return - 8753 - 8754 == data - 8755 # Like Registers, but no esp or ebp - 8756 Mu-registers: # (addr stream {(handle array byte), int}) - 8757 # a table is a stream - 8758 0x48/imm32/write - 8759 0/imm32/read - 8760 0x48/imm32/length - 8761 # data - 8762 # it is perfectly ok to use fake alloc-ids -- as long as you never try to reclaim them - 8763 0x11/imm32/alloc-id $Mu-register-eax/imm32 0/imm32 - 8764 0x11/imm32/alloc-id $Mu-register-ecx/imm32 1/imm32 - 8765 0x11/imm32/alloc-id $Mu-register-edx/imm32 2/imm32 - 8766 0x11/imm32/alloc-id $Mu-register-ebx/imm32 3/imm32 - 8767 0x11/imm32/alloc-id $Mu-register-esi/imm32 6/imm32 - 8768 0x11/imm32/alloc-id $Mu-register-edi/imm32 7/imm32 - 8769 - 8770 $Mu-register-eax: - 8771 0x11/imm32/alloc-id - 8772 3/imm32/size - 8773 0x65/e 0x61/a 0x78/x - 8774 - 8775 $Mu-register-ecx: - 8776 0x11/imm32/alloc-id - 8777 3/imm32/size - 8778 0x65/e 0x63/c 0x78/x - 8779 - 8780 $Mu-register-edx: - 8781 0x11/imm32/alloc-id - 8782 3/imm32/size - 8783 0x65/e 0x64/d 0x78/x - 8784 - 8785 $Mu-register-ebx: - 8786 0x11/imm32/alloc-id - 8787 3/imm32/size - 8788 0x65/e 0x62/b 0x78/x - 8789 - 8790 $Mu-register-esi: - 8791 0x11/imm32/alloc-id - 8792 3/imm32/size - 8793 0x65/e 0x73/s 0x69/i - 8794 - 8795 $Mu-register-edi: - 8796 0x11/imm32/alloc-id - 8797 3/imm32/size - 8798 0x65/e 0x64/d 0x69/i - 8799 - 8800 == code - 8801 - 8802 # return first 'name' from the top (back) of 'vars' and create a new var for a fn output if not found - 8803 lookup-var-or-find-in-fn-outputs: # name: (addr slice), vars: (addr stack live-var), fn: (addr function), out: (addr handle var), err: (addr buffered-file), ed: (addr exit-descriptor) - 8804 # . prologue - 8805 55/push-ebp - 8806 89/<- %ebp 4/r32/esp - 8807 # . save registers - 8808 50/push-eax - 8809 # - 8810 (lookup-var-helper *(ebp+8) *(ebp+0xc) *(ebp+0x14) *(ebp+0x10) *(ebp+0x18) *(ebp+0x1c)) # arg order slightly different; 'fn' is deemphasized - 8811 { - 8812 # if (out != 0) return - 8813 8b/-> *(ebp+0x14) 0/r32/eax - 8814 81 7/subop/compare *eax 0/imm32 - 8815 75/jump-if-!= break/disp8 - 8816 # if name is one of fn's outputs, return it - 8817 (find-in-function-outputs *(ebp+0x10) *(ebp+8) *(ebp+0x14)) - 8818 8b/-> *(ebp+0x14) 0/r32/eax - 8819 81 7/subop/compare *eax 0/imm32 - 8820 # otherwise abort - 8821 0f 84/jump-if-= $lookup-or-define-var:abort/disp32 - 8822 } - 8823 $lookup-or-define-var:end: - 8824 # . restore registers - 8825 58/pop-to-eax - 8826 # . epilogue - 8827 89/<- %esp 5/r32/ebp - 8828 5d/pop-to-ebp - 8829 c3/return + 7364 (parse-var-with-type %ecx _test-input-stream %edx Stderr 0) + 7365 # var v-addr/edx: (addr var) = lookup(v) + 7366 (lookup *edx *(edx+4)) # => eax + 7367 89/<- %edx 0/r32/eax + 7368 # check v-addr->name + 7369 (lookup *edx *(edx+4)) # Var-name Var-name => eax + 7370 (check-strings-equal %eax "x" "F - test-parse-var-with-type/name") + 7371 # check v-addr->type + 7372 (lookup *(edx+8) *(edx+0xc)) # Var-type Var-type => eax + 7373 (check-ints-equal *eax 1 "F - test-parse-var-with-type/type:0") # Type-tree-is-atom + 7374 (check-ints-equal *(eax+4) 1 "F - test-parse-var-with-type/type:1") # Type-tree-value + 7375 (check-ints-equal *(eax+0xc) 0 "F - test-parse-var-with-type/type:2") # Type-tree-right + 7376 # . epilogue + 7377 89/<- %esp 5/r32/ebp + 7378 5d/pop-to-ebp + 7379 c3/return + 7380 + 7381 test-parse-var-with-type-and-register: + 7382 # . prologue + 7383 55/push-ebp + 7384 89/<- %ebp 4/r32/esp + 7385 # (eax..ecx) = "x/eax:" + 7386 b8/copy-to-eax "x/eax:"/imm32 + 7387 8b/-> *eax 1/r32/ecx + 7388 8d/copy-address *(eax+ecx+4) 1/r32/ecx + 7389 05/add-to-eax 4/imm32 + 7390 # var slice/ecx: slice = {eax, ecx} + 7391 51/push-ecx + 7392 50/push-eax + 7393 89/<- %ecx 4/r32/esp + 7394 # _test-input-stream contains "int" + 7395 (clear-stream _test-input-stream) + 7396 (write _test-input-stream "int") + 7397 # var v/edx: (handle var) + 7398 68/push 0/imm32 + 7399 68/push 0/imm32 + 7400 89/<- %edx 4/r32/esp + 7401 # + 7402 (parse-var-with-type %ecx _test-input-stream %edx Stderr 0) + 7403 # var v-addr/edx: (addr var) = lookup(v) + 7404 (lookup *edx *(edx+4)) # => eax + 7405 89/<- %edx 0/r32/eax + 7406 # check v-addr->name + 7407 (lookup *edx *(edx+4)) # Var-name Var-name => eax + 7408 (check-strings-equal %eax "x" "F - test-parse-var-with-type-and-register/name") + 7409 # check v-addr->register + 7410 (lookup *(edx+0x18) *(edx+0x1c)) # Var-register Var-register => eax + 7411 (check-strings-equal %eax "eax" "F - test-parse-var-with-type-and-register/register") + 7412 # check v-addr->type + 7413 (lookup *(edx+8) *(edx+0xc)) # Var-type Var-type => eax + 7414 (check-ints-equal *eax 1 "F - test-parse-var-with-type-and-register/type:0") # Type-tree-is-atom + 7415 (check-ints-equal *(eax+4) 1 "F - test-parse-var-with-type-and-register/type:1") # Type-tree-left + 7416 (check-ints-equal *(eax+0xc) 0 "F - test-parse-var-with-type-and-register/type:2") # Type-tree-right + 7417 # . epilogue + 7418 89/<- %esp 5/r32/ebp + 7419 5d/pop-to-ebp + 7420 c3/return + 7421 + 7422 test-parse-var-with-trailing-characters: + 7423 # . prologue + 7424 55/push-ebp + 7425 89/<- %ebp 4/r32/esp + 7426 # (eax..ecx) = "x:" + 7427 b8/copy-to-eax "x:"/imm32 + 7428 8b/-> *eax 1/r32/ecx + 7429 8d/copy-address *(eax+ecx+4) 1/r32/ecx + 7430 05/add-to-eax 4/imm32 + 7431 # var slice/ecx: slice = {eax, ecx} + 7432 51/push-ecx + 7433 50/push-eax + 7434 89/<- %ecx 4/r32/esp + 7435 # _test-input-stream contains "int," + 7436 (clear-stream _test-input-stream) + 7437 (write _test-input-stream "int,") + 7438 # var v/edx: (handle var) + 7439 68/push 0/imm32 + 7440 68/push 0/imm32 + 7441 89/<- %edx 4/r32/esp + 7442 # + 7443 (parse-var-with-type %ecx _test-input-stream %edx Stderr 0) + 7444 # var v-addr/edx: (addr var) = lookup(v) + 7445 (lookup *edx *(edx+4)) # => eax + 7446 89/<- %edx 0/r32/eax + 7447 # check v-addr->name + 7448 (lookup *edx *(edx+4)) # Var-name Var-name => eax + 7449 (check-strings-equal %eax "x" "F - test-parse-var-with-trailing-characters/name") + 7450 # check v-addr->register + 7451 (check-ints-equal *(edx+0x18) 0 "F - test-parse-var-with-trailing-characters/register") # Var-register + 7452 # check v-addr->type + 7453 (lookup *(edx+8) *(edx+0xc)) # Var-type Var-type => eax + 7454 (check-ints-equal *eax 1 "F - test-parse-var-with-trailing-characters/type:0") # Type-tree-is-atom + 7455 (check-ints-equal *(eax+4) 1 "F - test-parse-var-with-trailing-characters/type:1") # Type-tree-left + 7456 (check-ints-equal *(eax+0xc) 0 "F - test-parse-var-with-trailing-characters/type:1") # Type-tree-right + 7457 # . epilogue + 7458 89/<- %esp 5/r32/ebp + 7459 5d/pop-to-ebp + 7460 c3/return + 7461 + 7462 test-parse-var-with-register-and-trailing-characters: + 7463 # . prologue + 7464 55/push-ebp + 7465 89/<- %ebp 4/r32/esp + 7466 # (eax..ecx) = "x/eax:" + 7467 b8/copy-to-eax "x/eax:"/imm32 + 7468 8b/-> *eax 1/r32/ecx + 7469 8d/copy-address *(eax+ecx+4) 1/r32/ecx + 7470 05/add-to-eax 4/imm32 + 7471 # var slice/ecx: slice = {eax, ecx} + 7472 51/push-ecx + 7473 50/push-eax + 7474 89/<- %ecx 4/r32/esp + 7475 # _test-input-stream contains "int," + 7476 (clear-stream _test-input-stream) + 7477 (write _test-input-stream "int,") + 7478 # var v/edx: (handle var) + 7479 68/push 0/imm32 + 7480 68/push 0/imm32 + 7481 89/<- %edx 4/r32/esp + 7482 # + 7483 (parse-var-with-type %ecx _test-input-stream %edx Stderr 0) + 7484 # var v-addr/edx: (addr var) = lookup(v) + 7485 (lookup *edx *(edx+4)) # => eax + 7486 89/<- %edx 0/r32/eax + 7487 # check v-addr->name + 7488 (lookup *edx *(edx+4)) # Var-name Var-name => eax + 7489 (check-strings-equal %eax "x" "F - test-parse-var-with-register-and-trailing-characters/name") + 7490 # check v-addr->register + 7491 (lookup *(edx+0x18) *(edx+0x1c)) # Var-register Var-register => eax + 7492 (check-strings-equal %eax "eax" "F - test-parse-var-with-register-and-trailing-characters/register") + 7493 # check v-addr->type + 7494 (lookup *(edx+8) *(edx+0xc)) # Var-type Var-type => eax + 7495 (check-ints-equal *eax 1 "F - test-parse-var-with-register-and-trailing-characters/type:0") # Type-tree-is-atom + 7496 (check-ints-equal *(eax+4) 1 "F - test-parse-var-with-register-and-trailing-characters/type:1") # Type-tree-left + 7497 (check-ints-equal *(eax+0xc) 0 "F - test-parse-var-with-register-and-trailing-characters/type:2") # Type-tree-right + 7498 # . epilogue + 7499 89/<- %esp 5/r32/ebp + 7500 5d/pop-to-ebp + 7501 c3/return + 7502 + 7503 test-parse-var-with-compound-type: + 7504 # . prologue + 7505 55/push-ebp + 7506 89/<- %ebp 4/r32/esp + 7507 # (eax..ecx) = "x:" + 7508 b8/copy-to-eax "x:"/imm32 + 7509 8b/-> *eax 1/r32/ecx + 7510 8d/copy-address *(eax+ecx+4) 1/r32/ecx + 7511 05/add-to-eax 4/imm32 + 7512 # var slice/ecx: slice = {eax, ecx} + 7513 51/push-ecx + 7514 50/push-eax + 7515 89/<- %ecx 4/r32/esp + 7516 # _test-input-stream contains "(addr int)" + 7517 (clear-stream _test-input-stream) + 7518 (write _test-input-stream "(addr int)") + 7519 # var v/edx: (handle var) + 7520 68/push 0/imm32 + 7521 68/push 0/imm32 + 7522 89/<- %edx 4/r32/esp + 7523 # + 7524 (parse-var-with-type %ecx _test-input-stream %edx Stderr 0) + 7525 # var v-addr/edx: (addr var) = lookup(v) + 7526 (lookup *edx *(edx+4)) # => eax + 7527 89/<- %edx 0/r32/eax + 7528 # check v-addr->name + 7529 (lookup *edx *(edx+4)) # Var-name Var-name => eax + 7530 (check-strings-equal %eax "x" "F - test-parse-var-with-compound-type/name") + 7531 # check v-addr->register + 7532 (check-ints-equal *(edx+0x18) 0 "F - test-parse-var-with-compound-type/register") # Var-register + 7533 # - check v-addr->type + 7534 # var type/edx: (addr type-tree) = var->type + 7535 (lookup *(edx+8) *(edx+0xc)) # Var-type Var-type => eax + 7536 89/<- %edx 0/r32/eax + 7537 # type is a non-atom + 7538 (check-ints-equal *edx 0 "F - test-parse-var-with-compound-type/type:0") # Type-tree-is-atom + 7539 # type->left == atom(addr) + 7540 (lookup *(edx+4) *(edx+8)) # Type-tree-left Type-tree-left => eax + 7541 (check-ints-equal *eax 1 "F - test-parse-var-with-compound-type/type:1") # Type-tree-is-atom + 7542 (check-ints-equal *(eax+4) 2 "F - test-parse-var-with-compound-type/type:2") # Type-tree-value + 7543 # type->right->left == atom(int) + 7544 (lookup *(edx+0xc) *(edx+0x10)) # Type-tree-right Type-tree-right => eax + 7545 (lookup *(eax+4) *(eax+8)) # Type-tree-left Type-tree-left => eax + 7546 (check-ints-equal *eax 1 "F - test-parse-var-with-compound-type/type:3") # Type-tree-is-atom + 7547 (check-ints-equal *(eax+4) 1 "F - test-parse-var-with-compound-type/type:4") # Type-tree-value + 7548 # type->right->right == null + 7549 (check-ints-equal *(eax+0xc) 0 "F - test-parse-var-with-compound-type/type:5") # Type-tree-right + 7550 # . epilogue + 7551 89/<- %esp 5/r32/ebp + 7552 5d/pop-to-ebp + 7553 c3/return + 7554 + 7555 # identifier starts with a letter or '$' or '_' + 7556 # no constraints at the moment on later letters + 7557 # all we really want to do so far is exclude '{', '}' and '->' + 7558 is-identifier?: # in: (addr slice) -> result/eax: boolean + 7559 # . prologue + 7560 55/push-ebp + 7561 89/<- %ebp 4/r32/esp + 7562 # if (slice-empty?(in)) return false + 7563 (slice-empty? *(ebp+8)) # => eax + 7564 3d/compare-eax-and 0/imm32/false + 7565 75/jump-if-!= $is-identifier?:false/disp8 + 7566 # var c/eax: byte = *in->start + 7567 8b/-> *(ebp+8) 0/r32/eax + 7568 8b/-> *eax 0/r32/eax + 7569 8a/copy-byte *eax 0/r32/AL + 7570 81 4/subop/and %eax 0xff/imm32 + 7571 # if (c == '$') return true + 7572 3d/compare-eax-and 0x24/imm32/$ + 7573 74/jump-if-= $is-identifier?:true/disp8 + 7574 # if (c == '_') return true + 7575 3d/compare-eax-and 0x5f/imm32/_ + 7576 74/jump-if-= $is-identifier?:true/disp8 + 7577 # drop case + 7578 25/and-eax-with 0x5f/imm32 + 7579 # if (c < 'A') return false + 7580 3d/compare-eax-and 0x41/imm32/A + 7581 7c/jump-if-< $is-identifier?:false/disp8 + 7582 # if (c > 'Z') return false + 7583 3d/compare-eax-and 0x5a/imm32/Z + 7584 7f/jump-if-> $is-identifier?:false/disp8 + 7585 # otherwise return true + 7586 $is-identifier?:true: + 7587 b8/copy-to-eax 1/imm32/true + 7588 eb/jump $is-identifier?:end/disp8 + 7589 $is-identifier?:false: + 7590 b8/copy-to-eax 0/imm32/false + 7591 $is-identifier?:end: + 7592 # . epilogue + 7593 89/<- %esp 5/r32/ebp + 7594 5d/pop-to-ebp + 7595 c3/return + 7596 + 7597 test-is-identifier-dollar: + 7598 # . prologue + 7599 55/push-ebp + 7600 89/<- %ebp 4/r32/esp + 7601 # (eax..ecx) = "$a" + 7602 b8/copy-to-eax "$a"/imm32 + 7603 8b/-> *eax 1/r32/ecx + 7604 8d/copy-address *(eax+ecx+4) 1/r32/ecx + 7605 05/add-to-eax 4/imm32 + 7606 # var slice/ecx: slice = {eax, ecx} + 7607 51/push-ecx + 7608 50/push-eax + 7609 89/<- %ecx 4/r32/esp + 7610 # + 7611 (is-identifier? %ecx) + 7612 (check-ints-equal %eax 1 "F - test-is-identifier-dollar") + 7613 # . epilogue + 7614 89/<- %esp 5/r32/ebp + 7615 5d/pop-to-ebp + 7616 c3/return + 7617 + 7618 test-is-identifier-underscore: + 7619 # . prologue + 7620 55/push-ebp + 7621 89/<- %ebp 4/r32/esp + 7622 # (eax..ecx) = "_a" + 7623 b8/copy-to-eax "_a"/imm32 + 7624 8b/-> *eax 1/r32/ecx + 7625 8d/copy-address *(eax+ecx+4) 1/r32/ecx + 7626 05/add-to-eax 4/imm32 + 7627 # var slice/ecx: slice = {eax, ecx} + 7628 51/push-ecx + 7629 50/push-eax + 7630 89/<- %ecx 4/r32/esp + 7631 # + 7632 (is-identifier? %ecx) + 7633 (check-ints-equal %eax 1 "F - test-is-identifier-underscore") + 7634 # . epilogue + 7635 89/<- %esp 5/r32/ebp + 7636 5d/pop-to-ebp + 7637 c3/return + 7638 + 7639 test-is-identifier-a: + 7640 # . prologue + 7641 55/push-ebp + 7642 89/<- %ebp 4/r32/esp + 7643 # (eax..ecx) = "a$" + 7644 b8/copy-to-eax "a$"/imm32 + 7645 8b/-> *eax 1/r32/ecx + 7646 8d/copy-address *(eax+ecx+4) 1/r32/ecx + 7647 05/add-to-eax 4/imm32 + 7648 # var slice/ecx: slice = {eax, ecx} + 7649 51/push-ecx + 7650 50/push-eax + 7651 89/<- %ecx 4/r32/esp + 7652 # + 7653 (is-identifier? %ecx) + 7654 (check-ints-equal %eax 1 "F - test-is-identifier-a") + 7655 # . epilogue + 7656 89/<- %esp 5/r32/ebp + 7657 5d/pop-to-ebp + 7658 c3/return + 7659 + 7660 test-is-identifier-z: + 7661 # . prologue + 7662 55/push-ebp + 7663 89/<- %ebp 4/r32/esp + 7664 # (eax..ecx) = "z$" + 7665 b8/copy-to-eax "z$"/imm32 + 7666 8b/-> *eax 1/r32/ecx + 7667 8d/copy-address *(eax+ecx+4) 1/r32/ecx + 7668 05/add-to-eax 4/imm32 + 7669 # var slice/ecx: slice = {eax, ecx} + 7670 51/push-ecx + 7671 50/push-eax + 7672 89/<- %ecx 4/r32/esp + 7673 # + 7674 (is-identifier? %ecx) + 7675 (check-ints-equal %eax 1 "F - test-is-identifier-z") + 7676 # . epilogue + 7677 89/<- %esp 5/r32/ebp + 7678 5d/pop-to-ebp + 7679 c3/return + 7680 + 7681 test-is-identifier-A: + 7682 # . prologue + 7683 55/push-ebp + 7684 89/<- %ebp 4/r32/esp + 7685 # (eax..ecx) = "A$" + 7686 b8/copy-to-eax "A$"/imm32 + 7687 8b/-> *eax 1/r32/ecx + 7688 8d/copy-address *(eax+ecx+4) 1/r32/ecx + 7689 05/add-to-eax 4/imm32 + 7690 # var slice/ecx: slice = {eax, ecx} + 7691 51/push-ecx + 7692 50/push-eax + 7693 89/<- %ecx 4/r32/esp + 7694 # + 7695 (is-identifier? %ecx) + 7696 (check-ints-equal %eax 1 "F - test-is-identifier-A") + 7697 # . epilogue + 7698 89/<- %esp 5/r32/ebp + 7699 5d/pop-to-ebp + 7700 c3/return + 7701 + 7702 test-is-identifier-Z: + 7703 # . prologue + 7704 55/push-ebp + 7705 89/<- %ebp 4/r32/esp + 7706 # (eax..ecx) = "Z$" + 7707 b8/copy-to-eax "Z$"/imm32 + 7708 8b/-> *eax 1/r32/ecx + 7709 8d/copy-address *(eax+ecx+4) 1/r32/ecx + 7710 05/add-to-eax 4/imm32 + 7711 # var slice/ecx: slice = {eax, ecx} + 7712 51/push-ecx + 7713 50/push-eax + 7714 89/<- %ecx 4/r32/esp + 7715 # + 7716 (is-identifier? %ecx) + 7717 (check-ints-equal %eax 1 "F - test-is-identifier-Z") + 7718 # . epilogue + 7719 89/<- %esp 5/r32/ebp + 7720 5d/pop-to-ebp + 7721 c3/return + 7722 + 7723 test-is-identifier-at: + 7724 # character before 'A' is invalid + 7725 # . prologue + 7726 55/push-ebp + 7727 89/<- %ebp 4/r32/esp + 7728 # (eax..ecx) = "@a" + 7729 b8/copy-to-eax "@a"/imm32 + 7730 8b/-> *eax 1/r32/ecx + 7731 8d/copy-address *(eax+ecx+4) 1/r32/ecx + 7732 05/add-to-eax 4/imm32 + 7733 # var slice/ecx: slice = {eax, ecx} + 7734 51/push-ecx + 7735 50/push-eax + 7736 89/<- %ecx 4/r32/esp + 7737 # + 7738 (is-identifier? %ecx) + 7739 (check-ints-equal %eax 0 "F - test-is-identifier-@") + 7740 # . epilogue + 7741 89/<- %esp 5/r32/ebp + 7742 5d/pop-to-ebp + 7743 c3/return + 7744 + 7745 test-is-identifier-square-bracket: + 7746 # character after 'Z' is invalid + 7747 # . prologue + 7748 55/push-ebp + 7749 89/<- %ebp 4/r32/esp + 7750 # (eax..ecx) = "[a" + 7751 b8/copy-to-eax "[a"/imm32 + 7752 8b/-> *eax 1/r32/ecx + 7753 8d/copy-address *(eax+ecx+4) 1/r32/ecx + 7754 05/add-to-eax 4/imm32 + 7755 # var slice/ecx: slice = {eax, ecx} + 7756 51/push-ecx + 7757 50/push-eax + 7758 89/<- %ecx 4/r32/esp + 7759 # + 7760 (is-identifier? %ecx) + 7761 (check-ints-equal %eax 0 "F - test-is-identifier-@") + 7762 # . epilogue + 7763 89/<- %esp 5/r32/ebp + 7764 5d/pop-to-ebp + 7765 c3/return + 7766 + 7767 test-is-identifier-backtick: + 7768 # character before 'a' is invalid + 7769 # . prologue + 7770 55/push-ebp + 7771 89/<- %ebp 4/r32/esp + 7772 # (eax..ecx) = "`a" + 7773 b8/copy-to-eax "`a"/imm32 + 7774 8b/-> *eax 1/r32/ecx + 7775 8d/copy-address *(eax+ecx+4) 1/r32/ecx + 7776 05/add-to-eax 4/imm32 + 7777 # var slice/ecx: slice = {eax, ecx} + 7778 51/push-ecx + 7779 50/push-eax + 7780 89/<- %ecx 4/r32/esp + 7781 # + 7782 (is-identifier? %ecx) + 7783 (check-ints-equal %eax 0 "F - test-is-identifier-backtick") + 7784 # . epilogue + 7785 89/<- %esp 5/r32/ebp + 7786 5d/pop-to-ebp + 7787 c3/return + 7788 + 7789 test-is-identifier-curly-brace-open: + 7790 # character after 'z' is invalid; also used for blocks + 7791 # . prologue + 7792 55/push-ebp + 7793 89/<- %ebp 4/r32/esp + 7794 # (eax..ecx) = "{a" + 7795 b8/copy-to-eax "{a"/imm32 + 7796 8b/-> *eax 1/r32/ecx + 7797 8d/copy-address *(eax+ecx+4) 1/r32/ecx + 7798 05/add-to-eax 4/imm32 + 7799 # var slice/ecx: slice = {eax, ecx} + 7800 51/push-ecx + 7801 50/push-eax + 7802 89/<- %ecx 4/r32/esp + 7803 # + 7804 (is-identifier? %ecx) + 7805 (check-ints-equal %eax 0 "F - test-is-identifier-curly-brace-open") + 7806 # . epilogue + 7807 89/<- %esp 5/r32/ebp + 7808 5d/pop-to-ebp + 7809 c3/return + 7810 + 7811 test-is-identifier-curly-brace-close: + 7812 # . prologue + 7813 55/push-ebp + 7814 89/<- %ebp 4/r32/esp + 7815 # (eax..ecx) = "}a" + 7816 b8/copy-to-eax "}a"/imm32 + 7817 8b/-> *eax 1/r32/ecx + 7818 8d/copy-address *(eax+ecx+4) 1/r32/ecx + 7819 05/add-to-eax 4/imm32 + 7820 # var slice/ecx: slice = {eax, ecx} + 7821 51/push-ecx + 7822 50/push-eax + 7823 89/<- %ecx 4/r32/esp + 7824 # + 7825 (is-identifier? %ecx) + 7826 (check-ints-equal %eax 0 "F - test-is-identifier-curly-brace-close") + 7827 # . epilogue + 7828 89/<- %esp 5/r32/ebp + 7829 5d/pop-to-ebp + 7830 c3/return + 7831 + 7832 test-is-identifier-hyphen: + 7833 # disallow leading '-' since '->' has special meaning + 7834 # . prologue + 7835 55/push-ebp + 7836 89/<- %ebp 4/r32/esp + 7837 # (eax..ecx) = "-a" + 7838 b8/copy-to-eax "-a"/imm32 + 7839 8b/-> *eax 1/r32/ecx + 7840 8d/copy-address *(eax+ecx+4) 1/r32/ecx + 7841 05/add-to-eax 4/imm32 + 7842 # var slice/ecx: slice = {eax, ecx} + 7843 51/push-ecx + 7844 50/push-eax + 7845 89/<- %ecx 4/r32/esp + 7846 # + 7847 (is-identifier? %ecx) + 7848 (check-ints-equal %eax 0 "F - test-is-identifier-hyphen") + 7849 # . epilogue + 7850 89/<- %esp 5/r32/ebp + 7851 5d/pop-to-ebp + 7852 c3/return + 7853 + 7854 populate-mu-function-body: # in: (addr buffered-file), out: (addr function), vars: (addr stack live-var), err: (addr buffered-file), ed: (addr exit-descriptor) + 7855 # . prologue + 7856 55/push-ebp + 7857 89/<- %ebp 4/r32/esp + 7858 # . save registers + 7859 50/push-eax + 7860 56/push-esi + 7861 57/push-edi + 7862 # esi = in + 7863 8b/-> *(ebp+8) 6/r32/esi + 7864 # edi = out + 7865 8b/-> *(ebp+0xc) 7/r32/edi + 7866 # initialize some global state + 7867 c7 0/subop/copy *Curr-block-depth 1/imm32 + 7868 # parse-mu-block(in, vars, out, out->body) + 7869 8d/copy-address *(edi+0x18) 0/r32/eax # Function-body + 7870 (parse-mu-block %esi *(ebp+0x10) %edi %eax *(ebp+0x14) *(ebp+0x18)) + 7871 $populate-mu-function-body:end: + 7872 # . restore registers + 7873 5f/pop-to-edi + 7874 5e/pop-to-esi + 7875 58/pop-to-eax + 7876 # . epilogue + 7877 89/<- %esp 5/r32/ebp + 7878 5d/pop-to-ebp + 7879 c3/return + 7880 + 7881 # parses a block, assuming that the leading '{' has already been read by the caller + 7882 parse-mu-block: # in: (addr buffered-file), vars: (addr stack live-var), fn: (addr function), out: (addr handle block), err: (addr buffered-file), ed: (addr exit-descriptor) + 7883 # pseudocode: + 7884 # var line: (stream byte 512) + 7885 # var word-slice: slice + 7886 # allocate(Heap, Stmt-size, out) + 7887 # var out-addr: (addr block) = lookup(*out) + 7888 # out-addr->tag = 0/block + 7889 # out-addr->var = some unique name + 7890 # push(vars, {out-addr->var, false}) + 7891 # while true # line loop + 7892 # clear-stream(line) + 7893 # read-line-buffered(in, line) + 7894 # if (line->write == 0) break # end of file + 7895 # word-slice = next-mu-token(line) + 7896 # if slice-empty?(word-slice) # end of line + 7897 # continue + 7898 # else if slice-starts-with?(word-slice, "#") + 7899 # continue + 7900 # else if slice-equal?(word-slice, "{") + 7901 # assert(no-tokens-in(line)) + 7902 # block = parse-mu-block(in, vars, fn) + 7903 # append-to-block(out-addr, block) + 7904 # else if slice-equal?(word-slice, "}") + 7905 # break + 7906 # else if slice-ends-with?(word-slice, ":") + 7907 # # TODO: error-check the rest of 'line' + 7908 # --word-slice->end to skip ':' + 7909 # named-block = parse-mu-named-block(word-slice, in, vars, fn) + 7910 # append-to-block(out-addr, named-block) + 7911 # else if slice-equal?(word-slice, "var") + 7912 # var-def = parse-mu-var-def(line, vars, fn) + 7913 # append-to-block(out-addr, var-def) + 7914 # else + 7915 # stmt = parse-mu-stmt(line, vars, fn) + 7916 # append-to-block(out-addr, stmt) + 7917 # pop(vars) + 7918 # + 7919 # . prologue + 7920 55/push-ebp + 7921 89/<- %ebp 4/r32/esp + 7922 # . save registers + 7923 50/push-eax + 7924 51/push-ecx + 7925 52/push-edx + 7926 53/push-ebx + 7927 57/push-edi + 7928 # var line/ecx: (stream byte 512) + 7929 81 5/subop/subtract %esp 0x200/imm32 + 7930 68/push 0x200/imm32/size + 7931 68/push 0/imm32/read + 7932 68/push 0/imm32/write + 7933 89/<- %ecx 4/r32/esp + 7934 # var word-slice/edx: slice + 7935 68/push 0/imm32/end + 7936 68/push 0/imm32/start + 7937 89/<- %edx 4/r32/esp + 7938 # allocate into out + 7939 (allocate Heap *Stmt-size *(ebp+0x14)) + 7940 # var out-addr/edi: (addr block) = lookup(*out) + 7941 8b/-> *(ebp+0x14) 7/r32/edi + 7942 (lookup *edi *(edi+4)) # => eax + 7943 89/<- %edi 0/r32/eax + 7944 # out-addr->tag is 0 (block) by default + 7945 # set out-addr->var + 7946 8d/copy-address *(edi+0xc) 0/r32/eax # Block-var + 7947 (new-block-name *(ebp+0x10) %eax) + 7948 # push(vars, out-addr->var) + 7949 (push *(ebp+0xc) *(edi+0xc)) # Block-var + 7950 (push *(ebp+0xc) *(edi+0x10)) # Block-var + 7951 (push *(ebp+0xc) 0) # false + 7952 # increment *Curr-block-depth + 7953 ff 0/subop/increment *Curr-block-depth + 7954 { + 7955 $parse-mu-block:line-loop: + 7956 # line = read-line-buffered(in) + 7957 (clear-stream %ecx) + 7958 (read-line-buffered *(ebp+8) %ecx) + 7959 #? (write-buffered Stderr "line: ") + 7960 #? (write-stream-data Stderr %ecx) + 7961 #? #? (write-buffered Stderr Newline) # line has its own newline + 7962 #? (flush Stderr) + 7963 #? (rewind-stream %ecx) + 7964 # if (line->write == 0) break + 7965 81 7/subop/compare *ecx 0/imm32 + 7966 0f 84/jump-if-= break/disp32 + 7967 #? (write-buffered Stderr "vars:\n") + 7968 #? (dump-vars *(ebp+0xc)) + 7969 # word-slice = next-mu-token(line) + 7970 (next-mu-token %ecx %edx) + 7971 #? (write-buffered Stderr "word: ") + 7972 #? (write-slice-buffered Stderr %edx) + 7973 #? (write-buffered Stderr Newline) + 7974 #? (flush Stderr) + 7975 # if slice-empty?(word-slice) continue + 7976 (slice-empty? %edx) + 7977 3d/compare-eax-and 0/imm32/false + 7978 0f 85/jump-if-!= loop/disp32 + 7979 # if (slice-starts-with?(word-slice, '#') continue + 7980 # . eax = *word-slice->start + 7981 8b/-> *edx 0/r32/eax + 7982 8a/copy-byte *eax 0/r32/AL + 7983 81 4/subop/and %eax 0xff/imm32 + 7984 # . if (eax == '#') continue + 7985 3d/compare-eax-and 0x23/imm32/hash + 7986 0f 84/jump-if-= loop/disp32 + 7987 # if slice-equal?(word-slice, "{") + 7988 { + 7989 $parse-mu-block:check-for-block: + 7990 (slice-equal? %edx "{") + 7991 3d/compare-eax-and 0/imm32/false + 7992 74/jump-if-= break/disp8 + 7993 (check-no-tokens-left %ecx) + 7994 # parse new block and append + 7995 # . var tmp/eax: (handle block) + 7996 68/push 0/imm32 + 7997 68/push 0/imm32 + 7998 89/<- %eax 4/r32/esp + 7999 # . + 8000 (parse-mu-block *(ebp+8) *(ebp+0xc) *(ebp+0x10) %eax *(ebp+0x18) *(ebp+0x1c)) + 8001 (append-to-block Heap %edi *eax *(eax+4)) + 8002 # . reclaim tmp + 8003 81 0/subop/add %esp 8/imm32 + 8004 # . + 8005 e9/jump $parse-mu-block:line-loop/disp32 + 8006 } + 8007 # if slice-equal?(word-slice, "}") break + 8008 $parse-mu-block:check-for-end: + 8009 (slice-equal? %edx "}") + 8010 3d/compare-eax-and 0/imm32/false + 8011 0f 85/jump-if-!= break/disp32 + 8012 # if slice-ends-with?(word-slice, ":") parse named block and append + 8013 { + 8014 $parse-mu-block:check-for-named-block: + 8015 # . eax = *(word-slice->end-1) + 8016 8b/-> *(edx+4) 0/r32/eax + 8017 48/decrement-eax + 8018 8a/copy-byte *eax 0/r32/AL + 8019 81 4/subop/and %eax 0xff/imm32 + 8020 # . if (eax != ':') break + 8021 3d/compare-eax-and 0x3a/imm32/colon + 8022 0f 85/jump-if-!= break/disp32 + 8023 # TODO: error-check the rest of 'line' + 8024 # + 8025 # skip ':' + 8026 ff 1/subop/decrement *(edx+4) # Slice-end + 8027 # var tmp/eax: (handle block) + 8028 68/push 0/imm32 + 8029 68/push 0/imm32 + 8030 89/<- %eax 4/r32/esp + 8031 # + 8032 (parse-mu-named-block %edx *(ebp+8) *(ebp+0xc) *(ebp+0x10) %eax *(ebp+0x18) *(ebp+0x1c)) + 8033 (append-to-block Heap %edi *eax *(eax+4)) + 8034 # reclaim tmp + 8035 81 0/subop/add %esp 8/imm32 + 8036 # + 8037 e9/jump $parse-mu-block:line-loop/disp32 + 8038 } + 8039 # if slice-equal?(word-slice, "var") + 8040 { + 8041 $parse-mu-block:check-for-var: + 8042 (slice-equal? %edx "var") + 8043 3d/compare-eax-and 0/imm32/false + 8044 74/jump-if-= break/disp8 + 8045 # var tmp/eax: (handle block) + 8046 68/push 0/imm32 + 8047 68/push 0/imm32 + 8048 89/<- %eax 4/r32/esp + 8049 # + 8050 (parse-mu-var-def %ecx *(ebp+0xc) %eax *(ebp+0x10) *(ebp+0x18) *(ebp+0x1c)) + 8051 (append-to-block Heap %edi *eax *(eax+4)) + 8052 # reclaim tmp + 8053 81 0/subop/add %esp 8/imm32 + 8054 # + 8055 e9/jump $parse-mu-block:line-loop/disp32 + 8056 } + 8057 $parse-mu-block:regular-stmt: + 8058 # otherwise + 8059 # var tmp/eax: (handle block) + 8060 68/push 0/imm32 + 8061 68/push 0/imm32 + 8062 89/<- %eax 4/r32/esp + 8063 # + 8064 (parse-mu-stmt %ecx *(ebp+0xc) *(ebp+0x10) %eax *(ebp+0x18) *(ebp+0x1c)) + 8065 (append-to-block Heap %edi *eax *(eax+4)) + 8066 # reclaim tmp + 8067 81 0/subop/add %esp 8/imm32 + 8068 # + 8069 e9/jump loop/disp32 + 8070 } # end line loop + 8071 (clean-up-blocks *(ebp+0xc) *Curr-block-depth *(ebp+0x10)) + 8072 # decrement *Curr-block-depth + 8073 ff 1/subop/decrement *Curr-block-depth + 8074 # pop(vars) + 8075 (pop *(ebp+0xc)) # => eax + 8076 (pop *(ebp+0xc)) # => eax + 8077 (pop *(ebp+0xc)) # => eax + 8078 $parse-mu-block:end: + 8079 # . reclaim locals + 8080 81 0/subop/add %esp 0x214/imm32 + 8081 # . restore registers + 8082 5f/pop-to-edi + 8083 5b/pop-to-ebx + 8084 5a/pop-to-edx + 8085 59/pop-to-ecx + 8086 58/pop-to-eax + 8087 # . epilogue + 8088 89/<- %esp 5/r32/ebp + 8089 5d/pop-to-ebp + 8090 c3/return + 8091 + 8092 $parse-mu-block:abort: + 8093 # error("'{' or '}' should be on its own line, but got '") + 8094 (write-buffered *(ebp+0x18) "'{' or '}' should be on its own line, but got '") + 8095 (rewind-stream %ecx) + 8096 (write-stream-data *(ebp+0x18) %ecx) + 8097 (write-buffered *(ebp+0x18) "'\n") + 8098 (flush *(ebp+0x18)) + 8099 (stop *(ebp+0x1c) 1) + 8100 # never gets here + 8101 + 8102 new-block-name: # fn: (addr function), out: (addr handle var) + 8103 # . prologue + 8104 55/push-ebp + 8105 89/<- %ebp 4/r32/esp + 8106 # . save registers + 8107 50/push-eax + 8108 51/push-ecx + 8109 52/push-edx + 8110 # var n/ecx: int = len(fn->name) + 10 for an int + 2 for '$:' + 8111 8b/-> *(ebp+8) 0/r32/eax + 8112 (lookup *eax *(eax+4)) # Function-name Function-name => eax + 8113 8b/-> *eax 0/r32/eax # String-size + 8114 05/add-to-eax 0xd/imm32 # 10 + 2 for '$:' + 8115 89/<- %ecx 0/r32/eax + 8116 # var name/edx: (stream byte n) + 8117 29/subtract-from %esp 1/r32/ecx + 8118 ff 6/subop/push %ecx + 8119 68/push 0/imm32/read + 8120 68/push 0/imm32/write + 8121 89/<- %edx 4/r32/esp + 8122 (clear-stream %edx) + 8123 # eax = fn->name + 8124 8b/-> *(ebp+8) 0/r32/eax + 8125 (lookup *eax *(eax+4)) # Function-name Function-name => eax + 8126 # construct result using Next-block-index (and increment it) + 8127 (write %edx "$") + 8128 (write %edx %eax) + 8129 (write %edx ":") + 8130 (write-int32-hex %edx *Next-block-index) + 8131 ff 0/subop/increment *Next-block-index + 8132 # var s/eax: slice = {name->data, name->data + name->write} (clobbering edx) + 8133 # . eax = name->write + 8134 8b/-> *edx 0/r32/eax + 8135 # . edx = name->data + 8136 8d/copy-address *(edx+0xc) 2/r32/edx + 8137 # . eax = name->write + name->data + 8138 01/add-to %eax 2/r32/edx + 8139 # . push {edx, eax} + 8140 ff 6/subop/push %eax + 8141 ff 6/subop/push %edx + 8142 89/<- %eax 4/r32/esp + 8143 # out = new literal(s) + 8144 (new-literal Heap %eax *(ebp+0xc)) + 8145 #? 8b/-> *(ebp+0xc) 0/r32/eax + 8146 #? (write-buffered Stderr "type allocid in caller after new-literal: ") + 8147 #? (write-int32-hex-buffered Stderr *(eax+8)) + 8148 #? (write-buffered Stderr " for var ") + 8149 #? (write-int32-hex-buffered Stderr %eax) + 8150 #? (write-buffered Stderr Newline) + 8151 #? (flush Stderr) + 8152 $new-block-name:end: + 8153 # . reclaim locals + 8154 81 0/subop/add %ecx 0xc/imm32 # name.{read/write/len} + 8155 81 0/subop/add %ecx 8/imm32 # slice + 8156 01/add-to %esp 1/r32/ecx + 8157 # . restore registers + 8158 5a/pop-to-edx + 8159 59/pop-to-ecx + 8160 58/pop-to-eax + 8161 # . epilogue + 8162 89/<- %esp 5/r32/ebp + 8163 5d/pop-to-ebp + 8164 c3/return + 8165 + 8166 check-no-tokens-left: # line: (addr stream byte) + 8167 # . prologue + 8168 55/push-ebp + 8169 89/<- %ebp 4/r32/esp + 8170 # . save registers + 8171 50/push-eax + 8172 51/push-ecx + 8173 # var s/ecx: slice + 8174 68/push 0/imm32/end + 8175 68/push 0/imm32/start + 8176 89/<- %ecx 4/r32/esp + 8177 # + 8178 (next-mu-token *(ebp+8) %ecx) + 8179 # if slice-empty?(s) return + 8180 (slice-empty? %ecx) + 8181 3d/compare-eax-and 0/imm32/false + 8182 75/jump-if-!= $check-no-tokens-left:end/disp8 + 8183 # if (slice-starts-with?(s, '#') return + 8184 # . eax = *s->start + 8185 8b/-> *edx 0/r32/eax + 8186 8a/copy-byte *eax 0/r32/AL + 8187 81 4/subop/and %eax 0xff/imm32 + 8188 # . if (eax == '#') continue + 8189 3d/compare-eax-and 0x23/imm32/hash + 8190 74/jump-if-= $check-no-tokens-left:end/disp8 + 8191 # abort + 8192 (write-buffered Stderr "'{' or '}' should be on its own line, but got '") + 8193 (rewind-stream %ecx) + 8194 (write-stream 2 %ecx) + 8195 (write-buffered Stderr "'\n") + 8196 (flush Stderr) + 8197 # . syscall(exit, 1) + 8198 bb/copy-to-ebx 1/imm32 + 8199 e8/call syscall_exit/disp32 + 8200 # never gets here + 8201 $check-no-tokens-left:end: + 8202 # . reclaim locals + 8203 81 0/subop/add %esp 8/imm32 + 8204 # . restore registers + 8205 59/pop-to-ecx + 8206 58/pop-to-eax + 8207 # . epilogue + 8208 89/<- %esp 5/r32/ebp + 8209 5d/pop-to-ebp + 8210 c3/return + 8211 + 8212 parse-mu-named-block: # name: (addr slice), in: (addr buffered-file), vars: (addr stack live-var), fn: (addr function), out: (addr handle stmt), err: (addr buffered-file), ed: (addr exit-descriptor) + 8213 # pseudocode: + 8214 # var v: (handle var) + 8215 # new-literal(name, v) + 8216 # push(vars, {v, false}) + 8217 # parse-mu-block(in, vars, fn, out) + 8218 # pop(vars) + 8219 # out->tag = block + 8220 # out->var = v + 8221 # + 8222 # . prologue + 8223 55/push-ebp + 8224 89/<- %ebp 4/r32/esp + 8225 # . save registers + 8226 50/push-eax + 8227 51/push-ecx + 8228 57/push-edi + 8229 # var v/ecx: (handle var) + 8230 68/push 0/imm32 + 8231 68/push 0/imm32 + 8232 89/<- %ecx 4/r32/esp + 8233 # + 8234 (new-literal Heap *(ebp+8) %ecx) + 8235 # push(vars, v) + 8236 (push *(ebp+0x10) *ecx) + 8237 (push *(ebp+0x10) *(ecx+4)) + 8238 (push *(ebp+0x10) 0) # false + 8239 # + 8240 (parse-mu-block *(ebp+0xc) *(ebp+0x10) *(ebp+0x14) *(ebp+0x18) *(ebp+0x1c) *(ebp+0x20)) + 8241 # pop v off vars + 8242 (pop *(ebp+0x10)) # => eax + 8243 (pop *(ebp+0x10)) # => eax + 8244 (pop *(ebp+0x10)) # => eax + 8245 # var out-addr/edi: (addr stmt) = lookup(*out) + 8246 8b/-> *(ebp+0x18) 7/r32/edi + 8247 (lookup *edi *(edi+4)) # => eax + 8248 89/<- %edi 0/r32/eax + 8249 # out-addr->tag = named-block + 8250 c7 0/subop/copy *edi 0/imm32/block # Stmt-tag + 8251 # out-addr->var = v + 8252 8b/-> *ecx 0/r32/eax + 8253 89/<- *(edi+0xc) 0/r32/eax # Block-var + 8254 8b/-> *(ecx+4) 0/r32/eax + 8255 89/<- *(edi+0x10) 0/r32/eax # Block-var + 8256 $parse-mu-named-block:end: + 8257 # . reclaim locals + 8258 81 0/subop/add %esp 8/imm32 + 8259 # . restore registers + 8260 5f/pop-to-edi + 8261 59/pop-to-ecx + 8262 58/pop-to-eax + 8263 # . epilogue + 8264 89/<- %esp 5/r32/ebp + 8265 5d/pop-to-ebp + 8266 c3/return + 8267 + 8268 parse-mu-var-def: # line: (addr stream byte), vars: (addr stack live-var), out: (addr handle stmt), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) + 8269 # . prologue + 8270 55/push-ebp + 8271 89/<- %ebp 4/r32/esp + 8272 # . save registers + 8273 50/push-eax + 8274 51/push-ecx + 8275 52/push-edx + 8276 53/push-ebx + 8277 57/push-edi + 8278 # edi = out + 8279 8b/-> *(ebp+0x10) 7/r32/edi + 8280 # var word-slice/ecx: slice + 8281 68/push 0/imm32/end + 8282 68/push 0/imm32/start + 8283 89/<- %ecx 4/r32/esp + 8284 # var v/edx: (handle var) + 8285 68/push 0/imm32 + 8286 68/push 0/imm32 + 8287 89/<- %edx 4/r32/esp + 8288 # v = parse-var-with-type(next-mu-token(line)) + 8289 (next-mu-token *(ebp+8) %ecx) + 8290 (parse-var-with-type %ecx *(ebp+8) %edx *(ebp+0x18) *(ebp+0x1c)) + 8291 # var v-addr/eax: (addr var) + 8292 (lookup *edx *(edx+4)) # => eax + 8293 # v->block-depth = *Curr-block-depth + 8294 8b/-> *Curr-block-depth 3/r32/ebx + 8295 89/<- *(eax+0x10) 3/r32/ebx # Var-block-depth + 8296 # either v has no register and there's no more to this line + 8297 8b/-> *(eax+0x18) 0/r32/eax # Var-register + 8298 3d/compare-eax-and 0/imm32 + 8299 { + 8300 75/jump-if-!= break/disp8 + 8301 # TODO: disallow vars of type 'byte' on the stack + 8302 # ensure that there's nothing else on this line + 8303 (next-mu-token *(ebp+8) %ecx) + 8304 (slice-empty? %ecx) # => eax + 8305 3d/compare-eax-and 0/imm32/false + 8306 0f 84/jump-if-= $parse-mu-var-def:error2/disp32 + 8307 # + 8308 (new-var-def Heap *edx *(edx+4) %edi) + 8309 e9/jump $parse-mu-var-def:update-vars/disp32 + 8310 } + 8311 # or v has a register and there's more to this line + 8312 { + 8313 0f 84/jump-if-= break/disp32 + 8314 # TODO: disallow vars of type 'byte' in registers 'esi' or 'edi' + 8315 # TODO: vars of type 'byte' should only be initialized by clearing to 0 + 8316 # ensure that the next word is '<-' + 8317 (next-mu-token *(ebp+8) %ecx) + 8318 (slice-equal? %ecx "<-") # => eax + 8319 3d/compare-eax-and 0/imm32/false + 8320 0f 84/jump-if-= $parse-mu-var-def:error1/disp32 + 8321 # + 8322 (new-reg-var-def Heap *edx *(edx+4) %edi) + 8323 (lookup *edi *(edi+4)) # => eax + 8324 (add-operation-and-inputs-to-stmt %eax *(ebp+8) *(ebp+0xc) *(ebp+0x14) *(ebp+0x18) *(ebp+0x1c)) + 8325 } + 8326 $parse-mu-var-def:update-vars: + 8327 # push 'v' at end of function + 8328 (push *(ebp+0xc) *edx) + 8329 (push *(ebp+0xc) *(edx+4)) + 8330 (push *(ebp+0xc) 0) # Live-var-register-spilled is unused during parsing + 8331 $parse-mu-var-def:end: + 8332 # . reclaim locals + 8333 81 0/subop/add %esp 0x10/imm32 + 8334 # . restore registers + 8335 5f/pop-to-edi + 8336 5b/pop-to-ebx + 8337 5a/pop-to-edx + 8338 59/pop-to-ecx + 8339 58/pop-to-eax + 8340 # . epilogue + 8341 89/<- %esp 5/r32/ebp + 8342 5d/pop-to-ebp + 8343 c3/return + 8344 + 8345 $parse-mu-var-def:error1: + 8346 (rewind-stream *(ebp+8)) + 8347 # error("register variable requires a valid instruction to initialize but got '" line "'\n") + 8348 (write-buffered *(ebp+0x18) "register variable requires a valid instruction to initialize but got '") + 8349 (flush *(ebp+0x18)) + 8350 (write-stream-data *(ebp+0x18) *(ebp+8)) + 8351 (write-buffered *(ebp+0x18) "'\n") + 8352 (flush *(ebp+0x18)) + 8353 (stop *(ebp+0x1c) 1) + 8354 # never gets here + 8355 + 8356 $parse-mu-var-def:error2: + 8357 (rewind-stream *(ebp+8)) + 8358 # error("fn " fn ": var " var ": variables on the stack can't take an initializer\n") + 8359 (write-buffered *(ebp+0x18) "fn ") + 8360 8b/-> *(ebp+0x14) 0/r32/eax + 8361 (lookup *eax *(eax+4)) # Function-name Function-name => eax + 8362 (write-buffered *(ebp+0x18) %eax) + 8363 (write-buffered *(ebp+0x18) ": var ") + 8364 # var v-addr/eax: (addr var) = lookup(v) + 8365 (lookup *edx *(edx+4)) # => eax + 8366 (lookup *eax *(eax+4)) # Var-name Var-name => eax + 8367 (write-buffered *(ebp+0x18) %eax) + 8368 (write-buffered *(ebp+0x18) ": variables on the stack can't take an initializer\n") + 8369 (flush *(ebp+0x18)) + 8370 (stop *(ebp+0x1c) 1) + 8371 # never gets here + 8372 + 8373 test-parse-mu-var-def: + 8374 # 'var n: int' + 8375 # . prologue + 8376 55/push-ebp + 8377 89/<- %ebp 4/r32/esp + 8378 # setup + 8379 (clear-stream _test-input-stream) + 8380 (write _test-input-stream "n: int\n") # caller has consumed the 'var' + 8381 c7 0/subop/copy *Curr-block-depth 1/imm32 + 8382 # var out/esi: (handle stmt) + 8383 68/push 0/imm32 + 8384 68/push 0/imm32 + 8385 89/<- %esi 4/r32/esp + 8386 # var vars/ecx: (stack (addr var) 16) + 8387 81 5/subop/subtract %esp 0xc0/imm32 + 8388 68/push 0xc0/imm32/size + 8389 68/push 0/imm32/top + 8390 89/<- %ecx 4/r32/esp + 8391 (clear-stack %ecx) + 8392 # convert + 8393 (parse-mu-var-def _test-input-stream %ecx %esi 0 Stderr 0) + 8394 # var out-addr/esi: (addr stmt) + 8395 (lookup *esi *(esi+4)) # => eax + 8396 89/<- %esi 0/r32/eax + 8397 # + 8398 (check-ints-equal *esi 2 "F - test-parse-mu-var-def/tag") # Stmt-tag is var-def + 8399 # var v/ecx: (addr var) = lookup(out->var) + 8400 (lookup *(esi+4) *(esi+8)) # Vardef-var Vardef-var => eax + 8401 89/<- %ecx 0/r32/eax + 8402 # v->name + 8403 (lookup *ecx *(ecx+4)) # Var-name Var-name => eax + 8404 (check-strings-equal %eax "n" "F - test-parse-mu-var-def/var-name") + 8405 # v->register + 8406 (check-ints-equal *(ecx+0x18) 0 "F - test-parse-mu-var-def/var-register") # Var-register + 8407 # v->block-depth + 8408 (check-ints-equal *(ecx+0x10) 1 "F - test-parse-mu-var-def/output-block-depth") # Var-block-depth + 8409 # v->type == int + 8410 (lookup *(ecx+8) *(ecx+0xc)) # Var-type Var-type => eax + 8411 (check-ints-equal *eax 1 "F - test-parse-mu-var-def/var-type:0") # Type-tree-is-atom + 8412 (check-ints-equal *(eax+4) 1 "F - test-parse-mu-var-def/var-type:1") # Type-tree-value + 8413 (check-ints-equal *(eax+0xc) 0 "F - test-parse-mu-var-def/var-type:2") # Type-tree-right + 8414 # . epilogue + 8415 89/<- %esp 5/r32/ebp + 8416 5d/pop-to-ebp + 8417 c3/return + 8418 + 8419 test-parse-mu-reg-var-def: + 8420 # 'var n/eax: int <- copy 0' + 8421 # . prologue + 8422 55/push-ebp + 8423 89/<- %ebp 4/r32/esp + 8424 # setup + 8425 (clear-stream _test-input-stream) + 8426 (write _test-input-stream "n/eax: int <- copy 0\n") # caller has consumed the 'var' + 8427 c7 0/subop/copy *Curr-block-depth 1/imm32 + 8428 # var out/esi: (handle stmt) + 8429 68/push 0/imm32 + 8430 68/push 0/imm32 + 8431 89/<- %esi 4/r32/esp + 8432 # var vars/ecx: (stack (addr var) 16) + 8433 81 5/subop/subtract %esp 0xc0/imm32 + 8434 68/push 0xc0/imm32/size + 8435 68/push 0/imm32/top + 8436 89/<- %ecx 4/r32/esp + 8437 (clear-stack %ecx) + 8438 # convert + 8439 (parse-mu-var-def _test-input-stream %ecx %esi 0 Stderr 0) + 8440 # var out-addr/esi: (addr stmt) + 8441 (lookup *esi *(esi+4)) # => eax + 8442 89/<- %esi 0/r32/eax + 8443 # + 8444 (check-ints-equal *esi 3 "F - test-parse-mu-reg-var-def/tag") # Stmt-tag is reg-var-def + 8445 # var v/ecx: (addr var) = lookup(out->outputs->value) + 8446 # . eax: (addr stmt-var) = lookup(out->outputs) + 8447 (lookup *(esi+0x14) *(esi+0x18)) # Regvardef-outputs Regvardef-outputs => eax + 8448 # . + 8449 (check-ints-equal *(eax+8) 0 "F - test-parse-mu-reg-var-def/single-output") # Stmt-var-next + 8450 # . eax: (addr var) = lookup(eax->value) + 8451 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax + 8452 # . ecx = eax + 8453 89/<- %ecx 0/r32/eax + 8454 # v->name + 8455 (lookup *ecx *(ecx+4)) # Var-name Var-name => eax + 8456 (check-strings-equal %eax "n" "F - test-parse-mu-reg-var-def/output-name") # Var-name + 8457 # v->register + 8458 (lookup *(ecx+0x18) *(ecx+0x1c)) # Var-register Var-register => eax + 8459 (check-strings-equal %eax "eax" "F - test-parse-mu-reg-var-def/output-register") + 8460 # v->block-depth + 8461 (check-ints-equal *(ecx+0x10) 1 "F - test-parse-mu-reg-var-def/output-block-depth") # Var-block-depth + 8462 # v->type == int + 8463 (lookup *(ecx+8) *(ecx+0xc)) # Var-type Var-type => eax + 8464 (check-ints-equal *eax 1 "F - test-parse-mu-reg-var-def/output-type:0") # Type-tree-is-atom + 8465 (check-ints-equal *(eax+4) 1 "F - test-parse-mu-reg-var-def/output-type:1") # Type-tree-value + 8466 (check-ints-equal *(eax+0xc) 0 "F - test-parse-mu-reg-var-def/output-type:2") # Type-tree-right + 8467 # . epilogue + 8468 89/<- %esp 5/r32/ebp + 8469 5d/pop-to-ebp + 8470 c3/return + 8471 + 8472 parse-mu-stmt: # line: (addr stream byte), vars: (addr stack live-var), fn: (addr function), out: (addr handle stmt), err: (addr buffered-file), ed: (addr exit-descriptor) + 8473 # Carefully push any outputs on the vars stack _after_ reading the inputs + 8474 # that may conflict with them. + 8475 # + 8476 # The only situation in which outputs are pushed here (when it's not a + 8477 # 'var' vardef stmt), and so can possibly conflict with inputs, is if the + 8478 # output is a function output. + 8479 # + 8480 # pseudocode: + 8481 # var name: slice + 8482 # allocate(Heap, Stmt-size, out) + 8483 # var out-addr: (addr stmt) = lookup(*out) + 8484 # out-addr->tag = stmt + 8485 # if stmt-has-outputs?(line) + 8486 # while true + 8487 # name = next-mu-token(line) + 8488 # if (name == '<-') break + 8489 # assert(is-identifier?(name)) + 8490 # var v: (handle var) = lookup-var-or-find-in-fn-outputs(name, vars, fn) + 8491 # out-addr->outputs = append(v, out-addr->outputs) + 8492 # add-operation-and-inputs-to-stmt(out-addr, line, vars) + 8493 # for output in stmt->outputs: + 8494 # maybe-define-var(output, vars) + 8495 # + 8496 # . prologue + 8497 55/push-ebp + 8498 89/<- %ebp 4/r32/esp + 8499 # . save registers + 8500 50/push-eax + 8501 51/push-ecx + 8502 52/push-edx + 8503 53/push-ebx + 8504 57/push-edi + 8505 # var name/ecx: slice + 8506 68/push 0/imm32/end + 8507 68/push 0/imm32/start + 8508 89/<- %ecx 4/r32/esp + 8509 # var is-deref?/edx: boolean = false + 8510 ba/copy-to-edx 0/imm32/false + 8511 # var v: (handle var) + 8512 68/push 0/imm32 + 8513 68/push 0/imm32 + 8514 89/<- %ebx 4/r32/esp + 8515 # + 8516 (allocate Heap *Stmt-size *(ebp+0x14)) + 8517 # var out-addr/edi: (addr stmt) = lookup(*out) + 8518 8b/-> *(ebp+0x14) 7/r32/edi + 8519 (lookup *edi *(edi+4)) # => eax + 8520 89/<- %edi 0/r32/eax + 8521 # out-addr->tag = 1/stmt + 8522 c7 0/subop/copy *edi 1/imm32/stmt1 # Stmt-tag + 8523 { + 8524 (stmt-has-outputs? *(ebp+8)) + 8525 3d/compare-eax-and 0/imm32/false + 8526 0f 84/jump-if-= break/disp32 + 8527 { + 8528 $parse-mu-stmt:read-outputs: + 8529 # name = next-mu-token(line) + 8530 (next-mu-token *(ebp+8) %ecx) + 8531 # if slice-empty?(word-slice) break + 8532 (slice-empty? %ecx) # => eax + 8533 3d/compare-eax-and 0/imm32/false + 8534 0f 85/jump-if-!= break/disp32 + 8535 # if (name == "<-") break + 8536 (slice-equal? %ecx "<-") # => eax + 8537 3d/compare-eax-and 0/imm32/false + 8538 0f 85/jump-if-!= break/disp32 + 8539 # is-deref? = false + 8540 ba/copy-to-edx 0/imm32/false + 8541 # if (slice-starts-with?(name, '*')) ++name->start and set is-deref? + 8542 8b/-> *ecx 0/r32/eax # Slice-start + 8543 8a/copy-byte *eax 0/r32/AL + 8544 81 4/subop/and %eax 0xff/imm32 + 8545 3d/compare-eax-and 0x2a/imm32/asterisk + 8546 { + 8547 75/jump-if-!= break/disp8 + 8548 ff 0/subop/increment *ecx + 8549 ba/copy-to-edx 1/imm32/true + 8550 } + 8551 # assert(is-identifier?(name)) + 8552 (is-identifier? %ecx) # => eax + 8553 3d/compare-eax-and 0/imm32/false + 8554 0f 84/jump-if-= $parse-mu-stmt:abort/disp32 + 8555 # + 8556 (lookup-var-or-find-in-fn-outputs %ecx *(ebp+0xc) *(ebp+0x10) %ebx *(ebp+0x18) *(ebp+0x1c)) + 8557 8d/copy-address *(edi+0x14) 0/r32/eax # Stmt1-outputs + 8558 (append-stmt-var Heap *ebx *(ebx+4) *(edi+0x14) *(edi+0x18) %edx %eax) # Stmt1-outputs + 8559 # + 8560 e9/jump loop/disp32 + 8561 } + 8562 } + 8563 (add-operation-and-inputs-to-stmt %edi *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x18) *(ebp+0x1c)) + 8564 $parse-mu-stmt:define-outputs: + 8565 # var output/edi: (addr stmt-var) = lookup(out-addr->outputs) + 8566 (lookup *(edi+0x14) *(edi+0x18)) # Stmt1-outputs Stmt1-outputs => eax + 8567 89/<- %edi 0/r32/eax + 8568 { + 8569 $parse-mu-stmt:define-outputs-loop: + 8570 # if (output == null) break + 8571 81 7/subop/compare %edi 0/imm32 + 8572 74/jump-if-= break/disp8 + 8573 # + 8574 (maybe-define-var *edi *(edi+4) *(ebp+0xc)) # if output is a deref, then it's already been defined, + 8575 # and must be in vars. This call will be a no-op, but safe. + 8576 # output = output->next + 8577 (lookup *(edi+8) *(edi+0xc)) # Stmt-var-next Stmt-var-next => eax + 8578 89/<- %edi 0/r32/eax + 8579 # + 8580 eb/jump loop/disp8 + 8581 } + 8582 $parse-mu-stmt:end: + 8583 # . reclaim locals + 8584 81 0/subop/add %esp 0x10/imm32 + 8585 # . restore registers + 8586 5f/pop-to-edi + 8587 5b/pop-to-ebx + 8588 5a/pop-to-edx + 8589 59/pop-to-ecx + 8590 58/pop-to-eax + 8591 # . epilogue + 8592 89/<- %esp 5/r32/ebp + 8593 5d/pop-to-ebp + 8594 c3/return + 8595 + 8596 $parse-mu-stmt:abort: + 8597 # error("invalid identifier '" name "'\n") + 8598 (write-buffered *(ebp+0x18) "invalid identifier '") + 8599 (write-slice-buffered *(ebp+0x18) %ecx) + 8600 (write-buffered *(ebp+0x18) "'\n") + 8601 (flush *(ebp+0x18)) + 8602 (stop *(ebp+0x1c) 1) + 8603 # never gets here + 8604 + 8605 add-operation-and-inputs-to-stmt: # stmt: (addr stmt), line: (addr stream byte), vars: (addr stack live-var), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) + 8606 # pseudocode: + 8607 # stmt->name = slice-to-string(next-mu-token(line)) + 8608 # while true + 8609 # name = next-mu-token(line) + 8610 # v = lookup-var-or-literal(name) + 8611 # stmt->inouts = append(v, stmt->inouts) + 8612 # + 8613 # . prologue + 8614 55/push-ebp + 8615 89/<- %ebp 4/r32/esp + 8616 # . save registers + 8617 50/push-eax + 8618 51/push-ecx + 8619 52/push-edx + 8620 53/push-ebx + 8621 56/push-esi + 8622 57/push-edi + 8623 # edi = stmt + 8624 8b/-> *(ebp+8) 7/r32/edi + 8625 # var name/ecx: slice + 8626 68/push 0/imm32/end + 8627 68/push 0/imm32/start + 8628 89/<- %ecx 4/r32/esp + 8629 # var is-deref?/edx: boolean = false + 8630 ba/copy-to-edx 0/imm32/false + 8631 # var v/esi: (handle var) + 8632 68/push 0/imm32 + 8633 68/push 0/imm32 + 8634 89/<- %esi 4/r32/esp + 8635 $add-operation-and-inputs-to-stmt:read-operation: + 8636 (next-mu-token *(ebp+0xc) %ecx) + 8637 8d/copy-address *(edi+4) 0/r32/eax # Stmt1-operation or Regvardef-operationStmt1-operation or Regvardef-operation + 8638 (slice-to-string Heap %ecx %eax) + 8639 # var is-get?/ebx: boolean = (name == "get") + 8640 (slice-equal? %ecx "get") # => eax + 8641 89/<- %ebx 0/r32/eax + 8642 { + 8643 $add-operation-and-inputs-to-stmt:read-inouts: + 8644 # name = next-mu-token(line) + 8645 (next-mu-token *(ebp+0xc) %ecx) + 8646 # if slice-empty?(word-slice) break + 8647 (slice-empty? %ecx) # => eax + 8648 3d/compare-eax-and 0/imm32/false + 8649 0f 85/jump-if-!= break/disp32 + 8650 # if (name == "<-") abort + 8651 (slice-equal? %ecx "<-") + 8652 3d/compare-eax-and 0/imm32/false + 8653 0f 85/jump-if-!= $add-operation-and-inputs-to-stmt:abort/disp32 + 8654 # if (is-get? && second operand) lookup or create offset + 8655 { + 8656 81 7/subop/compare %ebx 0/imm32/false + 8657 74/jump-if-= break/disp8 + 8658 (lookup *(edi+0xc) *(edi+0x10)) # Stmt1-inouts Stmt1-inouts => eax + 8659 3d/compare-eax-and 0/imm32 + 8660 74/jump-if-= break/disp8 + 8661 (lookup-or-create-constant %eax %ecx %esi) + 8662 #? (lookup *esi *(esi+4)) + 8663 #? (write-buffered Stderr "creating new output var ") + 8664 #? (write-int32-hex-buffered Stderr %eax) + 8665 #? (write-buffered Stderr " for field called ") + 8666 #? (write-slice-buffered Stderr %ecx) + 8667 #? (write-buffered Stderr "; var name ") + 8668 #? (lookup *eax *(eax+4)) # Var-name + 8669 #? (write-buffered Stderr %eax) + 8670 #? (write-buffered Stderr Newline) + 8671 #? (flush Stderr) + 8672 e9/jump $add-operation-and-inputs-to-stmt:save-var/disp32 + 8673 } + 8674 # is-deref? = false + 8675 ba/copy-to-edx 0/imm32/false + 8676 # if (slice-starts-with?(name, '*')) ++name->start and set is-deref? + 8677 8b/-> *ecx 0/r32/eax # Slice-start + 8678 8a/copy-byte *eax 0/r32/AL + 8679 81 4/subop/and %eax 0xff/imm32 + 8680 3d/compare-eax-and 0x2a/imm32/asterisk + 8681 { + 8682 75/jump-if-!= break/disp8 + 8683 $add-operation-and-inputs-to-stmt:inout-is-deref: + 8684 ff 0/subop/increment *ecx + 8685 ba/copy-to-edx 1/imm32/true + 8686 } + 8687 (lookup-var-or-literal %ecx *(ebp+0x10) %esi *(ebp+0x14) *(ebp+0x18) *(ebp+0x1c)) + 8688 $add-operation-and-inputs-to-stmt:save-var: + 8689 8d/copy-address *(edi+0xc) 0/r32/eax + 8690 (append-stmt-var Heap *esi *(esi+4) *(edi+0xc) *(edi+0x10) %edx %eax) # Stmt1-inouts or Regvardef-inouts + 8691 # + 8692 e9/jump loop/disp32 + 8693 } + 8694 $add-operation-and-inputs-to-stmt:end: + 8695 # . reclaim locals + 8696 81 0/subop/add %esp 0x10/imm32 + 8697 # . restore registers + 8698 5f/pop-to-edi + 8699 5e/pop-to-esi + 8700 5b/pop-to-ebx + 8701 5a/pop-to-edx + 8702 59/pop-to-ecx + 8703 58/pop-to-eax + 8704 # . epilogue + 8705 89/<- %esp 5/r32/ebp + 8706 5d/pop-to-ebp + 8707 c3/return + 8708 + 8709 $add-operation-and-inputs-to-stmt:abort: + 8710 # error("fn ___: invalid identifier in '" line "'\n") + 8711 (write-buffered *(ebp+0x18) "fn ") + 8712 8b/-> *(ebp+0x14) 0/r32/eax + 8713 (lookup *eax *(eax+4)) # Function-name Function-name => eax + 8714 (write-buffered *(ebp+0x18) %eax) + 8715 (rewind-stream *(ebp+0xc)) + 8716 (write-buffered *(ebp+0x18) ": invalid identifier in '") + 8717 (write-stream-data *(ebp+0x18) *(ebp+0xc)) + 8718 (write-buffered *(ebp+0x18) "'\n") + 8719 (flush *(ebp+0x18)) + 8720 (stop *(ebp+0x1c) 1) + 8721 # never gets here + 8722 + 8723 stmt-has-outputs?: # line: (addr stream byte) -> result/eax: boolean + 8724 # . prologue + 8725 55/push-ebp + 8726 89/<- %ebp 4/r32/esp + 8727 # . save registers + 8728 51/push-ecx + 8729 # var word-slice/ecx: slice + 8730 68/push 0/imm32/end + 8731 68/push 0/imm32/start + 8732 89/<- %ecx 4/r32/esp + 8733 # result = false + 8734 b8/copy-to-eax 0/imm32/false + 8735 (rewind-stream *(ebp+8)) + 8736 { + 8737 (next-mu-token *(ebp+8) %ecx) + 8738 # if slice-empty?(word-slice) break + 8739 (slice-empty? %ecx) + 8740 3d/compare-eax-and 0/imm32/false + 8741 b8/copy-to-eax 0/imm32/false/result # restore result (if we're here it's still false) + 8742 0f 85/jump-if-!= break/disp32 + 8743 # if slice-starts-with?(word-slice, '#') break + 8744 # . eax = *word-slice->start + 8745 8b/-> *ecx 0/r32/eax + 8746 8a/copy-byte *eax 0/r32/AL + 8747 81 4/subop/and %eax 0xff/imm32 + 8748 # . if (eax == '#') break + 8749 3d/compare-eax-and 0x23/imm32/hash + 8750 b8/copy-to-eax 0/imm32/false/result # restore result (if we're here it's still false) + 8751 0f 84/jump-if-= break/disp32 + 8752 # if slice-equal?(word-slice, '<-') return true + 8753 (slice-equal? %ecx "<-") + 8754 3d/compare-eax-and 0/imm32/false + 8755 74/jump-if-= loop/disp8 + 8756 b8/copy-to-eax 1/imm32/true + 8757 } + 8758 $stmt-has-outputs:end: + 8759 (rewind-stream *(ebp+8)) + 8760 # . reclaim locals + 8761 81 0/subop/add %esp 8/imm32 + 8762 # . restore registers + 8763 59/pop-to-ecx + 8764 # . epilogue + 8765 89/<- %esp 5/r32/ebp + 8766 5d/pop-to-ebp + 8767 c3/return + 8768 + 8769 # if 'name' starts with a digit, create a new literal var for it + 8770 # otherwise return first 'name' from the top (back) of 'vars' and abort if not found + 8771 lookup-var-or-literal: # name: (addr slice), vars: (addr stack live-var), out: (addr handle var), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) + 8772 # . prologue + 8773 55/push-ebp + 8774 89/<- %ebp 4/r32/esp + 8775 # . save registers + 8776 50/push-eax + 8777 51/push-ecx + 8778 56/push-esi + 8779 # esi = name + 8780 8b/-> *(ebp+8) 6/r32/esi + 8781 # if slice-empty?(name) abort + 8782 (slice-empty? %esi) # => eax + 8783 3d/compare-eax-and 0/imm32/false + 8784 0f 85/jump-if-!= $lookup-var-or-literal:abort/disp32 + 8785 # var c/ecx: byte = *name->start + 8786 8b/-> *esi 1/r32/ecx + 8787 8a/copy-byte *ecx 1/r32/CL + 8788 81 4/subop/and %ecx 0xff/imm32 + 8789 # if is-decimal-digit?(c) return new var(name) + 8790 { + 8791 (is-decimal-digit? %ecx) # => eax + 8792 3d/compare-eax-and 0/imm32/false + 8793 74/jump-if-= break/disp8 + 8794 $lookup-var-or-literal:literal: + 8795 (new-literal-integer Heap %esi *(ebp+0x10) *(ebp+0x18) *(ebp+0x1c)) + 8796 eb/jump $lookup-var-or-literal:end/disp8 + 8797 } + 8798 # else if (c == '"') return new var(name) + 8799 { + 8800 81 7/subop/compare %ecx 0x22/imm32/dquote + 8801 75/jump-if-!= break/disp8 + 8802 $lookup-var-or-literal:literal-string: + 8803 (new-literal Heap %esi *(ebp+0x10)) + 8804 eb/jump $lookup-var-or-literal:end/disp8 + 8805 } + 8806 # otherwise return lookup-var(name, vars) + 8807 { + 8808 $lookup-var-or-literal:var: + 8809 (lookup-var %esi *(ebp+0xc) *(ebp+0x10) *(ebp+0x14) *(ebp+0x18) *(ebp+0x1c)) + 8810 } + 8811 $lookup-var-or-literal:end: + 8812 # . restore registers + 8813 5e/pop-to-esi + 8814 59/pop-to-ecx + 8815 58/pop-to-eax + 8816 # . epilogue + 8817 89/<- %esp 5/r32/ebp + 8818 5d/pop-to-ebp + 8819 c3/return + 8820 + 8821 $lookup-var-or-literal:abort: + 8822 (write-buffered *(ebp+0x18) "fn ") + 8823 8b/-> *(ebp+0x14) 0/r32/eax + 8824 (lookup *eax *(eax+4)) # Function-name Function-name => eax + 8825 (write-buffered *(ebp+0x18) %eax) + 8826 (write-buffered *(ebp+0x18) ": empty variable!") + 8827 (flush *(ebp+0x18)) + 8828 (stop *(ebp+0x1c) 1) + 8829 # never gets here 8830 - 8831 $lookup-or-define-var:abort: - 8832 (write-buffered *(ebp+0x18) "unknown variable '") - 8833 (write-slice-buffered *(ebp+0x18) *(ebp+8)) - 8834 (write-buffered *(ebp+0x18) "'\n") - 8835 (flush *(ebp+0x18)) - 8836 (stop *(ebp+0x1c) 1) - 8837 # never gets here - 8838 - 8839 find-in-function-outputs: # fn: (addr function), name: (addr slice), out: (addr handle var) - 8840 # . prologue - 8841 55/push-ebp - 8842 89/<- %ebp 4/r32/esp - 8843 # . save registers - 8844 50/push-eax - 8845 51/push-ecx - 8846 # var curr/ecx: (addr list var) = lookup(fn->outputs) - 8847 8b/-> *(ebp+8) 1/r32/ecx - 8848 (lookup *(ecx+0x10) *(ecx+0x14)) # Function-outputs Function-outputs => eax - 8849 89/<- %ecx 0/r32/eax - 8850 # while curr != null - 8851 { - 8852 81 7/subop/compare %ecx 0/imm32 - 8853 74/jump-if-= break/disp8 - 8854 # var v/eax: (addr var) = lookup(curr->value) - 8855 (lookup *ecx *(ecx+4)) # List-value List-value => eax - 8856 # var s/eax: (addr array byte) = lookup(v->name) - 8857 (lookup *eax *(eax+4)) # Var-name Var-name => eax - 8858 # if (s == name) return curr->value - 8859 (slice-equal? *(ebp+0xc) %eax) # => eax - 8860 3d/compare-eax-and 0/imm32/false - 8861 { - 8862 74/jump-if-= break/disp8 - 8863 # var edi = out - 8864 57/push-edi - 8865 8b/-> *(ebp+0x10) 7/r32/edi - 8866 # *out = curr->value - 8867 8b/-> *ecx 0/r32/eax - 8868 89/<- *edi 0/r32/eax - 8869 8b/-> *(ecx+4) 0/r32/eax - 8870 89/<- *(edi+4) 0/r32/eax - 8871 # - 8872 5f/pop-to-edi - 8873 eb/jump $find-in-function-outputs:end/disp8 - 8874 } - 8875 # curr = curr->next - 8876 (lookup *(ecx+8) *(ecx+0xc)) # List-next List-next => eax - 8877 89/<- %ecx 0/r32/eax - 8878 # - 8879 eb/jump loop/disp8 - 8880 } - 8881 b8/copy-to-eax 0/imm32 - 8882 $find-in-function-outputs:end: - 8883 # . restore registers - 8884 59/pop-to-ecx - 8885 58/pop-to-eax - 8886 # . epilogue - 8887 89/<- %esp 5/r32/ebp - 8888 5d/pop-to-ebp - 8889 c3/return - 8890 - 8891 # push 'out' to 'vars' if not already there; it's assumed to be a fn output - 8892 maybe-define-var: # out: (handle var), vars: (addr stack live-var) - 8893 # . prologue - 8894 55/push-ebp - 8895 89/<- %ebp 4/r32/esp - 8896 # . save registers - 8897 50/push-eax - 8898 # var out-addr/eax: (addr var) - 8899 (lookup *(ebp+8) *(ebp+0xc)) # => eax - 8900 # - 8901 (binding-exists? %eax *(ebp+0x10)) # => eax - 8902 3d/compare-eax-and 0/imm32/false - 8903 75/jump-if-!= $maybe-define-var:end/disp8 - 8904 # otherwise update vars - 8905 (push *(ebp+0x10) *(ebp+8)) - 8906 (push *(ebp+0x10) *(ebp+0xc)) - 8907 (push *(ebp+0x10) 0) # 'out' is always a fn output; never spill it - 8908 $maybe-define-var:end: - 8909 # . restore registers - 8910 58/pop-to-eax - 8911 # . epilogue - 8912 89/<- %esp 5/r32/ebp - 8913 5d/pop-to-ebp - 8914 c3/return - 8915 - 8916 # simpler version of lookup-var-helper - 8917 binding-exists?: # target: (addr var), vars: (addr stack live-var) -> result/eax: boolean - 8918 # pseudocode: - 8919 # var curr: (addr handle var) = &vars->data[vars->top - 12] - 8920 # var min = vars->data - 8921 # while curr >= min - 8922 # var v: (handle var) = *curr - 8923 # if v->name == target->name - 8924 # return true - 8925 # curr -= 12 - 8926 # return false - 8927 # - 8928 # . prologue - 8929 55/push-ebp - 8930 89/<- %ebp 4/r32/esp - 8931 # . save registers - 8932 51/push-ecx - 8933 52/push-edx - 8934 56/push-esi - 8935 # var target-name/ecx: (addr array byte) = lookup(target->name) - 8936 8b/-> *(ebp+8) 0/r32/eax - 8937 (lookup *eax *(eax+4)) # Var-name Var-name => eax - 8938 89/<- %ecx 0/r32/eax - 8939 # esi = vars - 8940 8b/-> *(ebp+0xc) 6/r32/esi - 8941 # eax = vars->top - 8942 8b/-> *esi 0/r32/eax - 8943 # var min/edx: (addr handle var) = vars->data - 8944 8d/copy-address *(esi+8) 2/r32/edx - 8945 # var curr/esi: (addr handle var) = &vars->data[vars->top - 12] - 8946 8d/copy-address *(esi+eax-4) 6/r32/esi # vars + 8 + vars->type - 12 - 8947 { - 8948 $binding-exists?:loop: - 8949 # if (curr < min) return - 8950 39/compare %esi 2/r32/edx - 8951 0f 82/jump-if-addr< break/disp32 - 8952 # var v/eax: (addr var) = lookup(*curr) - 8953 (lookup *esi *(esi+4)) # => eax - 8954 # var vn/eax: (addr array byte) = lookup(v->name) - 8955 (lookup *eax *(eax+4)) # Var-name Var-name => eax - 8956 # if (vn == target-name) return true - 8957 (string-equal? %ecx %eax) # => eax - 8958 3d/compare-eax-and 0/imm32/false - 8959 75/jump-if-!= $binding-exists?:end/disp8 # eax already contains true - 8960 # curr -= 12 - 8961 81 5/subop/subtract %esi 0xc/imm32 - 8962 e9/jump loop/disp32 - 8963 } - 8964 b8/copy-to-eax 0/imm32/false - 8965 $binding-exists?:end: - 8966 # . restore registers - 8967 5e/pop-to-esi - 8968 5a/pop-to-edx - 8969 59/pop-to-ecx - 8970 # . epilogue - 8971 89/<- %esp 5/r32/ebp - 8972 5d/pop-to-ebp - 8973 c3/return - 8974 - 8975 test-parse-mu-stmt: - 8976 # . prologue - 8977 55/push-ebp - 8978 89/<- %ebp 4/r32/esp - 8979 # setup - 8980 (clear-stream _test-input-stream) - 8981 (write _test-input-stream "increment n\n") - 8982 # var vars/ecx: (stack (addr var) 16) - 8983 81 5/subop/subtract %esp 0xc0/imm32 - 8984 68/push 0xc0/imm32/size - 8985 68/push 0/imm32/top - 8986 89/<- %ecx 4/r32/esp - 8987 (clear-stack %ecx) - 8988 # var v/edx: (handle var) - 8989 68/push 0/imm32 - 8990 68/push 0/imm32 - 8991 89/<- %edx 4/r32/esp - 8992 # var s/eax: (handle array byte) - 8993 68/push 0/imm32 - 8994 68/push 0/imm32 - 8995 89/<- %eax 4/r32/esp - 8996 # v = new var("n") - 8997 (copy-array Heap "n" %eax) - 8998 (new-var Heap *eax *(eax+4) %edx) - 8999 # - 9000 (push %ecx *edx) - 9001 (push %ecx *(edx+4)) - 9002 (push %ecx 0) - 9003 # var out/eax: (handle stmt) - 9004 68/push 0/imm32 - 9005 68/push 0/imm32 - 9006 89/<- %eax 4/r32/esp - 9007 # convert - 9008 (parse-mu-stmt _test-input-stream %ecx 0 %eax Stderr 0) - 9009 # var out-addr/edx: (addr stmt) = lookup(*out) - 9010 (lookup *eax *(eax+4)) # => eax - 9011 89/<- %edx 0/r32/eax - 9012 # out->tag - 9013 (check-ints-equal *edx 1 "F - test-parse-mu-stmt/tag") # Stmt-tag is Stmt1 - 9014 # out->operation - 9015 (lookup *(edx+4) *(edx+8)) # Stmt1-operation Stmt1-operation => eax - 9016 (check-strings-equal %eax "increment" "F - test-parse-mu-stmt/name") # Stmt1-operation - 9017 # out->inouts->value->name - 9018 # . eax = out->inouts - 9019 (lookup *(edx+0xc) *(edx+0x10)) # Stmt1-inouts Stmt1-inouts => eax - 9020 # . eax = out->inouts->value - 9021 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax - 9022 # . eax = out->inouts->value->name - 9023 (lookup *eax *(eax+4)) # Var-name Var-name => eax - 9024 # . - 9025 (check-strings-equal %eax "n" "F - test-parse-mu-stmt/inout:0") - 9026 # . epilogue - 9027 89/<- %esp 5/r32/ebp - 9028 5d/pop-to-ebp - 9029 c3/return - 9030 - 9031 test-parse-mu-stmt-with-comma: - 9032 # . prologue - 9033 55/push-ebp - 9034 89/<- %ebp 4/r32/esp - 9035 # setup - 9036 (clear-stream _test-input-stream) - 9037 (write _test-input-stream "copy-to n, 3\n") - 9038 # var vars/ecx: (stack (addr var) 16) - 9039 81 5/subop/subtract %esp 0xc0/imm32 - 9040 68/push 0xc0/imm32/size - 9041 68/push 0/imm32/top - 9042 89/<- %ecx 4/r32/esp - 9043 (clear-stack %ecx) - 9044 # var v/edx: (handle var) - 9045 68/push 0/imm32 - 9046 68/push 0/imm32 - 9047 89/<- %edx 4/r32/esp - 9048 # var s/eax: (handle array byte) - 9049 68/push 0/imm32 - 9050 68/push 0/imm32 - 9051 89/<- %eax 4/r32/esp - 9052 # v = new var("n") - 9053 (copy-array Heap "n" %eax) - 9054 (new-var Heap *eax *(eax+4) %edx) - 9055 # - 9056 (push %ecx *edx) - 9057 (push %ecx *(edx+4)) - 9058 (push %ecx 0) - 9059 # var out/eax: (handle stmt) - 9060 68/push 0/imm32 - 9061 68/push 0/imm32 - 9062 89/<- %eax 4/r32/esp - 9063 # convert - 9064 (parse-mu-stmt _test-input-stream %ecx 0 %eax Stderr 0) - 9065 # var out-addr/edx: (addr stmt) = lookup(*out) - 9066 (lookup *eax *(eax+4)) # => eax - 9067 89/<- %edx 0/r32/eax - 9068 # out->tag - 9069 (check-ints-equal *edx 1 "F - test-parse-mu-stmt-with-comma/tag") # Stmt-tag is Stmt1 - 9070 # out->operation - 9071 (lookup *(edx+4) *(edx+8)) # Stmt1-operation Stmt1-operation => eax - 9072 (check-strings-equal %eax "copy-to" "F - test-parse-mu-stmt-with-comma/name") # Stmt1-operation - 9073 # out->inouts->value->name - 9074 # . eax = out->inouts - 9075 (lookup *(edx+0xc) *(edx+0x10)) # Stmt1-inouts Stmt1-inouts => eax - 9076 # . eax = out->inouts->value - 9077 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax - 9078 # . eax = out->inouts->value->name - 9079 (lookup *eax *(eax+4)) # Var-name Var-name => eax - 9080 # . - 9081 (check-strings-equal %eax "n" "F - test-parse-mu-stmt-with-comma/inout:0") - 9082 # . epilogue - 9083 89/<- %esp 5/r32/ebp - 9084 5d/pop-to-ebp - 9085 c3/return - 9086 - 9087 new-var: # ad: (addr allocation-descriptor), name: (handle array byte), out: (addr handle var) - 9088 # . prologue - 9089 55/push-ebp - 9090 89/<- %ebp 4/r32/esp - 9091 # . save registers - 9092 50/push-eax - 9093 51/push-ecx - 9094 # ecx = out - 9095 8b/-> *(ebp+0x14) 1/r32/ecx - 9096 # - 9097 (allocate *(ebp+8) *Var-size %ecx) - 9098 # var out-addr/eax: (addr var) - 9099 (lookup *ecx *(ecx+4)) # => eax - 9100 # out-addr->name = name - 9101 8b/-> *(ebp+0xc) 1/r32/ecx - 9102 89/<- *eax 1/r32/ecx # Var-name - 9103 8b/-> *(ebp+0x10) 1/r32/ecx - 9104 89/<- *(eax+4) 1/r32/ecx # Var-name - 9105 #? (write-buffered Stderr "var ") - 9106 #? (lookup *(ebp+0xc) *(ebp+0x10)) - 9107 #? (write-buffered Stderr %eax) - 9108 #? (write-buffered Stderr " at ") - 9109 #? 8b/-> *(ebp+0x14) 1/r32/ecx - 9110 #? (lookup *ecx *(ecx+4)) # => eax - 9111 #? (write-int32-hex-buffered Stderr %eax) - 9112 #? (write-buffered Stderr Newline) - 9113 #? (flush Stderr) - 9114 $new-var:end: - 9115 # . restore registers - 9116 59/pop-to-ecx - 9117 58/pop-to-eax - 9118 # . epilogue - 9119 89/<- %esp 5/r32/ebp - 9120 5d/pop-to-ebp - 9121 c3/return - 9122 - 9123 new-literal-integer: # ad: (addr allocation-descriptor), name: (addr slice), out: (addr handle var), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) - 9124 # . prologue - 9125 55/push-ebp - 9126 89/<- %ebp 4/r32/esp - 9127 # . save registers - 9128 50/push-eax - 9129 51/push-ecx - 9130 # if (!is-hex-int?(name)) abort - 9131 (is-hex-int? *(ebp+0xc)) # => eax - 9132 3d/compare-eax-and 0/imm32/false - 9133 0f 84/jump-if-= $new-literal-integer:abort/disp32 - 9134 # out = new var(s) - 9135 (new-var-from-slice *(ebp+8) *(ebp+0xc) *(ebp+0x10)) - 9136 # var out-addr/ecx: (addr var) = lookup(*out) - 9137 8b/-> *(ebp+0x10) 0/r32/eax - 9138 (lookup *eax *(eax+4)) # => eax - 9139 89/<- %ecx 0/r32/eax - 9140 # out-addr->block-depth = *Curr-block-depth - 9141 8b/-> *Curr-block-depth 0/r32/eax - 9142 89/<- *(ecx+0x10) 0/r32/eax # Var-block-depth - 9143 # out-addr->type = new tree() - 9144 8d/copy-address *(ecx+8) 0/r32/eax # Var-type - 9145 (allocate *(ebp+8) *Tree-size %eax) - 9146 (lookup *(ecx+8) *(ecx+0xc)) # Var-type Var-type => eax - 9147 c7 0/subop/copy *eax 1/imm32/true # Tree-is-atom - 9148 # nothing else to do; default type is 'literal' - 9149 $new-literal-integer:end: - 9150 # . reclaim locals - 9151 81 0/subop/add %esp 8/imm32 - 9152 # . restore registers - 9153 59/pop-to-ecx - 9154 58/pop-to-eax - 9155 # . epilogue - 9156 89/<- %esp 5/r32/ebp - 9157 5d/pop-to-ebp - 9158 c3/return - 9159 - 9160 $new-literal-integer:abort: - 9161 (write-buffered *(ebp+0x18) "fn ") - 9162 8b/-> *(ebp+0x14) 0/r32/eax - 9163 (lookup *eax *(eax+4)) # Function-name Function-name => eax - 9164 (write-buffered *(ebp+0x18) %eax) - 9165 (write-buffered *(ebp+0x18) ": variable cannot begin with a digit '") - 9166 (write-slice-buffered *(ebp+0x18) *(ebp+0xc)) - 9167 (write-buffered *(ebp+0x18) "'\n") - 9168 (flush *(ebp+0x18)) - 9169 (stop *(ebp+0x1c) 1) - 9170 # never gets here - 9171 - 9172 new-literal: # ad: (addr allocation-descriptor), name: (addr slice), out: (addr handle var) - 9173 # . prologue - 9174 55/push-ebp - 9175 89/<- %ebp 4/r32/esp - 9176 # . save registers - 9177 50/push-eax - 9178 51/push-ecx - 9179 # var s/ecx: (handle array byte) - 9180 68/push 0/imm32 - 9181 68/push 0/imm32 - 9182 89/<- %ecx 4/r32/esp - 9183 # s = slice-to-string(name) - 9184 (slice-to-string Heap *(ebp+0xc) %ecx) - 9185 # allocate to out - 9186 (new-var *(ebp+8) *ecx *(ecx+4) *(ebp+0x10)) - 9187 # var out-addr/ecx: (addr var) = lookup(*out) - 9188 8b/-> *(ebp+0x10) 1/r32/ecx - 9189 (lookup *ecx *(ecx+4)) # => eax - 9190 89/<- %ecx 0/r32/eax - 9191 # out-addr->block-depth = *Curr-block-depth - 9192 8b/-> *Curr-block-depth 0/r32/eax - 9193 89/<- *(ecx+0x10) 0/r32/eax # Var-block-depth - 9194 # out-addr->type/eax = new type - 9195 8d/copy-address *(ecx+8) 0/r32/eax # Var-type - 9196 (allocate *(ebp+8) *Tree-size %eax) - 9197 (lookup *(ecx+8) *(ecx+0xc)) # Var-type Var-type => eax - 9198 # nothing else to do; default type is 'literal' - 9199 c7 0/subop/copy *eax 1/imm32/true # Tree-is-atom - 9200 $new-literal:end: - 9201 # . reclaim locals - 9202 81 0/subop/add %esp 8/imm32 - 9203 # . restore registers - 9204 59/pop-to-ecx - 9205 58/pop-to-eax - 9206 # . epilogue - 9207 89/<- %esp 5/r32/ebp - 9208 5d/pop-to-ebp - 9209 c3/return - 9210 - 9211 new-var-from-slice: # ad: (addr allocation-descriptor), name: (addr slice), out: (addr handle var) - 9212 # . prologue - 9213 55/push-ebp - 9214 89/<- %ebp 4/r32/esp - 9215 # . save registers - 9216 51/push-ecx - 9217 # var tmp/ecx: (handle array byte) - 9218 68/push 0/imm32 - 9219 68/push 0/imm32 - 9220 89/<- %ecx 4/r32/esp - 9221 # tmp = slice-to-string(name) - 9222 (slice-to-string Heap *(ebp+0xc) %ecx) - 9223 # out = new-var(tmp) - 9224 (new-var *(ebp+8) *ecx *(ecx+4) *(ebp+0x10)) - 9225 $new-var-from-slice:end: - 9226 # . reclaim locals - 9227 81 0/subop/add %esp 8/imm32 - 9228 # . restore registers - 9229 59/pop-to-ecx - 9230 # . epilogue - 9231 89/<- %esp 5/r32/ebp - 9232 5d/pop-to-ebp - 9233 c3/return - 9234 - 9235 new-var-def: # ad: (addr allocation-descriptor), var: (handle var), out: (addr handle stmt) - 9236 # . prologue - 9237 55/push-ebp - 9238 89/<- %ebp 4/r32/esp - 9239 # . save registers - 9240 50/push-eax - 9241 51/push-ecx - 9242 # - 9243 (allocate *(ebp+8) *Stmt-size *(ebp+0x14)) - 9244 # var out-addr/eax: (addr stmt) = lookup(*out) - 9245 8b/-> *(ebp+0x14) 0/r32/eax - 9246 (lookup *eax *(eax+4)) # => eax - 9247 # out-addr->tag = stmt - 9248 c7 0/subop/copy *eax 2/imm32/tag/var-on-stack # Stmt-tag - 9249 # result->var = var - 9250 8b/-> *(ebp+0xc) 1/r32/ecx - 9251 89/<- *(eax+4) 1/r32/ecx # Vardef-var - 9252 8b/-> *(ebp+0x10) 1/r32/ecx - 9253 89/<- *(eax+8) 1/r32/ecx # Vardef-var - 9254 $new-var-def:end: - 9255 # . restore registers - 9256 59/pop-to-ecx - 9257 58/pop-to-eax - 9258 # . epilogue - 9259 89/<- %esp 5/r32/ebp - 9260 5d/pop-to-ebp - 9261 c3/return - 9262 - 9263 new-reg-var-def: # ad: (addr allocation-descriptor), var: (handle var), out: (addr handle stmt) - 9264 # . prologue - 9265 55/push-ebp - 9266 89/<- %ebp 4/r32/esp - 9267 # . save registers - 9268 50/push-eax - 9269 # eax = out - 9270 8b/-> *(ebp+0x14) 0/r32/eax - 9271 # - 9272 (allocate *(ebp+8) *Stmt-size %eax) - 9273 # var out-addr/eax: (addr stmt) = lookup(*out) - 9274 (lookup *eax *(eax+4)) # => eax - 9275 # set tag - 9276 c7 0/subop/copy *eax 3/imm32/tag/var-in-register # Stmt-tag - 9277 # set output - 9278 8d/copy-address *(eax+0x14) 0/r32/eax # Regvardef-outputs - 9279 (append-stmt-var Heap *(ebp+0xc) *(ebp+0x10) 0 0 0 %eax) - 9280 $new-reg-var-def:end: - 9281 # . restore registers - 9282 58/pop-to-eax - 9283 # . epilogue - 9284 89/<- %esp 5/r32/ebp - 9285 5d/pop-to-ebp - 9286 c3/return - 9287 - 9288 append-list: # ad: (addr allocation-descriptor), value: (handle _type), list: (handle list _type), out: (addr handle list _type) - 9289 # . prologue - 9290 55/push-ebp - 9291 89/<- %ebp 4/r32/esp - 9292 # . save registers - 9293 50/push-eax - 9294 51/push-ecx - 9295 57/push-edi - 9296 # edi = out - 9297 8b/-> *(ebp+0x1c) 7/r32/edi - 9298 # *out = new list - 9299 (allocate *(ebp+8) *List-size %edi) - 9300 # var out-addr/edi: (addr list _type) = lookup(*out) - 9301 (lookup *edi *(edi+4)) # => eax - 9302 89/<- %edi 0/r32/eax - 9303 # out-addr->value = value - 9304 8b/-> *(ebp+0xc) 0/r32/eax - 9305 89/<- *edi 0/r32/eax # List-value - 9306 8b/-> *(ebp+0x10) 0/r32/eax - 9307 89/<- *(edi+4) 0/r32/eax # List-value - 9308 # if (list == null) return - 9309 81 7/subop/compare *(ebp+0x14) 0/imm32 - 9310 74/jump-if-= $append-list:end/disp8 - 9311 # otherwise append - 9312 $append-list:non-empty-list: - 9313 # var curr/eax: (addr list _type) = lookup(list) - 9314 (lookup *(ebp+0x14) *(ebp+0x18)) # => eax - 9315 # while (curr->next != null) curr = curr->next - 9316 { - 9317 81 7/subop/compare *(eax+8) 0/imm32 # List-next - 9318 74/jump-if-= break/disp8 - 9319 # curr = lookup(curr->next) - 9320 (lookup *(eax+8) *(eax+0xc)) # List-next, List-next => eax - 9321 # - 9322 eb/jump loop/disp8 - 9323 } - 9324 # edi = out - 9325 8b/-> *(ebp+0x1c) 7/r32/edi - 9326 # curr->next = out - 9327 8b/-> *edi 1/r32/ecx - 9328 89/<- *(eax+8) 1/r32/ecx # List-next - 9329 8b/-> *(edi+4) 1/r32/ecx - 9330 89/<- *(eax+0xc) 1/r32/ecx # List-next - 9331 # out = list - 9332 8b/-> *(ebp+0x14) 1/r32/ecx - 9333 89/<- *edi 1/r32/ecx - 9334 8b/-> *(ebp+0x18) 1/r32/ecx - 9335 89/<- *(edi+4) 1/r32/ecx - 9336 $append-list:end: - 9337 # . restore registers - 9338 5f/pop-to-edi - 9339 59/pop-to-ecx - 9340 58/pop-to-eax - 9341 # . epilogue - 9342 89/<- %esp 5/r32/ebp - 9343 5d/pop-to-ebp - 9344 c3/return - 9345 - 9346 append-stmt-var: # ad: (addr allocation-descriptor), v: (handle var), vars: (handle stmt-var), is-deref?: boolean, out: (addr handle stmt-var) - 9347 # . prologue - 9348 55/push-ebp - 9349 89/<- %ebp 4/r32/esp - 9350 # . save registers - 9351 50/push-eax - 9352 51/push-ecx - 9353 57/push-edi - 9354 # edi = out - 9355 8b/-> *(ebp+0x20) 7/r32/edi - 9356 # out = new stmt-var - 9357 (allocate *(ebp+8) *Stmt-var-size %edi) - 9358 # var out-addr/ecx: (addr stmt-var) = lookup(*out) - 9359 (lookup *edi *(edi+4)) # => eax - 9360 89/<- %ecx 0/r32/eax - 9361 # out-addr->value = v - 9362 8b/-> *(ebp+0xc) 0/r32/eax - 9363 89/<- *ecx 0/r32/eax # Stmt-var-value - 9364 8b/-> *(ebp+0x10) 0/r32/eax - 9365 89/<- *(ecx+4) 0/r32/eax # Stmt-var-value - 9366 # out-addr->is-deref? = is-deref? - 9367 8b/-> *(ebp+0x1c) 0/r32/eax - 9368 89/<- *(ecx+0x10) 0/r32/eax # Stmt-var-is-deref - 9369 # if (vars == null) return result - 9370 81 7/subop/compare *(ebp+0x14) 0/imm32/null - 9371 74/jump-if-= $append-stmt-var:end/disp8 - 9372 # otherwise append - 9373 # var curr/eax: (addr stmt-var) = lookup(vars) - 9374 (lookup *(ebp+0x14) *(ebp+0x18)) # => eax - 9375 # while (curr->next != null) curr = curr->next - 9376 { - 9377 81 7/subop/compare *(eax+8) 0/imm32 # Stmt-var-next - 9378 74/jump-if-= break/disp8 - 9379 # curr = lookup(curr->next) - 9380 (lookup *(eax+8) *(eax+0xc)) # Stmt-var-next, Stmt-var-next => eax - 9381 # - 9382 eb/jump loop/disp8 - 9383 } - 9384 # curr->next = out - 9385 8b/-> *edi 1/r32/ecx - 9386 89/<- *(eax+8) 1/r32/ecx # Stmt-var-next - 9387 8b/-> *(edi+4) 1/r32/ecx - 9388 89/<- *(eax+0xc) 1/r32/ecx # Stmt-var-next - 9389 # out = vars - 9390 8b/-> *(ebp+0x14) 1/r32/ecx - 9391 89/<- *edi 1/r32/ecx - 9392 8b/-> *(ebp+0x18) 1/r32/ecx - 9393 89/<- *(edi+4) 1/r32/ecx - 9394 $append-stmt-var:end: - 9395 # . restore registers - 9396 5f/pop-to-edi - 9397 59/pop-to-ecx - 9398 58/pop-to-eax - 9399 # . epilogue - 9400 89/<- %esp 5/r32/ebp - 9401 5d/pop-to-ebp - 9402 c3/return - 9403 - 9404 append-to-block: # ad: (addr allocation-descriptor), block: (addr block), x: (handle stmt) - 9405 # . prologue - 9406 55/push-ebp - 9407 89/<- %ebp 4/r32/esp - 9408 # . save registers - 9409 50/push-eax - 9410 56/push-esi - 9411 # esi = block - 9412 8b/-> *(ebp+0xc) 6/r32/esi - 9413 # block->stmts = append(x, block->stmts) - 9414 8d/copy-address *(esi+4) 0/r32/eax # Block-stmts - 9415 (append-list *(ebp+8) *(ebp+0x10) *(ebp+0x14) *(esi+4) *(esi+8) %eax) # ad, x, x, Block-stmts, Block-stmts - 9416 $append-to-block:end: - 9417 # . restore registers - 9418 5e/pop-to-esi - 9419 58/pop-to-eax - 9420 # . epilogue - 9421 89/<- %esp 5/r32/ebp - 9422 5d/pop-to-ebp - 9423 c3/return - 9424 - 9425 ## Parsing types - 9426 # We need to create metadata on user-defined types, and we need to use this - 9427 # metadata as we parse instructions. - 9428 # However, we also want to allow types to be used before their definitions. - 9429 # This means we can't ever assume any type data structures exist. - 9430 - 9431 lookup-or-create-constant: # container: (addr stmt-var), field-name: (addr slice), out: (addr handle var) - 9432 # . prologue - 9433 55/push-ebp - 9434 89/<- %ebp 4/r32/esp - 9435 # . save registers - 9436 50/push-eax - 9437 56/push-esi - 9438 # var container-type/esi: type-id - 9439 (container-type *(ebp+8)) # => eax - 9440 89/<- %esi 0/r32/eax - 9441 # var tmp/eax: (handle typeinfo) = find-or-create-typeinfo(container-type) - 9442 68/push 0/imm32 - 9443 68/push 0/imm32 - 9444 89/<- %eax 4/r32/esp - 9445 (find-or-create-typeinfo %esi %eax) - 9446 # var tmp-addr/eax: (addr typeinfo) = lookup(tmp) - 9447 (lookup *eax *(eax+4)) # => eax - 9448 # result = find-or-create-typeinfo-output-var(typeinfo, field-name) - 9449 #? (write-buffered Stderr "constant: ") - 9450 #? (write-slice-buffered Stderr *(ebp+0xc)) - 9451 #? (write-buffered Stderr Newline) - 9452 #? (flush Stderr) - 9453 (find-or-create-typeinfo-output-var %eax *(ebp+0xc) *(ebp+0x10)) - 9454 #? 8b/-> *(ebp+0x10) 0/r32/eax - 9455 #? (write-buffered Stderr "@") - 9456 #? (lookup *eax *(eax+4)) - 9457 #? (write-int32-hex-buffered Stderr %eax) - 9458 #? (lookup *eax *(eax+4)) - 9459 #? (write-buffered Stderr %eax) - 9460 #? (write-buffered Stderr Newline) - 9461 #? (flush Stderr) - 9462 #? (write-buffered Stderr "offset: ") - 9463 #? 8b/-> *(eax+0x14) 0/r32/eax - 9464 #? (write-int32-hex-buffered Stderr %eax) - 9465 #? (write-buffered Stderr Newline) - 9466 #? (flush Stderr) - 9467 $lookup-or-create-constant:end: - 9468 # . reclaim locals - 9469 81 0/subop/add %esp 8/imm32 - 9470 # . restore registers - 9471 5e/pop-to-esi - 9472 58/pop-to-eax - 9473 # . epilogue - 9474 89/<- %esp 5/r32/ebp - 9475 5d/pop-to-ebp - 9476 c3/return - 9477 - 9478 # if addr var: - 9479 # container->var->type->right->left->value - 9480 # otherwise - 9481 # container->var->type->value - 9482 container-type: # container: (addr stmt-var) -> result/eax: type-id + 8831 # return first 'name' from the top (back) of 'vars' and abort if not found + 8832 lookup-var: # name: (addr slice), vars: (addr stack live-var), out: (addr handle var), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) + 8833 # . prologue + 8834 55/push-ebp + 8835 89/<- %ebp 4/r32/esp + 8836 # . save registers + 8837 50/push-eax + 8838 # + 8839 (lookup-var-helper *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14) *(ebp+0x18) *(ebp+0x1c)) + 8840 # if (*out == 0) abort + 8841 8b/-> *(ebp+0x10) 0/r32/eax + 8842 81 7/subop/compare *eax 0/imm32 + 8843 74/jump-if-= $lookup-var:abort/disp8 + 8844 $lookup-var:end: + 8845 # . restore registers + 8846 58/pop-to-eax + 8847 # . epilogue + 8848 89/<- %esp 5/r32/ebp + 8849 5d/pop-to-ebp + 8850 c3/return + 8851 + 8852 $lookup-var:abort: + 8853 (write-buffered *(ebp+0x18) "fn ") + 8854 8b/-> *(ebp+0x14) 0/r32/eax + 8855 (lookup *eax *(eax+4)) # Function-name Function-name => eax + 8856 (write-buffered *(ebp+0x18) %eax) + 8857 (write-buffered *(ebp+0x18) ": unknown variable '") + 8858 (write-slice-buffered *(ebp+0x18) *(ebp+8)) + 8859 (write-buffered *(ebp+0x18) "'\n") + 8860 (flush *(ebp+0x18)) + 8861 (stop *(ebp+0x1c) 1) + 8862 # never gets here + 8863 + 8864 # return first 'name' from the top (back) of 'vars', and 0/null if not found + 8865 # ensure that 'name' if in a register is the topmost variable in that register + 8866 lookup-var-helper: # name: (addr slice), vars: (addr stack live-var), out: (addr handle var), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) + 8867 # pseudocode: + 8868 # var curr: (addr handle var) = &vars->data[vars->top - 12] + 8869 # var min = vars->data + 8870 # while curr >= min + 8871 # var v: (handle var) = *curr + 8872 # if v->name == name + 8873 # return + 8874 # curr -= 12 + 8875 # + 8876 # . prologue + 8877 55/push-ebp + 8878 89/<- %ebp 4/r32/esp + 8879 # . save registers + 8880 50/push-eax + 8881 51/push-ecx + 8882 52/push-edx + 8883 53/push-ebx + 8884 56/push-esi + 8885 57/push-edi + 8886 # clear out + 8887 (zero-out *(ebp+0x10) *Handle-size) + 8888 # esi = vars + 8889 8b/-> *(ebp+0xc) 6/r32/esi + 8890 # ebx = vars->top + 8891 8b/-> *esi 3/r32/ebx + 8892 # if (vars->top > vars->size) abort + 8893 3b/compare<- *(esi+4) 0/r32/eax + 8894 0f 8f/jump-if-> $lookup-var-helper:error1/disp32 + 8895 # var min/edx: (addr handle var) = vars->data + 8896 8d/copy-address *(esi+8) 2/r32/edx + 8897 # var curr/ebx: (addr handle var) = &vars->data[vars->top - 12] + 8898 8d/copy-address *(esi+ebx-4) 3/r32/ebx # vars + 8 + vars->type - 12 + 8899 # var var-in-reg/edi: 8 addrs + 8900 68/push 0/imm32 + 8901 68/push 0/imm32 + 8902 68/push 0/imm32 + 8903 68/push 0/imm32 + 8904 68/push 0/imm32 + 8905 68/push 0/imm32 + 8906 68/push 0/imm32 + 8907 68/push 0/imm32 + 8908 89/<- %edi 4/r32/esp + 8909 { + 8910 $lookup-var-helper:loop: + 8911 # if (curr < min) return + 8912 39/compare %ebx 2/r32/edx + 8913 0f 82/jump-if-addr< break/disp32 + 8914 # var v/ecx: (addr var) = lookup(*curr) + 8915 (lookup *ebx *(ebx+4)) # => eax + 8916 89/<- %ecx 0/r32/eax + 8917 # var vn/eax: (addr array byte) = lookup(v->name) + 8918 (lookup *ecx *(ecx+4)) # Var-name Var-name => eax + 8919 # if (vn == name) return curr + 8920 (slice-equal? *(ebp+8) %eax) # => eax + 8921 3d/compare-eax-and 0/imm32/false + 8922 { + 8923 74/jump-if-= break/disp8 + 8924 $lookup-var-helper:found: + 8925 # var vr/eax: (addr array byte) = lookup(v->register) + 8926 (lookup *(ecx+0x18) *(ecx+0x1c)) # Var-register Var-register => eax + 8927 3d/compare-eax-and 0/imm32 + 8928 { + 8929 74/jump-if-= break/disp8 + 8930 $lookup-var-helper:found-register: + 8931 # var reg/eax: int = get(Registers, vr) + 8932 (get Mu-registers %eax 0xc "Mu-registers") # => eax + 8933 8b/-> *eax 0/r32/eax + 8934 # if (var-in-reg[reg]) error + 8935 8b/-> *(edi+eax<<2) 0/r32/eax + 8936 3d/compare-eax-and 0/imm32 + 8937 0f 85/jump-if-!= $lookup-var-helper:error2/disp32 + 8938 } + 8939 $lookup-var-helper:return: + 8940 # esi = out + 8941 8b/-> *(ebp+0x10) 6/r32/esi + 8942 # *out = *curr + 8943 8b/-> *ebx 0/r32/eax + 8944 89/<- *esi 0/r32/eax + 8945 8b/-> *(ebx+4) 0/r32/eax + 8946 89/<- *(esi+4) 0/r32/eax + 8947 # return + 8948 eb/jump $lookup-var-helper:end/disp8 + 8949 } + 8950 # 'name' not yet found; update var-in-reg if v in register + 8951 # . var vr/eax: (addr array byte) = lookup(v->register) + 8952 (lookup *(ecx+0x18) *(ecx+0x1c)) # Var-register Var-register => eax + 8953 # . if (var == 0) continue + 8954 3d/compare-eax-and 0/imm32 + 8955 74/jump-if-= $lookup-var-helper:continue/disp8 + 8956 # . var reg/eax: int = get(Registers, vr) + 8957 (get Mu-registers %eax 0xc "Mu-registers") # => eax + 8958 8b/-> *eax 0/r32/eax + 8959 # . if (var-in-reg[reg] == 0) var-in-reg[reg] = v + 8960 81 7/subop/compare *(edi+eax<<2) 0/imm32 + 8961 75/jump-if-!= $lookup-var-helper:continue/disp8 + 8962 89/<- *(edi+eax<<2) 1/r32/ecx + 8963 $lookup-var-helper:continue: + 8964 # curr -= 12 + 8965 81 5/subop/subtract %ebx 0xc/imm32 + 8966 e9/jump loop/disp32 + 8967 } + 8968 $lookup-var-helper:end: + 8969 # . reclaim locals + 8970 81 0/subop/add %esp 0x20/imm32 + 8971 # . restore registers + 8972 5f/pop-to-edi + 8973 5e/pop-to-esi + 8974 5b/pop-to-ebx + 8975 5a/pop-to-edx + 8976 59/pop-to-ecx + 8977 58/pop-to-eax + 8978 # . epilogue + 8979 89/<- %esp 5/r32/ebp + 8980 5d/pop-to-ebp + 8981 c3/return + 8982 + 8983 $lookup-var-helper:error1: + 8984 (write-buffered *(ebp+0x18) "fn ") + 8985 8b/-> *(ebp+0x14) 0/r32/eax + 8986 (lookup *eax *(eax+4)) # Function-name Function-name => eax + 8987 (write-buffered *(ebp+0x18) %eax) + 8988 (write-buffered *(ebp+0x18) ": malformed stack when looking up '") + 8989 (write-slice-buffered *(ebp+0x18) *(ebp+8)) + 8990 (write-buffered *(ebp+0x18) "'\n") + 8991 (flush *(ebp+0x18)) + 8992 (stop *(ebp+0x1c) 1) + 8993 # never gets here + 8994 + 8995 $lookup-var-helper:error2: + 8996 # eax contains the conflicting var at this point + 8997 (write-buffered *(ebp+0x18) "fn ") + 8998 50/push-eax + 8999 8b/-> *(ebp+0x14) 0/r32/eax + 9000 (lookup *eax *(eax+4)) # Function-name Function-name => eax + 9001 (write-buffered *(ebp+0x18) %eax) + 9002 58/pop-eax + 9003 (write-buffered *(ebp+0x18) ": register ") + 9004 50/push-eax + 9005 (lookup *(eax+0x18) *(eax+0x1c)) # Var-register Var-register => eax + 9006 (write-buffered *(ebp+0x18) %eax) + 9007 58/pop-to-eax + 9008 (write-buffered *(ebp+0x18) " reads var '") + 9009 (write-slice-buffered *(ebp+0x18) *(ebp+8)) + 9010 (write-buffered *(ebp+0x18) "' after writing var '") + 9011 (lookup *eax *(eax+4)) # Var-name Var-name => eax + 9012 (write-buffered *(ebp+0x18) %eax) + 9013 (write-buffered *(ebp+0x18) "'\n") + 9014 (flush *(ebp+0x18)) + 9015 (stop *(ebp+0x1c) 1) + 9016 # never gets here + 9017 + 9018 dump-vars: # vars: (addr stack live-var) + 9019 # pseudocode: + 9020 # var curr: (addr handle var) = &vars->data[vars->top - 12] + 9021 # var min = vars->data + 9022 # while curr >= min + 9023 # var v: (handle var) = *curr + 9024 # print v + 9025 # curr -= 12 + 9026 # + 9027 # . prologue + 9028 55/push-ebp + 9029 89/<- %ebp 4/r32/esp + 9030 # . save registers + 9031 52/push-edx + 9032 53/push-ebx + 9033 56/push-esi + 9034 # esi = vars + 9035 8b/-> *(ebp+8) 6/r32/esi + 9036 # ebx = vars->top + 9037 8b/-> *esi 3/r32/ebx + 9038 # var min/edx: (addr handle var) = vars->data + 9039 8d/copy-address *(esi+8) 2/r32/edx + 9040 # var curr/ebx: (addr handle var) = &vars->data[vars->top - 12] + 9041 8d/copy-address *(esi+ebx-4) 3/r32/ebx # vars + 8 + vars->type - 12 + 9042 { + 9043 $dump-vars:loop: + 9044 # if (curr < min) return + 9045 39/compare %ebx 2/r32/edx + 9046 0f 82/jump-if-addr< break/disp32 + 9047 # + 9048 (write-buffered Stderr " var@") + 9049 (dump-var 2 %ebx) + 9050 # curr -= 12 + 9051 81 5/subop/subtract %ebx 0xc/imm32 + 9052 e9/jump loop/disp32 + 9053 } + 9054 $dump-vars:end: + 9055 # . restore registers + 9056 5e/pop-to-esi + 9057 5b/pop-to-ebx + 9058 5a/pop-to-edx + 9059 # . epilogue + 9060 89/<- %esp 5/r32/ebp + 9061 5d/pop-to-ebp + 9062 c3/return + 9063 + 9064 == data + 9065 # Like Registers, but no esp or ebp + 9066 Mu-registers: # (addr stream {(handle array byte), int}) + 9067 # a table is a stream + 9068 0x48/imm32/write + 9069 0/imm32/read + 9070 0x48/imm32/length + 9071 # data + 9072 # it is perfectly ok to use fake alloc-ids -- as long as you never try to reclaim them + 9073 0x11/imm32/alloc-id $Mu-register-eax/imm32 0/imm32 + 9074 0x11/imm32/alloc-id $Mu-register-ecx/imm32 1/imm32 + 9075 0x11/imm32/alloc-id $Mu-register-edx/imm32 2/imm32 + 9076 0x11/imm32/alloc-id $Mu-register-ebx/imm32 3/imm32 + 9077 0x11/imm32/alloc-id $Mu-register-esi/imm32 6/imm32 + 9078 0x11/imm32/alloc-id $Mu-register-edi/imm32 7/imm32 + 9079 + 9080 $Mu-register-eax: + 9081 0x11/imm32/alloc-id + 9082 3/imm32/size + 9083 0x65/e 0x61/a 0x78/x + 9084 + 9085 $Mu-register-ecx: + 9086 0x11/imm32/alloc-id + 9087 3/imm32/size + 9088 0x65/e 0x63/c 0x78/x + 9089 + 9090 $Mu-register-edx: + 9091 0x11/imm32/alloc-id + 9092 3/imm32/size + 9093 0x65/e 0x64/d 0x78/x + 9094 + 9095 $Mu-register-ebx: + 9096 0x11/imm32/alloc-id + 9097 3/imm32/size + 9098 0x65/e 0x62/b 0x78/x + 9099 + 9100 $Mu-register-esi: + 9101 0x11/imm32/alloc-id + 9102 3/imm32/size + 9103 0x65/e 0x73/s 0x69/i + 9104 + 9105 $Mu-register-edi: + 9106 0x11/imm32/alloc-id + 9107 3/imm32/size + 9108 0x65/e 0x64/d 0x69/i + 9109 + 9110 == code + 9111 + 9112 # return first 'name' from the top (back) of 'vars' and create a new var for a fn output if not found + 9113 lookup-var-or-find-in-fn-outputs: # name: (addr slice), vars: (addr stack live-var), fn: (addr function), out: (addr handle var), err: (addr buffered-file), ed: (addr exit-descriptor) + 9114 # . prologue + 9115 55/push-ebp + 9116 89/<- %ebp 4/r32/esp + 9117 # . save registers + 9118 50/push-eax + 9119 # + 9120 (lookup-var-helper *(ebp+8) *(ebp+0xc) *(ebp+0x14) *(ebp+0x10) *(ebp+0x18) *(ebp+0x1c)) # arg order slightly different; 'fn' is deemphasized + 9121 { + 9122 # if (out != 0) return + 9123 8b/-> *(ebp+0x14) 0/r32/eax + 9124 81 7/subop/compare *eax 0/imm32 + 9125 75/jump-if-!= break/disp8 + 9126 # if name is one of fn's outputs, return it + 9127 (find-in-function-outputs *(ebp+0x10) *(ebp+8) *(ebp+0x14)) + 9128 8b/-> *(ebp+0x14) 0/r32/eax + 9129 81 7/subop/compare *eax 0/imm32 + 9130 # otherwise abort + 9131 0f 84/jump-if-= $lookup-or-define-var:abort/disp32 + 9132 } + 9133 $lookup-or-define-var:end: + 9134 # . restore registers + 9135 58/pop-to-eax + 9136 # . epilogue + 9137 89/<- %esp 5/r32/ebp + 9138 5d/pop-to-ebp + 9139 c3/return + 9140 + 9141 $lookup-or-define-var:abort: + 9142 (write-buffered *(ebp+0x18) "unknown variable '") + 9143 (write-slice-buffered *(ebp+0x18) *(ebp+8)) + 9144 (write-buffered *(ebp+0x18) "'\n") + 9145 (flush *(ebp+0x18)) + 9146 (stop *(ebp+0x1c) 1) + 9147 # never gets here + 9148 + 9149 find-in-function-outputs: # fn: (addr function), name: (addr slice), out: (addr handle var) + 9150 # . prologue + 9151 55/push-ebp + 9152 89/<- %ebp 4/r32/esp + 9153 # . save registers + 9154 50/push-eax + 9155 51/push-ecx + 9156 # var curr/ecx: (addr list var) = lookup(fn->outputs) + 9157 8b/-> *(ebp+8) 1/r32/ecx + 9158 (lookup *(ecx+0x10) *(ecx+0x14)) # Function-outputs Function-outputs => eax + 9159 89/<- %ecx 0/r32/eax + 9160 # while curr != null + 9161 { + 9162 81 7/subop/compare %ecx 0/imm32 + 9163 74/jump-if-= break/disp8 + 9164 # var v/eax: (addr var) = lookup(curr->value) + 9165 (lookup *ecx *(ecx+4)) # List-value List-value => eax + 9166 # var s/eax: (addr array byte) = lookup(v->name) + 9167 (lookup *eax *(eax+4)) # Var-name Var-name => eax + 9168 # if (s == name) return curr->value + 9169 (slice-equal? *(ebp+0xc) %eax) # => eax + 9170 3d/compare-eax-and 0/imm32/false + 9171 { + 9172 74/jump-if-= break/disp8 + 9173 # var edi = out + 9174 57/push-edi + 9175 8b/-> *(ebp+0x10) 7/r32/edi + 9176 # *out = curr->value + 9177 8b/-> *ecx 0/r32/eax + 9178 89/<- *edi 0/r32/eax + 9179 8b/-> *(ecx+4) 0/r32/eax + 9180 89/<- *(edi+4) 0/r32/eax + 9181 # + 9182 5f/pop-to-edi + 9183 eb/jump $find-in-function-outputs:end/disp8 + 9184 } + 9185 # curr = curr->next + 9186 (lookup *(ecx+8) *(ecx+0xc)) # List-next List-next => eax + 9187 89/<- %ecx 0/r32/eax + 9188 # + 9189 eb/jump loop/disp8 + 9190 } + 9191 b8/copy-to-eax 0/imm32 + 9192 $find-in-function-outputs:end: + 9193 # . restore registers + 9194 59/pop-to-ecx + 9195 58/pop-to-eax + 9196 # . epilogue + 9197 89/<- %esp 5/r32/ebp + 9198 5d/pop-to-ebp + 9199 c3/return + 9200 + 9201 # push 'out' to 'vars' if not already there; it's assumed to be a fn output + 9202 maybe-define-var: # out: (handle var), vars: (addr stack live-var) + 9203 # . prologue + 9204 55/push-ebp + 9205 89/<- %ebp 4/r32/esp + 9206 # . save registers + 9207 50/push-eax + 9208 # var out-addr/eax: (addr var) + 9209 (lookup *(ebp+8) *(ebp+0xc)) # => eax + 9210 # + 9211 (binding-exists? %eax *(ebp+0x10)) # => eax + 9212 3d/compare-eax-and 0/imm32/false + 9213 75/jump-if-!= $maybe-define-var:end/disp8 + 9214 # otherwise update vars + 9215 (push *(ebp+0x10) *(ebp+8)) + 9216 (push *(ebp+0x10) *(ebp+0xc)) + 9217 (push *(ebp+0x10) 0) # 'out' is always a fn output; never spill it + 9218 $maybe-define-var:end: + 9219 # . restore registers + 9220 58/pop-to-eax + 9221 # . epilogue + 9222 89/<- %esp 5/r32/ebp + 9223 5d/pop-to-ebp + 9224 c3/return + 9225 + 9226 # simpler version of lookup-var-helper + 9227 binding-exists?: # target: (addr var), vars: (addr stack live-var) -> result/eax: boolean + 9228 # pseudocode: + 9229 # var curr: (addr handle var) = &vars->data[vars->top - 12] + 9230 # var min = vars->data + 9231 # while curr >= min + 9232 # var v: (handle var) = *curr + 9233 # if v->name == target->name + 9234 # return true + 9235 # curr -= 12 + 9236 # return false + 9237 # + 9238 # . prologue + 9239 55/push-ebp + 9240 89/<- %ebp 4/r32/esp + 9241 # . save registers + 9242 51/push-ecx + 9243 52/push-edx + 9244 56/push-esi + 9245 # var target-name/ecx: (addr array byte) = lookup(target->name) + 9246 8b/-> *(ebp+8) 0/r32/eax + 9247 (lookup *eax *(eax+4)) # Var-name Var-name => eax + 9248 89/<- %ecx 0/r32/eax + 9249 # esi = vars + 9250 8b/-> *(ebp+0xc) 6/r32/esi + 9251 # eax = vars->top + 9252 8b/-> *esi 0/r32/eax + 9253 # var min/edx: (addr handle var) = vars->data + 9254 8d/copy-address *(esi+8) 2/r32/edx + 9255 # var curr/esi: (addr handle var) = &vars->data[vars->top - 12] + 9256 8d/copy-address *(esi+eax-4) 6/r32/esi # vars + 8 + vars->type - 12 + 9257 { + 9258 $binding-exists?:loop: + 9259 # if (curr < min) return + 9260 39/compare %esi 2/r32/edx + 9261 0f 82/jump-if-addr< break/disp32 + 9262 # var v/eax: (addr var) = lookup(*curr) + 9263 (lookup *esi *(esi+4)) # => eax + 9264 # var vn/eax: (addr array byte) = lookup(v->name) + 9265 (lookup *eax *(eax+4)) # Var-name Var-name => eax + 9266 # if (vn == target-name) return true + 9267 (string-equal? %ecx %eax) # => eax + 9268 3d/compare-eax-and 0/imm32/false + 9269 75/jump-if-!= $binding-exists?:end/disp8 # eax already contains true + 9270 # curr -= 12 + 9271 81 5/subop/subtract %esi 0xc/imm32 + 9272 e9/jump loop/disp32 + 9273 } + 9274 b8/copy-to-eax 0/imm32/false + 9275 $binding-exists?:end: + 9276 # . restore registers + 9277 5e/pop-to-esi + 9278 5a/pop-to-edx + 9279 59/pop-to-ecx + 9280 # . epilogue + 9281 89/<- %esp 5/r32/ebp + 9282 5d/pop-to-ebp + 9283 c3/return + 9284 + 9285 test-parse-mu-stmt: + 9286 # . prologue + 9287 55/push-ebp + 9288 89/<- %ebp 4/r32/esp + 9289 # setup + 9290 (clear-stream _test-input-stream) + 9291 (write _test-input-stream "increment n\n") + 9292 # var vars/ecx: (stack (addr var) 16) + 9293 81 5/subop/subtract %esp 0xc0/imm32 + 9294 68/push 0xc0/imm32/size + 9295 68/push 0/imm32/top + 9296 89/<- %ecx 4/r32/esp + 9297 (clear-stack %ecx) + 9298 # var v/edx: (handle var) + 9299 68/push 0/imm32 + 9300 68/push 0/imm32 + 9301 89/<- %edx 4/r32/esp + 9302 # var s/eax: (handle array byte) + 9303 68/push 0/imm32 + 9304 68/push 0/imm32 + 9305 89/<- %eax 4/r32/esp + 9306 # v = new var("n") + 9307 (copy-array Heap "n" %eax) + 9308 (new-var Heap *eax *(eax+4) %edx) + 9309 # + 9310 (push %ecx *edx) + 9311 (push %ecx *(edx+4)) + 9312 (push %ecx 0) + 9313 # var out/eax: (handle stmt) + 9314 68/push 0/imm32 + 9315 68/push 0/imm32 + 9316 89/<- %eax 4/r32/esp + 9317 # convert + 9318 (parse-mu-stmt _test-input-stream %ecx 0 %eax Stderr 0) + 9319 # var out-addr/edx: (addr stmt) = lookup(*out) + 9320 (lookup *eax *(eax+4)) # => eax + 9321 89/<- %edx 0/r32/eax + 9322 # out->tag + 9323 (check-ints-equal *edx 1 "F - test-parse-mu-stmt/tag") # Stmt-tag is Stmt1 + 9324 # out->operation + 9325 (lookup *(edx+4) *(edx+8)) # Stmt1-operation Stmt1-operation => eax + 9326 (check-strings-equal %eax "increment" "F - test-parse-mu-stmt/name") # Stmt1-operation + 9327 # out->inouts->value->name + 9328 # . eax = out->inouts + 9329 (lookup *(edx+0xc) *(edx+0x10)) # Stmt1-inouts Stmt1-inouts => eax + 9330 # . eax = out->inouts->value + 9331 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax + 9332 # . eax = out->inouts->value->name + 9333 (lookup *eax *(eax+4)) # Var-name Var-name => eax + 9334 # . + 9335 (check-strings-equal %eax "n" "F - test-parse-mu-stmt/inout:0") + 9336 # . epilogue + 9337 89/<- %esp 5/r32/ebp + 9338 5d/pop-to-ebp + 9339 c3/return + 9340 + 9341 test-parse-mu-stmt-with-comma: + 9342 # . prologue + 9343 55/push-ebp + 9344 89/<- %ebp 4/r32/esp + 9345 # setup + 9346 (clear-stream _test-input-stream) + 9347 (write _test-input-stream "copy-to n, 3\n") + 9348 # var vars/ecx: (stack (addr var) 16) + 9349 81 5/subop/subtract %esp 0xc0/imm32 + 9350 68/push 0xc0/imm32/size + 9351 68/push 0/imm32/top + 9352 89/<- %ecx 4/r32/esp + 9353 (clear-stack %ecx) + 9354 # var v/edx: (handle var) + 9355 68/push 0/imm32 + 9356 68/push 0/imm32 + 9357 89/<- %edx 4/r32/esp + 9358 # var s/eax: (handle array byte) + 9359 68/push 0/imm32 + 9360 68/push 0/imm32 + 9361 89/<- %eax 4/r32/esp + 9362 # v = new var("n") + 9363 (copy-array Heap "n" %eax) + 9364 (new-var Heap *eax *(eax+4) %edx) + 9365 # + 9366 (push %ecx *edx) + 9367 (push %ecx *(edx+4)) + 9368 (push %ecx 0) + 9369 # var out/eax: (handle stmt) + 9370 68/push 0/imm32 + 9371 68/push 0/imm32 + 9372 89/<- %eax 4/r32/esp + 9373 # convert + 9374 (parse-mu-stmt _test-input-stream %ecx 0 %eax Stderr 0) + 9375 # var out-addr/edx: (addr stmt) = lookup(*out) + 9376 (lookup *eax *(eax+4)) # => eax + 9377 89/<- %edx 0/r32/eax + 9378 # out->tag + 9379 (check-ints-equal *edx 1 "F - test-parse-mu-stmt-with-comma/tag") # Stmt-tag is Stmt1 + 9380 # out->operation + 9381 (lookup *(edx+4) *(edx+8)) # Stmt1-operation Stmt1-operation => eax + 9382 (check-strings-equal %eax "copy-to" "F - test-parse-mu-stmt-with-comma/name") # Stmt1-operation + 9383 # out->inouts->value->name + 9384 # . eax = out->inouts + 9385 (lookup *(edx+0xc) *(edx+0x10)) # Stmt1-inouts Stmt1-inouts => eax + 9386 # . eax = out->inouts->value + 9387 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax + 9388 # . eax = out->inouts->value->name + 9389 (lookup *eax *(eax+4)) # Var-name Var-name => eax + 9390 # . + 9391 (check-strings-equal %eax "n" "F - test-parse-mu-stmt-with-comma/inout:0") + 9392 # . epilogue + 9393 89/<- %esp 5/r32/ebp + 9394 5d/pop-to-ebp + 9395 c3/return + 9396 + 9397 new-var: # ad: (addr allocation-descriptor), name: (handle array byte), out: (addr handle var) + 9398 # . prologue + 9399 55/push-ebp + 9400 89/<- %ebp 4/r32/esp + 9401 # . save registers + 9402 50/push-eax + 9403 51/push-ecx + 9404 # ecx = out + 9405 8b/-> *(ebp+0x14) 1/r32/ecx + 9406 # + 9407 (allocate *(ebp+8) *Var-size %ecx) + 9408 # var out-addr/eax: (addr var) + 9409 (lookup *ecx *(ecx+4)) # => eax + 9410 # out-addr->name = name + 9411 8b/-> *(ebp+0xc) 1/r32/ecx + 9412 89/<- *eax 1/r32/ecx # Var-name + 9413 8b/-> *(ebp+0x10) 1/r32/ecx + 9414 89/<- *(eax+4) 1/r32/ecx # Var-name + 9415 #? (write-buffered Stderr "var ") + 9416 #? (lookup *(ebp+0xc) *(ebp+0x10)) + 9417 #? (write-buffered Stderr %eax) + 9418 #? (write-buffered Stderr " at ") + 9419 #? 8b/-> *(ebp+0x14) 1/r32/ecx + 9420 #? (lookup *ecx *(ecx+4)) # => eax + 9421 #? (write-int32-hex-buffered Stderr %eax) + 9422 #? (write-buffered Stderr Newline) + 9423 #? (flush Stderr) + 9424 $new-var:end: + 9425 # . restore registers + 9426 59/pop-to-ecx + 9427 58/pop-to-eax + 9428 # . epilogue + 9429 89/<- %esp 5/r32/ebp + 9430 5d/pop-to-ebp + 9431 c3/return + 9432 + 9433 new-literal-integer: # ad: (addr allocation-descriptor), name: (addr slice), out: (addr handle var), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) + 9434 # . prologue + 9435 55/push-ebp + 9436 89/<- %ebp 4/r32/esp + 9437 # . save registers + 9438 50/push-eax + 9439 51/push-ecx + 9440 # if (!is-hex-int?(name)) abort + 9441 (is-hex-int? *(ebp+0xc)) # => eax + 9442 3d/compare-eax-and 0/imm32/false + 9443 0f 84/jump-if-= $new-literal-integer:abort/disp32 + 9444 # out = new var(s) + 9445 (new-var-from-slice *(ebp+8) *(ebp+0xc) *(ebp+0x10)) + 9446 # var out-addr/ecx: (addr var) = lookup(*out) + 9447 8b/-> *(ebp+0x10) 0/r32/eax + 9448 (lookup *eax *(eax+4)) # => eax + 9449 89/<- %ecx 0/r32/eax + 9450 # out-addr->block-depth = *Curr-block-depth + 9451 8b/-> *Curr-block-depth 0/r32/eax + 9452 89/<- *(ecx+0x10) 0/r32/eax # Var-block-depth + 9453 # out-addr->type = new tree() + 9454 8d/copy-address *(ecx+8) 0/r32/eax # Var-type + 9455 (allocate *(ebp+8) *Type-tree-size %eax) + 9456 (lookup *(ecx+8) *(ecx+0xc)) # Var-type Var-type => eax + 9457 c7 0/subop/copy *eax 1/imm32/true # Type-tree-is-atom + 9458 # nothing else to do; default type is 'literal' + 9459 $new-literal-integer:end: + 9460 # . reclaim locals + 9461 81 0/subop/add %esp 8/imm32 + 9462 # . restore registers + 9463 59/pop-to-ecx + 9464 58/pop-to-eax + 9465 # . epilogue + 9466 89/<- %esp 5/r32/ebp + 9467 5d/pop-to-ebp + 9468 c3/return + 9469 + 9470 $new-literal-integer:abort: + 9471 (write-buffered *(ebp+0x18) "fn ") + 9472 8b/-> *(ebp+0x14) 0/r32/eax + 9473 (lookup *eax *(eax+4)) # Function-name Function-name => eax + 9474 (write-buffered *(ebp+0x18) %eax) + 9475 (write-buffered *(ebp+0x18) ": variable cannot begin with a digit '") + 9476 (write-slice-buffered *(ebp+0x18) *(ebp+0xc)) + 9477 (write-buffered *(ebp+0x18) "'\n") + 9478 (flush *(ebp+0x18)) + 9479 (stop *(ebp+0x1c) 1) + 9480 # never gets here + 9481 + 9482 new-literal: # ad: (addr allocation-descriptor), name: (addr slice), out: (addr handle var) 9483 # . prologue 9484 55/push-ebp 9485 89/<- %ebp 4/r32/esp - 9486 # - 9487 8b/-> *(ebp+8) 0/r32/eax - 9488 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax - 9489 (lookup *(eax+8) *(eax+0xc)) # Var-type Var-type => eax - 9490 { - 9491 81 7/subop/compare *(eax+8) 0/imm32 # Tree-right - 9492 74/jump-if-= break/disp8 - 9493 (lookup *(eax+0xc) *(eax+0x10)) # Tree-right Tree-right => eax - 9494 (lookup *(eax+4) *(eax+8)) # Tree-left Tree-left => eax - 9495 } - 9496 8b/-> *(eax+4) 0/r32/eax # Tree-value - 9497 $container-type:end: - 9498 # . epilogue - 9499 89/<- %esp 5/r32/ebp - 9500 5d/pop-to-ebp - 9501 c3/return - 9502 - 9503 is-container?: # t: type-id -> result/eax: boolean - 9504 # . prologue - 9505 55/push-ebp - 9506 89/<- %ebp 4/r32/esp - 9507 # - 9508 8b/-> *(ebp+8) 0/r32/eax - 9509 c1/shift 4/subop/left %eax 2/imm8 - 9510 3b/compare 0/r32/eax *Primitive-type-ids - 9511 0f 9d/set-if->= %al - 9512 81 4/subop/and %eax 0xff/imm32 - 9513 $is-container?:end: - 9514 # . epilogue - 9515 89/<- %esp 5/r32/ebp - 9516 5d/pop-to-ebp - 9517 c3/return - 9518 - 9519 find-or-create-typeinfo: # t: type-id, out: (addr handle typeinfo) - 9520 # . prologue - 9521 55/push-ebp - 9522 89/<- %ebp 4/r32/esp - 9523 # . save registers - 9524 50/push-eax - 9525 51/push-ecx - 9526 52/push-edx - 9527 57/push-edi - 9528 # edi = out - 9529 8b/-> *(ebp+0xc) 7/r32/edi - 9530 # var fields/ecx: (handle table (handle array byte) (handle typeinfo-entry)) - 9531 68/push 0/imm32 - 9532 68/push 0/imm32 - 9533 89/<- %ecx 4/r32/esp - 9534 # find-typeinfo(t, out) - 9535 (find-typeinfo *(ebp+8) %edi) - 9536 { - 9537 # if (*out != 0) break - 9538 81 7/subop/compare *edi 0/imm32 - 9539 0f 85/jump-if-!= break/disp32 - 9540 $find-or-create-typeinfo:create: - 9541 # *out = allocate - 9542 (allocate Heap *Typeinfo-size %edi) - 9543 # var tmp/eax: (addr typeinfo) = lookup(*out) - 9544 (lookup *edi *(edi+4)) # => eax - 9545 #? (write-buffered Stderr "created typeinfo at ") - 9546 #? (write-int32-hex-buffered Stderr %eax) - 9547 #? (write-buffered Stderr " for type-id ") - 9548 #? (write-int32-hex-buffered Stderr *(ebp+8)) - 9549 #? (write-buffered Stderr Newline) - 9550 #? (flush Stderr) - 9551 # tmp->id = t - 9552 8b/-> *(ebp+8) 2/r32/edx - 9553 89/<- *eax 2/r32/edx # Typeinfo-id - 9554 # tmp->fields = new table - 9555 # . fields = new table - 9556 (new-stream Heap 0x40 *Typeinfo-fields-row-size %ecx) - 9557 # . tmp->fields = fields - 9558 8b/-> *ecx 2/r32/edx - 9559 89/<- *(eax+4) 2/r32/edx # Typeinfo-fields - 9560 8b/-> *(ecx+4) 2/r32/edx - 9561 89/<- *(eax+8) 2/r32/edx # Typeinfo-fields - 9562 # tmp->next = Program->types - 9563 8b/-> *_Program-types 1/r32/ecx - 9564 89/<- *(eax+0x10) 1/r32/ecx # Typeinfo-next - 9565 8b/-> *_Program-types->payload 1/r32/ecx - 9566 89/<- *(eax+0x14) 1/r32/ecx # Typeinfo-next - 9567 # Program->types = out - 9568 8b/-> *edi 1/r32/ecx - 9569 89/<- *_Program-types 1/r32/ecx - 9570 8b/-> *(edi+4) 1/r32/ecx - 9571 89/<- *_Program-types->payload 1/r32/ecx - 9572 } - 9573 $find-or-create-typeinfo:end: - 9574 # . reclaim locals - 9575 81 0/subop/add %esp 8/imm32 - 9576 # . restore registers - 9577 5f/pop-to-edi - 9578 5a/pop-to-edx - 9579 59/pop-to-ecx - 9580 58/pop-to-eax - 9581 # . epilogue - 9582 89/<- %esp 5/r32/ebp - 9583 5d/pop-to-ebp - 9584 c3/return - 9585 - 9586 find-typeinfo: # t: type-id, out: (addr handle typeinfo) - 9587 # . prologue - 9588 55/push-ebp - 9589 89/<- %ebp 4/r32/esp - 9590 # . save registers - 9591 50/push-eax - 9592 51/push-ecx - 9593 52/push-edx - 9594 57/push-edi - 9595 # ecx = t - 9596 8b/-> *(ebp+8) 1/r32/ecx - 9597 # edi = out - 9598 8b/-> *(ebp+0xc) 7/r32/edi - 9599 # *out = Program->types - 9600 8b/-> *_Program-types 0/r32/eax - 9601 89/<- *edi 0/r32/eax - 9602 8b/-> *_Program-types->payload 0/r32/eax - 9603 89/<- *(edi+4) 0/r32/eax - 9604 { - 9605 $find-typeinfo:loop: - 9606 # if (*out == 0) break - 9607 81 7/subop/compare *edi 0/imm32 - 9608 74/jump-if-= break/disp8 - 9609 $find-typeinfo:check: - 9610 # var tmp/eax: (addr typeinfo) = lookup(*out) - 9611 (lookup *edi *(edi+4)) # => eax - 9612 # if (tmp->id == t) break - 9613 39/compare *eax 1/r32/ecx # Typeinfo-id - 9614 74/jump-if-= break/disp8 - 9615 $find-typeinfo:continue: - 9616 # *out = tmp->next - 9617 8b/-> *(eax+0x10) 2/r32/edx # Typeinfo-next - 9618 89/<- *edi 2/r32/edx - 9619 8b/-> *(eax+0x14) 2/r32/edx # Typeinfo-next - 9620 89/<- *(edi+4) 2/r32/edx - 9621 # - 9622 eb/jump loop/disp8 - 9623 } - 9624 $find-typeinfo:end: - 9625 # . restore registers - 9626 5f/pop-to-edi - 9627 5a/pop-to-edx - 9628 59/pop-to-ecx - 9629 58/pop-to-eax - 9630 # . epilogue - 9631 89/<- %esp 5/r32/ebp - 9632 5d/pop-to-ebp - 9633 c3/return - 9634 - 9635 find-or-create-typeinfo-output-var: # T: (addr typeinfo), f: (addr slice), out: (addr handle var) - 9636 # . prologue - 9637 55/push-ebp - 9638 89/<- %ebp 4/r32/esp - 9639 # . save registers - 9640 50/push-eax - 9641 52/push-edx - 9642 57/push-edi - 9643 # var dest/edi: (handle typeinfo-entry) - 9644 68/push 0/imm32 - 9645 68/push 0/imm32 - 9646 89/<- %edi 4/r32/esp - 9647 # find-or-create-typeinfo-fields(T, f, dest) - 9648 (find-or-create-typeinfo-fields *(ebp+8) *(ebp+0xc) %edi) - 9649 # var dest-addr/edi: (addr typeinfo-entry) = lookup(dest) - 9650 (lookup *edi *(edi+4)) # => eax - 9651 89/<- %edi 0/r32/eax - 9652 # if dest-addr->output-var doesn't exist, create it - 9653 { - 9654 81 7/subop/compare *(edi+0xc) 0/imm32 # Typeinfo-entry-output-var - 9655 0f 85/jump-if-!= break/disp32 - 9656 # dest-addr->output-var = new var(dummy name, type, -1 offset) - 9657 # . var name/eax: (handle array byte) = "field" - 9658 68/push 0/imm32 - 9659 68/push 0/imm32 - 9660 89/<- %eax 4/r32/esp - 9661 (slice-to-string Heap *(ebp+0xc) %eax) - 9662 # . new var - 9663 8d/copy-address *(edi+0xc) 2/r32/edx - 9664 (new-var Heap *eax *(eax+4) %edx) - 9665 # . reclaim name - 9666 81 0/subop/add %esp 8/imm32 - 9667 # var result/edx: (addr var) = lookup(dest-addr->output-var) - 9668 (lookup *(edi+0xc) *(edi+0x10)) # => eax - 9669 89/<- %edx 0/r32/eax - 9670 # result->type = new constant type - 9671 8d/copy-address *(edx+8) 0/r32/eax # Var-type - 9672 (allocate Heap *Tree-size %eax) - 9673 (lookup *(edx+8) *(edx+0xc)) # => eax - 9674 c7 0/subop/copy *eax 1/imm32/true # Tree-is-atom - 9675 c7 0/subop/copy *(eax+4) 6/imm32/constant # Tree-value - 9676 c7 0/subop/copy *(eax+8) 0/imm32 # Tree-left - 9677 c7 0/subop/copy *(eax+0xc) 0/imm32 # Tree-right - 9678 c7 0/subop/copy *(eax+0x10) 0/imm32 # Tree-right - 9679 # result->offset isn't filled out yet - 9680 c7 0/subop/copy *(edx+0x14) -1/imm32/uninitialized # Var-offset - 9681 } - 9682 # out = dest-addr->output-var - 9683 8b/-> *(ebp+0x10) 2/r32/edx - 9684 8b/-> *(edi+0xc) 0/r32/eax # Typeinfo-entry-output-var - 9685 89/<- *edx 0/r32/eax - 9686 8b/-> *(edi+0x10) 0/r32/eax # Typeinfo-entry-output-var - 9687 89/<- *(edx+4) 0/r32/eax - 9688 $find-or-create-typeinfo-output-var:end: - 9689 # . reclaim locals - 9690 81 0/subop/add %esp 8/imm32 - 9691 # . restore registers - 9692 5f/pop-to-edi - 9693 5a/pop-to-edx - 9694 58/pop-to-eax - 9695 # . epilogue - 9696 89/<- %esp 5/r32/ebp - 9697 5d/pop-to-ebp - 9698 c3/return - 9699 - 9700 find-or-create-typeinfo-fields: # T: (addr typeinfo), f: (addr slice), out: (addr handle typeinfo-entry) - 9701 # . prologue - 9702 55/push-ebp - 9703 89/<- %ebp 4/r32/esp - 9704 # . save registers - 9705 50/push-eax - 9706 56/push-esi - 9707 57/push-edi - 9708 # eax = lookup(T->fields) - 9709 8b/-> *(ebp+8) 0/r32/eax - 9710 (lookup *(eax+4) *(eax+8)) # Typeinfo-fields Typeinfo-fields => eax - 9711 # edi = out - 9712 8b/-> *(ebp+0x10) 7/r32/edi - 9713 # var src/esi: (addr handle typeinfo-entry) = get-or-insert-slice(T->fields, f) - 9714 (get-or-insert-slice %eax *(ebp+0xc) *Typeinfo-fields-row-size Heap) # => eax - 9715 89/<- %esi 0/r32/eax - 9716 # if src doesn't exist, allocate it - 9717 { - 9718 81 7/subop/compare *esi 0/imm32 - 9719 75/jump-if-!= break/disp8 - 9720 (allocate Heap *Typeinfo-entry-size %esi) - 9721 #? (write-buffered Stderr "handle at ") - 9722 #? (write-int32-hex-buffered Stderr %esi) - 9723 #? (write-buffered Stderr ": ") - 9724 #? (write-int32-hex-buffered Stderr *esi) - 9725 #? (write-buffered Stderr " ") - 9726 #? (write-int32-hex-buffered Stderr *(esi+4)) - 9727 #? (write-buffered Stderr Newline) - 9728 #? (flush Stderr) - 9729 #? (lookup *esi *(esi+4)) - 9730 #? (write-buffered Stderr "created typeinfo fields at ") - 9731 #? (write-int32-hex-buffered Stderr %esi) - 9732 #? (write-buffered Stderr " for ") - 9733 #? (write-int32-hex-buffered Stderr *(ebp+8)) - 9734 #? (write-buffered Stderr Newline) - 9735 #? (flush Stderr) - 9736 } - 9737 # *out = src - 9738 # . *edi = *src - 9739 8b/-> *esi 0/r32/eax - 9740 89/<- *edi 0/r32/eax - 9741 8b/-> *(esi+4) 0/r32/eax - 9742 89/<- *(edi+4) 0/r32/eax - 9743 $find-or-create-typeinfo-fields:end: - 9744 # . restore registers - 9745 5f/pop-to-edi - 9746 5e/pop-to-esi - 9747 58/pop-to-eax - 9748 # . epilogue - 9749 89/<- %esp 5/r32/ebp - 9750 5d/pop-to-ebp - 9751 c3/return - 9752 - 9753 populate-mu-type: # in: (addr stream byte), t: (addr typeinfo), err: (addr buffered-file), ed: (addr exit-descriptor) - 9754 # pseudocode: - 9755 # var line: (stream byte 512) - 9756 # curr-index = 0 - 9757 # while true - 9758 # clear-stream(line) - 9759 # read-line-buffered(in, line) - 9760 # if line->write == 0 - 9761 # abort - 9762 # word-slice = next-mu-token(line) - 9763 # if slice-empty?(word-slice) # end of line - 9764 # continue - 9765 # if slice-equal?(word-slice, "}") - 9766 # break - 9767 # var v: (handle var) = parse-var-with-type(word-slice, line) - 9768 # var r: (handle typeinfo-fields) = find-or-create-typeinfo-fields(t, word-slice/v->name) - 9769 # TODO: ensure that r->first is null - 9770 # r->index = curr-index - 9771 # curr-index++ - 9772 # r->input-var = v - 9773 # if r->output-var == 0 - 9774 # r->output-var = new literal - 9775 # TODO: ensure nothing else in line - 9776 # t->total-size-in-bytes = -2 (not yet initialized) - 9777 # - 9778 # . prologue - 9779 55/push-ebp - 9780 89/<- %ebp 4/r32/esp - 9781 # var curr-index: int at *(ebp-4) - 9782 68/push 0/imm32 - 9783 # . save registers - 9784 50/push-eax - 9785 51/push-ecx - 9786 52/push-edx - 9787 53/push-ebx - 9788 56/push-esi - 9789 57/push-edi - 9790 # edi = t - 9791 8b/-> *(ebp+0xc) 7/r32/edi - 9792 # var line/ecx: (stream byte 512) - 9793 81 5/subop/subtract %esp 0x200/imm32 - 9794 68/push 0x200/imm32/size - 9795 68/push 0/imm32/read - 9796 68/push 0/imm32/write - 9797 89/<- %ecx 4/r32/esp - 9798 # var word-slice/edx: slice - 9799 68/push 0/imm32/end - 9800 68/push 0/imm32/start - 9801 89/<- %edx 4/r32/esp - 9802 # var v/esi: (handle var) - 9803 68/push 0/imm32 - 9804 68/push 0/imm32 - 9805 89/<- %esi 4/r32/esp - 9806 # var r/ebx: (handle typeinfo-entry) - 9807 68/push 0/imm32 - 9808 68/push 0/imm32 - 9809 89/<- %ebx 4/r32/esp - 9810 { - 9811 $populate-mu-type:line-loop: - 9812 (clear-stream %ecx) - 9813 (read-line-buffered *(ebp+8) %ecx) - 9814 # if (line->write == 0) abort - 9815 81 7/subop/compare *ecx 0/imm32 - 9816 0f 84/jump-if-= $populate-mu-type:abort/disp32 - 9817 +-- 6 lines: #? # dump line ------------------------------------------------------------------------------------------------------------------------------------------------------ - 9823 (next-mu-token %ecx %edx) - 9824 # if slice-empty?(word-slice) continue - 9825 (slice-empty? %edx) # => eax - 9826 3d/compare-eax-and 0/imm32 - 9827 0f 85/jump-if-!= loop/disp32 - 9828 # if slice-equal?(word-slice, "}") break - 9829 (slice-equal? %edx "}") - 9830 3d/compare-eax-and 0/imm32 - 9831 0f 85/jump-if-!= break/disp32 - 9832 $populate-mu-type:parse-element: - 9833 # v = parse-var-with-type(word-slice, first-line) - 9834 # must do this first to strip the trailing ':' from word-slice before - 9835 # using it in find-or-create-typeinfo-fields below - 9836 # TODO: clean up that mutation in parse-var-with-type - 9837 (parse-var-with-type %edx %ecx %esi *(ebp+0x10) *(ebp+0x14)) # => eax - 9838 # var tmp/ecx - 9839 51/push-ecx - 9840 $populate-mu-type:create-typeinfo-fields: - 9841 # var r/ebx: (handle typeinfo-entry) - 9842 (find-or-create-typeinfo-fields %edi %edx %ebx) - 9843 # r->index = curr-index - 9844 (lookup *ebx *(ebx+4)) # => eax - 9845 8b/-> *(ebp-4) 1/r32/ecx - 9846 #? (write-buffered Stderr "saving index ") - 9847 #? (write-int32-hex-buffered Stderr %ecx) - 9848 #? (write-buffered Stderr " at ") - 9849 #? (write-int32-hex-buffered Stderr %edi) - 9850 #? (write-buffered Stderr Newline) - 9851 #? (flush Stderr) - 9852 89/<- *(eax+8) 1/r32/ecx # Typeinfo-entry-index - 9853 # ++curr-index - 9854 ff 0/subop/increment *(ebp-4) - 9855 $populate-mu-type:set-input-type: - 9856 # r->input-var = v - 9857 8b/-> *esi 1/r32/ecx - 9858 89/<- *eax 1/r32/ecx # Typeinfo-entry-input-var - 9859 8b/-> *(esi+4) 1/r32/ecx - 9860 89/<- *(eax+4) 1/r32/ecx # Typeinfo-entry-input-var - 9861 59/pop-to-ecx - 9862 { - 9863 $populate-mu-type:create-output-type: - 9864 # if (r->output-var == 0) create a new var with some placeholder data - 9865 81 7/subop/compare *(eax+0xc) 0/imm32 # Typeinfo-entry-output-var - 9866 75/jump-if-!= break/disp8 - 9867 8d/copy-address *(eax+0xc) 0/r32/eax # Typeinfo-entry-output-var - 9868 (new-literal Heap %edx %eax) - 9869 } - 9870 e9/jump loop/disp32 - 9871 } - 9872 $populate-mu-type:invalidate-total-size-in-bytes: - 9873 # Offsets and total size may not be accurate here since we may not yet - 9874 # have encountered the element types. - 9875 # We'll recompute them separately after parsing the entire program. - 9876 c7 0/subop/copy *(edi+0xc) -2/imm32/uninitialized # Typeinfo-total-size-in-bytes - 9877 $populate-mu-type:end: - 9878 # . reclaim locals - 9879 81 0/subop/add %esp 0x224/imm32 - 9880 # . restore registers - 9881 5f/pop-to-edi - 9882 5e/pop-to-esi - 9883 5b/pop-to-ebx - 9884 5a/pop-to-edx - 9885 59/pop-to-ecx - 9886 58/pop-to-eax - 9887 # reclaim curr-index - 9888 81 0/subop/add %esp 4/imm32 - 9889 # . epilogue - 9890 89/<- %esp 5/r32/ebp - 9891 5d/pop-to-ebp - 9892 c3/return - 9893 - 9894 $populate-mu-type:abort: - 9895 # error("unexpected top-level command: " word-slice "\n") - 9896 (write-buffered *(ebp+0x10) "incomplete type definition '") - 9897 (type-name *edi) # Typeinfo-id => eax - 9898 (write-buffered *(ebp+0x10) %eax) - 9899 (write-buffered *(ebp+0x10) "\n") - 9900 (flush *(ebp+0x10)) - 9901 (stop *(ebp+0x14) 1) - 9902 # never gets here - 9903 - 9904 type-name: # index: int -> result/eax: (addr array byte) - 9905 # . prologue - 9906 55/push-ebp - 9907 89/<- %ebp 4/r32/esp - 9908 # - 9909 (index Type-id *(ebp+8)) - 9910 $type-name:end: - 9911 # . epilogue - 9912 89/<- %esp 5/r32/ebp - 9913 5d/pop-to-ebp - 9914 c3/return - 9915 - 9916 index: # arr: (addr stream (handle array byte)), index: int -> result/eax: (addr array byte) - 9917 # . prologue - 9918 55/push-ebp - 9919 89/<- %ebp 4/r32/esp - 9920 # . save registers - 9921 56/push-esi - 9922 # TODO: bounds-check index - 9923 # esi = arr - 9924 8b/-> *(ebp+8) 6/r32/esi - 9925 # eax = index - 9926 8b/-> *(ebp+0xc) 0/r32/eax - 9927 # eax = *(arr + 12 + index) - 9928 8b/-> *(esi+eax+0xc) 0/r32/eax - 9929 $index:end: - 9930 # . restore registers - 9931 5e/pop-to-esi - 9932 # . epilogue - 9933 89/<- %esp 5/r32/ebp - 9934 5d/pop-to-ebp - 9935 c3/return - 9936 - 9937 ####################################################### - 9938 # Compute type sizes - 9939 ####################################################### - 9940 - 9941 # Compute the sizes of all user-defined types. - 9942 # We'll need the sizes of their elements, which may be other user-defined - 9943 # types, which we will compute as needed. + 9486 # . save registers + 9487 50/push-eax + 9488 51/push-ecx + 9489 # var s/ecx: (handle array byte) + 9490 68/push 0/imm32 + 9491 68/push 0/imm32 + 9492 89/<- %ecx 4/r32/esp + 9493 # s = slice-to-string(name) + 9494 (slice-to-string Heap *(ebp+0xc) %ecx) + 9495 # allocate to out + 9496 (new-var *(ebp+8) *ecx *(ecx+4) *(ebp+0x10)) + 9497 # var out-addr/ecx: (addr var) = lookup(*out) + 9498 8b/-> *(ebp+0x10) 1/r32/ecx + 9499 (lookup *ecx *(ecx+4)) # => eax + 9500 89/<- %ecx 0/r32/eax + 9501 # out-addr->block-depth = *Curr-block-depth + 9502 8b/-> *Curr-block-depth 0/r32/eax + 9503 89/<- *(ecx+0x10) 0/r32/eax # Var-block-depth + 9504 # out-addr->type/eax = new type + 9505 8d/copy-address *(ecx+8) 0/r32/eax # Var-type + 9506 (allocate *(ebp+8) *Type-tree-size %eax) + 9507 (lookup *(ecx+8) *(ecx+0xc)) # Var-type Var-type => eax + 9508 # nothing else to do; default type is 'literal' + 9509 c7 0/subop/copy *eax 1/imm32/true # Type-tree-is-atom + 9510 $new-literal:end: + 9511 # . reclaim locals + 9512 81 0/subop/add %esp 8/imm32 + 9513 # . restore registers + 9514 59/pop-to-ecx + 9515 58/pop-to-eax + 9516 # . epilogue + 9517 89/<- %esp 5/r32/ebp + 9518 5d/pop-to-ebp + 9519 c3/return + 9520 + 9521 new-var-from-slice: # ad: (addr allocation-descriptor), name: (addr slice), out: (addr handle var) + 9522 # . prologue + 9523 55/push-ebp + 9524 89/<- %ebp 4/r32/esp + 9525 # . save registers + 9526 51/push-ecx + 9527 # var tmp/ecx: (handle array byte) + 9528 68/push 0/imm32 + 9529 68/push 0/imm32 + 9530 89/<- %ecx 4/r32/esp + 9531 # tmp = slice-to-string(name) + 9532 (slice-to-string Heap *(ebp+0xc) %ecx) + 9533 # out = new-var(tmp) + 9534 (new-var *(ebp+8) *ecx *(ecx+4) *(ebp+0x10)) + 9535 $new-var-from-slice:end: + 9536 # . reclaim locals + 9537 81 0/subop/add %esp 8/imm32 + 9538 # . restore registers + 9539 59/pop-to-ecx + 9540 # . epilogue + 9541 89/<- %esp 5/r32/ebp + 9542 5d/pop-to-ebp + 9543 c3/return + 9544 + 9545 new-var-def: # ad: (addr allocation-descriptor), var: (handle var), out: (addr handle stmt) + 9546 # . prologue + 9547 55/push-ebp + 9548 89/<- %ebp 4/r32/esp + 9549 # . save registers + 9550 50/push-eax + 9551 51/push-ecx + 9552 # + 9553 (allocate *(ebp+8) *Stmt-size *(ebp+0x14)) + 9554 # var out-addr/eax: (addr stmt) = lookup(*out) + 9555 8b/-> *(ebp+0x14) 0/r32/eax + 9556 (lookup *eax *(eax+4)) # => eax + 9557 # out-addr->tag = stmt + 9558 c7 0/subop/copy *eax 2/imm32/tag/var-on-stack # Stmt-tag + 9559 # result->var = var + 9560 8b/-> *(ebp+0xc) 1/r32/ecx + 9561 89/<- *(eax+4) 1/r32/ecx # Vardef-var + 9562 8b/-> *(ebp+0x10) 1/r32/ecx + 9563 89/<- *(eax+8) 1/r32/ecx # Vardef-var + 9564 $new-var-def:end: + 9565 # . restore registers + 9566 59/pop-to-ecx + 9567 58/pop-to-eax + 9568 # . epilogue + 9569 89/<- %esp 5/r32/ebp + 9570 5d/pop-to-ebp + 9571 c3/return + 9572 + 9573 new-reg-var-def: # ad: (addr allocation-descriptor), var: (handle var), out: (addr handle stmt) + 9574 # . prologue + 9575 55/push-ebp + 9576 89/<- %ebp 4/r32/esp + 9577 # . save registers + 9578 50/push-eax + 9579 # eax = out + 9580 8b/-> *(ebp+0x14) 0/r32/eax + 9581 # + 9582 (allocate *(ebp+8) *Stmt-size %eax) + 9583 # var out-addr/eax: (addr stmt) = lookup(*out) + 9584 (lookup *eax *(eax+4)) # => eax + 9585 # set tag + 9586 c7 0/subop/copy *eax 3/imm32/tag/var-in-register # Stmt-tag + 9587 # set output + 9588 8d/copy-address *(eax+0x14) 0/r32/eax # Regvardef-outputs + 9589 (append-stmt-var Heap *(ebp+0xc) *(ebp+0x10) 0 0 0 %eax) + 9590 $new-reg-var-def:end: + 9591 # . restore registers + 9592 58/pop-to-eax + 9593 # . epilogue + 9594 89/<- %esp 5/r32/ebp + 9595 5d/pop-to-ebp + 9596 c3/return + 9597 + 9598 append-list: # ad: (addr allocation-descriptor), value: (handle _type), list: (handle list _type), out: (addr handle list _type) + 9599 # . prologue + 9600 55/push-ebp + 9601 89/<- %ebp 4/r32/esp + 9602 # . save registers + 9603 50/push-eax + 9604 51/push-ecx + 9605 57/push-edi + 9606 # edi = out + 9607 8b/-> *(ebp+0x1c) 7/r32/edi + 9608 # *out = new list + 9609 (allocate *(ebp+8) *List-size %edi) + 9610 # var out-addr/edi: (addr list _type) = lookup(*out) + 9611 (lookup *edi *(edi+4)) # => eax + 9612 89/<- %edi 0/r32/eax + 9613 # out-addr->value = value + 9614 8b/-> *(ebp+0xc) 0/r32/eax + 9615 89/<- *edi 0/r32/eax # List-value + 9616 8b/-> *(ebp+0x10) 0/r32/eax + 9617 89/<- *(edi+4) 0/r32/eax # List-value + 9618 # if (list == null) return + 9619 81 7/subop/compare *(ebp+0x14) 0/imm32 + 9620 74/jump-if-= $append-list:end/disp8 + 9621 # otherwise append + 9622 $append-list:non-empty-list: + 9623 # var curr/eax: (addr list _type) = lookup(list) + 9624 (lookup *(ebp+0x14) *(ebp+0x18)) # => eax + 9625 # while (curr->next != null) curr = curr->next + 9626 { + 9627 81 7/subop/compare *(eax+8) 0/imm32 # List-next + 9628 74/jump-if-= break/disp8 + 9629 # curr = lookup(curr->next) + 9630 (lookup *(eax+8) *(eax+0xc)) # List-next, List-next => eax + 9631 # + 9632 eb/jump loop/disp8 + 9633 } + 9634 # edi = out + 9635 8b/-> *(ebp+0x1c) 7/r32/edi + 9636 # curr->next = out + 9637 8b/-> *edi 1/r32/ecx + 9638 89/<- *(eax+8) 1/r32/ecx # List-next + 9639 8b/-> *(edi+4) 1/r32/ecx + 9640 89/<- *(eax+0xc) 1/r32/ecx # List-next + 9641 # out = list + 9642 8b/-> *(ebp+0x14) 1/r32/ecx + 9643 89/<- *edi 1/r32/ecx + 9644 8b/-> *(ebp+0x18) 1/r32/ecx + 9645 89/<- *(edi+4) 1/r32/ecx + 9646 $append-list:end: + 9647 # . restore registers + 9648 5f/pop-to-edi + 9649 59/pop-to-ecx + 9650 58/pop-to-eax + 9651 # . epilogue + 9652 89/<- %esp 5/r32/ebp + 9653 5d/pop-to-ebp + 9654 c3/return + 9655 + 9656 append-stmt-var: # ad: (addr allocation-descriptor), v: (handle var), vars: (handle stmt-var), is-deref?: boolean, out: (addr handle stmt-var) + 9657 # . prologue + 9658 55/push-ebp + 9659 89/<- %ebp 4/r32/esp + 9660 # . save registers + 9661 50/push-eax + 9662 51/push-ecx + 9663 57/push-edi + 9664 # edi = out + 9665 8b/-> *(ebp+0x20) 7/r32/edi + 9666 # out = new stmt-var + 9667 (allocate *(ebp+8) *Stmt-var-size %edi) + 9668 # var out-addr/ecx: (addr stmt-var) = lookup(*out) + 9669 (lookup *edi *(edi+4)) # => eax + 9670 89/<- %ecx 0/r32/eax + 9671 # out-addr->value = v + 9672 8b/-> *(ebp+0xc) 0/r32/eax + 9673 89/<- *ecx 0/r32/eax # Stmt-var-value + 9674 8b/-> *(ebp+0x10) 0/r32/eax + 9675 89/<- *(ecx+4) 0/r32/eax # Stmt-var-value + 9676 # out-addr->is-deref? = is-deref? + 9677 8b/-> *(ebp+0x1c) 0/r32/eax + 9678 89/<- *(ecx+0x10) 0/r32/eax # Stmt-var-is-deref + 9679 # if (vars == null) return result + 9680 81 7/subop/compare *(ebp+0x14) 0/imm32/null + 9681 74/jump-if-= $append-stmt-var:end/disp8 + 9682 # otherwise append + 9683 # var curr/eax: (addr stmt-var) = lookup(vars) + 9684 (lookup *(ebp+0x14) *(ebp+0x18)) # => eax + 9685 # while (curr->next != null) curr = curr->next + 9686 { + 9687 81 7/subop/compare *(eax+8) 0/imm32 # Stmt-var-next + 9688 74/jump-if-= break/disp8 + 9689 # curr = lookup(curr->next) + 9690 (lookup *(eax+8) *(eax+0xc)) # Stmt-var-next, Stmt-var-next => eax + 9691 # + 9692 eb/jump loop/disp8 + 9693 } + 9694 # curr->next = out + 9695 8b/-> *edi 1/r32/ecx + 9696 89/<- *(eax+8) 1/r32/ecx # Stmt-var-next + 9697 8b/-> *(edi+4) 1/r32/ecx + 9698 89/<- *(eax+0xc) 1/r32/ecx # Stmt-var-next + 9699 # out = vars + 9700 8b/-> *(ebp+0x14) 1/r32/ecx + 9701 89/<- *edi 1/r32/ecx + 9702 8b/-> *(ebp+0x18) 1/r32/ecx + 9703 89/<- *(edi+4) 1/r32/ecx + 9704 $append-stmt-var:end: + 9705 # . restore registers + 9706 5f/pop-to-edi + 9707 59/pop-to-ecx + 9708 58/pop-to-eax + 9709 # . epilogue + 9710 89/<- %esp 5/r32/ebp + 9711 5d/pop-to-ebp + 9712 c3/return + 9713 + 9714 append-to-block: # ad: (addr allocation-descriptor), block: (addr block), x: (handle stmt) + 9715 # . prologue + 9716 55/push-ebp + 9717 89/<- %ebp 4/r32/esp + 9718 # . save registers + 9719 50/push-eax + 9720 56/push-esi + 9721 # esi = block + 9722 8b/-> *(ebp+0xc) 6/r32/esi + 9723 # block->stmts = append(x, block->stmts) + 9724 8d/copy-address *(esi+4) 0/r32/eax # Block-stmts + 9725 (append-list *(ebp+8) *(ebp+0x10) *(ebp+0x14) *(esi+4) *(esi+8) %eax) # ad, x, x, Block-stmts, Block-stmts + 9726 $append-to-block:end: + 9727 # . restore registers + 9728 5e/pop-to-esi + 9729 58/pop-to-eax + 9730 # . epilogue + 9731 89/<- %esp 5/r32/ebp + 9732 5d/pop-to-ebp + 9733 c3/return + 9734 + 9735 ## Parsing types + 9736 # We need to create metadata on user-defined types, and we need to use this + 9737 # metadata as we parse instructions. + 9738 # However, we also want to allow types to be used before their definitions. + 9739 # This means we can't ever assume any type data structures exist. + 9740 + 9741 lookup-or-create-constant: # container: (addr stmt-var), field-name: (addr slice), out: (addr handle var) + 9742 # . prologue + 9743 55/push-ebp + 9744 89/<- %ebp 4/r32/esp + 9745 # . save registers + 9746 50/push-eax + 9747 56/push-esi + 9748 # var container-type/esi: type-id + 9749 (container-type *(ebp+8)) # => eax + 9750 89/<- %esi 0/r32/eax + 9751 # var tmp/eax: (handle typeinfo) = find-or-create-typeinfo(container-type) + 9752 68/push 0/imm32 + 9753 68/push 0/imm32 + 9754 89/<- %eax 4/r32/esp + 9755 (find-or-create-typeinfo %esi %eax) + 9756 # var tmp-addr/eax: (addr typeinfo) = lookup(tmp) + 9757 (lookup *eax *(eax+4)) # => eax + 9758 # result = find-or-create-typeinfo-output-var(typeinfo, field-name) + 9759 #? (write-buffered Stderr "constant: ") + 9760 #? (write-slice-buffered Stderr *(ebp+0xc)) + 9761 #? (write-buffered Stderr Newline) + 9762 #? (flush Stderr) + 9763 (find-or-create-typeinfo-output-var %eax *(ebp+0xc) *(ebp+0x10)) + 9764 #? 8b/-> *(ebp+0x10) 0/r32/eax + 9765 #? (write-buffered Stderr "@") + 9766 #? (lookup *eax *(eax+4)) + 9767 #? (write-int32-hex-buffered Stderr %eax) + 9768 #? (lookup *eax *(eax+4)) + 9769 #? (write-buffered Stderr %eax) + 9770 #? (write-buffered Stderr Newline) + 9771 #? (flush Stderr) + 9772 #? (write-buffered Stderr "offset: ") + 9773 #? 8b/-> *(eax+0x14) 0/r32/eax + 9774 #? (write-int32-hex-buffered Stderr %eax) + 9775 #? (write-buffered Stderr Newline) + 9776 #? (flush Stderr) + 9777 $lookup-or-create-constant:end: + 9778 # . reclaim locals + 9779 81 0/subop/add %esp 8/imm32 + 9780 # . restore registers + 9781 5e/pop-to-esi + 9782 58/pop-to-eax + 9783 # . epilogue + 9784 89/<- %esp 5/r32/ebp + 9785 5d/pop-to-ebp + 9786 c3/return + 9787 + 9788 # if addr var: + 9789 # container->var->type->right->left->value + 9790 # otherwise + 9791 # container->var->type->value + 9792 container-type: # container: (addr stmt-var) -> result/eax: type-id + 9793 # . prologue + 9794 55/push-ebp + 9795 89/<- %ebp 4/r32/esp + 9796 # + 9797 8b/-> *(ebp+8) 0/r32/eax + 9798 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax + 9799 (lookup *(eax+8) *(eax+0xc)) # Var-type Var-type => eax + 9800 { + 9801 81 7/subop/compare *(eax+8) 0/imm32 # Type-tree-right + 9802 74/jump-if-= break/disp8 + 9803 (lookup *(eax+0xc) *(eax+0x10)) # Type-tree-right Type-tree-right => eax + 9804 (lookup *(eax+4) *(eax+8)) # Type-tree-left Type-tree-left => eax + 9805 } + 9806 8b/-> *(eax+4) 0/r32/eax # Type-tree-value + 9807 $container-type:end: + 9808 # . epilogue + 9809 89/<- %esp 5/r32/ebp + 9810 5d/pop-to-ebp + 9811 c3/return + 9812 + 9813 is-container?: # t: type-id -> result/eax: boolean + 9814 # . prologue + 9815 55/push-ebp + 9816 89/<- %ebp 4/r32/esp + 9817 # + 9818 8b/-> *(ebp+8) 0/r32/eax + 9819 c1/shift 4/subop/left %eax 2/imm8 + 9820 3b/compare 0/r32/eax *Primitive-type-ids + 9821 0f 9d/set-if->= %al + 9822 81 4/subop/and %eax 0xff/imm32 + 9823 $is-container?:end: + 9824 # . epilogue + 9825 89/<- %esp 5/r32/ebp + 9826 5d/pop-to-ebp + 9827 c3/return + 9828 + 9829 find-or-create-typeinfo: # t: type-id, out: (addr handle typeinfo) + 9830 # . prologue + 9831 55/push-ebp + 9832 89/<- %ebp 4/r32/esp + 9833 # . save registers + 9834 50/push-eax + 9835 51/push-ecx + 9836 52/push-edx + 9837 57/push-edi + 9838 # edi = out + 9839 8b/-> *(ebp+0xc) 7/r32/edi + 9840 # var fields/ecx: (handle table (handle array byte) (handle typeinfo-entry)) + 9841 68/push 0/imm32 + 9842 68/push 0/imm32 + 9843 89/<- %ecx 4/r32/esp + 9844 # find-typeinfo(t, out) + 9845 (find-typeinfo *(ebp+8) %edi) + 9846 { + 9847 # if (*out != 0) break + 9848 81 7/subop/compare *edi 0/imm32 + 9849 0f 85/jump-if-!= break/disp32 + 9850 $find-or-create-typeinfo:create: + 9851 # *out = allocate + 9852 (allocate Heap *Typeinfo-size %edi) + 9853 # var tmp/eax: (addr typeinfo) = lookup(*out) + 9854 (lookup *edi *(edi+4)) # => eax + 9855 #? (write-buffered Stderr "created typeinfo at ") + 9856 #? (write-int32-hex-buffered Stderr %eax) + 9857 #? (write-buffered Stderr " for type-id ") + 9858 #? (write-int32-hex-buffered Stderr *(ebp+8)) + 9859 #? (write-buffered Stderr Newline) + 9860 #? (flush Stderr) + 9861 # tmp->id = t + 9862 8b/-> *(ebp+8) 2/r32/edx + 9863 89/<- *eax 2/r32/edx # Typeinfo-id + 9864 # tmp->fields = new table + 9865 # . fields = new table + 9866 (new-stream Heap 0x40 *Typeinfo-fields-row-size %ecx) + 9867 # . tmp->fields = fields + 9868 8b/-> *ecx 2/r32/edx + 9869 89/<- *(eax+4) 2/r32/edx # Typeinfo-fields + 9870 8b/-> *(ecx+4) 2/r32/edx + 9871 89/<- *(eax+8) 2/r32/edx # Typeinfo-fields + 9872 # tmp->next = Program->types + 9873 8b/-> *_Program-types 1/r32/ecx + 9874 89/<- *(eax+0x10) 1/r32/ecx # Typeinfo-next + 9875 8b/-> *_Program-types->payload 1/r32/ecx + 9876 89/<- *(eax+0x14) 1/r32/ecx # Typeinfo-next + 9877 # Program->types = out + 9878 8b/-> *edi 1/r32/ecx + 9879 89/<- *_Program-types 1/r32/ecx + 9880 8b/-> *(edi+4) 1/r32/ecx + 9881 89/<- *_Program-types->payload 1/r32/ecx + 9882 } + 9883 $find-or-create-typeinfo:end: + 9884 # . reclaim locals + 9885 81 0/subop/add %esp 8/imm32 + 9886 # . restore registers + 9887 5f/pop-to-edi + 9888 5a/pop-to-edx + 9889 59/pop-to-ecx + 9890 58/pop-to-eax + 9891 # . epilogue + 9892 89/<- %esp 5/r32/ebp + 9893 5d/pop-to-ebp + 9894 c3/return + 9895 + 9896 find-typeinfo: # t: type-id, out: (addr handle typeinfo) + 9897 # . prologue + 9898 55/push-ebp + 9899 89/<- %ebp 4/r32/esp + 9900 # . save registers + 9901 50/push-eax + 9902 51/push-ecx + 9903 52/push-edx + 9904 57/push-edi + 9905 # ecx = t + 9906 8b/-> *(ebp+8) 1/r32/ecx + 9907 # edi = out + 9908 8b/-> *(ebp+0xc) 7/r32/edi + 9909 # *out = Program->types + 9910 8b/-> *_Program-types 0/r32/eax + 9911 89/<- *edi 0/r32/eax + 9912 8b/-> *_Program-types->payload 0/r32/eax + 9913 89/<- *(edi+4) 0/r32/eax + 9914 { + 9915 $find-typeinfo:loop: + 9916 # if (*out == 0) break + 9917 81 7/subop/compare *edi 0/imm32 + 9918 74/jump-if-= break/disp8 + 9919 $find-typeinfo:check: + 9920 # var tmp/eax: (addr typeinfo) = lookup(*out) + 9921 (lookup *edi *(edi+4)) # => eax + 9922 # if (tmp->id == t) break + 9923 39/compare *eax 1/r32/ecx # Typeinfo-id + 9924 74/jump-if-= break/disp8 + 9925 $find-typeinfo:continue: + 9926 # *out = tmp->next + 9927 8b/-> *(eax+0x10) 2/r32/edx # Typeinfo-next + 9928 89/<- *edi 2/r32/edx + 9929 8b/-> *(eax+0x14) 2/r32/edx # Typeinfo-next + 9930 89/<- *(edi+4) 2/r32/edx + 9931 # + 9932 eb/jump loop/disp8 + 9933 } + 9934 $find-typeinfo:end: + 9935 # . restore registers + 9936 5f/pop-to-edi + 9937 5a/pop-to-edx + 9938 59/pop-to-ecx + 9939 58/pop-to-eax + 9940 # . epilogue + 9941 89/<- %esp 5/r32/ebp + 9942 5d/pop-to-ebp + 9943 c3/return 9944 - 9945 # Initially, all user-defined types have their sizes set to -2 (invalid) - 9946 populate-mu-type-sizes: # err: (addr buffered-file), ed: (addr exit-descriptor) - 9947 # . prologue - 9948 55/push-ebp - 9949 89/<- %ebp 4/r32/esp - 9950 $populate-mu-type-sizes:total-sizes: - 9951 # var curr/eax: (addr typeinfo) = lookup(Program->types) - 9952 (lookup *_Program-types *_Program-types->payload) # => eax - 9953 { - 9954 # if (curr == null) break - 9955 3d/compare-eax-and 0/imm32/null - 9956 74/jump-if-= break/disp8 - 9957 (populate-mu-type-sizes-in-type %eax *(ebp+8) *(ebp+0xc)) - 9958 # curr = lookup(curr->next) - 9959 (lookup *(eax+0x10) *(eax+0x14)) # Typeinfo-next Typeinfo-next => eax - 9960 eb/jump loop/disp8 - 9961 } - 9962 $populate-mu-type-sizes:offsets: - 9963 # curr = *Program->types - 9964 (lookup *_Program-types *_Program-types->payload) # => eax - 9965 { - 9966 # if (curr == null) break - 9967 3d/compare-eax-and 0/imm32/null - 9968 74/jump-if-= break/disp8 - 9969 (populate-mu-type-offsets %eax *(ebp+8) *(ebp+0xc)) - 9970 # curr = curr->next - 9971 (lookup *(eax+0x10) *(eax+0x14)) # Typeinfo-next Typeinfo-next => eax - 9972 eb/jump loop/disp8 - 9973 } - 9974 $populate-mu-type-sizes:end: - 9975 # . epilogue - 9976 89/<- %esp 5/r32/ebp - 9977 5d/pop-to-ebp - 9978 c3/return - 9979 - 9980 # compute sizes of all fields, recursing as necessary - 9981 # sum up all their sizes to arrive at total size - 9982 # fields may be out of order, but that doesn't affect the answer - 9983 populate-mu-type-sizes-in-type: # T: (addr typeinfo), err: (addr buffered-file), ed: (addr exit-descriptor) - 9984 # . prologue - 9985 55/push-ebp - 9986 89/<- %ebp 4/r32/esp - 9987 # . save registers - 9988 50/push-eax - 9989 51/push-ecx - 9990 52/push-edx - 9991 56/push-esi - 9992 57/push-edi - 9993 # esi = T - 9994 8b/-> *(ebp+8) 6/r32/esi - 9995 # if T is already computed, return - 9996 81 7/subop/compare *(esi+0xc) 0/imm32 # Typeinfo-total-size-in-bytes - 9997 0f 8d/jump-if->= $populate-mu-type-sizes-in-type:end/disp32 - 9998 # if T is being computed, abort - 9999 81 7/subop/compare *(esi+0xc) -1/imm32/being-computed # Typeinfo-total-size-in-bytes -10000 0f 84/jump-if-= $populate-mu-type-sizes-in-type:abort/disp32 -10001 # tag T (-2 to -1) to avoid infinite recursion -10002 c7 0/subop/copy *(esi+0xc) -1/imm32/being-computed # Typeinfo-total-size-in-bytes -10003 # var total-size/edi: int = 0 -10004 bf/copy-to-edi 0/imm32 -10005 # - for every field, if it's a user-defined type, compute its size -10006 # var table/ecx: (addr table (handle array byte) (handle typeinfo-entry)) = lookup(T->fields) -10007 (lookup *(esi+4) *(esi+8)) # Typeinfo-fields Typeinfo-fields => eax -10008 89/<- %ecx 0/r32/eax -10009 # var table-size/edx: int = table->write -10010 8b/-> *ecx 2/r32/edx # stream-write -10011 # var curr/ecx: (addr table_row) = table->data -10012 8d/copy-address *(ecx+0xc) 1/r32/ecx -10013 # var max/edx: (addr table_row) = table->data + table->write -10014 8d/copy-address *(ecx+edx) 2/r32/edx -10015 { -10016 $populate-mu-type-sizes-in-type:loop: -10017 # if (curr >= max) break -10018 39/compare %ecx 2/r32/edx -10019 73/jump-if-addr>= break/disp8 -10020 # var t/eax: (addr typeinfo-entry) = lookup(curr->value) -10021 (lookup *(ecx+8) *(ecx+0xc)) # => eax -10022 # if (t->input-var == 0) silently ignore it; we'll emit a nice error message while type-checking -10023 81 7/subop/compare *eax 0/imm32 # Typeinfo-entry-input-var -10024 74/jump-if-= $populate-mu-type-sizes-in-type:end/disp8 -10025 # compute size of t->input-var -10026 (lookup *eax *(eax+4)) # Typeinfo-entry-input-var Typeinfo-entry-input-var => eax -10027 (compute-size-of-var %eax) # => eax -10028 # result += eax -10029 01/add-to %edi 0/r32/eax -10030 # curr += row-size -10031 81 0/subop/add %ecx 0x10/imm32 # Typeinfo-fields-row-size -10032 # -10033 eb/jump loop/disp8 -10034 } -10035 # - save result -10036 89/<- *(esi+0xc) 7/r32/edi # Typeinfo-total-size-in-bytes -10037 $populate-mu-type-sizes-in-type:end: -10038 # . restore registers -10039 5f/pop-to-edi -10040 5e/pop-to-esi -10041 5a/pop-to-edx -10042 59/pop-to-ecx -10043 58/pop-to-eax -10044 # . epilogue -10045 89/<- %esp 5/r32/ebp -10046 5d/pop-to-ebp -10047 c3/return -10048 -10049 $populate-mu-type-sizes-in-type:abort: -10050 (write-buffered *(ebp+0xc) "cycle in type definitions\n") -10051 (flush *(ebp+0xc)) -10052 (stop *(ebp+0x10) 1) -10053 # never gets here -10054 -10055 # Analogous to size-of, except we need to compute what size-of can just read -10056 # off the right data structures. -10057 compute-size-of-var: # in: (addr var) -> result/eax: int -10058 # . prologue -10059 55/push-ebp -10060 89/<- %ebp 4/r32/esp -10061 # . push registers -10062 51/push-ecx -10063 # var t/ecx: (addr tree type-id) = lookup(v->type) -10064 8b/-> *(ebp+8) 1/r32/ecx -10065 (lookup *(ecx+8) *(ecx+0xc)) # Var-type Var-type => eax -10066 89/<- %ecx 0/r32/eax -10067 # if (t->is-atom == false) t = lookup(t->left) -10068 { -10069 81 7/subop/compare *ecx 0/imm32/false # Tree-is-atom -10070 75/jump-if-!= break/disp8 -10071 (lookup *(ecx+4) *(ecx+8)) # Tree-left Tree-left => eax -10072 89/<- %ecx 0/r32/eax -10073 } -10074 # TODO: ensure t is an atom -10075 (compute-size-of-type-id *(ecx+4)) # Tree-value => eax -10076 $compute-size-of-var:end: -10077 # . restore registers -10078 59/pop-to-ecx -10079 # . epilogue -10080 89/<- %esp 5/r32/ebp -10081 5d/pop-to-ebp -10082 c3/return -10083 -10084 compute-size-of-type-id: # t: type-id -> result/eax: int -10085 # . prologue -10086 55/push-ebp -10087 89/<- %ebp 4/r32/esp -10088 # . save registers -10089 51/push-ecx -10090 # var out/ecx: (handle typeinfo) -10091 68/push 0/imm32 + 9945 find-or-create-typeinfo-output-var: # T: (addr typeinfo), f: (addr slice), out: (addr handle var) + 9946 # . prologue + 9947 55/push-ebp + 9948 89/<- %ebp 4/r32/esp + 9949 # . save registers + 9950 50/push-eax + 9951 52/push-edx + 9952 57/push-edi + 9953 # var dest/edi: (handle typeinfo-entry) + 9954 68/push 0/imm32 + 9955 68/push 0/imm32 + 9956 89/<- %edi 4/r32/esp + 9957 # find-or-create-typeinfo-fields(T, f, dest) + 9958 (find-or-create-typeinfo-fields *(ebp+8) *(ebp+0xc) %edi) + 9959 # var dest-addr/edi: (addr typeinfo-entry) = lookup(dest) + 9960 (lookup *edi *(edi+4)) # => eax + 9961 89/<- %edi 0/r32/eax + 9962 # if dest-addr->output-var doesn't exist, create it + 9963 { + 9964 81 7/subop/compare *(edi+0xc) 0/imm32 # Typeinfo-entry-output-var + 9965 0f 85/jump-if-!= break/disp32 + 9966 # dest-addr->output-var = new var(dummy name, type, -1 offset) + 9967 # . var name/eax: (handle array byte) = "field" + 9968 68/push 0/imm32 + 9969 68/push 0/imm32 + 9970 89/<- %eax 4/r32/esp + 9971 (slice-to-string Heap *(ebp+0xc) %eax) + 9972 # . new var + 9973 8d/copy-address *(edi+0xc) 2/r32/edx + 9974 (new-var Heap *eax *(eax+4) %edx) + 9975 # . reclaim name + 9976 81 0/subop/add %esp 8/imm32 + 9977 # var result/edx: (addr var) = lookup(dest-addr->output-var) + 9978 (lookup *(edi+0xc) *(edi+0x10)) # => eax + 9979 89/<- %edx 0/r32/eax + 9980 # result->type = new constant type + 9981 8d/copy-address *(edx+8) 0/r32/eax # Var-type + 9982 (allocate Heap *Type-tree-size %eax) + 9983 (lookup *(edx+8) *(edx+0xc)) # => eax + 9984 c7 0/subop/copy *eax 1/imm32/true # Type-tree-is-atom + 9985 c7 0/subop/copy *(eax+4) 6/imm32/constant # Type-tree-value + 9986 c7 0/subop/copy *(eax+8) 0/imm32 # Type-tree-left + 9987 c7 0/subop/copy *(eax+0xc) 0/imm32 # Type-tree-right + 9988 c7 0/subop/copy *(eax+0x10) 0/imm32 # Type-tree-right + 9989 # result->offset isn't filled out yet + 9990 c7 0/subop/copy *(edx+0x14) -1/imm32/uninitialized # Var-offset + 9991 } + 9992 # out = dest-addr->output-var + 9993 8b/-> *(ebp+0x10) 2/r32/edx + 9994 8b/-> *(edi+0xc) 0/r32/eax # Typeinfo-entry-output-var + 9995 89/<- *edx 0/r32/eax + 9996 8b/-> *(edi+0x10) 0/r32/eax # Typeinfo-entry-output-var + 9997 89/<- *(edx+4) 0/r32/eax + 9998 $find-or-create-typeinfo-output-var:end: + 9999 # . reclaim locals +10000 81 0/subop/add %esp 8/imm32 +10001 # . restore registers +10002 5f/pop-to-edi +10003 5a/pop-to-edx +10004 58/pop-to-eax +10005 # . epilogue +10006 89/<- %esp 5/r32/ebp +10007 5d/pop-to-ebp +10008 c3/return +10009 +10010 find-or-create-typeinfo-fields: # T: (addr typeinfo), f: (addr slice), out: (addr handle typeinfo-entry) +10011 # . prologue +10012 55/push-ebp +10013 89/<- %ebp 4/r32/esp +10014 # . save registers +10015 50/push-eax +10016 56/push-esi +10017 57/push-edi +10018 # eax = lookup(T->fields) +10019 8b/-> *(ebp+8) 0/r32/eax +10020 (lookup *(eax+4) *(eax+8)) # Typeinfo-fields Typeinfo-fields => eax +10021 # edi = out +10022 8b/-> *(ebp+0x10) 7/r32/edi +10023 # var src/esi: (addr handle typeinfo-entry) = get-or-insert-slice(T->fields, f) +10024 (get-or-insert-slice %eax *(ebp+0xc) *Typeinfo-fields-row-size Heap) # => eax +10025 89/<- %esi 0/r32/eax +10026 # if src doesn't exist, allocate it +10027 { +10028 81 7/subop/compare *esi 0/imm32 +10029 75/jump-if-!= break/disp8 +10030 (allocate Heap *Typeinfo-entry-size %esi) +10031 #? (write-buffered Stderr "handle at ") +10032 #? (write-int32-hex-buffered Stderr %esi) +10033 #? (write-buffered Stderr ": ") +10034 #? (write-int32-hex-buffered Stderr *esi) +10035 #? (write-buffered Stderr " ") +10036 #? (write-int32-hex-buffered Stderr *(esi+4)) +10037 #? (write-buffered Stderr Newline) +10038 #? (flush Stderr) +10039 #? (lookup *esi *(esi+4)) +10040 #? (write-buffered Stderr "created typeinfo fields at ") +10041 #? (write-int32-hex-buffered Stderr %esi) +10042 #? (write-buffered Stderr " for ") +10043 #? (write-int32-hex-buffered Stderr *(ebp+8)) +10044 #? (write-buffered Stderr Newline) +10045 #? (flush Stderr) +10046 } +10047 # *out = src +10048 # . *edi = *src +10049 8b/-> *esi 0/r32/eax +10050 89/<- *edi 0/r32/eax +10051 8b/-> *(esi+4) 0/r32/eax +10052 89/<- *(edi+4) 0/r32/eax +10053 $find-or-create-typeinfo-fields:end: +10054 # . restore registers +10055 5f/pop-to-edi +10056 5e/pop-to-esi +10057 58/pop-to-eax +10058 # . epilogue +10059 89/<- %esp 5/r32/ebp +10060 5d/pop-to-ebp +10061 c3/return +10062 +10063 populate-mu-type: # in: (addr stream byte), t: (addr typeinfo), err: (addr buffered-file), ed: (addr exit-descriptor) +10064 # pseudocode: +10065 # var line: (stream byte 512) +10066 # curr-index = 0 +10067 # while true +10068 # clear-stream(line) +10069 # read-line-buffered(in, line) +10070 # if line->write == 0 +10071 # abort +10072 # word-slice = next-mu-token(line) +10073 # if slice-empty?(word-slice) # end of line +10074 # continue +10075 # if slice-equal?(word-slice, "}") +10076 # break +10077 # var v: (handle var) = parse-var-with-type(word-slice, line) +10078 # var r: (handle typeinfo-fields) = find-or-create-typeinfo-fields(t, word-slice/v->name) +10079 # TODO: ensure that r->first is null +10080 # r->index = curr-index +10081 # curr-index++ +10082 # r->input-var = v +10083 # if r->output-var == 0 +10084 # r->output-var = new literal +10085 # TODO: ensure nothing else in line +10086 # t->total-size-in-bytes = -2 (not yet initialized) +10087 # +10088 # . prologue +10089 55/push-ebp +10090 89/<- %ebp 4/r32/esp +10091 # var curr-index: int at *(ebp-4) 10092 68/push 0/imm32 -10093 89/<- %ecx 4/r32/esp -10094 # eax = t -10095 8b/-> *(ebp+8) 0/r32/eax -10096 # if t is a literal, return 0 -10097 3d/compare-eax-and 0/imm32/literal -10098 0f 84/jump-if-= $compute-size-of-type-id:end/disp32 # eax changes type from type-id to int -10099 # if t is a byte, return 4 (because we don't really support non-multiples of 4) -10100 3d/compare-eax-and 8/imm32/byte -10101 { -10102 75/jump-if-!= break/disp8 -10103 b8/copy-to-eax 4/imm32 -10104 eb/jump $compute-size-of-type-id:end/disp8 -10105 } -10106 # if t is a handle, return 8 -10107 3d/compare-eax-and 4/imm32/handle -10108 { -10109 75/jump-if-!= break/disp8 -10110 b8/copy-to-eax 8/imm32 -10111 eb/jump $compute-size-of-type-id:end/disp8 # eax changes type from type-id to int -10112 } -10113 # if t is a user-defined type, compute its size -10114 # TODO: support non-atom type -10115 (find-typeinfo %eax %ecx) -10116 { -10117 81 7/subop/compare *ecx 0/imm32 -10118 74/jump-if-= break/disp8 -10119 $compute-size-of-type-id:user-defined: -10120 (populate-mu-type-sizes %eax) -10121 8b/-> *(eax+0xc) 0/r32/eax # Typeinfo-total-size-in-bytes -10122 eb/jump $compute-size-of-type-id:end/disp8 -10123 } -10124 # otherwise return the word size -10125 b8/copy-to-eax 4/imm32 -10126 $compute-size-of-type-id:end: -10127 # . reclaim locals -10128 81 0/subop/add %esp 8/imm32 -10129 # . restore registers -10130 59/pop-to-ecx -10131 # . epilogue -10132 89/<- %esp 5/r32/ebp -10133 5d/pop-to-ebp -10134 c3/return -10135 -10136 # at this point we have total sizes for all user-defined types -10137 # compute offsets for each element -10138 # complication: fields may be out of order -10139 populate-mu-type-offsets: # in: (addr typeinfo), err: (addr buffered-file), ed: (addr exit-descriptor) -10140 # . prologue -10141 55/push-ebp -10142 89/<- %ebp 4/r32/esp -10143 # . save registers -10144 50/push-eax -10145 51/push-ecx -10146 52/push-edx -10147 53/push-ebx -10148 56/push-esi -10149 57/push-edi -10150 #? (dump-typeinfos "aaa\n") -10151 # var curr-offset/edi: int = 0 -10152 bf/copy-to-edi 0/imm32 -10153 # var table/ecx: (addr table string_key (handle typeinfo-entry)) = lookup(in->fields) -10154 8b/-> *(ebp+8) 1/r32/ecx -10155 (lookup *(ecx+4) *(ecx+8)) # Typeinfo-fields Typeinfo-fields => eax -10156 89/<- %ecx 0/r32/eax -10157 # var num-elems/edx: int = table->write / Typeinfo-fields-row-size -10158 8b/-> *ecx 2/r32/edx # stream-write -10159 c1 5/subop/shift-right-logical %edx 4/imm8 -10160 # var i/ebx: int = 0 -10161 bb/copy-to-ebx 0/imm32 -10162 { -10163 $populate-mu-type-offsets:loop: -10164 39/compare %ebx 2/r32/edx -10165 0f 8d/jump-if->= break/disp32 -10166 #? (write-buffered Stderr "looking up index ") -10167 #? (write-int32-hex-buffered Stderr %ebx) -10168 #? (write-buffered Stderr " in ") -10169 #? (write-int32-hex-buffered Stderr *(ebp+8)) -10170 #? (write-buffered Stderr Newline) -10171 #? (flush Stderr) -10172 # var v/esi: (addr typeinfo-entry) -10173 (locate-typeinfo-entry-with-index %ecx %ebx *(ebp+0xc) *(ebp+0x10)) # => eax -10174 89/<- %esi 0/r32/eax -10175 # if v is null, silently move on; we'll emit a nice error message while type-checking -10176 81 7/subop/compare %esi 0/imm32 # Typeinfo-entry-input-var -10177 74/jump-if-= $populate-mu-type-offsets:end/disp8 -10178 # if (v->input-var == 0) silently ignore v; we'll emit a nice error message while type-checking -10179 81 7/subop/compare *esi 0/imm32 # Typeinfo-entry-input-var -10180 74/jump-if-= $populate-mu-type-offsets:end/disp8 -10181 # v->output-var->offset = curr-offset -10182 # . eax: (addr var) -10183 (lookup *(esi+0xc) *(esi+0x10)) # Typeinfo-entry-output-var Typeinfo-entry-output-var => eax -10184 89/<- *(eax+0x14) 7/r32/edi # Var-offset -10185 # curr-offset += size-of(v->input-var) -10186 (lookup *esi *(esi+4)) # Typeinfo-entry-input-var Typeinfo-entry-input-var => eax -10187 (size-of %eax) # => eax -10188 01/add-to %edi 0/r32/eax -10189 # ++i -10190 43/increment-ebx -10191 e9/jump loop/disp32 -10192 } -10193 $populate-mu-type-offsets:end: -10194 # . restore registers -10195 5f/pop-to-edi -10196 5e/pop-to-esi -10197 5b/pop-to-ebx -10198 5a/pop-to-edx -10199 59/pop-to-ecx -10200 58/pop-to-eax -10201 # . epilogue -10202 89/<- %esp 5/r32/ebp -10203 5d/pop-to-ebp -10204 c3/return -10205 -10206 locate-typeinfo-entry-with-index: # table: (addr table (handle array byte) (handle typeinfo-entry)), idx: int, err: (addr buffered-file), ed: (addr exit-descriptor) -> result/eax: (addr typeinfo-entry) -10207 # . prologue -10208 55/push-ebp -10209 89/<- %ebp 4/r32/esp -10210 # . save registers -10211 51/push-ecx -10212 52/push-edx -10213 53/push-ebx -10214 56/push-esi -10215 57/push-edi -10216 # esi = table -10217 8b/-> *(ebp+8) 6/r32/esi -10218 # var curr/ecx: (addr row (handle array byte) (handle typeinfo-entry)) = table->data -10219 8d/copy-address *(esi+0xc) 1/r32/ecx -10220 # var max/edx: (addr byte) = &table->data[table->write] -10221 8b/-> *esi 2/r32/edx -10222 8d/copy-address *(ecx+edx) 2/r32/edx -10223 { -10224 $locate-typeinfo-entry-with-index:loop: -10225 39/compare %ecx 2/r32/edx -10226 73/jump-if-addr>= break/disp8 -10227 # var v/eax: (addr typeinfo-entry) -10228 (lookup *(ecx+8) *(ecx+0xc)) # => eax -10229 # if (v->index == idx) return v -10230 8b/-> *(eax+8) 3/r32/ebx # Typeinfo-entry-index -10231 #? (write-buffered Stderr "comparing ") -10232 #? (write-int32-hex-buffered Stderr %ebx) -10233 #? (write-buffered Stderr " and ") -10234 #? (write-int32-hex-buffered Stderr *(ebp+0xc)) -10235 #? (write-buffered Stderr Newline) -10236 #? (flush Stderr) -10237 39/compare *(ebp+0xc) 3/r32/ebx -10238 74/jump-if-= $locate-typeinfo-entry-with-index:end/disp8 -10239 # curr += Typeinfo-entry-size -10240 81 0/subop/add %ecx 0x10/imm32 # Typeinfo-entry-size -10241 # -10242 eb/jump loop/disp8 -10243 } -10244 # return 0 -10245 b8/copy-to-eax 0/imm32 -10246 $locate-typeinfo-entry-with-index:end: -10247 #? (write-buffered Stderr "returning ") -10248 #? (write-int32-hex-buffered Stderr %eax) -10249 #? (write-buffered Stderr Newline) -10250 #? (flush Stderr) -10251 # . restore registers -10252 5f/pop-to-edi -10253 5e/pop-to-esi -10254 5b/pop-to-ebx -10255 5a/pop-to-edx -10256 59/pop-to-ecx -10257 # . epilogue -10258 89/<- %esp 5/r32/ebp -10259 5d/pop-to-ebp -10260 c3/return -10261 -10262 dump-typeinfos: # hdr: (addr array byte) -10263 # . prologue -10264 55/push-ebp -10265 89/<- %ebp 4/r32/esp -10266 # . save registers -10267 50/push-eax -10268 # -10269 (write-buffered Stderr *(ebp+8)) -10270 (flush Stderr) -10271 # var curr/eax: (addr typeinfo) = lookup(Program->types) -10272 (lookup *_Program-types *_Program-types->payload) # => eax -10273 { -10274 # if (curr == null) break -10275 3d/compare-eax-and 0/imm32 -10276 74/jump-if-= break/disp8 -10277 (write-buffered Stderr "---\n") -10278 (flush Stderr) -10279 (dump-typeinfo %eax) -10280 # curr = lookup(curr->next) -10281 (lookup *(eax+0x10) *(eax+0x14)) # Typeinfo-next Typeinfo-next => eax +10093 # . save registers +10094 50/push-eax +10095 51/push-ecx +10096 52/push-edx +10097 53/push-ebx +10098 56/push-esi +10099 57/push-edi +10100 # edi = t +10101 8b/-> *(ebp+0xc) 7/r32/edi +10102 # var line/ecx: (stream byte 512) +10103 81 5/subop/subtract %esp 0x200/imm32 +10104 68/push 0x200/imm32/size +10105 68/push 0/imm32/read +10106 68/push 0/imm32/write +10107 89/<- %ecx 4/r32/esp +10108 # var word-slice/edx: slice +10109 68/push 0/imm32/end +10110 68/push 0/imm32/start +10111 89/<- %edx 4/r32/esp +10112 # var v/esi: (handle var) +10113 68/push 0/imm32 +10114 68/push 0/imm32 +10115 89/<- %esi 4/r32/esp +10116 # var r/ebx: (handle typeinfo-entry) +10117 68/push 0/imm32 +10118 68/push 0/imm32 +10119 89/<- %ebx 4/r32/esp +10120 { +10121 $populate-mu-type:line-loop: +10122 (clear-stream %ecx) +10123 (read-line-buffered *(ebp+8) %ecx) +10124 # if (line->write == 0) abort +10125 81 7/subop/compare *ecx 0/imm32 +10126 0f 84/jump-if-= $populate-mu-type:abort/disp32 +10127 +-- 6 lines: #? # dump line ------------------------------------------------------------------------------------------------------------------------------------------------------ +10133 (next-mu-token %ecx %edx) +10134 # if slice-empty?(word-slice) continue +10135 (slice-empty? %edx) # => eax +10136 3d/compare-eax-and 0/imm32 +10137 0f 85/jump-if-!= loop/disp32 +10138 # if slice-equal?(word-slice, "}") break +10139 (slice-equal? %edx "}") +10140 3d/compare-eax-and 0/imm32 +10141 0f 85/jump-if-!= break/disp32 +10142 $populate-mu-type:parse-element: +10143 # v = parse-var-with-type(word-slice, first-line) +10144 # must do this first to strip the trailing ':' from word-slice before +10145 # using it in find-or-create-typeinfo-fields below +10146 # TODO: clean up that mutation in parse-var-with-type +10147 (parse-var-with-type %edx %ecx %esi *(ebp+0x10) *(ebp+0x14)) # => eax +10148 # var tmp/ecx +10149 51/push-ecx +10150 $populate-mu-type:create-typeinfo-fields: +10151 # var r/ebx: (handle typeinfo-entry) +10152 (find-or-create-typeinfo-fields %edi %edx %ebx) +10153 # r->index = curr-index +10154 (lookup *ebx *(ebx+4)) # => eax +10155 8b/-> *(ebp-4) 1/r32/ecx +10156 #? (write-buffered Stderr "saving index ") +10157 #? (write-int32-hex-buffered Stderr %ecx) +10158 #? (write-buffered Stderr " at ") +10159 #? (write-int32-hex-buffered Stderr %edi) +10160 #? (write-buffered Stderr Newline) +10161 #? (flush Stderr) +10162 89/<- *(eax+8) 1/r32/ecx # Typeinfo-entry-index +10163 # ++curr-index +10164 ff 0/subop/increment *(ebp-4) +10165 $populate-mu-type:set-input-type: +10166 # r->input-var = v +10167 8b/-> *esi 1/r32/ecx +10168 89/<- *eax 1/r32/ecx # Typeinfo-entry-input-var +10169 8b/-> *(esi+4) 1/r32/ecx +10170 89/<- *(eax+4) 1/r32/ecx # Typeinfo-entry-input-var +10171 59/pop-to-ecx +10172 { +10173 $populate-mu-type:create-output-type: +10174 # if (r->output-var == 0) create a new var with some placeholder data +10175 81 7/subop/compare *(eax+0xc) 0/imm32 # Typeinfo-entry-output-var +10176 75/jump-if-!= break/disp8 +10177 8d/copy-address *(eax+0xc) 0/r32/eax # Typeinfo-entry-output-var +10178 (new-literal Heap %edx %eax) +10179 } +10180 e9/jump loop/disp32 +10181 } +10182 $populate-mu-type:invalidate-total-size-in-bytes: +10183 # Offsets and total size may not be accurate here since we may not yet +10184 # have encountered the element types. +10185 # We'll recompute them separately after parsing the entire program. +10186 c7 0/subop/copy *(edi+0xc) -2/imm32/uninitialized # Typeinfo-total-size-in-bytes +10187 $populate-mu-type:end: +10188 # . reclaim locals +10189 81 0/subop/add %esp 0x224/imm32 +10190 # . restore registers +10191 5f/pop-to-edi +10192 5e/pop-to-esi +10193 5b/pop-to-ebx +10194 5a/pop-to-edx +10195 59/pop-to-ecx +10196 58/pop-to-eax +10197 # reclaim curr-index +10198 81 0/subop/add %esp 4/imm32 +10199 # . epilogue +10200 89/<- %esp 5/r32/ebp +10201 5d/pop-to-ebp +10202 c3/return +10203 +10204 $populate-mu-type:abort: +10205 # error("unexpected top-level command: " word-slice "\n") +10206 (write-buffered *(ebp+0x10) "incomplete type definition '") +10207 (type-name *edi) # Typeinfo-id => eax +10208 (write-buffered *(ebp+0x10) %eax) +10209 (write-buffered *(ebp+0x10) "\n") +10210 (flush *(ebp+0x10)) +10211 (stop *(ebp+0x14) 1) +10212 # never gets here +10213 +10214 type-name: # index: int -> result/eax: (addr array byte) +10215 # . prologue +10216 55/push-ebp +10217 89/<- %ebp 4/r32/esp +10218 # +10219 (index Type-id *(ebp+8)) +10220 $type-name:end: +10221 # . epilogue +10222 89/<- %esp 5/r32/ebp +10223 5d/pop-to-ebp +10224 c3/return +10225 +10226 index: # arr: (addr stream (handle array byte)), index: int -> result/eax: (addr array byte) +10227 # . prologue +10228 55/push-ebp +10229 89/<- %ebp 4/r32/esp +10230 # . save registers +10231 56/push-esi +10232 # TODO: bounds-check index +10233 # esi = arr +10234 8b/-> *(ebp+8) 6/r32/esi +10235 # eax = index +10236 8b/-> *(ebp+0xc) 0/r32/eax +10237 # eax = *(arr + 12 + index) +10238 8b/-> *(esi+eax+0xc) 0/r32/eax +10239 $index:end: +10240 # . restore registers +10241 5e/pop-to-esi +10242 # . epilogue +10243 89/<- %esp 5/r32/ebp +10244 5d/pop-to-ebp +10245 c3/return +10246 +10247 ####################################################### +10248 # Compute type sizes +10249 ####################################################### +10250 +10251 # Compute the sizes of all user-defined types. +10252 # We'll need the sizes of their elements, which may be other user-defined +10253 # types, which we will compute as needed. +10254 +10255 # Initially, all user-defined types have their sizes set to -2 (invalid) +10256 populate-mu-type-sizes: # err: (addr buffered-file), ed: (addr exit-descriptor) +10257 # . prologue +10258 55/push-ebp +10259 89/<- %ebp 4/r32/esp +10260 $populate-mu-type-sizes:total-sizes: +10261 # var curr/eax: (addr typeinfo) = lookup(Program->types) +10262 (lookup *_Program-types *_Program-types->payload) # => eax +10263 { +10264 # if (curr == null) break +10265 3d/compare-eax-and 0/imm32/null +10266 74/jump-if-= break/disp8 +10267 (populate-mu-type-sizes-in-type %eax *(ebp+8) *(ebp+0xc)) +10268 # curr = lookup(curr->next) +10269 (lookup *(eax+0x10) *(eax+0x14)) # Typeinfo-next Typeinfo-next => eax +10270 eb/jump loop/disp8 +10271 } +10272 $populate-mu-type-sizes:offsets: +10273 # curr = *Program->types +10274 (lookup *_Program-types *_Program-types->payload) # => eax +10275 { +10276 # if (curr == null) break +10277 3d/compare-eax-and 0/imm32/null +10278 74/jump-if-= break/disp8 +10279 (populate-mu-type-offsets %eax *(ebp+8) *(ebp+0xc)) +10280 # curr = curr->next +10281 (lookup *(eax+0x10) *(eax+0x14)) # Typeinfo-next Typeinfo-next => eax 10282 eb/jump loop/disp8 10283 } -10284 $dump-typeinfos:end: -10285 # . restore registers -10286 58/pop-to-eax -10287 # . epilogue -10288 89/<- %esp 5/r32/ebp -10289 5d/pop-to-ebp -10290 c3/return -10291 -10292 dump-typeinfo: # in: (addr typeinfo) -10293 # . prologue -10294 55/push-ebp -10295 89/<- %ebp 4/r32/esp -10296 # . save registers -10297 50/push-eax -10298 51/push-ecx -10299 52/push-edx -10300 53/push-ebx +10284 $populate-mu-type-sizes:end: +10285 # . epilogue +10286 89/<- %esp 5/r32/ebp +10287 5d/pop-to-ebp +10288 c3/return +10289 +10290 # compute sizes of all fields, recursing as necessary +10291 # sum up all their sizes to arrive at total size +10292 # fields may be out of order, but that doesn't affect the answer +10293 populate-mu-type-sizes-in-type: # T: (addr typeinfo), err: (addr buffered-file), ed: (addr exit-descriptor) +10294 # . prologue +10295 55/push-ebp +10296 89/<- %ebp 4/r32/esp +10297 # . save registers +10298 50/push-eax +10299 51/push-ecx +10300 52/push-edx 10301 56/push-esi 10302 57/push-edi -10303 # esi = in +10303 # esi = T 10304 8b/-> *(ebp+8) 6/r32/esi -10305 # var table/ecx: (addr table (handle array byte) (handle typeinfo-entry)) = lookup(T->fields) -10306 (lookup *(esi+4) *(esi+8)) # Typeinfo-fields Typeinfo-fields => eax -10307 89/<- %ecx 0/r32/eax -10308 (write-buffered Stderr "id:") -10309 (write-int32-hex-buffered Stderr *esi) -10310 (write-buffered Stderr "\n") -10311 (write-buffered Stderr "fields @ ") -10312 (write-int32-hex-buffered Stderr %ecx) -10313 (write-buffered Stderr Newline) -10314 (flush Stderr) -10315 (write-buffered Stderr " write: ") -10316 (write-int32-hex-buffered Stderr *ecx) -10317 (write-buffered Stderr Newline) -10318 (flush Stderr) -10319 (write-buffered Stderr " read: ") -10320 (write-int32-hex-buffered Stderr *(ecx+4)) -10321 (write-buffered Stderr Newline) -10322 (flush Stderr) -10323 (write-buffered Stderr " size: ") -10324 (write-int32-hex-buffered Stderr *(ecx+8)) -10325 (write-buffered Stderr Newline) -10326 (flush Stderr) -10327 # var table-size/edx: int = table->write -10328 8b/-> *ecx 2/r32/edx # stream-write -10329 # var curr/ecx: (addr table_row) = table->data -10330 8d/copy-address *(ecx+0xc) 1/r32/ecx -10331 # var max/edx: (addr table_row) = table->data + table->write -10332 8d/copy-address *(ecx+edx) 2/r32/edx -10333 { -10334 $dump-typeinfo:loop: -10335 # if (curr >= max) break -10336 39/compare %ecx 2/r32/edx -10337 0f 83/jump-if-addr>= break/disp32 -10338 (write-buffered Stderr " row:\n") -10339 (write-buffered Stderr " key: ") -10340 (write-int32-hex-buffered Stderr *ecx) -10341 (write-buffered Stderr ",") -10342 (write-int32-hex-buffered Stderr *(ecx+4)) -10343 (write-buffered Stderr " = '") -10344 (lookup *ecx *(ecx+4)) -10345 (write-buffered Stderr %eax) -10346 (write-buffered Stderr "' @ ") -10347 (write-int32-hex-buffered Stderr %eax) -10348 (write-buffered Stderr Newline) -10349 (flush Stderr) -10350 (write-buffered Stderr " value: ") -10351 (write-int32-hex-buffered Stderr *(ecx+8)) -10352 (write-buffered Stderr ",") -10353 (write-int32-hex-buffered Stderr *(ecx+0xc)) -10354 (write-buffered Stderr " = typeinfo-entry@") -10355 (lookup *(ecx+8) *(ecx+0xc)) -10356 (write-int32-hex-buffered Stderr %eax) -10357 (write-buffered Stderr Newline) -10358 (flush Stderr) -10359 (write-buffered Stderr " input var@") -10360 (dump-var 5 %eax) -10361 (lookup *(ecx+8) *(ecx+0xc)) -10362 (write-buffered Stderr " index: ") -10363 (write-int32-hex-buffered Stderr *(eax+8)) -10364 (write-buffered Stderr Newline) -10365 (flush Stderr) -10366 (write-buffered Stderr " output var@") -10367 8d/copy-address *(eax+0xc) 0/r32/eax # Typeinfo-entry-output-var -10368 (dump-var 5 %eax) -10369 (flush Stderr) -10370 # curr += row-size -10371 81 0/subop/add %ecx 0x10/imm32 # Typeinfo-fields-row-size -10372 # -10373 e9/jump loop/disp32 -10374 } -10375 $dump-typeinfo:end: -10376 # . restore registers -10377 5f/pop-to-edi -10378 5e/pop-to-esi -10379 5b/pop-to-ebx -10380 5a/pop-to-edx -10381 59/pop-to-ecx -10382 58/pop-to-eax -10383 # . epilogue -10384 89/<- %esp 5/r32/ebp -10385 5d/pop-to-ebp -10386 c3/return -10387 -10388 dump-var: # indent: int, v: (addr handle var) -10389 # . prologue -10390 55/push-ebp -10391 89/<- %ebp 4/r32/esp -10392 # . save registers -10393 50/push-eax -10394 53/push-ebx -10395 # eax = v -10396 8b/-> *(ebp+0xc) 0/r32/eax -10397 # -10398 (write-int32-hex-buffered Stderr *eax) -10399 (write-buffered Stderr ",") -10400 (write-int32-hex-buffered Stderr *(eax+4)) -10401 (write-buffered Stderr "->") -10402 (lookup *eax *(eax+4)) -10403 (write-int32-hex-buffered Stderr %eax) -10404 (write-buffered Stderr Newline) -10405 (flush Stderr) -10406 { -10407 3d/compare-eax-and 0/imm32 -10408 0f 84/jump-if-= break/disp32 -10409 (emit-indent Stderr *(ebp+8)) -10410 (write-buffered Stderr "name: ") -10411 89/<- %ebx 0/r32/eax -10412 (write-int32-hex-buffered Stderr *ebx) # Var-name -10413 (write-buffered Stderr ",") -10414 (write-int32-hex-buffered Stderr *(ebx+4)) # Var-name -10415 (write-buffered Stderr "->") -10416 (lookup *ebx *(ebx+4)) # Var-name -10417 (write-int32-hex-buffered Stderr %eax) -10418 { -10419 3d/compare-eax-and 0/imm32 -10420 74/jump-if-= break/disp8 -10421 (write-buffered Stderr Space) -10422 (write-buffered Stderr %eax) -10423 } -10424 (write-buffered Stderr Newline) -10425 (flush Stderr) -10426 (emit-indent Stderr *(ebp+8)) -10427 (write-buffered Stderr "block depth: ") -10428 (write-int32-hex-buffered Stderr *(ebx+0x10)) # Var-block-depth -10429 (write-buffered Stderr Newline) -10430 (flush Stderr) -10431 (emit-indent Stderr *(ebp+8)) -10432 (write-buffered Stderr "stack offset: ") -10433 (write-int32-hex-buffered Stderr *(ebx+0x14)) # Var-offset -10434 (write-buffered Stderr Newline) -10435 (flush Stderr) -10436 (emit-indent Stderr *(ebp+8)) -10437 (write-buffered Stderr "reg: ") -10438 (write-int32-hex-buffered Stderr *(ebx+0x18)) # Var-register -10439 (write-buffered Stderr ",") -10440 (write-int32-hex-buffered Stderr *(ebx+0x1c)) # Var-register -10441 (write-buffered Stderr "->") -10442 (flush Stderr) -10443 (lookup *(ebx+0x18) *(ebx+0x1c)) # Var-register -10444 (write-int32-hex-buffered Stderr %eax) -10445 { -10446 3d/compare-eax-and 0/imm32 -10447 74/jump-if-= break/disp8 -10448 (write-buffered Stderr Space) -10449 (write-buffered Stderr %eax) -10450 } -10451 (write-buffered Stderr Newline) -10452 (flush Stderr) -10453 } -10454 $dump-var:end: -10455 # . restore registers -10456 5b/pop-to-ebx -10457 58/pop-to-eax -10458 # . epilogue -10459 89/<- %esp 5/r32/ebp -10460 5d/pop-to-ebp -10461 c3/return -10462 -10463 ####################################################### -10464 # Type-checking -10465 ####################################################### -10466 -10467 check-mu-types: # err: (addr buffered-file), ed: (addr exit-descriptor) -10468 # . prologue -10469 55/push-ebp -10470 89/<- %ebp 4/r32/esp -10471 # . save registers -10472 50/push-eax -10473 # var curr/eax: (addr function) = *Program->functions -10474 (lookup *_Program-functions *_Program-functions->payload) # => eax -10475 { -10476 $check-mu-types:loop: -10477 # if (curr == null) break -10478 3d/compare-eax-and 0/imm32 -10479 0f 84/jump-if-= break/disp32 -10480 (check-mu-function %eax *(ebp+8) *(ebp+0xc)) -10481 # curr = lookup(curr->next) -10482 (lookup *(eax+0x20) *(eax+0x24)) # Function-next Function-next => eax -10483 e9/jump loop/disp32 -10484 } -10485 $check-mu-types:end: -10486 # . restore registers -10487 58/pop-to-eax -10488 # . epilogue -10489 89/<- %esp 5/r32/ebp -10490 5d/pop-to-ebp -10491 c3/return -10492 -10493 check-mu-function: # fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) -10494 # . prologue -10495 55/push-ebp -10496 89/<- %ebp 4/r32/esp -10497 # . save registers -10498 50/push-eax -10499 # eax = f -10500 8b/-> *(ebp+8) 0/r32/eax -10501 # TODO: anything to check in header? -10502 # var body/eax: (addr block) = lookup(f->body) -10503 (lookup *(eax+0x18) *(eax+0x1c)) # Function-body Function-body => eax -10504 (check-mu-block %eax *(ebp+8) *(ebp+0xc) *(ebp+0x10)) -10505 $check-mu-function:end: -10506 # . restore registers -10507 58/pop-to-eax -10508 # . epilogue -10509 89/<- %esp 5/r32/ebp -10510 5d/pop-to-ebp -10511 c3/return -10512 -10513 check-mu-block: # block: (addr block), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) -10514 # . prologue -10515 55/push-ebp -10516 89/<- %ebp 4/r32/esp -10517 # . save registers -10518 50/push-eax -10519 # eax = block -10520 8b/-> *(ebp+8) 0/r32/eax -10521 # var stmts/eax: (addr list stmt) = lookup(block->statements) -10522 (lookup *(eax+4) *(eax+8)) # Block-stmts Block-stmts => eax -10523 # -10524 { -10525 $check-mu-block:check-empty: -10526 3d/compare-eax-and 0/imm32 -10527 0f 84/jump-if-= break/disp32 -10528 # emit block->statements -10529 (check-mu-stmt-list %eax *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) -10530 } -10531 $check-mu-block:end: -10532 # . restore registers -10533 58/pop-to-eax -10534 # . epilogue -10535 89/<- %esp 5/r32/ebp -10536 5d/pop-to-ebp -10537 c3/return -10538 -10539 check-mu-stmt-list: # stmts: (addr list stmt), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) -10540 # . prologue -10541 55/push-ebp -10542 89/<- %ebp 4/r32/esp -10543 # . save registers -10544 50/push-eax -10545 56/push-esi -10546 # esi = stmts -10547 8b/-> *(ebp+8) 6/r32/esi -10548 { -10549 $check-mu-stmt-list:loop: -10550 81 7/subop/compare %esi 0/imm32 -10551 0f 84/jump-if-= break/disp32 -10552 # var curr-stmt/eax: (addr stmt) = lookup(stmts->value) -10553 (lookup *esi *(esi+4)) # List-value List-value => eax -10554 { -10555 $check-mu-stmt-list:check-for-block: -10556 81 7/subop/compare *eax 0/imm32/block # Stmt-tag -10557 75/jump-if-!= break/disp8 -10558 $check-mu-stmt-list:block: -10559 (check-mu-block %eax *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) -10560 eb/jump $check-mu-stmt-list:continue/disp8 -10561 } -10562 { -10563 $check-mu-stmt-list:check-for-stmt1: -10564 81 7/subop/compare *eax 1/imm32/stmt1 # Stmt-tag -10565 0f 85/jump-if-!= break/disp32 -10566 $check-mu-stmt-list:stmt1: -10567 (check-mu-stmt %eax *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) -10568 eb/jump $check-mu-stmt-list:continue/disp8 -10569 } -10570 { -10571 $check-mu-stmt-list:check-for-reg-var-def: -10572 81 7/subop/compare *eax 3/imm32/reg-var-def # Stmt-tag -10573 0f 85/jump-if-!= break/disp32 -10574 $check-mu-stmt-list:reg-var-def: -10575 (check-mu-stmt %eax *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) -10576 eb/jump $check-mu-stmt-list:continue/disp8 -10577 } -10578 $check-mu-stmt-list:continue: -10579 # TODO: raise an error on unrecognized Stmt-tag -10580 (lookup *(esi+8) *(esi+0xc)) # List-next List-next => eax -10581 89/<- %esi 0/r32/eax -10582 e9/jump loop/disp32 -10583 } -10584 $check-mu-stmt-list:end: -10585 # . restore registers -10586 5e/pop-to-esi -10587 58/pop-to-eax -10588 # . epilogue -10589 89/<- %esp 5/r32/ebp -10590 5d/pop-to-ebp -10591 c3/return -10592 -10593 check-mu-stmt: # stmt: (addr stmt), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) -10594 # . prologue -10595 55/push-ebp -10596 89/<- %ebp 4/r32/esp -10597 # . save registers -10598 50/push-eax -10599 # if stmt's operation matches a primitive, check against it -10600 (has-primitive-name? *(ebp+8)) # => eax -10601 3d/compare-eax-and 0/imm32/false -10602 { -10603 74/jump-if-= break/disp8 -10604 (check-mu-primitive *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) -10605 eb/jump $check-mu-stmt:end/disp8 -10606 } -10607 # otherwise find a function to check against -10608 { -10609 # var f/edi: (addr function) = lookup(*Program->functions) -10610 (lookup *_Program-functions *_Program-functions->payload) # => eax -10611 (find-matching-function %eax *(ebp+8)) # => eax -10612 3d/compare-eax-and 0/imm32 -10613 { -10614 74/jump-if-= break/disp8 -10615 (check-mu-call *(ebp+8) %eax *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) -10616 eb/jump $check-mu-stmt:end/disp8 -10617 } -10618 # TODO: error on unknown function. We need to first type-check calls to SubX functions. -10619 } -10620 $check-mu-stmt:end: -10621 # . restore registers -10622 58/pop-to-eax -10623 # . epilogue -10624 89/<- %esp 5/r32/ebp -10625 5d/pop-to-ebp -10626 c3/return -10627 -10628 has-primitive-name?: # stmt: (addr stmt) -> result/eax: boolean -10629 # . prologue -10630 55/push-ebp -10631 89/<- %ebp 4/r32/esp -10632 # . save registers -10633 51/push-ecx -10634 56/push-esi -10635 # var name/esi: (addr array byte) = lookup(stmt->operation) -10636 8b/-> *(ebp+8) 6/r32/esi -10637 (lookup *(esi+4) *(esi+8)) # Stmt1-operation Stmt1-operation => eax -10638 89/<- %esi 0/r32/eax -10639 # if (name == "get") return true -10640 (string-equal? %esi "get") # => eax -10641 3d/compare-eax-and 0/imm32/false -10642 0f 85/jump-if-!= $has-primitive-name?:end/disp32 -10643 # if (name == "index") return true -10644 (string-equal? %esi "index") # => eax -10645 3d/compare-eax-and 0/imm32/false -10646 0f 85/jump-if-!= $has-primitive-name?:end/disp32 -10647 # if (name == "length") return true -10648 (string-equal? %esi "length") # => eax -10649 3d/compare-eax-and 0/imm32/false -10650 0f 85/jump-if-!= $has-primitive-name?:end/disp32 -10651 # if (name == "compute-offset") return true -10652 (string-equal? %esi "compute-offset") # => eax -10653 3d/compare-eax-and 0/imm32/false -10654 75/jump-if-!= $has-primitive-name?:end/disp8 -10655 # if (name == "lookup") return true -10656 (string-equal? %esi "lookup") # => eax -10657 3d/compare-eax-and 0/imm32/false -10658 75/jump-if-!= $has-primitive-name?:end/disp8 -10659 # var curr/ecx: (addr primitive) = Primitives -10660 b9/copy-to-ecx Primitives/imm32 -10661 { -10662 $has-primitive-name?:loop: -10663 # if (curr == null) break -10664 81 7/subop/compare %ecx 0/imm32 -10665 74/jump-if-= break/disp8 -10666 # if (primitive->name == name) return true -10667 (lookup *ecx *(ecx+4)) # Primitive-name Primitive-name => eax -10668 (string-equal? %esi %eax) # => eax -10669 3d/compare-eax-and 0/imm32/false -10670 75/jump-if-!= $has-primitive-name?:end/disp8 -10671 $has-primitive-name?:next-primitive: -10672 # curr = curr->next -10673 (lookup *(ecx+0x34) *(ecx+0x38)) # Primitive-next Primitive-next => eax -10674 89/<- %ecx 0/r32/eax -10675 # -10676 e9/jump loop/disp32 -10677 } -10678 # return null -10679 b8/copy-to-eax 0/imm32 -10680 $has-primitive-name?:end: -10681 # . restore registers -10682 5e/pop-to-esi -10683 59/pop-to-ecx -10684 # . epilogue -10685 89/<- %esp 5/r32/ebp -10686 5d/pop-to-ebp -10687 c3/return -10688 -10689 check-mu-primitive: # stmt: (addr stmt), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) -10690 # . prologue -10691 55/push-ebp -10692 89/<- %ebp 4/r32/esp -10693 # . save registers -10694 50/push-eax -10695 51/push-ecx -10696 # var op/ecx: (addr array byte) = lookup(stmt->operation) -10697 8b/-> *(ebp+8) 0/r32/eax -10698 (lookup *(eax+4) *(eax+8)) # Stmt1-operation Stmt1-operation => eax -10699 89/<- %ecx 0/r32/eax -10700 # if (op == "copy") check-mu-copy-stmt -10701 { -10702 (string-equal? %ecx "copy") # => eax -10703 3d/compare-eax-and 0/imm32/false -10704 74/jump-if-= break/disp8 -10705 (check-mu-copy-stmt *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) -10706 e9/jump $check-mu-primitive:end/disp32 -10707 } -10708 # if (op == "copy-to") check-mu-copy-to-stmt -10709 { -10710 (string-equal? %ecx "copy-to") # => eax -10711 3d/compare-eax-and 0/imm32/false -10712 74/jump-if-= break/disp8 -10713 (check-mu-copy-to-stmt *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) -10714 e9/jump $check-mu-primitive:end/disp32 -10715 } -10716 # if (op == "compare") check-mu-compare-stmt -10717 { -10718 (string-equal? %ecx "compare") # => eax -10719 3d/compare-eax-and 0/imm32/false -10720 74/jump-if-= break/disp8 -10721 (check-mu-compare-stmt *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) -10722 e9/jump $check-mu-primitive:end/disp32 -10723 } -10724 # if (op == "address") check-mu-address-stmt -10725 { -10726 (string-equal? %ecx "address") # => eax -10727 3d/compare-eax-and 0/imm32/false -10728 74/jump-if-= break/disp8 -10729 (check-mu-address-stmt *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) -10730 e9/jump $check-mu-primitive:end/disp32 -10731 } -10732 # if (op == "get") check-mu-get-stmt -10733 { -10734 (string-equal? %ecx "get") # => eax -10735 3d/compare-eax-and 0/imm32/false -10736 74/jump-if-= break/disp8 -10737 (check-mu-get-stmt *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) -10738 e9/jump $check-mu-primitive:end/disp32 -10739 } -10740 # if (op == "index") check-mu-index-stmt -10741 { -10742 (string-equal? %ecx "index") # => eax -10743 3d/compare-eax-and 0/imm32/false -10744 74/jump-if-= break/disp8 -10745 (check-mu-index-stmt *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) -10746 e9/jump $check-mu-primitive:end/disp32 -10747 } -10748 # if (op == "length") check-mu-length-stmt -10749 { -10750 (string-equal? %ecx "length") # => eax -10751 3d/compare-eax-and 0/imm32/false -10752 74/jump-if-= break/disp8 -10753 (check-mu-length-stmt *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) -10754 e9/jump $check-mu-primitive:end/disp32 -10755 } -10756 # if (op == "compute-offset") check-mu-compute-offset-stmt -10757 { -10758 (string-equal? %ecx "compute-offset") # => eax -10759 3d/compare-eax-and 0/imm32/false -10760 74/jump-if-= break/disp8 -10761 (check-mu-compute-offset-stmt *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) -10762 e9/jump $check-mu-primitive:end/disp32 +10305 # if T is already computed, return +10306 81 7/subop/compare *(esi+0xc) 0/imm32 # Typeinfo-total-size-in-bytes +10307 0f 8d/jump-if->= $populate-mu-type-sizes-in-type:end/disp32 +10308 # if T is being computed, abort +10309 81 7/subop/compare *(esi+0xc) -1/imm32/being-computed # Typeinfo-total-size-in-bytes +10310 0f 84/jump-if-= $populate-mu-type-sizes-in-type:abort/disp32 +10311 # tag T (-2 to -1) to avoid infinite recursion +10312 c7 0/subop/copy *(esi+0xc) -1/imm32/being-computed # Typeinfo-total-size-in-bytes +10313 # var total-size/edi: int = 0 +10314 bf/copy-to-edi 0/imm32 +10315 # - for every field, if it's a user-defined type, compute its size +10316 # var table/ecx: (addr table (handle array byte) (handle typeinfo-entry)) = lookup(T->fields) +10317 (lookup *(esi+4) *(esi+8)) # Typeinfo-fields Typeinfo-fields => eax +10318 89/<- %ecx 0/r32/eax +10319 # var table-size/edx: int = table->write +10320 8b/-> *ecx 2/r32/edx # stream-write +10321 # var curr/ecx: (addr table_row) = table->data +10322 8d/copy-address *(ecx+0xc) 1/r32/ecx +10323 # var max/edx: (addr table_row) = table->data + table->write +10324 8d/copy-address *(ecx+edx) 2/r32/edx +10325 { +10326 $populate-mu-type-sizes-in-type:loop: +10327 # if (curr >= max) break +10328 39/compare %ecx 2/r32/edx +10329 73/jump-if-addr>= break/disp8 +10330 # var t/eax: (addr typeinfo-entry) = lookup(curr->value) +10331 (lookup *(ecx+8) *(ecx+0xc)) # => eax +10332 # if (t->input-var == 0) silently ignore it; we'll emit a nice error message while type-checking +10333 81 7/subop/compare *eax 0/imm32 # Typeinfo-entry-input-var +10334 74/jump-if-= $populate-mu-type-sizes-in-type:end/disp8 +10335 # compute size of t->input-var +10336 (lookup *eax *(eax+4)) # Typeinfo-entry-input-var Typeinfo-entry-input-var => eax +10337 (compute-size-of-var %eax) # => eax +10338 # result += eax +10339 01/add-to %edi 0/r32/eax +10340 # curr += row-size +10341 81 0/subop/add %ecx 0x10/imm32 # Typeinfo-fields-row-size +10342 # +10343 eb/jump loop/disp8 +10344 } +10345 # - save result +10346 89/<- *(esi+0xc) 7/r32/edi # Typeinfo-total-size-in-bytes +10347 $populate-mu-type-sizes-in-type:end: +10348 # . restore registers +10349 5f/pop-to-edi +10350 5e/pop-to-esi +10351 5a/pop-to-edx +10352 59/pop-to-ecx +10353 58/pop-to-eax +10354 # . epilogue +10355 89/<- %esp 5/r32/ebp +10356 5d/pop-to-ebp +10357 c3/return +10358 +10359 $populate-mu-type-sizes-in-type:abort: +10360 (write-buffered *(ebp+0xc) "cycle in type definitions\n") +10361 (flush *(ebp+0xc)) +10362 (stop *(ebp+0x10) 1) +10363 # never gets here +10364 +10365 # Analogous to size-of, except we need to compute what size-of can just read +10366 # off the right data structures. +10367 compute-size-of-var: # in: (addr var) -> result/eax: int +10368 # . prologue +10369 55/push-ebp +10370 89/<- %ebp 4/r32/esp +10371 # . push registers +10372 51/push-ecx +10373 # var t/ecx: (addr type-tree) = lookup(v->type) +10374 8b/-> *(ebp+8) 1/r32/ecx +10375 (lookup *(ecx+8) *(ecx+0xc)) # Var-type Var-type => eax +10376 89/<- %ecx 0/r32/eax +10377 # if (t->is-atom == false) t = lookup(t->left) +10378 { +10379 81 7/subop/compare *ecx 0/imm32/false # Type-tree-is-atom +10380 75/jump-if-!= break/disp8 +10381 (lookup *(ecx+4) *(ecx+8)) # Type-tree-left Type-tree-left => eax +10382 89/<- %ecx 0/r32/eax +10383 } +10384 # TODO: ensure t is an atom +10385 (compute-size-of-type-id *(ecx+4)) # Type-tree-value => eax +10386 $compute-size-of-var:end: +10387 # . restore registers +10388 59/pop-to-ecx +10389 # . epilogue +10390 89/<- %esp 5/r32/ebp +10391 5d/pop-to-ebp +10392 c3/return +10393 +10394 compute-size-of-type-id: # t: type-id -> result/eax: int +10395 # . prologue +10396 55/push-ebp +10397 89/<- %ebp 4/r32/esp +10398 # . save registers +10399 51/push-ecx +10400 # var out/ecx: (handle typeinfo) +10401 68/push 0/imm32 +10402 68/push 0/imm32 +10403 89/<- %ecx 4/r32/esp +10404 # eax = t +10405 8b/-> *(ebp+8) 0/r32/eax +10406 # if t is a literal, return 0 +10407 3d/compare-eax-and 0/imm32/literal +10408 0f 84/jump-if-= $compute-size-of-type-id:end/disp32 # eax changes type from type-id to int +10409 # if t is a byte, return 4 (because we don't really support non-multiples of 4) +10410 3d/compare-eax-and 8/imm32/byte +10411 { +10412 75/jump-if-!= break/disp8 +10413 b8/copy-to-eax 4/imm32 +10414 eb/jump $compute-size-of-type-id:end/disp8 +10415 } +10416 # if t is a handle, return 8 +10417 3d/compare-eax-and 4/imm32/handle +10418 { +10419 75/jump-if-!= break/disp8 +10420 b8/copy-to-eax 8/imm32 +10421 eb/jump $compute-size-of-type-id:end/disp8 # eax changes type from type-id to int +10422 } +10423 # if t is a user-defined type, compute its size +10424 # TODO: support non-atom type +10425 (find-typeinfo %eax %ecx) +10426 { +10427 81 7/subop/compare *ecx 0/imm32 +10428 74/jump-if-= break/disp8 +10429 $compute-size-of-type-id:user-defined: +10430 (populate-mu-type-sizes %eax) +10431 8b/-> *(eax+0xc) 0/r32/eax # Typeinfo-total-size-in-bytes +10432 eb/jump $compute-size-of-type-id:end/disp8 +10433 } +10434 # otherwise return the word size +10435 b8/copy-to-eax 4/imm32 +10436 $compute-size-of-type-id:end: +10437 # . reclaim locals +10438 81 0/subop/add %esp 8/imm32 +10439 # . restore registers +10440 59/pop-to-ecx +10441 # . epilogue +10442 89/<- %esp 5/r32/ebp +10443 5d/pop-to-ebp +10444 c3/return +10445 +10446 # at this point we have total sizes for all user-defined types +10447 # compute offsets for each element +10448 # complication: fields may be out of order +10449 populate-mu-type-offsets: # in: (addr typeinfo), err: (addr buffered-file), ed: (addr exit-descriptor) +10450 # . prologue +10451 55/push-ebp +10452 89/<- %ebp 4/r32/esp +10453 # . save registers +10454 50/push-eax +10455 51/push-ecx +10456 52/push-edx +10457 53/push-ebx +10458 56/push-esi +10459 57/push-edi +10460 #? (dump-typeinfos "aaa\n") +10461 # var curr-offset/edi: int = 0 +10462 bf/copy-to-edi 0/imm32 +10463 # var table/ecx: (addr table string_key (handle typeinfo-entry)) = lookup(in->fields) +10464 8b/-> *(ebp+8) 1/r32/ecx +10465 (lookup *(ecx+4) *(ecx+8)) # Typeinfo-fields Typeinfo-fields => eax +10466 89/<- %ecx 0/r32/eax +10467 # var num-elems/edx: int = table->write / Typeinfo-fields-row-size +10468 8b/-> *ecx 2/r32/edx # stream-write +10469 c1 5/subop/shift-right-logical %edx 4/imm8 +10470 # var i/ebx: int = 0 +10471 bb/copy-to-ebx 0/imm32 +10472 { +10473 $populate-mu-type-offsets:loop: +10474 39/compare %ebx 2/r32/edx +10475 0f 8d/jump-if->= break/disp32 +10476 #? (write-buffered Stderr "looking up index ") +10477 #? (write-int32-hex-buffered Stderr %ebx) +10478 #? (write-buffered Stderr " in ") +10479 #? (write-int32-hex-buffered Stderr *(ebp+8)) +10480 #? (write-buffered Stderr Newline) +10481 #? (flush Stderr) +10482 # var v/esi: (addr typeinfo-entry) +10483 (locate-typeinfo-entry-with-index %ecx %ebx *(ebp+0xc) *(ebp+0x10)) # => eax +10484 89/<- %esi 0/r32/eax +10485 # if v is null, silently move on; we'll emit a nice error message while type-checking +10486 81 7/subop/compare %esi 0/imm32 # Typeinfo-entry-input-var +10487 74/jump-if-= $populate-mu-type-offsets:end/disp8 +10488 # if (v->input-var == 0) silently ignore v; we'll emit a nice error message while type-checking +10489 81 7/subop/compare *esi 0/imm32 # Typeinfo-entry-input-var +10490 74/jump-if-= $populate-mu-type-offsets:end/disp8 +10491 # v->output-var->offset = curr-offset +10492 # . eax: (addr var) +10493 (lookup *(esi+0xc) *(esi+0x10)) # Typeinfo-entry-output-var Typeinfo-entry-output-var => eax +10494 89/<- *(eax+0x14) 7/r32/edi # Var-offset +10495 # curr-offset += size-of(v->input-var) +10496 (lookup *esi *(esi+4)) # Typeinfo-entry-input-var Typeinfo-entry-input-var => eax +10497 (size-of %eax) # => eax +10498 01/add-to %edi 0/r32/eax +10499 # ++i +10500 43/increment-ebx +10501 e9/jump loop/disp32 +10502 } +10503 $populate-mu-type-offsets:end: +10504 # . restore registers +10505 5f/pop-to-edi +10506 5e/pop-to-esi +10507 5b/pop-to-ebx +10508 5a/pop-to-edx +10509 59/pop-to-ecx +10510 58/pop-to-eax +10511 # . epilogue +10512 89/<- %esp 5/r32/ebp +10513 5d/pop-to-ebp +10514 c3/return +10515 +10516 locate-typeinfo-entry-with-index: # table: (addr table (handle array byte) (handle typeinfo-entry)), idx: int, err: (addr buffered-file), ed: (addr exit-descriptor) -> result/eax: (addr typeinfo-entry) +10517 # . prologue +10518 55/push-ebp +10519 89/<- %ebp 4/r32/esp +10520 # . save registers +10521 51/push-ecx +10522 52/push-edx +10523 53/push-ebx +10524 56/push-esi +10525 57/push-edi +10526 # esi = table +10527 8b/-> *(ebp+8) 6/r32/esi +10528 # var curr/ecx: (addr row (handle array byte) (handle typeinfo-entry)) = table->data +10529 8d/copy-address *(esi+0xc) 1/r32/ecx +10530 # var max/edx: (addr byte) = &table->data[table->write] +10531 8b/-> *esi 2/r32/edx +10532 8d/copy-address *(ecx+edx) 2/r32/edx +10533 { +10534 $locate-typeinfo-entry-with-index:loop: +10535 39/compare %ecx 2/r32/edx +10536 73/jump-if-addr>= break/disp8 +10537 # var v/eax: (addr typeinfo-entry) +10538 (lookup *(ecx+8) *(ecx+0xc)) # => eax +10539 # if (v->index == idx) return v +10540 8b/-> *(eax+8) 3/r32/ebx # Typeinfo-entry-index +10541 #? (write-buffered Stderr "comparing ") +10542 #? (write-int32-hex-buffered Stderr %ebx) +10543 #? (write-buffered Stderr " and ") +10544 #? (write-int32-hex-buffered Stderr *(ebp+0xc)) +10545 #? (write-buffered Stderr Newline) +10546 #? (flush Stderr) +10547 39/compare *(ebp+0xc) 3/r32/ebx +10548 74/jump-if-= $locate-typeinfo-entry-with-index:end/disp8 +10549 # curr += Typeinfo-entry-size +10550 81 0/subop/add %ecx 0x10/imm32 # Typeinfo-entry-size +10551 # +10552 eb/jump loop/disp8 +10553 } +10554 # return 0 +10555 b8/copy-to-eax 0/imm32 +10556 $locate-typeinfo-entry-with-index:end: +10557 #? (write-buffered Stderr "returning ") +10558 #? (write-int32-hex-buffered Stderr %eax) +10559 #? (write-buffered Stderr Newline) +10560 #? (flush Stderr) +10561 # . restore registers +10562 5f/pop-to-edi +10563 5e/pop-to-esi +10564 5b/pop-to-ebx +10565 5a/pop-to-edx +10566 59/pop-to-ecx +10567 # . epilogue +10568 89/<- %esp 5/r32/ebp +10569 5d/pop-to-ebp +10570 c3/return +10571 +10572 dump-typeinfos: # hdr: (addr array byte) +10573 # . prologue +10574 55/push-ebp +10575 89/<- %ebp 4/r32/esp +10576 # . save registers +10577 50/push-eax +10578 # +10579 (write-buffered Stderr *(ebp+8)) +10580 (flush Stderr) +10581 # var curr/eax: (addr typeinfo) = lookup(Program->types) +10582 (lookup *_Program-types *_Program-types->payload) # => eax +10583 { +10584 # if (curr == null) break +10585 3d/compare-eax-and 0/imm32 +10586 74/jump-if-= break/disp8 +10587 (write-buffered Stderr "---\n") +10588 (flush Stderr) +10589 (dump-typeinfo %eax) +10590 # curr = lookup(curr->next) +10591 (lookup *(eax+0x10) *(eax+0x14)) # Typeinfo-next Typeinfo-next => eax +10592 eb/jump loop/disp8 +10593 } +10594 $dump-typeinfos:end: +10595 # . restore registers +10596 58/pop-to-eax +10597 # . epilogue +10598 89/<- %esp 5/r32/ebp +10599 5d/pop-to-ebp +10600 c3/return +10601 +10602 dump-typeinfo: # in: (addr typeinfo) +10603 # . prologue +10604 55/push-ebp +10605 89/<- %ebp 4/r32/esp +10606 # . save registers +10607 50/push-eax +10608 51/push-ecx +10609 52/push-edx +10610 53/push-ebx +10611 56/push-esi +10612 57/push-edi +10613 # esi = in +10614 8b/-> *(ebp+8) 6/r32/esi +10615 # var table/ecx: (addr table (handle array byte) (handle typeinfo-entry)) = lookup(T->fields) +10616 (lookup *(esi+4) *(esi+8)) # Typeinfo-fields Typeinfo-fields => eax +10617 89/<- %ecx 0/r32/eax +10618 (write-buffered Stderr "id:") +10619 (write-int32-hex-buffered Stderr *esi) +10620 (write-buffered Stderr "\n") +10621 (write-buffered Stderr "fields @ ") +10622 (write-int32-hex-buffered Stderr %ecx) +10623 (write-buffered Stderr Newline) +10624 (flush Stderr) +10625 (write-buffered Stderr " write: ") +10626 (write-int32-hex-buffered Stderr *ecx) +10627 (write-buffered Stderr Newline) +10628 (flush Stderr) +10629 (write-buffered Stderr " read: ") +10630 (write-int32-hex-buffered Stderr *(ecx+4)) +10631 (write-buffered Stderr Newline) +10632 (flush Stderr) +10633 (write-buffered Stderr " size: ") +10634 (write-int32-hex-buffered Stderr *(ecx+8)) +10635 (write-buffered Stderr Newline) +10636 (flush Stderr) +10637 # var table-size/edx: int = table->write +10638 8b/-> *ecx 2/r32/edx # stream-write +10639 # var curr/ecx: (addr table_row) = table->data +10640 8d/copy-address *(ecx+0xc) 1/r32/ecx +10641 # var max/edx: (addr table_row) = table->data + table->write +10642 8d/copy-address *(ecx+edx) 2/r32/edx +10643 { +10644 $dump-typeinfo:loop: +10645 # if (curr >= max) break +10646 39/compare %ecx 2/r32/edx +10647 0f 83/jump-if-addr>= break/disp32 +10648 (write-buffered Stderr " row:\n") +10649 (write-buffered Stderr " key: ") +10650 (write-int32-hex-buffered Stderr *ecx) +10651 (write-buffered Stderr ",") +10652 (write-int32-hex-buffered Stderr *(ecx+4)) +10653 (write-buffered Stderr " = '") +10654 (lookup *ecx *(ecx+4)) +10655 (write-buffered Stderr %eax) +10656 (write-buffered Stderr "' @ ") +10657 (write-int32-hex-buffered Stderr %eax) +10658 (write-buffered Stderr Newline) +10659 (flush Stderr) +10660 (write-buffered Stderr " value: ") +10661 (write-int32-hex-buffered Stderr *(ecx+8)) +10662 (write-buffered Stderr ",") +10663 (write-int32-hex-buffered Stderr *(ecx+0xc)) +10664 (write-buffered Stderr " = typeinfo-entry@") +10665 (lookup *(ecx+8) *(ecx+0xc)) +10666 (write-int32-hex-buffered Stderr %eax) +10667 (write-buffered Stderr Newline) +10668 (flush Stderr) +10669 (write-buffered Stderr " input var@") +10670 (dump-var 5 %eax) +10671 (lookup *(ecx+8) *(ecx+0xc)) +10672 (write-buffered Stderr " index: ") +10673 (write-int32-hex-buffered Stderr *(eax+8)) +10674 (write-buffered Stderr Newline) +10675 (flush Stderr) +10676 (write-buffered Stderr " output var@") +10677 8d/copy-address *(eax+0xc) 0/r32/eax # Typeinfo-entry-output-var +10678 (dump-var 5 %eax) +10679 (flush Stderr) +10680 # curr += row-size +10681 81 0/subop/add %ecx 0x10/imm32 # Typeinfo-fields-row-size +10682 # +10683 e9/jump loop/disp32 +10684 } +10685 $dump-typeinfo:end: +10686 # . restore registers +10687 5f/pop-to-edi +10688 5e/pop-to-esi +10689 5b/pop-to-ebx +10690 5a/pop-to-edx +10691 59/pop-to-ecx +10692 58/pop-to-eax +10693 # . epilogue +10694 89/<- %esp 5/r32/ebp +10695 5d/pop-to-ebp +10696 c3/return +10697 +10698 dump-var: # indent: int, v: (addr handle var) +10699 # . prologue +10700 55/push-ebp +10701 89/<- %ebp 4/r32/esp +10702 # . save registers +10703 50/push-eax +10704 53/push-ebx +10705 # eax = v +10706 8b/-> *(ebp+0xc) 0/r32/eax +10707 # +10708 (write-int32-hex-buffered Stderr *eax) +10709 (write-buffered Stderr ",") +10710 (write-int32-hex-buffered Stderr *(eax+4)) +10711 (write-buffered Stderr "->") +10712 (lookup *eax *(eax+4)) +10713 (write-int32-hex-buffered Stderr %eax) +10714 (write-buffered Stderr Newline) +10715 (flush Stderr) +10716 { +10717 3d/compare-eax-and 0/imm32 +10718 0f 84/jump-if-= break/disp32 +10719 (emit-indent Stderr *(ebp+8)) +10720 (write-buffered Stderr "name: ") +10721 89/<- %ebx 0/r32/eax +10722 (write-int32-hex-buffered Stderr *ebx) # Var-name +10723 (write-buffered Stderr ",") +10724 (write-int32-hex-buffered Stderr *(ebx+4)) # Var-name +10725 (write-buffered Stderr "->") +10726 (lookup *ebx *(ebx+4)) # Var-name +10727 (write-int32-hex-buffered Stderr %eax) +10728 { +10729 3d/compare-eax-and 0/imm32 +10730 74/jump-if-= break/disp8 +10731 (write-buffered Stderr Space) +10732 (write-buffered Stderr %eax) +10733 } +10734 (write-buffered Stderr Newline) +10735 (flush Stderr) +10736 (emit-indent Stderr *(ebp+8)) +10737 (write-buffered Stderr "block depth: ") +10738 (write-int32-hex-buffered Stderr *(ebx+0x10)) # Var-block-depth +10739 (write-buffered Stderr Newline) +10740 (flush Stderr) +10741 (emit-indent Stderr *(ebp+8)) +10742 (write-buffered Stderr "stack offset: ") +10743 (write-int32-hex-buffered Stderr *(ebx+0x14)) # Var-offset +10744 (write-buffered Stderr Newline) +10745 (flush Stderr) +10746 (emit-indent Stderr *(ebp+8)) +10747 (write-buffered Stderr "reg: ") +10748 (write-int32-hex-buffered Stderr *(ebx+0x18)) # Var-register +10749 (write-buffered Stderr ",") +10750 (write-int32-hex-buffered Stderr *(ebx+0x1c)) # Var-register +10751 (write-buffered Stderr "->") +10752 (flush Stderr) +10753 (lookup *(ebx+0x18) *(ebx+0x1c)) # Var-register +10754 (write-int32-hex-buffered Stderr %eax) +10755 { +10756 3d/compare-eax-and 0/imm32 +10757 74/jump-if-= break/disp8 +10758 (write-buffered Stderr Space) +10759 (write-buffered Stderr %eax) +10760 } +10761 (write-buffered Stderr Newline) +10762 (flush Stderr) 10763 } -10764 # if (op == "lookup") check-mu-lookup-stmt -10765 { -10766 (string-equal? %ecx "lookup") # => eax -10767 3d/compare-eax-and 0/imm32/false -10768 74/jump-if-= break/disp8 -10769 (check-mu-lookup-stmt *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) -10770 e9/jump $check-mu-primitive:end/disp32 -10771 } -10772 # otherwise check-numberlike-stmt -10773 (check-mu-numberlike-primitive *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) -10774 $check-mu-primitive:end: -10775 # . restore registers -10776 59/pop-to-ecx -10777 58/pop-to-eax -10778 # . epilogue -10779 89/<- %esp 5/r32/ebp -10780 5d/pop-to-ebp -10781 c3/return -10782 -10783 # by default, Mu primitives should only operate on 'number-like' types -10784 check-mu-numberlike-primitive: # stmt: (addr stmt), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) -10785 # . prologue -10786 55/push-ebp -10787 89/<- %ebp 4/r32/esp -10788 # . save registers -10789 50/push-eax -10790 51/push-ecx -10791 56/push-esi -10792 # esi = stmt -10793 8b/-> *(ebp+8) 6/r32/esi -10794 # var gas/ecx: int = 2 -10795 b9/copy-to-ecx 2/imm32 -10796 # - check at most 1 output -10797 # var output/eax: (addr stmt-var) = stmt->outputs -10798 (lookup *(esi+0x14) *(esi+0x18)) # Stmt1-outputs Stmt1-outputs => eax -10799 { -10800 3d/compare-eax-and 0/imm32 -10801 74/jump-if-= break/disp8 -10802 $check-mu-numberlike-primitive:output: -10803 (check-mu-numberlike-output %eax *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) -10804 (lookup *(eax+8) *(eax+0xc)) # Stmt-var-next Stmt-var-next => eax -10805 3d/compare-eax-and 0/imm32 -10806 0f 85/jump-if-!= $check-mu-numberlike-primitive:error-too-many-outputs/disp32 -10807 # check output is in a register -10808 # --gas -10809 49/decrement-ecx -10810 } -10811 # - check first inout -10812 (lookup *(esi+0xc) *(esi+0x10)) # Stmt1-inouts Stmt1-inouts => eax -10813 { -10814 3d/compare-eax-and 0/imm32 -10815 0f 84/jump-if-= $check-mu-numberlike-primitive:end/disp32 -10816 $check-mu-numberlike-primitive:first-inout: -10817 (check-mu-numberlike-arg %eax *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) -10818 # --gas -10819 49/decrement-ecx -10820 } -10821 # - check second inout -10822 (lookup *(eax+8) *(eax+0xc)) # Stmt-var-next Stmt-var-next => eax -10823 { -10824 3d/compare-eax-and 0/imm32 -10825 74/jump-if-= $check-mu-numberlike-primitive:end/disp8 -10826 $check-mu-numberlike-primitive:second-inout: -10827 # is a second inout allowed? -10828 81 7/subop/compare %ecx 0/imm32 -10829 0f 84/jump-if-= $check-mu-numberlike-primitive:error-too-many-inouts/disp32 -10830 $check-mu-numberlike-primitive:second-inout-permitted: -10831 (check-mu-numberlike-arg %eax *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) -10832 } -10833 $check-mu-numberlike-primitive:third-inout: -10834 # if there's a third arg, raise an error -10835 81 7/subop/compare *(eax+8) 0/imm32 # Stmt-var-next -10836 0f 85/jump-if-!= $check-mu-numberlike-primitive:error-too-many-inouts/disp32 -10837 $check-mu-numberlike-primitive:end: -10838 # . restore registers -10839 5e/pop-to-esi -10840 59/pop-to-ecx -10841 58/pop-to-eax -10842 # . epilogue -10843 89/<- %esp 5/r32/ebp -10844 5d/pop-to-ebp -10845 c3/return -10846 -10847 $check-mu-numberlike-primitive:error-too-many-inouts: -10848 (write-buffered *(ebp+0x10) "fn ") -10849 8b/-> *(ebp+0xc) 0/r32/eax -10850 (lookup *eax *(eax+4)) # Function-name Function-name => eax -10851 (write-buffered *(ebp+0x10) %eax) -10852 (write-buffered *(ebp+0x10) ": stmt ") -10853 (lookup *(esi+4) *(esi+8)) # Stmt1-operation Stmt1-operation => eax -10854 (write-buffered *(ebp+0x10) %eax) -10855 (write-buffered *(ebp+0x10) ": too many inouts; most primitives support at most two arguments, across inouts and outputs\n") -10856 (flush *(ebp+0x10)) -10857 (stop *(ebp+0x14) 1) -10858 # never gets here -10859 -10860 $check-mu-numberlike-primitive:error-too-many-outputs: -10861 (write-buffered *(ebp+0x10) "fn ") -10862 8b/-> *(ebp+0xc) 0/r32/eax -10863 (lookup *eax *(eax+4)) # Function-name Function-name => eax -10864 (write-buffered *(ebp+0x10) %eax) -10865 (write-buffered *(ebp+0x10) ": stmt ") -10866 (lookup *(esi+4) *(esi+8)) # Stmt1-operation Stmt1-operation => eax -10867 (write-buffered *(ebp+0x10) %eax) -10868 (write-buffered *(ebp+0x10) ": too many outputs; most primitives support at most one output\n") -10869 (flush *(ebp+0x10)) -10870 (stop *(ebp+0x14) 1) -10871 # never gets here -10872 -10873 check-mu-numberlike-arg: # v: (addr stmt-var), stmt: (addr stmt), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) -10874 # . prologue -10875 55/push-ebp -10876 89/<- %ebp 4/r32/esp -10877 # . save registers -10878 50/push-eax -10879 56/push-esi -10880 # var t/esi: (addr tree type-id) = lookup(v->value->type) -10881 8b/-> *(ebp+8) 0/r32/eax -10882 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax -10883 (lookup *(eax+8) *(eax+0xc)) # Var-type Var-type => eax -10884 89/<- %esi 0/r32/eax -10885 $check-mu-numberlike-arg:check-literal: -10886 # if t is an int, return -10887 (is-simple-mu-type? %esi 0) # literal => eax -10888 3d/compare-eax-and 0/imm32/false -10889 75/jump-if-!= $check-mu-numberlike-arg:end/disp8 -10890 $check-mu-numberlike-arg:check-addr: -10891 # if t is an addr and v is dereferenced, return -10892 { -10893 (is-mu-addr-type? %esi) # => eax -10894 3d/compare-eax-and 0/imm32/false -10895 74/jump-if-= break/disp8 -10896 8b/-> *(ebp+8) 0/r32/eax -10897 8b/-> *(eax+0x10) 0/r32/eax -10898 3d/compare-eax-and 0/imm32/false -10899 75/jump-if-!= $check-mu-numberlike-arg:end/disp8 -10900 } -10901 $check-mu-numberlike-arg:output-checks: -10902 (check-mu-numberlike-output *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14) *(ebp+0x18)) -10903 $check-mu-numberlike-arg:end: -10904 # . restore registers -10905 5e/pop-to-esi -10906 58/pop-to-eax -10907 # . epilogue -10908 89/<- %esp 5/r32/ebp -10909 5d/pop-to-ebp -10910 c3/return -10911 -10912 check-mu-numberlike-output: # v: (addr stmt-var), stmt: (addr stmt), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) -10913 # . prologue -10914 55/push-ebp -10915 89/<- %ebp 4/r32/esp -10916 # . save registers -10917 50/push-eax -10918 56/push-esi -10919 # var t/esi: (addr tree type-id) = lookup(v->value->type) -10920 8b/-> *(ebp+8) 0/r32/eax -10921 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax -10922 (lookup *(eax+8) *(eax+0xc)) # Var-type Var-type => eax -10923 89/<- %esi 0/r32/eax -10924 $check-mu-numberlike-output:check-int: -10925 # if t is an int, return -10926 (is-simple-mu-type? %esi 1) # int => eax -10927 3d/compare-eax-and 0/imm32/false -10928 75/jump-if-!= $check-mu-numberlike-output:end/disp8 -10929 $check-mu-numberlike-output:check-boolean: -10930 # if t is a boolean, return -10931 (is-simple-mu-type? %esi 5) # boolean => eax -10932 3d/compare-eax-and 0/imm32/false -10933 75/jump-if-!= $check-mu-numberlike-output:end/disp8 -10934 $check-mu-numberlike-output:check-byte: -10935 # if t is a byte, return -10936 (is-simple-mu-type? %esi 8) # byte => eax -10937 3d/compare-eax-and 0/imm32/false -10938 75/jump-if-!= $check-mu-numberlike-output:end/disp8 -10939 e9/jump $check-mu-numberlike-output:fail/disp32 -10940 $check-mu-numberlike-output:end: -10941 # . restore registers -10942 5e/pop-to-esi -10943 58/pop-to-eax -10944 # . epilogue -10945 89/<- %esp 5/r32/ebp -10946 5d/pop-to-ebp -10947 c3/return -10948 -10949 $check-mu-numberlike-output:fail: -10950 # otherwise raise an error -10951 (write-buffered *(ebp+0x14) "fn ") -10952 8b/-> *(ebp+0x10) 0/r32/eax -10953 (lookup *eax *(eax+4)) # Function-name Function-name => eax -10954 (write-buffered *(ebp+0x14) %eax) -10955 (write-buffered *(ebp+0x14) ": stmt ") -10956 8b/-> *(ebp+0xc) 0/r32/eax -10957 (lookup *(eax+4) *(eax+8)) # Stmt1-operation Stmt1-operation => eax -10958 (write-buffered *(ebp+0x14) %eax) -10959 (write-buffered *(ebp+0x14) ": only non-addr scalar args permitted\n") -10960 (flush *(ebp+0x14)) -10961 (stop *(ebp+0x18) 1) +10764 $dump-var:end: +10765 # . restore registers +10766 5b/pop-to-ebx +10767 58/pop-to-eax +10768 # . epilogue +10769 89/<- %esp 5/r32/ebp +10770 5d/pop-to-ebp +10771 c3/return +10772 +10773 ####################################################### +10774 # Type-checking +10775 ####################################################### +10776 +10777 check-mu-types: # err: (addr buffered-file), ed: (addr exit-descriptor) +10778 # . prologue +10779 55/push-ebp +10780 89/<- %ebp 4/r32/esp +10781 # . save registers +10782 50/push-eax +10783 # var curr/eax: (addr function) = lookup(Program->functions) +10784 (lookup *_Program-functions *_Program-functions->payload) # => eax +10785 { +10786 $check-mu-types:loop: +10787 # if (curr == null) break +10788 3d/compare-eax-and 0/imm32 +10789 0f 84/jump-if-= break/disp32 +10790 +-- 8 lines: #? # dump curr->name ------------------------------------------------------------------------------------------------------------------------------------------------ +10798 (check-mu-function %eax *(ebp+8) *(ebp+0xc)) +10799 # curr = lookup(curr->next) +10800 (lookup *(eax+0x20) *(eax+0x24)) # Function-next Function-next => eax +10801 e9/jump loop/disp32 +10802 } +10803 $check-mu-types:end: +10804 # . restore registers +10805 58/pop-to-eax +10806 # . epilogue +10807 89/<- %esp 5/r32/ebp +10808 5d/pop-to-ebp +10809 c3/return +10810 +10811 check-mu-function: # fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) +10812 # . prologue +10813 55/push-ebp +10814 89/<- %ebp 4/r32/esp +10815 # . save registers +10816 50/push-eax +10817 # eax = f +10818 8b/-> *(ebp+8) 0/r32/eax +10819 # TODO: anything to check in header? +10820 # var body/eax: (addr block) = lookup(f->body) +10821 (lookup *(eax+0x18) *(eax+0x1c)) # Function-body Function-body => eax +10822 (check-mu-block %eax *(ebp+8) *(ebp+0xc) *(ebp+0x10)) +10823 $check-mu-function:end: +10824 # . restore registers +10825 58/pop-to-eax +10826 # . epilogue +10827 89/<- %esp 5/r32/ebp +10828 5d/pop-to-ebp +10829 c3/return +10830 +10831 check-mu-block: # block: (addr block), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) +10832 # . prologue +10833 55/push-ebp +10834 89/<- %ebp 4/r32/esp +10835 # . save registers +10836 50/push-eax +10837 # eax = block +10838 8b/-> *(ebp+8) 0/r32/eax +10839 # var stmts/eax: (addr list stmt) = lookup(block->statements) +10840 (lookup *(eax+4) *(eax+8)) # Block-stmts Block-stmts => eax +10841 # +10842 { +10843 $check-mu-block:check-empty: +10844 3d/compare-eax-and 0/imm32 +10845 0f 84/jump-if-= break/disp32 +10846 # emit block->statements +10847 (check-mu-stmt-list %eax *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) +10848 } +10849 $check-mu-block:end: +10850 # . restore registers +10851 58/pop-to-eax +10852 # . epilogue +10853 89/<- %esp 5/r32/ebp +10854 5d/pop-to-ebp +10855 c3/return +10856 +10857 check-mu-stmt-list: # stmts: (addr list stmt), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) +10858 # . prologue +10859 55/push-ebp +10860 89/<- %ebp 4/r32/esp +10861 # . save registers +10862 50/push-eax +10863 56/push-esi +10864 # esi = stmts +10865 8b/-> *(ebp+8) 6/r32/esi +10866 { +10867 $check-mu-stmt-list:loop: +10868 81 7/subop/compare %esi 0/imm32 +10869 0f 84/jump-if-= break/disp32 +10870 # var curr-stmt/eax: (addr stmt) = lookup(stmts->value) +10871 (lookup *esi *(esi+4)) # List-value List-value => eax +10872 { +10873 $check-mu-stmt-list:check-for-block: +10874 81 7/subop/compare *eax 0/imm32/block # Stmt-tag +10875 75/jump-if-!= break/disp8 +10876 $check-mu-stmt-list:block: +10877 (check-mu-block %eax *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) +10878 eb/jump $check-mu-stmt-list:continue/disp8 +10879 } +10880 { +10881 $check-mu-stmt-list:check-for-stmt1: +10882 81 7/subop/compare *eax 1/imm32/stmt1 # Stmt-tag +10883 0f 85/jump-if-!= break/disp32 +10884 $check-mu-stmt-list:stmt1: +10885 (check-mu-stmt %eax *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) +10886 eb/jump $check-mu-stmt-list:continue/disp8 +10887 } +10888 { +10889 $check-mu-stmt-list:check-for-reg-var-def: +10890 81 7/subop/compare *eax 3/imm32/reg-var-def # Stmt-tag +10891 0f 85/jump-if-!= break/disp32 +10892 $check-mu-stmt-list:reg-var-def: +10893 (check-mu-stmt %eax *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) +10894 eb/jump $check-mu-stmt-list:continue/disp8 +10895 } +10896 $check-mu-stmt-list:continue: +10897 # TODO: raise an error on unrecognized Stmt-tag +10898 (lookup *(esi+8) *(esi+0xc)) # List-next List-next => eax +10899 89/<- %esi 0/r32/eax +10900 e9/jump loop/disp32 +10901 } +10902 $check-mu-stmt-list:end: +10903 # . restore registers +10904 5e/pop-to-esi +10905 58/pop-to-eax +10906 # . epilogue +10907 89/<- %esp 5/r32/ebp +10908 5d/pop-to-ebp +10909 c3/return +10910 +10911 check-mu-stmt: # stmt: (addr stmt), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) +10912 # . prologue +10913 55/push-ebp +10914 89/<- %ebp 4/r32/esp +10915 # . save registers +10916 50/push-eax +10917 # - if stmt's operation matches a primitive, check against it +10918 (has-primitive-name? *(ebp+8)) # => eax +10919 3d/compare-eax-and 0/imm32/false +10920 { +10921 74/jump-if-= break/disp8 +10922 (check-mu-primitive *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) +10923 e9/jump $check-mu-stmt:end/disp32 +10924 } +10925 # - otherwise find a function to check against +10926 # var f/eax: (addr function) = lookup(*Program->functions) +10927 (lookup *_Program-functions *_Program-functions->payload) # => eax +10928 (find-matching-function %eax *(ebp+8)) # => eax +10929 3d/compare-eax-and 0/imm32 +10930 { +10931 74/jump-if-= break/disp8 +10932 (check-mu-call *(ebp+8) %eax *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) +10933 eb/jump $check-mu-stmt:end/disp8 +10934 } +10935 # var f/eax: (addr function) = lookup(*Program->signatures) +10936 (lookup *_Program-signatures *_Program-signatures->payload) # => eax +10937 (find-matching-function %eax *(ebp+8)) # => eax +10938 3d/compare-eax-and 0/imm32 +10939 { +10940 74/jump-if-= break/disp8 +10941 (check-mu-call *(ebp+8) %eax *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) +10942 eb/jump $check-mu-stmt:end/disp8 +10943 } +10944 # - otherwise abort +10945 e9/jump $check-mu-stmt:unknown-call/disp32 +10946 $check-mu-stmt:end: +10947 # . restore registers +10948 58/pop-to-eax +10949 # . epilogue +10950 89/<- %esp 5/r32/ebp +10951 5d/pop-to-ebp +10952 c3/return +10953 +10954 $check-mu-stmt:unknown-call: +10955 (write-buffered *(ebp+0x10) "unknown function '") +10956 8b/-> *(ebp+8) 0/r32/eax +10957 (lookup *(eax+4) *(eax+8)) # Stmt1-operation Stmt1-operation => eax +10958 (write-buffered *(ebp+0x10) %eax) +10959 (write-buffered *(ebp+0x10) "'\n") +10960 (flush *(ebp+0x10)) +10961 (stop *(ebp+0x14) 1) 10962 # never gets here 10963 -10964 check-mu-copy-stmt: # stmt: (addr stmt), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) +10964 has-primitive-name?: # stmt: (addr stmt) -> result/eax: boolean 10965 # . prologue 10966 55/push-ebp 10967 89/<- %ebp 4/r32/esp 10968 # . save registers -10969 $check-mu-copy-stmt:end: -10970 # . restore registers -10971 # . epilogue -10972 89/<- %esp 5/r32/ebp -10973 5d/pop-to-ebp -10974 c3/return -10975 -10976 check-mu-copy-to-stmt: # stmt: (addr stmt), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) -10977 # . prologue -10978 55/push-ebp -10979 89/<- %ebp 4/r32/esp -10980 # . save registers -10981 $check-mu-copy-to-stmt:end: -10982 # . restore registers -10983 # . epilogue -10984 89/<- %esp 5/r32/ebp -10985 5d/pop-to-ebp -10986 c3/return -10987 -10988 check-mu-compare-stmt: # stmt: (addr stmt), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) -10989 # . prologue -10990 55/push-ebp -10991 89/<- %ebp 4/r32/esp -10992 # . save registers -10993 $check-mu-compare-stmt:end: -10994 # . restore registers -10995 # . epilogue -10996 89/<- %esp 5/r32/ebp -10997 5d/pop-to-ebp -10998 c3/return -10999 -11000 check-mu-address-stmt: # stmt: (addr stmt), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) -11001 # . prologue -11002 55/push-ebp -11003 89/<- %ebp 4/r32/esp -11004 # . save registers -11005 $check-mu-address-stmt:end: -11006 # . restore registers -11007 # . epilogue -11008 89/<- %esp 5/r32/ebp -11009 5d/pop-to-ebp -11010 c3/return -11011 -11012 check-mu-get-stmt: # stmt: (addr stmt), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) -11013 # . prologue -11014 55/push-ebp -11015 89/<- %ebp 4/r32/esp -11016 # . save registers -11017 50/push-eax -11018 51/push-ecx -11019 52/push-edx -11020 53/push-ebx -11021 56/push-esi -11022 57/push-edi -11023 # esi = stmt -11024 8b/-> *(ebp+8) 6/r32/esi -11025 # - check for 0 inouts -11026 # var base/ecx: (addr var) = stmt->inouts->value -11027 (lookup *(esi+0xc) *(esi+0x10)) # Stmt1-inouts Stmt1-inouts => eax -11028 3d/compare-eax-and 0/imm32/false -11029 0f 84/jump-if-= $check-mu-get-stmt:error-too-few-inouts/disp32 -11030 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax -11031 89/<- %ecx 0/r32/eax -11032 $check-mu-get-stmt:check-base: -11033 # - check base type -11034 # if it's an 'addr', check that it's in a register -11035 # var base-type/ebx: (addr tree type-id) = lookup(base->type) -11036 (lookup *(ecx+8) *(ecx+0xc)) # Var-type Var-type => eax -11037 89/<- %ebx 0/r32/eax -11038 { -11039 81 7/subop/compare *ebx 0/imm32/false # Tree-is-atom -11040 0f 85/jump-if-!= break/disp32 -11041 $check-mu-get-stmt:base-is-compound: -11042 # if (type->left != addr) break -11043 (lookup *(ebx+4) *(ebx+8)) # Tree-left Tree-left => eax -11044 (is-simple-mu-type? %eax 2) # => eax -11045 3d/compare-eax-and 0/imm32/false -11046 74/jump-if-= break/disp8 -11047 $check-mu-get-stmt:base-is-addr: -11048 # now check for register -11049 81 7/subop/compare *(ecx+0x18) 0/imm32 # Var-register -11050 0f 84/jump-if-= $check-mu-get-stmt:error-base-type-addr-but-not-register/disp32 -11051 $check-mu-get-stmt:base-is-addr-in-register: -11052 # type->left is now an addr; skip it -11053 (lookup *(ebx+0xc) *(ebx+0x10)) # Tree-right Tree-right => eax -11054 81 7/subop/compare *(eax+0xc) 0/imm32 # Tree-right -11055 0f 85/jump-if-!= $check-mu-get-stmt:error-bad-base/disp32 -11056 $check-mu-get-stmt:base-is-addr-to-atom-in-register: -11057 (lookup *(eax+4) *(eax+8)) # Tree-left Tree-left => eax -11058 89/<- %ebx 0/r32/eax +10969 51/push-ecx +10970 56/push-esi +10971 # var name/esi: (addr array byte) = lookup(stmt->operation) +10972 8b/-> *(ebp+8) 6/r32/esi +10973 (lookup *(esi+4) *(esi+8)) # Stmt1-operation Stmt1-operation => eax +10974 89/<- %esi 0/r32/eax +10975 # if (name == "get") return true +10976 (string-equal? %esi "get") # => eax +10977 3d/compare-eax-and 0/imm32/false +10978 0f 85/jump-if-!= $has-primitive-name?:end/disp32 +10979 # if (name == "index") return true +10980 (string-equal? %esi "index") # => eax +10981 3d/compare-eax-and 0/imm32/false +10982 0f 85/jump-if-!= $has-primitive-name?:end/disp32 +10983 # if (name == "length") return true +10984 (string-equal? %esi "length") # => eax +10985 3d/compare-eax-and 0/imm32/false +10986 0f 85/jump-if-!= $has-primitive-name?:end/disp32 +10987 # if (name == "compute-offset") return true +10988 (string-equal? %esi "compute-offset") # => eax +10989 3d/compare-eax-and 0/imm32/false +10990 75/jump-if-!= $has-primitive-name?:end/disp8 +10991 # if (name == "lookup") return true +10992 (string-equal? %esi "lookup") # => eax +10993 3d/compare-eax-and 0/imm32/false +10994 75/jump-if-!= $has-primitive-name?:end/disp8 +10995 # var curr/ecx: (addr primitive) = Primitives +10996 b9/copy-to-ecx Primitives/imm32 +10997 { +10998 $has-primitive-name?:loop: +10999 # if (curr == null) break +11000 81 7/subop/compare %ecx 0/imm32 +11001 74/jump-if-= break/disp8 +11002 # if (primitive->name == name) return true +11003 (lookup *ecx *(ecx+4)) # Primitive-name Primitive-name => eax +11004 (string-equal? %esi %eax) # => eax +11005 3d/compare-eax-and 0/imm32/false +11006 75/jump-if-!= $has-primitive-name?:end/disp8 +11007 $has-primitive-name?:next-primitive: +11008 # curr = curr->next +11009 (lookup *(ecx+0x34) *(ecx+0x38)) # Primitive-next Primitive-next => eax +11010 89/<- %ecx 0/r32/eax +11011 # +11012 e9/jump loop/disp32 +11013 } +11014 # return null +11015 b8/copy-to-eax 0/imm32 +11016 $has-primitive-name?:end: +11017 # . restore registers +11018 5e/pop-to-esi +11019 59/pop-to-ecx +11020 # . epilogue +11021 89/<- %esp 5/r32/ebp +11022 5d/pop-to-ebp +11023 c3/return +11024 +11025 check-mu-primitive: # stmt: (addr stmt), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) +11026 # . prologue +11027 55/push-ebp +11028 89/<- %ebp 4/r32/esp +11029 # . save registers +11030 50/push-eax +11031 51/push-ecx +11032 # var op/ecx: (addr array byte) = lookup(stmt->operation) +11033 8b/-> *(ebp+8) 0/r32/eax +11034 (lookup *(eax+4) *(eax+8)) # Stmt1-operation Stmt1-operation => eax +11035 89/<- %ecx 0/r32/eax +11036 # if (op == "copy") check-mu-copy-stmt +11037 { +11038 (string-equal? %ecx "copy") # => eax +11039 3d/compare-eax-and 0/imm32/false +11040 74/jump-if-= break/disp8 +11041 (check-mu-copy-stmt *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) +11042 e9/jump $check-mu-primitive:end/disp32 +11043 } +11044 # if (op == "copy-to") check-mu-copy-to-stmt +11045 { +11046 (string-equal? %ecx "copy-to") # => eax +11047 3d/compare-eax-and 0/imm32/false +11048 74/jump-if-= break/disp8 +11049 (check-mu-copy-to-stmt *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) +11050 e9/jump $check-mu-primitive:end/disp32 +11051 } +11052 # if (op == "compare") check-mu-compare-stmt +11053 { +11054 (string-equal? %ecx "compare") # => eax +11055 3d/compare-eax-and 0/imm32/false +11056 74/jump-if-= break/disp8 +11057 (check-mu-compare-stmt *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) +11058 e9/jump $check-mu-primitive:end/disp32 11059 } -11060 $check-mu-get-stmt:check-base-typeinfo: -11061 # ensure type is a container -11062 # var base-type-id/ebx: type-id = base-type->value -11063 8b/-> *(ebx+4) 3/r32/ebx # Tree-value -11064 (is-container? %ebx) # => eax -11065 3d/compare-eax-and 0/imm32/false -11066 0f 84/jump-if-= $check-mu-get-stmt:error-bad-base/disp32 -11067 # var base-typeinfo/edx: (addr typeinfo) = find-typeinfo(base-type-id) -11068 # . var container/ecx: (handle typeinfo) -11069 68/push 0/imm32 -11070 68/push 0/imm32 -11071 89/<- %ecx 4/r32/esp -11072 # . -11073 (find-typeinfo %ebx %ecx) -11074 (lookup *ecx *(ecx+4)) # => eax -11075 # . reclaim container -11076 81 0/subop/add %esp 8/imm32 -11077 # . -11078 89/<- %edx 0/r32/eax -11079 # var offset/ecx: (addr stmt-var) = stmt->inouts->next -11080 (lookup *(esi+0xc) *(esi+0x10)) # Stmt1-inouts Stmt1-inouts => eax -11081 (lookup *(eax+8) *(eax+0xc)) # Stmt-var-next Stmt-var-next => eax -11082 89/<- %ecx 0/r32/eax -11083 # - check for 1 inout -11084 3d/compare-eax-and 0/imm32/false -11085 0f 84/jump-if-= $check-mu-get-stmt:error-too-few-inouts/disp32 -11086 # var offset/ecx: (addr var) = lookup(offset->value) -11087 (lookup *ecx *(ecx+4)) # Stmt-var-value Stmt-var-value => eax -11088 89/<- %ecx 0/r32/eax -11089 # - check for valid field -11090 81 7/subop/compare *(ecx+0x14) -1/imm32/uninitialized # Var-offset -11091 0f 84/jump-if-= $check-mu-get-stmt:error-bad-field/disp32 -11092 # - check for too many inouts -11093 (lookup *(esi+0xc) *(esi+0x10)) # Stmt1-inouts Stmt1-inouts => eax -11094 (lookup *(eax+8) *(eax+0xc)) # Stmt-var-next Stmt-var-next => eax -11095 (lookup *(eax+8) *(eax+0xc)) # Stmt-var-next Stmt-var-next => eax -11096 3d/compare-eax-and 0/imm32/false -11097 0f 85/jump-if-!= $check-mu-get-stmt:error-too-many-inouts/disp32 -11098 # var output/edi: (addr var) = stmt->outputs->value -11099 (lookup *(esi+0x14) *(esi+0x18)) # Stmt1-outputs Stmt1-outputs => eax -11100 # - check for 0 outputs -11101 3d/compare-eax-and 0/imm32/false -11102 0f 84/jump-if-= $check-mu-get-stmt:error-too-few-outputs/disp32 -11103 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax -11104 89/<- %edi 0/r32/eax -11105 $check-mu-get-stmt:check-output-type: -11106 # - check output type -11107 # must be in register -11108 (lookup *(edi+0x18) *(edi+0x1c)) # Var-register Var-register => eax -11109 3d/compare-eax-and 0/imm32 -11110 0f 84/jump-if-= $check-mu-get-stmt:error-output-not-in-register/disp32 -11111 # must have a non-atomic type -11112 (lookup *(edi+8) *(edi+0xc)) # Var-type Var-type => eax -11113 81 7/subop/compare *eax 0/imm32/false # Tree-is-atom -11114 0f 85/jump-if-!= $check-mu-get-stmt:error-output-type-not-address/disp32 -11115 # type must start with (addr ...) -11116 (lookup *(eax+4) *(eax+8)) # Tree-left Tree-left => eax -11117 (is-simple-mu-type? %eax 2) # => eax -11118 3d/compare-eax-and 0/imm32/false -11119 0f 84/jump-if-= $check-mu-get-stmt:error-output-type-not-address/disp32 -11120 $check-mu-get-stmt:check-output-type-match: -11121 # payload of addr type must match 'type' definition -11122 (lookup *(edi+8) *(edi+0xc)) # Var-type Var-type => eax -11123 (lookup *(eax+0xc) *(eax+0x10)) # Tree-right Tree-right => eax -11124 # if (payload->right == null) payload = payload->left -11125 81 7/subop/compare *(eax+0xc) 0/imm32/null # Tree-right -11126 { -11127 75/jump-if-!= break/disp8 -11128 (lookup *(eax+4) *(eax+8)) # Tree-left Tree-left => eax -11129 } -11130 89/<- %edi 0/r32/eax -11131 # . var output-name/ecx: (addr array byte) -11132 (lookup *ecx *(ecx+4)) # Var-name Var-name => eax -11133 89/<- %ecx 0/r32/eax -11134 # . var base-typeinfo-entry/eax: (addr handle typeinfo-entry) -11135 (lookup *(edx+4) *(edx+8)) # Typeinfo-fields Typeinfo-fields => eax -11136 (get %eax %ecx 0x10) # => eax -11137 # . -11138 (lookup *eax *(eax+4)) # => eax -11139 (lookup *eax *(eax+4)) # Typeinfo-entry-input-var Typeinfo-entry-input-var => eax -11140 (lookup *(eax+8) *(eax+0xc)) # Var-type Var-type => eax -11141 # . -11142 (type-equal? %edi %eax) # => eax -11143 3d/compare-eax-and 0/imm32/false -11144 0f 84/jump-if-= $check-mu-get-stmt:error-bad-output-type/disp32 -11145 # - check for too many outputs -11146 (lookup *(esi+0x14) *(esi+0x18)) # Stmt1-outputs Stmt1-outputs => eax -11147 (lookup *(eax+8) *(eax+0xc)) # Stmt-var-next Stmt-var-next => eax -11148 3d/compare-eax-and 0/imm32/false -11149 0f 85/jump-if-!= $check-mu-get-stmt:error-too-many-outputs/disp32 -11150 $check-mu-get-stmt:end: -11151 # . restore registers -11152 5f/pop-to-edi -11153 5e/pop-to-esi -11154 5b/pop-to-ebx -11155 5a/pop-to-edx -11156 59/pop-to-ecx -11157 58/pop-to-eax -11158 # . epilogue -11159 89/<- %esp 5/r32/ebp -11160 5d/pop-to-ebp -11161 c3/return -11162 -11163 $check-mu-get-stmt:error-too-few-inouts: -11164 (write-buffered *(ebp+0x10) "fn ") -11165 8b/-> *(ebp+0xc) 0/r32/eax -11166 (lookup *eax *(eax+4)) # Function-name Function-name => eax -11167 (write-buffered *(ebp+0x10) %eax) -11168 (write-buffered *(ebp+0x10) ": stmt get: too few inouts (2 required)\n") -11169 (flush *(ebp+0x10)) -11170 (stop *(ebp+0x14) 1) -11171 # never gets here -11172 -11173 $check-mu-get-stmt:error-too-many-inouts: -11174 (write-buffered *(ebp+0x10) "fn ") -11175 8b/-> *(ebp+0xc) 0/r32/eax -11176 (lookup *eax *(eax+4)) # Function-name Function-name => eax -11177 (write-buffered *(ebp+0x10) %eax) -11178 (write-buffered *(ebp+0x10) ": stmt get: too many inouts (2 required)\n") -11179 (flush *(ebp+0x10)) -11180 (stop *(ebp+0x14) 1) -11181 # never gets here +11060 # if (op == "address") check-mu-address-stmt +11061 { +11062 (string-equal? %ecx "address") # => eax +11063 3d/compare-eax-and 0/imm32/false +11064 74/jump-if-= break/disp8 +11065 (check-mu-address-stmt *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) +11066 e9/jump $check-mu-primitive:end/disp32 +11067 } +11068 # if (op == "get") check-mu-get-stmt +11069 { +11070 (string-equal? %ecx "get") # => eax +11071 3d/compare-eax-and 0/imm32/false +11072 74/jump-if-= break/disp8 +11073 (check-mu-get-stmt *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) +11074 e9/jump $check-mu-primitive:end/disp32 +11075 } +11076 # if (op == "index") check-mu-index-stmt +11077 { +11078 (string-equal? %ecx "index") # => eax +11079 3d/compare-eax-and 0/imm32/false +11080 74/jump-if-= break/disp8 +11081 (check-mu-index-stmt *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) +11082 e9/jump $check-mu-primitive:end/disp32 +11083 } +11084 # if (op == "length") check-mu-length-stmt +11085 { +11086 (string-equal? %ecx "length") # => eax +11087 3d/compare-eax-and 0/imm32/false +11088 74/jump-if-= break/disp8 +11089 (check-mu-length-stmt *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) +11090 e9/jump $check-mu-primitive:end/disp32 +11091 } +11092 # if (op == "compute-offset") check-mu-compute-offset-stmt +11093 { +11094 (string-equal? %ecx "compute-offset") # => eax +11095 3d/compare-eax-and 0/imm32/false +11096 74/jump-if-= break/disp8 +11097 (check-mu-compute-offset-stmt *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) +11098 e9/jump $check-mu-primitive:end/disp32 +11099 } +11100 # if (op == "lookup") check-mu-lookup-stmt +11101 { +11102 (string-equal? %ecx "lookup") # => eax +11103 3d/compare-eax-and 0/imm32/false +11104 74/jump-if-= break/disp8 +11105 (check-mu-lookup-stmt *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) +11106 e9/jump $check-mu-primitive:end/disp32 +11107 } +11108 # otherwise check-numberlike-stmt +11109 (check-mu-numberlike-primitive *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) +11110 $check-mu-primitive:end: +11111 # . restore registers +11112 59/pop-to-ecx +11113 58/pop-to-eax +11114 # . epilogue +11115 89/<- %esp 5/r32/ebp +11116 5d/pop-to-ebp +11117 c3/return +11118 +11119 # by default, Mu primitives should only operate on 'number-like' types +11120 check-mu-numberlike-primitive: # stmt: (addr stmt), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) +11121 # . prologue +11122 55/push-ebp +11123 89/<- %ebp 4/r32/esp +11124 # . save registers +11125 50/push-eax +11126 51/push-ecx +11127 56/push-esi +11128 # esi = stmt +11129 8b/-> *(ebp+8) 6/r32/esi +11130 # var gas/ecx: int = 2 +11131 b9/copy-to-ecx 2/imm32 +11132 # - check at most 1 output +11133 # var output/eax: (addr stmt-var) = stmt->outputs +11134 (lookup *(esi+0x14) *(esi+0x18)) # Stmt1-outputs Stmt1-outputs => eax +11135 { +11136 3d/compare-eax-and 0/imm32 +11137 74/jump-if-= break/disp8 +11138 $check-mu-numberlike-primitive:output: +11139 (check-mu-numberlike-output %eax *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) +11140 (lookup *(eax+8) *(eax+0xc)) # Stmt-var-next Stmt-var-next => eax +11141 3d/compare-eax-and 0/imm32 +11142 0f 85/jump-if-!= $check-mu-numberlike-primitive:error-too-many-outputs/disp32 +11143 # check output is in a register +11144 # --gas +11145 49/decrement-ecx +11146 } +11147 # - check first inout +11148 (lookup *(esi+0xc) *(esi+0x10)) # Stmt1-inouts Stmt1-inouts => eax +11149 { +11150 3d/compare-eax-and 0/imm32 +11151 0f 84/jump-if-= $check-mu-numberlike-primitive:end/disp32 +11152 $check-mu-numberlike-primitive:first-inout: +11153 (check-mu-numberlike-arg %eax *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) +11154 # --gas +11155 49/decrement-ecx +11156 } +11157 # - check second inout +11158 (lookup *(eax+8) *(eax+0xc)) # Stmt-var-next Stmt-var-next => eax +11159 { +11160 3d/compare-eax-and 0/imm32 +11161 74/jump-if-= $check-mu-numberlike-primitive:end/disp8 +11162 $check-mu-numberlike-primitive:second-inout: +11163 # is a second inout allowed? +11164 81 7/subop/compare %ecx 0/imm32 +11165 0f 84/jump-if-= $check-mu-numberlike-primitive:error-too-many-inouts/disp32 +11166 $check-mu-numberlike-primitive:second-inout-permitted: +11167 (check-mu-numberlike-arg %eax *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) +11168 } +11169 $check-mu-numberlike-primitive:third-inout: +11170 # if there's a third arg, raise an error +11171 81 7/subop/compare *(eax+8) 0/imm32 # Stmt-var-next +11172 0f 85/jump-if-!= $check-mu-numberlike-primitive:error-too-many-inouts/disp32 +11173 $check-mu-numberlike-primitive:end: +11174 # . restore registers +11175 5e/pop-to-esi +11176 59/pop-to-ecx +11177 58/pop-to-eax +11178 # . epilogue +11179 89/<- %esp 5/r32/ebp +11180 5d/pop-to-ebp +11181 c3/return 11182 -11183 $check-mu-get-stmt:error-too-few-outputs: -11184 (write-buffered *(ebp+0x10) "fn ") +11183 $check-mu-numberlike-primitive:error-too-many-inouts: +11184 (write-buffered *(ebp+0x10) "fn ") 11185 8b/-> *(ebp+0xc) 0/r32/eax -11186 (lookup *eax *(eax+4)) # Function-name Function-name => eax -11187 (write-buffered *(ebp+0x10) %eax) -11188 (write-buffered *(ebp+0x10) ": stmt get: must have an output\n") -11189 (flush *(ebp+0x10)) -11190 (stop *(ebp+0x14) 1) -11191 # never gets here -11192 -11193 $check-mu-get-stmt:error-too-many-outputs: -11194 (write-buffered *(ebp+0x10) "fn ") -11195 8b/-> *(ebp+0xc) 0/r32/eax -11196 (lookup *eax *(eax+4)) # Function-name Function-name => eax -11197 (write-buffered *(ebp+0x10) %eax) -11198 (write-buffered *(ebp+0x10) ": stmt get: too many outputs (1 required)\n") -11199 (flush *(ebp+0x10)) -11200 (stop *(ebp+0x14) 1) -11201 # never gets here -11202 -11203 $check-mu-get-stmt:error-bad-base: -11204 # error("fn " fn ": stmt get: var '" base->name "' must have a 'type' definition\n") -11205 (write-buffered *(ebp+0x10) "fn ") -11206 8b/-> *(ebp+0xc) 0/r32/eax -11207 (lookup *eax *(eax+4)) # Function-name Function-name => eax -11208 (write-buffered *(ebp+0x10) %eax) -11209 (write-buffered *(ebp+0x10) ": stmt get: var '") -11210 (lookup *(esi+0xc) *(esi+0x10)) # Stmt1-inouts Stmt1-inouts => eax -11211 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax -11212 (lookup *eax *(eax+4)) # Var-name Var-name => eax -11213 (write-buffered *(ebp+0x10) %eax) -11214 (write-buffered *(ebp+0x10) "' must have a 'type' definition\n") -11215 (flush *(ebp+0x10)) -11216 (stop *(ebp+0x14) 1) -11217 # never gets here -11218 -11219 $check-mu-get-stmt:error-base-type-addr-but-not-register: -11220 (write-buffered *(ebp+0x10) "fn ") -11221 8b/-> *(ebp+0xc) 0/r32/eax -11222 (lookup *eax *(eax+4)) # Function-name Function-name => eax -11223 (write-buffered *(ebp+0x10) %eax) -11224 (write-buffered *(ebp+0x10) ": stmt get: var '") -11225 (lookup *(esi+0xc) *(esi+0x10)) # Stmt1-inouts Stmt1-inouts => eax -11226 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax -11227 (lookup *eax *(eax+4)) # Var-name Var-name => eax -11228 (write-buffered *(ebp+0x10) %eax) -11229 (write-buffered *(ebp+0x10) "' is an 'addr' type, and so must live in a register\n") -11230 (flush *(ebp+0x10)) -11231 (stop *(ebp+0x14) 1) -11232 # never gets here -11233 -11234 $check-mu-get-stmt:error-bad-field: -11235 # error("fn " fn ": stmt get: type " type " has no member called '" curr->name "'\n") -11236 (write-buffered *(ebp+0x10) "fn ") -11237 8b/-> *(ebp+0xc) 0/r32/eax -11238 (lookup *eax *(eax+4)) # Function-name Function-name => eax -11239 (write-buffered *(ebp+0x10) %eax) -11240 (write-buffered *(ebp+0x10) ": stmt get: type '") -11241 # . write(Type-id->data[tmp]) -11242 bf/copy-to-edi Type-id/imm32 -11243 (write-buffered *(ebp+0x10) *(edi+ebx<<2+0xc)) -11244 # . -11245 (write-buffered *(ebp+0x10) "' has no member called '") -11246 (lookup *ecx *(ecx+4)) # Var-name Var-name => eax -11247 (write-buffered *(ebp+0x10) %eax) -11248 (write-buffered *(ebp+0x10) "'\n") -11249 (flush *(ebp+0x10)) -11250 (stop *(ebp+0x14) 1) -11251 # never gets here -11252 -11253 $check-mu-get-stmt:error-output-not-in-register: -11254 (write-buffered *(ebp+0x10) "fn ") -11255 8b/-> *(ebp+0xc) 0/r32/eax -11256 (lookup *eax *(eax+4)) # Function-name Function-name => eax -11257 (write-buffered *(ebp+0x10) %eax) -11258 (write-buffered *(ebp+0x10) ": stmt get: output '") -11259 (lookup *edi *(edi+4)) # Var-name Var-name => eax -11260 (write-buffered *(ebp+0x10) %eax) -11261 (write-buffered *(ebp+0x10) "' is not in a register\n") -11262 (flush *(ebp+0x10)) -11263 (stop *(ebp+0x14) 1) -11264 # never gets here -11265 -11266 $check-mu-get-stmt:error-output-type-not-address: -11267 (write-buffered *(ebp+0x10) "fn ") -11268 8b/-> *(ebp+0xc) 0/r32/eax -11269 (lookup *eax *(eax+4)) # Function-name Function-name => eax -11270 (write-buffered *(ebp+0x10) %eax) -11271 (write-buffered *(ebp+0x10) ": stmt get: output must be an address\n") -11272 (flush *(ebp+0x10)) -11273 (stop *(ebp+0x14) 1) -11274 # never gets here -11275 -11276 $check-mu-get-stmt:error-bad-output-type: -11277 (write-buffered *(ebp+0x10) "fn ") -11278 8b/-> *(ebp+0xc) 0/r32/eax -11279 (lookup *eax *(eax+4)) # Function-name Function-name => eax -11280 (write-buffered *(ebp+0x10) %eax) -11281 (write-buffered *(ebp+0x10) ": stmt get: wrong output type for member '") -11282 (write-buffered *(ebp+0x10) %ecx) -11283 (write-buffered *(ebp+0x10) "' of type '") -11284 bf/copy-to-edi Type-id/imm32 -11285 (write-buffered *(ebp+0x10) *(edi+ebx<<2+0xc)) -11286 (write-buffered *(ebp+0x10) "'\n") -11287 (flush *(ebp+0x10)) -11288 (stop *(ebp+0x14) 1) -11289 # never gets here -11290 -11291 check-mu-index-stmt: # stmt: (addr stmt), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) -11292 # . prologue -11293 55/push-ebp -11294 89/<- %ebp 4/r32/esp -11295 # . save registers -11296 $check-mu-index-stmt:end: -11297 # . restore registers -11298 # . epilogue -11299 89/<- %esp 5/r32/ebp -11300 5d/pop-to-ebp -11301 c3/return -11302 -11303 check-mu-length-stmt: # stmt: (addr stmt), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) -11304 # . prologue -11305 55/push-ebp -11306 89/<- %ebp 4/r32/esp -11307 # . save registers -11308 $check-mu-length-stmt:end: -11309 # . restore registers -11310 # . epilogue -11311 89/<- %esp 5/r32/ebp -11312 5d/pop-to-ebp -11313 c3/return -11314 -11315 check-mu-compute-offset-stmt: # stmt: (addr stmt), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) -11316 # . prologue -11317 55/push-ebp -11318 89/<- %ebp 4/r32/esp -11319 # . save registers -11320 $check-mu-compute-offset-stmt:end: -11321 # . restore registers -11322 # . epilogue -11323 89/<- %esp 5/r32/ebp -11324 5d/pop-to-ebp -11325 c3/return -11326 -11327 check-mu-lookup-stmt: # stmt: (addr stmt), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) -11328 # . prologue -11329 55/push-ebp -11330 89/<- %ebp 4/r32/esp -11331 # . save registers -11332 $check-mu-lookup-stmt:end: -11333 # . restore registers -11334 # . epilogue -11335 89/<- %esp 5/r32/ebp -11336 5d/pop-to-ebp -11337 c3/return -11338 -11339 check-mu-call: # stmt: (addr stmt), callee: (addr function), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) -11340 # . prologue -11341 55/push-ebp -11342 89/<- %ebp 4/r32/esp -11343 # . save registers -11344 50/push-eax -11345 51/push-ecx -11346 52/push-edx -11347 53/push-ebx -11348 56/push-esi -11349 57/push-edi -11350 # esi = stmt -11351 8b/-> *(ebp+8) 6/r32/esi -11352 # edi = callee -11353 8b/-> *(ebp+0xc) 7/r32/edi -11354 # var inouts/ecx: (addr stmt-var) = lookup(stmt->inouts) -11355 (lookup *(esi+0xc) *(esi+0x10)) # Stmt1-inouts Stmt1-inouts => eax -11356 89/<- %ecx 0/r32/eax -11357 # var expected/edx: (addr list var) = lookup(f->inouts) -11358 (lookup *(edi+8) *(edi+0xc)) # Function-inouts Function-inouts => eax -11359 89/<- %edx 0/r32/eax -11360 { -11361 $check-mu-call:check-for-inouts: -11362 # if (inouts == 0) break -11363 81 7/subop/compare %ecx 0/imm32 -11364 0f 84/jump-if-= break/disp32 -11365 # if (expected == 0) error -11366 81 7/subop/compare %edx 0/imm32 -11367 0f 84/jump-if-= break/disp32 -11368 $check-mu-call:check-inout-type: -11369 # var v/eax: (addr v) = lookup(inouts->value) -11370 (lookup *ecx *(ecx+4)) # Stmt-var-value Stmt-var-value => eax -11371 # var t/ebx: (addr tree type-id) = lookup(v->type) -11372 (lookup *(eax+8) *(eax+0xc)) # Var-type Var-type => eax -11373 89/<- %ebx 0/r32/eax -11374 # if (inouts->is-deref?) t = t->right # TODO: check that t->left is an addr -11375 81 7/subop/compare *(ecx+0x10) 0/imm32/false # Stmt-var-is-deref -11376 { -11377 74/jump-if-= break/disp8 -11378 (lookup *(ebx+0xc) *(ebx+0x10)) # Tree-right Tree-right => eax -11379 89/<- %ebx 0/r32/eax -11380 # if t->right is null, t = t->left -11381 81 7/subop/compare *(ebx+0xc) 0/imm32 # Tree-right -11382 75/jump-if-!= break/disp8 -11383 (lookup *(ebx+4) *(ebx+8)) # Tree-left Tree-left => eax -11384 89/<- %ebx 0/r32/eax -11385 } -11386 # var v2/eax: (addr v) = lookup(expected->value) -11387 (lookup *edx *(edx+4)) # List-value List-value => eax -11388 # var t2/eax: (addr tree type-id) = lookup(v2->type) -11389 (lookup *(eax+8) *(eax+0xc)) # Var-type Var-type => eax -11390 # if (t != t2) error -11391 (type-match? %eax %ebx) # => eax -11392 3d/compare-eax-and 0/imm32/false -11393 { -11394 0f 85/jump-if-!= break/disp32 -11395 (write-buffered *(ebp+0x14) "fn ") -11396 8b/-> *(ebp+0x10) 0/r32/eax -11397 (lookup *eax *(eax+4)) # Function-name Function-name => eax -11398 (write-buffered *(ebp+0x14) %eax) -11399 (write-buffered *(ebp+0x14) ": call ") -11400 (lookup *edi *(edi+4)) # Function-name Function-name => eax -11401 (write-buffered *(ebp+0x14) %eax) -11402 (write-buffered *(ebp+0x14) ": type for inout '") -11403 (lookup *ecx *(ecx+4)) # Stmt-var-value Stmt-var-value => eax -11404 (lookup *eax *(eax+4)) # Var-name Var-name => eax -11405 (write-buffered *(ebp+0x14) %eax) -11406 (write-buffered *(ebp+0x14) "' is not right\n") -11407 (flush *(ebp+0x14)) -11408 (stop *(ebp+0x18) 1) -11409 } -11410 $check-mu-call:continue-to-next-inout: -11411 # inouts = lookup(inouts->next) -11412 (lookup *(ecx+8) *(ecx+0xc)) # Stmt-var-next Stmt-var-next => eax -11413 89/<- %ecx 0/r32/eax -11414 # expected = lookup(expected->next) -11415 (lookup *(edx+8) *(edx+0xc)) # List-next List-next => eax -11416 89/<- %edx 0/r32/eax -11417 # -11418 e9/jump loop/disp32 -11419 } -11420 $check-mu-call:check-inout-count: -11421 # if (inouts == expected) proceed -11422 39/compare %ecx 2/r32/edx -11423 { -11424 0f 84/jump-if-= break/disp32 -11425 # exactly one of the two is null -11426 # if (inouts == 0) error("too many inouts") -11427 { -11428 81 7/subop/compare %ecx 0/imm32 -11429 0f 84/jump-if-= break/disp32 -11430 (write-buffered *(ebp+0x14) "fn ") -11431 8b/-> *(ebp+0x10) 0/r32/eax -11432 (lookup *eax *(eax+4)) # Function-name Function-name => eax -11433 (write-buffered *(ebp+0x14) %eax) -11434 (write-buffered *(ebp+0x14) ": call ") -11435 (lookup *edi *(edi+4)) # Function-name Function-name => eax -11436 (write-buffered *(ebp+0x14) %eax) -11437 (write-buffered *(ebp+0x14) ": too many inouts\n") -11438 (flush *(ebp+0x14)) -11439 (stop *(ebp+0x18) 1) -11440 } -11441 # if (expected == 0) error("too few inouts") -11442 { -11443 81 7/subop/compare %edx 0/imm32 -11444 0f 84/jump-if-= break/disp32 -11445 (write-buffered *(ebp+0x14) "fn ") -11446 8b/-> *(ebp+0x10) 0/r32/eax -11447 (lookup *eax *(eax+4)) # Function-name Function-name => eax -11448 (write-buffered *(ebp+0x14) %eax) -11449 (write-buffered *(ebp+0x14) ": call ") -11450 (lookup *edi *(edi+4)) # Function-name Function-name => eax -11451 (write-buffered *(ebp+0x14) %eax) -11452 (write-buffered *(ebp+0x14) ": too few inouts\n") -11453 (flush *(ebp+0x14)) -11454 (stop *(ebp+0x18) 1) -11455 } -11456 } -11457 $check-mu-call:check-outputs: -11458 # var outputs/ecx: (addr stmt-var) = lookup(stmt->outputs) -11459 (lookup *(esi+0x14) *(esi+0x18)) # Stmt1-outputs Stmt1-outputs => eax -11460 89/<- %ecx 0/r32/eax -11461 # var expected/edx: (addr list var) = lookup(f->outputs) -11462 (lookup *(edi+0x10) *(edi+0x14)) # Function-outputs Function-outputs => eax -11463 89/<- %edx 0/r32/eax -11464 { -11465 $check-mu-call:check-for-outputs: -11466 # if (outputs == 0) break -11467 81 7/subop/compare %ecx 0/imm32 -11468 0f 84/jump-if-= break/disp32 -11469 # if (expected == 0) error -11470 81 7/subop/compare %edx 0/imm32 -11471 0f 84/jump-if-= break/disp32 -11472 $check-mu-call:check-output-type: -11473 # var v/eax: (addr v) = lookup(outputs->value) -11474 (lookup *ecx *(ecx+4)) # Stmt-var-value Stmt-var-value => eax -11475 # var t/ebx: (addr tree type-id) = lookup(v->type) -11476 (lookup *(eax+8) *(eax+0xc)) # Var-type Var-type => eax -11477 89/<- %ebx 0/r32/eax -11478 # if (outputs->is-deref?) t = t->right # TODO: check that t->left is an addr -11479 81 7/subop/compare *(ecx+0x10) 0/imm32/false # Stmt-var-is-deref -11480 { -11481 74/jump-if-= break/disp8 -11482 (lookup *(ebx+0xc) *(ebx+0x10)) # Tree-right Tree-right => eax -11483 89/<- %ebx 0/r32/eax -11484 } -11485 # var v2/eax: (addr v) = lookup(expected->value) -11486 (lookup *edx *(edx+4)) # List-value List-value => eax -11487 # var t2/eax: (addr tree type-id) = lookup(v2->type) -11488 (lookup *(eax+8) *(eax+0xc)) # Var-type Var-type => eax -11489 # if (t != t2) error -11490 (type-equal? %eax %ebx) # => eax -11491 3d/compare-eax-and 0/imm32/false -11492 { -11493 0f 85/jump-if-!= break/disp32 -11494 (write-buffered *(ebp+0x14) "fn ") -11495 8b/-> *(ebp+0x10) 0/r32/eax -11496 (lookup *eax *(eax+4)) # Function-name Function-name => eax -11497 (write-buffered *(ebp+0x14) %eax) -11498 (write-buffered *(ebp+0x14) ": call ") -11499 (lookup *edi *(edi+4)) # Function-name Function-name => eax -11500 (write-buffered *(ebp+0x14) %eax) -11501 (write-buffered *(ebp+0x14) ": type for output '") -11502 (lookup *ecx *(ecx+4)) # Stmt-var-value Stmt-var-value => eax -11503 (lookup *eax *(eax+4)) # Var-name Var-name => eax -11504 (write-buffered *(ebp+0x14) %eax) -11505 (write-buffered *(ebp+0x14) "' is not right\n") -11506 (flush *(ebp+0x14)) -11507 (stop *(ebp+0x18) 1) -11508 } -11509 $check-mu-call:check-output-register: -11510 # var v/eax: (addr v) = lookup(outputs->value) -11511 (lookup *ecx *(ecx+4)) # Stmt-var-value Stmt-var-value => eax -11512 # var r/ebx: (addr array byte) = lookup(v->register) -11513 (lookup *(eax+18) *(eax+0x1c)) # Var-register Var-register => eax -11514 89/<- %ebx 0/r32/eax -11515 # var v2/eax: (addr v) = lookup(expected->value) -11516 (lookup *edx *(edx+4)) # Stmt-var-value Stmt-var-value => eax -11517 # var r2/eax: (addr array byte) = lookup(v2->register) -11518 (lookup *(eax+18) *(eax+0x1c)) # Var-register Var-register => eax -11519 # if (r != r2) error -11520 (string-equal? %eax %ebx) # => eax -11521 3d/compare-eax-and 0/imm32/false -11522 { -11523 0f 85/jump-if-!= break/disp32 -11524 (write-buffered *(ebp+0x14) "fn ") -11525 8b/-> *(ebp+0x10) 0/r32/eax -11526 (lookup *eax *(eax+4)) # Function-name Function-name => eax -11527 (write-buffered *(ebp+0x14) %eax) -11528 (write-buffered *(ebp+0x14) ": call ") -11529 (lookup *edi *(edi+4)) # Function-name Function-name => eax -11530 (write-buffered *(ebp+0x14) %eax) -11531 (write-buffered *(ebp+0x14) ": register for output '") -11532 (lookup *ecx *(ecx+4)) # Stmt-var-value Stmt-var-value => eax -11533 (lookup *eax *(eax+4)) # Var-name Var-name => eax -11534 (write-buffered *(ebp+0x14) %eax) -11535 (write-buffered *(ebp+0x14) "' is not right\n") -11536 (flush *(ebp+0x14)) -11537 (stop *(ebp+0x18) 1) -11538 } -11539 $check-mu-call:continue-to-next-output: -11540 # outputs = lookup(outputs->next) -11541 (lookup *(ecx+8) *(ecx+0xc)) # Stmt-var-next Stmt-var-next => eax -11542 89/<- %ecx 0/r32/eax -11543 # expected = lookup(expected->next) -11544 (lookup *(edx+8) *(edx+0xc)) # List-next List-next => eax -11545 89/<- %edx 0/r32/eax -11546 # -11547 e9/jump loop/disp32 -11548 } -11549 $check-mu-call:check-output-count: -11550 # if (outputs == expected) proceed -11551 39/compare %ecx 2/r32/edx -11552 { -11553 0f 84/jump-if-= break/disp32 -11554 # exactly one of the two is null -11555 # if (outputs == 0) error("too many outputs") -11556 { -11557 81 7/subop/compare %ecx 0/imm32 -11558 0f 84/jump-if-= break/disp32 -11559 (write-buffered *(ebp+0x14) "fn ") -11560 8b/-> *(ebp+0x10) 0/r32/eax -11561 (lookup *eax *(eax+4)) # Function-name Function-name => eax -11562 (write-buffered *(ebp+0x14) %eax) -11563 (write-buffered *(ebp+0x14) ": call ") -11564 (lookup *edi *(edi+4)) # Function-name Function-name => eax -11565 (write-buffered *(ebp+0x14) %eax) -11566 (write-buffered *(ebp+0x14) ": too many outputs\n") -11567 (flush *(ebp+0x14)) -11568 (stop *(ebp+0x18) 1) -11569 } -11570 # if (expected == 0) error("too few outputs") -11571 { -11572 81 7/subop/compare %edx 0/imm32 -11573 0f 84/jump-if-= break/disp32 -11574 (write-buffered *(ebp+0x14) "fn ") -11575 8b/-> *(ebp+0x10) 0/r32/eax -11576 (lookup *eax *(eax+4)) # Function-name Function-name => eax -11577 (write-buffered *(ebp+0x14) %eax) -11578 (write-buffered *(ebp+0x14) ": call ") -11579 (lookup *edi *(edi+4)) # Function-name Function-name => eax -11580 (write-buffered *(ebp+0x14) %eax) -11581 (write-buffered *(ebp+0x14) ": too few outputs\n") -11582 (flush *(ebp+0x14)) -11583 (stop *(ebp+0x18) 1) -11584 } -11585 } -11586 $check-mu-call:end: -11587 # . restore registers -11588 5f/pop-to-edi -11589 5e/pop-to-esi -11590 5b/pop-to-ebx -11591 5a/pop-to-edx -11592 59/pop-to-ecx -11593 58/pop-to-eax -11594 # . epilogue -11595 89/<- %esp 5/r32/ebp -11596 5d/pop-to-ebp -11597 c3/return -11598 -11599 # like type-equal? but takes literals into account -11600 type-match?: # def: (addr tree type-id), call: (addr tree type-id) -> result/eax: boolean -11601 # . prologue -11602 55/push-ebp -11603 89/<- %ebp 4/r32/esp -11604 # if (call == literal) return true # TODO: more precise -11605 (is-simple-mu-type? *(ebp+0xc) 0) # literal => eax -11606 3d/compare-eax-and 0/imm32/false -11607 b8/copy-to-eax 1/imm32/true -11608 75/jump-if-!= $type-match?:end/disp8 -11609 $type-match?:baseline: -11610 # otherwise fall back -11611 (type-equal? *(ebp+8) *(ebp+0xc)) # => eax -11612 $type-match?:end: -11613 # . epilogue -11614 89/<- %esp 5/r32/ebp -11615 5d/pop-to-ebp -11616 c3/return -11617 -11618 size-of: # v: (addr var) -> result/eax: int -11619 # . prologue -11620 55/push-ebp -11621 89/<- %ebp 4/r32/esp -11622 # . save registers -11623 51/push-ecx -11624 # var t/ecx: (addr tree type-id) = lookup(v->type) -11625 8b/-> *(ebp+8) 1/r32/ecx -11626 #? (write-buffered Stderr "size-of ") -11627 #? (write-int32-hex-buffered Stderr %ecx) -11628 #? (write-buffered Stderr Newline) -11629 #? (write-buffered Stderr "type allocid: ") -11630 #? (write-int32-hex-buffered Stderr *(ecx+8)) -11631 #? (write-buffered Stderr Newline) -11632 #? (flush Stderr) -11633 (lookup *(ecx+8) *(ecx+0xc)) # Var-type Var-type => eax -11634 89/<- %ecx 0/r32/eax -11635 # if is-mu-array?(t) return size-of-array(t) -11636 { -11637 (is-mu-array? %ecx) # => eax -11638 3d/compare-eax-and 0/imm32/false -11639 74/jump-if-= break/disp8 -11640 (size-of-array %ecx) # => eax -11641 eb/jump $size-of:end/disp8 -11642 } -11643 # if (!t->is-atom?) t = lookup(t->left) -11644 { -11645 81 7/subop/compare *ecx 0/imm32/false # Tree-is-atom -11646 75/jump-if-!= break/disp8 -11647 (lookup *(ecx+4) *(ecx+8)) # Tree-left Tree-left => eax -11648 89/<- %ecx 0/r32/eax -11649 } -11650 # TODO: assert t->is-atom? -11651 (size-of-type-id *(ecx+4)) # Tree-value => eax -11652 $size-of:end: -11653 # . restore registers -11654 59/pop-to-ecx -11655 # . epilogue -11656 89/<- %esp 5/r32/ebp -11657 5d/pop-to-ebp -11658 c3/return -11659 -11660 size-of-deref: # v: (addr var) -> result/eax: int -11661 # . prologue -11662 55/push-ebp -11663 89/<- %ebp 4/r32/esp -11664 # . save registers -11665 51/push-ecx -11666 # var t/ecx: (addr tree type-id) = lookup(v->type) -11667 8b/-> *(ebp+8) 1/r32/ecx -11668 (lookup *(ecx+8) *(ecx+0xc)) # Var-type Var-type => eax -11669 89/<- %ecx 0/r32/eax -11670 # TODO: assert(t is an addr) -11671 # t = lookup(t->right) -11672 (lookup *(ecx+0xc) *(ecx+0x10)) # Tree-right Tree-right => eax -11673 89/<- %ecx 0/r32/eax -11674 # if is-mu-array?(t) return size-of-array(t) -11675 { -11676 (is-mu-array? %ecx) # => eax -11677 3d/compare-eax-and 0/imm32/false -11678 74/jump-if-= break/disp8 -11679 (size-of-array %ecx) # => eax -11680 eb/jump $size-of:end/disp8 -11681 } -11682 # if (!t->is-atom?) t = lookup(t->left) -11683 { -11684 81 7/subop/compare *ecx 0/imm32/false # Tree-is-atom -11685 75/jump-if-!= break/disp8 -11686 (lookup *(ecx+4) *(ecx+8)) # Tree-left Tree-left => eax -11687 89/<- %ecx 0/r32/eax -11688 } -11689 # TODO: assert t->is-atom? -11690 (size-of-type-id *(ecx+4)) # Tree-value => eax -11691 $size-of-deref:end: -11692 # . restore registers -11693 59/pop-to-ecx -11694 # . epilogue -11695 89/<- %esp 5/r32/ebp -11696 5d/pop-to-ebp -11697 c3/return -11698 -11699 is-mu-array?: # t: (addr tree type-id) -> result/eax: boolean -11700 # . prologue -11701 55/push-ebp -11702 89/<- %ebp 4/r32/esp -11703 # . save registers -11704 51/push-ecx -11705 # ecx = t -11706 8b/-> *(ebp+8) 1/r32/ecx -11707 # if t->is-atom?, return false -11708 81 7/subop/compare *ecx 0/imm32/false # Tree-is-atom -11709 75/jump-if-!= $is-mu-array?:return-false/disp8 -11710 # if !t->left->is-atom?, return false -11711 (lookup *(ecx+4) *(ecx+8)) # Tree-left Tree-left => eax -11712 81 7/subop/compare *eax 0/imm32/false # Tree-is-atom -11713 74/jump-if-= $is-mu-array?:return-false/disp8 -11714 # return t->left->value == array -11715 81 7/subop/compare *(eax+4) 3/imm32/array-type-id # Tree-value -11716 0f 94/set-if-= %al -11717 81 4/subop/and %eax 0xff/imm32 -11718 eb/jump $is-mu-array?:end/disp8 -11719 $is-mu-array?:return-false: -11720 b8/copy-to-eax 0/imm32/false -11721 $is-mu-array?:end: -11722 # . restore registers -11723 59/pop-to-ecx -11724 # . epilogue -11725 89/<- %esp 5/r32/ebp -11726 5d/pop-to-ebp -11727 c3/return -11728 -11729 size-of-array: # a: (addr tree type-id) -> result/eax: int -11730 # . prologue -11731 55/push-ebp -11732 89/<- %ebp 4/r32/esp -11733 # . save registers -11734 51/push-ecx -11735 52/push-edx -11736 # -11737 8b/-> *(ebp+8) 1/r32/ecx -11738 # TODO: assert that a->left is 'array' -11739 (lookup *(ecx+0xc) *(ecx+0x10)) # Tree-right Tree-right => eax -11740 89/<- %ecx 0/r32/eax -11741 # var elem-type/edx: type-id = a->right->left->value -11742 (lookup *(ecx+4) *(ecx+8)) # Tree-left Tree-left => eax -11743 8b/-> *(eax+4) 2/r32/edx # Tree-value -11744 # var array-size/ecx: int = a->right->right->left->value -11745 (lookup *(ecx+0xc) *(ecx+0x10)) # Tree-right Tree-right => eax -11746 (lookup *(eax+4) *(eax+8)) # Tree-left Tree-left => eax -11747 8b/-> *(eax+4) 1/r32/ecx # Tree-value -11748 # return array-size * size-of(elem-type) -11749 (size-of-type-id-as-array-element %edx) # => eax -11750 f7 4/subop/multiply-into-eax %ecx -11751 05/add-to-eax 4/imm32 # for array size -11752 $size-of-array:end: -11753 # . restore registers -11754 5a/pop-to-edx -11755 59/pop-to-ecx -11756 # . epilogue -11757 89/<- %esp 5/r32/ebp -11758 5d/pop-to-ebp -11759 c3/return -11760 -11761 size-of-type-id: # t: type-id -> result/eax: int -11762 # . prologue -11763 55/push-ebp -11764 89/<- %ebp 4/r32/esp -11765 # . save registers -11766 51/push-ecx -11767 # var out/ecx: (handle typeinfo) -11768 68/push 0/imm32 -11769 68/push 0/imm32 -11770 89/<- %ecx 4/r32/esp -11771 # eax = t -11772 8b/-> *(ebp+8) 0/r32/eax -11773 # if t is a literal, return 0 -11774 3d/compare-eax-and 0/imm32 -11775 0f 84/jump-if-= $size-of-type-id:end/disp32 # eax changes type from type-id to int -11776 # if t is a byte, return 4 (because we don't really support non-multiples of 4) -11777 3d/compare-eax-and 8/imm32/byte -11778 { -11779 75/jump-if-!= break/disp8 -11780 b8/copy-to-eax 4/imm32 -11781 eb/jump $size-of-type-id:end/disp8 -11782 } -11783 # if t is a handle, return 8 -11784 3d/compare-eax-and 4/imm32/handle -11785 { -11786 75/jump-if-!= break/disp8 -11787 b8/copy-to-eax 8/imm32 -11788 eb/jump $size-of-type-id:end/disp8 # eax changes type from type-id to int -11789 } -11790 # if t is a user-defined type, return its size -11791 # TODO: support non-atom type -11792 (find-typeinfo %eax %ecx) -11793 { -11794 81 7/subop/compare *ecx 0/imm32 -11795 74/jump-if-= break/disp8 -11796 $size-of-type-id:user-defined: -11797 (lookup *ecx *(ecx+4)) # => eax -11798 8b/-> *(eax+0xc) 0/r32/eax # Typeinfo-total-size-in-bytes -11799 eb/jump $size-of-type-id:end/disp8 -11800 } -11801 # otherwise return the word size -11802 b8/copy-to-eax 4/imm32 -11803 $size-of-type-id:end: -11804 # . reclaim locals -11805 81 0/subop/add %esp 8/imm32 -11806 # . restore registers -11807 59/pop-to-ecx -11808 # . epilogue -11809 89/<- %esp 5/r32/ebp -11810 5d/pop-to-ebp -11811 c3/return -11812 -11813 type-equal?: # a: (addr tree type-id), b: (addr tree type-id) -> result/eax: boolean -11814 # . prologue -11815 55/push-ebp -11816 89/<- %ebp 4/r32/esp -11817 # . save registers -11818 51/push-ecx -11819 52/push-edx -11820 53/push-ebx -11821 # ecx = a -11822 8b/-> *(ebp+8) 1/r32/ecx -11823 # edx = b -11824 8b/-> *(ebp+0xc) 2/r32/edx -11825 $type-equal?:compare-addr: -11826 # if (a == b) return true -11827 8b/-> %ecx 0/r32/eax # Var-type -11828 39/compare %edx 0/r32/eax # Var-type -11829 b8/copy-to-eax 1/imm32/true -11830 0f 84/jump-if-= $type-equal?:end/disp32 -11831 $type-equal?:compare-atom-state: -11832 # if (a->is-atom? != b->is-atom?) return false -11833 8b/-> *ecx 3/r32/ebx # Tree-value -11834 39/compare *edx 3/r32/ebx # Tree-value -11835 b8/copy-to-eax 0/imm32/false -11836 0f 85/jump-if-!= $type-equal?:end/disp32 -11837 # if a->is-atom? return (a->value == b->value) -11838 { -11839 $type-equal?:check-atom: -11840 81 7/subop/compare %ebx 0/imm32/false -11841 74/jump-if-= break/disp8 -11842 $type-equal?:is-atom: -11843 8b/-> *(ecx+4) 0/r32/eax # Tree-value -11844 39/compare *(edx+4) 0/r32/eax # Tree-value -11845 0f 94/set-if-= %al -11846 81 4/subop/and %eax 0xff/imm32 -11847 e9/jump $type-equal?:end/disp32 -11848 } -11849 $type-equal?:check-left: -11850 # if (!type-equal?(a->left, b->left)) return false -11851 (lookup *(ecx+4) *(ecx+8)) # Tree-left Tree-left => eax -11852 89/<- %ebx 0/r32/eax -11853 (lookup *(edx+4) *(edx+8)) # Tree-left Tree-left => eax -11854 (type-equal? %eax %ebx) # => eax -11855 3d/compare-eax-and 0/imm32/false -11856 74/jump-if-= $type-equal?:end/disp8 -11857 $type-equal?:check-right: -11858 # return type-equal?(a->right, b->right) -11859 (lookup *(ecx+0xc) *(ecx+0x10)) # Tree-right Tree-right => eax -11860 89/<- %ebx 0/r32/eax -11861 (lookup *(edx+0xc) *(edx+0x10)) # Tree-right Tree-right => eax -11862 (type-equal? %eax %ebx) # => eax -11863 $type-equal?:end: -11864 # . restore registers -11865 5b/pop-to-ebx -11866 5a/pop-to-edx -11867 59/pop-to-ecx -11868 # . epilogue -11869 89/<- %esp 5/r32/ebp -11870 5d/pop-to-ebp -11871 c3/return -11872 -11873 ####################################################### -11874 # Code-generation -11875 ####################################################### -11876 -11877 == data -11878 -11879 # Global state added to each var record when performing code-generation. -11880 Curr-local-stack-offset: # (addr int) -11881 0/imm32 -11882 -11883 == code -11884 -11885 emit-subx: # out: (addr buffered-file), err: (addr buffered-file), ed: (addr exit-descriptor) -11886 # . prologue -11887 55/push-ebp -11888 89/<- %ebp 4/r32/esp -11889 # . save registers -11890 50/push-eax -11891 # var curr/eax: (addr function) = *Program->functions -11892 (lookup *_Program-functions *_Program-functions->payload) # => eax -11893 { -11894 # if (curr == null) break -11895 3d/compare-eax-and 0/imm32 -11896 0f 84/jump-if-= break/disp32 -11897 (emit-subx-function *(ebp+8) %eax *(ebp+0xc) *(ebp+0x10)) -11898 # curr = lookup(curr->next) -11899 (lookup *(eax+0x20) *(eax+0x24)) # Function-next Function-next => eax -11900 e9/jump loop/disp32 -11901 } -11902 $emit-subx:end: -11903 # . restore registers -11904 58/pop-to-eax -11905 # . epilogue -11906 89/<- %esp 5/r32/ebp -11907 5d/pop-to-ebp -11908 c3/return -11909 -11910 emit-subx-function: # out: (addr buffered-file), f: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) -11911 # . prologue -11912 55/push-ebp -11913 89/<- %ebp 4/r32/esp -11914 # some preprocessing -11915 (populate-mu-type-offsets-in-inouts *(ebp+0xc)) -11916 # . save registers -11917 50/push-eax -11918 51/push-ecx -11919 52/push-edx -11920 # initialize some global state -11921 c7 0/subop/copy *Curr-block-depth 1/imm32 # Important: keep this in sync with the parse phase -11922 c7 0/subop/copy *Curr-local-stack-offset 0/imm32 -11923 # ecx = f -11924 8b/-> *(ebp+0xc) 1/r32/ecx -11925 # var vars/edx: (stack (addr var) 256) -11926 81 5/subop/subtract %esp 0xc00/imm32 -11927 68/push 0xc00/imm32/size -11928 68/push 0/imm32/top -11929 89/<- %edx 4/r32/esp -11930 # var name/eax: (addr array byte) = lookup(f->name) -11931 (lookup *ecx *(ecx+4)) # Function-name Function-name => eax -11932 # -11933 (write-buffered *(ebp+8) %eax) -11934 (write-buffered *(ebp+8) ":\n") -11935 (emit-subx-prologue *(ebp+8)) -11936 # var body/eax: (addr block) = lookup(f->body) -11937 (lookup *(ecx+0x18) *(ecx+0x1c)) # Function-body Function-body => eax -11938 # -11939 (emit-subx-block *(ebp+8) %eax %edx *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) -11940 (emit-subx-epilogue *(ebp+8)) -11941 # TODO: validate that *Curr-block-depth and *Curr-local-stack-offset have -11942 # been cleaned up -11943 $emit-subx-function:end: -11944 # . reclaim locals -11945 81 0/subop/add %esp 0xc08/imm32 -11946 # . restore registers -11947 5a/pop-to-edx -11948 59/pop-to-ecx -11949 58/pop-to-eax -11950 # . epilogue -11951 89/<- %esp 5/r32/ebp -11952 5d/pop-to-ebp -11953 c3/return -11954 -11955 populate-mu-type-offsets-in-inouts: # f: (addr function) -11956 # . prologue -11957 55/push-ebp -11958 89/<- %ebp 4/r32/esp -11959 # . save registers -11960 50/push-eax -11961 51/push-ecx -11962 52/push-edx -11963 53/push-ebx -11964 57/push-edi -11965 # var next-offset/edx: int = 8 -11966 ba/copy-to-edx 8/imm32 -11967 # var curr/ecx: (addr list var) = lookup(f->inouts) -11968 8b/-> *(ebp+8) 1/r32/ecx -11969 (lookup *(ecx+8) *(ecx+0xc)) # Function-inouts Function-inouts => eax +11186 (lookup *eax *(eax+4)) # Function-name Function-name => eax +11187 (write-buffered *(ebp+0x10) %eax) +11188 (write-buffered *(ebp+0x10) ": stmt ") +11189 (lookup *(esi+4) *(esi+8)) # Stmt1-operation Stmt1-operation => eax +11190 (write-buffered *(ebp+0x10) %eax) +11191 (write-buffered *(ebp+0x10) ": too many inouts; most primitives support at most two arguments, across inouts and outputs\n") +11192 (flush *(ebp+0x10)) +11193 (stop *(ebp+0x14) 1) +11194 # never gets here +11195 +11196 $check-mu-numberlike-primitive:error-too-many-outputs: +11197 (write-buffered *(ebp+0x10) "fn ") +11198 8b/-> *(ebp+0xc) 0/r32/eax +11199 (lookup *eax *(eax+4)) # Function-name Function-name => eax +11200 (write-buffered *(ebp+0x10) %eax) +11201 (write-buffered *(ebp+0x10) ": stmt ") +11202 (lookup *(esi+4) *(esi+8)) # Stmt1-operation Stmt1-operation => eax +11203 (write-buffered *(ebp+0x10) %eax) +11204 (write-buffered *(ebp+0x10) ": too many outputs; most primitives support at most one output\n") +11205 (flush *(ebp+0x10)) +11206 (stop *(ebp+0x14) 1) +11207 # never gets here +11208 +11209 check-mu-numberlike-arg: # v: (addr stmt-var), stmt: (addr stmt), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) +11210 # . prologue +11211 55/push-ebp +11212 89/<- %ebp 4/r32/esp +11213 # . save registers +11214 50/push-eax +11215 56/push-esi +11216 # var t/esi: (addr type-tree) = lookup(v->value->type) +11217 8b/-> *(ebp+8) 0/r32/eax +11218 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax +11219 (lookup *(eax+8) *(eax+0xc)) # Var-type Var-type => eax +11220 89/<- %esi 0/r32/eax +11221 $check-mu-numberlike-arg:check-literal: +11222 # if t is an int, return +11223 (is-simple-mu-type? %esi 0) # literal => eax +11224 3d/compare-eax-and 0/imm32/false +11225 75/jump-if-!= $check-mu-numberlike-arg:end/disp8 +11226 $check-mu-numberlike-arg:check-addr: +11227 # if t is an addr and v is dereferenced, return +11228 { +11229 (is-mu-addr-type? %esi) # => eax +11230 3d/compare-eax-and 0/imm32/false +11231 74/jump-if-= break/disp8 +11232 8b/-> *(ebp+8) 0/r32/eax +11233 8b/-> *(eax+0x10) 0/r32/eax +11234 3d/compare-eax-and 0/imm32/false +11235 75/jump-if-!= $check-mu-numberlike-arg:end/disp8 +11236 } +11237 $check-mu-numberlike-arg:output-checks: +11238 (check-mu-numberlike-output *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14) *(ebp+0x18)) +11239 $check-mu-numberlike-arg:end: +11240 # . restore registers +11241 5e/pop-to-esi +11242 58/pop-to-eax +11243 # . epilogue +11244 89/<- %esp 5/r32/ebp +11245 5d/pop-to-ebp +11246 c3/return +11247 +11248 check-mu-numberlike-output: # v: (addr stmt-var), stmt: (addr stmt), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) +11249 # . prologue +11250 55/push-ebp +11251 89/<- %ebp 4/r32/esp +11252 # . save registers +11253 50/push-eax +11254 56/push-esi +11255 # var t/esi: (addr type-tree) = lookup(v->value->type) +11256 8b/-> *(ebp+8) 0/r32/eax +11257 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax +11258 (lookup *(eax+8) *(eax+0xc)) # Var-type Var-type => eax +11259 89/<- %esi 0/r32/eax +11260 $check-mu-numberlike-output:check-int: +11261 # if t is an int, return +11262 (is-simple-mu-type? %esi 1) # int => eax +11263 3d/compare-eax-and 0/imm32/false +11264 75/jump-if-!= $check-mu-numberlike-output:end/disp8 +11265 $check-mu-numberlike-output:check-boolean: +11266 # if t is a boolean, return +11267 (is-simple-mu-type? %esi 5) # boolean => eax +11268 3d/compare-eax-and 0/imm32/false +11269 75/jump-if-!= $check-mu-numberlike-output:end/disp8 +11270 $check-mu-numberlike-output:check-byte: +11271 # if t is a byte, return +11272 (is-simple-mu-type? %esi 8) # byte => eax +11273 3d/compare-eax-and 0/imm32/false +11274 75/jump-if-!= $check-mu-numberlike-output:end/disp8 +11275 e9/jump $check-mu-numberlike-output:fail/disp32 +11276 $check-mu-numberlike-output:end: +11277 # . restore registers +11278 5e/pop-to-esi +11279 58/pop-to-eax +11280 # . epilogue +11281 89/<- %esp 5/r32/ebp +11282 5d/pop-to-ebp +11283 c3/return +11284 +11285 $check-mu-numberlike-output:fail: +11286 # otherwise raise an error +11287 (write-buffered *(ebp+0x14) "fn ") +11288 8b/-> *(ebp+0x10) 0/r32/eax +11289 (lookup *eax *(eax+4)) # Function-name Function-name => eax +11290 (write-buffered *(ebp+0x14) %eax) +11291 (write-buffered *(ebp+0x14) ": stmt ") +11292 8b/-> *(ebp+0xc) 0/r32/eax +11293 (lookup *(eax+4) *(eax+8)) # Stmt1-operation Stmt1-operation => eax +11294 (write-buffered *(ebp+0x14) %eax) +11295 (write-buffered *(ebp+0x14) ": only non-addr scalar args permitted\n") +11296 (flush *(ebp+0x14)) +11297 (stop *(ebp+0x18) 1) +11298 # never gets here +11299 +11300 check-mu-copy-stmt: # stmt: (addr stmt), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) +11301 # . prologue +11302 55/push-ebp +11303 89/<- %ebp 4/r32/esp +11304 # . save registers +11305 $check-mu-copy-stmt:end: +11306 # . restore registers +11307 # . epilogue +11308 89/<- %esp 5/r32/ebp +11309 5d/pop-to-ebp +11310 c3/return +11311 +11312 check-mu-copy-to-stmt: # stmt: (addr stmt), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) +11313 # . prologue +11314 55/push-ebp +11315 89/<- %ebp 4/r32/esp +11316 # . save registers +11317 $check-mu-copy-to-stmt:end: +11318 # . restore registers +11319 # . epilogue +11320 89/<- %esp 5/r32/ebp +11321 5d/pop-to-ebp +11322 c3/return +11323 +11324 check-mu-compare-stmt: # stmt: (addr stmt), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) +11325 # . prologue +11326 55/push-ebp +11327 89/<- %ebp 4/r32/esp +11328 # . save registers +11329 $check-mu-compare-stmt:end: +11330 # . restore registers +11331 # . epilogue +11332 89/<- %esp 5/r32/ebp +11333 5d/pop-to-ebp +11334 c3/return +11335 +11336 check-mu-address-stmt: # stmt: (addr stmt), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) +11337 # . prologue +11338 55/push-ebp +11339 89/<- %ebp 4/r32/esp +11340 # . save registers +11341 $check-mu-address-stmt:end: +11342 # . restore registers +11343 # . epilogue +11344 89/<- %esp 5/r32/ebp +11345 5d/pop-to-ebp +11346 c3/return +11347 +11348 check-mu-get-stmt: # stmt: (addr stmt), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) +11349 # . prologue +11350 55/push-ebp +11351 89/<- %ebp 4/r32/esp +11352 # . save registers +11353 50/push-eax +11354 51/push-ecx +11355 52/push-edx +11356 53/push-ebx +11357 56/push-esi +11358 57/push-edi +11359 # esi = stmt +11360 8b/-> *(ebp+8) 6/r32/esi +11361 # - check for 0 inouts +11362 # var base/ecx: (addr var) = stmt->inouts->value +11363 (lookup *(esi+0xc) *(esi+0x10)) # Stmt1-inouts Stmt1-inouts => eax +11364 3d/compare-eax-and 0/imm32/false +11365 0f 84/jump-if-= $check-mu-get-stmt:error-too-few-inouts/disp32 +11366 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax +11367 89/<- %ecx 0/r32/eax +11368 $check-mu-get-stmt:check-base: +11369 # - check base type +11370 # if it's an 'addr', check that it's in a register +11371 # var base-type/ebx: (addr type-tree) = lookup(base->type) +11372 (lookup *(ecx+8) *(ecx+0xc)) # Var-type Var-type => eax +11373 89/<- %ebx 0/r32/eax +11374 { +11375 81 7/subop/compare *ebx 0/imm32/false # Type-tree-is-atom +11376 0f 85/jump-if-!= break/disp32 +11377 $check-mu-get-stmt:base-is-compound: +11378 # if (type->left != addr) break +11379 (lookup *(ebx+4) *(ebx+8)) # Type-tree-left Type-tree-left => eax +11380 (is-simple-mu-type? %eax 2) # => eax +11381 3d/compare-eax-and 0/imm32/false +11382 74/jump-if-= break/disp8 +11383 $check-mu-get-stmt:base-is-addr: +11384 # now check for register +11385 81 7/subop/compare *(ecx+0x18) 0/imm32 # Var-register +11386 0f 84/jump-if-= $check-mu-get-stmt:error-base-type-addr-but-not-register/disp32 +11387 $check-mu-get-stmt:base-is-addr-in-register: +11388 # type->left is now an addr; skip it +11389 (lookup *(ebx+0xc) *(ebx+0x10)) # Type-tree-right Type-tree-right => eax +11390 81 7/subop/compare *(eax+0xc) 0/imm32 # Type-tree-right +11391 0f 85/jump-if-!= $check-mu-get-stmt:error-bad-base/disp32 +11392 $check-mu-get-stmt:base-is-addr-to-atom-in-register: +11393 (lookup *(eax+4) *(eax+8)) # Type-tree-left Type-tree-left => eax +11394 89/<- %ebx 0/r32/eax +11395 } +11396 $check-mu-get-stmt:check-base-typeinfo: +11397 # ensure type is a container +11398 # var base-type-id/ebx: type-id = base-type->value +11399 8b/-> *(ebx+4) 3/r32/ebx # Type-tree-value +11400 (is-container? %ebx) # => eax +11401 3d/compare-eax-and 0/imm32/false +11402 0f 84/jump-if-= $check-mu-get-stmt:error-bad-base/disp32 +11403 # var base-typeinfo/edx: (addr typeinfo) = find-typeinfo(base-type-id) +11404 # . var container/ecx: (handle typeinfo) +11405 68/push 0/imm32 +11406 68/push 0/imm32 +11407 89/<- %ecx 4/r32/esp +11408 # . +11409 (find-typeinfo %ebx %ecx) +11410 (lookup *ecx *(ecx+4)) # => eax +11411 # . reclaim container +11412 81 0/subop/add %esp 8/imm32 +11413 # . +11414 89/<- %edx 0/r32/eax +11415 # var offset/ecx: (addr stmt-var) = stmt->inouts->next +11416 (lookup *(esi+0xc) *(esi+0x10)) # Stmt1-inouts Stmt1-inouts => eax +11417 (lookup *(eax+8) *(eax+0xc)) # Stmt-var-next Stmt-var-next => eax +11418 89/<- %ecx 0/r32/eax +11419 # - check for 1 inout +11420 3d/compare-eax-and 0/imm32/false +11421 0f 84/jump-if-= $check-mu-get-stmt:error-too-few-inouts/disp32 +11422 # var offset/ecx: (addr var) = lookup(offset->value) +11423 (lookup *ecx *(ecx+4)) # Stmt-var-value Stmt-var-value => eax +11424 89/<- %ecx 0/r32/eax +11425 # - check for valid field +11426 81 7/subop/compare *(ecx+0x14) -1/imm32/uninitialized # Var-offset +11427 0f 84/jump-if-= $check-mu-get-stmt:error-bad-field/disp32 +11428 # - check for too many inouts +11429 (lookup *(esi+0xc) *(esi+0x10)) # Stmt1-inouts Stmt1-inouts => eax +11430 (lookup *(eax+8) *(eax+0xc)) # Stmt-var-next Stmt-var-next => eax +11431 (lookup *(eax+8) *(eax+0xc)) # Stmt-var-next Stmt-var-next => eax +11432 3d/compare-eax-and 0/imm32/false +11433 0f 85/jump-if-!= $check-mu-get-stmt:error-too-many-inouts/disp32 +11434 # var output/edi: (addr var) = stmt->outputs->value +11435 (lookup *(esi+0x14) *(esi+0x18)) # Stmt1-outputs Stmt1-outputs => eax +11436 # - check for 0 outputs +11437 3d/compare-eax-and 0/imm32/false +11438 0f 84/jump-if-= $check-mu-get-stmt:error-too-few-outputs/disp32 +11439 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax +11440 89/<- %edi 0/r32/eax +11441 $check-mu-get-stmt:check-output-type: +11442 # - check output type +11443 # must be in register +11444 (lookup *(edi+0x18) *(edi+0x1c)) # Var-register Var-register => eax +11445 3d/compare-eax-and 0/imm32 +11446 0f 84/jump-if-= $check-mu-get-stmt:error-output-not-in-register/disp32 +11447 # must have a non-atomic type +11448 (lookup *(edi+8) *(edi+0xc)) # Var-type Var-type => eax +11449 81 7/subop/compare *eax 0/imm32/false # Type-tree-is-atom +11450 0f 85/jump-if-!= $check-mu-get-stmt:error-output-type-not-address/disp32 +11451 # type must start with (addr ...) +11452 (lookup *(eax+4) *(eax+8)) # Type-tree-left Type-tree-left => eax +11453 (is-simple-mu-type? %eax 2) # => eax +11454 3d/compare-eax-and 0/imm32/false +11455 0f 84/jump-if-= $check-mu-get-stmt:error-output-type-not-address/disp32 +11456 $check-mu-get-stmt:check-output-type-match: +11457 # payload of addr type must match 'type' definition +11458 (lookup *(edi+8) *(edi+0xc)) # Var-type Var-type => eax +11459 (lookup *(eax+0xc) *(eax+0x10)) # Type-tree-right Type-tree-right => eax +11460 # if (payload->right == null) payload = payload->left +11461 81 7/subop/compare *(eax+0xc) 0/imm32/null # Type-tree-right +11462 { +11463 75/jump-if-!= break/disp8 +11464 (lookup *(eax+4) *(eax+8)) # Type-tree-left Type-tree-left => eax +11465 } +11466 89/<- %edi 0/r32/eax +11467 # . var output-name/ecx: (addr array byte) +11468 (lookup *ecx *(ecx+4)) # Var-name Var-name => eax +11469 89/<- %ecx 0/r32/eax +11470 # . var base-typeinfo-entry/eax: (addr handle typeinfo-entry) +11471 (lookup *(edx+4) *(edx+8)) # Typeinfo-fields Typeinfo-fields => eax +11472 (get %eax %ecx 0x10) # => eax +11473 # . +11474 (lookup *eax *(eax+4)) # => eax +11475 (lookup *eax *(eax+4)) # Typeinfo-entry-input-var Typeinfo-entry-input-var => eax +11476 (lookup *(eax+8) *(eax+0xc)) # Var-type Var-type => eax +11477 # . +11478 (type-equal? %edi %eax) # => eax +11479 3d/compare-eax-and 0/imm32/false +11480 0f 84/jump-if-= $check-mu-get-stmt:error-bad-output-type/disp32 +11481 # - check for too many outputs +11482 (lookup *(esi+0x14) *(esi+0x18)) # Stmt1-outputs Stmt1-outputs => eax +11483 (lookup *(eax+8) *(eax+0xc)) # Stmt-var-next Stmt-var-next => eax +11484 3d/compare-eax-and 0/imm32/false +11485 0f 85/jump-if-!= $check-mu-get-stmt:error-too-many-outputs/disp32 +11486 $check-mu-get-stmt:end: +11487 # . restore registers +11488 5f/pop-to-edi +11489 5e/pop-to-esi +11490 5b/pop-to-ebx +11491 5a/pop-to-edx +11492 59/pop-to-ecx +11493 58/pop-to-eax +11494 # . epilogue +11495 89/<- %esp 5/r32/ebp +11496 5d/pop-to-ebp +11497 c3/return +11498 +11499 $check-mu-get-stmt:error-too-few-inouts: +11500 (write-buffered *(ebp+0x10) "fn ") +11501 8b/-> *(ebp+0xc) 0/r32/eax +11502 (lookup *eax *(eax+4)) # Function-name Function-name => eax +11503 (write-buffered *(ebp+0x10) %eax) +11504 (write-buffered *(ebp+0x10) ": stmt get: too few inouts (2 required)\n") +11505 (flush *(ebp+0x10)) +11506 (stop *(ebp+0x14) 1) +11507 # never gets here +11508 +11509 $check-mu-get-stmt:error-too-many-inouts: +11510 (write-buffered *(ebp+0x10) "fn ") +11511 8b/-> *(ebp+0xc) 0/r32/eax +11512 (lookup *eax *(eax+4)) # Function-name Function-name => eax +11513 (write-buffered *(ebp+0x10) %eax) +11514 (write-buffered *(ebp+0x10) ": stmt get: too many inouts (2 required)\n") +11515 (flush *(ebp+0x10)) +11516 (stop *(ebp+0x14) 1) +11517 # never gets here +11518 +11519 $check-mu-get-stmt:error-too-few-outputs: +11520 (write-buffered *(ebp+0x10) "fn ") +11521 8b/-> *(ebp+0xc) 0/r32/eax +11522 (lookup *eax *(eax+4)) # Function-name Function-name => eax +11523 (write-buffered *(ebp+0x10) %eax) +11524 (write-buffered *(ebp+0x10) ": stmt get: must have an output\n") +11525 (flush *(ebp+0x10)) +11526 (stop *(ebp+0x14) 1) +11527 # never gets here +11528 +11529 $check-mu-get-stmt:error-too-many-outputs: +11530 (write-buffered *(ebp+0x10) "fn ") +11531 8b/-> *(ebp+0xc) 0/r32/eax +11532 (lookup *eax *(eax+4)) # Function-name Function-name => eax +11533 (write-buffered *(ebp+0x10) %eax) +11534 (write-buffered *(ebp+0x10) ": stmt get: too many outputs (1 required)\n") +11535 (flush *(ebp+0x10)) +11536 (stop *(ebp+0x14) 1) +11537 # never gets here +11538 +11539 $check-mu-get-stmt:error-bad-base: +11540 # error("fn " fn ": stmt get: var '" base->name "' must have a 'type' definition\n") +11541 (write-buffered *(ebp+0x10) "fn ") +11542 8b/-> *(ebp+0xc) 0/r32/eax +11543 (lookup *eax *(eax+4)) # Function-name Function-name => eax +11544 (write-buffered *(ebp+0x10) %eax) +11545 (write-buffered *(ebp+0x10) ": stmt get: var '") +11546 (lookup *(esi+0xc) *(esi+0x10)) # Stmt1-inouts Stmt1-inouts => eax +11547 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax +11548 (lookup *eax *(eax+4)) # Var-name Var-name => eax +11549 (write-buffered *(ebp+0x10) %eax) +11550 (write-buffered *(ebp+0x10) "' must have a 'type' definition\n") +11551 (flush *(ebp+0x10)) +11552 (stop *(ebp+0x14) 1) +11553 # never gets here +11554 +11555 $check-mu-get-stmt:error-base-type-addr-but-not-register: +11556 (write-buffered *(ebp+0x10) "fn ") +11557 8b/-> *(ebp+0xc) 0/r32/eax +11558 (lookup *eax *(eax+4)) # Function-name Function-name => eax +11559 (write-buffered *(ebp+0x10) %eax) +11560 (write-buffered *(ebp+0x10) ": stmt get: var '") +11561 (lookup *(esi+0xc) *(esi+0x10)) # Stmt1-inouts Stmt1-inouts => eax +11562 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax +11563 (lookup *eax *(eax+4)) # Var-name Var-name => eax +11564 (write-buffered *(ebp+0x10) %eax) +11565 (write-buffered *(ebp+0x10) "' is an 'addr' type, and so must live in a register\n") +11566 (flush *(ebp+0x10)) +11567 (stop *(ebp+0x14) 1) +11568 # never gets here +11569 +11570 $check-mu-get-stmt:error-bad-field: +11571 # error("fn " fn ": stmt get: type " type " has no member called '" curr->name "'\n") +11572 (write-buffered *(ebp+0x10) "fn ") +11573 8b/-> *(ebp+0xc) 0/r32/eax +11574 (lookup *eax *(eax+4)) # Function-name Function-name => eax +11575 (write-buffered *(ebp+0x10) %eax) +11576 (write-buffered *(ebp+0x10) ": stmt get: type '") +11577 # . write(Type-id->data[tmp]) +11578 bf/copy-to-edi Type-id/imm32 +11579 (write-buffered *(ebp+0x10) *(edi+ebx<<2+0xc)) +11580 # . +11581 (write-buffered *(ebp+0x10) "' has no member called '") +11582 (lookup *ecx *(ecx+4)) # Var-name Var-name => eax +11583 (write-buffered *(ebp+0x10) %eax) +11584 (write-buffered *(ebp+0x10) "'\n") +11585 (flush *(ebp+0x10)) +11586 (stop *(ebp+0x14) 1) +11587 # never gets here +11588 +11589 $check-mu-get-stmt:error-output-not-in-register: +11590 (write-buffered *(ebp+0x10) "fn ") +11591 8b/-> *(ebp+0xc) 0/r32/eax +11592 (lookup *eax *(eax+4)) # Function-name Function-name => eax +11593 (write-buffered *(ebp+0x10) %eax) +11594 (write-buffered *(ebp+0x10) ": stmt get: output '") +11595 (lookup *edi *(edi+4)) # Var-name Var-name => eax +11596 (write-buffered *(ebp+0x10) %eax) +11597 (write-buffered *(ebp+0x10) "' is not in a register\n") +11598 (flush *(ebp+0x10)) +11599 (stop *(ebp+0x14) 1) +11600 # never gets here +11601 +11602 $check-mu-get-stmt:error-output-type-not-address: +11603 (write-buffered *(ebp+0x10) "fn ") +11604 8b/-> *(ebp+0xc) 0/r32/eax +11605 (lookup *eax *(eax+4)) # Function-name Function-name => eax +11606 (write-buffered *(ebp+0x10) %eax) +11607 (write-buffered *(ebp+0x10) ": stmt get: output must be an address\n") +11608 (flush *(ebp+0x10)) +11609 (stop *(ebp+0x14) 1) +11610 # never gets here +11611 +11612 $check-mu-get-stmt:error-bad-output-type: +11613 (write-buffered *(ebp+0x10) "fn ") +11614 8b/-> *(ebp+0xc) 0/r32/eax +11615 (lookup *eax *(eax+4)) # Function-name Function-name => eax +11616 (write-buffered *(ebp+0x10) %eax) +11617 (write-buffered *(ebp+0x10) ": stmt get: wrong output type for member '") +11618 (write-buffered *(ebp+0x10) %ecx) +11619 (write-buffered *(ebp+0x10) "' of type '") +11620 bf/copy-to-edi Type-id/imm32 +11621 (write-buffered *(ebp+0x10) *(edi+ebx<<2+0xc)) +11622 (write-buffered *(ebp+0x10) "'\n") +11623 (flush *(ebp+0x10)) +11624 (stop *(ebp+0x14) 1) +11625 # never gets here +11626 +11627 check-mu-index-stmt: # stmt: (addr stmt), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) +11628 # . prologue +11629 55/push-ebp +11630 89/<- %ebp 4/r32/esp +11631 # . save registers +11632 $check-mu-index-stmt:end: +11633 # . restore registers +11634 # . epilogue +11635 89/<- %esp 5/r32/ebp +11636 5d/pop-to-ebp +11637 c3/return +11638 +11639 check-mu-length-stmt: # stmt: (addr stmt), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) +11640 # . prologue +11641 55/push-ebp +11642 89/<- %ebp 4/r32/esp +11643 # . save registers +11644 $check-mu-length-stmt:end: +11645 # . restore registers +11646 # . epilogue +11647 89/<- %esp 5/r32/ebp +11648 5d/pop-to-ebp +11649 c3/return +11650 +11651 check-mu-compute-offset-stmt: # stmt: (addr stmt), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) +11652 # . prologue +11653 55/push-ebp +11654 89/<- %ebp 4/r32/esp +11655 # . save registers +11656 $check-mu-compute-offset-stmt:end: +11657 # . restore registers +11658 # . epilogue +11659 89/<- %esp 5/r32/ebp +11660 5d/pop-to-ebp +11661 c3/return +11662 +11663 check-mu-lookup-stmt: # stmt: (addr stmt), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) +11664 # . prologue +11665 55/push-ebp +11666 89/<- %ebp 4/r32/esp +11667 # . save registers +11668 $check-mu-lookup-stmt:end: +11669 # . restore registers +11670 # . epilogue +11671 89/<- %esp 5/r32/ebp +11672 5d/pop-to-ebp +11673 c3/return +11674 +11675 check-mu-call: # stmt: (addr stmt), callee: (addr function), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) +11676 # . prologue +11677 55/push-ebp +11678 89/<- %ebp 4/r32/esp +11679 # . save registers +11680 50/push-eax +11681 51/push-ecx +11682 52/push-edx +11683 53/push-ebx +11684 56/push-esi +11685 57/push-edi +11686 # esi = stmt +11687 8b/-> *(ebp+8) 6/r32/esi +11688 # edi = callee +11689 8b/-> *(ebp+0xc) 7/r32/edi +11690 # var inouts/ecx: (addr stmt-var) = lookup(stmt->inouts) +11691 (lookup *(esi+0xc) *(esi+0x10)) # Stmt1-inouts Stmt1-inouts => eax +11692 89/<- %ecx 0/r32/eax +11693 # var expected/edx: (addr list var) = lookup(f->inouts) +11694 (lookup *(edi+8) *(edi+0xc)) # Function-inouts Function-inouts => eax +11695 89/<- %edx 0/r32/eax +11696 { +11697 $check-mu-call:check-for-inouts: +11698 # if (inouts == 0) break +11699 81 7/subop/compare %ecx 0/imm32 +11700 0f 84/jump-if-= break/disp32 +11701 # if (expected == 0) error +11702 81 7/subop/compare %edx 0/imm32 +11703 0f 84/jump-if-= break/disp32 +11704 $check-mu-call:check-inout-type: +11705 # var v/eax: (addr v) = lookup(inouts->value) +11706 (lookup *ecx *(ecx+4)) # Stmt-var-value Stmt-var-value => eax +11707 # var t/ebx: (addr type-tree) = lookup(v->type) +11708 (lookup *(eax+8) *(eax+0xc)) # Var-type Var-type => eax +11709 89/<- %ebx 0/r32/eax +11710 # if (inouts->is-deref?) t = t->right # TODO: check that t->left is an addr +11711 81 7/subop/compare *(ecx+0x10) 0/imm32/false # Stmt-var-is-deref +11712 { +11713 74/jump-if-= break/disp8 +11714 (lookup *(ebx+0xc) *(ebx+0x10)) # Type-tree-right Type-tree-right => eax +11715 89/<- %ebx 0/r32/eax +11716 # if t->right is null, t = t->left +11717 81 7/subop/compare *(ebx+0xc) 0/imm32 # Type-tree-right +11718 75/jump-if-!= break/disp8 +11719 (lookup *(ebx+4) *(ebx+8)) # Type-tree-left Type-tree-left => eax +11720 89/<- %ebx 0/r32/eax +11721 } +11722 # var v2/eax: (addr v) = lookup(expected->value) +11723 (lookup *edx *(edx+4)) # List-value List-value => eax +11724 # var t2/eax: (addr type-tree) = lookup(v2->type) +11725 (lookup *(eax+8) *(eax+0xc)) # Var-type Var-type => eax +11726 # if (t != t2) error +11727 (type-match? %eax %ebx) # => eax +11728 3d/compare-eax-and 0/imm32/false +11729 { +11730 0f 85/jump-if-!= break/disp32 +11731 (write-buffered *(ebp+0x14) "fn ") +11732 8b/-> *(ebp+0x10) 0/r32/eax +11733 (lookup *eax *(eax+4)) # Function-name Function-name => eax +11734 (write-buffered *(ebp+0x14) %eax) +11735 (write-buffered *(ebp+0x14) ": call ") +11736 (lookup *edi *(edi+4)) # Function-name Function-name => eax +11737 (write-buffered *(ebp+0x14) %eax) +11738 (write-buffered *(ebp+0x14) ": type for inout '") +11739 (lookup *ecx *(ecx+4)) # Stmt-var-value Stmt-var-value => eax +11740 (lookup *eax *(eax+4)) # Var-name Var-name => eax +11741 (write-buffered *(ebp+0x14) %eax) +11742 (write-buffered *(ebp+0x14) "' is not right\n") +11743 (flush *(ebp+0x14)) +11744 (stop *(ebp+0x18) 1) +11745 } +11746 $check-mu-call:continue-to-next-inout: +11747 # inouts = lookup(inouts->next) +11748 (lookup *(ecx+8) *(ecx+0xc)) # Stmt-var-next Stmt-var-next => eax +11749 89/<- %ecx 0/r32/eax +11750 # expected = lookup(expected->next) +11751 (lookup *(edx+8) *(edx+0xc)) # List-next List-next => eax +11752 89/<- %edx 0/r32/eax +11753 # +11754 e9/jump loop/disp32 +11755 } +11756 $check-mu-call:check-inout-count: +11757 # if (inouts == expected) proceed +11758 39/compare %ecx 2/r32/edx +11759 { +11760 0f 84/jump-if-= break/disp32 +11761 # exactly one of the two is null +11762 # if (inouts == 0) error("too many inouts") +11763 { +11764 81 7/subop/compare %ecx 0/imm32 +11765 0f 84/jump-if-= break/disp32 +11766 (write-buffered *(ebp+0x14) "fn ") +11767 8b/-> *(ebp+0x10) 0/r32/eax +11768 (lookup *eax *(eax+4)) # Function-name Function-name => eax +11769 (write-buffered *(ebp+0x14) %eax) +11770 (write-buffered *(ebp+0x14) ": call ") +11771 (lookup *edi *(edi+4)) # Function-name Function-name => eax +11772 (write-buffered *(ebp+0x14) %eax) +11773 (write-buffered *(ebp+0x14) ": too many inouts\n") +11774 (flush *(ebp+0x14)) +11775 (stop *(ebp+0x18) 1) +11776 } +11777 # if (expected == 0) error("too few inouts") +11778 { +11779 81 7/subop/compare %edx 0/imm32 +11780 0f 84/jump-if-= break/disp32 +11781 (write-buffered *(ebp+0x14) "fn ") +11782 8b/-> *(ebp+0x10) 0/r32/eax +11783 (lookup *eax *(eax+4)) # Function-name Function-name => eax +11784 (write-buffered *(ebp+0x14) %eax) +11785 (write-buffered *(ebp+0x14) ": call ") +11786 (lookup *edi *(edi+4)) # Function-name Function-name => eax +11787 (write-buffered *(ebp+0x14) %eax) +11788 (write-buffered *(ebp+0x14) ": too few inouts\n") +11789 (flush *(ebp+0x14)) +11790 (stop *(ebp+0x18) 1) +11791 } +11792 } +11793 $check-mu-call:check-outputs: +11794 # var outputs/ecx: (addr stmt-var) = lookup(stmt->outputs) +11795 (lookup *(esi+0x14) *(esi+0x18)) # Stmt1-outputs Stmt1-outputs => eax +11796 89/<- %ecx 0/r32/eax +11797 # var expected/edx: (addr list var) = lookup(f->outputs) +11798 (lookup *(edi+0x10) *(edi+0x14)) # Function-outputs Function-outputs => eax +11799 89/<- %edx 0/r32/eax +11800 { +11801 $check-mu-call:check-for-outputs: +11802 # if (outputs == 0) break +11803 81 7/subop/compare %ecx 0/imm32 +11804 0f 84/jump-if-= break/disp32 +11805 # if (expected == 0) error +11806 81 7/subop/compare %edx 0/imm32 +11807 0f 84/jump-if-= break/disp32 +11808 $check-mu-call:check-output-type: +11809 # var v/eax: (addr v) = lookup(outputs->value) +11810 (lookup *ecx *(ecx+4)) # Stmt-var-value Stmt-var-value => eax +11811 # var t/ebx: (addr type-tree) = lookup(v->type) +11812 (lookup *(eax+8) *(eax+0xc)) # Var-type Var-type => eax +11813 89/<- %ebx 0/r32/eax +11814 # if (outputs->is-deref?) t = t->right # TODO: check that t->left is an addr +11815 81 7/subop/compare *(ecx+0x10) 0/imm32/false # Stmt-var-is-deref +11816 { +11817 74/jump-if-= break/disp8 +11818 (lookup *(ebx+0xc) *(ebx+0x10)) # Type-tree-right Type-tree-right => eax +11819 89/<- %ebx 0/r32/eax +11820 } +11821 # var v2/eax: (addr v) = lookup(expected->value) +11822 (lookup *edx *(edx+4)) # List-value List-value => eax +11823 # var t2/eax: (addr type-tree) = lookup(v2->type) +11824 (lookup *(eax+8) *(eax+0xc)) # Var-type Var-type => eax +11825 # if (t != t2) error +11826 (type-equal? %eax %ebx) # => eax +11827 3d/compare-eax-and 0/imm32/false +11828 { +11829 0f 85/jump-if-!= break/disp32 +11830 (write-buffered *(ebp+0x14) "fn ") +11831 8b/-> *(ebp+0x10) 0/r32/eax +11832 (lookup *eax *(eax+4)) # Function-name Function-name => eax +11833 (write-buffered *(ebp+0x14) %eax) +11834 (write-buffered *(ebp+0x14) ": call ") +11835 (lookup *edi *(edi+4)) # Function-name Function-name => eax +11836 (write-buffered *(ebp+0x14) %eax) +11837 (write-buffered *(ebp+0x14) ": type for output '") +11838 (lookup *ecx *(ecx+4)) # Stmt-var-value Stmt-var-value => eax +11839 (lookup *eax *(eax+4)) # Var-name Var-name => eax +11840 (write-buffered *(ebp+0x14) %eax) +11841 (write-buffered *(ebp+0x14) "' is not right\n") +11842 (flush *(ebp+0x14)) +11843 (stop *(ebp+0x18) 1) +11844 } +11845 $check-mu-call:check-output-register: +11846 # var v/eax: (addr v) = lookup(outputs->value) +11847 (lookup *ecx *(ecx+4)) # Stmt-var-value Stmt-var-value => eax +11848 # var r/ebx: (addr array byte) = lookup(v->register) +11849 (lookup *(eax+18) *(eax+0x1c)) # Var-register Var-register => eax +11850 89/<- %ebx 0/r32/eax +11851 # var v2/eax: (addr v) = lookup(expected->value) +11852 (lookup *edx *(edx+4)) # Stmt-var-value Stmt-var-value => eax +11853 # var r2/eax: (addr array byte) = lookup(v2->register) +11854 (lookup *(eax+18) *(eax+0x1c)) # Var-register Var-register => eax +11855 # if (r != r2) error +11856 (string-equal? %eax %ebx) # => eax +11857 3d/compare-eax-and 0/imm32/false +11858 { +11859 0f 85/jump-if-!= break/disp32 +11860 (write-buffered *(ebp+0x14) "fn ") +11861 8b/-> *(ebp+0x10) 0/r32/eax +11862 (lookup *eax *(eax+4)) # Function-name Function-name => eax +11863 (write-buffered *(ebp+0x14) %eax) +11864 (write-buffered *(ebp+0x14) ": call ") +11865 (lookup *edi *(edi+4)) # Function-name Function-name => eax +11866 (write-buffered *(ebp+0x14) %eax) +11867 (write-buffered *(ebp+0x14) ": register for output '") +11868 (lookup *ecx *(ecx+4)) # Stmt-var-value Stmt-var-value => eax +11869 (lookup *eax *(eax+4)) # Var-name Var-name => eax +11870 (write-buffered *(ebp+0x14) %eax) +11871 (write-buffered *(ebp+0x14) "' is not right\n") +11872 (flush *(ebp+0x14)) +11873 (stop *(ebp+0x18) 1) +11874 } +11875 $check-mu-call:continue-to-next-output: +11876 # outputs = lookup(outputs->next) +11877 (lookup *(ecx+8) *(ecx+0xc)) # Stmt-var-next Stmt-var-next => eax +11878 89/<- %ecx 0/r32/eax +11879 # expected = lookup(expected->next) +11880 (lookup *(edx+8) *(edx+0xc)) # List-next List-next => eax +11881 89/<- %edx 0/r32/eax +11882 # +11883 e9/jump loop/disp32 +11884 } +11885 $check-mu-call:check-output-count: +11886 # if (outputs == expected) proceed +11887 39/compare %ecx 2/r32/edx +11888 { +11889 0f 84/jump-if-= break/disp32 +11890 # exactly one of the two is null +11891 # if (outputs == 0) error("too many outputs") +11892 { +11893 81 7/subop/compare %ecx 0/imm32 +11894 0f 84/jump-if-= break/disp32 +11895 (write-buffered *(ebp+0x14) "fn ") +11896 8b/-> *(ebp+0x10) 0/r32/eax +11897 (lookup *eax *(eax+4)) # Function-name Function-name => eax +11898 (write-buffered *(ebp+0x14) %eax) +11899 (write-buffered *(ebp+0x14) ": call ") +11900 (lookup *edi *(edi+4)) # Function-name Function-name => eax +11901 (write-buffered *(ebp+0x14) %eax) +11902 (write-buffered *(ebp+0x14) ": too many outputs\n") +11903 (flush *(ebp+0x14)) +11904 (stop *(ebp+0x18) 1) +11905 } +11906 # if (expected == 0) error("too few outputs") +11907 { +11908 81 7/subop/compare %edx 0/imm32 +11909 0f 84/jump-if-= break/disp32 +11910 (write-buffered *(ebp+0x14) "fn ") +11911 8b/-> *(ebp+0x10) 0/r32/eax +11912 (lookup *eax *(eax+4)) # Function-name Function-name => eax +11913 (write-buffered *(ebp+0x14) %eax) +11914 (write-buffered *(ebp+0x14) ": call ") +11915 (lookup *edi *(edi+4)) # Function-name Function-name => eax +11916 (write-buffered *(ebp+0x14) %eax) +11917 (write-buffered *(ebp+0x14) ": too few outputs\n") +11918 (flush *(ebp+0x14)) +11919 (stop *(ebp+0x18) 1) +11920 } +11921 } +11922 $check-mu-call:end: +11923 # . restore registers +11924 5f/pop-to-edi +11925 5e/pop-to-esi +11926 5b/pop-to-ebx +11927 5a/pop-to-edx +11928 59/pop-to-ecx +11929 58/pop-to-eax +11930 # . epilogue +11931 89/<- %esp 5/r32/ebp +11932 5d/pop-to-ebp +11933 c3/return +11934 +11935 # like type-equal? but takes literals into account +11936 type-match?: # def: (addr type-tree), call: (addr type-tree) -> result/eax: boolean +11937 # . prologue +11938 55/push-ebp +11939 89/<- %ebp 4/r32/esp +11940 # if (call == literal) return true # TODO: more precise +11941 (is-simple-mu-type? *(ebp+0xc) 0) # literal => eax +11942 3d/compare-eax-and 0/imm32/false +11943 b8/copy-to-eax 1/imm32/true +11944 75/jump-if-!= $type-match?:end/disp8 +11945 $type-match?:baseline: +11946 # otherwise fall back +11947 (type-equal? *(ebp+8) *(ebp+0xc)) # => eax +11948 $type-match?:end: +11949 # . epilogue +11950 89/<- %esp 5/r32/ebp +11951 5d/pop-to-ebp +11952 c3/return +11953 +11954 size-of: # v: (addr var) -> result/eax: int +11955 # . prologue +11956 55/push-ebp +11957 89/<- %ebp 4/r32/esp +11958 # . save registers +11959 51/push-ecx +11960 # var t/ecx: (addr type-tree) = lookup(v->type) +11961 8b/-> *(ebp+8) 1/r32/ecx +11962 #? (write-buffered Stderr "size-of ") +11963 #? (write-int32-hex-buffered Stderr %ecx) +11964 #? (write-buffered Stderr Newline) +11965 #? (write-buffered Stderr "type allocid: ") +11966 #? (write-int32-hex-buffered Stderr *(ecx+8)) +11967 #? (write-buffered Stderr Newline) +11968 #? (flush Stderr) +11969 (lookup *(ecx+8) *(ecx+0xc)) # Var-type Var-type => eax 11970 89/<- %ecx 0/r32/eax -11971 { -11972 $populate-mu-type-offsets-in-inouts:loop: -11973 81 7/subop/compare %ecx 0/imm32 -11974 74/jump-if-= break/disp8 -11975 # var v/ebx: (addr var) = lookup(curr->value) -11976 (lookup *ecx *(ecx+4)) # List-value List-value => eax -11977 89/<- %ebx 0/r32/eax -11978 #? (lookup *ebx *(ebx+4)) -11979 #? (write-buffered Stderr "setting offset of fn inout ") -11980 #? (write-buffered Stderr %eax) -11981 #? (write-buffered Stderr "@") -11982 #? (write-int32-hex-buffered Stderr %ebx) -11983 #? (write-buffered Stderr " to ") -11984 #? (write-int32-hex-buffered Stderr %edx) -11985 #? (write-buffered Stderr Newline) -11986 #? (flush Stderr) -11987 # v->offset = next-offset -11988 89/<- *(ebx+0x14) 2/r32/edx # Var-offset -11989 # next-offset += size-of(v) -11990 (size-of %ebx) # => eax -11991 01/add-to %edx 0/r32/eax -11992 # curr = lookup(curr->next) -11993 (lookup *(ecx+8) *(ecx+0xc)) # List-next List-next => eax -11994 89/<- %ecx 0/r32/eax -11995 # -11996 eb/jump loop/disp8 -11997 } -11998 $populate-mu-type-offsets-in-inouts:end: -11999 # . restore registers -12000 5f/pop-to-edi -12001 5b/pop-to-ebx -12002 5a/pop-to-edx -12003 59/pop-to-ecx -12004 58/pop-to-eax -12005 # . epilogue -12006 89/<- %esp 5/r32/ebp -12007 5d/pop-to-ebp -12008 c3/return -12009 -12010 emit-subx-stmt-list: # out: (addr buffered-file), stmts: (addr list stmt), vars: (addr stack live-var), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) -12011 # . prologue -12012 55/push-ebp -12013 89/<- %ebp 4/r32/esp -12014 # . save registers -12015 50/push-eax -12016 51/push-ecx -12017 53/push-ebx -12018 56/push-esi -12019 # esi = stmts -12020 8b/-> *(ebp+0xc) 6/r32/esi -12021 # -12022 { -12023 $emit-subx-stmt-list:loop: -12024 81 7/subop/compare %esi 0/imm32 -12025 0f 84/jump-if-= break/disp32 -12026 # var curr-stmt/ecx: (addr stmt) = lookup(stmts->value) -12027 (lookup *esi *(esi+4)) # List-value List-value => eax -12028 89/<- %ecx 0/r32/eax -12029 { -12030 $emit-subx-stmt-list:check-for-block: -12031 81 7/subop/compare *ecx 0/imm32/block # Stmt-tag -12032 75/jump-if-!= break/disp8 -12033 $emit-subx-stmt-list:block: -12034 (emit-subx-block *(ebp+8) %ecx *(ebp+0x10) *(ebp+0x14) *(ebp+0x18) *(ebp+0x1c)) -12035 } -12036 { -12037 $emit-subx-stmt-list:check-for-stmt: -12038 81 7/subop/compare *ecx 1/imm32/stmt1 # Stmt-tag -12039 0f 85/jump-if-!= break/disp32 -12040 $emit-subx-stmt-list:stmt1: -12041 { -12042 (is-mu-branch? %ecx) # => eax -12043 3d/compare-eax-and 0/imm32/false -12044 0f 84/jump-if-= break/disp32 -12045 $emit-subx-stmt-list:branch-stmt: -12046 +-- 27 lines: # unconditional loops ----------------------------------------------------------------------------------------------------------------------------------------------------- -12073 +-- 16 lines: # unconditional breaks ---------------------------------------------------------------------------------------------------------------------------------------------------- -12089 +-- 38 lines: # simple conditional branches without a target ---------------------------------------------------------------------------------------------------------------------------- -12127 +-- 19 lines: # conditional branches with an explicit target ---------------------------------------------------------------------------------------------------------------------------- -12146 } -12147 $emit-subx-stmt-list:1-to-1: -12148 (emit-subx-stmt *(ebp+8) %ecx Primitives *(ebp+0x18) *(ebp+0x1c)) -12149 e9/jump $emit-subx-stmt-list:continue/disp32 -12150 } -12151 { -12152 $emit-subx-stmt-list:check-for-var-def: -12153 81 7/subop/compare *ecx 2/imm32/var-def # Stmt-tag -12154 75/jump-if-!= break/disp8 -12155 $emit-subx-stmt-list:var-def: -12156 (emit-subx-var-def *(ebp+8) %ecx) -12157 (push *(ebp+0x10) *(ecx+4)) # Vardef-var -12158 (push *(ebp+0x10) *(ecx+8)) # Vardef-var -12159 (push *(ebp+0x10) 0) # Live-var-register-spilled = 0 for vars on the stack -12160 # -12161 eb/jump $emit-subx-stmt-list:continue/disp8 -12162 } -12163 { -12164 $emit-subx-stmt-list:check-for-reg-var-def: -12165 81 7/subop/compare *ecx 3/imm32/reg-var-def # Stmt-tag -12166 0f 85/jump-if-!= break/disp32 -12167 $emit-subx-stmt-list:reg-var-def: -12168 # TODO: ensure that there's exactly one output -12169 (push-output-and-maybe-emit-spill *(ebp+8) %ecx *(ebp+0x10) %esi *(ebp+0x14) *(ebp+0x18) *(ebp+0x1c)) -12170 # emit the instruction as usual -12171 (emit-subx-stmt *(ebp+8) %ecx Primitives *(ebp+0x18) *(ebp+0x1c)) -12172 # -12173 eb/jump $emit-subx-stmt-list:continue/disp8 -12174 } -12175 $emit-subx-stmt-list:continue: -12176 # TODO: raise an error on unrecognized Stmt-tag -12177 (lookup *(esi+8) *(esi+0xc)) # List-next List-next => eax -12178 89/<- %esi 0/r32/eax -12179 e9/jump loop/disp32 -12180 } -12181 $emit-subx-stmt-list:emit-cleanup: -12182 (emit-cleanup-code-until-depth *(ebp+8) *(ebp+0x10) *Curr-block-depth) -12183 $emit-subx-stmt-list:clean-up: -12184 (clean-up-blocks *(ebp+0x10) *Curr-block-depth *(ebp+0x14)) -12185 $emit-subx-stmt-list:end: -12186 # . restore registers -12187 5e/pop-to-esi -12188 5b/pop-to-ebx -12189 59/pop-to-ecx -12190 58/pop-to-eax -12191 # . epilogue -12192 89/<- %esp 5/r32/ebp -12193 5d/pop-to-ebp -12194 c3/return -12195 -12196 # 'later-stmts' includes 'stmt', but will behave the same even without it; reg-var-def stmts are guaranteed not to write to function outputs. -12197 push-output-and-maybe-emit-spill: # out: (addr buffered-file), stmt: (addr reg-var-def), vars: (addr stack (handle var)), later-stmts: (addr list stmt), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) -12198 # . prologue -12199 55/push-ebp -12200 89/<- %ebp 4/r32/esp -12201 # . save registers -12202 50/push-eax -12203 51/push-ecx -12204 52/push-edx -12205 # ecx = stmt -12206 8b/-> *(ebp+0xc) 1/r32/ecx -12207 # var sv/eax: (addr stmt-var) = lookup(curr-stmt->outputs) -12208 (lookup *(ecx+0x14) *(ecx+0x18)) # Regvardef-outputs Regvardef-outputs => eax -12209 # TODO: assert !sv->is-deref? -12210 # var v/ecx: (addr var) = lookup(sv->value) -12211 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax -12212 89/<- %ecx 0/r32/eax -12213 # v->block-depth = *Curr-block-depth -12214 8b/-> *Curr-block-depth 0/r32/eax -12215 89/<- *(ecx+0x10) 0/r32/eax # Var-block-depth -12216 #? (write-buffered Stderr "var ") -12217 #? (lookup *ecx *(ecx+4)) -12218 #? (write-buffered Stderr %eax) -12219 #? (write-buffered Stderr " at depth ") -12220 #? (write-int32-hex-buffered Stderr *(ecx+0x10)) -12221 #? (write-buffered Stderr Newline) -12222 #? (flush Stderr) -12223 # ensure that v is in a register -12224 81 7/subop/compare *(ecx+0x18) 0/imm32 # Var-register -12225 0f 84/jump-if-= $push-output-and-maybe-emit-spill:abort/disp32 -12226 # var emit-spill?/edx: boolean = not-yet-spilled-this-block? && will-not-write-some-register?(fn) -12227 (not-yet-spilled-this-block? %ecx *(ebp+0x10)) # => eax -12228 89/<- %edx 0/r32/eax -12229 3d/compare-eax-and 0/imm32/false -12230 0f 84/jump-if-= $push-output-and-maybe-emit-spill:push/disp32 -12231 (will-not-write-some-register? %ecx *(ebp+0x14) *(ebp+0x18)) # => eax -12232 89/<- %edx 0/r32/eax -12233 # check emit-spill? -12234 3d/compare-eax-and 0/imm32/false -12235 0f 84/jump-if-= $push-output-and-maybe-emit-spill:push/disp32 -12236 # TODO: assert(size-of(output) == 4) -12237 # *Curr-local-stack-offset -= 4 -12238 81 5/subop/subtract *Curr-local-stack-offset 4/imm32 -12239 # emit spill -12240 (emit-indent *(ebp+8) *Curr-block-depth) -12241 (write-buffered *(ebp+8) "ff 6/subop/push %") -12242 (lookup *(ecx+0x18) *(ecx+0x1c)) # Var-register Var-register => eax -12243 (write-buffered *(ebp+8) %eax) -12244 (write-buffered *(ebp+8) Newline) -12245 $push-output-and-maybe-emit-spill:push: -12246 8b/-> *(ebp+0xc) 1/r32/ecx -12247 (lookup *(ecx+0x14) *(ecx+0x18)) # Regvardef-outputs Regvardef-outputs => eax -12248 # push(vars, {sv->value, emit-spill?}) -12249 (push *(ebp+0x10) *eax) # Stmt-var-value -12250 (push *(ebp+0x10) *(eax+4)) # Stmt-var-value -12251 (push *(ebp+0x10) %edx) -12252 $push-output-and-maybe-emit-spill:end: -12253 # . restore registers -12254 5a/pop-to-edx -12255 59/pop-to-ecx -12256 58/pop-to-eax -12257 # . epilogue -12258 89/<- %esp 5/r32/ebp -12259 5d/pop-to-ebp -12260 c3/return -12261 -12262 $push-output-and-maybe-emit-spill:abort: -12263 # error("var '" var->name "' initialized from an instruction must live in a register\n") -12264 (write-buffered *(ebp+0x1c) "var '") -12265 (write-buffered *(ebp+0x1c) *eax) # Var-name -12266 (write-buffered *(ebp+0x1c) "' initialized from an instruction must live in a register\n") -12267 (flush *(ebp+0x1c)) -12268 (stop *(ebp+0x20) 1) -12269 # never gets here -12270 -12271 emit-subx-cleanup-and-unconditional-nonlocal-branch: # out: (addr buffered-file), stmt: (addr stmt1), vars: (addr stack live-var) -12272 # . prologue -12273 55/push-ebp -12274 89/<- %ebp 4/r32/esp -12275 # . save registers -12276 50/push-eax -12277 51/push-ecx -12278 # ecx = stmt -12279 8b/-> *(ebp+0xc) 1/r32/ecx -12280 # var target/eax: (addr array byte) = curr-stmt->inouts->value->name -12281 (lookup *(ecx+0xc) *(ecx+0x10)) # Stmt1-inouts Stmt1-inouts => eax -12282 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax -12283 (lookup *eax *(eax+4)) # Var-name Var-name => eax -12284 # clean up until target block -12285 (emit-cleanup-code-until-target *(ebp+8) *(ebp+0x10) %eax) -12286 # emit jump to target block -12287 (emit-indent *(ebp+8) *Curr-block-depth) -12288 (write-buffered *(ebp+8) "e9/jump ") -12289 (write-buffered *(ebp+8) %eax) -12290 (lookup *(ecx+4) *(ecx+8)) # Stmt1-operation Stmt1-operation => eax -12291 (string-starts-with? %eax "break") -12292 3d/compare-eax-and 0/imm32/false -12293 { -12294 74/jump-if-= break/disp8 -12295 (write-buffered *(ebp+8) ":break/disp32\n") -12296 } -12297 3d/compare-eax-and 0/imm32/false # just in case the function call modified flags -12298 { -12299 75/jump-if-!= break/disp8 -12300 (write-buffered *(ebp+8) ":loop/disp32\n") -12301 } -12302 $emit-subx-cleanup-and-unconditional-nonlocal-branch:end: -12303 # . restore registers -12304 59/pop-to-ecx -12305 58/pop-to-eax -12306 # . epilogue -12307 89/<- %esp 5/r32/ebp -12308 5d/pop-to-ebp -12309 c3/return -12310 -12311 is-mu-branch?: # stmt: (addr stmt1) -> result/eax: boolean -12312 # . prologue -12313 55/push-ebp -12314 89/<- %ebp 4/r32/esp -12315 # . save registers -12316 51/push-ecx -12317 # ecx = lookup(stmt->operation) -12318 8b/-> *(ebp+8) 1/r32/ecx -12319 (lookup *(ecx+4) *(ecx+8)) # Stmt1-operation Stmt1-operation => eax -12320 89/<- %ecx 0/r32/eax -12321 # if (stmt->operation starts with "loop") return true -12322 (string-starts-with? %ecx "loop") # => eax -12323 3d/compare-eax-and 0/imm32/false -12324 75/jump-if-not-equal $is-mu-branch?:end/disp8 -12325 # otherwise return (stmt->operation starts with "break") -12326 (string-starts-with? %ecx "break") # => eax -12327 $is-mu-branch?:end: -12328 # . restore registers -12329 59/pop-to-ecx -12330 # . epilogue -12331 89/<- %esp 5/r32/ebp -12332 5d/pop-to-ebp -12333 c3/return -12334 -12335 emit-reverse-break: # out: (addr buffered-file), stmt: (addr stmt1) -12336 # . prologue -12337 55/push-ebp -12338 89/<- %ebp 4/r32/esp -12339 # . save registers -12340 50/push-eax -12341 # eax = stmt -12342 8b/-> *(ebp+0xc) 0/r32/eax -12343 # -12344 (lookup *(eax+4) *(eax+8)) # Stmt1-operation Stmt1-operation => eax -12345 (get Reverse-branch %eax 0x10 "reverse-branch: ") # => eax: (addr handle array byte) -12346 (emit-indent *(ebp+8) *Curr-block-depth) -12347 (lookup *eax *(eax+4)) # => eax -12348 (write-buffered *(ebp+8) %eax) -12349 (write-buffered *(ebp+8) " break/disp32\n") -12350 $emit-reverse-break:end: -12351 # . restore registers -12352 58/pop-to-eax -12353 # . epilogue -12354 89/<- %esp 5/r32/ebp -12355 5d/pop-to-ebp -12356 c3/return -12357 -12358 == data -12359 -12360 # Table from Mu branch instructions to the reverse SubX opcodes for them. -12361 Reverse-branch: # (table (handle array byte) (handle array byte)) -12362 # a table is a stream -12363 0x140/imm32/write -12364 0/imm32/read -12365 0x140/imm32/size -12366 # data -12367 0x11/imm32/alloc-id _string-break-if-=/imm32 0x11/imm32/alloc-id _string_0f_85_jump_label/imm32 -12368 0x11/imm32/alloc-id _string-loop-if-=/imm32 0x11/imm32/alloc-id _string_0f_85_jump_label/imm32 -12369 0x11/imm32/alloc-id _string-break-if-!=/imm32 0x11/imm32/alloc-id _string_0f_84_jump_label/imm32 -12370 0x11/imm32/alloc-id _string-loop-if-!=/imm32 0x11/imm32/alloc-id _string_0f_84_jump_label/imm32 -12371 0x11/imm32/alloc-id _string-break-if-</imm32 0x11/imm32/alloc-id _string_0f_8d_jump_label/imm32 -12372 0x11/imm32/alloc-id _string-loop-if-</imm32 0x11/imm32/alloc-id _string_0f_8d_jump_label/imm32 -12373 0x11/imm32/alloc-id _string-break-if->/imm32 0x11/imm32/alloc-id _string_0f_8e_jump_label/imm32 -12374 0x11/imm32/alloc-id _string-loop-if->/imm32 0x11/imm32/alloc-id _string_0f_8e_jump_label/imm32 -12375 0x11/imm32/alloc-id _string-break-if-<=/imm32 0x11/imm32/alloc-id _string_0f_87_jump_label/imm32 -12376 0x11/imm32/alloc-id _string-loop-if-<=/imm32 0x11/imm32/alloc-id _string_0f_87_jump_label/imm32 -12377 0x11/imm32/alloc-id _string-break-if->=/imm32 0x11/imm32/alloc-id _string_0f_8c_jump_label/imm32 -12378 0x11/imm32/alloc-id _string-loop-if->=/imm32 0x11/imm32/alloc-id _string_0f_8c_jump_label/imm32 -12379 0x11/imm32/alloc-id _string-break-if-addr</imm32 0x11/imm32/alloc-id _string_0f_83_jump_label/imm32 -12380 0x11/imm32/alloc-id _string-loop-if-addr</imm32 0x11/imm32/alloc-id _string_0f_83_jump_label/imm32 -12381 0x11/imm32/alloc-id _string-break-if-addr>/imm32 0x11/imm32/alloc-id _string_0f_86_jump_label/imm32 -12382 0x11/imm32/alloc-id _string-loop-if-addr>/imm32 0x11/imm32/alloc-id _string_0f_86_jump_label/imm32 -12383 0x11/imm32/alloc-id _string-break-if-addr<=/imm32 0x11/imm32/alloc-id _string_0f_87_jump_label/imm32 -12384 0x11/imm32/alloc-id _string-loop-if-addr<=/imm32 0x11/imm32/alloc-id _string_0f_87_jump_label/imm32 -12385 0x11/imm32/alloc-id _string-break-if-addr>=/imm32 0x11/imm32/alloc-id _string_0f_82_jump_label/imm32 -12386 0x11/imm32/alloc-id _string-loop-if-addr>=/imm32 0x11/imm32/alloc-id _string_0f_82_jump_label/imm32 -12387 -12388 == code -12389 -12390 emit-unconditional-jump-to-depth: # out: (addr buffered-file), vars: (addr stack live-var), depth: int, label-suffix: (addr array byte) -12391 # . prologue -12392 55/push-ebp -12393 89/<- %ebp 4/r32/esp -12394 # . save registers -12395 50/push-eax -12396 51/push-ecx -12397 52/push-edx -12398 53/push-ebx -12399 56/push-esi -12400 # ecx = vars -12401 8b/-> *(ebp+0xc) 1/r32/ecx -12402 # var eax: int = vars->top -12403 8b/-> *ecx 0/r32/eax -12404 # var curr/esi: (addr handle var) = &vars->data[vars->top - 12] -12405 8d/copy-address *(ecx+eax-4) 6/r32/esi # vars + 8 + vars->top - 12/Live-var-size -12406 # var min/ecx: (addr handle var) = vars->data -12407 8d/copy-address *(ecx+8) 1/r32/ecx -12408 # edx = depth -12409 8b/-> *(ebp+0x10) 2/r32/edx -12410 { -12411 $emit-unconditional-jump-to-depth:loop: -12412 # if (curr < min) break -12413 39/compare %esi 1/r32/ecx -12414 0f 82/jump-if-addr< break/disp32 -12415 # var v/ebx: (addr var) = lookup(*curr) -12416 (lookup *esi *(esi+4)) # => eax -12417 89/<- %ebx 0/r32/eax -12418 # if (v->block-depth < until-block-depth) break -12419 39/compare *(ebx+0x10) 2/r32/edx # Var-block-depth -12420 0f 8c/jump-if-< break/disp32 -12421 { -12422 $emit-unconditional-jump-to-depth:check: -12423 # if v->block-depth != until-block-depth, continue -12424 39/compare *(ebx+0x10) 2/r32/edx # Var-block-depth -12425 0f 85/jump-if-!= break/disp32 -12426 $emit-unconditional-jump-to-depth:depth-found: -12427 # if v is not a literal, continue -12428 (size-of %ebx) # => eax -12429 3d/compare-eax-and 0/imm32 -12430 0f 85/jump-if-!= break/disp32 -12431 $emit-unconditional-jump-to-depth:label-found: -12432 # emit unconditional jump, then return -12433 (emit-indent *(ebp+8) *Curr-block-depth) -12434 (write-buffered *(ebp+8) "e9/jump ") -12435 (lookup *ebx *(ebx+4)) # Var-name Var-name => eax -12436 (write-buffered *(ebp+8) %eax) -12437 (write-buffered *(ebp+8) ":") -12438 (write-buffered *(ebp+8) *(ebp+0x14)) -12439 (write-buffered *(ebp+8) "/disp32\n") -12440 eb/jump $emit-unconditional-jump-to-depth:end/disp8 -12441 } -12442 # curr -= 12 -12443 81 5/subop/subtract %esi 0xc/imm32 -12444 e9/jump loop/disp32 -12445 } -12446 # TODO: error if no label at 'depth' was found -12447 $emit-unconditional-jump-to-depth:end: -12448 # . restore registers -12449 5e/pop-to-esi -12450 5b/pop-to-ebx -12451 5a/pop-to-edx -12452 59/pop-to-ecx -12453 58/pop-to-eax -12454 # . epilogue -12455 89/<- %esp 5/r32/ebp -12456 5d/pop-to-ebp -12457 c3/return -12458 -12459 # emit clean-up code for 'vars' until some block depth -12460 # doesn't actually modify 'vars' so we need traverse manually inside the stack -12461 emit-cleanup-code-until-depth: # out: (addr buffered-file), vars: (addr stack live-var), until-block-depth: int -12462 # . prologue -12463 55/push-ebp -12464 89/<- %ebp 4/r32/esp -12465 # . save registers -12466 50/push-eax -12467 51/push-ecx -12468 52/push-edx -12469 53/push-ebx -12470 56/push-esi -12471 #? (write-buffered Stderr "--- cleanup\n") -12472 #? (flush Stderr) -12473 # ecx = vars -12474 8b/-> *(ebp+0xc) 1/r32/ecx -12475 # var esi: int = vars->top -12476 8b/-> *ecx 6/r32/esi -12477 # var curr/esi: (addr handle var) = &vars->data[vars->top - 12] -12478 8d/copy-address *(ecx+esi-4) 6/r32/esi # vars + 8 + vars->top - 12/Live-var-size -12479 # var min/ecx: (addr handle var) = vars->data -12480 81 0/subop/add %ecx 8/imm32 -12481 # edx = until-block-depth -12482 8b/-> *(ebp+0x10) 2/r32/edx -12483 { -12484 $emit-cleanup-code-until-depth:loop: -12485 # if (curr < min) break -12486 39/compare %esi 1/r32/ecx -12487 0f 82/jump-if-addr< break/disp32 -12488 # var v/ebx: (addr var) = lookup(*curr) -12489 (lookup *esi *(esi+4)) # => eax -12490 89/<- %ebx 0/r32/eax -12491 #? (lookup *ebx *(ebx+4)) # Var-name -12492 #? (write-buffered Stderr "var ") -12493 #? (write-buffered Stderr %eax) -12494 #? (write-buffered Stderr Newline) -12495 #? (flush Stderr) -12496 # if (v->block-depth < until-block-depth) break -12497 39/compare *(ebx+0x10) 2/r32/edx # Var-block-depth -12498 0f 8c/jump-if-< break/disp32 -12499 # if v is in a register -12500 81 7/subop/compare *(ebx+0x18) 0/imm32 # Var-register -12501 { -12502 0f 84/jump-if-= break/disp32 -12503 { -12504 $emit-cleanup-code-until-depth:check-for-previous-spill: -12505 8b/-> *(esi+8) 0/r32/eax # Live-var-register-spilled -12506 3d/compare-eax-and 0/imm32/false -12507 74/jump-if-= break/disp8 -12508 $emit-cleanup-code-until-depth:reclaim-var-in-register: -12509 (emit-indent *(ebp+8) *Curr-block-depth) -12510 (write-buffered *(ebp+8) "8f 0/subop/pop %") -12511 (lookup *(ebx+0x18) *(ebx+0x1c)) # Var-register Var-register => eax -12512 (write-buffered *(ebp+8) %eax) -12513 (write-buffered *(ebp+8) Newline) -12514 } -12515 eb/jump $emit-cleanup-code-until-depth:continue/disp8 -12516 } -12517 # otherwise v is on the stack -12518 { -12519 75/jump-if-!= break/disp8 -12520 $emit-cleanup-code-until-depth:var-on-stack: -12521 (size-of %ebx) # => eax -12522 # don't emit code for labels -12523 3d/compare-eax-and 0/imm32 -12524 74/jump-if-= break/disp8 -12525 $emit-cleanup-code-until-depth:reclaim-var-on-stack: -12526 (emit-indent *(ebp+8) *Curr-block-depth) -12527 (write-buffered *(ebp+8) "81 0/subop/add %esp ") -12528 (write-int32-hex-buffered *(ebp+8) %eax) -12529 (write-buffered *(ebp+8) "/imm32\n") -12530 } -12531 $emit-cleanup-code-until-depth:continue: -12532 # curr -= 12 -12533 81 5/subop/subtract %esi 0xc/imm32 -12534 e9/jump loop/disp32 -12535 } -12536 $emit-cleanup-code-until-depth:end: -12537 # . restore registers -12538 5e/pop-to-esi -12539 5b/pop-to-ebx -12540 5a/pop-to-edx -12541 59/pop-to-ecx -12542 58/pop-to-eax -12543 # . epilogue -12544 89/<- %esp 5/r32/ebp -12545 5d/pop-to-ebp -12546 c3/return -12547 -12548 # emit clean-up code for 'vars' until a given label is encountered -12549 # doesn't actually modify 'vars' so we need traverse manually inside the stack -12550 emit-cleanup-code-until-target: # out: (addr buffered-file), vars: (addr stack live-var), until-block-label: (addr array byte) -12551 # . prologue -12552 55/push-ebp -12553 89/<- %ebp 4/r32/esp -12554 # . save registers -12555 50/push-eax -12556 51/push-ecx -12557 52/push-edx -12558 53/push-ebx -12559 # ecx = vars -12560 8b/-> *(ebp+0xc) 1/r32/ecx -12561 # var eax: int = vars->top -12562 8b/-> *ecx 0/r32/eax -12563 # var curr/edx: (addr handle var) = &vars->data[vars->top - 12] -12564 8d/copy-address *(ecx+eax-4) 2/r32/edx # vars + 8 + vars->top - 12/Live-var-size -12565 # var min/ecx: (addr handle var) = vars->data -12566 81 0/subop/add %ecx 8/imm32 -12567 { -12568 $emit-cleanup-code-until-target:loop: -12569 # if (curr < min) break -12570 39/compare %edx 1/r32/ecx -12571 0f 82/jump-if-addr< break/disp32 -12572 # var v/ebx: (handle var) = lookup(*curr) -12573 (lookup *edx *(edx+4)) # => eax -12574 89/<- %ebx 0/r32/eax -12575 # if (v->name == until-block-label) break -12576 (lookup *ebx *(ebx+4)) # Var-name Var-name => eax -12577 (string-equal? %eax *(ebp+0x10)) # => eax -12578 3d/compare-eax-and 0/imm32/false -12579 0f 85/jump-if-!= break/disp32 -12580 # if v is in a register -12581 81 7/subop/compare *(ebx+0x18) 0/imm32 # Var-register -12582 { -12583 0f 84/jump-if-= break/disp32 -12584 { -12585 $emit-cleanup-code-until-target:check-for-previous-spill: -12586 8b/-> *(edx+8) 0/r32/eax # Live-var-register-spilled -12587 3d/compare-eax-and 0/imm32/false -12588 74/jump-if-= break/disp8 -12589 $emit-cleanup-code-until-target:reclaim-var-in-register: -12590 (emit-indent *(ebp+8) *Curr-block-depth) -12591 (write-buffered *(ebp+8) "8f 0/subop/pop %") -12592 (lookup *(ebx+0x18) *(ebx+0x1c)) # Var-register Var-register => eax -12593 (write-buffered *(ebp+8) %eax) -12594 (write-buffered *(ebp+8) Newline) -12595 } -12596 eb/jump $emit-cleanup-code-until-target:continue/disp8 -12597 } -12598 # otherwise v is on the stack -12599 { -12600 75/jump-if-!= break/disp8 -12601 $emit-cleanup-code-until-target:reclaim-var-on-stack: -12602 (size-of %ebx) # => eax -12603 # don't emit code for labels -12604 3d/compare-eax-and 0/imm32 -12605 74/jump-if-= break/disp8 -12606 # -12607 (emit-indent *(ebp+8) *Curr-block-depth) -12608 (write-buffered *(ebp+8) "81 0/subop/add %esp ") -12609 (write-int32-hex-buffered *(ebp+8) %eax) -12610 (write-buffered *(ebp+8) "/imm32\n") -12611 } -12612 $emit-cleanup-code-until-target:continue: -12613 # curr -= 12 -12614 81 5/subop/subtract %edx 0xc/imm32 -12615 e9/jump loop/disp32 -12616 } -12617 $emit-cleanup-code-until-target:end: -12618 # . restore registers -12619 5b/pop-to-ebx -12620 5a/pop-to-edx -12621 59/pop-to-ecx -12622 58/pop-to-eax -12623 # . epilogue -12624 89/<- %esp 5/r32/ebp -12625 5d/pop-to-ebp -12626 c3/return -12627 -12628 # Return true if there isn't a variable in 'vars' with the same block-depth -12629 # and register as 'v'. -12630 # 'v' is guaranteed not to be within 'vars'. -12631 not-yet-spilled-this-block?: # v: (addr var), vars: (addr stack live-var) -> result/eax: boolean -12632 # . prologue -12633 55/push-ebp -12634 89/<- %ebp 4/r32/esp -12635 # . save registers -12636 51/push-ecx -12637 52/push-edx -12638 53/push-ebx -12639 56/push-esi -12640 57/push-edi -12641 # ecx = vars -12642 8b/-> *(ebp+0xc) 1/r32/ecx -12643 # var eax: int = vars->top -12644 8b/-> *ecx 0/r32/eax -12645 # var curr/edx: (addr handle var) = &vars->data[vars->top - 12] -12646 8d/copy-address *(ecx+eax-4) 2/r32/edx # vars + 8 + vars->top - 12/Live-var-size -12647 # var min/ecx: (addr handle var) = vars->data -12648 8d/copy-address *(ecx+8) 1/r32/ecx -12649 # var depth/ebx: int = v->block-depth -12650 8b/-> *(ebp+8) 3/r32/ebx -12651 8b/-> *(ebx+0x10) 3/r32/ebx # Var-block-depth -12652 # var needle/esi: (addr array byte) = v->register -12653 8b/-> *(ebp+8) 6/r32/esi -12654 (lookup *(esi+0x18) *(esi+0x1c)) # Var-register Var-register => eax -12655 89/<- %esi 0/r32/eax -12656 { -12657 $not-yet-spilled-this-block?:loop: -12658 # if (curr < min) break -12659 39/compare %edx 1/r32/ecx -12660 0f 82/jump-if-addr< break/disp32 -12661 # var cand/edi: (addr var) = lookup(*curr) -12662 (lookup *edx *(edx+4)) # => eax -12663 89/<- %edi 0/r32/eax -12664 # if (cand->block-depth < depth) break -12665 39/compare *(edi+0x10) 3/r32/ebx # Var-block-depth -12666 0f 8c/jump-if-< break/disp32 -12667 # var cand-reg/edi: (array array byte) = cand->reg -12668 (lookup *(edi+0x18) *(edi+0x1c)) # Var-register Var-register => eax -12669 89/<- %edi 0/r32/eax -12670 # if (cand-reg == null) continue -12671 { -12672 $not-yet-spilled-this-block?:check-reg: -12673 81 7/subop/compare %edi 0/imm32 -12674 0f 84/jump-if-= break/disp32 -12675 # if (cand-reg == needle) return true -12676 (string-equal? %esi %edi) # => eax -12677 3d/compare-eax-and 0/imm32/false -12678 74/jump-if-= break/disp8 -12679 $not-yet-spilled-this-block?:return-false: -12680 b8/copy-to-eax 0/imm32/false -12681 eb/jump $not-yet-spilled-this-block?:end/disp8 -12682 } -12683 $not-yet-spilled-this-block?:continue: -12684 # curr -= 12 -12685 81 5/subop/subtract %edx 0xc/imm32 -12686 e9/jump loop/disp32 -12687 } -12688 $not-yet-spilled-this-block?:return-true: -12689 # return true -12690 b8/copy-to-eax 1/imm32/true -12691 $not-yet-spilled-this-block?:end: -12692 # . restore registers -12693 5f/pop-to-edi -12694 5e/pop-to-esi -12695 5b/pop-to-ebx -12696 5a/pop-to-edx -12697 59/pop-to-ecx -12698 # . epilogue -12699 89/<- %esp 5/r32/ebp -12700 5d/pop-to-ebp -12701 c3/return -12702 -12703 # could the register of 'v' ever be written to by one of the vars in fn-outputs? -12704 will-not-write-some-register?: # v: (addr var), stmts: (addr list stmt), fn: (addr function) -> result/eax: boolean -12705 # . prologue -12706 55/push-ebp -12707 89/<- %ebp 4/r32/esp -12708 # eax = v -12709 8b/-> *(ebp+8) 0/r32/eax -12710 # var reg/eax: (addr array byte) = lookup(v->register) -12711 (lookup *(eax+0x18) *(eax+0x1c)) # Var-register Var-register => eax -12712 # var target/eax: (addr var) = find-register(fn-outputs, reg) -12713 (find-register *(ebp+0x10) %eax) # => eax -12714 # if (target == 0) return true -12715 { -12716 3d/compare-eax-and 0/imm32 -12717 75/jump-if-!= break/disp8 -12718 b8/copy-to-eax 1/imm32/true -12719 eb/jump $will-not-write-some-register?:end/disp8 -12720 } -12721 # return !assigns-in-stmts?(stmts, target) -12722 (assigns-in-stmts? *(ebp+0xc) %eax) # => eax -12723 3d/compare-eax-and 0/imm32/false -12724 # assume: true = 1, so no need to mask with 0x000000ff -12725 0f 94/set-if-= %al -12726 $will-not-write-some-register?:end: -12727 # . epilogue -12728 89/<- %esp 5/r32/ebp -12729 5d/pop-to-ebp -12730 c3/return -12731 -12732 # return fn output with matching register -12733 # always returns false if 'reg' is null -12734 find-register: # fn: (addr function), reg: (addr array byte) -> result/eax: (addr var) -12735 # . prologue -12736 55/push-ebp -12737 89/<- %ebp 4/r32/esp -12738 # . save registers -12739 51/push-ecx -12740 # var curr/ecx: (addr list var) = lookup(fn->outputs) -12741 8b/-> *(ebp+8) 1/r32/ecx -12742 (lookup *(ecx+0x10) *(ecx+0x14)) # Function-outputs Function-outputs => eax -12743 89/<- %ecx 0/r32/eax -12744 { -12745 $find-register:loop: -12746 # if (curr == 0) break -12747 81 7/subop/compare %ecx 0/imm32 -12748 74/jump-if-= break/disp8 -12749 # eax = curr->value->register -12750 (lookup *ecx *(ecx+4)) # List-value List-value => eax -12751 (lookup *(eax+0x18) *(eax+0x1c)) # Var-register Var-register => eax -12752 # if (eax == reg) return curr->value -12753 $find-register:compare: -12754 (string-equal? *(ebp+0xc) %eax) # => eax -12755 { -12756 3d/compare-eax-and 0/imm32/false -12757 74/jump-if-= break/disp8 -12758 $find-register:found: -12759 (lookup *ecx *(ecx+4)) # List-value List-value => eax -12760 eb/jump $find-register:end/disp8 -12761 } -12762 # curr = lookup(curr->next) -12763 (lookup *(ecx+8) *(ecx+0xc)) # List-next List-next => eax -12764 89/<- %ecx 0/r32/eax -12765 # -12766 eb/jump loop/disp8 -12767 } -12768 $find-register:end: -12769 # . restore registers -12770 59/pop-to-ecx -12771 # . epilogue -12772 89/<- %esp 5/r32/ebp -12773 5d/pop-to-ebp -12774 c3/return -12775 -12776 assigns-in-stmts?: # stmts: (addr list stmt), v: (addr var) -> result/eax: boolean -12777 # . prologue -12778 55/push-ebp -12779 89/<- %ebp 4/r32/esp -12780 # . save registers -12781 51/push-ecx -12782 # var curr/ecx: (addr list stmt) = stmts -12783 8b/-> *(ebp+8) 1/r32/ecx -12784 { -12785 # if (curr == 0) break -12786 81 7/subop/compare %ecx 0/imm32 -12787 74/jump-if-= break/disp8 -12788 # if assigns-in-stmt?(curr->value, v) return true -12789 (lookup *ecx *(ecx+4)) # List-value List-value => eax -12790 (assigns-in-stmt? %eax *(ebp+0xc)) # => eax -12791 3d/compare-eax-and 0/imm32/false -12792 75/jump-if-!= break/disp8 -12793 # curr = lookup(curr->next) -12794 (lookup *(ecx+8) *(ecx+0xc)) # List-next List-next => eax -12795 89/<- %ecx 0/r32/eax -12796 # -12797 eb/jump loop/disp8 -12798 } -12799 $assigns-in-stmts?:end: -12800 # . restore registers -12801 59/pop-to-ecx -12802 # . epilogue -12803 89/<- %esp 5/r32/ebp -12804 5d/pop-to-ebp -12805 c3/return -12806 -12807 assigns-in-stmt?: # stmt: (addr stmt), v: (addr var) -> result/eax: boolean -12808 # . prologue -12809 55/push-ebp -12810 89/<- %ebp 4/r32/esp -12811 # . save registers -12812 51/push-ecx -12813 # ecx = stmt -12814 8b/-> *(ebp+8) 1/r32/ecx -12815 # if stmt is a stmt1, return assigns-in-stmt-vars?(stmt->outputs, v) -12816 { -12817 81 7/subop/compare *ecx 1/imm32/stmt1 # Stmt-tag -12818 75/jump-if-!= break/disp8 -12819 (lookup *(ecx+0x14) *(ecx+0x18)) # Stmt1-outputs Stmt1-outputs => eax -12820 (assigns-in-stmt-vars? %eax *(ebp+0xc)) # => eax -12821 eb/jump $assigns-in-stmt?:end/disp8 -12822 } -12823 # if stmt is a block, return assigns-in-stmts?(stmt->stmts, v) -12824 { -12825 81 7/subop/compare *ecx 0/imm32/block # Stmt-tag -12826 75/jump-if-!= break/disp8 -12827 (lookup *(ecx+4) *(ecx+8)) # Block-stmts Block-stmts => eax -12828 (assigns-in-stmts? %eax *(ebp+0xc)) # => eax -12829 eb/jump $assigns-in-stmt?:end/disp8 -12830 } -12831 # otherwise return false -12832 b8/copy 0/imm32/false -12833 $assigns-in-stmt?:end: -12834 # . restore registers -12835 59/pop-to-ecx -12836 # . epilogue -12837 89/<- %esp 5/r32/ebp -12838 5d/pop-to-ebp -12839 c3/return -12840 -12841 assigns-in-stmt-vars?: # stmt-var: (addr stmt-var), v: (addr var) -> result/eax: boolean -12842 # . prologue -12843 55/push-ebp -12844 89/<- %ebp 4/r32/esp -12845 # . save registers -12846 51/push-ecx -12847 # var curr/ecx: (addr stmt-var) = stmt-var -12848 8b/-> *(ebp+8) 1/r32/ecx -12849 { -12850 # if (curr == 0) break -12851 81 7/subop/compare %ecx 0/imm32 -12852 74/jump-if-= break/disp8 -12853 # eax = lookup(curr->value) -12854 (lookup *ecx *(ecx+4)) # Stmt-var-value Stmt-var-value => eax -12855 # if (eax == v && curr->is-deref? == false) return true -12856 { -12857 39/compare *(ebp+0xc) 0/r32/eax -12858 75/jump-if-!= break/disp8 -12859 81 7/subop/compare *(ecx+0x10) 0/imm32/false # Stmt-var-is-deref -12860 75/jump-if-!= break/disp8 -12861 b8/copy-to-eax 1/imm32/true -12862 eb/jump $assigns-in-stmt-vars?:end/disp8 -12863 } -12864 # curr = lookup(curr->next) -12865 (lookup *(ecx+8) *(ecx+0xc)) # Stmt-var-next Stmt-var-next => eax -12866 89/<- %ecx 0/r32/eax -12867 # -12868 eb/jump loop/disp8 -12869 } -12870 $assigns-in-stmt-vars?:end: -12871 # . restore registers -12872 59/pop-to-ecx -12873 # . epilogue -12874 89/<- %esp 5/r32/ebp -12875 5d/pop-to-ebp -12876 c3/return -12877 -12878 # is there a var before 'v' with the same block-depth and register on the 'vars' stack? -12879 # v is guaranteed to be within vars -12880 # 'start' is provided as an optimization, a pointer within vars -12881 # *start == v -12882 same-register-spilled-before?: # v: (addr var), vars: (addr stack (handle var)), start: (addr var) -> result/eax: boolean -12883 # . prologue -12884 55/push-ebp -12885 89/<- %ebp 4/r32/esp -12886 # . save registers -12887 51/push-ecx -12888 52/push-edx -12889 53/push-ebx -12890 56/push-esi -12891 57/push-edi -12892 # ecx = v -12893 8b/-> *(ebp+8) 1/r32/ecx -12894 # var reg/edx: (addr array byte) = lookup(v->register) -12895 (lookup *(ecx+0x18) *(ecx+0x1c)) # Var-register Var-register => eax -12896 89/<- %edx 0/r32/eax -12897 # var depth/ebx: int = v->block-depth -12898 8b/-> *(ecx+0x10) 3/r32/ebx # Var-block-depth -12899 # var min/ecx: (addr handle var) = vars->data -12900 8b/-> *(ebp+0xc) 1/r32/ecx -12901 81 0/subop/add %ecx 8/imm32 -12902 # TODO: check that start >= min and start < &vars->data[top] -12903 # TODO: check that *start == v -12904 # var curr/esi: (addr handle var) = start -12905 8b/-> *(ebp+0x10) 6/r32/esi -12906 # curr -= 8 -12907 81 5/subop/subtract %esi 8/imm32 -12908 { -12909 $same-register-spilled-before?:loop: -12910 # if (curr < min) break -12911 39/compare %esi 1/r32/ecx -12912 0f 82/jump-if-addr< break/disp32 -12913 # var x/eax: (addr var) = lookup(*curr) -12914 (lookup *esi *(esi+4)) # => eax -12915 # if (x->block-depth < depth) break -12916 39/compare *(eax+0x10) 3/r32/ebx # Var-block-depth -12917 0f 8c/jump-if-< break/disp32 -12918 # if (x->register == 0) continue -12919 81 7/subop/compare *(eax+0x18) 0/imm32 # Var-register -12920 74/jump-if-= $same-register-spilled-before?:continue/disp8 -12921 # if (x->register == reg) return true -12922 (lookup *(eax+0x18) *(eax+0x1c)) # Var-register Var-register => eax -12923 (string-equal? %eax %edx) # => eax -12924 3d/compare-eax-and 0/imm32/false -12925 b8/copy-to-eax 1/imm32/true -12926 75/jump-if-!= $same-register-spilled-before?:end/disp8 -12927 $same-register-spilled-before?:continue: -12928 # curr -= 8 -12929 81 5/subop/subtract %esi 8/imm32 -12930 e9/jump loop/disp32 -12931 } -12932 $same-register-spilled-before?:false: -12933 b8/copy-to-eax 0/imm32/false -12934 $same-register-spilled-before?:end: -12935 # . restore registers -12936 5f/pop-to-edi -12937 5e/pop-to-esi -12938 5b/pop-to-ebx -12939 5a/pop-to-edx -12940 59/pop-to-ecx -12941 # . epilogue -12942 89/<- %esp 5/r32/ebp -12943 5d/pop-to-ebp -12944 c3/return -12945 -12946 # Clean up global state for 'vars' until some block depth (inclusive). -12947 # -12948 # This would be a simple series of pops, if it wasn't for fn outputs, which -12949 # can occur anywhere in the stack. -12950 # So we have to _compact_ the entire array underlying the stack. -12951 # -12952 # We want to allow a fn output register to be written to by locals before the -12953 # output is set. -12954 # So fn outputs can't just be pushed at the start of the function. -12955 # -12956 # We want to allow other locals to shadow a fn output register after the -12957 # output is set. -12958 # So the output can't just always override anything in the stack. Sequence matters. -12959 clean-up-blocks: # vars: (addr stack live-var), until-block-depth: int, fn: (addr function) -12960 # pseudocode: -12961 # to = vars->top (which points outside the stack) -12962 # while true -12963 # if to <= 0 -12964 # break -12965 # var v = vars->data[to-1] -12966 # if v.depth < until and !in-function-outputs?(fn, v) -12967 # break -12968 # --to -12969 # from = to -12970 # while true -12971 # if from >= vars->top -12972 # break -12973 # assert(from >= to) -12974 # v = vars->data[from] -12975 # if in-function-outputs?(fn, v) -12976 # if from > to -12977 # vars->data[to] = vars->data[from] -12978 # ++to -12979 # ++from -12980 # vars->top = to -12981 # -12982 # . prologue -12983 55/push-ebp -12984 89/<- %ebp 4/r32/esp -12985 # . save registers -12986 50/push-eax -12987 52/push-edx -12988 53/push-ebx -12989 56/push-esi -12990 57/push-edi -12991 # ebx = vars -12992 8b/-> *(ebp+8) 3/r32/ebx -12993 # edx = until-block-depth -12994 8b/-> *(ebp+0xc) 2/r32/edx -12995 $clean-up-blocks:phase1: -12996 # var to/edi: int = vars->top -12997 8b/-> *ebx 7/r32/edi -12998 { -12999 $clean-up-blocks:loop1: -13000 # if (to <= 0) break -13001 81 7/subop/compare %edi 0/imm32 -13002 7e/jump-if-<= break/disp8 -13003 # var v/eax: (addr var) = lookup(vars->data[to-1]->var) -13004 8d/copy-address *(ebx+edi-4) 0/r32/eax # vars + 8 + to - 12 -13005 (lookup *eax *(eax+4)) # => eax -13006 # if (v->block-depth >= until-block-depth) continue -13007 39/compare *(eax+0x10) 2/r32/edx # Var-block-depth +11971 # if is-mu-array?(t) return size-of-array(t) +11972 { +11973 (is-mu-array? %ecx) # => eax +11974 3d/compare-eax-and 0/imm32/false +11975 74/jump-if-= break/disp8 +11976 (size-of-array %ecx) # => eax +11977 eb/jump $size-of:end/disp8 +11978 } +11979 # if (!t->is-atom?) t = lookup(t->left) +11980 { +11981 81 7/subop/compare *ecx 0/imm32/false # Type-tree-is-atom +11982 75/jump-if-!= break/disp8 +11983 (lookup *(ecx+4) *(ecx+8)) # Type-tree-left Type-tree-left => eax +11984 89/<- %ecx 0/r32/eax +11985 } +11986 # TODO: assert t->is-atom? +11987 (size-of-type-id *(ecx+4)) # Type-tree-value => eax +11988 $size-of:end: +11989 # . restore registers +11990 59/pop-to-ecx +11991 # . epilogue +11992 89/<- %esp 5/r32/ebp +11993 5d/pop-to-ebp +11994 c3/return +11995 +11996 size-of-deref: # v: (addr var) -> result/eax: int +11997 # . prologue +11998 55/push-ebp +11999 89/<- %ebp 4/r32/esp +12000 # . save registers +12001 51/push-ecx +12002 # var t/ecx: (addr type-tree) = lookup(v->type) +12003 8b/-> *(ebp+8) 1/r32/ecx +12004 (lookup *(ecx+8) *(ecx+0xc)) # Var-type Var-type => eax +12005 89/<- %ecx 0/r32/eax +12006 # TODO: assert(t is an addr) +12007 # t = lookup(t->right) +12008 (lookup *(ecx+0xc) *(ecx+0x10)) # Type-tree-right Type-tree-right => eax +12009 89/<- %ecx 0/r32/eax +12010 # if is-mu-array?(t) return size-of-array(t) +12011 { +12012 (is-mu-array? %ecx) # => eax +12013 3d/compare-eax-and 0/imm32/false +12014 74/jump-if-= break/disp8 +12015 (size-of-array %ecx) # => eax +12016 eb/jump $size-of:end/disp8 +12017 } +12018 # if (!t->is-atom?) t = lookup(t->left) +12019 { +12020 81 7/subop/compare *ecx 0/imm32/false # Type-tree-is-atom +12021 75/jump-if-!= break/disp8 +12022 (lookup *(ecx+4) *(ecx+8)) # Type-tree-left Type-tree-left => eax +12023 89/<- %ecx 0/r32/eax +12024 } +12025 # TODO: assert t->is-atom? +12026 (size-of-type-id *(ecx+4)) # Type-tree-value => eax +12027 $size-of-deref:end: +12028 # . restore registers +12029 59/pop-to-ecx +12030 # . epilogue +12031 89/<- %esp 5/r32/ebp +12032 5d/pop-to-ebp +12033 c3/return +12034 +12035 is-mu-array?: # t: (addr type-tree) -> result/eax: boolean +12036 # . prologue +12037 55/push-ebp +12038 89/<- %ebp 4/r32/esp +12039 # . save registers +12040 51/push-ecx +12041 # ecx = t +12042 8b/-> *(ebp+8) 1/r32/ecx +12043 # if t->is-atom?, return false +12044 81 7/subop/compare *ecx 0/imm32/false # Type-tree-is-atom +12045 75/jump-if-!= $is-mu-array?:return-false/disp8 +12046 # if !t->left->is-atom?, return false +12047 (lookup *(ecx+4) *(ecx+8)) # Type-tree-left Type-tree-left => eax +12048 81 7/subop/compare *eax 0/imm32/false # Type-tree-is-atom +12049 74/jump-if-= $is-mu-array?:return-false/disp8 +12050 # return t->left->value == array +12051 81 7/subop/compare *(eax+4) 3/imm32/array-type-id # Type-tree-value +12052 0f 94/set-if-= %al +12053 81 4/subop/and %eax 0xff/imm32 +12054 eb/jump $is-mu-array?:end/disp8 +12055 $is-mu-array?:return-false: +12056 b8/copy-to-eax 0/imm32/false +12057 $is-mu-array?:end: +12058 # . restore registers +12059 59/pop-to-ecx +12060 # . epilogue +12061 89/<- %esp 5/r32/ebp +12062 5d/pop-to-ebp +12063 c3/return +12064 +12065 size-of-array: # a: (addr type-tree) -> result/eax: int +12066 # . prologue +12067 55/push-ebp +12068 89/<- %ebp 4/r32/esp +12069 # . save registers +12070 51/push-ecx +12071 52/push-edx +12072 # +12073 8b/-> *(ebp+8) 1/r32/ecx +12074 # TODO: assert that a->left is 'array' +12075 (lookup *(ecx+0xc) *(ecx+0x10)) # Type-tree-right Type-tree-right => eax +12076 89/<- %ecx 0/r32/eax +12077 # var elem-type/edx: type-id = a->right->left->value +12078 (lookup *(ecx+4) *(ecx+8)) # Type-tree-left Type-tree-left => eax +12079 8b/-> *(eax+4) 2/r32/edx # Type-tree-value +12080 # TODO: assert that a->right->right->left->value == size +12081 # var array-size/ecx: int = a->right->right->left->value-size +12082 (lookup *(ecx+0xc) *(ecx+0x10)) # Type-tree-right Type-tree-right => eax +12083 (lookup *(eax+4) *(eax+8)) # Type-tree-left Type-tree-left => eax +12084 8b/-> *(eax+8) 1/r32/ecx # Type-tree-value-size +12085 # return array-size * size-of(elem-type) +12086 (size-of-type-id-as-array-element %edx) # => eax +12087 f7 4/subop/multiply-into-eax %ecx +12088 05/add-to-eax 4/imm32 # for array size +12089 $size-of-array:end: +12090 # . restore registers +12091 5a/pop-to-edx +12092 59/pop-to-ecx +12093 # . epilogue +12094 89/<- %esp 5/r32/ebp +12095 5d/pop-to-ebp +12096 c3/return +12097 +12098 size-of-type-id: # t: type-id -> result/eax: int +12099 # . prologue +12100 55/push-ebp +12101 89/<- %ebp 4/r32/esp +12102 # . save registers +12103 51/push-ecx +12104 # var out/ecx: (handle typeinfo) +12105 68/push 0/imm32 +12106 68/push 0/imm32 +12107 89/<- %ecx 4/r32/esp +12108 # eax = t +12109 8b/-> *(ebp+8) 0/r32/eax +12110 # if t is a literal, return 0 +12111 3d/compare-eax-and 0/imm32 +12112 0f 84/jump-if-= $size-of-type-id:end/disp32 # eax changes type from type-id to int +12113 # if t is a byte, return 4 (because we don't really support non-multiples of 4) +12114 3d/compare-eax-and 8/imm32/byte +12115 { +12116 75/jump-if-!= break/disp8 +12117 b8/copy-to-eax 4/imm32 +12118 eb/jump $size-of-type-id:end/disp8 +12119 } +12120 # if t is a handle, return 8 +12121 3d/compare-eax-and 4/imm32/handle +12122 { +12123 75/jump-if-!= break/disp8 +12124 b8/copy-to-eax 8/imm32 +12125 eb/jump $size-of-type-id:end/disp8 # eax changes type from type-id to int +12126 } +12127 # if t is a user-defined type, return its size +12128 # TODO: support non-atom type +12129 (find-typeinfo %eax %ecx) +12130 { +12131 81 7/subop/compare *ecx 0/imm32 +12132 74/jump-if-= break/disp8 +12133 $size-of-type-id:user-defined: +12134 (lookup *ecx *(ecx+4)) # => eax +12135 8b/-> *(eax+0xc) 0/r32/eax # Typeinfo-total-size-in-bytes +12136 eb/jump $size-of-type-id:end/disp8 +12137 } +12138 # otherwise return the word size +12139 b8/copy-to-eax 4/imm32 +12140 $size-of-type-id:end: +12141 # . reclaim locals +12142 81 0/subop/add %esp 8/imm32 +12143 # . restore registers +12144 59/pop-to-ecx +12145 # . epilogue +12146 89/<- %esp 5/r32/ebp +12147 5d/pop-to-ebp +12148 c3/return +12149 +12150 type-equal?: # a: (addr type-tree), b: (addr type-tree) -> result/eax: boolean +12151 # . prologue +12152 55/push-ebp +12153 89/<- %ebp 4/r32/esp +12154 # . save registers +12155 51/push-ecx +12156 52/push-edx +12157 53/push-ebx +12158 # ecx = a +12159 8b/-> *(ebp+8) 1/r32/ecx +12160 # edx = b +12161 8b/-> *(ebp+0xc) 2/r32/edx +12162 $type-equal?:compare-addr: +12163 # if (a == b) return true +12164 8b/-> %ecx 0/r32/eax # Var-type +12165 39/compare %edx 0/r32/eax # Var-type +12166 b8/copy-to-eax 1/imm32/true +12167 0f 84/jump-if-= $type-equal?:end/disp32 +12168 $type-equal?:compare-atom-state: +12169 # if (a->is-atom? != b->is-atom?) return false +12170 8b/-> *ecx 3/r32/ebx # Type-tree-value +12171 39/compare *edx 3/r32/ebx # Type-tree-value +12172 b8/copy-to-eax 0/imm32/false +12173 0f 85/jump-if-!= $type-equal?:end/disp32 +12174 # if a->is-atom? return (a->value == b->value) +12175 { +12176 $type-equal?:check-atom: +12177 81 7/subop/compare %ebx 0/imm32/false +12178 74/jump-if-= break/disp8 +12179 $type-equal?:is-atom: +12180 8b/-> *(ecx+4) 0/r32/eax # Type-tree-value +12181 39/compare *(edx+4) 0/r32/eax # Type-tree-value +12182 0f 94/set-if-= %al +12183 81 4/subop/and %eax 0xff/imm32 +12184 e9/jump $type-equal?:end/disp32 +12185 } +12186 $type-equal?:check-left: +12187 # if (!type-equal?(a->left, b->left)) return false +12188 (lookup *(ecx+4) *(ecx+8)) # Type-tree-left Type-tree-left => eax +12189 89/<- %ebx 0/r32/eax +12190 (lookup *(edx+4) *(edx+8)) # Type-tree-left Type-tree-left => eax +12191 (type-equal? %eax %ebx) # => eax +12192 3d/compare-eax-and 0/imm32/false +12193 74/jump-if-= $type-equal?:end/disp8 +12194 $type-equal?:check-right: +12195 # return type-equal?(a->right, b->right) +12196 (lookup *(ecx+0xc) *(ecx+0x10)) # Type-tree-right Type-tree-right => eax +12197 89/<- %ebx 0/r32/eax +12198 (lookup *(edx+0xc) *(edx+0x10)) # Type-tree-right Type-tree-right => eax +12199 (type-equal? %eax %ebx) # => eax +12200 $type-equal?:end: +12201 # . restore registers +12202 5b/pop-to-ebx +12203 5a/pop-to-edx +12204 59/pop-to-ecx +12205 # . epilogue +12206 89/<- %esp 5/r32/ebp +12207 5d/pop-to-ebp +12208 c3/return +12209 +12210 ####################################################### +12211 # Code-generation +12212 ####################################################### +12213 +12214 == data +12215 +12216 # Global state added to each var record when performing code-generation. +12217 Curr-local-stack-offset: # (addr int) +12218 0/imm32 +12219 +12220 == code +12221 +12222 emit-subx: # out: (addr buffered-file), err: (addr buffered-file), ed: (addr exit-descriptor) +12223 # . prologue +12224 55/push-ebp +12225 89/<- %ebp 4/r32/esp +12226 # . save registers +12227 50/push-eax +12228 # var curr/eax: (addr function) = *Program->functions +12229 (lookup *_Program-functions *_Program-functions->payload) # => eax +12230 { +12231 # if (curr == null) break +12232 3d/compare-eax-and 0/imm32 +12233 0f 84/jump-if-= break/disp32 +12234 (emit-subx-function *(ebp+8) %eax *(ebp+0xc) *(ebp+0x10)) +12235 # curr = lookup(curr->next) +12236 (lookup *(eax+0x20) *(eax+0x24)) # Function-next Function-next => eax +12237 e9/jump loop/disp32 +12238 } +12239 $emit-subx:end: +12240 # . restore registers +12241 58/pop-to-eax +12242 # . epilogue +12243 89/<- %esp 5/r32/ebp +12244 5d/pop-to-ebp +12245 c3/return +12246 +12247 emit-subx-function: # out: (addr buffered-file), f: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) +12248 # . prologue +12249 55/push-ebp +12250 89/<- %ebp 4/r32/esp +12251 # some preprocessing +12252 (populate-mu-type-offsets-in-inouts *(ebp+0xc)) +12253 # . save registers +12254 50/push-eax +12255 51/push-ecx +12256 52/push-edx +12257 # initialize some global state +12258 c7 0/subop/copy *Curr-block-depth 1/imm32 # Important: keep this in sync with the parse phase +12259 c7 0/subop/copy *Curr-local-stack-offset 0/imm32 +12260 # ecx = f +12261 8b/-> *(ebp+0xc) 1/r32/ecx +12262 # var vars/edx: (stack (addr var) 256) +12263 81 5/subop/subtract %esp 0xc00/imm32 +12264 68/push 0xc00/imm32/size +12265 68/push 0/imm32/top +12266 89/<- %edx 4/r32/esp +12267 # var name/eax: (addr array byte) = lookup(f->name) +12268 (lookup *ecx *(ecx+4)) # Function-name Function-name => eax +12269 # +12270 (write-buffered *(ebp+8) %eax) +12271 (write-buffered *(ebp+8) ":\n") +12272 (emit-subx-prologue *(ebp+8)) +12273 # var body/eax: (addr block) = lookup(f->body) +12274 (lookup *(ecx+0x18) *(ecx+0x1c)) # Function-body Function-body => eax +12275 # +12276 (emit-subx-block *(ebp+8) %eax %edx *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) +12277 (emit-subx-epilogue *(ebp+8)) +12278 # TODO: validate that *Curr-block-depth and *Curr-local-stack-offset have +12279 # been cleaned up +12280 $emit-subx-function:end: +12281 # . reclaim locals +12282 81 0/subop/add %esp 0xc08/imm32 +12283 # . restore registers +12284 5a/pop-to-edx +12285 59/pop-to-ecx +12286 58/pop-to-eax +12287 # . epilogue +12288 89/<- %esp 5/r32/ebp +12289 5d/pop-to-ebp +12290 c3/return +12291 +12292 populate-mu-type-offsets-in-inouts: # f: (addr function) +12293 # . prologue +12294 55/push-ebp +12295 89/<- %ebp 4/r32/esp +12296 # . save registers +12297 50/push-eax +12298 51/push-ecx +12299 52/push-edx +12300 53/push-ebx +12301 57/push-edi +12302 # var next-offset/edx: int = 8 +12303 ba/copy-to-edx 8/imm32 +12304 # var curr/ecx: (addr list var) = lookup(f->inouts) +12305 8b/-> *(ebp+8) 1/r32/ecx +12306 (lookup *(ecx+8) *(ecx+0xc)) # Function-inouts Function-inouts => eax +12307 89/<- %ecx 0/r32/eax +12308 { +12309 $populate-mu-type-offsets-in-inouts:loop: +12310 81 7/subop/compare %ecx 0/imm32 +12311 74/jump-if-= break/disp8 +12312 # var v/ebx: (addr var) = lookup(curr->value) +12313 (lookup *ecx *(ecx+4)) # List-value List-value => eax +12314 89/<- %ebx 0/r32/eax +12315 #? (lookup *ebx *(ebx+4)) +12316 #? (write-buffered Stderr "setting offset of fn inout ") +12317 #? (write-buffered Stderr %eax) +12318 #? (write-buffered Stderr "@") +12319 #? (write-int32-hex-buffered Stderr %ebx) +12320 #? (write-buffered Stderr " to ") +12321 #? (write-int32-hex-buffered Stderr %edx) +12322 #? (write-buffered Stderr Newline) +12323 #? (flush Stderr) +12324 # v->offset = next-offset +12325 89/<- *(ebx+0x14) 2/r32/edx # Var-offset +12326 # next-offset += size-of(v) +12327 (size-of %ebx) # => eax +12328 01/add-to %edx 0/r32/eax +12329 # curr = lookup(curr->next) +12330 (lookup *(ecx+8) *(ecx+0xc)) # List-next List-next => eax +12331 89/<- %ecx 0/r32/eax +12332 # +12333 eb/jump loop/disp8 +12334 } +12335 $populate-mu-type-offsets-in-inouts:end: +12336 # . restore registers +12337 5f/pop-to-edi +12338 5b/pop-to-ebx +12339 5a/pop-to-edx +12340 59/pop-to-ecx +12341 58/pop-to-eax +12342 # . epilogue +12343 89/<- %esp 5/r32/ebp +12344 5d/pop-to-ebp +12345 c3/return +12346 +12347 emit-subx-stmt-list: # out: (addr buffered-file), stmts: (addr list stmt), vars: (addr stack live-var), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) +12348 # . prologue +12349 55/push-ebp +12350 89/<- %ebp 4/r32/esp +12351 # . save registers +12352 50/push-eax +12353 51/push-ecx +12354 53/push-ebx +12355 56/push-esi +12356 # esi = stmts +12357 8b/-> *(ebp+0xc) 6/r32/esi +12358 # +12359 { +12360 $emit-subx-stmt-list:loop: +12361 81 7/subop/compare %esi 0/imm32 +12362 0f 84/jump-if-= break/disp32 +12363 # var curr-stmt/ecx: (addr stmt) = lookup(stmts->value) +12364 (lookup *esi *(esi+4)) # List-value List-value => eax +12365 89/<- %ecx 0/r32/eax +12366 { +12367 $emit-subx-stmt-list:check-for-block: +12368 81 7/subop/compare *ecx 0/imm32/block # Stmt-tag +12369 75/jump-if-!= break/disp8 +12370 $emit-subx-stmt-list:block: +12371 (emit-subx-block *(ebp+8) %ecx *(ebp+0x10) *(ebp+0x14) *(ebp+0x18) *(ebp+0x1c)) +12372 } +12373 { +12374 $emit-subx-stmt-list:check-for-stmt: +12375 81 7/subop/compare *ecx 1/imm32/stmt1 # Stmt-tag +12376 0f 85/jump-if-!= break/disp32 +12377 $emit-subx-stmt-list:stmt1: +12378 { +12379 (is-mu-branch? %ecx) # => eax +12380 3d/compare-eax-and 0/imm32/false +12381 0f 84/jump-if-= break/disp32 +12382 $emit-subx-stmt-list:branch-stmt: +12383 +-- 27 lines: # unconditional loops ----------------------------------------------------------------------------------------------------------------------------------------------------- +12410 +-- 16 lines: # unconditional breaks ---------------------------------------------------------------------------------------------------------------------------------------------------- +12426 +-- 38 lines: # simple conditional branches without a target ---------------------------------------------------------------------------------------------------------------------------- +12464 +-- 19 lines: # conditional branches with an explicit target ---------------------------------------------------------------------------------------------------------------------------- +12483 } +12484 $emit-subx-stmt-list:1-to-1: +12485 (emit-subx-stmt *(ebp+8) %ecx Primitives *(ebp+0x18) *(ebp+0x1c)) +12486 e9/jump $emit-subx-stmt-list:continue/disp32 +12487 } +12488 { +12489 $emit-subx-stmt-list:check-for-var-def: +12490 81 7/subop/compare *ecx 2/imm32/var-def # Stmt-tag +12491 75/jump-if-!= break/disp8 +12492 $emit-subx-stmt-list:var-def: +12493 (emit-subx-var-def *(ebp+8) %ecx) +12494 (push *(ebp+0x10) *(ecx+4)) # Vardef-var +12495 (push *(ebp+0x10) *(ecx+8)) # Vardef-var +12496 (push *(ebp+0x10) 0) # Live-var-register-spilled = 0 for vars on the stack +12497 # +12498 eb/jump $emit-subx-stmt-list:continue/disp8 +12499 } +12500 { +12501 $emit-subx-stmt-list:check-for-reg-var-def: +12502 81 7/subop/compare *ecx 3/imm32/reg-var-def # Stmt-tag +12503 0f 85/jump-if-!= break/disp32 +12504 $emit-subx-stmt-list:reg-var-def: +12505 # TODO: ensure that there's exactly one output +12506 (push-output-and-maybe-emit-spill *(ebp+8) %ecx *(ebp+0x10) %esi *(ebp+0x14) *(ebp+0x18) *(ebp+0x1c)) +12507 # emit the instruction as usual +12508 (emit-subx-stmt *(ebp+8) %ecx Primitives *(ebp+0x18) *(ebp+0x1c)) +12509 # +12510 eb/jump $emit-subx-stmt-list:continue/disp8 +12511 } +12512 $emit-subx-stmt-list:continue: +12513 # TODO: raise an error on unrecognized Stmt-tag +12514 (lookup *(esi+8) *(esi+0xc)) # List-next List-next => eax +12515 89/<- %esi 0/r32/eax +12516 e9/jump loop/disp32 +12517 } +12518 $emit-subx-stmt-list:emit-cleanup: +12519 (emit-cleanup-code-until-depth *(ebp+8) *(ebp+0x10) *Curr-block-depth) +12520 $emit-subx-stmt-list:clean-up: +12521 (clean-up-blocks *(ebp+0x10) *Curr-block-depth *(ebp+0x14)) +12522 $emit-subx-stmt-list:end: +12523 # . restore registers +12524 5e/pop-to-esi +12525 5b/pop-to-ebx +12526 59/pop-to-ecx +12527 58/pop-to-eax +12528 # . epilogue +12529 89/<- %esp 5/r32/ebp +12530 5d/pop-to-ebp +12531 c3/return +12532 +12533 # 'later-stmts' includes 'stmt', but will behave the same even without it; reg-var-def stmts are guaranteed not to write to function outputs. +12534 push-output-and-maybe-emit-spill: # out: (addr buffered-file), stmt: (addr reg-var-def), vars: (addr stack (handle var)), later-stmts: (addr list stmt), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) +12535 # . prologue +12536 55/push-ebp +12537 89/<- %ebp 4/r32/esp +12538 # . save registers +12539 50/push-eax +12540 51/push-ecx +12541 52/push-edx +12542 # ecx = stmt +12543 8b/-> *(ebp+0xc) 1/r32/ecx +12544 # var sv/eax: (addr stmt-var) = lookup(curr-stmt->outputs) +12545 (lookup *(ecx+0x14) *(ecx+0x18)) # Regvardef-outputs Regvardef-outputs => eax +12546 # TODO: assert !sv->is-deref? +12547 # var v/ecx: (addr var) = lookup(sv->value) +12548 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax +12549 89/<- %ecx 0/r32/eax +12550 # v->block-depth = *Curr-block-depth +12551 8b/-> *Curr-block-depth 0/r32/eax +12552 89/<- *(ecx+0x10) 0/r32/eax # Var-block-depth +12553 #? (write-buffered Stderr "var ") +12554 #? (lookup *ecx *(ecx+4)) +12555 #? (write-buffered Stderr %eax) +12556 #? (write-buffered Stderr " at depth ") +12557 #? (write-int32-hex-buffered Stderr *(ecx+0x10)) +12558 #? (write-buffered Stderr Newline) +12559 #? (flush Stderr) +12560 # ensure that v is in a register +12561 81 7/subop/compare *(ecx+0x18) 0/imm32 # Var-register +12562 0f 84/jump-if-= $push-output-and-maybe-emit-spill:abort/disp32 +12563 # var emit-spill?/edx: boolean = not-yet-spilled-this-block? && will-not-write-some-register?(fn) +12564 (not-yet-spilled-this-block? %ecx *(ebp+0x10)) # => eax +12565 89/<- %edx 0/r32/eax +12566 3d/compare-eax-and 0/imm32/false +12567 0f 84/jump-if-= $push-output-and-maybe-emit-spill:push/disp32 +12568 (will-not-write-some-register? %ecx *(ebp+0x14) *(ebp+0x18)) # => eax +12569 89/<- %edx 0/r32/eax +12570 # check emit-spill? +12571 3d/compare-eax-and 0/imm32/false +12572 0f 84/jump-if-= $push-output-and-maybe-emit-spill:push/disp32 +12573 # TODO: assert(size-of(output) == 4) +12574 # *Curr-local-stack-offset -= 4 +12575 81 5/subop/subtract *Curr-local-stack-offset 4/imm32 +12576 # emit spill +12577 (emit-indent *(ebp+8) *Curr-block-depth) +12578 (write-buffered *(ebp+8) "ff 6/subop/push %") +12579 (lookup *(ecx+0x18) *(ecx+0x1c)) # Var-register Var-register => eax +12580 (write-buffered *(ebp+8) %eax) +12581 (write-buffered *(ebp+8) Newline) +12582 $push-output-and-maybe-emit-spill:push: +12583 8b/-> *(ebp+0xc) 1/r32/ecx +12584 (lookup *(ecx+0x14) *(ecx+0x18)) # Regvardef-outputs Regvardef-outputs => eax +12585 # push(vars, {sv->value, emit-spill?}) +12586 (push *(ebp+0x10) *eax) # Stmt-var-value +12587 (push *(ebp+0x10) *(eax+4)) # Stmt-var-value +12588 (push *(ebp+0x10) %edx) +12589 $push-output-and-maybe-emit-spill:end: +12590 # . restore registers +12591 5a/pop-to-edx +12592 59/pop-to-ecx +12593 58/pop-to-eax +12594 # . epilogue +12595 89/<- %esp 5/r32/ebp +12596 5d/pop-to-ebp +12597 c3/return +12598 +12599 $push-output-and-maybe-emit-spill:abort: +12600 # error("var '" var->name "' initialized from an instruction must live in a register\n") +12601 (write-buffered *(ebp+0x1c) "var '") +12602 (write-buffered *(ebp+0x1c) *eax) # Var-name +12603 (write-buffered *(ebp+0x1c) "' initialized from an instruction must live in a register\n") +12604 (flush *(ebp+0x1c)) +12605 (stop *(ebp+0x20) 1) +12606 # never gets here +12607 +12608 emit-subx-cleanup-and-unconditional-nonlocal-branch: # out: (addr buffered-file), stmt: (addr stmt1), vars: (addr stack live-var) +12609 # . prologue +12610 55/push-ebp +12611 89/<- %ebp 4/r32/esp +12612 # . save registers +12613 50/push-eax +12614 51/push-ecx +12615 # ecx = stmt +12616 8b/-> *(ebp+0xc) 1/r32/ecx +12617 # var target/eax: (addr array byte) = curr-stmt->inouts->value->name +12618 (lookup *(ecx+0xc) *(ecx+0x10)) # Stmt1-inouts Stmt1-inouts => eax +12619 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax +12620 (lookup *eax *(eax+4)) # Var-name Var-name => eax +12621 # clean up until target block +12622 (emit-cleanup-code-until-target *(ebp+8) *(ebp+0x10) %eax) +12623 # emit jump to target block +12624 (emit-indent *(ebp+8) *Curr-block-depth) +12625 (write-buffered *(ebp+8) "e9/jump ") +12626 (write-buffered *(ebp+8) %eax) +12627 (lookup *(ecx+4) *(ecx+8)) # Stmt1-operation Stmt1-operation => eax +12628 (string-starts-with? %eax "break") +12629 3d/compare-eax-and 0/imm32/false +12630 { +12631 74/jump-if-= break/disp8 +12632 (write-buffered *(ebp+8) ":break/disp32\n") +12633 } +12634 3d/compare-eax-and 0/imm32/false # just in case the function call modified flags +12635 { +12636 75/jump-if-!= break/disp8 +12637 (write-buffered *(ebp+8) ":loop/disp32\n") +12638 } +12639 $emit-subx-cleanup-and-unconditional-nonlocal-branch:end: +12640 # . restore registers +12641 59/pop-to-ecx +12642 58/pop-to-eax +12643 # . epilogue +12644 89/<- %esp 5/r32/ebp +12645 5d/pop-to-ebp +12646 c3/return +12647 +12648 is-mu-branch?: # stmt: (addr stmt1) -> result/eax: boolean +12649 # . prologue +12650 55/push-ebp +12651 89/<- %ebp 4/r32/esp +12652 # . save registers +12653 51/push-ecx +12654 # ecx = lookup(stmt->operation) +12655 8b/-> *(ebp+8) 1/r32/ecx +12656 (lookup *(ecx+4) *(ecx+8)) # Stmt1-operation Stmt1-operation => eax +12657 89/<- %ecx 0/r32/eax +12658 # if (stmt->operation starts with "loop") return true +12659 (string-starts-with? %ecx "loop") # => eax +12660 3d/compare-eax-and 0/imm32/false +12661 75/jump-if-not-equal $is-mu-branch?:end/disp8 +12662 # otherwise return (stmt->operation starts with "break") +12663 (string-starts-with? %ecx "break") # => eax +12664 $is-mu-branch?:end: +12665 # . restore registers +12666 59/pop-to-ecx +12667 # . epilogue +12668 89/<- %esp 5/r32/ebp +12669 5d/pop-to-ebp +12670 c3/return +12671 +12672 emit-reverse-break: # out: (addr buffered-file), stmt: (addr stmt1) +12673 # . prologue +12674 55/push-ebp +12675 89/<- %ebp 4/r32/esp +12676 # . save registers +12677 50/push-eax +12678 # eax = stmt +12679 8b/-> *(ebp+0xc) 0/r32/eax +12680 # +12681 (lookup *(eax+4) *(eax+8)) # Stmt1-operation Stmt1-operation => eax +12682 (get Reverse-branch %eax 0x10 "reverse-branch: ") # => eax: (addr handle array byte) +12683 (emit-indent *(ebp+8) *Curr-block-depth) +12684 (lookup *eax *(eax+4)) # => eax +12685 (write-buffered *(ebp+8) %eax) +12686 (write-buffered *(ebp+8) " break/disp32\n") +12687 $emit-reverse-break:end: +12688 # . restore registers +12689 58/pop-to-eax +12690 # . epilogue +12691 89/<- %esp 5/r32/ebp +12692 5d/pop-to-ebp +12693 c3/return +12694 +12695 == data +12696 +12697 # Table from Mu branch instructions to the reverse SubX opcodes for them. +12698 Reverse-branch: # (table (handle array byte) (handle array byte)) +12699 # a table is a stream +12700 0x140/imm32/write +12701 0/imm32/read +12702 0x140/imm32/size +12703 # data +12704 0x11/imm32/alloc-id _string-break-if-=/imm32 0x11/imm32/alloc-id _string_0f_85_jump_label/imm32 +12705 0x11/imm32/alloc-id _string-loop-if-=/imm32 0x11/imm32/alloc-id _string_0f_85_jump_label/imm32 +12706 0x11/imm32/alloc-id _string-break-if-!=/imm32 0x11/imm32/alloc-id _string_0f_84_jump_label/imm32 +12707 0x11/imm32/alloc-id _string-loop-if-!=/imm32 0x11/imm32/alloc-id _string_0f_84_jump_label/imm32 +12708 0x11/imm32/alloc-id _string-break-if-</imm32 0x11/imm32/alloc-id _string_0f_8d_jump_label/imm32 +12709 0x11/imm32/alloc-id _string-loop-if-</imm32 0x11/imm32/alloc-id _string_0f_8d_jump_label/imm32 +12710 0x11/imm32/alloc-id _string-break-if->/imm32 0x11/imm32/alloc-id _string_0f_8e_jump_label/imm32 +12711 0x11/imm32/alloc-id _string-loop-if->/imm32 0x11/imm32/alloc-id _string_0f_8e_jump_label/imm32 +12712 0x11/imm32/alloc-id _string-break-if-<=/imm32 0x11/imm32/alloc-id _string_0f_87_jump_label/imm32 +12713 0x11/imm32/alloc-id _string-loop-if-<=/imm32 0x11/imm32/alloc-id _string_0f_87_jump_label/imm32 +12714 0x11/imm32/alloc-id _string-break-if->=/imm32 0x11/imm32/alloc-id _string_0f_8c_jump_label/imm32 +12715 0x11/imm32/alloc-id _string-loop-if->=/imm32 0x11/imm32/alloc-id _string_0f_8c_jump_label/imm32 +12716 0x11/imm32/alloc-id _string-break-if-addr</imm32 0x11/imm32/alloc-id _string_0f_83_jump_label/imm32 +12717 0x11/imm32/alloc-id _string-loop-if-addr</imm32 0x11/imm32/alloc-id _string_0f_83_jump_label/imm32 +12718 0x11/imm32/alloc-id _string-break-if-addr>/imm32 0x11/imm32/alloc-id _string_0f_86_jump_label/imm32 +12719 0x11/imm32/alloc-id _string-loop-if-addr>/imm32 0x11/imm32/alloc-id _string_0f_86_jump_label/imm32 +12720 0x11/imm32/alloc-id _string-break-if-addr<=/imm32 0x11/imm32/alloc-id _string_0f_87_jump_label/imm32 +12721 0x11/imm32/alloc-id _string-loop-if-addr<=/imm32 0x11/imm32/alloc-id _string_0f_87_jump_label/imm32 +12722 0x11/imm32/alloc-id _string-break-if-addr>=/imm32 0x11/imm32/alloc-id _string_0f_82_jump_label/imm32 +12723 0x11/imm32/alloc-id _string-loop-if-addr>=/imm32 0x11/imm32/alloc-id _string_0f_82_jump_label/imm32 +12724 +12725 == code +12726 +12727 emit-unconditional-jump-to-depth: # out: (addr buffered-file), vars: (addr stack live-var), depth: int, label-suffix: (addr array byte) +12728 # . prologue +12729 55/push-ebp +12730 89/<- %ebp 4/r32/esp +12731 # . save registers +12732 50/push-eax +12733 51/push-ecx +12734 52/push-edx +12735 53/push-ebx +12736 56/push-esi +12737 # ecx = vars +12738 8b/-> *(ebp+0xc) 1/r32/ecx +12739 # var eax: int = vars->top +12740 8b/-> *ecx 0/r32/eax +12741 # var curr/esi: (addr handle var) = &vars->data[vars->top - 12] +12742 8d/copy-address *(ecx+eax-4) 6/r32/esi # vars + 8 + vars->top - 12/Live-var-size +12743 # var min/ecx: (addr handle var) = vars->data +12744 8d/copy-address *(ecx+8) 1/r32/ecx +12745 # edx = depth +12746 8b/-> *(ebp+0x10) 2/r32/edx +12747 { +12748 $emit-unconditional-jump-to-depth:loop: +12749 # if (curr < min) break +12750 39/compare %esi 1/r32/ecx +12751 0f 82/jump-if-addr< break/disp32 +12752 # var v/ebx: (addr var) = lookup(*curr) +12753 (lookup *esi *(esi+4)) # => eax +12754 89/<- %ebx 0/r32/eax +12755 # if (v->block-depth < until-block-depth) break +12756 39/compare *(ebx+0x10) 2/r32/edx # Var-block-depth +12757 0f 8c/jump-if-< break/disp32 +12758 { +12759 $emit-unconditional-jump-to-depth:check: +12760 # if v->block-depth != until-block-depth, continue +12761 39/compare *(ebx+0x10) 2/r32/edx # Var-block-depth +12762 0f 85/jump-if-!= break/disp32 +12763 $emit-unconditional-jump-to-depth:depth-found: +12764 # if v is not a literal, continue +12765 (size-of %ebx) # => eax +12766 3d/compare-eax-and 0/imm32 +12767 0f 85/jump-if-!= break/disp32 +12768 $emit-unconditional-jump-to-depth:label-found: +12769 # emit unconditional jump, then return +12770 (emit-indent *(ebp+8) *Curr-block-depth) +12771 (write-buffered *(ebp+8) "e9/jump ") +12772 (lookup *ebx *(ebx+4)) # Var-name Var-name => eax +12773 (write-buffered *(ebp+8) %eax) +12774 (write-buffered *(ebp+8) ":") +12775 (write-buffered *(ebp+8) *(ebp+0x14)) +12776 (write-buffered *(ebp+8) "/disp32\n") +12777 eb/jump $emit-unconditional-jump-to-depth:end/disp8 +12778 } +12779 # curr -= 12 +12780 81 5/subop/subtract %esi 0xc/imm32 +12781 e9/jump loop/disp32 +12782 } +12783 # TODO: error if no label at 'depth' was found +12784 $emit-unconditional-jump-to-depth:end: +12785 # . restore registers +12786 5e/pop-to-esi +12787 5b/pop-to-ebx +12788 5a/pop-to-edx +12789 59/pop-to-ecx +12790 58/pop-to-eax +12791 # . epilogue +12792 89/<- %esp 5/r32/ebp +12793 5d/pop-to-ebp +12794 c3/return +12795 +12796 # emit clean-up code for 'vars' until some block depth +12797 # doesn't actually modify 'vars' so we need traverse manually inside the stack +12798 emit-cleanup-code-until-depth: # out: (addr buffered-file), vars: (addr stack live-var), until-block-depth: int +12799 # . prologue +12800 55/push-ebp +12801 89/<- %ebp 4/r32/esp +12802 # . save registers +12803 50/push-eax +12804 51/push-ecx +12805 52/push-edx +12806 53/push-ebx +12807 56/push-esi +12808 #? (write-buffered Stderr "--- cleanup\n") +12809 #? (flush Stderr) +12810 # ecx = vars +12811 8b/-> *(ebp+0xc) 1/r32/ecx +12812 # var esi: int = vars->top +12813 8b/-> *ecx 6/r32/esi +12814 # var curr/esi: (addr handle var) = &vars->data[vars->top - 12] +12815 8d/copy-address *(ecx+esi-4) 6/r32/esi # vars + 8 + vars->top - 12/Live-var-size +12816 # var min/ecx: (addr handle var) = vars->data +12817 81 0/subop/add %ecx 8/imm32 +12818 # edx = until-block-depth +12819 8b/-> *(ebp+0x10) 2/r32/edx +12820 { +12821 $emit-cleanup-code-until-depth:loop: +12822 # if (curr < min) break +12823 39/compare %esi 1/r32/ecx +12824 0f 82/jump-if-addr< break/disp32 +12825 # var v/ebx: (addr var) = lookup(*curr) +12826 (lookup *esi *(esi+4)) # => eax +12827 89/<- %ebx 0/r32/eax +12828 #? (lookup *ebx *(ebx+4)) # Var-name +12829 #? (write-buffered Stderr "var ") +12830 #? (write-buffered Stderr %eax) +12831 #? (write-buffered Stderr Newline) +12832 #? (flush Stderr) +12833 # if (v->block-depth < until-block-depth) break +12834 39/compare *(ebx+0x10) 2/r32/edx # Var-block-depth +12835 0f 8c/jump-if-< break/disp32 +12836 # if v is in a register +12837 81 7/subop/compare *(ebx+0x18) 0/imm32 # Var-register +12838 { +12839 0f 84/jump-if-= break/disp32 +12840 { +12841 $emit-cleanup-code-until-depth:check-for-previous-spill: +12842 8b/-> *(esi+8) 0/r32/eax # Live-var-register-spilled +12843 3d/compare-eax-and 0/imm32/false +12844 74/jump-if-= break/disp8 +12845 $emit-cleanup-code-until-depth:reclaim-var-in-register: +12846 (emit-indent *(ebp+8) *Curr-block-depth) +12847 (write-buffered *(ebp+8) "8f 0/subop/pop %") +12848 (lookup *(ebx+0x18) *(ebx+0x1c)) # Var-register Var-register => eax +12849 (write-buffered *(ebp+8) %eax) +12850 (write-buffered *(ebp+8) Newline) +12851 } +12852 eb/jump $emit-cleanup-code-until-depth:continue/disp8 +12853 } +12854 # otherwise v is on the stack +12855 { +12856 75/jump-if-!= break/disp8 +12857 $emit-cleanup-code-until-depth:var-on-stack: +12858 (size-of %ebx) # => eax +12859 # don't emit code for labels +12860 3d/compare-eax-and 0/imm32 +12861 74/jump-if-= break/disp8 +12862 $emit-cleanup-code-until-depth:reclaim-var-on-stack: +12863 (emit-indent *(ebp+8) *Curr-block-depth) +12864 (write-buffered *(ebp+8) "81 0/subop/add %esp ") +12865 (write-int32-hex-buffered *(ebp+8) %eax) +12866 (write-buffered *(ebp+8) "/imm32\n") +12867 } +12868 $emit-cleanup-code-until-depth:continue: +12869 # curr -= 12 +12870 81 5/subop/subtract %esi 0xc/imm32 +12871 e9/jump loop/disp32 +12872 } +12873 $emit-cleanup-code-until-depth:end: +12874 # . restore registers +12875 5e/pop-to-esi +12876 5b/pop-to-ebx +12877 5a/pop-to-edx +12878 59/pop-to-ecx +12879 58/pop-to-eax +12880 # . epilogue +12881 89/<- %esp 5/r32/ebp +12882 5d/pop-to-ebp +12883 c3/return +12884 +12885 # emit clean-up code for 'vars' until a given label is encountered +12886 # doesn't actually modify 'vars' so we need traverse manually inside the stack +12887 emit-cleanup-code-until-target: # out: (addr buffered-file), vars: (addr stack live-var), until-block-label: (addr array byte) +12888 # . prologue +12889 55/push-ebp +12890 89/<- %ebp 4/r32/esp +12891 # . save registers +12892 50/push-eax +12893 51/push-ecx +12894 52/push-edx +12895 53/push-ebx +12896 # ecx = vars +12897 8b/-> *(ebp+0xc) 1/r32/ecx +12898 # var eax: int = vars->top +12899 8b/-> *ecx 0/r32/eax +12900 # var curr/edx: (addr handle var) = &vars->data[vars->top - 12] +12901 8d/copy-address *(ecx+eax-4) 2/r32/edx # vars + 8 + vars->top - 12/Live-var-size +12902 # var min/ecx: (addr handle var) = vars->data +12903 81 0/subop/add %ecx 8/imm32 +12904 { +12905 $emit-cleanup-code-until-target:loop: +12906 # if (curr < min) break +12907 39/compare %edx 1/r32/ecx +12908 0f 82/jump-if-addr< break/disp32 +12909 # var v/ebx: (handle var) = lookup(*curr) +12910 (lookup *edx *(edx+4)) # => eax +12911 89/<- %ebx 0/r32/eax +12912 # if (v->name == until-block-label) break +12913 (lookup *ebx *(ebx+4)) # Var-name Var-name => eax +12914 (string-equal? %eax *(ebp+0x10)) # => eax +12915 3d/compare-eax-and 0/imm32/false +12916 0f 85/jump-if-!= break/disp32 +12917 # if v is in a register +12918 81 7/subop/compare *(ebx+0x18) 0/imm32 # Var-register +12919 { +12920 0f 84/jump-if-= break/disp32 +12921 { +12922 $emit-cleanup-code-until-target:check-for-previous-spill: +12923 8b/-> *(edx+8) 0/r32/eax # Live-var-register-spilled +12924 3d/compare-eax-and 0/imm32/false +12925 74/jump-if-= break/disp8 +12926 $emit-cleanup-code-until-target:reclaim-var-in-register: +12927 (emit-indent *(ebp+8) *Curr-block-depth) +12928 (write-buffered *(ebp+8) "8f 0/subop/pop %") +12929 (lookup *(ebx+0x18) *(ebx+0x1c)) # Var-register Var-register => eax +12930 (write-buffered *(ebp+8) %eax) +12931 (write-buffered *(ebp+8) Newline) +12932 } +12933 eb/jump $emit-cleanup-code-until-target:continue/disp8 +12934 } +12935 # otherwise v is on the stack +12936 { +12937 75/jump-if-!= break/disp8 +12938 $emit-cleanup-code-until-target:reclaim-var-on-stack: +12939 (size-of %ebx) # => eax +12940 # don't emit code for labels +12941 3d/compare-eax-and 0/imm32 +12942 74/jump-if-= break/disp8 +12943 # +12944 (emit-indent *(ebp+8) *Curr-block-depth) +12945 (write-buffered *(ebp+8) "81 0/subop/add %esp ") +12946 (write-int32-hex-buffered *(ebp+8) %eax) +12947 (write-buffered *(ebp+8) "/imm32\n") +12948 } +12949 $emit-cleanup-code-until-target:continue: +12950 # curr -= 12 +12951 81 5/subop/subtract %edx 0xc/imm32 +12952 e9/jump loop/disp32 +12953 } +12954 $emit-cleanup-code-until-target:end: +12955 # . restore registers +12956 5b/pop-to-ebx +12957 5a/pop-to-edx +12958 59/pop-to-ecx +12959 58/pop-to-eax +12960 # . epilogue +12961 89/<- %esp 5/r32/ebp +12962 5d/pop-to-ebp +12963 c3/return +12964 +12965 # Return true if there isn't a variable in 'vars' with the same block-depth +12966 # and register as 'v'. +12967 # 'v' is guaranteed not to be within 'vars'. +12968 not-yet-spilled-this-block?: # v: (addr var), vars: (addr stack live-var) -> result/eax: boolean +12969 # . prologue +12970 55/push-ebp +12971 89/<- %ebp 4/r32/esp +12972 # . save registers +12973 51/push-ecx +12974 52/push-edx +12975 53/push-ebx +12976 56/push-esi +12977 57/push-edi +12978 # ecx = vars +12979 8b/-> *(ebp+0xc) 1/r32/ecx +12980 # var eax: int = vars->top +12981 8b/-> *ecx 0/r32/eax +12982 # var curr/edx: (addr handle var) = &vars->data[vars->top - 12] +12983 8d/copy-address *(ecx+eax-4) 2/r32/edx # vars + 8 + vars->top - 12/Live-var-size +12984 # var min/ecx: (addr handle var) = vars->data +12985 8d/copy-address *(ecx+8) 1/r32/ecx +12986 # var depth/ebx: int = v->block-depth +12987 8b/-> *(ebp+8) 3/r32/ebx +12988 8b/-> *(ebx+0x10) 3/r32/ebx # Var-block-depth +12989 # var needle/esi: (addr array byte) = v->register +12990 8b/-> *(ebp+8) 6/r32/esi +12991 (lookup *(esi+0x18) *(esi+0x1c)) # Var-register Var-register => eax +12992 89/<- %esi 0/r32/eax +12993 { +12994 $not-yet-spilled-this-block?:loop: +12995 # if (curr < min) break +12996 39/compare %edx 1/r32/ecx +12997 0f 82/jump-if-addr< break/disp32 +12998 # var cand/edi: (addr var) = lookup(*curr) +12999 (lookup *edx *(edx+4)) # => eax +13000 89/<- %edi 0/r32/eax +13001 # if (cand->block-depth < depth) break +13002 39/compare *(edi+0x10) 3/r32/ebx # Var-block-depth +13003 0f 8c/jump-if-< break/disp32 +13004 # var cand-reg/edi: (array array byte) = cand->reg +13005 (lookup *(edi+0x18) *(edi+0x1c)) # Var-register Var-register => eax +13006 89/<- %edi 0/r32/eax +13007 # if (cand-reg == null) continue 13008 { -13009 7d/jump-if->= break/disp8 -13010 # if (!in-function-outputs?(fn, v)) break -13011 (in-function-outputs? *(ebp+0x10) %eax) # => eax -13012 3d/compare-eax-and 0/imm32/false -13013 74/jump-if-= $clean-up-blocks:phase2/disp8 -13014 } -13015 $clean-up-blocks:loop1-continue: -13016 # --to -13017 81 5/subop/subtract %edi 0xc/imm32 -13018 # -13019 eb/jump loop/disp8 -13020 } -13021 $clean-up-blocks:phase2: -13022 # var from/esi: int = to -13023 89/<- %esi 7/r32/edi -13024 { -13025 $clean-up-blocks:loop2: -13026 # if (from >= vars->top) break -13027 3b/compare 6/r32/esi *ebx -13028 7d/jump-if->= break/disp8 -13029 # var v/eax: (addr var) = lookup(vars->data[from]->var) -13030 8d/copy-address *(ebx+esi+8) 0/r32/eax -13031 (lookup *eax *(eax+4)) # => eax -13032 # if !in-function-outputs?(fn, v) continue -13033 (in-function-outputs? *(ebp+0x10) %eax) # => eax -13034 3d/compare-eax-and 0/imm32/false -13035 74/jump-if-= $clean-up-blocks:loop2-continue/disp8 -13036 # invariant: from >= to -13037 # if (from > to) vars->data[to] = vars->data[from] -13038 { -13039 39/compare %esi 7/r32/edi -13040 7e/jump-if-<= break/disp8 -13041 56/push-esi -13042 57/push-edi -13043 # . var from/esi: (addr byte) = &vars->data[from] -13044 8d/copy-address *(ebx+esi+8) 6/r32/esi -13045 # . var to/edi: (addr byte) = &vars->data[to] -13046 8d/copy-address *(ebx+edi+8) 7/r32/edi -13047 # . -13048 8b/-> *esi 0/r32/eax -13049 89/<- *edi 0/r32/eax -13050 8b/-> *(esi+4) 0/r32/eax -13051 89/<- *(edi+4) 0/r32/eax -13052 8b/-> *(esi+8) 0/r32/eax -13053 89/<- *(edi+8) 0/r32/eax -13054 5f/pop-to-edi -13055 5e/pop-to-esi -13056 } -13057 # ++to -13058 81 0/subop/add %edi 0xc/imm32 -13059 $clean-up-blocks:loop2-continue: -13060 # ++from -13061 81 0/subop/add %esi 0xc/imm32 -13062 # -13063 eb/jump loop/disp8 -13064 } -13065 89/<- *ebx 7/r32/edi -13066 $clean-up-blocks:end: -13067 # . restore registers -13068 5f/pop-to-edi -13069 5e/pop-to-esi -13070 5b/pop-to-ebx -13071 5a/pop-to-edx -13072 58/pop-to-eax -13073 # . epilogue -13074 89/<- %esp 5/r32/ebp -13075 5d/pop-to-ebp -13076 c3/return -13077 -13078 in-function-outputs?: # fn: (addr function), target: (addr var) -> result/eax: boolean -13079 # . prologue -13080 55/push-ebp -13081 89/<- %ebp 4/r32/esp -13082 # . save registers -13083 51/push-ecx -13084 # var curr/ecx: (addr list var) = lookup(fn->outputs) -13085 8b/-> *(ebp+8) 1/r32/ecx -13086 (lookup *(ecx+0x10) *(ecx+0x14)) # Function-outputs Function-outputs => eax -13087 89/<- %ecx 0/r32/eax -13088 # while curr != null -13089 { -13090 81 7/subop/compare %ecx 0/imm32 -13091 74/jump-if-= break/disp8 -13092 # var v/eax: (addr var) = lookup(curr->value) -13093 (lookup *ecx *(ecx+4)) # List-value List-value => eax -13094 # if (v == target) return true -13095 39/compare *(ebp+0xc) 0/r32/eax -13096 b8/copy-to-eax 1/imm32/true -13097 74/jump-if-= $in-function-outputs?:end/disp8 -13098 # curr = curr->next -13099 (lookup *(ecx+8) *(ecx+0xc)) # List-next List-next => eax -13100 89/<- %ecx 0/r32/eax -13101 # -13102 eb/jump loop/disp8 -13103 } -13104 b8/copy-to-eax 0/imm32 -13105 $in-function-outputs?:end: +13009 $not-yet-spilled-this-block?:check-reg: +13010 81 7/subop/compare %edi 0/imm32 +13011 0f 84/jump-if-= break/disp32 +13012 # if (cand-reg == needle) return true +13013 (string-equal? %esi %edi) # => eax +13014 3d/compare-eax-and 0/imm32/false +13015 74/jump-if-= break/disp8 +13016 $not-yet-spilled-this-block?:return-false: +13017 b8/copy-to-eax 0/imm32/false +13018 eb/jump $not-yet-spilled-this-block?:end/disp8 +13019 } +13020 $not-yet-spilled-this-block?:continue: +13021 # curr -= 12 +13022 81 5/subop/subtract %edx 0xc/imm32 +13023 e9/jump loop/disp32 +13024 } +13025 $not-yet-spilled-this-block?:return-true: +13026 # return true +13027 b8/copy-to-eax 1/imm32/true +13028 $not-yet-spilled-this-block?:end: +13029 # . restore registers +13030 5f/pop-to-edi +13031 5e/pop-to-esi +13032 5b/pop-to-ebx +13033 5a/pop-to-edx +13034 59/pop-to-ecx +13035 # . epilogue +13036 89/<- %esp 5/r32/ebp +13037 5d/pop-to-ebp +13038 c3/return +13039 +13040 # could the register of 'v' ever be written to by one of the vars in fn-outputs? +13041 will-not-write-some-register?: # v: (addr var), stmts: (addr list stmt), fn: (addr function) -> result/eax: boolean +13042 # . prologue +13043 55/push-ebp +13044 89/<- %ebp 4/r32/esp +13045 # eax = v +13046 8b/-> *(ebp+8) 0/r32/eax +13047 # var reg/eax: (addr array byte) = lookup(v->register) +13048 (lookup *(eax+0x18) *(eax+0x1c)) # Var-register Var-register => eax +13049 # var target/eax: (addr var) = find-register(fn-outputs, reg) +13050 (find-register *(ebp+0x10) %eax) # => eax +13051 # if (target == 0) return true +13052 { +13053 3d/compare-eax-and 0/imm32 +13054 75/jump-if-!= break/disp8 +13055 b8/copy-to-eax 1/imm32/true +13056 eb/jump $will-not-write-some-register?:end/disp8 +13057 } +13058 # return !assigns-in-stmts?(stmts, target) +13059 (assigns-in-stmts? *(ebp+0xc) %eax) # => eax +13060 3d/compare-eax-and 0/imm32/false +13061 # assume: true = 1, so no need to mask with 0x000000ff +13062 0f 94/set-if-= %al +13063 $will-not-write-some-register?:end: +13064 # . epilogue +13065 89/<- %esp 5/r32/ebp +13066 5d/pop-to-ebp +13067 c3/return +13068 +13069 # return fn output with matching register +13070 # always returns false if 'reg' is null +13071 find-register: # fn: (addr function), reg: (addr array byte) -> result/eax: (addr var) +13072 # . prologue +13073 55/push-ebp +13074 89/<- %ebp 4/r32/esp +13075 # . save registers +13076 51/push-ecx +13077 # var curr/ecx: (addr list var) = lookup(fn->outputs) +13078 8b/-> *(ebp+8) 1/r32/ecx +13079 (lookup *(ecx+0x10) *(ecx+0x14)) # Function-outputs Function-outputs => eax +13080 89/<- %ecx 0/r32/eax +13081 { +13082 $find-register:loop: +13083 # if (curr == 0) break +13084 81 7/subop/compare %ecx 0/imm32 +13085 74/jump-if-= break/disp8 +13086 # eax = curr->value->register +13087 (lookup *ecx *(ecx+4)) # List-value List-value => eax +13088 (lookup *(eax+0x18) *(eax+0x1c)) # Var-register Var-register => eax +13089 # if (eax == reg) return curr->value +13090 $find-register:compare: +13091 (string-equal? *(ebp+0xc) %eax) # => eax +13092 { +13093 3d/compare-eax-and 0/imm32/false +13094 74/jump-if-= break/disp8 +13095 $find-register:found: +13096 (lookup *ecx *(ecx+4)) # List-value List-value => eax +13097 eb/jump $find-register:end/disp8 +13098 } +13099 # curr = lookup(curr->next) +13100 (lookup *(ecx+8) *(ecx+0xc)) # List-next List-next => eax +13101 89/<- %ecx 0/r32/eax +13102 # +13103 eb/jump loop/disp8 +13104 } +13105 $find-register:end: 13106 # . restore registers 13107 59/pop-to-ecx 13108 # . epilogue @@ -12541,6283 +12529,6298 @@ if ('onhashchange' in window) { 13110 5d/pop-to-ebp 13111 c3/return 13112 -13113 emit-subx-var-def: # out: (addr buffered-file), stmt: (addr stmt) +13113 assigns-in-stmts?: # stmts: (addr list stmt), v: (addr var) -> result/eax: boolean 13114 # . prologue 13115 55/push-ebp 13116 89/<- %ebp 4/r32/esp 13117 # . save registers -13118 50/push-eax -13119 51/push-ecx -13120 52/push-edx -13121 # eax = stmt -13122 8b/-> *(ebp+0xc) 0/r32/eax -13123 # var v/ecx: (addr var) -13124 (lookup *(eax+4) *(eax+8)) # Vardef-var Vardef-var => eax -13125 89/<- %ecx 0/r32/eax -13126 # v->block-depth = *Curr-block-depth -13127 8b/-> *Curr-block-depth 0/r32/eax -13128 89/<- *(ecx+0x10) 0/r32/eax # Var-block-depth -13129 # var n/edx: int = size-of(stmt->var) -13130 (size-of %ecx) # => eax -13131 89/<- %edx 0/r32/eax -13132 # *Curr-local-stack-offset -= n -13133 29/subtract-from *Curr-local-stack-offset 2/r32/edx -13134 # v->offset = *Curr-local-stack-offset -13135 8b/-> *Curr-local-stack-offset 0/r32/eax -13136 89/<- *(ecx+0x14) 0/r32/eax # Var-offset -13137 # if v is an array, do something special -13138 { -13139 (lookup *(ecx+8) *(ecx+0xc)) # Var-type Var-type => eax -13140 (is-mu-array? %eax) # => eax -13141 3d/compare-eax-and 0/imm32/false -13142 0f 84/jump-if-= break/disp32 -13143 # var array-size-without-size/edx: int = n-4 -13144 81 5/subop/subtract %edx 4/imm32 -13145 (emit-indent *(ebp+8) *Curr-block-depth) -13146 (write-buffered *(ebp+8) "(push-n-zero-bytes ") -13147 (write-int32-hex-buffered *(ebp+8) %edx) -13148 (write-buffered *(ebp+8) ")\n") -13149 (emit-indent *(ebp+8) *Curr-block-depth) -13150 (write-buffered *(ebp+8) "68/push ") -13151 (write-int32-hex-buffered *(ebp+8) %edx) -13152 (write-buffered *(ebp+8) "/imm32\n") -13153 eb/jump $emit-subx-var-def:end/disp8 -13154 } -13155 # while n > 0 -13156 { -13157 81 7/subop/compare %edx 0/imm32 -13158 7e/jump-if-<= break/disp8 -13159 (emit-indent *(ebp+8) *Curr-block-depth) -13160 (write-buffered *(ebp+8) "68/push 0/imm32\n") -13161 # n -= 4 -13162 81 5/subop/subtract %edx 4/imm32 -13163 # -13164 eb/jump loop/disp8 -13165 } -13166 $emit-subx-var-def:end: -13167 # . restore registers -13168 5a/pop-to-edx -13169 59/pop-to-ecx -13170 58/pop-to-eax -13171 # . epilogue -13172 89/<- %esp 5/r32/ebp -13173 5d/pop-to-ebp -13174 c3/return -13175 -13176 emit-subx-stmt: # out: (addr buffered-file), stmt: (addr stmt), primitives: (addr primitive), err: (addr buffered-file), ed: (addr exit-descriptor) -13177 # . prologue -13178 55/push-ebp -13179 89/<- %ebp 4/r32/esp -13180 # . save registers -13181 50/push-eax -13182 51/push-ecx -13183 # - some special-case primitives that don't actually use the 'primitives' data structure -13184 # var op/ecx: (addr array byte) = lookup(stmt->operation) -13185 8b/-> *(ebp+0xc) 1/r32/ecx -13186 (lookup *(ecx+4) *(ecx+8)) # Stmt1-operation Stmt1-operation => eax -13187 89/<- %ecx 0/r32/eax -13188 # array size -13189 { -13190 # if (!string-equal?(stmt->operation, "length")) break -13191 (string-equal? %ecx "length") # => eax -13192 3d/compare-eax-and 0/imm32 -13193 0f 84/jump-if-= break/disp32 -13194 (translate-mu-length-stmt *(ebp+8) *(ebp+0xc) *(ebp+0x14) *(ebp+0x18)) -13195 e9/jump $emit-subx-stmt:end/disp32 -13196 } -13197 # index into array -13198 { -13199 # if (!string-equal?(stmt->operation, "index")) break -13200 (string-equal? %ecx "index") # => eax -13201 3d/compare-eax-and 0/imm32 -13202 0f 84/jump-if-= break/disp32 -13203 (translate-mu-index-stmt *(ebp+8) *(ebp+0xc) *(ebp+0x14) *(ebp+0x18)) -13204 e9/jump $emit-subx-stmt:end/disp32 -13205 } -13206 # compute-offset for index into array -13207 { -13208 # if (!string-equal?(stmt->operation, "compute-offset")) break -13209 (string-equal? %ecx "compute-offset") # => eax -13210 3d/compare-eax-and 0/imm32 -13211 0f 84/jump-if-= break/disp32 -13212 (translate-mu-compute-index-stmt *(ebp+8) *(ebp+0xc) *(ebp+0x14) *(ebp+0x18)) -13213 e9/jump $emit-subx-stmt:end/disp32 -13214 } -13215 # get field from record -13216 { -13217 # if (!string-equal?(stmt->operation, "get")) break -13218 (string-equal? %ecx "get") # => eax -13219 3d/compare-eax-and 0/imm32 -13220 0f 84/jump-if-= break/disp32 -13221 (translate-mu-get-stmt *(ebp+8) *(ebp+0xc)) -13222 e9/jump $emit-subx-stmt:end/disp32 -13223 } -13224 # - if stmt matches a primitive, emit it -13225 { -13226 $emit-subx-stmt:check-for-primitive: -13227 # var curr/eax: (addr primitive) -13228 (find-matching-primitive *(ebp+0x10) *(ebp+0xc)) # primitives, stmt => eax -13229 3d/compare-eax-and 0/imm32 -13230 74/jump-if-= break/disp8 -13231 $emit-subx-stmt:primitive: -13232 (emit-subx-primitive *(ebp+8) *(ebp+0xc) %eax) # out, stmt, curr -13233 e9/jump $emit-subx-stmt:end/disp32 -13234 } -13235 # - otherwise emit a call -13236 # TODO: type-checking -13237 $emit-subx-stmt:call: -13238 (emit-call *(ebp+8) *(ebp+0xc)) -13239 $emit-subx-stmt:end: -13240 # . restore registers -13241 59/pop-to-ecx -13242 58/pop-to-eax -13243 # . epilogue -13244 89/<- %esp 5/r32/ebp -13245 5d/pop-to-ebp -13246 c3/return -13247 -13248 translate-mu-length-stmt: # out: (addr buffered-file), stmt: (addr stmt), err: (addr buffered-file), ed: (addr exit-descriptor) -13249 # . prologue -13250 55/push-ebp -13251 89/<- %ebp 4/r32/esp -13252 # . save registers -13253 50/push-eax -13254 51/push-ecx -13255 52/push-edx -13256 53/push-ebx -13257 56/push-esi -13258 # esi = stmt -13259 8b/-> *(ebp+0xc) 6/r32/esi -13260 # var base/ebx: (addr var) = stmt->inouts[0]->value -13261 (lookup *(esi+0xc) *(esi+0x10)) # Stmt1-inouts Stmt1-inouts => eax -13262 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax -13263 89/<- %ebx 0/r32/eax -13264 # var elemsize/ecx: int = array-element-size(base) -13265 (array-element-size %ebx *(ebp+0x10) *(ebp+0x14)) # => eax -13266 89/<- %ecx 0/r32/eax -13267 # var outreg/edx: (addr array byte) = stmt->outputs[0]->value->register -13268 (lookup *(esi+0x14) *(esi+0x18)) # Stmt1-outputs Stmt1-outputs => eax -13269 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax -13270 (lookup *(eax+0x18) *(eax+0x1c)) # Var-register Var-register => eax -13271 89/<- %edx 0/r32/eax -13272 # if elemsize == 1 -13273 { -13274 81 7/subop/compare %ecx 1/imm32 -13275 75/jump-if-!= break/disp8 -13276 $translate-mu-length-stmt:size-1: -13277 (emit-save-size-to *(ebp+8) %ebx %edx) -13278 e9/jump $translate-mu-length-stmt:end/disp32 -13279 } -13280 # if elemsize is a power of 2 less than 256 -13281 { -13282 (power-of-2? %ecx *(ebp+0x10) *(ebp+0x14)) # => eax -13283 3d/compare-eax-and 0/imm32/false -13284 74/jump-if-= break/disp8 -13285 81 7/subop/compare %ecx 0xff/imm32 -13286 7f/jump-if-> break/disp8 -13287 $translate-mu-length-stmt:size-power-of-2: -13288 (emit-save-size-to *(ebp+8) %ebx %edx) -13289 (emit-divide-by-shift-right *(ebp+8) %edx %ecx) -13290 e9/jump $translate-mu-length-stmt:end/disp32 -13291 } -13292 # otherwise, the complex case -13293 # . emit register spills -13294 { -13295 $translate-mu-length-stmt:complex: -13296 (string-equal? %edx "eax") # => eax -13297 3d/compare-eax-and 0/imm32/false -13298 75/break-if-!= break/disp8 -13299 (emit-indent *(ebp+8) *Curr-block-depth) -13300 (write-buffered *(ebp+8) "50/push-eax\n") -13301 } -13302 { -13303 (string-equal? %edx "ecx") # => eax -13304 3d/compare-eax-and 0/imm32/false -13305 75/break-if-!= break/disp8 -13306 (emit-indent *(ebp+8) *Curr-block-depth) -13307 (write-buffered *(ebp+8) "51/push-ecx\n") -13308 } -13309 { -13310 (string-equal? %edx "edx") # => eax -13311 3d/compare-eax-and 0/imm32/false -13312 75/break-if-!= break/disp8 -13313 (emit-indent *(ebp+8) *Curr-block-depth) -13314 (write-buffered *(ebp+8) "52/push-edx\n") -13315 } -13316 # . -13317 (emit-save-size-to *(ebp+8) %ebx "eax") -13318 (emit-indent *(ebp+8) *Curr-block-depth) -13319 (write-buffered *(ebp+8) "31/xor %edx 2/r32/edx\n") -13320 (emit-indent *(ebp+8) *Curr-block-depth) -13321 (write-buffered *(ebp+8) "b9/copy-to-ecx ") -13322 (write-int32-hex-buffered *(ebp+8) %ecx) -13323 (write-buffered *(ebp+8) "/imm32\n") -13324 (emit-indent *(ebp+8) *Curr-block-depth) -13325 (write-buffered *(ebp+8) "f7 7/subop/idiv-eax-edx-by %ecx\n") -13326 { -13327 (string-equal? %edx "eax") # => eax -13328 3d/compare-eax-and 0/imm32/false -13329 75/break-if-!= break/disp8 -13330 (emit-indent *(ebp+8) *Curr-block-depth) -13331 (write-buffered *(ebp+8) "89/<- %") -13332 (write-buffered *(ebp+8) %edx) -13333 (write-buffered *(ebp+8) " 0/r32/eax\n") -13334 } -13335 # . emit register restores -13336 { -13337 (string-equal? %edx "edx") # => eax -13338 3d/compare-eax-and 0/imm32/false -13339 75/break-if-!= break/disp8 -13340 (emit-indent *(ebp+8) *Curr-block-depth) -13341 (write-buffered *(ebp+8) "5a/pop-to-edx\n") -13342 } -13343 { -13344 (string-equal? %edx "ecx") # => eax -13345 3d/compare-eax-and 0/imm32/false -13346 75/break-if-!= break/disp8 -13347 (emit-indent *(ebp+8) *Curr-block-depth) -13348 (write-buffered *(ebp+8) "59/pop-to-ecx\n") -13349 } -13350 { -13351 (string-equal? %edx "eax") # => eax -13352 3d/compare-eax-and 0/imm32/false -13353 75/break-if-!= break/disp8 -13354 (emit-indent *(ebp+8) *Curr-block-depth) -13355 (write-buffered *(ebp+8) "58/pop-to-eax\n") -13356 } -13357 $translate-mu-length-stmt:end: -13358 # . restore registers -13359 5e/pop-to-esi -13360 5b/pop-to-ebx -13361 5a/pop-to-edx -13362 59/pop-to-ecx -13363 58/pop-to-eax -13364 # . epilogue -13365 89/<- %esp 5/r32/ebp -13366 5d/pop-to-ebp -13367 c3/return -13368 -13369 array-element-size: # arr: (addr var), err: (addr buffered-file), ed: (addr exit-descriptor) -> result/eax: int -13370 # . prologue -13371 55/push-ebp -13372 89/<- %ebp 4/r32/esp -13373 # -13374 (array-element-type-id *(ebp+8) *(ebp+0xc) *(ebp+0x10)) # => eax -13375 (size-of-type-id-as-array-element %eax) # => eax -13376 $array-element-size:end: -13377 # . epilogue -13378 89/<- %esp 5/r32/ebp -13379 5d/pop-to-ebp -13380 c3/return -13381 -13382 size-of-type-id-as-array-element: # t: type-id -> result/eax: int -13383 # . prologue -13384 55/push-ebp -13385 89/<- %ebp 4/r32/esp -13386 # eax = t -13387 8b/-> *(ebp+8) 0/r32/eax -13388 # if t is 'byte', size is 1 -13389 3d/compare-eax-and 8/imm32/byte -13390 { -13391 75/jump-if-!= break/disp8 -13392 b8/copy-to-eax 1/imm32 -13393 eb/jump $array-element-size:end/disp8 -13394 } -13395 # otherwise proceed as usual -13396 (size-of-type-id %eax) # => eax -13397 $size-of-type-id-as-array-element:end: -13398 # . epilogue -13399 89/<- %esp 5/r32/ebp -13400 5d/pop-to-ebp -13401 c3/return -13402 -13403 emit-save-size-to: # out: (addr buffered-file), base: (addr var), outreg: (addr array byte) -13404 # . prologue -13405 55/push-ebp -13406 89/<- %ebp 4/r32/esp -13407 # . save registers -13408 50/push-eax -13409 53/push-ebx -13410 # ebx = base -13411 8b/-> *(ebp+0xc) 3/r32/ebx -13412 (emit-indent *(ebp+8) *Curr-block-depth) -13413 (write-buffered *(ebp+8) "8b/-> *") -13414 # if base is an (addr array ...) in a register -13415 { -13416 81 7/subop/compare *(ebx+0x18)) 0/imm32 # Var-register -13417 74/jump-if-= break/disp8 -13418 $emit-save-size-to:emit-base-from-register: -13419 (lookup *(ebx+0x18) *(ebx+0x1c)) # Var-register Var-register => eax -13420 (write-buffered *(ebp+8) %eax) -13421 eb/jump $emit-save-size-to:emit-output/disp8 -13422 } -13423 # otherwise if base is an (array ...) on the stack -13424 { -13425 81 7/subop/compare *(ebx+0x14)) 0/imm32 # Var-offset -13426 74/jump-if-= break/disp8 -13427 $emit-save-size-to:emit-base-from-stack: -13428 (write-buffered *(ebp+8) "(ebp+") -13429 (write-int32-hex-buffered *(ebp+8) *(ebx+0x14)) # Var-offset -13430 (write-buffered *(ebp+8) ")") -13431 } -13432 $emit-save-size-to:emit-output: -13433 (write-buffered *(ebp+8) " ") -13434 (get Mu-registers *(ebp+0x10) 0xc "Mu-registers") # => eax -13435 (write-int32-hex-buffered *(ebp+8) *eax) -13436 (write-buffered *(ebp+8) "/r32\n") -13437 $emit-save-size-to:end: -13438 # . restore registers -13439 5b/pop-to-ebx -13440 58/pop-to-eax -13441 # . epilogue -13442 89/<- %esp 5/r32/ebp -13443 5d/pop-to-ebp -13444 c3/return -13445 -13446 emit-divide-by-shift-right: # out: (addr buffered-file), reg: (addr array byte), size: int -13447 # . prologue -13448 55/push-ebp -13449 89/<- %ebp 4/r32/esp -13450 # . save registers -13451 50/push-eax -13452 # -13453 (emit-indent *(ebp+8) *Curr-block-depth) -13454 (write-buffered *(ebp+8) "c1/shift 5/subop/>> %") -13455 (write-buffered *(ebp+8) *(ebp+0xc)) -13456 (write-buffered *(ebp+8) Space) -13457 (num-shift-rights *(ebp+0x10)) # => eax -13458 (write-int32-hex-buffered *(ebp+8) %eax) -13459 (write-buffered *(ebp+8) "/imm8\n") -13460 $emit-divide-by-shift-right:end: -13461 # . restore registers -13462 58/pop-to-eax -13463 # . epilogue -13464 89/<- %esp 5/r32/ebp -13465 5d/pop-to-ebp -13466 c3/return -13467 -13468 translate-mu-index-stmt: # out: (addr buffered-file), stmt: (addr stmt), err: (addr buffered-file), ed: (addr exit-descriptor) -13469 # . prologue -13470 55/push-ebp -13471 89/<- %ebp 4/r32/esp -13472 # . save registers -13473 51/push-ecx -13474 # ecx = stmt -13475 8b/-> *(ebp+0xc) 1/r32/ecx -13476 # var base/ecx: (addr var) = stmt->inouts[0] -13477 (lookup *(ecx+0xc) *(ecx+0x10)) # Stmt1-inouts Stmt1-inouts => eax -13478 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax -13479 89/<- %ecx 0/r32/eax -13480 # if (var->register) do one thing -13481 { -13482 81 7/subop/compare *(ecx+0x18) 0/imm32 # Var-register -13483 74/jump-if-= break/disp8 -13484 # TODO: ensure there's no dereference -13485 (translate-mu-index-stmt-with-array-in-register *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) -13486 eb/jump $translate-mu-index-stmt:end/disp8 -13487 } -13488 # if (var->offset) do a different thing -13489 { -13490 81 7/subop/compare *(ecx+0x14) 0/imm32 # Var-offset -13491 74/jump-if-= break/disp8 -13492 # TODO: ensure there's no dereference -13493 (translate-mu-index-stmt-with-array-on-stack *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) -13494 eb/jump $translate-mu-index-stmt:end/disp8 -13495 } -13496 $translate-mu-index-stmt:end: -13497 # . restore registers -13498 59/pop-to-ecx -13499 # . epilogue -13500 89/<- %esp 5/r32/ebp -13501 5d/pop-to-ebp -13502 c3/return -13503 -13504 $translate-mu-index-stmt-with-array:error1: -13505 (write-buffered *(ebp+0x10) "couldn't translate an index instruction. second (index) input must either lie in a register or be a literal\n") -13506 (flush *(ebp+0x10)) -13507 (stop *(ebp+0x14) 1) -13508 # never gets here -13509 -13510 $translate-mu-index-stmt-with-array:error2: -13511 (write-buffered *(ebp+0x10) "couldn't translate an index instruction. second (index) input when in a register must be an int or offset\n") -13512 (flush *(ebp+0x10)) -13513 (stop *(ebp+0x14) 1) -13514 # never gets here -13515 -13516 translate-mu-index-stmt-with-array-in-register: # out: (addr buffered-file), stmt: (addr stmt), err: (addr buffered-file), ed: (addr exit-descriptor) -13517 # . prologue -13518 55/push-ebp -13519 89/<- %ebp 4/r32/esp -13520 # . save registers -13521 50/push-eax -13522 51/push-ecx -13523 52/push-edx -13524 53/push-ebx -13525 # -13526 (emit-indent *(ebp+8) *Curr-block-depth) -13527 (write-buffered *(ebp+8) "8d/copy-address *(") -13528 # TODO: ensure inouts[0] is in a register and not dereferenced -13529 $translate-mu-index-stmt-with-array-in-register:emit-base: -13530 # ecx = stmt -13531 8b/-> *(ebp+0xc) 1/r32/ecx -13532 # var base/ebx: (addr var) = inouts[0] -13533 (lookup *(ecx+0xc) *(ecx+0x10)) # Stmt1-inouts Stmt1-inouts => eax -13534 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax -13535 89/<- %ebx 0/r32/eax -13536 # print base->register " + " -13537 (lookup *(ebx+0x18) *(ebx+0x1c)) # Var-register Var-register => eax -13538 (write-buffered *(ebp+8) %eax) -13539 (write-buffered *(ebp+8) " + ") -13540 # var index/edx: (addr var) = inouts[1] -13541 (lookup *(ecx+0xc) *(ecx+0x10)) # Stmt1-inouts Stmt1-inouts => eax -13542 (lookup *(eax+8) *(eax+0xc)) # Stmt-var-next Stmt-var-next => eax -13543 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax -13544 89/<- %edx 0/r32/eax -13545 # if index->register -13546 81 7/subop/compare *(edx+0x18) 0/imm32 # Var-register -13547 { +13118 51/push-ecx +13119 # var curr/ecx: (addr list stmt) = stmts +13120 8b/-> *(ebp+8) 1/r32/ecx +13121 { +13122 # if (curr == 0) break +13123 81 7/subop/compare %ecx 0/imm32 +13124 74/jump-if-= break/disp8 +13125 # if assigns-in-stmt?(curr->value, v) return true +13126 (lookup *ecx *(ecx+4)) # List-value List-value => eax +13127 (assigns-in-stmt? %eax *(ebp+0xc)) # => eax +13128 3d/compare-eax-and 0/imm32/false +13129 75/jump-if-!= break/disp8 +13130 # curr = lookup(curr->next) +13131 (lookup *(ecx+8) *(ecx+0xc)) # List-next List-next => eax +13132 89/<- %ecx 0/r32/eax +13133 # +13134 eb/jump loop/disp8 +13135 } +13136 $assigns-in-stmts?:end: +13137 # . restore registers +13138 59/pop-to-ecx +13139 # . epilogue +13140 89/<- %esp 5/r32/ebp +13141 5d/pop-to-ebp +13142 c3/return +13143 +13144 assigns-in-stmt?: # stmt: (addr stmt), v: (addr var) -> result/eax: boolean +13145 # . prologue +13146 55/push-ebp +13147 89/<- %ebp 4/r32/esp +13148 # . save registers +13149 51/push-ecx +13150 # ecx = stmt +13151 8b/-> *(ebp+8) 1/r32/ecx +13152 # if stmt is a stmt1, return assigns-in-stmt-vars?(stmt->outputs, v) +13153 { +13154 81 7/subop/compare *ecx 1/imm32/stmt1 # Stmt-tag +13155 75/jump-if-!= break/disp8 +13156 (lookup *(ecx+0x14) *(ecx+0x18)) # Stmt1-outputs Stmt1-outputs => eax +13157 (assigns-in-stmt-vars? %eax *(ebp+0xc)) # => eax +13158 eb/jump $assigns-in-stmt?:end/disp8 +13159 } +13160 # if stmt is a block, return assigns-in-stmts?(stmt->stmts, v) +13161 { +13162 81 7/subop/compare *ecx 0/imm32/block # Stmt-tag +13163 75/jump-if-!= break/disp8 +13164 (lookup *(ecx+4) *(ecx+8)) # Block-stmts Block-stmts => eax +13165 (assigns-in-stmts? %eax *(ebp+0xc)) # => eax +13166 eb/jump $assigns-in-stmt?:end/disp8 +13167 } +13168 # otherwise return false +13169 b8/copy 0/imm32/false +13170 $assigns-in-stmt?:end: +13171 # . restore registers +13172 59/pop-to-ecx +13173 # . epilogue +13174 89/<- %esp 5/r32/ebp +13175 5d/pop-to-ebp +13176 c3/return +13177 +13178 assigns-in-stmt-vars?: # stmt-var: (addr stmt-var), v: (addr var) -> result/eax: boolean +13179 # . prologue +13180 55/push-ebp +13181 89/<- %ebp 4/r32/esp +13182 # . save registers +13183 51/push-ecx +13184 # var curr/ecx: (addr stmt-var) = stmt-var +13185 8b/-> *(ebp+8) 1/r32/ecx +13186 { +13187 # if (curr == 0) break +13188 81 7/subop/compare %ecx 0/imm32 +13189 74/jump-if-= break/disp8 +13190 # eax = lookup(curr->value) +13191 (lookup *ecx *(ecx+4)) # Stmt-var-value Stmt-var-value => eax +13192 # if (eax == v && curr->is-deref? == false) return true +13193 { +13194 39/compare *(ebp+0xc) 0/r32/eax +13195 75/jump-if-!= break/disp8 +13196 81 7/subop/compare *(ecx+0x10) 0/imm32/false # Stmt-var-is-deref +13197 75/jump-if-!= break/disp8 +13198 b8/copy-to-eax 1/imm32/true +13199 eb/jump $assigns-in-stmt-vars?:end/disp8 +13200 } +13201 # curr = lookup(curr->next) +13202 (lookup *(ecx+8) *(ecx+0xc)) # Stmt-var-next Stmt-var-next => eax +13203 89/<- %ecx 0/r32/eax +13204 # +13205 eb/jump loop/disp8 +13206 } +13207 $assigns-in-stmt-vars?:end: +13208 # . restore registers +13209 59/pop-to-ecx +13210 # . epilogue +13211 89/<- %esp 5/r32/ebp +13212 5d/pop-to-ebp +13213 c3/return +13214 +13215 # is there a var before 'v' with the same block-depth and register on the 'vars' stack? +13216 # v is guaranteed to be within vars +13217 # 'start' is provided as an optimization, a pointer within vars +13218 # *start == v +13219 same-register-spilled-before?: # v: (addr var), vars: (addr stack (handle var)), start: (addr var) -> result/eax: boolean +13220 # . prologue +13221 55/push-ebp +13222 89/<- %ebp 4/r32/esp +13223 # . save registers +13224 51/push-ecx +13225 52/push-edx +13226 53/push-ebx +13227 56/push-esi +13228 57/push-edi +13229 # ecx = v +13230 8b/-> *(ebp+8) 1/r32/ecx +13231 # var reg/edx: (addr array byte) = lookup(v->register) +13232 (lookup *(ecx+0x18) *(ecx+0x1c)) # Var-register Var-register => eax +13233 89/<- %edx 0/r32/eax +13234 # var depth/ebx: int = v->block-depth +13235 8b/-> *(ecx+0x10) 3/r32/ebx # Var-block-depth +13236 # var min/ecx: (addr handle var) = vars->data +13237 8b/-> *(ebp+0xc) 1/r32/ecx +13238 81 0/subop/add %ecx 8/imm32 +13239 # TODO: check that start >= min and start < &vars->data[top] +13240 # TODO: check that *start == v +13241 # var curr/esi: (addr handle var) = start +13242 8b/-> *(ebp+0x10) 6/r32/esi +13243 # curr -= 8 +13244 81 5/subop/subtract %esi 8/imm32 +13245 { +13246 $same-register-spilled-before?:loop: +13247 # if (curr < min) break +13248 39/compare %esi 1/r32/ecx +13249 0f 82/jump-if-addr< break/disp32 +13250 # var x/eax: (addr var) = lookup(*curr) +13251 (lookup *esi *(esi+4)) # => eax +13252 # if (x->block-depth < depth) break +13253 39/compare *(eax+0x10) 3/r32/ebx # Var-block-depth +13254 0f 8c/jump-if-< break/disp32 +13255 # if (x->register == 0) continue +13256 81 7/subop/compare *(eax+0x18) 0/imm32 # Var-register +13257 74/jump-if-= $same-register-spilled-before?:continue/disp8 +13258 # if (x->register == reg) return true +13259 (lookup *(eax+0x18) *(eax+0x1c)) # Var-register Var-register => eax +13260 (string-equal? %eax %edx) # => eax +13261 3d/compare-eax-and 0/imm32/false +13262 b8/copy-to-eax 1/imm32/true +13263 75/jump-if-!= $same-register-spilled-before?:end/disp8 +13264 $same-register-spilled-before?:continue: +13265 # curr -= 8 +13266 81 5/subop/subtract %esi 8/imm32 +13267 e9/jump loop/disp32 +13268 } +13269 $same-register-spilled-before?:false: +13270 b8/copy-to-eax 0/imm32/false +13271 $same-register-spilled-before?:end: +13272 # . restore registers +13273 5f/pop-to-edi +13274 5e/pop-to-esi +13275 5b/pop-to-ebx +13276 5a/pop-to-edx +13277 59/pop-to-ecx +13278 # . epilogue +13279 89/<- %esp 5/r32/ebp +13280 5d/pop-to-ebp +13281 c3/return +13282 +13283 # Clean up global state for 'vars' until some block depth (inclusive). +13284 # +13285 # This would be a simple series of pops, if it wasn't for fn outputs, which +13286 # can occur anywhere in the stack. +13287 # So we have to _compact_ the entire array underlying the stack. +13288 # +13289 # We want to allow a fn output register to be written to by locals before the +13290 # output is set. +13291 # So fn outputs can't just be pushed at the start of the function. +13292 # +13293 # We want to allow other locals to shadow a fn output register after the +13294 # output is set. +13295 # So the output can't just always override anything in the stack. Sequence matters. +13296 clean-up-blocks: # vars: (addr stack live-var), until-block-depth: int, fn: (addr function) +13297 # pseudocode: +13298 # to = vars->top (which points outside the stack) +13299 # while true +13300 # if to <= 0 +13301 # break +13302 # var v = vars->data[to-1] +13303 # if v.depth < until and !in-function-outputs?(fn, v) +13304 # break +13305 # --to +13306 # from = to +13307 # while true +13308 # if from >= vars->top +13309 # break +13310 # assert(from >= to) +13311 # v = vars->data[from] +13312 # if in-function-outputs?(fn, v) +13313 # if from > to +13314 # vars->data[to] = vars->data[from] +13315 # ++to +13316 # ++from +13317 # vars->top = to +13318 # +13319 # . prologue +13320 55/push-ebp +13321 89/<- %ebp 4/r32/esp +13322 # . save registers +13323 50/push-eax +13324 52/push-edx +13325 53/push-ebx +13326 56/push-esi +13327 57/push-edi +13328 # ebx = vars +13329 8b/-> *(ebp+8) 3/r32/ebx +13330 # edx = until-block-depth +13331 8b/-> *(ebp+0xc) 2/r32/edx +13332 $clean-up-blocks:phase1: +13333 # var to/edi: int = vars->top +13334 8b/-> *ebx 7/r32/edi +13335 { +13336 $clean-up-blocks:loop1: +13337 # if (to <= 0) break +13338 81 7/subop/compare %edi 0/imm32 +13339 7e/jump-if-<= break/disp8 +13340 # var v/eax: (addr var) = lookup(vars->data[to-1]->var) +13341 8d/copy-address *(ebx+edi-4) 0/r32/eax # vars + 8 + to - 12 +13342 (lookup *eax *(eax+4)) # => eax +13343 # if (v->block-depth >= until-block-depth) continue +13344 39/compare *(eax+0x10) 2/r32/edx # Var-block-depth +13345 { +13346 7d/jump-if->= break/disp8 +13347 # if (!in-function-outputs?(fn, v)) break +13348 (in-function-outputs? *(ebp+0x10) %eax) # => eax +13349 3d/compare-eax-and 0/imm32/false +13350 74/jump-if-= $clean-up-blocks:phase2/disp8 +13351 } +13352 $clean-up-blocks:loop1-continue: +13353 # --to +13354 81 5/subop/subtract %edi 0xc/imm32 +13355 # +13356 eb/jump loop/disp8 +13357 } +13358 $clean-up-blocks:phase2: +13359 # var from/esi: int = to +13360 89/<- %esi 7/r32/edi +13361 { +13362 $clean-up-blocks:loop2: +13363 # if (from >= vars->top) break +13364 3b/compare 6/r32/esi *ebx +13365 7d/jump-if->= break/disp8 +13366 # var v/eax: (addr var) = lookup(vars->data[from]->var) +13367 8d/copy-address *(ebx+esi+8) 0/r32/eax +13368 (lookup *eax *(eax+4)) # => eax +13369 # if !in-function-outputs?(fn, v) continue +13370 (in-function-outputs? *(ebp+0x10) %eax) # => eax +13371 3d/compare-eax-and 0/imm32/false +13372 74/jump-if-= $clean-up-blocks:loop2-continue/disp8 +13373 # invariant: from >= to +13374 # if (from > to) vars->data[to] = vars->data[from] +13375 { +13376 39/compare %esi 7/r32/edi +13377 7e/jump-if-<= break/disp8 +13378 56/push-esi +13379 57/push-edi +13380 # . var from/esi: (addr byte) = &vars->data[from] +13381 8d/copy-address *(ebx+esi+8) 6/r32/esi +13382 # . var to/edi: (addr byte) = &vars->data[to] +13383 8d/copy-address *(ebx+edi+8) 7/r32/edi +13384 # . +13385 8b/-> *esi 0/r32/eax +13386 89/<- *edi 0/r32/eax +13387 8b/-> *(esi+4) 0/r32/eax +13388 89/<- *(edi+4) 0/r32/eax +13389 8b/-> *(esi+8) 0/r32/eax +13390 89/<- *(edi+8) 0/r32/eax +13391 5f/pop-to-edi +13392 5e/pop-to-esi +13393 } +13394 # ++to +13395 81 0/subop/add %edi 0xc/imm32 +13396 $clean-up-blocks:loop2-continue: +13397 # ++from +13398 81 0/subop/add %esi 0xc/imm32 +13399 # +13400 eb/jump loop/disp8 +13401 } +13402 89/<- *ebx 7/r32/edi +13403 $clean-up-blocks:end: +13404 # . restore registers +13405 5f/pop-to-edi +13406 5e/pop-to-esi +13407 5b/pop-to-ebx +13408 5a/pop-to-edx +13409 58/pop-to-eax +13410 # . epilogue +13411 89/<- %esp 5/r32/ebp +13412 5d/pop-to-ebp +13413 c3/return +13414 +13415 in-function-outputs?: # fn: (addr function), target: (addr var) -> result/eax: boolean +13416 # . prologue +13417 55/push-ebp +13418 89/<- %ebp 4/r32/esp +13419 # . save registers +13420 51/push-ecx +13421 # var curr/ecx: (addr list var) = lookup(fn->outputs) +13422 8b/-> *(ebp+8) 1/r32/ecx +13423 (lookup *(ecx+0x10) *(ecx+0x14)) # Function-outputs Function-outputs => eax +13424 89/<- %ecx 0/r32/eax +13425 # while curr != null +13426 { +13427 81 7/subop/compare %ecx 0/imm32 +13428 74/jump-if-= break/disp8 +13429 # var v/eax: (addr var) = lookup(curr->value) +13430 (lookup *ecx *(ecx+4)) # List-value List-value => eax +13431 # if (v == target) return true +13432 39/compare *(ebp+0xc) 0/r32/eax +13433 b8/copy-to-eax 1/imm32/true +13434 74/jump-if-= $in-function-outputs?:end/disp8 +13435 # curr = curr->next +13436 (lookup *(ecx+8) *(ecx+0xc)) # List-next List-next => eax +13437 89/<- %ecx 0/r32/eax +13438 # +13439 eb/jump loop/disp8 +13440 } +13441 b8/copy-to-eax 0/imm32 +13442 $in-function-outputs?:end: +13443 # . restore registers +13444 59/pop-to-ecx +13445 # . epilogue +13446 89/<- %esp 5/r32/ebp +13447 5d/pop-to-ebp +13448 c3/return +13449 +13450 emit-subx-var-def: # out: (addr buffered-file), stmt: (addr stmt) +13451 # . prologue +13452 55/push-ebp +13453 89/<- %ebp 4/r32/esp +13454 # . save registers +13455 50/push-eax +13456 51/push-ecx +13457 52/push-edx +13458 # eax = stmt +13459 8b/-> *(ebp+0xc) 0/r32/eax +13460 # var v/ecx: (addr var) +13461 (lookup *(eax+4) *(eax+8)) # Vardef-var Vardef-var => eax +13462 89/<- %ecx 0/r32/eax +13463 # v->block-depth = *Curr-block-depth +13464 8b/-> *Curr-block-depth 0/r32/eax +13465 89/<- *(ecx+0x10) 0/r32/eax # Var-block-depth +13466 # var n/edx: int = size-of(stmt->var) +13467 (size-of %ecx) # => eax +13468 89/<- %edx 0/r32/eax +13469 # *Curr-local-stack-offset -= n +13470 29/subtract-from *Curr-local-stack-offset 2/r32/edx +13471 # v->offset = *Curr-local-stack-offset +13472 8b/-> *Curr-local-stack-offset 0/r32/eax +13473 89/<- *(ecx+0x14) 0/r32/eax # Var-offset +13474 # if v is an array, do something special +13475 { +13476 (lookup *(ecx+8) *(ecx+0xc)) # Var-type Var-type => eax +13477 (is-mu-array? %eax) # => eax +13478 3d/compare-eax-and 0/imm32/false +13479 0f 84/jump-if-= break/disp32 +13480 # var array-size-without-size/edx: int = n-4 +13481 81 5/subop/subtract %edx 4/imm32 +13482 (emit-indent *(ebp+8) *Curr-block-depth) +13483 (write-buffered *(ebp+8) "(push-n-zero-bytes ") +13484 (write-int32-hex-buffered *(ebp+8) %edx) +13485 (write-buffered *(ebp+8) ")\n") +13486 (emit-indent *(ebp+8) *Curr-block-depth) +13487 (write-buffered *(ebp+8) "68/push ") +13488 (write-int32-hex-buffered *(ebp+8) %edx) +13489 (write-buffered *(ebp+8) "/imm32\n") +13490 eb/jump $emit-subx-var-def:end/disp8 +13491 } +13492 # while n > 0 +13493 { +13494 81 7/subop/compare %edx 0/imm32 +13495 7e/jump-if-<= break/disp8 +13496 (emit-indent *(ebp+8) *Curr-block-depth) +13497 (write-buffered *(ebp+8) "68/push 0/imm32\n") +13498 # n -= 4 +13499 81 5/subop/subtract %edx 4/imm32 +13500 # +13501 eb/jump loop/disp8 +13502 } +13503 $emit-subx-var-def:end: +13504 # . restore registers +13505 5a/pop-to-edx +13506 59/pop-to-ecx +13507 58/pop-to-eax +13508 # . epilogue +13509 89/<- %esp 5/r32/ebp +13510 5d/pop-to-ebp +13511 c3/return +13512 +13513 emit-subx-stmt: # out: (addr buffered-file), stmt: (addr stmt), primitives: (addr primitive), err: (addr buffered-file), ed: (addr exit-descriptor) +13514 # . prologue +13515 55/push-ebp +13516 89/<- %ebp 4/r32/esp +13517 # . save registers +13518 50/push-eax +13519 51/push-ecx +13520 # - some special-case primitives that don't actually use the 'primitives' data structure +13521 # var op/ecx: (addr array byte) = lookup(stmt->operation) +13522 8b/-> *(ebp+0xc) 1/r32/ecx +13523 (lookup *(ecx+4) *(ecx+8)) # Stmt1-operation Stmt1-operation => eax +13524 89/<- %ecx 0/r32/eax +13525 # array size +13526 { +13527 # if (!string-equal?(stmt->operation, "length")) break +13528 (string-equal? %ecx "length") # => eax +13529 3d/compare-eax-and 0/imm32 +13530 0f 84/jump-if-= break/disp32 +13531 (translate-mu-length-stmt *(ebp+8) *(ebp+0xc) *(ebp+0x14) *(ebp+0x18)) +13532 e9/jump $emit-subx-stmt:end/disp32 +13533 } +13534 # index into array +13535 { +13536 # if (!string-equal?(stmt->operation, "index")) break +13537 (string-equal? %ecx "index") # => eax +13538 3d/compare-eax-and 0/imm32 +13539 0f 84/jump-if-= break/disp32 +13540 (translate-mu-index-stmt *(ebp+8) *(ebp+0xc) *(ebp+0x14) *(ebp+0x18)) +13541 e9/jump $emit-subx-stmt:end/disp32 +13542 } +13543 # compute-offset for index into array +13544 { +13545 # if (!string-equal?(stmt->operation, "compute-offset")) break +13546 (string-equal? %ecx "compute-offset") # => eax +13547 3d/compare-eax-and 0/imm32 13548 0f 84/jump-if-= break/disp32 -13549 $translate-mu-index-stmt-with-array-in-register:emit-register-index: -13550 # if index is an int -13551 (lookup *(edx+8) *(edx+0xc)) # Var-type Var-type => eax -13552 (is-simple-mu-type? %eax 1) # int => eax -13553 3d/compare-eax-and 0/imm32/false -13554 { -13555 0f 84/jump-if-= break/disp32 -13556 $translate-mu-index-stmt-with-array-in-register:emit-int-register-index: -13557 # print index->register "<<" log2(array-element-size(base)) " + 4) " -13558 # . index->register "<<" -13559 (lookup *(edx+0x18) *(edx+0x1c)) # Var-register Var-register => eax -13560 (write-buffered *(ebp+8) %eax) -13561 (write-buffered *(ebp+8) "<<") -13562 # . log2(array-element-size(base->type)) -13563 # TODO: ensure size is a power of 2 -13564 (array-element-size %ebx *(ebp+0x10) *(ebp+0x14)) # => eax -13565 (num-shift-rights %eax) # => eax -13566 (write-int32-hex-buffered *(ebp+8) %eax) -13567 e9/jump $translate-mu-index-stmt-with-array-in-register:emit-register-index-done/disp32 -13568 } -13569 # if index->type is any other atom, abort -13570 (lookup *(edx+8) *(edx+0xc)) # Var-type Var-type => eax -13571 81 7/subop/compare *eax 0/imm32/false # Tree-is-atom -13572 0f 85/jump-if-!= $translate-mu-index-stmt-with-array:error2/disp32 -13573 # if index has type (offset ...) -13574 (lookup *(eax+4) *(eax+8)) # Tree-left Tree-left => eax -13575 (is-simple-mu-type? %eax 7) # => eax -13576 3d/compare-eax-and 0/imm32/false -13577 { -13578 0f 84/jump-if-= break/disp32 -13579 # print index->register -13580 $translate-mu-index-stmt-with-array-in-register:emit-offset-register-index: -13581 (lookup *(edx+0x18) *(edx+0x1c)) # Var-register Var-register => eax -13582 (write-buffered *(ebp+8) %eax) -13583 } -13584 $translate-mu-index-stmt-with-array-in-register:emit-register-index-done: -13585 (write-buffered *(ebp+8) " + 4) ") -13586 e9/jump $translate-mu-index-stmt-with-array-in-register:emit-output/disp32 -13587 } -13588 # otherwise if index is a literal -13589 (lookup *(edx+8) *(edx+0xc)) # Var-type Var-type => eax -13590 (is-simple-mu-type? %eax 0) # => eax -13591 3d/compare-eax-and 0/imm32/false -13592 { -13593 0f 84/jump-if-= break/disp32 -13594 $translate-mu-index-stmt-with-array-in-register:emit-literal-index: -13595 # var index-value/edx: int = parse-hex-int(index->name) -13596 (lookup *edx *(edx+4)) # Var-name Var-name => eax -13597 (parse-hex-int %eax) # => eax -13598 89/<- %edx 0/r32/eax -13599 # offset = idx-value * array-element-size(base->type) -13600 (array-element-size %ebx *(ebp+0x10) *(ebp+0x14)) # => eax -13601 f7 4/subop/multiply-into-eax %edx # clobbers edx -13602 # offset += 4 for array size -13603 05/add-to-eax 4/imm32 -13604 # TODO: check edx for overflow -13605 # print offset -13606 (write-int32-hex-buffered *(ebp+8) %eax) -13607 (write-buffered *(ebp+8) ") ") -13608 e9/jump $translate-mu-index-stmt-with-array-in-register:emit-output/disp32 -13609 } -13610 # otherwise abort -13611 e9/jump $translate-mu-index-stmt-with-array:error1/disp32 -13612 $translate-mu-index-stmt-with-array-in-register:emit-output: -13613 # outputs[0] "/r32" -13614 8b/-> *(ebp+0xc) 1/r32/ecx -13615 (lookup *(ecx+0x14) *(ecx+0x18)) # Stmt1-outputs Stmt1-outputs => eax -13616 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax -13617 (lookup *(eax+0x18) *(eax+0x1c)) # Var-register Var-register => eax -13618 (get Mu-registers %eax 0xc "Mu-registers") # => eax: (addr int) -13619 (write-int32-hex-buffered *(ebp+8) *eax) -13620 (write-buffered *(ebp+8) "/r32\n") -13621 $translate-mu-index-stmt-with-array-in-register:end: -13622 # . restore registers -13623 5b/pop-to-ebx -13624 5a/pop-to-edx -13625 59/pop-to-ecx -13626 58/pop-to-eax -13627 # . epilogue -13628 89/<- %esp 5/r32/ebp -13629 5d/pop-to-ebp -13630 c3/return -13631 -13632 translate-mu-index-stmt-with-array-on-stack: # out: (addr buffered-file), stmt: (addr stmt), err: (addr buffered-file), ed: (addr exit-descriptor) -13633 # . prologue -13634 55/push-ebp -13635 89/<- %ebp 4/r32/esp -13636 # . save registers -13637 50/push-eax -13638 51/push-ecx -13639 52/push-edx -13640 53/push-ebx -13641 # -13642 (emit-indent *(ebp+8) *Curr-block-depth) -13643 (write-buffered *(ebp+8) "8d/copy-address *(ebp + ") -13644 # var curr/edx: (addr stmt-var) = lookup(stmt->inouts) -13645 8b/-> *(ebp+0xc) 0/r32/eax -13646 (lookup *(eax+0xc) *(eax+0x10)) # Stmt1-inouts Stmt1-inouts => eax -13647 89/<- %edx 0/r32/eax -13648 # var base/ecx: (addr var) = lookup(curr->value) -13649 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax -13650 89/<- %ecx 0/r32/eax -13651 # var curr2/eax: (addr stmt-var) = lookup(curr->next) -13652 (lookup *(edx+8) *(edx+0xc)) # Stmt-var-next Stmt-var-next => eax -13653 # var index/edx: (handle var) = curr2->value -13654 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax -13655 89/<- %edx 0/r32/eax -13656 # if index->register -13657 81 7/subop/compare *(edx+0x18) 0/imm32 # Var-register -13658 { -13659 0f 84/jump-if-= break/disp32 -13660 $translate-mu-index-stmt-with-array-on-stack:emit-register-index: -13661 # if index is an int -13662 (lookup *(edx+8) *(edx+0xc)) # Var-type Var-type => eax -13663 (is-simple-mu-type? %eax 1) # int => eax -13664 3d/compare-eax-and 0/imm32/false -13665 { -13666 0f 84/jump-if-= break/disp32 -13667 $translate-mu-index-stmt-with-array-on-stack:emit-int-register-index: -13668 # print index->register "<<" log2(array-element-size(base)) " + " base->offset+4 -13669 # . inouts[1]->register "<<" -13670 (lookup *(edx+0x18) *(edx+0x1c)) # Var-register Var-register => eax -13671 (write-buffered *(ebp+8) %eax) -13672 (write-buffered *(ebp+8) "<<") -13673 # . log2(array-element-size(base)) -13674 # TODO: ensure size is a power of 2 -13675 (array-element-size %ecx *(ebp+0x10) *(ebp+0x14)) # => eax -13676 (num-shift-rights %eax) # => eax -13677 (write-int32-hex-buffered *(ebp+8) %eax) -13678 # -13679 (write-buffered *(ebp+8) " + ") -13680 # -13681 8b/-> *(ecx+0x14) 0/r32/eax # Var-offset -13682 05/add-to-eax 4/imm32 # for array length -13683 (write-int32-hex-buffered *(ebp+8) %eax) -13684 e9/jump $translate-mu-index-stmt-with-array-on-stack:emit-register-index-done/disp32 -13685 } -13686 # if index->type is any other atom, abort -13687 (lookup *(edx+8) *(edx+0xc)) # Var-type Var-type => eax -13688 81 7/subop/compare *eax 0/imm32/false # Tree-is-atom -13689 0f 85/jump-if-!= $translate-mu-index-stmt-with-array:error2/disp32 -13690 # if index has type (offset ...) -13691 (lookup *(eax+4) *(eax+8)) # Tree-left Tree-left => eax -13692 (is-simple-mu-type? %eax 7) # => eax -13693 3d/compare-eax-and 0/imm32/false -13694 { -13695 0f 84/jump-if-= break/disp32 -13696 # print index->register -13697 $translate-mu-index-stmt-with-array-on-stack:emit-offset-register-index: -13698 (lookup *(edx+0x18) *(edx+0x1c)) # Var-register Var-register => eax -13699 (write-buffered *(ebp+8) %eax) -13700 } -13701 $translate-mu-index-stmt-with-array-on-stack:emit-register-index-done: -13702 (write-buffered *(ebp+8) ") ") -13703 e9/jump $translate-mu-index-stmt-with-array-on-stack:emit-output/disp32 -13704 } -13705 # otherwise if index is a literal -13706 (lookup *(edx+8) *(edx+0xc)) # Var-type Var-type => eax -13707 (is-simple-mu-type? %eax 0) # => eax -13708 3d/compare-eax-and 0/imm32/false -13709 { -13710 0f 84/jump-if-= break/disp32 -13711 $translate-mu-index-stmt-with-array-on-stack:emit-literal-index: -13712 # var idx-value/edx: int = parse-hex-int(index->name) -13713 (lookup *edx *(edx+4)) # Var-name Var-name => eax -13714 (parse-hex-int %eax) # Var-name => eax -13715 89/<- %edx 0/r32/eax -13716 # offset = idx-value * array-element-size(base) -13717 (array-element-size %ecx *(ebp+0x10) *(ebp+0x14)) # => eax -13718 f7 4/subop/multiply-into-eax %edx # clobbers edx -13719 # offset += base->offset -13720 03/add *(ecx+0x14) 0/r32/eax # Var-offset -13721 # offset += 4 for array size -13722 05/add-to-eax 4/imm32 -13723 # TODO: check edx for overflow -13724 # print offset -13725 (write-int32-hex-buffered *(ebp+8) %eax) -13726 (write-buffered *(ebp+8) ") ") -13727 e9/jump $translate-mu-index-stmt-with-array-on-stack:emit-output/disp32 -13728 } -13729 # otherwise abort -13730 e9/jump $translate-mu-index-stmt-with-array:error1/disp32 -13731 $translate-mu-index-stmt-with-array-on-stack:emit-output: -13732 # outputs[0] "/r32" -13733 8b/-> *(ebp+0xc) 0/r32/eax -13734 (lookup *(eax+0x14) *(eax+0x18)) # Stmt1-outputs Stmt1-outputs => eax -13735 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax -13736 (lookup *(eax+0x18) *(eax+0x1c)) # Var-register Var-register => eax -13737 (get Mu-registers %eax 0xc "Mu-registers") # => eax: (addr int) -13738 (write-int32-hex-buffered *(ebp+8) *eax) -13739 (write-buffered *(ebp+8) "/r32\n") -13740 $translate-mu-index-stmt-with-array-on-stack:end: -13741 # . restore registers -13742 5b/pop-to-ebx -13743 5a/pop-to-edx -13744 59/pop-to-ecx -13745 58/pop-to-eax -13746 # . epilogue -13747 89/<- %esp 5/r32/ebp -13748 5d/pop-to-ebp -13749 c3/return -13750 -13751 translate-mu-compute-index-stmt: # out: (addr buffered-file), stmt: (addr stmt), err: (addr buffered-file), ed: (addr exit-descriptor) -13752 # . prologue -13753 55/push-ebp -13754 89/<- %ebp 4/r32/esp -13755 # . save registers -13756 50/push-eax -13757 51/push-ecx -13758 52/push-edx -13759 53/push-ebx -13760 # -13761 (emit-indent *(ebp+8) *Curr-block-depth) -13762 (write-buffered *(ebp+8) "69/multiply") -13763 # ecx = stmt -13764 8b/-> *(ebp+0xc) 1/r32/ecx -13765 # var first-inout/ebx: (addr stmt-var) = stmt->inouts[0] -13766 (lookup *(ecx+0xc) *(ecx+0x10)) # Stmt1-inouts Stmt1-inouts => eax -13767 89/<- %ebx 0/r32/eax -13768 $translate-mu-compute-index-stmt:emit-index: -13769 (lookup *(ebx+8) *(ebx+0xc)) # Stmt-var-next Stmt-var-next => eax -13770 (emit-subx-var-as-rm32 *(ebp+8) %eax) -13771 (write-buffered *(ebp+8) Space) -13772 $translate-mu-compute-index-stmt:emit-elem-size: -13773 # var base/ebx: (addr var) -13774 (lookup *ebx *(ebx+4)) # Stmt-var-value Stmt-var-value => eax -13775 89/<- %ebx 0/r32/eax -13776 # print array-element-size(base) -13777 (array-element-size %ebx *(ebp+0x10) *(ebp+0x14)) # => eax -13778 (write-int32-hex-buffered *(ebp+8) %eax) -13779 (write-buffered *(ebp+8) "/imm32 ") -13780 $translate-mu-compute-index-stmt:emit-output: -13781 # outputs[0] "/r32" -13782 (lookup *(ecx+0x14) *(ecx+0x18)) # Stmt1-outputs Stmt1-outputs => eax -13783 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax -13784 (lookup *(eax+0x18) *(eax+0x1c)) # Var-register Var-register => eax -13785 (get Mu-registers %eax 0xc "Mu-registers") # => eax: (addr int) -13786 (write-int32-hex-buffered *(ebp+8) *eax) -13787 (write-buffered *(ebp+8) "/r32\n") -13788 $translate-mu-compute-index-stmt:end: -13789 # . restore registers -13790 5b/pop-to-ebx -13791 5a/pop-to-edx -13792 59/pop-to-ecx -13793 58/pop-to-eax -13794 # . epilogue -13795 89/<- %esp 5/r32/ebp -13796 5d/pop-to-ebp -13797 c3/return -13798 -13799 translate-mu-get-stmt: # out: (addr buffered-file), stmt: (addr stmt) -13800 # . prologue -13801 55/push-ebp -13802 89/<- %ebp 4/r32/esp -13803 # . save registers -13804 50/push-eax -13805 51/push-ecx -13806 52/push-edx -13807 # -13808 (emit-indent *(ebp+8) *Curr-block-depth) -13809 (write-buffered *(ebp+8) "8d/copy-address ") -13810 # ecx = stmt -13811 8b/-> *(ebp+0xc) 1/r32/ecx -13812 # var offset/edx: int = get offset of stmt -13813 (mu-get-offset %ecx) # => eax -13814 89/<- %edx 0/r32/eax -13815 # var base/eax: (addr var) = stmt->inouts->value -13816 (lookup *(ecx+0xc) *(ecx+0x10)) # Stmt1-inouts Stmt1-inouts => eax -13817 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax -13818 # if base is in a register -13819 81 7/subop/compare *(eax+0x18) 0/imm32 # Var-register -13820 { -13821 0f 84/jump-if-= break/disp32 -13822 $translate-mu-get-stmt:emit-register-input: -13823 # emit "*(" base->register " + " offset ") " -13824 (write-buffered *(ebp+8) "*(") -13825 (lookup *(eax+0x18) *(eax+0x1c)) # Var-register Var-register => eax -13826 (write-buffered *(ebp+8) %eax) -13827 (write-buffered *(ebp+8) " + ") -13828 (write-int32-hex-buffered *(ebp+8) %edx) -13829 (write-buffered *(ebp+8) ") ") -13830 e9/jump $translate-mu-get-stmt:emit-output/disp32 -13831 } -13832 # otherwise base is on the stack -13833 { -13834 $translate-mu-get-stmt:emit-stack-input: -13835 # emit "*(ebp + " inouts[0]->stack-offset + offset ") " -13836 (write-buffered *(ebp+8) "*(ebp+") -13837 03/add *(eax+0x14) 2/r32/edx # Var-offset -13838 (write-int32-hex-buffered *(ebp+8) %edx) -13839 (write-buffered *(ebp+8) ") ") -13840 eb/jump $translate-mu-get-stmt:emit-output/disp8 -13841 } -13842 $translate-mu-get-stmt:emit-output: -13843 # var output/eax: (addr var) = stmt->outputs->value -13844 (lookup *(ecx+0x14) *(ecx+0x18)) # Stmt1-outputs Stmt1-outputs => eax -13845 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax -13846 # emit offset->register "/r32" -13847 (lookup *(eax+0x18) *(eax+0x1c)) # Var-register Var-register => eax -13848 (get Mu-registers %eax 0xc "Mu-registers") # => eax: (addr int) -13849 (write-int32-hex-buffered *(ebp+8) *eax) -13850 (write-buffered *(ebp+8) "/r32\n") -13851 $translate-mu-get-stmt:end: -13852 # . restore registers -13853 5a/pop-to-edx -13854 59/pop-to-ecx -13855 58/pop-to-eax -13856 # . epilogue -13857 89/<- %esp 5/r32/ebp -13858 5d/pop-to-ebp -13859 c3/return -13860 -13861 array-element-type-id: # v: (addr var), err: (addr buffered-file), ed: (addr exit-descriptor) -> result/eax: type-id -13862 # precondition: n is positive -13863 # . prologue -13864 55/push-ebp -13865 89/<- %ebp 4/r32/esp -13866 # -13867 8b/-> *(ebp+8) 0/r32/eax -13868 # var t/eax: (addr tree type-id) -13869 (lookup *(eax+8) *(eax+0xc)) # Var-type Var-type => eax -13870 # if t == 0 abort -13871 3d/compare-eax-with 0/imm32 -13872 0f 84/jump-if-== $array-element-type-id:error0/disp32 -13873 # if t->is-atom? abort -13874 81 7/subop/compare *eax 0/imm32/false # Tree-is-atom -13875 0f 85/jump-if-!= $array-element-type-id:error1/disp32 -13876 # if (t->left == addr) t = t->right -13877 { -13878 50/push-eax -13879 (lookup *(eax+4) *(eax+8)) # Tree-left Tree-left => eax -13880 (is-simple-mu-type? %eax 2) # addr => eax -13881 3d/compare-eax-with 0/imm32/false -13882 58/pop-to-eax -13883 74/jump-if-= break/disp8 -13884 $array-element-type-id:skip-addr: -13885 (lookup *(eax+0xc) *(eax+0x10)) # Tree-right Tree-right => eax -13886 } -13887 # if t == 0 abort -13888 3d/compare-eax-with 0/imm32 -13889 0f 84/jump-if-= $array-element-type-id:error2/disp32 -13890 # if t->is-atom? abort -13891 81 7/subop/compare *eax 0/imm32/false # Tree-is-atom -13892 0f 85/jump-if-!= $array-element-type-id:error2/disp32 -13893 # if t->left != array abort -13894 { -13895 50/push-eax -13896 (lookup *(eax+4) *(eax+8)) # Tree-left Tree-left => eax -13897 (is-simple-mu-type? %eax 3) # array => eax -13898 3d/compare-eax-with 0/imm32/false -13899 58/pop-to-eax -13900 $array-element-type-id:no-array: -13901 0f 84/jump-if-= $array-element-type-id:error2/disp32 -13902 } -13903 $array-element-type-id:skip-array: -13904 # t = t->right -13905 (lookup *(eax+0xc) *(eax+0x10)) # Tree-right Tree-right => eax -13906 # if t == 0 abort -13907 3d/compare-eax-with 0/imm32 -13908 0f 84/jump-if-= $array-element-type-id:error2/disp32 -13909 # if t->is-atom? abort -13910 81 7/subop/compare *eax 0/imm32/false # Tree-is-atom -13911 0f 85/jump-if-!= $array-element-type-id:error2/disp32 -13912 # return t->left->value -13913 (lookup *(eax+4) *(eax+8)) # Tree-left Tree-left => eax -13914 8b/-> *(eax+4) 0/r32/eax # Tree-value -13915 $array-element-type-id:end: -13916 # . epilogue -13917 89/<- %esp 5/r32/ebp -13918 5d/pop-to-ebp -13919 c3/return -13920 -13921 $array-element-type-id:error0: -13922 (write-buffered *(ebp+0xc) "array-element-type-id: var '") -13923 50/push-eax -13924 8b/-> *(ebp+8) 0/r32/eax -13925 (lookup *eax *(eax+4)) # Var-name Var-name => eax -13926 (write-buffered *(ebp+0xc) %eax) -13927 58/pop-to-eax -13928 (write-buffered *(ebp+0xc) "' has no type\n") -13929 (flush *(ebp+0xc)) -13930 (stop *(ebp+0x10) 1) -13931 # never gets here -13932 -13933 $array-element-type-id:error1: -13934 (write-buffered *(ebp+0xc) "array-element-type-id: var '") -13935 50/push-eax -13936 8b/-> *(ebp+8) 0/r32/eax -13937 (lookup *eax *(eax+4)) # Var-name Var-name => eax -13938 (write-buffered *(ebp+0xc) %eax) -13939 58/pop-to-eax -13940 (write-buffered *(ebp+0xc) "' has atomic type ") -13941 (write-int32-hex-buffered *(ebp+0xc) *(eax+4)) # Tree-value -13942 (write-buffered *(ebp+0xc) Newline) -13943 (flush *(ebp+0xc)) -13944 (stop *(ebp+0x10) 1) -13945 # never gets here -13946 -13947 $array-element-type-id:error2: -13948 (write-buffered *(ebp+0xc) "array-element-type-id: var '") -13949 50/push-eax -13950 8b/-> *(ebp+8) 0/r32/eax -13951 (lookup *eax *(eax+4)) # Var-name Var-name => eax -13952 (write-buffered *(ebp+0xc) %eax) -13953 58/pop-to-eax -13954 (write-buffered *(ebp+0xc) "' has non-array type\n") -13955 (flush *(ebp+0xc)) -13956 (stop *(ebp+0x10) 1) -13957 # never gets here -13958 -13959 power-of-2?: # n: int, err: (addr buffered-file), ed: (addr exit-descriptor) -> result/eax: boolean -13960 # precondition: n is positive -13961 # . prologue -13962 55/push-ebp -13963 89/<- %ebp 4/r32/esp -13964 # eax = n -13965 8b/-> *(ebp+8) 0/r32/eax -13966 # if (n < 0) abort -13967 3d/compare-eax-with 0/imm32 -13968 0f 8c/jump-if-< $power-of-2?:abort/disp32 -13969 # var tmp/eax: int = n-1 -13970 48/decrement-eax -13971 # var tmp2/eax: int = n & tmp -13972 23/and-> *(ebp+8) 0/r32/eax -13973 # return (tmp2 == 0) -13974 3d/compare-eax-and 0/imm32 -13975 0f 94/set-byte-if-= %al -13976 81 4/subop/and %eax 0xff/imm32 -13977 $power-of-2?:end: -13978 # . epilogue -13979 89/<- %esp 5/r32/ebp -13980 5d/pop-to-ebp -13981 c3/return -13982 -13983 $power-of-2?:abort: -13984 (write-buffered *(ebp+0xc) "power-of-2?: negative number\n") -13985 (flush *(ebp+0xc)) -13986 (stop *(ebp+0x10) 1) -13987 # never gets here -13988 -13989 num-shift-rights: # n: int -> result/eax: int -13990 # precondition: n is a positive power of 2 -13991 # . prologue -13992 55/push-ebp -13993 89/<- %ebp 4/r32/esp -13994 # . save registers -13995 51/push-ecx -13996 # var curr/ecx: int = n -13997 8b/-> *(ebp+8) 1/r32/ecx -13998 # result = 0 -13999 b8/copy-to-eax 0/imm32 -14000 { -14001 # if (curr <= 1) break -14002 81 7/subop/compare %ecx 1/imm32 -14003 7e/jump-if-<= break/disp8 -14004 40/increment-eax -14005 c1/shift 5/subop/arithmetic-right %ecx 1/imm8 -14006 eb/jump loop/disp8 -14007 } -14008 $num-shift-rights:end: -14009 # . restore registers -14010 59/pop-to-ecx -14011 # . epilogue -14012 89/<- %esp 5/r32/ebp -14013 5d/pop-to-ebp -14014 c3/return -14015 -14016 mu-get-offset: # stmt: (addr stmt) -> result/eax: int -14017 # . prologue -14018 55/push-ebp -14019 89/<- %ebp 4/r32/esp -14020 # var second-inout/eax: (addr stmt-var) = stmt->inouts->next -14021 8b/-> *(ebp+8) 0/r32/eax -14022 (lookup *(eax+0xc) *(eax+0x10)) # Stmt1-inouts Stmt1-inouts => eax -14023 (lookup *(eax+8) *(eax+0xc)) # Stmt-var-next Stmt-var-next => eax -14024 # var output-var/eax: (addr var) = second-inout->value -14025 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax -14026 #? (write-buffered Stderr "mu-get-offset: ") -14027 #? (write-int32-hex-buffered Stderr %eax) -14028 #? (write-buffered Stderr " name: ") -14029 #? 50/push-eax -14030 #? (lookup *eax *(eax+4)) # Var-name -14031 #? (write-buffered Stderr %eax) -14032 #? 58/pop-to-eax -14033 #? (write-buffered Stderr Newline) -14034 #? (flush Stderr) -14035 # return output-var->stack-offset -14036 8b/-> *(eax+0x14) 0/r32/eax # Var-offset -14037 #? (write-buffered Stderr "=> ") -14038 #? (write-int32-hex-buffered Stderr %eax) -14039 #? (write-buffered Stderr Newline) -14040 #? (flush Stderr) -14041 $emit-get-offset:end: -14042 # . epilogue -14043 89/<- %esp 5/r32/ebp -14044 5d/pop-to-ebp -14045 c3/return -14046 -14047 emit-subx-block: # out: (addr buffered-file), block: (addr block), vars: (addr stack live-var), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) -14048 # . prologue -14049 55/push-ebp -14050 89/<- %ebp 4/r32/esp -14051 # . save registers -14052 50/push-eax -14053 51/push-ecx -14054 56/push-esi -14055 # esi = block -14056 8b/-> *(ebp+0xc) 6/r32/esi -14057 # block->var->block-depth = *Curr-block-depth -14058 (lookup *(esi+0xc) *(esi+0x10)) # Block-var Block-var => eax -14059 8b/-> *Curr-block-depth 1/r32/ecx -14060 89/<- *(eax+0x10) 1/r32/ecx # Var-block-depth -14061 # var stmts/eax: (addr list stmt) = lookup(block->statements) -14062 (lookup *(esi+4) *(esi+8)) # Block-stmts Block-stmts => eax -14063 # -14064 { -14065 $emit-subx-block:check-empty: -14066 3d/compare-eax-and 0/imm32 -14067 0f 84/jump-if-= break/disp32 -14068 (emit-indent *(ebp+8) *Curr-block-depth) -14069 (write-buffered *(ebp+8) "{\n") -14070 # var v/ecx: (addr var) = lookup(block->var) -14071 (lookup *(esi+0xc) *(esi+0x10)) # Block-var Block-var => eax -14072 89/<- %ecx 0/r32/eax -14073 # -14074 (lookup *ecx *(ecx+4)) # Var-name Var-name => eax -14075 (write-buffered *(ebp+8) %eax) -14076 (write-buffered *(ebp+8) ":loop:\n") -14077 ff 0/subop/increment *Curr-block-depth -14078 (push *(ebp+0x10) *(esi+0xc)) # Block-var -14079 (push *(ebp+0x10) *(esi+0x10)) # Block-var -14080 (push *(ebp+0x10) 0) # false -14081 # emit block->statements -14082 (lookup *(esi+4) *(esi+8)) # Block-stmts Block-stmts => eax -14083 (emit-subx-stmt-list *(ebp+8) %eax *(ebp+0x10) *(ebp+0x14) *(ebp+0x18) *(ebp+0x1c)) -14084 (pop *(ebp+0x10)) # => eax -14085 (pop *(ebp+0x10)) # => eax -14086 (pop *(ebp+0x10)) # => eax -14087 ff 1/subop/decrement *Curr-block-depth -14088 (emit-indent *(ebp+8) *Curr-block-depth) -14089 (write-buffered *(ebp+8) "}\n") -14090 (lookup *ecx *(ecx+4)) # Var-name Var-name => eax -14091 (write-buffered *(ebp+8) %eax) -14092 (write-buffered *(ebp+8) ":break:\n") -14093 } -14094 $emit-subx-block:end: -14095 # . restore registers -14096 5e/pop-to-esi -14097 59/pop-to-ecx -14098 58/pop-to-eax -14099 # . epilogue -14100 89/<- %esp 5/r32/ebp -14101 5d/pop-to-ebp -14102 c3/return -14103 -14104 # Primitives supported -14105 # See mu_instructions for a summary of this linked-list data structure. -14106 # -14107 # For each operation, put variants with hard-coded registers before flexible ones. -14108 # -14109 # Unfortunately, our restrictions on addresses require that various fields in -14110 # primitives be handles, which complicates these definitions. -14111 # - we need to insert dummy fields all over the place for fake alloc-ids -14112 # - we can't use our syntax sugar of quoted literals for string fields -14113 # -14114 # Fake alloc-ids are needed because our type definitions up top require -14115 # handles but it's clearer to statically allocate these long-lived objects. -14116 # Fake alloc-ids are perfectly safe, but they can't be reclaimed. -14117 # -14118 # Every 'object' below starts with a fake alloc-id. It may also contain other -14119 # fake alloc-ids for various handle fields. -14120 # -14121 # I think of objects starting with a fake alloc-id as having type 'payload'. -14122 # It's not really intended to be created dynamically; for that use `allocate` -14123 # as usual. -14124 # -14125 # Idea for a notation to simplify such definitions: -14126 # _Primitive-increment-eax: # (payload primitive) -14127 # 0x11/alloc-id:fake:payload -14128 # 0x11 @(0x11 "increment") # name -14129 # 0 0 # inouts -14130 # 0x11 @(0x11/payload -14131 # 0x11 @(0x11/payload # List-value -14132 # 0 0 # Var-name -14133 # 0x11 @(0x11 # Var-type -14134 # 1/is-atom -14135 # 1/value 0/unused # Tree-left -14136 # 0 0 # Tree-right -14137 # ) -14138 # 1 # block-depth -14139 # 0 # stack-offset -14140 # 0x11 @(0x11 "eax") # Var-register -14141 # ) -14142 # 0 0) # List-next -14143 # ... -14144 # _Primitive-increment-ecx/imm32/next -14145 # ... -14146 # Awfully complex and non-obvious. But also clearly signals there's something -14147 # to learn here, so may be worth trying. -14148 # -14149 # '@' is just an initial thought. Punctuation used so far in Mu: () * % # / " -14150 # -14151 # For now we'll continue to just use comments and manually ensure they stay up -14152 # to date. -14153 == data -14154 Primitives: # (addr primitive) -14155 # - increment/decrement -14156 _Primitive-increment-eax: # (addr primitive) -14157 # var/eax <- increment => 40/increment-eax -14158 0x11/imm32/alloc-id:fake -14159 _string-increment/imm32/name -14160 0/imm32/no-inouts -14161 0/imm32/no-inouts -14162 0x11/imm32/alloc-id:fake -14163 Single-int-var-in-eax/imm32/outputs -14164 0x11/imm32/alloc-id:fake -14165 _string_40_increment_eax/imm32/subx-name -14166 0/imm32/no-rm32 -14167 0/imm32/no-r32 -14168 0/imm32/no-imm32 -14169 0/imm32/no-disp32 -14170 0/imm32/output-is-write-only -14171 0x11/imm32/alloc-id:fake -14172 _Primitive-increment-ecx/imm32/next -14173 _Primitive-increment-ecx: # (payload primitive) -14174 0x11/imm32/alloc-id:fake:payload -14175 # var/ecx <- increment => 41/increment-ecx -14176 0x11/imm32/alloc-id:fake -14177 _string-increment/imm32/name -14178 0/imm32/no-inouts -14179 0/imm32/no-inouts -14180 0x11/imm32/alloc-id:fake -14181 Single-int-var-in-ecx/imm32/outputs -14182 0x11/imm32/alloc-id:fake -14183 _string_41_increment_ecx/imm32/subx-name -14184 0/imm32/no-rm32 -14185 0/imm32/no-r32 -14186 0/imm32/no-imm32 -14187 0/imm32/no-disp32 -14188 0/imm32/output-is-write-only -14189 0x11/imm32/alloc-id:fake -14190 _Primitive-increment-edx/imm32/next -14191 _Primitive-increment-edx: # (payload primitive) -14192 0x11/imm32/alloc-id:fake:payload -14193 # var/edx <- increment => 42/increment-edx -14194 0x11/imm32/alloc-id:fake -14195 _string-increment/imm32/name -14196 0/imm32/no-inouts -14197 0/imm32/no-inouts -14198 0x11/imm32/alloc-id:fake -14199 Single-int-var-in-edx/imm32/outputs -14200 0x11/imm32/alloc-id:fake -14201 _string_42_increment_edx/imm32/subx-name -14202 0/imm32/no-rm32 -14203 0/imm32/no-r32 -14204 0/imm32/no-imm32 -14205 0/imm32/no-disp32 -14206 0/imm32/output-is-write-only -14207 0x11/imm32/alloc-id:fake -14208 _Primitive-increment-ebx/imm32/next -14209 _Primitive-increment-ebx: # (payload primitive) -14210 0x11/imm32/alloc-id:fake:payload -14211 # var/ebx <- increment => 43/increment-ebx -14212 0x11/imm32/alloc-id:fake -14213 _string-increment/imm32/name -14214 0/imm32/no-inouts -14215 0/imm32/no-inouts -14216 0x11/imm32/alloc-id:fake -14217 Single-int-var-in-ebx/imm32/outputs -14218 0x11/imm32/alloc-id:fake -14219 _string_43_increment_ebx/imm32/subx-name -14220 0/imm32/no-rm32 -14221 0/imm32/no-r32 -14222 0/imm32/no-imm32 -14223 0/imm32/no-disp32 -14224 0/imm32/output-is-write-only -14225 0x11/imm32/alloc-id:fake -14226 _Primitive-increment-esi/imm32/next -14227 _Primitive-increment-esi: # (payload primitive) -14228 0x11/imm32/alloc-id:fake:payload -14229 # var/esi <- increment => 46/increment-esi -14230 0x11/imm32/alloc-id:fake -14231 _string-increment/imm32/name -14232 0/imm32/no-inouts -14233 0/imm32/no-inouts -14234 0x11/imm32/alloc-id:fake -14235 Single-int-var-in-esi/imm32/outputs -14236 0x11/imm32/alloc-id:fake -14237 _string_46_increment_esi/imm32/subx-name -14238 0/imm32/no-rm32 -14239 0/imm32/no-r32 -14240 0/imm32/no-imm32 -14241 0/imm32/no-disp32 -14242 0/imm32/output-is-write-only -14243 0x11/imm32/alloc-id:fake -14244 _Primitive-increment-edi/imm32/next -14245 _Primitive-increment-edi: # (payload primitive) -14246 0x11/imm32/alloc-id:fake:payload -14247 # var/edi <- increment => 47/increment-edi -14248 0x11/imm32/alloc-id:fake -14249 _string-increment/imm32/name -14250 0/imm32/no-inouts -14251 0/imm32/no-inouts -14252 0x11/imm32/alloc-id:fake -14253 Single-int-var-in-edi/imm32/outputs -14254 0x11/imm32/alloc-id:fake -14255 _string_47_increment_edi/imm32/subx-name -14256 0/imm32/no-rm32 -14257 0/imm32/no-r32 -14258 0/imm32/no-imm32 -14259 0/imm32/no-disp32 -14260 0/imm32/output-is-write-only -14261 0x11/imm32/alloc-id:fake -14262 _Primitive-decrement-eax/imm32/next -14263 _Primitive-decrement-eax: # (payload primitive) -14264 0x11/imm32/alloc-id:fake:payload -14265 # var/eax <- decrement => 48/decrement-eax -14266 0x11/imm32/alloc-id:fake -14267 _string-decrement/imm32/name -14268 0/imm32/no-inouts -14269 0/imm32/no-inouts -14270 0x11/imm32/alloc-id:fake -14271 Single-int-var-in-eax/imm32/outputs -14272 0x11/imm32/alloc-id:fake -14273 _string_48_decrement_eax/imm32/subx-name -14274 0/imm32/no-rm32 -14275 0/imm32/no-r32 -14276 0/imm32/no-imm32 -14277 0/imm32/no-disp32 -14278 0/imm32/output-is-write-only -14279 0x11/imm32/alloc-id:fake -14280 _Primitive-decrement-ecx/imm32/next -14281 _Primitive-decrement-ecx: # (payload primitive) -14282 0x11/imm32/alloc-id:fake:payload -14283 # var/ecx <- decrement => 49/decrement-ecx -14284 0x11/imm32/alloc-id:fake -14285 _string-decrement/imm32/name -14286 0/imm32/no-inouts -14287 0/imm32/no-inouts -14288 0x11/imm32/alloc-id:fake -14289 Single-int-var-in-ecx/imm32/outputs -14290 0x11/imm32/alloc-id:fake -14291 _string_49_decrement_ecx/imm32/subx-name -14292 0/imm32/no-rm32 -14293 0/imm32/no-r32 -14294 0/imm32/no-imm32 -14295 0/imm32/no-disp32 -14296 0/imm32/output-is-write-only -14297 0x11/imm32/alloc-id:fake -14298 _Primitive-decrement-edx/imm32/next -14299 _Primitive-decrement-edx: # (payload primitive) -14300 0x11/imm32/alloc-id:fake:payload -14301 # var/edx <- decrement => 4a/decrement-edx -14302 0x11/imm32/alloc-id:fake -14303 _string-decrement/imm32/name -14304 0/imm32/no-inouts -14305 0/imm32/no-inouts -14306 0x11/imm32/alloc-id:fake -14307 Single-int-var-in-edx/imm32/outputs -14308 0x11/imm32/alloc-id:fake -14309 _string_4a_decrement_edx/imm32/subx-name -14310 0/imm32/no-rm32 -14311 0/imm32/no-r32 -14312 0/imm32/no-imm32 -14313 0/imm32/no-disp32 -14314 0/imm32/output-is-write-only -14315 0x11/imm32/alloc-id:fake -14316 _Primitive-decrement-ebx/imm32/next -14317 _Primitive-decrement-ebx: # (payload primitive) -14318 0x11/imm32/alloc-id:fake:payload -14319 # var/ebx <- decrement => 4b/decrement-ebx -14320 0x11/imm32/alloc-id:fake -14321 _string-decrement/imm32/name -14322 0/imm32/no-inouts -14323 0/imm32/no-inouts -14324 0x11/imm32/alloc-id:fake -14325 Single-int-var-in-ebx/imm32/outputs -14326 0x11/imm32/alloc-id:fake -14327 _string_4b_decrement_ebx/imm32/subx-name -14328 0/imm32/no-rm32 -14329 0/imm32/no-r32 -14330 0/imm32/no-imm32 -14331 0/imm32/no-disp32 -14332 0/imm32/output-is-write-only -14333 0x11/imm32/alloc-id:fake -14334 _Primitive-decrement-esi/imm32/next -14335 _Primitive-decrement-esi: # (payload primitive) -14336 0x11/imm32/alloc-id:fake:payload -14337 # var/esi <- decrement => 4e/decrement-esi -14338 0x11/imm32/alloc-id:fake -14339 _string-decrement/imm32/name -14340 0/imm32/no-inouts -14341 0/imm32/no-inouts -14342 0x11/imm32/alloc-id:fake -14343 Single-int-var-in-esi/imm32/outputs -14344 0x11/imm32/alloc-id:fake -14345 _string_4e_decrement_esi/imm32/subx-name -14346 0/imm32/no-rm32 -14347 0/imm32/no-r32 -14348 0/imm32/no-imm32 -14349 0/imm32/no-disp32 -14350 0/imm32/output-is-write-only -14351 0x11/imm32/alloc-id:fake -14352 _Primitive-decrement-edi/imm32/next -14353 _Primitive-decrement-edi: # (payload primitive) -14354 0x11/imm32/alloc-id:fake:payload -14355 # var/edi <- decrement => 4f/decrement-edi -14356 0x11/imm32/alloc-id:fake -14357 _string-decrement/imm32/name -14358 0/imm32/no-inouts -14359 0/imm32/no-inouts -14360 0x11/imm32/alloc-id:fake -14361 Single-int-var-in-edi/imm32/outputs -14362 0x11/imm32/alloc-id:fake -14363 _string_4f_decrement_edi/imm32/subx-name -14364 0/imm32/no-rm32 -14365 0/imm32/no-r32 -14366 0/imm32/no-imm32 -14367 0/imm32/no-disp32 -14368 0/imm32/output-is-write-only -14369 0x11/imm32/alloc-id:fake -14370 _Primitive-increment-mem/imm32/next -14371 _Primitive-increment-mem: # (payload primitive) -14372 0x11/imm32/alloc-id:fake:payload -14373 # increment var => ff 0/subop/increment *(ebp+__) -14374 0x11/imm32/alloc-id:fake -14375 _string-increment/imm32/name -14376 0x11/imm32/alloc-id:fake -14377 Single-int-var-in-mem/imm32/inouts -14378 0/imm32/no-outputs -14379 0/imm32/no-outputs -14380 0x11/imm32/alloc-id:fake -14381 _string_ff_subop_increment/imm32/subx-name -14382 1/imm32/rm32-is-first-inout -14383 0/imm32/no-r32 -14384 0/imm32/no-imm32 -14385 0/imm32/no-disp32 -14386 0/imm32/output-is-write-only -14387 0x11/imm32/alloc-id:fake -14388 _Primitive-increment-reg/imm32/next -14389 _Primitive-increment-reg: # (payload primitive) -14390 0x11/imm32/alloc-id:fake:payload -14391 # var/reg <- increment => ff 0/subop/increment %__ -14392 0x11/imm32/alloc-id:fake -14393 _string-increment/imm32/name -14394 0/imm32/no-inouts -14395 0/imm32/no-inouts -14396 0x11/imm32/alloc-id:fake -14397 Single-int-var-in-some-register/imm32/outputs -14398 0x11/imm32/alloc-id:fake -14399 _string_ff_subop_increment/imm32/subx-name -14400 3/imm32/rm32-is-first-output -14401 0/imm32/no-r32 -14402 0/imm32/no-imm32 -14403 0/imm32/no-disp32 -14404 0/imm32/output-is-write-only -14405 0x11/imm32/alloc-id:fake -14406 _Primitive-decrement-mem/imm32/next -14407 _Primitive-decrement-mem: # (payload primitive) -14408 0x11/imm32/alloc-id:fake:payload -14409 # decrement var => ff 1/subop/decrement *(ebp+__) -14410 0x11/imm32/alloc-id:fake -14411 _string-decrement/imm32/name -14412 0x11/imm32/alloc-id:fake -14413 Single-int-var-in-mem/imm32/inouts -14414 0/imm32/no-outputs -14415 0/imm32/no-outputs -14416 0x11/imm32/alloc-id:fake -14417 _string_ff_subop_decrement/imm32/subx-name -14418 1/imm32/rm32-is-first-inout -14419 0/imm32/no-r32 -14420 0/imm32/no-imm32 -14421 0/imm32/no-disp32 -14422 0/imm32/output-is-write-only -14423 0x11/imm32/alloc-id:fake -14424 _Primitive-decrement-reg/imm32/next -14425 _Primitive-decrement-reg: # (payload primitive) -14426 0x11/imm32/alloc-id:fake:payload -14427 # var/reg <- decrement => ff 1/subop/decrement %__ -14428 0x11/imm32/alloc-id:fake -14429 _string-decrement/imm32/name -14430 0/imm32/no-inouts -14431 0/imm32/no-inouts -14432 0x11/imm32/alloc-id:fake -14433 Single-int-var-in-some-register/imm32/outputs -14434 0x11/imm32/alloc-id:fake -14435 _string_ff_subop_decrement/imm32/subx-name -14436 3/imm32/rm32-is-first-output -14437 0/imm32/no-r32 -14438 0/imm32/no-imm32 -14439 0/imm32/no-disp32 -14440 0/imm32/output-is-write-only -14441 0x11/imm32/alloc-id:fake -14442 _Primitive-add-to-eax/imm32/next -14443 # - add -14444 _Primitive-add-to-eax: # (payload primitive) -14445 0x11/imm32/alloc-id:fake:payload -14446 # var/eax <- add lit => 05/add-to-eax lit/imm32 -14447 0x11/imm32/alloc-id:fake -14448 _string-add/imm32/name -14449 0x11/imm32/alloc-id:fake -14450 Single-lit-var/imm32/inouts -14451 0x11/imm32/alloc-id:fake -14452 Single-int-var-in-eax/imm32/outputs -14453 0x11/imm32/alloc-id:fake -14454 _string_05_add_to_eax/imm32/subx-name -14455 0/imm32/no-rm32 -14456 0/imm32/no-r32 -14457 1/imm32/imm32-is-first-inout -14458 0/imm32/no-disp32 -14459 0/imm32/output-is-write-only -14460 0x11/imm32/alloc-id:fake -14461 _Primitive-add-reg-to-reg/imm32/next -14462 _Primitive-add-reg-to-reg: # (payload primitive) -14463 0x11/imm32/alloc-id:fake:payload -14464 # var1/reg <- add var2/reg => 01/add-to var1/rm32 var2/r32 -14465 0x11/imm32/alloc-id:fake -14466 _string-add/imm32/name -14467 0x11/imm32/alloc-id:fake -14468 Single-int-var-in-some-register/imm32/inouts -14469 0x11/imm32/alloc-id:fake -14470 Single-int-var-in-some-register/imm32/outputs -14471 0x11/imm32/alloc-id:fake -14472 _string_01_add_to/imm32/subx-name -14473 3/imm32/rm32-is-first-output -14474 1/imm32/r32-is-first-inout -14475 0/imm32/no-imm32 -14476 0/imm32/no-disp32 -14477 0/imm32/output-is-write-only -14478 0x11/imm32/alloc-id:fake -14479 _Primitive-add-reg-to-mem/imm32/next -14480 _Primitive-add-reg-to-mem: # (payload primitive) -14481 0x11/imm32/alloc-id:fake:payload -14482 # add-to var1 var2/reg => 01/add-to var1 var2/r32 -14483 0x11/imm32/alloc-id:fake -14484 _string-add-to/imm32/name -14485 0x11/imm32/alloc-id:fake -14486 Two-args-int-stack-int-reg/imm32/inouts -14487 0/imm32/no-outputs -14488 0/imm32/no-outputs -14489 0x11/imm32/alloc-id:fake -14490 _string_01_add_to/imm32/subx-name -14491 1/imm32/rm32-is-first-inout -14492 2/imm32/r32-is-second-inout -14493 0/imm32/no-imm32 -14494 0/imm32/no-disp32 -14495 0/imm32/output-is-write-only -14496 0x11/imm32/alloc-id:fake -14497 _Primitive-add-mem-to-reg/imm32/next -14498 _Primitive-add-mem-to-reg: # (payload primitive) -14499 0x11/imm32/alloc-id:fake:payload -14500 # var1/reg <- add var2 => 03/add var2/rm32 var1/r32 +13549 (translate-mu-compute-index-stmt *(ebp+8) *(ebp+0xc) *(ebp+0x14) *(ebp+0x18)) +13550 e9/jump $emit-subx-stmt:end/disp32 +13551 } +13552 # get field from record +13553 { +13554 # if (!string-equal?(stmt->operation, "get")) break +13555 (string-equal? %ecx "get") # => eax +13556 3d/compare-eax-and 0/imm32 +13557 0f 84/jump-if-= break/disp32 +13558 (translate-mu-get-stmt *(ebp+8) *(ebp+0xc)) +13559 e9/jump $emit-subx-stmt:end/disp32 +13560 } +13561 # - if stmt matches a primitive, emit it +13562 { +13563 $emit-subx-stmt:check-for-primitive: +13564 # var curr/eax: (addr primitive) +13565 (find-matching-primitive *(ebp+0x10) *(ebp+0xc)) # primitives, stmt => eax +13566 3d/compare-eax-and 0/imm32 +13567 74/jump-if-= break/disp8 +13568 $emit-subx-stmt:primitive: +13569 (emit-subx-primitive *(ebp+8) *(ebp+0xc) %eax) # out, stmt, curr +13570 e9/jump $emit-subx-stmt:end/disp32 +13571 } +13572 # - otherwise emit a call +13573 # TODO: type-checking +13574 $emit-subx-stmt:call: +13575 (emit-call *(ebp+8) *(ebp+0xc)) +13576 $emit-subx-stmt:end: +13577 # . restore registers +13578 59/pop-to-ecx +13579 58/pop-to-eax +13580 # . epilogue +13581 89/<- %esp 5/r32/ebp +13582 5d/pop-to-ebp +13583 c3/return +13584 +13585 translate-mu-length-stmt: # out: (addr buffered-file), stmt: (addr stmt), err: (addr buffered-file), ed: (addr exit-descriptor) +13586 # . prologue +13587 55/push-ebp +13588 89/<- %ebp 4/r32/esp +13589 # . save registers +13590 50/push-eax +13591 51/push-ecx +13592 52/push-edx +13593 53/push-ebx +13594 56/push-esi +13595 # esi = stmt +13596 8b/-> *(ebp+0xc) 6/r32/esi +13597 # var base/ebx: (addr var) = stmt->inouts[0]->value +13598 (lookup *(esi+0xc) *(esi+0x10)) # Stmt1-inouts Stmt1-inouts => eax +13599 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax +13600 89/<- %ebx 0/r32/eax +13601 # var elemsize/ecx: int = array-element-size(base) +13602 (array-element-size %ebx *(ebp+0x10) *(ebp+0x14)) # => eax +13603 89/<- %ecx 0/r32/eax +13604 # var outreg/edx: (addr array byte) = stmt->outputs[0]->value->register +13605 (lookup *(esi+0x14) *(esi+0x18)) # Stmt1-outputs Stmt1-outputs => eax +13606 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax +13607 (lookup *(eax+0x18) *(eax+0x1c)) # Var-register Var-register => eax +13608 89/<- %edx 0/r32/eax +13609 # if elemsize == 1 +13610 { +13611 81 7/subop/compare %ecx 1/imm32 +13612 75/jump-if-!= break/disp8 +13613 $translate-mu-length-stmt:size-1: +13614 (emit-save-size-to *(ebp+8) %ebx %edx) +13615 e9/jump $translate-mu-length-stmt:end/disp32 +13616 } +13617 # if elemsize is a power of 2 less than 256 +13618 { +13619 (power-of-2? %ecx *(ebp+0x10) *(ebp+0x14)) # => eax +13620 3d/compare-eax-and 0/imm32/false +13621 74/jump-if-= break/disp8 +13622 81 7/subop/compare %ecx 0xff/imm32 +13623 7f/jump-if-> break/disp8 +13624 $translate-mu-length-stmt:size-power-of-2: +13625 (emit-save-size-to *(ebp+8) %ebx %edx) +13626 (emit-divide-by-shift-right *(ebp+8) %edx %ecx) +13627 e9/jump $translate-mu-length-stmt:end/disp32 +13628 } +13629 # otherwise, the complex case +13630 # . emit register spills +13631 { +13632 $translate-mu-length-stmt:complex: +13633 (string-equal? %edx "eax") # => eax +13634 3d/compare-eax-and 0/imm32/false +13635 75/break-if-!= break/disp8 +13636 (emit-indent *(ebp+8) *Curr-block-depth) +13637 (write-buffered *(ebp+8) "50/push-eax\n") +13638 } +13639 { +13640 (string-equal? %edx "ecx") # => eax +13641 3d/compare-eax-and 0/imm32/false +13642 75/break-if-!= break/disp8 +13643 (emit-indent *(ebp+8) *Curr-block-depth) +13644 (write-buffered *(ebp+8) "51/push-ecx\n") +13645 } +13646 { +13647 (string-equal? %edx "edx") # => eax +13648 3d/compare-eax-and 0/imm32/false +13649 75/break-if-!= break/disp8 +13650 (emit-indent *(ebp+8) *Curr-block-depth) +13651 (write-buffered *(ebp+8) "52/push-edx\n") +13652 } +13653 # . +13654 (emit-save-size-to *(ebp+8) %ebx "eax") +13655 (emit-indent *(ebp+8) *Curr-block-depth) +13656 (write-buffered *(ebp+8) "31/xor %edx 2/r32/edx\n") +13657 (emit-indent *(ebp+8) *Curr-block-depth) +13658 (write-buffered *(ebp+8) "b9/copy-to-ecx ") +13659 (write-int32-hex-buffered *(ebp+8) %ecx) +13660 (write-buffered *(ebp+8) "/imm32\n") +13661 (emit-indent *(ebp+8) *Curr-block-depth) +13662 (write-buffered *(ebp+8) "f7 7/subop/idiv-eax-edx-by %ecx\n") +13663 { +13664 (string-equal? %edx "eax") # => eax +13665 3d/compare-eax-and 0/imm32/false +13666 75/break-if-!= break/disp8 +13667 (emit-indent *(ebp+8) *Curr-block-depth) +13668 (write-buffered *(ebp+8) "89/<- %") +13669 (write-buffered *(ebp+8) %edx) +13670 (write-buffered *(ebp+8) " 0/r32/eax\n") +13671 } +13672 # . emit register restores +13673 { +13674 (string-equal? %edx "edx") # => eax +13675 3d/compare-eax-and 0/imm32/false +13676 75/break-if-!= break/disp8 +13677 (emit-indent *(ebp+8) *Curr-block-depth) +13678 (write-buffered *(ebp+8) "5a/pop-to-edx\n") +13679 } +13680 { +13681 (string-equal? %edx "ecx") # => eax +13682 3d/compare-eax-and 0/imm32/false +13683 75/break-if-!= break/disp8 +13684 (emit-indent *(ebp+8) *Curr-block-depth) +13685 (write-buffered *(ebp+8) "59/pop-to-ecx\n") +13686 } +13687 { +13688 (string-equal? %edx "eax") # => eax +13689 3d/compare-eax-and 0/imm32/false +13690 75/break-if-!= break/disp8 +13691 (emit-indent *(ebp+8) *Curr-block-depth) +13692 (write-buffered *(ebp+8) "58/pop-to-eax\n") +13693 } +13694 $translate-mu-length-stmt:end: +13695 # . restore registers +13696 5e/pop-to-esi +13697 5b/pop-to-ebx +13698 5a/pop-to-edx +13699 59/pop-to-ecx +13700 58/pop-to-eax +13701 # . epilogue +13702 89/<- %esp 5/r32/ebp +13703 5d/pop-to-ebp +13704 c3/return +13705 +13706 array-element-size: # arr: (addr var), err: (addr buffered-file), ed: (addr exit-descriptor) -> result/eax: int +13707 # . prologue +13708 55/push-ebp +13709 89/<- %ebp 4/r32/esp +13710 # +13711 (array-element-type-id *(ebp+8) *(ebp+0xc) *(ebp+0x10)) # => eax +13712 (size-of-type-id-as-array-element %eax) # => eax +13713 $array-element-size:end: +13714 # . epilogue +13715 89/<- %esp 5/r32/ebp +13716 5d/pop-to-ebp +13717 c3/return +13718 +13719 size-of-type-id-as-array-element: # t: type-id -> result/eax: int +13720 # . prologue +13721 55/push-ebp +13722 89/<- %ebp 4/r32/esp +13723 # eax = t +13724 8b/-> *(ebp+8) 0/r32/eax +13725 # if t is 'byte', size is 1 +13726 3d/compare-eax-and 8/imm32/byte +13727 { +13728 75/jump-if-!= break/disp8 +13729 b8/copy-to-eax 1/imm32 +13730 eb/jump $array-element-size:end/disp8 +13731 } +13732 # otherwise proceed as usual +13733 (size-of-type-id %eax) # => eax +13734 $size-of-type-id-as-array-element:end: +13735 # . epilogue +13736 89/<- %esp 5/r32/ebp +13737 5d/pop-to-ebp +13738 c3/return +13739 +13740 emit-save-size-to: # out: (addr buffered-file), base: (addr var), outreg: (addr array byte) +13741 # . prologue +13742 55/push-ebp +13743 89/<- %ebp 4/r32/esp +13744 # . save registers +13745 50/push-eax +13746 53/push-ebx +13747 # ebx = base +13748 8b/-> *(ebp+0xc) 3/r32/ebx +13749 (emit-indent *(ebp+8) *Curr-block-depth) +13750 (write-buffered *(ebp+8) "8b/-> *") +13751 # if base is an (addr array ...) in a register +13752 { +13753 81 7/subop/compare *(ebx+0x18)) 0/imm32 # Var-register +13754 74/jump-if-= break/disp8 +13755 $emit-save-size-to:emit-base-from-register: +13756 (lookup *(ebx+0x18) *(ebx+0x1c)) # Var-register Var-register => eax +13757 (write-buffered *(ebp+8) %eax) +13758 eb/jump $emit-save-size-to:emit-output/disp8 +13759 } +13760 # otherwise if base is an (array ...) on the stack +13761 { +13762 81 7/subop/compare *(ebx+0x14)) 0/imm32 # Var-offset +13763 74/jump-if-= break/disp8 +13764 $emit-save-size-to:emit-base-from-stack: +13765 (write-buffered *(ebp+8) "(ebp+") +13766 (write-int32-hex-buffered *(ebp+8) *(ebx+0x14)) # Var-offset +13767 (write-buffered *(ebp+8) ")") +13768 } +13769 $emit-save-size-to:emit-output: +13770 (write-buffered *(ebp+8) " ") +13771 (get Mu-registers *(ebp+0x10) 0xc "Mu-registers") # => eax +13772 (write-int32-hex-buffered *(ebp+8) *eax) +13773 (write-buffered *(ebp+8) "/r32\n") +13774 $emit-save-size-to:end: +13775 # . restore registers +13776 5b/pop-to-ebx +13777 58/pop-to-eax +13778 # . epilogue +13779 89/<- %esp 5/r32/ebp +13780 5d/pop-to-ebp +13781 c3/return +13782 +13783 emit-divide-by-shift-right: # out: (addr buffered-file), reg: (addr array byte), size: int +13784 # . prologue +13785 55/push-ebp +13786 89/<- %ebp 4/r32/esp +13787 # . save registers +13788 50/push-eax +13789 # +13790 (emit-indent *(ebp+8) *Curr-block-depth) +13791 (write-buffered *(ebp+8) "c1/shift 5/subop/>> %") +13792 (write-buffered *(ebp+8) *(ebp+0xc)) +13793 (write-buffered *(ebp+8) Space) +13794 (num-shift-rights *(ebp+0x10)) # => eax +13795 (write-int32-hex-buffered *(ebp+8) %eax) +13796 (write-buffered *(ebp+8) "/imm8\n") +13797 $emit-divide-by-shift-right:end: +13798 # . restore registers +13799 58/pop-to-eax +13800 # . epilogue +13801 89/<- %esp 5/r32/ebp +13802 5d/pop-to-ebp +13803 c3/return +13804 +13805 translate-mu-index-stmt: # out: (addr buffered-file), stmt: (addr stmt), err: (addr buffered-file), ed: (addr exit-descriptor) +13806 # . prologue +13807 55/push-ebp +13808 89/<- %ebp 4/r32/esp +13809 # . save registers +13810 51/push-ecx +13811 # ecx = stmt +13812 8b/-> *(ebp+0xc) 1/r32/ecx +13813 # var base/ecx: (addr var) = stmt->inouts[0] +13814 (lookup *(ecx+0xc) *(ecx+0x10)) # Stmt1-inouts Stmt1-inouts => eax +13815 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax +13816 89/<- %ecx 0/r32/eax +13817 # if (var->register) do one thing +13818 { +13819 81 7/subop/compare *(ecx+0x18) 0/imm32 # Var-register +13820 74/jump-if-= break/disp8 +13821 # TODO: ensure there's no dereference +13822 (translate-mu-index-stmt-with-array-in-register *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) +13823 eb/jump $translate-mu-index-stmt:end/disp8 +13824 } +13825 # if (var->offset) do a different thing +13826 { +13827 81 7/subop/compare *(ecx+0x14) 0/imm32 # Var-offset +13828 74/jump-if-= break/disp8 +13829 # TODO: ensure there's no dereference +13830 (translate-mu-index-stmt-with-array-on-stack *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14)) +13831 eb/jump $translate-mu-index-stmt:end/disp8 +13832 } +13833 $translate-mu-index-stmt:end: +13834 # . restore registers +13835 59/pop-to-ecx +13836 # . epilogue +13837 89/<- %esp 5/r32/ebp +13838 5d/pop-to-ebp +13839 c3/return +13840 +13841 $translate-mu-index-stmt-with-array:error1: +13842 (write-buffered *(ebp+0x10) "couldn't translate an index instruction. second (index) input must either lie in a register or be a literal\n") +13843 (flush *(ebp+0x10)) +13844 (stop *(ebp+0x14) 1) +13845 # never gets here +13846 +13847 $translate-mu-index-stmt-with-array:error2: +13848 (write-buffered *(ebp+0x10) "couldn't translate an index instruction. second (index) input when in a register must be an int or offset\n") +13849 (flush *(ebp+0x10)) +13850 (stop *(ebp+0x14) 1) +13851 # never gets here +13852 +13853 translate-mu-index-stmt-with-array-in-register: # out: (addr buffered-file), stmt: (addr stmt), err: (addr buffered-file), ed: (addr exit-descriptor) +13854 # . prologue +13855 55/push-ebp +13856 89/<- %ebp 4/r32/esp +13857 # . save registers +13858 50/push-eax +13859 51/push-ecx +13860 52/push-edx +13861 53/push-ebx +13862 # +13863 (emit-indent *(ebp+8) *Curr-block-depth) +13864 (write-buffered *(ebp+8) "8d/copy-address *(") +13865 # TODO: ensure inouts[0] is in a register and not dereferenced +13866 $translate-mu-index-stmt-with-array-in-register:emit-base: +13867 # ecx = stmt +13868 8b/-> *(ebp+0xc) 1/r32/ecx +13869 # var base/ebx: (addr var) = inouts[0] +13870 (lookup *(ecx+0xc) *(ecx+0x10)) # Stmt1-inouts Stmt1-inouts => eax +13871 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax +13872 89/<- %ebx 0/r32/eax +13873 # print base->register " + " +13874 (lookup *(ebx+0x18) *(ebx+0x1c)) # Var-register Var-register => eax +13875 (write-buffered *(ebp+8) %eax) +13876 (write-buffered *(ebp+8) " + ") +13877 # var index/edx: (addr var) = inouts[1] +13878 (lookup *(ecx+0xc) *(ecx+0x10)) # Stmt1-inouts Stmt1-inouts => eax +13879 (lookup *(eax+8) *(eax+0xc)) # Stmt-var-next Stmt-var-next => eax +13880 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax +13881 89/<- %edx 0/r32/eax +13882 # if index->register +13883 81 7/subop/compare *(edx+0x18) 0/imm32 # Var-register +13884 { +13885 0f 84/jump-if-= break/disp32 +13886 $translate-mu-index-stmt-with-array-in-register:emit-register-index: +13887 # if index is an int +13888 (lookup *(edx+8) *(edx+0xc)) # Var-type Var-type => eax +13889 (is-simple-mu-type? %eax 1) # int => eax +13890 3d/compare-eax-and 0/imm32/false +13891 { +13892 0f 84/jump-if-= break/disp32 +13893 $translate-mu-index-stmt-with-array-in-register:emit-int-register-index: +13894 # print index->register "<<" log2(array-element-size(base)) " + 4) " +13895 # . index->register "<<" +13896 (lookup *(edx+0x18) *(edx+0x1c)) # Var-register Var-register => eax +13897 (write-buffered *(ebp+8) %eax) +13898 (write-buffered *(ebp+8) "<<") +13899 # . log2(array-element-size(base->type)) +13900 # TODO: ensure size is a power of 2 +13901 (array-element-size %ebx *(ebp+0x10) *(ebp+0x14)) # => eax +13902 (num-shift-rights %eax) # => eax +13903 (write-int32-hex-buffered *(ebp+8) %eax) +13904 e9/jump $translate-mu-index-stmt-with-array-in-register:emit-register-index-done/disp32 +13905 } +13906 # if index->type is any other atom, abort +13907 (lookup *(edx+8) *(edx+0xc)) # Var-type Var-type => eax +13908 81 7/subop/compare *eax 0/imm32/false # Type-tree-is-atom +13909 0f 85/jump-if-!= $translate-mu-index-stmt-with-array:error2/disp32 +13910 # if index has type (offset ...) +13911 (lookup *(eax+4) *(eax+8)) # Type-tree-left Type-tree-left => eax +13912 (is-simple-mu-type? %eax 7) # => eax +13913 3d/compare-eax-and 0/imm32/false +13914 { +13915 0f 84/jump-if-= break/disp32 +13916 # print index->register +13917 $translate-mu-index-stmt-with-array-in-register:emit-offset-register-index: +13918 (lookup *(edx+0x18) *(edx+0x1c)) # Var-register Var-register => eax +13919 (write-buffered *(ebp+8) %eax) +13920 } +13921 $translate-mu-index-stmt-with-array-in-register:emit-register-index-done: +13922 (write-buffered *(ebp+8) " + 4) ") +13923 e9/jump $translate-mu-index-stmt-with-array-in-register:emit-output/disp32 +13924 } +13925 # otherwise if index is a literal +13926 (lookup *(edx+8) *(edx+0xc)) # Var-type Var-type => eax +13927 (is-simple-mu-type? %eax 0) # => eax +13928 3d/compare-eax-and 0/imm32/false +13929 { +13930 0f 84/jump-if-= break/disp32 +13931 $translate-mu-index-stmt-with-array-in-register:emit-literal-index: +13932 # var index-value/edx: int = parse-hex-int(index->name) +13933 (lookup *edx *(edx+4)) # Var-name Var-name => eax +13934 (parse-hex-int %eax) # => eax +13935 89/<- %edx 0/r32/eax +13936 # offset = idx-value * array-element-size(base->type) +13937 (array-element-size %ebx *(ebp+0x10) *(ebp+0x14)) # => eax +13938 f7 4/subop/multiply-into-eax %edx # clobbers edx +13939 # offset += 4 for array size +13940 05/add-to-eax 4/imm32 +13941 # TODO: check edx for overflow +13942 # print offset +13943 (write-int32-hex-buffered *(ebp+8) %eax) +13944 (write-buffered *(ebp+8) ") ") +13945 e9/jump $translate-mu-index-stmt-with-array-in-register:emit-output/disp32 +13946 } +13947 # otherwise abort +13948 e9/jump $translate-mu-index-stmt-with-array:error1/disp32 +13949 $translate-mu-index-stmt-with-array-in-register:emit-output: +13950 # outputs[0] "/r32" +13951 8b/-> *(ebp+0xc) 1/r32/ecx +13952 (lookup *(ecx+0x14) *(ecx+0x18)) # Stmt1-outputs Stmt1-outputs => eax +13953 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax +13954 (lookup *(eax+0x18) *(eax+0x1c)) # Var-register Var-register => eax +13955 (get Mu-registers %eax 0xc "Mu-registers") # => eax: (addr int) +13956 (write-int32-hex-buffered *(ebp+8) *eax) +13957 (write-buffered *(ebp+8) "/r32\n") +13958 $translate-mu-index-stmt-with-array-in-register:end: +13959 # . restore registers +13960 5b/pop-to-ebx +13961 5a/pop-to-edx +13962 59/pop-to-ecx +13963 58/pop-to-eax +13964 # . epilogue +13965 89/<- %esp 5/r32/ebp +13966 5d/pop-to-ebp +13967 c3/return +13968 +13969 translate-mu-index-stmt-with-array-on-stack: # out: (addr buffered-file), stmt: (addr stmt), err: (addr buffered-file), ed: (addr exit-descriptor) +13970 # . prologue +13971 55/push-ebp +13972 89/<- %ebp 4/r32/esp +13973 # . save registers +13974 50/push-eax +13975 51/push-ecx +13976 52/push-edx +13977 53/push-ebx +13978 # +13979 (emit-indent *(ebp+8) *Curr-block-depth) +13980 (write-buffered *(ebp+8) "8d/copy-address *(ebp + ") +13981 # var curr/edx: (addr stmt-var) = lookup(stmt->inouts) +13982 8b/-> *(ebp+0xc) 0/r32/eax +13983 (lookup *(eax+0xc) *(eax+0x10)) # Stmt1-inouts Stmt1-inouts => eax +13984 89/<- %edx 0/r32/eax +13985 # var base/ecx: (addr var) = lookup(curr->value) +13986 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax +13987 89/<- %ecx 0/r32/eax +13988 # var curr2/eax: (addr stmt-var) = lookup(curr->next) +13989 (lookup *(edx+8) *(edx+0xc)) # Stmt-var-next Stmt-var-next => eax +13990 # var index/edx: (handle var) = curr2->value +13991 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax +13992 89/<- %edx 0/r32/eax +13993 # if index->register +13994 81 7/subop/compare *(edx+0x18) 0/imm32 # Var-register +13995 { +13996 0f 84/jump-if-= break/disp32 +13997 $translate-mu-index-stmt-with-array-on-stack:emit-register-index: +13998 # if index is an int +13999 (lookup *(edx+8) *(edx+0xc)) # Var-type Var-type => eax +14000 (is-simple-mu-type? %eax 1) # int => eax +14001 3d/compare-eax-and 0/imm32/false +14002 { +14003 0f 84/jump-if-= break/disp32 +14004 $translate-mu-index-stmt-with-array-on-stack:emit-int-register-index: +14005 # print index->register "<<" log2(array-element-size(base)) " + " base->offset+4 +14006 # . inouts[1]->register "<<" +14007 (lookup *(edx+0x18) *(edx+0x1c)) # Var-register Var-register => eax +14008 (write-buffered *(ebp+8) %eax) +14009 (write-buffered *(ebp+8) "<<") +14010 # . log2(array-element-size(base)) +14011 # TODO: ensure size is a power of 2 +14012 (array-element-size %ecx *(ebp+0x10) *(ebp+0x14)) # => eax +14013 (num-shift-rights %eax) # => eax +14014 (write-int32-hex-buffered *(ebp+8) %eax) +14015 # +14016 (write-buffered *(ebp+8) " + ") +14017 # +14018 8b/-> *(ecx+0x14) 0/r32/eax # Var-offset +14019 05/add-to-eax 4/imm32 # for array length +14020 (write-int32-hex-buffered *(ebp+8) %eax) +14021 e9/jump $translate-mu-index-stmt-with-array-on-stack:emit-register-index-done/disp32 +14022 } +14023 # if index->type is any other atom, abort +14024 (lookup *(edx+8) *(edx+0xc)) # Var-type Var-type => eax +14025 81 7/subop/compare *eax 0/imm32/false # Type-tree-is-atom +14026 0f 85/jump-if-!= $translate-mu-index-stmt-with-array:error2/disp32 +14027 # if index has type (offset ...) +14028 (lookup *(eax+4) *(eax+8)) # Type-tree-left Type-tree-left => eax +14029 (is-simple-mu-type? %eax 7) # => eax +14030 3d/compare-eax-and 0/imm32/false +14031 { +14032 0f 84/jump-if-= break/disp32 +14033 # print index->register +14034 $translate-mu-index-stmt-with-array-on-stack:emit-offset-register-index: +14035 (lookup *(edx+0x18) *(edx+0x1c)) # Var-register Var-register => eax +14036 (write-buffered *(ebp+8) %eax) +14037 } +14038 $translate-mu-index-stmt-with-array-on-stack:emit-register-index-done: +14039 (write-buffered *(ebp+8) ") ") +14040 e9/jump $translate-mu-index-stmt-with-array-on-stack:emit-output/disp32 +14041 } +14042 # otherwise if index is a literal +14043 (lookup *(edx+8) *(edx+0xc)) # Var-type Var-type => eax +14044 (is-simple-mu-type? %eax 0) # => eax +14045 3d/compare-eax-and 0/imm32/false +14046 { +14047 0f 84/jump-if-= break/disp32 +14048 $translate-mu-index-stmt-with-array-on-stack:emit-literal-index: +14049 # var idx-value/edx: int = parse-hex-int(index->name) +14050 (lookup *edx *(edx+4)) # Var-name Var-name => eax +14051 (parse-hex-int %eax) # Var-name => eax +14052 89/<- %edx 0/r32/eax +14053 # offset = idx-value * array-element-size(base) +14054 (array-element-size %ecx *(ebp+0x10) *(ebp+0x14)) # => eax +14055 f7 4/subop/multiply-into-eax %edx # clobbers edx +14056 # offset += base->offset +14057 03/add *(ecx+0x14) 0/r32/eax # Var-offset +14058 # offset += 4 for array size +14059 05/add-to-eax 4/imm32 +14060 # TODO: check edx for overflow +14061 # print offset +14062 (write-int32-hex-buffered *(ebp+8) %eax) +14063 (write-buffered *(ebp+8) ") ") +14064 e9/jump $translate-mu-index-stmt-with-array-on-stack:emit-output/disp32 +14065 } +14066 # otherwise abort +14067 e9/jump $translate-mu-index-stmt-with-array:error1/disp32 +14068 $translate-mu-index-stmt-with-array-on-stack:emit-output: +14069 # outputs[0] "/r32" +14070 8b/-> *(ebp+0xc) 0/r32/eax +14071 (lookup *(eax+0x14) *(eax+0x18)) # Stmt1-outputs Stmt1-outputs => eax +14072 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax +14073 (lookup *(eax+0x18) *(eax+0x1c)) # Var-register Var-register => eax +14074 (get Mu-registers %eax 0xc "Mu-registers") # => eax: (addr int) +14075 (write-int32-hex-buffered *(ebp+8) *eax) +14076 (write-buffered *(ebp+8) "/r32\n") +14077 $translate-mu-index-stmt-with-array-on-stack:end: +14078 # . restore registers +14079 5b/pop-to-ebx +14080 5a/pop-to-edx +14081 59/pop-to-ecx +14082 58/pop-to-eax +14083 # . epilogue +14084 89/<- %esp 5/r32/ebp +14085 5d/pop-to-ebp +14086 c3/return +14087 +14088 translate-mu-compute-index-stmt: # out: (addr buffered-file), stmt: (addr stmt), err: (addr buffered-file), ed: (addr exit-descriptor) +14089 # . prologue +14090 55/push-ebp +14091 89/<- %ebp 4/r32/esp +14092 # . save registers +14093 50/push-eax +14094 51/push-ecx +14095 52/push-edx +14096 53/push-ebx +14097 # +14098 (emit-indent *(ebp+8) *Curr-block-depth) +14099 (write-buffered *(ebp+8) "69/multiply") +14100 # ecx = stmt +14101 8b/-> *(ebp+0xc) 1/r32/ecx +14102 # var first-inout/ebx: (addr stmt-var) = stmt->inouts[0] +14103 (lookup *(ecx+0xc) *(ecx+0x10)) # Stmt1-inouts Stmt1-inouts => eax +14104 89/<- %ebx 0/r32/eax +14105 $translate-mu-compute-index-stmt:emit-index: +14106 (lookup *(ebx+8) *(ebx+0xc)) # Stmt-var-next Stmt-var-next => eax +14107 (emit-subx-var-as-rm32 *(ebp+8) %eax) +14108 (write-buffered *(ebp+8) Space) +14109 $translate-mu-compute-index-stmt:emit-elem-size: +14110 # var base/ebx: (addr var) +14111 (lookup *ebx *(ebx+4)) # Stmt-var-value Stmt-var-value => eax +14112 89/<- %ebx 0/r32/eax +14113 # print array-element-size(base) +14114 (array-element-size %ebx *(ebp+0x10) *(ebp+0x14)) # => eax +14115 (write-int32-hex-buffered *(ebp+8) %eax) +14116 (write-buffered *(ebp+8) "/imm32 ") +14117 $translate-mu-compute-index-stmt:emit-output: +14118 # outputs[0] "/r32" +14119 (lookup *(ecx+0x14) *(ecx+0x18)) # Stmt1-outputs Stmt1-outputs => eax +14120 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax +14121 (lookup *(eax+0x18) *(eax+0x1c)) # Var-register Var-register => eax +14122 (get Mu-registers %eax 0xc "Mu-registers") # => eax: (addr int) +14123 (write-int32-hex-buffered *(ebp+8) *eax) +14124 (write-buffered *(ebp+8) "/r32\n") +14125 $translate-mu-compute-index-stmt:end: +14126 # . restore registers +14127 5b/pop-to-ebx +14128 5a/pop-to-edx +14129 59/pop-to-ecx +14130 58/pop-to-eax +14131 # . epilogue +14132 89/<- %esp 5/r32/ebp +14133 5d/pop-to-ebp +14134 c3/return +14135 +14136 translate-mu-get-stmt: # out: (addr buffered-file), stmt: (addr stmt) +14137 # . prologue +14138 55/push-ebp +14139 89/<- %ebp 4/r32/esp +14140 # . save registers +14141 50/push-eax +14142 51/push-ecx +14143 52/push-edx +14144 # +14145 (emit-indent *(ebp+8) *Curr-block-depth) +14146 (write-buffered *(ebp+8) "8d/copy-address ") +14147 # ecx = stmt +14148 8b/-> *(ebp+0xc) 1/r32/ecx +14149 # var offset/edx: int = get offset of stmt +14150 (mu-get-offset %ecx) # => eax +14151 89/<- %edx 0/r32/eax +14152 # var base/eax: (addr var) = stmt->inouts->value +14153 (lookup *(ecx+0xc) *(ecx+0x10)) # Stmt1-inouts Stmt1-inouts => eax +14154 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax +14155 # if base is in a register +14156 81 7/subop/compare *(eax+0x18) 0/imm32 # Var-register +14157 { +14158 0f 84/jump-if-= break/disp32 +14159 $translate-mu-get-stmt:emit-register-input: +14160 # emit "*(" base->register " + " offset ") " +14161 (write-buffered *(ebp+8) "*(") +14162 (lookup *(eax+0x18) *(eax+0x1c)) # Var-register Var-register => eax +14163 (write-buffered *(ebp+8) %eax) +14164 (write-buffered *(ebp+8) " + ") +14165 (write-int32-hex-buffered *(ebp+8) %edx) +14166 (write-buffered *(ebp+8) ") ") +14167 e9/jump $translate-mu-get-stmt:emit-output/disp32 +14168 } +14169 # otherwise base is on the stack +14170 { +14171 $translate-mu-get-stmt:emit-stack-input: +14172 # emit "*(ebp + " inouts[0]->stack-offset + offset ") " +14173 (write-buffered *(ebp+8) "*(ebp+") +14174 03/add *(eax+0x14) 2/r32/edx # Var-offset +14175 (write-int32-hex-buffered *(ebp+8) %edx) +14176 (write-buffered *(ebp+8) ") ") +14177 eb/jump $translate-mu-get-stmt:emit-output/disp8 +14178 } +14179 $translate-mu-get-stmt:emit-output: +14180 # var output/eax: (addr var) = stmt->outputs->value +14181 (lookup *(ecx+0x14) *(ecx+0x18)) # Stmt1-outputs Stmt1-outputs => eax +14182 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax +14183 # emit offset->register "/r32" +14184 (lookup *(eax+0x18) *(eax+0x1c)) # Var-register Var-register => eax +14185 (get Mu-registers %eax 0xc "Mu-registers") # => eax: (addr int) +14186 (write-int32-hex-buffered *(ebp+8) *eax) +14187 (write-buffered *(ebp+8) "/r32\n") +14188 $translate-mu-get-stmt:end: +14189 # . restore registers +14190 5a/pop-to-edx +14191 59/pop-to-ecx +14192 58/pop-to-eax +14193 # . epilogue +14194 89/<- %esp 5/r32/ebp +14195 5d/pop-to-ebp +14196 c3/return +14197 +14198 array-element-type-id: # v: (addr var), err: (addr buffered-file), ed: (addr exit-descriptor) -> result/eax: type-id +14199 # precondition: n is positive +14200 # . prologue +14201 55/push-ebp +14202 89/<- %ebp 4/r32/esp +14203 # +14204 8b/-> *(ebp+8) 0/r32/eax +14205 # var t/eax: (addr type-tree) +14206 (lookup *(eax+8) *(eax+0xc)) # Var-type Var-type => eax +14207 # if t == 0 abort +14208 3d/compare-eax-with 0/imm32 +14209 0f 84/jump-if-== $array-element-type-id:error0/disp32 +14210 # if t->is-atom? abort +14211 81 7/subop/compare *eax 0/imm32/false # Type-tree-is-atom +14212 0f 85/jump-if-!= $array-element-type-id:error1/disp32 +14213 # if (t->left == addr) t = t->right +14214 { +14215 50/push-eax +14216 (lookup *(eax+4) *(eax+8)) # Type-tree-left Type-tree-left => eax +14217 (is-simple-mu-type? %eax 2) # addr => eax +14218 3d/compare-eax-with 0/imm32/false +14219 58/pop-to-eax +14220 74/jump-if-= break/disp8 +14221 $array-element-type-id:skip-addr: +14222 (lookup *(eax+0xc) *(eax+0x10)) # Type-tree-right Type-tree-right => eax +14223 } +14224 # if t == 0 abort +14225 3d/compare-eax-with 0/imm32 +14226 0f 84/jump-if-= $array-element-type-id:error2/disp32 +14227 # if t->is-atom? abort +14228 81 7/subop/compare *eax 0/imm32/false # Type-tree-is-atom +14229 0f 85/jump-if-!= $array-element-type-id:error2/disp32 +14230 # if t->left != array abort +14231 { +14232 50/push-eax +14233 (lookup *(eax+4) *(eax+8)) # Type-tree-left Type-tree-left => eax +14234 (is-simple-mu-type? %eax 3) # array => eax +14235 3d/compare-eax-with 0/imm32/false +14236 58/pop-to-eax +14237 $array-element-type-id:no-array: +14238 0f 84/jump-if-= $array-element-type-id:error2/disp32 +14239 } +14240 $array-element-type-id:skip-array: +14241 # t = t->right +14242 (lookup *(eax+0xc) *(eax+0x10)) # Type-tree-right Type-tree-right => eax +14243 # if t == 0 abort +14244 3d/compare-eax-with 0/imm32 +14245 0f 84/jump-if-= $array-element-type-id:error2/disp32 +14246 # if t->is-atom? abort +14247 81 7/subop/compare *eax 0/imm32/false # Type-tree-is-atom +14248 0f 85/jump-if-!= $array-element-type-id:error2/disp32 +14249 # return t->left->value +14250 (lookup *(eax+4) *(eax+8)) # Type-tree-left Type-tree-left => eax +14251 8b/-> *(eax+4) 0/r32/eax # Type-tree-value +14252 $array-element-type-id:end: +14253 # . epilogue +14254 89/<- %esp 5/r32/ebp +14255 5d/pop-to-ebp +14256 c3/return +14257 +14258 $array-element-type-id:error0: +14259 (write-buffered *(ebp+0xc) "array-element-type-id: var '") +14260 50/push-eax +14261 8b/-> *(ebp+8) 0/r32/eax +14262 (lookup *eax *(eax+4)) # Var-name Var-name => eax +14263 (write-buffered *(ebp+0xc) %eax) +14264 58/pop-to-eax +14265 (write-buffered *(ebp+0xc) "' has no type\n") +14266 (flush *(ebp+0xc)) +14267 (stop *(ebp+0x10) 1) +14268 # never gets here +14269 +14270 $array-element-type-id:error1: +14271 (write-buffered *(ebp+0xc) "array-element-type-id: var '") +14272 50/push-eax +14273 8b/-> *(ebp+8) 0/r32/eax +14274 (lookup *eax *(eax+4)) # Var-name Var-name => eax +14275 (write-buffered *(ebp+0xc) %eax) +14276 58/pop-to-eax +14277 (write-buffered *(ebp+0xc) "' has atomic type ") +14278 (write-int32-hex-buffered *(ebp+0xc) *(eax+4)) # Type-tree-value +14279 (write-buffered *(ebp+0xc) Newline) +14280 (flush *(ebp+0xc)) +14281 (stop *(ebp+0x10) 1) +14282 # never gets here +14283 +14284 $array-element-type-id:error2: +14285 (write-buffered *(ebp+0xc) "array-element-type-id: var '") +14286 50/push-eax +14287 8b/-> *(ebp+8) 0/r32/eax +14288 (lookup *eax *(eax+4)) # Var-name Var-name => eax +14289 (write-buffered *(ebp+0xc) %eax) +14290 58/pop-to-eax +14291 (write-buffered *(ebp+0xc) "' has non-array type\n") +14292 (flush *(ebp+0xc)) +14293 (stop *(ebp+0x10) 1) +14294 # never gets here +14295 +14296 power-of-2?: # n: int, err: (addr buffered-file), ed: (addr exit-descriptor) -> result/eax: boolean +14297 # precondition: n is positive +14298 # . prologue +14299 55/push-ebp +14300 89/<- %ebp 4/r32/esp +14301 # eax = n +14302 8b/-> *(ebp+8) 0/r32/eax +14303 # if (n < 0) abort +14304 3d/compare-eax-with 0/imm32 +14305 0f 8c/jump-if-< $power-of-2?:abort/disp32 +14306 # var tmp/eax: int = n-1 +14307 48/decrement-eax +14308 # var tmp2/eax: int = n & tmp +14309 23/and-> *(ebp+8) 0/r32/eax +14310 # return (tmp2 == 0) +14311 3d/compare-eax-and 0/imm32 +14312 0f 94/set-byte-if-= %al +14313 81 4/subop/and %eax 0xff/imm32 +14314 $power-of-2?:end: +14315 # . epilogue +14316 89/<- %esp 5/r32/ebp +14317 5d/pop-to-ebp +14318 c3/return +14319 +14320 $power-of-2?:abort: +14321 (write-buffered *(ebp+0xc) "power-of-2?: negative number\n") +14322 (flush *(ebp+0xc)) +14323 (stop *(ebp+0x10) 1) +14324 # never gets here +14325 +14326 num-shift-rights: # n: int -> result/eax: int +14327 # precondition: n is a positive power of 2 +14328 # . prologue +14329 55/push-ebp +14330 89/<- %ebp 4/r32/esp +14331 # . save registers +14332 51/push-ecx +14333 # var curr/ecx: int = n +14334 8b/-> *(ebp+8) 1/r32/ecx +14335 # result = 0 +14336 b8/copy-to-eax 0/imm32 +14337 { +14338 # if (curr <= 1) break +14339 81 7/subop/compare %ecx 1/imm32 +14340 7e/jump-if-<= break/disp8 +14341 40/increment-eax +14342 c1/shift 5/subop/arithmetic-right %ecx 1/imm8 +14343 eb/jump loop/disp8 +14344 } +14345 $num-shift-rights:end: +14346 # . restore registers +14347 59/pop-to-ecx +14348 # . epilogue +14349 89/<- %esp 5/r32/ebp +14350 5d/pop-to-ebp +14351 c3/return +14352 +14353 mu-get-offset: # stmt: (addr stmt) -> result/eax: int +14354 # . prologue +14355 55/push-ebp +14356 89/<- %ebp 4/r32/esp +14357 # var second-inout/eax: (addr stmt-var) = stmt->inouts->next +14358 8b/-> *(ebp+8) 0/r32/eax +14359 (lookup *(eax+0xc) *(eax+0x10)) # Stmt1-inouts Stmt1-inouts => eax +14360 (lookup *(eax+8) *(eax+0xc)) # Stmt-var-next Stmt-var-next => eax +14361 # var output-var/eax: (addr var) = second-inout->value +14362 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax +14363 #? (write-buffered Stderr "mu-get-offset: ") +14364 #? (write-int32-hex-buffered Stderr %eax) +14365 #? (write-buffered Stderr " name: ") +14366 #? 50/push-eax +14367 #? (lookup *eax *(eax+4)) # Var-name +14368 #? (write-buffered Stderr %eax) +14369 #? 58/pop-to-eax +14370 #? (write-buffered Stderr Newline) +14371 #? (flush Stderr) +14372 # return output-var->stack-offset +14373 8b/-> *(eax+0x14) 0/r32/eax # Var-offset +14374 #? (write-buffered Stderr "=> ") +14375 #? (write-int32-hex-buffered Stderr %eax) +14376 #? (write-buffered Stderr Newline) +14377 #? (flush Stderr) +14378 $emit-get-offset:end: +14379 # . epilogue +14380 89/<- %esp 5/r32/ebp +14381 5d/pop-to-ebp +14382 c3/return +14383 +14384 emit-subx-block: # out: (addr buffered-file), block: (addr block), vars: (addr stack live-var), fn: (addr function), err: (addr buffered-file), ed: (addr exit-descriptor) +14385 # . prologue +14386 55/push-ebp +14387 89/<- %ebp 4/r32/esp +14388 # . save registers +14389 50/push-eax +14390 51/push-ecx +14391 56/push-esi +14392 # esi = block +14393 8b/-> *(ebp+0xc) 6/r32/esi +14394 # block->var->block-depth = *Curr-block-depth +14395 (lookup *(esi+0xc) *(esi+0x10)) # Block-var Block-var => eax +14396 8b/-> *Curr-block-depth 1/r32/ecx +14397 89/<- *(eax+0x10) 1/r32/ecx # Var-block-depth +14398 # var stmts/eax: (addr list stmt) = lookup(block->statements) +14399 (lookup *(esi+4) *(esi+8)) # Block-stmts Block-stmts => eax +14400 # +14401 { +14402 $emit-subx-block:check-empty: +14403 3d/compare-eax-and 0/imm32 +14404 0f 84/jump-if-= break/disp32 +14405 (emit-indent *(ebp+8) *Curr-block-depth) +14406 (write-buffered *(ebp+8) "{\n") +14407 # var v/ecx: (addr var) = lookup(block->var) +14408 (lookup *(esi+0xc) *(esi+0x10)) # Block-var Block-var => eax +14409 89/<- %ecx 0/r32/eax +14410 # +14411 (lookup *ecx *(ecx+4)) # Var-name Var-name => eax +14412 (write-buffered *(ebp+8) %eax) +14413 (write-buffered *(ebp+8) ":loop:\n") +14414 ff 0/subop/increment *Curr-block-depth +14415 (push *(ebp+0x10) *(esi+0xc)) # Block-var +14416 (push *(ebp+0x10) *(esi+0x10)) # Block-var +14417 (push *(ebp+0x10) 0) # false +14418 # emit block->statements +14419 (lookup *(esi+4) *(esi+8)) # Block-stmts Block-stmts => eax +14420 (emit-subx-stmt-list *(ebp+8) %eax *(ebp+0x10) *(ebp+0x14) *(ebp+0x18) *(ebp+0x1c)) +14421 (pop *(ebp+0x10)) # => eax +14422 (pop *(ebp+0x10)) # => eax +14423 (pop *(ebp+0x10)) # => eax +14424 ff 1/subop/decrement *Curr-block-depth +14425 (emit-indent *(ebp+8) *Curr-block-depth) +14426 (write-buffered *(ebp+8) "}\n") +14427 (lookup *ecx *(ecx+4)) # Var-name Var-name => eax +14428 (write-buffered *(ebp+8) %eax) +14429 (write-buffered *(ebp+8) ":break:\n") +14430 } +14431 $emit-subx-block:end: +14432 # . restore registers +14433 5e/pop-to-esi +14434 59/pop-to-ecx +14435 58/pop-to-eax +14436 # . epilogue +14437 89/<- %esp 5/r32/ebp +14438 5d/pop-to-ebp +14439 c3/return +14440 +14441 # Primitives supported +14442 # See mu_instructions for a summary of this linked-list data structure. +14443 # +14444 # For each operation, put variants with hard-coded registers before flexible ones. +14445 # +14446 # Unfortunately, our restrictions on addresses require that various fields in +14447 # primitives be handles, which complicates these definitions. +14448 # - we need to insert dummy fields all over the place for fake alloc-ids +14449 # - we can't use our syntax sugar of quoted literals for string fields +14450 # +14451 # Fake alloc-ids are needed because our type definitions up top require +14452 # handles but it's clearer to statically allocate these long-lived objects. +14453 # Fake alloc-ids are perfectly safe, but they can't be reclaimed. +14454 # +14455 # Every 'object' below starts with a fake alloc-id. It may also contain other +14456 # fake alloc-ids for various handle fields. +14457 # +14458 # I think of objects starting with a fake alloc-id as having type 'payload'. +14459 # It's not really intended to be created dynamically; for that use `allocate` +14460 # as usual. +14461 # +14462 # Idea for a notation to simplify such definitions: +14463 # _Primitive-increment-eax: # (payload primitive) +14464 # 0x11/alloc-id:fake:payload +14465 # 0x11 @(0x11 "increment") # name +14466 # 0 0 # inouts +14467 # 0x11 @(0x11/payload +14468 # 0x11 @(0x11/payload # List-value +14469 # 0 0 # Var-name +14470 # 0x11 @(0x11 # Var-type +14471 # 1/is-atom +14472 # 1/value 0/unused # Type-tree-left +14473 # 0 0 # Type-tree-right +14474 # ) +14475 # 1 # block-depth +14476 # 0 # stack-offset +14477 # 0x11 @(0x11 "eax") # Var-register +14478 # ) +14479 # 0 0) # List-next +14480 # ... +14481 # _Primitive-increment-ecx/imm32/next +14482 # ... +14483 # Awfully complex and non-obvious. But also clearly signals there's something +14484 # to learn here, so may be worth trying. +14485 # +14486 # '@' is just an initial thought. Punctuation used so far in Mu: () * % # / " +14487 # +14488 # For now we'll continue to just use comments and manually ensure they stay up +14489 # to date. +14490 == data +14491 Primitives: # (addr primitive) +14492 # - increment/decrement +14493 _Primitive-increment-eax: # (addr primitive) +14494 # var/eax <- increment => 40/increment-eax +14495 0x11/imm32/alloc-id:fake +14496 _string-increment/imm32/name +14497 0/imm32/no-inouts +14498 0/imm32/no-inouts +14499 0x11/imm32/alloc-id:fake +14500 Single-int-var-in-eax/imm32/outputs 14501 0x11/imm32/alloc-id:fake -14502 _string-add/imm32/name -14503 0x11/imm32/alloc-id:fake -14504 Single-int-var-in-mem/imm32/inouts -14505 0x11/imm32/alloc-id:fake -14506 Single-int-var-in-some-register/imm32/outputs -14507 0x11/imm32/alloc-id:fake -14508 _string_03_add/imm32/subx-name -14509 1/imm32/rm32-is-first-inout -14510 3/imm32/r32-is-first-output -14511 0/imm32/no-imm32 -14512 0/imm32/no-disp32 -14513 0/imm32/output-is-write-only -14514 0x11/imm32/alloc-id:fake -14515 _Primitive-add-lit-to-reg/imm32/next -14516 _Primitive-add-lit-to-reg: # (payload primitive) -14517 0x11/imm32/alloc-id:fake:payload -14518 # var1/reg <- add lit => 81 0/subop/add var1/rm32 lit/imm32 +14502 _string_40_increment_eax/imm32/subx-name +14503 0/imm32/no-rm32 +14504 0/imm32/no-r32 +14505 0/imm32/no-imm32 +14506 0/imm32/no-disp32 +14507 0/imm32/output-is-write-only +14508 0x11/imm32/alloc-id:fake +14509 _Primitive-increment-ecx/imm32/next +14510 _Primitive-increment-ecx: # (payload primitive) +14511 0x11/imm32/alloc-id:fake:payload +14512 # var/ecx <- increment => 41/increment-ecx +14513 0x11/imm32/alloc-id:fake +14514 _string-increment/imm32/name +14515 0/imm32/no-inouts +14516 0/imm32/no-inouts +14517 0x11/imm32/alloc-id:fake +14518 Single-int-var-in-ecx/imm32/outputs 14519 0x11/imm32/alloc-id:fake -14520 _string-add/imm32/name -14521 0x11/imm32/alloc-id:fake -14522 Single-lit-var/imm32/inouts -14523 0x11/imm32/alloc-id:fake -14524 Single-int-var-in-some-register/imm32/outputs -14525 0x11/imm32/alloc-id:fake -14526 _string_81_subop_add/imm32/subx-name -14527 3/imm32/rm32-is-first-output -14528 0/imm32/no-r32 -14529 1/imm32/imm32-is-first-inout -14530 0/imm32/no-disp32 -14531 0/imm32/output-is-write-only -14532 0x11/imm32/alloc-id:fake -14533 _Primitive-add-lit-to-mem/imm32/next -14534 _Primitive-add-lit-to-mem: # (payload primitive) -14535 0x11/imm32/alloc-id:fake:payload -14536 # add-to var1, lit => 81 0/subop/add var1/rm32 lit/imm32 +14520 _string_41_increment_ecx/imm32/subx-name +14521 0/imm32/no-rm32 +14522 0/imm32/no-r32 +14523 0/imm32/no-imm32 +14524 0/imm32/no-disp32 +14525 0/imm32/output-is-write-only +14526 0x11/imm32/alloc-id:fake +14527 _Primitive-increment-edx/imm32/next +14528 _Primitive-increment-edx: # (payload primitive) +14529 0x11/imm32/alloc-id:fake:payload +14530 # var/edx <- increment => 42/increment-edx +14531 0x11/imm32/alloc-id:fake +14532 _string-increment/imm32/name +14533 0/imm32/no-inouts +14534 0/imm32/no-inouts +14535 0x11/imm32/alloc-id:fake +14536 Single-int-var-in-edx/imm32/outputs 14537 0x11/imm32/alloc-id:fake -14538 _string-add-to/imm32/name -14539 0x11/imm32/alloc-id:fake -14540 Int-var-and-literal/imm32/inouts -14541 0/imm32/no-outputs -14542 0/imm32/no-outputs -14543 0x11/imm32/alloc-id:fake -14544 _string_81_subop_add/imm32/subx-name -14545 1/imm32/rm32-is-first-inout -14546 0/imm32/no-r32 -14547 2/imm32/imm32-is-second-inout -14548 0/imm32/no-disp32 -14549 0/imm32/output-is-write-only -14550 0x11/imm32/alloc-id:fake -14551 _Primitive-subtract-from-eax/imm32/next -14552 # - subtract -14553 _Primitive-subtract-from-eax: # (payload primitive) -14554 0x11/imm32/alloc-id:fake:payload -14555 # var/eax <- subtract lit => 2d/subtract-from-eax lit/imm32 -14556 0x11/imm32/alloc-id:fake -14557 _string-subtract/imm32/name -14558 0x11/imm32/alloc-id:fake -14559 Single-lit-var/imm32/inouts -14560 0x11/imm32/alloc-id:fake -14561 Single-int-var-in-eax/imm32/outputs +14538 _string_42_increment_edx/imm32/subx-name +14539 0/imm32/no-rm32 +14540 0/imm32/no-r32 +14541 0/imm32/no-imm32 +14542 0/imm32/no-disp32 +14543 0/imm32/output-is-write-only +14544 0x11/imm32/alloc-id:fake +14545 _Primitive-increment-ebx/imm32/next +14546 _Primitive-increment-ebx: # (payload primitive) +14547 0x11/imm32/alloc-id:fake:payload +14548 # var/ebx <- increment => 43/increment-ebx +14549 0x11/imm32/alloc-id:fake +14550 _string-increment/imm32/name +14551 0/imm32/no-inouts +14552 0/imm32/no-inouts +14553 0x11/imm32/alloc-id:fake +14554 Single-int-var-in-ebx/imm32/outputs +14555 0x11/imm32/alloc-id:fake +14556 _string_43_increment_ebx/imm32/subx-name +14557 0/imm32/no-rm32 +14558 0/imm32/no-r32 +14559 0/imm32/no-imm32 +14560 0/imm32/no-disp32 +14561 0/imm32/output-is-write-only 14562 0x11/imm32/alloc-id:fake -14563 _string_2d_subtract_from_eax/imm32/subx-name -14564 0/imm32/no-rm32 -14565 0/imm32/no-r32 -14566 1/imm32/imm32-is-first-inout -14567 0/imm32/no-disp32 -14568 0/imm32/output-is-write-only -14569 0x11/imm32/alloc-id:fake -14570 _Primitive-subtract-reg-from-reg/imm32/next -14571 _Primitive-subtract-reg-from-reg: # (payload primitive) -14572 0x11/imm32/alloc-id:fake:payload -14573 # var1/reg <- subtract var2/reg => 29/subtract-from var1/rm32 var2/r32 -14574 0x11/imm32/alloc-id:fake -14575 _string-subtract/imm32/name -14576 0x11/imm32/alloc-id:fake -14577 Single-int-var-in-some-register/imm32/inouts -14578 0x11/imm32/alloc-id:fake -14579 Single-int-var-in-some-register/imm32/outputs +14563 _Primitive-increment-esi/imm32/next +14564 _Primitive-increment-esi: # (payload primitive) +14565 0x11/imm32/alloc-id:fake:payload +14566 # var/esi <- increment => 46/increment-esi +14567 0x11/imm32/alloc-id:fake +14568 _string-increment/imm32/name +14569 0/imm32/no-inouts +14570 0/imm32/no-inouts +14571 0x11/imm32/alloc-id:fake +14572 Single-int-var-in-esi/imm32/outputs +14573 0x11/imm32/alloc-id:fake +14574 _string_46_increment_esi/imm32/subx-name +14575 0/imm32/no-rm32 +14576 0/imm32/no-r32 +14577 0/imm32/no-imm32 +14578 0/imm32/no-disp32 +14579 0/imm32/output-is-write-only 14580 0x11/imm32/alloc-id:fake -14581 _string_29_subtract_from/imm32/subx-name -14582 3/imm32/rm32-is-first-output -14583 1/imm32/r32-is-first-inout -14584 0/imm32/no-imm32 -14585 0/imm32/no-disp32 -14586 0/imm32/output-is-write-only -14587 0x11/imm32/alloc-id:fake -14588 _Primitive-subtract-reg-from-mem/imm32/next -14589 _Primitive-subtract-reg-from-mem: # (payload primitive) -14590 0x11/imm32/alloc-id:fake:payload -14591 # subtract-from var1 var2/reg => 29/subtract-from var1 var2/r32 -14592 0x11/imm32/alloc-id:fake -14593 _string-subtract-from/imm32/name -14594 0x11/imm32/alloc-id:fake -14595 Two-args-int-stack-int-reg/imm32/inouts -14596 0/imm32/no-outputs -14597 0/imm32/no-outputs +14581 _Primitive-increment-edi/imm32/next +14582 _Primitive-increment-edi: # (payload primitive) +14583 0x11/imm32/alloc-id:fake:payload +14584 # var/edi <- increment => 47/increment-edi +14585 0x11/imm32/alloc-id:fake +14586 _string-increment/imm32/name +14587 0/imm32/no-inouts +14588 0/imm32/no-inouts +14589 0x11/imm32/alloc-id:fake +14590 Single-int-var-in-edi/imm32/outputs +14591 0x11/imm32/alloc-id:fake +14592 _string_47_increment_edi/imm32/subx-name +14593 0/imm32/no-rm32 +14594 0/imm32/no-r32 +14595 0/imm32/no-imm32 +14596 0/imm32/no-disp32 +14597 0/imm32/output-is-write-only 14598 0x11/imm32/alloc-id:fake -14599 _string_29_subtract_from/imm32/subx-name -14600 1/imm32/rm32-is-first-inout -14601 2/imm32/r32-is-second-inout -14602 0/imm32/no-imm32 -14603 0/imm32/no-disp32 -14604 0/imm32/output-is-write-only -14605 0x11/imm32/alloc-id:fake -14606 _Primitive-subtract-mem-from-reg/imm32/next -14607 _Primitive-subtract-mem-from-reg: # (payload primitive) -14608 0x11/imm32/alloc-id:fake:payload -14609 # var1/reg <- subtract var2 => 2b/subtract var2/rm32 var1/r32 -14610 0x11/imm32/alloc-id:fake -14611 _string-subtract/imm32/name -14612 0x11/imm32/alloc-id:fake -14613 Single-int-var-in-mem/imm32/inouts -14614 0x11/imm32/alloc-id:fake -14615 Single-int-var-in-some-register/imm32/outputs +14599 _Primitive-decrement-eax/imm32/next +14600 _Primitive-decrement-eax: # (payload primitive) +14601 0x11/imm32/alloc-id:fake:payload +14602 # var/eax <- decrement => 48/decrement-eax +14603 0x11/imm32/alloc-id:fake +14604 _string-decrement/imm32/name +14605 0/imm32/no-inouts +14606 0/imm32/no-inouts +14607 0x11/imm32/alloc-id:fake +14608 Single-int-var-in-eax/imm32/outputs +14609 0x11/imm32/alloc-id:fake +14610 _string_48_decrement_eax/imm32/subx-name +14611 0/imm32/no-rm32 +14612 0/imm32/no-r32 +14613 0/imm32/no-imm32 +14614 0/imm32/no-disp32 +14615 0/imm32/output-is-write-only 14616 0x11/imm32/alloc-id:fake -14617 _string_2b_subtract/imm32/subx-name -14618 1/imm32/rm32-is-first-inout -14619 3/imm32/r32-is-first-output -14620 0/imm32/no-imm32 -14621 0/imm32/no-disp32 -14622 0/imm32/output-is-write-only -14623 0x11/imm32/alloc-id:fake -14624 _Primitive-subtract-lit-from-reg/imm32/next -14625 _Primitive-subtract-lit-from-reg: # (payload primitive) -14626 0x11/imm32/alloc-id:fake:payload -14627 # var1/reg <- subtract lit => 81 5/subop/subtract var1/rm32 lit/imm32 -14628 0x11/imm32/alloc-id:fake -14629 _string-subtract/imm32/name -14630 0x11/imm32/alloc-id:fake -14631 Single-lit-var/imm32/inouts -14632 0x11/imm32/alloc-id:fake -14633 Single-int-var-in-some-register/imm32/outputs +14617 _Primitive-decrement-ecx/imm32/next +14618 _Primitive-decrement-ecx: # (payload primitive) +14619 0x11/imm32/alloc-id:fake:payload +14620 # var/ecx <- decrement => 49/decrement-ecx +14621 0x11/imm32/alloc-id:fake +14622 _string-decrement/imm32/name +14623 0/imm32/no-inouts +14624 0/imm32/no-inouts +14625 0x11/imm32/alloc-id:fake +14626 Single-int-var-in-ecx/imm32/outputs +14627 0x11/imm32/alloc-id:fake +14628 _string_49_decrement_ecx/imm32/subx-name +14629 0/imm32/no-rm32 +14630 0/imm32/no-r32 +14631 0/imm32/no-imm32 +14632 0/imm32/no-disp32 +14633 0/imm32/output-is-write-only 14634 0x11/imm32/alloc-id:fake -14635 _string_81_subop_subtract/imm32/subx-name -14636 3/imm32/rm32-is-first-output -14637 0/imm32/no-r32 -14638 1/imm32/imm32-is-first-inout -14639 0/imm32/no-disp32 -14640 0/imm32/output-is-write-only -14641 0x11/imm32/alloc-id:fake -14642 _Primitive-subtract-lit-from-mem/imm32/next -14643 _Primitive-subtract-lit-from-mem: # (payload primitive) -14644 0x11/imm32/alloc-id:fake:payload -14645 # subtract-from var1, lit => 81 5/subop/subtract var1/rm32 lit/imm32 -14646 0x11/imm32/alloc-id:fake -14647 _string-subtract-from/imm32/name -14648 0x11/imm32/alloc-id:fake -14649 Int-var-and-literal/imm32/inouts -14650 0/imm32/no-outputs -14651 0/imm32/no-outputs +14635 _Primitive-decrement-edx/imm32/next +14636 _Primitive-decrement-edx: # (payload primitive) +14637 0x11/imm32/alloc-id:fake:payload +14638 # var/edx <- decrement => 4a/decrement-edx +14639 0x11/imm32/alloc-id:fake +14640 _string-decrement/imm32/name +14641 0/imm32/no-inouts +14642 0/imm32/no-inouts +14643 0x11/imm32/alloc-id:fake +14644 Single-int-var-in-edx/imm32/outputs +14645 0x11/imm32/alloc-id:fake +14646 _string_4a_decrement_edx/imm32/subx-name +14647 0/imm32/no-rm32 +14648 0/imm32/no-r32 +14649 0/imm32/no-imm32 +14650 0/imm32/no-disp32 +14651 0/imm32/output-is-write-only 14652 0x11/imm32/alloc-id:fake -14653 _string_81_subop_subtract/imm32/subx-name -14654 1/imm32/rm32-is-first-inout -14655 0/imm32/no-r32 -14656 2/imm32/imm32-is-first-inout -14657 0/imm32/no-disp32 -14658 0/imm32/output-is-write-only -14659 0x11/imm32/alloc-id:fake -14660 _Primitive-and-with-eax/imm32/next -14661 # - and -14662 _Primitive-and-with-eax: # (payload primitive) -14663 0x11/imm32/alloc-id:fake:payload -14664 # var/eax <- and lit => 25/and-with-eax lit/imm32 -14665 0x11/imm32/alloc-id:fake -14666 _string-and/imm32/name -14667 0x11/imm32/alloc-id:fake -14668 Single-lit-var/imm32/inouts -14669 0x11/imm32/alloc-id:fake -14670 Single-int-var-in-eax/imm32/outputs -14671 0x11/imm32/alloc-id:fake -14672 _string_25_and_with_eax/imm32/subx-name -14673 0/imm32/no-rm32 -14674 0/imm32/no-r32 -14675 1/imm32/imm32-is-first-inout -14676 0/imm32/no-disp32 -14677 0/imm32/output-is-write-only -14678 0x11/imm32/alloc-id:fake -14679 _Primitive-and-reg-with-reg/imm32/next -14680 _Primitive-and-reg-with-reg: # (payload primitive) -14681 0x11/imm32/alloc-id:fake:payload -14682 # var1/reg <- and var2/reg => 21/and-with var1/rm32 var2/r32 -14683 0x11/imm32/alloc-id:fake -14684 _string-and/imm32/name -14685 0x11/imm32/alloc-id:fake -14686 Single-int-var-in-some-register/imm32/inouts -14687 0x11/imm32/alloc-id:fake -14688 Single-int-var-in-some-register/imm32/outputs -14689 0x11/imm32/alloc-id:fake -14690 _string_21_and_with/imm32/subx-name -14691 3/imm32/rm32-is-first-output -14692 1/imm32/r32-is-first-inout -14693 0/imm32/no-imm32 -14694 0/imm32/no-disp32 -14695 0/imm32/output-is-write-only -14696 0x11/imm32/alloc-id:fake -14697 _Primitive-and-reg-with-mem/imm32/next -14698 _Primitive-and-reg-with-mem: # (payload primitive) -14699 0x11/imm32/alloc-id:fake:payload -14700 # and-with var1 var2/reg => 21/and-with var1 var2/r32 -14701 0x11/imm32/alloc-id:fake -14702 _string-and-with/imm32/name -14703 0x11/imm32/alloc-id:fake -14704 Two-args-int-stack-int-reg/imm32/inouts -14705 0/imm32/no-outputs -14706 0/imm32/no-outputs -14707 0x11/imm32/alloc-id:fake -14708 _string_21_and_with/imm32/subx-name -14709 1/imm32/rm32-is-first-inout -14710 2/imm32/r32-is-second-inout -14711 0/imm32/no-imm32 -14712 0/imm32/no-disp32 -14713 0/imm32/output-is-write-only -14714 0x11/imm32/alloc-id:fake -14715 _Primitive-and-mem-with-reg/imm32/next -14716 _Primitive-and-mem-with-reg: # (payload primitive) -14717 0x11/imm32/alloc-id:fake:payload -14718 # var1/reg <- and var2 => 23/and var2/rm32 var1/r32 -14719 0x11/imm32/alloc-id:fake -14720 _string-and/imm32/name -14721 0x11/imm32/alloc-id:fake -14722 Single-int-var-in-mem/imm32/inouts -14723 0x11/imm32/alloc-id:fake -14724 Single-int-var-in-some-register/imm32/outputs -14725 0x11/imm32/alloc-id:fake -14726 _string_23_and/imm32/subx-name -14727 1/imm32/rm32-is-first-inout -14728 3/imm32/r32-is-first-output -14729 0/imm32/no-imm32 -14730 0/imm32/no-disp32 -14731 0/imm32/output-is-write-only -14732 0x11/imm32/alloc-id:fake -14733 _Primitive-and-lit-with-reg/imm32/next -14734 _Primitive-and-lit-with-reg: # (payload primitive) -14735 0x11/imm32/alloc-id:fake:payload -14736 # var1/reg <- and lit => 81 4/subop/and var1/rm32 lit/imm32 -14737 0x11/imm32/alloc-id:fake -14738 _string-and/imm32/name -14739 0x11/imm32/alloc-id:fake -14740 Single-lit-var/imm32/inouts -14741 0x11/imm32/alloc-id:fake -14742 Single-int-var-in-some-register/imm32/outputs -14743 0x11/imm32/alloc-id:fake -14744 _string_81_subop_and/imm32/subx-name -14745 3/imm32/rm32-is-first-output -14746 0/imm32/no-r32 -14747 1/imm32/imm32-is-first-inout -14748 0/imm32/no-disp32 -14749 0/imm32/output-is-write-only -14750 0x11/imm32/alloc-id:fake -14751 _Primitive-and-lit-with-mem/imm32/next -14752 _Primitive-and-lit-with-mem: # (payload primitive) -14753 0x11/imm32/alloc-id:fake:payload -14754 # and-with var1, lit => 81 4/subop/and var1/rm32 lit/imm32 -14755 0x11/imm32/alloc-id:fake -14756 _string-and-with/imm32/name -14757 0x11/imm32/alloc-id:fake -14758 Int-var-and-literal/imm32/inouts -14759 0/imm32/no-outputs -14760 0/imm32/no-outputs -14761 0x11/imm32/alloc-id:fake -14762 _string_81_subop_and/imm32/subx-name -14763 1/imm32/rm32-is-first-inout -14764 0/imm32/no-r32 -14765 2/imm32/imm32-is-first-inout -14766 0/imm32/no-disp32 -14767 0/imm32/output-is-write-only -14768 0x11/imm32/alloc-id:fake -14769 _Primitive-or-with-eax/imm32/next -14770 # - or -14771 _Primitive-or-with-eax: # (payload primitive) -14772 0x11/imm32/alloc-id:fake:payload -14773 # var/eax <- or lit => 0d/or-with-eax lit/imm32 -14774 0x11/imm32/alloc-id:fake -14775 _string-or/imm32/name -14776 0x11/imm32/alloc-id:fake -14777 Single-lit-var/imm32/inouts +14653 _Primitive-decrement-ebx/imm32/next +14654 _Primitive-decrement-ebx: # (payload primitive) +14655 0x11/imm32/alloc-id:fake:payload +14656 # var/ebx <- decrement => 4b/decrement-ebx +14657 0x11/imm32/alloc-id:fake +14658 _string-decrement/imm32/name +14659 0/imm32/no-inouts +14660 0/imm32/no-inouts +14661 0x11/imm32/alloc-id:fake +14662 Single-int-var-in-ebx/imm32/outputs +14663 0x11/imm32/alloc-id:fake +14664 _string_4b_decrement_ebx/imm32/subx-name +14665 0/imm32/no-rm32 +14666 0/imm32/no-r32 +14667 0/imm32/no-imm32 +14668 0/imm32/no-disp32 +14669 0/imm32/output-is-write-only +14670 0x11/imm32/alloc-id:fake +14671 _Primitive-decrement-esi/imm32/next +14672 _Primitive-decrement-esi: # (payload primitive) +14673 0x11/imm32/alloc-id:fake:payload +14674 # var/esi <- decrement => 4e/decrement-esi +14675 0x11/imm32/alloc-id:fake +14676 _string-decrement/imm32/name +14677 0/imm32/no-inouts +14678 0/imm32/no-inouts +14679 0x11/imm32/alloc-id:fake +14680 Single-int-var-in-esi/imm32/outputs +14681 0x11/imm32/alloc-id:fake +14682 _string_4e_decrement_esi/imm32/subx-name +14683 0/imm32/no-rm32 +14684 0/imm32/no-r32 +14685 0/imm32/no-imm32 +14686 0/imm32/no-disp32 +14687 0/imm32/output-is-write-only +14688 0x11/imm32/alloc-id:fake +14689 _Primitive-decrement-edi/imm32/next +14690 _Primitive-decrement-edi: # (payload primitive) +14691 0x11/imm32/alloc-id:fake:payload +14692 # var/edi <- decrement => 4f/decrement-edi +14693 0x11/imm32/alloc-id:fake +14694 _string-decrement/imm32/name +14695 0/imm32/no-inouts +14696 0/imm32/no-inouts +14697 0x11/imm32/alloc-id:fake +14698 Single-int-var-in-edi/imm32/outputs +14699 0x11/imm32/alloc-id:fake +14700 _string_4f_decrement_edi/imm32/subx-name +14701 0/imm32/no-rm32 +14702 0/imm32/no-r32 +14703 0/imm32/no-imm32 +14704 0/imm32/no-disp32 +14705 0/imm32/output-is-write-only +14706 0x11/imm32/alloc-id:fake +14707 _Primitive-increment-mem/imm32/next +14708 _Primitive-increment-mem: # (payload primitive) +14709 0x11/imm32/alloc-id:fake:payload +14710 # increment var => ff 0/subop/increment *(ebp+__) +14711 0x11/imm32/alloc-id:fake +14712 _string-increment/imm32/name +14713 0x11/imm32/alloc-id:fake +14714 Single-int-var-in-mem/imm32/inouts +14715 0/imm32/no-outputs +14716 0/imm32/no-outputs +14717 0x11/imm32/alloc-id:fake +14718 _string_ff_subop_increment/imm32/subx-name +14719 1/imm32/rm32-is-first-inout +14720 0/imm32/no-r32 +14721 0/imm32/no-imm32 +14722 0/imm32/no-disp32 +14723 0/imm32/output-is-write-only +14724 0x11/imm32/alloc-id:fake +14725 _Primitive-increment-reg/imm32/next +14726 _Primitive-increment-reg: # (payload primitive) +14727 0x11/imm32/alloc-id:fake:payload +14728 # var/reg <- increment => ff 0/subop/increment %__ +14729 0x11/imm32/alloc-id:fake +14730 _string-increment/imm32/name +14731 0/imm32/no-inouts +14732 0/imm32/no-inouts +14733 0x11/imm32/alloc-id:fake +14734 Single-int-var-in-some-register/imm32/outputs +14735 0x11/imm32/alloc-id:fake +14736 _string_ff_subop_increment/imm32/subx-name +14737 3/imm32/rm32-is-first-output +14738 0/imm32/no-r32 +14739 0/imm32/no-imm32 +14740 0/imm32/no-disp32 +14741 0/imm32/output-is-write-only +14742 0x11/imm32/alloc-id:fake +14743 _Primitive-decrement-mem/imm32/next +14744 _Primitive-decrement-mem: # (payload primitive) +14745 0x11/imm32/alloc-id:fake:payload +14746 # decrement var => ff 1/subop/decrement *(ebp+__) +14747 0x11/imm32/alloc-id:fake +14748 _string-decrement/imm32/name +14749 0x11/imm32/alloc-id:fake +14750 Single-int-var-in-mem/imm32/inouts +14751 0/imm32/no-outputs +14752 0/imm32/no-outputs +14753 0x11/imm32/alloc-id:fake +14754 _string_ff_subop_decrement/imm32/subx-name +14755 1/imm32/rm32-is-first-inout +14756 0/imm32/no-r32 +14757 0/imm32/no-imm32 +14758 0/imm32/no-disp32 +14759 0/imm32/output-is-write-only +14760 0x11/imm32/alloc-id:fake +14761 _Primitive-decrement-reg/imm32/next +14762 _Primitive-decrement-reg: # (payload primitive) +14763 0x11/imm32/alloc-id:fake:payload +14764 # var/reg <- decrement => ff 1/subop/decrement %__ +14765 0x11/imm32/alloc-id:fake +14766 _string-decrement/imm32/name +14767 0/imm32/no-inouts +14768 0/imm32/no-inouts +14769 0x11/imm32/alloc-id:fake +14770 Single-int-var-in-some-register/imm32/outputs +14771 0x11/imm32/alloc-id:fake +14772 _string_ff_subop_decrement/imm32/subx-name +14773 3/imm32/rm32-is-first-output +14774 0/imm32/no-r32 +14775 0/imm32/no-imm32 +14776 0/imm32/no-disp32 +14777 0/imm32/output-is-write-only 14778 0x11/imm32/alloc-id:fake -14779 Single-int-var-in-eax/imm32/outputs -14780 0x11/imm32/alloc-id:fake -14781 _string_0d_or_with_eax/imm32/subx-name -14782 0/imm32/no-rm32 -14783 0/imm32/no-r32 -14784 1/imm32/imm32-is-first-inout -14785 0/imm32/no-disp32 -14786 0/imm32/output-is-write-only -14787 0x11/imm32/alloc-id:fake -14788 _Primitive-or-reg-with-reg/imm32/next -14789 _Primitive-or-reg-with-reg: # (payload primitive) -14790 0x11/imm32/alloc-id:fake:payload -14791 # var1/reg <- or var2/reg => 09/or-with var1/rm32 var2/r32 -14792 0x11/imm32/alloc-id:fake -14793 _string-or/imm32/name -14794 0x11/imm32/alloc-id:fake -14795 Single-int-var-in-some-register/imm32/inouts -14796 0x11/imm32/alloc-id:fake -14797 Single-int-var-in-some-register/imm32/outputs -14798 0x11/imm32/alloc-id:fake -14799 _string_09_or_with/imm32/subx-name -14800 3/imm32/rm32-is-first-output -14801 1/imm32/r32-is-first-inout -14802 0/imm32/no-imm32 -14803 0/imm32/no-disp32 -14804 0/imm32/output-is-write-only -14805 0x11/imm32/alloc-id:fake -14806 _Primitive-or-reg-with-mem/imm32/next -14807 _Primitive-or-reg-with-mem: # (payload primitive) -14808 0x11/imm32/alloc-id:fake:payload -14809 # or-with var1 var2/reg => 09/or-with var1 var2/r32 -14810 0x11/imm32/alloc-id:fake -14811 _string-or-with/imm32/name -14812 0x11/imm32/alloc-id:fake -14813 Two-args-int-stack-int-reg/imm32/inouts -14814 0/imm32/no-outputs -14815 0/imm32/no-outputs -14816 0x11/imm32/alloc-id:fake -14817 _string_09_or_with/imm32/subx-name -14818 1/imm32/rm32-is-first-inout -14819 2/imm32/r32-is-second-inout -14820 0/imm32/no-imm32 -14821 0/imm32/no-disp32 -14822 0/imm32/output-is-write-only -14823 0x11/imm32/alloc-id:fake -14824 _Primitive-or-mem-with-reg/imm32/next -14825 _Primitive-or-mem-with-reg: # (payload primitive) -14826 0x11/imm32/alloc-id:fake:payload -14827 # var1/reg <- or var2 => 0b/or var2/rm32 var1/r32 -14828 0x11/imm32/alloc-id:fake -14829 _string-or/imm32/name -14830 0x11/imm32/alloc-id:fake -14831 Single-int-var-in-mem/imm32/inouts -14832 0x11/imm32/alloc-id:fake -14833 Single-int-var-in-some-register/imm32/outputs -14834 0x11/imm32/alloc-id:fake -14835 _string_0b_or/imm32/subx-name -14836 1/imm32/rm32-is-first-inout -14837 3/imm32/r32-is-first-output -14838 0/imm32/no-imm32 -14839 0/imm32/no-disp32 -14840 0/imm32/output-is-write-only -14841 0x11/imm32/alloc-id:fake -14842 _Primitive-or-lit-with-reg/imm32/next -14843 _Primitive-or-lit-with-reg: # (payload primitive) -14844 0x11/imm32/alloc-id:fake:payload -14845 # var1/reg <- or lit => 81 1/subop/or var1/rm32 lit/imm32 -14846 0x11/imm32/alloc-id:fake -14847 _string-or/imm32/name -14848 0x11/imm32/alloc-id:fake -14849 Single-lit-var/imm32/inouts -14850 0x11/imm32/alloc-id:fake -14851 Single-int-var-in-some-register/imm32/outputs -14852 0x11/imm32/alloc-id:fake -14853 _string_81_subop_or/imm32/subx-name -14854 3/imm32/rm32-is-first-output -14855 0/imm32/no-r32 -14856 1/imm32/imm32-is-first-inout -14857 0/imm32/no-disp32 -14858 0/imm32/output-is-write-only -14859 0x11/imm32/alloc-id:fake -14860 _Primitive-or-lit-with-mem/imm32/next -14861 _Primitive-or-lit-with-mem: # (payload primitive) -14862 0x11/imm32/alloc-id:fake:payload -14863 # or-with var1, lit => 81 1/subop/or var1/rm32 lit/imm32 -14864 0x11/imm32/alloc-id:fake -14865 _string-or-with/imm32/name -14866 0x11/imm32/alloc-id:fake -14867 Int-var-and-literal/imm32/inouts -14868 0/imm32/no-outputs -14869 0/imm32/no-outputs -14870 0x11/imm32/alloc-id:fake -14871 _string_81_subop_or/imm32/subx-name -14872 1/imm32/rm32-is-first-inout -14873 0/imm32/no-r32 -14874 2/imm32/imm32-is-second-inout -14875 0/imm32/no-disp32 -14876 0/imm32/output-is-write-only -14877 0x11/imm32/alloc-id:fake -14878 _Primitive-xor-with-eax/imm32/next -14879 # - xor -14880 _Primitive-xor-with-eax: # (payload primitive) -14881 0x11/imm32/alloc-id:fake:payload -14882 # var/eax <- xor lit => 35/xor-with-eax lit/imm32 -14883 0x11/imm32/alloc-id:fake -14884 _string-xor/imm32/name -14885 0x11/imm32/alloc-id:fake -14886 Single-lit-var/imm32/inouts +14779 _Primitive-add-to-eax/imm32/next +14780 # - add +14781 _Primitive-add-to-eax: # (payload primitive) +14782 0x11/imm32/alloc-id:fake:payload +14783 # var/eax <- add lit => 05/add-to-eax lit/imm32 +14784 0x11/imm32/alloc-id:fake +14785 _string-add/imm32/name +14786 0x11/imm32/alloc-id:fake +14787 Single-lit-var/imm32/inouts +14788 0x11/imm32/alloc-id:fake +14789 Single-int-var-in-eax/imm32/outputs +14790 0x11/imm32/alloc-id:fake +14791 _string_05_add_to_eax/imm32/subx-name +14792 0/imm32/no-rm32 +14793 0/imm32/no-r32 +14794 1/imm32/imm32-is-first-inout +14795 0/imm32/no-disp32 +14796 0/imm32/output-is-write-only +14797 0x11/imm32/alloc-id:fake +14798 _Primitive-add-reg-to-reg/imm32/next +14799 _Primitive-add-reg-to-reg: # (payload primitive) +14800 0x11/imm32/alloc-id:fake:payload +14801 # var1/reg <- add var2/reg => 01/add-to var1/rm32 var2/r32 +14802 0x11/imm32/alloc-id:fake +14803 _string-add/imm32/name +14804 0x11/imm32/alloc-id:fake +14805 Single-int-var-in-some-register/imm32/inouts +14806 0x11/imm32/alloc-id:fake +14807 Single-int-var-in-some-register/imm32/outputs +14808 0x11/imm32/alloc-id:fake +14809 _string_01_add_to/imm32/subx-name +14810 3/imm32/rm32-is-first-output +14811 1/imm32/r32-is-first-inout +14812 0/imm32/no-imm32 +14813 0/imm32/no-disp32 +14814 0/imm32/output-is-write-only +14815 0x11/imm32/alloc-id:fake +14816 _Primitive-add-reg-to-mem/imm32/next +14817 _Primitive-add-reg-to-mem: # (payload primitive) +14818 0x11/imm32/alloc-id:fake:payload +14819 # add-to var1 var2/reg => 01/add-to var1 var2/r32 +14820 0x11/imm32/alloc-id:fake +14821 _string-add-to/imm32/name +14822 0x11/imm32/alloc-id:fake +14823 Two-args-int-stack-int-reg/imm32/inouts +14824 0/imm32/no-outputs +14825 0/imm32/no-outputs +14826 0x11/imm32/alloc-id:fake +14827 _string_01_add_to/imm32/subx-name +14828 1/imm32/rm32-is-first-inout +14829 2/imm32/r32-is-second-inout +14830 0/imm32/no-imm32 +14831 0/imm32/no-disp32 +14832 0/imm32/output-is-write-only +14833 0x11/imm32/alloc-id:fake +14834 _Primitive-add-mem-to-reg/imm32/next +14835 _Primitive-add-mem-to-reg: # (payload primitive) +14836 0x11/imm32/alloc-id:fake:payload +14837 # var1/reg <- add var2 => 03/add var2/rm32 var1/r32 +14838 0x11/imm32/alloc-id:fake +14839 _string-add/imm32/name +14840 0x11/imm32/alloc-id:fake +14841 Single-int-var-in-mem/imm32/inouts +14842 0x11/imm32/alloc-id:fake +14843 Single-int-var-in-some-register/imm32/outputs +14844 0x11/imm32/alloc-id:fake +14845 _string_03_add/imm32/subx-name +14846 1/imm32/rm32-is-first-inout +14847 3/imm32/r32-is-first-output +14848 0/imm32/no-imm32 +14849 0/imm32/no-disp32 +14850 0/imm32/output-is-write-only +14851 0x11/imm32/alloc-id:fake +14852 _Primitive-add-lit-to-reg/imm32/next +14853 _Primitive-add-lit-to-reg: # (payload primitive) +14854 0x11/imm32/alloc-id:fake:payload +14855 # var1/reg <- add lit => 81 0/subop/add var1/rm32 lit/imm32 +14856 0x11/imm32/alloc-id:fake +14857 _string-add/imm32/name +14858 0x11/imm32/alloc-id:fake +14859 Single-lit-var/imm32/inouts +14860 0x11/imm32/alloc-id:fake +14861 Single-int-var-in-some-register/imm32/outputs +14862 0x11/imm32/alloc-id:fake +14863 _string_81_subop_add/imm32/subx-name +14864 3/imm32/rm32-is-first-output +14865 0/imm32/no-r32 +14866 1/imm32/imm32-is-first-inout +14867 0/imm32/no-disp32 +14868 0/imm32/output-is-write-only +14869 0x11/imm32/alloc-id:fake +14870 _Primitive-add-lit-to-mem/imm32/next +14871 _Primitive-add-lit-to-mem: # (payload primitive) +14872 0x11/imm32/alloc-id:fake:payload +14873 # add-to var1, lit => 81 0/subop/add var1/rm32 lit/imm32 +14874 0x11/imm32/alloc-id:fake +14875 _string-add-to/imm32/name +14876 0x11/imm32/alloc-id:fake +14877 Int-var-and-literal/imm32/inouts +14878 0/imm32/no-outputs +14879 0/imm32/no-outputs +14880 0x11/imm32/alloc-id:fake +14881 _string_81_subop_add/imm32/subx-name +14882 1/imm32/rm32-is-first-inout +14883 0/imm32/no-r32 +14884 2/imm32/imm32-is-second-inout +14885 0/imm32/no-disp32 +14886 0/imm32/output-is-write-only 14887 0x11/imm32/alloc-id:fake -14888 Single-int-var-in-eax/imm32/outputs -14889 0x11/imm32/alloc-id:fake -14890 _string_35_xor_with_eax/imm32/subx-name -14891 0/imm32/no-rm32 -14892 0/imm32/no-r32 -14893 1/imm32/imm32-is-first-inout -14894 0/imm32/no-disp32 -14895 0/imm32/output-is-write-only -14896 0x11/imm32/alloc-id:fake -14897 _Primitive-xor-reg-with-reg/imm32/next -14898 _Primitive-xor-reg-with-reg: # (payload primitive) -14899 0x11/imm32/alloc-id:fake:payload -14900 # var1/reg <- xor var2/reg => 31/xor-with var1/rm32 var2/r32 -14901 0x11/imm32/alloc-id:fake -14902 _string-xor/imm32/name -14903 0x11/imm32/alloc-id:fake -14904 Single-int-var-in-some-register/imm32/inouts -14905 0x11/imm32/alloc-id:fake -14906 Single-int-var-in-some-register/imm32/outputs -14907 0x11/imm32/alloc-id:fake -14908 _string_31_xor_with/imm32/subx-name -14909 3/imm32/rm32-is-first-output -14910 1/imm32/r32-is-first-inout -14911 0/imm32/no-imm32 -14912 0/imm32/no-disp32 -14913 0/imm32/output-is-write-only -14914 0x11/imm32/alloc-id:fake -14915 _Primitive-xor-reg-with-mem/imm32/next -14916 _Primitive-xor-reg-with-mem: # (payload primitive) -14917 0x11/imm32/alloc-id:fake:payload -14918 # xor-with var1 var2/reg => 31/xor-with var1 var2/r32 -14919 0x11/imm32/alloc-id:fake -14920 _string-xor-with/imm32/name -14921 0x11/imm32/alloc-id:fake -14922 Two-args-int-stack-int-reg/imm32/inouts -14923 0/imm32/no-outputs -14924 0/imm32/no-outputs -14925 0x11/imm32/alloc-id:fake -14926 _string_31_xor_with/imm32/subx-name -14927 1/imm32/rm32-is-first-inout -14928 2/imm32/r32-is-second-inout -14929 0/imm32/no-imm32 -14930 0/imm32/no-disp32 -14931 0/imm32/output-is-write-only -14932 0x11/imm32/alloc-id:fake -14933 _Primitive-xor-mem-with-reg/imm32/next -14934 _Primitive-xor-mem-with-reg: # (payload primitive) -14935 0x11/imm32/alloc-id:fake:payload -14936 # var1/reg <- xor var2 => 33/xor var2/rm32 var1/r32 -14937 0x11/imm32/alloc-id:fake -14938 _string-xor/imm32/name -14939 0x11/imm32/alloc-id:fake -14940 Single-int-var-in-mem/imm32/inouts -14941 0x11/imm32/alloc-id:fake -14942 Single-int-var-in-some-register/imm32/outputs -14943 0x11/imm32/alloc-id:fake -14944 _string_33_xor/imm32/subx-name -14945 1/imm32/rm32-is-first-inout -14946 3/imm32/r32-is-first-output -14947 0/imm32/no-imm32 -14948 0/imm32/no-disp32 -14949 0/imm32/output-is-write-only -14950 0x11/imm32/alloc-id:fake -14951 _Primitive-xor-lit-with-reg/imm32/next -14952 _Primitive-xor-lit-with-reg: # (payload primitive) -14953 0x11/imm32/alloc-id:fake:payload -14954 # var1/reg <- xor lit => 81 6/subop/xor var1/rm32 lit/imm32 -14955 0x11/imm32/alloc-id:fake -14956 _string-xor/imm32/name -14957 0x11/imm32/alloc-id:fake -14958 Single-lit-var/imm32/inouts -14959 0x11/imm32/alloc-id:fake -14960 Single-int-var-in-some-register/imm32/outputs -14961 0x11/imm32/alloc-id:fake -14962 _string_81_subop_xor/imm32/subx-name -14963 3/imm32/rm32-is-first-output -14964 0/imm32/no-r32 -14965 1/imm32/imm32-is-first-inout -14966 0/imm32/no-disp32 -14967 0/imm32/output-is-write-only -14968 0x11/imm32/alloc-id:fake -14969 _Primitive-xor-lit-with-mem/imm32/next -14970 _Primitive-xor-lit-with-mem: # (payload primitive) -14971 0x11/imm32/alloc-id:fake:payload -14972 # xor-with var1, lit => 81 6/subop/xor var1/rm32 lit/imm32 -14973 0x11/imm32/alloc-id:fake -14974 _string-xor-with/imm32/name -14975 0x11/imm32/alloc-id:fake -14976 Int-var-and-literal/imm32/inouts -14977 0/imm32/no-outputs -14978 0/imm32/no-outputs -14979 0x11/imm32/alloc-id:fake -14980 _string_81_subop_xor/imm32/subx-name -14981 1/imm32/rm32-is-first-inout -14982 0/imm32/no-r32 -14983 2/imm32/imm32-is-first-inout -14984 0/imm32/no-disp32 -14985 0/imm32/output-is-write-only -14986 0x11/imm32/alloc-id:fake -14987 _Primitive-copy-to-eax/imm32/next -14988 # - copy -14989 _Primitive-copy-to-eax: # (payload primitive) -14990 0x11/imm32/alloc-id:fake:payload -14991 # var/eax <- copy lit => b8/copy-to-eax lit/imm32 -14992 0x11/imm32/alloc-id:fake -14993 _string-copy/imm32/name -14994 0x11/imm32/alloc-id:fake -14995 Single-lit-var/imm32/inouts +14888 _Primitive-subtract-from-eax/imm32/next +14889 # - subtract +14890 _Primitive-subtract-from-eax: # (payload primitive) +14891 0x11/imm32/alloc-id:fake:payload +14892 # var/eax <- subtract lit => 2d/subtract-from-eax lit/imm32 +14893 0x11/imm32/alloc-id:fake +14894 _string-subtract/imm32/name +14895 0x11/imm32/alloc-id:fake +14896 Single-lit-var/imm32/inouts +14897 0x11/imm32/alloc-id:fake +14898 Single-int-var-in-eax/imm32/outputs +14899 0x11/imm32/alloc-id:fake +14900 _string_2d_subtract_from_eax/imm32/subx-name +14901 0/imm32/no-rm32 +14902 0/imm32/no-r32 +14903 1/imm32/imm32-is-first-inout +14904 0/imm32/no-disp32 +14905 0/imm32/output-is-write-only +14906 0x11/imm32/alloc-id:fake +14907 _Primitive-subtract-reg-from-reg/imm32/next +14908 _Primitive-subtract-reg-from-reg: # (payload primitive) +14909 0x11/imm32/alloc-id:fake:payload +14910 # var1/reg <- subtract var2/reg => 29/subtract-from var1/rm32 var2/r32 +14911 0x11/imm32/alloc-id:fake +14912 _string-subtract/imm32/name +14913 0x11/imm32/alloc-id:fake +14914 Single-int-var-in-some-register/imm32/inouts +14915 0x11/imm32/alloc-id:fake +14916 Single-int-var-in-some-register/imm32/outputs +14917 0x11/imm32/alloc-id:fake +14918 _string_29_subtract_from/imm32/subx-name +14919 3/imm32/rm32-is-first-output +14920 1/imm32/r32-is-first-inout +14921 0/imm32/no-imm32 +14922 0/imm32/no-disp32 +14923 0/imm32/output-is-write-only +14924 0x11/imm32/alloc-id:fake +14925 _Primitive-subtract-reg-from-mem/imm32/next +14926 _Primitive-subtract-reg-from-mem: # (payload primitive) +14927 0x11/imm32/alloc-id:fake:payload +14928 # subtract-from var1 var2/reg => 29/subtract-from var1 var2/r32 +14929 0x11/imm32/alloc-id:fake +14930 _string-subtract-from/imm32/name +14931 0x11/imm32/alloc-id:fake +14932 Two-args-int-stack-int-reg/imm32/inouts +14933 0/imm32/no-outputs +14934 0/imm32/no-outputs +14935 0x11/imm32/alloc-id:fake +14936 _string_29_subtract_from/imm32/subx-name +14937 1/imm32/rm32-is-first-inout +14938 2/imm32/r32-is-second-inout +14939 0/imm32/no-imm32 +14940 0/imm32/no-disp32 +14941 0/imm32/output-is-write-only +14942 0x11/imm32/alloc-id:fake +14943 _Primitive-subtract-mem-from-reg/imm32/next +14944 _Primitive-subtract-mem-from-reg: # (payload primitive) +14945 0x11/imm32/alloc-id:fake:payload +14946 # var1/reg <- subtract var2 => 2b/subtract var2/rm32 var1/r32 +14947 0x11/imm32/alloc-id:fake +14948 _string-subtract/imm32/name +14949 0x11/imm32/alloc-id:fake +14950 Single-int-var-in-mem/imm32/inouts +14951 0x11/imm32/alloc-id:fake +14952 Single-int-var-in-some-register/imm32/outputs +14953 0x11/imm32/alloc-id:fake +14954 _string_2b_subtract/imm32/subx-name +14955 1/imm32/rm32-is-first-inout +14956 3/imm32/r32-is-first-output +14957 0/imm32/no-imm32 +14958 0/imm32/no-disp32 +14959 0/imm32/output-is-write-only +14960 0x11/imm32/alloc-id:fake +14961 _Primitive-subtract-lit-from-reg/imm32/next +14962 _Primitive-subtract-lit-from-reg: # (payload primitive) +14963 0x11/imm32/alloc-id:fake:payload +14964 # var1/reg <- subtract lit => 81 5/subop/subtract var1/rm32 lit/imm32 +14965 0x11/imm32/alloc-id:fake +14966 _string-subtract/imm32/name +14967 0x11/imm32/alloc-id:fake +14968 Single-lit-var/imm32/inouts +14969 0x11/imm32/alloc-id:fake +14970 Single-int-var-in-some-register/imm32/outputs +14971 0x11/imm32/alloc-id:fake +14972 _string_81_subop_subtract/imm32/subx-name +14973 3/imm32/rm32-is-first-output +14974 0/imm32/no-r32 +14975 1/imm32/imm32-is-first-inout +14976 0/imm32/no-disp32 +14977 0/imm32/output-is-write-only +14978 0x11/imm32/alloc-id:fake +14979 _Primitive-subtract-lit-from-mem/imm32/next +14980 _Primitive-subtract-lit-from-mem: # (payload primitive) +14981 0x11/imm32/alloc-id:fake:payload +14982 # subtract-from var1, lit => 81 5/subop/subtract var1/rm32 lit/imm32 +14983 0x11/imm32/alloc-id:fake +14984 _string-subtract-from/imm32/name +14985 0x11/imm32/alloc-id:fake +14986 Int-var-and-literal/imm32/inouts +14987 0/imm32/no-outputs +14988 0/imm32/no-outputs +14989 0x11/imm32/alloc-id:fake +14990 _string_81_subop_subtract/imm32/subx-name +14991 1/imm32/rm32-is-first-inout +14992 0/imm32/no-r32 +14993 2/imm32/imm32-is-first-inout +14994 0/imm32/no-disp32 +14995 0/imm32/output-is-write-only 14996 0x11/imm32/alloc-id:fake -14997 Single-int-var-in-eax/imm32/outputs -14998 0x11/imm32/alloc-id:fake -14999 _string_b8_copy_to_eax/imm32/subx-name -15000 0/imm32/no-rm32 -15001 0/imm32/no-r32 -15002 1/imm32/imm32-is-first-inout -15003 0/imm32/no-disp32 -15004 1/imm32/output-is-write-only -15005 0x11/imm32/alloc-id:fake -15006 _Primitive-copy-to-ecx/imm32/next -15007 _Primitive-copy-to-ecx: # (payload primitive) -15008 0x11/imm32/alloc-id:fake:payload -15009 # var/ecx <- copy lit => b9/copy-to-ecx lit/imm32 -15010 0x11/imm32/alloc-id:fake -15011 _string-copy/imm32/name -15012 0x11/imm32/alloc-id:fake -15013 Single-lit-var/imm32/inouts -15014 0x11/imm32/alloc-id:fake -15015 Single-int-var-in-ecx/imm32/outputs -15016 0x11/imm32/alloc-id:fake -15017 _string_b9_copy_to_ecx/imm32/subx-name -15018 0/imm32/no-rm32 -15019 0/imm32/no-r32 -15020 1/imm32/imm32-is-first-inout -15021 0/imm32/no-disp32 -15022 1/imm32/output-is-write-only -15023 0x11/imm32/alloc-id:fake -15024 _Primitive-copy-to-edx/imm32/next -15025 _Primitive-copy-to-edx: # (payload primitive) -15026 0x11/imm32/alloc-id:fake:payload -15027 # var/edx <- copy lit => ba/copy-to-edx lit/imm32 -15028 0x11/imm32/alloc-id:fake -15029 _string-copy/imm32/name -15030 0x11/imm32/alloc-id:fake -15031 Single-lit-var/imm32/inouts -15032 0x11/imm32/alloc-id:fake -15033 Single-int-var-in-edx/imm32/outputs -15034 0x11/imm32/alloc-id:fake -15035 _string_ba_copy_to_edx/imm32/subx-name -15036 0/imm32/no-rm32 -15037 0/imm32/no-r32 -15038 1/imm32/imm32-is-first-inout -15039 0/imm32/no-disp32 -15040 1/imm32/output-is-write-only -15041 0x11/imm32/alloc-id:fake -15042 _Primitive-copy-to-ebx/imm32/next -15043 _Primitive-copy-to-ebx: # (payload primitive) -15044 0x11/imm32/alloc-id:fake:payload -15045 # var/ebx <- copy lit => bb/copy-to-ebx lit/imm32 -15046 0x11/imm32/alloc-id:fake -15047 _string-copy/imm32/name -15048 0x11/imm32/alloc-id:fake -15049 Single-lit-var/imm32/inouts -15050 0x11/imm32/alloc-id:fake -15051 Single-int-var-in-ebx/imm32/outputs -15052 0x11/imm32/alloc-id:fake -15053 _string_bb_copy_to_ebx/imm32/subx-name -15054 0/imm32/no-rm32 -15055 0/imm32/no-r32 -15056 1/imm32/imm32-is-first-inout -15057 0/imm32/no-disp32 -15058 1/imm32/output-is-write-only -15059 0x11/imm32/alloc-id:fake -15060 _Primitive-copy-to-esi/imm32/next -15061 _Primitive-copy-to-esi: # (payload primitive) -15062 0x11/imm32/alloc-id:fake:payload -15063 # var/esi <- copy lit => be/copy-to-esi lit/imm32 -15064 0x11/imm32/alloc-id:fake -15065 _string-copy/imm32/name -15066 0x11/imm32/alloc-id:fake -15067 Single-lit-var/imm32/inouts -15068 0x11/imm32/alloc-id:fake -15069 Single-int-var-in-esi/imm32/outputs -15070 0x11/imm32/alloc-id:fake -15071 _string_be_copy_to_esi/imm32/subx-name -15072 0/imm32/no-rm32 -15073 0/imm32/no-r32 -15074 1/imm32/imm32-is-first-inout -15075 0/imm32/no-disp32 -15076 1/imm32/output-is-write-only -15077 0x11/imm32/alloc-id:fake -15078 _Primitive-copy-to-edi/imm32/next -15079 _Primitive-copy-to-edi: # (payload primitive) -15080 0x11/imm32/alloc-id:fake:payload -15081 # var/edi <- copy lit => bf/copy-to-edi lit/imm32 -15082 0x11/imm32/alloc-id:fake -15083 _string-copy/imm32/name -15084 0x11/imm32/alloc-id:fake -15085 Single-lit-var/imm32/inouts -15086 0x11/imm32/alloc-id:fake -15087 Single-int-var-in-edi/imm32/outputs -15088 0x11/imm32/alloc-id:fake -15089 _string_bf_copy_to_edi/imm32/subx-name -15090 0/imm32/no-rm32 -15091 0/imm32/no-r32 -15092 1/imm32/imm32-is-first-inout -15093 0/imm32/no-disp32 -15094 1/imm32/output-is-write-only -15095 0x11/imm32/alloc-id:fake -15096 _Primitive-copy-reg-to-reg/imm32/next -15097 _Primitive-copy-reg-to-reg: # (payload primitive) -15098 0x11/imm32/alloc-id:fake:payload -15099 # var1/reg <- copy var2/reg => 89/<- var1/rm32 var2/r32 -15100 0x11/imm32/alloc-id:fake -15101 _string-copy/imm32/name -15102 0x11/imm32/alloc-id:fake -15103 Single-int-var-in-some-register/imm32/inouts -15104 0x11/imm32/alloc-id:fake -15105 Single-int-var-in-some-register/imm32/outputs -15106 0x11/imm32/alloc-id:fake -15107 _string_89_<-/imm32/subx-name -15108 3/imm32/rm32-is-first-output -15109 1/imm32/r32-is-first-inout -15110 0/imm32/no-imm32 -15111 0/imm32/no-disp32 -15112 1/imm32/output-is-write-only +14997 _Primitive-and-with-eax/imm32/next +14998 # - and +14999 _Primitive-and-with-eax: # (payload primitive) +15000 0x11/imm32/alloc-id:fake:payload +15001 # var/eax <- and lit => 25/and-with-eax lit/imm32 +15002 0x11/imm32/alloc-id:fake +15003 _string-and/imm32/name +15004 0x11/imm32/alloc-id:fake +15005 Single-lit-var/imm32/inouts +15006 0x11/imm32/alloc-id:fake +15007 Single-int-var-in-eax/imm32/outputs +15008 0x11/imm32/alloc-id:fake +15009 _string_25_and_with_eax/imm32/subx-name +15010 0/imm32/no-rm32 +15011 0/imm32/no-r32 +15012 1/imm32/imm32-is-first-inout +15013 0/imm32/no-disp32 +15014 0/imm32/output-is-write-only +15015 0x11/imm32/alloc-id:fake +15016 _Primitive-and-reg-with-reg/imm32/next +15017 _Primitive-and-reg-with-reg: # (payload primitive) +15018 0x11/imm32/alloc-id:fake:payload +15019 # var1/reg <- and var2/reg => 21/and-with var1/rm32 var2/r32 +15020 0x11/imm32/alloc-id:fake +15021 _string-and/imm32/name +15022 0x11/imm32/alloc-id:fake +15023 Single-int-var-in-some-register/imm32/inouts +15024 0x11/imm32/alloc-id:fake +15025 Single-int-var-in-some-register/imm32/outputs +15026 0x11/imm32/alloc-id:fake +15027 _string_21_and_with/imm32/subx-name +15028 3/imm32/rm32-is-first-output +15029 1/imm32/r32-is-first-inout +15030 0/imm32/no-imm32 +15031 0/imm32/no-disp32 +15032 0/imm32/output-is-write-only +15033 0x11/imm32/alloc-id:fake +15034 _Primitive-and-reg-with-mem/imm32/next +15035 _Primitive-and-reg-with-mem: # (payload primitive) +15036 0x11/imm32/alloc-id:fake:payload +15037 # and-with var1 var2/reg => 21/and-with var1 var2/r32 +15038 0x11/imm32/alloc-id:fake +15039 _string-and-with/imm32/name +15040 0x11/imm32/alloc-id:fake +15041 Two-args-int-stack-int-reg/imm32/inouts +15042 0/imm32/no-outputs +15043 0/imm32/no-outputs +15044 0x11/imm32/alloc-id:fake +15045 _string_21_and_with/imm32/subx-name +15046 1/imm32/rm32-is-first-inout +15047 2/imm32/r32-is-second-inout +15048 0/imm32/no-imm32 +15049 0/imm32/no-disp32 +15050 0/imm32/output-is-write-only +15051 0x11/imm32/alloc-id:fake +15052 _Primitive-and-mem-with-reg/imm32/next +15053 _Primitive-and-mem-with-reg: # (payload primitive) +15054 0x11/imm32/alloc-id:fake:payload +15055 # var1/reg <- and var2 => 23/and var2/rm32 var1/r32 +15056 0x11/imm32/alloc-id:fake +15057 _string-and/imm32/name +15058 0x11/imm32/alloc-id:fake +15059 Single-int-var-in-mem/imm32/inouts +15060 0x11/imm32/alloc-id:fake +15061 Single-int-var-in-some-register/imm32/outputs +15062 0x11/imm32/alloc-id:fake +15063 _string_23_and/imm32/subx-name +15064 1/imm32/rm32-is-first-inout +15065 3/imm32/r32-is-first-output +15066 0/imm32/no-imm32 +15067 0/imm32/no-disp32 +15068 0/imm32/output-is-write-only +15069 0x11/imm32/alloc-id:fake +15070 _Primitive-and-lit-with-reg/imm32/next +15071 _Primitive-and-lit-with-reg: # (payload primitive) +15072 0x11/imm32/alloc-id:fake:payload +15073 # var1/reg <- and lit => 81 4/subop/and var1/rm32 lit/imm32 +15074 0x11/imm32/alloc-id:fake +15075 _string-and/imm32/name +15076 0x11/imm32/alloc-id:fake +15077 Single-lit-var/imm32/inouts +15078 0x11/imm32/alloc-id:fake +15079 Single-int-var-in-some-register/imm32/outputs +15080 0x11/imm32/alloc-id:fake +15081 _string_81_subop_and/imm32/subx-name +15082 3/imm32/rm32-is-first-output +15083 0/imm32/no-r32 +15084 1/imm32/imm32-is-first-inout +15085 0/imm32/no-disp32 +15086 0/imm32/output-is-write-only +15087 0x11/imm32/alloc-id:fake +15088 _Primitive-and-lit-with-mem/imm32/next +15089 _Primitive-and-lit-with-mem: # (payload primitive) +15090 0x11/imm32/alloc-id:fake:payload +15091 # and-with var1, lit => 81 4/subop/and var1/rm32 lit/imm32 +15092 0x11/imm32/alloc-id:fake +15093 _string-and-with/imm32/name +15094 0x11/imm32/alloc-id:fake +15095 Int-var-and-literal/imm32/inouts +15096 0/imm32/no-outputs +15097 0/imm32/no-outputs +15098 0x11/imm32/alloc-id:fake +15099 _string_81_subop_and/imm32/subx-name +15100 1/imm32/rm32-is-first-inout +15101 0/imm32/no-r32 +15102 2/imm32/imm32-is-first-inout +15103 0/imm32/no-disp32 +15104 0/imm32/output-is-write-only +15105 0x11/imm32/alloc-id:fake +15106 _Primitive-or-with-eax/imm32/next +15107 # - or +15108 _Primitive-or-with-eax: # (payload primitive) +15109 0x11/imm32/alloc-id:fake:payload +15110 # var/eax <- or lit => 0d/or-with-eax lit/imm32 +15111 0x11/imm32/alloc-id:fake +15112 _string-or/imm32/name 15113 0x11/imm32/alloc-id:fake -15114 _Primitive-copy-reg-to-mem/imm32/next -15115 _Primitive-copy-reg-to-mem: # (payload primitive) -15116 0x11/imm32/alloc-id:fake:payload -15117 # copy-to var1 var2/reg => 89/<- var1 var2/r32 -15118 0x11/imm32/alloc-id:fake -15119 _string-copy-to/imm32/name -15120 0x11/imm32/alloc-id:fake -15121 Two-args-int-stack-int-reg/imm32/inouts -15122 0/imm32/no-outputs -15123 0/imm32/no-outputs +15114 Single-lit-var/imm32/inouts +15115 0x11/imm32/alloc-id:fake +15116 Single-int-var-in-eax/imm32/outputs +15117 0x11/imm32/alloc-id:fake +15118 _string_0d_or_with_eax/imm32/subx-name +15119 0/imm32/no-rm32 +15120 0/imm32/no-r32 +15121 1/imm32/imm32-is-first-inout +15122 0/imm32/no-disp32 +15123 0/imm32/output-is-write-only 15124 0x11/imm32/alloc-id:fake -15125 _string_89_<-/imm32/subx-name -15126 1/imm32/rm32-is-first-inout -15127 2/imm32/r32-is-second-inout -15128 0/imm32/no-imm32 -15129 0/imm32/no-disp32 -15130 1/imm32/output-is-write-only +15125 _Primitive-or-reg-with-reg/imm32/next +15126 _Primitive-or-reg-with-reg: # (payload primitive) +15127 0x11/imm32/alloc-id:fake:payload +15128 # var1/reg <- or var2/reg => 09/or-with var1/rm32 var2/r32 +15129 0x11/imm32/alloc-id:fake +15130 _string-or/imm32/name 15131 0x11/imm32/alloc-id:fake -15132 _Primitive-copy-mem-to-reg/imm32/next -15133 _Primitive-copy-mem-to-reg: # (payload primitive) -15134 0x11/imm32/alloc-id:fake:payload -15135 # var1/reg <- copy var2 => 8b/-> var2/rm32 var1/r32 -15136 0x11/imm32/alloc-id:fake -15137 _string-copy/imm32/name -15138 0x11/imm32/alloc-id:fake -15139 Single-int-var-in-mem/imm32/inouts -15140 0x11/imm32/alloc-id:fake -15141 Single-int-var-in-some-register/imm32/outputs +15132 Single-int-var-in-some-register/imm32/inouts +15133 0x11/imm32/alloc-id:fake +15134 Single-int-var-in-some-register/imm32/outputs +15135 0x11/imm32/alloc-id:fake +15136 _string_09_or_with/imm32/subx-name +15137 3/imm32/rm32-is-first-output +15138 1/imm32/r32-is-first-inout +15139 0/imm32/no-imm32 +15140 0/imm32/no-disp32 +15141 0/imm32/output-is-write-only 15142 0x11/imm32/alloc-id:fake -15143 _string_8b_->/imm32/subx-name -15144 1/imm32/rm32-is-first-inout -15145 3/imm32/r32-is-first-output -15146 0/imm32/no-imm32 -15147 0/imm32/no-disp32 -15148 1/imm32/output-is-write-only +15143 _Primitive-or-reg-with-mem/imm32/next +15144 _Primitive-or-reg-with-mem: # (payload primitive) +15145 0x11/imm32/alloc-id:fake:payload +15146 # or-with var1 var2/reg => 09/or-with var1 var2/r32 +15147 0x11/imm32/alloc-id:fake +15148 _string-or-with/imm32/name 15149 0x11/imm32/alloc-id:fake -15150 _Primitive-copy-lit-to-reg/imm32/next -15151 _Primitive-copy-lit-to-reg: # (payload primitive) -15152 0x11/imm32/alloc-id:fake:payload -15153 # var1/reg <- copy lit => c7 0/subop/copy var1/rm32 lit/imm32 -15154 0x11/imm32/alloc-id:fake -15155 _string-copy/imm32/name -15156 0x11/imm32/alloc-id:fake -15157 Single-lit-var/imm32/inouts -15158 0x11/imm32/alloc-id:fake -15159 Single-int-var-in-some-register/imm32/outputs +15150 Two-args-int-stack-int-reg/imm32/inouts +15151 0/imm32/no-outputs +15152 0/imm32/no-outputs +15153 0x11/imm32/alloc-id:fake +15154 _string_09_or_with/imm32/subx-name +15155 1/imm32/rm32-is-first-inout +15156 2/imm32/r32-is-second-inout +15157 0/imm32/no-imm32 +15158 0/imm32/no-disp32 +15159 0/imm32/output-is-write-only 15160 0x11/imm32/alloc-id:fake -15161 _string_c7_subop_copy/imm32/subx-name -15162 3/imm32/rm32-is-first-output -15163 0/imm32/no-r32 -15164 1/imm32/imm32-is-first-inout -15165 0/imm32/no-disp32 -15166 1/imm32/output-is-write-only +15161 _Primitive-or-mem-with-reg/imm32/next +15162 _Primitive-or-mem-with-reg: # (payload primitive) +15163 0x11/imm32/alloc-id:fake:payload +15164 # var1/reg <- or var2 => 0b/or var2/rm32 var1/r32 +15165 0x11/imm32/alloc-id:fake +15166 _string-or/imm32/name 15167 0x11/imm32/alloc-id:fake -15168 _Primitive-copy-lit-to-mem/imm32/next -15169 _Primitive-copy-lit-to-mem: # (payload primitive) -15170 0x11/imm32/alloc-id:fake:payload -15171 # copy-to var1, lit => c7 0/subop/copy var1/rm32 lit/imm32 -15172 0x11/imm32/alloc-id:fake -15173 _string-copy-to/imm32/name -15174 0x11/imm32/alloc-id:fake -15175 Int-var-and-literal/imm32/inouts -15176 0/imm32/no-outputs -15177 0/imm32/no-outputs +15168 Single-int-var-in-mem/imm32/inouts +15169 0x11/imm32/alloc-id:fake +15170 Single-int-var-in-some-register/imm32/outputs +15171 0x11/imm32/alloc-id:fake +15172 _string_0b_or/imm32/subx-name +15173 1/imm32/rm32-is-first-inout +15174 3/imm32/r32-is-first-output +15175 0/imm32/no-imm32 +15176 0/imm32/no-disp32 +15177 0/imm32/output-is-write-only 15178 0x11/imm32/alloc-id:fake -15179 _string_c7_subop_copy/imm32/subx-name -15180 1/imm32/rm32-is-first-inout -15181 0/imm32/no-r32 -15182 2/imm32/imm32-is-first-inout -15183 0/imm32/no-disp32 -15184 1/imm32/output-is-write-only +15179 _Primitive-or-lit-with-reg/imm32/next +15180 _Primitive-or-lit-with-reg: # (payload primitive) +15181 0x11/imm32/alloc-id:fake:payload +15182 # var1/reg <- or lit => 81 1/subop/or var1/rm32 lit/imm32 +15183 0x11/imm32/alloc-id:fake +15184 _string-or/imm32/name 15185 0x11/imm32/alloc-id:fake -15186 _Primitive-copy-byte-from-reg/imm32/next -15187 # - copy byte -15188 _Primitive-copy-byte-from-reg: -15189 0x11/imm32/alloc-id:fake:payload -15190 # var/reg <- copy-byte var2/reg2 => 8a/byte-> %var2 var/r32 -15191 0x11/imm32/alloc-id:fake -15192 _string-copy-byte/imm32/name -15193 0x11/imm32/alloc-id:fake -15194 Single-byte-var-in-some-register/imm32/inouts -15195 0x11/imm32/alloc-id:fake -15196 Single-byte-var-in-some-register/imm32/outputs -15197 0x11/imm32/alloc-id:fake -15198 _string_8a_copy_byte/imm32/subx-name -15199 1/imm32/rm32-is-first-inout -15200 3/imm32/r32-is-first-output -15201 0/imm32/no-imm32 -15202 0/imm32/no-disp32 -15203 1/imm32/output-is-write-only -15204 0x11/imm32/alloc-id:fake -15205 _Primitive-copy-byte-from-mem/imm32/next -15206 _Primitive-copy-byte-from-mem: -15207 0x11/imm32/alloc-id:fake:payload -15208 # var/reg <- copy-byte *var2/reg2 => 8a/byte-> *var2 var/r32 -15209 0x11/imm32/alloc-id:fake -15210 _string-copy-byte/imm32/name -15211 0x11/imm32/alloc-id:fake -15212 Single-byte-var-in-mem/imm32/inouts -15213 0x11/imm32/alloc-id:fake -15214 Single-byte-var-in-some-register/imm32/outputs -15215 0x11/imm32/alloc-id:fake -15216 _string_8a_copy_byte/imm32/subx-name -15217 1/imm32/rm32-is-first-inout -15218 3/imm32/r32-is-first-output -15219 0/imm32/no-imm32 -15220 0/imm32/no-disp32 -15221 1/imm32/output-is-write-only +15186 Single-lit-var/imm32/inouts +15187 0x11/imm32/alloc-id:fake +15188 Single-int-var-in-some-register/imm32/outputs +15189 0x11/imm32/alloc-id:fake +15190 _string_81_subop_or/imm32/subx-name +15191 3/imm32/rm32-is-first-output +15192 0/imm32/no-r32 +15193 1/imm32/imm32-is-first-inout +15194 0/imm32/no-disp32 +15195 0/imm32/output-is-write-only +15196 0x11/imm32/alloc-id:fake +15197 _Primitive-or-lit-with-mem/imm32/next +15198 _Primitive-or-lit-with-mem: # (payload primitive) +15199 0x11/imm32/alloc-id:fake:payload +15200 # or-with var1, lit => 81 1/subop/or var1/rm32 lit/imm32 +15201 0x11/imm32/alloc-id:fake +15202 _string-or-with/imm32/name +15203 0x11/imm32/alloc-id:fake +15204 Int-var-and-literal/imm32/inouts +15205 0/imm32/no-outputs +15206 0/imm32/no-outputs +15207 0x11/imm32/alloc-id:fake +15208 _string_81_subop_or/imm32/subx-name +15209 1/imm32/rm32-is-first-inout +15210 0/imm32/no-r32 +15211 2/imm32/imm32-is-second-inout +15212 0/imm32/no-disp32 +15213 0/imm32/output-is-write-only +15214 0x11/imm32/alloc-id:fake +15215 _Primitive-xor-with-eax/imm32/next +15216 # - xor +15217 _Primitive-xor-with-eax: # (payload primitive) +15218 0x11/imm32/alloc-id:fake:payload +15219 # var/eax <- xor lit => 35/xor-with-eax lit/imm32 +15220 0x11/imm32/alloc-id:fake +15221 _string-xor/imm32/name 15222 0x11/imm32/alloc-id:fake -15223 _Primitive-copy-byte-to-mem/imm32/next -15224 _Primitive-copy-byte-to-mem: -15225 0x11/imm32/alloc-id:fake:payload -15226 # copy-byte-to *var1/reg1, var2/reg2 => 88/byte<- *reg1 reg2/r32 -15227 0x11/imm32/alloc-id:fake -15228 _string-copy-byte-to/imm32/name -15229 0x11/imm32/alloc-id:fake -15230 Two-args-byte-stack-byte-reg/imm32/inouts -15231 0/imm32/no-outputs -15232 0/imm32/no-outputs +15223 Single-lit-var/imm32/inouts +15224 0x11/imm32/alloc-id:fake +15225 Single-int-var-in-eax/imm32/outputs +15226 0x11/imm32/alloc-id:fake +15227 _string_35_xor_with_eax/imm32/subx-name +15228 0/imm32/no-rm32 +15229 0/imm32/no-r32 +15230 1/imm32/imm32-is-first-inout +15231 0/imm32/no-disp32 +15232 0/imm32/output-is-write-only 15233 0x11/imm32/alloc-id:fake -15234 _string_88_copy_byte/imm32/subx-name -15235 1/imm32/rm32-is-first-inout -15236 2/imm32/r32-is-second-inout -15237 0/imm32/no-imm32 -15238 0/imm32/no-disp32 -15239 0/imm32/output-is-write-only +15234 _Primitive-xor-reg-with-reg/imm32/next +15235 _Primitive-xor-reg-with-reg: # (payload primitive) +15236 0x11/imm32/alloc-id:fake:payload +15237 # var1/reg <- xor var2/reg => 31/xor-with var1/rm32 var2/r32 +15238 0x11/imm32/alloc-id:fake +15239 _string-xor/imm32/name 15240 0x11/imm32/alloc-id:fake -15241 _Primitive-address/imm32/next -15242 # - address -15243 _Primitive-address: # (payload primitive) -15244 0x11/imm32/alloc-id:fake:payload -15245 # var1/reg <- address var2 => 8d/copy-address var2/rm32 var1/r32 -15246 0x11/imm32/alloc-id:fake -15247 _string-address/imm32/name -15248 0x11/imm32/alloc-id:fake -15249 Single-int-var-in-mem/imm32/inouts -15250 0x11/imm32/alloc-id:fake -15251 Single-addr-var-in-some-register/imm32/outputs -15252 0x11/imm32/alloc-id:fake -15253 _string_8d_copy_address/imm32/subx-name -15254 1/imm32/rm32-is-first-inout -15255 3/imm32/r32-is-first-output -15256 0/imm32/no-imm32 -15257 0/imm32/no-disp32 -15258 1/imm32/output-is-write-only -15259 0x11/imm32/alloc-id:fake -15260 _Primitive-compare-reg-with-reg/imm32/next -15261 # - compare -15262 _Primitive-compare-reg-with-reg: # (payload primitive) -15263 0x11/imm32/alloc-id:fake:payload -15264 # compare var1/reg1 var2/reg2 => 39/compare var1/rm32 var2/r32 -15265 0x11/imm32/alloc-id:fake -15266 _string-compare/imm32/name -15267 0x11/imm32/alloc-id:fake -15268 Two-int-args-in-regs/imm32/inouts -15269 0/imm32/no-outputs -15270 0/imm32/no-outputs -15271 0x11/imm32/alloc-id:fake -15272 _string_39_compare->/imm32/subx-name -15273 1/imm32/rm32-is-first-inout -15274 2/imm32/r32-is-second-inout -15275 0/imm32/no-imm32 -15276 0/imm32/no-disp32 -15277 0/imm32/output-is-write-only +15241 Single-int-var-in-some-register/imm32/inouts +15242 0x11/imm32/alloc-id:fake +15243 Single-int-var-in-some-register/imm32/outputs +15244 0x11/imm32/alloc-id:fake +15245 _string_31_xor_with/imm32/subx-name +15246 3/imm32/rm32-is-first-output +15247 1/imm32/r32-is-first-inout +15248 0/imm32/no-imm32 +15249 0/imm32/no-disp32 +15250 0/imm32/output-is-write-only +15251 0x11/imm32/alloc-id:fake +15252 _Primitive-xor-reg-with-mem/imm32/next +15253 _Primitive-xor-reg-with-mem: # (payload primitive) +15254 0x11/imm32/alloc-id:fake:payload +15255 # xor-with var1 var2/reg => 31/xor-with var1 var2/r32 +15256 0x11/imm32/alloc-id:fake +15257 _string-xor-with/imm32/name +15258 0x11/imm32/alloc-id:fake +15259 Two-args-int-stack-int-reg/imm32/inouts +15260 0/imm32/no-outputs +15261 0/imm32/no-outputs +15262 0x11/imm32/alloc-id:fake +15263 _string_31_xor_with/imm32/subx-name +15264 1/imm32/rm32-is-first-inout +15265 2/imm32/r32-is-second-inout +15266 0/imm32/no-imm32 +15267 0/imm32/no-disp32 +15268 0/imm32/output-is-write-only +15269 0x11/imm32/alloc-id:fake +15270 _Primitive-xor-mem-with-reg/imm32/next +15271 _Primitive-xor-mem-with-reg: # (payload primitive) +15272 0x11/imm32/alloc-id:fake:payload +15273 # var1/reg <- xor var2 => 33/xor var2/rm32 var1/r32 +15274 0x11/imm32/alloc-id:fake +15275 _string-xor/imm32/name +15276 0x11/imm32/alloc-id:fake +15277 Single-int-var-in-mem/imm32/inouts 15278 0x11/imm32/alloc-id:fake -15279 _Primitive-compare-mem-with-reg/imm32/next -15280 _Primitive-compare-mem-with-reg: # (payload primitive) -15281 0x11/imm32/alloc-id:fake:payload -15282 # compare var1 var2/reg => 39/compare var1/rm32 var2/r32 -15283 0x11/imm32/alloc-id:fake -15284 _string-compare/imm32/name -15285 0x11/imm32/alloc-id:fake -15286 Two-args-int-stack-int-reg/imm32/inouts -15287 0/imm32/no-outputs -15288 0/imm32/no-outputs -15289 0x11/imm32/alloc-id:fake -15290 _string_39_compare->/imm32/subx-name -15291 1/imm32/rm32-is-first-inout -15292 2/imm32/r32-is-second-inout -15293 0/imm32/no-imm32 -15294 0/imm32/no-disp32 -15295 0/imm32/output-is-write-only +15279 Single-int-var-in-some-register/imm32/outputs +15280 0x11/imm32/alloc-id:fake +15281 _string_33_xor/imm32/subx-name +15282 1/imm32/rm32-is-first-inout +15283 3/imm32/r32-is-first-output +15284 0/imm32/no-imm32 +15285 0/imm32/no-disp32 +15286 0/imm32/output-is-write-only +15287 0x11/imm32/alloc-id:fake +15288 _Primitive-xor-lit-with-reg/imm32/next +15289 _Primitive-xor-lit-with-reg: # (payload primitive) +15290 0x11/imm32/alloc-id:fake:payload +15291 # var1/reg <- xor lit => 81 6/subop/xor var1/rm32 lit/imm32 +15292 0x11/imm32/alloc-id:fake +15293 _string-xor/imm32/name +15294 0x11/imm32/alloc-id:fake +15295 Single-lit-var/imm32/inouts 15296 0x11/imm32/alloc-id:fake -15297 _Primitive-compare-reg-with-mem/imm32/next -15298 _Primitive-compare-reg-with-mem: # (payload primitive) -15299 0x11/imm32/alloc-id:fake:payload -15300 # compare var1/reg var2 => 3b/compare<- var2/rm32 var1/r32 -15301 0x11/imm32/alloc-id:fake -15302 _string-compare/imm32/name -15303 0x11/imm32/alloc-id:fake -15304 Two-args-int-reg-int-stack/imm32/inouts -15305 0/imm32/no-outputs -15306 0/imm32/no-outputs -15307 0x11/imm32/alloc-id:fake -15308 _string_3b_compare<-/imm32/subx-name -15309 2/imm32/rm32-is-second-inout -15310 1/imm32/r32-is-first-inout -15311 0/imm32/no-imm32 -15312 0/imm32/no-disp32 -15313 0/imm32/output-is-write-only -15314 0x11/imm32/alloc-id:fake -15315 _Primitive-compare-eax-with-literal/imm32/next -15316 _Primitive-compare-eax-with-literal: # (payload primitive) -15317 0x11/imm32/alloc-id:fake:payload -15318 # compare var1/eax n => 3d/compare-eax-with n/imm32 -15319 0x11/imm32/alloc-id:fake -15320 _string-compare/imm32/name -15321 0x11/imm32/alloc-id:fake -15322 Two-args-int-eax-int-literal/imm32/inouts -15323 0/imm32/no-outputs -15324 0/imm32/no-outputs -15325 0x11/imm32/alloc-id:fake -15326 _string_3d_compare_eax_with/imm32/subx-name -15327 0/imm32/no-rm32 -15328 0/imm32/no-r32 -15329 2/imm32/imm32-is-second-inout -15330 0/imm32/no-disp32 -15331 0/imm32/output-is-write-only -15332 0x11/imm32/alloc-id:fake -15333 _Primitive-compare-reg-with-literal/imm32/next -15334 _Primitive-compare-reg-with-literal: # (payload primitive) -15335 0x11/imm32/alloc-id:fake:payload -15336 # compare var1/reg n => 81 7/subop/compare %reg n/imm32 -15337 0x11/imm32/alloc-id:fake -15338 _string-compare/imm32/name -15339 0x11/imm32/alloc-id:fake -15340 Int-var-in-register-and-literal/imm32/inouts -15341 0/imm32/no-outputs -15342 0/imm32/no-outputs -15343 0x11/imm32/alloc-id:fake -15344 _string_81_subop_compare/imm32/subx-name -15345 1/imm32/rm32-is-first-inout -15346 0/imm32/no-r32 -15347 2/imm32/imm32-is-second-inout -15348 0/imm32/no-disp32 -15349 0/imm32/output-is-write-only -15350 0x11/imm32/alloc-id:fake -15351 _Primitive-compare-mem-with-literal/imm32/next -15352 _Primitive-compare-mem-with-literal: # (payload primitive) -15353 0x11/imm32/alloc-id:fake:payload -15354 # compare var1 n => 81 7/subop/compare *(ebp+___) n/imm32 -15355 0x11/imm32/alloc-id:fake -15356 _string-compare/imm32/name -15357 0x11/imm32/alloc-id:fake -15358 Int-var-and-literal/imm32/inouts -15359 0/imm32/no-outputs -15360 0/imm32/no-outputs -15361 0x11/imm32/alloc-id:fake -15362 _string_81_subop_compare/imm32/subx-name -15363 1/imm32/rm32-is-first-inout -15364 0/imm32/no-r32 -15365 2/imm32/imm32-is-second-inout -15366 0/imm32/no-disp32 -15367 0/imm32/output-is-write-only -15368 0x11/imm32/alloc-id:fake -15369 _Primitive-multiply-reg-by-reg/imm32/next -15370 # - multiply -15371 _Primitive-multiply-reg-by-reg: # (payload primitive) -15372 0x11/imm32/alloc-id:fake:payload -15373 # var1/reg <- multiply var2 => 0f af/multiply var2/rm32 var1/r32 -15374 0x11/imm32/alloc-id:fake -15375 _string-multiply/imm32/name -15376 0x11/imm32/alloc-id:fake -15377 Single-int-var-in-some-register/imm32/inouts +15297 Single-int-var-in-some-register/imm32/outputs +15298 0x11/imm32/alloc-id:fake +15299 _string_81_subop_xor/imm32/subx-name +15300 3/imm32/rm32-is-first-output +15301 0/imm32/no-r32 +15302 1/imm32/imm32-is-first-inout +15303 0/imm32/no-disp32 +15304 0/imm32/output-is-write-only +15305 0x11/imm32/alloc-id:fake +15306 _Primitive-xor-lit-with-mem/imm32/next +15307 _Primitive-xor-lit-with-mem: # (payload primitive) +15308 0x11/imm32/alloc-id:fake:payload +15309 # xor-with var1, lit => 81 6/subop/xor var1/rm32 lit/imm32 +15310 0x11/imm32/alloc-id:fake +15311 _string-xor-with/imm32/name +15312 0x11/imm32/alloc-id:fake +15313 Int-var-and-literal/imm32/inouts +15314 0/imm32/no-outputs +15315 0/imm32/no-outputs +15316 0x11/imm32/alloc-id:fake +15317 _string_81_subop_xor/imm32/subx-name +15318 1/imm32/rm32-is-first-inout +15319 0/imm32/no-r32 +15320 2/imm32/imm32-is-first-inout +15321 0/imm32/no-disp32 +15322 0/imm32/output-is-write-only +15323 0x11/imm32/alloc-id:fake +15324 _Primitive-copy-to-eax/imm32/next +15325 # - copy +15326 _Primitive-copy-to-eax: # (payload primitive) +15327 0x11/imm32/alloc-id:fake:payload +15328 # var/eax <- copy lit => b8/copy-to-eax lit/imm32 +15329 0x11/imm32/alloc-id:fake +15330 _string-copy/imm32/name +15331 0x11/imm32/alloc-id:fake +15332 Single-lit-var/imm32/inouts +15333 0x11/imm32/alloc-id:fake +15334 Single-int-var-in-eax/imm32/outputs +15335 0x11/imm32/alloc-id:fake +15336 _string_b8_copy_to_eax/imm32/subx-name +15337 0/imm32/no-rm32 +15338 0/imm32/no-r32 +15339 1/imm32/imm32-is-first-inout +15340 0/imm32/no-disp32 +15341 1/imm32/output-is-write-only +15342 0x11/imm32/alloc-id:fake +15343 _Primitive-copy-to-ecx/imm32/next +15344 _Primitive-copy-to-ecx: # (payload primitive) +15345 0x11/imm32/alloc-id:fake:payload +15346 # var/ecx <- copy lit => b9/copy-to-ecx lit/imm32 +15347 0x11/imm32/alloc-id:fake +15348 _string-copy/imm32/name +15349 0x11/imm32/alloc-id:fake +15350 Single-lit-var/imm32/inouts +15351 0x11/imm32/alloc-id:fake +15352 Single-int-var-in-ecx/imm32/outputs +15353 0x11/imm32/alloc-id:fake +15354 _string_b9_copy_to_ecx/imm32/subx-name +15355 0/imm32/no-rm32 +15356 0/imm32/no-r32 +15357 1/imm32/imm32-is-first-inout +15358 0/imm32/no-disp32 +15359 1/imm32/output-is-write-only +15360 0x11/imm32/alloc-id:fake +15361 _Primitive-copy-to-edx/imm32/next +15362 _Primitive-copy-to-edx: # (payload primitive) +15363 0x11/imm32/alloc-id:fake:payload +15364 # var/edx <- copy lit => ba/copy-to-edx lit/imm32 +15365 0x11/imm32/alloc-id:fake +15366 _string-copy/imm32/name +15367 0x11/imm32/alloc-id:fake +15368 Single-lit-var/imm32/inouts +15369 0x11/imm32/alloc-id:fake +15370 Single-int-var-in-edx/imm32/outputs +15371 0x11/imm32/alloc-id:fake +15372 _string_ba_copy_to_edx/imm32/subx-name +15373 0/imm32/no-rm32 +15374 0/imm32/no-r32 +15375 1/imm32/imm32-is-first-inout +15376 0/imm32/no-disp32 +15377 1/imm32/output-is-write-only 15378 0x11/imm32/alloc-id:fake -15379 Single-int-var-in-some-register/imm32/outputs -15380 0x11/imm32/alloc-id:fake -15381 _string_0f_af_multiply/imm32/subx-name -15382 1/imm32/rm32-is-first-inout -15383 3/imm32/r32-is-first-output -15384 0/imm32/no-imm32 -15385 0/imm32/no-disp32 -15386 0/imm32/output-is-write-only +15379 _Primitive-copy-to-ebx/imm32/next +15380 _Primitive-copy-to-ebx: # (payload primitive) +15381 0x11/imm32/alloc-id:fake:payload +15382 # var/ebx <- copy lit => bb/copy-to-ebx lit/imm32 +15383 0x11/imm32/alloc-id:fake +15384 _string-copy/imm32/name +15385 0x11/imm32/alloc-id:fake +15386 Single-lit-var/imm32/inouts 15387 0x11/imm32/alloc-id:fake -15388 _Primitive-multiply-reg-by-mem/imm32/next -15389 _Primitive-multiply-reg-by-mem: # (payload primitive) -15390 0x11/imm32/alloc-id:fake:payload -15391 # var1/reg <- multiply var2 => 0f af/multiply var2/rm32 var1/r32 -15392 0x11/imm32/alloc-id:fake -15393 _string-multiply/imm32/name -15394 0x11/imm32/alloc-id:fake -15395 Single-int-var-in-mem/imm32/inouts +15388 Single-int-var-in-ebx/imm32/outputs +15389 0x11/imm32/alloc-id:fake +15390 _string_bb_copy_to_ebx/imm32/subx-name +15391 0/imm32/no-rm32 +15392 0/imm32/no-r32 +15393 1/imm32/imm32-is-first-inout +15394 0/imm32/no-disp32 +15395 1/imm32/output-is-write-only 15396 0x11/imm32/alloc-id:fake -15397 Single-int-var-in-some-register/imm32/outputs -15398 0x11/imm32/alloc-id:fake -15399 _string_0f_af_multiply/imm32/subx-name -15400 1/imm32/rm32-is-first-inout -15401 3/imm32/r32-is-first-output -15402 0/imm32/no-imm32 -15403 0/imm32/no-disp32 -15404 0/imm32/output-is-write-only +15397 _Primitive-copy-to-esi/imm32/next +15398 _Primitive-copy-to-esi: # (payload primitive) +15399 0x11/imm32/alloc-id:fake:payload +15400 # var/esi <- copy lit => be/copy-to-esi lit/imm32 +15401 0x11/imm32/alloc-id:fake +15402 _string-copy/imm32/name +15403 0x11/imm32/alloc-id:fake +15404 Single-lit-var/imm32/inouts 15405 0x11/imm32/alloc-id:fake -15406 _Primitive-break-if-addr</imm32/next -15407 # - branches -15408 _Primitive-break-if-addr<: # (payload primitive) -15409 0x11/imm32/alloc-id:fake:payload -15410 0x11/imm32/alloc-id:fake -15411 _string-break-if-addr</imm32/name -15412 0/imm32/no-inouts -15413 0/imm32/no-inouts -15414 0/imm32/no-outputs -15415 0/imm32/no-outputs -15416 0x11/imm32/alloc-id:fake -15417 _string_0f_82_jump_break/imm32/subx-name -15418 0/imm32/no-rm32 -15419 0/imm32/no-r32 -15420 0/imm32/no-imm32 -15421 0/imm32/no-disp32 -15422 0/imm32/no-output +15406 Single-int-var-in-esi/imm32/outputs +15407 0x11/imm32/alloc-id:fake +15408 _string_be_copy_to_esi/imm32/subx-name +15409 0/imm32/no-rm32 +15410 0/imm32/no-r32 +15411 1/imm32/imm32-is-first-inout +15412 0/imm32/no-disp32 +15413 1/imm32/output-is-write-only +15414 0x11/imm32/alloc-id:fake +15415 _Primitive-copy-to-edi/imm32/next +15416 _Primitive-copy-to-edi: # (payload primitive) +15417 0x11/imm32/alloc-id:fake:payload +15418 # var/edi <- copy lit => bf/copy-to-edi lit/imm32 +15419 0x11/imm32/alloc-id:fake +15420 _string-copy/imm32/name +15421 0x11/imm32/alloc-id:fake +15422 Single-lit-var/imm32/inouts 15423 0x11/imm32/alloc-id:fake -15424 _Primitive-break-if-addr>=/imm32/next -15425 _Primitive-break-if-addr>=: # (payload primitive) -15426 0x11/imm32/alloc-id:fake:payload -15427 0x11/imm32/alloc-id:fake -15428 _string-break-if-addr>=/imm32/name -15429 0/imm32/no-inouts -15430 0/imm32/no-inouts -15431 0/imm32/no-outputs -15432 0/imm32/no-outputs -15433 0x11/imm32/alloc-id:fake -15434 _string_0f_83_jump_break/imm32/subx-name -15435 0/imm32/no-rm32 -15436 0/imm32/no-r32 -15437 0/imm32/no-imm32 -15438 0/imm32/no-disp32 -15439 0/imm32/no-output -15440 0x11/imm32/alloc-id:fake -15441 _Primitive-break-if-=/imm32/next -15442 _Primitive-break-if-=: # (payload primitive) -15443 0x11/imm32/alloc-id:fake:payload -15444 0x11/imm32/alloc-id:fake -15445 _string-break-if-=/imm32/name -15446 0/imm32/no-inouts -15447 0/imm32/no-inouts -15448 0/imm32/no-outputs -15449 0/imm32/no-outputs +15424 Single-int-var-in-edi/imm32/outputs +15425 0x11/imm32/alloc-id:fake +15426 _string_bf_copy_to_edi/imm32/subx-name +15427 0/imm32/no-rm32 +15428 0/imm32/no-r32 +15429 1/imm32/imm32-is-first-inout +15430 0/imm32/no-disp32 +15431 1/imm32/output-is-write-only +15432 0x11/imm32/alloc-id:fake +15433 _Primitive-copy-reg-to-reg/imm32/next +15434 _Primitive-copy-reg-to-reg: # (payload primitive) +15435 0x11/imm32/alloc-id:fake:payload +15436 # var1/reg <- copy var2/reg => 89/<- var1/rm32 var2/r32 +15437 0x11/imm32/alloc-id:fake +15438 _string-copy/imm32/name +15439 0x11/imm32/alloc-id:fake +15440 Single-int-var-in-some-register/imm32/inouts +15441 0x11/imm32/alloc-id:fake +15442 Single-int-var-in-some-register/imm32/outputs +15443 0x11/imm32/alloc-id:fake +15444 _string_89_<-/imm32/subx-name +15445 3/imm32/rm32-is-first-output +15446 1/imm32/r32-is-first-inout +15447 0/imm32/no-imm32 +15448 0/imm32/no-disp32 +15449 1/imm32/output-is-write-only 15450 0x11/imm32/alloc-id:fake -15451 _string_0f_84_jump_break/imm32/subx-name -15452 0/imm32/no-rm32 -15453 0/imm32/no-r32 -15454 0/imm32/no-imm32 -15455 0/imm32/no-disp32 -15456 0/imm32/no-output +15451 _Primitive-copy-reg-to-mem/imm32/next +15452 _Primitive-copy-reg-to-mem: # (payload primitive) +15453 0x11/imm32/alloc-id:fake:payload +15454 # copy-to var1 var2/reg => 89/<- var1 var2/r32 +15455 0x11/imm32/alloc-id:fake +15456 _string-copy-to/imm32/name 15457 0x11/imm32/alloc-id:fake -15458 _Primitive-break-if-!=/imm32/next -15459 _Primitive-break-if-!=: # (payload primitive) -15460 0x11/imm32/alloc-id:fake:payload +15458 Two-args-int-stack-int-reg/imm32/inouts +15459 0/imm32/no-outputs +15460 0/imm32/no-outputs 15461 0x11/imm32/alloc-id:fake -15462 _string-break-if-!=/imm32/name -15463 0/imm32/no-inouts -15464 0/imm32/no-inouts -15465 0/imm32/no-outputs -15466 0/imm32/no-outputs -15467 0x11/imm32/alloc-id:fake -15468 _string_0f_85_jump_break/imm32/subx-name -15469 0/imm32/no-rm32 -15470 0/imm32/no-r32 -15471 0/imm32/no-imm32 -15472 0/imm32/no-disp32 -15473 0/imm32/no-output -15474 0x11/imm32/alloc-id:fake -15475 _Primitive-break-if-addr<=/imm32/next -15476 _Primitive-break-if-addr<=: # (payload primitive) -15477 0x11/imm32/alloc-id:fake:payload -15478 0x11/imm32/alloc-id:fake -15479 _string-break-if-addr<=/imm32/name -15480 0/imm32/no-inouts -15481 0/imm32/no-inouts -15482 0/imm32/no-outputs -15483 0/imm32/no-outputs -15484 0x11/imm32/alloc-id:fake -15485 _string_0f_86_jump_break/imm32/subx-name -15486 0/imm32/no-rm32 -15487 0/imm32/no-r32 -15488 0/imm32/no-imm32 -15489 0/imm32/no-disp32 -15490 0/imm32/no-output +15462 _string_89_<-/imm32/subx-name +15463 1/imm32/rm32-is-first-inout +15464 2/imm32/r32-is-second-inout +15465 0/imm32/no-imm32 +15466 0/imm32/no-disp32 +15467 1/imm32/output-is-write-only +15468 0x11/imm32/alloc-id:fake +15469 _Primitive-copy-mem-to-reg/imm32/next +15470 _Primitive-copy-mem-to-reg: # (payload primitive) +15471 0x11/imm32/alloc-id:fake:payload +15472 # var1/reg <- copy var2 => 8b/-> var2/rm32 var1/r32 +15473 0x11/imm32/alloc-id:fake +15474 _string-copy/imm32/name +15475 0x11/imm32/alloc-id:fake +15476 Single-int-var-in-mem/imm32/inouts +15477 0x11/imm32/alloc-id:fake +15478 Single-int-var-in-some-register/imm32/outputs +15479 0x11/imm32/alloc-id:fake +15480 _string_8b_->/imm32/subx-name +15481 1/imm32/rm32-is-first-inout +15482 3/imm32/r32-is-first-output +15483 0/imm32/no-imm32 +15484 0/imm32/no-disp32 +15485 1/imm32/output-is-write-only +15486 0x11/imm32/alloc-id:fake +15487 _Primitive-copy-lit-to-reg/imm32/next +15488 _Primitive-copy-lit-to-reg: # (payload primitive) +15489 0x11/imm32/alloc-id:fake:payload +15490 # var1/reg <- copy lit => c7 0/subop/copy var1/rm32 lit/imm32 15491 0x11/imm32/alloc-id:fake -15492 _Primitive-break-if-addr>/imm32/next -15493 _Primitive-break-if-addr>: # (payload primitive) -15494 0x11/imm32/alloc-id:fake:payload +15492 _string-copy/imm32/name +15493 0x11/imm32/alloc-id:fake +15494 Single-lit-var/imm32/inouts 15495 0x11/imm32/alloc-id:fake -15496 _string-break-if-addr>/imm32/name -15497 0/imm32/no-inouts -15498 0/imm32/no-inouts -15499 0/imm32/no-outputs -15500 0/imm32/no-outputs -15501 0x11/imm32/alloc-id:fake -15502 _string_0f_87_jump_break/imm32/subx-name -15503 0/imm32/no-rm32 -15504 0/imm32/no-r32 -15505 0/imm32/no-imm32 -15506 0/imm32/no-disp32 -15507 0/imm32/no-output -15508 0x11/imm32/alloc-id:fake -15509 _Primitive-break-if-</imm32/next -15510 _Primitive-break-if-<: # (payload primitive) -15511 0x11/imm32/alloc-id:fake:payload -15512 0x11/imm32/alloc-id:fake -15513 _string-break-if-</imm32/name -15514 0/imm32/no-inouts -15515 0/imm32/no-inouts -15516 0/imm32/no-outputs -15517 0/imm32/no-outputs -15518 0x11/imm32/alloc-id:fake -15519 _string_0f_8c_jump_break/imm32/subx-name -15520 0/imm32/no-rm32 -15521 0/imm32/no-r32 -15522 0/imm32/no-imm32 -15523 0/imm32/no-disp32 -15524 0/imm32/no-output -15525 0x11/imm32/alloc-id:fake -15526 _Primitive-break-if->=/imm32/next -15527 _Primitive-break-if->=: # (payload primitive) -15528 0x11/imm32/alloc-id:fake:payload -15529 0x11/imm32/alloc-id:fake -15530 _string-break-if->=/imm32/name -15531 0/imm32/no-inouts -15532 0/imm32/no-inouts -15533 0/imm32/no-outputs -15534 0/imm32/no-outputs -15535 0x11/imm32/alloc-id:fake -15536 _string_0f_8d_jump_break/imm32/subx-name -15537 0/imm32/no-rm32 -15538 0/imm32/no-r32 -15539 0/imm32/no-imm32 -15540 0/imm32/no-disp32 -15541 0/imm32/no-output -15542 0x11/imm32/alloc-id:fake -15543 _Primitive-break-if-<=/imm32/next -15544 _Primitive-break-if-<=: # (payload primitive) -15545 0x11/imm32/alloc-id:fake:payload +15496 Single-int-var-in-some-register/imm32/outputs +15497 0x11/imm32/alloc-id:fake +15498 _string_c7_subop_copy/imm32/subx-name +15499 3/imm32/rm32-is-first-output +15500 0/imm32/no-r32 +15501 1/imm32/imm32-is-first-inout +15502 0/imm32/no-disp32 +15503 1/imm32/output-is-write-only +15504 0x11/imm32/alloc-id:fake +15505 _Primitive-copy-lit-to-mem/imm32/next +15506 _Primitive-copy-lit-to-mem: # (payload primitive) +15507 0x11/imm32/alloc-id:fake:payload +15508 # copy-to var1, lit => c7 0/subop/copy var1/rm32 lit/imm32 +15509 0x11/imm32/alloc-id:fake +15510 _string-copy-to/imm32/name +15511 0x11/imm32/alloc-id:fake +15512 Int-var-and-literal/imm32/inouts +15513 0/imm32/no-outputs +15514 0/imm32/no-outputs +15515 0x11/imm32/alloc-id:fake +15516 _string_c7_subop_copy/imm32/subx-name +15517 1/imm32/rm32-is-first-inout +15518 0/imm32/no-r32 +15519 2/imm32/imm32-is-first-inout +15520 0/imm32/no-disp32 +15521 1/imm32/output-is-write-only +15522 0x11/imm32/alloc-id:fake +15523 _Primitive-copy-byte-from-reg/imm32/next +15524 # - copy byte +15525 _Primitive-copy-byte-from-reg: +15526 0x11/imm32/alloc-id:fake:payload +15527 # var/reg <- copy-byte var2/reg2 => 8a/byte-> %var2 var/r32 +15528 0x11/imm32/alloc-id:fake +15529 _string-copy-byte/imm32/name +15530 0x11/imm32/alloc-id:fake +15531 Single-byte-var-in-some-register/imm32/inouts +15532 0x11/imm32/alloc-id:fake +15533 Single-byte-var-in-some-register/imm32/outputs +15534 0x11/imm32/alloc-id:fake +15535 _string_8a_copy_byte/imm32/subx-name +15536 1/imm32/rm32-is-first-inout +15537 3/imm32/r32-is-first-output +15538 0/imm32/no-imm32 +15539 0/imm32/no-disp32 +15540 1/imm32/output-is-write-only +15541 0x11/imm32/alloc-id:fake +15542 _Primitive-copy-byte-from-mem/imm32/next +15543 _Primitive-copy-byte-from-mem: +15544 0x11/imm32/alloc-id:fake:payload +15545 # var/reg <- copy-byte *var2/reg2 => 8a/byte-> *var2 var/r32 15546 0x11/imm32/alloc-id:fake -15547 _string-break-if-<=/imm32/name -15548 0/imm32/no-inouts -15549 0/imm32/no-inouts -15550 0/imm32/no-outputs -15551 0/imm32/no-outputs +15547 _string-copy-byte/imm32/name +15548 0x11/imm32/alloc-id:fake +15549 Single-byte-var-in-mem/imm32/inouts +15550 0x11/imm32/alloc-id:fake +15551 Single-byte-var-in-some-register/imm32/outputs 15552 0x11/imm32/alloc-id:fake -15553 _string_0f_8e_jump_break/imm32/subx-name -15554 0/imm32/no-rm32 -15555 0/imm32/no-r32 +15553 _string_8a_copy_byte/imm32/subx-name +15554 1/imm32/rm32-is-first-inout +15555 3/imm32/r32-is-first-output 15556 0/imm32/no-imm32 15557 0/imm32/no-disp32 -15558 0/imm32/no-output +15558 1/imm32/output-is-write-only 15559 0x11/imm32/alloc-id:fake -15560 _Primitive-break-if->/imm32/next -15561 _Primitive-break-if->: # (payload primitive) +15560 _Primitive-copy-byte-to-mem/imm32/next +15561 _Primitive-copy-byte-to-mem: 15562 0x11/imm32/alloc-id:fake:payload -15563 0x11/imm32/alloc-id:fake -15564 _string-break-if->/imm32/name -15565 0/imm32/no-inouts -15566 0/imm32/no-inouts -15567 0/imm32/no-outputs +15563 # copy-byte-to *var1/reg1, var2/reg2 => 88/byte<- *reg1 reg2/r32 +15564 0x11/imm32/alloc-id:fake +15565 _string-copy-byte-to/imm32/name +15566 0x11/imm32/alloc-id:fake +15567 Two-args-byte-stack-byte-reg/imm32/inouts 15568 0/imm32/no-outputs -15569 0x11/imm32/alloc-id:fake -15570 _string_0f_8f_jump_break/imm32/subx-name -15571 0/imm32/no-rm32 -15572 0/imm32/no-r32 -15573 0/imm32/no-imm32 -15574 0/imm32/no-disp32 -15575 0/imm32/no-output -15576 0x11/imm32/alloc-id:fake -15577 _Primitive-break/imm32/next -15578 _Primitive-break: # (payload primitive) -15579 0x11/imm32/alloc-id:fake:payload -15580 0x11/imm32/alloc-id:fake -15581 _string-break/imm32/name -15582 0/imm32/no-inouts -15583 0/imm32/no-inouts -15584 0/imm32/no-outputs -15585 0/imm32/no-outputs -15586 0x11/imm32/alloc-id:fake -15587 _string_e9_jump_break/imm32/subx-name -15588 0/imm32/no-rm32 -15589 0/imm32/no-r32 -15590 0/imm32/no-imm32 -15591 0/imm32/no-disp32 -15592 0/imm32/no-output -15593 0x11/imm32/alloc-id:fake -15594 _Primitive-loop-if-addr</imm32/next -15595 _Primitive-loop-if-addr<: # (payload primitive) -15596 0x11/imm32/alloc-id:fake:payload -15597 0x11/imm32/alloc-id:fake -15598 _string-loop-if-addr</imm32/name -15599 0/imm32/no-inouts -15600 0/imm32/no-inouts -15601 0/imm32/no-outputs -15602 0/imm32/no-outputs -15603 0x11/imm32/alloc-id:fake -15604 _string_0f_82_jump_loop/imm32/subx-name -15605 0/imm32/no-rm32 -15606 0/imm32/no-r32 -15607 0/imm32/no-imm32 -15608 0/imm32/no-disp32 -15609 0/imm32/no-output -15610 0x11/imm32/alloc-id:fake -15611 _Primitive-loop-if-addr>=/imm32/next -15612 _Primitive-loop-if-addr>=: # (payload primitive) -15613 0x11/imm32/alloc-id:fake:payload -15614 0x11/imm32/alloc-id:fake -15615 _string-loop-if-addr>=/imm32/name -15616 0/imm32/no-inouts -15617 0/imm32/no-inouts -15618 0/imm32/no-outputs -15619 0/imm32/no-outputs +15569 0/imm32/no-outputs +15570 0x11/imm32/alloc-id:fake +15571 _string_88_copy_byte/imm32/subx-name +15572 1/imm32/rm32-is-first-inout +15573 2/imm32/r32-is-second-inout +15574 0/imm32/no-imm32 +15575 0/imm32/no-disp32 +15576 0/imm32/output-is-write-only +15577 0x11/imm32/alloc-id:fake +15578 _Primitive-address/imm32/next +15579 # - address +15580 _Primitive-address: # (payload primitive) +15581 0x11/imm32/alloc-id:fake:payload +15582 # var1/reg <- address var2 => 8d/copy-address var2/rm32 var1/r32 +15583 0x11/imm32/alloc-id:fake +15584 _string-address/imm32/name +15585 0x11/imm32/alloc-id:fake +15586 Single-int-var-in-mem/imm32/inouts +15587 0x11/imm32/alloc-id:fake +15588 Single-addr-var-in-some-register/imm32/outputs +15589 0x11/imm32/alloc-id:fake +15590 _string_8d_copy_address/imm32/subx-name +15591 1/imm32/rm32-is-first-inout +15592 3/imm32/r32-is-first-output +15593 0/imm32/no-imm32 +15594 0/imm32/no-disp32 +15595 1/imm32/output-is-write-only +15596 0x11/imm32/alloc-id:fake +15597 _Primitive-compare-reg-with-reg/imm32/next +15598 # - compare +15599 _Primitive-compare-reg-with-reg: # (payload primitive) +15600 0x11/imm32/alloc-id:fake:payload +15601 # compare var1/reg1 var2/reg2 => 39/compare var1/rm32 var2/r32 +15602 0x11/imm32/alloc-id:fake +15603 _string-compare/imm32/name +15604 0x11/imm32/alloc-id:fake +15605 Two-int-args-in-regs/imm32/inouts +15606 0/imm32/no-outputs +15607 0/imm32/no-outputs +15608 0x11/imm32/alloc-id:fake +15609 _string_39_compare->/imm32/subx-name +15610 1/imm32/rm32-is-first-inout +15611 2/imm32/r32-is-second-inout +15612 0/imm32/no-imm32 +15613 0/imm32/no-disp32 +15614 0/imm32/output-is-write-only +15615 0x11/imm32/alloc-id:fake +15616 _Primitive-compare-mem-with-reg/imm32/next +15617 _Primitive-compare-mem-with-reg: # (payload primitive) +15618 0x11/imm32/alloc-id:fake:payload +15619 # compare var1 var2/reg => 39/compare var1/rm32 var2/r32 15620 0x11/imm32/alloc-id:fake -15621 _string_0f_83_jump_loop/imm32/subx-name -15622 0/imm32/no-rm32 -15623 0/imm32/no-r32 -15624 0/imm32/no-imm32 -15625 0/imm32/no-disp32 -15626 0/imm32/no-output -15627 0x11/imm32/alloc-id:fake -15628 _Primitive-loop-if-=/imm32/next -15629 _Primitive-loop-if-=: # (payload primitive) -15630 0x11/imm32/alloc-id:fake:payload -15631 0x11/imm32/alloc-id:fake -15632 _string-loop-if-=/imm32/name -15633 0/imm32/no-inouts -15634 0/imm32/no-inouts -15635 0/imm32/no-outputs -15636 0/imm32/no-outputs -15637 0x11/imm32/alloc-id:fake -15638 _string_0f_84_jump_loop/imm32/subx-name -15639 0/imm32/no-rm32 -15640 0/imm32/no-r32 -15641 0/imm32/no-imm32 -15642 0/imm32/no-disp32 -15643 0/imm32/no-output +15621 _string-compare/imm32/name +15622 0x11/imm32/alloc-id:fake +15623 Two-args-int-stack-int-reg/imm32/inouts +15624 0/imm32/no-outputs +15625 0/imm32/no-outputs +15626 0x11/imm32/alloc-id:fake +15627 _string_39_compare->/imm32/subx-name +15628 1/imm32/rm32-is-first-inout +15629 2/imm32/r32-is-second-inout +15630 0/imm32/no-imm32 +15631 0/imm32/no-disp32 +15632 0/imm32/output-is-write-only +15633 0x11/imm32/alloc-id:fake +15634 _Primitive-compare-reg-with-mem/imm32/next +15635 _Primitive-compare-reg-with-mem: # (payload primitive) +15636 0x11/imm32/alloc-id:fake:payload +15637 # compare var1/reg var2 => 3b/compare<- var2/rm32 var1/r32 +15638 0x11/imm32/alloc-id:fake +15639 _string-compare/imm32/name +15640 0x11/imm32/alloc-id:fake +15641 Two-args-int-reg-int-stack/imm32/inouts +15642 0/imm32/no-outputs +15643 0/imm32/no-outputs 15644 0x11/imm32/alloc-id:fake -15645 _Primitive-loop-if-!=/imm32/next -15646 _Primitive-loop-if-!=: # (payload primitive) -15647 0x11/imm32/alloc-id:fake:payload -15648 0x11/imm32/alloc-id:fake -15649 _string-loop-if-!=/imm32/name -15650 0/imm32/no-inouts -15651 0/imm32/no-inouts -15652 0/imm32/no-outputs -15653 0/imm32/no-outputs -15654 0x11/imm32/alloc-id:fake -15655 _string_0f_85_jump_loop/imm32/subx-name -15656 0/imm32/no-rm32 -15657 0/imm32/no-r32 -15658 0/imm32/no-imm32 -15659 0/imm32/no-disp32 -15660 0/imm32/no-output -15661 0x11/imm32/alloc-id:fake -15662 _Primitive-loop-if-addr<=/imm32/next -15663 _Primitive-loop-if-addr<=: # (payload primitive) -15664 0x11/imm32/alloc-id:fake:payload -15665 0x11/imm32/alloc-id:fake -15666 _string-loop-if-addr<=/imm32/name -15667 0/imm32/no-inouts -15668 0/imm32/no-inouts -15669 0/imm32/no-outputs -15670 0/imm32/no-outputs -15671 0x11/imm32/alloc-id:fake -15672 _string_0f_86_jump_loop/imm32/subx-name -15673 0/imm32/no-rm32 -15674 0/imm32/no-r32 -15675 0/imm32/no-imm32 -15676 0/imm32/no-disp32 -15677 0/imm32/no-output -15678 0x11/imm32/alloc-id:fake -15679 _Primitive-loop-if-addr>/imm32/next -15680 _Primitive-loop-if-addr>: # (payload primitive) -15681 0x11/imm32/alloc-id:fake:payload -15682 0x11/imm32/alloc-id:fake -15683 _string-loop-if-addr>/imm32/name -15684 0/imm32/no-inouts -15685 0/imm32/no-inouts -15686 0/imm32/no-outputs -15687 0/imm32/no-outputs -15688 0x11/imm32/alloc-id:fake -15689 _string_0f_87_jump_loop/imm32/subx-name -15690 0/imm32/no-rm32 -15691 0/imm32/no-r32 -15692 0/imm32/no-imm32 -15693 0/imm32/no-disp32 -15694 0/imm32/no-output -15695 0x11/imm32/alloc-id:fake -15696 _Primitive-loop-if-</imm32/next -15697 _Primitive-loop-if-<: # (payload primitive) -15698 0x11/imm32/alloc-id:fake:payload -15699 0x11/imm32/alloc-id:fake -15700 _string-loop-if-</imm32/name -15701 0/imm32/no-inouts -15702 0/imm32/no-inouts -15703 0/imm32/no-outputs -15704 0/imm32/no-outputs +15645 _string_3b_compare<-/imm32/subx-name +15646 2/imm32/rm32-is-second-inout +15647 1/imm32/r32-is-first-inout +15648 0/imm32/no-imm32 +15649 0/imm32/no-disp32 +15650 0/imm32/output-is-write-only +15651 0x11/imm32/alloc-id:fake +15652 _Primitive-compare-eax-with-literal/imm32/next +15653 _Primitive-compare-eax-with-literal: # (payload primitive) +15654 0x11/imm32/alloc-id:fake:payload +15655 # compare var1/eax n => 3d/compare-eax-with n/imm32 +15656 0x11/imm32/alloc-id:fake +15657 _string-compare/imm32/name +15658 0x11/imm32/alloc-id:fake +15659 Two-args-int-eax-int-literal/imm32/inouts +15660 0/imm32/no-outputs +15661 0/imm32/no-outputs +15662 0x11/imm32/alloc-id:fake +15663 _string_3d_compare_eax_with/imm32/subx-name +15664 0/imm32/no-rm32 +15665 0/imm32/no-r32 +15666 2/imm32/imm32-is-second-inout +15667 0/imm32/no-disp32 +15668 0/imm32/output-is-write-only +15669 0x11/imm32/alloc-id:fake +15670 _Primitive-compare-reg-with-literal/imm32/next +15671 _Primitive-compare-reg-with-literal: # (payload primitive) +15672 0x11/imm32/alloc-id:fake:payload +15673 # compare var1/reg n => 81 7/subop/compare %reg n/imm32 +15674 0x11/imm32/alloc-id:fake +15675 _string-compare/imm32/name +15676 0x11/imm32/alloc-id:fake +15677 Int-var-in-register-and-literal/imm32/inouts +15678 0/imm32/no-outputs +15679 0/imm32/no-outputs +15680 0x11/imm32/alloc-id:fake +15681 _string_81_subop_compare/imm32/subx-name +15682 1/imm32/rm32-is-first-inout +15683 0/imm32/no-r32 +15684 2/imm32/imm32-is-second-inout +15685 0/imm32/no-disp32 +15686 0/imm32/output-is-write-only +15687 0x11/imm32/alloc-id:fake +15688 _Primitive-compare-mem-with-literal/imm32/next +15689 _Primitive-compare-mem-with-literal: # (payload primitive) +15690 0x11/imm32/alloc-id:fake:payload +15691 # compare var1 n => 81 7/subop/compare *(ebp+___) n/imm32 +15692 0x11/imm32/alloc-id:fake +15693 _string-compare/imm32/name +15694 0x11/imm32/alloc-id:fake +15695 Int-var-and-literal/imm32/inouts +15696 0/imm32/no-outputs +15697 0/imm32/no-outputs +15698 0x11/imm32/alloc-id:fake +15699 _string_81_subop_compare/imm32/subx-name +15700 1/imm32/rm32-is-first-inout +15701 0/imm32/no-r32 +15702 2/imm32/imm32-is-second-inout +15703 0/imm32/no-disp32 +15704 0/imm32/output-is-write-only 15705 0x11/imm32/alloc-id:fake -15706 _string_0f_8c_jump_loop/imm32/subx-name -15707 0/imm32/no-rm32 -15708 0/imm32/no-r32 -15709 0/imm32/no-imm32 -15710 0/imm32/no-disp32 -15711 0/imm32/no-output -15712 0x11/imm32/alloc-id:fake -15713 _Primitive-loop-if->=/imm32/next -15714 _Primitive-loop-if->=: # (payload primitive) -15715 0x11/imm32/alloc-id:fake:payload -15716 0x11/imm32/alloc-id:fake -15717 _string-loop-if->=/imm32/name -15718 0/imm32/no-inouts -15719 0/imm32/no-inouts -15720 0/imm32/no-outputs -15721 0/imm32/no-outputs -15722 0x11/imm32/alloc-id:fake -15723 _string_0f_8d_jump_loop/imm32/subx-name -15724 0/imm32/no-rm32 -15725 0/imm32/no-r32 -15726 0/imm32/no-imm32 -15727 0/imm32/no-disp32 -15728 0/imm32/no-output +15706 _Primitive-multiply-reg-by-reg/imm32/next +15707 # - multiply +15708 _Primitive-multiply-reg-by-reg: # (payload primitive) +15709 0x11/imm32/alloc-id:fake:payload +15710 # var1/reg <- multiply var2 => 0f af/multiply var2/rm32 var1/r32 +15711 0x11/imm32/alloc-id:fake +15712 _string-multiply/imm32/name +15713 0x11/imm32/alloc-id:fake +15714 Single-int-var-in-some-register/imm32/inouts +15715 0x11/imm32/alloc-id:fake +15716 Single-int-var-in-some-register/imm32/outputs +15717 0x11/imm32/alloc-id:fake +15718 _string_0f_af_multiply/imm32/subx-name +15719 1/imm32/rm32-is-first-inout +15720 3/imm32/r32-is-first-output +15721 0/imm32/no-imm32 +15722 0/imm32/no-disp32 +15723 0/imm32/output-is-write-only +15724 0x11/imm32/alloc-id:fake +15725 _Primitive-multiply-reg-by-mem/imm32/next +15726 _Primitive-multiply-reg-by-mem: # (payload primitive) +15727 0x11/imm32/alloc-id:fake:payload +15728 # var1/reg <- multiply var2 => 0f af/multiply var2/rm32 var1/r32 15729 0x11/imm32/alloc-id:fake -15730 _Primitive-loop-if-<=/imm32/next -15731 _Primitive-loop-if-<=: # (payload primitive) -15732 0x11/imm32/alloc-id:fake:payload +15730 _string-multiply/imm32/name +15731 0x11/imm32/alloc-id:fake +15732 Single-int-var-in-mem/imm32/inouts 15733 0x11/imm32/alloc-id:fake -15734 _string-loop-if-<=/imm32/name -15735 0/imm32/no-inouts -15736 0/imm32/no-inouts -15737 0/imm32/no-outputs -15738 0/imm32/no-outputs -15739 0x11/imm32/alloc-id:fake -15740 _string_0f_8e_jump_loop/imm32/subx-name -15741 0/imm32/no-rm32 -15742 0/imm32/no-r32 -15743 0/imm32/no-imm32 -15744 0/imm32/no-disp32 -15745 0/imm32/no-output -15746 0x11/imm32/alloc-id:fake -15747 _Primitive-loop-if->/imm32/next -15748 _Primitive-loop-if->: # (payload primitive) -15749 0x11/imm32/alloc-id:fake:payload -15750 0x11/imm32/alloc-id:fake -15751 _string-loop-if->/imm32/name -15752 0/imm32/no-inouts -15753 0/imm32/no-inouts -15754 0/imm32/no-outputs -15755 0/imm32/no-outputs -15756 0x11/imm32/alloc-id:fake -15757 _string_0f_8f_jump_loop/imm32/subx-name -15758 0/imm32/no-rm32 -15759 0/imm32/no-r32 -15760 0/imm32/no-imm32 -15761 0/imm32/no-disp32 -15762 0/imm32/no-output -15763 0x11/imm32/alloc-id:fake -15764 _Primitive-loop/imm32/next # we probably don't need an unconditional break -15765 _Primitive-loop: # (payload primitive) -15766 0x11/imm32/alloc-id:fake:payload -15767 0x11/imm32/alloc-id:fake -15768 _string-loop/imm32/name -15769 0/imm32/no-inouts -15770 0/imm32/no-inouts -15771 0/imm32/no-outputs -15772 0/imm32/no-outputs -15773 0x11/imm32/alloc-id:fake -15774 _string_e9_jump_loop/imm32/subx-name -15775 0/imm32/no-rm32 -15776 0/imm32/no-r32 -15777 0/imm32/no-imm32 -15778 0/imm32/no-disp32 -15779 0/imm32/no-output -15780 0x11/imm32/alloc-id:fake -15781 _Primitive-break-if-addr<-named/imm32/next -15782 # - branches to named blocks -15783 _Primitive-break-if-addr<-named: # (payload primitive) -15784 0x11/imm32/alloc-id:fake:payload -15785 0x11/imm32/alloc-id:fake -15786 _string-break-if-addr</imm32/name +15734 Single-int-var-in-some-register/imm32/outputs +15735 0x11/imm32/alloc-id:fake +15736 _string_0f_af_multiply/imm32/subx-name +15737 1/imm32/rm32-is-first-inout +15738 3/imm32/r32-is-first-output +15739 0/imm32/no-imm32 +15740 0/imm32/no-disp32 +15741 0/imm32/output-is-write-only +15742 0x11/imm32/alloc-id:fake +15743 _Primitive-break-if-addr</imm32/next +15744 # - branches +15745 _Primitive-break-if-addr<: # (payload primitive) +15746 0x11/imm32/alloc-id:fake:payload +15747 0x11/imm32/alloc-id:fake +15748 _string-break-if-addr</imm32/name +15749 0/imm32/no-inouts +15750 0/imm32/no-inouts +15751 0/imm32/no-outputs +15752 0/imm32/no-outputs +15753 0x11/imm32/alloc-id:fake +15754 _string_0f_82_jump_break/imm32/subx-name +15755 0/imm32/no-rm32 +15756 0/imm32/no-r32 +15757 0/imm32/no-imm32 +15758 0/imm32/no-disp32 +15759 0/imm32/no-output +15760 0x11/imm32/alloc-id:fake +15761 _Primitive-break-if-addr>=/imm32/next +15762 _Primitive-break-if-addr>=: # (payload primitive) +15763 0x11/imm32/alloc-id:fake:payload +15764 0x11/imm32/alloc-id:fake +15765 _string-break-if-addr>=/imm32/name +15766 0/imm32/no-inouts +15767 0/imm32/no-inouts +15768 0/imm32/no-outputs +15769 0/imm32/no-outputs +15770 0x11/imm32/alloc-id:fake +15771 _string_0f_83_jump_break/imm32/subx-name +15772 0/imm32/no-rm32 +15773 0/imm32/no-r32 +15774 0/imm32/no-imm32 +15775 0/imm32/no-disp32 +15776 0/imm32/no-output +15777 0x11/imm32/alloc-id:fake +15778 _Primitive-break-if-=/imm32/next +15779 _Primitive-break-if-=: # (payload primitive) +15780 0x11/imm32/alloc-id:fake:payload +15781 0x11/imm32/alloc-id:fake +15782 _string-break-if-=/imm32/name +15783 0/imm32/no-inouts +15784 0/imm32/no-inouts +15785 0/imm32/no-outputs +15786 0/imm32/no-outputs 15787 0x11/imm32/alloc-id:fake -15788 Single-lit-var/imm32/inouts -15789 0/imm32/no-outputs -15790 0/imm32/no-outputs -15791 0x11/imm32/alloc-id:fake -15792 _string_0f_82_jump_label/imm32/subx-name -15793 0/imm32/no-rm32 -15794 0/imm32/no-r32 -15795 0/imm32/no-imm32 -15796 1/imm32/disp32-is-first-inout -15797 0/imm32/no-output +15788 _string_0f_84_jump_break/imm32/subx-name +15789 0/imm32/no-rm32 +15790 0/imm32/no-r32 +15791 0/imm32/no-imm32 +15792 0/imm32/no-disp32 +15793 0/imm32/no-output +15794 0x11/imm32/alloc-id:fake +15795 _Primitive-break-if-!=/imm32/next +15796 _Primitive-break-if-!=: # (payload primitive) +15797 0x11/imm32/alloc-id:fake:payload 15798 0x11/imm32/alloc-id:fake -15799 _Primitive-break-if-addr>=-named/imm32/next -15800 _Primitive-break-if-addr>=-named: # (payload primitive) -15801 0x11/imm32/alloc-id:fake:payload -15802 0x11/imm32/alloc-id:fake -15803 _string-break-if-addr>=/imm32/name +15799 _string-break-if-!=/imm32/name +15800 0/imm32/no-inouts +15801 0/imm32/no-inouts +15802 0/imm32/no-outputs +15803 0/imm32/no-outputs 15804 0x11/imm32/alloc-id:fake -15805 Single-lit-var/imm32/inouts -15806 0/imm32/no-outputs -15807 0/imm32/no-outputs -15808 0x11/imm32/alloc-id:fake -15809 _string_0f_83_jump_label/imm32/subx-name -15810 0/imm32/no-rm32 -15811 0/imm32/no-r32 -15812 0/imm32/no-imm32 -15813 1/imm32/disp32-is-first-inout -15814 0/imm32/no-output +15805 _string_0f_85_jump_break/imm32/subx-name +15806 0/imm32/no-rm32 +15807 0/imm32/no-r32 +15808 0/imm32/no-imm32 +15809 0/imm32/no-disp32 +15810 0/imm32/no-output +15811 0x11/imm32/alloc-id:fake +15812 _Primitive-break-if-addr<=/imm32/next +15813 _Primitive-break-if-addr<=: # (payload primitive) +15814 0x11/imm32/alloc-id:fake:payload 15815 0x11/imm32/alloc-id:fake -15816 _Primitive-break-if-=-named/imm32/next -15817 _Primitive-break-if-=-named: # (payload primitive) -15818 0x11/imm32/alloc-id:fake:payload -15819 0x11/imm32/alloc-id:fake -15820 _string-break-if-=/imm32/name +15816 _string-break-if-addr<=/imm32/name +15817 0/imm32/no-inouts +15818 0/imm32/no-inouts +15819 0/imm32/no-outputs +15820 0/imm32/no-outputs 15821 0x11/imm32/alloc-id:fake -15822 Single-lit-var/imm32/inouts -15823 0/imm32/no-outputs -15824 0/imm32/no-outputs -15825 0x11/imm32/alloc-id:fake -15826 _string_0f_84_jump_label/imm32/subx-name -15827 0/imm32/no-rm32 -15828 0/imm32/no-r32 -15829 0/imm32/no-imm32 -15830 1/imm32/disp32-is-first-inout -15831 0/imm32/no-output +15822 _string_0f_86_jump_break/imm32/subx-name +15823 0/imm32/no-rm32 +15824 0/imm32/no-r32 +15825 0/imm32/no-imm32 +15826 0/imm32/no-disp32 +15827 0/imm32/no-output +15828 0x11/imm32/alloc-id:fake +15829 _Primitive-break-if-addr>/imm32/next +15830 _Primitive-break-if-addr>: # (payload primitive) +15831 0x11/imm32/alloc-id:fake:payload 15832 0x11/imm32/alloc-id:fake -15833 _Primitive-break-if-!=-named/imm32/next -15834 _Primitive-break-if-!=-named: # (payload primitive) -15835 0x11/imm32/alloc-id:fake:payload -15836 0x11/imm32/alloc-id:fake -15837 _string-break-if-!=/imm32/name +15833 _string-break-if-addr>/imm32/name +15834 0/imm32/no-inouts +15835 0/imm32/no-inouts +15836 0/imm32/no-outputs +15837 0/imm32/no-outputs 15838 0x11/imm32/alloc-id:fake -15839 Single-lit-var/imm32/inouts -15840 0/imm32/no-outputs -15841 0/imm32/no-outputs -15842 0x11/imm32/alloc-id:fake -15843 _string_0f_85_jump_label/imm32/subx-name -15844 0/imm32/no-rm32 -15845 0/imm32/no-r32 -15846 0/imm32/no-imm32 -15847 1/imm32/disp32-is-first-inout -15848 0/imm32/no-output +15839 _string_0f_87_jump_break/imm32/subx-name +15840 0/imm32/no-rm32 +15841 0/imm32/no-r32 +15842 0/imm32/no-imm32 +15843 0/imm32/no-disp32 +15844 0/imm32/no-output +15845 0x11/imm32/alloc-id:fake +15846 _Primitive-break-if-</imm32/next +15847 _Primitive-break-if-<: # (payload primitive) +15848 0x11/imm32/alloc-id:fake:payload 15849 0x11/imm32/alloc-id:fake -15850 _Primitive-break-if-addr<=-named/imm32/next -15851 _Primitive-break-if-addr<=-named: # (payload primitive) -15852 0x11/imm32/alloc-id:fake:payload -15853 0x11/imm32/alloc-id:fake -15854 _string-break-if-addr<=/imm32/name +15850 _string-break-if-</imm32/name +15851 0/imm32/no-inouts +15852 0/imm32/no-inouts +15853 0/imm32/no-outputs +15854 0/imm32/no-outputs 15855 0x11/imm32/alloc-id:fake -15856 Single-lit-var/imm32/inouts -15857 0/imm32/no-outputs -15858 0/imm32/no-outputs -15859 0x11/imm32/alloc-id:fake -15860 _string_0f_86_jump_label/imm32/subx-name -15861 0/imm32/no-rm32 -15862 0/imm32/no-r32 -15863 0/imm32/no-imm32 -15864 1/imm32/disp32-is-first-inout -15865 0/imm32/no-output +15856 _string_0f_8c_jump_break/imm32/subx-name +15857 0/imm32/no-rm32 +15858 0/imm32/no-r32 +15859 0/imm32/no-imm32 +15860 0/imm32/no-disp32 +15861 0/imm32/no-output +15862 0x11/imm32/alloc-id:fake +15863 _Primitive-break-if->=/imm32/next +15864 _Primitive-break-if->=: # (payload primitive) +15865 0x11/imm32/alloc-id:fake:payload 15866 0x11/imm32/alloc-id:fake -15867 _Primitive-break-if-addr>-named/imm32/next -15868 _Primitive-break-if-addr>-named: # (payload primitive) -15869 0x11/imm32/alloc-id:fake:payload -15870 0x11/imm32/alloc-id:fake -15871 _string-break-if-addr>/imm32/name +15867 _string-break-if->=/imm32/name +15868 0/imm32/no-inouts +15869 0/imm32/no-inouts +15870 0/imm32/no-outputs +15871 0/imm32/no-outputs 15872 0x11/imm32/alloc-id:fake -15873 Single-lit-var/imm32/inouts -15874 0/imm32/no-outputs -15875 0/imm32/no-outputs -15876 0x11/imm32/alloc-id:fake -15877 _string_0f_87_jump_label/imm32/subx-name -15878 0/imm32/no-rm32 -15879 0/imm32/no-r32 -15880 0/imm32/no-imm32 -15881 1/imm32/disp32-is-first-inout -15882 0/imm32/no-output +15873 _string_0f_8d_jump_break/imm32/subx-name +15874 0/imm32/no-rm32 +15875 0/imm32/no-r32 +15876 0/imm32/no-imm32 +15877 0/imm32/no-disp32 +15878 0/imm32/no-output +15879 0x11/imm32/alloc-id:fake +15880 _Primitive-break-if-<=/imm32/next +15881 _Primitive-break-if-<=: # (payload primitive) +15882 0x11/imm32/alloc-id:fake:payload 15883 0x11/imm32/alloc-id:fake -15884 _Primitive-break-if-<-named/imm32/next -15885 _Primitive-break-if-<-named: # (payload primitive) -15886 0x11/imm32/alloc-id:fake:payload -15887 0x11/imm32/alloc-id:fake -15888 _string-break-if-</imm32/name +15884 _string-break-if-<=/imm32/name +15885 0/imm32/no-inouts +15886 0/imm32/no-inouts +15887 0/imm32/no-outputs +15888 0/imm32/no-outputs 15889 0x11/imm32/alloc-id:fake -15890 Single-lit-var/imm32/inouts -15891 0/imm32/no-outputs -15892 0/imm32/no-outputs -15893 0x11/imm32/alloc-id:fake -15894 _string_0f_8c_jump_label/imm32/subx-name -15895 0/imm32/no-rm32 -15896 0/imm32/no-r32 -15897 0/imm32/no-imm32 -15898 1/imm32/disp32-is-first-inout -15899 0/imm32/no-output +15890 _string_0f_8e_jump_break/imm32/subx-name +15891 0/imm32/no-rm32 +15892 0/imm32/no-r32 +15893 0/imm32/no-imm32 +15894 0/imm32/no-disp32 +15895 0/imm32/no-output +15896 0x11/imm32/alloc-id:fake +15897 _Primitive-break-if->/imm32/next +15898 _Primitive-break-if->: # (payload primitive) +15899 0x11/imm32/alloc-id:fake:payload 15900 0x11/imm32/alloc-id:fake -15901 _Primitive-break-if->=-named/imm32/next -15902 _Primitive-break-if->=-named: # (payload primitive) -15903 0x11/imm32/alloc-id:fake:payload -15904 0x11/imm32/alloc-id:fake -15905 _string-break-if->=/imm32/name +15901 _string-break-if->/imm32/name +15902 0/imm32/no-inouts +15903 0/imm32/no-inouts +15904 0/imm32/no-outputs +15905 0/imm32/no-outputs 15906 0x11/imm32/alloc-id:fake -15907 Single-lit-var/imm32/inouts -15908 0/imm32/no-outputs -15909 0/imm32/no-outputs -15910 0x11/imm32/alloc-id:fake -15911 _string_0f_8d_jump_label/imm32/subx-name -15912 0/imm32/no-rm32 -15913 0/imm32/no-r32 -15914 0/imm32/no-imm32 -15915 1/imm32/disp32-is-first-inout -15916 0/imm32/no-output +15907 _string_0f_8f_jump_break/imm32/subx-name +15908 0/imm32/no-rm32 +15909 0/imm32/no-r32 +15910 0/imm32/no-imm32 +15911 0/imm32/no-disp32 +15912 0/imm32/no-output +15913 0x11/imm32/alloc-id:fake +15914 _Primitive-break/imm32/next +15915 _Primitive-break: # (payload primitive) +15916 0x11/imm32/alloc-id:fake:payload 15917 0x11/imm32/alloc-id:fake -15918 _Primitive-break-if-<=-named/imm32/next -15919 _Primitive-break-if-<=-named: # (payload primitive) -15920 0x11/imm32/alloc-id:fake:payload -15921 0x11/imm32/alloc-id:fake -15922 _string-break-if-<=/imm32/name +15918 _string-break/imm32/name +15919 0/imm32/no-inouts +15920 0/imm32/no-inouts +15921 0/imm32/no-outputs +15922 0/imm32/no-outputs 15923 0x11/imm32/alloc-id:fake -15924 Single-lit-var/imm32/inouts -15925 0/imm32/no-outputs -15926 0/imm32/no-outputs -15927 0x11/imm32/alloc-id:fake -15928 _string_0f_8e_jump_label/imm32/subx-name -15929 0/imm32/no-rm32 -15930 0/imm32/no-r32 -15931 0/imm32/no-imm32 -15932 1/imm32/disp32-is-first-inout -15933 0/imm32/no-output +15924 _string_e9_jump_break/imm32/subx-name +15925 0/imm32/no-rm32 +15926 0/imm32/no-r32 +15927 0/imm32/no-imm32 +15928 0/imm32/no-disp32 +15929 0/imm32/no-output +15930 0x11/imm32/alloc-id:fake +15931 _Primitive-loop-if-addr</imm32/next +15932 _Primitive-loop-if-addr<: # (payload primitive) +15933 0x11/imm32/alloc-id:fake:payload 15934 0x11/imm32/alloc-id:fake -15935 _Primitive-break-if->-named/imm32/next -15936 _Primitive-break-if->-named: # (payload primitive) -15937 0x11/imm32/alloc-id:fake:payload -15938 0x11/imm32/alloc-id:fake -15939 _string-break-if->/imm32/name +15935 _string-loop-if-addr</imm32/name +15936 0/imm32/no-inouts +15937 0/imm32/no-inouts +15938 0/imm32/no-outputs +15939 0/imm32/no-outputs 15940 0x11/imm32/alloc-id:fake -15941 Single-lit-var/imm32/inouts -15942 0/imm32/no-outputs -15943 0/imm32/no-outputs -15944 0x11/imm32/alloc-id:fake -15945 _string_0f_8f_jump_label/imm32/subx-name -15946 0/imm32/no-rm32 -15947 0/imm32/no-r32 -15948 0/imm32/no-imm32 -15949 1/imm32/disp32-is-first-inout -15950 0/imm32/no-output +15941 _string_0f_82_jump_loop/imm32/subx-name +15942 0/imm32/no-rm32 +15943 0/imm32/no-r32 +15944 0/imm32/no-imm32 +15945 0/imm32/no-disp32 +15946 0/imm32/no-output +15947 0x11/imm32/alloc-id:fake +15948 _Primitive-loop-if-addr>=/imm32/next +15949 _Primitive-loop-if-addr>=: # (payload primitive) +15950 0x11/imm32/alloc-id:fake:payload 15951 0x11/imm32/alloc-id:fake -15952 _Primitive-break-named/imm32/next -15953 _Primitive-break-named: # (payload primitive) -15954 0x11/imm32/alloc-id:fake:payload -15955 0x11/imm32/alloc-id:fake -15956 _string-break/imm32/name +15952 _string-loop-if-addr>=/imm32/name +15953 0/imm32/no-inouts +15954 0/imm32/no-inouts +15955 0/imm32/no-outputs +15956 0/imm32/no-outputs 15957 0x11/imm32/alloc-id:fake -15958 Single-lit-var/imm32/inouts -15959 0/imm32/no-outputs -15960 0/imm32/no-outputs -15961 0x11/imm32/alloc-id:fake -15962 _string_e9_jump_label/imm32/subx-name -15963 0/imm32/no-rm32 -15964 0/imm32/no-r32 -15965 0/imm32/no-imm32 -15966 1/imm32/disp32-is-first-inout -15967 0/imm32/no-output +15958 _string_0f_83_jump_loop/imm32/subx-name +15959 0/imm32/no-rm32 +15960 0/imm32/no-r32 +15961 0/imm32/no-imm32 +15962 0/imm32/no-disp32 +15963 0/imm32/no-output +15964 0x11/imm32/alloc-id:fake +15965 _Primitive-loop-if-=/imm32/next +15966 _Primitive-loop-if-=: # (payload primitive) +15967 0x11/imm32/alloc-id:fake:payload 15968 0x11/imm32/alloc-id:fake -15969 _Primitive-loop-if-addr<-named/imm32/next -15970 _Primitive-loop-if-addr<-named: # (payload primitive) -15971 0x11/imm32/alloc-id:fake:payload -15972 0x11/imm32/alloc-id:fake -15973 _string-loop-if-addr</imm32/name +15969 _string-loop-if-=/imm32/name +15970 0/imm32/no-inouts +15971 0/imm32/no-inouts +15972 0/imm32/no-outputs +15973 0/imm32/no-outputs 15974 0x11/imm32/alloc-id:fake -15975 Single-lit-var/imm32/inouts -15976 0/imm32/no-outputs -15977 0/imm32/no-outputs -15978 0x11/imm32/alloc-id:fake -15979 _string_0f_82_jump_label/imm32/subx-name -15980 0/imm32/no-rm32 -15981 0/imm32/no-r32 -15982 0/imm32/no-imm32 -15983 1/imm32/disp32-is-first-inout -15984 0/imm32/no-output +15975 _string_0f_84_jump_loop/imm32/subx-name +15976 0/imm32/no-rm32 +15977 0/imm32/no-r32 +15978 0/imm32/no-imm32 +15979 0/imm32/no-disp32 +15980 0/imm32/no-output +15981 0x11/imm32/alloc-id:fake +15982 _Primitive-loop-if-!=/imm32/next +15983 _Primitive-loop-if-!=: # (payload primitive) +15984 0x11/imm32/alloc-id:fake:payload 15985 0x11/imm32/alloc-id:fake -15986 _Primitive-loop-if-addr>=-named/imm32/next -15987 _Primitive-loop-if-addr>=-named: # (payload primitive) -15988 0x11/imm32/alloc-id:fake:payload -15989 0x11/imm32/alloc-id:fake -15990 _string-loop-if-addr>=/imm32/name +15986 _string-loop-if-!=/imm32/name +15987 0/imm32/no-inouts +15988 0/imm32/no-inouts +15989 0/imm32/no-outputs +15990 0/imm32/no-outputs 15991 0x11/imm32/alloc-id:fake -15992 Single-lit-var/imm32/inouts -15993 0/imm32/no-outputs -15994 0/imm32/no-outputs -15995 0x11/imm32/alloc-id:fake -15996 _string_0f_83_jump_label/imm32/subx-name -15997 0/imm32/no-rm32 -15998 0/imm32/no-r32 -15999 0/imm32/no-imm32 -16000 1/imm32/disp32-is-first-inout -16001 0/imm32/no-output +15992 _string_0f_85_jump_loop/imm32/subx-name +15993 0/imm32/no-rm32 +15994 0/imm32/no-r32 +15995 0/imm32/no-imm32 +15996 0/imm32/no-disp32 +15997 0/imm32/no-output +15998 0x11/imm32/alloc-id:fake +15999 _Primitive-loop-if-addr<=/imm32/next +16000 _Primitive-loop-if-addr<=: # (payload primitive) +16001 0x11/imm32/alloc-id:fake:payload 16002 0x11/imm32/alloc-id:fake -16003 _Primitive-loop-if-=-named/imm32/next -16004 _Primitive-loop-if-=-named: # (payload primitive) -16005 0x11/imm32/alloc-id:fake:payload -16006 0x11/imm32/alloc-id:fake -16007 _string-loop-if-=/imm32/name +16003 _string-loop-if-addr<=/imm32/name +16004 0/imm32/no-inouts +16005 0/imm32/no-inouts +16006 0/imm32/no-outputs +16007 0/imm32/no-outputs 16008 0x11/imm32/alloc-id:fake -16009 Single-lit-var/imm32/inouts -16010 0/imm32/no-outputs -16011 0/imm32/no-outputs -16012 0x11/imm32/alloc-id:fake -16013 _string_0f_84_jump_label/imm32/subx-name -16014 0/imm32/no-rm32 -16015 0/imm32/no-r32 -16016 0/imm32/no-imm32 -16017 1/imm32/disp32-is-first-inout -16018 0/imm32/no-output +16009 _string_0f_86_jump_loop/imm32/subx-name +16010 0/imm32/no-rm32 +16011 0/imm32/no-r32 +16012 0/imm32/no-imm32 +16013 0/imm32/no-disp32 +16014 0/imm32/no-output +16015 0x11/imm32/alloc-id:fake +16016 _Primitive-loop-if-addr>/imm32/next +16017 _Primitive-loop-if-addr>: # (payload primitive) +16018 0x11/imm32/alloc-id:fake:payload 16019 0x11/imm32/alloc-id:fake -16020 _Primitive-loop-if-!=-named/imm32/next -16021 _Primitive-loop-if-!=-named: # (payload primitive) -16022 0x11/imm32/alloc-id:fake:payload -16023 0x11/imm32/alloc-id:fake -16024 _string-loop-if-!=/imm32/name +16020 _string-loop-if-addr>/imm32/name +16021 0/imm32/no-inouts +16022 0/imm32/no-inouts +16023 0/imm32/no-outputs +16024 0/imm32/no-outputs 16025 0x11/imm32/alloc-id:fake -16026 Single-lit-var/imm32/inouts -16027 0/imm32/no-outputs -16028 0/imm32/no-outputs -16029 0x11/imm32/alloc-id:fake -16030 _string_0f_85_jump_label/imm32/subx-name -16031 0/imm32/no-rm32 -16032 0/imm32/no-r32 -16033 0/imm32/no-imm32 -16034 1/imm32/disp32-is-first-inout -16035 0/imm32/no-output +16026 _string_0f_87_jump_loop/imm32/subx-name +16027 0/imm32/no-rm32 +16028 0/imm32/no-r32 +16029 0/imm32/no-imm32 +16030 0/imm32/no-disp32 +16031 0/imm32/no-output +16032 0x11/imm32/alloc-id:fake +16033 _Primitive-loop-if-</imm32/next +16034 _Primitive-loop-if-<: # (payload primitive) +16035 0x11/imm32/alloc-id:fake:payload 16036 0x11/imm32/alloc-id:fake -16037 _Primitive-loop-if-addr<=-named/imm32/next -16038 _Primitive-loop-if-addr<=-named: # (payload primitive) -16039 0x11/imm32/alloc-id:fake:payload -16040 0x11/imm32/alloc-id:fake -16041 _string-loop-if-addr<=/imm32/name +16037 _string-loop-if-</imm32/name +16038 0/imm32/no-inouts +16039 0/imm32/no-inouts +16040 0/imm32/no-outputs +16041 0/imm32/no-outputs 16042 0x11/imm32/alloc-id:fake -16043 Single-lit-var/imm32/inouts -16044 0/imm32/no-outputs -16045 0/imm32/no-outputs -16046 0x11/imm32/alloc-id:fake -16047 _string_0f_86_jump_label/imm32/subx-name -16048 0/imm32/no-rm32 -16049 0/imm32/no-r32 -16050 0/imm32/no-imm32 -16051 1/imm32/disp32-is-first-inout -16052 0/imm32/no-output +16043 _string_0f_8c_jump_loop/imm32/subx-name +16044 0/imm32/no-rm32 +16045 0/imm32/no-r32 +16046 0/imm32/no-imm32 +16047 0/imm32/no-disp32 +16048 0/imm32/no-output +16049 0x11/imm32/alloc-id:fake +16050 _Primitive-loop-if->=/imm32/next +16051 _Primitive-loop-if->=: # (payload primitive) +16052 0x11/imm32/alloc-id:fake:payload 16053 0x11/imm32/alloc-id:fake -16054 _Primitive-loop-if-addr>-named/imm32/next -16055 _Primitive-loop-if-addr>-named: # (payload primitive) -16056 0x11/imm32/alloc-id:fake:payload -16057 0x11/imm32/alloc-id:fake -16058 _string-loop-if-addr>/imm32/name +16054 _string-loop-if->=/imm32/name +16055 0/imm32/no-inouts +16056 0/imm32/no-inouts +16057 0/imm32/no-outputs +16058 0/imm32/no-outputs 16059 0x11/imm32/alloc-id:fake -16060 Single-lit-var/imm32/inouts -16061 0/imm32/no-outputs -16062 0/imm32/no-outputs -16063 0x11/imm32/alloc-id:fake -16064 _string_0f_87_jump_label/imm32/subx-name -16065 0/imm32/no-rm32 -16066 0/imm32/no-r32 -16067 0/imm32/no-imm32 -16068 1/imm32/disp32-is-first-inout -16069 0/imm32/no-output +16060 _string_0f_8d_jump_loop/imm32/subx-name +16061 0/imm32/no-rm32 +16062 0/imm32/no-r32 +16063 0/imm32/no-imm32 +16064 0/imm32/no-disp32 +16065 0/imm32/no-output +16066 0x11/imm32/alloc-id:fake +16067 _Primitive-loop-if-<=/imm32/next +16068 _Primitive-loop-if-<=: # (payload primitive) +16069 0x11/imm32/alloc-id:fake:payload 16070 0x11/imm32/alloc-id:fake -16071 _Primitive-loop-if-<-named/imm32/next -16072 _Primitive-loop-if-<-named: # (payload primitive) -16073 0x11/imm32/alloc-id:fake:payload -16074 0x11/imm32/alloc-id:fake -16075 _string-loop-if-</imm32/name +16071 _string-loop-if-<=/imm32/name +16072 0/imm32/no-inouts +16073 0/imm32/no-inouts +16074 0/imm32/no-outputs +16075 0/imm32/no-outputs 16076 0x11/imm32/alloc-id:fake -16077 Single-lit-var/imm32/inouts -16078 0/imm32/no-outputs -16079 0/imm32/no-outputs -16080 0x11/imm32/alloc-id:fake -16081 _string_0f_8c_jump_label/imm32/subx-name -16082 0/imm32/no-rm32 -16083 0/imm32/no-r32 -16084 0/imm32/no-imm32 -16085 1/imm32/disp32-is-first-inout -16086 0/imm32/no-output +16077 _string_0f_8e_jump_loop/imm32/subx-name +16078 0/imm32/no-rm32 +16079 0/imm32/no-r32 +16080 0/imm32/no-imm32 +16081 0/imm32/no-disp32 +16082 0/imm32/no-output +16083 0x11/imm32/alloc-id:fake +16084 _Primitive-loop-if->/imm32/next +16085 _Primitive-loop-if->: # (payload primitive) +16086 0x11/imm32/alloc-id:fake:payload 16087 0x11/imm32/alloc-id:fake -16088 _Primitive-loop-if->=-named/imm32/next -16089 _Primitive-loop-if->=-named: # (payload primitive) -16090 0x11/imm32/alloc-id:fake:payload -16091 0x11/imm32/alloc-id:fake -16092 _string-loop-if->=/imm32/name +16088 _string-loop-if->/imm32/name +16089 0/imm32/no-inouts +16090 0/imm32/no-inouts +16091 0/imm32/no-outputs +16092 0/imm32/no-outputs 16093 0x11/imm32/alloc-id:fake -16094 Single-lit-var/imm32/inouts -16095 0/imm32/no-outputs -16096 0/imm32/no-outputs -16097 0x11/imm32/alloc-id:fake -16098 _string_0f_8d_jump_label/imm32/subx-name -16099 0/imm32/no-rm32 -16100 0/imm32/no-r32 -16101 0/imm32/no-imm32 -16102 1/imm32/disp32-is-first-inout -16103 0/imm32/no-output +16094 _string_0f_8f_jump_loop/imm32/subx-name +16095 0/imm32/no-rm32 +16096 0/imm32/no-r32 +16097 0/imm32/no-imm32 +16098 0/imm32/no-disp32 +16099 0/imm32/no-output +16100 0x11/imm32/alloc-id:fake +16101 _Primitive-loop/imm32/next # we probably don't need an unconditional break +16102 _Primitive-loop: # (payload primitive) +16103 0x11/imm32/alloc-id:fake:payload 16104 0x11/imm32/alloc-id:fake -16105 _Primitive-loop-if-<=-named/imm32/next -16106 _Primitive-loop-if-<=-named: # (payload primitive) -16107 0x11/imm32/alloc-id:fake:payload -16108 0x11/imm32/alloc-id:fake -16109 _string-loop-if-<=/imm32/name +16105 _string-loop/imm32/name +16106 0/imm32/no-inouts +16107 0/imm32/no-inouts +16108 0/imm32/no-outputs +16109 0/imm32/no-outputs 16110 0x11/imm32/alloc-id:fake -16111 Single-lit-var/imm32/inouts -16112 0/imm32/no-outputs -16113 0/imm32/no-outputs -16114 0x11/imm32/alloc-id:fake -16115 _string_0f_8e_jump_label/imm32/subx-name -16116 0/imm32/no-rm32 -16117 0/imm32/no-r32 -16118 0/imm32/no-imm32 -16119 1/imm32/disp32-is-first-inout -16120 0/imm32/no-output -16121 0x11/imm32/alloc-id:fake -16122 _Primitive-loop-if->-named/imm32/next -16123 _Primitive-loop-if->-named: # (payload primitive) -16124 0x11/imm32/alloc-id:fake:payload -16125 0x11/imm32/alloc-id:fake -16126 _string-loop-if->/imm32/name -16127 0x11/imm32/alloc-id:fake -16128 Single-lit-var/imm32/inouts -16129 0/imm32/no-outputs -16130 0/imm32/no-outputs -16131 0x11/imm32/alloc-id:fake -16132 _string_0f_8f_jump_label/imm32/subx-name -16133 0/imm32/no-rm32 -16134 0/imm32/no-r32 -16135 0/imm32/no-imm32 -16136 1/imm32/disp32-is-first-inout -16137 0/imm32/no-output -16138 0x11/imm32/alloc-id:fake -16139 _Primitive-loop-named/imm32/next # we probably don't need an unconditional break -16140 _Primitive-loop-named: # (payload primitive) -16141 0x11/imm32/alloc-id:fake:payload -16142 0x11/imm32/alloc-id:fake -16143 _string-loop/imm32/name -16144 0x11/imm32/alloc-id:fake -16145 Single-lit-var/imm32/inouts -16146 0/imm32/no-outputs -16147 0/imm32/no-outputs -16148 0x11/imm32/alloc-id:fake -16149 _string_e9_jump_label/imm32/subx-name -16150 0/imm32/no-rm32 -16151 0/imm32/no-r32 -16152 0/imm32/no-imm32 -16153 1/imm32/disp32-is-first-inout -16154 0/imm32/no-output -16155 0/imm32/next -16156 0/imm32/next -16157 -16158 # string literals for Mu instructions -16159 _string-add: # (payload array byte) -16160 0x11/imm32/alloc-id:fake:payload -16161 # "add" -16162 0x3/imm32/size -16163 0x61/a 0x64/d 0x64/d -16164 _string-address: # (payload array byte) -16165 0x11/imm32/alloc-id:fake:payload -16166 # "address" -16167 0x7/imm32/size -16168 0x61/a 0x64/d 0x64/d 0x72/r 0x65/e 0x73/s 0x73/s -16169 _string-add-to: # (payload array byte) -16170 0x11/imm32/alloc-id:fake:payload -16171 # "add-to" -16172 0x6/imm32/size -16173 0x61/a 0x64/d 0x64/d 0x2d/dash 0x74/t 0x6f/o -16174 _string-and: # (payload array byte) -16175 0x11/imm32/alloc-id:fake:payload -16176 # "and" -16177 0x3/imm32/size -16178 0x61/a 0x6e/n 0x64/d -16179 _string-and-with: # (payload array byte) -16180 0x11/imm32/alloc-id:fake:payload -16181 # "and-with" -16182 0x8/imm32/size -16183 0x61/a 0x6e/n 0x64/d 0x2d/dash 0x77/w 0x69/i 0x74/t 0x68/h -16184 _string-break: # (payload array byte) -16185 0x11/imm32/alloc-id:fake:payload -16186 # "break" -16187 0x5/imm32/size -16188 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k -16189 _string-break-if-<: # (payload array byte) -16190 0x11/imm32/alloc-id:fake:payload -16191 # "break-if-<" -16192 0xa/imm32/size -16193 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3c/< -16194 _string-break-if-<=: # (payload array byte) -16195 0x11/imm32/alloc-id:fake:payload -16196 # "break-if-<=" -16197 0xb/imm32/size -16198 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3c/< 0x3d/= -16199 _string-break-if-=: # (payload array byte) -16200 0x11/imm32/alloc-id:fake:payload -16201 # "break-if-=" -16202 0xa/imm32/size -16203 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3d/= -16204 _string-break-if->: # (payload array byte) -16205 0x11/imm32/alloc-id:fake:payload -16206 # "break-if->" -16207 0xa/imm32/size -16208 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3e/> -16209 _string-break-if->=: # (payload array byte) -16210 0x11/imm32/alloc-id:fake:payload -16211 # "break-if->=" -16212 0xb/imm32/size -16213 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3e/> 0x3d/= -16214 _string-break-if-!=: # (payload array byte) -16215 0x11/imm32/alloc-id:fake:payload -16216 # "break-if-!=" -16217 0xb/imm32/size -16218 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x21/! 0x3d/= -16219 _string-break-if-addr<: # (payload array byte) -16220 0x11/imm32/alloc-id:fake:payload -16221 # "break-if-addr<" -16222 0xe/imm32/size -16223 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x3c/< -16224 _string-break-if-addr<=: # (payload array byte) -16225 0x11/imm32/alloc-id:fake:payload -16226 # "break-if-addr<=" -16227 0xf/imm32/size -16228 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x3c/< 0x3d/= -16229 _string-break-if-addr>: # (payload array byte) -16230 0x11/imm32/alloc-id:fake:payload -16231 # "break-if-addr>" -16232 0xe/imm32/size -16233 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x3e/> -16234 _string-break-if-addr>=: # (payload array byte) -16235 0x11/imm32/alloc-id:fake:payload -16236 # "break-if-addr>=" -16237 0xf/imm32/size -16238 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x3e/> 0x3d/= -16239 _string-compare: # (payload array byte) +16111 _string_e9_jump_loop/imm32/subx-name +16112 0/imm32/no-rm32 +16113 0/imm32/no-r32 +16114 0/imm32/no-imm32 +16115 0/imm32/no-disp32 +16116 0/imm32/no-output +16117 0x11/imm32/alloc-id:fake +16118 _Primitive-break-if-addr<-named/imm32/next +16119 # - branches to named blocks +16120 _Primitive-break-if-addr<-named: # (payload primitive) +16121 0x11/imm32/alloc-id:fake:payload +16122 0x11/imm32/alloc-id:fake +16123 _string-break-if-addr</imm32/name +16124 0x11/imm32/alloc-id:fake +16125 Single-lit-var/imm32/inouts +16126 0/imm32/no-outputs +16127 0/imm32/no-outputs +16128 0x11/imm32/alloc-id:fake +16129 _string_0f_82_jump_label/imm32/subx-name +16130 0/imm32/no-rm32 +16131 0/imm32/no-r32 +16132 0/imm32/no-imm32 +16133 1/imm32/disp32-is-first-inout +16134 0/imm32/no-output +16135 0x11/imm32/alloc-id:fake +16136 _Primitive-break-if-addr>=-named/imm32/next +16137 _Primitive-break-if-addr>=-named: # (payload primitive) +16138 0x11/imm32/alloc-id:fake:payload +16139 0x11/imm32/alloc-id:fake +16140 _string-break-if-addr>=/imm32/name +16141 0x11/imm32/alloc-id:fake +16142 Single-lit-var/imm32/inouts +16143 0/imm32/no-outputs +16144 0/imm32/no-outputs +16145 0x11/imm32/alloc-id:fake +16146 _string_0f_83_jump_label/imm32/subx-name +16147 0/imm32/no-rm32 +16148 0/imm32/no-r32 +16149 0/imm32/no-imm32 +16150 1/imm32/disp32-is-first-inout +16151 0/imm32/no-output +16152 0x11/imm32/alloc-id:fake +16153 _Primitive-break-if-=-named/imm32/next +16154 _Primitive-break-if-=-named: # (payload primitive) +16155 0x11/imm32/alloc-id:fake:payload +16156 0x11/imm32/alloc-id:fake +16157 _string-break-if-=/imm32/name +16158 0x11/imm32/alloc-id:fake +16159 Single-lit-var/imm32/inouts +16160 0/imm32/no-outputs +16161 0/imm32/no-outputs +16162 0x11/imm32/alloc-id:fake +16163 _string_0f_84_jump_label/imm32/subx-name +16164 0/imm32/no-rm32 +16165 0/imm32/no-r32 +16166 0/imm32/no-imm32 +16167 1/imm32/disp32-is-first-inout +16168 0/imm32/no-output +16169 0x11/imm32/alloc-id:fake +16170 _Primitive-break-if-!=-named/imm32/next +16171 _Primitive-break-if-!=-named: # (payload primitive) +16172 0x11/imm32/alloc-id:fake:payload +16173 0x11/imm32/alloc-id:fake +16174 _string-break-if-!=/imm32/name +16175 0x11/imm32/alloc-id:fake +16176 Single-lit-var/imm32/inouts +16177 0/imm32/no-outputs +16178 0/imm32/no-outputs +16179 0x11/imm32/alloc-id:fake +16180 _string_0f_85_jump_label/imm32/subx-name +16181 0/imm32/no-rm32 +16182 0/imm32/no-r32 +16183 0/imm32/no-imm32 +16184 1/imm32/disp32-is-first-inout +16185 0/imm32/no-output +16186 0x11/imm32/alloc-id:fake +16187 _Primitive-break-if-addr<=-named/imm32/next +16188 _Primitive-break-if-addr<=-named: # (payload primitive) +16189 0x11/imm32/alloc-id:fake:payload +16190 0x11/imm32/alloc-id:fake +16191 _string-break-if-addr<=/imm32/name +16192 0x11/imm32/alloc-id:fake +16193 Single-lit-var/imm32/inouts +16194 0/imm32/no-outputs +16195 0/imm32/no-outputs +16196 0x11/imm32/alloc-id:fake +16197 _string_0f_86_jump_label/imm32/subx-name +16198 0/imm32/no-rm32 +16199 0/imm32/no-r32 +16200 0/imm32/no-imm32 +16201 1/imm32/disp32-is-first-inout +16202 0/imm32/no-output +16203 0x11/imm32/alloc-id:fake +16204 _Primitive-break-if-addr>-named/imm32/next +16205 _Primitive-break-if-addr>-named: # (payload primitive) +16206 0x11/imm32/alloc-id:fake:payload +16207 0x11/imm32/alloc-id:fake +16208 _string-break-if-addr>/imm32/name +16209 0x11/imm32/alloc-id:fake +16210 Single-lit-var/imm32/inouts +16211 0/imm32/no-outputs +16212 0/imm32/no-outputs +16213 0x11/imm32/alloc-id:fake +16214 _string_0f_87_jump_label/imm32/subx-name +16215 0/imm32/no-rm32 +16216 0/imm32/no-r32 +16217 0/imm32/no-imm32 +16218 1/imm32/disp32-is-first-inout +16219 0/imm32/no-output +16220 0x11/imm32/alloc-id:fake +16221 _Primitive-break-if-<-named/imm32/next +16222 _Primitive-break-if-<-named: # (payload primitive) +16223 0x11/imm32/alloc-id:fake:payload +16224 0x11/imm32/alloc-id:fake +16225 _string-break-if-</imm32/name +16226 0x11/imm32/alloc-id:fake +16227 Single-lit-var/imm32/inouts +16228 0/imm32/no-outputs +16229 0/imm32/no-outputs +16230 0x11/imm32/alloc-id:fake +16231 _string_0f_8c_jump_label/imm32/subx-name +16232 0/imm32/no-rm32 +16233 0/imm32/no-r32 +16234 0/imm32/no-imm32 +16235 1/imm32/disp32-is-first-inout +16236 0/imm32/no-output +16237 0x11/imm32/alloc-id:fake +16238 _Primitive-break-if->=-named/imm32/next +16239 _Primitive-break-if->=-named: # (payload primitive) 16240 0x11/imm32/alloc-id:fake:payload -16241 # "compare" -16242 0x7/imm32/size -16243 0x63/c 0x6f/o 0x6d/m 0x70/p 0x61/a 0x72/r 0x65/e -16244 _string-copy: # (payload array byte) -16245 0x11/imm32/alloc-id:fake:payload -16246 # "copy" -16247 0x4/imm32/size -16248 0x63/c 0x6f/o 0x70/p 0x79/y -16249 _string-copy-to: # (payload array byte) -16250 0x11/imm32/alloc-id:fake:payload -16251 # "copy-to" -16252 0x7/imm32/size -16253 0x63/c 0x6f/o 0x70/p 0x79/y 0x2d/dash 0x74/t 0x6f/o -16254 _string-copy-byte: -16255 0x11/imm32/alloc-id:fake:payload -16256 # "copy-byte" -16257 0x9/imm32/size -16258 0x63/c 0x6f/o 0x70/p 0x79/y 0x2d/- 0x62/b 0x79/y 0x74/t 0x65/e -16259 _string-copy-byte-to: -16260 0x11/imm32/alloc-id:fake:payload -16261 # "copy-byte-to" -16262 0xc/imm32/size -16263 0x63/c 0x6f/o 0x70/p 0x79/y 0x2d/- 0x62/b 0x79/y 0x74/t 0x65/e 0x2d/- 0x74/t 0x6f/o -16264 _string-decrement: # (payload array byte) -16265 0x11/imm32/alloc-id:fake:payload -16266 # "decrement" -16267 0x9/imm32/size -16268 0x64/d 0x65/e 0x63/c 0x72/r 0x65/e 0x6d/m 0x65/e 0x6e/n 0x74/t -16269 _string-increment: # (payload array byte) -16270 0x11/imm32/alloc-id:fake:payload -16271 # "increment" -16272 0x9/imm32/size -16273 0x69/i 0x6e/n 0x63/c 0x72/r 0x65/e 0x6d/m 0x65/e 0x6e/n 0x74/t -16274 _string-loop: # (payload array byte) -16275 0x11/imm32/alloc-id:fake:payload -16276 # "loop" -16277 0x4/imm32/size -16278 0x6c/l 0x6f/o 0x6f/o 0x70/p -16279 _string-loop-if-<: # (payload array byte) -16280 0x11/imm32/alloc-id:fake:payload -16281 # "loop-if-<" -16282 0x9/imm32/size -16283 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3c/< -16284 _string-loop-if-<=: # (payload array byte) -16285 0x11/imm32/alloc-id:fake:payload -16286 # "loop-if-<=" -16287 0xa/imm32/size -16288 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3c/< 0x3d/= -16289 _string-loop-if-=: # (payload array byte) -16290 0x11/imm32/alloc-id:fake:payload -16291 # "loop-if-=" -16292 0x9/imm32/size -16293 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3d/= -16294 _string-loop-if->: # (payload array byte) -16295 0x11/imm32/alloc-id:fake:payload -16296 # "loop-if->" -16297 0x9/imm32/size -16298 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3e/> -16299 _string-loop-if->=: # (payload array byte) -16300 0x11/imm32/alloc-id:fake:payload -16301 # "loop-if->=" -16302 0xa/imm32/size -16303 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3e/> 0x3d/= -16304 _string-loop-if-!=: # (payload array byte) -16305 0x11/imm32/alloc-id:fake:payload -16306 # "loop-if-!=" -16307 0xa/imm32/size -16308 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x21/! 0x3d/= -16309 _string-loop-if-addr<: # (payload array byte) -16310 0x11/imm32/alloc-id:fake:payload -16311 # "loop-if-addr<" -16312 0xd/imm32/size -16313 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x3c/< -16314 _string-loop-if-addr<=: # (payload array byte) -16315 0x11/imm32/alloc-id:fake:payload -16316 # "loop-if-addr<=" -16317 0xe/imm32/size -16318 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x3c/< 0x3d/= -16319 _string-loop-if-addr>: # (payload array byte) -16320 0x11/imm32/alloc-id:fake:payload -16321 # "loop-if-addr>" -16322 0xd/imm32/size -16323 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x3e/> -16324 _string-loop-if-addr>=: # (payload array byte) +16241 0x11/imm32/alloc-id:fake +16242 _string-break-if->=/imm32/name +16243 0x11/imm32/alloc-id:fake +16244 Single-lit-var/imm32/inouts +16245 0/imm32/no-outputs +16246 0/imm32/no-outputs +16247 0x11/imm32/alloc-id:fake +16248 _string_0f_8d_jump_label/imm32/subx-name +16249 0/imm32/no-rm32 +16250 0/imm32/no-r32 +16251 0/imm32/no-imm32 +16252 1/imm32/disp32-is-first-inout +16253 0/imm32/no-output +16254 0x11/imm32/alloc-id:fake +16255 _Primitive-break-if-<=-named/imm32/next +16256 _Primitive-break-if-<=-named: # (payload primitive) +16257 0x11/imm32/alloc-id:fake:payload +16258 0x11/imm32/alloc-id:fake +16259 _string-break-if-<=/imm32/name +16260 0x11/imm32/alloc-id:fake +16261 Single-lit-var/imm32/inouts +16262 0/imm32/no-outputs +16263 0/imm32/no-outputs +16264 0x11/imm32/alloc-id:fake +16265 _string_0f_8e_jump_label/imm32/subx-name +16266 0/imm32/no-rm32 +16267 0/imm32/no-r32 +16268 0/imm32/no-imm32 +16269 1/imm32/disp32-is-first-inout +16270 0/imm32/no-output +16271 0x11/imm32/alloc-id:fake +16272 _Primitive-break-if->-named/imm32/next +16273 _Primitive-break-if->-named: # (payload primitive) +16274 0x11/imm32/alloc-id:fake:payload +16275 0x11/imm32/alloc-id:fake +16276 _string-break-if->/imm32/name +16277 0x11/imm32/alloc-id:fake +16278 Single-lit-var/imm32/inouts +16279 0/imm32/no-outputs +16280 0/imm32/no-outputs +16281 0x11/imm32/alloc-id:fake +16282 _string_0f_8f_jump_label/imm32/subx-name +16283 0/imm32/no-rm32 +16284 0/imm32/no-r32 +16285 0/imm32/no-imm32 +16286 1/imm32/disp32-is-first-inout +16287 0/imm32/no-output +16288 0x11/imm32/alloc-id:fake +16289 _Primitive-break-named/imm32/next +16290 _Primitive-break-named: # (payload primitive) +16291 0x11/imm32/alloc-id:fake:payload +16292 0x11/imm32/alloc-id:fake +16293 _string-break/imm32/name +16294 0x11/imm32/alloc-id:fake +16295 Single-lit-var/imm32/inouts +16296 0/imm32/no-outputs +16297 0/imm32/no-outputs +16298 0x11/imm32/alloc-id:fake +16299 _string_e9_jump_label/imm32/subx-name +16300 0/imm32/no-rm32 +16301 0/imm32/no-r32 +16302 0/imm32/no-imm32 +16303 1/imm32/disp32-is-first-inout +16304 0/imm32/no-output +16305 0x11/imm32/alloc-id:fake +16306 _Primitive-loop-if-addr<-named/imm32/next +16307 _Primitive-loop-if-addr<-named: # (payload primitive) +16308 0x11/imm32/alloc-id:fake:payload +16309 0x11/imm32/alloc-id:fake +16310 _string-loop-if-addr</imm32/name +16311 0x11/imm32/alloc-id:fake +16312 Single-lit-var/imm32/inouts +16313 0/imm32/no-outputs +16314 0/imm32/no-outputs +16315 0x11/imm32/alloc-id:fake +16316 _string_0f_82_jump_label/imm32/subx-name +16317 0/imm32/no-rm32 +16318 0/imm32/no-r32 +16319 0/imm32/no-imm32 +16320 1/imm32/disp32-is-first-inout +16321 0/imm32/no-output +16322 0x11/imm32/alloc-id:fake +16323 _Primitive-loop-if-addr>=-named/imm32/next +16324 _Primitive-loop-if-addr>=-named: # (payload primitive) 16325 0x11/imm32/alloc-id:fake:payload -16326 # "loop-if-addr>=" -16327 0xe/imm32/size -16328 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x3e/> 0x3d/= -16329 _string-multiply: # (payload array byte) -16330 0x11/imm32/alloc-id:fake:payload -16331 # "multiply" -16332 0x8/imm32/size -16333 0x6d/m 0x75/u 0x6c/l 0x74/t 0x69/i 0x70/p 0x6c/l 0x79/y -16334 _string-or: # (payload array byte) -16335 0x11/imm32/alloc-id:fake:payload -16336 # "or" -16337 0x2/imm32/size -16338 0x6f/o 0x72/r -16339 _string-or-with: # (payload array byte) -16340 0x11/imm32/alloc-id:fake:payload -16341 # "or-with" -16342 0x7/imm32/size -16343 0x6f/o 0x72/r 0x2d/dash 0x77/w 0x69/i 0x74/t 0x68/h -16344 _string-subtract: # (payload array byte) -16345 0x11/imm32/alloc-id:fake:payload -16346 # "subtract" -16347 0x8/imm32/size -16348 0x73/s 0x75/u 0x62/b 0x74/t 0x72/r 0x61/a 0x63/c 0x74/t -16349 _string-subtract-from: # (payload array byte) -16350 0x11/imm32/alloc-id:fake:payload -16351 # "subtract-from" -16352 0xd/imm32/size -16353 0x73/s 0x75/u 0x62/b 0x74/t 0x72/r 0x61/a 0x63/c 0x74/t 0x2d/dash 0x66/f 0x72/r 0x6f/o 0x6d/m -16354 _string-xor: # (payload array byte) -16355 0x11/imm32/alloc-id:fake:payload -16356 # "xor" -16357 0x3/imm32/size -16358 0x78/x 0x6f/o 0x72/r -16359 _string-xor-with: # (payload array byte) -16360 0x11/imm32/alloc-id:fake:payload -16361 # "xor-with" -16362 0x8/imm32/size -16363 0x78/x 0x6f/o 0x72/r 0x2d/dash 0x77/w 0x69/i 0x74/t 0x68/h -16364 -16365 # string literals for SubX instructions -16366 _string_01_add_to: # (payload array byte) -16367 0x11/imm32/alloc-id:fake:payload -16368 # "01/add-to" -16369 0x9/imm32/size -16370 0x30/0 0x31/1 0x2f/slash 0x61/a 0x64/d 0x64/d 0x2d/dash 0x74/t 0x6f/o -16371 _string_03_add: # (payload array byte) -16372 0x11/imm32/alloc-id:fake:payload -16373 # "03/add" -16374 0x6/imm32/size -16375 0x30/0 0x33/3 0x2f/slash 0x61/a 0x64/d 0x64/d -16376 _string_05_add_to_eax: # (payload array byte) -16377 0x11/imm32/alloc-id:fake:payload -16378 # "05/add-to-eax" -16379 0xd/imm32/size -16380 0x30/0 0x35/5 0x2f/slash 0x61/a 0x64/d 0x64/d 0x2d/dash 0x74/t 0x6f/o 0x2d/dash 0x65/e 0x61/a 0x78/x -16381 _string_09_or_with: # (payload array byte) -16382 0x11/imm32/alloc-id:fake:payload -16383 # "09/or-with" -16384 0xa/imm32/size -16385 0x30/0 0x39/9 0x2f/slash 0x6f/o 0x72/r 0x2d/dash 0x77/w 0x69/i 0x74/t 0x68/h -16386 _string_0b_or: # (payload array byte) -16387 0x11/imm32/alloc-id:fake:payload -16388 # "0b/or" -16389 0x5/imm32/size -16390 0x30/0 0x62/b 0x2f/slash 0x6f/o 0x72/r -16391 _string_0d_or_with_eax: # (payload array byte) -16392 0x11/imm32/alloc-id:fake:payload -16393 # "0d/or-with-eax" -16394 0xe/imm32/size -16395 0x30/0 0x64/d 0x2f/slash 0x6f/o 0x72/r 0x2d/dash 0x77/w 0x69/i 0x74/t 0x68/h 0x2d/dash 0x65/e 0x61/a 0x78/x -16396 _string_0f_82_jump_label: # (payload array byte) -16397 0x11/imm32/alloc-id:fake:payload -16398 # "0f 82/jump-if-addr<" -16399 0x13/imm32/size -16400 0x30/0 0x66/f 0x20/space 0x38/8 0x32/2 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x3c/< -16401 _string_0f_82_jump_break: # (payload array byte) -16402 0x11/imm32/alloc-id:fake:payload -16403 # "0f 82/jump-if-addr< break/disp32" -16404 0x20/imm32/size -16405 0x30/0 0x66/f 0x20/space 0x38/8 0x32/2 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x3c/< 0x20/space 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 -16406 _string_0f_82_jump_loop: # (payload array byte) -16407 0x11/imm32/alloc-id:fake:payload -16408 # "0f 82/jump-if-addr< loop/disp32" -16409 0x1f/imm32/size -16410 0x30/0 0x66/f 0x20/space 0x38/8 0x32/2 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x3c/< 0x20/space 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 -16411 _string_0f_83_jump_label: # (payload array byte) -16412 0x11/imm32/alloc-id:fake:payload -16413 # "0f 83/jump-if-addr>=" -16414 0x14/imm32/size -16415 0x30/0 0x66/f 0x20/space 0x38/8 0x33/3 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x3e/> 0x3d/= -16416 _string_0f_83_jump_break: # (payload array byte) -16417 0x11/imm32/alloc-id:fake:payload -16418 # "0f 83/jump-if-addr>= break/disp32" -16419 0x21/imm32/size -16420 0x30/0 0x66/f 0x20/space 0x38/8 0x33/3 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x3e/> 0x3d/= 0x20/space 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 -16421 _string_0f_83_jump_loop: # (payload array byte) -16422 0x11/imm32/alloc-id:fake:payload -16423 # "0f 83/jump-if-addr>= loop/disp32" -16424 0x20/imm32/size -16425 0x30/0 0x66/f 0x20/space 0x38/8 0x33/3 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x3e/> 0x3d/= 0x20/space 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 -16426 _string_0f_84_jump_label: # (payload array byte) +16326 0x11/imm32/alloc-id:fake +16327 _string-loop-if-addr>=/imm32/name +16328 0x11/imm32/alloc-id:fake +16329 Single-lit-var/imm32/inouts +16330 0/imm32/no-outputs +16331 0/imm32/no-outputs +16332 0x11/imm32/alloc-id:fake +16333 _string_0f_83_jump_label/imm32/subx-name +16334 0/imm32/no-rm32 +16335 0/imm32/no-r32 +16336 0/imm32/no-imm32 +16337 1/imm32/disp32-is-first-inout +16338 0/imm32/no-output +16339 0x11/imm32/alloc-id:fake +16340 _Primitive-loop-if-=-named/imm32/next +16341 _Primitive-loop-if-=-named: # (payload primitive) +16342 0x11/imm32/alloc-id:fake:payload +16343 0x11/imm32/alloc-id:fake +16344 _string-loop-if-=/imm32/name +16345 0x11/imm32/alloc-id:fake +16346 Single-lit-var/imm32/inouts +16347 0/imm32/no-outputs +16348 0/imm32/no-outputs +16349 0x11/imm32/alloc-id:fake +16350 _string_0f_84_jump_label/imm32/subx-name +16351 0/imm32/no-rm32 +16352 0/imm32/no-r32 +16353 0/imm32/no-imm32 +16354 1/imm32/disp32-is-first-inout +16355 0/imm32/no-output +16356 0x11/imm32/alloc-id:fake +16357 _Primitive-loop-if-!=-named/imm32/next +16358 _Primitive-loop-if-!=-named: # (payload primitive) +16359 0x11/imm32/alloc-id:fake:payload +16360 0x11/imm32/alloc-id:fake +16361 _string-loop-if-!=/imm32/name +16362 0x11/imm32/alloc-id:fake +16363 Single-lit-var/imm32/inouts +16364 0/imm32/no-outputs +16365 0/imm32/no-outputs +16366 0x11/imm32/alloc-id:fake +16367 _string_0f_85_jump_label/imm32/subx-name +16368 0/imm32/no-rm32 +16369 0/imm32/no-r32 +16370 0/imm32/no-imm32 +16371 1/imm32/disp32-is-first-inout +16372 0/imm32/no-output +16373 0x11/imm32/alloc-id:fake +16374 _Primitive-loop-if-addr<=-named/imm32/next +16375 _Primitive-loop-if-addr<=-named: # (payload primitive) +16376 0x11/imm32/alloc-id:fake:payload +16377 0x11/imm32/alloc-id:fake +16378 _string-loop-if-addr<=/imm32/name +16379 0x11/imm32/alloc-id:fake +16380 Single-lit-var/imm32/inouts +16381 0/imm32/no-outputs +16382 0/imm32/no-outputs +16383 0x11/imm32/alloc-id:fake +16384 _string_0f_86_jump_label/imm32/subx-name +16385 0/imm32/no-rm32 +16386 0/imm32/no-r32 +16387 0/imm32/no-imm32 +16388 1/imm32/disp32-is-first-inout +16389 0/imm32/no-output +16390 0x11/imm32/alloc-id:fake +16391 _Primitive-loop-if-addr>-named/imm32/next +16392 _Primitive-loop-if-addr>-named: # (payload primitive) +16393 0x11/imm32/alloc-id:fake:payload +16394 0x11/imm32/alloc-id:fake +16395 _string-loop-if-addr>/imm32/name +16396 0x11/imm32/alloc-id:fake +16397 Single-lit-var/imm32/inouts +16398 0/imm32/no-outputs +16399 0/imm32/no-outputs +16400 0x11/imm32/alloc-id:fake +16401 _string_0f_87_jump_label/imm32/subx-name +16402 0/imm32/no-rm32 +16403 0/imm32/no-r32 +16404 0/imm32/no-imm32 +16405 1/imm32/disp32-is-first-inout +16406 0/imm32/no-output +16407 0x11/imm32/alloc-id:fake +16408 _Primitive-loop-if-<-named/imm32/next +16409 _Primitive-loop-if-<-named: # (payload primitive) +16410 0x11/imm32/alloc-id:fake:payload +16411 0x11/imm32/alloc-id:fake +16412 _string-loop-if-</imm32/name +16413 0x11/imm32/alloc-id:fake +16414 Single-lit-var/imm32/inouts +16415 0/imm32/no-outputs +16416 0/imm32/no-outputs +16417 0x11/imm32/alloc-id:fake +16418 _string_0f_8c_jump_label/imm32/subx-name +16419 0/imm32/no-rm32 +16420 0/imm32/no-r32 +16421 0/imm32/no-imm32 +16422 1/imm32/disp32-is-first-inout +16423 0/imm32/no-output +16424 0x11/imm32/alloc-id:fake +16425 _Primitive-loop-if->=-named/imm32/next +16426 _Primitive-loop-if->=-named: # (payload primitive) 16427 0x11/imm32/alloc-id:fake:payload -16428 # "0f 84/jump-if-=" -16429 0xf/imm32/size -16430 0x30/0 0x66/f 0x20/space 0x38/8 0x34/4 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3d/= -16431 _string_0f_84_jump_break: # (payload array byte) -16432 0x11/imm32/alloc-id:fake:payload -16433 # "0f 84/jump-if-= break/disp32" -16434 0x1c/imm32/size -16435 0x30/0 0x66/f 0x20/space 0x38/8 0x34/4 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3d/= 0x20/space 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 -16436 _string_0f_84_jump_loop: # (payload array byte) -16437 0x11/imm32/alloc-id:fake:payload -16438 # "0f 84/jump-if-= loop/disp32" -16439 0x1b/imm32/size -16440 0x30/0 0x66/f 0x20/space 0x38/8 0x34/4 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3d/= 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 -16441 _string_0f_85_jump_label: # (payload array byte) -16442 0x11/imm32/alloc-id:fake:payload -16443 # "0f 85/jump-if-!=" -16444 0x10/imm32/size -16445 0x30/0 0x66/f 0x20/space 0x38/8 0x35/5 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x21/! 0x3d/= -16446 _string_0f_85_jump_break: # (payload array byte) -16447 0x11/imm32/alloc-id:fake:payload -16448 # "0f 85/jump-if-!= break/disp32" -16449 0x1d/imm32/size -16450 0x30/0 0x66/f 0x20/space 0x38/8 0x35/5 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x21/! 0x3d/= 0x20/space 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 -16451 _string_0f_85_jump_loop: # (payload array byte) -16452 0x11/imm32/alloc-id:fake:payload -16453 # "0f 85/jump-if-!= loop/disp32" -16454 0x1c/imm32/size -16455 0x30/0 0x66/f 0x20/space 0x38/8 0x35/5 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x21/! 0x3d/= 0x20/space 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 -16456 _string_0f_86_jump_label: # (payload array byte) -16457 0x11/imm32/alloc-id:fake:payload -16458 # "0f 86/jump-if-addr<=" -16459 0x14/imm32/size -16460 0x30/0 0x66/f 0x20/space 0x38/8 0x36/6 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x3c/< 0x3d/= -16461 _string_0f_86_jump_break: # (payload array byte) -16462 0x11/imm32/alloc-id:fake:payload -16463 # "0f 86/jump-if-addr<= break/disp32" -16464 0x21/imm32/size -16465 0x30/0 0x66/f 0x20/space 0x38/8 0x36/6 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x3c/< 0x3d/= 0x20/space 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 -16466 _string_0f_86_jump_loop: # (payload array byte) -16467 0x11/imm32/alloc-id:fake:payload -16468 # "0f 86/jump-if-addr<= loop/disp32" -16469 0x20/imm32/size -16470 0x30/0 0x66/f 0x20/space 0x38/8 0x36/6 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x3c/< 0x3d/= 0x20/space 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 -16471 _string_0f_87_jump_label: # (payload array byte) -16472 0x11/imm32/alloc-id:fake:payload -16473 # "0f 87/jump-if-addr>" -16474 0x13/imm32/size -16475 0x30/0 0x66/f 0x20/space 0x38/8 0x37/7 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x3e/> -16476 _string_0f_87_jump_break: # (payload array byte) -16477 0x11/imm32/alloc-id:fake:payload -16478 # "0f 87/jump-if-addr> break/disp32" -16479 0x20/imm32/size -16480 0x30/0 0x66/f 0x20/space 0x38/8 0x37/7 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x3e/> 0x20/space 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 -16481 _string_0f_87_jump_loop: # (payload array byte) -16482 0x11/imm32/alloc-id:fake:payload -16483 # "0f 87/jump-if-addr> loop/disp32" -16484 0x1f/imm32/size -16485 0x30/0 0x66/f 0x20/space 0x38/8 0x37/7 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x3e/> 0x20/space 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 -16486 _string_0f_8c_jump_label: # (payload array byte) -16487 0x11/imm32/alloc-id:fake:payload -16488 # "0f 8c/jump-if-<" -16489 0xf/imm32/size -16490 0x30/0 0x66/f 0x20/space 0x38/8 0x63/c 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3c/< -16491 _string_0f_8c_jump_break: # (payload array byte) -16492 0x11/imm32/alloc-id:fake:payload -16493 # "0f 8c/jump-if-< break/disp32" -16494 0x1c/imm32/size -16495 0x30/0 0x66/f 0x20/space 0x38/8 0x63/c 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3c/< 0x20/space 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 -16496 _string_0f_8c_jump_loop: # (payload array byte) +16428 0x11/imm32/alloc-id:fake +16429 _string-loop-if->=/imm32/name +16430 0x11/imm32/alloc-id:fake +16431 Single-lit-var/imm32/inouts +16432 0/imm32/no-outputs +16433 0/imm32/no-outputs +16434 0x11/imm32/alloc-id:fake +16435 _string_0f_8d_jump_label/imm32/subx-name +16436 0/imm32/no-rm32 +16437 0/imm32/no-r32 +16438 0/imm32/no-imm32 +16439 1/imm32/disp32-is-first-inout +16440 0/imm32/no-output +16441 0x11/imm32/alloc-id:fake +16442 _Primitive-loop-if-<=-named/imm32/next +16443 _Primitive-loop-if-<=-named: # (payload primitive) +16444 0x11/imm32/alloc-id:fake:payload +16445 0x11/imm32/alloc-id:fake +16446 _string-loop-if-<=/imm32/name +16447 0x11/imm32/alloc-id:fake +16448 Single-lit-var/imm32/inouts +16449 0/imm32/no-outputs +16450 0/imm32/no-outputs +16451 0x11/imm32/alloc-id:fake +16452 _string_0f_8e_jump_label/imm32/subx-name +16453 0/imm32/no-rm32 +16454 0/imm32/no-r32 +16455 0/imm32/no-imm32 +16456 1/imm32/disp32-is-first-inout +16457 0/imm32/no-output +16458 0x11/imm32/alloc-id:fake +16459 _Primitive-loop-if->-named/imm32/next +16460 _Primitive-loop-if->-named: # (payload primitive) +16461 0x11/imm32/alloc-id:fake:payload +16462 0x11/imm32/alloc-id:fake +16463 _string-loop-if->/imm32/name +16464 0x11/imm32/alloc-id:fake +16465 Single-lit-var/imm32/inouts +16466 0/imm32/no-outputs +16467 0/imm32/no-outputs +16468 0x11/imm32/alloc-id:fake +16469 _string_0f_8f_jump_label/imm32/subx-name +16470 0/imm32/no-rm32 +16471 0/imm32/no-r32 +16472 0/imm32/no-imm32 +16473 1/imm32/disp32-is-first-inout +16474 0/imm32/no-output +16475 0x11/imm32/alloc-id:fake +16476 _Primitive-loop-named/imm32/next # we probably don't need an unconditional break +16477 _Primitive-loop-named: # (payload primitive) +16478 0x11/imm32/alloc-id:fake:payload +16479 0x11/imm32/alloc-id:fake +16480 _string-loop/imm32/name +16481 0x11/imm32/alloc-id:fake +16482 Single-lit-var/imm32/inouts +16483 0/imm32/no-outputs +16484 0/imm32/no-outputs +16485 0x11/imm32/alloc-id:fake +16486 _string_e9_jump_label/imm32/subx-name +16487 0/imm32/no-rm32 +16488 0/imm32/no-r32 +16489 0/imm32/no-imm32 +16490 1/imm32/disp32-is-first-inout +16491 0/imm32/no-output +16492 0/imm32/next +16493 0/imm32/next +16494 +16495 # string literals for Mu instructions +16496 _string-add: # (payload array byte) 16497 0x11/imm32/alloc-id:fake:payload -16498 # "0f 8c/jump-if-< loop/disp32" -16499 0x1b/imm32/size -16500 0x30/0 0x66/f 0x20/space 0x38/8 0x63/c 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3c/< 0x20/space 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 -16501 _string_0f_8d_jump_label: # (payload array byte) +16498 # "add" +16499 0x3/imm32/size +16500 0x61/a 0x64/d 0x64/d +16501 _string-address: # (payload array byte) 16502 0x11/imm32/alloc-id:fake:payload -16503 # "0f 8d/jump-if->=" -16504 0x10/imm32/size -16505 0x30/0 0x66/f 0x20/space 0x38/8 0x64/d 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3e/> 0x3d/= -16506 _string_0f_8d_jump_break: # (payload array byte) +16503 # "address" +16504 0x7/imm32/size +16505 0x61/a 0x64/d 0x64/d 0x72/r 0x65/e 0x73/s 0x73/s +16506 _string-add-to: # (payload array byte) 16507 0x11/imm32/alloc-id:fake:payload -16508 # "0f 8d/jump-if->= break/disp32" -16509 0x1d/imm32/size -16510 0x30/0 0x66/f 0x20/space 0x38/8 0x64/d 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3e/> 0x3d/= 0x20/space 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 -16511 _string_0f_8d_jump_loop: # (payload array byte) +16508 # "add-to" +16509 0x6/imm32/size +16510 0x61/a 0x64/d 0x64/d 0x2d/dash 0x74/t 0x6f/o +16511 _string-and: # (payload array byte) 16512 0x11/imm32/alloc-id:fake:payload -16513 # "0f 8d/jump-if->= loop/disp32" -16514 0x1c/imm32/size -16515 0x30/0 0x66/f 0x20/space 0x38/8 0x64/d 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3e/> 0x3d/= 0x20/space 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 -16516 _string_0f_8e_jump_label: # (payload array byte) +16513 # "and" +16514 0x3/imm32/size +16515 0x61/a 0x6e/n 0x64/d +16516 _string-and-with: # (payload array byte) 16517 0x11/imm32/alloc-id:fake:payload -16518 # "0f 8e/jump-if-<=" -16519 0x10/imm32/size -16520 0x30/0 0x66/f 0x20/space 0x38/8 0x65/e 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3c/< 0x3d/= -16521 _string_0f_8e_jump_break: # (payload array byte) +16518 # "and-with" +16519 0x8/imm32/size +16520 0x61/a 0x6e/n 0x64/d 0x2d/dash 0x77/w 0x69/i 0x74/t 0x68/h +16521 _string-break: # (payload array byte) 16522 0x11/imm32/alloc-id:fake:payload -16523 # "0f 8e/jump-if-<= break/disp32" -16524 0x1d/imm32/size -16525 0x30/0 0x66/f 0x20/space 0x38/8 0x65/e 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3c/< 0x3d/= 0x20/space 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 -16526 _string_0f_8e_jump_loop: # (payload array byte) +16523 # "break" +16524 0x5/imm32/size +16525 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k +16526 _string-break-if-<: # (payload array byte) 16527 0x11/imm32/alloc-id:fake:payload -16528 # "0f 8e/jump-if-<= loop/disp32" -16529 0x1c/imm32/size -16530 0x30/0 0x66/f 0x20/space 0x38/8 0x65/e 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3c/< 0x3d/= 0x20/space 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 -16531 _string_0f_8f_jump_label: # (payload array byte) +16528 # "break-if-<" +16529 0xa/imm32/size +16530 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3c/< +16531 _string-break-if-<=: # (payload array byte) 16532 0x11/imm32/alloc-id:fake:payload -16533 # "0f 8f/jump-if->" -16534 0xf/imm32/size -16535 0x30/0 0x66/f 0x20/space 0x38/8 0x66/f 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3e/> -16536 _string_0f_8f_jump_break: # (payload array byte) +16533 # "break-if-<=" +16534 0xb/imm32/size +16535 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3c/< 0x3d/= +16536 _string-break-if-=: # (payload array byte) 16537 0x11/imm32/alloc-id:fake:payload -16538 # "0f 8f/jump-if-> break/disp32" -16539 0x1c/imm32/size -16540 0x30/0 0x66/f 0x20/space 0x38/8 0x66/f 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3e/> 0x20/space 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 -16541 _string_0f_8f_jump_loop: # (payload array byte) +16538 # "break-if-=" +16539 0xa/imm32/size +16540 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3d/= +16541 _string-break-if->: # (payload array byte) 16542 0x11/imm32/alloc-id:fake:payload -16543 # "0f 8f/jump-if-> loop/disp32" -16544 0x1b/imm32/size -16545 0x30/0 0x66/f 0x20/space 0x38/8 0x66/f 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3e/> 0x20/space 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 -16546 _string_0f_af_multiply: # (payload array byte) +16543 # "break-if->" +16544 0xa/imm32/size +16545 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3e/> +16546 _string-break-if->=: # (payload array byte) 16547 0x11/imm32/alloc-id:fake:payload -16548 # "0f af/multiply" -16549 0xe/imm32/size -16550 0x30/0 0x66/f 0x20/space 0x61/a 0x66/f 0x2f/slash 0x6d/m 0x75/u 0x6c/l 0x74/t 0x69/i 0x70/p 0x6c/l 0x79/y -16551 _string_21_and_with: # (payload array byte) +16548 # "break-if->=" +16549 0xb/imm32/size +16550 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3e/> 0x3d/= +16551 _string-break-if-!=: # (payload array byte) 16552 0x11/imm32/alloc-id:fake:payload -16553 # "21/and-with" +16553 # "break-if-!=" 16554 0xb/imm32/size -16555 0x32/2 0x31/1 0x2f/slash 0x61/a 0x6e/n 0x64/d 0x2d/dash 0x77/w 0x69/i 0x74/t 0x68/h -16556 _string_23_and: # (payload array byte) +16555 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x21/! 0x3d/= +16556 _string-break-if-addr<: # (payload array byte) 16557 0x11/imm32/alloc-id:fake:payload -16558 # "23/and" -16559 0x6/imm32/size -16560 0x32/2 0x33/3 0x2f/slash 0x61/a 0x6e/n 0x64/d -16561 _string_25_and_with_eax: # (payload array byte) +16558 # "break-if-addr<" +16559 0xe/imm32/size +16560 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x3c/< +16561 _string-break-if-addr<=: # (payload array byte) 16562 0x11/imm32/alloc-id:fake:payload -16563 # "25/and-with-eax" +16563 # "break-if-addr<=" 16564 0xf/imm32/size -16565 0x32/2 0x35/5 0x2f/slash 0x61/a 0x6e/n 0x64/d 0x2d/dash 0x77/w 0x69/i 0x74/t 0x68/h 0x2d/dash 0x65/e 0x61/a 0x78/x -16566 _string_29_subtract_from: # (payload array byte) +16565 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x3c/< 0x3d/= +16566 _string-break-if-addr>: # (payload array byte) 16567 0x11/imm32/alloc-id:fake:payload -16568 # "29/subtract-from" -16569 0x10/imm32/size -16570 0x32/2 0x39/9 0x2f/slash 0x73/s 0x75/u 0x62/b 0x74/t 0x72/r 0x61/a 0x63/c 0x74/t 0x2d/dash 0x66/f 0x72/r 0x6f/o 0x6d/m -16571 _string_2b_subtract: # (payload array byte) +16568 # "break-if-addr>" +16569 0xe/imm32/size +16570 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x3e/> +16571 _string-break-if-addr>=: # (payload array byte) 16572 0x11/imm32/alloc-id:fake:payload -16573 # "2b/subtract" -16574 0xb/imm32/size -16575 0x32/2 0x62/b 0x2f/slash 0x73/s 0x75/u 0x62/b 0x74/t 0x72/r 0x61/a 0x63/c 0x74/t -16576 _string_2d_subtract_from_eax: # (payload array byte) +16573 # "break-if-addr>=" +16574 0xf/imm32/size +16575 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x3e/> 0x3d/= +16576 _string-compare: # (payload array byte) 16577 0x11/imm32/alloc-id:fake:payload -16578 # "2d/subtract-from-eax" -16579 0x14/imm32/size -16580 0x32/2 0x64/d 0x2f/slash 0x73/s 0x75/u 0x62/b 0x74/t 0x72/r 0x61/a 0x63/c 0x74/t 0x2d/dash 0x66/f 0x72/r 0x6f/o 0x6d/m 0x2d/dash 0x65/e 0x61/a 0x78/x -16581 _string_31_xor_with: # (payload array byte) +16578 # "compare" +16579 0x7/imm32/size +16580 0x63/c 0x6f/o 0x6d/m 0x70/p 0x61/a 0x72/r 0x65/e +16581 _string-copy: # (payload array byte) 16582 0x11/imm32/alloc-id:fake:payload -16583 # "31/xor-with" -16584 0xb/imm32/size -16585 0x33/3 0x31/1 0x2f/slash 0x78/x 0x6f/o 0x72/r 0x2d/dash 0x77/w 0x69/i 0x74/t 0x68/h -16586 _string_33_xor: # (payload array byte) +16583 # "copy" +16584 0x4/imm32/size +16585 0x63/c 0x6f/o 0x70/p 0x79/y +16586 _string-copy-to: # (payload array byte) 16587 0x11/imm32/alloc-id:fake:payload -16588 # "33/xor" -16589 0x6/imm32/size -16590 0x33/3 0x33/3 0x2f/slash 0x78/x 0x6f/o 0x72/r -16591 _string_35_xor_with_eax: # (payload array byte) +16588 # "copy-to" +16589 0x7/imm32/size +16590 0x63/c 0x6f/o 0x70/p 0x79/y 0x2d/dash 0x74/t 0x6f/o +16591 _string-copy-byte: 16592 0x11/imm32/alloc-id:fake:payload -16593 # "35/xor-with-eax" -16594 0xf/imm32/size -16595 0x33/3 0x35/5 0x2f/slash 0x78/x 0x6f/o 0x72/r 0x2d/dash 0x77/w 0x69/i 0x74/t 0x68/h 0x2d/dash 0x65/e 0x61/a 0x78/x -16596 _string_39_compare->: # (payload array byte) +16593 # "copy-byte" +16594 0x9/imm32/size +16595 0x63/c 0x6f/o 0x70/p 0x79/y 0x2d/- 0x62/b 0x79/y 0x74/t 0x65/e +16596 _string-copy-byte-to: 16597 0x11/imm32/alloc-id:fake:payload -16598 # "39/compare->" +16598 # "copy-byte-to" 16599 0xc/imm32/size -16600 0x33/3 0x39/9 0x2f/slash 0x63/c 0x6f/o 0x6d/m 0x70/p 0x61/a 0x72/r 0x65/e 0x2d/dash 0x3e/> -16601 _string_3b_compare<-: # (payload array byte) +16600 0x63/c 0x6f/o 0x70/p 0x79/y 0x2d/- 0x62/b 0x79/y 0x74/t 0x65/e 0x2d/- 0x74/t 0x6f/o +16601 _string-decrement: # (payload array byte) 16602 0x11/imm32/alloc-id:fake:payload -16603 # "3b/compare<-" -16604 0xc/imm32/size -16605 0x33/3 0x62/b 0x2f/slash 0x63/c 0x6f/o 0x6d/m 0x70/p 0x61/a 0x72/r 0x65/e 0x3c/< 0x2d/dash -16606 _string_3d_compare_eax_with: # (payload array byte) +16603 # "decrement" +16604 0x9/imm32/size +16605 0x64/d 0x65/e 0x63/c 0x72/r 0x65/e 0x6d/m 0x65/e 0x6e/n 0x74/t +16606 _string-increment: # (payload array byte) 16607 0x11/imm32/alloc-id:fake:payload -16608 # "3d/compare-eax-with" -16609 0x13/imm32/size -16610 0x33/3 0x64/d 0x2f/slash 0x63/c 0x6f/o 0x6d/m 0x70/p 0x61/a 0x72/r 0x65/e 0x2d/dash 0x65/e 0x61/a 0x78/x 0x2d/dash 0x77/w 0x69/i 0x74/t 0x68/h -16611 _string_40_increment_eax: # (payload array byte) +16608 # "increment" +16609 0x9/imm32/size +16610 0x69/i 0x6e/n 0x63/c 0x72/r 0x65/e 0x6d/m 0x65/e 0x6e/n 0x74/t +16611 _string-loop: # (payload array byte) 16612 0x11/imm32/alloc-id:fake:payload -16613 # "40/increment-eax" -16614 0x10/imm32/size -16615 0x34/4 0x30/0 0x2f/slash 0x69/i 0x6e/n 0x63/c 0x72/r 0x65/e 0x6d/m 0x65/e 0x6e/n 0x74/t 0x2d/dash 0x65/e 0x61/a 0x78/x -16616 _string_41_increment_ecx: # (payload array byte) +16613 # "loop" +16614 0x4/imm32/size +16615 0x6c/l 0x6f/o 0x6f/o 0x70/p +16616 _string-loop-if-<: # (payload array byte) 16617 0x11/imm32/alloc-id:fake:payload -16618 # "41/increment-ecx" -16619 0x10/imm32/size -16620 0x34/4 0x31/1 0x2f/slash 0x69/i 0x6e/n 0x63/c 0x72/r 0x65/e 0x6d/m 0x65/e 0x6e/n 0x74/t 0x2d/dash 0x65/e 0x63/c 0x78/x -16621 _string_42_increment_edx: # (payload array byte) +16618 # "loop-if-<" +16619 0x9/imm32/size +16620 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3c/< +16621 _string-loop-if-<=: # (payload array byte) 16622 0x11/imm32/alloc-id:fake:payload -16623 # "42/increment-edx" -16624 0x10/imm32/size -16625 0x34/4 0x32/2 0x2f/slash 0x69/i 0x6e/n 0x63/c 0x72/r 0x65/e 0x6d/m 0x65/e 0x6e/n 0x74/t 0x2d/dash 0x65/e 0x64/d 0x78/x -16626 _string_43_increment_ebx: # (payload array byte) +16623 # "loop-if-<=" +16624 0xa/imm32/size +16625 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3c/< 0x3d/= +16626 _string-loop-if-=: # (payload array byte) 16627 0x11/imm32/alloc-id:fake:payload -16628 # "43/increment-ebx" -16629 0x10/imm32/size -16630 0x34/4 0x33/3 0x2f/slash 0x69/i 0x6e/n 0x63/c 0x72/r 0x65/e 0x6d/m 0x65/e 0x6e/n 0x74/t 0x2d/dash 0x65/e 0x62/b 0x78/x -16631 _string_46_increment_esi: # (payload array byte) +16628 # "loop-if-=" +16629 0x9/imm32/size +16630 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3d/= +16631 _string-loop-if->: # (payload array byte) 16632 0x11/imm32/alloc-id:fake:payload -16633 # "46/increment-esi" -16634 0x10/imm32/size -16635 0x34/4 0x36/6 0x2f/slash 0x69/i 0x6e/n 0x63/c 0x72/r 0x65/e 0x6d/m 0x65/e 0x6e/n 0x74/t 0x2d/dash 0x65/e 0x73/s 0x69/i -16636 _string_47_increment_edi: # (payload array byte) +16633 # "loop-if->" +16634 0x9/imm32/size +16635 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3e/> +16636 _string-loop-if->=: # (payload array byte) 16637 0x11/imm32/alloc-id:fake:payload -16638 # "47/increment-edi" -16639 0x10/imm32/size -16640 0x34/4 0x37/7 0x2f/slash 0x69/i 0x6e/n 0x63/c 0x72/r 0x65/e 0x6d/m 0x65/e 0x6e/n 0x74/t 0x2d/dash 0x65/e 0x64/d 0x69/i -16641 _string_48_decrement_eax: # (payload array byte) +16638 # "loop-if->=" +16639 0xa/imm32/size +16640 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3e/> 0x3d/= +16641 _string-loop-if-!=: # (payload array byte) 16642 0x11/imm32/alloc-id:fake:payload -16643 # "48/decrement-eax" -16644 0x10/imm32/size -16645 0x34/4 0x38/8 0x2f/slash 0x64/d 0x65/e 0x63/c 0x72/r 0x65/e 0x6d/m 0x65/e 0x6e/n 0x74/t 0x2d/dash 0x65/e 0x61/a 0x78/x -16646 _string_49_decrement_ecx: # (payload array byte) +16643 # "loop-if-!=" +16644 0xa/imm32/size +16645 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x21/! 0x3d/= +16646 _string-loop-if-addr<: # (payload array byte) 16647 0x11/imm32/alloc-id:fake:payload -16648 # "49/decrement-ecx" -16649 0x10/imm32/size -16650 0x34/4 0x39/9 0x2f/slash 0x64/d 0x65/e 0x63/c 0x72/r 0x65/e 0x6d/m 0x65/e 0x6e/n 0x74/t 0x2d/dash 0x65/e 0x63/c 0x78/x -16651 _string_4a_decrement_edx: # (payload array byte) +16648 # "loop-if-addr<" +16649 0xd/imm32/size +16650 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x3c/< +16651 _string-loop-if-addr<=: # (payload array byte) 16652 0x11/imm32/alloc-id:fake:payload -16653 # "4a/decrement-edx" -16654 0x10/imm32/size -16655 0x34/4 0x61/a 0x2f/slash 0x64/d 0x65/e 0x63/c 0x72/r 0x65/e 0x6d/m 0x65/e 0x6e/n 0x74/t 0x2d/dash 0x65/e 0x64/d 0x78/x -16656 _string_4b_decrement_ebx: # (payload array byte) +16653 # "loop-if-addr<=" +16654 0xe/imm32/size +16655 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x3c/< 0x3d/= +16656 _string-loop-if-addr>: # (payload array byte) 16657 0x11/imm32/alloc-id:fake:payload -16658 # "4b/decrement-ebx" -16659 0x10/imm32/size -16660 0x34/4 0x62/b 0x2f/slash 0x64/d 0x65/e 0x63/c 0x72/r 0x65/e 0x6d/m 0x65/e 0x6e/n 0x74/t 0x2d/dash 0x65/e 0x62/b 0x78/x -16661 _string_4e_decrement_esi: # (payload array byte) +16658 # "loop-if-addr>" +16659 0xd/imm32/size +16660 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x3e/> +16661 _string-loop-if-addr>=: # (payload array byte) 16662 0x11/imm32/alloc-id:fake:payload -16663 # "4e/decrement-esi" -16664 0x10/imm32/size -16665 0x34/4 0x65/e 0x2f/slash 0x64/d 0x65/e 0x63/c 0x72/r 0x65/e 0x6d/m 0x65/e 0x6e/n 0x74/t 0x2d/dash 0x65/e 0x73/s 0x69/i -16666 _string_4f_decrement_edi: # (payload array byte) +16663 # "loop-if-addr>=" +16664 0xe/imm32/size +16665 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x3e/> 0x3d/= +16666 _string-multiply: # (payload array byte) 16667 0x11/imm32/alloc-id:fake:payload -16668 # "4f/decrement-edi" -16669 0x10/imm32/size -16670 0x34/4 0x66/f 0x2f/slash 0x64/d 0x65/e 0x63/c 0x72/r 0x65/e 0x6d/m 0x65/e 0x6e/n 0x74/t 0x2d/dash 0x65/e 0x64/d 0x69/i -16671 _string_81_subop_add: # (payload array byte) +16668 # "multiply" +16669 0x8/imm32/size +16670 0x6d/m 0x75/u 0x6c/l 0x74/t 0x69/i 0x70/p 0x6c/l 0x79/y +16671 _string-or: # (payload array byte) 16672 0x11/imm32/alloc-id:fake:payload -16673 # "81 0/subop/add" -16674 0xe/imm32/size -16675 0x38/8 0x31/1 0x20/space 0x30/0 0x2f/slash 0x73/s 0x75/u 0x62/b 0x6f/o 0x70/p 0x2f/slash 0x61/a 0x64/d 0x64/d -16676 _string_81_subop_or: # (payload array byte) +16673 # "or" +16674 0x2/imm32/size +16675 0x6f/o 0x72/r +16676 _string-or-with: # (payload array byte) 16677 0x11/imm32/alloc-id:fake:payload -16678 # "81 1/subop/or" -16679 0xd/imm32/size -16680 0x38/8 0x31/1 0x20/space 0x31/1 0x2f/slash 0x73/s 0x75/u 0x62/b 0x6f/o 0x70/p 0x2f/slash 0x6f/o 0x72/r -16681 _string_81_subop_and: # (payload array byte) +16678 # "or-with" +16679 0x7/imm32/size +16680 0x6f/o 0x72/r 0x2d/dash 0x77/w 0x69/i 0x74/t 0x68/h +16681 _string-subtract: # (payload array byte) 16682 0x11/imm32/alloc-id:fake:payload -16683 # "81 4/subop/and" -16684 0xe/imm32/size -16685 0x38/8 0x31/1 0x20/space 0x34/4 0x2f/slash 0x73/s 0x75/u 0x62/b 0x6f/o 0x70/p 0x2f/slash 0x61/a 0x6e/n 0x64/d -16686 _string_81_subop_subtract: # (payload array byte) +16683 # "subtract" +16684 0x8/imm32/size +16685 0x73/s 0x75/u 0x62/b 0x74/t 0x72/r 0x61/a 0x63/c 0x74/t +16686 _string-subtract-from: # (payload array byte) 16687 0x11/imm32/alloc-id:fake:payload -16688 # "81 5/subop/subtract" -16689 0x13/imm32/size -16690 0x38/8 0x31/1 0x20/space 0x35/5 0x2f/slash 0x73/s 0x75/u 0x62/b 0x6f/o 0x70/p 0x2f/slash 0x73/s 0x75/u 0x62/b 0x74/t 0x72/r 0x61/a 0x63/c 0x74/t -16691 _string_81_subop_xor: # (payload array byte) +16688 # "subtract-from" +16689 0xd/imm32/size +16690 0x73/s 0x75/u 0x62/b 0x74/t 0x72/r 0x61/a 0x63/c 0x74/t 0x2d/dash 0x66/f 0x72/r 0x6f/o 0x6d/m +16691 _string-xor: # (payload array byte) 16692 0x11/imm32/alloc-id:fake:payload -16693 # "81 6/subop/xor" -16694 0xe/imm32/size -16695 0x38/8 0x31/1 0x20/space 0x36/6 0x2f/slash 0x73/s 0x75/u 0x62/b 0x6f/o 0x70/p 0x2f/slash 0x78/x 0x6f/o 0x72/r -16696 _string_81_subop_compare: # (payload array byte) +16693 # "xor" +16694 0x3/imm32/size +16695 0x78/x 0x6f/o 0x72/r +16696 _string-xor-with: # (payload array byte) 16697 0x11/imm32/alloc-id:fake:payload -16698 # "81 7/subop/compare" -16699 0x12/imm32/size -16700 0x38/8 0x31/1 0x20/space 0x37/7 0x2f/slash 0x73/s 0x75/u 0x62/b 0x6f/o 0x70/p 0x2f/slash 0x63/c 0x6f/o 0x6d/m 0x70/p 0x61/a 0x72/r 0x65/e -16701 _string_89_<-: # (payload array byte) -16702 0x11/imm32/alloc-id:fake:payload -16703 # "89/<-" -16704 0x5/imm32/size -16705 0x38/8 0x39/9 0x2f/slash 0x3c/< 0x2d/dash -16706 _string_8b_->: # (payload array byte) -16707 0x11/imm32/alloc-id:fake:payload -16708 # "8b/->" -16709 0x5/imm32/size -16710 0x38/8 0x62/b 0x2f/slash 0x2d/dash 0x3e/> -16711 _string_8a_copy_byte: -16712 0x11/imm32/alloc-id:fake:payload -16713 # "8a/byte->" -16714 0x9/imm32/size -16715 0x38/8 0x61/a 0x2f// 0x62/b 0x79/y 0x74/t 0x65/e 0x2d/- 0x3e/> -16716 _string_88_copy_byte: -16717 0x11/imm32/alloc-id:fake:payload -16718 # "88/byte<-" -16719 0x9/imm32/size -16720 0x38/8 0x38/8 0x2f// 0x62/b 0x79/y 0x74/t 0x65/e 0x3c/< 0x2d/- -16721 _string_8d_copy_address: # (payload array byte) -16722 0x11/imm32/alloc-id:fake:payload -16723 # "8d/copy-address" -16724 0xf/imm32/size -16725 0x38/8 0x64/d 0x2f/slash 0x63/c 0x6f/o 0x70/p 0x79/y 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x65/e 0x73/s 0x73/s -16726 _string_b8_copy_to_eax: # (payload array byte) -16727 0x11/imm32/alloc-id:fake:payload -16728 # "b8/copy-to-eax" -16729 0xe/imm32/size -16730 0x62/b 0x38/8 0x2f/slash 0x63/c 0x6f/o 0x70/p 0x79/y 0x2d/dash 0x74/t 0x6f/o 0x2d/dash 0x65/e 0x61/a 0x78/x -16731 _string_b9_copy_to_ecx: # (payload array byte) -16732 0x11/imm32/alloc-id:fake:payload -16733 # "b9/copy-to-ecx" -16734 0xe/imm32/size -16735 0x62/b 0x39/9 0x2f/slash 0x63/c 0x6f/o 0x70/p 0x79/y 0x2d/dash 0x74/t 0x6f/o 0x2d/dash 0x65/e 0x63/c 0x78/x -16736 _string_ba_copy_to_edx: # (payload array byte) -16737 0x11/imm32/alloc-id:fake:payload -16738 # "ba/copy-to-edx" -16739 0xe/imm32/size -16740 0x62/b 0x61/a 0x2f/slash 0x63/c 0x6f/o 0x70/p 0x79/y 0x2d/dash 0x74/t 0x6f/o 0x2d/dash 0x65/e 0x64/d 0x78/x -16741 _string_bb_copy_to_ebx: # (payload array byte) -16742 0x11/imm32/alloc-id:fake:payload -16743 # "bb/copy-to-ebx" -16744 0xe/imm32/size -16745 0x62/b 0x62/b 0x2f/slash 0x63/c 0x6f/o 0x70/p 0x79/y 0x2d/dash 0x74/t 0x6f/o 0x2d/dash 0x65/e 0x62/b 0x78/x -16746 _string_be_copy_to_esi: # (payload array byte) -16747 0x11/imm32/alloc-id:fake:payload -16748 # "be/copy-to-esi" -16749 0xe/imm32/size -16750 0x62/b 0x65/e 0x2f/slash 0x63/c 0x6f/o 0x70/p 0x79/y 0x2d/dash 0x74/t 0x6f/o 0x2d/dash 0x65/e 0x73/s 0x69/i -16751 _string_bf_copy_to_edi: # (payload array byte) -16752 0x11/imm32/alloc-id:fake:payload -16753 # "bf/copy-to-edi" -16754 0xe/imm32/size -16755 0x62/b 0x66/f 0x2f/slash 0x63/c 0x6f/o 0x70/p 0x79/y 0x2d/dash 0x74/t 0x6f/o 0x2d/dash 0x65/e 0x64/d 0x69/i -16756 _string_c7_subop_copy: # (payload array byte) -16757 0x11/imm32/alloc-id:fake:payload -16758 # "c7 0/subop/copy" -16759 0xf/imm32/size -16760 0x63/c 0x37/7 0x20/space 0x30/0 0x2f/slash 0x73/s 0x75/u 0x62/b 0x6f/o 0x70/p 0x2f/slash 0x63/c 0x6f/o 0x70/p 0x79/y -16761 _string_e9_jump_label: # (payload array byte) -16762 0x11/imm32/alloc-id:fake:payload -16763 # "e9/jump" -16764 0x7/imm32/size -16765 0x65/e 0x39/9 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p -16766 _string_e9_jump_break: # (payload array byte) -16767 0x11/imm32/alloc-id:fake:payload -16768 # "e9/jump break/disp32" -16769 0x14/imm32/size -16770 0x65/e 0x39/9 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x20/space 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 -16771 _string_e9_jump_loop: # (payload array byte) -16772 0x11/imm32/alloc-id:fake:payload -16773 # "e9/jump loop/disp32" -16774 0x13/imm32/size -16775 0x65/e 0x39/9 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x20/space 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 -16776 _string_ff_subop_increment: # (payload array byte) -16777 0x11/imm32/alloc-id:fake:payload -16778 # "ff 0/subop/increment" -16779 0x14/imm32/size -16780 0x66/f 0x66/f 0x20/space 0x30/0 0x2f/slash 0x73/s 0x75/u 0x62/b 0x6f/o 0x70/p 0x2f/slash 0x69/i 0x6e/n 0x63/c 0x72/r 0x65/e 0x6d/m 0x65/e 0x6e/n 0x74/t -16781 _string_ff_subop_decrement: # (payload array byte) -16782 0x11/imm32/alloc-id:fake:payload -16783 # "ff 1/subop/decrement" -16784 0x14/imm32/size -16785 0x66/f 0x66/f 0x20/space 0x31/1 0x2f/slash 0x73/s 0x75/u 0x62/b 0x6f/o 0x70/p 0x2f/slash 0x64/d 0x65/e 0x63/c 0x72/r 0x65/e 0x6d/m 0x65/e 0x6e/n 0x74/t -16786 -16787 Single-int-var-in-mem: # (payload list var) -16788 0x11/imm32/alloc-id:fake:payload -16789 0x11/imm32/alloc-id:fake -16790 Int-var-in-mem/imm32 -16791 0/imm32/next -16792 0/imm32/next -16793 -16794 Int-var-in-mem: # (payload var) -16795 0x11/imm32/alloc-id:fake:payload -16796 0/imm32/name -16797 0/imm32/name -16798 0x11/imm32/alloc-id:fake -16799 Type-int/imm32 -16800 1/imm32/some-block-depth -16801 1/imm32/some-stack-offset -16802 0/imm32/no-register -16803 0/imm32/no-register -16804 -16805 # Not really legal, but closest we can currently represent a dereference of an (addr byte) -16806 Single-byte-var-in-mem: # (payload list var) -16807 0x11/imm32/alloc-id:fake:payload -16808 0x11/imm32/alloc-id:fake -16809 Byte-var-in-mem/imm32 -16810 0/imm32/next -16811 0/imm32/next -16812 -16813 # Not really legal, but closest we can currently represent a dereference of an (addr byte) -16814 Byte-var-in-mem: # (payload var) -16815 0x11/imm32/alloc-id:fake:payload -16816 0/imm32/name -16817 0/imm32/name -16818 0x11/imm32/alloc-id:fake -16819 Type-byte/imm32 -16820 1/imm32/some-block-depth -16821 1/imm32/some-stack-offset -16822 0/imm32/no-register -16823 0/imm32/no-register -16824 -16825 Two-args-int-stack-int-reg: # (payload list var) -16826 0x11/imm32/alloc-id:fake:payload -16827 0x11/imm32/alloc-id:fake -16828 Int-var-in-mem/imm32 -16829 0x11/imm32/alloc-id:fake -16830 Single-int-var-in-some-register/imm32/next -16831 -16832 Two-int-args-in-regs: # (payload list var) -16833 0x11/imm32/alloc-id:fake:payload -16834 0x11/imm32/alloc-id:fake -16835 Int-var-in-some-register/imm32 -16836 0x11/imm32/alloc-id:fake -16837 Single-int-var-in-some-register/imm32/next -16838 -16839 # Not really legal, but closest we can currently represent a dereference of an (addr byte) -16840 Two-args-byte-stack-byte-reg: # (payload list var) -16841 0x11/imm32/alloc-id:fake:payload -16842 0x11/imm32/alloc-id:fake -16843 Byte-var-in-mem/imm32 -16844 0x11/imm32/alloc-id:fake -16845 Single-byte-var-in-some-register/imm32/next -16846 -16847 Two-args-int-reg-int-stack: # (payload list var) -16848 0x11/imm32/alloc-id:fake:payload -16849 0x11/imm32/alloc-id:fake -16850 Int-var-in-some-register/imm32 -16851 0x11/imm32/alloc-id:fake -16852 Single-int-var-in-mem/imm32/next -16853 -16854 Two-args-int-eax-int-literal: # (payload list var) -16855 0x11/imm32/alloc-id:fake:payload -16856 0x11/imm32/alloc-id:fake -16857 Int-var-in-eax/imm32 -16858 0x11/imm32/alloc-id:fake -16859 Single-lit-var/imm32/next -16860 -16861 Int-var-and-literal: # (payload list var) -16862 0x11/imm32/alloc-id:fake:payload -16863 0x11/imm32/alloc-id:fake -16864 Int-var-in-mem/imm32 -16865 0x11/imm32/alloc-id:fake -16866 Single-lit-var/imm32/next -16867 -16868 Int-var-in-register-and-literal: # (payload list var) +16698 # "xor-with" +16699 0x8/imm32/size +16700 0x78/x 0x6f/o 0x72/r 0x2d/dash 0x77/w 0x69/i 0x74/t 0x68/h +16701 +16702 # string literals for SubX instructions +16703 _string_01_add_to: # (payload array byte) +16704 0x11/imm32/alloc-id:fake:payload +16705 # "01/add-to" +16706 0x9/imm32/size +16707 0x30/0 0x31/1 0x2f/slash 0x61/a 0x64/d 0x64/d 0x2d/dash 0x74/t 0x6f/o +16708 _string_03_add: # (payload array byte) +16709 0x11/imm32/alloc-id:fake:payload +16710 # "03/add" +16711 0x6/imm32/size +16712 0x30/0 0x33/3 0x2f/slash 0x61/a 0x64/d 0x64/d +16713 _string_05_add_to_eax: # (payload array byte) +16714 0x11/imm32/alloc-id:fake:payload +16715 # "05/add-to-eax" +16716 0xd/imm32/size +16717 0x30/0 0x35/5 0x2f/slash 0x61/a 0x64/d 0x64/d 0x2d/dash 0x74/t 0x6f/o 0x2d/dash 0x65/e 0x61/a 0x78/x +16718 _string_09_or_with: # (payload array byte) +16719 0x11/imm32/alloc-id:fake:payload +16720 # "09/or-with" +16721 0xa/imm32/size +16722 0x30/0 0x39/9 0x2f/slash 0x6f/o 0x72/r 0x2d/dash 0x77/w 0x69/i 0x74/t 0x68/h +16723 _string_0b_or: # (payload array byte) +16724 0x11/imm32/alloc-id:fake:payload +16725 # "0b/or" +16726 0x5/imm32/size +16727 0x30/0 0x62/b 0x2f/slash 0x6f/o 0x72/r +16728 _string_0d_or_with_eax: # (payload array byte) +16729 0x11/imm32/alloc-id:fake:payload +16730 # "0d/or-with-eax" +16731 0xe/imm32/size +16732 0x30/0 0x64/d 0x2f/slash 0x6f/o 0x72/r 0x2d/dash 0x77/w 0x69/i 0x74/t 0x68/h 0x2d/dash 0x65/e 0x61/a 0x78/x +16733 _string_0f_82_jump_label: # (payload array byte) +16734 0x11/imm32/alloc-id:fake:payload +16735 # "0f 82/jump-if-addr<" +16736 0x13/imm32/size +16737 0x30/0 0x66/f 0x20/space 0x38/8 0x32/2 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x3c/< +16738 _string_0f_82_jump_break: # (payload array byte) +16739 0x11/imm32/alloc-id:fake:payload +16740 # "0f 82/jump-if-addr< break/disp32" +16741 0x20/imm32/size +16742 0x30/0 0x66/f 0x20/space 0x38/8 0x32/2 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x3c/< 0x20/space 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 +16743 _string_0f_82_jump_loop: # (payload array byte) +16744 0x11/imm32/alloc-id:fake:payload +16745 # "0f 82/jump-if-addr< loop/disp32" +16746 0x1f/imm32/size +16747 0x30/0 0x66/f 0x20/space 0x38/8 0x32/2 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x3c/< 0x20/space 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 +16748 _string_0f_83_jump_label: # (payload array byte) +16749 0x11/imm32/alloc-id:fake:payload +16750 # "0f 83/jump-if-addr>=" +16751 0x14/imm32/size +16752 0x30/0 0x66/f 0x20/space 0x38/8 0x33/3 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x3e/> 0x3d/= +16753 _string_0f_83_jump_break: # (payload array byte) +16754 0x11/imm32/alloc-id:fake:payload +16755 # "0f 83/jump-if-addr>= break/disp32" +16756 0x21/imm32/size +16757 0x30/0 0x66/f 0x20/space 0x38/8 0x33/3 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x3e/> 0x3d/= 0x20/space 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 +16758 _string_0f_83_jump_loop: # (payload array byte) +16759 0x11/imm32/alloc-id:fake:payload +16760 # "0f 83/jump-if-addr>= loop/disp32" +16761 0x20/imm32/size +16762 0x30/0 0x66/f 0x20/space 0x38/8 0x33/3 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x3e/> 0x3d/= 0x20/space 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 +16763 _string_0f_84_jump_label: # (payload array byte) +16764 0x11/imm32/alloc-id:fake:payload +16765 # "0f 84/jump-if-=" +16766 0xf/imm32/size +16767 0x30/0 0x66/f 0x20/space 0x38/8 0x34/4 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3d/= +16768 _string_0f_84_jump_break: # (payload array byte) +16769 0x11/imm32/alloc-id:fake:payload +16770 # "0f 84/jump-if-= break/disp32" +16771 0x1c/imm32/size +16772 0x30/0 0x66/f 0x20/space 0x38/8 0x34/4 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3d/= 0x20/space 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 +16773 _string_0f_84_jump_loop: # (payload array byte) +16774 0x11/imm32/alloc-id:fake:payload +16775 # "0f 84/jump-if-= loop/disp32" +16776 0x1b/imm32/size +16777 0x30/0 0x66/f 0x20/space 0x38/8 0x34/4 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3d/= 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 +16778 _string_0f_85_jump_label: # (payload array byte) +16779 0x11/imm32/alloc-id:fake:payload +16780 # "0f 85/jump-if-!=" +16781 0x10/imm32/size +16782 0x30/0 0x66/f 0x20/space 0x38/8 0x35/5 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x21/! 0x3d/= +16783 _string_0f_85_jump_break: # (payload array byte) +16784 0x11/imm32/alloc-id:fake:payload +16785 # "0f 85/jump-if-!= break/disp32" +16786 0x1d/imm32/size +16787 0x30/0 0x66/f 0x20/space 0x38/8 0x35/5 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x21/! 0x3d/= 0x20/space 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 +16788 _string_0f_85_jump_loop: # (payload array byte) +16789 0x11/imm32/alloc-id:fake:payload +16790 # "0f 85/jump-if-!= loop/disp32" +16791 0x1c/imm32/size +16792 0x30/0 0x66/f 0x20/space 0x38/8 0x35/5 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x21/! 0x3d/= 0x20/space 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 +16793 _string_0f_86_jump_label: # (payload array byte) +16794 0x11/imm32/alloc-id:fake:payload +16795 # "0f 86/jump-if-addr<=" +16796 0x14/imm32/size +16797 0x30/0 0x66/f 0x20/space 0x38/8 0x36/6 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x3c/< 0x3d/= +16798 _string_0f_86_jump_break: # (payload array byte) +16799 0x11/imm32/alloc-id:fake:payload +16800 # "0f 86/jump-if-addr<= break/disp32" +16801 0x21/imm32/size +16802 0x30/0 0x66/f 0x20/space 0x38/8 0x36/6 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x3c/< 0x3d/= 0x20/space 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 +16803 _string_0f_86_jump_loop: # (payload array byte) +16804 0x11/imm32/alloc-id:fake:payload +16805 # "0f 86/jump-if-addr<= loop/disp32" +16806 0x20/imm32/size +16807 0x30/0 0x66/f 0x20/space 0x38/8 0x36/6 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x3c/< 0x3d/= 0x20/space 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 +16808 _string_0f_87_jump_label: # (payload array byte) +16809 0x11/imm32/alloc-id:fake:payload +16810 # "0f 87/jump-if-addr>" +16811 0x13/imm32/size +16812 0x30/0 0x66/f 0x20/space 0x38/8 0x37/7 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x3e/> +16813 _string_0f_87_jump_break: # (payload array byte) +16814 0x11/imm32/alloc-id:fake:payload +16815 # "0f 87/jump-if-addr> break/disp32" +16816 0x20/imm32/size +16817 0x30/0 0x66/f 0x20/space 0x38/8 0x37/7 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x3e/> 0x20/space 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 +16818 _string_0f_87_jump_loop: # (payload array byte) +16819 0x11/imm32/alloc-id:fake:payload +16820 # "0f 87/jump-if-addr> loop/disp32" +16821 0x1f/imm32/size +16822 0x30/0 0x66/f 0x20/space 0x38/8 0x37/7 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x3e/> 0x20/space 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 +16823 _string_0f_8c_jump_label: # (payload array byte) +16824 0x11/imm32/alloc-id:fake:payload +16825 # "0f 8c/jump-if-<" +16826 0xf/imm32/size +16827 0x30/0 0x66/f 0x20/space 0x38/8 0x63/c 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3c/< +16828 _string_0f_8c_jump_break: # (payload array byte) +16829 0x11/imm32/alloc-id:fake:payload +16830 # "0f 8c/jump-if-< break/disp32" +16831 0x1c/imm32/size +16832 0x30/0 0x66/f 0x20/space 0x38/8 0x63/c 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3c/< 0x20/space 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 +16833 _string_0f_8c_jump_loop: # (payload array byte) +16834 0x11/imm32/alloc-id:fake:payload +16835 # "0f 8c/jump-if-< loop/disp32" +16836 0x1b/imm32/size +16837 0x30/0 0x66/f 0x20/space 0x38/8 0x63/c 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3c/< 0x20/space 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 +16838 _string_0f_8d_jump_label: # (payload array byte) +16839 0x11/imm32/alloc-id:fake:payload +16840 # "0f 8d/jump-if->=" +16841 0x10/imm32/size +16842 0x30/0 0x66/f 0x20/space 0x38/8 0x64/d 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3e/> 0x3d/= +16843 _string_0f_8d_jump_break: # (payload array byte) +16844 0x11/imm32/alloc-id:fake:payload +16845 # "0f 8d/jump-if->= break/disp32" +16846 0x1d/imm32/size +16847 0x30/0 0x66/f 0x20/space 0x38/8 0x64/d 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3e/> 0x3d/= 0x20/space 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 +16848 _string_0f_8d_jump_loop: # (payload array byte) +16849 0x11/imm32/alloc-id:fake:payload +16850 # "0f 8d/jump-if->= loop/disp32" +16851 0x1c/imm32/size +16852 0x30/0 0x66/f 0x20/space 0x38/8 0x64/d 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3e/> 0x3d/= 0x20/space 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 +16853 _string_0f_8e_jump_label: # (payload array byte) +16854 0x11/imm32/alloc-id:fake:payload +16855 # "0f 8e/jump-if-<=" +16856 0x10/imm32/size +16857 0x30/0 0x66/f 0x20/space 0x38/8 0x65/e 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3c/< 0x3d/= +16858 _string_0f_8e_jump_break: # (payload array byte) +16859 0x11/imm32/alloc-id:fake:payload +16860 # "0f 8e/jump-if-<= break/disp32" +16861 0x1d/imm32/size +16862 0x30/0 0x66/f 0x20/space 0x38/8 0x65/e 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3c/< 0x3d/= 0x20/space 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 +16863 _string_0f_8e_jump_loop: # (payload array byte) +16864 0x11/imm32/alloc-id:fake:payload +16865 # "0f 8e/jump-if-<= loop/disp32" +16866 0x1c/imm32/size +16867 0x30/0 0x66/f 0x20/space 0x38/8 0x65/e 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3c/< 0x3d/= 0x20/space 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 +16868 _string_0f_8f_jump_label: # (payload array byte) 16869 0x11/imm32/alloc-id:fake:payload -16870 0x11/imm32/alloc-id:fake -16871 Int-var-in-some-register/imm32 -16872 0x11/imm32/alloc-id:fake -16873 Single-lit-var/imm32/next -16874 -16875 Single-int-var-in-some-register: # (payload list var) -16876 0x11/imm32/alloc-id:fake:payload -16877 0x11/imm32/alloc-id:fake -16878 Int-var-in-some-register/imm32 -16879 0/imm32/next -16880 0/imm32/next -16881 -16882 Single-addr-var-in-some-register: # (payload list var) -16883 0x11/imm32/alloc-id:fake:payload -16884 0x11/imm32/alloc-id:fake -16885 Addr-var-in-some-register/imm32 -16886 0/imm32/next -16887 0/imm32/next -16888 -16889 Single-byte-var-in-some-register: # (payload list var) -16890 0x11/imm32/alloc-id:fake:payload -16891 0x11/imm32/alloc-id:fake -16892 Byte-var-in-some-register/imm32 -16893 0/imm32/next -16894 0/imm32/next -16895 -16896 Int-var-in-some-register: # (payload var) -16897 0x11/imm32/alloc-id:fake:payload -16898 0/imm32/name -16899 0/imm32/name -16900 0x11/imm32/alloc-id:fake -16901 Type-int/imm32 -16902 1/imm32/some-block-depth -16903 0/imm32/no-stack-offset -16904 0x11/imm32/alloc-id:fake -16905 Any-register/imm32 -16906 -16907 Any-register: # (payload array byte) -16908 0x11/imm32/alloc-id:fake:payload -16909 1/imm32/size -16910 # data -16911 2a/asterisk -16912 -16913 Addr-var-in-some-register: # (payload var) +16870 # "0f 8f/jump-if->" +16871 0xf/imm32/size +16872 0x30/0 0x66/f 0x20/space 0x38/8 0x66/f 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3e/> +16873 _string_0f_8f_jump_break: # (payload array byte) +16874 0x11/imm32/alloc-id:fake:payload +16875 # "0f 8f/jump-if-> break/disp32" +16876 0x1c/imm32/size +16877 0x30/0 0x66/f 0x20/space 0x38/8 0x66/f 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3e/> 0x20/space 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 +16878 _string_0f_8f_jump_loop: # (payload array byte) +16879 0x11/imm32/alloc-id:fake:payload +16880 # "0f 8f/jump-if-> loop/disp32" +16881 0x1b/imm32/size +16882 0x30/0 0x66/f 0x20/space 0x38/8 0x66/f 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x2d/dash 0x69/i 0x66/f 0x2d/dash 0x3e/> 0x20/space 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 +16883 _string_0f_af_multiply: # (payload array byte) +16884 0x11/imm32/alloc-id:fake:payload +16885 # "0f af/multiply" +16886 0xe/imm32/size +16887 0x30/0 0x66/f 0x20/space 0x61/a 0x66/f 0x2f/slash 0x6d/m 0x75/u 0x6c/l 0x74/t 0x69/i 0x70/p 0x6c/l 0x79/y +16888 _string_21_and_with: # (payload array byte) +16889 0x11/imm32/alloc-id:fake:payload +16890 # "21/and-with" +16891 0xb/imm32/size +16892 0x32/2 0x31/1 0x2f/slash 0x61/a 0x6e/n 0x64/d 0x2d/dash 0x77/w 0x69/i 0x74/t 0x68/h +16893 _string_23_and: # (payload array byte) +16894 0x11/imm32/alloc-id:fake:payload +16895 # "23/and" +16896 0x6/imm32/size +16897 0x32/2 0x33/3 0x2f/slash 0x61/a 0x6e/n 0x64/d +16898 _string_25_and_with_eax: # (payload array byte) +16899 0x11/imm32/alloc-id:fake:payload +16900 # "25/and-with-eax" +16901 0xf/imm32/size +16902 0x32/2 0x35/5 0x2f/slash 0x61/a 0x6e/n 0x64/d 0x2d/dash 0x77/w 0x69/i 0x74/t 0x68/h 0x2d/dash 0x65/e 0x61/a 0x78/x +16903 _string_29_subtract_from: # (payload array byte) +16904 0x11/imm32/alloc-id:fake:payload +16905 # "29/subtract-from" +16906 0x10/imm32/size +16907 0x32/2 0x39/9 0x2f/slash 0x73/s 0x75/u 0x62/b 0x74/t 0x72/r 0x61/a 0x63/c 0x74/t 0x2d/dash 0x66/f 0x72/r 0x6f/o 0x6d/m +16908 _string_2b_subtract: # (payload array byte) +16909 0x11/imm32/alloc-id:fake:payload +16910 # "2b/subtract" +16911 0xb/imm32/size +16912 0x32/2 0x62/b 0x2f/slash 0x73/s 0x75/u 0x62/b 0x74/t 0x72/r 0x61/a 0x63/c 0x74/t +16913 _string_2d_subtract_from_eax: # (payload array byte) 16914 0x11/imm32/alloc-id:fake:payload -16915 0/imm32/name -16916 0/imm32/name -16917 0x11/imm32/alloc-id:fake -16918 Type-addr/imm32 -16919 1/imm32/some-block-depth -16920 0/imm32/no-stack-offset -16921 0x11/imm32/alloc-id:fake -16922 Any-register/imm32 -16923 -16924 Byte-var-in-some-register: # (payload var) -16925 0x11/imm32/alloc-id:fake:payload -16926 0/imm32/name -16927 0/imm32/name -16928 0x11/imm32/alloc-id:fake -16929 Type-byte/imm32 -16930 1/imm32/some-block-depth -16931 0/imm32/no-stack-offset -16932 0x11/imm32/alloc-id:fake -16933 Any-register/imm32 -16934 -16935 Single-int-var-in-eax: # (payload list var) -16936 0x11/imm32/alloc-id:fake:payload -16937 0x11/imm32/alloc-id:fake -16938 Int-var-in-eax/imm32 -16939 0/imm32/next -16940 0/imm32/next -16941 -16942 Int-var-in-eax: -16943 0x11/imm32/alloc-id:fake:payload -16944 0/imm32/name -16945 0/imm32/name -16946 0x11/imm32/alloc-id:fake -16947 Type-int/imm32 -16948 1/imm32/some-block-depth -16949 0/imm32/no-stack-offset -16950 0x11/imm32/alloc-id:fake -16951 $Register-eax/imm32 -16952 -16953 Single-int-var-in-ecx: # (payload list var) +16915 # "2d/subtract-from-eax" +16916 0x14/imm32/size +16917 0x32/2 0x64/d 0x2f/slash 0x73/s 0x75/u 0x62/b 0x74/t 0x72/r 0x61/a 0x63/c 0x74/t 0x2d/dash 0x66/f 0x72/r 0x6f/o 0x6d/m 0x2d/dash 0x65/e 0x61/a 0x78/x +16918 _string_31_xor_with: # (payload array byte) +16919 0x11/imm32/alloc-id:fake:payload +16920 # "31/xor-with" +16921 0xb/imm32/size +16922 0x33/3 0x31/1 0x2f/slash 0x78/x 0x6f/o 0x72/r 0x2d/dash 0x77/w 0x69/i 0x74/t 0x68/h +16923 _string_33_xor: # (payload array byte) +16924 0x11/imm32/alloc-id:fake:payload +16925 # "33/xor" +16926 0x6/imm32/size +16927 0x33/3 0x33/3 0x2f/slash 0x78/x 0x6f/o 0x72/r +16928 _string_35_xor_with_eax: # (payload array byte) +16929 0x11/imm32/alloc-id:fake:payload +16930 # "35/xor-with-eax" +16931 0xf/imm32/size +16932 0x33/3 0x35/5 0x2f/slash 0x78/x 0x6f/o 0x72/r 0x2d/dash 0x77/w 0x69/i 0x74/t 0x68/h 0x2d/dash 0x65/e 0x61/a 0x78/x +16933 _string_39_compare->: # (payload array byte) +16934 0x11/imm32/alloc-id:fake:payload +16935 # "39/compare->" +16936 0xc/imm32/size +16937 0x33/3 0x39/9 0x2f/slash 0x63/c 0x6f/o 0x6d/m 0x70/p 0x61/a 0x72/r 0x65/e 0x2d/dash 0x3e/> +16938 _string_3b_compare<-: # (payload array byte) +16939 0x11/imm32/alloc-id:fake:payload +16940 # "3b/compare<-" +16941 0xc/imm32/size +16942 0x33/3 0x62/b 0x2f/slash 0x63/c 0x6f/o 0x6d/m 0x70/p 0x61/a 0x72/r 0x65/e 0x3c/< 0x2d/dash +16943 _string_3d_compare_eax_with: # (payload array byte) +16944 0x11/imm32/alloc-id:fake:payload +16945 # "3d/compare-eax-with" +16946 0x13/imm32/size +16947 0x33/3 0x64/d 0x2f/slash 0x63/c 0x6f/o 0x6d/m 0x70/p 0x61/a 0x72/r 0x65/e 0x2d/dash 0x65/e 0x61/a 0x78/x 0x2d/dash 0x77/w 0x69/i 0x74/t 0x68/h +16948 _string_40_increment_eax: # (payload array byte) +16949 0x11/imm32/alloc-id:fake:payload +16950 # "40/increment-eax" +16951 0x10/imm32/size +16952 0x34/4 0x30/0 0x2f/slash 0x69/i 0x6e/n 0x63/c 0x72/r 0x65/e 0x6d/m 0x65/e 0x6e/n 0x74/t 0x2d/dash 0x65/e 0x61/a 0x78/x +16953 _string_41_increment_ecx: # (payload array byte) 16954 0x11/imm32/alloc-id:fake:payload -16955 0x11/imm32/alloc-id:fake -16956 Int-var-in-ecx/imm32 -16957 0/imm32/next -16958 0/imm32/next -16959 -16960 Int-var-in-ecx: -16961 0x11/imm32/alloc-id:fake:payload -16962 0/imm32/name -16963 0/imm32/name -16964 0x11/imm32/alloc-id:fake -16965 Type-int/imm32 -16966 1/imm32/some-block-depth -16967 0/imm32/no-stack-offset -16968 0x11/imm32/alloc-id:fake -16969 $Register-ecx/imm32/register -16970 -16971 Single-int-var-in-edx: # (payload list var) -16972 0x11/imm32/alloc-id:fake:payload -16973 0x11/imm32/alloc-id:fake -16974 Int-var-in-edx/imm32 -16975 0/imm32/next -16976 0/imm32/next -16977 -16978 Int-var-in-edx: # (payload list var) +16955 # "41/increment-ecx" +16956 0x10/imm32/size +16957 0x34/4 0x31/1 0x2f/slash 0x69/i 0x6e/n 0x63/c 0x72/r 0x65/e 0x6d/m 0x65/e 0x6e/n 0x74/t 0x2d/dash 0x65/e 0x63/c 0x78/x +16958 _string_42_increment_edx: # (payload array byte) +16959 0x11/imm32/alloc-id:fake:payload +16960 # "42/increment-edx" +16961 0x10/imm32/size +16962 0x34/4 0x32/2 0x2f/slash 0x69/i 0x6e/n 0x63/c 0x72/r 0x65/e 0x6d/m 0x65/e 0x6e/n 0x74/t 0x2d/dash 0x65/e 0x64/d 0x78/x +16963 _string_43_increment_ebx: # (payload array byte) +16964 0x11/imm32/alloc-id:fake:payload +16965 # "43/increment-ebx" +16966 0x10/imm32/size +16967 0x34/4 0x33/3 0x2f/slash 0x69/i 0x6e/n 0x63/c 0x72/r 0x65/e 0x6d/m 0x65/e 0x6e/n 0x74/t 0x2d/dash 0x65/e 0x62/b 0x78/x +16968 _string_46_increment_esi: # (payload array byte) +16969 0x11/imm32/alloc-id:fake:payload +16970 # "46/increment-esi" +16971 0x10/imm32/size +16972 0x34/4 0x36/6 0x2f/slash 0x69/i 0x6e/n 0x63/c 0x72/r 0x65/e 0x6d/m 0x65/e 0x6e/n 0x74/t 0x2d/dash 0x65/e 0x73/s 0x69/i +16973 _string_47_increment_edi: # (payload array byte) +16974 0x11/imm32/alloc-id:fake:payload +16975 # "47/increment-edi" +16976 0x10/imm32/size +16977 0x34/4 0x37/7 0x2f/slash 0x69/i 0x6e/n 0x63/c 0x72/r 0x65/e 0x6d/m 0x65/e 0x6e/n 0x74/t 0x2d/dash 0x65/e 0x64/d 0x69/i +16978 _string_48_decrement_eax: # (payload array byte) 16979 0x11/imm32/alloc-id:fake:payload -16980 0/imm32/name -16981 0/imm32/name -16982 0x11/imm32/alloc-id:fake -16983 Type-int/imm32 -16984 1/imm32/some-block-depth -16985 0/imm32/no-stack-offset -16986 0x11/imm32/alloc-id:fake -16987 $Register-edx/imm32/register -16988 -16989 Single-int-var-in-ebx: # (payload list var) -16990 0x11/imm32/alloc-id:fake:payload -16991 0x11/imm32/alloc-id:fake -16992 Int-var-in-ebx/imm32 -16993 0/imm32/next -16994 0/imm32/next -16995 -16996 Int-var-in-ebx: # (payload list var) -16997 0x11/imm32/alloc-id:fake:payload -16998 0/imm32/name -16999 0/imm32/name -17000 0x11/imm32/alloc-id:fake -17001 Type-int/imm32 -17002 1/imm32/some-block-depth -17003 0/imm32/no-stack-offset -17004 0x11/imm32/alloc-id:fake -17005 $Register-ebx/imm32/register -17006 -17007 Single-int-var-in-esi: # (payload list var) -17008 0x11/imm32/alloc-id:fake:payload -17009 0x11/imm32/alloc-id:fake -17010 Int-var-in-esi/imm32 -17011 0/imm32/next -17012 0/imm32/next -17013 -17014 Int-var-in-esi: # (payload list var) -17015 0x11/imm32/alloc-id:fake:payload -17016 0/imm32/name -17017 0/imm32/name -17018 0x11/imm32/alloc-id:fake -17019 Type-int/imm32 -17020 1/imm32/some-block-depth -17021 0/imm32/no-stack-offset -17022 0x11/imm32/alloc-id:fake -17023 $Register-esi/imm32/register -17024 -17025 Single-int-var-in-edi: # (payload list var) -17026 0x11/imm32/alloc-id:fake:payload -17027 0x11/imm32/alloc-id:fake -17028 Int-var-in-edi/imm32 -17029 0/imm32/next -17030 0/imm32/next -17031 -17032 Int-var-in-edi: # (payload list var) -17033 0x11/imm32/alloc-id:fake:payload -17034 0/imm32/name -17035 0/imm32/name -17036 0x11/imm32/alloc-id:fake -17037 Type-int/imm32 -17038 1/imm32/some-block-depth -17039 0/imm32/no-stack-offset -17040 0x11/imm32/alloc-id:fake -17041 $Register-edi/imm32/register -17042 -17043 Single-lit-var: # (payload list var) +16980 # "48/decrement-eax" +16981 0x10/imm32/size +16982 0x34/4 0x38/8 0x2f/slash 0x64/d 0x65/e 0x63/c 0x72/r 0x65/e 0x6d/m 0x65/e 0x6e/n 0x74/t 0x2d/dash 0x65/e 0x61/a 0x78/x +16983 _string_49_decrement_ecx: # (payload array byte) +16984 0x11/imm32/alloc-id:fake:payload +16985 # "49/decrement-ecx" +16986 0x10/imm32/size +16987 0x34/4 0x39/9 0x2f/slash 0x64/d 0x65/e 0x63/c 0x72/r 0x65/e 0x6d/m 0x65/e 0x6e/n 0x74/t 0x2d/dash 0x65/e 0x63/c 0x78/x +16988 _string_4a_decrement_edx: # (payload array byte) +16989 0x11/imm32/alloc-id:fake:payload +16990 # "4a/decrement-edx" +16991 0x10/imm32/size +16992 0x34/4 0x61/a 0x2f/slash 0x64/d 0x65/e 0x63/c 0x72/r 0x65/e 0x6d/m 0x65/e 0x6e/n 0x74/t 0x2d/dash 0x65/e 0x64/d 0x78/x +16993 _string_4b_decrement_ebx: # (payload array byte) +16994 0x11/imm32/alloc-id:fake:payload +16995 # "4b/decrement-ebx" +16996 0x10/imm32/size +16997 0x34/4 0x62/b 0x2f/slash 0x64/d 0x65/e 0x63/c 0x72/r 0x65/e 0x6d/m 0x65/e 0x6e/n 0x74/t 0x2d/dash 0x65/e 0x62/b 0x78/x +16998 _string_4e_decrement_esi: # (payload array byte) +16999 0x11/imm32/alloc-id:fake:payload +17000 # "4e/decrement-esi" +17001 0x10/imm32/size +17002 0x34/4 0x65/e 0x2f/slash 0x64/d 0x65/e 0x63/c 0x72/r 0x65/e 0x6d/m 0x65/e 0x6e/n 0x74/t 0x2d/dash 0x65/e 0x73/s 0x69/i +17003 _string_4f_decrement_edi: # (payload array byte) +17004 0x11/imm32/alloc-id:fake:payload +17005 # "4f/decrement-edi" +17006 0x10/imm32/size +17007 0x34/4 0x66/f 0x2f/slash 0x64/d 0x65/e 0x63/c 0x72/r 0x65/e 0x6d/m 0x65/e 0x6e/n 0x74/t 0x2d/dash 0x65/e 0x64/d 0x69/i +17008 _string_81_subop_add: # (payload array byte) +17009 0x11/imm32/alloc-id:fake:payload +17010 # "81 0/subop/add" +17011 0xe/imm32/size +17012 0x38/8 0x31/1 0x20/space 0x30/0 0x2f/slash 0x73/s 0x75/u 0x62/b 0x6f/o 0x70/p 0x2f/slash 0x61/a 0x64/d 0x64/d +17013 _string_81_subop_or: # (payload array byte) +17014 0x11/imm32/alloc-id:fake:payload +17015 # "81 1/subop/or" +17016 0xd/imm32/size +17017 0x38/8 0x31/1 0x20/space 0x31/1 0x2f/slash 0x73/s 0x75/u 0x62/b 0x6f/o 0x70/p 0x2f/slash 0x6f/o 0x72/r +17018 _string_81_subop_and: # (payload array byte) +17019 0x11/imm32/alloc-id:fake:payload +17020 # "81 4/subop/and" +17021 0xe/imm32/size +17022 0x38/8 0x31/1 0x20/space 0x34/4 0x2f/slash 0x73/s 0x75/u 0x62/b 0x6f/o 0x70/p 0x2f/slash 0x61/a 0x6e/n 0x64/d +17023 _string_81_subop_subtract: # (payload array byte) +17024 0x11/imm32/alloc-id:fake:payload +17025 # "81 5/subop/subtract" +17026 0x13/imm32/size +17027 0x38/8 0x31/1 0x20/space 0x35/5 0x2f/slash 0x73/s 0x75/u 0x62/b 0x6f/o 0x70/p 0x2f/slash 0x73/s 0x75/u 0x62/b 0x74/t 0x72/r 0x61/a 0x63/c 0x74/t +17028 _string_81_subop_xor: # (payload array byte) +17029 0x11/imm32/alloc-id:fake:payload +17030 # "81 6/subop/xor" +17031 0xe/imm32/size +17032 0x38/8 0x31/1 0x20/space 0x36/6 0x2f/slash 0x73/s 0x75/u 0x62/b 0x6f/o 0x70/p 0x2f/slash 0x78/x 0x6f/o 0x72/r +17033 _string_81_subop_compare: # (payload array byte) +17034 0x11/imm32/alloc-id:fake:payload +17035 # "81 7/subop/compare" +17036 0x12/imm32/size +17037 0x38/8 0x31/1 0x20/space 0x37/7 0x2f/slash 0x73/s 0x75/u 0x62/b 0x6f/o 0x70/p 0x2f/slash 0x63/c 0x6f/o 0x6d/m 0x70/p 0x61/a 0x72/r 0x65/e +17038 _string_89_<-: # (payload array byte) +17039 0x11/imm32/alloc-id:fake:payload +17040 # "89/<-" +17041 0x5/imm32/size +17042 0x38/8 0x39/9 0x2f/slash 0x3c/< 0x2d/dash +17043 _string_8b_->: # (payload array byte) 17044 0x11/imm32/alloc-id:fake:payload -17045 0x11/imm32/alloc-id:fake -17046 Lit-var/imm32 -17047 0/imm32/next -17048 0/imm32/next -17049 -17050 Lit-var: # (payload var) -17051 0x11/imm32/alloc-id:fake:payload -17052 0/imm32/name -17053 0/imm32/name -17054 0x11/imm32/alloc-id:fake -17055 Type-literal/imm32 -17056 1/imm32/some-block-depth -17057 0/imm32/no-stack-offset -17058 0/imm32/no-register -17059 0/imm32/no-register -17060 -17061 Type-int: # (payload tree type-id) -17062 0x11/imm32/alloc-id:fake:payload -17063 1/imm32/left-is-atom -17064 1/imm32/value:int -17065 0/imm32/left:unused -17066 0/imm32/right:null -17067 0/imm32/right:null -17068 -17069 Type-literal: # (payload tree type-id) -17070 0x11/imm32/alloc-id:fake:payload -17071 1/imm32/is-atom -17072 0/imm32/value:literal -17073 0/imm32/left:unused -17074 0/imm32/right:null -17075 0/imm32/right:null -17076 -17077 Type-addr: # (payload tree type-id) -17078 0x11/imm32/alloc-id:fake:payload -17079 1/imm32/is-atom -17080 2/imm32/value:addr -17081 0/imm32/left:unused -17082 0/imm32/right:null -17083 0/imm32/right:null -17084 -17085 Type-byte: # (payload tree type-id) -17086 0x11/imm32/alloc-id:fake:payload -17087 1/imm32/is-atom -17088 8/imm32/value:byte -17089 0/imm32/left:unused -17090 0/imm32/right:null -17091 0/imm32/right:null -17092 -17093 == code -17094 emit-subx-primitive: # out: (addr buffered-file), stmt: (addr stmt), primitive: (addr primitive), err: (addr buffered-file), ed: (addr exit-descriptor) -17095 # . prologue -17096 55/push-ebp -17097 89/<- %ebp 4/r32/esp -17098 # . save registers -17099 50/push-eax -17100 51/push-ecx -17101 # ecx = primitive -17102 8b/-> *(ebp+0x10) 1/r32/ecx -17103 # emit primitive name -17104 (emit-indent *(ebp+8) *Curr-block-depth) -17105 (lookup *(ecx+0x18) *(ecx+0x1c)) # Primitive-subx-name Primitive-subx-name => eax -17106 (write-buffered *(ebp+8) %eax) -17107 # emit rm32 if necessary -17108 (emit-subx-rm32 *(ebp+8) *(ecx+0x20) *(ebp+0xc) *(ebp+0x14) *(ebp+0x18)) # Primitive-subx-rm32 -17109 # emit r32 if necessary -17110 (emit-subx-r32 *(ebp+8) *(ecx+0x24) *(ebp+0xc)) # Primitive-subx-r32 -17111 # emit imm32 if necessary -17112 (emit-subx-imm32 *(ebp+8) *(ecx+0x28) *(ebp+0xc)) # Primitive-subx-imm32 -17113 # emit disp32 if necessary -17114 (emit-subx-disp32 *(ebp+8) *(ecx+0x2c) *(ebp+0xc) *(ebp+0x14) *(ebp+0x18)) # Primitive-subx-disp32 -17115 (write-buffered *(ebp+8) Newline) -17116 $emit-subx-primitive:end: -17117 # . restore registers -17118 59/pop-to-ecx -17119 58/pop-to-eax -17120 # . epilogue -17121 89/<- %esp 5/r32/ebp -17122 5d/pop-to-ebp -17123 c3/return -17124 -17125 emit-subx-rm32: # out: (addr buffered-file), l: arg-location, stmt: (addr stmt), err: (addr buffered-file), ed: (addr exit-descriptor) -17126 # . prologue -17127 55/push-ebp -17128 89/<- %ebp 4/r32/esp -17129 # . save registers -17130 50/push-eax -17131 # if (l == 0) return -17132 81 7/subop/compare *(ebp+0xc) 0/imm32 -17133 74/jump-if-= $emit-subx-rm32:end/disp8 -17134 # var v/eax: (addr stmt-var) -17135 (get-stmt-operand-from-arg-location *(ebp+0x10) *(ebp+0xc) *(ebp+0x14) *(ebp+0x18)) # => eax -17136 (emit-subx-var-as-rm32 *(ebp+8) %eax) -17137 $emit-subx-rm32:end: -17138 # . restore registers -17139 58/pop-to-eax -17140 # . epilogue -17141 89/<- %esp 5/r32/ebp -17142 5d/pop-to-ebp -17143 c3/return -17144 -17145 get-stmt-operand-from-arg-location: # stmt: (addr stmt), l: arg-location, err: (addr buffered-file), ed: (addr exit-descriptor) -> var/eax: (addr stmt-var) -17146 # . prologue -17147 55/push-ebp -17148 89/<- %ebp 4/r32/esp -17149 # . save registers -17150 51/push-ecx -17151 # eax = l -17152 8b/-> *(ebp+0xc) 0/r32/eax -17153 # ecx = stmt -17154 8b/-> *(ebp+8) 1/r32/ecx -17155 # if (l == 1) return stmt->inouts -17156 { -17157 3d/compare-eax-and 1/imm32 -17158 75/jump-if-!= break/disp8 -17159 $get-stmt-operand-from-arg-location:1: -17160 (lookup *(ecx+0xc) *(ecx+0x10)) # Stmt1-inouts Stmt1-inouts => eax -17161 eb/jump $get-stmt-operand-from-arg-location:end/disp8 -17162 } -17163 # if (l == 2) return stmt->inouts->next -17164 { -17165 3d/compare-eax-and 2/imm32 -17166 75/jump-if-!= break/disp8 -17167 $get-stmt-operand-from-arg-location:2: -17168 (lookup *(ecx+0xc) *(ecx+0x10)) # Stmt1-inouts Stmt1-inouts => eax -17169 (lookup *(eax+8) *(eax+0xc)) # Stmt-var-next Stmt-var-next => eax -17170 eb/jump $get-stmt-operand-from-arg-location:end/disp8 -17171 } -17172 # if (l == 3) return stmt->outputs -17173 { -17174 3d/compare-eax-and 3/imm32 -17175 75/jump-if-!= break/disp8 -17176 $get-stmt-operand-from-arg-location:3: -17177 (lookup *(ecx+0x14) *(ecx+0x18)) # Stmt1-outputs Stmt1-outputs => eax -17178 eb/jump $get-stmt-operand-from-arg-location:end/disp8 -17179 } -17180 # abort -17181 e9/jump $get-stmt-operand-from-arg-location:abort/disp32 -17182 $get-stmt-operand-from-arg-location:end: -17183 # . restore registers -17184 59/pop-to-ecx -17185 # . epilogue -17186 89/<- %esp 5/r32/ebp -17187 5d/pop-to-ebp -17188 c3/return -17189 -17190 $get-stmt-operand-from-arg-location:abort: -17191 # error("invalid arg-location " eax) -17192 (write-buffered *(ebp+0x10) "invalid arg-location ") -17193 (write-int32-hex-buffered *(ebp+0x10) %eax) -17194 (write-buffered *(ebp+0x10) Newline) -17195 (flush *(ebp+0x10)) -17196 (stop *(ebp+0x14) 1) -17197 # never gets here -17198 -17199 emit-subx-r32: # out: (addr buffered-file), l: arg-location, stmt: (addr stmt) -17200 # . prologue -17201 55/push-ebp -17202 89/<- %ebp 4/r32/esp -17203 # . save registers -17204 50/push-eax -17205 51/push-ecx -17206 # if (l == 0) return -17207 81 7/subop/compare *(ebp+0xc) 0/imm32 -17208 0f 84/jump-if-= $emit-subx-r32:end/disp32 -17209 # var v/eax: (addr stmt-var) -17210 (get-stmt-operand-from-arg-location *(ebp+0x10) *(ebp+0xc)) # => eax -17211 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax -17212 (lookup *(eax+0x18) *(eax+0x1c)) # Var-register Var-register => eax -17213 (maybe-get Mu-registers %eax 0xc) # => eax: (addr register-index) -17214 (write-buffered *(ebp+8) Space) -17215 (write-int32-hex-buffered *(ebp+8) *eax) -17216 (write-buffered *(ebp+8) "/r32") -17217 $emit-subx-r32:end: -17218 # . restore registers -17219 59/pop-to-ecx -17220 58/pop-to-eax -17221 # . epilogue -17222 89/<- %esp 5/r32/ebp -17223 5d/pop-to-ebp -17224 c3/return +17045 # "8b/->" +17046 0x5/imm32/size +17047 0x38/8 0x62/b 0x2f/slash 0x2d/dash 0x3e/> +17048 _string_8a_copy_byte: +17049 0x11/imm32/alloc-id:fake:payload +17050 # "8a/byte->" +17051 0x9/imm32/size +17052 0x38/8 0x61/a 0x2f// 0x62/b 0x79/y 0x74/t 0x65/e 0x2d/- 0x3e/> +17053 _string_88_copy_byte: +17054 0x11/imm32/alloc-id:fake:payload +17055 # "88/byte<-" +17056 0x9/imm32/size +17057 0x38/8 0x38/8 0x2f// 0x62/b 0x79/y 0x74/t 0x65/e 0x3c/< 0x2d/- +17058 _string_8d_copy_address: # (payload array byte) +17059 0x11/imm32/alloc-id:fake:payload +17060 # "8d/copy-address" +17061 0xf/imm32/size +17062 0x38/8 0x64/d 0x2f/slash 0x63/c 0x6f/o 0x70/p 0x79/y 0x2d/dash 0x61/a 0x64/d 0x64/d 0x72/r 0x65/e 0x73/s 0x73/s +17063 _string_b8_copy_to_eax: # (payload array byte) +17064 0x11/imm32/alloc-id:fake:payload +17065 # "b8/copy-to-eax" +17066 0xe/imm32/size +17067 0x62/b 0x38/8 0x2f/slash 0x63/c 0x6f/o 0x70/p 0x79/y 0x2d/dash 0x74/t 0x6f/o 0x2d/dash 0x65/e 0x61/a 0x78/x +17068 _string_b9_copy_to_ecx: # (payload array byte) +17069 0x11/imm32/alloc-id:fake:payload +17070 # "b9/copy-to-ecx" +17071 0xe/imm32/size +17072 0x62/b 0x39/9 0x2f/slash 0x63/c 0x6f/o 0x70/p 0x79/y 0x2d/dash 0x74/t 0x6f/o 0x2d/dash 0x65/e 0x63/c 0x78/x +17073 _string_ba_copy_to_edx: # (payload array byte) +17074 0x11/imm32/alloc-id:fake:payload +17075 # "ba/copy-to-edx" +17076 0xe/imm32/size +17077 0x62/b 0x61/a 0x2f/slash 0x63/c 0x6f/o 0x70/p 0x79/y 0x2d/dash 0x74/t 0x6f/o 0x2d/dash 0x65/e 0x64/d 0x78/x +17078 _string_bb_copy_to_ebx: # (payload array byte) +17079 0x11/imm32/alloc-id:fake:payload +17080 # "bb/copy-to-ebx" +17081 0xe/imm32/size +17082 0x62/b 0x62/b 0x2f/slash 0x63/c 0x6f/o 0x70/p 0x79/y 0x2d/dash 0x74/t 0x6f/o 0x2d/dash 0x65/e 0x62/b 0x78/x +17083 _string_be_copy_to_esi: # (payload array byte) +17084 0x11/imm32/alloc-id:fake:payload +17085 # "be/copy-to-esi" +17086 0xe/imm32/size +17087 0x62/b 0x65/e 0x2f/slash 0x63/c 0x6f/o 0x70/p 0x79/y 0x2d/dash 0x74/t 0x6f/o 0x2d/dash 0x65/e 0x73/s 0x69/i +17088 _string_bf_copy_to_edi: # (payload array byte) +17089 0x11/imm32/alloc-id:fake:payload +17090 # "bf/copy-to-edi" +17091 0xe/imm32/size +17092 0x62/b 0x66/f 0x2f/slash 0x63/c 0x6f/o 0x70/p 0x79/y 0x2d/dash 0x74/t 0x6f/o 0x2d/dash 0x65/e 0x64/d 0x69/i +17093 _string_c7_subop_copy: # (payload array byte) +17094 0x11/imm32/alloc-id:fake:payload +17095 # "c7 0/subop/copy" +17096 0xf/imm32/size +17097 0x63/c 0x37/7 0x20/space 0x30/0 0x2f/slash 0x73/s 0x75/u 0x62/b 0x6f/o 0x70/p 0x2f/slash 0x63/c 0x6f/o 0x70/p 0x79/y +17098 _string_e9_jump_label: # (payload array byte) +17099 0x11/imm32/alloc-id:fake:payload +17100 # "e9/jump" +17101 0x7/imm32/size +17102 0x65/e 0x39/9 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p +17103 _string_e9_jump_break: # (payload array byte) +17104 0x11/imm32/alloc-id:fake:payload +17105 # "e9/jump break/disp32" +17106 0x14/imm32/size +17107 0x65/e 0x39/9 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x20/space 0x62/b 0x72/r 0x65/e 0x61/a 0x6b/k 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 +17108 _string_e9_jump_loop: # (payload array byte) +17109 0x11/imm32/alloc-id:fake:payload +17110 # "e9/jump loop/disp32" +17111 0x13/imm32/size +17112 0x65/e 0x39/9 0x2f/slash 0x6a/j 0x75/u 0x6d/m 0x70/p 0x20/space 0x6c/l 0x6f/o 0x6f/o 0x70/p 0x2f/slash 0x64/d 0x69/i 0x73/s 0x70/p 0x33/3 0x32/2 +17113 _string_ff_subop_increment: # (payload array byte) +17114 0x11/imm32/alloc-id:fake:payload +17115 # "ff 0/subop/increment" +17116 0x14/imm32/size +17117 0x66/f 0x66/f 0x20/space 0x30/0 0x2f/slash 0x73/s 0x75/u 0x62/b 0x6f/o 0x70/p 0x2f/slash 0x69/i 0x6e/n 0x63/c 0x72/r 0x65/e 0x6d/m 0x65/e 0x6e/n 0x74/t +17118 _string_ff_subop_decrement: # (payload array byte) +17119 0x11/imm32/alloc-id:fake:payload +17120 # "ff 1/subop/decrement" +17121 0x14/imm32/size +17122 0x66/f 0x66/f 0x20/space 0x31/1 0x2f/slash 0x73/s 0x75/u 0x62/b 0x6f/o 0x70/p 0x2f/slash 0x64/d 0x65/e 0x63/c 0x72/r 0x65/e 0x6d/m 0x65/e 0x6e/n 0x74/t +17123 +17124 Single-int-var-in-mem: # (payload list var) +17125 0x11/imm32/alloc-id:fake:payload +17126 0x11/imm32/alloc-id:fake +17127 Int-var-in-mem/imm32 +17128 0/imm32/next +17129 0/imm32/next +17130 +17131 Int-var-in-mem: # (payload var) +17132 0x11/imm32/alloc-id:fake:payload +17133 0/imm32/name +17134 0/imm32/name +17135 0x11/imm32/alloc-id:fake +17136 Type-int/imm32 +17137 1/imm32/some-block-depth +17138 1/imm32/some-stack-offset +17139 0/imm32/no-register +17140 0/imm32/no-register +17141 +17142 # Not really legal, but closest we can currently represent a dereference of an (addr byte) +17143 Single-byte-var-in-mem: # (payload list var) +17144 0x11/imm32/alloc-id:fake:payload +17145 0x11/imm32/alloc-id:fake +17146 Byte-var-in-mem/imm32 +17147 0/imm32/next +17148 0/imm32/next +17149 +17150 # Not really legal, but closest we can currently represent a dereference of an (addr byte) +17151 Byte-var-in-mem: # (payload var) +17152 0x11/imm32/alloc-id:fake:payload +17153 0/imm32/name +17154 0/imm32/name +17155 0x11/imm32/alloc-id:fake +17156 Type-byte/imm32 +17157 1/imm32/some-block-depth +17158 1/imm32/some-stack-offset +17159 0/imm32/no-register +17160 0/imm32/no-register +17161 +17162 Two-args-int-stack-int-reg: # (payload list var) +17163 0x11/imm32/alloc-id:fake:payload +17164 0x11/imm32/alloc-id:fake +17165 Int-var-in-mem/imm32 +17166 0x11/imm32/alloc-id:fake +17167 Single-int-var-in-some-register/imm32/next +17168 +17169 Two-int-args-in-regs: # (payload list var) +17170 0x11/imm32/alloc-id:fake:payload +17171 0x11/imm32/alloc-id:fake +17172 Int-var-in-some-register/imm32 +17173 0x11/imm32/alloc-id:fake +17174 Single-int-var-in-some-register/imm32/next +17175 +17176 # Not really legal, but closest we can currently represent a dereference of an (addr byte) +17177 Two-args-byte-stack-byte-reg: # (payload list var) +17178 0x11/imm32/alloc-id:fake:payload +17179 0x11/imm32/alloc-id:fake +17180 Byte-var-in-mem/imm32 +17181 0x11/imm32/alloc-id:fake +17182 Single-byte-var-in-some-register/imm32/next +17183 +17184 Two-args-int-reg-int-stack: # (payload list var) +17185 0x11/imm32/alloc-id:fake:payload +17186 0x11/imm32/alloc-id:fake +17187 Int-var-in-some-register/imm32 +17188 0x11/imm32/alloc-id:fake +17189 Single-int-var-in-mem/imm32/next +17190 +17191 Two-args-int-eax-int-literal: # (payload list var) +17192 0x11/imm32/alloc-id:fake:payload +17193 0x11/imm32/alloc-id:fake +17194 Int-var-in-eax/imm32 +17195 0x11/imm32/alloc-id:fake +17196 Single-lit-var/imm32/next +17197 +17198 Int-var-and-literal: # (payload list var) +17199 0x11/imm32/alloc-id:fake:payload +17200 0x11/imm32/alloc-id:fake +17201 Int-var-in-mem/imm32 +17202 0x11/imm32/alloc-id:fake +17203 Single-lit-var/imm32/next +17204 +17205 Int-var-in-register-and-literal: # (payload list var) +17206 0x11/imm32/alloc-id:fake:payload +17207 0x11/imm32/alloc-id:fake +17208 Int-var-in-some-register/imm32 +17209 0x11/imm32/alloc-id:fake +17210 Single-lit-var/imm32/next +17211 +17212 Single-int-var-in-some-register: # (payload list var) +17213 0x11/imm32/alloc-id:fake:payload +17214 0x11/imm32/alloc-id:fake +17215 Int-var-in-some-register/imm32 +17216 0/imm32/next +17217 0/imm32/next +17218 +17219 Single-addr-var-in-some-register: # (payload list var) +17220 0x11/imm32/alloc-id:fake:payload +17221 0x11/imm32/alloc-id:fake +17222 Addr-var-in-some-register/imm32 +17223 0/imm32/next +17224 0/imm32/next 17225 -17226 emit-subx-imm32: # out: (addr buffered-file), l: arg-location, stmt: (addr stmt) -17227 # . prologue -17228 55/push-ebp -17229 89/<- %ebp 4/r32/esp -17230 # . save registers -17231 50/push-eax -17232 51/push-ecx -17233 # if (l == 0) return -17234 81 7/subop/compare *(ebp+0xc) 0/imm32 -17235 0f 84/jump-if-= $emit-subx-imm32:end/disp32 -17236 # var v/eax: (handle var) -17237 (get-stmt-operand-from-arg-location *(ebp+0x10) *(ebp+0xc)) # => eax -17238 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax -17239 (lookup *eax *(eax+4)) # Var-name Var-name => eax -17240 (write-buffered *(ebp+8) Space) -17241 (write-buffered *(ebp+8) %eax) -17242 (write-buffered *(ebp+8) "/imm32") -17243 $emit-subx-imm32:end: -17244 # . restore registers -17245 59/pop-to-ecx -17246 58/pop-to-eax -17247 # . epilogue -17248 89/<- %esp 5/r32/ebp -17249 5d/pop-to-ebp -17250 c3/return -17251 -17252 emit-subx-disp32: # out: (addr buffered-file), l: arg-location, stmt: (addr stmt), err: (addr buffered-file), ed: (addr exit-descriptor) -17253 # . prologue -17254 55/push-ebp -17255 89/<- %ebp 4/r32/esp -17256 # . save registers -17257 50/push-eax -17258 51/push-ecx -17259 # if (location == 0) return -17260 81 7/subop/compare *(ebp+0xc) 0/imm32 -17261 0f 84/jump-if-= $emit-subx-disp32:end/disp32 -17262 # var v/eax: (addr stmt-var) -17263 (get-stmt-operand-from-arg-location *(ebp+0x10) *(ebp+0xc) *(ebp+0x14) *(ebp+0x18)) # => eax -17264 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax -17265 (lookup *eax *(eax+4)) # Var-name Var-name => eax -17266 (write-buffered *(ebp+8) Space) -17267 (write-buffered *(ebp+8) %eax) -17268 # hack: if instruction operation starts with "break", emit ":break" -17269 # var name/ecx: (addr array byte) = lookup(stmt->operation) -17270 8b/-> *(ebp+0x10) 0/r32/eax -17271 (lookup *(eax+4) *(eax+8)) # Stmt1-operation Stmt1-operation => eax -17272 89/<- %ecx 0/r32/eax -17273 { -17274 (string-starts-with? %ecx "break") # => eax -17275 3d/compare-eax-and 0/imm32/false -17276 74/jump-if-= break/disp8 -17277 (write-buffered *(ebp+8) ":break") -17278 } -17279 # hack: if instruction operation starts with "loop", emit ":loop" -17280 { -17281 (string-starts-with? %ecx "loop") # => eax -17282 3d/compare-eax-and 0/imm32/false -17283 74/jump-if-= break/disp8 -17284 (write-buffered *(ebp+8) ":loop") -17285 } -17286 (write-buffered *(ebp+8) "/disp32") -17287 $emit-subx-disp32:end: -17288 # . restore registers -17289 59/pop-to-ecx -17290 58/pop-to-eax -17291 # . epilogue -17292 89/<- %esp 5/r32/ebp -17293 5d/pop-to-ebp -17294 c3/return -17295 -17296 emit-call: # out: (addr buffered-file), stmt: (addr stmt) -17297 # . prologue -17298 55/push-ebp -17299 89/<- %ebp 4/r32/esp -17300 # . save registers -17301 50/push-eax -17302 51/push-ecx -17303 # -17304 (emit-indent *(ebp+8) *Curr-block-depth) -17305 (write-buffered *(ebp+8) "(") -17306 # ecx = stmt -17307 8b/-> *(ebp+0xc) 1/r32/ecx -17308 # - emit function name -17309 (lookup *(ecx+4) *(ecx+8)) # Stmt1-operation Stmt1-operation => eax -17310 (write-buffered *(ebp+8) %eax) -17311 # - emit arguments -17312 # var curr/eax: (addr stmt-var) = lookup(stmt->inouts) -17313 (lookup *(ecx+0xc) *(ecx+0x10)) # Stmt1-inouts Stmt1-inouts => eax -17314 { -17315 # if (curr == null) break -17316 3d/compare-eax-and 0/imm32 -17317 74/jump-if-= break/disp8 -17318 # -17319 (emit-subx-call-operand *(ebp+8) %eax) -17320 # curr = lookup(curr->next) -17321 (lookup *(eax+8) *(eax+0xc)) # Stmt-var-next Stmt-var-next => eax -17322 eb/jump loop/disp8 -17323 } -17324 # -17325 (write-buffered *(ebp+8) ")\n") -17326 $emit-call:end: -17327 # . restore registers -17328 59/pop-to-ecx -17329 58/pop-to-eax -17330 # . epilogue -17331 89/<- %esp 5/r32/ebp -17332 5d/pop-to-ebp -17333 c3/return -17334 -17335 emit-subx-call-operand: # out: (addr buffered-file), s: (addr stmt-var) -17336 # shares code with emit-subx-var-as-rm32 -17337 # . prologue -17338 55/push-ebp -17339 89/<- %ebp 4/r32/esp -17340 # . save registers -17341 50/push-eax -17342 51/push-ecx -17343 56/push-esi -17344 # ecx = s -17345 8b/-> *(ebp+0xc) 1/r32/ecx -17346 # var operand/esi: (addr var) = lookup(s->value) -17347 (lookup *ecx *(ecx+4)) # Stmt-var-value Stmt-var-value => eax -17348 89/<- %esi 0/r32/eax -17349 # if (operand->register && !s->is-deref?) emit "%__" -17350 { -17351 $emit-subx-call-operand:check-for-register-direct: -17352 81 7/subop/compare *(esi+0x18) 0/imm32 # Var-register -17353 74/jump-if-= break/disp8 -17354 81 7/subop/compare *(ecx+0x10) 0/imm32/false # Stmt-var-is-deref -17355 75/jump-if-!= break/disp8 -17356 $emit-subx-call-operand:register-direct: -17357 (write-buffered *(ebp+8) " %") -17358 (lookup *(esi+0x18) *(esi+0x1c)) # Var-register Var-register => eax -17359 (write-buffered *(ebp+8) %eax) -17360 e9/jump $emit-subx-call-operand:end/disp32 -17361 } -17362 # else if (operand->register && s->is-deref?) emit "*__" -17363 { -17364 $emit-subx-call-operand:check-for-register-indirect: -17365 81 7/subop/compare *(esi+0x18) 0/imm32 # Var-register -17366 74/jump-if-= break/disp8 -17367 81 7/subop/compare *(ecx+0x10) 0/imm32/false # Stmt-var-is-deref -17368 74/jump-if-= break/disp8 -17369 $emit-subx-call-operand:register-indirect: -17370 (emit-subx-call-operand-register-indirect *(ebp+8) %esi) -17371 e9/jump $emit-subx-call-operand:end/disp32 -17372 } -17373 # else if (operand->stack-offset) emit "*(ebp+__)" -17374 { -17375 81 7/subop/compare *(esi+0x14) 0/imm32 # Var-offset -17376 74/jump-if-= break/disp8 -17377 $emit-subx-call-operand:stack: -17378 (emit-subx-call-operand-stack *(ebp+8) %esi) -17379 e9/jump $emit-subx-call-operand:end/disp32 -17380 } -17381 # else if (operand->type == literal) emit "__" -17382 { -17383 (lookup *(esi+8) *(esi+0xc)) # Var-type Var-type => eax -17384 81 7/subop/compare *(eax+4) 0/imm32 # Tree-left -17385 75/jump-if-!= break/disp8 -17386 $emit-subx-call-operand:literal: -17387 (write-buffered *(ebp+8) Space) -17388 (lookup *esi *(esi+4)) # Var-name Var-name => eax -17389 (write-buffered *(ebp+8) %eax) -17390 } -17391 $emit-subx-call-operand:end: -17392 # . restore registers -17393 5e/pop-to-esi -17394 59/pop-to-ecx -17395 58/pop-to-eax -17396 # . epilogue -17397 89/<- %esp 5/r32/ebp -17398 5d/pop-to-ebp -17399 c3/return -17400 -17401 emit-subx-call-operand-register-indirect: # out: (addr buffered-file), v: (addr var) -17402 # . prologue -17403 55/push-ebp -17404 89/<- %ebp 4/r32/esp -17405 # . save registers -17406 50/push-eax -17407 51/push-ecx -17408 56/push-esi -17409 # esi = v -17410 8b/-> *(ebp+0xc) 6/r32/esi -17411 # var size/ecx: int = size-of-deref(v) -17412 (size-of-deref %esi) # => eax -17413 89/<- %ecx 0/r32/eax -17414 # var reg-name/esi: (addr array byte) = lookup(v->register) -17415 (lookup *(esi+0x18) *(esi+0x1c)) # Var-register Var-register => eax -17416 89/<- %esi 0/r32/eax -17417 # TODO: assert size is a multiple of 4 -17418 # var i/eax: int = 0 -17419 b8/copy-to-eax 0/imm32 -17420 { -17421 $emit-subx-call-operand-register-indirect:loop: -17422 # if (i >= size) break -17423 39/compare %eax 1/r32/ecx -17424 7d/jump-if->= break/disp8 -17425 # emit " *(" v->register "+" i ")" -17426 (write-buffered *(ebp+8) " *(") -17427 (write-buffered *(ebp+8) %esi) -17428 (write-buffered *(ebp+8) "+") -17429 (write-int32-hex-buffered *(ebp+8) %eax) -17430 (write-buffered *(ebp+8) ")") -17431 # i += 4 -17432 05/add-to-eax 4/imm32 -17433 # -17434 eb/jump loop/disp8 -17435 } -17436 $emit-subx-call-operand-register-indirect:end: -17437 # . restore registers -17438 5e/pop-to-esi -17439 59/pop-to-ecx -17440 58/pop-to-eax -17441 # . epilogue -17442 89/<- %esp 5/r32/ebp -17443 5d/pop-to-ebp -17444 c3/return -17445 -17446 emit-subx-call-operand-stack: # out: (addr buffered-file), v: (addr var) -17447 # . prologue -17448 55/push-ebp -17449 89/<- %ebp 4/r32/esp -17450 # . save registers -17451 50/push-eax -17452 51/push-ecx -17453 56/push-esi -17454 # esi = v -17455 8b/-> *(ebp+0xc) 6/r32/esi -17456 # var curr/ecx: int = v->offset -17457 8b/-> *(esi+0x14) 1/r32/ecx # Var-offset -17458 # var max/eax: int = v->offset + size-of(v) -17459 (size-of %esi) # => eax -17460 # TODO: assert size is a multiple of 4 -17461 01/add-to %eax 1/r32/ecx -17462 { -17463 $emit-subx-call-operand-stack:loop: -17464 # if (curr >= max) break -17465 39/compare %ecx 0/r32/eax -17466 7d/jump-if->= break/disp8 -17467 # emit " *(ebp+" curr ")" -17468 (write-buffered *(ebp+8) " *(ebp+") -17469 (write-int32-hex-buffered *(ebp+8) %ecx) -17470 (write-buffered *(ebp+8) ")") -17471 # i += 4 -17472 81 0/subop/add %ecx 4/imm32 -17473 # -17474 eb/jump loop/disp8 -17475 } -17476 $emit-subx-call-operand-stack:end: -17477 # . restore registers -17478 5e/pop-to-esi -17479 59/pop-to-ecx -17480 58/pop-to-eax -17481 # . epilogue -17482 89/<- %esp 5/r32/ebp -17483 5d/pop-to-ebp -17484 c3/return -17485 -17486 emit-subx-var-as-rm32: # out: (addr buffered-file), s: (addr stmt-var) -17487 # . prologue -17488 55/push-ebp -17489 89/<- %ebp 4/r32/esp -17490 # . save registers -17491 50/push-eax -17492 51/push-ecx -17493 56/push-esi -17494 # ecx = s -17495 8b/-> *(ebp+0xc) 1/r32/ecx -17496 # var operand/esi: (addr var) = lookup(s->value) -17497 (lookup *ecx *(ecx+4)) # Stmt-var-value Stmt-var-value => eax -17498 89/<- %esi 0/r32/eax -17499 # if (operand->register && s->is-deref?) emit "*__" -17500 { -17501 $emit-subx-var-as-rm32:check-for-register-indirect: -17502 81 7/subop/compare *(esi+0x18) 0/imm32 # Var-register -17503 74/jump-if-= break/disp8 -17504 81 7/subop/compare *(ecx+0x10) 0/imm32/false # Stmt-var-is-deref -17505 74/jump-if-= break/disp8 -17506 $emit-subx-var-as-rm32:register-indirect: -17507 (write-buffered *(ebp+8) " *") -17508 (lookup *(esi+0x18) *(esi+0x1c)) # Var-register Var-register => eax -17509 (write-buffered *(ebp+8) %eax) -17510 e9/jump $emit-subx-var-as-rm32:end/disp32 -17511 } -17512 # if (operand->register && !s->is-deref?) emit "%__" -17513 { -17514 $emit-subx-var-as-rm32:check-for-register-direct: -17515 81 7/subop/compare *(esi+0x18) 0/imm32 # Var-register -17516 74/jump-if-= break/disp8 -17517 81 7/subop/compare *(ecx+0x10) 0/imm32/false # Stmt-var-is-deref -17518 75/jump-if-!= break/disp8 -17519 $emit-subx-var-as-rm32:register-direct: -17520 (write-buffered *(ebp+8) " %") -17521 (lookup *(esi+0x18) *(esi+0x1c)) # Var-register Var-register => eax -17522 (write-buffered *(ebp+8) %eax) -17523 e9/jump $emit-subx-var-as-rm32:end/disp32 -17524 } -17525 # else if (operand->stack-offset) emit "*(ebp+__)" -17526 { -17527 81 7/subop/compare *(esi+0x14) 0/imm32 # Var-offset -17528 74/jump-if-= break/disp8 -17529 $emit-subx-var-as-rm32:stack: -17530 (write-buffered *(ebp+8) Space) -17531 (write-buffered *(ebp+8) "*(ebp+") -17532 (write-int32-hex-buffered *(ebp+8) *(esi+0x14)) # Var-offset -17533 (write-buffered *(ebp+8) ")") -17534 } -17535 $emit-subx-var-as-rm32:end: -17536 # . restore registers -17537 5e/pop-to-esi -17538 59/pop-to-ecx -17539 58/pop-to-eax -17540 # . epilogue -17541 89/<- %esp 5/r32/ebp -17542 5d/pop-to-ebp -17543 c3/return -17544 -17545 find-matching-primitive: # primitives: (addr primitive), stmt: (addr stmt) -> result/eax: (addr primitive) -17546 # . prologue -17547 55/push-ebp -17548 89/<- %ebp 4/r32/esp -17549 # . save registers -17550 51/push-ecx -17551 # var curr/ecx: (addr primitive) = primitives -17552 8b/-> *(ebp+8) 1/r32/ecx -17553 { -17554 $find-matching-primitive:loop: -17555 # if (curr == null) break -17556 81 7/subop/compare %ecx 0/imm32 -17557 74/jump-if-= break/disp8 -17558 # if match(curr, stmt) return curr -17559 { -17560 (mu-stmt-matches-primitive? *(ebp+0xc) %ecx) # => eax -17561 3d/compare-eax-and 0/imm32/false -17562 74/jump-if-= break/disp8 -17563 89/<- %eax 1/r32/ecx -17564 eb/jump $find-matching-primitive:end/disp8 -17565 } -17566 $find-matching-primitive:next-primitive: -17567 # curr = curr->next -17568 (lookup *(ecx+0x34) *(ecx+0x38)) # Primitive-next Primitive-next => eax -17569 89/<- %ecx 0/r32/eax -17570 # -17571 e9/jump loop/disp32 -17572 } -17573 # return null -17574 b8/copy-to-eax 0/imm32 -17575 $find-matching-primitive:end: -17576 # . restore registers -17577 59/pop-to-ecx -17578 # . epilogue -17579 89/<- %esp 5/r32/ebp -17580 5d/pop-to-ebp -17581 c3/return -17582 -17583 mu-stmt-matches-primitive?: # stmt: (addr stmt), primitive: (addr primitive) -> result/eax: boolean -17584 # A mu stmt matches a primitive if the name matches, all the inout vars -17585 # match, and all the output vars match. -17586 # Vars match if types match and registers match. -17587 # In addition, a stmt output matches a primitive's output if types match -17588 # and the primitive has a wildcard register. -17589 # . prologue -17590 55/push-ebp -17591 89/<- %ebp 4/r32/esp -17592 # . save registers -17593 51/push-ecx -17594 52/push-edx -17595 53/push-ebx -17596 56/push-esi -17597 57/push-edi -17598 # ecx = stmt -17599 8b/-> *(ebp+8) 1/r32/ecx -17600 # edx = primitive -17601 8b/-> *(ebp+0xc) 2/r32/edx -17602 { -17603 $mu-stmt-matches-primitive?:check-name: -17604 # if (primitive->name != stmt->operation) return false -17605 # . var esi: (addr array byte) = lookup(stmt->operation) -17606 (lookup *(ecx+4) *(ecx+8)) # Stmt1-operation Stmt1-operation => eax -17607 89/<- %esi 0/r32/eax -17608 # . var edi: (addr array byte) = lookup(primitive->name) -17609 (lookup *edx *(edx+4)) # Primitive-name Primitive-name => eax -17610 89/<- %edi 0/r32/eax -17611 (string-equal? %esi %edi) # => eax +17226 Single-byte-var-in-some-register: # (payload list var) +17227 0x11/imm32/alloc-id:fake:payload +17228 0x11/imm32/alloc-id:fake +17229 Byte-var-in-some-register/imm32 +17230 0/imm32/next +17231 0/imm32/next +17232 +17233 Int-var-in-some-register: # (payload var) +17234 0x11/imm32/alloc-id:fake:payload +17235 0/imm32/name +17236 0/imm32/name +17237 0x11/imm32/alloc-id:fake +17238 Type-int/imm32 +17239 1/imm32/some-block-depth +17240 0/imm32/no-stack-offset +17241 0x11/imm32/alloc-id:fake +17242 Any-register/imm32 +17243 +17244 Any-register: # (payload array byte) +17245 0x11/imm32/alloc-id:fake:payload +17246 1/imm32/size +17247 # data +17248 2a/asterisk +17249 +17250 Addr-var-in-some-register: # (payload var) +17251 0x11/imm32/alloc-id:fake:payload +17252 0/imm32/name +17253 0/imm32/name +17254 0x11/imm32/alloc-id:fake +17255 Type-addr/imm32 +17256 1/imm32/some-block-depth +17257 0/imm32/no-stack-offset +17258 0x11/imm32/alloc-id:fake +17259 Any-register/imm32 +17260 +17261 Byte-var-in-some-register: # (payload var) +17262 0x11/imm32/alloc-id:fake:payload +17263 0/imm32/name +17264 0/imm32/name +17265 0x11/imm32/alloc-id:fake +17266 Type-byte/imm32 +17267 1/imm32/some-block-depth +17268 0/imm32/no-stack-offset +17269 0x11/imm32/alloc-id:fake +17270 Any-register/imm32 +17271 +17272 Single-int-var-in-eax: # (payload list var) +17273 0x11/imm32/alloc-id:fake:payload +17274 0x11/imm32/alloc-id:fake +17275 Int-var-in-eax/imm32 +17276 0/imm32/next +17277 0/imm32/next +17278 +17279 Int-var-in-eax: +17280 0x11/imm32/alloc-id:fake:payload +17281 0/imm32/name +17282 0/imm32/name +17283 0x11/imm32/alloc-id:fake +17284 Type-int/imm32 +17285 1/imm32/some-block-depth +17286 0/imm32/no-stack-offset +17287 0x11/imm32/alloc-id:fake +17288 $Register-eax/imm32 +17289 +17290 Single-int-var-in-ecx: # (payload list var) +17291 0x11/imm32/alloc-id:fake:payload +17292 0x11/imm32/alloc-id:fake +17293 Int-var-in-ecx/imm32 +17294 0/imm32/next +17295 0/imm32/next +17296 +17297 Int-var-in-ecx: +17298 0x11/imm32/alloc-id:fake:payload +17299 0/imm32/name +17300 0/imm32/name +17301 0x11/imm32/alloc-id:fake +17302 Type-int/imm32 +17303 1/imm32/some-block-depth +17304 0/imm32/no-stack-offset +17305 0x11/imm32/alloc-id:fake +17306 $Register-ecx/imm32/register +17307 +17308 Single-int-var-in-edx: # (payload list var) +17309 0x11/imm32/alloc-id:fake:payload +17310 0x11/imm32/alloc-id:fake +17311 Int-var-in-edx/imm32 +17312 0/imm32/next +17313 0/imm32/next +17314 +17315 Int-var-in-edx: # (payload list var) +17316 0x11/imm32/alloc-id:fake:payload +17317 0/imm32/name +17318 0/imm32/name +17319 0x11/imm32/alloc-id:fake +17320 Type-int/imm32 +17321 1/imm32/some-block-depth +17322 0/imm32/no-stack-offset +17323 0x11/imm32/alloc-id:fake +17324 $Register-edx/imm32/register +17325 +17326 Single-int-var-in-ebx: # (payload list var) +17327 0x11/imm32/alloc-id:fake:payload +17328 0x11/imm32/alloc-id:fake +17329 Int-var-in-ebx/imm32 +17330 0/imm32/next +17331 0/imm32/next +17332 +17333 Int-var-in-ebx: # (payload list var) +17334 0x11/imm32/alloc-id:fake:payload +17335 0/imm32/name +17336 0/imm32/name +17337 0x11/imm32/alloc-id:fake +17338 Type-int/imm32 +17339 1/imm32/some-block-depth +17340 0/imm32/no-stack-offset +17341 0x11/imm32/alloc-id:fake +17342 $Register-ebx/imm32/register +17343 +17344 Single-int-var-in-esi: # (payload list var) +17345 0x11/imm32/alloc-id:fake:payload +17346 0x11/imm32/alloc-id:fake +17347 Int-var-in-esi/imm32 +17348 0/imm32/next +17349 0/imm32/next +17350 +17351 Int-var-in-esi: # (payload list var) +17352 0x11/imm32/alloc-id:fake:payload +17353 0/imm32/name +17354 0/imm32/name +17355 0x11/imm32/alloc-id:fake +17356 Type-int/imm32 +17357 1/imm32/some-block-depth +17358 0/imm32/no-stack-offset +17359 0x11/imm32/alloc-id:fake +17360 $Register-esi/imm32/register +17361 +17362 Single-int-var-in-edi: # (payload list var) +17363 0x11/imm32/alloc-id:fake:payload +17364 0x11/imm32/alloc-id:fake +17365 Int-var-in-edi/imm32 +17366 0/imm32/next +17367 0/imm32/next +17368 +17369 Int-var-in-edi: # (payload list var) +17370 0x11/imm32/alloc-id:fake:payload +17371 0/imm32/name +17372 0/imm32/name +17373 0x11/imm32/alloc-id:fake +17374 Type-int/imm32 +17375 1/imm32/some-block-depth +17376 0/imm32/no-stack-offset +17377 0x11/imm32/alloc-id:fake +17378 $Register-edi/imm32/register +17379 +17380 Single-lit-var: # (payload list var) +17381 0x11/imm32/alloc-id:fake:payload +17382 0x11/imm32/alloc-id:fake +17383 Lit-var/imm32 +17384 0/imm32/next +17385 0/imm32/next +17386 +17387 Lit-var: # (payload var) +17388 0x11/imm32/alloc-id:fake:payload +17389 0/imm32/name +17390 0/imm32/name +17391 0x11/imm32/alloc-id:fake +17392 Type-literal/imm32 +17393 1/imm32/some-block-depth +17394 0/imm32/no-stack-offset +17395 0/imm32/no-register +17396 0/imm32/no-register +17397 +17398 Type-int: # (payload type-tree) +17399 0x11/imm32/alloc-id:fake:payload +17400 1/imm32/left-is-atom +17401 1/imm32/value:int +17402 0/imm32/left:unused +17403 0/imm32/right:null +17404 0/imm32/right:null +17405 +17406 Type-literal: # (payload type-tree) +17407 0x11/imm32/alloc-id:fake:payload +17408 1/imm32/is-atom +17409 0/imm32/value:literal +17410 0/imm32/left:unused +17411 0/imm32/right:null +17412 0/imm32/right:null +17413 +17414 Type-addr: # (payload type-tree) +17415 0x11/imm32/alloc-id:fake:payload +17416 1/imm32/is-atom +17417 2/imm32/value:addr +17418 0/imm32/left:unused +17419 0/imm32/right:null +17420 0/imm32/right:null +17421 +17422 Type-byte: # (payload type-tree) +17423 0x11/imm32/alloc-id:fake:payload +17424 1/imm32/is-atom +17425 8/imm32/value:byte +17426 0/imm32/left:unused +17427 0/imm32/right:null +17428 0/imm32/right:null +17429 +17430 == code +17431 emit-subx-primitive: # out: (addr buffered-file), stmt: (addr stmt), primitive: (addr primitive), err: (addr buffered-file), ed: (addr exit-descriptor) +17432 # . prologue +17433 55/push-ebp +17434 89/<- %ebp 4/r32/esp +17435 # . save registers +17436 50/push-eax +17437 51/push-ecx +17438 # ecx = primitive +17439 8b/-> *(ebp+0x10) 1/r32/ecx +17440 # emit primitive name +17441 (emit-indent *(ebp+8) *Curr-block-depth) +17442 (lookup *(ecx+0x18) *(ecx+0x1c)) # Primitive-subx-name Primitive-subx-name => eax +17443 (write-buffered *(ebp+8) %eax) +17444 # emit rm32 if necessary +17445 (emit-subx-rm32 *(ebp+8) *(ecx+0x20) *(ebp+0xc) *(ebp+0x14) *(ebp+0x18)) # Primitive-subx-rm32 +17446 # emit r32 if necessary +17447 (emit-subx-r32 *(ebp+8) *(ecx+0x24) *(ebp+0xc)) # Primitive-subx-r32 +17448 # emit imm32 if necessary +17449 (emit-subx-imm32 *(ebp+8) *(ecx+0x28) *(ebp+0xc)) # Primitive-subx-imm32 +17450 # emit disp32 if necessary +17451 (emit-subx-disp32 *(ebp+8) *(ecx+0x2c) *(ebp+0xc) *(ebp+0x14) *(ebp+0x18)) # Primitive-subx-disp32 +17452 (write-buffered *(ebp+8) Newline) +17453 $emit-subx-primitive:end: +17454 # . restore registers +17455 59/pop-to-ecx +17456 58/pop-to-eax +17457 # . epilogue +17458 89/<- %esp 5/r32/ebp +17459 5d/pop-to-ebp +17460 c3/return +17461 +17462 emit-subx-rm32: # out: (addr buffered-file), l: arg-location, stmt: (addr stmt), err: (addr buffered-file), ed: (addr exit-descriptor) +17463 # . prologue +17464 55/push-ebp +17465 89/<- %ebp 4/r32/esp +17466 # . save registers +17467 50/push-eax +17468 # if (l == 0) return +17469 81 7/subop/compare *(ebp+0xc) 0/imm32 +17470 74/jump-if-= $emit-subx-rm32:end/disp8 +17471 # var v/eax: (addr stmt-var) +17472 (get-stmt-operand-from-arg-location *(ebp+0x10) *(ebp+0xc) *(ebp+0x14) *(ebp+0x18)) # => eax +17473 (emit-subx-var-as-rm32 *(ebp+8) %eax) +17474 $emit-subx-rm32:end: +17475 # . restore registers +17476 58/pop-to-eax +17477 # . epilogue +17478 89/<- %esp 5/r32/ebp +17479 5d/pop-to-ebp +17480 c3/return +17481 +17482 get-stmt-operand-from-arg-location: # stmt: (addr stmt), l: arg-location, err: (addr buffered-file), ed: (addr exit-descriptor) -> var/eax: (addr stmt-var) +17483 # . prologue +17484 55/push-ebp +17485 89/<- %ebp 4/r32/esp +17486 # . save registers +17487 51/push-ecx +17488 # eax = l +17489 8b/-> *(ebp+0xc) 0/r32/eax +17490 # ecx = stmt +17491 8b/-> *(ebp+8) 1/r32/ecx +17492 # if (l == 1) return stmt->inouts +17493 { +17494 3d/compare-eax-and 1/imm32 +17495 75/jump-if-!= break/disp8 +17496 $get-stmt-operand-from-arg-location:1: +17497 (lookup *(ecx+0xc) *(ecx+0x10)) # Stmt1-inouts Stmt1-inouts => eax +17498 eb/jump $get-stmt-operand-from-arg-location:end/disp8 +17499 } +17500 # if (l == 2) return stmt->inouts->next +17501 { +17502 3d/compare-eax-and 2/imm32 +17503 75/jump-if-!= break/disp8 +17504 $get-stmt-operand-from-arg-location:2: +17505 (lookup *(ecx+0xc) *(ecx+0x10)) # Stmt1-inouts Stmt1-inouts => eax +17506 (lookup *(eax+8) *(eax+0xc)) # Stmt-var-next Stmt-var-next => eax +17507 eb/jump $get-stmt-operand-from-arg-location:end/disp8 +17508 } +17509 # if (l == 3) return stmt->outputs +17510 { +17511 3d/compare-eax-and 3/imm32 +17512 75/jump-if-!= break/disp8 +17513 $get-stmt-operand-from-arg-location:3: +17514 (lookup *(ecx+0x14) *(ecx+0x18)) # Stmt1-outputs Stmt1-outputs => eax +17515 eb/jump $get-stmt-operand-from-arg-location:end/disp8 +17516 } +17517 # abort +17518 e9/jump $get-stmt-operand-from-arg-location:abort/disp32 +17519 $get-stmt-operand-from-arg-location:end: +17520 # . restore registers +17521 59/pop-to-ecx +17522 # . epilogue +17523 89/<- %esp 5/r32/ebp +17524 5d/pop-to-ebp +17525 c3/return +17526 +17527 $get-stmt-operand-from-arg-location:abort: +17528 # error("invalid arg-location " eax) +17529 (write-buffered *(ebp+0x10) "invalid arg-location ") +17530 (write-int32-hex-buffered *(ebp+0x10) %eax) +17531 (write-buffered *(ebp+0x10) Newline) +17532 (flush *(ebp+0x10)) +17533 (stop *(ebp+0x14) 1) +17534 # never gets here +17535 +17536 emit-subx-r32: # out: (addr buffered-file), l: arg-location, stmt: (addr stmt) +17537 # . prologue +17538 55/push-ebp +17539 89/<- %ebp 4/r32/esp +17540 # . save registers +17541 50/push-eax +17542 51/push-ecx +17543 # if (l == 0) return +17544 81 7/subop/compare *(ebp+0xc) 0/imm32 +17545 0f 84/jump-if-= $emit-subx-r32:end/disp32 +17546 # var v/eax: (addr stmt-var) +17547 (get-stmt-operand-from-arg-location *(ebp+0x10) *(ebp+0xc)) # => eax +17548 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax +17549 (lookup *(eax+0x18) *(eax+0x1c)) # Var-register Var-register => eax +17550 (maybe-get Mu-registers %eax 0xc) # => eax: (addr register-index) +17551 (write-buffered *(ebp+8) Space) +17552 (write-int32-hex-buffered *(ebp+8) *eax) +17553 (write-buffered *(ebp+8) "/r32") +17554 $emit-subx-r32:end: +17555 # . restore registers +17556 59/pop-to-ecx +17557 58/pop-to-eax +17558 # . epilogue +17559 89/<- %esp 5/r32/ebp +17560 5d/pop-to-ebp +17561 c3/return +17562 +17563 emit-subx-imm32: # out: (addr buffered-file), l: arg-location, stmt: (addr stmt) +17564 # . prologue +17565 55/push-ebp +17566 89/<- %ebp 4/r32/esp +17567 # . save registers +17568 50/push-eax +17569 51/push-ecx +17570 # if (l == 0) return +17571 81 7/subop/compare *(ebp+0xc) 0/imm32 +17572 0f 84/jump-if-= $emit-subx-imm32:end/disp32 +17573 # var v/eax: (handle var) +17574 (get-stmt-operand-from-arg-location *(ebp+0x10) *(ebp+0xc)) # => eax +17575 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax +17576 (lookup *eax *(eax+4)) # Var-name Var-name => eax +17577 (write-buffered *(ebp+8) Space) +17578 (write-buffered *(ebp+8) %eax) +17579 (write-buffered *(ebp+8) "/imm32") +17580 $emit-subx-imm32:end: +17581 # . restore registers +17582 59/pop-to-ecx +17583 58/pop-to-eax +17584 # . epilogue +17585 89/<- %esp 5/r32/ebp +17586 5d/pop-to-ebp +17587 c3/return +17588 +17589 emit-subx-disp32: # out: (addr buffered-file), l: arg-location, stmt: (addr stmt), err: (addr buffered-file), ed: (addr exit-descriptor) +17590 # . prologue +17591 55/push-ebp +17592 89/<- %ebp 4/r32/esp +17593 # . save registers +17594 50/push-eax +17595 51/push-ecx +17596 # if (location == 0) return +17597 81 7/subop/compare *(ebp+0xc) 0/imm32 +17598 0f 84/jump-if-= $emit-subx-disp32:end/disp32 +17599 # var v/eax: (addr stmt-var) +17600 (get-stmt-operand-from-arg-location *(ebp+0x10) *(ebp+0xc) *(ebp+0x14) *(ebp+0x18)) # => eax +17601 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax +17602 (lookup *eax *(eax+4)) # Var-name Var-name => eax +17603 (write-buffered *(ebp+8) Space) +17604 (write-buffered *(ebp+8) %eax) +17605 # hack: if instruction operation starts with "break", emit ":break" +17606 # var name/ecx: (addr array byte) = lookup(stmt->operation) +17607 8b/-> *(ebp+0x10) 0/r32/eax +17608 (lookup *(eax+4) *(eax+8)) # Stmt1-operation Stmt1-operation => eax +17609 89/<- %ecx 0/r32/eax +17610 { +17611 (string-starts-with? %ecx "break") # => eax 17612 3d/compare-eax-and 0/imm32/false -17613 75/jump-if-!= break/disp8 -17614 b8/copy-to-eax 0/imm32 -17615 e9/jump $mu-stmt-matches-primitive?:end/disp32 -17616 } -17617 # var curr/esi: (addr stmt-var) = lookup(stmt->inouts) -17618 (lookup *(ecx+0xc) *(ecx+0x10)) # Stmt1-inouts Stmt1-inouts => eax -17619 89/<- %esi 0/r32/eax -17620 # var curr2/edi: (addr list var) = lookup(primitive->inouts) -17621 (lookup *(edx+8) *(edx+0xc)) # Primitive-inouts Primitive-inouts => eax -17622 89/<- %edi 0/r32/eax -17623 { -17624 $mu-stmt-matches-primitive?:inouts-loop: -17625 # if (curr == 0 && curr2 == 0) move on to check outputs -17626 { -17627 $mu-stmt-matches-primitive?:check-both-inouts-null: -17628 81 7/subop/compare %esi 0/imm32 -17629 75/jump-if-!= break/disp8 -17630 $mu-stmt-matches-primitive?:stmt-inout-null: -17631 81 7/subop/compare %edi 0/imm32 -17632 0f 84/jump-if-= $mu-stmt-matches-primitive?:check-outputs/disp32 -17633 $mu-stmt-matches-primitive?:stmt-inout-null-and-prim-inout-not-null: -17634 # return false -17635 b8/copy-to-eax 0/imm32/false -17636 e9/jump $mu-stmt-matches-primitive?:end/disp32 -17637 } -17638 # if (curr2 == 0) return false -17639 { -17640 $mu-stmt-matches-primitive?:check-prim-inout-null: -17641 81 7/subop/compare %edi 0/imm32 -17642 75/jump-if-!= break/disp8 -17643 $mu-stmt-matches-primitive?:prim-inout-null: -17644 b8/copy-to-eax 0/imm32/false -17645 e9/jump $mu-stmt-matches-primitive?:end/disp32 -17646 } -17647 # if (curr != curr2) return false -17648 { -17649 $mu-stmt-matches-primitive?:check-inouts-match: -17650 (lookup *edi *(edi+4)) # List-value List-value => eax -17651 (operand-matches-primitive? %esi %eax) # => eax -17652 3d/compare-eax-and 0/imm32/false -17653 75/jump-if-!= break/disp8 -17654 $mu-stmt-matches-primitive?:inouts-match: -17655 b8/copy-to-eax 0/imm32/false -17656 e9/jump $mu-stmt-matches-primitive?:end/disp32 -17657 } -17658 $mu-stmt-matches-primitive?:next-inout: -17659 # curr = lookup(curr->next) -17660 (lookup *(esi+8) *(esi+0xc)) # Stmt-var-next Stmt-var-next => eax -17661 89/<- %esi 0/r32/eax -17662 # curr2 = lookup(curr2->next) -17663 (lookup *(edi+8) *(edi+0xc)) # List-next List-next => eax -17664 89/<- %edi 0/r32/eax -17665 # -17666 e9/jump loop/disp32 -17667 } -17668 $mu-stmt-matches-primitive?:check-outputs: -17669 # var curr/esi: (addr stmt-var) = lookup(stmt->outputs) -17670 (lookup *(ecx+0x14) *(ecx+0x18)) # Stmt1-outputs Stmt1-outputs => eax -17671 89/<- %esi 0/r32/eax -17672 # var curr2/edi: (addr list var) = lookup(primitive->outputs) -17673 (lookup *(edx+0x10) *(edx+0x14)) # Primitive-outputs Primitive-outputs => eax -17674 89/<- %edi 0/r32/eax -17675 { -17676 $mu-stmt-matches-primitive?:outputs-loop: -17677 # if (curr == 0) return (curr2 == 0) -17678 { -17679 $mu-stmt-matches-primitive?:check-both-outputs-null: -17680 81 7/subop/compare %esi 0/imm32 -17681 75/jump-if-!= break/disp8 -17682 { -17683 $mu-stmt-matches-primitive?:stmt-output-null: -17684 81 7/subop/compare %edi 0/imm32 -17685 75/jump-if-!= break/disp8 -17686 $mu-stmt-matches-primitive?:both-outputs-null: -17687 # return true -17688 b8/copy-to-eax 1/imm32 -17689 e9/jump $mu-stmt-matches-primitive?:end/disp32 -17690 } -17691 $mu-stmt-matches-primitive?:stmt-output-null-and-prim-output-not-null: -17692 # return false -17693 b8/copy-to-eax 0/imm32 -17694 e9/jump $mu-stmt-matches-primitive?:end/disp32 -17695 } -17696 # if (curr2 == 0) return false -17697 { -17698 $mu-stmt-matches-primitive?:check-prim-output-null: -17699 81 7/subop/compare %edi 0/imm32 -17700 75/jump-if-!= break/disp8 -17701 $mu-stmt-matches-primitive?:prim-output-is-null: -17702 b8/copy-to-eax 0/imm32 -17703 e9/jump $mu-stmt-matches-primitive?:end/disp32 -17704 } -17705 # if (curr != curr2) return false -17706 { -17707 $mu-stmt-matches-primitive?:check-outputs-match: -17708 (lookup *edi *(edi+4)) # List-value List-value => eax -17709 (operand-matches-primitive? %esi %eax) # => eax -17710 3d/compare-eax-and 0/imm32/false -17711 75/jump-if-!= break/disp8 -17712 $mu-stmt-matches-primitive?:outputs-match: -17713 b8/copy-to-eax 0/imm32 -17714 e9/jump $mu-stmt-matches-primitive?:end/disp32 -17715 } -17716 $mu-stmt-matches-primitive?:next-output: -17717 # curr = lookup(curr->next) -17718 (lookup *(esi+8) *(esi+0xc)) # Stmt-var-next Stmt-var-next => eax -17719 89/<- %esi 0/r32/eax -17720 # curr2 = lookup(curr2->next) -17721 (lookup *(edi+8) *(edi+0xc)) # List-next List-next => eax -17722 89/<- %edi 0/r32/eax -17723 # -17724 e9/jump loop/disp32 -17725 } -17726 $mu-stmt-matches-primitive?:return-true: -17727 b8/copy-to-eax 1/imm32 -17728 $mu-stmt-matches-primitive?:end: +17613 74/jump-if-= break/disp8 +17614 (write-buffered *(ebp+8) ":break") +17615 } +17616 # hack: if instruction operation starts with "loop", emit ":loop" +17617 { +17618 (string-starts-with? %ecx "loop") # => eax +17619 3d/compare-eax-and 0/imm32/false +17620 74/jump-if-= break/disp8 +17621 (write-buffered *(ebp+8) ":loop") +17622 } +17623 (write-buffered *(ebp+8) "/disp32") +17624 $emit-subx-disp32:end: +17625 # . restore registers +17626 59/pop-to-ecx +17627 58/pop-to-eax +17628 # . epilogue +17629 89/<- %esp 5/r32/ebp +17630 5d/pop-to-ebp +17631 c3/return +17632 +17633 emit-call: # out: (addr buffered-file), stmt: (addr stmt) +17634 # . prologue +17635 55/push-ebp +17636 89/<- %ebp 4/r32/esp +17637 # . save registers +17638 50/push-eax +17639 51/push-ecx +17640 # +17641 (emit-indent *(ebp+8) *Curr-block-depth) +17642 (write-buffered *(ebp+8) "(") +17643 # ecx = stmt +17644 8b/-> *(ebp+0xc) 1/r32/ecx +17645 # - emit function name +17646 (lookup *(ecx+4) *(ecx+8)) # Stmt1-operation Stmt1-operation => eax +17647 (write-buffered *(ebp+8) %eax) +17648 # - emit arguments +17649 # var curr/eax: (addr stmt-var) = lookup(stmt->inouts) +17650 (lookup *(ecx+0xc) *(ecx+0x10)) # Stmt1-inouts Stmt1-inouts => eax +17651 { +17652 # if (curr == null) break +17653 3d/compare-eax-and 0/imm32 +17654 74/jump-if-= break/disp8 +17655 # +17656 (emit-subx-call-operand *(ebp+8) %eax) +17657 # curr = lookup(curr->next) +17658 (lookup *(eax+8) *(eax+0xc)) # Stmt-var-next Stmt-var-next => eax +17659 eb/jump loop/disp8 +17660 } +17661 # +17662 (write-buffered *(ebp+8) ")\n") +17663 $emit-call:end: +17664 # . restore registers +17665 59/pop-to-ecx +17666 58/pop-to-eax +17667 # . epilogue +17668 89/<- %esp 5/r32/ebp +17669 5d/pop-to-ebp +17670 c3/return +17671 +17672 emit-subx-call-operand: # out: (addr buffered-file), s: (addr stmt-var) +17673 # shares code with emit-subx-var-as-rm32 +17674 # . prologue +17675 55/push-ebp +17676 89/<- %ebp 4/r32/esp +17677 # . save registers +17678 50/push-eax +17679 51/push-ecx +17680 56/push-esi +17681 # ecx = s +17682 8b/-> *(ebp+0xc) 1/r32/ecx +17683 # var operand/esi: (addr var) = lookup(s->value) +17684 (lookup *ecx *(ecx+4)) # Stmt-var-value Stmt-var-value => eax +17685 89/<- %esi 0/r32/eax +17686 # if (operand->register && !s->is-deref?) emit "%__" +17687 { +17688 $emit-subx-call-operand:check-for-register-direct: +17689 81 7/subop/compare *(esi+0x18) 0/imm32 # Var-register +17690 74/jump-if-= break/disp8 +17691 81 7/subop/compare *(ecx+0x10) 0/imm32/false # Stmt-var-is-deref +17692 75/jump-if-!= break/disp8 +17693 $emit-subx-call-operand:register-direct: +17694 (write-buffered *(ebp+8) " %") +17695 (lookup *(esi+0x18) *(esi+0x1c)) # Var-register Var-register => eax +17696 (write-buffered *(ebp+8) %eax) +17697 e9/jump $emit-subx-call-operand:end/disp32 +17698 } +17699 # else if (operand->register && s->is-deref?) emit "*__" +17700 { +17701 $emit-subx-call-operand:check-for-register-indirect: +17702 81 7/subop/compare *(esi+0x18) 0/imm32 # Var-register +17703 74/jump-if-= break/disp8 +17704 81 7/subop/compare *(ecx+0x10) 0/imm32/false # Stmt-var-is-deref +17705 74/jump-if-= break/disp8 +17706 $emit-subx-call-operand:register-indirect: +17707 (emit-subx-call-operand-register-indirect *(ebp+8) %esi) +17708 e9/jump $emit-subx-call-operand:end/disp32 +17709 } +17710 # else if (operand->stack-offset) emit "*(ebp+__)" +17711 { +17712 81 7/subop/compare *(esi+0x14) 0/imm32 # Var-offset +17713 74/jump-if-= break/disp8 +17714 $emit-subx-call-operand:stack: +17715 (emit-subx-call-operand-stack *(ebp+8) %esi) +17716 e9/jump $emit-subx-call-operand:end/disp32 +17717 } +17718 # else if (operand->type == literal) emit "__" +17719 { +17720 (lookup *(esi+8) *(esi+0xc)) # Var-type Var-type => eax +17721 81 7/subop/compare *(eax+4) 0/imm32 # Type-tree-left +17722 75/jump-if-!= break/disp8 +17723 $emit-subx-call-operand:literal: +17724 (write-buffered *(ebp+8) Space) +17725 (lookup *esi *(esi+4)) # Var-name Var-name => eax +17726 (write-buffered *(ebp+8) %eax) +17727 } +17728 $emit-subx-call-operand:end: 17729 # . restore registers -17730 5f/pop-to-edi -17731 5e/pop-to-esi -17732 5b/pop-to-ebx -17733 5a/pop-to-edx -17734 59/pop-to-ecx -17735 # . epilogue -17736 89/<- %esp 5/r32/ebp -17737 5d/pop-to-ebp -17738 c3/return -17739 -17740 operand-matches-primitive?: # s: (addr stmt-var), prim-var: (addr var) -> result/eax: boolean -17741 # . prologue -17742 55/push-ebp -17743 89/<- %ebp 4/r32/esp -17744 # . save registers -17745 51/push-ecx -17746 52/push-edx -17747 53/push-ebx -17748 56/push-esi -17749 57/push-edi -17750 # ecx = s -17751 8b/-> *(ebp+8) 1/r32/ecx -17752 # var var/esi: (addr var) = lookup(s->value) -17753 (lookup *ecx *(ecx+4)) # Stmt-var-value Stmt-var-value => eax -17754 89/<- %esi 0/r32/eax -17755 # edi = prim-var -17756 8b/-> *(ebp+0xc) 7/r32/edi -17757 $operand-matches-primitive?:check-type: -17758 # if !category-match?(var->type, prim-var->type) return false -17759 # . var vtype/ebx: (addr tree type-id) = lookup(var->type) -17760 (lookup *(esi+8) *(esi+0xc)) # Var-type Var-type => eax -17761 89/<- %ebx 0/r32/eax -17762 # . var ptype/eax: (addr tree type-id) = lookup(prim-var->type) -17763 (lookup *(edi+8) *(edi+0xc)) # Var-type Var-type => eax -17764 (subx-type-category-match? %ebx %eax) # => eax -17765 3d/compare-eax-and 0/imm32/false -17766 0f 84/jump-if-= $operand-matches-primitive?:return-false/disp32 -17767 { -17768 $operand-matches-primitive?:check-register: -17769 # if prim-var is in memory and var is in register but dereference, match -17770 { -17771 81 7/subop/compare *(edi+0x18) 0/imm32 # Var-register -17772 0f 85/jump-if-!= break/disp32 -17773 81 7/subop/compare *(esi+0x18) 0/imm32 # Var-register -17774 74/jump-if-= break/disp8 -17775 81 7/subop/compare *(ecx+0x10) 0/imm32/false # Stmt-var-is-deref -17776 74/jump-if-= break/disp8 -17777 $operand-matches-primitive?:var-deref-match: -17778 e9/jump $operand-matches-primitive?:return-true/disp32 -17779 } -17780 # if prim-var is in register and var is in register but dereference, no match -17781 { -17782 81 7/subop/compare *(edi+0x18) 0/imm32 # Var-register -17783 0f 84/jump-if-= break/disp32 -17784 81 7/subop/compare *(esi+0x18) 0/imm32 # Var-register -17785 0f 84/jump-if-= break/disp32 -17786 81 7/subop/compare *(ecx+0x10) 0/imm32/false # Stmt-var-is-deref -17787 74/jump-if-= break/disp8 -17788 $operand-matches-primitive?:var-deref-no-match: -17789 e9/jump $operand-matches-primitive?:return-false/disp32 -17790 } -17791 # return false if var->register doesn't match prim-var->register -17792 { -17793 # if register addresses are equal, it's a match -17794 # var vreg/ebx: (addr array byte) = lookup(var->register) -17795 (lookup *(esi+0x18) *(esi+0x1c)) # Var-register Var-register => eax -17796 89/<- %ebx 0/r32/eax -17797 # var preg/ecx: (addr array byte) = lookup(prim-var->register) -17798 (lookup *(edi+0x18) *(edi+0x1c)) # Var-register Var-register => eax -17799 89/<- %ecx 0/r32/eax -17800 # if (vreg == preg) break -17801 39/compare %ecx 3/r32/ebx -17802 74/jump-if-= break/disp8 -17803 $operand-matches-primitive?:var-register-no-match: -17804 # if either address is 0, return false -17805 81 7/subop/compare %ebx 0/imm32 -17806 74/jump-if-= $operand-matches-primitive?:return-false/disp8 -17807 81 7/subop/compare %ecx 0/imm32 -17808 74/jump-if-= $operand-matches-primitive?:return-false/disp8 -17809 # if prim-var->register is wildcard, it's a match -17810 (string-equal? %ecx "*") # Any-register => eax -17811 3d/compare-eax-and 0/imm32/false -17812 75/jump-if-!= break/disp8 -17813 $operand-matches-primitive?:wildcard-no-match: -17814 # if string contents aren't equal, return false -17815 (string-equal? %ecx %ebx) # => eax -17816 3d/compare-eax-and 0/imm32/false -17817 74/jump-if-= $operand-matches-primitive?:return-false/disp8 -17818 } -17819 } -17820 $operand-matches-primitive?:return-true: -17821 b8/copy-to-eax 1/imm32/true -17822 eb/jump $operand-matches-primitive?:end/disp8 -17823 $operand-matches-primitive?:return-false: -17824 b8/copy-to-eax 0/imm32/false -17825 $operand-matches-primitive?:end: -17826 # . restore registers -17827 5f/pop-to-edi -17828 5e/pop-to-esi -17829 5b/pop-to-ebx -17830 5a/pop-to-edx -17831 59/pop-to-ecx -17832 # . epilogue -17833 89/<- %esp 5/r32/ebp -17834 5d/pop-to-ebp -17835 c3/return -17836 -17837 find-matching-function: # functions: (addr function), stmt: (addr stmt) -> result/eax: (addr function) -17838 # . prologue -17839 55/push-ebp -17840 89/<- %ebp 4/r32/esp -17841 # . save registers -17842 51/push-ecx -17843 # var curr/ecx: (handle function) = functions -17844 8b/-> *(ebp+8) 1/r32/ecx -17845 { -17846 # if (curr == null) break -17847 81 7/subop/compare %ecx 0/imm32 -17848 74/jump-if-= break/disp8 -17849 #? (write-buffered Stderr "iter\n") -17850 #? (flush Stderr) -17851 # if match(stmt, curr) return curr -17852 { -17853 (mu-stmt-matches-function? *(ebp+0xc) %ecx) # => eax -17854 3d/compare-eax-and 0/imm32/false -17855 74/jump-if-= break/disp8 -17856 89/<- %eax 1/r32/ecx -17857 eb/jump $find-matching-function:end/disp8 -17858 } -17859 # curr = curr->next -17860 (lookup *(ecx+0x20) *(ecx+0x24)) # Function-next Function-next => eax -17861 89/<- %ecx 0/r32/eax -17862 # -17863 eb/jump loop/disp8 -17864 } -17865 # return null -17866 b8/copy-to-eax 0/imm32 -17867 $find-matching-function:end: -17868 # . restore registers -17869 59/pop-to-ecx -17870 # . epilogue -17871 89/<- %esp 5/r32/ebp -17872 5d/pop-to-ebp -17873 c3/return -17874 -17875 # Just compare names; user-defined functions don't support overloading yet. -17876 mu-stmt-matches-function?: # stmt: (addr stmt1), function: (addr function) -> result/eax: boolean -17877 # . prologue -17878 55/push-ebp -17879 89/<- %ebp 4/r32/esp -17880 # . save registers -17881 51/push-ecx -17882 # return function->name == stmt->operation -17883 # ecx = lookup(stmt->operation) -17884 8b/-> *(ebp+8) 0/r32/eax -17885 (lookup *(eax+4) *(eax+8)) # Stmt1-operation Stmt1-operation => eax -17886 89/<- %ecx 0/r32/eax -17887 # eax = lookup(function->name) -17888 8b/-> *(ebp+0xc) 0/r32/eax -17889 (lookup *eax *(eax+4)) # Function-name Function-name => eax -17890 (string-equal? %eax %ecx) # => eax -17891 $mu-stmt-matches-function?:end: -17892 # . restore registers -17893 59/pop-to-ecx -17894 # . epilogue -17895 89/<- %esp 5/r32/ebp -17896 5d/pop-to-ebp -17897 c3/return -17898 -17899 # Type-checking happens elsewhere. This method is for selecting between -17900 # primitives. -17901 subx-type-category-match?: # a: (addr tree type-id), b: (addr tree type-id) -> result/eax: boolean -17902 # . prologue -17903 55/push-ebp -17904 89/<- %ebp 4/r32/esp -17905 # . save registers -17906 51/push-ecx -17907 # var alit/ecx: boolean = is-literal-type?(a) -17908 (is-simple-mu-type? *(ebp+8) 0) # => eax -17909 89/<- %ecx 0/r32/eax -17910 # var blit/eax: boolean = is-literal-type?(b) -17911 (is-simple-mu-type? *(ebp+0xc) 0) # => eax -17912 # return alit == blit -17913 39/compare %eax 1/r32/ecx -17914 0f 94/set-byte-if-= %al -17915 81 4/subop/and %eax 0xff/imm32 -17916 $subx-type-category-match?:end: -17917 # . restore registers -17918 59/pop-to-ecx -17919 # . epilogue -17920 89/<- %esp 5/r32/ebp -17921 5d/pop-to-ebp -17922 c3/return -17923 -17924 is-simple-mu-type?: # a: (addr tree type-id), n: type-id -> result/eax: boolean -17925 # . prologue -17926 55/push-ebp -17927 89/<- %ebp 4/r32/esp -17928 # . save registers -17929 51/push-ecx -17930 # ecx = n -17931 8b/-> *(ebp+0xc) 1/r32/ecx -17932 # return (a->value == n) -17933 8b/-> *(ebp+8) 0/r32/eax -17934 39/compare *(eax+4) 1/r32/ecx # Tree-value -17935 0f 94/set-byte-if-= %al -17936 81 4/subop/and %eax 0xff/imm32 -17937 $is-simple-mu-type?:end: -17938 # . restore registers -17939 59/pop-to-ecx -17940 # . epilogue -17941 89/<- %esp 5/r32/ebp -17942 5d/pop-to-ebp -17943 c3/return -17944 -17945 is-mu-addr-type?: # a: (addr tree type-id) -> result/eax: boolean -17946 # . prologue -17947 55/push-ebp -17948 89/<- %ebp 4/r32/esp -17949 # eax = a -17950 8b/-> *(ebp+8) 0/r32/eax -17951 # if (!a->is-atom?) a = a->left -17952 81 7/subop/compare *eax 0/imm32/false # Tree-is-atom -17953 { -17954 75/jump-if-!= break/disp8 -17955 (lookup *(eax+4) *(eax+8)) # Tree-left Tree-left => eax -17956 } -17957 # return (a->value == addr) -17958 81 7/subop/compare *(eax+4) 2/imm32/addr # Tree-value -17959 0f 94/set-byte-if-= %al -17960 81 4/subop/and %eax 0xff/imm32 -17961 $is-mu-addr-type?:end: -17962 # . epilogue -17963 89/<- %esp 5/r32/ebp -17964 5d/pop-to-ebp -17965 c3/return -17966 -17967 test-emit-subx-stmt-primitive: -17968 # Primitive operation on a variable on the stack. -17969 # increment foo -17970 # => -17971 # ff 0/subop/increment *(ebp-8) -17972 # -17973 # There's a variable on the var stack as follows: -17974 # name: 'foo' -17975 # type: int -17976 # stack-offset: -8 -17977 # -17978 # There's a primitive with this info: -17979 # name: 'increment' -17980 # inouts: int/mem -17981 # value: 'ff 0/subop/increment' -17982 # -17983 # . prologue -17984 55/push-ebp -17985 89/<- %ebp 4/r32/esp -17986 # setup -17987 (clear-stream _test-output-stream) -17988 (clear-stream $_test-output-buffered-file->buffer) -17989 # simulate allocated payloads starting with an initial fake alloc-id (0x11) -17990 $test-emit-subx-stmt-primitive:initialize-type: -17991 # var type/ecx: (payload tree type-id) = int -17992 68/push 0/imm32/right:null -17993 68/push 0/imm32/right:null -17994 68/push 0/imm32/left:unused -17995 68/push 1/imm32/value:int -17996 68/push 1/imm32/is-atom?:true -17997 68/push 0x11/imm32/alloc-id:fake:payload -17998 89/<- %ecx 4/r32/esp -17999 $test-emit-subx-stmt-primitive:initialize-var: -18000 # var var-foo/ecx: (payload var) = var(type) -18001 68/push 0/imm32/no-register -18002 68/push 0/imm32/no-register -18003 68/push -8/imm32/stack-offset -18004 68/push 1/imm32/block-depth -18005 51/push-ecx/type -18006 68/push 0x11/imm32/alloc-id:fake -18007 68/push 0/imm32/name -18008 68/push 0/imm32/name -18009 68/push 0x11/imm32/alloc-id:fake:payload -18010 89/<- %ecx 4/r32/esp -18011 $test-emit-subx-stmt-primitive:initialize-var-name: -18012 # var-foo->name = "foo" -18013 8d/copy-address *(ecx+4) 0/r32/eax # Var-name + 4 -18014 (copy-array Heap "foo" %eax) -18015 $test-emit-subx-stmt-primitive:initialize-stmt-var: -18016 # var operand/ebx: (payload stmt-var) = stmt-var(var-foo) -18017 68/push 0/imm32/is-deref:false -18018 68/push 0/imm32/next -18019 68/push 0/imm32/next -18020 51/push-ecx/var-foo -18021 68/push 0x11/imm32/alloc-id:fake -18022 68/push 0x11/imm32/alloc-id:fake:payload -18023 89/<- %ebx 4/r32/esp -18024 $test-emit-subx-stmt-primitive:initialize-stmt: -18025 # var stmt/esi: (addr statement) -18026 68/push 0/imm32/no-outputs -18027 68/push 0/imm32/no-outputs -18028 53/push-ebx/inouts -18029 68/push 0x11/imm32/alloc-id:fake -18030 68/push 0/imm32/operation -18031 68/push 0/imm32/operation -18032 68/push 1/imm32/tag -18033 89/<- %esi 4/r32/esp -18034 $test-emit-subx-stmt-primitive:initialize-stmt-operation: -18035 # stmt->operation = "increment" -18036 8d/copy-address *(esi+4) 0/r32/eax # Stmt1-operation -18037 (copy-array Heap "increment" %eax) -18038 $test-emit-subx-stmt-primitive:initialize-primitive: -18039 # var primitives/ebx: (addr primitive) -18040 68/push 0/imm32/next -18041 68/push 0/imm32/next -18042 68/push 0/imm32/output-is-write-only -18043 68/push 0/imm32/no-disp32 -18044 68/push 0/imm32/no-imm32 -18045 68/push 0/imm32/no-r32 -18046 68/push 1/imm32/rm32-is-first-inout -18047 68/push 0/imm32/subx-name -18048 68/push 0/imm32/subx-name -18049 68/push 0/imm32/no-outputs -18050 68/push 0/imm32/no-outputs -18051 53/push-ebx/inouts # hack: reuse stmt-var from call stmt as (list var) in function declaration -18052 68/push 0x11/imm32/alloc-id:fake -18053 68/push 0/imm32/name -18054 68/push 0/imm32/name -18055 89/<- %ebx 4/r32/esp -18056 $test-emit-subx-stmt-primitive:initialize-primitive-name: -18057 # primitives->name = "increment" -18058 (copy-array Heap "increment" %ebx) # Primitive-name -18059 $test-emit-subx-stmt-primitive:initialize-primitive-subx-name: -18060 # primitives->subx-name = "ff 0/subop/increment" -18061 8d/copy-address *(ebx+0x18) 0/r32/eax # Primitive-subx-name -18062 (copy-array Heap "ff 0/subop/increment" %eax) -18063 # convert -18064 c7 0/subop/copy *Curr-block-depth 0/imm32 -18065 (emit-subx-stmt _test-output-buffered-file %esi %ebx Stderr 0) -18066 (flush _test-output-buffered-file) -18067 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- -18073 # check output -18074 (check-next-stream-line-equal _test-output-stream "ff 0/subop/increment *(ebp+0xfffffff8)" "F - test-emit-subx-stmt-primitive") -18075 # . epilogue -18076 89/<- %esp 5/r32/ebp -18077 5d/pop-to-ebp -18078 c3/return -18079 -18080 test-emit-subx-stmt-primitive-register: -18081 # Primitive operation on a variable in a register. -18082 # foo <- increment -18083 # => -18084 # ff 0/subop/increment %eax # sub-optimal, but should suffice -18085 # -18086 # There's a variable on the var stack as follows: -18087 # name: 'foo' -18088 # type: int -18089 # register: 'eax' -18090 # -18091 # There's a primitive with this info: -18092 # name: 'increment' -18093 # out: int/reg -18094 # value: 'ff 0/subop/increment' -18095 # -18096 # . prologue -18097 55/push-ebp -18098 89/<- %ebp 4/r32/esp -18099 # setup -18100 (clear-stream _test-output-stream) -18101 (clear-stream $_test-output-buffered-file->buffer) -18102 $test-emit-subx-stmt-primitive-register:initialize-type: -18103 # var type/ecx: (payload tree type-id) = int -18104 68/push 0/imm32/right:null -18105 68/push 0/imm32/right:null -18106 68/push 0/imm32/left:unused -18107 68/push 1/imm32/value:int -18108 68/push 1/imm32/is-atom?:true -18109 68/push 0x11/imm32/alloc-id:fake:payload -18110 89/<- %ecx 4/r32/esp -18111 $test-emit-subx-stmt-primitive-register:initialize-var: -18112 # var var-foo/ecx: (payload var) -18113 68/push 0/imm32/register -18114 68/push 0/imm32/register -18115 68/push 0/imm32/no-stack-offset -18116 68/push 1/imm32/block-depth -18117 51/push-ecx -18118 68/push 0x11/imm32/alloc-id:fake -18119 68/push 0/imm32/name -18120 68/push 0/imm32/name -18121 68/push 0x11/imm32/alloc-id:fake:payload -18122 89/<- %ecx 4/r32/esp -18123 $test-emit-subx-stmt-primitive-register:initialize-var-name: -18124 # var-foo->name = "foo" -18125 8d/copy-address *(ecx+4) 0/r32/eax # Var-name + 4 -18126 (copy-array Heap "foo" %eax) -18127 $test-emit-subx-stmt-primitive-register:initialize-var-register: -18128 # var-foo->register = "eax" -18129 8d/copy-address *(ecx+0x1c) 0/r32/eax # Var-register + 4 -18130 (copy-array Heap "eax" %eax) -18131 $test-emit-subx-stmt-primitive-register:initialize-stmt-var: -18132 # var operand/ebx: (payload stmt-var) -18133 68/push 0/imm32/is-deref:false -18134 68/push 0/imm32/next -18135 68/push 0/imm32/next -18136 51/push-ecx/var-foo -18137 68/push 0x11/imm32/alloc-id:fake -18138 68/push 0x11/imm32/alloc-id:fake:payload -18139 89/<- %ebx 4/r32/esp -18140 $test-emit-subx-stmt-primitive-register:initialize-stmt: -18141 # var stmt/esi: (addr statement) -18142 53/push-ebx/outputs -18143 68/push 0x11/imm32/alloc-id:fake -18144 68/push 0/imm32/no-inouts -18145 68/push 0/imm32/no-inouts -18146 68/push 0/imm32/operation -18147 68/push 0/imm32/operation -18148 68/push 1/imm32 -18149 89/<- %esi 4/r32/esp -18150 $test-emit-subx-stmt-primitive-register:initialize-stmt-operation: -18151 # stmt->operation = "increment" -18152 8d/copy-address *(esi+4) 0/r32/eax # Stmt1-operation -18153 (copy-array Heap "increment" %eax) -18154 $test-emit-subx-stmt-primitive-register:initialize-formal-var: -18155 # var formal-var/ebx: (payload var) -18156 68/push 0/imm32/register -18157 68/push 0/imm32/register -18158 68/push 0/imm32/no-stack-offset -18159 68/push 1/imm32/block-depth -18160 ff 6/subop/push *(ecx+0x10) # Var-type + payload alloc id + handle alloc id -18161 68/push 0x11/imm32/alloc-id:fake -18162 68/push 0/imm32/name -18163 68/push 0/imm32/name -18164 68/push 0x11/imm32/alloc-id:fake:payload -18165 89/<- %ebx 4/r32/esp -18166 $test-emit-subx-stmt-primitive-register:initialize-formal-var-name: -18167 # formal-var->name = "dummy" -18168 8d/copy-address *(ebx+4) 0/r32/eax # Var-name + 4 -18169 (copy-array Heap "dummy" %eax) -18170 $test-emit-subx-stmt-primitive-register:initialize-formal-register: -18171 # formal-var->register = "*" -18172 8d/copy-address *(ebx+0x1c) 0/r32/eax # Var-register + 4 -18173 (copy-array Heap "*" %eax) # Any-register -18174 $test-emit-subx-stmt-primitive-register:initialize-var-list: -18175 # var formal-outputs/ebx: (payload list var) -18176 68/push 0/imm32/next -18177 68/push 0/imm32/next -18178 53/push-ebx/formal-var -18179 68/push 0x11/imm32/alloc-id:fake -18180 68/push 0x11/imm32/alloc-id:fake:payload -18181 89/<- %ebx 4/r32/esp -18182 $test-emit-subx-stmt-primitive-register:initialize-primitive: -18183 # var primitives/ebx: (addr primitive) -18184 68/push 0/imm32/next -18185 68/push 0/imm32/next -18186 68/push 0/imm32/output-is-write-only -18187 68/push 0/imm32/no-disp32 -18188 68/push 0/imm32/no-imm32 -18189 68/push 0/imm32/no-r32 -18190 68/push 3/imm32/rm32-is-first-output -18191 68/push 0/imm32/subx-name -18192 68/push 0/imm32/subx-name -18193 53/push-ebx/outputs -18194 68/push 0x11/imm32/alloc-id:fake -18195 68/push 0/imm32/no-inouts -18196 68/push 0/imm32/no-inouts -18197 68/push 0/imm32/name -18198 68/push 0/imm32/name -18199 89/<- %ebx 4/r32/esp -18200 $test-emit-subx-stmt-primitive-register:initialize-primitive-name: -18201 # primitives->name = "increment" -18202 (copy-array Heap "increment" %ebx) # Primitive-name -18203 $test-emit-subx-stmt-primitive-register:initialize-primitive-subx-name: -18204 # primitives->subx-name = "ff 0/subop/increment" -18205 8d/copy-address *(ebx+0x18) 0/r32/eax # Primitive-subx-name -18206 (copy-array Heap "ff 0/subop/increment" %eax) -18207 # convert -18208 c7 0/subop/copy *Curr-block-depth 0/imm32 -18209 (emit-subx-stmt _test-output-buffered-file %esi %ebx Stderr 0) -18210 (flush _test-output-buffered-file) -18211 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- -18217 # check output -18218 (check-next-stream-line-equal _test-output-stream "ff 0/subop/increment %eax" "F - test-emit-subx-stmt-primitive-register") -18219 # . epilogue -18220 89/<- %esp 5/r32/ebp -18221 5d/pop-to-ebp -18222 c3/return -18223 -18224 test-emit-subx-stmt-select-primitive: -18225 # Select the right primitive between overloads. -18226 # foo <- increment -18227 # => -18228 # ff 0/subop/increment %eax # sub-optimal, but should suffice -18229 # -18230 # There's a variable on the var stack as follows: -18231 # name: 'foo' -18232 # type: int -18233 # register: 'eax' -18234 # -18235 # There's two primitives, as follows: -18236 # - name: 'increment' -18237 # out: int/reg -18238 # value: 'ff 0/subop/increment' -18239 # - name: 'increment' -18240 # inout: int/mem -18241 # value: 'ff 0/subop/increment' -18242 # -18243 # . prologue -18244 55/push-ebp -18245 89/<- %ebp 4/r32/esp -18246 # setup -18247 (clear-stream _test-output-stream) -18248 (clear-stream $_test-output-buffered-file->buffer) -18249 $test-emit-subx-stmt-select-primitive:initialize-type: -18250 # var type/ecx: (payload tree type-id) = int -18251 68/push 0/imm32/right:null -18252 68/push 0/imm32/right:null -18253 68/push 0/imm32/left:unused -18254 68/push 1/imm32/value:int -18255 68/push 1/imm32/is-atom?:true -18256 68/push 0x11/imm32/alloc-id:fake:payload -18257 89/<- %ecx 4/r32/esp -18258 $test-emit-subx-stmt-select-primitive:initialize-var: -18259 # var var-foo/ecx: (payload var) -18260 68/push 0/imm32/register -18261 68/push 0/imm32/register -18262 68/push 0/imm32/no-stack-offset -18263 68/push 1/imm32/block-depth -18264 51/push-ecx -18265 68/push 0x11/imm32/alloc-id:fake -18266 68/push 0/imm32/name -18267 68/push 0/imm32/name -18268 68/push 0x11/imm32/alloc-id:fake:payload -18269 89/<- %ecx 4/r32/esp -18270 $test-emit-subx-stmt-select-primitive:initialize-var-name: -18271 # var-foo->name = "foo" -18272 8d/copy-address *(ecx+4) 0/r32/eax # Var-name + 4 -18273 (copy-array Heap "foo" %eax) -18274 $test-emit-subx-stmt-select-primitive:initialize-var-register: -18275 # var-foo->register = "eax" -18276 8d/copy-address *(ecx+0x1c) 0/r32/eax # Var-register + 4 -18277 (copy-array Heap "eax" %eax) -18278 $test-emit-subx-stmt-select-primitive:initialize-stmt-var: -18279 # var operand/ebx: (payload stmt-var) -18280 68/push 0/imm32/is-deref:false -18281 68/push 0/imm32/next -18282 68/push 0/imm32/next -18283 51/push-ecx/var-foo -18284 68/push 0x11/imm32/alloc-id:fake -18285 68/push 0x11/imm32/alloc-id:fake:payload -18286 89/<- %ebx 4/r32/esp -18287 $test-emit-subx-stmt-select-primitive:initialize-stmt: -18288 # var stmt/esi: (addr statement) -18289 53/push-ebx/outputs -18290 68/push 0x11/imm32/alloc-id:fake -18291 68/push 0/imm32/no-inouts -18292 68/push 0/imm32/no-inouts -18293 68/push 0/imm32/operation -18294 68/push 0/imm32/operation -18295 68/push 1/imm32 -18296 89/<- %esi 4/r32/esp -18297 $test-emit-subx-stmt-select-primitive:initialize-stmt-operation: -18298 # stmt->operation = "increment" -18299 8d/copy-address *(esi+4) 0/r32/eax # Stmt1-operation -18300 (copy-array Heap "increment" %eax) -18301 $test-emit-subx-stmt-select-primitive:initialize-formal-var: -18302 # var formal-var/ebx: (payload var) -18303 68/push 0/imm32/register -18304 68/push 0/imm32/register -18305 68/push 0/imm32/no-stack-offset -18306 68/push 1/imm32/block-depth -18307 ff 6/subop/push *(ecx+0x10) # Var-type + payload alloc id + handle alloc id -18308 68/push 0x11/imm32/alloc-id:fake -18309 68/push 0/imm32/name -18310 68/push 0/imm32/name -18311 68/push 0x11/imm32/alloc-id:fake:payload -18312 89/<- %ebx 4/r32/esp -18313 $test-emit-subx-stmt-select-primitive:initialize-formal-var-name: -18314 # formal-var->name = "dummy" -18315 8d/copy-address *(ebx+4) 0/r32/eax # Var-name + 4 -18316 (copy-array Heap "dummy" %eax) -18317 $test-emit-subx-stmt-select-primitive:initialize-formal-register: -18318 # formal-var->register = "*" -18319 8d/copy-address *(ebx+0x1c) 0/r32/eax # Var-register + 4 -18320 (copy-array Heap "*" %eax) # Any-register -18321 $test-emit-subx-stmt-select-primitive:initialize-var-list: -18322 # var formal-outputs/ebx: (payload list var) -18323 68/push 0/imm32/next -18324 68/push 0/imm32/next -18325 53/push-ebx/formal-var -18326 68/push 0x11/imm32/alloc-id:fake -18327 68/push 0x11/imm32/alloc-id:fake:payload -18328 89/<- %ebx 4/r32/esp -18329 $test-emit-subx-stmt-select-primitive:initialize-primitive2: -18330 # var primitive2/edi: (payload primitive) -18331 68/push 0/imm32/next -18332 68/push 0/imm32/next -18333 68/push 0/imm32/output-is-write-only -18334 68/push 0/imm32/no-disp32 -18335 68/push 0/imm32/no-imm32 -18336 68/push 0/imm32/no-r32 -18337 68/push 3/imm32/rm32-is-first-output -18338 68/push 0/imm32/subx-name -18339 68/push 0/imm32/subx-name -18340 53/push-ebx/outputs -18341 68/push 0x11/imm32/alloc-id:fake -18342 68/push 0/imm32/no-inouts -18343 68/push 0/imm32/no-inouts +17730 5e/pop-to-esi +17731 59/pop-to-ecx +17732 58/pop-to-eax +17733 # . epilogue +17734 89/<- %esp 5/r32/ebp +17735 5d/pop-to-ebp +17736 c3/return +17737 +17738 emit-subx-call-operand-register-indirect: # out: (addr buffered-file), v: (addr var) +17739 # . prologue +17740 55/push-ebp +17741 89/<- %ebp 4/r32/esp +17742 # . save registers +17743 50/push-eax +17744 51/push-ecx +17745 56/push-esi +17746 # esi = v +17747 8b/-> *(ebp+0xc) 6/r32/esi +17748 # var size/ecx: int = size-of-deref(v) +17749 (size-of-deref %esi) # => eax +17750 89/<- %ecx 0/r32/eax +17751 # var reg-name/esi: (addr array byte) = lookup(v->register) +17752 (lookup *(esi+0x18) *(esi+0x1c)) # Var-register Var-register => eax +17753 89/<- %esi 0/r32/eax +17754 # TODO: assert size is a multiple of 4 +17755 # var i/eax: int = 0 +17756 b8/copy-to-eax 0/imm32 +17757 { +17758 $emit-subx-call-operand-register-indirect:loop: +17759 # if (i >= size) break +17760 39/compare %eax 1/r32/ecx +17761 7d/jump-if->= break/disp8 +17762 # emit " *(" v->register "+" i ")" +17763 (write-buffered *(ebp+8) " *(") +17764 (write-buffered *(ebp+8) %esi) +17765 (write-buffered *(ebp+8) "+") +17766 (write-int32-hex-buffered *(ebp+8) %eax) +17767 (write-buffered *(ebp+8) ")") +17768 # i += 4 +17769 05/add-to-eax 4/imm32 +17770 # +17771 eb/jump loop/disp8 +17772 } +17773 $emit-subx-call-operand-register-indirect:end: +17774 # . restore registers +17775 5e/pop-to-esi +17776 59/pop-to-ecx +17777 58/pop-to-eax +17778 # . epilogue +17779 89/<- %esp 5/r32/ebp +17780 5d/pop-to-ebp +17781 c3/return +17782 +17783 emit-subx-call-operand-stack: # out: (addr buffered-file), v: (addr var) +17784 # . prologue +17785 55/push-ebp +17786 89/<- %ebp 4/r32/esp +17787 # . save registers +17788 50/push-eax +17789 51/push-ecx +17790 56/push-esi +17791 # esi = v +17792 8b/-> *(ebp+0xc) 6/r32/esi +17793 # var curr/ecx: int = v->offset +17794 8b/-> *(esi+0x14) 1/r32/ecx # Var-offset +17795 # var max/eax: int = v->offset + size-of(v) +17796 (size-of %esi) # => eax +17797 # TODO: assert size is a multiple of 4 +17798 01/add-to %eax 1/r32/ecx +17799 { +17800 $emit-subx-call-operand-stack:loop: +17801 # if (curr >= max) break +17802 39/compare %ecx 0/r32/eax +17803 7d/jump-if->= break/disp8 +17804 # emit " *(ebp+" curr ")" +17805 (write-buffered *(ebp+8) " *(ebp+") +17806 (write-int32-hex-buffered *(ebp+8) %ecx) +17807 (write-buffered *(ebp+8) ")") +17808 # i += 4 +17809 81 0/subop/add %ecx 4/imm32 +17810 # +17811 eb/jump loop/disp8 +17812 } +17813 $emit-subx-call-operand-stack:end: +17814 # . restore registers +17815 5e/pop-to-esi +17816 59/pop-to-ecx +17817 58/pop-to-eax +17818 # . epilogue +17819 89/<- %esp 5/r32/ebp +17820 5d/pop-to-ebp +17821 c3/return +17822 +17823 emit-subx-var-as-rm32: # out: (addr buffered-file), s: (addr stmt-var) +17824 # . prologue +17825 55/push-ebp +17826 89/<- %ebp 4/r32/esp +17827 # . save registers +17828 50/push-eax +17829 51/push-ecx +17830 56/push-esi +17831 # ecx = s +17832 8b/-> *(ebp+0xc) 1/r32/ecx +17833 # var operand/esi: (addr var) = lookup(s->value) +17834 (lookup *ecx *(ecx+4)) # Stmt-var-value Stmt-var-value => eax +17835 89/<- %esi 0/r32/eax +17836 # if (operand->register && s->is-deref?) emit "*__" +17837 { +17838 $emit-subx-var-as-rm32:check-for-register-indirect: +17839 81 7/subop/compare *(esi+0x18) 0/imm32 # Var-register +17840 74/jump-if-= break/disp8 +17841 81 7/subop/compare *(ecx+0x10) 0/imm32/false # Stmt-var-is-deref +17842 74/jump-if-= break/disp8 +17843 $emit-subx-var-as-rm32:register-indirect: +17844 (write-buffered *(ebp+8) " *") +17845 (lookup *(esi+0x18) *(esi+0x1c)) # Var-register Var-register => eax +17846 (write-buffered *(ebp+8) %eax) +17847 e9/jump $emit-subx-var-as-rm32:end/disp32 +17848 } +17849 # if (operand->register && !s->is-deref?) emit "%__" +17850 { +17851 $emit-subx-var-as-rm32:check-for-register-direct: +17852 81 7/subop/compare *(esi+0x18) 0/imm32 # Var-register +17853 74/jump-if-= break/disp8 +17854 81 7/subop/compare *(ecx+0x10) 0/imm32/false # Stmt-var-is-deref +17855 75/jump-if-!= break/disp8 +17856 $emit-subx-var-as-rm32:register-direct: +17857 (write-buffered *(ebp+8) " %") +17858 (lookup *(esi+0x18) *(esi+0x1c)) # Var-register Var-register => eax +17859 (write-buffered *(ebp+8) %eax) +17860 e9/jump $emit-subx-var-as-rm32:end/disp32 +17861 } +17862 # else if (operand->stack-offset) emit "*(ebp+__)" +17863 { +17864 81 7/subop/compare *(esi+0x14) 0/imm32 # Var-offset +17865 74/jump-if-= break/disp8 +17866 $emit-subx-var-as-rm32:stack: +17867 (write-buffered *(ebp+8) Space) +17868 (write-buffered *(ebp+8) "*(ebp+") +17869 (write-int32-hex-buffered *(ebp+8) *(esi+0x14)) # Var-offset +17870 (write-buffered *(ebp+8) ")") +17871 } +17872 $emit-subx-var-as-rm32:end: +17873 # . restore registers +17874 5e/pop-to-esi +17875 59/pop-to-ecx +17876 58/pop-to-eax +17877 # . epilogue +17878 89/<- %esp 5/r32/ebp +17879 5d/pop-to-ebp +17880 c3/return +17881 +17882 find-matching-primitive: # primitives: (addr primitive), stmt: (addr stmt) -> result/eax: (addr primitive) +17883 # . prologue +17884 55/push-ebp +17885 89/<- %ebp 4/r32/esp +17886 # . save registers +17887 51/push-ecx +17888 # var curr/ecx: (addr primitive) = primitives +17889 8b/-> *(ebp+8) 1/r32/ecx +17890 { +17891 $find-matching-primitive:loop: +17892 # if (curr == null) break +17893 81 7/subop/compare %ecx 0/imm32 +17894 74/jump-if-= break/disp8 +17895 # if match(curr, stmt) return curr +17896 { +17897 (mu-stmt-matches-primitive? *(ebp+0xc) %ecx) # => eax +17898 3d/compare-eax-and 0/imm32/false +17899 74/jump-if-= break/disp8 +17900 89/<- %eax 1/r32/ecx +17901 eb/jump $find-matching-primitive:end/disp8 +17902 } +17903 $find-matching-primitive:next-primitive: +17904 # curr = curr->next +17905 (lookup *(ecx+0x34) *(ecx+0x38)) # Primitive-next Primitive-next => eax +17906 89/<- %ecx 0/r32/eax +17907 # +17908 e9/jump loop/disp32 +17909 } +17910 # return null +17911 b8/copy-to-eax 0/imm32 +17912 $find-matching-primitive:end: +17913 # . restore registers +17914 59/pop-to-ecx +17915 # . epilogue +17916 89/<- %esp 5/r32/ebp +17917 5d/pop-to-ebp +17918 c3/return +17919 +17920 mu-stmt-matches-primitive?: # stmt: (addr stmt), primitive: (addr primitive) -> result/eax: boolean +17921 # A mu stmt matches a primitive if the name matches, all the inout vars +17922 # match, and all the output vars match. +17923 # Vars match if types match and registers match. +17924 # In addition, a stmt output matches a primitive's output if types match +17925 # and the primitive has a wildcard register. +17926 # . prologue +17927 55/push-ebp +17928 89/<- %ebp 4/r32/esp +17929 # . save registers +17930 51/push-ecx +17931 52/push-edx +17932 53/push-ebx +17933 56/push-esi +17934 57/push-edi +17935 # ecx = stmt +17936 8b/-> *(ebp+8) 1/r32/ecx +17937 # edx = primitive +17938 8b/-> *(ebp+0xc) 2/r32/edx +17939 { +17940 $mu-stmt-matches-primitive?:check-name: +17941 # if (primitive->name != stmt->operation) return false +17942 # . var esi: (addr array byte) = lookup(stmt->operation) +17943 (lookup *(ecx+4) *(ecx+8)) # Stmt1-operation Stmt1-operation => eax +17944 89/<- %esi 0/r32/eax +17945 # . var edi: (addr array byte) = lookup(primitive->name) +17946 (lookup *edx *(edx+4)) # Primitive-name Primitive-name => eax +17947 89/<- %edi 0/r32/eax +17948 (string-equal? %esi %edi) # => eax +17949 3d/compare-eax-and 0/imm32/false +17950 75/jump-if-!= break/disp8 +17951 b8/copy-to-eax 0/imm32 +17952 e9/jump $mu-stmt-matches-primitive?:end/disp32 +17953 } +17954 # var curr/esi: (addr stmt-var) = lookup(stmt->inouts) +17955 (lookup *(ecx+0xc) *(ecx+0x10)) # Stmt1-inouts Stmt1-inouts => eax +17956 89/<- %esi 0/r32/eax +17957 # var curr2/edi: (addr list var) = lookup(primitive->inouts) +17958 (lookup *(edx+8) *(edx+0xc)) # Primitive-inouts Primitive-inouts => eax +17959 89/<- %edi 0/r32/eax +17960 { +17961 $mu-stmt-matches-primitive?:inouts-loop: +17962 # if (curr == 0 && curr2 == 0) move on to check outputs +17963 { +17964 $mu-stmt-matches-primitive?:check-both-inouts-null: +17965 81 7/subop/compare %esi 0/imm32 +17966 75/jump-if-!= break/disp8 +17967 $mu-stmt-matches-primitive?:stmt-inout-null: +17968 81 7/subop/compare %edi 0/imm32 +17969 0f 84/jump-if-= $mu-stmt-matches-primitive?:check-outputs/disp32 +17970 $mu-stmt-matches-primitive?:stmt-inout-null-and-prim-inout-not-null: +17971 # return false +17972 b8/copy-to-eax 0/imm32/false +17973 e9/jump $mu-stmt-matches-primitive?:end/disp32 +17974 } +17975 # if (curr2 == 0) return false +17976 { +17977 $mu-stmt-matches-primitive?:check-prim-inout-null: +17978 81 7/subop/compare %edi 0/imm32 +17979 75/jump-if-!= break/disp8 +17980 $mu-stmt-matches-primitive?:prim-inout-null: +17981 b8/copy-to-eax 0/imm32/false +17982 e9/jump $mu-stmt-matches-primitive?:end/disp32 +17983 } +17984 # if (curr != curr2) return false +17985 { +17986 $mu-stmt-matches-primitive?:check-inouts-match: +17987 (lookup *edi *(edi+4)) # List-value List-value => eax +17988 (operand-matches-primitive? %esi %eax) # => eax +17989 3d/compare-eax-and 0/imm32/false +17990 75/jump-if-!= break/disp8 +17991 $mu-stmt-matches-primitive?:inouts-match: +17992 b8/copy-to-eax 0/imm32/false +17993 e9/jump $mu-stmt-matches-primitive?:end/disp32 +17994 } +17995 $mu-stmt-matches-primitive?:next-inout: +17996 # curr = lookup(curr->next) +17997 (lookup *(esi+8) *(esi+0xc)) # Stmt-var-next Stmt-var-next => eax +17998 89/<- %esi 0/r32/eax +17999 # curr2 = lookup(curr2->next) +18000 (lookup *(edi+8) *(edi+0xc)) # List-next List-next => eax +18001 89/<- %edi 0/r32/eax +18002 # +18003 e9/jump loop/disp32 +18004 } +18005 $mu-stmt-matches-primitive?:check-outputs: +18006 # var curr/esi: (addr stmt-var) = lookup(stmt->outputs) +18007 (lookup *(ecx+0x14) *(ecx+0x18)) # Stmt1-outputs Stmt1-outputs => eax +18008 89/<- %esi 0/r32/eax +18009 # var curr2/edi: (addr list var) = lookup(primitive->outputs) +18010 (lookup *(edx+0x10) *(edx+0x14)) # Primitive-outputs Primitive-outputs => eax +18011 89/<- %edi 0/r32/eax +18012 { +18013 $mu-stmt-matches-primitive?:outputs-loop: +18014 # if (curr == 0) return (curr2 == 0) +18015 { +18016 $mu-stmt-matches-primitive?:check-both-outputs-null: +18017 81 7/subop/compare %esi 0/imm32 +18018 75/jump-if-!= break/disp8 +18019 { +18020 $mu-stmt-matches-primitive?:stmt-output-null: +18021 81 7/subop/compare %edi 0/imm32 +18022 75/jump-if-!= break/disp8 +18023 $mu-stmt-matches-primitive?:both-outputs-null: +18024 # return true +18025 b8/copy-to-eax 1/imm32 +18026 e9/jump $mu-stmt-matches-primitive?:end/disp32 +18027 } +18028 $mu-stmt-matches-primitive?:stmt-output-null-and-prim-output-not-null: +18029 # return false +18030 b8/copy-to-eax 0/imm32 +18031 e9/jump $mu-stmt-matches-primitive?:end/disp32 +18032 } +18033 # if (curr2 == 0) return false +18034 { +18035 $mu-stmt-matches-primitive?:check-prim-output-null: +18036 81 7/subop/compare %edi 0/imm32 +18037 75/jump-if-!= break/disp8 +18038 $mu-stmt-matches-primitive?:prim-output-is-null: +18039 b8/copy-to-eax 0/imm32 +18040 e9/jump $mu-stmt-matches-primitive?:end/disp32 +18041 } +18042 # if (curr != curr2) return false +18043 { +18044 $mu-stmt-matches-primitive?:check-outputs-match: +18045 (lookup *edi *(edi+4)) # List-value List-value => eax +18046 (operand-matches-primitive? %esi %eax) # => eax +18047 3d/compare-eax-and 0/imm32/false +18048 75/jump-if-!= break/disp8 +18049 $mu-stmt-matches-primitive?:outputs-match: +18050 b8/copy-to-eax 0/imm32 +18051 e9/jump $mu-stmt-matches-primitive?:end/disp32 +18052 } +18053 $mu-stmt-matches-primitive?:next-output: +18054 # curr = lookup(curr->next) +18055 (lookup *(esi+8) *(esi+0xc)) # Stmt-var-next Stmt-var-next => eax +18056 89/<- %esi 0/r32/eax +18057 # curr2 = lookup(curr2->next) +18058 (lookup *(edi+8) *(edi+0xc)) # List-next List-next => eax +18059 89/<- %edi 0/r32/eax +18060 # +18061 e9/jump loop/disp32 +18062 } +18063 $mu-stmt-matches-primitive?:return-true: +18064 b8/copy-to-eax 1/imm32 +18065 $mu-stmt-matches-primitive?:end: +18066 # . restore registers +18067 5f/pop-to-edi +18068 5e/pop-to-esi +18069 5b/pop-to-ebx +18070 5a/pop-to-edx +18071 59/pop-to-ecx +18072 # . epilogue +18073 89/<- %esp 5/r32/ebp +18074 5d/pop-to-ebp +18075 c3/return +18076 +18077 operand-matches-primitive?: # s: (addr stmt-var), prim-var: (addr var) -> result/eax: boolean +18078 # . prologue +18079 55/push-ebp +18080 89/<- %ebp 4/r32/esp +18081 # . save registers +18082 51/push-ecx +18083 52/push-edx +18084 53/push-ebx +18085 56/push-esi +18086 57/push-edi +18087 # ecx = s +18088 8b/-> *(ebp+8) 1/r32/ecx +18089 # var var/esi: (addr var) = lookup(s->value) +18090 (lookup *ecx *(ecx+4)) # Stmt-var-value Stmt-var-value => eax +18091 89/<- %esi 0/r32/eax +18092 # edi = prim-var +18093 8b/-> *(ebp+0xc) 7/r32/edi +18094 $operand-matches-primitive?:check-type: +18095 # if !category-match?(var->type, prim-var->type) return false +18096 # . var vtype/ebx: (addr type-tree) = lookup(var->type) +18097 (lookup *(esi+8) *(esi+0xc)) # Var-type Var-type => eax +18098 89/<- %ebx 0/r32/eax +18099 # . var ptype/eax: (addr type-tree) = lookup(prim-var->type) +18100 (lookup *(edi+8) *(edi+0xc)) # Var-type Var-type => eax +18101 (subx-type-category-match? %ebx %eax) # => eax +18102 3d/compare-eax-and 0/imm32/false +18103 0f 84/jump-if-= $operand-matches-primitive?:return-false/disp32 +18104 { +18105 $operand-matches-primitive?:check-register: +18106 # if prim-var is in memory and var is in register but dereference, match +18107 { +18108 81 7/subop/compare *(edi+0x18) 0/imm32 # Var-register +18109 0f 85/jump-if-!= break/disp32 +18110 81 7/subop/compare *(esi+0x18) 0/imm32 # Var-register +18111 74/jump-if-= break/disp8 +18112 81 7/subop/compare *(ecx+0x10) 0/imm32/false # Stmt-var-is-deref +18113 74/jump-if-= break/disp8 +18114 $operand-matches-primitive?:var-deref-match: +18115 e9/jump $operand-matches-primitive?:return-true/disp32 +18116 } +18117 # if prim-var is in register and var is in register but dereference, no match +18118 { +18119 81 7/subop/compare *(edi+0x18) 0/imm32 # Var-register +18120 0f 84/jump-if-= break/disp32 +18121 81 7/subop/compare *(esi+0x18) 0/imm32 # Var-register +18122 0f 84/jump-if-= break/disp32 +18123 81 7/subop/compare *(ecx+0x10) 0/imm32/false # Stmt-var-is-deref +18124 74/jump-if-= break/disp8 +18125 $operand-matches-primitive?:var-deref-no-match: +18126 e9/jump $operand-matches-primitive?:return-false/disp32 +18127 } +18128 # return false if var->register doesn't match prim-var->register +18129 { +18130 # if register addresses are equal, it's a match +18131 # var vreg/ebx: (addr array byte) = lookup(var->register) +18132 (lookup *(esi+0x18) *(esi+0x1c)) # Var-register Var-register => eax +18133 89/<- %ebx 0/r32/eax +18134 # var preg/ecx: (addr array byte) = lookup(prim-var->register) +18135 (lookup *(edi+0x18) *(edi+0x1c)) # Var-register Var-register => eax +18136 89/<- %ecx 0/r32/eax +18137 # if (vreg == preg) break +18138 39/compare %ecx 3/r32/ebx +18139 74/jump-if-= break/disp8 +18140 $operand-matches-primitive?:var-register-no-match: +18141 # if either address is 0, return false +18142 81 7/subop/compare %ebx 0/imm32 +18143 74/jump-if-= $operand-matches-primitive?:return-false/disp8 +18144 81 7/subop/compare %ecx 0/imm32 +18145 74/jump-if-= $operand-matches-primitive?:return-false/disp8 +18146 # if prim-var->register is wildcard, it's a match +18147 (string-equal? %ecx "*") # Any-register => eax +18148 3d/compare-eax-and 0/imm32/false +18149 75/jump-if-!= break/disp8 +18150 $operand-matches-primitive?:wildcard-no-match: +18151 # if string contents aren't equal, return false +18152 (string-equal? %ecx %ebx) # => eax +18153 3d/compare-eax-and 0/imm32/false +18154 74/jump-if-= $operand-matches-primitive?:return-false/disp8 +18155 } +18156 } +18157 $operand-matches-primitive?:return-true: +18158 b8/copy-to-eax 1/imm32/true +18159 eb/jump $operand-matches-primitive?:end/disp8 +18160 $operand-matches-primitive?:return-false: +18161 b8/copy-to-eax 0/imm32/false +18162 $operand-matches-primitive?:end: +18163 # . restore registers +18164 5f/pop-to-edi +18165 5e/pop-to-esi +18166 5b/pop-to-ebx +18167 5a/pop-to-edx +18168 59/pop-to-ecx +18169 # . epilogue +18170 89/<- %esp 5/r32/ebp +18171 5d/pop-to-ebp +18172 c3/return +18173 +18174 find-matching-function: # functions: (addr function), stmt: (addr stmt) -> result/eax: (addr function) +18175 # . prologue +18176 55/push-ebp +18177 89/<- %ebp 4/r32/esp +18178 # . save registers +18179 51/push-ecx +18180 # var curr/ecx: (handle function) = functions +18181 8b/-> *(ebp+8) 1/r32/ecx +18182 { +18183 # if (curr == null) break +18184 81 7/subop/compare %ecx 0/imm32 +18185 74/jump-if-= break/disp8 +18186 #? (write-buffered Stderr "iter\n") +18187 #? (flush Stderr) +18188 # if match(stmt, curr) return curr +18189 { +18190 (mu-stmt-matches-function? *(ebp+0xc) %ecx) # => eax +18191 3d/compare-eax-and 0/imm32/false +18192 74/jump-if-= break/disp8 +18193 89/<- %eax 1/r32/ecx +18194 eb/jump $find-matching-function:end/disp8 +18195 } +18196 # curr = curr->next +18197 (lookup *(ecx+0x20) *(ecx+0x24)) # Function-next Function-next => eax +18198 89/<- %ecx 0/r32/eax +18199 # +18200 eb/jump loop/disp8 +18201 } +18202 # return null +18203 b8/copy-to-eax 0/imm32 +18204 $find-matching-function:end: +18205 # . restore registers +18206 59/pop-to-ecx +18207 # . epilogue +18208 89/<- %esp 5/r32/ebp +18209 5d/pop-to-ebp +18210 c3/return +18211 +18212 # Just compare names; user-defined functions don't support overloading yet. +18213 mu-stmt-matches-function?: # stmt: (addr stmt1), function: (addr function) -> result/eax: boolean +18214 # . prologue +18215 55/push-ebp +18216 89/<- %ebp 4/r32/esp +18217 # . save registers +18218 51/push-ecx +18219 # return function->name == stmt->operation +18220 # ecx = lookup(stmt->operation) +18221 8b/-> *(ebp+8) 0/r32/eax +18222 (lookup *(eax+4) *(eax+8)) # Stmt1-operation Stmt1-operation => eax +18223 89/<- %ecx 0/r32/eax +18224 # eax = lookup(function->name) +18225 8b/-> *(ebp+0xc) 0/r32/eax +18226 (lookup *eax *(eax+4)) # Function-name Function-name => eax +18227 (string-equal? %eax %ecx) # => eax +18228 $mu-stmt-matches-function?:end: +18229 # . restore registers +18230 59/pop-to-ecx +18231 # . epilogue +18232 89/<- %esp 5/r32/ebp +18233 5d/pop-to-ebp +18234 c3/return +18235 +18236 # Type-checking happens elsewhere. This method is for selecting between +18237 # primitives. +18238 subx-type-category-match?: # a: (addr type-tree), b: (addr type-tree) -> result/eax: boolean +18239 # . prologue +18240 55/push-ebp +18241 89/<- %ebp 4/r32/esp +18242 # . save registers +18243 51/push-ecx +18244 # var alit/ecx: boolean = is-literal-type?(a) +18245 (is-simple-mu-type? *(ebp+8) 0) # => eax +18246 89/<- %ecx 0/r32/eax +18247 # var blit/eax: boolean = is-literal-type?(b) +18248 (is-simple-mu-type? *(ebp+0xc) 0) # => eax +18249 # return alit == blit +18250 39/compare %eax 1/r32/ecx +18251 0f 94/set-byte-if-= %al +18252 81 4/subop/and %eax 0xff/imm32 +18253 $subx-type-category-match?:end: +18254 # . restore registers +18255 59/pop-to-ecx +18256 # . epilogue +18257 89/<- %esp 5/r32/ebp +18258 5d/pop-to-ebp +18259 c3/return +18260 +18261 is-simple-mu-type?: # a: (addr type-tree), n: type-id -> result/eax: boolean +18262 # . prologue +18263 55/push-ebp +18264 89/<- %ebp 4/r32/esp +18265 # . save registers +18266 51/push-ecx +18267 # ecx = n +18268 8b/-> *(ebp+0xc) 1/r32/ecx +18269 # return (a->value == n) +18270 8b/-> *(ebp+8) 0/r32/eax +18271 39/compare *(eax+4) 1/r32/ecx # Type-tree-value +18272 0f 94/set-byte-if-= %al +18273 81 4/subop/and %eax 0xff/imm32 +18274 $is-simple-mu-type?:end: +18275 # . restore registers +18276 59/pop-to-ecx +18277 # . epilogue +18278 89/<- %esp 5/r32/ebp +18279 5d/pop-to-ebp +18280 c3/return +18281 +18282 is-mu-addr-type?: # a: (addr type-tree) -> result/eax: boolean +18283 # . prologue +18284 55/push-ebp +18285 89/<- %ebp 4/r32/esp +18286 # eax = a +18287 8b/-> *(ebp+8) 0/r32/eax +18288 # if (!a->is-atom?) a = a->left +18289 81 7/subop/compare *eax 0/imm32/false # Type-tree-is-atom +18290 { +18291 75/jump-if-!= break/disp8 +18292 (lookup *(eax+4) *(eax+8)) # Type-tree-left Type-tree-left => eax +18293 } +18294 # return (a->value == addr) +18295 81 7/subop/compare *(eax+4) 2/imm32/addr # Type-tree-value +18296 0f 94/set-byte-if-= %al +18297 81 4/subop/and %eax 0xff/imm32 +18298 $is-mu-addr-type?:end: +18299 # . epilogue +18300 89/<- %esp 5/r32/ebp +18301 5d/pop-to-ebp +18302 c3/return +18303 +18304 test-emit-subx-stmt-primitive: +18305 # Primitive operation on a variable on the stack. +18306 # increment foo +18307 # => +18308 # ff 0/subop/increment *(ebp-8) +18309 # +18310 # There's a variable on the var stack as follows: +18311 # name: 'foo' +18312 # type: int +18313 # stack-offset: -8 +18314 # +18315 # There's a primitive with this info: +18316 # name: 'increment' +18317 # inouts: int/mem +18318 # value: 'ff 0/subop/increment' +18319 # +18320 # . prologue +18321 55/push-ebp +18322 89/<- %ebp 4/r32/esp +18323 # setup +18324 (clear-stream _test-output-stream) +18325 (clear-stream $_test-output-buffered-file->buffer) +18326 # simulate allocated payloads starting with an initial fake alloc-id (0x11) +18327 $test-emit-subx-stmt-primitive:initialize-type: +18328 # var type/ecx: (payload type-tree) = int +18329 68/push 0/imm32/right:null +18330 68/push 0/imm32/right:null +18331 68/push 0/imm32/left:unused +18332 68/push 1/imm32/value:int +18333 68/push 1/imm32/is-atom?:true +18334 68/push 0x11/imm32/alloc-id:fake:payload +18335 89/<- %ecx 4/r32/esp +18336 $test-emit-subx-stmt-primitive:initialize-var: +18337 # var var-foo/ecx: (payload var) = var(type) +18338 68/push 0/imm32/no-register +18339 68/push 0/imm32/no-register +18340 68/push -8/imm32/stack-offset +18341 68/push 1/imm32/block-depth +18342 51/push-ecx/type +18343 68/push 0x11/imm32/alloc-id:fake 18344 68/push 0/imm32/name 18345 68/push 0/imm32/name 18346 68/push 0x11/imm32/alloc-id:fake:payload -18347 89/<- %edi 4/r32/esp -18348 $test-emit-subx-stmt-select-primitive:initialize-primitive2-name: -18349 # primitives->name = "increment" -18350 8d/copy-address *(edi+4) 0/r32/eax # Primitive-name + 4 -18351 (copy-array Heap "increment" %eax) -18352 $test-emit-subx-stmt-select-primitive:initialize-primitive2-subx-name: -18353 # primitives->subx-name = "ff 0/subop/increment" -18354 8d/copy-address *(edi+0x1c) 0/r32/eax # Primitive-subx-name + 4 -18355 (copy-array Heap "ff 0/subop/increment" %eax) -18356 $test-emit-subx-stmt-select-primitive:initialize-primitive: -18357 # var primitives/ebx: (addr primitive) -18358 57/push-edi -18359 68/push 0x11/imm32/alloc-id:fake -18360 68/push 0/imm32/output-is-write-only -18361 68/push 0/imm32/no-disp32 -18362 68/push 0/imm32/no-imm32 -18363 68/push 0/imm32/no-r32 -18364 68/push 1/imm32/rm32-is-first-inout -18365 68/push 0/imm32/subx-name -18366 68/push 0/imm32/subx-name -18367 68/push 0/imm32/no-outputs -18368 68/push 0/imm32/no-outputs -18369 53/push-ebx/inouts # hack: reuse stmt-var from call stmt as (list var) in function declaration -18370 68/push 0x11/imm32/alloc-id:fake -18371 68/push 0/imm32/name -18372 68/push 0/imm32/name -18373 89/<- %ebx 4/r32/esp -18374 $test-emit-subx-stmt-select-primitive:initialize-primitive-name: -18375 # primitives->name = "increment" -18376 (copy-array Heap "increment" %ebx) # Primitive-name -18377 $test-emit-subx-stmt-select-primitive:initialize-primitive-subx-name: -18378 # primitives->subx-name = "ff 0/subop/increment" -18379 8d/copy-address *(ebx+0x18) 0/r32/eax # Primitive-subx-name -18380 (copy-array Heap "ff 0/subop/increment" %eax) -18381 # convert -18382 c7 0/subop/copy *Curr-block-depth 0/imm32 -18383 (emit-subx-stmt _test-output-buffered-file %esi %ebx Stderr 0) -18384 (flush _test-output-buffered-file) -18385 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- -18391 # check output -18392 (check-next-stream-line-equal _test-output-stream "ff 0/subop/increment %eax" "F - test-emit-subx-stmt-select-primitive") -18393 # . epilogue -18394 89/<- %esp 5/r32/ebp -18395 5d/pop-to-ebp -18396 c3/return -18397 -18398 test-emit-subx-stmt-select-primitive-2: -18399 # Select the right primitive between overloads. -18400 # increment foo -18401 # => -18402 # ff 0/subop/increment %eax # sub-optimal, but should suffice -18403 # -18404 # There's a variable on the var stack as follows: -18405 # name: 'foo' -18406 # type: int -18407 # register: 'eax' -18408 # -18409 # There's two primitives, as follows: -18410 # - name: 'increment' -18411 # out: int/reg -18412 # value: 'ff 0/subop/increment' -18413 # - name: 'increment' -18414 # inout: int/mem -18415 # value: 'ff 0/subop/increment' -18416 # -18417 # . prologue -18418 55/push-ebp -18419 89/<- %ebp 4/r32/esp -18420 # setup -18421 (clear-stream _test-output-stream) -18422 (clear-stream $_test-output-buffered-file->buffer) -18423 $test-emit-subx-stmt-select-primitive-2:initialize-type: -18424 # var type/ecx: (payload tree type-id) = int -18425 68/push 0/imm32/right:null -18426 68/push 0/imm32/right:null -18427 68/push 0/imm32/left:unused -18428 68/push 1/imm32/value:int -18429 68/push 1/imm32/is-atom?:true -18430 68/push 0x11/imm32/alloc-id:fake:payload -18431 89/<- %ecx 4/r32/esp -18432 $test-emit-subx-stmt-select-primitive-2:initialize-var: -18433 # var var-foo/ecx: (payload var) -18434 68/push 0/imm32/register -18435 68/push 0/imm32/register -18436 68/push 0/imm32/no-stack-offset -18437 68/push 1/imm32/block-depth -18438 51/push-ecx -18439 68/push 0x11/imm32/alloc-id:fake -18440 68/push 0/imm32/name -18441 68/push 0/imm32/name -18442 68/push 0x11/imm32/alloc-id:fake:payload -18443 89/<- %ecx 4/r32/esp -18444 $test-emit-subx-stmt-select-primitive-2:initialize-var-name: -18445 # var-foo->name = "foo" -18446 8d/copy-address *(ecx+4) 0/r32/eax # Var-name + 4 -18447 (copy-array Heap "foo" %eax) -18448 $test-emit-subx-stmt-select-primitive-2:initialize-var-register: -18449 # var-foo->register = "eax" -18450 8d/copy-address *(ecx+0x1c) 0/r32/eax # Var-register + 4 -18451 (copy-array Heap "eax" %eax) -18452 $test-emit-subx-stmt-select-primitive-2:initialize-stmt-var: -18453 # var operand/ebx: (payload stmt-var) -18454 68/push 0/imm32/is-deref:false -18455 68/push 0/imm32/next -18456 68/push 0/imm32/next -18457 51/push-ecx/var-foo -18458 68/push 0x11/imm32/alloc-id:fake -18459 68/push 0x11/imm32/alloc-id:fake:payload -18460 89/<- %ebx 4/r32/esp -18461 $test-emit-subx-stmt-select-primitive-2:initialize-stmt: -18462 # var stmt/esi: (addr statement) -18463 68/push 0/imm32/no-outputs -18464 68/push 0/imm32/no-outputs -18465 53/push-ebx/inouts -18466 68/push 0x11/imm32/alloc-id:fake -18467 68/push 0/imm32/operation -18468 68/push 0/imm32/operation -18469 68/push 1/imm32 -18470 89/<- %esi 4/r32/esp -18471 $test-emit-subx-stmt-select-primitive-2:initialize-stmt-operation: -18472 # stmt->operation = "increment" -18473 8d/copy-address *(esi+4) 0/r32/eax # Stmt1-operation -18474 (copy-array Heap "increment" %eax) -18475 $test-emit-subx-stmt-select-primitive-2:initialize-formal-var: -18476 # var formal-var/ebx: (payload var) -18477 68/push 0/imm32/register -18478 68/push 0/imm32/register -18479 68/push 0/imm32/no-stack-offset -18480 68/push 1/imm32/block-depth -18481 ff 6/subop/push *(ecx+0x10) # Var-type + payload alloc id + handle alloc id -18482 68/push 0x11/imm32/alloc-id:fake -18483 68/push 0/imm32/name -18484 68/push 0/imm32/name -18485 68/push 0x11/imm32/alloc-id:fake:payload -18486 89/<- %ebx 4/r32/esp -18487 $test-emit-subx-stmt-select-primitive-2:initialize-formal-var-name: -18488 # formal-var->name = "dummy" -18489 8d/copy-address *(ebx+4) 0/r32/eax # Var-name + 4 -18490 (copy-array Heap "dummy" %eax) -18491 $test-emit-subx-stmt-select-primitive-2:initialize-formal-register: -18492 # formal-var->register = "*" -18493 8d/copy-address *(ebx+0x1c) 0/r32/eax # Var-register + 4 -18494 (copy-array Heap "*" %eax) # Any-register -18495 $test-emit-subx-stmt-select-primitive-2:initialize-var-list: -18496 # var formal-outputs/ebx: (payload list stmt-var) -18497 68/push 0/imm32/next -18498 68/push 0/imm32/next -18499 53/push-ebx/formal-var -18500 68/push 0x11/imm32/alloc-id:fake +18347 89/<- %ecx 4/r32/esp +18348 $test-emit-subx-stmt-primitive:initialize-var-name: +18349 # var-foo->name = "foo" +18350 8d/copy-address *(ecx+4) 0/r32/eax # Var-name + 4 +18351 (copy-array Heap "foo" %eax) +18352 $test-emit-subx-stmt-primitive:initialize-stmt-var: +18353 # var operand/ebx: (payload stmt-var) = stmt-var(var-foo) +18354 68/push 0/imm32/is-deref:false +18355 68/push 0/imm32/next +18356 68/push 0/imm32/next +18357 51/push-ecx/var-foo +18358 68/push 0x11/imm32/alloc-id:fake +18359 68/push 0x11/imm32/alloc-id:fake:payload +18360 89/<- %ebx 4/r32/esp +18361 $test-emit-subx-stmt-primitive:initialize-stmt: +18362 # var stmt/esi: (addr statement) +18363 68/push 0/imm32/no-outputs +18364 68/push 0/imm32/no-outputs +18365 53/push-ebx/inouts +18366 68/push 0x11/imm32/alloc-id:fake +18367 68/push 0/imm32/operation +18368 68/push 0/imm32/operation +18369 68/push 1/imm32/tag +18370 89/<- %esi 4/r32/esp +18371 $test-emit-subx-stmt-primitive:initialize-stmt-operation: +18372 # stmt->operation = "increment" +18373 8d/copy-address *(esi+4) 0/r32/eax # Stmt1-operation +18374 (copy-array Heap "increment" %eax) +18375 $test-emit-subx-stmt-primitive:initialize-primitive: +18376 # var primitives/ebx: (addr primitive) +18377 68/push 0/imm32/next +18378 68/push 0/imm32/next +18379 68/push 0/imm32/output-is-write-only +18380 68/push 0/imm32/no-disp32 +18381 68/push 0/imm32/no-imm32 +18382 68/push 0/imm32/no-r32 +18383 68/push 1/imm32/rm32-is-first-inout +18384 68/push 0/imm32/subx-name +18385 68/push 0/imm32/subx-name +18386 68/push 0/imm32/no-outputs +18387 68/push 0/imm32/no-outputs +18388 53/push-ebx/inouts # hack: reuse stmt-var from call stmt as (list var) in function declaration +18389 68/push 0x11/imm32/alloc-id:fake +18390 68/push 0/imm32/name +18391 68/push 0/imm32/name +18392 89/<- %ebx 4/r32/esp +18393 $test-emit-subx-stmt-primitive:initialize-primitive-name: +18394 # primitives->name = "increment" +18395 (copy-array Heap "increment" %ebx) # Primitive-name +18396 $test-emit-subx-stmt-primitive:initialize-primitive-subx-name: +18397 # primitives->subx-name = "ff 0/subop/increment" +18398 8d/copy-address *(ebx+0x18) 0/r32/eax # Primitive-subx-name +18399 (copy-array Heap "ff 0/subop/increment" %eax) +18400 # convert +18401 c7 0/subop/copy *Curr-block-depth 0/imm32 +18402 (emit-subx-stmt _test-output-buffered-file %esi %ebx Stderr 0) +18403 (flush _test-output-buffered-file) +18404 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- +18410 # check output +18411 (check-next-stream-line-equal _test-output-stream "ff 0/subop/increment *(ebp+0xfffffff8)" "F - test-emit-subx-stmt-primitive") +18412 # . epilogue +18413 89/<- %esp 5/r32/ebp +18414 5d/pop-to-ebp +18415 c3/return +18416 +18417 test-emit-subx-stmt-primitive-register: +18418 # Primitive operation on a variable in a register. +18419 # foo <- increment +18420 # => +18421 # ff 0/subop/increment %eax # sub-optimal, but should suffice +18422 # +18423 # There's a variable on the var stack as follows: +18424 # name: 'foo' +18425 # type: int +18426 # register: 'eax' +18427 # +18428 # There's a primitive with this info: +18429 # name: 'increment' +18430 # out: int/reg +18431 # value: 'ff 0/subop/increment' +18432 # +18433 # . prologue +18434 55/push-ebp +18435 89/<- %ebp 4/r32/esp +18436 # setup +18437 (clear-stream _test-output-stream) +18438 (clear-stream $_test-output-buffered-file->buffer) +18439 $test-emit-subx-stmt-primitive-register:initialize-type: +18440 # var type/ecx: (payload type-tree) = int +18441 68/push 0/imm32/right:null +18442 68/push 0/imm32/right:null +18443 68/push 0/imm32/left:unused +18444 68/push 1/imm32/value:int +18445 68/push 1/imm32/is-atom?:true +18446 68/push 0x11/imm32/alloc-id:fake:payload +18447 89/<- %ecx 4/r32/esp +18448 $test-emit-subx-stmt-primitive-register:initialize-var: +18449 # var var-foo/ecx: (payload var) +18450 68/push 0/imm32/register +18451 68/push 0/imm32/register +18452 68/push 0/imm32/no-stack-offset +18453 68/push 1/imm32/block-depth +18454 51/push-ecx +18455 68/push 0x11/imm32/alloc-id:fake +18456 68/push 0/imm32/name +18457 68/push 0/imm32/name +18458 68/push 0x11/imm32/alloc-id:fake:payload +18459 89/<- %ecx 4/r32/esp +18460 $test-emit-subx-stmt-primitive-register:initialize-var-name: +18461 # var-foo->name = "foo" +18462 8d/copy-address *(ecx+4) 0/r32/eax # Var-name + 4 +18463 (copy-array Heap "foo" %eax) +18464 $test-emit-subx-stmt-primitive-register:initialize-var-register: +18465 # var-foo->register = "eax" +18466 8d/copy-address *(ecx+0x1c) 0/r32/eax # Var-register + 4 +18467 (copy-array Heap "eax" %eax) +18468 $test-emit-subx-stmt-primitive-register:initialize-stmt-var: +18469 # var operand/ebx: (payload stmt-var) +18470 68/push 0/imm32/is-deref:false +18471 68/push 0/imm32/next +18472 68/push 0/imm32/next +18473 51/push-ecx/var-foo +18474 68/push 0x11/imm32/alloc-id:fake +18475 68/push 0x11/imm32/alloc-id:fake:payload +18476 89/<- %ebx 4/r32/esp +18477 $test-emit-subx-stmt-primitive-register:initialize-stmt: +18478 # var stmt/esi: (addr statement) +18479 53/push-ebx/outputs +18480 68/push 0x11/imm32/alloc-id:fake +18481 68/push 0/imm32/no-inouts +18482 68/push 0/imm32/no-inouts +18483 68/push 0/imm32/operation +18484 68/push 0/imm32/operation +18485 68/push 1/imm32 +18486 89/<- %esi 4/r32/esp +18487 $test-emit-subx-stmt-primitive-register:initialize-stmt-operation: +18488 # stmt->operation = "increment" +18489 8d/copy-address *(esi+4) 0/r32/eax # Stmt1-operation +18490 (copy-array Heap "increment" %eax) +18491 $test-emit-subx-stmt-primitive-register:initialize-formal-var: +18492 # var formal-var/ebx: (payload var) +18493 68/push 0/imm32/register +18494 68/push 0/imm32/register +18495 68/push 0/imm32/no-stack-offset +18496 68/push 1/imm32/block-depth +18497 ff 6/subop/push *(ecx+0x10) # Var-type + payload alloc id + handle alloc id +18498 68/push 0x11/imm32/alloc-id:fake +18499 68/push 0/imm32/name +18500 68/push 0/imm32/name 18501 68/push 0x11/imm32/alloc-id:fake:payload 18502 89/<- %ebx 4/r32/esp -18503 $test-emit-subx-stmt-select-primitive-2:initialize-primitive2: -18504 # var primitive2/edi: (payload primitive) -18505 68/push 0/imm32/next -18506 68/push 0/imm32/next -18507 68/push 0/imm32/output-is-write-only -18508 68/push 0/imm32/no-disp32 -18509 68/push 0/imm32/no-imm32 -18510 68/push 0/imm32/no-r32 -18511 68/push 3/imm32/rm32-is-first-output -18512 68/push 0/imm32/subx-name -18513 68/push 0/imm32/subx-name -18514 53/push-ebx/outputs -18515 68/push 0x11/imm32/alloc-id:fake -18516 68/push 0/imm32/no-inouts -18517 68/push 0/imm32/no-inouts -18518 68/push 0/imm32/name -18519 68/push 0/imm32/name -18520 68/push 0x11/imm32/alloc-id:fake:payload -18521 89/<- %edi 4/r32/esp -18522 $test-emit-subx-stmt-select-primitive-2:initialize-primitive2-name: -18523 # primitives->name = "increment" -18524 8d/copy-address *(edi+4) 0/r32/eax # Primitive-name + 4 -18525 (copy-array Heap "increment" %eax) -18526 $test-emit-subx-stmt-select-primitive-2:initialize-primitive2-subx-name: -18527 # primitives->subx-name = "ff 0/subop/increment" -18528 8d/copy-address *(edi+0x1c) 0/r32/eax # Primitive-subx-name + 4 -18529 (copy-array Heap "ff 0/subop/increment" %eax) -18530 $test-emit-subx-stmt-select-primitive-2:initialize-primitive: -18531 # var primitives/ebx: (addr primitive) -18532 57/push-edi -18533 68/push 0x11/imm32/alloc-id:fake -18534 68/push 0/imm32/output-is-write-only -18535 68/push 0/imm32/no-disp32 -18536 68/push 0/imm32/no-imm32 -18537 68/push 0/imm32/no-r32 -18538 68/push 1/imm32/rm32-is-first-inout -18539 68/push 0/imm32/subx-name -18540 68/push 0/imm32/subx-name -18541 68/push 0/imm32/no-outputs -18542 68/push 0/imm32/no-outputs -18543 53/push-ebx/inouts # hack: reuse stmt-var from call stmt as (list var) in function declaration -18544 68/push 0x11/imm32/alloc-id:fake -18545 68/push 0/imm32/name -18546 68/push 0/imm32/name -18547 89/<- %ebx 4/r32/esp -18548 $test-emit-subx-stmt-select-primitive-2:initialize-primitive-name: -18549 # primitives->name = "increment" -18550 (copy-array Heap "increment" %ebx) # Primitive-name -18551 $test-emit-subx-stmt-select-primitive-2:initialize-primitive-subx-name: -18552 # primitives->subx-name = "ff 0/subop/increment" -18553 8d/copy-address *(ebx+0x18) 0/r32/eax # Primitive-subx-name -18554 (copy-array Heap "ff 0/subop/increment" %eax) -18555 # convert -18556 c7 0/subop/copy *Curr-block-depth 0/imm32 -18557 (emit-subx-stmt _test-output-buffered-file %esi %ebx Stderr 0) -18558 (flush _test-output-buffered-file) -18559 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- -18565 # check output -18566 (check-next-stream-line-equal _test-output-stream "ff 0/subop/increment %eax" "F - test-emit-subx-stmt-select-primitive-2") -18567 # . epilogue -18568 89/<- %esp 5/r32/ebp -18569 5d/pop-to-ebp -18570 c3/return -18571 -18572 test-increment-register: -18573 # Select the right register between overloads. -18574 # foo <- increment -18575 # => -18576 # 50/increment-eax -18577 # -18578 # There's a variable on the var stack as follows: -18579 # name: 'foo' -18580 # type: int -18581 # register: 'eax' -18582 # -18583 # Primitives are the global definitions. -18584 # -18585 # . prologue -18586 55/push-ebp -18587 89/<- %ebp 4/r32/esp -18588 # setup -18589 (clear-stream _test-output-stream) -18590 (clear-stream $_test-output-buffered-file->buffer) -18591 $test-increment-register:initialize-type: -18592 # var type/ecx: (payload tree type-id) = int -18593 68/push 0/imm32/right:null -18594 68/push 0/imm32/right:null -18595 68/push 0/imm32/left:unused -18596 68/push 1/imm32/value:int -18597 68/push 1/imm32/is-atom?:true -18598 68/push 0x11/imm32/alloc-id:fake:payload -18599 89/<- %ecx 4/r32/esp -18600 $test-increment-register:initialize-var: -18601 # var var-foo/ecx: (payload var) -18602 68/push 0/imm32/register -18603 68/push 0/imm32/register -18604 68/push 0/imm32/no-stack-offset -18605 68/push 1/imm32/block-depth -18606 51/push-ecx -18607 68/push 0x11/imm32/alloc-id:fake -18608 68/push 0/imm32/name -18609 68/push 0/imm32/name -18610 68/push 0x11/imm32/alloc-id:fake:payload -18611 89/<- %ecx 4/r32/esp -18612 $test-increment-register:initialize-var-name: -18613 # var-foo->name = "foo" -18614 8d/copy-address *(ecx+4) 0/r32/eax # Var-name + 4 -18615 (copy-array Heap "foo" %eax) -18616 $test-increment-register:initialize-var-register: -18617 # var-foo->register = "eax" -18618 8d/copy-address *(ecx+0x1c) 0/r32/eax # Var-register + 4 -18619 (copy-array Heap "eax" %eax) -18620 $test-increment-register:initialize-stmt-var: -18621 # var operand/ebx: (payload stmt-var) -18622 68/push 0/imm32/is-deref:false -18623 68/push 0/imm32/next -18624 68/push 0/imm32/next -18625 51/push-ecx/var-foo -18626 68/push 0x11/imm32/alloc-id:fake -18627 68/push 0x11/imm32/alloc-id:fake:payload -18628 89/<- %ebx 4/r32/esp -18629 $test-increment-register:initialize-stmt: -18630 # var stmt/esi: (addr statement) -18631 53/push-ebx/outputs -18632 68/push 0x11/imm32/alloc-id:fake -18633 68/push 0/imm32/no-inouts -18634 68/push 0/imm32/no-inouts -18635 68/push 0/imm32/operation -18636 68/push 0/imm32/operation -18637 68/push 1/imm32 -18638 89/<- %esi 4/r32/esp -18639 $test-increment-register:initialize-stmt-operation: -18640 # stmt->operation = "increment" -18641 8d/copy-address *(esi+4) 0/r32/eax # Stmt1-operation -18642 (copy-array Heap "increment" %eax) -18643 # convert -18644 c7 0/subop/copy *Curr-block-depth 0/imm32 -18645 (emit-subx-stmt _test-output-buffered-file %esi Primitives Stderr 0) -18646 (flush _test-output-buffered-file) -18647 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- -18653 # check output -18654 (check-next-stream-line-equal _test-output-stream "40/increment-eax" "F - test-increment-register") -18655 # . epilogue -18656 89/<- %esp 5/r32/ebp -18657 5d/pop-to-ebp -18658 c3/return -18659 -18660 test-add-reg-to-reg: -18661 # var1/reg <- add var2/reg -18662 # => -18663 # 01/add-to %var1 var2 -18664 # -18665 # . prologue -18666 55/push-ebp -18667 89/<- %ebp 4/r32/esp -18668 # setup -18669 (clear-stream _test-output-stream) -18670 (clear-stream $_test-output-buffered-file->buffer) -18671 $test-add-reg-to-reg:initialize-type: -18672 # var type/ecx: (payload tree type-id) = int -18673 68/push 0/imm32/right:null -18674 68/push 0/imm32/right:null -18675 68/push 0/imm32/left:unused -18676 68/push 1/imm32/value:int -18677 68/push 1/imm32/is-atom?:true -18678 68/push 0x11/imm32/alloc-id:fake:payload -18679 89/<- %ecx 4/r32/esp -18680 $test-add-reg-to-reg:initialize-var1: -18681 # var var1/ecx: (payload var) -18682 68/push 0/imm32/register -18683 68/push 0/imm32/register -18684 68/push 0/imm32/no-stack-offset -18685 68/push 1/imm32/block-depth -18686 51/push-ecx -18687 68/push 0x11/imm32/alloc-id:fake -18688 68/push 0/imm32/name -18689 68/push 0/imm32/name -18690 68/push 0x11/imm32/alloc-id:fake:payload -18691 89/<- %ecx 4/r32/esp -18692 $test-add-reg-to-reg:initialize-var1-name: -18693 # var1->name = "var1" -18694 8d/copy-address *(ecx+4) 0/r32/eax # Var-name + 4 -18695 (copy-array Heap "var1" %eax) -18696 $test-add-reg-to-reg:initialize-var1-register: -18697 # var1->register = "eax" -18698 8d/copy-address *(ecx+0x1c) 0/r32/eax # Var-register + 4 -18699 (copy-array Heap "eax" %eax) -18700 $test-add-reg-to-reg:initialize-var2: -18701 # var var2/edx: (payload var) -18702 68/push 0/imm32/register -18703 68/push 0/imm32/register -18704 68/push 0/imm32/no-stack-offset -18705 68/push 1/imm32/block-depth -18706 ff 6/subop/push *(ecx+0x10) +18503 $test-emit-subx-stmt-primitive-register:initialize-formal-var-name: +18504 # formal-var->name = "dummy" +18505 8d/copy-address *(ebx+4) 0/r32/eax # Var-name + 4 +18506 (copy-array Heap "dummy" %eax) +18507 $test-emit-subx-stmt-primitive-register:initialize-formal-register: +18508 # formal-var->register = "*" +18509 8d/copy-address *(ebx+0x1c) 0/r32/eax # Var-register + 4 +18510 (copy-array Heap "*" %eax) # Any-register +18511 $test-emit-subx-stmt-primitive-register:initialize-var-list: +18512 # var formal-outputs/ebx: (payload list var) +18513 68/push 0/imm32/next +18514 68/push 0/imm32/next +18515 53/push-ebx/formal-var +18516 68/push 0x11/imm32/alloc-id:fake +18517 68/push 0x11/imm32/alloc-id:fake:payload +18518 89/<- %ebx 4/r32/esp +18519 $test-emit-subx-stmt-primitive-register:initialize-primitive: +18520 # var primitives/ebx: (addr primitive) +18521 68/push 0/imm32/next +18522 68/push 0/imm32/next +18523 68/push 0/imm32/output-is-write-only +18524 68/push 0/imm32/no-disp32 +18525 68/push 0/imm32/no-imm32 +18526 68/push 0/imm32/no-r32 +18527 68/push 3/imm32/rm32-is-first-output +18528 68/push 0/imm32/subx-name +18529 68/push 0/imm32/subx-name +18530 53/push-ebx/outputs +18531 68/push 0x11/imm32/alloc-id:fake +18532 68/push 0/imm32/no-inouts +18533 68/push 0/imm32/no-inouts +18534 68/push 0/imm32/name +18535 68/push 0/imm32/name +18536 89/<- %ebx 4/r32/esp +18537 $test-emit-subx-stmt-primitive-register:initialize-primitive-name: +18538 # primitives->name = "increment" +18539 (copy-array Heap "increment" %ebx) # Primitive-name +18540 $test-emit-subx-stmt-primitive-register:initialize-primitive-subx-name: +18541 # primitives->subx-name = "ff 0/subop/increment" +18542 8d/copy-address *(ebx+0x18) 0/r32/eax # Primitive-subx-name +18543 (copy-array Heap "ff 0/subop/increment" %eax) +18544 # convert +18545 c7 0/subop/copy *Curr-block-depth 0/imm32 +18546 (emit-subx-stmt _test-output-buffered-file %esi %ebx Stderr 0) +18547 (flush _test-output-buffered-file) +18548 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- +18554 # check output +18555 (check-next-stream-line-equal _test-output-stream "ff 0/subop/increment %eax" "F - test-emit-subx-stmt-primitive-register") +18556 # . epilogue +18557 89/<- %esp 5/r32/ebp +18558 5d/pop-to-ebp +18559 c3/return +18560 +18561 test-emit-subx-stmt-select-primitive: +18562 # Select the right primitive between overloads. +18563 # foo <- increment +18564 # => +18565 # ff 0/subop/increment %eax # sub-optimal, but should suffice +18566 # +18567 # There's a variable on the var stack as follows: +18568 # name: 'foo' +18569 # type: int +18570 # register: 'eax' +18571 # +18572 # There's two primitives, as follows: +18573 # - name: 'increment' +18574 # out: int/reg +18575 # value: 'ff 0/subop/increment' +18576 # - name: 'increment' +18577 # inout: int/mem +18578 # value: 'ff 0/subop/increment' +18579 # +18580 # . prologue +18581 55/push-ebp +18582 89/<- %ebp 4/r32/esp +18583 # setup +18584 (clear-stream _test-output-stream) +18585 (clear-stream $_test-output-buffered-file->buffer) +18586 $test-emit-subx-stmt-select-primitive:initialize-type: +18587 # var type/ecx: (payload type-tree) = int +18588 68/push 0/imm32/right:null +18589 68/push 0/imm32/right:null +18590 68/push 0/imm32/left:unused +18591 68/push 1/imm32/value:int +18592 68/push 1/imm32/is-atom?:true +18593 68/push 0x11/imm32/alloc-id:fake:payload +18594 89/<- %ecx 4/r32/esp +18595 $test-emit-subx-stmt-select-primitive:initialize-var: +18596 # var var-foo/ecx: (payload var) +18597 68/push 0/imm32/register +18598 68/push 0/imm32/register +18599 68/push 0/imm32/no-stack-offset +18600 68/push 1/imm32/block-depth +18601 51/push-ecx +18602 68/push 0x11/imm32/alloc-id:fake +18603 68/push 0/imm32/name +18604 68/push 0/imm32/name +18605 68/push 0x11/imm32/alloc-id:fake:payload +18606 89/<- %ecx 4/r32/esp +18607 $test-emit-subx-stmt-select-primitive:initialize-var-name: +18608 # var-foo->name = "foo" +18609 8d/copy-address *(ecx+4) 0/r32/eax # Var-name + 4 +18610 (copy-array Heap "foo" %eax) +18611 $test-emit-subx-stmt-select-primitive:initialize-var-register: +18612 # var-foo->register = "eax" +18613 8d/copy-address *(ecx+0x1c) 0/r32/eax # Var-register + 4 +18614 (copy-array Heap "eax" %eax) +18615 $test-emit-subx-stmt-select-primitive:initialize-stmt-var: +18616 # var operand/ebx: (payload stmt-var) +18617 68/push 0/imm32/is-deref:false +18618 68/push 0/imm32/next +18619 68/push 0/imm32/next +18620 51/push-ecx/var-foo +18621 68/push 0x11/imm32/alloc-id:fake +18622 68/push 0x11/imm32/alloc-id:fake:payload +18623 89/<- %ebx 4/r32/esp +18624 $test-emit-subx-stmt-select-primitive:initialize-stmt: +18625 # var stmt/esi: (addr statement) +18626 53/push-ebx/outputs +18627 68/push 0x11/imm32/alloc-id:fake +18628 68/push 0/imm32/no-inouts +18629 68/push 0/imm32/no-inouts +18630 68/push 0/imm32/operation +18631 68/push 0/imm32/operation +18632 68/push 1/imm32 +18633 89/<- %esi 4/r32/esp +18634 $test-emit-subx-stmt-select-primitive:initialize-stmt-operation: +18635 # stmt->operation = "increment" +18636 8d/copy-address *(esi+4) 0/r32/eax # Stmt1-operation +18637 (copy-array Heap "increment" %eax) +18638 $test-emit-subx-stmt-select-primitive:initialize-formal-var: +18639 # var formal-var/ebx: (payload var) +18640 68/push 0/imm32/register +18641 68/push 0/imm32/register +18642 68/push 0/imm32/no-stack-offset +18643 68/push 1/imm32/block-depth +18644 ff 6/subop/push *(ecx+0x10) # Var-type + payload alloc id + handle alloc id +18645 68/push 0x11/imm32/alloc-id:fake +18646 68/push 0/imm32/name +18647 68/push 0/imm32/name +18648 68/push 0x11/imm32/alloc-id:fake:payload +18649 89/<- %ebx 4/r32/esp +18650 $test-emit-subx-stmt-select-primitive:initialize-formal-var-name: +18651 # formal-var->name = "dummy" +18652 8d/copy-address *(ebx+4) 0/r32/eax # Var-name + 4 +18653 (copy-array Heap "dummy" %eax) +18654 $test-emit-subx-stmt-select-primitive:initialize-formal-register: +18655 # formal-var->register = "*" +18656 8d/copy-address *(ebx+0x1c) 0/r32/eax # Var-register + 4 +18657 (copy-array Heap "*" %eax) # Any-register +18658 $test-emit-subx-stmt-select-primitive:initialize-var-list: +18659 # var formal-outputs/ebx: (payload list var) +18660 68/push 0/imm32/next +18661 68/push 0/imm32/next +18662 53/push-ebx/formal-var +18663 68/push 0x11/imm32/alloc-id:fake +18664 68/push 0x11/imm32/alloc-id:fake:payload +18665 89/<- %ebx 4/r32/esp +18666 $test-emit-subx-stmt-select-primitive:initialize-primitive2: +18667 # var primitive2/edi: (payload primitive) +18668 68/push 0/imm32/next +18669 68/push 0/imm32/next +18670 68/push 0/imm32/output-is-write-only +18671 68/push 0/imm32/no-disp32 +18672 68/push 0/imm32/no-imm32 +18673 68/push 0/imm32/no-r32 +18674 68/push 3/imm32/rm32-is-first-output +18675 68/push 0/imm32/subx-name +18676 68/push 0/imm32/subx-name +18677 53/push-ebx/outputs +18678 68/push 0x11/imm32/alloc-id:fake +18679 68/push 0/imm32/no-inouts +18680 68/push 0/imm32/no-inouts +18681 68/push 0/imm32/name +18682 68/push 0/imm32/name +18683 68/push 0x11/imm32/alloc-id:fake:payload +18684 89/<- %edi 4/r32/esp +18685 $test-emit-subx-stmt-select-primitive:initialize-primitive2-name: +18686 # primitives->name = "increment" +18687 8d/copy-address *(edi+4) 0/r32/eax # Primitive-name + 4 +18688 (copy-array Heap "increment" %eax) +18689 $test-emit-subx-stmt-select-primitive:initialize-primitive2-subx-name: +18690 # primitives->subx-name = "ff 0/subop/increment" +18691 8d/copy-address *(edi+0x1c) 0/r32/eax # Primitive-subx-name + 4 +18692 (copy-array Heap "ff 0/subop/increment" %eax) +18693 $test-emit-subx-stmt-select-primitive:initialize-primitive: +18694 # var primitives/ebx: (addr primitive) +18695 57/push-edi +18696 68/push 0x11/imm32/alloc-id:fake +18697 68/push 0/imm32/output-is-write-only +18698 68/push 0/imm32/no-disp32 +18699 68/push 0/imm32/no-imm32 +18700 68/push 0/imm32/no-r32 +18701 68/push 1/imm32/rm32-is-first-inout +18702 68/push 0/imm32/subx-name +18703 68/push 0/imm32/subx-name +18704 68/push 0/imm32/no-outputs +18705 68/push 0/imm32/no-outputs +18706 53/push-ebx/inouts # hack: reuse stmt-var from call stmt as (list var) in function declaration 18707 68/push 0x11/imm32/alloc-id:fake 18708 68/push 0/imm32/name 18709 68/push 0/imm32/name -18710 68/push 0x11/imm32/alloc-id:fake:payload -18711 89/<- %edx 4/r32/esp -18712 $test-add-reg-to-reg:initialize-var2-name: -18713 # var2->name = "var2" -18714 8d/copy-address *(edx+4) 0/r32/eax # Var-name + 4 -18715 (copy-array Heap "var2" %eax) -18716 $test-add-reg-to-reg:initialize-var2-register: -18717 # var2->register = "ecx" -18718 8d/copy-address *(edx+0x1c) 0/r32/eax # Var-register + 4 -18719 (copy-array Heap "ecx" %eax) -18720 $test-add-reg-to-reg:initialize-inouts: -18721 # var inouts/esi: (payload stmt-var) = [var2] -18722 68/push 0/imm32/is-deref:false -18723 68/push 0/imm32/next -18724 68/push 0/imm32/next -18725 52/push-edx/var2 -18726 68/push 0x11/imm32/alloc-id:fake -18727 68/push 0x11/imm32/alloc-id:fake:payload -18728 89/<- %esi 4/r32/esp -18729 $test-add-reg-to-reg:initialize-outputs: -18730 # var outputs/edi: (payload stmt-var) = [var1] -18731 68/push 0/imm32/is-deref:false -18732 68/push 0/imm32/next -18733 68/push 0/imm32/next -18734 51/push-ecx/var1 -18735 68/push 0x11/imm32/alloc-id:fake -18736 68/push 0x11/imm32/alloc-id:fake:payload -18737 89/<- %edi 4/r32/esp -18738 $test-add-reg-to-reg:initialize-stmt: -18739 # var stmt/esi: (addr statement) -18740 68/push 0/imm32/next -18741 68/push 0/imm32/next -18742 57/push-edi/outputs -18743 68/push 0x11/imm32/alloc-id:fake -18744 56/push-esi/inouts -18745 68/push 0x11/imm32/alloc-id:fake -18746 68/push 0/imm32/operation -18747 68/push 0/imm32/operation -18748 68/push 1/imm32/tag:stmt1 -18749 89/<- %esi 4/r32/esp -18750 $test-add-reg-to-reg:initialize-stmt-operation: -18751 # stmt->operation = "add" -18752 8d/copy-address *(esi+4) 0/r32/eax # Stmt1-operation -18753 (copy-array Heap "add" %eax) -18754 # convert -18755 c7 0/subop/copy *Curr-block-depth 0/imm32 -18756 (emit-subx-stmt _test-output-buffered-file %esi Primitives Stderr 0) -18757 (flush _test-output-buffered-file) -18758 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- -18764 # check output -18765 (check-next-stream-line-equal _test-output-stream "01/add-to %eax 0x00000001/r32" "F - test-add-reg-to-reg") -18766 # . epilogue -18767 89/<- %esp 5/r32/ebp -18768 5d/pop-to-ebp -18769 c3/return -18770 -18771 test-add-reg-to-mem: -18772 # add-to var1 var2/reg -18773 # => -18774 # 01/add-to *(ebp+__) var2 -18775 # -18776 # . prologue -18777 55/push-ebp -18778 89/<- %ebp 4/r32/esp -18779 # setup -18780 (clear-stream _test-output-stream) -18781 (clear-stream $_test-output-buffered-file->buffer) -18782 $test-add-reg-to-mem:initialize-type: -18783 # var type/ecx: (payload tree type-id) = int -18784 68/push 0/imm32/right:null -18785 68/push 0/imm32/right:null -18786 68/push 0/imm32/left:unused -18787 68/push 1/imm32/value:int -18788 68/push 1/imm32/is-atom?:true -18789 68/push 0x11/imm32/alloc-id:fake:payload -18790 89/<- %ecx 4/r32/esp -18791 $test-add-reg-to-mem:initialize-var1: -18792 # var var1/ecx: (payload var) -18793 68/push 0/imm32/register -18794 68/push 0/imm32/register -18795 68/push 8/imm32/stack-offset -18796 68/push 1/imm32/block-depth -18797 51/push-ecx -18798 68/push 0x11/imm32/alloc-id:fake -18799 68/push 0/imm32/name -18800 68/push 0/imm32/name -18801 68/push 0x11/imm32/alloc-id:fake:payload -18802 89/<- %ecx 4/r32/esp -18803 $test-add-reg-to-mem:initialize-var1-name: -18804 # var1->name = "var1" -18805 8d/copy-address *(ecx+4) 0/r32/eax # Var-name + 4 -18806 (copy-array Heap "var1" %eax) -18807 $test-add-reg-to-mem:initialize-var2: -18808 # var var2/edx: (payload var) -18809 68/push 0/imm32/register -18810 68/push 0/imm32/register -18811 68/push 0/imm32/no-stack-offset -18812 68/push 1/imm32/block-depth -18813 ff 6/subop/push *(ecx+0x10) -18814 68/push 0x11/imm32/alloc-id:fake -18815 68/push 0/imm32/name -18816 68/push 0/imm32/name -18817 68/push 0x11/imm32/alloc-id:fake:payload -18818 89/<- %edx 4/r32/esp -18819 $test-add-reg-to-mem:initialize-var2-name: -18820 # var2->name = "var2" -18821 8d/copy-address *(edx+4) 0/r32/eax # Var-name + 4 -18822 (copy-array Heap "var2" %eax) -18823 $test-add-reg-to-mem:initialize-var2-register: -18824 # var2->register = "ecx" -18825 8d/copy-address *(edx+0x1c) 0/r32/eax # Var-register + 4 -18826 (copy-array Heap "ecx" %eax) -18827 $test-add-reg-to-mem:initialize-inouts: -18828 # var inouts/esi: (payload stmt-var) = [var2] -18829 68/push 0/imm32/is-deref:false -18830 68/push 0/imm32/next -18831 68/push 0/imm32/next -18832 52/push-edx/var2 -18833 68/push 0x11/imm32/alloc-id:fake -18834 68/push 0x11/imm32/alloc-id:fake:payload -18835 89/<- %esi 4/r32/esp -18836 # inouts = [var1, var2] -18837 68/push 0/imm32/is-deref:false -18838 56/push-esi/next -18839 68/push 0x11/imm32/alloc-id:fake -18840 51/push-ecx/var1 -18841 68/push 0x11/imm32/alloc-id:fake -18842 68/push 0x11/imm32/alloc-id:fake:payload -18843 89/<- %esi 4/r32/esp -18844 $test-add-reg-to-mem:initialize-stmt: -18845 # var stmt/esi: (addr statement) -18846 68/push 0/imm32/next -18847 68/push 0/imm32/next -18848 68/push 0/imm32/outputs -18849 68/push 0/imm32/outputs -18850 56/push-esi/inouts -18851 68/push 0x11/imm32/alloc-id:fake -18852 68/push 0/imm32/operation -18853 68/push 0/imm32/operation -18854 68/push 1/imm32/tag:stmt1 -18855 89/<- %esi 4/r32/esp -18856 $test-add-reg-to-mem:initialize-stmt-operation: -18857 # stmt->operation = "add-to" -18858 8d/copy-address *(esi+4) 0/r32/eax # Stmt1-operation -18859 (copy-array Heap "add-to" %eax) -18860 # convert -18861 c7 0/subop/copy *Curr-block-depth 0/imm32 -18862 (emit-subx-stmt _test-output-buffered-file %esi Primitives Stderr 0) -18863 (flush _test-output-buffered-file) -18864 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- -18870 # check output -18871 (check-next-stream-line-equal _test-output-stream "01/add-to *(ebp+0x00000008) 0x00000001/r32" "F - test-add-reg-to-mem") -18872 # . epilogue -18873 89/<- %esp 5/r32/ebp -18874 5d/pop-to-ebp -18875 c3/return -18876 -18877 test-add-mem-to-reg: -18878 # var1/reg <- add var2 -18879 # => -18880 # 03/add *(ebp+__) var1 -18881 # -18882 # . prologue -18883 55/push-ebp -18884 89/<- %ebp 4/r32/esp -18885 # setup -18886 (clear-stream _test-output-stream) -18887 (clear-stream $_test-output-buffered-file->buffer) -18888 $test-add-mem-to-reg:initialize-type: -18889 # var type/ecx: (payload tree type-id) = int -18890 68/push 0/imm32/right:null -18891 68/push 0/imm32/right:null -18892 68/push 0/imm32/left:unused -18893 68/push 1/imm32/value:int -18894 68/push 1/imm32/is-atom?:true -18895 68/push 0x11/imm32/alloc-id:fake:payload -18896 89/<- %ecx 4/r32/esp -18897 $test-add-mem-to-reg:initialize-var: -18898 # var var1/ecx: (payload var) -18899 68/push 0/imm32/register -18900 68/push 0/imm32/register -18901 68/push 0/imm32/no-stack-offset -18902 68/push 1/imm32/block-depth -18903 51/push-ecx -18904 68/push 0x11/imm32/alloc-id:fake -18905 68/push 0/imm32/name -18906 68/push 0/imm32/name -18907 68/push 0x11/imm32/alloc-id:fake:payload -18908 89/<- %ecx 4/r32/esp -18909 $test-add-mem-to-reg:initialize-var-name: -18910 # var1->name = "foo" -18911 8d/copy-address *(ecx+4) 0/r32/eax # Var-name + 4 -18912 (copy-array Heap "var1" %eax) -18913 $test-add-mem-to-reg:initialize-var-register: -18914 # var1->register = "eax" -18915 8d/copy-address *(ecx+0x1c) 0/r32/eax # Var-register + 4 -18916 (copy-array Heap "eax" %eax) -18917 $test-add-mem-to-reg:initialize-var2: -18918 # var var2/edx: (payload var) -18919 68/push 0/imm32/register -18920 68/push 0/imm32/register -18921 68/push 8/imm32/stack-offset -18922 68/push 1/imm32/block-depth -18923 ff 6/subop/push *(ecx+0x10) -18924 68/push 0x11/imm32/alloc-id:fake -18925 68/push 0/imm32/name -18926 68/push 0/imm32/name -18927 68/push 0x11/imm32/alloc-id:fake:payload -18928 89/<- %edx 4/r32/esp -18929 $test-add-mem-to-reg:initialize-var2-name: -18930 # var2->name = "var2" -18931 8d/copy-address *(edx+4) 0/r32/eax # Var-name + 4 -18932 (copy-array Heap "var2" %eax) -18933 $test-add-mem-to-reg:initialize-inouts: -18934 # var inouts/esi: (payload stmt-var) = [var2] -18935 68/push 0/imm32/is-deref:false -18936 68/push 0/imm32/next -18937 68/push 0/imm32/next -18938 52/push-edx/var2 -18939 68/push 0x11/imm32/alloc-id:fake -18940 68/push 0x11/imm32/alloc-id:fake:payload -18941 89/<- %esi 4/r32/esp -18942 $test-add-mem-to-reg:initialize-outputs: -18943 # var outputs/edi: (payload stmt-var) = [var1] -18944 68/push 0/imm32/is-deref:false -18945 68/push 0/imm32/next -18946 68/push 0/imm32/next -18947 51/push-ecx/var1 -18948 68/push 0x11/imm32/alloc-id:fake -18949 68/push 0x11/imm32/alloc-id:fake:payload -18950 89/<- %edi 4/r32/esp -18951 $test-add-mem-to-reg:initialize-stmt: -18952 # var stmt/esi: (addr statement) -18953 68/push 0/imm32/next -18954 68/push 0/imm32/next -18955 57/push-edi/outputs -18956 68/push 0x11/imm32/alloc-id:fake -18957 56/push-esi/inouts -18958 68/push 0x11/imm32/alloc-id:fake -18959 68/push 0/imm32/operation -18960 68/push 0/imm32/operation -18961 68/push 1/imm32/tag:stmt1 -18962 89/<- %esi 4/r32/esp -18963 $test-add-mem-to-reg:initialize-stmt-operation: -18964 # stmt->operation = "add" -18965 8d/copy-address *(esi+4) 0/r32/eax # Stmt1-operation -18966 (copy-array Heap "add" %eax) -18967 # convert -18968 c7 0/subop/copy *Curr-block-depth 0/imm32 -18969 (emit-subx-stmt _test-output-buffered-file %esi Primitives Stderr 0) -18970 (flush _test-output-buffered-file) -18971 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- -18977 # check output -18978 (check-next-stream-line-equal _test-output-stream "03/add *(ebp+0x00000008) 0x00000000/r32" "F - test-add-mem-to-reg") -18979 # . epilogue -18980 89/<- %esp 5/r32/ebp -18981 5d/pop-to-ebp -18982 c3/return -18983 -18984 test-add-literal-to-eax: -18985 # var1/eax <- add 0x34 -18986 # => -18987 # 05/add-to-eax 0x34/imm32 -18988 # -18989 # . prologue -18990 55/push-ebp -18991 89/<- %ebp 4/r32/esp -18992 # setup -18993 (clear-stream _test-output-stream) -18994 (clear-stream $_test-output-buffered-file->buffer) -18995 $test-add-literal-to-eax:initialize-var-type: -18996 # var type/ecx: (payload tree type-id) = int -18997 68/push 0/imm32/right:null -18998 68/push 0/imm32/right:null -18999 68/push 0/imm32/left:unused -19000 68/push 1/imm32/value:int -19001 68/push 1/imm32/is-atom?:true -19002 68/push 0x11/imm32/alloc-id:fake:payload -19003 89/<- %ecx 4/r32/esp -19004 $test-add-literal-to-eax:initialize-var: -19005 # var v/ecx: (payload var) -19006 68/push 0/imm32/register -19007 68/push 0/imm32/register -19008 68/push 0/imm32/no-stack-offset -19009 68/push 1/imm32/block-depth -19010 51/push-ecx -19011 68/push 0x11/imm32/alloc-id:fake -19012 68/push 0/imm32/name -19013 68/push 0/imm32/name -19014 68/push 0x11/imm32/alloc-id:fake:payload -19015 89/<- %ecx 4/r32/esp -19016 $test-add-literal-to-eax:initialize-var-name: -19017 # v->name = "v" -19018 8d/copy-address *(ecx+4) 0/r32/eax # Var-name + 4 -19019 (copy-array Heap "v" %eax) -19020 $test-add-literal-to-eax:initialize-var-register: -19021 # v->register = "eax" -19022 8d/copy-address *(ecx+0x1c) 0/r32/eax # Var-register + 4 -19023 (copy-array Heap "eax" %eax) -19024 $test-add-literal-to-eax:initialize-literal-type: -19025 # var type/edx: (payload tree type-id) = literal -19026 68/push 0/imm32/right:null -19027 68/push 0/imm32/right:null -19028 68/push 0/imm32/left:unused -19029 68/push 0/imm32/value:literal -19030 68/push 1/imm32/is-atom?:true -19031 68/push 0x11/imm32/alloc-id:fake:payload -19032 89/<- %edx 4/r32/esp -19033 $test-add-literal-to-eax:initialize-literal: -19034 # var l/edx: (payload var) -19035 68/push 0/imm32/register -19036 68/push 0/imm32/register -19037 68/push 0/imm32/no-stack-offset -19038 68/push 1/imm32/block-depth -19039 52/push-edx -19040 68/push 0x11/imm32/alloc-id:fake -19041 68/push 0/imm32/name -19042 68/push 0/imm32/name -19043 68/push 0x11/imm32/alloc-id:fake:payload -19044 89/<- %edx 4/r32/esp -19045 $test-add-literal-to-eax:initialize-literal-value: -19046 # l->name = "0x34" -19047 8d/copy-address *(edx+4) 0/r32/eax # Var-name + 4 -19048 (copy-array Heap "0x34" %eax) -19049 $test-add-literal-to-eax:initialize-inouts: -19050 # var inouts/esi: (payload stmt-var) = [l] -19051 68/push 0/imm32/is-deref:false -19052 68/push 0/imm32/next -19053 68/push 0/imm32/next -19054 52/push-edx/l -19055 68/push 0x11/imm32/alloc-id:fake -19056 68/push 0x11/imm32/alloc-id:fake:payload -19057 89/<- %esi 4/r32/esp -19058 $test-add-literal-to-eax:initialize-outputs: -19059 # var outputs/edi: (payload stmt-var) = [v] -19060 68/push 0/imm32/is-deref:false +18710 89/<- %ebx 4/r32/esp +18711 $test-emit-subx-stmt-select-primitive:initialize-primitive-name: +18712 # primitives->name = "increment" +18713 (copy-array Heap "increment" %ebx) # Primitive-name +18714 $test-emit-subx-stmt-select-primitive:initialize-primitive-subx-name: +18715 # primitives->subx-name = "ff 0/subop/increment" +18716 8d/copy-address *(ebx+0x18) 0/r32/eax # Primitive-subx-name +18717 (copy-array Heap "ff 0/subop/increment" %eax) +18718 # convert +18719 c7 0/subop/copy *Curr-block-depth 0/imm32 +18720 (emit-subx-stmt _test-output-buffered-file %esi %ebx Stderr 0) +18721 (flush _test-output-buffered-file) +18722 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- +18728 # check output +18729 (check-next-stream-line-equal _test-output-stream "ff 0/subop/increment %eax" "F - test-emit-subx-stmt-select-primitive") +18730 # . epilogue +18731 89/<- %esp 5/r32/ebp +18732 5d/pop-to-ebp +18733 c3/return +18734 +18735 test-emit-subx-stmt-select-primitive-2: +18736 # Select the right primitive between overloads. +18737 # increment foo +18738 # => +18739 # ff 0/subop/increment %eax # sub-optimal, but should suffice +18740 # +18741 # There's a variable on the var stack as follows: +18742 # name: 'foo' +18743 # type: int +18744 # register: 'eax' +18745 # +18746 # There's two primitives, as follows: +18747 # - name: 'increment' +18748 # out: int/reg +18749 # value: 'ff 0/subop/increment' +18750 # - name: 'increment' +18751 # inout: int/mem +18752 # value: 'ff 0/subop/increment' +18753 # +18754 # . prologue +18755 55/push-ebp +18756 89/<- %ebp 4/r32/esp +18757 # setup +18758 (clear-stream _test-output-stream) +18759 (clear-stream $_test-output-buffered-file->buffer) +18760 $test-emit-subx-stmt-select-primitive-2:initialize-type: +18761 # var type/ecx: (payload type-tree) = int +18762 68/push 0/imm32/right:null +18763 68/push 0/imm32/right:null +18764 68/push 0/imm32/left:unused +18765 68/push 1/imm32/value:int +18766 68/push 1/imm32/is-atom?:true +18767 68/push 0x11/imm32/alloc-id:fake:payload +18768 89/<- %ecx 4/r32/esp +18769 $test-emit-subx-stmt-select-primitive-2:initialize-var: +18770 # var var-foo/ecx: (payload var) +18771 68/push 0/imm32/register +18772 68/push 0/imm32/register +18773 68/push 0/imm32/no-stack-offset +18774 68/push 1/imm32/block-depth +18775 51/push-ecx +18776 68/push 0x11/imm32/alloc-id:fake +18777 68/push 0/imm32/name +18778 68/push 0/imm32/name +18779 68/push 0x11/imm32/alloc-id:fake:payload +18780 89/<- %ecx 4/r32/esp +18781 $test-emit-subx-stmt-select-primitive-2:initialize-var-name: +18782 # var-foo->name = "foo" +18783 8d/copy-address *(ecx+4) 0/r32/eax # Var-name + 4 +18784 (copy-array Heap "foo" %eax) +18785 $test-emit-subx-stmt-select-primitive-2:initialize-var-register: +18786 # var-foo->register = "eax" +18787 8d/copy-address *(ecx+0x1c) 0/r32/eax # Var-register + 4 +18788 (copy-array Heap "eax" %eax) +18789 $test-emit-subx-stmt-select-primitive-2:initialize-stmt-var: +18790 # var operand/ebx: (payload stmt-var) +18791 68/push 0/imm32/is-deref:false +18792 68/push 0/imm32/next +18793 68/push 0/imm32/next +18794 51/push-ecx/var-foo +18795 68/push 0x11/imm32/alloc-id:fake +18796 68/push 0x11/imm32/alloc-id:fake:payload +18797 89/<- %ebx 4/r32/esp +18798 $test-emit-subx-stmt-select-primitive-2:initialize-stmt: +18799 # var stmt/esi: (addr statement) +18800 68/push 0/imm32/no-outputs +18801 68/push 0/imm32/no-outputs +18802 53/push-ebx/inouts +18803 68/push 0x11/imm32/alloc-id:fake +18804 68/push 0/imm32/operation +18805 68/push 0/imm32/operation +18806 68/push 1/imm32 +18807 89/<- %esi 4/r32/esp +18808 $test-emit-subx-stmt-select-primitive-2:initialize-stmt-operation: +18809 # stmt->operation = "increment" +18810 8d/copy-address *(esi+4) 0/r32/eax # Stmt1-operation +18811 (copy-array Heap "increment" %eax) +18812 $test-emit-subx-stmt-select-primitive-2:initialize-formal-var: +18813 # var formal-var/ebx: (payload var) +18814 68/push 0/imm32/register +18815 68/push 0/imm32/register +18816 68/push 0/imm32/no-stack-offset +18817 68/push 1/imm32/block-depth +18818 ff 6/subop/push *(ecx+0x10) # Var-type + payload alloc id + handle alloc id +18819 68/push 0x11/imm32/alloc-id:fake +18820 68/push 0/imm32/name +18821 68/push 0/imm32/name +18822 68/push 0x11/imm32/alloc-id:fake:payload +18823 89/<- %ebx 4/r32/esp +18824 $test-emit-subx-stmt-select-primitive-2:initialize-formal-var-name: +18825 # formal-var->name = "dummy" +18826 8d/copy-address *(ebx+4) 0/r32/eax # Var-name + 4 +18827 (copy-array Heap "dummy" %eax) +18828 $test-emit-subx-stmt-select-primitive-2:initialize-formal-register: +18829 # formal-var->register = "*" +18830 8d/copy-address *(ebx+0x1c) 0/r32/eax # Var-register + 4 +18831 (copy-array Heap "*" %eax) # Any-register +18832 $test-emit-subx-stmt-select-primitive-2:initialize-var-list: +18833 # var formal-outputs/ebx: (payload list stmt-var) +18834 68/push 0/imm32/next +18835 68/push 0/imm32/next +18836 53/push-ebx/formal-var +18837 68/push 0x11/imm32/alloc-id:fake +18838 68/push 0x11/imm32/alloc-id:fake:payload +18839 89/<- %ebx 4/r32/esp +18840 $test-emit-subx-stmt-select-primitive-2:initialize-primitive2: +18841 # var primitive2/edi: (payload primitive) +18842 68/push 0/imm32/next +18843 68/push 0/imm32/next +18844 68/push 0/imm32/output-is-write-only +18845 68/push 0/imm32/no-disp32 +18846 68/push 0/imm32/no-imm32 +18847 68/push 0/imm32/no-r32 +18848 68/push 3/imm32/rm32-is-first-output +18849 68/push 0/imm32/subx-name +18850 68/push 0/imm32/subx-name +18851 53/push-ebx/outputs +18852 68/push 0x11/imm32/alloc-id:fake +18853 68/push 0/imm32/no-inouts +18854 68/push 0/imm32/no-inouts +18855 68/push 0/imm32/name +18856 68/push 0/imm32/name +18857 68/push 0x11/imm32/alloc-id:fake:payload +18858 89/<- %edi 4/r32/esp +18859 $test-emit-subx-stmt-select-primitive-2:initialize-primitive2-name: +18860 # primitives->name = "increment" +18861 8d/copy-address *(edi+4) 0/r32/eax # Primitive-name + 4 +18862 (copy-array Heap "increment" %eax) +18863 $test-emit-subx-stmt-select-primitive-2:initialize-primitive2-subx-name: +18864 # primitives->subx-name = "ff 0/subop/increment" +18865 8d/copy-address *(edi+0x1c) 0/r32/eax # Primitive-subx-name + 4 +18866 (copy-array Heap "ff 0/subop/increment" %eax) +18867 $test-emit-subx-stmt-select-primitive-2:initialize-primitive: +18868 # var primitives/ebx: (addr primitive) +18869 57/push-edi +18870 68/push 0x11/imm32/alloc-id:fake +18871 68/push 0/imm32/output-is-write-only +18872 68/push 0/imm32/no-disp32 +18873 68/push 0/imm32/no-imm32 +18874 68/push 0/imm32/no-r32 +18875 68/push 1/imm32/rm32-is-first-inout +18876 68/push 0/imm32/subx-name +18877 68/push 0/imm32/subx-name +18878 68/push 0/imm32/no-outputs +18879 68/push 0/imm32/no-outputs +18880 53/push-ebx/inouts # hack: reuse stmt-var from call stmt as (list var) in function declaration +18881 68/push 0x11/imm32/alloc-id:fake +18882 68/push 0/imm32/name +18883 68/push 0/imm32/name +18884 89/<- %ebx 4/r32/esp +18885 $test-emit-subx-stmt-select-primitive-2:initialize-primitive-name: +18886 # primitives->name = "increment" +18887 (copy-array Heap "increment" %ebx) # Primitive-name +18888 $test-emit-subx-stmt-select-primitive-2:initialize-primitive-subx-name: +18889 # primitives->subx-name = "ff 0/subop/increment" +18890 8d/copy-address *(ebx+0x18) 0/r32/eax # Primitive-subx-name +18891 (copy-array Heap "ff 0/subop/increment" %eax) +18892 # convert +18893 c7 0/subop/copy *Curr-block-depth 0/imm32 +18894 (emit-subx-stmt _test-output-buffered-file %esi %ebx Stderr 0) +18895 (flush _test-output-buffered-file) +18896 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- +18902 # check output +18903 (check-next-stream-line-equal _test-output-stream "ff 0/subop/increment %eax" "F - test-emit-subx-stmt-select-primitive-2") +18904 # . epilogue +18905 89/<- %esp 5/r32/ebp +18906 5d/pop-to-ebp +18907 c3/return +18908 +18909 test-increment-register: +18910 # Select the right register between overloads. +18911 # foo <- increment +18912 # => +18913 # 50/increment-eax +18914 # +18915 # There's a variable on the var stack as follows: +18916 # name: 'foo' +18917 # type: int +18918 # register: 'eax' +18919 # +18920 # Primitives are the global definitions. +18921 # +18922 # . prologue +18923 55/push-ebp +18924 89/<- %ebp 4/r32/esp +18925 # setup +18926 (clear-stream _test-output-stream) +18927 (clear-stream $_test-output-buffered-file->buffer) +18928 $test-increment-register:initialize-type: +18929 # var type/ecx: (payload type-tree) = int +18930 68/push 0/imm32/right:null +18931 68/push 0/imm32/right:null +18932 68/push 0/imm32/left:unused +18933 68/push 1/imm32/value:int +18934 68/push 1/imm32/is-atom?:true +18935 68/push 0x11/imm32/alloc-id:fake:payload +18936 89/<- %ecx 4/r32/esp +18937 $test-increment-register:initialize-var: +18938 # var var-foo/ecx: (payload var) +18939 68/push 0/imm32/register +18940 68/push 0/imm32/register +18941 68/push 0/imm32/no-stack-offset +18942 68/push 1/imm32/block-depth +18943 51/push-ecx +18944 68/push 0x11/imm32/alloc-id:fake +18945 68/push 0/imm32/name +18946 68/push 0/imm32/name +18947 68/push 0x11/imm32/alloc-id:fake:payload +18948 89/<- %ecx 4/r32/esp +18949 $test-increment-register:initialize-var-name: +18950 # var-foo->name = "foo" +18951 8d/copy-address *(ecx+4) 0/r32/eax # Var-name + 4 +18952 (copy-array Heap "foo" %eax) +18953 $test-increment-register:initialize-var-register: +18954 # var-foo->register = "eax" +18955 8d/copy-address *(ecx+0x1c) 0/r32/eax # Var-register + 4 +18956 (copy-array Heap "eax" %eax) +18957 $test-increment-register:initialize-stmt-var: +18958 # var operand/ebx: (payload stmt-var) +18959 68/push 0/imm32/is-deref:false +18960 68/push 0/imm32/next +18961 68/push 0/imm32/next +18962 51/push-ecx/var-foo +18963 68/push 0x11/imm32/alloc-id:fake +18964 68/push 0x11/imm32/alloc-id:fake:payload +18965 89/<- %ebx 4/r32/esp +18966 $test-increment-register:initialize-stmt: +18967 # var stmt/esi: (addr statement) +18968 53/push-ebx/outputs +18969 68/push 0x11/imm32/alloc-id:fake +18970 68/push 0/imm32/no-inouts +18971 68/push 0/imm32/no-inouts +18972 68/push 0/imm32/operation +18973 68/push 0/imm32/operation +18974 68/push 1/imm32 +18975 89/<- %esi 4/r32/esp +18976 $test-increment-register:initialize-stmt-operation: +18977 # stmt->operation = "increment" +18978 8d/copy-address *(esi+4) 0/r32/eax # Stmt1-operation +18979 (copy-array Heap "increment" %eax) +18980 # convert +18981 c7 0/subop/copy *Curr-block-depth 0/imm32 +18982 (emit-subx-stmt _test-output-buffered-file %esi Primitives Stderr 0) +18983 (flush _test-output-buffered-file) +18984 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- +18990 # check output +18991 (check-next-stream-line-equal _test-output-stream "40/increment-eax" "F - test-increment-register") +18992 # . epilogue +18993 89/<- %esp 5/r32/ebp +18994 5d/pop-to-ebp +18995 c3/return +18996 +18997 test-add-reg-to-reg: +18998 # var1/reg <- add var2/reg +18999 # => +19000 # 01/add-to %var1 var2 +19001 # +19002 # . prologue +19003 55/push-ebp +19004 89/<- %ebp 4/r32/esp +19005 # setup +19006 (clear-stream _test-output-stream) +19007 (clear-stream $_test-output-buffered-file->buffer) +19008 $test-add-reg-to-reg:initialize-type: +19009 # var type/ecx: (payload type-tree) = int +19010 68/push 0/imm32/right:null +19011 68/push 0/imm32/right:null +19012 68/push 0/imm32/left:unused +19013 68/push 1/imm32/value:int +19014 68/push 1/imm32/is-atom?:true +19015 68/push 0x11/imm32/alloc-id:fake:payload +19016 89/<- %ecx 4/r32/esp +19017 $test-add-reg-to-reg:initialize-var1: +19018 # var var1/ecx: (payload var) +19019 68/push 0/imm32/register +19020 68/push 0/imm32/register +19021 68/push 0/imm32/no-stack-offset +19022 68/push 1/imm32/block-depth +19023 51/push-ecx +19024 68/push 0x11/imm32/alloc-id:fake +19025 68/push 0/imm32/name +19026 68/push 0/imm32/name +19027 68/push 0x11/imm32/alloc-id:fake:payload +19028 89/<- %ecx 4/r32/esp +19029 $test-add-reg-to-reg:initialize-var1-name: +19030 # var1->name = "var1" +19031 8d/copy-address *(ecx+4) 0/r32/eax # Var-name + 4 +19032 (copy-array Heap "var1" %eax) +19033 $test-add-reg-to-reg:initialize-var1-register: +19034 # var1->register = "eax" +19035 8d/copy-address *(ecx+0x1c) 0/r32/eax # Var-register + 4 +19036 (copy-array Heap "eax" %eax) +19037 $test-add-reg-to-reg:initialize-var2: +19038 # var var2/edx: (payload var) +19039 68/push 0/imm32/register +19040 68/push 0/imm32/register +19041 68/push 0/imm32/no-stack-offset +19042 68/push 1/imm32/block-depth +19043 ff 6/subop/push *(ecx+0x10) +19044 68/push 0x11/imm32/alloc-id:fake +19045 68/push 0/imm32/name +19046 68/push 0/imm32/name +19047 68/push 0x11/imm32/alloc-id:fake:payload +19048 89/<- %edx 4/r32/esp +19049 $test-add-reg-to-reg:initialize-var2-name: +19050 # var2->name = "var2" +19051 8d/copy-address *(edx+4) 0/r32/eax # Var-name + 4 +19052 (copy-array Heap "var2" %eax) +19053 $test-add-reg-to-reg:initialize-var2-register: +19054 # var2->register = "ecx" +19055 8d/copy-address *(edx+0x1c) 0/r32/eax # Var-register + 4 +19056 (copy-array Heap "ecx" %eax) +19057 $test-add-reg-to-reg:initialize-inouts: +19058 # var inouts/esi: (payload stmt-var) = [var2] +19059 68/push 0/imm32/is-deref:false +19060 68/push 0/imm32/next 19061 68/push 0/imm32/next -19062 68/push 0/imm32/next -19063 51/push-ecx/v -19064 68/push 0x11/imm32/alloc-id:fake -19065 68/push 0x11/imm32/alloc-id:fake:payload -19066 89/<- %edi 4/r32/esp -19067 $test-add-literal-to-eax:initialize-stmt: -19068 # var stmt/esi: (addr statement) +19062 52/push-edx/var2 +19063 68/push 0x11/imm32/alloc-id:fake +19064 68/push 0x11/imm32/alloc-id:fake:payload +19065 89/<- %esi 4/r32/esp +19066 $test-add-reg-to-reg:initialize-outputs: +19067 # var outputs/edi: (payload stmt-var) = [var1] +19068 68/push 0/imm32/is-deref:false 19069 68/push 0/imm32/next 19070 68/push 0/imm32/next -19071 57/push-edi/outputs +19071 51/push-ecx/var1 19072 68/push 0x11/imm32/alloc-id:fake -19073 56/push-esi/inouts -19074 68/push 0x11/imm32/alloc-id:fake -19075 68/push 0/imm32/operation -19076 68/push 0/imm32/operation -19077 68/push 1/imm32/tag:stmt1 -19078 89/<- %esi 4/r32/esp -19079 $test-add-literal-to-eax:initialize-stmt-operation: -19080 # stmt->operation = "add" -19081 8d/copy-address *(esi+4) 0/r32/eax # Stmt1-operation -19082 (copy-array Heap "add" %eax) -19083 # convert -19084 c7 0/subop/copy *Curr-block-depth 0/imm32 -19085 (emit-subx-stmt _test-output-buffered-file %esi Primitives Stderr 0) -19086 (flush _test-output-buffered-file) -19087 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- -19093 # check output -19094 (check-next-stream-line-equal _test-output-stream "05/add-to-eax 0x34/imm32" "F - test-add-literal-to-eax") -19095 # . epilogue -19096 89/<- %esp 5/r32/ebp -19097 5d/pop-to-ebp -19098 c3/return -19099 -19100 test-add-literal-to-reg: -19101 # var1/ecx <- add 0x34 -19102 # => -19103 # 81 0/subop/add %ecx 0x34/imm32 -19104 # -19105 # . prologue -19106 55/push-ebp -19107 89/<- %ebp 4/r32/esp -19108 # setup -19109 (clear-stream _test-output-stream) -19110 (clear-stream $_test-output-buffered-file->buffer) -19111 $test-add-literal-to-reg:initialize-var-type: -19112 # var type/ecx: (payload tree type-id) = int -19113 68/push 0/imm32/right:null -19114 68/push 0/imm32/right:null -19115 68/push 0/imm32/left:unused -19116 68/push 1/imm32/value:int -19117 68/push 1/imm32/is-atom?:true -19118 68/push 0x11/imm32/alloc-id:fake:payload -19119 89/<- %ecx 4/r32/esp -19120 $test-add-literal-to-reg:initialize-var: -19121 # var v/ecx: (payload var) -19122 68/push 0/imm32/register -19123 68/push 0/imm32/register -19124 68/push 0/imm32/no-stack-offset -19125 68/push 1/imm32/block-depth -19126 51/push-ecx -19127 68/push 0x11/imm32/alloc-id:fake -19128 68/push 0/imm32/name -19129 68/push 0/imm32/name -19130 68/push 0x11/imm32/alloc-id:fake:payload -19131 89/<- %ecx 4/r32/esp -19132 $test-add-literal-to-reg:initialize-var-name: -19133 # v->name = "v" -19134 8d/copy-address *(ecx+4) 0/r32/eax # Var-name + 4 -19135 (copy-array Heap "v" %eax) -19136 $test-add-literal-to-reg:initialize-var-register: -19137 # v->register = "ecx" -19138 8d/copy-address *(ecx+0x1c) 0/r32/eax # Var-register + 4 -19139 (copy-array Heap "ecx" %eax) -19140 $test-add-literal-to-reg:initialize-literal-type: -19141 # var type/edx: (payload tree type-id) = literal -19142 68/push 0/imm32/right:null -19143 68/push 0/imm32/right:null -19144 68/push 0/imm32/left:unused -19145 68/push 0/imm32/value:literal -19146 68/push 1/imm32/is-atom?:true -19147 68/push 0x11/imm32/alloc-id:fake:payload -19148 89/<- %edx 4/r32/esp -19149 $test-add-literal-to-reg:initialize-literal: -19150 # var l/edx: (payload var) -19151 68/push 0/imm32/register -19152 68/push 0/imm32/register -19153 68/push 0/imm32/no-stack-offset -19154 68/push 1/imm32/block-depth -19155 52/push-edx -19156 68/push 0x11/imm32/alloc-id:fake -19157 68/push 0/imm32/name -19158 68/push 0/imm32/name -19159 68/push 0x11/imm32/alloc-id:fake:payload -19160 89/<- %edx 4/r32/esp -19161 $test-add-literal-to-reg:initialize-literal-value: -19162 # l->name = "0x34" -19163 8d/copy-address *(edx+4) 0/r32/eax # Var-name + 4 -19164 (copy-array Heap "0x34" %eax) -19165 $test-add-literal-to-reg:initialize-inouts: -19166 # var inouts/esi: (payload stmt-var) = [l] -19167 68/push 0/imm32/is-deref:false +19073 68/push 0x11/imm32/alloc-id:fake:payload +19074 89/<- %edi 4/r32/esp +19075 $test-add-reg-to-reg:initialize-stmt: +19076 # var stmt/esi: (addr statement) +19077 68/push 0/imm32/next +19078 68/push 0/imm32/next +19079 57/push-edi/outputs +19080 68/push 0x11/imm32/alloc-id:fake +19081 56/push-esi/inouts +19082 68/push 0x11/imm32/alloc-id:fake +19083 68/push 0/imm32/operation +19084 68/push 0/imm32/operation +19085 68/push 1/imm32/tag:stmt1 +19086 89/<- %esi 4/r32/esp +19087 $test-add-reg-to-reg:initialize-stmt-operation: +19088 # stmt->operation = "add" +19089 8d/copy-address *(esi+4) 0/r32/eax # Stmt1-operation +19090 (copy-array Heap "add" %eax) +19091 # convert +19092 c7 0/subop/copy *Curr-block-depth 0/imm32 +19093 (emit-subx-stmt _test-output-buffered-file %esi Primitives Stderr 0) +19094 (flush _test-output-buffered-file) +19095 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- +19101 # check output +19102 (check-next-stream-line-equal _test-output-stream "01/add-to %eax 0x00000001/r32" "F - test-add-reg-to-reg") +19103 # . epilogue +19104 89/<- %esp 5/r32/ebp +19105 5d/pop-to-ebp +19106 c3/return +19107 +19108 test-add-reg-to-mem: +19109 # add-to var1 var2/reg +19110 # => +19111 # 01/add-to *(ebp+__) var2 +19112 # +19113 # . prologue +19114 55/push-ebp +19115 89/<- %ebp 4/r32/esp +19116 # setup +19117 (clear-stream _test-output-stream) +19118 (clear-stream $_test-output-buffered-file->buffer) +19119 $test-add-reg-to-mem:initialize-type: +19120 # var type/ecx: (payload type-tree) = int +19121 68/push 0/imm32/right:null +19122 68/push 0/imm32/right:null +19123 68/push 0/imm32/left:unused +19124 68/push 1/imm32/value:int +19125 68/push 1/imm32/is-atom?:true +19126 68/push 0x11/imm32/alloc-id:fake:payload +19127 89/<- %ecx 4/r32/esp +19128 $test-add-reg-to-mem:initialize-var1: +19129 # var var1/ecx: (payload var) +19130 68/push 0/imm32/register +19131 68/push 0/imm32/register +19132 68/push 8/imm32/stack-offset +19133 68/push 1/imm32/block-depth +19134 51/push-ecx +19135 68/push 0x11/imm32/alloc-id:fake +19136 68/push 0/imm32/name +19137 68/push 0/imm32/name +19138 68/push 0x11/imm32/alloc-id:fake:payload +19139 89/<- %ecx 4/r32/esp +19140 $test-add-reg-to-mem:initialize-var1-name: +19141 # var1->name = "var1" +19142 8d/copy-address *(ecx+4) 0/r32/eax # Var-name + 4 +19143 (copy-array Heap "var1" %eax) +19144 $test-add-reg-to-mem:initialize-var2: +19145 # var var2/edx: (payload var) +19146 68/push 0/imm32/register +19147 68/push 0/imm32/register +19148 68/push 0/imm32/no-stack-offset +19149 68/push 1/imm32/block-depth +19150 ff 6/subop/push *(ecx+0x10) +19151 68/push 0x11/imm32/alloc-id:fake +19152 68/push 0/imm32/name +19153 68/push 0/imm32/name +19154 68/push 0x11/imm32/alloc-id:fake:payload +19155 89/<- %edx 4/r32/esp +19156 $test-add-reg-to-mem:initialize-var2-name: +19157 # var2->name = "var2" +19158 8d/copy-address *(edx+4) 0/r32/eax # Var-name + 4 +19159 (copy-array Heap "var2" %eax) +19160 $test-add-reg-to-mem:initialize-var2-register: +19161 # var2->register = "ecx" +19162 8d/copy-address *(edx+0x1c) 0/r32/eax # Var-register + 4 +19163 (copy-array Heap "ecx" %eax) +19164 $test-add-reg-to-mem:initialize-inouts: +19165 # var inouts/esi: (payload stmt-var) = [var2] +19166 68/push 0/imm32/is-deref:false +19167 68/push 0/imm32/next 19168 68/push 0/imm32/next -19169 68/push 0/imm32/next -19170 52/push-edx/l -19171 68/push 0x11/imm32/alloc-id:fake -19172 68/push 0x11/imm32/alloc-id:fake:payload -19173 89/<- %esi 4/r32/esp -19174 $test-add-literal-to-reg:initialize-outputs: -19175 # var outputs/edi: (payload stmt-var) = [v] -19176 68/push 0/imm32/is-deref:false -19177 68/push 0/imm32/next -19178 68/push 0/imm32/next -19179 51/push-ecx/v -19180 68/push 0x11/imm32/alloc-id:fake -19181 68/push 0x11/imm32/alloc-id:fake:payload -19182 89/<- %edi 4/r32/esp -19183 $test-add-literal-to-reg:initialize-stmt: -19184 # var stmt/esi: (addr statement) -19185 68/push 0/imm32/next -19186 68/push 0/imm32/next -19187 57/push-edi/outputs +19169 52/push-edx/var2 +19170 68/push 0x11/imm32/alloc-id:fake +19171 68/push 0x11/imm32/alloc-id:fake:payload +19172 89/<- %esi 4/r32/esp +19173 # inouts = [var1, var2] +19174 68/push 0/imm32/is-deref:false +19175 56/push-esi/next +19176 68/push 0x11/imm32/alloc-id:fake +19177 51/push-ecx/var1 +19178 68/push 0x11/imm32/alloc-id:fake +19179 68/push 0x11/imm32/alloc-id:fake:payload +19180 89/<- %esi 4/r32/esp +19181 $test-add-reg-to-mem:initialize-stmt: +19182 # var stmt/esi: (addr statement) +19183 68/push 0/imm32/next +19184 68/push 0/imm32/next +19185 68/push 0/imm32/outputs +19186 68/push 0/imm32/outputs +19187 56/push-esi/inouts 19188 68/push 0x11/imm32/alloc-id:fake -19189 56/push-esi/inouts -19190 68/push 0x11/imm32/alloc-id:fake -19191 68/push 0/imm32/operation -19192 68/push 0/imm32/operation -19193 68/push 1/imm32/tag:stmt1 -19194 89/<- %esi 4/r32/esp -19195 $test-add-literal-to-reg:initialize-stmt-operation: -19196 # stmt->operation = "add" -19197 8d/copy-address *(esi+4) 0/r32/eax # Stmt1-operation -19198 (copy-array Heap "add" %eax) -19199 # convert -19200 c7 0/subop/copy *Curr-block-depth 0/imm32 -19201 (emit-subx-stmt _test-output-buffered-file %esi Primitives Stderr 0) -19202 (flush _test-output-buffered-file) -19203 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- -19209 # check output -19210 (check-next-stream-line-equal _test-output-stream "81 0/subop/add %ecx 0x34/imm32" "F - test-add-literal-to-reg") -19211 # . epilogue -19212 89/<- %esp 5/r32/ebp -19213 5d/pop-to-ebp -19214 c3/return -19215 -19216 test-add-literal-to-mem: -19217 # add-to var1, 0x34 -19218 # => -19219 # 81 0/subop/add %eax 0x34/imm32 -19220 # -19221 # . prologue -19222 55/push-ebp -19223 89/<- %ebp 4/r32/esp -19224 # setup -19225 (clear-stream _test-output-stream) -19226 (clear-stream $_test-output-buffered-file->buffer) -19227 $test-add-literal-to-mem:initialize-type: -19228 # var type/ecx: (payload tree type-id) = int -19229 68/push 0/imm32/right:null -19230 68/push 0/imm32/right:null -19231 68/push 0/imm32/left:unused -19232 68/push 1/imm32/value:int -19233 68/push 1/imm32/is-atom?:true -19234 68/push 0x11/imm32/alloc-id:fake:payload -19235 89/<- %ecx 4/r32/esp -19236 $test-add-literal-to-mem:initialize-var1: -19237 # var var1/ecx: (payload var) -19238 68/push 0/imm32/register -19239 68/push 0/imm32/register -19240 68/push 8/imm32/stack-offset -19241 68/push 1/imm32/block-depth -19242 51/push-ecx -19243 68/push 0x11/imm32/alloc-id:fake -19244 68/push 0/imm32/name -19245 68/push 0/imm32/name -19246 68/push 0x11/imm32/alloc-id:fake:payload -19247 89/<- %ecx 4/r32/esp -19248 $test-add-literal-to-mem:initialize-var1-name: -19249 # var1->name = "var1" -19250 8d/copy-address *(ecx+4) 0/r32/eax # Var-name + 4 -19251 (copy-array Heap "var1" %eax) -19252 $test-add-literal-to-mem:initialize-literal-type: -19253 # var type/edx: (payload tree type-id) = literal -19254 68/push 0/imm32/right:null -19255 68/push 0/imm32/right:null -19256 68/push 0/imm32/left:unused -19257 68/push 0/imm32/value:literal -19258 68/push 1/imm32/is-atom?:true -19259 68/push 0x11/imm32/alloc-id:fake:payload -19260 89/<- %edx 4/r32/esp -19261 $test-add-literal-to-mem:initialize-literal: -19262 # var l/edx: (payload var) -19263 68/push 0/imm32/register -19264 68/push 0/imm32/register -19265 68/push 0/imm32/no-stack-offset -19266 68/push 1/imm32/block-depth -19267 52/push-edx -19268 68/push 0x11/imm32/alloc-id:fake -19269 68/push 0/imm32/name -19270 68/push 0/imm32/name -19271 68/push 0x11/imm32/alloc-id:fake:payload -19272 89/<- %edx 4/r32/esp -19273 $test-add-literal-to-mem:initialize-literal-value: -19274 # l->name = "0x34" -19275 8d/copy-address *(edx+4) 0/r32/eax # Var-name + 4 -19276 (copy-array Heap "0x34" %eax) -19277 $test-add-literal-to-mem:initialize-inouts: -19278 # var inouts/esi: (payload stmt-var) = [l] -19279 68/push 0/imm32/is-deref:false -19280 68/push 0/imm32/next -19281 68/push 0/imm32/next -19282 52/push-edx/l -19283 68/push 0x11/imm32/alloc-id:fake -19284 68/push 0x11/imm32/alloc-id:fake:payload -19285 89/<- %esi 4/r32/esp -19286 # var inouts = (handle stmt-var) = [var1, var2] -19287 68/push 0/imm32/is-deref:false -19288 56/push-esi/next -19289 68/push 0x11/imm32/alloc-id:fake -19290 51/push-ecx/var1 -19291 68/push 0x11/imm32/alloc-id:fake -19292 68/push 0x11/imm32/alloc-id:fake:payload -19293 89/<- %esi 4/r32/esp -19294 $test-add-literal-to-mem:initialize-stmt: -19295 # var stmt/esi: (addr statement) -19296 68/push 0/imm32/next -19297 68/push 0/imm32/next -19298 68/push 0/imm32/outputs -19299 68/push 0/imm32/outputs -19300 56/push-esi/inouts -19301 68/push 0x11/imm32/alloc-id:fake -19302 68/push 0/imm32/operation -19303 68/push 0/imm32/operation -19304 68/push 1/imm32/tag:stmt1 -19305 89/<- %esi 4/r32/esp -19306 $test-add-literal-to-mem:initialize-stmt-operation: -19307 # stmt->operation = "add-to" -19308 8d/copy-address *(esi+4) 0/r32/eax # Stmt1-operation -19309 (copy-array Heap "add-to" %eax) -19310 # convert -19311 c7 0/subop/copy *Curr-block-depth 0/imm32 -19312 (emit-subx-stmt _test-output-buffered-file %esi Primitives Stderr 0) -19313 (flush _test-output-buffered-file) -19314 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- -19320 # check output -19321 (check-next-stream-line-equal _test-output-stream "81 0/subop/add *(ebp+0x00000008) 0x34/imm32" "F - test-add-literal-to-mem") -19322 # . epilogue -19323 89/<- %esp 5/r32/ebp -19324 5d/pop-to-ebp -19325 c3/return -19326 -19327 test-compare-reg-with-reg: -19328 # compare var1/ecx, var2/eax -19329 # => -19330 # 39/compare %ecx 0/r32/eax -19331 # -19332 # . prologue -19333 55/push-ebp -19334 89/<- %ebp 4/r32/esp -19335 # setup -19336 (clear-stream _test-output-stream) -19337 (clear-stream $_test-output-buffered-file->buffer) -19338 $test-compare-reg-with-reg:initialize-type: -19339 # var type/ecx: (payload tree type-id) = int -19340 68/push 0/imm32/right:null -19341 68/push 0/imm32/right:null -19342 68/push 0/imm32/left:unused -19343 68/push 1/imm32/value:int -19344 68/push 1/imm32/is-atom?:true -19345 68/push 0x11/imm32/alloc-id:fake:payload -19346 89/<- %ecx 4/r32/esp -19347 $test-compare-reg-with-reg:initialize-var1: -19348 # var var1/ecx: (payload var) -19349 68/push 0/imm32/register -19350 68/push 0/imm32/register -19351 68/push 0/imm32/no-stack-offset -19352 68/push 1/imm32/block-depth -19353 51/push-ecx -19354 68/push 0x11/imm32/alloc-id:fake -19355 68/push 0/imm32/name -19356 68/push 0/imm32/name -19357 68/push 0x11/imm32/alloc-id:fake:payload -19358 89/<- %ecx 4/r32/esp -19359 $test-compare-reg-with-reg:initialize-var1-name: -19360 # var1->name = "var1" -19361 8d/copy-address *(ecx+4) 0/r32/eax # Var-name + 4 -19362 (copy-array Heap "var1" %eax) -19363 $test-compare-reg-with-reg:initialize-var1-register: -19364 # var1->register = "ecx" -19365 8d/copy-address *(ecx+0x1c) 0/r32/eax # Var-register + 4 -19366 (copy-array Heap "ecx" %eax) -19367 $test-compare-reg-with-reg:initialize-var2: -19368 # var var2/edx: (payload var) -19369 68/push 0/imm32/register -19370 68/push 0/imm32/register -19371 68/push 0/imm32/no-stack-offset -19372 68/push 1/imm32/block-depth -19373 ff 6/subop/push *(ecx+0x10) -19374 68/push 0x11/imm32/alloc-id:fake -19375 68/push 0/imm32/name -19376 68/push 0/imm32/name -19377 68/push 0x11/imm32/alloc-id:fake:payload -19378 89/<- %edx 4/r32/esp -19379 $test-compare-reg-with-reg:initialize-var2-name: -19380 # var2->name = "var2" -19381 8d/copy-address *(edx+4) 0/r32/eax # Var-name + 4 -19382 (copy-array Heap "var2" %eax) -19383 $test-compare-reg-with-reg:initialize-var2-register: -19384 # var2->register = "eax" -19385 8d/copy-address *(edx+0x1c) 0/r32/eax # Var-register + 4 -19386 (copy-array Heap "eax" %eax) -19387 $test-compare-reg-with-reg:initialize-inouts: -19388 # var inouts/esi: (payload stmt-var) = [var2] -19389 68/push 0/imm32/is-deref:false +19189 68/push 0/imm32/operation +19190 68/push 0/imm32/operation +19191 68/push 1/imm32/tag:stmt1 +19192 89/<- %esi 4/r32/esp +19193 $test-add-reg-to-mem:initialize-stmt-operation: +19194 # stmt->operation = "add-to" +19195 8d/copy-address *(esi+4) 0/r32/eax # Stmt1-operation +19196 (copy-array Heap "add-to" %eax) +19197 # convert +19198 c7 0/subop/copy *Curr-block-depth 0/imm32 +19199 (emit-subx-stmt _test-output-buffered-file %esi Primitives Stderr 0) +19200 (flush _test-output-buffered-file) +19201 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- +19207 # check output +19208 (check-next-stream-line-equal _test-output-stream "01/add-to *(ebp+0x00000008) 0x00000001/r32" "F - test-add-reg-to-mem") +19209 # . epilogue +19210 89/<- %esp 5/r32/ebp +19211 5d/pop-to-ebp +19212 c3/return +19213 +19214 test-add-mem-to-reg: +19215 # var1/reg <- add var2 +19216 # => +19217 # 03/add *(ebp+__) var1 +19218 # +19219 # . prologue +19220 55/push-ebp +19221 89/<- %ebp 4/r32/esp +19222 # setup +19223 (clear-stream _test-output-stream) +19224 (clear-stream $_test-output-buffered-file->buffer) +19225 $test-add-mem-to-reg:initialize-type: +19226 # var type/ecx: (payload type-tree) = int +19227 68/push 0/imm32/right:null +19228 68/push 0/imm32/right:null +19229 68/push 0/imm32/left:unused +19230 68/push 1/imm32/value:int +19231 68/push 1/imm32/is-atom?:true +19232 68/push 0x11/imm32/alloc-id:fake:payload +19233 89/<- %ecx 4/r32/esp +19234 $test-add-mem-to-reg:initialize-var: +19235 # var var1/ecx: (payload var) +19236 68/push 0/imm32/register +19237 68/push 0/imm32/register +19238 68/push 0/imm32/no-stack-offset +19239 68/push 1/imm32/block-depth +19240 51/push-ecx +19241 68/push 0x11/imm32/alloc-id:fake +19242 68/push 0/imm32/name +19243 68/push 0/imm32/name +19244 68/push 0x11/imm32/alloc-id:fake:payload +19245 89/<- %ecx 4/r32/esp +19246 $test-add-mem-to-reg:initialize-var-name: +19247 # var1->name = "foo" +19248 8d/copy-address *(ecx+4) 0/r32/eax # Var-name + 4 +19249 (copy-array Heap "var1" %eax) +19250 $test-add-mem-to-reg:initialize-var-register: +19251 # var1->register = "eax" +19252 8d/copy-address *(ecx+0x1c) 0/r32/eax # Var-register + 4 +19253 (copy-array Heap "eax" %eax) +19254 $test-add-mem-to-reg:initialize-var2: +19255 # var var2/edx: (payload var) +19256 68/push 0/imm32/register +19257 68/push 0/imm32/register +19258 68/push 8/imm32/stack-offset +19259 68/push 1/imm32/block-depth +19260 ff 6/subop/push *(ecx+0x10) +19261 68/push 0x11/imm32/alloc-id:fake +19262 68/push 0/imm32/name +19263 68/push 0/imm32/name +19264 68/push 0x11/imm32/alloc-id:fake:payload +19265 89/<- %edx 4/r32/esp +19266 $test-add-mem-to-reg:initialize-var2-name: +19267 # var2->name = "var2" +19268 8d/copy-address *(edx+4) 0/r32/eax # Var-name + 4 +19269 (copy-array Heap "var2" %eax) +19270 $test-add-mem-to-reg:initialize-inouts: +19271 # var inouts/esi: (payload stmt-var) = [var2] +19272 68/push 0/imm32/is-deref:false +19273 68/push 0/imm32/next +19274 68/push 0/imm32/next +19275 52/push-edx/var2 +19276 68/push 0x11/imm32/alloc-id:fake +19277 68/push 0x11/imm32/alloc-id:fake:payload +19278 89/<- %esi 4/r32/esp +19279 $test-add-mem-to-reg:initialize-outputs: +19280 # var outputs/edi: (payload stmt-var) = [var1] +19281 68/push 0/imm32/is-deref:false +19282 68/push 0/imm32/next +19283 68/push 0/imm32/next +19284 51/push-ecx/var1 +19285 68/push 0x11/imm32/alloc-id:fake +19286 68/push 0x11/imm32/alloc-id:fake:payload +19287 89/<- %edi 4/r32/esp +19288 $test-add-mem-to-reg:initialize-stmt: +19289 # var stmt/esi: (addr statement) +19290 68/push 0/imm32/next +19291 68/push 0/imm32/next +19292 57/push-edi/outputs +19293 68/push 0x11/imm32/alloc-id:fake +19294 56/push-esi/inouts +19295 68/push 0x11/imm32/alloc-id:fake +19296 68/push 0/imm32/operation +19297 68/push 0/imm32/operation +19298 68/push 1/imm32/tag:stmt1 +19299 89/<- %esi 4/r32/esp +19300 $test-add-mem-to-reg:initialize-stmt-operation: +19301 # stmt->operation = "add" +19302 8d/copy-address *(esi+4) 0/r32/eax # Stmt1-operation +19303 (copy-array Heap "add" %eax) +19304 # convert +19305 c7 0/subop/copy *Curr-block-depth 0/imm32 +19306 (emit-subx-stmt _test-output-buffered-file %esi Primitives Stderr 0) +19307 (flush _test-output-buffered-file) +19308 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- +19314 # check output +19315 (check-next-stream-line-equal _test-output-stream "03/add *(ebp+0x00000008) 0x00000000/r32" "F - test-add-mem-to-reg") +19316 # . epilogue +19317 89/<- %esp 5/r32/ebp +19318 5d/pop-to-ebp +19319 c3/return +19320 +19321 test-add-literal-to-eax: +19322 # var1/eax <- add 0x34 +19323 # => +19324 # 05/add-to-eax 0x34/imm32 +19325 # +19326 # . prologue +19327 55/push-ebp +19328 89/<- %ebp 4/r32/esp +19329 # setup +19330 (clear-stream _test-output-stream) +19331 (clear-stream $_test-output-buffered-file->buffer) +19332 $test-add-literal-to-eax:initialize-var-type: +19333 # var type/ecx: (payload type-tree) = int +19334 68/push 0/imm32/right:null +19335 68/push 0/imm32/right:null +19336 68/push 0/imm32/left:unused +19337 68/push 1/imm32/value:int +19338 68/push 1/imm32/is-atom?:true +19339 68/push 0x11/imm32/alloc-id:fake:payload +19340 89/<- %ecx 4/r32/esp +19341 $test-add-literal-to-eax:initialize-var: +19342 # var v/ecx: (payload var) +19343 68/push 0/imm32/register +19344 68/push 0/imm32/register +19345 68/push 0/imm32/no-stack-offset +19346 68/push 1/imm32/block-depth +19347 51/push-ecx +19348 68/push 0x11/imm32/alloc-id:fake +19349 68/push 0/imm32/name +19350 68/push 0/imm32/name +19351 68/push 0x11/imm32/alloc-id:fake:payload +19352 89/<- %ecx 4/r32/esp +19353 $test-add-literal-to-eax:initialize-var-name: +19354 # v->name = "v" +19355 8d/copy-address *(ecx+4) 0/r32/eax # Var-name + 4 +19356 (copy-array Heap "v" %eax) +19357 $test-add-literal-to-eax:initialize-var-register: +19358 # v->register = "eax" +19359 8d/copy-address *(ecx+0x1c) 0/r32/eax # Var-register + 4 +19360 (copy-array Heap "eax" %eax) +19361 $test-add-literal-to-eax:initialize-literal-type: +19362 # var type/edx: (payload type-tree) = literal +19363 68/push 0/imm32/right:null +19364 68/push 0/imm32/right:null +19365 68/push 0/imm32/left:unused +19366 68/push 0/imm32/value:literal +19367 68/push 1/imm32/is-atom?:true +19368 68/push 0x11/imm32/alloc-id:fake:payload +19369 89/<- %edx 4/r32/esp +19370 $test-add-literal-to-eax:initialize-literal: +19371 # var l/edx: (payload var) +19372 68/push 0/imm32/register +19373 68/push 0/imm32/register +19374 68/push 0/imm32/no-stack-offset +19375 68/push 1/imm32/block-depth +19376 52/push-edx +19377 68/push 0x11/imm32/alloc-id:fake +19378 68/push 0/imm32/name +19379 68/push 0/imm32/name +19380 68/push 0x11/imm32/alloc-id:fake:payload +19381 89/<- %edx 4/r32/esp +19382 $test-add-literal-to-eax:initialize-literal-value: +19383 # l->name = "0x34" +19384 8d/copy-address *(edx+4) 0/r32/eax # Var-name + 4 +19385 (copy-array Heap "0x34" %eax) +19386 $test-add-literal-to-eax:initialize-inouts: +19387 # var inouts/esi: (payload stmt-var) = [l] +19388 68/push 0/imm32/is-deref:false +19389 68/push 0/imm32/next 19390 68/push 0/imm32/next -19391 68/push 0/imm32/next -19392 52/push-edx/var2 -19393 68/push 0x11/imm32/alloc-id:fake -19394 68/push 0x11/imm32/alloc-id:fake:payload -19395 89/<- %esi 4/r32/esp -19396 # inouts = [var1, var2] +19391 52/push-edx/l +19392 68/push 0x11/imm32/alloc-id:fake +19393 68/push 0x11/imm32/alloc-id:fake:payload +19394 89/<- %esi 4/r32/esp +19395 $test-add-literal-to-eax:initialize-outputs: +19396 # var outputs/edi: (payload stmt-var) = [v] 19397 68/push 0/imm32/is-deref:false -19398 56/push-esi/next -19399 68/push 0x11/imm32/alloc-id:fake -19400 51/push-ecx/var1 +19398 68/push 0/imm32/next +19399 68/push 0/imm32/next +19400 51/push-ecx/v 19401 68/push 0x11/imm32/alloc-id:fake 19402 68/push 0x11/imm32/alloc-id:fake:payload -19403 89/<- %esi 4/r32/esp -19404 $test-compare-reg-with-reg:initialize-stmt: +19403 89/<- %edi 4/r32/esp +19404 $test-add-literal-to-eax:initialize-stmt: 19405 # var stmt/esi: (addr statement) 19406 68/push 0/imm32/next 19407 68/push 0/imm32/next -19408 68/push 0/imm32/outputs -19409 68/push 0/imm32/outputs +19408 57/push-edi/outputs +19409 68/push 0x11/imm32/alloc-id:fake 19410 56/push-esi/inouts 19411 68/push 0x11/imm32/alloc-id:fake 19412 68/push 0/imm32/operation 19413 68/push 0/imm32/operation 19414 68/push 1/imm32/tag:stmt1 19415 89/<- %esi 4/r32/esp -19416 $test-compare-reg-with-reg:initialize-stmt-operation: -19417 # stmt->operation = "compare" +19416 $test-add-literal-to-eax:initialize-stmt-operation: +19417 # stmt->operation = "add" 19418 8d/copy-address *(esi+4) 0/r32/eax # Stmt1-operation -19419 (copy-array Heap "compare" %eax) +19419 (copy-array Heap "add" %eax) 19420 # convert -19421 c7 0/subop/copy *Curr-block-depth 0/imm32 -19422 (emit-subx-stmt _test-output-buffered-file %esi Primitives Stderr 0) -19423 (flush _test-output-buffered-file) +19421 c7 0/subop/copy *Curr-block-depth 0/imm32 +19422 (emit-subx-stmt _test-output-buffered-file %esi Primitives Stderr 0) +19423 (flush _test-output-buffered-file) 19424 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- 19430 # check output -19431 (check-next-stream-line-equal _test-output-stream "39/compare-> %ecx 0x00000000/r32" "F - test-compare-reg-with-reg") +19431 (check-next-stream-line-equal _test-output-stream "05/add-to-eax 0x34/imm32" "F - test-add-literal-to-eax") 19432 # . epilogue 19433 89/<- %esp 5/r32/ebp 19434 5d/pop-to-ebp 19435 c3/return 19436 -19437 test-compare-mem-with-reg: -19438 # compare var1, var2/eax +19437 test-add-literal-to-reg: +19438 # var1/ecx <- add 0x34 19439 # => -19440 # 39/compare *(ebp+___) 0/r32/eax +19440 # 81 0/subop/add %ecx 0x34/imm32 19441 # 19442 # . prologue 19443 55/push-ebp 19444 89/<- %ebp 4/r32/esp 19445 # setup -19446 (clear-stream _test-output-stream) -19447 (clear-stream $_test-output-buffered-file->buffer) -19448 $test-compare-mem-with-reg:initialize-type: -19449 # var type/ecx: (payload tree type-id) = int +19446 (clear-stream _test-output-stream) +19447 (clear-stream $_test-output-buffered-file->buffer) +19448 $test-add-literal-to-reg:initialize-var-type: +19449 # var type/ecx: (payload type-tree) = int 19450 68/push 0/imm32/right:null 19451 68/push 0/imm32/right:null 19452 68/push 0/imm32/left:unused @@ -18825,11 +18828,11 @@ if ('onhashchange' in window) { 19454 68/push 1/imm32/is-atom?:true 19455 68/push 0x11/imm32/alloc-id:fake:payload 19456 89/<- %ecx 4/r32/esp -19457 $test-compare-mem-with-reg:initialize-var1: -19458 # var var1/ecx: (payload var) +19457 $test-add-literal-to-reg:initialize-var: +19458 # var v/ecx: (payload var) 19459 68/push 0/imm32/register 19460 68/push 0/imm32/register -19461 68/push 8/imm32/stack-offset +19461 68/push 0/imm32/no-stack-offset 19462 68/push 1/imm32/block-depth 19463 51/push-ecx 19464 68/push 0x11/imm32/alloc-id:fake @@ -18837,709 +18840,1031 @@ if ('onhashchange' in window) { 19466 68/push 0/imm32/name 19467 68/push 0x11/imm32/alloc-id:fake:payload 19468 89/<- %ecx 4/r32/esp -19469 $test-compare-mem-with-reg:initialize-var1-name: -19470 # var1->name = "var1" +19469 $test-add-literal-to-reg:initialize-var-name: +19470 # v->name = "v" 19471 8d/copy-address *(ecx+4) 0/r32/eax # Var-name + 4 -19472 (copy-array Heap "var1" %eax) -19473 $test-compare-mem-with-reg:initialize-var2: -19474 # var var2/edx: (payload var) -19475 68/push 0/imm32/register -19476 68/push 0/imm32/register -19477 68/push 0/imm32/no-stack-offset -19478 68/push 1/imm32/block-depth -19479 ff 6/subop/push *(ecx+0x10) -19480 68/push 0x11/imm32/alloc-id:fake -19481 68/push 0/imm32/name -19482 68/push 0/imm32/name -19483 68/push 0x11/imm32/alloc-id:fake:payload -19484 89/<- %edx 4/r32/esp -19485 $test-compare-mem-with-reg:initialize-var2-name: -19486 # var2->name = "var2" -19487 8d/copy-address *(edx+4) 0/r32/eax # Var-name + 4 -19488 (copy-array Heap "var2" %eax) -19489 $test-compare-mem-with-reg:initialize-var2-register: -19490 # var2->register = "eax" -19491 8d/copy-address *(edx+0x1c) 0/r32/eax # Var-register + 4 -19492 (copy-array Heap "eax" %eax) -19493 $test-compare-mem-with-reg:initialize-inouts: -19494 # var inouts/esi: (payload stmt-var) = [var2] -19495 68/push 0/imm32/is-deref:false -19496 68/push 0/imm32/next -19497 68/push 0/imm32/next -19498 52/push-edx/var2 -19499 68/push 0x11/imm32/alloc-id:fake -19500 68/push 0x11/imm32/alloc-id:fake:payload -19501 89/<- %esi 4/r32/esp -19502 # inouts = [var1, var2] -19503 68/push 0/imm32/is-deref:false -19504 56/push-esi/next -19505 68/push 0x11/imm32/alloc-id:fake -19506 51/push-ecx/var1 -19507 68/push 0x11/imm32/alloc-id:fake -19508 68/push 0x11/imm32/alloc-id:fake:payload -19509 89/<- %esi 4/r32/esp -19510 $test-compare-mem-with-reg:initialize-stmt: -19511 # var stmt/esi: (addr statement) -19512 68/push 0/imm32/next -19513 68/push 0/imm32/next -19514 68/push 0/imm32/outputs -19515 68/push 0/imm32/outputs -19516 56/push-esi/inouts +19472 (copy-array Heap "v" %eax) +19473 $test-add-literal-to-reg:initialize-var-register: +19474 # v->register = "ecx" +19475 8d/copy-address *(ecx+0x1c) 0/r32/eax # Var-register + 4 +19476 (copy-array Heap "ecx" %eax) +19477 $test-add-literal-to-reg:initialize-literal-type: +19478 # var type/edx: (payload type-tree) = literal +19479 68/push 0/imm32/right:null +19480 68/push 0/imm32/right:null +19481 68/push 0/imm32/left:unused +19482 68/push 0/imm32/value:literal +19483 68/push 1/imm32/is-atom?:true +19484 68/push 0x11/imm32/alloc-id:fake:payload +19485 89/<- %edx 4/r32/esp +19486 $test-add-literal-to-reg:initialize-literal: +19487 # var l/edx: (payload var) +19488 68/push 0/imm32/register +19489 68/push 0/imm32/register +19490 68/push 0/imm32/no-stack-offset +19491 68/push 1/imm32/block-depth +19492 52/push-edx +19493 68/push 0x11/imm32/alloc-id:fake +19494 68/push 0/imm32/name +19495 68/push 0/imm32/name +19496 68/push 0x11/imm32/alloc-id:fake:payload +19497 89/<- %edx 4/r32/esp +19498 $test-add-literal-to-reg:initialize-literal-value: +19499 # l->name = "0x34" +19500 8d/copy-address *(edx+4) 0/r32/eax # Var-name + 4 +19501 (copy-array Heap "0x34" %eax) +19502 $test-add-literal-to-reg:initialize-inouts: +19503 # var inouts/esi: (payload stmt-var) = [l] +19504 68/push 0/imm32/is-deref:false +19505 68/push 0/imm32/next +19506 68/push 0/imm32/next +19507 52/push-edx/l +19508 68/push 0x11/imm32/alloc-id:fake +19509 68/push 0x11/imm32/alloc-id:fake:payload +19510 89/<- %esi 4/r32/esp +19511 $test-add-literal-to-reg:initialize-outputs: +19512 # var outputs/edi: (payload stmt-var) = [v] +19513 68/push 0/imm32/is-deref:false +19514 68/push 0/imm32/next +19515 68/push 0/imm32/next +19516 51/push-ecx/v 19517 68/push 0x11/imm32/alloc-id:fake -19518 68/push 0/imm32/operation -19519 68/push 0/imm32/operation -19520 68/push 1/imm32/tag:stmt1 -19521 89/<- %esi 4/r32/esp -19522 $test-compare-mem-with-reg:initialize-stmt-operation: -19523 # stmt->operation = "compare" -19524 8d/copy-address *(esi+4) 0/r32/eax # Stmt1-operation -19525 (copy-array Heap "compare" %eax) -19526 # convert -19527 c7 0/subop/copy *Curr-block-depth 0/imm32 -19528 (emit-subx-stmt _test-output-buffered-file %esi Primitives Stderr 0) -19529 (flush _test-output-buffered-file) -19530 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- -19536 # check output -19537 (check-next-stream-line-equal _test-output-stream "39/compare-> *(ebp+0x00000008) 0x00000000/r32" "F - test-compare-mem-with-reg") -19538 # . epilogue -19539 89/<- %esp 5/r32/ebp -19540 5d/pop-to-ebp -19541 c3/return -19542 -19543 test-compare-reg-with-mem: -19544 # compare var1/eax, var2 -19545 # => -19546 # 3b/compare<- *(ebp+___) 0/r32/eax -19547 # -19548 # . prologue -19549 55/push-ebp -19550 89/<- %ebp 4/r32/esp -19551 # setup -19552 (clear-stream _test-output-stream) -19553 (clear-stream $_test-output-buffered-file->buffer) -19554 $test-compare-reg-with-mem:initialize-type: -19555 # var type/ecx: (payload tree type-id) = int -19556 68/push 0/imm32/right:null -19557 68/push 0/imm32/right:null -19558 68/push 0/imm32/left:unused -19559 68/push 1/imm32/value:int -19560 68/push 1/imm32/is-atom?:true -19561 68/push 0x11/imm32/alloc-id:fake:payload -19562 89/<- %ecx 4/r32/esp -19563 $test-compare-reg-with-mem:initialize-var1: -19564 # var var1/ecx: (payload var) -19565 68/push 0/imm32/register -19566 68/push 0/imm32/register -19567 68/push 0/imm32/no-stack-offset -19568 68/push 1/imm32/block-depth -19569 51/push-ecx -19570 68/push 0x11/imm32/alloc-id:fake -19571 68/push 0/imm32/name -19572 68/push 0/imm32/name -19573 68/push 0x11/imm32/alloc-id:fake:payload -19574 89/<- %ecx 4/r32/esp -19575 $test-compare-reg-with-mem:initialize-var1-name: -19576 # var1->name = "var1" -19577 8d/copy-address *(ecx+4) 0/r32/eax # Var-name + 4 -19578 (copy-array Heap "var1" %eax) -19579 $test-compare-reg-with-mem:initialize-var1-register: -19580 # var1->register = "eax" -19581 8d/copy-address *(ecx+0x1c) 0/r32/eax # Var-register + 4 -19582 (copy-array Heap "eax" %eax) -19583 $test-compare-reg-with-mem:initialize-var2: -19584 # var var2/edx: (payload var) -19585 68/push 0/imm32/register -19586 68/push 0/imm32/register -19587 68/push 8/imm32/stack-offset -19588 68/push 1/imm32/block-depth -19589 ff 6/subop/push *(ecx+0x10) -19590 68/push 0x11/imm32/alloc-id:fake -19591 68/push 0/imm32/name -19592 68/push 0/imm32/name -19593 68/push 0x11/imm32/alloc-id:fake:payload -19594 89/<- %edx 4/r32/esp -19595 $test-compare-reg-with-mem:initialize-var2-name: -19596 # var2->name = "var2" -19597 8d/copy-address *(edx+4) 0/r32/eax # Var-name + 4 -19598 (copy-array Heap "var2" %eax) -19599 $test-compare-reg-with-mem:initialize-inouts: -19600 # var inouts/esi: (payload stmt-var) = [var2] -19601 68/push 0/imm32/is-deref:false -19602 68/push 0/imm32/next -19603 68/push 0/imm32/next -19604 52/push-edx/var2 +19518 68/push 0x11/imm32/alloc-id:fake:payload +19519 89/<- %edi 4/r32/esp +19520 $test-add-literal-to-reg:initialize-stmt: +19521 # var stmt/esi: (addr statement) +19522 68/push 0/imm32/next +19523 68/push 0/imm32/next +19524 57/push-edi/outputs +19525 68/push 0x11/imm32/alloc-id:fake +19526 56/push-esi/inouts +19527 68/push 0x11/imm32/alloc-id:fake +19528 68/push 0/imm32/operation +19529 68/push 0/imm32/operation +19530 68/push 1/imm32/tag:stmt1 +19531 89/<- %esi 4/r32/esp +19532 $test-add-literal-to-reg:initialize-stmt-operation: +19533 # stmt->operation = "add" +19534 8d/copy-address *(esi+4) 0/r32/eax # Stmt1-operation +19535 (copy-array Heap "add" %eax) +19536 # convert +19537 c7 0/subop/copy *Curr-block-depth 0/imm32 +19538 (emit-subx-stmt _test-output-buffered-file %esi Primitives Stderr 0) +19539 (flush _test-output-buffered-file) +19540 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- +19546 # check output +19547 (check-next-stream-line-equal _test-output-stream "81 0/subop/add %ecx 0x34/imm32" "F - test-add-literal-to-reg") +19548 # . epilogue +19549 89/<- %esp 5/r32/ebp +19550 5d/pop-to-ebp +19551 c3/return +19552 +19553 test-add-literal-to-mem: +19554 # add-to var1, 0x34 +19555 # => +19556 # 81 0/subop/add %eax 0x34/imm32 +19557 # +19558 # . prologue +19559 55/push-ebp +19560 89/<- %ebp 4/r32/esp +19561 # setup +19562 (clear-stream _test-output-stream) +19563 (clear-stream $_test-output-buffered-file->buffer) +19564 $test-add-literal-to-mem:initialize-type: +19565 # var type/ecx: (payload type-tree) = int +19566 68/push 0/imm32/right:null +19567 68/push 0/imm32/right:null +19568 68/push 0/imm32/left:unused +19569 68/push 1/imm32/value:int +19570 68/push 1/imm32/is-atom?:true +19571 68/push 0x11/imm32/alloc-id:fake:payload +19572 89/<- %ecx 4/r32/esp +19573 $test-add-literal-to-mem:initialize-var1: +19574 # var var1/ecx: (payload var) +19575 68/push 0/imm32/register +19576 68/push 0/imm32/register +19577 68/push 8/imm32/stack-offset +19578 68/push 1/imm32/block-depth +19579 51/push-ecx +19580 68/push 0x11/imm32/alloc-id:fake +19581 68/push 0/imm32/name +19582 68/push 0/imm32/name +19583 68/push 0x11/imm32/alloc-id:fake:payload +19584 89/<- %ecx 4/r32/esp +19585 $test-add-literal-to-mem:initialize-var1-name: +19586 # var1->name = "var1" +19587 8d/copy-address *(ecx+4) 0/r32/eax # Var-name + 4 +19588 (copy-array Heap "var1" %eax) +19589 $test-add-literal-to-mem:initialize-literal-type: +19590 # var type/edx: (payload type-tree) = literal +19591 68/push 0/imm32/right:null +19592 68/push 0/imm32/right:null +19593 68/push 0/imm32/left:unused +19594 68/push 0/imm32/value:literal +19595 68/push 1/imm32/is-atom?:true +19596 68/push 0x11/imm32/alloc-id:fake:payload +19597 89/<- %edx 4/r32/esp +19598 $test-add-literal-to-mem:initialize-literal: +19599 # var l/edx: (payload var) +19600 68/push 0/imm32/register +19601 68/push 0/imm32/register +19602 68/push 0/imm32/no-stack-offset +19603 68/push 1/imm32/block-depth +19604 52/push-edx 19605 68/push 0x11/imm32/alloc-id:fake -19606 68/push 0x11/imm32/alloc-id:fake:payload -19607 89/<- %esi 4/r32/esp -19608 # inouts = [var1, var2] -19609 68/push 0/imm32/is-deref:false -19610 56/push-esi/next -19611 68/push 0x11/imm32/alloc-id:fake -19612 51/push-ecx/var1 -19613 68/push 0x11/imm32/alloc-id:fake -19614 68/push 0x11/imm32/alloc-id:fake:payload -19615 89/<- %esi 4/r32/esp -19616 $test-compare-reg-with-mem:initialize-stmt: -19617 # var stmt/esi: (addr statement) +19606 68/push 0/imm32/name +19607 68/push 0/imm32/name +19608 68/push 0x11/imm32/alloc-id:fake:payload +19609 89/<- %edx 4/r32/esp +19610 $test-add-literal-to-mem:initialize-literal-value: +19611 # l->name = "0x34" +19612 8d/copy-address *(edx+4) 0/r32/eax # Var-name + 4 +19613 (copy-array Heap "0x34" %eax) +19614 $test-add-literal-to-mem:initialize-inouts: +19615 # var inouts/esi: (payload stmt-var) = [l] +19616 68/push 0/imm32/is-deref:false +19617 68/push 0/imm32/next 19618 68/push 0/imm32/next -19619 68/push 0/imm32/next -19620 68/push 0/imm32/outputs -19621 68/push 0/imm32/outputs -19622 56/push-esi/inouts -19623 68/push 0x11/imm32/alloc-id:fake -19624 68/push 0/imm32/operation -19625 68/push 0/imm32/operation -19626 68/push 1/imm32/tag:stmt1 -19627 89/<- %esi 4/r32/esp -19628 $test-compare-reg-with-mem:initialize-stmt-operation: -19629 # stmt->operation = "compare" -19630 8d/copy-address *(esi+4) 0/r32/eax # Stmt1-operation -19631 (copy-array Heap "compare" %eax) -19632 # convert -19633 c7 0/subop/copy *Curr-block-depth 0/imm32 -19634 (emit-subx-stmt _test-output-buffered-file %esi Primitives Stderr 0) -19635 (flush _test-output-buffered-file) -19636 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- -19642 # check output -19643 (check-next-stream-line-equal _test-output-stream "3b/compare<- *(ebp+0x00000008) 0x00000000/r32" "F - test-compare-reg-with-mem") -19644 # . epilogue -19645 89/<- %esp 5/r32/ebp -19646 5d/pop-to-ebp -19647 c3/return -19648 -19649 test-compare-mem-with-literal: -19650 # compare var1, 0x34 -19651 # => -19652 # 81 7/subop/compare *(ebp+___) 0x34/imm32 -19653 # -19654 # . prologue -19655 55/push-ebp -19656 89/<- %ebp 4/r32/esp -19657 # setup -19658 (clear-stream _test-output-stream) -19659 (clear-stream $_test-output-buffered-file->buffer) -19660 $test-compare-mem-with-literal:initialize-type: -19661 # var type/ecx: (payload tree type-id) = int -19662 68/push 0/imm32/right:null -19663 68/push 0/imm32/right:null -19664 68/push 0/imm32/left:unused -19665 68/push 1/imm32/value:int -19666 68/push 1/imm32/is-atom?:true -19667 68/push 0x11/imm32/alloc-id:fake:payload -19668 89/<- %ecx 4/r32/esp -19669 $test-compare-mem-with-literal:initialize-var1: -19670 # var var1/ecx: (payload var) -19671 68/push 0/imm32/register -19672 68/push 0/imm32/register -19673 68/push 8/imm32/stack-offset -19674 68/push 1/imm32/block-depth -19675 51/push-ecx -19676 68/push 0x11/imm32/alloc-id:fake -19677 68/push 0/imm32/name -19678 68/push 0/imm32/name -19679 68/push 0x11/imm32/alloc-id:fake:payload -19680 89/<- %ecx 4/r32/esp -19681 $test-compare-mem-with-literal:initialize-var1-name: -19682 # var1->name = "var1" -19683 8d/copy-address *(ecx+4) 0/r32/eax # Var-name + 4 -19684 (copy-array Heap "var1" %eax) -19685 $test-compare-mem-with-literal:initialize-literal-type: -19686 # var type/edx: (payload tree type-id) = literal -19687 68/push 0/imm32/right:null -19688 68/push 0/imm32/right:null -19689 68/push 0/imm32/left:unused -19690 68/push 0/imm32/value:literal -19691 68/push 1/imm32/is-atom?:true -19692 68/push 0x11/imm32/alloc-id:fake:payload -19693 89/<- %edx 4/r32/esp -19694 $test-compare-mem-with-literal:initialize-literal: -19695 # var l/edx: (payload var) -19696 68/push 0/imm32/register -19697 68/push 0/imm32/register -19698 68/push 0/imm32/no-stack-offset -19699 68/push 1/imm32/block-depth -19700 52/push-edx -19701 68/push 0x11/imm32/alloc-id:fake -19702 68/push 0/imm32/name -19703 68/push 0/imm32/name -19704 68/push 0x11/imm32/alloc-id:fake:payload -19705 89/<- %edx 4/r32/esp -19706 $test-compare-mem-with-literal:initialize-literal-value: -19707 # l->name = "0x34" -19708 8d/copy-address *(edx+4) 0/r32/eax # Var-name + 4 -19709 (copy-array Heap "0x34" %eax) -19710 $test-compare-mem-with-literal:initialize-inouts: -19711 # var inouts/esi: (payload stmt-var) = [l] -19712 68/push 0/imm32/is-deref:false -19713 68/push 0/imm32/next -19714 68/push 0/imm32/next -19715 52/push-edx/l -19716 68/push 0x11/imm32/alloc-id:fake -19717 68/push 0x11/imm32/alloc-id:fake:payload -19718 89/<- %esi 4/r32/esp -19719 # var inouts = (handle stmt-var) = [var1, var2] -19720 68/push 0/imm32/is-deref:false -19721 56/push-esi/next -19722 68/push 0x11/imm32/alloc-id:fake -19723 51/push-ecx/var1 -19724 68/push 0x11/imm32/alloc-id:fake -19725 68/push 0x11/imm32/alloc-id:fake:payload -19726 89/<- %esi 4/r32/esp -19727 $test-compare-mem-with-literal:initialize-stmt: -19728 # var stmt/esi: (addr statement) -19729 68/push 0/imm32/next -19730 68/push 0/imm32/next -19731 68/push 0/imm32/outputs -19732 68/push 0/imm32/outputs -19733 56/push-esi/inouts -19734 68/push 0x11/imm32/alloc-id:fake -19735 68/push 0/imm32/operation -19736 68/push 0/imm32/operation -19737 68/push 1/imm32/tag:stmt1 -19738 89/<- %esi 4/r32/esp -19739 $test-compare-mem-with-literal:initialize-stmt-operation: -19740 # stmt->operation = "compare" -19741 8d/copy-address *(esi+4) 0/r32/eax # Stmt1-operation -19742 (copy-array Heap "compare" %eax) -19743 # convert -19744 c7 0/subop/copy *Curr-block-depth 0/imm32 -19745 (emit-subx-stmt _test-output-buffered-file %esi Primitives Stderr 0) -19746 (flush _test-output-buffered-file) -19747 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- -19753 # check output -19754 (check-next-stream-line-equal _test-output-stream "81 7/subop/compare *(ebp+0x00000008) 0x34/imm32" "F - test-compare-mem-with-literal") -19755 # . epilogue -19756 89/<- %esp 5/r32/ebp -19757 5d/pop-to-ebp -19758 c3/return -19759 -19760 test-compare-eax-with-literal: -19761 # compare var1/eax 0x34 -19762 # => -19763 # 3d/compare-eax-with 0x34/imm32 -19764 # -19765 # . prologue -19766 55/push-ebp -19767 89/<- %ebp 4/r32/esp -19768 # setup -19769 (clear-stream _test-output-stream) -19770 (clear-stream $_test-output-buffered-file->buffer) -19771 $test-compare-eax-with-literal:initialize-type: -19772 # var type/ecx: (payload tree type-id) = int -19773 68/push 0/imm32/right:null -19774 68/push 0/imm32/right:null -19775 68/push 0/imm32/left:unused -19776 68/push 1/imm32/value:int -19777 68/push 1/imm32/is-atom?:true -19778 68/push 0x11/imm32/alloc-id:fake:payload -19779 89/<- %ecx 4/r32/esp -19780 $test-compare-eax-with-literal:initialize-var1: -19781 # var var1/ecx: (payload var) -19782 68/push 0/imm32/register -19783 68/push 0/imm32/register -19784 68/push 0/imm32/no-stack-offset -19785 68/push 1/imm32/block-depth -19786 51/push-ecx -19787 68/push 0x11/imm32/alloc-id:fake -19788 68/push 0/imm32/name -19789 68/push 0/imm32/name -19790 68/push 0x11/imm32/alloc-id:fake:payload -19791 89/<- %ecx 4/r32/esp -19792 $test-compare-eax-with-literal:initialize-var1-name: -19793 # var1->name = "var1" -19794 8d/copy-address *(ecx+4) 0/r32/eax # Var-name + 4 -19795 (copy-array Heap "var1" %eax) -19796 $test-compare-eax-with-literal:initialize-var1-register: -19797 # v->register = "eax" -19798 8d/copy-address *(ecx+0x1c) 0/r32/eax # Var-register + 4 -19799 (copy-array Heap "eax" %eax) -19800 $test-compare-eax-with-literal:initialize-literal-type: -19801 # var type/edx: (payload tree type-id) = literal -19802 68/push 0/imm32/right:null -19803 68/push 0/imm32/right:null -19804 68/push 0/imm32/left:unused -19805 68/push 0/imm32/value:literal -19806 68/push 1/imm32/is-atom?:true -19807 68/push 0x11/imm32/alloc-id:fake:payload -19808 89/<- %edx 4/r32/esp -19809 $test-compare-eax-with-literal:initialize-literal: -19810 # var l/edx: (payload var) -19811 68/push 0/imm32/register +19619 52/push-edx/l +19620 68/push 0x11/imm32/alloc-id:fake +19621 68/push 0x11/imm32/alloc-id:fake:payload +19622 89/<- %esi 4/r32/esp +19623 # var inouts = (handle stmt-var) = [var1, var2] +19624 68/push 0/imm32/is-deref:false +19625 56/push-esi/next +19626 68/push 0x11/imm32/alloc-id:fake +19627 51/push-ecx/var1 +19628 68/push 0x11/imm32/alloc-id:fake +19629 68/push 0x11/imm32/alloc-id:fake:payload +19630 89/<- %esi 4/r32/esp +19631 $test-add-literal-to-mem:initialize-stmt: +19632 # var stmt/esi: (addr statement) +19633 68/push 0/imm32/next +19634 68/push 0/imm32/next +19635 68/push 0/imm32/outputs +19636 68/push 0/imm32/outputs +19637 56/push-esi/inouts +19638 68/push 0x11/imm32/alloc-id:fake +19639 68/push 0/imm32/operation +19640 68/push 0/imm32/operation +19641 68/push 1/imm32/tag:stmt1 +19642 89/<- %esi 4/r32/esp +19643 $test-add-literal-to-mem:initialize-stmt-operation: +19644 # stmt->operation = "add-to" +19645 8d/copy-address *(esi+4) 0/r32/eax # Stmt1-operation +19646 (copy-array Heap "add-to" %eax) +19647 # convert +19648 c7 0/subop/copy *Curr-block-depth 0/imm32 +19649 (emit-subx-stmt _test-output-buffered-file %esi Primitives Stderr 0) +19650 (flush _test-output-buffered-file) +19651 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- +19657 # check output +19658 (check-next-stream-line-equal _test-output-stream "81 0/subop/add *(ebp+0x00000008) 0x34/imm32" "F - test-add-literal-to-mem") +19659 # . epilogue +19660 89/<- %esp 5/r32/ebp +19661 5d/pop-to-ebp +19662 c3/return +19663 +19664 test-compare-reg-with-reg: +19665 # compare var1/ecx, var2/eax +19666 # => +19667 # 39/compare %ecx 0/r32/eax +19668 # +19669 # . prologue +19670 55/push-ebp +19671 89/<- %ebp 4/r32/esp +19672 # setup +19673 (clear-stream _test-output-stream) +19674 (clear-stream $_test-output-buffered-file->buffer) +19675 $test-compare-reg-with-reg:initialize-type: +19676 # var type/ecx: (payload type-tree) = int +19677 68/push 0/imm32/right:null +19678 68/push 0/imm32/right:null +19679 68/push 0/imm32/left:unused +19680 68/push 1/imm32/value:int +19681 68/push 1/imm32/is-atom?:true +19682 68/push 0x11/imm32/alloc-id:fake:payload +19683 89/<- %ecx 4/r32/esp +19684 $test-compare-reg-with-reg:initialize-var1: +19685 # var var1/ecx: (payload var) +19686 68/push 0/imm32/register +19687 68/push 0/imm32/register +19688 68/push 0/imm32/no-stack-offset +19689 68/push 1/imm32/block-depth +19690 51/push-ecx +19691 68/push 0x11/imm32/alloc-id:fake +19692 68/push 0/imm32/name +19693 68/push 0/imm32/name +19694 68/push 0x11/imm32/alloc-id:fake:payload +19695 89/<- %ecx 4/r32/esp +19696 $test-compare-reg-with-reg:initialize-var1-name: +19697 # var1->name = "var1" +19698 8d/copy-address *(ecx+4) 0/r32/eax # Var-name + 4 +19699 (copy-array Heap "var1" %eax) +19700 $test-compare-reg-with-reg:initialize-var1-register: +19701 # var1->register = "ecx" +19702 8d/copy-address *(ecx+0x1c) 0/r32/eax # Var-register + 4 +19703 (copy-array Heap "ecx" %eax) +19704 $test-compare-reg-with-reg:initialize-var2: +19705 # var var2/edx: (payload var) +19706 68/push 0/imm32/register +19707 68/push 0/imm32/register +19708 68/push 0/imm32/no-stack-offset +19709 68/push 1/imm32/block-depth +19710 ff 6/subop/push *(ecx+0x10) +19711 68/push 0x11/imm32/alloc-id:fake +19712 68/push 0/imm32/name +19713 68/push 0/imm32/name +19714 68/push 0x11/imm32/alloc-id:fake:payload +19715 89/<- %edx 4/r32/esp +19716 $test-compare-reg-with-reg:initialize-var2-name: +19717 # var2->name = "var2" +19718 8d/copy-address *(edx+4) 0/r32/eax # Var-name + 4 +19719 (copy-array Heap "var2" %eax) +19720 $test-compare-reg-with-reg:initialize-var2-register: +19721 # var2->register = "eax" +19722 8d/copy-address *(edx+0x1c) 0/r32/eax # Var-register + 4 +19723 (copy-array Heap "eax" %eax) +19724 $test-compare-reg-with-reg:initialize-inouts: +19725 # var inouts/esi: (payload stmt-var) = [var2] +19726 68/push 0/imm32/is-deref:false +19727 68/push 0/imm32/next +19728 68/push 0/imm32/next +19729 52/push-edx/var2 +19730 68/push 0x11/imm32/alloc-id:fake +19731 68/push 0x11/imm32/alloc-id:fake:payload +19732 89/<- %esi 4/r32/esp +19733 # inouts = [var1, var2] +19734 68/push 0/imm32/is-deref:false +19735 56/push-esi/next +19736 68/push 0x11/imm32/alloc-id:fake +19737 51/push-ecx/var1 +19738 68/push 0x11/imm32/alloc-id:fake +19739 68/push 0x11/imm32/alloc-id:fake:payload +19740 89/<- %esi 4/r32/esp +19741 $test-compare-reg-with-reg:initialize-stmt: +19742 # var stmt/esi: (addr statement) +19743 68/push 0/imm32/next +19744 68/push 0/imm32/next +19745 68/push 0/imm32/outputs +19746 68/push 0/imm32/outputs +19747 56/push-esi/inouts +19748 68/push 0x11/imm32/alloc-id:fake +19749 68/push 0/imm32/operation +19750 68/push 0/imm32/operation +19751 68/push 1/imm32/tag:stmt1 +19752 89/<- %esi 4/r32/esp +19753 $test-compare-reg-with-reg:initialize-stmt-operation: +19754 # stmt->operation = "compare" +19755 8d/copy-address *(esi+4) 0/r32/eax # Stmt1-operation +19756 (copy-array Heap "compare" %eax) +19757 # convert +19758 c7 0/subop/copy *Curr-block-depth 0/imm32 +19759 (emit-subx-stmt _test-output-buffered-file %esi Primitives Stderr 0) +19760 (flush _test-output-buffered-file) +19761 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- +19767 # check output +19768 (check-next-stream-line-equal _test-output-stream "39/compare-> %ecx 0x00000000/r32" "F - test-compare-reg-with-reg") +19769 # . epilogue +19770 89/<- %esp 5/r32/ebp +19771 5d/pop-to-ebp +19772 c3/return +19773 +19774 test-compare-mem-with-reg: +19775 # compare var1, var2/eax +19776 # => +19777 # 39/compare *(ebp+___) 0/r32/eax +19778 # +19779 # . prologue +19780 55/push-ebp +19781 89/<- %ebp 4/r32/esp +19782 # setup +19783 (clear-stream _test-output-stream) +19784 (clear-stream $_test-output-buffered-file->buffer) +19785 $test-compare-mem-with-reg:initialize-type: +19786 # var type/ecx: (payload type-tree) = int +19787 68/push 0/imm32/right:null +19788 68/push 0/imm32/right:null +19789 68/push 0/imm32/left:unused +19790 68/push 1/imm32/value:int +19791 68/push 1/imm32/is-atom?:true +19792 68/push 0x11/imm32/alloc-id:fake:payload +19793 89/<- %ecx 4/r32/esp +19794 $test-compare-mem-with-reg:initialize-var1: +19795 # var var1/ecx: (payload var) +19796 68/push 0/imm32/register +19797 68/push 0/imm32/register +19798 68/push 8/imm32/stack-offset +19799 68/push 1/imm32/block-depth +19800 51/push-ecx +19801 68/push 0x11/imm32/alloc-id:fake +19802 68/push 0/imm32/name +19803 68/push 0/imm32/name +19804 68/push 0x11/imm32/alloc-id:fake:payload +19805 89/<- %ecx 4/r32/esp +19806 $test-compare-mem-with-reg:initialize-var1-name: +19807 # var1->name = "var1" +19808 8d/copy-address *(ecx+4) 0/r32/eax # Var-name + 4 +19809 (copy-array Heap "var1" %eax) +19810 $test-compare-mem-with-reg:initialize-var2: +19811 # var var2/edx: (payload var) 19812 68/push 0/imm32/register -19813 68/push 0/imm32/no-stack-offset -19814 68/push 1/imm32/block-depth -19815 52/push-edx -19816 68/push 0x11/imm32/alloc-id:fake -19817 68/push 0/imm32/name +19813 68/push 0/imm32/register +19814 68/push 0/imm32/no-stack-offset +19815 68/push 1/imm32/block-depth +19816 ff 6/subop/push *(ecx+0x10) +19817 68/push 0x11/imm32/alloc-id:fake 19818 68/push 0/imm32/name -19819 68/push 0x11/imm32/alloc-id:fake:payload -19820 89/<- %edx 4/r32/esp -19821 $test-compare-eax-with-literal:initialize-literal-value: -19822 # l->name = "0x34" -19823 8d/copy-address *(edx+4) 0/r32/eax # Var-name + 4 -19824 (copy-array Heap "0x34" %eax) -19825 $test-compare-eax-with-literal:initialize-inouts: -19826 # var inouts/esi: (payload stmt-var) = [l] -19827 68/push 0/imm32/is-deref:false -19828 68/push 0/imm32/next -19829 68/push 0/imm32/next -19830 52/push-edx/l -19831 68/push 0x11/imm32/alloc-id:fake -19832 68/push 0x11/imm32/alloc-id:fake:payload -19833 89/<- %esi 4/r32/esp -19834 # var inouts = (handle stmt-var) = [var1, var2] -19835 68/push 0/imm32/is-deref:false -19836 56/push-esi/next -19837 68/push 0x11/imm32/alloc-id:fake -19838 51/push-ecx/var1 -19839 68/push 0x11/imm32/alloc-id:fake -19840 68/push 0x11/imm32/alloc-id:fake:payload -19841 89/<- %esi 4/r32/esp -19842 $test-compare-eax-with-literal:initialize-stmt: -19843 # var stmt/esi: (addr statement) -19844 68/push 0/imm32/next -19845 68/push 0/imm32/next -19846 68/push 0/imm32/outputs -19847 68/push 0/imm32/outputs -19848 56/push-esi/inouts -19849 68/push 0x11/imm32/alloc-id:fake -19850 68/push 0/imm32/operation -19851 68/push 0/imm32/operation -19852 68/push 1/imm32/tag:stmt1 -19853 89/<- %esi 4/r32/esp -19854 $test-compare-eax-with-literal:initialize-stmt-operation: -19855 # stmt->operation = "compare" -19856 8d/copy-address *(esi+4) 0/r32/eax # Stmt1-operation -19857 (copy-array Heap "compare" %eax) -19858 # convert -19859 c7 0/subop/copy *Curr-block-depth 0/imm32 -19860 (emit-subx-stmt _test-output-buffered-file %esi Primitives Stderr 0) -19861 (flush _test-output-buffered-file) -19862 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- -19868 # check output -19869 (check-next-stream-line-equal _test-output-stream "3d/compare-eax-with 0x34/imm32" "F - test-compare-eax-with-literal") -19870 # . epilogue -19871 89/<- %esp 5/r32/ebp -19872 5d/pop-to-ebp -19873 c3/return -19874 -19875 test-compare-reg-with-literal: -19876 # compare var1/ecx 0x34 -19877 # => -19878 # 81 7/subop/compare %ecx 0x34/imm32 -19879 # -19880 # . prologue -19881 55/push-ebp -19882 89/<- %ebp 4/r32/esp -19883 # setup -19884 (clear-stream _test-output-stream) -19885 (clear-stream $_test-output-buffered-file->buffer) -19886 $test-compare-reg-with-literal:initialize-type: -19887 # var type/ecx: (payload tree type-id) = int -19888 68/push 0/imm32/right:null -19889 68/push 0/imm32/right:null -19890 68/push 0/imm32/left:unused -19891 68/push 1/imm32/value:int -19892 68/push 1/imm32/is-atom?:true -19893 68/push 0x11/imm32/alloc-id:fake:payload -19894 89/<- %ecx 4/r32/esp -19895 $test-compare-reg-with-literal:initialize-var1: -19896 # var var1/ecx: (payload var) -19897 68/push 0/imm32/register -19898 68/push 0/imm32/register -19899 68/push 0/imm32/no-stack-offset -19900 68/push 1/imm32/block-depth -19901 51/push-ecx -19902 68/push 0x11/imm32/alloc-id:fake -19903 68/push 0/imm32/name -19904 68/push 0/imm32/name -19905 68/push 0x11/imm32/alloc-id:fake:payload -19906 89/<- %ecx 4/r32/esp -19907 $test-compare-reg-with-literal:initialize-var1-name: -19908 # var1->name = "var1" -19909 8d/copy-address *(ecx+4) 0/r32/eax # Var-name + 4 -19910 (copy-array Heap "var1" %eax) -19911 $test-compare-reg-with-literal:initialize-var1-register: -19912 # v->register = "ecx" -19913 8d/copy-address *(ecx+0x1c) 0/r32/eax # Var-register + 4 -19914 (copy-array Heap "ecx" %eax) -19915 $test-compare-reg-with-literal:initialize-literal-type: -19916 # var type/edx: (payload tree type-id) = literal -19917 68/push 0/imm32/right:null -19918 68/push 0/imm32/right:null -19919 68/push 0/imm32/left:unused -19920 68/push 0/imm32/value:literal -19921 68/push 1/imm32/is-atom?:true -19922 68/push 0x11/imm32/alloc-id:fake:payload -19923 89/<- %edx 4/r32/esp -19924 $test-compare-reg-with-literal:initialize-literal: -19925 # var l/edx: (payload var) -19926 68/push 0/imm32/register -19927 68/push 0/imm32/register -19928 68/push 0/imm32/no-stack-offset -19929 68/push 1/imm32/block-depth -19930 52/push-edx -19931 68/push 0x11/imm32/alloc-id:fake -19932 68/push 0/imm32/name -19933 68/push 0/imm32/name -19934 68/push 0x11/imm32/alloc-id:fake:payload -19935 89/<- %edx 4/r32/esp -19936 $test-compare-reg-with-literal:initialize-literal-value: -19937 # l->name = "0x34" -19938 8d/copy-address *(edx+4) 0/r32/eax # Var-name + 4 -19939 (copy-array Heap "0x34" %eax) -19940 $test-compare-reg-with-literal:initialize-inouts: -19941 # var inouts/esi: (payload stmt-var) = [l] -19942 68/push 0/imm32/is-deref:false -19943 68/push 0/imm32/next -19944 68/push 0/imm32/next -19945 52/push-edx/l -19946 68/push 0x11/imm32/alloc-id:fake -19947 68/push 0x11/imm32/alloc-id:fake:payload -19948 89/<- %esi 4/r32/esp -19949 # var inouts = (handle stmt-var) = [var1, var2] -19950 68/push 0/imm32/is-deref:false -19951 56/push-esi/next -19952 68/push 0x11/imm32/alloc-id:fake -19953 51/push-ecx/var1 -19954 68/push 0x11/imm32/alloc-id:fake -19955 68/push 0x11/imm32/alloc-id:fake:payload -19956 89/<- %esi 4/r32/esp -19957 $test-compare-reg-with-literal:initialize-stmt: -19958 # var stmt/esi: (addr statement) -19959 68/push 0/imm32/next -19960 68/push 0/imm32/next -19961 68/push 0/imm32/outputs -19962 68/push 0/imm32/outputs -19963 56/push-esi/inouts -19964 68/push 0x11/imm32/alloc-id:fake -19965 68/push 0/imm32/operation -19966 68/push 0/imm32/operation -19967 68/push 1/imm32/tag:stmt1 -19968 89/<- %esi 4/r32/esp -19969 $test-compare-reg-with-literal:initialize-stmt-operation: -19970 # stmt->operation = "compare" -19971 8d/copy-address *(esi+4) 0/r32/eax # Stmt1-operation -19972 (copy-array Heap "compare" %eax) -19973 # convert -19974 c7 0/subop/copy *Curr-block-depth 0/imm32 -19975 (emit-subx-stmt _test-output-buffered-file %esi Primitives Stderr 0) -19976 (flush _test-output-buffered-file) -19977 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- -19983 # check output -19984 (check-next-stream-line-equal _test-output-stream "81 7/subop/compare %ecx 0x34/imm32" "F - test-compare-reg-with-literal") -19985 # . epilogue -19986 89/<- %esp 5/r32/ebp -19987 5d/pop-to-ebp -19988 c3/return -19989 -19990 test-emit-subx-stmt-function-call: -19991 # Call a function on a variable on the stack. -19992 # f foo -19993 # => -19994 # (f *(ebp-8)) -19995 # (Changing the function name supports overloading in general, but here it -19996 # just serves to help disambiguate things.) -19997 # -19998 # There's a variable on the var stack as follows: -19999 # name: 'foo' -20000 # type: int -20001 # stack-offset: -8 -20002 # -20003 # There's nothing in primitives. -20004 # -20005 # We don't perform any checking here on the type of 'f'. -20006 # -20007 # . prologue -20008 55/push-ebp -20009 89/<- %ebp 4/r32/esp -20010 # setup -20011 (clear-stream _test-output-stream) -20012 (clear-stream $_test-output-buffered-file->buffer) -20013 $test-emit-subx-function-call:initialize-type: -20014 # var type/ecx: (payload tree type-id) = int -20015 68/push 0/imm32/right:null -20016 68/push 0/imm32/right:null -20017 68/push 0/imm32/left:unused -20018 68/push 1/imm32/value:int -20019 68/push 1/imm32/is-atom?:true -20020 68/push 0x11/imm32/alloc-id:fake:payload -20021 89/<- %ecx 4/r32/esp -20022 $test-emit-subx-function-call:initialize-var: -20023 # var var-foo/ecx: (payload var) = var(type) -20024 68/push 0/imm32/no-register -20025 68/push 0/imm32/no-register -20026 68/push -8/imm32/stack-offset -20027 68/push 1/imm32/block-depth -20028 51/push-ecx/type -20029 68/push 0x11/imm32/alloc-id:fake -20030 68/push 0/imm32/name -20031 68/push 0/imm32/name -20032 68/push 0x11/imm32/alloc-id:fake:payload -20033 89/<- %ecx 4/r32/esp -20034 $test-emit-subx-function-call:initialize-var-name: -20035 # var-foo->name = "foo" -20036 8d/copy-address *(ecx+4) 0/r32/eax # Var-name + 4 -20037 (copy-array Heap "foo" %eax) -20038 $test-emit-subx-function-call:initialize-stmt-var: -20039 # var operand/ebx: (payload stmt-var) = stmt-var(var-foo) -20040 68/push 0/imm32/is-deref:false -20041 68/push 0/imm32/next -20042 68/push 0/imm32/next -20043 51/push-ecx/var-foo -20044 68/push 0x11/imm32/alloc-id:fake -20045 68/push 0x11/imm32/alloc-id:fake:payload -20046 89/<- %ebx 4/r32/esp -20047 $test-emit-subx-function-call:initialize-stmt: -20048 # var stmt/esi: (addr statement) -20049 68/push 0/imm32/no-outputs -20050 68/push 0/imm32/no-outputs -20051 53/push-ebx/inouts -20052 68/push 0x11/imm32/alloc-id:fake -20053 68/push 0/imm32/operation -20054 68/push 0/imm32/operation -20055 68/push 1/imm32/tag -20056 89/<- %esi 4/r32/esp -20057 $test-emit-subx-function-call:initialize-stmt-operation: -20058 # stmt->operation = "f" -20059 8d/copy-address *(esi+4) 0/r32/eax # Stmt1-operation -20060 (copy-array Heap "f" %eax) -20061 # convert -20062 c7 0/subop/copy *Curr-block-depth 0/imm32 -20063 (emit-subx-stmt _test-output-buffered-file %esi 0 Stderr 0) -20064 (flush _test-output-buffered-file) -20065 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- -20071 # check output -20072 (check-next-stream-line-equal _test-output-stream "(f *(ebp+0xfffffff8))" "F - test-emit-subx-stmt-function-call") -20073 # . epilogue -20074 89/<- %esp 5/r32/ebp -20075 5d/pop-to-ebp -20076 c3/return -20077 -20078 test-emit-subx-stmt-function-call-with-literal-arg: -20079 # Call a function on a literal. -20080 # f 0x34 -20081 # => -20082 # (f2 0x34) -20083 # -20084 # . prologue -20085 55/push-ebp -20086 89/<- %ebp 4/r32/esp -20087 # setup -20088 (clear-stream _test-output-stream) -20089 (clear-stream $_test-output-buffered-file->buffer) -20090 $test-emit-subx-function-call-with-literal-arg:initialize-type: -20091 # var type/ecx: (payload tree type-id) = int -20092 68/push 0/imm32/right:null -20093 68/push 0/imm32/right:null -20094 68/push 0/imm32/left:unused -20095 68/push 0/imm32/value:literal -20096 68/push 1/imm32/is-atom?:true -20097 68/push 0x11/imm32/alloc-id:fake:payload -20098 89/<- %ecx 4/r32/esp -20099 $test-emit-subx-function-call-with-literal-arg:initialize-var: -20100 # var var-foo/ecx: (payload var) = var(lit) -20101 68/push 0/imm32/no-register -20102 68/push 0/imm32/no-register -20103 68/push 0/imm32/no-stack-offset -20104 68/push 1/imm32/block-depth -20105 51/push-ecx/type -20106 68/push 0x11/imm32/alloc-id:fake -20107 68/push 0/imm32/name -20108 68/push 0/imm32/name -20109 68/push 0x11/imm32/alloc-id:fake:payload -20110 89/<- %ecx 4/r32/esp -20111 $test-emit-subx-function-call-with-literal-arg:initialize-var-name: -20112 # var-foo->name = "0x34" -20113 8d/copy-address *(ecx+4) 0/r32/eax # Var-name + 4 -20114 (copy-array Heap "0x34" %eax) -20115 $test-emit-subx-function-call-with-literal-arg:initialize-stmt-var: -20116 # var operand/ebx: (payload stmt-var) = stmt-var(var-foo) -20117 68/push 0/imm32/is-deref:false -20118 68/push 0/imm32/next -20119 68/push 0/imm32/next -20120 51/push-ecx/var-foo -20121 68/push 0x11/imm32/alloc-id:fake -20122 68/push 0x11/imm32/alloc-id:fake:payload -20123 89/<- %ebx 4/r32/esp -20124 $test-emit-subx-function-call-with-literal-arg:initialize-stmt: -20125 # var stmt/esi: (addr statement) -20126 68/push 0/imm32/no-outputs -20127 68/push 0/imm32/no-outputs -20128 53/push-ebx/inouts -20129 68/push 0x11/imm32/alloc-id:fake -20130 68/push 0/imm32/operation -20131 68/push 0/imm32/operation -20132 68/push 1/imm32/tag -20133 89/<- %esi 4/r32/esp -20134 $test-emit-subx-function-call-with-literal-arg:initialize-stmt-operation: -20135 # stmt->operation = "f" -20136 8d/copy-address *(esi+4) 0/r32/eax # Stmt1-operation -20137 (copy-array Heap "f" %eax) -20138 # convert -20139 c7 0/subop/copy *Curr-block-depth 0/imm32 -20140 (emit-subx-stmt _test-output-buffered-file %esi 0 %ebx Stderr 0) -20141 (flush _test-output-buffered-file) -20142 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- -20148 # check output -20149 (check-next-stream-line-equal _test-output-stream "(f 0x34)" "F - test-emit-subx-stmt-function-call-with-literal-arg") -20150 # . epilogue -20151 89/<- %esp 5/r32/ebp -20152 5d/pop-to-ebp -20153 c3/return -20154 -20155 emit-indent: # out: (addr buffered-file), n: int -20156 # . prologue -20157 55/push-ebp -20158 89/<- %ebp 4/r32/esp -20159 # . save registers -20160 50/push-eax -20161 # var i/eax: int = n -20162 8b/-> *(ebp+0xc) 0/r32/eax -20163 { -20164 # if (i <= 0) break -20165 3d/compare-eax-with 0/imm32 -20166 7e/jump-if-<= break/disp8 -20167 (write-buffered *(ebp+8) " ") -20168 48/decrement-eax -20169 eb/jump loop/disp8 -20170 } -20171 $emit-indent:end: -20172 # . restore registers -20173 58/pop-to-eax -20174 # . epilogue -20175 89/<- %esp 5/r32/ebp -20176 5d/pop-to-ebp -20177 c3/return -20178 -20179 emit-subx-prologue: # out: (addr buffered-file) -20180 # . prologue -20181 55/push-ebp -20182 89/<- %ebp 4/r32/esp -20183 # -20184 (write-buffered *(ebp+8) " # . prologue\n") -20185 (write-buffered *(ebp+8) " 55/push-ebp\n") -20186 (write-buffered *(ebp+8) " 89/<- %ebp 4/r32/esp\n") -20187 $emit-subx-prologue:end: -20188 # . epilogue -20189 89/<- %esp 5/r32/ebp -20190 5d/pop-to-ebp -20191 c3/return -20192 -20193 emit-subx-epilogue: # out: (addr buffered-file) -20194 # . prologue -20195 55/push-ebp -20196 89/<- %ebp 4/r32/esp -20197 # -20198 (write-buffered *(ebp+8) " # . epilogue\n") -20199 (write-buffered *(ebp+8) " 89/<- %esp 5/r32/ebp\n") -20200 (write-buffered *(ebp+8) " 5d/pop-to-ebp\n") -20201 (write-buffered *(ebp+8) " c3/return\n") -20202 $emit-subx-epilogue:end: -20203 # . epilogue -20204 89/<- %esp 5/r32/ebp -20205 5d/pop-to-ebp -20206 c3/return +19819 68/push 0/imm32/name +19820 68/push 0x11/imm32/alloc-id:fake:payload +19821 89/<- %edx 4/r32/esp +19822 $test-compare-mem-with-reg:initialize-var2-name: +19823 # var2->name = "var2" +19824 8d/copy-address *(edx+4) 0/r32/eax # Var-name + 4 +19825 (copy-array Heap "var2" %eax) +19826 $test-compare-mem-with-reg:initialize-var2-register: +19827 # var2->register = "eax" +19828 8d/copy-address *(edx+0x1c) 0/r32/eax # Var-register + 4 +19829 (copy-array Heap "eax" %eax) +19830 $test-compare-mem-with-reg:initialize-inouts: +19831 # var inouts/esi: (payload stmt-var) = [var2] +19832 68/push 0/imm32/is-deref:false +19833 68/push 0/imm32/next +19834 68/push 0/imm32/next +19835 52/push-edx/var2 +19836 68/push 0x11/imm32/alloc-id:fake +19837 68/push 0x11/imm32/alloc-id:fake:payload +19838 89/<- %esi 4/r32/esp +19839 # inouts = [var1, var2] +19840 68/push 0/imm32/is-deref:false +19841 56/push-esi/next +19842 68/push 0x11/imm32/alloc-id:fake +19843 51/push-ecx/var1 +19844 68/push 0x11/imm32/alloc-id:fake +19845 68/push 0x11/imm32/alloc-id:fake:payload +19846 89/<- %esi 4/r32/esp +19847 $test-compare-mem-with-reg:initialize-stmt: +19848 # var stmt/esi: (addr statement) +19849 68/push 0/imm32/next +19850 68/push 0/imm32/next +19851 68/push 0/imm32/outputs +19852 68/push 0/imm32/outputs +19853 56/push-esi/inouts +19854 68/push 0x11/imm32/alloc-id:fake +19855 68/push 0/imm32/operation +19856 68/push 0/imm32/operation +19857 68/push 1/imm32/tag:stmt1 +19858 89/<- %esi 4/r32/esp +19859 $test-compare-mem-with-reg:initialize-stmt-operation: +19860 # stmt->operation = "compare" +19861 8d/copy-address *(esi+4) 0/r32/eax # Stmt1-operation +19862 (copy-array Heap "compare" %eax) +19863 # convert +19864 c7 0/subop/copy *Curr-block-depth 0/imm32 +19865 (emit-subx-stmt _test-output-buffered-file %esi Primitives Stderr 0) +19866 (flush _test-output-buffered-file) +19867 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- +19873 # check output +19874 (check-next-stream-line-equal _test-output-stream "39/compare-> *(ebp+0x00000008) 0x00000000/r32" "F - test-compare-mem-with-reg") +19875 # . epilogue +19876 89/<- %esp 5/r32/ebp +19877 5d/pop-to-ebp +19878 c3/return +19879 +19880 test-compare-reg-with-mem: +19881 # compare var1/eax, var2 +19882 # => +19883 # 3b/compare<- *(ebp+___) 0/r32/eax +19884 # +19885 # . prologue +19886 55/push-ebp +19887 89/<- %ebp 4/r32/esp +19888 # setup +19889 (clear-stream _test-output-stream) +19890 (clear-stream $_test-output-buffered-file->buffer) +19891 $test-compare-reg-with-mem:initialize-type: +19892 # var type/ecx: (payload type-tree) = int +19893 68/push 0/imm32/right:null +19894 68/push 0/imm32/right:null +19895 68/push 0/imm32/left:unused +19896 68/push 1/imm32/value:int +19897 68/push 1/imm32/is-atom?:true +19898 68/push 0x11/imm32/alloc-id:fake:payload +19899 89/<- %ecx 4/r32/esp +19900 $test-compare-reg-with-mem:initialize-var1: +19901 # var var1/ecx: (payload var) +19902 68/push 0/imm32/register +19903 68/push 0/imm32/register +19904 68/push 0/imm32/no-stack-offset +19905 68/push 1/imm32/block-depth +19906 51/push-ecx +19907 68/push 0x11/imm32/alloc-id:fake +19908 68/push 0/imm32/name +19909 68/push 0/imm32/name +19910 68/push 0x11/imm32/alloc-id:fake:payload +19911 89/<- %ecx 4/r32/esp +19912 $test-compare-reg-with-mem:initialize-var1-name: +19913 # var1->name = "var1" +19914 8d/copy-address *(ecx+4) 0/r32/eax # Var-name + 4 +19915 (copy-array Heap "var1" %eax) +19916 $test-compare-reg-with-mem:initialize-var1-register: +19917 # var1->register = "eax" +19918 8d/copy-address *(ecx+0x1c) 0/r32/eax # Var-register + 4 +19919 (copy-array Heap "eax" %eax) +19920 $test-compare-reg-with-mem:initialize-var2: +19921 # var var2/edx: (payload var) +19922 68/push 0/imm32/register +19923 68/push 0/imm32/register +19924 68/push 8/imm32/stack-offset +19925 68/push 1/imm32/block-depth +19926 ff 6/subop/push *(ecx+0x10) +19927 68/push 0x11/imm32/alloc-id:fake +19928 68/push 0/imm32/name +19929 68/push 0/imm32/name +19930 68/push 0x11/imm32/alloc-id:fake:payload +19931 89/<- %edx 4/r32/esp +19932 $test-compare-reg-with-mem:initialize-var2-name: +19933 # var2->name = "var2" +19934 8d/copy-address *(edx+4) 0/r32/eax # Var-name + 4 +19935 (copy-array Heap "var2" %eax) +19936 $test-compare-reg-with-mem:initialize-inouts: +19937 # var inouts/esi: (payload stmt-var) = [var2] +19938 68/push 0/imm32/is-deref:false +19939 68/push 0/imm32/next +19940 68/push 0/imm32/next +19941 52/push-edx/var2 +19942 68/push 0x11/imm32/alloc-id:fake +19943 68/push 0x11/imm32/alloc-id:fake:payload +19944 89/<- %esi 4/r32/esp +19945 # inouts = [var1, var2] +19946 68/push 0/imm32/is-deref:false +19947 56/push-esi/next +19948 68/push 0x11/imm32/alloc-id:fake +19949 51/push-ecx/var1 +19950 68/push 0x11/imm32/alloc-id:fake +19951 68/push 0x11/imm32/alloc-id:fake:payload +19952 89/<- %esi 4/r32/esp +19953 $test-compare-reg-with-mem:initialize-stmt: +19954 # var stmt/esi: (addr statement) +19955 68/push 0/imm32/next +19956 68/push 0/imm32/next +19957 68/push 0/imm32/outputs +19958 68/push 0/imm32/outputs +19959 56/push-esi/inouts +19960 68/push 0x11/imm32/alloc-id:fake +19961 68/push 0/imm32/operation +19962 68/push 0/imm32/operation +19963 68/push 1/imm32/tag:stmt1 +19964 89/<- %esi 4/r32/esp +19965 $test-compare-reg-with-mem:initialize-stmt-operation: +19966 # stmt->operation = "compare" +19967 8d/copy-address *(esi+4) 0/r32/eax # Stmt1-operation +19968 (copy-array Heap "compare" %eax) +19969 # convert +19970 c7 0/subop/copy *Curr-block-depth 0/imm32 +19971 (emit-subx-stmt _test-output-buffered-file %esi Primitives Stderr 0) +19972 (flush _test-output-buffered-file) +19973 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- +19979 # check output +19980 (check-next-stream-line-equal _test-output-stream "3b/compare<- *(ebp+0x00000008) 0x00000000/r32" "F - test-compare-reg-with-mem") +19981 # . epilogue +19982 89/<- %esp 5/r32/ebp +19983 5d/pop-to-ebp +19984 c3/return +19985 +19986 test-compare-mem-with-literal: +19987 # compare var1, 0x34 +19988 # => +19989 # 81 7/subop/compare *(ebp+___) 0x34/imm32 +19990 # +19991 # . prologue +19992 55/push-ebp +19993 89/<- %ebp 4/r32/esp +19994 # setup +19995 (clear-stream _test-output-stream) +19996 (clear-stream $_test-output-buffered-file->buffer) +19997 $test-compare-mem-with-literal:initialize-type: +19998 # var type/ecx: (payload type-tree) = int +19999 68/push 0/imm32/right:null +20000 68/push 0/imm32/right:null +20001 68/push 0/imm32/left:unused +20002 68/push 1/imm32/value:int +20003 68/push 1/imm32/is-atom?:true +20004 68/push 0x11/imm32/alloc-id:fake:payload +20005 89/<- %ecx 4/r32/esp +20006 $test-compare-mem-with-literal:initialize-var1: +20007 # var var1/ecx: (payload var) +20008 68/push 0/imm32/register +20009 68/push 0/imm32/register +20010 68/push 8/imm32/stack-offset +20011 68/push 1/imm32/block-depth +20012 51/push-ecx +20013 68/push 0x11/imm32/alloc-id:fake +20014 68/push 0/imm32/name +20015 68/push 0/imm32/name +20016 68/push 0x11/imm32/alloc-id:fake:payload +20017 89/<- %ecx 4/r32/esp +20018 $test-compare-mem-with-literal:initialize-var1-name: +20019 # var1->name = "var1" +20020 8d/copy-address *(ecx+4) 0/r32/eax # Var-name + 4 +20021 (copy-array Heap "var1" %eax) +20022 $test-compare-mem-with-literal:initialize-literal-type: +20023 # var type/edx: (payload type-tree) = literal +20024 68/push 0/imm32/right:null +20025 68/push 0/imm32/right:null +20026 68/push 0/imm32/left:unused +20027 68/push 0/imm32/value:literal +20028 68/push 1/imm32/is-atom?:true +20029 68/push 0x11/imm32/alloc-id:fake:payload +20030 89/<- %edx 4/r32/esp +20031 $test-compare-mem-with-literal:initialize-literal: +20032 # var l/edx: (payload var) +20033 68/push 0/imm32/register +20034 68/push 0/imm32/register +20035 68/push 0/imm32/no-stack-offset +20036 68/push 1/imm32/block-depth +20037 52/push-edx +20038 68/push 0x11/imm32/alloc-id:fake +20039 68/push 0/imm32/name +20040 68/push 0/imm32/name +20041 68/push 0x11/imm32/alloc-id:fake:payload +20042 89/<- %edx 4/r32/esp +20043 $test-compare-mem-with-literal:initialize-literal-value: +20044 # l->name = "0x34" +20045 8d/copy-address *(edx+4) 0/r32/eax # Var-name + 4 +20046 (copy-array Heap "0x34" %eax) +20047 $test-compare-mem-with-literal:initialize-inouts: +20048 # var inouts/esi: (payload stmt-var) = [l] +20049 68/push 0/imm32/is-deref:false +20050 68/push 0/imm32/next +20051 68/push 0/imm32/next +20052 52/push-edx/l +20053 68/push 0x11/imm32/alloc-id:fake +20054 68/push 0x11/imm32/alloc-id:fake:payload +20055 89/<- %esi 4/r32/esp +20056 # var inouts = (handle stmt-var) = [var1, var2] +20057 68/push 0/imm32/is-deref:false +20058 56/push-esi/next +20059 68/push 0x11/imm32/alloc-id:fake +20060 51/push-ecx/var1 +20061 68/push 0x11/imm32/alloc-id:fake +20062 68/push 0x11/imm32/alloc-id:fake:payload +20063 89/<- %esi 4/r32/esp +20064 $test-compare-mem-with-literal:initialize-stmt: +20065 # var stmt/esi: (addr statement) +20066 68/push 0/imm32/next +20067 68/push 0/imm32/next +20068 68/push 0/imm32/outputs +20069 68/push 0/imm32/outputs +20070 56/push-esi/inouts +20071 68/push 0x11/imm32/alloc-id:fake +20072 68/push 0/imm32/operation +20073 68/push 0/imm32/operation +20074 68/push 1/imm32/tag:stmt1 +20075 89/<- %esi 4/r32/esp +20076 $test-compare-mem-with-literal:initialize-stmt-operation: +20077 # stmt->operation = "compare" +20078 8d/copy-address *(esi+4) 0/r32/eax # Stmt1-operation +20079 (copy-array Heap "compare" %eax) +20080 # convert +20081 c7 0/subop/copy *Curr-block-depth 0/imm32 +20082 (emit-subx-stmt _test-output-buffered-file %esi Primitives Stderr 0) +20083 (flush _test-output-buffered-file) +20084 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- +20090 # check output +20091 (check-next-stream-line-equal _test-output-stream "81 7/subop/compare *(ebp+0x00000008) 0x34/imm32" "F - test-compare-mem-with-literal") +20092 # . epilogue +20093 89/<- %esp 5/r32/ebp +20094 5d/pop-to-ebp +20095 c3/return +20096 +20097 test-compare-eax-with-literal: +20098 # compare var1/eax 0x34 +20099 # => +20100 # 3d/compare-eax-with 0x34/imm32 +20101 # +20102 # . prologue +20103 55/push-ebp +20104 89/<- %ebp 4/r32/esp +20105 # setup +20106 (clear-stream _test-output-stream) +20107 (clear-stream $_test-output-buffered-file->buffer) +20108 $test-compare-eax-with-literal:initialize-type: +20109 # var type/ecx: (payload type-tree) = int +20110 68/push 0/imm32/right:null +20111 68/push 0/imm32/right:null +20112 68/push 0/imm32/left:unused +20113 68/push 1/imm32/value:int +20114 68/push 1/imm32/is-atom?:true +20115 68/push 0x11/imm32/alloc-id:fake:payload +20116 89/<- %ecx 4/r32/esp +20117 $test-compare-eax-with-literal:initialize-var1: +20118 # var var1/ecx: (payload var) +20119 68/push 0/imm32/register +20120 68/push 0/imm32/register +20121 68/push 0/imm32/no-stack-offset +20122 68/push 1/imm32/block-depth +20123 51/push-ecx +20124 68/push 0x11/imm32/alloc-id:fake +20125 68/push 0/imm32/name +20126 68/push 0/imm32/name +20127 68/push 0x11/imm32/alloc-id:fake:payload +20128 89/<- %ecx 4/r32/esp +20129 $test-compare-eax-with-literal:initialize-var1-name: +20130 # var1->name = "var1" +20131 8d/copy-address *(ecx+4) 0/r32/eax # Var-name + 4 +20132 (copy-array Heap "var1" %eax) +20133 $test-compare-eax-with-literal:initialize-var1-register: +20134 # v->register = "eax" +20135 8d/copy-address *(ecx+0x1c) 0/r32/eax # Var-register + 4 +20136 (copy-array Heap "eax" %eax) +20137 $test-compare-eax-with-literal:initialize-literal-type: +20138 # var type/edx: (payload type-tree) = literal +20139 68/push 0/imm32/right:null +20140 68/push 0/imm32/right:null +20141 68/push 0/imm32/left:unused +20142 68/push 0/imm32/value:literal +20143 68/push 1/imm32/is-atom?:true +20144 68/push 0x11/imm32/alloc-id:fake:payload +20145 89/<- %edx 4/r32/esp +20146 $test-compare-eax-with-literal:initialize-literal: +20147 # var l/edx: (payload var) +20148 68/push 0/imm32/register +20149 68/push 0/imm32/register +20150 68/push 0/imm32/no-stack-offset +20151 68/push 1/imm32/block-depth +20152 52/push-edx +20153 68/push 0x11/imm32/alloc-id:fake +20154 68/push 0/imm32/name +20155 68/push 0/imm32/name +20156 68/push 0x11/imm32/alloc-id:fake:payload +20157 89/<- %edx 4/r32/esp +20158 $test-compare-eax-with-literal:initialize-literal-value: +20159 # l->name = "0x34" +20160 8d/copy-address *(edx+4) 0/r32/eax # Var-name + 4 +20161 (copy-array Heap "0x34" %eax) +20162 $test-compare-eax-with-literal:initialize-inouts: +20163 # var inouts/esi: (payload stmt-var) = [l] +20164 68/push 0/imm32/is-deref:false +20165 68/push 0/imm32/next +20166 68/push 0/imm32/next +20167 52/push-edx/l +20168 68/push 0x11/imm32/alloc-id:fake +20169 68/push 0x11/imm32/alloc-id:fake:payload +20170 89/<- %esi 4/r32/esp +20171 # var inouts = (handle stmt-var) = [var1, var2] +20172 68/push 0/imm32/is-deref:false +20173 56/push-esi/next +20174 68/push 0x11/imm32/alloc-id:fake +20175 51/push-ecx/var1 +20176 68/push 0x11/imm32/alloc-id:fake +20177 68/push 0x11/imm32/alloc-id:fake:payload +20178 89/<- %esi 4/r32/esp +20179 $test-compare-eax-with-literal:initialize-stmt: +20180 # var stmt/esi: (addr statement) +20181 68/push 0/imm32/next +20182 68/push 0/imm32/next +20183 68/push 0/imm32/outputs +20184 68/push 0/imm32/outputs +20185 56/push-esi/inouts +20186 68/push 0x11/imm32/alloc-id:fake +20187 68/push 0/imm32/operation +20188 68/push 0/imm32/operation +20189 68/push 1/imm32/tag:stmt1 +20190 89/<- %esi 4/r32/esp +20191 $test-compare-eax-with-literal:initialize-stmt-operation: +20192 # stmt->operation = "compare" +20193 8d/copy-address *(esi+4) 0/r32/eax # Stmt1-operation +20194 (copy-array Heap "compare" %eax) +20195 # convert +20196 c7 0/subop/copy *Curr-block-depth 0/imm32 +20197 (emit-subx-stmt _test-output-buffered-file %esi Primitives Stderr 0) +20198 (flush _test-output-buffered-file) +20199 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- +20205 # check output +20206 (check-next-stream-line-equal _test-output-stream "3d/compare-eax-with 0x34/imm32" "F - test-compare-eax-with-literal") +20207 # . epilogue +20208 89/<- %esp 5/r32/ebp +20209 5d/pop-to-ebp +20210 c3/return +20211 +20212 test-compare-reg-with-literal: +20213 # compare var1/ecx 0x34 +20214 # => +20215 # 81 7/subop/compare %ecx 0x34/imm32 +20216 # +20217 # . prologue +20218 55/push-ebp +20219 89/<- %ebp 4/r32/esp +20220 # setup +20221 (clear-stream _test-output-stream) +20222 (clear-stream $_test-output-buffered-file->buffer) +20223 $test-compare-reg-with-literal:initialize-type: +20224 # var type/ecx: (payload type-tree) = int +20225 68/push 0/imm32/right:null +20226 68/push 0/imm32/right:null +20227 68/push 0/imm32/left:unused +20228 68/push 1/imm32/value:int +20229 68/push 1/imm32/is-atom?:true +20230 68/push 0x11/imm32/alloc-id:fake:payload +20231 89/<- %ecx 4/r32/esp +20232 $test-compare-reg-with-literal:initialize-var1: +20233 # var var1/ecx: (payload var) +20234 68/push 0/imm32/register +20235 68/push 0/imm32/register +20236 68/push 0/imm32/no-stack-offset +20237 68/push 1/imm32/block-depth +20238 51/push-ecx +20239 68/push 0x11/imm32/alloc-id:fake +20240 68/push 0/imm32/name +20241 68/push 0/imm32/name +20242 68/push 0x11/imm32/alloc-id:fake:payload +20243 89/<- %ecx 4/r32/esp +20244 $test-compare-reg-with-literal:initialize-var1-name: +20245 # var1->name = "var1" +20246 8d/copy-address *(ecx+4) 0/r32/eax # Var-name + 4 +20247 (copy-array Heap "var1" %eax) +20248 $test-compare-reg-with-literal:initialize-var1-register: +20249 # v->register = "ecx" +20250 8d/copy-address *(ecx+0x1c) 0/r32/eax # Var-register + 4 +20251 (copy-array Heap "ecx" %eax) +20252 $test-compare-reg-with-literal:initialize-literal-type: +20253 # var type/edx: (payload type-tree) = literal +20254 68/push 0/imm32/right:null +20255 68/push 0/imm32/right:null +20256 68/push 0/imm32/left:unused +20257 68/push 0/imm32/value:literal +20258 68/push 1/imm32/is-atom?:true +20259 68/push 0x11/imm32/alloc-id:fake:payload +20260 89/<- %edx 4/r32/esp +20261 $test-compare-reg-with-literal:initialize-literal: +20262 # var l/edx: (payload var) +20263 68/push 0/imm32/register +20264 68/push 0/imm32/register +20265 68/push 0/imm32/no-stack-offset +20266 68/push 1/imm32/block-depth +20267 52/push-edx +20268 68/push 0x11/imm32/alloc-id:fake +20269 68/push 0/imm32/name +20270 68/push 0/imm32/name +20271 68/push 0x11/imm32/alloc-id:fake:payload +20272 89/<- %edx 4/r32/esp +20273 $test-compare-reg-with-literal:initialize-literal-value: +20274 # l->name = "0x34" +20275 8d/copy-address *(edx+4) 0/r32/eax # Var-name + 4 +20276 (copy-array Heap "0x34" %eax) +20277 $test-compare-reg-with-literal:initialize-inouts: +20278 # var inouts/esi: (payload stmt-var) = [l] +20279 68/push 0/imm32/is-deref:false +20280 68/push 0/imm32/next +20281 68/push 0/imm32/next +20282 52/push-edx/l +20283 68/push 0x11/imm32/alloc-id:fake +20284 68/push 0x11/imm32/alloc-id:fake:payload +20285 89/<- %esi 4/r32/esp +20286 # var inouts = (handle stmt-var) = [var1, var2] +20287 68/push 0/imm32/is-deref:false +20288 56/push-esi/next +20289 68/push 0x11/imm32/alloc-id:fake +20290 51/push-ecx/var1 +20291 68/push 0x11/imm32/alloc-id:fake +20292 68/push 0x11/imm32/alloc-id:fake:payload +20293 89/<- %esi 4/r32/esp +20294 $test-compare-reg-with-literal:initialize-stmt: +20295 # var stmt/esi: (addr statement) +20296 68/push 0/imm32/next +20297 68/push 0/imm32/next +20298 68/push 0/imm32/outputs +20299 68/push 0/imm32/outputs +20300 56/push-esi/inouts +20301 68/push 0x11/imm32/alloc-id:fake +20302 68/push 0/imm32/operation +20303 68/push 0/imm32/operation +20304 68/push 1/imm32/tag:stmt1 +20305 89/<- %esi 4/r32/esp +20306 $test-compare-reg-with-literal:initialize-stmt-operation: +20307 # stmt->operation = "compare" +20308 8d/copy-address *(esi+4) 0/r32/eax # Stmt1-operation +20309 (copy-array Heap "compare" %eax) +20310 # convert +20311 c7 0/subop/copy *Curr-block-depth 0/imm32 +20312 (emit-subx-stmt _test-output-buffered-file %esi Primitives Stderr 0) +20313 (flush _test-output-buffered-file) +20314 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- +20320 # check output +20321 (check-next-stream-line-equal _test-output-stream "81 7/subop/compare %ecx 0x34/imm32" "F - test-compare-reg-with-literal") +20322 # . epilogue +20323 89/<- %esp 5/r32/ebp +20324 5d/pop-to-ebp +20325 c3/return +20326 +20327 test-emit-subx-stmt-function-call: +20328 # Call a function on a variable on the stack. +20329 # f foo +20330 # => +20331 # (f *(ebp-8)) +20332 # (Changing the function name supports overloading in general, but here it +20333 # just serves to help disambiguate things.) +20334 # +20335 # There's a variable on the var stack as follows: +20336 # name: 'foo' +20337 # type: int +20338 # stack-offset: -8 +20339 # +20340 # There's nothing in primitives. +20341 # +20342 # We don't perform any checking here on the type of 'f'. +20343 # +20344 # . prologue +20345 55/push-ebp +20346 89/<- %ebp 4/r32/esp +20347 # setup +20348 (clear-stream _test-output-stream) +20349 (clear-stream $_test-output-buffered-file->buffer) +20350 $test-emit-subx-function-call:initialize-type: +20351 # var type/ecx: (payload type-tree) = int +20352 68/push 0/imm32/right:null +20353 68/push 0/imm32/right:null +20354 68/push 0/imm32/left:unused +20355 68/push 1/imm32/value:int +20356 68/push 1/imm32/is-atom?:true +20357 68/push 0x11/imm32/alloc-id:fake:payload +20358 89/<- %ecx 4/r32/esp +20359 $test-emit-subx-function-call:initialize-var: +20360 # var var-foo/ecx: (payload var) = var(type) +20361 68/push 0/imm32/no-register +20362 68/push 0/imm32/no-register +20363 68/push -8/imm32/stack-offset +20364 68/push 1/imm32/block-depth +20365 51/push-ecx/type +20366 68/push 0x11/imm32/alloc-id:fake +20367 68/push 0/imm32/name +20368 68/push 0/imm32/name +20369 68/push 0x11/imm32/alloc-id:fake:payload +20370 89/<- %ecx 4/r32/esp +20371 $test-emit-subx-function-call:initialize-var-name: +20372 # var-foo->name = "foo" +20373 8d/copy-address *(ecx+4) 0/r32/eax # Var-name + 4 +20374 (copy-array Heap "foo" %eax) +20375 $test-emit-subx-function-call:initialize-stmt-var: +20376 # var operand/ebx: (payload stmt-var) = stmt-var(var-foo) +20377 68/push 0/imm32/is-deref:false +20378 68/push 0/imm32/next +20379 68/push 0/imm32/next +20380 51/push-ecx/var-foo +20381 68/push 0x11/imm32/alloc-id:fake +20382 68/push 0x11/imm32/alloc-id:fake:payload +20383 89/<- %ebx 4/r32/esp +20384 $test-emit-subx-function-call:initialize-stmt: +20385 # var stmt/esi: (addr statement) +20386 68/push 0/imm32/no-outputs +20387 68/push 0/imm32/no-outputs +20388 53/push-ebx/inouts +20389 68/push 0x11/imm32/alloc-id:fake +20390 68/push 0/imm32/operation +20391 68/push 0/imm32/operation +20392 68/push 1/imm32/tag +20393 89/<- %esi 4/r32/esp +20394 $test-emit-subx-function-call:initialize-stmt-operation: +20395 # stmt->operation = "f" +20396 8d/copy-address *(esi+4) 0/r32/eax # Stmt1-operation +20397 (copy-array Heap "f" %eax) +20398 # convert +20399 c7 0/subop/copy *Curr-block-depth 0/imm32 +20400 (emit-subx-stmt _test-output-buffered-file %esi 0 Stderr 0) +20401 (flush _test-output-buffered-file) +20402 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- +20408 # check output +20409 (check-next-stream-line-equal _test-output-stream "(f *(ebp+0xfffffff8))" "F - test-emit-subx-stmt-function-call") +20410 # . epilogue +20411 89/<- %esp 5/r32/ebp +20412 5d/pop-to-ebp +20413 c3/return +20414 +20415 test-emit-subx-stmt-function-call-with-literal-arg: +20416 # Call a function on a literal. +20417 # f 0x34 +20418 # => +20419 # (f2 0x34) +20420 # +20421 # . prologue +20422 55/push-ebp +20423 89/<- %ebp 4/r32/esp +20424 # setup +20425 (clear-stream _test-output-stream) +20426 (clear-stream $_test-output-buffered-file->buffer) +20427 $test-emit-subx-function-call-with-literal-arg:initialize-type: +20428 # var type/ecx: (payload type-tree) = int +20429 68/push 0/imm32/right:null +20430 68/push 0/imm32/right:null +20431 68/push 0/imm32/left:unused +20432 68/push 0/imm32/value:literal +20433 68/push 1/imm32/is-atom?:true +20434 68/push 0x11/imm32/alloc-id:fake:payload +20435 89/<- %ecx 4/r32/esp +20436 $test-emit-subx-function-call-with-literal-arg:initialize-var: +20437 # var var-foo/ecx: (payload var) = var(lit) +20438 68/push 0/imm32/no-register +20439 68/push 0/imm32/no-register +20440 68/push 0/imm32/no-stack-offset +20441 68/push 1/imm32/block-depth +20442 51/push-ecx/type +20443 68/push 0x11/imm32/alloc-id:fake +20444 68/push 0/imm32/name +20445 68/push 0/imm32/name +20446 68/push 0x11/imm32/alloc-id:fake:payload +20447 89/<- %ecx 4/r32/esp +20448 $test-emit-subx-function-call-with-literal-arg:initialize-var-name: +20449 # var-foo->name = "0x34" +20450 8d/copy-address *(ecx+4) 0/r32/eax # Var-name + 4 +20451 (copy-array Heap "0x34" %eax) +20452 $test-emit-subx-function-call-with-literal-arg:initialize-stmt-var: +20453 # var operand/ebx: (payload stmt-var) = stmt-var(var-foo) +20454 68/push 0/imm32/is-deref:false +20455 68/push 0/imm32/next +20456 68/push 0/imm32/next +20457 51/push-ecx/var-foo +20458 68/push 0x11/imm32/alloc-id:fake +20459 68/push 0x11/imm32/alloc-id:fake:payload +20460 89/<- %ebx 4/r32/esp +20461 $test-emit-subx-function-call-with-literal-arg:initialize-stmt: +20462 # var stmt/esi: (addr statement) +20463 68/push 0/imm32/no-outputs +20464 68/push 0/imm32/no-outputs +20465 53/push-ebx/inouts +20466 68/push 0x11/imm32/alloc-id:fake +20467 68/push 0/imm32/operation +20468 68/push 0/imm32/operation +20469 68/push 1/imm32/tag +20470 89/<- %esi 4/r32/esp +20471 $test-emit-subx-function-call-with-literal-arg:initialize-stmt-operation: +20472 # stmt->operation = "f" +20473 8d/copy-address *(esi+4) 0/r32/eax # Stmt1-operation +20474 (copy-array Heap "f" %eax) +20475 # convert +20476 c7 0/subop/copy *Curr-block-depth 0/imm32 +20477 (emit-subx-stmt _test-output-buffered-file %esi 0 %ebx Stderr 0) +20478 (flush _test-output-buffered-file) +20479 +-- 6 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- +20485 # check output +20486 (check-next-stream-line-equal _test-output-stream "(f 0x34)" "F - test-emit-subx-stmt-function-call-with-literal-arg") +20487 # . epilogue +20488 89/<- %esp 5/r32/ebp +20489 5d/pop-to-ebp +20490 c3/return +20491 +20492 emit-indent: # out: (addr buffered-file), n: int +20493 # . prologue +20494 55/push-ebp +20495 89/<- %ebp 4/r32/esp +20496 # . save registers +20497 50/push-eax +20498 # var i/eax: int = n +20499 8b/-> *(ebp+0xc) 0/r32/eax +20500 { +20501 # if (i <= 0) break +20502 3d/compare-eax-with 0/imm32 +20503 7e/jump-if-<= break/disp8 +20504 (write-buffered *(ebp+8) " ") +20505 48/decrement-eax +20506 eb/jump loop/disp8 +20507 } +20508 $emit-indent:end: +20509 # . restore registers +20510 58/pop-to-eax +20511 # . epilogue +20512 89/<- %esp 5/r32/ebp +20513 5d/pop-to-ebp +20514 c3/return +20515 +20516 emit-subx-prologue: # out: (addr buffered-file) +20517 # . prologue +20518 55/push-ebp +20519 89/<- %ebp 4/r32/esp +20520 # +20521 (write-buffered *(ebp+8) " # . prologue\n") +20522 (write-buffered *(ebp+8) " 55/push-ebp\n") +20523 (write-buffered *(ebp+8) " 89/<- %ebp 4/r32/esp\n") +20524 $emit-subx-prologue:end: +20525 # . epilogue +20526 89/<- %esp 5/r32/ebp +20527 5d/pop-to-ebp +20528 c3/return +20529 +20530 emit-subx-epilogue: # out: (addr buffered-file) +20531 # . prologue +20532 55/push-ebp +20533 89/<- %ebp 4/r32/esp +20534 # +20535 (write-buffered *(ebp+8) " # . epilogue\n") +20536 (write-buffered *(ebp+8) " 89/<- %esp 5/r32/ebp\n") +20537 (write-buffered *(ebp+8) " 5d/pop-to-ebp\n") +20538 (write-buffered *(ebp+8) " c3/return\n") +20539 $emit-subx-epilogue:end: +20540 # . epilogue +20541 89/<- %esp 5/r32/ebp +20542 5d/pop-to-ebp +20543 c3/return
diff --git a/html/apps/mulisp.subx.html b/html/apps/mulisp.subx.html index 1fc6e57f..62316dfb 100644 --- a/html/apps/mulisp.subx.html +++ b/html/apps/mulisp.subx.html @@ -72,22 +72,22 @@ if ('onhashchange' in window) { 14 # . prologue 15 89/<- %ebp 4/r32/esp 16 # initialize heap - 17 (new-segment *Heap-size Heap) + 17 (new-segment *Heap-size Heap) 18 { 19 # if (argc <= 1) break 20 81 7/subop/compare *ebp 1/imm32 21 7e/jump-if-<= break/disp8 22 # if (argv[1] != "test")) break - 23 (kernel-string-equal? *(ebp+8) "test") # => eax + 23 (kernel-string-equal? *(ebp+8) "test") # => eax 24 3d/compare-eax-and 0/imm32/false 25 74/jump-if-= break/disp8 26 # 27 (run-tests) 28 # syscall(exit, *Num-test-failures) - 29 8b/-> *Num-test-failures 3/r32/ebx + 29 8b/-> *Num-test-failures 3/r32/ebx 30 eb/jump $main:end/disp8 31 } - 32 (repl Stdin Stdout) + 32 (repl Stdin Stdout) 33 # syscall(exit, 0) 34 bb/copy-to-ebx 0/imm32 35 $main:end: @@ -138,13 +138,13 @@ if ('onhashchange' in window) { 80 # . save registers 81 50/push-eax 82 { - 83 (lisp-read Stdin) # => eax: (handle cell) + 83 (lisp-read Stdin) # => eax: (handle cell) 84 # if (eax == 0) break 85 3d/compare-eax-and 0/imm32 86 74/jump-if-= break/disp8 87 # 88 (lisp-eval %eax) # => eax: (handle cell) - 89 (lisp-print Stdout %eax) + 89 (lisp-print Stdout %eax) 90 eb/jump loop/disp8 91 } 92 $repl:end: @@ -175,8 +175,8 @@ if ('onhashchange' in window) { 117 89/<- %ecx 4/r32/esp 118 { 119 # read line into s -120 (clear-stream %ecx) -121 (read-line-buffered *(ebp+8) %ecx) +120 (clear-stream %ecx) +121 (read-line-buffered *(ebp+8) %ecx) 122 # if (s->write == 0) return null 123 { 124 81 7/subop/compare *ecx 0/imm32 @@ -274,9 +274,9 @@ if ('onhashchange' in window) { 216 89/<- %ebp 4/r32/esp 217 # . save registers 218 # write(x) -219 (write-buffered Stdout "=> ") -220 (write-stream-data Stdout *(ebp+0xc)) -221 (flush Stdout) +219 (write-buffered Stdout "=> ") +220 (write-stream-data Stdout *(ebp+0xc)) +221 (flush Stdout) 222 $lisp-print:end: 223 # . restore registers 224 # . epilogue diff --git a/html/apps/pack.subx.html b/html/apps/pack.subx.html index 308f2031..c60c7ae4 100644 --- a/html/apps/pack.subx.html +++ b/html/apps/pack.subx.html @@ -87,10 +87,10 @@ if ('onhashchange' in window) { 25 # initialize heap 26 # . Heap = new-segment(Heap-size) 27 # . . push args - 28 68/push Heap/imm32 - 29 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Heap-size/disp32 # push *Heap-size + 28 68/push Heap/imm32 + 29 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Heap-size/disp32 # push *Heap-size 30 # . . call - 31 e8/call new-segment/disp32 + 31 e8/call new-segment/disp32 32 # . . discard args 33 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 34 @@ -104,7 +104,7 @@ if ('onhashchange' in window) { 42 68/push "test"/imm32 43 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 44 # . . call - 45 e8/call kernel-string-equal?/disp32 + 45 e8/call kernel-string-equal?/disp32 46 # . . discard args 47 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 48 # . if (eax == false) goto interactive @@ -113,14 +113,14 @@ if ('onhashchange' in window) { 51 # run-tests() 52 e8/call run-tests/disp32 53 # syscall(exit, *Num-test-failures) - 54 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/ebx Num-test-failures/disp32 # copy *Num-test-failures to ebx + 54 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/ebx Num-test-failures/disp32 # copy *Num-test-failures to ebx 55 eb/jump $subx-pack-main:end/disp8 56 $subx-pack-main:interactive: 57 # - otherwise convert stdin 58 # subx-pack(Stdin, Stdout) 59 # . . push args - 60 68/push Stdout/imm32 - 61 68/push Stdin/imm32 + 60 68/push Stdout/imm32 + 61 68/push Stdin/imm32 62 # . . call 63 e8/call subx-pack/disp32 64 # . . discard args @@ -198,7 +198,7 @@ if ('onhashchange' in window) { 136 # . . push args 137 51/push-ecx 138 # . . call - 139 e8/call clear-stream/disp32 + 139 e8/call clear-stream/disp32 140 # . . discard args 141 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 142 # read-line-buffered(in, line) @@ -206,7 +206,7 @@ if ('onhashchange' in window) { 144 51/push-ecx 145 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 146 # . . call - 147 e8/call read-line-buffered/disp32 + 147 e8/call read-line-buffered/disp32 148 # . . discard args 149 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 150 $subx-pack:check0: @@ -219,7 +219,7 @@ if ('onhashchange' in window) { 182 52/push-edx 183 51/push-ecx 184 # . . call - 185 e8/call next-word/disp32 + 185 e8/call next-word/disp32 186 # . . discard args 187 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 188 $subx-pack:check1: @@ -228,7 +228,7 @@ if ('onhashchange' in window) { 191 # . . push args 192 52/push-edx 193 # . . call - 194 e8/call slice-empty?/disp32 + 194 e8/call slice-empty?/disp32 195 # . . discard args 196 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 197 # . if (eax != false) write-stream-data(out, line) @@ -242,7 +242,7 @@ if ('onhashchange' in window) { 244 68/push "=="/imm32 245 52/push-edx 246 # . . call - 247 e8/call slice-equal?/disp32 + 247 e8/call slice-equal?/disp32 248 # . . discard args 249 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 250 # . if (eax == false) goto check3 @@ -253,7 +253,7 @@ if ('onhashchange' in window) { 255 52/push-edx 256 51/push-ecx 257 # . . call - 258 e8/call next-word/disp32 + 258 e8/call next-word/disp32 259 # . . discard args 260 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 261 +-- 40 lines: #? # dump segment name ------------------------------------------------------------------------------------------------------------------------------------------------ @@ -262,7 +262,7 @@ if ('onhashchange' in window) { 303 68/push "code"/imm32 304 52/push-edx 305 # . . call - 306 e8/call slice-equal?/disp32 + 306 e8/call slice-equal?/disp32 307 # . . discard args 308 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 309 # . . in-code? = eax @@ -275,7 +275,7 @@ if ('onhashchange' in window) { 316 # . . push args 317 51/push-ecx 318 # . . call - 319 e8/call rewind-stream/disp32 + 319 e8/call rewind-stream/disp32 320 # . . discard args 321 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 322 # if (in-code? != false) convert-instruction(line, out) @@ -309,7 +309,7 @@ if ('onhashchange' in window) { 350 51/push-ecx 351 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 352 # . . call - 353 e8/call write-stream-data/disp32 + 353 e8/call write-stream-data/disp32 354 # . . discard args 355 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 356 # . loop @@ -319,7 +319,7 @@ if ('onhashchange' in window) { 360 # . . push args 361 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 362 # . . call - 363 e8/call flush/disp32 + 363 e8/call flush/disp32 364 # . . discard args 365 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 366 $subx-pack:end: @@ -343,37 +343,37 @@ if ('onhashchange' in window) { 384 # setup 385 # . clear-stream(_test-input-stream) 386 # . . push args - 387 68/push _test-input-stream/imm32 + 387 68/push _test-input-stream/imm32 388 # . . call - 389 e8/call clear-stream/disp32 + 389 e8/call clear-stream/disp32 390 # . . discard args 391 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 392 # . clear-stream($_test-input-buffered-file->buffer) 393 # . . push args 394 68/push $_test-input-buffered-file->buffer/imm32 395 # . . call - 396 e8/call clear-stream/disp32 + 396 e8/call clear-stream/disp32 397 # . . discard args 398 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 399 # . clear-stream(_test-output-stream) 400 # . . push args - 401 68/push _test-output-stream/imm32 + 401 68/push _test-output-stream/imm32 402 # . . call - 403 e8/call clear-stream/disp32 + 403 e8/call clear-stream/disp32 404 # . . discard args 405 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 406 # . clear-stream($_test-output-buffered-file->buffer) 407 # . . push args 408 68/push $_test-output-buffered-file->buffer/imm32 409 # . . call - 410 e8/call clear-stream/disp32 + 410 e8/call clear-stream/disp32 411 # . . discard args 412 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 413 # write nothing to input 414 # subx-pack(_test-input-buffered-file, _test-output-buffered-file) 415 # . . push args - 416 68/push _test-output-buffered-file/imm32 - 417 68/push _test-input-buffered-file/imm32 + 416 68/push _test-output-buffered-file/imm32 + 417 68/push _test-input-buffered-file/imm32 418 # . . call 419 e8/call subx-pack/disp32 420 # . . discard args @@ -381,18 +381,18 @@ if ('onhashchange' in window) { 422 # check that the line just passed through 423 # . flush(_test-output-buffered-file) 424 # . . push args - 425 68/push _test-output-buffered-file/imm32 + 425 68/push _test-output-buffered-file/imm32 426 # . . call - 427 e8/call flush/disp32 + 427 e8/call flush/disp32 428 # . . discard args 429 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 430 # . check-stream-equal(_test-output-stream, "", msg) 431 # . . push args 432 68/push "F - test-subx-pack-passes-empty-lines-through"/imm32 433 68/push ""/imm32 - 434 68/push _test-output-stream/imm32 + 434 68/push _test-output-stream/imm32 435 # . . call - 436 e8/call check-stream-equal/disp32 + 436 e8/call check-stream-equal/disp32 437 # . . discard args 438 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 439 # . epilogue @@ -408,45 +408,45 @@ if ('onhashchange' in window) { 449 # setup 450 # . clear-stream(_test-input-stream) 451 # . . push args - 452 68/push _test-input-stream/imm32 + 452 68/push _test-input-stream/imm32 453 # . . call - 454 e8/call clear-stream/disp32 + 454 e8/call clear-stream/disp32 455 # . . discard args 456 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 457 # . clear-stream($_test-input-buffered-file->buffer) 458 # . . push args 459 68/push $_test-input-buffered-file->buffer/imm32 460 # . . call - 461 e8/call clear-stream/disp32 + 461 e8/call clear-stream/disp32 462 # . . discard args 463 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 464 # . clear-stream(_test-output-stream) 465 # . . push args - 466 68/push _test-output-stream/imm32 + 466 68/push _test-output-stream/imm32 467 # . . call - 468 e8/call clear-stream/disp32 + 468 e8/call clear-stream/disp32 469 # . . discard args 470 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 471 # . clear-stream($_test-output-buffered-file->buffer) 472 # . . push args 473 68/push $_test-output-buffered-file->buffer/imm32 474 # . . call - 475 e8/call clear-stream/disp32 + 475 e8/call clear-stream/disp32 476 # . . discard args 477 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 478 # initialize input 479 # . write(_test-input-stream, " ") 480 # . . push args 481 68/push " "/imm32 - 482 68/push _test-input-stream/imm32 + 482 68/push _test-input-stream/imm32 483 # . . call - 484 e8/call write/disp32 + 484 e8/call write/disp32 485 # . . discard args 486 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 487 # subx-pack(_test-input-buffered-file, _test-output-buffered-file) 488 # . . push args - 489 68/push _test-output-buffered-file/imm32 - 490 68/push _test-input-buffered-file/imm32 + 489 68/push _test-output-buffered-file/imm32 + 490 68/push _test-input-buffered-file/imm32 491 # . . call 492 e8/call subx-pack/disp32 493 # . . discard args @@ -454,18 +454,18 @@ if ('onhashchange' in window) { 495 # check that the line just passed through 496 # . flush(_test-output-buffered-file) 497 # . . push args - 498 68/push _test-output-buffered-file/imm32 + 498 68/push _test-output-buffered-file/imm32 499 # . . call - 500 e8/call flush/disp32 + 500 e8/call flush/disp32 501 # . . discard args 502 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 503 # . check-next-stream-line-equal(_test-output-stream, " ", msg) 504 # . . push args 505 68/push "F - test-subx-pack-passes-with-just-whitespace-through"/imm32 506 68/push " "/imm32 - 507 68/push _test-output-stream/imm32 + 507 68/push _test-output-stream/imm32 508 # . . call - 509 e8/call check-next-stream-line-equal/disp32 + 509 e8/call check-next-stream-line-equal/disp32 510 # . . discard args 511 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 512 # . epilogue @@ -481,45 +481,45 @@ if ('onhashchange' in window) { 522 # setup 523 # . clear-stream(_test-input-stream) 524 # . . push args - 525 68/push _test-input-stream/imm32 + 525 68/push _test-input-stream/imm32 526 # . . call - 527 e8/call clear-stream/disp32 + 527 e8/call clear-stream/disp32 528 # . . discard args 529 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 530 # . clear-stream($_test-input-buffered-file->buffer) 531 # . . push args 532 68/push $_test-input-buffered-file->buffer/imm32 533 # . . call - 534 e8/call clear-stream/disp32 + 534 e8/call clear-stream/disp32 535 # . . discard args 536 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 537 # . clear-stream(_test-output-stream) 538 # . . push args - 539 68/push _test-output-stream/imm32 + 539 68/push _test-output-stream/imm32 540 # . . call - 541 e8/call clear-stream/disp32 + 541 e8/call clear-stream/disp32 542 # . . discard args 543 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 544 # . clear-stream($_test-output-buffered-file->buffer) 545 # . . push args 546 68/push $_test-output-buffered-file->buffer/imm32 547 # . . call - 548 e8/call clear-stream/disp32 + 548 e8/call clear-stream/disp32 549 # . . discard args 550 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 551 # initialize input 552 # . write(_test-input-stream, "== abcd 0x1") 553 # . . push args 554 68/push "== abcd 0x1"/imm32 - 555 68/push _test-input-stream/imm32 + 555 68/push _test-input-stream/imm32 556 # . . call - 557 e8/call write/disp32 + 557 e8/call write/disp32 558 # . . discard args 559 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 560 # subx-pack(_test-input-buffered-file, _test-output-buffered-file) 561 # . . push args - 562 68/push _test-output-buffered-file/imm32 - 563 68/push _test-input-buffered-file/imm32 + 562 68/push _test-output-buffered-file/imm32 + 563 68/push _test-input-buffered-file/imm32 564 # . . call 565 e8/call subx-pack/disp32 566 # . . discard args @@ -527,18 +527,18 @@ if ('onhashchange' in window) { 568 # check that the line just passed through 569 # . flush(_test-output-buffered-file) 570 # . . push args - 571 68/push _test-output-buffered-file/imm32 + 571 68/push _test-output-buffered-file/imm32 572 # . . call - 573 e8/call flush/disp32 + 573 e8/call flush/disp32 574 # . . discard args 575 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 576 # . check-stream-equal(_test-output-stream, "== abcd 0x1", msg) 577 # . . push args 578 68/push "F - test-subx-pack-passes-segment-headers-through"/imm32 579 68/push "== abcd 0x1"/imm32 - 580 68/push _test-output-stream/imm32 + 580 68/push _test-output-stream/imm32 581 # . . call - 582 e8/call check-stream-equal/disp32 + 582 e8/call check-stream-equal/disp32 583 # . . discard args 584 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 585 # . epilogue @@ -554,30 +554,30 @@ if ('onhashchange' in window) { 595 # setup 596 # . clear-stream(_test-input-stream) 597 # . . push args - 598 68/push _test-input-stream/imm32 + 598 68/push _test-input-stream/imm32 599 # . . call - 600 e8/call clear-stream/disp32 + 600 e8/call clear-stream/disp32 601 # . . discard args 602 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 603 # . clear-stream($_test-input-buffered-file->buffer) 604 # . . push args 605 68/push $_test-input-buffered-file->buffer/imm32 606 # . . call - 607 e8/call clear-stream/disp32 + 607 e8/call clear-stream/disp32 608 # . . discard args 609 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 610 # . clear-stream(_test-output-stream) 611 # . . push args - 612 68/push _test-output-stream/imm32 + 612 68/push _test-output-stream/imm32 613 # . . call - 614 e8/call clear-stream/disp32 + 614 e8/call clear-stream/disp32 615 # . . discard args 616 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 617 # . clear-stream($_test-output-buffered-file->buffer) 618 # . . push args 619 68/push $_test-output-buffered-file->buffer/imm32 620 # . . call - 621 e8/call clear-stream/disp32 + 621 e8/call clear-stream/disp32 622 # . . discard args 623 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 624 # initialize input @@ -587,31 +587,31 @@ if ('onhashchange' in window) { 628 # . write(_test-input-stream, "== code 0x1") 629 # . . push args 630 68/push "== code 0x1\n"/imm32 - 631 68/push _test-input-stream/imm32 + 631 68/push _test-input-stream/imm32 632 # . . call - 633 e8/call write/disp32 + 633 e8/call write/disp32 634 # . . discard args 635 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 636 # . write(_test-input-stream, "== data 0x2\n") 637 # . . push args 638 68/push "== data 0x2\n"/imm32 - 639 68/push _test-input-stream/imm32 + 639 68/push _test-input-stream/imm32 640 # . . call - 641 e8/call write/disp32 + 641 e8/call write/disp32 642 # . . discard args 643 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 644 # . write(_test-input-stream, "3 4/imm32\n") 645 # . . push args 646 68/push "3 4/imm32\n"/imm32 - 647 68/push _test-input-stream/imm32 + 647 68/push _test-input-stream/imm32 648 # . . call - 649 e8/call write/disp32 + 649 e8/call write/disp32 650 # . . discard args 651 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 652 # subx-pack(_test-input-buffered-file, _test-output-buffered-file) 653 # . . push args - 654 68/push _test-output-buffered-file/imm32 - 655 68/push _test-input-buffered-file/imm32 + 654 68/push _test-output-buffered-file/imm32 + 655 68/push _test-input-buffered-file/imm32 656 # . . call 657 e8/call subx-pack/disp32 658 # . . discard args @@ -620,36 +620,36 @@ if ('onhashchange' in window) { 661 +-- 26 lines: #? # debug print ------------------------------------------------------------------------------------------------------------------------------------------------------ 687 # . flush(_test-output-buffered-file) 688 # . . push args - 689 68/push _test-output-buffered-file/imm32 + 689 68/push _test-output-buffered-file/imm32 690 # . . call - 691 e8/call flush/disp32 + 691 e8/call flush/disp32 692 # . . discard args 693 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 694 # . check-next-stream-line-equal(_test-output-stream, "== code 0x1", msg) 695 # . . push args 696 68/push "F - test-subx-pack-in-data-segment/0"/imm32 697 68/push "== code 0x1"/imm32 - 698 68/push _test-output-stream/imm32 + 698 68/push _test-output-stream/imm32 699 # . . call - 700 e8/call check-next-stream-line-equal/disp32 + 700 e8/call check-next-stream-line-equal/disp32 701 # . . discard args 702 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 703 # . check-next-stream-line-equal(_test-output-stream, "== data 0x2", msg) 704 # . . push args 705 68/push "F - test-subx-pack-in-data-segment/1"/imm32 706 68/push "== data 0x2"/imm32 - 707 68/push _test-output-stream/imm32 + 707 68/push _test-output-stream/imm32 708 # . . call - 709 e8/call check-next-stream-line-equal/disp32 + 709 e8/call check-next-stream-line-equal/disp32 710 # . . discard args 711 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 712 # . check-next-stream-line-equal(_test-output-stream, "03 04 00 00 00 ", msg) 713 # . . push args 714 68/push "F - test-subx-pack-in-data-segment/2"/imm32 715 68/push "03 04 00 00 00 "/imm32 - 716 68/push _test-output-stream/imm32 + 716 68/push _test-output-stream/imm32 717 # . . call - 718 e8/call check-next-stream-line-equal/disp32 + 718 e8/call check-next-stream-line-equal/disp32 719 # . . discard args 720 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 721 # . epilogue @@ -665,30 +665,30 @@ if ('onhashchange' in window) { 731 # setup 732 # . clear-stream(_test-input-stream) 733 # . . push args - 734 68/push _test-input-stream/imm32 + 734 68/push _test-input-stream/imm32 735 # . . call - 736 e8/call clear-stream/disp32 + 736 e8/call clear-stream/disp32 737 # . . discard args 738 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 739 # . clear-stream($_test-input-buffered-file->buffer) 740 # . . push args 741 68/push $_test-input-buffered-file->buffer/imm32 742 # . . call - 743 e8/call clear-stream/disp32 + 743 e8/call clear-stream/disp32 744 # . . discard args 745 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 746 # . clear-stream(_test-output-stream) 747 # . . push args - 748 68/push _test-output-stream/imm32 + 748 68/push _test-output-stream/imm32 749 # . . call - 750 e8/call clear-stream/disp32 + 750 e8/call clear-stream/disp32 751 # . . discard args 752 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 753 # . clear-stream($_test-output-buffered-file->buffer) 754 # . . push args 755 68/push $_test-output-buffered-file->buffer/imm32 756 # . . call - 757 e8/call clear-stream/disp32 + 757 e8/call clear-stream/disp32 758 # . . discard args 759 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 760 # initialize input @@ -700,47 +700,47 @@ if ('onhashchange' in window) { 766 # . write(_test-input-stream, "== code 0x1\n") 767 # . . push args 768 68/push "== code 0x1\n"/imm32 - 769 68/push _test-input-stream/imm32 + 769 68/push _test-input-stream/imm32 770 # . . call - 771 e8/call write/disp32 + 771 e8/call write/disp32 772 # . . discard args 773 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 774 # . write(_test-input-stream, "e8/call 20/disp32\n") 775 # . . push args 776 68/push "e8/call 20/disp32\n"/imm32 - 777 68/push _test-input-stream/imm32 + 777 68/push _test-input-stream/imm32 778 # . . call - 779 e8/call write/disp32 + 779 e8/call write/disp32 780 # . . discard args 781 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 782 # . write(_test-input-stream, "68/push 0x20/imm8\n") 783 # . . push args 784 68/push "68/push 0x20/imm8\n"/imm32 - 785 68/push _test-input-stream/imm32 + 785 68/push _test-input-stream/imm32 786 # . . call - 787 e8/call write/disp32 + 787 e8/call write/disp32 788 # . . discard args 789 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 790 # . write(_test-input-stream, "== data 0x2\n") 791 # . . push args 792 68/push "== data 0x2\n"/imm32 - 793 68/push _test-input-stream/imm32 + 793 68/push _test-input-stream/imm32 794 # . . call - 795 e8/call write/disp32 + 795 e8/call write/disp32 796 # . . discard args 797 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 798 # . write(_test-input-stream, "3 4/imm32\n") 799 # . . push args 800 68/push "3 4/imm32\n"/imm32 - 801 68/push _test-input-stream/imm32 + 801 68/push _test-input-stream/imm32 802 # . . call - 803 e8/call write/disp32 + 803 e8/call write/disp32 804 # . . discard args 805 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 806 # subx-pack(_test-input-buffered-file, _test-output-buffered-file) 807 # . . push args - 808 68/push _test-output-buffered-file/imm32 - 809 68/push _test-input-buffered-file/imm32 + 808 68/push _test-output-buffered-file/imm32 + 809 68/push _test-input-buffered-file/imm32 810 # . . call 811 e8/call subx-pack/disp32 812 # . . discard args @@ -754,54 +754,54 @@ if ('onhashchange' in window) { 820 +-- 26 lines: #? # debug print ------------------------------------------------------------------------------------------------------------------------------------------------------ 846 # . flush(_test-output-buffered-file) 847 # . . push args - 848 68/push _test-output-buffered-file/imm32 + 848 68/push _test-output-buffered-file/imm32 849 # . . call - 850 e8/call flush/disp32 + 850 e8/call flush/disp32 851 # . . discard args 852 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 853 # . check-next-stream-line-equal(_test-output-stream, "== code 0x1", msg) 854 # . . push args 855 68/push "F - test-subx-pack-code-and-data-segments/0"/imm32 856 68/push "== code 0x1"/imm32 - 857 68/push _test-output-stream/imm32 + 857 68/push _test-output-stream/imm32 858 # . . call - 859 e8/call check-next-stream-line-equal/disp32 + 859 e8/call check-next-stream-line-equal/disp32 860 # . . discard args 861 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 862 # . check-next-stream-line-equal(_test-output-stream, "e8 20 00 00 00 # e8/call 20/disp32", msg) 863 # . . push args 864 68/push "F - test-subx-pack-code-and-data-segments/1"/imm32 865 68/push "e8 20 00 00 00 # e8/call 20/disp32"/imm32 - 866 68/push _test-output-stream/imm32 + 866 68/push _test-output-stream/imm32 867 # . . call - 868 e8/call check-next-stream-line-equal/disp32 + 868 e8/call check-next-stream-line-equal/disp32 869 # . . discard args 870 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 871 # . check-next-stream-line-equal(_test-output-stream, "68 20 # 68/push 0x20/imm8", msg) 872 # . . push args 873 68/push "F - test-subx-pack-code-and-data-segments/2"/imm32 874 68/push "68 20 # 68/push 0x20/imm8"/imm32 - 875 68/push _test-output-stream/imm32 + 875 68/push _test-output-stream/imm32 876 # . . call - 877 e8/call check-next-stream-line-equal/disp32 + 877 e8/call check-next-stream-line-equal/disp32 878 # . . discard args 879 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 880 # . check-next-stream-line-equal(_test-output-stream, "== data 0x2", msg) 881 # . . push args 882 68/push "F - test-subx-pack-code-and-data-segments/3"/imm32 883 68/push "== data 0x2"/imm32 - 884 68/push _test-output-stream/imm32 + 884 68/push _test-output-stream/imm32 885 # . . call - 886 e8/call check-next-stream-line-equal/disp32 + 886 e8/call check-next-stream-line-equal/disp32 887 # . . discard args 888 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 889 # . check-next-stream-line-equal(_test-output-stream, "03 04 00 00 00 ", msg) 890 # . . push args 891 68/push "F - test-subx-pack-code-and-data-segments/4"/imm32 892 68/push "03 04 00 00 00 "/imm32 - 893 68/push _test-output-stream/imm32 + 893 68/push _test-output-stream/imm32 894 # . . call - 895 e8/call check-next-stream-line-equal/disp32 + 895 e8/call check-next-stream-line-equal/disp32 896 # . . discard args 897 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 898 # . epilogue @@ -847,7 +847,7 @@ if ('onhashchange' in window) { 963 51/push-ecx 964 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 965 # . . call - 966 e8/call next-word/disp32 + 966 e8/call next-word/disp32 967 # . . discard args 968 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 969 +-- 40 lines: #? # dump word-slice -------------------------------------------------------------------------------------------------------------------------------------------------- @@ -857,7 +857,7 @@ if ('onhashchange' in window) { 1012 # . . push args 1013 51/push-ecx 1014 # . . call -1015 e8/call slice-empty?/disp32 +1015 e8/call slice-empty?/disp32 1016 # . . discard args 1017 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1018 # . if (eax != false) break @@ -879,7 +879,7 @@ if ('onhashchange' in window) { 1034 51/push-ecx 1035 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 1036 # . . call -1037 e8/call write-slice-buffered/disp32 +1037 e8/call write-slice-buffered/disp32 1038 # . . discard args 1039 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1040 # return @@ -900,7 +900,7 @@ if ('onhashchange' in window) { 1055 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 1056 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 1057 # . . call -1058 e8/call write-stream-data/disp32 +1058 e8/call write-stream-data/disp32 1059 # . . discard args 1060 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1061 # return @@ -912,7 +912,7 @@ if ('onhashchange' in window) { 1067 68/push "imm32"/imm32 1068 51/push-ecx 1069 # . . call -1070 e8/call has-metadata?/disp32 +1070 e8/call has-metadata?/disp32 1071 # . . discard args 1072 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1073 # . if (eax == false) process as a single byte @@ -925,7 +925,7 @@ if ('onhashchange' in window) { 1080 51/push-ecx 1081 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 1082 # . . call -1083 e8/call emit/disp32 +1083 e8/call emit/disp32 1084 # . . discard args 1085 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1086 e9/jump $convert-data:loop/disp32 @@ -936,17 +936,17 @@ if ('onhashchange' in window) { 1091 51/push-ecx 1092 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 1093 # . . call -1094 e8/call emit/disp32 +1094 e8/call emit/disp32 1095 # . . discard args 1096 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1097 e9/jump $convert-data:loop/disp32 1098 $convert-data:break: 1099 # write-buffered(out, "\n") 1100 # . . push args -1101 68/push Newline/imm32 +1101 68/push Newline/imm32 1102 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 1103 # . . call -1104 e8/call write-buffered/disp32 +1104 e8/call write-buffered/disp32 1105 # . . discard args 1106 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1107 $convert-data:end: @@ -969,38 +969,38 @@ if ('onhashchange' in window) { 1124 # setup 1125 # . clear-stream(_test-input-stream) 1126 # . . push args -1127 68/push _test-input-stream/imm32 +1127 68/push _test-input-stream/imm32 1128 # . . call -1129 e8/call clear-stream/disp32 +1129 e8/call clear-stream/disp32 1130 # . . discard args 1131 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1132 # . clear-stream(_test-output-stream) 1133 # . . push args -1134 68/push _test-output-stream/imm32 +1134 68/push _test-output-stream/imm32 1135 # . . call -1136 e8/call clear-stream/disp32 +1136 e8/call clear-stream/disp32 1137 # . . discard args 1138 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1139 # . clear-stream($_test-output-buffered-file->buffer) 1140 # . . push args 1141 68/push $_test-output-buffered-file->buffer/imm32 1142 # . . call -1143 e8/call clear-stream/disp32 +1143 e8/call clear-stream/disp32 1144 # . . discard args 1145 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1146 # initialize input 1147 # . write(_test-input-stream, "# abcd") 1148 # . . push args 1149 68/push "# abcd"/imm32 -1150 68/push _test-input-stream/imm32 +1150 68/push _test-input-stream/imm32 1151 # . . call -1152 e8/call write/disp32 +1152 e8/call write/disp32 1153 # . . discard args 1154 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1155 # convert-data(_test-input-stream, _test-output-buffered-file) 1156 # . . push args -1157 68/push _test-output-buffered-file/imm32 -1158 68/push _test-input-stream/imm32 +1157 68/push _test-output-buffered-file/imm32 +1158 68/push _test-input-stream/imm32 1159 # . . call 1160 e8/call convert-data/disp32 1161 # . . discard args @@ -1008,9 +1008,9 @@ if ('onhashchange' in window) { 1163 # check that the line just passed through 1164 # . flush(_test-output-buffered-file) 1165 # . . push args -1166 68/push _test-output-buffered-file/imm32 +1166 68/push _test-output-buffered-file/imm32 1167 # . . call -1168 e8/call flush/disp32 +1168 e8/call flush/disp32 1169 # . . discard args 1170 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1171 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -1018,9 +1018,9 @@ if ('onhashchange' in window) { 1198 # . . push args 1199 68/push "F - test-convert-data-passes-comments-through"/imm32 1200 68/push "# abcd"/imm32 -1201 68/push _test-output-stream/imm32 +1201 68/push _test-output-stream/imm32 1202 # . . call -1203 e8/call check-stream-equal/disp32 +1203 e8/call check-stream-equal/disp32 1204 # . . discard args 1205 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1206 # . epilogue @@ -1036,38 +1036,38 @@ if ('onhashchange' in window) { 1216 # setup 1217 # . clear-stream(_test-input-stream) 1218 # . . push args -1219 68/push _test-input-stream/imm32 +1219 68/push _test-input-stream/imm32 1220 # . . call -1221 e8/call clear-stream/disp32 +1221 e8/call clear-stream/disp32 1222 # . . discard args 1223 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1224 # . clear-stream(_test-output-stream) 1225 # . . push args -1226 68/push _test-output-stream/imm32 +1226 68/push _test-output-stream/imm32 1227 # . . call -1228 e8/call clear-stream/disp32 +1228 e8/call clear-stream/disp32 1229 # . . discard args 1230 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1231 # . clear-stream($_test-output-buffered-file->buffer) 1232 # . . push args 1233 68/push $_test-output-buffered-file->buffer/imm32 1234 # . . call -1235 e8/call clear-stream/disp32 +1235 e8/call clear-stream/disp32 1236 # . . discard args 1237 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1238 # initialize input 1239 # . write(_test-input-stream, "ab: # cd") 1240 # . . push args 1241 68/push "ab: # cd"/imm32 -1242 68/push _test-input-stream/imm32 +1242 68/push _test-input-stream/imm32 1243 # . . call -1244 e8/call write/disp32 +1244 e8/call write/disp32 1245 # . . discard args 1246 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1247 # convert-data(_test-input-stream, _test-output-buffered-file) 1248 # . . push args -1249 68/push _test-output-buffered-file/imm32 -1250 68/push _test-input-stream/imm32 +1249 68/push _test-output-buffered-file/imm32 +1250 68/push _test-input-stream/imm32 1251 # . . call 1252 e8/call convert-data/disp32 1253 # . . discard args @@ -1075,18 +1075,18 @@ if ('onhashchange' in window) { 1255 # check that the line just passed through 1256 # . flush(_test-output-buffered-file) 1257 # . . push args -1258 68/push _test-output-buffered-file/imm32 +1258 68/push _test-output-buffered-file/imm32 1259 # . . call -1260 e8/call flush/disp32 +1260 e8/call flush/disp32 1261 # . . discard args 1262 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1263 # . check-stream-equal(_test-output-stream, "ab: # cd", msg) 1264 # . . push args 1265 68/push "F - test-convert-data-passes-labels-through"/imm32 1266 68/push "ab: # cd"/imm32 -1267 68/push _test-output-stream/imm32 +1267 68/push _test-output-stream/imm32 1268 # . . call -1269 e8/call check-stream-equal/disp32 +1269 e8/call check-stream-equal/disp32 1270 # . . discard args 1271 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1272 # . epilogue @@ -1103,38 +1103,38 @@ if ('onhashchange' in window) { 1283 # setup 1284 # . clear-stream(_test-input-stream) 1285 # . . push args -1286 68/push _test-input-stream/imm32 +1286 68/push _test-input-stream/imm32 1287 # . . call -1288 e8/call clear-stream/disp32 +1288 e8/call clear-stream/disp32 1289 # . . discard args 1290 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1291 # . clear-stream(_test-output-stream) 1292 # . . push args -1293 68/push _test-output-stream/imm32 +1293 68/push _test-output-stream/imm32 1294 # . . call -1295 e8/call clear-stream/disp32 +1295 e8/call clear-stream/disp32 1296 # . . discard args 1297 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1298 # . clear-stream($_test-output-buffered-file->buffer) 1299 # . . push args 1300 68/push $_test-output-buffered-file->buffer/imm32 1301 # . . call -1302 e8/call clear-stream/disp32 +1302 e8/call clear-stream/disp32 1303 # . . discard args 1304 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1305 # initialize input 1306 # . write(_test-input-stream, "abcd/imm32") 1307 # . . push args 1308 68/push "abcd/imm32"/imm32 -1309 68/push _test-input-stream/imm32 +1309 68/push _test-input-stream/imm32 1310 # . . call -1311 e8/call write/disp32 +1311 e8/call write/disp32 1312 # . . discard args 1313 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1314 # convert-data(_test-input-stream, _test-output-buffered-file) 1315 # . . push args -1316 68/push _test-output-buffered-file/imm32 -1317 68/push _test-input-stream/imm32 +1316 68/push _test-output-buffered-file/imm32 +1317 68/push _test-input-stream/imm32 1318 # . . call 1319 e8/call convert-data/disp32 1320 # . . discard args @@ -1142,18 +1142,18 @@ if ('onhashchange' in window) { 1322 # check that the line just passed through 1323 # . flush(_test-output-buffered-file) 1324 # . . push args -1325 68/push _test-output-buffered-file/imm32 +1325 68/push _test-output-buffered-file/imm32 1326 # . . call -1327 e8/call flush/disp32 +1327 e8/call flush/disp32 1328 # . . discard args 1329 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1330 # . check-stream-equal(_test-output-stream, "abcd/imm32 \n", msg) 1331 # . . push args 1332 68/push "F - test-convert-data-passes-names-through"/imm32 1333 68/push "abcd/imm32 \n"/imm32 -1334 68/push _test-output-stream/imm32 +1334 68/push _test-output-stream/imm32 1335 # . . call -1336 e8/call check-stream-equal/disp32 +1336 e8/call check-stream-equal/disp32 1337 # . . discard args 1338 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1339 # . epilogue @@ -1169,38 +1169,38 @@ if ('onhashchange' in window) { 1349 # setup 1350 # . clear-stream(_test-input-stream) 1351 # . . push args -1352 68/push _test-input-stream/imm32 +1352 68/push _test-input-stream/imm32 1353 # . . call -1354 e8/call clear-stream/disp32 +1354 e8/call clear-stream/disp32 1355 # . . discard args 1356 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1357 # . clear-stream(_test-output-stream) 1358 # . . push args -1359 68/push _test-output-stream/imm32 +1359 68/push _test-output-stream/imm32 1360 # . . call -1361 e8/call clear-stream/disp32 +1361 e8/call clear-stream/disp32 1362 # . . discard args 1363 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1364 # . clear-stream($_test-output-buffered-file->buffer) 1365 # . . push args 1366 68/push $_test-output-buffered-file->buffer/imm32 1367 # . . call -1368 e8/call clear-stream/disp32 +1368 e8/call clear-stream/disp32 1369 # . . discard args 1370 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1371 # initialize input 1372 # . write(_test-input-stream, "30/imm32") 1373 # . . push args 1374 68/push "30/imm32"/imm32 -1375 68/push _test-input-stream/imm32 +1375 68/push _test-input-stream/imm32 1376 # . . call -1377 e8/call write/disp32 +1377 e8/call write/disp32 1378 # . . discard args 1379 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1380 # convert-data(_test-input-stream, _test-output-buffered-file) 1381 # . . push args -1382 68/push _test-output-buffered-file/imm32 -1383 68/push _test-input-stream/imm32 +1382 68/push _test-output-buffered-file/imm32 +1383 68/push _test-input-stream/imm32 1384 # . . call 1385 e8/call convert-data/disp32 1386 # . . discard args @@ -1208,18 +1208,18 @@ if ('onhashchange' in window) { 1388 # check that 4 bytes were written 1389 # . flush(_test-output-buffered-file) 1390 # . . push args -1391 68/push _test-output-buffered-file/imm32 +1391 68/push _test-output-buffered-file/imm32 1392 # . . call -1393 e8/call flush/disp32 +1393 e8/call flush/disp32 1394 # . . discard args 1395 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1396 # . check-stream-equal(_test-output-stream, "30 00 00 00 \n", msg) 1397 # . . push args 1398 68/push "F - test-convert-data-handles-imm32"/imm32 1399 68/push "30 00 00 00 \n"/imm32 -1400 68/push _test-output-stream/imm32 +1400 68/push _test-output-stream/imm32 1401 # . . call -1402 e8/call check-stream-equal/disp32 +1402 e8/call check-stream-equal/disp32 1403 # . . discard args 1404 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1405 # . epilogue @@ -1236,38 +1236,38 @@ if ('onhashchange' in window) { 1416 # setup 1417 # . clear-stream(_test-input-stream) 1418 # . . push args -1419 68/push _test-input-stream/imm32 +1419 68/push _test-input-stream/imm32 1420 # . . call -1421 e8/call clear-stream/disp32 +1421 e8/call clear-stream/disp32 1422 # . . discard args 1423 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1424 # . clear-stream(_test-output-stream) 1425 # . . push args -1426 68/push _test-output-stream/imm32 +1426 68/push _test-output-stream/imm32 1427 # . . call -1428 e8/call clear-stream/disp32 +1428 e8/call clear-stream/disp32 1429 # . . discard args 1430 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1431 # . clear-stream($_test-output-buffered-file->buffer) 1432 # . . push args 1433 68/push $_test-output-buffered-file->buffer/imm32 1434 # . . call -1435 e8/call clear-stream/disp32 +1435 e8/call clear-stream/disp32 1436 # . . discard args 1437 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1438 # initialize input 1439 # . write(_test-input-stream, "30/imm16") 1440 # . . push args 1441 68/push "30/imm16"/imm32 -1442 68/push _test-input-stream/imm32 +1442 68/push _test-input-stream/imm32 1443 # . . call -1444 e8/call write/disp32 +1444 e8/call write/disp32 1445 # . . discard args 1446 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1447 # convert-data(_test-input-stream, _test-output-buffered-file) 1448 # . . push args -1449 68/push _test-output-buffered-file/imm32 -1450 68/push _test-input-stream/imm32 +1449 68/push _test-output-buffered-file/imm32 +1450 68/push _test-input-stream/imm32 1451 # . . call 1452 e8/call convert-data/disp32 1453 # . . discard args @@ -1275,18 +1275,18 @@ if ('onhashchange' in window) { 1455 # check that a single byte was written (imm16 is not a valid operand type) 1456 # . flush(_test-output-buffered-file) 1457 # . . push args -1458 68/push _test-output-buffered-file/imm32 +1458 68/push _test-output-buffered-file/imm32 1459 # . . call -1460 e8/call flush/disp32 +1460 e8/call flush/disp32 1461 # . . discard args 1462 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1463 # . check-stream-equal(_test-output-stream, "30 \n", msg) 1464 # . . push args 1465 68/push "F - test-convert-data-handles-single-byte"/imm32 1466 68/push "30 \n"/imm32 -1467 68/push _test-output-stream/imm32 +1467 68/push _test-output-stream/imm32 1468 # . . call -1469 e8/call check-stream-equal/disp32 +1469 e8/call check-stream-equal/disp32 1470 # . . discard args 1471 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1472 # . epilogue @@ -1302,38 +1302,38 @@ if ('onhashchange' in window) { 1482 # setup 1483 # . clear-stream(_test-input-stream) 1484 # . . push args -1485 68/push _test-input-stream/imm32 +1485 68/push _test-input-stream/imm32 1486 # . . call -1487 e8/call clear-stream/disp32 +1487 e8/call clear-stream/disp32 1488 # . . discard args 1489 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1490 # . clear-stream(_test-output-stream) 1491 # . . push args -1492 68/push _test-output-stream/imm32 +1492 68/push _test-output-stream/imm32 1493 # . . call -1494 e8/call clear-stream/disp32 +1494 e8/call clear-stream/disp32 1495 # . . discard args 1496 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1497 # . clear-stream($_test-output-buffered-file->buffer) 1498 # . . push args 1499 68/push $_test-output-buffered-file->buffer/imm32 1500 # . . call -1501 e8/call clear-stream/disp32 +1501 e8/call clear-stream/disp32 1502 # . . discard args 1503 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1504 # initialize input 1505 # . write(_test-input-stream, "1 2") 1506 # . . push args 1507 68/push "1 2"/imm32 -1508 68/push _test-input-stream/imm32 +1508 68/push _test-input-stream/imm32 1509 # . . call -1510 e8/call write/disp32 +1510 e8/call write/disp32 1511 # . . discard args 1512 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1513 # convert-data(_test-input-stream, _test-output-buffered-file) 1514 # . . push args -1515 68/push _test-output-buffered-file/imm32 -1516 68/push _test-input-stream/imm32 +1515 68/push _test-output-buffered-file/imm32 +1516 68/push _test-input-stream/imm32 1517 # . . call 1518 e8/call convert-data/disp32 1519 # . . discard args @@ -1341,18 +1341,18 @@ if ('onhashchange' in window) { 1521 # check output 1522 # . flush(_test-output-buffered-file) 1523 # . . push args -1524 68/push _test-output-buffered-file/imm32 +1524 68/push _test-output-buffered-file/imm32 1525 # . . call -1526 e8/call flush/disp32 +1526 e8/call flush/disp32 1527 # . . discard args 1528 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1529 # . check-stream-equal(_test-output-stream, "01 02 \n", msg) 1530 # . . push args 1531 68/push "F - test-convert-data-multiple-bytes"/imm32 1532 68/push "01 02 \n"/imm32 -1533 68/push _test-output-stream/imm32 +1533 68/push _test-output-stream/imm32 1534 # . . call -1535 e8/call check-stream-equal/disp32 +1535 e8/call check-stream-equal/disp32 1536 # . . discard args 1537 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1538 # . epilogue @@ -1368,38 +1368,38 @@ if ('onhashchange' in window) { 1548 # setup 1549 # . clear-stream(_test-input-stream) 1550 # . . push args -1551 68/push _test-input-stream/imm32 +1551 68/push _test-input-stream/imm32 1552 # . . call -1553 e8/call clear-stream/disp32 +1553 e8/call clear-stream/disp32 1554 # . . discard args 1555 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1556 # . clear-stream(_test-output-stream) 1557 # . . push args -1558 68/push _test-output-stream/imm32 +1558 68/push _test-output-stream/imm32 1559 # . . call -1560 e8/call clear-stream/disp32 +1560 e8/call clear-stream/disp32 1561 # . . discard args 1562 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1563 # . clear-stream($_test-output-buffered-file->buffer) 1564 # . . push args 1565 68/push $_test-output-buffered-file->buffer/imm32 1566 # . . call -1567 e8/call clear-stream/disp32 +1567 e8/call clear-stream/disp32 1568 # . . discard args 1569 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1570 # initialize input 1571 # . write(_test-input-stream, "30 abcd/o") 1572 # . . push args 1573 68/push "30 abcd/o"/imm32 -1574 68/push _test-input-stream/imm32 +1574 68/push _test-input-stream/imm32 1575 # . . call -1576 e8/call write/disp32 +1576 e8/call write/disp32 1577 # . . discard args 1578 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1579 # convert-data(_test-input-stream, _test-output-buffered-file) 1580 # . . push args -1581 68/push _test-output-buffered-file/imm32 -1582 68/push _test-input-stream/imm32 +1581 68/push _test-output-buffered-file/imm32 +1582 68/push _test-input-stream/imm32 1583 # . . call 1584 e8/call convert-data/disp32 1585 # . . discard args @@ -1407,18 +1407,18 @@ if ('onhashchange' in window) { 1587 # check output 1588 # . flush(_test-output-buffered-file) 1589 # . . push args -1590 68/push _test-output-buffered-file/imm32 +1590 68/push _test-output-buffered-file/imm32 1591 # . . call -1592 e8/call flush/disp32 +1592 e8/call flush/disp32 1593 # . . discard args 1594 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1595 # . check-stream-equal(_test-output-stream, "30 abcd/o \n", msg) 1596 # . . push args 1597 68/push "F - test-convert-data-byte-then-name"/imm32 1598 68/push "30 abcd/o \n"/imm32 -1599 68/push _test-output-stream/imm32 +1599 68/push _test-output-stream/imm32 1600 # . . call -1601 e8/call check-stream-equal/disp32 +1601 e8/call check-stream-equal/disp32 1602 # . . discard args 1603 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1604 # . epilogue @@ -1434,38 +1434,38 @@ if ('onhashchange' in window) { 1614 # setup 1615 # . clear-stream(_test-input-stream) 1616 # . . push args -1617 68/push _test-input-stream/imm32 +1617 68/push _test-input-stream/imm32 1618 # . . call -1619 e8/call clear-stream/disp32 +1619 e8/call clear-stream/disp32 1620 # . . discard args 1621 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1622 # . clear-stream(_test-output-stream) 1623 # . . push args -1624 68/push _test-output-stream/imm32 +1624 68/push _test-output-stream/imm32 1625 # . . call -1626 e8/call clear-stream/disp32 +1626 e8/call clear-stream/disp32 1627 # . . discard args 1628 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1629 # . clear-stream($_test-output-buffered-file->buffer) 1630 # . . push args 1631 68/push $_test-output-buffered-file->buffer/imm32 1632 # . . call -1633 e8/call clear-stream/disp32 +1633 e8/call clear-stream/disp32 1634 # . . discard args 1635 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1636 # initialize input 1637 # . write(_test-input-stream, "30 abcd/o 42e1/imm32") 1638 # . . push args 1639 68/push "30 abcd/o 42e1/imm32"/imm32 -1640 68/push _test-input-stream/imm32 +1640 68/push _test-input-stream/imm32 1641 # . . call -1642 e8/call write/disp32 +1642 e8/call write/disp32 1643 # . . discard args 1644 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1645 # convert-data(_test-input-stream, _test-output-buffered-file) 1646 # . . push args -1647 68/push _test-output-buffered-file/imm32 -1648 68/push _test-input-stream/imm32 +1647 68/push _test-output-buffered-file/imm32 +1648 68/push _test-input-stream/imm32 1649 # . . call 1650 e8/call convert-data/disp32 1651 # . . discard args @@ -1473,9 +1473,9 @@ if ('onhashchange' in window) { 1653 # check output 1654 # . flush(_test-output-buffered-file) 1655 # . . push args -1656 68/push _test-output-buffered-file/imm32 +1656 68/push _test-output-buffered-file/imm32 1657 # . . call -1658 e8/call flush/disp32 +1658 e8/call flush/disp32 1659 # . . discard args 1660 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1661 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -1483,9 +1483,9 @@ if ('onhashchange' in window) { 1688 # . . push args 1689 68/push "F - test-convert-data-multiple-words"/imm32 1690 68/push "30 abcd/o e1 42 00 00 \n"/imm32 -1691 68/push _test-output-stream/imm32 +1691 68/push _test-output-stream/imm32 1692 # . . call -1693 e8/call check-stream-equal/disp32 +1693 e8/call check-stream-equal/disp32 1694 # . . discard args 1695 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1696 # . epilogue @@ -1501,38 +1501,38 @@ if ('onhashchange' in window) { 1706 # setup 1707 # . clear-stream(_test-input-stream) 1708 # . . push args -1709 68/push _test-input-stream/imm32 +1709 68/push _test-input-stream/imm32 1710 # . . call -1711 e8/call clear-stream/disp32 +1711 e8/call clear-stream/disp32 1712 # . . discard args 1713 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1714 # . clear-stream(_test-output-stream) 1715 # . . push args -1716 68/push _test-output-stream/imm32 +1716 68/push _test-output-stream/imm32 1717 # . . call -1718 e8/call clear-stream/disp32 +1718 e8/call clear-stream/disp32 1719 # . . discard args 1720 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1721 # . clear-stream($_test-output-buffered-file->buffer) 1722 # . . push args 1723 68/push $_test-output-buffered-file->buffer/imm32 1724 # . . call -1725 e8/call clear-stream/disp32 +1725 e8/call clear-stream/disp32 1726 # . . discard args 1727 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1728 # initialize input 1729 # . write(_test-input-stream, "30/imm32 # comment") 1730 # . . push args 1731 68/push "30/imm32 # comment"/imm32 -1732 68/push _test-input-stream/imm32 +1732 68/push _test-input-stream/imm32 1733 # . . call -1734 e8/call write/disp32 +1734 e8/call write/disp32 1735 # . . discard args 1736 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1737 # convert-data(_test-input-stream, _test-output-buffered-file) 1738 # . . push args -1739 68/push _test-output-buffered-file/imm32 -1740 68/push _test-input-stream/imm32 +1739 68/push _test-output-buffered-file/imm32 +1740 68/push _test-input-stream/imm32 1741 # . . call 1742 e8/call convert-data/disp32 1743 # . . discard args @@ -1540,9 +1540,9 @@ if ('onhashchange' in window) { 1745 # check output 1746 # . flush(_test-output-buffered-file) 1747 # . . push args -1748 68/push _test-output-buffered-file/imm32 +1748 68/push _test-output-buffered-file/imm32 1749 # . . call -1750 e8/call flush/disp32 +1750 e8/call flush/disp32 1751 # . . discard args 1752 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1753 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -1550,9 +1550,9 @@ if ('onhashchange' in window) { 1780 # . . push args 1781 68/push "F - test-convert-data-trailing-comment"/imm32 1782 68/push "30 00 00 00 # comment"/imm32 -1783 68/push _test-output-stream/imm32 +1783 68/push _test-output-stream/imm32 1784 # . . call -1785 e8/call check-stream-equal/disp32 +1785 e8/call check-stream-equal/disp32 1786 # . . discard args 1787 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1788 # . epilogue @@ -1607,7 +1607,7 @@ if ('onhashchange' in window) { 1837 51/push-ecx 1838 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 1839 # . . call -1840 e8/call next-word/disp32 +1840 e8/call next-word/disp32 1841 # . . discard args 1842 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1843 $convert-instruction:check0: @@ -1616,7 +1616,7 @@ if ('onhashchange' in window) { 1846 # . . push args 1847 51/push-ecx 1848 # . . call -1849 e8/call slice-empty?/disp32 +1849 e8/call slice-empty?/disp32 1850 # . . discard args 1851 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1852 # . if (eax != false) pass through @@ -1648,7 +1648,7 @@ if ('onhashchange' in window) { 1878 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 1879 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 1880 # . . call -1881 e8/call write-stream-data/disp32 +1881 e8/call write-stream-data/disp32 1882 # . . discard args 1883 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1884 # return @@ -1767,7 +1767,7 @@ if ('onhashchange' in window) { 1997 # . . push args 1998 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 1999 # . . call -2000 e8/call rewind-stream/disp32 +2000 e8/call rewind-stream/disp32 2001 # . . discard args 2002 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 2003 $emit-opcodes:op1: @@ -1776,7 +1776,7 @@ if ('onhashchange' in window) { 2006 51/push-ecx 2007 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 2008 # . . call -2009 e8/call next-word/disp32 +2009 e8/call next-word/disp32 2010 # . . discard args 2011 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2012 # if (slice-empty?(op1)) return @@ -1784,7 +1784,7 @@ if ('onhashchange' in window) { 2014 # . . push args 2015 51/push-ecx 2016 # . . call -2017 e8/call slice-empty?/disp32 +2017 e8/call slice-empty?/disp32 2018 # . . discard args 2019 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 2020 # . if (eax != false) return @@ -1806,7 +1806,7 @@ if ('onhashchange' in window) { 2036 ff 6/subop/push 1/mod/*+disp8 1/rm32/ecx . . . . 4/disp8 . # push *(ecx+4) 2037 ff 6/subop/push 0/mod/indirect 1/rm32/ecx . . . . . . # push *ecx 2038 # . . call -2039 e8/call next-token-from-slice/disp32 +2039 e8/call next-token-from-slice/disp32 2040 # . . discard args 2041 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32 # add to esp 2042 # write-slice-buffered(out, op1) @@ -1814,15 +1814,15 @@ if ('onhashchange' in window) { 2044 51/push-ecx 2045 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 2046 # . . call -2047 e8/call write-slice-buffered/disp32 +2047 e8/call write-slice-buffered/disp32 2048 # . . discard args 2049 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2050 # write-buffered(out, " ") 2051 # . . push args -2052 68/push Space/imm32 +2052 68/push Space/imm32 2053 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 2054 # . . call -2055 e8/call write-buffered/disp32 +2055 e8/call write-buffered/disp32 2056 # . . discard args 2057 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2058 # if (slice-equal?(op1, "0f")) goto op2 @@ -1831,7 +1831,7 @@ if ('onhashchange' in window) { 2061 68/push "0f"/imm32 2062 51/push-ecx 2063 # . . call -2064 e8/call slice-equal?/disp32 +2064 e8/call slice-equal?/disp32 2065 # . . discard args 2066 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2067 # . if (eax != false) goto op2 @@ -1843,7 +1843,7 @@ if ('onhashchange' in window) { 2073 68/push "f2"/imm32 2074 51/push-ecx 2075 # . . call -2076 e8/call slice-equal?/disp32 +2076 e8/call slice-equal?/disp32 2077 # . . discard args 2078 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2079 # . if (eax != false) goto op2 @@ -1855,7 +1855,7 @@ if ('onhashchange' in window) { 2085 68/push "f3"/imm32 2086 51/push-ecx 2087 # . . call -2088 e8/call slice-equal?/disp32 +2088 e8/call slice-equal?/disp32 2089 # . . discard args 2090 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2091 # . if (eax != false) goto op2 @@ -1869,7 +1869,7 @@ if ('onhashchange' in window) { 2099 52/push-edx 2100 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 2101 # . . call -2102 e8/call next-word/disp32 +2102 e8/call next-word/disp32 2103 # . . discard args 2104 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2105 # if (slice-empty?(op2)) return @@ -1877,7 +1877,7 @@ if ('onhashchange' in window) { 2107 # . . push args 2108 52/push-edx 2109 # . . call -2110 e8/call slice-empty?/disp32 +2110 e8/call slice-empty?/disp32 2111 # . . discard args 2112 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 2113 # . if (eax != false) return @@ -1899,7 +1899,7 @@ if ('onhashchange' in window) { 2129 ff 6/subop/push 1/mod/*+disp8 2/rm32/edx . . . . 4/disp8 . # push *(edx+4) 2130 ff 6/subop/push 0/mod/indirect 2/rm32/edx . . . . . . # push *edx 2131 # . . call -2132 e8/call next-token-from-slice/disp32 +2132 e8/call next-token-from-slice/disp32 2133 # . . discard args 2134 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32 # add to esp 2135 # write-slice-buffered(out, op2) @@ -1907,15 +1907,15 @@ if ('onhashchange' in window) { 2137 52/push-edx 2138 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 2139 # . . call -2140 e8/call write-slice-buffered/disp32 +2140 e8/call write-slice-buffered/disp32 2141 # . . discard args 2142 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2143 # write-buffered(out, " ") 2144 # . . push args -2145 68/push Space/imm32 +2145 68/push Space/imm32 2146 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 2147 # . . call -2148 e8/call write-buffered/disp32 +2148 e8/call write-buffered/disp32 2149 # . . discard args 2150 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2151 # if (slice-equal?(op1, "0f")) return @@ -1924,7 +1924,7 @@ if ('onhashchange' in window) { 2154 68/push "0f"/imm32 2155 51/push-ecx 2156 # . . call -2157 e8/call slice-equal?/disp32 +2157 e8/call slice-equal?/disp32 2158 # . . discard args 2159 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2160 # . if (eax != false) return @@ -1936,7 +1936,7 @@ if ('onhashchange' in window) { 2166 68/push "0f"/imm32 2167 52/push-edx 2168 # . . call -2169 e8/call slice-equal?/disp32 +2169 e8/call slice-equal?/disp32 2170 # . . discard args 2171 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2172 # . if (eax == false) return @@ -1948,7 +1948,7 @@ if ('onhashchange' in window) { 2178 52/push-edx 2179 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 2180 # . . call -2181 e8/call next-word/disp32 +2181 e8/call next-word/disp32 2182 # . . discard args 2183 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2184 # if (slice-empty?(op3)) return @@ -1956,7 +1956,7 @@ if ('onhashchange' in window) { 2186 # . . push args 2187 52/push-edx 2188 # . . call -2189 e8/call slice-empty?/disp32 +2189 e8/call slice-empty?/disp32 2190 # . . discard args 2191 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 2192 # . if (eax != false) return @@ -1978,7 +1978,7 @@ if ('onhashchange' in window) { 2208 ff 6/subop/push 1/mod/*+disp8 2/rm32/edx . . . . 4/disp8 . # push *(edx+4) 2209 ff 6/subop/push 0/mod/indirect 2/rm32/edx . . . . . . # push *edx 2210 # . . call -2211 e8/call next-token-from-slice/disp32 +2211 e8/call next-token-from-slice/disp32 2212 # . . discard args 2213 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32 # add to esp 2214 # write-slice-buffered(out, op3) @@ -1986,15 +1986,15 @@ if ('onhashchange' in window) { 2216 52/push-edx 2217 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 2218 # . . call -2219 e8/call write-slice-buffered/disp32 +2219 e8/call write-slice-buffered/disp32 2220 # . . discard args 2221 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2222 # write-buffered(out, " ") 2223 # . . push args -2224 68/push Space/imm32 +2224 68/push Space/imm32 2225 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 2226 # . . call -2227 e8/call write-buffered/disp32 +2227 e8/call write-buffered/disp32 2228 # . . discard args 2229 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2230 $emit-opcodes:end: @@ -2062,7 +2062,7 @@ if ('onhashchange' in window) { 2292 # . . push args 2293 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 2294 # . . call -2295 e8/call rewind-stream/disp32 +2295 e8/call rewind-stream/disp32 2296 # . . discard args 2297 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 2298 +-- 33 lines: #? # dump line -------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -2072,7 +2072,7 @@ if ('onhashchange' in window) { 2334 51/push-ecx 2335 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 2336 # . . call -2337 e8/call next-word/disp32 +2337 e8/call next-word/disp32 2338 # . . discard args 2339 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2340 +-- 40 lines: #? # dump word-slice -------------------------------------------------------------------------------------------------------------------------------------------------- @@ -2082,7 +2082,7 @@ if ('onhashchange' in window) { 2383 # . . push args 2384 51/push-ecx 2385 # . . call -2386 e8/call slice-empty?/disp32 +2386 e8/call slice-empty?/disp32 2387 # . . discard args 2388 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 2389 # . if (eax != false) pass through @@ -2109,7 +2109,7 @@ if ('onhashchange' in window) { 2410 68/push "mod"/imm32 2411 51/push-ecx 2412 # . . call -2413 e8/call has-metadata?/disp32 +2413 e8/call has-metadata?/disp32 2414 # . . discard args 2415 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2416 # . if (eax == false) goto next check @@ -2137,7 +2137,7 @@ if ('onhashchange' in window) { 2438 68/push "rm32"/imm32 2439 51/push-ecx 2440 # . . call -2441 e8/call has-metadata?/disp32 +2441 e8/call has-metadata?/disp32 2442 # . . discard args 2443 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2444 # . if (eax == false) goto next check @@ -2165,7 +2165,7 @@ if ('onhashchange' in window) { 2466 68/push "r32"/imm32 2467 51/push-ecx 2468 # . . call -2469 e8/call has-metadata?/disp32 +2469 e8/call has-metadata?/disp32 2470 # . . discard args 2471 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2472 # . if (eax == false) goto next check @@ -2193,7 +2193,7 @@ if ('onhashchange' in window) { 2494 68/push "subop"/imm32 2495 51/push-ecx 2496 # . . call -2497 e8/call has-metadata?/disp32 +2497 e8/call has-metadata?/disp32 2498 # . . discard args 2499 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2500 # . if (eax == false) loop @@ -2231,14 +2231,14 @@ if ('onhashchange' in window) { 2532 # modrm |= rm32 & 0b111 2533 81 4/subop/and 3/mod/direct 6/rm32/esi . . . . . 7/imm32/0b111 # bitwise and of esi 2534 09/or 3/mod/direct 3/rm32/ebx . . . 6/r32/esi . . # ebx = bitwise OR with esi -2535 $emit-modrm:emit: +2535 $emit-modrm:emit: 2536 # emit-hex(out, modrm, 1) 2537 # . . push args 2538 68/push 1/imm32 2539 53/push-ebx 2540 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 2541 # . . call -2542 e8/call emit-hex/disp32 +2542 e8/call emit-hex/disp32 2543 # . . discard args 2544 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2545 $emit-modrm:end: @@ -2307,7 +2307,7 @@ if ('onhashchange' in window) { 2608 # . . push args 2609 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 2610 # . . call -2611 e8/call rewind-stream/disp32 +2611 e8/call rewind-stream/disp32 2612 # . . discard args 2613 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 2614 $emit-sib:loop: @@ -2317,7 +2317,7 @@ if ('onhashchange' in window) { 2643 51/push-ecx 2644 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 2645 # . . call -2646 e8/call next-word/disp32 +2646 e8/call next-word/disp32 2647 # . . discard args 2648 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2649 +-- 40 lines: #? # dump word-slice -------------------------------------------------------------------------------------------------------------------------------------------------- @@ -2327,7 +2327,7 @@ if ('onhashchange' in window) { 2692 # . . push args 2693 51/push-ecx 2694 # . . call -2695 e8/call slice-empty?/disp32 +2695 e8/call slice-empty?/disp32 2696 # . . discard args 2697 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 2698 # . if (eax != false) pass through @@ -2354,7 +2354,7 @@ if ('onhashchange' in window) { 2719 68/push "scale"/imm32 2720 51/push-ecx 2721 # . . call -2722 e8/call has-metadata?/disp32 +2722 e8/call has-metadata?/disp32 2723 # . . discard args 2724 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2725 # . if (eax == false) goto next check @@ -2382,7 +2382,7 @@ if ('onhashchange' in window) { 2747 68/push "base"/imm32 2748 51/push-ecx 2749 # . . call -2750 e8/call has-metadata?/disp32 +2750 e8/call has-metadata?/disp32 2751 # . . discard args 2752 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2753 # . if (eax == false) goto next check @@ -2410,7 +2410,7 @@ if ('onhashchange' in window) { 2775 68/push "index"/imm32 2776 51/push-ecx 2777 # . . call -2778 e8/call has-metadata?/disp32 +2778 e8/call has-metadata?/disp32 2779 # . . discard args 2780 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2781 # . if (eax == false) loop @@ -2448,14 +2448,14 @@ if ('onhashchange' in window) { 2813 # sib |= base & 0b111 2814 81 4/subop/and 3/mod/direct 6/rm32/esi . . . . . 7/imm32/0b111 # bitwise and of esi 2815 09/or 3/mod/direct 3/rm32/ebx . . . 6/r32/esi . . # ebx = bitwise OR with esi -2816 $emit-sib:emit: +2816 $emit-sib:emit: 2817 # emit-hex(out, sib, 1) 2818 # . . push args 2819 68/push 1/imm32 2820 53/push-ebx 2821 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 2822 # . . call -2823 e8/call emit-hex/disp32 +2823 e8/call emit-hex/disp32 2824 # . . discard args 2825 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2826 $emit-sib:end: @@ -2506,7 +2506,7 @@ if ('onhashchange' in window) { 2871 # . . push args 2872 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 2873 # . . call -2874 e8/call rewind-stream/disp32 +2874 e8/call rewind-stream/disp32 2875 # . . discard args 2876 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 2877 +-- 26 lines: #? # dump line -------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -2516,7 +2516,7 @@ if ('onhashchange' in window) { 2906 51/push-ecx 2907 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 2908 # . . call -2909 e8/call next-word/disp32 +2909 e8/call next-word/disp32 2910 # . . discard args 2911 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2912 +-- 40 lines: #? # dump word-slice -------------------------------------------------------------------------------------------------------------------------------------------------- @@ -2526,7 +2526,7 @@ if ('onhashchange' in window) { 2955 # . . push args 2956 51/push-ecx 2957 # . . call -2958 e8/call slice-empty?/disp32 +2958 e8/call slice-empty?/disp32 2959 # . . discard args 2960 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 2961 # . if (eax != false) pass through @@ -2549,7 +2549,7 @@ if ('onhashchange' in window) { 2978 68/push "disp32"/imm32 2979 51/push-ecx 2980 # . . call -2981 e8/call has-metadata?/disp32 +2981 e8/call has-metadata?/disp32 2982 # . . discard args 2983 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2984 # . if (eax == false) goto next check @@ -2562,7 +2562,7 @@ if ('onhashchange' in window) { 2991 51/push-ecx 2992 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 2993 # . . call -2994 e8/call emit/disp32 +2994 e8/call emit/disp32 2995 # . . discard args 2996 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2997 # break @@ -2574,7 +2574,7 @@ if ('onhashchange' in window) { 3003 68/push "disp16"/imm32 3004 51/push-ecx 3005 # . . call -3006 e8/call has-metadata?/disp32 +3006 e8/call has-metadata?/disp32 3007 # . . discard args 3008 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3009 # . if (eax == false) goto next check @@ -2587,7 +2587,7 @@ if ('onhashchange' in window) { 3016 51/push-ecx 3017 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 3018 # . . call -3019 e8/call emit/disp32 +3019 e8/call emit/disp32 3020 # . . discard args 3021 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 3022 # break @@ -2599,7 +2599,7 @@ if ('onhashchange' in window) { 3028 68/push "disp8"/imm32 3029 51/push-ecx 3030 # . . call -3031 e8/call has-metadata?/disp32 +3031 e8/call has-metadata?/disp32 3032 # . . discard args 3033 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3034 # . if (eax == false) loop @@ -2612,7 +2612,7 @@ if ('onhashchange' in window) { 3041 51/push-ecx 3042 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 3043 # . . call -3044 e8/call emit/disp32 +3044 e8/call emit/disp32 3045 # . . discard args 3046 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 3047 # break @@ -2661,7 +2661,7 @@ if ('onhashchange' in window) { 3090 # . . push args 3091 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 3092 # . . call -3093 e8/call rewind-stream/disp32 +3093 e8/call rewind-stream/disp32 3094 # . . discard args 3095 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3096 +-- 26 lines: #? # dump line -------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -2671,7 +2671,7 @@ if ('onhashchange' in window) { 3125 51/push-ecx 3126 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 3127 # . . call -3128 e8/call next-word/disp32 +3128 e8/call next-word/disp32 3129 # . . discard args 3130 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3131 +-- 40 lines: #? # dump word-slice -------------------------------------------------------------------------------------------------------------------------------------------------- @@ -2681,7 +2681,7 @@ if ('onhashchange' in window) { 3174 # . . push args 3175 51/push-ecx 3176 # . . call -3177 e8/call slice-empty?/disp32 +3177 e8/call slice-empty?/disp32 3178 # . . discard args 3179 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3180 # . if (eax != false) pass through @@ -2704,7 +2704,7 @@ if ('onhashchange' in window) { 3197 68/push "imm32"/imm32 3198 51/push-ecx 3199 # . . call -3200 e8/call has-metadata?/disp32 +3200 e8/call has-metadata?/disp32 3201 # . . discard args 3202 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3203 # . if (eax == false) goto next check @@ -2717,7 +2717,7 @@ if ('onhashchange' in window) { 3210 51/push-ecx 3211 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 3212 # . . call -3213 e8/call emit/disp32 +3213 e8/call emit/disp32 3214 # . . discard args 3215 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 3216 # break @@ -2729,7 +2729,7 @@ if ('onhashchange' in window) { 3222 68/push "imm16"/imm32 3223 51/push-ecx 3224 # . . call -3225 e8/call has-metadata?/disp32 +3225 e8/call has-metadata?/disp32 3226 # . . discard args 3227 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3228 # . if (eax == false) goto next check @@ -2742,7 +2742,7 @@ if ('onhashchange' in window) { 3235 51/push-ecx 3236 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 3237 # . . call -3238 e8/call emit/disp32 +3238 e8/call emit/disp32 3239 # . . discard args 3240 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 3241 # break @@ -2754,7 +2754,7 @@ if ('onhashchange' in window) { 3247 68/push "imm8"/imm32 3248 51/push-ecx 3249 # . . call -3250 e8/call has-metadata?/disp32 +3250 e8/call has-metadata?/disp32 3251 # . . discard args 3252 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3253 # . if (eax == false) loop @@ -2767,7 +2767,7 @@ if ('onhashchange' in window) { 3260 51/push-ecx 3261 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 3262 # . . call -3263 e8/call emit/disp32 +3263 e8/call emit/disp32 3264 # . . discard args 3265 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 3266 # break @@ -2792,7 +2792,7 @@ if ('onhashchange' in window) { 3285 68/push " # "/imm32 3286 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 3287 # . . call -3288 e8/call write-buffered/disp32 +3288 e8/call write-buffered/disp32 3289 # . . discard args 3290 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3291 # write-stream-data(out, line) @@ -2800,7 +2800,7 @@ if ('onhashchange' in window) { 3293 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 3294 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 3295 # . . call -3296 e8/call write-stream-data/disp32 +3296 e8/call write-stream-data/disp32 3297 # . . discard args 3298 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3299 $emit-line-in-comment:end: @@ -2817,38 +2817,38 @@ if ('onhashchange' in window) { 3310 # setup 3311 # . clear-stream(_test-input-stream) 3312 # . . push args -3313 68/push _test-input-stream/imm32 +3313 68/push _test-input-stream/imm32 3314 # . . call -3315 e8/call clear-stream/disp32 +3315 e8/call clear-stream/disp32 3316 # . . discard args 3317 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3318 # . clear-stream(_test-output-stream) 3319 # . . push args -3320 68/push _test-output-stream/imm32 +3320 68/push _test-output-stream/imm32 3321 # . . call -3322 e8/call clear-stream/disp32 +3322 e8/call clear-stream/disp32 3323 # . . discard args 3324 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3325 # . clear-stream($_test-output-buffered-file->buffer) 3326 # . . push args 3327 68/push $_test-output-buffered-file->buffer/imm32 3328 # . . call -3329 e8/call clear-stream/disp32 +3329 e8/call clear-stream/disp32 3330 # . . discard args 3331 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3332 # initialize input 3333 # . write(_test-input-stream, "# abcd") 3334 # . . push args 3335 68/push "# abcd"/imm32 -3336 68/push _test-input-stream/imm32 +3336 68/push _test-input-stream/imm32 3337 # . . call -3338 e8/call write/disp32 +3338 e8/call write/disp32 3339 # . . discard args 3340 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3341 # convert-instruction(_test-input-stream, _test-output-buffered-file) 3342 # . . push args -3343 68/push _test-output-buffered-file/imm32 -3344 68/push _test-input-stream/imm32 +3343 68/push _test-output-buffered-file/imm32 +3344 68/push _test-input-stream/imm32 3345 # . . call 3346 e8/call convert-instruction/disp32 3347 # . . discard args @@ -2856,18 +2856,18 @@ if ('onhashchange' in window) { 3349 # check that the line just passed through 3350 # . flush(_test-output-buffered-file) 3351 # . . push args -3352 68/push _test-output-buffered-file/imm32 +3352 68/push _test-output-buffered-file/imm32 3353 # . . call -3354 e8/call flush/disp32 +3354 e8/call flush/disp32 3355 # . . discard args 3356 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3357 # . check-stream-equal(_test-output-stream, "# abcd", msg) 3358 # . . push args 3359 68/push "F - test-convert-instruction-passes-comments-through"/imm32 3360 68/push "# abcd"/imm32 -3361 68/push _test-output-stream/imm32 +3361 68/push _test-output-stream/imm32 3362 # . . call -3363 e8/call check-stream-equal/disp32 +3363 e8/call check-stream-equal/disp32 3364 # . . discard args 3365 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 3366 # . epilogue @@ -2883,38 +2883,38 @@ if ('onhashchange' in window) { 3376 # setup 3377 # . clear-stream(_test-input-stream) 3378 # . . push args -3379 68/push _test-input-stream/imm32 +3379 68/push _test-input-stream/imm32 3380 # . . call -3381 e8/call clear-stream/disp32 +3381 e8/call clear-stream/disp32 3382 # . . discard args 3383 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3384 # . clear-stream(_test-output-stream) 3385 # . . push args -3386 68/push _test-output-stream/imm32 +3386 68/push _test-output-stream/imm32 3387 # . . call -3388 e8/call clear-stream/disp32 +3388 e8/call clear-stream/disp32 3389 # . . discard args 3390 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3391 # . clear-stream($_test-output-buffered-file->buffer) 3392 # . . push args 3393 68/push $_test-output-buffered-file->buffer/imm32 3394 # . . call -3395 e8/call clear-stream/disp32 +3395 e8/call clear-stream/disp32 3396 # . . discard args 3397 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3398 # initialize input 3399 # . write(_test-input-stream, "ab: # cd") 3400 # . . push args 3401 68/push "ab: # cd"/imm32 -3402 68/push _test-input-stream/imm32 +3402 68/push _test-input-stream/imm32 3403 # . . call -3404 e8/call write/disp32 +3404 e8/call write/disp32 3405 # . . discard args 3406 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3407 # convert-instruction(_test-input-stream, _test-output-buffered-file) 3408 # . . push args -3409 68/push _test-output-buffered-file/imm32 -3410 68/push _test-input-stream/imm32 +3409 68/push _test-output-buffered-file/imm32 +3410 68/push _test-input-stream/imm32 3411 # . . call 3412 e8/call convert-instruction/disp32 3413 # . . discard args @@ -2922,18 +2922,18 @@ if ('onhashchange' in window) { 3415 # check that the line just passed through 3416 # . flush(_test-output-buffered-file) 3417 # . . push args -3418 68/push _test-output-buffered-file/imm32 +3418 68/push _test-output-buffered-file/imm32 3419 # . . call -3420 e8/call flush/disp32 +3420 e8/call flush/disp32 3421 # . . discard args 3422 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3423 # . check-stream-equal(_test-output-stream, "ab: # cd", msg) 3424 # . . push args 3425 68/push "F - test-convert-instruction-passes-labels-through"/imm32 3426 68/push "ab: # cd"/imm32 -3427 68/push _test-output-stream/imm32 +3427 68/push _test-output-stream/imm32 3428 # . . call -3429 e8/call check-stream-equal/disp32 +3429 e8/call check-stream-equal/disp32 3430 # . . discard args 3431 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 3432 # . epilogue @@ -2949,38 +2949,38 @@ if ('onhashchange' in window) { 3442 # setup 3443 # . clear-stream(_test-input-stream) 3444 # . . push args -3445 68/push _test-input-stream/imm32 +3445 68/push _test-input-stream/imm32 3446 # . . call -3447 e8/call clear-stream/disp32 +3447 e8/call clear-stream/disp32 3448 # . . discard args 3449 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3450 # . clear-stream(_test-output-stream) 3451 # . . push args -3452 68/push _test-output-stream/imm32 +3452 68/push _test-output-stream/imm32 3453 # . . call -3454 e8/call clear-stream/disp32 +3454 e8/call clear-stream/disp32 3455 # . . discard args 3456 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3457 # . clear-stream($_test-output-buffered-file->buffer) 3458 # . . push args 3459 68/push $_test-output-buffered-file->buffer/imm32 3460 # . . call -3461 e8/call clear-stream/disp32 +3461 e8/call clear-stream/disp32 3462 # . . discard args 3463 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3464 # initialize input 3465 # . write(_test-input-stream, "ab/cd # comment") 3466 # . . push args 3467 68/push "ab/cd # comment"/imm32 -3468 68/push _test-input-stream/imm32 +3468 68/push _test-input-stream/imm32 3469 # . . call -3470 e8/call write/disp32 +3470 e8/call write/disp32 3471 # . . discard args 3472 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3473 # convert-instruction(_test-input-stream, _test-output-buffered-file) 3474 # . . push args -3475 68/push _test-output-buffered-file/imm32 -3476 68/push _test-input-stream/imm32 +3475 68/push _test-output-buffered-file/imm32 +3476 68/push _test-input-stream/imm32 3477 # . . call 3478 e8/call convert-instruction/disp32 3479 # . . discard args @@ -2988,9 +2988,9 @@ if ('onhashchange' in window) { 3481 # check output 3482 # . flush(_test-output-buffered-file) 3483 # . . push args -3484 68/push _test-output-buffered-file/imm32 +3484 68/push _test-output-buffered-file/imm32 3485 # . . call -3486 e8/call flush/disp32 +3486 e8/call flush/disp32 3487 # . . discard args 3488 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3489 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -2998,9 +2998,9 @@ if ('onhashchange' in window) { 3516 # . . push args 3517 68/push "F - test-convert-instruction-handles-single-opcode"/imm32 3518 68/push "ab # ab/cd # comment"/imm32 -3519 68/push _test-output-stream/imm32 +3519 68/push _test-output-stream/imm32 3520 # . . call -3521 e8/call check-stream-equal/disp32 +3521 e8/call check-stream-equal/disp32 3522 # . . discard args 3523 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 3524 # . epilogue @@ -3016,38 +3016,38 @@ if ('onhashchange' in window) { 3534 # setup 3535 # . clear-stream(_test-input-stream) 3536 # . . push args -3537 68/push _test-input-stream/imm32 +3537 68/push _test-input-stream/imm32 3538 # . . call -3539 e8/call clear-stream/disp32 +3539 e8/call clear-stream/disp32 3540 # . . discard args 3541 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3542 # . clear-stream(_test-output-stream) 3543 # . . push args -3544 68/push _test-output-stream/imm32 +3544 68/push _test-output-stream/imm32 3545 # . . call -3546 e8/call clear-stream/disp32 +3546 e8/call clear-stream/disp32 3547 # . . discard args 3548 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3549 # . clear-stream($_test-output-buffered-file->buffer) 3550 # . . push args 3551 68/push $_test-output-buffered-file->buffer/imm32 3552 # . . call -3553 e8/call clear-stream/disp32 +3553 e8/call clear-stream/disp32 3554 # . . discard args 3555 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3556 # initialize input 3557 # . write(_test-input-stream, "0f/m1 ab/m2 # comment") 3558 # . . push args 3559 68/push "0f/m1 ab/m2 # comment"/imm32 -3560 68/push _test-input-stream/imm32 +3560 68/push _test-input-stream/imm32 3561 # . . call -3562 e8/call write/disp32 +3562 e8/call write/disp32 3563 # . . discard args 3564 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3565 # convert-instruction(_test-input-stream, _test-output-buffered-file) 3566 # . . push args -3567 68/push _test-output-buffered-file/imm32 -3568 68/push _test-input-stream/imm32 +3567 68/push _test-output-buffered-file/imm32 +3568 68/push _test-input-stream/imm32 3569 # . . call 3570 e8/call convert-instruction/disp32 3571 # . . discard args @@ -3055,9 +3055,9 @@ if ('onhashchange' in window) { 3573 # check output 3574 # . flush(_test-output-buffered-file) 3575 # . . push args -3576 68/push _test-output-buffered-file/imm32 +3576 68/push _test-output-buffered-file/imm32 3577 # . . call -3578 e8/call flush/disp32 +3578 e8/call flush/disp32 3579 # . . discard args 3580 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3581 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -3065,9 +3065,9 @@ if ('onhashchange' in window) { 3608 # . . push args 3609 68/push "F - test-convert-instruction-handles-0f-opcode"/imm32 3610 68/push "0f ab # 0f/m1 ab/m2 # comment"/imm32 -3611 68/push _test-output-stream/imm32 +3611 68/push _test-output-stream/imm32 3612 # . . call -3613 e8/call check-stream-equal/disp32 +3613 e8/call check-stream-equal/disp32 3614 # . . discard args 3615 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 3616 # . epilogue @@ -3083,38 +3083,38 @@ if ('onhashchange' in window) { 3626 # setup 3627 # . clear-stream(_test-input-stream) 3628 # . . push args -3629 68/push _test-input-stream/imm32 +3629 68/push _test-input-stream/imm32 3630 # . . call -3631 e8/call clear-stream/disp32 +3631 e8/call clear-stream/disp32 3632 # . . discard args 3633 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3634 # . clear-stream(_test-output-stream) 3635 # . . push args -3636 68/push _test-output-stream/imm32 +3636 68/push _test-output-stream/imm32 3637 # . . call -3638 e8/call clear-stream/disp32 +3638 e8/call clear-stream/disp32 3639 # . . discard args 3640 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3641 # . clear-stream($_test-output-buffered-file->buffer) 3642 # . . push args 3643 68/push $_test-output-buffered-file->buffer/imm32 3644 # . . call -3645 e8/call clear-stream/disp32 +3645 e8/call clear-stream/disp32 3646 # . . discard args 3647 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3648 # initialize input 3649 # . write(_test-input-stream, "f2/m1 ab/m2 # comment") 3650 # . . push args 3651 68/push "f2/m1 ab/m2 # comment"/imm32 -3652 68/push _test-input-stream/imm32 +3652 68/push _test-input-stream/imm32 3653 # . . call -3654 e8/call write/disp32 +3654 e8/call write/disp32 3655 # . . discard args 3656 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3657 # convert-instruction(_test-input-stream, _test-output-buffered-file) 3658 # . . push args -3659 68/push _test-output-buffered-file/imm32 -3660 68/push _test-input-stream/imm32 +3659 68/push _test-output-buffered-file/imm32 +3660 68/push _test-input-stream/imm32 3661 # . . call 3662 e8/call convert-instruction/disp32 3663 # . . discard args @@ -3122,9 +3122,9 @@ if ('onhashchange' in window) { 3665 # check output 3666 # . flush(_test-output-buffered-file) 3667 # . . push args -3668 68/push _test-output-buffered-file/imm32 +3668 68/push _test-output-buffered-file/imm32 3669 # . . call -3670 e8/call flush/disp32 +3670 e8/call flush/disp32 3671 # . . discard args 3672 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3673 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -3132,9 +3132,9 @@ if ('onhashchange' in window) { 3700 # . . push args 3701 68/push "F - test-convert-instruction-handles-f2-opcode"/imm32 3702 68/push "f2 ab # f2/m1 ab/m2 # comment"/imm32 -3703 68/push _test-output-stream/imm32 +3703 68/push _test-output-stream/imm32 3704 # . . call -3705 e8/call check-stream-equal/disp32 +3705 e8/call check-stream-equal/disp32 3706 # . . discard args 3707 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 3708 # . epilogue @@ -3150,38 +3150,38 @@ if ('onhashchange' in window) { 3718 # setup 3719 # . clear-stream(_test-input-stream) 3720 # . . push args -3721 68/push _test-input-stream/imm32 +3721 68/push _test-input-stream/imm32 3722 # . . call -3723 e8/call clear-stream/disp32 +3723 e8/call clear-stream/disp32 3724 # . . discard args 3725 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3726 # . clear-stream(_test-output-stream) 3727 # . . push args -3728 68/push _test-output-stream/imm32 +3728 68/push _test-output-stream/imm32 3729 # . . call -3730 e8/call clear-stream/disp32 +3730 e8/call clear-stream/disp32 3731 # . . discard args 3732 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3733 # . clear-stream($_test-output-buffered-file->buffer) 3734 # . . push args 3735 68/push $_test-output-buffered-file->buffer/imm32 3736 # . . call -3737 e8/call clear-stream/disp32 +3737 e8/call clear-stream/disp32 3738 # . . discard args 3739 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3740 # initialize input 3741 # . write(_test-input-stream, "f3/m1 ab/m2 # comment") 3742 # . . push args 3743 68/push "f3/m1 ab/m2 # comment"/imm32 -3744 68/push _test-input-stream/imm32 +3744 68/push _test-input-stream/imm32 3745 # . . call -3746 e8/call write/disp32 +3746 e8/call write/disp32 3747 # . . discard args 3748 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3749 # convert-instruction(_test-input-stream, _test-output-buffered-file) 3750 # . . push args -3751 68/push _test-output-buffered-file/imm32 -3752 68/push _test-input-stream/imm32 +3751 68/push _test-output-buffered-file/imm32 +3752 68/push _test-input-stream/imm32 3753 # . . call 3754 e8/call convert-instruction/disp32 3755 # . . discard args @@ -3189,9 +3189,9 @@ if ('onhashchange' in window) { 3757 # check output 3758 # . flush(_test-output-buffered-file) 3759 # . . push args -3760 68/push _test-output-buffered-file/imm32 +3760 68/push _test-output-buffered-file/imm32 3761 # . . call -3762 e8/call flush/disp32 +3762 e8/call flush/disp32 3763 # . . discard args 3764 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3765 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -3199,9 +3199,9 @@ if ('onhashchange' in window) { 3792 # . . push args 3793 68/push "F - test-convert-instruction-handles-f3-opcode"/imm32 3794 68/push "f3 ab # f3/m1 ab/m2 # comment"/imm32 -3795 68/push _test-output-stream/imm32 +3795 68/push _test-output-stream/imm32 3796 # . . call -3797 e8/call check-stream-equal/disp32 +3797 e8/call check-stream-equal/disp32 3798 # . . discard args 3799 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 3800 # . epilogue @@ -3217,38 +3217,38 @@ if ('onhashchange' in window) { 3810 # setup 3811 # . clear-stream(_test-input-stream) 3812 # . . push args -3813 68/push _test-input-stream/imm32 +3813 68/push _test-input-stream/imm32 3814 # . . call -3815 e8/call clear-stream/disp32 +3815 e8/call clear-stream/disp32 3816 # . . discard args 3817 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3818 # . clear-stream(_test-output-stream) 3819 # . . push args -3820 68/push _test-output-stream/imm32 +3820 68/push _test-output-stream/imm32 3821 # . . call -3822 e8/call clear-stream/disp32 +3822 e8/call clear-stream/disp32 3823 # . . discard args 3824 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3825 # . clear-stream($_test-output-buffered-file->buffer) 3826 # . . push args 3827 68/push $_test-output-buffered-file->buffer/imm32 3828 # . . call -3829 e8/call clear-stream/disp32 +3829 e8/call clear-stream/disp32 3830 # . . discard args 3831 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3832 # initialize input 3833 # . write(_test-input-stream, "f2/m1 0f/m2 ab/m3 # comment") 3834 # . . push args 3835 68/push "f2/m1 0f/m2 ab/m3 # comment"/imm32 -3836 68/push _test-input-stream/imm32 +3836 68/push _test-input-stream/imm32 3837 # . . call -3838 e8/call write/disp32 +3838 e8/call write/disp32 3839 # . . discard args 3840 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3841 # convert-instruction(_test-input-stream, _test-output-buffered-file) 3842 # . . push args -3843 68/push _test-output-buffered-file/imm32 -3844 68/push _test-input-stream/imm32 +3843 68/push _test-output-buffered-file/imm32 +3844 68/push _test-input-stream/imm32 3845 # . . call 3846 e8/call convert-instruction/disp32 3847 # . . discard args @@ -3256,9 +3256,9 @@ if ('onhashchange' in window) { 3849 # check output 3850 # . flush(_test-output-buffered-file) 3851 # . . push args -3852 68/push _test-output-buffered-file/imm32 +3852 68/push _test-output-buffered-file/imm32 3853 # . . call -3854 e8/call flush/disp32 +3854 e8/call flush/disp32 3855 # . . discard args 3856 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3857 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -3266,9 +3266,9 @@ if ('onhashchange' in window) { 3884 # . . push args 3885 68/push "F - test-convert-instruction-handles-f2-0f-opcode"/imm32 3886 68/push "f2 0f ab # f2/m1 0f/m2 ab/m3 # comment"/imm32 -3887 68/push _test-output-stream/imm32 +3887 68/push _test-output-stream/imm32 3888 # . . call -3889 e8/call check-stream-equal/disp32 +3889 e8/call check-stream-equal/disp32 3890 # . . discard args 3891 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 3892 # . epilogue @@ -3284,38 +3284,38 @@ if ('onhashchange' in window) { 3902 # setup 3903 # . clear-stream(_test-input-stream) 3904 # . . push args -3905 68/push _test-input-stream/imm32 +3905 68/push _test-input-stream/imm32 3906 # . . call -3907 e8/call clear-stream/disp32 +3907 e8/call clear-stream/disp32 3908 # . . discard args 3909 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3910 # . clear-stream(_test-output-stream) 3911 # . . push args -3912 68/push _test-output-stream/imm32 +3912 68/push _test-output-stream/imm32 3913 # . . call -3914 e8/call clear-stream/disp32 +3914 e8/call clear-stream/disp32 3915 # . . discard args 3916 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3917 # . clear-stream($_test-output-buffered-file->buffer) 3918 # . . push args 3919 68/push $_test-output-buffered-file->buffer/imm32 3920 # . . call -3921 e8/call clear-stream/disp32 +3921 e8/call clear-stream/disp32 3922 # . . discard args 3923 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3924 # initialize input 3925 # . write(_test-input-stream, "f3/m1 0f/m2 ab/m3 # comment") 3926 # . . push args 3927 68/push "f3/m1 0f/m2 ab/m3 # comment"/imm32 -3928 68/push _test-input-stream/imm32 +3928 68/push _test-input-stream/imm32 3929 # . . call -3930 e8/call write/disp32 +3930 e8/call write/disp32 3931 # . . discard args 3932 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3933 # convert-instruction(_test-input-stream, _test-output-buffered-file) 3934 # . . push args -3935 68/push _test-output-buffered-file/imm32 -3936 68/push _test-input-stream/imm32 +3935 68/push _test-output-buffered-file/imm32 +3936 68/push _test-input-stream/imm32 3937 # . . call 3938 e8/call convert-instruction/disp32 3939 # . . discard args @@ -3323,9 +3323,9 @@ if ('onhashchange' in window) { 3941 # check output 3942 # . flush(_test-output-buffered-file) 3943 # . . push args -3944 68/push _test-output-buffered-file/imm32 +3944 68/push _test-output-buffered-file/imm32 3945 # . . call -3946 e8/call flush/disp32 +3946 e8/call flush/disp32 3947 # . . discard args 3948 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3949 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -3333,9 +3333,9 @@ if ('onhashchange' in window) { 3976 # . . push args 3977 68/push "F - test-convert-instruction-handles-f3-0f-opcode"/imm32 3978 68/push "f3 0f ab # f3/m1 0f/m2 ab/m3 # comment"/imm32 -3979 68/push _test-output-stream/imm32 +3979 68/push _test-output-stream/imm32 3980 # . . call -3981 e8/call check-stream-equal/disp32 +3981 e8/call check-stream-equal/disp32 3982 # . . discard args 3983 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 3984 # . epilogue @@ -3351,38 +3351,38 @@ if ('onhashchange' in window) { 3994 # setup 3995 # . clear-stream(_test-input-stream) 3996 # . . push args -3997 68/push _test-input-stream/imm32 +3997 68/push _test-input-stream/imm32 3998 # . . call -3999 e8/call clear-stream/disp32 +3999 e8/call clear-stream/disp32 4000 # . . discard args 4001 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4002 # . clear-stream(_test-output-stream) 4003 # . . push args -4004 68/push _test-output-stream/imm32 +4004 68/push _test-output-stream/imm32 4005 # . . call -4006 e8/call clear-stream/disp32 +4006 e8/call clear-stream/disp32 4007 # . . discard args 4008 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4009 # . clear-stream($_test-output-buffered-file->buffer) 4010 # . . push args 4011 68/push $_test-output-buffered-file->buffer/imm32 4012 # . . call -4013 e8/call clear-stream/disp32 +4013 e8/call clear-stream/disp32 4014 # . . discard args 4015 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4016 # initialize input 4017 # . write(_test-input-stream, "ab/m1 cd/m2 # comment") 4018 # . . push args 4019 68/push "ab/m1 cd/m2 # comment"/imm32 -4020 68/push _test-input-stream/imm32 +4020 68/push _test-input-stream/imm32 4021 # . . call -4022 e8/call write/disp32 +4022 e8/call write/disp32 4023 # . . discard args 4024 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 4025 # convert-instruction(_test-input-stream, _test-output-buffered-file) 4026 # . . push args -4027 68/push _test-output-buffered-file/imm32 -4028 68/push _test-input-stream/imm32 +4027 68/push _test-output-buffered-file/imm32 +4028 68/push _test-input-stream/imm32 4029 # . . call 4030 e8/call convert-instruction/disp32 4031 # . . discard args @@ -3390,9 +3390,9 @@ if ('onhashchange' in window) { 4033 # check output 4034 # . flush(_test-output-buffered-file) 4035 # . . push args -4036 68/push _test-output-buffered-file/imm32 +4036 68/push _test-output-buffered-file/imm32 4037 # . . call -4038 e8/call flush/disp32 +4038 e8/call flush/disp32 4039 # . . discard args 4040 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4041 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -3400,9 +3400,9 @@ if ('onhashchange' in window) { 4068 # . . push args 4069 68/push "F - test-convert-instruction-handles-unused-opcodes"/imm32 4070 68/push "ab # ab/m1 cd/m2 # comment"/imm32 -4071 68/push _test-output-stream/imm32 +4071 68/push _test-output-stream/imm32 4072 # . . call -4073 e8/call check-stream-equal/disp32 +4073 e8/call check-stream-equal/disp32 4074 # . . discard args 4075 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 4076 # . epilogue @@ -3418,38 +3418,38 @@ if ('onhashchange' in window) { 4086 # setup 4087 # . clear-stream(_test-input-stream) 4088 # . . push args -4089 68/push _test-input-stream/imm32 +4089 68/push _test-input-stream/imm32 4090 # . . call -4091 e8/call clear-stream/disp32 +4091 e8/call clear-stream/disp32 4092 # . . discard args 4093 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4094 # . clear-stream(_test-output-stream) 4095 # . . push args -4096 68/push _test-output-stream/imm32 +4096 68/push _test-output-stream/imm32 4097 # . . call -4098 e8/call clear-stream/disp32 +4098 e8/call clear-stream/disp32 4099 # . . discard args 4100 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4101 # . clear-stream($_test-output-buffered-file->buffer) 4102 # . . push args 4103 68/push $_test-output-buffered-file->buffer/imm32 4104 # . . call -4105 e8/call clear-stream/disp32 +4105 e8/call clear-stream/disp32 4106 # . . discard args 4107 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4108 # initialize input 4109 # . write(_test-input-stream, "f2/m1 ab/m2 cd/m3 # comment") 4110 # . . push args 4111 68/push "f2/m1 ab/m2 cd/m3 # comment"/imm32 -4112 68/push _test-input-stream/imm32 +4112 68/push _test-input-stream/imm32 4113 # . . call -4114 e8/call write/disp32 +4114 e8/call write/disp32 4115 # . . discard args 4116 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 4117 # convert-instruction(_test-input-stream, _test-output-buffered-file) 4118 # . . push args -4119 68/push _test-output-buffered-file/imm32 -4120 68/push _test-input-stream/imm32 +4119 68/push _test-output-buffered-file/imm32 +4120 68/push _test-input-stream/imm32 4121 # . . call 4122 e8/call convert-instruction/disp32 4123 # . . discard args @@ -3457,9 +3457,9 @@ if ('onhashchange' in window) { 4125 # check output 4126 # . flush(_test-output-buffered-file) 4127 # . . push args -4128 68/push _test-output-buffered-file/imm32 +4128 68/push _test-output-buffered-file/imm32 4129 # . . call -4130 e8/call flush/disp32 +4130 e8/call flush/disp32 4131 # . . discard args 4132 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4133 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -3467,9 +3467,9 @@ if ('onhashchange' in window) { 4160 # . . push args 4161 68/push "F - test-convert-instruction-handles-unused-second-opcodes"/imm32 4162 68/push "f2 ab # f2/m1 ab/m2 cd/m3 # comment"/imm32 -4163 68/push _test-output-stream/imm32 +4163 68/push _test-output-stream/imm32 4164 # . . call -4165 e8/call check-stream-equal/disp32 +4165 e8/call check-stream-equal/disp32 4166 # . . discard args 4167 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 4168 # . epilogue @@ -3485,38 +3485,38 @@ if ('onhashchange' in window) { 4178 # setup 4179 # . clear-stream(_test-input-stream) 4180 # . . push args -4181 68/push _test-input-stream/imm32 +4181 68/push _test-input-stream/imm32 4182 # . . call -4183 e8/call clear-stream/disp32 +4183 e8/call clear-stream/disp32 4184 # . . discard args 4185 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4186 # . clear-stream(_test-output-stream) 4187 # . . push args -4188 68/push _test-output-stream/imm32 +4188 68/push _test-output-stream/imm32 4189 # . . call -4190 e8/call clear-stream/disp32 +4190 e8/call clear-stream/disp32 4191 # . . discard args 4192 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4193 # . clear-stream($_test-output-buffered-file->buffer) 4194 # . . push args 4195 68/push $_test-output-buffered-file->buffer/imm32 4196 # . . call -4197 e8/call clear-stream/disp32 +4197 e8/call clear-stream/disp32 4198 # . . discard args 4199 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4200 # initialize input 4201 # . write(_test-input-stream, "f3/m1 ab/m2 cd/m3 # comment") 4202 # . . push args 4203 68/push "f3/m1 ab/m2 cd/m3 # comment"/imm32 -4204 68/push _test-input-stream/imm32 +4204 68/push _test-input-stream/imm32 4205 # . . call -4206 e8/call write/disp32 +4206 e8/call write/disp32 4207 # . . discard args 4208 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 4209 # convert-instruction(_test-input-stream, _test-output-buffered-file) 4210 # . . push args -4211 68/push _test-output-buffered-file/imm32 -4212 68/push _test-input-stream/imm32 +4211 68/push _test-output-buffered-file/imm32 +4212 68/push _test-input-stream/imm32 4213 # . . call 4214 e8/call convert-instruction/disp32 4215 # . . discard args @@ -3524,9 +3524,9 @@ if ('onhashchange' in window) { 4217 # check output 4218 # . flush(_test-output-buffered-file) 4219 # . . push args -4220 68/push _test-output-buffered-file/imm32 +4220 68/push _test-output-buffered-file/imm32 4221 # . . call -4222 e8/call flush/disp32 +4222 e8/call flush/disp32 4223 # . . discard args 4224 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4225 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -3534,9 +3534,9 @@ if ('onhashchange' in window) { 4252 # . . push args 4253 68/push "F - test-convert-instruction-handles-unused-second-opcodes"/imm32 4254 68/push "f3 ab # f3/m1 ab/m2 cd/m3 # comment"/imm32 -4255 68/push _test-output-stream/imm32 +4255 68/push _test-output-stream/imm32 4256 # . . call -4257 e8/call check-stream-equal/disp32 +4257 e8/call check-stream-equal/disp32 4258 # . . discard args 4259 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 4260 # . epilogue @@ -3552,38 +3552,38 @@ if ('onhashchange' in window) { 4270 # setup 4271 # . clear-stream(_test-input-stream) 4272 # . . push args -4273 68/push _test-input-stream/imm32 +4273 68/push _test-input-stream/imm32 4274 # . . call -4275 e8/call clear-stream/disp32 +4275 e8/call clear-stream/disp32 4276 # . . discard args 4277 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4278 # . clear-stream(_test-output-stream) 4279 # . . push args -4280 68/push _test-output-stream/imm32 +4280 68/push _test-output-stream/imm32 4281 # . . call -4282 e8/call clear-stream/disp32 +4282 e8/call clear-stream/disp32 4283 # . . discard args 4284 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4285 # . clear-stream($_test-output-buffered-file->buffer) 4286 # . . push args 4287 68/push $_test-output-buffered-file->buffer/imm32 4288 # . . call -4289 e8/call clear-stream/disp32 +4289 e8/call clear-stream/disp32 4290 # . . discard args 4291 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4292 # initialize input 4293 # . write(_test-input-stream, "8b/copy 0/mod 0/rm32 1/r32") 4294 # . . push args 4295 68/push "8b/copy 0/mod 0/rm32 1/r32"/imm32 -4296 68/push _test-input-stream/imm32 +4296 68/push _test-input-stream/imm32 4297 # . . call -4298 e8/call write/disp32 +4298 e8/call write/disp32 4299 # . . discard args 4300 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 4301 # convert-instruction(_test-input-stream, _test-output-buffered-file) 4302 # . . push args -4303 68/push _test-output-buffered-file/imm32 -4304 68/push _test-input-stream/imm32 +4303 68/push _test-output-buffered-file/imm32 +4304 68/push _test-input-stream/imm32 4305 # . . call 4306 e8/call convert-instruction/disp32 4307 # . . discard args @@ -3591,9 +3591,9 @@ if ('onhashchange' in window) { 4309 # check output 4310 # . flush(_test-output-buffered-file) 4311 # . . push args -4312 68/push _test-output-buffered-file/imm32 +4312 68/push _test-output-buffered-file/imm32 4313 # . . call -4314 e8/call flush/disp32 +4314 e8/call flush/disp32 4315 # . . discard args 4316 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4317 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -3601,9 +3601,9 @@ if ('onhashchange' in window) { 4344 # . . push args 4345 68/push "F - test-convert-instruction-emits-modrm-byte"/imm32 4346 68/push "8b 08 # 8b/copy 0/mod 0/rm32 1/r32"/imm32 -4347 68/push _test-output-stream/imm32 +4347 68/push _test-output-stream/imm32 4348 # . . call -4349 e8/call check-stream-equal/disp32 +4349 e8/call check-stream-equal/disp32 4350 # . . discard args 4351 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 4352 # . epilogue @@ -3618,47 +3618,47 @@ if ('onhashchange' in window) { 4361 # setup 4362 # . clear-stream(_test-input-stream) 4363 # . . push args -4364 68/push _test-input-stream/imm32 +4364 68/push _test-input-stream/imm32 4365 # . . call -4366 e8/call clear-stream/disp32 +4366 e8/call clear-stream/disp32 4367 # . . discard args 4368 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4369 # . clear-stream(_test-output-stream) 4370 # . . push args -4371 68/push _test-output-stream/imm32 +4371 68/push _test-output-stream/imm32 4372 # . . call -4373 e8/call clear-stream/disp32 +4373 e8/call clear-stream/disp32 4374 # . . discard args 4375 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4376 # . clear-stream($_test-output-buffered-file->buffer) 4377 # . . push args 4378 68/push $_test-output-buffered-file->buffer/imm32 4379 # . . call -4380 e8/call clear-stream/disp32 +4380 e8/call clear-stream/disp32 4381 # . . discard args 4382 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4383 # initialize input 4384 # . write(_test-input-stream, "01/add 3/mod/direct 3/rm32/ebx 1/r32/ecx") 4385 # . . push args 4386 68/push "01/add 3/mod/direct 3/rm32/ebx 1/r32/ecx"/imm32 -4387 68/push _test-input-stream/imm32 +4387 68/push _test-input-stream/imm32 4388 # . . call -4389 e8/call write/disp32 +4389 e8/call write/disp32 4390 # . . discard args 4391 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 4392 # convert-instruction(_test-input-stream, _test-output-buffered-file) 4393 # . . push args -4394 68/push _test-output-buffered-file/imm32 -4395 68/push _test-input-stream/imm32 +4394 68/push _test-output-buffered-file/imm32 +4395 68/push _test-input-stream/imm32 4396 # . . call 4397 e8/call convert-instruction/disp32 4398 # . . discard args 4399 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 4400 # . flush(_test-output-buffered-file) 4401 # . . push args -4402 68/push _test-output-buffered-file/imm32 +4402 68/push _test-output-buffered-file/imm32 4403 # . . call -4404 e8/call flush/disp32 +4404 e8/call flush/disp32 4405 # . . discard args 4406 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4407 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -3667,9 +3667,9 @@ if ('onhashchange' in window) { 4435 # . . push args 4436 68/push "F - test-convert-instruction-foo"/imm32 4437 68/push "01 cb # 01/add 3/mod/direct 3/rm32/ebx 1/r32/ecx"/imm32 -4438 68/push _test-output-stream/imm32 +4438 68/push _test-output-stream/imm32 4439 # . . call -4440 e8/call check-stream-equal/disp32 +4440 e8/call check-stream-equal/disp32 4441 # . . discard args 4442 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 4443 # . epilogue @@ -3685,38 +3685,38 @@ if ('onhashchange' in window) { 4453 # setup 4454 # . clear-stream(_test-input-stream) 4455 # . . push args -4456 68/push _test-input-stream/imm32 +4456 68/push _test-input-stream/imm32 4457 # . . call -4458 e8/call clear-stream/disp32 +4458 e8/call clear-stream/disp32 4459 # . . discard args 4460 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4461 # . clear-stream(_test-output-stream) 4462 # . . push args -4463 68/push _test-output-stream/imm32 +4463 68/push _test-output-stream/imm32 4464 # . . call -4465 e8/call clear-stream/disp32 +4465 e8/call clear-stream/disp32 4466 # . . discard args 4467 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4468 # . clear-stream($_test-output-buffered-file->buffer) 4469 # . . push args 4470 68/push $_test-output-buffered-file->buffer/imm32 4471 # . . call -4472 e8/call clear-stream/disp32 +4472 e8/call clear-stream/disp32 4473 # . . discard args 4474 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4475 # initialize input 4476 # . write(_test-input-stream, "ff 6/subop/push 0/mod 0/rm32") 4477 # . . push args 4478 68/push "ff 6/subop/push 0/mod 0/rm32"/imm32 -4479 68/push _test-input-stream/imm32 +4479 68/push _test-input-stream/imm32 4480 # . . call -4481 e8/call write/disp32 +4481 e8/call write/disp32 4482 # . . discard args 4483 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 4484 # convert-instruction(_test-input-stream, _test-output-buffered-file) 4485 # . . push args -4486 68/push _test-output-buffered-file/imm32 -4487 68/push _test-input-stream/imm32 +4486 68/push _test-output-buffered-file/imm32 +4487 68/push _test-input-stream/imm32 4488 # . . call 4489 e8/call convert-instruction/disp32 4490 # . . discard args @@ -3724,9 +3724,9 @@ if ('onhashchange' in window) { 4492 # check output 4493 # . flush(_test-output-buffered-file) 4494 # . . push args -4495 68/push _test-output-buffered-file/imm32 +4495 68/push _test-output-buffered-file/imm32 4496 # . . call -4497 e8/call flush/disp32 +4497 e8/call flush/disp32 4498 # . . discard args 4499 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4500 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -3734,9 +3734,9 @@ if ('onhashchange' in window) { 4527 # . . push args 4528 68/push "F - test-convert-instruction-emits-modrm-byte-from-subop"/imm32 4529 68/push "ff 30 # ff 6/subop/push 0/mod 0/rm32"/imm32 -4530 68/push _test-output-stream/imm32 +4530 68/push _test-output-stream/imm32 4531 # . . call -4532 e8/call check-stream-equal/disp32 +4532 e8/call check-stream-equal/disp32 4533 # . . discard args 4534 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 4535 # . epilogue @@ -3752,38 +3752,38 @@ if ('onhashchange' in window) { 4545 # setup 4546 # . clear-stream(_test-input-stream) 4547 # . . push args -4548 68/push _test-input-stream/imm32 +4548 68/push _test-input-stream/imm32 4549 # . . call -4550 e8/call clear-stream/disp32 +4550 e8/call clear-stream/disp32 4551 # . . discard args 4552 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4553 # . clear-stream(_test-output-stream) 4554 # . . push args -4555 68/push _test-output-stream/imm32 +4555 68/push _test-output-stream/imm32 4556 # . . call -4557 e8/call clear-stream/disp32 +4557 e8/call clear-stream/disp32 4558 # . . discard args 4559 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4560 # . clear-stream($_test-output-buffered-file->buffer) 4561 # . . push args 4562 68/push $_test-output-buffered-file->buffer/imm32 4563 # . . call -4564 e8/call clear-stream/disp32 +4564 e8/call clear-stream/disp32 4565 # . . discard args 4566 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4567 # initialize input 4568 # . write(_test-input-stream, "8b/copy 0/rm32 1/r32") 4569 # . . push args 4570 68/push "8b/copy 0/rm32 1/r32"/imm32 -4571 68/push _test-input-stream/imm32 +4571 68/push _test-input-stream/imm32 4572 # . . call -4573 e8/call write/disp32 +4573 e8/call write/disp32 4574 # . . discard args 4575 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 4576 # convert-instruction(_test-input-stream, _test-output-buffered-file) 4577 # . . push args -4578 68/push _test-output-buffered-file/imm32 -4579 68/push _test-input-stream/imm32 +4578 68/push _test-output-buffered-file/imm32 +4579 68/push _test-input-stream/imm32 4580 # . . call 4581 e8/call convert-instruction/disp32 4582 # . . discard args @@ -3791,9 +3791,9 @@ if ('onhashchange' in window) { 4584 # check output 4585 # . flush(_test-output-buffered-file) 4586 # . . push args -4587 68/push _test-output-buffered-file/imm32 +4587 68/push _test-output-buffered-file/imm32 4588 # . . call -4589 e8/call flush/disp32 +4589 e8/call flush/disp32 4590 # . . discard args 4591 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4592 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -3801,9 +3801,9 @@ if ('onhashchange' in window) { 4619 # . . push args 4620 68/push "F - test-convert-instruction-emits-modrm-byte-with-missing-mod"/imm32 4621 68/push "8b 08 # 8b/copy 0/rm32 1/r32"/imm32 -4622 68/push _test-output-stream/imm32 +4622 68/push _test-output-stream/imm32 4623 # . . call -4624 e8/call check-stream-equal/disp32 +4624 e8/call check-stream-equal/disp32 4625 # . . discard args 4626 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 4627 # . epilogue @@ -3819,38 +3819,38 @@ if ('onhashchange' in window) { 4637 # setup 4638 # . clear-stream(_test-input-stream) 4639 # . . push args -4640 68/push _test-input-stream/imm32 +4640 68/push _test-input-stream/imm32 4641 # . . call -4642 e8/call clear-stream/disp32 +4642 e8/call clear-stream/disp32 4643 # . . discard args 4644 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4645 # . clear-stream(_test-output-stream) 4646 # . . push args -4647 68/push _test-output-stream/imm32 +4647 68/push _test-output-stream/imm32 4648 # . . call -4649 e8/call clear-stream/disp32 +4649 e8/call clear-stream/disp32 4650 # . . discard args 4651 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4652 # . clear-stream($_test-output-buffered-file->buffer) 4653 # . . push args 4654 68/push $_test-output-buffered-file->buffer/imm32 4655 # . . call -4656 e8/call clear-stream/disp32 +4656 e8/call clear-stream/disp32 4657 # . . discard args 4658 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4659 # initialize input 4660 # . write(_test-input-stream, "8b/copy 0/mod 1/r32") 4661 # . . push args 4662 68/push "8b/copy 0/mod 1/r32"/imm32 -4663 68/push _test-input-stream/imm32 +4663 68/push _test-input-stream/imm32 4664 # . . call -4665 e8/call write/disp32 +4665 e8/call write/disp32 4666 # . . discard args 4667 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 4668 # convert-instruction(_test-input-stream, _test-output-buffered-file) 4669 # . . push args -4670 68/push _test-output-buffered-file/imm32 -4671 68/push _test-input-stream/imm32 +4670 68/push _test-output-buffered-file/imm32 +4671 68/push _test-input-stream/imm32 4672 # . . call 4673 e8/call convert-instruction/disp32 4674 # . . discard args @@ -3858,9 +3858,9 @@ if ('onhashchange' in window) { 4676 # check output 4677 # . flush(_test-output-buffered-file) 4678 # . . push args -4679 68/push _test-output-buffered-file/imm32 +4679 68/push _test-output-buffered-file/imm32 4680 # . . call -4681 e8/call flush/disp32 +4681 e8/call flush/disp32 4682 # . . discard args 4683 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4684 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -3868,9 +3868,9 @@ if ('onhashchange' in window) { 4711 # . . push args 4712 68/push "F - test-convert-instruction-emits-modrm-byte-with-missing-rm32"/imm32 4713 68/push "8b 08 # 8b/copy 0/mod 1/r32"/imm32 -4714 68/push _test-output-stream/imm32 +4714 68/push _test-output-stream/imm32 4715 # . . call -4716 e8/call check-stream-equal/disp32 +4716 e8/call check-stream-equal/disp32 4717 # . . discard args 4718 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 4719 # . epilogue @@ -3886,38 +3886,38 @@ if ('onhashchange' in window) { 4729 # setup 4730 # . clear-stream(_test-input-stream) 4731 # . . push args -4732 68/push _test-input-stream/imm32 +4732 68/push _test-input-stream/imm32 4733 # . . call -4734 e8/call clear-stream/disp32 +4734 e8/call clear-stream/disp32 4735 # . . discard args 4736 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4737 # . clear-stream(_test-output-stream) 4738 # . . push args -4739 68/push _test-output-stream/imm32 +4739 68/push _test-output-stream/imm32 4740 # . . call -4741 e8/call clear-stream/disp32 +4741 e8/call clear-stream/disp32 4742 # . . discard args 4743 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4744 # . clear-stream($_test-output-buffered-file->buffer) 4745 # . . push args 4746 68/push $_test-output-buffered-file->buffer/imm32 4747 # . . call -4748 e8/call clear-stream/disp32 +4748 e8/call clear-stream/disp32 4749 # . . discard args 4750 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4751 # initialize input 4752 # . write(_test-input-stream, "8b/copy 0/mod 0/rm32") 4753 # . . push args 4754 68/push "8b/copy 0/mod 0/rm32"/imm32 -4755 68/push _test-input-stream/imm32 +4755 68/push _test-input-stream/imm32 4756 # . . call -4757 e8/call write/disp32 +4757 e8/call write/disp32 4758 # . . discard args 4759 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 4760 # convert-instruction(_test-input-stream, _test-output-buffered-file) 4761 # . . push args -4762 68/push _test-output-buffered-file/imm32 -4763 68/push _test-input-stream/imm32 +4762 68/push _test-output-buffered-file/imm32 +4763 68/push _test-input-stream/imm32 4764 # . . call 4765 e8/call convert-instruction/disp32 4766 # . . discard args @@ -3925,9 +3925,9 @@ if ('onhashchange' in window) { 4768 # check output 4769 # . flush(_test-output-buffered-file) 4770 # . . push args -4771 68/push _test-output-buffered-file/imm32 +4771 68/push _test-output-buffered-file/imm32 4772 # . . call -4773 e8/call flush/disp32 +4773 e8/call flush/disp32 4774 # . . discard args 4775 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4776 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -3935,9 +3935,9 @@ if ('onhashchange' in window) { 4803 # . . push args 4804 68/push "F - test-convert-instruction-emits-modrm-byte-with-missing-r32"/imm32 4805 68/push "8b 00 # 8b/copy 0/mod 0/rm32"/imm32 -4806 68/push _test-output-stream/imm32 +4806 68/push _test-output-stream/imm32 4807 # . . call -4808 e8/call check-stream-equal/disp32 +4808 e8/call check-stream-equal/disp32 4809 # . . discard args 4810 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 4811 # . epilogue @@ -3953,38 +3953,38 @@ if ('onhashchange' in window) { 4821 # setup 4822 # . clear-stream(_test-input-stream) 4823 # . . push args -4824 68/push _test-input-stream/imm32 +4824 68/push _test-input-stream/imm32 4825 # . . call -4826 e8/call clear-stream/disp32 +4826 e8/call clear-stream/disp32 4827 # . . discard args 4828 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4829 # . clear-stream(_test-output-stream) 4830 # . . push args -4831 68/push _test-output-stream/imm32 +4831 68/push _test-output-stream/imm32 4832 # . . call -4833 e8/call clear-stream/disp32 +4833 e8/call clear-stream/disp32 4834 # . . discard args 4835 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4836 # . clear-stream($_test-output-buffered-file->buffer) 4837 # . . push args 4838 68/push $_test-output-buffered-file->buffer/imm32 4839 # . . call -4840 e8/call clear-stream/disp32 +4840 e8/call clear-stream/disp32 4841 # . . discard args 4842 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4843 # initialize input 4844 # . write(_test-input-stream, "8b/copy 0/mod 4/rm32 1/r32 0/base 1/index 0/scale") 4845 # . . push args 4846 68/push "8b/copy 0/mod 4/rm32 1/r32 0/base 1/index 0/scale"/imm32 -4847 68/push _test-input-stream/imm32 +4847 68/push _test-input-stream/imm32 4848 # . . call -4849 e8/call write/disp32 +4849 e8/call write/disp32 4850 # . . discard args 4851 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 4852 # convert-instruction(_test-input-stream, _test-output-buffered-file) 4853 # . . push args -4854 68/push _test-output-buffered-file/imm32 -4855 68/push _test-input-stream/imm32 +4854 68/push _test-output-buffered-file/imm32 +4855 68/push _test-input-stream/imm32 4856 # . . call 4857 e8/call convert-instruction/disp32 4858 # . . discard args @@ -3992,9 +3992,9 @@ if ('onhashchange' in window) { 4860 # check output 4861 # . flush(_test-output-buffered-file) 4862 # . . push args -4863 68/push _test-output-buffered-file/imm32 +4863 68/push _test-output-buffered-file/imm32 4864 # . . call -4865 e8/call flush/disp32 +4865 e8/call flush/disp32 4866 # . . discard args 4867 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4868 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -4002,9 +4002,9 @@ if ('onhashchange' in window) { 4895 # . . push args 4896 68/push "F - test-convert-instruction-emits-sib-byte"/imm32 4897 68/push "8b 0c 08 # 8b/copy 0/mod 4/rm32 1/r32 0/base 1/index 0/scale"/imm32 -4898 68/push _test-output-stream/imm32 +4898 68/push _test-output-stream/imm32 4899 # . . call -4900 e8/call check-stream-equal/disp32 +4900 e8/call check-stream-equal/disp32 4901 # . . discard args 4902 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 4903 # . epilogue @@ -4020,38 +4020,38 @@ if ('onhashchange' in window) { 4913 # setup 4914 # . clear-stream(_test-input-stream) 4915 # . . push args -4916 68/push _test-input-stream/imm32 +4916 68/push _test-input-stream/imm32 4917 # . . call -4918 e8/call clear-stream/disp32 +4918 e8/call clear-stream/disp32 4919 # . . discard args 4920 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4921 # . clear-stream(_test-output-stream) 4922 # . . push args -4923 68/push _test-output-stream/imm32 +4923 68/push _test-output-stream/imm32 4924 # . . call -4925 e8/call clear-stream/disp32 +4925 e8/call clear-stream/disp32 4926 # . . discard args 4927 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4928 # . clear-stream($_test-output-buffered-file->buffer) 4929 # . . push args 4930 68/push $_test-output-buffered-file->buffer/imm32 4931 # . . call -4932 e8/call clear-stream/disp32 +4932 e8/call clear-stream/disp32 4933 # . . discard args 4934 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4935 # initialize input 4936 # . write(_test-input-stream, "8b/copy 0/mod 4/rm32 1/scale") 4937 # . . push args 4938 68/push "8b/copy 0/mod 4/rm32 1/scale"/imm32 -4939 68/push _test-input-stream/imm32 +4939 68/push _test-input-stream/imm32 4940 # . . call -4941 e8/call write/disp32 +4941 e8/call write/disp32 4942 # . . discard args 4943 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 4944 # convert-instruction(_test-input-stream, _test-output-buffered-file) 4945 # . . push args -4946 68/push _test-output-buffered-file/imm32 -4947 68/push _test-input-stream/imm32 +4946 68/push _test-output-buffered-file/imm32 +4947 68/push _test-input-stream/imm32 4948 # . . call 4949 e8/call convert-instruction/disp32 4950 # . . discard args @@ -4059,9 +4059,9 @@ if ('onhashchange' in window) { 4952 # check output 4953 # . flush(_test-output-buffered-file) 4954 # . . push args -4955 68/push _test-output-buffered-file/imm32 +4955 68/push _test-output-buffered-file/imm32 4956 # . . call -4957 e8/call flush/disp32 +4957 e8/call flush/disp32 4958 # . . discard args 4959 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4960 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -4069,9 +4069,9 @@ if ('onhashchange' in window) { 4987 # . . push args 4988 68/push "F - test-convert-instruction-emits-scale"/imm32 4989 68/push "8b 04 40 # 8b/copy 0/mod 4/rm32 1/scale"/imm32 -4990 68/push _test-output-stream/imm32 +4990 68/push _test-output-stream/imm32 4991 # . . call -4992 e8/call check-stream-equal/disp32 +4992 e8/call check-stream-equal/disp32 4993 # . . discard args 4994 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 4995 # . epilogue @@ -4087,38 +4087,38 @@ if ('onhashchange' in window) { 5005 # setup 5006 # . clear-stream(_test-input-stream) 5007 # . . push args -5008 68/push _test-input-stream/imm32 +5008 68/push _test-input-stream/imm32 5009 # . . call -5010 e8/call clear-stream/disp32 +5010 e8/call clear-stream/disp32 5011 # . . discard args 5012 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5013 # . clear-stream(_test-output-stream) 5014 # . . push args -5015 68/push _test-output-stream/imm32 +5015 68/push _test-output-stream/imm32 5016 # . . call -5017 e8/call clear-stream/disp32 +5017 e8/call clear-stream/disp32 5018 # . . discard args 5019 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5020 # . clear-stream($_test-output-buffered-file->buffer) 5021 # . . push args 5022 68/push $_test-output-buffered-file->buffer/imm32 5023 # . . call -5024 e8/call clear-stream/disp32 +5024 e8/call clear-stream/disp32 5025 # . . discard args 5026 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5027 # initialize input 5028 # . write(_test-input-stream, "8b/copy 0/mod 4/rm32 1/r32 1/index 0/scale") 5029 # . . push args 5030 68/push "8b/copy 0/mod 4/rm32 1/r32 1/index 0/scale"/imm32 -5031 68/push _test-input-stream/imm32 +5031 68/push _test-input-stream/imm32 5032 # . . call -5033 e8/call write/disp32 +5033 e8/call write/disp32 5034 # . . discard args 5035 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 5036 # convert-instruction(_test-input-stream, _test-output-buffered-file) 5037 # . . push args -5038 68/push _test-output-buffered-file/imm32 -5039 68/push _test-input-stream/imm32 +5038 68/push _test-output-buffered-file/imm32 +5039 68/push _test-input-stream/imm32 5040 # . . call 5041 e8/call convert-instruction/disp32 5042 # . . discard args @@ -4126,9 +4126,9 @@ if ('onhashchange' in window) { 5044 # check output 5045 # . flush(_test-output-buffered-file) 5046 # . . push args -5047 68/push _test-output-buffered-file/imm32 +5047 68/push _test-output-buffered-file/imm32 5048 # . . call -5049 e8/call flush/disp32 +5049 e8/call flush/disp32 5050 # . . discard args 5051 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5052 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -4136,9 +4136,9 @@ if ('onhashchange' in window) { 5079 # . . push args 5080 68/push "F - test-convert-instruction-emits-sib-byte-with-missing-base"/imm32 5081 68/push "8b 0c 08 # 8b/copy 0/mod 4/rm32 1/r32 1/index 0/scale"/imm32 -5082 68/push _test-output-stream/imm32 +5082 68/push _test-output-stream/imm32 5083 # . . call -5084 e8/call check-stream-equal/disp32 +5084 e8/call check-stream-equal/disp32 5085 # . . discard args 5086 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 5087 # . epilogue @@ -4154,38 +4154,38 @@ if ('onhashchange' in window) { 5097 # setup 5098 # . clear-stream(_test-input-stream) 5099 # . . push args -5100 68/push _test-input-stream/imm32 +5100 68/push _test-input-stream/imm32 5101 # . . call -5102 e8/call clear-stream/disp32 +5102 e8/call clear-stream/disp32 5103 # . . discard args 5104 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5105 # . clear-stream(_test-output-stream) 5106 # . . push args -5107 68/push _test-output-stream/imm32 +5107 68/push _test-output-stream/imm32 5108 # . . call -5109 e8/call clear-stream/disp32 +5109 e8/call clear-stream/disp32 5110 # . . discard args 5111 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5112 # . clear-stream($_test-output-buffered-file->buffer) 5113 # . . push args 5114 68/push $_test-output-buffered-file->buffer/imm32 5115 # . . call -5116 e8/call clear-stream/disp32 +5116 e8/call clear-stream/disp32 5117 # . . discard args 5118 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5119 # initialize input 5120 # . write(_test-input-stream, "8b/copy 0/mod 4/rm32 1/r32 0/base 0/scale") 5121 # . . push args 5122 68/push "8b/copy 0/mod 4/rm32 1/r32 0/base 0/scale"/imm32 -5123 68/push _test-input-stream/imm32 +5123 68/push _test-input-stream/imm32 5124 # . . call -5125 e8/call write/disp32 +5125 e8/call write/disp32 5126 # . . discard args 5127 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 5128 # convert-instruction(_test-input-stream, _test-output-buffered-file) 5129 # . . push args -5130 68/push _test-output-buffered-file/imm32 -5131 68/push _test-input-stream/imm32 +5130 68/push _test-output-buffered-file/imm32 +5131 68/push _test-input-stream/imm32 5132 # . . call 5133 e8/call convert-instruction/disp32 5134 # . . discard args @@ -4193,9 +4193,9 @@ if ('onhashchange' in window) { 5136 # check output 5137 # . flush(_test-output-buffered-file) 5138 # . . push args -5139 68/push _test-output-buffered-file/imm32 +5139 68/push _test-output-buffered-file/imm32 5140 # . . call -5141 e8/call flush/disp32 +5141 e8/call flush/disp32 5142 # . . discard args 5143 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5144 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -4203,9 +4203,9 @@ if ('onhashchange' in window) { 5171 # . . push args 5172 68/push "F - test-convert-instruction-emits-sib-byte-with-missing-index"/imm32 5173 68/push "8b 0c 00 # 8b/copy 0/mod 4/rm32 1/r32 0/base 0/scale"/imm32 -5174 68/push _test-output-stream/imm32 +5174 68/push _test-output-stream/imm32 5175 # . . call -5176 e8/call check-stream-equal/disp32 +5176 e8/call check-stream-equal/disp32 5177 # . . discard args 5178 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 5179 # . epilogue @@ -4221,38 +4221,38 @@ if ('onhashchange' in window) { 5189 # setup 5190 # . clear-stream(_test-input-stream) 5191 # . . push args -5192 68/push _test-input-stream/imm32 +5192 68/push _test-input-stream/imm32 5193 # . . call -5194 e8/call clear-stream/disp32 +5194 e8/call clear-stream/disp32 5195 # . . discard args 5196 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5197 # . clear-stream(_test-output-stream) 5198 # . . push args -5199 68/push _test-output-stream/imm32 +5199 68/push _test-output-stream/imm32 5200 # . . call -5201 e8/call clear-stream/disp32 +5201 e8/call clear-stream/disp32 5202 # . . discard args 5203 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5204 # . clear-stream($_test-output-buffered-file->buffer) 5205 # . . push args 5206 68/push $_test-output-buffered-file->buffer/imm32 5207 # . . call -5208 e8/call clear-stream/disp32 +5208 e8/call clear-stream/disp32 5209 # . . discard args 5210 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5211 # initialize input 5212 # . write(_test-input-stream, "8b/copy 0/mod 4/rm32 1/r32 0/base 1/index") 5213 # . . push args 5214 68/push "8b/copy 0/mod 4/rm32 1/r32 0/base 1/index"/imm32 -5215 68/push _test-input-stream/imm32 +5215 68/push _test-input-stream/imm32 5216 # . . call -5217 e8/call write/disp32 +5217 e8/call write/disp32 5218 # . . discard args 5219 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 5220 # convert-instruction(_test-input-stream, _test-output-buffered-file) 5221 # . . push args -5222 68/push _test-output-buffered-file/imm32 -5223 68/push _test-input-stream/imm32 +5222 68/push _test-output-buffered-file/imm32 +5223 68/push _test-input-stream/imm32 5224 # . . call 5225 e8/call convert-instruction/disp32 5226 # . . discard args @@ -4260,9 +4260,9 @@ if ('onhashchange' in window) { 5228 # check output 5229 # . flush(_test-output-buffered-file) 5230 # . . push args -5231 68/push _test-output-buffered-file/imm32 +5231 68/push _test-output-buffered-file/imm32 5232 # . . call -5233 e8/call flush/disp32 +5233 e8/call flush/disp32 5234 # . . discard args 5235 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5236 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -4270,9 +4270,9 @@ if ('onhashchange' in window) { 5263 # . . push args 5264 68/push "F - test-convert-instruction-emits-sib-byte-with-missing-scale"/imm32 5265 68/push "8b 0c 08 # 8b/copy 0/mod 4/rm32 1/r32 0/base 1/index"/imm32 -5266 68/push _test-output-stream/imm32 +5266 68/push _test-output-stream/imm32 5267 # . . call -5268 e8/call check-stream-equal/disp32 +5268 e8/call check-stream-equal/disp32 5269 # . . discard args 5270 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 5271 # . epilogue @@ -4288,38 +4288,38 @@ if ('onhashchange' in window) { 5281 # setup 5282 # . clear-stream(_test-input-stream) 5283 # . . push args -5284 68/push _test-input-stream/imm32 +5284 68/push _test-input-stream/imm32 5285 # . . call -5286 e8/call clear-stream/disp32 +5286 e8/call clear-stream/disp32 5287 # . . discard args 5288 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5289 # . clear-stream(_test-output-stream) 5290 # . . push args -5291 68/push _test-output-stream/imm32 +5291 68/push _test-output-stream/imm32 5292 # . . call -5293 e8/call clear-stream/disp32 +5293 e8/call clear-stream/disp32 5294 # . . discard args 5295 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5296 # . clear-stream($_test-output-buffered-file->buffer) 5297 # . . push args 5298 68/push $_test-output-buffered-file->buffer/imm32 5299 # . . call -5300 e8/call clear-stream/disp32 +5300 e8/call clear-stream/disp32 5301 # . . discard args 5302 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5303 # initialize input 5304 # . write(_test-input-stream, "e8/call 20/disp32") 5305 # . . push args 5306 68/push "e8/call 20/disp32"/imm32 -5307 68/push _test-input-stream/imm32 +5307 68/push _test-input-stream/imm32 5308 # . . call -5309 e8/call write/disp32 +5309 e8/call write/disp32 5310 # . . discard args 5311 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 5312 # convert-instruction(_test-input-stream, _test-output-buffered-file) 5313 # . . push args -5314 68/push _test-output-buffered-file/imm32 -5315 68/push _test-input-stream/imm32 +5314 68/push _test-output-buffered-file/imm32 +5315 68/push _test-input-stream/imm32 5316 # . . call 5317 e8/call convert-instruction/disp32 5318 # . . discard args @@ -4327,9 +4327,9 @@ if ('onhashchange' in window) { 5320 # check output 5321 # . flush(_test-output-buffered-file) 5322 # . . push args -5323 68/push _test-output-buffered-file/imm32 +5323 68/push _test-output-buffered-file/imm32 5324 # . . call -5325 e8/call flush/disp32 +5325 e8/call flush/disp32 5326 # . . discard args 5327 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5328 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -4337,9 +4337,9 @@ if ('onhashchange' in window) { 5355 # . . push args 5356 68/push "F - test-convert-instruction-handles-disp32-operand"/imm32 5357 68/push "e8 20 00 00 00 # e8/call 20/disp32"/imm32 -5358 68/push _test-output-stream/imm32 +5358 68/push _test-output-stream/imm32 5359 # . . call -5360 e8/call check-stream-equal/disp32 +5360 e8/call check-stream-equal/disp32 5361 # . . discard args 5362 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 5363 # . epilogue @@ -4355,38 +4355,38 @@ if ('onhashchange' in window) { 5373 # setup 5374 # . clear-stream(_test-input-stream) 5375 # . . push args -5376 68/push _test-input-stream/imm32 +5376 68/push _test-input-stream/imm32 5377 # . . call -5378 e8/call clear-stream/disp32 +5378 e8/call clear-stream/disp32 5379 # . . discard args 5380 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5381 # . clear-stream(_test-output-stream) 5382 # . . push args -5383 68/push _test-output-stream/imm32 +5383 68/push _test-output-stream/imm32 5384 # . . call -5385 e8/call clear-stream/disp32 +5385 e8/call clear-stream/disp32 5386 # . . discard args 5387 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5388 # . clear-stream($_test-output-buffered-file->buffer) 5389 # . . push args 5390 68/push $_test-output-buffered-file->buffer/imm32 5391 # . . call -5392 e8/call clear-stream/disp32 +5392 e8/call clear-stream/disp32 5393 # . . discard args 5394 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5395 # initialize input 5396 # . write(_test-input-stream, "e8/call 20/disp16") 5397 # . . push args 5398 68/push "e8/call 20/disp16"/imm32 # not a valid instruction -5399 68/push _test-input-stream/imm32 +5399 68/push _test-input-stream/imm32 5400 # . . call -5401 e8/call write/disp32 +5401 e8/call write/disp32 5402 # . . discard args 5403 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 5404 # convert-instruction(_test-input-stream, _test-output-buffered-file) 5405 # . . push args -5406 68/push _test-output-buffered-file/imm32 -5407 68/push _test-input-stream/imm32 +5406 68/push _test-output-buffered-file/imm32 +5407 68/push _test-input-stream/imm32 5408 # . . call 5409 e8/call convert-instruction/disp32 5410 # . . discard args @@ -4394,9 +4394,9 @@ if ('onhashchange' in window) { 5412 # check output 5413 # . flush(_test-output-buffered-file) 5414 # . . push args -5415 68/push _test-output-buffered-file/imm32 +5415 68/push _test-output-buffered-file/imm32 5416 # . . call -5417 e8/call flush/disp32 +5417 e8/call flush/disp32 5418 # . . discard args 5419 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5420 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -4404,9 +4404,9 @@ if ('onhashchange' in window) { 5447 # . . push args 5448 68/push "F - test-convert-instruction-handles-disp16-operand"/imm32 5449 68/push "e8 20 00 # e8/call 20/disp16"/imm32 -5450 68/push _test-output-stream/imm32 +5450 68/push _test-output-stream/imm32 5451 # . . call -5452 e8/call check-stream-equal/disp32 +5452 e8/call check-stream-equal/disp32 5453 # . . discard args 5454 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 5455 # . epilogue @@ -4422,38 +4422,38 @@ if ('onhashchange' in window) { 5465 # setup 5466 # . clear-stream(_test-input-stream) 5467 # . . push args -5468 68/push _test-input-stream/imm32 +5468 68/push _test-input-stream/imm32 5469 # . . call -5470 e8/call clear-stream/disp32 +5470 e8/call clear-stream/disp32 5471 # . . discard args 5472 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5473 # . clear-stream(_test-output-stream) 5474 # . . push args -5475 68/push _test-output-stream/imm32 +5475 68/push _test-output-stream/imm32 5476 # . . call -5477 e8/call clear-stream/disp32 +5477 e8/call clear-stream/disp32 5478 # . . discard args 5479 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5480 # . clear-stream($_test-output-buffered-file->buffer) 5481 # . . push args 5482 68/push $_test-output-buffered-file->buffer/imm32 5483 # . . call -5484 e8/call clear-stream/disp32 +5484 e8/call clear-stream/disp32 5485 # . . discard args 5486 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5487 # initialize input 5488 # . write(_test-input-stream, "eb/jump 20/disp8") 5489 # . . push args 5490 68/push "eb/jump 20/disp8"/imm32 -5491 68/push _test-input-stream/imm32 +5491 68/push _test-input-stream/imm32 5492 # . . call -5493 e8/call write/disp32 +5493 e8/call write/disp32 5494 # . . discard args 5495 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 5496 # convert-instruction(_test-input-stream, _test-output-buffered-file) 5497 # . . push args -5498 68/push _test-output-buffered-file/imm32 -5499 68/push _test-input-stream/imm32 +5498 68/push _test-output-buffered-file/imm32 +5499 68/push _test-input-stream/imm32 5500 # . . call 5501 e8/call convert-instruction/disp32 5502 # . . discard args @@ -4461,9 +4461,9 @@ if ('onhashchange' in window) { 5504 # check output 5505 # . flush(_test-output-buffered-file) 5506 # . . push args -5507 68/push _test-output-buffered-file/imm32 +5507 68/push _test-output-buffered-file/imm32 5508 # . . call -5509 e8/call flush/disp32 +5509 e8/call flush/disp32 5510 # . . discard args 5511 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5512 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -4471,9 +4471,9 @@ if ('onhashchange' in window) { 5539 # . . push args 5540 68/push "F - test-convert-instruction-handles-disp8-operand"/imm32 5541 68/push "eb 20 # eb/jump 20/disp8"/imm32 -5542 68/push _test-output-stream/imm32 +5542 68/push _test-output-stream/imm32 5543 # . . call -5544 e8/call check-stream-equal/disp32 +5544 e8/call check-stream-equal/disp32 5545 # . . discard args 5546 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 5547 # . epilogue @@ -4489,38 +4489,38 @@ if ('onhashchange' in window) { 5557 # setup 5558 # . clear-stream(_test-input-stream) 5559 # . . push args -5560 68/push _test-input-stream/imm32 +5560 68/push _test-input-stream/imm32 5561 # . . call -5562 e8/call clear-stream/disp32 +5562 e8/call clear-stream/disp32 5563 # . . discard args 5564 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5565 # . clear-stream(_test-output-stream) 5566 # . . push args -5567 68/push _test-output-stream/imm32 +5567 68/push _test-output-stream/imm32 5568 # . . call -5569 e8/call clear-stream/disp32 +5569 e8/call clear-stream/disp32 5570 # . . discard args 5571 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5572 # . clear-stream($_test-output-buffered-file->buffer) 5573 # . . push args 5574 68/push $_test-output-buffered-file->buffer/imm32 5575 # . . call -5576 e8/call clear-stream/disp32 +5576 e8/call clear-stream/disp32 5577 # . . discard args 5578 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5579 # initialize input 5580 # . write(_test-input-stream, "eb/jump xyz/disp8") 5581 # . . push args 5582 68/push "eb/jump xyz/disp8"/imm32 -5583 68/push _test-input-stream/imm32 +5583 68/push _test-input-stream/imm32 5584 # . . call -5585 e8/call write/disp32 +5585 e8/call write/disp32 5586 # . . discard args 5587 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 5588 # convert-instruction(_test-input-stream, _test-output-buffered-file) 5589 # . . push args -5590 68/push _test-output-buffered-file/imm32 -5591 68/push _test-input-stream/imm32 +5590 68/push _test-output-buffered-file/imm32 +5591 68/push _test-input-stream/imm32 5592 # . . call 5593 e8/call convert-instruction/disp32 5594 # . . discard args @@ -4528,9 +4528,9 @@ if ('onhashchange' in window) { 5596 # check output 5597 # . flush(_test-output-buffered-file) 5598 # . . push args -5599 68/push _test-output-buffered-file/imm32 +5599 68/push _test-output-buffered-file/imm32 5600 # . . call -5601 e8/call flush/disp32 +5601 e8/call flush/disp32 5602 # . . discard args 5603 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5604 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -4538,9 +4538,9 @@ if ('onhashchange' in window) { 5631 # . . push args 5632 68/push "F - test-convert-instruction-handles-disp8-name"/imm32 5633 68/push "eb xyz/disp8 # eb/jump xyz/disp8"/imm32 -5634 68/push _test-output-stream/imm32 +5634 68/push _test-output-stream/imm32 5635 # . . call -5636 e8/call check-stream-equal/disp32 +5636 e8/call check-stream-equal/disp32 5637 # . . discard args 5638 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 5639 # . epilogue @@ -4556,38 +4556,38 @@ if ('onhashchange' in window) { 5649 # setup 5650 # . clear-stream(_test-input-stream) 5651 # . . push args -5652 68/push _test-input-stream/imm32 +5652 68/push _test-input-stream/imm32 5653 # . . call -5654 e8/call clear-stream/disp32 +5654 e8/call clear-stream/disp32 5655 # . . discard args 5656 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5657 # . clear-stream(_test-output-stream) 5658 # . . push args -5659 68/push _test-output-stream/imm32 +5659 68/push _test-output-stream/imm32 5660 # . . call -5661 e8/call clear-stream/disp32 +5661 e8/call clear-stream/disp32 5662 # . . discard args 5663 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5664 # . clear-stream($_test-output-buffered-file->buffer) 5665 # . . push args 5666 68/push $_test-output-buffered-file->buffer/imm32 5667 # . . call -5668 e8/call clear-stream/disp32 +5668 e8/call clear-stream/disp32 5669 # . . discard args 5670 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5671 # initialize input 5672 # . write(_test-input-stream, "68/push 0x20/imm32") 5673 # . . push args 5674 68/push "68/push 0x20/imm32"/imm32 -5675 68/push _test-input-stream/imm32 +5675 68/push _test-input-stream/imm32 5676 # . . call -5677 e8/call write/disp32 +5677 e8/call write/disp32 5678 # . . discard args 5679 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 5680 # convert-instruction(_test-input-stream, _test-output-buffered-file) 5681 # . . push args -5682 68/push _test-output-buffered-file/imm32 -5683 68/push _test-input-stream/imm32 +5682 68/push _test-output-buffered-file/imm32 +5683 68/push _test-input-stream/imm32 5684 # . . call 5685 e8/call convert-instruction/disp32 5686 # . . discard args @@ -4595,9 +4595,9 @@ if ('onhashchange' in window) { 5688 # check output 5689 # . flush(_test-output-buffered-file) 5690 # . . push args -5691 68/push _test-output-buffered-file/imm32 +5691 68/push _test-output-buffered-file/imm32 5692 # . . call -5693 e8/call flush/disp32 +5693 e8/call flush/disp32 5694 # . . discard args 5695 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5696 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -4605,9 +4605,9 @@ if ('onhashchange' in window) { 5723 # . . push args 5724 68/push "F - test-convert-instruction-handles-imm32-operand"/imm32 5725 68/push "68 20 00 00 00 # 68/push 0x20/imm32"/imm32 -5726 68/push _test-output-stream/imm32 +5726 68/push _test-output-stream/imm32 5727 # . . call -5728 e8/call check-stream-equal/disp32 +5728 e8/call check-stream-equal/disp32 5729 # . . discard args 5730 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 5731 # . epilogue @@ -4624,38 +4624,38 @@ if ('onhashchange' in window) { 5742 # setup 5743 # . clear-stream(_test-input-stream) 5744 # . . push args -5745 68/push _test-input-stream/imm32 +5745 68/push _test-input-stream/imm32 5746 # . . call -5747 e8/call clear-stream/disp32 +5747 e8/call clear-stream/disp32 5748 # . . discard args 5749 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5750 # . clear-stream(_test-output-stream) 5751 # . . push args -5752 68/push _test-output-stream/imm32 +5752 68/push _test-output-stream/imm32 5753 # . . call -5754 e8/call clear-stream/disp32 +5754 e8/call clear-stream/disp32 5755 # . . discard args 5756 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5757 # . clear-stream($_test-output-buffered-file->buffer) 5758 # . . push args 5759 68/push $_test-output-buffered-file->buffer/imm32 5760 # . . call -5761 e8/call clear-stream/disp32 +5761 e8/call clear-stream/disp32 5762 # . . discard args 5763 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5764 # initialize input 5765 # . write(_test-input-stream, "68/push 0x20/imm16") 5766 # . . push args 5767 68/push "68/push 0x20/imm16"/imm32 # not a valid instruction -5768 68/push _test-input-stream/imm32 +5768 68/push _test-input-stream/imm32 5769 # . . call -5770 e8/call write/disp32 +5770 e8/call write/disp32 5771 # . . discard args 5772 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 5773 # convert-instruction(_test-input-stream, _test-output-buffered-file) 5774 # . . push args -5775 68/push _test-output-buffered-file/imm32 -5776 68/push _test-input-stream/imm32 +5775 68/push _test-output-buffered-file/imm32 +5776 68/push _test-input-stream/imm32 5777 # . . call 5778 e8/call convert-instruction/disp32 5779 # . . discard args @@ -4663,9 +4663,9 @@ if ('onhashchange' in window) { 5781 # check output 5782 # . flush(_test-output-buffered-file) 5783 # . . push args -5784 68/push _test-output-buffered-file/imm32 +5784 68/push _test-output-buffered-file/imm32 5785 # . . call -5786 e8/call flush/disp32 +5786 e8/call flush/disp32 5787 # . . discard args 5788 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5789 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -4673,9 +4673,9 @@ if ('onhashchange' in window) { 5816 # . . push args 5817 68/push "F - test-convert-instruction-handles-imm16-operand"/imm32 5818 68/push "68 20 00 # 68/push 0x20/imm16"/imm32 -5819 68/push _test-output-stream/imm32 +5819 68/push _test-output-stream/imm32 5820 # . . call -5821 e8/call check-stream-equal/disp32 +5821 e8/call check-stream-equal/disp32 5822 # . . discard args 5823 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 5824 # . epilogue @@ -4692,38 +4692,38 @@ if ('onhashchange' in window) { 5835 # setup 5836 # . clear-stream(_test-input-stream) 5837 # . . push args -5838 68/push _test-input-stream/imm32 +5838 68/push _test-input-stream/imm32 5839 # . . call -5840 e8/call clear-stream/disp32 +5840 e8/call clear-stream/disp32 5841 # . . discard args 5842 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5843 # . clear-stream(_test-output-stream) 5844 # . . push args -5845 68/push _test-output-stream/imm32 +5845 68/push _test-output-stream/imm32 5846 # . . call -5847 e8/call clear-stream/disp32 +5847 e8/call clear-stream/disp32 5848 # . . discard args 5849 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5850 # . clear-stream($_test-output-buffered-file->buffer) 5851 # . . push args 5852 68/push $_test-output-buffered-file->buffer/imm32 5853 # . . call -5854 e8/call clear-stream/disp32 +5854 e8/call clear-stream/disp32 5855 # . . discard args 5856 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5857 # initialize input 5858 # . write(_test-input-stream, "68/push 0x20/imm8") 5859 # . . push args 5860 68/push "68/push 0x20/imm8"/imm32 -5861 68/push _test-input-stream/imm32 +5861 68/push _test-input-stream/imm32 5862 # . . call -5863 e8/call write/disp32 +5863 e8/call write/disp32 5864 # . . discard args 5865 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 5866 # convert-instruction(_test-input-stream, _test-output-buffered-file) 5867 # . . push args -5868 68/push _test-output-buffered-file/imm32 -5869 68/push _test-input-stream/imm32 +5868 68/push _test-output-buffered-file/imm32 +5869 68/push _test-input-stream/imm32 5870 # . . call 5871 e8/call convert-instruction/disp32 5872 # . . discard args @@ -4731,9 +4731,9 @@ if ('onhashchange' in window) { 5874 # check output 5875 # . flush(_test-output-buffered-file) 5876 # . . push args -5877 68/push _test-output-buffered-file/imm32 +5877 68/push _test-output-buffered-file/imm32 5878 # . . call -5879 e8/call flush/disp32 +5879 e8/call flush/disp32 5880 # . . discard args 5881 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5882 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -4741,9 +4741,9 @@ if ('onhashchange' in window) { 5909 # . . push args 5910 68/push "F - test-convert-instruction-handles-imm8-operand"/imm32 5911 68/push "68 20 # 68/push 0x20/imm8"/imm32 -5912 68/push _test-output-stream/imm32 +5912 68/push _test-output-stream/imm32 5913 # . . call -5914 e8/call check-stream-equal/disp32 +5914 e8/call check-stream-equal/disp32 5915 # . . discard args 5916 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 5917 # . epilogue @@ -4772,14 +4772,14 @@ if ('onhashchange' in window) { 5940 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 . # push *(esi+4) 5941 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . . # push *esi 5942 # . . call -5943 e8/call next-token-from-slice/disp32 +5943 e8/call next-token-from-slice/disp32 5944 # . . discard args 5945 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32 # add to esp 5946 # return parse-hex-int-from-slice(slice) 5947 # . . push args 5948 51/push-ecx 5949 # . . call -5950 e8/call parse-hex-int-from-slice/disp32 +5950 e8/call parse-hex-int-from-slice/disp32 5951 # . . discard args 5952 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 5953 $parse-datum-of-word:end: diff --git a/html/apps/parse-int.mu.html b/html/apps/parse-int.mu.html index 68bc12a7..e347f1a5 100644 --- a/html/apps/parse-int.mu.html +++ b/html/apps/parse-int.mu.html @@ -72,7 +72,7 @@ if ('onhashchange' in window) { 14 compare n, 1 15 { 16 break-if-> -17 print-string-to-screen "usage: parse-int <integer>\n" +17 print-string-to-screen "usage: parse-int <integer>\n" 18 exit-status <- copy 1 19 break $main-body 20 } @@ -99,7 +99,7 @@ if ('onhashchange' in window) { 41 var c/eax: byte <- copy 0 42 c <- copy-byte *tmp 43 # -44 var digit/eax: int <- to-decimal-digit c +44 var digit/eax: int <- to-decimal-digit c 45 out <- add digit 46 i <- increment 47 loop diff --git a/html/apps/print-file.mu.html b/html/apps/print-file.mu.html index b567e515..fae1ca3f 100644 --- a/html/apps/print-file.mu.html +++ b/html/apps/print-file.mu.html @@ -72,7 +72,7 @@ if ('onhashchange' in window) { 14 compare n, 1 15 { 16 break-if-> -17 print-string-to-screen "usage: cat <filename>\n" +17 print-string-to-screen "usage: cat <filename>\n" 18 break $main-body 19 } 20 { @@ -81,15 +81,15 @@ if ('onhashchange' in window) { 23 var in: (handle buffered-file) 24 { 25 var addr-in/eax: (addr handle buffered-file) <- address in -26 open *filename, 0, addr-in +26 open *filename, 0, addr-in 27 } -28 var _in-addr/eax: (addr buffered-file) <- lookup in +28 var _in-addr/eax: (addr buffered-file) <- lookup in 29 var in-addr/ecx: (addr buffered-file) <- copy _in-addr 30 { -31 var c/eax: byte <- read-byte-buffered in-addr +31 var c/eax: byte <- read-byte-buffered in-addr 32 compare c, 0xffffffff # EOF marker 33 break-if-= -34 print-byte-to-screen c +34 print-byte-to-screen c 35 loop 36 } 37 } diff --git a/html/apps/random.subx.html b/html/apps/random.subx.html index bc570016..5605936d 100644 --- a/html/apps/random.subx.html +++ b/html/apps/random.subx.html @@ -87,16 +87,16 @@ if ('onhashchange' in window) { 29 # write-int32-hex-buffered(Stdout, *N) 30 # . . push args 31 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . N/disp32 # push *N -32 68/push Stdout/imm32 +32 68/push Stdout/imm32 33 # . . call -34 e8/call write-int32-hex-buffered/disp32 +34 e8/call write-int32-hex-buffered/disp32 35 36 # write-buffered(Stdout, Newline) 37 # . . push args -38 68/push Newline/imm32 -39 68/push Stdout/imm32 +38 68/push Newline/imm32 +39 68/push Stdout/imm32 40 # . . call -41 e8/call write-buffered/disp32 +41 e8/call write-buffered/disp32 42 # . . discard args 43 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 44 diff --git a/html/apps/sigils.subx.html b/html/apps/sigils.subx.html index b6ddf5ac..92ac0c01 100644 --- a/html/apps/sigils.subx.html +++ b/html/apps/sigils.subx.html @@ -120,10 +120,10 @@ if ('onhashchange' in window) { 58 # initialize heap 59 # . Heap = new-segment(Heap-size) 60 # . . push args - 61 68/push Heap/imm32 - 62 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Heap-size/disp32 # push *Heap-size + 61 68/push Heap/imm32 + 62 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Heap-size/disp32 # push *Heap-size 63 # . . call - 64 e8/call new-segment/disp32 + 64 e8/call new-segment/disp32 65 # . . discard args 66 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 67 @@ -137,7 +137,7 @@ if ('onhashchange' in window) { 75 68/push "test"/imm32 76 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 77 # . . call - 78 e8/call kernel-string-equal?/disp32 + 78 e8/call kernel-string-equal?/disp32 79 # . . discard args 80 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 81 # . if (eax == false) goto interactive @@ -146,14 +146,14 @@ if ('onhashchange' in window) { 84 # run-tests() 85 e8/call run-tests/disp32 86 # syscall(exit, *Num-test-failures) - 87 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/ebx Num-test-failures/disp32 # copy *Num-test-failures to ebx + 87 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/ebx Num-test-failures/disp32 # copy *Num-test-failures to ebx 88 eb/jump $subx-sigils-main:end/disp8 89 $subx-sigils-main:interactive: 90 # - otherwise convert stdin 91 # subx-sigils(Stdin, Stdout) 92 # . . push args - 93 68/push Stdout/imm32 - 94 68/push Stdin/imm32 + 93 68/push Stdout/imm32 + 94 68/push Stdin/imm32 95 # . . call 96 e8/call subx-sigils/disp32 97 # . . discard args @@ -217,7 +217,7 @@ if ('onhashchange' in window) { 155 # . . push args 156 51/push-ecx 157 # . . call - 158 e8/call clear-stream/disp32 + 158 e8/call clear-stream/disp32 159 # . . discard args 160 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 161 # read-line-buffered(in, line) @@ -225,7 +225,7 @@ if ('onhashchange' in window) { 163 51/push-ecx 164 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 165 # . . call - 166 e8/call read-line-buffered/disp32 + 166 e8/call read-line-buffered/disp32 167 # . . discard args 168 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 169 $subx-sigils:check0: @@ -247,7 +247,7 @@ if ('onhashchange' in window) { 185 # . . push args 186 52/push-edx 187 # . . call - 188 e8/call slice-empty?/disp32 + 188 e8/call slice-empty?/disp32 189 # . . discard args 190 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 191 # . if (eax != false) break @@ -278,7 +278,7 @@ if ('onhashchange' in window) { 255 # . . discard args 256 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 257 # continue - 258 e9/jump $subx-sigils:next-word/disp32 + 258 e9/jump $subx-sigils:next-word/disp32 259 $subx-sigils:check-for-indirect-mode: 260 # if (!slice-starts-with?(word-slice, "*")) goto next check 261 3d/compare-eax-and 0x2a/imm32/asterisk @@ -304,7 +304,7 @@ if ('onhashchange' in window) { 281 # . . discard args 282 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 283 # continue - 284 e9/jump $subx-sigils:next-word/disp32 + 284 e9/jump $subx-sigils:next-word/disp32 285 $subx-sigils:indirect-mode: 286 # spill registers 287 50/push-eax @@ -335,7 +335,7 @@ if ('onhashchange' in window) { 312 59/pop-to-ecx 313 58/pop-to-eax 314 # continue - 315 e9/jump $subx-sigils:next-word/disp32 + 315 e9/jump $subx-sigils:next-word/disp32 316 $subx-sigils:check-for-invalid-addition: 317 # if (slice-starts-with?(word-slice, "+")) goto error1 318 3d/compare-eax-and 0x2b/imm32/plus @@ -350,17 +350,17 @@ if ('onhashchange' in window) { 327 52/push-edx 328 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 329 # . . call - 330 e8/call write-slice-buffered/disp32 + 330 e8/call write-slice-buffered/disp32 331 # . . discard args 332 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 333 # fall through - 334 $subx-sigils:next-word: + 334 $subx-sigils:next-word: 335 # write-buffered(out, " ") 336 # . . push args - 337 68/push Space/imm32 + 337 68/push Space/imm32 338 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 339 # . . call - 340 e8/call write-buffered/disp32 + 340 e8/call write-buffered/disp32 341 # . . discard args 342 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 343 # loop @@ -368,10 +368,10 @@ if ('onhashchange' in window) { 345 $subx-sigils:next-line: 346 # write-buffered(out, "\n") 347 # . . push args - 348 68/push Newline/imm32 + 348 68/push Newline/imm32 349 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 350 # . . call - 351 e8/call write-buffered/disp32 + 351 e8/call write-buffered/disp32 352 # . . discard args 353 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 354 # loop @@ -381,7 +381,7 @@ if ('onhashchange' in window) { 358 # . . push args 359 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 360 # . . call - 361 e8/call flush/disp32 + 361 e8/call flush/disp32 362 # . . discard args 363 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 364 $subx-sigils:end: @@ -402,48 +402,48 @@ if ('onhashchange' in window) { 379 # . write-buffered(Stderr, "error: '") 380 # . . push args 381 68/push "error: '"/imm32 - 382 68/push Stderr/imm32 + 382 68/push Stderr/imm32 383 # . . call - 384 e8/call write-buffered/disp32 + 384 e8/call write-buffered/disp32 385 # . . discard args 386 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 387 # . write-byte-buffered(Stderr, eax) 388 # . . push args 389 50/push-eax - 390 68/push Stderr/imm32 + 390 68/push Stderr/imm32 391 # . . call - 392 e8/call write-byte-buffered/disp32 + 392 e8/call write-byte-buffered/disp32 393 # . . discard args 394 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 395 # . write-buffered(Stderr, "' only permitted within '*(...)' in '") 396 # . . push args 397 68/push "' only permitted within '*(...)' in '"/imm32 - 398 68/push Stderr/imm32 + 398 68/push Stderr/imm32 399 # . . call - 400 e8/call write-buffered/disp32 + 400 e8/call write-buffered/disp32 401 # . . discard args 402 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 403 # . write-stream-data(Stderr, line) 404 # . . push args 405 51/push-ecx - 406 68/push Stderr/imm32 + 406 68/push Stderr/imm32 407 # . . call - 408 e8/call write-stream-data/disp32 + 408 e8/call write-stream-data/disp32 409 # . . discard args 410 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 411 # . write-buffered(Stderr, "'") 412 # . . push args 413 68/push "'"/imm32 - 414 68/push Stderr/imm32 + 414 68/push Stderr/imm32 415 # . . call - 416 e8/call write-buffered/disp32 + 416 e8/call write-buffered/disp32 417 # . . discard args 418 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 419 # . flush(Stderr) 420 # . . push args - 421 68/push Stderr/imm32 + 421 68/push Stderr/imm32 422 # . . call - 423 e8/call flush/disp32 + 423 e8/call flush/disp32 424 # . . discard args 425 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 426 # . syscall(exit, 1) @@ -458,45 +458,45 @@ if ('onhashchange' in window) { 435 # setup 436 # . clear-stream(_test-input-stream) 437 # . . push args - 438 68/push _test-input-stream/imm32 + 438 68/push _test-input-stream/imm32 439 # . . call - 440 e8/call clear-stream/disp32 + 440 e8/call clear-stream/disp32 441 # . . discard args 442 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 443 # . clear-stream($_test-input-buffered-file->buffer) 444 # . . push args 445 68/push $_test-input-buffered-file->buffer/imm32 446 # . . call - 447 e8/call clear-stream/disp32 + 447 e8/call clear-stream/disp32 448 # . . discard args 449 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 450 # . clear-stream(_test-output-stream) 451 # . . push args - 452 68/push _test-output-stream/imm32 + 452 68/push _test-output-stream/imm32 453 # . . call - 454 e8/call clear-stream/disp32 + 454 e8/call clear-stream/disp32 455 # . . discard args 456 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 457 # . clear-stream($_test-output-buffered-file->buffer) 458 # . . push args 459 68/push $_test-output-buffered-file->buffer/imm32 460 # . . call - 461 e8/call clear-stream/disp32 + 461 e8/call clear-stream/disp32 462 # . . discard args 463 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 464 # initialize input 465 # . write(_test-input-stream, "== abcd 0x1") 466 # . . push args 467 68/push "== abcd 0x1"/imm32 - 468 68/push _test-input-stream/imm32 + 468 68/push _test-input-stream/imm32 469 # . . call - 470 e8/call write/disp32 + 470 e8/call write/disp32 471 # . . discard args 472 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 473 # subx-sigils(_test-input-buffered-file, _test-output-buffered-file) 474 # . . push args - 475 68/push _test-output-buffered-file/imm32 - 476 68/push _test-input-buffered-file/imm32 + 475 68/push _test-output-buffered-file/imm32 + 476 68/push _test-input-buffered-file/imm32 477 # . . call 478 e8/call subx-sigils/disp32 479 # . . discard args @@ -504,9 +504,9 @@ if ('onhashchange' in window) { 481 # check that the line just passed through 482 # . flush(_test-output-buffered-file) 483 # . . push args - 484 68/push _test-output-buffered-file/imm32 + 484 68/push _test-output-buffered-file/imm32 485 # . . call - 486 e8/call flush/disp32 + 486 e8/call flush/disp32 487 # . . discard args 488 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 489 +-- 26 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- @@ -514,9 +514,9 @@ if ('onhashchange' in window) { 516 # . . push args 517 68/push "F - test-subx-sigils-passes-most-words-through"/imm32 518 68/push "== abcd 0x1 \n"/imm32 - 519 68/push _test-output-stream/imm32 + 519 68/push _test-output-stream/imm32 520 # . . call - 521 e8/call check-stream-equal/disp32 + 521 e8/call check-stream-equal/disp32 522 # . . discard args 523 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 524 # . epilogue @@ -531,45 +531,45 @@ if ('onhashchange' in window) { 533 # setup 534 # . clear-stream(_test-input-stream) 535 # . . push args - 536 68/push _test-input-stream/imm32 + 536 68/push _test-input-stream/imm32 537 # . . call - 538 e8/call clear-stream/disp32 + 538 e8/call clear-stream/disp32 539 # . . discard args 540 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 541 # . clear-stream($_test-input-buffered-file->buffer) 542 # . . push args 543 68/push $_test-input-buffered-file->buffer/imm32 544 # . . call - 545 e8/call clear-stream/disp32 + 545 e8/call clear-stream/disp32 546 # . . discard args 547 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 548 # . clear-stream(_test-output-stream) 549 # . . push args - 550 68/push _test-output-stream/imm32 + 550 68/push _test-output-stream/imm32 551 # . . call - 552 e8/call clear-stream/disp32 + 552 e8/call clear-stream/disp32 553 # . . discard args 554 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 555 # . clear-stream($_test-output-buffered-file->buffer) 556 # . . push args 557 68/push $_test-output-buffered-file->buffer/imm32 558 # . . call - 559 e8/call clear-stream/disp32 + 559 e8/call clear-stream/disp32 560 # . . discard args 561 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 562 # initialize input 563 # . write(_test-input-stream, "ab %ecx") 564 # . . push args 565 68/push "ab %ecx"/imm32 - 566 68/push _test-input-stream/imm32 + 566 68/push _test-input-stream/imm32 567 # . . call - 568 e8/call write/disp32 + 568 e8/call write/disp32 569 # . . discard args 570 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 571 # subx-sigils(_test-input-buffered-file, _test-output-buffered-file) 572 # . . push args - 573 68/push _test-output-buffered-file/imm32 - 574 68/push _test-input-buffered-file/imm32 + 573 68/push _test-output-buffered-file/imm32 + 574 68/push _test-input-buffered-file/imm32 575 # . . call 576 e8/call subx-sigils/disp32 577 # . . discard args @@ -577,9 +577,9 @@ if ('onhashchange' in window) { 579 # check that the line just passed through 580 # . flush(_test-output-buffered-file) 581 # . . push args - 582 68/push _test-output-buffered-file/imm32 + 582 68/push _test-output-buffered-file/imm32 583 # . . call - 584 e8/call flush/disp32 + 584 e8/call flush/disp32 585 # . . discard args 586 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 587 +-- 26 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- @@ -587,9 +587,9 @@ if ('onhashchange' in window) { 614 # . . push args 615 68/push "F - test-subx-sigils-direct-mode"/imm32 616 68/push "ab 3/mod/direct 0x00000001/rm32 \n"/imm32 - 617 68/push _test-output-stream/imm32 + 617 68/push _test-output-stream/imm32 618 # . . call - 619 e8/call check-stream-equal/disp32 + 619 e8/call check-stream-equal/disp32 620 # . . discard args 621 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 622 # . epilogue @@ -604,45 +604,45 @@ if ('onhashchange' in window) { 631 # setup 632 # . clear-stream(_test-input-stream) 633 # . . push args - 634 68/push _test-input-stream/imm32 + 634 68/push _test-input-stream/imm32 635 # . . call - 636 e8/call clear-stream/disp32 + 636 e8/call clear-stream/disp32 637 # . . discard args 638 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 639 # . clear-stream($_test-input-buffered-file->buffer) 640 # . . push args 641 68/push $_test-input-buffered-file->buffer/imm32 642 # . . call - 643 e8/call clear-stream/disp32 + 643 e8/call clear-stream/disp32 644 # . . discard args 645 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 646 # . clear-stream(_test-output-stream) 647 # . . push args - 648 68/push _test-output-stream/imm32 + 648 68/push _test-output-stream/imm32 649 # . . call - 650 e8/call clear-stream/disp32 + 650 e8/call clear-stream/disp32 651 # . . discard args 652 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 653 # . clear-stream($_test-output-buffered-file->buffer) 654 # . . push args 655 68/push $_test-output-buffered-file->buffer/imm32 656 # . . call - 657 e8/call clear-stream/disp32 + 657 e8/call clear-stream/disp32 658 # . . discard args 659 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 660 # initialize input 661 # . write(_test-input-stream, "ab %ecx/foo") 662 # . . push args 663 68/push "ab %ecx/foo"/imm32 - 664 68/push _test-input-stream/imm32 + 664 68/push _test-input-stream/imm32 665 # . . call - 666 e8/call write/disp32 + 666 e8/call write/disp32 667 # . . discard args 668 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 669 # subx-sigils(_test-input-buffered-file, _test-output-buffered-file) 670 # . . push args - 671 68/push _test-output-buffered-file/imm32 - 672 68/push _test-input-buffered-file/imm32 + 671 68/push _test-output-buffered-file/imm32 + 672 68/push _test-input-buffered-file/imm32 673 # . . call 674 e8/call subx-sigils/disp32 675 # . . discard args @@ -650,18 +650,18 @@ if ('onhashchange' in window) { 677 # check that the line just passed through 678 # . flush(_test-output-buffered-file) 679 # . . push args - 680 68/push _test-output-buffered-file/imm32 + 680 68/push _test-output-buffered-file/imm32 681 # . . call - 682 e8/call flush/disp32 + 682 e8/call flush/disp32 683 # . . discard args 684 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 685 # . check-stream-equal(_test-output-stream, "ab 3/mod/direct 0x00000001/rm32 \n", msg) 686 # . . push args 687 68/push "F - test-subx-sigils-direct-mode-with-metadata"/imm32 688 68/push "ab 3/mod/direct 0x00000001/rm32 \n"/imm32 - 689 68/push _test-output-stream/imm32 + 689 68/push _test-output-stream/imm32 690 # . . call - 691 e8/call check-stream-equal/disp32 + 691 e8/call check-stream-equal/disp32 692 # . . discard args 693 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 694 # . epilogue @@ -676,45 +676,45 @@ if ('onhashchange' in window) { 703 # setup 704 # . clear-stream(_test-input-stream) 705 # . . push args - 706 68/push _test-input-stream/imm32 + 706 68/push _test-input-stream/imm32 707 # . . call - 708 e8/call clear-stream/disp32 + 708 e8/call clear-stream/disp32 709 # . . discard args 710 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 711 # . clear-stream($_test-input-buffered-file->buffer) 712 # . . push args 713 68/push $_test-input-buffered-file->buffer/imm32 714 # . . call - 715 e8/call clear-stream/disp32 + 715 e8/call clear-stream/disp32 716 # . . discard args 717 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 718 # . clear-stream(_test-output-stream) 719 # . . push args - 720 68/push _test-output-stream/imm32 + 720 68/push _test-output-stream/imm32 721 # . . call - 722 e8/call clear-stream/disp32 + 722 e8/call clear-stream/disp32 723 # . . discard args 724 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 725 # . clear-stream($_test-output-buffered-file->buffer) 726 # . . push args 727 68/push $_test-output-buffered-file->buffer/imm32 728 # . . call - 729 e8/call clear-stream/disp32 + 729 e8/call clear-stream/disp32 730 # . . discard args 731 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 732 # initialize input 733 # . write(_test-input-stream, "ab *ecx") 734 # . . push args 735 68/push "ab *ecx"/imm32 - 736 68/push _test-input-stream/imm32 + 736 68/push _test-input-stream/imm32 737 # . . call - 738 e8/call write/disp32 + 738 e8/call write/disp32 739 # . . discard args 740 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 741 # subx-sigils(_test-input-buffered-file, _test-output-buffered-file) 742 # . . push args - 743 68/push _test-output-buffered-file/imm32 - 744 68/push _test-input-buffered-file/imm32 + 743 68/push _test-output-buffered-file/imm32 + 744 68/push _test-input-buffered-file/imm32 745 # . . call 746 e8/call subx-sigils/disp32 747 # . . discard args @@ -722,9 +722,9 @@ if ('onhashchange' in window) { 749 # check that the line just passed through 750 # . flush(_test-output-buffered-file) 751 # . . push args - 752 68/push _test-output-buffered-file/imm32 + 752 68/push _test-output-buffered-file/imm32 753 # . . call - 754 e8/call flush/disp32 + 754 e8/call flush/disp32 755 # . . discard args 756 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 757 +-- 26 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- @@ -732,9 +732,9 @@ if ('onhashchange' in window) { 784 # . . push args 785 68/push "F - test-subx-sigils-register-indirect-mode"/imm32 786 68/push "ab 0/mod/indirect 0x00000001/rm32 \n"/imm32 - 787 68/push _test-output-stream/imm32 + 787 68/push _test-output-stream/imm32 788 # . . call - 789 e8/call check-stream-equal/disp32 + 789 e8/call check-stream-equal/disp32 790 # . . discard args 791 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 792 # . epilogue @@ -749,45 +749,45 @@ if ('onhashchange' in window) { 801 # setup 802 # . clear-stream(_test-input-stream) 803 # . . push args - 804 68/push _test-input-stream/imm32 + 804 68/push _test-input-stream/imm32 805 # . . call - 806 e8/call clear-stream/disp32 + 806 e8/call clear-stream/disp32 807 # . . discard args 808 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 809 # . clear-stream($_test-input-buffered-file->buffer) 810 # . . push args 811 68/push $_test-input-buffered-file->buffer/imm32 812 # . . call - 813 e8/call clear-stream/disp32 + 813 e8/call clear-stream/disp32 814 # . . discard args 815 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 816 # . clear-stream(_test-output-stream) 817 # . . push args - 818 68/push _test-output-stream/imm32 + 818 68/push _test-output-stream/imm32 819 # . . call - 820 e8/call clear-stream/disp32 + 820 e8/call clear-stream/disp32 821 # . . discard args 822 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 823 # . clear-stream($_test-output-buffered-file->buffer) 824 # . . push args 825 68/push $_test-output-buffered-file->buffer/imm32 826 # . . call - 827 e8/call clear-stream/disp32 + 827 e8/call clear-stream/disp32 828 # . . discard args 829 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 830 # initialize input 831 # . write(_test-input-stream, "ab *ecx/foo") 832 # . . push args 833 68/push "ab *ecx/foo"/imm32 - 834 68/push _test-input-stream/imm32 + 834 68/push _test-input-stream/imm32 835 # . . call - 836 e8/call write/disp32 + 836 e8/call write/disp32 837 # . . discard args 838 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 839 # subx-sigils(_test-input-buffered-file, _test-output-buffered-file) 840 # . . push args - 841 68/push _test-output-buffered-file/imm32 - 842 68/push _test-input-buffered-file/imm32 + 841 68/push _test-output-buffered-file/imm32 + 842 68/push _test-input-buffered-file/imm32 843 # . . call 844 e8/call subx-sigils/disp32 845 # . . discard args @@ -795,18 +795,18 @@ if ('onhashchange' in window) { 847 # check that the line just passed through 848 # . flush(_test-output-buffered-file) 849 # . . push args - 850 68/push _test-output-buffered-file/imm32 + 850 68/push _test-output-buffered-file/imm32 851 # . . call - 852 e8/call flush/disp32 + 852 e8/call flush/disp32 853 # . . discard args 854 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 855 # . check-stream-equal(_test-output-stream, "ab 0/mod/indirect 0x00000001/rm32 \n", msg) 856 # . . push args 857 68/push "F - test-subx-sigils-register-indirect-mode-with-metadata"/imm32 858 68/push "ab 0/mod/indirect 0x00000001/rm32 \n"/imm32 - 859 68/push _test-output-stream/imm32 + 859 68/push _test-output-stream/imm32 860 # . . call - 861 e8/call check-stream-equal/disp32 + 861 e8/call check-stream-equal/disp32 862 # . . discard args 863 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 864 # . epilogue @@ -821,45 +821,45 @@ if ('onhashchange' in window) { 873 # setup 874 # . clear-stream(_test-input-stream) 875 # . . push args - 876 68/push _test-input-stream/imm32 + 876 68/push _test-input-stream/imm32 877 # . . call - 878 e8/call clear-stream/disp32 + 878 e8/call clear-stream/disp32 879 # . . discard args 880 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 881 # . clear-stream($_test-input-buffered-file->buffer) 882 # . . push args 883 68/push $_test-input-buffered-file->buffer/imm32 884 # . . call - 885 e8/call clear-stream/disp32 + 885 e8/call clear-stream/disp32 886 # . . discard args 887 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 888 # . clear-stream(_test-output-stream) 889 # . . push args - 890 68/push _test-output-stream/imm32 + 890 68/push _test-output-stream/imm32 891 # . . call - 892 e8/call clear-stream/disp32 + 892 e8/call clear-stream/disp32 893 # . . discard args 894 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 895 # . clear-stream($_test-output-buffered-file->buffer) 896 # . . push args 897 68/push $_test-output-buffered-file->buffer/imm32 898 # . . call - 899 e8/call clear-stream/disp32 + 899 e8/call clear-stream/disp32 900 # . . discard args 901 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 902 # initialize input 903 # . write(_test-input-stream, "ab *(ecx)") 904 # . . push args 905 68/push "ab *(ecx)"/imm32 - 906 68/push _test-input-stream/imm32 + 906 68/push _test-input-stream/imm32 907 # . . call - 908 e8/call write/disp32 + 908 e8/call write/disp32 909 # . . discard args 910 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 911 # subx-sigils(_test-input-buffered-file, _test-output-buffered-file) 912 # . . push args - 913 68/push _test-output-buffered-file/imm32 - 914 68/push _test-input-buffered-file/imm32 + 913 68/push _test-output-buffered-file/imm32 + 914 68/push _test-input-buffered-file/imm32 915 # . . call 916 e8/call subx-sigils/disp32 917 # . . discard args @@ -867,9 +867,9 @@ if ('onhashchange' in window) { 919 # check that the line just passed through 920 # . flush(_test-output-buffered-file) 921 # . . push args - 922 68/push _test-output-buffered-file/imm32 + 922 68/push _test-output-buffered-file/imm32 923 # . . call - 924 e8/call flush/disp32 + 924 e8/call flush/disp32 925 # . . discard args 926 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 927 +-- 26 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- @@ -877,9 +877,9 @@ if ('onhashchange' in window) { 954 # . . push args 955 68/push "F - test-subx-sigils-register-indirect-mode-without-displacement"/imm32 956 68/push "ab 0/mod/indirect 0x00000001/rm32 \n"/imm32 - 957 68/push _test-output-stream/imm32 + 957 68/push _test-output-stream/imm32 958 # . . call - 959 e8/call check-stream-equal/disp32 + 959 e8/call check-stream-equal/disp32 960 # . . discard args 961 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 962 # . epilogue @@ -894,45 +894,45 @@ if ('onhashchange' in window) { 971 # setup 972 # . clear-stream(_test-input-stream) 973 # . . push args - 974 68/push _test-input-stream/imm32 + 974 68/push _test-input-stream/imm32 975 # . . call - 976 e8/call clear-stream/disp32 + 976 e8/call clear-stream/disp32 977 # . . discard args 978 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 979 # . clear-stream($_test-input-buffered-file->buffer) 980 # . . push args 981 68/push $_test-input-buffered-file->buffer/imm32 982 # . . call - 983 e8/call clear-stream/disp32 + 983 e8/call clear-stream/disp32 984 # . . discard args 985 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 986 # . clear-stream(_test-output-stream) 987 # . . push args - 988 68/push _test-output-stream/imm32 + 988 68/push _test-output-stream/imm32 989 # . . call - 990 e8/call clear-stream/disp32 + 990 e8/call clear-stream/disp32 991 # . . discard args 992 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 993 # . clear-stream($_test-output-buffered-file->buffer) 994 # . . push args 995 68/push $_test-output-buffered-file->buffer/imm32 996 # . . call - 997 e8/call clear-stream/disp32 + 997 e8/call clear-stream/disp32 998 # . . discard args 999 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1000 # initialize input 1001 # . write(_test-input-stream, "ab *(ecx+4)") 1002 # . . push args 1003 68/push "ab *(ecx+4)"/imm32 -1004 68/push _test-input-stream/imm32 +1004 68/push _test-input-stream/imm32 1005 # . . call -1006 e8/call write/disp32 +1006 e8/call write/disp32 1007 # . . discard args 1008 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1009 # subx-sigils(_test-input-buffered-file, _test-output-buffered-file) 1010 # . . push args -1011 68/push _test-output-buffered-file/imm32 -1012 68/push _test-input-buffered-file/imm32 +1011 68/push _test-output-buffered-file/imm32 +1012 68/push _test-input-buffered-file/imm32 1013 # . . call 1014 e8/call subx-sigils/disp32 1015 # . . discard args @@ -940,9 +940,9 @@ if ('onhashchange' in window) { 1017 # check that the line just passed through 1018 # . flush(_test-output-buffered-file) 1019 # . . push args -1020 68/push _test-output-buffered-file/imm32 +1020 68/push _test-output-buffered-file/imm32 1021 # . . call -1022 e8/call flush/disp32 +1022 e8/call flush/disp32 1023 # . . discard args 1024 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1025 +-- 26 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- @@ -950,9 +950,9 @@ if ('onhashchange' in window) { 1052 # . . push args 1053 68/push "F - test-subx-sigils-register-indirect-mode-with-displacement"/imm32 1054 68/push "ab 2/mod/*+disp32 0x00000001/rm32 0x00000004/disp32 \n"/imm32 -1055 68/push _test-output-stream/imm32 +1055 68/push _test-output-stream/imm32 1056 # . . call -1057 e8/call check-stream-equal/disp32 +1057 e8/call check-stream-equal/disp32 1058 # . . discard args 1059 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1060 # . epilogue @@ -968,45 +968,45 @@ if ('onhashchange' in window) { 1070 # setup 1071 # . clear-stream(_test-input-stream) 1072 # . . push args -1073 68/push _test-input-stream/imm32 +1073 68/push _test-input-stream/imm32 1074 # . . call -1075 e8/call clear-stream/disp32 +1075 e8/call clear-stream/disp32 1076 # . . discard args 1077 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1078 # . clear-stream($_test-input-buffered-file->buffer) 1079 # . . push args 1080 68/push $_test-input-buffered-file->buffer/imm32 1081 # . . call -1082 e8/call clear-stream/disp32 +1082 e8/call clear-stream/disp32 1083 # . . discard args 1084 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1085 # . clear-stream(_test-output-stream) 1086 # . . push args -1087 68/push _test-output-stream/imm32 +1087 68/push _test-output-stream/imm32 1088 # . . call -1089 e8/call clear-stream/disp32 +1089 e8/call clear-stream/disp32 1090 # . . discard args 1091 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1092 # . clear-stream($_test-output-buffered-file->buffer) 1093 # . . push args 1094 68/push $_test-output-buffered-file->buffer/imm32 1095 # . . call -1096 e8/call clear-stream/disp32 +1096 e8/call clear-stream/disp32 1097 # . . discard args 1098 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1099 # initialize input 1100 # . write(_test-input-stream, "ab *(ecx + edx<<3 + 4)") 1101 # . . push args 1102 68/push "ab *(ecx + edx<<3 + 4)"/imm32 -1103 68/push _test-input-stream/imm32 +1103 68/push _test-input-stream/imm32 1104 # . . call -1105 e8/call write/disp32 +1105 e8/call write/disp32 1106 # . . discard args 1107 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1108 # subx-sigils(_test-input-buffered-file, _test-output-buffered-file) 1109 # . . push args -1110 68/push _test-output-buffered-file/imm32 -1111 68/push _test-input-buffered-file/imm32 +1110 68/push _test-output-buffered-file/imm32 +1111 68/push _test-input-buffered-file/imm32 1112 # . . call 1113 e8/call subx-sigils/disp32 1114 # . . discard args @@ -1014,9 +1014,9 @@ if ('onhashchange' in window) { 1116 # check that the line just passed through 1117 # . flush(_test-output-buffered-file) 1118 # . . push args -1119 68/push _test-output-buffered-file/imm32 +1119 68/push _test-output-buffered-file/imm32 1120 # . . call -1121 e8/call flush/disp32 +1121 e8/call flush/disp32 1122 # . . discard args 1123 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1124 +-- 26 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- @@ -1024,9 +1024,9 @@ if ('onhashchange' in window) { 1151 # . . push args 1152 68/push "F - test-subx-sigils-register-indirect-mode-with-sib-byte"/imm32 1153 68/push "ab 2/mod/*+disp32 4/rm32/sib 0x00000001/base 0x00000002/index 0x00000003/scale 0x00000004/disp32 \n"/imm32 -1154 68/push _test-output-stream/imm32 +1154 68/push _test-output-stream/imm32 1155 # . . call -1156 e8/call check-stream-equal/disp32 +1156 e8/call check-stream-equal/disp32 1157 # . . discard args 1158 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1159 # . epilogue @@ -1041,45 +1041,45 @@ if ('onhashchange' in window) { 1168 # setup 1169 # . clear-stream(_test-input-stream) 1170 # . . push args -1171 68/push _test-input-stream/imm32 +1171 68/push _test-input-stream/imm32 1172 # . . call -1173 e8/call clear-stream/disp32 +1173 e8/call clear-stream/disp32 1174 # . . discard args 1175 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1176 # . clear-stream($_test-input-buffered-file->buffer) 1177 # . . push args 1178 68/push $_test-input-buffered-file->buffer/imm32 1179 # . . call -1180 e8/call clear-stream/disp32 +1180 e8/call clear-stream/disp32 1181 # . . discard args 1182 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1183 # . clear-stream(_test-output-stream) 1184 # . . push args -1185 68/push _test-output-stream/imm32 +1185 68/push _test-output-stream/imm32 1186 # . . call -1187 e8/call clear-stream/disp32 +1187 e8/call clear-stream/disp32 1188 # . . discard args 1189 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1190 # . clear-stream($_test-output-buffered-file->buffer) 1191 # . . push args 1192 68/push $_test-output-buffered-file->buffer/imm32 1193 # . . call -1194 e8/call clear-stream/disp32 +1194 e8/call clear-stream/disp32 1195 # . . discard args 1196 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1197 # initialize input 1198 # . write(_test-input-stream, "ab *(ecx + edx<<3 - 4)") 1199 # . . push args 1200 68/push "ab *(ecx + edx<<3 - 4)"/imm32 -1201 68/push _test-input-stream/imm32 +1201 68/push _test-input-stream/imm32 1202 # . . call -1203 e8/call write/disp32 +1203 e8/call write/disp32 1204 # . . discard args 1205 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1206 # subx-sigils(_test-input-buffered-file, _test-output-buffered-file) 1207 # . . push args -1208 68/push _test-output-buffered-file/imm32 -1209 68/push _test-input-buffered-file/imm32 +1208 68/push _test-output-buffered-file/imm32 +1209 68/push _test-input-buffered-file/imm32 1210 # . . call 1211 e8/call subx-sigils/disp32 1212 # . . discard args @@ -1087,9 +1087,9 @@ if ('onhashchange' in window) { 1214 # check that the line just passed through 1215 # . flush(_test-output-buffered-file) 1216 # . . push args -1217 68/push _test-output-buffered-file/imm32 +1217 68/push _test-output-buffered-file/imm32 1218 # . . call -1219 e8/call flush/disp32 +1219 e8/call flush/disp32 1220 # . . discard args 1221 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1222 +-- 26 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- @@ -1097,9 +1097,9 @@ if ('onhashchange' in window) { 1249 # . . push args 1250 68/push "F - test-subx-sigils-register-indirect-mode-with-sib-byte-negative-displacement"/imm32 1251 68/push "ab 2/mod/*+disp32 4/rm32/sib 0x00000001/base 0x00000002/index 0x00000003/scale 0xfffffffc/disp32 \n"/imm32 -1252 68/push _test-output-stream/imm32 +1252 68/push _test-output-stream/imm32 1253 # . . call -1254 e8/call check-stream-equal/disp32 +1254 e8/call check-stream-equal/disp32 1255 # . . discard args 1256 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1257 # . epilogue @@ -1114,45 +1114,45 @@ if ('onhashchange' in window) { 1266 # setup 1267 # . clear-stream(_test-input-stream) 1268 # . . push args -1269 68/push _test-input-stream/imm32 +1269 68/push _test-input-stream/imm32 1270 # . . call -1271 e8/call clear-stream/disp32 +1271 e8/call clear-stream/disp32 1272 # . . discard args 1273 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1274 # . clear-stream($_test-input-buffered-file->buffer) 1275 # . . push args 1276 68/push $_test-input-buffered-file->buffer/imm32 1277 # . . call -1278 e8/call clear-stream/disp32 +1278 e8/call clear-stream/disp32 1279 # . . discard args 1280 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1281 # . clear-stream(_test-output-stream) 1282 # . . push args -1283 68/push _test-output-stream/imm32 +1283 68/push _test-output-stream/imm32 1284 # . . call -1285 e8/call clear-stream/disp32 +1285 e8/call clear-stream/disp32 1286 # . . discard args 1287 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1288 # . clear-stream($_test-output-buffered-file->buffer) 1289 # . . push args 1290 68/push $_test-output-buffered-file->buffer/imm32 1291 # . . call -1292 e8/call clear-stream/disp32 +1292 e8/call clear-stream/disp32 1293 # . . discard args 1294 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1295 # initialize input 1296 # . write(_test-input-stream, "ab *Foo") 1297 # . . push args 1298 68/push "ab *Foo"/imm32 -1299 68/push _test-input-stream/imm32 +1299 68/push _test-input-stream/imm32 1300 # . . call -1301 e8/call write/disp32 +1301 e8/call write/disp32 1302 # . . discard args 1303 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1304 # subx-sigils(_test-input-buffered-file, _test-output-buffered-file) 1305 # . . push args -1306 68/push _test-output-buffered-file/imm32 -1307 68/push _test-input-buffered-file/imm32 +1306 68/push _test-output-buffered-file/imm32 +1307 68/push _test-input-buffered-file/imm32 1308 # . . call 1309 e8/call subx-sigils/disp32 1310 # . . discard args @@ -1160,9 +1160,9 @@ if ('onhashchange' in window) { 1312 # check that the line just passed through 1313 # . flush(_test-output-buffered-file) 1314 # . . push args -1315 68/push _test-output-buffered-file/imm32 +1315 68/push _test-output-buffered-file/imm32 1316 # . . call -1317 e8/call flush/disp32 +1317 e8/call flush/disp32 1318 # . . discard args 1319 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1320 +-- 26 lines: #? # dump _test-output-stream ----------------------------------------------------------------------------------------------------------------------------------------- @@ -1170,9 +1170,9 @@ if ('onhashchange' in window) { 1347 # . . push args 1348 68/push "F - test-subx-sigils-indirect-mode-without-register"/imm32 1349 68/push "ab 0/mod/indirect 5/rm32/.disp32 Foo/disp32 \n"/imm32 -1350 68/push _test-output-stream/imm32 +1350 68/push _test-output-stream/imm32 1351 # . . call -1352 e8/call check-stream-equal/disp32 +1352 e8/call check-stream-equal/disp32 1353 # . . discard args 1354 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1355 # . epilogue @@ -1202,7 +1202,7 @@ if ('onhashchange' in window) { 1402 ff 6/subop/push 1/mod/*+disp8 0/rm32/eax . . . . 4/disp8 . # push *(eax+4) 1403 ff 6/subop/push 0/mod/indirect 0/rm32/eax . . . . . . # push *eax 1404 # . . call -1405 e8/call next-token-from-slice/disp32 +1405 e8/call next-token-from-slice/disp32 1406 # . . discard args 1407 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32 # add to esp 1408 # reg-num/eax = get-slice(Registers, local-slice, row-size=12) @@ -1210,9 +1210,9 @@ if ('onhashchange' in window) { 1410 68/push "Registers"/imm32 1411 68/push 0xc/imm32/row-size 1412 50/push-eax -1413 68/push Registers/imm32 +1413 68/push Registers/imm32 1414 # . . call -1415 e8/call get-slice/disp32 +1415 e8/call get-slice/disp32 1416 # . . discard args 1417 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32 # add to esp 1418 # write-buffered(out, "3/mod/direct ") @@ -1220,7 +1220,7 @@ if ('onhashchange' in window) { 1420 68/push "3/mod/direct "/imm32 1421 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 1422 # . . call -1423 e8/call write-buffered/disp32 +1423 e8/call write-buffered/disp32 1424 # . . discard args 1425 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1426 # write-int32-hex-buffered(out, *reg-num) @@ -1228,7 +1228,7 @@ if ('onhashchange' in window) { 1428 ff 6/subop/push 0/mod/indirect 0/rm32/eax . . . . . . # push *eax 1429 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 1430 # . . call -1431 e8/call write-int32-hex-buffered/disp32 +1431 e8/call write-int32-hex-buffered/disp32 1432 # . . discard args 1433 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1434 # write-buffered(out, "/rm32") @@ -1236,7 +1236,7 @@ if ('onhashchange' in window) { 1436 68/push "/rm32"/imm32 1437 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 1438 # . . call -1439 e8/call write-buffered/disp32 +1439 e8/call write-buffered/disp32 1440 # . . discard args 1441 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1442 $emit-direct-mode:end: @@ -1256,16 +1256,16 @@ if ('onhashchange' in window) { 1456 # setup 1457 # . clear-stream(_test-output-stream) 1458 # . . push args -1459 68/push _test-output-stream/imm32 +1459 68/push _test-output-stream/imm32 1460 # . . call -1461 e8/call clear-stream/disp32 +1461 e8/call clear-stream/disp32 1462 # . . discard args 1463 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1464 # . clear-stream($_test-output-buffered-file->buffer) 1465 # . . push args 1466 68/push $_test-output-buffered-file->buffer/imm32 1467 # . . call -1468 e8/call clear-stream/disp32 +1468 e8/call clear-stream/disp32 1469 # . . discard args 1470 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1471 # var slice/ecx = "%eax" @@ -1280,16 +1280,16 @@ if ('onhashchange' in window) { 1480 # emit-direct-mode(_test-output-buffered-file, str) 1481 # . . push args 1482 51/push-ecx -1483 68/push _test-output-buffered-file/imm32 +1483 68/push _test-output-buffered-file/imm32 1484 # . . call 1485 e8/call emit-direct-mode/disp32 1486 # . . discard args 1487 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1488 # . flush(_test-output-buffered-file) 1489 # . . push args -1490 68/push _test-output-buffered-file/imm32 +1490 68/push _test-output-buffered-file/imm32 1491 # . . call -1492 e8/call flush/disp32 +1492 e8/call flush/disp32 1493 # . . discard args 1494 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1495 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -1297,9 +1297,9 @@ if ('onhashchange' in window) { 1522 # . . push args 1523 68/push "F - test-emit-direct-mode/0"/imm32 1524 68/push "3/mod/direct 0x00000000/rm32"/imm32 -1525 68/push _test-output-stream/imm32 +1525 68/push _test-output-stream/imm32 1526 # . . call -1527 e8/call check-stream-equal/disp32 +1527 e8/call check-stream-equal/disp32 1528 # . . discard args 1529 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1530 # . epilogue @@ -1314,16 +1314,16 @@ if ('onhashchange' in window) { 1539 # setup 1540 # . clear-stream(_test-output-stream) 1541 # . . push args -1542 68/push _test-output-stream/imm32 +1542 68/push _test-output-stream/imm32 1543 # . . call -1544 e8/call clear-stream/disp32 +1544 e8/call clear-stream/disp32 1545 # . . discard args 1546 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1547 # . clear-stream($_test-output-buffered-file->buffer) 1548 # . . push args 1549 68/push $_test-output-buffered-file->buffer/imm32 1550 # . . call -1551 e8/call clear-stream/disp32 +1551 e8/call clear-stream/disp32 1552 # . . discard args 1553 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1554 # var slice/ecx = "%edi" @@ -1338,16 +1338,16 @@ if ('onhashchange' in window) { 1563 # emit-direct-mode(_test-output-buffered-file, str/ecx) 1564 # . . push args 1565 51/push-ecx -1566 68/push _test-output-buffered-file/imm32 +1566 68/push _test-output-buffered-file/imm32 1567 # . . call 1568 e8/call emit-direct-mode/disp32 1569 # . . discard args 1570 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1571 # . flush(_test-output-buffered-file) 1572 # . . push args -1573 68/push _test-output-buffered-file/imm32 +1573 68/push _test-output-buffered-file/imm32 1574 # . . call -1575 e8/call flush/disp32 +1575 e8/call flush/disp32 1576 # . . discard args 1577 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1578 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -1355,9 +1355,9 @@ if ('onhashchange' in window) { 1605 # . . push args 1606 68/push "F - test-emit-direct-mode/1"/imm32 1607 68/push "3/mod/direct 0x00000007/rm32"/imm32 -1608 68/push _test-output-stream/imm32 +1608 68/push _test-output-stream/imm32 1609 # . . call -1610 e8/call check-stream-equal/disp32 +1610 e8/call check-stream-equal/disp32 1611 # . . discard args 1612 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1613 # . epilogue @@ -1415,7 +1415,7 @@ if ('onhashchange' in window) { 1665 68/push 0x20/imm32/space 1666 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 1667 # . . call -1668 e8/call skip-chars-matching/disp32 +1668 e8/call skip-chars-matching/disp32 1669 # . . discard args 1670 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1671 $next-word-or-expression:check0: @@ -1459,7 +1459,7 @@ if ('onhashchange' in window) { 1709 # . . push args 1710 56/push-esi 1711 # . . call -1712 e8/call skip-string/disp32 +1712 e8/call skip-string/disp32 1713 # . . discard args 1714 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1715 # skip rest of word @@ -1480,7 +1480,7 @@ if ('onhashchange' in window) { 1730 # . . push args 1731 56/push-esi 1732 # . . call -1733 e8/call skip-until-close-paren/disp32 +1733 e8/call skip-until-close-paren/disp32 1734 # . . discard args 1735 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1736 # if (line->data[line->read] != ')') goto error2 @@ -1498,7 +1498,7 @@ if ('onhashchange' in window) { 1748 # . . push args 1749 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 1750 # . . call -1751 e8/call skip-chars-not-matching-whitespace/disp32 +1751 e8/call skip-chars-not-matching-whitespace/disp32 1752 # . . discard args 1753 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1754 # out->end = &line->data[line->read] @@ -1521,32 +1521,32 @@ if ('onhashchange' in window) { 1771 # . write-buffered(Stderr, "error: no space allowed after '*' in '") 1772 # . . push args 1773 68/push "error: no space allowed after '*' in '"/imm32 -1774 68/push Stderr/imm32 +1774 68/push Stderr/imm32 1775 # . . call -1776 e8/call write-buffered/disp32 +1776 e8/call write-buffered/disp32 1777 # . . discard args 1778 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1779 # . write-stream-data(Stderr, line) 1780 # . . push args 1781 56/push-esi -1782 68/push Stderr/imm32 +1782 68/push Stderr/imm32 1783 # . . call -1784 e8/call write-stream-data/disp32 +1784 e8/call write-stream-data/disp32 1785 # . . discard args 1786 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1787 # . write-buffered(Stderr, "'") 1788 # . . push args 1789 68/push "'"/imm32 -1790 68/push Stderr/imm32 +1790 68/push Stderr/imm32 1791 # . . call -1792 e8/call write-buffered/disp32 +1792 e8/call write-buffered/disp32 1793 # . . discard args 1794 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1795 # . flush(Stderr) 1796 # . . push args -1797 68/push Stderr/imm32 +1797 68/push Stderr/imm32 1798 # . . call -1799 e8/call flush/disp32 +1799 e8/call flush/disp32 1800 # . . discard args 1801 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1802 # . syscall(exit, 1) @@ -1559,32 +1559,32 @@ if ('onhashchange' in window) { 1809 # . write-buffered(Stderr, "error: *(...) expression must be all on a single line in '") 1810 # . . push args 1811 68/push "error: *(...) expression must be all on a single line in '"/imm32 -1812 68/push Stderr/imm32 +1812 68/push Stderr/imm32 1813 # . . call -1814 e8/call write-buffered/disp32 +1814 e8/call write-buffered/disp32 1815 # . . discard args 1816 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1817 # . write-stream-data(Stderr, line) 1818 # . . push args 1819 56/push-esi -1820 68/push Stderr/imm32 +1820 68/push Stderr/imm32 1821 # . . call -1822 e8/call write-stream-data/disp32 +1822 e8/call write-stream-data/disp32 1823 # . . discard args 1824 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1825 # . write-buffered(Stderr, "'") 1826 # . . push args 1827 68/push "'"/imm32 -1828 68/push Stderr/imm32 +1828 68/push Stderr/imm32 1829 # . . call -1830 e8/call write-buffered/disp32 +1830 e8/call write-buffered/disp32 1831 # . . discard args 1832 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1833 # . flush(Stderr) 1834 # . . push args -1835 68/push Stderr/imm32 +1835 68/push Stderr/imm32 1836 # . . call -1837 e8/call flush/disp32 +1837 e8/call flush/disp32 1838 # . . discard args 1839 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1840 # . syscall(exit, 1) @@ -1599,9 +1599,9 @@ if ('onhashchange' in window) { 1849 # setup 1850 # . clear-stream(_test-input-stream) 1851 # . . push args -1852 68/push _test-input-stream/imm32 +1852 68/push _test-input-stream/imm32 1853 # . . call -1854 e8/call clear-stream/disp32 +1854 e8/call clear-stream/disp32 1855 # . . discard args 1856 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1857 # var slice/ecx: slice @@ -1611,15 +1611,15 @@ if ('onhashchange' in window) { 1861 # write(_test-input-stream, " ab") 1862 # . . push args 1863 68/push " ab"/imm32 -1864 68/push _test-input-stream/imm32 +1864 68/push _test-input-stream/imm32 1865 # . . call -1866 e8/call write/disp32 +1866 e8/call write/disp32 1867 # . . discard args 1868 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1869 # next-word-or-expression(_test-input-stream, slice) 1870 # . . push args 1871 51/push-ecx -1872 68/push _test-input-stream/imm32 +1872 68/push _test-input-stream/imm32 1873 # . . call 1874 e8/call next-word-or-expression/disp32 1875 # . . discard args @@ -1628,10 +1628,10 @@ if ('onhashchange' in window) { 1878 # . . push args 1879 68/push "F - test-next-word-or-expression/updates-stream-read-correctly"/imm32 1880 68/push 4/imm32 -1881 b8/copy-to-eax _test-input-stream/imm32 +1881 b8/copy-to-eax _test-input-stream/imm32 1882 ff 6/subop/push 1/mod/*+disp8 0/rm32/eax . . . . 4/disp8 . # push *(eax+4) 1883 # . . call -1884 e8/call check-ints-equal/disp32 +1884 e8/call check-ints-equal/disp32 1885 # . . discard args 1886 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1887 # check-ints-equal(slice->start - _test-input-stream->data, 2, msg) @@ -1641,10 +1641,10 @@ if ('onhashchange' in window) { 1891 68/push 0xe/imm32 1892 # . . push slice->start - _test-input-stream 1893 8b/copy 0/mod/indirect 1/rm32/ecx . . . 0/r32/eax . . # copy *ecx to eax -1894 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32 # subtract from eax +1894 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32 # subtract from eax 1895 50/push-eax 1896 # . . call -1897 e8/call check-ints-equal/disp32 +1897 e8/call check-ints-equal/disp32 1898 # . . discard args 1899 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1900 # check-ints-equal(slice->end - _test-input-stream->data, 4, msg) @@ -1654,10 +1654,10 @@ if ('onhashchange' in window) { 1904 68/push 0x10/imm32 1905 # . . push slice->end - _test-input-stream 1906 8b/copy 1/mod/*+disp8 1/rm32/ecx . . . 0/r32/eax 4/disp8 . # copy *(ecx+4) to eax -1907 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32 # subtract from eax +1907 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32 # subtract from eax 1908 50/push-eax 1909 # . . call -1910 e8/call check-ints-equal/disp32 +1910 e8/call check-ints-equal/disp32 1911 # . . discard args 1912 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1913 # . epilogue @@ -1672,9 +1672,9 @@ if ('onhashchange' in window) { 1922 # setup 1923 # . clear-stream(_test-input-stream) 1924 # . . push args -1925 68/push _test-input-stream/imm32 +1925 68/push _test-input-stream/imm32 1926 # . . call -1927 e8/call clear-stream/disp32 +1927 e8/call clear-stream/disp32 1928 # . . discard args 1929 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1930 # var slice/ecx: slice @@ -1684,15 +1684,15 @@ if ('onhashchange' in window) { 1934 # write(_test-input-stream, " # a") 1935 # . . push args 1936 68/push " # a"/imm32 -1937 68/push _test-input-stream/imm32 +1937 68/push _test-input-stream/imm32 1938 # . . call -1939 e8/call write/disp32 +1939 e8/call write/disp32 1940 # . . discard args 1941 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1942 # next-word-or-expression(_test-input-stream, slice) 1943 # . . push args 1944 51/push-ecx -1945 68/push _test-input-stream/imm32 +1945 68/push _test-input-stream/imm32 1946 # . . call 1947 e8/call next-word-or-expression/disp32 1948 # . . discard args @@ -1701,10 +1701,10 @@ if ('onhashchange' in window) { 1951 # . . push args 1952 68/push "F - test-next-word-or-expression-returns-whole-comment/updates-stream-read-correctly"/imm32 1953 68/push 5/imm32 -1954 b8/copy-to-eax _test-input-stream/imm32 +1954 b8/copy-to-eax _test-input-stream/imm32 1955 ff 6/subop/push 1/mod/*+disp8 0/rm32/eax . . . . 4/disp8 . # push *(eax+4) 1956 # . . call -1957 e8/call check-ints-equal/disp32 +1957 e8/call check-ints-equal/disp32 1958 # . . discard args 1959 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1960 # check-ints-equal(slice->start - _test-input-stream->data, 2, msg) @@ -1714,10 +1714,10 @@ if ('onhashchange' in window) { 1964 68/push 0xe/imm32 1965 # . . push slice->start - _test-input-stream 1966 8b/copy 0/mod/indirect 1/rm32/ecx . . . 0/r32/eax . . # copy *ecx to eax -1967 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32 # subtract from eax +1967 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32 # subtract from eax 1968 50/push-eax 1969 # . . call -1970 e8/call check-ints-equal/disp32 +1970 e8/call check-ints-equal/disp32 1971 # . . discard args 1972 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1973 # check-ints-equal(slice->end - _test-input-stream->data, 5, msg) @@ -1727,10 +1727,10 @@ if ('onhashchange' in window) { 1977 68/push 0x11/imm32 1978 # . . push slice->end - _test-input-stream 1979 8b/copy 1/mod/*+disp8 1/rm32/ecx . . . 0/r32/eax 4/disp8 . # copy *(ecx+4) to eax -1980 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32 # subtract from eax +1980 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32 # subtract from eax 1981 50/push-eax 1982 # . . call -1983 e8/call check-ints-equal/disp32 +1983 e8/call check-ints-equal/disp32 1984 # . . discard args 1985 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1986 # . epilogue @@ -1745,9 +1745,9 @@ if ('onhashchange' in window) { 1995 # setup 1996 # . clear-stream(_test-input-stream) 1997 # . . push args -1998 68/push _test-input-stream/imm32 +1998 68/push _test-input-stream/imm32 1999 # . . call -2000 e8/call clear-stream/disp32 +2000 e8/call clear-stream/disp32 2001 # . . discard args 2002 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 2003 # var slice/ecx: slice @@ -1758,7 +1758,7 @@ if ('onhashchange' in window) { 2008 # next-word-or-expression(_test-input-stream, slice) 2009 # . . push args 2010 51/push-ecx -2011 68/push _test-input-stream/imm32 +2011 68/push _test-input-stream/imm32 2012 # . . call 2013 e8/call next-word-or-expression/disp32 2014 # . . discard args @@ -1772,7 +1772,7 @@ if ('onhashchange' in window) { 2022 2b/subtract 0/mod/indirect 1/rm32/ecx . . . 0/r32/eax . . # subtract *ecx from eax 2023 50/push-eax 2024 # . . call -2025 e8/call check-ints-equal/disp32 +2025 e8/call check-ints-equal/disp32 2026 # . . discard args 2027 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2028 # . epilogue @@ -1787,9 +1787,9 @@ if ('onhashchange' in window) { 2037 # setup 2038 # . clear-stream(_test-input-stream) 2039 # . . push args -2040 68/push _test-input-stream/imm32 +2040 68/push _test-input-stream/imm32 2041 # . . call -2042 e8/call clear-stream/disp32 +2042 e8/call clear-stream/disp32 2043 # . . discard args 2044 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 2045 # var slice/ecx: slice @@ -1799,15 +1799,15 @@ if ('onhashchange' in window) { 2049 # write(_test-input-stream, " \"a b\"/imm32 ") 2050 # . . push args 2051 68/push " \"a b\"/imm32 "/imm32 -2052 68/push _test-input-stream/imm32 +2052 68/push _test-input-stream/imm32 2053 # . . call -2054 e8/call write/disp32 +2054 e8/call write/disp32 2055 # . . discard args 2056 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2057 # next-word-or-expression(_test-input-stream, slice) 2058 # . . push args 2059 51/push-ecx -2060 68/push _test-input-stream/imm32 +2060 68/push _test-input-stream/imm32 2061 # . . call 2062 e8/call next-word-or-expression/disp32 2063 # . . discard args @@ -1819,10 +1819,10 @@ if ('onhashchange' in window) { 2069 68/push 0xd/imm32 2070 # . . push slice->start - _test-input-stream 2071 8b/copy 0/mod/indirect 1/rm32/ecx . . . 0/r32/eax . . # copy *ecx to eax -2072 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32 # subtract from eax +2072 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32 # subtract from eax 2073 50/push-eax 2074 # . . call -2075 e8/call check-ints-equal/disp32 +2075 e8/call check-ints-equal/disp32 2076 # . . discard args 2077 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2078 # check-ints-equal(slice->end - _test-input-stream->data, 12, msg) @@ -1832,10 +1832,10 @@ if ('onhashchange' in window) { 2082 68/push 0x18/imm32 2083 # . . push slice->end - _test-input-stream 2084 8b/copy 1/mod/*+disp8 1/rm32/ecx . . . 0/r32/eax 4/disp8 . # copy *(ecx+4) to eax -2085 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32 # subtract from eax +2085 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32 # subtract from eax 2086 50/push-eax 2087 # . . call -2088 e8/call check-ints-equal/disp32 +2088 e8/call check-ints-equal/disp32 2089 # . . discard args 2090 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2091 # . epilogue @@ -1850,9 +1850,9 @@ if ('onhashchange' in window) { 2100 # setup 2101 # . clear-stream(_test-input-stream) 2102 # . . push args -2103 68/push _test-input-stream/imm32 +2103 68/push _test-input-stream/imm32 2104 # . . call -2105 e8/call clear-stream/disp32 +2105 e8/call clear-stream/disp32 2106 # . . discard args 2107 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 2108 # var slice/ecx: slice @@ -1862,15 +1862,15 @@ if ('onhashchange' in window) { 2112 # write(_test-input-stream, " \"a\\\"b\"/x") 2113 # . . push args 2114 68/push " \"a\\\"b\"/x"/imm32 -2115 68/push _test-input-stream/imm32 +2115 68/push _test-input-stream/imm32 2116 # . . call -2117 e8/call write/disp32 +2117 e8/call write/disp32 2118 # . . discard args 2119 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2120 # next-word-or-expression(_test-input-stream, slice) 2121 # . . push args 2122 51/push-ecx -2123 68/push _test-input-stream/imm32 +2123 68/push _test-input-stream/imm32 2124 # . . call 2125 e8/call next-word-or-expression/disp32 2126 # . . discard args @@ -1882,10 +1882,10 @@ if ('onhashchange' in window) { 2132 68/push 0xd/imm32 2133 # . . push slice->start - _test-input-stream 2134 8b/copy 0/mod/indirect 1/rm32/ecx . . . 0/r32/eax . . # copy *ecx to eax -2135 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32 # subtract from eax +2135 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32 # subtract from eax 2136 50/push-eax 2137 # . . call -2138 e8/call check-ints-equal/disp32 +2138 e8/call check-ints-equal/disp32 2139 # . . discard args 2140 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2141 # check-ints-equal(slice->end - _test-input-stream->data, 9, msg) @@ -1895,10 +1895,10 @@ if ('onhashchange' in window) { 2145 68/push 0x15/imm32 2146 # . . push slice->end - _test-input-stream 2147 8b/copy 1/mod/*+disp8 1/rm32/ecx . . . 0/r32/eax 4/disp8 . # copy *(ecx+4) to eax -2148 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32 # subtract from eax +2148 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32 # subtract from eax 2149 50/push-eax 2150 # . . call -2151 e8/call check-ints-equal/disp32 +2151 e8/call check-ints-equal/disp32 2152 # . . discard args 2153 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2154 # . epilogue @@ -1913,9 +1913,9 @@ if ('onhashchange' in window) { 2163 # setup 2164 # . clear-stream(_test-input-stream) 2165 # . . push args -2166 68/push _test-input-stream/imm32 +2166 68/push _test-input-stream/imm32 2167 # . . call -2168 e8/call clear-stream/disp32 +2168 e8/call clear-stream/disp32 2169 # . . discard args 2170 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 2171 # var slice/ecx: slice @@ -1925,15 +1925,15 @@ if ('onhashchange' in window) { 2175 # write(_test-input-stream, " *(a b)/imm32 ") 2176 # . . push args 2177 68/push " *(a b)/imm32 "/imm32 -2178 68/push _test-input-stream/imm32 +2178 68/push _test-input-stream/imm32 2179 # . . call -2180 e8/call write/disp32 +2180 e8/call write/disp32 2181 # . . discard args 2182 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2183 # next-word-or-expression(_test-input-stream, slice) 2184 # . . push args 2185 51/push-ecx -2186 68/push _test-input-stream/imm32 +2186 68/push _test-input-stream/imm32 2187 # . . call 2188 e8/call next-word-or-expression/disp32 2189 # . . discard args @@ -1945,10 +1945,10 @@ if ('onhashchange' in window) { 2195 68/push 0xd/imm32 2196 # . . push slice->start - _test-input-stream 2197 8b/copy 0/mod/indirect 1/rm32/ecx . . . 0/r32/eax . . # copy *ecx to eax -2198 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32 # subtract from eax +2198 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32 # subtract from eax 2199 50/push-eax 2200 # . . call -2201 e8/call check-ints-equal/disp32 +2201 e8/call check-ints-equal/disp32 2202 # . . discard args 2203 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2204 # check-ints-equal(slice->end - _test-input-stream->data, 13, msg) @@ -1958,10 +1958,10 @@ if ('onhashchange' in window) { 2208 68/push 0x19/imm32 2209 # . . push slice->end - _test-input-stream 2210 8b/copy 1/mod/*+disp8 1/rm32/ecx . . . 0/r32/eax 4/disp8 . # copy *(ecx+4) to eax -2211 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32 # subtract from eax +2211 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32 # subtract from eax 2212 50/push-eax 2213 # . . call -2214 e8/call check-ints-equal/disp32 +2214 e8/call check-ints-equal/disp32 2215 # . . discard args 2216 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2217 # . epilogue @@ -2048,7 +2048,7 @@ if ('onhashchange' in window) { 2298 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 . # push *(esi+4) 2299 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . . # push *esi 2300 # . . call -2301 e8/call next-token-from-slice/disp32 +2301 e8/call next-token-from-slice/disp32 2302 # . . discard args 2303 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32 # add to esp 2304 # base = get-slice(Registers, local-slice, row-size=12) @@ -2057,9 +2057,9 @@ if ('onhashchange' in window) { 2307 68/push "Registers"/imm32 2308 68/push 0xc/imm32/row-size 2309 56/push-esi -2310 68/push Registers/imm32 +2310 68/push Registers/imm32 2311 # . . call -2312 e8/call get-slice/disp32 +2312 e8/call get-slice/disp32 2313 # . . discard args 2314 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32 # add to esp 2315 # . base = *eax @@ -2075,7 +2075,7 @@ if ('onhashchange' in window) { 2325 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 . # push *(esi+4) 2326 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . . # push *esi 2327 # . . call -2328 e8/call skip-chars-matching-whitespace-in-slice/disp32 +2328 e8/call skip-chars-matching-whitespace-in-slice/disp32 2329 # . . discard args 2330 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2331 # . local-slice->start = eax @@ -2096,7 +2096,7 @@ if ('onhashchange' in window) { 2346 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 . # push *(esi+4) 2347 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . . # push *esi 2348 # . . call -2349 e8/call skip-chars-matching-whitespace-in-slice/disp32 +2349 e8/call skip-chars-matching-whitespace-in-slice/disp32 2350 # . . discard args 2351 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2352 # . local-slice->start = eax @@ -2121,7 +2121,7 @@ if ('onhashchange' in window) { 2371 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 . # push *(esi+4) 2372 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . . # push *esi 2373 # . . call -2374 e8/call skip-chars-matching-whitespace-in-slice/disp32 +2374 e8/call skip-chars-matching-whitespace-in-slice/disp32 2375 # . . discard args 2376 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2377 # . local-slice->start = eax @@ -2144,9 +2144,9 @@ if ('onhashchange' in window) { 2394 # . . push args 2395 68/push 0xc/imm32/row-size 2396 51/push-ecx -2397 68/push Registers/imm32 +2397 68/push Registers/imm32 2398 # . . call -2399 e8/call maybe-get-slice/disp32 +2399 e8/call maybe-get-slice/disp32 2400 # . . discard args 2401 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2402 # . reclaim tmp @@ -2173,7 +2173,7 @@ if ('onhashchange' in window) { 2423 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 . # push *(esi+4) 2424 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . . # push *esi 2425 # . . call -2426 e8/call skip-chars-matching-whitespace-in-slice/disp32 +2426 e8/call skip-chars-matching-whitespace-in-slice/disp32 2427 # . . discard args 2428 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2429 # . local-slice->start = eax @@ -2203,7 +2203,7 @@ if ('onhashchange' in window) { 2453 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 . # push *(esi+4) 2454 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . . # push *esi 2455 # . . call -2456 e8/call skip-chars-matching-whitespace-in-slice/disp32 +2456 e8/call skip-chars-matching-whitespace-in-slice/disp32 2457 # . . discard args 2458 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2459 # . local-slice->start = eax @@ -2225,7 +2225,7 @@ if ('onhashchange' in window) { 2475 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 . # push *(esi+4) 2476 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . . # push *esi 2477 # . . call -2478 e8/call skip-chars-matching-whitespace-in-slice/disp32 +2478 e8/call skip-chars-matching-whitespace-in-slice/disp32 2479 # . . discard args 2480 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2481 # . local-slice->start = eax @@ -2259,7 +2259,7 @@ if ('onhashchange' in window) { 2509 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 . # push *(esi+4) 2510 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . . # push *esi 2511 # . . call -2512 e8/call skip-chars-matching-whitespace-in-slice/disp32 +2512 e8/call skip-chars-matching-whitespace-in-slice/disp32 2513 # . . discard args 2514 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2515 # . local-slice->start = eax @@ -2287,32 +2287,32 @@ if ('onhashchange' in window) { 2537 # . write-buffered(Stderr, "error: unexpected character: ") 2538 # . . push args 2539 68/push "error: unexpected character: "/imm32 -2540 68/push Stderr/imm32 +2540 68/push Stderr/imm32 2541 # . . call -2542 e8/call write-buffered/disp32 +2542 e8/call write-buffered/disp32 2543 # . . discard args 2544 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2545 # . write-int32-hex-buffered(out, eax) 2546 # . . push args 2547 50/push-eax -2548 68/push Stderr/imm32 +2548 68/push Stderr/imm32 2549 # . . call -2550 e8/call write-int32-hex-buffered/disp32 +2550 e8/call write-int32-hex-buffered/disp32 2551 # . . discard args 2552 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2553 # . write-buffered(Stderr, "\n") 2554 # . . push args -2555 68/push Newline/imm32 -2556 68/push Stderr/imm32 +2555 68/push Newline/imm32 +2556 68/push Stderr/imm32 2557 # . . call -2558 e8/call write-buffered/disp32 +2558 e8/call write-buffered/disp32 2559 # . . discard args 2560 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2561 # . flush(Stderr) 2562 # . . push args -2563 68/push Stderr/imm32 +2563 68/push Stderr/imm32 2564 # . . call -2565 e8/call flush/disp32 +2565 e8/call flush/disp32 2566 # . . discard args 2567 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 2568 # . syscall(exit, 1) @@ -2325,32 +2325,32 @@ if ('onhashchange' in window) { 2575 # . write-buffered(Stderr, "error: '<' can only be followed by '<' but got: ") 2576 # . . push args 2577 68/push "error: '<' can only be followed by '<' but got: "/imm32 -2578 68/push Stderr/imm32 +2578 68/push Stderr/imm32 2579 # . . call -2580 e8/call write-buffered/disp32 +2580 e8/call write-buffered/disp32 2581 # . . discard args 2582 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2583 # . write-int32-hex-buffered(out, eax) 2584 # . . push args 2585 50/push-eax -2586 68/push Stderr/imm32 +2586 68/push Stderr/imm32 2587 # . . call -2588 e8/call write-int32-hex-buffered/disp32 +2588 e8/call write-int32-hex-buffered/disp32 2589 # . . discard args 2590 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2591 # . write-buffered(Stderr, "\n") 2592 # . . push args -2593 68/push Newline/imm32 -2594 68/push Stderr/imm32 +2593 68/push Newline/imm32 +2594 68/push Stderr/imm32 2595 # . . call -2596 e8/call write-buffered/disp32 +2596 e8/call write-buffered/disp32 2597 # . . discard args 2598 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2599 # . flush(Stderr) 2600 # . . push args -2601 68/push Stderr/imm32 +2601 68/push Stderr/imm32 2602 # . . call -2603 e8/call flush/disp32 +2603 e8/call flush/disp32 2604 # . . discard args 2605 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 2606 # . syscall(exit, 1) @@ -2363,32 +2363,32 @@ if ('onhashchange' in window) { 2613 # . write-buffered(Stderr, "error: unexpected character before displacement: ") 2614 # . . push args 2615 68/push "error: unexpected character before displacement: "/imm32 -2616 68/push Stderr/imm32 +2616 68/push Stderr/imm32 2617 # . . call -2618 e8/call write-buffered/disp32 +2618 e8/call write-buffered/disp32 2619 # . . discard args 2620 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2621 # . write-int32-hex-buffered(out, eax) 2622 # . . push args 2623 50/push-eax -2624 68/push Stderr/imm32 +2624 68/push Stderr/imm32 2625 # . . call -2626 e8/call write-int32-hex-buffered/disp32 +2626 e8/call write-int32-hex-buffered/disp32 2627 # . . discard args 2628 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2629 # . write-buffered(Stderr, "\n") 2630 # . . push args -2631 68/push Newline/imm32 -2632 68/push Stderr/imm32 +2631 68/push Newline/imm32 +2632 68/push Stderr/imm32 2633 # . . call -2634 e8/call write-buffered/disp32 +2634 e8/call write-buffered/disp32 2635 # . . discard args 2636 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2637 # . flush(Stderr) 2638 # . . push args -2639 68/push Stderr/imm32 +2639 68/push Stderr/imm32 2640 # . . call -2641 e8/call flush/disp32 +2641 e8/call flush/disp32 2642 # . . discard args 2643 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 2644 # . syscall(exit, 1) @@ -2401,32 +2401,32 @@ if ('onhashchange' in window) { 2651 # . write-buffered(Stderr, "error: unexpected character after displacement: ") 2652 # . . push args 2653 68/push "error: unexpected character after displacement: "/imm32 -2654 68/push Stderr/imm32 +2654 68/push Stderr/imm32 2655 # . . call -2656 e8/call write-buffered/disp32 +2656 e8/call write-buffered/disp32 2657 # . . discard args 2658 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2659 # . write-int32-hex-buffered(out, eax) 2660 # . . push args 2661 50/push-eax -2662 68/push Stderr/imm32 +2662 68/push Stderr/imm32 2663 # . . call -2664 e8/call write-int32-hex-buffered/disp32 +2664 e8/call write-int32-hex-buffered/disp32 2665 # . . discard args 2666 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2667 # . write-buffered(Stderr, "; expected ')' to wrap up\n") 2668 # . . push args 2669 68/push "; expected ')' to wrap up\n"/imm32 -2670 68/push Stderr/imm32 +2670 68/push Stderr/imm32 2671 # . . call -2672 e8/call write-buffered/disp32 +2672 e8/call write-buffered/disp32 2673 # . . discard args 2674 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2675 # . flush(Stderr) 2676 # . . push args -2677 68/push Stderr/imm32 +2677 68/push Stderr/imm32 2678 # . . call -2679 e8/call flush/disp32 +2679 e8/call flush/disp32 2680 # . . discard args 2681 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 2682 # . syscall(exit, 1) @@ -2458,9 +2458,9 @@ if ('onhashchange' in window) { 2708 68/push "next-register"/imm32 2709 68/push 0xc/imm32/row-size 2710 51/push-ecx -2711 68/push Registers/imm32 +2711 68/push Registers/imm32 2712 # . . call -2713 e8/call get-slice/disp32 +2713 e8/call get-slice/disp32 2714 # . . discard args 2715 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32 # add to esp 2716 $next-register:end: @@ -2501,7 +2501,7 @@ if ('onhashchange' in window) { 2751 68/push 6/imm32/esi 2752 50/push-eax 2753 # . . call -2754 e8/call check-ints-equal/disp32 +2754 e8/call check-ints-equal/disp32 2755 # . . discard args 2756 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2757 # check-ints-equal(ecx, 4, msg) @@ -2510,7 +2510,7 @@ if ('onhashchange' in window) { 2760 68/push 4/imm32/none 2761 51/push-ecx 2762 # . . call -2763 e8/call check-ints-equal/disp32 +2763 e8/call check-ints-equal/disp32 2764 # . . discard args 2765 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2766 # check-ints-equal(edx, 0, msg) @@ -2519,7 +2519,7 @@ if ('onhashchange' in window) { 2769 68/push 0/imm32/none 2770 52/push-edx 2771 # . . call -2772 e8/call check-ints-equal/disp32 +2772 e8/call check-ints-equal/disp32 2773 # . . discard args 2774 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2775 # check-ints-equal(ebx, 0, msg) @@ -2528,7 +2528,7 @@ if ('onhashchange' in window) { 2778 68/push 0/imm32/none 2779 53/push-ebx 2780 # . . call -2781 e8/call check-ints-equal/disp32 +2781 e8/call check-ints-equal/disp32 2782 # . . discard args 2783 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2784 # . epilogue @@ -2563,7 +2563,7 @@ if ('onhashchange' in window) { 2813 68/push 6/imm32/esi 2814 50/push-eax 2815 # . . call -2816 e8/call check-ints-equal/disp32 +2816 e8/call check-ints-equal/disp32 2817 # . . discard args 2818 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2819 # check-ints-equal(ecx, 4, msg) @@ -2572,7 +2572,7 @@ if ('onhashchange' in window) { 2822 68/push 4/imm32/none 2823 51/push-ecx 2824 # . . call -2825 e8/call check-ints-equal/disp32 +2825 e8/call check-ints-equal/disp32 2826 # . . discard args 2827 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2828 # check-ints-equal(edx, 0, msg) @@ -2581,7 +2581,7 @@ if ('onhashchange' in window) { 2831 68/push 0/imm32/none 2832 52/push-edx 2833 # . . call -2834 e8/call check-ints-equal/disp32 +2834 e8/call check-ints-equal/disp32 2835 # . . discard args 2836 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2837 # check-ints-equal(ebx, 0, msg) @@ -2590,7 +2590,7 @@ if ('onhashchange' in window) { 2840 68/push 0/imm32/none 2841 53/push-ebx 2842 # . . call -2843 e8/call check-ints-equal/disp32 +2843 e8/call check-ints-equal/disp32 2844 # . . discard args 2845 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2846 # . epilogue @@ -2625,7 +2625,7 @@ if ('onhashchange' in window) { 2875 68/push 6/imm32/esi 2876 50/push-eax 2877 # . . call -2878 e8/call check-ints-equal/disp32 +2878 e8/call check-ints-equal/disp32 2879 # . . discard args 2880 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2881 # check-ints-equal(ecx, 4, msg) @@ -2634,7 +2634,7 @@ if ('onhashchange' in window) { 2884 68/push 4/imm32/none 2885 51/push-ecx 2886 # . . call -2887 e8/call check-ints-equal/disp32 +2887 e8/call check-ints-equal/disp32 2888 # . . discard args 2889 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2890 # check-ints-equal(edx, 0, msg) @@ -2643,7 +2643,7 @@ if ('onhashchange' in window) { 2893 68/push 0/imm32/none 2894 52/push-edx 2895 # . . call -2896 e8/call check-ints-equal/disp32 +2896 e8/call check-ints-equal/disp32 2897 # . . discard args 2898 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2899 # check-ints-equal(ebx, 3, msg) @@ -2652,7 +2652,7 @@ if ('onhashchange' in window) { 2902 68/push 3/imm32 2903 53/push-ebx 2904 # . . call -2905 e8/call check-ints-equal/disp32 +2905 e8/call check-ints-equal/disp32 2906 # . . discard args 2907 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2908 # . epilogue @@ -2687,7 +2687,7 @@ if ('onhashchange' in window) { 2937 68/push 6/imm32/esi 2938 50/push-eax 2939 # . . call -2940 e8/call check-ints-equal/disp32 +2940 e8/call check-ints-equal/disp32 2941 # . . discard args 2942 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2943 # check-ints-equal(ecx, 4, msg) @@ -2696,7 +2696,7 @@ if ('onhashchange' in window) { 2946 68/push 4/imm32/none 2947 51/push-ecx 2948 # . . call -2949 e8/call check-ints-equal/disp32 +2949 e8/call check-ints-equal/disp32 2950 # . . discard args 2951 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2952 # check-ints-equal(edx, 0, msg) @@ -2705,7 +2705,7 @@ if ('onhashchange' in window) { 2955 68/push 0/imm32/none 2956 52/push-edx 2957 # . . call -2958 e8/call check-ints-equal/disp32 +2958 e8/call check-ints-equal/disp32 2959 # . . discard args 2960 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2961 # check-ints-equal(ebx, -3, msg) @@ -2714,7 +2714,7 @@ if ('onhashchange' in window) { 2964 68/push -3/imm32 2965 53/push-ebx 2966 # . . call -2967 e8/call check-ints-equal/disp32 +2967 e8/call check-ints-equal/disp32 2968 # . . discard args 2969 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2970 # . epilogue @@ -2749,7 +2749,7 @@ if ('onhashchange' in window) { 2999 68/push 6/imm32/esi 3000 50/push-eax 3001 # . . call -3002 e8/call check-ints-equal/disp32 +3002 e8/call check-ints-equal/disp32 3003 # . . discard args 3004 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 3005 # check-ints-equal(ecx, 1, msg) @@ -2758,7 +2758,7 @@ if ('onhashchange' in window) { 3008 68/push 1/imm32/none 3009 51/push-ecx 3010 # . . call -3011 e8/call check-ints-equal/disp32 +3011 e8/call check-ints-equal/disp32 3012 # . . discard args 3013 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 3014 # check-ints-equal(edx, 0, msg) @@ -2767,7 +2767,7 @@ if ('onhashchange' in window) { 3017 68/push 0/imm32/none 3018 52/push-edx 3019 # . . call -3020 e8/call check-ints-equal/disp32 +3020 e8/call check-ints-equal/disp32 3021 # . . discard args 3022 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 3023 # check-ints-equal(ebx, 0, msg) @@ -2776,7 +2776,7 @@ if ('onhashchange' in window) { 3026 68/push 0/imm32 3027 53/push-ebx 3028 # . . call -3029 e8/call check-ints-equal/disp32 +3029 e8/call check-ints-equal/disp32 3030 # . . discard args 3031 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 3032 # . epilogue @@ -2811,7 +2811,7 @@ if ('onhashchange' in window) { 3061 68/push 6/imm32/esi 3062 50/push-eax 3063 # . . call -3064 e8/call check-ints-equal/disp32 +3064 e8/call check-ints-equal/disp32 3065 # . . discard args 3066 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 3067 # check-ints-equal(ecx, 1, msg) @@ -2820,7 +2820,7 @@ if ('onhashchange' in window) { 3070 68/push 1/imm32/none 3071 51/push-ecx 3072 # . . call -3073 e8/call check-ints-equal/disp32 +3073 e8/call check-ints-equal/disp32 3074 # . . discard args 3075 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 3076 # check-ints-equal(edx, 2, msg) @@ -2829,7 +2829,7 @@ if ('onhashchange' in window) { 3079 68/push 2/imm32 3080 52/push-edx 3081 # . . call -3082 e8/call check-ints-equal/disp32 +3082 e8/call check-ints-equal/disp32 3083 # . . discard args 3084 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 3085 # check-ints-equal(ebx, 0, msg) @@ -2838,7 +2838,7 @@ if ('onhashchange' in window) { 3088 68/push 0/imm32 3089 53/push-ebx 3090 # . . call -3091 e8/call check-ints-equal/disp32 +3091 e8/call check-ints-equal/disp32 3092 # . . discard args 3093 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 3094 # . epilogue @@ -2873,7 +2873,7 @@ if ('onhashchange' in window) { 3123 68/push 6/imm32/esi 3124 50/push-eax 3125 # . . call -3126 e8/call check-ints-equal/disp32 +3126 e8/call check-ints-equal/disp32 3127 # . . discard args 3128 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 3129 # check-ints-equal(ecx, 1, msg) @@ -2882,7 +2882,7 @@ if ('onhashchange' in window) { 3132 68/push 1/imm32/none 3133 51/push-ecx 3134 # . . call -3135 e8/call check-ints-equal/disp32 +3135 e8/call check-ints-equal/disp32 3136 # . . discard args 3137 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 3138 # check-ints-equal(edx, 2, msg) @@ -2891,7 +2891,7 @@ if ('onhashchange' in window) { 3141 68/push 2/imm32 3142 52/push-edx 3143 # . . call -3144 e8/call check-ints-equal/disp32 +3144 e8/call check-ints-equal/disp32 3145 # . . discard args 3146 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 3147 # check-ints-equal(ebx, -0x34, msg) @@ -2900,7 +2900,7 @@ if ('onhashchange' in window) { 3150 68/push -0x34/imm32 3151 53/push-ebx 3152 # . . call -3153 e8/call check-ints-equal/disp32 +3153 e8/call check-ints-equal/disp32 3154 # . . discard args 3155 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 3156 # . epilogue @@ -2938,7 +2938,7 @@ if ('onhashchange' in window) { 3188 68/push "2/mod/*+disp32 4/rm32/sib "/imm32 3189 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 3190 # . . call -3191 e8/call write-buffered/disp32 +3191 e8/call write-buffered/disp32 3192 # . . discard args 3193 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3194 # . write-int32-hex-buffered(out, base) @@ -2946,7 +2946,7 @@ if ('onhashchange' in window) { 3196 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 3197 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 3198 # . . call -3199 e8/call write-int32-hex-buffered/disp32 +3199 e8/call write-int32-hex-buffered/disp32 3200 # . . discard args 3201 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3202 # . write-buffered(out, "/base ") @@ -2954,7 +2954,7 @@ if ('onhashchange' in window) { 3204 68/push "/base "/imm32 3205 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 3206 # . . call -3207 e8/call write-buffered/disp32 +3207 e8/call write-buffered/disp32 3208 # . . discard args 3209 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3210 # . write-int32-hex-buffered(out, index) @@ -2962,7 +2962,7 @@ if ('onhashchange' in window) { 3212 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x10/disp8 . # push *(ebp+16) 3213 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 3214 # . . call -3215 e8/call write-int32-hex-buffered/disp32 +3215 e8/call write-int32-hex-buffered/disp32 3216 # . . discard args 3217 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3218 # . write-buffered(out, "/index ") @@ -2970,7 +2970,7 @@ if ('onhashchange' in window) { 3220 68/push "/index "/imm32 3221 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 3222 # . . call -3223 e8/call write-buffered/disp32 +3223 e8/call write-buffered/disp32 3224 # . . discard args 3225 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3226 # . write-int32-hex-buffered(out, scale) @@ -2978,7 +2978,7 @@ if ('onhashchange' in window) { 3228 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x14/disp8 . # push *(ebp+20) 3229 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 3230 # . . call -3231 e8/call write-int32-hex-buffered/disp32 +3231 e8/call write-int32-hex-buffered/disp32 3232 # . . discard args 3233 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3234 # . write-buffered(out, "/scale ") @@ -2986,7 +2986,7 @@ if ('onhashchange' in window) { 3236 68/push "/scale "/imm32 3237 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 3238 # . . call -3239 e8/call write-buffered/disp32 +3239 e8/call write-buffered/disp32 3240 # . . discard args 3241 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3242 # . write-int32-hex-buffered(out, disp) @@ -2994,7 +2994,7 @@ if ('onhashchange' in window) { 3244 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x18/disp8 . # push *(ebp+24) 3245 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 3246 # . . call -3247 e8/call write-int32-hex-buffered/disp32 +3247 e8/call write-int32-hex-buffered/disp32 3248 # . . discard args 3249 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3250 # . write-buffered(out, "/disp32") @@ -3002,7 +3002,7 @@ if ('onhashchange' in window) { 3252 68/push "/disp32"/imm32 3253 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 3254 # . . call -3255 e8/call write-buffered/disp32 +3255 e8/call write-buffered/disp32 3256 # . . discard args 3257 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3258 e9/jump $emit-indirect-mode:end/disp32 @@ -3017,7 +3017,7 @@ if ('onhashchange' in window) { 3267 68/push "2/mod/*+disp32 "/imm32 3268 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 3269 # . . call -3270 e8/call write-buffered/disp32 +3270 e8/call write-buffered/disp32 3271 # . . discard args 3272 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3273 # . write-int32-hex-buffered(out, base) @@ -3025,7 +3025,7 @@ if ('onhashchange' in window) { 3275 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 3276 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 3277 # . . call -3278 e8/call write-int32-hex-buffered/disp32 +3278 e8/call write-int32-hex-buffered/disp32 3279 # . . discard args 3280 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3281 # . write-buffered(out, "/rm32 ") @@ -3033,7 +3033,7 @@ if ('onhashchange' in window) { 3283 68/push "/rm32 "/imm32 3284 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 3285 # . . call -3286 e8/call write-buffered/disp32 +3286 e8/call write-buffered/disp32 3287 # . . discard args 3288 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3289 # . write-int32-hex-buffered(out, disp) @@ -3041,7 +3041,7 @@ if ('onhashchange' in window) { 3291 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x18/disp8 . # push *(ebp+24) 3292 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 3293 # . . call -3294 e8/call write-int32-hex-buffered/disp32 +3294 e8/call write-int32-hex-buffered/disp32 3295 # . . discard args 3296 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3297 # . write-buffered(out, "/disp32") @@ -3049,7 +3049,7 @@ if ('onhashchange' in window) { 3299 68/push "/disp32"/imm32 3300 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 3301 # . . call -3302 e8/call write-buffered/disp32 +3302 e8/call write-buffered/disp32 3303 # . . discard args 3304 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3305 eb/jump $emit-indirect-mode:end/disp8 @@ -3060,7 +3060,7 @@ if ('onhashchange' in window) { 3310 68/push "0/mod/indirect "/imm32 3311 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 3312 # . . call -3313 e8/call write-buffered/disp32 +3313 e8/call write-buffered/disp32 3314 # . . discard args 3315 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3316 # . write-int32-hex-buffered(out, base) @@ -3068,7 +3068,7 @@ if ('onhashchange' in window) { 3318 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 3319 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 3320 # . . call -3321 e8/call write-int32-hex-buffered/disp32 +3321 e8/call write-int32-hex-buffered/disp32 3322 # . . discard args 3323 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3324 # . write-buffered(out, "/rm32") @@ -3076,7 +3076,7 @@ if ('onhashchange' in window) { 3326 68/push "/rm32"/imm32 3327 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 3328 # . . call -3329 e8/call write-buffered/disp32 +3329 e8/call write-buffered/disp32 3330 # . . discard args 3331 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3332 $emit-indirect-mode:end: @@ -3092,16 +3092,16 @@ if ('onhashchange' in window) { 3342 # setup 3343 # . clear-stream(_test-output-stream) 3344 # . . push args -3345 68/push _test-output-stream/imm32 +3345 68/push _test-output-stream/imm32 3346 # . . call -3347 e8/call clear-stream/disp32 +3347 e8/call clear-stream/disp32 3348 # . . discard args 3349 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3350 # . clear-stream($_test-output-buffered-file->buffer) 3351 # . . push args 3352 68/push $_test-output-buffered-file->buffer/imm32 3353 # . . call -3354 e8/call clear-stream/disp32 +3354 e8/call clear-stream/disp32 3355 # . . discard args 3356 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3357 # emit-indirect-mode(_test-output-buffered-file, 0, 4/none, 0, 0) @@ -3110,16 +3110,16 @@ if ('onhashchange' in window) { 3360 68/push 0/imm32/.scale 3361 68/push 4/imm32/.index/none 3362 68/push 0/imm32/.base -3363 68/push _test-output-buffered-file/imm32 +3363 68/push _test-output-buffered-file/imm32 3364 # . . call 3365 e8/call emit-indirect-mode/disp32 3366 # . . discard args 3367 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x14/imm32 # add to esp 3368 # . flush(_test-output-buffered-file) 3369 # . . push args -3370 68/push _test-output-buffered-file/imm32 +3370 68/push _test-output-buffered-file/imm32 3371 # . . call -3372 e8/call flush/disp32 +3372 e8/call flush/disp32 3373 # . . discard args 3374 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3375 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -3127,9 +3127,9 @@ if ('onhashchange' in window) { 3402 # . . push args 3403 68/push "F - test-emit-indirect-mode"/imm32 3404 68/push "0/mod/indirect 0x00000000/rm32"/imm32 -3405 68/push _test-output-stream/imm32 +3405 68/push _test-output-stream/imm32 3406 # . . call -3407 e8/call check-stream-equal/disp32 +3407 e8/call check-stream-equal/disp32 3408 # . . discard args 3409 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 3410 # . epilogue @@ -3144,16 +3144,16 @@ if ('onhashchange' in window) { 3419 # setup 3420 # . clear-stream(_test-output-stream) 3421 # . . push args -3422 68/push _test-output-stream/imm32 +3422 68/push _test-output-stream/imm32 3423 # . . call -3424 e8/call clear-stream/disp32 +3424 e8/call clear-stream/disp32 3425 # . . discard args 3426 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3427 # . clear-stream($_test-output-buffered-file->buffer) 3428 # . . push args 3429 68/push $_test-output-buffered-file->buffer/imm32 3430 # . . call -3431 e8/call clear-stream/disp32 +3431 e8/call clear-stream/disp32 3432 # . . discard args 3433 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3434 # emit-indirect-mode(_test-output-buffered-file, 6, 4/none, 0, 0) @@ -3162,16 +3162,16 @@ if ('onhashchange' in window) { 3437 68/push 0/imm32/.scale 3438 68/push 4/imm32/.index/none 3439 68/push 7/imm32/.base -3440 68/push _test-output-buffered-file/imm32 +3440 68/push _test-output-buffered-file/imm32 3441 # . . call 3442 e8/call emit-indirect-mode/disp32 3443 # . . discard args 3444 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x14/imm32 # add to esp 3445 # . flush(_test-output-buffered-file) 3446 # . . push args -3447 68/push _test-output-buffered-file/imm32 +3447 68/push _test-output-buffered-file/imm32 3448 # . . call -3449 e8/call flush/disp32 +3449 e8/call flush/disp32 3450 # . . discard args 3451 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3452 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -3179,9 +3179,9 @@ if ('onhashchange' in window) { 3479 # . . push args 3480 68/push "F - test-emit-indirect-mode-2"/imm32 3481 68/push "0/mod/indirect 0x00000007/rm32"/imm32 -3482 68/push _test-output-stream/imm32 +3482 68/push _test-output-stream/imm32 3483 # . . call -3484 e8/call check-stream-equal/disp32 +3484 e8/call check-stream-equal/disp32 3485 # . . discard args 3486 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 3487 # . epilogue @@ -3196,16 +3196,16 @@ if ('onhashchange' in window) { 3496 # setup 3497 # . clear-stream(_test-output-stream) 3498 # . . push args -3499 68/push _test-output-stream/imm32 +3499 68/push _test-output-stream/imm32 3500 # . . call -3501 e8/call clear-stream/disp32 +3501 e8/call clear-stream/disp32 3502 # . . discard args 3503 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3504 # . clear-stream($_test-output-buffered-file->buffer) 3505 # . . push args 3506 68/push $_test-output-buffered-file->buffer/imm32 3507 # . . call -3508 e8/call clear-stream/disp32 +3508 e8/call clear-stream/disp32 3509 # . . discard args 3510 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3511 # emit-indirect-mode(_test-output-buffered-file, 6, 4/none, 0, 4) @@ -3214,16 +3214,16 @@ if ('onhashchange' in window) { 3514 68/push 0/imm32/.scale 3515 68/push 4/imm32/.index/none 3516 68/push 6/imm32/.base -3517 68/push _test-output-buffered-file/imm32 +3517 68/push _test-output-buffered-file/imm32 3518 # . . call 3519 e8/call emit-indirect-mode/disp32 3520 # . . discard args 3521 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x14/imm32 # add to esp 3522 # . flush(_test-output-buffered-file) 3523 # . . push args -3524 68/push _test-output-buffered-file/imm32 +3524 68/push _test-output-buffered-file/imm32 3525 # . . call -3526 e8/call flush/disp32 +3526 e8/call flush/disp32 3527 # . . discard args 3528 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3529 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -3231,9 +3231,9 @@ if ('onhashchange' in window) { 3556 # . . push args 3557 68/push "F - test-emit-indirect-mode-with-disp"/imm32 3558 68/push "2/mod/*+disp32 0x00000006/rm32 0x00000004/disp32"/imm32 -3559 68/push _test-output-stream/imm32 +3559 68/push _test-output-stream/imm32 3560 # . . call -3561 e8/call check-stream-equal/disp32 +3561 e8/call check-stream-equal/disp32 3562 # . . discard args 3563 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 3564 # . epilogue @@ -3248,16 +3248,16 @@ if ('onhashchange' in window) { 3573 # setup 3574 # . clear-stream(_test-output-stream) 3575 # . . push args -3576 68/push _test-output-stream/imm32 +3576 68/push _test-output-stream/imm32 3577 # . . call -3578 e8/call clear-stream/disp32 +3578 e8/call clear-stream/disp32 3579 # . . discard args 3580 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3581 # . clear-stream($_test-output-buffered-file->buffer) 3582 # . . push args 3583 68/push $_test-output-buffered-file->buffer/imm32 3584 # . . call -3585 e8/call clear-stream/disp32 +3585 e8/call clear-stream/disp32 3586 # . . discard args 3587 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3588 # emit-indirect-mode(_test-output-buffered-file, 6, 4/none, 0, -4) @@ -3266,16 +3266,16 @@ if ('onhashchange' in window) { 3591 68/push 0/imm32/.scale 3592 68/push 4/imm32/.index/none 3593 68/push 6/imm32/.base -3594 68/push _test-output-buffered-file/imm32 +3594 68/push _test-output-buffered-file/imm32 3595 # . . call 3596 e8/call emit-indirect-mode/disp32 3597 # . . discard args 3598 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x14/imm32 # add to esp 3599 # . flush(_test-output-buffered-file) 3600 # . . push args -3601 68/push _test-output-buffered-file/imm32 +3601 68/push _test-output-buffered-file/imm32 3602 # . . call -3603 e8/call flush/disp32 +3603 e8/call flush/disp32 3604 # . . discard args 3605 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3606 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -3283,9 +3283,9 @@ if ('onhashchange' in window) { 3633 # . . push args 3634 68/push "F - test-emit-indirect-mode-with-disp"/imm32 3635 68/push "2/mod/*+disp32 0x00000006/rm32 0xfffffffc/disp32"/imm32 -3636 68/push _test-output-stream/imm32 +3636 68/push _test-output-stream/imm32 3637 # . . call -3638 e8/call check-stream-equal/disp32 +3638 e8/call check-stream-equal/disp32 3639 # . . discard args 3640 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 3641 # . epilogue @@ -3300,16 +3300,16 @@ if ('onhashchange' in window) { 3650 # setup 3651 # . clear-stream(_test-output-stream) 3652 # . . push args -3653 68/push _test-output-stream/imm32 +3653 68/push _test-output-stream/imm32 3654 # . . call -3655 e8/call clear-stream/disp32 +3655 e8/call clear-stream/disp32 3656 # . . discard args 3657 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3658 # . clear-stream($_test-output-buffered-file->buffer) 3659 # . . push args 3660 68/push $_test-output-buffered-file->buffer/imm32 3661 # . . call -3662 e8/call clear-stream/disp32 +3662 e8/call clear-stream/disp32 3663 # . . discard args 3664 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3665 # emit-indirect-mode(_test-output-buffered-file, 6/base, 1/index, 2/scale, 4/disp) @@ -3318,16 +3318,16 @@ if ('onhashchange' in window) { 3668 68/push 2/imm32/.scale 3669 68/push 1/imm32/.index 3670 68/push 6/imm32/.base -3671 68/push _test-output-buffered-file/imm32 +3671 68/push _test-output-buffered-file/imm32 3672 # . . call 3673 e8/call emit-indirect-mode/disp32 3674 # . . discard args 3675 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x14/imm32 # add to esp 3676 # . flush(_test-output-buffered-file) 3677 # . . push args -3678 68/push _test-output-buffered-file/imm32 +3678 68/push _test-output-buffered-file/imm32 3679 # . . call -3680 e8/call flush/disp32 +3680 e8/call flush/disp32 3681 # . . discard args 3682 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3683 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -3335,9 +3335,9 @@ if ('onhashchange' in window) { 3710 # . . push args 3711 68/push "F - test-emit-indirect-mode-with-sib"/imm32 3712 68/push "2/mod/*+disp32 4/rm32/sib 0x00000006/base 0x00000001/index 0x00000002/scale 0x00000004/disp32"/imm32 -3713 68/push _test-output-stream/imm32 +3713 68/push _test-output-stream/imm32 3714 # . . call -3715 e8/call check-stream-equal/disp32 +3715 e8/call check-stream-equal/disp32 3716 # . . discard args 3717 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 3718 # . epilogue @@ -3352,16 +3352,16 @@ if ('onhashchange' in window) { 3727 # setup 3728 # . clear-stream(_test-output-stream) 3729 # . . push args -3730 68/push _test-output-stream/imm32 +3730 68/push _test-output-stream/imm32 3731 # . . call -3732 e8/call clear-stream/disp32 +3732 e8/call clear-stream/disp32 3733 # . . discard args 3734 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3735 # . clear-stream($_test-output-buffered-file->buffer) 3736 # . . push args 3737 68/push $_test-output-buffered-file->buffer/imm32 3738 # . . call -3739 e8/call clear-stream/disp32 +3739 e8/call clear-stream/disp32 3740 # . . discard args 3741 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3742 # emit-indirect-mode(_test-output-buffered-file, 5/base, 0/index, 0/scale, 0/disp) @@ -3370,16 +3370,16 @@ if ('onhashchange' in window) { 3745 68/push 0/imm32/.scale 3746 68/push 0/imm32/.index 3747 68/push 5/imm32/.base/ebp -3748 68/push _test-output-buffered-file/imm32 +3748 68/push _test-output-buffered-file/imm32 3749 # . . call 3750 e8/call emit-indirect-mode/disp32 3751 # . . discard args 3752 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x14/imm32 # add to esp 3753 # . flush(_test-output-buffered-file) 3754 # . . push args -3755 68/push _test-output-buffered-file/imm32 +3755 68/push _test-output-buffered-file/imm32 3756 # . . call -3757 e8/call flush/disp32 +3757 e8/call flush/disp32 3758 # . . discard args 3759 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3760 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -3387,9 +3387,9 @@ if ('onhashchange' in window) { 3787 # . . push args 3788 68/push "F - test-emit-indirect-mode-ebp"/imm32 3789 68/push "2/mod/*+disp32 4/rm32/sib 0x00000005/base 0x00000000/index 0x00000000/scale 0x00000000/disp32"/imm32 -3790 68/push _test-output-stream/imm32 +3790 68/push _test-output-stream/imm32 3791 # . . call -3792 e8/call check-stream-equal/disp32 +3792 e8/call check-stream-equal/disp32 3793 # . . discard args 3794 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 3795 # . epilogue @@ -3404,16 +3404,16 @@ if ('onhashchange' in window) { 3804 # setup 3805 # . clear-stream(_test-output-stream) 3806 # . . push args -3807 68/push _test-output-stream/imm32 +3807 68/push _test-output-stream/imm32 3808 # . . call -3809 e8/call clear-stream/disp32 +3809 e8/call clear-stream/disp32 3810 # . . discard args 3811 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3812 # . clear-stream($_test-output-buffered-file->buffer) 3813 # . . push args 3814 68/push $_test-output-buffered-file->buffer/imm32 3815 # . . call -3816 e8/call clear-stream/disp32 +3816 e8/call clear-stream/disp32 3817 # . . discard args 3818 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3819 # emit-indirect-mode(_test-output-buffered-file, 4/base, 0/index, 0/scale, 0/disp) @@ -3422,16 +3422,16 @@ if ('onhashchange' in window) { 3822 68/push 0/imm32/.scale 3823 68/push 0/imm32/.index 3824 68/push 4/imm32/.base/esp -3825 68/push _test-output-buffered-file/imm32 +3825 68/push _test-output-buffered-file/imm32 3826 # . . call 3827 e8/call emit-indirect-mode/disp32 3828 # . . discard args 3829 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x14/imm32 # add to esp 3830 # . flush(_test-output-buffered-file) 3831 # . . push args -3832 68/push _test-output-buffered-file/imm32 +3832 68/push _test-output-buffered-file/imm32 3833 # . . call -3834 e8/call flush/disp32 +3834 e8/call flush/disp32 3835 # . . discard args 3836 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3837 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -3439,9 +3439,9 @@ if ('onhashchange' in window) { 3864 # . . push args 3865 68/push "F - test-emit-indirect-mode-esp"/imm32 3866 68/push "2/mod/*+disp32 4/rm32/sib 0x00000004/base 0x00000000/index 0x00000000/scale 0x00000000/disp32"/imm32 -3867 68/push _test-output-stream/imm32 +3867 68/push _test-output-stream/imm32 3868 # . . call -3869 e8/call check-stream-equal/disp32 +3869 e8/call check-stream-equal/disp32 3870 # . . discard args 3871 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 3872 # . epilogue @@ -3477,16 +3477,16 @@ if ('onhashchange' in window) { 3902 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 . # push *(esi+4) 3903 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . . # push *esi 3904 # . . call -3905 e8/call next-token-from-slice/disp32 +3905 e8/call next-token-from-slice/disp32 3906 # . . discard args 3907 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32 # add to esp 3908 # reg-num/eax = maybe-get-slice(Registers, local-slice, row-size=12) 3909 # . . push args 3910 68/push 0xc/imm32/row-size 3911 56/push-esi -3912 68/push Registers/imm32 +3912 68/push Registers/imm32 3913 # . . cal -3914 e8/call maybe-get-slice/disp32 +3914 e8/call maybe-get-slice/disp32 3915 # . . discard args 3916 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 3917 # if (eax != 0) return false @@ -3526,7 +3526,7 @@ if ('onhashchange' in window) { 3951 68/push "0/mod/indirect 5/rm32/.disp32 "/imm32 3952 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 3953 # . . call -3954 e8/call write-buffered/disp32 +3954 e8/call write-buffered/disp32 3955 # . . discard args 3956 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3957 # write-slice-buffered(out, local-slice) @@ -3534,7 +3534,7 @@ if ('onhashchange' in window) { 3959 56/push-esi 3960 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 3961 # . . call -3962 e8/call write-slice-buffered/disp32 +3962 e8/call write-slice-buffered/disp32 3963 # . . discard args 3964 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3965 # write-buffered(out, "/disp32") @@ -3542,7 +3542,7 @@ if ('onhashchange' in window) { 3967 68/push "/disp32"/imm32 3968 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 3969 # . . call -3970 e8/call write-buffered/disp32 +3970 e8/call write-buffered/disp32 3971 # . . discard args 3972 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3973 $emit-indirect-disp32:end: @@ -3606,7 +3606,7 @@ if ('onhashchange' in window) { 4031 52/push-edx 4032 51/push-ecx 4033 # . . call -4034 e8/call skip-chars-matching-whitespace-in-slice/disp32 +4034 e8/call skip-chars-matching-whitespace-in-slice/disp32 4035 # . . discard args 4036 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 4037 # ecx = eax @@ -3643,7 +3643,7 @@ if ('onhashchange' in window) { 4068 # . . push args 4069 50/push-eax 4070 # . . call -4071 e8/call is-hex-digit?/disp32 +4071 e8/call is-hex-digit?/disp32 4072 # . . discard args 4073 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4074 # . if (eax == false) break @@ -3653,7 +3653,7 @@ if ('onhashchange' in window) { 4078 # . . copy arg to eax 4079 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 0/r32/AL . . # copy byte at *ecx to AL 4080 # . . call -4081 e8/call from-hex-char/disp32 +4081 e8/call from-hex-char/disp32 4082 # result = result * 16 + eax 4083 c1/shift 4/subop/left 3/mod/direct 7/rm32/edi . . . . . 4/imm8 # shift edi left by 4 bits 4084 01/add 3/mod/direct 7/rm32/edi . . . 0/r32/eax . . # add eax to edi @@ -3689,7 +3689,7 @@ if ('onhashchange' in window) { 4114 68/push "next-hex-int: invalid hex char: "/imm32 4115 68/push 2/imm32/stderr 4116 # . . call -4117 e8/call _write/disp32 +4117 e8/call _write/disp32 4118 # . . discard args 4119 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 4120 # . clear-stream($Stderr->buffer) @@ -3698,7 +3698,7 @@ if ('onhashchange' in window) { 4123 # . . push args 4124 68/push $Stderr->buffer/imm32 4125 # . . call -4126 e8/call clear-stream/disp32 +4126 e8/call clear-stream/disp32 4127 # . . discard args 4128 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4129 # . . restore eax @@ -3706,24 +3706,24 @@ if ('onhashchange' in window) { 4131 # . write-int32-hex-buffered(Stderr, eax) 4132 # . . push args 4133 50/push-eax -4134 68/push Stderr/imm32 +4134 68/push Stderr/imm32 4135 # . . call -4136 e8/call write-int32-hex-buffered/disp32 +4136 e8/call write-int32-hex-buffered/disp32 4137 # . . discard args 4138 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 4139 # . flush(Stderr) 4140 # . . push args -4141 68/push Stderr/imm32 +4141 68/push Stderr/imm32 4142 # . . call -4143 e8/call flush/disp32 +4143 e8/call flush/disp32 4144 # . . discard args 4145 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4146 # . _write(2/stderr, "\n") 4147 # . . push args -4148 68/push Newline/imm32 +4148 68/push Newline/imm32 4149 68/push 2/imm32/stderr 4150 # . . call -4151 e8/call _write/disp32 +4151 e8/call _write/disp32 4152 # . . discard args 4153 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 4154 # . syscall(exit, 1) @@ -3757,7 +3757,7 @@ if ('onhashchange' in window) { 4182 68/push 0xa/imm32 4183 50/push-eax 4184 # . . call -4185 e8/call check-ints-equal/disp32 +4185 e8/call check-ints-equal/disp32 4186 # . . discard args 4187 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 4188 # . epilogue @@ -3791,7 +3791,7 @@ if ('onhashchange' in window) { 4216 68/push 0x34a/imm32 4217 50/push-eax 4218 # . . call -4219 e8/call check-ints-equal/disp32 +4219 e8/call check-ints-equal/disp32 4220 # . . discard args 4221 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 4222 # . epilogue @@ -3825,7 +3825,7 @@ if ('onhashchange' in window) { 4250 68/push 0x34/imm32 4251 50/push-eax 4252 # . . call -4253 e8/call check-ints-equal/disp32 +4253 e8/call check-ints-equal/disp32 4254 # . . discard args 4255 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 4256 # . epilogue @@ -3859,7 +3859,7 @@ if ('onhashchange' in window) { 4284 68/push 0/imm32 4285 50/push-eax 4286 # . . call -4287 e8/call check-ints-equal/disp32 +4287 e8/call check-ints-equal/disp32 4288 # . . discard args 4289 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 4290 # . epilogue @@ -3893,7 +3893,7 @@ if ('onhashchange' in window) { 4318 68/push 3/imm32 4319 50/push-eax 4320 # . . call -4321 e8/call check-ints-equal/disp32 +4321 e8/call check-ints-equal/disp32 4322 # . . discard args 4323 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 4324 # . epilogue @@ -3927,7 +3927,7 @@ if ('onhashchange' in window) { 4352 68/push -3/imm32 4353 50/push-eax 4354 # . . call -4355 e8/call check-ints-equal/disp32 +4355 e8/call check-ints-equal/disp32 4356 # . . discard args 4357 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 4358 # . epilogue @@ -3961,7 +3961,7 @@ if ('onhashchange' in window) { 4386 68/push -3/imm32 4387 50/push-eax 4388 # . . call -4389 e8/call check-ints-equal/disp32 +4389 e8/call check-ints-equal/disp32 4390 # . . discard args 4391 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 4392 # . epilogue @@ -4025,7 +4025,7 @@ if ('onhashchange' in window) { 4450 # . . push args 4451 50/push-eax 4452 # . . call -4453 e8/call is-hex-digit?/disp32 +4453 e8/call is-hex-digit?/disp32 4454 # . . discard args 4455 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4456 # . if (eax == false) break @@ -4035,7 +4035,7 @@ if ('onhashchange' in window) { 4460 # . . copy arg to eax 4461 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 0/r32/AL . . # copy byte at *ecx to AL 4462 # . . call -4463 e8/call from-hex-char/disp32 +4463 e8/call from-hex-char/disp32 4464 # result = result * 16 + eax 4465 c1/shift 4/subop/left 3/mod/direct 7/rm32/edi . . . . . 4/imm8 # shift edi left by 4 bits 4466 01/add 3/mod/direct 7/rm32/edi . . . 0/r32/eax . . # add eax to edi @@ -4085,7 +4085,7 @@ if ('onhashchange' in window) { 4510 68/push 0xa/imm32 4511 50/push-eax 4512 # . . call -4513 e8/call check-ints-equal/disp32 +4513 e8/call check-ints-equal/disp32 4514 # . . discard args 4515 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 4516 # . epilogue @@ -4119,7 +4119,7 @@ if ('onhashchange' in window) { 4544 68/push 0x34a/imm32 4545 50/push-eax 4546 # . . call -4547 e8/call check-ints-equal/disp32 +4547 e8/call check-ints-equal/disp32 4548 # . . discard args 4549 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 4550 # . epilogue @@ -4153,7 +4153,7 @@ if ('onhashchange' in window) { 4578 68/push 0x34/imm32 4579 50/push-eax 4580 # . . call -4581 e8/call check-ints-equal/disp32 +4581 e8/call check-ints-equal/disp32 4582 # . . discard args 4583 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 4584 # . epilogue @@ -4187,7 +4187,7 @@ if ('onhashchange' in window) { 4612 68/push 0/imm32 4613 50/push-eax 4614 # . . call -4615 e8/call check-ints-equal/disp32 +4615 e8/call check-ints-equal/disp32 4616 # . . discard args 4617 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 4618 # . epilogue @@ -4221,7 +4221,7 @@ if ('onhashchange' in window) { 4646 68/push 3/imm32 4647 50/push-eax 4648 # . . call -4649 e8/call check-ints-equal/disp32 +4649 e8/call check-ints-equal/disp32 4650 # . . discard args 4651 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 4652 # . epilogue diff --git a/html/apps/survey.subx.html b/html/apps/survey.subx.html index da2a899f..0919ab21 100644 --- a/html/apps/survey.subx.html +++ b/html/apps/survey.subx.html @@ -110,17 +110,17 @@ if ('onhashchange' in window) { 47 48 # Heap = new-segment(Heap-size) 49 # . . push args - 50 68/push Heap/imm32 - 51 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Heap-size/disp32 # push *Heap-size + 50 68/push Heap/imm32 + 51 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Heap-size/disp32 # push *Heap-size 52 # . . call - 53 e8/call new-segment/disp32 + 53 e8/call new-segment/disp32 54 # . . discard args 55 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 56 # initialize-trace-stream(Trace-size) 57 # . . push args 58 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-size/disp32 # push *Heap-size 59 # . . call - 60 e8/call initialize-trace-stream/disp32 + 60 e8/call initialize-trace-stream/disp32 61 # . . discard args 62 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 63 @@ -134,7 +134,7 @@ if ('onhashchange' in window) { 71 68/push "test"/imm32 72 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 73 # . . call - 74 e8/call kernel-string-equal?/disp32 + 74 e8/call kernel-string-equal?/disp32 75 # . . discard args 76 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 77 # . if (eax == false) goto interactive @@ -143,14 +143,14 @@ if ('onhashchange' in window) { 80 # run-tests() 81 e8/call run-tests/disp32 82 # syscall(exit, *Num-test-failures) - 83 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/ebx Num-test-failures/disp32 # copy *Num-test-failures to ebx + 83 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/ebx Num-test-failures/disp32 # copy *Num-test-failures to ebx 84 eb/jump $subx-survey-main:end/disp8 85 $subx-survey-main:interactive: 86 # - otherwise convert stdin 87 # subx-survey(Stdin, Stdout) 88 # . . push args - 89 68/push Stdout/imm32 - 90 68/push Stdin/imm32 + 89 68/push Stdout/imm32 + 90 68/push Stdin/imm32 91 # . . call 92 e8/call subx-survey/disp32 93 # . . discard args @@ -224,7 +224,7 @@ if ('onhashchange' in window) { 161 56/push-esi 162 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 163 # . . call - 164 e8/call slurp/disp32 + 164 e8/call slurp/disp32 165 # . . discard args 166 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 167 # compute-offsets(in, segments, labels) @@ -248,7 +248,7 @@ if ('onhashchange' in window) { 185 # . . push args 186 56/push-esi 187 # . . call - 188 e8/call rewind-stream/disp32 + 188 e8/call rewind-stream/disp32 189 # . . discard args 190 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 191 # emit-output(in, out, segments, labels) @@ -265,7 +265,7 @@ if ('onhashchange' in window) { 202 # . . push args 203 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 204 # . . call - 205 e8/call flush/disp32 + 205 e8/call flush/disp32 206 # . . discard args 207 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 208 $subx-survey:end: @@ -303,85 +303,85 @@ if ('onhashchange' in window) { 240 # setup 241 # . clear-stream(_test-input-stream) 242 # . . push args - 243 68/push _test-input-stream/imm32 + 243 68/push _test-input-stream/imm32 244 # . . call - 245 e8/call clear-stream/disp32 + 245 e8/call clear-stream/disp32 246 # . . discard args 247 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 248 # . clear-stream($_test-input-buffered-file->buffer) 249 # . . push args 250 68/push $_test-input-buffered-file->buffer/imm32 251 # . . call - 252 e8/call clear-stream/disp32 + 252 e8/call clear-stream/disp32 253 # . . discard args 254 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 255 # . clear-stream(_test-output-stream) 256 # . . push args - 257 68/push _test-output-stream/imm32 + 257 68/push _test-output-stream/imm32 258 # . . call - 259 e8/call clear-stream/disp32 + 259 e8/call clear-stream/disp32 260 # . . discard args 261 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 262 # . clear-stream($_test-output-buffered-file->buffer) 263 # . . push args 264 68/push $_test-output-buffered-file->buffer/imm32 265 # . . call - 266 e8/call clear-stream/disp32 + 266 e8/call clear-stream/disp32 267 # . . discard args 268 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 269 # initialize input 270 # . write(_test-input-stream, "== code 0x1\n") 271 # . . push args 272 68/push "== code 0x1\n"/imm32 - 273 68/push _test-input-stream/imm32 + 273 68/push _test-input-stream/imm32 274 # . . call - 275 e8/call write/disp32 + 275 e8/call write/disp32 276 # . . discard args 277 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 278 # . write(_test-input-stream, "Entry:\n") 279 # . . push args 280 68/push "Entry:\n"/imm32 - 281 68/push _test-input-stream/imm32 + 281 68/push _test-input-stream/imm32 282 # . . call - 283 e8/call write/disp32 + 283 e8/call write/disp32 284 # . . discard args 285 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 286 # . write(_test-input-stream, "ab x/imm32\n") 287 # . . push args 288 68/push "ab x/imm32\n"/imm32 - 289 68/push _test-input-stream/imm32 + 289 68/push _test-input-stream/imm32 290 # . . call - 291 e8/call write/disp32 + 291 e8/call write/disp32 292 # . . discard args 293 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 294 # . write(_test-input-stream, "== data 0x1000\n") 295 # . . push args 296 68/push "== data 0x1000\n"/imm32 - 297 68/push _test-input-stream/imm32 + 297 68/push _test-input-stream/imm32 298 # . . call - 299 e8/call write/disp32 + 299 e8/call write/disp32 300 # . . discard args 301 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 302 # . write(_test-input-stream, "x:\n") 303 # . . push args 304 68/push "x:\n"/imm32 - 305 68/push _test-input-stream/imm32 + 305 68/push _test-input-stream/imm32 306 # . . call - 307 e8/call write/disp32 + 307 e8/call write/disp32 308 # . . discard args 309 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 310 # . write(_test-input-stream, "01\n") 311 # . . push args 312 68/push "01\n"/imm32 - 313 68/push _test-input-stream/imm32 + 313 68/push _test-input-stream/imm32 314 # . . call - 315 e8/call write/disp32 + 315 e8/call write/disp32 316 # . . discard args 317 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 318 # subx-survey(_test-input-buffered-file, _test-output-buffered-file) 319 # . . push args - 320 68/push _test-output-buffered-file/imm32 - 321 68/push _test-input-buffered-file/imm32 + 320 68/push _test-output-buffered-file/imm32 + 321 68/push _test-input-buffered-file/imm32 322 # . . call 323 e8/call subx-survey/disp32 324 # . . discard args @@ -393,7 +393,7 @@ if ('onhashchange' in window) { 355 68/push "F - test-subx-survey-computes-addresses/0"/imm32 356 68/push "label 'x' is at address 0x00001079."/imm32 357 # . . call - 358 e8/call check-trace-contains/disp32 + 358 e8/call check-trace-contains/disp32 359 # . . discard args 360 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 361 # . check-trace-contains("segment 'code' starts at address 0x00000074.", msg) @@ -401,15 +401,15 @@ if ('onhashchange' in window) { 363 68/push "F - test-subx-survey-computes-addresses/1"/imm32 364 68/push "segment 'code' starts at address 0x00000074."/imm32 365 # . . call - 366 e8/call check-trace-contains/disp32 + 366 e8/call check-trace-contains/disp32 367 # . . discard args 368 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 369 # . check-trace-contains("segment 'code' has size 0x00000005.", msg) 370 # . . push args 371 68/push "F - test-subx-survey-computes-addresses/2"/imm32 - 372 68/push "segment 'code' has size 0x00000005."/imm32 + 372 68/push "segment 'code' has size 0x00000005."/imm32 373 # . . call - 374 e8/call check-trace-contains/disp32 + 374 e8/call check-trace-contains/disp32 375 # . . discard args 376 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 377 # . check-trace-contains("segment 'data' starts at address 0x00001079.", msg) @@ -417,7 +417,7 @@ if ('onhashchange' in window) { 379 68/push "F - test-subx-survey-computes-addresses/3"/imm32 380 68/push "segment 'data' starts at address 0x00001079."/imm32 381 # . . call - 382 e8/call check-trace-contains/disp32 + 382 e8/call check-trace-contains/disp32 383 # . . discard args 384 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 385 # . epilogue @@ -533,13 +533,13 @@ if ('onhashchange' in window) { 495 $compute-offsets:line-loop: 496 # clear-stream(line) 497 51/push-ecx - 498 e8/call clear-stream/disp32 + 498 e8/call clear-stream/disp32 499 # . discard args 500 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 501 # read-line(in, line) 502 51/push-ecx 503 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) - 504 e8/call read-line/disp32 + 504 e8/call read-line/disp32 505 # . discard args 506 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 507 # if (line->write == 0) break @@ -551,14 +551,14 @@ if ('onhashchange' in window) { 545 # next-word(line, word-slice) 546 52/push-edx 547 51/push-ecx - 548 e8/call next-word/disp32 + 548 e8/call next-word/disp32 549 # . discard args 550 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 551 $compute-offsets:case-empty: 552 # if slice-empty?(word-slice) break 553 # . eax = slice-empty?(word-slice) 554 52/push-edx - 555 e8/call slice-empty?/disp32 + 555 e8/call slice-empty?/disp32 556 # . . discard args 557 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 558 # . if (eax != false) break @@ -568,7 +568,7 @@ if ('onhashchange' in window) { 562 # if slice-starts-with?(word-slice, "#") continue 563 68/push "#"/imm32 564 52/push-edx - 565 e8/call slice-starts-with?/disp32 + 565 e8/call slice-starts-with?/disp32 566 # . . discard args 567 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 568 # . if (eax != false) break @@ -579,7 +579,7 @@ if ('onhashchange' in window) { 573 # . eax = slice-equal?(word-slice, "==") 574 68/push "=="/imm32 575 52/push-edx - 576 e8/call slice-equal?/disp32 + 576 e8/call slice-equal?/disp32 577 # . . discard args 578 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 579 # . if (eax == false) goto next case @@ -596,7 +596,7 @@ if ('onhashchange' in window) { 590 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . . # push *esi 591 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 592 # . . call - 593 e8/call get-or-insert-handle/disp32 + 593 e8/call get-or-insert-handle/disp32 594 # . . discard args 595 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32 # add to esp 596 # . edi = eax @@ -620,7 +620,7 @@ if ('onhashchange' in window) { 614 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 . # push *(esi+4) 615 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . . # push *esi 616 # . . call - 617 e8/call lookup/disp32 + 617 e8/call lookup/disp32 618 # . . discard args 619 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 620 # . trace-sssns("segment '", eax, "' has size ", sinfo->size, ".") @@ -638,7 +638,7 @@ if ('onhashchange' in window) { 632 # next-word(line, segment-tmp) 633 68/push compute-offsets:segment-tmp/imm32 634 51/push-ecx - 635 e8/call next-word/disp32 + 635 e8/call next-word/disp32 636 # . discard args 637 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 638 # if slice-empty?(segment-tmp) abort @@ -646,7 +646,7 @@ if ('onhashchange' in window) { 640 # . . push args 641 68/push compute-offsets:segment-tmp/imm32 642 # . . call - 643 e8/call slice-empty?/disp32 + 643 e8/call slice-empty?/disp32 644 # . . discard args 645 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 646 # . if (eax != false) abort @@ -657,15 +657,15 @@ if ('onhashchange' in window) { 651 # . . push args 652 56/push-esi 653 68/push compute-offsets:segment-tmp/imm32 - 654 68/push Heap/imm32 + 654 68/push Heap/imm32 655 # . . call - 656 e8/call slice-to-string/disp32 + 656 e8/call slice-to-string/disp32 657 # . . discard args 658 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 659 # next-word(line, segment-tmp) 660 68/push compute-offsets:segment-tmp/imm32 661 51/push-ecx - 662 e8/call next-word/disp32 + 662 e8/call next-word/disp32 663 # . discard args 664 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 665 # if slice-empty?(segment-tmp) abort @@ -673,7 +673,7 @@ if ('onhashchange' in window) { 667 # . . push args 668 68/push compute-offsets:segment-tmp/imm32 669 # . . call - 670 e8/call slice-empty?/disp32 + 670 e8/call slice-empty?/disp32 671 # . . discard args 672 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 673 # . if (eax != false) abort @@ -687,7 +687,7 @@ if ('onhashchange' in window) { 681 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . . # push *esi 682 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 683 # . . call - 684 e8/call get-or-insert-handle/disp32 + 684 e8/call get-or-insert-handle/disp32 685 # . . discard args 686 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32 # add to esp 687 # . edi = eax @@ -697,7 +697,7 @@ if ('onhashchange' in window) { 691 # . . push args 692 68/push compute-offsets:segment-tmp/imm32 693 # . . call - 694 e8/call parse-hex-int-from-slice/disp32 + 694 e8/call parse-hex-int-from-slice/disp32 695 # . . discard args 696 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 697 # . sinfo->address = eax @@ -711,7 +711,7 @@ if ('onhashchange' in window) { 705 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 . # push *(esi+4) 706 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . . # push *esi 707 # . . call - 708 e8/call lookup/disp32 + 708 e8/call lookup/disp32 709 # . . discard args 710 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 711 # . trace-sssns("segment '", eax, "' is at file offset ", file-offset, ".") @@ -735,7 +735,7 @@ if ('onhashchange' in window) { 729 # . . push args 730 52/push-edx 731 # . . call - 732 e8/call is-label?/disp32 + 732 e8/call is-label?/disp32 733 # . . discard args 734 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 735 # . if (eax == false) goto next case @@ -746,12 +746,12 @@ if ('onhashchange' in window) { 740 # linfo/edi = get-or-insert-slice(labels, word-slice, row-size=24) 741 # . eax = get-or-insert-slice(labels, word-slice, row-size=24) 742 # . . push args - 743 68/push Heap/imm32 + 743 68/push Heap/imm32 744 68/push 0x18/imm32/row-size 745 52/push-edx 746 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x10/disp8 . # push *(ebp+16) 747 # . . call - 748 e8/call get-or-insert-slice/disp32 + 748 e8/call get-or-insert-slice/disp32 749 # . . discard args 750 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32 # add to esp 751 # . edi = eax @@ -768,7 +768,7 @@ if ('onhashchange' in window) { 762 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 . # push *(esi+4) 763 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . . # push *esi 764 # . . call - 765 e8/call lookup/disp32 + 765 e8/call lookup/disp32 766 # . . discard args 767 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 768 # . trace-slsss("label '" word-slice "' is in segment '" eax "'.") @@ -805,7 +805,7 @@ if ('onhashchange' in window) { 799 # . . push args 800 52/push-edx 801 # . . call - 802 e8/call compute-width-of-slice/disp32 + 802 e8/call compute-width-of-slice/disp32 803 # . . discard args 804 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 805 # segment-offset += width @@ -823,7 +823,7 @@ if ('onhashchange' in window) { 857 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . . # push *esi 858 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 859 # . . call - 860 e8/call get-or-insert-handle/disp32 + 860 e8/call get-or-insert-handle/disp32 861 # . . discard args 862 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32 # add to esp 863 # . edi = eax @@ -847,7 +847,7 @@ if ('onhashchange' in window) { 881 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 . # push *(esi+4) 882 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . . # push *esi 883 # . . call - 884 e8/call lookup/disp32 + 884 e8/call lookup/disp32 885 # . . discard args 886 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 887 # . trace-sssns("segment '", eax, "' has size ", ebx, ".") @@ -882,7 +882,7 @@ if ('onhashchange' in window) { 916 68/push "'==' must be followed by segment name and segment-start\n"/imm32 917 68/push 2/imm32/stderr 918 # . . call - 919 e8/call _write/disp32 + 919 e8/call _write/disp32 920 # . . discard args 921 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 922 # . syscall(exit, 1) @@ -913,9 +913,9 @@ if ('onhashchange' in window) { 947 # setup 948 # . clear-stream(_test-input-stream) 949 # . . push args - 950 68/push _test-input-stream/imm32 + 950 68/push _test-input-stream/imm32 951 # . . call - 952 e8/call clear-stream/disp32 + 952 e8/call clear-stream/disp32 953 # . . discard args 954 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 955 # var segments/ecx: (stream byte 2*20) @@ -934,56 +934,56 @@ if ('onhashchange' in window) { 968 # . write(_test-input-stream, "== code 0x1\n") 969 # . . push args 970 68/push "== code 0x1\n"/imm32 - 971 68/push _test-input-stream/imm32 + 971 68/push _test-input-stream/imm32 972 # . . call - 973 e8/call write/disp32 + 973 e8/call write/disp32 974 # . . discard args 975 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 976 # . write(_test-input-stream, "ab x/imm32 # skip comment\n") 977 # . . push args 978 68/push "ab x/imm32 # skip comment\n"/imm32 - 979 68/push _test-input-stream/imm32 + 979 68/push _test-input-stream/imm32 980 # . . call - 981 e8/call write/disp32 + 981 e8/call write/disp32 982 # . . discard args 983 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 984 # . write(_test-input-stream, "== data 0x1000\n") 985 # . . push args 986 68/push "== data 0x1000\n"/imm32 - 987 68/push _test-input-stream/imm32 + 987 68/push _test-input-stream/imm32 988 # . . call - 989 e8/call write/disp32 + 989 e8/call write/disp32 990 # . . discard args 991 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 992 # . write(_test-input-stream, "00\n") 993 # . . push args 994 68/push "00\n"/imm32 - 995 68/push _test-input-stream/imm32 + 995 68/push _test-input-stream/imm32 996 # . . call - 997 e8/call write/disp32 + 997 e8/call write/disp32 998 # . . discard args 999 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1000 # . write(_test-input-stream, "x:\n") 1001 # . . push args 1002 68/push "x:\n"/imm32 -1003 68/push _test-input-stream/imm32 +1003 68/push _test-input-stream/imm32 1004 # . . call -1005 e8/call write/disp32 +1005 e8/call write/disp32 1006 # . . discard args 1007 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1008 # . write(_test-input-stream, "34\n") 1009 # . . push args 1010 68/push "34\n"/imm32 -1011 68/push _test-input-stream/imm32 +1011 68/push _test-input-stream/imm32 1012 # . . call -1013 e8/call write/disp32 +1013 e8/call write/disp32 1014 # . . discard args 1015 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1016 # compute-offsets(_test-input-stream, segments, labels) 1017 # . . push args 1018 52/push-edx 1019 51/push-ecx -1020 68/push _test-input-stream/imm32 +1020 68/push _test-input-stream/imm32 1021 # . . call 1022 e8/call compute-offsets/disp32 1023 # . . discard args @@ -995,15 +995,15 @@ if ('onhashchange' in window) { 1054 68/push "F - test-compute-offsets/0"/imm32 1055 68/push "segment 'code' is at file offset 0x00000000."/imm32 1056 # . . call -1057 e8/call check-trace-contains/disp32 +1057 e8/call check-trace-contains/disp32 1058 # . . discard args 1059 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1060 # . check-trace-contains("segment 'code' has size 0x00000005", msg) 1061 # . . push args 1062 68/push "F - test-compute-offsets/1"/imm32 -1063 68/push "segment 'code' has size 0x00000005."/imm32 +1063 68/push "segment 'code' has size 0x00000005."/imm32 1064 # . . call -1065 e8/call check-trace-contains/disp32 +1065 e8/call check-trace-contains/disp32 1066 # . . discard args 1067 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1068 # . check-trace-contains("segment 'data' is at file offset 0x00000005.", msg) @@ -1011,15 +1011,15 @@ if ('onhashchange' in window) { 1070 68/push "F - test-compute-offsets/2"/imm32 1071 68/push "segment 'data' is at file offset 0x00000005."/imm32 1072 # . . call -1073 e8/call check-trace-contains/disp32 +1073 e8/call check-trace-contains/disp32 1074 # . . discard args 1075 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1076 # . check-trace-contains("segment 'data' has size 0x00000002.", msg) 1077 # . . push args 1078 68/push "F - test-compute-offsets/3"/imm32 -1079 68/push "segment 'data' has size 0x00000002."/imm32 +1079 68/push "segment 'data' has size 0x00000002."/imm32 1080 # . . call -1081 e8/call check-trace-contains/disp32 +1081 e8/call check-trace-contains/disp32 1082 # . . discard args 1083 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1084 # . check-trace-contains("label 'x' is in segment 'data'.", msg) @@ -1027,7 +1027,7 @@ if ('onhashchange' in window) { 1086 68/push "F - test-compute-offsets/4"/imm32 1087 68/push "label 'x' is in segment 'data'."/imm32 1088 # . . call -1089 e8/call check-trace-contains/disp32 +1089 e8/call check-trace-contains/disp32 1090 # . . discard args 1091 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1092 # . check-trace-contains("label 'x' is at segment offset 0x00000001.", msg) @@ -1035,7 +1035,7 @@ if ('onhashchange' in window) { 1094 68/push "F - test-compute-offsets/5"/imm32 1095 68/push "label 'x' is at segment offset 0x00000001."/imm32 1096 # . . call -1097 e8/call check-trace-contains/disp32 +1097 e8/call check-trace-contains/disp32 1098 # . . discard args 1099 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1100 # . check-ints-equal(labels->write, 0x18, msg) @@ -1044,7 +1044,7 @@ if ('onhashchange' in window) { 1103 68/push 0x18/imm32/1-entry 1104 ff 6/subop/push 0/mod/indirect 2/rm32/edx . . . . . . # push *edx 1105 # . . call -1106 e8/call check-ints-equal/disp32 +1106 e8/call check-ints-equal/disp32 1107 # . . discard args 1108 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1109 # . epilogue @@ -1134,7 +1134,7 @@ if ('onhashchange' in window) { 1193 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 . # push *(esi+4) 1194 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . . # push *esi 1195 # . . call -1196 e8/call lookup/disp32 +1196 e8/call lookup/disp32 1197 # . . discard args 1198 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1199 # . trace-sssns("segment " eax " starts at address " srow->address ".") @@ -1171,7 +1171,7 @@ if ('onhashchange' in window) { 1280 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 0xc/disp8 . # push *(esi+12) 1281 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 8/disp8 . # push *(esi+8) 1282 # . . call -1283 e8/call lookup/disp32 +1283 e8/call lookup/disp32 1284 # . . discard args 1285 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1286 # . edx = eax @@ -1185,7 +1185,7 @@ if ('onhashchange' in window) { 1319 52/push-edx 1320 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 1321 # . . call -1322 e8/call get/disp32 +1322 e8/call get/disp32 1323 # . . discard args 1324 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32 # add to esp 1325 # . edx = eax @@ -1202,7 +1202,7 @@ if ('onhashchange' in window) { 1336 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 . # push *(esi+4) 1337 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . . # push *esi 1338 # . . call -1339 e8/call lookup/disp32 +1339 e8/call lookup/disp32 1340 # . . discard args 1341 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1342 # . trace-sssns("label " eax " is at address " lrow->address ".") @@ -1273,9 +1273,9 @@ if ('onhashchange' in window) { 1407 # . . push args 1408 53/push-ebx 1409 68/push "a"/imm32 -1410 68/push Heap/imm32 +1410 68/push Heap/imm32 1411 # . . call -1412 e8/call copy-array/disp32 +1412 e8/call copy-array/disp32 1413 # . . discard args 1414 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1415 # . stream-add5(segments, "a", 0x1000, 0, 5) @@ -1294,9 +1294,9 @@ if ('onhashchange' in window) { 1428 # . . push args 1429 53/push-ebx 1430 68/push "b"/imm32 -1431 68/push Heap/imm32 +1431 68/push Heap/imm32 1432 # . . call -1433 e8/call copy-array/disp32 +1433 e8/call copy-array/disp32 1434 # . . discard args 1435 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1436 # . stream-add5(segments, "b", 0x2018, 5, 1) @@ -1315,9 +1315,9 @@ if ('onhashchange' in window) { 1449 # . . push args 1450 53/push-ebx 1451 68/push "c"/imm32 -1452 68/push Heap/imm32 +1452 68/push Heap/imm32 1453 # . . call -1454 e8/call copy-array/disp32 +1454 e8/call copy-array/disp32 1455 # . . discard args 1456 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1457 # . stream-add5(segments, "c", 0x5444, 6, 12) @@ -1338,16 +1338,16 @@ if ('onhashchange' in window) { 1472 # . . push "a" 1473 53/push-ebx 1474 68/push "a"/imm32 -1475 68/push Heap/imm32 -1476 e8/call copy-array/disp32 +1475 68/push Heap/imm32 +1476 e8/call copy-array/disp32 1477 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1478 ff 6/subop/push 1/mod/*+disp8 3/rm32/ebx . . . . 4/disp8 . # push *(ebx+4) 1479 ff 6/subop/push 0/mod/indirect 3/rm32/ebx . . . . . . # push *ebx 1480 # . . push "l1" 1481 53/push-ebx 1482 68/push "l1"/imm32 -1483 68/push Heap/imm32 -1484 e8/call copy-array/disp32 +1483 68/push Heap/imm32 +1484 e8/call copy-array/disp32 1485 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1486 ff 6/subop/push 1/mod/*+disp8 3/rm32/ebx . . . . 4/disp8 . # push *(ebx+4) 1487 ff 6/subop/push 0/mod/indirect 3/rm32/ebx . . . . . . # push *ebx @@ -1364,16 +1364,16 @@ if ('onhashchange' in window) { 1498 # . . push "b" 1499 53/push-ebx 1500 68/push "b"/imm32 -1501 68/push Heap/imm32 -1502 e8/call copy-array/disp32 +1501 68/push Heap/imm32 +1502 e8/call copy-array/disp32 1503 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1504 ff 6/subop/push 1/mod/*+disp8 3/rm32/ebx . . . . 4/disp8 . # push *(ebx+4) 1505 ff 6/subop/push 0/mod/indirect 3/rm32/ebx . . . . . . # push *ebx 1506 # . . push "l2" 1507 53/push-ebx 1508 68/push "l2"/imm32 -1509 68/push Heap/imm32 -1510 e8/call copy-array/disp32 +1509 68/push Heap/imm32 +1510 e8/call copy-array/disp32 1511 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1512 ff 6/subop/push 1/mod/*+disp8 3/rm32/ebx . . . . 4/disp8 . # push *(ebx+4) 1513 ff 6/subop/push 0/mod/indirect 3/rm32/ebx . . . . . . # push *ebx @@ -1399,7 +1399,7 @@ if ('onhashchange' in window) { 1558 68/push "F - test-compute-addresses/0"/imm32 1559 68/push "segment 'a' starts at address 0x00001094."/imm32 1560 # . . call -1561 e8/call check-trace-contains/disp32 +1561 e8/call check-trace-contains/disp32 1562 # . . discard args 1563 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1564 # . check-trace-contains("segment 'b' starts at address 0x00002099.", msg) @@ -1407,7 +1407,7 @@ if ('onhashchange' in window) { 1566 68/push "F - test-compute-addresses/1"/imm32 1567 68/push "segment 'b' starts at address 0x00002099."/imm32 1568 # . . call -1569 e8/call check-trace-contains/disp32 +1569 e8/call check-trace-contains/disp32 1570 # . . discard args 1571 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1572 # . check-trace-contains("segment 'c' starts at address 0x0000509a.", msg) @@ -1415,7 +1415,7 @@ if ('onhashchange' in window) { 1574 68/push "F - test-compute-addresses/2"/imm32 1575 68/push "segment 'c' starts at address 0x0000509a."/imm32 1576 # . . call -1577 e8/call check-trace-contains/disp32 +1577 e8/call check-trace-contains/disp32 1578 # . . discard args 1579 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1580 # . check-trace-contains("label 'l1' is at address 0x00001097.", msg) @@ -1423,7 +1423,7 @@ if ('onhashchange' in window) { 1582 68/push "F - test-compute-addresses/3"/imm32 1583 68/push "label 'l1' is at address 0x00001097."/imm32 1584 # . . call -1585 e8/call check-trace-contains/disp32 +1585 e8/call check-trace-contains/disp32 1586 # . . discard args 1587 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1588 # . check-trace-contains("label 'l2' is at address 0x00002099.", msg) @@ -1431,7 +1431,7 @@ if ('onhashchange' in window) { 1590 68/push "F - test-compute-addresses/4"/imm32 1591 68/push "label 'l2' is at address 0x00002099."/imm32 1592 # . . call -1593 e8/call check-trace-contains/disp32 +1593 e8/call check-trace-contains/disp32 1594 # . . discard args 1595 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1596 # . check-ints-equal(labels->write, 0x30, msg) @@ -1440,7 +1440,7 @@ if ('onhashchange' in window) { 1599 68/push 0x30/imm32/2-entries 1600 ff 6/subop/push 0/mod/indirect 2/rm32/edx . . . . . . # push *edx 1601 # . . call -1602 e8/call check-ints-equal/disp32 +1602 e8/call check-ints-equal/disp32 1603 # . . discard args 1604 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1605 # . epilogue @@ -1485,9 +1485,9 @@ if ('onhashchange' in window) { 1644 # . . push args 1645 53/push-ebx 1646 68/push "a"/imm32 -1647 68/push Heap/imm32 +1647 68/push Heap/imm32 1648 # . . call -1649 e8/call copy-array/disp32 +1649 e8/call copy-array/disp32 1650 # . . discard args 1651 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1652 # . stream-add5(segments, "a", 0x1000, 0, 0x5604) @@ -1505,9 +1505,9 @@ if ('onhashchange' in window) { 1664 # . . push args 1665 53/push-ebx 1666 68/push "b"/imm32 -1667 68/push Heap/imm32 +1667 68/push Heap/imm32 1668 # . . call -1669 e8/call copy-array/disp32 +1669 e8/call copy-array/disp32 1670 # . . discard args 1671 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1672 # . stream-add5(segments, "b", 0x2018, 0x5604, 1) @@ -1527,16 +1527,16 @@ if ('onhashchange' in window) { 1686 # . . push "a" 1687 53/push-ebx 1688 68/push "a"/imm32 -1689 68/push Heap/imm32 -1690 e8/call copy-array/disp32 +1689 68/push Heap/imm32 +1690 e8/call copy-array/disp32 1691 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1692 ff 6/subop/push 1/mod/*+disp8 3/rm32/ebx . . . . 4/disp8 . # push *(ebx+4) 1693 ff 6/subop/push 0/mod/indirect 3/rm32/ebx . . . . . . # push *ebx 1694 # . . push "l1" 1695 53/push-ebx 1696 68/push "l1"/imm32 -1697 68/push Heap/imm32 -1698 e8/call copy-array/disp32 +1697 68/push Heap/imm32 +1698 e8/call copy-array/disp32 1699 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 1700 ff 6/subop/push 1/mod/*+disp8 3/rm32/ebx . . . . 4/disp8 . # push *(ebx+4) 1701 ff 6/subop/push 0/mod/indirect 3/rm32/ebx . . . . . . # push *ebx @@ -1562,7 +1562,7 @@ if ('onhashchange' in window) { 1746 68/push "F - test-compute-addresses-large-segments/0"/imm32 1747 68/push "segment 'a' starts at address 0x00001074."/imm32 1748 # . . call -1749 e8/call check-trace-contains/disp32 +1749 e8/call check-trace-contains/disp32 1750 # . . discard args 1751 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1752 # . check-trace-contains("segment 'b' starts at address 0x00002678.", msg) @@ -1570,7 +1570,7 @@ if ('onhashchange' in window) { 1754 68/push "F - test-compute-addresses-large-segments/1"/imm32 1755 68/push "segment 'b' starts at address 0x00002678."/imm32 1756 # . . call -1757 e8/call check-trace-contains/disp32 +1757 e8/call check-trace-contains/disp32 1758 # . . discard args 1759 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1760 # . check-trace-contains("label 'l1' is at address 0x00001077.", msg) @@ -1578,7 +1578,7 @@ if ('onhashchange' in window) { 1762 68/push "F - test-compute-addresses-large-segments/3"/imm32 1763 68/push "label 'l1' is at address 0x00001077."/imm32 1764 # . . call -1765 e8/call check-trace-contains/disp32 +1765 e8/call check-trace-contains/disp32 1766 # . . discard args 1767 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1768 # . epilogue @@ -1707,7 +1707,7 @@ if ('onhashchange' in window) { 1907 # . . push args 1908 51/push-ecx 1909 # . . call -1910 e8/call clear-stream/disp32 +1910 e8/call clear-stream/disp32 1911 # . . discard args 1912 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 1913 # read-line(in, line) @@ -1715,7 +1715,7 @@ if ('onhashchange' in window) { 1915 51/push-ecx 1916 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 1917 # . . call -1918 e8/call read-line/disp32 +1918 e8/call read-line/disp32 1919 # . . discard args 1920 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1921 +-- 33 lines: #? # dump line -------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -1739,7 +1739,7 @@ if ('onhashchange' in window) { 1971 52/push-edx 1972 51/push-ecx 1973 # . . call -1974 e8/call next-word/disp32 +1974 e8/call next-word/disp32 1975 # . . discard args 1976 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1977 +-- 33 lines: #? # dump word-slice -------------------------------------------------------------------------------------------------------------------------------------------------- @@ -1749,7 +1749,7 @@ if ('onhashchange' in window) { 2013 # . . push args 2014 52/push-edx 2015 # . . call -2016 e8/call slice-empty?/disp32 +2016 e8/call slice-empty?/disp32 2017 # . . discard args 2018 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 2019 # . if (eax != 0) break @@ -1771,7 +1771,7 @@ if ('onhashchange' in window) { 2035 # . . push args 2036 52/push-edx 2037 # . . call -2038 e8/call is-label?/disp32 +2038 e8/call is-label?/disp32 2039 # . . discard args 2040 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 2041 # . if (eax != false) break @@ -1784,7 +1784,7 @@ if ('onhashchange' in window) { 2048 68/push "=="/imm32 2049 52/push-edx 2050 # . . call -2051 e8/call slice-equal?/disp32 +2051 e8/call slice-equal?/disp32 2052 # . . discard args 2053 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2054 # . if (eax != false) break @@ -1803,15 +1803,15 @@ if ('onhashchange' in window) { 2067 52/push-edx 2068 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 2069 # . . call -2070 e8/call write-slice-buffered/disp32 +2070 e8/call write-slice-buffered/disp32 2071 # . . discard args 2072 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2073 # write-buffered(out, " ") 2074 # . . push args -2075 68/push Space/imm32 +2075 68/push Space/imm32 2076 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 2077 # . . call -2078 e8/call write-buffered/disp32 +2078 e8/call write-buffered/disp32 2079 # . . discard args 2080 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2081 # continue @@ -1825,7 +1825,7 @@ if ('onhashchange' in window) { 2089 ff 6/subop/push 1/mod/*+disp8 2/rm32/edx . . . . 4/disp8 . # push *(edx+4) 2090 ff 6/subop/push 0/mod/indirect 2/rm32/edx . . . . . . # push *edx 2091 # . . call -2092 e8/call next-token-from-slice/disp32 +2092 e8/call next-token-from-slice/disp32 2093 # . . discard args 2094 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32 # add to esp 2095 +-- 33 lines: #? # dump datum ------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -1837,7 +1837,7 @@ if ('onhashchange' in window) { 2133 57/push-edi 2134 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x10/disp8 . # push *(ebp+16) 2135 # . . call -2136 e8/call get-slice/disp32 +2136 e8/call get-slice/disp32 2137 # . . discard args 2138 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32 # add to esp 2139 # . esi = eax @@ -1849,7 +1849,7 @@ if ('onhashchange' in window) { 2145 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 . # push *(esi+4) 2146 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . . # push *esi 2147 # . . call -2148 e8/call lookup/disp32 +2148 e8/call lookup/disp32 2149 # . . discard args 2150 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2151 # . eax = string-equal?(eax, "code") @@ -1857,7 +1857,7 @@ if ('onhashchange' in window) { 2153 68/push "code"/imm32 2154 50/push-eax 2155 # . . call -2156 e8/call string-equal?/disp32 +2156 e8/call string-equal?/disp32 2157 # . . discard args 2158 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2159 # . if (eax != false) goto code label checks @@ -1870,7 +1870,7 @@ if ('onhashchange' in window) { 2166 68/push "disp8"/imm32 2167 52/push-edx 2168 # . . call -2169 e8/call has-metadata?/disp32 +2169 e8/call has-metadata?/disp32 2170 # . . discard args 2171 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2172 # . if (eax != false) abort @@ -1883,7 +1883,7 @@ if ('onhashchange' in window) { 2179 68/push "imm8"/imm32 2180 52/push-edx 2181 # . . call -2182 e8/call has-metadata?/disp32 +2182 e8/call has-metadata?/disp32 2183 # . . discard args 2184 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2185 # . if (eax != false) abort @@ -1896,7 +1896,7 @@ if ('onhashchange' in window) { 2192 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 0xc/disp8 . # push *(esi+12) 2193 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 2194 # . . call -2195 e8/call emit-hex/disp32 +2195 e8/call emit-hex/disp32 2196 # . . discard args 2197 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2198 # continue @@ -1908,7 +1908,7 @@ if ('onhashchange' in window) { 2204 68/push "imm8"/imm32 2205 52/push-edx 2206 # . . call -2207 e8/call has-metadata?/disp32 +2207 e8/call has-metadata?/disp32 2208 # . . discard args 2209 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2210 # . if (eax != false) abort @@ -1921,7 +1921,7 @@ if ('onhashchange' in window) { 2217 68/push "imm32"/imm32 2218 52/push-edx 2219 # . . call -2220 e8/call has-metadata?/disp32 +2220 e8/call has-metadata?/disp32 2221 # . . discard args 2222 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2223 # . if (eax == false) goto next check @@ -1935,7 +1935,7 @@ if ('onhashchange' in window) { 2263 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 0xc/disp8 . # push *(esi+12) 2264 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 2265 # . . call -2266 e8/call emit-hex/disp32 +2266 e8/call emit-hex/disp32 2267 # . . discard args 2268 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2269 # continue @@ -1947,7 +1947,7 @@ if ('onhashchange' in window) { 2275 68/push "disp8"/imm32 2276 52/push-edx 2277 # . . call -2278 e8/call has-metadata?/disp32 +2278 e8/call has-metadata?/disp32 2279 # . . discard args 2280 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2281 # . if (eax == false) goto next check @@ -1962,7 +1962,7 @@ if ('onhashchange' in window) { 2290 50/push-eax 2291 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 2292 # . . call -2293 e8/call emit-hex/disp32 +2293 e8/call emit-hex/disp32 2294 # . . discard args 2295 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2296 # continue @@ -1974,7 +1974,7 @@ if ('onhashchange' in window) { 2302 68/push "disp32"/imm32 2303 52/push-edx 2304 # . . call -2305 e8/call has-metadata?/disp32 +2305 e8/call has-metadata?/disp32 2306 # . . discard args 2307 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2308 # . if (eax == false) abort @@ -1989,7 +1989,7 @@ if ('onhashchange' in window) { 2317 50/push-eax 2318 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 2319 # . . call -2320 e8/call emit-hex/disp32 +2320 e8/call emit-hex/disp32 2321 # . . discard args 2322 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2323 # continue @@ -1997,10 +1997,10 @@ if ('onhashchange' in window) { 2325 $emit-segments:next-line: 2326 # write-buffered(out, "\n") 2327 # . . push args -2328 68/push Newline/imm32 +2328 68/push Newline/imm32 2329 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 2330 # . . call -2331 e8/call write-buffered/disp32 +2331 e8/call write-buffered/disp32 2332 # . . discard args 2333 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2334 # loop @@ -2026,7 +2026,7 @@ if ('onhashchange' in window) { 2354 68/push "emit-segments: must refer to global variables with /disp32 or /imm32"/imm32 2355 68/push 2/imm32/stderr 2356 # . . call -2357 e8/call _write/disp32 +2357 e8/call _write/disp32 2358 # . . discard args 2359 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2360 # . syscall(exit, 1) @@ -2040,7 +2040,7 @@ if ('onhashchange' in window) { 2368 68/push "emit-segments: cannot refer to code labels with /imm8"/imm32 2369 68/push 2/imm32/stderr 2370 # . . call -2371 e8/call _write/disp32 +2371 e8/call _write/disp32 2372 # . . discard args 2373 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2374 # . syscall(exit, 1) @@ -2055,22 +2055,22 @@ if ('onhashchange' in window) { 2383 68/push "emit-segments: missing metadata in "/imm32 2384 68/push 2/imm32/stderr 2385 # . . call -2386 e8/call _write/disp32 +2386 e8/call _write/disp32 2387 # . . discard args 2388 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2389 # . write-slice-buffered(Stderr, word-slice) 2390 # . . push args 2391 52/push-edx -2392 68/push Stderr/imm32 +2392 68/push Stderr/imm32 2393 # . . call -2394 e8/call write-slice-buffered/disp32 +2394 e8/call write-slice-buffered/disp32 2395 # . . discard args 2396 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2397 # . flush(Stderr) 2398 # . . push args -2399 68/push Stderr/imm32 +2399 68/push Stderr/imm32 2400 # . . call -2401 e8/call flush/disp32 +2401 e8/call flush/disp32 2402 # . . discard args 2403 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 2404 # . syscall(exit, 1) @@ -2105,23 +2105,23 @@ if ('onhashchange' in window) { 2433 # setup 2434 # . clear-stream(_test-input-stream) 2435 # . . push args -2436 68/push _test-input-stream/imm32 +2436 68/push _test-input-stream/imm32 2437 # . . call -2438 e8/call clear-stream/disp32 +2438 e8/call clear-stream/disp32 2439 # . . discard args 2440 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 2441 # . clear-stream(_test-output-stream) 2442 # . . push args -2443 68/push _test-output-stream/imm32 +2443 68/push _test-output-stream/imm32 2444 # . . call -2445 e8/call clear-stream/disp32 +2445 e8/call clear-stream/disp32 2446 # . . discard args 2447 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 2448 # . clear-stream($_test-output-buffered-file->buffer) 2449 # . . push args 2450 68/push $_test-output-buffered-file->buffer/imm32 2451 # . . call -2452 e8/call clear-stream/disp32 +2452 e8/call clear-stream/disp32 2453 # . . discard args 2454 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 2455 # . var labels/edx: (stream byte 8*24) @@ -2138,57 +2138,57 @@ if ('onhashchange' in window) { 2466 # . write(_test-input-stream, "== code 0x1000\n") 2467 # . . push args 2468 68/push "== code 0x1000\n"/imm32 -2469 68/push _test-input-stream/imm32 +2469 68/push _test-input-stream/imm32 2470 # . . call -2471 e8/call write/disp32 +2471 e8/call write/disp32 2472 # . . discard args 2473 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2474 # . write(_test-input-stream, "ab cd ef gh\n") 2475 # . . push args 2476 68/push "ab cd ef gh\n"/imm32 -2477 68/push _test-input-stream/imm32 +2477 68/push _test-input-stream/imm32 2478 # . . call -2479 e8/call write/disp32 +2479 e8/call write/disp32 2480 # . . discard args 2481 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2482 # . write(_test-input-stream, "ij x/disp32\n") 2483 # . . push args 2484 68/push "ij x/disp32\n"/imm32 -2485 68/push _test-input-stream/imm32 +2485 68/push _test-input-stream/imm32 2486 # . . call -2487 e8/call write/disp32 +2487 e8/call write/disp32 2488 # . . discard args 2489 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2490 # . write(_test-input-stream, "== data 0x2000\n") 2491 # . . push args 2492 68/push "== data 0x2000\n"/imm32 -2493 68/push _test-input-stream/imm32 +2493 68/push _test-input-stream/imm32 2494 # . . call -2495 e8/call write/disp32 +2495 e8/call write/disp32 2496 # . . discard args 2497 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2498 # . write(_test-input-stream, "00\n") 2499 # . . push args 2500 68/push "00\n"/imm32 -2501 68/push _test-input-stream/imm32 +2501 68/push _test-input-stream/imm32 2502 # . . call -2503 e8/call write/disp32 +2503 e8/call write/disp32 2504 # . . discard args 2505 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2506 # . write(_test-input-stream, "x:\n") 2507 # . . push args 2508 68/push "x:\n"/imm32 -2509 68/push _test-input-stream/imm32 +2509 68/push _test-input-stream/imm32 2510 # . . call -2511 e8/call write/disp32 +2511 e8/call write/disp32 2512 # . . discard args 2513 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2514 # . write(_test-input-stream, "34\n") 2515 # . . push args 2516 68/push "34\n"/imm32 -2517 68/push _test-input-stream/imm32 +2517 68/push _test-input-stream/imm32 2518 # . . call -2519 e8/call write/disp32 +2519 e8/call write/disp32 2520 # . . discard args 2521 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2522 # . stream-add6(labels, "x", "data", 1, 0x207a) @@ -2197,16 +2197,16 @@ if ('onhashchange' in window) { 2525 # . . push "data" 2526 53/push-ebx 2527 68/push "data"/imm32 -2528 68/push Heap/imm32 -2529 e8/call copy-array/disp32 +2528 68/push Heap/imm32 +2529 e8/call copy-array/disp32 2530 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2531 ff 6/subop/push 1/mod/*+disp8 3/rm32/ebx . . . . 4/disp8 . # push *(ebx+4) 2532 ff 6/subop/push 0/mod/indirect 3/rm32/ebx . . . . . . # push *ebx 2533 # . . push "l1" 2534 53/push-ebx 2535 68/push "x"/imm32 -2536 68/push Heap/imm32 -2537 e8/call copy-array/disp32 +2536 68/push Heap/imm32 +2537 e8/call copy-array/disp32 2538 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2539 ff 6/subop/push 1/mod/*+disp8 3/rm32/ebx . . . . 4/disp8 . # push *(ebx+4) 2540 ff 6/subop/push 0/mod/indirect 3/rm32/ebx . . . . . . # push *ebx @@ -2220,8 +2220,8 @@ if ('onhashchange' in window) { 2548 # . emit-segments(_test-input-stream, _test-output-buffered-file, labels) 2549 # . . push args 2550 52/push-edx -2551 68/push _test-output-buffered-file/imm32 -2552 68/push _test-input-stream/imm32 +2551 68/push _test-output-buffered-file/imm32 +2552 68/push _test-input-stream/imm32 2553 # . . call 2554 e8/call emit-segments/disp32 2555 # . . discard args @@ -2229,9 +2229,9 @@ if ('onhashchange' in window) { 2557 # checks 2558 # . flush(_test-output-buffered-file) 2559 # . . push args -2560 68/push _test-output-buffered-file/imm32 +2560 68/push _test-output-buffered-file/imm32 2561 # . . call -2562 e8/call flush/disp32 +2562 e8/call flush/disp32 2563 # . . discard args 2564 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 2565 +-- 33 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -2239,36 +2239,36 @@ if ('onhashchange' in window) { 2599 # . . push args 2600 68/push "F - test-emit-segments-global-variable/0"/imm32 2601 68/push "ab cd ef gh "/imm32 -2602 68/push _test-output-stream/imm32 +2602 68/push _test-output-stream/imm32 2603 # . . call -2604 e8/call check-next-stream-line-equal/disp32 +2604 e8/call check-next-stream-line-equal/disp32 2605 # . . discard args 2606 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2607 # . check-next-stream-line-equal(_test-output-stream, "ij 7a 20 00 00 ", msg) 2608 # . . push args 2609 68/push "F - test-emit-segments-global-variable/1"/imm32 2610 68/push "ij 7a 20 00 00 "/imm32 -2611 68/push _test-output-stream/imm32 +2611 68/push _test-output-stream/imm32 2612 # . . call -2613 e8/call check-next-stream-line-equal/disp32 +2613 e8/call check-next-stream-line-equal/disp32 2614 # . . discard args 2615 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2616 # . check-next-stream-line-equal(_test-output-stream, "00 ", msg) 2617 # . . push args 2618 68/push "F - test-emit-segments-global-variable/2"/imm32 2619 68/push "00 "/imm32 -2620 68/push _test-output-stream/imm32 +2620 68/push _test-output-stream/imm32 2621 # . . call -2622 e8/call check-next-stream-line-equal/disp32 +2622 e8/call check-next-stream-line-equal/disp32 2623 # . . discard args 2624 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2625 # . check-next-stream-line-equal(_test-output-stream, "34 ", msg) 2626 # . . push args 2627 68/push "F - test-emit-segments-global-variable/3"/imm32 2628 68/push "34 "/imm32 -2629 68/push _test-output-stream/imm32 +2629 68/push _test-output-stream/imm32 2630 # . . call -2631 e8/call check-next-stream-line-equal/disp32 +2631 e8/call check-next-stream-line-equal/disp32 2632 # . . discard args 2633 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2634 # . epilogue @@ -2300,23 +2300,23 @@ if ('onhashchange' in window) { 2660 # setup 2661 # . clear-stream(_test-input-stream) 2662 # . . push args -2663 68/push _test-input-stream/imm32 +2663 68/push _test-input-stream/imm32 2664 # . . call -2665 e8/call clear-stream/disp32 +2665 e8/call clear-stream/disp32 2666 # . . discard args 2667 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 2668 # . clear-stream(_test-output-stream) 2669 # . . push args -2670 68/push _test-output-stream/imm32 +2670 68/push _test-output-stream/imm32 2671 # . . call -2672 e8/call clear-stream/disp32 +2672 e8/call clear-stream/disp32 2673 # . . discard args 2674 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 2675 # . clear-stream($_test-output-buffered-file->buffer) 2676 # . . push args 2677 68/push $_test-output-buffered-file->buffer/imm32 2678 # . . call -2679 e8/call clear-stream/disp32 +2679 e8/call clear-stream/disp32 2680 # . . discard args 2681 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 2682 # . var labels/edx: (stream byte 8*24) @@ -2333,41 +2333,41 @@ if ('onhashchange' in window) { 2693 # . write(_test-input-stream, "== code 0x1000\n") 2694 # . . push args 2695 68/push "== code 0x1000\n"/imm32 -2696 68/push _test-input-stream/imm32 +2696 68/push _test-input-stream/imm32 2697 # . . call -2698 e8/call write/disp32 +2698 e8/call write/disp32 2699 # . . discard args 2700 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2701 # . write(_test-input-stream, "ab cd\n") 2702 # . . push args 2703 68/push "ab cd\n"/imm32 -2704 68/push _test-input-stream/imm32 +2704 68/push _test-input-stream/imm32 2705 # . . call -2706 e8/call write/disp32 +2706 e8/call write/disp32 2707 # . . discard args 2708 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2709 # . write(_test-input-stream, "l1:\n") 2710 # . . push args 2711 68/push "l1:\n"/imm32 -2712 68/push _test-input-stream/imm32 +2712 68/push _test-input-stream/imm32 2713 # . . call -2714 e8/call write/disp32 +2714 e8/call write/disp32 2715 # . . discard args 2716 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2717 # . write(_test-input-stream, " ef gh\n") 2718 # . . push args 2719 68/push " ef gh\n"/imm32 -2720 68/push _test-input-stream/imm32 +2720 68/push _test-input-stream/imm32 2721 # . . call -2722 e8/call write/disp32 +2722 e8/call write/disp32 2723 # . . discard args 2724 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2725 # . write(_test-input-stream, " ij l1/disp32\n") 2726 # . . push args 2727 68/push " ij l1/disp32\n"/imm32 -2728 68/push _test-input-stream/imm32 +2728 68/push _test-input-stream/imm32 2729 # . . call -2730 e8/call write/disp32 +2730 e8/call write/disp32 2731 # . . discard args 2732 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2733 # . stream-add6(labels, "l1", "code", 2, 0x1056) @@ -2376,16 +2376,16 @@ if ('onhashchange' in window) { 2736 # . . push "data" 2737 53/push-ebx 2738 68/push "code"/imm32 -2739 68/push Heap/imm32 -2740 e8/call copy-array/disp32 +2739 68/push Heap/imm32 +2740 e8/call copy-array/disp32 2741 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2742 ff 6/subop/push 1/mod/*+disp8 3/rm32/ebx . . . . 4/disp8 . # push *(ebx+4) 2743 ff 6/subop/push 0/mod/indirect 3/rm32/ebx . . . . . . # push *ebx 2744 # . . push "l1" 2745 53/push-ebx 2746 68/push "l1"/imm32 -2747 68/push Heap/imm32 -2748 e8/call copy-array/disp32 +2747 68/push Heap/imm32 +2748 e8/call copy-array/disp32 2749 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2750 ff 6/subop/push 1/mod/*+disp8 3/rm32/ebx . . . . 4/disp8 . # push *(ebx+4) 2751 ff 6/subop/push 0/mod/indirect 3/rm32/ebx . . . . . . # push *ebx @@ -2399,8 +2399,8 @@ if ('onhashchange' in window) { 2759 # . emit-segments(_test-input-stream, _test-output-buffered-file, labels) 2760 # . . push args 2761 52/push-edx -2762 68/push _test-output-buffered-file/imm32 -2763 68/push _test-input-stream/imm32 +2762 68/push _test-output-buffered-file/imm32 +2763 68/push _test-input-stream/imm32 2764 # . . call 2765 e8/call emit-segments/disp32 2766 # . . discard args @@ -2408,9 +2408,9 @@ if ('onhashchange' in window) { 2768 # checks 2769 # . flush(_test-output-buffered-file) 2770 # . . push args -2771 68/push _test-output-buffered-file/imm32 +2771 68/push _test-output-buffered-file/imm32 2772 # . . call -2773 e8/call flush/disp32 +2773 e8/call flush/disp32 2774 # . . discard args 2775 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 2776 +-- 33 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -2418,27 +2418,27 @@ if ('onhashchange' in window) { 2810 # . . push args 2811 68/push "F - test-emit-segments-code-label/0"/imm32 2812 68/push "ab cd "/imm32 -2813 68/push _test-output-stream/imm32 +2813 68/push _test-output-stream/imm32 2814 # . . call -2815 e8/call check-next-stream-line-equal/disp32 +2815 e8/call check-next-stream-line-equal/disp32 2816 # . . discard args 2817 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2818 # . check-next-stream-line-equal(_test-output-stream, "ef gh ", msg) 2819 # . . push args 2820 68/push "F - test-emit-segments-code-label/1"/imm32 2821 68/push "ef gh "/imm32 -2822 68/push _test-output-stream/imm32 +2822 68/push _test-output-stream/imm32 2823 # . . call -2824 e8/call check-next-stream-line-equal/disp32 +2824 e8/call check-next-stream-line-equal/disp32 2825 # . . discard args 2826 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2827 # . check-next-stream-line-equal(_test-output-stream, "ij f9 ff ff ff ", msg) 2828 # . . push args 2829 68/push "F - test-emit-segments-code-label/2"/imm32 2830 68/push "ij f9 ff ff ff "/imm32 -2831 68/push _test-output-stream/imm32 +2831 68/push _test-output-stream/imm32 2832 # . . call -2833 e8/call check-next-stream-line-equal/disp32 +2833 e8/call check-next-stream-line-equal/disp32 2834 # . . discard args 2835 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2836 # . epilogue @@ -2470,23 +2470,23 @@ if ('onhashchange' in window) { 2862 # setup 2863 # . clear-stream(_test-input-stream) 2864 # . . push args -2865 68/push _test-input-stream/imm32 +2865 68/push _test-input-stream/imm32 2866 # . . call -2867 e8/call clear-stream/disp32 +2867 e8/call clear-stream/disp32 2868 # . . discard args 2869 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 2870 # . clear-stream(_test-output-stream) 2871 # . . push args -2872 68/push _test-output-stream/imm32 +2872 68/push _test-output-stream/imm32 2873 # . . call -2874 e8/call clear-stream/disp32 +2874 e8/call clear-stream/disp32 2875 # . . discard args 2876 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 2877 # . clear-stream($_test-output-buffered-file->buffer) 2878 # . . push args 2879 68/push $_test-output-buffered-file->buffer/imm32 2880 # . . call -2881 e8/call clear-stream/disp32 +2881 e8/call clear-stream/disp32 2882 # . . discard args 2883 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 2884 # . var labels/edx: (stream byte 8*24) @@ -2503,41 +2503,41 @@ if ('onhashchange' in window) { 2895 # . write(_test-input-stream, "== code 0x1000\n") 2896 # . . push args 2897 68/push "== code 0x1000\n"/imm32 -2898 68/push _test-input-stream/imm32 +2898 68/push _test-input-stream/imm32 2899 # . . call -2900 e8/call write/disp32 +2900 e8/call write/disp32 2901 # . . discard args 2902 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2903 # . write(_test-input-stream, "ab cd\n") 2904 # . . push args 2905 68/push "ab cd\n"/imm32 -2906 68/push _test-input-stream/imm32 +2906 68/push _test-input-stream/imm32 2907 # . . call -2908 e8/call write/disp32 +2908 e8/call write/disp32 2909 # . . discard args 2910 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2911 # . write(_test-input-stream, "l1:\n") 2912 # . . push args 2913 68/push "l1:\n"/imm32 -2914 68/push _test-input-stream/imm32 +2914 68/push _test-input-stream/imm32 2915 # . . call -2916 e8/call write/disp32 +2916 e8/call write/disp32 2917 # . . discard args 2918 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2919 # . write(_test-input-stream, " ef gh\n") 2920 # . . push args 2921 68/push " ef gh\n"/imm32 -2922 68/push _test-input-stream/imm32 +2922 68/push _test-input-stream/imm32 2923 # . . call -2924 e8/call write/disp32 +2924 e8/call write/disp32 2925 # . . discard args 2926 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2927 # . write(_test-input-stream, " ij l1/imm32\n") 2928 # . . push args 2929 68/push " ij l1/imm32\n"/imm32 -2930 68/push _test-input-stream/imm32 +2930 68/push _test-input-stream/imm32 2931 # . . call -2932 e8/call write/disp32 +2932 e8/call write/disp32 2933 # . . discard args 2934 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2935 # . stream-add6(labels, "l1", "code", 2, 0x1056) @@ -2546,16 +2546,16 @@ if ('onhashchange' in window) { 2938 # . . push "data" 2939 53/push-ebx 2940 68/push "code"/imm32 -2941 68/push Heap/imm32 -2942 e8/call copy-array/disp32 +2941 68/push Heap/imm32 +2942 e8/call copy-array/disp32 2943 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2944 ff 6/subop/push 1/mod/*+disp8 3/rm32/ebx . . . . 4/disp8 . # push *(ebx+4) 2945 ff 6/subop/push 0/mod/indirect 3/rm32/ebx . . . . . . # push *ebx 2946 # . . push "l1" 2947 53/push-ebx 2948 68/push "l1"/imm32 -2949 68/push Heap/imm32 -2950 e8/call copy-array/disp32 +2949 68/push Heap/imm32 +2950 e8/call copy-array/disp32 2951 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 2952 ff 6/subop/push 1/mod/*+disp8 3/rm32/ebx . . . . 4/disp8 . # push *(ebx+4) 2953 ff 6/subop/push 0/mod/indirect 3/rm32/ebx . . . . . . # push *ebx @@ -2569,8 +2569,8 @@ if ('onhashchange' in window) { 2961 # . emit-segments(_test-input-stream, _test-output-buffered-file, labels) 2962 # . . push args 2963 52/push-edx -2964 68/push _test-output-buffered-file/imm32 -2965 68/push _test-input-stream/imm32 +2964 68/push _test-output-buffered-file/imm32 +2965 68/push _test-input-stream/imm32 2966 # . . call 2967 e8/call emit-segments/disp32 2968 # . . discard args @@ -2578,9 +2578,9 @@ if ('onhashchange' in window) { 2970 # checks 2971 # . flush(_test-output-buffered-file) 2972 # . . push args -2973 68/push _test-output-buffered-file/imm32 +2973 68/push _test-output-buffered-file/imm32 2974 # . . call -2975 e8/call flush/disp32 +2975 e8/call flush/disp32 2976 # . . discard args 2977 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 2978 +-- 33 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -2588,27 +2588,27 @@ if ('onhashchange' in window) { 3012 # . . push args 3013 68/push "F - test-emit-segments-code-label-absolute/0"/imm32 3014 68/push "ab cd "/imm32 -3015 68/push _test-output-stream/imm32 +3015 68/push _test-output-stream/imm32 3016 # . . call -3017 e8/call check-next-stream-line-equal/disp32 +3017 e8/call check-next-stream-line-equal/disp32 3018 # . . discard args 3019 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 3020 # . check-next-stream-line-equal(_test-output-stream, "ef gh ", msg) 3021 # . . push args 3022 68/push "F - test-emit-segments-code-label-absolute/1"/imm32 3023 68/push "ef gh "/imm32 -3024 68/push _test-output-stream/imm32 +3024 68/push _test-output-stream/imm32 3025 # . . call -3026 e8/call check-next-stream-line-equal/disp32 +3026 e8/call check-next-stream-line-equal/disp32 3027 # . . discard args 3028 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 3029 # . check-next-stream-line-equal(_test-output-stream, "ij f9 ff ff ff ", msg) 3030 # . . push args 3031 68/push "F - test-emit-segments-code-label-absolute/2"/imm32 3032 68/push "ij 56 10 00 00 "/imm32 -3033 68/push _test-output-stream/imm32 +3033 68/push _test-output-stream/imm32 3034 # . . call -3035 e8/call check-next-stream-line-equal/disp32 +3035 e8/call check-next-stream-line-equal/disp32 3036 # . . discard args 3037 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 3038 # . epilogue @@ -2699,7 +2699,7 @@ if ('onhashchange' in window) { 3193 68/push "Entry"/imm32 3194 50/push-eax 3195 # . . call -3196 e8/call get/disp32 +3196 e8/call get/disp32 3197 # . . discard args 3198 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32 # add to esp 3199 # . eax = label-info->address @@ -2722,15 +2722,15 @@ if ('onhashchange' in window) { 3216 68/push Elf_header/imm32 3217 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 3218 # . . call -3219 e8/call emit-hex-array/disp32 +3219 e8/call emit-hex-array/disp32 3220 # . . discard args 3221 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3222 # write-buffered(out, "\n") 3223 # . . push args -3224 68/push Newline/imm32 +3224 68/push Newline/imm32 3225 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 3226 # . . call -3227 e8/call write-buffered/disp32 +3227 e8/call write-buffered/disp32 3228 # . . discard args 3229 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3230 $emit-elf-header:end: @@ -2792,7 +2792,7 @@ if ('onhashchange' in window) { 3286 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 . # push *(esi+4) 3287 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . . # push *esi 3288 # . . call -3289 e8/call lookup/disp32 +3289 e8/call lookup/disp32 3290 # . . discard args 3291 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3292 # . eax = string-equal?(name, "code") @@ -2800,7 +2800,7 @@ if ('onhashchange' in window) { 3294 68/push "code"/imm32 3295 50/push-eax 3296 # . . call -3297 e8/call string-equal?/disp32 +3297 e8/call string-equal?/disp32 3298 # . . discard args 3299 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3300 # . if (eax == false) goto next check @@ -2818,15 +2818,15 @@ if ('onhashchange' in window) { 3312 68/push Elf_program_header_entry/imm32 3313 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 3314 # . . call -3315 e8/call emit-hex-array/disp32 +3315 e8/call emit-hex-array/disp32 3316 # . . discard args 3317 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3318 # write-buffered(out, "\n") 3319 # . . push args -3320 68/push Newline/imm32 +3320 68/push Newline/imm32 3321 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 3322 # . . call -3323 e8/call write-buffered/disp32 +3323 e8/call write-buffered/disp32 3324 # . . discard args 3325 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3326 $emit-elf-program-header-entry:end: @@ -2910,7 +2910,7 @@ if ('onhashchange' in window) { 3404 68/push "overflow in stream-add4\n"/imm32 3405 68/push 2/imm32/stderr 3406 # . . call -3407 e8/call _write/disp32 +3407 e8/call _write/disp32 3408 # . . discard args 3409 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3410 # . syscall(exit, 1) @@ -2996,7 +2996,7 @@ if ('onhashchange' in window) { 3490 68/push "overflow in stream-add5\n"/imm32 3491 68/push 2/imm32/stderr 3492 # . . call -3493 e8/call _write/disp32 +3493 e8/call _write/disp32 3494 # . . discard args 3495 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3496 # . syscall(exit, 1) @@ -3091,7 +3091,7 @@ if ('onhashchange' in window) { 3585 68/push "overflow in stream-add6\n"/imm32 3586 68/push 2/imm32/stderr 3587 # . . call -3588 e8/call _write/disp32 +3588 e8/call _write/disp32 3589 # . . discard args 3590 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3591 # . syscall(exit, 1) @@ -3113,40 +3113,40 @@ if ('onhashchange' in window) { 3607 # write(*Trace-stream, s1) 3608 # . . push args 3609 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) -3610 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream +3610 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream 3611 # . . call -3612 e8/call write/disp32 +3612 e8/call write/disp32 3613 # . . discard args 3614 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3615 # write(*Trace-stream, s2) 3616 # . . push args 3617 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) -3618 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream +3618 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream 3619 # . . call -3620 e8/call write/disp32 +3620 e8/call write/disp32 3621 # . . discard args 3622 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3623 # write(*Trace-stream, s3) 3624 # . . push args 3625 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x10/disp8 . # push *(ebp+16) -3626 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream +3626 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream 3627 # . . call -3628 e8/call write/disp32 +3628 e8/call write/disp32 3629 # . . discard args 3630 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3631 # write-int32-hex(*Trace-stream, n4) 3632 # . . push args 3633 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x14/disp8 . # push *(ebp+20) -3634 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream +3634 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream 3635 # . . call -3636 e8/call write-int32-hex/disp32 +3636 e8/call write-int32-hex/disp32 3637 # . . discard args 3638 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3639 # trace(s5) # implicitly adds a newline and finalizes the trace line 3640 # . . push args 3641 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x18/disp8 . # push *(ebp+24) 3642 # . . call -3643 e8/call trace/disp32 +3643 e8/call trace/disp32 3644 # . . discard args 3645 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3646 $trace-sssns:end: @@ -3161,7 +3161,7 @@ if ('onhashchange' in window) { 3655 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp 3656 # setup 3657 # . *Trace-stream->write = 0 -3658 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 0/r32/eax Trace-stream/disp32 # copy *Trace-stream to eax +3658 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 0/r32/eax Trace-stream/disp32 # copy *Trace-stream to eax 3659 c7 0/subop/copy 0/mod/direct 0/rm32/eax . . . . . 0/imm32 # clear *eax 3660 # trace-sssns("A" "b" "c " 3 " e") 3661 # . . push args @@ -3180,7 +3180,7 @@ if ('onhashchange' in window) { 3699 68/push "F - test-trace-sssns"/imm32 3700 68/push "Abc 0x00000003 e"/imm32 3701 # . . call -3702 e8/call check-trace-contains/disp32 +3702 e8/call check-trace-contains/disp32 3703 # . . discard args 3704 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3705 # . epilogue @@ -3195,40 +3195,40 @@ if ('onhashchange' in window) { 3714 # write(*Trace-stream, s1) 3715 # . . push args 3716 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) -3717 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream +3717 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream 3718 # . . call -3719 e8/call write/disp32 +3719 e8/call write/disp32 3720 # . . discard args 3721 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3722 # write-int32-hex(*Trace-stream, n2) 3723 # . . push args 3724 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) -3725 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream +3725 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream 3726 # . . call -3727 e8/call write-int32-hex/disp32 +3727 e8/call write-int32-hex/disp32 3728 # . . discard args 3729 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3730 # write(*Trace-stream, s3) 3731 # . . push args 3732 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x10/disp8 . # push *(ebp+16) -3733 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream +3733 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream 3734 # . . call -3735 e8/call write/disp32 +3735 e8/call write/disp32 3736 # . . discard args 3737 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3738 # write-int32-hex(*Trace-stream, n4) 3739 # . . push args 3740 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x14/disp8 . # push *(ebp+20) -3741 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream +3741 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream 3742 # . . call -3743 e8/call write-int32-hex/disp32 +3743 e8/call write-int32-hex/disp32 3744 # . . discard args 3745 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3746 # trace(s5) # implicitly adds a newline and finalizes the trace line 3747 # . . push args 3748 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x18/disp8 . # push *(ebp+24) 3749 # . . call -3750 e8/call trace/disp32 +3750 e8/call trace/disp32 3751 # . . discard args 3752 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3753 $trace-snsns:end: @@ -3243,7 +3243,7 @@ if ('onhashchange' in window) { 3762 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp 3763 # setup 3764 # . *Trace-stream->write = 0 -3765 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 0/r32/eax Trace-stream/disp32 # copy *Trace-stream to eax +3765 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 0/r32/eax Trace-stream/disp32 # copy *Trace-stream to eax 3766 c7 0/subop/copy 0/mod/direct 0/rm32/eax . . . . . 0/imm32 # clear *eax 3767 # trace-snsns("A " 2 " c " 3 " e") 3768 # . . push args @@ -3262,7 +3262,7 @@ if ('onhashchange' in window) { 3806 68/push "F - test-trace-snsns"/imm32 3807 68/push "A 0x00000002 c 0x00000003 e"/imm32 3808 # . . call -3809 e8/call check-trace-contains/disp32 +3809 e8/call check-trace-contains/disp32 3810 # . . discard args 3811 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3812 # . epilogue @@ -3277,40 +3277,40 @@ if ('onhashchange' in window) { 3821 # write(*Trace-stream, s1) 3822 # . . push args 3823 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) -3824 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream +3824 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream 3825 # . . call -3826 e8/call write/disp32 +3826 e8/call write/disp32 3827 # . . discard args 3828 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3829 # write-slice(*Trace-stream, l2) 3830 # . . push args 3831 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) -3832 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream +3832 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream 3833 # . . call -3834 e8/call write-slice/disp32 +3834 e8/call write-slice/disp32 3835 # . . discard args 3836 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3837 # write(*Trace-stream, s3) 3838 # . . push args 3839 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x10/disp8 . # push *(ebp+16) -3840 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream +3840 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream 3841 # . . call -3842 e8/call write/disp32 +3842 e8/call write/disp32 3843 # . . discard args 3844 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3845 # write-slice(*Trace-stream, l4) 3846 # . . push args 3847 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x14/disp8 . # push *(ebp+20) -3848 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream +3848 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream 3849 # . . call -3850 e8/call write-slice/disp32 +3850 e8/call write-slice/disp32 3851 # . . discard args 3852 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3853 # trace(s5) # implicitly adds a newline and finalizes the trace line 3854 # . . push args 3855 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x18/disp8 . # push *(ebp+24) 3856 # . . call -3857 e8/call trace/disp32 +3857 e8/call trace/disp32 3858 # . . discard args 3859 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3860 $trace-slsls:end: @@ -3325,7 +3325,7 @@ if ('onhashchange' in window) { 3869 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp 3870 # setup 3871 # . *Trace-stream->write = 0 -3872 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 0/r32/eax Trace-stream/disp32 # copy *Trace-stream to eax +3872 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 0/r32/eax Trace-stream/disp32 # copy *Trace-stream to eax 3873 c7 0/subop/copy 0/mod/direct 0/rm32/eax . . . . . 0/imm32 # clear *eax 3874 # (eax..ecx) = "b" 3875 b8/copy-to-eax "b"/imm32 @@ -3362,7 +3362,7 @@ if ('onhashchange' in window) { 3931 68/push "F - test-trace-slsls"/imm32 3932 68/push "Abcde"/imm32 3933 # . . call -3934 e8/call check-trace-contains/disp32 +3934 e8/call check-trace-contains/disp32 3935 # . . discard args 3936 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3937 # . epilogue @@ -3377,40 +3377,40 @@ if ('onhashchange' in window) { 3946 # write(*Trace-stream, s1) 3947 # . . push args 3948 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) -3949 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream +3949 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream 3950 # . . call -3951 e8/call write/disp32 +3951 e8/call write/disp32 3952 # . . discard args 3953 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3954 # write-slice(*Trace-stream, l2) 3955 # . . push args 3956 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) -3957 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream +3957 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream 3958 # . . call -3959 e8/call write-slice/disp32 +3959 e8/call write-slice/disp32 3960 # . . discard args 3961 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3962 # write(*Trace-stream, s3) 3963 # . . push args 3964 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x10/disp8 . # push *(ebp+16) -3965 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream +3965 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream 3966 # . . call -3967 e8/call write/disp32 +3967 e8/call write/disp32 3968 # . . discard args 3969 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3970 # write-int32-hex(*Trace-stream, n4) 3971 # . . push args 3972 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x14/disp8 . # push *(ebp+20) -3973 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream +3973 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream 3974 # . . call -3975 e8/call write-int32-hex/disp32 +3975 e8/call write-int32-hex/disp32 3976 # . . discard args 3977 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3978 # trace(s5) # implicitly adds a newline and finalizes the trace line 3979 # . . push args 3980 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x18/disp8 . # push *(ebp+24) 3981 # . . call -3982 e8/call trace/disp32 +3982 e8/call trace/disp32 3983 # . . discard args 3984 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 3985 $trace-slsns:end: @@ -3425,7 +3425,7 @@ if ('onhashchange' in window) { 3994 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp 3995 # setup 3996 # . *Trace-stream->write = 0 -3997 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 0/r32/eax Trace-stream/disp32 # copy *Trace-stream to eax +3997 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 0/r32/eax Trace-stream/disp32 # copy *Trace-stream to eax 3998 c7 0/subop/copy 0/mod/direct 0/rm32/eax . . . . . 0/imm32 # clear *eax 3999 # (eax..ecx) = "b" 4000 b8/copy-to-eax "b"/imm32 @@ -3453,7 +3453,7 @@ if ('onhashchange' in window) { 4047 68/push "F - test-trace-slsls"/imm32 4048 68/push "Abc 0x00000003 e"/imm32 4049 # . . call -4050 e8/call check-trace-contains/disp32 +4050 e8/call check-trace-contains/disp32 4051 # . . discard args 4052 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 4053 # . epilogue @@ -3468,40 +3468,40 @@ if ('onhashchange' in window) { 4062 # write(*Trace-stream, s1) 4063 # . . push args 4064 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) -4065 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream +4065 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream 4066 # . . call -4067 e8/call write/disp32 +4067 e8/call write/disp32 4068 # . . discard args 4069 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 4070 # write-slice(*Trace-stream, l2) 4071 # . . push args 4072 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) -4073 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream +4073 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream 4074 # . . call -4075 e8/call write-slice/disp32 +4075 e8/call write-slice/disp32 4076 # . . discard args 4077 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 4078 # write(*Trace-stream, s3) 4079 # . . push args 4080 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x10/disp8 . # push *(ebp+16) -4081 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream +4081 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream 4082 # . . call -4083 e8/call write/disp32 +4083 e8/call write/disp32 4084 # . . discard args 4085 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 4086 # write(*Trace-stream, s4) 4087 # . . push args 4088 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x14/disp8 . # push *(ebp+20) -4089 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream +4089 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream 4090 # . . call -4091 e8/call write/disp32 +4091 e8/call write/disp32 4092 # . . discard args 4093 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 4094 # trace(s5) # implicitly adds a newline and finalizes the trace line 4095 # . . push args 4096 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x18/disp8 . # push *(ebp+24) 4097 # . . call -4098 e8/call trace/disp32 +4098 e8/call trace/disp32 4099 # . . discard args 4100 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4101 $trace-slsss:end: @@ -3516,7 +3516,7 @@ if ('onhashchange' in window) { 4110 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp 4111 # setup 4112 # . *Trace-stream->write = 0 -4113 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 0/r32/eax Trace-stream/disp32 # copy *Trace-stream to eax +4113 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 0/r32/eax Trace-stream/disp32 # copy *Trace-stream to eax 4114 c7 0/subop/copy 0/mod/direct 0/rm32/eax . . . . . 0/imm32 # clear *eax 4115 # (eax..ecx) = "b" 4116 b8/copy-to-eax "b"/imm32 @@ -3544,7 +3544,7 @@ if ('onhashchange' in window) { 4163 68/push "F - test-trace-slsss"/imm32 4164 68/push "Abcde"/imm32 4165 # . . call -4166 e8/call check-trace-contains/disp32 +4166 e8/call check-trace-contains/disp32 4167 # . . discard args 4168 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 4169 # . epilogue @@ -3586,7 +3586,7 @@ if ('onhashchange' in window) { 4230 # . . push args 4231 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 4232 # . . call -4233 e8/call rewind-stream/disp32 +4233 e8/call rewind-stream/disp32 4234 # . . discard args 4235 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4236 $num-bytes:loop: @@ -3595,7 +3595,7 @@ if ('onhashchange' in window) { 4239 51/push-ecx 4240 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 4241 # . . call -4242 e8/call next-word/disp32 +4242 e8/call next-word/disp32 4243 # . . discard args 4244 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 4245 +-- 40 lines: #? # dump word-slice -------------------------------------------------------------------------------------------------------------------------------------------------- @@ -3607,7 +3607,7 @@ if ('onhashchange' in window) { 4290 # . . push args 4291 51/push-ecx 4292 # . . call -4293 e8/call slice-empty?/disp32 +4293 e8/call slice-empty?/disp32 4294 # . . discard args 4295 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4296 # . if (eax != false) break @@ -3644,7 +3644,7 @@ if ('onhashchange' in window) { 4327 68/push "=="/imm32 4328 51/push-ecx 4329 # . . call -4330 e8/call slice-equal?/disp32 +4330 e8/call slice-equal?/disp32 4331 # . . discard args 4332 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 4333 # . if (eax != false) break @@ -3660,7 +3660,7 @@ if ('onhashchange' in window) { 4343 # . . push args 4344 51/push-ecx 4345 # . . call -4346 e8/call compute-width-of-slice/disp32 +4346 e8/call compute-width-of-slice/disp32 4347 # . . discard args 4348 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4349 # . eax += result @@ -3671,7 +3671,7 @@ if ('onhashchange' in window) { 4354 # . . push args 4355 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 4356 # . . call -4357 e8/call rewind-stream/disp32 +4357 e8/call rewind-stream/disp32 4358 # . . discard args 4359 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4360 # . reclaim locals @@ -3693,22 +3693,22 @@ if ('onhashchange' in window) { 4376 # setup 4377 # . clear-stream(_test-input-stream) 4378 # . . push args -4379 68/push _test-input-stream/imm32 +4379 68/push _test-input-stream/imm32 4380 # . . call -4381 e8/call clear-stream/disp32 +4381 e8/call clear-stream/disp32 4382 # . . discard args 4383 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4384 # . clear-stream(_test-output-stream) 4385 # . . push args -4386 68/push _test-output-stream/imm32 +4386 68/push _test-output-stream/imm32 4387 # . . call -4388 e8/call clear-stream/disp32 +4388 e8/call clear-stream/disp32 4389 # . . discard args 4390 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4391 # no contents in input 4392 # eax = num-bytes(_test-input-stream) 4393 # . . push args -4394 68/push _test-input-stream/imm32 +4394 68/push _test-input-stream/imm32 4395 # . . call 4396 e8/call num-bytes/disp32 4397 # . . discard args @@ -3719,7 +3719,7 @@ if ('onhashchange' in window) { 4402 68/push 0/imm32/true 4403 50/push-eax 4404 # . . call -4405 e8/call check-ints-equal/disp32 +4405 e8/call check-ints-equal/disp32 4406 # . . discard args 4407 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 4408 # . epilogue @@ -3735,30 +3735,30 @@ if ('onhashchange' in window) { 4418 # setup 4419 # . clear-stream(_test-input-stream) 4420 # . . push args -4421 68/push _test-input-stream/imm32 +4421 68/push _test-input-stream/imm32 4422 # . . call -4423 e8/call clear-stream/disp32 +4423 e8/call clear-stream/disp32 4424 # . . discard args 4425 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4426 # . clear-stream(_test-output-stream) 4427 # . . push args -4428 68/push _test-output-stream/imm32 +4428 68/push _test-output-stream/imm32 4429 # . . call -4430 e8/call clear-stream/disp32 +4430 e8/call clear-stream/disp32 4431 # . . discard args 4432 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4433 # initialize input 4434 # . write(_test-input-stream, "# abcd") 4435 # . . push args 4436 68/push "# abcd"/imm32 -4437 68/push _test-input-stream/imm32 +4437 68/push _test-input-stream/imm32 4438 # . . call -4439 e8/call write/disp32 +4439 e8/call write/disp32 4440 # . . discard args 4441 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 4442 # eax = num-bytes(_test-input-stream) 4443 # . . push args -4444 68/push _test-input-stream/imm32 +4444 68/push _test-input-stream/imm32 4445 # . . call 4446 e8/call num-bytes/disp32 4447 # . . discard args @@ -3769,7 +3769,7 @@ if ('onhashchange' in window) { 4452 68/push 0/imm32/true 4453 50/push-eax 4454 # . . call -4455 e8/call check-ints-equal/disp32 +4455 e8/call check-ints-equal/disp32 4456 # . . discard args 4457 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 4458 # . epilogue @@ -3785,30 +3785,30 @@ if ('onhashchange' in window) { 4468 # setup 4469 # . clear-stream(_test-input-stream) 4470 # . . push args -4471 68/push _test-input-stream/imm32 +4471 68/push _test-input-stream/imm32 4472 # . . call -4473 e8/call clear-stream/disp32 +4473 e8/call clear-stream/disp32 4474 # . . discard args 4475 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4476 # . clear-stream(_test-output-stream) 4477 # . . push args -4478 68/push _test-output-stream/imm32 +4478 68/push _test-output-stream/imm32 4479 # . . call -4480 e8/call clear-stream/disp32 +4480 e8/call clear-stream/disp32 4481 # . . discard args 4482 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4483 # initialize input 4484 # . write(_test-input-stream, "ab: # cd") 4485 # . . push args 4486 68/push "ab: # cd"/imm32 -4487 68/push _test-input-stream/imm32 +4487 68/push _test-input-stream/imm32 4488 # . . call -4489 e8/call write/disp32 +4489 e8/call write/disp32 4490 # . . discard args 4491 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 4492 # eax = num-bytes(_test-input-stream) 4493 # . . push args -4494 68/push _test-input-stream/imm32 +4494 68/push _test-input-stream/imm32 4495 # . . call 4496 e8/call num-bytes/disp32 4497 # . . discard args @@ -3819,7 +3819,7 @@ if ('onhashchange' in window) { 4502 68/push 0/imm32/true 4503 50/push-eax 4504 # . . call -4505 e8/call check-ints-equal/disp32 +4505 e8/call check-ints-equal/disp32 4506 # . . discard args 4507 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 4508 # . epilogue @@ -3835,30 +3835,30 @@ if ('onhashchange' in window) { 4518 # setup 4519 # . clear-stream(_test-input-stream) 4520 # . . push args -4521 68/push _test-input-stream/imm32 +4521 68/push _test-input-stream/imm32 4522 # . . call -4523 e8/call clear-stream/disp32 +4523 e8/call clear-stream/disp32 4524 # . . discard args 4525 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4526 # . clear-stream(_test-output-stream) 4527 # . . push args -4528 68/push _test-output-stream/imm32 +4528 68/push _test-output-stream/imm32 4529 # . . call -4530 e8/call clear-stream/disp32 +4530 e8/call clear-stream/disp32 4531 # . . discard args 4532 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4533 # initialize input 4534 # . write(_test-input-stream, "== ab cd") 4535 # . . push args 4536 68/push "== ab cd"/imm32 -4537 68/push _test-input-stream/imm32 +4537 68/push _test-input-stream/imm32 4538 # . . call -4539 e8/call write/disp32 +4539 e8/call write/disp32 4540 # . . discard args 4541 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 4542 # eax = num-bytes(_test-input-stream) 4543 # . . push args -4544 68/push _test-input-stream/imm32 +4544 68/push _test-input-stream/imm32 4545 # . . call 4546 e8/call num-bytes/disp32 4547 # . . discard args @@ -3869,7 +3869,7 @@ if ('onhashchange' in window) { 4552 68/push 0/imm32/true 4553 50/push-eax 4554 # . . call -4555 e8/call check-ints-equal/disp32 +4555 e8/call check-ints-equal/disp32 4556 # . . discard args 4557 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 4558 # . epilogue @@ -3885,30 +3885,30 @@ if ('onhashchange' in window) { 4568 # setup 4569 # . clear-stream(_test-input-stream) 4570 # . . push args -4571 68/push _test-input-stream/imm32 +4571 68/push _test-input-stream/imm32 4572 # . . call -4573 e8/call clear-stream/disp32 +4573 e8/call clear-stream/disp32 4574 # . . discard args 4575 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4576 # . clear-stream(_test-output-stream) 4577 # . . push args -4578 68/push _test-output-stream/imm32 +4578 68/push _test-output-stream/imm32 4579 # . . call -4580 e8/call clear-stream/disp32 +4580 e8/call clear-stream/disp32 4581 # . . discard args 4582 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4583 # initialize input 4584 # . write(_test-input-stream, "ab cd ef") 4585 # . . push args 4586 68/push "ab cd ef"/imm32 -4587 68/push _test-input-stream/imm32 +4587 68/push _test-input-stream/imm32 4588 # . . call -4589 e8/call write/disp32 +4589 e8/call write/disp32 4590 # . . discard args 4591 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 4592 # eax = num-bytes(_test-input-stream) 4593 # . . push args -4594 68/push _test-input-stream/imm32 +4594 68/push _test-input-stream/imm32 4595 # . . call 4596 e8/call num-bytes/disp32 4597 # . . discard args @@ -3919,7 +3919,7 @@ if ('onhashchange' in window) { 4602 68/push 3/imm32/true 4603 50/push-eax 4604 # . . call -4605 e8/call check-ints-equal/disp32 +4605 e8/call check-ints-equal/disp32 4606 # . . discard args 4607 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 4608 # . epilogue @@ -3935,30 +3935,30 @@ if ('onhashchange' in window) { 4618 # setup 4619 # . clear-stream(_test-input-stream) 4620 # . . push args -4621 68/push _test-input-stream/imm32 +4621 68/push _test-input-stream/imm32 4622 # . . call -4623 e8/call clear-stream/disp32 +4623 e8/call clear-stream/disp32 4624 # . . discard args 4625 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4626 # . clear-stream(_test-output-stream) 4627 # . . push args -4628 68/push _test-output-stream/imm32 +4628 68/push _test-output-stream/imm32 4629 # . . call -4630 e8/call clear-stream/disp32 +4630 e8/call clear-stream/disp32 4631 # . . discard args 4632 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4633 # initialize input 4634 # . write(_test-input-stream, "ab cd # ef") 4635 # . . push args 4636 68/push "ab cd # ef"/imm32 -4637 68/push _test-input-stream/imm32 +4637 68/push _test-input-stream/imm32 4638 # . . call -4639 e8/call write/disp32 +4639 e8/call write/disp32 4640 # . . discard args 4641 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 4642 # eax = num-bytes(_test-input-stream) 4643 # . . push args -4644 68/push _test-input-stream/imm32 +4644 68/push _test-input-stream/imm32 4645 # . . call 4646 e8/call num-bytes/disp32 4647 # . . discard args @@ -3969,7 +3969,7 @@ if ('onhashchange' in window) { 4652 68/push 2/imm32/true 4653 50/push-eax 4654 # . . call -4655 e8/call check-ints-equal/disp32 +4655 e8/call check-ints-equal/disp32 4656 # . . discard args 4657 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 4658 # . epilogue @@ -3985,30 +3985,30 @@ if ('onhashchange' in window) { 4668 # setup 4669 # . clear-stream(_test-input-stream) 4670 # . . push args -4671 68/push _test-input-stream/imm32 +4671 68/push _test-input-stream/imm32 4672 # . . call -4673 e8/call clear-stream/disp32 +4673 e8/call clear-stream/disp32 4674 # . . discard args 4675 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4676 # . clear-stream(_test-output-stream) 4677 # . . push args -4678 68/push _test-output-stream/imm32 +4678 68/push _test-output-stream/imm32 4679 # . . call -4680 e8/call clear-stream/disp32 +4680 e8/call clear-stream/disp32 4681 # . . discard args 4682 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4683 # initialize input 4684 # . write(_test-input-stream, "ab cd/imm32 ef") 4685 # . . push args 4686 68/push "ab cd/imm32 ef"/imm32 -4687 68/push _test-input-stream/imm32 +4687 68/push _test-input-stream/imm32 4688 # . . call -4689 e8/call write/disp32 +4689 e8/call write/disp32 4690 # . . discard args 4691 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 4692 # eax = num-bytes(_test-input-stream) 4693 # . . push args -4694 68/push _test-input-stream/imm32 +4694 68/push _test-input-stream/imm32 4695 # . . call 4696 e8/call num-bytes/disp32 4697 # . . discard args @@ -4019,7 +4019,7 @@ if ('onhashchange' in window) { 4702 68/push 6/imm32/true 4703 50/push-eax 4704 # . . call -4705 e8/call check-ints-equal/disp32 +4705 e8/call check-ints-equal/disp32 4706 # . . discard args 4707 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 4708 # . epilogue diff --git a/html/apps/tests.subx.html b/html/apps/tests.subx.html index 8ba1a41f..731ac276 100644 --- a/html/apps/tests.subx.html +++ b/html/apps/tests.subx.html @@ -76,17 +76,17 @@ if ('onhashchange' in window) { 16 # initialize heap 17 # . Heap = new-segment(Heap-size) 18 # . . push args - 19 68/push Heap/imm32 - 20 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Heap-size/disp32 # push *Heap-size + 19 68/push Heap/imm32 + 20 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Heap-size/disp32 # push *Heap-size 21 # . . call - 22 e8/call new-segment/disp32 + 22 e8/call new-segment/disp32 23 # . . discard args 24 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 25 # initialize-trace-stream(256KB) 26 # . . push args 27 68/push 0x40000/imm32/256KB 28 # . . call - 29 e8/call initialize-trace-stream/disp32 + 29 e8/call initialize-trace-stream/disp32 30 # . . discard args 31 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 32 @@ -100,7 +100,7 @@ if ('onhashchange' in window) { 40 68/push "test"/imm32 41 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 42 # . . call - 43 e8/call kernel-string-equal?/disp32 + 43 e8/call kernel-string-equal?/disp32 44 # . . discard args 45 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 46 # . if (eax == false) goto run-main @@ -109,14 +109,14 @@ if ('onhashchange' in window) { 49 # run-tests() 50 e8/call run-tests/disp32 51 # syscall(exit, *Num-test-failures) - 52 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/ebx Num-test-failures/disp32 # copy *Num-test-failures to ebx + 52 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/ebx Num-test-failures/disp32 # copy *Num-test-failures to ebx 53 eb/jump $subx-tests-main:end/disp8 54 $subx-tests-main:interactive: 55 # - otherwise convert stdin 56 # subx-gen-run-tests(Stdin, Stdout) 57 # . . push args - 58 68/push Stdout/imm32 - 59 68/push Stdin/imm32 + 58 68/push Stdout/imm32 + 59 68/push Stdin/imm32 60 # . . call 61 e8/call subx-gen-run-tests/disp32 62 # . . discard args @@ -184,9 +184,9 @@ if ('onhashchange' in window) { 124 56/push-esi 125 68/push 1/imm32 126 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Segment-size/disp32 # push *Segment-size -127 68/push Heap/imm32 +127 68/push Heap/imm32 128 # . . call -129 e8/call new-stream/disp32 +129 e8/call new-stream/disp32 130 # . . discard args 131 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32 # add to esp 132 # var new-code-stream/edi: (addr stream byte) = lookup(*new-code-stream-handle) @@ -195,7 +195,7 @@ if ('onhashchange' in window) { 135 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 . # push *(esi+4) 136 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . . # push *esi 137 # . . call -138 e8/call lookup/disp32 +138 e8/call lookup/disp32 139 # . . discard args 140 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 141 # . new-code-stream = eax @@ -205,7 +205,7 @@ if ('onhashchange' in window) { 145 68/push "\n== code\n"/imm32 146 57/push-edi 147 # . . call -148 e8/call write/disp32 +148 e8/call write/disp32 149 # . . discard args 150 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 151 # write(new-code-segment, "run-tests:\n") @@ -213,7 +213,7 @@ if ('onhashchange' in window) { 153 68/push "run-tests:\n"/imm32 154 57/push-edi 155 # . . call -156 e8/call write/disp32 +156 e8/call write/disp32 157 # . . discard args 158 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 159 $subx-gen-run-tests:loop: @@ -221,7 +221,7 @@ if ('onhashchange' in window) { 161 # . . push args 162 51/push-ecx 163 # . . call -164 e8/call clear-stream/disp32 +164 e8/call clear-stream/disp32 165 # . . discard args 166 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 167 # read-line-buffered(in, line) @@ -229,7 +229,7 @@ if ('onhashchange' in window) { 169 51/push-ecx 170 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 171 # . . call -172 e8/call read-line-buffered/disp32 +172 e8/call read-line-buffered/disp32 173 # . . discard args 174 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 175 $subx-gen-run-tests:check0: @@ -241,7 +241,7 @@ if ('onhashchange' in window) { 181 52/push-edx 182 51/push-ecx 183 # . . call -184 e8/call next-word/disp32 +184 e8/call next-word/disp32 185 # . . discard args 186 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 187 $subx-gen-run-tests:check-for-label: @@ -250,7 +250,7 @@ if ('onhashchange' in window) { 190 # . . push args 191 52/push-edx 192 # . . call -193 e8/call is-label?/disp32 +193 e8/call is-label?/disp32 194 # . . discard args 195 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 196 # . if (eax == false) continue @@ -264,7 +264,7 @@ if ('onhashchange' in window) { 204 68/push "test-"/imm32 205 52/push-edx 206 # . . call -207 e8/call slice-starts-with?/disp32 +207 e8/call slice-starts-with?/disp32 208 # . . discard args 209 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 210 # . if (eax == false) break @@ -278,7 +278,7 @@ if ('onhashchange' in window) { 218 68/push " e8/call "/imm32 219 57/push-edi 220 # . . call -221 e8/call write/disp32 +221 e8/call write/disp32 222 # . . discard args 223 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 224 # write-slice(new-code-segment, word-slice) @@ -286,7 +286,7 @@ if ('onhashchange' in window) { 226 52/push-edx 227 57/push-edi 228 # . . call -229 e8/call write-slice/disp32 +229 e8/call write-slice/disp32 230 # . . discard args 231 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 232 # write(new-code-segment, "/disp32\n") @@ -294,7 +294,7 @@ if ('onhashchange' in window) { 234 68/push "/disp32\n"/imm32 235 57/push-edi 236 # . . call -237 e8/call write/disp32 +237 e8/call write/disp32 238 # . . discard args 239 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 240 $subx-gen-run-tests:continue: @@ -302,7 +302,7 @@ if ('onhashchange' in window) { 242 # . . push args 243 51/push-ecx 244 # . . call -245 e8/call rewind-stream/disp32 +245 e8/call rewind-stream/disp32 246 # . . discard args 247 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 248 # write-stream-data(out, line) @@ -310,7 +310,7 @@ if ('onhashchange' in window) { 250 51/push-ecx 251 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 252 # . . call -253 e8/call write-stream-data/disp32 +253 e8/call write-stream-data/disp32 254 # . . discard args 255 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 256 # loop @@ -324,7 +324,7 @@ if ('onhashchange' in window) { 264 68/push " c3/return\n"/imm32 265 57/push-edi 266 # . . call -267 e8/call write/disp32 +267 e8/call write/disp32 268 # . . discard args 269 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 270 # write-stream-data(out, new-code-segment) @@ -332,7 +332,7 @@ if ('onhashchange' in window) { 272 57/push-edi 273 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 274 # . . call -275 e8/call write-stream-data/disp32 +275 e8/call write-stream-data/disp32 276 # . . discard args 277 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 278 $subx-gen-run-tests:end: @@ -340,7 +340,7 @@ if ('onhashchange' in window) { 280 # . . push args 281 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 282 # . . call -283 e8/call flush/disp32 +283 e8/call flush/disp32 284 # . . discard args 285 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 286 # . reclaim locals diff --git a/html/apps/tui.mu.html b/html/apps/tui.mu.html index feec1be9..93733c11 100644 --- a/html/apps/tui.mu.html +++ b/html/apps/tui.mu.html @@ -65,28 +65,28 @@ if ('onhashchange' in window) { 7 fn main -> exit-status/ebx: int { 8 var nrows/eax: int <- copy 0 9 var ncols/ecx: int <- copy 0 -10 nrows, ncols <- screen-size -11 enable-screen-grid-mode -12 move-cursor-on-screen 5, 35 -13 start-color-on-screen 1, 0x7a -14 start-blinking-on-screen -15 print-string-to-screen "Hello world!" -16 reset-formatting-on-screen -17 move-cursor-on-screen 6, 35 -18 print-string-to-screen "tty dimensions: " -19 print-int32-hex-to-screen nrows -20 print-string-to-screen " rows, " -21 print-int32-hex-to-screen ncols -22 print-string-to-screen " rows\n" +10 nrows, ncols <- screen-size +11 enable-screen-grid-mode +12 move-cursor-on-screen 5, 35 +13 start-color-on-screen 1, 0x7a +14 start-blinking-on-screen +15 print-string-to-screen "Hello world!" +16 reset-formatting-on-screen +17 move-cursor-on-screen 6, 35 +18 print-string-to-screen "tty dimensions: " +19 print-int32-hex-to-screen nrows +20 print-string-to-screen " rows, " +21 print-int32-hex-to-screen ncols +22 print-string-to-screen " rows\n" 23 -24 print-string-to-screen "press a key to see its code: " -25 enable-keyboard-immediate-mode -26 var x/eax: byte <- read-key -27 enable-keyboard-type-mode -28 enable-screen-type-mode -29 print-string-to-screen "You pressed " -30 print-int32-hex-to-screen x -31 print-string-to-screen "\n" +24 print-string-to-screen "press a key to see its code: " +25 enable-keyboard-immediate-mode +26 var x/eax: byte <- read-key +27 enable-keyboard-type-mode +28 enable-screen-type-mode +29 print-string-to-screen "You pressed " +30 print-int32-hex-to-screen x +31 print-string-to-screen "\n" 32 exit-status <- copy 0 33 }
diff --git a/html/mu-init-test.subx.html b/html/mu-init-test.subx.html index b71f5d46..64673d0b 100644 --- a/html/mu-init-test.subx.html +++ b/html/mu-init-test.subx.html @@ -75,13 +75,13 @@ if ('onhashchange' in window) { 18 81 7/subop/compare *esi 4/imm32 19 7e/jump-if-<= break/disp8 20 # if (argv[1] != "test") break -21 (string-equal? *(esi+8) "test") # => eax +21 (string-equal? *(esi+8) "test") # => eax 22 3d/compare-eax-and 0/imm32 23 74/jump-if-= break/disp8 24 # 25 (run-tests) 26 # return *Num-test-failures -27 8b/-> *Num-test-failures 3/r32/ebx +27 8b/-> *Num-test-failures 3/r32/ebx 28 eb/jump $main:end/disp8 29 } 30 $main:end: diff --git a/html/mu-init.subx.html b/html/mu-init.subx.html index cea26406..80ad77ed 100644 --- a/html/mu-init.subx.html +++ b/html/mu-init.subx.html @@ -76,7 +76,7 @@ if ('onhashchange' in window) { 20 89/<- %esi 4/r32/esp 21 $Entry:initialize-heap: 22 # - initialize the heap -23 (new-segment *Heap-size Heap) +23 (new-segment *Heap-size Heap) 24 $Entry:initialize-args: 25 # - convert argv from null-terminated 'kernel' strings to length-prefixed Mu strings 26 # var argc/edx: int @@ -88,8 +88,8 @@ if ('onhashchange' in window) { 32 68/push 0/imm32 33 89/<- %ebx 4/r32/esp 34 # var args/edi: (addr array (addr array byte)) -35 (allocate-array Heap %edx %ebx) -36 (lookup *ebx *(ebx+4)) # => eax +35 (allocate-array Heap %edx %ebx) +36 (lookup *ebx *(ebx+4)) # => eax 37 89/<- %edi 0/r32/eax 38 # var curr/ecx: (addr kernel-string) = argv 39 8d/copy-address *(esi+4) 1/r32/ecx @@ -102,8 +102,8 @@ if ('onhashchange' in window) { 46 39/compare %ecx 2/r32/edx 47 73/jump-if-addr>= break/disp8 48 # *dest = kernel-string-to-string(*curr) -49 (kernel-string-to-string Heap *ecx %ebx) -50 (lookup *ebx *(ebx+4)) # => eax +49 (kernel-string-to-string Heap *ecx %ebx) +50 (lookup *ebx *(ebx+4)) # => eax 51 89/<- *esi 0/r32/eax 52 # curr += 4 53 81 0/subop/add %ecx 4/imm32 diff --git a/html/run_one_test.subx.html b/html/run_one_test.subx.html index 555fc3e1..bfd463ea 100644 --- a/html/run_one_test.subx.html +++ b/html/run_one_test.subx.html @@ -65,22 +65,22 @@ if ('onhashchange' in window) { 8 Entry: 9 # Heap = new-segment(64KB) 10 # . . push args -11 68/push Heap/imm32 -12 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Heap-size/disp32 # push *Heap-size +11 68/push Heap/imm32 +12 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Heap-size/disp32 # push *Heap-size 13 # . . call -14 e8/call new-segment/disp32 +14 e8/call new-segment/disp32 15 # . . discard args 16 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 17 # initialize-trace-stream(256KB) 18 # . . push args 19 68/push 0x40000/imm32/256KB 20 # . . call -21 e8/call initialize-trace-stream/disp32 +21 e8/call initialize-trace-stream/disp32 22 # . . discard args 23 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 24 # for debugging: run a single test 25 e8/call $TEST_NAME/disp32 -26 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/ebx Num-test-failures/disp32 # copy *Num-test-failures to ebx +26 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/ebx Num-test-failures/disp32 # copy *Num-test-failures to ebx 27 b8/copy-to-eax 1/imm32/exit 28 cd/syscall 0x80/imm8 29