From 540974343290cb9ac0cf55b999447bf563928612 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Thu, 17 Oct 2019 21:59:51 -0700 Subject: [PATCH] 5700 --- 050_write.subx | 2 +- 051test.subx | 2 +- 055stream.subx | 4 ++-- 056trace.subx | 2 +- 057write.subx | 2 +- 059stop.subx | 2 +- 062write-stream.subx | 4 ++-- 063error.subx | 2 +- 064write-byte.subx | 6 +++--- 065write-buffered.subx | 2 +- 066print-int.subx | 8 ++++---- 068error-byte.subx | 2 +- 071read-line.subx | 4 ++-- 073next-token.subx | 2 +- 074write-stream-data.subx | 2 +- 078emit-hex.subx | 2 +- 079emit.subx | 2 +- 082slurp.subx | 2 +- 084emit-hex-array.subx | 2 +- 092write-int.subx | 2 +- apps/assort.subx | 2 +- apps/braces.subx | 2 +- apps/calls.subx | 2 +- apps/crenshaw2-1.subx | 8 ++++---- apps/crenshaw2-1b.subx | 8 ++++---- apps/dquotes.subx | 2 +- apps/hex.subx | 4 ++-- apps/mulisp.subx | 2 +- apps/pack.subx | 18 +++++++++--------- apps/sigils.subx | 2 +- apps/survey.subx | 2 +- apps/tests.subx | 2 +- 32 files changed, 55 insertions(+), 55 deletions(-) diff --git a/050_write.subx b/050_write.subx index dd6892af..4a48e825 100644 --- a/050_write.subx +++ b/050_write.subx @@ -11,7 +11,7 @@ Entry: # just exit; can't test _write just yet b8/copy-to-eax 1/imm32/exit cd/syscall 0x80/imm8 -_write: # fd : int, s : (address array byte) -> +_write: # fd : int, s : (address 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 c5282446..a49022e0 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 : (address 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 4534f84f..c60be1d5 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) -> +clear-stream: # f : (address stream) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -51,7 +51,7 @@ $clear-stream:end: 5d/pop-to-ebp c3/return -rewind-stream: # f : (address stream) -> +rewind-stream: # f : (address stream) # . 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 1d5c5a0b..beff1993 100644 --- a/056trace.subx +++ b/056trace.subx @@ -41,7 +41,7 @@ _test-trace-stream: # Allocate a new segment for the trace stream, initialize its length, and save its address to Trace-stream. # The Trace-stream segment will consist of variable-length lines separated by newlines (0x0a) -initialize-trace-stream: # n : int -> +initialize-trace-stream: # n : 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 a55202db..b1ec1688 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), s : (address array byte) -> +write: # f : fd or (address stream), s : (address array byte) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp diff --git a/059stop.subx b/059stop.subx index c099d66f..628c813d 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 : (address exit-descriptor), nbytes : int # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp diff --git a/062write-stream.subx b/062write-stream.subx index a85cf40c..12d3c7e2 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), s : (address stream) -> +write-stream: # f : fd or (address stream), s : (address stream) # . 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) -> +_write-stream: # fd : int, s : (address stream) # . 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 10f10667..1d77b3f0 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), msg : (address array byte) -> +error: # ed : (address exit-descriptor), out : fd or (address stream), msg : (address 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 1864a53d..c8a6f800 100644 --- a/064write-byte.subx +++ b/064write-byte.subx @@ -28,7 +28,7 @@ Stdout: # . 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 : (address buffered-file), n : int # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -76,7 +76,7 @@ $write-byte-buffered:end: 5d/pop-to-ebp c3/return -flush: # f : (address buffered-file) -> +flush: # f : (address buffered-file) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -209,7 +209,7 @@ test-write-byte-buffered-multiple-flushes: # - variant without buffering # Write lower byte of 'n' to 'f'. -append-byte: # f : (address stream), n : int -> +append-byte: # f : (address stream), n : int # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp diff --git a/065write-buffered.subx b/065write-buffered.subx index a765d4ee..9774a4b1 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 : (address buffered-file), msg : (address array byte) # pseudocode: # in = msg->data # inend = &msg->data[msg->length] diff --git a/066print-int.subx b/066print-int.subx index 6c7a55fd..6ba21cab 100644 --- a/066print-int.subx +++ b/066print-int.subx @@ -17,7 +17,7 @@ $to-hex-char:else: 05/add-to-eax 0x57/imm32/a-10 c3/return -append-byte-hex: # f : (address stream), n : int -> +append-byte-hex: # f : (address stream), n : int # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -89,7 +89,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 : (address buffered-file), n : int # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -176,7 +176,7 @@ test-print-byte-buffered: # . end c3/return -print-int32: # f : (address stream), n : int -> +print-int32: # f : (address stream), n : int # pseudocode: # write(f, "0x") # ecx = 28 @@ -264,7 +264,7 @@ test-print-int32: # . end c3/return -print-int32-buffered: # f : (address buffered-file), n : int -> +print-int32-buffered: # f : (address buffered-file), n : int # pseudocode: # write-buffered(f, "0x") # ecx = 28 diff --git a/068error-byte.subx b/068error-byte.subx index 0d6ddafe..5284c034 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 : (address exit-descriptor), out : (address buffered-file), msg : (address 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/071read-line.subx b/071read-line.subx index a68a76c2..5c4019ab 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 : (address buffered-file), s : (address stream byte) # pseudocode: # while true # if (s->write >= s->length) abort @@ -220,7 +220,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), s : (address stream byte) -> +read-line: # f : (address stream), s : (address stream byte) # pseudocode: # while true # if (s->write >= s->length) abort diff --git a/073next-token.subx b/073next-token.subx index d11cd8b9..35414883 100644 --- a/073next-token.subx +++ b/073next-token.subx @@ -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 : (address byte), end : (address byte), delimiter : byte, out : (address slice) # . 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 72fca897..a7bf49d2 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) -> +write-stream-data: # f : (address buffered-file), s : (address stream) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp diff --git a/078emit-hex.subx b/078emit-hex.subx index 750db096..67d851e9 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 : (address 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 d8168990..9eb79340 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 : (address buffered-file), word : (address 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/082slurp.subx b/082slurp.subx index 1968f69f..e116b5e8 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 : (address buffered-file), s : (address stream byte) # pseudocode: # while true # if (s->write >= s->length) abort diff --git a/084emit-hex-array.subx b/084emit-hex-array.subx index 9708f240..892c7318 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 : (address buffered-file), arr : (address array byte) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp diff --git a/092write-int.subx b/092write-int.subx index 11ac84fe..7ebd473a 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), n : int -> +write-int: # out : (address stream), n : 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 1898d832..1e546f49 100644 --- a/apps/assort.subx +++ b/apps/assort.subx @@ -86,7 +86,7 @@ $subx-assort-main:end: # table: (address stream {string, (address 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 : (address buffered-file), out : (address buffered-file) # pseudocode: # var table : (address stream) = new-stream(10 rows, 8 bytes each) # read-segments(in, table) diff --git a/apps/braces.subx b/apps/braces.subx index 87907b95..69e62c2c 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 : (address buffered-file), out : (address buffered-file) # pseudocode: # var line = new-stream(512, 1) # var label-stack : (address stack) = new-stack(32*4) # at most 32 levels of nesting diff --git a/apps/calls.subx b/apps/calls.subx index 88e963a5..a29c52f3 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 : (address buffered-file), out : (address buffered-file) # pseudocode: # var line = new-stream(512, 1) # var words : (address stream slice) = new-stream(16, 8) # at most function name and 15 args diff --git a/apps/crenshaw2-1.subx b/apps/crenshaw2-1.subx index 9fc2cb08..3f075140 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), err : fd or (address stream), ed : (address exit-descriptor) -> +compile: # in : (address buffered-file), out : fd or (address stream), err : fd or (address stream), ed : (address exit-descriptor) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -190,7 +190,7 @@ $compile:end: # Read a single digit into 'out'. Abort if there are none, or if there is no space in 'out'. # Input comes from the global variable 'Look', and we leave the next byte from # 'in' into it on exit. -get-num: # in : (address buffered-file), out : (address stream), err : fd or (address stream), ed : (address exit-descriptor) -> +get-num: # in : (address buffered-file), out : (address stream), err : fd or (address stream), ed : (address exit-descriptor) # pseudocode: # if (!is-digit?(Look)) expected(ed, err, "integer") # if out->write >= out->length @@ -472,7 +472,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), s : (address array byte) -> +expected: # ed : (address exit-descriptor), f : fd or (address stream), s : (address array byte) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -514,7 +514,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 : (address 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 2a321281..11115b24 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), err : fd or (address stream), ed : (address exit-descriptor) -> +compile: # in : (address buffered-file), out : fd or (address stream), err : fd or (address stream), ed : (address 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), err : fd or (address stream), ed : (address exit-descriptor) -> +get-num: # in : (address buffered-file), out : (address stream), err : fd or (address stream), ed : (address exit-descriptor) # pseudocode: # if (!is-digit?(Look)) expected(ed, err, "integer") # do @@ -672,7 +672,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), s : (address array byte) -> +expected: # ed : (address exit-descriptor), f : fd or (address stream), s : (address array byte) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -714,7 +714,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 : (address 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 8d85b45b..7d7cf632 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 : (address buffered-file), out : (address buffered-file) # pseudocode: # var line = new-stream(512, 1) # var new-data-segment = new-stream(Heap, Segment-size, 1) diff --git a/apps/hex.subx b/apps/hex.subx index 98e14a25..b3a98838 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 : (address buffered-file), out : (address buffered-file), err : (address buffered-file), ed : (address exit-descriptor) # pseudocode: # while true # eax = convert-next-octet(in, err, ed) @@ -1392,7 +1392,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 : (address buffered-file) # pseudocode: # push eax # while true diff --git a/apps/mulisp.subx b/apps/mulisp.subx index 226042c2..74f8098c 100644 --- a/apps/mulisp.subx +++ b/apps/mulisp.subx @@ -74,7 +74,7 @@ $main:end: # 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 : (address buffered-file), out : (address buffered-file) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp diff --git a/apps/pack.subx b/apps/pack.subx index 3f300f3a..51ad879e 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 : (address buffered-file), out : (address buffered-file) # pseudocode: # var line = new-stream(512, 1) # var in-code? = false @@ -933,7 +933,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 : (address stream byte), out : (address buffered-file) # pseudocode: # var word-slice = {0, 0} # while true @@ -1853,7 +1853,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 : (address stream byte), out : (address buffered-file) # pseudocode: # # some early exits # var word-slice = next-word(line) @@ -1997,7 +1997,7 @@ $convert-instruction:end: 5d/pop-to-ebp c3/return -emit-opcodes: # line : (address stream byte), out : (address buffered-file) -> +emit-opcodes: # line : (address stream byte), out : (address buffered-file) # opcodes occupy 1-3 bytes: # xx # 0f xx @@ -2293,7 +2293,7 @@ $emit-opcodes:end: 5d/pop-to-ebp c3/return -emit-modrm: # line : (address stream byte), out : (address buffered-file) -> +emit-modrm: # line : (address stream byte), out : (address buffered-file) # pseudocode: # rewind-stream(line) # var has-modrm? = false, mod = 0, rm32 = 0, r32 = 0 @@ -2612,7 +2612,7 @@ $emit-modrm:end: 5d/pop-to-ebp c3/return -emit-sib: # line : (address stream byte), out : (address buffered-file) -> +emit-sib: # line : (address stream byte), out : (address buffered-file) # pseudocode: # var has-sib? = false, base = 0, index = 0, scale = 0 # var word-slice = {0, 0} @@ -2895,7 +2895,7 @@ $emit-sib:end: 5d/pop-to-ebp c3/return -emit-disp: # line : (address stream byte), out : (address buffered-file) -> +emit-disp: # line : (address stream byte), out : (address buffered-file) # pseudocode: # rewind-stream(line) # var word-slice = {0, 0} @@ -3116,7 +3116,7 @@ $emit-disp:break: 5d/pop-to-ebp c3/return -emit-imm: # line : (address stream byte), out : (address buffered-file) -> +emit-imm: # line : (address stream byte), out : (address buffered-file) # pseudocode: # rewind-stream(line) # var word-slice = {0, 0} @@ -3337,7 +3337,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 : (address stream byte), out : (address 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/sigils.subx b/apps/sigils.subx index 76a956b7..296ad68d 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 : (address buffered-file), out : (address buffered-file) # pseudocode: # var line = new-stream(512, 1) # while true diff --git a/apps/survey.subx b/apps/survey.subx index 08e7775a..9c48e928 100644 --- a/apps/survey.subx +++ b/apps/survey.subx @@ -113,7 +113,7 @@ $subx-survey-main:end: # labels: (address 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 : (address buffered-file), out : (address buffered-file) # pseudocode # var in : (address stream byte) = stream(4096) # slurp(infile, in) diff --git a/apps/tests.subx b/apps/tests.subx index cb2b5e2a..4e407d50 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 : (address buffered-file), out : (address buffered-file) # pseudocode # bool tests-found = false # var line = new-stream(512, 1)