From 0af2ea07b33ac7c810cfb8f5aa124092e626228b Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Tue, 23 Apr 2019 20:51:58 -0700 Subject: 5119 --- html/subx/058stream-equal.subx.html | 744 ++++++++++++++++-------------------- 1 file changed, 334 insertions(+), 410 deletions(-) (limited to 'html/subx/058stream-equal.subx.html') diff --git a/html/subx/058stream-equal.subx.html b/html/subx/058stream-equal.subx.html index e947be92..0f44395a 100644 --- a/html/subx/058stream-equal.subx.html +++ b/html/subx/058stream-equal.subx.html @@ -23,7 +23,6 @@ a { color:inherit; } .subxTest { color: #5f8700; } .Normal { color: #000000; background-color: #c6c6c6; padding-bottom: 1px; } .subxS2Comment { color: #8a8a8a; } -.SpecialChar { color: #d70000; } --> @@ -280,459 +279,384 @@ if ('onhashchange' in window) { 219 e8/call check-ints-equal/disp32 220 # . . discard args 221 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP -222 # . restore registers -223 58/pop-to-EAX -224 # . epilog -225 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP -226 5d/pop-to-EBP -227 c3/return -228 -229 # scan the next line until newline starting from f->read and compare it with -230 # 's' (ignoring the trailing newline) -231 # on success, set f->read to after the next newline -232 # on failure, leave f->read unmodified -233 # this function is usually used only in tests, so we repeatedly write f->read -234 next-stream-line-equal?: # f : (address stream), s : (address string) -> EAX : boolean -235 # pseudocode: -236 # currf = f->read # bound: f->write -237 # currs = 0 # bound : s->length -238 # while true -239 # if currf >= f->write -240 # return currs >= s->length -241 # if f[currf] == '\n' -242 # ++currf -243 # return currs >= s->length -244 # if (currs >= s->length) return false # the current line of f still has data to match -245 # if (f[currf] != s[currs]) return false -246 # ++currf -247 # ++currs -248 # -249 # collapsing the two branches that can return true: -250 # currf = f->read # bound: f->write -251 # currs = 0 # bound : s->length -252 # while true -253 # if (currf >= f->write) break -254 # if (f[currf] == '\n') break -255 # if (currs >= s->length) return false # the current line of f still has data to match -256 # if (f[currf] != s[currs]) return false -257 # ++currf -258 # ++currs -259 # ++currf # skip '\n' -260 # return currs >= s->length -261 # Here the final `++currf` is sometimes unnecessary (if we're already at the end of the stream) -262 # -263 # registers: -264 # f: ESI -265 # s: EDI -266 # currf: ECX -267 # currs: EDX -268 # f[currf]: EAX -269 # s[currs]: EBX -270 # -271 # . prolog -272 55/push-EBP -273 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP -274 # . save registers -275 51/push-ECX -276 52/push-EDX -277 56/push-ESI -278 57/push-EDI -279 # ESI = f -280 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 8/disp8 . # copy *(EBP+8) to ESI -281 # currf/ECX = f->read -282 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 1/r32/ECX 4/disp8 . # copy *(ESI+4) to ECX -283 # EDI = s -284 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 7/r32/EDI 0xc/disp8 . # copy *(EBP+12) to EDI -285 # currs/EDX = 0 -286 31/xor 3/mod/direct 2/rm32/EDX . . . 2/r32/EDX . . # clear EDX -287 # EAX = EBX = 0 -288 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . . # clear EAX -289 31/xor 3/mod/direct 3/rm32/EBX . . . 3/r32/EBX . . # clear EBX -290 $next-stream-line-equal?:loop: -291 # if (currf >= f->write) break -292 3b/compare 0/mod/indirect 6/rm32/ESI . . . 1/r32/ECX . . # compare ECX with *ESI -293 7d/jump-if-greater-or-equal $next-stream-line-equal?:break/disp8 -294 # AL = *(f->data + f->read) -295 8a/copy-byte 1/mod/*+disp8 4/rm32/sib 6/base/ESI 1/index/ECX . 0/r32/AL 0xc/disp8 . # copy byte at *(ESI+ECX+12) to AL -296 # if (EAX == '\n') break -297 3d/compare-EAX-and 0xa/imm32/newline -298 74/jump-if-equal $next-stream-line-equal?:break/disp8 -299 # if (currs >= s->length) return false -300 3b/compare 0/mod/indirect 7/rm32/EDI . . . 2/r32/EDX . . # compare EDX with *EDI -301 7d/jump-if-greater-or-equal $next-stream-line-equal?:false/disp8 -302 # BL = *(s->data + currs) -303 8a/copy-byte 1/mod/*+disp8 4/rm32/sib 7/base/EDI 2/index/EDX . 3/r32/BL 4/disp8 . # copy byte at *(EDI+EDX+4) to BL -304 # if (EAX != EBX) return false -305 39/compare 3/mod/direct 0/rm32/EAX . . . 3/r32/EBX . . # compare EAX and EBX -306 75/jump-if-not-equal $next-stream-line-equal?:false/disp8 -307 # ++currf -308 41/increment-ECX -309 # ++currs -310 42/increment-EDX -311 eb/jump $next-stream-line-equal?:loop/disp8 -312 $next-stream-line-equal?:break: -313 # ++currf -314 41/increment-ECX -315 # if (currs >= s->length) return true -316 3b/compare 0/mod/indirect 7/rm32/EDI . . . 2/r32/EDX . . # compare EDX with *EDI -317 7c/jump-if-lesser $next-stream-line-equal?:false/disp8 -318 $next-stream-line-equal?:true: -319 b8/copy-to-EAX 1/imm32 -320 # persist f->read on success -321 89/copy 1/mod/*+disp8 6/rm32/ESI . . . 1/r32/ECX 4/disp8 . # copy ECX to *(ESI+4) -322 eb/jump $next-stream-line-equal?:end/disp8 -323 $next-stream-line-equal?:false: -324 b8/copy-to-EAX 0/imm32 -325 $next-stream-line-equal?:end: -326 # . restore registers -327 5f/pop-to-EDI -328 5e/pop-to-ESI -329 5a/pop-to-EDX -330 59/pop-to-ECX -331 # . epilog -332 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP -333 5d/pop-to-EBP -334 c3/return -335 -336 test-next-stream-line-equal-stops-at-newline: -337 # . prolog -338 55/push-EBP -339 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP -340 # clear-stream(_test-stream) -341 # . . push args -342 68/push _test-stream/imm32 -343 # . . call -344 e8/call clear-stream/disp32 -345 # . . discard args -346 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP -347 # write(_test-stream, "Abc\ndef") -348 # . write(_test-stream, "Abc") +222 $check-stream-equal:end: +223 # . restore registers +224 58/pop-to-EAX +225 # . epilog +226 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP +227 5d/pop-to-EBP +228 c3/return +229 +230 # scan the next line until newline starting from f->read and compare it with +231 # 's' (ignoring the trailing newline) +232 # on success, set f->read to after the next newline +233 # on failure, leave f->read unmodified +234 # this function is usually used only in tests, so we repeatedly write f->read +235 next-stream-line-equal?: # f : (address stream), s : (address string) -> EAX : boolean +236 # pseudocode: +237 # currf = f->read # bound: f->write +238 # currs = 0 # bound : s->length +239 # while true +240 # if currf >= f->write +241 # return currs >= s->length +242 # if f[currf] == '\n' +243 # ++currf +244 # return currs >= s->length +245 # if (currs >= s->length) return false # the current line of f still has data to match +246 # if (f[currf] != s[currs]) return false +247 # ++currf +248 # ++currs +249 # +250 # collapsing the two branches that can return true: +251 # currf = f->read # bound: f->write +252 # currs = 0 # bound : s->length +253 # while true +254 # if (currf >= f->write) break +255 # if (f[currf] == '\n') break +256 # if (currs >= s->length) return false # the current line of f still has data to match +257 # if (f[currf] != s[currs]) return false +258 # ++currf +259 # ++currs +260 # ++currf # skip '\n' +261 # return currs >= s->length +262 # Here the final `++currf` is sometimes unnecessary (if we're already at the end of the stream) +263 # +264 # registers: +265 # f: ESI +266 # s: EDI +267 # currf: ECX +268 # currs: EDX +269 # f[currf]: EAX +270 # s[currs]: EBX +271 # +272 # . prolog +273 55/push-EBP +274 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP +275 # . save registers +276 51/push-ECX +277 52/push-EDX +278 56/push-ESI +279 57/push-EDI +280 # ESI = f +281 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 8/disp8 . # copy *(EBP+8) to ESI +282 # currf/ECX = f->read +283 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 1/r32/ECX 4/disp8 . # copy *(ESI+4) to ECX +284 # EDI = s +285 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 7/r32/EDI 0xc/disp8 . # copy *(EBP+12) to EDI +286 # currs/EDX = 0 +287 31/xor 3/mod/direct 2/rm32/EDX . . . 2/r32/EDX . . # clear EDX +288 # EAX = EBX = 0 +289 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . . # clear EAX +290 31/xor 3/mod/direct 3/rm32/EBX . . . 3/r32/EBX . . # clear EBX +291 $next-stream-line-equal?:loop: +292 # if (currf >= f->write) break +293 3b/compare 0/mod/indirect 6/rm32/ESI . . . 1/r32/ECX . . # compare ECX with *ESI +294 7d/jump-if-greater-or-equal $next-stream-line-equal?:break/disp8 +295 # AL = *(f->data + f->read) +296 8a/copy-byte 1/mod/*+disp8 4/rm32/sib 6/base/ESI 1/index/ECX . 0/r32/AL 0xc/disp8 . # copy byte at *(ESI+ECX+12) to AL +297 # if (EAX == '\n') break +298 3d/compare-EAX-and 0xa/imm32/newline +299 74/jump-if-equal $next-stream-line-equal?:break/disp8 +300 # if (currs >= s->length) return false +301 3b/compare 0/mod/indirect 7/rm32/EDI . . . 2/r32/EDX . . # compare EDX with *EDI +302 7d/jump-if-greater-or-equal $next-stream-line-equal?:false/disp8 +303 # BL = *(s->data + currs) +304 8a/copy-byte 1/mod/*+disp8 4/rm32/sib 7/base/EDI 2/index/EDX . 3/r32/BL 4/disp8 . # copy byte at *(EDI+EDX+4) to BL +305 # if (EAX != EBX) return false +306 39/compare 3/mod/direct 0/rm32/EAX . . . 3/r32/EBX . . # compare EAX and EBX +307 75/jump-if-not-equal $next-stream-line-equal?:false/disp8 +308 # ++currf +309 41/increment-ECX +310 # ++currs +311 42/increment-EDX +312 eb/jump $next-stream-line-equal?:loop/disp8 +313 $next-stream-line-equal?:break: +314 # ++currf +315 41/increment-ECX +316 # if (currs >= s->length) return true +317 3b/compare 0/mod/indirect 7/rm32/EDI . . . 2/r32/EDX . . # compare EDX with *EDI +318 7c/jump-if-lesser $next-stream-line-equal?:false/disp8 +319 $next-stream-line-equal?:true: +320 b8/copy-to-EAX 1/imm32 +321 # persist f->read on success +322 89/copy 1/mod/*+disp8 6/rm32/ESI . . . 1/r32/ECX 4/disp8 . # copy ECX to *(ESI+4) +323 eb/jump $next-stream-line-equal?:end/disp8 +324 $next-stream-line-equal?:false: +325 b8/copy-to-EAX 0/imm32 +326 $next-stream-line-equal?:end: +327 # . restore registers +328 5f/pop-to-EDI +329 5e/pop-to-ESI +330 5a/pop-to-EDX +331 59/pop-to-ECX +332 # . epilog +333 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP +334 5d/pop-to-EBP +335 c3/return +336 +337 test-next-stream-line-equal-stops-at-newline: +338 # . prolog +339 55/push-EBP +340 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP +341 # clear-stream(_test-stream) +342 # . . push args +343 68/push _test-stream/imm32 +344 # . . call +345 e8/call clear-stream/disp32 +346 # . . discard args +347 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP +348 # write(_test-stream, "Abc\ndef") 349 # . . push args -350 68/push "Abc"/imm32 +350 68/push "Abc\ndef"/imm32 351 68/push _test-stream/imm32 352 # . . call 353 e8/call write/disp32 354 # . . discard args 355 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP -356 # . write(_test-stream, Newline) +356 # EAX = next-stream-line-equal?(_test-stream, "Abc") 357 # . . push args -358 68/push Newline/imm32 +358 68/push "Abc"/imm32 359 68/push _test-stream/imm32 360 # . . call -361 e8/call write/disp32 +361 e8/call next-stream-line-equal?/disp32 362 # . . discard args 363 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP -364 # . write(_test-stream, "def") +364 # check-ints-equal(EAX, 1, msg) 365 # . . push args -366 68/push "def"/imm32 -367 68/push _test-stream/imm32 -368 # . . call -369 e8/call write/disp32 -370 # . . discard args -371 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP -372 # EAX = next-stream-line-equal?(_test-stream, "Abc") -373 # . . push args -374 68/push "Abc"/imm32 -375 68/push _test-stream/imm32 -376 # . . call -377 e8/call next-stream-line-equal?/disp32 -378 # . . discard args -379 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP -380 # check-ints-equal(EAX, 1, msg) -381 # . . push args -382 68/push "F - test-next-stream-line-equal-stops-at-newline"/imm32 -383 68/push 1/imm32 -384 50/push-EAX +366 68/push "F - test-next-stream-line-equal-stops-at-newline"/imm32 +367 68/push 1/imm32 +368 50/push-EAX +369 # . . call +370 e8/call check-ints-equal/disp32 +371 # . . discard args +372 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP +373 # . epilog +374 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP +375 5d/pop-to-EBP +376 c3/return +377 +378 test-next-stream-line-equal-stops-at-newline-2: +379 # . prolog +380 55/push-EBP +381 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP +382 # clear-stream(_test-stream) +383 # . . push args +384 68/push _test-stream/imm32 385 # . . call -386 e8/call check-ints-equal/disp32 +386 e8/call clear-stream/disp32 387 # . . discard args -388 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP -389 # . epilog -390 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP -391 5d/pop-to-EBP -392 c3/return -393 -394 test-next-stream-line-equal-stops-at-newline-2: -395 # . prolog -396 55/push-EBP -397 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP -398 # clear-stream(_test-stream) -399 # . . push args +388 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP +389 # write(_test-stream, "Abc\ndef") +390 # . . push args +391 68/push "Abc\ndef"/imm32 +392 68/push _test-stream/imm32 +393 # . . call +394 e8/call write/disp32 +395 # . . discard args +396 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP +397 # EAX = next-stream-line-equal?(_test-stream, "def") +398 # . . push args +399 68/push "def"/imm32 400 68/push _test-stream/imm32 401 # . . call -402 e8/call clear-stream/disp32 +402 e8/call next-stream-line-equal?/disp32 403 # . . discard args -404 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP -405 # write(_test-stream, "Abc\ndef") -406 # . write(_test-stream, "Abc") -407 # . . push args -408 68/push "Abc"/imm32 -409 68/push _test-stream/imm32 +404 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP +405 # check-ints-equal(EAX, 0, msg) +406 # . . push args +407 68/push "F - test-next-stream-line-equal-stops-at-newline-2"/imm32 +408 68/push 0/imm32 +409 50/push-EAX 410 # . . call -411 e8/call write/disp32 +411 e8/call check-ints-equal/disp32 412 # . . discard args -413 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP -414 # . write(_test-stream, Newline) -415 # . . push args -416 68/push Newline/imm32 -417 68/push _test-stream/imm32 -418 # . . call -419 e8/call write/disp32 -420 # . . discard args -421 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP -422 # . write(_test-stream, "def") -423 # . . push args -424 68/push "def"/imm32 +413 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP +414 # . epilog +415 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP +416 5d/pop-to-EBP +417 c3/return +418 +419 test-next-stream-line-equal-skips-newline: +420 # . prolog +421 55/push-EBP +422 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP +423 # clear-stream(_test-stream) +424 # . . push args 425 68/push _test-stream/imm32 426 # . . call -427 e8/call write/disp32 +427 e8/call clear-stream/disp32 428 # . . discard args -429 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP -430 # EAX = next-stream-line-equal?(_test-stream, "def") +429 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP +430 # write(_test-stream, "Abc\ndef\n") 431 # . . push args -432 68/push "def"/imm32 +432 68/push "Abc\ndef\n"/imm32 433 68/push _test-stream/imm32 434 # . . call -435 e8/call next-stream-line-equal?/disp32 +435 e8/call write/disp32 436 # . . discard args 437 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP -438 # check-ints-equal(EAX, 0, msg) +438 # next-stream-line-equal?(_test-stream, "Abc") 439 # . . push args -440 68/push "F - test-next-stream-line-equal-stops-at-newline-2"/imm32 -441 68/push 0/imm32 -442 50/push-EAX -443 # . . call -444 e8/call check-ints-equal/disp32 -445 # . . discard args -446 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP -447 # . epilog -448 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP -449 5d/pop-to-EBP -450 c3/return -451 -452 test-next-stream-line-equal-skips-newline: -453 # . prolog -454 55/push-EBP -455 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP -456 # clear-stream(_test-stream) -457 # . . push args -458 68/push _test-stream/imm32 +440 68/push "Abc"/imm32 +441 68/push _test-stream/imm32 +442 # . . call +443 e8/call next-stream-line-equal?/disp32 +444 # . . discard args +445 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP +446 # EAX = next-stream-line-equal?(_test-stream, "def") +447 # . . push args +448 68/push "def"/imm32 +449 68/push _test-stream/imm32 +450 # . . call +451 e8/call next-stream-line-equal?/disp32 +452 # . . discard args +453 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP +454 # check-ints-equal(EAX, 1, msg) +455 # . . push args +456 68/push "F - test-next-stream-line-equal-skips-newline"/imm32 +457 68/push 1/imm32 +458 50/push-EAX 459 # . . call -460 e8/call clear-stream/disp32 +460 e8/call check-ints-equal/disp32 461 # . . discard args -462 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP -463 # write(_test-stream, "Abc\ndef\n") -464 # . write(_test-stream, "Abc") -465 # . . push args -466 68/push "Abc"/imm32 -467 68/push _test-stream/imm32 -468 # . . call -469 e8/call write/disp32 -470 # . . discard args -471 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP -472 # . write(_test-stream, Newline) +462 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP +463 # . epilog +464 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP +465 5d/pop-to-EBP +466 c3/return +467 +468 test-next-stream-line-equal-handles-final-line: +469 # . prolog +470 55/push-EBP +471 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP +472 # clear-stream(_test-stream) 473 # . . push args -474 68/push Newline/imm32 -475 68/push _test-stream/imm32 -476 # . . call -477 e8/call write/disp32 -478 # . . discard args -479 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP -480 # . write(_test-stream, "def") -481 # . . push args -482 68/push "def"/imm32 -483 68/push _test-stream/imm32 -484 # . . call -485 e8/call write/disp32 -486 # . . discard args -487 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP -488 # . write(_test-stream, Newline) -489 # . . push args -490 68/push Newline/imm32 -491 68/push _test-stream/imm32 -492 # . . call -493 e8/call write/disp32 -494 # . . discard args -495 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP -496 # next-stream-line-equal?(_test-stream, "Abc") -497 # . . push args -498 68/push "Abc"/imm32 -499 68/push _test-stream/imm32 -500 # . . call -501 e8/call next-stream-line-equal?/disp32 -502 # . . discard args -503 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP -504 # EAX = next-stream-line-equal?(_test-stream, "def") -505 # . . push args -506 68/push "def"/imm32 -507 68/push _test-stream/imm32 +474 68/push _test-stream/imm32 +475 # . . call +476 e8/call clear-stream/disp32 +477 # . . discard args +478 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP +479 # write(_test-stream, "Abc\ndef") +480 # . . push args +481 68/push "Abc\ndef"/imm32 +482 68/push _test-stream/imm32 +483 # . . call +484 e8/call write/disp32 +485 # . . discard args +486 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP +487 # next-stream-line-equal?(_test-stream, "Abc") +488 # . . push args +489 68/push "Abc"/imm32 +490 68/push _test-stream/imm32 +491 # . . call +492 e8/call next-stream-line-equal?/disp32 +493 # . . discard args +494 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP +495 # EAX = next-stream-line-equal?(_test-stream, "def") +496 # . . push args +497 68/push "def"/imm32 +498 68/push _test-stream/imm32 +499 # . . call +500 e8/call next-stream-line-equal?/disp32 +501 # . . discard args +502 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP +503 # check-ints-equal(EAX, 1, msg) +504 # . . push args +505 68/push "F - test-next-stream-line-equal-skips-newline"/imm32 +506 68/push 1/imm32 +507 50/push-EAX 508 # . . call -509 e8/call next-stream-line-equal?/disp32 +509 e8/call check-ints-equal/disp32 510 # . . discard args -511 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP -512 # check-ints-equal(EAX, 1, msg) -513 # . . push args -514 68/push "F - test-next-stream-line-equal-skips-newline"/imm32 -515 68/push 1/imm32 -516 50/push-EAX -517 # . . call -518 e8/call check-ints-equal/disp32 -519 # . . discard args -520 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP -521 # . epilog -522 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP -523 5d/pop-to-EBP -524 c3/return -525 -526 test-next-stream-line-equal-handles-final-line: -527 # . prolog -528 55/push-EBP -529 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP -530 # clear-stream(_test-stream) -531 # . . push args +511 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP +512 # . epilog +513 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP +514 5d/pop-to-EBP +515 c3/return +516 +517 test-next-stream-line-equal-always-fails-after-Eof: +518 # . prolog +519 55/push-EBP +520 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP +521 # clear-stream(_test-stream) +522 # . . push args +523 68/push _test-stream/imm32 +524 # . . call +525 e8/call clear-stream/disp32 +526 # . . discard args +527 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP +528 # write nothing +529 # EAX = next-stream-line-equal?(_test-stream, "") +530 # . . push args +531 68/push ""/imm32 532 68/push _test-stream/imm32 533 # . . call -534 e8/call clear-stream/disp32 +534 e8/call next-stream-line-equal?/disp32 535 # . . discard args -536 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP -537 # write(_test-stream, "Abc\ndef") -538 # . write(_test-stream, "Abc") -539 # . . push args -540 68/push "Abc"/imm32 -541 68/push _test-stream/imm32 +536 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP +537 # check-ints-equal(EAX, 0, msg) +538 # . . push args +539 68/push "F - test-next-stream-line-equal-always-fails-after-Eof"/imm32 +540 68/push 1/imm32 +541 50/push-EAX 542 # . . call -543 e8/call write/disp32 +543 e8/call check-ints-equal/disp32 544 # . . discard args -545 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP -546 # . write(_test-stream, Newline) +545 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP +546 # EAX = next-stream-line-equal?(_test-stream, "") 547 # . . push args -548 68/push Newline/imm32 +548 68/push ""/imm32 549 68/push _test-stream/imm32 550 # . . call -551 e8/call write/disp32 +551 e8/call next-stream-line-equal?/disp32 552 # . . discard args 553 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP -554 # . write(_test-stream, "def") +554 # check-ints-equal(EAX, 0, msg) 555 # . . push args -556 68/push "def"/imm32 -557 68/push _test-stream/imm32 -558 # . . call -559 e8/call write/disp32 -560 # . . discard args -561 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP -562 # next-stream-line-equal?(_test-stream, "Abc") -563 # . . push args -564 68/push "Abc"/imm32 -565 68/push _test-stream/imm32 -566 # . . call -567 e8/call next-stream-line-equal?/disp32 -568 # . . discard args -569 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP -570 # EAX = next-stream-line-equal?(_test-stream, "def") -571 # . . push args -572 68/push "def"/imm32 -573 68/push _test-stream/imm32 -574 # . . call -575 e8/call next-stream-line-equal?/disp32 -576 # . . discard args -577 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP -578 # check-ints-equal(EAX, 1, msg) -579 # . . push args -580 68/push "F - test-next-stream-line-equal-skips-newline"/imm32 -581 68/push 1/imm32 -582 50/push-EAX -583 # . . call -584 e8/call check-ints-equal/disp32 -585 # . . discard args -586 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP -587 # . epilog -588 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP -589 5d/pop-to-EBP -590 c3/return -591 -592 test-next-stream-line-equal-always-fails-after-Eof: -593 # . prolog -594 55/push-EBP -595 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP -596 # clear-stream(_test-stream) -597 # . . push args -598 68/push _test-stream/imm32 -599 # . . call -600 e8/call clear-stream/disp32 -601 # . . discard args -602 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP -603 # write nothing -604 # EAX = next-stream-line-equal?(_test-stream, "") -605 # . . push args -606 68/push ""/imm32 -607 68/push _test-stream/imm32 -608 # . . call -609 e8/call next-stream-line-equal?/disp32 -610 # . . discard args -611 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP -612 # check-ints-equal(EAX, 0, msg) -613 # . . push args -614 68/push "F - test-next-stream-line-equal-always-fails-after-Eof"/imm32 -615 68/push 1/imm32 -616 50/push-EAX -617 # . . call -618 e8/call check-ints-equal/disp32 -619 # . . discard args -620 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP -621 # EAX = next-stream-line-equal?(_test-stream, "") -622 # . . push args -623 68/push ""/imm32 -624 68/push _test-stream/imm32 -625 # . . call -626 e8/call next-stream-line-equal?/disp32 -627 # . . discard args -628 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP -629 # check-ints-equal(EAX, 0, msg) -630 # . . push args -631 68/push "F - test-next-stream-line-equal-always-fails-after-Eof/2"/imm32 -632 68/push 1/imm32 -633 50/push-EAX -634 # . . call -635 e8/call check-ints-equal/disp32 -636 # . . discard args -637 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP -638 # . epilog -639 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP -640 5d/pop-to-EBP -641 c3/return -642 -643 # helper for later tests -644 check-next-stream-line-equal: -645 # . prolog -646 55/push-EBP -647 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP -648 # . save registers -649 50/push-EAX -650 # EAX = next-stream-line-equal?(f, s) -651 # . . push args -652 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 . # push *(EBP+12) -653 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 . # push *(EBP+8) -654 # . . call -655 e8/call next-stream-line-equal?/disp32 -656 # . . discard args -657 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP -658 # check-ints-equal(EAX, 1, msg) -659 # . . push args -660 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0x10/disp8 . # push *(EBP+16) -661 68/push 1/imm32 -662 50/push-EAX -663 # . . call -664 e8/call check-ints-equal/disp32 -665 # . . discard args -666 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP -667 # . restore registers -668 58/pop-to-EAX -669 # . epilog -670 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP -671 5d/pop-to-EBP -672 c3/return -673 -674 # . . vim:nowrap:textwidth=0 +556 68/push "F - test-next-stream-line-equal-always-fails-after-Eof/2"/imm32 +557 68/push 1/imm32 +558 50/push-EAX +559 # . . call +560 e8/call check-ints-equal/disp32 +561 # . . discard args +562 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP +563 # . epilog +564 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP +565 5d/pop-to-EBP +566 c3/return +567 +568 # helper for later tests +569 check-next-stream-line-equal: +570 # . prolog +571 55/push-EBP +572 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP +573 # . save registers +574 50/push-EAX +575 # EAX = next-stream-line-equal?(f, s) +576 # . . push args +577 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 . # push *(EBP+12) +578 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 . # push *(EBP+8) +579 # . . call +580 e8/call next-stream-line-equal?/disp32 +581 # . . discard args +582 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP +583 # check-ints-equal(EAX, 1, msg) +584 # . . push args +585 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0x10/disp8 . # push *(EBP+16) +586 68/push 1/imm32 +587 50/push-EAX +588 # . . call +589 e8/call check-ints-equal/disp32 +590 # . . discard args +591 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP +592 # . restore registers +593 58/pop-to-EAX +594 # . epilog +595 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP +596 5d/pop-to-EBP +597 c3/return +598 +599 # . . vim:nowrap:textwidth=0 -- cgit 1.4.1-2-gfad0