From f9ec61327a8bf57da6593f445a2712917772959d Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Sun, 9 Dec 2018 23:37:34 -0800 Subject: 4862 --- html/subx/apps/hex.subx.html | 289 +++++++++++++++++++++---------------------- 1 file changed, 144 insertions(+), 145 deletions(-) (limited to 'html') diff --git a/html/subx/apps/hex.subx.html b/html/subx/apps/hex.subx.html index 7bd0b55b..928b233e 100644 --- a/html/subx/apps/hex.subx.html +++ b/html/subx/apps/hex.subx.html @@ -112,7 +112,7 @@ if ('onhashchange' in window) { 46 #? e8/call test-scan-next-byte-handles-eof/disp32 47 #? e8/call test-scan-next-byte-skips-comment/disp32 48 #? e8/call test-scan-next-byte-aborts-on-invalid-byte/disp32 - 49 #? e8/call test-convert-next-hex-byte/disp32 + 49 #? e8/call test-convert-next-octet/disp32 50 e8/call run-tests/disp32 51 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/EBX Num-test-failures/disp32 # copy *Num-test-failures to EBX 52 eb/jump $main:end/disp8 @@ -144,7 +144,7 @@ if ('onhashchange' in window) { 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-hex-byte(in, err, ed) + 81 # EAX = convert-next-octet(in, err, ed) 82 # if EAX == 0xffffffff break # eof 83 # write-byte(out, AL) 84 # flush(out) @@ -155,13 +155,13 @@ if ('onhashchange' in window) { 89 # . save registers 90 50/push-EAX 91 $convert:loop: - 92 # EAX = convert-next-hex-byte(in, err, ed) + 92 # EAX = convert-next-octet(in, err, ed) 93 # . . push args 94 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x14/disp8 . # push *(EBP+20) 95 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x10/disp8 . # push *(EBP+16) 96 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) 97 # . . call - 98 e8/call convert-next-hex-byte/disp32 + 98 e8/call convert-next-octet/disp32 99 # . . discard first 2 args 100 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP 101 # if EAX == 0xffffffff break @@ -199,7 +199,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-hex-byte: # 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 @@ -226,7 +226,7 @@ if ('onhashchange' in window) { 160 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP 161 # if (EAX == 0xffffffff) return 162 81 7/subop/compare 3/mod/direct 0/rm32/EAX . . . . . 0xffffffff/imm32 # compare EAX - 163 74/jump-if-equal $convert-next-hex-byte:end/disp8 + 163 74/jump-if-equal $convert-next-octet:end/disp8 164 # EAX = parse-hex-digit(EAX) 165 e8/call parse-hex-digit/disp32 166 # ECX = EAX @@ -242,16 +242,16 @@ if ('onhashchange' in window) { 176 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP 177 # if (EAX == 0xffffffff) error(ed, err, "partial byte found.") 178 81 7/subop/compare 3/mod/direct 0/rm32/EAX . . . . . 0xffffffff/imm32 # compare EAX - 179 75/jump-if-not-equal $convert-next-hex-byte:convert/disp8 + 179 75/jump-if-not-equal $convert-next-octet:convert/disp8 180 # . error-byte(ed, err, msg, '.') # reusing error-byte to avoid creating _yet_ another helper 181 # . . push args 182 68/push 0x2e/imm32/period/dummy - 183 68/push "convert-next-hex-byte: partial byte found"/imm32 + 183 68/push "convert-next-octet: partial byte found"/imm32 184 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0xc/disp8 . # push *(EBP+12) 185 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x10/disp8 . # push *(EBP+16) 186 # . . call 187 e8/call error-byte/disp32 # never returns - 188 $convert-next-hex-byte:convert: + 188 $convert-next-octet:convert: 189 # EAX = parse-hex-digit(EAX) 190 e8/call parse-hex-digit/disp32 191 # EAX = (ECX << 4) | EAX @@ -259,7 +259,7 @@ if ('onhashchange' in window) { 193 c1/shift 4/subop/left 3/mod/direct 1/rm32/ECX . . . . . 4/imm8 # shift ECX left by 4 bits 194 # . EAX |= ECX 195 09/or 3/mod/direct 0/rm32/EAX . . . 1/r32/ECX . . # EAX = bitwise OR with ECX - 196 $convert-next-hex-byte:end: + 196 $convert-next-octet:end: 197 # . restore registers 198 59/pop-to-ECX 199 # . epilog @@ -267,7 +267,7 @@ if ('onhashchange' in window) { 201 5d/pop-to-EBP 202 c3/return 203 - 204 test-convert-next-hex-byte: + 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 @@ -314,35 +314,35 @@ if ('onhashchange' in window) { 248 e8/call write/disp32 249 # . . discard args 250 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP - 251 # initialize exit-descriptor 'ed' for the call to 'convert-next-hex-byte' below + 251 # initialize exit-descriptor 'ed' for the call to 'convert-next-octet' below 252 # . var ed/ECX : exit-descriptor 253 81 5/subop/subtract 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # subtract from ESP 254 8d/copy-address 0/mod/indirect 4/rm32/sib 4/base/ESP 4/index/none . 1/r32/ECX . . # copy ESP to ECX 255 # . tailor-exit-descriptor(ed, 12) 256 # . . push args - 257 68/push 0xc/imm32/nbytes-of-args-for-convert-next-hex-byte + 257 68/push 0xc/imm32/nbytes-of-args-for-convert-next-octet 258 51/push-ECX/ed 259 # . . call 260 e8/call tailor-exit-descriptor/disp32 261 # . . discard args 262 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP - 263 # EAX = convert-next-hex-byte(_test-buffered-file, _test-error-buffered-file, ed) + 263 # EAX = convert-next-octet(_test-buffered-file, _test-error-buffered-file, ed) 264 # . . push args 265 51/push-ECX/ed 266 68/push _test-error-buffered-file/imm32 267 68/push _test-buffered-file/imm32 268 # . . call - 269 e8/call convert-next-hex-byte/disp32 + 269 e8/call convert-next-octet/disp32 270 # registers except ESP may be clobbered at this point - 271 # pop args to convert-next-hex-bytes + 271 # pop args to convert-next-octet 272 # . . discard first 2 args 273 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP 274 # . . restore ed 275 59/pop-to-ECX - 276 # check that convert-next-hex-byte didn't abort + 276 # check that convert-next-octet didn't abort 277 # . check-ints-equal(ed->value, 0, msg) 278 # . . push args - 279 68/push "F - test-convert-next-hex-byte: unexpected abort"/imm32 + 279 68/push "F - test-convert-next-octet: unexpected abort"/imm32 280 68/push 0/imm32 281 # . . push ed->value 282 ff 6/subop/push 1/mod/*+disp8 1/rm32/ECX . . . . 4/disp8 . # push *(ECX+4) @@ -352,24 +352,24 @@ if ('onhashchange' in window) { 286 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP 287 # return if abort 288 81 7/subop/compare 1/mod/*+disp8 1/rm32/ECX . . . . 4/disp8 0/imm32 # compare *(ECX+4) - 289 75/jump-if-not-equal $test-convert-next-hex-byte:end/disp8 + 289 75/jump-if-not-equal $test-convert-next-octet:end/disp8 290 # check-ints-equal(EAX, 0xab, msg) 291 # . . push args - 292 68/push "F - test-convert-next-hex-byte"/imm32 + 292 68/push "F - test-convert-next-octet"/imm32 293 68/push 0xab/imm32/ab 294 50/push-EAX 295 # . . call 296 e8/call check-ints-equal/disp32 297 # . . discard args 298 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP - 299 $test-convert-next-hex-byte:end: + 299 $test-convert-next-octet:end: 300 # . epilog 301 # don't restore ESP from EBP; manually reclaim locals 302 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP 303 5d/pop-to-EBP 304 c3/return 305 - 306 test-convert-next-hex-byte-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 @@ -408,35 +408,35 @@ if ('onhashchange' in window) { 342 # . . discard args 343 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP 344 # don't initialize '_test-stream' - 345 # initialize exit-descriptor 'ed' for the call to 'convert-next-hex-byte' below + 345 # initialize exit-descriptor 'ed' for the call to 'convert-next-octet' below 346 # . var ed/ECX : exit-descriptor 347 81 5/subop/subtract 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # subtract from ESP 348 8d/copy-address 0/mod/indirect 4/rm32/sib 4/base/ESP 4/index/none . 1/r32/ECX . . # copy ESP to ECX 349 # . tailor-exit-descriptor(ed, 12) 350 # . . push args - 351 68/push 0xc/imm32/nbytes-of-args-for-convert-next-hex-byte + 351 68/push 0xc/imm32/nbytes-of-args-for-convert-next-octet 352 51/push-ECX/ed 353 # . . call 354 e8/call tailor-exit-descriptor/disp32 355 # . . discard args 356 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP - 357 # EAX = convert-next-hex-byte(_test-buffered-file, _test-error-buffered-file, ed) + 357 # EAX = convert-next-octet(_test-buffered-file, _test-error-buffered-file, ed) 358 # . . push args 359 51/push-ECX/ed 360 68/push _test-error-buffered-file/imm32 361 68/push _test-buffered-file/imm32 362 # . . call - 363 e8/call convert-next-hex-byte/disp32 + 363 e8/call convert-next-octet/disp32 364 # registers except ESP may be clobbered at this point - 365 # pop args to convert-next-hex-bytes + 365 # pop args to convert-next-octet 366 # . . discard first 2 args 367 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP 368 # . . restore ed 369 59/pop-to-ECX - 370 # check that convert-next-hex-byte didn't abort + 370 # check that convert-next-octet didn't abort 371 # . check-ints-equal(ed->value, 0, msg) 372 # . . push args - 373 68/push "F - test-convert-next-hex-byte: unexpected abort"/imm32 + 373 68/push "F - test-convert-next-octet: unexpected abort"/imm32 374 68/push 0/imm32 375 # . . push ed->value 376 ff 6/subop/push 1/mod/*+disp8 1/rm32/ECX . . . . 4/disp8 . # push *(ECX+4) @@ -446,24 +446,24 @@ if ('onhashchange' in window) { 380 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP 381 # return if abort 382 81 7/subop/compare 1/mod/*+disp8 1/rm32/ECX . . . . 4/disp8 0/imm32 # compare *(ECX+4) - 383 75/jump-if-not-equal $test-convert-next-hex-byte-handles-eof:end/disp8 + 383 75/jump-if-not-equal $test-convert-next-octet-handles-eof:end/disp8 384 # check-ints-equal(EAX, 0xffffffff, msg) 385 # . . push args - 386 68/push "F - test-convert-next-hex-byte-handles-eof"/imm32 + 386 68/push "F - test-convert-next-octet-handles-eof"/imm32 387 68/push 0xffffffff/imm32/eof 388 50/push-EAX 389 # . . call 390 e8/call check-ints-equal/disp32 391 # . . discard args 392 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP - 393 $test-convert-next-hex-byte-handles-eof:end: + 393 $test-convert-next-octet-handles-eof:end: 394 # . epilog 395 # don't restore ESP from EBP; manually reclaim locals 396 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP 397 5d/pop-to-EBP 398 c3/return 399 - 400 test-convert-next-hex-byte-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 @@ -510,35 +510,35 @@ if ('onhashchange' in window) { 444 e8/call write/disp32 445 # . . discard args 446 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP - 447 # initialize exit-descriptor 'ed' for the call to 'convert-next-hex-byte' below + 447 # initialize exit-descriptor 'ed' for the call to 'convert-next-octet' below 448 # . var ed/ECX : exit-descriptor 449 81 5/subop/subtract 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # subtract from ESP 450 8d/copy-address 0/mod/indirect 4/rm32/sib 4/base/ESP 4/index/none . 1/r32/ECX . . # copy ESP to ECX 451 # . tailor-exit-descriptor(ed, 12) 452 # . . push args - 453 68/push 0xc/imm32/nbytes-of-args-for-convert-next-hex-byte + 453 68/push 0xc/imm32/nbytes-of-args-for-convert-next-octet 454 51/push-ECX/ed 455 # . . call 456 e8/call tailor-exit-descriptor/disp32 457 # . . discard args 458 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP - 459 # EAX = convert-next-hex-byte(_test-buffered-file, _test-error-buffered-file, ed) + 459 # EAX = convert-next-octet(_test-buffered-file, _test-error-buffered-file, ed) 460 # . . push args 461 51/push-ECX/ed 462 68/push _test-error-buffered-file/imm32 463 68/push _test-buffered-file/imm32 464 # . . call - 465 e8/call convert-next-hex-byte/disp32 + 465 e8/call convert-next-octet/disp32 466 # registers except ESP may be clobbered at this point - 467 # pop args to convert-next-hex-bytes + 467 # pop args to convert-next-octet 468 # . . discard first 2 args 469 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP 470 # . . restore ed 471 59/pop-to-ECX - 472 # check that convert-next-hex-byte aborted + 472 # check that convert-next-octet aborted 473 # . check-ints-equal(ed->value, 2, msg) 474 # . . push args - 475 68/push "F - test-convert-next-hex-byte-aborts-on-single-hex-byte: unexpected abort"/imm32 + 475 68/push "F - test-convert-next-octet-aborts-on-single-hex-byte: unexpected abort"/imm32 476 68/push 2/imm32 477 # . . push ed->value 478 ff 6/subop/push 1/mod/*+disp8 1/rm32/ECX . . . . 4/disp8 . # push *(ECX+4) @@ -546,7 +546,7 @@ if ('onhashchange' in window) { 480 e8/call check-ints-equal/disp32 481 # . . discard args 482 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP - 483 $test-convert-next-hex-byte-aborts-on-single-hex-byte:end: + 483 $test-convert-next-octet-aborts-on-single-hex-byte:end: 484 # . epilog 485 # don't restore ESP from EBP; manually reclaim locals 486 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP @@ -563,9 +563,9 @@ if ('onhashchange' in window) { 497 # EAX = read-byte(in) 498 # if EAX == 0xffffffff return EAX 499 # if is-hex-lowercase-byte?(EAX) return EAX - 500 # if EAX == 0x20 continue + 500 # if EAX == ' ' or '\t' or '\n' continue 501 # if EAX == '#' skip-until-newline(in) - 502 # else error-byte(ed, err, "unexpected byte: " EAX) + 502 # else error-byte(ed, err, "invalid byte: " EAX) 503 # 504 # . prolog 505 55/push-EBP @@ -1675,108 +1675,107 @@ if ('onhashchange' in window) { 1609 # . if EAX == 0xffffffff break 1610 81 7/subop/compare 3/mod/direct 0/rm32/EAX . . . . . 0xffffffff/imm32 # compare EAX 1611 74/jump-if-equal $skip-until-newline:end/disp8 -1612 $aa: -1613 # . if EAX != 0xa/newline loop -1614 81 7/subop/compare 3/mod/direct 0/rm32/EAX . . . . . 0xa/imm32 # compare EAX -1615 75/jump-if-not-equal $skip-until-newline:loop/disp8 -1616 $skip-until-newline:end: -1617 # . restore registers -1618 58/pop-to-EAX -1619 # . epilog -1620 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP -1621 5d/pop-to-EBP -1622 c3/return -1623 -1624 test-skip-until-newline: -1625 # - check that the read pointer points after the newline -1626 # setup -1627 # . clear-stream(_test-stream) -1628 # . . push args -1629 68/push _test-stream/imm32 -1630 # . . call -1631 e8/call clear-stream/disp32 -1632 # . . discard args -1633 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP -1634 # . clear-stream(_test-buffered-file+4) -1635 # . . push args -1636 b8/copy-to-EAX _test-buffered-file/imm32 -1637 05/add-to-EAX 4/imm32 -1638 50/push-EAX -1639 # . . call -1640 e8/call clear-stream/disp32 -1641 # . . discard args -1642 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP -1643 # initialize '_test-stream' to "abc\nde" -1644 # . write(_test-stream, "abc") -1645 # . . push args -1646 68/push "abc"/imm32 -1647 68/push _test-stream/imm32 -1648 # . . call -1649 e8/call write/disp32 -1650 # . . discard args -1651 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP -1652 # . write(_test-stream, Newline) -1653 # . . push args -1654 68/push Newline/imm32 -1655 68/push _test-stream/imm32 -1656 # . . call -1657 e8/call write/disp32 -1658 # . . discard args -1659 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP -1660 # . write(_test-stream, "de") -1661 # . . push args -1662 68/push "de"/imm32 -1663 68/push _test-stream/imm32 -1664 # . . call -1665 e8/call write/disp32 -1666 # . . discard args -1667 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP -1668 # skip-until-newline(_test-buffered-file) -1669 # . . push args -1670 68/push _test-buffered-file/imm32 -1671 # . . call -1672 e8/call skip-until-newline/disp32 -1673 # . . discard args -1674 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP -1675 # check-ints-equal(_test-buffered-file->read, 4, msg) -1676 # . . push args -1677 68/push "F - test-skip-until-newline"/imm32 -1678 68/push 4/imm32 -1679 b8/copy-to-EAX _test-buffered-file/imm32 -1680 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 8/disp8 . # push *(EAX+8) -1681 # . . call -1682 e8/call check-ints-equal/disp32 -1683 # . . discard args -1684 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP -1685 # . end -1686 c3/return -1687 -1688 == data -1689 -1690 _test-error-stream: -1691 # current write index -1692 00 00 00 00 -1693 # current read index -1694 00 00 00 00 -1695 # length (= 8) -1696 08 00 00 00 -1697 # data -1698 00 00 00 00 00 00 00 00 # 8 bytes -1699 -1700 # a test buffered file for _test-stream -1701 _test-error-buffered-file: -1702 # file descriptor or (address stream) -1703 _test-error-stream/imm32 -1704 # current write index -1705 00 00 00 00 -1706 # current read index -1707 00 00 00 00 -1708 # length (6) -1709 06 00 00 00 -1710 # data -1711 00 00 00 00 00 00 # 6 bytes -1712 -1713 # . . vim:nowrap:textwidth=0 +1612 # . if EAX != 0xa/newline loop +1613 81 7/subop/compare 3/mod/direct 0/rm32/EAX . . . . . 0xa/imm32 # compare EAX +1614 75/jump-if-not-equal $skip-until-newline:loop/disp8 +1615 $skip-until-newline:end: +1616 # . restore registers +1617 58/pop-to-EAX +1618 # . epilog +1619 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP +1620 5d/pop-to-EBP +1621 c3/return +1622 +1623 test-skip-until-newline: +1624 # - check that the read pointer points after the newline +1625 # setup +1626 # . clear-stream(_test-stream) +1627 # . . push args +1628 68/push _test-stream/imm32 +1629 # . . call +1630 e8/call clear-stream/disp32 +1631 # . . discard args +1632 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP +1633 # . clear-stream(_test-buffered-file+4) +1634 # . . push args +1635 b8/copy-to-EAX _test-buffered-file/imm32 +1636 05/add-to-EAX 4/imm32 +1637 50/push-EAX +1638 # . . call +1639 e8/call clear-stream/disp32 +1640 # . . discard args +1641 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP +1642 # initialize '_test-stream' to "abc\nde" +1643 # . write(_test-stream, "abc") +1644 # . . push args +1645 68/push "abc"/imm32 +1646 68/push _test-stream/imm32 +1647 # . . call +1648 e8/call write/disp32 +1649 # . . discard args +1650 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP +1651 # . write(_test-stream, Newline) +1652 # . . push args +1653 68/push Newline/imm32 +1654 68/push _test-stream/imm32 +1655 # . . call +1656 e8/call write/disp32 +1657 # . . discard args +1658 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP +1659 # . write(_test-stream, "de") +1660 # . . push args +1661 68/push "de"/imm32 +1662 68/push _test-stream/imm32 +1663 # . . call +1664 e8/call write/disp32 +1665 # . . discard args +1666 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP +1667 # skip-until-newline(_test-buffered-file) +1668 # . . push args +1669 68/push _test-buffered-file/imm32 +1670 # . . call +1671 e8/call skip-until-newline/disp32 +1672 # . . discard args +1673 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP +1674 # check-ints-equal(_test-buffered-file->read, 4, msg) +1675 # . . push args +1676 68/push "F - test-skip-until-newline"/imm32 +1677 68/push 4/imm32 +1678 b8/copy-to-EAX _test-buffered-file/imm32 +1679 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 8/disp8 . # push *(EAX+8) +1680 # . . call +1681 e8/call check-ints-equal/disp32 +1682 # . . discard args +1683 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP +1684 # . end +1685 c3/return +1686 +1687 == data +1688 +1689 _test-error-stream: +1690 # current write index +1691 00 00 00 00 +1692 # current read index +1693 00 00 00 00 +1694 # length (= 8) +1695 08 00 00 00 +1696 # data +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: +1701 # file descriptor or (address stream) +1702 _test-error-stream/imm32 +1703 # current write index +1704 00 00 00 00 +1705 # current read index +1706 00 00 00 00 +1707 # length (6) +1708 06 00 00 00 +1709 # data +1710 00 00 00 00 00 00 # 6 bytes +1711 +1712 # . . vim:nowrap:textwidth=0 -- cgit 1.4.1-2-gfad0