From 6070c23e5e1c60d3bb169e43bddfa59b1d322427 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Thu, 16 Jan 2020 18:31:12 -0800 Subject: 5897 - rename comparison instructions Signed and unsigned don't quite capture the essence of what the different combinations of x86 flags are doing for SubX. The crucial distinction is that one set of comparison operators is for integers and the second is for addresses. --- html/apps/calls.subx.html | 50 +++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'html/apps/calls.subx.html') diff --git a/html/apps/calls.subx.html b/html/apps/calls.subx.html index 2513b344..0f1f352d 100644 --- a/html/apps/calls.subx.html +++ b/html/apps/calls.subx.html @@ -102,7 +102,7 @@ if ('onhashchange' in window) { 41 # - if argc > 1 and argv[1] == "test", then return run_tests() 42 # if (argc <= 1) goto run-main 43 81 7/subop/compare *ebp 1/imm32 - 44 7e/jump-if-lesser-or-equal $subx-calls-main:interactive/disp8 + 44 7e/jump-if-<= $subx-calls-main:interactive/disp8 45 # if (!kernel-string-equal?(argv[1], "test")) goto run-main 46 # . eax = kernel-string-equal?(argv[1], "test") 47 # . . push args @@ -114,7 +114,7 @@ if ('onhashchange' in window) { 53 81 0/subop/add %esp 8/imm32 54 # . if (eax == false) goto run-main 55 3d/compare-eax-and 0/imm32/false - 56 74/jump-if-equal $subx-calls-main:interactive/disp8 + 56 74/jump-if-= $subx-calls-main:interactive/disp8 57 # run-tests() 58 e8/call run-tests/disp32 59 # syscall(exit, *Num-test-failures) @@ -197,7 +197,7 @@ if ('onhashchange' in window) { 136 $subx-calls:check0: 137 # if (line->write == 0) break 138 81 7/subop/compare *esi 0/imm32 - 139 0f 84/jump-if-equal $subx-calls:break/disp32 + 139 0f 84/jump-if-= $subx-calls:break/disp32 140 # skip-chars-matching-whitespace(line) 141 # . . push args 142 56/push-esi @@ -213,7 +213,7 @@ if ('onhashchange' in window) { 152 8a/copy-byte *(esi+ecx+0xc) 0/r32/AL 153 # . if (eax == '(') goto convert-call 154 3d/compare-eax-and 0x28/imm32/open-paren - 155 74/jump-if-equal $subx-calls:convert-call/disp8 + 155 74/jump-if-= $subx-calls:convert-call/disp8 156 $subx-calls:pass-through: 157 # write-stream-data(out, line) 158 # . . push args @@ -331,7 +331,7 @@ if ('onhashchange' in window) { 270 81 0/subop/add %esp 4/imm32 271 # . if (eax != false) break 272 3d/compare-eax-and 0/imm32/false - 273 0f 85/jump-if-not-equal $parse-line:end/disp32 + 273 0f 85/jump-if-!= $parse-line:end/disp32 274 +-- 40 lines: #? # dump word-slice ----------------------------------------------------------------------------------------------------------------------- 314 $parse-line:write-word: 315 # write-int(words, word-slice->start) @@ -402,7 +402,7 @@ if ('onhashchange' in window) { 380 # . ecx = words->write - 8 381 8b/-> *esi 1/r32/ecx 382 81 5/subop/subtract %ecx 8/imm32 - 383 0f 8c/jump-if-lesser $emit-call:error1/disp32 + 383 0f 8c/jump-if-< $emit-call:error1/disp32 384 # var curr/ecx : (addr slice) = &words->data[words->write-8] 385 8d/copy-address *(esi+ecx+0xc) 1/r32/ecx 386 # var min/edx : (addr byte) = words->data @@ -411,7 +411,7 @@ if ('onhashchange' in window) { 389 $emit-call:push-loop: 390 # if (curr <= min) break 391 39/compare %ecx 2/r32/edx - 392 0f 8e/jump-if-lesser-or-equal $emit-call:call-instruction/disp32 + 392 0f 8e/jump-if-<= $emit-call:call-instruction/disp32 393 # if (*curr->start in '%' '*') goto push-rm32 394 # . var start/eax : (addr byte) = curr->start 395 8b/-> *ecx 0/r32/eax @@ -420,10 +420,10 @@ if ('onhashchange' in window) { 398 81 4/subop/and %eax 0xff/imm32 399 # . if (c == '%') goto push-rm32 400 3d/compare-eax-and 0x25/imm32/percent - 401 74/jump-if-equal $emit-call:push-rm32/disp8 + 401 74/jump-if-= $emit-call:push-rm32/disp8 402 # . if (c == '*') goto push-rm32 403 3d/compare-eax-and 0x2a/imm32/asterisk - 404 74/jump-if-equal $emit-call:push-rm32/disp8 + 404 74/jump-if-= $emit-call:push-rm32/disp8 405 $emit-call:push-imm32: 406 # write-buffered(out, "68/push ") 407 68/push "68/push "/imm32 @@ -814,7 +814,7 @@ if ('onhashchange' in window) { 824 8b/-> *(esi+4) 1/r32/ecx 825 # . if (ecx >= line->write) return out = {0, 0} 826 3b/compare 1/r32/ecx *esi - 827 0f 8d/jump-if-greater-or-equal $next-word-string-or-expression-without-metadata:return-eol/disp32 + 827 0f 8d/jump-if->= $next-word-string-or-expression-without-metadata:return-eol/disp32 828 $next-word-string-or-expression-without-metadata:check-for-comment: 829 # out->start = &line->data[line->read] 830 8d/copy-address *(esi+ecx+0xc) 0/r32/eax @@ -825,7 +825,7 @@ if ('onhashchange' in window) { 835 8a/copy-byte *(esi+ecx+0xc) 0/r32/AL 836 # . if (eax != '#') goto next check 837 3d/compare-eax-and 0x23/imm32/pound - 838 75/jump-if-not-equal $next-word-string-or-expression-without-metadata:check-for-string-literal/disp8 + 838 75/jump-if-!= $next-word-string-or-expression-without-metadata:check-for-string-literal/disp8 839 $next-word-string-or-expression-without-metadata:comment: 840 # out->end = &line->data[line->write] 841 8b/-> *esi 0/r32/eax @@ -839,7 +839,7 @@ if ('onhashchange' in window) { 849 $next-word-string-or-expression-without-metadata:check-for-string-literal: 850 # if (line->data[line->read] != '"') goto next check 851 3d/compare-eax-and 0x22/imm32/dquote - 852 75/jump-if-not-equal $next-word-string-or-expression-without-metadata:check-for-expression/disp8 + 852 75/jump-if-!= $next-word-string-or-expression-without-metadata:check-for-expression/disp8 853 $next-word-string-or-expression-without-metadata:string-literal: 854 # skip-string(line) 855 # . . push args @@ -857,14 +857,14 @@ if ('onhashchange' in window) { 867 $next-word-string-or-expression-without-metadata:check-for-expression: 868 # if (line->data[line->read] != '*') goto next check 869 3d/compare-eax-and 0x2a/imm32/asterisk - 870 75/jump-if-not-equal $next-word-string-or-expression-without-metadata:check-for-end-of-call/disp8 + 870 75/jump-if-!= $next-word-string-or-expression-without-metadata:check-for-end-of-call/disp8 871 # if (line->data[line->read + 1] == ' ') goto error1 872 8a/copy-byte *(esi+ecx+0xd) 0/r32/AL 873 3d/compare-eax-and 0x20/imm32/space - 874 0f 84/jump-if-equal $next-word-string-or-expression-without-metadata:error1/disp32 + 874 0f 84/jump-if-= $next-word-string-or-expression-without-metadata:error1/disp32 875 # if (line->data[line->read + 1] != '(') goto regular-word 876 3d/compare-eax-and 0x28/imm32/open-paren - 877 0f 85/jump-if-not-equal $next-word-string-or-expression-without-metadata:regular-word-without-metadata/disp32 + 877 0f 85/jump-if-!= $next-word-string-or-expression-without-metadata:regular-word-without-metadata/disp32 878 $next-word-string-or-expression-without-metadata:paren: 879 # skip-until-close-paren(line) 880 # . . push args @@ -879,7 +879,7 @@ if ('onhashchange' in window) { 889 8a/copy-byte *(esi+ecx+0xc) 0/r32/AL 890 # . if (eax != ')') goto error2 891 3d/compare-eax-and 0x29/imm32/close-paren - 892 0f 85/jump-if-not-equal $next-word-string-or-expression-without-metadata:error2/disp32 + 892 0f 85/jump-if-!= $next-word-string-or-expression-without-metadata:error2/disp32 893 # ++line->read to skip ')' 894 ff 0/subop/increment *(esi+4) 895 # out->end = &line->data[line->read] @@ -891,7 +891,7 @@ if ('onhashchange' in window) { 901 $next-word-string-or-expression-without-metadata:check-for-end-of-call: 902 # if (line->data[line->read] != ')') goto next check 903 3d/compare-eax-and 0x29/imm32/close-paren - 904 75/jump-if-not-equal $next-word-string-or-expression-without-metadata:regular-word-without-metadata/disp8 + 904 75/jump-if-!= $next-word-string-or-expression-without-metadata:regular-word-without-metadata/disp8 905 # ++line->read to skip ')' 906 ff 0/subop/increment *(esi+4) 907 # - error checking: make sure there's nothing else of importance on the line @@ -900,13 +900,13 @@ if ('onhashchange' in window) { 910 8b/-> *(esi+4) 1/r32/ecx 911 # . if (ecx >= line->write) return {0, 0} 912 3b/compare 1/r32/ecx *esi - 913 0f 8d/jump-if-greater-or-equal $next-word-string-or-expression-without-metadata:return-eol/disp32 + 913 0f 8d/jump-if->= $next-word-string-or-expression-without-metadata:return-eol/disp32 914 # if (line->data[line->read] == '/') goto error3 915 # . eax = line->data[line->read] 916 8a/copy-byte *(esi+ecx+0xc) 0/r32/AL 917 # . if (eax == '/') goto error3 918 3d/compare-eax-and 0x2f/imm32/slash - 919 0f 84/jump-if-equal $next-word-string-or-expression-without-metadata:error3/disp32 + 919 0f 84/jump-if-= $next-word-string-or-expression-without-metadata:error3/disp32 920 # skip-chars-matching-whitespace(line) 921 # . . push args 922 56/push-esi @@ -919,14 +919,14 @@ if ('onhashchange' in window) { 929 8b/-> *(esi+4) 1/r32/ecx 930 # . if (ecx >= line->write) return {0, 0} 931 3b/compare 1/r32/ecx *esi - 932 0f 8d/jump-if-greater-or-equal $next-word-string-or-expression-without-metadata:return-eol/disp32 + 932 0f 8d/jump-if->= $next-word-string-or-expression-without-metadata:return-eol/disp32 933 # if (line->data[line->read] == '#') return out = {0, 0} 934 # . eax = line->data[line->read] 935 8b/-> *(esi+4) 1/r32/ecx 936 8a/copy-byte *(esi+ecx+0xc) 0/r32/AL 937 # . if (eax == '#') return out = {0, 0} 938 3d/compare-eax-and 0x23/imm32/pound - 939 74/jump-if-equal $next-word-string-or-expression-without-metadata:return-eol/disp8 + 939 74/jump-if-= $next-word-string-or-expression-without-metadata:return-eol/disp8 940 # otherwise goto error4 941 e9/jump $next-word-string-or-expression-without-metadata:error4/disp32 942 $next-word-string-or-expression-without-metadata:regular-word-without-metadata: @@ -935,20 +935,20 @@ if ('onhashchange' in window) { 945 8b/-> *(esi+4) 1/r32/ecx 946 # . if (ecx >= line->write) break 947 3b/compare *esi 1/r32/ecx - 948 7d/jump-if-greater-or-equal $next-word-string-or-expression-without-metadata:regular-word-break/disp8 + 948 7d/jump-if->= $next-word-string-or-expression-without-metadata:regular-word-break/disp8 949 # if (line->data[line->read] == ' ') break 950 # . eax = line->data[line->read] 951 8b/-> *(esi+4) 1/r32/ecx 952 8a/copy-byte *(esi+ecx+0xc) 0/r32/AL 953 # . if (eax == ' ') break 954 3d/compare-eax-and 0x20/imm32/space - 955 74/jump-if-equal $next-word-string-or-expression-without-metadata:regular-word-break/disp8 + 955 74/jump-if-= $next-word-string-or-expression-without-metadata:regular-word-break/disp8 956 # if (line->data[line->read] == ')') break 957 3d/compare-eax-and 0x29/imm32/close-paren - 958 0f 84/jump-if-equal $next-word-string-or-expression-without-metadata:regular-word-break/disp32 + 958 0f 84/jump-if-= $next-word-string-or-expression-without-metadata:regular-word-break/disp32 959 # if (line->data[line->read] == '/') goto error5 960 3d/compare-eax-and 0x2f/imm32/slash - 961 0f 84/jump-if-equal $next-word-string-or-expression-without-metadata:error5/disp32 + 961 0f 84/jump-if-= $next-word-string-or-expression-without-metadata:error5/disp32 962 # ++line->read 963 ff 0/subop/increment *(esi+4) 964 # loop -- cgit 1.4.1-2-gfad0