From af326d9e399f3834a81284f61dde2f0caaf6dd15 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Sat, 29 Feb 2020 05:53:13 -0800 Subject: 6070 --- 075print-int-decimal.subx | 12 +-- apps/assort | Bin 40722 -> 40720 bytes apps/braces | Bin 42416 -> 42414 bytes apps/calls | Bin 47077 -> 47075 bytes apps/crenshaw2-1 | Bin 40130 -> 40128 bytes apps/crenshaw2-1b | Bin 40677 -> 40675 bytes apps/dquotes | Bin 44372 -> 44370 bytes apps/factorial | Bin 39149 -> 39147 bytes apps/handle | Bin 40047 -> 40045 bytes apps/hex | Bin 42969 -> 42967 bytes apps/mu | Bin 160792 -> 160790 bytes apps/mu.subx | 2 +- apps/pack | Bin 53114 -> 53112 bytes apps/sigils | Bin 54801 -> 54799 bytes apps/survey | Bin 49963 -> 49961 bytes apps/tests | Bin 39520 -> 39518 bytes html/075print-int-decimal.subx.html | 186 ++++++++++++++++++------------------ html/apps/mu.subx.html | 2 +- 18 files changed, 99 insertions(+), 103 deletions(-) diff --git a/075print-int-decimal.subx b/075print-int-decimal.subx index 6967a2a7..19fae94b 100644 --- a/075print-int-decimal.subx +++ b/075print-int-decimal.subx @@ -312,16 +312,14 @@ is-decimal-digit?: # c: byte -> eax: boolean 51/push-ecx # ecx = c 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 1/r32/ecx 8/disp8 . # copy *(ebp+8) to ecx + # result = false + b8/copy-to-eax 0/imm32/false # return false if c < '0' 81 7/subop/compare 3/mod/direct 1/rm32/ecx . . . . . 0x30/imm32 # compare ecx - 7c/jump-if-< $is-decimal-digit?:false/disp8 - # return true if c <= '9' + 7c/jump-if-< $is-decimal-digit?:end/disp8 + # return (c <= '9') 81 7/subop/compare 3/mod/direct 1/rm32/ecx . . . . . 0x39/imm32 # compare ecx - 7e/jump-if-<= $is-decimal-digit?:true/disp8 - # otherwise return false -$is-decimal-digit?:false: - b8/copy-to-eax 0/imm32/false - eb/jump $is-decimal-digit?:end/disp8 + 7f/jump-if-> $is-decimal-digit?:end/disp8 $is-decimal-digit?:true: b8/copy-to-eax 1/imm32/true $is-decimal-digit?:end: diff --git a/apps/assort b/apps/assort index 5a3a32a3..413fd903 100755 Binary files a/apps/assort and b/apps/assort differ diff --git a/apps/braces b/apps/braces index 3f85235e..541ea51f 100755 Binary files a/apps/braces and b/apps/braces differ diff --git a/apps/calls b/apps/calls index c524a9d2..7f81b966 100755 Binary files a/apps/calls and b/apps/calls differ diff --git a/apps/crenshaw2-1 b/apps/crenshaw2-1 index b87f041b..38762989 100755 Binary files a/apps/crenshaw2-1 and b/apps/crenshaw2-1 differ diff --git a/apps/crenshaw2-1b b/apps/crenshaw2-1b index b7294aeb..edd330ff 100755 Binary files a/apps/crenshaw2-1b and b/apps/crenshaw2-1b differ diff --git a/apps/dquotes b/apps/dquotes index bb137fec..8edb4c6d 100755 Binary files a/apps/dquotes and b/apps/dquotes differ diff --git a/apps/factorial b/apps/factorial index cd402a60..5fd210cd 100755 Binary files a/apps/factorial and b/apps/factorial differ diff --git a/apps/handle b/apps/handle index 7922f7b4..8ec603e8 100755 Binary files a/apps/handle and b/apps/handle differ diff --git a/apps/hex b/apps/hex index ca85716e..7fe1537d 100755 Binary files a/apps/hex and b/apps/hex differ diff --git a/apps/mu b/apps/mu index 37ab1d90..7ed2734a 100755 Binary files a/apps/mu and b/apps/mu differ diff --git a/apps/mu.subx b/apps/mu.subx index c65bac17..2756a0d1 100644 --- a/apps/mu.subx +++ b/apps/mu.subx @@ -8367,7 +8367,7 @@ subx-type-equal?: # a: (handle tree type-id), b: (handle tree type-id) -> resul # return alit == blit 39/compare %eax 1/r32/ecx 74/jump-if-= $subx-type-equal?:true/disp8 -$subx-type-equal?:false: +$subx-type-equal?:false: # TODO: replace with setcc b8/copy-to-eax 0/imm32/false eb/jump $subx-type-equal?:end/disp8 $subx-type-equal?:true: diff --git a/apps/pack b/apps/pack index 009660eb..44f51c28 100755 Binary files a/apps/pack and b/apps/pack differ diff --git a/apps/sigils b/apps/sigils index 0e4e03d3..8160e494 100755 Binary files a/apps/sigils and b/apps/sigils differ diff --git a/apps/survey b/apps/survey index 7657ae38..21706977 100755 Binary files a/apps/survey and b/apps/survey differ diff --git a/apps/tests b/apps/tests index fbdbe5d2..24e6b812 100755 Binary files a/apps/tests and b/apps/tests differ diff --git a/html/075print-int-decimal.subx.html b/html/075print-int-decimal.subx.html index 21f4811e..a9753eea 100644 --- a/html/075print-int-decimal.subx.html +++ b/html/075print-int-decimal.subx.html @@ -348,100 +348,98 @@ if ('onhashchange' in window) { 312 51/push-ecx 313 # ecx = c 314 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 1/r32/ecx 8/disp8 . # copy *(ebp+8) to ecx -315 # return false if c < '0' -316 81 7/subop/compare 3/mod/direct 1/rm32/ecx . . . . . 0x30/imm32 # compare ecx -317 7c/jump-if-< $is-decimal-digit?:false/disp8 -318 # return true if c <= '9' -319 81 7/subop/compare 3/mod/direct 1/rm32/ecx . . . . . 0x39/imm32 # compare ecx -320 7e/jump-if-<= $is-decimal-digit?:true/disp8 -321 # otherwise return false -322 $is-decimal-digit?:false: -323 b8/copy-to-eax 0/imm32/false -324 eb/jump $is-decimal-digit?:end/disp8 -325 $is-decimal-digit?:true: -326 b8/copy-to-eax 1/imm32/true -327 $is-decimal-digit?:end: -328 # . restore registers -329 59/pop-to-ecx -330 # . epilogue -331 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . . # copy ebp to esp -332 5d/pop-to-ebp -333 c3/return -334 -335 test-is-decimal-digit-below-0: -336 # eax = is-decimal-digit?(0x2f) -337 # . . push args -338 68/push 0x2f/imm32 -339 # . . call -340 e8/call is-decimal-digit?/disp32 -341 # . . discard args -342 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp -343 # check-ints-equal(eax, 0, msg) -344 # . . push args -345 68/push "F - test-is-decimal-digit-below-0"/imm32 -346 68/push 0/imm32/false -347 50/push-eax -348 # . . call -349 e8/call check-ints-equal/disp32 -350 # . . discard args -351 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp -352 c3/return -353 -354 test-is-decimal-digit-0-to-9: -355 # eax = is-decimal-digit?(0x30) -356 # . . push args -357 68/push 0x30/imm32 -358 # . . call -359 e8/call is-decimal-digit?/disp32 -360 # . . discard args -361 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp -362 # check-ints-equal(eax, 1, msg) -363 # . . push args -364 68/push "F - test-is-decimal-digit-at-0"/imm32 -365 68/push 1/imm32/true -366 50/push-eax -367 # . . call -368 e8/call check-ints-equal/disp32 -369 # . . discard args -370 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp -371 # eax = is-decimal-digit?(0x39) -372 # . . push args -373 68/push 0x39/imm32 -374 # . . call -375 e8/call is-decimal-digit?/disp32 -376 # . . discard args -377 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp -378 # check-ints-equal(eax, 1, msg) -379 # . . push args -380 68/push "F - test-is-decimal-digit-at-9"/imm32 -381 68/push 1/imm32/true -382 50/push-eax -383 # . . call -384 e8/call check-ints-equal/disp32 -385 # . . discard args -386 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp -387 c3/return -388 -389 test-is-decimal-digit-above-9: -390 # eax = is-decimal-digit?(0x3a) -391 # . . push args -392 68/push 0x3a/imm32 -393 # . . call -394 e8/call is-decimal-digit?/disp32 -395 # . . discard args -396 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp -397 # check-ints-equal(eax, 0, msg) -398 # . . push args -399 68/push "F - test-is-decimal-digit-above-9"/imm32 -400 68/push 0/imm32/false -401 50/push-eax -402 # . . call -403 e8/call check-ints-equal/disp32 -404 # . . discard args -405 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp -406 c3/return -407 -408 # . . vim:nowrap:textwidth=0 +315 # result = false +316 b8/copy-to-eax 0/imm32/false +317 # return false if c < '0' +318 81 7/subop/compare 3/mod/direct 1/rm32/ecx . . . . . 0x30/imm32 # compare ecx +319 7c/jump-if-< $is-decimal-digit?:end/disp8 +320 # return (c <= '9') +321 81 7/subop/compare 3/mod/direct 1/rm32/ecx . . . . . 0x39/imm32 # compare ecx +322 7f/jump-if-> $is-decimal-digit?:end/disp8 +323 $is-decimal-digit?:true: +324 b8/copy-to-eax 1/imm32/true +325 $is-decimal-digit?:end: +326 # . restore registers +327 59/pop-to-ecx +328 # . epilogue +329 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . . # copy ebp to esp +330 5d/pop-to-ebp +331 c3/return +332 +333 test-is-decimal-digit-below-0: +334 # eax = is-decimal-digit?(0x2f) +335 # . . push args +336 68/push 0x2f/imm32 +337 # . . call +338 e8/call is-decimal-digit?/disp32 +339 # . . discard args +340 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp +341 # check-ints-equal(eax, 0, msg) +342 # . . push args +343 68/push "F - test-is-decimal-digit-below-0"/imm32 +344 68/push 0/imm32/false +345 50/push-eax +346 # . . call +347 e8/call check-ints-equal/disp32 +348 # . . discard args +349 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp +350 c3/return +351 +352 test-is-decimal-digit-0-to-9: +353 # eax = is-decimal-digit?(0x30) +354 # . . push args +355 68/push 0x30/imm32 +356 # . . call +357 e8/call is-decimal-digit?/disp32 +358 # . . discard args +359 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp +360 # check-ints-equal(eax, 1, msg) +361 # . . push args +362 68/push "F - test-is-decimal-digit-at-0"/imm32 +363 68/push 1/imm32/true +364 50/push-eax +365 # . . call +366 e8/call check-ints-equal/disp32 +367 # . . discard args +368 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp +369 # eax = is-decimal-digit?(0x39) +370 # . . push args +371 68/push 0x39/imm32 +372 # . . call +373 e8/call is-decimal-digit?/disp32 +374 # . . discard args +375 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp +376 # check-ints-equal(eax, 1, msg) +377 # . . push args +378 68/push "F - test-is-decimal-digit-at-9"/imm32 +379 68/push 1/imm32/true +380 50/push-eax +381 # . . call +382 e8/call check-ints-equal/disp32 +383 # . . discard args +384 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp +385 c3/return +386 +387 test-is-decimal-digit-above-9: +388 # eax = is-decimal-digit?(0x3a) +389 # . . push args +390 68/push 0x3a/imm32 +391 # . . call +392 e8/call is-decimal-digit?/disp32 +393 # . . discard args +394 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp +395 # check-ints-equal(eax, 0, msg) +396 # . . push args +397 68/push "F - test-is-decimal-digit-above-9"/imm32 +398 68/push 0/imm32/false +399 50/push-eax +400 # . . call +401 e8/call check-ints-equal/disp32 +402 # . . discard args +403 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp +404 c3/return +405 +406 # . . vim:nowrap:textwidth=0 diff --git a/html/apps/mu.subx.html b/html/apps/mu.subx.html index bb220441..af0154e9 100644 --- a/html/apps/mu.subx.html +++ b/html/apps/mu.subx.html @@ -8091,7 +8091,7 @@ if ('onhashchange' in window) { 8367 # return alit == blit 8368 39/compare %eax 1/r32/ecx 8369 74/jump-if-= $subx-type-equal?:true/disp8 -8370 $subx-type-equal?:false: +8370 $subx-type-equal?:false: # TODO: replace with setcc 8371 b8/copy-to-eax 0/imm32/false 8372 eb/jump $subx-type-equal?:end/disp8 8373 $subx-type-equal?:true: -- cgit 1.4.1-2-gfad0