diff options
author | Kartik Agaram <vc@akkartik.com> | 2019-02-14 16:49:10 -0800 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2019-02-14 16:49:10 -0800 |
commit | 833152354e906bee0721e02995f186c1948d72f1 (patch) | |
tree | dfd871de43c7e49771734143b3f501a8a74c4b8a /subx | |
parent | 1e43ba2b741e2d59779bbaa0b8919d8c1496e024 (diff) | |
download | mu-833152354e906bee0721e02995f186c1948d72f1.tar.gz |
4963
Diffstat (limited to 'subx')
-rw-r--r-- | subx/052kernel-string-equal.subx | 6 | ||||
-rw-r--r-- | subx/examples/ex10.subx | 4 | ||||
-rw-r--r-- | subx/examples/ex11.subx | 6 | ||||
-rw-r--r-- | subx/examples/ex8.subx | 2 |
4 files changed, 9 insertions, 9 deletions
diff --git a/subx/052kernel-string-equal.subx b/subx/052kernel-string-equal.subx index 840b4460..47e1e296 100644 --- a/subx/052kernel-string-equal.subx +++ b/subx/052kernel-string-equal.subx @@ -76,9 +76,9 @@ $kernel-string-equal?:loop: 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 # c1 = *s1 - 8a/copy 0/mod/indirect 7/rm32/EDI . . . 0/r32/EAX . . # copy byte at *EDI to lower byte of EAX + 8a/copy-byte 0/mod/indirect 7/rm32/EDI . . . 0/r32/AL . . # copy byte at *EDI to AL # c2 = *s2 - 8a/copy 0/mod/indirect 6/rm32/ESI . . . 3/r32/EBX . . # copy byte at *ESI to lower byte of EBX + 8a/copy-byte 0/mod/indirect 6/rm32/ESI . . . 3/r32/BL . . # copy byte at *ESI to BL # if (c1 == 0) return false 3d/compare-EAX 0/imm32 74/jump-if-equal $kernel-string-equal?:false/disp8 @@ -94,7 +94,7 @@ $kernel-string-equal?:loop: eb/jump $kernel-string-equal?:loop/disp8 $kernel-string-equal?:break: # return *s1 == 0 - 8a/copy 0/mod/indirect 7/rm32/EDI . . . 0/r32/EAX . . # copy byte at *EDI to lower byte of EAX + 8a/copy-byte 0/mod/indirect 7/rm32/EDI . . . 0/r32/AL . . # copy byte at *EDI to AL 3d/compare-EAX 0/imm32 75/jump-if-not-equal $kernel-string-equal?:false/disp8 $kernel-string-equal?:true: diff --git a/subx/examples/ex10.subx b/subx/examples/ex10.subx index 07b5b4bb..7e37a54b 100644 --- a/subx/examples/ex10.subx +++ b/subx/examples/ex10.subx @@ -41,9 +41,9 @@ argv-equal: # (s1, s2) : null-terminated ascii strings -> EAX : boolean $argv-equal:loop: # c1/EAX, c2/EBX = *s1, *s2 b8/copy-to-EAX 0/imm32 - 8a/copy 0/mod/indirect 1/rm32/ECX . . . 0/r32/EAX . . # copy byte at *ECX to lower byte of EAX + 8a/copy-byte 0/mod/indirect 1/rm32/ECX . . . 0/r32/AL . . # copy byte at *ECX to AL bb/copy-to-EBX 0/imm32 - 8a/copy 0/mod/indirect 2/rm32/EDX . . . 3/r32/EBX . . # copy byte at *EDX to lower byte of EBX + 8a/copy-byte 0/mod/indirect 2/rm32/EDX . . . 3/r32/BL . . # copy byte at *EDX to BL # if (c1 == 0) break 3d/compare-EAX 0/imm32 74/jump-if-equal $argv-equal:break/disp8 diff --git a/subx/examples/ex11.subx b/subx/examples/ex11.subx index 49e0c753..bb3c8e23 100644 --- a/subx/examples/ex11.subx +++ b/subx/examples/ex11.subx @@ -76,9 +76,9 @@ $kernel-string-equal?:loop: 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 # c1 = *s1 - 8a/copy 0/mod/indirect 7/rm32/EDI . . . 0/r32/EAX . . # copy byte at *EDI to lower byte of EAX + 8a/copy-byte 0/mod/indirect 7/rm32/EDI . . . 0/r32/AL . . # copy byte at *EDI to AL # c2 = *s2 - 8a/copy 0/mod/indirect 6/rm32/ESI . . . 3/r32/EBX . . # copy byte at *ESI to lower byte of EBX + 8a/copy-byte 0/mod/indirect 6/rm32/ESI . . . 3/r32/BL . . # copy byte at *ESI to BL # if (c1 == 0) return false 3d/compare-EAX 0/imm32 74/jump-if-equal $kernel-string-equal?:false/disp8 @@ -94,7 +94,7 @@ $kernel-string-equal?:loop: eb/jump $kernel-string-equal?:loop/disp8 $kernel-string-equal?:break: # return *s1 == 0 - 8a/copy 0/mod/indirect 7/rm32/EDI . . . 0/r32/EAX . . # copy byte at *EDI to lower byte of EAX + 8a/copy-byte 0/mod/indirect 7/rm32/EDI . . . 0/r32/AL . . # copy byte at *EDI to AL 3d/compare-EAX 0/imm32 75/jump-if-not-equal $kernel-string-equal?:false/disp8 $kernel-string-equal?:true: diff --git a/subx/examples/ex8.subx b/subx/examples/ex8.subx index f45813ec..c7c51c91 100644 --- a/subx/examples/ex8.subx +++ b/subx/examples/ex8.subx @@ -41,7 +41,7 @@ ascii-length: # s : (address array byte) -> n/EAX b8/copy-to-EAX 0/imm32 $ascii-length-loop: # var c/ECX = *s - 8a/copy 0/mod/* 2/rm32/EDX . . . 1/r32/ECX . . # copy byte at *EDX to lower byte of ECX + 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-ret/disp8 |