From 075354cd175fdf0c778fdf09b0d26fae5c8e959a Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Sat, 31 Aug 2019 23:56:24 -0700 Subject: 5601 --- html/apps/sigils.subx.html | 136 ++++++++++++++++++++++----------------------- 1 file changed, 68 insertions(+), 68 deletions(-) (limited to 'html/apps') diff --git a/html/apps/sigils.subx.html b/html/apps/sigils.subx.html index f16c8ee1..80e936c6 100644 --- a/html/apps/sigils.subx.html +++ b/html/apps/sigils.subx.html @@ -1114,19 +1114,19 @@ if ('onhashchange' in window) { 1272 5d/pop-to-ebp 1273 c3/return 1274 -1275 # BEWARE: modifies 'word' -1276 emit-direct-mode: # word : (address slice), out : (address buffered-file) +1275 # BEWARE: modifies 'word-slice' +1276 emit-direct-mode: # word-slice : (address slice), out : (address buffered-file) 1277 # . prolog 1278 55/push-ebp 1279 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp 1280 # . save registers 1281 50/push-eax -1282 # ++word->start -1283 # . eax = word +1282 # ++word-slice->start +1283 # . eax = word-slice 1284 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 0/r32/eax 8/disp8 . # copy *(ebp+8) to eax 1285 # . ++(*eax) 1286 ff 0/subop/increment 0/mod/indirect 0/rm32/eax . . . . . . # increment *eax -1287 # word = next-token-from-slice(word->start, word->end, "/") +1287 # word-slice = next-token-from-slice(word-slice->start, word-slice->end, "/") 1288 # . . push args 1289 50/push-eax 1290 68/push 0x2f/imm32/slash @@ -1136,7 +1136,7 @@ if ('onhashchange' in window) { 1294 e8/call next-token-from-slice/disp32 1295 # . . discard args 1296 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32 # add to esp -1297 # reg-num/eax = get-slice(Registers, word, row-size=8) +1297 # reg-num/eax = get-slice(Registers, word-slice, row-size=8) 1298 # . . push args 1299 68/push "Registers"/imm32 1300 68/push 8/imm32/row-size @@ -1897,52 +1897,52 @@ if ('onhashchange' in window) { 2105 # *(reg1+reg2<<s+disp) -> 2/mod 4/rm32 reg1/base reg2/index s/scale disp/disp32 2106 # Intermediate structure: base, index, scale, disp 2107 # Default values: base: 0, index: 4 (none), scale: 0, disp: 0 -2108 # BEWARE: modifies 'word' -2109 parse-effective-address: # word : (address slice) -> base/eax, index/ecx, scale/edx, disp/ebx +2108 # BEWARE: modifies 'word-slice' +2109 parse-effective-address: # word-slice : (address slice) -> base/eax, index/ecx, scale/edx, disp/ebx 2110 # pseudocode: -2111 # ++word->start to skip '*' +2111 # ++word-slice->start to skip '*' 2112 # initialize defaults: base=0, index=4, scale=0, disp=0 -2113 # if (*word->start != '(') { -2114 # word = next-token-from-slice(word->start, word->end, "/") -2115 # base = get-slice(Registers, word, row-size=8) +2113 # if (*word-slice->start != '(') { +2114 # word-slice = next-token-from-slice(word-slice->start, word-slice->end, "/") +2115 # base = get-slice(Registers, word-slice, row-size=8) 2116 # return 2117 # } 2118 # # compound expressions 2119 # skip whitespace 2120 # read register into base 2121 # skip whitespace -2122 # if (*word->start == ')') goto end -2123 # if (*word->start == '-') goto displacement -2124 # if (*word->start != '+') goto error1 -2125 # ++word->start to skip '+' +2122 # if (*word-slice->start == ')') goto end +2123 # if (*word-slice->start == '-') goto displacement +2124 # if (*word-slice->start != '+') goto error1 +2125 # ++word-slice->start to skip '+' 2126 # skip whitespace 2127 # if next 3 characters don't make a register, goto displacement 2128 # read register into index 2129 # skip whitespace -2130 # if (*word->start == ')') goto end -2131 # if (*word->start == '<') { -2132 # ++word->start to skip '<' -2133 # if (*word->start != '<') goto error2 -2134 # ++word->start to skip '<' +2130 # if (*word-slice->start == ')') goto end +2131 # if (*word-slice->start == '<') { +2132 # ++word-slice->start to skip '<' +2133 # if (*word-slice->start != '<') goto error2 +2134 # ++word-slice->start to skip '<' 2135 # skip whitespace 2136 # read integer into scale 2137 # skip whitespace -2138 # if (*word->start == ')') goto end +2138 # if (*word-slice->start == ')') goto end 2139 # } -2140 # if (*word->start not in '+' '-') goto error3 +2140 # if (*word-slice->start not in '+' '-') goto error3 2141 # displacement: 2142 # read integer into disp 2143 # skip whitespace -2144 # if (*word->start != ')') goto error4 +2144 # if (*word-slice->start != ')') goto error4 2145 # . prolog 2146 55/push-ebp 2147 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp 2148 # . save registers 2149 56/push-esi 2150 57/push-edi -2151 # esi = word +2151 # esi = word-slice 2152 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 . # copy *(ebp+8) to esi -2153 # ++word->start to skip '*' +2153 # ++word-slice->start to skip '*' 2154 ff 0/subop/increment 0/mod/indirect 6/rm32/esi . . . . . . # increment *esi 2155 # initialize defaults 2156 # base is in edi; we'll move it to eax just before we return @@ -1951,14 +1951,14 @@ if ('onhashchange' in window) { 2159 ba/copy-to-edx 0/imm32/.scale 2160 bb/copy-to-ebx 0/imm32/disp 2161 $parse-effective-address:check-for-simple-register: -2162 # if (*word->start == '(') goto compound expression +2162 # if (*word-slice->start == '(') goto compound expression 2163 8b/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . . # copy *esi to eax 2164 8a/copy-byte 0/mod/indirect 0/rm32/eax . . . 0/r32/AL . . # copy byte at *eax to AL 2165 81 4/subop/and 3/mod/direct 0/rm32/eax . . . . . 0xff/imm32 # bitwise and of eax 2166 3d/compare-eax-and 0x28/imm32/open-paren 2167 74/jump-if-equal $parse-effective-address:compound-expression/disp8 2168 $parse-effective-address:simple-register: -2169 # word = next-token-from-slice(word->start, word->end, "/") +2169 # word-slice = next-token-from-slice(word-slice->start, word-slice->end, "/") 2170 # . . push args 2171 56/push-esi 2172 68/push 0x2f/imm32/slash @@ -1968,8 +1968,8 @@ if ('onhashchange' in window) { 2176 e8/call next-token-from-slice/disp32 2177 # . . discard args 2178 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32 # add to esp -2179 # base = get-slice(Registers, word, row-size=8) -2180 # . eax = get-slice(Registers, word, row-size=8) +2179 # base = get-slice(Registers, word-slice, row-size=8) +2180 # . eax = get-slice(Registers, word-slice, row-size=8) 2181 # . . push args 2182 68/push "Registers"/imm32 2183 68/push 8/imm32/row-size @@ -1984,10 +1984,10 @@ if ('onhashchange' in window) { 2192 # return 2193 e9/jump $parse-effective-address:end/disp32 2194 $parse-effective-address:compound-expression: -2195 # ++word->start to skip '(' +2195 # ++word-slice->start to skip '(' 2196 ff 0/subop/increment 0/mod/indirect 6/rm32/esi . . . . . . # increment *esi 2197 # skip whitespace -2198 # . eax = skip-chars-matching-whitespace-in-slice(word->start, word->end) +2198 # . eax = skip-chars-matching-whitespace-in-slice(word-slice->start, word-slice->end) 2199 # . . push args 2200 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 . # push *(esi+4) 2201 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . . # push *esi @@ -1995,10 +1995,10 @@ if ('onhashchange' in window) { 2203 e8/call skip-chars-matching-whitespace-in-slice/disp32 2204 # . . discard args 2205 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp -2206 # . word->start = eax +2206 # . word-slice->start = eax 2207 89/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . . # copy eax to *esi 2208 # read register into base -2209 # . eax = next-register(word) +2209 # . eax = next-register(word-slice) 2210 # . . push args 2211 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 2212 # . . call @@ -2008,7 +2008,7 @@ if ('onhashchange' in window) { 2216 # . edi = *eax 2217 8b/copy 0/mod/indirect 0/rm32/eax . . . 7/r32/edi . . # copy *eax to edi 2218 # skip whitespace -2219 # . eax = skip-chars-matching-whitespace-in-slice(word->start, word->end) +2219 # . eax = skip-chars-matching-whitespace-in-slice(word-slice->start, word-slice->end) 2220 # . . push args 2221 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 . # push *(esi+4) 2222 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . . # push *esi @@ -2016,24 +2016,24 @@ if ('onhashchange' in window) { 2224 e8/call skip-chars-matching-whitespace-in-slice/disp32 2225 # . . discard args 2226 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp -2227 # . word->start = eax +2227 # . word-slice->start = eax 2228 89/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . . # copy eax to *esi -2229 # if (*word->start == ')') goto end +2229 # if (*word-slice->start == ')') goto end 2230 8a/copy-byte 0/mod/indirect 0/rm32/eax . . . 0/r32/AL . . # copy byte at *eax to AL 2231 81 4/subop/and 3/mod/direct 0/rm32/eax . . . . . 0xff/imm32 # bitwise and of eax 2232 3d/compare-eax-and 0x29/imm32/close-paren 2233 0f 84/jump-if-equal $parse-effective-address:end/disp32 -2234 # if (*word->start == '-') goto displacement +2234 # if (*word-slice->start == '-') goto displacement 2235 3d/compare-eax-and 0x2d/imm32/minus 2236 0f 84/jump-if-equal $parse-effective-address:displacement/disp32 -2237 # if (*word->start != '+') goto error1 +2237 # if (*word-slice->start != '+') goto error1 2238 3d/compare-eax-and 0x2b/imm32/plus 2239 0f 85/jump-if-not-equal $parse-effective-address:error1/disp32 2240 $parse-effective-address:check-for-index: -2241 # ++word->start to skip '+' +2241 # ++word-slice->start to skip '+' 2242 ff 0/subop/increment 0/mod/indirect 6/rm32/esi . . . . . . # increment *esi 2243 # skip whitespace -2244 # . eax = skip-chars-matching-whitespace-in-slice(word->start, word->end) +2244 # . eax = skip-chars-matching-whitespace-in-slice(word-slice->start, word-slice->end) 2245 # . . push args 2246 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 . # push *(esi+4) 2247 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . . # push *esi @@ -2041,16 +2041,16 @@ if ('onhashchange' in window) { 2249 e8/call skip-chars-matching-whitespace-in-slice/disp32 2250 # . . discard args 2251 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp -2252 # . word->start = eax +2252 # . word-slice->start = eax 2253 89/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . . # copy eax to *esi 2254 $parse-effective-address:resolve-ambiguity: 2255 # if next 3 characters don't make a register, goto displacement 2256 # . spill ecx 2257 51/push-ecx -2258 # . var tmp/ecx = {word->start, word->start+3} -2259 # . . ecx = word->start +2258 # . var tmp/ecx = {word-slice->start, word-slice->start+3} +2259 # . . ecx = word-slice->start 2260 89/copy 3/mod/direct 1/rm32/ecx . . . 0/r32/eax . . # copy eax to ecx -2261 # . . eax = word->start+3 +2261 # . . eax = word-slice->start+3 2262 05/add-to-eax 3/imm32 2263 # . . push 2264 50/push-eax @@ -2075,7 +2075,7 @@ if ('onhashchange' in window) { 2283 0f 84/jump-if-equal $parse-effective-address:displacement/disp32 2284 $parse-effective-address:index: 2285 # read register into index -2286 # . eax = next-register(word) +2286 # . eax = next-register(word-slice) 2287 # . . push args 2288 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 2289 # . . call @@ -2085,7 +2085,7 @@ if ('onhashchange' in window) { 2293 # . ecx = *eax 2294 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . . # copy *eax to ecx 2295 # skip whitespace -2296 # . eax = skip-chars-matching-whitespace-in-slice(word->start, word->end) +2296 # . eax = skip-chars-matching-whitespace-in-slice(word-slice->start, word-slice->end) 2297 # . . push args 2298 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 . # push *(esi+4) 2299 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . . # push *esi @@ -2093,29 +2093,29 @@ if ('onhashchange' in window) { 2301 e8/call skip-chars-matching-whitespace-in-slice/disp32 2302 # . . discard args 2303 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp -2304 # . word->start = eax +2304 # . word-slice->start = eax 2305 89/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . . # copy eax to *esi -2306 # if (*word->start == ')') goto end +2306 # if (*word-slice->start == ')') goto end 2307 8a/copy-byte 0/mod/indirect 0/rm32/eax . . . 0/r32/AL . . # copy byte at *eax to AL 2308 81 4/subop/and 3/mod/direct 0/rm32/eax . . . . . 0xff/imm32 # bitwise and of eax 2309 3d/compare-eax-and 0x29/imm32/close-paren 2310 0f 84/jump-if-equal $parse-effective-address:end/disp32 2311 $parse-effective-address:check-for-scale: -2312 # if (*word->start != '<') goto next check +2312 # if (*word-slice->start != '<') goto next check 2313 3d/compare-eax-and 0x3c/imm32/less-than 2314 75/jump-if-not-equal $parse-effective-address:check-for-displacement/disp8 -2315 # ++word->start to skip '<' +2315 # ++word-slice->start to skip '<' 2316 ff 0/subop/increment 0/mod/indirect 6/rm32/esi . . . . . . # increment *esi -2317 # if (*word->start != '<') goto error2 +2317 # if (*word-slice->start != '<') goto error2 2318 8b/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . . # copy *esi to eax 2319 8a/copy-byte 0/mod/indirect 0/rm32/eax . . . 0/r32/AL . . # copy byte at *eax to AL 2320 81 4/subop/and 3/mod/direct 0/rm32/eax . . . . . 0xff/imm32 # bitwise and of eax 2321 3d/compare-eax-and 0x3c/imm32/less-than 2322 0f 85/jump-if-not-equal $parse-effective-address:error2/disp32 -2323 # ++word->start to skip '<' +2323 # ++word-slice->start to skip '<' 2324 ff 0/subop/increment 0/mod/indirect 6/rm32/esi . . . . . . # increment *esi 2325 # skip whitespace -2326 # . eax = skip-chars-matching-whitespace-in-slice(word->start, word->end) +2326 # . eax = skip-chars-matching-whitespace-in-slice(word-slice->start, word-slice->end) 2327 # . . push args 2328 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 . # push *(esi+4) 2329 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . . # push *esi @@ -2123,11 +2123,11 @@ if ('onhashchange' in window) { 2331 e8/call skip-chars-matching-whitespace-in-slice/disp32 2332 # . . discard args 2333 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp -2334 # . word->start = eax +2334 # . word-slice->start = eax 2335 89/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . . # copy eax to *esi 2336 $parse-effective-address:scale: 2337 # read positive integer into scale -2338 # . eax = next-positive-hex-int(word) +2338 # . eax = next-positive-hex-int(word-slice) 2339 # . . push args 2340 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 2341 # . . call @@ -2137,7 +2137,7 @@ if ('onhashchange' in window) { 2345 # . edx = eax 2346 89/copy 3/mod/direct 2/rm32/edx . . . 0/r32/eax . . # copy eax to edx 2347 # skip whitespace -2348 # . eax = skip-chars-matching-whitespace-in-slice(word->start, word->end) +2348 # . eax = skip-chars-matching-whitespace-in-slice(word-slice->start, word-slice->end) 2349 # . . push args 2350 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 . # push *(esi+4) 2351 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . . # push *esi @@ -2145,15 +2145,15 @@ if ('onhashchange' in window) { 2353 e8/call skip-chars-matching-whitespace-in-slice/disp32 2354 # . . discard args 2355 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp -2356 # . word->start = eax +2356 # . word-slice->start = eax 2357 89/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . . # copy eax to *esi -2358 # if (*word->start == ')') goto end +2358 # if (*word-slice->start == ')') goto end 2359 8a/copy-byte 0/mod/indirect 0/rm32/eax . . . 0/r32/AL . . # copy byte at *eax to AL 2360 81 4/subop/and 3/mod/direct 0/rm32/eax . . . . . 0xff/imm32 # bitwise and of eax 2361 3d/compare-eax-and 0x29/imm32/close-paren 2362 74/jump-if-equal $parse-effective-address:end/disp8 2363 $parse-effective-address:check-for-displacement: -2364 # if (*word->start not in '+' '-') goto error3 +2364 # if (*word-slice->start not in '+' '-') goto error3 2365 3d/compare-eax-and 0x2b/imm32/plus 2366 74/jump-if-equal $parse-effective-address:displacement/disp8 2367 3d/compare-eax-and 0x2d/imm32/minus @@ -2161,7 +2161,7 @@ if ('onhashchange' in window) { 2369 e9/jump $parse-effective-address:error3/disp32 2370 $parse-effective-address:displacement: 2371 # read integer into disp -2372 # . eax = next-hex-int(word) +2372 # . eax = next-hex-int(word-slice) 2373 # . . push args 2374 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 2375 # . . call @@ -2171,7 +2171,7 @@ if ('onhashchange' in window) { 2379 # . ebx = eax 2380 89/copy 3/mod/direct 3/rm32/ebx . . . 0/r32/eax . . # copy eax to ebx 2381 # skip whitespace -2382 # . eax = skip-chars-matching-whitespace-in-slice(word->start, word->end) +2382 # . eax = skip-chars-matching-whitespace-in-slice(word-slice->start, word-slice->end) 2383 # . . push args 2384 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 . # push *(esi+4) 2385 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . . # push *esi @@ -2179,9 +2179,9 @@ if ('onhashchange' in window) { 2387 e8/call skip-chars-matching-whitespace-in-slice/disp32 2388 # . . discard args 2389 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp -2390 # . word->start = eax +2390 # . word-slice->start = eax 2391 89/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . . # copy eax to *esi -2392 # if (*word->start != ')') goto error4 +2392 # if (*word-slice->start != ')') goto error4 2393 8a/copy-byte 0/mod/indirect 0/rm32/eax . . . 0/r32/AL . . # copy byte at *eax to AL 2394 81 4/subop/and 3/mod/direct 0/rm32/eax . . . . . 0xff/imm32 # bitwise and of eax 2395 3d/compare-eax-and 0x29/imm32/close-paren @@ -2372,7 +2372,7 @@ if ('onhashchange' in window) { 2580 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx 2581 # in->start += 3 2582 81 0/subop/add 0/mod/indirect 6/rm32/esi . . . . . 3/imm32 # add to *esi -2583 # eax = get-slice(Registers, word, row-size=8) +2583 # eax = get-slice(Registers, reg-slice, row-size=8) 2584 # . . push args 2585 68/push "next-register"/imm32 2586 68/push 8/imm32/row-size @@ -3755,7 +3755,7 @@ if ('onhashchange' in window) { 4138 $next-hex-int:skip-whitespace: 4139 # spill eax 4140 50/push-eax -4141 # eax = skip-chars-matching-whitespace-in-slice(word->start, word->end) +4141 # eax = skip-chars-matching-whitespace-in-slice(word-slice->start, word-slice->end) 4142 # . . push args 4143 52/push-edx 4144 51/push-ecx @@ -3821,7 +3821,7 @@ if ('onhashchange' in window) { 4204 $next-hex-int:negate: 4205 f7 3/subop/negate 3/mod/direct 7/rm32/edi . . . . . . # negate edi 4206 $next-hex-int:end: -4207 # word->start = curr +4207 # word-slice->start = curr 4208 89/copy 0/mod/indirect 6/rm32/esi . . . 1/r32/ecx . . # copy ecx to *esi 4209 # return edi 4210 89/copy 3/mod/direct 0/rm32/eax . . . 7/r32/edi . . # copy edi to eax @@ -4200,7 +4200,7 @@ if ('onhashchange' in window) { 4583 # loop 4584 eb/jump $next-positive-hex-int:loop/disp8 4585 $next-positive-hex-int:end: -4586 # word->start = curr +4586 # word-slice->start = curr 4587 89/copy 0/mod/indirect 6/rm32/esi . . . 1/r32/ecx . . # copy ecx to *esi 4588 # return edi 4589 89/copy 3/mod/direct 0/rm32/eax . . . 7/r32/edi . . # copy edi to eax -- cgit 1.4.1-2-gfad0