diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/assort.subx | 16 | ||||
-rw-r--r-- | apps/braces.subx | 18 | ||||
-rw-r--r-- | apps/calls.subx | 50 | ||||
-rw-r--r-- | apps/crenshaw2-1.subx | 12 | ||||
-rw-r--r-- | apps/crenshaw2-1b.subx | 14 | ||||
-rw-r--r-- | apps/dquotes.subx | 50 | ||||
-rw-r--r-- | apps/ex10.subx | 6 | ||||
-rw-r--r-- | apps/ex11.subx | 8 | ||||
-rw-r--r-- | apps/ex3.subx | 2 | ||||
-rw-r--r-- | apps/ex8.subx | 2 | ||||
-rw-r--r-- | apps/factorial.subx | 4 | ||||
-rw-r--r-- | apps/factorial2.subx | 4 | ||||
-rw-r--r-- | apps/factorial3.subx | 4 | ||||
-rw-r--r-- | apps/factorial4.subx | 10 | ||||
-rw-r--r-- | apps/handle.subx | 6 | ||||
-rw-r--r-- | apps/hex.subx | 44 | ||||
-rw-r--r-- | apps/mu.subx | 220 | ||||
-rw-r--r-- | apps/mulisp.subx | 8 | ||||
-rw-r--r-- | apps/pack.subx | 98 | ||||
-rw-r--r-- | apps/sigils.subx | 96 | ||||
-rw-r--r-- | apps/survey.subx | 74 | ||||
-rw-r--r-- | apps/tests.subx | 12 |
22 files changed, 379 insertions, 379 deletions
diff --git a/apps/assort.subx b/apps/assort.subx index be365403..e6914978 100644 --- a/apps/assort.subx +++ b/apps/assort.subx @@ -40,7 +40,7 @@ Entry: # run tests if necessary, convert stdin if not # - if argc > 1 and argv[1] == "test", then return run_tests() # if (argc <= 1) goto interactive 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 0/disp8 1/imm32 # compare *ebp - 7e/jump-if-lesser-or-equal $subx-assort-main:interactive/disp8 + 7e/jump-if-<= $subx-assort-main:interactive/disp8 # if (!kernel-string-equal?(argv[1], "test")) goto interactive # . eax = kernel-string-equal?(argv[1], "test") # . . push args @@ -52,7 +52,7 @@ Entry: # run tests if necessary, convert stdin if not 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax == false) goto interactive 3d/compare-eax-and 0/imm32/false - 74/jump-if-equal $subx-assort-main:interactive/disp8 + 74/jump-if-= $subx-assort-main:interactive/disp8 # run-tests() e8/call run-tests/disp32 # syscall(exit, *Num-test-failures) @@ -525,7 +525,7 @@ $read-segments:loop: $read-segments:check0: # if (line->write == 0) break 81 7/subop/compare 0/mod/indirect 1/rm32/ecx . . . . . 0/imm32 # compare *ecx - 0f 84/jump-if-equal $read-segments:break/disp32 + 0f 84/jump-if-= $read-segments:break/disp32 #? # dump line {{{ #? # . write(2/stderr, "LL: ") #? # . . push args @@ -587,7 +587,7 @@ $read-segments:check1: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax != false) continue 3d/compare-eax-and 0/imm32/false - 0f 85/jump-if-not-equal $read-segments:loop/disp32 + 0f 85/jump-if-!= $read-segments:loop/disp32 $read-segments:check-for-comment: #? # print("check for comment\n") {{{ #? # . . push args @@ -606,7 +606,7 @@ $read-segments:check-for-comment: 8a/copy-byte 0/mod/indirect 6/rm32/esi . . . 0/r32/AL . . # copy byte at *esi to AL # . if (c == '#') continue 3d/compare-eax-and 0x23/imm32/hash - 0f 84/jump-if-equal $read-segments:loop/disp32 + 0f 84/jump-if-= $read-segments:loop/disp32 $read-segments:check-for-segment-header: #? # print("check for segment header\n") {{{ #? # . . push args @@ -668,7 +668,7 @@ $read-segments:check-for-segment-header: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax == false) goto check3 3d/compare-eax-and 0/imm32/false - 0f 84/jump-if-equal $read-segments:regular-line/disp32 + 0f 84/jump-if-= $read-segments:regular-line/disp32 # segment-name = next-word-or-string(line) # . . push args 52/push-edx @@ -730,7 +730,7 @@ $read-segments:check-for-segment-header: 8b/copy 0/mod/indirect 0/rm32/eax . . . 3/r32/ebx . . # copy *eax to ebx # if (curr-segment != 0) continue 81 7/subop/compare 3/mod/direct 3/rm32/ebx . . . . . 0/imm32 # compare ebx - 0f 85/jump-if-not-equal $read-segments:loop/disp32 + 0f 85/jump-if-!= $read-segments:loop/disp32 # curr-segment = new-stream(Heap, Segment-size, 1) # . save segment-slot 50/push-eax @@ -871,7 +871,7 @@ write-segments: # out : (addr buffered-file), table : (addr stream {string_key, $write-segments:loop: # if (curr >= max) break 39/compare 3/mod/direct 6/rm32/esi . . . 2/r32/edx . . # compare esi with edx - 73/jump-if-greater-or-equal-unsigned $write-segments:break/disp8 + 73/jump-if-addr>= $write-segments:break/disp8 # var stream/eax : (addr stream byte) = table[i].stream 8b/copy 1/mod/*+disp8 6/rm32/esi . . . 0/r32/eax 4/disp8 . # copy *(esi+4) to eax # write-stream-data(out, stream) diff --git a/apps/braces.subx b/apps/braces.subx index e3659048..edb72393 100644 --- a/apps/braces.subx +++ b/apps/braces.subx @@ -57,11 +57,11 @@ Entry: # run tests if necessary, a REPL if not (new-segment *Heap-size Heap) # if (argc <= 1) goto interactive 81 7/subop/compare *ebp 1/imm32 - 7e/jump-if-lesser-or-equal $subx-braces-main:interactive/disp8 + 7e/jump-if-<= $subx-braces-main:interactive/disp8 # if (argv[1] != "test")) goto interactive (kernel-string-equal? *(ebp+8) "test") # => eax 3d/compare-eax-and 0/imm32 - 74/jump-if-equal $subx-braces-main:interactive/disp8 + 74/jump-if-= $subx-braces-main:interactive/disp8 # (run-tests) # syscall(exit, *Num-test-failures) @@ -146,7 +146,7 @@ $subx-braces:line-loop: $subx-braces:check0: # if (line->write == 0) break 81 7/subop/compare *ecx 0/imm32 - 0f 84/jump-if-equal $subx-braces:break/disp32 + 0f 84/jump-if-= $subx-braces:break/disp32 (skip-chars-matching-whitespace %ecx) $subx-braces:check-for-curly-open: # if (line->data[line->read] != '{') goto next check @@ -156,7 +156,7 @@ $subx-braces:check-for-curly-open: 81 4/subop/and %eax 0xff/imm32 # . if (eax != '{') continue 3d/compare-eax-and 0x7b/imm32/open-curly - 0f 85/jump-if-not-equal $subx-braces:check-for-curly-closed/disp32 + 0f 85/jump-if-!= $subx-braces:check-for-curly-closed/disp32 $subx-braces:emit-curly-open: # print(out, "_loop" next-label-id ":") (write-buffered *(ebp+0xc) "_loop") @@ -171,7 +171,7 @@ $subx-braces:emit-curly-open: $subx-braces:check-for-curly-closed: # if (line->data[line->read] != '}') goto next check 3d/compare-eax-and 0x7d/imm32/close-curly - 0f 85/jump-if-equal $subx-braces:word-loop/disp32 + 0f 85/jump-if-= $subx-braces:word-loop/disp32 $subx-braces:emit-curly-closed: # eax = pop(label-stack) (pop %edx) @@ -187,7 +187,7 @@ $subx-braces:check1: # if (slice-empty?(word-slice)) break (slice-empty? %edi) 3d/compare-eax-and 0/imm32 - 0f 85/jump-if-not-equal $subx-braces:next-line/disp32 + 0f 85/jump-if-!= $subx-braces:next-line/disp32 $subx-braces:check-for-comment: # if (slice-starts-with?(word-slice, "#")) continue # . eax = *word-slice->start @@ -196,14 +196,14 @@ $subx-braces:check-for-comment: 81 4/subop/and %eax 0xff/imm32 # . if (eax == '#') continue 3d/compare-eax-and 0x23/imm32/hash - 74/jump-if-equal $subx-braces:word-loop/disp8 + 74/jump-if-= $subx-braces:word-loop/disp8 $subx-braces:check-for-break: # if (!slice-starts-with?(word-slice, "break/")) goto next check # . eax = slice-starts-with?(word-slice, "break/") (slice-starts-with? %edi "break/") # . if (eax == false) goto next check 3d/compare-eax-and 0/imm32/false - 74/jump-if-equal $subx-braces:check-for-loop/disp8 + 74/jump-if-= $subx-braces:check-for-loop/disp8 $subx-braces:emit-break: (top %edx) # print(out, "_break" eax) @@ -219,7 +219,7 @@ $subx-braces:check-for-loop: (slice-starts-with? %edi "loop/") # . if (eax == false) goto next check 3d/compare-eax-and 0/imm32/false - 74/jump-if-equal $subx-braces:emit-word-slice/disp8 + 74/jump-if-= $subx-braces:emit-word-slice/disp8 $subx-braces:emit-loop: (top %edx) # print(out, "_loop" eax) diff --git a/apps/calls.subx b/apps/calls.subx index aedd766a..a1ab5ca1 100644 --- a/apps/calls.subx +++ b/apps/calls.subx @@ -41,7 +41,7 @@ Entry: # run tests if necessary, convert stdin if not # - if argc > 1 and argv[1] == "test", then return run_tests() # if (argc <= 1) goto run-main 81 7/subop/compare *ebp 1/imm32 - 7e/jump-if-lesser-or-equal $subx-calls-main:interactive/disp8 + 7e/jump-if-<= $subx-calls-main:interactive/disp8 # if (!kernel-string-equal?(argv[1], "test")) goto run-main # . eax = kernel-string-equal?(argv[1], "test") # . . push args @@ -53,7 +53,7 @@ Entry: # run tests if necessary, convert stdin if not 81 0/subop/add %esp 8/imm32 # . if (eax == false) goto run-main 3d/compare-eax-and 0/imm32/false - 74/jump-if-equal $subx-calls-main:interactive/disp8 + 74/jump-if-= $subx-calls-main:interactive/disp8 # run-tests() e8/call run-tests/disp32 # syscall(exit, *Num-test-failures) @@ -136,7 +136,7 @@ $subx-calls:loop: $subx-calls:check0: # if (line->write == 0) break 81 7/subop/compare *esi 0/imm32 - 0f 84/jump-if-equal $subx-calls:break/disp32 + 0f 84/jump-if-= $subx-calls:break/disp32 # skip-chars-matching-whitespace(line) # . . push args 56/push-esi @@ -152,7 +152,7 @@ $subx-calls:check0: 8a/copy-byte *(esi+ecx+0xc) 0/r32/AL # . if (eax == '(') goto convert-call 3d/compare-eax-and 0x28/imm32/open-paren - 74/jump-if-equal $subx-calls:convert-call/disp8 + 74/jump-if-= $subx-calls:convert-call/disp8 $subx-calls:pass-through: # write-stream-data(out, line) # . . push args @@ -270,7 +270,7 @@ $parse-line:check1: 81 0/subop/add %esp 4/imm32 # . if (eax != false) break 3d/compare-eax-and 0/imm32/false - 0f 85/jump-if-not-equal $parse-line:end/disp32 + 0f 85/jump-if-!= $parse-line:end/disp32 #? # dump word-slice {{{ #? # . write(2/stderr, "w: ") #? # . . push args @@ -380,7 +380,7 @@ emit-call: # out : (addr buffered-file), words : (addr stream slice) # . ecx = words->write - 8 8b/-> *esi 1/r32/ecx 81 5/subop/subtract %ecx 8/imm32 - 0f 8c/jump-if-lesser $emit-call:error1/disp32 + 0f 8c/jump-if-< $emit-call:error1/disp32 # var curr/ecx : (addr slice) = &words->data[words->write-8] 8d/copy-address *(esi+ecx+0xc) 1/r32/ecx # var min/edx : (addr byte) = words->data @@ -389,7 +389,7 @@ emit-call: # out : (addr buffered-file), words : (addr stream slice) $emit-call:push-loop: # if (curr <= min) break 39/compare %ecx 2/r32/edx - 0f 8e/jump-if-lesser-or-equal $emit-call:call-instruction/disp32 + 0f 8e/jump-if-<= $emit-call:call-instruction/disp32 # if (*curr->start in '%' '*') goto push-rm32 # . var start/eax : (addr byte) = curr->start 8b/-> *ecx 0/r32/eax @@ -398,10 +398,10 @@ $emit-call:push-loop: 81 4/subop/and %eax 0xff/imm32 # . if (c == '%') goto push-rm32 3d/compare-eax-and 0x25/imm32/percent - 74/jump-if-equal $emit-call:push-rm32/disp8 + 74/jump-if-= $emit-call:push-rm32/disp8 # . if (c == '*') goto push-rm32 3d/compare-eax-and 0x2a/imm32/asterisk - 74/jump-if-equal $emit-call:push-rm32/disp8 + 74/jump-if-= $emit-call:push-rm32/disp8 $emit-call:push-imm32: # write-buffered(out, "68/push ") 68/push "68/push "/imm32 @@ -824,7 +824,7 @@ $next-word-string-or-expression-without-metadata:check0: 8b/-> *(esi+4) 1/r32/ecx # . if (ecx >= line->write) return out = {0, 0} 3b/compare 1/r32/ecx *esi - 0f 8d/jump-if-greater-or-equal $next-word-string-or-expression-without-metadata:return-eol/disp32 + 0f 8d/jump-if->= $next-word-string-or-expression-without-metadata:return-eol/disp32 $next-word-string-or-expression-without-metadata:check-for-comment: # out->start = &line->data[line->read] 8d/copy-address *(esi+ecx+0xc) 0/r32/eax @@ -835,7 +835,7 @@ $next-word-string-or-expression-without-metadata:check-for-comment: 8a/copy-byte *(esi+ecx+0xc) 0/r32/AL # . if (eax != '#') goto next check 3d/compare-eax-and 0x23/imm32/pound - 75/jump-if-not-equal $next-word-string-or-expression-without-metadata:check-for-string-literal/disp8 + 75/jump-if-!= $next-word-string-or-expression-without-metadata:check-for-string-literal/disp8 $next-word-string-or-expression-without-metadata:comment: # out->end = &line->data[line->write] 8b/-> *esi 0/r32/eax @@ -849,7 +849,7 @@ $next-word-string-or-expression-without-metadata:comment: $next-word-string-or-expression-without-metadata:check-for-string-literal: # if (line->data[line->read] != '"') goto next check 3d/compare-eax-and 0x22/imm32/dquote - 75/jump-if-not-equal $next-word-string-or-expression-without-metadata:check-for-expression/disp8 + 75/jump-if-!= $next-word-string-or-expression-without-metadata:check-for-expression/disp8 $next-word-string-or-expression-without-metadata:string-literal: # skip-string(line) # . . push args @@ -867,14 +867,14 @@ $next-word-string-or-expression-without-metadata:string-literal: $next-word-string-or-expression-without-metadata:check-for-expression: # if (line->data[line->read] != '*') goto next check 3d/compare-eax-and 0x2a/imm32/asterisk - 75/jump-if-not-equal $next-word-string-or-expression-without-metadata:check-for-end-of-call/disp8 + 75/jump-if-!= $next-word-string-or-expression-without-metadata:check-for-end-of-call/disp8 # if (line->data[line->read + 1] == ' ') goto error1 8a/copy-byte *(esi+ecx+0xd) 0/r32/AL 3d/compare-eax-and 0x20/imm32/space - 0f 84/jump-if-equal $next-word-string-or-expression-without-metadata:error1/disp32 + 0f 84/jump-if-= $next-word-string-or-expression-without-metadata:error1/disp32 # if (line->data[line->read + 1] != '(') goto regular-word 3d/compare-eax-and 0x28/imm32/open-paren - 0f 85/jump-if-not-equal $next-word-string-or-expression-without-metadata:regular-word-without-metadata/disp32 + 0f 85/jump-if-!= $next-word-string-or-expression-without-metadata:regular-word-without-metadata/disp32 $next-word-string-or-expression-without-metadata:paren: # skip-until-close-paren(line) # . . push args @@ -889,7 +889,7 @@ $next-word-string-or-expression-without-metadata:paren: 8a/copy-byte *(esi+ecx+0xc) 0/r32/AL # . if (eax != ')') goto error2 3d/compare-eax-and 0x29/imm32/close-paren - 0f 85/jump-if-not-equal $next-word-string-or-expression-without-metadata:error2/disp32 + 0f 85/jump-if-!= $next-word-string-or-expression-without-metadata:error2/disp32 # ++line->read to skip ')' ff 0/subop/increment *(esi+4) # out->end = &line->data[line->read] @@ -901,7 +901,7 @@ $next-word-string-or-expression-without-metadata:paren: $next-word-string-or-expression-without-metadata:check-for-end-of-call: # if (line->data[line->read] != ')') goto next check 3d/compare-eax-and 0x29/imm32/close-paren - 75/jump-if-not-equal $next-word-string-or-expression-without-metadata:regular-word-without-metadata/disp8 + 75/jump-if-!= $next-word-string-or-expression-without-metadata:regular-word-without-metadata/disp8 # ++line->read to skip ')' ff 0/subop/increment *(esi+4) # - error checking: make sure there's nothing else of importance on the line @@ -910,13 +910,13 @@ $next-word-string-or-expression-without-metadata:check-for-end-of-call: 8b/-> *(esi+4) 1/r32/ecx # . if (ecx >= line->write) return {0, 0} 3b/compare 1/r32/ecx *esi - 0f 8d/jump-if-greater-or-equal $next-word-string-or-expression-without-metadata:return-eol/disp32 + 0f 8d/jump-if->= $next-word-string-or-expression-without-metadata:return-eol/disp32 # if (line->data[line->read] == '/') goto error3 # . eax = line->data[line->read] 8a/copy-byte *(esi+ecx+0xc) 0/r32/AL # . if (eax == '/') goto error3 3d/compare-eax-and 0x2f/imm32/slash - 0f 84/jump-if-equal $next-word-string-or-expression-without-metadata:error3/disp32 + 0f 84/jump-if-= $next-word-string-or-expression-without-metadata:error3/disp32 # skip-chars-matching-whitespace(line) # . . push args 56/push-esi @@ -929,14 +929,14 @@ $next-word-string-or-expression-without-metadata:check-for-end-of-call: 8b/-> *(esi+4) 1/r32/ecx # . if (ecx >= line->write) return {0, 0} 3b/compare 1/r32/ecx *esi - 0f 8d/jump-if-greater-or-equal $next-word-string-or-expression-without-metadata:return-eol/disp32 + 0f 8d/jump-if->= $next-word-string-or-expression-without-metadata:return-eol/disp32 # if (line->data[line->read] == '#') return out = {0, 0} # . eax = line->data[line->read] 8b/-> *(esi+4) 1/r32/ecx 8a/copy-byte *(esi+ecx+0xc) 0/r32/AL # . if (eax == '#') return out = {0, 0} 3d/compare-eax-and 0x23/imm32/pound - 74/jump-if-equal $next-word-string-or-expression-without-metadata:return-eol/disp8 + 74/jump-if-= $next-word-string-or-expression-without-metadata:return-eol/disp8 # otherwise goto error4 e9/jump $next-word-string-or-expression-without-metadata:error4/disp32 $next-word-string-or-expression-without-metadata:regular-word-without-metadata: @@ -945,20 +945,20 @@ $next-word-string-or-expression-without-metadata:regular-word-without-metadata: 8b/-> *(esi+4) 1/r32/ecx # . if (ecx >= line->write) break 3b/compare *esi 1/r32/ecx - 7d/jump-if-greater-or-equal $next-word-string-or-expression-without-metadata:regular-word-break/disp8 + 7d/jump-if->= $next-word-string-or-expression-without-metadata:regular-word-break/disp8 # if (line->data[line->read] == ' ') break # . eax = line->data[line->read] 8b/-> *(esi+4) 1/r32/ecx 8a/copy-byte *(esi+ecx+0xc) 0/r32/AL # . if (eax == ' ') break 3d/compare-eax-and 0x20/imm32/space - 74/jump-if-equal $next-word-string-or-expression-without-metadata:regular-word-break/disp8 + 74/jump-if-= $next-word-string-or-expression-without-metadata:regular-word-break/disp8 # if (line->data[line->read] == ')') break 3d/compare-eax-and 0x29/imm32/close-paren - 0f 84/jump-if-equal $next-word-string-or-expression-without-metadata:regular-word-break/disp32 + 0f 84/jump-if-= $next-word-string-or-expression-without-metadata:regular-word-break/disp32 # if (line->data[line->read] == '/') goto error5 3d/compare-eax-and 0x2f/imm32/slash - 0f 84/jump-if-equal $next-word-string-or-expression-without-metadata:error5/disp32 + 0f 84/jump-if-= $next-word-string-or-expression-without-metadata:error5/disp32 # ++line->read ff 0/subop/increment *(esi+4) # loop diff --git a/apps/crenshaw2-1.subx b/apps/crenshaw2-1.subx index b5783ef3..e8ff7101 100644 --- a/apps/crenshaw2-1.subx +++ b/apps/crenshaw2-1.subx @@ -47,7 +47,7 @@ Entry: # run tests if necessary, call 'compile' if not # - if argc > 1 and argv[1] == "test", then return run_tests() # if (argc <= 1) goto run-main 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 0/disp8 1/imm32 # compare *ebp - 7e/jump-if-lesser-or-equal $run-main/disp8 + 7e/jump-if-<= $run-main/disp8 # if (!kernel-string-equal?(argv[1], "test")) goto run-main # . eax = kernel-string-equal?(argv[1], "test") # . . push args @@ -59,7 +59,7 @@ Entry: # run tests if necessary, call 'compile' if not 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax == false) goto run-main 3d/compare-eax-and 0/imm32/false - 74/jump-if-equal $run-main/disp8 + 74/jump-if-= $run-main/disp8 # run-tests() e8/call run-tests/disp32 # syscall(exit, *Num-test-failures) @@ -224,7 +224,7 @@ get-num: # in : (addr buffered-file), out : (addr stream byte), err : fd or (ad 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax == false) 3d/compare-eax-and 0/imm32/false - 75/jump-if-not-equal $get-num:main/disp8 + 75/jump-if-!= $get-num:main/disp8 # . expected(ed, err, "integer") # . . push args 68/push "integer"/imm32 @@ -255,7 +255,7 @@ $get-num:main: $get-num:loop: # if (out->write >= out->length) error 39/compare 3/mod/direct 2/rm32/edx . . . 1/r32/ecx . . # compare edx with ecx - 7d/jump-if-lesser $get-num:stage2/disp8 + 7d/jump-if-< $get-num:stage2/disp8 # . error(ed, err, msg) # TODO: show full number # . . push args 68/push "get-num: too many digits in number"/imm32 @@ -543,10 +543,10 @@ is-digit?: # c : int -> eax : boolean b8/copy-to-eax 0/imm32 # if (c < '0') return false 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 0x30/imm32 # compare *(ebp+8) - 7c/jump-if-lesser $is-digit?:end/disp8 + 7c/jump-if-< $is-digit?:end/disp8 # if (c > '9') return false 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 0x39/imm32 # compare *(ebp+8) - 7f/jump-if-greater $is-digit?:end/disp8 + 7f/jump-if-> $is-digit?:end/disp8 # otherwise return true b8/copy-to-eax 1/imm32 $is-digit?:end: diff --git a/apps/crenshaw2-1b.subx b/apps/crenshaw2-1b.subx index d5f90952..f382955c 100644 --- a/apps/crenshaw2-1b.subx +++ b/apps/crenshaw2-1b.subx @@ -47,7 +47,7 @@ Entry: # run tests if necessary, call 'compile' if not # - if argc > 1 and argv[1] == "test", then return run_tests() # if (argc <= 1) goto run-main 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 0/disp8 1/imm32 # compare *ebp - 7e/jump-if-lesser-or-equal $run-main/disp8 + 7e/jump-if-<= $run-main/disp8 # if (!kernel-string-equal?(argv[1], "test")) goto run-main # . eax = kernel-string-equal?(argv[1], "test") # . . push args @@ -59,7 +59,7 @@ Entry: # run tests if necessary, call 'compile' if not 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax == false) goto run-main 3d/compare-eax-and 0/imm32/false - 74/jump-if-equal $run-main/disp8 + 74/jump-if-= $run-main/disp8 # run-tests() e8/call run-tests/disp32 # syscall(exit, *Num-test-failures) @@ -229,7 +229,7 @@ get-num: # in : (addr buffered-file), out : (addr stream byte), err : fd or (ad 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax == false) 3d/compare-eax-and 0/imm32/false - 75/jump-if-not-equal $get-num:main/disp8 + 75/jump-if-!= $get-num:main/disp8 # . expected(ed, err, "integer") # . . push args 68/push "integer"/imm32 @@ -260,7 +260,7 @@ $get-num:main: $get-num:loop: # if (out->write >= out->length) error 39/compare 3/mod/direct 2/rm32/edx . . . 1/r32/ecx . . # compare edx with ecx - 7d/jump-if-lesser $get-num:loop-stage2/disp8 + 7d/jump-if-< $get-num:loop-stage2/disp8 # . error(ed, err, msg) # TODO: show full number # . . push args 68/push "get-num: too many digits in number"/imm32 @@ -294,7 +294,7 @@ $get-num:loop-stage2: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax != false) loop 3d/compare-eax-and 0/imm32/false - 0f 85/jump-if-not-equal $get-num:loop/disp32 + 0f 85/jump-if-!= $get-num:loop/disp32 $get-num:loop-end: # persist necessary variables from registers 89/copy 0/mod/indirect 7/rm32/edi . . . 1/r32/ecx . . # copy ecx to *edi @@ -737,10 +737,10 @@ is-digit?: # c : int -> eax : boolean b8/copy-to-eax 0/imm32 # if (c < '0') return false 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 0x30/imm32 # compare *(ebp+8) - 7c/jump-if-lesser $is-digit?:end/disp8 + 7c/jump-if-< $is-digit?:end/disp8 # if (c > '9') return false 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 0x39/imm32 # compare *(ebp+8) - 7f/jump-if-greater $is-digit?:end/disp8 + 7f/jump-if-> $is-digit?:end/disp8 # otherwise return true b8/copy-to-eax 1/imm32 $is-digit?:end: diff --git a/apps/dquotes.subx b/apps/dquotes.subx index 5396d26e..38eb08fd 100644 --- a/apps/dquotes.subx +++ b/apps/dquotes.subx @@ -36,7 +36,7 @@ Entry: # run tests if necessary, convert stdin if not # - if argc > 1 and argv[1] == "test", then return run-tests() # if (argc <= 1) goto interactive 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 0/disp8 1/imm32 # compare *ebp - 7e/jump-if-lesser-or-equal $subx-dquotes-main:interactive/disp8 + 7e/jump-if-<= $subx-dquotes-main:interactive/disp8 # if (!kernel-string-equal?(argv[1], "test")) goto interactive # . eax = kernel-string-equal?(argv[1], "test") # . . push args @@ -48,7 +48,7 @@ Entry: # run tests if necessary, convert stdin if not 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax == false) goto interactive 3d/compare-eax-and 0/imm32/false - 74/jump-if-equal $subx-dquotes-main:interactive/disp8 + 74/jump-if-= $subx-dquotes-main:interactive/disp8 # run-tests() e8/call run-tests/disp32 # syscall(exit, *Num-test-failures) @@ -174,7 +174,7 @@ $subx-dquotes:line-loop: $subx-dquotes:check0: # if (line->write == 0) break 81 7/subop/compare 0/mod/indirect 1/rm32/ecx . . . . . 0/imm32 # compare *ecx - 0f 84/jump-if-equal $subx-dquotes:break/disp32 + 0f 84/jump-if-= $subx-dquotes:break/disp32 $subx-dquotes:word-loop: # next-word-or-string(line, word-slice) # . . push args @@ -195,7 +195,7 @@ $subx-dquotes:check1: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax != false) break 3d/compare-eax-and 0/imm32/false - 0f 85/jump-if-not-equal $subx-dquotes:next-line/disp32 + 0f 85/jump-if-!= $subx-dquotes:next-line/disp32 $subx-dquotes:check-for-comment: # if (slice-starts-with?(word-slice, "#")) continue # . var start/esi : (addr byte) = word-slice->start @@ -205,11 +205,11 @@ $subx-dquotes:check-for-comment: 8a/copy-byte 0/mod/indirect 6/rm32/esi . . . 0/r32/AL . . # copy byte at *esi to AL # . if (c == '#') continue 3d/compare-eax-and 0x23/imm32/hash - 74/jump-if-equal $subx-dquotes:word-loop/disp8 + 74/jump-if-= $subx-dquotes:word-loop/disp8 $subx-dquotes:check-for-string-literal: # if (slice-starts-with?(word-slice, '"')) continue 3d/compare-eax-and 0x22/imm32/dquote - 75/jump-if-not-equal $subx-dquotes:regular-word/disp8 + 75/jump-if-!= $subx-dquotes:regular-word/disp8 $subx-dquotes:string-literal: # process-string-literal(word-slice, out, new-data-segment) # . . push args @@ -925,25 +925,25 @@ $emit-string-literal-data:loop-init: $emit-string-literal-data:loop: # if (curr >= max) break 39/compare 3/mod/direct 2/rm32/edx . . . 6/r32/esi . . # compare edx with esi - 0f 83/jump-if-greater-or-equal-unsigned $emit-string-literal-data:end/disp32 + 0f 83/jump-if-addr>= $emit-string-literal-data:end/disp32 # CL = *curr 8a/copy-byte 0/mod/indirect 2/rm32/edx . . . 1/r32/CL . . # copy byte at *edx to CL # if (c == '"') break 81 7/subop/compare 3/mod/direct 1/rm32/ecx . . . . . 0x22/imm32/dquote # compare ecx - 0f 84/jump-if-equal $emit-string-literal-data:end/disp32 + 0f 84/jump-if-= $emit-string-literal-data:end/disp32 # if (c != '\') goto emit 81 7/subop/compare 3/mod/direct 1/rm32/ecx . . . . . 0x5c/imm32/backslash # compare ecx - 75/jump-if-not-equal $emit-string-literal-data:emit/disp8 + 75/jump-if-!= $emit-string-literal-data:emit/disp8 # ++curr 42/increment-edx # if (curr >= max) break 39/compare 3/mod/direct 2/rm32/edx . . . 6/r32/esi . . # compare edx with esi - 0f 83/jump-if-greater-or-equal-unsigned $emit-string-literal-data:end/disp32 + 0f 83/jump-if-addr>= $emit-string-literal-data:end/disp32 # c = *curr 8a/copy-byte 0/mod/indirect 2/rm32/edx . . . 1/r32/CL . . # copy byte at *edx to CL # if (c == 'n') c = newline 81 7/subop/compare 3/mod/direct 1/rm32/ecx . . . . . 0x6e/imm32/n # compare ecx - 75/jump-if-not-equal $emit-string-literal-data:emit/disp8 + 75/jump-if-!= $emit-string-literal-data:emit/disp8 b9/copy-to-ecx 0x0a/imm32/newline $emit-string-literal-data:emit: # append-byte-hex(out, CL) @@ -964,7 +964,7 @@ $emit-string-literal-data:emit: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax == false) goto char-done 3d/compare-eax-and 0/imm32/false - 74/jump-if-equal $emit-string-literal-data:char-done/disp8 + 74/jump-if-= $emit-string-literal-data:char-done/disp8 # . write(out, "/") # . . push args 68/push Slash/imm32 @@ -996,7 +996,7 @@ $emit-string-literal-data:char-done: 43/increment-ebx # if (idx < 0x40) continue 81 7/subop/compare 3/mod/direct 3/rm32/ebx . . . . . 0x40/imm32 # compare ebx - 7c/jump-if-lesser $emit-string-literal-data:next-char/disp8 + 7c/jump-if-< $emit-string-literal-data:next-char/disp8 # idx = 0 31/xor 3/mod/direct 3/rm32/ebx . . . 3/r32/ebx . . # clear ebx # write(out, "\n") @@ -1029,22 +1029,22 @@ is-alphanumeric?: # c : int -> eax : boolean 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 0/r32/eax 8/disp8 . # copy *(ebp+8) to eax # if (c < '0') return false 3d/compare-eax-with 0x30/imm32/0 - 7c/jump-if-lesser $is-alphanumeric?:false/disp8 + 7c/jump-if-< $is-alphanumeric?:false/disp8 # if (c <= '9') return true 3d/compare-eax-with 0x39/imm32/9 - 7e/jump-if-lesser-or-equal $is-alphanumeric?:true/disp8 + 7e/jump-if-<= $is-alphanumeric?:true/disp8 # if (c < 'A') return false 3d/compare-eax-with 0x41/imm32/A - 7c/jump-if-lesser $is-alphanumeric?:false/disp8 + 7c/jump-if-< $is-alphanumeric?:false/disp8 # if (c <= 'Z') return true 3d/compare-eax-with 0x5a/imm32/Z - 7e/jump-if-lesser-or-equal $is-alphanumeric?:true/disp8 + 7e/jump-if-<= $is-alphanumeric?:true/disp8 # if (c < 'a') return false 3d/compare-eax-with 0x61/imm32/a - 7c/jump-if-lesser $is-alphanumeric?:false/disp8 + 7c/jump-if-< $is-alphanumeric?:false/disp8 # if (c <= 'z') return true 3d/compare-eax-with 0x7a/imm32/z - 7e/jump-if-lesser-or-equal $is-alphanumeric?:true/disp8 + 7e/jump-if-<= $is-alphanumeric?:true/disp8 # return false $is-alphanumeric?:false: b8/copy-to-eax 0/imm32/false @@ -1420,7 +1420,7 @@ $emit-metadata:check-for-string-literal: # - if (*curr == '"') curr = skip-string-in-slice(curr, end) 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 0/r32/AL . . # copy byte at *ecx to AL 3d/compare-eax-and 0x22/imm32/dquote - 75/jump-if-not-equal $emit-metadata:skip-datum-loop/disp8 + 75/jump-if-!= $emit-metadata:skip-datum-loop/disp8 $emit-metadata:skip-string-literal: # . eax = skip-string-in-slice(curr, end) # . . push args @@ -1437,11 +1437,11 @@ $emit-metadata:skip-datum-loop: # - otherwise scan for '/' # if (curr == end) return 39/compare 3/mod/direct 1/rm32/ecx . . . 2/r32/edx . . # compare ecx and edx - 74/jump-if-equal $emit-metadata:end/disp8 + 74/jump-if-= $emit-metadata:end/disp8 # if (*curr == '/') break 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 0/r32/AL . . # copy byte at *ecx to AL 3d/compare-eax-and 0x2f/imm32/slash - 74/jump-if-equal $emit-metadata:emit/disp8 + 74/jump-if-= $emit-metadata:emit/disp8 # ++curr 41/increment-ecx eb/jump $emit-metadata:skip-datum-loop/disp8 @@ -1799,17 +1799,17 @@ string-length-at-start-of-slice: # curr : (addr byte), end : (addr byte) -> len $string-length-at-start-of-slice:loop: # if (curr >= end) return length 39/compare 3/mod/direct 1/rm32/ecx . . . 2/r32/edx . . # compare ecx with edx - 73/jump-if-greater-unsigned-or-equal $string-length-at-start-of-slice:end/disp8 + 73/jump-if-addr>= $string-length-at-start-of-slice:end/disp8 # c = *curr 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 3/r32/BL . . # copy byte at *ecx to BL $string-length-at-start-of-slice:dquote: # if (c == '"') break 81 7/subop/compare 3/mod/direct 3/rm32/ebx . . . . . 0x22/imm32/dquote # compare ebx - 74/jump-if-equal $string-length-at-start-of-slice:end/disp8 + 74/jump-if-= $string-length-at-start-of-slice:end/disp8 $string-length-at-start-of-slice:check-for-escape: # if (c == '\') escape next char 81 7/subop/compare 3/mod/direct 3/rm32/ebx . . . . . 0x5c/imm32/backslash # compare ebx - 75/jump-if-not-equal $string-length-at-start-of-slice:continue/disp8 + 75/jump-if-!= $string-length-at-start-of-slice:continue/disp8 $string-length-at-start-of-slice:escape: # increment curr but not result 41/increment-ecx diff --git a/apps/ex10.subx b/apps/ex10.subx index c091fe52..a67ec6f7 100644 --- a/apps/ex10.subx +++ b/apps/ex10.subx @@ -45,10 +45,10 @@ $argv-equal:loop: 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-and 0/imm32 - 74/jump-if-equal $argv-equal:break/disp8 + 74/jump-if-= $argv-equal:break/disp8 # if (c1 != c2) return false 39/compare 3/mod/direct 0/rm32/eax . . . 3/r32/ebx . . # compare eax and ebx - 75/jump-if-not-equal $argv-equal:false/disp8 + 75/jump-if-!= $argv-equal:false/disp8 # ++s1, ++s2 41/increment-ecx 42/increment-edx @@ -57,7 +57,7 @@ $argv-equal:loop: $argv-equal:break: # if (c2 == 0) return true 81 7/subop/compare 3/mod/direct 3/rm32/ebx . . . . . 0/imm32 # compare ebx - 75/jump-if-not-equal $argv-equal:false/disp8 + 75/jump-if-!= $argv-equal:false/disp8 $argv-equal:success: b8/copy-to-eax 1/imm32 c3/return diff --git a/apps/ex11.subx b/apps/ex11.subx index 2469542d..fb63b25c 100644 --- a/apps/ex11.subx +++ b/apps/ex11.subx @@ -73,17 +73,17 @@ kernel-string-equal?: # s : null-terminated ascii string, benchmark : length-pr $kernel-string-equal?:loop: # if (i >= n) break 39/compare 3/mod/direct 1/rm32/ecx . . . 2/r32/edx . . # compare ecx with edx - 7d/jump-if-greater-or-equal $kernel-string-equal?:break/disp8 + 7d/jump-if->= $kernel-string-equal?:break/disp8 # c1 = *s1 8a/copy-byte 0/mod/indirect 7/rm32/edi . . . 0/r32/AL . . # copy byte at *edi to AL # 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-and 0/imm32 - 74/jump-if-equal $kernel-string-equal?:false/disp8 + 74/jump-if-= $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 - 75/jump-if-not-equal $kernel-string-equal?:false/disp8 + 75/jump-if-!= $kernel-string-equal?:false/disp8 # ++i 41/increment-ecx # ++s1 @@ -95,7 +95,7 @@ $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-and 0/imm32 - 75/jump-if-not-equal $kernel-string-equal?:false/disp8 + 75/jump-if-!= $kernel-string-equal?:false/disp8 $kernel-string-equal?:true: b8/copy-to-eax 1/imm32 eb/jump $kernel-string-equal?:end/disp8 diff --git a/apps/ex3.subx b/apps/ex3.subx index f6f8c17d..66f2b3a3 100644 --- a/apps/ex3.subx +++ b/apps/ex3.subx @@ -21,7 +21,7 @@ Entry: $loop: # if (counter > 10) break 81 7/subop/compare 3/mod/direct 1/rm32/ecx . . . . . 0xa/imm32 # compare ecx - 7f/jump-if-greater $exit/disp8 + 7f/jump-if-> $exit/disp8 # result += counter 01/add 3/mod/direct 3/rm32/ebx . . . 1/r32/ecx . . # add ecx to ebx # ++counter diff --git a/apps/ex8.subx b/apps/ex8.subx index 2ea653f1..e000bfca 100644 --- a/apps/ex8.subx +++ b/apps/ex8.subx @@ -44,7 +44,7 @@ $ascii-length:loop: 8a/copy-byte 0/mod/* 2/rm32/edx . . . 1/r32/CL . . # copy byte at *edx to CL # if (c == '\0') break 81 7/subop/compare 3/mod/direct 1/rm32/ecx . . . . . 0/imm32 # compare ecx - 74/jump-if-equal $ascii-length:end/disp8 + 74/jump-if-= $ascii-length:end/disp8 # ++s 42/increment-edx # ++result diff --git a/apps/factorial.subx b/apps/factorial.subx index 019329e3..aebd2a12 100644 --- a/apps/factorial.subx +++ b/apps/factorial.subx @@ -35,7 +35,7 @@ Entry: # run tests if necessary, compute `factorial(5)` if not # - if argc > 1 and argv[1] == "test", then return run_tests() # if (argc <= 1) goto run-main 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 0/disp8 1/imm32 # compare *ebp - 7e/jump-if-lesser-or-equal $run-main/disp8 + 7e/jump-if-<= $run-main/disp8 # if (!kernel-string-equal?(argv[1], "test")) goto run-main # . eax = kernel-string-equal?(argv[1], "test") # . . push args @@ -47,7 +47,7 @@ Entry: # run tests if necessary, compute `factorial(5)` if not 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax == false) goto run-main 3d/compare-eax-and 0/imm32/false - 74/jump-if-equal $run-main/disp8 + 74/jump-if-= $run-main/disp8 # run-tests() e8/call run-tests/disp32 # syscall(exit, *Num-test-failures) diff --git a/apps/factorial2.subx b/apps/factorial2.subx index f6578f1b..7e0a737d 100644 --- a/apps/factorial2.subx +++ b/apps/factorial2.subx @@ -35,7 +35,7 @@ Entry: # run tests if necessary, compute `factorial(5)` if not # - if argc > 1 and argv[1] == "test", then return run_tests() # if (argc <= 1) goto run-main 81 7/subop/compare *ebp 1/imm32 - 7e/jump-if-lesser-or-equal $run-main/disp8 + 7e/jump-if-<= $run-main/disp8 # if (!kernel-string-equal?(argv[1], "test")) goto run-main # . eax = kernel-string-equal?(argv[1], "test") # . . push args @@ -47,7 +47,7 @@ Entry: # run tests if necessary, compute `factorial(5)` if not 81 0/subop/add %esp 8/imm32 # . if (eax == false) goto run-main 3d/compare-eax-and 0/imm32/false - 74/jump-if-equal $run-main/disp8 + 74/jump-if-= $run-main/disp8 # run-tests() e8/call run-tests/disp32 # syscall(exit, *Num-test-failures) diff --git a/apps/factorial3.subx b/apps/factorial3.subx index 17a8cbbb..e6bcf959 100644 --- a/apps/factorial3.subx +++ b/apps/factorial3.subx @@ -29,12 +29,12 @@ Entry: # run tests if necessary, compute `factorial(5)` if not # - if argc > 1 and argv[1] == "test", then return run_tests() # if (argc <= 1) goto run-main 81 7/subop/compare *ebp 1/imm32 - 7e/jump-if-lesser-or-equal $run-main/disp8 + 7e/jump-if-<= $run-main/disp8 # if (!kernel-string-equal?(argv[1], "test")) goto run-main (kernel-string-equal? *(ebp+8) "test") # => eax # . if (eax == false) goto run-main 3d/compare-eax-and 0/imm32/false - 74/jump-if-equal $run-main/disp8 + 74/jump-if-= $run-main/disp8 # (run-tests) # syscall(exit, *Num-test-failures) diff --git a/apps/factorial4.subx b/apps/factorial4.subx index 99d7bff4..5f8c6aef 100644 --- a/apps/factorial4.subx +++ b/apps/factorial4.subx @@ -31,11 +31,11 @@ Entry: # run tests if necessary, compute `factorial(5)` if not { # if (argc <= 1) break 81 7/subop/compare *ebp 1/imm32 - 7e/jump-if-lesser-or-equal break/disp8 + 7e/jump-if-<= break/disp8 # if (!kernel-string-equal?(argv[1], "test")) break (kernel-string-equal? *(ebp+8) "test") # => eax 3d/compare-eax-and 0/imm32/false - 74/jump-if-equal break/disp8 + 74/jump-if-= break/disp8 # (run-tests) # eax = *Num-test-failures @@ -45,7 +45,7 @@ Entry: # run tests if necessary, compute `factorial(5)` if not { # if (argc > 1) break 81 7/subop/compare *ebp 1/imm32 - 7f/jump-if-greater break/disp8 + 7f/jump-if-> break/disp8 # eax = factorial(5) (factorial 5) # syscall(exit, eax) @@ -64,12 +64,12 @@ factorial: # n : int -> int/eax # if (n <= 1) return 1 81 7/subop/compare *(ebp+8) 1/imm32 { - 7f/jump-if-greater break/disp8 + 7f/jump-if-> break/disp8 b8/copy-to-eax 1/imm32 } # if (n > 1) return n * factorial(n-1) { - 7e/jump-if-lesser-or-equal break/disp8 + 7e/jump-if-<= break/disp8 # var ebx : int = n-1 8b/-> *(ebp+8) 3/r32/ebx 4b/decrement-ebx diff --git a/apps/handle.subx b/apps/handle.subx index 38af2db2..37fb9030 100644 --- a/apps/handle.subx +++ b/apps/handle.subx @@ -69,7 +69,7 @@ new: # ad : (addr allocation-descriptor), n : int, out : (handle _) 89/copy 1/mod/*+disp8 2/rm32/edx . . . 0/r32/eax 4/disp8 . # copy eax to *(edx+4) # if (eax == 0) out->alloc_id = 0, return 3d/compare-eax-and 0/imm32 - 75/jump-if-not-equal $new:continue/disp8 + 75/jump-if-!= $new:continue/disp8 c7 0/subop/copy 0/mod/indirect 2/rm32/edx . . . . . 0/imm32 # copy to *edx eb/jump $new:end/disp8 $new:continue: @@ -239,7 +239,7 @@ lookup: # h : (handle T) -> eax : (addr T) 8b/copy 0/mod/indirect 0/rm32/eax . . . . . . # copy *eax to eax # if (eax != handle->alloc_id) abort 39/compare 1/mod/*+disp8 4/rm32/sib 4/base/esp 4/index/none . 0/r32/eax 4/disp8 . # compare *(esp+4) and eax - 75/jump-if-not-equal $lookup:abort/disp8 + 75/jump-if-!= $lookup:abort/disp8 # eax = pop handle->address 58/pop-to-eax # discard handle->alloc_id @@ -254,7 +254,7 @@ lookup: # h : (handle T) -> eax : (addr T) #? 8b/copy 1/mod/*+disp8 0/rm32/eax . . . 0/r32/eax 4/disp8 . # copy *(eax+4) to eax #? # if (ecx != *eax) abort #? 39/compare 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . . # compare *eax and ecx -#? 75/jump-if-not-equal $lookup:abort/disp8 +#? 75/jump-if-!= $lookup:abort/disp8 #? # add 4 to eax #? 05/add-to-eax 4/imm32 # - } diff --git a/apps/hex.subx b/apps/hex.subx index 4dd725e8..21fd1939 100644 --- a/apps/hex.subx +++ b/apps/hex.subx @@ -34,7 +34,7 @@ Entry: # run tests if necessary, convert stdin if not # - if argc > 1 and argv[1] == "test", then return run_tests() # if (argc <= 1) goto interactive 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 0/disp8 1/imm32 # compare *ebp - 7e/jump-if-lesser-or-equal $subx-hex-main:interactive/disp8 + 7e/jump-if-<= $subx-hex-main:interactive/disp8 # if (!kernel-string-equal?(argv[1], "test")) goto interactive # . eax = kernel-string-equal?(argv[1], "test") # . . push args @@ -46,7 +46,7 @@ Entry: # run tests if necessary, convert stdin if not 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax == false) goto interactive 3d/compare-eax-and 0/imm32/false - 74/jump-if-equal $subx-hex-main:interactive/disp8 + 74/jump-if-= $subx-hex-main:interactive/disp8 # run-tests() e8/call run-tests/disp32 # syscall(exit, *Num-test-failures) @@ -102,7 +102,7 @@ $subx-hex:loop: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp # if (eax == Eof) break 3d/compare-eax-and 0xffffffff/imm32/Eof - 74/jump-if-equal $subx-hex:loop-end/disp8 + 74/jump-if-= $subx-hex:loop-end/disp8 # write-byte-buffered(out, AL) # . . push args 50/push-eax @@ -162,7 +162,7 @@ convert-next-octet: # in : (addr buffered-file), err : (addr buffered-file), ed 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp # if (eax == Eof) return 3d/compare-eax-and 0xffffffff/imm32/Eof - 74/jump-if-equal $convert-next-octet:end/disp8 + 74/jump-if-= $convert-next-octet:end/disp8 # eax = from-hex-char(eax) e8/call from-hex-char/disp32 # ecx = eax @@ -178,7 +178,7 @@ convert-next-octet: # in : (addr buffered-file), err : (addr buffered-file), ed 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp # if (eax == Eof) error(ed, err, "partial byte found.") 3d/compare-eax-and 0xffffffff/imm32/Eof - 75/jump-if-not-equal $convert-next-octet:convert/disp8 + 75/jump-if-!= $convert-next-octet:convert/disp8 # . error-byte(ed, err, msg, '.') # reusing error-byte to avoid creating _yet_ another helper # . . push args 68/push 0x2e/imm32/period/dummy @@ -284,7 +284,7 @@ test-convert-next-octet: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp # return if abort 81 7/subop/compare 1/mod/*+disp8 1/rm32/ecx . . . . 4/disp8 0/imm32 # compare *(ecx+4) - 75/jump-if-not-equal $test-convert-next-octet:end/disp8 + 75/jump-if-!= $test-convert-next-octet:end/disp8 # check-ints-equal(eax, 0xab, msg) # . . push args 68/push "F - test-convert-next-octet"/imm32 @@ -374,7 +374,7 @@ test-convert-next-octet-handles-Eof: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp # return if abort 81 7/subop/compare 1/mod/*+disp8 1/rm32/ecx . . . . 4/disp8 0/imm32 # compare *(ecx+4) - 75/jump-if-not-equal $test-convert-next-octet-handles-Eof:end/disp8 + 75/jump-if-!= $test-convert-next-octet-handles-Eof:end/disp8 # check-ints-equal(eax, Eof, msg) # . . push args 68/push "F - test-convert-next-octet-handles-Eof"/imm32 @@ -505,7 +505,7 @@ $scan-next-byte:loop: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # if (eax == Eof) return eax 3d/compare-with-eax 0xffffffff/imm32/Eof - 74/jump-if-equal $scan-next-byte:end/disp8 + 74/jump-if-= $scan-next-byte:end/disp8 # if (is-hex-digit?(eax)) return eax # . save eax for now 50/push-eax @@ -521,21 +521,21 @@ $scan-next-byte:loop: # . restore eax (does not affect flags) 58/pop-to-eax # . check whether to return - 75/jump-if-not-equal $scan-next-byte:end/disp8 + 75/jump-if-!= $scan-next-byte:end/disp8 $scan-next-byte:check1: # if (eax == ' ') continue 3d/compare-eax-and 0x20/imm32/space - 74/jump-if-equal $scan-next-byte:loop/disp8 + 74/jump-if-= $scan-next-byte:loop/disp8 # if (eax == '\t') continue 3d/compare-eax-and 9/imm32/tab - 74/jump-if-equal $scan-next-byte:loop/disp8 + 74/jump-if-= $scan-next-byte:loop/disp8 # if (eax == '\n') continue 3d/compare-eax-and 0xa/imm32/newline - 74/jump-if-equal $scan-next-byte:loop/disp8 + 74/jump-if-= $scan-next-byte:loop/disp8 $scan-next-byte:check2: # if (eax == '#') skip-until-newline(in) 3d/compare-with-eax 0x23/imm32 - 75/jump-if-not-equal $scan-next-byte:check3/disp8 + 75/jump-if-!= $scan-next-byte:check3/disp8 # . skip-until-newline(in) # . . push args ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) @@ -641,7 +641,7 @@ test-scan-next-byte: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp # return if abort 81 7/subop/compare 1/mod/*+disp8 1/rm32/ecx . . . . 4/disp8 0/imm32 # compare *(ecx+4) - 75/jump-if-not-equal $test-scan-next-byte:end/disp8 + 75/jump-if-!= $test-scan-next-byte:end/disp8 # check-ints-equal(eax, 0x61/a, msg) # . . push args 68/push "F - test-scan-next-byte"/imm32 @@ -739,7 +739,7 @@ test-scan-next-byte-skips-whitespace: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp # return if abort 81 7/subop/compare 1/mod/*+disp8 1/rm32/ecx . . . . 4/disp8 0/imm32 # compare *(ecx+4) - 75/jump-if-not-equal $test-scan-next-byte-skips-whitespace:end/disp8 + 75/jump-if-!= $test-scan-next-byte-skips-whitespace:end/disp8 # check-ints-equal(eax, 0x61/a, msg) # . . push args 68/push "F - test-scan-next-byte-skips-whitespace"/imm32 @@ -845,7 +845,7 @@ test-scan-next-byte-skips-comment: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp # return if abort 81 7/subop/compare 1/mod/*+disp8 1/rm32/ecx . . . . 4/disp8 0/imm32 # compare *(ecx+4) - 75/jump-if-not-equal $test-scan-next-byte-skips-comment:end/disp8 + 75/jump-if-!= $test-scan-next-byte-skips-comment:end/disp8 # check-ints-equal(eax, 0x61/a, msg) # . . push args 68/push "F - test-scan-next-byte-skips-comment"/imm32 @@ -951,7 +951,7 @@ test-scan-next-byte-skips-comment-and-whitespace: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp # return if abort 81 7/subop/compare 1/mod/*+disp8 1/rm32/ecx . . . . 4/disp8 0/imm32 # compare *(ecx+4) - 75/jump-if-not-equal $test-scan-next-byte-skips-comment-and-whitespace:end/disp8 + 75/jump-if-!= $test-scan-next-byte-skips-comment-and-whitespace:end/disp8 # check-ints-equal(eax, 0x61/a, msg) # . . push args 68/push "F - test-scan-next-byte-skips-comment-and-whitespace"/imm32 @@ -1059,7 +1059,7 @@ test-scan-next-byte-skips-whitespace-and-comment: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp # return if abort 81 7/subop/compare 1/mod/*+disp8 1/rm32/ecx . . . . 4/disp8 0/imm32 # compare *(ecx+4) - 75/jump-if-not-equal $test-scan-next-byte-skips-whitespace-and-comment:end/disp8 + 75/jump-if-!= $test-scan-next-byte-skips-whitespace-and-comment:end/disp8 # check-ints-equal(eax, 0x61/a, msg) # . . push args 68/push "F - test-scan-next-byte-skips-whitespace-and-comment"/imm32 @@ -1157,7 +1157,7 @@ test-scan-next-byte-reads-final-byte: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp # return if abort 81 7/subop/compare 1/mod/*+disp8 1/rm32/ecx . . . . 4/disp8 0/imm32 # compare *(ecx+4) - 75/jump-if-not-equal $test-scan-next-byte-reads-final-byte:end/disp8 + 75/jump-if-!= $test-scan-next-byte-reads-final-byte:end/disp8 # check-ints-equal(eax, 0x61/a, msg) # . . push args 68/push "F - test-scan-next-byte-reads-final-byte"/imm32 @@ -1247,7 +1247,7 @@ test-scan-next-byte-handles-Eof: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp # return if abort 81 7/subop/compare 1/mod/*+disp8 1/rm32/ecx . . . . 4/disp8 0/imm32 # compare *(ecx+4) - 75/jump-if-not-equal $test-scan-next-byte-handles-Eof:end/disp8 + 75/jump-if-!= $test-scan-next-byte-handles-Eof:end/disp8 # check-ints-equal(eax, Eof, msg) # . . push args 68/push "F - test-scan-next-byte-handles-Eof"/imm32 @@ -1373,10 +1373,10 @@ $skip-until-newline:loop: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax == Eof) break 3d/compare-eax-and 0xffffffff/imm32/Eof - 74/jump-if-equal $skip-until-newline:end/disp8 + 74/jump-if-= $skip-until-newline:end/disp8 # . if (eax != 0xa/newline) loop 3d/compare-eax-and 0xa/imm32/newline - 75/jump-if-not-equal $skip-until-newline:loop/disp8 + 75/jump-if-!= $skip-until-newline:loop/disp8 $skip-until-newline:end: # . restore registers 58/pop-to-eax diff --git a/apps/mu.subx b/apps/mu.subx index d0719713..962cc175 100644 --- a/apps/mu.subx +++ b/apps/mu.subx @@ -374,11 +374,11 @@ Entry: { # if (argc <= 1) break 81 7/subop/compare *ebp 1/imm32 - 7e/jump-if-lesser-or-equal break/disp8 + 7e/jump-if-<= break/disp8 # if (argv[1] != "test") break (kernel-string-equal? *(ebp+8) "test") # => eax 3d/compare-eax-and 0/imm32 - 74/jump-if-equal break/disp8 + 74/jump-if-= break/disp8 # (run-tests) # syscall(exit, *Num-test-failures) @@ -1025,7 +1025,7 @@ $parse-mu:line-loop: (read-line-buffered *(ebp+8) %ecx) # if (line->write == 0) break 81 7/subop/compare *ecx 0/imm32 - 0f 84/jump-if-equal break/disp32 + 0f 84/jump-if-= break/disp32 #? # dump line {{{ #? (write 2 "parse-mu: ^") #? (write-stream 2 %ecx) @@ -1036,7 +1036,7 @@ $parse-mu:line-loop: # if slice-empty?(word-slice) continue (slice-empty? %edx) 3d/compare-eax-and 0/imm32 - 0f 85/jump-if-not-equal loop/disp32 + 0f 85/jump-if-!= loop/disp32 # if (*word-slice->start == "#") continue # . eax = *word-slice->start 8b/-> *edx 0/r32/eax @@ -1044,13 +1044,13 @@ $parse-mu:line-loop: 81 4/subop/and %eax 0xff/imm32 # . if (eax == '#') continue 3d/compare-eax-and 0x23/imm32/hash - 0f 84/jump-if-equal loop/disp32 + 0f 84/jump-if-= loop/disp32 # if (slice-equal?(word-slice, "fn")) parse a function { $parse-mu:fn: (slice-equal? %edx "fn") 3d/compare-eax-and 0/imm32 - 0f 84/jump-if-equal break/disp32 + 0f 84/jump-if-= break/disp32 # var new-function/eax : (handle function) = populate-mu-function(in, new-function, vars) (allocate Heap *Function-size) # => eax (zero-out %eax *Function-size) @@ -1169,15 +1169,15 @@ populate-mu-function-header: # first-line : (addr stream byte), out : (handle f # if (word-slice == '{') abort (slice-equal? %ecx "{") # => eax 3d/compare-eax-and 0/imm32 - 0f 85/jump-if-not-equal $populate-mu-function-header:error1/disp32 + 0f 85/jump-if-!= $populate-mu-function-header:error1/disp32 # if (word-slice == '->') abort (slice-equal? %ecx "->") # => eax 3d/compare-eax-and 0/imm32 - 0f 85/jump-if-not-equal $populate-mu-function-header:error1/disp32 + 0f 85/jump-if-!= $populate-mu-function-header:error1/disp32 # if (word-slice == '}') abort (slice-equal? %ecx "}") # => eax 3d/compare-eax-and 0/imm32 - 0f 85/jump-if-not-equal $populate-mu-function-header:error1/disp32 + 0f 85/jump-if-!= $populate-mu-function-header:error1/disp32 # save function name (slice-to-string Heap %ecx) # => eax 89/<- *edi 0/r32/eax # Function-name @@ -1190,21 +1190,21 @@ $populate-mu-function-header:check-for-inout: # if (word-slice == '{') goto done (slice-equal? %ecx "{") # => eax 3d/compare-eax-and 0/imm32 - 0f 85/jump-if-not-equal $populate-mu-function-header:done/disp32 + 0f 85/jump-if-!= $populate-mu-function-header:done/disp32 # if (word-slice == '->') break (slice-equal? %ecx "->") # => eax 3d/compare-eax-and 0/imm32 - 0f 85/jump-if-not-equal break/disp32 + 0f 85/jump-if-!= break/disp32 # if (word-slice == '}') abort (slice-equal? %ecx "}") # => eax 3d/compare-eax-and 0/imm32 - 0f 85/jump-if-not-equal $populate-mu-function-header:error1/disp32 + 0f 85/jump-if-!= $populate-mu-function-header:error1/disp32 # var v/ebx : (handle var) = parse-var-with-type(word-slice, first-line) (parse-var-with-type %ecx *(ebp+8)) # => eax 89/<- %ebx 0/r32/eax # assert(v->register == null) 81 7/subop/compare *(ebx+0x10) 0/imm32 # Var-register - 0f 85/jump-if-not-equal $populate-mu-function-header:error2/disp32 + 0f 85/jump-if-!= $populate-mu-function-header:error2/disp32 # v->stack-offset = next-offset 89/<- *(ebx+0xc) 2/r32/edx # Var-stack-offset # next-offset += size-of(v) @@ -1224,21 +1224,21 @@ $parse-var-with-type:check-for-out: # if (word-slice == '{') break (slice-equal? %ecx "{") # => eax 3d/compare-eax-and 0/imm32 - 0f 85/jump-if-not-equal break/disp32 + 0f 85/jump-if-!= break/disp32 # if (word-slice == '->') abort (slice-equal? %ecx "->") # => eax 3d/compare-eax-and 0/imm32 - 0f 85/jump-if-not-equal $populate-mu-function-header:error1/disp32 + 0f 85/jump-if-!= $populate-mu-function-header:error1/disp32 # if (word-slice == '}') abort (slice-equal? %ecx "}") # => eax 3d/compare-eax-and 0/imm32 - 0f 85/jump-if-not-equal $populate-mu-function-header:error1/disp32 + 0f 85/jump-if-!= $populate-mu-function-header:error1/disp32 # (parse-var-with-type %ecx *(ebp+8)) # => eax 89/<- %ebx 0/r32/eax # assert(var->register != null) 81 7/subop/compare *(ebx+0x10) 0/imm32 # Var-register - 0f 84/jump-if-equal $populate-mu-function-header:error3/disp32 + 0f 84/jump-if-= $populate-mu-function-header:error3/disp32 (append-list Heap %ebx *(edi+0xc)) # Function-outputs => eax 89/<- *(edi+0xc) 0/r32/eax # Function-outputs e9/jump loop/disp32 @@ -1522,7 +1522,7 @@ $parse-var-with-type:save-name: 8a/copy-byte *eax 3/r32/BL 81 4/subop/and %ebx 0xff/imm32 81 7/subop/compare %ebx 0x3a/imm32/colon - 75/jump-if-not-equal break/disp8 + 75/jump-if-!= break/disp8 89/<- *(ecx+4) 0/r32/eax } # . if s ends with ',', decrement s->end @@ -1532,7 +1532,7 @@ $parse-var-with-type:save-name: 8a/copy-byte *eax 3/r32/BL 81 4/subop/and %ebx 0xff/imm32 81 7/subop/compare %ebx 0x2c/imm32/comma - 75/jump-if-not-equal break/disp8 + 75/jump-if-!= break/disp8 89/<- *(ecx+4) 0/r32/eax } $parse-var-with-type:write-name: @@ -1548,7 +1548,7 @@ $parse-var-with-type:save-register: 8a/copy-byte *eax 3/r32/BL 81 4/subop/and %ebx 0xff/imm32 81 7/subop/compare %ebx 0x3a/imm32/colon - 75/jump-if-not-equal break/disp8 + 75/jump-if-!= break/disp8 89/<- *(ecx+4) 0/r32/eax } # . if s ends with ',', decrement s->end @@ -1558,7 +1558,7 @@ $parse-var-with-type:save-register: 8a/copy-byte *eax 3/r32/BL 81 4/subop/and %ebx 0xff/imm32 81 7/subop/compare %ebx 0x2c/imm32/comma - 75/jump-if-not-equal break/disp8 + 75/jump-if-!= break/disp8 89/<- *(ecx+4) 0/r32/eax } # if (!slice-empty?(s)) v->register = slice-to-string(s) @@ -1568,7 +1568,7 @@ $parse-var-with-type:write-register: # That's probably a sign we have the wrong algorithm for this function. 8b/-> *ecx 0/r32/eax 39/compare 0/r32/eax *(ecx+4) - 76/jump-if-lesser-or-equal break/disp8 + 76/jump-if-<= break/disp8 (slice-to-string Heap %ecx) 89/<- *(edi+0x10) 0/r32/eax # Var-register } @@ -1577,33 +1577,33 @@ $parse-var-with-type:write-register: # if (word-slice == '{') abort (slice-equal? %ecx "{") # => eax 3d/compare-eax-and 0/imm32 - 0f 85/jump-if-not-equal $parse-var-with-type:abort/disp32 + 0f 85/jump-if-!= $parse-var-with-type:abort/disp32 # if (word-slice == '->') abort (slice-equal? %ecx "->") # => eax 3d/compare-eax-and 0/imm32 - 0f 85/jump-if-not-equal $parse-var-with-type:abort/disp32 + 0f 85/jump-if-!= $parse-var-with-type:abort/disp32 # if (word-slice == '}') abort (slice-equal? %ecx "}") # => eax 3d/compare-eax-and 0/imm32 - 0f 85/jump-if-not-equal $parse-var-with-type:abort/disp32 + 0f 85/jump-if-!= $parse-var-with-type:abort/disp32 # if (slice-empty?(type)) skip (slice-empty? %ecx) { 3d/compare-eax-and 0/imm32 - 0f 84/jump-if-equal break/disp32 + 0f 84/jump-if-= break/disp32 (next-mu-token *(ebp+0xc) %ecx) # if (word-slice == '{') abort (slice-equal? %ecx "{") # => eax 3d/compare-eax-and 0/imm32 - 0f 85/jump-if-not-equal $parse-var-with-type:abort/disp32 + 0f 85/jump-if-!= $parse-var-with-type:abort/disp32 # if (word-slice == '->') abort (slice-equal? %ecx "->") # => eax 3d/compare-eax-and 0/imm32 - 0f 85/jump-if-not-equal $parse-var-with-type:abort/disp32 + 0f 85/jump-if-!= $parse-var-with-type:abort/disp32 # if (word-slice == '}') abort (slice-equal? %ecx "}") # => eax 3d/compare-eax-and 0/imm32 - 0f 85/jump-if-not-equal $parse-var-with-type:abort/disp32 + 0f 85/jump-if-!= $parse-var-with-type:abort/disp32 } (type-for %ecx) # => eax 89/<- *(edi+4) 0/r32/eax # Var-type @@ -1655,7 +1655,7 @@ next-mu-token: # in: (addr stream byte), out: (addr slice) 8a/copy-byte *eax 3/r32/BL 81 4/subop/and %ebx 0xff/imm32 81 7/subop/compare %ebx 0x3a/imm32/colon - 75/jump-if-not-equal break/disp8 + 75/jump-if-!= break/disp8 89/<- *(edi+4) 0/r32/eax } # if out ends with ',', decrement out->end @@ -1665,7 +1665,7 @@ next-mu-token: # in: (addr stream byte), out: (addr slice) 8a/copy-byte *eax 3/r32/BL 81 4/subop/and %ebx 0xff/imm32 81 7/subop/compare %ebx 0x2c/imm32/comma - 75/jump-if-not-equal break/disp8 + 75/jump-if-!= break/disp8 89/<- *(edi+4) 0/r32/eax } $next-mu-token:end: @@ -1722,14 +1722,14 @@ pos-slice: # arr: (addr stream (handle array byte)), s: (addr slice) -> index/e # if (curr >= max) return -1 39/compare %edx 3/r32/ebx { - 72/jump-if-lesser-unsigned break/disp8 + 72/jump-if-addr< break/disp8 b8/copy-to-eax 1/imm32 eb/jump $pos-slice:end/disp8 } # if (slice-equal?(s, *curr)) break (slice-equal? *(ebp+0xc) *edx) # => eax 3d/compare-eax-and 0/imm32 - 75/jump-if-not-equal break/disp8 + 75/jump-if-!= break/disp8 # ++index 41/increment-ecx # curr += 4 @@ -1901,7 +1901,7 @@ is-identifier?: # in : (addr slice) -> result/eax : boolean # if (slice-empty?(in)) return false (slice-empty? *(ebp+8)) # => eax 3d/compare-eax-and 0/imm32 - 75/jump-if-not-equal $is-identifier?:false/disp8 + 75/jump-if-!= $is-identifier?:false/disp8 # var c/eax : byte = *in->start 8b/-> *(ebp+8) 0/r32/eax 8b/-> *eax 0/r32/eax @@ -1909,18 +1909,18 @@ is-identifier?: # in : (addr slice) -> result/eax : boolean 81 4/subop/and %eax 0xff/imm32 # if (c == '$') return true 3d/compare-eax-and 0x24/imm32/$ - 74/jump-if-equal $is-identifier?:true/disp8 + 74/jump-if-= $is-identifier?:true/disp8 # if (c == '_') return true 3d/compare-eax-and 0x5f/imm32/_ - 74/jump-if-equal $is-identifier?:true/disp8 + 74/jump-if-= $is-identifier?:true/disp8 # drop case 25/and-eax-with 0x5f/imm32 # if (c < 'A') return false 3d/compare-eax-and 0x41/imm32/A - 7c/jump-if-lesser $is-identifier?:false/disp8 + 7c/jump-if-< $is-identifier?:false/disp8 # if (c > 'Z') return false 3d/compare-eax-and 0x5a/imm32/Z - 7f/jump-if-greater $is-identifier?:false/disp8 + 7f/jump-if-> $is-identifier?:false/disp8 # otherwise return true $is-identifier?:true: b8/copy-to-eax 1/imm32/true @@ -2282,7 +2282,7 @@ $parse-mu-block:line-loop: #? (flush Stderr) # if (line->write == 0) break 81 7/subop/compare *ecx 0/imm32 - 0f 84/jump-if-equal break/disp32 + 0f 84/jump-if-= break/disp32 # word-slice = next-word(line) (next-word %ecx %edx) #? (write-buffered Stderr "word: ") @@ -2292,7 +2292,7 @@ $parse-mu-block:line-loop: # if slice-empty?(word-slice) continue (slice-empty? %edx) 3d/compare-eax-and 0/imm32 - 0f 85/jump-if-not-equal loop/disp32 + 0f 85/jump-if-!= loop/disp32 # if (slice-starts-with?(word-slice, '#') continue # . eax = *word-slice->start 8b/-> *edx 0/r32/eax @@ -2300,13 +2300,13 @@ $parse-mu-block:line-loop: 81 4/subop/and %eax 0xff/imm32 # . if (eax == '#') continue 3d/compare-eax-and 0x23/imm32/hash - 0f 84/jump-if-equal loop/disp32 + 0f 84/jump-if-= loop/disp32 # if slice-equal?(word-slice, "{") { $parse-mu-block:check-for-block: (slice-equal? %edx "{") 3d/compare-eax-and 0/imm32 - 74/jump-if-equal break/disp8 + 74/jump-if-= break/disp8 (check-no-tokens-left %ecx) # parse new block and append (parse-mu-block *(ebp+8) *(ebp+0xc) *(ebp+0x10)) # => eax @@ -2317,7 +2317,7 @@ $parse-mu-block:check-for-block: $parse-mu-block:check-for-end: (slice-equal? %edx "}") 3d/compare-eax-and 0/imm32 - 0f 85/jump-if-not-equal break/disp32 + 0f 85/jump-if-!= break/disp32 # if slice-ends-with?(word-slice, ":") parse named block and append { $parse-mu-block:check-for-named-block: @@ -2327,7 +2327,7 @@ $parse-mu-block:check-for-named-block: 81 4/subop/and %eax 0xff/imm32 # . if (eax != ':') break 3d/compare-eax-and 0x23/imm32/hash - 0f 85/jump-if-not-equal break/disp32 + 0f 85/jump-if-!= break/disp32 # (parse-mu-named-block %edx %ecx *(ebp+8) *(ebp+0xc) *(ebp+0x10)) # => eax (append-to-block %edi %eax) @@ -2338,7 +2338,7 @@ $parse-mu-block:check-for-named-block: $parse-mu-block:check-for-var: (slice-equal? %edx "var") 3d/compare-eax-and 0/imm32 - 74/jump-if-equal break/disp8 + 74/jump-if-= break/disp8 # (parse-mu-var-def %ecx *(ebp+0xc)) # => eax (append-to-block %edi %eax) @@ -2394,7 +2394,7 @@ check-no-tokens-left: # line : (addr stream byte) # if slice-empty?(s) return (slice-empty? %ecx) 3d/compare-eax-and 0/imm32 - 75/jump-if-not-equal $check-no-tokens-left:end/disp8 + 75/jump-if-!= $check-no-tokens-left:end/disp8 # if (slice-starts-with?(s, '#') return # . eax = *s->start 8b/-> *edx 0/r32/eax @@ -2402,7 +2402,7 @@ check-no-tokens-left: # line : (addr stream byte) 81 4/subop/and %eax 0xff/imm32 # . if (eax == '#') continue 3d/compare-eax-and 0x23/imm32/hash - 74/jump-if-equal $check-no-tokens-left:end/disp8 + 74/jump-if-= $check-no-tokens-left:end/disp8 # abort (write-buffered Stderr "'{' or '}' should be on its own line, but got '") (rewind-stream %ecx) @@ -2520,7 +2520,7 @@ parse-mu-stmt: # line : (addr stream byte), vars : (addr stack (handle var)), f { (stmt-has-outputs? *(ebp+8)) 3d/compare-eax-and 0/imm32 - 0f 84/jump-if-equal break/disp32 + 0f 84/jump-if-= break/disp32 { $parse-mu-stmt:read-outputs: # name = next-word(line) @@ -2528,15 +2528,15 @@ $parse-mu-stmt:read-outputs: # if slice-empty?(word-slice) break (slice-empty? %ecx) 3d/compare-eax-and 0/imm32 - 0f 85/jump-if-not-equal break/disp32 + 0f 85/jump-if-!= break/disp32 # if (name == "<-") break (slice-equal? %ecx "<-") 3d/compare-eax-and 0/imm32 - 75/jump-if-not-equal break/disp8 + 75/jump-if-!= break/disp8 # assert(is-identifier?(name)) (is-identifier? %ecx) 3d/compare-eax-and 0/imm32 - 0f 84/jump-if-equal $parse-mu-stmt:abort/disp32 + 0f 84/jump-if-= $parse-mu-stmt:abort/disp32 # (lookup-or-define-var %ecx *(ebp+0xc) *(ebp+0x10)) # => eax (append-list Heap %eax *(edi+0xc)) # Stmt1-outputs => eax @@ -2555,11 +2555,11 @@ $parse-mu-stmt:read-inouts: # if slice-empty?(word-slice) break (slice-empty? %ecx) 3d/compare-eax-and 0/imm32 - 0f 85/jump-if-not-equal break/disp32 + 0f 85/jump-if-!= break/disp32 # if (name == "<-") abort (slice-equal? %ecx "<-") 3d/compare-eax-and 0/imm32 - 0f 85/jump-if-not-equal $parse-mu-stmt:abort2/disp32 + 0f 85/jump-if-!= $parse-mu-stmt:abort2/disp32 # (lookup-var-or-literal %ecx *(ebp+0xc)) # => eax (append-list Heap %eax *(edi+8)) # Stmt1-inouts => eax @@ -2623,7 +2623,7 @@ stmt-has-outputs?: # line : (addr stream byte) -> result/eax : boolean (slice-empty? %ecx) 3d/compare-eax-and 0/imm32 b8/copy-to-eax 0/imm32/false/result # restore result (if we're here it's still false) - 0f 85/jump-if-not-equal break/disp32 + 0f 85/jump-if-!= break/disp32 # if slice-starts-with?(word-slice, '#') break # . eax = *word-slice->start 8b/-> *ecx 0/r32/eax @@ -2632,11 +2632,11 @@ stmt-has-outputs?: # line : (addr stream byte) -> result/eax : boolean # . if (eax == '#') break 3d/compare-eax-and 0x23/imm32/hash b8/copy-to-eax 0/imm32/false/result # restore result (if we're here it's still false) - 0f 84/jump-if-equal break/disp32 + 0f 84/jump-if-= break/disp32 # if slice-equal?(word-slice, '<-') return true (slice-equal? %ecx "<-") 3d/compare-eax-and 0/imm32 - 74/jump-if-equal loop/disp8 + 74/jump-if-= loop/disp8 b8/copy-to-eax 1/imm32/true } $stmt-has-outputs:end: @@ -2664,7 +2664,7 @@ lookup-var-or-literal: # name: (addr slice), vars : (addr stack (handle var)) - # if slice-empty?(name) abort (slice-empty? %esi) # => eax 3d/compare-eax-and 0/imm32 - 0f 85/jump-if-not-equal $lookup-var-or-literal:abort/disp32 + 0f 85/jump-if-!= $lookup-var-or-literal:abort/disp32 # var ecx : byte = *name->start 8b/-> *esi 1/r32/ecx 8a/copy-byte *ecx 1/r32/CL @@ -2673,12 +2673,12 @@ lookup-var-or-literal: # name: (addr slice), vars : (addr stack (handle var)) - (is-decimal-digit? %ecx) # => eax 81 7/subop/compare %eax 0/imm32 { - 74/jump-if-equal break/disp8 + 74/jump-if-= break/disp8 (new-literal-integer Heap %esi) # => eax } # otherwise return lookup-var(name, vars) { - 75/jump-if-not-equal break/disp8 + 75/jump-if-!= break/disp8 (lookup-var %esi *(ebp+0xc)) # => eax } $lookup-var-or-literal:end: @@ -2710,7 +2710,7 @@ lookup-var: # name: (addr slice), vars : (addr stack (handle var)) -> result/ea (lookup-var-helper %eax *(ebp+0xc)) # => eax # if (result == 0) abort 3d/compare-eax-and 0/imm32 - 74/jump-if-equal $lookup-var:abort/disp8 + 74/jump-if-= $lookup-var:abort/disp8 $lookup-var:end: # . epilogue 89/<- %esp 5/r32/ebp @@ -2752,7 +2752,7 @@ lookup-var-helper: # name: (addr array byte), vars : (addr stack (handle var)) 8b/-> *esi 3/r32/ebx # if (vars->top > vars->length) abort 3b/compare 0/r32/eax *(esi+4) - 0f 8f/jump-if-greater $lookup-var-helper:error1/disp32 + 0f 8f/jump-if-> $lookup-var-helper:error1/disp32 # var min/edx : (addr handle var) = vars->data 8d/copy-address *(esi+8) 2/r32/edx # var curr/ebx : (addr handle var) = &vars->data[vars->top - 4] @@ -2762,14 +2762,14 @@ lookup-var-helper: # name: (addr array byte), vars : (addr stack (handle var)) # if (curr < min) return 0 39/compare %ebx 2/r32/edx b8/copy-to-eax 0/imm32 - 0f 82/jump-if-lesser-unsigned break/disp32 + 0f 82/jump-if-addr< break/disp32 # var v/eax : (handle var) = *curr 8b/-> *ebx 0/r32/eax # if (v->name == name) return v (string-equal? *eax *(ebp+8)) # Var-name 3d/compare-eax-and 0/imm32 8b/-> *ebx 0/r32/eax - 75/jump-if-not-equal break/disp8 + 75/jump-if-!= break/disp8 # curr -= 4 81 5/subop/subtract %ebx 4/imm32 e9/jump loop/disp32 @@ -2810,13 +2810,13 @@ lookup-or-define-var: # name: (addr slice), vars : (addr stack (handle var)), f { # if (result != 0) return 3d/compare-eax-and 0/imm32 - 75/jump-if-not-equal break/disp8 + 75/jump-if-!= break/disp8 # if name is one of fn's outputs, return it { (find-in-function-outputs *(ebp+0x10) %ecx) # => eax 3d/compare-eax-and 0/imm32 # otherwise abort - 0f 84/jump-if-not-equal $lookup-var:abort/disp32 + 0f 84/jump-if-!= $lookup-var:abort/disp32 } } $lookup-or-define-var:end: @@ -2839,7 +2839,7 @@ find-in-function-outputs: # fn : (handle function), name : (handle array byte) # while curr != null { 81 7/subop/compare %ecx 0/imm32 - 74/jump-if-equal break/disp8 + 74/jump-if-= break/disp8 # var v : (handle var) = *curr 8b/-> *ecx 0/r32/eax # List-value # if (curr->name == name) return curr @@ -2847,7 +2847,7 @@ find-in-function-outputs: # fn : (handle function), name : (handle array byte) (string-equal? *eax *(ebp+0xc)) 3d/compare-eax-and 0/imm32 58/pop-to-eax - 75/jump-if-not-equal $find-in-function-outputs:end/disp8 + 75/jump-if-!= $find-in-function-outputs:end/disp8 # curr = curr->next 8b/-> *(ecx+4) 1/r32/ecx # List-next eb/jump loop/disp8 @@ -2960,7 +2960,7 @@ new-literal-integer: # ad: (addr allocation-descriptor), name: (addr slice) -> # if (!is-hex-int?(name)) abort (is-hex-int? *(ebp+0xc)) # => eax 3d/compare-eax-and 0/imm32 - 0f 84/jump-if-equal $new-literal-integer:abort/disp32 + 0f 84/jump-if-= $new-literal-integer:abort/disp32 # var s/ecx : (addr array byte) (slice-to-string Heap *(ebp+0xc)) # => eax 89/<- %ecx 0/r32/eax @@ -3137,14 +3137,14 @@ append-list: # ad: (addr allocation-descriptor), value: _type, list: (handle li 89/<- *eax 1/r32/ecx # List-value # if (list == null) return result 81 7/subop/compare *(ebp+0x10) 0/imm32 - 74/jump-if-equal $new-list:end/disp8 + 74/jump-if-= $new-list:end/disp8 # otherwise append # var curr/ecx = list 8b/-> *(ebp+0x10) 1/r32/ecx # while (curr->next != null) curr = curr->next { 81 7/subop/compare *(ecx+4) 0/imm32 # List-next - 74/jump-if-equal break/disp8 + 74/jump-if-= break/disp8 # curr = curr->next 8b/-> *(ecx+4) 1/r32/ecx eb/jump loop/disp8 @@ -3225,7 +3225,7 @@ emit-subx: # out : (addr buffered-file) { # if (curr == null) break 81 7/subop/compare %ecx 0/imm32 - 0f 84/jump-if-equal break/disp32 + 0f 84/jump-if-= break/disp32 (emit-subx-function %edi %ecx) # curr = curr->next 8b/-> *(ecx+0x14) 1/r32/ecx # Function-next @@ -3280,12 +3280,12 @@ emit-subx-block: # out : (addr buffered-file), block : (handle block) { $emit-subx-block:check-empty: 81 7/subop/compare %esi 0/imm32 - 0f 84/jump-if-equal break/disp32 + 0f 84/jump-if-= break/disp32 (write-buffered *(ebp+8) "{\n") { $emit-subx-block:stmt: 81 7/subop/compare %esi 0/imm32 - 74/jump-if-equal break/disp8 + 74/jump-if-= break/disp8 (emit-subx-statement *(ebp+8) *esi Primitives *Program) (write-buffered *(ebp+8) Newline) 8b/-> *(esi+4) 6/r32/esi # List-next @@ -3311,7 +3311,7 @@ emit-subx-statement: # out : (addr buffered-file), stmt : (handle statement), p $emit-subx-statement:primitive: (find-matching-primitive *(ebp+0x10) *(ebp+0xc)) # primitives, stmt => curr/eax 3d/compare-eax-and 0/imm32 - 74/jump-if-equal break/disp8 + 74/jump-if-= break/disp8 (emit-subx-primitive *(ebp+8) *(ebp+0xc) %eax) # out, stmt, curr e9/jump $emit-subx-statement:end/disp32 } @@ -3320,7 +3320,7 @@ $emit-subx-statement:primitive: $emit-subx-statement:call: (find-matching-function *(ebp+0x14) *(ebp+0xc)) # functions, stmt => curr/eax 3d/compare-eax-and 0/imm32 - 74/jump-if-equal break/disp8 + 74/jump-if-= break/disp8 (emit-subx-call *(ebp+8) *(ebp+0xc) %eax) # out, stmt, curr e9/jump $emit-subx-statement:end/disp32 } @@ -4136,7 +4136,7 @@ emit-subx-rm32: # out : (addr buffered-file), l : arg-location, stmt : (handle 50/push-eax # if (l == 0) return 81 7/subop/compare *(ebp+0xc) 0/imm32 - 74/jump-if-equal $emit-subx-rm32:end/disp8 + 74/jump-if-= $emit-subx-rm32:end/disp8 # (get-stmt-operand-from-arg-location *(ebp+0x10) *(ebp+0xc)) # stmt, l => var/eax (emit-subx-var-as-rm32 *(ebp+8) %eax) # out, var @@ -4161,7 +4161,7 @@ get-stmt-operand-from-arg-location: # stmt : (handle statement), l : arg-locati # if (l == 1) return stmt->inouts->var { 3d/compare-eax-and 1/imm32 - 75/jump-if-not-equal break/disp8 + 75/jump-if-!= break/disp8 $get-stmt-operand-from-arg-location:1: 8b/-> *(ecx+8) 0/r32/eax # Stmt1-inouts 8b/-> *eax 0/r32/eax # Operand-var @@ -4170,7 +4170,7 @@ $get-stmt-operand-from-arg-location:1: # if (l == 2) return stmt->inouts->next->var { 3d/compare-eax-and 2/imm32 - 75/jump-if-not-equal break/disp8 + 75/jump-if-!= break/disp8 $get-stmt-operand-from-arg-location:2: 8b/-> *(ecx+8) 0/r32/eax # Stmt1-inouts 8b/-> *(eax+4) 0/r32/eax # Operand-next @@ -4180,7 +4180,7 @@ $get-stmt-operand-from-arg-location:2: # if (l == 3) return stmt->outputs { 3d/compare-eax-and 3/imm32 - 75/jump-if-not-equal break/disp8 + 75/jump-if-!= break/disp8 $get-stmt-operand-from-arg-location:3: 8b/-> *(ecx+0xc) 0/r32/eax # Stmt1-outputs 8b/-> *eax 0/r32/eax # Operand-var @@ -4217,7 +4217,7 @@ emit-subx-r32: # out : (addr buffered-file), l : arg-location, stmt : (handle s 51/push-ecx # if (location == 0) return 81 7/subop/compare *(ebp+0xc) 0/imm32 - 0f 84/jump-if-equal $emit-subx-r32:end/disp32 + 0f 84/jump-if-= $emit-subx-r32:end/disp32 # (get-stmt-operand-from-arg-location *(ebp+0x10) *(ebp+0xc)) # stmt, l => var/eax (maybe-get Registers *(eax+0x10) 8) # Var-register => eax : (addr register-index) @@ -4242,7 +4242,7 @@ emit-subx-imm32: # out : (addr buffered-file), l : arg-location, stmt : (handle 51/push-ecx # if (location == 0) return 81 7/subop/compare *(ebp+0xc) 0/imm32 - 74/jump-if-equal $emit-subx-imm32:end/disp8 + 74/jump-if-= $emit-subx-imm32:end/disp8 # (get-stmt-operand-from-arg-location *(ebp+0x10) *(ebp+0xc)) # stmt, l => var/eax (write-buffered *(ebp+8) Space) @@ -4276,7 +4276,7 @@ emit-subx-call: # out : (addr buffered-file), stmt : (handle statement), callee { # if (curr == null) break 81 7/subop/compare %ecx 0/imm32 - 74/jump-if-equal break/disp8 + 74/jump-if-= break/disp8 # (emit-subx-call-operand *(ebp+8) *ecx) # curr = curr->next @@ -4305,7 +4305,7 @@ emit-subx-call-operand: # out : (addr buffered-file), operand : (handle variabl # if (operand->register) emit "%__" { 81 7/subop/compare *(eax+0x10) 0/imm32 # Var-register - 74/jump-if-equal break/disp8 + 74/jump-if-= break/disp8 $emit-subx-call-operand:register: (write-buffered *(ebp+8) " %") (write-buffered *(ebp+8) *(eax+0x10)) # Var-register @@ -4314,7 +4314,7 @@ $emit-subx-call-operand:register: # else if (operand->stack-offset) emit "*(ebp+__)" { 81 7/subop/compare *(eax+0xc) 0/imm32 # Var-stack-offset - 74/jump-if-equal break/disp8 + 74/jump-if-= break/disp8 $emit-subx-call-operand:stack: (write-buffered *(ebp+8) Space) (write-buffered *(ebp+8) "*(ebp+") @@ -4329,7 +4329,7 @@ $emit-subx-call-operand:stack: 8b/-> *(eax+4) 0/r32/eax # Var-type 81 7/subop/compare *eax 0/imm32 # Tree-left 58/pop-to-eax - 75/jump-if-not-equal break/disp8 + 75/jump-if-!= break/disp8 $emit-subx-call-operand:literal: (write-buffered *(ebp+8) Space) (write-buffered *(ebp+8) *eax) @@ -4353,7 +4353,7 @@ emit-subx-var-as-rm32: # out : (addr buffered-file), operand : (handle variable # if (operand->register) emit "%__" { 81 7/subop/compare *(eax+0x10) 0/imm32 # Var-register - 74/jump-if-equal break/disp8 + 74/jump-if-= break/disp8 $emit-subx-var-as-rm32:register: (write-buffered *(ebp+8) " %") (write-buffered *(ebp+8) *(eax+0x10)) # Var-register @@ -4361,7 +4361,7 @@ $emit-subx-var-as-rm32:register: # else if (operand->stack-offset) emit "*(ebp+__)" { 81 7/subop/compare *(eax+0xc) 0/imm32 # Var-stack-offset - 74/jump-if-equal break/disp8 + 74/jump-if-= break/disp8 $emit-subx-var-as-rm32:stack: (write-buffered *(ebp+8) Space) (write-buffered *(ebp+8) "*(ebp+") @@ -4388,12 +4388,12 @@ find-matching-function: # functions : (addr function), stmt : (handle statement { # if (curr == null) break 81 7/subop/compare %ecx 0/imm32 - 74/jump-if-equal break/disp8 + 74/jump-if-= break/disp8 # if match(stmt, curr) return curr { (mu-stmt-matches-function? *(ebp+0xc) %ecx) # => eax 3d/compare-eax-and 0/imm32 - 74/jump-if-equal break/disp8 + 74/jump-if-= break/disp8 89/<- %eax 1/r32/ecx eb/jump $find-matching-function:end/disp8 } @@ -4423,7 +4423,7 @@ find-matching-primitive: # primitives : (handle primitive), stmt : (handle stat $find-matching-primitive:loop: # if (curr == null) break 81 7/subop/compare %ecx 0/imm32 - 0f 84/jump-if-equal break/disp32 + 0f 84/jump-if-= break/disp32 #? (write-buffered Stderr "prim: ") #? (write-buffered Stderr *ecx) # Primitive-name #? (write-buffered Stderr " => ") @@ -4434,7 +4434,7 @@ $find-matching-primitive:loop: { (mu-stmt-matches-primitive? *(ebp+0xc) %ecx) # => eax 3d/compare-eax-and 0/imm32 - 74/jump-if-equal break/disp8 + 74/jump-if-= break/disp8 89/<- %eax 1/r32/ecx eb/jump $find-matching-primitive:end/disp8 } @@ -4495,7 +4495,7 @@ $mu-stmt-matches-primitive?:check-name: # if (primitive->name != stmt->operation) return false (string-equal? *(ecx+4) *edx) # Stmt1-operation, Primitive-name => eax 3d/compare-eax-and 0/imm32 - 75/jump-if-not-equal break/disp8 + 75/jump-if-!= break/disp8 b8/copy-to-eax 0/imm32 e9/jump $mu-stmt-matches-primitive?:end/disp32 } @@ -4507,11 +4507,11 @@ $mu-stmt-matches-primitive?:check-inouts: # if (curr == 0 && curr2 == 0) move on to check outputs { 81 7/subop/compare %esi 0/imm32 - 75/jump-if-not-equal break/disp8 + 75/jump-if-!= break/disp8 $mu-stmt-matches-primitive?:stmt-inout-is-null: { 81 7/subop/compare %edi 0/imm32 - 75/jump-if-not-equal break/disp8 + 75/jump-if-!= break/disp8 # e9/jump $mu-stmt-matches-primitive?:check-outputs/disp32 } @@ -4522,7 +4522,7 @@ $mu-stmt-matches-primitive?:stmt-inout-is-null: # if (curr2 == 0) return false { 81 7/subop/compare %edi 0/imm32 - 75/jump-if-not-equal break/disp8 + 75/jump-if-!= break/disp8 $mu-stmt-matches-primitive?:prim-inout-is-null: b8/copy-to-eax 0/imm32/false e9/jump $mu-stmt-matches-primitive?:end/disp32 @@ -4531,7 +4531,7 @@ $mu-stmt-matches-primitive?:prim-inout-is-null: { (operand-matches-primitive? *esi *edi) # => eax 3d/compare-eax-and 0/imm32 - 75/jump-if-not-equal break/disp8 + 75/jump-if-!= break/disp8 b8/copy-to-eax 0/imm32/false e9/jump $mu-stmt-matches-primitive?:end/disp32 } @@ -4550,10 +4550,10 @@ $mu-stmt-matches-primitive?:check-outputs: { $mu-stmt-matches-primitive?:check-output: 81 7/subop/compare %esi 0/imm32 - 75/jump-if-not-equal break/disp8 + 75/jump-if-!= break/disp8 { 81 7/subop/compare %edi 0/imm32 - 75/jump-if-not-equal break/disp8 + 75/jump-if-!= break/disp8 # return true b8/copy-to-eax 1/imm32 e9/jump $mu-stmt-matches-primitive?:end/disp32 @@ -4565,7 +4565,7 @@ $mu-stmt-matches-primitive?:check-output: # if (curr2 == 0) return false { 81 7/subop/compare %edi 0/imm32 - 75/jump-if-not-equal break/disp8 + 75/jump-if-!= break/disp8 b8/copy-to-eax 0/imm32 e9/jump $mu-stmt-matches-primitive?:end/disp32 } @@ -4573,7 +4573,7 @@ $mu-stmt-matches-primitive?:check-output: { (operand-matches-primitive? *esi *edi) # List-value List-value => eax 3d/compare-eax-and 0/imm32 - 75/jump-if-not-equal break/disp8 + 75/jump-if-!= break/disp8 b8/copy-to-eax 0/imm32 e9/jump $mu-stmt-matches-primitive?:end/disp32 } @@ -4612,28 +4612,28 @@ operand-matches-primitive?: # var : (handle var), prim-var : (handle var) => re (type-equal? *(esi+4) *(edi+4)) # Var-type, Var-type => eax 3d/compare-eax-and 0/imm32 b8/copy-to-eax 0/imm32/false - 74/jump-if-equal $operand-matches-primitive?:end/disp8 + 74/jump-if-= $operand-matches-primitive?:end/disp8 # return false if var->register doesn't match prim-var->register { # if addresses are equal, don't return here 8b/-> *(esi+0x10) 0/r32/eax 39/compare *(edi+0x10) 0/r32/eax - 74/jump-if-equal break/disp8 + 74/jump-if-= break/disp8 # if either address is 0, return false 3d/compare-eax-and 0/imm32 - 74/jump-if-equal $operand-matches-primitive?:end/disp8 # eax goes from meaning var->register to result + 74/jump-if-= $operand-matches-primitive?:end/disp8 # eax goes from meaning var->register to result 81 7/subop/compare *(edi+0x10) 0/imm32 - 74/jump-if-equal $operand-matches-primitive?:end/disp8 # eax goes from meaning var->register to result + 74/jump-if-= $operand-matches-primitive?:end/disp8 # eax goes from meaning var->register to result # if prim-var->register is "*", return true (string-equal? *(edi+0x10) "*") # Var-register 3d/compare-eax-and 0/imm32 b8/copy-to-eax 1/imm32/true - 75/jump-if-not-equal $operand-matches-primitive?:end/disp8 + 75/jump-if-!= $operand-matches-primitive?:end/disp8 # if string contents don't match, return false (string-equal? *(esi+0x10) *(edi+0x10)) # Var-register Var-register 3d/compare-eax-and 0/imm32 b8/copy-to-eax 0/imm32/false - 74/jump-if-equal $operand-matches-primitive?:end/disp8 + 74/jump-if-= $operand-matches-primitive?:end/disp8 } # return true b8/copy-to-eax 1/imm32/true @@ -4661,19 +4661,19 @@ type-equal?: # a : (handle tree type-id), b : (handle tree type-id) => result/e 8b/-> %ecx 0/r32/eax # Var-type 39/compare %edx 0/r32/eax # Var-type b8/copy-to-eax 1/imm32/true - 0f 84/jump-if-equal $type-equal?:end/disp32 + 0f 84/jump-if-= $type-equal?:end/disp32 # if (a == 0) return false 81 7/subop/compare %ecx 0/imm32 b8/copy-to-eax 0/imm32/false - 0f 84/jump-if-equal $type-equal?:end/disp32 + 0f 84/jump-if-= $type-equal?:end/disp32 # if (b == 0) return false 81 7/subop/compare %edx 0/imm32 b8/copy-to-eax 0/imm32/false - 0f 84/jump-if-equal $type-equal?:end/disp32 + 0f 84/jump-if-= $type-equal?:end/disp32 # if (!type-equal?(a->left, b->left)) return false (type-equal? *ecx *edx) # Tree-left, Tree-left => eax 3d/compare-eax-and 0/imm32 - 0f 84/jump-if-equal $type-equal?:end/disp32 + 0f 84/jump-if-= $type-equal?:end/disp32 # return type-equal?(a->right, b->right (type-equal? *(ecx+4) *(edx+4)) # Tree-right, Tree-right => eax $type-equal?:end: diff --git a/apps/mulisp.subx b/apps/mulisp.subx index 87479ffe..a2fd5ebe 100644 --- a/apps/mulisp.subx +++ b/apps/mulisp.subx @@ -18,11 +18,11 @@ Entry: # run tests if necessary, a REPL if not { # if (argc <= 1) break 81 7/subop/compare *ebp 1/imm32 - 7e/jump-if-lesser-or-equal break/disp8 + 7e/jump-if-<= break/disp8 # if (argv[1] != "test")) break (kernel-string-equal? *(ebp+8) "test") # => eax 3d/compare-eax-and 0/imm32 - 74/jump-if-equal break/disp8 + 74/jump-if-= break/disp8 # (run-tests) # syscall(exit, *Num-test-failures) @@ -84,7 +84,7 @@ repl: # in : (addr buffered-file), out : (addr buffered-file) (lisp-read Stdin) # => eax : (handle cell) # if (eax == 0) break 3d/compare-eax-and 0/imm32 - 74/jump-if-equal break/disp8 + 74/jump-if-= break/disp8 # (lisp-eval %eax) # => eax : (handle cell) (lisp-print Stdout %eax) @@ -123,7 +123,7 @@ lisp-read: # in : (addr buffered-file) -> eax : (handle cell) # if (s->write == 0) return null { 81 7/subop/compare *ecx 0/imm32 - 75/jump-if-not-equal break/disp8 + 75/jump-if-!= break/disp8 b8/copy-to-eax 0/imm32/eof eb/jump $lisp-read:end/disp8 } diff --git a/apps/pack.subx b/apps/pack.subx index 68be16aa..8719996b 100644 --- a/apps/pack.subx +++ b/apps/pack.subx @@ -35,7 +35,7 @@ Entry: # run tests if necessary, convert stdin if not # - if argc > 1 and argv[1] == "test", then return run_tests() # if (argc <= 1) goto interactive 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 0/disp8 1/imm32 # compare *ebp - 7e/jump-if-lesser-or-equal $subx-pack-main:interactive/disp8 + 7e/jump-if-<= $subx-pack-main:interactive/disp8 # if (!kernel-string-equal?(argv[1], "test")) goto interactive # . eax = kernel-string-equal?(argv[1], "test") # . . push args @@ -47,7 +47,7 @@ Entry: # run tests if necessary, convert stdin if not 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax == false) goto interactive 3d/compare-eax-and 0/imm32/false - 74/jump-if-equal $subx-pack-main:interactive/disp8 + 74/jump-if-= $subx-pack-main:interactive/disp8 # run-tests() e8/call run-tests/disp32 # syscall(exit, *Num-test-failures) @@ -159,7 +159,7 @@ $subx-pack:loop: $subx-pack:check0: # if (line->write == 0) break 81 7/subop/compare 0/mod/indirect 1/rm32/ecx . . . . . 0/imm32 # compare *ecx - 0f 84/jump-if-equal $subx-pack:break/disp32 + 0f 84/jump-if-= $subx-pack:break/disp32 #? # dump line {{{ #? # . write(2/stderr, "LL: ") #? # . . push args @@ -205,7 +205,7 @@ $subx-pack:check1: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax != false) write-stream-data(out, line) 3d/compare-eax-and 0/imm32/false - 0f 85/jump-if-not-equal $subx-pack:pass-through/disp32 + 0f 85/jump-if-!= $subx-pack:pass-through/disp32 $subx-pack:check2: #? # dump word-slice {{{ #? # . write(2/stderr, "AA: ") @@ -258,7 +258,7 @@ $subx-pack:check2: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax == false) goto check3 3d/compare-eax-and 0/imm32/false - 0f 84/jump-if-equal $subx-pack:check3/disp32 + 0f 84/jump-if-= $subx-pack:check3/disp32 # word-slice = next-word(line) # . . push args 52/push-edx @@ -330,7 +330,7 @@ $subx-pack:check3: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # if (in-code? != false) convert-instruction(line, out) 81 7/subop/compare 3/mod/direct 3/rm32/ebx . . . . . 0/imm32/false # compare ebx - 74/jump-if-equal $subx-pack:data/disp8 + 74/jump-if-= $subx-pack:data/disp8 $subx-pack:code: # . convert-instruction(line, out) # . . push args @@ -1026,7 +1026,7 @@ $convert-data:check0: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax != false) break 3d/compare-eax-and 0/imm32/false - 0f 85/jump-if-not-equal $convert-data:break/disp32 + 0f 85/jump-if-!= $convert-data:break/disp32 $convert-data:check-for-comment: # if (slice-starts-with?(word-slice, "#")) # . var start/edx : (addr byte) = word-slice->start @@ -1036,7 +1036,7 @@ $convert-data:check-for-comment: 8a/copy-byte 0/mod/indirect 2/rm32/edx . . . 0/r32/AL . . # copy byte at *edx to AL # . if (c != '#') goto next check 3d/compare-eax-and 0x23/imm32/hash - 75/jump-if-not-equal $convert-data:check-for-label/disp8 + 75/jump-if-!= $convert-data:check-for-label/disp8 $convert-data:comment: # write-slice-buffered(out, word-slice) # . . push args @@ -1047,7 +1047,7 @@ $convert-data:comment: # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # return - 0f 85/jump-if-not-equal $convert-data:end/disp32 + 0f 85/jump-if-!= $convert-data:end/disp32 $convert-data:check-for-label: # if (slice-ends-with?(word-slice, ":")) # . var end/edx : (addr byte) = word-slice->end @@ -1057,7 +1057,7 @@ $convert-data:check-for-label: 8a/copy-byte 1/mod/*+disp8 2/rm32/edx . . . 0/r32/AL -1/disp8 . # copy byte at *ecx to AL # . if (c != ':') goto next check 3d/compare-eax-and 0x3a/imm32/colon - 75/jump-if-not-equal $convert-data:check-for-imm32/disp8 + 75/jump-if-!= $convert-data:check-for-imm32/disp8 $convert-data:label: # write-stream-data(out, line) # . . push args @@ -1068,7 +1068,7 @@ $convert-data:label: # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # return - 75/jump-if-not-equal $convert-data:end/disp8 + 75/jump-if-!= $convert-data:end/disp8 $convert-data:check-for-imm32: # if (has-metadata?(word-slice, "imm32")) # . eax = has-metadata?(ecx, "imm32") @@ -1081,7 +1081,7 @@ $convert-data:check-for-imm32: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax == false) process as a single byte 3d/compare-eax-and 0/imm32/false - 74/jump-if-equal $convert-data:single-byte/disp8 + 74/jump-if-= $convert-data:single-byte/disp8 $convert-data:imm32: # emit(out, word-slice, 4) # . . push args @@ -1860,7 +1860,7 @@ $convert-instruction:check0: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax != false) pass through 3d/compare-eax-and 0/imm32/false - 75/jump-if-not-equal $convert-instruction:pass-through/disp8 + 75/jump-if-!= $convert-instruction:pass-through/disp8 $convert-instruction:check1: # if (slice-starts-with?(word-slice, "#")) write-stream-data(out, line) # . var start/edx : (addr byte) = word-slice->start @@ -1870,7 +1870,7 @@ $convert-instruction:check1: 8a/copy-byte 0/mod/indirect 2/rm32/edx . . . 0/r32/AL . . # copy byte at *edx to AL # . if (c == '#') pass through 3d/compare-eax-and 0x23/imm32/hash - 74/jump-if-equal $convert-instruction:pass-through/disp8 + 74/jump-if-= $convert-instruction:pass-through/disp8 $convert-instruction:check2: # if (slice-ends-with?(word-slice, ":")) write-stream-data(out, line) # . var end/edx : (addr byte) = word-slice->end @@ -1880,7 +1880,7 @@ $convert-instruction:check2: 8a/copy-byte 1/mod/*+disp8 2/rm32/edx . . . 0/r32/AL -1/disp8 . # copy byte at *ecx to AL # . if (c == ':') pass through 3d/compare-eax-and 0x3a/imm32/colon - 75/jump-if-not-equal $convert-instruction:really-convert/disp8 + 75/jump-if-!= $convert-instruction:really-convert/disp8 $convert-instruction:pass-through: # write-stream-data(out, line) # . . push args @@ -2028,7 +2028,7 @@ $emit-opcodes:op1: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax != false) return 3d/compare-eax-and 0/imm32/false - 0f 85/jump-if-not-equal $emit-opcodes:end/disp32 + 0f 85/jump-if-!= $emit-opcodes:end/disp32 # if (slice-starts-with?(op1, "#")) return # . var start/ebx : (addr byte) = op1->start 8b/copy 0/mod/indirect 1/rm32/ecx . . . 3/r32/ebx . . # copy *ecx to ebx @@ -2037,7 +2037,7 @@ $emit-opcodes:op1: 8a/copy-byte 0/mod/indirect 3/rm32/ebx . . . 0/r32/AL . . # copy byte at *ebx to AL # . if (c == '#') return 3d/compare-eax-and 0x23/imm32/hash - 0f 84/jump-if-equal $emit-opcodes:end/disp32 + 0f 84/jump-if-= $emit-opcodes:end/disp32 # op1 = next-token-from-slice(op1->start, op1->end, '/') # . . push args 51/push-ecx @@ -2075,7 +2075,7 @@ $emit-opcodes:op1: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax != false) goto op2 3d/compare-eax-and 0/imm32/false - 75/jump-if-not-equal $emit-opcodes:op2/disp8 + 75/jump-if-!= $emit-opcodes:op2/disp8 # if (slice-equal?(op1, "f2")) goto op2 # . eax = slice-equal?(op1, "f2") # . . push args @@ -2087,7 +2087,7 @@ $emit-opcodes:op1: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax != false) goto op2 3d/compare-eax-and 0/imm32/false - 75/jump-if-not-equal $emit-opcodes:op2/disp8 + 75/jump-if-!= $emit-opcodes:op2/disp8 # if (slice-equal?(op1, "f3")) goto op2 # . eax = slice-equal?(op1, "f3") # . . push args @@ -2099,7 +2099,7 @@ $emit-opcodes:op1: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax != false) goto op2 3d/compare-eax-and 0/imm32/false - 75/jump-if-not-equal $emit-opcodes:op2/disp8 + 75/jump-if-!= $emit-opcodes:op2/disp8 # otherwise return e9/jump $emit-opcodes:end/disp32 $emit-opcodes:op2: @@ -2121,7 +2121,7 @@ $emit-opcodes:op2: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax != false) return 3d/compare-eax-and 0/imm32/false - 0f 85/jump-if-not-equal $emit-opcodes:end/disp32 + 0f 85/jump-if-!= $emit-opcodes:end/disp32 # if (slice-starts-with?(op2, "#")) return # . var start/ebx : (addr byte) = op2->start 8b/copy 0/mod/indirect 2/rm32/edx . . . 3/r32/ebx . . # copy *edx to ebx @@ -2130,7 +2130,7 @@ $emit-opcodes:op2: 8a/copy-byte 0/mod/indirect 3/rm32/ebx . . . 0/r32/AL . . # copy byte at *ebx to AL # . if (c == '#') return 3d/compare-eax-and 0x23/imm32/hash - 0f 84/jump-if-equal $emit-opcodes:end/disp32 + 0f 84/jump-if-= $emit-opcodes:end/disp32 # op2 = next-token-from-slice(op2->start, op2->end, '/') # . . push args 52/push-edx @@ -2168,7 +2168,7 @@ $emit-opcodes:op2: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax != false) return 3d/compare-eax-and 0/imm32/false - 0f 85/jump-if-not-equal $emit-opcodes:end/disp32 + 0f 85/jump-if-!= $emit-opcodes:end/disp32 # if (!slice-equal?(op2, "0f")) return # . eax = slice-equal?(op2, "0f") # . . push args @@ -2180,7 +2180,7 @@ $emit-opcodes:op2: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax == false) return 3d/compare-eax-and 0/imm32/false - 0f 84/jump-if-equal $emit-opcodes:end/disp32 + 0f 84/jump-if-= $emit-opcodes:end/disp32 $emit-opcodes:op3: # next-word(line, op3) # reuse op2/edx # . . push args @@ -2200,7 +2200,7 @@ $emit-opcodes:op3: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax != false) return 3d/compare-eax-and 0/imm32/false - 0f 85/jump-if-not-equal $emit-opcodes:end/disp32 + 0f 85/jump-if-!= $emit-opcodes:end/disp32 # if (slice-starts-with?(op3, "#")) return # . var start/ebx : (addr byte) = op2->start 8b/copy 0/mod/indirect 2/rm32/edx . . . 3/r32/ebx . . # copy *edx to ebx @@ -2209,7 +2209,7 @@ $emit-opcodes:op3: 8a/copy-byte 0/mod/indirect 3/rm32/ebx . . . 0/r32/AL . . # copy byte at *ebx to AL # . if (c == '#') return 3d/compare-eax-and 0x23/imm32/hash - 0f 84/jump-if-equal $emit-opcodes:end/disp32 + 0f 84/jump-if-= $emit-opcodes:end/disp32 # op3 = next-token-from-slice(op3->start, op3->end, '/') # . . push args 52/push-edx @@ -2397,7 +2397,7 @@ $emit-modrm:check0: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax != false) pass through 3d/compare-eax-and 0/imm32/false - 0f 85/jump-if-not-equal $emit-modrm:break/disp32 + 0f 85/jump-if-!= $emit-modrm:break/disp32 $emit-modrm:check1: # if (slice-starts-with?(word-slice, "#")) break # . spill edx @@ -2411,7 +2411,7 @@ $emit-modrm:check1: 5a/pop-to-edx # . if (c == '#') pass through 3d/compare-eax-and 0x23/imm32/hash - 0f 84/jump-if-equal $emit-modrm:break/disp32 + 0f 84/jump-if-= $emit-modrm:break/disp32 $emit-modrm:check-for-mod: # if (has-metadata?(word-slice, "mod")) # . eax = has-metadata?(ecx, "mod") @@ -2424,7 +2424,7 @@ $emit-modrm:check-for-mod: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax == false) goto next check 3d/compare-eax-and 0/imm32/false - 74/jump-if-equal $emit-modrm:check-for-rm32/disp8 + 74/jump-if-= $emit-modrm:check-for-rm32/disp8 $emit-modrm:mod: # mod = parse-hex-int(next-token-from-slice(word-slice->start, word-slice->end, '/')) # . eax = parse-datum-of-word(word-slice) @@ -2452,7 +2452,7 @@ $emit-modrm:check-for-rm32: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax == false) goto next check 3d/compare-eax-and 0/imm32/false - 74/jump-if-equal $emit-modrm:check-for-r32/disp8 + 74/jump-if-= $emit-modrm:check-for-r32/disp8 $emit-modrm:rm32: # rm32 = parse-hex-int(next-token-from-slice(word-slice->start, word-slice->end, '/')) # . eax = parse-datum-of-word(word-slice) @@ -2480,7 +2480,7 @@ $emit-modrm:check-for-r32: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax == false) goto next check 3d/compare-eax-and 0/imm32/false - 74/jump-if-equal $emit-modrm:check-for-subop/disp8 + 74/jump-if-= $emit-modrm:check-for-subop/disp8 $emit-modrm:r32: # r32 = parse-hex-int(next-token-from-slice(word-slice->start, word-slice->end, '/')) # . eax = parse-datum-of-word(word-slice) @@ -2508,7 +2508,7 @@ $emit-modrm:check-for-subop: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax == false) loop 3d/compare-eax-and 0/imm32/false - 0f 84/jump-if-equal $emit-modrm:loop/disp32 + 0f 84/jump-if-= $emit-modrm:loop/disp32 $emit-modrm:subop: # r32 = parse-hex-int(next-token-from-slice(word-slice->start, word-slice->end, '/')) # . eax = parse-datum-of-word(word-slice) @@ -2527,7 +2527,7 @@ $emit-modrm:subop: $emit-modrm:break: # if (!has-modrm?) return 81 7/subop/compare 3/mod/direct 2/rm32/edx . . . . . 0/imm32/false # compare edx - 74/jump-if-equal $emit-modrm:end/disp8 + 74/jump-if-= $emit-modrm:end/disp8 $emit-modrm:calculate: # var modrm/ebx : byte = mod & 0b11 81 4/subop/and 3/mod/direct 3/rm32/ebx . . . . . 3/imm32/0b11 # bitwise and of ebx @@ -2706,7 +2706,7 @@ $emit-sib:check0: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax != false) pass through 3d/compare-eax-and 0/imm32/false - 0f 85/jump-if-not-equal $emit-sib:break/disp32 + 0f 85/jump-if-!= $emit-sib:break/disp32 $emit-sib:check1: # if (slice-starts-with?(word-slice, "#")) break # . spill edx @@ -2720,7 +2720,7 @@ $emit-sib:check1: 5a/pop-to-edx # . if (c == '#') pass through 3d/compare-eax-and 0x23/imm32/hash - 0f 84/jump-if-equal $emit-sib:break/disp32 + 0f 84/jump-if-= $emit-sib:break/disp32 $emit-sib:check-for-scale: # if (has-metadata?(word-slice, "scale")) # . eax = has-metadata?(ecx, "scale") @@ -2733,7 +2733,7 @@ $emit-sib:check-for-scale: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax == false) goto next check 3d/compare-eax-and 0/imm32/false - 74/jump-if-equal $emit-sib:check-for-base/disp8 + 74/jump-if-= $emit-sib:check-for-base/disp8 $emit-sib:scale: # scale = parse-hex-int(next-token-from-slice(word-slice->start, word-slice->end, '/')) # . eax = parse-datum-of-word(word-slice) @@ -2761,7 +2761,7 @@ $emit-sib:check-for-base: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax == false) goto next check 3d/compare-eax-and 0/imm32/false - 74/jump-if-equal $emit-sib:check-for-index/disp8 + 74/jump-if-= $emit-sib:check-for-index/disp8 $emit-sib:base: # base = parse-hex-int(next-token-from-slice(word-slice->start, word-slice->end, '/')) # . eax = parse-datum-of-word(word-slice) @@ -2789,7 +2789,7 @@ $emit-sib:check-for-index: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax == false) loop 3d/compare-eax-and 0/imm32/false - 0f 84/jump-if-equal $emit-sib:loop/disp32 + 0f 84/jump-if-= $emit-sib:loop/disp32 $emit-sib:index: # index = parse-hex-int(next-token-from-slice(word-slice->start, word-slice->end, '/')) # . eax = parse-datum-of-word(word-slice) @@ -2808,7 +2808,7 @@ $emit-sib:index: $emit-sib:break: # if (!has-sib?) return 81 7/subop/compare 3/mod/direct 2/rm32/edx . . . . . 0/imm32/false # compare edx - 74/jump-if-equal $emit-sib:end/disp8 + 74/jump-if-= $emit-sib:end/disp8 $emit-sib:calculate: # var sib/ebx : byte = scale & 0b11 81 4/subop/and 3/mod/direct 3/rm32/ebx . . . . . 3/imm32/0b11 # bitwise and of ebx @@ -2969,7 +2969,7 @@ $emit-disp:check0: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax != false) pass through 3d/compare-eax-and 0/imm32/false - 0f 85/jump-if-not-equal $emit-disp:break/disp32 + 0f 85/jump-if-!= $emit-disp:break/disp32 $emit-disp:check1: # if (slice-starts-with?(word-slice, "#")) break # . var start/edx : (addr byte) = word-slice->start @@ -2979,7 +2979,7 @@ $emit-disp:check1: 8a/copy-byte 0/mod/indirect 2/rm32/edx . . . 0/r32/AL . . # copy byte at *edx to AL # . if (c == '#') break 3d/compare-eax-and 0x23/imm32/hash - 0f 84/jump-if-equal $emit-disp:break/disp32 + 0f 84/jump-if-= $emit-disp:break/disp32 $emit-disp:check-for-disp32: # if (has-metadata?(word-slice, "disp32")) # . eax = has-metadata?(ecx, "disp32") @@ -2992,7 +2992,7 @@ $emit-disp:check-for-disp32: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax == false) goto next check 3d/compare-eax-and 0/imm32/false - 74/jump-if-equal $emit-disp:check-for-disp16/disp8 + 74/jump-if-= $emit-disp:check-for-disp16/disp8 $emit-disp:disp32: # emit(out, word-slice, 4) # . . push args @@ -3017,7 +3017,7 @@ $emit-disp:check-for-disp16: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax == false) goto next check 3d/compare-eax-and 0/imm32/false - 74/jump-if-equal $emit-disp:check-for-disp8/disp8 + 74/jump-if-= $emit-disp:check-for-disp8/disp8 $emit-disp:disp16: # emit(out, word-slice, 2) # . . push args @@ -3042,7 +3042,7 @@ $emit-disp:check-for-disp8: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax == false) loop 3d/compare-eax-and 0/imm32/false - 0f 84/jump-if-equal $emit-disp:loop/disp32 + 0f 84/jump-if-= $emit-disp:loop/disp32 $emit-disp:disp8: # emit(out, word-slice, 1) # . . push args @@ -3188,7 +3188,7 @@ $emit-imm:check0: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax != false) pass through 3d/compare-eax-and 0/imm32/false - 0f 85/jump-if-not-equal $emit-imm:break/disp32 + 0f 85/jump-if-!= $emit-imm:break/disp32 $emit-imm:check1: # if (slice-starts-with?(word-slice, "#")) break # . var start/edx : (addr byte) = slice->start @@ -3198,7 +3198,7 @@ $emit-imm:check1: 8a/copy-byte 0/mod/indirect 2/rm32/edx . . . 0/r32/AL . . # copy byte at *edx to AL # . if (c == '#') break 3d/compare-eax-and 0x23/imm32/hash - 0f 84/jump-if-equal $emit-imm:break/disp32 + 0f 84/jump-if-= $emit-imm:break/disp32 $emit-imm:check-for-imm32: # if (has-metadata?(word-slice, "imm32")) # . eax = has-metadata?(ecx, "imm32") @@ -3211,7 +3211,7 @@ $emit-imm:check-for-imm32: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax == false) goto next check 3d/compare-eax-and 0/imm32/false - 74/jump-if-equal $emit-imm:check-for-imm16/disp8 + 74/jump-if-= $emit-imm:check-for-imm16/disp8 $emit-imm:imm32: # emit(out, word-slice, 4) # . . push args @@ -3236,7 +3236,7 @@ $emit-imm:check-for-imm16: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax == false) goto next check 3d/compare-eax-and 0/imm32/false - 74/jump-if-equal $emit-imm:check-for-imm8/disp8 + 74/jump-if-= $emit-imm:check-for-imm8/disp8 $emit-imm:imm16: # emit(out, word-slice, 2) # . . push args @@ -3261,7 +3261,7 @@ $emit-imm:check-for-imm8: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax == false) loop 3d/compare-eax-and 0/imm32/false - 0f 84/jump-if-equal $emit-imm:loop/disp32 + 0f 84/jump-if-= $emit-imm:loop/disp32 $emit-imm:imm8: # emit(out, word-slice, 1) # . . push args diff --git a/apps/sigils.subx b/apps/sigils.subx index c1374c60..fd0bc649 100644 --- a/apps/sigils.subx +++ b/apps/sigils.subx @@ -68,7 +68,7 @@ Entry: # run tests if necessary, convert stdin if not # - if argc > 1 and argv[1] == "test", then return run_tests() # if (argc <= 1) goto interactive 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 0/disp8 1/imm32 # compare *ebp - 7e/jump-if-lesser-or-equal $subx-sigils-main:interactive/disp8 + 7e/jump-if-<= $subx-sigils-main:interactive/disp8 # if (!kernel-string-equal?(argv[1], "test")) goto interactive # . eax = kernel-string-equal?(argv[1], "test") # . . push args @@ -80,7 +80,7 @@ Entry: # run tests if necessary, convert stdin if not 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax == false) goto interactive 3d/compare-eax-and 0/imm32/false - 74/jump-if-equal $subx-sigils-main:interactive/disp8 + 74/jump-if-= $subx-sigils-main:interactive/disp8 # run-tests() e8/call run-tests/disp32 # syscall(exit, *Num-test-failures) @@ -170,7 +170,7 @@ $subx-sigils:line-loop: $subx-sigils:check0: # if (line->write == 0) break 81 7/subop/compare 0/mod/indirect 1/rm32/ecx . . . . . 0/imm32 # compare *ecx - 0f 84/jump-if-equal $subx-sigils:break/disp32 + 0f 84/jump-if-= $subx-sigils:break/disp32 $subx-sigils:word-loop: # next-word-or-expression(line, word-slice) # . . push args @@ -191,7 +191,7 @@ $subx-sigils:check1: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax != false) break 3d/compare-eax-and 0/imm32/false - 0f 85/jump-if-not-equal $subx-sigils:next-line/disp32 + 0f 85/jump-if-!= $subx-sigils:next-line/disp32 $subx-sigils:check-for-comment: # if (slice-starts-with?(word-slice, "#")) continue # . start/ebx = word-slice->start @@ -201,11 +201,11 @@ $subx-sigils:check-for-comment: 8a/copy-byte 0/mod/indirect 3/rm32/ebx . . . 0/r32/AL . . # copy byte at *ebx to AL # . if (eax == '#') continue 3d/compare-eax-and 0x23/imm32/hash - 74/jump-if-equal $subx-sigils:word-loop/disp8 + 74/jump-if-= $subx-sigils:word-loop/disp8 $subx-sigils:check-for-direct-mode: # if (!slice-starts-with?(word-slice, "%")) goto next check 3d/compare-eax-and 0x25/imm32/percent - 75/jump-if-not-equal $subx-sigils:check-for-indirect-mode/disp8 + 75/jump-if-!= $subx-sigils:check-for-indirect-mode/disp8 $subx-sigils:direct-mode: #? # dump word-slice {{{ #? # . write(2/stderr, "w: ") @@ -260,7 +260,7 @@ $subx-sigils:direct-mode: $subx-sigils:check-for-indirect-mode: # if (!slice-starts-with?(word-slice, "*")) goto next check 3d/compare-eax-and 0x2a/imm32/asterisk - 75/jump-if-not-equal $subx-sigils:check-for-invalid-addition/disp8 + 75/jump-if-!= $subx-sigils:check-for-invalid-addition/disp8 # if (!disp32-mode?(word-slice)) goto indirect mode # . eax = disp32-mode?(word-slice) # . . push args @@ -271,7 +271,7 @@ $subx-sigils:check-for-indirect-mode: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax == false) goto indirect mode 3d/compare-eax-and 0/imm32/false - 74/jump-if-equal $subx-sigils:indirect-mode/disp8 + 74/jump-if-= $subx-sigils:indirect-mode/disp8 $subx-sigils:disp32-mode: # emit-indirect-mode(out, word-slice) # . . push args @@ -317,11 +317,11 @@ $subx-sigils:indirect-mode: $subx-sigils:check-for-invalid-addition: # if (slice-starts-with?(word-slice, "+")) goto error1 3d/compare-eax-and 0x2b/imm32/plus - 74/jump-if-equal $subx-sigils:error1/disp8 + 74/jump-if-= $subx-sigils:error1/disp8 $subx-sigils:check-for-invalid-left-shift: # if (slice-starts-with?(word-slice, "<")) goto error1 3d/compare-eax-and 0x3c/imm32/less-than - 74/jump-if-equal $subx-sigils:error1/disp8 + 74/jump-if-= $subx-sigils:error1/disp8 $subx-sigils:regular-word: # write-slice-buffered(out, word-slice) # . . push args @@ -1652,7 +1652,7 @@ $next-word-or-expression:check0: 8b/copy 1/mod/*+disp8 6/rm32/esi . . . 1/r32/ecx 4/disp8 . # copy *(esi+4) to ecx # . if (ecx < line->write) goto next check 3b/compare 0/mod/indirect 6/rm32/esi . . . 1/r32/ecx . . # compare ecx with *esi - 7c/jump-if-lesser $next-word-or-expression:check-for-comment/disp8 + 7c/jump-if-< $next-word-or-expression:check-for-comment/disp8 # . return out = {0, 0} c7 0/subop/copy 0/mod/direct 7/rm32/edi . . . . . 0/imm32 # copy to *edi c7 0/subop/copy 1/mod/*+disp8 7/rm32/edi . . . . 4/disp8 0/imm32 # copy to *(edi+4) @@ -1667,7 +1667,7 @@ $next-word-or-expression:check-for-comment: 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 != '#') goto next check 3d/compare-eax-and 0x23/imm32/pound - 75/jump-if-not-equal $next-word-or-expression:check-for-string-literal/disp8 + 75/jump-if-!= $next-word-or-expression:check-for-string-literal/disp8 $next-word-or-expression:comment: # out->end = &line->data[line->write] 8b/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . . # copy *esi to eax @@ -1681,7 +1681,7 @@ $next-word-or-expression:comment: $next-word-or-expression:check-for-string-literal: # if (line->data[line->read] != '"') goto next check 3d/compare-eax-and 0x22/imm32/dquote - 75/jump-if-not-equal $next-word-or-expression:check-for-expression/disp8 + 75/jump-if-!= $next-word-or-expression:check-for-expression/disp8 $next-word-or-expression:string-literal: # skip-string(line) # . . push args @@ -1695,14 +1695,14 @@ $next-word-or-expression:string-literal: $next-word-or-expression:check-for-expression: # if (line->data[line->read] != '*') goto next check 3d/compare-eax-and 0x2a/imm32/asterisk - 75/jump-if-not-equal $next-word-or-expression:regular-word/disp8 + 75/jump-if-!= $next-word-or-expression:regular-word/disp8 # if (line->data[line->read + 1] == ' ') goto error1 8a/copy-byte 1/mod/*+disp8 4/rm32/sib 6/base/esi 1/index/ecx . 0/r32/AL 0xd/disp8 . # copy byte at *(esi+ecx+12+1) to AL 3d/compare-eax-and 0x20/imm32/space - 74/jump-if-equal $next-word-or-expression:error1/disp8 + 74/jump-if-= $next-word-or-expression:error1/disp8 # if (line->data[line->read + 1] != '(') goto regular word 3d/compare-eax-and 0x28/imm32/open-paren - 75/jump-if-not-equal $next-word-or-expression:regular-word/disp8 + 75/jump-if-!= $next-word-or-expression:regular-word/disp8 $next-word-or-expression:paren: # skip-until-close-paren(line) # . . push args @@ -1717,7 +1717,7 @@ $next-word-or-expression:paren: 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 != ')') goto error2 3d/compare-eax-and 0x29/imm32/close-paren - 75/jump-if-not-equal $next-word-or-expression:error2/disp8 + 75/jump-if-!= $next-word-or-expression:error2/disp8 # skip ')' ff 0/subop/increment 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 . # increment *(esi+4) # fall through @@ -2269,7 +2269,7 @@ $parse-effective-address:check-for-simple-register: 8a/copy-byte 0/mod/indirect 0/rm32/eax . . . 0/r32/AL . . # copy byte at *eax to AL 81 4/subop/and 3/mod/direct 0/rm32/eax . . . . . 0xff/imm32 # bitwise and of eax 3d/compare-eax-and 0x28/imm32/open-paren - 74/jump-if-equal $parse-effective-address:compound-expression/disp8 + 74/jump-if-= $parse-effective-address:compound-expression/disp8 $parse-effective-address:simple-register: # local-slice = next-token-from-slice(local-slice->start, local-slice->end, "/") # . . push args @@ -2335,13 +2335,13 @@ $parse-effective-address:compound-expression: 8a/copy-byte 0/mod/indirect 0/rm32/eax . . . 0/r32/AL . . # copy byte at *eax to AL 81 4/subop/and 3/mod/direct 0/rm32/eax . . . . . 0xff/imm32 # bitwise and of eax 3d/compare-eax-and 0x29/imm32/close-paren - 0f 84/jump-if-equal $parse-effective-address:end/disp32 + 0f 84/jump-if-= $parse-effective-address:end/disp32 # if (*local-slice->start == '-') goto displacement 3d/compare-eax-and 0x2d/imm32/minus - 0f 84/jump-if-equal $parse-effective-address:displacement/disp32 + 0f 84/jump-if-= $parse-effective-address:displacement/disp32 # if (*local-slice->start != '+') goto error1 3d/compare-eax-and 0x2b/imm32/plus - 0f 85/jump-if-not-equal $parse-effective-address:error1/disp32 + 0f 85/jump-if-!= $parse-effective-address:error1/disp32 $parse-effective-address:check-for-index: # ++local-slice->start to skip '+' ff 0/subop/increment 0/mod/indirect 6/rm32/esi . . . . . . # increment *esi @@ -2385,7 +2385,7 @@ $parse-effective-address:resolve-ambiguity: 59/pop-to-ecx # . if (eax == 0) goto displacement 3d/compare-eax-and 0/imm32 - 0f 84/jump-if-equal $parse-effective-address:displacement/disp32 + 0f 84/jump-if-= $parse-effective-address:displacement/disp32 $parse-effective-address:index: # read register into index # . eax = next-register(local-slice) @@ -2412,11 +2412,11 @@ $parse-effective-address:index: 8a/copy-byte 0/mod/indirect 0/rm32/eax . . . 0/r32/AL . . # copy byte at *eax to AL 81 4/subop/and 3/mod/direct 0/rm32/eax . . . . . 0xff/imm32 # bitwise and of eax 3d/compare-eax-and 0x29/imm32/close-paren - 0f 84/jump-if-equal $parse-effective-address:end/disp32 + 0f 84/jump-if-= $parse-effective-address:end/disp32 $parse-effective-address:check-for-scale: # if (*local-slice->start != '<') goto next check 3d/compare-eax-and 0x3c/imm32/less-than - 75/jump-if-not-equal $parse-effective-address:check-for-displacement/disp8 + 75/jump-if-!= $parse-effective-address:check-for-displacement/disp8 # ++local-slice->start to skip '<' ff 0/subop/increment 0/mod/indirect 6/rm32/esi . . . . . . # increment *esi # if (*local-slice->start != '<') goto error2 @@ -2424,7 +2424,7 @@ $parse-effective-address:check-for-scale: 8a/copy-byte 0/mod/indirect 0/rm32/eax . . . 0/r32/AL . . # copy byte at *eax to AL 81 4/subop/and 3/mod/direct 0/rm32/eax . . . . . 0xff/imm32 # bitwise and of eax 3d/compare-eax-and 0x3c/imm32/less-than - 0f 85/jump-if-not-equal $parse-effective-address:error2/disp32 + 0f 85/jump-if-!= $parse-effective-address:error2/disp32 # ++local-slice->start to skip '<' ff 0/subop/increment 0/mod/indirect 6/rm32/esi . . . . . . # increment *esi # skip whitespace @@ -2464,13 +2464,13 @@ $parse-effective-address:scale: 8a/copy-byte 0/mod/indirect 0/rm32/eax . . . 0/r32/AL . . # copy byte at *eax to AL 81 4/subop/and 3/mod/direct 0/rm32/eax . . . . . 0xff/imm32 # bitwise and of eax 3d/compare-eax-and 0x29/imm32/close-paren - 74/jump-if-equal $parse-effective-address:end/disp8 + 74/jump-if-= $parse-effective-address:end/disp8 $parse-effective-address:check-for-displacement: # if (*local-slice->start not in '+' '-') goto error3 3d/compare-eax-and 0x2b/imm32/plus - 74/jump-if-equal $parse-effective-address:displacement/disp8 + 74/jump-if-= $parse-effective-address:displacement/disp8 3d/compare-eax-and 0x2d/imm32/minus - 74/jump-if-equal $parse-effective-address:displacement/disp8 + 74/jump-if-= $parse-effective-address:displacement/disp8 e9/jump $parse-effective-address:error3/disp32 $parse-effective-address:displacement: # read integer into disp @@ -2498,7 +2498,7 @@ $parse-effective-address:displacement: 8a/copy-byte 0/mod/indirect 0/rm32/eax . . . 0/r32/AL . . # copy byte at *eax to AL 81 4/subop/and 3/mod/direct 0/rm32/eax . . . . . 0xff/imm32 # bitwise and of eax 3d/compare-eax-and 0x29/imm32/close-paren - 0f 85/jump-if-not-equal $parse-effective-address:error4/disp32 + 0f 85/jump-if-!= $parse-effective-address:error4/disp32 $parse-effective-address:end: # return base in eax 89/copy 3/mod/direct 0/rm32/eax . . . 7/r32/edi . . # copy edi to eax @@ -3156,15 +3156,15 @@ emit-indirect-mode: # out : (addr buffered-file), base : int, index : int, scal $emit-indirect-mode:check-for-ebp: # if (base == 5) goto emit-sib 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 5/imm32 # compare *(ebp+12) - 74/jump-if-equal $emit-indirect-mode:emit-sib/disp8 + 74/jump-if-= $emit-indirect-mode:emit-sib/disp8 $emit-indirect-mode:check-for-esp: # if (base == 4) goto emit-sib 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 4/imm32 # compare *(ebp+12) - 74/jump-if-equal $emit-indirect-mode:emit-sib/disp8 + 74/jump-if-= $emit-indirect-mode:emit-sib/disp8 $emit-indirect-mode:check-for-sib: # if (index == 4/none) goto next check 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 0x10/disp8 4/imm32 # compare *(ebp+16) - 0f 84/jump-if-equal $emit-indirect-mode:check-for-disp/disp32 + 0f 84/jump-if-= $emit-indirect-mode:check-for-disp/disp32 $emit-indirect-mode:emit-sib: # emit(out, "2/mod/indirect 4/rm32/sib " base "/base " index "/index " scale "/scale " disp "/disp32") # . write-buffered(out, "2/mod/*+disp32 4/rm32/sib ") @@ -3243,7 +3243,7 @@ $emit-indirect-mode:emit-sib: $emit-indirect-mode:check-for-disp: # if (disp == 0) goto next check 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 0x18/disp8 0/imm32 # compare *(ebp+24) - 74/jump-if-equal $emit-indirect-mode:emit-indirect/disp8 + 74/jump-if-= $emit-indirect-mode:emit-indirect/disp8 $emit-indirect-mode:emit-disp: # emit(out, "2/mod/*+disp32 " base "/rm32 " disp "/disp32") # . write-buffered(out, "2/mod/*+disp32 ") @@ -3877,7 +3877,7 @@ disp32-mode?: # in : (addr slice) -> reg/eax : boolean 8a/copy-byte 0/mod/indirect 0/rm32/eax . . . 0/r32/AL . . # copy byte at *eax to AL 81 4/subop/and 3/mod/direct 0/rm32/eax . . . . . 0xff/imm32 # bitwise and of eax 3d/compare-eax-and 0x28/imm32/open-paren - 74/jump-if-equal $disp32-mode?:false/disp8 + 74/jump-if-= $disp32-mode?:false/disp8 $disp32-mode?:check-for-register: # local-slice = next-token-from-slice(local-slice->start, local-slice->end, "/") # . . push args @@ -3900,7 +3900,7 @@ $disp32-mode?:check-for-register: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp # if (eax != 0) return false 3d/compare-eax-and 0/imm32 - 75/jump-if-not-equal $disp32-mode?:false/disp8 + 75/jump-if-!= $disp32-mode?:false/disp8 # return true b8/copy-to-eax 1/imm32/true eb/jump $disp32-mode?:end/disp8 @@ -3993,14 +3993,14 @@ next-hex-int: # in : (addr slice) -> result/eax $next-hex-int:positive: # if (*curr == '+') ++curr 3d/compare-eax-and 0x2b/imm32/+ - 75/jump-if-not-equal $next-hex-int:negative/disp8 + 75/jump-if-!= $next-hex-int:negative/disp8 # . ++curr 41/increment-ecx eb/jump $next-hex-int:skip-whitespace/disp8 $next-hex-int:negative: # else if (*curr == '-') ++curr, negate = true 3d/compare-eax-and 0x2d/imm32/- - 75/jump-if-not-equal $next-hex-int:skip-whitespace/disp8 + 75/jump-if-!= $next-hex-int:skip-whitespace/disp8 $next-hex-int:need-to-negate: # . ++curr 41/increment-ecx @@ -4027,24 +4027,24 @@ $next-hex-int:initial-0: # . if (*curr != '0') jump to loop 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 0/r32/AL . . # copy byte at *ecx to AL 3d/compare-eax-and 0x30/imm32/0 - 75/jump-if-not-equal $next-hex-int:loop/disp8 + 75/jump-if-!= $next-hex-int:loop/disp8 # . ++curr 41/increment-ecx $next-hex-int:initial-0x: # . if (curr >= in->end) return result 39/compare 3/mod/direct 1/rm32/ecx . . . 2/r32/edx . . # compare ecx with edx - 73/jump-if-greater-or-equal-unsigned $next-hex-int:end/disp8 + 73/jump-if-addr>= $next-hex-int:end/disp8 # . if (*curr != 'x') jump to loop # the previous '0' is still valid so doesn't need to be checked again 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 3d/compare-eax-and 0x78/imm32/x - 75/jump-if-not-equal $next-hex-int:loop/disp8 + 75/jump-if-!= $next-hex-int:loop/disp8 # . ++curr 41/increment-ecx $next-hex-int:loop: # if (curr >= in->end) break 39/compare 3/mod/direct 1/rm32/ecx . . . 2/r32/edx . . # compare ecx with edx - 73/jump-if-greater-or-equal-unsigned $next-hex-int:break/disp8 + 73/jump-if-addr>= $next-hex-int:break/disp8 # if (!is-hex-digit?(*curr)) break # . eax = *curr 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 0/r32/AL . . # copy byte at *ecx to AL @@ -4057,7 +4057,7 @@ $next-hex-int:loop: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax == false) break 3d/compare-eax-and 0/imm32/false - 74/jump-if-equal $next-hex-int:break/disp8 + 74/jump-if-= $next-hex-int:break/disp8 # eax = from-hex-char(*curr) # . . copy arg to eax 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 0/r32/AL . . # copy byte at *ecx to AL @@ -4073,7 +4073,7 @@ $next-hex-int:loop: $next-hex-int:break: # if (negate?) result = -result 81 7/subop/compare 3/mod/direct 3/rm32/ebx . . . . . 0/imm32/false # compare ebx - 74/jump-if-equal $next-hex-int:end/disp8 + 74/jump-if-= $next-hex-int:end/disp8 $next-hex-int:negate: f7 3/subop/negate 3/mod/direct 7/rm32/edi . . . . . . # negate edi $next-hex-int:end: @@ -4410,24 +4410,24 @@ $next-positive-hex-int:initial-0: # . if (*curr != '0') jump to loop 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 0/r32/AL . . # copy byte at *ecx to AL 3d/compare-eax-and 0x30/imm32/0 - 75/jump-if-not-equal $next-positive-hex-int:loop/disp8 + 75/jump-if-!= $next-positive-hex-int:loop/disp8 # . ++curr 41/increment-ecx $next-positive-hex-int:initial-0x: # . if (curr >= in->end) return result 39/compare 3/mod/direct 1/rm32/ecx . . . 2/r32/edx . . # compare ecx with edx - 73/jump-if-greater-or-equal-unsigned $next-positive-hex-int:end/disp8 + 73/jump-if-addr>= $next-positive-hex-int:end/disp8 # . if (*curr != 'x') jump to loop # the previous '0' is still valid so doesn't need to be checked again 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 3d/compare-eax-and 0x78/imm32/x - 75/jump-if-not-equal $next-positive-hex-int:loop/disp8 + 75/jump-if-!= $next-positive-hex-int:loop/disp8 # . ++curr 41/increment-ecx $next-positive-hex-int:loop: # if (curr >= in->end) break 39/compare 3/mod/direct 1/rm32/ecx . . . 2/r32/edx . . # compare ecx with edx - 73/jump-if-greater-or-equal-unsigned $next-positive-hex-int:end/disp8 + 73/jump-if-addr>= $next-positive-hex-int:end/disp8 # if (!is-hex-digit?(*curr)) break # . eax = *curr 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 0/r32/AL . . # copy byte at *ecx to AL @@ -4440,7 +4440,7 @@ $next-positive-hex-int:loop: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax == false) break 3d/compare-eax-and 0/imm32/false - 74/jump-if-equal $next-positive-hex-int:end/disp8 + 74/jump-if-= $next-positive-hex-int:end/disp8 # eax = from-hex-char(*curr) # . . copy arg to eax 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 0/r32/AL . . # copy byte at *ecx to AL diff --git a/apps/survey.subx b/apps/survey.subx index caedc77a..7ee97d3d 100644 --- a/apps/survey.subx +++ b/apps/survey.subx @@ -64,7 +64,7 @@ Entry: # run tests if necessary, convert stdin if not # - if argc > 1 and argv[1] == "test", then return run_tests() # if (argc <= 1) goto interactive 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 0/disp8 1/imm32 # compare *ebp - 7e/jump-if-lesser-or-equal $subx-survey-main:interactive/disp8 + 7e/jump-if-<= $subx-survey-main:interactive/disp8 # if (!kernel-string-equal?(argv[1], "test")) goto interactive # . eax = kernel-string-equal?(argv[1], "test") # . . push args @@ -76,7 +76,7 @@ Entry: # run tests if necessary, convert stdin if not 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax == false) goto interactive 3d/compare-eax-and 0/imm32/false - 74/jump-if-equal $subx-survey-main:interactive/disp8 + 74/jump-if-= $subx-survey-main:interactive/disp8 # run-tests() e8/call run-tests/disp32 # syscall(exit, *Num-test-failures) @@ -709,7 +709,7 @@ $compute-offsets:line-loop: # if (line->write == 0) break 8b/copy 0/mod/indirect 1/rm32/ecx . . . 0/r32/eax . . # copy *ecx to eax 3d/compare-eax-and 0/imm32 - 0f 84/jump-if-equal $compute-offsets:break-line-loop/disp32 + 0f 84/jump-if-= $compute-offsets:break-line-loop/disp32 #? # dump line {{{ #? # . write(2/stderr, "LL: ") #? # . . push args @@ -793,7 +793,7 @@ $compute-offsets:word-loop: #? 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp #? # . if (curr-segment-name == 0) print curr-segment-name #? 81 7/subop/compare 3/mod/direct 6/rm32/esi . . . . . 0/imm32 # compare esi -#? 74/jump-if-equal $compute-offsets:case-empty/disp8 +#? 74/jump-if-= $compute-offsets:case-empty/disp8 #? # . write(2/stderr, "segment at start of word: ") #? # . . push args #? 68/push "segment at start of word: "/imm32 @@ -835,7 +835,7 @@ $compute-offsets:case-empty: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax != false) break 3d/compare-eax-and 0/imm32/false - 0f 85/jump-if-not-equal $compute-offsets:line-loop/disp32 + 0f 85/jump-if-!= $compute-offsets:line-loop/disp32 $compute-offsets:case-comment: # if slice-starts-with?(word-slice, "#") continue 68/push "#"/imm32 @@ -845,7 +845,7 @@ $compute-offsets:case-comment: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax != false) break 3d/compare-eax-and 0/imm32/false - 0f 85/jump-if-not-equal $compute-offsets:line-loop/disp32 + 0f 85/jump-if-!= $compute-offsets:line-loop/disp32 $compute-offsets:case-segment-header: # if (!slice-equal?(word-slice/edx, "==")) goto next case # . eax = slice-equal?(word-slice/edx, "==") @@ -856,10 +856,10 @@ $compute-offsets:case-segment-header: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax == false) goto next case 3d/compare-eax-and 0/imm32/false - 0f 84/jump-if-equal $compute-offsets:case-label/disp32 + 0f 84/jump-if-= $compute-offsets:case-label/disp32 # if (curr-segment-name == 0) goto construct-next-segment 81 7/subop/compare 3/mod/direct 6/rm32/esi . . . . . 0/imm32 # compare esi - 74/jump-if-equal $compute-offsets:construct-next-segment/disp8 + 74/jump-if-= $compute-offsets:construct-next-segment/disp8 # seg/eax = get-or-insert(segments, curr-segment-name, row-size=16) # . . push args 68/push 0x10/imm32/row-size @@ -903,7 +903,7 @@ $compute-offsets:construct-next-segment: #? # dump curr-segment-name if not null (clobbering eax) {{{ #? # . if (curr-segment-name == 0) goto update-curr-segment-name #? 81 7/subop/compare 3/mod/direct 6/rm32/esi . . . . . 0/imm32 # compare esi -#? 74/jump-if-equal $compute-offsets:update-curr-segment-name/disp8 +#? 74/jump-if-= $compute-offsets:update-curr-segment-name/disp8 #? # . write(2/stderr, "setting segment to: ") #? # . . push args #? 68/push "setting segment to: "/imm32 @@ -960,7 +960,7 @@ $compute-offsets:update-curr-segment-name: # if empty?(curr-segment-name) abort # . if (eax == 0) abort 3d/compare-eax-and 0/imm32 - 0f 84/jump-if-equal $compute-offsets:abort/disp32 + 0f 84/jump-if-= $compute-offsets:abort/disp32 # next-word(line, segment-tmp) 68/push compute-offsets:segment-tmp/imm32 51/push-ecx @@ -975,7 +975,7 @@ $compute-offsets:update-curr-segment-name: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax != false) abort 3d/compare-eax-and 0/imm32/false - 0f 85/jump-if-not-equal $compute-offsets:abort/disp32 + 0f 85/jump-if-!= $compute-offsets:abort/disp32 # seg/ebx = get-or-insert(segments, curr-segment-name, row-size=16) # . . push args 68/push 0x10/imm32/row-size @@ -1024,7 +1024,7 @@ $compute-offsets:case-label: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax == false) goto next case 3d/compare-eax-and 0/imm32/false - 74/jump-if-equal $compute-offsets:case-default/disp8 + 74/jump-if-= $compute-offsets:case-default/disp8 # strip trailing ':' from word-slice ff 1/subop/decrement 1/mod/*+disp8 2/rm32/edx . . . . 4/disp8 . # decrement *(edx+4) # x/eax = leaky-get-or-insert-slice(labels, word-slice, row-size=16) @@ -1428,7 +1428,7 @@ compute-addresses: # segments : (addr stream {string, segment-info}), labels : $compute-addresses:segment-loop: # if (srow >= max) break 39/compare 3/mod/direct 0/rm32/eax . . . 1/r32/ecx . . # compare eax with ecx - 73/jump-if-greater-or-equal-unsigned $compute-addresses:segment-break/disp8 + 73/jump-if-addr>= $compute-addresses:segment-break/disp8 # srow->file-offset += starting-offset 01/add 1/mod/*+disp8 0/rm32/eax . . . 7/r32/edi 8/disp8 . # add edi to *(eax+8) # clear last 12 bits of srow->address for p_align=0x1000 @@ -1495,7 +1495,7 @@ $compute-addresses:segment-break: $compute-addresses:label-loop: # if (lrow >= max) break 39/compare 3/mod/direct 0/rm32/eax . . . 1/r32/ecx . . # compare eax with ecx - 0f 83/jump-if-greater-or-equal-unsigned $compute-addresses:end/disp32 + 0f 83/jump-if-addr>= $compute-addresses:end/disp32 #? # dump lrow->key {{{ #? # . write(2/stderr, "label: ") #? # . . push args @@ -2055,7 +2055,7 @@ $emit-segments:line-loop: $emit-segments:check-for-end-of-input: # if (line->write == 0) break 81 7/subop/compare 0/mod/indirect 1/rm32/ecx . . . . . 0/imm32 # compare *ecx - 0f 84/jump-if-equal $emit-segments:end/disp32 + 0f 84/jump-if-= $emit-segments:end/disp32 # offset-of-next-instruction += num-bytes(line) # . eax = num-bytes(line) # . . push args @@ -2119,7 +2119,7 @@ $emit-segments:check-for-end-of-line: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax != 0) break 3d/compare-eax-and 0/imm32 - 0f 85/jump-if-not-equal $emit-segments:next-line/disp32 + 0f 85/jump-if-!= $emit-segments:next-line/disp32 $emit-segments:check-for-comment: # if (slice-starts-with?(word-slice, "#")) break # . start/esi = word-slice->start @@ -2129,7 +2129,7 @@ $emit-segments:check-for-comment: 8a/copy-byte 0/mod/indirect 6/rm32/esi . . . 0/r32/AL . . # copy byte at *esi to AL # . if (eax == '#') break 3d/compare-eax-and 0x23/imm32/hash - 0f 84/jump-if-equal $emit-segments:next-line/disp32 + 0f 84/jump-if-= $emit-segments:next-line/disp32 $emit-segments:check-for-label: # if is-label?(word-slice) break # . eax = is-label?(word-slice) @@ -2141,7 +2141,7 @@ $emit-segments:check-for-label: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax != false) break 3d/compare-eax-and 0/imm32/false - 0f 85/jump-if-not-equal $emit-segments:line-loop/disp32 + 0f 85/jump-if-!= $emit-segments:line-loop/disp32 $emit-segments:check-for-segment-header: # if (slice-equal?(word-slice, "==")) break # . eax = slice-equal?(word-slice, "==") @@ -2154,7 +2154,7 @@ $emit-segments:check-for-segment-header: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax != false) break 3d/compare-eax-and 0/imm32/false - 0f 85/jump-if-not-equal $emit-segments:line-loop/disp32 + 0f 85/jump-if-!= $emit-segments:line-loop/disp32 $emit-segments:2-character: # if (length(word-slice) != 2) goto next check # . eax = length(word-slice) @@ -2162,7 +2162,7 @@ $emit-segments:2-character: 2b/subtract 0/mod/indirect 2/rm32/edx . . . 0/r32/eax . . # subtract *edx from eax # . if (eax != 2) goto next check 3d/compare-eax-and 2/imm32 - 75/jump-if-not-equal $emit-segments:check-metadata/disp8 + 75/jump-if-!= $emit-segments:check-metadata/disp8 # write-slice-buffered(out, word-slice) # . . push args 52/push-edx @@ -2277,7 +2277,7 @@ $emit-segments:check-global-variable: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax != false) goto code label checks 3d/compare-eax-and 0/imm32/false - 0f 85/jump-if-not-equal $emit-segments:check-code-label-for-imm8/disp32 + 0f 85/jump-if-!= $emit-segments:check-code-label-for-imm8/disp32 $emit-segments:check-global-variable-for-disp8: # if has-metadata?(word-slice, "disp8") abort # . eax = has-metadata?(word-slice, "disp8") @@ -2290,7 +2290,7 @@ $emit-segments:check-global-variable-for-disp8: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax != false) abort 3d/compare-eax-and 0/imm32/false - 0f 85/jump-if-not-equal $emit-segments:global-variable-abort/disp32 + 0f 85/jump-if-!= $emit-segments:global-variable-abort/disp32 $emit-segments:check-global-variable-for-imm8: # if has-metadata?(word-slice, "imm8") abort # . eax = has-metadata?(word-slice, "imm8") @@ -2303,7 +2303,7 @@ $emit-segments:check-global-variable-for-imm8: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax != false) abort 3d/compare-eax-and 0/imm32/false - 0f 85/jump-if-not-equal $emit-segments:global-variable-abort/disp32 + 0f 85/jump-if-!= $emit-segments:global-variable-abort/disp32 $emit-segments:emit-global-variable: # emit-hex(out, info->address, 4) # . . push args @@ -2328,7 +2328,7 @@ $emit-segments:check-code-label-for-imm8: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax != false) abort 3d/compare-eax-and 0/imm32/false - 0f 85/jump-if-not-equal $emit-segments:imm8-abort/disp32 + 0f 85/jump-if-!= $emit-segments:imm8-abort/disp32 $emit-segments:check-code-label-for-imm32: # if (!has-metadata?(word-slice, "imm32")) goto next check # . eax = has-metadata?(edx, "imm32") @@ -2341,7 +2341,7 @@ $emit-segments:check-code-label-for-imm32: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax == false) goto next check 3d/compare-eax-and 0/imm32 - 74/jump-if-equal $emit-segments:check-code-label-for-disp8/disp8 + 74/jump-if-= $emit-segments:check-code-label-for-disp8/disp8 #? # dump info->address {{{ #? # . write(2/stderr, "info->address: ") #? # . . push args @@ -2399,7 +2399,7 @@ $emit-segments:check-code-label-for-disp8: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax == false) goto next check 3d/compare-eax-and 0/imm32/false - 74/jump-if-equal $emit-segments:check-code-label-for-disp32/disp8 + 74/jump-if-= $emit-segments:check-code-label-for-disp32/disp8 $emit-segments:emit-code-label-disp8: # emit-hex(out, info->offset - offset-of-next-instruction, 1) # . . push args @@ -2426,7 +2426,7 @@ $emit-segments:check-code-label-for-disp32: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax == false) abort 3d/compare-eax-and 0/imm32/false - 0f 84/jump-if-equal $emit-segments:abort/disp32 + 0f 84/jump-if-= $emit-segments:abort/disp32 $emit-segments:emit-code-label-disp32: # emit-hex(out, info->offset - offset-of-next-instruction, 4) # . . push args @@ -3218,7 +3218,7 @@ emit-headers: # out : (addr buffered-file), segments : (addr stream {string, se $emit-headers:loop: # if (curr-segment >= max) break 39/compare 3/mod/direct 0/rm32/eax . . . 1/r32/ecx . . # compare eax with ecx - 0f 83/jump-if-greater-or-equal-unsigned $emit-headers:end/disp32 + 0f 83/jump-if-addr>= $emit-headers:end/disp32 #? # dump curr-segment->name {{{ #? # . write(2/stderr, "about to emit ph entry: segment->name: ") #? # . . push args @@ -3433,7 +3433,7 @@ emit-elf-program-header-entry: # out : (addr buffered-file), curr-segment : (ad 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax == false) goto next check 3d/compare-eax-and 0/imm32/false - 74/jump-if-equal $emit-elf-program-header-entry:data/disp8 + 74/jump-if-= $emit-elf-program-header-entry:data/disp8 # *$Elf_p_flags = r-x c7 0/subop/copy 0/mod/indirect 5/rm32/.disp32 . . . $Elf_p_flags/disp32 5/imm32 # copy to *$Elf_p_flags eb/jump $emit-elf-program-header-entry:really-emit/disp8 @@ -3491,7 +3491,7 @@ stream-add4: # in : (addr stream byte), key : addr, val1 : addr, val2 : addr, v 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/esi 2/index/edx . 2/r32/edx 0xc/disp8 . # copy esi+edx+12 to edx # if (curr >= max) abort 39/compare 3/mod/direct 0/rm32/eax . . . 2/r32/edx . . # compare eax with edx - 73/jump-if-greater-or-equal-unsigned $stream-add4:abort/disp8 + 73/jump-if-addr>= $stream-add4:abort/disp8 # *curr = key 8b/copy 1/mod/*+disp8 5/rm32/ebp . . 1/r32/ecx 0xc/disp8 . # copy *(ebp+12) to ecx 89/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . . # copy ecx to *eax @@ -3499,7 +3499,7 @@ stream-add4: # in : (addr stream byte), key : addr, val1 : addr, val2 : addr, v 05/add-to-eax 4/imm32 # if (curr >= max) abort 39/compare 3/mod/direct 0/rm32/eax . . . 2/r32/edx . . # compare eax with edx - 73/jump-if-greater-or-equal-unsigned $stream-add4:abort/disp8 + 73/jump-if-addr>= $stream-add4:abort/disp8 # *curr = val1 8b/copy 1/mod/*+disp8 5/rm32/ebp . . 1/r32/ecx 0x10/disp8 . # copy *(ebp+16) to ecx 89/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . . # copy ecx to *eax @@ -3507,7 +3507,7 @@ stream-add4: # in : (addr stream byte), key : addr, val1 : addr, val2 : addr, v 05/add-to-eax 4/imm32 # if (curr >= max) abort 39/compare 3/mod/direct 0/rm32/eax . . . 2/r32/edx . . # compare eax with edx - 73/jump-if-greater-or-equal-unsigned $stream-add4:abort/disp8 + 73/jump-if-addr>= $stream-add4:abort/disp8 # *curr = val2 8b/copy 1/mod/*+disp8 5/rm32/ebp . . 1/r32/ecx 0x14/disp8 . # copy *(ebp+20) to ecx 89/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . . # copy ecx to *eax @@ -3515,7 +3515,7 @@ stream-add4: # in : (addr stream byte), key : addr, val1 : addr, val2 : addr, v 05/add-to-eax 4/imm32 # if (curr >= max) abort 39/compare 3/mod/direct 0/rm32/eax . . . 2/r32/edx . . # compare eax with edx - 73/jump-if-greater-or-equal-unsigned $stream-add4:abort/disp8 + 73/jump-if-addr>= $stream-add4:abort/disp8 # *curr = val3 8b/copy 1/mod/*+disp8 5/rm32/ebp . . 1/r32/ecx 0x18/disp8 . # copy *(ebp+24) to ecx 89/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . . # copy ecx to *eax @@ -4251,7 +4251,7 @@ $num-bytes:check0: 3d/compare-eax-and 0/imm32/false # . restore result now that ZF is set 58/pop-to-eax - 75/jump-if-not-equal $num-bytes:end/disp8 + 75/jump-if-!= $num-bytes:end/disp8 $num-bytes:check-for-comment: # if (slice-starts-with?(word-slice, "#")) break # . start/edx = word-slice->start @@ -4261,7 +4261,7 @@ $num-bytes:check-for-comment: 8a/copy-byte 0/mod/indirect 2/rm32/edx . . . 3/r32/BL . . # copy byte at *edx to BL # . if (ebx == '#') break 81 7/subop/compare 3/mod/direct 3/rm32/ebx . . . . . 0x23/imm32/hash # compare ebx - 74/jump-if-equal $num-bytes:end/disp8 + 74/jump-if-= $num-bytes:end/disp8 $num-bytes:check-for-label: # if (slice-ends-with?(word-slice, ":")) break # . end/edx = word-slice->end @@ -4271,7 +4271,7 @@ $num-bytes:check-for-label: 8a/copy-byte 1/mod/*+disp8 2/rm32/edx . . . 3/r32/BL -1/disp8 . # copy byte at *ecx to BL # . if (ebx == ':') break 81 7/subop/compare 3/mod/direct 3/rm32/ebx . . . . . 0x3a/imm32/colon # compare ebx - 74/jump-if-equal $num-bytes:end/disp8 + 74/jump-if-= $num-bytes:end/disp8 $num-bytes:check-for-segment-header: # if (slice-equal?(word-slice, "==")) break # . push result @@ -4288,7 +4288,7 @@ $num-bytes:check-for-segment-header: 3d/compare-eax-and 0/imm32/false # . restore result now that ZF is set 58/pop-to-eax - 75/jump-if-not-equal $num-bytes:end/disp8 + 75/jump-if-!= $num-bytes:end/disp8 $num-bytes:loop-body: # result += compute-width-of-slice(word-slice) # . copy result to edx diff --git a/apps/tests.subx b/apps/tests.subx index 5609be0c..118e027e 100644 --- a/apps/tests.subx +++ b/apps/tests.subx @@ -33,7 +33,7 @@ Entry: # run tests if necessary, convert stdin if not # - if argc > 1 and argv[1] == "test", then return run_tests() # if (argc <= 1) goto run-main 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 0/disp8 1/imm32 # compare *ebp - 7e/jump-if-lesser-or-equal $subx-tests-main:interactive/disp8 + 7e/jump-if-<= $subx-tests-main:interactive/disp8 # if (!kernel-string-equal?(argv[1], "test")) goto run-main # . eax = kernel-string-equal?(argv[1], "test") # . . push args @@ -45,7 +45,7 @@ Entry: # run tests if necessary, convert stdin if not 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax == false) goto run-main 3d/compare-eax-and 0/imm32/false - 74/jump-if-equal $subx-tests-main:interactive/disp8 + 74/jump-if-= $subx-tests-main:interactive/disp8 # run-tests() e8/call run-tests/disp32 # syscall(exit, *Num-test-failures) @@ -160,7 +160,7 @@ $subx-gen-run-tests:loop: $subx-gen-run-tests:check0: # if (line->write == 0) break 81 7/subop/compare 0/mod/indirect 1/rm32/ecx . . . . . 0/imm32 # compare *ecx - 0f 84/jump-if-equal $subx-gen-run-tests:break/disp32 + 0f 84/jump-if-= $subx-gen-run-tests:break/disp32 # next-word(line, word-slice) # . . push args 52/push-edx @@ -180,7 +180,7 @@ $subx-gen-run-tests:check-for-label: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax == false) continue 3d/compare-eax-and 0/imm32/false - 74/jump-if-equal $subx-gen-run-tests:continue/disp8 + 74/jump-if-= $subx-gen-run-tests:continue/disp8 $subx-gen-run-tests:check-label-prefix: # strip trailing ':' from word-slice ff 1/subop/decrement 1/mod/*+disp8 2/rm32/edx . . . . 4/disp8 . # decrement *(edx+4) @@ -194,7 +194,7 @@ $subx-gen-run-tests:check-label-prefix: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax == false) break 3d/compare-eax-and 0/imm32/false - 74/jump-if-equal $subx-gen-run-tests:continue/disp8 + 74/jump-if-= $subx-gen-run-tests:continue/disp8 $subx-gen-run-tests:call-test-function: # tests-found? = true bb/copy-to-ebx 1/imm32/true @@ -243,7 +243,7 @@ $subx-gen-run-tests:continue: $subx-gen-run-tests:break: # if (!tests-found?) goto end 81 7/subop/compare 3/mod/direct 3/rm32/ebx . . . . . 0/imm32/false # compare ebx - 74/jump-if-equal $subx-gen-run-tests:end/disp8 + 74/jump-if-= $subx-gen-run-tests:end/disp8 # write(new-code-segment, " c3/return\n") # . . push args 68/push " c3/return\n"/imm32 |