From 81605224f085ec85ea11302c938a53cf2dd8a2bc Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Thu, 6 Dec 2018 09:41:40 -0800 Subject: 4847 --- html/subx/051test.subx.html | 2 +- html/subx/055trace.subx.html | 4 ++-- html/subx/063print-byte.subx.html | 4 ++-- html/subx/apps/crenshaw2-1.subx.html | 8 ++++---- html/subx/apps/crenshaw2-1b.subx.html | 8 ++++---- html/subx/apps/factorial.subx.html | 2 +- html/subx/apps/hex.subx.html | 10 +++++----- html/subx/examples/ex10.subx.html | 2 +- html/subx/examples/ex11.subx.html | 2 +- html/subx/examples/ex8.subx.html | 2 +- html/subx/examples/ex9.subx.html | 2 +- subx/051test.subx | 2 +- subx/055trace.subx | 4 ++-- subx/063print-byte.subx | 4 ++-- subx/apps/crenshaw2-1.subx | 8 ++++---- subx/apps/crenshaw2-1b.subx | 8 ++++---- subx/apps/factorial.subx | 2 +- subx/apps/hex.subx | 10 +++++----- subx/examples/ex10.subx | 2 +- subx/examples/ex11.subx | 2 +- subx/examples/ex8.subx | 2 +- subx/examples/ex9.subx | 2 +- 22 files changed, 46 insertions(+), 46 deletions(-) diff --git a/html/subx/051test.subx.html b/html/subx/051test.subx.html index 90b2b48c..fe5354d1 100644 --- a/html/subx/051test.subx.html +++ b/html/subx/051test.subx.html @@ -93,7 +93,7 @@ if ('onhashchange' in window) { 30 51/push-ECX 31 53/push-EBX 32 # load first 2 args into EAX and EBX -33 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . 0/r32/EAX 0x8/disp8 . # copy *(EBP+8) to EAX +33 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . 0/r32/EAX 8/disp8 . # copy *(EBP+8) to EAX 34 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . 3/r32/EBX 0xc/disp8 . # copy *(EBP+12) to EBX 35 # if EAX == EBX success 36 39/compare 3/mod/direct 0/rm32/EAX . . . 3/r32/EBX . . # compare EAX and EBX diff --git a/html/subx/055trace.subx.html b/html/subx/055trace.subx.html index 03af8e3c..f9a25505 100644 --- a/html/subx/055trace.subx.html +++ b/html/subx/055trace.subx.html @@ -360,7 +360,7 @@ if ('onhashchange' in window) { 294 # . . push outend 295 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0xc/disp8 . # push *(EBP+12) 296 # . . push out -297 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 . # push *(EBP+8) +297 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) 298 # . . call 299 e8/call _append-4/disp32 300 # . . discard args @@ -387,7 +387,7 @@ if ('onhashchange' in window) { 321 # EAX/num_bytes_appended = 0 322 b8/copy-to-EAX 0/imm32 323 # EDI = out -324 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . 7/r32/EDI 0x8/disp8 . # copy *(EBP+8) to EDI +324 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . 7/r32/EDI 8/disp8 . # copy *(EBP+8) to EDI 325 # EDX = outend 326 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . 2/r32/EDX 0xc/disp8 . # copy *(EBP+12) to EDX 327 # ESI = in diff --git a/html/subx/063print-byte.subx.html b/html/subx/063print-byte.subx.html index 0dfe9269..eb445da7 100644 --- a/html/subx/063print-byte.subx.html +++ b/html/subx/063print-byte.subx.html @@ -96,7 +96,7 @@ if ('onhashchange' in window) { 31 # write-byte(f, AL) 32 # . . push args 33 50/push-EAX - 34 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 . # push *(EBP+8) + 34 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) 35 # . . call 36 e8/call write-byte/disp32 37 # . . discard args @@ -114,7 +114,7 @@ if ('onhashchange' in window) { 49 # write-byte(f, AL) 50 # . . push args 51 50/push-EAX - 52 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 . # push *(EBP+8) + 52 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) 53 # . . call 54 e8/call write-byte/disp32 55 # . . discard args diff --git a/html/subx/apps/crenshaw2-1.subx.html b/html/subx/apps/crenshaw2-1.subx.html index deef86c6..44b0ac02 100644 --- a/html/subx/apps/crenshaw2-1.subx.html +++ b/html/subx/apps/crenshaw2-1.subx.html @@ -110,7 +110,7 @@ if ('onhashchange' in window) { 44 # . argv[1] == "test" 45 # . . push args 46 68/push "test"/imm32 - 47 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 . # push *(EBP+8) + 47 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) 48 # . . call 49 e8/call kernel-string-equal/disp32 50 # . . discard args @@ -604,7 +604,7 @@ if ('onhashchange' in window) { 538 50/push-EAX 539 # read-byte(f) 540 # . . push args -541 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 . # push *(EBP+8) +541 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) 542 # . . call 543 e8/call read-byte/disp32 544 # . . discard args @@ -626,10 +626,10 @@ if ('onhashchange' in window) { 560 # EAX = false 561 b8/copy-to-EAX 0/imm32 562 # if c < '0' return false -563 81 7/subop/compare 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 0x30/imm32 # compare *(EBP+8) +563 81 7/subop/compare 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 0x30/imm32 # compare *(EBP+8) 564 7c/jump-if-lesser $is-digit?:end/disp8 565 # if c > '9' return false -566 81 7/subop/compare 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 0x39/imm32 # compare *(EBP+8) +566 81 7/subop/compare 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 0x39/imm32 # compare *(EBP+8) 567 7f/jump-if-greater $is-digit?:end/disp8 568 # otherwise return true 569 b8/copy-to-EAX 1/imm32 diff --git a/html/subx/apps/crenshaw2-1b.subx.html b/html/subx/apps/crenshaw2-1b.subx.html index 3c387555..3d5196a2 100644 --- a/html/subx/apps/crenshaw2-1b.subx.html +++ b/html/subx/apps/crenshaw2-1b.subx.html @@ -110,7 +110,7 @@ if ('onhashchange' in window) { 44 # . argv[1] == "test" 45 # . . push args 46 68/push "test"/imm32 - 47 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 . # push *(EBP+8) + 47 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) 48 # . . call 49 e8/call kernel-string-equal/disp32 50 # . . discard args @@ -802,7 +802,7 @@ if ('onhashchange' in window) { 736 50/push-EAX 737 # read-byte(f) 738 # . . push args -739 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 . # push *(EBP+8) +739 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) 740 # . . call 741 e8/call read-byte/disp32 742 # . . discard args @@ -823,10 +823,10 @@ if ('onhashchange' in window) { 757 # EAX = false 758 b8/copy-to-EAX 0/imm32 759 # if c < '0' return false -760 81 7/subop/compare 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 0x30/imm32 # compare *(EBP+8) +760 81 7/subop/compare 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 0x30/imm32 # compare *(EBP+8) 761 7c/jump-if-lesser $is-digit?:end/disp8 762 # if c > '9' return false -763 81 7/subop/compare 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 0x39/imm32 # compare *(EBP+8) +763 81 7/subop/compare 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 0x39/imm32 # compare *(EBP+8) 764 7f/jump-if-greater $is-digit?:end/disp8 765 # otherwise return true 766 b8/copy-to-EAX 1/imm32 diff --git a/html/subx/apps/factorial.subx.html b/html/subx/apps/factorial.subx.html index 9f25d28c..87a467fa 100644 --- a/html/subx/apps/factorial.subx.html +++ b/html/subx/apps/factorial.subx.html @@ -94,7 +94,7 @@ if ('onhashchange' in window) { 29 # . argv[1] == "test" 30 # . . push args 31 68/push "test"/imm32 - 32 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 . # push *(EBP+8) + 32 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) 33 # . . call 34 e8/call kernel-string-equal/disp32 35 # . . discard args diff --git a/html/subx/apps/hex.subx.html b/html/subx/apps/hex.subx.html index d81e587f..7de27c37 100644 --- a/html/subx/apps/hex.subx.html +++ b/html/subx/apps/hex.subx.html @@ -97,7 +97,7 @@ if ('onhashchange' in window) { 31 # . argv[1] == "test" 32 # . . push args 33 68/push "test"/imm32 - 34 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 . # push *(EBP+8) + 34 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) 35 # . . call 36 e8/call kernel-string-equal/disp32 37 # . . discard args @@ -197,7 +197,7 @@ if ('onhashchange' in window) { 131 $scan-next-byte:loop: 132 # EAX = read-byte(in) 133 # . . push args - 134 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 . # push *(EBP+8) + 134 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) 135 # . . call 136 e8/call read-byte/disp32 137 # . . discard args @@ -234,7 +234,7 @@ if ('onhashchange' in window) { 168 75/jump-if-not-equal $scan-next-byte:check3/disp8 169 # . skip-until-newline(in) 170 # . . push args - 171 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 . # push *(EBP+8) + 171 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) 172 # . . call 173 e8/call skip-until-newline/disp32 174 # . . discard args @@ -870,7 +870,7 @@ if ('onhashchange' in window) { 804 # . save registers 805 51/push-ECX 806 # ECX = c - 807 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . 1/r32/ECX 0x8/disp8 . # copy *(EBP+8) to ECX + 807 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . 1/r32/ECX 8/disp8 . # copy *(EBP+8) to ECX 808 # return false if c < '0' 809 b8/copy-to-EAX 0/imm32/false 810 81 7/subop/compare 3/mod/direct 1/rm32/ECX . . . . . 0x30/imm32 # compare ECX @@ -1038,7 +1038,7 @@ if ('onhashchange' in window) { 972 $skip-until-newline:loop: 973 # . EAX = read-byte(in) 974 # . . push args - 975 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 . # push *(EBP+8) + 975 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) 976 # . . call 977 e8/call read-byte/disp32 978 # . . discard args diff --git a/html/subx/examples/ex10.subx.html b/html/subx/examples/ex10.subx.html index 55b1c177..c951ca62 100644 --- a/html/subx/examples/ex10.subx.html +++ b/html/subx/examples/ex10.subx.html @@ -86,7 +86,7 @@ if ('onhashchange' in window) { 24 # . . push argv[2] 25 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0xc/disp8 . # push *(EBP+12) 26 # . . push argv[1] -27 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 . # push *(EBP+8) +27 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) 28 # . . call 29 e8/call argv-equal/disp32 30 # syscall(exit, EAX) diff --git a/html/subx/examples/ex11.subx.html b/html/subx/examples/ex11.subx.html index cb2150db..ba1add8f 100644 --- a/html/subx/examples/ex11.subx.html +++ b/html/subx/examples/ex11.subx.html @@ -326,7 +326,7 @@ if ('onhashchange' in window) { 261 51/push-ECX 262 53/push-EBX 263 # load args into EAX, EBX and ECX -264 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . 0/r32/EAX 0x8/disp8 . # copy *(EBP+8) to EAX +264 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . 0/r32/EAX 8/disp8 . # copy *(EBP+8) to EAX 265 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . 3/r32/EBX 0xc/disp8 . # copy *(EBP+12) to EBX 266 # if EAX == b/EBX print('.') and return 267 39/compare 3/mod/direct 0/rm32/EAX . . . 3/r32/EBX . . # compare EAX and EBX diff --git a/html/subx/examples/ex8.subx.html b/html/subx/examples/ex8.subx.html index 07534b4d..41cf1abe 100644 --- a/html/subx/examples/ex8.subx.html +++ b/html/subx/examples/ex8.subx.html @@ -85,7 +85,7 @@ if ('onhashchange' in window) { 23 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP 24 # EAX = ascii-length(argv[1]) 25 # . . push args -26 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 . # push *(EBP+8) +26 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) 27 # . . call 28 e8/call ascii-length/disp32 29 # . . discard args diff --git a/html/subx/examples/ex9.subx.html b/html/subx/examples/ex9.subx.html index 0bb4659c..27ac87ea 100644 --- a/html/subx/examples/ex9.subx.html +++ b/html/subx/examples/ex9.subx.html @@ -89,7 +89,7 @@ if ('onhashchange' in window) { 28 # . . push argv[2] 29 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0xc/disp8 . # push *(EBP+12) 30 # . . push argv[1] -31 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 . # push *(EBP+8) +31 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) 32 # . . call 33 e8/call ascii-difference/disp32 34 # . . discard args diff --git a/subx/051test.subx b/subx/051test.subx index 3fe51218..98816c80 100644 --- a/subx/051test.subx +++ b/subx/051test.subx @@ -30,7 +30,7 @@ check-ints-equal: # (a : int, b : int, msg : (address array byte)) -> 51/push-ECX 53/push-EBX # load first 2 args into EAX and EBX - 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . 0/r32/EAX 0x8/disp8 . # copy *(EBP+8) to EAX + 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . 0/r32/EAX 8/disp8 . # copy *(EBP+8) to EAX 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . 3/r32/EBX 0xc/disp8 . # copy *(EBP+12) to EBX # if EAX == EBX success 39/compare 3/mod/direct 0/rm32/EAX . . . 3/r32/EBX . . # compare EAX and EBX diff --git a/subx/055trace.subx b/subx/055trace.subx index d3a2d698..5e0dda3b 100644 --- a/subx/055trace.subx +++ b/subx/055trace.subx @@ -294,7 +294,7 @@ _append-3: # out : address, outend : address, s : (array byte) -> num_bytes_app # . . push outend ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0xc/disp8 . # push *(EBP+12) # . . push out - ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 . # push *(EBP+8) + ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) # . . call e8/call _append-4/disp32 # . . discard args @@ -321,7 +321,7 @@ _append-4: # out : address, outend : address, in : address, inend : address -> # EAX/num_bytes_appended = 0 b8/copy-to-EAX 0/imm32 # EDI = out - 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . 7/r32/EDI 0x8/disp8 . # copy *(EBP+8) to EDI + 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . 7/r32/EDI 8/disp8 . # copy *(EBP+8) to EDI # EDX = outend 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . 2/r32/EDX 0xc/disp8 . # copy *(EBP+12) to EDX # ESI = in diff --git a/subx/063print-byte.subx b/subx/063print-byte.subx index 686695c4..1268e800 100644 --- a/subx/063print-byte.subx +++ b/subx/063print-byte.subx @@ -31,7 +31,7 @@ print-byte: # f : (address buffered-file), n : num -> # write-byte(f, AL) # . . push args 50/push-EAX - ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 . # push *(EBP+8) + ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) # . . call e8/call write-byte/disp32 # . . discard args @@ -49,7 +49,7 @@ print-byte: # f : (address buffered-file), n : num -> # write-byte(f, AL) # . . push args 50/push-EAX - ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 . # push *(EBP+8) + ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) # . . call e8/call write-byte/disp32 # . . discard args diff --git a/subx/apps/crenshaw2-1.subx b/subx/apps/crenshaw2-1.subx index 25bc897b..6feabcfb 100644 --- a/subx/apps/crenshaw2-1.subx +++ b/subx/apps/crenshaw2-1.subx @@ -44,7 +44,7 @@ # . argv[1] == "test" # . . push args 68/push "test"/imm32 - ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 . # push *(EBP+8) + ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) # . . call e8/call kernel-string-equal/disp32 # . . discard args @@ -538,7 +538,7 @@ get-char: # f : (address buffered-file) -> 50/push-EAX # read-byte(f) # . . push args - ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 . # push *(EBP+8) + ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) # . . call e8/call read-byte/disp32 # . . discard args @@ -560,10 +560,10 @@ is-digit?: # c : int -> bool/EAX # EAX = false b8/copy-to-EAX 0/imm32 # if c < '0' return false - 81 7/subop/compare 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 0x30/imm32 # compare *(EBP+8) + 81 7/subop/compare 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 0x30/imm32 # compare *(EBP+8) 7c/jump-if-lesser $is-digit?:end/disp8 # if c > '9' return false - 81 7/subop/compare 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 0x39/imm32 # compare *(EBP+8) + 81 7/subop/compare 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 0x39/imm32 # compare *(EBP+8) 7f/jump-if-greater $is-digit?:end/disp8 # otherwise return true b8/copy-to-EAX 1/imm32 diff --git a/subx/apps/crenshaw2-1b.subx b/subx/apps/crenshaw2-1b.subx index eec78f85..0b4fc27c 100644 --- a/subx/apps/crenshaw2-1b.subx +++ b/subx/apps/crenshaw2-1b.subx @@ -44,7 +44,7 @@ # . argv[1] == "test" # . . push args 68/push "test"/imm32 - ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 . # push *(EBP+8) + ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) # . . call e8/call kernel-string-equal/disp32 # . . discard args @@ -736,7 +736,7 @@ get-char: # f : (address buffered-file) -> 50/push-EAX # read-byte(f) # . . push args - ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 . # push *(EBP+8) + ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) # . . call e8/call read-byte/disp32 # . . discard args @@ -757,10 +757,10 @@ is-digit?: # c : int -> bool/EAX # EAX = false b8/copy-to-EAX 0/imm32 # if c < '0' return false - 81 7/subop/compare 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 0x30/imm32 # compare *(EBP+8) + 81 7/subop/compare 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 0x30/imm32 # compare *(EBP+8) 7c/jump-if-lesser $is-digit?:end/disp8 # if c > '9' return false - 81 7/subop/compare 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 0x39/imm32 # compare *(EBP+8) + 81 7/subop/compare 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 0x39/imm32 # compare *(EBP+8) 7f/jump-if-greater $is-digit?:end/disp8 # otherwise return true b8/copy-to-EAX 1/imm32 diff --git a/subx/apps/factorial.subx b/subx/apps/factorial.subx index 73735fab..bd73d72b 100644 --- a/subx/apps/factorial.subx +++ b/subx/apps/factorial.subx @@ -29,7 +29,7 @@ # . argv[1] == "test" # . . push args 68/push "test"/imm32 - ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 . # push *(EBP+8) + ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) # . . call e8/call kernel-string-equal/disp32 # . . discard args diff --git a/subx/apps/hex.subx b/subx/apps/hex.subx index e0963a7e..c5429285 100644 --- a/subx/apps/hex.subx +++ b/subx/apps/hex.subx @@ -31,7 +31,7 @@ # . argv[1] == "test" # . . push args 68/push "test"/imm32 - ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 . # push *(EBP+8) + ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) # . . call e8/call kernel-string-equal/disp32 # . . discard args @@ -131,7 +131,7 @@ scan-next-byte: # in : (address buffered-file), err : (address buffered-file), $scan-next-byte:loop: # EAX = read-byte(in) # . . push args - ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 . # push *(EBP+8) + ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) # . . call e8/call read-byte/disp32 # . . discard args @@ -168,7 +168,7 @@ $scan-next-byte:check2: 75/jump-if-not-equal $scan-next-byte:check3/disp8 # . skip-until-newline(in) # . . push args - ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 . # push *(EBP+8) + ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) # . . call e8/call skip-until-newline/disp32 # . . discard args @@ -804,7 +804,7 @@ is-hex-lowercase-byte?: # c : byte -> bool/EAX # . save registers 51/push-ECX # ECX = c - 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . 1/r32/ECX 0x8/disp8 . # copy *(EBP+8) to ECX + 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . 1/r32/ECX 8/disp8 . # copy *(EBP+8) to ECX # return false if c < '0' b8/copy-to-EAX 0/imm32/false 81 7/subop/compare 3/mod/direct 1/rm32/ECX . . . . . 0x30/imm32 # compare ECX @@ -972,7 +972,7 @@ skip-until-newline: # in : (address buffered-file) -> $skip-until-newline:loop: # . EAX = read-byte(in) # . . push args - ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 . # push *(EBP+8) + ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) # . . call e8/call read-byte/disp32 # . . discard args diff --git a/subx/examples/ex10.subx b/subx/examples/ex10.subx index 69e7c2ec..86d7cb54 100644 --- a/subx/examples/ex10.subx +++ b/subx/examples/ex10.subx @@ -24,7 +24,7 @@ # . . push argv[2] ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0xc/disp8 . # push *(EBP+12) # . . push argv[1] - ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 . # push *(EBP+8) + ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) # . . call e8/call argv-equal/disp32 # syscall(exit, EAX) diff --git a/subx/examples/ex11.subx b/subx/examples/ex11.subx index 2a92b172..a03c08d3 100644 --- a/subx/examples/ex11.subx +++ b/subx/examples/ex11.subx @@ -261,7 +261,7 @@ check-ints-equal: # (a : int, b : int, msg : (address array byte)) -> boolean 51/push-ECX 53/push-EBX # load args into EAX, EBX and ECX - 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . 0/r32/EAX 0x8/disp8 . # copy *(EBP+8) to EAX + 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . 0/r32/EAX 8/disp8 . # copy *(EBP+8) to EAX 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . 3/r32/EBX 0xc/disp8 . # copy *(EBP+12) to EBX # if EAX == b/EBX print('.') and return 39/compare 3/mod/direct 0/rm32/EAX . . . 3/r32/EBX . . # compare EAX and EBX diff --git a/subx/examples/ex8.subx b/subx/examples/ex8.subx index 6ec9eb3c..75a77a50 100644 --- a/subx/examples/ex8.subx +++ b/subx/examples/ex8.subx @@ -23,7 +23,7 @@ 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP # EAX = ascii-length(argv[1]) # . . push args - ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 . # push *(EBP+8) + ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) # . . call e8/call ascii-length/disp32 # . . discard args diff --git a/subx/examples/ex9.subx b/subx/examples/ex9.subx index ed4e6761..bc842e4b 100644 --- a/subx/examples/ex9.subx +++ b/subx/examples/ex9.subx @@ -28,7 +28,7 @@ # . . push argv[2] ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0xc/disp8 . # push *(EBP+12) # . . push argv[1] - ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 . # push *(EBP+8) + ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) # . . call e8/call ascii-difference/disp32 # . . discard args -- cgit 1.4.1-2-gfad0