From 6e181e7fd998a0d542cb531c929c905a243ea2f6 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Tue, 5 Feb 2019 23:30:12 -0800 Subject: 4953 --- html/subx/052kernel-string-equal.subx.html | 52 +++++++++++++++--------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'html/subx/052kernel-string-equal.subx.html') diff --git a/html/subx/052kernel-string-equal.subx.html b/html/subx/052kernel-string-equal.subx.html index 86926d78..55d0546b 100644 --- a/html/subx/052kernel-string-equal.subx.html +++ b/html/subx/052kernel-string-equal.subx.html @@ -90,7 +90,7 @@ if ('onhashchange' in window) { 28 29 # compare a null-terminated ascii string with a more idiomatic length-prefixed byte array 30 # reason for the name: the only place we should have null-terminated ascii strings is from commandline args - 31 kernel-string-equal: # s : null-terminated ascii string, benchmark : length-prefixed ascii string -> EAX : boolean + 31 kernel-string-equal?: # s : null-terminated ascii string, benchmark : length-prefixed ascii string -> EAX : boolean 32 # pseudocode: 33 # initialize n = b->length 34 # initialize s1 = s @@ -125,9 +125,9 @@ if ('onhashchange' in window) { 63 # initialize loop counter i into ECX 64 b9/copy-to-ECX 0/imm32/exit 65 # while (i/ECX < n/EDX) - 66 $kernel-string-equal:loop: + 66 $kernel-string-equal?:loop: 67 39/compare 3/mod/direct 1/rm32/ECX . . . 2/r32/EDX . . # compare ECX with EDX - 68 74/jump-if-equal $kernel-string-equal:break/disp8 + 68 74/jump-if-equal $kernel-string-equal?:break/disp8 69 # c1/EAX, c2/EBX = *s, *benchmark 70 b8/copy-to-EAX 0/imm32 71 8a/copy 0/mod/indirect 7/rm32/EDI . . . 0/r32/EAX . . # copy byte at *EDI to lower byte of EAX @@ -135,29 +135,29 @@ if ('onhashchange' in window) { 73 8a/copy 0/mod/indirect 6/rm32/ESI . . . 3/r32/EBX . . # copy byte at *ESI to lower byte of EBX 74 # if (c1 == 0) return false 75 3d/compare-EAX 0/imm32 - 76 74/jump-if-equal $kernel-string-equal:false/disp8 + 76 74/jump-if-equal $kernel-string-equal?:false/disp8 77 # if (c1 != c2) return false 78 39/compare 3/mod/direct 0/rm32/EAX . . . 3/r32/EBX . . # compare EAX with EBX - 79 75/jump-if-not-equal $kernel-string-equal:false/disp8 + 79 75/jump-if-not-equal $kernel-string-equal?:false/disp8 80 # ++s1, ++s2, ++i 81 41/inc-ECX 82 46/inc-ESI 83 47/inc-EDI 84 # end while - 85 eb/jump $kernel-string-equal:loop/disp8 - 86 $kernel-string-equal:break: + 85 eb/jump $kernel-string-equal?:loop/disp8 + 86 $kernel-string-equal?:break: 87 # if (*s/EDI == 0) return true 88 b8/copy-to-EAX 0/imm32 89 8a/copy 0/mod/indirect 7/rm32/EDI . . . 0/r32/EAX . . # copy byte at *EDI to lower byte of EAX 90 3d/compare-EAX 0/imm32 - 91 75/jump-if-not-equal $kernel-string-equal:false/disp8 - 92 $kernel-string-equal:true: + 91 75/jump-if-not-equal $kernel-string-equal?:false/disp8 + 92 $kernel-string-equal?:true: 93 b8/copy-to-EAX 1/imm32 - 94 eb/jump $kernel-string-equal:end/disp8 + 94 eb/jump $kernel-string-equal?:end/disp8 95 # return false - 96 $kernel-string-equal:false: + 96 $kernel-string-equal?:false: 97 b8/copy-to-EAX 0/imm32 - 98 $kernel-string-equal:end: + 98 $kernel-string-equal?:end: 99 # . restore registers 100 5f/pop-to-EDI 101 5e/pop-to-ESI @@ -172,12 +172,12 @@ if ('onhashchange' in window) { 110 # - tests 111 112 test-compare-null-kernel-string-with-empty-array: -113 # EAX = kernel-string-equal(Null-kernel-string, "") +113 # EAX = kernel-string-equal?(Null-kernel-string, "") 114 # . . push args 115 68/push ""/imm32 116 68/push Null-kernel-string/imm32 117 # . . call -118 e8/call kernel-string-equal/disp32 +118 e8/call kernel-string-equal?/disp32 119 # . . discard args 120 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP 121 # check-ints-equal(EAX, 1, msg) @@ -192,12 +192,12 @@ if ('onhashchange' in window) { 130 c3/return 131 132 test-compare-null-kernel-string-with-non-empty-array: -133 # EAX = kernel-string-equal(Null-kernel-string, "Abc") +133 # EAX = kernel-string-equal?(Null-kernel-string, "Abc") 134 # . . push args 135 68/push "Abc"/imm32 136 68/push Null-kernel-string/imm32 137 # . . call -138 e8/call kernel-string-equal/disp32 +138 e8/call kernel-string-equal?/disp32 139 # . . discard args 140 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP 141 # check-ints-equal(EAX, 0, msg) @@ -212,12 +212,12 @@ if ('onhashchange' in window) { 150 c3/return 151 152 test-compare-kernel-string-with-equal-array: -153 # EAX = kernel-string-equal(_test-Abc-kernel-string, "Abc") +153 # EAX = kernel-string-equal?(_test-Abc-kernel-string, "Abc") 154 # . . push args 155 68/push "Abc"/imm32 156 68/push _test-Abc-kernel-string/imm32 157 # . . call -158 e8/call kernel-string-equal/disp32 +158 e8/call kernel-string-equal?/disp32 159 # . . discard args 160 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP 161 # check-ints-equal(EAX, 1, msg) @@ -232,12 +232,12 @@ if ('onhashchange' in window) { 170 c3/return 171 172 test-compare-kernel-string-with-inequal-array: -173 # EAX = kernel-string-equal(_test-Abc-kernel-string, "Adc") +173 # EAX = kernel-string-equal?(_test-Abc-kernel-string, "Adc") 174 # . . push args 175 68/push "Adc"/imm32 176 68/push _test-Abc-kernel-string/imm32 177 # . . call -178 e8/call kernel-string-equal/disp32 +178 e8/call kernel-string-equal?/disp32 179 # . . discard args 180 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP 181 # check-ints-equal(EAX, 0, msg) @@ -252,12 +252,12 @@ if ('onhashchange' in window) { 190 c3/return 191 192 test-compare-kernel-string-with-empty-array: -193 # EAX = kernel-string-equal(_test-Abc-kernel-string, "") +193 # EAX = kernel-string-equal?(_test-Abc-kernel-string, "") 194 # . . push args 195 68/push ""/imm32 196 68/push _test-Abc-kernel-string/imm32 197 # . . call -198 e8/call kernel-string-equal/disp32 +198 e8/call kernel-string-equal?/disp32 199 # . . discard args 200 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP 201 # check-ints-equal(EAX, 0, msg) @@ -272,12 +272,12 @@ if ('onhashchange' in window) { 210 c3/return 211 212 test-compare-kernel-string-with-shorter-array: -213 # EAX = kernel-string-equal(_test-Abc-kernel-string, "Ab") +213 # EAX = kernel-string-equal?(_test-Abc-kernel-string, "Ab") 214 # . . push args 215 68/push "Ab"/imm32 216 68/push _test-Abc-kernel-string/imm32 217 # . . call -218 e8/call kernel-string-equal/disp32 +218 e8/call kernel-string-equal?/disp32 219 # . . discard args 220 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP 221 # check-ints-equal(EAX, 0, msg) @@ -292,12 +292,12 @@ if ('onhashchange' in window) { 230 c3/return 231 232 test-compare-kernel-string-with-longer-array: -233 # EAX = kernel-string-equal(_test-Abc-kernel-string, "Abcd") +233 # EAX = kernel-string-equal?(_test-Abc-kernel-string, "Abcd") 234 # . . push args 235 68/push "Abcd"/imm32 236 68/push _test-Abc-kernel-string/imm32 237 # . . call -238 e8/call kernel-string-equal/disp32 +238 e8/call kernel-string-equal?/disp32 239 # . . discard args 240 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP 241 # check-ints-equal(EAX, 0, msg) -- cgit 1.4.1-2-gfad0