diff options
110 files changed, 716 insertions, 716 deletions
diff --git a/050_write.subx b/050_write.subx index f4b95c0d..9e848b0d 100644 --- a/050_write.subx +++ b/050_write.subx @@ -34,7 +34,7 @@ Entry: # just exit; can't test _write just yet # You can convert a ref or handle to an address, but not the other way around. # You can convert addresses to ints, but not the other way around. -_write: # fd : int, s : (address array byte) +_write: # fd : int, s : (addr array byte) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp diff --git a/051test.subx b/051test.subx index ac0f32a5..f5771010 100644 --- a/051test.subx +++ b/051test.subx @@ -21,7 +21,7 @@ Entry: # manual test cd/syscall 0x80/imm8 # print msg to stderr if a != b, otherwise print "." -check-ints-equal: # a : int, b : int, msg : (address array byte) +check-ints-equal: # a : int, b : int, msg : (addr array byte) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp diff --git a/052kernel-string-equal.subx b/052kernel-string-equal.subx index f63ef9ed..94953e59 100644 --- a/052kernel-string-equal.subx +++ b/052kernel-string-equal.subx @@ -30,7 +30,7 @@ Entry: # run all tests # compare a null-terminated ascii string with a more idiomatic length-prefixed byte array # reason for the name: the only place we should have null-terminated ascii strings is from commandline args -kernel-string-equal?: # s : (address kernel-string), benchmark : (address array byte) -> eax : boolean +kernel-string-equal?: # s : (addr kernel-string), benchmark : (addr array byte) -> eax : boolean # pseudocode: # n = benchmark->length # s1 = s @@ -61,12 +61,12 @@ kernel-string-equal?: # s : (address kernel-string), benchmark : (address array 53/push-ebx 56/push-esi 57/push-edi - # var s1/edi : (address byte) = s + # var s1/edi : (addr byte) = s 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 7/r32/edi 8/disp8 . # copy *(ebp+8) to edi # var n/edx : int = benchmark->length 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 2/r32/edx 0xc/disp8 . # copy *(ebp+12) to edx 8b/copy 0/mod/indirect 2/rm32/edx . . . 2/r32/edx . . # copy *edx to edx - # var s2/esi : (address byte) = benchmark->data + # var s2/esi : (addr byte) = benchmark->data 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 0xc/disp8 . # copy *(ebp+12) to esi 81 0/subop/add 3/mod/direct 6/rm32/esi . . . . . 4/imm32 # add to esi # var i/ecx : int = 0 @@ -262,10 +262,10 @@ test-compare-kernel-string-with-longer-array: == data -Null-kernel-string: # (address kernel-string) +Null-kernel-string: # (addr kernel-string) 00/null -_test-Abc-kernel-string: # (address kernel-string) +_test-Abc-kernel-string: # (addr kernel-string) 41/A 62/b 63/c 00/null # . . vim:nowrap:textwidth=0 diff --git a/053new-segment.subx b/053new-segment.subx index ba2487d5..d1cc7daf 100644 --- a/053new-segment.subx +++ b/053new-segment.subx @@ -29,7 +29,7 @@ Entry: # manual test e8/call new-segment/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp - # var eax : (address _) = ad->curr + # var eax : (addr _) = ad->curr 8b/copy 0/mod/indirect 1/rm32/ecx . . . 0/r32/eax . . # copy *ecx to eax # write to *eax to check that we have access to the newly-allocated segment c7 0/subop/copy 0/mod/direct 0/rm32/eax . . . . . 0x34/imm32 # copy to *eax diff --git a/054string-equal.subx b/054string-equal.subx index c63688a1..a34130ec 100644 --- a/054string-equal.subx +++ b/054string-equal.subx @@ -13,7 +13,7 @@ Entry: # run all tests b8/copy-to-eax 1/imm32/exit cd/syscall 0x80/imm8 -string-equal?: # s : (address array byte), benchmark : (address array byte) -> eax : boolean +string-equal?: # s : (addr array byte), benchmark : (addr array byte) -> eax : boolean # pseudocode: # if (s->length != benchmark->length) return false # currs = s->data @@ -51,11 +51,11 @@ $string-equal?:lengths: # if (ecx != benchmark->length) return false 39/compare 0/mod/indirect 7/rm32/edi . . . 1/r32/ecx . . # compare *edi and ecx 75/jump-if-not-equal $string-equal?:false/disp8 - # var currs/esi : (address byte) = s->data + # var currs/esi : (addr byte) = s->data 81 0/subop/add 3/mod/direct 6/rm32/esi . . . . . 4/imm32 # add to esi - # var maxs/ecx : (address byte) = &s->data[s->length] + # var maxs/ecx : (addr byte) = &s->data[s->length] 01/add 3/mod/direct 1/rm32/ecx . . . 6/r32/esi . . # add esi to ecx - # var currb/edi : (address byte) = benchmark->data + # var currb/edi : (addr byte) = benchmark->data 81 0/subop/add 3/mod/direct 7/rm32/edi . . . . . 4/imm32 # add to edi # var c1/eax : byte = 0 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . . # clear eax @@ -176,7 +176,7 @@ test-compare-inequal-strings-equal-lengths: c3/return # helper for later tests -check-strings-equal: # s : (address array byte), expected : (address array byte), msg : (address array byte) +check-strings-equal: # s : (addr array byte), expected : (addr array byte), msg : (addr array byte) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp diff --git a/055stream.subx b/055stream.subx index 6568602a..cd2fc3db 100644 --- a/055stream.subx +++ b/055stream.subx @@ -14,7 +14,7 @@ # . op subop mod rm32 base index scale r32 # . 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 -clear-stream: # f : (address stream byte) +clear-stream: # f : (addr stream byte) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -25,13 +25,13 @@ clear-stream: # f : (address stream byte) 8b/copy 1/mod/*+disp8 5/rm32/ebp . . 0/r32/eax 8/disp8 . # copy *(ebp+8) to eax # var count/ecx : int = f->length 8b/copy 1/mod/*+disp8 0/rm32/eax . . . 1/r32/ecx 8/disp8 . # copy *(eax+8) to ecx - # var max/ecx : (address byte) = &f->data[f->length] + # var max/ecx : (addr byte) = &f->data[f->length] 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 0xc/disp8 . # copy eax+ecx+12 to ecx # f->write = 0 c7 0/subop/copy 0/mod/direct 0/rm32/eax . . . . . 0/imm32 # copy to *eax # f->read = 0 c7 0/subop/copy 1/mod/*+disp8 0/rm32/eax . . . . 4/disp8 0/imm32 # copy to *(eax+4) - # var curr/eax : (address byte) = f->data + # var curr/eax : (addr byte) = f->data 81 0/subop/add 3/mod/direct 0/rm32/eax . . . . . 0xc/imm32 # add to eax $clear-stream:loop: # if (curr >= max) break @@ -51,7 +51,7 @@ $clear-stream:end: 5d/pop-to-ebp c3/return -rewind-stream: # f : (address stream byte) +rewind-stream: # f : (addr stream byte) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp diff --git a/056trace.subx b/056trace.subx index 0a09bd4f..14270887 100644 --- a/056trace.subx +++ b/056trace.subx @@ -79,7 +79,7 @@ $initialize-trace-stream:end: # Append a string to the given trace stream. # Silently give up if it's already full. Or truncate the string if there isn't enough room. -trace: # line : (address array byte) +trace: # line : (addr array byte) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -90,7 +90,7 @@ trace: # line : (address array byte) 53/push-ebx 56/push-esi 57/push-edi - # var edi : (address stream byte) = *Trace-stream + # var edi : (addr stream byte) = *Trace-stream 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 7/r32/edi Trace-stream/disp32 # copy *Trace-stream to edi # esi = line 8b/copy 1/mod/*+disp8 5/rm32/ebp . . 6/r32/esi 8/disp8 . # copy *(ebp+8) to esi @@ -246,7 +246,7 @@ test-trace-empty-line: # end c3/return -check-trace-contains: # line : (address string), msg : (address string) +check-trace-contains: # line : (addr string), msg : (addr string) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -271,7 +271,7 @@ $check-trace-contains:end: 5d/pop-to-ebp c3/return -check-trace-scans-to: # line : (address string), msg : (address string) +check-trace-scans-to: # line : (addr string), msg : (addr string) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -302,7 +302,7 @@ $check-trace-scans-to:end: c3/return # Start scanning from Trace-stream->read for 'line'. If found, update Trace-stream->read and return true. -trace-scan: # line : (address array byte) -> result/eax : boolean +trace-scan: # line : (addr array byte) -> result/eax : boolean # pseudocode: # push Trace-stream->read # while true: @@ -554,7 +554,7 @@ test-trace-scan-failure-leaves-read-index-untouched: # . end c3/return -next-line-matches?: # t : (address stream byte), line : (address array byte) -> result/eax : boolean +next-line-matches?: # t : (addr stream byte), line : (addr array byte) -> result/eax : boolean # pseudocode: # while true: # if (currl >= maxl) break @@ -575,24 +575,24 @@ next-line-matches?: # t : (address stream byte), line : (address array byte) -> 57/push-edi # edx = line 8b/copy 1/mod/*+disp8 5/rm32/ebp . . 2/r32/edx 0xc/disp8 . # copy *(ebp+12) to edx - # var currl/esi : (address byte) = line->data + # var currl/esi : (addr byte) = line->data # . esi = line/edx->data 8d/copy-address 1/mod/*+disp8 2/rm32/edx . . . 6/r32/esi 4/disp8 . # copy edx+4 to esi - # var maxl/ecx : (address byte) = &line->data[line->size] + # var maxl/ecx : (addr byte) = &line->data[line->size] # . eax = line/edx->size 8b/copy 0/mod/indirect 2/rm32/edx . . 0/r32/eax . . # copy *edx to eax # . maxl = &line->data[line->size] 8d/copy-address 0/mod/indirect 4/rm32/sib 6/base/esi 0/index/eax . 1/r32/ecx . . # copy edx+eax to ecx # edi = t 8b/copy 1/mod/*+disp8 5/rm32/ebp . . 7/r32/edi 8/disp8 . # copy *(ebp+8) to edi - # var ebx : (address byte) = t->data + # var ebx : (addr byte) = t->data 8d/copy-address 1/mod/*+disp8 7/rm32/edi . . . 3/r32/ebx 0xc/disp8 . # copy edi+12 to ebx - # var maxt/edx : (address byte) = &t->data[t->write] + # var maxt/edx : (addr byte) = &t->data[t->write] # . eax = t->write 8b/copy 0/mod/indirect 7/rm32/edi . . 0/r32/eax . . # copy *edi to eax # . maxt = &t->data[t->write] 8d/copy-address 0/mod/indirect 4/rm32/sib 3/base/ebx 0/index/eax . 2/r32/edx . . # copy ebx+eax to edx - # var currt/edi : (address byte) = &t->data[t->read] + # var currt/edi : (addr byte) = &t->data[t->read] # . eax = t/edi->read 8b/copy 1/mod/*+disp8 7/rm32/edi . . 0/r32/eax 4/disp8 . # copy *(edi+4) to eax # . currt = &t->data[t->read] @@ -730,7 +730,7 @@ test-next-line-matches?-match: c3/return # move t->read to _after_ next newline -skip-next-line: # t : (address stream byte) +skip-next-line: # t : (addr stream byte) # pseudocode: # max = &t->data[t->write] # i = t->read @@ -756,11 +756,11 @@ skip-next-line: # t : (address stream byte) 8d/copy-address 1/mod/*+disp8 1/rm32/ecx . . . 2/r32/edx 0xc/disp8 . # copy ecx+12 to edx # eax = t->write 8b/copy 0/mod/indirect 1/rm32/ecx . . . 0/r32/eax . . # copy *ecx to eax - # var max/ebx : (address byte) = &t->data[t->write] + # var max/ebx : (addr byte) = &t->data[t->write] 8d/copy-address 0/mod/indirect 4/rm32/sib 2/base/edx 0/index/eax . 3/r32/ebx . . # copy edx+eax to ebx # eax = t->read 8b/copy 1/mod/*+disp8 1/rm32/ecx . . . 0/r32/eax 4/disp8 . # copy *(ecx+4) to edx - # var curr/ecx : (address byte) = &t->data[t->read] + # var curr/ecx : (addr byte) = &t->data[t->read] 8d/copy-address 0/mod/indirect 4/rm32/sib 2/base/edx 0/index/eax . 1/r32/ecx . . # copy edx+eax to ecx # var i/edx : int = t->read 89/copy 3/mod/direct 2/rm32/edx . . . 0/r32/eax . . # copy eax to edx @@ -858,7 +858,7 @@ $clear-trace-stream:end: # - helpers # 3-argument variant of _append -_append-3: # out : (address byte), outend : (address byte), s : (address array byte) -> num_bytes_appended/eax +_append-3: # out : (addr byte), outend : (addr byte), s : (addr array byte) -> num_bytes_appended/eax # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -890,7 +890,7 @@ $_append-3:end: c3/return # 4-argument variant of _append -_append-4: # out : (address byte), outend : (address byte), in : (address byte), inend : (address byte) -> num_bytes_appended/eax : int +_append-4: # out : (addr byte), outend : (addr byte), in : (addr byte), inend : (addr byte) -> num_bytes_appended/eax : int # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp diff --git a/057write.subx b/057write.subx index db3cb5cc..b768c22a 100644 --- a/057write.subx +++ b/057write.subx @@ -21,7 +21,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 # TODO: come up with a way to signal when a write to disk fails -write: # f : fd or (address stream byte), s : (address array byte) +write: # f : fd or (addr stream byte), s : (addr array byte) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp diff --git a/058stream-equal.subx b/058stream-equal.subx index bc3bc4d0..bcf6b6f2 100644 --- a/058stream-equal.subx +++ b/058stream-equal.subx @@ -6,7 +6,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 # compare all the data in a stream (ignoring the read pointer) -stream-data-equal?: # f : (address stream byte), s : (address array byte) -> eax : boolean +stream-data-equal?: # f : (addr stream byte), s : (addr array byte) -> eax : boolean # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -19,9 +19,9 @@ stream-data-equal?: # f : (address stream byte), s : (address array byte) -> ea 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 . # copy *(ebp+8) to esi # eax = f->write 8b/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . . # copy *esi to eax - # var maxf/edx : (address byte) = &f->data[f->write] + # var maxf/edx : (addr byte) = &f->data[f->write] 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/esi 0/index/eax . 2/r32/edx 0xc/disp8 . # copy esi+eax+12 to edx - # var currf/esi : (address byte) = f->data + # var currf/esi : (addr byte) = f->data 81 0/subop/add 3/mod/direct 6/rm32/esi . . . . . 0xc/imm32 # add to esi # edi = s 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 7/r32/edi 0xc/disp8 . # copy *(ebp+12) to edi @@ -29,7 +29,7 @@ $stream-data-equal?:compare-lengths: # if (f->write != s->length) return false 39/compare 0/mod/indirect 7/rm32/edi . . . 0/r32/eax . . # compare *edi and eax 75/jump-if-not-equal $stream-data-equal?:false/disp8 - # var currs/edi : (address byte) = s->data + # var currs/edi : (addr byte) = s->data 81 0/subop/add 3/mod/direct 7/rm32/edi . . . . . 4/imm32 # add to edi # var eax : byte = 0 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . . # clear eax @@ -191,7 +191,7 @@ test-stream-data-equal-length-check: c3/return # helper for later tests -check-stream-equal: # f : (address stream byte), s : (address array byte), msg : (address array byte) +check-stream-equal: # f : (addr stream byte), s : (addr array byte), msg : (addr array byte) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -227,7 +227,7 @@ $check-stream-equal:end: # on success, set f->read to after the next newline # on failure, leave f->read unmodified # this function is usually used only in tests, so we repeatedly write f->read -next-stream-line-equal?: # f : (address stream byte), s : (address array byte) -> eax : boolean +next-stream-line-equal?: # f : (addr stream byte), s : (addr array byte) -> eax : boolean # pseudocode: # currf = f->read # bound: f->write # currs = 0 # bound : s->length diff --git a/059stop.subx b/059stop.subx index 7c1c776b..b224005c 100644 --- a/059stop.subx +++ b/059stop.subx @@ -41,7 +41,7 @@ # the stack. # Ugly that we need to know the size of args. Don't allocate variables between # tailor-exit-descriptor and the call it's for. -tailor-exit-descriptor: # ed : (address exit-descriptor), nbytes : int +tailor-exit-descriptor: # ed : (addr exit-descriptor), nbytes : int # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -89,7 +89,7 @@ $tailor-exit-descriptor:end: 5d/pop-to-ebp c3/return -stop: # ed : (address exit-descriptor), value : int +stop: # ed : (addr exit-descriptor), value : int # no prologue; one way or another, we're going to clobber registers # eax = ed 8b/copy 1/mod/*+disp8 4/rm32/sib 4/base/esp 4/index/none . 0/r32/eax 4/disp8 . # copy *(esp+4) to eax @@ -161,7 +161,7 @@ test-stop-skips-returns-on-exit: 5d/pop-to-ebp c3/return -_test-stop-1: # ed : (address exit-descriptor) +_test-stop-1: # ed : (addr exit-descriptor) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -188,7 +188,7 @@ $_test-stop-1:dead-end: 5d/pop-to-ebp c3/return -_test-stop-2: # ed : (address exit-descriptor) +_test-stop-2: # ed : (addr exit-descriptor) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp diff --git a/060read.subx b/060read.subx index 34658b7b..3fad28b4 100644 --- a/060read.subx +++ b/060read.subx @@ -45,7 +45,7 @@ # . op subop mod rm32 base index scale r32 # . 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 -read: # f : fd or (address stream byte), s : (address stream byte) -> num-bytes-read/eax : int +read: # f : fd or (addr stream byte), s : (addr stream byte) -> num-bytes-read/eax : int # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -195,7 +195,7 @@ $_buffer-4:end: # Unclear how I'd use it, though. Callers seem to need the check anyway. # Maybe a better helper would be 'empty-stream?' -_read: # fd : int, s : (address stream byte) -> num-bytes-read/eax : int +_read: # fd : int, s : (addr stream byte) -> num-bytes-read/eax : int # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp diff --git a/061read-byte.subx b/061read-byte.subx index a90c05da..ae09a7a5 100644 --- a/061read-byte.subx +++ b/061read-byte.subx @@ -12,7 +12,7 @@ # The buffered file for standard input. Also illustrates the layout for # buffered-file: a pointer to the backing store, followed by a 'buffer' stream Stdin: # (ref buffered-file) - # file descriptor or (address stream byte) + # file descriptor or (addr stream byte) 0/imm32 # standard input $Stdin->buffer: # inlined fields for a stream @@ -35,7 +35,7 @@ $Stdin->buffer: # return next byte value in eax, with top 3 bytes cleared. # On reaching end of file, return 0xffffffff (Eof). -read-byte-buffered: # f : (address buffered-file) -> byte-or-Eof/eax +read-byte-buffered: # f : (addr buffered-file) -> byte-or-Eof/eax # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -272,7 +272,7 @@ test-read-byte-buffered-refills-buffer: # a test buffered file for _test-stream _test-buffered-file: # (ref buffered-file) - # file descriptor or (address stream byte) + # file descriptor or (addr stream byte) _test-stream/imm32 $_test-buffered-file->buffer: # current write index @@ -311,7 +311,7 @@ _test-input-stream: # (ref stream byte) # a test buffered file for _test-input-stream _test-input-buffered-file: # (ref buffered-file) - # file descriptor or (address stream byte) + # file descriptor or (addr stream byte) _test-input-stream/imm32 $_test-input-buffered-file->buffer: # current write index diff --git a/062write-stream.subx b/062write-stream.subx index 2dab3fe8..2183e59b 100644 --- a/062write-stream.subx +++ b/062write-stream.subx @@ -15,7 +15,7 @@ #? b8/copy-to-eax 1/imm32/exit #? cd/syscall 0x80/imm8 -write-stream: # f : fd or (address stream byte), s : (address stream byte) +write-stream: # f : fd or (addr stream byte), s : (addr stream byte) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -75,7 +75,7 @@ $write-stream:end: 5d/pop-to-ebp c3/return -_write-stream: # fd : int, s : (address stream byte) +_write-stream: # fd : int, s : (addr stream byte) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp diff --git a/063error.subx b/063error.subx index bb1a8b71..aa1db47c 100644 --- a/063error.subx +++ b/063error.subx @@ -6,7 +6,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 # write(out, "Error: "+msg+"\n") then stop(ed, 1) -error: # ed : (address exit-descriptor), out : fd or (address stream byte), msg : (address array byte) +error: # ed : (addr exit-descriptor), out : fd or (addr stream byte), msg : (addr array byte) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp diff --git a/064write-byte.subx b/064write-byte.subx index 2e7a36f3..cd68eea7 100644 --- a/064write-byte.subx +++ b/064write-byte.subx @@ -8,7 +8,7 @@ # The buffered file for standard output. Stdout: # (ref buffered-file) - # file descriptor or (address stream byte) + # file descriptor or (addr stream byte) 1/imm32 # standard output $Stdout->buffer: # inlined fields for a stream @@ -30,7 +30,7 @@ $Stdout->buffer: # . 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 # Write lower byte of 'n' to 'f'. -write-byte-buffered: # f : (address buffered-file), n : int +write-byte-buffered: # f : (addr buffered-file), n : int # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -78,7 +78,7 @@ $write-byte-buffered:end: 5d/pop-to-ebp c3/return -flush: # f : (address buffered-file) +flush: # f : (addr buffered-file) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -205,7 +205,7 @@ test-write-byte-buffered-multiple-flushes: # - variant without buffering # Write lower byte of 'n' to 'f'. -append-byte: # f : (address stream byte), n : int +append-byte: # f : (addr stream byte), n : int # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -326,7 +326,7 @@ _test-output-stream: # (ref stream byte) # a test buffered file for _test-output-stream _test-output-buffered-file: # (ref buffered-file) - # file descriptor or (address stream byte) + # file descriptor or (addr stream byte) _test-output-stream/imm32 $_test-output-buffered-file->buffer: # current write index @@ -357,7 +357,7 @@ _test-error-stream: # (ref stream byte) # a test buffered file for _test-error-stream _test-error-buffered-file: # (ref buffered-file) - # file descriptor or (address stream byte) + # file descriptor or (addr stream byte) _test-error-stream/imm32 $_test-error-buffered-file->buffer: # current write index diff --git a/065write-buffered.subx b/065write-buffered.subx index 8c7ae9c5..16ad8381 100644 --- a/065write-buffered.subx +++ b/065write-buffered.subx @@ -5,7 +5,7 @@ # . op subop mod rm32 base index scale r32 # . 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 -write-buffered: # f : (address buffered-file), msg : (address array byte) +write-buffered: # f : (addr buffered-file), msg : (addr array byte) # pseudocode: # in = msg->data # inend = &msg->data[msg->length] @@ -38,9 +38,9 @@ write-buffered: # f : (address buffered-file), msg : (address array byte) 57/push-edi # eax = msg 8b/copy 1/mod/*+disp8 5/rm32/ebp . . 0/r32/eax 0xc/disp8 . # copy *(ebp+12) to eax - # var in/esi : (address byte) = msg->data + # var in/esi : (addr byte) = msg->data 8d/copy-address 1/mod/*+disp8 0/rm32/eax . . . 6/r32/esi 4/disp8 . # copy eax+4 to esi - # var inend/ecx : (address byte) = &msg->data[msg->length] + # var inend/ecx : (addr byte) = &msg->data[msg->length] 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . . # copy *eax to ecx 8d/copy-address 0/mod/indirect 4/rm32/sib 6/base/esi 1/index/ecx . 1/r32/ecx . . # copy esi+ecx to ecx # edi = f @@ -207,7 +207,7 @@ test-write-buffered-with-intermediate-flush: # The buffered file for standard error. Stderr: # (ref buffered-file) - # file descriptor or (address stream byte) + # file descriptor or (addr stream byte) 2/imm32 # standard error $Stderr->buffer: # inlined fields for a stream diff --git a/066print-int.subx b/066print-int.subx index a1f968f7..dacf9ef5 100644 --- a/066print-int.subx +++ b/066print-int.subx @@ -18,7 +18,7 @@ $to-hex-char:else: 05/add-to-eax 0x57/imm32/a-10 c3/return -append-byte-hex: # f : (address stream byte), n : int +append-byte-hex: # f : (addr stream byte), n : int # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -90,7 +90,7 @@ test-append-byte-hex: c3/return # print the hex representation for the lowest byte of a number -print-byte-buffered: # f : (address buffered-file), n : int +print-byte-buffered: # f : (addr buffered-file), n : int # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -175,7 +175,7 @@ test-print-byte-buffered: # . end c3/return -print-int32: # f : (address stream byte), n : int +print-int32: # f : (addr stream byte), n : int # pseudocode: # write(f, "0x") # ecx = 28 @@ -263,7 +263,7 @@ test-print-int32: # . end c3/return -print-int32-buffered: # f : (address buffered-file), n : int +print-int32-buffered: # f : (addr buffered-file), n : int # pseudocode: # write-buffered(f, "0x") # ecx = 28 diff --git a/067parse-hex.subx b/067parse-hex.subx index 105943ca..b1c5e7a0 100644 --- a/067parse-hex.subx +++ b/067parse-hex.subx @@ -6,7 +6,7 @@ # . op subop mod rm32 base index scale r32 # . 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 -is-hex-int?: # in : (address slice) -> eax : boolean +is-hex-int?: # in : (addr slice) -> eax : boolean # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -18,7 +18,7 @@ is-hex-int?: # in : (address slice) -> eax : boolean 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 1/r32/ecx 8/disp8 . # copy *(ebp+8) to ecx # edx = s->end 8b/copy 1/mod/*+disp8 1/rm32/ecx . . . 2/r32/edx 4/disp8 . # copy *(ecx+4) to edx - # var curr/ecx : (address byte) = s->start + # var curr/ecx : (addr byte) = s->start 8b/copy 0/mod/indirect 1/rm32/ecx . . . 1/r32/ecx . . # copy *ecx to ecx # if s is empty return false b8/copy-to-eax 0/imm32/false @@ -351,7 +351,7 @@ test-is-hex-int-handles-negative-0x-prefix: 5d/pop-to-ebp c3/return -parse-hex-int: # in : (address slice) -> result/eax : int +parse-hex-int: # in : (addr slice) -> result/eax : int # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -366,7 +366,7 @@ parse-hex-int: # in : (address slice) -> result/eax : int 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 1/r32/ecx 8/disp8 . # copy *(ebp+8) to ecx # edx = in->end 8b/copy 1/mod/*+disp8 1/rm32/ecx . . . 2/r32/edx 4/disp8 . # copy *(ecx+4) to edx - # var curr/ecx : (address byte) = in->start + # var curr/ecx : (addr byte) = in->start 8b/copy 0/mod/indirect 1/rm32/ecx . . . 1/r32/ecx . . # copy *ecx to ecx # var negate?/esi : boolean = false 31/xor 3/mod/direct 6/rm32/esi . . . 6/r32/esi . . # clear esi diff --git a/068error-byte.subx b/068error-byte.subx index 5490f890..b3e7e2a0 100644 --- a/068error-byte.subx +++ b/068error-byte.subx @@ -24,7 +24,7 @@ #? cd/syscall 0x80/imm8 # write(out, "Error: "+msg+": "+byte) then stop(ed, 1) -error-byte: # ed : (address exit-descriptor), out : (address buffered-file), msg : (address array byte), n : byte +error-byte: # ed : (addr exit-descriptor), out : (addr buffered-file), msg : (addr array byte), n : byte # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp diff --git a/069allocate.subx b/069allocate.subx index 9b4dff57..5e05f873 100644 --- a/069allocate.subx +++ b/069allocate.subx @@ -56,7 +56,7 @@ $array-equal-main:end: # Claim the next 'n' bytes of memory starting at ad->curr and update ad->curr. # Abort if there isn't enough memory in 'ad'. -allocate: # ad : (address allocation-descriptor), n : int -> address-or-null/eax : (address _) +allocate: # ad : (addr allocation-descriptor), n : int -> address-or-null/eax : (addr _) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -180,7 +180,7 @@ _pending-test-allocate-failure: c3/return # helper: create a nested allocation descriptor (useful for tests) -allocate-region: # ad : (address allocation-descriptor), n : int -> new-ad : (handle allocation-descriptor) +allocate-region: # ad : (addr allocation-descriptor), n : int -> new-ad : (handle allocation-descriptor) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp diff --git a/070new-stream.subx b/070new-stream.subx index 45076c91..8420e5c8 100644 --- a/070new-stream.subx +++ b/070new-stream.subx @@ -5,7 +5,7 @@ # . op subop mod rm32 base index scale r32 # . 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 -new-stream: # ad : (address allocation-descriptor), length : int, elemsize : int -> address/eax : (handle stream _) +new-stream: # ad : (addr allocation-descriptor), length : int, elemsize : int -> address/eax : (handle stream _) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp diff --git a/071read-line.subx b/071read-line.subx index ab336c52..ee52e44f 100644 --- a/071read-line.subx +++ b/071read-line.subx @@ -6,7 +6,7 @@ # read bytes from 'f' until (and including) a newline and store them into 's' # 's' fails to grow if and only if no data found # just abort if 's' is too small -read-line-buffered: # f : (address buffered-file), s : (address stream byte) +read-line-buffered: # f : (addr buffered-file), s : (addr stream byte) # pseudocode: # while true # if (s->write >= s->length) abort @@ -216,7 +216,7 @@ test-read-line-buffered-reads-final-line-until-Eof: # read bytes from 'f' until (and including) a newline and store them into 's' # 's' fails to grow if and only if no data found # just abort if 's' is too small -read-line: # f : (address stream byte), s : (address stream byte) +read-line: # f : (addr stream byte), s : (addr stream byte) # pseudocode: # while true # if (s->write >= s->length) abort diff --git a/072slice.subx b/072slice.subx index 30c1b356..317277cd 100644 --- a/072slice.subx +++ b/072slice.subx @@ -6,7 +6,7 @@ # . op subop mod rm32 base index scale r32 # . 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 -slice-empty?: # s : (address slice) -> eax : boolean +slice-empty?: # s : (addr slice) -> eax : boolean # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -88,7 +88,7 @@ test-slice-empty-false: 5d/pop-to-ebp c3/return -slice-equal?: # s : (address slice), p : (address array byte) -> eax : boolean +slice-equal?: # s : (addr slice), p : (addr array byte) -> eax : boolean # pseudocode: # if (p == 0) return (s == 0) # currs = s->start @@ -118,9 +118,9 @@ slice-equal?: # s : (address slice), p : (address array byte) -> eax : boolean 56/push-esi # esi = s 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 . # copy *(ebp+8) to esi - # var currs/edx : (address byte) = s->start + # var currs/edx : (addr byte) = s->start 8b/copy 0/mod/indirect 6/rm32/esi . . . 2/r32/edx . . # copy *esi to edx - # var maxs/esi : (address byte) = s->end + # var maxs/esi : (addr byte) = s->end 8b/copy 1/mod/*+disp8 6/rm32/esi . . . 6/r32/esi 4/disp8 . # copy *(esi+4) to esi # var slen/eax : int = maxs - currs 89/copy 3/mod/direct 0/rm32/eax . . . 6/r32/esi . . # copy esi to eax @@ -139,7 +139,7 @@ $slice-equal?:nonnull-string: # if (slen != p->length) return false 39/compare 0/mod/indirect 3/rm32/ebx . . . 0/r32/eax . . # compare *ebx and eax 75/jump-if-not-equal $slice-equal?:false/disp8 - # var currp/ebx : (address byte) = p->data + # var currp/ebx : (addr byte) = p->data 81 0/subop/add 3/mod/direct 3/rm32/ebx . . . . . 4/imm32 # add to ebx # var c1/eax : byte = 0 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . . # clear eax @@ -455,7 +455,7 @@ test-slice-equal-with-null: 5d/pop-to-ebp c3/return -slice-starts-with?: # s : (address slice), head : (address array byte) -> eax : boolean +slice-starts-with?: # s : (addr slice), head : (addr array byte) -> eax : boolean # pseudocode # lenh = head->length # if (lenh > s->end - s->start) return false @@ -498,9 +498,9 @@ slice-starts-with?: # s : (address slice), head : (address array byte) -> eax : # if (lenh > lens) return false 39/compare 3/mod/direct 2/rm32/edx . . . 1/r32/ecx . . # compare edx with ecx 7f/jump-if-greater $slice-starts-with?:false/disp8 - # var currs/esi : (address byte) = s->start + # var currs/esi : (addr byte) = s->start 8b/subtract 0/mod/indirect 6/rm32/esi . . . 6/r32/esi . . # copy *esi to esi - # var currh/edi : (address byte) = head->data + # var currh/edi : (addr byte) = head->data 81 0/subop/add 3/mod/direct 7/rm32/edi . . . . . 4/imm32 # add to edi # var i/ecx : int = 0 31/xor 3/mod/direct 1/rm32/ecx . . . 1/r32/ecx . . # clear ecx @@ -761,7 +761,7 @@ test-slice-starts-with-fails-2: # write a slice to a stream # abort if the stream doesn't have enough space -write-slice: # out : (address stream byte), s : (address slice) +write-slice: # out : (addr stream byte), s : (addr slice) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -774,9 +774,9 @@ write-slice: # out : (address stream byte), s : (address slice) 57/push-edi # esi = s 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 0xc/disp8 . # copy *(ebp+12) to esi - # var curr/ecx : (address byte) = s->start + # var curr/ecx : (addr byte) = s->start 8b/copy 0/mod/indirect 6/rm32/esi . . . 1/r32/ecx . . # copy *esi to ecx - # var max/esi : (address byte) = s->end + # var max/esi : (addr byte) = s->end 8b/copy 1/mod/*+disp8 6/rm32/esi . . . 6/r32/esi 4/disp8 . # copy *(esi+4) to esi # edi = out 8b/copy 1/mod/*+disp8 5/rm32/ebp . . 7/r32/edi 8/disp8 . # copy *(ebp+8) to edi @@ -877,7 +877,7 @@ test-write-slice: c3/return # write a slice to a buffered-file -write-slice-buffered: # out : (address buffered-file), s : (address slice) +write-slice-buffered: # out : (addr buffered-file), s : (addr slice) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -890,9 +890,9 @@ write-slice-buffered: # out : (address buffered-file), s : (address slice) 57/push-edi # esi = s 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 0xc/disp8 . # copy *(ebp+12) to esi - # var curr/ecx : (address byte) = s->start + # var curr/ecx : (addr byte) = s->start 8b/copy 0/mod/indirect 6/rm32/esi . . . 1/r32/ecx . . # copy *esi to ecx - # var max/esi : (address byte) = s->end + # var max/esi : (addr byte) = s->end 8b/copy 1/mod/*+disp8 6/rm32/esi . . . 6/r32/esi 4/disp8 . # copy *(esi+4) to esi # edi = out 8b/copy 1/mod/*+disp8 5/rm32/ebp . . 7/r32/edi 8/disp8 . # copy *(ebp+8) to edi @@ -1012,7 +1012,7 @@ test-write-slice-buffered: c3/return # copy a slice into a new (dynamically allocated) string -slice-to-string: # ad : (address allocation-descriptor), in : (address slice) -> out/eax : (address array byte) +slice-to-string: # ad : (addr allocation-descriptor), in : (addr slice) -> out/eax : (addr array byte) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -1023,9 +1023,9 @@ slice-to-string: # ad : (address allocation-descriptor), in : (address slice) - 56/push-esi # esi = in 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 0xc/disp8 . # copy *(ebp+12) to esi - # var curr/edx : (address byte) = in->start + # var curr/edx : (addr byte) = in->start 8b/copy 0/mod/indirect 6/rm32/esi . . . 2/r32/edx . . # copy *esi to edx - # var max/ebx : (address byte) = in->end + # var max/ebx : (addr byte) = in->end 8b/copy 1/mod/*+disp8 6/rm32/esi . . . 3/r32/ebx 4/disp8 . # copy *(esi+4) to ebx # var size/ecx : int = max - curr + 4 # total size of output string (including the initial length) 89/copy 3/mod/direct 1/rm32/ecx . . . 3/r32/ebx . . # copy ebx to ecx diff --git a/073next-token.subx b/073next-token.subx index 567f0cce..b108d9f0 100644 --- a/073next-token.subx +++ b/073next-token.subx @@ -7,7 +7,7 @@ # extract the next run of characters that are different from a given 'delimiter' (skipping multiple delimiters if necessary) # on reaching end of file, return an empty interval -next-token: # in : (address stream byte), delimiter : byte, out : (address slice) +next-token: # in : (addr stream byte), delimiter : byte, out : (addr slice) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -160,7 +160,7 @@ test-next-token-Eof: # extract the next run of characters that are different from a given 'delimiter' (skipping multiple delimiters if necessary) # on reaching end of file, return an empty interval -next-token-from-slice: # start : (address byte), end : (address byte), delimiter : byte, out : (address slice) +next-token-from-slice: # start : (addr byte), end : (addr byte), delimiter : byte, out : (addr slice) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -338,7 +338,7 @@ test-next-token-from-slice-nothing: 5d/pop-to-ebp c3/return -skip-chars-matching: # in : (address stream byte), delimiter : byte +skip-chars-matching: # in : (addr stream byte), delimiter : byte # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -461,7 +461,7 @@ test-skip-chars-matching-none: # end c3/return -skip-chars-matching-whitespace: # in : (address stream byte) +skip-chars-matching-whitespace: # in : (addr stream byte) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -551,7 +551,7 @@ test-skip-chars-matching-whitespace: c3/return # minor fork of 'skip-chars-matching' -skip-chars-not-matching: # in : (address stream byte), delimiter : byte +skip-chars-not-matching: # in : (addr stream byte), delimiter : byte # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -713,7 +713,7 @@ test-skip-chars-not-matching-all: # end c3/return -skip-chars-not-matching-whitespace: # in : (address stream byte) +skip-chars-not-matching-whitespace: # in : (addr stream byte) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -801,7 +801,7 @@ test-skip-chars-not-matching-whitespace: # end c3/return -skip-chars-matching-in-slice: # curr : (address byte), end : (address byte), delimiter : byte -> curr/eax +skip-chars-matching-in-slice: # curr : (addr byte), end : (addr byte), delimiter : byte -> curr/eax # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -897,7 +897,7 @@ test-skip-chars-matching-in-slice-none: # end c3/return -skip-chars-matching-whitespace-in-slice: # curr : (address byte), end : (address byte) -> curr/eax +skip-chars-matching-whitespace-in-slice: # curr : (addr byte), end : (addr byte) -> curr/eax # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -970,7 +970,7 @@ test-skip-chars-matching-whitespace-in-slice: c3/return # minor fork of 'skip-chars-matching-in-slice' -skip-chars-not-matching-in-slice: # curr : (address byte), end : (address byte), delimiter : byte -> curr/eax +skip-chars-not-matching-in-slice: # curr : (addr byte), end : (addr byte), delimiter : byte -> curr/eax # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -1095,7 +1095,7 @@ test-skip-chars-not-matching-in-slice-all: # end c3/return -skip-chars-not-matching-whitespace-in-slice: # curr : (address byte), end : (address byte) -> curr/eax +skip-chars-not-matching-whitespace-in-slice: # curr : (addr byte), end : (addr byte) -> curr/eax # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -1168,7 +1168,7 @@ test-skip-chars-not-matching-whitespace-in-slice: # update line->read to end of string literal surrounded by double quotes # line->read must start out at a double-quote -skip-string: # line : (address stream byte) +skip-string: # line : (addr stream byte) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -1410,7 +1410,7 @@ test-skip-string-works-from-mid-stream: 5d/pop-to-ebp c3/return -skip-string-in-slice: # curr : (address byte), end : (address byte) -> new_curr/eax +skip-string-in-slice: # curr : (addr byte), end : (addr byte) -> new_curr/eax # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -1596,7 +1596,7 @@ test-skip-string-in-slice-stops-at-end: # update line->read to ')' # line->read ends at ')' -skip-until-close-paren: # line : (address stream byte) +skip-until-close-paren: # line : (addr stream byte) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -1783,7 +1783,7 @@ test-skip-until-close-paren-works-from-mid-stream: 5d/pop-to-ebp c3/return -skip-until-close-paren-in-slice: # curr : (address byte), end : (address byte) -> new_curr/eax : (address byte) +skip-until-close-paren-in-slice: # curr : (addr byte), end : (addr byte) -> new_curr/eax : (addr byte) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp diff --git a/074write-stream-data.subx b/074write-stream-data.subx index 074e9d29..a7ad60f4 100644 --- a/074write-stream-data.subx +++ b/074write-stream-data.subx @@ -8,7 +8,7 @@ # - construct a 'maximal slice' and pass it to write-slice-buffered # - flush the buffered-file and pass the stream directly to its fd (disabling buffering) # we'll go with the first way for now -write-stream-data: # f : (address buffered-file), s : (address stream byte) +write-stream-data: # f : (addr buffered-file), s : (addr stream byte) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp diff --git a/075print-int-decimal.subx b/075print-int-decimal.subx index 6eba81a1..95e9e23b 100644 --- a/075print-int-decimal.subx +++ b/075print-int-decimal.subx @@ -5,7 +5,7 @@ # . op subop mod rm32 base index scale r32 # . 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 -print-int32-decimal: # out : (address stream byte), n : int32 +print-int32-decimal: # out : (addr stream byte), n : int32 # works by generating characters from lowest to highest and pushing them # to the stack, before popping them one by one into the stream # @@ -76,9 +76,9 @@ $print-int32-decimal:write: 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 7/r32/edi 8/disp8 . # copy *(ebp+8) to edi # var w/edx : int = out->write 8b/copy 0/mod/indirect 7/rm32/edi . . . 2/r32/edx . . # copy *edi to edx - # var curr/ecx : (address byte) = &out->data[out->write] + # var curr/ecx : (addr byte) = &out->data[out->write] 8d/copy-address 1/mod/*+disp8 4/rm32/sib 7/base/edi 2/index/edx . 1/r32/ecx 0xc/disp8 . # copy ebx+edx+12 to ecx - # var max/ebx : (address byte) = &out->data[out->length] + # var max/ebx : (addr byte) = &out->data[out->length] 8b/copy 1/mod/*+disp8 7/rm32/edi . . . 3/r32/ebx 8/disp8 . # copy *(edi+8) to ebx 8d/copy-address 1/mod/*+disp8 4/rm32/sib 7/base/edi 3/index/ebx . 3/r32/ebx 0xc/disp8 . # copy edi+ebx+12 to ebx $print-int32-decimal:write-loop: diff --git a/076next-word.subx b/076next-word.subx index 34dd9c4d..7d8bbd8b 100644 --- a/076next-word.subx +++ b/076next-word.subx @@ -7,7 +7,7 @@ # (re)compute the bounds of the next word in the line # return empty string on reaching end of file -next-word: # line : (address stream byte), out : (address slice) +next-word: # line : (addr stream byte), out : (addr slice) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp diff --git a/077subx-words.subx b/077subx-words.subx index a166217a..3b523cb6 100644 --- a/077subx-words.subx +++ b/077subx-words.subx @@ -5,7 +5,7 @@ # . op subop mod rm32 base index scale r32 # . 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 -has-metadata?: # word : (address slice), s : (address string) -> eax : boolean +has-metadata?: # word : (addr slice), s : (addr string) -> eax : boolean # pseudocode: # var twig : &slice = next-token-from-slice(word->start, word->end, '/') # skip name # curr = twig->end @@ -25,7 +25,7 @@ has-metadata?: # word : (address slice), s : (address string) -> eax : boolean 57/push-edi # esi = word 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 . # copy *(ebp+8) to esi - # var edx : (address byte) = word->end + # var edx : (addr byte) = word->end 8b/copy 1/mod/*+disp8 6/rm32/esi . . . 2/r32/edx 4/disp8 . # copy *(esi+4) to edx # var twig/edi : (ref slice) 68/push 0/imm32/end @@ -275,7 +275,7 @@ test-has-metadata-multiple-false: #: - if it starts with '0x' it's treated as a number. (redundant) #: - if it's two characters long, it can't be a name. Either it's a hex #: byte, or it raises an error. -is-valid-name?: # in : (address slice) -> eax : boolean +is-valid-name?: # in : (addr slice) -> eax : boolean # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -284,7 +284,7 @@ is-valid-name?: # in : (address slice) -> eax : boolean 56/push-esi # esi = in 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 . # copy *(ebp+8) to esi - # var start/ecx : (address byte) = in->start + # var start/ecx : (addr byte) = in->start 8b/copy 0/mod/indirect 6/rm32/esi . . . 1/r32/ecx . . # copy *esi to ecx $is-valid-name?:check0: # if (start >= in->end) return false @@ -298,7 +298,7 @@ $is-valid-name?:check1: 3d/compare-eax-and 2/imm32 74/jump-if-equal $is-valid-name?:false/disp8 $is-valid-name?:check2: - # var c/eax : (address byte) = *start + # var c/eax : (addr byte) = *start 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . . # clear eax 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 0/r32/AL . . # copy byte at *ecx to AL # if (c == "-") return false @@ -532,7 +532,7 @@ test-is-valid-name-starts-with-digit: 5d/pop-to-ebp c3/return -is-label?: # word : (address slice) -> eax : boolean +is-label?: # word : (addr slice) -> eax : boolean # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -540,7 +540,7 @@ is-label?: # word : (address slice) -> eax : boolean 51/push-ecx # ecx = word 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 1/r32/ecx 8/disp8 . # copy *(ebp+8) to ecx - # var end/ecx : (address byte) = word->end + # var end/ecx : (addr byte) = word->end 8b/copy 1/mod/*+disp8 1/rm32/ecx . . . 1/r32/ecx 4/disp8 . # copy *(ecx+4) to ecx # return *(end - 1) == ':' # . eax = *(end-1) diff --git a/078emit-hex.subx b/078emit-hex.subx index caea7800..bc052642 100644 --- a/078emit-hex.subx +++ b/078emit-hex.subx @@ -4,7 +4,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 # print 'n' in hex in 'width' bytes in lower-endian order, with a space after every byte -emit-hex: # out : (address buffered-file), n : int, width : int +emit-hex: # out : (addr buffered-file), n : int, width : int # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp diff --git a/079emit.subx b/079emit.subx index 0db46bdf..1f2a5b45 100644 --- a/079emit.subx +++ b/079emit.subx @@ -7,7 +7,7 @@ # it in 'width' bytes of hex, least significant first. # Otherwise just print the entire word including metadata. # Always print a trailing space. -emit: # out : (address buffered-file), word : (address slice), width : int +emit: # out : (addr buffered-file), word : (addr slice), width : int # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp diff --git a/080zero-out.subx b/080zero-out.subx index 19e8128f..b1f9c9dc 100644 --- a/080zero-out.subx +++ b/080zero-out.subx @@ -5,7 +5,7 @@ # . op subop mod rm32 base index scale r32 # . 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 -zero-out: # start : (address byte), len : int +zero-out: # start : (addr byte), len : int # pseudocode: # curr/esi = start # i/ecx = 0 diff --git a/081table.subx b/081table.subx index 46329ca0..859147ea 100644 --- a/081table.subx +++ b/081table.subx @@ -1,6 +1,6 @@ # A table is a stream of (key, value) rows. # -# Each row consists of a 4-byte key -- a 'string_key' which is (address array +# Each row consists of a 4-byte key -- a 'string_key' which is (addr array # byte) -- and a variable-size value. # # Accessing the table performs a linear scan for a key string, and always @@ -23,8 +23,8 @@ # . 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 # if no row is found, abort -# type string_key = (address array byte) -get: # table : (address stream {string_key, T}), key : string_key, row-size : int, abort-message-prefix : (address array byte) -> eax : (address T) +# type string_key = (addr array byte) +get: # table : (addr stream {string_key, T}), key : string_key, row-size : int, abort-message-prefix : (addr array byte) -> eax : (addr T) # pseudocode: # curr = table->data # max = &table->data[table->write] @@ -43,9 +43,9 @@ get: # table : (address stream {string_key, T}), key : string_key, row-size : i 56/push-esi # esi = table 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 . # copy *(ebp+8) to esi - # var curr/ecx : (address string_key) = table->data + # var curr/ecx : (addr string_key) = table->data 8d/copy-address 1/mod/*+disp8 6/rm32/esi . . . 1/r32/ecx 0xc/disp8 . # copy esi+12 to ecx - # var max/edx : (address byte) = &table->data[table->write] + # var max/edx : (addr byte) = &table->data[table->write] 8b/copy 0/mod/indirect 6/rm32/esi . . . 2/r32/edx . . # copy *esi to edx 8d/copy-address 0/mod/indirect 4/rm32/sib 1/base/ecx 2/index/edx . 2/r32/edx . . # copy ecx+edx to edx $get:search-loop: @@ -198,7 +198,7 @@ $test-get:end: c3/return # if no row is found, abort -get-slice: # table : (address stream {string_key, T}), key : (address slice), row-size : int, abort-message-prefix : (address array byte) -> eax : (address T) +get-slice: # table : (addr stream {string_key, T}), key : (addr slice), row-size : int, abort-message-prefix : (addr array byte) -> eax : (addr T) # pseudocode: # curr = table->data # max = &table->data[table->write] @@ -217,9 +217,9 @@ get-slice: # table : (address stream {string_key, T}), key : (address slice), r 56/push-esi # esi = table 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 . # copy *(ebp+8) to esi - # var curr/ecx : (address string_key) = table->data + # var curr/ecx : (addr string_key) = table->data 8d/copy-address 1/mod/*+disp8 6/rm32/esi . . . 1/r32/ecx 0xc/disp8 . # copy esi+12 to ecx - # var max/edx : (address byte) = &table->data[table->write] + # var max/edx : (addr byte) = &table->data[table->write] 8b/copy 0/mod/indirect 6/rm32/esi . . . 2/r32/edx . . # copy *esi to edx 8d/copy-address 0/mod/indirect 4/rm32/sib 1/base/ecx 2/index/edx . 2/r32/edx . . # copy ecx+edx to edx $get-slice:search-loop: @@ -401,7 +401,7 @@ $test-get-slice:end: # return the address of the value # Beware: assume keys are immutable; they're inserted by reference # TODO: pass in an allocation descriptor -get-or-insert: # table : (address stream {string_key, T}), key : string_key, row-size : int -> eax : (address T) +get-or-insert: # table : (addr stream {string_key, T}), key : string_key, row-size : int -> eax : (addr T) # pseudocode: # curr = table->data # max = &table->data[table->write] @@ -425,9 +425,9 @@ get-or-insert: # table : (address stream {string_key, T}), key : string_key, ro 56/push-esi # esi = table 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 . # copy *(ebp+8) to esi - # var curr/ecx : (address string_key) = table->data + # var curr/ecx : (addr string_key) = table->data 8d/copy-address 1/mod/*+disp8 6/rm32/esi . . . 1/r32/ecx 0xc/disp8 . # copy esi+12 to ecx - # var max/edx : (address string_key) = &table->data[table->write] + # var max/edx : (addr string_key) = &table->data[table->write] 8b/copy 0/mod/indirect 6/rm32/esi . . . 2/r32/edx . . # copy *esi to edx 8d/copy-address 0/mod/indirect 4/rm32/sib 1/base/ecx 2/index/edx . 2/r32/edx . . # copy ecx+edx to edx $get-or-insert:search-loop: @@ -652,7 +652,7 @@ $test-get-or-insert:end: # if there are no rows free, abort # WARNING: leaks memory # TODO: pass in an allocation descriptor -leaky-get-or-insert-slice: # table : (address stream {string_key, T}), key : (address slice), row-size : int -> eax : (address T) +leaky-get-or-insert-slice: # table : (addr stream {string_key, T}), key : (addr slice), row-size : int -> eax : (addr T) # pseudocode: # curr = table->data # max = &table->data[table->write] @@ -676,9 +676,9 @@ leaky-get-or-insert-slice: # table : (address stream {string_key, T}), key : (a 56/push-esi # esi = table 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 . # copy *(ebp+8) to esi - # var curr/ecx : (address string_key) = table->data + # var curr/ecx : (addr string_key) = table->data 8d/copy-address 1/mod/*+disp8 6/rm32/esi . . . 1/r32/ecx 0xc/disp8 . # copy esi+12 to ecx - # var max/edx : (address string_key) = &table->data[table->write] + # var max/edx : (addr string_key) = &table->data[table->write] 8b/copy 0/mod/indirect 6/rm32/esi . . . 2/r32/edx . . # copy *esi to edx 8d/copy-address 0/mod/indirect 4/rm32/sib 1/base/ecx 2/index/edx . 2/r32/edx . . # copy ecx+edx to edx $leaky-get-or-insert-slice:search-loop: @@ -924,9 +924,9 @@ $test-leaky-get-or-insert-slice:end: c3/return # if no row is found, stop(ed) -get-or-stop: # table : (address stream {string_key, T}), key : string_key, row-size : int, - # abort-message-prefix : (address array byte), err : (address buffered-file), ed : (address exit-descriptor) - # -> eax : (address T) +get-or-stop: # table : (addr stream {string_key, T}), key : string_key, row-size : int, + # abort-message-prefix : (addr array byte), err : (addr buffered-file), ed : (addr exit-descriptor) + # -> eax : (addr T) # pseudocode: # curr = table->data # max = &table->data[table->write] @@ -946,9 +946,9 @@ get-or-stop: # table : (address stream {string_key, T}), key : string_key, row- 56/push-esi # esi = table 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 . # copy *(ebp+8) to esi - # var curr/ecx : (address string_key) = table->data + # var curr/ecx : (addr string_key) = table->data 8d/copy-address 1/mod/*+disp8 6/rm32/esi . . . 1/r32/ecx 0xc/disp8 . # copy esi+12 to ecx - # var max/edx : (address byte) = &table->data[table->write] + # var max/edx : (addr byte) = &table->data[table->write] 8b/copy 0/mod/indirect 6/rm32/esi . . . 2/r32/edx . . # copy *esi to edx 8d/copy-address 0/mod/indirect 4/rm32/sib 1/base/ecx 2/index/edx . 2/r32/edx . . # copy ecx+edx to edx $get-or-stop:search-loop: @@ -1140,9 +1140,9 @@ $test-get-or-stop:end: c3/return # if no row is found, stop(ed) -get-slice-or-stop: # table : (address stream {string_key, _}), key : (address slice), row-size : int, - # abort-message-prefix : (address string), err : (address buffered-file), ed : (address exit-descriptor) - # -> eax : (address _) +get-slice-or-stop: # table : (addr stream {string_key, _}), key : (addr slice), row-size : int, + # abort-message-prefix : (addr string), err : (addr buffered-file), ed : (addr exit-descriptor) + # -> eax : (addr _) # pseudocode: # curr = table->data # max = &table->data[table->write] @@ -1162,9 +1162,9 @@ get-slice-or-stop: # table : (address stream {string_key, _}), key : (address s 56/push-esi # esi = table 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 . # copy *(ebp+8) to esi - # var curr/ecx : (address string_key) = table->data + # var curr/ecx : (addr string_key) = table->data 8d/copy-address 1/mod/*+disp8 6/rm32/esi . . . 1/r32/ecx 0xc/disp8 . # copy esi+12 to ecx - # var max/edx : (address byte) = &table->data[table->write] + # var max/edx : (addr byte) = &table->data[table->write] 8b/copy 0/mod/indirect 6/rm32/esi . . . 2/r32/edx . . # copy *esi to edx 8d/copy-address 0/mod/indirect 4/rm32/sib 1/base/ecx 2/index/edx . 2/r32/edx . . # copy ecx+edx to edx $get-slice-or-stop:search-loop: @@ -1379,7 +1379,7 @@ $test-get-slice-or-stop:end: c3/return # if no row is found, return null (0) -maybe-get: # table : (address stream {string_key, T}), key : string_key, row-size : int -> eax : (address T) +maybe-get: # table : (addr stream {string_key, T}), key : string_key, row-size : int -> eax : (addr T) # pseudocode: # curr = table->data # max = &table->data[table->write] @@ -1398,9 +1398,9 @@ maybe-get: # table : (address stream {string_key, T}), key : string_key, row-si 56/push-esi # esi = table 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 . # copy *(ebp+8) to esi - # var curr/ecx : (address string_key) = table->data + # var curr/ecx : (addr string_key) = table->data 8d/copy-address 1/mod/*+disp8 6/rm32/esi . . . 1/r32/ecx 0xc/disp8 . # copy esi+12 to ecx - # var max/edx : (address byte) = &table->data[table->write] + # var max/edx : (addr byte) = &table->data[table->write] 8b/copy 0/mod/indirect 6/rm32/esi . . . 2/r32/edx . . # copy *esi to edx 8d/copy-address 0/mod/indirect 4/rm32/sib 1/base/ecx 2/index/edx . 2/r32/edx . . # copy ecx+edx to edx $maybe-get:search-loop: @@ -1526,7 +1526,7 @@ $test-maybe-get:end: c3/return # if no row is found, return null (0) -maybe-get-slice: # table : (address stream {string_key, T}), key : (address slice), row-size : int -> eax : (address T) +maybe-get-slice: # table : (addr stream {string_key, T}), key : (addr slice), row-size : int -> eax : (addr T) # pseudocode: # curr = table->data # max = &table->data[table->write] @@ -1545,9 +1545,9 @@ maybe-get-slice: # table : (address stream {string_key, T}), key : (address sli 56/push-esi # esi = table 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 . # copy *(ebp+8) to esi - # var curr/ecx : (address string_key) = table->data + # var curr/ecx : (addr string_key) = table->data 8d/copy-address 1/mod/*+disp8 6/rm32/esi . . . 1/r32/ecx 0xc/disp8 . # copy esi+12 to ecx - # var max/edx : (address byte) = &table->data[table->write] + # var max/edx : (addr byte) = &table->data[table->write] 8b/copy 0/mod/indirect 6/rm32/esi . . . 2/r32/edx . . # copy *esi to edx 8d/copy-address 0/mod/indirect 4/rm32/sib 1/base/ecx 2/index/edx . 2/r32/edx . . # copy ecx+edx to edx $maybe-get-slice:search-loop: diff --git a/082slurp.subx b/082slurp.subx index 51fba1e2..11769bc9 100644 --- a/082slurp.subx +++ b/082slurp.subx @@ -5,7 +5,7 @@ # read all bytes from 'f' and store them into 's' # abort if 's' is too small -slurp: # f : (address buffered-file), s : (address stream byte) +slurp: # f : (addr buffered-file), s : (addr stream byte) # pseudocode: # while true # if (s->write >= s->length) abort diff --git a/083subx-widths.subx b/083subx-widths.subx index db5b84ba..524dd465 100644 --- a/083subx-widths.subx +++ b/083subx-widths.subx @@ -8,7 +8,7 @@ # . op subop mod rm32 base index scale r32 # . 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 -compute-width: # word : (address array byte) -> eax : int +compute-width: # word : (addr array byte) -> eax : int # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -16,7 +16,7 @@ compute-width: # word : (address array byte) -> eax : int 51/push-ecx # eax = word 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 0/r32/eax 8/disp8 . # copy *(ebp+8) to ecx - # var ecx : (address byte) = &word[word->length] + # var ecx : (addr byte) = &word[word->length] 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . . # copy *eax to ecx 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 . # copy eax+ecx+4 to ecx # eax = word->data @@ -42,7 +42,7 @@ $compute-width:end: 5d/pop-to-ebp c3/return -compute-width-of-slice: # s : (address slice) -> eax : int +compute-width-of-slice: # s : (addr slice) -> eax : int # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp diff --git a/084emit-hex-array.subx b/084emit-hex-array.subx index 29f685f9..c554df2a 100644 --- a/084emit-hex-array.subx +++ b/084emit-hex-array.subx @@ -4,7 +4,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 # print 'arr' in hex with a space after every byte -emit-hex-array: # out : (address buffered-file), arr : (address array byte) +emit-hex-array: # out : (addr buffered-file), arr : (addr array byte) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -17,9 +17,9 @@ emit-hex-array: # out : (address buffered-file), arr : (address array byte) 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 7/r32/edi 8/disp8 . # copy *(ebp+8) to edi # edx = arr 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 2/r32/edx 0xc/disp8 . # copy *(ebp+12) to edx - # var curr/ecx : (address byte) = arr->data + # var curr/ecx : (addr byte) = arr->data 8d/copy-address 1/mod/*+disp8 2/rm32/edx . . . 1/r32/ecx 4/disp8 . # copy edx+4 to ecx - # var max/edx : (address byte) = &arr->data[arr->length] + # var max/edx : (addr byte) = &arr->data[arr->length] 8b/copy 0/mod/indirect 2/rm32/edx . . . 2/r32/edx . . # copy *edx to edx 01/add 3/mod/direct 2/rm32/edx . . . 1/r32/ecx . . # add ecx to edx # var c/eax : byte = 0 diff --git a/092write-int.subx b/092write-int.subx index 5fe1c4d3..736fc684 100644 --- a/092write-int.subx +++ b/092write-int.subx @@ -5,7 +5,7 @@ # . op subop mod rm32 base index scale r32 # . 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 -write-int: # out : (address stream byte), n : int +write-int: # out : (addr stream byte), n : int # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp diff --git a/093array-equal.subx b/093array-equal.subx index f10a9463..eba1fe8a 100644 --- a/093array-equal.subx +++ b/093array-equal.subx @@ -5,7 +5,7 @@ # . op subop mod rm32 base index scale r32 # . 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 -array-equal?: # a : (address array int), b : (address array int) -> eax : boolean +array-equal?: # a : (addr array int), b : (addr array int) -> eax : boolean # pseudocode: # lena = a->length # if (lena != b->length) return false @@ -46,9 +46,9 @@ $array-equal?:lengths: # if (lena != b->length) return false 39/compare 0/mod/indirect 7/rm32/edi . . . 2/r32/edx . . # compare *edi and edx 75/jump-if-not-equal $array-equal?:false/disp8 - # var curra/esi : (address byte) = a->data + # var curra/esi : (addr byte) = a->data 81 0/subop/add 3/mod/direct 6/rm32/esi . . . . . 4/imm32 # add to esi - # var currb/edi : (address byte) = b->data + # var currb/edi : (addr byte) = b->data 81 0/subop/add 3/mod/direct 7/rm32/edi . . . . . 4/imm32 # add to edi # var i/ecx : int = 0 31/xor 3/mod/direct 1/rm32/ecx . . . 1/r32/ecx . . # clear ecx @@ -230,7 +230,7 @@ test-compare-inequal-arrays-equal-lengths: 5d/pop-to-ebp c3/return -parse-array-of-ints: # ad : (address allocation-descriptor), s : (address string) -> result/eax : (handle array int) +parse-array-of-ints: # ad : (addr allocation-descriptor), s : (addr string) -> result/eax : (handle array int) # pseudocode # end = &s->data[s->length] # curr = s->data @@ -266,9 +266,9 @@ parse-array-of-ints: # ad : (address allocation-descriptor), s : (address strin 57/push-edi # esi = s 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 0xc/disp8 . # copy *(ebp+12) to esi - # var curr/ecx : (address byte) = s->data + # var curr/ecx : (addr byte) = s->data 8d/copy-address 1/mod/*+disp8 6/rm32/esi . . . 1/r32/ecx 4/disp8 . # copy esi+4 to ecx - # var end/edx : (address byte) = &s->data[s->length] + # var end/edx : (addr byte) = &s->data[s->length] # . edx = s->length 8b/copy 0/mod/indirect 6/rm32/esi . . . 2/r32/edx . . # copy *esi to edx # . edx += curr @@ -334,7 +334,7 @@ $parse-array-of-ints:pass2: 51/push-ecx # . bookmark 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx - # var out/ebx : (address byte) = result->data + # var out/ebx : (addr byte) = result->data 8d/copy-address 1/mod/*+disp8 0/rm32/eax . . . 3/r32/ebx 4/disp8 . # copy eax+4 to ebx $parse-array-of-ints:loop2: # if (slice->start >= end) break @@ -536,7 +536,7 @@ test-parse-array-of-ints-extra-whitespace: # helper for later tests # compare an array with a string representation of an array literal -check-array-equal: # a : (address array int), expected : (address string), msg : (address string) +check-array-equal: # a : (addr array int), expected : (addr string), msg : (addr string) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp diff --git a/094next-word-or-string.subx b/094next-word-or-string.subx index d3734fc9..5ffcd418 100644 --- a/094next-word-or-string.subx +++ b/094next-word-or-string.subx @@ -5,7 +5,7 @@ # (re)compute the bounds of the next word or string literal in the line # return empty string on reaching end of file -next-word-or-string: # line : (address stream byte), out : (address slice) +next-word-or-string: # line : (addr stream byte), out : (addr slice) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp diff --git a/095stack.subx b/095stack.subx index 692dece2..fdc4fa95 100644 --- a/095stack.subx +++ b/095stack.subx @@ -7,7 +7,7 @@ # . op subop mod rm32 base index scale r32 # . 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 -clear-stack: # s : (address stack) +clear-stack: # s : (addr stack) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -16,12 +16,12 @@ clear-stack: # s : (address stack) 51/push-ecx # eax = s 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 0/r32/eax 8/disp8 . # copy *(ebp+8) to eax - # var max/ecx : (address byte) = &s->data[s->length] + # var max/ecx : (addr byte) = &s->data[s->length] 8b/copy 1/mod/*+disp8 0/rm32/eax . . . 1/r32/ecx 4/disp8 . # copy *(eax+4) to eax 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 8/disp8 . # copy eax+ecx+8 to ecx # s->top = 0 c7 0/subop/copy 0/mod/direct 0/rm32/eax . . . . . 0/imm32 # copy to *eax - # var curr/eax : (address byte) = s->data + # var curr/eax : (addr byte) = s->data 81 0/subop/add 3/mod/direct 0/rm32/eax . . . . . 8/imm32 # add to eax $clear-stack:loop: # if (curr >= max) break @@ -107,7 +107,7 @@ test-clear-stack: 5d/pop-to-ebp c3/return -push: # s : (address stack), n : int +push: # s : (addr stack), n : int # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -227,7 +227,7 @@ test-push: 5d/pop-to-ebp c3/return -pop: # s : (address stack) -> n/eax : int +pop: # s : (addr stack) -> n/eax : int # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -331,7 +331,7 @@ test-pop: 5d/pop-to-ebp c3/return -top: # s : (address stack) -> n/eax : int +top: # s : (addr stack) -> n/eax : int # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp diff --git a/apps/assort.subx b/apps/assort.subx index 0aa18555..87a940cb 100644 --- a/apps/assort.subx +++ b/apps/assort.subx @@ -83,12 +83,12 @@ $subx-assort-main:end: cd/syscall 0x80/imm8 # data structure: -# table: (address stream {string, (address stream byte)}) (8 bytes per row) +# table: (addr stream {string, (addr stream byte)}) (8 bytes per row) # inefficient; uses sequential search for looking up segments by name -subx-assort: # in : (address buffered-file), out : (address buffered-file) +subx-assort: # in : (addr buffered-file), out : (addr buffered-file) # pseudocode: - # var table : (address stream {string, (address stream byte)} 10/rows) + # var table : (addr stream {string, (addr stream byte)} 10/rows) # read-segments(in, table) # write-segments(out, table) # @@ -97,7 +97,7 @@ subx-assort: # in : (address buffered-file), out : (address buffered-file) 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp # . save registers 51/push-ecx - # var table/ecx : (ref stream {string, (address stream byte)} 80) # 10 rows * 8 bytes/row + # var table/ecx : (ref stream {string, (addr stream byte)} 80) # 10 rows * 8 bytes/row 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 0x50/imm32 # subtract from esp 68/push 0x50/imm32/length 68/push 0/imm32/read @@ -450,10 +450,10 @@ test-subx-assort: 5d/pop-to-ebp c3/return -# type string_key = (address array byte) +# type string_key = (addr array byte) # beware: leaks memory (one name per segment read) -read-segments: # in : (address buffered-file), table : (address stream {string_key, (handle stream byte)}) +read-segments: # in : (addr buffered-file), table : (addr stream {string_key, (handle stream byte)}) # pseudocode: # var curr-segment : (handle stream byte) = 0 # var line : (stream byte 512) @@ -599,7 +599,7 @@ $read-segments:check-for-comment: #? 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp #? # }}} # if (slice-starts-with?(word-slice, "#")) continue - # . var start/esi : (address byte) = word-slice->start + # . var start/esi : (addr byte) = word-slice->start 8b/copy 0/mod/indirect 2/rm32/edx . . . 6/r32/esi . . # copy *ecx to esi # . var c/eax : byte = *start 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . . # clear eax @@ -717,7 +717,7 @@ $read-segments:check-for-segment-header: #? # . . discard args #? 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp #? # }}} - # var segment-slot/eax : (address handle stream byte) = leaky-get-or-insert-slice(table, segment-name, row-size=8) + # var segment-slot/eax : (addr handle stream byte) = leaky-get-or-insert-slice(table, segment-name, row-size=8) # . . push args 68/push 8/imm32/row-size 52/push-edx @@ -843,7 +843,7 @@ $read-segments:end: 5d/pop-to-ebp c3/return -write-segments: # out : (address buffered-file), table : (address stream {string_key, (handle stream byte)}) +write-segments: # out : (addr buffered-file), table : (addr stream {string_key, (handle stream byte)}) # pseudocode: # var curr = table->data # var max = &table->data[table->write] @@ -864,15 +864,15 @@ write-segments: # out : (address buffered-file), table : (address stream {strin 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 0xc/disp8 . # copy *(ebp+12) to esi # var write/edx : int = table->write 8b/copy 0/mod/indirect 6/rm32/esi . . . 2/r32/edx . . # copy *esi to edx - # var curr/esi : (address byte) = table->data + # var curr/esi : (addr byte) = table->data 81 0/subop/add 3/mod/direct 6/rm32/esi . . . . . 0xc/imm32 # add to eax - # var max/edx : (address byte) = curr + write + # var max/edx : (addr byte) = curr + write 01/add 3/mod/direct 2/rm32/edx . . . 6/r32/esi . . # add esi to edx $write-segments:loop: # if (curr >= max) break 39/compare 3/mod/direct 6/rm32/esi . . . 2/r32/edx . . # compare esi with edx 73/jump-if-greater-or-equal-unsigned $write-segments:break/disp8 - # var stream/eax : (address stream byte) = table[i].stream + # var stream/eax : (addr stream byte) = table[i].stream 8b/copy 1/mod/*+disp8 6/rm32/esi . . . 0/r32/eax 4/disp8 . # copy *(esi+4) to eax # write-stream-data(out, stream) # . . push args diff --git a/apps/braces.subx b/apps/braces.subx index 95b6a7ea..44e931a7 100644 --- a/apps/braces.subx +++ b/apps/braces.subx @@ -75,7 +75,7 @@ $subx-braces-main:end: b8/copy-to-eax 1/imm32/exit cd/syscall 0x80/imm8 -subx-braces: # in : (address buffered-file), out : (address buffered-file) +subx-braces: # in : (addr buffered-file), out : (addr buffered-file) # pseudocode: # var line : (ref stream byte 512) # var label-stack : (stack int 32) # at most 32 levels of nesting @@ -95,7 +95,7 @@ subx-braces: # in : (address buffered-file), out : (address buffered-file) # print(out, "_break" top ":\n") # continue # while true - # var word-slice : (address slice) = next-word-or-string(line) + # var word-slice : (addr slice) = next-word-or-string(line) # if slice-empty?(word-slice) # end of line # break # if slice-starts-with?(word-slice, "#") # comment diff --git a/apps/calls.subx b/apps/calls.subx index 0e4d113e..a4615297 100644 --- a/apps/calls.subx +++ b/apps/calls.subx @@ -75,7 +75,7 @@ $subx-calls-main:end: b8/copy-to-eax 1/imm32/exit cd/syscall 0x80/imm8 -subx-calls: # in : (address buffered-file), out : (address buffered-file) +subx-calls: # in : (addr buffered-file), out : (addr buffered-file) # pseudocode: # var line : (ref stream byte 512) # var words : (ref stream slice 16) # at most function name and 15 args @@ -231,7 +231,7 @@ $subx-calls:end: 5d/pop-to-ebp c3/return -parse-line: # line : (address stream byte), words : (address stream slice) +parse-line: # line : (addr stream byte), words : (addr stream slice) # pseudocode: # var word-slice : (ref slice) # while true @@ -340,7 +340,7 @@ $parse-line:end: 5d/pop-to-ebp c3/return -emit-call: # out : (address buffered-file), words : (address stream slice) +emit-call: # out : (addr buffered-file), words : (addr stream slice) # pseudocode: # if (words->write < 8) abort # curr = &words->data[words->write-8] @@ -381,9 +381,9 @@ emit-call: # out : (address buffered-file), words : (address stream slice) 8b/-> *esi 1/r32/ecx 81 5/subop/subtract %ecx 8/imm32 0f 8c/jump-if-lesser $emit-call:error1/disp32 - # var curr/ecx : (address slice) = &words->data[words->write-8] + # var curr/ecx : (addr slice) = &words->data[words->write-8] 8d/copy-address *(esi+ecx+0xc) 1/r32/ecx - # var min/edx : (address byte) = words->data + # var min/edx : (addr byte) = words->data 8d/copy-address *(esi+0xc) 2/r32/edx # - emit pushes $emit-call:push-loop: @@ -391,7 +391,7 @@ $emit-call:push-loop: 39/compare %ecx 2/r32/edx 0f 8e/jump-if-lesser-or-equal $emit-call:call-instruction/disp32 # if (*curr->start in '%' '*') goto push-rm32 - # . var start/eax : (address byte) = curr->start + # . var start/eax : (addr byte) = curr->start 8b/-> *ecx 0/r32/eax # . var c/eax : byte = *eax 8b/-> *eax 0/r32/eax @@ -741,7 +741,7 @@ test-subx-calls-processes-calls: 5d/pop-to-ebp c3/return -next-word-string-or-expression-without-metadata: # line : (address stream byte), out : (address slice) +next-word-string-or-expression-without-metadata: # line : (addr stream byte), out : (addr slice) # pseudocode: # skip-chars-matching(line, ' ') # if line->read >= line->write # end of line diff --git a/apps/crenshaw2-1.subx b/apps/crenshaw2-1.subx index 228f4696..c1dd79a7 100644 --- a/apps/crenshaw2-1.subx +++ b/apps/crenshaw2-1.subx @@ -90,7 +90,7 @@ $main:end: cd/syscall 0x80/imm8 # the main entry point -compile: # in : (address buffered-file), out : fd or (address stream byte), err : fd or (address stream byte), ed : (address exit-descriptor) +compile: # in : (addr buffered-file), out : fd or (addr stream byte), err : fd or (addr stream byte), ed : (addr exit-descriptor) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -191,7 +191,7 @@ $compile:end: # space in 'out'. # Input comes from the global variable 'Look' (first byte) and the argument # 'in' (rest). We leave the next byte from 'in' into 'Look' on exit. -get-num: # in : (address buffered-file), out : (address stream byte), err : fd or (address stream byte), ed : (address exit-descriptor) +get-num: # in : (addr buffered-file), out : (addr stream byte), err : fd or (addr stream byte), ed : (addr exit-descriptor) # pseudocode: # if (!is-digit?(Look)) expected(ed, err, "integer") # if out->write >= out->length @@ -470,7 +470,7 @@ test-get-num-aborts-on-non-digit-in-Look: ## helpers # write(f, "Error: "+s+" expected\n") then stop(ed, 1) -expected: # ed : (address exit-descriptor), f : fd or (address stream byte), s : (address array byte) +expected: # ed : (addr exit-descriptor), f : fd or (addr stream byte), s : (addr array byte) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -512,7 +512,7 @@ $expected:dead-end: c3/return # read a byte from 'f', and save it in 'Look' -get-char: # f : (address buffered-file) +get-char: # f : (addr buffered-file) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp diff --git a/apps/crenshaw2-1b.subx b/apps/crenshaw2-1b.subx index 374625e9..8efd9ca4 100644 --- a/apps/crenshaw2-1b.subx +++ b/apps/crenshaw2-1b.subx @@ -90,7 +90,7 @@ $main:end: cd/syscall 0x80/imm8 # the main entry point -compile: # in : (address buffered-file), out : fd or (address stream byte), err : fd or (address stream byte), ed : (address exit-descriptor) +compile: # in : (addr buffered-file), out : fd or (addr stream byte), err : fd or (addr stream byte), ed : (addr exit-descriptor) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -191,7 +191,7 @@ $compile:end: # no space in 'out'. # Input comes from the global variable 'Look' (first byte) and the argument # 'in' (rest). We leave the next byte from 'in' into 'Look' on exit. -get-num: # in : (address buffered-file), out : (address stream byte), err : fd or (address stream byte), ed : (address exit-descriptor) +get-num: # in : (addr buffered-file), out : (addr stream byte), err : fd or (addr stream byte), ed : (addr exit-descriptor) # pseudocode: # if (!is-digit?(Look)) expected(ed, err, "integer") # do @@ -664,7 +664,7 @@ test-get-num-reads-multiple-digits-followed-by-nondigit: ## helpers # write(f, "Error: "+s+" expected\n") then stop(ed, 1) -expected: # ed : (address exit-descriptor), f : fd or (address stream byte), s : (address array byte) +expected: # ed : (addr exit-descriptor), f : fd or (addr stream byte), s : (addr array byte) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -706,7 +706,7 @@ $expected:dead-end: c3/return # read a byte from 'f', and save it in 'Look' -get-char: # f : (address buffered-file) +get-char: # f : (addr buffered-file) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp diff --git a/apps/dquotes.subx b/apps/dquotes.subx index 4b985fbb..3f3fa452 100644 --- a/apps/dquotes.subx +++ b/apps/dquotes.subx @@ -82,7 +82,7 @@ $subx-dquotes-main:end: # line = words separated by ' ', maybe followed by comment starting with '#' # word = datum until '/', then 0 or more metadata separated by '/' -subx-dquotes: # in : (address buffered-file), out : (address buffered-file) +subx-dquotes: # in : (addr buffered-file), out : (addr buffered-file) # pseudocode: # var line : (ref stream byte 512) # var new-data-segment : (handle stream byte) = new-stream(Heap, Segment-size, 1) @@ -198,7 +198,7 @@ $subx-dquotes:check1: 0f 85/jump-if-not-equal $subx-dquotes:next-line/disp32 $subx-dquotes:check-for-comment: # if (slice-starts-with?(word-slice, "#")) continue - # . var start/esi : (address byte) = word-slice->start + # . var start/esi : (addr byte) = word-slice->start 8b/copy 0/mod/indirect 2/rm32/edx . . . 6/r32/esi . . # copy *edx to esi # . var c/eax : byte = *start 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . . # clear eax @@ -287,7 +287,7 @@ $subx-dquotes:end: # Write out 'string-literal' in a new format to 'out-segment', assign it a new # label, and write the new label out to 'out'. -process-string-literal: # string-literal : (address slice), out : (address buffered-file), out-segment : (address stream byte) +process-string-literal: # string-literal : (addr slice), out : (addr buffered-file), out-segment : (addr stream byte) # pseudocode: # print(out-segment, "_string#{Next-string-literal}:\n") # emit-string-literal-data(out-segment, string-literal) @@ -846,7 +846,7 @@ test-subx-dquotes-processes-string-literals: c3/return # generate the data segment contents byte by byte for a given slice -emit-string-literal-data: # out : (address stream byte), word : (address slice) +emit-string-literal-data: # out : (addr stream byte), word : (addr slice) # pseudocode # len = string-length-at-start-of-slice(word->start, word->end) # print(out, "#{len}/imm32 ") @@ -887,9 +887,9 @@ emit-string-literal-data: # out : (address stream byte), word : (address slice) 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 0xc/disp8 . # copy *(ebp+12) to esi # var idx/ebx : int = 0 31/xor 3/mod/direct 3/rm32/ebx . . . 3/r32/ebx . . # clear ebx - # var curr/edx : (address byte) = word->start + # var curr/edx : (addr byte) = word->start 8b/copy 0/mod/indirect 6/rm32/esi . . . 2/r32/edx . . # copy *esi to edx - # var max/esi : (address byte) = word->end + # var max/esi : (addr byte) = word->end 8b/copy 1/mod/*+disp8 6/rm32/esi . . . 6/r32/esi 4/disp8 . # copy *(esi+4) to esi $emit-string-literal-data:emit-length: # var len/eax : int = string-length-at-start-of-slice(word->start, word->end) @@ -1379,7 +1379,7 @@ test-emit-string-literal-data-handles-newline-escape: c3/return # emit everything from a word except the initial datum -emit-metadata: # out : (address buffered-file), word : (address slice) +emit-metadata: # out : (addr buffered-file), word : (addr slice) # pseudocode # var slice : (ref slice) = {0, word->end} # curr = word->start @@ -1406,9 +1406,9 @@ emit-metadata: # out : (address buffered-file), word : (address slice) 56/push-esi # esi = word 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 0xc/disp8 . # copy *(ebp+12) to esi - # var curr/ecx : (address byte) = word->start + # var curr/ecx : (addr byte) = word->start 8b/copy 0/mod/indirect 6/rm32/esi . . . 1/r32/ecx . . # copy *esi to ecx - # var end/edx : (address byte) = word->end + # var end/edx : (addr byte) = word->end 8b/copy 1/mod/*+disp8 6/rm32/esi . . . 2/r32/edx 4/disp8 . # copy *(esi+4) to edx # var slice/ebx : (ref slice) = {0, end} 52/push-edx @@ -1778,7 +1778,7 @@ test-emit-metadata-in-string-literal: 5d/pop-to-ebp c3/return -string-length-at-start-of-slice: # curr : (address byte), end : (address byte) -> length/eax +string-length-at-start-of-slice: # curr : (addr byte), end : (addr byte) -> length/eax # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp diff --git a/apps/ex11.subx b/apps/ex11.subx index b235927d..2469542d 100644 --- a/apps/ex11.subx +++ b/apps/ex11.subx @@ -258,7 +258,7 @@ test-compare-kernel-string-with-longer-array: # - helpers # print msg to stderr if a != b, otherwise print "." -check-ints-equal: # (a : int, b : int, msg : (address array byte)) -> boolean +check-ints-equal: # (a : int, b : int, msg : (addr array byte)) -> boolean # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -307,7 +307,7 @@ $check-ints-equal:end: 5d/pop-to-ebp c3/return -write-stderr: # s : (address array byte) -> <void> +write-stderr: # s : (addr array byte) -> <void> # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp diff --git a/apps/ex8.subx b/apps/ex8.subx index 0e44a883..2ea653f1 100644 --- a/apps/ex8.subx +++ b/apps/ex8.subx @@ -34,7 +34,7 @@ Entry: 89/copy 3/mod/direct 3/rm32/ebx . . . 0/r32/eax . . # copy eax to ebx e8/call syscall_exit/disp32 -ascii-length: # s : (address array byte) -> n/eax +ascii-length: # s : (addr array byte) -> n/eax # edx = s 8b/copy 1/mod/*+disp8 4/rm32/sib 4/base/esp 4/index/none . 2/r32/edx 4/disp8 . # copy *(esp+4) to edx # var result/eax = 0 diff --git a/apps/handle.subx b/apps/handle.subx index 07611596..fba9db1c 100644 --- a/apps/handle.subx +++ b/apps/handle.subx @@ -44,7 +44,7 @@ $handle-main:end: b8/copy-to-eax 1/imm32/exit cd/syscall 0x80/imm8 -new: # ad : (address allocation-descriptor), n : int, out : (handle _) +new: # ad : (addr allocation-descriptor), n : int, out : (handle _) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -221,7 +221,7 @@ _pending-test-new-failure: 5d/pop-to-ebp c3/return -lookup: # h : (handle T) -> eax : (address T) +lookup: # h : (handle T) -> eax : (addr T) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp diff --git a/apps/hex.subx b/apps/hex.subx index 09e394bd..d3af0105 100644 --- a/apps/hex.subx +++ b/apps/hex.subx @@ -77,7 +77,7 @@ $subx-hex-main:end: cd/syscall 0x80/imm8 # the main entry point -subx-hex: # in : (address buffered-file), out : (address buffered-file), err : (address buffered-file), ed : (address exit-descriptor) +subx-hex: # in : (addr buffered-file), out : (addr buffered-file), err : (addr buffered-file), ed : (addr exit-descriptor) # pseudocode: # while true # eax = convert-next-octet(in, err, ed) @@ -135,7 +135,7 @@ $subx-hex:end: # raise an error and abort on all other unexpected bytes # return in eax an _octet_ containing the binary value of the two hex characters # return Eof on reaching end of file -convert-next-octet: # in : (address buffered-file), err : (address buffered-file), ed : (address exit-descriptor) -> byte-or-Eof/eax +convert-next-octet: # in : (addr buffered-file), err : (addr buffered-file), ed : (addr exit-descriptor) -> byte-or-Eof/eax # pseudocode: # eax = scan-next-byte(in, err, ed) # if (eax == Eof) return @@ -481,7 +481,7 @@ $test-convert-next-octet-aborts-on-single-hex-byte:end: # return Eof if file ends without finding a hex byte # on '#' skip all bytes until newline # abort on any other byte -scan-next-byte: # in : (address buffered-file), err : (address buffered-file), ed : (address exit-descriptor) -> byte-or-Eof/eax +scan-next-byte: # in : (addr buffered-file), err : (addr buffered-file), ed : (addr exit-descriptor) -> byte-or-Eof/eax # pseudocode: # while true # eax = read-byte-buffered(in) @@ -1350,7 +1350,7 @@ $test-scan-next-byte-aborts-on-invalid-byte:end: 5d/pop-to-ebp c3/return -skip-until-newline: # in : (address buffered-file) +skip-until-newline: # in : (addr buffered-file) # pseudocode: # push eax # while true diff --git a/apps/mu.subx b/apps/mu.subx index 7c056d46..534f247d 100644 --- a/apps/mu.subx +++ b/apps/mu.subx @@ -246,7 +246,7 @@ == data -Program: # (address (handle function)) +Program: # (addr (handle function)) 0/imm32 Function-name: @@ -378,7 +378,7 @@ $mu-main:end: b8/copy-to-eax 1/imm32/exit cd/syscall 0x80/imm8 -convert-mu: # in : (address buffered-file), out : (address buffered-file) +convert-mu: # in : (addr buffered-file), out : (addr buffered-file) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -952,9 +952,9 @@ test-convert-function-call-with-literal-arg: # Parsing ####################################################### -parse-mu: # in : (address buffered-file) +parse-mu: # in : (addr buffered-file) # pseudocode - # var curr-function : (address (handle function)) = Program + # var curr-function : (addr (handle function)) = Program # var line : (ref stream byte 512) # var word-slice : (ref slice) # while true # line loop @@ -968,7 +968,7 @@ parse-mu: # in : (address buffered-file) # continue # end of line # else if slice-equal(word-slice, "fn") # var new-function : (handle function) = allocate(function) - # var vars : (ref stack (address var) 256) + # var vars : (ref stack (addr var) 256) # populate-mu-function-header(in, new-function, vars) # populate-mu-function-body(in, new-function, vars) # assert(vars->top == 0) @@ -996,9 +996,9 @@ parse-mu: # in : (address buffered-file) 68/push 0/imm32/end 68/push 0/imm32/start 89/<- %edx 4/r32/esp - # var curr-function/edi : (address (handle function)) = Program + # var curr-function/edi : (addr (handle function)) = Program bf/copy-to-edi Program/imm32 - # var vars/ebx : (ref stack (address var) 256) + # var vars/ebx : (ref stack (addr var) 256) 81 5/subop/subtract %esp 0x400/imm32 68/push 0x400/imm32/length 68/push 0/imm32/top @@ -1100,7 +1100,7 @@ $parse-mu:error2: # ✓ fn foo x : int { # ✓ fn foo x: int { # ✓ fn foo x: int -> y/eax: int { -populate-mu-function-header: # first-line : (address stream byte), out : (handle function), vars : (address stack (handle var)) +populate-mu-function-header: # first-line : (addr stream byte), out : (handle function), vars : (addr stack (handle var)) # pseudocode: # var name : (ref slice) # next-word(first-line, name) @@ -1297,7 +1297,7 @@ test-function-header-with-arg: 2b/subtract-> *Function-size 4/r32/esp 89/<- %ecx 4/r32/esp (zero-out %ecx *Function-size) - # var vars/ebx : (ref stack (address var) 16) + # var vars/ebx : (ref stack (addr var) 16) 81 5/subop/subtract %esp 0x10/imm32 68/push 0x10/imm32/length 68/push 0/imm32/top @@ -1329,7 +1329,7 @@ test-function-header-with-multiple-args: 2b/subtract-> *Function-size 4/r32/esp 89/<- %ecx 4/r32/esp (zero-out %ecx *Function-size) - # var vars/ebx : (ref stack (address var) 16) + # var vars/ebx : (ref stack (addr var) 16) 81 5/subop/subtract %esp 0x10/imm32 68/push 0x10/imm32/length 68/push 0/imm32/top @@ -1376,7 +1376,7 @@ test-function-with-multiple-args-and-outputs: 2b/subtract-> *Function-size 4/r32/esp 89/<- %ecx 4/r32/esp (zero-out %ecx *Function-size) - # var vars/ebx : (ref stack (address var) 16) + # var vars/ebx : (ref stack (addr var) 16) 81 5/subop/subtract %esp 0x10/imm32 68/push 0x10/imm32/length 68/push 0/imm32/top @@ -1427,12 +1427,12 @@ test-function-with-multiple-args-and-outputs: # x: int # x: int, # ignores at most one trailing colon or comma -parse-var-with-type: # name: (address slice), first-line: (address stream byte) -> result/eax: (handle var) +parse-var-with-type: # name: (addr slice), first-line: (addr stream byte) -> result/eax: (handle var) # pseudocode: # var v : (handle var) = allocate(Heap, Var-size) # var s : (ref slice) # next-token-from-slice(name->start, name->end, '/', s) - # var end : (address byte) = s->end + # var end : (addr byte) = s->end # if (slice-ends-with(s, ":")) # decrement s->end # if (slice-ends-with(s, ",")) @@ -1603,7 +1603,7 @@ $parse-var-with-type:abort: cd/syscall 0x80/imm8 # never gets here -next-mu-token: # in: (address stream byte), out: (address slice) +next-mu-token: # in: (addr stream byte), out: (addr slice) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -1644,7 +1644,7 @@ $next-mu-token:end: 5d/pop-to-ebp c3/return -type-for: # name: (address slice) -> result/eax: (handle s-expression type-id) +type-for: # name: (addr slice) -> result/eax: (handle s-expression type-id) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -1778,7 +1778,7 @@ test-parse-var-with-register-and-trailing-characters: # identifier starts with a letter or '$' or '_' # no constraints at the moment on later letters # all we really want to do so far is exclude '{', '}' and '->' -is-identifier?: # in : (address slice) -> result/eax : boolean +is-identifier?: # in : (addr slice) -> result/eax : boolean # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -2074,7 +2074,7 @@ test-is-identifier-hyphen: 5d/pop-to-ebp c3/return -populate-mu-function-body: # in : (address buffered-file), out : (handle function), vars : (address stack (handle var)) +populate-mu-function-body: # in : (addr buffered-file), out : (handle function), vars : (addr stack (handle var)) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -2101,7 +2101,7 @@ $populate-mu-function-body:end: c3/return # parses a block, assuming that the leading '{' has already been read by the caller -parse-mu-block: # in : (address buffered-file), vars : (address stack (handle var)), fn : (handle function) -> result/eax : (handle block) +parse-mu-block: # in : (addr buffered-file), vars : (addr stack (handle var)), fn : (handle function) -> result/eax : (handle block) # pseudocode: # var line : (ref stream byte 512) # var word-slice : (ref slice) @@ -2262,7 +2262,7 @@ $parse-mu-block:abort: cd/syscall 0x80/imm8 # never gets here -check-no-tokens-left: # line : (address stream byte) +check-no-tokens-left: # line : (addr stream byte) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -2309,7 +2309,7 @@ $check-no-tokens-left:end: 5d/pop-to-ebp c3/return -parse-mu-named-block: # name : (address slice), first-line : (address stream byte), in : (address buffered-file), vars : (address stack (handle var)) -> result/eax : (handle stmt) +parse-mu-named-block: # name : (addr slice), first-line : (addr stream byte), in : (addr buffered-file), vars : (addr stack (handle var)) -> result/eax : (handle stmt) # pseudocode: # var line : (ref stream byte 512) # var word-slice : (ref slice) @@ -2353,7 +2353,7 @@ $parse-mu-named-block:end: 5d/pop-to-ebp c3/return -parse-mu-var-def: # line : (address stream byte), vars : (address stack (handle var)) -> result/eax : (handle stmt) +parse-mu-var-def: # line : (addr stream byte), vars : (addr stack (handle var)) -> result/eax : (handle stmt) # pseudocode: # # . prologue @@ -2368,7 +2368,7 @@ $parse-mu-var-def:end: 5d/pop-to-ebp c3/return -parse-mu-stmt: # line : (address stream byte), vars : (address stack (handle var)), fn : (handle function) -> result/eax : (handle stmt) +parse-mu-stmt: # line : (addr stream byte), vars : (addr stack (handle var)), fn : (handle function) -> result/eax : (handle stmt) # pseudocode: # var name : (ref slice) # result = allocate(Heap, Stmt-size) @@ -2488,7 +2488,7 @@ $parse-mu-stmt:abort2: cd/syscall 0x80/imm8 # never gets here -stmt-has-outputs?: # line : (address stream byte) -> result/eax : boolean +stmt-has-outputs?: # line : (addr stream byte) -> result/eax : boolean # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -2536,7 +2536,7 @@ $stmt-has-outputs:end: # if 'name' starts with a digit, create a new literal var for it # otherwise return first 'name' from the top (back) of 'vars' and abort if not found -lookup-var-or-literal: # name: (address slice), vars : (address stack (handle var)) -> result/eax: (handle var) +lookup-var-or-literal: # name: (addr slice), vars : (addr stack (handle var)) -> result/eax: (handle var) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -2584,7 +2584,7 @@ $lookup-var-or-literal:abort: # never gets here # return first 'name' from the top (back) of 'vars' and abort if not found -lookup-var: # name: (address slice), vars : (address stack (handle var)) -> result/eax: (handle var) +lookup-var: # name: (addr slice), vars : (addr stack (handle var)) -> result/eax: (handle var) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -2613,9 +2613,9 @@ $lookup-var:abort: # never gets here # return first 'name' from the top (back) of 'vars', and 0/null if not found -lookup-var-helper: # name: (address array byte), vars : (address stack (handle var)) -> result/eax: (handle var) +lookup-var-helper: # name: (addr array byte), vars : (addr stack (handle var)) -> result/eax: (handle var) # pseudocode: - # var curr : (address handle var) = &vars->data[vars->top - 4] + # var curr : (addr handle var) = &vars->data[vars->top - 4] # var min = vars->data # while curr >= min # var v : (handle var) = *curr @@ -2637,9 +2637,9 @@ lookup-var-helper: # name: (address array byte), vars : (address stack (handle # if (vars->top > vars->length) abort 3b/compare 0/r32/eax *(esi+4) 0f 8f/jump-if-greater $lookup-var-helper:error1/disp32 - # var min/edx : (address handle var) = vars->data + # var min/edx : (addr handle var) = vars->data 8d/copy-address *(esi+8) 2/r32/edx - # var curr/ebx : (address handle var) = &vars->data[vars->top - 4] + # var curr/ebx : (addr handle var) = &vars->data[vars->top - 4] 81 5/subop/subtract %ebx 4/imm32 8d/copy-address *(esi+ebx+8) 3/r32/ebx { @@ -2680,7 +2680,7 @@ $lookup-var-helper:error1: # never gets here # return first 'name' from the top (back) of 'vars' and create a new var for a fn output if not found -lookup-or-define-var: # name: (address slice), vars : (address stack (handle var)), fn : (handle function) -> result/eax: (handle var) +lookup-or-define-var: # name: (addr slice), vars : (addr stack (handle var)), fn : (handle function) -> result/eax: (handle var) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -2753,7 +2753,7 @@ test-parse-mu-stmt: # setup (clear-stream _test-input-stream) (write _test-input-stream "increment n\n") - # var vars/ecx : (ref stack (address var) 4) + # var vars/ecx : (ref stack (addr var) 4) 81 5/subop/subtract %esp 0x10/imm32 68/push 0x10/imm32/length 68/push 0/imm32/top @@ -2781,7 +2781,7 @@ test-parse-mu-stmt: 5d/pop-to-ebp c3/return -new-function: # ad: (address allocation-descriptor), name: (address array byte), subx-name: (address array byte), inouts: (handle list var), outputs: (handle list var), body: (handle block), next: (handle function) -> result/eax: (handle function) +new-function: # ad: (addr allocation-descriptor), name: (addr array byte), subx-name: (addr array byte), inouts: (handle list var), outputs: (handle list var), body: (handle block), next: (handle function) -> result/eax: (handle function) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -2809,7 +2809,7 @@ $new-function:end: 5d/pop-to-ebp c3/return -new-var: # ad: (address allocation-descriptor), name: (address array byte), type: int, block: int, stack-offset: int, register: (address array byte) -> result/eax: (handle var) +new-var: # ad: (addr allocation-descriptor), name: (addr array byte), type: int, block: int, stack-offset: int, register: (addr array byte) -> result/eax: (handle var) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -2835,7 +2835,7 @@ $new-var:end: 5d/pop-to-ebp c3/return -new-literal-integer: # ad: (address allocation-descriptor), name: (address slice) -> result/eax: (handle var) +new-literal-integer: # ad: (addr allocation-descriptor), name: (addr slice) -> result/eax: (handle var) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -2845,7 +2845,7 @@ new-literal-integer: # ad: (address allocation-descriptor), name: (address slic (is-hex-int? *(ebp+0xc)) # => eax 3d/compare-eax-and 0/imm32 0f 84/jump-if-equal $new-literal-integer:abort/disp32 - # var s/ecx : (address array byte) + # var s/ecx : (addr array byte) (slice-to-string Heap *(ebp+0xc)) # => eax 89/<- %ecx 0/r32/eax # @@ -2874,7 +2874,7 @@ $new-literal-integer:abort: cd/syscall 0x80/imm8 # never gets here -new-block: # ad: (address allocation-descriptor), data: (handle list statement) -> result/eax: (handle statement) +new-block: # ad: (addr allocation-descriptor), data: (handle list statement) -> result/eax: (handle statement) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -2894,7 +2894,7 @@ $new-block:end: 5d/pop-to-ebp c3/return -new-stmt: # ad: (address allocation-descriptor), operation: (address array byte), inouts: (handle list var), outputs: (handle list var) -> result/eax: (handle statement) +new-stmt: # ad: (addr allocation-descriptor), operation: (addr array byte), inouts: (handle list var), outputs: (handle list var) -> result/eax: (handle statement) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -2918,7 +2918,7 @@ $new-stmt:end: 5d/pop-to-ebp c3/return -new-vardef: # ad: (address allocation-descriptor), name: (address array byte), type: int -> result/eax: (handle statement) +new-vardef: # ad: (addr allocation-descriptor), name: (addr array byte), type: int -> result/eax: (handle statement) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -2940,7 +2940,7 @@ $new-vardef:end: 5d/pop-to-ebp c3/return -new-regvardef: # ad: (address allocation-descriptor), name: (address array byte), type: int, register: (address array byte) -> result/eax: (handle statement) +new-regvardef: # ad: (addr allocation-descriptor), name: (addr array byte), type: int, register: (addr array byte) -> result/eax: (handle statement) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -2964,7 +2964,7 @@ $new-regvardef:end: 5d/pop-to-ebp c3/return -new-named-block: # ad: (address allocation-descriptor), name: (address array byte), data: (handle list statement) -> result/eax: (handle statement) +new-named-block: # ad: (addr allocation-descriptor), name: (addr array byte), data: (handle list statement) -> result/eax: (handle statement) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -2986,7 +2986,7 @@ $new-named-block:end: 5d/pop-to-ebp c3/return -new-list: # ad: (address allocation-descriptor), value: _type, next: (handle list _type) -> result/eax : (handle list _type) +new-list: # ad: (addr allocation-descriptor), value: _type, next: (handle list _type) -> result/eax : (handle list _type) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -3006,7 +3006,7 @@ $new-list:end: 5d/pop-to-ebp c3/return -append-list: # ad: (address allocation-descriptor), value: _type, list: (handle list _type) -> result/eax : (handle list _type) +append-list: # ad: (addr allocation-descriptor), value: _type, list: (handle list _type) -> result/eax : (handle list _type) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -3042,7 +3042,7 @@ $append-list:end: 5d/pop-to-ebp c3/return -append-to-block: # ad: (address allocation-descriptor), block: (handle block), x: (handle stmt) +append-to-block: # ad: (addr allocation-descriptor), block: (handle block), x: (handle stmt) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -3075,7 +3075,7 @@ $check-mu-types:end: 5d/pop-to-ebp c3/return -size-of: # n : (address var) +size-of: # n : (addr var) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -3091,7 +3091,7 @@ $size-of:end: # Code-generation ####################################################### -emit-subx: # out : (address buffered-file) +emit-subx: # out : (addr buffered-file) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -3122,7 +3122,7 @@ $emit-subx:end: 5d/pop-to-ebp c3/return -emit-subx-function: # out : (address buffered-file), f : (handle function) +emit-subx-function: # out : (addr buffered-file), f : (handle function) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -3150,7 +3150,7 @@ $emit-subx-function:end: 5d/pop-to-ebp c3/return -emit-subx-block: # out : (address buffered-file), block : (handle block) +emit-subx-block: # out : (addr buffered-file), block : (handle block) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -3180,7 +3180,7 @@ $emit-subx-block:end: 5d/pop-to-ebp c3/return -emit-subx-statement: # out : (address buffered-file), stmt : (handle statement), primitives : (handle primitive), functions : (handle function) +emit-subx-statement: # out : (addr buffered-file), stmt : (handle statement), primitives : (handle primitive), functions : (handle function) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -3975,7 +3975,7 @@ Lit-var: 0/imm32/no-register == code -emit-subx-primitive: # out : (address buffered-file), stmt : (handle statement), primitive : (handle function) +emit-subx-primitive: # out : (addr buffered-file), stmt : (handle statement), primitive : (handle function) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -4001,7 +4001,7 @@ $emit-subx-primitive:end: 5d/pop-to-ebp c3/return -emit-subx-rm32: # out : (address buffered-file), l : arg-location, stmt : (handle statement) +emit-subx-rm32: # out : (addr buffered-file), l : arg-location, stmt : (handle statement) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -4081,7 +4081,7 @@ $get-stmt-operand-from-arg-location:abort: cd/syscall 0x80/imm8 # never gets here -emit-subx-r32: # out : (address buffered-file), l : arg-location, stmt : (handle statement) +emit-subx-r32: # out : (addr buffered-file), l : arg-location, stmt : (handle statement) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -4093,7 +4093,7 @@ emit-subx-r32: # out : (address buffered-file), l : arg-location, stmt : (handl 0f 84/jump-if-equal $emit-subx-r32:end/disp32 # (get-stmt-operand-from-arg-location *(ebp+0x10) *(ebp+0xc)) # stmt, l => var/eax - (maybe-get Registers *(eax+0x10) 8) # Var-register => eax : (address register-index) + (maybe-get Registers *(eax+0x10) 8) # Var-register => eax : (addr register-index) (write-buffered *(ebp+8) Space) (print-int32-buffered *(ebp+8) *eax) (write-buffered *(ebp+8) "/r32") @@ -4106,7 +4106,7 @@ $emit-subx-r32:end: 5d/pop-to-ebp c3/return -emit-subx-imm32: # out : (address buffered-file), l : arg-location, stmt : (handle statement) +emit-subx-imm32: # out : (addr buffered-file), l : arg-location, stmt : (handle statement) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -4130,7 +4130,7 @@ $emit-subx-imm32:end: 5d/pop-to-ebp c3/return -emit-subx-call: # out : (address buffered-file), stmt : (handle statement), callee : (handle function) +emit-subx-call: # out : (addr buffered-file), stmt : (handle statement), callee : (handle function) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -4167,7 +4167,7 @@ $emit-subx-call:end: 5d/pop-to-ebp c3/return -emit-subx-call-operand: # out : (address buffered-file), operand : (handle variable) +emit-subx-call-operand: # out : (addr buffered-file), operand : (handle variable) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -4193,7 +4193,7 @@ $emit-subx-call-operand:end: 5d/pop-to-ebp c3/return -emit-subx-var-as-rm32: # out : (address buffered-file), operand : (handle variable) +emit-subx-var-as-rm32: # out : (addr buffered-file), operand : (handle variable) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -4228,7 +4228,7 @@ $emit-subx-var-as-rm32:end: 5d/pop-to-ebp c3/return -find-matching-function: # functions : (address function), stmt : (handle statement) -> result/eax : (handle function) +find-matching-function: # functions : (addr function), stmt : (handle statement) -> result/eax : (handle function) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -5402,7 +5402,7 @@ test-emit-subx-statement-function-call-with-literal-arg: 5d/pop-to-ebp c3/return -emit-subx-prologue: # out : (address buffered-file) +emit-subx-prologue: # out : (addr buffered-file) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -5416,7 +5416,7 @@ $emit-subx-prologue:end: 5d/pop-to-ebp c3/return -emit-subx-epilogue: # out : (address buffered-file) +emit-subx-epilogue: # out : (addr buffered-file) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp diff --git a/apps/mulisp.subx b/apps/mulisp.subx index 1cfdeb03..d9fbb594 100644 --- a/apps/mulisp.subx +++ b/apps/mulisp.subx @@ -49,7 +49,7 @@ $main:end: # NIL NUM CHAR STRING SYMBOL PAIR ARRAY # memory type: a type specifying memory layout at the SubX level. Starts # with a '$'. -# $int $array $(address _) +# $int $array $(addr _) # # Lisp values are represented in memory by the _cell_ data structure. A cell # is 12 bytes long: @@ -63,18 +63,18 @@ $main:end: # - char: cell{ tag: 2/CHAR, data: $int 0 } # data contains the utf-8 code of the character (no compound glyphs, no # modifiers, etc., etc.) -# - string: cell{ tag: 3/STRING, data: $(address stream byte) -# data contains an (address array byte) containing the string in utf-8 -# - symbol: cell{ tag: 4/SYMBOL, data: $(address array byte) 0 } -# data contains an (address array byte) containing the name of the symbol in utf-8 +# - string: cell{ tag: 3/STRING, data: $(addr stream byte) +# data contains an (addr array byte) containing the string in utf-8 +# - symbol: cell{ tag: 4/SYMBOL, data: $(addr array byte) 0 } +# data contains an (addr array byte) containing the name of the symbol in utf-8 # alternatively, data could contain an index into the table of interned symbols -# - pair: cell{ tag: 5/PAIR, data: $(address cell) $(address cell) } +# - pair: cell{ tag: 5/PAIR, data: $(addr cell) $(addr cell) } # data contains pointers to car and cdr -# - array: cell{ tag: 6/ARRAY, data: $tag $(address stream data) +# - array: cell{ tag: 6/ARRAY, data: $tag $(addr stream data) # data contains a pointer to an array of 8-byte data fields and the common # tag for them all -repl: # in : (address buffered-file), out : (address buffered-file) +repl: # in : (addr buffered-file), out : (addr buffered-file) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -104,7 +104,7 @@ $repl:end: # arrays start with '[' # symbols start with anything else but quote, backquote, unquote or splice # only one s-expression per line -lisp-read: # in : (address buffered-file) -> eax : (handle cell) +lisp-read: # in : (addr buffered-file) -> eax : (handle cell) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -142,14 +142,14 @@ $lisp-read:end: 5d/pop-to-ebp c3/return -# lisp-read: in : (address buffered-file) -> (handle cell) +# lisp-read: in : (addr buffered-file) -> (handle cell) # token tmp = next-mulisp-token(in) # if is-int(tmp) return cell(tmp) # if is-string(tmp) return cell(tmp) # if is-pair(tmp) ... # if is-array(tmp) ... -next-mulisp-token: # in : (address buffered-file), line : (address stream byte), result : (address slice) +next-mulisp-token: # in : (addr buffered-file), line : (addr stream byte), result : (addr slice) # pseudocode: # if (line->read >= line->write) # read-line-buffered(in, line) @@ -194,11 +194,11 @@ $next-mulisp-token:end: 5d/pop-to-ebp c3/return -new-int-cell: # in : (address slice) -> eax : (handle cell) +new-int-cell: # in : (addr slice) -> eax : (handle cell) -new-string-cell: # in : (address slice) -> eax : (handle cell) +new-string-cell: # in : (addr slice) -> eax : (handle cell) -lisp-eval: # in : (address cell) -> eax : (handle cell) +lisp-eval: # in : (addr cell) -> eax : (handle cell) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -211,7 +211,7 @@ $lisp-eval:end: 5d/pop-to-ebp c3/return -lisp-print: # out : (address buffered-file), x : (address cell) +lisp-print: # out : (addr buffered-file), x : (addr cell) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp diff --git a/apps/pack.subx b/apps/pack.subx index df683f84..5d5d8033 100644 --- a/apps/pack.subx +++ b/apps/pack.subx @@ -97,7 +97,7 @@ $subx-pack-main:end: # next-token-from-slice(start, end, delim char) -> slice # slice-equal?(slice, string) -subx-pack: # in : (address buffered-file), out : (address buffered-file) +subx-pack: # in : (addr buffered-file), out : (addr buffered-file) # pseudocode: # var line : (ref stream byte 512) # var in-code? = false @@ -909,7 +909,7 @@ test-subx-pack-code-and-data-segments: 5d/pop-to-ebp c3/return -convert-data: # line : (address stream byte), out : (address buffered-file) +convert-data: # line : (addr stream byte), out : (addr buffered-file) # pseudocode: # var word-slice : (ref slice) # while true @@ -1029,7 +1029,7 @@ $convert-data:check0: 0f 85/jump-if-not-equal $convert-data:break/disp32 $convert-data:check-for-comment: # if (slice-starts-with?(word-slice, "#")) - # . var start/edx : (address byte) = word-slice->start + # . var start/edx : (addr byte) = word-slice->start 8b/copy 0/mod/indirect 1/rm32/ecx . . . 2/r32/edx . . # copy *ecx to edx # . var c/eax : byte = *start 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . . # clear eax @@ -1050,7 +1050,7 @@ $convert-data:comment: 0f 85/jump-if-not-equal $convert-data:end/disp32 $convert-data:check-for-label: # if (slice-ends-with?(word-slice, ":")) - # . var end/edx : (address byte) = word-slice->end + # . var end/edx : (addr byte) = word-slice->end 8b/copy 1/mod/*+disp8 1/rm32/ecx . . . 2/r32/edx 4/disp8 . # copy *(ecx+4) to edx # . var c/eax : byte = *(end-1) 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . . # clear eax @@ -1809,7 +1809,7 @@ test-convert-data-trailing-comment: # unceremoniously abort on non-numeric operands except disp or imm # opcodes must be lowercase and zero padded # opcodes with misleading operand metadata may get duplicated as operands as well. don't rely on this. -convert-instruction: # line : (address stream byte), out : (address buffered-file) +convert-instruction: # line : (addr stream byte), out : (addr buffered-file) # pseudocode: # # some early exits # var word-slice = next-word(line) @@ -1863,7 +1863,7 @@ $convert-instruction:check0: 75/jump-if-not-equal $convert-instruction:pass-through/disp8 $convert-instruction:check1: # if (slice-starts-with?(word-slice, "#")) write-stream-data(out, line) - # . var start/edx : (address byte) = word-slice->start + # . var start/edx : (addr byte) = word-slice->start 8b/copy 0/mod/indirect 1/rm32/ecx . . . 2/r32/edx . . # copy *ecx to edx # . var c/eax : byte = *start 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . . # clear eax @@ -1873,7 +1873,7 @@ $convert-instruction:check1: 74/jump-if-equal $convert-instruction:pass-through/disp8 $convert-instruction:check2: # if (slice-ends-with?(word-slice, ":")) write-stream-data(out, line) - # . var end/edx : (address byte) = word-slice->end + # . var end/edx : (addr byte) = word-slice->end 8b/copy 1/mod/*+disp8 1/rm32/ecx . . . 2/r32/edx 4/disp8 . # copy *(ecx+4) to edx # . var c/eax : byte = *(end-1) 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . . # clear eax @@ -1953,7 +1953,7 @@ $convert-instruction:end: 5d/pop-to-ebp c3/return -emit-opcodes: # line : (address stream byte), out : (address buffered-file) +emit-opcodes: # line : (addr stream byte), out : (addr buffered-file) # opcodes occupy 1-3 bytes: # xx # 0f xx @@ -2030,7 +2030,7 @@ $emit-opcodes:op1: 3d/compare-eax-and 0/imm32/false 0f 85/jump-if-not-equal $emit-opcodes:end/disp32 # if (slice-starts-with?(op1, "#")) return - # . var start/ebx : (address byte) = op1->start + # . var start/ebx : (addr byte) = op1->start 8b/copy 0/mod/indirect 1/rm32/ecx . . . 3/r32/ebx . . # copy *ecx to ebx # . var c/eax : byte = *start 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . . # clear eax @@ -2123,7 +2123,7 @@ $emit-opcodes:op2: 3d/compare-eax-and 0/imm32/false 0f 85/jump-if-not-equal $emit-opcodes:end/disp32 # if (slice-starts-with?(op2, "#")) return - # . var start/ebx : (address byte) = op2->start + # . var start/ebx : (addr byte) = op2->start 8b/copy 0/mod/indirect 2/rm32/edx . . . 3/r32/ebx . . # copy *edx to ebx # . var c/eax : byte = *start 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . . # clear eax @@ -2202,7 +2202,7 @@ $emit-opcodes:op3: 3d/compare-eax-and 0/imm32/false 0f 85/jump-if-not-equal $emit-opcodes:end/disp32 # if (slice-starts-with?(op3, "#")) return - # . var start/ebx : (address byte) = op2->start + # . var start/ebx : (addr byte) = op2->start 8b/copy 0/mod/indirect 2/rm32/edx . . . 3/r32/ebx . . # copy *edx to ebx # . var c/eax : byte = *start 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . . # clear eax @@ -2249,7 +2249,7 @@ $emit-opcodes:end: 5d/pop-to-ebp c3/return -emit-modrm: # line : (address stream byte), out : (address buffered-file) +emit-modrm: # line : (addr stream byte), out : (addr buffered-file) # pseudocode: # rewind-stream(line) # var has-modrm? = false, mod = 0, rm32 = 0, r32 = 0 @@ -2402,7 +2402,7 @@ $emit-modrm:check1: # if (slice-starts-with?(word-slice, "#")) break # . spill edx 52/push-edx - # . var start/edx : (address byte) = word-slice->start + # . var start/edx : (addr byte) = word-slice->start 8b/copy 0/mod/indirect 1/rm32/ecx . . . 2/r32/edx . . # copy *ecx to edx # . var c/eax : byte = *start 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . . # clear eax @@ -2566,7 +2566,7 @@ $emit-modrm:end: 5d/pop-to-ebp c3/return -emit-sib: # line : (address stream byte), out : (address buffered-file) +emit-sib: # line : (addr stream byte), out : (addr buffered-file) # pseudocode: # var has-sib? = false, base = 0, index = 0, scale = 0 # var word-slice : (ref slice) @@ -2711,7 +2711,7 @@ $emit-sib:check1: # if (slice-starts-with?(word-slice, "#")) break # . spill edx 52/push-edx - # . var start/edx : (address byte) = word-slice->start + # . var start/edx : (addr byte) = word-slice->start 8b/copy 0/mod/indirect 1/rm32/ecx . . . 2/r32/edx . . # copy *ecx to edx # . var c/eax : byte = *start 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . . # clear eax @@ -2847,7 +2847,7 @@ $emit-sib:end: 5d/pop-to-ebp c3/return -emit-disp: # line : (address stream byte), out : (address buffered-file) +emit-disp: # line : (addr stream byte), out : (addr buffered-file) # pseudocode: # rewind-stream(line) # var word-slice : (ref slice) @@ -2972,7 +2972,7 @@ $emit-disp:check0: 0f 85/jump-if-not-equal $emit-disp:break/disp32 $emit-disp:check1: # if (slice-starts-with?(word-slice, "#")) break - # . var start/edx : (address byte) = word-slice->start + # . var start/edx : (addr byte) = word-slice->start 8b/copy 0/mod/indirect 1/rm32/ecx . . . 2/r32/edx . . # copy *ecx to edx # . var c/eax : byte = *start 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . . # clear eax @@ -3066,7 +3066,7 @@ $emit-disp:break: 5d/pop-to-ebp c3/return -emit-imm: # line : (address stream byte), out : (address buffered-file) +emit-imm: # line : (addr stream byte), out : (addr buffered-file) # pseudocode: # rewind-stream(line) # var word-slice : (ref slice) @@ -3191,7 +3191,7 @@ $emit-imm:check0: 0f 85/jump-if-not-equal $emit-imm:break/disp32 $emit-imm:check1: # if (slice-starts-with?(word-slice, "#")) break - # . var start/edx : (address byte) = slice->start + # . var start/edx : (addr byte) = slice->start 8b/copy 0/mod/indirect 1/rm32/ecx . . . 2/r32/edx . . # copy *ecx to edx # . var c/eax : byte = *start 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . . # clear eax @@ -3285,7 +3285,7 @@ $emit-imm:break: 5d/pop-to-ebp c3/return -emit-line-in-comment: # line : (address stream byte), out : (address buffered-file) +emit-line-in-comment: # line : (addr stream byte), out : (addr buffered-file) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -5837,7 +5837,7 @@ test-convert-instruction-handles-imm8-operand: c3/return # shortcut for parse-hex-int(next-token-from-slice(word->start, word->end, '/')) -parse-datum-of-word: # word : (address slice) -> value/eax : int +parse-datum-of-word: # word : (addr slice) -> value/eax : int # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp diff --git a/apps/sigils.subx b/apps/sigils.subx index a22aee44..485463d7 100644 --- a/apps/sigils.subx +++ b/apps/sigils.subx @@ -104,7 +104,7 @@ $subx-sigils-main:end: # error messages considered: # *x + 34 -> error: base+disp addressing must be within '()' -subx-sigils: # in : (address buffered-file), out : (address buffered-file) +subx-sigils: # in : (addr buffered-file), out : (addr buffered-file) # pseudocode: # var line : (stream byte 512) # while true @@ -1359,7 +1359,7 @@ test-subx-sigils-indirect-mode-without-register: 5d/pop-to-ebp c3/return -emit-direct-mode: # out : (address buffered-file), word-slice : (address slice) +emit-direct-mode: # out : (addr buffered-file), word-slice : (addr slice) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -1599,7 +1599,7 @@ test-emit-direct-mode-2: # error messages considered: # * ... -> error: no space after '*' # *(... -> error: *(...) expression must be all on a single line -next-word-or-expression: # line : (address stream byte), out : (address slice) +next-word-or-expression: # line : (addr stream byte), out : (addr slice) # pseudocode: # skip-chars-matching(line, ' ') # if line->read >= line->write # end of line @@ -2207,7 +2207,7 @@ test-next-word-or-expression-returns-whole-expression: # *(reg1+reg2<<s+disp) -> 2/mod 4/rm32 reg1/base reg2/index s/scale disp/disp32 # Intermediate structure: base, index, scale, disp # Default values: base: 0, index: 4 (none), scale: 0, disp: 0 -parse-effective-address: # word-slice : (address slice) -> base/eax, index/ecx, scale/edx, disp/ebx +parse-effective-address: # word-slice : (addr slice) -> base/eax, index/ecx, scale/edx, disp/ebx # pseudocode: # var local-slice = {word-slice->start, word-slice->end} # ++local-slice->start to skip '*' @@ -2670,7 +2670,7 @@ $parse-effective-address:error4: # assumes 'in' starts with a register name, and returns pointer to its code # side-effect: modifies 'in' to scan past the initial register name -next-register: # in : (address slice) -> reg/eax : int +next-register: # in : (addr slice) -> reg/eax : int # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -3149,7 +3149,7 @@ test-parse-effective-address-base-index-scale-displacement: # if index is none, then mod = 2 and rm32 = base and disp32 = disp # emit-sib: # if index is not none, then mod = 2 and rm32 = 4 and base = base and index = index and disp32 = disp -emit-indirect-mode: # out : (address buffered-file), base : int, index : int, scale : int, disp : int +emit-indirect-mode: # out : (addr buffered-file), base : int, index : int, scale : int, disp : int # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -3858,7 +3858,7 @@ test-emit-indirect-mode-esp: 5d/pop-to-ebp c3/return -disp32-mode?: # in : (address slice) -> reg/eax : boolean +disp32-mode?: # in : (addr slice) -> reg/eax : boolean # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -3917,7 +3917,7 @@ $disp32-mode?:end: 5d/pop-to-ebp c3/return -emit-indirect-disp32: # out : (address buffered-file), word-slice : (address slice) +emit-indirect-disp32: # out : (addr buffered-file), word-slice : (addr slice) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -3967,7 +3967,7 @@ $emit-indirect-disp32:end: # assumes 'in' starts with optional '+' or '-', optional whitespace, and an unsigned integer # returns the value of the integer # side-effect: modifies 'in' to skip past the integer -next-hex-int: # in : (address slice) -> result/eax +next-hex-int: # in : (addr slice) -> result/eax # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -4382,7 +4382,7 @@ test-next-hex-int-negative-with-space: # assumes 'in' starts a positive unsigned integer # returns the value of the integer # side-effect: modifies 'in' to skip past the integer -next-positive-hex-int: # in : (address slice) -> result/eax +next-positive-hex-int: # in : (addr slice) -> result/eax # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp diff --git a/apps/survey.subx b/apps/survey.subx index e365ac1b..7983e6c5 100644 --- a/apps/survey.subx +++ b/apps/survey.subx @@ -107,13 +107,13 @@ $subx-survey-main:end: cd/syscall 0x80/imm8 # data structures: -# segment-info: {address, file-offset, size} (12 bytes) -# segments: (address stream {string, segment-info}) (16 bytes per row) -# label-info: {segment-name, segment-offset, address} (12 bytes) -# labels: (address stream {string, label-info}) (16 bytes per row) +# segment-info: {addr, file-offset, size} (12 bytes) +# segments: (addr stream {string, segment-info}) (16 bytes per row) +# label-info: {segment-name, segment-offset, addr} (12 bytes) +# labels: (addr stream {string, label-info}) (16 bytes per row) # these are all inefficient; use sequential scans for lookups -subx-survey: # infile : (address buffered-file), out : (address buffered-file) +subx-survey: # infile : (addr buffered-file), out : (addr buffered-file) # pseudocode # var in : (ref stream byte 4096) # slurp(infile, in) @@ -618,7 +618,7 @@ compute-offsets:segment-tmp: # slice == code -compute-offsets: # in : (address stream byte), segments : (address stream {string, segment-info}), labels : (address stream {string, label-info}) +compute-offsets: # in : (addr stream byte), segments : (addr stream {string, segment-info}), labels : (addr stream {string, label-info}) # skeleton: # for lines in 'in' # for words in line @@ -629,7 +629,7 @@ compute-offsets: # in : (address stream byte), segments : (address stream {stri # default # # pseudocode: - # curr-segment-name : (address string) = 0 + # curr-segment-name : (addr string) = 0 # var line : (stream byte 512) # while true # line loop # clear-stream(line) @@ -661,7 +661,7 @@ compute-offsets: # in : (address stream byte), segments : (address stream {stri # break (next line) # else if is-label?(word-slice) # strip trailing ':' from word-slice - # x : (address label-info) = get-or-insert(labels, name) + # x : (addr label-info) = get-or-insert(labels, name) # x->segment-name = curr-segment-name # trace("label '", word-slice, "' is in segment '", curr-segment-name, "'.") # x->segment-offset = segment-offset @@ -1378,9 +1378,9 @@ test-compute-offsets: 5d/pop-to-ebp c3/return -compute-addresses: # segments : (address stream {string, segment-info}), labels : (address stream {string, label-info}) +compute-addresses: # segments : (addr stream {string, segment-info}), labels : (addr stream {string, label-info}) # pseudocode: - # srow : (address segment-info) = segments->data + # srow : (addr segment-info) = segments->data # max = &segments->data[segments->write] # num-segments = segments->write / 16 # starting-offset = 0x34 + (num-segments * 0x20) @@ -1391,12 +1391,12 @@ compute-addresses: # segments : (address stream {string, segment-info}), labels # s->address += (s->file-offset & 0x00000fff) # trace-sssns("segment " s->key " starts at address " s->address) # srow += 16 # row-size - # lrow : (address label-info) = labels->data + # lrow : (addr label-info) = labels->data # max = &labels->data[labels->write] # while true # if (lrow >= max) break - # seg-name : (address string) = lrow->segment-name - # label-seg : (address segment-info) = get(segments, seg-name) + # seg-name : (addr string) = lrow->segment-name + # label-seg : (addr segment-info) = get(segments, seg-name) # lrow->address = label-seg->address + lrow->segment-offset # trace-sssns("label " lrow->key " is at address " lrow->address) # lrow += 16 # row-size @@ -1550,7 +1550,7 @@ $compute-addresses:label-loop: #? # . . discard args #? 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp #? # }}} - # label-seg/edx : (address segment-info) = get(segments, seg-name, row-size=16, "segment table") + # label-seg/edx : (addr segment-info) = get(segments, seg-name, row-size=16, "segment table") # . save eax 50/push-eax # . eax = get(segments, seg-name, row-size=16) @@ -1871,7 +1871,7 @@ test-compute-addresses-large-segments: 5d/pop-to-ebp c3/return -emit-output: # in : (address stream byte), out : (address buffered-file), segments : (address stream {string, segment-info}), labels : (address stream {string, label-info}) +emit-output: # in : (addr stream byte), out : (addr buffered-file), segments : (addr stream {string, segment-info}), labels : (addr stream {string, label-info}) # pseudocode: # emit-headers(out, segments, labels) # emit-segments(in, out, segments, labels) @@ -1922,7 +1922,7 @@ $emit-output:end: 5d/pop-to-ebp c3/return -emit-segments: # in : (address stream byte), out : (address buffered-file), segments : (address stream {string, segment-info}), labels : (address stream {string, label-info}) +emit-segments: # in : (addr stream byte), out : (addr buffered-file), segments : (addr stream {string, segment-info}), labels : (addr stream {string, label-info}) # pseudocode: # var offset-of-next-instruction = 0 # var line : (stream byte 512) @@ -3173,7 +3173,7 @@ test-emit-segments-code-label-absolute: 5d/pop-to-ebp c3/return -emit-headers: # out : (address buffered-file), segments : (address stream {string, segment-info}), labels : (address stream {string, label-info}) +emit-headers: # out : (addr buffered-file), segments : (addr stream {string, segment-info}), labels : (addr stream {string, label-info}) # pseudocode: # emit-elf-header(out, segments, labels) # curr-segment = segments->data @@ -3311,7 +3311,7 @@ $emit-headers:end: 5d/pop-to-ebp c3/return -emit-elf-header: # out : (address buffered-file), segments : (address stream {string, segment-info}), labels : (address stream {string, label-info}) +emit-elf-header: # out : (addr buffered-file), segments : (addr stream {string, segment-info}), labels : (addr stream {string, label-info}) # pseudocode # *$Elf_e_entry = get(labels, "Entry")->address # *$Elf_e_phnum = segments->write / 16 # size of a row @@ -3379,7 +3379,7 @@ $emit-elf-header:end: 5d/pop-to-ebp c3/return -emit-elf-program-header-entry: # out : (address buffered-file), curr-segment : (address {string, segment-info}) +emit-elf-program-header-entry: # out : (addr buffered-file), curr-segment : (addr {string, segment-info}) # pseudocode: # *$Elf_p_offset = curr-segment->file-offset # *$Elf_p_vaddr = curr-segment->address @@ -3468,7 +3468,7 @@ $emit-elf-program-header-entry:end: # - some helpers for tests -stream-add4: # in : (address stream byte), key : address, val1 : address, val2 : address, val3 : address +stream-add4: # in : (addr stream byte), key : addr, val1 : addr, val2 : addr, val3 : addr # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -3550,11 +3550,11 @@ $stream-add4:abort: # some variants of 'trace' that take multiple arguments in different combinations of types: # n: int # c: character [4-bytes, will eventually be UTF-8] -# s: (address string) -# l: (address slice) +# s: (addr string) +# l: (addr slice) # one gotcha: 's5' must not be empty -trace-sssns: # s1 : (address string), s2 : (address string), s3 : (address string), n4 : int, s5 : (address string) +trace-sssns: # s1 : (addr string), s2 : (addr string), s3 : (addr string), n4 : int, s5 : (addr string) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -3661,7 +3661,7 @@ test-trace-sssns: 5d/pop-to-ebp c3/return -trace-snsns: # s1 : (address string), n2 : int, s3 : (address string), n4 : int, s5 : (address string) +trace-snsns: # s1 : (addr string), n2 : int, s3 : (addr string), n4 : int, s5 : (addr string) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -3768,7 +3768,7 @@ test-trace-snsns: 5d/pop-to-ebp c3/return -trace-slsls: # s1 : (address string), l2 : (address slice), s3 : (address string), l4 : (address slice), s5 : (address string) +trace-slsls: # s1 : (addr string), l2 : (addr slice), s3 : (addr string), l4 : (addr slice), s5 : (addr string) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -3893,7 +3893,7 @@ test-trace-slsls: 5d/pop-to-ebp c3/return -trace-slsns: # s1 : (address string), l2 : (address slice), s3 : (address string), n4 : int, s5 : (address string) +trace-slsns: # s1 : (addr string), l2 : (addr slice), s3 : (addr string), n4 : int, s5 : (addr string) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -4009,7 +4009,7 @@ test-trace-slsns: 5d/pop-to-ebp c3/return -trace-slsss: # s1 : (address string), l2 : (address slice), s3 : (address string), s4 : (address string), s5 : (address string) +trace-slsss: # s1 : (addr string), l2 : (addr slice), s3 : (addr string), s4 : (addr string), s5 : (addr string) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -4125,7 +4125,7 @@ test-trace-slsss: 5d/pop-to-ebp c3/return -num-bytes: # line : (address stream byte) -> eax : int +num-bytes: # line : (addr stream byte) -> eax : int # pseudocode: # result = 0 # while true diff --git a/apps/tests.subx b/apps/tests.subx index 1d00cf30..2cef958b 100644 --- a/apps/tests.subx +++ b/apps/tests.subx @@ -67,7 +67,7 @@ $subx-tests-main:end: b8/copy-to-eax 1/imm32/exit cd/syscall 0x80/imm8 -subx-gen-run-tests: # in : (address buffered-file), out : (address buffered-file) +subx-gen-run-tests: # in : (addr buffered-file), out : (addr buffered-file) # pseudocode # bool tests-found = false # var line : (stream byte 512) diff --git a/html/050_write.subx.html b/html/050_write.subx.html index c12ebd44..d676e839 100644 --- a/html/050_write.subx.html +++ b/html/050_write.subx.html @@ -93,7 +93,7 @@ if ('onhashchange' in window) { <span id="L34" class="LineNr">34 </span><span class="subxComment"># You can convert a ref or handle to an address, but not the other way around.</span> <span id="L35" class="LineNr">35 </span><span class="subxComment"># You can convert addresses to ints, but not the other way around.</span> <span id="L36" class="LineNr">36 </span> -<span id="L37" class="LineNr">37 </span><span class="subxMinorFunction">_write</span>: <span class="subxComment"># fd : int, s : (address array byte)</span> +<span id="L37" class="LineNr">37 </span><span class="subxMinorFunction">_write</span>: <span class="subxComment"># fd : int, s : (addr array byte)</span> <span id="L38" class="LineNr">38 </span> <span class="subxS1Comment"># . prologue</span> <span id="L39" class="LineNr">39 </span> 55/push-ebp <span id="L40" class="LineNr">40 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> diff --git a/html/051test.subx.html b/html/051test.subx.html index 3ea121ab..2ea337aa 100644 --- a/html/051test.subx.html +++ b/html/051test.subx.html @@ -80,7 +80,7 @@ if ('onhashchange' in window) { <span id="L21" class="LineNr"> 21 </span> cd/syscall 0x80/imm8 <span id="L22" class="LineNr"> 22 </span> <span id="L23" class="LineNr"> 23 </span><span class="subxComment"># print msg to stderr if a != b, otherwise print "."</span> -<span id="L24" class="LineNr"> 24 </span><span class="subxFunction">check-ints-equal</span>: <span class="subxComment"># a : int, b : int, msg : (address array byte)</span> +<span id="L24" class="LineNr"> 24 </span><span class="subxFunction">check-ints-equal</span>: <span class="subxComment"># a : int, b : int, msg : (addr array byte)</span> <span id="L25" class="LineNr"> 25 </span> <span class="subxS1Comment"># . prologue</span> <span id="L26" class="LineNr"> 26 </span> 55/push-ebp <span id="L27" class="LineNr"> 27 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> diff --git a/html/052kernel-string-equal.subx.html b/html/052kernel-string-equal.subx.html index 8a2dc15e..f7818771 100644 --- a/html/052kernel-string-equal.subx.html +++ b/html/052kernel-string-equal.subx.html @@ -92,7 +92,7 @@ if ('onhashchange' in window) { <span id="L30" class="LineNr"> 30 </span> <span id="L31" class="LineNr"> 31 </span><span class="subxComment"># compare a null-terminated ascii string with a more idiomatic length-prefixed byte array</span> <span id="L32" class="LineNr"> 32 </span><span class="subxComment"># reason for the name: the only place we should have null-terminated ascii strings is from commandline args</span> -<span id="L33" class="LineNr"> 33 </span><span class="subxFunction">kernel-string-equal?</span>: <span class="subxComment"># s : (address kernel-string), benchmark : (address array byte) -> eax : boolean</span> +<span id="L33" class="LineNr"> 33 </span><span class="subxFunction">kernel-string-equal?</span>: <span class="subxComment"># s : (addr kernel-string), benchmark : (addr array byte) -> eax : boolean</span> <span id="L34" class="LineNr"> 34 </span> <span class="subxComment"># pseudocode:</span> <span id="L35" class="LineNr"> 35 </span> <span class="subxComment"># n = benchmark->length</span> <span id="L36" class="LineNr"> 36 </span> <span class="subxComment"># s1 = s</span> @@ -123,12 +123,12 @@ if ('onhashchange' in window) { <span id="L61" class="LineNr"> 61 </span> 53/push-ebx <span id="L62" class="LineNr"> 62 </span> 56/push-esi <span id="L63" class="LineNr"> 63 </span> 57/push-edi -<span id="L64" class="LineNr"> 64 </span> <span class="subxComment"># var s1/edi : (address byte) = s</span> +<span id="L64" class="LineNr"> 64 </span> <span class="subxComment"># var s1/edi : (addr byte) = s</span> <span id="L65" class="LineNr"> 65 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 7/r32/edi 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to edi</span> <span id="L66" class="LineNr"> 66 </span> <span class="subxComment"># var n/edx : int = benchmark->length</span> <span id="L67" class="LineNr"> 67 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+12) to edx</span> <span id="L68" class="LineNr"> 68 </span> 8b/copy 0/mod/indirect 2/rm32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *edx to edx</span> -<span id="L69" class="LineNr"> 69 </span> <span class="subxComment"># var s2/esi : (address byte) = benchmark->data</span> +<span id="L69" class="LineNr"> 69 </span> <span class="subxComment"># var s2/esi : (addr byte) = benchmark->data</span> <span id="L70" class="LineNr"> 70 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+12) to esi</span> <span id="L71" class="LineNr"> 71 </span> 81 0/subop/add 3/mod/direct 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esi</span> <span id="L72" class="LineNr"> 72 </span> <span class="subxComment"># var i/ecx : int = 0</span> @@ -324,10 +324,10 @@ if ('onhashchange' in window) { <span id="L262" class="LineNr">262 </span> <span id="L263" class="LineNr">263 </span>== data <span id="L264" class="LineNr">264 </span> -<span id="L265" class="LineNr">265 </span><span class="SpecialChar">Null-kernel-string</span>: <span class="subxComment"># (address kernel-string)</span> +<span id="L265" class="LineNr">265 </span><span class="SpecialChar">Null-kernel-string</span>: <span class="subxComment"># (addr kernel-string)</span> <span id="L266" class="LineNr">266 </span> 00/null <span id="L267" class="LineNr">267 </span> -<span id="L268" class="LineNr">268 </span><span class="subxMinorFunction">_test-Abc-kernel-string</span>: <span class="subxComment"># (address kernel-string)</span> +<span id="L268" class="LineNr">268 </span><span class="subxMinorFunction">_test-Abc-kernel-string</span>: <span class="subxComment"># (addr kernel-string)</span> <span id="L269" class="LineNr">269 </span> 41/A 62/b 63/c 00/null <span id="L270" class="LineNr">270 </span> <span id="L271" class="LineNr">271 </span><span class="subxS2Comment"># . . vim:nowrap:textwidth=0</span> diff --git a/html/053new-segment.subx.html b/html/053new-segment.subx.html index 142f7fda..6197950c 100644 --- a/html/053new-segment.subx.html +++ b/html/053new-segment.subx.html @@ -89,7 +89,7 @@ if ('onhashchange' in window) { <span id="L29" class="LineNr">29 </span> e8/call <a href='053new-segment.subx.html#L41'>new-segment</a>/disp32 <span id="L30" class="LineNr">30 </span> <span class="subxS2Comment"># . . discard args</span> <span id="L31" class="LineNr">31 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span> -<span id="L32" class="LineNr">32 </span> <span class="subxComment"># var eax : (address _) = ad->curr</span> +<span id="L32" class="LineNr">32 </span> <span class="subxComment"># var eax : (addr _) = ad->curr</span> <span id="L33" class="LineNr">33 </span> 8b/copy 0/mod/indirect 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *ecx to eax</span> <span id="L34" class="LineNr">34 </span> <span class="subxComment"># write to *eax to check that we have access to the newly-allocated segment</span> <span id="L35" class="LineNr">35 </span> c7 0/subop/copy 0/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x34/imm32 <span class="subxComment"># copy to *eax</span> diff --git a/html/054string-equal.subx.html b/html/054string-equal.subx.html index b79a5cd8..027d9c6c 100644 --- a/html/054string-equal.subx.html +++ b/html/054string-equal.subx.html @@ -75,7 +75,7 @@ if ('onhashchange' in window) { <span id="L13" class="LineNr"> 13 </span> b8/copy-to-eax 1/imm32/exit <span id="L14" class="LineNr"> 14 </span> cd/syscall 0x80/imm8 <span id="L15" class="LineNr"> 15 </span> -<span id="L16" class="LineNr"> 16 </span><span class="subxFunction">string-equal?</span>: <span class="subxComment"># s : (address array byte), benchmark : (address array byte) -> eax : boolean</span> +<span id="L16" class="LineNr"> 16 </span><span class="subxFunction">string-equal?</span>: <span class="subxComment"># s : (addr array byte), benchmark : (addr array byte) -> eax : boolean</span> <span id="L17" class="LineNr"> 17 </span> <span class="subxComment"># pseudocode:</span> <span id="L18" class="LineNr"> 18 </span> <span class="subxComment"># if (s->length != benchmark->length) return false</span> <span id="L19" class="LineNr"> 19 </span> <span class="subxComment"># currs = s->data</span> @@ -113,11 +113,11 @@ if ('onhashchange' in window) { <span id="L51" class="LineNr"> 51 </span> <span class="subxComment"># if (ecx != benchmark->length) return false</span> <span id="L52" class="LineNr"> 52 </span> 39/compare 0/mod/indirect 7/rm32/edi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># compare *edi and ecx</span> <span id="L53" class="LineNr"> 53 </span> 75/jump-if-not-equal $string-equal?:false/disp8 -<span id="L54" class="LineNr"> 54 </span> <span class="subxComment"># var currs/esi : (address byte) = s->data</span> +<span id="L54" class="LineNr"> 54 </span> <span class="subxComment"># var currs/esi : (addr byte) = s->data</span> <span id="L55" class="LineNr"> 55 </span> 81 0/subop/add 3/mod/direct 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esi</span> -<span id="L56" class="LineNr"> 56 </span> <span class="subxComment"># var maxs/ecx : (address byte) = &s->data[s->length]</span> +<span id="L56" class="LineNr"> 56 </span> <span class="subxComment"># var maxs/ecx : (addr byte) = &s->data[s->length]</span> <span id="L57" class="LineNr"> 57 </span> 01/add 3/mod/direct 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># add esi to ecx</span> -<span id="L58" class="LineNr"> 58 </span> <span class="subxComment"># var currb/edi : (address byte) = benchmark->data</span> +<span id="L58" class="LineNr"> 58 </span> <span class="subxComment"># var currb/edi : (addr byte) = benchmark->data</span> <span id="L59" class="LineNr"> 59 </span> 81 0/subop/add 3/mod/direct 7/rm32/edi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to edi</span> <span id="L60" class="LineNr"> 60 </span> <span class="subxComment"># var c1/eax : byte = 0</span> <span id="L61" class="LineNr"> 61 </span> 31/xor 3/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># clear eax</span> @@ -238,7 +238,7 @@ if ('onhashchange' in window) { <span id="L176" class="LineNr">176 </span> c3/return <span id="L177" class="LineNr">177 </span> <span id="L178" class="LineNr">178 </span><span class="subxComment"># helper for later tests</span> -<span id="L179" class="LineNr">179 </span><span class="subxFunction">check-strings-equal</span>: <span class="subxComment"># s : (address array byte), expected : (address array byte), msg : (address array byte)</span> +<span id="L179" class="LineNr">179 </span><span class="subxFunction">check-strings-equal</span>: <span class="subxComment"># s : (addr array byte), expected : (addr array byte), msg : (addr array byte)</span> <span id="L180" class="LineNr">180 </span> <span class="subxS1Comment"># . prologue</span> <span id="L181" class="LineNr">181 </span> 55/push-ebp <span id="L182" class="LineNr">182 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> diff --git a/html/055stream.subx.html b/html/055stream.subx.html index 1aa67979..e4d5b8fb 100644 --- a/html/055stream.subx.html +++ b/html/055stream.subx.html @@ -72,7 +72,7 @@ if ('onhashchange' in window) { <span id="L14" class="LineNr">14 </span><span class="subxS1Comment"># . op subop mod rm32 base index scale r32</span> <span id="L15" class="LineNr">15 </span><span class="subxS1Comment"># . 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</span> <span id="L16" class="LineNr">16 </span> -<span id="L17" class="LineNr">17 </span><span class="subxFunction">clear-stream</span>: <span class="subxComment"># f : (address stream byte)</span> +<span id="L17" class="LineNr">17 </span><span class="subxFunction">clear-stream</span>: <span class="subxComment"># f : (addr stream byte)</span> <span id="L18" class="LineNr">18 </span> <span class="subxS1Comment"># . prologue</span> <span id="L19" class="LineNr">19 </span> 55/push-ebp <span id="L20" class="LineNr">20 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -83,13 +83,13 @@ if ('onhashchange' in window) { <span id="L25" class="LineNr">25 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to eax</span> <span id="L26" class="LineNr">26 </span> <span class="subxComment"># var count/ecx : int = f->length</span> <span id="L27" class="LineNr">27 </span> 8b/copy 1/mod/*+disp8 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(eax+8) to ecx</span> -<span id="L28" class="LineNr">28 </span> <span class="subxComment"># var max/ecx : (address byte) = &f->data[f->length]</span> +<span id="L28" class="LineNr">28 </span> <span class="subxComment"># var max/ecx : (addr byte) = &f->data[f->length]</span> <span id="L29" class="LineNr">29 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx <span class="Normal"> . </span> 1/r32/ecx 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy eax+ecx+12 to ecx</span> <span id="L30" class="LineNr">30 </span> <span class="subxComment"># f->write = 0</span> <span id="L31" class="LineNr">31 </span> c7 0/subop/copy 0/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/imm32 <span class="subxComment"># copy to *eax</span> <span id="L32" class="LineNr">32 </span> <span class="subxComment"># f->read = 0</span> <span id="L33" class="LineNr">33 </span> c7 0/subop/copy 1/mod/*+disp8 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/disp8 0/imm32 <span class="subxComment"># copy to *(eax+4)</span> -<span id="L34" class="LineNr">34 </span> <span class="subxComment"># var curr/eax : (address byte) = f->data</span> +<span id="L34" class="LineNr">34 </span> <span class="subxComment"># var curr/eax : (addr byte) = f->data</span> <span id="L35" class="LineNr">35 </span> 81 0/subop/add 3/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to eax</span> <span id="L36" class="LineNr">36 </span><span class="Constant">$clear-stream:loop</span>: <span id="L37" class="LineNr">37 </span> <span class="subxComment"># if (curr >= max) break</span> @@ -109,7 +109,7 @@ if ('onhashchange' in window) { <span id="L51" class="LineNr">51 </span> 5d/pop-to-ebp <span id="L52" class="LineNr">52 </span> c3/return <span id="L53" class="LineNr">53 </span> -<span id="L54" class="LineNr">54 </span><span class="subxFunction">rewind-stream</span>: <span class="subxComment"># f : (address stream byte)</span> +<span id="L54" class="LineNr">54 </span><span class="subxFunction">rewind-stream</span>: <span class="subxComment"># f : (addr stream byte)</span> <span id="L55" class="LineNr">55 </span> <span class="subxS1Comment"># . prologue</span> <span id="L56" class="LineNr">56 </span> 55/push-ebp <span id="L57" class="LineNr">57 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> diff --git a/html/056trace.subx.html b/html/056trace.subx.html index 7673a059..c11be5ae 100644 --- a/html/056trace.subx.html +++ b/html/056trace.subx.html @@ -142,7 +142,7 @@ if ('onhashchange' in window) { <span id="L79" class="LineNr"> 79 </span> <span id="L80" class="LineNr"> 80 </span><span class="subxComment"># Append a string to the given trace stream.</span> <span id="L81" class="LineNr"> 81 </span><span class="subxComment"># Silently give up if it's already full. Or truncate the string if there isn't enough room.</span> -<span id="L82" class="LineNr"> 82 </span><span class="subxFunction">trace</span>: <span class="subxComment"># line : (address array byte)</span> +<span id="L82" class="LineNr"> 82 </span><span class="subxFunction">trace</span>: <span class="subxComment"># line : (addr array byte)</span> <span id="L83" class="LineNr"> 83 </span> <span class="subxS1Comment"># . prologue</span> <span id="L84" class="LineNr"> 84 </span> 55/push-ebp <span id="L85" class="LineNr"> 85 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -153,7 +153,7 @@ if ('onhashchange' in window) { <span id="L90" class="LineNr"> 90 </span> 53/push-ebx <span id="L91" class="LineNr"> 91 </span> 56/push-esi <span id="L92" class="LineNr"> 92 </span> 57/push-edi -<span id="L93" class="LineNr"> 93 </span> <span class="subxComment"># var edi : (address stream byte) = *Trace-stream</span> +<span id="L93" class="LineNr"> 93 </span> <span class="subxComment"># var edi : (addr stream byte) = *Trace-stream</span> <span id="L94" class="LineNr"> 94 </span> 8b/copy 0/mod/indirect 5/rm32/.disp32 <span class="Normal"> . </span> <span class="Normal"> . </span> 7/r32/edi <span class="SpecialChar"><a href='056trace.subx.html#L17'>Trace-stream</a></span>/disp32 <span class="subxComment"># copy *Trace-stream to edi</span> <span id="L95" class="LineNr"> 95 </span> <span class="subxComment"># esi = line</span> <span id="L96" class="LineNr"> 96 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to esi</span> @@ -309,7 +309,7 @@ if ('onhashchange' in window) { <span id="L246" class="LineNr">246 </span> <span class="subxComment"># end</span> <span id="L247" class="LineNr">247 </span> c3/return <span id="L248" class="LineNr">248 </span> -<span id="L249" class="LineNr">249 </span><span class="subxFunction">check-trace-contains</span>: <span class="subxComment"># line : (address string), msg : (address string)</span> +<span id="L249" class="LineNr">249 </span><span class="subxFunction">check-trace-contains</span>: <span class="subxComment"># line : (addr string), msg : (addr string)</span> <span id="L250" class="LineNr">250 </span> <span class="subxS1Comment"># . prologue</span> <span id="L251" class="LineNr">251 </span> 55/push-ebp <span id="L252" class="LineNr">252 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -334,7 +334,7 @@ if ('onhashchange' in window) { <span id="L271" class="LineNr">271 </span> 5d/pop-to-ebp <span id="L272" class="LineNr">272 </span> c3/return <span id="L273" class="LineNr">273 </span> -<span id="L274" class="LineNr">274 </span><span class="subxFunction">check-trace-scans-to</span>: <span class="subxComment"># line : (address string), msg : (address string)</span> +<span id="L274" class="LineNr">274 </span><span class="subxFunction">check-trace-scans-to</span>: <span class="subxComment"># line : (addr string), msg : (addr string)</span> <span id="L275" class="LineNr">275 </span> <span class="subxS1Comment"># . prologue</span> <span id="L276" class="LineNr">276 </span> 55/push-ebp <span id="L277" class="LineNr">277 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -365,7 +365,7 @@ if ('onhashchange' in window) { <span id="L302" class="LineNr">302 </span> c3/return <span id="L303" class="LineNr">303 </span> <span id="L304" class="LineNr">304 </span><span class="subxComment"># Start scanning from Trace-stream->read for 'line'. If found, update Trace-stream->read and return true.</span> -<span id="L305" class="LineNr">305 </span><span class="subxFunction">trace-scan</span>: <span class="subxComment"># line : (address array byte) -> result/eax : boolean</span> +<span id="L305" class="LineNr">305 </span><span class="subxFunction">trace-scan</span>: <span class="subxComment"># line : (addr array byte) -> result/eax : boolean</span> <span id="L306" class="LineNr">306 </span> <span class="subxComment"># pseudocode:</span> <span id="L307" class="LineNr">307 </span> <span class="subxComment"># push Trace-stream->read</span> <span id="L308" class="LineNr">308 </span> <span class="subxComment"># while true:</span> @@ -617,7 +617,7 @@ if ('onhashchange' in window) { <span id="L554" class="LineNr">554 </span> <span class="subxS1Comment"># . end</span> <span id="L555" class="LineNr">555 </span> c3/return <span id="L556" class="LineNr">556 </span> -<span id="L557" class="LineNr">557 </span><span class="subxFunction">next-line-matches?</span>: <span class="subxComment"># t : (address stream byte), line : (address array byte) -> result/eax : boolean</span> +<span id="L557" class="LineNr">557 </span><span class="subxFunction">next-line-matches?</span>: <span class="subxComment"># t : (addr stream byte), line : (addr array byte) -> result/eax : boolean</span> <span id="L558" class="LineNr">558 </span> <span class="subxComment"># pseudocode:</span> <span id="L559" class="LineNr">559 </span> <span class="subxComment"># while true:</span> <span id="L560" class="LineNr">560 </span> <span class="subxComment"># if (currl >= maxl) break</span> @@ -638,24 +638,24 @@ if ('onhashchange' in window) { <span id="L575" class="LineNr">575 </span> 57/push-edi <span id="L576" class="LineNr">576 </span> <span class="subxComment"># edx = line</span> <span id="L577" class="LineNr">577 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+12) to edx</span> -<span id="L578" class="LineNr">578 </span> <span class="subxComment"># var currl/esi : (address byte) = line->data</span> +<span id="L578" class="LineNr">578 </span> <span class="subxComment"># var currl/esi : (addr byte) = line->data</span> <span id="L579" class="LineNr">579 </span> <span class="subxS1Comment"># . esi = line/edx->data</span> <span id="L580" class="LineNr">580 </span> 8d/copy-address 1/mod/*+disp8 2/rm32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy edx+4 to esi</span> -<span id="L581" class="LineNr">581 </span> <span class="subxComment"># var maxl/ecx : (address byte) = &line->data[line->size]</span> +<span id="L581" class="LineNr">581 </span> <span class="subxComment"># var maxl/ecx : (addr byte) = &line->data[line->size]</span> <span id="L582" class="LineNr">582 </span> <span class="subxS1Comment"># . eax = line/edx->size</span> <span id="L583" class="LineNr">583 </span> 8b/copy 0/mod/indirect 2/rm32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *edx to eax</span> <span id="L584" class="LineNr">584 </span> <span class="subxS1Comment"># . maxl = &line->data[line->size]</span> <span id="L585" class="LineNr">585 </span> 8d/copy-address 0/mod/indirect 4/rm32/sib 6/base/esi 0/index/eax <span class="Normal"> . </span> 1/r32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy edx+eax to ecx</span> <span id="L586" class="LineNr">586 </span> <span class="subxComment"># edi = t</span> <span id="L587" class="LineNr">587 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> 7/r32/edi 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to edi</span> -<span id="L588" class="LineNr">588 </span> <span class="subxComment"># var ebx : (address byte) = t->data</span> +<span id="L588" class="LineNr">588 </span> <span class="subxComment"># var ebx : (addr byte) = t->data</span> <span id="L589" class="LineNr">589 </span> 8d/copy-address 1/mod/*+disp8 7/rm32/edi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 3/r32/ebx 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy edi+12 to ebx</span> -<span id="L590" class="LineNr">590 </span> <span class="subxComment"># var maxt/edx : (address byte) = &t->data[t->write]</span> +<span id="L590" class="LineNr">590 </span> <span class="subxComment"># var maxt/edx : (addr byte) = &t->data[t->write]</span> <span id="L591" class="LineNr">591 </span> <span class="subxS1Comment"># . eax = t->write</span> <span id="L592" class="LineNr">592 </span> 8b/copy 0/mod/indirect 7/rm32/edi <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *edi to eax</span> <span id="L593" class="LineNr">593 </span> <span class="subxS1Comment"># . maxt = &t->data[t->write]</span> <span id="L594" class="LineNr">594 </span> 8d/copy-address 0/mod/indirect 4/rm32/sib 3/base/ebx 0/index/eax <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ebx+eax to edx</span> -<span id="L595" class="LineNr">595 </span> <span class="subxComment"># var currt/edi : (address byte) = &t->data[t->read]</span> +<span id="L595" class="LineNr">595 </span> <span class="subxComment"># var currt/edi : (addr byte) = &t->data[t->read]</span> <span id="L596" class="LineNr">596 </span> <span class="subxS1Comment"># . eax = t/edi->read</span> <span id="L597" class="LineNr">597 </span> 8b/copy 1/mod/*+disp8 7/rm32/edi <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(edi+4) to eax</span> <span id="L598" class="LineNr">598 </span> <span class="subxS1Comment"># . currt = &t->data[t->read]</span> @@ -793,7 +793,7 @@ if ('onhashchange' in window) { <span id="L730" class="LineNr">730 </span> c3/return <span id="L731" class="LineNr">731 </span> <span id="L732" class="LineNr">732 </span><span class="subxComment"># move t->read to _after_ next newline</span> -<span id="L733" class="LineNr">733 </span><span class="subxFunction">skip-next-line</span>: <span class="subxComment"># t : (address stream byte)</span> +<span id="L733" class="LineNr">733 </span><span class="subxFunction">skip-next-line</span>: <span class="subxComment"># t : (addr stream byte)</span> <span id="L734" class="LineNr">734 </span> <span class="subxComment"># pseudocode:</span> <span id="L735" class="LineNr">735 </span> <span class="subxComment"># max = &t->data[t->write]</span> <span id="L736" class="LineNr">736 </span> <span class="subxComment"># i = t->read</span> @@ -819,11 +819,11 @@ if ('onhashchange' in window) { <span id="L756" class="LineNr">756 </span> 8d/copy-address 1/mod/*+disp8 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy ecx+12 to edx</span> <span id="L757" class="LineNr">757 </span> <span class="subxComment"># eax = t->write</span> <span id="L758" class="LineNr">758 </span> 8b/copy 0/mod/indirect 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *ecx to eax</span> -<span id="L759" class="LineNr">759 </span> <span class="subxComment"># var max/ebx : (address byte) = &t->data[t->write]</span> +<span id="L759" class="LineNr">759 </span> <span class="subxComment"># var max/ebx : (addr byte) = &t->data[t->write]</span> <span id="L760" class="LineNr">760 </span> 8d/copy-address 0/mod/indirect 4/rm32/sib 2/base/edx 0/index/eax <span class="Normal"> . </span> 3/r32/ebx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy edx+eax to ebx</span> <span id="L761" class="LineNr">761 </span> <span class="subxComment"># eax = t->read</span> <span id="L762" class="LineNr">762 </span> 8b/copy 1/mod/*+disp8 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ecx+4) to edx</span> -<span id="L763" class="LineNr">763 </span> <span class="subxComment"># var curr/ecx : (address byte) = &t->data[t->read]</span> +<span id="L763" class="LineNr">763 </span> <span class="subxComment"># var curr/ecx : (addr byte) = &t->data[t->read]</span> <span id="L764" class="LineNr">764 </span> 8d/copy-address 0/mod/indirect 4/rm32/sib 2/base/edx 0/index/eax <span class="Normal"> . </span> 1/r32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy edx+eax to ecx</span> <span id="L765" class="LineNr">765 </span> <span class="subxComment"># var i/edx : int = t->read</span> <span id="L766" class="LineNr">766 </span> 89/copy 3/mod/direct 2/rm32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy eax to edx</span> @@ -921,7 +921,7 @@ if ('onhashchange' in window) { <span id="L858" class="LineNr">858 </span><span class="subxH1Comment"># - helpers</span> <span id="L859" class="LineNr">859 </span> <span id="L860" class="LineNr">860 </span><span class="subxComment"># 3-argument variant of _append</span> -<span id="L861" class="LineNr">861 </span><span class="subxMinorFunction">_append-3</span>: <span class="subxComment"># out : (address byte), outend : (address byte), s : (address array byte) -> num_bytes_appended/eax</span> +<span id="L861" class="LineNr">861 </span><span class="subxMinorFunction">_append-3</span>: <span class="subxComment"># out : (addr byte), outend : (addr byte), s : (addr array byte) -> num_bytes_appended/eax</span> <span id="L862" class="LineNr">862 </span> <span class="subxS1Comment"># . prologue</span> <span id="L863" class="LineNr">863 </span> 55/push-ebp <span id="L864" class="LineNr">864 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -953,7 +953,7 @@ if ('onhashchange' in window) { <span id="L890" class="LineNr">890 </span> c3/return <span id="L891" class="LineNr">891 </span> <span id="L892" class="LineNr">892 </span><span class="subxComment"># 4-argument variant of _append</span> -<span id="L893" class="LineNr">893 </span><span class="subxMinorFunction">_append-4</span>: <span class="subxComment"># out : (address byte), outend : (address byte), in : (address byte), inend : (address byte) -> num_bytes_appended/eax : int</span> +<span id="L893" class="LineNr">893 </span><span class="subxMinorFunction">_append-4</span>: <span class="subxComment"># out : (addr byte), outend : (addr byte), in : (addr byte), inend : (addr byte) -> num_bytes_appended/eax : int</span> <span id="L894" class="LineNr">894 </span> <span class="subxS1Comment"># . prologue</span> <span id="L895" class="LineNr">895 </span> 55/push-ebp <span id="L896" class="LineNr">896 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> diff --git a/html/057write.subx.html b/html/057write.subx.html index 38ad6630..bba690fc 100644 --- a/html/057write.subx.html +++ b/html/057write.subx.html @@ -81,7 +81,7 @@ if ('onhashchange' in window) { <span id="L21" class="LineNr"> 21 </span><span class="subxS1Comment"># . 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</span> <span id="L22" class="LineNr"> 22 </span> <span id="L23" class="LineNr"> 23 </span><span class="subxComment"># TODO: come up with a way to signal when a write to disk fails</span> -<span id="L24" class="LineNr"> 24 </span><span class="subxFunction">write</span>: <span class="subxComment"># f : fd or (address stream byte), s : (address array byte)</span> +<span id="L24" class="LineNr"> 24 </span><span class="subxFunction">write</span>: <span class="subxComment"># f : fd or (addr stream byte), s : (addr array byte)</span> <span id="L25" class="LineNr"> 25 </span> <span class="subxS1Comment"># . prologue</span> <span id="L26" class="LineNr"> 26 </span> 55/push-ebp <span id="L27" class="LineNr"> 27 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> diff --git a/html/058stream-equal.subx.html b/html/058stream-equal.subx.html index 2e24dba7..f4e87361 100644 --- a/html/058stream-equal.subx.html +++ b/html/058stream-equal.subx.html @@ -65,7 +65,7 @@ if ('onhashchange' in window) { <span id="L6" class="LineNr"> 6 </span><span class="subxS1Comment"># . 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</span> <span id="L7" class="LineNr"> 7 </span> <span id="L8" class="LineNr"> 8 </span><span class="subxComment"># compare all the data in a stream (ignoring the read pointer)</span> -<span id="L9" class="LineNr"> 9 </span><span class="subxFunction">stream-data-equal?</span>: <span class="subxComment"># f : (address stream byte), s : (address array byte) -> eax : boolean</span> +<span id="L9" class="LineNr"> 9 </span><span class="subxFunction">stream-data-equal?</span>: <span class="subxComment"># f : (addr stream byte), s : (addr array byte) -> eax : boolean</span> <span id="L10" class="LineNr"> 10 </span> <span class="subxS1Comment"># . prologue</span> <span id="L11" class="LineNr"> 11 </span> 55/push-ebp <span id="L12" class="LineNr"> 12 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -78,9 +78,9 @@ if ('onhashchange' in window) { <span id="L19" class="LineNr"> 19 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to esi</span> <span id="L20" class="LineNr"> 20 </span> <span class="subxComment"># eax = f->write</span> <span id="L21" class="LineNr"> 21 </span> 8b/copy 0/mod/indirect 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *esi to eax</span> -<span id="L22" class="LineNr"> 22 </span> <span class="subxComment"># var maxf/edx : (address byte) = &f->data[f->write]</span> +<span id="L22" class="LineNr"> 22 </span> <span class="subxComment"># var maxf/edx : (addr byte) = &f->data[f->write]</span> <span id="L23" class="LineNr"> 23 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/esi 0/index/eax <span class="Normal"> . </span> 2/r32/edx 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy esi+eax+12 to edx</span> -<span id="L24" class="LineNr"> 24 </span> <span class="subxComment"># var currf/esi : (address byte) = f->data</span> +<span id="L24" class="LineNr"> 24 </span> <span class="subxComment"># var currf/esi : (addr byte) = f->data</span> <span id="L25" class="LineNr"> 25 </span> 81 0/subop/add 3/mod/direct 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esi</span> <span id="L26" class="LineNr"> 26 </span> <span class="subxComment"># edi = s</span> <span id="L27" class="LineNr"> 27 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 7/r32/edi 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+12) to edi</span> @@ -88,7 +88,7 @@ if ('onhashchange' in window) { <span id="L29" class="LineNr"> 29 </span> <span class="subxComment"># if (f->write != s->length) return false</span> <span id="L30" class="LineNr"> 30 </span> 39/compare 0/mod/indirect 7/rm32/edi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># compare *edi and eax</span> <span id="L31" class="LineNr"> 31 </span> 75/jump-if-not-equal $stream-data-equal?:false/disp8 -<span id="L32" class="LineNr"> 32 </span> <span class="subxComment"># var currs/edi : (address byte) = s->data</span> +<span id="L32" class="LineNr"> 32 </span> <span class="subxComment"># var currs/edi : (addr byte) = s->data</span> <span id="L33" class="LineNr"> 33 </span> 81 0/subop/add 3/mod/direct 7/rm32/edi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to edi</span> <span id="L34" class="LineNr"> 34 </span> <span class="subxComment"># var eax : byte = 0</span> <span id="L35" class="LineNr"> 35 </span> 31/xor 3/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># clear eax</span> @@ -250,7 +250,7 @@ if ('onhashchange' in window) { <span id="L191" class="LineNr">191 </span> c3/return <span id="L192" class="LineNr">192 </span> <span id="L193" class="LineNr">193 </span><span class="subxComment"># helper for later tests</span> -<span id="L194" class="LineNr">194 </span><span class="subxFunction">check-stream-equal</span>: <span class="subxComment"># f : (address stream byte), s : (address array byte), msg : (address array byte)</span> +<span id="L194" class="LineNr">194 </span><span class="subxFunction">check-stream-equal</span>: <span class="subxComment"># f : (addr stream byte), s : (addr array byte), msg : (addr array byte)</span> <span id="L195" class="LineNr">195 </span> <span class="subxS1Comment"># . prologue</span> <span id="L196" class="LineNr">196 </span> 55/push-ebp <span id="L197" class="LineNr">197 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -286,7 +286,7 @@ if ('onhashchange' in window) { <span id="L227" class="LineNr">227 </span><span class="subxComment"># on success, set f->read to after the next newline</span> <span id="L228" class="LineNr">228 </span><span class="subxComment"># on failure, leave f->read unmodified</span> <span id="L229" class="LineNr">229 </span><span class="subxComment"># this function is usually used only in tests, so we repeatedly write f->read</span> -<span id="L230" class="LineNr">230 </span><span class="subxFunction">next-stream-line-equal?</span>: <span class="subxComment"># f : (address stream byte), s : (address array byte) -> eax : boolean</span> +<span id="L230" class="LineNr">230 </span><span class="subxFunction">next-stream-line-equal?</span>: <span class="subxComment"># f : (addr stream byte), s : (addr array byte) -> eax : boolean</span> <span id="L231" class="LineNr">231 </span> <span class="subxComment"># pseudocode:</span> <span id="L232" class="LineNr">232 </span> <span class="subxComment"># currf = f->read # bound: f->write</span> <span id="L233" class="LineNr">233 </span> <span class="subxComment"># currs = 0 # bound : s->length</span> diff --git a/html/059stop.subx.html b/html/059stop.subx.html index b7c0cd20..4ecff92e 100644 --- a/html/059stop.subx.html +++ b/html/059stop.subx.html @@ -102,7 +102,7 @@ if ('onhashchange' in window) { <span id="L41" class="LineNr"> 41 </span><span class="subxComment"># the stack.</span> <span id="L42" class="LineNr"> 42 </span><span class="subxComment"># Ugly that we need to know the size of args. Don't allocate variables between</span> <span id="L43" class="LineNr"> 43 </span><span class="subxComment"># tailor-exit-descriptor and the call it's for.</span> -<span id="L44" class="LineNr"> 44 </span><span class="subxFunction">tailor-exit-descriptor</span>: <span class="subxComment"># ed : (address exit-descriptor), nbytes : int</span> +<span id="L44" class="LineNr"> 44 </span><span class="subxFunction">tailor-exit-descriptor</span>: <span class="subxComment"># ed : (addr exit-descriptor), nbytes : int</span> <span id="L45" class="LineNr"> 45 </span> <span class="subxS1Comment"># . prologue</span> <span id="L46" class="LineNr"> 46 </span> 55/push-ebp <span id="L47" class="LineNr"> 47 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -150,7 +150,7 @@ if ('onhashchange' in window) { <span id="L89" class="LineNr"> 89 </span> 5d/pop-to-ebp <span id="L90" class="LineNr"> 90 </span> c3/return <span id="L91" class="LineNr"> 91 </span> -<span id="L92" class="LineNr"> 92 </span><span class="subxFunction">stop</span>: <span class="subxComment"># ed : (address exit-descriptor), value : int</span> +<span id="L92" class="LineNr"> 92 </span><span class="subxFunction">stop</span>: <span class="subxComment"># ed : (addr exit-descriptor), value : int</span> <span id="L93" class="LineNr"> 93 </span> <span class="subxComment"># no prologue; one way or another, we're going to clobber registers</span> <span id="L94" class="LineNr"> 94 </span> <span class="subxComment"># eax = ed</span> <span id="L95" class="LineNr"> 95 </span> 8b/copy 1/mod/*+disp8 4/rm32/sib 4/base/esp 4/index/none <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(esp+4) to eax</span> @@ -222,7 +222,7 @@ if ('onhashchange' in window) { <span id="L161" class="LineNr">161 </span> 5d/pop-to-ebp <span id="L162" class="LineNr">162 </span> c3/return <span id="L163" class="LineNr">163 </span> -<span id="L164" class="LineNr">164 </span><span class="subxMinorFunction">_test-stop-1</span>: <span class="subxComment"># ed : (address exit-descriptor)</span> +<span id="L164" class="LineNr">164 </span><span class="subxMinorFunction">_test-stop-1</span>: <span class="subxComment"># ed : (addr exit-descriptor)</span> <span id="L165" class="LineNr">165 </span> <span class="subxS1Comment"># . prologue</span> <span id="L166" class="LineNr">166 </span> 55/push-ebp <span id="L167" class="LineNr">167 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -249,7 +249,7 @@ if ('onhashchange' in window) { <span id="L188" class="LineNr">188 </span> 5d/pop-to-ebp <span id="L189" class="LineNr">189 </span> c3/return <span id="L190" class="LineNr">190 </span> -<span id="L191" class="LineNr">191 </span><span class="subxMinorFunction">_test-stop-2</span>: <span class="subxComment"># ed : (address exit-descriptor)</span> +<span id="L191" class="LineNr">191 </span><span class="subxMinorFunction">_test-stop-2</span>: <span class="subxComment"># ed : (addr exit-descriptor)</span> <span id="L192" class="LineNr">192 </span> <span class="subxS1Comment"># . prologue</span> <span id="L193" class="LineNr">193 </span> 55/push-ebp <span id="L194" class="LineNr">194 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> diff --git a/html/060read.subx.html b/html/060read.subx.html index 235389fa..137be892 100644 --- a/html/060read.subx.html +++ b/html/060read.subx.html @@ -106,7 +106,7 @@ if ('onhashchange' in window) { <span id="L45" class="LineNr"> 45 </span><span class="subxS1Comment"># . op subop mod rm32 base index scale r32</span> <span id="L46" class="LineNr"> 46 </span><span class="subxS1Comment"># . 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</span> <span id="L47" class="LineNr"> 47 </span> -<span id="L48" class="LineNr"> 48 </span><span class="subxFunction">read</span>: <span class="subxComment"># f : fd or (address stream byte), s : (address stream byte) -> num-bytes-read/eax : int</span> +<span id="L48" class="LineNr"> 48 </span><span class="subxFunction">read</span>: <span class="subxComment"># f : fd or (addr stream byte), s : (addr stream byte) -> num-bytes-read/eax : int</span> <span id="L49" class="LineNr"> 49 </span> <span class="subxS1Comment"># . prologue</span> <span id="L50" class="LineNr"> 50 </span> 55/push-ebp <span id="L51" class="LineNr"> 51 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -256,7 +256,7 @@ if ('onhashchange' in window) { <span id="L195" class="LineNr">195 </span><span class="subxComment"># Unclear how I'd use it, though. Callers seem to need the check anyway.</span> <span id="L196" class="LineNr">196 </span><span class="subxComment"># Maybe a better helper would be 'empty-stream?'</span> <span id="L197" class="LineNr">197 </span> -<span id="L198" class="LineNr">198 </span><span class="subxMinorFunction">_read</span>: <span class="subxComment"># fd : int, s : (address stream byte) -> num-bytes-read/eax : int</span> +<span id="L198" class="LineNr">198 </span><span class="subxMinorFunction">_read</span>: <span class="subxComment"># fd : int, s : (addr stream byte) -> num-bytes-read/eax : int</span> <span id="L199" class="LineNr">199 </span> <span class="subxS1Comment"># . prologue</span> <span id="L200" class="LineNr">200 </span> 55/push-ebp <span id="L201" class="LineNr">201 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> diff --git a/html/061read-byte.subx.html b/html/061read-byte.subx.html index 9e5f62a6..e697f0c8 100644 --- a/html/061read-byte.subx.html +++ b/html/061read-byte.subx.html @@ -74,7 +74,7 @@ if ('onhashchange' in window) { <span id="L12" class="LineNr"> 12 </span><span class="subxComment"># The buffered file for standard input. Also illustrates the layout for</span> <span id="L13" class="LineNr"> 13 </span><span class="subxComment"># buffered-file: a pointer to the backing store, followed by a 'buffer' stream</span> <span id="L14" class="LineNr"> 14 </span><span class="SpecialChar">Stdin</span>: <span class="subxComment"># (ref buffered-file)</span> -<span id="L15" class="LineNr"> 15 </span> <span class="subxComment"># file descriptor or (address stream byte)</span> +<span id="L15" class="LineNr"> 15 </span> <span class="subxComment"># file descriptor or (addr stream byte)</span> <span id="L16" class="LineNr"> 16 </span> 0/imm32 <span class="subxComment"># standard input</span> <span id="L17" class="LineNr"> 17 </span><span class="Constant">$Stdin->buffer</span>: <span id="L18" class="LineNr"> 18 </span> <span class="subxComment"># inlined fields for a stream</span> @@ -97,7 +97,7 @@ if ('onhashchange' in window) { <span id="L35" class="LineNr"> 35 </span> <span id="L36" class="LineNr"> 36 </span><span class="subxComment"># return next byte value in eax, with top 3 bytes cleared.</span> <span id="L37" class="LineNr"> 37 </span><span class="subxComment"># On reaching end of file, return 0xffffffff (Eof).</span> -<span id="L38" class="LineNr"> 38 </span><span class="subxFunction">read-byte-buffered</span>: <span class="subxComment"># f : (address buffered-file) -> byte-or-Eof/eax</span> +<span id="L38" class="LineNr"> 38 </span><span class="subxFunction">read-byte-buffered</span>: <span class="subxComment"># f : (addr buffered-file) -> byte-or-Eof/eax</span> <span id="L39" class="LineNr"> 39 </span> <span class="subxS1Comment"># . prologue</span> <span id="L40" class="LineNr"> 40 </span> 55/push-ebp <span id="L41" class="LineNr"> 41 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -334,7 +334,7 @@ if ('onhashchange' in window) { <span id="L272" class="LineNr">272 </span> <span id="L273" class="LineNr">273 </span><span class="subxComment"># a test buffered file for _test-stream</span> <span id="L274" class="LineNr">274 </span><span class="subxMinorFunction">_test-buffered-file</span>: <span class="subxComment"># (ref buffered-file)</span> -<span id="L275" class="LineNr">275 </span> <span class="subxComment"># file descriptor or (address stream byte)</span> +<span id="L275" class="LineNr">275 </span> <span class="subxComment"># file descriptor or (addr stream byte)</span> <span id="L276" class="LineNr">276 </span> <a href='057write.subx.html#L148'>_test-stream</a>/imm32 <span id="L277" class="LineNr">277 </span><span class="Constant">$_test-buffered-file->buffer</span>: <span id="L278" class="LineNr">278 </span> <span class="subxComment"># current write index</span> @@ -373,7 +373,7 @@ if ('onhashchange' in window) { <span id="L311" class="LineNr">311 </span> <span id="L312" class="LineNr">312 </span><span class="subxComment"># a test buffered file for _test-input-stream</span> <span id="L313" class="LineNr">313 </span><span class="subxMinorFunction">_test-input-buffered-file</span>: <span class="subxComment"># (ref buffered-file)</span> -<span id="L314" class="LineNr">314 </span> <span class="subxComment"># file descriptor or (address stream byte)</span> +<span id="L314" class="LineNr">314 </span> <span class="subxComment"># file descriptor or (addr stream byte)</span> <span id="L315" class="LineNr">315 </span> <a href='061read-byte.subx.html#L287'>_test-input-stream</a>/imm32 <span id="L316" class="LineNr">316 </span><span class="Constant">$_test-input-buffered-file->buffer</span>: <span id="L317" class="LineNr">317 </span> <span class="subxComment"># current write index</span> diff --git a/html/062write-stream.subx.html b/html/062write-stream.subx.html index 49b3bfec..36a31115 100644 --- a/html/062write-stream.subx.html +++ b/html/062write-stream.subx.html @@ -76,7 +76,7 @@ if ('onhashchange' in window) { <span id="L15" class="LineNr"> 15 </span><span class="CommentedCode">#? b8/copy-to-eax 1/imm32/exit</span> <span id="L16" class="LineNr"> 16 </span><span class="CommentedCode">#? cd/syscall 0x80/imm8</span> <span id="L17" class="LineNr"> 17 </span> -<span id="L18" class="LineNr"> 18 </span><span class="subxFunction">write-stream</span>: <span class="subxComment"># f : fd or (address stream byte), s : (address stream byte)</span> +<span id="L18" class="LineNr"> 18 </span><span class="subxFunction">write-stream</span>: <span class="subxComment"># f : fd or (addr stream byte), s : (addr stream byte)</span> <span id="L19" class="LineNr"> 19 </span> <span class="subxS1Comment"># . prologue</span> <span id="L20" class="LineNr"> 20 </span> 55/push-ebp <span id="L21" class="LineNr"> 21 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -136,7 +136,7 @@ if ('onhashchange' in window) { <span id="L75" class="LineNr"> 75 </span> 5d/pop-to-ebp <span id="L76" class="LineNr"> 76 </span> c3/return <span id="L77" class="LineNr"> 77 </span> -<span id="L78" class="LineNr"> 78 </span><span class="subxMinorFunction">_write-stream</span>: <span class="subxComment"># fd : int, s : (address stream byte)</span> +<span id="L78" class="LineNr"> 78 </span><span class="subxMinorFunction">_write-stream</span>: <span class="subxComment"># fd : int, s : (addr stream byte)</span> <span id="L79" class="LineNr"> 79 </span> <span class="subxS1Comment"># . prologue</span> <span id="L80" class="LineNr"> 80 </span> 55/push-ebp <span id="L81" class="LineNr"> 81 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> diff --git a/html/063error.subx.html b/html/063error.subx.html index dad098cd..b32602f1 100644 --- a/html/063error.subx.html +++ b/html/063error.subx.html @@ -65,7 +65,7 @@ if ('onhashchange' in window) { <span id="L6" class="LineNr"> 6 </span><span class="subxS1Comment"># . 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</span> <span id="L7" class="LineNr"> 7 </span> <span id="L8" class="LineNr"> 8 </span><span class="subxComment"># write(out, "Error: "+msg+"\n") then stop(ed, 1)</span> -<span id="L9" class="LineNr"> 9 </span><span class="subxFunction">error</span>: <span class="subxComment"># ed : (address exit-descriptor), out : fd or (address stream byte), msg : (address array byte)</span> +<span id="L9" class="LineNr"> 9 </span><span class="subxFunction">error</span>: <span class="subxComment"># ed : (addr exit-descriptor), out : fd or (addr stream byte), msg : (addr array byte)</span> <span id="L10" class="LineNr">10 </span> <span class="subxS1Comment"># . prologue</span> <span id="L11" class="LineNr">11 </span> 55/push-ebp <span id="L12" class="LineNr">12 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> diff --git a/html/064write-byte.subx.html b/html/064write-byte.subx.html index 8ab5318f..9fba419d 100644 --- a/html/064write-byte.subx.html +++ b/html/064write-byte.subx.html @@ -70,7 +70,7 @@ if ('onhashchange' in window) { <span id="L8" class="LineNr"> 8 </span> <span id="L9" class="LineNr"> 9 </span><span class="subxComment"># The buffered file for standard output.</span> <span id="L10" class="LineNr"> 10 </span><span class="SpecialChar">Stdout</span>: <span class="subxComment"># (ref buffered-file)</span> -<span id="L11" class="LineNr"> 11 </span> <span class="subxComment"># file descriptor or (address stream byte)</span> +<span id="L11" class="LineNr"> 11 </span> <span class="subxComment"># file descriptor or (addr stream byte)</span> <span id="L12" class="LineNr"> 12 </span> 1/imm32 <span class="subxComment"># standard output</span> <span id="L13" class="LineNr"> 13 </span><span class="Constant">$Stdout->buffer</span>: <span id="L14" class="LineNr"> 14 </span> <span class="subxComment"># inlined fields for a stream</span> @@ -92,7 +92,7 @@ if ('onhashchange' in window) { <span id="L30" class="LineNr"> 30 </span><span class="subxS1Comment"># . 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</span> <span id="L31" class="LineNr"> 31 </span> <span id="L32" class="LineNr"> 32 </span><span class="subxComment"># Write lower byte of 'n' to 'f'.</span> -<span id="L33" class="LineNr"> 33 </span><span class="subxFunction">write-byte-buffered</span>: <span class="subxComment"># f : (address buffered-file), n : int</span> +<span id="L33" class="LineNr"> 33 </span><span class="subxFunction">write-byte-buffered</span>: <span class="subxComment"># f : (addr buffered-file), n : int</span> <span id="L34" class="LineNr"> 34 </span> <span class="subxS1Comment"># . prologue</span> <span id="L35" class="LineNr"> 35 </span> 55/push-ebp <span id="L36" class="LineNr"> 36 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -140,7 +140,7 @@ if ('onhashchange' in window) { <span id="L78" class="LineNr"> 78 </span> 5d/pop-to-ebp <span id="L79" class="LineNr"> 79 </span> c3/return <span id="L80" class="LineNr"> 80 </span> -<span id="L81" class="LineNr"> 81 </span><span class="subxFunction">flush</span>: <span class="subxComment"># f : (address buffered-file)</span> +<span id="L81" class="LineNr"> 81 </span><span class="subxFunction">flush</span>: <span class="subxComment"># f : (addr buffered-file)</span> <span id="L82" class="LineNr"> 82 </span> <span class="subxS1Comment"># . prologue</span> <span id="L83" class="LineNr"> 83 </span> 55/push-ebp <span id="L84" class="LineNr"> 84 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -267,7 +267,7 @@ if ('onhashchange' in window) { <span id="L205" class="LineNr">205 </span><span class="subxH1Comment"># - variant without buffering</span> <span id="L206" class="LineNr">206 </span> <span id="L207" class="LineNr">207 </span><span class="subxComment"># Write lower byte of 'n' to 'f'.</span> -<span id="L208" class="LineNr">208 </span><span class="subxFunction">append-byte</span>: <span class="subxComment"># f : (address stream byte), n : int</span> +<span id="L208" class="LineNr">208 </span><span class="subxFunction">append-byte</span>: <span class="subxComment"># f : (addr stream byte), n : int</span> <span id="L209" class="LineNr">209 </span> <span class="subxS1Comment"># . prologue</span> <span id="L210" class="LineNr">210 </span> 55/push-ebp <span id="L211" class="LineNr">211 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -388,7 +388,7 @@ if ('onhashchange' in window) { <span id="L326" class="LineNr">326 </span> <span id="L327" class="LineNr">327 </span><span class="subxComment"># a test buffered file for _test-output-stream</span> <span id="L328" class="LineNr">328 </span><span class="subxMinorFunction">_test-output-buffered-file</span>: <span class="subxComment"># (ref buffered-file)</span> -<span id="L329" class="LineNr">329 </span> <span class="subxComment"># file descriptor or (address stream byte)</span> +<span id="L329" class="LineNr">329 </span> <span class="subxComment"># file descriptor or (addr stream byte)</span> <span id="L330" class="LineNr">330 </span> <a href='064write-byte.subx.html#L286'>_test-output-stream</a>/imm32 <span id="L331" class="LineNr">331 </span><span class="Constant">$_test-output-buffered-file->buffer</span>: <span id="L332" class="LineNr">332 </span> <span class="subxComment"># current write index</span> @@ -419,7 +419,7 @@ if ('onhashchange' in window) { <span id="L357" class="LineNr">357 </span> <span id="L358" class="LineNr">358 </span><span class="subxComment"># a test buffered file for _test-error-stream</span> <span id="L359" class="LineNr">359 </span><span class="subxMinorFunction">_test-error-buffered-file</span>: <span class="subxComment"># (ref buffered-file)</span> -<span id="L360" class="LineNr">360 </span> <span class="subxComment"># file descriptor or (address stream byte)</span> +<span id="L360" class="LineNr">360 </span> <span class="subxComment"># file descriptor or (addr stream byte)</span> <span id="L361" class="LineNr">361 </span> <a href='064write-byte.subx.html#L341'>_test-error-stream</a>/imm32 <span id="L362" class="LineNr">362 </span><span class="Constant">$_test-error-buffered-file->buffer</span>: <span id="L363" class="LineNr">363 </span> <span class="subxComment"># current write index</span> diff --git a/html/065write-buffered.subx.html b/html/065write-buffered.subx.html index ab9c8670..10545dec 100644 --- a/html/065write-buffered.subx.html +++ b/html/065write-buffered.subx.html @@ -66,7 +66,7 @@ if ('onhashchange' in window) { <span id="L5" class="LineNr"> 5 </span><span class="subxS1Comment"># . op subop mod rm32 base index scale r32</span> <span id="L6" class="LineNr"> 6 </span><span class="subxS1Comment"># . 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</span> <span id="L7" class="LineNr"> 7 </span> -<span id="L8" class="LineNr"> 8 </span><span class="subxFunction">write-buffered</span>: <span class="subxComment"># f : (address buffered-file), msg : (address array byte)</span> +<span id="L8" class="LineNr"> 8 </span><span class="subxFunction">write-buffered</span>: <span class="subxComment"># f : (addr buffered-file), msg : (addr array byte)</span> <span id="L9" class="LineNr"> 9 </span> <span class="subxComment"># pseudocode:</span> <span id="L10" class="LineNr"> 10 </span> <span class="subxComment"># in = msg->data</span> <span id="L11" class="LineNr"> 11 </span> <span class="subxComment"># inend = &msg->data[msg->length]</span> @@ -99,9 +99,9 @@ if ('onhashchange' in window) { <span id="L38" class="LineNr"> 38 </span> 57/push-edi <span id="L39" class="LineNr"> 39 </span> <span class="subxComment"># eax = msg</span> <span id="L40" class="LineNr"> 40 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+12) to eax</span> -<span id="L41" class="LineNr"> 41 </span> <span class="subxComment"># var in/esi : (address byte) = msg->data</span> +<span id="L41" class="LineNr"> 41 </span> <span class="subxComment"># var in/esi : (addr byte) = msg->data</span> <span id="L42" class="LineNr"> 42 </span> 8d/copy-address 1/mod/*+disp8 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy eax+4 to esi</span> -<span id="L43" class="LineNr"> 43 </span> <span class="subxComment"># var inend/ecx : (address byte) = &msg->data[msg->length]</span> +<span id="L43" class="LineNr"> 43 </span> <span class="subxComment"># var inend/ecx : (addr byte) = &msg->data[msg->length]</span> <span id="L44" class="LineNr"> 44 </span> 8b/copy 0/mod/indirect 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *eax to ecx</span> <span id="L45" class="LineNr"> 45 </span> 8d/copy-address 0/mod/indirect 4/rm32/sib 6/base/esi 1/index/ecx <span class="Normal"> . </span> 1/r32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esi+ecx to ecx</span> <span id="L46" class="LineNr"> 46 </span> <span class="subxComment"># edi = f</span> @@ -268,7 +268,7 @@ if ('onhashchange' in window) { <span id="L207" class="LineNr">207 </span> <span id="L208" class="LineNr">208 </span><span class="subxComment"># The buffered file for standard error.</span> <span id="L209" class="LineNr">209 </span><span class="SpecialChar">Stderr</span>: <span class="subxComment"># (ref buffered-file)</span> -<span id="L210" class="LineNr">210 </span> <span class="subxComment"># file descriptor or (address stream byte)</span> +<span id="L210" class="LineNr">210 </span> <span class="subxComment"># file descriptor or (addr stream byte)</span> <span id="L211" class="LineNr">211 </span> 2/imm32 <span class="subxComment"># standard error</span> <span id="L212" class="LineNr">212 </span><span class="Constant">$Stderr->buffer</span>: <span id="L213" class="LineNr">213 </span> <span class="subxComment"># inlined fields for a stream</span> diff --git a/html/066print-int.subx.html b/html/066print-int.subx.html index d3adba30..1c024069 100644 --- a/html/066print-int.subx.html +++ b/html/066print-int.subx.html @@ -79,7 +79,7 @@ if ('onhashchange' in window) { <span id="L18" class="LineNr"> 18 </span> 05/add-to-eax 0x57/imm32/a-10 <span id="L19" class="LineNr"> 19 </span> c3/return <span id="L20" class="LineNr"> 20 </span> -<span id="L21" class="LineNr"> 21 </span><span class="subxFunction">append-byte-hex</span>: <span class="subxComment"># f : (address stream byte), n : int</span> +<span id="L21" class="LineNr"> 21 </span><span class="subxFunction">append-byte-hex</span>: <span class="subxComment"># f : (addr stream byte), n : int</span> <span id="L22" class="LineNr"> 22 </span> <span class="subxS1Comment"># . prologue</span> <span id="L23" class="LineNr"> 23 </span> 55/push-ebp <span id="L24" class="LineNr"> 24 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -151,7 +151,7 @@ if ('onhashchange' in window) { <span id="L90" class="LineNr"> 90 </span> c3/return <span id="L91" class="LineNr"> 91 </span> <span id="L92" class="LineNr"> 92 </span><span class="subxComment"># print the hex representation for the lowest byte of a number</span> -<span id="L93" class="LineNr"> 93 </span><span class="subxFunction">print-byte-buffered</span>: <span class="subxComment"># f : (address buffered-file), n : int</span> +<span id="L93" class="LineNr"> 93 </span><span class="subxFunction">print-byte-buffered</span>: <span class="subxComment"># f : (addr buffered-file), n : int</span> <span id="L94" class="LineNr"> 94 </span> <span class="subxS1Comment"># . prologue</span> <span id="L95" class="LineNr"> 95 </span> 55/push-ebp <span id="L96" class="LineNr"> 96 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -236,7 +236,7 @@ if ('onhashchange' in window) { <span id="L175" class="LineNr">175 </span> <span class="subxS1Comment"># . end</span> <span id="L176" class="LineNr">176 </span> c3/return <span id="L177" class="LineNr">177 </span> -<span id="L178" class="LineNr">178 </span><span class="subxFunction">print-int32</span>: <span class="subxComment"># f : (address stream byte), n : int</span> +<span id="L178" class="LineNr">178 </span><span class="subxFunction">print-int32</span>: <span class="subxComment"># f : (addr stream byte), n : int</span> <span id="L179" class="LineNr">179 </span> <span class="subxComment"># pseudocode:</span> <span id="L180" class="LineNr">180 </span> <span class="subxComment"># write(f, "0x")</span> <span id="L181" class="LineNr">181 </span> <span class="subxComment"># ecx = 28</span> @@ -324,7 +324,7 @@ if ('onhashchange' in window) { <span id="L263" class="LineNr">263 </span> <span class="subxS1Comment"># . end</span> <span id="L264" class="LineNr">264 </span> c3/return <span id="L265" class="LineNr">265 </span> -<span id="L266" class="LineNr">266 </span><span class="subxFunction">print-int32-buffered</span>: <span class="subxComment"># f : (address buffered-file), n : int</span> +<span id="L266" class="LineNr">266 </span><span class="subxFunction">print-int32-buffered</span>: <span class="subxComment"># f : (addr buffered-file), n : int</span> <span id="L267" class="LineNr">267 </span> <span class="subxComment"># pseudocode:</span> <span id="L268" class="LineNr">268 </span> <span class="subxComment"># write-buffered(f, "0x")</span> <span id="L269" class="LineNr">269 </span> <span class="subxComment"># ecx = 28</span> diff --git a/html/067parse-hex.subx.html b/html/067parse-hex.subx.html index ad3f8de9..2b607e42 100644 --- a/html/067parse-hex.subx.html +++ b/html/067parse-hex.subx.html @@ -66,7 +66,7 @@ if ('onhashchange' in window) { <span id="L6" class="LineNr"> 6 </span><span class="subxS1Comment"># . op subop mod rm32 base index scale r32</span> <span id="L7" class="LineNr"> 7 </span><span class="subxS1Comment"># . 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</span> <span id="L8" class="LineNr"> 8 </span> -<span id="L9" class="LineNr"> 9 </span><span class="subxFunction">is-hex-int?</span>: <span class="subxComment"># in : (address slice) -> eax : boolean</span> +<span id="L9" class="LineNr"> 9 </span><span class="subxFunction">is-hex-int?</span>: <span class="subxComment"># in : (addr slice) -> eax : boolean</span> <span id="L10" class="LineNr"> 10 </span> <span class="subxS1Comment"># . prologue</span> <span id="L11" class="LineNr"> 11 </span> 55/push-ebp <span id="L12" class="LineNr"> 12 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -78,7 +78,7 @@ if ('onhashchange' in window) { <span id="L18" class="LineNr"> 18 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to ecx</span> <span id="L19" class="LineNr"> 19 </span> <span class="subxComment"># edx = s->end</span> <span id="L20" class="LineNr"> 20 </span> 8b/copy 1/mod/*+disp8 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ecx+4) to edx</span> -<span id="L21" class="LineNr"> 21 </span> <span class="subxComment"># var curr/ecx : (address byte) = s->start</span> +<span id="L21" class="LineNr"> 21 </span> <span class="subxComment"># var curr/ecx : (addr byte) = s->start</span> <span id="L22" class="LineNr"> 22 </span> 8b/copy 0/mod/indirect 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *ecx to ecx</span> <span id="L23" class="LineNr"> 23 </span> <span class="subxComment"># if s is empty return false</span> <span id="L24" class="LineNr"> 24 </span> b8/copy-to-eax 0/imm32/false @@ -411,7 +411,7 @@ if ('onhashchange' in window) { <span id="L351" class="LineNr">351 </span> 5d/pop-to-ebp <span id="L352" class="LineNr">352 </span> c3/return <span id="L353" class="LineNr">353 </span> -<span id="L354" class="LineNr">354 </span><span class="subxFunction">parse-hex-int</span>: <span class="subxComment"># in : (address slice) -> result/eax : int</span> +<span id="L354" class="LineNr">354 </span><span class="subxFunction">parse-hex-int</span>: <span class="subxComment"># in : (addr slice) -> result/eax : int</span> <span id="L355" class="LineNr">355 </span> <span class="subxS1Comment"># . prologue</span> <span id="L356" class="LineNr">356 </span> 55/push-ebp <span id="L357" class="LineNr">357 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -426,7 +426,7 @@ if ('onhashchange' in window) { <span id="L366" class="LineNr">366 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to ecx</span> <span id="L367" class="LineNr">367 </span> <span class="subxComment"># edx = in->end</span> <span id="L368" class="LineNr">368 </span> 8b/copy 1/mod/*+disp8 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ecx+4) to edx</span> -<span id="L369" class="LineNr">369 </span> <span class="subxComment"># var curr/ecx : (address byte) = in->start</span> +<span id="L369" class="LineNr">369 </span> <span class="subxComment"># var curr/ecx : (addr byte) = in->start</span> <span id="L370" class="LineNr">370 </span> 8b/copy 0/mod/indirect 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *ecx to ecx</span> <span id="L371" class="LineNr">371 </span> <span class="subxComment"># var negate?/esi : boolean = false</span> <span id="L372" class="LineNr">372 </span> 31/xor 3/mod/direct 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># clear esi</span> diff --git a/html/068error-byte.subx.html b/html/068error-byte.subx.html index acd6f8ab..d3c23edb 100644 --- a/html/068error-byte.subx.html +++ b/html/068error-byte.subx.html @@ -84,7 +84,7 @@ if ('onhashchange' in window) { <span id="L24" class="LineNr">24 </span><span class="CommentedCode">#? cd/syscall 0x80/imm8</span> <span id="L25" class="LineNr">25 </span> <span id="L26" class="LineNr">26 </span><span class="subxComment"># write(out, "Error: "+msg+": "+byte) then stop(ed, 1)</span> -<span id="L27" class="LineNr">27 </span><span class="subxFunction">error-byte</span>: <span class="subxComment"># ed : (address exit-descriptor), out : (address buffered-file), msg : (address array byte), n : byte</span> +<span id="L27" class="LineNr">27 </span><span class="subxFunction">error-byte</span>: <span class="subxComment"># ed : (addr exit-descriptor), out : (addr buffered-file), msg : (addr array byte), n : byte</span> <span id="L28" class="LineNr">28 </span> <span class="subxS1Comment"># . prologue</span> <span id="L29" class="LineNr">29 </span> 55/push-ebp <span id="L30" class="LineNr">30 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> diff --git a/html/069allocate.subx.html b/html/069allocate.subx.html index a1bca554..b8bb8681 100644 --- a/html/069allocate.subx.html +++ b/html/069allocate.subx.html @@ -117,7 +117,7 @@ if ('onhashchange' in window) { <span id="L56" class="LineNr"> 56 </span> <span id="L57" class="LineNr"> 57 </span><span class="subxComment"># Claim the next 'n' bytes of memory starting at ad->curr and update ad->curr.</span> <span id="L58" class="LineNr"> 58 </span><span class="subxComment"># Abort if there isn't enough memory in 'ad'.</span> -<span id="L59" class="LineNr"> 59 </span><span class="subxFunction">allocate</span>: <span class="subxComment"># ad : (address allocation-descriptor), n : int -> address-or-null/eax : (address _)</span> +<span id="L59" class="LineNr"> 59 </span><span class="subxFunction">allocate</span>: <span class="subxComment"># ad : (addr allocation-descriptor), n : int -> address-or-null/eax : (addr _)</span> <span id="L60" class="LineNr"> 60 </span> <span class="subxS1Comment"># . prologue</span> <span id="L61" class="LineNr"> 61 </span> 55/push-ebp <span id="L62" class="LineNr"> 62 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -241,7 +241,7 @@ if ('onhashchange' in window) { <span id="L180" class="LineNr">180 </span> c3/return <span id="L181" class="LineNr">181 </span> <span id="L182" class="LineNr">182 </span><span class="subxComment"># helper: create a nested allocation descriptor (useful for tests)</span> -<span id="L183" class="LineNr">183 </span><span class="subxFunction">allocate-region</span>: <span class="subxComment"># ad : (address allocation-descriptor), n : int -> new-ad : (handle allocation-descriptor)</span> +<span id="L183" class="LineNr">183 </span><span class="subxFunction">allocate-region</span>: <span class="subxComment"># ad : (addr allocation-descriptor), n : int -> new-ad : (handle allocation-descriptor)</span> <span id="L184" class="LineNr">184 </span> <span class="subxS1Comment"># . prologue</span> <span id="L185" class="LineNr">185 </span> 55/push-ebp <span id="L186" class="LineNr">186 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> diff --git a/html/070new-stream.subx.html b/html/070new-stream.subx.html index 8db50f60..09c8b9be 100644 --- a/html/070new-stream.subx.html +++ b/html/070new-stream.subx.html @@ -64,7 +64,7 @@ if ('onhashchange' in window) { <span id="L5" class="LineNr"> 5 </span><span class="subxS1Comment"># . op subop mod rm32 base index scale r32</span> <span id="L6" class="LineNr"> 6 </span><span class="subxS1Comment"># . 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</span> <span id="L7" class="LineNr"> 7 </span> -<span id="L8" class="LineNr"> 8 </span><span class="subxFunction">new-stream</span>: <span class="subxComment"># ad : (address allocation-descriptor), length : int, elemsize : int -> address/eax : (handle stream _)</span> +<span id="L8" class="LineNr"> 8 </span><span class="subxFunction">new-stream</span>: <span class="subxComment"># ad : (addr allocation-descriptor), length : int, elemsize : int -> address/eax : (handle stream _)</span> <span id="L9" class="LineNr"> 9 </span> <span class="subxS1Comment"># . prologue</span> <span id="L10" class="LineNr"> 10 </span> 55/push-ebp <span id="L11" class="LineNr"> 11 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> diff --git a/html/071read-line.subx.html b/html/071read-line.subx.html index b97cc706..8abf926d 100644 --- a/html/071read-line.subx.html +++ b/html/071read-line.subx.html @@ -66,7 +66,7 @@ if ('onhashchange' in window) { <span id="L6" class="LineNr"> 6 </span><span class="subxComment"># read bytes from 'f' until (and including) a newline and store them into 's'</span> <span id="L7" class="LineNr"> 7 </span><span class="subxComment"># 's' fails to grow if and only if no data found</span> <span id="L8" class="LineNr"> 8 </span><span class="subxComment"># just abort if 's' is too small</span> -<span id="L9" class="LineNr"> 9 </span><span class="subxFunction">read-line-buffered</span>: <span class="subxComment"># f : (address buffered-file), s : (address stream byte)</span> +<span id="L9" class="LineNr"> 9 </span><span class="subxFunction">read-line-buffered</span>: <span class="subxComment"># f : (addr buffered-file), s : (addr stream byte)</span> <span id="L10" class="LineNr"> 10 </span> <span class="subxComment"># pseudocode:</span> <span id="L11" class="LineNr"> 11 </span> <span class="subxComment"># while true</span> <span id="L12" class="LineNr"> 12 </span> <span class="subxComment"># if (s->write >= s->length) abort</span> @@ -276,7 +276,7 @@ if ('onhashchange' in window) { <span id="L216" class="LineNr">216 </span><span class="subxComment"># read bytes from 'f' until (and including) a newline and store them into 's'</span> <span id="L217" class="LineNr">217 </span><span class="subxComment"># 's' fails to grow if and only if no data found</span> <span id="L218" class="LineNr">218 </span><span class="subxComment"># just abort if 's' is too small</span> -<span id="L219" class="LineNr">219 </span><span class="subxFunction">read-line</span>: <span class="subxComment"># f : (address stream byte), s : (address stream byte)</span> +<span id="L219" class="LineNr">219 </span><span class="subxFunction">read-line</span>: <span class="subxComment"># f : (addr stream byte), s : (addr stream byte)</span> <span id="L220" class="LineNr">220 </span> <span class="subxComment"># pseudocode:</span> <span id="L221" class="LineNr">221 </span> <span class="subxComment"># while true</span> <span id="L222" class="LineNr">222 </span> <span class="subxComment"># if (s->write >= s->length) abort</span> diff --git a/html/072slice.subx.html b/html/072slice.subx.html index 6a525e2e..8176b4d7 100644 --- a/html/072slice.subx.html +++ b/html/072slice.subx.html @@ -67,7 +67,7 @@ if ('onhashchange' in window) { <span id="L6" class="LineNr"> 6 </span><span class="subxS1Comment"># . op subop mod rm32 base index scale r32</span> <span id="L7" class="LineNr"> 7 </span><span class="subxS1Comment"># . 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</span> <span id="L8" class="LineNr"> 8 </span> -<span id="L9" class="LineNr"> 9 </span><span class="subxFunction">slice-empty?</span>: <span class="subxComment"># s : (address slice) -> eax : boolean</span> +<span id="L9" class="LineNr"> 9 </span><span class="subxFunction">slice-empty?</span>: <span class="subxComment"># s : (addr slice) -> eax : boolean</span> <span id="L10" class="LineNr"> 10 </span> <span class="subxS1Comment"># . prologue</span> <span id="L11" class="LineNr"> 11 </span> 55/push-ebp <span id="L12" class="LineNr"> 12 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -149,7 +149,7 @@ if ('onhashchange' in window) { <span id="L88" class="LineNr"> 88 </span> 5d/pop-to-ebp <span id="L89" class="LineNr"> 89 </span> c3/return <span id="L90" class="LineNr"> 90 </span> -<span id="L91" class="LineNr"> 91 </span><span class="subxFunction">slice-equal?</span>: <span class="subxComment"># s : (address slice), p : (address array byte) -> eax : boolean</span> +<span id="L91" class="LineNr"> 91 </span><span class="subxFunction">slice-equal?</span>: <span class="subxComment"># s : (addr slice), p : (addr array byte) -> eax : boolean</span> <span id="L92" class="LineNr"> 92 </span> <span class="subxComment"># pseudocode:</span> <span id="L93" class="LineNr"> 93 </span> <span class="subxComment"># if (p == 0) return (s == 0)</span> <span id="L94" class="LineNr"> 94 </span> <span class="subxComment"># currs = s->start</span> @@ -179,9 +179,9 @@ if ('onhashchange' in window) { <span id="L118" class="LineNr"> 118 </span> 56/push-esi <span id="L119" class="LineNr"> 119 </span> <span class="subxComment"># esi = s</span> <span id="L120" class="LineNr"> 120 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to esi</span> -<span id="L121" class="LineNr"> 121 </span> <span class="subxComment"># var currs/edx : (address byte) = s->start</span> +<span id="L121" class="LineNr"> 121 </span> <span class="subxComment"># var currs/edx : (addr byte) = s->start</span> <span id="L122" class="LineNr"> 122 </span> 8b/copy 0/mod/indirect 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *esi to edx</span> -<span id="L123" class="LineNr"> 123 </span> <span class="subxComment"># var maxs/esi : (address byte) = s->end</span> +<span id="L123" class="LineNr"> 123 </span> <span class="subxComment"># var maxs/esi : (addr byte) = s->end</span> <span id="L124" class="LineNr"> 124 </span> 8b/copy 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(esi+4) to esi</span> <span id="L125" class="LineNr"> 125 </span> <span class="subxComment"># var slen/eax : int = maxs - currs</span> <span id="L126" class="LineNr"> 126 </span> 89/copy 3/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esi to eax</span> @@ -200,7 +200,7 @@ if ('onhashchange' in window) { <span id="L139" class="LineNr"> 139 </span> <span class="subxComment"># if (slen != p->length) return false</span> <span id="L140" class="LineNr"> 140 </span> 39/compare 0/mod/indirect 3/rm32/ebx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># compare *ebx and eax</span> <span id="L141" class="LineNr"> 141 </span> 75/jump-if-not-equal $slice-equal?:false/disp8 -<span id="L142" class="LineNr"> 142 </span> <span class="subxComment"># var currp/ebx : (address byte) = p->data</span> +<span id="L142" class="LineNr"> 142 </span> <span class="subxComment"># var currp/ebx : (addr byte) = p->data</span> <span id="L143" class="LineNr"> 143 </span> 81 0/subop/add 3/mod/direct 3/rm32/ebx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to ebx</span> <span id="L144" class="LineNr"> 144 </span> <span class="subxComment"># var c1/eax : byte = 0</span> <span id="L145" class="LineNr"> 145 </span> 31/xor 3/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># clear eax</span> @@ -516,7 +516,7 @@ if ('onhashchange' in window) { <span id="L455" class="LineNr"> 455 </span> 5d/pop-to-ebp <span id="L456" class="LineNr"> 456 </span> c3/return <span id="L457" class="LineNr"> 457 </span> -<span id="L458" class="LineNr"> 458 </span><span class="subxFunction">slice-starts-with?</span>: <span class="subxComment"># s : (address slice), head : (address array byte) -> eax : boolean</span> +<span id="L458" class="LineNr"> 458 </span><span class="subxFunction">slice-starts-with?</span>: <span class="subxComment"># s : (addr slice), head : (addr array byte) -> eax : boolean</span> <span id="L459" class="LineNr"> 459 </span> <span class="subxComment"># pseudocode</span> <span id="L460" class="LineNr"> 460 </span> <span class="subxComment"># lenh = head->length</span> <span id="L461" class="LineNr"> 461 </span> <span class="subxComment"># if (lenh > s->end - s->start) return false</span> @@ -559,9 +559,9 @@ if ('onhashchange' in window) { <span id="L498" class="LineNr"> 498 </span> <span class="subxComment"># if (lenh > lens) return false</span> <span id="L499" class="LineNr"> 499 </span> 39/compare 3/mod/direct 2/rm32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># compare edx with ecx</span> <span id="L500" class="LineNr"> 500 </span> 7f/jump-if-greater $slice-starts-with?:false/disp8 -<span id="L501" class="LineNr"> 501 </span> <span class="subxComment"># var currs/esi : (address byte) = s->start</span> +<span id="L501" class="LineNr"> 501 </span> <span class="subxComment"># var currs/esi : (addr byte) = s->start</span> <span id="L502" class="LineNr"> 502 </span> 8b/subtract 0/mod/indirect 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *esi to esi</span> -<span id="L503" class="LineNr"> 503 </span> <span class="subxComment"># var currh/edi : (address byte) = head->data</span> +<span id="L503" class="LineNr"> 503 </span> <span class="subxComment"># var currh/edi : (addr byte) = head->data</span> <span id="L504" class="LineNr"> 504 </span> 81 0/subop/add 3/mod/direct 7/rm32/edi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to edi</span> <span id="L505" class="LineNr"> 505 </span> <span class="subxComment"># var i/ecx : int = 0</span> <span id="L506" class="LineNr"> 506 </span> 31/xor 3/mod/direct 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># clear ecx</span> @@ -822,7 +822,7 @@ if ('onhashchange' in window) { <span id="L761" class="LineNr"> 761 </span> <span id="L762" class="LineNr"> 762 </span><span class="subxComment"># write a slice to a stream</span> <span id="L763" class="LineNr"> 763 </span><span class="subxComment"># abort if the stream doesn't have enough space</span> -<span id="L764" class="LineNr"> 764 </span><span class="subxFunction">write-slice</span>: <span class="subxComment"># out : (address stream byte), s : (address slice)</span> +<span id="L764" class="LineNr"> 764 </span><span class="subxFunction">write-slice</span>: <span class="subxComment"># out : (addr stream byte), s : (addr slice)</span> <span id="L765" class="LineNr"> 765 </span> <span class="subxS1Comment"># . prologue</span> <span id="L766" class="LineNr"> 766 </span> 55/push-ebp <span id="L767" class="LineNr"> 767 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -835,9 +835,9 @@ if ('onhashchange' in window) { <span id="L774" class="LineNr"> 774 </span> 57/push-edi <span id="L775" class="LineNr"> 775 </span> <span class="subxComment"># esi = s</span> <span id="L776" class="LineNr"> 776 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+12) to esi</span> -<span id="L777" class="LineNr"> 777 </span> <span class="subxComment"># var curr/ecx : (address byte) = s->start</span> +<span id="L777" class="LineNr"> 777 </span> <span class="subxComment"># var curr/ecx : (addr byte) = s->start</span> <span id="L778" class="LineNr"> 778 </span> 8b/copy 0/mod/indirect 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *esi to ecx</span> -<span id="L779" class="LineNr"> 779 </span> <span class="subxComment"># var max/esi : (address byte) = s->end</span> +<span id="L779" class="LineNr"> 779 </span> <span class="subxComment"># var max/esi : (addr byte) = s->end</span> <span id="L780" class="LineNr"> 780 </span> 8b/copy 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(esi+4) to esi</span> <span id="L781" class="LineNr"> 781 </span> <span class="subxComment"># edi = out</span> <span id="L782" class="LineNr"> 782 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> 7/r32/edi 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to edi</span> @@ -938,7 +938,7 @@ if ('onhashchange' in window) { <span id="L877" class="LineNr"> 877 </span> c3/return <span id="L878" class="LineNr"> 878 </span> <span id="L879" class="LineNr"> 879 </span><span class="subxComment"># write a slice to a buffered-file</span> -<span id="L880" class="LineNr"> 880 </span><span class="subxFunction">write-slice-buffered</span>: <span class="subxComment"># out : (address buffered-file), s : (address slice)</span> +<span id="L880" class="LineNr"> 880 </span><span class="subxFunction">write-slice-buffered</span>: <span class="subxComment"># out : (addr buffered-file), s : (addr slice)</span> <span id="L881" class="LineNr"> 881 </span> <span class="subxS1Comment"># . prologue</span> <span id="L882" class="LineNr"> 882 </span> 55/push-ebp <span id="L883" class="LineNr"> 883 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -951,9 +951,9 @@ if ('onhashchange' in window) { <span id="L890" class="LineNr"> 890 </span> 57/push-edi <span id="L891" class="LineNr"> 891 </span> <span class="subxComment"># esi = s</span> <span id="L892" class="LineNr"> 892 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+12) to esi</span> -<span id="L893" class="LineNr"> 893 </span> <span class="subxComment"># var curr/ecx : (address byte) = s->start</span> +<span id="L893" class="LineNr"> 893 </span> <span class="subxComment"># var curr/ecx : (addr byte) = s->start</span> <span id="L894" class="LineNr"> 894 </span> 8b/copy 0/mod/indirect 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *esi to ecx</span> -<span id="L895" class="LineNr"> 895 </span> <span class="subxComment"># var max/esi : (address byte) = s->end</span> +<span id="L895" class="LineNr"> 895 </span> <span class="subxComment"># var max/esi : (addr byte) = s->end</span> <span id="L896" class="LineNr"> 896 </span> 8b/copy 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(esi+4) to esi</span> <span id="L897" class="LineNr"> 897 </span> <span class="subxComment"># edi = out</span> <span id="L898" class="LineNr"> 898 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> 7/r32/edi 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to edi</span> @@ -1073,7 +1073,7 @@ if ('onhashchange' in window) { <span id="L1012" class="LineNr">1012 </span> c3/return <span id="L1013" class="LineNr">1013 </span> <span id="L1014" class="LineNr">1014 </span><span class="subxComment"># copy a slice into a new (dynamically allocated) string</span> -<span id="L1015" class="LineNr">1015 </span><span class="subxFunction">slice-to-string</span>: <span class="subxComment"># ad : (address allocation-descriptor), in : (address slice) -> out/eax : (address array byte)</span> +<span id="L1015" class="LineNr">1015 </span><span class="subxFunction">slice-to-string</span>: <span class="subxComment"># ad : (addr allocation-descriptor), in : (addr slice) -> out/eax : (addr array byte)</span> <span id="L1016" class="LineNr">1016 </span> <span class="subxS1Comment"># . prologue</span> <span id="L1017" class="LineNr">1017 </span> 55/push-ebp <span id="L1018" class="LineNr">1018 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -1084,9 +1084,9 @@ if ('onhashchange' in window) { <span id="L1023" class="LineNr">1023 </span> 56/push-esi <span id="L1024" class="LineNr">1024 </span> <span class="subxComment"># esi = in</span> <span id="L1025" class="LineNr">1025 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+12) to esi</span> -<span id="L1026" class="LineNr">1026 </span> <span class="subxComment"># var curr/edx : (address byte) = in->start</span> +<span id="L1026" class="LineNr">1026 </span> <span class="subxComment"># var curr/edx : (addr byte) = in->start</span> <span id="L1027" class="LineNr">1027 </span> 8b/copy 0/mod/indirect 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *esi to edx</span> -<span id="L1028" class="LineNr">1028 </span> <span class="subxComment"># var max/ebx : (address byte) = in->end</span> +<span id="L1028" class="LineNr">1028 </span> <span class="subxComment"># var max/ebx : (addr byte) = in->end</span> <span id="L1029" class="LineNr">1029 </span> 8b/copy 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 3/r32/ebx 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(esi+4) to ebx</span> <span id="L1030" class="LineNr">1030 </span> <span class="subxComment"># var size/ecx : int = max - curr + 4 # total size of output string (including the initial length)</span> <span id="L1031" class="LineNr">1031 </span> 89/copy 3/mod/direct 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 3/r32/ebx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ebx to ecx</span> diff --git a/html/073next-token.subx.html b/html/073next-token.subx.html index 8fa3ac22..4165500e 100644 --- a/html/073next-token.subx.html +++ b/html/073next-token.subx.html @@ -66,7 +66,7 @@ if ('onhashchange' in window) { <span id="L7" class="LineNr"> 7 </span> <span id="L8" class="LineNr"> 8 </span><span class="subxComment"># extract the next run of characters that are different from a given 'delimiter' (skipping multiple delimiters if necessary)</span> <span id="L9" class="LineNr"> 9 </span><span class="subxComment"># on reaching end of file, return an empty interval</span> -<span id="L10" class="LineNr"> 10 </span><span class="subxFunction">next-token</span>: <span class="subxComment"># in : (address stream byte), delimiter : byte, out : (address slice)</span> +<span id="L10" class="LineNr"> 10 </span><span class="subxFunction">next-token</span>: <span class="subxComment"># in : (addr stream byte), delimiter : byte, out : (addr slice)</span> <span id="L11" class="LineNr"> 11 </span> <span class="subxS1Comment"># . prologue</span> <span id="L12" class="LineNr"> 12 </span> 55/push-ebp <span id="L13" class="LineNr"> 13 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -219,7 +219,7 @@ if ('onhashchange' in window) { <span id="L160" class="LineNr"> 160 </span> <span id="L161" class="LineNr"> 161 </span><span class="subxComment"># extract the next run of characters that are different from a given 'delimiter' (skipping multiple delimiters if necessary)</span> <span id="L162" class="LineNr"> 162 </span><span class="subxComment"># on reaching end of file, return an empty interval</span> -<span id="L163" class="LineNr"> 163 </span><span class="subxFunction">next-token-from-slice</span>: <span class="subxComment"># start : (address byte), end : (address byte), delimiter : byte, out : (address slice)</span> +<span id="L163" class="LineNr"> 163 </span><span class="subxFunction">next-token-from-slice</span>: <span class="subxComment"># start : (addr byte), end : (addr byte), delimiter : byte, out : (addr slice)</span> <span id="L164" class="LineNr"> 164 </span> <span class="subxS1Comment"># . prologue</span> <span id="L165" class="LineNr"> 165 </span> 55/push-ebp <span id="L166" class="LineNr"> 166 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -397,7 +397,7 @@ if ('onhashchange' in window) { <span id="L338" class="LineNr"> 338 </span> 5d/pop-to-ebp <span id="L339" class="LineNr"> 339 </span> c3/return <span id="L340" class="LineNr"> 340 </span> -<span id="L341" class="LineNr"> 341 </span><span class="subxFunction">skip-chars-matching</span>: <span class="subxComment"># in : (address stream byte), delimiter : byte</span> +<span id="L341" class="LineNr"> 341 </span><span class="subxFunction">skip-chars-matching</span>: <span class="subxComment"># in : (addr stream byte), delimiter : byte</span> <span id="L342" class="LineNr"> 342 </span> <span class="subxS1Comment"># . prologue</span> <span id="L343" class="LineNr"> 343 </span> 55/push-ebp <span id="L344" class="LineNr"> 344 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -520,7 +520,7 @@ if ('onhashchange' in window) { <span id="L461" class="LineNr"> 461 </span> <span class="subxComment"># end</span> <span id="L462" class="LineNr"> 462 </span> c3/return <span id="L463" class="LineNr"> 463 </span> -<span id="L464" class="LineNr"> 464 </span><span class="subxFunction">skip-chars-matching-whitespace</span>: <span class="subxComment"># in : (address stream byte)</span> +<span id="L464" class="LineNr"> 464 </span><span class="subxFunction">skip-chars-matching-whitespace</span>: <span class="subxComment"># in : (addr stream byte)</span> <span id="L465" class="LineNr"> 465 </span> <span class="subxS1Comment"># . prologue</span> <span id="L466" class="LineNr"> 466 </span> 55/push-ebp <span id="L467" class="LineNr"> 467 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -610,7 +610,7 @@ if ('onhashchange' in window) { <span id="L551" class="LineNr"> 551 </span> c3/return <span id="L552" class="LineNr"> 552 </span> <span id="L553" class="LineNr"> 553 </span><span class="subxComment"># minor fork of 'skip-chars-matching'</span> -<span id="L554" class="LineNr"> 554 </span><span class="subxFunction">skip-chars-not-matching</span>: <span class="subxComment"># in : (address stream byte), delimiter : byte</span> +<span id="L554" class="LineNr"> 554 </span><span class="subxFunction">skip-chars-not-matching</span>: <span class="subxComment"># in : (addr stream byte), delimiter : byte</span> <span id="L555" class="LineNr"> 555 </span> <span class="subxS1Comment"># . prologue</span> <span id="L556" class="LineNr"> 556 </span> 55/push-ebp <span id="L557" class="LineNr"> 557 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -772,7 +772,7 @@ if ('onhashchange' in window) { <span id="L713" class="LineNr"> 713 </span> <span class="subxComment"># end</span> <span id="L714" class="LineNr"> 714 </span> c3/return <span id="L715" class="LineNr"> 715 </span> -<span id="L716" class="LineNr"> 716 </span><span class="subxFunction">skip-chars-not-matching-whitespace</span>: <span class="subxComment"># in : (address stream byte)</span> +<span id="L716" class="LineNr"> 716 </span><span class="subxFunction">skip-chars-not-matching-whitespace</span>: <span class="subxComment"># in : (addr stream byte)</span> <span id="L717" class="LineNr"> 717 </span> <span class="subxS1Comment"># . prologue</span> <span id="L718" class="LineNr"> 718 </span> 55/push-ebp <span id="L719" class="LineNr"> 719 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -860,7 +860,7 @@ if ('onhashchange' in window) { <span id="L801" class="LineNr"> 801 </span> <span class="subxComment"># end</span> <span id="L802" class="LineNr"> 802 </span> c3/return <span id="L803" class="LineNr"> 803 </span> -<span id="L804" class="LineNr"> 804 </span><span class="subxFunction">skip-chars-matching-in-slice</span>: <span class="subxComment"># curr : (address byte), end : (address byte), delimiter : byte -> curr/eax</span> +<span id="L804" class="LineNr"> 804 </span><span class="subxFunction">skip-chars-matching-in-slice</span>: <span class="subxComment"># curr : (addr byte), end : (addr byte), delimiter : byte -> curr/eax</span> <span id="L805" class="LineNr"> 805 </span> <span class="subxS1Comment"># . prologue</span> <span id="L806" class="LineNr"> 806 </span> 55/push-ebp <span id="L807" class="LineNr"> 807 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -956,7 +956,7 @@ if ('onhashchange' in window) { <span id="L897" class="LineNr"> 897 </span> <span class="subxComment"># end</span> <span id="L898" class="LineNr"> 898 </span> c3/return <span id="L899" class="LineNr"> 899 </span> -<span id="L900" class="LineNr"> 900 </span><span class="subxFunction">skip-chars-matching-whitespace-in-slice</span>: <span class="subxComment"># curr : (address byte), end : (address byte) -> curr/eax</span> +<span id="L900" class="LineNr"> 900 </span><span class="subxFunction">skip-chars-matching-whitespace-in-slice</span>: <span class="subxComment"># curr : (addr byte), end : (addr byte) -> curr/eax</span> <span id="L901" class="LineNr"> 901 </span> <span class="subxS1Comment"># . prologue</span> <span id="L902" class="LineNr"> 902 </span> 55/push-ebp <span id="L903" class="LineNr"> 903 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -1029,7 +1029,7 @@ if ('onhashchange' in window) { <span id="L970" class="LineNr"> 970 </span> c3/return <span id="L971" class="LineNr"> 971 </span> <span id="L972" class="LineNr"> 972 </span><span class="subxComment"># minor fork of 'skip-chars-matching-in-slice'</span> -<span id="L973" class="LineNr"> 973 </span><span class="subxFunction">skip-chars-not-matching-in-slice</span>: <span class="subxComment"># curr : (address byte), end : (address byte), delimiter : byte -> curr/eax</span> +<span id="L973" class="LineNr"> 973 </span><span class="subxFunction">skip-chars-not-matching-in-slice</span>: <span class="subxComment"># curr : (addr byte), end : (addr byte), delimiter : byte -> curr/eax</span> <span id="L974" class="LineNr"> 974 </span> <span class="subxS1Comment"># . prologue</span> <span id="L975" class="LineNr"> 975 </span> 55/push-ebp <span id="L976" class="LineNr"> 976 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -1154,7 +1154,7 @@ if ('onhashchange' in window) { <span id="L1095" class="LineNr">1095 </span> <span class="subxComment"># end</span> <span id="L1096" class="LineNr">1096 </span> c3/return <span id="L1097" class="LineNr">1097 </span> -<span id="L1098" class="LineNr">1098 </span><span class="subxFunction">skip-chars-not-matching-whitespace-in-slice</span>: <span class="subxComment"># curr : (address byte), end : (address byte) -> curr/eax</span> +<span id="L1098" class="LineNr">1098 </span><span class="subxFunction">skip-chars-not-matching-whitespace-in-slice</span>: <span class="subxComment"># curr : (addr byte), end : (addr byte) -> curr/eax</span> <span id="L1099" class="LineNr">1099 </span> <span class="subxS1Comment"># . prologue</span> <span id="L1100" class="LineNr">1100 </span> 55/push-ebp <span id="L1101" class="LineNr">1101 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -1227,7 +1227,7 @@ if ('onhashchange' in window) { <span id="L1168" class="LineNr">1168 </span> <span id="L1169" class="LineNr">1169 </span><span class="subxComment"># update line->read to end of string literal surrounded by double quotes</span> <span id="L1170" class="LineNr">1170 </span><span class="subxComment"># line->read must start out at a double-quote</span> -<span id="L1171" class="LineNr">1171 </span><span class="subxFunction">skip-string</span>: <span class="subxComment"># line : (address stream byte)</span> +<span id="L1171" class="LineNr">1171 </span><span class="subxFunction">skip-string</span>: <span class="subxComment"># line : (addr stream byte)</span> <span id="L1172" class="LineNr">1172 </span> <span class="subxS1Comment"># . prologue</span> <span id="L1173" class="LineNr">1173 </span> 55/push-ebp <span id="L1174" class="LineNr">1174 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -1469,7 +1469,7 @@ if ('onhashchange' in window) { <span id="L1410" class="LineNr">1410 </span> 5d/pop-to-ebp <span id="L1411" class="LineNr">1411 </span> c3/return <span id="L1412" class="LineNr">1412 </span> -<span id="L1413" class="LineNr">1413 </span><span class="subxFunction">skip-string-in-slice</span>: <span class="subxComment"># curr : (address byte), end : (address byte) -> new_curr/eax</span> +<span id="L1413" class="LineNr">1413 </span><span class="subxFunction">skip-string-in-slice</span>: <span class="subxComment"># curr : (addr byte), end : (addr byte) -> new_curr/eax</span> <span id="L1414" class="LineNr">1414 </span> <span class="subxS1Comment"># . prologue</span> <span id="L1415" class="LineNr">1415 </span> 55/push-ebp <span id="L1416" class="LineNr">1416 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -1655,7 +1655,7 @@ if ('onhashchange' in window) { <span id="L1596" class="LineNr">1596 </span> <span id="L1597" class="LineNr">1597 </span><span class="subxComment"># update line->read to ')'</span> <span id="L1598" class="LineNr">1598 </span><span class="subxComment"># line->read ends at ')'</span> -<span id="L1599" class="LineNr">1599 </span><span class="subxFunction">skip-until-close-paren</span>: <span class="subxComment"># line : (address stream byte)</span> +<span id="L1599" class="LineNr">1599 </span><span class="subxFunction">skip-until-close-paren</span>: <span class="subxComment"># line : (addr stream byte)</span> <span id="L1600" class="LineNr">1600 </span> <span class="subxS1Comment"># . prologue</span> <span id="L1601" class="LineNr">1601 </span> 55/push-ebp <span id="L1602" class="LineNr">1602 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -1842,7 +1842,7 @@ if ('onhashchange' in window) { <span id="L1783" class="LineNr">1783 </span> 5d/pop-to-ebp <span id="L1784" class="LineNr">1784 </span> c3/return <span id="L1785" class="LineNr">1785 </span> -<span id="L1786" class="LineNr">1786 </span><span class="subxFunction">skip-until-close-paren-in-slice</span>: <span class="subxComment"># curr : (address byte), end : (address byte) -> new_curr/eax : (address byte)</span> +<span id="L1786" class="LineNr">1786 </span><span class="subxFunction">skip-until-close-paren-in-slice</span>: <span class="subxComment"># curr : (addr byte), end : (addr byte) -> new_curr/eax : (addr byte)</span> <span id="L1787" class="LineNr">1787 </span> <span class="subxS1Comment"># . prologue</span> <span id="L1788" class="LineNr">1788 </span> 55/push-ebp <span id="L1789" class="LineNr">1789 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> diff --git a/html/074write-stream-data.subx.html b/html/074write-stream-data.subx.html index 9f9f5aa4..5ea6ff9a 100644 --- a/html/074write-stream-data.subx.html +++ b/html/074write-stream-data.subx.html @@ -67,7 +67,7 @@ if ('onhashchange' in window) { <span id="L8" class="LineNr"> 8 </span><span class="subxComment"># - construct a 'maximal slice' and pass it to write-slice-buffered</span> <span id="L9" class="LineNr"> 9 </span><span class="subxComment"># - flush the buffered-file and pass the stream directly to its fd (disabling buffering)</span> <span id="L10" class="LineNr"> 10 </span><span class="subxComment"># we'll go with the first way for now</span> -<span id="L11" class="LineNr"> 11 </span><span class="subxFunction">write-stream-data</span>: <span class="subxComment"># f : (address buffered-file), s : (address stream byte)</span> +<span id="L11" class="LineNr"> 11 </span><span class="subxFunction">write-stream-data</span>: <span class="subxComment"># f : (addr buffered-file), s : (addr stream byte)</span> <span id="L12" class="LineNr"> 12 </span> <span class="subxS1Comment"># . prologue</span> <span id="L13" class="LineNr"> 13 </span> 55/push-ebp <span id="L14" class="LineNr"> 14 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> diff --git a/html/075print-int-decimal.subx.html b/html/075print-int-decimal.subx.html index 88ace8b1..e811484b 100644 --- a/html/075print-int-decimal.subx.html +++ b/html/075print-int-decimal.subx.html @@ -66,7 +66,7 @@ if ('onhashchange' in window) { <span id="L5" class="LineNr"> 5 </span><span class="subxS1Comment"># . op subop mod rm32 base index scale r32</span> <span id="L6" class="LineNr"> 6 </span><span class="subxS1Comment"># . 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</span> <span id="L7" class="LineNr"> 7 </span> -<span id="L8" class="LineNr"> 8 </span><span class="subxFunction">print-int32-decimal</span>: <span class="subxComment"># out : (address stream byte), n : int32</span> +<span id="L8" class="LineNr"> 8 </span><span class="subxFunction">print-int32-decimal</span>: <span class="subxComment"># out : (addr stream byte), n : int32</span> <span id="L9" class="LineNr"> 9 </span> <span class="subxComment"># works by generating characters from lowest to highest and pushing them</span> <span id="L10" class="LineNr"> 10 </span> <span class="subxComment"># to the stack, before popping them one by one into the stream</span> <span id="L11" class="LineNr"> 11 </span> <span class="subxComment">#</span> @@ -137,9 +137,9 @@ if ('onhashchange' in window) { <span id="L76" class="LineNr"> 76 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 7/r32/edi 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to edi</span> <span id="L77" class="LineNr"> 77 </span> <span class="subxComment"># var w/edx : int = out->write</span> <span id="L78" class="LineNr"> 78 </span> 8b/copy 0/mod/indirect 7/rm32/edi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *edi to edx</span> -<span id="L79" class="LineNr"> 79 </span> <span class="subxComment"># var curr/ecx : (address byte) = &out->data[out->write]</span> +<span id="L79" class="LineNr"> 79 </span> <span class="subxComment"># var curr/ecx : (addr byte) = &out->data[out->write]</span> <span id="L80" class="LineNr"> 80 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 7/base/edi 2/index/edx <span class="Normal"> . </span> 1/r32/ecx 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy ebx+edx+12 to ecx</span> -<span id="L81" class="LineNr"> 81 </span> <span class="subxComment"># var max/ebx : (address byte) = &out->data[out->length]</span> +<span id="L81" class="LineNr"> 81 </span> <span class="subxComment"># var max/ebx : (addr byte) = &out->data[out->length]</span> <span id="L82" class="LineNr"> 82 </span> 8b/copy 1/mod/*+disp8 7/rm32/edi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 3/r32/ebx 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(edi+8) to ebx</span> <span id="L83" class="LineNr"> 83 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 7/base/edi 3/index/ebx <span class="Normal"> . </span> 3/r32/ebx 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy edi+ebx+12 to ebx</span> <span id="L84" class="LineNr"> 84 </span><span class="Constant">$print-int32-decimal:write-loop</span>: diff --git a/html/076next-word.subx.html b/html/076next-word.subx.html index c383fbd9..5eae28e9 100644 --- a/html/076next-word.subx.html +++ b/html/076next-word.subx.html @@ -66,7 +66,7 @@ if ('onhashchange' in window) { <span id="L7" class="LineNr"> 7 </span> <span id="L8" class="LineNr"> 8 </span><span class="subxComment"># (re)compute the bounds of the next word in the line</span> <span id="L9" class="LineNr"> 9 </span><span class="subxComment"># return empty string on reaching end of file</span> -<span id="L10" class="LineNr"> 10 </span><span class="subxFunction">next-word</span>: <span class="subxComment"># line : (address stream byte), out : (address slice)</span> +<span id="L10" class="LineNr"> 10 </span><span class="subxFunction">next-word</span>: <span class="subxComment"># line : (addr stream byte), out : (addr slice)</span> <span id="L11" class="LineNr"> 11 </span> <span class="subxS1Comment"># . prologue</span> <span id="L12" class="LineNr"> 12 </span> 55/push-ebp <span id="L13" class="LineNr"> 13 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> diff --git a/html/077subx-words.subx.html b/html/077subx-words.subx.html index df5994ba..e45bfd7f 100644 --- a/html/077subx-words.subx.html +++ b/html/077subx-words.subx.html @@ -64,7 +64,7 @@ if ('onhashchange' in window) { <span id="L5" class="LineNr"> 5 </span><span class="subxS1Comment"># . op subop mod rm32 base index scale r32</span> <span id="L6" class="LineNr"> 6 </span><span class="subxS1Comment"># . 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</span> <span id="L7" class="LineNr"> 7 </span> -<span id="L8" class="LineNr"> 8 </span><span class="subxFunction">has-metadata?</span>: <span class="subxComment"># word : (address slice), s : (address string) -> eax : boolean</span> +<span id="L8" class="LineNr"> 8 </span><span class="subxFunction">has-metadata?</span>: <span class="subxComment"># word : (addr slice), s : (addr string) -> eax : boolean</span> <span id="L9" class="LineNr"> 9 </span> <span class="subxComment"># pseudocode:</span> <span id="L10" class="LineNr"> 10 </span> <span class="subxComment"># var twig : &slice = next-token-from-slice(word->start, word->end, '/') # skip name</span> <span id="L11" class="LineNr"> 11 </span> <span class="subxComment"># curr = twig->end</span> @@ -84,7 +84,7 @@ if ('onhashchange' in window) { <span id="L25" class="LineNr"> 25 </span> 57/push-edi <span id="L26" class="LineNr"> 26 </span> <span class="subxComment"># esi = word</span> <span id="L27" class="LineNr"> 27 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to esi</span> -<span id="L28" class="LineNr"> 28 </span> <span class="subxComment"># var edx : (address byte) = word->end</span> +<span id="L28" class="LineNr"> 28 </span> <span class="subxComment"># var edx : (addr byte) = word->end</span> <span id="L29" class="LineNr"> 29 </span> 8b/copy 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(esi+4) to edx</span> <span id="L30" class="LineNr"> 30 </span> <span class="subxComment"># var twig/edi : (ref slice)</span> <span id="L31" class="LineNr"> 31 </span> 68/push 0/imm32/end @@ -334,7 +334,7 @@ if ('onhashchange' in window) { <span id="L275" class="LineNr">275 </span><span class="subxComment">#: - if it starts with '0x' it's treated as a number. (redundant)</span> <span id="L276" class="LineNr">276 </span><span class="subxComment">#: - if it's two characters long, it can't be a name. Either it's a hex</span> <span id="L277" class="LineNr">277 </span><span class="subxComment">#: byte, or it raises an error.</span> -<span id="L278" class="LineNr">278 </span><span class="subxFunction">is-valid-name?</span>: <span class="subxComment"># in : (address slice) -> eax : boolean</span> +<span id="L278" class="LineNr">278 </span><span class="subxFunction">is-valid-name?</span>: <span class="subxComment"># in : (addr slice) -> eax : boolean</span> <span id="L279" class="LineNr">279 </span> <span class="subxS1Comment"># . prologue</span> <span id="L280" class="LineNr">280 </span> 55/push-ebp <span id="L281" class="LineNr">281 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -343,7 +343,7 @@ if ('onhashchange' in window) { <span id="L284" class="LineNr">284 </span> 56/push-esi <span id="L285" class="LineNr">285 </span> <span class="subxComment"># esi = in</span> <span id="L286" class="LineNr">286 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to esi</span> -<span id="L287" class="LineNr">287 </span> <span class="subxComment"># var start/ecx : (address byte) = in->start</span> +<span id="L287" class="LineNr">287 </span> <span class="subxComment"># var start/ecx : (addr byte) = in->start</span> <span id="L288" class="LineNr">288 </span> 8b/copy 0/mod/indirect 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *esi to ecx</span> <span id="L289" class="LineNr">289 </span><span class="Constant">$is-valid-name?:check0</span>: <span id="L290" class="LineNr">290 </span> <span class="subxComment"># if (start >= in->end) return false</span> @@ -357,7 +357,7 @@ if ('onhashchange' in window) { <span id="L298" class="LineNr">298 </span> 3d/compare-eax-and 2/imm32 <span id="L299" class="LineNr">299 </span> 74/jump-if-equal $is-valid-name?:false/disp8 <span id="L300" class="LineNr">300 </span><span class="Constant">$is-valid-name?:check2</span>: -<span id="L301" class="LineNr">301 </span> <span class="subxComment"># var c/eax : (address byte) = *start</span> +<span id="L301" class="LineNr">301 </span> <span class="subxComment"># var c/eax : (addr byte) = *start</span> <span id="L302" class="LineNr">302 </span> 31/xor 3/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># clear eax</span> <span id="L303" class="LineNr">303 </span> 8a/copy-byte 0/mod/indirect 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/AL <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy byte at *ecx to AL</span> <span id="L304" class="LineNr">304 </span> <span class="subxComment"># if (c == "-") return false</span> @@ -591,7 +591,7 @@ if ('onhashchange' in window) { <span id="L532" class="LineNr">532 </span> 5d/pop-to-ebp <span id="L533" class="LineNr">533 </span> c3/return <span id="L534" class="LineNr">534 </span> -<span id="L535" class="LineNr">535 </span><span class="subxFunction">is-label?</span>: <span class="subxComment"># word : (address slice) -> eax : boolean</span> +<span id="L535" class="LineNr">535 </span><span class="subxFunction">is-label?</span>: <span class="subxComment"># word : (addr slice) -> eax : boolean</span> <span id="L536" class="LineNr">536 </span> <span class="subxS1Comment"># . prologue</span> <span id="L537" class="LineNr">537 </span> 55/push-ebp <span id="L538" class="LineNr">538 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -599,7 +599,7 @@ if ('onhashchange' in window) { <span id="L540" class="LineNr">540 </span> 51/push-ecx <span id="L541" class="LineNr">541 </span> <span class="subxComment"># ecx = word</span> <span id="L542" class="LineNr">542 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to ecx</span> -<span id="L543" class="LineNr">543 </span> <span class="subxComment"># var end/ecx : (address byte) = word->end</span> +<span id="L543" class="LineNr">543 </span> <span class="subxComment"># var end/ecx : (addr byte) = word->end</span> <span id="L544" class="LineNr">544 </span> 8b/copy 1/mod/*+disp8 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ecx+4) to ecx</span> <span id="L545" class="LineNr">545 </span> <span class="subxComment"># return *(end - 1) == ':'</span> <span id="L546" class="LineNr">546 </span> <span class="subxS1Comment"># . eax = *(end-1)</span> diff --git a/html/078emit-hex.subx.html b/html/078emit-hex.subx.html index d9e0dc6a..94b7eea1 100644 --- a/html/078emit-hex.subx.html +++ b/html/078emit-hex.subx.html @@ -63,7 +63,7 @@ if ('onhashchange' in window) { <span id="L4" class="LineNr"> 4 </span><span class="subxS1Comment"># . 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</span> <span id="L5" class="LineNr"> 5 </span> <span id="L6" class="LineNr"> 6 </span><span class="subxComment"># print 'n' in hex in 'width' bytes in lower-endian order, with a space after every byte</span> -<span id="L7" class="LineNr"> 7 </span><span class="subxFunction">emit-hex</span>: <span class="subxComment"># out : (address buffered-file), n : int, width : int</span> +<span id="L7" class="LineNr"> 7 </span><span class="subxFunction">emit-hex</span>: <span class="subxComment"># out : (addr buffered-file), n : int, width : int</span> <span id="L8" class="LineNr"> 8 </span> <span class="subxS1Comment"># . prologue</span> <span id="L9" class="LineNr"> 9 </span> 55/push-ebp <span id="L10" class="LineNr"> 10 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> diff --git a/html/079emit.subx.html b/html/079emit.subx.html index ed61ad03..18e9631e 100644 --- a/html/079emit.subx.html +++ b/html/079emit.subx.html @@ -68,7 +68,7 @@ if ('onhashchange' in window) { <span id="L7" class="LineNr"> 7 </span><span class="subxComment"># it in 'width' bytes of hex, least significant first.</span> <span id="L8" class="LineNr"> 8 </span><span class="subxComment"># Otherwise just print the entire word including metadata.</span> <span id="L9" class="LineNr"> 9 </span><span class="subxComment"># Always print a trailing space.</span> -<span id="L10" class="LineNr"> 10 </span><span class="subxFunction">emit</span>: <span class="subxComment"># out : (address buffered-file), word : (address slice), width : int</span> +<span id="L10" class="LineNr"> 10 </span><span class="subxFunction">emit</span>: <span class="subxComment"># out : (addr buffered-file), word : (addr slice), width : int</span> <span id="L11" class="LineNr"> 11 </span> <span class="subxS1Comment"># . prologue</span> <span id="L12" class="LineNr"> 12 </span> 55/push-ebp <span id="L13" class="LineNr"> 13 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> diff --git a/html/080zero-out.subx.html b/html/080zero-out.subx.html index f9163495..9f39374e 100644 --- a/html/080zero-out.subx.html +++ b/html/080zero-out.subx.html @@ -64,7 +64,7 @@ if ('onhashchange' in window) { <span id="L5" class="LineNr"> 5 </span><span class="subxS1Comment"># . op subop mod rm32 base index scale r32</span> <span id="L6" class="LineNr"> 6 </span><span class="subxS1Comment"># . 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</span> <span id="L7" class="LineNr"> 7 </span> -<span id="L8" class="LineNr"> 8 </span><span class="subxFunction">zero-out</span>: <span class="subxComment"># start : (address byte), len : int</span> +<span id="L8" class="LineNr"> 8 </span><span class="subxFunction">zero-out</span>: <span class="subxComment"># start : (addr byte), len : int</span> <span id="L9" class="LineNr"> 9 </span> <span class="subxComment"># pseudocode:</span> <span id="L10" class="LineNr">10 </span> <span class="subxComment"># curr/esi = start</span> <span id="L11" class="LineNr">11 </span> <span class="subxComment"># i/ecx = 0</span> diff --git a/html/081table.subx.html b/html/081table.subx.html index 3080d171..439aec66 100644 --- a/html/081table.subx.html +++ b/html/081table.subx.html @@ -61,7 +61,7 @@ if ('onhashchange' in window) { <pre id='vimCodeElement'> <span id="L1" class="LineNr"> 1 </span><span class="subxComment"># A table is a stream of (key, value) rows.</span> <span id="L2" class="LineNr"> 2 </span><span class="subxComment">#</span> -<span id="L3" class="LineNr"> 3 </span><span class="subxComment"># Each row consists of a 4-byte key -- a 'string_key' which is (address array</span> +<span id="L3" class="LineNr"> 3 </span><span class="subxComment"># Each row consists of a 4-byte key -- a 'string_key' which is (addr array</span> <span id="L4" class="LineNr"> 4 </span><span class="subxComment"># byte) -- and a variable-size value.</span> <span id="L5" class="LineNr"> 5 </span><span class="subxComment">#</span> <span id="L6" class="LineNr"> 6 </span><span class="subxComment"># Accessing the table performs a linear scan for a key string, and always</span> @@ -84,8 +84,8 @@ if ('onhashchange' in window) { <span id="L23" class="LineNr"> 23 </span><span class="subxS1Comment"># . 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</span> <span id="L24" class="LineNr"> 24 </span> <span id="L25" class="LineNr"> 25 </span><span class="subxComment"># if no row is found, abort</span> -<span id="L26" class="LineNr"> 26 </span><span class="subxComment"># type string_key = (address array byte)</span> -<span id="L27" class="LineNr"> 27 </span><span class="subxFunction">get</span>: <span class="subxComment"># table : (address stream {string_key, T}), key : string_key, row-size : int, abort-message-prefix : (address array byte) -> eax : (address T)</span> +<span id="L26" class="LineNr"> 26 </span><span class="subxComment"># type string_key = (addr array byte)</span> +<span id="L27" class="LineNr"> 27 </span><span class="subxFunction">get</span>: <span class="subxComment"># table : (addr stream {string_key, T}), key : string_key, row-size : int, abort-message-prefix : (addr array byte) -> eax : (addr T)</span> <span id="L28" class="LineNr"> 28 </span> <span class="subxComment"># pseudocode:</span> <span id="L29" class="LineNr"> 29 </span> <span class="subxComment"># curr = table->data</span> <span id="L30" class="LineNr"> 30 </span> <span class="subxComment"># max = &table->data[table->write]</span> @@ -104,9 +104,9 @@ if ('onhashchange' in window) { <span id="L43" class="LineNr"> 43 </span> 56/push-esi <span id="L44" class="LineNr"> 44 </span> <span class="subxComment"># esi = table</span> <span id="L45" class="LineNr"> 45 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to esi</span> -<span id="L46" class="LineNr"> 46 </span> <span class="subxComment"># var curr/ecx : (address string_key) = table->data</span> +<span id="L46" class="LineNr"> 46 </span> <span class="subxComment"># var curr/ecx : (addr string_key) = table->data</span> <span id="L47" class="LineNr"> 47 </span> 8d/copy-address 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy esi+12 to ecx</span> -<span id="L48" class="LineNr"> 48 </span> <span class="subxComment"># var max/edx : (address byte) = &table->data[table->write]</span> +<span id="L48" class="LineNr"> 48 </span> <span class="subxComment"># var max/edx : (addr byte) = &table->data[table->write]</span> <span id="L49" class="LineNr"> 49 </span> 8b/copy 0/mod/indirect 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *esi to edx</span> <span id="L50" class="LineNr"> 50 </span> 8d/copy-address 0/mod/indirect 4/rm32/sib 1/base/ecx 2/index/edx <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ecx+edx to edx</span> <span id="L51" class="LineNr"> 51 </span><span class="Constant">$get:search-loop</span>: @@ -259,7 +259,7 @@ if ('onhashchange' in window) { <span id="L198" class="LineNr"> 198 </span> c3/return <span id="L199" class="LineNr"> 199 </span> <span id="L200" class="LineNr"> 200 </span><span class="subxComment"># if no row is found, abort</span> -<span id="L201" class="LineNr"> 201 </span><span class="subxFunction">get-slice</span>: <span class="subxComment"># table : (address stream {string_key, T}), key : (address slice), row-size : int, abort-message-prefix : (address array byte) -> eax : (address T)</span> +<span id="L201" class="LineNr"> 201 </span><span class="subxFunction">get-slice</span>: <span class="subxComment"># table : (addr stream {string_key, T}), key : (addr slice), row-size : int, abort-message-prefix : (addr array byte) -> eax : (addr T)</span> <span id="L202" class="LineNr"> 202 </span> <span class="subxComment"># pseudocode:</span> <span id="L203" class="LineNr"> 203 </span> <span class="subxComment"># curr = table->data</span> <span id="L204" class="LineNr"> 204 </span> <span class="subxComment"># max = &table->data[table->write]</span> @@ -278,9 +278,9 @@ if ('onhashchange' in window) { <span id="L217" class="LineNr"> 217 </span> 56/push-esi <span id="L218" class="LineNr"> 218 </span> <span class="subxComment"># esi = table</span> <span id="L219" class="LineNr"> 219 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to esi</span> -<span id="L220" class="LineNr"> 220 </span> <span class="subxComment"># var curr/ecx : (address string_key) = table->data</span> +<span id="L220" class="LineNr"> 220 </span> <span class="subxComment"># var curr/ecx : (addr string_key) = table->data</span> <span id="L221" class="LineNr"> 221 </span> 8d/copy-address 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy esi+12 to ecx</span> -<span id="L222" class="LineNr"> 222 </span> <span class="subxComment"># var max/edx : (address byte) = &table->data[table->write]</span> +<span id="L222" class="LineNr"> 222 </span> <span class="subxComment"># var max/edx : (addr byte) = &table->data[table->write]</span> <span id="L223" class="LineNr"> 223 </span> 8b/copy 0/mod/indirect 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *esi to edx</span> <span id="L224" class="LineNr"> 224 </span> 8d/copy-address 0/mod/indirect 4/rm32/sib 1/base/ecx 2/index/edx <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ecx+edx to edx</span> <span id="L225" class="LineNr"> 225 </span><span class="Constant">$get-slice:search-loop</span>: @@ -462,7 +462,7 @@ if ('onhashchange' in window) { <span id="L401" class="LineNr"> 401 </span><span class="subxComment"># return the address of the value</span> <span id="L402" class="LineNr"> 402 </span><span class="subxComment"># Beware: assume keys are immutable; they're inserted by reference</span> <span id="L403" class="LineNr"> 403 </span><span class="subxComment"># TODO: pass in an allocation descriptor</span> -<span id="L404" class="LineNr"> 404 </span><span class="subxFunction">get-or-insert</span>: <span class="subxComment"># table : (address stream {string_key, T}), key : string_key, row-size : int -> eax : (address T)</span> +<span id="L404" class="LineNr"> 404 </span><span class="subxFunction">get-or-insert</span>: <span class="subxComment"># table : (addr stream {string_key, T}), key : string_key, row-size : int -> eax : (addr T)</span> <span id="L405" class="LineNr"> 405 </span> <span class="subxComment"># pseudocode:</span> <span id="L406" class="LineNr"> 406 </span> <span class="subxComment"># curr = table->data</span> <span id="L407" class="LineNr"> 407 </span> <span class="subxComment"># max = &table->data[table->write]</span> @@ -486,9 +486,9 @@ if ('onhashchange' in window) { <span id="L425" class="LineNr"> 425 </span> 56/push-esi <span id="L426" class="LineNr"> 426 </span> <span class="subxComment"># esi = table</span> <span id="L427" class="LineNr"> 427 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to esi</span> -<span id="L428" class="LineNr"> 428 </span> <span class="subxComment"># var curr/ecx : (address string_key) = table->data</span> +<span id="L428" class="LineNr"> 428 </span> <span class="subxComment"># var curr/ecx : (addr string_key) = table->data</span> <span id="L429" class="LineNr"> 429 </span> 8d/copy-address 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy esi+12 to ecx</span> -<span id="L430" class="LineNr"> 430 </span> <span class="subxComment"># var max/edx : (address string_key) = &table->data[table->write]</span> +<span id="L430" class="LineNr"> 430 </span> <span class="subxComment"># var max/edx : (addr string_key) = &table->data[table->write]</span> <span id="L431" class="LineNr"> 431 </span> 8b/copy 0/mod/indirect 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *esi to edx</span> <span id="L432" class="LineNr"> 432 </span> 8d/copy-address 0/mod/indirect 4/rm32/sib 1/base/ecx 2/index/edx <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ecx+edx to edx</span> <span id="L433" class="LineNr"> 433 </span><span class="Constant">$get-or-insert:search-loop</span>: @@ -713,7 +713,7 @@ if ('onhashchange' in window) { <span id="L652" class="LineNr"> 652 </span><span class="subxComment"># if there are no rows free, abort</span> <span id="L653" class="LineNr"> 653 </span><span class="subxComment"># WARNING: leaks memory</span> <span id="L654" class="LineNr"> 654 </span><span class="subxComment"># TODO: pass in an allocation descriptor</span> -<span id="L655" class="LineNr"> 655 </span><span class="subxFunction">leaky-get-or-insert-slice</span>: <span class="subxComment"># table : (address stream {string_key, T}), key : (address slice), row-size : int -> eax : (address T)</span> +<span id="L655" class="LineNr"> 655 </span><span class="subxFunction">leaky-get-or-insert-slice</span>: <span class="subxComment"># table : (addr stream {string_key, T}), key : (addr slice), row-size : int -> eax : (addr T)</span> <span id="L656" class="LineNr"> 656 </span> <span class="subxComment"># pseudocode:</span> <span id="L657" class="LineNr"> 657 </span> <span class="subxComment"># curr = table->data</span> <span id="L658" class="LineNr"> 658 </span> <span class="subxComment"># max = &table->data[table->write]</span> @@ -737,9 +737,9 @@ if ('onhashchange' in window) { <span id="L676" class="LineNr"> 676 </span> 56/push-esi <span id="L677" class="LineNr"> 677 </span> <span class="subxComment"># esi = table</span> <span id="L678" class="LineNr"> 678 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to esi</span> -<span id="L679" class="LineNr"> 679 </span> <span class="subxComment"># var curr/ecx : (address string_key) = table->data</span> +<span id="L679" class="LineNr"> 679 </span> <span class="subxComment"># var curr/ecx : (addr string_key) = table->data</span> <span id="L680" class="LineNr"> 680 </span> 8d/copy-address 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy esi+12 to ecx</span> -<span id="L681" class="LineNr"> 681 </span> <span class="subxComment"># var max/edx : (address string_key) = &table->data[table->write]</span> +<span id="L681" class="LineNr"> 681 </span> <span class="subxComment"># var max/edx : (addr string_key) = &table->data[table->write]</span> <span id="L682" class="LineNr"> 682 </span> 8b/copy 0/mod/indirect 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *esi to edx</span> <span id="L683" class="LineNr"> 683 </span> 8d/copy-address 0/mod/indirect 4/rm32/sib 1/base/ecx 2/index/edx <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ecx+edx to edx</span> <span id="L684" class="LineNr"> 684 </span><span class="Constant">$leaky-get-or-insert-slice:search-loop</span>: @@ -985,9 +985,9 @@ if ('onhashchange' in window) { <span id="L924" class="LineNr"> 924 </span> c3/return <span id="L925" class="LineNr"> 925 </span> <span id="L926" class="LineNr"> 926 </span><span class="subxComment"># if no row is found, stop(ed)</span> -<span id="L927" class="LineNr"> 927 </span><span class="subxFunction">get-or-stop</span>: <span class="subxComment"># table : (address stream {string_key, T}), key : string_key, row-size : int,</span> -<span id="L928" class="LineNr"> 928 </span> <span class="subxComment"># abort-message-prefix : (address array byte), err : (address buffered-file), ed : (address exit-descriptor)</span> -<span id="L929" class="LineNr"> 929 </span> <span class="subxComment"># -> eax : (address T)</span> +<span id="L927" class="LineNr"> 927 </span><span class="subxFunction">get-or-stop</span>: <span class="subxComment"># table : (addr stream {string_key, T}), key : string_key, row-size : int,</span> +<span id="L928" class="LineNr"> 928 </span> <span class="subxComment"># abort-message-prefix : (addr array byte), err : (addr buffered-file), ed : (addr exit-descriptor)</span> +<span id="L929" class="LineNr"> 929 </span> <span class="subxComment"># -> eax : (addr T)</span> <span id="L930" class="LineNr"> 930 </span> <span class="subxComment"># pseudocode:</span> <span id="L931" class="LineNr"> 931 </span> <span class="subxComment"># curr = table->data</span> <span id="L932" class="LineNr"> 932 </span> <span class="subxComment"># max = &table->data[table->write]</span> @@ -1007,9 +1007,9 @@ if ('onhashchange' in window) { <span id="L946" class="LineNr"> 946 </span> 56/push-esi <span id="L947" class="LineNr"> 947 </span> <span class="subxComment"># esi = table</span> <span id="L948" class="LineNr"> 948 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to esi</span> -<span id="L949" class="LineNr"> 949 </span> <span class="subxComment"># var curr/ecx : (address string_key) = table->data</span> +<span id="L949" class="LineNr"> 949 </span> <span class="subxComment"># var curr/ecx : (addr string_key) = table->data</span> <span id="L950" class="LineNr"> 950 </span> 8d/copy-address 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy esi+12 to ecx</span> -<span id="L951" class="LineNr"> 951 </span> <span class="subxComment"># var max/edx : (address byte) = &table->data[table->write]</span> +<span id="L951" class="LineNr"> 951 </span> <span class="subxComment"># var max/edx : (addr byte) = &table->data[table->write]</span> <span id="L952" class="LineNr"> 952 </span> 8b/copy 0/mod/indirect 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *esi to edx</span> <span id="L953" class="LineNr"> 953 </span> 8d/copy-address 0/mod/indirect 4/rm32/sib 1/base/ecx 2/index/edx <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ecx+edx to edx</span> <span id="L954" class="LineNr"> 954 </span><span class="Constant">$get-or-stop:search-loop</span>: @@ -1201,9 +1201,9 @@ if ('onhashchange' in window) { <span id="L1140" class="LineNr">1140 </span> c3/return <span id="L1141" class="LineNr">1141 </span> <span id="L1142" class="LineNr">1142 </span><span class="subxComment"># if no row is found, stop(ed)</span> -<span id="L1143" class="LineNr">1143 </span><span class="subxFunction">get-slice-or-stop</span>: <span class="subxComment"># table : (address stream {string_key, _}), key : (address slice), row-size : int,</span> -<span id="L1144" class="LineNr">1144 </span> <span class="subxComment"># abort-message-prefix : (address string), err : (address buffered-file), ed : (address exit-descriptor)</span> -<span id="L1145" class="LineNr">1145 </span> <span class="subxComment"># -> eax : (address _)</span> +<span id="L1143" class="LineNr">1143 </span><span class="subxFunction">get-slice-or-stop</span>: <span class="subxComment"># table : (addr stream {string_key, _}), key : (addr slice), row-size : int,</span> +<span id="L1144" class="LineNr">1144 </span> <span class="subxComment"># abort-message-prefix : (addr string), err : (addr buffered-file), ed : (addr exit-descriptor)</span> +<span id="L1145" class="LineNr">1145 </span> <span class="subxComment"># -> eax : (addr _)</span> <span id="L1146" class="LineNr">1146 </span> <span class="subxComment"># pseudocode:</span> <span id="L1147" class="LineNr">1147 </span> <span class="subxComment"># curr = table->data</span> <span id="L1148" class="LineNr">1148 </span> <span class="subxComment"># max = &table->data[table->write]</span> @@ -1223,9 +1223,9 @@ if ('onhashchange' in window) { <span id="L1162" class="LineNr">1162 </span> 56/push-esi <span id="L1163" class="LineNr">1163 </span> <span class="subxComment"># esi = table</span> <span id="L1164" class="LineNr">1164 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to esi</span> -<span id="L1165" class="LineNr">1165 </span> <span class="subxComment"># var curr/ecx : (address string_key) = table->data</span> +<span id="L1165" class="LineNr">1165 </span> <span class="subxComment"># var curr/ecx : (addr string_key) = table->data</span> <span id="L1166" class="LineNr">1166 </span> 8d/copy-address 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy esi+12 to ecx</span> -<span id="L1167" class="LineNr">1167 </span> <span class="subxComment"># var max/edx : (address byte) = &table->data[table->write]</span> +<span id="L1167" class="LineNr">1167 </span> <span class="subxComment"># var max/edx : (addr byte) = &table->data[table->write]</span> <span id="L1168" class="LineNr">1168 </span> 8b/copy 0/mod/indirect 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *esi to edx</span> <span id="L1169" class="LineNr">1169 </span> 8d/copy-address 0/mod/indirect 4/rm32/sib 1/base/ecx 2/index/edx <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ecx+edx to edx</span> <span id="L1170" class="LineNr">1170 </span><span class="Constant">$get-slice-or-stop:search-loop</span>: @@ -1440,7 +1440,7 @@ if ('onhashchange' in window) { <span id="L1379" class="LineNr">1379 </span> c3/return <span id="L1380" class="LineNr">1380 </span> <span id="L1381" class="LineNr">1381 </span><span class="subxComment"># if no row is found, return null (0)</span> -<span id="L1382" class="LineNr">1382 </span><span class="subxFunction">maybe-get</span>: <span class="subxComment"># table : (address stream {string_key, T}), key : string_key, row-size : int -> eax : (address T)</span> +<span id="L1382" class="LineNr">1382 </span><span class="subxFunction">maybe-get</span>: <span class="subxComment"># table : (addr stream {string_key, T}), key : string_key, row-size : int -> eax : (addr T)</span> <span id="L1383" class="LineNr">1383 </span> <span class="subxComment"># pseudocode:</span> <span id="L1384" class="LineNr">1384 </span> <span class="subxComment"># curr = table->data</span> <span id="L1385" class="LineNr">1385 </span> <span class="subxComment"># max = &table->data[table->write]</span> @@ -1459,9 +1459,9 @@ if ('onhashchange' in window) { <span id="L1398" class="LineNr">1398 </span> 56/push-esi <span id="L1399" class="LineNr">1399 </span> <span class="subxComment"># esi = table</span> <span id="L1400" class="LineNr">1400 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to esi</span> -<span id="L1401" class="LineNr">1401 </span> <span class="subxComment"># var curr/ecx : (address string_key) = table->data</span> +<span id="L1401" class="LineNr">1401 </span> <span class="subxComment"># var curr/ecx : (addr string_key) = table->data</span> <span id="L1402" class="LineNr">1402 </span> 8d/copy-address 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy esi+12 to ecx</span> -<span id="L1403" class="LineNr">1403 </span> <span class="subxComment"># var max/edx : (address byte) = &table->data[table->write]</span> +<span id="L1403" class="LineNr">1403 </span> <span class="subxComment"># var max/edx : (addr byte) = &table->data[table->write]</span> <span id="L1404" class="LineNr">1404 </span> 8b/copy 0/mod/indirect 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *esi to edx</span> <span id="L1405" class="LineNr">1405 </span> 8d/copy-address 0/mod/indirect 4/rm32/sib 1/base/ecx 2/index/edx <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ecx+edx to edx</span> <span id="L1406" class="LineNr">1406 </span><span class="Constant">$maybe-get:search-loop</span>: @@ -1587,7 +1587,7 @@ if ('onhashchange' in window) { <span id="L1526" class="LineNr">1526 </span> c3/return <span id="L1527" class="LineNr">1527 </span> <span id="L1528" class="LineNr">1528 </span><span class="subxComment"># if no row is found, return null (0)</span> -<span id="L1529" class="LineNr">1529 </span><span class="subxFunction">maybe-get-slice</span>: <span class="subxComment"># table : (address stream {string_key, T}), key : (address slice), row-size : int -> eax : (address T)</span> +<span id="L1529" class="LineNr">1529 </span><span class="subxFunction">maybe-get-slice</span>: <span class="subxComment"># table : (addr stream {string_key, T}), key : (addr slice), row-size : int -> eax : (addr T)</span> <span id="L1530" class="LineNr">1530 </span> <span class="subxComment"># pseudocode:</span> <span id="L1531" class="LineNr">1531 </span> <span class="subxComment"># curr = table->data</span> <span id="L1532" class="LineNr">1532 </span> <span class="subxComment"># max = &table->data[table->write]</span> @@ -1606,9 +1606,9 @@ if ('onhashchange' in window) { <span id="L1545" class="LineNr">1545 </span> 56/push-esi <span id="L1546" class="LineNr">1546 </span> <span class="subxComment"># esi = table</span> <span id="L1547" class="LineNr">1547 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to esi</span> -<span id="L1548" class="LineNr">1548 </span> <span class="subxComment"># var curr/ecx : (address string_key) = table->data</span> +<span id="L1548" class="LineNr">1548 </span> <span class="subxComment"># var curr/ecx : (addr string_key) = table->data</span> <span id="L1549" class="LineNr">1549 </span> 8d/copy-address 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy esi+12 to ecx</span> -<span id="L1550" class="LineNr">1550 </span> <span class="subxComment"># var max/edx : (address byte) = &table->data[table->write]</span> +<span id="L1550" class="LineNr">1550 </span> <span class="subxComment"># var max/edx : (addr byte) = &table->data[table->write]</span> <span id="L1551" class="LineNr">1551 </span> 8b/copy 0/mod/indirect 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *esi to edx</span> <span id="L1552" class="LineNr">1552 </span> 8d/copy-address 0/mod/indirect 4/rm32/sib 1/base/ecx 2/index/edx <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ecx+edx to edx</span> <span id="L1553" class="LineNr">1553 </span><span class="Constant">$maybe-get-slice:search-loop</span>: diff --git a/html/082slurp.subx.html b/html/082slurp.subx.html index aabab90e..3a21e3f3 100644 --- a/html/082slurp.subx.html +++ b/html/082slurp.subx.html @@ -64,7 +64,7 @@ if ('onhashchange' in window) { <span id="L5" class="LineNr"> 5 </span> <span id="L6" class="LineNr"> 6 </span><span class="subxComment"># read all bytes from 'f' and store them into 's'</span> <span id="L7" class="LineNr"> 7 </span><span class="subxComment"># abort if 's' is too small</span> -<span id="L8" class="LineNr"> 8 </span><span class="subxFunction">slurp</span>: <span class="subxComment"># f : (address buffered-file), s : (address stream byte)</span> +<span id="L8" class="LineNr"> 8 </span><span class="subxFunction">slurp</span>: <span class="subxComment"># f : (addr buffered-file), s : (addr stream byte)</span> <span id="L9" class="LineNr"> 9 </span> <span class="subxComment"># pseudocode:</span> <span id="L10" class="LineNr"> 10 </span> <span class="subxComment"># while true</span> <span id="L11" class="LineNr"> 11 </span> <span class="subxComment"># if (s->write >= s->length) abort</span> diff --git a/html/083subx-widths.subx.html b/html/083subx-widths.subx.html index 82006604..9c06167a 100644 --- a/html/083subx-widths.subx.html +++ b/html/083subx-widths.subx.html @@ -67,7 +67,7 @@ if ('onhashchange' in window) { <span id="L8" class="LineNr"> 8 </span><span class="subxS1Comment"># . op subop mod rm32 base index scale r32</span> <span id="L9" class="LineNr"> 9 </span><span class="subxS1Comment"># . 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</span> <span id="L10" class="LineNr"> 10 </span> -<span id="L11" class="LineNr"> 11 </span><span class="subxFunction">compute-width</span>: <span class="subxComment"># word : (address array byte) -> eax : int</span> +<span id="L11" class="LineNr"> 11 </span><span class="subxFunction">compute-width</span>: <span class="subxComment"># word : (addr array byte) -> eax : int</span> <span id="L12" class="LineNr"> 12 </span> <span class="subxS1Comment"># . prologue</span> <span id="L13" class="LineNr"> 13 </span> 55/push-ebp <span id="L14" class="LineNr"> 14 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -75,7 +75,7 @@ if ('onhashchange' in window) { <span id="L16" class="LineNr"> 16 </span> 51/push-ecx <span id="L17" class="LineNr"> 17 </span> <span class="subxComment"># eax = word</span> <span id="L18" class="LineNr"> 18 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to ecx</span> -<span id="L19" class="LineNr"> 19 </span> <span class="subxComment"># var ecx : (address byte) = &word[word->length]</span> +<span id="L19" class="LineNr"> 19 </span> <span class="subxComment"># var ecx : (addr byte) = &word[word->length]</span> <span id="L20" class="LineNr"> 20 </span> 8b/copy 0/mod/indirect 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *eax to ecx</span> <span id="L21" class="LineNr"> 21 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx <span class="Normal"> . </span> 1/r32/ecx 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy eax+ecx+4 to ecx</span> <span id="L22" class="LineNr"> 22 </span> <span class="subxComment"># eax = word->data</span> @@ -101,7 +101,7 @@ if ('onhashchange' in window) { <span id="L42" class="LineNr"> 42 </span> 5d/pop-to-ebp <span id="L43" class="LineNr"> 43 </span> c3/return <span id="L44" class="LineNr"> 44 </span> -<span id="L45" class="LineNr"> 45 </span><span class="subxFunction">compute-width-of-slice</span>: <span class="subxComment"># s : (address slice) -> eax : int</span> +<span id="L45" class="LineNr"> 45 </span><span class="subxFunction">compute-width-of-slice</span>: <span class="subxComment"># s : (addr slice) -> eax : int</span> <span id="L46" class="LineNr"> 46 </span> <span class="subxS1Comment"># . prologue</span> <span id="L47" class="LineNr"> 47 </span> 55/push-ebp <span id="L48" class="LineNr"> 48 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> diff --git a/html/084emit-hex-array.subx.html b/html/084emit-hex-array.subx.html index e4d39d23..836f53f9 100644 --- a/html/084emit-hex-array.subx.html +++ b/html/084emit-hex-array.subx.html @@ -64,7 +64,7 @@ if ('onhashchange' in window) { <span id="L4" class="LineNr"> 4 </span><span class="subxS1Comment"># . 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</span> <span id="L5" class="LineNr"> 5 </span> <span id="L6" class="LineNr"> 6 </span><span class="subxComment"># print 'arr' in hex with a space after every byte</span> -<span id="L7" class="LineNr"> 7 </span><span class="subxFunction">emit-hex-array</span>: <span class="subxComment"># out : (address buffered-file), arr : (address array byte)</span> +<span id="L7" class="LineNr"> 7 </span><span class="subxFunction">emit-hex-array</span>: <span class="subxComment"># out : (addr buffered-file), arr : (addr array byte)</span> <span id="L8" class="LineNr"> 8 </span> <span class="subxS1Comment"># . prologue</span> <span id="L9" class="LineNr"> 9 </span> 55/push-ebp <span id="L10" class="LineNr"> 10 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -77,9 +77,9 @@ if ('onhashchange' in window) { <span id="L17" class="LineNr"> 17 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 7/r32/edi 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to edi</span> <span id="L18" class="LineNr"> 18 </span> <span class="subxComment"># edx = arr</span> <span id="L19" class="LineNr"> 19 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+12) to edx</span> -<span id="L20" class="LineNr"> 20 </span> <span class="subxComment"># var curr/ecx : (address byte) = arr->data</span> +<span id="L20" class="LineNr"> 20 </span> <span class="subxComment"># var curr/ecx : (addr byte) = arr->data</span> <span id="L21" class="LineNr"> 21 </span> 8d/copy-address 1/mod/*+disp8 2/rm32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy edx+4 to ecx</span> -<span id="L22" class="LineNr"> 22 </span> <span class="subxComment"># var max/edx : (address byte) = &arr->data[arr->length]</span> +<span id="L22" class="LineNr"> 22 </span> <span class="subxComment"># var max/edx : (addr byte) = &arr->data[arr->length]</span> <span id="L23" class="LineNr"> 23 </span> 8b/copy 0/mod/indirect 2/rm32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *edx to edx</span> <span id="L24" class="LineNr"> 24 </span> 01/add 3/mod/direct 2/rm32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># add ecx to edx</span> <span id="L25" class="LineNr"> 25 </span> <span class="subxComment"># var c/eax : byte = 0</span> diff --git a/html/092write-int.subx.html b/html/092write-int.subx.html index 44989ebf..fe9d318e 100644 --- a/html/092write-int.subx.html +++ b/html/092write-int.subx.html @@ -65,7 +65,7 @@ if ('onhashchange' in window) { <span id="L5" class="LineNr"> 5 </span><span class="subxS1Comment"># . op subop mod rm32 base index scale r32</span> <span id="L6" class="LineNr"> 6 </span><span class="subxS1Comment"># . 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</span> <span id="L7" class="LineNr"> 7 </span> -<span id="L8" class="LineNr"> 8 </span><span class="subxFunction">write-int</span>: <span class="subxComment"># out : (address stream byte), n : int</span> +<span id="L8" class="LineNr"> 8 </span><span class="subxFunction">write-int</span>: <span class="subxComment"># out : (addr stream byte), n : int</span> <span id="L9" class="LineNr"> 9 </span> <span class="subxS1Comment"># . prologue</span> <span id="L10" class="LineNr"> 10 </span> 55/push-ebp <span id="L11" class="LineNr"> 11 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> diff --git a/html/093array-equal.subx.html b/html/093array-equal.subx.html index 4da63790..dabe8ef2 100644 --- a/html/093array-equal.subx.html +++ b/html/093array-equal.subx.html @@ -66,7 +66,7 @@ if ('onhashchange' in window) { <span id="L5" class="LineNr"> 5 </span><span class="subxS1Comment"># . op subop mod rm32 base index scale r32</span> <span id="L6" class="LineNr"> 6 </span><span class="subxS1Comment"># . 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</span> <span id="L7" class="LineNr"> 7 </span> -<span id="L8" class="LineNr"> 8 </span><span class="subxFunction">array-equal?</span>: <span class="subxComment"># a : (address array int), b : (address array int) -> eax : boolean</span> +<span id="L8" class="LineNr"> 8 </span><span class="subxFunction">array-equal?</span>: <span class="subxComment"># a : (addr array int), b : (addr array int) -> eax : boolean</span> <span id="L9" class="LineNr"> 9 </span> <span class="subxComment"># pseudocode:</span> <span id="L10" class="LineNr"> 10 </span> <span class="subxComment"># lena = a->length</span> <span id="L11" class="LineNr"> 11 </span> <span class="subxComment"># if (lena != b->length) return false</span> @@ -107,9 +107,9 @@ if ('onhashchange' in window) { <span id="L46" class="LineNr"> 46 </span> <span class="subxComment"># if (lena != b->length) return false</span> <span id="L47" class="LineNr"> 47 </span> 39/compare 0/mod/indirect 7/rm32/edi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># compare *edi and edx</span> <span id="L48" class="LineNr"> 48 </span> 75/jump-if-not-equal $array-equal?:false/disp8 -<span id="L49" class="LineNr"> 49 </span> <span class="subxComment"># var curra/esi : (address byte) = a->data</span> +<span id="L49" class="LineNr"> 49 </span> <span class="subxComment"># var curra/esi : (addr byte) = a->data</span> <span id="L50" class="LineNr"> 50 </span> 81 0/subop/add 3/mod/direct 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esi</span> -<span id="L51" class="LineNr"> 51 </span> <span class="subxComment"># var currb/edi : (address byte) = b->data</span> +<span id="L51" class="LineNr"> 51 </span> <span class="subxComment"># var currb/edi : (addr byte) = b->data</span> <span id="L52" class="LineNr"> 52 </span> 81 0/subop/add 3/mod/direct 7/rm32/edi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to edi</span> <span id="L53" class="LineNr"> 53 </span> <span class="subxComment"># var i/ecx : int = 0</span> <span id="L54" class="LineNr"> 54 </span> 31/xor 3/mod/direct 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># clear ecx</span> @@ -291,7 +291,7 @@ if ('onhashchange' in window) { <span id="L230" class="LineNr">230 </span> 5d/pop-to-ebp <span id="L231" class="LineNr">231 </span> c3/return <span id="L232" class="LineNr">232 </span> -<span id="L233" class="LineNr">233 </span><span class="subxFunction">parse-array-of-ints</span>: <span class="subxComment"># ad : (address allocation-descriptor), s : (address string) -> result/eax : (handle array int)</span> +<span id="L233" class="LineNr">233 </span><span class="subxFunction">parse-array-of-ints</span>: <span class="subxComment"># ad : (addr allocation-descriptor), s : (addr string) -> result/eax : (handle array int)</span> <span id="L234" class="LineNr">234 </span> <span class="subxComment"># pseudocode</span> <span id="L235" class="LineNr">235 </span> <span class="subxComment"># end = &s->data[s->length]</span> <span id="L236" class="LineNr">236 </span> <span class="subxComment"># curr = s->data</span> @@ -327,9 +327,9 @@ if ('onhashchange' in window) { <span id="L266" class="LineNr">266 </span> 57/push-edi <span id="L267" class="LineNr">267 </span> <span class="subxComment"># esi = s</span> <span id="L268" class="LineNr">268 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+12) to esi</span> -<span id="L269" class="LineNr">269 </span> <span class="subxComment"># var curr/ecx : (address byte) = s->data</span> +<span id="L269" class="LineNr">269 </span> <span class="subxComment"># var curr/ecx : (addr byte) = s->data</span> <span id="L270" class="LineNr">270 </span> 8d/copy-address 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy esi+4 to ecx</span> -<span id="L271" class="LineNr">271 </span> <span class="subxComment"># var end/edx : (address byte) = &s->data[s->length]</span> +<span id="L271" class="LineNr">271 </span> <span class="subxComment"># var end/edx : (addr byte) = &s->data[s->length]</span> <span id="L272" class="LineNr">272 </span> <span class="subxS1Comment"># . edx = s->length</span> <span id="L273" class="LineNr">273 </span> 8b/copy 0/mod/indirect 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *esi to edx</span> <span id="L274" class="LineNr">274 </span> <span class="subxS1Comment"># . edx += curr</span> @@ -395,7 +395,7 @@ if ('onhashchange' in window) { <span id="L334" class="LineNr">334 </span> 51/push-ecx <span id="L335" class="LineNr">335 </span> <span class="subxS1Comment"># . bookmark</span> <span id="L336" class="LineNr">336 </span> 89/copy 3/mod/direct 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ecx</span> -<span id="L337" class="LineNr">337 </span> <span class="subxComment"># var out/ebx : (address byte) = result->data</span> +<span id="L337" class="LineNr">337 </span> <span class="subxComment"># var out/ebx : (addr byte) = result->data</span> <span id="L338" class="LineNr">338 </span> 8d/copy-address 1/mod/*+disp8 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 3/r32/ebx 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy eax+4 to ebx</span> <span id="L339" class="LineNr">339 </span><span class="Constant">$parse-array-of-ints:loop2</span>: <span id="L340" class="LineNr">340 </span> <span class="subxComment"># if (slice->start >= end) break</span> @@ -597,7 +597,7 @@ if ('onhashchange' in window) { <span id="L536" class="LineNr">536 </span> <span id="L537" class="LineNr">537 </span><span class="subxComment"># helper for later tests</span> <span id="L538" class="LineNr">538 </span><span class="subxComment"># compare an array with a string representation of an array literal</span> -<span id="L539" class="LineNr">539 </span><span class="subxFunction">check-array-equal</span>: <span class="subxComment"># a : (address array int), expected : (address string), msg : (address string)</span> +<span id="L539" class="LineNr">539 </span><span class="subxFunction">check-array-equal</span>: <span class="subxComment"># a : (addr array int), expected : (addr string), msg : (addr string)</span> <span id="L540" class="LineNr">540 </span> <span class="subxS1Comment"># . prologue</span> <span id="L541" class="LineNr">541 </span> 55/push-ebp <span id="L542" class="LineNr">542 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> diff --git a/html/094next-word-or-string.subx.html b/html/094next-word-or-string.subx.html index 71530620..df152bca 100644 --- a/html/094next-word-or-string.subx.html +++ b/html/094next-word-or-string.subx.html @@ -64,7 +64,7 @@ if ('onhashchange' in window) { <span id="L5" class="LineNr"> 5 </span> <span id="L6" class="LineNr"> 6 </span><span class="subxComment"># (re)compute the bounds of the next word or string literal in the line</span> <span id="L7" class="LineNr"> 7 </span><span class="subxComment"># return empty string on reaching end of file</span> -<span id="L8" class="LineNr"> 8 </span><span class="subxFunction">next-word-or-string</span>: <span class="subxComment"># line : (address stream byte), out : (address slice)</span> +<span id="L8" class="LineNr"> 8 </span><span class="subxFunction">next-word-or-string</span>: <span class="subxComment"># line : (addr stream byte), out : (addr slice)</span> <span id="L9" class="LineNr"> 9 </span> <span class="subxS1Comment"># . prologue</span> <span id="L10" class="LineNr"> 10 </span> 55/push-ebp <span id="L11" class="LineNr"> 11 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> diff --git a/html/095stack.subx.html b/html/095stack.subx.html index 988bac36..29c47744 100644 --- a/html/095stack.subx.html +++ b/html/095stack.subx.html @@ -67,7 +67,7 @@ if ('onhashchange' in window) { <span id="L7" class="LineNr"> 7 </span><span class="subxS1Comment"># . op subop mod rm32 base index scale r32</span> <span id="L8" class="LineNr"> 8 </span><span class="subxS1Comment"># . 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</span> <span id="L9" class="LineNr"> 9 </span> -<span id="L10" class="LineNr"> 10 </span><span class="subxFunction">clear-stack</span>: <span class="subxComment"># s : (address stack)</span> +<span id="L10" class="LineNr"> 10 </span><span class="subxFunction">clear-stack</span>: <span class="subxComment"># s : (addr stack)</span> <span id="L11" class="LineNr"> 11 </span> <span class="subxS1Comment"># . prologue</span> <span id="L12" class="LineNr"> 12 </span> 55/push-ebp <span id="L13" class="LineNr"> 13 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -76,12 +76,12 @@ if ('onhashchange' in window) { <span id="L16" class="LineNr"> 16 </span> 51/push-ecx <span id="L17" class="LineNr"> 17 </span> <span class="subxComment"># eax = s</span> <span id="L18" class="LineNr"> 18 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to eax</span> -<span id="L19" class="LineNr"> 19 </span> <span class="subxComment"># var max/ecx : (address byte) = &s->data[s->length]</span> +<span id="L19" class="LineNr"> 19 </span> <span class="subxComment"># var max/ecx : (addr byte) = &s->data[s->length]</span> <span id="L20" class="LineNr"> 20 </span> 8b/copy 1/mod/*+disp8 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(eax+4) to eax</span> <span id="L21" class="LineNr"> 21 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx <span class="Normal"> . </span> 1/r32/ecx 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy eax+ecx+8 to ecx</span> <span id="L22" class="LineNr"> 22 </span> <span class="subxComment"># s->top = 0</span> <span id="L23" class="LineNr"> 23 </span> c7 0/subop/copy 0/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/imm32 <span class="subxComment"># copy to *eax</span> -<span id="L24" class="LineNr"> 24 </span> <span class="subxComment"># var curr/eax : (address byte) = s->data</span> +<span id="L24" class="LineNr"> 24 </span> <span class="subxComment"># var curr/eax : (addr byte) = s->data</span> <span id="L25" class="LineNr"> 25 </span> 81 0/subop/add 3/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to eax</span> <span id="L26" class="LineNr"> 26 </span><span class="Constant">$clear-stack:loop</span>: <span id="L27" class="LineNr"> 27 </span> <span class="subxComment"># if (curr >= max) break</span> @@ -167,7 +167,7 @@ if ('onhashchange' in window) { <span id="L107" class="LineNr">107 </span> 5d/pop-to-ebp <span id="L108" class="LineNr">108 </span> c3/return <span id="L109" class="LineNr">109 </span> -<span id="L110" class="LineNr">110 </span><span class="subxFunction">push</span>: <span class="subxComment"># s : (address stack), n : int</span> +<span id="L110" class="LineNr">110 </span><span class="subxFunction">push</span>: <span class="subxComment"># s : (addr stack), n : int</span> <span id="L111" class="LineNr">111 </span> <span class="subxS1Comment"># . prologue</span> <span id="L112" class="LineNr">112 </span> 55/push-ebp <span id="L113" class="LineNr">113 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -287,7 +287,7 @@ if ('onhashchange' in window) { <span id="L227" class="LineNr">227 </span> 5d/pop-to-ebp <span id="L228" class="LineNr">228 </span> c3/return <span id="L229" class="LineNr">229 </span> -<span id="L230" class="LineNr">230 </span><span class="subxFunction">pop</span>: <span class="subxComment"># s : (address stack) -> n/eax : int</span> +<span id="L230" class="LineNr">230 </span><span class="subxFunction">pop</span>: <span class="subxComment"># s : (addr stack) -> n/eax : int</span> <span id="L231" class="LineNr">231 </span> <span class="subxS1Comment"># . prologue</span> <span id="L232" class="LineNr">232 </span> 55/push-ebp <span id="L233" class="LineNr">233 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -391,7 +391,7 @@ if ('onhashchange' in window) { <span id="L331" class="LineNr">331 </span> 5d/pop-to-ebp <span id="L332" class="LineNr">332 </span> c3/return <span id="L333" class="LineNr">333 </span> -<span id="L334" class="LineNr">334 </span><span class="subxFunction">top</span>: <span class="subxComment"># s : (address stack) -> n/eax : int</span> +<span id="L334" class="LineNr">334 </span><span class="subxFunction">top</span>: <span class="subxComment"># s : (addr stack) -> n/eax : int</span> <span id="L335" class="LineNr">335 </span> <span class="subxS1Comment"># . prologue</span> <span id="L336" class="LineNr">336 </span> 55/push-ebp <span id="L337" class="LineNr">337 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> diff --git a/html/apps/assort.subx.html b/html/apps/assort.subx.html index d6c66612..9823f5f6 100644 --- a/html/apps/assort.subx.html +++ b/html/apps/assort.subx.html @@ -145,12 +145,12 @@ if ('onhashchange' in window) { <span id="L83" class="LineNr"> 83 </span> cd/syscall 0x80/imm8 <span id="L84" class="LineNr"> 84 </span> <span id="L85" class="LineNr"> 85 </span><span class="subxComment"># data structure:</span> -<span id="L86" class="LineNr"> 86 </span><span class="subxComment"># table: (address stream {string, (address stream byte)}) (8 bytes per row)</span> +<span id="L86" class="LineNr"> 86 </span><span class="subxComment"># table: (addr stream {string, (addr stream byte)}) (8 bytes per row)</span> <span id="L87" class="LineNr"> 87 </span><span class="subxComment"># inefficient; uses sequential search for looking up segments by name</span> <span id="L88" class="LineNr"> 88 </span> -<span id="L89" class="LineNr"> 89 </span><span class="subxFunction">subx-assort</span>: <span class="subxComment"># in : (address buffered-file), out : (address buffered-file)</span> +<span id="L89" class="LineNr"> 89 </span><span class="subxFunction">subx-assort</span>: <span class="subxComment"># in : (addr buffered-file), out : (addr buffered-file)</span> <span id="L90" class="LineNr"> 90 </span> <span class="subxComment"># pseudocode:</span> -<span id="L91" class="LineNr"> 91 </span> <span class="subxComment"># var table : (address stream {string, (address stream byte)} 10/rows)</span> +<span id="L91" class="LineNr"> 91 </span> <span class="subxComment"># var table : (addr stream {string, (addr stream byte)} 10/rows)</span> <span id="L92" class="LineNr"> 92 </span> <span class="subxComment"># read-segments(in, table)</span> <span id="L93" class="LineNr"> 93 </span> <span class="subxComment"># write-segments(out, table)</span> <span id="L94" class="LineNr"> 94 </span> <span class="subxComment">#</span> @@ -159,7 +159,7 @@ if ('onhashchange' in window) { <span id="L97" class="LineNr"> 97 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> <span id="L98" class="LineNr"> 98 </span> <span class="subxS1Comment"># . save registers</span> <span id="L99" class="LineNr"> 99 </span> 51/push-ecx -<span id="L100" class="LineNr">100 </span> <span class="subxComment"># var table/ecx : (ref stream {string, (address stream byte)} 80) # 10 rows * 8 bytes/row</span> +<span id="L100" class="LineNr">100 </span> <span class="subxComment"># var table/ecx : (ref stream {string, (addr stream byte)} 80) # 10 rows * 8 bytes/row</span> <span id="L101" class="LineNr">101 </span> 81 5/subop/subtract 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x50/imm32 <span class="subxComment"># subtract from esp</span> <span id="L102" class="LineNr">102 </span> 68/push 0x50/imm32/length <span id="L103" class="LineNr">103 </span> 68/push 0/imm32/read @@ -464,10 +464,10 @@ if ('onhashchange' in window) { <span id="L450" class="LineNr">450 </span> 5d/pop-to-ebp <span id="L451" class="LineNr">451 </span> c3/return <span id="L452" class="LineNr">452 </span> -<span id="L453" class="LineNr">453 </span><span class="subxComment"># type string_key = (address array byte)</span> +<span id="L453" class="LineNr">453 </span><span class="subxComment"># type string_key = (addr array byte)</span> <span id="L454" class="LineNr">454 </span> <span id="L455" class="LineNr">455 </span><span class="subxComment"># beware: leaks memory (one name per segment read)</span> -<span id="L456" class="LineNr">456 </span><span class="subxFunction">read-segments</span>: <span class="subxComment"># in : (address buffered-file), table : (address stream {string_key, (handle stream byte)})</span> +<span id="L456" class="LineNr">456 </span><span class="subxFunction">read-segments</span>: <span class="subxComment"># in : (addr buffered-file), table : (addr stream {string_key, (handle stream byte)})</span> <span id="L457" class="LineNr">457 </span> <span class="subxComment"># pseudocode:</span> <span id="L458" class="LineNr">458 </span> <span class="subxComment"># var curr-segment : (handle stream byte) = 0</span> <span id="L459" class="LineNr">459 </span> <span class="subxComment"># var line : (stream byte 512)</span> @@ -565,7 +565,7 @@ if ('onhashchange' in window) { <span id="L591" class="LineNr">591 </span><span class="Constant">$read-segments:check-for-comment</span>: <span id="L592" class="Folded">592 </span><span class="Folded">+-- 9 lines: #? # print("check for comment\n") ----------------------------------------------------------------------------------------------------------</span> <span id="L601" class="LineNr">601 </span> <span class="subxComment"># if (slice-starts-with?(word-slice, "#")) continue</span> -<span id="L602" class="LineNr">602 </span> <span class="subxS1Comment"># . var start/esi : (address byte) = word-slice->start</span> +<span id="L602" class="LineNr">602 </span> <span class="subxS1Comment"># . var start/esi : (addr byte) = word-slice->start</span> <span id="L603" class="LineNr">603 </span> 8b/copy 0/mod/indirect 2/rm32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *ecx to esi</span> <span id="L604" class="LineNr">604 </span> <span class="subxS1Comment"># . var c/eax : byte = *start</span> <span id="L605" class="LineNr">605 </span> 31/xor 3/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># clear eax</span> @@ -597,7 +597,7 @@ if ('onhashchange' in window) { <span id="L678" class="LineNr">678 </span> <span class="subxS2Comment"># . . discard args</span> <span id="L679" class="LineNr">679 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span> <span id="L680" class="Folded">680 </span><span class="Folded">+-- 40 lines: #? # dump segment name ---------------------------------------------------------------------------------------------------------------------</span> -<span id="L720" class="LineNr">720 </span> <span class="subxComment"># var segment-slot/eax : (address handle stream byte) = leaky-get-or-insert-slice(table, segment-name, row-size=8)</span> +<span id="L720" class="LineNr">720 </span> <span class="subxComment"># var segment-slot/eax : (addr handle stream byte) = leaky-get-or-insert-slice(table, segment-name, row-size=8)</span> <span id="L721" class="LineNr">721 </span> <span class="subxS2Comment"># . . push args</span> <span id="L722" class="LineNr">722 </span> 68/push 8/imm32/row-size <span id="L723" class="LineNr">723 </span> 52/push-edx @@ -667,7 +667,7 @@ if ('onhashchange' in window) { <span id="L843" class="LineNr">843 </span> 5d/pop-to-ebp <span id="L844" class="LineNr">844 </span> c3/return <span id="L845" class="LineNr">845 </span> -<span id="L846" class="LineNr">846 </span><span class="subxFunction">write-segments</span>: <span class="subxComment"># out : (address buffered-file), table : (address stream {string_key, (handle stream byte)})</span> +<span id="L846" class="LineNr">846 </span><span class="subxFunction">write-segments</span>: <span class="subxComment"># out : (addr buffered-file), table : (addr stream {string_key, (handle stream byte)})</span> <span id="L847" class="LineNr">847 </span> <span class="subxComment"># pseudocode:</span> <span id="L848" class="LineNr">848 </span> <span class="subxComment"># var curr = table->data</span> <span id="L849" class="LineNr">849 </span> <span class="subxComment"># var max = &table->data[table->write]</span> @@ -688,15 +688,15 @@ if ('onhashchange' in window) { <span id="L864" class="LineNr">864 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+12) to esi</span> <span id="L865" class="LineNr">865 </span> <span class="subxComment"># var write/edx : int = table->write</span> <span id="L866" class="LineNr">866 </span> 8b/copy 0/mod/indirect 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *esi to edx</span> -<span id="L867" class="LineNr">867 </span> <span class="subxComment"># var curr/esi : (address byte) = table->data</span> +<span id="L867" class="LineNr">867 </span> <span class="subxComment"># var curr/esi : (addr byte) = table->data</span> <span id="L868" class="LineNr">868 </span> 81 0/subop/add 3/mod/direct 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to eax</span> -<span id="L869" class="LineNr">869 </span> <span class="subxComment"># var max/edx : (address byte) = curr + write</span> +<span id="L869" class="LineNr">869 </span> <span class="subxComment"># var max/edx : (addr byte) = curr + write</span> <span id="L870" class="LineNr">870 </span> 01/add 3/mod/direct 2/rm32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># add esi to edx</span> <span id="L871" class="LineNr">871 </span><span class="Constant">$write-segments:loop</span>: <span id="L872" class="LineNr">872 </span> <span class="subxComment"># if (curr >= max) break</span> <span id="L873" class="LineNr">873 </span> 39/compare 3/mod/direct 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># compare esi with edx</span> <span id="L874" class="LineNr">874 </span> 73/jump-if-greater-or-equal-unsigned $write-segments:<span class="Constant">break</span>/disp8 -<span id="L875" class="LineNr">875 </span> <span class="subxComment"># var stream/eax : (address stream byte) = table[i].stream</span> +<span id="L875" class="LineNr">875 </span> <span class="subxComment"># var stream/eax : (addr stream byte) = table[i].stream</span> <span id="L876" class="LineNr">876 </span> 8b/copy 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(esi+4) to eax</span> <span id="L877" class="LineNr">877 </span> <span class="subxComment"># write-stream-data(out, stream)</span> <span id="L878" class="LineNr">878 </span> <span class="subxS2Comment"># . . push args</span> diff --git a/html/apps/braces.subx.html b/html/apps/braces.subx.html index 50639b81..9f8256cf 100644 --- a/html/apps/braces.subx.html +++ b/html/apps/braces.subx.html @@ -134,7 +134,7 @@ if ('onhashchange' in window) { <span id="L75" class="LineNr"> 75 </span> b8/copy-to-eax 1/imm32/exit <span id="L76" class="LineNr"> 76 </span> cd/syscall 0x80/imm8 <span id="L77" class="LineNr"> 77 </span> -<span id="L78" class="LineNr"> 78 </span><span class="subxFunction">subx-braces</span>: <span class="subxComment"># in : (address buffered-file), out : (address buffered-file)</span> +<span id="L78" class="LineNr"> 78 </span><span class="subxFunction">subx-braces</span>: <span class="subxComment"># in : (addr buffered-file), out : (addr buffered-file)</span> <span id="L79" class="LineNr"> 79 </span> <span class="subxComment"># pseudocode:</span> <span id="L80" class="LineNr"> 80 </span> <span class="subxComment"># var line : (ref stream byte 512)</span> <span id="L81" class="LineNr"> 81 </span> <span class="subxComment"># var label-stack : (stack int 32) # at most 32 levels of nesting</span> @@ -154,7 +154,7 @@ if ('onhashchange' in window) { <span id="L95" class="LineNr"> 95 </span> <span class="subxComment"># print(out, "_break" top ":\n")</span> <span id="L96" class="LineNr"> 96 </span> <span class="subxComment"># continue</span> <span id="L97" class="LineNr"> 97 </span> <span class="subxComment"># while true</span> -<span id="L98" class="LineNr"> 98 </span> <span class="subxComment"># var word-slice : (address slice) = next-word-or-string(line)</span> +<span id="L98" class="LineNr"> 98 </span> <span class="subxComment"># var word-slice : (addr slice) = next-word-or-string(line)</span> <span id="L99" class="LineNr"> 99 </span> <span class="subxComment"># if slice-empty?(word-slice) # end of line</span> <span id="L100" class="LineNr">100 </span> <span class="subxComment"># break</span> <span id="L101" class="LineNr">101 </span> <span class="subxComment"># if slice-starts-with?(word-slice, "#") # comment</span> diff --git a/html/apps/calls.subx.html b/html/apps/calls.subx.html index 9f78d04d..c8949bbd 100644 --- a/html/apps/calls.subx.html +++ b/html/apps/calls.subx.html @@ -136,7 +136,7 @@ if ('onhashchange' in window) { <span id="L75" class="LineNr"> 75 </span> b8/copy-to-eax 1/imm32/exit <span id="L76" class="LineNr"> 76 </span> cd/syscall 0x80/imm8 <span id="L77" class="LineNr"> 77 </span> -<span id="L78" class="LineNr"> 78 </span><span class="subxFunction">subx-calls</span>: <span class="subxComment"># in : (address buffered-file), out : (address buffered-file)</span> +<span id="L78" class="LineNr"> 78 </span><span class="subxFunction">subx-calls</span>: <span class="subxComment"># in : (addr buffered-file), out : (addr buffered-file)</span> <span id="L79" class="LineNr"> 79 </span> <span class="subxComment"># pseudocode:</span> <span id="L80" class="LineNr"> 80 </span> <span class="subxComment"># var line : (ref stream byte 512)</span> <span id="L81" class="LineNr"> 81 </span> <span class="subxComment"># var words : (ref stream slice 16) # at most function name and 15 args</span> @@ -292,7 +292,7 @@ if ('onhashchange' in window) { <span id="L231" class="LineNr"> 231 </span> 5d/pop-to-ebp <span id="L232" class="LineNr"> 232 </span> c3/return <span id="L233" class="LineNr"> 233 </span> -<span id="L234" class="LineNr"> 234 </span><span class="subxFunction">parse-line</span>: <span class="subxComment"># line : (address stream byte), words : (address stream slice)</span> +<span id="L234" class="LineNr"> 234 </span><span class="subxFunction">parse-line</span>: <span class="subxComment"># line : (addr stream byte), words : (addr stream slice)</span> <span id="L235" class="LineNr"> 235 </span> <span class="subxComment"># pseudocode:</span> <span id="L236" class="LineNr"> 236 </span> <span class="subxComment"># var word-slice : (ref slice)</span> <span id="L237" class="LineNr"> 237 </span> <span class="subxComment"># while true</span> @@ -362,7 +362,7 @@ if ('onhashchange' in window) { <span id="L340" class="LineNr"> 340 </span> 5d/pop-to-ebp <span id="L341" class="LineNr"> 341 </span> c3/return <span id="L342" class="LineNr"> 342 </span> -<span id="L343" class="LineNr"> 343 </span><span class="subxFunction">emit-call</span>: <span class="subxComment"># out : (address buffered-file), words : (address stream slice)</span> +<span id="L343" class="LineNr"> 343 </span><span class="subxFunction">emit-call</span>: <span class="subxComment"># out : (addr buffered-file), words : (addr stream slice)</span> <span id="L344" class="LineNr"> 344 </span> <span class="subxComment"># pseudocode:</span> <span id="L345" class="LineNr"> 345 </span> <span class="subxComment"># if (words->write < 8) abort</span> <span id="L346" class="LineNr"> 346 </span> <span class="subxComment"># curr = &words->data[words->write-8]</span> @@ -403,9 +403,9 @@ if ('onhashchange' in window) { <span id="L381" class="LineNr"> 381 </span> 8b/-> *esi 1/r32/ecx <span id="L382" class="LineNr"> 382 </span> 81 5/subop/subtract %ecx 8/imm32 <span id="L383" class="LineNr"> 383 </span> 0f 8c/jump-if-lesser $emit-call:error1/disp32 -<span id="L384" class="LineNr"> 384 </span> <span class="subxComment"># var curr/ecx : (address slice) = &words->data[words->write-8]</span> +<span id="L384" class="LineNr"> 384 </span> <span class="subxComment"># var curr/ecx : (addr slice) = &words->data[words->write-8]</span> <span id="L385" class="LineNr"> 385 </span> 8d/copy-address *(esi+ecx+0xc) 1/r32/ecx -<span id="L386" class="LineNr"> 386 </span> <span class="subxComment"># var min/edx : (address byte) = words->data</span> +<span id="L386" class="LineNr"> 386 </span> <span class="subxComment"># var min/edx : (addr byte) = words->data</span> <span id="L387" class="LineNr"> 387 </span> 8d/copy-address *(esi+0xc) 2/r32/edx <span id="L388" class="LineNr"> 388 </span> <span class="subxH1Comment"># - emit pushes</span> <span id="L389" class="LineNr"> 389 </span><span class="Constant">$emit-call:push-loop</span>: @@ -413,7 +413,7 @@ if ('onhashchange' in window) { <span id="L391" class="LineNr"> 391 </span> 39/compare %ecx 2/r32/edx <span id="L392" class="LineNr"> 392 </span> 0f 8e/jump-if-lesser-or-equal $emit-call:call-instruction/disp32 <span id="L393" class="LineNr"> 393 </span> <span class="subxComment"># if (*curr->start in '%' '*') goto push-rm32</span> -<span id="L394" class="LineNr"> 394 </span> <span class="subxS1Comment"># . var start/eax : (address byte) = curr->start</span> +<span id="L394" class="LineNr"> 394 </span> <span class="subxS1Comment"># . var start/eax : (addr byte) = curr->start</span> <span id="L395" class="LineNr"> 395 </span> 8b/-> *ecx 0/r32/eax <span id="L396" class="LineNr"> 396 </span> <span class="subxS1Comment"># . var c/eax : byte = *eax</span> <span id="L397" class="LineNr"> 397 </span> 8b/-> *eax 0/r32/eax @@ -731,7 +731,7 @@ if ('onhashchange' in window) { <span id="L741" class="LineNr"> 741 </span> 5d/pop-to-ebp <span id="L742" class="LineNr"> 742 </span> c3/return <span id="L743" class="LineNr"> 743 </span> -<span id="L744" class="LineNr"> 744 </span><span class="subxFunction">next-word-string-or-expression-without-metadata</span>: <span class="subxComment"># line : (address stream byte), out : (address slice)</span> +<span id="L744" class="LineNr"> 744 </span><span class="subxFunction">next-word-string-or-expression-without-metadata</span>: <span class="subxComment"># line : (addr stream byte), out : (addr slice)</span> <span id="L745" class="LineNr"> 745 </span> <span class="subxComment"># pseudocode:</span> <span id="L746" class="LineNr"> 746 </span> <span class="subxComment"># skip-chars-matching(line, ' ')</span> <span id="L747" class="LineNr"> 747 </span> <span class="subxComment"># if line->read >= line->write # end of line</span> diff --git a/html/apps/crenshaw2-1.subx.html b/html/apps/crenshaw2-1.subx.html index df65b454..35d75540 100644 --- a/html/apps/crenshaw2-1.subx.html +++ b/html/apps/crenshaw2-1.subx.html @@ -151,7 +151,7 @@ if ('onhashchange' in window) { <span id="L90" class="LineNr"> 90 </span> cd/syscall 0x80/imm8 <span id="L91" class="LineNr"> 91 </span> <span id="L92" class="LineNr"> 92 </span><span class="subxComment"># the main entry point</span> -<span id="L93" class="LineNr"> 93 </span><span class="subxFunction">compile</span>: <span class="subxComment"># in : (address buffered-file), out : fd or (address stream byte), err : fd or (address stream byte), ed : (address exit-descriptor)</span> +<span id="L93" class="LineNr"> 93 </span><span class="subxFunction">compile</span>: <span class="subxComment"># in : (addr buffered-file), out : fd or (addr stream byte), err : fd or (addr stream byte), ed : (addr exit-descriptor)</span> <span id="L94" class="LineNr"> 94 </span> <span class="subxS1Comment"># . prologue</span> <span id="L95" class="LineNr"> 95 </span> 55/push-ebp <span id="L96" class="LineNr"> 96 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -252,7 +252,7 @@ if ('onhashchange' in window) { <span id="L191" class="LineNr">191 </span><span class="subxComment"># space in 'out'.</span> <span id="L192" class="LineNr">192 </span><span class="subxComment"># Input comes from the global variable 'Look' (first byte) and the argument</span> <span id="L193" class="LineNr">193 </span><span class="subxComment"># 'in' (rest). We leave the next byte from 'in' into 'Look' on exit.</span> -<span id="L194" class="LineNr">194 </span><span class="subxFunction">get-num</span>: <span class="subxComment"># in : (address buffered-file), out : (address stream byte), err : fd or (address stream byte), ed : (address exit-descriptor)</span> +<span id="L194" class="LineNr">194 </span><span class="subxFunction">get-num</span>: <span class="subxComment"># in : (addr buffered-file), out : (addr stream byte), err : fd or (addr stream byte), ed : (addr exit-descriptor)</span> <span id="L195" class="LineNr">195 </span> <span class="subxComment"># pseudocode:</span> <span id="L196" class="LineNr">196 </span> <span class="subxComment"># if (!is-digit?(Look)) expected(ed, err, "integer")</span> <span id="L197" class="LineNr">197 </span> <span class="subxComment"># if out->write >= out->length</span> @@ -531,7 +531,7 @@ if ('onhashchange' in window) { <span id="L470" class="LineNr">470 </span><span class="subxComment">## helpers</span> <span id="L471" class="LineNr">471 </span> <span id="L472" class="LineNr">472 </span><span class="subxComment"># write(f, "Error: "+s+" expected\n") then stop(ed, 1)</span> -<span id="L473" class="LineNr">473 </span><span class="subxFunction">expected</span>: <span class="subxComment"># ed : (address exit-descriptor), f : fd or (address stream byte), s : (address array byte)</span> +<span id="L473" class="LineNr">473 </span><span class="subxFunction">expected</span>: <span class="subxComment"># ed : (addr exit-descriptor), f : fd or (addr stream byte), s : (addr array byte)</span> <span id="L474" class="LineNr">474 </span> <span class="subxS1Comment"># . prologue</span> <span id="L475" class="LineNr">475 </span> 55/push-ebp <span id="L476" class="LineNr">476 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -573,7 +573,7 @@ if ('onhashchange' in window) { <span id="L512" class="LineNr">512 </span> c3/return <span id="L513" class="LineNr">513 </span> <span id="L514" class="LineNr">514 </span><span class="subxComment"># read a byte from 'f', and save it in 'Look'</span> -<span id="L515" class="LineNr">515 </span><span class="subxFunction">get-char</span>: <span class="subxComment"># f : (address buffered-file)</span> +<span id="L515" class="LineNr">515 </span><span class="subxFunction">get-char</span>: <span class="subxComment"># f : (addr buffered-file)</span> <span id="L516" class="LineNr">516 </span> <span class="subxS1Comment"># . prologue</span> <span id="L517" class="LineNr">517 </span> 55/push-ebp <span id="L518" class="LineNr">518 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> diff --git a/html/apps/crenshaw2-1b.subx.html b/html/apps/crenshaw2-1b.subx.html index 1c15f4f9..097d27f4 100644 --- a/html/apps/crenshaw2-1b.subx.html +++ b/html/apps/crenshaw2-1b.subx.html @@ -151,7 +151,7 @@ if ('onhashchange' in window) { <span id="L90" class="LineNr"> 90 </span> cd/syscall 0x80/imm8 <span id="L91" class="LineNr"> 91 </span> <span id="L92" class="LineNr"> 92 </span><span class="subxComment"># the main entry point</span> -<span id="L93" class="LineNr"> 93 </span><span class="subxFunction">compile</span>: <span class="subxComment"># in : (address buffered-file), out : fd or (address stream byte), err : fd or (address stream byte), ed : (address exit-descriptor)</span> +<span id="L93" class="LineNr"> 93 </span><span class="subxFunction">compile</span>: <span class="subxComment"># in : (addr buffered-file), out : fd or (addr stream byte), err : fd or (addr stream byte), ed : (addr exit-descriptor)</span> <span id="L94" class="LineNr"> 94 </span> <span class="subxS1Comment"># . prologue</span> <span id="L95" class="LineNr"> 95 </span> 55/push-ebp <span id="L96" class="LineNr"> 96 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -252,7 +252,7 @@ if ('onhashchange' in window) { <span id="L191" class="LineNr">191 </span><span class="subxComment"># no space in 'out'.</span> <span id="L192" class="LineNr">192 </span><span class="subxComment"># Input comes from the global variable 'Look' (first byte) and the argument</span> <span id="L193" class="LineNr">193 </span><span class="subxComment"># 'in' (rest). We leave the next byte from 'in' into 'Look' on exit.</span> -<span id="L194" class="LineNr">194 </span><span class="subxFunction">get-num</span>: <span class="subxComment"># in : (address buffered-file), out : (address stream byte), err : fd or (address stream byte), ed : (address exit-descriptor)</span> +<span id="L194" class="LineNr">194 </span><span class="subxFunction">get-num</span>: <span class="subxComment"># in : (addr buffered-file), out : (addr stream byte), err : fd or (addr stream byte), ed : (addr exit-descriptor)</span> <span id="L195" class="LineNr">195 </span> <span class="subxComment"># pseudocode:</span> <span id="L196" class="LineNr">196 </span> <span class="subxComment"># if (!is-digit?(Look)) expected(ed, err, "integer")</span> <span id="L197" class="LineNr">197 </span> <span class="subxComment"># do</span> @@ -725,7 +725,7 @@ if ('onhashchange' in window) { <span id="L664" class="LineNr">664 </span><span class="subxComment">## helpers</span> <span id="L665" class="LineNr">665 </span> <span id="L666" class="LineNr">666 </span><span class="subxComment"># write(f, "Error: "+s+" expected\n") then stop(ed, 1)</span> -<span id="L667" class="LineNr">667 </span><span class="subxFunction">expected</span>: <span class="subxComment"># ed : (address exit-descriptor), f : fd or (address stream byte), s : (address array byte)</span> +<span id="L667" class="LineNr">667 </span><span class="subxFunction">expected</span>: <span class="subxComment"># ed : (addr exit-descriptor), f : fd or (addr stream byte), s : (addr array byte)</span> <span id="L668" class="LineNr">668 </span> <span class="subxS1Comment"># . prologue</span> <span id="L669" class="LineNr">669 </span> 55/push-ebp <span id="L670" class="LineNr">670 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -767,7 +767,7 @@ if ('onhashchange' in window) { <span id="L706" class="LineNr">706 </span> c3/return <span id="L707" class="LineNr">707 </span> <span id="L708" class="LineNr">708 </span><span class="subxComment"># read a byte from 'f', and save it in 'Look'</span> -<span id="L709" class="LineNr">709 </span><span class="subxFunction">get-char</span>: <span class="subxComment"># f : (address buffered-file)</span> +<span id="L709" class="LineNr">709 </span><span class="subxFunction">get-char</span>: <span class="subxComment"># f : (addr buffered-file)</span> <span id="L710" class="LineNr">710 </span> <span class="subxS1Comment"># . prologue</span> <span id="L711" class="LineNr">711 </span> 55/push-ebp <span id="L712" class="LineNr">712 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> diff --git a/html/apps/dquotes.subx.html b/html/apps/dquotes.subx.html index b0d80c00..f6a880b6 100644 --- a/html/apps/dquotes.subx.html +++ b/html/apps/dquotes.subx.html @@ -145,7 +145,7 @@ if ('onhashchange' in window) { <span id="L82" class="LineNr"> 82 </span><span class="subxComment"># line = words separated by ' ', maybe followed by comment starting with '#'</span> <span id="L83" class="LineNr"> 83 </span><span class="subxComment"># word = datum until '/', then 0 or more metadata separated by '/'</span> <span id="L84" class="LineNr"> 84 </span> -<span id="L85" class="LineNr"> 85 </span><span class="subxFunction">subx-dquotes</span>: <span class="subxComment"># in : (address buffered-file), out : (address buffered-file)</span> +<span id="L85" class="LineNr"> 85 </span><span class="subxFunction">subx-dquotes</span>: <span class="subxComment"># in : (addr buffered-file), out : (addr buffered-file)</span> <span id="L86" class="LineNr"> 86 </span> <span class="subxComment"># pseudocode:</span> <span id="L87" class="LineNr"> 87 </span> <span class="subxComment"># var line : (ref stream byte 512)</span> <span id="L88" class="LineNr"> 88 </span> <span class="subxComment"># var new-data-segment : (handle stream byte) = new-stream(Heap, Segment-size, 1)</span> @@ -261,7 +261,7 @@ if ('onhashchange' in window) { <span id="L198" class="LineNr"> 198 </span> 0f 85/jump-if-not-equal $subx-dquotes:next-line/disp32 <span id="L199" class="LineNr"> 199 </span><span class="Constant">$subx-dquotes:check-for-comment</span>: <span id="L200" class="LineNr"> 200 </span> <span class="subxComment"># if (slice-starts-with?(word-slice, "#")) continue</span> -<span id="L201" class="LineNr"> 201 </span> <span class="subxS1Comment"># . var start/esi : (address byte) = word-slice->start</span> +<span id="L201" class="LineNr"> 201 </span> <span class="subxS1Comment"># . var start/esi : (addr byte) = word-slice->start</span> <span id="L202" class="LineNr"> 202 </span> 8b/copy 0/mod/indirect 2/rm32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *edx to esi</span> <span id="L203" class="LineNr"> 203 </span> <span class="subxS1Comment"># . var c/eax : byte = *start</span> <span id="L204" class="LineNr"> 204 </span> 31/xor 3/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># clear eax</span> @@ -350,7 +350,7 @@ if ('onhashchange' in window) { <span id="L287" class="LineNr"> 287 </span> <span id="L288" class="LineNr"> 288 </span><span class="subxComment"># Write out 'string-literal' in a new format to 'out-segment', assign it a new</span> <span id="L289" class="LineNr"> 289 </span><span class="subxComment"># label, and write the new label out to 'out'.</span> -<span id="L290" class="LineNr"> 290 </span><span class="subxFunction">process-string-literal</span>: <span class="subxComment"># string-literal : (address slice), out : (address buffered-file), out-segment : (address stream byte)</span> +<span id="L290" class="LineNr"> 290 </span><span class="subxFunction">process-string-literal</span>: <span class="subxComment"># string-literal : (addr slice), out : (addr buffered-file), out-segment : (addr stream byte)</span> <span id="L291" class="LineNr"> 291 </span> <span class="subxComment"># pseudocode:</span> <span id="L292" class="LineNr"> 292 </span> <span class="subxComment"># print(out-segment, "_string#{Next-string-literal}:\n")</span> <span id="L293" class="LineNr"> 293 </span> <span class="subxComment"># emit-string-literal-data(out-segment, string-literal)</span> @@ -852,7 +852,7 @@ if ('onhashchange' in window) { <span id="L846" class="LineNr"> 846 </span> c3/return <span id="L847" class="LineNr"> 847 </span> <span id="L848" class="LineNr"> 848 </span><span class="subxComment"># generate the data segment contents byte by byte for a given slice</span> -<span id="L849" class="LineNr"> 849 </span><span class="subxFunction">emit-string-literal-data</span>: <span class="subxComment"># out : (address stream byte), word : (address slice)</span> +<span id="L849" class="LineNr"> 849 </span><span class="subxFunction">emit-string-literal-data</span>: <span class="subxComment"># out : (addr stream byte), word : (addr slice)</span> <span id="L850" class="LineNr"> 850 </span> <span class="subxComment"># pseudocode</span> <span id="L851" class="LineNr"> 851 </span> <span class="subxComment"># len = string-length-at-start-of-slice(word->start, word->end)</span> <span id="L852" class="LineNr"> 852 </span> <span class="subxComment"># print(out, "#{len}/imm32 ")</span> @@ -893,9 +893,9 @@ if ('onhashchange' in window) { <span id="L887" class="LineNr"> 887 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+12) to esi</span> <span id="L888" class="LineNr"> 888 </span> <span class="subxComment"># var idx/ebx : int = 0</span> <span id="L889" class="LineNr"> 889 </span> 31/xor 3/mod/direct 3/rm32/ebx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 3/r32/ebx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># clear ebx</span> -<span id="L890" class="LineNr"> 890 </span> <span class="subxComment"># var curr/edx : (address byte) = word->start</span> +<span id="L890" class="LineNr"> 890 </span> <span class="subxComment"># var curr/edx : (addr byte) = word->start</span> <span id="L891" class="LineNr"> 891 </span> 8b/copy 0/mod/indirect 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *esi to edx</span> -<span id="L892" class="LineNr"> 892 </span> <span class="subxComment"># var max/esi : (address byte) = word->end</span> +<span id="L892" class="LineNr"> 892 </span> <span class="subxComment"># var max/esi : (addr byte) = word->end</span> <span id="L893" class="LineNr"> 893 </span> 8b/copy 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(esi+4) to esi</span> <span id="L894" class="LineNr"> 894 </span><span class="Constant">$emit-string-literal-data:emit-length</span>: <span id="L895" class="LineNr"> 895 </span> <span class="subxComment"># var len/eax : int = string-length-at-start-of-slice(word->start, word->end)</span> @@ -1260,7 +1260,7 @@ if ('onhashchange' in window) { <span id="L1379" class="LineNr">1379 </span> c3/return <span id="L1380" class="LineNr">1380 </span> <span id="L1381" class="LineNr">1381 </span><span class="subxComment"># emit everything from a word except the initial datum</span> -<span id="L1382" class="LineNr">1382 </span><span class="subxFunction">emit-metadata</span>: <span class="subxComment"># out : (address buffered-file), word : (address slice)</span> +<span id="L1382" class="LineNr">1382 </span><span class="subxFunction">emit-metadata</span>: <span class="subxComment"># out : (addr buffered-file), word : (addr slice)</span> <span id="L1383" class="LineNr">1383 </span> <span class="subxComment"># pseudocode</span> <span id="L1384" class="LineNr">1384 </span> <span class="subxComment"># var slice : (ref slice) = {0, word->end}</span> <span id="L1385" class="LineNr">1385 </span> <span class="subxComment"># curr = word->start</span> @@ -1287,9 +1287,9 @@ if ('onhashchange' in window) { <span id="L1406" class="LineNr">1406 </span> 56/push-esi <span id="L1407" class="LineNr">1407 </span> <span class="subxComment"># esi = word</span> <span id="L1408" class="LineNr">1408 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+12) to esi</span> -<span id="L1409" class="LineNr">1409 </span> <span class="subxComment"># var curr/ecx : (address byte) = word->start</span> +<span id="L1409" class="LineNr">1409 </span> <span class="subxComment"># var curr/ecx : (addr byte) = word->start</span> <span id="L1410" class="LineNr">1410 </span> 8b/copy 0/mod/indirect 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *esi to ecx</span> -<span id="L1411" class="LineNr">1411 </span> <span class="subxComment"># var end/edx : (address byte) = word->end</span> +<span id="L1411" class="LineNr">1411 </span> <span class="subxComment"># var end/edx : (addr byte) = word->end</span> <span id="L1412" class="LineNr">1412 </span> 8b/copy 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(esi+4) to edx</span> <span id="L1413" class="LineNr">1413 </span> <span class="subxComment"># var slice/ebx : (ref slice) = {0, end}</span> <span id="L1414" class="LineNr">1414 </span> 52/push-edx @@ -1634,7 +1634,7 @@ if ('onhashchange' in window) { <span id="L1778" class="LineNr">1778 </span> 5d/pop-to-ebp <span id="L1779" class="LineNr">1779 </span> c3/return <span id="L1780" class="LineNr">1780 </span> -<span id="L1781" class="LineNr">1781 </span><span class="subxFunction">string-length-at-start-of-slice</span>: <span class="subxComment"># curr : (address byte), end : (address byte) -> length/eax</span> +<span id="L1781" class="LineNr">1781 </span><span class="subxFunction">string-length-at-start-of-slice</span>: <span class="subxComment"># curr : (addr byte), end : (addr byte) -> length/eax</span> <span id="L1782" class="LineNr">1782 </span> <span class="subxS1Comment"># . prologue</span> <span id="L1783" class="LineNr">1783 </span> 55/push-ebp <span id="L1784" class="LineNr">1784 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> diff --git a/html/apps/ex11.subx.html b/html/apps/ex11.subx.html index 28fa18f0..84519e0e 100644 --- a/html/apps/ex11.subx.html +++ b/html/apps/ex11.subx.html @@ -320,7 +320,7 @@ if ('onhashchange' in window) { <span id="L258" class="LineNr">258 </span><span class="subxH1Comment"># - helpers</span> <span id="L259" class="LineNr">259 </span> <span id="L260" class="LineNr">260 </span><span class="subxComment"># print msg to stderr if a != b, otherwise print "."</span> -<span id="L261" class="LineNr">261 </span><span class="subxFunction">check-ints-equal</span>: <span class="subxComment"># (a : int, b : int, msg : (address array byte)) -> boolean</span> +<span id="L261" class="LineNr">261 </span><span class="subxFunction">check-ints-equal</span>: <span class="subxComment"># (a : int, b : int, msg : (addr array byte)) -> boolean</span> <span id="L262" class="LineNr">262 </span> <span class="subxS1Comment"># . prologue</span> <span id="L263" class="LineNr">263 </span> 55/push-ebp <span id="L264" class="LineNr">264 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -369,7 +369,7 @@ if ('onhashchange' in window) { <span id="L307" class="LineNr">307 </span> 5d/pop-to-ebp <span id="L308" class="LineNr">308 </span> c3/return <span id="L309" class="LineNr">309 </span> -<span id="L310" class="LineNr">310 </span><span class="subxFunction">write-stderr</span>: <span class="subxComment"># s : (address array byte) -> <void></span> +<span id="L310" class="LineNr">310 </span><span class="subxFunction">write-stderr</span>: <span class="subxComment"># s : (addr array byte) -> <void></span> <span id="L311" class="LineNr">311 </span> <span class="subxS1Comment"># . prologue</span> <span id="L312" class="LineNr">312 </span> 55/push-ebp <span id="L313" class="LineNr">313 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> diff --git a/html/apps/ex8.subx.html b/html/apps/ex8.subx.html index ab67bb1f..04c0e1cb 100644 --- a/html/apps/ex8.subx.html +++ b/html/apps/ex8.subx.html @@ -93,7 +93,7 @@ if ('onhashchange' in window) { <span id="L34" class="LineNr">34 </span> 89/copy 3/mod/direct 3/rm32/ebx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy eax to ebx</span> <span id="L35" class="LineNr">35 </span> e8/call syscall_exit/disp32 <span id="L36" class="LineNr">36 </span> -<span id="L37" class="LineNr">37 </span><span class="subxFunction">ascii-length</span>: <span class="subxComment"># s : (address array byte) -> n/eax</span> +<span id="L37" class="LineNr">37 </span><span class="subxFunction">ascii-length</span>: <span class="subxComment"># s : (addr array byte) -> n/eax</span> <span id="L38" class="LineNr">38 </span> <span class="subxComment"># edx = s</span> <span id="L39" class="LineNr">39 </span> 8b/copy 1/mod/*+disp8 4/rm32/sib 4/base/esp 4/index/none <span class="Normal"> . </span> 2/r32/edx 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(esp+4) to edx</span> <span id="L40" class="LineNr">40 </span> <span class="subxComment"># var result/eax = 0</span> diff --git a/html/apps/handle.subx.html b/html/apps/handle.subx.html index e4f90531..a7a8d6aa 100644 --- a/html/apps/handle.subx.html +++ b/html/apps/handle.subx.html @@ -107,7 +107,7 @@ if ('onhashchange' in window) { <span id="L44" class="LineNr"> 44 </span> b8/copy-to-eax 1/imm32/exit <span id="L45" class="LineNr"> 45 </span> cd/syscall 0x80/imm8 <span id="L46" class="LineNr"> 46 </span> -<span id="L47" class="LineNr"> 47 </span><span class="subxFunction">new</span>: <span class="subxComment"># ad : (address allocation-descriptor), n : int, out : (handle _)</span> +<span id="L47" class="LineNr"> 47 </span><span class="subxFunction">new</span>: <span class="subxComment"># ad : (addr allocation-descriptor), n : int, out : (handle _)</span> <span id="L48" class="LineNr"> 48 </span> <span class="subxS1Comment"># . prologue</span> <span id="L49" class="LineNr"> 49 </span> 55/push-ebp <span id="L50" class="LineNr"> 50 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -284,7 +284,7 @@ if ('onhashchange' in window) { <span id="L221" class="LineNr">221 </span> 5d/pop-to-ebp <span id="L222" class="LineNr">222 </span> c3/return <span id="L223" class="LineNr">223 </span> -<span id="L224" class="LineNr">224 </span><span class="subxFunction">lookup</span>: <span class="subxComment"># h : (handle T) -> eax : (address T)</span> +<span id="L224" class="LineNr">224 </span><span class="subxFunction">lookup</span>: <span class="subxComment"># h : (handle T) -> eax : (addr T)</span> <span id="L225" class="LineNr">225 </span> <span class="subxS1Comment"># . prologue</span> <span id="L226" class="LineNr">226 </span> 55/push-ebp <span id="L227" class="LineNr">227 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> diff --git a/html/apps/hex.subx.html b/html/apps/hex.subx.html index e09ac4cd..bbf94945 100644 --- a/html/apps/hex.subx.html +++ b/html/apps/hex.subx.html @@ -138,7 +138,7 @@ if ('onhashchange' in window) { <span id="L77" class="LineNr"> 77 </span> cd/syscall 0x80/imm8 <span id="L78" class="LineNr"> 78 </span> <span id="L79" class="LineNr"> 79 </span><span class="subxComment"># the main entry point</span> -<span id="L80" class="LineNr"> 80 </span><span class="subxFunction">subx-hex</span>: <span class="subxComment"># in : (address buffered-file), out : (address buffered-file), err : (address buffered-file), ed : (address exit-descriptor)</span> +<span id="L80" class="LineNr"> 80 </span><span class="subxFunction">subx-hex</span>: <span class="subxComment"># in : (addr buffered-file), out : (addr buffered-file), err : (addr buffered-file), ed : (addr exit-descriptor)</span> <span id="L81" class="LineNr"> 81 </span> <span class="subxComment"># pseudocode:</span> <span id="L82" class="LineNr"> 82 </span> <span class="subxComment"># while true</span> <span id="L83" class="LineNr"> 83 </span> <span class="subxComment"># eax = convert-next-octet(in, err, ed)</span> @@ -196,7 +196,7 @@ if ('onhashchange' in window) { <span id="L135" class="LineNr"> 135 </span><span class="subxComment"># raise an error and abort on all other unexpected bytes</span> <span id="L136" class="LineNr"> 136 </span><span class="subxComment"># return in eax an _octet_ containing the binary value of the two hex characters</span> <span id="L137" class="LineNr"> 137 </span><span class="subxComment"># return Eof on reaching end of file</span> -<span id="L138" class="LineNr"> 138 </span><span class="subxFunction">convert-next-octet</span>: <span class="subxComment"># in : (address buffered-file), err : (address buffered-file), ed : (address exit-descriptor) -> byte-or-Eof/eax</span> +<span id="L138" class="LineNr"> 138 </span><span class="subxFunction">convert-next-octet</span>: <span class="subxComment"># in : (addr buffered-file), err : (addr buffered-file), ed : (addr exit-descriptor) -> byte-or-Eof/eax</span> <span id="L139" class="LineNr"> 139 </span> <span class="subxComment"># pseudocode:</span> <span id="L140" class="LineNr"> 140 </span> <span class="subxComment"># eax = scan-next-byte(in, err, ed)</span> <span id="L141" class="LineNr"> 141 </span> <span class="subxComment"># if (eax == Eof) return</span> @@ -542,7 +542,7 @@ if ('onhashchange' in window) { <span id="L481" class="LineNr"> 481 </span><span class="subxComment"># return Eof if file ends without finding a hex byte</span> <span id="L482" class="LineNr"> 482 </span><span class="subxComment"># on '#' skip all bytes until newline</span> <span id="L483" class="LineNr"> 483 </span><span class="subxComment"># abort on any other byte</span> -<span id="L484" class="LineNr"> 484 </span><span class="subxFunction">scan-next-byte</span>: <span class="subxComment"># in : (address buffered-file), err : (address buffered-file), ed : (address exit-descriptor) -> byte-or-Eof/eax</span> +<span id="L484" class="LineNr"> 484 </span><span class="subxFunction">scan-next-byte</span>: <span class="subxComment"># in : (addr buffered-file), err : (addr buffered-file), ed : (addr exit-descriptor) -> byte-or-Eof/eax</span> <span id="L485" class="LineNr"> 485 </span> <span class="subxComment"># pseudocode:</span> <span id="L486" class="LineNr"> 486 </span> <span class="subxComment"># while true</span> <span id="L487" class="LineNr"> 487 </span> <span class="subxComment"># eax = read-byte-buffered(in)</span> @@ -1411,7 +1411,7 @@ if ('onhashchange' in window) { <span id="L1350" class="LineNr">1350 </span> 5d/pop-to-ebp <span id="L1351" class="LineNr">1351 </span> c3/return <span id="L1352" class="LineNr">1352 </span> -<span id="L1353" class="LineNr">1353 </span><span class="subxFunction">skip-until-newline</span>: <span class="subxComment"># in : (address buffered-file)</span> +<span id="L1353" class="LineNr">1353 </span><span class="subxFunction">skip-until-newline</span>: <span class="subxComment"># in : (addr buffered-file)</span> <span id="L1354" class="LineNr">1354 </span> <span class="subxComment"># pseudocode:</span> <span id="L1355" class="LineNr">1355 </span> <span class="subxComment"># push eax</span> <span id="L1356" class="LineNr">1356 </span> <span class="subxComment"># while true</span> diff --git a/html/apps/mu.subx.html b/html/apps/mu.subx.html index 8201c261..af5d5389 100644 --- a/html/apps/mu.subx.html +++ b/html/apps/mu.subx.html @@ -308,7 +308,7 @@ if ('onhashchange' in window) { <span id="L246" class="LineNr"> 246 </span> <span id="L247" class="LineNr"> 247 </span>== data <span id="L248" class="LineNr"> 248 </span> -<span id="L249" class="LineNr"> 249 </span><span class="SpecialChar">Program</span>: <span class="subxComment"># (address (handle function))</span> +<span id="L249" class="LineNr"> 249 </span><span class="SpecialChar">Program</span>: <span class="subxComment"># (addr (handle function))</span> <span id="L250" class="LineNr"> 250 </span> 0/imm32 <span id="L251" class="LineNr"> 251 </span> <span id="L252" class="LineNr"> 252 </span><span class="SpecialChar">Function-name</span>: @@ -440,7 +440,7 @@ if ('onhashchange' in window) { <span id="L378" class="LineNr"> 378 </span> b8/copy-to-eax 1/imm32/exit <span id="L379" class="LineNr"> 379 </span> cd/syscall 0x80/imm8 <span id="L380" class="LineNr"> 380 </span> -<span id="L381" class="LineNr"> 381 </span><span class="subxFunction">convert-mu</span>: <span class="subxComment"># in : (address buffered-file), out : (address buffered-file)</span> +<span id="L381" class="LineNr"> 381 </span><span class="subxFunction">convert-mu</span>: <span class="subxComment"># in : (addr buffered-file), out : (addr buffered-file)</span> <span id="L382" class="LineNr"> 382 </span> <span class="subxS1Comment"># . prologue</span> <span id="L383" class="LineNr"> 383 </span> 55/push-ebp <span id="L384" class="LineNr"> 384 </span> 89/<- %ebp 4/r32/esp @@ -969,9 +969,9 @@ if ('onhashchange' in window) { <span id="L952" class="LineNr"> 952 </span><span class="subxComment"># Parsing</span> <span id="L953" class="LineNr"> 953 </span><span class="subxComment">#######################################################</span> <span id="L954" class="LineNr"> 954 </span> -<span id="L955" class="LineNr"> 955 </span><span class="subxFunction">parse-mu</span>: <span class="subxComment"># in : (address buffered-file)</span> +<span id="L955" class="LineNr"> 955 </span><span class="subxFunction">parse-mu</span>: <span class="subxComment"># in : (addr buffered-file)</span> <span id="L956" class="LineNr"> 956 </span> <span class="subxComment"># pseudocode</span> -<span id="L957" class="LineNr"> 957 </span> <span class="subxComment"># var curr-function : (address (handle function)) = Program</span> +<span id="L957" class="LineNr"> 957 </span> <span class="subxComment"># var curr-function : (addr (handle function)) = Program</span> <span id="L958" class="LineNr"> 958 </span> <span class="subxComment"># var line : (ref stream byte 512)</span> <span id="L959" class="LineNr"> 959 </span> <span class="subxComment"># var word-slice : (ref slice)</span> <span id="L960" class="LineNr"> 960 </span> <span class="subxComment"># while true # line loop</span> @@ -985,7 +985,7 @@ if ('onhashchange' in window) { <span id="L968" class="LineNr"> 968 </span> <span class="subxComment"># continue # end of line</span> <span id="L969" class="LineNr"> 969 </span> <span class="subxComment"># else if slice-equal(word-slice, "fn")</span> <span id="L970" class="LineNr"> 970 </span> <span class="subxComment"># var new-function : (handle function) = allocate(function)</span> -<span id="L971" class="LineNr"> 971 </span> <span class="subxComment"># var vars : (ref stack (address var) 256)</span> +<span id="L971" class="LineNr"> 971 </span> <span class="subxComment"># var vars : (ref stack (addr var) 256)</span> <span id="L972" class="LineNr"> 972 </span> <span class="subxComment"># populate-mu-function-header(in, new-function, vars)</span> <span id="L973" class="LineNr"> 973 </span> <span class="subxComment"># populate-mu-function-body(in, new-function, vars)</span> <span id="L974" class="LineNr"> 974 </span> <span class="subxComment"># assert(vars->top == 0)</span> @@ -1013,9 +1013,9 @@ if ('onhashchange' in window) { <span id="L996" class="LineNr"> 996 </span> 68/push 0/imm32/end <span id="L997" class="LineNr"> 997 </span> 68/push 0/imm32/start <span id="L998" class="LineNr"> 998 </span> 89/<- %edx 4/r32/esp -<span id="L999" class="LineNr"> 999 </span> <span class="subxComment"># var curr-function/edi : (address (handle function)) = Program</span> +<span id="L999" class="LineNr"> 999 </span> <span class="subxComment"># var curr-function/edi : (addr (handle function)) = Program</span> <span id="L1000" class="LineNr">1000 </span> bf/copy-to-edi <span class="SpecialChar"><a href='mu.subx.html#L249'>Program</a></span>/imm32 -<span id="L1001" class="LineNr">1001 </span> <span class="subxComment"># var vars/ebx : (ref stack (address var) 256)</span> +<span id="L1001" class="LineNr">1001 </span> <span class="subxComment"># var vars/ebx : (ref stack (addr var) 256)</span> <span id="L1002" class="LineNr">1002 </span> 81 5/subop/subtract %esp 0x400/imm32 <span id="L1003" class="LineNr">1003 </span> 68/push 0x400/imm32/length <span id="L1004" class="LineNr">1004 </span> 68/push 0/imm32/top @@ -1112,7 +1112,7 @@ if ('onhashchange' in window) { <span id="L1100" class="LineNr">1100 </span><span class="subxComment"># ✓ fn foo x : int {</span> <span id="L1101" class="LineNr">1101 </span><span class="subxComment"># ✓ fn foo x: int {</span> <span id="L1102" class="LineNr">1102 </span><span class="subxComment"># ✓ fn foo x: int -> y/eax: int {</span> -<span id="L1103" class="LineNr">1103 </span><span class="subxFunction">populate-mu-function-header</span>: <span class="subxComment"># first-line : (address stream byte), out : (handle function), vars : (address stack (handle var))</span> +<span id="L1103" class="LineNr">1103 </span><span class="subxFunction">populate-mu-function-header</span>: <span class="subxComment"># first-line : (addr stream byte), out : (handle function), vars : (addr stack (handle var))</span> <span id="L1104" class="LineNr">1104 </span> <span class="subxComment"># pseudocode:</span> <span id="L1105" class="LineNr">1105 </span> <span class="subxComment"># var name : (ref slice)</span> <span id="L1106" class="LineNr">1106 </span> <span class="subxComment"># next-word(first-line, name)</span> @@ -1309,7 +1309,7 @@ if ('onhashchange' in window) { <span id="L1297" class="LineNr">1297 </span> 2b/subtract-> *<span class="SpecialChar"><a href='mu.subx.html#L264'>Function-size</a></span> 4/r32/esp <span id="L1298" class="LineNr">1298 </span> 89/<- %ecx 4/r32/esp <span id="L1299" class="LineNr">1299 </span> (<a href='../080zero-out.subx.html#L8'>zero-out</a> %ecx *<span class="SpecialChar"><a href='mu.subx.html#L264'>Function-size</a></span>) -<span id="L1300" class="LineNr">1300 </span> <span class="subxComment"># var vars/ebx : (ref stack (address var) 16)</span> +<span id="L1300" class="LineNr">1300 </span> <span class="subxComment"># var vars/ebx : (ref stack (addr var) 16)</span> <span id="L1301" class="LineNr">1301 </span> 81 5/subop/subtract %esp 0x10/imm32 <span id="L1302" class="LineNr">1302 </span> 68/push 0x10/imm32/length <span id="L1303" class="LineNr">1303 </span> 68/push 0/imm32/top @@ -1341,7 +1341,7 @@ if ('onhashchange' in window) { <span id="L1329" class="LineNr">1329 </span> 2b/subtract-> *<span class="SpecialChar"><a href='mu.subx.html#L264'>Function-size</a></span> 4/r32/esp <span id="L1330" class="LineNr">1330 </span> 89/<- %ecx 4/r32/esp <span id="L1331" class="LineNr">1331 </span> (<a href='../080zero-out.subx.html#L8'>zero-out</a> %ecx *<span class="SpecialChar"><a href='mu.subx.html#L264'>Function-size</a></span>) -<span id="L1332" class="LineNr">1332 </span> <span class="subxComment"># var vars/ebx : (ref stack (address var) 16)</span> +<span id="L1332" class="LineNr">1332 </span> <span class="subxComment"># var vars/ebx : (ref stack (addr var) 16)</span> <span id="L1333" class="LineNr">1333 </span> 81 5/subop/subtract %esp 0x10/imm32 <span id="L1334" class="LineNr">1334 </span> 68/push 0x10/imm32/length <span id="L1335" class="LineNr">1335 </span> 68/push 0/imm32/top @@ -1388,7 +1388,7 @@ if ('onhashchange' in window) { <span id="L1376" class="LineNr">1376 </span> 2b/subtract-> *<span class="SpecialChar"><a href='mu.subx.html#L264'>Function-size</a></span> 4/r32/esp <span id="L1377" class="LineNr">1377 </span> 89/<- %ecx 4/r32/esp <span id="L1378" class="LineNr">1378 </span> (<a href='../080zero-out.subx.html#L8'>zero-out</a> %ecx *<span class="SpecialChar"><a href='mu.subx.html#L264'>Function-size</a></span>) -<span id="L1379" class="LineNr">1379 </span> <span class="subxComment"># var vars/ebx : (ref stack (address var) 16)</span> +<span id="L1379" class="LineNr">1379 </span> <span class="subxComment"># var vars/ebx : (ref stack (addr var) 16)</span> <span id="L1380" class="LineNr">1380 </span> 81 5/subop/subtract %esp 0x10/imm32 <span id="L1381" class="LineNr">1381 </span> 68/push 0x10/imm32/length <span id="L1382" class="LineNr">1382 </span> 68/push 0/imm32/top @@ -1439,12 +1439,12 @@ if ('onhashchange' in window) { <span id="L1427" class="LineNr">1427 </span><span class="subxComment"># x: int</span> <span id="L1428" class="LineNr">1428 </span><span class="subxComment"># x: int,</span> <span id="L1429" class="LineNr">1429 </span><span class="subxComment"># ignores at most one trailing colon or comma</span> -<span id="L1430" class="LineNr">1430 </span><span class="subxFunction">parse-var-with-type</span>: <span class="subxComment"># name: (address slice), first-line: (address stream byte) -> result/eax: (handle var)</span> +<span id="L1430" class="LineNr">1430 </span><span class="subxFunction">parse-var-with-type</span>: <span class="subxComment"># name: (addr slice), first-line: (addr stream byte) -> result/eax: (handle var)</span> <span id="L1431" class="LineNr">1431 </span> <span class="subxComment"># pseudocode:</span> <span id="L1432" class="LineNr">1432 </span> <span class="subxComment"># var v : (handle var) = allocate(Heap, Var-size)</span> <span id="L1433" class="LineNr">1433 </span> <span class="subxComment"># var s : (ref slice)</span> <span id="L1434" class="LineNr">1434 </span> <span class="subxComment"># next-token-from-slice(name->start, name->end, '/', s)</span> -<span id="L1435" class="LineNr">1435 </span> <span class="subxComment"># var end : (address byte) = s->end</span> +<span id="L1435" class="LineNr">1435 </span> <span class="subxComment"># var end : (addr byte) = s->end</span> <span id="L1436" class="LineNr">1436 </span> <span class="subxComment"># if (slice-ends-with(s, ":"))</span> <span id="L1437" class="LineNr">1437 </span> <span class="subxComment"># decrement s->end</span> <span id="L1438" class="LineNr">1438 </span> <span class="subxComment"># if (slice-ends-with(s, ","))</span> @@ -1615,7 +1615,7 @@ if ('onhashchange' in window) { <span id="L1603" class="LineNr">1603 </span> cd/syscall 0x80/imm8 <span id="L1604" class="LineNr">1604 </span> <span class="subxComment"># never gets here</span> <span id="L1605" class="LineNr">1605 </span> -<span id="L1606" class="LineNr">1606 </span><span class="subxFunction">next-mu-token</span>: <span class="subxComment"># in: (address stream byte), out: (address slice)</span> +<span id="L1606" class="LineNr">1606 </span><span class="subxFunction">next-mu-token</span>: <span class="subxComment"># in: (addr stream byte), out: (addr slice)</span> <span id="L1607" class="LineNr">1607 </span> <span class="subxS1Comment"># . prologue</span> <span id="L1608" class="LineNr">1608 </span> 55/push-ebp <span id="L1609" class="LineNr">1609 </span> 89/<- %ebp 4/r32/esp @@ -1656,7 +1656,7 @@ if ('onhashchange' in window) { <span id="L1644" class="LineNr">1644 </span> 5d/pop-to-ebp <span id="L1645" class="LineNr">1645 </span> c3/return <span id="L1646" class="LineNr">1646 </span> -<span id="L1647" class="LineNr">1647 </span><span class="subxFunction">type-for</span>: <span class="subxComment"># name: (address slice) -> result/eax: (handle s-expression type-id)</span> +<span id="L1647" class="LineNr">1647 </span><span class="subxFunction">type-for</span>: <span class="subxComment"># name: (addr slice) -> result/eax: (handle s-expression type-id)</span> <span id="L1648" class="LineNr">1648 </span> <span class="subxS1Comment"># . prologue</span> <span id="L1649" class="LineNr">1649 </span> 55/push-ebp <span id="L1650" class="LineNr">1650 </span> 89/<- %ebp 4/r32/esp @@ -1790,7 +1790,7 @@ if ('onhashchange' in window) { <span id="L1778" class="LineNr">1778 </span><span class="subxComment"># identifier starts with a letter or '$' or '_'</span> <span id="L1779" class="LineNr">1779 </span><span class="subxComment"># no constraints at the moment on later letters</span> <span id="L1780" class="LineNr">1780 </span><span class="subxComment"># all we really want to do so far is exclude '{', '}' and '->'</span> -<span id="L1781" class="LineNr">1781 </span><span class="subxFunction">is-identifier?</span>: <span class="subxComment"># in : (address slice) -> result/eax : boolean</span> +<span id="L1781" class="LineNr">1781 </span><span class="subxFunction">is-identifier?</span>: <span class="subxComment"># in : (addr slice) -> result/eax : boolean</span> <span id="L1782" class="LineNr">1782 </span> <span class="subxS1Comment"># . prologue</span> <span id="L1783" class="LineNr">1783 </span> 55/push-ebp <span id="L1784" class="LineNr">1784 </span> 89/<- %ebp 4/r32/esp @@ -2086,7 +2086,7 @@ if ('onhashchange' in window) { <span id="L2074" class="LineNr">2074 </span> 5d/pop-to-ebp <span id="L2075" class="LineNr">2075 </span> c3/return <span id="L2076" class="LineNr">2076 </span> -<span id="L2077" class="LineNr">2077 </span><span class="subxFunction">populate-mu-function-body</span>: <span class="subxComment"># in : (address buffered-file), out : (handle function), vars : (address stack (handle var))</span> +<span id="L2077" class="LineNr">2077 </span><span class="subxFunction">populate-mu-function-body</span>: <span class="subxComment"># in : (addr buffered-file), out : (handle function), vars : (addr stack (handle var))</span> <span id="L2078" class="LineNr">2078 </span> <span class="subxS1Comment"># . prologue</span> <span id="L2079" class="LineNr">2079 </span> 55/push-ebp <span id="L2080" class="LineNr">2080 </span> 89/<- %ebp 4/r32/esp @@ -2113,7 +2113,7 @@ if ('onhashchange' in window) { <span id="L2101" class="LineNr">2101 </span> c3/return <span id="L2102" class="LineNr">2102 </span> <span id="L2103" class="LineNr">2103 </span><span class="subxComment"># parses a block, assuming that the leading '{' has already been read by the caller</span> -<span id="L2104" class="LineNr">2104 </span><span class="subxFunction">parse-mu-block</span>: <span class="subxComment"># in : (address buffered-file), vars : (address stack (handle var)), fn : (handle function) -> result/eax : (handle block)</span> +<span id="L2104" class="LineNr">2104 </span><span class="subxFunction">parse-mu-block</span>: <span class="subxComment"># in : (addr buffered-file), vars : (addr stack (handle var)), fn : (handle function) -> result/eax : (handle block)</span> <span id="L2105" class="LineNr">2105 </span> <span class="subxComment"># pseudocode:</span> <span id="L2106" class="LineNr">2106 </span> <span class="subxComment"># var line : (ref stream byte 512)</span> <span id="L2107" class="LineNr">2107 </span> <span class="subxComment"># var word-slice : (ref slice)</span> @@ -2274,7 +2274,7 @@ if ('onhashchange' in window) { <span id="L2262" class="LineNr">2262 </span> cd/syscall 0x80/imm8 <span id="L2263" class="LineNr">2263 </span> <span class="subxComment"># never gets here</span> <span id="L2264" class="LineNr">2264 </span> -<span id="L2265" class="LineNr">2265 </span><span class="subxFunction">check-no-tokens-left</span>: <span class="subxComment"># line : (address stream byte)</span> +<span id="L2265" class="LineNr">2265 </span><span class="subxFunction">check-no-tokens-left</span>: <span class="subxComment"># line : (addr stream byte)</span> <span id="L2266" class="LineNr">2266 </span> <span class="subxS1Comment"># . prologue</span> <span id="L2267" class="LineNr">2267 </span> 55/push-ebp <span id="L2268" class="LineNr">2268 </span> 89/<- %ebp 4/r32/esp @@ -2321,7 +2321,7 @@ if ('onhashchange' in window) { <span id="L2309" class="LineNr">2309 </span> 5d/pop-to-ebp <span id="L2310" class="LineNr">2310 </span> c3/return <span id="L2311" class="LineNr">2311 </span> -<span id="L2312" class="LineNr">2312 </span><span class="subxFunction">parse-mu-named-block</span>: <span class="subxComment"># name : (address slice), first-line : (address stream byte), in : (address buffered-file), vars : (address stack (handle var)) -> result/eax : (handle stmt)</span> +<span id="L2312" class="LineNr">2312 </span><span class="subxFunction">parse-mu-named-block</span>: <span class="subxComment"># name : (addr slice), first-line : (addr stream byte), in : (addr buffered-file), vars : (addr stack (handle var)) -> result/eax : (handle stmt)</span> <span id="L2313" class="LineNr">2313 </span> <span class="subxComment"># pseudocode:</span> <span id="L2314" class="LineNr">2314 </span> <span class="subxComment"># var line : (ref stream byte 512)</span> <span id="L2315" class="LineNr">2315 </span> <span class="subxComment"># var word-slice : (ref slice)</span> @@ -2365,7 +2365,7 @@ if ('onhashchange' in window) { <span id="L2353" class="LineNr">2353 </span> 5d/pop-to-ebp <span id="L2354" class="LineNr">2354 </span> c3/return <span id="L2355" class="LineNr">2355 </span> -<span id="L2356" class="LineNr">2356 </span><span class="subxFunction">parse-mu-var-def</span>: <span class="subxComment"># line : (address stream byte), vars : (address stack (handle var)) -> result/eax : (handle stmt)</span> +<span id="L2356" class="LineNr">2356 </span><span class="subxFunction">parse-mu-var-def</span>: <span class="subxComment"># line : (addr stream byte), vars : (addr stack (handle var)) -> result/eax : (handle stmt)</span> <span id="L2357" class="LineNr">2357 </span> <span class="subxComment"># pseudocode:</span> <span id="L2358" class="LineNr">2358 </span> <span class="subxComment">#</span> <span id="L2359" class="LineNr">2359 </span> <span class="subxS1Comment"># . prologue</span> @@ -2380,7 +2380,7 @@ if ('onhashchange' in window) { <span id="L2368" class="LineNr">2368 </span> 5d/pop-to-ebp <span id="L2369" class="LineNr">2369 </span> c3/return <span id="L2370" class="LineNr">2370 </span> -<span id="L2371" class="LineNr">2371 </span><span class="subxFunction">parse-mu-stmt</span>: <span class="subxComment"># line : (address stream byte), vars : (address stack (handle var)), fn : (handle function) -> result/eax : (handle stmt)</span> +<span id="L2371" class="LineNr">2371 </span><span class="subxFunction">parse-mu-stmt</span>: <span class="subxComment"># line : (addr stream byte), vars : (addr stack (handle var)), fn : (handle function) -> result/eax : (handle stmt)</span> <span id="L2372" class="LineNr">2372 </span> <span class="subxComment"># pseudocode:</span> <span id="L2373" class="LineNr">2373 </span> <span class="subxComment"># var name : (ref slice)</span> <span id="L2374" class="LineNr">2374 </span> <span class="subxComment"># result = allocate(Heap, Stmt-size)</span> @@ -2500,7 +2500,7 @@ if ('onhashchange' in window) { <span id="L2488" class="LineNr">2488 </span> cd/syscall 0x80/imm8 <span id="L2489" class="LineNr">2489 </span> <span class="subxComment"># never gets here</span> <span id="L2490" class="LineNr">2490 </span> -<span id="L2491" class="LineNr">2491 </span><span class="subxFunction">stmt-has-outputs?</span>: <span class="subxComment"># line : (address stream byte) -> result/eax : boolean</span> +<span id="L2491" class="LineNr">2491 </span><span class="subxFunction">stmt-has-outputs?</span>: <span class="subxComment"># line : (addr stream byte) -> result/eax : boolean</span> <span id="L2492" class="LineNr">2492 </span> <span class="subxS1Comment"># . prologue</span> <span id="L2493" class="LineNr">2493 </span> 55/push-ebp <span id="L2494" class="LineNr">2494 </span> 89/<- %ebp 4/r32/esp @@ -2548,7 +2548,7 @@ if ('onhashchange' in window) { <span id="L2536" class="LineNr">2536 </span> <span id="L2537" class="LineNr">2537 </span><span class="subxComment"># if 'name' starts with a digit, create a new literal var for it</span> <span id="L2538" class="LineNr">2538 </span><span class="subxComment"># otherwise return first 'name' from the top (back) of 'vars' and abort if not found</span> -<span id="L2539" class="LineNr">2539 </span><span class="subxFunction">lookup-var-or-literal</span>: <span class="subxComment"># name: (address slice), vars : (address stack (handle var)) -> result/eax: (handle var)</span> +<span id="L2539" class="LineNr">2539 </span><span class="subxFunction">lookup-var-or-literal</span>: <span class="subxComment"># name: (addr slice), vars : (addr stack (handle var)) -> result/eax: (handle var)</span> <span id="L2540" class="LineNr">2540 </span> <span class="subxS1Comment"># . prologue</span> <span id="L2541" class="LineNr">2541 </span> 55/push-ebp <span id="L2542" class="LineNr">2542 </span> 89/<- %ebp 4/r32/esp @@ -2596,7 +2596,7 @@ if ('onhashchange' in window) { <span id="L2584" class="LineNr">2584 </span> <span class="subxComment"># never gets here</span> <span id="L2585" class="LineNr">2585 </span> <span id="L2586" class="LineNr">2586 </span><span class="subxComment"># return first 'name' from the top (back) of 'vars' and abort if not found</span> -<span id="L2587" class="LineNr">2587 </span><span class="subxFunction">lookup-var</span>: <span class="subxComment"># name: (address slice), vars : (address stack (handle var)) -> result/eax: (handle var)</span> +<span id="L2587" class="LineNr">2587 </span><span class="subxFunction">lookup-var</span>: <span class="subxComment"># name: (addr slice), vars : (addr stack (handle var)) -> result/eax: (handle var)</span> <span id="L2588" class="LineNr">2588 </span> <span class="subxS1Comment"># . prologue</span> <span id="L2589" class="LineNr">2589 </span> 55/push-ebp <span id="L2590" class="LineNr">2590 </span> 89/<- %ebp 4/r32/esp @@ -2625,9 +2625,9 @@ if ('onhashchange' in window) { <span id="L2613" class="LineNr">2613 </span> <span class="subxComment"># never gets here</span> <span id="L2614" class="LineNr">2614 </span> <span id="L2615" class="LineNr">2615 </span><span class="subxComment"># return first 'name' from the top (back) of 'vars', and 0/null if not found</span> -<span id="L2616" class="LineNr">2616 </span><span class="subxFunction">lookup-var-helper</span>: <span class="subxComment"># name: (address array byte), vars : (address stack (handle var)) -> result/eax: (handle var)</span> +<span id="L2616" class="LineNr">2616 </span><span class="subxFunction">lookup-var-helper</span>: <span class="subxComment"># name: (addr array byte), vars : (addr stack (handle var)) -> result/eax: (handle var)</span> <span id="L2617" class="LineNr">2617 </span> <span class="subxComment"># pseudocode:</span> -<span id="L2618" class="LineNr">2618 </span> <span class="subxComment"># var curr : (address handle var) = &vars->data[vars->top - 4]</span> +<span id="L2618" class="LineNr">2618 </span> <span class="subxComment"># var curr : (addr handle var) = &vars->data[vars->top - 4]</span> <span id="L2619" class="LineNr">2619 </span> <span class="subxComment"># var min = vars->data</span> <span id="L2620" class="LineNr">2620 </span> <span class="subxComment"># while curr >= min</span> <span id="L2621" class="LineNr">2621 </span> <span class="subxComment"># var v : (handle var) = *curr</span> @@ -2649,9 +2649,9 @@ if ('onhashchange' in window) { <span id="L2637" class="LineNr">2637 </span> <span class="subxComment"># if (vars->top > vars->length) abort</span> <span id="L2638" class="LineNr">2638 </span> 3b/compare 0/r32/eax *(esi+4) <span id="L2639" class="LineNr">2639 </span> 0f 8f/jump-if-greater $lookup-var-helper:error1/disp32 -<span id="L2640" class="LineNr">2640 </span> <span class="subxComment"># var min/edx : (address handle var) = vars->data</span> +<span id="L2640" class="LineNr">2640 </span> <span class="subxComment"># var min/edx : (addr handle var) = vars->data</span> <span id="L2641" class="LineNr">2641 </span> 8d/copy-address *(esi+8) 2/r32/edx -<span id="L2642" class="LineNr">2642 </span> <span class="subxComment"># var curr/ebx : (address handle var) = &vars->data[vars->top - 4]</span> +<span id="L2642" class="LineNr">2642 </span> <span class="subxComment"># var curr/ebx : (addr handle var) = &vars->data[vars->top - 4]</span> <span id="L2643" class="LineNr">2643 </span> 81 5/subop/subtract %ebx 4/imm32 <span id="L2644" class="LineNr">2644 </span> 8d/copy-address *(esi+ebx+8) 3/r32/ebx <span id="L2645" class="LineNr">2645 </span> { @@ -2692,7 +2692,7 @@ if ('onhashchange' in window) { <span id="L2680" class="LineNr">2680 </span> <span class="subxComment"># never gets here</span> <span id="L2681" class="LineNr">2681 </span> <span id="L2682" class="LineNr">2682 </span><span class="subxComment"># return first 'name' from the top (back) of 'vars' and create a new var for a fn output if not found</span> -<span id="L2683" class="LineNr">2683 </span><span class="subxFunction">lookup-or-define-var</span>: <span class="subxComment"># name: (address slice), vars : (address stack (handle var)), fn : (handle function) -> result/eax: (handle var)</span> +<span id="L2683" class="LineNr">2683 </span><span class="subxFunction">lookup-or-define-var</span>: <span class="subxComment"># name: (addr slice), vars : (addr stack (handle var)), fn : (handle function) -> result/eax: (handle var)</span> <span id="L2684" class="LineNr">2684 </span> <span class="subxS1Comment"># . prologue</span> <span id="L2685" class="LineNr">2685 </span> 55/push-ebp <span id="L2686" class="LineNr">2686 </span> 89/<- %ebp 4/r32/esp @@ -2765,7 +2765,7 @@ if ('onhashchange' in window) { <span id="L2753" class="LineNr">2753 </span> <span class="subxComment"># setup</span> <span id="L2754" class="LineNr">2754 </span> (<a href='../055stream.subx.html#L17'>clear-stream</a> <a href='../061read-byte.subx.html#L287'>_test-input-stream</a>) <span id="L2755" class="LineNr">2755 </span> (<a href='../057write.subx.html#L24'>write</a> <a href='../061read-byte.subx.html#L287'>_test-input-stream</a> <span class="Constant">"increment n\n"</span>) -<span id="L2756" class="LineNr">2756 </span> <span class="subxComment"># var vars/ecx : (ref stack (address var) 4)</span> +<span id="L2756" class="LineNr">2756 </span> <span class="subxComment"># var vars/ecx : (ref stack (addr var) 4)</span> <span id="L2757" class="LineNr">2757 </span> 81 5/subop/subtract %esp 0x10/imm32 <span id="L2758" class="LineNr">2758 </span> 68/push 0x10/imm32/length <span id="L2759" class="LineNr">2759 </span> 68/push 0/imm32/top @@ -2793,7 +2793,7 @@ if ('onhashchange' in window) { <span id="L2781" class="LineNr">2781 </span> 5d/pop-to-ebp <span id="L2782" class="LineNr">2782 </span> c3/return <span id="L2783" class="LineNr">2783 </span> -<span id="L2784" class="LineNr">2784 </span><span class="subxFunction">new-function</span>: <span class="subxComment"># ad: (address allocation-descriptor), name: (address array byte), subx-name: (address array byte), inouts: (handle list var), outputs: (handle list var), body: (handle block), next: (handle function) -> result/eax: (handle function)</span> +<span id="L2784" class="LineNr">2784 </span><span class="subxFunction">new-function</span>: <span class="subxComment"># ad: (addr allocation-descriptor), name: (addr array byte), subx-name: (addr array byte), inouts: (handle list var), outputs: (handle list var), body: (handle block), next: (handle function) -> result/eax: (handle function)</span> <span id="L2785" class="LineNr">2785 </span> <span class="subxS1Comment"># . prologue</span> <span id="L2786" class="LineNr">2786 </span> 55/push-ebp <span id="L2787" class="LineNr">2787 </span> 89/<- %ebp 4/r32/esp @@ -2821,7 +2821,7 @@ if ('onhashchange' in window) { <span id="L2809" class="LineNr">2809 </span> 5d/pop-to-ebp <span id="L2810" class="LineNr">2810 </span> c3/return <span id="L2811" class="LineNr">2811 </span> -<span id="L2812" class="LineNr">2812 </span><span class="subxFunction">new-var</span>: <span class="subxComment"># ad: (address allocation-descriptor), name: (address array byte), type: int, block: int, stack-offset: int, register: (address array byte) -> result/eax: (handle var)</span> +<span id="L2812" class="LineNr">2812 </span><span class="subxFunction">new-var</span>: <span class="subxComment"># ad: (addr allocation-descriptor), name: (addr array byte), type: int, block: int, stack-offset: int, register: (addr array byte) -> result/eax: (handle var)</span> <span id="L2813" class="LineNr">2813 </span> <span class="subxS1Comment"># . prologue</span> <span id="L2814" class="LineNr">2814 </span> 55/push-ebp <span id="L2815" class="LineNr">2815 </span> 89/<- %ebp 4/r32/esp @@ -2847,7 +2847,7 @@ if ('onhashchange' in window) { <span id="L2835" class="LineNr">2835 </span> 5d/pop-to-ebp <span id="L2836" class="LineNr">2836 </span> c3/return <span id="L2837" class="LineNr">2837 </span> -<span id="L2838" class="LineNr">2838 </span><span class="subxFunction">new-literal-integer</span>: <span class="subxComment"># ad: (address allocation-descriptor), name: (address slice) -> result/eax: (handle var)</span> +<span id="L2838" class="LineNr">2838 </span><span class="subxFunction">new-literal-integer</span>: <span class="subxComment"># ad: (addr allocation-descriptor), name: (addr slice) -> result/eax: (handle var)</span> <span id="L2839" class="LineNr">2839 </span> <span class="subxS1Comment"># . prologue</span> <span id="L2840" class="LineNr">2840 </span> 55/push-ebp <span id="L2841" class="LineNr">2841 </span> 89/<- %ebp 4/r32/esp @@ -2857,7 +2857,7 @@ if ('onhashchange' in window) { <span id="L2845" class="LineNr">2845 </span> (<a href='../067parse-hex.subx.html#L9'>is-hex-int?</a> *(ebp+0xc)) <span class="subxComment"># => eax</span> <span id="L2846" class="LineNr">2846 </span> 3d/compare-eax-and 0/imm32 <span id="L2847" class="LineNr">2847 </span> 0f 84/jump-if-equal $new-literal-integer:abort/disp32 -<span id="L2848" class="LineNr">2848 </span> <span class="subxComment"># var s/ecx : (address array byte)</span> +<span id="L2848" class="LineNr">2848 </span> <span class="subxComment"># var s/ecx : (addr array byte)</span> <span id="L2849" class="LineNr">2849 </span> (<a href='../072slice.subx.html#L1015'>slice-to-string</a> <span class="SpecialChar"><a href='../069allocate.subx.html#L22'>Heap</a></span> *(ebp+0xc)) <span class="subxComment"># => eax</span> <span id="L2850" class="LineNr">2850 </span> 89/<- %ecx 0/r32/eax <span id="L2851" class="LineNr">2851 </span> <span class="subxComment">#</span> @@ -2886,7 +2886,7 @@ if ('onhashchange' in window) { <span id="L2874" class="LineNr">2874 </span> cd/syscall 0x80/imm8 <span id="L2875" class="LineNr">2875 </span> <span class="subxComment"># never gets here</span> <span id="L2876" class="LineNr">2876 </span> -<span id="L2877" class="LineNr">2877 </span><span class="subxFunction">new-block</span>: <span class="subxComment"># ad: (address allocation-descriptor), data: (handle list statement) -> result/eax: (handle statement)</span> +<span id="L2877" class="LineNr">2877 </span><span class="subxFunction">new-block</span>: <span class="subxComment"># ad: (addr allocation-descriptor), data: (handle list statement) -> result/eax: (handle statement)</span> <span id="L2878" class="LineNr">2878 </span> <span class="subxS1Comment"># . prologue</span> <span id="L2879" class="LineNr">2879 </span> 55/push-ebp <span id="L2880" class="LineNr">2880 </span> 89/<- %ebp 4/r32/esp @@ -2906,7 +2906,7 @@ if ('onhashchange' in window) { <span id="L2894" class="LineNr">2894 </span> 5d/pop-to-ebp <span id="L2895" class="LineNr">2895 </span> c3/return <span id="L2896" class="LineNr">2896 </span> -<span id="L2897" class="LineNr">2897 </span><span class="subxFunction">new-stmt</span>: <span class="subxComment"># ad: (address allocation-descriptor), operation: (address array byte), inouts: (handle list var), outputs: (handle list var) -> result/eax: (handle statement)</span> +<span id="L2897" class="LineNr">2897 </span><span class="subxFunction">new-stmt</span>: <span class="subxComment"># ad: (addr allocation-descriptor), operation: (addr array byte), inouts: (handle list var), outputs: (handle list var) -> result/eax: (handle statement)</span> <span id="L2898" class="LineNr">2898 </span> <span class="subxS1Comment"># . prologue</span> <span id="L2899" class="LineNr">2899 </span> 55/push-ebp <span id="L2900" class="LineNr">2900 </span> 89/<- %ebp 4/r32/esp @@ -2930,7 +2930,7 @@ if ('onhashchange' in window) { <span id="L2918" class="LineNr">2918 </span> 5d/pop-to-ebp <span id="L2919" class="LineNr">2919 </span> c3/return <span id="L2920" class="LineNr">2920 </span> -<span id="L2921" class="LineNr">2921 </span><span class="subxFunction">new-vardef</span>: <span class="subxComment"># ad: (address allocation-descriptor), name: (address array byte), type: int -> result/eax: (handle statement)</span> +<span id="L2921" class="LineNr">2921 </span><span class="subxFunction">new-vardef</span>: <span class="subxComment"># ad: (addr allocation-descriptor), name: (addr array byte), type: int -> result/eax: (handle statement)</span> <span id="L2922" class="LineNr">2922 </span> <span class="subxS1Comment"># . prologue</span> <span id="L2923" class="LineNr">2923 </span> 55/push-ebp <span id="L2924" class="LineNr">2924 </span> 89/<- %ebp 4/r32/esp @@ -2952,7 +2952,7 @@ if ('onhashchange' in window) { <span id="L2940" class="LineNr">2940 </span> 5d/pop-to-ebp <span id="L2941" class="LineNr">2941 </span> c3/return <span id="L2942" class="LineNr">2942 </span> -<span id="L2943" class="LineNr">2943 </span><span class="subxFunction">new-regvardef</span>: <span class="subxComment"># ad: (address allocation-descriptor), name: (address array byte), type: int, register: (address array byte) -> result/eax: (handle statement)</span> +<span id="L2943" class="LineNr">2943 </span><span class="subxFunction">new-regvardef</span>: <span class="subxComment"># ad: (addr allocation-descriptor), name: (addr array byte), type: int, register: (addr array byte) -> result/eax: (handle statement)</span> <span id="L2944" class="LineNr">2944 </span> <span class="subxS1Comment"># . prologue</span> <span id="L2945" class="LineNr">2945 </span> 55/push-ebp <span id="L2946" class="LineNr">2946 </span> 89/<- %ebp 4/r32/esp @@ -2976,7 +2976,7 @@ if ('onhashchange' in window) { <span id="L2964" class="LineNr">2964 </span> 5d/pop-to-ebp <span id="L2965" class="LineNr">2965 </span> c3/return <span id="L2966" class="LineNr">2966 </span> -<span id="L2967" class="LineNr">2967 </span><span class="subxFunction">new-named-block</span>: <span class="subxComment"># ad: (address allocation-descriptor), name: (address array byte), data: (handle list statement) -> result/eax: (handle statement)</span> +<span id="L2967" class="LineNr">2967 </span><span class="subxFunction">new-named-block</span>: <span class="subxComment"># ad: (addr allocation-descriptor), name: (addr array byte), data: (handle list statement) -> result/eax: (handle statement)</span> <span id="L2968" class="LineNr">2968 </span> <span class="subxS1Comment"># . prologue</span> <span id="L2969" class="LineNr">2969 </span> 55/push-ebp <span id="L2970" class="LineNr">2970 </span> 89/<- %ebp 4/r32/esp @@ -2998,7 +2998,7 @@ if ('onhashchange' in window) { <span id="L2986" class="LineNr">2986 </span> 5d/pop-to-ebp <span id="L2987" class="LineNr">2987 </span> c3/return <span id="L2988" class="LineNr">2988 </span> -<span id="L2989" class="LineNr">2989 </span><span class="subxFunction">new-list</span>: <span class="subxComment"># ad: (address allocation-descriptor), value: _type, next: (handle list _type) -> result/eax : (handle list _type)</span> +<span id="L2989" class="LineNr">2989 </span><span class="subxFunction">new-list</span>: <span class="subxComment"># ad: (addr allocation-descriptor), value: _type, next: (handle list _type) -> result/eax : (handle list _type)</span> <span id="L2990" class="LineNr">2990 </span> <span class="subxS1Comment"># . prologue</span> <span id="L2991" class="LineNr">2991 </span> 55/push-ebp <span id="L2992" class="LineNr">2992 </span> 89/<- %ebp 4/r32/esp @@ -3018,7 +3018,7 @@ if ('onhashchange' in window) { <span id="L3006" class="LineNr">3006 </span> 5d/pop-to-ebp <span id="L3007" class="LineNr">3007 </span> c3/return <span id="L3008" class="LineNr">3008 </span> -<span id="L3009" class="LineNr">3009 </span><span class="subxFunction">append-list</span>: <span class="subxComment"># ad: (address allocation-descriptor), value: _type, list: (handle list _type) -> result/eax : (handle list _type)</span> +<span id="L3009" class="LineNr">3009 </span><span class="subxFunction">append-list</span>: <span class="subxComment"># ad: (addr allocation-descriptor), value: _type, list: (handle list _type) -> result/eax : (handle list _type)</span> <span id="L3010" class="LineNr">3010 </span> <span class="subxS1Comment"># . prologue</span> <span id="L3011" class="LineNr">3011 </span> 55/push-ebp <span id="L3012" class="LineNr">3012 </span> 89/<- %ebp 4/r32/esp @@ -3054,7 +3054,7 @@ if ('onhashchange' in window) { <span id="L3042" class="LineNr">3042 </span> 5d/pop-to-ebp <span id="L3043" class="LineNr">3043 </span> c3/return <span id="L3044" class="LineNr">3044 </span> -<span id="L3045" class="LineNr">3045 </span><span class="subxFunction">append-to-block</span>: <span class="subxComment"># ad: (address allocation-descriptor), block: (handle block), x: (handle stmt)</span> +<span id="L3045" class="LineNr">3045 </span><span class="subxFunction">append-to-block</span>: <span class="subxComment"># ad: (addr allocation-descriptor), block: (handle block), x: (handle stmt)</span> <span id="L3046" class="LineNr">3046 </span> <span class="subxS1Comment"># . prologue</span> <span id="L3047" class="LineNr">3047 </span> 55/push-ebp <span id="L3048" class="LineNr">3048 </span> 89/<- %ebp 4/r32/esp @@ -3087,7 +3087,7 @@ if ('onhashchange' in window) { <span id="L3075" class="LineNr">3075 </span> 5d/pop-to-ebp <span id="L3076" class="LineNr">3076 </span> c3/return <span id="L3077" class="LineNr">3077 </span> -<span id="L3078" class="LineNr">3078 </span><span class="subxFunction">size-of</span>: <span class="subxComment"># n : (address var)</span> +<span id="L3078" class="LineNr">3078 </span><span class="subxFunction">size-of</span>: <span class="subxComment"># n : (addr var)</span> <span id="L3079" class="LineNr">3079 </span> <span class="subxS1Comment"># . prologue</span> <span id="L3080" class="LineNr">3080 </span> 55/push-ebp <span id="L3081" class="LineNr">3081 </span> 89/<- %ebp 4/r32/esp @@ -3103,7 +3103,7 @@ if ('onhashchange' in window) { <span id="L3091" class="LineNr">3091 </span><span class="subxComment"># Code-generation</span> <span id="L3092" class="LineNr">3092 </span><span class="subxComment">#######################################################</span> <span id="L3093" class="LineNr">3093 </span> -<span id="L3094" class="LineNr">3094 </span><span class="subxFunction">emit-subx</span>: <span class="subxComment"># out : (address buffered-file)</span> +<span id="L3094" class="LineNr">3094 </span><span class="subxFunction">emit-subx</span>: <span class="subxComment"># out : (addr buffered-file)</span> <span id="L3095" class="LineNr">3095 </span> <span class="subxS1Comment"># . prologue</span> <span id="L3096" class="LineNr">3096 </span> 55/push-ebp <span id="L3097" class="LineNr">3097 </span> 89/<- %ebp 4/r32/esp @@ -3134,7 +3134,7 @@ if ('onhashchange' in window) { <span id="L3122" class="LineNr">3122 </span> 5d/pop-to-ebp <span id="L3123" class="LineNr">3123 </span> c3/return <span id="L3124" class="LineNr">3124 </span> -<span id="L3125" class="LineNr">3125 </span><span class="subxFunction">emit-subx-function</span>: <span class="subxComment"># out : (address buffered-file), f : (handle function)</span> +<span id="L3125" class="LineNr">3125 </span><span class="subxFunction">emit-subx-function</span>: <span class="subxComment"># out : (addr buffered-file), f : (handle function)</span> <span id="L3126" class="LineNr">3126 </span> <span class="subxS1Comment"># . prologue</span> <span id="L3127" class="LineNr">3127 </span> 55/push-ebp <span id="L3128" class="LineNr">3128 </span> 89/<- %ebp 4/r32/esp @@ -3162,7 +3162,7 @@ if ('onhashchange' in window) { <span id="L3150" class="LineNr">3150 </span> 5d/pop-to-ebp <span id="L3151" class="LineNr">3151 </span> c3/return <span id="L3152" class="LineNr">3152 </span> -<span id="L3153" class="LineNr">3153 </span><span class="subxFunction">emit-subx-block</span>: <span class="subxComment"># out : (address buffered-file), block : (handle block)</span> +<span id="L3153" class="LineNr">3153 </span><span class="subxFunction">emit-subx-block</span>: <span class="subxComment"># out : (addr buffered-file), block : (handle block)</span> <span id="L3154" class="LineNr">3154 </span> <span class="subxS1Comment"># . prologue</span> <span id="L3155" class="LineNr">3155 </span> 55/push-ebp <span id="L3156" class="LineNr">3156 </span> 89/<- %ebp 4/r32/esp @@ -3192,7 +3192,7 @@ if ('onhashchange' in window) { <span id="L3180" class="LineNr">3180 </span> 5d/pop-to-ebp <span id="L3181" class="LineNr">3181 </span> c3/return <span id="L3182" class="LineNr">3182 </span> -<span id="L3183" class="LineNr">3183 </span><span class="subxFunction">emit-subx-statement</span>: <span class="subxComment"># out : (address buffered-file), stmt : (handle statement), primitives : (handle primitive), functions : (handle function)</span> +<span id="L3183" class="LineNr">3183 </span><span class="subxFunction">emit-subx-statement</span>: <span class="subxComment"># out : (addr buffered-file), stmt : (handle statement), primitives : (handle primitive), functions : (handle function)</span> <span id="L3184" class="LineNr">3184 </span> <span class="subxS1Comment"># . prologue</span> <span id="L3185" class="LineNr">3185 </span> 55/push-ebp <span id="L3186" class="LineNr">3186 </span> 89/<- %ebp 4/r32/esp @@ -3987,7 +3987,7 @@ if ('onhashchange' in window) { <span id="L3975" class="LineNr">3975 </span> 0/imm32/no-register <span id="L3976" class="LineNr">3976 </span> <span id="L3977" class="LineNr">3977 </span>== code -<span id="L3978" class="LineNr">3978 </span><span class="subxFunction">emit-subx-primitive</span>: <span class="subxComment"># out : (address buffered-file), stmt : (handle statement), primitive : (handle function)</span> +<span id="L3978" class="LineNr">3978 </span><span class="subxFunction">emit-subx-primitive</span>: <span class="subxComment"># out : (addr buffered-file), stmt : (handle statement), primitive : (handle function)</span> <span id="L3979" class="LineNr">3979 </span> <span class="subxS1Comment"># . prologue</span> <span id="L3980" class="LineNr">3980 </span> 55/push-ebp <span id="L3981" class="LineNr">3981 </span> 89/<- %ebp 4/r32/esp @@ -4013,7 +4013,7 @@ if ('onhashchange' in window) { <span id="L4001" class="LineNr">4001 </span> 5d/pop-to-ebp <span id="L4002" class="LineNr">4002 </span> c3/return <span id="L4003" class="LineNr">4003 </span> -<span id="L4004" class="LineNr">4004 </span><span class="subxFunction">emit-subx-rm32</span>: <span class="subxComment"># out : (address buffered-file), l : arg-location, stmt : (handle statement)</span> +<span id="L4004" class="LineNr">4004 </span><span class="subxFunction">emit-subx-rm32</span>: <span class="subxComment"># out : (addr buffered-file), l : arg-location, stmt : (handle statement)</span> <span id="L4005" class="LineNr">4005 </span> <span class="subxS1Comment"># . prologue</span> <span id="L4006" class="LineNr">4006 </span> 55/push-ebp <span id="L4007" class="LineNr">4007 </span> 89/<- %ebp 4/r32/esp @@ -4093,7 +4093,7 @@ if ('onhashchange' in window) { <span id="L4081" class="LineNr">4081 </span> cd/syscall 0x80/imm8 <span id="L4082" class="LineNr">4082 </span> <span class="subxComment"># never gets here</span> <span id="L4083" class="LineNr">4083 </span> -<span id="L4084" class="LineNr">4084 </span><span class="subxFunction">emit-subx-r32</span>: <span class="subxComment"># out : (address buffered-file), l : arg-location, stmt : (handle statement)</span> +<span id="L4084" class="LineNr">4084 </span><span class="subxFunction">emit-subx-r32</span>: <span class="subxComment"># out : (addr buffered-file), l : arg-location, stmt : (handle statement)</span> <span id="L4085" class="LineNr">4085 </span> <span class="subxS1Comment"># . prologue</span> <span id="L4086" class="LineNr">4086 </span> 55/push-ebp <span id="L4087" class="LineNr">4087 </span> 89/<- %ebp 4/r32/esp @@ -4105,7 +4105,7 @@ if ('onhashchange' in window) { <span id="L4093" class="LineNr">4093 </span> 0f 84/jump-if-equal $emit-subx-r32:end/disp32 <span id="L4094" class="LineNr">4094 </span> <span class="subxComment">#</span> <span id="L4095" class="LineNr">4095 </span> (<a href='mu.subx.html#L4024'>get-stmt-operand-from-arg-location</a> *(ebp+0x10) *(ebp+0xc)) <span class="subxComment"># stmt, l => var/eax</span> -<span id="L4096" class="LineNr">4096 </span> (<a href='../081table.subx.html#L1382'>maybe-get</a> <span class="SpecialChar"><a href='../085register-names.subx.html#L2'>Registers</a></span> *(eax+0x10) 8) <span class="subxComment"># Var-register => eax : (address register-index)</span> +<span id="L4096" class="LineNr">4096 </span> (<a href='../081table.subx.html#L1382'>maybe-get</a> <span class="SpecialChar"><a href='../085register-names.subx.html#L2'>Registers</a></span> *(eax+0x10) 8) <span class="subxComment"># Var-register => eax : (addr register-index)</span> <span id="L4097" class="LineNr">4097 </span> (<a href='../065write-buffered.subx.html#L8'>write-buffered</a> *(ebp+8) <span class="SpecialChar"><a href='../051test.subx.html#L94'>Space</a></span>) <span id="L4098" class="LineNr">4098 </span> (<a href='../066print-int.subx.html#L266'>print-int32-buffered</a> *(ebp+8) *eax) <span id="L4099" class="LineNr">4099 </span> (<a href='../065write-buffered.subx.html#L8'>write-buffered</a> *(ebp+8) <span class="Constant">"/r32"</span>) @@ -4118,7 +4118,7 @@ if ('onhashchange' in window) { <span id="L4106" class="LineNr">4106 </span> 5d/pop-to-ebp <span id="L4107" class="LineNr">4107 </span> c3/return <span id="L4108" class="LineNr">4108 </span> -<span id="L4109" class="LineNr">4109 </span><span class="subxFunction">emit-subx-imm32</span>: <span class="subxComment"># out : (address buffered-file), l : arg-location, stmt : (handle statement)</span> +<span id="L4109" class="LineNr">4109 </span><span class="subxFunction">emit-subx-imm32</span>: <span class="subxComment"># out : (addr buffered-file), l : arg-location, stmt : (handle statement)</span> <span id="L4110" class="LineNr">4110 </span> <span class="subxS1Comment"># . prologue</span> <span id="L4111" class="LineNr">4111 </span> 55/push-ebp <span id="L4112" class="LineNr">4112 </span> 89/<- %ebp 4/r32/esp @@ -4142,7 +4142,7 @@ if ('onhashchange' in window) { <span id="L4130" class="LineNr">4130 </span> 5d/pop-to-ebp <span id="L4131" class="LineNr">4131 </span> c3/return <span id="L4132" class="LineNr">4132 </span> -<span id="L4133" class="LineNr">4133 </span><span class="subxFunction">emit-subx-call</span>: <span class="subxComment"># out : (address buffered-file), stmt : (handle statement), callee : (handle function)</span> +<span id="L4133" class="LineNr">4133 </span><span class="subxFunction">emit-subx-call</span>: <span class="subxComment"># out : (addr buffered-file), stmt : (handle statement), callee : (handle function)</span> <span id="L4134" class="LineNr">4134 </span> <span class="subxS1Comment"># . prologue</span> <span id="L4135" class="LineNr">4135 </span> 55/push-ebp <span id="L4136" class="LineNr">4136 </span> 89/<- %ebp 4/r32/esp @@ -4179,7 +4179,7 @@ if ('onhashchange' in window) { <span id="L4167" class="LineNr">4167 </span> 5d/pop-to-ebp <span id="L4168" class="LineNr">4168 </span> c3/return <span id="L4169" class="LineNr">4169 </span> -<span id="L4170" class="LineNr">4170 </span><span class="subxFunction">emit-subx-call-operand</span>: <span class="subxComment"># out : (address buffered-file), operand : (handle variable)</span> +<span id="L4170" class="LineNr">4170 </span><span class="subxFunction">emit-subx-call-operand</span>: <span class="subxComment"># out : (addr buffered-file), operand : (handle variable)</span> <span id="L4171" class="LineNr">4171 </span> <span class="subxS1Comment"># . prologue</span> <span id="L4172" class="LineNr">4172 </span> 55/push-ebp <span id="L4173" class="LineNr">4173 </span> 89/<- %ebp 4/r32/esp @@ -4205,7 +4205,7 @@ if ('onhashchange' in window) { <span id="L4193" class="LineNr">4193 </span> 5d/pop-to-ebp <span id="L4194" class="LineNr">4194 </span> c3/return <span id="L4195" class="LineNr">4195 </span> -<span id="L4196" class="LineNr">4196 </span><span class="subxFunction">emit-subx-var-as-rm32</span>: <span class="subxComment"># out : (address buffered-file), operand : (handle variable)</span> +<span id="L4196" class="LineNr">4196 </span><span class="subxFunction">emit-subx-var-as-rm32</span>: <span class="subxComment"># out : (addr buffered-file), operand : (handle variable)</span> <span id="L4197" class="LineNr">4197 </span> <span class="subxS1Comment"># . prologue</span> <span id="L4198" class="LineNr">4198 </span> 55/push-ebp <span id="L4199" class="LineNr">4199 </span> 89/<- %ebp 4/r32/esp @@ -4240,7 +4240,7 @@ if ('onhashchange' in window) { <span id="L4228" class="LineNr">4228 </span> 5d/pop-to-ebp <span id="L4229" class="LineNr">4229 </span> c3/return <span id="L4230" class="LineNr">4230 </span> -<span id="L4231" class="LineNr">4231 </span><span class="subxFunction">find-matching-function</span>: <span class="subxComment"># functions : (address function), stmt : (handle statement) -> result/eax : (handle function)</span> +<span id="L4231" class="LineNr">4231 </span><span class="subxFunction">find-matching-function</span>: <span class="subxComment"># functions : (addr function), stmt : (handle statement) -> result/eax : (handle function)</span> <span id="L4232" class="LineNr">4232 </span> <span class="subxS1Comment"># . prologue</span> <span id="L4233" class="LineNr">4233 </span> 55/push-ebp <span id="L4234" class="LineNr">4234 </span> 89/<- %ebp 4/r32/esp @@ -5344,7 +5344,7 @@ if ('onhashchange' in window) { <span id="L5402" class="LineNr">5402 </span> 5d/pop-to-ebp <span id="L5403" class="LineNr">5403 </span> c3/return <span id="L5404" class="LineNr">5404 </span> -<span id="L5405" class="LineNr">5405 </span><span class="subxFunction">emit-subx-prologue</span>: <span class="subxComment"># out : (address buffered-file)</span> +<span id="L5405" class="LineNr">5405 </span><span class="subxFunction">emit-subx-prologue</span>: <span class="subxComment"># out : (addr buffered-file)</span> <span id="L5406" class="LineNr">5406 </span> <span class="subxS1Comment"># . prologue</span> <span id="L5407" class="LineNr">5407 </span> 55/push-ebp <span id="L5408" class="LineNr">5408 </span> 89/<- %ebp 4/r32/esp @@ -5358,7 +5358,7 @@ if ('onhashchange' in window) { <span id="L5416" class="LineNr">5416 </span> 5d/pop-to-ebp <span id="L5417" class="LineNr">5417 </span> c3/return <span id="L5418" class="LineNr">5418 </span> -<span id="L5419" class="LineNr">5419 </span><span class="subxFunction">emit-subx-epilogue</span>: <span class="subxComment"># out : (address buffered-file)</span> +<span id="L5419" class="LineNr">5419 </span><span class="subxFunction">emit-subx-epilogue</span>: <span class="subxComment"># out : (addr buffered-file)</span> <span id="L5420" class="LineNr">5420 </span> <span class="subxS1Comment"># . prologue</span> <span id="L5421" class="LineNr">5421 </span> 55/push-ebp <span id="L5422" class="LineNr">5422 </span> 89/<- %ebp 4/r32/esp diff --git a/html/apps/mulisp.subx.html b/html/apps/mulisp.subx.html index 17c2e7c3..4d3ba8fb 100644 --- a/html/apps/mulisp.subx.html +++ b/html/apps/mulisp.subx.html @@ -107,7 +107,7 @@ if ('onhashchange' in window) { <span id="L49" class="LineNr"> 49 </span><span class="subxComment"># NIL NUM CHAR STRING SYMBOL PAIR ARRAY</span> <span id="L50" class="LineNr"> 50 </span><span class="subxComment"># memory type: a type specifying memory layout at the SubX level. Starts</span> <span id="L51" class="LineNr"> 51 </span><span class="subxComment"># with a '$'.</span> -<span id="L52" class="LineNr"> 52 </span><span class="subxComment"># $int $array $(address _)</span> +<span id="L52" class="LineNr"> 52 </span><span class="subxComment"># $int $array $(addr _)</span> <span id="L53" class="LineNr"> 53 </span><span class="subxComment">#</span> <span id="L54" class="LineNr"> 54 </span><span class="subxComment"># Lisp values are represented in memory by the _cell_ data structure. A cell</span> <span id="L55" class="LineNr"> 55 </span><span class="subxComment"># is 12 bytes long:</span> @@ -121,18 +121,18 @@ if ('onhashchange' in window) { <span id="L63" class="LineNr"> 63 </span><span class="subxComment"># - char: cell{ tag: 2/CHAR, data: $int 0 }</span> <span id="L64" class="LineNr"> 64 </span><span class="subxComment"># data contains the utf-8 code of the character (no compound glyphs, no</span> <span id="L65" class="LineNr"> 65 </span><span class="subxComment"># modifiers, etc., etc.)</span> -<span id="L66" class="LineNr"> 66 </span><span class="subxComment"># - string: cell{ tag: 3/STRING, data: $(address stream byte)</span> -<span id="L67" class="LineNr"> 67 </span><span class="subxComment"># data contains an (address array byte) containing the string in utf-8</span> -<span id="L68" class="LineNr"> 68 </span><span class="subxComment"># - symbol: cell{ tag: 4/SYMBOL, data: $(address array byte) 0 }</span> -<span id="L69" class="LineNr"> 69 </span><span class="subxComment"># data contains an (address array byte) containing the name of the symbol in utf-8</span> +<span id="L66" class="LineNr"> 66 </span><span class="subxComment"># - string: cell{ tag: 3/STRING, data: $(addr stream byte)</span> +<span id="L67" class="LineNr"> 67 </span><span class="subxComment"># data contains an (addr array byte) containing the string in utf-8</span> +<span id="L68" class="LineNr"> 68 </span><span class="subxComment"># - symbol: cell{ tag: 4/SYMBOL, data: $(addr array byte) 0 }</span> +<span id="L69" class="LineNr"> 69 </span><span class="subxComment"># data contains an (addr array byte) containing the name of the symbol in utf-8</span> <span id="L70" class="LineNr"> 70 </span><span class="subxComment"># alternatively, data could contain an index into the table of interned symbols</span> -<span id="L71" class="LineNr"> 71 </span><span class="subxComment"># - pair: cell{ tag: 5/PAIR, data: $(address cell) $(address cell) }</span> +<span id="L71" class="LineNr"> 71 </span><span class="subxComment"># - pair: cell{ tag: 5/PAIR, data: $(addr cell) $(addr cell) }</span> <span id="L72" class="LineNr"> 72 </span><span class="subxComment"># data contains pointers to car and cdr</span> -<span id="L73" class="LineNr"> 73 </span><span class="subxComment"># - array: cell{ tag: 6/ARRAY, data: $tag $(address stream data)</span> +<span id="L73" class="LineNr"> 73 </span><span class="subxComment"># - array: cell{ tag: 6/ARRAY, data: $tag $(addr stream data)</span> <span id="L74" class="LineNr"> 74 </span><span class="subxComment"># data contains a pointer to an array of 8-byte data fields and the common</span> <span id="L75" class="LineNr"> 75 </span><span class="subxComment"># tag for them all</span> <span id="L76" class="LineNr"> 76 </span> -<span id="L77" class="LineNr"> 77 </span><span class="subxFunction">repl</span>: <span class="subxComment"># in : (address buffered-file), out : (address buffered-file)</span> +<span id="L77" class="LineNr"> 77 </span><span class="subxFunction">repl</span>: <span class="subxComment"># in : (addr buffered-file), out : (addr buffered-file)</span> <span id="L78" class="LineNr"> 78 </span> <span class="subxS1Comment"># . prologue</span> <span id="L79" class="LineNr"> 79 </span> 55/push-ebp <span id="L80" class="LineNr"> 80 </span> 89/<- %ebp 4/r32/esp @@ -162,7 +162,7 @@ if ('onhashchange' in window) { <span id="L104" class="LineNr">104 </span><span class="subxComment"># arrays start with '['</span> <span id="L105" class="LineNr">105 </span><span class="subxComment"># symbols start with anything else but quote, backquote, unquote or splice</span> <span id="L106" class="LineNr">106 </span><span class="subxComment"># only one s-expression per line</span> -<span id="L107" class="LineNr">107 </span><span class="subxFunction">lisp-read</span>: <span class="subxComment"># in : (address buffered-file) -> eax : (handle cell)</span> +<span id="L107" class="LineNr">107 </span><span class="subxFunction">lisp-read</span>: <span class="subxComment"># in : (addr buffered-file) -> eax : (handle cell)</span> <span id="L108" class="LineNr">108 </span> <span class="subxS1Comment"># . prologue</span> <span id="L109" class="LineNr">109 </span> 55/push-ebp <span id="L110" class="LineNr">110 </span> 89/<- %ebp 4/r32/esp @@ -200,14 +200,14 @@ if ('onhashchange' in window) { <span id="L142" class="LineNr">142 </span> 5d/pop-to-ebp <span id="L143" class="LineNr">143 </span> c3/return <span id="L144" class="LineNr">144 </span> -<span id="L145" class="LineNr">145 </span><span class="subxComment"># lisp-read: in : (address buffered-file) -> (handle cell)</span> +<span id="L145" class="LineNr">145 </span><span class="subxComment"># lisp-read: in : (addr buffered-file) -> (handle cell)</span> <span id="L146" class="LineNr">146 </span><span class="subxComment"># token tmp = next-mulisp-token(in)</span> <span id="L147" class="LineNr">147 </span><span class="subxComment"># if is-int(tmp) return cell(tmp)</span> <span id="L148" class="LineNr">148 </span><span class="subxComment"># if is-string(tmp) return cell(tmp)</span> <span id="L149" class="LineNr">149 </span><span class="subxComment"># if is-pair(tmp) ...</span> <span id="L150" class="LineNr">150 </span><span class="subxComment"># if is-array(tmp) ...</span> <span id="L151" class="LineNr">151 </span> -<span id="L152" class="LineNr">152 </span><span class="subxFunction">next-mulisp-token</span>: <span class="subxComment"># in : (address buffered-file), line : (address stream byte), result : (address slice)</span> +<span id="L152" class="LineNr">152 </span><span class="subxFunction">next-mulisp-token</span>: <span class="subxComment"># in : (addr buffered-file), line : (addr stream byte), result : (addr slice)</span> <span id="L153" class="LineNr">153 </span> <span class="subxComment"># pseudocode:</span> <span id="L154" class="LineNr">154 </span> <span class="subxComment"># if (line->read >= line->write)</span> <span id="L155" class="LineNr">155 </span> <span class="subxComment"># read-line-buffered(in, line)</span> @@ -252,11 +252,11 @@ if ('onhashchange' in window) { <span id="L194" class="LineNr">194 </span> 5d/pop-to-ebp <span id="L195" class="LineNr">195 </span> c3/return <span id="L196" class="LineNr">196 </span> -<span id="L197" class="LineNr">197 </span><span class="subxFunction">new-int-cell</span>: <span class="subxComment"># in : (address slice) -> eax : (handle cell)</span> +<span id="L197" class="LineNr">197 </span><span class="subxFunction">new-int-cell</span>: <span class="subxComment"># in : (addr slice) -> eax : (handle cell)</span> <span id="L198" class="LineNr">198 </span> -<span id="L199" class="LineNr">199 </span><span class="subxFunction">new-string-cell</span>: <span class="subxComment"># in : (address slice) -> eax : (handle cell)</span> +<span id="L199" class="LineNr">199 </span><span class="subxFunction">new-string-cell</span>: <span class="subxComment"># in : (addr slice) -> eax : (handle cell)</span> <span id="L200" class="LineNr">200 </span> -<span id="L201" class="LineNr">201 </span><span class="subxFunction">lisp-eval</span>: <span class="subxComment"># in : (address cell) -> eax : (handle cell)</span> +<span id="L201" class="LineNr">201 </span><span class="subxFunction">lisp-eval</span>: <span class="subxComment"># in : (addr cell) -> eax : (handle cell)</span> <span id="L202" class="LineNr">202 </span> <span class="subxS1Comment"># . prologue</span> <span id="L203" class="LineNr">203 </span> 55/push-ebp <span id="L204" class="LineNr">204 </span> 89/<- %ebp 4/r32/esp @@ -269,7 +269,7 @@ if ('onhashchange' in window) { <span id="L211" class="LineNr">211 </span> 5d/pop-to-ebp <span id="L212" class="LineNr">212 </span> c3/return <span id="L213" class="LineNr">213 </span> -<span id="L214" class="LineNr">214 </span><span class="subxFunction">lisp-print</span>: <span class="subxComment"># out : (address buffered-file), x : (address cell)</span> +<span id="L214" class="LineNr">214 </span><span class="subxFunction">lisp-print</span>: <span class="subxComment"># out : (addr buffered-file), x : (addr cell)</span> <span id="L215" class="LineNr">215 </span> <span class="subxS1Comment"># . prologue</span> <span id="L216" class="LineNr">216 </span> 55/push-ebp <span id="L217" class="LineNr">217 </span> 89/<- %ebp 4/r32/esp diff --git a/html/apps/pack.subx.html b/html/apps/pack.subx.html index 16e28c46..aa7afa7b 100644 --- a/html/apps/pack.subx.html +++ b/html/apps/pack.subx.html @@ -159,7 +159,7 @@ if ('onhashchange' in window) { <span id="L97" class="LineNr"> 97 </span><span class="subxComment"># next-token-from-slice(start, end, delim char) -> slice</span> <span id="L98" class="LineNr"> 98 </span><span class="subxComment"># slice-equal?(slice, string)</span> <span id="L99" class="LineNr"> 99 </span> -<span id="L100" class="LineNr"> 100 </span><span class="subxFunction">subx-pack</span>: <span class="subxComment"># in : (address buffered-file), out : (address buffered-file)</span> +<span id="L100" class="LineNr"> 100 </span><span class="subxFunction">subx-pack</span>: <span class="subxComment"># in : (addr buffered-file), out : (addr buffered-file)</span> <span id="L101" class="LineNr"> 101 </span> <span class="subxComment"># pseudocode:</span> <span id="L102" class="LineNr"> 102 </span> <span class="subxComment"># var line : (ref stream byte 512)</span> <span id="L103" class="LineNr"> 103 </span> <span class="subxComment"># var in-code? = false</span> @@ -818,7 +818,7 @@ if ('onhashchange' in window) { <span id="L909" class="LineNr"> 909 </span> 5d/pop-to-ebp <span id="L910" class="LineNr"> 910 </span> c3/return <span id="L911" class="LineNr"> 911 </span> -<span id="L912" class="LineNr"> 912 </span><span class="subxFunction">convert-data</span>: <span class="subxComment"># line : (address stream byte), out : (address buffered-file)</span> +<span id="L912" class="LineNr"> 912 </span><span class="subxFunction">convert-data</span>: <span class="subxComment"># line : (addr stream byte), out : (addr buffered-file)</span> <span id="L913" class="LineNr"> 913 </span> <span class="subxComment"># pseudocode:</span> <span id="L914" class="LineNr"> 914 </span> <span class="subxComment"># var word-slice : (ref slice)</span> <span id="L915" class="LineNr"> 915 </span> <span class="subxComment"># while true</span> @@ -874,7 +874,7 @@ if ('onhashchange' in window) { <span id="L1029" class="LineNr">1029 </span> 0f 85/jump-if-not-equal $convert-data:<span class="Constant">break</span>/disp32 <span id="L1030" class="LineNr">1030 </span><span class="Constant">$convert-data:check-for-comment</span>: <span id="L1031" class="LineNr">1031 </span> <span class="subxComment"># if (slice-starts-with?(word-slice, "#"))</span> -<span id="L1032" class="LineNr">1032 </span> <span class="subxS1Comment"># . var start/edx : (address byte) = word-slice->start</span> +<span id="L1032" class="LineNr">1032 </span> <span class="subxS1Comment"># . var start/edx : (addr byte) = word-slice->start</span> <span id="L1033" class="LineNr">1033 </span> 8b/copy 0/mod/indirect 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *ecx to edx</span> <span id="L1034" class="LineNr">1034 </span> <span class="subxS1Comment"># . var c/eax : byte = *start</span> <span id="L1035" class="LineNr">1035 </span> 31/xor 3/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># clear eax</span> @@ -895,7 +895,7 @@ if ('onhashchange' in window) { <span id="L1050" class="LineNr">1050 </span> 0f 85/jump-if-not-equal $convert-data:end/disp32 <span id="L1051" class="LineNr">1051 </span><span class="Constant">$convert-data:check-for-label</span>: <span id="L1052" class="LineNr">1052 </span> <span class="subxComment"># if (slice-ends-with?(word-slice, ":"))</span> -<span id="L1053" class="LineNr">1053 </span> <span class="subxS1Comment"># . var end/edx : (address byte) = word-slice->end</span> +<span id="L1053" class="LineNr">1053 </span> <span class="subxS1Comment"># . var end/edx : (addr byte) = word-slice->end</span> <span id="L1054" class="LineNr">1054 </span> 8b/copy 1/mod/*+disp8 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ecx+4) to edx</span> <span id="L1055" class="LineNr">1055 </span> <span class="subxS1Comment"># . var c/eax : byte = *(end-1)</span> <span id="L1056" class="LineNr">1056 </span> 31/xor 3/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># clear eax</span> @@ -1579,7 +1579,7 @@ if ('onhashchange' in window) { <span id="L1809" class="LineNr">1809 </span><span class="subxComment"># unceremoniously abort on non-numeric operands except disp or imm</span> <span id="L1810" class="LineNr">1810 </span><span class="subxComment"># opcodes must be lowercase and zero padded</span> <span id="L1811" class="LineNr">1811 </span><span class="subxComment"># opcodes with misleading operand metadata may get duplicated as operands as well. don't rely on this.</span> -<span id="L1812" class="LineNr">1812 </span><span class="subxFunction">convert-instruction</span>: <span class="subxComment"># line : (address stream byte), out : (address buffered-file)</span> +<span id="L1812" class="LineNr">1812 </span><span class="subxFunction">convert-instruction</span>: <span class="subxComment"># line : (addr stream byte), out : (addr buffered-file)</span> <span id="L1813" class="LineNr">1813 </span> <span class="subxComment"># pseudocode:</span> <span id="L1814" class="LineNr">1814 </span> <span class="subxComment"># # some early exits</span> <span id="L1815" class="LineNr">1815 </span> <span class="subxComment"># var word-slice = next-word(line)</span> @@ -1633,7 +1633,7 @@ if ('onhashchange' in window) { <span id="L1863" class="LineNr">1863 </span> 75/jump-if-not-equal $convert-instruction:pass-through/disp8 <span id="L1864" class="LineNr">1864 </span><span class="Constant">$convert-instruction:check1</span>: <span id="L1865" class="LineNr">1865 </span> <span class="subxComment"># if (slice-starts-with?(word-slice, "#")) write-stream-data(out, line)</span> -<span id="L1866" class="LineNr">1866 </span> <span class="subxS1Comment"># . var start/edx : (address byte) = word-slice->start</span> +<span id="L1866" class="LineNr">1866 </span> <span class="subxS1Comment"># . var start/edx : (addr byte) = word-slice->start</span> <span id="L1867" class="LineNr">1867 </span> 8b/copy 0/mod/indirect 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *ecx to edx</span> <span id="L1868" class="LineNr">1868 </span> <span class="subxS1Comment"># . var c/eax : byte = *start</span> <span id="L1869" class="LineNr">1869 </span> 31/xor 3/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># clear eax</span> @@ -1643,7 +1643,7 @@ if ('onhashchange' in window) { <span id="L1873" class="LineNr">1873 </span> 74/jump-if-equal $convert-instruction:pass-through/disp8 <span id="L1874" class="LineNr">1874 </span><span class="Constant">$convert-instruction:check2</span>: <span id="L1875" class="LineNr">1875 </span> <span class="subxComment"># if (slice-ends-with?(word-slice, ":")) write-stream-data(out, line)</span> -<span id="L1876" class="LineNr">1876 </span> <span class="subxS1Comment"># . var end/edx : (address byte) = word-slice->end</span> +<span id="L1876" class="LineNr">1876 </span> <span class="subxS1Comment"># . var end/edx : (addr byte) = word-slice->end</span> <span id="L1877" class="LineNr">1877 </span> 8b/copy 1/mod/*+disp8 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ecx+4) to edx</span> <span id="L1878" class="LineNr">1878 </span> <span class="subxS1Comment"># . var c/eax : byte = *(end-1)</span> <span id="L1879" class="LineNr">1879 </span> 31/xor 3/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># clear eax</span> @@ -1723,7 +1723,7 @@ if ('onhashchange' in window) { <span id="L1953" class="LineNr">1953 </span> 5d/pop-to-ebp <span id="L1954" class="LineNr">1954 </span> c3/return <span id="L1955" class="LineNr">1955 </span> -<span id="L1956" class="LineNr">1956 </span><span class="subxFunction">emit-opcodes</span>: <span class="subxComment"># line : (address stream byte), out : (address buffered-file)</span> +<span id="L1956" class="LineNr">1956 </span><span class="subxFunction">emit-opcodes</span>: <span class="subxComment"># line : (addr stream byte), out : (addr buffered-file)</span> <span id="L1957" class="LineNr">1957 </span> <span class="subxComment"># opcodes occupy 1-3 bytes:</span> <span id="L1958" class="LineNr">1958 </span> <span class="subxComment"># xx</span> <span id="L1959" class="LineNr">1959 </span> <span class="subxComment"># 0f xx</span> @@ -1800,7 +1800,7 @@ if ('onhashchange' in window) { <span id="L2030" class="LineNr">2030 </span> 3d/compare-eax-and 0/imm32/false <span id="L2031" class="LineNr">2031 </span> 0f 85/jump-if-not-equal $emit-opcodes:end/disp32 <span id="L2032" class="LineNr">2032 </span> <span class="subxComment"># if (slice-starts-with?(op1, "#")) return</span> -<span id="L2033" class="LineNr">2033 </span> <span class="subxS1Comment"># . var start/ebx : (address byte) = op1->start</span> +<span id="L2033" class="LineNr">2033 </span> <span class="subxS1Comment"># . var start/ebx : (addr byte) = op1->start</span> <span id="L2034" class="LineNr">2034 </span> 8b/copy 0/mod/indirect 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 3/r32/ebx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *ecx to ebx</span> <span id="L2035" class="LineNr">2035 </span> <span class="subxS1Comment"># . var c/eax : byte = *start</span> <span id="L2036" class="LineNr">2036 </span> 31/xor 3/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># clear eax</span> @@ -1893,7 +1893,7 @@ if ('onhashchange' in window) { <span id="L2123" class="LineNr">2123 </span> 3d/compare-eax-and 0/imm32/false <span id="L2124" class="LineNr">2124 </span> 0f 85/jump-if-not-equal $emit-opcodes:end/disp32 <span id="L2125" class="LineNr">2125 </span> <span class="subxComment"># if (slice-starts-with?(op2, "#")) return</span> -<span id="L2126" class="LineNr">2126 </span> <span class="subxS1Comment"># . var start/ebx : (address byte) = op2->start</span> +<span id="L2126" class="LineNr">2126 </span> <span class="subxS1Comment"># . var start/ebx : (addr byte) = op2->start</span> <span id="L2127" class="LineNr">2127 </span> 8b/copy 0/mod/indirect 2/rm32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 3/r32/ebx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *edx to ebx</span> <span id="L2128" class="LineNr">2128 </span> <span class="subxS1Comment"># . var c/eax : byte = *start</span> <span id="L2129" class="LineNr">2129 </span> 31/xor 3/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># clear eax</span> @@ -1972,7 +1972,7 @@ if ('onhashchange' in window) { <span id="L2202" class="LineNr">2202 </span> 3d/compare-eax-and 0/imm32/false <span id="L2203" class="LineNr">2203 </span> 0f 85/jump-if-not-equal $emit-opcodes:end/disp32 <span id="L2204" class="LineNr">2204 </span> <span class="subxComment"># if (slice-starts-with?(op3, "#")) return</span> -<span id="L2205" class="LineNr">2205 </span> <span class="subxS1Comment"># . var start/ebx : (address byte) = op2->start</span> +<span id="L2205" class="LineNr">2205 </span> <span class="subxS1Comment"># . var start/ebx : (addr byte) = op2->start</span> <span id="L2206" class="LineNr">2206 </span> 8b/copy 0/mod/indirect 2/rm32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 3/r32/ebx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *edx to ebx</span> <span id="L2207" class="LineNr">2207 </span> <span class="subxS1Comment"># . var c/eax : byte = *start</span> <span id="L2208" class="LineNr">2208 </span> 31/xor 3/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># clear eax</span> @@ -2019,7 +2019,7 @@ if ('onhashchange' in window) { <span id="L2249" class="LineNr">2249 </span> 5d/pop-to-ebp <span id="L2250" class="LineNr">2250 </span> c3/return <span id="L2251" class="LineNr">2251 </span> -<span id="L2252" class="LineNr">2252 </span><span class="subxFunction">emit-modrm</span>: <span class="subxComment"># line : (address stream byte), out : (address buffered-file)</span> +<span id="L2252" class="LineNr">2252 </span><span class="subxFunction">emit-modrm</span>: <span class="subxComment"># line : (addr stream byte), out : (addr buffered-file)</span> <span id="L2253" class="LineNr">2253 </span> <span class="subxComment"># pseudocode:</span> <span id="L2254" class="LineNr">2254 </span> <span class="subxComment"># rewind-stream(line)</span> <span id="L2255" class="LineNr">2255 </span> <span class="subxComment"># var has-modrm? = false, mod = 0, rm32 = 0, r32 = 0</span> @@ -2101,7 +2101,7 @@ if ('onhashchange' in window) { <span id="L2402" class="LineNr">2402 </span> <span class="subxComment"># if (slice-starts-with?(word-slice, "#")) break</span> <span id="L2403" class="LineNr">2403 </span> <span class="subxS1Comment"># . spill edx</span> <span id="L2404" class="LineNr">2404 </span> 52/push-edx -<span id="L2405" class="LineNr">2405 </span> <span class="subxS1Comment"># . var start/edx : (address byte) = word-slice->start</span> +<span id="L2405" class="LineNr">2405 </span> <span class="subxS1Comment"># . var start/edx : (addr byte) = word-slice->start</span> <span id="L2406" class="LineNr">2406 </span> 8b/copy 0/mod/indirect 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *ecx to edx</span> <span id="L2407" class="LineNr">2407 </span> <span class="subxS1Comment"># . var c/eax : byte = *start</span> <span id="L2408" class="LineNr">2408 </span> 31/xor 3/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># clear eax</span> @@ -2265,7 +2265,7 @@ if ('onhashchange' in window) { <span id="L2566" class="LineNr">2566 </span> 5d/pop-to-ebp <span id="L2567" class="LineNr">2567 </span> c3/return <span id="L2568" class="LineNr">2568 </span> -<span id="L2569" class="LineNr">2569 </span><span class="subxFunction">emit-sib</span>: <span class="subxComment"># line : (address stream byte), out : (address buffered-file)</span> +<span id="L2569" class="LineNr">2569 </span><span class="subxFunction">emit-sib</span>: <span class="subxComment"># line : (addr stream byte), out : (addr buffered-file)</span> <span id="L2570" class="LineNr">2570 </span> <span class="subxComment"># pseudocode:</span> <span id="L2571" class="LineNr">2571 </span> <span class="subxComment"># var has-sib? = false, base = 0, index = 0, scale = 0</span> <span id="L2572" class="LineNr">2572 </span> <span class="subxComment"># var word-slice : (ref slice)</span> @@ -2346,7 +2346,7 @@ if ('onhashchange' in window) { <span id="L2711" class="LineNr">2711 </span> <span class="subxComment"># if (slice-starts-with?(word-slice, "#")) break</span> <span id="L2712" class="LineNr">2712 </span> <span class="subxS1Comment"># . spill edx</span> <span id="L2713" class="LineNr">2713 </span> 52/push-edx -<span id="L2714" class="LineNr">2714 </span> <span class="subxS1Comment"># . var start/edx : (address byte) = word-slice->start</span> +<span id="L2714" class="LineNr">2714 </span> <span class="subxS1Comment"># . var start/edx : (addr byte) = word-slice->start</span> <span id="L2715" class="LineNr">2715 </span> 8b/copy 0/mod/indirect 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *ecx to edx</span> <span id="L2716" class="LineNr">2716 </span> <span class="subxS1Comment"># . var c/eax : byte = *start</span> <span id="L2717" class="LineNr">2717 </span> 31/xor 3/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># clear eax</span> @@ -2482,7 +2482,7 @@ if ('onhashchange' in window) { <span id="L2847" class="LineNr">2847 </span> 5d/pop-to-ebp <span id="L2848" class="LineNr">2848 </span> c3/return <span id="L2849" class="LineNr">2849 </span> -<span id="L2850" class="LineNr">2850 </span><span class="subxFunction">emit-disp</span>: <span class="subxComment"># line : (address stream byte), out : (address buffered-file)</span> +<span id="L2850" class="LineNr">2850 </span><span class="subxFunction">emit-disp</span>: <span class="subxComment"># line : (addr stream byte), out : (addr buffered-file)</span> <span id="L2851" class="LineNr">2851 </span> <span class="subxComment"># pseudocode:</span> <span id="L2852" class="LineNr">2852 </span> <span class="subxComment"># rewind-stream(line)</span> <span id="L2853" class="LineNr">2853 </span> <span class="subxComment"># var word-slice : (ref slice)</span> @@ -2543,7 +2543,7 @@ if ('onhashchange' in window) { <span id="L2972" class="LineNr">2972 </span> 0f 85/jump-if-not-equal $emit-disp:<span class="Constant">break</span>/disp32 <span id="L2973" class="LineNr">2973 </span><span class="Constant">$emit-disp:check1</span>: <span id="L2974" class="LineNr">2974 </span> <span class="subxComment"># if (slice-starts-with?(word-slice, "#")) break</span> -<span id="L2975" class="LineNr">2975 </span> <span class="subxS1Comment"># . var start/edx : (address byte) = word-slice->start</span> +<span id="L2975" class="LineNr">2975 </span> <span class="subxS1Comment"># . var start/edx : (addr byte) = word-slice->start</span> <span id="L2976" class="LineNr">2976 </span> 8b/copy 0/mod/indirect 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *ecx to edx</span> <span id="L2977" class="LineNr">2977 </span> <span class="subxS1Comment"># . var c/eax : byte = *start</span> <span id="L2978" class="LineNr">2978 </span> 31/xor 3/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># clear eax</span> @@ -2637,7 +2637,7 @@ if ('onhashchange' in window) { <span id="L3066" class="LineNr">3066 </span> 5d/pop-to-ebp <span id="L3067" class="LineNr">3067 </span> c3/return <span id="L3068" class="LineNr">3068 </span> -<span id="L3069" class="LineNr">3069 </span><span class="subxFunction">emit-imm</span>: <span class="subxComment"># line : (address stream byte), out : (address buffered-file)</span> +<span id="L3069" class="LineNr">3069 </span><span class="subxFunction">emit-imm</span>: <span class="subxComment"># line : (addr stream byte), out : (addr buffered-file)</span> <span id="L3070" class="LineNr">3070 </span> <span class="subxComment"># pseudocode:</span> <span id="L3071" class="LineNr">3071 </span> <span class="subxComment"># rewind-stream(line)</span> <span id="L3072" class="LineNr">3072 </span> <span class="subxComment"># var word-slice : (ref slice)</span> @@ -2698,7 +2698,7 @@ if ('onhashchange' in window) { <span id="L3191" class="LineNr">3191 </span> 0f 85/jump-if-not-equal $emit-imm:<span class="Constant">break</span>/disp32 <span id="L3192" class="LineNr">3192 </span><span class="Constant">$emit-imm:check1</span>: <span id="L3193" class="LineNr">3193 </span> <span class="subxComment"># if (slice-starts-with?(word-slice, "#")) break</span> -<span id="L3194" class="LineNr">3194 </span> <span class="subxS1Comment"># . var start/edx : (address byte) = slice->start</span> +<span id="L3194" class="LineNr">3194 </span> <span class="subxS1Comment"># . var start/edx : (addr byte) = slice->start</span> <span id="L3195" class="LineNr">3195 </span> 8b/copy 0/mod/indirect 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *ecx to edx</span> <span id="L3196" class="LineNr">3196 </span> <span class="subxS1Comment"># . var c/eax : byte = *start</span> <span id="L3197" class="LineNr">3197 </span> 31/xor 3/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># clear eax</span> @@ -2792,7 +2792,7 @@ if ('onhashchange' in window) { <span id="L3285" class="LineNr">3285 </span> 5d/pop-to-ebp <span id="L3286" class="LineNr">3286 </span> c3/return <span id="L3287" class="LineNr">3287 </span> -<span id="L3288" class="LineNr">3288 </span><span class="subxFunction">emit-line-in-comment</span>: <span class="subxComment"># line : (address stream byte), out : (address buffered-file)</span> +<span id="L3288" class="LineNr">3288 </span><span class="subxFunction">emit-line-in-comment</span>: <span class="subxComment"># line : (addr stream byte), out : (addr buffered-file)</span> <span id="L3289" class="LineNr">3289 </span> <span class="subxS1Comment"># . prologue</span> <span id="L3290" class="LineNr">3290 </span> 55/push-ebp <span id="L3291" class="LineNr">3291 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -4694,7 +4694,7 @@ if ('onhashchange' in window) { <span id="L5837" class="LineNr">5837 </span> c3/return <span id="L5838" class="LineNr">5838 </span> <span id="L5839" class="LineNr">5839 </span><span class="subxComment"># shortcut for parse-hex-int(next-token-from-slice(word->start, word->end, '/'))</span> -<span id="L5840" class="LineNr">5840 </span><span class="subxFunction">parse-datum-of-word</span>: <span class="subxComment"># word : (address slice) -> value/eax : int</span> +<span id="L5840" class="LineNr">5840 </span><span class="subxFunction">parse-datum-of-word</span>: <span class="subxComment"># word : (addr slice) -> value/eax : int</span> <span id="L5841" class="LineNr">5841 </span> <span class="subxS1Comment"># . prologue</span> <span id="L5842" class="LineNr">5842 </span> 55/push-ebp <span id="L5843" class="LineNr">5843 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> diff --git a/html/apps/sigils.subx.html b/html/apps/sigils.subx.html index 0283638e..bdcc8605 100644 --- a/html/apps/sigils.subx.html +++ b/html/apps/sigils.subx.html @@ -166,7 +166,7 @@ if ('onhashchange' in window) { <span id="L104" class="LineNr"> 104 </span> <span id="L105" class="LineNr"> 105 </span><span class="subxComment"># error messages considered:</span> <span id="L106" class="LineNr"> 106 </span><span class="subxComment"># *x + 34 -> error: base+disp addressing must be within '()'</span> -<span id="L107" class="LineNr"> 107 </span><span class="subxFunction">subx-sigils</span>: <span class="subxComment"># in : (address buffered-file), out : (address buffered-file)</span> +<span id="L107" class="LineNr"> 107 </span><span class="subxFunction">subx-sigils</span>: <span class="subxComment"># in : (addr buffered-file), out : (addr buffered-file)</span> <span id="L108" class="LineNr"> 108 </span> <span class="subxComment"># pseudocode:</span> <span id="L109" class="LineNr"> 109 </span> <span class="subxComment"># var line : (stream byte 512)</span> <span id="L110" class="LineNr"> 110 </span> <span class="subxComment"># while true</span> @@ -1182,7 +1182,7 @@ if ('onhashchange' in window) { <span id="L1359" class="LineNr">1359 </span> 5d/pop-to-ebp <span id="L1360" class="LineNr">1360 </span> c3/return <span id="L1361" class="LineNr">1361 </span> -<span id="L1362" class="LineNr">1362 </span><span class="subxFunction">emit-direct-mode</span>: <span class="subxComment"># out : (address buffered-file), word-slice : (address slice)</span> +<span id="L1362" class="LineNr">1362 </span><span class="subxFunction">emit-direct-mode</span>: <span class="subxComment"># out : (addr buffered-file), word-slice : (addr slice)</span> <span id="L1363" class="LineNr">1363 </span> <span class="subxS1Comment"># . prologue</span> <span id="L1364" class="LineNr">1364 </span> 55/push-ebp <span id="L1365" class="LineNr">1365 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -1372,7 +1372,7 @@ if ('onhashchange' in window) { <span id="L1599" class="LineNr">1599 </span><span class="subxComment"># error messages considered:</span> <span id="L1600" class="LineNr">1600 </span><span class="subxComment"># * ... -> error: no space after '*'</span> <span id="L1601" class="LineNr">1601 </span><span class="subxComment"># *(... -> error: *(...) expression must be all on a single line</span> -<span id="L1602" class="LineNr">1602 </span><span class="subxFunction">next-word-or-expression</span>: <span class="subxComment"># line : (address stream byte), out : (address slice)</span> +<span id="L1602" class="LineNr">1602 </span><span class="subxFunction">next-word-or-expression</span>: <span class="subxComment"># line : (addr stream byte), out : (addr slice)</span> <span id="L1603" class="LineNr">1603 </span> <span class="subxComment"># pseudocode:</span> <span id="L1604" class="LineNr">1604 </span> <span class="subxComment"># skip-chars-matching(line, ' ')</span> <span id="L1605" class="LineNr">1605 </span> <span class="subxComment"># if line->read >= line->write # end of line</span> @@ -1980,7 +1980,7 @@ if ('onhashchange' in window) { <span id="L2207" class="LineNr">2207 </span><span class="subxComment"># *(reg1+reg2<<s+disp) -> 2/mod 4/rm32 reg1/base reg2/index s/scale disp/disp32</span> <span id="L2208" class="LineNr">2208 </span><span class="subxComment"># Intermediate structure: base, index, scale, disp</span> <span id="L2209" class="LineNr">2209 </span><span class="subxComment"># Default values: base: 0, index: 4 (none), scale: 0, disp: 0</span> -<span id="L2210" class="LineNr">2210 </span><span class="subxFunction">parse-effective-address</span>: <span class="subxComment"># word-slice : (address slice) -> base/eax, index/ecx, scale/edx, disp/ebx</span> +<span id="L2210" class="LineNr">2210 </span><span class="subxFunction">parse-effective-address</span>: <span class="subxComment"># word-slice : (addr slice) -> base/eax, index/ecx, scale/edx, disp/ebx</span> <span id="L2211" class="LineNr">2211 </span> <span class="subxComment"># pseudocode:</span> <span id="L2212" class="LineNr">2212 </span> <span class="subxComment"># var local-slice = {word-slice->start, word-slice->end}</span> <span id="L2213" class="LineNr">2213 </span> <span class="subxComment"># ++local-slice->start to skip '*'</span> @@ -2443,7 +2443,7 @@ if ('onhashchange' in window) { <span id="L2670" class="LineNr">2670 </span> <span id="L2671" class="LineNr">2671 </span><span class="subxComment"># assumes 'in' starts with a register name, and returns pointer to its code</span> <span id="L2672" class="LineNr">2672 </span><span class="subxComment"># side-effect: modifies 'in' to scan past the initial register name</span> -<span id="L2673" class="LineNr">2673 </span><span class="subxFunction">next-register</span>: <span class="subxComment"># in : (address slice) -> reg/eax : int</span> +<span id="L2673" class="LineNr">2673 </span><span class="subxFunction">next-register</span>: <span class="subxComment"># in : (addr slice) -> reg/eax : int</span> <span id="L2674" class="LineNr">2674 </span> <span class="subxS1Comment"># . prologue</span> <span id="L2675" class="LineNr">2675 </span> 55/push-ebp <span id="L2676" class="LineNr">2676 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -2922,7 +2922,7 @@ if ('onhashchange' in window) { <span id="L3149" class="LineNr">3149 </span><span class="subxComment"># if index is none, then mod = 2 and rm32 = base and disp32 = disp</span> <span id="L3150" class="LineNr">3150 </span><span class="subxComment"># emit-sib:</span> <span id="L3151" class="LineNr">3151 </span><span class="subxComment"># if index is not none, then mod = 2 and rm32 = 4 and base = base and index = index and disp32 = disp</span> -<span id="L3152" class="LineNr">3152 </span><span class="subxFunction">emit-indirect-mode</span>: <span class="subxComment"># out : (address buffered-file), base : int, index : int, scale : int, disp : int</span> +<span id="L3152" class="LineNr">3152 </span><span class="subxFunction">emit-indirect-mode</span>: <span class="subxComment"># out : (addr buffered-file), base : int, index : int, scale : int, disp : int</span> <span id="L3153" class="LineNr">3153 </span> <span class="subxS1Comment"># . prologue</span> <span id="L3154" class="LineNr">3154 </span> 55/push-ebp <span id="L3155" class="LineNr">3155 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -3456,7 +3456,7 @@ if ('onhashchange' in window) { <span id="L3858" class="LineNr">3858 </span> 5d/pop-to-ebp <span id="L3859" class="LineNr">3859 </span> c3/return <span id="L3860" class="LineNr">3860 </span> -<span id="L3861" class="LineNr">3861 </span><span class="subxFunction">disp32-mode?</span>: <span class="subxComment"># in : (address slice) -> reg/eax : boolean</span> +<span id="L3861" class="LineNr">3861 </span><span class="subxFunction">disp32-mode?</span>: <span class="subxComment"># in : (addr slice) -> reg/eax : boolean</span> <span id="L3862" class="LineNr">3862 </span> <span class="subxS1Comment"># . prologue</span> <span id="L3863" class="LineNr">3863 </span> 55/push-ebp <span id="L3864" class="LineNr">3864 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -3515,7 +3515,7 @@ if ('onhashchange' in window) { <span id="L3917" class="LineNr">3917 </span> 5d/pop-to-ebp <span id="L3918" class="LineNr">3918 </span> c3/return <span id="L3919" class="LineNr">3919 </span> -<span id="L3920" class="LineNr">3920 </span><span class="subxFunction">emit-indirect-disp32</span>: <span class="subxComment"># out : (address buffered-file), word-slice : (address slice)</span> +<span id="L3920" class="LineNr">3920 </span><span class="subxFunction">emit-indirect-disp32</span>: <span class="subxComment"># out : (addr buffered-file), word-slice : (addr slice)</span> <span id="L3921" class="LineNr">3921 </span> <span class="subxS1Comment"># . prologue</span> <span id="L3922" class="LineNr">3922 </span> 55/push-ebp <span id="L3923" class="LineNr">3923 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -3565,7 +3565,7 @@ if ('onhashchange' in window) { <span id="L3967" class="LineNr">3967 </span><span class="subxComment"># assumes 'in' starts with optional '+' or '-', optional whitespace, and an unsigned integer</span> <span id="L3968" class="LineNr">3968 </span><span class="subxComment"># returns the value of the integer</span> <span id="L3969" class="LineNr">3969 </span><span class="subxComment"># side-effect: modifies 'in' to skip past the integer</span> -<span id="L3970" class="LineNr">3970 </span><span class="subxFunction">next-hex-int</span>: <span class="subxComment"># in : (address slice) -> result/eax</span> +<span id="L3970" class="LineNr">3970 </span><span class="subxFunction">next-hex-int</span>: <span class="subxComment"># in : (addr slice) -> result/eax</span> <span id="L3971" class="LineNr">3971 </span> <span class="subxS1Comment"># . prologue</span> <span id="L3972" class="LineNr">3972 </span> 55/push-ebp <span id="L3973" class="LineNr">3973 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -3980,7 +3980,7 @@ if ('onhashchange' in window) { <span id="L4382" class="LineNr">4382 </span><span class="subxComment"># assumes 'in' starts a positive unsigned integer</span> <span id="L4383" class="LineNr">4383 </span><span class="subxComment"># returns the value of the integer</span> <span id="L4384" class="LineNr">4384 </span><span class="subxComment"># side-effect: modifies 'in' to skip past the integer</span> -<span id="L4385" class="LineNr">4385 </span><span class="subxFunction">next-positive-hex-int</span>: <span class="subxComment"># in : (address slice) -> result/eax</span> +<span id="L4385" class="LineNr">4385 </span><span class="subxFunction">next-positive-hex-int</span>: <span class="subxComment"># in : (addr slice) -> result/eax</span> <span id="L4386" class="LineNr">4386 </span> <span class="subxS1Comment"># . prologue</span> <span id="L4387" class="LineNr">4387 </span> 55/push-ebp <span id="L4388" class="LineNr">4388 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> diff --git a/html/apps/survey.subx.html b/html/apps/survey.subx.html index 475d3ad4..9c918fef 100644 --- a/html/apps/survey.subx.html +++ b/html/apps/survey.subx.html @@ -170,13 +170,13 @@ if ('onhashchange' in window) { <span id="L107" class="LineNr"> 107 </span> cd/syscall 0x80/imm8 <span id="L108" class="LineNr"> 108 </span> <span id="L109" class="LineNr"> 109 </span><span class="subxComment"># data structures:</span> -<span id="L110" class="LineNr"> 110 </span><span class="subxComment"># segment-info: {address, file-offset, size} (12 bytes)</span> -<span id="L111" class="LineNr"> 111 </span><span class="subxComment"># segments: (address stream {string, segment-info}) (16 bytes per row)</span> -<span id="L112" class="LineNr"> 112 </span><span class="subxComment"># label-info: {segment-name, segment-offset, address} (12 bytes)</span> -<span id="L113" class="LineNr"> 113 </span><span class="subxComment"># labels: (address stream {string, label-info}) (16 bytes per row)</span> +<span id="L110" class="LineNr"> 110 </span><span class="subxComment"># segment-info: {addr, file-offset, size} (12 bytes)</span> +<span id="L111" class="LineNr"> 111 </span><span class="subxComment"># segments: (addr stream {string, segment-info}) (16 bytes per row)</span> +<span id="L112" class="LineNr"> 112 </span><span class="subxComment"># label-info: {segment-name, segment-offset, addr} (12 bytes)</span> +<span id="L113" class="LineNr"> 113 </span><span class="subxComment"># labels: (addr stream {string, label-info}) (16 bytes per row)</span> <span id="L114" class="LineNr"> 114 </span><span class="subxComment"># these are all inefficient; use sequential scans for lookups</span> <span id="L115" class="LineNr"> 115 </span> -<span id="L116" class="LineNr"> 116 </span><span class="subxFunction">subx-survey</span>: <span class="subxComment"># infile : (address buffered-file), out : (address buffered-file)</span> +<span id="L116" class="LineNr"> 116 </span><span class="subxFunction">subx-survey</span>: <span class="subxComment"># infile : (addr buffered-file), out : (addr buffered-file)</span> <span id="L117" class="LineNr"> 117 </span> <span class="subxComment"># pseudocode</span> <span id="L118" class="LineNr"> 118 </span> <span class="subxComment"># var in : (ref stream byte 4096)</span> <span id="L119" class="LineNr"> 119 </span> <span class="subxComment"># slurp(infile, in)</span> @@ -449,7 +449,7 @@ if ('onhashchange' in window) { <span id="L618" class="LineNr"> 618 </span> <span id="L619" class="LineNr"> 619 </span>== code <span id="L620" class="LineNr"> 620 </span> -<span id="L621" class="LineNr"> 621 </span><span class="subxFunction">compute-offsets</span>: <span class="subxComment"># in : (address stream byte), segments : (address stream {string, segment-info}), labels : (address stream {string, label-info})</span> +<span id="L621" class="LineNr"> 621 </span><span class="subxFunction">compute-offsets</span>: <span class="subxComment"># in : (addr stream byte), segments : (addr stream {string, segment-info}), labels : (addr stream {string, label-info})</span> <span id="L622" class="LineNr"> 622 </span> <span class="subxComment"># skeleton:</span> <span id="L623" class="LineNr"> 623 </span> <span class="subxComment"># for lines in 'in'</span> <span id="L624" class="LineNr"> 624 </span> <span class="subxComment"># for words in line</span> @@ -460,7 +460,7 @@ if ('onhashchange' in window) { <span id="L629" class="LineNr"> 629 </span> <span class="subxComment"># default</span> <span id="L630" class="LineNr"> 630 </span> <span class="subxComment">#</span> <span id="L631" class="LineNr"> 631 </span> <span class="subxComment"># pseudocode:</span> -<span id="L632" class="LineNr"> 632 </span> <span class="subxComment"># curr-segment-name : (address string) = 0</span> +<span id="L632" class="LineNr"> 632 </span> <span class="subxComment"># curr-segment-name : (addr string) = 0</span> <span id="L633" class="LineNr"> 633 </span> <span class="subxComment"># var line : (stream byte 512)</span> <span id="L634" class="LineNr"> 634 </span> <span class="subxComment"># while true # line loop</span> <span id="L635" class="LineNr"> 635 </span> <span class="subxComment"># clear-stream(line)</span> @@ -492,7 +492,7 @@ if ('onhashchange' in window) { <span id="L661" class="LineNr"> 661 </span> <span class="subxComment"># break (next line)</span> <span id="L662" class="LineNr"> 662 </span> <span class="subxComment"># else if is-label?(word-slice)</span> <span id="L663" class="LineNr"> 663 </span> <span class="subxComment"># strip trailing ':' from word-slice</span> -<span id="L664" class="LineNr"> 664 </span> <span class="subxComment"># x : (address label-info) = get-or-insert(labels, name)</span> +<span id="L664" class="LineNr"> 664 </span> <span class="subxComment"># x : (addr label-info) = get-or-insert(labels, name)</span> <span id="L665" class="LineNr"> 665 </span> <span class="subxComment"># x->segment-name = curr-segment-name</span> <span id="L666" class="LineNr"> 666 </span> <span class="subxComment"># trace("label '", word-slice, "' is in segment '", curr-segment-name, "'.")</span> <span id="L667" class="LineNr"> 667 </span> <span class="subxComment"># x->segment-offset = segment-offset</span> @@ -995,9 +995,9 @@ if ('onhashchange' in window) { <span id="L1378" class="LineNr">1378 </span> 5d/pop-to-ebp <span id="L1379" class="LineNr">1379 </span> c3/return <span id="L1380" class="LineNr">1380 </span> -<span id="L1381" class="LineNr">1381 </span><span class="subxFunction">compute-addresses</span>: <span class="subxComment"># segments : (address stream {string, segment-info}), labels : (address stream {string, label-info})</span> +<span id="L1381" class="LineNr">1381 </span><span class="subxFunction">compute-addresses</span>: <span class="subxComment"># segments : (addr stream {string, segment-info}), labels : (addr stream {string, label-info})</span> <span id="L1382" class="LineNr">1382 </span> <span class="subxComment"># pseudocode:</span> -<span id="L1383" class="LineNr">1383 </span> <span class="subxComment"># srow : (address segment-info) = segments->data</span> +<span id="L1383" class="LineNr">1383 </span> <span class="subxComment"># srow : (addr segment-info) = segments->data</span> <span id="L1384" class="LineNr">1384 </span> <span class="subxComment"># max = &segments->data[segments->write]</span> <span id="L1385" class="LineNr">1385 </span> <span class="subxComment"># num-segments = segments->write / 16</span> <span id="L1386" class="LineNr">1386 </span> <span class="subxComment"># starting-offset = 0x34 + (num-segments * 0x20)</span> @@ -1008,12 +1008,12 @@ if ('onhashchange' in window) { <span id="L1391" class="LineNr">1391 </span> <span class="subxComment"># s->address += (s->file-offset & 0x00000fff)</span> <span id="L1392" class="LineNr">1392 </span> <span class="subxComment"># trace-sssns("segment " s->key " starts at address " s->address)</span> <span id="L1393" class="LineNr">1393 </span> <span class="subxComment"># srow += 16 # row-size</span> -<span id="L1394" class="LineNr">1394 </span> <span class="subxComment"># lrow : (address label-info) = labels->data</span> +<span id="L1394" class="LineNr">1394 </span> <span class="subxComment"># lrow : (addr label-info) = labels->data</span> <span id="L1395" class="LineNr">1395 </span> <span class="subxComment"># max = &labels->data[labels->write]</span> <span id="L1396" class="LineNr">1396 </span> <span class="subxComment"># while true</span> <span id="L1397" class="LineNr">1397 </span> <span class="subxComment"># if (lrow >= max) break</span> -<span id="L1398" class="LineNr">1398 </span> <span class="subxComment"># seg-name : (address string) = lrow->segment-name</span> -<span id="L1399" class="LineNr">1399 </span> <span class="subxComment"># label-seg : (address segment-info) = get(segments, seg-name)</span> +<span id="L1398" class="LineNr">1398 </span> <span class="subxComment"># seg-name : (addr string) = lrow->segment-name</span> +<span id="L1399" class="LineNr">1399 </span> <span class="subxComment"># label-seg : (addr segment-info) = get(segments, seg-name)</span> <span id="L1400" class="LineNr">1400 </span> <span class="subxComment"># lrow->address = label-seg->address + lrow->segment-offset</span> <span id="L1401" class="LineNr">1401 </span> <span class="subxComment"># trace-sssns("label " lrow->key " is at address " lrow->address)</span> <span id="L1402" class="LineNr">1402 </span> <span class="subxComment"># lrow += 16 # row-size</span> @@ -1092,7 +1092,7 @@ if ('onhashchange' in window) { <span id="L1525" class="LineNr">1525 </span> <span class="subxComment"># seg-name/edx = lrow->segment-name</span> <span id="L1526" class="LineNr">1526 </span> 8b/copy 1/mod/*+disp8 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *eax to edx</span> <span id="L1527" class="Folded">1527 </span><span class="Folded">+-- 26 lines: #? # dump seg-name -------------------------------------------------------------------------------------------------------------------------</span> -<span id="L1553" class="LineNr">1553 </span> <span class="subxComment"># label-seg/edx : (address segment-info) = get(segments, seg-name, row-size=16, "segment table")</span> +<span id="L1553" class="LineNr">1553 </span> <span class="subxComment"># label-seg/edx : (addr segment-info) = get(segments, seg-name, row-size=16, "segment table")</span> <span id="L1554" class="LineNr">1554 </span> <span class="subxS1Comment"># . save eax</span> <span id="L1555" class="LineNr">1555 </span> 50/push-eax <span id="L1556" class="LineNr">1556 </span> <span class="subxS1Comment"># . eax = get(segments, seg-name, row-size=16)</span> @@ -1388,7 +1388,7 @@ if ('onhashchange' in window) { <span id="L1871" class="LineNr">1871 </span> 5d/pop-to-ebp <span id="L1872" class="LineNr">1872 </span> c3/return <span id="L1873" class="LineNr">1873 </span> -<span id="L1874" class="LineNr">1874 </span><span class="subxFunction">emit-output</span>: <span class="subxComment"># in : (address stream byte), out : (address buffered-file), segments : (address stream {string, segment-info}), labels : (address stream {string, label-info})</span> +<span id="L1874" class="LineNr">1874 </span><span class="subxFunction">emit-output</span>: <span class="subxComment"># in : (addr stream byte), out : (addr buffered-file), segments : (addr stream {string, segment-info}), labels : (addr stream {string, label-info})</span> <span id="L1875" class="LineNr">1875 </span> <span class="subxComment"># pseudocode:</span> <span id="L1876" class="LineNr">1876 </span> <span class="subxComment"># emit-headers(out, segments, labels)</span> <span id="L1877" class="LineNr">1877 </span> <span class="subxComment"># emit-segments(in, out, segments, labels)</span> @@ -1423,7 +1423,7 @@ if ('onhashchange' in window) { <span id="L1922" class="LineNr">1922 </span> 5d/pop-to-ebp <span id="L1923" class="LineNr">1923 </span> c3/return <span id="L1924" class="LineNr">1924 </span> -<span id="L1925" class="LineNr">1925 </span><span class="subxFunction">emit-segments</span>: <span class="subxComment"># in : (address stream byte), out : (address buffered-file), segments : (address stream {string, segment-info}), labels : (address stream {string, label-info})</span> +<span id="L1925" class="LineNr">1925 </span><span class="subxFunction">emit-segments</span>: <span class="subxComment"># in : (addr stream byte), out : (addr buffered-file), segments : (addr stream {string, segment-info}), labels : (addr stream {string, label-info})</span> <span id="L1926" class="LineNr">1926 </span> <span class="subxComment"># pseudocode:</span> <span id="L1927" class="LineNr">1927 </span> <span class="subxComment"># var offset-of-next-instruction = 0</span> <span id="L1928" class="LineNr">1928 </span> <span class="subxComment"># var line : (stream byte 512)</span> @@ -2425,7 +2425,7 @@ if ('onhashchange' in window) { <span id="L3173" class="LineNr">3173 </span> 5d/pop-to-ebp <span id="L3174" class="LineNr">3174 </span> c3/return <span id="L3175" class="LineNr">3175 </span> -<span id="L3176" class="LineNr">3176 </span><span class="subxFunction">emit-headers</span>: <span class="subxComment"># out : (address buffered-file), segments : (address stream {string, segment-info}), labels : (address stream {string, label-info})</span> +<span id="L3176" class="LineNr">3176 </span><span class="subxFunction">emit-headers</span>: <span class="subxComment"># out : (addr buffered-file), segments : (addr stream {string, segment-info}), labels : (addr stream {string, label-info})</span> <span id="L3177" class="LineNr">3177 </span> <span class="subxComment"># pseudocode:</span> <span id="L3178" class="LineNr">3178 </span> <span class="subxComment"># emit-elf-header(out, segments, labels)</span> <span id="L3179" class="LineNr">3179 </span> <span class="subxComment"># curr-segment = segments->data</span> @@ -2485,7 +2485,7 @@ if ('onhashchange' in window) { <span id="L3311" class="LineNr">3311 </span> 5d/pop-to-ebp <span id="L3312" class="LineNr">3312 </span> c3/return <span id="L3313" class="LineNr">3313 </span> -<span id="L3314" class="LineNr">3314 </span><span class="subxFunction">emit-elf-header</span>: <span class="subxComment"># out : (address buffered-file), segments : (address stream {string, segment-info}), labels : (address stream {string, label-info})</span> +<span id="L3314" class="LineNr">3314 </span><span class="subxFunction">emit-elf-header</span>: <span class="subxComment"># out : (addr buffered-file), segments : (addr stream {string, segment-info}), labels : (addr stream {string, label-info})</span> <span id="L3315" class="LineNr">3315 </span> <span class="subxComment"># pseudocode</span> <span id="L3316" class="LineNr">3316 </span> <span class="subxComment"># *$Elf_e_entry = get(labels, "Entry")->address</span> <span id="L3317" class="LineNr">3317 </span> <span class="subxComment"># *$Elf_e_phnum = segments->write / 16 # size of a row</span> @@ -2553,7 +2553,7 @@ if ('onhashchange' in window) { <span id="L3379" class="LineNr">3379 </span> 5d/pop-to-ebp <span id="L3380" class="LineNr">3380 </span> c3/return <span id="L3381" class="LineNr">3381 </span> -<span id="L3382" class="LineNr">3382 </span><span class="subxFunction">emit-elf-program-header-entry</span>: <span class="subxComment"># out : (address buffered-file), curr-segment : (address {string, segment-info})</span> +<span id="L3382" class="LineNr">3382 </span><span class="subxFunction">emit-elf-program-header-entry</span>: <span class="subxComment"># out : (addr buffered-file), curr-segment : (addr {string, segment-info})</span> <span id="L3383" class="LineNr">3383 </span> <span class="subxComment"># pseudocode:</span> <span id="L3384" class="LineNr">3384 </span> <span class="subxComment"># *$Elf_p_offset = curr-segment->file-offset</span> <span id="L3385" class="LineNr">3385 </span> <span class="subxComment"># *$Elf_p_vaddr = curr-segment->address</span> @@ -2642,7 +2642,7 @@ if ('onhashchange' in window) { <span id="L3468" class="LineNr">3468 </span> <span id="L3469" class="LineNr">3469 </span><span class="subxH1Comment"># - some helpers for tests</span> <span id="L3470" class="LineNr">3470 </span> -<span id="L3471" class="LineNr">3471 </span><span class="subxFunction">stream-add4</span>: <span class="subxComment"># in : (address stream byte), key : address, val1 : address, val2 : address, val3 : address</span> +<span id="L3471" class="LineNr">3471 </span><span class="subxFunction">stream-add4</span>: <span class="subxComment"># in : (addr stream byte), key : addr, val1 : addr, val2 : addr, val3 : addr</span> <span id="L3472" class="LineNr">3472 </span> <span class="subxS1Comment"># . prologue</span> <span id="L3473" class="LineNr">3473 </span> 55/push-ebp <span id="L3474" class="LineNr">3474 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -2724,11 +2724,11 @@ if ('onhashchange' in window) { <span id="L3550" class="LineNr">3550 </span><span class="subxComment"># some variants of 'trace' that take multiple arguments in different combinations of types:</span> <span id="L3551" class="LineNr">3551 </span><span class="subxComment"># n: int</span> <span id="L3552" class="LineNr">3552 </span><span class="subxComment"># c: character [4-bytes, will eventually be UTF-8]</span> -<span id="L3553" class="LineNr">3553 </span><span class="subxComment"># s: (address string)</span> -<span id="L3554" class="LineNr">3554 </span><span class="subxComment"># l: (address slice)</span> +<span id="L3553" class="LineNr">3553 </span><span class="subxComment"># s: (addr string)</span> +<span id="L3554" class="LineNr">3554 </span><span class="subxComment"># l: (addr slice)</span> <span id="L3555" class="LineNr">3555 </span><span class="subxComment"># one gotcha: 's5' must not be empty</span> <span id="L3556" class="LineNr">3556 </span> -<span id="L3557" class="LineNr">3557 </span><span class="subxFunction">trace-sssns</span>: <span class="subxComment"># s1 : (address string), s2 : (address string), s3 : (address string), n4 : int, s5 : (address string)</span> +<span id="L3557" class="LineNr">3557 </span><span class="subxFunction">trace-sssns</span>: <span class="subxComment"># s1 : (addr string), s2 : (addr string), s3 : (addr string), n4 : int, s5 : (addr string)</span> <span id="L3558" class="LineNr">3558 </span> <span class="subxS1Comment"># . prologue</span> <span id="L3559" class="LineNr">3559 </span> 55/push-ebp <span id="L3560" class="LineNr">3560 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -2810,7 +2810,7 @@ if ('onhashchange' in window) { <span id="L3661" class="LineNr">3661 </span> 5d/pop-to-ebp <span id="L3662" class="LineNr">3662 </span> c3/return <span id="L3663" class="LineNr">3663 </span> -<span id="L3664" class="LineNr">3664 </span><span class="subxFunction">trace-snsns</span>: <span class="subxComment"># s1 : (address string), n2 : int, s3 : (address string), n4 : int, s5 : (address string)</span> +<span id="L3664" class="LineNr">3664 </span><span class="subxFunction">trace-snsns</span>: <span class="subxComment"># s1 : (addr string), n2 : int, s3 : (addr string), n4 : int, s5 : (addr string)</span> <span id="L3665" class="LineNr">3665 </span> <span class="subxS1Comment"># . prologue</span> <span id="L3666" class="LineNr">3666 </span> 55/push-ebp <span id="L3667" class="LineNr">3667 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -2892,7 +2892,7 @@ if ('onhashchange' in window) { <span id="L3768" class="LineNr">3768 </span> 5d/pop-to-ebp <span id="L3769" class="LineNr">3769 </span> c3/return <span id="L3770" class="LineNr">3770 </span> -<span id="L3771" class="LineNr">3771 </span><span class="subxFunction">trace-slsls</span>: <span class="subxComment"># s1 : (address string), l2 : (address slice), s3 : (address string), l4 : (address slice), s5 : (address string)</span> +<span id="L3771" class="LineNr">3771 </span><span class="subxFunction">trace-slsls</span>: <span class="subxComment"># s1 : (addr string), l2 : (addr slice), s3 : (addr string), l4 : (addr slice), s5 : (addr string)</span> <span id="L3772" class="LineNr">3772 </span> <span class="subxS1Comment"># . prologue</span> <span id="L3773" class="LineNr">3773 </span> 55/push-ebp <span id="L3774" class="LineNr">3774 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -2992,7 +2992,7 @@ if ('onhashchange' in window) { <span id="L3893" class="LineNr">3893 </span> 5d/pop-to-ebp <span id="L3894" class="LineNr">3894 </span> c3/return <span id="L3895" class="LineNr">3895 </span> -<span id="L3896" class="LineNr">3896 </span><span class="subxFunction">trace-slsns</span>: <span class="subxComment"># s1 : (address string), l2 : (address slice), s3 : (address string), n4 : int, s5 : (address string)</span> +<span id="L3896" class="LineNr">3896 </span><span class="subxFunction">trace-slsns</span>: <span class="subxComment"># s1 : (addr string), l2 : (addr slice), s3 : (addr string), n4 : int, s5 : (addr string)</span> <span id="L3897" class="LineNr">3897 </span> <span class="subxS1Comment"># . prologue</span> <span id="L3898" class="LineNr">3898 </span> 55/push-ebp <span id="L3899" class="LineNr">3899 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -3083,7 +3083,7 @@ if ('onhashchange' in window) { <span id="L4009" class="LineNr">4009 </span> 5d/pop-to-ebp <span id="L4010" class="LineNr">4010 </span> c3/return <span id="L4011" class="LineNr">4011 </span> -<span id="L4012" class="LineNr">4012 </span><span class="subxFunction">trace-slsss</span>: <span class="subxComment"># s1 : (address string), l2 : (address slice), s3 : (address string), s4 : (address string), s5 : (address string)</span> +<span id="L4012" class="LineNr">4012 </span><span class="subxFunction">trace-slsss</span>: <span class="subxComment"># s1 : (addr string), l2 : (addr slice), s3 : (addr string), s4 : (addr string), s5 : (addr string)</span> <span id="L4013" class="LineNr">4013 </span> <span class="subxS1Comment"># . prologue</span> <span id="L4014" class="LineNr">4014 </span> 55/push-ebp <span id="L4015" class="LineNr">4015 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span> @@ -3174,7 +3174,7 @@ if ('onhashchange' in window) { <span id="L4125" class="LineNr">4125 </span> 5d/pop-to-ebp <span id="L4126" class="LineNr">4126 </span> c3/return <span id="L4127" class="LineNr">4127 </span> -<span id="L4128" class="LineNr">4128 </span><span class="subxFunction">num-bytes</span>: <span class="subxComment"># line : (address stream byte) -> eax : int</span> +<span id="L4128" class="LineNr">4128 </span><span class="subxFunction">num-bytes</span>: <span class="subxComment"># line : (addr stream byte) -> eax : int</span> <span id="L4129" class="LineNr">4129 </span> <span class="subxComment"># pseudocode:</span> <span id="L4130" class="LineNr">4130 </span> <span class="subxComment"># result = 0</span> <span id="L4131" class="LineNr">4131 </span> <span class="subxComment"># while true</span> diff --git a/html/apps/tests.subx.html b/html/apps/tests.subx.html index 3c9c8237..f7abb994 100644 --- a/html/apps/tests.subx.html +++ b/html/apps/tests.subx.html @@ -127,7 +127,7 @@ if ('onhashchange' in window) { <span id="L67" class="LineNr"> 67 </span> b8/copy-to-eax 1/imm32/exit <span id="L68" class="LineNr"> 68 </span> cd/syscall 0x80/imm8 <span id="L69" class="LineNr"> 69 </span> -<span id="L70" class="LineNr"> 70 </span><span class="subxFunction">subx-gen-run-tests</span>: <span class="subxComment"># in : (address buffered-file), out : (address buffered-file)</span> +<span id="L70" class="LineNr"> 70 </span><span class="subxFunction">subx-gen-run-tests</span>: <span class="subxComment"># in : (addr buffered-file), out : (addr buffered-file)</span> <span id="L71" class="LineNr"> 71 </span> <span class="subxComment"># pseudocode</span> <span id="L72" class="LineNr"> 72 </span> <span class="subxComment"># bool tests-found = false</span> <span id="L73" class="LineNr"> 73 </span> <span class="subxComment"># var line : (stream byte 512)</span> |