From ac07e589b3e912c704c2011d543f18b16712ff15 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Sat, 29 Dec 2018 15:27:18 -0800 Subject: 4890 - new html renderings a) Switch to a light background. b) Linkify calls in .subx files. c) Keep all colorization in the Vim colorscheme, get rid of hacky special-cases in update_html. --- html/subx/052kernel_string_equal.subx.html | 145 ++++++++++++++--------------- 1 file changed, 70 insertions(+), 75 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 911a17d8..d1397093 100644 --- a/html/subx/052kernel_string_equal.subx.html +++ b/html/subx/052kernel_string_equal.subx.html @@ -7,27 +7,22 @@ - + @@ -87,16 +82,16 @@ if ('onhashchange' in window) { 22 # main: 23 e8/call run-tests/disp32 # 'run-tests' is a function created automatically by SubX. It calls all functions that start with 'test-'. 24 # syscall(exit, Num-test-failures) - 25 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/EBX Num-test-failures/disp32 # copy *Num-test-failures to EBX - 26 b8/copy-to-EAX 1/imm32 + 25 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/EBX Num-test-failures/disp32 # copy *Num-test-failures to EBX + 26 b8/copy-to-EAX 1/imm32/exit 27 cd/syscall 0x80/imm8 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 # . prolog 33 55/push-EBP - 34 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP + 34 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP 35 # . save registers 36 51/push-ECX 37 52/push-EDX @@ -119,29 +114,29 @@ if ('onhashchange' in window) { 54 # return *s1 == 0 55 # 56 # initialize s into EDI - 57 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . 7/r32/EDI 8/disp8 . # copy *(EBP+8) to EDI + 57 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 7/r32/EDI 8/disp8 . # copy *(EBP+8) to EDI 58 # initialize benchmark length n into EDX - 59 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . 2/r32/EDX 0xc/disp8 . # copy *(EBP+12) to EDX - 60 8b/copy 0/mod/indirect 2/rm32/EDX . . . 2/r32/EDX . . # copy *EDX to EDX + 59 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 2/r32/EDX 0xc/disp8 . # copy *(EBP+12) to EDX + 60 8b/copy 0/mod/indirect 2/rm32/EDX . . . 2/r32/EDX . . # copy *EDX to EDX 61 # initialize benchmark data into ESI - 62 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . 6/r32/ESI 0xc/disp8 . # copy *(EBP+12) to ESI - 63 81 0/subop/add 3/mod/direct 6/rm32/ESI . . . . . 4/imm32 # add to ESI + 62 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 0xc/disp8 . # copy *(EBP+12) to ESI + 63 81 0/subop/add 3/mod/direct 6/rm32/ESI . . . . . 4/imm32 # add to ESI 64 # initialize loop counter i into ECX 65 b9/copy-to-ECX 0/imm32/exit 66 # while (i/ECX < n/EDX) 67 $kernel-string-equal:loop: - 68 39/compare 3/mod/direct 1/rm32/ECX . . . 2/r32/EDX . . # compare ECX with EDX + 68 39/compare 3/mod/direct 1/rm32/ECX . . . 2/r32/EDX . . # compare ECX with EDX 69 74/jump-if-equal $kernel-string-equal:break/disp8 70 # c1/EAX, c2/EBX = *s, *benchmark 71 b8/copy-to-EAX 0/imm32 - 72 8a/copy 0/mod/indirect 7/rm32/EDI . . . 0/r32/EAX . . # copy byte at *EDI to lower byte of EAX + 72 8a/copy 0/mod/indirect 7/rm32/EDI . . . 0/r32/EAX . . # copy byte at *EDI to lower byte of EAX 73 bb/copy-to-EBX 0/imm32 - 74 8a/copy 0/mod/indirect 6/rm32/ESI . . . 3/r32/EBX . . # copy byte at *ESI to lower byte of EBX + 74 8a/copy 0/mod/indirect 6/rm32/ESI . . . 3/r32/EBX . . # copy byte at *ESI to lower byte of EBX 75 # if (c1 == 0) return false 76 3d/compare-EAX 0/imm32 77 74/jump-if-equal $kernel-string-equal:false/disp8 78 # if (c1 != c2) return false - 79 39/compare 3/mod/direct 0/rm32/EAX . . . 3/r32/EBX . . # compare EAX with EBX + 79 39/compare 3/mod/direct 0/rm32/EAX . . . 3/r32/EBX . . # compare EAX with EBX 80 75/jump-if-not-equal $kernel-string-equal:false/disp8 81 # ++s1, ++s2, ++i 82 41/inc-ECX @@ -152,7 +147,7 @@ if ('onhashchange' in window) { 87 $kernel-string-equal:break: 88 # if (*s/EDI == 0) return true 89 b8/copy-to-EAX 0/imm32 - 90 8a/copy 0/mod/indirect 7/rm32/EDI . . . 0/r32/EAX . . # copy byte at *EDI to lower byte of EAX + 90 8a/copy 0/mod/indirect 7/rm32/EDI . . . 0/r32/EAX . . # copy byte at *EDI to lower byte of EAX 91 3d/compare-EAX 0/imm32 92 75/jump-if-not-equal $kernel-string-equal:false/disp8 93 $kernel-string-equal:true: @@ -169,157 +164,157 @@ if ('onhashchange' in window) { 104 5a/pop-to-EDX 105 59/pop-to-ECX 106 # . epilog -107 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP +107 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP 108 5d/pop-to-EBP 109 c3/return 110 111 # - tests 112 -113 test-compare-null-kernel-string-with-empty-array: +113 test-compare-null-kernel-string-with-empty-array: 114 # EAX = kernel-string-equal(Null-kernel-string, "") 115 # . . push args 116 68/push ""/imm32 -117 68/push Null-kernel-string/imm32 +117 68/push Null-kernel-string/imm32 118 # . . call -119 e8/call kernel-string-equal/disp32 +119 e8/call kernel-string-equal/disp32 120 # . . discard args -121 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP +121 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP 122 # check-ints-equal(EAX, 1, msg) 123 # . . push args 124 68/push "F - test-compare-null-kernel-string-with-empty-array"/imm32 125 68/push 1/imm32/true 126 50/push-EAX 127 # . . call -128 e8/call check-ints-equal/disp32 +128 e8/call check-ints-equal/disp32 129 # . . discard args -130 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP +130 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP 131 c3/return 132 -133 test-compare-null-kernel-string-with-non-empty-array: +133 test-compare-null-kernel-string-with-non-empty-array: 134 # EAX = kernel-string-equal(Null-kernel-string, "Abc") 135 # . . push args 136 68/push "Abc"/imm32 -137 68/push Null-kernel-string/imm32 +137 68/push Null-kernel-string/imm32 138 # . . call -139 e8/call kernel-string-equal/disp32 +139 e8/call kernel-string-equal/disp32 140 # . . discard args -141 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP +141 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP 142 # check-ints-equal(EAX, 0, msg) 143 # . . push args 144 68/push "F - test-compare-null-kernel-string-with-non-empty-array"/imm32 145 68/push 0/imm32/false 146 50/push-EAX 147 # . . call -148 e8/call check-ints-equal/disp32 +148 e8/call check-ints-equal/disp32 149 # . . discard args -150 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP +150 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP 151 c3/return 152 -153 test-compare-kernel-string-with-equal-array: +153 test-compare-kernel-string-with-equal-array: 154 # EAX = kernel-string-equal(Abc-kernel-string, "Abc") 155 # . . push args 156 68/push "Abc"/imm32 -157 68/push Abc-kernel-string/imm32 +157 68/push Abc-kernel-string/imm32 158 # . . call -159 e8/call kernel-string-equal/disp32 +159 e8/call kernel-string-equal/disp32 160 # . . discard args -161 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP +161 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP 162 # check-ints-equal(EAX, 1, msg) 163 # . . push args 164 68/push "F - test-compare-kernel-string-with-equal-array"/imm32 165 68/push 1/imm32/true 166 50/push-EAX 167 # . . call -168 e8/call check-ints-equal/disp32 +168 e8/call check-ints-equal/disp32 169 # . . discard args -170 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP +170 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP 171 c3/return 172 -173 test-compare-kernel-string-with-inequal-array: +173 test-compare-kernel-string-with-inequal-array: 174 # EAX = kernel-string-equal(Abc-kernel-string, "Adc") 175 # . . push args 176 68/push "Adc"/imm32 -177 68/push Abc-kernel-string/imm32 +177 68/push Abc-kernel-string/imm32 178 # . . call -179 e8/call kernel-string-equal/disp32 +179 e8/call kernel-string-equal/disp32 180 # . . discard args -181 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP +181 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP 182 # check-ints-equal(EAX, 0, msg) 183 # . . push args 184 68/push "F - test-compare-kernel-string-with-equal-array"/imm32 185 68/push 0/imm32/false 186 50/push-EAX 187 # . . call -188 e8/call check-ints-equal/disp32 +188 e8/call check-ints-equal/disp32 189 # . . discard args -190 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP +190 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP 191 c3/return 192 -193 test-compare-kernel-string-with-empty-array: +193 test-compare-kernel-string-with-empty-array: 194 # EAX = kernel-string-equal(Abc-kernel-string, "") 195 # . . push args 196 68/push ""/imm32 -197 68/push Abc-kernel-string/imm32 +197 68/push Abc-kernel-string/imm32 198 # . . call -199 e8/call kernel-string-equal/disp32 +199 e8/call kernel-string-equal/disp32 200 # . . discard args -201 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP +201 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP 202 # check-ints-equal(EAX, 0, msg) 203 # . . push args 204 68/push "F - test-compare-kernel-string-with-equal-array"/imm32 205 68/push 0/imm32/false 206 50/push-EAX 207 # . . call -208 e8/call check-ints-equal/disp32 +208 e8/call check-ints-equal/disp32 209 # . . discard args -210 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP +210 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP 211 c3/return 212 -213 test-compare-kernel-string-with-shorter-array: +213 test-compare-kernel-string-with-shorter-array: 214 # EAX = kernel-string-equal(Abc-kernel-string, "Ab") 215 # . . push args 216 68/push "Ab"/imm32 -217 68/push Abc-kernel-string/imm32 +217 68/push Abc-kernel-string/imm32 218 # . . call -219 e8/call kernel-string-equal/disp32 +219 e8/call kernel-string-equal/disp32 220 # . . discard args -221 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP +221 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP 222 # check-ints-equal(EAX, 0, msg) 223 # . . push args 224 68/push "F - test-compare-kernel-string-with-shorter-array"/imm32 225 68/push 0/imm32/false 226 50/push-EAX 227 # . . call -228 e8/call check-ints-equal/disp32 +228 e8/call check-ints-equal/disp32 229 # . . discard args -230 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP +230 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP 231 c3/return 232 -233 test-compare-kernel-string-with-longer-array: +233 test-compare-kernel-string-with-longer-array: 234 # EAX = kernel-string-equal(Abc-kernel-string, "Abcd") 235 # . . push args 236 68/push "Abcd"/imm32 -237 68/push Abc-kernel-string/imm32 +237 68/push Abc-kernel-string/imm32 238 # . . call -239 e8/call kernel-string-equal/disp32 +239 e8/call kernel-string-equal/disp32 240 # . . discard args -241 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP +241 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP 242 # check-ints-equal(EAX, 0, msg) 243 # . . push args 244 68/push "F - test-compare-kernel-string-with-longer-array"/imm32 245 68/push 0/imm32/false 246 50/push-EAX 247 # . . call -248 e8/call check-ints-equal/disp32 +248 e8/call check-ints-equal/disp32 249 # . . discard args -250 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP +250 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP 251 c3/return 252 253 == data 254 -255 Null-kernel-string: +255 Null-kernel-string: 256 00/null -257 Abc-kernel-string: +257 Abc-kernel-string: 258 41/A 62/b 63/c 00/null 259 260 # . . vim:nowrap:textwidth=0 -- cgit 1.4.1-2-gfad0