diff options
author | Kartik Agaram <vc@akkartik.com> | 2020-01-12 12:11:15 -0800 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2020-01-12 14:49:35 -0800 |
commit | f1eade728695ed3f52ae4e13f0a91dfe769e8567 (patch) | |
tree | d43079a8127487ecf9837600961f333e41ab7320 /apps | |
parent | e064f1bbfdbd4386d752fbb750bf36d91dce413b (diff) | |
download | mu-f1eade728695ed3f52ae4e13f0a91dfe769e8567.tar.gz |
5883 - drop the `ref` keyword
When I created it I was conflating two things: a) needing to refer to just the start, rather than the whole, and b) counting indirections. Both are kinda ill-posed. Now Mu will have just `addr` and `handle` types. Normal types will translate implicitly to `addr` types, while `handle` will always require explicit handling.
Diffstat (limited to 'apps')
-rw-r--r-- | apps/assort.subx | 8 | ||||
-rw-r--r-- | apps/braces.subx | 8 | ||||
-rw-r--r-- | apps/calls.subx | 32 | ||||
-rw-r--r-- | apps/crenshaw2-1.subx | 8 | ||||
-rw-r--r-- | apps/crenshaw2-1b.subx | 12 | ||||
-rw-r--r-- | apps/dquotes.subx | 14 | ||||
-rw-r--r-- | apps/handle.subx | 16 | ||||
-rw-r--r-- | apps/hex.subx | 24 | ||||
-rw-r--r-- | apps/mu.subx | 224 | ||||
-rw-r--r-- | apps/mulisp.subx | 2 | ||||
-rw-r--r-- | apps/pack.subx | 36 | ||||
-rw-r--r-- | apps/sigils.subx | 24 | ||||
-rw-r--r-- | apps/survey.subx | 46 | ||||
-rw-r--r-- | apps/tests.subx | 4 |
14 files changed, 229 insertions, 229 deletions
diff --git a/apps/assort.subx b/apps/assort.subx index 87a940cb..be365403 100644 --- a/apps/assort.subx +++ b/apps/assort.subx @@ -60,7 +60,7 @@ Entry: # run tests if necessary, convert stdin if not eb/jump $subx-assort-main:end/disp8 $subx-assort-main:interactive: # - otherwise convert stdin - # var ed/eax : (ref exit-descriptor) + # var ed/eax : exit-descriptor 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # subtract from esp 89/copy 3/mod/direct 0/rm32/eax . . . 4/r32/esp . . # copy esp to eax # configure ed to really exit() @@ -97,7 +97,7 @@ subx-assort: # in : (addr buffered-file), out : (addr 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, (addr stream byte)} 80) # 10 rows * 8 bytes/row + # var table/ecx : (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 @@ -496,13 +496,13 @@ read-segments: # in : (addr buffered-file), table : (addr stream {string_key, ( 52/push-edx 53/push-ebx 56/push-esi - # var line/ecx : (ref stream byte 512) + # var line/ecx : (stream byte 512) 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 0x200/imm32 # subtract from esp 68/push 0x200/imm32/length 68/push 0/imm32/read 68/push 0/imm32/write 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx - # var word-slice/edx : (ref slice) + # var word-slice/edx : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/copy 3/mod/direct 2/rm32/edx . . . 4/r32/esp . . # copy esp to edx diff --git a/apps/braces.subx b/apps/braces.subx index 264f0893..e3659048 100644 --- a/apps/braces.subx +++ b/apps/braces.subx @@ -77,7 +77,7 @@ $subx-braces-main:end: subx-braces: # in : (addr buffered-file), out : (addr buffered-file) # pseudocode: - # var line : (ref stream byte 512) + # var line : (stream byte 512) # var label-stack : (stack int 32) # at most 32 levels of nesting # var next-label-id : int = 1 # while true @@ -123,20 +123,20 @@ subx-braces: # in : (addr buffered-file), out : (addr buffered-file) 57/push-edi # esi = in 8b/-> *(ebp+8) 6/r32/esi - # var line/ecx : (ref stream byte 512) + # var line/ecx : (stream byte 512) 81 5/subop/subtract %esp 0x200/imm32 68/push 0x200/imm32/length 68/push 0/imm32/read 68/push 0/imm32/write 89/<- %ecx 4/r32/esp - # var label-stack/edx : (ref stack int 32) + # var label-stack/edx : (stack int 32) 81 5/subop/subtract %esp 0x80/imm32 68/push 0x80/imm32/length 68/push 0/imm32/top 89/<- %edx 4/r32/esp # var next-label-id/ebx : int = 1 c7 0/subop/copy %ebx 1/imm32 - # var word-slice/edi : (ref slice) + # var word-slice/edi : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/<- %edi 4/r32/esp diff --git a/apps/calls.subx b/apps/calls.subx index f1bc0cd9..1661313f 100644 --- a/apps/calls.subx +++ b/apps/calls.subx @@ -77,8 +77,8 @@ $subx-calls-main:end: 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 + # var line : (stream byte 512) + # var words : (stream slice 16) # at most function name and 15 args # while true # clear-stream(line) # read-line-buffered(in, line) @@ -105,13 +105,13 @@ subx-calls: # in : (addr buffered-file), out : (addr buffered-file) 51/push-ecx 52/push-edx 56/push-esi - # var line/esi : (ref stream byte 512) + # var line/esi : (stream byte 512) 81 5/subop/subtract %esp 0x200/imm32 68/push 0x200/imm32/length 68/push 0/imm32/read 68/push 0/imm32/write 89/<- %esi 4/r32/esp - # var words/edx : (ref stream slice 128) # 16 rows * 8 bytes/row + # var words/edx : (stream slice 128) # 16 rows * 8 bytes/row 81 5/subop/subtract %esp 0x80/imm32 68/push 0x80/imm32/length 68/push 0/imm32/read @@ -233,7 +233,7 @@ $subx-calls:end: parse-line: # line : (addr stream byte), words : (addr stream slice) # pseudocode: - # var word-slice : (ref slice) + # var word-slice : slice # while true # word-slice = next-word-string-or-expression-without-metadata(line) # if slice-empty?(word-slice) @@ -246,7 +246,7 @@ parse-line: # line : (addr stream byte), words : (addr stream slice) 89/<- %ebp 4/r32/esp # . save registers 51/push-ecx - # var word-slice/ecx : (ref slice) + # var word-slice/ecx : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/<- %ecx 4/r32/esp @@ -1191,7 +1191,7 @@ test-next-word-string-or-expression-without-metadata: e8/call clear-stream/disp32 # . . discard args 81 0/subop/add %esp 4/imm32 - # var slice/ecx : (ref slice) + # var slice/ecx : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/<- %ecx 4/r32/esp @@ -1264,7 +1264,7 @@ test-next-word-string-or-expression-without-metadata-returns-whole-comment: e8/call clear-stream/disp32 # . . discard args 81 0/subop/add %esp 4/imm32 - # var slice/ecx : (ref slice) + # var slice/ecx : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/<- %ecx 4/r32/esp @@ -1337,7 +1337,7 @@ test-next-word-string-or-expression-without-metadata-returns-empty-slice-on-eof: e8/call clear-stream/disp32 # . . discard args 81 0/subop/add %esp 4/imm32 - # var slice/ecx : (ref slice) + # var slice/ecx : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/<- %ecx 4/r32/esp @@ -1379,7 +1379,7 @@ test-next-word-string-or-expression-without-metadata-returns-string-literal: e8/call clear-stream/disp32 # . . discard args 81 0/subop/add %esp 4/imm32 - # var slice/ecx : (ref slice) + # var slice/ecx : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/<- %ecx 4/r32/esp @@ -1442,7 +1442,7 @@ test-next-word-string-or-expression-without-metadata-returns-string-with-escapes e8/call clear-stream/disp32 # . . discard args 81 0/subop/add %esp 4/imm32 - # var slice/ecx : (ref slice) + # var slice/ecx : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/<- %ecx 4/r32/esp @@ -1505,7 +1505,7 @@ test-next-word-string-or-expression-without-metadata-returns-whole-expression: e8/call clear-stream/disp32 # . . discard args 81 0/subop/add %esp 4/imm32 - # var slice/ecx : (ref slice) + # var slice/ecx : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/<- %ecx 4/r32/esp @@ -1568,7 +1568,7 @@ test-next-word-string-or-expression-without-metadata-returns-eol-on-trailing-clo e8/call clear-stream/disp32 # . . discard args 81 0/subop/add %esp 4/imm32 - # var slice/ecx : (ref slice) + # var slice/ecx : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/<- %ecx 4/r32/esp @@ -1623,7 +1623,7 @@ test-next-word-string-or-expression-without-metadata-handles-comment-after-trail e8/call clear-stream/disp32 # . . discard args 81 0/subop/add %esp 4/imm32 - # var slice/ecx : (ref slice) + # var slice/ecx : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/<- %ecx 4/r32/esp @@ -1678,7 +1678,7 @@ test-next-word-string-or-expression-without-metadata-handles-newline-after-trail e8/call clear-stream/disp32 # . . discard args 81 0/subop/add %esp 4/imm32 - # var slice/ecx : (ref slice) + # var slice/ecx : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/<- %ecx 4/r32/esp @@ -1733,7 +1733,7 @@ test-next-word-string-or-expression-without-metadata-stops-at-close-paren: e8/call clear-stream/disp32 # . . discard args 81 0/subop/add %esp 4/imm32 - # var slice/ecx : (ref slice) + # var slice/ecx : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/<- %ecx 4/r32/esp diff --git a/apps/crenshaw2-1.subx b/apps/crenshaw2-1.subx index c1dd79a7..b5783ef3 100644 --- a/apps/crenshaw2-1.subx +++ b/apps/crenshaw2-1.subx @@ -67,7 +67,7 @@ Entry: # run tests if necessary, call 'compile' if not eb/jump $main:end/disp8 $run-main: # - otherwise read a program from stdin and emit its translation to stdout - # var ed/eax : (ref exit-descriptor) + # var ed/eax : exit-descriptor 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # subtract from esp 89/copy 3/mod/direct 0/rm32/eax . . . 4/r32/esp . . # copy esp to eax # configure ed to really exit() @@ -105,7 +105,7 @@ compile: # in : (addr buffered-file), out : fd or (addr stream byte), err : fd e8/call get-char/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp - # var num/ecx : (ref stream byte 7) + # var num/ecx : (stream byte 7) # Numbers can be 32 bits or 8 hex bytes long. One of them will be in 'Look', so we need space for 7 bytes. # Sizing the stream just right buys us overflow-handling for free inside 'get-num'. # Add 12 bytes for 'read', 'write' and 'length' fields, for a total of 19 bytes, or 0x13 in hex. @@ -339,7 +339,7 @@ test-get-num-reads-single-digit: # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # initialize exit-descriptor 'ed' for the call to 'get-num' below - # . var ed/eax : (ref exit-descriptor) + # . var ed/eax : exit-descriptor 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # subtract from esp 89/copy 3/mod/direct 0/rm32/eax . . . 4/r32/esp . . # copy esp to eax # . tailor-exit-descriptor(ed, 16) @@ -428,7 +428,7 @@ test-get-num-aborts-on-non-digit-in-Look: # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # initialize exit-descriptor 'ed' for the call to 'get-num' below - # . var ed/eax : (ref exit-descriptor) + # . var ed/eax : exit-descriptor 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # subtract from esp 89/copy 3/mod/direct 0/rm32/eax . . . 4/r32/esp . . # copy esp to eax # . tailor-exit-descriptor(ed, 16) diff --git a/apps/crenshaw2-1b.subx b/apps/crenshaw2-1b.subx index 8efd9ca4..d5f90952 100644 --- a/apps/crenshaw2-1b.subx +++ b/apps/crenshaw2-1b.subx @@ -67,7 +67,7 @@ Entry: # run tests if necessary, call 'compile' if not eb/jump $main:end/disp8 $run-main: # - otherwise read a program from stdin and emit its translation to stdout - # var ed/eax : (ref exit-descriptor) + # var ed/eax : exit-descriptor 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # subtract from esp 89/copy 3/mod/direct 0/rm32/eax . . . 4/r32/esp . . # copy esp to eax # configure ed to really exit() @@ -105,7 +105,7 @@ compile: # in : (addr buffered-file), out : fd or (addr stream byte), err : fd e8/call get-char/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp - # var num/ecx : (ref stream byte 7) + # var num/ecx : (stream byte 7) # Numbers can be 32 bits or 8 hex bytes long. One of them will be in 'Look', so we need space for 7 bytes. # Sizing the stream just right buys us overflow-handling for free inside 'get-num'. # Add 12 bytes for 'read', 'write' and 'length' fields, for a total of 19 bytes, or 0x13 in hex. @@ -355,7 +355,7 @@ test-get-num-reads-single-digit: # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # initialize exit-descriptor 'ed' for the call to 'get-num' below - # . var ed/eax : (ref exit-descriptor) + # . var ed/eax : exit-descriptor 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # subtract from esp 89/copy 3/mod/direct 0/rm32/eax . . . 4/r32/esp . . # copy esp to eax # . tailor-exit-descriptor(ed, 16) @@ -444,7 +444,7 @@ test-get-num-aborts-on-non-digit-in-Look: # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # initialize exit-descriptor 'ed' for the call to 'get-num' below - # . var ed/eax : (ref exit-descriptor) + # . var ed/eax : exit-descriptor 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # subtract from esp 89/copy 3/mod/direct 0/rm32/eax . . . 4/r32/esp . . # copy esp to eax # . tailor-exit-descriptor(ed, 16) @@ -527,7 +527,7 @@ test-get-num-reads-multiple-digits: # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # initialize exit-descriptor 'ed' for the call to 'get-num' below - # . var ed/eax : (ref exit-descriptor) + # . var ed/eax : exit-descriptor 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # subtract from esp 89/copy 3/mod/direct 0/rm32/eax . . . 4/r32/esp . . # copy esp to eax # . tailor-exit-descriptor(ed, 16) @@ -616,7 +616,7 @@ test-get-num-reads-multiple-digits-followed-by-nondigit: # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # initialize exit-descriptor 'ed' for the call to 'get-num' below - # . var ed/eax : (ref exit-descriptor) + # . var ed/eax : exit-descriptor 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # subtract from esp 89/copy 3/mod/direct 0/rm32/eax . . . 4/r32/esp . . # copy esp to eax # . tailor-exit-descriptor(ed, 16) diff --git a/apps/dquotes.subx b/apps/dquotes.subx index adade39a..5396d26e 100644 --- a/apps/dquotes.subx +++ b/apps/dquotes.subx @@ -56,7 +56,7 @@ Entry: # run tests if necessary, convert stdin if not eb/jump $subx-dquotes-main:end/disp8 $subx-dquotes-main:interactive: # - otherwise convert stdin - # var ed/eax : (ref exit-descriptor) + # var ed/eax : exit-descriptor 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # subtract from esp 89/copy 3/mod/direct 0/rm32/eax . . . 4/r32/esp . . # copy esp to eax # configure ed to really exit() @@ -84,7 +84,7 @@ $subx-dquotes-main:end: subx-dquotes: # in : (addr buffered-file), out : (addr buffered-file) # pseudocode: - # var line : (ref stream byte 512) + # var line : (stream byte 512) # var new-data-segment : (handle stream byte) = new-stream(Heap, Segment-size, 1) # # write(new-data-segment, "== data\n") @@ -125,13 +125,13 @@ subx-dquotes: # in : (addr buffered-file), out : (addr buffered-file) 53/push-ebx 56/push-esi 57/push-edi - # var line/ecx : (ref stream byte 512) + # var line/ecx : (stream byte 512) 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 0x200/imm32 # subtract from esp 68/push 0x200/imm32/length 68/push 0/imm32/read 68/push 0/imm32/write 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx - # var word-slice/edx : (ref slice) + # var word-slice/edx : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/copy 3/mod/direct 2/rm32/edx . . . 4/r32/esp . . # copy esp to edx @@ -300,7 +300,7 @@ process-string-literal: # string-literal : (addr slice), out : (addr buffered-f 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp # . save registers 51/push-ecx - # var int32-stream/ecx : (ref stream byte 10) # number of decimal digits a 32-bit number can have + # var int32-stream/ecx : (stream byte 10) # number of decimal digits a 32-bit number can have 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 0xa/imm32 # subtract from esp 68/push 0xa/imm32/decimal-digits-in-32bit-number 68/push 0/imm32/read @@ -1381,7 +1381,7 @@ test-emit-string-literal-data-handles-newline-escape: # emit everything from a word except the initial datum emit-metadata: # out : (addr buffered-file), word : (addr slice) # pseudocode - # var slice : (ref slice) = {0, word->end} + # var slice : slice = {0, word->end} # curr = word->start # if *curr == '"' # curr = skip-string-in-slice(curr, word->end) @@ -1410,7 +1410,7 @@ emit-metadata: # out : (addr buffered-file), word : (addr slice) 8b/copy 0/mod/indirect 6/rm32/esi . . . 1/r32/ecx . . # copy *esi to ecx # 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} + # var slice/ebx : slice = {0, end} 52/push-edx 68/push 0/imm32 89/copy 3/mod/direct 3/rm32/ebx . . . 4/r32/esp . . # copy esp to ebx diff --git a/apps/handle.subx b/apps/handle.subx index fba9db1c..38af2db2 100644 --- a/apps/handle.subx +++ b/apps/handle.subx @@ -96,7 +96,7 @@ test-new: # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp - # var heap/edx : (ref allocation-descriptor) + # var heap/edx : allocation-descriptor 68/push 0/imm32/limit 68/push 0/imm32/curr 89/copy 3/mod/direct 2/rm32/edx . . . 4/r32/esp . . # copy esp to edx @@ -110,7 +110,7 @@ test-new: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # *Next-alloc-id = 0x34 c7 0/subop/copy 0/mod/indirect 5/rm32/.disp32 . . . Next-alloc-id/disp32 0x34/imm32 # copy to *Next-alloc-id - # var handle/ecx : (ref handle) + # var handle/ecx : handle 68/push 0/imm32/address 68/push 0/imm32/alloc-id 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx @@ -166,7 +166,7 @@ _pending-test-new-failure: # . *Next-alloc-id = 0x34 c7 0/subop/copy 0/mod/indirect 5/rm32/.disp32 . . . Next-alloc-id/disp32 0x34/imm32 # copy to *Next-alloc-id # define an allocation-descriptor with no space left - # . var ad/eax : (ref allocation-descriptor) = {0x10, 0x10} + # . var ad/eax : allocation-descriptor = {0x10, 0x10} 68/push 0x10/imm32/limit 68/push 0x10/imm32/curr 89/copy 3/mod/direct 0/rm32/eax . . . 4/r32/esp . . # copy esp to eax @@ -282,7 +282,7 @@ test-lookup-success: 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp # . save registers - # var heap/ebx : (ref allocation-descriptor) + # var heap/ebx : allocation-descriptor 68/push 0/imm32/limit 68/push 0/imm32/curr 89/copy 3/mod/direct 3/rm32/ebx . . . 4/r32/esp . . # copy esp to ebx @@ -294,7 +294,7 @@ test-lookup-success: e8/call new-segment/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp - # var handle/ecx : (ref handle) + # var handle/ecx : handle 68/push 0/imm32/address 68/push 0/imm32/alloc-id 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx @@ -350,7 +350,7 @@ test-lookup-failure: # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp - # var heap/esi : (ref allocation-descriptor) + # var heap/esi : allocation-descriptor 68/push 0/imm32/limit 68/push 0/imm32/curr 89/copy 3/mod/direct 6/rm32/esi . . . 4/r32/esp . . # copy esp to esi @@ -362,7 +362,7 @@ test-lookup-failure: e8/call new-segment/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp - # var h1/ecx : (ref handle) + # var h1/ecx : handle 68/push 0/imm32/address 68/push 0/imm32/alloc-id 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx @@ -381,7 +381,7 @@ test-lookup-failure: # reset heap->curr to mimic reclamation 89/copy 0/mod/indirect 6/rm32/esi . . . 3/r32/ebx . . # copy ebx to *esi # second allocation that returns the same address as the first - # var h2/edx : (ref handle) + # var h2/edx : handle 68/push 0/imm32/address 68/push 0/imm32/alloc-id 89/copy 3/mod/direct 2/rm32/edx . . . 4/r32/esp . . # copy esp to edx diff --git a/apps/hex.subx b/apps/hex.subx index d3af0105..4dd725e8 100644 --- a/apps/hex.subx +++ b/apps/hex.subx @@ -54,7 +54,7 @@ Entry: # run tests if necessary, convert stdin if not eb/jump $subx-hex-main:end/disp8 $subx-hex-main:interactive: # - otherwise convert stdin - # var ed/eax : (ref exit-descriptor) + # var ed/eax : exit-descriptor 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # subtract from esp 89/copy 3/mod/direct 0/rm32/eax . . . 4/r32/esp . . # copy esp to eax # configure ed to really exit() @@ -247,7 +247,7 @@ test-convert-next-octet: # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # initialize exit-descriptor 'ed' for the call to 'convert-next-octet' below - # . var ed/ecx : (ref exit-descriptor) + # . var ed/ecx : exit-descriptor 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # subtract from esp 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx # . tailor-exit-descriptor(ed, 12) @@ -337,7 +337,7 @@ test-convert-next-octet-handles-Eof: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # don't initialize '_test-stream' # initialize exit-descriptor 'ed' for the call to 'convert-next-octet' below - # . var ed/ecx : (ref exit-descriptor) + # . var ed/ecx : exit-descriptor 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # subtract from esp 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx # . tailor-exit-descriptor(ed, 12) @@ -435,7 +435,7 @@ test-convert-next-octet-aborts-on-single-hex-byte: # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # initialize exit-descriptor 'ed' for the call to 'convert-next-octet' below - # . var ed/ecx : (ref exit-descriptor) + # . var ed/ecx : exit-descriptor 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # subtract from esp 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx # . tailor-exit-descriptor(ed, 12) @@ -604,7 +604,7 @@ test-scan-next-byte: # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # initialize exit-descriptor 'ed' for the call to 'scan-next-byte' below - # . var ed/ecx : (ref exit-descriptor) + # . var ed/ecx : exit-descriptor 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # subtract from esp 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx # . tailor-exit-descriptor(ed, 12) @@ -702,7 +702,7 @@ test-scan-next-byte-skips-whitespace: # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # initialize exit-descriptor 'ed' for the call to 'scan-next-byte' below - # . var ed/ecx : (ref exit-descriptor) + # . var ed/ecx : exit-descriptor 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # subtract from esp 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx # . tailor-exit-descriptor(ed, 12) @@ -808,7 +808,7 @@ test-scan-next-byte-skips-comment: # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # initialize exit-descriptor 'ed' for the call to 'scan-next-byte' below - # . var ed/ecx : (ref exit-descriptor) + # . var ed/ecx : exit-descriptor 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # subtract from esp 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx # . tailor-exit-descriptor(ed, 12) @@ -914,7 +914,7 @@ test-scan-next-byte-skips-comment-and-whitespace: # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # initialize exit-descriptor 'ed' for the call to 'scan-next-byte' below - # . var ed/ecx : (ref exit-descriptor) + # . var ed/ecx : exit-descriptor 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # subtract from esp 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx # . tailor-exit-descriptor(ed, 12) @@ -1022,7 +1022,7 @@ test-scan-next-byte-skips-whitespace-and-comment: # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # initialize exit-descriptor 'ed' for the call to 'scan-next-byte' below - # . var ed/ecx : (ref exit-descriptor) + # . var ed/ecx : exit-descriptor 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # subtract from esp 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx # . tailor-exit-descriptor(ed, 12) @@ -1120,7 +1120,7 @@ test-scan-next-byte-reads-final-byte: # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # initialize exit-descriptor 'ed' for the call to 'scan-next-byte' below - # . var ed/ecx : (ref exit-descriptor) + # . var ed/ecx : exit-descriptor 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # subtract from esp 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx # . tailor-exit-descriptor(ed, 12) @@ -1210,7 +1210,7 @@ test-scan-next-byte-handles-Eof: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # leave '_test-stream' empty # initialize exit-descriptor 'ed' for the call to 'scan-next-byte' below - # . var ed/ecx : (ref exit-descriptor) + # . var ed/ecx : exit-descriptor 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # subtract from esp 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx # . tailor-exit-descriptor(ed, 12) @@ -1308,7 +1308,7 @@ test-scan-next-byte-aborts-on-invalid-byte: # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # initialize exit-descriptor 'ed' for the call to 'scan-next-byte' below - # . var ed/ecx : (ref exit-descriptor) + # . var ed/ecx : exit-descriptor 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # subtract from esp 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx # . tailor-exit-descriptor(ed, 12) diff --git a/apps/mu.subx b/apps/mu.subx index 404d4b17..df3c8447 100644 --- a/apps/mu.subx +++ b/apps/mu.subx @@ -64,8 +64,8 @@ # } # # - variable definitions on the stack. E.g.: -# - var foo: (ref int) -# - var bar: (ref array int 3) +# - var foo: int +# - var bar: (array int 3) # There's no initializer; variables are automatically initialized. # The type of a local variable is either word-length (4 bytes) or starts with 'ref'. # @@ -246,7 +246,7 @@ == data -Program: # (ref (handle function)) +Program: # (handle function) 0/imm32 Function-name: @@ -971,8 +971,8 @@ test-convert-function-call-with-literal-arg: parse-mu: # in : (addr buffered-file) # pseudocode # var curr-function : (addr (handle function)) = Program - # var line : (ref stream byte 512) - # var word-slice : (ref slice) + # var line : (stream byte 512) + # var word-slice : slice # while true # line loop # clear-stream(line) # read-line-buffered(in, line) @@ -984,7 +984,7 @@ parse-mu: # in : (addr buffered-file) # continue # end of line # else if slice-equal(word-slice, "fn") # var new-function : (handle function) = allocate(function) - # var vars : (ref stack (addr var) 256) + # var vars : (stack (addr var) 256) # populate-mu-function-header(in, new-function, vars) # populate-mu-function-body(in, new-function, vars) # assert(vars->top == 0) @@ -1002,19 +1002,19 @@ parse-mu: # in : (addr buffered-file) 52/push-edx 53/push-ebx 57/push-edi - # var line/ecx : (ref stream byte 512) + # var line/ecx : (stream byte 512) 81 5/subop/subtract %esp 0x200/imm32 68/push 0x200/imm32/length 68/push 0/imm32/read 68/push 0/imm32/write 89/<- %ecx 4/r32/esp - # var word-slice/edx : (ref slice) + # var word-slice/edx : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/<- %edx 4/r32/esp # var curr-function/edi : (addr (handle function)) = Program bf/copy-to-edi Program/imm32 - # var vars/ebx : (ref stack (addr var) 256) + # var vars/ebx : (stack (addr var) 256) 81 5/subop/subtract %esp 0x400/imm32 68/push 0x400/imm32/length 68/push 0/imm32/top @@ -1118,7 +1118,7 @@ $parse-mu:error2: # ✓ fn foo x: int -> y/eax: int { populate-mu-function-header: # first-line : (addr stream byte), out : (handle function), vars : (addr stack (handle var)) # pseudocode: - # var name : (ref slice) + # var name : slice # next-word(first-line, name) # assert(name not in '{' '}' '->') # out->name = slice-to-string(name) @@ -1157,7 +1157,7 @@ populate-mu-function-header: # first-line : (addr stream byte), out : (handle f 57/push-edi # edi = out 8b/-> *(ebp+0xc) 7/r32/edi - # var word-slice/ecx : (ref slice) + # var word-slice/ecx : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/<- %ecx 4/r32/esp @@ -1309,11 +1309,11 @@ test-function-header-with-arg: # setup (clear-stream _test-input-stream) (write _test-input-stream "foo n : int {\n") - # result/ecx : (ref function) + # result/ecx : function 2b/subtract-> *Function-size 4/r32/esp 89/<- %ecx 4/r32/esp (zero-out %ecx *Function-size) - # var vars/ebx : (ref stack (addr var) 16) + # var vars/ebx : (stack (addr var) 16) 81 5/subop/subtract %esp 0x10/imm32 68/push 0x10/imm32/length 68/push 0/imm32/top @@ -1345,7 +1345,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 (addr var) 16) + # var vars/ebx : (stack (addr var) 16) 81 5/subop/subtract %esp 0x10/imm32 68/push 0x10/imm32/length 68/push 0/imm32/top @@ -1392,7 +1392,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 (addr var) 16) + # var vars/ebx : (stack (addr var) 16) 81 5/subop/subtract %esp 0x10/imm32 68/push 0x10/imm32/length 68/push 0/imm32/top @@ -1446,7 +1446,7 @@ test-function-with-multiple-args-and-outputs: 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) + # var s : slice # next-token-from-slice(name->start, name->end, '/', s) # var end : (addr byte) = s->end # if (slice-ends-with(s, ":")) @@ -1488,7 +1488,7 @@ parse-var-with-type: # name: (addr slice), first-line: (addr stream byte) -> re 89/<- %edi 0/r32/eax # esi = name 8b/-> *(ebp+8) 6/r32/esi - # var s/ecx : (ref slice) + # var s/ecx : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/<- %ecx 4/r32/esp @@ -1757,7 +1757,7 @@ test-parse-var-with-type: 8b/-> *eax 1/r32/ecx 8d/copy-address *(eax+ecx+4) 1/r32/ecx 05/add-to-eax 4/imm32 - # var slice/ecx : (ref slice) = {eax, ecx} + # var slice/ecx : slice = {eax, ecx} 51/push-ecx 50/push-eax 89/<- %ecx 4/r32/esp @@ -1784,7 +1784,7 @@ test-parse-var-with-type-and-register: 8b/-> *eax 1/r32/ecx 8d/copy-address *(eax+ecx+4) 1/r32/ecx 05/add-to-eax 4/imm32 - # var slice/ecx : (ref slice) = {eax, ecx} + # var slice/ecx : slice = {eax, ecx} 51/push-ecx 50/push-eax 89/<- %ecx 4/r32/esp @@ -1813,7 +1813,7 @@ test-parse-var-with-trailing-characters: 8b/-> *eax 1/r32/ecx 8d/copy-address *(eax+ecx+4) 1/r32/ecx 05/add-to-eax 4/imm32 - # var slice/ecx : (ref slice) = {eax, ecx} + # var slice/ecx : slice = {eax, ecx} 51/push-ecx 50/push-eax 89/<- %ecx 4/r32/esp @@ -1842,7 +1842,7 @@ test-parse-var-with-register-and-trailing-characters: 8b/-> *eax 1/r32/ecx 8d/copy-address *(eax+ecx+4) 1/r32/ecx 05/add-to-eax 4/imm32 - # var slice/ecx : (ref slice) = {eax, ecx} + # var slice/ecx : slice = {eax, ecx} 51/push-ecx 50/push-eax 89/<- %ecx 4/r32/esp @@ -1913,7 +1913,7 @@ test-is-identifier-dollar: 8b/-> *eax 1/r32/ecx 8d/copy-address *(eax+ecx+4) 1/r32/ecx 05/add-to-eax 4/imm32 - # var slice/ecx : (ref slice) = {eax, ecx} + # var slice/ecx : slice = {eax, ecx} 51/push-ecx 50/push-eax 89/<- %ecx 4/r32/esp @@ -1934,7 +1934,7 @@ test-is-identifier-underscore: 8b/-> *eax 1/r32/ecx 8d/copy-address *(eax+ecx+4) 1/r32/ecx 05/add-to-eax 4/imm32 - # var slice/ecx : (ref slice) = {eax, ecx} + # var slice/ecx : slice = {eax, ecx} 51/push-ecx 50/push-eax 89/<- %ecx 4/r32/esp @@ -1955,7 +1955,7 @@ test-is-identifier-a: 8b/-> *eax 1/r32/ecx 8d/copy-address *(eax+ecx+4) 1/r32/ecx 05/add-to-eax 4/imm32 - # var slice/ecx : (ref slice) = {eax, ecx} + # var slice/ecx : slice = {eax, ecx} 51/push-ecx 50/push-eax 89/<- %ecx 4/r32/esp @@ -1976,7 +1976,7 @@ test-is-identifier-z: 8b/-> *eax 1/r32/ecx 8d/copy-address *(eax+ecx+4) 1/r32/ecx 05/add-to-eax 4/imm32 - # var slice/ecx : (ref slice) = {eax, ecx} + # var slice/ecx : slice = {eax, ecx} 51/push-ecx 50/push-eax 89/<- %ecx 4/r32/esp @@ -1997,7 +1997,7 @@ test-is-identifier-A: 8b/-> *eax 1/r32/ecx 8d/copy-address *(eax+ecx+4) 1/r32/ecx 05/add-to-eax 4/imm32 - # var slice/ecx : (ref slice) = {eax, ecx} + # var slice/ecx : slice = {eax, ecx} 51/push-ecx 50/push-eax 89/<- %ecx 4/r32/esp @@ -2018,7 +2018,7 @@ test-is-identifier-Z: 8b/-> *eax 1/r32/ecx 8d/copy-address *(eax+ecx+4) 1/r32/ecx 05/add-to-eax 4/imm32 - # var slice/ecx : (ref slice) = {eax, ecx} + # var slice/ecx : slice = {eax, ecx} 51/push-ecx 50/push-eax 89/<- %ecx 4/r32/esp @@ -2040,7 +2040,7 @@ test-is-identifier-@: 8b/-> *eax 1/r32/ecx 8d/copy-address *(eax+ecx+4) 1/r32/ecx 05/add-to-eax 4/imm32 - # var slice/ecx : (ref slice) = {eax, ecx} + # var slice/ecx : slice = {eax, ecx} 51/push-ecx 50/push-eax 89/<- %ecx 4/r32/esp @@ -2062,7 +2062,7 @@ test-is-identifier-square-bracket: 8b/-> *eax 1/r32/ecx 8d/copy-address *(eax+ecx+4) 1/r32/ecx 05/add-to-eax 4/imm32 - # var slice/ecx : (ref slice) = {eax, ecx} + # var slice/ecx : slice = {eax, ecx} 51/push-ecx 50/push-eax 89/<- %ecx 4/r32/esp @@ -2084,7 +2084,7 @@ test-is-identifier-backtick: 8b/-> *eax 1/r32/ecx 8d/copy-address *(eax+ecx+4) 1/r32/ecx 05/add-to-eax 4/imm32 - # var slice/ecx : (ref slice) = {eax, ecx} + # var slice/ecx : slice = {eax, ecx} 51/push-ecx 50/push-eax 89/<- %ecx 4/r32/esp @@ -2106,7 +2106,7 @@ test-is-identifier-curly-brace-open: 8b/-> *eax 1/r32/ecx 8d/copy-address *(eax+ecx+4) 1/r32/ecx 05/add-to-eax 4/imm32 - # var slice/ecx : (ref slice) = {eax, ecx} + # var slice/ecx : slice = {eax, ecx} 51/push-ecx 50/push-eax 89/<- %ecx 4/r32/esp @@ -2127,7 +2127,7 @@ test-is-identifier-curly-brace-close: 8b/-> *eax 1/r32/ecx 8d/copy-address *(eax+ecx+4) 1/r32/ecx 05/add-to-eax 4/imm32 - # var slice/ecx : (ref slice) = {eax, ecx} + # var slice/ecx : slice = {eax, ecx} 51/push-ecx 50/push-eax 89/<- %ecx 4/r32/esp @@ -2149,7 +2149,7 @@ test-is-identifier-hyphen: 8b/-> *eax 1/r32/ecx 8d/copy-address *(eax+ecx+4) 1/r32/ecx 05/add-to-eax 4/imm32 - # var slice/ecx : (ref slice) = {eax, ecx} + # var slice/ecx : slice = {eax, ecx} 51/push-ecx 50/push-eax 89/<- %ecx 4/r32/esp @@ -2190,8 +2190,8 @@ $populate-mu-function-body:end: # parses a block, assuming that the leading '{' has already been read by the caller 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) + # var line : (stream byte 512) + # var word-slice : slice # result/eax = allocate(Heap, Stmt-size) # result->tag = 0/Block # while true # line loop @@ -2228,13 +2228,13 @@ parse-mu-block: # in : (addr buffered-file), vars : (addr stack (handle var)), 52/push-edx 53/push-ebx 57/push-edi - # var line/ecx : (ref stream byte 512) + # var line/ecx : (stream byte 512) 81 5/subop/subtract %esp 0x200/imm32 68/push 0x200/imm32/length 68/push 0/imm32/read 68/push 0/imm32/write 89/<- %ecx 4/r32/esp - # var word-slice/edx : (ref slice) + # var word-slice/edx : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/<- %edx 4/r32/esp @@ -2356,7 +2356,7 @@ check-no-tokens-left: # line : (addr stream byte) # . save registers 50/push-eax 51/push-ecx - # var s/ecx : (ref slice) + # var s/ecx : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/<- %ecx 4/r32/esp @@ -2398,8 +2398,8 @@ $check-no-tokens-left:end: 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) + # var line : (stream byte 512) + # var word-slice : slice # result/eax = allocate(Heap, Stmt-size) # result->tag = 4/Named-block # result->name = name @@ -2457,7 +2457,7 @@ $parse-mu-var-def:end: parse-mu-stmt: # line : (addr stream byte), vars : (addr stack (handle var)), fn : (handle function) -> result/eax : (handle stmt) # pseudocode: - # var name : (ref slice) + # var name : slice # result = allocate(Heap, Stmt-size) # if stmt-has-outputs?(line) # while true @@ -2478,7 +2478,7 @@ parse-mu-stmt: # line : (addr stream byte), vars : (addr stack (handle var)), f # . save registers 51/push-ecx 57/push-edi - # var name/ecx : (ref slice) + # var name/ecx : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/<- %ecx 4/r32/esp @@ -2581,7 +2581,7 @@ stmt-has-outputs?: # line : (addr stream byte) -> result/eax : boolean 89/<- %ebp 4/r32/esp # . save registers 51/push-ecx - # var word-slice/ecx : (ref slice) + # var word-slice/ecx : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/<- %ecx 4/r32/esp @@ -2840,13 +2840,13 @@ test-parse-mu-stmt: # setup (clear-stream _test-input-stream) (write _test-input-stream "increment n\n") - # var vars/ecx : (ref stack (addr var) 4) + # var vars/ecx : (stack (addr var) 4) 81 5/subop/subtract %esp 0x10/imm32 68/push 0x10/imm32/length 68/push 0/imm32/top 89/<- %ecx 4/r32/esp (clear-stack %ecx) - # var v/edx : (ref var) + # var v/edx : var 81 5/subop/subtract %esp 0x14/imm32 # Var-size 89/<- %edx 4/r32/esp (zero-out %edx 0x14) @@ -4608,25 +4608,25 @@ test-emit-subx-statement-primitive: # setup (clear-stream _test-output-stream) (clear-stream $_test-output-buffered-file->buffer) - # var var-foo/ecx : (ref var) + # var var-foo/ecx : var 68/push 0/imm32/no-register 68/push -8/imm32/stack-offset 68/push 1/imm32/block-depth 68/push 1/imm32/type-int 68/push "foo"/imm32 89/<- %ecx 4/r32/esp - # var operand/ebx : (ref list var) + # var operand/ebx : (list var) 68/push 0/imm32/next 51/push-ecx/var-foo 89/<- %ebx 4/r32/esp - # var stmt/esi : (ref statement) + # var stmt/esi : statement 68/push 0/imm32/next 68/push 0/imm32/outputs 53/push-ebx/operands 68/push "increment"/imm32/operation 68/push 1/imm32 89/<- %esi 4/r32/esp - # var primitives/ebx : (ref primitive) + # var primitives/ebx : primitive 68/push 0/imm32/next 68/push 0/imm32/output-is-write-only 68/push 0/imm32/no-imm32 @@ -4677,36 +4677,36 @@ test-emit-subx-statement-primitive-register: # setup (clear-stream _test-output-stream) (clear-stream $_test-output-buffered-file->buffer) - # var var-foo/ecx : (ref var) in eax + # var var-foo/ecx : var in eax 68/push "eax"/imm32/register 68/push 0/imm32/no-stack-offset 68/push 1/imm32/block-depth 68/push 1/imm32/type-int 68/push "foo"/imm32 89/<- %ecx 4/r32/esp - # var operand/ebx : (ref list var) + # var operand/ebx : (list var) 68/push 0/imm32/next 51/push-ecx/var-foo 89/<- %ebx 4/r32/esp - # var stmt/esi : (ref statement) + # var stmt/esi : statement 68/push 0/imm32/next 53/push-ebx/outputs 68/push 0/imm32/inouts 68/push "increment"/imm32/operation 68/push 1/imm32 89/<- %esi 4/r32/esp - # var formal-var/ebx : (ref var) in any register + # var formal-var/ebx : var in any register 68/push Any-register/imm32 68/push 0/imm32/no-stack-offset 68/push 1/imm32/block-depth 68/push 1/imm32/type-int 68/push "dummy"/imm32 89/<- %ebx 4/r32/esp - # var operand/ebx : (ref list var) + # var operand/ebx : (list var) 68/push 0/imm32/next 53/push-ebx/formal-var 89/<- %ebx 4/r32/esp - # var primitives/ebx : (ref primitive) + # var primitives/ebx : primitive 68/push 0/imm32/next 68/push 0/imm32/output-is-write-only 68/push 0/imm32/no-imm32 @@ -4760,36 +4760,36 @@ test-emit-subx-statement-select-primitive: # setup (clear-stream _test-output-stream) (clear-stream $_test-output-buffered-file->buffer) - # var var-foo/ecx : (ref var) in eax + # var var-foo/ecx : var in eax 68/push "eax"/imm32/register 68/push 0/imm32/no-stack-offset 68/push 1/imm32/block-depth 68/push 1/imm32/type-int 68/push "foo"/imm32 89/<- %ecx 4/r32/esp - # var real-outputs/edi : (ref list var) + # var real-outputs/edi : (list var) 68/push 0/imm32/next 51/push-ecx/var-foo 89/<- %edi 4/r32/esp - # var stmt/esi : (ref statement) + # var stmt/esi : statement 68/push 0/imm32/next 57/push-edi/outputs 68/push 0/imm32/inouts 68/push "increment"/imm32/operation 68/push 1/imm32 89/<- %esi 4/r32/esp - # var formal-var/ebx : (ref var) in any register + # var formal-var/ebx : var in any register 68/push Any-register/imm32 68/push 0/imm32/no-stack-offset 68/push 1/imm32/block-depth 68/push 1/imm32/type-int 68/push "dummy"/imm32 89/<- %ebx 4/r32/esp - # var formal-outputs/ebx : (ref list var) = {formal-var, 0} + # var formal-outputs/ebx : (list var) = {formal-var, 0} 68/push 0/imm32/next 53/push-ebx/formal-var 89/<- %ebx 4/r32/esp - # var primitive1/ebx : (ref primitive) + # var primitive1/ebx : primitive 68/push 0/imm32/next 68/push 0/imm32/output-is-write-only 68/push 0/imm32/no-imm32 @@ -4800,7 +4800,7 @@ test-emit-subx-statement-select-primitive: 68/push 0/imm32/inouts 68/push "increment"/imm32/name 89/<- %ebx 4/r32/esp - # var primitives/ebx : (ref primitive) + # var primitives/ebx : primitive 53/push-ebx/next 68/push 0/imm32/output-is-write-only 68/push 0/imm32/no-imm32 @@ -4854,32 +4854,32 @@ test-emit-subx-statement-select-primitive-2: # setup (clear-stream _test-output-stream) (clear-stream $_test-output-buffered-file->buffer) - # var var-foo/ecx : (ref var) in eax + # var var-foo/ecx : var in eax 68/push "eax"/imm32/register 68/push 0/imm32/no-stack-offset 68/push 1/imm32/block-depth 68/push 1/imm32/type-int 68/push "foo"/imm32 89/<- %ecx 4/r32/esp - # var inouts/edi : (ref list var) + # var inouts/edi : (list var) 68/push 0/imm32/next 51/push-ecx/var-foo 89/<- %edi 4/r32/esp - # var stmt/esi : (ref statement) + # var stmt/esi : statement 68/push 0/imm32/next 68/push 0/imm32/outputs 57/push-edi/inouts 68/push "increment"/imm32/operation 68/push 1/imm32 89/<- %esi 4/r32/esp - # var formal-var/ebx : (ref var) in any register + # var formal-var/ebx : var in any register 68/push Any-register/imm32 68/push 0/imm32/no-stack-offset 68/push 1/imm32/block-depth 68/push 1/imm32/type-int 68/push "dummy"/imm32 89/<- %ebx 4/r32/esp - # var operand/ebx : (ref list var) + # var operand/ebx : (list var) 68/push 0/imm32/next 53/push-ebx/formal-var 89/<- %ebx 4/r32/esp @@ -4894,7 +4894,7 @@ test-emit-subx-statement-select-primitive-2: 68/push 0/imm32/inouts 68/push "increment"/imm32/name 89/<- %ebx 4/r32/esp - # var primitives/ebx : (ref primitive) + # var primitives/ebx : primitive 53/push-ebx/next 68/push 0/imm32/output-is-write-only 68/push 0/imm32/no-imm32 @@ -4942,18 +4942,18 @@ test-increment-register: # setup (clear-stream _test-output-stream) (clear-stream $_test-output-buffered-file->buffer) - # var var-foo/ecx : (ref var) in eax + # var var-foo/ecx : var in eax 68/push "eax"/imm32/register 68/push 0/imm32/no-stack-offset 68/push 1/imm32/block-depth 68/push 1/imm32/type-int 68/push "foo"/imm32 89/<- %ecx 4/r32/esp - # var real-outputs/edi : (ref list var) + # var real-outputs/edi : (list var) 68/push 0/imm32/next 51/push-ecx/var-foo 89/<- %edi 4/r32/esp - # var stmt/esi : (ref statement) + # var stmt/esi : statement 68/push 0/imm32/next 57/push-edi/outputs 68/push 0/imm32/inouts @@ -4997,18 +4997,18 @@ test-increment-var: # setup (clear-stream _test-output-stream) (clear-stream $_test-output-buffered-file->buffer) - # var var-foo/ecx : (ref var) in eax + # var var-foo/ecx : var in eax 68/push "eax"/imm32/register 68/push 0/imm32/no-stack-offset 68/push 1/imm32/block-depth 68/push 1/imm32/type-int 68/push "foo"/imm32 89/<- %ecx 4/r32/esp - # var inouts/edi : (ref list var) + # var inouts/edi : (list var) 68/push 0/imm32/next 51/push-ecx/var-foo 89/<- %edi 4/r32/esp - # var stmt/esi : (ref statement) + # var stmt/esi : statement 68/push 0/imm32/next 68/push 0/imm32/outputs 57/push-edi/inouts @@ -5042,29 +5042,29 @@ test-add-reg-to-reg: # setup (clear-stream _test-output-stream) (clear-stream $_test-output-buffered-file->buffer) - # var var-var1/ecx : (ref var) in eax + # var var-var1/ecx : var in eax 68/push "eax"/imm32/register 68/push 0/imm32/no-stack-offset 68/push 1/imm32/block-depth 68/push 1/imm32/type-int 68/push "var1"/imm32 89/<- %ecx 4/r32/esp - # var var-var2/edx : (ref var) in ecx + # var var-var2/edx : var in ecx 68/push "ecx"/imm32/register 68/push 0/imm32/no-stack-offset 68/push 1/imm32/block-depth 68/push 1/imm32/type-int 68/push "var2"/imm32 89/<- %edx 4/r32/esp - # var inouts/esi : (ref list var2) + # var inouts/esi : (list var2) 68/push 0/imm32/next 52/push-edx/var-var2 89/<- %esi 4/r32/esp - # var outputs/edi : (ref list var1) + # var outputs/edi : (list var1) 68/push 0/imm32/next 51/push-ecx/var-var1 89/<- %edi 4/r32/esp - # var stmt/esi : (ref statement) + # var stmt/esi : statement 68/push 0/imm32/next 57/push-edi/outputs 56/push-esi/inouts @@ -5098,29 +5098,29 @@ test-add-reg-to-mem: # setup (clear-stream _test-output-stream) (clear-stream $_test-output-buffered-file->buffer) - # var var-var1/ecx : (ref var) + # var var-var1/ecx : var 68/push 0/imm32/no-register 68/push 8/imm32/stack-offset 68/push 1/imm32/block-depth 68/push 1/imm32/type-int 68/push "var1"/imm32 89/<- %ecx 4/r32/esp - # var var-var2/edx : (ref var) in ecx + # var var-var2/edx : var in ecx 68/push "ecx"/imm32/register 68/push 0/imm32/no-stack-offset 68/push 1/imm32/block-depth 68/push 1/imm32/type-int 68/push "var2"/imm32 89/<- %edx 4/r32/esp - # var inouts/esi : (ref list var2) + # var inouts/esi : (list var2) 68/push 0/imm32/next 52/push-edx/var-var2 89/<- %esi 4/r32/esp - # var inouts = (ref list var1 var2) + # var inouts = (list var1 var2) 56/push-esi/next 51/push-ecx/var-var1 89/<- %esi 4/r32/esp - # var stmt/esi : (ref statement) + # var stmt/esi : statement 68/push 0/imm32/next 68/push 0/imm32/outputs 56/push-esi/inouts @@ -5154,29 +5154,29 @@ test-add-mem-to-reg: # setup (clear-stream _test-output-stream) (clear-stream $_test-output-buffered-file->buffer) - # var var-var1/ecx : (ref var) in eax + # var var-var1/ecx : var in eax 68/push "eax"/imm32/register 68/push 0/imm32/no-stack-offset 68/push 1/imm32/block-depth 68/push 1/imm32/type-int 68/push "var1"/imm32 89/<- %ecx 4/r32/esp - # var var-var2/edx : (ref var) + # var var-var2/edx : var 68/push 0/imm32/no-register 68/push 8/imm32/stack-offset 68/push 1/imm32/block-depth 68/push 1/imm32/type-int 68/push "var2"/imm32 89/<- %edx 4/r32/esp - # var inouts/esi : (ref list var2) + # var inouts/esi : (list var2) 68/push 0/imm32/next 52/push-edx/var-var2 89/<- %esi 4/r32/esp - # var outputs/edi : (ref list var1) + # var outputs/edi : (list var1) 68/push 0/imm32/next 51/push-ecx/var-var1 89/<- %edi 4/r32/esp - # var stmt/esi : (ref statement) + # var stmt/esi : statement 68/push 0/imm32/next 57/push-edi/outputs 56/push-esi/inouts @@ -5210,29 +5210,29 @@ test-add-literal-to-eax: # setup (clear-stream _test-output-stream) (clear-stream $_test-output-buffered-file->buffer) - # var var-var1/ecx : (ref var) in eax + # var var-var1/ecx : var in eax 68/push "eax"/imm32/register 68/push 0/imm32/no-stack-offset 68/push 1/imm32/block-depth 68/push 1/imm32/type-int 68/push "var1"/imm32 89/<- %ecx 4/r32/esp - # var var-var2/edx : (ref var) literal + # var var-var2/edx : var literal 68/push 0/imm32/no-register 68/push 0/imm32/no-stack-offset 68/push 1/imm32/block-depth 68/push 0/imm32/type-literal 68/push "0x34"/imm32 89/<- %edx 4/r32/esp - # var inouts/esi : (ref list var2) + # var inouts/esi : (list var2) 68/push 0/imm32/next 52/push-edx/var-var2 89/<- %esi 4/r32/esp - # var outputs/edi : (ref list var1) + # var outputs/edi : (list var1) 68/push 0/imm32/next 51/push-ecx/var-var1 89/<- %edi 4/r32/esp - # var stmt/esi : (ref statement) + # var stmt/esi : statement 68/push 0/imm32/next 57/push-edi/outputs 56/push-esi/inouts @@ -5266,29 +5266,29 @@ test-add-literal-to-reg: # setup (clear-stream _test-output-stream) (clear-stream $_test-output-buffered-file->buffer) - # var var-var1/ecx : (ref var) in ecx + # var var-var1/ecx : var in ecx 68/push "ecx"/imm32/register 68/push 0/imm32/no-stack-offset 68/push 1/imm32/block-depth 68/push 1/imm32/type-int 68/push "var1"/imm32 89/<- %ecx 4/r32/esp - # var var-var2/edx : (ref var) literal + # var var-var2/edx : var literal 68/push 0/imm32/no-register 68/push 0/imm32/no-stack-offset 68/push 1/imm32/block-depth 68/push 0/imm32/type-literal 68/push "0x34"/imm32 89/<- %edx 4/r32/esp - # var inouts/esi : (ref list var2) + # var inouts/esi : (list var2) 68/push 0/imm32/next 52/push-edx/var-var2 89/<- %esi 4/r32/esp - # var outputs/edi : (ref list var1) + # var outputs/edi : (list var1) 68/push 0/imm32/next 51/push-ecx/var-var1 89/<- %edi 4/r32/esp - # var stmt/esi : (ref statement) + # var stmt/esi : statement 68/push 0/imm32/next 57/push-edi/outputs 56/push-esi/inouts @@ -5322,29 +5322,29 @@ test-add-literal-to-mem: # setup (clear-stream _test-output-stream) (clear-stream $_test-output-buffered-file->buffer) - # var var-var1/ecx : (ref var) + # var var-var1/ecx : var 68/push 0/imm32/no-register 68/push 8/imm32/stack-offset 68/push 1/imm32/block-depth 68/push 1/imm32/type-int 68/push "var1"/imm32 89/<- %ecx 4/r32/esp - # var var-var2/edx : (ref var) literal + # var var-var2/edx : var literal 68/push 0/imm32/no-register 68/push 0/imm32/no-stack-offset 68/push 1/imm32/block-depth 68/push 0/imm32/type-literal 68/push "0x34"/imm32 89/<- %edx 4/r32/esp - # var inouts/esi : (ref list var2) + # var inouts/esi : (list var2) 68/push 0/imm32/next 52/push-edx/var-var2 89/<- %esi 4/r32/esp - # var inouts = (ref list var1 inouts) + # var inouts = (list var1 inouts) 56/push-esi/next 51/push-ecx/var-var1 89/<- %esi 4/r32/esp - # var stmt/esi : (ref statement) + # var stmt/esi : statement 68/push 0/imm32/next 68/push 0/imm32/outputs 56/push-esi/inouts @@ -5393,25 +5393,25 @@ test-emit-subx-statement-function-call: # setup (clear-stream _test-output-stream) (clear-stream $_test-output-buffered-file->buffer) - # var var-foo/ecx : (ref var) + # var var-foo/ecx : var 68/push 0/imm32/no-register 68/push -8/imm32/stack-offset 68/push 0/imm32/block-depth 68/push 1/imm32/type-int 68/push "foo"/imm32 89/<- %ecx 4/r32/esp - # var operands/esi : (ref list var) + # var operands/esi : (list var) 68/push 0/imm32/next 51/push-ecx/var-foo 89/<- %esi 4/r32/esp - # var stmt/esi : (ref statement) + # var stmt/esi : statement 68/push 0/imm32/next 68/push 0/imm32/outputs 56/push-esi/inouts 68/push "f"/imm32/operation 68/push 1/imm32 89/<- %esi 4/r32/esp - # var functions/ebx : (ref function) + # var functions/ebx : function 68/push 0/imm32/next 68/push 0/imm32/body 68/push 0/imm32/outputs @@ -5447,25 +5447,25 @@ test-emit-subx-statement-function-call-with-literal-arg: # setup (clear-stream _test-output-stream) (clear-stream $_test-output-buffered-file->buffer) - # var var-foo/ecx : (ref var) literal + # var var-foo/ecx : var literal 68/push 0/imm32/no-register 68/push 0/imm32/no-stack-offset 68/push 0/imm32/block-depth 68/push 0/imm32/type-literal 68/push "34"/imm32 89/<- %ecx 4/r32/esp - # var operands/esi : (ref list var) + # var operands/esi : (list var) 68/push 0/imm32/next 51/push-ecx/var-foo 89/<- %esi 4/r32/esp - # var stmt/esi : (ref statement) + # var stmt/esi : statement 68/push 0/imm32/next 68/push 0/imm32/outputs 56/push-esi/inouts 68/push "f"/imm32/operation 68/push 1/imm32 89/<- %esi 4/r32/esp - # var functions/ebx : (ref function) + # var functions/ebx : function 68/push 0/imm32/next 68/push 0/imm32/body 68/push 0/imm32/outputs diff --git a/apps/mulisp.subx b/apps/mulisp.subx index 252b0583..87479ffe 100644 --- a/apps/mulisp.subx +++ b/apps/mulisp.subx @@ -110,7 +110,7 @@ lisp-read: # in : (addr buffered-file) -> eax : (handle cell) 89/<- %ebp 4/r32/esp # . save registers 51/push-ecx - # var s/ecx : (ref stream byte 512) + # var s/ecx : (stream byte 512) 81 5/subop/subtract %esp 0x200/imm32 68/push 0x200/imm32/size 68/push 0/imm32/read diff --git a/apps/pack.subx b/apps/pack.subx index 5d5d8033..68be16aa 100644 --- a/apps/pack.subx +++ b/apps/pack.subx @@ -55,7 +55,7 @@ Entry: # run tests if necessary, convert stdin if not eb/jump $subx-pack-main:end/disp8 $subx-pack-main:interactive: # - otherwise convert stdin - # var ed/eax : (ref exit-descriptor) + # var ed/eax : exit-descriptor 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # subtract from esp 89/copy 3/mod/direct 0/rm32/eax . . . 4/r32/esp . . # copy esp to eax # configure ed to really exit() @@ -99,7 +99,7 @@ $subx-pack-main:end: subx-pack: # in : (addr buffered-file), out : (addr buffered-file) # pseudocode: - # var line : (ref stream byte 512) + # var line : (stream byte 512) # var in-code? = false # while true # clear-stream(line) @@ -128,13 +128,13 @@ subx-pack: # in : (addr buffered-file), out : (addr buffered-file) 51/push-ecx 52/push-edx 53/push-ebx - # var line/ecx : (ref stream byte 512) + # var line/ecx : (stream byte 512) 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 0x200/imm32 # subtract from esp 68/push 0x200/imm32/length 68/push 0/imm32/read 68/push 0/imm32/write 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx - # var word-slice/edx : (ref slice) + # var word-slice/edx : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/copy 3/mod/direct 2/rm32/edx . . . 4/r32/esp . . # copy esp to edx @@ -911,7 +911,7 @@ test-subx-pack-code-and-data-segments: convert-data: # line : (addr stream byte), out : (addr buffered-file) # pseudocode: - # var word-slice : (ref slice) + # var word-slice : slice # while true # word-slice = next-word(line) # if slice-empty?(word-slice) # end of file (maybe including trailing whitespace) @@ -936,7 +936,7 @@ convert-data: # line : (addr stream byte), out : (addr buffered-file) 50/push-eax 51/push-ecx 52/push-edx - # var word-slice/ecx : (ref slice) + # var word-slice/ecx : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx @@ -1837,7 +1837,7 @@ convert-instruction: # line : (addr stream byte), out : (addr buffered-file) 50/push-eax 51/push-ecx 52/push-edx - # var word-slice/ecx : (ref slice) + # var word-slice/ecx : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx @@ -1994,11 +1994,11 @@ emit-opcodes: # line : (addr stream byte), out : (addr buffered-file) 51/push-ecx 52/push-edx 53/push-ebx - # var op1/ecx : (ref slice) + # var op1/ecx : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx - # var op2/edx : (ref slice) + # var op2/edx : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/copy 3/mod/direct 2/rm32/edx . . . 4/r32/esp . . # copy esp to edx @@ -2253,7 +2253,7 @@ emit-modrm: # line : (addr stream byte), out : (addr buffered-file) # pseudocode: # rewind-stream(line) # var has-modrm? = false, mod = 0, rm32 = 0, r32 = 0 - # var word-slice : (ref slice) + # var word-slice : slice # while true # word-slice = next-word(line) # if (slice-empty?(word-slice)) break @@ -2285,7 +2285,7 @@ emit-modrm: # line : (addr stream byte), out : (addr buffered-file) 53/push-ebx 56/push-esi 57/push-edi - # var word-slice/ecx : (ref slice) + # var word-slice/ecx : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx @@ -2569,7 +2569,7 @@ $emit-modrm:end: 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) + # var word-slice : slice # while true # word-slice = next-word(line) # if (slice-empty?(word-slice)) break @@ -2601,7 +2601,7 @@ emit-sib: # line : (addr stream byte), out : (addr buffered-file) 53/push-ebx 56/push-esi 57/push-edi - # var word-slice/ecx : (ref slice) + # var word-slice/ecx : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx @@ -2850,7 +2850,7 @@ $emit-sib:end: emit-disp: # line : (addr stream byte), out : (addr buffered-file) # pseudocode: # rewind-stream(line) - # var word-slice : (ref slice) + # var word-slice : slice # while true # word-slice = next-word(line) # if (slice-empty?(word-slice)) break @@ -2872,7 +2872,7 @@ emit-disp: # line : (addr stream byte), out : (addr buffered-file) 50/push-eax 51/push-ecx 52/push-edx - # var word-slice/ecx : (ref slice) + # var word-slice/ecx : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx @@ -3069,7 +3069,7 @@ $emit-disp:break: emit-imm: # line : (addr stream byte), out : (addr buffered-file) # pseudocode: # rewind-stream(line) - # var word-slice : (ref slice) + # var word-slice : slice # while true # word-slice = next-word(line) # if (slice-empty?(word-slice)) break @@ -3091,7 +3091,7 @@ emit-imm: # line : (addr stream byte), out : (addr buffered-file) 50/push-eax 51/push-ecx 52/push-edx - # var word-slice/ecx : (ref slice) + # var word-slice/ecx : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx @@ -5846,7 +5846,7 @@ parse-datum-of-word: # word : (addr slice) -> value/eax : int 56/push-esi # esi = word 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 . # copy *(ebp+8) to esi - # var slice/ecx : (ref slice) + # var slice/ecx : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx diff --git a/apps/sigils.subx b/apps/sigils.subx index 485463d7..c1374c60 100644 --- a/apps/sigils.subx +++ b/apps/sigils.subx @@ -147,7 +147,7 @@ subx-sigils: # in : (addr buffered-file), out : (addr buffered-file) 68/push 0/imm32/read 68/push 0/imm32/write 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx - # var word-slice/edx : (ref slice) + # var word-slice/edx : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/copy 3/mod/direct 2/rm32/edx . . . 4/r32/esp . . # copy esp to edx @@ -1365,7 +1365,7 @@ emit-direct-mode: # out : (addr buffered-file), word-slice : (addr slice) 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp # . save registers 50/push-eax - # var local-slice/eax : (ref slice) = {word-slice->start, word-slice->end} + # var local-slice/eax : slice = {word-slice->start, word-slice->end} 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 0/r32/eax 0xc/disp8 . # copy *(ebp+12) to eax ff 6/subop/push 1/mod/*+disp8 0/rm32/eax . . . . 4/disp8 . # push *(eax+4) ff 6/subop/push 0/mod/indirect 0/rm32/eax . . . . . . # push *eax @@ -1834,7 +1834,7 @@ test-next-word-or-expression: e8/call clear-stream/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp - # var slice/ecx : (ref slice) + # var slice/ecx : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx @@ -1907,7 +1907,7 @@ test-next-word-or-expression-returns-whole-comment: e8/call clear-stream/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp - # var slice/ecx : (ref slice) + # var slice/ecx : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx @@ -1980,7 +1980,7 @@ test-next-word-or-expression-returns-empty-slice-on-eof: e8/call clear-stream/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp - # var slice/ecx : (ref slice) + # var slice/ecx : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx @@ -2022,7 +2022,7 @@ test-next-word-or-expression-returns-string-literal: e8/call clear-stream/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp - # var slice/ecx : (ref slice) + # var slice/ecx : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx @@ -2085,7 +2085,7 @@ test-next-word-or-expression-returns-string-with-escapes: e8/call clear-stream/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp - # var slice/ecx : (ref slice) + # var slice/ecx : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx @@ -2148,7 +2148,7 @@ test-next-word-or-expression-returns-whole-expression: e8/call clear-stream/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp - # var slice/ecx : (ref slice) + # var slice/ecx : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx @@ -2250,7 +2250,7 @@ parse-effective-address: # word-slice : (addr slice) -> base/eax, index/ecx, sc # . save registers 56/push-esi 57/push-edi - # var local-slice/esi : (ref slice) = {word-slice->start, word-slice->end} + # var local-slice/esi : slice = {word-slice->start, word-slice->end} 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 . # copy *(ebp+8) to esi ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 . # push *(esi+4) ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . . # push *esi @@ -2679,7 +2679,7 @@ next-register: # in : (addr slice) -> reg/eax : int 56/push-esi # esi = in 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 . # copy *(ebp+8) to esi - # var reg-slice/ecx : (ref slice) = {in->start, in->start + 3} + # var reg-slice/ecx : slice = {in->start, in->start + 3} 8b/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . . # copy *esi to eax 05/add-to-eax 3/imm32 50/push-eax @@ -3865,7 +3865,7 @@ disp32-mode?: # in : (addr slice) -> reg/eax : boolean # . save registers 56/push-esi 57/push-edi - # var local-slice/esi : (ref slice) = {in->start, in->end} + # var local-slice/esi : slice = {in->start, in->end} 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 . # copy *(ebp+8) to esi ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 . # push *(esi+4) ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . . # push *esi @@ -3923,7 +3923,7 @@ emit-indirect-disp32: # out : (addr buffered-file), word-slice : (addr slice) 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp # . save registers 56/push-esi - # var local-slice/esi : (ref slice) = {in->start, in->end} + # var local-slice/esi : slice = {in->start, in->end} 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 0xc/disp8 . # copy *(ebp+12) to esi ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 . # push *(esi+4) ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . . # push *esi diff --git a/apps/survey.subx b/apps/survey.subx index 7983e6c5..caedc77a 100644 --- a/apps/survey.subx +++ b/apps/survey.subx @@ -115,7 +115,7 @@ $subx-survey-main:end: subx-survey: # infile : (addr buffered-file), out : (addr buffered-file) # pseudocode - # var in : (ref stream byte 4096) + # var in : (stream byte 4096) # slurp(infile, in) # var segments : (stream segment-info) # var labels : (stream label-info Max-labels) @@ -131,13 +131,13 @@ subx-survey: # infile : (addr buffered-file), out : (addr buffered-file) 51/push-ecx 52/push-edx 56/push-esi - # var segments/ecx : (ref stream {string, segment-info} 160) # 10 rows * 16 bytes/row + # var segments/ecx : (stream {string, segment-info} 160) # 10 rows * 16 bytes/row 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 0xa0/imm32 # subtract from esp 68/push 0xa0/imm32/length 68/push 0/imm32/read 68/push 0/imm32/write 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx - # var labels/edx : (ref stream label-info Max-labels*16) + # var labels/edx : (stream label-info Max-labels*16) # . data 2b/subtract 0/mod/indirect 5/rm32/.disp32 . . 4/r32/esp Max-labels/disp32 # subtract *Max-labels from esp # . length @@ -147,7 +147,7 @@ subx-survey: # infile : (addr buffered-file), out : (addr buffered-file) # . write 68/push 0/imm32/write 89/copy 3/mod/direct 2/rm32/edx . . . 4/r32/esp . . # copy esp to edx - # var in/esi : (ref stream byte Input-size) + # var in/esi : (stream byte Input-size) # . data 2b/subtract 0/mod/indirect 5/rm32/.disp32 . . 4/r32/esp Input-size/disp32 # subtract *Input-size from esp # . length @@ -1219,13 +1219,13 @@ test-compute-offsets: e8/call clear-stream/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp - # var segments/ecx : (ref stream byte 2*16) + # var segments/ecx : (stream byte 2*16) 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 0x20/imm32 # subtract from esp 68/push 0x20/imm32/length 68/push 0/imm32/read 68/push 0/imm32/write 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx - # var labels/edx : (ref stream byte 2*16) + # var labels/edx : (stream byte 2*16) 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 0x20/imm32 # subtract from esp 68/push 0x20/imm32/length 68/push 0/imm32/read @@ -1621,13 +1621,13 @@ test-compute-addresses: 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp # setup - # . var segments/ecx : (ref stream byte 10*16) + # . var segments/ecx : (stream byte 10*16) 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 0xa0/imm32 # subtract from esp 68/push 0xa0/imm32/length 68/push 0/imm32/read 68/push 0/imm32/write 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx - # . var labels/edx : (ref stream byte 512*16) + # . var labels/edx : (stream byte 512*16) 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 0x2000/imm32 # subtract from esp 68/push 0x2000/imm32/length 68/push 0/imm32/read @@ -1790,13 +1790,13 @@ test-compute-addresses-large-segments: 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp # setup - # . var segments/ecx : (ref stream byte 10*16) + # . var segments/ecx : (stream byte 10*16) 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 0xa0/imm32 # subtract from esp 68/push 0xa0/imm32/length 68/push 0/imm32/read 68/push 0/imm32/write 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx - # . var labels/edx : (ref stream byte 512*16) + # . var labels/edx : (stream byte 512*16) 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 0x2000/imm32 # subtract from esp 68/push 0x2000/imm32/length 68/push 0/imm32/read @@ -1993,11 +1993,11 @@ emit-segments: # in : (addr stream byte), out : (addr buffered-file), segments 68/push 0/imm32/read 68/push 0/imm32/write 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx - # var word-slice/edx : (ref slice) + # var word-slice/edx : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/copy 3/mod/direct 2/rm32/edx . . . 4/r32/esp . . # copy esp to edx - # var datum/edi : (ref slice) + # var datum/edi : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/copy 3/mod/direct 7/rm32/edi . . . 4/r32/esp . . # copy esp to edi @@ -2577,13 +2577,13 @@ test-emit-segments-global-variable: e8/call clear-stream/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp - # . var segments/ecx : (ref stream byte 10*16) + # . var segments/ecx : (stream byte 10*16) 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 0xa0/imm32 # subtract from esp 68/push 0xa0/imm32/length 68/push 0/imm32/read 68/push 0/imm32/write 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx - # . var labels/edx : (ref stream byte 512*16) + # . var labels/edx : (stream byte 512*16) 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 0x2000/imm32 # subtract from esp 68/push 0x2000/imm32/length 68/push 0/imm32/read @@ -2814,13 +2814,13 @@ test-emit-segments-code-label: e8/call clear-stream/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp - # . var segments/ecx : (ref stream byte 10*16) + # . var segments/ecx : (stream byte 10*16) 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 0xa0/imm32 # subtract from esp 68/push 0xa0/imm32/length 68/push 0/imm32/read 68/push 0/imm32/write 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx - # . var labels/edx : (ref stream byte 512*16) + # . var labels/edx : (stream byte 512*16) 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 0x2000/imm32 # subtract from esp 68/push 0x2000/imm32/length 68/push 0/imm32/read @@ -3016,13 +3016,13 @@ test-emit-segments-code-label-absolute: e8/call clear-stream/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp - # . var segments/ecx : (ref stream byte 10*16) + # . var segments/ecx : (stream byte 10*16) 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 0xa0/imm32 # subtract from esp 68/push 0xa0/imm32/length 68/push 0/imm32/read 68/push 0/imm32/write 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx - # . var labels/edx : (ref stream byte 512*16) + # . var labels/edx : (stream byte 512*16) 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 0x2000/imm32 # subtract from esp 68/push 0x2000/imm32/length 68/push 0/imm32/read @@ -3830,7 +3830,7 @@ test-trace-slsls: 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 05/add-to-eax 4/imm32 - # var b/ebx : (ref slice) = {eax, ecx} + # var b/ebx : slice = {eax, ecx} 51/push-ecx 50/push-eax 89/copy 3/mod/direct 3/rm32/ebx . . . 4/r32/esp . . # copy esp to ebx @@ -3839,7 +3839,7 @@ test-trace-slsls: 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 05/add-to-eax 4/imm32 - # var d/edx : (ref slice) = {eax, ecx} + # var d/edx : slice = {eax, ecx} 51/push-ecx 50/push-eax 89/copy 3/mod/direct 2/rm32/edx . . . 4/r32/esp . . # copy esp to edx @@ -3955,7 +3955,7 @@ test-trace-slsns: 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 05/add-to-eax 4/imm32 - # var b/ebx : (ref slice) = {eax, ecx} + # var b/ebx : slice = {eax, ecx} 51/push-ecx 50/push-eax 89/copy 3/mod/direct 3/rm32/ebx . . . 4/r32/esp . . # copy esp to ebx @@ -4071,7 +4071,7 @@ test-trace-slsss: 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 05/add-to-eax 4/imm32 - # var b/ebx : (ref slice) = {eax, ecx} + # var b/ebx : slice = {eax, ecx} 51/push-ecx 50/push-eax 89/copy 3/mod/direct 3/rm32/ebx . . . 4/r32/esp . . # copy esp to ebx @@ -4150,7 +4150,7 @@ num-bytes: # line : (addr stream byte) -> eax : int 53/push-ebx # var result/eax = 0 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . . # clear eax - # var word-slice/ecx : (ref slice) + # var word-slice/ecx : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx diff --git a/apps/tests.subx b/apps/tests.subx index 2cef958b..5609be0c 100644 --- a/apps/tests.subx +++ b/apps/tests.subx @@ -101,13 +101,13 @@ subx-gen-run-tests: # in : (addr buffered-file), out : (addr buffered-file) 52/push-edx 53/push-ebx 57/push-edi - # var line/ecx : (ref stream byte 512) + # var line/ecx : (stream byte 512) 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 0x200/imm32 # subtract from esp 68/push 0x200/imm32/length 68/push 0/imm32/read 68/push 0/imm32/write 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx - # var word-slice/edx : (ref slice) + # var word-slice/edx : slice 68/push 0/imm32/end 68/push 0/imm32/start 89/copy 3/mod/direct 2/rm32/edx . . . 4/r32/esp . . # copy esp to edx |