diff options
-rw-r--r-- | subx/052kernel-string-equal.subx | 4 | ||||
-rw-r--r-- | subx/065hex.subx | 6 | ||||
-rw-r--r-- | subx/073next-token.subx | 8 | ||||
-rw-r--r-- | subx/apps/crenshaw2-1.subx | 4 | ||||
-rw-r--r-- | subx/apps/crenshaw2-1b.subx | 6 | ||||
-rw-r--r-- | subx/apps/factorial.subx | 2 | ||||
-rw-r--r-- | subx/apps/hex.subx | 2 | ||||
-rw-r--r-- | subx/apps/pack.subx | 26 | ||||
-rw-r--r-- | subx/examples/ex10.subx | 2 | ||||
-rw-r--r-- | subx/examples/ex11.subx | 4 |
10 files changed, 32 insertions, 32 deletions
diff --git a/subx/052kernel-string-equal.subx b/subx/052kernel-string-equal.subx index dd2a406a..914d8a03 100644 --- a/subx/052kernel-string-equal.subx +++ b/subx/052kernel-string-equal.subx @@ -80,7 +80,7 @@ $kernel-string-equal?:loop: # c2 = *s2 8a/copy-byte 0/mod/indirect 6/rm32/ESI . . . 3/r32/BL . . # copy byte at *ESI to BL # if (c1 == 0) return false - 3d/compare-EAX 0/imm32 + 3d/compare-EAX-and 0/imm32 74/jump-if-equal $kernel-string-equal?:false/disp8 # if (c1 != c2) return false 39/compare 3/mod/direct 0/rm32/EAX . . . 3/r32/EBX . . # compare EAX and EBX @@ -95,7 +95,7 @@ $kernel-string-equal?:loop: $kernel-string-equal?:break: # return *s1 == 0 8a/copy-byte 0/mod/indirect 7/rm32/EDI . . . 0/r32/AL . . # copy byte at *EDI to AL - 3d/compare-EAX 0/imm32 + 3d/compare-EAX-and 0/imm32 75/jump-if-not-equal $kernel-string-equal?:false/disp8 $kernel-string-equal?:true: b8/copy-to-EAX 1/imm32 diff --git a/subx/065hex.subx b/subx/065hex.subx index a5a4bdac..eb1e88d4 100644 --- a/subx/065hex.subx +++ b/subx/065hex.subx @@ -65,7 +65,7 @@ $is-hex-int?:loop: # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # if (EAX == false) return false - 3d/compare-with-EAX 0/imm32 + 3d/compare-EAX-and 0/imm32 74/jump-if-equal $is-hex-int?:end/disp8 # ++curr 41/increment-ECX @@ -732,7 +732,7 @@ test-hex-above-f: from-hex-char: # in/EAX : byte -> out/EAX : num # no error checking; accepts argument in EAX # if (EAX <= '9') return EAX - '0' - 3d/compare-EAX 0x39/imm32/9 + 3d/compare-EAX-with 0x39/imm32/9 7f/jump-if-greater $from-hex-char:else/disp8 2d/subtract-from-EAX 0x30/imm32/0 c3/return @@ -744,7 +744,7 @@ $from-hex-char:else: to-hex-char: # in/EAX : nibble -> out/EAX : byte # no error checking; accepts argument in EAX # if (EAX <= 9) return EAX + '0' - 3d/compare-EAX 0x9/imm32/9 + 3d/compare-EAX-with 0x9/imm32/9 7f/jump-if-greater $to-hex-char:else/disp8 05/add-to-EAX 0x30/imm32/0 c3/return diff --git a/subx/073next-token.subx b/subx/073next-token.subx index de9f3928..490ab0cd 100644 --- a/subx/073next-token.subx +++ b/subx/073next-token.subx @@ -652,16 +652,16 @@ $skip-chars-not-matching-whitespace:loop: 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . . # clear EAX 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 # if (EAX == ' ') break - 3d/compare-with-EAX 0x20/imm32/space + 3d/compare-EAX-and 0x20/imm32/space 74/jump-if-equal $skip-chars-not-matching-whitespace:end/disp8 # if (EAX == '\n') break - 3d/compare-with-EAX 0x0a/imm32/newline + 3d/compare-EAX-and 0x0a/imm32/newline 74/jump-if-equal $skip-chars-not-matching-whitespace:end/disp8 # if (EAX == '\t') break - 3d/compare-with-EAX 0x09/imm32/tab + 3d/compare-EAX-and 0x09/imm32/tab 74/jump-if-equal $skip-chars-not-matching-whitespace:end/disp8 # if (EAX == '\r') break - 3d/compare-with-EAX 0x0d/imm32/cr + 3d/compare-EAX-and 0x0d/imm32/cr 74/jump-if-equal $skip-chars-not-matching-whitespace:end/disp8 # ++in->read 41/inc-ECX diff --git a/subx/apps/crenshaw2-1.subx b/subx/apps/crenshaw2-1.subx index 46785b16..05fdbbfe 100644 --- a/subx/apps/crenshaw2-1.subx +++ b/subx/apps/crenshaw2-1.subx @@ -51,7 +51,7 @@ Entry: # run tests if necessary, call 'compile' if not # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP # . check result - 3d/compare-EAX 1/imm32 + 3d/compare-EAX-and 1/imm32 75/jump-if-not-equal $run-main/disp8 # . run-tests() e8/call run-tests/disp32 @@ -230,7 +230,7 @@ get-num: # in : (address buffered-file), out : (address stream), err : fd or (a # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # . if (EAX == 0) - 3d/compare-EAX 0/imm32 + 3d/compare-EAX-and 0/imm32 75/jump-if-not-equal $get-num:main/disp8 # . expected(ed, err, "integer") # . . push args diff --git a/subx/apps/crenshaw2-1b.subx b/subx/apps/crenshaw2-1b.subx index c599206c..ba30ef94 100644 --- a/subx/apps/crenshaw2-1b.subx +++ b/subx/apps/crenshaw2-1b.subx @@ -51,7 +51,7 @@ Entry: # run tests if necessary, call 'compile' if not # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP # . check result - 3d/compare-EAX 1/imm32 + 3d/compare-EAX-and 1/imm32 75/jump-if-not-equal $run-main/disp8 # . run-tests() e8/call run-tests/disp32 @@ -235,7 +235,7 @@ get-num: # in : (address buffered-file), out : (address stream), err : fd or (a # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # . if (EAX == 0) - 3d/compare-EAX 0/imm32 + 3d/compare-EAX-and 0/imm32 75/jump-if-not-equal $get-num:main/disp8 # . expected(ed, err, "integer") # . . push args @@ -300,7 +300,7 @@ $get-num:loop-stage2: # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # . if (EAX != 0) loop - 3d/compare-EAX 0/imm32 + 3d/compare-EAX-and 0/imm32 0f 85/jump-if-not-equal $get-num:loop/disp32 $get-num:loop-end: # persist necessary variables from registers diff --git a/subx/apps/factorial.subx b/subx/apps/factorial.subx index 8f4bf47d..20b0a4fe 100644 --- a/subx/apps/factorial.subx +++ b/subx/apps/factorial.subx @@ -39,7 +39,7 @@ Entry: # run tests if necessary, compute `factorial(5)` if not # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP # . check result - 3d/compare-EAX 1/imm32 + 3d/compare-EAX-and 1/imm32 75/jump-if-not-equal $run-main/disp8 # . run-tests() e8/call run-tests/disp32 diff --git a/subx/apps/hex.subx b/subx/apps/hex.subx index 138b63c0..a52ff219 100644 --- a/subx/apps/hex.subx +++ b/subx/apps/hex.subx @@ -39,7 +39,7 @@ Entry: # run tests if necessary, convert stdin if not # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP # . check result - 3d/compare-EAX 1/imm32 + 3d/compare-EAX-and 1/imm32 75/jump-if-not-equal $run-main/disp8 # . run-tests() e8/call run-tests/disp32 diff --git a/subx/apps/pack.subx b/subx/apps/pack.subx index 8b2aed06..ab0fef24 100644 --- a/subx/apps/pack.subx +++ b/subx/apps/pack.subx @@ -42,7 +42,7 @@ Entry: # run tests if necessary, convert stdin if not # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP # . check result - 3d/compare-EAX 1/imm32 + 3d/compare-EAX-and 1/imm32 75/jump-if-not-equal $run-main/disp8 # . run-tests() e8/call run-tests/disp32 @@ -208,7 +208,7 @@ $convert:check1: # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # . if (EAX != 0) write-stream-buffered(out, line) - 3d/compare-EAX 0/imm32 + 3d/compare-EAX-and 0/imm32 0f 85/jump-if-not-equal $convert:pass-through/disp32 $convert:check2: #? # dump current word {{{ @@ -905,7 +905,7 @@ $convert-data:check0: # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # . if (EAX != 0) pass through - 3d/compare-EAX 0/imm32 + 3d/compare-EAX-and 0/imm32 75/jump-if-not-equal $convert-data:break/disp8 $convert-data:check1: # if (slice-starts-with?(word-slice, "#")) write-stream-buffered(out, line) @@ -915,7 +915,7 @@ $convert-data:check1: 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . . # clear EAX 8a/copy-byte 0/mod/indirect 2/rm32/EDX . . . 0/r32/AL . . # copy byte at *EDX to AL # . if (EAX == '#') pass through - 3d/compare-with-EAX 0x23/imm32/hash + 3d/compare-EAX-and 0x23/imm32/hash 74/jump-if-equal $convert-data:pass-line-through/disp8 $convert-data:check2: # if (slice-ends-with?(word-slice, ":")) write-stream-buffered(out, line) @@ -925,7 +925,7 @@ $convert-data:check2: 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . . # clear EAX 8a/copy-byte 1/mod/*+disp8 2/rm32/EDX . . . 0/r32/AL -1/disp8 . # copy byte at *ECX to AL # . if (EAX == ':') pass through - 3d/compare-with-EAX 0x3a/imm32/colon + 3d/compare-EAX-and 0x3a/imm32/colon 74/jump-if-equal $convert-data:pass-line-through/disp8 $convert-data:check3: # if (has-metadata?(word-slice, "imm32")) @@ -1625,7 +1625,7 @@ $convert-instruction:check0: # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # . if (EAX != 0) pass through - 3d/compare-EAX 0/imm32 + 3d/compare-EAX-and 0/imm32 75/jump-if-not-equal $convert-instruction:pass-through/disp8 $convert-instruction:check1: # if (slice-starts-with?(word-slice, "#")) write-stream-buffered(out, line) @@ -1635,7 +1635,7 @@ $convert-instruction:check1: 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . . # clear EAX 8a/copy-byte 0/mod/indirect 2/rm32/EDX . . . 0/r32/AL . . # copy byte at *EDX to AL # . if (EAX == '#') pass through - 3d/compare-with-EAX 0x23/imm32/hash + 3d/compare-EAX-and 0x23/imm32/hash 74/jump-if-equal $convert-instruction:pass-through/disp8 $convert-instruction:check2: # if (slice-ends-with?(word-slice, ":")) write-stream-buffered(out, line) @@ -1645,7 +1645,7 @@ $convert-instruction:check2: 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . . # clear EAX 8a/copy-byte 1/mod/*+disp8 2/rm32/EDX . . . 0/r32/AL -1/disp8 . # copy byte at *ECX to AL # . if (EAX == ':') pass through - 3d/compare-with-EAX 0x3a/imm32/colon + 3d/compare-EAX-and 0x3a/imm32/colon 74/jump-if-equal $convert-instruction:pass-through/disp8 $convert-instruction:pass-through: # write-stream-buffered(out, line) @@ -2108,7 +2108,7 @@ $next-word:check1: 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . . # clear EAX 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 # . compare - 3d/compare-EAX-with 0x23/imm32/pound + 3d/compare-EAX-and 0x23/imm32/pound 75/jump-if-not-equal $next-word:not-comment/disp8 # . out->end = &line->data[line->write] 8b/copy 0/mod/indirect 6/rm32/ESI . . . 0/r32/EAX . . # copy *ESI to EAX @@ -3030,22 +3030,22 @@ $is-valid-name?:check1: # EAX -= ECX 29/subtract 3/mod/direct 0/rm32/EAX . . . 1/r32/ECX . . # subtract ECX from EAX # if (EAX == 2) return false - 3d/compare-with-EAX 2/imm32 + 3d/compare-EAX-and 2/imm32 74/jump-if-equal $is-valid-name?:false/disp8 $is-valid-name?:check2: # c/EAX = *ECX 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . . # clear EAX 8a/copy-byte 0/mod/indirect 1/rm32/ECX . . . 0/r32/AL . . # copy byte at *ECX to AL # if (c == "-") return false - 3d/compare-with-EAX 2d/imm32/- + 3d/compare-EAX-and 2d/imm32/- 74/jump-if-equal $is-valid-name?:false/disp8 $is-valid-name?:check3a: # if (c < "0") return true - 3d/compare-with-EAX 30/imm32/0 + 3d/compare-EAX-with 30/imm32/0 7c/jump-if-lesser $is-valid-name?:true/disp8 $is-valid-name?:check3b: # if (c > "9") return true - 3d/compare-with-EAX 39/imm32/9 + 3d/compare-EAX-with 39/imm32/9 7f/jump-if-greater $is-valid-name?:true/disp8 $is-valid-name?:false: # return false diff --git a/subx/examples/ex10.subx b/subx/examples/ex10.subx index 72da1da0..f68f1afd 100644 --- a/subx/examples/ex10.subx +++ b/subx/examples/ex10.subx @@ -45,7 +45,7 @@ $argv-equal:loop: bb/copy-to-EBX 0/imm32 8a/copy-byte 0/mod/indirect 2/rm32/EDX . . . 3/r32/BL . . # copy byte at *EDX to BL # if (c1 == 0) break - 3d/compare-EAX 0/imm32 + 3d/compare-EAX-and 0/imm32 74/jump-if-equal $argv-equal:break/disp8 # if (c1 != c2) return false 39/compare 3/mod/direct 0/rm32/EAX . . . 3/r32/EBX . . # compare EAX and EBX diff --git a/subx/examples/ex11.subx b/subx/examples/ex11.subx index 8414351b..e07d0f90 100644 --- a/subx/examples/ex11.subx +++ b/subx/examples/ex11.subx @@ -80,7 +80,7 @@ $kernel-string-equal?:loop: # c2 = *s2 8a/copy-byte 0/mod/indirect 6/rm32/ESI . . . 3/r32/BL . . # copy byte at *ESI to BL # if (c1 == 0) return false - 3d/compare-EAX 0/imm32 + 3d/compare-EAX-and 0/imm32 74/jump-if-equal $kernel-string-equal?:false/disp8 # if (c1 != c2) return false 39/compare 3/mod/direct 0/rm32/EAX . . . 3/r32/EBX . . # compare EAX and EBX @@ -95,7 +95,7 @@ $kernel-string-equal?:loop: $kernel-string-equal?:break: # return *s1 == 0 8a/copy-byte 0/mod/indirect 7/rm32/EDI . . . 0/r32/AL . . # copy byte at *EDI to AL - 3d/compare-EAX 0/imm32 + 3d/compare-EAX-and 0/imm32 75/jump-if-not-equal $kernel-string-equal?:false/disp8 $kernel-string-equal?:true: b8/copy-to-EAX 1/imm32 |