From cb7b403210f13e721739d58dab9000ec51ed2d0a Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Mon, 25 Feb 2019 00:26:48 -0800 Subject: 4989 --- html/subx/apps/hex.subx.html | 68 ++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 34 deletions(-) (limited to 'html/subx/apps/hex.subx.html') diff --git a/html/subx/apps/hex.subx.html b/html/subx/apps/hex.subx.html index 90e08318..94515434 100644 --- a/html/subx/apps/hex.subx.html +++ b/html/subx/apps/hex.subx.html @@ -137,7 +137,7 @@ if ('onhashchange' in window) { 74 # pseudocode: 75 # repeatedly 76 # EAX = convert-next-octet(in, err, ed) - 77 # if (EAX == 0xffffffff) break # eof + 77 # if (EAX == Eof) break 78 # write-byte(out, AL) 79 # flush(out) 80 # @@ -156,8 +156,8 @@ if ('onhashchange' in window) { 93 e8/call convert-next-octet/disp32 94 # . . discard first 2 args 95 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP - 96 # if (EAX == 0xffffffff) break - 97 81 7/subop/compare 3/mod/direct 0/rm32/EAX . . . . . 0xffffffff/imm32 # compare EAX + 96 # if (EAX == Eof) break + 97 81 7/subop/compare 3/mod/direct 0/rm32/EAX . . . . . 0xffffffff/imm32/Eof # compare EAX 98 74/jump-if-equal $convert:loop-end/disp8 99 # write-byte(out, AL) 100 # . . push args @@ -190,14 +190,14 @@ if ('onhashchange' in window) { 127 # on '#' skip bytes until newline 128 # raise an error and abort on all other unexpected bytes 129 # return in EAX an _octet_ containing the binary value of the two hex characters - 130 # return 0xffffffff on end of file - 131 convert-next-octet: # in : (address buffered-file), err : (address buffered-file), ed : (address exit-descriptor) -> byte-or-eof/EAX + 130 # return Eof on reaching end of file + 131 convert-next-octet: # in : (address buffered-file), err : (address buffered-file), ed : (address exit-descriptor) -> byte-or-Eof/EAX 132 # pseudocode: 133 # EAX = scan-next-byte(in, err, ed) - 134 # if (EAX == 0xffffffff) return + 134 # if (EAX == Eof) return 135 # ECX = from-hex-char(EAX) 136 # EAX = scan-next-byte(in, err, ed) - 137 # if (EAX == 0xffffffff) error("partial byte found.") + 137 # if (EAX == Eof) error("partial byte found.") 138 # EAX = from-hex-char(EAX) 139 # EAX = (ECX << 4) | EAX 140 # return @@ -216,8 +216,8 @@ if ('onhashchange' in window) { 153 e8/call scan-next-byte/disp32 154 # . . discard args 155 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP - 156 # if (EAX == 0xffffffff) return - 157 81 7/subop/compare 3/mod/direct 0/rm32/EAX . . . . . 0xffffffff/imm32 # compare EAX + 156 # if (EAX == Eof) return + 157 81 7/subop/compare 3/mod/direct 0/rm32/EAX . . . . . 0xffffffff/imm32/Eof # compare EAX 158 74/jump-if-equal $convert-next-octet:end/disp8 159 # EAX = from-hex-char(EAX) 160 e8/call from-hex-char/disp32 @@ -232,8 +232,8 @@ if ('onhashchange' in window) { 169 e8/call scan-next-byte/disp32 170 # . . discard args 171 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP - 172 # if (EAX == 0xffffffff) error(ed, err, "partial byte found.") - 173 81 7/subop/compare 3/mod/direct 0/rm32/EAX . . . . . 0xffffffff/imm32 # compare EAX + 172 # if (EAX == Eof) error(ed, err, "partial byte found.") + 173 81 7/subop/compare 3/mod/direct 0/rm32/EAX . . . . . 0xffffffff/imm32/Eof # compare EAX 174 75/jump-if-not-equal $convert-next-octet:convert/disp8 175 # . error-byte(ed, err, msg, '.') # reusing error-byte to avoid creating _yet_ another helper 176 # . . push args @@ -361,8 +361,8 @@ if ('onhashchange' in window) { 298 5d/pop-to-EBP 299 c3/return 300 - 301 test-convert-next-octet-handles-eof: - 302 # - check that eof returns the sentinel octet + 301 test-convert-next-octet-handles-Eof: + 302 # - check that reaching end of file returns Eof 303 # This test uses exit-descriptors. Use EBP for setting up local variables. 304 55/push-EBP 305 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -438,17 +438,17 @@ if ('onhashchange' in window) { 375 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP 376 # return if abort 377 81 7/subop/compare 1/mod/*+disp8 1/rm32/ECX . . . . 4/disp8 0/imm32 # compare *(ECX+4) - 378 75/jump-if-not-equal $test-convert-next-octet-handles-eof:end/disp8 - 379 # check-ints-equal(EAX, 0xffffffff, msg) + 378 75/jump-if-not-equal $test-convert-next-octet-handles-Eof:end/disp8 + 379 # check-ints-equal(EAX, Eof, msg) 380 # . . push args - 381 68/push "F - test-convert-next-octet-handles-eof"/imm32 - 382 68/push 0xffffffff/imm32/eof + 381 68/push "F - test-convert-next-octet-handles-Eof"/imm32 + 382 68/push 0xffffffff/imm32/Eof 383 50/push-EAX 384 # . . call 385 e8/call check-ints-equal/disp32 386 # . . discard args 387 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP - 388 $test-convert-next-octet-handles-eof:end: + 388 $test-convert-next-octet-handles-Eof:end: 389 # . epilog 390 # don't restore ESP from EBP; manually reclaim locals 391 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP @@ -546,14 +546,14 @@ if ('onhashchange' in window) { 483 c3/return 484 485 # read whitespace until a hex byte, and return it - 486 # return 0xffffffff if file ends without finding a hex byte + 486 # return Eof if file ends without finding a hex byte 487 # on '#' skip all bytes until newline 488 # abort on any other byte - 489 scan-next-byte: # in : (address buffered-file), err : (address buffered-file), ed : (address exit-descriptor) -> byte-or-eof/EAX + 489 scan-next-byte: # in : (address buffered-file), err : (address buffered-file), ed : (address exit-descriptor) -> byte-or-Eof/EAX 490 # pseudocode: 491 # repeatedly 492 # EAX = read-byte(in) - 493 # if (EAX == 0xffffffff) return EAX + 493 # if (EAX == Eof) return EAX 494 # if (is-hex-digit?(EAX)) return EAX 495 # if (EAX == ' ' or '\t' or '\n') continue 496 # if (EAX == '#') skip-until-newline(in) @@ -571,8 +571,8 @@ if ('onhashchange' in window) { 508 e8/call read-byte/disp32 509 # . . discard args 510 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP - 511 # if (EAX == 0xffffffff) return EAX - 512 3d/compare-with-EAX 0xffffffff/imm32 + 511 # if (EAX == Eof) return EAX + 512 3d/compare-with-EAX 0xffffffff/imm32/Eof 513 74/jump-if-equal $scan-next-byte:end/disp8 514 # if (is-hex-digit?(EAX)) return EAX 515 # . save EAX for now @@ -1288,7 +1288,7 @@ if ('onhashchange' in window) { 1225 5d/pop-to-EBP 1226 c3/return 1227 -1228 test-scan-next-byte-handles-eof: +1228 test-scan-next-byte-handles-Eof: 1229 # - check that the right sentinel value is returned when there's no data remaining to be read 1230 # This test uses exit-descriptors. Use EBP for setting up local variables. 1231 55/push-EBP @@ -1355,7 +1355,7 @@ if ('onhashchange' in window) { 1292 # check that scan-next-byte didn't abort 1293 # . check-ints-equal(ed->value, 0, msg) 1294 # . . push args -1295 68/push "F - test-scan-next-byte-handles-eof: unexpected abort"/imm32 +1295 68/push "F - test-scan-next-byte-handles-Eof: unexpected abort"/imm32 1296 68/push 0/imm32 1297 # . . push ed->value 1298 ff 6/subop/push 1/mod/*+disp8 1/rm32/ECX . . . . 4/disp8 . # push *(ECX+4) @@ -1365,17 +1365,17 @@ if ('onhashchange' in window) { 1302 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP 1303 # return if abort 1304 81 7/subop/compare 1/mod/*+disp8 1/rm32/ECX . . . . 4/disp8 0/imm32 # compare *(ECX+4) -1305 75/jump-if-not-equal $test-scan-next-byte-handles-eof:end/disp8 -1306 # check-ints-equal(EAX, 0xffffffff/eof, msg) +1305 75/jump-if-not-equal $test-scan-next-byte-handles-Eof:end/disp8 +1306 # check-ints-equal(EAX, Eof, msg) 1307 # . . push args -1308 68/push "F - test-scan-next-byte-handles-eof"/imm32 -1309 68/push 0xffffffff/imm32/eof +1308 68/push "F - test-scan-next-byte-handles-Eof"/imm32 +1309 68/push 0xffffffff/imm32/Eof 1310 50/push-EAX 1311 # . . call 1312 e8/call check-ints-equal/disp32 1313 # . . discard args 1314 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP -1315 $test-scan-next-byte-handles-eof:end: +1315 $test-scan-next-byte-handles-Eof:end: 1316 # . epilog 1317 # don't restore ESP from EBP; manually reclaim locals 1318 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP @@ -1477,7 +1477,7 @@ if ('onhashchange' in window) { 1414 # push EAX 1415 # repeatedly: 1416 # EAX = read-byte(in) -1417 # if (EAX == 0xffffffff) break +1417 # if (EAX == Eof) break 1418 # if (EAX == 0x0a) break 1419 # pop EAX 1420 # . prolog @@ -1493,8 +1493,8 @@ if ('onhashchange' in window) { 1430 e8/call read-byte/disp32 1431 # . . discard args 1432 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP -1433 # . if (EAX == 0xffffffff) break -1434 81 7/subop/compare 3/mod/direct 0/rm32/EAX . . . . . 0xffffffff/imm32 # compare EAX +1433 # . if (EAX == Eof) break +1434 81 7/subop/compare 3/mod/direct 0/rm32/EAX . . . . . 0xffffffff/imm32/Eof # compare EAX 1435 74/jump-if-equal $skip-until-newline:end/disp8 1436 # . if (EAX != 0xa/newline) loop 1437 81 7/subop/compare 3/mod/direct 0/rm32/EAX . . . . . 0xa/imm32 # compare EAX @@ -1583,7 +1583,7 @@ if ('onhashchange' in window) { 1520 # data 1521 00 00 00 00 00 00 00 00 # 8 bytes 1522 -1523 # a test buffered file for _test-stream +1523 # a test buffered file for _test-error-stream 1524 _test-error-buffered-file: 1525 # file descriptor or (address stream) 1526 _test-error-stream/imm32 -- cgit 1.4.1-2-gfad0