diff options
author | Kartik Agaram <vc@akkartik.com> | 2020-01-16 18:31:12 -0800 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2020-01-16 18:31:12 -0800 |
commit | 6070c23e5e1c60d3bb169e43bddfa59b1d322427 (patch) | |
tree | 9a70e378c33c15e4779cf94abda8f37c35a5d1da /apps/ex11.subx | |
parent | 5a6601aba973ba1d1ef30b7b64438c25623b89c5 (diff) | |
download | mu-6070c23e5e1c60d3bb169e43bddfa59b1d322427.tar.gz |
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.
Diffstat (limited to 'apps/ex11.subx')
-rw-r--r-- | apps/ex11.subx | 8 |
1 files changed, 4 insertions, 4 deletions
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 |