diff options
author | Kartik Agaram <vc@akkartik.com> | 2019-08-25 23:25:08 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2019-08-25 23:25:08 -0700 |
commit | fc55af70a5b0771d7656024716a51345bbe11fcb (patch) | |
tree | 8b53317f996fa29c6daea02da230585159a65a78 /html/apps/dquotes.subx.html | |
parent | 418ea7d3dbc81b066852c615329b1f463a2a33c0 (diff) | |
download | mu-fc55af70a5b0771d7656024716a51345bbe11fcb.tar.gz |
5589
Diffstat (limited to 'html/apps/dquotes.subx.html')
-rw-r--r-- | html/apps/dquotes.subx.html | 783 |
1 files changed, 178 insertions, 605 deletions
diff --git a/html/apps/dquotes.subx.html b/html/apps/dquotes.subx.html index ecffb4d6..6e9d009a 100644 --- a/html/apps/dquotes.subx.html +++ b/html/apps/dquotes.subx.html @@ -65,7 +65,7 @@ if ('onhashchange' in window) { <span id="L2" class="LineNr"> 2 </span><span class="subxComment"># Replace them with references to new variables in the data segment.</span> <span id="L3" class="LineNr"> 3 </span><span class="subxComment">#</span> <span id="L4" class="LineNr"> 4 </span><span class="subxComment"># To run:</span> -<span id="L5" class="LineNr"> 5 </span><span class="subxComment"># $ ./subx translate *.subx apps/dquotes.subx -o apps/dquotes</span> +<span id="L5" class="LineNr"> 5 </span><span class="subxComment"># $ ./subx translate 0*.subx apps/subx-common.subx apps/dquotes.subx -o apps/dquotes</span> <span id="L6" class="LineNr"> 6 </span><span class="subxComment"># $ cat x</span> <span id="L7" class="LineNr"> 7 </span><span class="subxComment"># == code</span> <span id="L8" class="LineNr"> 8 </span><span class="subxComment"># ab "cd ef"/imm32</span> @@ -369,7 +369,7 @@ if ('onhashchange' in window) { <span id="L306" class="LineNr"> 306 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to ESP</span> <span id="L307" class="LineNr"> 307 </span> <span class="subxS1Comment"># . print-int32-decimal(out-segment, *Next-string-literal)</span> <span id="L308" class="LineNr"> 308 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L309" class="LineNr"> 309 </span> ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="SpecialChar"><a href='dquotes.subx.html#L2715'>Next-string-literal</a></span>/disp32 <span class="subxComment"># push *Next-string-literal</span> +<span id="L309" class="LineNr"> 309 </span> ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="SpecialChar"><a href='dquotes.subx.html#L2288'>Next-string-literal</a></span>/disp32 <span class="subxComment"># push *Next-string-literal</span> <span id="L310" class="LineNr"> 310 </span> ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x10/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(EBP+16)</span> <span id="L311" class="LineNr"> 311 </span> <span class="subxS2Comment"># . . call</span> <span id="L312" class="LineNr"> 312 </span> e8/call <a href='../074print-int-decimal.subx.html#L8'>print-int32-decimal</a>/disp32 @@ -410,7 +410,7 @@ if ('onhashchange' in window) { <span id="L347" class="LineNr"> 347 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to ESP</span> <span id="L348" class="LineNr"> 348 </span> <span class="subxS1Comment"># . print-int32-decimal(int32-stream, *Next-string-literal)</span> <span id="L349" class="LineNr"> 349 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L350" class="LineNr"> 350 </span> ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="SpecialChar"><a href='dquotes.subx.html#L2715'>Next-string-literal</a></span>/disp32 <span class="subxComment"># push *Next-string-literal</span> +<span id="L350" class="LineNr"> 350 </span> ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="SpecialChar"><a href='dquotes.subx.html#L2288'>Next-string-literal</a></span>/disp32 <span class="subxComment"># push *Next-string-literal</span> <span id="L351" class="LineNr"> 351 </span> 51/push-ECX <span id="L352" class="LineNr"> 352 </span> <span class="subxS2Comment"># . . call</span> <span id="L353" class="LineNr"> 353 </span> e8/call <a href='../074print-int-decimal.subx.html#L8'>print-int32-decimal</a>/disp32 @@ -433,7 +433,7 @@ if ('onhashchange' in window) { <span id="L370" class="LineNr"> 370 </span> <span class="subxS2Comment"># . . discard args</span> <span id="L371" class="LineNr"> 371 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to ESP</span> <span id="L372" class="LineNr"> 372 </span> <span class="subxComment"># ++ *Next-string-literal</span> -<span id="L373" class="LineNr"> 373 </span> ff 0/subop/increment 0/mod/indirect 5/rm32/.disp32 <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="SpecialChar"><a href='dquotes.subx.html#L2715'>Next-string-literal</a></span>/disp32 <span class="subxComment"># increment *Num-test-failures</span> +<span id="L373" class="LineNr"> 373 </span> ff 0/subop/increment 0/mod/indirect 5/rm32/.disp32 <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="SpecialChar"><a href='dquotes.subx.html#L2288'>Next-string-literal</a></span>/disp32 <span class="subxComment"># increment *Num-test-failures</span> <span id="L374" class="LineNr"> 374 </span><span class="Constant">$process-string-literal:end</span>: <span id="L375" class="LineNr"> 375 </span> <span class="subxS1Comment"># . reclaim locals</span> <span id="L376" class="LineNr"> 376 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x16/imm32 <span class="subxComment"># add to ESP</span> @@ -892,7 +892,7 @@ if ('onhashchange' in window) { <span id="L886" class="LineNr"> 886 </span> 56/push-ESI <span id="L887" class="LineNr"> 887 </span> 52/push-EDX <span id="L888" class="LineNr"> 888 </span> <span class="subxS2Comment"># . . call</span> -<span id="L889" class="LineNr"> 889 </span> e8/call <a href='dquotes.subx.html#L2600'>string-length-at-start-of-slice</a>/disp32 +<span id="L889" class="LineNr"> 889 </span> e8/call <a href='dquotes.subx.html#L2173'>string-length-at-start-of-slice</a>/disp32 <span id="L890" class="LineNr"> 890 </span> <span class="subxS2Comment"># . . discard args</span> <span id="L891" class="LineNr"> 891 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to ESP</span> <span id="L892" class="LineNr"> 892 </span> <span class="subxComment"># print(out, "#{len}/imm32 ")</span> @@ -962,7 +962,7 @@ if ('onhashchange' in window) { <span id="L956" class="LineNr"> 956 </span> 74/jump-if-equal $emit-string-literal-data:char-done/disp8 <span id="L957" class="LineNr"> 957 </span> <span class="subxS1Comment"># . write(out, "/")</span> <span id="L958" class="LineNr"> 958 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L959" class="LineNr"> 959 </span> 68/push <span class="SpecialChar"><a href='dquotes.subx.html#L2726'>Slash</a></span>/imm32 +<span id="L959" class="LineNr"> 959 </span> 68/push <span class="SpecialChar"><a href='dquotes.subx.html#L2299'>Slash</a></span>/imm32 <span id="L960" class="LineNr"> 960 </span> ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(EBP+8)</span> <span id="L961" class="LineNr"> 961 </span> <span class="subxS2Comment"># . . call</span> <span id="L962" class="LineNr"> 962 </span> e8/call <a href='../057write.subx.html#L24'>write</a>/disp32 @@ -979,7 +979,7 @@ if ('onhashchange' in window) { <span id="L973" class="LineNr"> 973 </span><span class="Constant">$emit-string-literal-data:char-done</span>: <span id="L974" class="LineNr"> 974 </span> <span class="subxComment"># write(out, " ")</span> <span id="L975" class="LineNr"> 975 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L976" class="LineNr"> 976 </span> 68/push <span class="SpecialChar"><a href='dquotes.subx.html#L2719'>Space</a></span>/imm32 +<span id="L976" class="LineNr"> 976 </span> 68/push <span class="SpecialChar"><a href='dquotes.subx.html#L2292'>Space</a></span>/imm32 <span id="L977" class="LineNr"> 977 </span> ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(EBP+8)</span> <span id="L978" class="LineNr"> 978 </span> <span class="subxS2Comment"># . . call</span> <span id="L979" class="LineNr"> 979 </span> e8/call <a href='../057write.subx.html#L24'>write</a>/disp32 @@ -1048,8 +1048,8 @@ if ('onhashchange' in window) { <span id="L1042" class="LineNr">1042 </span> <span class="subxS2Comment"># . . discard args</span> <span id="L1043" class="LineNr">1043 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to ESP</span> <span id="L1044" class="LineNr">1044 </span> <span class="subxComment"># var slice/ECX = '"abc"/d'</span> -<span id="L1045" class="LineNr">1045 </span> 68/push <a href='dquotes.subx.html#L2735'>_test-slice-abc-limit</a>/imm32 -<span id="L1046" class="LineNr">1046 </span> 68/push <a href='dquotes.subx.html#L2732'>_test-slice-abc</a>/imm32 +<span id="L1045" class="LineNr">1045 </span> 68/push <a href='dquotes.subx.html#L2308'>_test-slice-abc-limit</a>/imm32 +<span id="L1046" class="LineNr">1046 </span> 68/push <a href='dquotes.subx.html#L2305'>_test-slice-abc</a>/imm32 <span id="L1047" class="LineNr">1047 </span> 89/copy 3/mod/direct 1/rm32/ECX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ESP to ECX</span> <span id="L1048" class="LineNr">1048 </span> <span class="subxComment"># emit-string-literal-data(_test-output-stream, slice)</span> <span id="L1049" class="LineNr">1049 </span> <span class="subxS2Comment"># . . push args</span> @@ -1127,8 +1127,8 @@ if ('onhashchange' in window) { <span id="L1171" class="LineNr">1171 </span> <span class="subxS2Comment"># . . discard args</span> <span id="L1172" class="LineNr">1172 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to ESP</span> <span id="L1173" class="LineNr">1173 </span> <span class="subxComment"># var slice/ECX = '"a b"'</span> -<span id="L1174" class="LineNr">1174 </span> 68/push <a href='dquotes.subx.html#L2739'>_test-slice-a-space-b-limit</a>/imm32 -<span id="L1175" class="LineNr">1175 </span> 68/push <a href='dquotes.subx.html#L2737'>_test-slice-a-space-b</a>/imm32 +<span id="L1174" class="LineNr">1174 </span> 68/push <a href='dquotes.subx.html#L2312'>_test-slice-a-space-b-limit</a>/imm32 +<span id="L1175" class="LineNr">1175 </span> 68/push <a href='dquotes.subx.html#L2310'>_test-slice-a-space-b</a>/imm32 <span id="L1176" class="LineNr">1176 </span> 89/copy 3/mod/direct 1/rm32/ECX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ESP to ECX</span> <span id="L1177" class="LineNr">1177 </span> <span class="subxComment"># emit-string-literal-data(_test-output-stream, slice)</span> <span id="L1178" class="LineNr">1178 </span> <span class="subxS2Comment"># . . push args</span> @@ -1166,8 +1166,8 @@ if ('onhashchange' in window) { <span id="L1235" class="LineNr">1235 </span> <span class="subxS2Comment"># . . discard args</span> <span id="L1236" class="LineNr">1236 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to ESP</span> <span id="L1237" class="LineNr">1237 </span> <span class="subxComment"># var slice/ECX = '"a\"b"'</span> -<span id="L1238" class="LineNr">1238 </span> 68/push <a href='dquotes.subx.html#L2743'>_test-slice-a-dquote-b-limit</a>/imm32 -<span id="L1239" class="LineNr">1239 </span> 68/push <a href='dquotes.subx.html#L2741'>_test-slice-a-dquote-b</a>/imm32 +<span id="L1238" class="LineNr">1238 </span> 68/push <a href='dquotes.subx.html#L2316'>_test-slice-a-dquote-b-limit</a>/imm32 +<span id="L1239" class="LineNr">1239 </span> 68/push <a href='dquotes.subx.html#L2314'>_test-slice-a-dquote-b</a>/imm32 <span id="L1240" class="LineNr">1240 </span> 89/copy 3/mod/direct 1/rm32/ECX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ESP to ECX</span> <span id="L1241" class="LineNr">1241 </span> <span class="subxComment"># emit-string-literal-data(_test-output-stream, slice)</span> <span id="L1242" class="LineNr">1242 </span> <span class="subxS2Comment"># . . push args</span> @@ -1205,8 +1205,8 @@ if ('onhashchange' in window) { <span id="L1299" class="LineNr">1299 </span> <span class="subxS2Comment"># . . discard args</span> <span id="L1300" class="LineNr">1300 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to ESP</span> <span id="L1301" class="LineNr">1301 </span> <span class="subxComment"># var slice/ECX = '"a\nb"'</span> -<span id="L1302" class="LineNr">1302 </span> 68/push <a href='dquotes.subx.html#L2747'>_test-slice-a-newline-b-limit</a>/imm32 -<span id="L1303" class="LineNr">1303 </span> 68/push <a href='dquotes.subx.html#L2745'>_test-slice-a-newline-b</a>/imm32 +<span id="L1302" class="LineNr">1302 </span> 68/push <a href='dquotes.subx.html#L2320'>_test-slice-a-newline-b-limit</a>/imm32 +<span id="L1303" class="LineNr">1303 </span> 68/push <a href='dquotes.subx.html#L2318'>_test-slice-a-newline-b</a>/imm32 <span id="L1304" class="LineNr">1304 </span> 89/copy 3/mod/direct 1/rm32/ECX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ESP to ECX</span> <span id="L1305" class="LineNr">1305 </span> <span class="subxComment"># emit-string-literal-data(_test-output-stream, slice)</span> <span id="L1306" class="LineNr">1306 </span> <span class="subxS2Comment"># . . push args</span> @@ -1280,7 +1280,7 @@ if ('onhashchange' in window) { <span id="L1399" class="LineNr">1399 </span> 52/push-EDX <span id="L1400" class="LineNr">1400 </span> 51/push-ECX <span id="L1401" class="LineNr">1401 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1402" class="LineNr">1402 </span> e8/call <a href='dquotes.subx.html#L2416'>skip-string-in-slice</a>/disp32 +<span id="L1402" class="LineNr">1402 </span> e8/call skip-string-in-slice/disp32 <span id="L1403" class="LineNr">1403 </span> <span class="subxS2Comment"># . . discard args</span> <span id="L1404" class="LineNr">1404 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to ESP</span> <span id="L1405" class="LineNr">1405 </span> <span class="subxS1Comment"># . curr = EAX</span> @@ -1583,8 +1583,8 @@ if ('onhashchange' in window) { <span id="L1702" class="LineNr">1702 </span> <span class="subxS2Comment"># . . discard args</span> <span id="L1703" class="LineNr">1703 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to ESP</span> <span id="L1704" class="LineNr">1704 </span> <span class="subxComment"># var slice/ECX = "\"abc/def\"/ghi"</span> -<span id="L1705" class="LineNr">1705 </span> 68/push <a href='dquotes.subx.html#L2756'>_test-slice-literal-string-with-limit</a>/imm32 -<span id="L1706" class="LineNr">1706 </span> 68/push <a href='dquotes.subx.html#L2750'>_test-slice-literal-string</a>/imm32/start +<span id="L1705" class="LineNr">1705 </span> 68/push <a href='dquotes.subx.html#L2329'>_test-slice-literal-string-with-limit</a>/imm32 +<span id="L1706" class="LineNr">1706 </span> 68/push <a href='dquotes.subx.html#L2323'>_test-slice-literal-string</a>/imm32/start <span id="L1707" class="LineNr">1707 </span> 89/copy 3/mod/direct 1/rm32/ECX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ESP to ECX</span> <span id="L1708" class="LineNr">1708 </span> <span class="subxComment"># emit-metadata(_test-output-buffered-file, slice)</span> <span id="L1709" class="LineNr">1709 </span> <span class="subxS2Comment"># . . push args</span> @@ -1685,7 +1685,7 @@ if ('onhashchange' in window) { <span id="L1829" class="LineNr">1829 </span> <span class="subxS2Comment"># . . push args</span> <span id="L1830" class="LineNr">1830 </span> 56/push-ESI <span id="L1831" class="LineNr">1831 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1832" class="LineNr">1832 </span> e8/call <a href='dquotes.subx.html#L2175'>skip-string</a>/disp32 +<span id="L1832" class="LineNr">1832 </span> e8/call skip-string/disp32 <span id="L1833" class="LineNr">1833 </span> <span class="subxS2Comment"># . . discard args</span> <span id="L1834" class="LineNr">1834 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to ESP</span> <span id="L1835" class="LineNr">1835 </span> <span class="subxComment"># fall through</span> @@ -1858,7 +1858,7 @@ if ('onhashchange' in window) { <span id="L2002" class="LineNr">2002 </span> 5d/pop-to-EBP <span id="L2003" class="LineNr">2003 </span> c3/return <span id="L2004" class="LineNr">2004 </span> -<span id="L2005" class="LineNr">2005 </span><span class="subxTest">test-next-word-or-string-returns-empty-string-on-eof</span>: +<span id="L2005" class="LineNr">2005 </span><span class="subxTest">test-next-word-or-string-returns-empty-slice-on-eof</span>: <span id="L2006" class="LineNr">2006 </span> <span class="subxS1Comment"># . prolog</span> <span id="L2007" class="LineNr">2007 </span> 55/push-EBP <span id="L2008" class="LineNr">2008 </span> 89/copy 3/mod/direct 5/rm32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ESP to EBP</span> @@ -1900,7 +1900,7 @@ if ('onhashchange' in window) { <span id="L2044" class="LineNr">2044 </span> 5d/pop-to-EBP <span id="L2045" class="LineNr">2045 </span> c3/return <span id="L2046" class="LineNr">2046 </span> -<span id="L2047" class="LineNr">2047 </span><span class="subxTest">test-next-word-or-string-returns-whole-string</span>: +<span id="L2047" class="LineNr">2047 </span><span class="subxTest">test-next-word-or-string-returns-string-literal</span>: <span id="L2048" class="LineNr">2048 </span> <span class="subxS1Comment"># . prolog</span> <span id="L2049" class="LineNr">2049 </span> 55/push-EBP <span id="L2050" class="LineNr">2050 </span> 89/copy 3/mod/direct 5/rm32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ESP to EBP</span> @@ -1935,7 +1935,7 @@ if ('onhashchange' in window) { <span id="L2079" class="LineNr">2079 </span> <span class="subxComment"># check-ints-equal(slice->start - _test-input-stream->data, 1, msg)</span> <span id="L2080" class="LineNr">2080 </span> <span class="subxS1Comment"># . check-ints-equal(slice->start - _test-input-stream, 13, msg)</span> <span id="L2081" class="LineNr">2081 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2082" class="LineNr">2082 </span> 68/push <span class="Constant">"F - <a href='dquotes.subx.html#L2047'>test-next-word-or-string-returns-whole-string</a>: start"</span>/imm32 +<span id="L2082" class="LineNr">2082 </span> 68/push <span class="Constant">"F - <a href='dquotes.subx.html#L2047'>test-next-word-or-string-returns-string-literal</a>: start"</span>/imm32 <span id="L2083" class="LineNr">2083 </span> 68/push 0xd/imm32 <span id="L2084" class="LineNr">2084 </span> <span class="subxS2Comment"># . . push slice->start - _test-input-stream</span> <span id="L2085" class="LineNr">2085 </span> 8b/copy 0/mod/indirect 1/rm32/ECX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *ECX to EAX</span> @@ -1948,7 +1948,7 @@ if ('onhashchange' in window) { <span id="L2092" class="LineNr">2092 </span> <span class="subxComment"># check-ints-equal(slice->end - _test-input-stream->data, 12, msg)</span> <span id="L2093" class="LineNr">2093 </span> <span class="subxS1Comment"># . check-ints-equal(slice->end - _test-input-stream, 24, msg)</span> <span id="L2094" class="LineNr">2094 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2095" class="LineNr">2095 </span> 68/push <span class="Constant">"F - <a href='dquotes.subx.html#L2047'>test-next-word-or-string-returns-whole-string</a>: end"</span>/imm32 +<span id="L2095" class="LineNr">2095 </span> 68/push <span class="Constant">"F - <a href='dquotes.subx.html#L2047'>test-next-word-or-string-returns-string-literal</a>: end"</span>/imm32 <span id="L2096" class="LineNr">2096 </span> 68/push 0x18/imm32 <span id="L2097" class="LineNr">2097 </span> <span class="subxS2Comment"># . . push slice->end - _test-input-stream</span> <span id="L2098" class="LineNr">2098 </span> 8b/copy 1/mod/*+disp8 1/rm32/ECX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/EAX 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ECX+4) to EAX</span> @@ -2026,592 +2026,165 @@ if ('onhashchange' in window) { <span id="L2170" class="LineNr">2170 </span> 5d/pop-to-EBP <span id="L2171" class="LineNr">2171 </span> c3/return <span id="L2172" class="LineNr">2172 </span> -<span id="L2173" class="LineNr">2173 </span><span class="subxComment"># update line->read to end of string literal surrounded by double quotes</span> -<span id="L2174" class="LineNr">2174 </span><span class="subxComment"># line->read must start out at a double-quote</span> -<span id="L2175" class="LineNr">2175 </span><span class="subxFunction">skip-string</span>: <span class="subxComment"># line : (address stream)</span> -<span id="L2176" class="LineNr">2176 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L2177" class="LineNr">2177 </span> 55/push-EBP -<span id="L2178" class="LineNr">2178 </span> 89/copy 3/mod/direct 5/rm32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ESP to EBP</span> -<span id="L2179" class="LineNr">2179 </span> <span class="subxS1Comment"># . save registers</span> -<span id="L2180" class="LineNr">2180 </span> 50/push-EAX -<span id="L2181" class="LineNr">2181 </span> 51/push-ECX -<span id="L2182" class="LineNr">2182 </span> 52/push-EDX -<span id="L2183" class="LineNr">2183 </span> <span class="subxComment"># ECX = line</span> -<span id="L2184" class="LineNr">2184 </span> 8b/copy 1/mod/*+disp8 5/rm32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ECX 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(EBP+8) to ECX</span> -<span id="L2185" class="LineNr">2185 </span> <span class="subxComment"># EAX = skip-string-in-slice(&line->data[line->read], &line->data[line->write])</span> -<span id="L2186" class="LineNr">2186 </span> <span class="subxS2Comment"># . . push &line->data[line->write]</span> -<span id="L2187" class="LineNr">2187 </span> 8b/copy 1/mod/*+disp8 1/rm32/ECX <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/EDX 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ECX+8) to EDX</span> -<span id="L2188" class="LineNr">2188 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 1/base/ECX 2/index/EDX <span class="Normal"> . </span> 2/r32/EDX 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy ECX+EDX+12 to EDX</span> -<span id="L2189" class="LineNr">2189 </span> 52/push-EDX -<span id="L2190" class="LineNr">2190 </span> <span class="subxS2Comment"># . . push &line->data[line->read]</span> -<span id="L2191" class="LineNr">2191 </span> 8b/copy 1/mod/*+disp8 1/rm32/ECX <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/EDX 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ECX+4) to EDX</span> -<span id="L2192" class="LineNr">2192 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 1/base/ECX 2/index/EDX <span class="Normal"> . </span> 2/r32/EDX 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy ECX+EDX+12 to EDX</span> -<span id="L2193" class="LineNr">2193 </span> 52/push-EDX -<span id="L2194" class="LineNr">2194 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2195" class="LineNr">2195 </span> e8/call <a href='dquotes.subx.html#L2416'>skip-string-in-slice</a>/disp32 -<span id="L2196" class="LineNr">2196 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2197" class="LineNr">2197 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2198" class="LineNr">2198 </span> <span class="subxComment"># line->read = EAX - line->data</span> -<span id="L2199" class="LineNr">2199 </span> 29/subtract 3/mod/direct 0/rm32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ECX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># subtract ECX from EAX</span> -<span id="L2200" class="LineNr">2200 </span> 2d/subtract-from-EAX 0xc/imm32 -<span id="L2201" class="LineNr">2201 </span> 89/copy 1/mod/*+disp8 1/rm32/ECX <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/EAX 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy EAX to *(ECX+4)</span> -<span id="L2202" class="LineNr">2202 </span><span class="Constant">$skip-string:end</span>: -<span id="L2203" class="LineNr">2203 </span> <span class="subxS1Comment"># . restore registers</span> -<span id="L2204" class="LineNr">2204 </span> 5a/pop-to-EDX -<span id="L2205" class="LineNr">2205 </span> 59/pop-to-ECX -<span id="L2206" class="LineNr">2206 </span> 58/pop-to-EAX -<span id="L2207" class="LineNr">2207 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L2208" class="LineNr">2208 </span> 89/copy 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 5/r32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy EBP to ESP</span> -<span id="L2209" class="LineNr">2209 </span> 5d/pop-to-EBP -<span id="L2210" class="LineNr">2210 </span> c3/return -<span id="L2211" class="LineNr">2211 </span> -<span id="L2212" class="LineNr">2212 </span><span class="subxTest">test-skip-string</span>: -<span id="L2213" class="LineNr">2213 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L2214" class="LineNr">2214 </span> 55/push-EBP -<span id="L2215" class="LineNr">2215 </span> 89/copy 3/mod/direct 5/rm32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ESP to EBP</span> -<span id="L2216" class="LineNr">2216 </span> <span class="subxComment"># setup</span> -<span id="L2217" class="LineNr">2217 </span> <span class="subxS1Comment"># . clear-stream(_test-input-stream)</span> -<span id="L2218" class="LineNr">2218 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2219" class="LineNr">2219 </span> 68/push <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 -<span id="L2220" class="LineNr">2220 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2221" class="LineNr">2221 </span> e8/call <a href='../055stream.subx.html#L17'>clear-stream</a>/disp32 -<span id="L2222" class="LineNr">2222 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2223" class="LineNr">2223 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2224" class="LineNr">2224 </span> <span class="subxS1Comment"># . write(_test-input-stream, "\"abc\" def")</span> -<span id="L2225" class="LineNr">2225 </span> <span class="subxS1Comment"># . indices: 0123 45</span> -<span id="L2226" class="LineNr">2226 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2227" class="LineNr">2227 </span> 68/push <span class="Constant">"\"</span>abc\<span class="Constant">" def"</span>/imm32 -<span id="L2228" class="LineNr">2228 </span> 68/push <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 -<span id="L2229" class="LineNr">2229 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2230" class="LineNr">2230 </span> e8/call <a href='../057write.subx.html#L24'>write</a>/disp32 -<span id="L2231" class="LineNr">2231 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2232" class="LineNr">2232 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2233" class="LineNr">2233 </span> <span class="subxComment"># precondition: line->read == 0</span> +<span id="L2173" class="LineNr">2173 </span><span class="subxFunction">string-length-at-start-of-slice</span>: <span class="subxComment"># curr : (address byte), end : (address byte) -> length/EAX</span> +<span id="L2174" class="LineNr">2174 </span> <span class="subxS1Comment"># . prolog</span> +<span id="L2175" class="LineNr">2175 </span> 55/push-EBP +<span id="L2176" class="LineNr">2176 </span> 89/copy 3/mod/direct 5/rm32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ESP to EBP</span> +<span id="L2177" class="LineNr">2177 </span> <span class="subxS1Comment"># . save registers</span> +<span id="L2178" class="LineNr">2178 </span> 51/push-ECX +<span id="L2179" class="LineNr">2179 </span> 52/push-EDX +<span id="L2180" class="LineNr">2180 </span> 53/push-EBX +<span id="L2181" class="LineNr">2181 </span> <span class="subxComment"># ECX = curr</span> +<span id="L2182" class="LineNr">2182 </span> 8b/copy 1/mod/*+disp8 5/rm32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ECX 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(EBP+8) to ECX</span> +<span id="L2183" class="LineNr">2183 </span> <span class="subxComment"># EDX = end</span> +<span id="L2184" class="LineNr">2184 </span> 8b/copy 1/mod/*+disp8 5/rm32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/EDX 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(EBP+12) to EDX</span> +<span id="L2185" class="LineNr">2185 </span> <span class="subxComment"># length/EAX = 0</span> +<span id="L2186" class="LineNr">2186 </span> 31/xor 3/mod/direct 0/rm32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># clear EAX</span> +<span id="L2187" class="LineNr">2187 </span> <span class="subxComment"># EBX = 0</span> +<span id="L2188" class="LineNr">2188 </span> 31/xor 3/mod/direct 3/rm32/EBX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 3/r32/EBX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># clear EBX</span> +<span id="L2189" class="LineNr">2189 </span> <span class="subxComment"># skip initial dquote</span> +<span id="L2190" class="LineNr">2190 </span> 41/increment-ECX +<span id="L2191" class="LineNr">2191 </span><span class="Constant">$string-length-at-start-of-slice:loop</span>: +<span id="L2192" class="LineNr">2192 </span> <span class="subxComment"># if (curr >= end) return length</span> +<span id="L2193" class="LineNr">2193 </span> 39/compare 3/mod/direct 1/rm32/ECX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/EDX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># compare ECX with EDX</span> +<span id="L2194" class="LineNr">2194 </span> 73/jump-if-greater-unsigned-or-equal $string-length-at-start-of-slice:end/disp8 +<span id="L2195" class="LineNr">2195 </span> <span class="subxComment"># BL = *curr</span> +<span id="L2196" class="LineNr">2196 </span> 8a/copy-byte 0/mod/indirect 1/rm32/ECX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 3/r32/BL <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy byte at *ECX to BL</span> +<span id="L2197" class="LineNr">2197 </span><span class="Constant">$string-length-at-start-of-slice:dquote</span>: +<span id="L2198" class="LineNr">2198 </span> <span class="subxComment"># if (EBX == '"') break</span> +<span id="L2199" class="LineNr">2199 </span> 81 7/subop/compare 3/mod/direct 3/rm32/EBX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x22/imm32/dquote <span class="subxComment"># compare EBX</span> +<span id="L2200" class="LineNr">2200 </span> 74/jump-if-equal $string-length-at-start-of-slice:end/disp8 +<span id="L2201" class="LineNr">2201 </span><span class="Constant">$string-length-at-start-of-slice:check-for-escape</span>: +<span id="L2202" class="LineNr">2202 </span> <span class="subxComment"># if (EBX == '\') escape next char</span> +<span id="L2203" class="LineNr">2203 </span> 81 7/subop/compare 3/mod/direct 3/rm32/EBX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x5c/imm32/backslash <span class="subxComment"># compare EBX</span> +<span id="L2204" class="LineNr">2204 </span> 75/jump-if-not-equal $string-length-at-start-of-slice:continue/disp8 +<span id="L2205" class="LineNr">2205 </span><span class="Constant">$string-length-at-start-of-slice:escape</span>: +<span id="L2206" class="LineNr">2206 </span> <span class="subxComment"># increment curr but not result</span> +<span id="L2207" class="LineNr">2207 </span> 41/increment-ECX +<span id="L2208" class="LineNr">2208 </span><span class="Constant">$string-length-at-start-of-slice:continue</span>: +<span id="L2209" class="LineNr">2209 </span> <span class="subxComment"># ++result</span> +<span id="L2210" class="LineNr">2210 </span> 40/increment-EAX +<span id="L2211" class="LineNr">2211 </span> <span class="subxComment"># ++curr</span> +<span id="L2212" class="LineNr">2212 </span> 41/increment-ECX +<span id="L2213" class="LineNr">2213 </span> eb/jump $string-length-at-start-of-slice:loop/disp8 +<span id="L2214" class="LineNr">2214 </span><span class="Constant">$string-length-at-start-of-slice:end</span>: +<span id="L2215" class="LineNr">2215 </span> <span class="subxS1Comment"># . restore registers</span> +<span id="L2216" class="LineNr">2216 </span> 5b/pop-to-EBX +<span id="L2217" class="LineNr">2217 </span> 5a/pop-to-EDX +<span id="L2218" class="LineNr">2218 </span> 59/pop-to-ECX +<span id="L2219" class="LineNr">2219 </span> <span class="subxS1Comment"># . epilog</span> +<span id="L2220" class="LineNr">2220 </span> 89/copy 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 5/r32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy EBP to ESP</span> +<span id="L2221" class="LineNr">2221 </span> 5d/pop-to-EBP +<span id="L2222" class="LineNr">2222 </span> c3/return +<span id="L2223" class="LineNr">2223 </span> +<span id="L2224" class="LineNr">2224 </span><span class="subxTest">test-string-length-at-start-of-slice</span>: +<span id="L2225" class="LineNr">2225 </span> <span class="subxS1Comment"># . prolog</span> +<span id="L2226" class="LineNr">2226 </span> 55/push-EBP +<span id="L2227" class="LineNr">2227 </span> 89/copy 3/mod/direct 5/rm32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ESP to EBP</span> +<span id="L2228" class="LineNr">2228 </span> <span class="subxComment"># setup: (EAX..ECX) = "\"abc\" def"</span> +<span id="L2229" class="LineNr">2229 </span> b8/copy-to-EAX <span class="Constant">"\"</span>abc\<span class="Constant">" def"</span>/imm32 +<span id="L2230" class="LineNr">2230 </span> 8b/copy 0/mod/indirect 0/rm32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ECX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *EAX to ECX</span> +<span id="L2231" class="LineNr">2231 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX <span class="Normal"> . </span> 1/r32/ECX 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy EAX+ECX+4 to ECX</span> +<span id="L2232" class="LineNr">2232 </span> 05/add-to-EAX 4/imm32 +<span id="L2233" class="LineNr">2233 </span> <span class="subxComment"># EAX = string-length-at-start-of-slice(EAX, ECX)</span> <span id="L2234" class="LineNr">2234 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2235" class="LineNr">2235 </span> 68/push <span class="Constant">"F - <a href='dquotes.subx.html#L2212'>test-skip-string</a>/precondition"</span>/imm32 -<span id="L2236" class="LineNr">2236 </span> 68/push 0/imm32 -<span id="L2237" class="LineNr">2237 </span> b8/copy-to-EAX <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 -<span id="L2238" class="LineNr">2238 </span> ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(EAX+4)</span> -<span id="L2239" class="LineNr">2239 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2240" class="LineNr">2240 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L2241" class="LineNr">2241 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2242" class="LineNr">2242 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2243" class="LineNr">2243 </span> <span class="subxComment"># skip-string(_test-input-stream)</span> -<span id="L2244" class="LineNr">2244 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2245" class="LineNr">2245 </span> 68/push <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 +<span id="L2235" class="LineNr">2235 </span> 51/push-ECX +<span id="L2236" class="LineNr">2236 </span> 50/push-EAX +<span id="L2237" class="LineNr">2237 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2238" class="LineNr">2238 </span> e8/call <a href='dquotes.subx.html#L2173'>string-length-at-start-of-slice</a>/disp32 +<span id="L2239" class="LineNr">2239 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2240" class="LineNr">2240 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to ESP</span> +<span id="L2241" class="LineNr">2241 </span> <span class="subxComment"># check-ints-equal(EAX, 3, msg)</span> +<span id="L2242" class="LineNr">2242 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2243" class="LineNr">2243 </span> 68/push <span class="Constant">"F - test-string-length-at-start-of-slice"</span>/imm32 +<span id="L2244" class="LineNr">2244 </span> 68/push 3/imm32 +<span id="L2245" class="LineNr">2245 </span> 50/push-EAX <span id="L2246" class="LineNr">2246 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2247" class="LineNr">2247 </span> e8/call <a href='dquotes.subx.html#L2175'>skip-string</a>/disp32 +<span id="L2247" class="LineNr">2247 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 <span id="L2248" class="LineNr">2248 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2249" class="LineNr">2249 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2250" class="LineNr">2250 </span> <span class="subxComment"># check-ints-equal(line->read, 5, msg)</span> -<span id="L2251" class="LineNr">2251 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2252" class="LineNr">2252 </span> 68/push <span class="Constant">"F - test-skip-string"</span>/imm32 -<span id="L2253" class="LineNr">2253 </span> 68/push 5/imm32 -<span id="L2254" class="LineNr">2254 </span> b8/copy-to-EAX <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 -<span id="L2255" class="LineNr">2255 </span> ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(EAX+4)</span> -<span id="L2256" class="LineNr">2256 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2257" class="LineNr">2257 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L2258" class="LineNr">2258 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2259" class="LineNr">2259 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2260" class="LineNr">2260 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L2261" class="LineNr">2261 </span> 89/copy 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 5/r32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy EBP to ESP</span> -<span id="L2262" class="LineNr">2262 </span> 5d/pop-to-EBP -<span id="L2263" class="LineNr">2263 </span> c3/return -<span id="L2264" class="LineNr">2264 </span> -<span id="L2265" class="LineNr">2265 </span><span class="subxTest">test-skip-string-ignores-spaces</span>: -<span id="L2266" class="LineNr">2266 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L2267" class="LineNr">2267 </span> 55/push-EBP -<span id="L2268" class="LineNr">2268 </span> 89/copy 3/mod/direct 5/rm32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ESP to EBP</span> -<span id="L2269" class="LineNr">2269 </span> <span class="subxComment"># setup</span> -<span id="L2270" class="LineNr">2270 </span> <span class="subxS1Comment"># . clear-stream(_test-input-stream)</span> -<span id="L2271" class="LineNr">2271 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2272" class="LineNr">2272 </span> 68/push <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 -<span id="L2273" class="LineNr">2273 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2274" class="LineNr">2274 </span> e8/call <a href='../055stream.subx.html#L17'>clear-stream</a>/disp32 -<span id="L2275" class="LineNr">2275 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2276" class="LineNr">2276 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2277" class="LineNr">2277 </span> <span class="subxS1Comment"># . write(_test-input-stream, "\"a b\"/yz")</span> -<span id="L2278" class="LineNr">2278 </span> <span class="subxS1Comment"># . indices: 0123 45</span> -<span id="L2279" class="LineNr">2279 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2280" class="LineNr">2280 </span> 68/push <span class="Constant">"\"</span>a b\<span class="Constant">"/yz"</span>/imm32 -<span id="L2281" class="LineNr">2281 </span> 68/push <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 -<span id="L2282" class="LineNr">2282 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2283" class="LineNr">2283 </span> e8/call <a href='../057write.subx.html#L24'>write</a>/disp32 -<span id="L2284" class="LineNr">2284 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2285" class="LineNr">2285 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2286" class="LineNr">2286 </span> <span class="subxComment"># precondition: line->read == 0</span> -<span id="L2287" class="LineNr">2287 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2288" class="LineNr">2288 </span> 68/push <span class="Constant">"F - <a href='dquotes.subx.html#L2265'>test-skip-string-ignores-spaces</a>/precondition"</span>/imm32 -<span id="L2289" class="LineNr">2289 </span> 68/push 0/imm32 -<span id="L2290" class="LineNr">2290 </span> b8/copy-to-EAX <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 -<span id="L2291" class="LineNr">2291 </span> ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(EAX+4)</span> -<span id="L2292" class="LineNr">2292 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2293" class="LineNr">2293 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L2294" class="LineNr">2294 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2295" class="LineNr">2295 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2296" class="LineNr">2296 </span> <span class="subxComment"># skip-string(_test-input-stream)</span> -<span id="L2297" class="LineNr">2297 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2298" class="LineNr">2298 </span> 68/push <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 -<span id="L2299" class="LineNr">2299 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2300" class="LineNr">2300 </span> e8/call <a href='dquotes.subx.html#L2175'>skip-string</a>/disp32 -<span id="L2301" class="LineNr">2301 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2302" class="LineNr">2302 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2303" class="LineNr">2303 </span> <span class="subxComment"># check-ints-equal(line->read, 5, msg)</span> -<span id="L2304" class="LineNr">2304 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2305" class="LineNr">2305 </span> 68/push <span class="Constant">"F - test-skip-string-ignores-spaces"</span>/imm32 -<span id="L2306" class="LineNr">2306 </span> 68/push 5/imm32 -<span id="L2307" class="LineNr">2307 </span> b8/copy-to-EAX <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 -<span id="L2308" class="LineNr">2308 </span> ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(EAX+4)</span> -<span id="L2309" class="LineNr">2309 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2310" class="LineNr">2310 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L2311" class="LineNr">2311 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2312" class="LineNr">2312 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2313" class="LineNr">2313 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L2314" class="LineNr">2314 </span> 89/copy 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 5/r32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy EBP to ESP</span> -<span id="L2315" class="LineNr">2315 </span> 5d/pop-to-EBP -<span id="L2316" class="LineNr">2316 </span> c3/return +<span id="L2249" class="LineNr">2249 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to ESP</span> +<span id="L2250" class="LineNr">2250 </span> <span class="subxS1Comment"># . epilog</span> +<span id="L2251" class="LineNr">2251 </span> 89/copy 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 5/r32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy EBP to ESP</span> +<span id="L2252" class="LineNr">2252 </span> 5d/pop-to-EBP +<span id="L2253" class="LineNr">2253 </span> c3/return +<span id="L2254" class="LineNr">2254 </span> +<span id="L2255" class="LineNr">2255 </span><span class="subxTest">test-string-length-at-start-of-slice-escaped</span>: +<span id="L2256" class="LineNr">2256 </span> <span class="subxS1Comment"># . prolog</span> +<span id="L2257" class="LineNr">2257 </span> 55/push-EBP +<span id="L2258" class="LineNr">2258 </span> 89/copy 3/mod/direct 5/rm32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ESP to EBP</span> +<span id="L2259" class="LineNr">2259 </span> <span class="subxComment"># setup: (EAX..ECX) = "\"ab\\c\" def"</span> +<span id="L2260" class="LineNr">2260 </span> b8/copy-to-EAX <span class="Constant">"\"</span>ab\\c\<span class="Constant">" def"</span>/imm32 +<span id="L2261" class="LineNr">2261 </span> 8b/copy 0/mod/indirect 0/rm32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ECX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *EAX to ECX</span> +<span id="L2262" class="LineNr">2262 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX <span class="Normal"> . </span> 1/r32/ECX 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy EAX+ECX+4 to ECX</span> +<span id="L2263" class="LineNr">2263 </span> 05/add-to-EAX 4/imm32 +<span id="L2264" class="LineNr">2264 </span> <span class="subxComment"># EAX = string-length-at-start-of-slice(EAX, ECX)</span> +<span id="L2265" class="LineNr">2265 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2266" class="LineNr">2266 </span> 51/push-ECX +<span id="L2267" class="LineNr">2267 </span> 50/push-EAX +<span id="L2268" class="LineNr">2268 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2269" class="LineNr">2269 </span> e8/call <a href='dquotes.subx.html#L2173'>string-length-at-start-of-slice</a>/disp32 +<span id="L2270" class="LineNr">2270 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2271" class="LineNr">2271 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to ESP</span> +<span id="L2272" class="LineNr">2272 </span> <span class="subxComment"># check-ints-equal(EAX, 3, msg)</span> +<span id="L2273" class="LineNr">2273 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2274" class="LineNr">2274 </span> 68/push <span class="Constant">"F - test-string-length-at-start-of-slice-escaped"</span>/imm32 +<span id="L2275" class="LineNr">2275 </span> 68/push 3/imm32 +<span id="L2276" class="LineNr">2276 </span> 50/push-EAX +<span id="L2277" class="LineNr">2277 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2278" class="LineNr">2278 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L2279" class="LineNr">2279 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2280" class="LineNr">2280 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to ESP</span> +<span id="L2281" class="LineNr">2281 </span> <span class="subxS1Comment"># . epilog</span> +<span id="L2282" class="LineNr">2282 </span> 89/copy 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 5/r32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy EBP to ESP</span> +<span id="L2283" class="LineNr">2283 </span> 5d/pop-to-EBP +<span id="L2284" class="LineNr">2284 </span> c3/return +<span id="L2285" class="LineNr">2285 </span> +<span id="L2286" class="LineNr">2286 </span>== data +<span id="L2287" class="LineNr">2287 </span> +<span id="L2288" class="LineNr">2288 </span><span class="SpecialChar">Next-string-literal</span>: <span class="subxComment"># tracks the next auto-generated variable name</span> +<span id="L2289" class="LineNr">2289 </span> 1/imm32 +<span id="L2290" class="LineNr">2290 </span> +<span id="L2291" class="LineNr">2291 </span><span class="subxComment"># length-prefixed string containing just a single space</span> +<span id="L2292" class="LineNr">2292 </span><span class="SpecialChar">Space</span>: +<span id="L2293" class="LineNr">2293 </span> <span class="subxComment"># size</span> +<span id="L2294" class="LineNr">2294 </span> 1/imm32 +<span id="L2295" class="LineNr">2295 </span> <span class="subxComment"># data</span> +<span id="L2296" class="LineNr">2296 </span> 20/space +<span id="L2297" class="LineNr">2297 </span> +<span id="L2298" class="LineNr">2298 </span><span class="subxComment"># length-prefixed string containing just a single slash</span> +<span id="L2299" class="LineNr">2299 </span><span class="SpecialChar">Slash</span>: +<span id="L2300" class="LineNr">2300 </span> <span class="subxComment"># size</span> +<span id="L2301" class="LineNr">2301 </span> 1/imm32 +<span id="L2302" class="LineNr">2302 </span> <span class="subxComment"># data</span> +<span id="L2303" class="LineNr">2303 </span> 2f/slash +<span id="L2304" class="LineNr">2304 </span> +<span id="L2305" class="LineNr">2305 </span><span class="subxMinorFunction">_test-slice-abc</span>: +<span id="L2306" class="LineNr">2306 </span> 22/dquote 61/a 62/b 63/c 22/dquote <span class="subxComment"># "abc"</span> +<span id="L2307" class="LineNr">2307 </span> 2f/slash 64/d +<span id="L2308" class="LineNr">2308 </span><span class="subxMinorFunction">_test-slice-abc-limit</span>: +<span id="L2309" class="LineNr">2309 </span> +<span id="L2310" class="LineNr">2310 </span><span class="subxMinorFunction">_test-slice-a-space-b</span>: +<span id="L2311" class="LineNr">2311 </span> 22/dquote 61/a 20/space 62/b 22/dquote <span class="subxComment"># "a b"</span> +<span id="L2312" class="LineNr">2312 </span><span class="subxMinorFunction">_test-slice-a-space-b-limit</span>: +<span id="L2313" class="LineNr">2313 </span> +<span id="L2314" class="LineNr">2314 </span><span class="subxMinorFunction">_test-slice-a-dquote-b</span>: +<span id="L2315" class="LineNr">2315 </span> 22/dquote 61/a 5c/backslash 22/dquote 62/b 22/dquote <span class="subxComment"># "a\"b"</span> +<span id="L2316" class="LineNr">2316 </span><span class="subxMinorFunction">_test-slice-a-dquote-b-limit</span>: <span id="L2317" class="LineNr">2317 </span> -<span id="L2318" class="LineNr">2318 </span><span class="subxTest">test-skip-string-ignores-escapes</span>: -<span id="L2319" class="LineNr">2319 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L2320" class="LineNr">2320 </span> 55/push-EBP -<span id="L2321" class="LineNr">2321 </span> 89/copy 3/mod/direct 5/rm32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ESP to EBP</span> -<span id="L2322" class="LineNr">2322 </span> <span class="subxComment"># setup</span> -<span id="L2323" class="LineNr">2323 </span> <span class="subxS1Comment"># . clear-stream(_test-input-stream)</span> -<span id="L2324" class="LineNr">2324 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2325" class="LineNr">2325 </span> 68/push <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 -<span id="L2326" class="LineNr">2326 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2327" class="LineNr">2327 </span> e8/call <a href='../055stream.subx.html#L17'>clear-stream</a>/disp32 -<span id="L2328" class="LineNr">2328 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2329" class="LineNr">2329 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2330" class="LineNr">2330 </span> <span class="subxS1Comment"># . write(_test-input-stream, "\"a\\\"b\"/yz")</span> -<span id="L2331" class="LineNr">2331 </span> <span class="subxS1Comment"># . indices: 01 2 34 56</span> -<span id="L2332" class="LineNr">2332 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2333" class="LineNr">2333 </span> 68/push <span class="Constant">"\"</span>a\\\<span class="Constant">"b\"</span>/yz"/imm32 -<span id="L2334" class="LineNr">2334 </span> 68/push <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 -<span id="L2335" class="LineNr">2335 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2336" class="LineNr">2336 </span> e8/call <a href='../057write.subx.html#L24'>write</a>/disp32 -<span id="L2337" class="LineNr">2337 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2338" class="LineNr">2338 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2339" class="LineNr">2339 </span> <span class="subxComment"># precondition: line->read == 0</span> -<span id="L2340" class="LineNr">2340 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2341" class="LineNr">2341 </span> 68/push <span class="Constant">"F - <a href='dquotes.subx.html#L2318'>test-skip-string-ignores-escapes</a>/precondition"</span>/imm32 -<span id="L2342" class="LineNr">2342 </span> 68/push 0/imm32 -<span id="L2343" class="LineNr">2343 </span> b8/copy-to-EAX <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 -<span id="L2344" class="LineNr">2344 </span> ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(EAX+4)</span> -<span id="L2345" class="LineNr">2345 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2346" class="LineNr">2346 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L2347" class="LineNr">2347 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2348" class="LineNr">2348 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2349" class="LineNr">2349 </span> <span class="subxComment"># skip-string(_test-input-stream)</span> -<span id="L2350" class="LineNr">2350 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2351" class="LineNr">2351 </span> 68/push <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 -<span id="L2352" class="LineNr">2352 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2353" class="LineNr">2353 </span> e8/call <a href='dquotes.subx.html#L2175'>skip-string</a>/disp32 -<span id="L2354" class="LineNr">2354 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2355" class="LineNr">2355 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2356" class="LineNr">2356 </span> <span class="subxComment"># check-ints-equal(line->read, 6, msg)</span> -<span id="L2357" class="LineNr">2357 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2358" class="LineNr">2358 </span> 68/push <span class="Constant">"F - test-skip-string-ignores-escapes"</span>/imm32 -<span id="L2359" class="LineNr">2359 </span> 68/push 6/imm32 -<span id="L2360" class="LineNr">2360 </span> b8/copy-to-EAX <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 -<span id="L2361" class="LineNr">2361 </span> ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(EAX+4)</span> -<span id="L2362" class="LineNr">2362 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2363" class="LineNr">2363 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L2364" class="LineNr">2364 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2365" class="LineNr">2365 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2366" class="LineNr">2366 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L2367" class="LineNr">2367 </span> 89/copy 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 5/r32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy EBP to ESP</span> -<span id="L2368" class="LineNr">2368 </span> 5d/pop-to-EBP -<span id="L2369" class="LineNr">2369 </span> c3/return -<span id="L2370" class="LineNr">2370 </span> -<span id="L2371" class="LineNr">2371 </span><span class="subxTest">test-skip-string-works-from-mid-stream</span>: -<span id="L2372" class="LineNr">2372 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L2373" class="LineNr">2373 </span> 55/push-EBP -<span id="L2374" class="LineNr">2374 </span> 89/copy 3/mod/direct 5/rm32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ESP to EBP</span> -<span id="L2375" class="LineNr">2375 </span> <span class="subxComment"># setup</span> -<span id="L2376" class="LineNr">2376 </span> <span class="subxS1Comment"># . clear-stream(_test-input-stream)</span> -<span id="L2377" class="LineNr">2377 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2378" class="LineNr">2378 </span> 68/push <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 -<span id="L2379" class="LineNr">2379 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2380" class="LineNr">2380 </span> e8/call <a href='../055stream.subx.html#L17'>clear-stream</a>/disp32 -<span id="L2381" class="LineNr">2381 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2382" class="LineNr">2382 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2383" class="LineNr">2383 </span> <span class="subxS1Comment"># . write(_test-input-stream, "0 \"a\\\"b\"/yz")</span> -<span id="L2384" class="LineNr">2384 </span> <span class="subxS1Comment"># . indices: 01 2 34 56</span> -<span id="L2385" class="LineNr">2385 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2386" class="LineNr">2386 </span> 68/push <span class="Constant">"0 \"</span>a\\\<span class="Constant">"b\"</span>/yz"/imm32 -<span id="L2387" class="LineNr">2387 </span> 68/push <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 -<span id="L2388" class="LineNr">2388 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2389" class="LineNr">2389 </span> e8/call <a href='../057write.subx.html#L24'>write</a>/disp32 -<span id="L2390" class="LineNr">2390 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2391" class="LineNr">2391 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2392" class="LineNr">2392 </span> <span class="subxComment"># precondition: line->read == 2</span> -<span id="L2393" class="LineNr">2393 </span> c7 0/subop/copy 1/mod/*+disp8 0/rm32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/disp8 2/imm32 <span class="subxComment"># copy to *(EAX+4)</span> -<span id="L2394" class="LineNr">2394 </span> <span class="subxComment"># skip-string(_test-input-stream)</span> -<span id="L2395" class="LineNr">2395 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2396" class="LineNr">2396 </span> 68/push <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 -<span id="L2397" class="LineNr">2397 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2398" class="LineNr">2398 </span> e8/call <a href='dquotes.subx.html#L2175'>skip-string</a>/disp32 -<span id="L2399" class="LineNr">2399 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2400" class="LineNr">2400 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2401" class="LineNr">2401 </span> <span class="subxComment"># check-ints-equal(line->read, 8, msg)</span> -<span id="L2402" class="LineNr">2402 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2403" class="LineNr">2403 </span> 68/push <span class="Constant">"F - test-skip-string-works-from-mid-stream"</span>/imm32 -<span id="L2404" class="LineNr">2404 </span> 68/push 8/imm32 -<span id="L2405" class="LineNr">2405 </span> b8/copy-to-EAX <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 -<span id="L2406" class="LineNr">2406 </span> ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(EAX+4)</span> -<span id="L2407" class="LineNr">2407 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2408" class="LineNr">2408 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L2409" class="LineNr">2409 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2410" class="LineNr">2410 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2411" class="LineNr">2411 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L2412" class="LineNr">2412 </span> 89/copy 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 5/r32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy EBP to ESP</span> -<span id="L2413" class="LineNr">2413 </span> 5d/pop-to-EBP -<span id="L2414" class="LineNr">2414 </span> c3/return -<span id="L2415" class="LineNr">2415 </span> -<span id="L2416" class="LineNr">2416 </span><span class="subxFunction">skip-string-in-slice</span>: <span class="subxComment"># curr : (address byte), end : (address byte) -> new_curr/EAX</span> -<span id="L2417" class="LineNr">2417 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L2418" class="LineNr">2418 </span> 55/push-EBP -<span id="L2419" class="LineNr">2419 </span> 89/copy 3/mod/direct 5/rm32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ESP to EBP</span> -<span id="L2420" class="LineNr">2420 </span> <span class="subxS1Comment"># . save registers</span> -<span id="L2421" class="LineNr">2421 </span> 51/push-ECX -<span id="L2422" class="LineNr">2422 </span> 52/push-EDX -<span id="L2423" class="LineNr">2423 </span> 53/push-EBX -<span id="L2424" class="LineNr">2424 </span> <span class="subxComment"># ECX = curr</span> -<span id="L2425" class="LineNr">2425 </span> 8b/copy 1/mod/*+disp8 5/rm32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ECX 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(EBP+8) to ECX</span> -<span id="L2426" class="LineNr">2426 </span> <span class="subxComment"># EDX = end</span> -<span id="L2427" class="LineNr">2427 </span> 8b/copy 1/mod/*+disp8 5/rm32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/EDX 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(EBP+12) to EDX</span> -<span id="L2428" class="LineNr">2428 </span> <span class="subxComment"># EAX = 0</span> -<span id="L2429" class="LineNr">2429 </span> 31/xor 3/mod/direct 0/rm32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># clear EAX</span> -<span id="L2430" class="LineNr">2430 </span> <span class="subxComment"># skip initial dquote</span> -<span id="L2431" class="LineNr">2431 </span> 41/increment-ECX -<span id="L2432" class="LineNr">2432 </span><span class="Constant">$skip-string-in-slice:loop</span>: -<span id="L2433" class="LineNr">2433 </span> <span class="subxComment"># if (curr >= end) return curr</span> -<span id="L2434" class="LineNr">2434 </span> 39/compare 3/mod/direct 1/rm32/ECX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/EDX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># compare ECX with EDX</span> -<span id="L2435" class="LineNr">2435 </span> 73/jump-if-greater-unsigned-or-equal $skip-string-in-slice:return-curr/disp8 -<span id="L2436" class="LineNr">2436 </span> <span class="subxComment"># AL = *curr</span> -<span id="L2437" class="LineNr">2437 </span> 8a/copy-byte 0/mod/indirect 1/rm32/ECX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/AL <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy byte at *ECX to AL</span> -<span id="L2438" class="LineNr">2438 </span><span class="Constant">$skip-string-in-slice:dquote</span>: -<span id="L2439" class="LineNr">2439 </span> <span class="subxComment"># if (EAX == '"') break</span> -<span id="L2440" class="LineNr">2440 </span> 3d/compare-EAX-and 0x22/imm32/double-quote -<span id="L2441" class="LineNr">2441 </span> 74/jump-if-equal $skip-string-in-slice:break/disp8 -<span id="L2442" class="LineNr">2442 </span><span class="Constant">$skip-string-in-slice:check-for-escape</span>: -<span id="L2443" class="LineNr">2443 </span> <span class="subxComment"># if (EAX == '\') escape next char</span> -<span id="L2444" class="LineNr">2444 </span> 3d/compare-EAX-and 0x5c/imm32/backslash -<span id="L2445" class="LineNr">2445 </span> 75/jump-if-not-equal $skip-string-in-slice:continue/disp8 -<span id="L2446" class="LineNr">2446 </span><span class="Constant">$skip-string-in-slice:escape</span>: -<span id="L2447" class="LineNr">2447 </span> 41/increment-ECX -<span id="L2448" class="LineNr">2448 </span><span class="Constant">$skip-string-in-slice:continue</span>: -<span id="L2449" class="LineNr">2449 </span> <span class="subxComment"># ++curr</span> -<span id="L2450" class="LineNr">2450 </span> 41/increment-ECX -<span id="L2451" class="LineNr">2451 </span> eb/jump $skip-string-in-slice:loop/disp8 -<span id="L2452" class="LineNr">2452 </span><span class="Constant">$skip-string-in-slice:break</span>: -<span id="L2453" class="LineNr">2453 </span> <span class="subxComment"># skip final dquote</span> -<span id="L2454" class="LineNr">2454 </span> 41/increment-ECX -<span id="L2455" class="LineNr">2455 </span><span class="Constant">$skip-string-in-slice:return-curr</span>: -<span id="L2456" class="LineNr">2456 </span> <span class="subxComment"># return curr</span> -<span id="L2457" class="LineNr">2457 </span> 89/copy 3/mod/direct 0/rm32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ECX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ECX to EAX</span> -<span id="L2458" class="LineNr">2458 </span><span class="Constant">$skip-string-in-slice:end</span>: -<span id="L2459" class="LineNr">2459 </span> <span class="subxS1Comment"># . restore registers</span> -<span id="L2460" class="LineNr">2460 </span> 5b/pop-to-EBX -<span id="L2461" class="LineNr">2461 </span> 5a/pop-to-EDX -<span id="L2462" class="LineNr">2462 </span> 59/pop-to-ECX -<span id="L2463" class="LineNr">2463 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L2464" class="LineNr">2464 </span> 89/copy 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 5/r32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy EBP to ESP</span> -<span id="L2465" class="LineNr">2465 </span> 5d/pop-to-EBP -<span id="L2466" class="LineNr">2466 </span> c3/return -<span id="L2467" class="LineNr">2467 </span> -<span id="L2468" class="LineNr">2468 </span><span class="subxTest">test-skip-string-in-slice</span>: -<span id="L2469" class="LineNr">2469 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L2470" class="LineNr">2470 </span> 55/push-EBP -<span id="L2471" class="LineNr">2471 </span> 89/copy 3/mod/direct 5/rm32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ESP to EBP</span> -<span id="L2472" class="LineNr">2472 </span> <span class="subxComment"># setup: (EAX..ECX) = "\"abc\" def"</span> -<span id="L2473" class="LineNr">2473 </span> b8/copy-to-EAX <span class="Constant">"\"</span>abc\<span class="Constant">" def"</span>/imm32 -<span id="L2474" class="LineNr">2474 </span> 8b/copy 0/mod/indirect 0/rm32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ECX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *EAX to ECX</span> -<span id="L2475" class="LineNr">2475 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX <span class="Normal"> . </span> 1/r32/ECX 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy EAX+ECX+4 to ECX</span> -<span id="L2476" class="LineNr">2476 </span> 05/add-to-EAX 4/imm32 -<span id="L2477" class="LineNr">2477 </span> <span class="subxComment"># EAX = skip-string-in-slice(EAX, ECX)</span> -<span id="L2478" class="LineNr">2478 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2479" class="LineNr">2479 </span> 51/push-ECX -<span id="L2480" class="LineNr">2480 </span> 50/push-EAX -<span id="L2481" class="LineNr">2481 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2482" class="LineNr">2482 </span> e8/call <a href='dquotes.subx.html#L2416'>skip-string-in-slice</a>/disp32 -<span id="L2483" class="LineNr">2483 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2484" class="LineNr">2484 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2485" class="LineNr">2485 </span> <span class="subxComment"># check-ints-equal(ECX-EAX, 4, msg) # number of chars remaining after the string literal</span> -<span id="L2486" class="LineNr">2486 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2487" class="LineNr">2487 </span> 68/push <span class="Constant">"F - test-skip-string-in-slice"</span>/imm32 -<span id="L2488" class="LineNr">2488 </span> 68/push 4/imm32 -<span id="L2489" class="LineNr">2489 </span> <span class="subxS2Comment"># . . push ECX-EAX</span> -<span id="L2490" class="LineNr">2490 </span> 29/subtract 3/mod/direct 1/rm32/ECX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># subtract EAX from ECX</span> -<span id="L2491" class="LineNr">2491 </span> 51/push-ECX -<span id="L2492" class="LineNr">2492 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2493" class="LineNr">2493 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L2494" class="LineNr">2494 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2495" class="LineNr">2495 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2496" class="LineNr">2496 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L2497" class="LineNr">2497 </span> 89/copy 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 5/r32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy EBP to ESP</span> -<span id="L2498" class="LineNr">2498 </span> 5d/pop-to-EBP -<span id="L2499" class="LineNr">2499 </span> c3/return -<span id="L2500" class="LineNr">2500 </span> -<span id="L2501" class="LineNr">2501 </span><span class="subxTest">test-skip-string-in-slice-ignores-spaces</span>: -<span id="L2502" class="LineNr">2502 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L2503" class="LineNr">2503 </span> 55/push-EBP -<span id="L2504" class="LineNr">2504 </span> 89/copy 3/mod/direct 5/rm32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ESP to EBP</span> -<span id="L2505" class="LineNr">2505 </span> <span class="subxComment"># setup: (EAX..ECX) = "\"a b\"/yz"</span> -<span id="L2506" class="LineNr">2506 </span> b8/copy-to-EAX <span class="Constant">"\"</span>a b\<span class="Constant">"/yz"</span>/imm32 -<span id="L2507" class="LineNr">2507 </span> 8b/copy 0/mod/indirect 0/rm32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ECX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *EAX to ECX</span> -<span id="L2508" class="LineNr">2508 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX <span class="Normal"> . </span> 1/r32/ECX 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy EAX+ECX+4 to ECX</span> -<span id="L2509" class="LineNr">2509 </span> 05/add-to-EAX 4/imm32 -<span id="L2510" class="LineNr">2510 </span> <span class="subxComment"># EAX = skip-string-in-slice(EAX, ECX)</span> -<span id="L2511" class="LineNr">2511 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2512" class="LineNr">2512 </span> 51/push-ECX -<span id="L2513" class="LineNr">2513 </span> 50/push-EAX -<span id="L2514" class="LineNr">2514 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2515" class="LineNr">2515 </span> e8/call <a href='dquotes.subx.html#L2416'>skip-string-in-slice</a>/disp32 -<span id="L2516" class="LineNr">2516 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2517" class="LineNr">2517 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2518" class="LineNr">2518 </span> <span class="subxComment"># check-ints-equal(ECX-EAX, 3, msg) # number of chars remaining after the string literal</span> -<span id="L2519" class="LineNr">2519 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2520" class="LineNr">2520 </span> 68/push <span class="Constant">"F - test-skip-string-in-slice-ignores-spaces"</span>/imm32 -<span id="L2521" class="LineNr">2521 </span> 68/push 3/imm32 -<span id="L2522" class="LineNr">2522 </span> <span class="subxS2Comment"># . . push ECX-EAX</span> -<span id="L2523" class="LineNr">2523 </span> 29/subtract 3/mod/direct 1/rm32/ECX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># subtract EAX from ECX</span> -<span id="L2524" class="LineNr">2524 </span> 51/push-ECX -<span id="L2525" class="LineNr">2525 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2526" class="LineNr">2526 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L2527" class="LineNr">2527 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2528" class="LineNr">2528 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2529" class="LineNr">2529 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L2530" class="LineNr">2530 </span> 89/copy 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 5/r32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy EBP to ESP</span> -<span id="L2531" class="LineNr">2531 </span> 5d/pop-to-EBP -<span id="L2532" class="LineNr">2532 </span> c3/return -<span id="L2533" class="LineNr">2533 </span> -<span id="L2534" class="LineNr">2534 </span><span class="subxTest">test-skip-string-in-slice-ignores-escapes</span>: -<span id="L2535" class="LineNr">2535 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L2536" class="LineNr">2536 </span> 55/push-EBP -<span id="L2537" class="LineNr">2537 </span> 89/copy 3/mod/direct 5/rm32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ESP to EBP</span> -<span id="L2538" class="LineNr">2538 </span> <span class="subxComment"># setup: (EAX..ECX) = "\"a\\\"b\"/yz"</span> -<span id="L2539" class="LineNr">2539 </span> b8/copy-to-EAX <span class="Constant">"\"</span>a\\\<span class="Constant">"b\"</span>/yz"/imm32 -<span id="L2540" class="LineNr">2540 </span> 8b/copy 0/mod/indirect 0/rm32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ECX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *EAX to ECX</span> -<span id="L2541" class="LineNr">2541 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX <span class="Normal"> . </span> 1/r32/ECX 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy EAX+ECX+4 to ECX</span> -<span id="L2542" class="LineNr">2542 </span> 05/add-to-EAX 4/imm32 -<span id="L2543" class="LineNr">2543 </span> <span class="subxComment"># EAX = skip-string-in-slice(EAX, ECX)</span> -<span id="L2544" class="LineNr">2544 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2545" class="LineNr">2545 </span> 51/push-ECX -<span id="L2546" class="LineNr">2546 </span> 50/push-EAX -<span id="L2547" class="LineNr">2547 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2548" class="LineNr">2548 </span> e8/call <a href='dquotes.subx.html#L2416'>skip-string-in-slice</a>/disp32 -<span id="L2549" class="LineNr">2549 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2550" class="LineNr">2550 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2551" class="LineNr">2551 </span> <span class="subxComment"># check-ints-equal(ECX-EAX, 3, msg) # number of chars remaining after the string literal</span> -<span id="L2552" class="LineNr">2552 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2553" class="LineNr">2553 </span> 68/push <span class="Constant">"F - test-skip-string-in-slice-ignores-escapes"</span>/imm32 -<span id="L2554" class="LineNr">2554 </span> 68/push 3/imm32 -<span id="L2555" class="LineNr">2555 </span> <span class="subxS2Comment"># . . push ECX-EAX</span> -<span id="L2556" class="LineNr">2556 </span> 29/subtract 3/mod/direct 1/rm32/ECX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># subtract EAX from ECX</span> -<span id="L2557" class="LineNr">2557 </span> 51/push-ECX -<span id="L2558" class="LineNr">2558 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2559" class="LineNr">2559 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L2560" class="LineNr">2560 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2561" class="LineNr">2561 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2562" class="LineNr">2562 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L2563" class="LineNr">2563 </span> 89/copy 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 5/r32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy EBP to ESP</span> -<span id="L2564" class="LineNr">2564 </span> 5d/pop-to-EBP -<span id="L2565" class="LineNr">2565 </span> c3/return -<span id="L2566" class="LineNr">2566 </span> -<span id="L2567" class="LineNr">2567 </span><span class="subxTest">test-skip-string-in-slice-stops-at-end</span>: -<span id="L2568" class="LineNr">2568 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L2569" class="LineNr">2569 </span> 55/push-EBP -<span id="L2570" class="LineNr">2570 </span> 89/copy 3/mod/direct 5/rm32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ESP to EBP</span> -<span id="L2571" class="LineNr">2571 </span> <span class="subxComment"># setup: (EAX..ECX) = "\"abc" # unbalanced dquote</span> -<span id="L2572" class="LineNr">2572 </span> b8/copy-to-EAX <span class="Constant">"\"</span>abc"/imm32 -<span id="L2573" class="LineNr">2573 </span> 8b/copy 0/mod/indirect 0/rm32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ECX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *EAX to ECX</span> -<span id="L2574" class="LineNr">2574 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX <span class="Normal"> . </span> 1/r32/ECX 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy EAX+ECX+4 to ECX</span> -<span id="L2575" class="LineNr">2575 </span> 05/add-to-EAX 4/imm32 -<span id="L2576" class="LineNr">2576 </span> <span class="subxComment"># EAX = skip-string-in-slice(EAX, ECX)</span> -<span id="L2577" class="LineNr">2577 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2578" class="LineNr">2578 </span> 51/push-ECX -<span id="L2579" class="LineNr">2579 </span> 50/push-EAX -<span id="L2580" class="LineNr">2580 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2581" class="LineNr">2581 </span> e8/call <a href='dquotes.subx.html#L2416'>skip-string-in-slice</a>/disp32 -<span id="L2582" class="LineNr">2582 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2583" class="LineNr">2583 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2584" class="LineNr">2584 </span> <span class="subxComment"># check-ints-equal(ECX-EAX, 0, msg) # skipped to end of slice</span> -<span id="L2585" class="LineNr">2585 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2586" class="LineNr">2586 </span> 68/push <span class="Constant">"F - test-skip-string-in-slice-stops-at-end"</span>/imm32 -<span id="L2587" class="LineNr">2587 </span> 68/push 0/imm32 -<span id="L2588" class="LineNr">2588 </span> <span class="subxS2Comment"># . . push ECX-EAX</span> -<span id="L2589" class="LineNr">2589 </span> 29/subtract 3/mod/direct 1/rm32/ECX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># subtract EAX from ECX</span> -<span id="L2590" class="LineNr">2590 </span> 51/push-ECX -<span id="L2591" class="LineNr">2591 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2592" class="LineNr">2592 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L2593" class="LineNr">2593 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2594" class="LineNr">2594 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2595" class="LineNr">2595 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L2596" class="LineNr">2596 </span> 89/copy 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 5/r32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy EBP to ESP</span> -<span id="L2597" class="LineNr">2597 </span> 5d/pop-to-EBP -<span id="L2598" class="LineNr">2598 </span> c3/return -<span id="L2599" class="LineNr">2599 </span> -<span id="L2600" class="LineNr">2600 </span><span class="subxFunction">string-length-at-start-of-slice</span>: <span class="subxComment"># curr : (address byte), end : (address byte) -> length/EAX</span> -<span id="L2601" class="LineNr">2601 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L2602" class="LineNr">2602 </span> 55/push-EBP -<span id="L2603" class="LineNr">2603 </span> 89/copy 3/mod/direct 5/rm32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ESP to EBP</span> -<span id="L2604" class="LineNr">2604 </span> <span class="subxS1Comment"># . save registers</span> -<span id="L2605" class="LineNr">2605 </span> 51/push-ECX -<span id="L2606" class="LineNr">2606 </span> 52/push-EDX -<span id="L2607" class="LineNr">2607 </span> 53/push-EBX -<span id="L2608" class="LineNr">2608 </span> <span class="subxComment"># ECX = curr</span> -<span id="L2609" class="LineNr">2609 </span> 8b/copy 1/mod/*+disp8 5/rm32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ECX 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(EBP+8) to ECX</span> -<span id="L2610" class="LineNr">2610 </span> <span class="subxComment"># EDX = end</span> -<span id="L2611" class="LineNr">2611 </span> 8b/copy 1/mod/*+disp8 5/rm32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/EDX 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(EBP+12) to EDX</span> -<span id="L2612" class="LineNr">2612 </span> <span class="subxComment"># length/EAX = 0</span> -<span id="L2613" class="LineNr">2613 </span> 31/xor 3/mod/direct 0/rm32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># clear EAX</span> -<span id="L2614" class="LineNr">2614 </span> <span class="subxComment"># EBX = 0</span> -<span id="L2615" class="LineNr">2615 </span> 31/xor 3/mod/direct 3/rm32/EBX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 3/r32/EBX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># clear EBX</span> -<span id="L2616" class="LineNr">2616 </span> <span class="subxComment"># skip initial dquote</span> -<span id="L2617" class="LineNr">2617 </span> 41/increment-ECX -<span id="L2618" class="LineNr">2618 </span><span class="Constant">$string-length-at-start-of-slice:loop</span>: -<span id="L2619" class="LineNr">2619 </span> <span class="subxComment"># if (curr >= end) return length</span> -<span id="L2620" class="LineNr">2620 </span> 39/compare 3/mod/direct 1/rm32/ECX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/EDX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># compare ECX with EDX</span> -<span id="L2621" class="LineNr">2621 </span> 73/jump-if-greater-unsigned-or-equal $string-length-at-start-of-slice:end/disp8 -<span id="L2622" class="LineNr">2622 </span> <span class="subxComment"># BL = *curr</span> -<span id="L2623" class="LineNr">2623 </span> 8a/copy-byte 0/mod/indirect 1/rm32/ECX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 3/r32/BL <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy byte at *ECX to BL</span> -<span id="L2624" class="LineNr">2624 </span><span class="Constant">$string-length-at-start-of-slice:dquote</span>: -<span id="L2625" class="LineNr">2625 </span> <span class="subxComment"># if (EBX == '"') break</span> -<span id="L2626" class="LineNr">2626 </span> 81 7/subop/compare 3/mod/direct 3/rm32/EBX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x22/imm32/dquote <span class="subxComment"># compare EBX</span> -<span id="L2627" class="LineNr">2627 </span> 74/jump-if-equal $string-length-at-start-of-slice:end/disp8 -<span id="L2628" class="LineNr">2628 </span><span class="Constant">$string-length-at-start-of-slice:check-for-escape</span>: -<span id="L2629" class="LineNr">2629 </span> <span class="subxComment"># if (EBX == '\') escape next char</span> -<span id="L2630" class="LineNr">2630 </span> 81 7/subop/compare 3/mod/direct 3/rm32/EBX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x5c/imm32/backslash <span class="subxComment"># compare EBX</span> -<span id="L2631" class="LineNr">2631 </span> 75/jump-if-not-equal $string-length-at-start-of-slice:continue/disp8 -<span id="L2632" class="LineNr">2632 </span><span class="Constant">$string-length-at-start-of-slice:escape</span>: -<span id="L2633" class="LineNr">2633 </span> <span class="subxComment"># increment curr but not result</span> -<span id="L2634" class="LineNr">2634 </span> 41/increment-ECX -<span id="L2635" class="LineNr">2635 </span><span class="Constant">$string-length-at-start-of-slice:continue</span>: -<span id="L2636" class="LineNr">2636 </span> <span class="subxComment"># ++result</span> -<span id="L2637" class="LineNr">2637 </span> 40/increment-EAX -<span id="L2638" class="LineNr">2638 </span> <span class="subxComment"># ++curr</span> -<span id="L2639" class="LineNr">2639 </span> 41/increment-ECX -<span id="L2640" class="LineNr">2640 </span> eb/jump $string-length-at-start-of-slice:loop/disp8 -<span id="L2641" class="LineNr">2641 </span><span class="Constant">$string-length-at-start-of-slice:end</span>: -<span id="L2642" class="LineNr">2642 </span> <span class="subxS1Comment"># . restore registers</span> -<span id="L2643" class="LineNr">2643 </span> 5b/pop-to-EBX -<span id="L2644" class="LineNr">2644 </span> 5a/pop-to-EDX -<span id="L2645" class="LineNr">2645 </span> 59/pop-to-ECX -<span id="L2646" class="LineNr">2646 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L2647" class="LineNr">2647 </span> 89/copy 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 5/r32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy EBP to ESP</span> -<span id="L2648" class="LineNr">2648 </span> 5d/pop-to-EBP -<span id="L2649" class="LineNr">2649 </span> c3/return -<span id="L2650" class="LineNr">2650 </span> -<span id="L2651" class="LineNr">2651 </span><span class="subxTest">test-string-length-at-start-of-slice</span>: -<span id="L2652" class="LineNr">2652 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L2653" class="LineNr">2653 </span> 55/push-EBP -<span id="L2654" class="LineNr">2654 </span> 89/copy 3/mod/direct 5/rm32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ESP to EBP</span> -<span id="L2655" class="LineNr">2655 </span> <span class="subxComment"># setup: (EAX..ECX) = "\"abc\" def"</span> -<span id="L2656" class="LineNr">2656 </span> b8/copy-to-EAX <span class="Constant">"\"</span>abc\<span class="Constant">" def"</span>/imm32 -<span id="L2657" class="LineNr">2657 </span> 8b/copy 0/mod/indirect 0/rm32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ECX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *EAX to ECX</span> -<span id="L2658" class="LineNr">2658 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX <span class="Normal"> . </span> 1/r32/ECX 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy EAX+ECX+4 to ECX</span> -<span id="L2659" class="LineNr">2659 </span> 05/add-to-EAX 4/imm32 -<span id="L2660" class="LineNr">2660 </span> <span class="subxComment"># EAX = string-length-at-start-of-slice(EAX, ECX)</span> -<span id="L2661" class="LineNr">2661 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2662" class="LineNr">2662 </span> 51/push-ECX -<span id="L2663" class="LineNr">2663 </span> 50/push-EAX -<span id="L2664" class="LineNr">2664 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2665" class="LineNr">2665 </span> e8/call <a href='dquotes.subx.html#L2600'>string-length-at-start-of-slice</a>/disp32 -<span id="L2666" class="LineNr">2666 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2667" class="LineNr">2667 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2668" class="LineNr">2668 </span> <span class="subxComment"># check-ints-equal(EAX, 3, msg)</span> -<span id="L2669" class="LineNr">2669 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2670" class="LineNr">2670 </span> 68/push <span class="Constant">"F - test-string-length-at-start-of-slice"</span>/imm32 -<span id="L2671" class="LineNr">2671 </span> 68/push 3/imm32 -<span id="L2672" class="LineNr">2672 </span> 50/push-EAX -<span id="L2673" class="LineNr">2673 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2674" class="LineNr">2674 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L2675" class="LineNr">2675 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2676" class="LineNr">2676 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2677" class="LineNr">2677 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L2678" class="LineNr">2678 </span> 89/copy 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 5/r32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy EBP to ESP</span> -<span id="L2679" class="LineNr">2679 </span> 5d/pop-to-EBP -<span id="L2680" class="LineNr">2680 </span> c3/return -<span id="L2681" class="LineNr">2681 </span> -<span id="L2682" class="LineNr">2682 </span><span class="subxTest">test-string-length-at-start-of-slice-escaped</span>: -<span id="L2683" class="LineNr">2683 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L2684" class="LineNr">2684 </span> 55/push-EBP -<span id="L2685" class="LineNr">2685 </span> 89/copy 3/mod/direct 5/rm32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ESP to EBP</span> -<span id="L2686" class="LineNr">2686 </span> <span class="subxComment"># setup: (EAX..ECX) = "\"ab\\c\" def"</span> -<span id="L2687" class="LineNr">2687 </span> b8/copy-to-EAX <span class="Constant">"\"</span>ab\\c\<span class="Constant">" def"</span>/imm32 -<span id="L2688" class="LineNr">2688 </span> 8b/copy 0/mod/indirect 0/rm32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ECX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *EAX to ECX</span> -<span id="L2689" class="LineNr">2689 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX <span class="Normal"> . </span> 1/r32/ECX 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy EAX+ECX+4 to ECX</span> -<span id="L2690" class="LineNr">2690 </span> 05/add-to-EAX 4/imm32 -<span id="L2691" class="LineNr">2691 </span> <span class="subxComment"># EAX = string-length-at-start-of-slice(EAX, ECX)</span> -<span id="L2692" class="LineNr">2692 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2693" class="LineNr">2693 </span> 51/push-ECX -<span id="L2694" class="LineNr">2694 </span> 50/push-EAX -<span id="L2695" class="LineNr">2695 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2696" class="LineNr">2696 </span> e8/call <a href='dquotes.subx.html#L2600'>string-length-at-start-of-slice</a>/disp32 -<span id="L2697" class="LineNr">2697 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2698" class="LineNr">2698 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2699" class="LineNr">2699 </span> <span class="subxComment"># check-ints-equal(EAX, 3, msg)</span> -<span id="L2700" class="LineNr">2700 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2701" class="LineNr">2701 </span> 68/push <span class="Constant">"F - test-string-length-at-start-of-slice-escaped"</span>/imm32 -<span id="L2702" class="LineNr">2702 </span> 68/push 3/imm32 -<span id="L2703" class="LineNr">2703 </span> 50/push-EAX -<span id="L2704" class="LineNr">2704 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2705" class="LineNr">2705 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L2706" class="LineNr">2706 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2707" class="LineNr">2707 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2708" class="LineNr">2708 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L2709" class="LineNr">2709 </span> 89/copy 3/mod/direct 4/rm32/ESP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 5/r32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy EBP to ESP</span> -<span id="L2710" class="LineNr">2710 </span> 5d/pop-to-EBP -<span id="L2711" class="LineNr">2711 </span> c3/return -<span id="L2712" class="LineNr">2712 </span> -<span id="L2713" class="LineNr">2713 </span>== data -<span id="L2714" class="LineNr">2714 </span> -<span id="L2715" class="LineNr">2715 </span><span class="SpecialChar">Next-string-literal</span>: <span class="subxComment"># tracks the next auto-generated variable name</span> -<span id="L2716" class="LineNr">2716 </span> 1/imm32 -<span id="L2717" class="LineNr">2717 </span> -<span id="L2718" class="LineNr">2718 </span><span class="subxComment"># length-prefixed string containing just a single space</span> -<span id="L2719" class="LineNr">2719 </span><span class="SpecialChar">Space</span>: -<span id="L2720" class="LineNr">2720 </span> <span class="subxComment"># size</span> -<span id="L2721" class="LineNr">2721 </span> 1/imm32 -<span id="L2722" class="LineNr">2722 </span> <span class="subxComment"># data</span> -<span id="L2723" class="LineNr">2723 </span> 20/space -<span id="L2724" class="LineNr">2724 </span> -<span id="L2725" class="LineNr">2725 </span><span class="subxComment"># length-prefixed string containing just a single slash</span> -<span id="L2726" class="LineNr">2726 </span><span class="SpecialChar">Slash</span>: -<span id="L2727" class="LineNr">2727 </span> <span class="subxComment"># size</span> -<span id="L2728" class="LineNr">2728 </span> 1/imm32 -<span id="L2729" class="LineNr">2729 </span> <span class="subxComment"># data</span> -<span id="L2730" class="LineNr">2730 </span> 2f/slash -<span id="L2731" class="LineNr">2731 </span> -<span id="L2732" class="LineNr">2732 </span><span class="subxMinorFunction">_test-slice-abc</span>: -<span id="L2733" class="LineNr">2733 </span> 22/dquote 61/a 62/b 63/c 22/dquote <span class="subxComment"># "abc"</span> -<span id="L2734" class="LineNr">2734 </span> 2f/slash 64/d -<span id="L2735" class="LineNr">2735 </span><span class="subxMinorFunction">_test-slice-abc-limit</span>: -<span id="L2736" class="LineNr">2736 </span> -<span id="L2737" class="LineNr">2737 </span><span class="subxMinorFunction">_test-slice-a-space-b</span>: -<span id="L2738" class="LineNr">2738 </span> 22/dquote 61/a 20/space 62/b 22/dquote <span class="subxComment"># "a b"</span> -<span id="L2739" class="LineNr">2739 </span><span class="subxMinorFunction">_test-slice-a-space-b-limit</span>: -<span id="L2740" class="LineNr">2740 </span> -<span id="L2741" class="LineNr">2741 </span><span class="subxMinorFunction">_test-slice-a-dquote-b</span>: -<span id="L2742" class="LineNr">2742 </span> 22/dquote 61/a 5c/backslash 22/dquote 62/b 22/dquote <span class="subxComment"># "a\"b"</span> -<span id="L2743" class="LineNr">2743 </span><span class="subxMinorFunction">_test-slice-a-dquote-b-limit</span>: -<span id="L2744" class="LineNr">2744 </span> -<span id="L2745" class="LineNr">2745 </span><span class="subxMinorFunction">_test-slice-a-newline-b</span>: -<span id="L2746" class="LineNr">2746 </span> 22/dquote 61/a 5c/backslash 6e/n 62/b 22/dquote <span class="subxComment"># "a\nb"</span> -<span id="L2747" class="LineNr">2747 </span><span class="subxMinorFunction">_test-slice-a-newline-b-limit</span>: -<span id="L2748" class="LineNr">2748 </span> -<span id="L2749" class="LineNr">2749 </span><span class="subxComment"># "abc/def"/ghi</span> -<span id="L2750" class="LineNr">2750 </span><span class="subxMinorFunction">_test-slice-literal-string</span>: -<span id="L2751" class="LineNr">2751 </span> 22/dquote -<span id="L2752" class="LineNr">2752 </span> 61/a 62/b 63/c <span class="subxComment"># abc</span> -<span id="L2753" class="LineNr">2753 </span> 2f/slash 64/d 65/e 66/f <span class="subxComment"># /def</span> -<span id="L2754" class="LineNr">2754 </span> 22/dquote -<span id="L2755" class="LineNr">2755 </span> 2f/slash 67/g 68/h 69/i <span class="subxComment"># /ghi</span> -<span id="L2756" class="LineNr">2756 </span><span class="subxMinorFunction">_test-slice-literal-string-with-limit</span>: -<span id="L2757" class="LineNr">2757 </span> -<span id="L2758" class="LineNr">2758 </span><span class="subxS2Comment"># . . vim:nowrap:textwidth=0</span> +<span id="L2318" class="LineNr">2318 </span><span class="subxMinorFunction">_test-slice-a-newline-b</span>: +<span id="L2319" class="LineNr">2319 </span> 22/dquote 61/a 5c/backslash 6e/n 62/b 22/dquote <span class="subxComment"># "a\nb"</span> +<span id="L2320" class="LineNr">2320 </span><span class="subxMinorFunction">_test-slice-a-newline-b-limit</span>: +<span id="L2321" class="LineNr">2321 </span> +<span id="L2322" class="LineNr">2322 </span><span class="subxComment"># "abc/def"/ghi</span> +<span id="L2323" class="LineNr">2323 </span><span class="subxMinorFunction">_test-slice-literal-string</span>: +<span id="L2324" class="LineNr">2324 </span> 22/dquote +<span id="L2325" class="LineNr">2325 </span> 61/a 62/b 63/c <span class="subxComment"># abc</span> +<span id="L2326" class="LineNr">2326 </span> 2f/slash 64/d 65/e 66/f <span class="subxComment"># /def</span> +<span id="L2327" class="LineNr">2327 </span> 22/dquote +<span id="L2328" class="LineNr">2328 </span> 2f/slash 67/g 68/h 69/i <span class="subxComment"># /ghi</span> +<span id="L2329" class="LineNr">2329 </span><span class="subxMinorFunction">_test-slice-literal-string-with-limit</span>: +<span id="L2330" class="LineNr">2330 </span> +<span id="L2331" class="LineNr">2331 </span><span class="subxS2Comment"># . . vim:nowrap:textwidth=0</span> </pre> </body> </html> |