From 901ae474300d70bcc00e7e0b420ca87c8cbf6f55 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Sun, 30 Dec 2018 20:24:37 -0800 Subject: 4899 Bug in my linkify tool introduced in commit 4891. --- html/subx/050_write.subx.html | 2 +- html/subx/051test.subx.html | 6 ++-- html/subx/052kernel_string_equal.subx.html | 20 ++++++------ html/subx/053new_segment.subx.html | 4 +-- html/subx/054string_equal.subx.html | 10 +++--- html/subx/055trace.subx.html | 20 ++++++------ html/subx/056write.subx.html | 10 +++--- html/subx/057stop.subx.html | 10 +++--- html/subx/058read.subx.html | 12 +++---- html/subx/059read-byte.subx.html | 14 ++++----- html/subx/060write-stream.subx.html | 10 +++--- html/subx/061error.subx.html | 2 +- html/subx/062write-byte.subx.html | 8 ++--- html/subx/063print-byte.subx.html | 6 ++-- html/subx/064write-buffered.subx.html | 6 ++-- html/subx/065error-byte.subx.html | 4 +-- html/subx/066allocate.subx.html | 8 ++--- html/subx/apps/crenshaw2-1.subx.html | 20 ++++++------ html/subx/apps/crenshaw2-1b.subx.html | 24 +++++++------- html/subx/apps/factorial.subx.html | 4 +-- html/subx/apps/handle.subx.html | 14 ++++----- html/subx/apps/hex.subx.html | 50 +++++++++++++++--------------- html/subx/examples/ex10.subx.html | 2 +- html/subx/examples/ex11.subx.html | 26 ++++++++-------- html/subx/examples/ex12.subx.html | 2 +- html/subx/examples/ex4.subx.html | 2 +- html/subx/examples/ex6.subx.html | 4 +-- html/subx/examples/ex7.subx.html | 8 ++--- html/subx/examples/ex8.subx.html | 2 +- html/subx/examples/ex9.subx.html | 2 +- 30 files changed, 156 insertions(+), 156 deletions(-) (limited to 'html/subx') diff --git a/html/subx/050_write.subx.html b/html/subx/050_write.subx.html index 506fbded..b7e6bffc 100644 --- a/html/subx/050_write.subx.html +++ b/html/subx/050_write.subx.html @@ -69,7 +69,7 @@ if ('onhashchange' in window) { 11 b8/copy-to-EAX 1/imm32/exit 12 cd/syscall 0x80/imm8 13 -14 _write: # fd : int, s : (address array byte) -> <void> +14 _write: # fd : int, s : (address array byte) -> <void> 15 # . prolog 16 55/push-EBP 17 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP diff --git a/html/subx/051test.subx.html b/html/subx/051test.subx.html index c67b3f67..c3cbdf4c 100644 --- a/html/subx/051test.subx.html +++ b/html/subx/051test.subx.html @@ -80,7 +80,7 @@ if ('onhashchange' in window) { 21 cd/syscall 0x80/imm8 22 23 # print msg to stderr if a != b, otherwise print "." -24 check-ints-equal: # (a : int, b : int, msg : (address array byte)) -> <void> +24 check-ints-equal: # (a : int, b : int, msg : (address array byte)) -> <void> 25 # . prolog 26 55/push-EBP 27 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -139,14 +139,14 @@ if ('onhashchange' in window) { 80 81 # length-prefixed string containing just a single newline 82 # convenient to have when printing messages and so on -83 Newline: +83 Newline: 84 # size 85 01 00 00 00 86 # data 87 0a/newline 88 89 # every test failure increments this counter -90 Num-test-failures: +90 Num-test-failures: 91 00 00 00 00 92 93 # . . vim:nowrap:textwidth=0 diff --git a/html/subx/052kernel_string_equal.subx.html b/html/subx/052kernel_string_equal.subx.html index e620ab08..3bc6e6f4 100644 --- a/html/subx/052kernel_string_equal.subx.html +++ b/html/subx/052kernel_string_equal.subx.html @@ -89,7 +89,7 @@ if ('onhashchange' in window) { 28 29 # compare a null-terminated ascii string with a more idiomatic length-prefixed byte array 30 # reason for the name: the only place we should have null-terminated ascii strings is from commandline args - 31 kernel-string-equal: # s : null-terminated ascii string, benchmark : length-prefixed ascii string -> EAX : boolean + 31 kernel-string-equal: # s : null-terminated ascii string, benchmark : length-prefixed ascii string -> EAX : boolean 32 # . prolog 33 55/push-EBP 34 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -171,7 +171,7 @@ if ('onhashchange' in window) { 110 111 # - tests 112 -113 test-compare-null-kernel-string-with-empty-array: +113 test-compare-null-kernel-string-with-empty-array: 114 # EAX = kernel-string-equal(Null-kernel-string, "") 115 # . . push args 116 68/push ""/imm32 @@ -191,7 +191,7 @@ if ('onhashchange' in window) { 130 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP 131 c3/return 132 -133 test-compare-null-kernel-string-with-non-empty-array: +133 test-compare-null-kernel-string-with-non-empty-array: 134 # EAX = kernel-string-equal(Null-kernel-string, "Abc") 135 # . . push args 136 68/push "Abc"/imm32 @@ -211,7 +211,7 @@ if ('onhashchange' in window) { 150 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP 151 c3/return 152 -153 test-compare-kernel-string-with-equal-array: +153 test-compare-kernel-string-with-equal-array: 154 # EAX = kernel-string-equal(Abc-kernel-string, "Abc") 155 # . . push args 156 68/push "Abc"/imm32 @@ -231,7 +231,7 @@ if ('onhashchange' in window) { 170 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP 171 c3/return 172 -173 test-compare-kernel-string-with-inequal-array: +173 test-compare-kernel-string-with-inequal-array: 174 # EAX = kernel-string-equal(Abc-kernel-string, "Adc") 175 # . . push args 176 68/push "Adc"/imm32 @@ -251,7 +251,7 @@ if ('onhashchange' in window) { 190 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP 191 c3/return 192 -193 test-compare-kernel-string-with-empty-array: +193 test-compare-kernel-string-with-empty-array: 194 # EAX = kernel-string-equal(Abc-kernel-string, "") 195 # . . push args 196 68/push ""/imm32 @@ -271,7 +271,7 @@ if ('onhashchange' in window) { 210 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP 211 c3/return 212 -213 test-compare-kernel-string-with-shorter-array: +213 test-compare-kernel-string-with-shorter-array: 214 # EAX = kernel-string-equal(Abc-kernel-string, "Ab") 215 # . . push args 216 68/push "Ab"/imm32 @@ -291,7 +291,7 @@ if ('onhashchange' in window) { 230 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP 231 c3/return 232 -233 test-compare-kernel-string-with-longer-array: +233 test-compare-kernel-string-with-longer-array: 234 # EAX = kernel-string-equal(Abc-kernel-string, "Abcd") 235 # . . push args 236 68/push "Abcd"/imm32 @@ -313,9 +313,9 @@ if ('onhashchange' in window) { 252 253 == data 254 -255 Null-kernel-string: +255 Null-kernel-string: 256 00/null -257 Abc-kernel-string: +257 Abc-kernel-string: 258 41/A 62/b 63/c 00/null 259 260 # . . vim:nowrap:textwidth=0 diff --git a/html/subx/053new_segment.subx.html b/html/subx/053new_segment.subx.html index 9e0e47d6..df60c22a 100644 --- a/html/subx/053new_segment.subx.html +++ b/html/subx/053new_segment.subx.html @@ -81,7 +81,7 @@ if ('onhashchange' in window) { 22 b8/copy-to-EAX 1/imm32/exit 23 cd/syscall 0x80/imm8 24 -25 new-segment: # len : int -> address +25 new-segment: # len : int -> address 26 # . prolog 27 55/push-EBP 28 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -105,7 +105,7 @@ if ('onhashchange' in window) { 46 == data 47 48 # various constants used here were found in the Linux sources (search for file mman-common.h) -49 _mmap-new-segment: # type mmap_arg_struct +49 _mmap-new-segment: # type mmap_arg_struct 50 # addr 51 00 00 00 00 # null 52 # len diff --git a/html/subx/054string_equal.subx.html b/html/subx/054string_equal.subx.html index b6339ba6..83507aed 100644 --- a/html/subx/054string_equal.subx.html +++ b/html/subx/054string_equal.subx.html @@ -74,7 +74,7 @@ if ('onhashchange' in window) { 13 b8/copy-to-EAX 1/imm32/exit 14 cd/syscall 0x80/imm8 15 - 16 string-equal: # s : string, benchmark : string -> EAX : boolean + 16 string-equal: # s : string, benchmark : string -> EAX : boolean 17 # . prolog 18 55/push-EBP 19 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -148,7 +148,7 @@ if ('onhashchange' in window) { 87 88 # - tests 89 - 90 test-compare-empty-with-empty-string: + 90 test-compare-empty-with-empty-string: 91 # EAX = string-equal("", "") 92 # . . push args 93 68/push ""/imm32 @@ -168,7 +168,7 @@ if ('onhashchange' in window) { 107 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP 108 c3/return 109 -110 test-compare-empty-with-non-empty-string: # also checks length-mismatch code path +110 test-compare-empty-with-non-empty-string: # also checks length-mismatch code path 111 # EAX = string-equal("", "Abc") 112 # . . push args 113 68/push "Abc"/imm32 @@ -188,7 +188,7 @@ if ('onhashchange' in window) { 127 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP 128 c3/return 129 -130 test-compare-equal-strings: +130 test-compare-equal-strings: 131 # EAX = string-equal("Abc", "Abc") 132 # . . push args 133 68/push "Abc"/imm32 @@ -208,7 +208,7 @@ if ('onhashchange' in window) { 147 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP 148 c3/return 149 -150 test-compare-inequal-strings-equal-lengths: +150 test-compare-inequal-strings-equal-lengths: 151 # EAX = string-equal("Abc", "Adc") 152 # . . push args 153 68/push "Adc"/imm32 diff --git a/html/subx/055trace.subx.html b/html/subx/055trace.subx.html index 7e71858c..fc55d888 100644 --- a/html/subx/055trace.subx.html +++ b/html/subx/055trace.subx.html @@ -84,12 +84,12 @@ if ('onhashchange' in window) { 22 == data 23 24 # We'll save the address of the trace segment here. - 25 Trace-stream: + 25 Trace-stream: 26 00 00 00 00 27 28 # Fake trace-stream for tests. 29 # Also illustrates the layout of the real trace-stream (segment). - 30 _test-trace-stream: + 30 _test-trace-stream: 31 # current write index 32 00 00 00 00 33 # current read index @@ -114,7 +114,7 @@ if ('onhashchange' in window) { 52 53 # Allocate a new segment for the trace stream, initialize its length, and save its address to Trace-stream. 54 # The Trace-stream segment will consist of variable-length lines separated by newlines (0x0a) - 55 initialize-trace-stream: + 55 initialize-trace-stream: 56 # EAX = new-segment(0x1000) 57 # . . push args 58 68/push 0x1000/imm32/N @@ -130,7 +130,7 @@ if ('onhashchange' in window) { 68 69 # Append a string to the given trace stream. 70 # Silently give up if it's already full. Or truncate the string if there isn't enough room. - 71 trace: # t : (address trace-stream), line : string + 71 trace: # t : (address trace-stream), line : string 72 # . prolog 73 55/push-EBP 74 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -197,7 +197,7 @@ if ('onhashchange' in window) { 135 5d/pop-to-EBP 136 c3/return 137 -138 clear-trace-stream: # t : (address trace-stream) +138 clear-trace-stream: # t : (address trace-stream) 139 # . prolog 140 55/push-EBP 141 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -237,7 +237,7 @@ if ('onhashchange' in window) { 175 176 # - tests 177 -178 test-trace-single: +178 test-trace-single: 179 # clear-trace-stream(_test-trace-stream) 180 # . . push args 181 68/push _test-trace-stream/imm32 @@ -267,7 +267,7 @@ if ('onhashchange' in window) { 205 # end 206 c3/return 207 -208 test-trace-appends: +208 test-trace-appends: 209 # clear-trace-stream(_test-trace-stream) 210 # . . push args 211 68/push _test-trace-stream/imm32 @@ -305,7 +305,7 @@ if ('onhashchange' in window) { 243 # end 244 c3/return 245 -246 test-trace-empty-line: +246 test-trace-empty-line: 247 # clear-trace-stream(_test-trace-stream) 248 # . . push args 249 68/push _test-trace-stream/imm32 @@ -338,7 +338,7 @@ if ('onhashchange' in window) { 276 # - helpers 277 278 # 3-argument variant of _append -279 _append-3: # out : address, outend : address, s : (array byte) -> num_bytes_appended/EAX +279 _append-3: # out : address, outend : address, s : (array byte) -> num_bytes_appended/EAX 280 # . prolog 281 55/push-EBP 282 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -370,7 +370,7 @@ if ('onhashchange' in window) { 308 c3/return 309 310 # 4-argument variant of _append -311 _append-4: # out : address, outend : address, in : address, inend : address -> num_bytes_appended/EAX +311 _append-4: # out : address, outend : address, in : address, inend : address -> num_bytes_appended/EAX 312 # . prolog 313 55/push-EBP 314 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP diff --git a/html/subx/056write.subx.html b/html/subx/056write.subx.html index 01337f40..304a06f2 100644 --- a/html/subx/056write.subx.html +++ b/html/subx/056write.subx.html @@ -89,7 +89,7 @@ if ('onhashchange' in window) { 28 cd/syscall 0x80/imm8 29 30 # TODO: come up with a way to signal when a write to disk fails - 31 write: # f : fd or (address stream), s : (address array byte) -> <void> + 31 write: # f : fd or (address stream), s : (address array byte) -> <void> 32 # . prolog 33 55/push-EBP 34 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -143,7 +143,7 @@ if ('onhashchange' in window) { 82 5d/pop-to-EBP 83 c3/return 84 - 85 clear-stream: # f : (address stream) -> <void> + 85 clear-stream: # f : (address stream) -> <void> 86 # . prolog 87 55/push-EBP 88 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -181,7 +181,7 @@ if ('onhashchange' in window) { 120 5d/pop-to-EBP 121 c3/return 122 -123 test-write-single: +123 test-write-single: 124 # clear-stream(_test-stream) 125 # . . push args 126 68/push _test-stream/imm32 @@ -211,7 +211,7 @@ if ('onhashchange' in window) { 150 # end 151 c3/return 152 -153 test-write-appends: +153 test-write-appends: 154 # clear-stream(_test-stream) 155 # . . push args 156 68/push _test-stream/imm32 @@ -251,7 +251,7 @@ if ('onhashchange' in window) { 190 191 == data 192 -193 _test-stream: +193 _test-stream: 194 # current write index 195 00 00 00 00 196 # current read index diff --git a/html/subx/057stop.subx.html b/html/subx/057stop.subx.html index d705f3be..3278961b 100644 --- a/html/subx/057stop.subx.html +++ b/html/subx/057stop.subx.html @@ -110,7 +110,7 @@ if ('onhashchange' in window) { 48 # Configure an exit-descriptor for a call pushing 'nbytes' bytes of args to 49 # the stack. 50 # Ugly that we need to know the size of args, but so it goes. - 51 tailor-exit-descriptor: # ed : (address exit-descriptor), nbytes : int -> <void> + 51 tailor-exit-descriptor: # ed : (address exit-descriptor), nbytes : int -> <void> 52 # . prolog 53 55/push-EBP 54 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -158,7 +158,7 @@ if ('onhashchange' in window) { 96 5d/pop-to-EBP 97 c3/return 98 - 99 stop: # ed : (address exit-descriptor), value : int + 99 stop: # ed : (address exit-descriptor), value : int 100 # no prolog; one way or another, we're going to clobber registers 101 # EAX = ed 102 8b/copy 1/mod/*+disp8 4/rm32/sib 4/base/ESP 4/index/none . 0/r32/EAX 4/disp8 . # copy *(ESP+4) to EAX @@ -179,7 +179,7 @@ if ('onhashchange' in window) { 117 $stop:end: 118 c3/return # doesn't return to caller 119 -120 test-stop-skips-returns-on-exit: +120 test-stop-skips-returns-on-exit: 121 # This looks like the standard prolog, but is here for different reasons. 122 # A function calling 'stop' can't rely on EBP persisting past the call. 123 # @@ -228,7 +228,7 @@ if ('onhashchange' in window) { 166 5d/pop-to-EBP 167 c3/return 168 -169 _test-stop-1: # ed : (address exit-descriptor) +169 _test-stop-1: # ed : (address exit-descriptor) 170 # . prolog 171 55/push-EBP 172 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -255,7 +255,7 @@ if ('onhashchange' in window) { 193 5d/pop-to-EBP 194 c3/return 195 -196 _test-stop-2: # ed : (address exit-descriptor) +196 _test-stop-2: # ed : (address exit-descriptor) 197 # . prolog 198 55/push-EBP 199 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP diff --git a/html/subx/058read.subx.html b/html/subx/058read.subx.html index 2c54adce..27b20a0e 100644 --- a/html/subx/058read.subx.html +++ b/html/subx/058read.subx.html @@ -114,7 +114,7 @@ if ('onhashchange' in window) { 52 b8/copy-to-EAX 1/imm32/exit 53 cd/syscall 0x80/imm8 54 - 55 read: # f : fd or (address stream), s : (address stream) -> num-bytes-read/EAX + 55 read: # f : fd or (address stream), s : (address stream) -> num-bytes-read/EAX 56 # . prolog 57 55/push-EBP 58 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -180,7 +180,7 @@ if ('onhashchange' in window) { 118 # Unclear how I'd use it, though. Callers seem to need the check anyway. 119 # Maybe a better helper would be 'empty-stream?' 120 -121 _read: # fd : int, s : (address stream) -> num-bytes-read/EAX +121 _read: # fd : int, s : (address stream) -> num-bytes-read/EAX 122 # . prolog 123 55/push-EBP 124 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -241,7 +241,7 @@ if ('onhashchange' in window) { 179 180 # - tests 181 -182 test-read-single: +182 test-read-single: 183 # - write a single character into _test-stream, then read from its buffered-file 184 # clear-stream(_test-stream) 185 # . . push args @@ -296,7 +296,7 @@ if ('onhashchange' in window) { 234 # end 235 c3/return 236 -237 test-read-is-stateful: +237 test-read-is-stateful: 238 # - make two consecutive reads, check that their results are appended 239 # clear-stream(_test-stream) 240 # . . push args @@ -358,7 +358,7 @@ if ('onhashchange' in window) { 296 # end 297 c3/return 298 -299 test-read-returns-0-on-end-of-file: +299 test-read-returns-0-on-end-of-file: 300 # - read after hitting end-of-file, check that result is 0 301 # setup 302 # . clear-stream(_test-stream) @@ -415,7 +415,7 @@ if ('onhashchange' in window) { 353 354 == data 355 -356 _test-stream-buffer: +356 _test-stream-buffer: 357 # current write index 358 00 00 00 00 359 # current read index diff --git a/html/subx/059read-byte.subx.html b/html/subx/059read-byte.subx.html index 5103e9e6..7eb39292 100644 --- a/html/subx/059read-byte.subx.html +++ b/html/subx/059read-byte.subx.html @@ -74,7 +74,7 @@ if ('onhashchange' in window) { 11 12 # The buffered file for standard input. Also illustrates the layout for 13 # buffered-file. - 14 Stdin: + 14 Stdin: 15 # file descriptor or (address stream) 16 00 00 00 00 # 0 = standard input 17 # current write index @@ -105,7 +105,7 @@ if ('onhashchange' in window) { 42 43 # return next byte value in EAX, with top 3 bytes cleared. 44 # On EOF, return 0xffffffff. - 45 read-byte: # f : (address buffered-file) -> byte-or-eof/EAX + 45 read-byte: # f : (address buffered-file) -> byte-or-eof/EAX 46 # . prolog 47 55/push-EBP 48 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -160,7 +160,7 @@ if ('onhashchange' in window) { 97 98 # - tests 99 -100 test-read-byte-single: +100 test-read-byte-single: 101 # - check that read-byte returns first byte of 'file' 102 # setup 103 # . clear-stream(_test-stream) @@ -206,7 +206,7 @@ if ('onhashchange' in window) { 143 # . end 144 c3/return 145 -146 test-read-byte-multiple: +146 test-read-byte-multiple: 147 # - call read-byte twice, check that second call returns second byte 148 # setup 149 # . clear-stream(_test-stream) @@ -259,7 +259,7 @@ if ('onhashchange' in window) { 196 # . end 197 c3/return 198 -199 test-read-byte-end-of-file: +199 test-read-byte-end-of-file: 200 # - call read-byte on an empty 'file', check that it returns 0xffffffff 201 # setup 202 # . clear-stream(_test-stream) @@ -297,7 +297,7 @@ if ('onhashchange' in window) { 234 # . end 235 c3/return 236 -237 test-read-byte-refills-buffer: +237 test-read-byte-refills-buffer: 238 # - consume buffered-file's buffer, check that next read-byte still works 239 # setup 240 # . clear-stream(_test-stream) @@ -350,7 +350,7 @@ if ('onhashchange' in window) { 287 == data 288 289 # a test buffered file for _test-stream -290 _test-buffered-file: +290 _test-buffered-file: 291 # file descriptor or (address stream) 292 _test-stream/imm32 293 # current write index diff --git a/html/subx/060write-stream.subx.html b/html/subx/060write-stream.subx.html index 66a8c601..027deb60 100644 --- a/html/subx/060write-stream.subx.html +++ b/html/subx/060write-stream.subx.html @@ -81,7 +81,7 @@ if ('onhashchange' in window) { 19 b8/copy-to-EAX 1/imm32/exit 20 cd/syscall 0x80/imm8 21 - 22 write-stream: # f : fd or (address stream), s : (address stream) -> <void> + 22 write-stream: # f : fd or (address stream), s : (address stream) -> <void> 23 # . prolog 24 55/push-EBP 25 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -141,7 +141,7 @@ if ('onhashchange' in window) { 79 5d/pop-to-EBP 80 c3/return 81 - 82 _write-stream: # fd : int, s : (address stream) -> <void> + 82 _write-stream: # fd : int, s : (address stream) -> <void> 83 # . prolog 84 55/push-EBP 85 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -180,7 +180,7 @@ if ('onhashchange' in window) { 118 5d/pop-to-EBP 119 c3/return 120 -121 test-write-stream-single: +121 test-write-stream-single: 122 # setup 123 # . clear-stream(_test-stream) 124 # . . push args @@ -226,7 +226,7 @@ if ('onhashchange' in window) { 164 # . end 165 c3/return 166 -167 test-write-stream-appends: +167 test-write-stream-appends: 168 # setup 169 # . clear-stream(_test-stream) 170 # . . push args @@ -292,7 +292,7 @@ if ('onhashchange' in window) { 230 231 == data 232 -233 _test-stream2: +233 _test-stream2: 234 # current write index 235 04 00 00 00 236 # current read index diff --git a/html/subx/061error.subx.html b/html/subx/061error.subx.html index e22783a5..f52ea308 100644 --- a/html/subx/061error.subx.html +++ b/html/subx/061error.subx.html @@ -72,7 +72,7 @@ if ('onhashchange' in window) { 13 cd/syscall 0x80/imm8 14 15 # write(out, "Error: "+msg+"\n") then stop(ed, 1) -16 error: # ed : (address exit-descriptor), out : fd or (address stream), msg : (address array byte) -> <void> +16 error: # ed : (address exit-descriptor), out : fd or (address stream), msg : (address array byte) -> <void> 17 # . prolog 18 55/push-EBP 19 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP diff --git a/html/subx/062write-byte.subx.html b/html/subx/062write-byte.subx.html index 07f446ce..606e12fe 100644 --- a/html/subx/062write-byte.subx.html +++ b/html/subx/062write-byte.subx.html @@ -68,7 +68,7 @@ if ('onhashchange' in window) { 7 == data 8 9 # The buffered file for standard output. - 10 Stdout: + 10 Stdout: 11 # file descriptor or (address stream) 12 01 00 00 00 # 1 = standard output 13 # current write index @@ -96,7 +96,7 @@ if ('onhashchange' in window) { 35 cd/syscall 0x80/imm8 36 37 # Write lower byte of 'n' to 'f'. - 38 write-byte: # f : (address buffered-file), n : int -> <void> + 38 write-byte: # f : (address buffered-file), n : int -> <void> 39 # . prolog 40 55/push-EBP 41 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -142,7 +142,7 @@ if ('onhashchange' in window) { 81 5d/pop-to-EBP 82 c3/return 83 - 84 flush: # f : (address buffered-file) -> <void> + 84 flush: # f : (address buffered-file) -> <void> 85 # . prolog 86 55/push-EBP 87 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -171,7 +171,7 @@ if ('onhashchange' in window) { 110 111 # - tests 112 -113 test-write-byte-single: +113 test-write-byte-single: 114 # - check that read-byte returns first byte of 'file' 115 # setup 116 # . clear-stream(_test-stream) diff --git a/html/subx/063print-byte.subx.html b/html/subx/063print-byte.subx.html index a16ac3b6..4a21bc33 100644 --- a/html/subx/063print-byte.subx.html +++ b/html/subx/063print-byte.subx.html @@ -73,7 +73,7 @@ if ('onhashchange' in window) { 12 b8/copy-to-EAX 1/imm32/exit 13 cd/syscall 0x80/imm8 14 - 15 print-byte: # f : (address buffered-file), n : int -> <void> + 15 print-byte: # f : (address buffered-file), n : int -> <void> 16 # . prolog 17 55/push-EBP 18 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -126,7 +126,7 @@ if ('onhashchange' in window) { 65 66 # extract lowest 4 bits and convert to 8-byte ascii 67 # return 0xffffffff if more than 4 bits are set - 68 hex-char: # n : int -> char_or_error/EAX + 68 hex-char: # n : int -> char_or_error/EAX 69 # . prolog 70 55/push-EBP 71 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -152,7 +152,7 @@ if ('onhashchange' in window) { 91 5d/pop-to-EBP 92 c3/return 93 - 94 test-print-byte: + 94 test-print-byte: 95 # - check that print-byte prints the hex textual representation 96 # setup 97 # . clear-stream(_test-stream) diff --git a/html/subx/064write-buffered.subx.html b/html/subx/064write-buffered.subx.html index a4a39421..5327f9c6 100644 --- a/html/subx/064write-buffered.subx.html +++ b/html/subx/064write-buffered.subx.html @@ -76,7 +76,7 @@ if ('onhashchange' in window) { 14 b8/copy-to-EAX 1/imm32/exit 15 cd/syscall 0x80/imm8 16 - 17 write-buffered: # f : (address buffered-file), msg : (address array byte) -> <void> + 17 write-buffered: # f : (address buffered-file), msg : (address array byte) -> <void> 18 # pseudocode: 19 # in = msg->data 20 # inend = &msg->data[msg->length] @@ -174,7 +174,7 @@ if ('onhashchange' in window) { 112 5d/pop-to-EBP 113 c3/return 114 -115 test-write-buffered: +115 test-write-buffered: 116 # - check that write-buffered writes to the file 117 # setup 118 # . clear-stream(_test-stream) @@ -222,7 +222,7 @@ if ('onhashchange' in window) { 160 # . end 161 c3/return 162 -163 test-write-buffered-with-intermediate-flush: +163 test-write-buffered-with-intermediate-flush: 164 # - check that write-buffered flushes in the middle if its buffer fills up 165 # setup 166 # . clear-stream(_test-stream) diff --git a/html/subx/065error-byte.subx.html b/html/subx/065error-byte.subx.html index 67cae32a..31783f53 100644 --- a/html/subx/065error-byte.subx.html +++ b/html/subx/065error-byte.subx.html @@ -87,7 +87,7 @@ if ('onhashchange' in window) { 27 cd/syscall 0x80/imm8 28 29 # write(out, "Error: "+msg+": "+byte) then stop(ed, 1) - 30 error-byte: # ed : (address exit-descriptor), out : (address buffered-file), msg : (address array byte), n : byte -> <void> + 30 error-byte: # ed : (address exit-descriptor), out : (address buffered-file), msg : (address array byte), n : byte -> <void> 31 # . prolog 32 55/push-EBP 33 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -154,7 +154,7 @@ if ('onhashchange' in window) { 94 == data 95 96 # The buffered file for standard error. - 97 Stderr: + 97 Stderr: 98 # file descriptor or (address stream) 99 02 00 00 00 # 1 = standard error 100 # current write index diff --git a/html/subx/066allocate.subx.html b/html/subx/066allocate.subx.html index 94a0b52a..9cae149f 100644 --- a/html/subx/066allocate.subx.html +++ b/html/subx/066allocate.subx.html @@ -80,7 +80,7 @@ if ('onhashchange' in window) { 20 21 # The 'global' allocation descriptor. Pass this into 'allocate' to claim a 22 # hitherto unused bit of memory. - 23 Heap: + 23 Heap: 24 Start-of-heap/imm32 # curr 25 00 00 00 0b # limit = 0x0b000000; keep sync'd with DATA_SEGMENT + SEGMENT_ALIGNMENT 26 @@ -98,7 +98,7 @@ if ('onhashchange' in window) { 38 39 # Claim the next 'n' bytes of memory starting at ad->curr and update ad->curr. 40 # If there isn't enough memory before ad->limit, return 0 and leave 'ad' unmodified. - 41 allocate: # ad : (address allocation-descriptor), n : int -> address-or-null/EAX + 41 allocate: # ad : (address allocation-descriptor), n : int -> address-or-null/EAX 42 # . prolog 43 55/push-EBP 44 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -130,7 +130,7 @@ if ('onhashchange' in window) { 70 5d/pop-to-EBP 71 c3/return 72 - 73 test-allocate-success: + 73 test-allocate-success: 74 # . prolog 75 55/push-EBP 76 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -169,7 +169,7 @@ if ('onhashchange' in window) { 109 5d/pop-to-EBP 110 c3/return 111 -112 test-allocate-failure: +112 test-allocate-failure: 113 # . prolog 114 55/push-EBP 115 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP diff --git a/html/subx/apps/crenshaw2-1.subx.html b/html/subx/apps/crenshaw2-1.subx.html index f64afa4c..de7cf5c0 100644 --- a/html/subx/apps/crenshaw2-1.subx.html +++ b/html/subx/apps/crenshaw2-1.subx.html @@ -144,7 +144,7 @@ if ('onhashchange' in window) { 81 cd/syscall 0x80/imm8 82 83 # the main entry point - 84 compile: # in : (address buffered-file), out : fd or (address stream), err : fd or (address stream), ed : (address exit-descriptor) -> <void> + 84 compile: # in : (address buffered-file), out : fd or (address stream), err : fd or (address stream), ed : (address exit-descriptor) -> <void> 85 # . prolog 86 55/push-EBP 87 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -260,7 +260,7 @@ if ('onhashchange' in window) { 197 # Read a single digit into 'out'. Abort if there are none, or if there is no space in 'out'. 198 # Input comes from the global variable 'Look', and we leave the next byte from 199 # 'in' into it on exit. -200 get-num: # in : (address buffered-file), out : (address stream), err : fd or (address stream), ed : (address exit-descriptor) -> <void> +200 get-num: # in : (address buffered-file), out : (address stream), err : fd or (address stream), ed : (address exit-descriptor) -> <void> 201 # pseudocode: 202 # if !is-digit?(Look) expected(ed, err, "integer") 203 # if out->write >= out->length @@ -364,7 +364,7 @@ if ('onhashchange' in window) { 301 5d/pop-to-EBP 302 c3/return 303 -304 test-get-num-reads-single-digit: +304 test-get-num-reads-single-digit: 305 # - check that get-num returns first character if it's a digit 306 # This test uses exit-descriptors. Use EBP for setting up local variables. 307 55/push-EBP @@ -455,7 +455,7 @@ if ('onhashchange' in window) { 392 5d/pop-to-EBP 393 c3/return 394 -395 test-get-num-aborts-on-non-digit-in-Look: +395 test-get-num-aborts-on-non-digit-in-Look: 396 # - check that get-num returns first character if it's a digit 397 # This test uses exit-descriptors. Use EBP for setting up local variables. 398 55/push-EBP @@ -543,7 +543,7 @@ if ('onhashchange' in window) { 480 ## helpers 481 482 # write(f, "Error: "+s+" expected\n") then stop(ed, 1) -483 expected: # ed : (address exit-descriptor), f : fd or (address stream), s : (address array byte) -> <void> +483 expected: # ed : (address exit-descriptor), f : fd or (address stream), s : (address array byte) -> <void> 484 # . prolog 485 55/push-EBP 486 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -593,7 +593,7 @@ if ('onhashchange' in window) { 530 c3/return 531 532 # read a byte from 'f', and save it in 'Look' -533 get-char: # f : (address buffered-file) -> <void> +533 get-char: # f : (address buffered-file) -> <void> 534 # . prolog 535 55/push-EBP 536 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -616,7 +616,7 @@ if ('onhashchange' in window) { 553 5d/pop-to-EBP 554 c3/return 555 -556 is-digit?: # c : int -> bool/EAX +556 is-digit?: # c : int -> bool/EAX 557 # . prolog 558 55/push-EBP 559 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -638,10 +638,10 @@ if ('onhashchange' in window) { 575 576 == data 577 -578 Look: # (char) +578 Look: # (char) 579 00 00 00 00 # = 0 580 -581 _test-output-stream: +581 _test-output-stream: 582 # current write index 583 00 00 00 00 584 # current read index @@ -651,7 +651,7 @@ if ('onhashchange' in window) { 588 # data 589 00 00 00 00 00 00 00 00 # 8 bytes 590 -591 _test-error-stream: +591 _test-error-stream: 592 # current write index 593 00 00 00 00 594 # current read index diff --git a/html/subx/apps/crenshaw2-1b.subx.html b/html/subx/apps/crenshaw2-1b.subx.html index 4445c081..b059f0fc 100644 --- a/html/subx/apps/crenshaw2-1b.subx.html +++ b/html/subx/apps/crenshaw2-1b.subx.html @@ -144,7 +144,7 @@ if ('onhashchange' in window) { 81 cd/syscall 0x80/imm8 82 83 # the main entry point - 84 compile: # in : (address buffered-file), out : fd or (address stream), err : fd or (address stream), ed : (address exit-descriptor) -> <void> + 84 compile: # in : (address buffered-file), out : fd or (address stream), err : fd or (address stream), ed : (address exit-descriptor) -> <void> 85 # . prolog 86 55/push-EBP 87 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -261,7 +261,7 @@ if ('onhashchange' in window) { 198 # no space in 'out'. 199 # Input comes from the global variable 'Look' (first byte) and the argument 200 # 'in' (rest). We leave the next byte from 'in' into 'Look' on exit. -201 get-num: # in : (address buffered-file), out : (address stream), err : fd or (address stream), ed : (address exit-descriptor) -> <void> +201 get-num: # in : (address buffered-file), out : (address stream), err : fd or (address stream), ed : (address exit-descriptor) -> <void> 202 # pseudocode: 203 # if !is-digit?(Look) expected(ed, err, "integer") 204 # do @@ -381,7 +381,7 @@ if ('onhashchange' in window) { 318 5d/pop-to-EBP 319 c3/return 320 -321 test-get-num-reads-single-digit: +321 test-get-num-reads-single-digit: 322 # - check that get-num returns first character if it's a digit 323 # This test uses exit-descriptors. Use EBP for setting up local variables. 324 55/push-EBP @@ -472,7 +472,7 @@ if ('onhashchange' in window) { 409 5d/pop-to-EBP 410 c3/return 411 -412 test-get-num-aborts-on-non-digit-in-Look: +412 test-get-num-aborts-on-non-digit-in-Look: 413 # - check that get-num returns first character if it's a digit 414 # This test uses exit-descriptors. Use EBP for setting up local variables. 415 55/push-EBP @@ -557,7 +557,7 @@ if ('onhashchange' in window) { 494 5d/pop-to-EBP 495 c3/return 496 -497 test-get-num-reads-multiple-digits: +497 test-get-num-reads-multiple-digits: 498 # - check that get-num returns all initial digits until it encounters a non-digit 499 # This test uses exit-descriptors. Use EBP for setting up local variables. 500 55/push-EBP @@ -648,7 +648,7 @@ if ('onhashchange' in window) { 585 5d/pop-to-EBP 586 c3/return 587 -588 test-get-num-reads-multiple-digits-followed-by-nondigit: +588 test-get-num-reads-multiple-digits-followed-by-nondigit: 589 # - check that get-num returns all initial digits until it encounters a non-digit 590 # This test uses exit-descriptors. Use EBP for setting up local variables. 591 55/push-EBP @@ -742,7 +742,7 @@ if ('onhashchange' in window) { 679 ## helpers 680 681 # write(f, "Error: "+s+" expected\n") then stop(ed, 1) -682 expected: # ed : (address exit-descriptor), f : fd or (address stream), s : (address array byte) -> <void> +682 expected: # ed : (address exit-descriptor), f : fd or (address stream), s : (address array byte) -> <void> 683 # . prolog 684 55/push-EBP 685 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -791,7 +791,7 @@ if ('onhashchange' in window) { 728 c3/return 729 730 # read a byte from 'f', and save it in 'Look' -731 get-char: # f : (address buffered-file) -> <void> +731 get-char: # f : (address buffered-file) -> <void> 732 # . prolog 733 55/push-EBP 734 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -813,7 +813,7 @@ if ('onhashchange' in window) { 750 5d/pop-to-EBP 751 c3/return 752 -753 is-digit?: # c : int -> bool/EAX +753 is-digit?: # c : int -> bool/EAX 754 # . prolog 755 55/push-EBP 756 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -835,10 +835,10 @@ if ('onhashchange' in window) { 772 773 == data 774 -775 Look: # (char) +775 Look: # (char) 776 00 00 00 00 # = 0 777 -778 _test-output-stream: +778 _test-output-stream: 779 # current write index 780 00 00 00 00 781 # current read index @@ -848,7 +848,7 @@ if ('onhashchange' in window) { 785 # data 786 00 00 00 00 00 00 00 00 # 8 bytes 787 -788 _test-error-stream: +788 _test-error-stream: 789 # current write index 790 00 00 00 00 791 # current read index diff --git a/html/subx/apps/factorial.subx.html b/html/subx/apps/factorial.subx.html index e1e954c6..2999bbe9 100644 --- a/html/subx/apps/factorial.subx.html +++ b/html/subx/apps/factorial.subx.html @@ -116,7 +116,7 @@ if ('onhashchange' in window) { 55 b8/copy-to-EAX 1/imm32/exit 56 cd/syscall 0x80/imm8 57 - 58 factorial: # n : int -> int/EAX + 58 factorial: # n : int -> int/EAX 59 # . prolog 60 55/push-EBP 61 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -146,7 +146,7 @@ if ('onhashchange' in window) { 85 5d/pop-to-EBP 86 c3/return 87 - 88 test-factorial: + 88 test-factorial: 89 # factorial(5) 90 # . . push args 91 68/push 5/imm32 diff --git a/html/subx/apps/handle.subx.html b/html/subx/apps/handle.subx.html index a7c7c993..3b846c48 100644 --- a/html/subx/apps/handle.subx.html +++ b/html/subx/apps/handle.subx.html @@ -91,7 +91,7 @@ if ('onhashchange' in window) { 30 b8/copy-to-EAX 1/imm32/exit 31 cd/syscall 0x80/imm8 32 - 33 new: # ad : (address allocation-descriptor), n : int, out : (address handle) + 33 new: # ad : (address allocation-descriptor), n : int, out : (address handle) 34 # . prolog 35 55/push-EBP 36 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -139,7 +139,7 @@ if ('onhashchange' in window) { 78 5d/pop-to-EBP 79 c3/return 80 - 81 test-new: # - this test uses the bottom of the stack segment as scratch space + 81 test-new: # - this test uses the bottom of the stack segment as scratch space 82 # . prolog 83 55/push-EBP 84 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -207,7 +207,7 @@ if ('onhashchange' in window) { 146 5d/pop-to-EBP 147 c3/return 148 -149 test-new-failure: +149 test-new-failure: 150 # . prolog 151 55/push-EBP 152 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -269,7 +269,7 @@ if ('onhashchange' in window) { 208 5d/pop-to-EBP 209 c3/return 210 -211 lookup: # h : (handle T) -> EAX : (address T) +211 lookup: # h : (handle T) -> EAX : (address T) 212 # . prolog 213 55/push-EBP 214 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -311,7 +311,7 @@ if ('onhashchange' in window) { 250 5d/pop-to-EBP 251 c3/return 252 -253 test-lookup-success: +253 test-lookup-success: 254 # . prolog 255 55/push-EBP 256 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -361,7 +361,7 @@ if ('onhashchange' in window) { 300 5d/pop-to-EBP 301 c3/return 302 -303 test-lookup-failure: +303 test-lookup-failure: 304 # . prolog 305 55/push-EBP 306 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -426,7 +426,7 @@ if ('onhashchange' in window) { 365 == data 366 367 # Monotonically increasing counter for calls to 'new' -368 Next-alloc-id: +368 Next-alloc-id: 369 01 00 00 00 # 1 370 371 # . . vim:nowrap:textwidth=0 diff --git a/html/subx/apps/hex.subx.html b/html/subx/apps/hex.subx.html index 763f9999..17d17854 100644 --- a/html/subx/apps/hex.subx.html +++ b/html/subx/apps/hex.subx.html @@ -138,7 +138,7 @@ if ('onhashchange' in window) { 75 cd/syscall 0x80/imm8 76 77 # the main entry point - 78 convert: # in : (address buffered-file), out : (address buffered-file), err : (address buffered-file), ed : (address exit-descriptor) -> <void> + 78 convert: # in : (address buffered-file), out : (address buffered-file), err : (address buffered-file), ed : (address exit-descriptor) -> <void> 79 # pseudocode: 80 # repeatedly 81 # EAX = convert-next-octet(in, err, ed) @@ -196,7 +196,7 @@ if ('onhashchange' in window) { 133 # raise an error and abort on all other unexpected bytes 134 # return in EAX an _octet_ containing the binary value of the two hex characters 135 # return 0xffffffff on end of file - 136 convert-next-octet: # in : (address buffered-file), err : (address buffered-file), ed : (address exit-descriptor) -> byte-or-eof/EAX + 136 convert-next-octet: # in : (address buffered-file), err : (address buffered-file), ed : (address exit-descriptor) -> byte-or-eof/EAX 137 # pseudocode: 138 # EAX = scan-next-byte(in, err, ed) 139 # if (EAX == 0xffffffff) return @@ -264,7 +264,7 @@ if ('onhashchange' in window) { 201 5d/pop-to-EBP 202 c3/return 203 - 204 test-convert-next-octet: + 204 test-convert-next-octet: 205 # - check that the first two bytes of the input are assembled into the resulting octet 206 # This test uses exit-descriptors. Use EBP for setting up local variables. 207 55/push-EBP @@ -366,7 +366,7 @@ if ('onhashchange' in window) { 303 5d/pop-to-EBP 304 c3/return 305 - 306 test-convert-next-octet-handles-eof: + 306 test-convert-next-octet-handles-eof: 307 # - check that eof returns the sentinel octet 308 # This test uses exit-descriptors. Use EBP for setting up local variables. 309 55/push-EBP @@ -460,7 +460,7 @@ if ('onhashchange' in window) { 397 5d/pop-to-EBP 398 c3/return 399 - 400 test-convert-next-octet-aborts-on-single-hex-byte: + 400 test-convert-next-octet-aborts-on-single-hex-byte: 401 # - check that a single unaccompanied hex byte aborts 402 # This test uses exit-descriptors. Use EBP for setting up local variables. 403 55/push-EBP @@ -554,7 +554,7 @@ if ('onhashchange' in window) { 491 # return 0xffffffff if file ends without finding a hex byte 492 # on '#' skip all bytes until newline 493 # abort on any other byte - 494 scan-next-byte: # in : (address buffered-file), err : (address buffered-file), ed : (address exit-descriptor) -> byte-or-eof/EAX + 494 scan-next-byte: # in : (address buffered-file), err : (address buffered-file), ed : (address exit-descriptor) -> byte-or-eof/EAX 495 # pseudocode: 496 # repeatedly 497 # EAX = read-byte(in) @@ -633,7 +633,7 @@ if ('onhashchange' in window) { 570 5d/pop-to-EBP 571 c3/return 572 - 573 test-scan-next-byte: + 573 test-scan-next-byte: 574 # - check that the first byte of the input is returned 575 # This test uses exit-descriptors. Use EBP for setting up local variables. 576 55/push-EBP @@ -735,7 +735,7 @@ if ('onhashchange' in window) { 672 5d/pop-to-EBP 673 c3/return 674 - 675 test-scan-next-byte-skips-whitespace: + 675 test-scan-next-byte-skips-whitespace: 676 # - check that the first byte after whitespace is returned 677 # This test uses exit-descriptors. Use EBP for setting up local variables. 678 55/push-EBP @@ -837,7 +837,7 @@ if ('onhashchange' in window) { 774 5d/pop-to-EBP 775 c3/return 776 - 777 test-scan-next-byte-skips-comment: + 777 test-scan-next-byte-skips-comment: 778 # - check that the first byte after a comment (and newline) is returned 779 # This test uses exit-descriptors. Use EBP for setting up local variables. 780 55/push-EBP @@ -955,7 +955,7 @@ if ('onhashchange' in window) { 892 5d/pop-to-EBP 893 c3/return 894 - 895 test-scan-next-byte-skips-comment-and-whitespace: + 895 test-scan-next-byte-skips-comment-and-whitespace: 896 # - check that the first byte after a comment and any further whitespace is returned 897 # This test uses exit-descriptors. Use EBP for setting up local variables. 898 55/push-EBP @@ -1073,7 +1073,7 @@ if ('onhashchange' in window) { 1010 5d/pop-to-EBP 1011 c3/return 1012 -1013 test-scan-next-byte-skips-whitespace-and-comment: +1013 test-scan-next-byte-skips-whitespace-and-comment: 1014 # - check that the first byte after any whitespace and comments is returned 1015 # This test uses exit-descriptors. Use EBP for setting up local variables. 1016 55/push-EBP @@ -1191,7 +1191,7 @@ if ('onhashchange' in window) { 1128 5d/pop-to-EBP 1129 c3/return 1130 -1131 test-scan-next-byte-reads-final-byte: +1131 test-scan-next-byte-reads-final-byte: 1132 # - check that the final byte in input is returned 1133 # This test uses exit-descriptors. Use EBP for setting up local variables. 1134 55/push-EBP @@ -1293,7 +1293,7 @@ if ('onhashchange' in window) { 1230 5d/pop-to-EBP 1231 c3/return 1232 -1233 test-scan-next-byte-handles-eof: +1233 test-scan-next-byte-handles-eof: 1234 # - check that the right sentinel value is returned when there's no data remaining to be read 1235 # This test uses exit-descriptors. Use EBP for setting up local variables. 1236 55/push-EBP @@ -1387,7 +1387,7 @@ if ('onhashchange' in window) { 1324 5d/pop-to-EBP 1325 c3/return 1326 -1327 test-scan-next-byte-aborts-on-invalid-byte: +1327 test-scan-next-byte-aborts-on-invalid-byte: 1328 # - check that the a bad byte immediately aborts 1329 # This test uses exit-descriptors. Use EBP for setting up local variables. 1330 55/push-EBP @@ -1477,7 +1477,7 @@ if ('onhashchange' in window) { 1414 5d/pop-to-EBP 1415 c3/return 1416 -1417 is-hex-lowercase-byte?: # c : byte -> bool/EAX +1417 is-hex-lowercase-byte?: # c : byte -> bool/EAX 1418 # . prolog 1419 55/push-EBP 1420 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -1509,7 +1509,7 @@ if ('onhashchange' in window) { 1446 5d/pop-to-EBP 1447 c3/return 1448 -1449 test-hex-below-0: +1449 test-hex-below-0: 1450 # is-hex-lowercase-byte?(0x2f) 1451 # . . push args 1452 68/push 0x2f/imm32 @@ -1528,7 +1528,7 @@ if ('onhashchange' in window) { 1465 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP 1466 c3/return 1467 -1468 test-hex-0-to-9: +1468 test-hex-0-to-9: 1469 # is-hex-lowercase-byte?(0x30) 1470 # . . push args 1471 68/push 0x30/imm32 @@ -1563,7 +1563,7 @@ if ('onhashchange' in window) { 1500 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP 1501 c3/return 1502 -1503 test-hex-above-9-to-a: +1503 test-hex-above-9-to-a: 1504 # is-hex-lowercase-byte?(0x3a) 1505 # . . push args 1506 68/push 0x3a/imm32 @@ -1582,7 +1582,7 @@ if ('onhashchange' in window) { 1519 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP 1520 c3/return 1521 -1522 test-hex-a-to-f: +1522 test-hex-a-to-f: 1523 # is-hex-lowercase-byte?(0x61) 1524 # . . push args 1525 68/push 0x61/imm32 @@ -1617,7 +1617,7 @@ if ('onhashchange' in window) { 1554 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP 1555 c3/return 1556 -1557 test-hex-above-f: +1557 test-hex-above-f: 1558 # is-hex-lowercase-byte?(0x67) 1559 # . . push args 1560 68/push 0x67/imm32 @@ -1636,7 +1636,7 @@ if ('onhashchange' in window) { 1573 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP 1574 c3/return 1575 -1576 parse-hex-digit: # in/EAX : byte -> out/EAX : num +1576 parse-hex-digit: # in/EAX : byte -> out/EAX : num 1577 # no error checking; accepts argument in EAX 1578 # if EAX <= '9' return EAX - '0' 1579 3d/compare-EAX 0x39/imm32/9 @@ -1648,7 +1648,7 @@ if ('onhashchange' in window) { 1585 2d/subtract-from-EAX 0x57/imm32/a-10 1586 c3/return 1587 -1588 skip-until-newline: # in : (address buffered-file) -> <void> +1588 skip-until-newline: # in : (address buffered-file) -> <void> 1589 # pseudocode: 1590 # push EAX 1591 # repeatedly: @@ -1683,7 +1683,7 @@ if ('onhashchange' in window) { 1620 5d/pop-to-EBP 1621 c3/return 1622 -1623 test-skip-until-newline: +1623 test-skip-until-newline: 1624 # - check that the read pointer points after the newline 1625 # setup 1626 # . clear-stream(_test-stream) @@ -1749,7 +1749,7 @@ if ('onhashchange' in window) { 1686 1687 == data 1688 -1689 _test-error-stream: +1689 _test-error-stream: 1690 # current write index 1691 00 00 00 00 1692 # current read index @@ -1760,7 +1760,7 @@ if ('onhashchange' in window) { 1697 00 00 00 00 00 00 00 00 # 8 bytes 1698 1699 # a test buffered file for _test-stream -1700 _test-error-buffered-file: +1700 _test-error-buffered-file: 1701 # file descriptor or (address stream) 1702 _test-error-stream/imm32 1703 # current write index diff --git a/html/subx/examples/ex10.subx.html b/html/subx/examples/ex10.subx.html index 329f698d..49383f99 100644 --- a/html/subx/examples/ex10.subx.html +++ b/html/subx/examples/ex10.subx.html @@ -92,7 +92,7 @@ if ('onhashchange' in window) { 34 35 # compare two null-terminated ascii strings 36 # reason for the name: the only place we should have null-terminated ascii strings is from commandline args -37 argv-equal: # (s1, s2) : null-terminated ascii strings -> EAX : boolean +37 argv-equal: # (s1, s2) : null-terminated ascii strings -> EAX : boolean 38 # initialize s1 (ECX) and s2 (EDX) 39 8b/copy 1/mod/*+disp8 4/rm32/sib 4/base/ESP 4/index/none . 1/r32/ECX 4/disp8 . # copy *(ESP+4) to ECX 40 8b/copy 1/mod/*+disp8 4/rm32/sib 4/base/ESP 4/index/none . 2/r32/EDX 8/disp8 . # copy *(ESP+8) to EDX diff --git a/html/subx/examples/ex11.subx.html b/html/subx/examples/ex11.subx.html index 30b462f4..54d5982c 100644 --- a/html/subx/examples/ex11.subx.html +++ b/html/subx/examples/ex11.subx.html @@ -89,7 +89,7 @@ if ('onhashchange' in window) { 28 29 # compare a null-terminated ascii string with a more idiomatic length-prefixed byte array 30 # reason for the name: the only place we should have null-terminated ascii strings is from commandline args - 31 kernel-string-equal: # s : null-terminated ascii string, benchmark : length-prefixed ascii string -> EAX : boolean + 31 kernel-string-equal: # s : null-terminated ascii string, benchmark : length-prefixed ascii string -> EAX : boolean 32 # . prolog 33 55/push-EBP 34 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -171,7 +171,7 @@ if ('onhashchange' in window) { 110 111 # - tests 112 -113 test-compare-null-kernel-string-with-empty-array: +113 test-compare-null-kernel-string-with-empty-array: 114 # EAX = kernel-string-equal(Null-kernel-string, "") 115 # . . push args 116 68/push ""/imm32 @@ -191,7 +191,7 @@ if ('onhashchange' in window) { 130 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP 131 c3/return 132 -133 test-compare-null-kernel-string-with-non-empty-array: +133 test-compare-null-kernel-string-with-non-empty-array: 134 # EAX = kernel-string-equal(Null-kernel-string, "Abc") 135 # . . push args 136 68/push "Abc"/imm32 @@ -211,7 +211,7 @@ if ('onhashchange' in window) { 150 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP 151 c3/return 152 -153 test-compare-kernel-string-with-equal-array: +153 test-compare-kernel-string-with-equal-array: 154 # EAX = kernel-string-equal(Abc-kernel-string, "Abc") 155 # . . push args 156 68/push "Abc"/imm32 @@ -231,7 +231,7 @@ if ('onhashchange' in window) { 170 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP 171 c3/return 172 -173 test-compare-kernel-string-with-inequal-array: +173 test-compare-kernel-string-with-inequal-array: 174 # EAX = kernel-string-equal(Abc-kernel-string, "Adc") 175 # . . push args 176 68/push "Adc"/imm32 @@ -251,7 +251,7 @@ if ('onhashchange' in window) { 190 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP 191 c3/return 192 -193 test-compare-kernel-string-with-empty-array: +193 test-compare-kernel-string-with-empty-array: 194 # EAX = kernel-string-equal(Abc-kernel-string, "") 195 # . . push args 196 68/push ""/imm32 @@ -271,7 +271,7 @@ if ('onhashchange' in window) { 210 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP 211 c3/return 212 -213 test-compare-kernel-string-with-shorter-array: +213 test-compare-kernel-string-with-shorter-array: 214 # EAX = kernel-string-equal(Abc-kernel-string, "Ab") 215 # . . push args 216 68/push "Ab"/imm32 @@ -291,7 +291,7 @@ if ('onhashchange' in window) { 230 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP 231 c3/return 232 -233 test-compare-kernel-string-with-longer-array: +233 test-compare-kernel-string-with-longer-array: 234 # EAX = kernel-string-equal(Abc-kernel-string, "Abcd") 235 # . . push args 236 68/push "Abcd"/imm32 @@ -314,7 +314,7 @@ if ('onhashchange' in window) { 253 # - helpers 254 255 # print msg to stderr if a != b, otherwise print "." -256 check-ints-equal: # (a : int, b : int, msg : (address array byte)) -> boolean +256 check-ints-equal: # (a : int, b : int, msg : (address array byte)) -> boolean 257 # . prolog 258 55/push-EBP 259 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -363,7 +363,7 @@ if ('onhashchange' in window) { 302 5d/pop-to-EBP 303 c3/return 304 -305 write-stderr: # s : (address array byte) -> <void> +305 write-stderr: # s : (address array byte) -> <void> 306 # . prolog 307 55/push-EBP 308 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -396,16 +396,16 @@ if ('onhashchange' in window) { 335 336 == data 337 -338 Newline: +338 Newline: 339 # size 340 01 00 00 00 341 # data 342 0a/newline 343 344 # for kernel-string-equal tests -345 Null-kernel-string: +345 Null-kernel-string: 346 00/null -347 Abc-kernel-string: +347 Abc-kernel-string: 348 41/A 62/b 63/c 00/null 349 350 # . . vim:nowrap:textwidth=0 diff --git a/html/subx/examples/ex12.subx.html b/html/subx/examples/ex12.subx.html index e6c1470a..88e939cb 100644 --- a/html/subx/examples/ex12.subx.html +++ b/html/subx/examples/ex12.subx.html @@ -84,7 +84,7 @@ if ('onhashchange' in window) { 27 == data 28 29 # various constants used here were found in the Linux sources (search for file mman-common.h) -30 Mmap-new-segment: # type mmap_arg_struct +30 Mmap-new-segment: # type mmap_arg_struct 31 # addr 32 00 00 00 00 # null 33 # len diff --git a/html/subx/examples/ex4.subx.html b/html/subx/examples/ex4.subx.html index 21d9c19d..98c31507 100644 --- a/html/subx/examples/ex4.subx.html +++ b/html/subx/examples/ex4.subx.html @@ -90,7 +90,7 @@ if ('onhashchange' in window) { 34 35 == data 36 -37 X: +37 X: 38 00 00 00 00 # space for read() to write to 39 40 # . . vim:nowrap:textwidth=0 diff --git a/html/subx/examples/ex6.subx.html b/html/subx/examples/ex6.subx.html index e06a0885..d2d01bed 100644 --- a/html/subx/examples/ex6.subx.html +++ b/html/subx/examples/ex6.subx.html @@ -84,9 +84,9 @@ if ('onhashchange' in window) { 27 28 == data 29 -30 Size: # size of string +30 Size: # size of string 31 0e 00 00 00 # 14 -32 X: # string to print +32 X: # string to print 33 48 65 6c 6c 6f 2c 20 77 6f 72 6c 64 21 0a 00 34 # H e l l o , ␣ w o r l d ! newline null 35 diff --git a/html/subx/examples/ex7.subx.html b/html/subx/examples/ex7.subx.html index 942b9ab2..60cd3ccc 100644 --- a/html/subx/examples/ex7.subx.html +++ b/html/subx/examples/ex7.subx.html @@ -150,13 +150,13 @@ if ('onhashchange' in window) { 93 94 == data 95 - 96 Stream: + 96 Stream: 97 00 00 00 00 - 98 A: + 98 A: 99 61 00 00 00 -100 B: +100 B: 101 00 00 00 00 -102 Filename: +102 Filename: 103 2e 66 6f 6f 00 00 00 00 104 105 # . . vim:nowrap:textwidth=0 diff --git a/html/subx/examples/ex8.subx.html b/html/subx/examples/ex8.subx.html index cadea305..8495f188 100644 --- a/html/subx/examples/ex8.subx.html +++ b/html/subx/examples/ex8.subx.html @@ -92,7 +92,7 @@ if ('onhashchange' in window) { 34 b8/copy-to-EAX 1/imm32/exit 35 cd/syscall 0x80/imm8 36 -37 ascii-length: # s : (address array byte) -> n/EAX +37 ascii-length: # s : (address array byte) -> n/EAX 38 # EDX = s 39 8b/copy 1/mod/*+disp8 4/rm32/sib 4/base/ESP 4/index/none . 2/r32/EDX 4/disp8 . # copy *(ESP+4) to EDX 40 # var result/EAX = 0 diff --git a/html/subx/examples/ex9.subx.html b/html/subx/examples/ex9.subx.html index dfe0a8ba..ab4693d3 100644 --- a/html/subx/examples/ex9.subx.html +++ b/html/subx/examples/ex9.subx.html @@ -95,7 +95,7 @@ if ('onhashchange' in window) { 38 b8/copy-to-EAX 1/imm32/exit 39 cd/syscall 0x80/imm8 40 -41 ascii-difference: # (s1, s2) : null-terminated ascii strings +41 ascii-difference: # (s1, s2) : null-terminated ascii strings 42 # a = first letter of s1 (ECX) 43 8b/copy 1/mod/*+disp8 4/rm32/sib 4/base/ESP 4/index/none 0/r32/EAX 4/disp8 . # copy *(ESP+4) to EAX 44 8b/copy 0/mod/indirect 0/rm32/EAX . . . 0/r32/EAX . . # copy *EAX to EAX -- cgit 1.4.1-2-gfad0