diff options
-rwxr-xr-x | apps/desugar | bin | 48096 -> 48753 bytes | |||
-rw-r--r-- | apps/desugar.subx | 190 | ||||
-rw-r--r-- | html/apps/desugar.subx.html | 4324 |
3 files changed, 2429 insertions, 2085 deletions
diff --git a/apps/desugar b/apps/desugar index 53e23663..0215d324 100755 --- a/apps/desugar +++ b/apps/desugar Binary files differdiff --git a/apps/desugar.subx b/apps/desugar.subx index 7d001b02..c100520e 100644 --- a/apps/desugar.subx +++ b/apps/desugar.subx @@ -1804,7 +1804,7 @@ parse-effective-address: # word : (address slice) -> base/EAX, index/ECX, scale # skip whitespace # if (*word->start == ')') goto end # if (*word->start == '-') goto displacement - # if (*word->start != '+') goto error2 + # if (*word->start != '+') goto error1 # ++word->start to skip '+' # skip whitespace # if next 3 characters don't make a register, goto displacement @@ -1813,18 +1813,18 @@ parse-effective-address: # word : (address slice) -> base/EAX, index/ECX, scale # if (*word->start == ')') goto end # if (*word->start == '<') { # ++word->start to skip '<' - # if (*word->start != '<') goto error3 + # if (*word->start != '<') goto error2 # ++word->start to skip '<' # skip whitespace # read integer into scale # skip whitespace # if (*word->start == ')') goto end # } - # if (*word->start not in '+' '-') goto error4 + # if (*word->start not in '+' '-') goto error3 # displacement: # read integer into disp # skip whitespace - # if (*word->start != ')') goto error5 + # if (*word->start != ')') goto error4 # . prolog 55/push-EBP 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP @@ -1907,7 +1907,9 @@ $parse-effective-address:compound-expression: # if (*word->start == '-') goto displacement 3d/compare-EAX-and 0x2d/imm32/minus 0f 84/jump-if-equal $parse-effective-address:displacement/disp32 - # if (*word->start != '+') goto error2 + # if (*word->start != '+') goto error1 + 3d/compare-EAX-and 0x2b/imm32/plus + 0f 85/jump-if-not-equal $parse-effective-address:error1/disp32 $parse-effective-address:check-for-index: # ++word->start to skip '+' ff 0/subop/increment 0/mod/indirect 6/rm32/ESI . . . . . . # increment *ESI @@ -1978,14 +1980,19 @@ $parse-effective-address:index: 8a/copy-byte 0/mod/indirect 0/rm32/EAX . . . 0/r32/AL . . # copy byte at *EAX to AL 81 4/subop/and 3/mod/direct 0/rm32/EAX . . . . . 0xff/imm32 # bitwise and of EAX 3d/compare-EAX-and 0x29/imm32/close-paren - 74/jump-if-equal $parse-effective-address:end/disp8 + 0f 84/jump-if-equal $parse-effective-address:end/disp32 $parse-effective-address:check-for-scale: # if (*word->start != '<') goto next check 3d/compare-EAX-and 0x3c/imm32/less-than 75/jump-if-not-equal $parse-effective-address:check-for-displacement/disp8 # ++word->start to skip '<' ff 0/subop/increment 0/mod/indirect 6/rm32/ESI . . . . . . # increment *ESI - # if (*word->start != '<') goto error3 + # if (*word->start != '<') goto error2 + 8b/copy 0/mod/indirect 6/rm32/ESI . . . 0/r32/EAX . . # copy *ESI to EAX + 8a/copy-byte 0/mod/indirect 0/rm32/EAX . . . 0/r32/AL . . # copy byte at *EAX to AL + 81 4/subop/and 3/mod/direct 0/rm32/EAX . . . . . 0xff/imm32 # bitwise and of EAX + 3d/compare-EAX-and 0x3c/imm32/less-than + 0f 85/jump-if-not-equal $parse-effective-address:error2/disp32 # ++word->start to skip '<' ff 0/subop/increment 0/mod/indirect 6/rm32/ESI . . . . . . # increment *ESI # skip whitespace @@ -2027,7 +2034,12 @@ $parse-effective-address:scale: 3d/compare-EAX-and 0x29/imm32/close-paren 74/jump-if-equal $parse-effective-address:end/disp8 $parse-effective-address:check-for-displacement: - # if (*word->start not in '+' '-') goto error4 + # if (*word->start not in '+' '-') goto error3 + 3d/compare-EAX-and 0x2b/imm32/plus + 74/jump-if-equal $parse-effective-address:displacement/disp8 + 3d/compare-EAX-and 0x2d/imm32/minus + 74/jump-if-equal $parse-effective-address:displacement/disp8 + e9/jump $parse-effective-address:error3/disp32 $parse-effective-address:displacement: # read integer into disp # . EAX = next-hex-int(word) @@ -2050,7 +2062,11 @@ $parse-effective-address:displacement: 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP # . word->start = EAX 89/copy 0/mod/indirect 6/rm32/ESI . . . 0/r32/EAX . . # copy EAX to *ESI - # if (*word->start != ')') goto error5 + # if (*word->start != ')') goto error4 + 8a/copy-byte 0/mod/indirect 0/rm32/EAX . . . 0/r32/AL . . # copy byte at *EAX to AL + 81 4/subop/and 3/mod/direct 0/rm32/EAX . . . . . 0xff/imm32 # bitwise and of EAX + 3d/compare-EAX-and 0x29/imm32/close-paren + 0f 85/jump-if-not-equal $parse-effective-address:error4/disp32 $parse-effective-address:end: # return base in EAX 89/copy 3/mod/direct 0/rm32/EAX . . . 7/r32/EDI . . # copy EDI to EAX @@ -2062,6 +2078,162 @@ $parse-effective-address:end: 5d/pop-to-EBP c3/return +$parse-effective-address:error1: + # print(stderr, "error: unexpected character: " EAX "\n") + # . write-buffered(Stderr, "error: unexpected character: ") + # . . push args + 68/push "error: unexpected character: "/imm32 + 68/push Stderr/imm32 + # . . call + e8/call write-buffered/disp32 + # . . discard args + 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP + # . print-int32-buffered(out, EAX) + # . . push args + 50/push-EAX + 68/push Stderr/imm32 + # . . call + e8/call print-int32-buffered/disp32 + # . . discard args + 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP + # . write-buffered(Stderr, "\n") + # . . push args + 68/push "\n"/imm32 + 68/push Stderr/imm32 + # . . call + e8/call write-buffered/disp32 + # . . discard args + 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP + # . flush(Stderr) + # . . push args + 68/push Stderr/imm32 + # . . call + e8/call flush/disp32 + # . . discard args + 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP + # . syscall(exit, 1) + bb/copy-to-EBX 1/imm32 + b8/copy-to-EAX 1/imm32/exit + cd/syscall 0x80/imm8 + # never gets here + +$parse-effective-address:error2: + # print(stderr, "error: '<' can only be followed by '<' but got: " EAX "\n") + # . write-buffered(Stderr, "error: '<' can only be followed by '<' but got: ") + # . . push args + 68/push "error: '<' can only be followed by '<' but got: "/imm32 + 68/push Stderr/imm32 + # . . call + e8/call write-buffered/disp32 + # . . discard args + 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP + # . print-int32-buffered(out, EAX) + # . . push args + 50/push-EAX + 68/push Stderr/imm32 + # . . call + e8/call print-int32-buffered/disp32 + # . . discard args + 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP + # . write-buffered(Stderr, "\n") + # . . push args + 68/push "\n"/imm32 + 68/push Stderr/imm32 + # . . call + e8/call write-buffered/disp32 + # . . discard args + 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP + # . flush(Stderr) + # . . push args + 68/push Stderr/imm32 + # . . call + e8/call flush/disp32 + # . . discard args + 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP + # . syscall(exit, 1) + bb/copy-to-EBX 1/imm32 + b8/copy-to-EAX 1/imm32/exit + cd/syscall 0x80/imm8 + # never gets here + +$parse-effective-address:error3: + # print(stderr, "error: unexpected character before displacement: " EAX "\n") + # . write-buffered(Stderr, "error: unexpected character before displacement: ") + # . . push args + 68/push "error: unexpected character before displacement: "/imm32 + 68/push Stderr/imm32 + # . . call + e8/call write-buffered/disp32 + # . . discard args + 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP + # . print-int32-buffered(out, EAX) + # . . push args + 50/push-EAX + 68/push Stderr/imm32 + # . . call + e8/call print-int32-buffered/disp32 + # . . discard args + 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP + # . write-buffered(Stderr, "\n") + # . . push args + 68/push "\n"/imm32 + 68/push Stderr/imm32 + # . . call + e8/call write-buffered/disp32 + # . . discard args + 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP + # . flush(Stderr) + # . . push args + 68/push Stderr/imm32 + # . . call + e8/call flush/disp32 + # . . discard args + 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP + # . syscall(exit, 1) + bb/copy-to-EBX 1/imm32 + b8/copy-to-EAX 1/imm32/exit + cd/syscall 0x80/imm8 + # never gets here + +$parse-effective-address:error4: + # print(stderr, "error: unexpected character after displacement: " EAX "; expected ')' to wrap up\n") + # . write-buffered(Stderr, "error: unexpected character after displacement: ") + # . . push args + 68/push "error: unexpected character after displacement: "/imm32 + 68/push Stderr/imm32 + # . . call + e8/call write-buffered/disp32 + # . . discard args + 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP + # . print-int32-buffered(out, EAX) + # . . push args + 50/push-EAX + 68/push Stderr/imm32 + # . . call + e8/call print-int32-buffered/disp32 + # . . discard args + 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP + # . write-buffered(Stderr, "; expected ')' to wrap up\n") + # . . push args + 68/push "; expected ')' to wrap up\n"/imm32 + 68/push Stderr/imm32 + # . . call + e8/call write-buffered/disp32 + # . . discard args + 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP + # . flush(Stderr) + # . . push args + 68/push Stderr/imm32 + # . . call + e8/call flush/disp32 + # . . discard args + 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP + # . syscall(exit, 1) + bb/copy-to-EBX 1/imm32 + b8/copy-to-EAX 1/imm32/exit + cd/syscall 0x80/imm8 + # never gets here + # assumes 'in' starts with a register name, and returns pointer to its code # side-effect: modifies 'in' to scan past the initial register name next-register: # in : (address slice) -> reg/EAX : int diff --git a/html/apps/desugar.subx.html b/html/apps/desugar.subx.html index 7fea0d16..404e846f 100644 --- a/html/apps/desugar.subx.html +++ b/html/apps/desugar.subx.html @@ -286,7 +286,7 @@ if ('onhashchange' in window) { <span id="L269" class="LineNr"> 269 </span> 50/push-EAX <span id="L270" class="LineNr"> 270 </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> 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(EBP+12)</span> <span id="L271" class="LineNr"> 271 </span> <span class="subxS2Comment"># . . call</span> -<span id="L272" class="LineNr"> 272 </span> e8/call <a href='desugar.subx.html#L2543'>emit-indirect-mode</a>/disp32 +<span id="L272" class="LineNr"> 272 </span> e8/call <a href='desugar.subx.html#L2715'>emit-indirect-mode</a>/disp32 <span id="L273" class="LineNr"> 273 </span> <span class="subxS2Comment"># . . discard args</span> <span id="L274" class="LineNr"> 274 </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> 0x14/imm32 <span class="subxComment"># add to ESP</span> <span id="L275" class="LineNr"> 275 </span> <span class="subxComment"># restore registers</span> @@ -969,7 +969,7 @@ if ('onhashchange' in window) { <span id="L1127" class="LineNr">1127 </span> 68/push <span class="Constant">"Registers"</span>/imm32 <span id="L1128" class="LineNr">1128 </span> 68/push 8/imm32/row-size <span id="L1129" class="LineNr">1129 </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="L1130" class="LineNr">1130 </span> 68/push <span class="SpecialChar"><a href='desugar.subx.html#L4104'>Registers</a></span>/imm32 +<span id="L1130" class="LineNr">1130 </span> 68/push <span class="SpecialChar"><a href='desugar.subx.html#L4276'>Registers</a></span>/imm32 <span id="L1131" class="LineNr">1131 </span> <span class="subxS2Comment"># . . call</span> <span id="L1132" class="LineNr">1132 </span> e8/call <a href='../078table.subx.html#L200'>get-slice</a>/disp32 <span id="L1133" class="LineNr">1133 </span> <span class="subxS2Comment"># . . discard args</span> @@ -1209,7 +1209,7 @@ if ('onhashchange' in window) { <span id="L1417" class="LineNr">1417 </span> <span class="subxS2Comment"># . . push args</span> <span id="L1418" class="LineNr">1418 </span> 56/push-ESI <span id="L1419" class="LineNr">1419 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1420" class="LineNr">1420 </span> e8/call <a href='desugar.subx.html#L3102'>skip-until-close-paren</a>/disp32 +<span id="L1420" class="LineNr">1420 </span> e8/call <a href='desugar.subx.html#L3274'>skip-until-close-paren</a>/disp32 <span id="L1421" class="LineNr">1421 </span> <span class="subxS2Comment"># . . discard args</span> <span id="L1422" class="LineNr">1422 </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="L1423" class="LineNr">1423 </span> <span class="subxComment"># if (line->data[line->read] != ')') goto error2</span> @@ -1596,7 +1596,7 @@ if ('onhashchange' in window) { <span id="L1804" class="LineNr">1804 </span> <span class="subxComment"># skip whitespace</span> <span id="L1805" class="LineNr">1805 </span> <span class="subxComment"># if (*word->start == ')') goto end</span> <span id="L1806" class="LineNr">1806 </span> <span class="subxComment"># if (*word->start == '-') goto displacement</span> -<span id="L1807" class="LineNr">1807 </span> <span class="subxComment"># if (*word->start != '+') goto error2</span> +<span id="L1807" class="LineNr">1807 </span> <span class="subxComment"># if (*word->start != '+') goto error1</span> <span id="L1808" class="LineNr">1808 </span> <span class="subxComment"># ++word->start to skip '+'</span> <span id="L1809" class="LineNr">1809 </span> <span class="subxComment"># skip whitespace</span> <span id="L1810" class="LineNr">1810 </span> <span class="subxComment"># if next 3 characters don't make a register, goto displacement</span> @@ -1605,18 +1605,18 @@ if ('onhashchange' in window) { <span id="L1813" class="LineNr">1813 </span> <span class="subxComment"># if (*word->start == ')') goto end</span> <span id="L1814" class="LineNr">1814 </span> <span class="subxComment"># if (*word->start == '<') {</span> <span id="L1815" class="LineNr">1815 </span> <span class="subxComment"># ++word->start to skip '<'</span> -<span id="L1816" class="LineNr">1816 </span> <span class="subxComment"># if (*word->start != '<') goto error3</span> +<span id="L1816" class="LineNr">1816 </span> <span class="subxComment"># if (*word->start != '<') goto error2</span> <span id="L1817" class="LineNr">1817 </span> <span class="subxComment"># ++word->start to skip '<'</span> <span id="L1818" class="LineNr">1818 </span> <span class="subxComment"># skip whitespace</span> <span id="L1819" class="LineNr">1819 </span> <span class="subxComment"># read integer into scale</span> <span id="L1820" class="LineNr">1820 </span> <span class="subxComment"># skip whitespace</span> <span id="L1821" class="LineNr">1821 </span> <span class="subxComment"># if (*word->start == ')') goto end</span> <span id="L1822" class="LineNr">1822 </span> <span class="subxComment"># }</span> -<span id="L1823" class="LineNr">1823 </span> <span class="subxComment"># if (*word->start not in '+' '-') goto error4</span> +<span id="L1823" class="LineNr">1823 </span> <span class="subxComment"># if (*word->start not in '+' '-') goto error3</span> <span id="L1824" class="LineNr">1824 </span> <span class="subxComment"># displacement:</span> <span id="L1825" class="LineNr">1825 </span> <span class="subxComment"># read integer into disp</span> <span id="L1826" class="LineNr">1826 </span> <span class="subxComment"># skip whitespace</span> -<span id="L1827" class="LineNr">1827 </span> <span class="subxComment"># if (*word->start != ')') goto error5</span> +<span id="L1827" class="LineNr">1827 </span> <span class="subxComment"># if (*word->start != ')') goto error4</span> <span id="L1828" class="LineNr">1828 </span> <span class="subxS1Comment"># . prolog</span> <span id="L1829" class="LineNr">1829 </span> 55/push-EBP <span id="L1830" class="LineNr">1830 </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> @@ -1647,7 +1647,7 @@ if ('onhashchange' in window) { <span id="L1855" class="LineNr">1855 </span> 68/push <span class="Constant">"Registers"</span>/imm32 <span id="L1856" class="LineNr">1856 </span> 68/push 8/imm32/row-size <span id="L1857" class="LineNr">1857 </span> 56/push-ESI -<span id="L1858" class="LineNr">1858 </span> 68/push <span class="SpecialChar"><a href='desugar.subx.html#L4104'>Registers</a></span>/imm32 +<span id="L1858" class="LineNr">1858 </span> 68/push <span class="SpecialChar"><a href='desugar.subx.html#L4276'>Registers</a></span>/imm32 <span id="L1859" class="LineNr">1859 </span> <span class="subxS2Comment"># . . call</span> <span id="L1860" class="LineNr">1860 </span> e8/call <a href='../078table.subx.html#L200'>get-slice</a>/disp32 <span id="L1861" class="LineNr">1861 </span> <span class="subxS2Comment"># . . discard args</span> @@ -1675,7 +1675,7 @@ if ('onhashchange' in window) { <span id="L1883" class="LineNr">1883 </span> <span class="subxS2Comment"># . . push args</span> <span id="L1884" class="LineNr">1884 </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="L1885" class="LineNr">1885 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1886" class="LineNr">1886 </span> e8/call <a href='desugar.subx.html#L2067'>next-register</a>/disp32 +<span id="L1886" class="LineNr">1886 </span> e8/call <a href='desugar.subx.html#L2239'>next-register</a>/disp32 <span id="L1887" class="LineNr">1887 </span> <span class="subxS2Comment"># . . discard args</span> <span id="L1888" class="LineNr">1888 </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="L1889" class="LineNr">1889 </span> <span class="subxS1Comment"># . EDI = *EAX</span> @@ -1699,2091 +1699,2263 @@ if ('onhashchange' in window) { <span id="L1907" class="LineNr">1907 </span> <span class="subxComment"># if (*word->start == '-') goto displacement</span> <span id="L1908" class="LineNr">1908 </span> 3d/compare-EAX-and 0x2d/imm32/minus <span id="L1909" class="LineNr">1909 </span> 0f 84/jump-if-equal $parse-effective-address:displacement/disp32 -<span id="L1910" class="LineNr">1910 </span> <span class="subxComment"># if (*word->start != '+') goto error2</span> -<span id="L1911" class="LineNr">1911 </span><span class="Constant">$parse-effective-address:check-for-index</span>: -<span id="L1912" class="LineNr">1912 </span> <span class="subxComment"># ++word->start to skip '+'</span> -<span id="L1913" class="LineNr">1913 </span> ff 0/subop/increment 0/mod/indirect 6/rm32/ESI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># increment *ESI</span> -<span id="L1914" class="LineNr">1914 </span> <span class="subxComment"># skip whitespace</span> -<span id="L1915" class="LineNr">1915 </span> <span class="subxS1Comment"># . EAX = skip-chars-matching-whitespace-in-slice(word->start, word->end)</span> -<span id="L1916" class="LineNr">1916 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1917" class="LineNr">1917 </span> ff 6/subop/push 1/mod/*+disp8 6/rm32/ESI <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 *(ESI+4)</span> -<span id="L1918" class="LineNr">1918 </span> ff 6/subop/push 0/mod/indirect 6/rm32/ESI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># push *ESI</span> -<span id="L1919" class="LineNr">1919 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1920" class="LineNr">1920 </span> e8/call <a href='../073next-token.subx.html#L899'>skip-chars-matching-whitespace-in-slice</a>/disp32 -<span id="L1921" class="LineNr">1921 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1922" class="LineNr">1922 </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="L1923" class="LineNr">1923 </span> <span class="subxS1Comment"># . word->start = EAX</span> -<span id="L1924" class="LineNr">1924 </span> 89/copy 0/mod/indirect 6/rm32/ESI <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 EAX to *ESI</span> -<span id="L1925" class="LineNr">1925 </span><span class="Constant">$parse-effective-address:resolve-ambiguity</span>: -<span id="L1926" class="LineNr">1926 </span> <span class="subxComment"># if next 3 characters don't make a register, goto displacement</span> -<span id="L1927" class="LineNr">1927 </span> <span class="subxS1Comment"># . spill ECX</span> -<span id="L1928" class="LineNr">1928 </span> 51/push-ECX -<span id="L1929" class="LineNr">1929 </span> <span class="subxS1Comment"># . var tmp/ECX = {word->start, word->start+3}</span> -<span id="L1930" class="LineNr">1930 </span> <span class="subxS2Comment"># . . ECX = word->start</span> -<span id="L1931" class="LineNr">1931 </span> 89/copy 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"># copy EAX to ECX</span> -<span id="L1932" class="LineNr">1932 </span> <span class="subxS2Comment"># . . EAX = word->start+3</span> -<span id="L1933" class="LineNr">1933 </span> 05/add-to-EAX 3/imm32 -<span id="L1934" class="LineNr">1934 </span> <span class="subxS2Comment"># . . push</span> -<span id="L1935" class="LineNr">1935 </span> 50/push-EAX -<span id="L1936" class="LineNr">1936 </span> 51/push-ECX -<span id="L1937" class="LineNr">1937 </span> <span class="subxS2Comment"># . . copy ESP to ECX</span> -<span id="L1938" class="LineNr">1938 </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="L1939" class="LineNr">1939 </span> <span class="subxS1Comment"># . EAX = maybe-get-slice(Register, tmp, row-size=8)</span> -<span id="L1940" class="LineNr">1940 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1941" class="LineNr">1941 </span> 68/push 8/imm32/row-size -<span id="L1942" class="LineNr">1942 </span> 51/push-ECX -<span id="L1943" class="LineNr">1943 </span> 68/push <span class="SpecialChar"><a href='desugar.subx.html#L4104'>Registers</a></span>/imm32 -<span id="L1944" class="LineNr">1944 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1945" class="LineNr">1945 </span> e8/call <a href='../078table.subx.html#L1532'>maybe-get-slice</a>/disp32 -<span id="L1946" class="LineNr">1946 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1947" class="LineNr">1947 </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="L1948" class="LineNr">1948 </span> <span class="subxS1Comment"># . reclaim tmp</span> -<span id="L1949" class="LineNr">1949 </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="L1950" class="LineNr">1950 </span> <span class="subxS1Comment"># . restore ECX</span> -<span id="L1951" class="LineNr">1951 </span> 59/pop-to-ECX -<span id="L1952" class="LineNr">1952 </span> <span class="subxS1Comment"># . if (EAX == 0) goto displacement</span> -<span id="L1953" class="LineNr">1953 </span> 3d/compare-EAX-and 0/imm32 -<span id="L1954" class="LineNr">1954 </span> 0f 84/jump-if-equal $parse-effective-address:displacement/disp32 -<span id="L1955" class="LineNr">1955 </span><span class="Constant">$parse-effective-address:index</span>: -<span id="L1956" class="LineNr">1956 </span> <span class="subxComment"># read register into index</span> -<span id="L1957" class="LineNr">1957 </span> <span class="subxS1Comment"># . EAX = next-register(word)</span> -<span id="L1958" class="LineNr">1958 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1959" class="LineNr">1959 </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="L1960" class="LineNr">1960 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1961" class="LineNr">1961 </span> e8/call <a href='desugar.subx.html#L2067'>next-register</a>/disp32 -<span id="L1962" class="LineNr">1962 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1963" class="LineNr">1963 </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="L1964" class="LineNr">1964 </span> <span class="subxS1Comment"># . ECX = *EAX</span> -<span id="L1965" class="LineNr">1965 </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="L1966" class="LineNr">1966 </span> <span class="subxComment"># skip whitespace</span> -<span id="L1967" class="LineNr">1967 </span> <span class="subxS1Comment"># . EAX = skip-chars-matching-whitespace-in-slice(word->start, word->end)</span> -<span id="L1968" class="LineNr">1968 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1969" class="LineNr">1969 </span> ff 6/subop/push 1/mod/*+disp8 6/rm32/ESI <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 *(ESI+4)</span> -<span id="L1970" class="LineNr">1970 </span> ff 6/subop/push 0/mod/indirect 6/rm32/ESI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># push *ESI</span> -<span id="L1971" class="LineNr">1971 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1972" class="LineNr">1972 </span> e8/call <a href='../073next-token.subx.html#L899'>skip-chars-matching-whitespace-in-slice</a>/disp32 -<span id="L1973" class="LineNr">1973 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1974" class="LineNr">1974 </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="L1975" class="LineNr">1975 </span> <span class="subxS1Comment"># . word->start = EAX</span> -<span id="L1976" class="LineNr">1976 </span> 89/copy 0/mod/indirect 6/rm32/ESI <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 EAX to *ESI</span> -<span id="L1977" class="LineNr">1977 </span> <span class="subxComment"># if (*word->start == ')') goto end</span> -<span id="L1978" class="LineNr">1978 </span> 8a/copy-byte 0/mod/indirect 0/rm32/EAX <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 *EAX to AL</span> -<span id="L1979" class="LineNr">1979 </span> 81 4/subop/and 3/mod/direct 0/rm32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xff/imm32 <span class="subxComment"># bitwise and of EAX</span> -<span id="L1980" class="LineNr">1980 </span> 3d/compare-EAX-and 0x29/imm32/close-paren -<span id="L1981" class="LineNr">1981 </span> 74/jump-if-equal $parse-effective-address:end/disp8 -<span id="L1982" class="LineNr">1982 </span><span class="Constant">$parse-effective-address:check-for-scale</span>: -<span id="L1983" class="LineNr">1983 </span> <span class="subxComment"># if (*word->start != '<') goto next check</span> -<span id="L1984" class="LineNr">1984 </span> 3d/compare-EAX-and 0x3c/imm32/less-than -<span id="L1985" class="LineNr">1985 </span> 75/jump-if-not-equal $parse-effective-address:check-for-displacement/disp8 -<span id="L1986" class="LineNr">1986 </span> <span class="subxComment"># ++word->start to skip '<'</span> -<span id="L1987" class="LineNr">1987 </span> ff 0/subop/increment 0/mod/indirect 6/rm32/ESI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># increment *ESI</span> -<span id="L1988" class="LineNr">1988 </span> <span class="subxComment"># if (*word->start != '<') goto error3</span> -<span id="L1989" class="LineNr">1989 </span> <span class="subxComment"># ++word->start to skip '<'</span> -<span id="L1990" class="LineNr">1990 </span> ff 0/subop/increment 0/mod/indirect 6/rm32/ESI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># increment *ESI</span> -<span id="L1991" class="LineNr">1991 </span> <span class="subxComment"># skip whitespace</span> -<span id="L1992" class="LineNr">1992 </span> <span class="subxS1Comment"># . EAX = skip-chars-matching-whitespace-in-slice(word->start, word->end)</span> -<span id="L1993" class="LineNr">1993 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L1994" class="LineNr">1994 </span> ff 6/subop/push 1/mod/*+disp8 6/rm32/ESI <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 *(ESI+4)</span> -<span id="L1995" class="LineNr">1995 </span> ff 6/subop/push 0/mod/indirect 6/rm32/ESI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># push *ESI</span> -<span id="L1996" class="LineNr">1996 </span> <span class="subxS2Comment"># . . call</span> -<span id="L1997" class="LineNr">1997 </span> e8/call <a href='../073next-token.subx.html#L899'>skip-chars-matching-whitespace-in-slice</a>/disp32 -<span id="L1998" class="LineNr">1998 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L1999" class="LineNr">1999 </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="L2000" class="LineNr">2000 </span> <span class="subxS1Comment"># . word->start = EAX</span> -<span id="L2001" class="LineNr">2001 </span> 89/copy 0/mod/indirect 6/rm32/ESI <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 EAX to *ESI</span> -<span id="L2002" class="LineNr">2002 </span><span class="Constant">$parse-effective-address:scale</span>: -<span id="L2003" class="LineNr">2003 </span> <span class="subxComment"># read positive integer into scale</span> -<span id="L2004" class="LineNr">2004 </span> <span class="subxS1Comment"># . EAX = next-positive-hex-int(word)</span> -<span id="L2005" class="LineNr">2005 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2006" class="LineNr">2006 </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="L2007" class="LineNr">2007 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2008" class="LineNr">2008 </span> e8/call <a href='desugar.subx.html#L3846'>next-positive-hex-int</a>/disp32 -<span id="L2009" class="LineNr">2009 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2010" class="LineNr">2010 </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="L2011" class="LineNr">2011 </span> <span class="subxS1Comment"># . EDX = EAX</span> -<span id="L2012" class="LineNr">2012 </span> 89/copy 3/mod/direct 2/rm32/EDX <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 EAX to EDX</span> -<span id="L2013" class="LineNr">2013 </span> <span class="subxComment"># skip whitespace</span> -<span id="L2014" class="LineNr">2014 </span> <span class="subxS1Comment"># . EAX = skip-chars-matching-whitespace-in-slice(word->start, word->end)</span> -<span id="L2015" class="LineNr">2015 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2016" class="LineNr">2016 </span> ff 6/subop/push 1/mod/*+disp8 6/rm32/ESI <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 *(ESI+4)</span> -<span id="L2017" class="LineNr">2017 </span> ff 6/subop/push 0/mod/indirect 6/rm32/ESI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># push *ESI</span> -<span id="L2018" class="LineNr">2018 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2019" class="LineNr">2019 </span> e8/call <a href='../073next-token.subx.html#L899'>skip-chars-matching-whitespace-in-slice</a>/disp32 -<span id="L2020" class="LineNr">2020 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2021" class="LineNr">2021 </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="L2022" class="LineNr">2022 </span> <span class="subxS1Comment"># . word->start = EAX</span> -<span id="L2023" class="LineNr">2023 </span> 89/copy 0/mod/indirect 6/rm32/ESI <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 EAX to *ESI</span> -<span id="L2024" class="LineNr">2024 </span> <span class="subxComment"># if (*word->start == ')') goto end</span> -<span id="L2025" class="LineNr">2025 </span> 8a/copy-byte 0/mod/indirect 0/rm32/EAX <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 *EAX to AL</span> -<span id="L2026" class="LineNr">2026 </span> 81 4/subop/and 3/mod/direct 0/rm32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xff/imm32 <span class="subxComment"># bitwise and of EAX</span> -<span id="L2027" class="LineNr">2027 </span> 3d/compare-EAX-and 0x29/imm32/close-paren -<span id="L2028" class="LineNr">2028 </span> 74/jump-if-equal $parse-effective-address:end/disp8 -<span id="L2029" class="LineNr">2029 </span><span class="Constant">$parse-effective-address:check-for-displacement</span>: -<span id="L2030" class="LineNr">2030 </span> <span class="subxComment"># if (*word->start not in '+' '-') goto error4</span> -<span id="L2031" class="LineNr">2031 </span><span class="Constant">$parse-effective-address:displacement</span>: -<span id="L2032" class="LineNr">2032 </span> <span class="subxComment"># read integer into disp</span> -<span id="L2033" class="LineNr">2033 </span> <span class="subxS1Comment"># . EAX = next-hex-int(word)</span> -<span id="L2034" class="LineNr">2034 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2035" class="LineNr">2035 </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="L2036" class="LineNr">2036 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2037" class="LineNr">2037 </span> e8/call <a href='desugar.subx.html#L3430'>next-hex-int</a>/disp32 -<span id="L2038" class="LineNr">2038 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2039" class="LineNr">2039 </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="L2040" class="LineNr">2040 </span> <span class="subxS1Comment"># . EBX = EAX</span> -<span id="L2041" class="LineNr">2041 </span> 89/copy 3/mod/direct 3/rm32/EBX <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 EAX to EBX</span> -<span id="L2042" class="LineNr">2042 </span> <span class="subxComment"># skip whitespace</span> -<span id="L2043" class="LineNr">2043 </span> <span class="subxS1Comment"># . EAX = skip-chars-matching-whitespace-in-slice(word->start, word->end)</span> -<span id="L2044" class="LineNr">2044 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2045" class="LineNr">2045 </span> ff 6/subop/push 1/mod/*+disp8 6/rm32/ESI <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 *(ESI+4)</span> -<span id="L2046" class="LineNr">2046 </span> ff 6/subop/push 0/mod/indirect 6/rm32/ESI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># push *ESI</span> -<span id="L2047" class="LineNr">2047 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2048" class="LineNr">2048 </span> e8/call <a href='../073next-token.subx.html#L899'>skip-chars-matching-whitespace-in-slice</a>/disp32 -<span id="L2049" class="LineNr">2049 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2050" class="LineNr">2050 </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="L2051" class="LineNr">2051 </span> <span class="subxS1Comment"># . word->start = EAX</span> -<span id="L2052" class="LineNr">2052 </span> 89/copy 0/mod/indirect 6/rm32/ESI <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 EAX to *ESI</span> -<span id="L2053" class="LineNr">2053 </span> <span class="subxComment"># if (*word->start != ')') goto error5</span> -<span id="L2054" class="LineNr">2054 </span><span class="Constant">$parse-effective-address:end</span>: -<span id="L2055" class="LineNr">2055 </span> <span class="subxComment"># return base in EAX</span> -<span id="L2056" class="LineNr">2056 </span> 89/copy 3/mod/direct 0/rm32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 7/r32/EDI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy EDI to EAX</span> -<span id="L2057" class="LineNr">2057 </span> <span class="subxS1Comment"># . restore registers</span> -<span id="L2058" class="LineNr">2058 </span> 5f/pop-to-EDI -<span id="L2059" class="LineNr">2059 </span> 5e/pop-to-ESI -<span id="L2060" class="LineNr">2060 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L2061" class="LineNr">2061 </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="L2062" class="LineNr">2062 </span> 5d/pop-to-EBP -<span id="L2063" class="LineNr">2063 </span> c3/return -<span id="L2064" class="LineNr">2064 </span> -<span id="L2065" class="LineNr">2065 </span><span class="subxComment"># assumes 'in' starts with a register name, and returns pointer to its code</span> -<span id="L2066" class="LineNr">2066 </span><span class="subxComment"># side-effect: modifies 'in' to scan past the initial register name</span> -<span id="L2067" class="LineNr">2067 </span><span class="subxFunction">next-register</span>: <span class="subxComment"># in : (address slice) -> reg/EAX : int</span> -<span id="L2068" class="LineNr">2068 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L2069" class="LineNr">2069 </span> 55/push-EBP -<span id="L2070" class="LineNr">2070 </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="L2071" class="LineNr">2071 </span> <span class="subxS1Comment"># . save registers</span> -<span id="L2072" class="LineNr">2072 </span> 51/push-ECX -<span id="L2073" class="LineNr">2073 </span> 56/push-ESI -<span id="L2074" class="LineNr">2074 </span> <span class="subxComment"># ESI = in</span> -<span id="L2075" class="LineNr">2075 </span> 8b/copy 1/mod/*+disp8 5/rm32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/ESI 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(EBP+8) to ESI</span> -<span id="L2076" class="LineNr">2076 </span> <span class="subxComment"># var reg-slice/ECX : (address slice) = {in->start, in->start + 3}</span> -<span id="L2077" class="LineNr">2077 </span> 8b/copy 0/mod/indirect 6/rm32/ESI <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 *ESI to EAX</span> -<span id="L2078" class="LineNr">2078 </span> 05/add-to-EAX 3/imm32 -<span id="L2079" class="LineNr">2079 </span> 50/push-EAX -<span id="L2080" class="LineNr">2080 </span> ff 6/subop/push 0/mod/indirect 6/rm32/ESI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># push *ESI</span> -<span id="L2081" class="LineNr">2081 </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="L2082" class="LineNr">2082 </span> <span class="subxComment"># in->start += 3</span> -<span id="L2083" class="LineNr">2083 </span> 81 0/subop/add 0/mod/indirect 6/rm32/ESI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 3/imm32 <span class="subxComment"># add to *ESI</span> -<span id="L2084" class="LineNr">2084 </span> <span class="subxComment"># EAX = get-slice(Registers, word, row-size=8)</span> -<span id="L2085" class="LineNr">2085 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2086" class="LineNr">2086 </span> 68/push <span class="Constant">"next-register"</span>/imm32 -<span id="L2087" class="LineNr">2087 </span> 68/push 8/imm32/row-size -<span id="L2088" class="LineNr">2088 </span> 51/push-ECX -<span id="L2089" class="LineNr">2089 </span> 68/push <span class="SpecialChar"><a href='desugar.subx.html#L4104'>Registers</a></span>/imm32 -<span id="L2090" class="LineNr">2090 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2091" class="LineNr">2091 </span> e8/call <a href='../078table.subx.html#L200'>get-slice</a>/disp32 -<span id="L2092" class="LineNr">2092 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2093" class="LineNr">2093 </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> 0x10/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2094" class="LineNr">2094 </span><span class="Constant">$next-register:end</span>: -<span id="L2095" class="LineNr">2095 </span> <span class="subxComment"># reclaim locals</span> -<span id="L2096" class="LineNr">2096 </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="L2097" class="LineNr">2097 </span> <span class="subxS1Comment"># . restore registers</span> -<span id="L2098" class="LineNr">2098 </span> 5e/pop-to-ESI -<span id="L2099" class="LineNr">2099 </span> 59/pop-to-ECX -<span id="L2100" class="LineNr">2100 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L2101" class="LineNr">2101 </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="L2102" class="LineNr">2102 </span> 5d/pop-to-EBP -<span id="L2103" class="LineNr">2103 </span> c3/return -<span id="L2104" class="LineNr">2104 </span> -<span id="L2105" class="LineNr">2105 </span><span class="subxTest">test-parse-effective-address-simple</span>: -<span id="L2106" class="LineNr">2106 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L2107" class="LineNr">2107 </span> 55/push-EBP -<span id="L2108" class="LineNr">2108 </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="L2109" class="LineNr">2109 </span> <span class="subxComment"># var slice/ECX = "*esi"</span> -<span id="L2110" class="LineNr">2110 </span> b8/copy-to-EAX <span class="Constant">"*esi"</span>/imm32 -<span id="L2111" class="LineNr">2111 </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="L2112" class="LineNr">2112 </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="L2113" class="LineNr">2113 </span> 05/add-to-EAX 4/imm32 -<span id="L2114" class="LineNr">2114 </span> <span class="subxS1Comment"># . ECX = {EAX, ECX}</span> -<span id="L2115" class="LineNr">2115 </span> 51/push-ECX -<span id="L2116" class="LineNr">2116 </span> 50/push-EAX -<span id="L2117" class="LineNr">2117 </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="L2118" class="LineNr">2118 </span> <span class="subxComment"># EAX, ECX, EDX, EBX = parse-effective-address(slice)</span> -<span id="L2119" class="LineNr">2119 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2120" class="LineNr">2120 </span> 51/push-ECX -<span id="L2121" class="LineNr">2121 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2122" class="LineNr">2122 </span> e8/call <a href='desugar.subx.html#L1793'>parse-effective-address</a>/disp32 -<span id="L2123" class="LineNr">2123 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2124" class="LineNr">2124 </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="L2125" class="LineNr">2125 </span> <span class="subxComment"># slice clobbered beyond this point</span> -<span id="L2126" class="LineNr">2126 </span> <span class="subxComment"># check-ints-equal(EAX, 6, msg)</span> -<span id="L2127" class="LineNr">2127 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2128" class="LineNr">2128 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2105'>test-parse-effective-address-simple</a>/base"</span>/imm32 -<span id="L2129" class="LineNr">2129 </span> 68/push 6/imm32/ESI -<span id="L2130" class="LineNr">2130 </span> 50/push-EAX -<span id="L2131" class="LineNr">2131 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2132" class="LineNr">2132 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L2133" class="LineNr">2133 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2134" class="LineNr">2134 </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="L2135" class="LineNr">2135 </span> <span class="subxComment"># check-ints-equal(ECX, 4, msg)</span> -<span id="L2136" class="LineNr">2136 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2137" class="LineNr">2137 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2105'>test-parse-effective-address-simple</a>/index"</span>/imm32 -<span id="L2138" class="LineNr">2138 </span> 68/push 4/imm32/none -<span id="L2139" class="LineNr">2139 </span> 51/push-ECX -<span id="L2140" class="LineNr">2140 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2141" class="LineNr">2141 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L2142" class="LineNr">2142 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2143" class="LineNr">2143 </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="L2144" class="LineNr">2144 </span> <span class="subxComment"># check-ints-equal(EDX, 0, msg)</span> -<span id="L2145" class="LineNr">2145 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2146" class="LineNr">2146 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2105'>test-parse-effective-address-simple</a>/scale"</span>/imm32 -<span id="L2147" class="LineNr">2147 </span> 68/push 0/imm32/none -<span id="L2148" class="LineNr">2148 </span> 52/push-EDX +<span id="L1910" class="LineNr">1910 </span> <span class="subxComment"># if (*word->start != '+') goto error1</span> +<span id="L1911" class="LineNr">1911 </span> 3d/compare-EAX-and 0x2b/imm32/plus +<span id="L1912" class="LineNr">1912 </span> 0f 85/jump-if-not-equal $parse-effective-address:error1/disp32 +<span id="L1913" class="LineNr">1913 </span><span class="Constant">$parse-effective-address:check-for-index</span>: +<span id="L1914" class="LineNr">1914 </span> <span class="subxComment"># ++word->start to skip '+'</span> +<span id="L1915" class="LineNr">1915 </span> ff 0/subop/increment 0/mod/indirect 6/rm32/ESI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># increment *ESI</span> +<span id="L1916" class="LineNr">1916 </span> <span class="subxComment"># skip whitespace</span> +<span id="L1917" class="LineNr">1917 </span> <span class="subxS1Comment"># . EAX = skip-chars-matching-whitespace-in-slice(word->start, word->end)</span> +<span id="L1918" class="LineNr">1918 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1919" class="LineNr">1919 </span> ff 6/subop/push 1/mod/*+disp8 6/rm32/ESI <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 *(ESI+4)</span> +<span id="L1920" class="LineNr">1920 </span> ff 6/subop/push 0/mod/indirect 6/rm32/ESI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># push *ESI</span> +<span id="L1921" class="LineNr">1921 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1922" class="LineNr">1922 </span> e8/call <a href='../073next-token.subx.html#L899'>skip-chars-matching-whitespace-in-slice</a>/disp32 +<span id="L1923" class="LineNr">1923 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1924" class="LineNr">1924 </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="L1925" class="LineNr">1925 </span> <span class="subxS1Comment"># . word->start = EAX</span> +<span id="L1926" class="LineNr">1926 </span> 89/copy 0/mod/indirect 6/rm32/ESI <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 EAX to *ESI</span> +<span id="L1927" class="LineNr">1927 </span><span class="Constant">$parse-effective-address:resolve-ambiguity</span>: +<span id="L1928" class="LineNr">1928 </span> <span class="subxComment"># if next 3 characters don't make a register, goto displacement</span> +<span id="L1929" class="LineNr">1929 </span> <span class="subxS1Comment"># . spill ECX</span> +<span id="L1930" class="LineNr">1930 </span> 51/push-ECX +<span id="L1931" class="LineNr">1931 </span> <span class="subxS1Comment"># . var tmp/ECX = {word->start, word->start+3}</span> +<span id="L1932" class="LineNr">1932 </span> <span class="subxS2Comment"># . . ECX = word->start</span> +<span id="L1933" class="LineNr">1933 </span> 89/copy 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"># copy EAX to ECX</span> +<span id="L1934" class="LineNr">1934 </span> <span class="subxS2Comment"># . . EAX = word->start+3</span> +<span id="L1935" class="LineNr">1935 </span> 05/add-to-EAX 3/imm32 +<span id="L1936" class="LineNr">1936 </span> <span class="subxS2Comment"># . . push</span> +<span id="L1937" class="LineNr">1937 </span> 50/push-EAX +<span id="L1938" class="LineNr">1938 </span> 51/push-ECX +<span id="L1939" class="LineNr">1939 </span> <span class="subxS2Comment"># . . copy ESP to ECX</span> +<span id="L1940" class="LineNr">1940 </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="L1941" class="LineNr">1941 </span> <span class="subxS1Comment"># . EAX = maybe-get-slice(Register, tmp, row-size=8)</span> +<span id="L1942" class="LineNr">1942 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1943" class="LineNr">1943 </span> 68/push 8/imm32/row-size +<span id="L1944" class="LineNr">1944 </span> 51/push-ECX +<span id="L1945" class="LineNr">1945 </span> 68/push <span class="SpecialChar"><a href='desugar.subx.html#L4276'>Registers</a></span>/imm32 +<span id="L1946" class="LineNr">1946 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1947" class="LineNr">1947 </span> e8/call <a href='../078table.subx.html#L1532'>maybe-get-slice</a>/disp32 +<span id="L1948" class="LineNr">1948 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1949" class="LineNr">1949 </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="L1950" class="LineNr">1950 </span> <span class="subxS1Comment"># . reclaim tmp</span> +<span id="L1951" class="LineNr">1951 </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="L1952" class="LineNr">1952 </span> <span class="subxS1Comment"># . restore ECX</span> +<span id="L1953" class="LineNr">1953 </span> 59/pop-to-ECX +<span id="L1954" class="LineNr">1954 </span> <span class="subxS1Comment"># . if (EAX == 0) goto displacement</span> +<span id="L1955" class="LineNr">1955 </span> 3d/compare-EAX-and 0/imm32 +<span id="L1956" class="LineNr">1956 </span> 0f 84/jump-if-equal $parse-effective-address:displacement/disp32 +<span id="L1957" class="LineNr">1957 </span><span class="Constant">$parse-effective-address:index</span>: +<span id="L1958" class="LineNr">1958 </span> <span class="subxComment"># read register into index</span> +<span id="L1959" class="LineNr">1959 </span> <span class="subxS1Comment"># . EAX = next-register(word)</span> +<span id="L1960" class="LineNr">1960 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1961" class="LineNr">1961 </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="L1962" class="LineNr">1962 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1963" class="LineNr">1963 </span> e8/call <a href='desugar.subx.html#L2239'>next-register</a>/disp32 +<span id="L1964" class="LineNr">1964 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1965" class="LineNr">1965 </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="L1966" class="LineNr">1966 </span> <span class="subxS1Comment"># . ECX = *EAX</span> +<span id="L1967" class="LineNr">1967 </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="L1968" class="LineNr">1968 </span> <span class="subxComment"># skip whitespace</span> +<span id="L1969" class="LineNr">1969 </span> <span class="subxS1Comment"># . EAX = skip-chars-matching-whitespace-in-slice(word->start, word->end)</span> +<span id="L1970" class="LineNr">1970 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L1971" class="LineNr">1971 </span> ff 6/subop/push 1/mod/*+disp8 6/rm32/ESI <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 *(ESI+4)</span> +<span id="L1972" class="LineNr">1972 </span> ff 6/subop/push 0/mod/indirect 6/rm32/ESI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># push *ESI</span> +<span id="L1973" class="LineNr">1973 </span> <span class="subxS2Comment"># . . call</span> +<span id="L1974" class="LineNr">1974 </span> e8/call <a href='../073next-token.subx.html#L899'>skip-chars-matching-whitespace-in-slice</a>/disp32 +<span id="L1975" class="LineNr">1975 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L1976" class="LineNr">1976 </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="L1977" class="LineNr">1977 </span> <span class="subxS1Comment"># . word->start = EAX</span> +<span id="L1978" class="LineNr">1978 </span> 89/copy 0/mod/indirect 6/rm32/ESI <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 EAX to *ESI</span> +<span id="L1979" class="LineNr">1979 </span> <span class="subxComment"># if (*word->start == ')') goto end</span> +<span id="L1980" class="LineNr">1980 </span> 8a/copy-byte 0/mod/indirect 0/rm32/EAX <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 *EAX to AL</span> +<span id="L1981" class="LineNr">1981 </span> 81 4/subop/and 3/mod/direct 0/rm32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xff/imm32 <span class="subxComment"># bitwise and of EAX</span> +<span id="L1982" class="LineNr">1982 </span> 3d/compare-EAX-and 0x29/imm32/close-paren +<span id="L1983" class="LineNr">1983 </span> 0f 84/jump-if-equal $parse-effective-address:end/disp32 +<span id="L1984" class="LineNr">1984 </span><span class="Constant">$parse-effective-address:check-for-scale</span>: +<span id="L1985" class="LineNr">1985 </span> <span class="subxComment"># if (*word->start != '<') goto next check</span> +<span id="L1986" class="LineNr">1986 </span> 3d/compare-EAX-and 0x3c/imm32/less-than +<span id="L1987" class="LineNr">1987 </span> 75/jump-if-not-equal $parse-effective-address:check-for-displacement/disp8 +<span id="L1988" class="LineNr">1988 </span> <span class="subxComment"># ++word->start to skip '<'</span> +<span id="L1989" class="LineNr">1989 </span> ff 0/subop/increment 0/mod/indirect 6/rm32/ESI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># increment *ESI</span> +<span id="L1990" class="LineNr">1990 </span> <span class="subxComment"># if (*word->start != '<') goto error2</span> +<span id="L1991" class="LineNr">1991 </span> 8b/copy 0/mod/indirect 6/rm32/ESI <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 *ESI to EAX</span> +<span id="L1992" class="LineNr">1992 </span> 8a/copy-byte 0/mod/indirect 0/rm32/EAX <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 *EAX to AL</span> +<span id="L1993" class="LineNr">1993 </span> 81 4/subop/and 3/mod/direct 0/rm32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xff/imm32 <span class="subxComment"># bitwise and of EAX</span> +<span id="L1994" class="LineNr">1994 </span> 3d/compare-EAX-and 0x3c/imm32/less-than +<span id="L1995" class="LineNr">1995 </span> 0f 85/jump-if-not-equal $parse-effective-address:error2/disp32 +<span id="L1996" class="LineNr">1996 </span> <span class="subxComment"># ++word->start to skip '<'</span> +<span id="L1997" class="LineNr">1997 </span> ff 0/subop/increment 0/mod/indirect 6/rm32/ESI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># increment *ESI</span> +<span id="L1998" class="LineNr">1998 </span> <span class="subxComment"># skip whitespace</span> +<span id="L1999" class="LineNr">1999 </span> <span class="subxS1Comment"># . EAX = skip-chars-matching-whitespace-in-slice(word->start, word->end)</span> +<span id="L2000" class="LineNr">2000 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2001" class="LineNr">2001 </span> ff 6/subop/push 1/mod/*+disp8 6/rm32/ESI <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 *(ESI+4)</span> +<span id="L2002" class="LineNr">2002 </span> ff 6/subop/push 0/mod/indirect 6/rm32/ESI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># push *ESI</span> +<span id="L2003" class="LineNr">2003 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2004" class="LineNr">2004 </span> e8/call <a href='../073next-token.subx.html#L899'>skip-chars-matching-whitespace-in-slice</a>/disp32 +<span id="L2005" class="LineNr">2005 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2006" class="LineNr">2006 </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="L2007" class="LineNr">2007 </span> <span class="subxS1Comment"># . word->start = EAX</span> +<span id="L2008" class="LineNr">2008 </span> 89/copy 0/mod/indirect 6/rm32/ESI <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 EAX to *ESI</span> +<span id="L2009" class="LineNr">2009 </span><span class="Constant">$parse-effective-address:scale</span>: +<span id="L2010" class="LineNr">2010 </span> <span class="subxComment"># read positive integer into scale</span> +<span id="L2011" class="LineNr">2011 </span> <span class="subxS1Comment"># . EAX = next-positive-hex-int(word)</span> +<span id="L2012" class="LineNr">2012 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2013" class="LineNr">2013 </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="L2014" class="LineNr">2014 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2015" class="LineNr">2015 </span> e8/call <a href='desugar.subx.html#L4018'>next-positive-hex-int</a>/disp32 +<span id="L2016" class="LineNr">2016 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2017" class="LineNr">2017 </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="L2018" class="LineNr">2018 </span> <span class="subxS1Comment"># . EDX = EAX</span> +<span id="L2019" class="LineNr">2019 </span> 89/copy 3/mod/direct 2/rm32/EDX <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 EAX to EDX</span> +<span id="L2020" class="LineNr">2020 </span> <span class="subxComment"># skip whitespace</span> +<span id="L2021" class="LineNr">2021 </span> <span class="subxS1Comment"># . EAX = skip-chars-matching-whitespace-in-slice(word->start, word->end)</span> +<span id="L2022" class="LineNr">2022 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2023" class="LineNr">2023 </span> ff 6/subop/push 1/mod/*+disp8 6/rm32/ESI <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 *(ESI+4)</span> +<span id="L2024" class="LineNr">2024 </span> ff 6/subop/push 0/mod/indirect 6/rm32/ESI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># push *ESI</span> +<span id="L2025" class="LineNr">2025 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2026" class="LineNr">2026 </span> e8/call <a href='../073next-token.subx.html#L899'>skip-chars-matching-whitespace-in-slice</a>/disp32 +<span id="L2027" class="LineNr">2027 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2028" class="LineNr">2028 </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="L2029" class="LineNr">2029 </span> <span class="subxS1Comment"># . word->start = EAX</span> +<span id="L2030" class="LineNr">2030 </span> 89/copy 0/mod/indirect 6/rm32/ESI <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 EAX to *ESI</span> +<span id="L2031" class="LineNr">2031 </span> <span class="subxComment"># if (*word->start == ')') goto end</span> +<span id="L2032" class="LineNr">2032 </span> 8a/copy-byte 0/mod/indirect 0/rm32/EAX <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 *EAX to AL</span> +<span id="L2033" class="LineNr">2033 </span> 81 4/subop/and 3/mod/direct 0/rm32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xff/imm32 <span class="subxComment"># bitwise and of EAX</span> +<span id="L2034" class="LineNr">2034 </span> 3d/compare-EAX-and 0x29/imm32/close-paren +<span id="L2035" class="LineNr">2035 </span> 74/jump-if-equal $parse-effective-address:end/disp8 +<span id="L2036" class="LineNr">2036 </span><span class="Constant">$parse-effective-address:check-for-displacement</span>: +<span id="L2037" class="LineNr">2037 </span> <span class="subxComment"># if (*word->start not in '+' '-') goto error3</span> +<span id="L2038" class="LineNr">2038 </span> 3d/compare-EAX-and 0x2b/imm32/plus +<span id="L2039" class="LineNr">2039 </span> 74/jump-if-equal $parse-effective-address:displacement/disp8 +<span id="L2040" class="LineNr">2040 </span> 3d/compare-EAX-and 0x2d/imm32/minus +<span id="L2041" class="LineNr">2041 </span> 74/jump-if-equal $parse-effective-address:displacement/disp8 +<span id="L2042" class="LineNr">2042 </span> e9/jump $parse-effective-address:error3/disp32 +<span id="L2043" class="LineNr">2043 </span><span class="Constant">$parse-effective-address:displacement</span>: +<span id="L2044" class="LineNr">2044 </span> <span class="subxComment"># read integer into disp</span> +<span id="L2045" class="LineNr">2045 </span> <span class="subxS1Comment"># . EAX = next-hex-int(word)</span> +<span id="L2046" class="LineNr">2046 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2047" class="LineNr">2047 </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="L2048" class="LineNr">2048 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2049" class="LineNr">2049 </span> e8/call <a href='desugar.subx.html#L3602'>next-hex-int</a>/disp32 +<span id="L2050" class="LineNr">2050 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2051" class="LineNr">2051 </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="L2052" class="LineNr">2052 </span> <span class="subxS1Comment"># . EBX = EAX</span> +<span id="L2053" class="LineNr">2053 </span> 89/copy 3/mod/direct 3/rm32/EBX <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 EAX to EBX</span> +<span id="L2054" class="LineNr">2054 </span> <span class="subxComment"># skip whitespace</span> +<span id="L2055" class="LineNr">2055 </span> <span class="subxS1Comment"># . EAX = skip-chars-matching-whitespace-in-slice(word->start, word->end)</span> +<span id="L2056" class="LineNr">2056 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2057" class="LineNr">2057 </span> ff 6/subop/push 1/mod/*+disp8 6/rm32/ESI <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 *(ESI+4)</span> +<span id="L2058" class="LineNr">2058 </span> ff 6/subop/push 0/mod/indirect 6/rm32/ESI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># push *ESI</span> +<span id="L2059" class="LineNr">2059 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2060" class="LineNr">2060 </span> e8/call <a href='../073next-token.subx.html#L899'>skip-chars-matching-whitespace-in-slice</a>/disp32 +<span id="L2061" class="LineNr">2061 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2062" class="LineNr">2062 </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="L2063" class="LineNr">2063 </span> <span class="subxS1Comment"># . word->start = EAX</span> +<span id="L2064" class="LineNr">2064 </span> 89/copy 0/mod/indirect 6/rm32/ESI <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 EAX to *ESI</span> +<span id="L2065" class="LineNr">2065 </span> <span class="subxComment"># if (*word->start != ')') goto error4</span> +<span id="L2066" class="LineNr">2066 </span> 8a/copy-byte 0/mod/indirect 0/rm32/EAX <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 *EAX to AL</span> +<span id="L2067" class="LineNr">2067 </span> 81 4/subop/and 3/mod/direct 0/rm32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xff/imm32 <span class="subxComment"># bitwise and of EAX</span> +<span id="L2068" class="LineNr">2068 </span> 3d/compare-EAX-and 0x29/imm32/close-paren +<span id="L2069" class="LineNr">2069 </span> 0f 85/jump-if-not-equal $parse-effective-address:error4/disp32 +<span id="L2070" class="LineNr">2070 </span><span class="Constant">$parse-effective-address:end</span>: +<span id="L2071" class="LineNr">2071 </span> <span class="subxComment"># return base in EAX</span> +<span id="L2072" class="LineNr">2072 </span> 89/copy 3/mod/direct 0/rm32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 7/r32/EDI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy EDI to EAX</span> +<span id="L2073" class="LineNr">2073 </span> <span class="subxS1Comment"># . restore registers</span> +<span id="L2074" class="LineNr">2074 </span> 5f/pop-to-EDI +<span id="L2075" class="LineNr">2075 </span> 5e/pop-to-ESI +<span id="L2076" class="LineNr">2076 </span> <span class="subxS1Comment"># . epilog</span> +<span id="L2077" class="LineNr">2077 </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="L2078" class="LineNr">2078 </span> 5d/pop-to-EBP +<span id="L2079" class="LineNr">2079 </span> c3/return +<span id="L2080" class="LineNr">2080 </span> +<span id="L2081" class="LineNr">2081 </span><span class="Constant">$parse-effective-address:error1</span>: +<span id="L2082" class="LineNr">2082 </span> <span class="subxComment"># print(stderr, "error: unexpected character: " EAX "\n")</span> +<span id="L2083" class="LineNr">2083 </span> <span class="subxS1Comment"># . write-buffered(Stderr, "error: unexpected character: ")</span> +<span id="L2084" class="LineNr">2084 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2085" class="LineNr">2085 </span> 68/push <span class="Constant">"error: unexpected character: "</span>/imm32 +<span id="L2086" class="LineNr">2086 </span> 68/push <span class="SpecialChar"><a href='../065write-buffered.subx.html#L213'>Stderr</a></span>/imm32 +<span id="L2087" class="LineNr">2087 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2088" class="LineNr">2088 </span> e8/call <a href='../065write-buffered.subx.html#L8'>write-buffered</a>/disp32 +<span id="L2089" class="LineNr">2089 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2090" class="LineNr">2090 </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="L2091" class="LineNr">2091 </span> <span class="subxS1Comment"># . print-int32-buffered(out, EAX)</span> +<span id="L2092" class="LineNr">2092 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2093" class="LineNr">2093 </span> 50/push-EAX +<span id="L2094" class="LineNr">2094 </span> 68/push <span class="SpecialChar"><a href='../065write-buffered.subx.html#L213'>Stderr</a></span>/imm32 +<span id="L2095" class="LineNr">2095 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2096" class="LineNr">2096 </span> e8/call <a href='../066print-int.subx.html#L267'>print-int32-buffered</a>/disp32 +<span id="L2097" class="LineNr">2097 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2098" class="LineNr">2098 </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="L2099" class="LineNr">2099 </span> <span class="subxS1Comment"># . write-buffered(Stderr, "\n")</span> +<span id="L2100" class="LineNr">2100 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2101" class="LineNr">2101 </span> 68/push <span class="Constant">"\n"</span>/imm32 +<span id="L2102" class="LineNr">2102 </span> 68/push <span class="SpecialChar"><a href='../065write-buffered.subx.html#L213'>Stderr</a></span>/imm32 +<span id="L2103" class="LineNr">2103 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2104" class="LineNr">2104 </span> e8/call <a href='../065write-buffered.subx.html#L8'>write-buffered</a>/disp32 +<span id="L2105" class="LineNr">2105 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2106" class="LineNr">2106 </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="L2107" class="LineNr">2107 </span> <span class="subxS1Comment"># . flush(Stderr)</span> +<span id="L2108" class="LineNr">2108 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2109" class="LineNr">2109 </span> 68/push <span class="SpecialChar"><a href='../065write-buffered.subx.html#L213'>Stderr</a></span>/imm32 +<span id="L2110" class="LineNr">2110 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2111" class="LineNr">2111 </span> e8/call <a href='../064write-byte.subx.html#L79'>flush</a>/disp32 +<span id="L2112" class="LineNr">2112 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2113" class="LineNr">2113 </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="L2114" class="LineNr">2114 </span> <span class="subxS1Comment"># . syscall(exit, 1)</span> +<span id="L2115" class="LineNr">2115 </span> bb/copy-to-EBX 1/imm32 +<span id="L2116" class="LineNr">2116 </span> b8/copy-to-EAX 1/imm32/exit +<span id="L2117" class="LineNr">2117 </span> cd/syscall 0x80/imm8 +<span id="L2118" class="LineNr">2118 </span> <span class="subxComment"># never gets here</span> +<span id="L2119" class="LineNr">2119 </span> +<span id="L2120" class="LineNr">2120 </span><span class="Constant">$parse-effective-address:error2</span>: +<span id="L2121" class="LineNr">2121 </span> <span class="subxComment"># print(stderr, "error: '<' can only be followed by '<' but got: " EAX "\n")</span> +<span id="L2122" class="LineNr">2122 </span> <span class="subxS1Comment"># . write-buffered(Stderr, "error: '<' can only be followed by '<' but got: ")</span> +<span id="L2123" class="LineNr">2123 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2124" class="LineNr">2124 </span> 68/push <span class="Constant">"error: '<' can only be followed by '<' but got: "</span>/imm32 +<span id="L2125" class="LineNr">2125 </span> 68/push <span class="SpecialChar"><a href='../065write-buffered.subx.html#L213'>Stderr</a></span>/imm32 +<span id="L2126" class="LineNr">2126 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2127" class="LineNr">2127 </span> e8/call <a href='../065write-buffered.subx.html#L8'>write-buffered</a>/disp32 +<span id="L2128" class="LineNr">2128 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2129" class="LineNr">2129 </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="L2130" class="LineNr">2130 </span> <span class="subxS1Comment"># . print-int32-buffered(out, EAX)</span> +<span id="L2131" class="LineNr">2131 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2132" class="LineNr">2132 </span> 50/push-EAX +<span id="L2133" class="LineNr">2133 </span> 68/push <span class="SpecialChar"><a href='../065write-buffered.subx.html#L213'>Stderr</a></span>/imm32 +<span id="L2134" class="LineNr">2134 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2135" class="LineNr">2135 </span> e8/call <a href='../066print-int.subx.html#L267'>print-int32-buffered</a>/disp32 +<span id="L2136" class="LineNr">2136 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2137" class="LineNr">2137 </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="L2138" class="LineNr">2138 </span> <span class="subxS1Comment"># . write-buffered(Stderr, "\n")</span> +<span id="L2139" class="LineNr">2139 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2140" class="LineNr">2140 </span> 68/push <span class="Constant">"\n"</span>/imm32 +<span id="L2141" class="LineNr">2141 </span> 68/push <span class="SpecialChar"><a href='../065write-buffered.subx.html#L213'>Stderr</a></span>/imm32 +<span id="L2142" class="LineNr">2142 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2143" class="LineNr">2143 </span> e8/call <a href='../065write-buffered.subx.html#L8'>write-buffered</a>/disp32 +<span id="L2144" class="LineNr">2144 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2145" class="LineNr">2145 </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="L2146" class="LineNr">2146 </span> <span class="subxS1Comment"># . flush(Stderr)</span> +<span id="L2147" class="LineNr">2147 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2148" class="LineNr">2148 </span> 68/push <span class="SpecialChar"><a href='../065write-buffered.subx.html#L213'>Stderr</a></span>/imm32 <span id="L2149" class="LineNr">2149 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2150" class="LineNr">2150 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L2150" class="LineNr">2150 </span> e8/call <a href='../064write-byte.subx.html#L79'>flush</a>/disp32 <span id="L2151" class="LineNr">2151 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2152" class="LineNr">2152 </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="L2153" class="LineNr">2153 </span> <span class="subxComment"># check-ints-equal(EBX, 0, msg)</span> -<span id="L2154" class="LineNr">2154 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2155" class="LineNr">2155 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2105'>test-parse-effective-address-simple</a>/displacement"</span>/imm32 -<span id="L2156" class="LineNr">2156 </span> 68/push 0/imm32/none -<span id="L2157" class="LineNr">2157 </span> 53/push-EBX -<span id="L2158" class="LineNr">2158 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2159" class="LineNr">2159 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L2160" class="LineNr">2160 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2161" class="LineNr">2161 </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="L2162" class="LineNr">2162 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L2163" class="LineNr">2163 </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="L2164" class="LineNr">2164 </span> 5d/pop-to-EBP -<span id="L2165" class="LineNr">2165 </span> c3/return -<span id="L2166" class="LineNr">2166 </span> -<span id="L2167" class="LineNr">2167 </span><span class="subxTest">test-parse-effective-address-base</span>: -<span id="L2168" class="LineNr">2168 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L2169" class="LineNr">2169 </span> 55/push-EBP -<span id="L2170" class="LineNr">2170 </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="L2171" class="LineNr">2171 </span> <span class="subxComment"># var slice/ECX = "*(esi )"</span> -<span id="L2172" class="LineNr">2172 </span> b8/copy-to-EAX <span class="Constant">"*(esi )"</span>/imm32 -<span id="L2173" class="LineNr">2173 </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="L2174" class="LineNr">2174 </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="L2175" class="LineNr">2175 </span> 05/add-to-EAX 4/imm32 -<span id="L2176" class="LineNr">2176 </span> <span class="subxS1Comment"># . ECX = {EAX, ECX}</span> -<span id="L2177" class="LineNr">2177 </span> 51/push-ECX -<span id="L2178" class="LineNr">2178 </span> 50/push-EAX -<span id="L2179" class="LineNr">2179 </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="L2180" class="LineNr">2180 </span> <span class="subxComment"># EAX, ECX, EDX, EBX = parse-effective-address(slice)</span> -<span id="L2181" class="LineNr">2181 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2182" class="LineNr">2182 </span> 51/push-ECX -<span id="L2183" class="LineNr">2183 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2184" class="LineNr">2184 </span> e8/call <a href='desugar.subx.html#L1793'>parse-effective-address</a>/disp32 -<span id="L2185" class="LineNr">2185 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2186" class="LineNr">2186 </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="L2187" class="LineNr">2187 </span> <span class="subxComment"># slice clobbered beyond this point</span> -<span id="L2188" class="LineNr">2188 </span> <span class="subxComment"># check-ints-equal(EAX, 6, msg)</span> -<span id="L2189" class="LineNr">2189 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2190" class="LineNr">2190 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2167'>test-parse-effective-address-base</a>/base"</span>/imm32 -<span id="L2191" class="LineNr">2191 </span> 68/push 6/imm32/ESI -<span id="L2192" class="LineNr">2192 </span> 50/push-EAX -<span id="L2193" class="LineNr">2193 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2194" class="LineNr">2194 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L2195" class="LineNr">2195 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2196" class="LineNr">2196 </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="L2197" class="LineNr">2197 </span> <span class="subxComment"># check-ints-equal(ECX, 4, msg)</span> -<span id="L2198" class="LineNr">2198 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2199" class="LineNr">2199 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2167'>test-parse-effective-address-base</a>/index"</span>/imm32 -<span id="L2200" class="LineNr">2200 </span> 68/push 4/imm32/none -<span id="L2201" class="LineNr">2201 </span> 51/push-ECX -<span id="L2202" class="LineNr">2202 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2203" class="LineNr">2203 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L2204" class="LineNr">2204 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2205" class="LineNr">2205 </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="L2206" class="LineNr">2206 </span> <span class="subxComment"># check-ints-equal(EDX, 0, msg)</span> -<span id="L2207" class="LineNr">2207 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2208" class="LineNr">2208 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2167'>test-parse-effective-address-base</a>/scale"</span>/imm32 -<span id="L2209" class="LineNr">2209 </span> 68/push 0/imm32/none -<span id="L2210" class="LineNr">2210 </span> 52/push-EDX -<span id="L2211" class="LineNr">2211 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2212" class="LineNr">2212 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L2213" class="LineNr">2213 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2214" class="LineNr">2214 </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="L2215" class="LineNr">2215 </span> <span class="subxComment"># check-ints-equal(EBX, 0, msg)</span> -<span id="L2216" class="LineNr">2216 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2217" class="LineNr">2217 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2167'>test-parse-effective-address-base</a>/displacement"</span>/imm32 -<span id="L2218" class="LineNr">2218 </span> 68/push 0/imm32/none -<span id="L2219" class="LineNr">2219 </span> 53/push-EBX +<span id="L2152" class="LineNr">2152 </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="L2153" class="LineNr">2153 </span> <span class="subxS1Comment"># . syscall(exit, 1)</span> +<span id="L2154" class="LineNr">2154 </span> bb/copy-to-EBX 1/imm32 +<span id="L2155" class="LineNr">2155 </span> b8/copy-to-EAX 1/imm32/exit +<span id="L2156" class="LineNr">2156 </span> cd/syscall 0x80/imm8 +<span id="L2157" class="LineNr">2157 </span> <span class="subxComment"># never gets here</span> +<span id="L2158" class="LineNr">2158 </span> +<span id="L2159" class="LineNr">2159 </span><span class="Constant">$parse-effective-address:error3</span>: +<span id="L2160" class="LineNr">2160 </span> <span class="subxComment"># print(stderr, "error: unexpected character before displacement: " EAX "\n")</span> +<span id="L2161" class="LineNr">2161 </span> <span class="subxS1Comment"># . write-buffered(Stderr, "error: unexpected character before displacement: ")</span> +<span id="L2162" class="LineNr">2162 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2163" class="LineNr">2163 </span> 68/push <span class="Constant">"error: unexpected character before displacement: "</span>/imm32 +<span id="L2164" class="LineNr">2164 </span> 68/push <span class="SpecialChar"><a href='../065write-buffered.subx.html#L213'>Stderr</a></span>/imm32 +<span id="L2165" class="LineNr">2165 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2166" class="LineNr">2166 </span> e8/call <a href='../065write-buffered.subx.html#L8'>write-buffered</a>/disp32 +<span id="L2167" class="LineNr">2167 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2168" class="LineNr">2168 </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="L2169" class="LineNr">2169 </span> <span class="subxS1Comment"># . print-int32-buffered(out, EAX)</span> +<span id="L2170" class="LineNr">2170 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2171" class="LineNr">2171 </span> 50/push-EAX +<span id="L2172" class="LineNr">2172 </span> 68/push <span class="SpecialChar"><a href='../065write-buffered.subx.html#L213'>Stderr</a></span>/imm32 +<span id="L2173" class="LineNr">2173 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2174" class="LineNr">2174 </span> e8/call <a href='../066print-int.subx.html#L267'>print-int32-buffered</a>/disp32 +<span id="L2175" class="LineNr">2175 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2176" class="LineNr">2176 </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="L2177" class="LineNr">2177 </span> <span class="subxS1Comment"># . write-buffered(Stderr, "\n")</span> +<span id="L2178" class="LineNr">2178 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2179" class="LineNr">2179 </span> 68/push <span class="Constant">"\n"</span>/imm32 +<span id="L2180" class="LineNr">2180 </span> 68/push <span class="SpecialChar"><a href='../065write-buffered.subx.html#L213'>Stderr</a></span>/imm32 +<span id="L2181" class="LineNr">2181 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2182" class="LineNr">2182 </span> e8/call <a href='../065write-buffered.subx.html#L8'>write-buffered</a>/disp32 +<span id="L2183" class="LineNr">2183 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2184" class="LineNr">2184 </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="L2185" class="LineNr">2185 </span> <span class="subxS1Comment"># . flush(Stderr)</span> +<span id="L2186" class="LineNr">2186 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2187" class="LineNr">2187 </span> 68/push <span class="SpecialChar"><a href='../065write-buffered.subx.html#L213'>Stderr</a></span>/imm32 +<span id="L2188" class="LineNr">2188 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2189" class="LineNr">2189 </span> e8/call <a href='../064write-byte.subx.html#L79'>flush</a>/disp32 +<span id="L2190" class="LineNr">2190 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2191" class="LineNr">2191 </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="L2192" class="LineNr">2192 </span> <span class="subxS1Comment"># . syscall(exit, 1)</span> +<span id="L2193" class="LineNr">2193 </span> bb/copy-to-EBX 1/imm32 +<span id="L2194" class="LineNr">2194 </span> b8/copy-to-EAX 1/imm32/exit +<span id="L2195" class="LineNr">2195 </span> cd/syscall 0x80/imm8 +<span id="L2196" class="LineNr">2196 </span> <span class="subxComment"># never gets here</span> +<span id="L2197" class="LineNr">2197 </span> +<span id="L2198" class="LineNr">2198 </span><span class="Constant">$parse-effective-address:error4</span>: +<span id="L2199" class="LineNr">2199 </span> <span class="subxComment"># print(stderr, "error: unexpected character after displacement: " EAX "; expected ')' to wrap up\n")</span> +<span id="L2200" class="LineNr">2200 </span> <span class="subxS1Comment"># . write-buffered(Stderr, "error: unexpected character after displacement: ")</span> +<span id="L2201" class="LineNr">2201 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2202" class="LineNr">2202 </span> 68/push <span class="Constant">"error: unexpected character after displacement: "</span>/imm32 +<span id="L2203" class="LineNr">2203 </span> 68/push <span class="SpecialChar"><a href='../065write-buffered.subx.html#L213'>Stderr</a></span>/imm32 +<span id="L2204" class="LineNr">2204 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2205" class="LineNr">2205 </span> e8/call <a href='../065write-buffered.subx.html#L8'>write-buffered</a>/disp32 +<span id="L2206" class="LineNr">2206 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2207" class="LineNr">2207 </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="L2208" class="LineNr">2208 </span> <span class="subxS1Comment"># . print-int32-buffered(out, EAX)</span> +<span id="L2209" class="LineNr">2209 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2210" class="LineNr">2210 </span> 50/push-EAX +<span id="L2211" class="LineNr">2211 </span> 68/push <span class="SpecialChar"><a href='../065write-buffered.subx.html#L213'>Stderr</a></span>/imm32 +<span id="L2212" class="LineNr">2212 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2213" class="LineNr">2213 </span> e8/call <a href='../066print-int.subx.html#L267'>print-int32-buffered</a>/disp32 +<span id="L2214" class="LineNr">2214 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2215" class="LineNr">2215 </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="L2216" class="LineNr">2216 </span> <span class="subxS1Comment"># . write-buffered(Stderr, "; expected ')' to wrap up\n")</span> +<span id="L2217" class="LineNr">2217 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2218" class="LineNr">2218 </span> 68/push <span class="Constant">"; expected ')' to wrap up\n"</span>/imm32 +<span id="L2219" class="LineNr">2219 </span> 68/push <span class="SpecialChar"><a href='../065write-buffered.subx.html#L213'>Stderr</a></span>/imm32 <span id="L2220" class="LineNr">2220 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2221" class="LineNr">2221 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L2221" class="LineNr">2221 </span> e8/call <a href='../065write-buffered.subx.html#L8'>write-buffered</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> 0xc/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2224" class="LineNr">2224 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L2225" class="LineNr">2225 </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="L2226" class="LineNr">2226 </span> 5d/pop-to-EBP -<span id="L2227" class="LineNr">2227 </span> c3/return -<span id="L2228" class="LineNr">2228 </span> -<span id="L2229" class="LineNr">2229 </span><span class="subxTest">test-parse-effective-address-base-displacement</span>: -<span id="L2230" class="LineNr">2230 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L2231" class="LineNr">2231 </span> 55/push-EBP -<span id="L2232" class="LineNr">2232 </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="L2233" class="LineNr">2233 </span> <span class="subxComment"># var slice/ECX = "*(esi+3)"</span> -<span id="L2234" class="LineNr">2234 </span> b8/copy-to-EAX <span class="Constant">"*(esi+3)"</span>/imm32 -<span id="L2235" class="LineNr">2235 </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="L2236" class="LineNr">2236 </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="L2237" class="LineNr">2237 </span> 05/add-to-EAX 4/imm32 -<span id="L2238" class="LineNr">2238 </span> <span class="subxS1Comment"># . ECX = {EAX, ECX}</span> -<span id="L2239" class="LineNr">2239 </span> 51/push-ECX -<span id="L2240" class="LineNr">2240 </span> 50/push-EAX -<span id="L2241" class="LineNr">2241 </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="L2242" class="LineNr">2242 </span> <span class="subxComment"># EAX, ECX, EDX, EBX = parse-effective-address(slice)</span> -<span id="L2243" class="LineNr">2243 </span> <span class="subxS2Comment"># . . push 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> 8/imm32 <span class="subxComment"># add to ESP</span> +<span id="L2224" class="LineNr">2224 </span> <span class="subxS1Comment"># . flush(Stderr)</span> +<span id="L2225" class="LineNr">2225 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2226" class="LineNr">2226 </span> 68/push <span class="SpecialChar"><a href='../065write-buffered.subx.html#L213'>Stderr</a></span>/imm32 +<span id="L2227" class="LineNr">2227 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2228" class="LineNr">2228 </span> e8/call <a href='../064write-byte.subx.html#L79'>flush</a>/disp32 +<span id="L2229" class="LineNr">2229 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2230" class="LineNr">2230 </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="L2231" class="LineNr">2231 </span> <span class="subxS1Comment"># . syscall(exit, 1)</span> +<span id="L2232" class="LineNr">2232 </span> bb/copy-to-EBX 1/imm32 +<span id="L2233" class="LineNr">2233 </span> b8/copy-to-EAX 1/imm32/exit +<span id="L2234" class="LineNr">2234 </span> cd/syscall 0x80/imm8 +<span id="L2235" class="LineNr">2235 </span> <span class="subxComment"># never gets here</span> +<span id="L2236" class="LineNr">2236 </span> +<span id="L2237" class="LineNr">2237 </span><span class="subxComment"># assumes 'in' starts with a register name, and returns pointer to its code</span> +<span id="L2238" class="LineNr">2238 </span><span class="subxComment"># side-effect: modifies 'in' to scan past the initial register name</span> +<span id="L2239" class="LineNr">2239 </span><span class="subxFunction">next-register</span>: <span class="subxComment"># in : (address slice) -> reg/EAX : int</span> +<span id="L2240" class="LineNr">2240 </span> <span class="subxS1Comment"># . prolog</span> +<span id="L2241" class="LineNr">2241 </span> 55/push-EBP +<span id="L2242" class="LineNr">2242 </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="L2243" class="LineNr">2243 </span> <span class="subxS1Comment"># . save registers</span> <span id="L2244" class="LineNr">2244 </span> 51/push-ECX -<span id="L2245" class="LineNr">2245 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2246" class="LineNr">2246 </span> e8/call <a href='desugar.subx.html#L1793'>parse-effective-address</a>/disp32 -<span id="L2247" class="LineNr">2247 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2248" class="LineNr">2248 </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="L2249" class="LineNr">2249 </span> <span class="subxComment"># slice clobbered beyond this point</span> -<span id="L2250" class="LineNr">2250 </span> <span class="subxComment"># check-ints-equal(EAX, 6, 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 - <a href='desugar.subx.html#L2229'>test-parse-effective-address-base-displacement</a>/base"</span>/imm32 -<span id="L2253" class="LineNr">2253 </span> 68/push 6/imm32/ESI -<span id="L2254" class="LineNr">2254 </span> 50/push-EAX -<span id="L2255" class="LineNr">2255 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2256" class="LineNr">2256 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L2257" class="LineNr">2257 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2258" class="LineNr">2258 </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="L2259" class="LineNr">2259 </span> <span class="subxComment"># check-ints-equal(ECX, 4, msg)</span> -<span id="L2260" class="LineNr">2260 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2261" class="LineNr">2261 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2229'>test-parse-effective-address-base-displacement</a>/index"</span>/imm32 -<span id="L2262" class="LineNr">2262 </span> 68/push 4/imm32/none -<span id="L2263" class="LineNr">2263 </span> 51/push-ECX -<span id="L2264" class="LineNr">2264 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2265" class="LineNr">2265 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L2266" class="LineNr">2266 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2267" class="LineNr">2267 </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="L2268" class="LineNr">2268 </span> <span class="subxComment"># check-ints-equal(EDX, 0, msg)</span> -<span id="L2269" class="LineNr">2269 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2270" class="LineNr">2270 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2229'>test-parse-effective-address-base-displacement</a>/scale"</span>/imm32 -<span id="L2271" class="LineNr">2271 </span> 68/push 0/imm32/none -<span id="L2272" class="LineNr">2272 </span> 52/push-EDX -<span id="L2273" class="LineNr">2273 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2274" class="LineNr">2274 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</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> 0xc/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2277" class="LineNr">2277 </span> <span class="subxComment"># check-ints-equal(EBX, 3, msg)</span> -<span id="L2278" class="LineNr">2278 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2279" class="LineNr">2279 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2229'>test-parse-effective-address-base-displacement</a>/displacement"</span>/imm32 -<span id="L2280" class="LineNr">2280 </span> 68/push 3/imm32 -<span id="L2281" class="LineNr">2281 </span> 53/push-EBX -<span id="L2282" class="LineNr">2282 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2283" class="LineNr">2283 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</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> 0xc/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2286" class="LineNr">2286 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L2287" class="LineNr">2287 </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="L2288" class="LineNr">2288 </span> 5d/pop-to-EBP -<span id="L2289" class="LineNr">2289 </span> c3/return -<span id="L2290" class="LineNr">2290 </span> -<span id="L2291" class="LineNr">2291 </span><span class="subxTest">test-parse-effective-address-base-negative-displacement</span>: -<span id="L2292" class="LineNr">2292 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L2293" class="LineNr">2293 </span> 55/push-EBP -<span id="L2294" class="LineNr">2294 </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="L2295" class="LineNr">2295 </span> <span class="subxComment"># var slice/ECX = "*(esi-3)"</span> -<span id="L2296" class="LineNr">2296 </span> b8/copy-to-EAX <span class="Constant">"*(esi-3)"</span>/imm32 -<span id="L2297" class="LineNr">2297 </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="L2298" class="LineNr">2298 </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="L2299" class="LineNr">2299 </span> 05/add-to-EAX 4/imm32 -<span id="L2300" class="LineNr">2300 </span> <span class="subxS1Comment"># . ECX = {EAX, ECX}</span> -<span id="L2301" class="LineNr">2301 </span> 51/push-ECX +<span id="L2245" class="LineNr">2245 </span> 56/push-ESI +<span id="L2246" class="LineNr">2246 </span> <span class="subxComment"># ESI = in</span> +<span id="L2247" class="LineNr">2247 </span> 8b/copy 1/mod/*+disp8 5/rm32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/ESI 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(EBP+8) to ESI</span> +<span id="L2248" class="LineNr">2248 </span> <span class="subxComment"># var reg-slice/ECX : (address slice) = {in->start, in->start + 3}</span> +<span id="L2249" class="LineNr">2249 </span> 8b/copy 0/mod/indirect 6/rm32/ESI <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 *ESI to EAX</span> +<span id="L2250" class="LineNr">2250 </span> 05/add-to-EAX 3/imm32 +<span id="L2251" class="LineNr">2251 </span> 50/push-EAX +<span id="L2252" class="LineNr">2252 </span> ff 6/subop/push 0/mod/indirect 6/rm32/ESI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># push *ESI</span> +<span id="L2253" class="LineNr">2253 </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="L2254" class="LineNr">2254 </span> <span class="subxComment"># in->start += 3</span> +<span id="L2255" class="LineNr">2255 </span> 81 0/subop/add 0/mod/indirect 6/rm32/ESI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 3/imm32 <span class="subxComment"># add to *ESI</span> +<span id="L2256" class="LineNr">2256 </span> <span class="subxComment"># EAX = get-slice(Registers, word, row-size=8)</span> +<span id="L2257" class="LineNr">2257 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2258" class="LineNr">2258 </span> 68/push <span class="Constant">"next-register"</span>/imm32 +<span id="L2259" class="LineNr">2259 </span> 68/push 8/imm32/row-size +<span id="L2260" class="LineNr">2260 </span> 51/push-ECX +<span id="L2261" class="LineNr">2261 </span> 68/push <span class="SpecialChar"><a href='desugar.subx.html#L4276'>Registers</a></span>/imm32 +<span id="L2262" class="LineNr">2262 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2263" class="LineNr">2263 </span> e8/call <a href='../078table.subx.html#L200'>get-slice</a>/disp32 +<span id="L2264" class="LineNr">2264 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2265" class="LineNr">2265 </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> 0x10/imm32 <span class="subxComment"># add to ESP</span> +<span id="L2266" class="LineNr">2266 </span><span class="Constant">$next-register:end</span>: +<span id="L2267" class="LineNr">2267 </span> <span class="subxComment"># reclaim locals</span> +<span id="L2268" class="LineNr">2268 </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="L2269" class="LineNr">2269 </span> <span class="subxS1Comment"># . restore registers</span> +<span id="L2270" class="LineNr">2270 </span> 5e/pop-to-ESI +<span id="L2271" class="LineNr">2271 </span> 59/pop-to-ECX +<span id="L2272" class="LineNr">2272 </span> <span class="subxS1Comment"># . epilog</span> +<span id="L2273" class="LineNr">2273 </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="L2274" class="LineNr">2274 </span> 5d/pop-to-EBP +<span id="L2275" class="LineNr">2275 </span> c3/return +<span id="L2276" class="LineNr">2276 </span> +<span id="L2277" class="LineNr">2277 </span><span class="subxTest">test-parse-effective-address-simple</span>: +<span id="L2278" class="LineNr">2278 </span> <span class="subxS1Comment"># . prolog</span> +<span id="L2279" class="LineNr">2279 </span> 55/push-EBP +<span id="L2280" class="LineNr">2280 </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="L2281" class="LineNr">2281 </span> <span class="subxComment"># var slice/ECX = "*esi"</span> +<span id="L2282" class="LineNr">2282 </span> b8/copy-to-EAX <span class="Constant">"*esi"</span>/imm32 +<span id="L2283" class="LineNr">2283 </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="L2284" class="LineNr">2284 </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="L2285" class="LineNr">2285 </span> 05/add-to-EAX 4/imm32 +<span id="L2286" class="LineNr">2286 </span> <span class="subxS1Comment"># . ECX = {EAX, ECX}</span> +<span id="L2287" class="LineNr">2287 </span> 51/push-ECX +<span id="L2288" class="LineNr">2288 </span> 50/push-EAX +<span id="L2289" class="LineNr">2289 </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="L2290" class="LineNr">2290 </span> <span class="subxComment"># EAX, ECX, EDX, EBX = parse-effective-address(slice)</span> +<span id="L2291" class="LineNr">2291 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2292" class="LineNr">2292 </span> 51/push-ECX +<span id="L2293" class="LineNr">2293 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2294" class="LineNr">2294 </span> e8/call <a href='desugar.subx.html#L1793'>parse-effective-address</a>/disp32 +<span id="L2295" class="LineNr">2295 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2296" class="LineNr">2296 </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="L2297" class="LineNr">2297 </span> <span class="subxComment"># slice clobbered beyond this point</span> +<span id="L2298" class="LineNr">2298 </span> <span class="subxComment"># check-ints-equal(EAX, 6, msg)</span> +<span id="L2299" class="LineNr">2299 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2300" class="LineNr">2300 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2277'>test-parse-effective-address-simple</a>/base"</span>/imm32 +<span id="L2301" class="LineNr">2301 </span> 68/push 6/imm32/ESI <span id="L2302" class="LineNr">2302 </span> 50/push-EAX -<span id="L2303" class="LineNr">2303 </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="L2304" class="LineNr">2304 </span> <span class="subxComment"># EAX, ECX, EDX, EBX = parse-effective-address(slice)</span> -<span id="L2305" class="LineNr">2305 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2306" class="LineNr">2306 </span> 51/push-ECX -<span id="L2307" class="LineNr">2307 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2308" class="LineNr">2308 </span> e8/call <a href='desugar.subx.html#L1793'>parse-effective-address</a>/disp32 -<span id="L2309" class="LineNr">2309 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2310" class="LineNr">2310 </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="L2311" class="LineNr">2311 </span> <span class="subxComment"># slice clobbered beyond this point</span> -<span id="L2312" class="LineNr">2312 </span> <span class="subxComment"># check-ints-equal(EAX, 6, msg)</span> -<span id="L2313" class="LineNr">2313 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2314" class="LineNr">2314 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2291'>test-parse-effective-address-base-negative-displacement</a>/base"</span>/imm32 -<span id="L2315" class="LineNr">2315 </span> 68/push 6/imm32/ESI -<span id="L2316" class="LineNr">2316 </span> 50/push-EAX -<span id="L2317" class="LineNr">2317 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2318" class="LineNr">2318 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L2319" class="LineNr">2319 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2320" class="LineNr">2320 </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="L2321" class="LineNr">2321 </span> <span class="subxComment"># check-ints-equal(ECX, 4, msg)</span> -<span id="L2322" class="LineNr">2322 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2323" class="LineNr">2323 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2291'>test-parse-effective-address-base-negative-displacement</a>/index"</span>/imm32 -<span id="L2324" class="LineNr">2324 </span> 68/push 4/imm32/none -<span id="L2325" class="LineNr">2325 </span> 51/push-ECX -<span id="L2326" class="LineNr">2326 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2327" class="LineNr">2327 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</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> 0xc/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2330" class="LineNr">2330 </span> <span class="subxComment"># check-ints-equal(EDX, 0, msg)</span> -<span id="L2331" class="LineNr">2331 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2332" class="LineNr">2332 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2291'>test-parse-effective-address-base-negative-displacement</a>/scale"</span>/imm32 -<span id="L2333" class="LineNr">2333 </span> 68/push 0/imm32/none -<span id="L2334" class="LineNr">2334 </span> 52/push-EDX -<span id="L2335" class="LineNr">2335 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2336" class="LineNr">2336 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</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> 0xc/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2339" class="LineNr">2339 </span> <span class="subxComment"># check-ints-equal(EBX, -3, msg)</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='desugar.subx.html#L2291'>test-parse-effective-address-base-negative-displacement</a>/displacement"</span>/imm32 -<span id="L2342" class="LineNr">2342 </span> 68/push -3/imm32 -<span id="L2343" class="LineNr">2343 </span> 53/push-EBX -<span id="L2344" class="LineNr">2344 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2345" class="LineNr">2345 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L2346" class="LineNr">2346 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2347" class="LineNr">2347 </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="L2348" class="LineNr">2348 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L2349" class="LineNr">2349 </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="L2350" class="LineNr">2350 </span> 5d/pop-to-EBP -<span id="L2351" class="LineNr">2351 </span> c3/return -<span id="L2352" class="LineNr">2352 </span> -<span id="L2353" class="LineNr">2353 </span><span class="subxTest">test-parse-effective-address-base-index</span>: -<span id="L2354" class="LineNr">2354 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L2355" class="LineNr">2355 </span> 55/push-EBP -<span id="L2356" class="LineNr">2356 </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="L2357" class="LineNr">2357 </span> <span class="subxComment"># var slice/ECX = "*(esi+ecx)"</span> -<span id="L2358" class="LineNr">2358 </span> b8/copy-to-EAX <span class="Constant">"*(esi+ecx)"</span>/imm32 -<span id="L2359" class="LineNr">2359 </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="L2360" class="LineNr">2360 </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="L2361" class="LineNr">2361 </span> 05/add-to-EAX 4/imm32 -<span id="L2362" class="LineNr">2362 </span> <span class="subxS1Comment"># . ECX = {EAX, ECX}</span> -<span id="L2363" class="LineNr">2363 </span> 51/push-ECX +<span id="L2303" class="LineNr">2303 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2304" class="LineNr">2304 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L2305" class="LineNr">2305 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2306" class="LineNr">2306 </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="L2307" class="LineNr">2307 </span> <span class="subxComment"># check-ints-equal(ECX, 4, msg)</span> +<span id="L2308" class="LineNr">2308 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2309" class="LineNr">2309 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2277'>test-parse-effective-address-simple</a>/index"</span>/imm32 +<span id="L2310" class="LineNr">2310 </span> 68/push 4/imm32/none +<span id="L2311" class="LineNr">2311 </span> 51/push-ECX +<span id="L2312" class="LineNr">2312 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2313" class="LineNr">2313 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L2314" class="LineNr">2314 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2315" class="LineNr">2315 </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="L2316" class="LineNr">2316 </span> <span class="subxComment"># check-ints-equal(EDX, 0, msg)</span> +<span id="L2317" class="LineNr">2317 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2318" class="LineNr">2318 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2277'>test-parse-effective-address-simple</a>/scale"</span>/imm32 +<span id="L2319" class="LineNr">2319 </span> 68/push 0/imm32/none +<span id="L2320" class="LineNr">2320 </span> 52/push-EDX +<span id="L2321" class="LineNr">2321 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2322" class="LineNr">2322 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L2323" class="LineNr">2323 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2324" class="LineNr">2324 </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="L2325" class="LineNr">2325 </span> <span class="subxComment"># check-ints-equal(EBX, 0, msg)</span> +<span id="L2326" class="LineNr">2326 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2327" class="LineNr">2327 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2277'>test-parse-effective-address-simple</a>/displacement"</span>/imm32 +<span id="L2328" class="LineNr">2328 </span> 68/push 0/imm32/none +<span id="L2329" class="LineNr">2329 </span> 53/push-EBX +<span id="L2330" class="LineNr">2330 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2331" class="LineNr">2331 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L2332" class="LineNr">2332 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2333" class="LineNr">2333 </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="L2334" class="LineNr">2334 </span> <span class="subxS1Comment"># . epilog</span> +<span id="L2335" class="LineNr">2335 </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="L2336" class="LineNr">2336 </span> 5d/pop-to-EBP +<span id="L2337" class="LineNr">2337 </span> c3/return +<span id="L2338" class="LineNr">2338 </span> +<span id="L2339" class="LineNr">2339 </span><span class="subxTest">test-parse-effective-address-base</span>: +<span id="L2340" class="LineNr">2340 </span> <span class="subxS1Comment"># . prolog</span> +<span id="L2341" class="LineNr">2341 </span> 55/push-EBP +<span id="L2342" class="LineNr">2342 </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="L2343" class="LineNr">2343 </span> <span class="subxComment"># var slice/ECX = "*(esi )"</span> +<span id="L2344" class="LineNr">2344 </span> b8/copy-to-EAX <span class="Constant">"*(esi )"</span>/imm32 +<span id="L2345" class="LineNr">2345 </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="L2346" class="LineNr">2346 </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="L2347" class="LineNr">2347 </span> 05/add-to-EAX 4/imm32 +<span id="L2348" class="LineNr">2348 </span> <span class="subxS1Comment"># . ECX = {EAX, ECX}</span> +<span id="L2349" class="LineNr">2349 </span> 51/push-ECX +<span id="L2350" class="LineNr">2350 </span> 50/push-EAX +<span id="L2351" class="LineNr">2351 </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="L2352" class="LineNr">2352 </span> <span class="subxComment"># EAX, ECX, EDX, EBX = parse-effective-address(slice)</span> +<span id="L2353" class="LineNr">2353 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2354" class="LineNr">2354 </span> 51/push-ECX +<span id="L2355" class="LineNr">2355 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2356" class="LineNr">2356 </span> e8/call <a href='desugar.subx.html#L1793'>parse-effective-address</a>/disp32 +<span id="L2357" class="LineNr">2357 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2358" class="LineNr">2358 </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="L2359" class="LineNr">2359 </span> <span class="subxComment"># slice clobbered beyond this point</span> +<span id="L2360" class="LineNr">2360 </span> <span class="subxComment"># check-ints-equal(EAX, 6, msg)</span> +<span id="L2361" class="LineNr">2361 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2362" class="LineNr">2362 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2339'>test-parse-effective-address-base</a>/base"</span>/imm32 +<span id="L2363" class="LineNr">2363 </span> 68/push 6/imm32/ESI <span id="L2364" class="LineNr">2364 </span> 50/push-EAX -<span id="L2365" class="LineNr">2365 </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="L2366" class="LineNr">2366 </span> <span class="subxComment"># EAX, ECX, EDX, EBX = parse-effective-address(slice)</span> -<span id="L2367" class="LineNr">2367 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2368" class="LineNr">2368 </span> 51/push-ECX -<span id="L2369" class="LineNr">2369 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2370" class="LineNr">2370 </span> e8/call <a href='desugar.subx.html#L1793'>parse-effective-address</a>/disp32 -<span id="L2371" class="LineNr">2371 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2372" class="LineNr">2372 </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="L2373" class="LineNr">2373 </span> <span class="subxComment"># slice clobbered beyond this point</span> -<span id="L2374" class="LineNr">2374 </span> <span class="subxComment"># check-ints-equal(EAX, 6, msg)</span> -<span id="L2375" class="LineNr">2375 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2376" class="LineNr">2376 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2353'>test-parse-effective-address-base-index</a>/base"</span>/imm32 -<span id="L2377" class="LineNr">2377 </span> 68/push 6/imm32/ESI -<span id="L2378" class="LineNr">2378 </span> 50/push-EAX -<span id="L2379" class="LineNr">2379 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2380" class="LineNr">2380 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</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> 0xc/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2383" class="LineNr">2383 </span> <span class="subxComment"># check-ints-equal(ECX, 1, msg)</span> -<span id="L2384" class="LineNr">2384 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2385" class="LineNr">2385 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2353'>test-parse-effective-address-base-index</a>/index"</span>/imm32 -<span id="L2386" class="LineNr">2386 </span> 68/push 1/imm32/none -<span id="L2387" class="LineNr">2387 </span> 51/push-ECX -<span id="L2388" class="LineNr">2388 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2389" class="LineNr">2389 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</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> 0xc/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2392" class="LineNr">2392 </span> <span class="subxComment"># check-ints-equal(EDX, 0, msg)</span> -<span id="L2393" class="LineNr">2393 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2394" class="LineNr">2394 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2353'>test-parse-effective-address-base-index</a>/scale"</span>/imm32 -<span id="L2395" class="LineNr">2395 </span> 68/push 0/imm32/none -<span id="L2396" class="LineNr">2396 </span> 52/push-EDX -<span id="L2397" class="LineNr">2397 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2398" class="LineNr">2398 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</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> 0xc/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2401" class="LineNr">2401 </span> <span class="subxComment"># check-ints-equal(EBX, 0, 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 - <a href='desugar.subx.html#L2353'>test-parse-effective-address-base-index</a>/displacement"</span>/imm32 -<span id="L2404" class="LineNr">2404 </span> 68/push 0/imm32 -<span id="L2405" class="LineNr">2405 </span> 53/push-EBX -<span id="L2406" class="LineNr">2406 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2407" class="LineNr">2407 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L2408" class="LineNr">2408 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2409" class="LineNr">2409 </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="L2410" class="LineNr">2410 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L2411" class="LineNr">2411 </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="L2412" class="LineNr">2412 </span> 5d/pop-to-EBP -<span id="L2413" class="LineNr">2413 </span> c3/return -<span id="L2414" class="LineNr">2414 </span> -<span id="L2415" class="LineNr">2415 </span><span class="subxTest">test-parse-effective-address-base-index-scale</span>: -<span id="L2416" class="LineNr">2416 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L2417" class="LineNr">2417 </span> 55/push-EBP -<span id="L2418" class="LineNr">2418 </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="L2419" class="LineNr">2419 </span> <span class="subxComment"># var slice/ECX = "*(esi+ecx<<2)"</span> -<span id="L2420" class="LineNr">2420 </span> b8/copy-to-EAX <span class="Constant">"*(esi+ecx<<2)"</span>/imm32 -<span id="L2421" class="LineNr">2421 </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="L2422" class="LineNr">2422 </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="L2423" class="LineNr">2423 </span> 05/add-to-EAX 4/imm32 -<span id="L2424" class="LineNr">2424 </span> <span class="subxS1Comment"># . ECX = {EAX, ECX}</span> -<span id="L2425" class="LineNr">2425 </span> 51/push-ECX +<span id="L2365" class="LineNr">2365 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2366" class="LineNr">2366 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L2367" class="LineNr">2367 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2368" class="LineNr">2368 </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="L2369" class="LineNr">2369 </span> <span class="subxComment"># check-ints-equal(ECX, 4, msg)</span> +<span id="L2370" class="LineNr">2370 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2371" class="LineNr">2371 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2339'>test-parse-effective-address-base</a>/index"</span>/imm32 +<span id="L2372" class="LineNr">2372 </span> 68/push 4/imm32/none +<span id="L2373" class="LineNr">2373 </span> 51/push-ECX +<span id="L2374" class="LineNr">2374 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2375" class="LineNr">2375 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L2376" class="LineNr">2376 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2377" class="LineNr">2377 </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="L2378" class="LineNr">2378 </span> <span class="subxComment"># check-ints-equal(EDX, 0, msg)</span> +<span id="L2379" class="LineNr">2379 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2380" class="LineNr">2380 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2339'>test-parse-effective-address-base</a>/scale"</span>/imm32 +<span id="L2381" class="LineNr">2381 </span> 68/push 0/imm32/none +<span id="L2382" class="LineNr">2382 </span> 52/push-EDX +<span id="L2383" class="LineNr">2383 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2384" class="LineNr">2384 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L2385" class="LineNr">2385 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2386" class="LineNr">2386 </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="L2387" class="LineNr">2387 </span> <span class="subxComment"># check-ints-equal(EBX, 0, msg)</span> +<span id="L2388" class="LineNr">2388 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2389" class="LineNr">2389 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2339'>test-parse-effective-address-base</a>/displacement"</span>/imm32 +<span id="L2390" class="LineNr">2390 </span> 68/push 0/imm32/none +<span id="L2391" class="LineNr">2391 </span> 53/push-EBX +<span id="L2392" class="LineNr">2392 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2393" class="LineNr">2393 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L2394" class="LineNr">2394 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2395" class="LineNr">2395 </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="L2396" class="LineNr">2396 </span> <span class="subxS1Comment"># . epilog</span> +<span id="L2397" class="LineNr">2397 </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="L2398" class="LineNr">2398 </span> 5d/pop-to-EBP +<span id="L2399" class="LineNr">2399 </span> c3/return +<span id="L2400" class="LineNr">2400 </span> +<span id="L2401" class="LineNr">2401 </span><span class="subxTest">test-parse-effective-address-base-displacement</span>: +<span id="L2402" class="LineNr">2402 </span> <span class="subxS1Comment"># . prolog</span> +<span id="L2403" class="LineNr">2403 </span> 55/push-EBP +<span id="L2404" class="LineNr">2404 </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="L2405" class="LineNr">2405 </span> <span class="subxComment"># var slice/ECX = "*(esi+3)"</span> +<span id="L2406" class="LineNr">2406 </span> b8/copy-to-EAX <span class="Constant">"*(esi+3)"</span>/imm32 +<span id="L2407" class="LineNr">2407 </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="L2408" class="LineNr">2408 </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="L2409" class="LineNr">2409 </span> 05/add-to-EAX 4/imm32 +<span id="L2410" class="LineNr">2410 </span> <span class="subxS1Comment"># . ECX = {EAX, ECX}</span> +<span id="L2411" class="LineNr">2411 </span> 51/push-ECX +<span id="L2412" class="LineNr">2412 </span> 50/push-EAX +<span id="L2413" class="LineNr">2413 </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="L2414" class="LineNr">2414 </span> <span class="subxComment"># EAX, ECX, EDX, EBX = parse-effective-address(slice)</span> +<span id="L2415" class="LineNr">2415 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2416" class="LineNr">2416 </span> 51/push-ECX +<span id="L2417" class="LineNr">2417 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2418" class="LineNr">2418 </span> e8/call <a href='desugar.subx.html#L1793'>parse-effective-address</a>/disp32 +<span id="L2419" class="LineNr">2419 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2420" class="LineNr">2420 </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="L2421" class="LineNr">2421 </span> <span class="subxComment"># slice clobbered beyond this point</span> +<span id="L2422" class="LineNr">2422 </span> <span class="subxComment"># check-ints-equal(EAX, 6, msg)</span> +<span id="L2423" class="LineNr">2423 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2424" class="LineNr">2424 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2401'>test-parse-effective-address-base-displacement</a>/base"</span>/imm32 +<span id="L2425" class="LineNr">2425 </span> 68/push 6/imm32/ESI <span id="L2426" class="LineNr">2426 </span> 50/push-EAX -<span id="L2427" class="LineNr">2427 </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="L2428" class="LineNr">2428 </span> <span class="subxComment"># EAX, ECX, EDX, EBX = parse-effective-address(slice)</span> -<span id="L2429" class="LineNr">2429 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2430" class="LineNr">2430 </span> 51/push-ECX -<span id="L2431" class="LineNr">2431 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2432" class="LineNr">2432 </span> e8/call <a href='desugar.subx.html#L1793'>parse-effective-address</a>/disp32 -<span id="L2433" class="LineNr">2433 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2434" class="LineNr">2434 </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="L2435" class="LineNr">2435 </span> <span class="subxComment"># slice clobbered beyond this point</span> -<span id="L2436" class="LineNr">2436 </span> <span class="subxComment"># check-ints-equal(EAX, 6, msg)</span> -<span id="L2437" class="LineNr">2437 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2438" class="LineNr">2438 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2415'>test-parse-effective-address-base-index-scale</a>/base"</span>/imm32 -<span id="L2439" class="LineNr">2439 </span> 68/push 6/imm32/ESI -<span id="L2440" class="LineNr">2440 </span> 50/push-EAX -<span id="L2441" class="LineNr">2441 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2442" class="LineNr">2442 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L2443" class="LineNr">2443 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2444" class="LineNr">2444 </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="L2445" class="LineNr">2445 </span> <span class="subxComment"># check-ints-equal(ECX, 1, msg)</span> -<span id="L2446" class="LineNr">2446 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2447" class="LineNr">2447 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2415'>test-parse-effective-address-base-index-scale</a>/index"</span>/imm32 -<span id="L2448" class="LineNr">2448 </span> 68/push 1/imm32/none -<span id="L2449" class="LineNr">2449 </span> 51/push-ECX -<span id="L2450" class="LineNr">2450 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2451" class="LineNr">2451 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L2452" class="LineNr">2452 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2453" class="LineNr">2453 </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="L2454" class="LineNr">2454 </span> <span class="subxComment"># check-ints-equal(EDX, 2, msg)</span> -<span id="L2455" class="LineNr">2455 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2456" class="LineNr">2456 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2415'>test-parse-effective-address-base-index-scale</a>/scale"</span>/imm32 -<span id="L2457" class="LineNr">2457 </span> 68/push 2/imm32 -<span id="L2458" class="LineNr">2458 </span> 52/push-EDX -<span id="L2459" class="LineNr">2459 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2460" class="LineNr">2460 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L2461" class="LineNr">2461 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2462" class="LineNr">2462 </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="L2463" class="LineNr">2463 </span> <span class="subxComment"># check-ints-equal(EBX, 0, msg)</span> -<span id="L2464" class="LineNr">2464 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2465" class="LineNr">2465 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2415'>test-parse-effective-address-base-index-scale</a>/displacement"</span>/imm32 -<span id="L2466" class="LineNr">2466 </span> 68/push 0/imm32 -<span id="L2467" class="LineNr">2467 </span> 53/push-EBX -<span id="L2468" class="LineNr">2468 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2469" class="LineNr">2469 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L2470" class="LineNr">2470 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2471" class="LineNr">2471 </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="L2472" class="LineNr">2472 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L2473" class="LineNr">2473 </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="L2474" class="LineNr">2474 </span> 5d/pop-to-EBP -<span id="L2475" class="LineNr">2475 </span> c3/return -<span id="L2476" class="LineNr">2476 </span> -<span id="L2477" class="LineNr">2477 </span><span class="subxTest">test-parse-effective-address-base-index-scale-displacement</span>: -<span id="L2478" class="LineNr">2478 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L2479" class="LineNr">2479 </span> 55/push-EBP -<span id="L2480" class="LineNr">2480 </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="L2481" class="LineNr">2481 </span> <span class="subxComment"># var slice/ECX = "*(esi + ecx<<2 - 0x34)"</span> -<span id="L2482" class="LineNr">2482 </span> b8/copy-to-EAX <span class="Constant">"*(esi + ecx<<2 - 0x34)"</span>/imm32 -<span id="L2483" class="LineNr">2483 </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="L2484" class="LineNr">2484 </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="L2485" class="LineNr">2485 </span> 05/add-to-EAX 4/imm32 -<span id="L2486" class="LineNr">2486 </span> <span class="subxS1Comment"># . ECX = {EAX, ECX}</span> -<span id="L2487" class="LineNr">2487 </span> 51/push-ECX +<span id="L2427" class="LineNr">2427 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2428" class="LineNr">2428 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L2429" class="LineNr">2429 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2430" class="LineNr">2430 </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="L2431" class="LineNr">2431 </span> <span class="subxComment"># check-ints-equal(ECX, 4, msg)</span> +<span id="L2432" class="LineNr">2432 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2433" class="LineNr">2433 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2401'>test-parse-effective-address-base-displacement</a>/index"</span>/imm32 +<span id="L2434" class="LineNr">2434 </span> 68/push 4/imm32/none +<span id="L2435" class="LineNr">2435 </span> 51/push-ECX +<span id="L2436" class="LineNr">2436 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2437" class="LineNr">2437 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L2438" class="LineNr">2438 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2439" class="LineNr">2439 </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="L2440" class="LineNr">2440 </span> <span class="subxComment"># check-ints-equal(EDX, 0, msg)</span> +<span id="L2441" class="LineNr">2441 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2442" class="LineNr">2442 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2401'>test-parse-effective-address-base-displacement</a>/scale"</span>/imm32 +<span id="L2443" class="LineNr">2443 </span> 68/push 0/imm32/none +<span id="L2444" class="LineNr">2444 </span> 52/push-EDX +<span id="L2445" class="LineNr">2445 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2446" class="LineNr">2446 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L2447" class="LineNr">2447 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2448" class="LineNr">2448 </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="L2449" class="LineNr">2449 </span> <span class="subxComment"># check-ints-equal(EBX, 3, msg)</span> +<span id="L2450" class="LineNr">2450 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2451" class="LineNr">2451 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2401'>test-parse-effective-address-base-displacement</a>/displacement"</span>/imm32 +<span id="L2452" class="LineNr">2452 </span> 68/push 3/imm32 +<span id="L2453" class="LineNr">2453 </span> 53/push-EBX +<span id="L2454" class="LineNr">2454 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2455" class="LineNr">2455 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L2456" class="LineNr">2456 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2457" class="LineNr">2457 </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="L2458" class="LineNr">2458 </span> <span class="subxS1Comment"># . epilog</span> +<span id="L2459" class="LineNr">2459 </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="L2460" class="LineNr">2460 </span> 5d/pop-to-EBP +<span id="L2461" class="LineNr">2461 </span> c3/return +<span id="L2462" class="LineNr">2462 </span> +<span id="L2463" class="LineNr">2463 </span><span class="subxTest">test-parse-effective-address-base-negative-displacement</span>: +<span id="L2464" class="LineNr">2464 </span> <span class="subxS1Comment"># . prolog</span> +<span id="L2465" class="LineNr">2465 </span> 55/push-EBP +<span id="L2466" class="LineNr">2466 </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="L2467" class="LineNr">2467 </span> <span class="subxComment"># var slice/ECX = "*(esi-3)"</span> +<span id="L2468" class="LineNr">2468 </span> b8/copy-to-EAX <span class="Constant">"*(esi-3)"</span>/imm32 +<span id="L2469" class="LineNr">2469 </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="L2470" class="LineNr">2470 </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="L2471" class="LineNr">2471 </span> 05/add-to-EAX 4/imm32 +<span id="L2472" class="LineNr">2472 </span> <span class="subxS1Comment"># . ECX = {EAX, ECX}</span> +<span id="L2473" class="LineNr">2473 </span> 51/push-ECX +<span id="L2474" class="LineNr">2474 </span> 50/push-EAX +<span id="L2475" class="LineNr">2475 </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="L2476" class="LineNr">2476 </span> <span class="subxComment"># EAX, ECX, EDX, EBX = parse-effective-address(slice)</span> +<span id="L2477" class="LineNr">2477 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2478" class="LineNr">2478 </span> 51/push-ECX +<span id="L2479" class="LineNr">2479 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2480" class="LineNr">2480 </span> e8/call <a href='desugar.subx.html#L1793'>parse-effective-address</a>/disp32 +<span id="L2481" class="LineNr">2481 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2482" class="LineNr">2482 </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="L2483" class="LineNr">2483 </span> <span class="subxComment"># slice clobbered beyond this point</span> +<span id="L2484" class="LineNr">2484 </span> <span class="subxComment"># check-ints-equal(EAX, 6, msg)</span> +<span id="L2485" class="LineNr">2485 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2486" class="LineNr">2486 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2463'>test-parse-effective-address-base-negative-displacement</a>/base"</span>/imm32 +<span id="L2487" class="LineNr">2487 </span> 68/push 6/imm32/ESI <span id="L2488" class="LineNr">2488 </span> 50/push-EAX -<span id="L2489" class="LineNr">2489 </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="L2490" class="LineNr">2490 </span> <span class="subxComment"># EAX, ECX, EDX, EBX = parse-effective-address(slice)</span> -<span id="L2491" class="LineNr">2491 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2492" class="LineNr">2492 </span> 51/push-ECX -<span id="L2493" class="LineNr">2493 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2494" class="LineNr">2494 </span> e8/call <a href='desugar.subx.html#L1793'>parse-effective-address</a>/disp32 -<span id="L2495" class="LineNr">2495 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2496" class="LineNr">2496 </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="L2497" class="LineNr">2497 </span> <span class="subxComment"># slice clobbered beyond this point</span> -<span id="L2498" class="LineNr">2498 </span> <span class="subxComment"># check-ints-equal(EAX, 6, msg)</span> -<span id="L2499" class="LineNr">2499 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2500" class="LineNr">2500 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2415'>test-parse-effective-address-base-index-scale</a>/base"</span>/imm32 -<span id="L2501" class="LineNr">2501 </span> 68/push 6/imm32/ESI -<span id="L2502" class="LineNr">2502 </span> 50/push-EAX -<span id="L2503" class="LineNr">2503 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2504" class="LineNr">2504 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L2505" class="LineNr">2505 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2506" class="LineNr">2506 </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="L2507" class="LineNr">2507 </span> <span class="subxComment"># check-ints-equal(ECX, 1, msg)</span> -<span id="L2508" class="LineNr">2508 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2509" class="LineNr">2509 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2415'>test-parse-effective-address-base-index-scale</a>/index"</span>/imm32 -<span id="L2510" class="LineNr">2510 </span> 68/push 1/imm32/none -<span id="L2511" class="LineNr">2511 </span> 51/push-ECX -<span id="L2512" class="LineNr">2512 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2513" class="LineNr">2513 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L2514" class="LineNr">2514 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2515" class="LineNr">2515 </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="L2516" class="LineNr">2516 </span> <span class="subxComment"># check-ints-equal(EDX, 2, msg)</span> -<span id="L2517" class="LineNr">2517 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2518" class="LineNr">2518 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2415'>test-parse-effective-address-base-index-scale</a>/scale"</span>/imm32 -<span id="L2519" class="LineNr">2519 </span> 68/push 2/imm32 -<span id="L2520" class="LineNr">2520 </span> 52/push-EDX -<span id="L2521" class="LineNr">2521 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2522" class="LineNr">2522 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L2523" class="LineNr">2523 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2524" class="LineNr">2524 </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="L2525" class="LineNr">2525 </span> <span class="subxComment"># check-ints-equal(EBX, -0x34, msg)</span> -<span id="L2526" class="LineNr">2526 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2527" class="LineNr">2527 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2415'>test-parse-effective-address-base-index-scale</a>/displacement"</span>/imm32 -<span id="L2528" class="LineNr">2528 </span> 68/push -0x34/imm32 -<span id="L2529" class="LineNr">2529 </span> 53/push-EBX -<span id="L2530" class="LineNr">2530 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2531" class="LineNr">2531 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L2532" class="LineNr">2532 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2533" class="LineNr">2533 </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="L2534" class="LineNr">2534 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L2535" class="LineNr">2535 </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="L2536" class="LineNr">2536 </span> 5d/pop-to-EBP -<span id="L2537" class="LineNr">2537 </span> c3/return -<span id="L2538" class="LineNr">2538 </span> -<span id="L2539" class="LineNr">2539 </span><span class="subxComment"># Code generation:</span> -<span id="L2540" class="LineNr">2540 </span><span class="subxComment"># if index is none and disp is 0, then mod = 0 and rm32 = base</span> -<span id="L2541" class="LineNr">2541 </span><span class="subxComment"># if index is none, then mod = 2 and rm32 = base and disp32 = disp</span> -<span id="L2542" class="LineNr">2542 </span><span class="subxComment"># if index is not none, then mod = 2 and rm32 = 4 and base = base and index = index and disp32 = disp</span> -<span id="L2543" class="LineNr">2543 </span><span class="subxFunction">emit-indirect-mode</span>: <span class="subxComment"># out : (address buffered-file), base : int, index : int, scale : int, disp : int</span> -<span id="L2544" class="LineNr">2544 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L2545" class="LineNr">2545 </span> 55/push-EBP -<span id="L2546" class="LineNr">2546 </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="L2547" class="LineNr">2547 </span><span class="Constant">$emit-indirect-mode:check-for-sib</span>: -<span id="L2548" class="LineNr">2548 </span> <span class="subxComment"># if (index == 4/none) goto next check</span> -<span id="L2549" class="LineNr">2549 </span> 81 7/subop/compare 1/mod/*+disp8 5/rm32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x10/disp8 4/imm32 <span class="subxComment"># compare *(EBP+16)</span> -<span id="L2550" class="LineNr">2550 </span> 0f 84/jump-if-equal $emit-indirect-mode:check-for-disp/disp32 -<span id="L2551" class="LineNr">2551 </span><span class="Constant">$emit-indirect-mode:emit-sib</span>: -<span id="L2552" class="LineNr">2552 </span> <span class="subxComment"># emit(out, "2/mod/indirect 4/rm32/sib " base "/base " index "/index " scale "/scale " disp "/disp32")</span> -<span id="L2553" class="LineNr">2553 </span> <span class="subxS1Comment"># . write-buffered(out, "2/mod/*+disp32 4/rm32/sib ")</span> -<span id="L2554" class="LineNr">2554 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2555" class="LineNr">2555 </span> 68/push <span class="Constant">"2/mod/*+disp32 4/rm32/sib "</span>/imm32 -<span id="L2556" class="LineNr">2556 </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="L2557" class="LineNr">2557 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2558" class="LineNr">2558 </span> e8/call <a href='../065write-buffered.subx.html#L8'>write-buffered</a>/disp32 -<span id="L2559" class="LineNr">2559 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2560" class="LineNr">2560 </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="L2561" class="LineNr">2561 </span> <span class="subxS1Comment"># . print-int32-buffered(out, base)</span> -<span id="L2562" class="LineNr">2562 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2563" class="LineNr">2563 </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> 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(EBP+12)</span> -<span id="L2564" class="LineNr">2564 </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="L2565" class="LineNr">2565 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2566" class="LineNr">2566 </span> e8/call <a href='../066print-int.subx.html#L267'>print-int32-buffered</a>/disp32 -<span id="L2567" class="LineNr">2567 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2568" class="LineNr">2568 </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="L2569" class="LineNr">2569 </span> <span class="subxS1Comment"># . write-buffered(out, "/base ")</span> -<span id="L2570" class="LineNr">2570 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2571" class="LineNr">2571 </span> 68/push <span class="Constant">"/base "</span>/imm32 -<span id="L2572" class="LineNr">2572 </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="L2573" class="LineNr">2573 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2574" class="LineNr">2574 </span> e8/call <a href='../065write-buffered.subx.html#L8'>write-buffered</a>/disp32 -<span id="L2575" class="LineNr">2575 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2576" class="LineNr">2576 </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="L2577" class="LineNr">2577 </span> <span class="subxS1Comment"># . print-int32-buffered(out, index)</span> -<span id="L2578" class="LineNr">2578 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2579" class="LineNr">2579 </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="L2580" class="LineNr">2580 </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="L2581" class="LineNr">2581 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2582" class="LineNr">2582 </span> e8/call <a href='../066print-int.subx.html#L267'>print-int32-buffered</a>/disp32 -<span id="L2583" class="LineNr">2583 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2584" class="LineNr">2584 </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="L2585" class="LineNr">2585 </span> <span class="subxS1Comment"># . write-buffered(out, "/index ")</span> -<span id="L2586" class="LineNr">2586 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2587" class="LineNr">2587 </span> 68/push <span class="Constant">"/index "</span>/imm32 -<span id="L2588" class="LineNr">2588 </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="L2589" class="LineNr">2589 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2590" class="LineNr">2590 </span> e8/call <a href='../065write-buffered.subx.html#L8'>write-buffered</a>/disp32 -<span id="L2591" class="LineNr">2591 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2592" class="LineNr">2592 </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="L2593" class="LineNr">2593 </span> <span class="subxS1Comment"># . print-int32-buffered(out, scale)</span> -<span id="L2594" class="LineNr">2594 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2595" class="LineNr">2595 </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> 0x14/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(EBP+20)</span> -<span id="L2596" class="LineNr">2596 </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="L2597" class="LineNr">2597 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2598" class="LineNr">2598 </span> e8/call <a href='../066print-int.subx.html#L267'>print-int32-buffered</a>/disp32 -<span id="L2599" class="LineNr">2599 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2600" class="LineNr">2600 </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="L2601" class="LineNr">2601 </span> <span class="subxS1Comment"># . write-buffered(out, "/scale ")</span> -<span id="L2602" class="LineNr">2602 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2603" class="LineNr">2603 </span> 68/push <span class="Constant">"/scale "</span>/imm32 -<span id="L2604" class="LineNr">2604 </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="L2605" class="LineNr">2605 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2606" class="LineNr">2606 </span> e8/call <a href='../065write-buffered.subx.html#L8'>write-buffered</a>/disp32 -<span id="L2607" class="LineNr">2607 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2608" class="LineNr">2608 </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="L2609" class="LineNr">2609 </span> <span class="subxS1Comment"># . print-int32-buffered(out, disp)</span> -<span id="L2610" class="LineNr">2610 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2611" class="LineNr">2611 </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> 0x18/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(EBP+24)</span> -<span id="L2612" class="LineNr">2612 </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="L2489" class="LineNr">2489 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2490" class="LineNr">2490 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L2491" class="LineNr">2491 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2492" class="LineNr">2492 </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="L2493" class="LineNr">2493 </span> <span class="subxComment"># check-ints-equal(ECX, 4, msg)</span> +<span id="L2494" class="LineNr">2494 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2495" class="LineNr">2495 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2463'>test-parse-effective-address-base-negative-displacement</a>/index"</span>/imm32 +<span id="L2496" class="LineNr">2496 </span> 68/push 4/imm32/none +<span id="L2497" class="LineNr">2497 </span> 51/push-ECX +<span id="L2498" class="LineNr">2498 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2499" class="LineNr">2499 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L2500" class="LineNr">2500 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2501" class="LineNr">2501 </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="L2502" class="LineNr">2502 </span> <span class="subxComment"># check-ints-equal(EDX, 0, msg)</span> +<span id="L2503" class="LineNr">2503 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2504" class="LineNr">2504 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2463'>test-parse-effective-address-base-negative-displacement</a>/scale"</span>/imm32 +<span id="L2505" class="LineNr">2505 </span> 68/push 0/imm32/none +<span id="L2506" class="LineNr">2506 </span> 52/push-EDX +<span id="L2507" class="LineNr">2507 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2508" class="LineNr">2508 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L2509" class="LineNr">2509 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2510" class="LineNr">2510 </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="L2511" class="LineNr">2511 </span> <span class="subxComment"># check-ints-equal(EBX, -3, msg)</span> +<span id="L2512" class="LineNr">2512 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2513" class="LineNr">2513 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2463'>test-parse-effective-address-base-negative-displacement</a>/displacement"</span>/imm32 +<span id="L2514" class="LineNr">2514 </span> 68/push -3/imm32 +<span id="L2515" class="LineNr">2515 </span> 53/push-EBX +<span id="L2516" class="LineNr">2516 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2517" class="LineNr">2517 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L2518" class="LineNr">2518 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2519" class="LineNr">2519 </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="L2520" class="LineNr">2520 </span> <span class="subxS1Comment"># . epilog</span> +<span id="L2521" class="LineNr">2521 </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="L2522" class="LineNr">2522 </span> 5d/pop-to-EBP +<span id="L2523" class="LineNr">2523 </span> c3/return +<span id="L2524" class="LineNr">2524 </span> +<span id="L2525" class="LineNr">2525 </span><span class="subxTest">test-parse-effective-address-base-index</span>: +<span id="L2526" class="LineNr">2526 </span> <span class="subxS1Comment"># . prolog</span> +<span id="L2527" class="LineNr">2527 </span> 55/push-EBP +<span id="L2528" class="LineNr">2528 </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="L2529" class="LineNr">2529 </span> <span class="subxComment"># var slice/ECX = "*(esi+ecx)"</span> +<span id="L2530" class="LineNr">2530 </span> b8/copy-to-EAX <span class="Constant">"*(esi+ecx)"</span>/imm32 +<span id="L2531" class="LineNr">2531 </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="L2532" class="LineNr">2532 </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="L2533" class="LineNr">2533 </span> 05/add-to-EAX 4/imm32 +<span id="L2534" class="LineNr">2534 </span> <span class="subxS1Comment"># . ECX = {EAX, ECX}</span> +<span id="L2535" class="LineNr">2535 </span> 51/push-ECX +<span id="L2536" class="LineNr">2536 </span> 50/push-EAX +<span id="L2537" class="LineNr">2537 </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="L2538" class="LineNr">2538 </span> <span class="subxComment"># EAX, ECX, EDX, EBX = parse-effective-address(slice)</span> +<span id="L2539" class="LineNr">2539 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2540" class="LineNr">2540 </span> 51/push-ECX +<span id="L2541" class="LineNr">2541 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2542" class="LineNr">2542 </span> e8/call <a href='desugar.subx.html#L1793'>parse-effective-address</a>/disp32 +<span id="L2543" class="LineNr">2543 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2544" class="LineNr">2544 </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="L2545" class="LineNr">2545 </span> <span class="subxComment"># slice clobbered beyond this point</span> +<span id="L2546" class="LineNr">2546 </span> <span class="subxComment"># check-ints-equal(EAX, 6, msg)</span> +<span id="L2547" class="LineNr">2547 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2548" class="LineNr">2548 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2525'>test-parse-effective-address-base-index</a>/base"</span>/imm32 +<span id="L2549" class="LineNr">2549 </span> 68/push 6/imm32/ESI +<span id="L2550" class="LineNr">2550 </span> 50/push-EAX +<span id="L2551" class="LineNr">2551 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2552" class="LineNr">2552 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L2553" class="LineNr">2553 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2554" class="LineNr">2554 </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="L2555" class="LineNr">2555 </span> <span class="subxComment"># check-ints-equal(ECX, 1, msg)</span> +<span id="L2556" class="LineNr">2556 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2557" class="LineNr">2557 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2525'>test-parse-effective-address-base-index</a>/index"</span>/imm32 +<span id="L2558" class="LineNr">2558 </span> 68/push 1/imm32/none +<span id="L2559" class="LineNr">2559 </span> 51/push-ECX +<span id="L2560" class="LineNr">2560 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2561" class="LineNr">2561 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L2562" class="LineNr">2562 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2563" class="LineNr">2563 </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="L2564" class="LineNr">2564 </span> <span class="subxComment"># check-ints-equal(EDX, 0, msg)</span> +<span id="L2565" class="LineNr">2565 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2566" class="LineNr">2566 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2525'>test-parse-effective-address-base-index</a>/scale"</span>/imm32 +<span id="L2567" class="LineNr">2567 </span> 68/push 0/imm32/none +<span id="L2568" class="LineNr">2568 </span> 52/push-EDX +<span id="L2569" class="LineNr">2569 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2570" class="LineNr">2570 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L2571" class="LineNr">2571 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2572" class="LineNr">2572 </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="L2573" class="LineNr">2573 </span> <span class="subxComment"># check-ints-equal(EBX, 0, msg)</span> +<span id="L2574" class="LineNr">2574 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2575" class="LineNr">2575 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2525'>test-parse-effective-address-base-index</a>/displacement"</span>/imm32 +<span id="L2576" class="LineNr">2576 </span> 68/push 0/imm32 +<span id="L2577" class="LineNr">2577 </span> 53/push-EBX +<span id="L2578" class="LineNr">2578 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2579" class="LineNr">2579 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L2580" class="LineNr">2580 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2581" class="LineNr">2581 </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="L2582" class="LineNr">2582 </span> <span class="subxS1Comment"># . epilog</span> +<span id="L2583" class="LineNr">2583 </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="L2584" class="LineNr">2584 </span> 5d/pop-to-EBP +<span id="L2585" class="LineNr">2585 </span> c3/return +<span id="L2586" class="LineNr">2586 </span> +<span id="L2587" class="LineNr">2587 </span><span class="subxTest">test-parse-effective-address-base-index-scale</span>: +<span id="L2588" class="LineNr">2588 </span> <span class="subxS1Comment"># . prolog</span> +<span id="L2589" class="LineNr">2589 </span> 55/push-EBP +<span id="L2590" class="LineNr">2590 </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="L2591" class="LineNr">2591 </span> <span class="subxComment"># var slice/ECX = "*(esi+ecx<<2)"</span> +<span id="L2592" class="LineNr">2592 </span> b8/copy-to-EAX <span class="Constant">"*(esi+ecx<<2)"</span>/imm32 +<span id="L2593" class="LineNr">2593 </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="L2594" class="LineNr">2594 </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="L2595" class="LineNr">2595 </span> 05/add-to-EAX 4/imm32 +<span id="L2596" class="LineNr">2596 </span> <span class="subxS1Comment"># . ECX = {EAX, ECX}</span> +<span id="L2597" class="LineNr">2597 </span> 51/push-ECX +<span id="L2598" class="LineNr">2598 </span> 50/push-EAX +<span id="L2599" class="LineNr">2599 </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="L2600" class="LineNr">2600 </span> <span class="subxComment"># EAX, ECX, EDX, EBX = parse-effective-address(slice)</span> +<span id="L2601" class="LineNr">2601 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2602" class="LineNr">2602 </span> 51/push-ECX +<span id="L2603" class="LineNr">2603 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2604" class="LineNr">2604 </span> e8/call <a href='desugar.subx.html#L1793'>parse-effective-address</a>/disp32 +<span id="L2605" class="LineNr">2605 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2606" class="LineNr">2606 </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="L2607" class="LineNr">2607 </span> <span class="subxComment"># slice clobbered beyond this point</span> +<span id="L2608" class="LineNr">2608 </span> <span class="subxComment"># check-ints-equal(EAX, 6, msg)</span> +<span id="L2609" class="LineNr">2609 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2610" class="LineNr">2610 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2587'>test-parse-effective-address-base-index-scale</a>/base"</span>/imm32 +<span id="L2611" class="LineNr">2611 </span> 68/push 6/imm32/ESI +<span id="L2612" class="LineNr">2612 </span> 50/push-EAX <span id="L2613" class="LineNr">2613 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2614" class="LineNr">2614 </span> e8/call <a href='../066print-int.subx.html#L267'>print-int32-buffered</a>/disp32 +<span id="L2614" class="LineNr">2614 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 <span id="L2615" class="LineNr">2615 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2616" class="LineNr">2616 </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="L2617" class="LineNr">2617 </span> <span class="subxS1Comment"># . write-buffered(out, "/disp32")</span> +<span id="L2616" class="LineNr">2616 </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="L2617" class="LineNr">2617 </span> <span class="subxComment"># check-ints-equal(ECX, 1, msg)</span> <span id="L2618" class="LineNr">2618 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2619" class="LineNr">2619 </span> 68/push <span class="Constant">"/disp32"</span>/imm32 -<span id="L2620" class="LineNr">2620 </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="L2621" class="LineNr">2621 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2622" class="LineNr">2622 </span> e8/call <a href='../065write-buffered.subx.html#L8'>write-buffered</a>/disp32 -<span id="L2623" class="LineNr">2623 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2624" class="LineNr">2624 </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="L2625" class="LineNr">2625 </span> e9/jump $emit-indirect-mode:end/disp32 -<span id="L2626" class="LineNr">2626 </span><span class="Constant">$emit-indirect-mode:check-for-disp</span>: -<span id="L2627" class="LineNr">2627 </span> <span class="subxComment"># if (disp == 0) goto next check</span> -<span id="L2628" class="LineNr">2628 </span> 81 7/subop/compare 1/mod/*+disp8 5/rm32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x18/disp8 0/imm32 <span class="subxComment"># compare *(EBP+24)</span> -<span id="L2629" class="LineNr">2629 </span> 74/jump-if-equal $emit-indirect-mode:emit-indirect/disp8 -<span id="L2630" class="LineNr">2630 </span><span class="Constant">$emit-indirect-mode:emit-disp</span>: -<span id="L2631" class="LineNr">2631 </span> <span class="subxComment"># emit(out, "2/mod/*+disp32 " base "/rm32 " disp "/disp32")</span> -<span id="L2632" class="LineNr">2632 </span> <span class="subxS1Comment"># . write-buffered(out, "2/mod/*+disp32 ")</span> -<span id="L2633" class="LineNr">2633 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2634" class="LineNr">2634 </span> 68/push <span class="Constant">"2/mod/*+disp32 "</span>/imm32 -<span id="L2635" class="LineNr">2635 </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="L2636" class="LineNr">2636 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2637" class="LineNr">2637 </span> e8/call <a href='../065write-buffered.subx.html#L8'>write-buffered</a>/disp32 -<span id="L2638" class="LineNr">2638 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2639" class="LineNr">2639 </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="L2640" class="LineNr">2640 </span> <span class="subxS1Comment"># . print-int32-buffered(out, base)</span> -<span id="L2641" class="LineNr">2641 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2642" class="LineNr">2642 </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> 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(EBP+12)</span> -<span id="L2643" class="LineNr">2643 </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="L2644" class="LineNr">2644 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2645" class="LineNr">2645 </span> e8/call <a href='../066print-int.subx.html#L267'>print-int32-buffered</a>/disp32 -<span id="L2646" class="LineNr">2646 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2647" class="LineNr">2647 </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="L2648" class="LineNr">2648 </span> <span class="subxS1Comment"># . write-buffered(out, "/rm32 ")</span> -<span id="L2649" class="LineNr">2649 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2650" class="LineNr">2650 </span> 68/push <span class="Constant">"/rm32 "</span>/imm32 -<span id="L2651" class="LineNr">2651 </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="L2652" class="LineNr">2652 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2653" class="LineNr">2653 </span> e8/call <a href='../065write-buffered.subx.html#L8'>write-buffered</a>/disp32 -<span id="L2654" class="LineNr">2654 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2655" class="LineNr">2655 </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="L2656" class="LineNr">2656 </span> <span class="subxS1Comment"># . print-int32-buffered(out, disp)</span> -<span id="L2657" class="LineNr">2657 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2658" class="LineNr">2658 </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> 0x18/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(EBP+24)</span> -<span id="L2659" class="LineNr">2659 </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="L2660" class="LineNr">2660 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2661" class="LineNr">2661 </span> e8/call <a href='../066print-int.subx.html#L267'>print-int32-buffered</a>/disp32 -<span id="L2662" class="LineNr">2662 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2663" class="LineNr">2663 </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="L2664" class="LineNr">2664 </span> <span class="subxS1Comment"># . write-buffered(out, "/disp32")</span> -<span id="L2665" class="LineNr">2665 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2666" class="LineNr">2666 </span> 68/push <span class="Constant">"/disp32"</span>/imm32 -<span id="L2667" class="LineNr">2667 </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="L2668" class="LineNr">2668 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2669" class="LineNr">2669 </span> e8/call <a href='../065write-buffered.subx.html#L8'>write-buffered</a>/disp32 -<span id="L2670" class="LineNr">2670 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2671" class="LineNr">2671 </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="L2672" class="LineNr">2672 </span> eb/jump $emit-indirect-mode:end/disp8 -<span id="L2673" class="LineNr">2673 </span><span class="Constant">$emit-indirect-mode:emit-indirect</span>: -<span id="L2674" class="LineNr">2674 </span> <span class="subxComment"># emit(out, "0/mod/indirect " base "/rm32")</span> -<span id="L2675" class="LineNr">2675 </span> <span class="subxS1Comment"># . write-buffered(out, "0/mod/indirect ")</span> -<span id="L2676" class="LineNr">2676 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2677" class="LineNr">2677 </span> 68/push <span class="Constant">"0/mod/indirect "</span>/imm32 -<span id="L2678" class="LineNr">2678 </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="L2679" class="LineNr">2679 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2680" class="LineNr">2680 </span> e8/call <a href='../065write-buffered.subx.html#L8'>write-buffered</a>/disp32 -<span id="L2681" class="LineNr">2681 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2682" class="LineNr">2682 </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="L2683" class="LineNr">2683 </span> <span class="subxS1Comment"># . print-int32-buffered(out, base)</span> -<span id="L2684" class="LineNr">2684 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2685" class="LineNr">2685 </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> 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(EBP+12)</span> -<span id="L2686" class="LineNr">2686 </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="L2687" class="LineNr">2687 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2688" class="LineNr">2688 </span> e8/call <a href='../066print-int.subx.html#L267'>print-int32-buffered</a>/disp32 -<span id="L2689" class="LineNr">2689 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2690" class="LineNr">2690 </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="L2691" class="LineNr">2691 </span> <span class="subxS1Comment"># . write-buffered(out, "/rm32")</span> -<span id="L2692" class="LineNr">2692 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2693" class="LineNr">2693 </span> 68/push <span class="Constant">"/rm32"</span>/imm32 -<span id="L2694" class="LineNr">2694 </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="L2695" class="LineNr">2695 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2696" class="LineNr">2696 </span> e8/call <a href='../065write-buffered.subx.html#L8'>write-buffered</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="Constant">$emit-indirect-mode:end</span>: -<span id="L2700" class="LineNr">2700 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L2701" class="LineNr">2701 </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="L2702" class="LineNr">2702 </span> 5d/pop-to-EBP -<span id="L2703" class="LineNr">2703 </span> c3/return -<span id="L2704" class="LineNr">2704 </span> -<span id="L2705" class="LineNr">2705 </span><span class="subxTest">test-emit-indirect-mode</span>: -<span id="L2706" class="LineNr">2706 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L2707" class="LineNr">2707 </span> 55/push-EBP -<span id="L2708" class="LineNr">2708 </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="L2709" class="LineNr">2709 </span> <span class="subxComment"># setup</span> -<span id="L2710" class="LineNr">2710 </span> <span class="subxS1Comment"># . clear-stream(_test-output-stream)</span> -<span id="L2711" class="LineNr">2711 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2712" class="LineNr">2712 </span> 68/push <a href='../064write-byte.subx.html#L290'>_test-output-stream</a>/imm32 -<span id="L2713" class="LineNr">2713 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2714" class="LineNr">2714 </span> e8/call <a href='../055stream.subx.html#L17'>clear-stream</a>/disp32 -<span id="L2715" class="LineNr">2715 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2716" class="LineNr">2716 </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="L2717" class="LineNr">2717 </span> <span class="subxS1Comment"># . clear-stream(_test-output-buffered-file+4)</span> -<span id="L2718" class="LineNr">2718 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2719" class="LineNr">2719 </span> b8/copy-to-EAX <a href='../064write-byte.subx.html#L332'>_test-output-buffered-file</a>/imm32 -<span id="L2720" class="LineNr">2720 </span> 05/add-to-EAX 4/imm32 -<span id="L2721" class="LineNr">2721 </span> 50/push-EAX -<span id="L2722" class="LineNr">2722 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2723" class="LineNr">2723 </span> e8/call <a href='../055stream.subx.html#L17'>clear-stream</a>/disp32 -<span id="L2724" class="LineNr">2724 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2725" class="LineNr">2725 </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="L2726" class="LineNr">2726 </span> <span class="subxComment"># emit-indirect-mode(_test-output-buffered-file, 0, 4/none, 0, 0)</span> -<span id="L2727" class="LineNr">2727 </span> <span class="subxS2Comment"># . . write args</span> -<span id="L2728" class="LineNr">2728 </span> 68/push 0/imm32/.disp -<span id="L2729" class="LineNr">2729 </span> 68/push 0/imm32/.scale -<span id="L2730" class="LineNr">2730 </span> 68/push 4/imm32/.index/none -<span id="L2731" class="LineNr">2731 </span> 68/push 0/imm32/.base -<span id="L2732" class="LineNr">2732 </span> 68/push <a href='../064write-byte.subx.html#L332'>_test-output-buffered-file</a>/imm32 -<span id="L2733" class="LineNr">2733 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2734" class="LineNr">2734 </span> e8/call <a href='desugar.subx.html#L2543'>emit-indirect-mode</a>/disp32 -<span id="L2735" class="LineNr">2735 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2736" class="LineNr">2736 </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> 0x14/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2737" class="LineNr">2737 </span> <span class="subxS1Comment"># . flush(_test-output-buffered-file)</span> -<span id="L2738" class="LineNr">2738 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2739" class="LineNr">2739 </span> 68/push <a href='../064write-byte.subx.html#L332'>_test-output-buffered-file</a>/imm32 -<span id="L2740" class="LineNr">2740 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2741" class="LineNr">2741 </span> e8/call <a href='../064write-byte.subx.html#L79'>flush</a>/disp32 -<span id="L2742" class="LineNr">2742 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2743" class="LineNr">2743 </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="L2744" class="Folded">2744 </span><span class="Folded">+-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------</span> -<span id="L2770" class="LineNr">2770 </span> <span class="subxComment"># check-stream-equal(_test-output-stream, "0/mod/indirect 0/rm32", msg)</span> -<span id="L2771" class="LineNr">2771 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2772" class="LineNr">2772 </span> 68/push <span class="Constant">"F - test-emit-indirect-mode"</span>/imm32 -<span id="L2773" class="LineNr">2773 </span> 68/push <span class="Constant">"0/mod/indirect 0x00000000/rm32"</span>/imm32 -<span id="L2774" class="LineNr">2774 </span> 68/push <a href='../064write-byte.subx.html#L290'>_test-output-stream</a>/imm32 -<span id="L2775" class="LineNr">2775 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2776" class="LineNr">2776 </span> e8/call <a href='../058stream-equal.subx.html#L193'>check-stream-equal</a>/disp32 -<span id="L2777" class="LineNr">2777 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2778" class="LineNr">2778 </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="L2779" class="LineNr">2779 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L2780" class="LineNr">2780 </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="L2781" class="LineNr">2781 </span> 5d/pop-to-EBP -<span id="L2782" class="LineNr">2782 </span> c3/return -<span id="L2783" class="LineNr">2783 </span> -<span id="L2784" class="LineNr">2784 </span><span class="subxTest">test-emit-indirect-mode-2</span>: -<span id="L2785" class="LineNr">2785 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L2786" class="LineNr">2786 </span> 55/push-EBP -<span id="L2787" class="LineNr">2787 </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="L2788" class="LineNr">2788 </span> <span class="subxComment"># setup</span> -<span id="L2789" class="LineNr">2789 </span> <span class="subxS1Comment"># . clear-stream(_test-output-stream)</span> +<span id="L2619" class="LineNr">2619 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2587'>test-parse-effective-address-base-index-scale</a>/index"</span>/imm32 +<span id="L2620" class="LineNr">2620 </span> 68/push 1/imm32/none +<span id="L2621" class="LineNr">2621 </span> 51/push-ECX +<span id="L2622" class="LineNr">2622 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2623" class="LineNr">2623 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L2624" class="LineNr">2624 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2625" class="LineNr">2625 </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="L2626" class="LineNr">2626 </span> <span class="subxComment"># check-ints-equal(EDX, 2, msg)</span> +<span id="L2627" class="LineNr">2627 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2628" class="LineNr">2628 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2587'>test-parse-effective-address-base-index-scale</a>/scale"</span>/imm32 +<span id="L2629" class="LineNr">2629 </span> 68/push 2/imm32 +<span id="L2630" class="LineNr">2630 </span> 52/push-EDX +<span id="L2631" class="LineNr">2631 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2632" class="LineNr">2632 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L2633" class="LineNr">2633 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2634" class="LineNr">2634 </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="L2635" class="LineNr">2635 </span> <span class="subxComment"># check-ints-equal(EBX, 0, msg)</span> +<span id="L2636" class="LineNr">2636 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2637" class="LineNr">2637 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2587'>test-parse-effective-address-base-index-scale</a>/displacement"</span>/imm32 +<span id="L2638" class="LineNr">2638 </span> 68/push 0/imm32 +<span id="L2639" class="LineNr">2639 </span> 53/push-EBX +<span id="L2640" class="LineNr">2640 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2641" class="LineNr">2641 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L2642" class="LineNr">2642 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2643" class="LineNr">2643 </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="L2644" class="LineNr">2644 </span> <span class="subxS1Comment"># . epilog</span> +<span id="L2645" class="LineNr">2645 </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="L2646" class="LineNr">2646 </span> 5d/pop-to-EBP +<span id="L2647" class="LineNr">2647 </span> c3/return +<span id="L2648" class="LineNr">2648 </span> +<span id="L2649" class="LineNr">2649 </span><span class="subxTest">test-parse-effective-address-base-index-scale-displacement</span>: +<span id="L2650" class="LineNr">2650 </span> <span class="subxS1Comment"># . prolog</span> +<span id="L2651" class="LineNr">2651 </span> 55/push-EBP +<span id="L2652" class="LineNr">2652 </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="L2653" class="LineNr">2653 </span> <span class="subxComment"># var slice/ECX = "*(esi + ecx<<2 - 0x34)"</span> +<span id="L2654" class="LineNr">2654 </span> b8/copy-to-EAX <span class="Constant">"*(esi + ecx<<2 - 0x34)"</span>/imm32 +<span id="L2655" class="LineNr">2655 </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="L2656" class="LineNr">2656 </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="L2657" class="LineNr">2657 </span> 05/add-to-EAX 4/imm32 +<span id="L2658" class="LineNr">2658 </span> <span class="subxS1Comment"># . ECX = {EAX, ECX}</span> +<span id="L2659" class="LineNr">2659 </span> 51/push-ECX +<span id="L2660" class="LineNr">2660 </span> 50/push-EAX +<span id="L2661" class="LineNr">2661 </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="L2662" class="LineNr">2662 </span> <span class="subxComment"># EAX, ECX, EDX, EBX = parse-effective-address(slice)</span> +<span id="L2663" class="LineNr">2663 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2664" class="LineNr">2664 </span> 51/push-ECX +<span id="L2665" class="LineNr">2665 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2666" class="LineNr">2666 </span> e8/call <a href='desugar.subx.html#L1793'>parse-effective-address</a>/disp32 +<span id="L2667" class="LineNr">2667 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2668" class="LineNr">2668 </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="L2669" class="LineNr">2669 </span> <span class="subxComment"># slice clobbered beyond this point</span> +<span id="L2670" class="LineNr">2670 </span> <span class="subxComment"># check-ints-equal(EAX, 6, msg)</span> +<span id="L2671" class="LineNr">2671 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2672" class="LineNr">2672 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2587'>test-parse-effective-address-base-index-scale</a>/base"</span>/imm32 +<span id="L2673" class="LineNr">2673 </span> 68/push 6/imm32/ESI +<span id="L2674" class="LineNr">2674 </span> 50/push-EAX +<span id="L2675" class="LineNr">2675 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2676" class="LineNr">2676 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L2677" class="LineNr">2677 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2678" class="LineNr">2678 </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="L2679" class="LineNr">2679 </span> <span class="subxComment"># check-ints-equal(ECX, 1, msg)</span> +<span id="L2680" class="LineNr">2680 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2681" class="LineNr">2681 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2587'>test-parse-effective-address-base-index-scale</a>/index"</span>/imm32 +<span id="L2682" class="LineNr">2682 </span> 68/push 1/imm32/none +<span id="L2683" class="LineNr">2683 </span> 51/push-ECX +<span id="L2684" class="LineNr">2684 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2685" class="LineNr">2685 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L2686" class="LineNr">2686 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2687" class="LineNr">2687 </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="L2688" class="LineNr">2688 </span> <span class="subxComment"># check-ints-equal(EDX, 2, msg)</span> +<span id="L2689" class="LineNr">2689 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2690" class="LineNr">2690 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2587'>test-parse-effective-address-base-index-scale</a>/scale"</span>/imm32 +<span id="L2691" class="LineNr">2691 </span> 68/push 2/imm32 +<span id="L2692" class="LineNr">2692 </span> 52/push-EDX +<span id="L2693" class="LineNr">2693 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2694" class="LineNr">2694 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L2695" class="LineNr">2695 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2696" class="LineNr">2696 </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="L2697" class="LineNr">2697 </span> <span class="subxComment"># check-ints-equal(EBX, -0x34, msg)</span> +<span id="L2698" class="LineNr">2698 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2699" class="LineNr">2699 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L2587'>test-parse-effective-address-base-index-scale</a>/displacement"</span>/imm32 +<span id="L2700" class="LineNr">2700 </span> 68/push -0x34/imm32 +<span id="L2701" class="LineNr">2701 </span> 53/push-EBX +<span id="L2702" class="LineNr">2702 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2703" class="LineNr">2703 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L2704" class="LineNr">2704 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2705" class="LineNr">2705 </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="L2706" class="LineNr">2706 </span> <span class="subxS1Comment"># . epilog</span> +<span id="L2707" class="LineNr">2707 </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="L2708" class="LineNr">2708 </span> 5d/pop-to-EBP +<span id="L2709" class="LineNr">2709 </span> c3/return +<span id="L2710" class="LineNr">2710 </span> +<span id="L2711" class="LineNr">2711 </span><span class="subxComment"># Code generation:</span> +<span id="L2712" class="LineNr">2712 </span><span class="subxComment"># if index is none and disp is 0, then mod = 0 and rm32 = base</span> +<span id="L2713" class="LineNr">2713 </span><span class="subxComment"># if index is none, then mod = 2 and rm32 = base and disp32 = disp</span> +<span id="L2714" class="LineNr">2714 </span><span class="subxComment"># if index is not none, then mod = 2 and rm32 = 4 and base = base and index = index and disp32 = disp</span> +<span id="L2715" class="LineNr">2715 </span><span class="subxFunction">emit-indirect-mode</span>: <span class="subxComment"># out : (address buffered-file), base : int, index : int, scale : int, disp : int</span> +<span id="L2716" class="LineNr">2716 </span> <span class="subxS1Comment"># . prolog</span> +<span id="L2717" class="LineNr">2717 </span> 55/push-EBP +<span id="L2718" class="LineNr">2718 </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="L2719" class="LineNr">2719 </span><span class="Constant">$emit-indirect-mode:check-for-sib</span>: +<span id="L2720" class="LineNr">2720 </span> <span class="subxComment"># if (index == 4/none) goto next check</span> +<span id="L2721" class="LineNr">2721 </span> 81 7/subop/compare 1/mod/*+disp8 5/rm32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x10/disp8 4/imm32 <span class="subxComment"># compare *(EBP+16)</span> +<span id="L2722" class="LineNr">2722 </span> 0f 84/jump-if-equal $emit-indirect-mode:check-for-disp/disp32 +<span id="L2723" class="LineNr">2723 </span><span class="Constant">$emit-indirect-mode:emit-sib</span>: +<span id="L2724" class="LineNr">2724 </span> <span class="subxComment"># emit(out, "2/mod/indirect 4/rm32/sib " base "/base " index "/index " scale "/scale " disp "/disp32")</span> +<span id="L2725" class="LineNr">2725 </span> <span class="subxS1Comment"># . write-buffered(out, "2/mod/*+disp32 4/rm32/sib ")</span> +<span id="L2726" class="LineNr">2726 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2727" class="LineNr">2727 </span> 68/push <span class="Constant">"2/mod/*+disp32 4/rm32/sib "</span>/imm32 +<span id="L2728" class="LineNr">2728 </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="L2729" class="LineNr">2729 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2730" class="LineNr">2730 </span> e8/call <a href='../065write-buffered.subx.html#L8'>write-buffered</a>/disp32 +<span id="L2731" class="LineNr">2731 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2732" class="LineNr">2732 </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="L2733" class="LineNr">2733 </span> <span class="subxS1Comment"># . print-int32-buffered(out, base)</span> +<span id="L2734" class="LineNr">2734 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2735" class="LineNr">2735 </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> 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(EBP+12)</span> +<span id="L2736" class="LineNr">2736 </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="L2737" class="LineNr">2737 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2738" class="LineNr">2738 </span> e8/call <a href='../066print-int.subx.html#L267'>print-int32-buffered</a>/disp32 +<span id="L2739" class="LineNr">2739 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2740" class="LineNr">2740 </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="L2741" class="LineNr">2741 </span> <span class="subxS1Comment"># . write-buffered(out, "/base ")</span> +<span id="L2742" class="LineNr">2742 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2743" class="LineNr">2743 </span> 68/push <span class="Constant">"/base "</span>/imm32 +<span id="L2744" class="LineNr">2744 </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="L2745" class="LineNr">2745 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2746" class="LineNr">2746 </span> e8/call <a href='../065write-buffered.subx.html#L8'>write-buffered</a>/disp32 +<span id="L2747" class="LineNr">2747 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2748" class="LineNr">2748 </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="L2749" class="LineNr">2749 </span> <span class="subxS1Comment"># . print-int32-buffered(out, index)</span> +<span id="L2750" class="LineNr">2750 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2751" class="LineNr">2751 </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="L2752" class="LineNr">2752 </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="L2753" class="LineNr">2753 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2754" class="LineNr">2754 </span> e8/call <a href='../066print-int.subx.html#L267'>print-int32-buffered</a>/disp32 +<span id="L2755" class="LineNr">2755 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2756" class="LineNr">2756 </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="L2757" class="LineNr">2757 </span> <span class="subxS1Comment"># . write-buffered(out, "/index ")</span> +<span id="L2758" class="LineNr">2758 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2759" class="LineNr">2759 </span> 68/push <span class="Constant">"/index "</span>/imm32 +<span id="L2760" class="LineNr">2760 </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="L2761" class="LineNr">2761 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2762" class="LineNr">2762 </span> e8/call <a href='../065write-buffered.subx.html#L8'>write-buffered</a>/disp32 +<span id="L2763" class="LineNr">2763 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2764" class="LineNr">2764 </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="L2765" class="LineNr">2765 </span> <span class="subxS1Comment"># . print-int32-buffered(out, scale)</span> +<span id="L2766" class="LineNr">2766 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2767" class="LineNr">2767 </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> 0x14/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(EBP+20)</span> +<span id="L2768" class="LineNr">2768 </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="L2769" class="LineNr">2769 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2770" class="LineNr">2770 </span> e8/call <a href='../066print-int.subx.html#L267'>print-int32-buffered</a>/disp32 +<span id="L2771" class="LineNr">2771 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2772" class="LineNr">2772 </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="L2773" class="LineNr">2773 </span> <span class="subxS1Comment"># . write-buffered(out, "/scale ")</span> +<span id="L2774" class="LineNr">2774 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2775" class="LineNr">2775 </span> 68/push <span class="Constant">"/scale "</span>/imm32 +<span id="L2776" class="LineNr">2776 </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="L2777" class="LineNr">2777 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2778" class="LineNr">2778 </span> e8/call <a href='../065write-buffered.subx.html#L8'>write-buffered</a>/disp32 +<span id="L2779" class="LineNr">2779 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2780" class="LineNr">2780 </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="L2781" class="LineNr">2781 </span> <span class="subxS1Comment"># . print-int32-buffered(out, disp)</span> +<span id="L2782" class="LineNr">2782 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2783" class="LineNr">2783 </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> 0x18/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(EBP+24)</span> +<span id="L2784" class="LineNr">2784 </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="L2785" class="LineNr">2785 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2786" class="LineNr">2786 </span> e8/call <a href='../066print-int.subx.html#L267'>print-int32-buffered</a>/disp32 +<span id="L2787" class="LineNr">2787 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2788" class="LineNr">2788 </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="L2789" class="LineNr">2789 </span> <span class="subxS1Comment"># . write-buffered(out, "/disp32")</span> <span id="L2790" class="LineNr">2790 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2791" class="LineNr">2791 </span> 68/push <a href='../064write-byte.subx.html#L290'>_test-output-stream</a>/imm32 -<span id="L2792" class="LineNr">2792 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2793" class="LineNr">2793 </span> e8/call <a href='../055stream.subx.html#L17'>clear-stream</a>/disp32 -<span id="L2794" class="LineNr">2794 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2795" class="LineNr">2795 </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="L2796" class="LineNr">2796 </span> <span class="subxS1Comment"># . clear-stream(_test-output-buffered-file+4)</span> -<span id="L2797" class="LineNr">2797 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2798" class="LineNr">2798 </span> b8/copy-to-EAX <a href='../064write-byte.subx.html#L332'>_test-output-buffered-file</a>/imm32 -<span id="L2799" class="LineNr">2799 </span> 05/add-to-EAX 4/imm32 -<span id="L2800" class="LineNr">2800 </span> 50/push-EAX -<span id="L2801" class="LineNr">2801 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2802" class="LineNr">2802 </span> e8/call <a href='../055stream.subx.html#L17'>clear-stream</a>/disp32 -<span id="L2803" class="LineNr">2803 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2804" class="LineNr">2804 </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="L2805" class="LineNr">2805 </span> <span class="subxComment"># emit-indirect-mode(_test-output-buffered-file, 6, 4/none, 0, 0)</span> -<span id="L2806" class="LineNr">2806 </span> <span class="subxS2Comment"># . . write args</span> -<span id="L2807" class="LineNr">2807 </span> 68/push 0/imm32/.disp -<span id="L2808" class="LineNr">2808 </span> 68/push 0/imm32/.scale -<span id="L2809" class="LineNr">2809 </span> 68/push 4/imm32/.index/none -<span id="L2810" class="LineNr">2810 </span> 68/push 7/imm32/.base -<span id="L2811" class="LineNr">2811 </span> 68/push <a href='../064write-byte.subx.html#L332'>_test-output-buffered-file</a>/imm32 -<span id="L2812" class="LineNr">2812 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2813" class="LineNr">2813 </span> e8/call <a href='desugar.subx.html#L2543'>emit-indirect-mode</a>/disp32 -<span id="L2814" class="LineNr">2814 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2815" class="LineNr">2815 </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> 0x14/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2816" class="LineNr">2816 </span> <span class="subxS1Comment"># . flush(_test-output-buffered-file)</span> -<span id="L2817" class="LineNr">2817 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2818" class="LineNr">2818 </span> 68/push <a href='../064write-byte.subx.html#L332'>_test-output-buffered-file</a>/imm32 -<span id="L2819" class="LineNr">2819 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2820" class="LineNr">2820 </span> e8/call <a href='../064write-byte.subx.html#L79'>flush</a>/disp32 -<span id="L2821" class="LineNr">2821 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2822" class="LineNr">2822 </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="L2823" class="Folded">2823 </span><span class="Folded">+-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------</span> -<span id="L2849" class="LineNr">2849 </span> <span class="subxComment"># check-stream-equal(_test-output-stream, "0/mod/indirect 7/rm32", msg)</span> -<span id="L2850" class="LineNr">2850 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2851" class="LineNr">2851 </span> 68/push <span class="Constant">"F - test-emit-indirect-mode-2"</span>/imm32 -<span id="L2852" class="LineNr">2852 </span> 68/push <span class="Constant">"0/mod/indirect 0x00000007/rm32"</span>/imm32 -<span id="L2853" class="LineNr">2853 </span> 68/push <a href='../064write-byte.subx.html#L290'>_test-output-stream</a>/imm32 -<span id="L2854" class="LineNr">2854 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2855" class="LineNr">2855 </span> e8/call <a href='../058stream-equal.subx.html#L193'>check-stream-equal</a>/disp32 -<span id="L2856" class="LineNr">2856 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2857" class="LineNr">2857 </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="L2858" class="LineNr">2858 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L2859" class="LineNr">2859 </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="L2860" class="LineNr">2860 </span> 5d/pop-to-EBP -<span id="L2861" class="LineNr">2861 </span> c3/return -<span id="L2862" class="LineNr">2862 </span> -<span id="L2863" class="LineNr">2863 </span><span class="subxTest">test-emit-indirect-mode-with-disp</span>: -<span id="L2864" class="LineNr">2864 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L2865" class="LineNr">2865 </span> 55/push-EBP -<span id="L2866" class="LineNr">2866 </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="L2867" class="LineNr">2867 </span> <span class="subxComment"># setup</span> -<span id="L2868" class="LineNr">2868 </span> <span class="subxS1Comment"># . clear-stream(_test-output-stream)</span> -<span id="L2869" class="LineNr">2869 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2870" class="LineNr">2870 </span> 68/push <a href='../064write-byte.subx.html#L290'>_test-output-stream</a>/imm32 -<span id="L2871" class="LineNr">2871 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2872" class="LineNr">2872 </span> e8/call <a href='../055stream.subx.html#L17'>clear-stream</a>/disp32 -<span id="L2873" class="LineNr">2873 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2874" class="LineNr">2874 </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="L2875" class="LineNr">2875 </span> <span class="subxS1Comment"># . clear-stream(_test-output-buffered-file+4)</span> -<span id="L2876" class="LineNr">2876 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2877" class="LineNr">2877 </span> b8/copy-to-EAX <a href='../064write-byte.subx.html#L332'>_test-output-buffered-file</a>/imm32 -<span id="L2878" class="LineNr">2878 </span> 05/add-to-EAX 4/imm32 -<span id="L2879" class="LineNr">2879 </span> 50/push-EAX -<span id="L2880" class="LineNr">2880 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2881" class="LineNr">2881 </span> e8/call <a href='../055stream.subx.html#L17'>clear-stream</a>/disp32 -<span id="L2882" class="LineNr">2882 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2883" class="LineNr">2883 </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="L2884" class="LineNr">2884 </span> <span class="subxComment"># emit-indirect-mode(_test-output-buffered-file, 6, 4/none, 0, 4)</span> -<span id="L2885" class="LineNr">2885 </span> <span class="subxS2Comment"># . . write args</span> -<span id="L2886" class="LineNr">2886 </span> 68/push 4/imm32/.disp -<span id="L2887" class="LineNr">2887 </span> 68/push 0/imm32/.scale -<span id="L2888" class="LineNr">2888 </span> 68/push 4/imm32/.index/none -<span id="L2889" class="LineNr">2889 </span> 68/push 6/imm32/.base -<span id="L2890" class="LineNr">2890 </span> 68/push <a href='../064write-byte.subx.html#L332'>_test-output-buffered-file</a>/imm32 -<span id="L2891" class="LineNr">2891 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2892" class="LineNr">2892 </span> e8/call <a href='desugar.subx.html#L2543'>emit-indirect-mode</a>/disp32 -<span id="L2893" class="LineNr">2893 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2894" class="LineNr">2894 </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> 0x14/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2895" class="LineNr">2895 </span> <span class="subxS1Comment"># . flush(_test-output-buffered-file)</span> -<span id="L2896" class="LineNr">2896 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2897" class="LineNr">2897 </span> 68/push <a href='../064write-byte.subx.html#L332'>_test-output-buffered-file</a>/imm32 -<span id="L2898" class="LineNr">2898 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2899" class="LineNr">2899 </span> e8/call <a href='../064write-byte.subx.html#L79'>flush</a>/disp32 -<span id="L2900" class="LineNr">2900 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2901" class="LineNr">2901 </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="L2902" class="Folded">2902 </span><span class="Folded">+-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------</span> -<span id="L2928" class="LineNr">2928 </span> <span class="subxComment"># check-stream-equal(_test-output-stream, "2/mod/*+disp32 6/rm32 4/disp32", msg)</span> -<span id="L2929" class="LineNr">2929 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2930" class="LineNr">2930 </span> 68/push <span class="Constant">"F - test-emit-indirect-mode-with-disp"</span>/imm32 -<span id="L2931" class="LineNr">2931 </span> 68/push <span class="Constant">"2/mod/*+disp32 0x00000006/rm32 0x00000004/disp32"</span>/imm32 -<span id="L2932" class="LineNr">2932 </span> 68/push <a href='../064write-byte.subx.html#L290'>_test-output-stream</a>/imm32 -<span id="L2933" class="LineNr">2933 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2934" class="LineNr">2934 </span> e8/call <a href='../058stream-equal.subx.html#L193'>check-stream-equal</a>/disp32 -<span id="L2935" class="LineNr">2935 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2936" class="LineNr">2936 </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="L2937" class="LineNr">2937 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L2938" class="LineNr">2938 </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="L2939" class="LineNr">2939 </span> 5d/pop-to-EBP -<span id="L2940" class="LineNr">2940 </span> c3/return -<span id="L2941" class="LineNr">2941 </span> -<span id="L2942" class="LineNr">2942 </span><span class="subxTest">test-emit-indirect-mode-with-disp-negative</span>: -<span id="L2943" class="LineNr">2943 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L2944" class="LineNr">2944 </span> 55/push-EBP -<span id="L2945" class="LineNr">2945 </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="L2946" class="LineNr">2946 </span> <span class="subxComment"># setup</span> -<span id="L2947" class="LineNr">2947 </span> <span class="subxS1Comment"># . clear-stream(_test-output-stream)</span> -<span id="L2948" class="LineNr">2948 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2949" class="LineNr">2949 </span> 68/push <a href='../064write-byte.subx.html#L290'>_test-output-stream</a>/imm32 -<span id="L2950" class="LineNr">2950 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2951" class="LineNr">2951 </span> e8/call <a href='../055stream.subx.html#L17'>clear-stream</a>/disp32 -<span id="L2952" class="LineNr">2952 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2953" class="LineNr">2953 </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="L2954" class="LineNr">2954 </span> <span class="subxS1Comment"># . clear-stream(_test-output-buffered-file+4)</span> -<span id="L2955" class="LineNr">2955 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2956" class="LineNr">2956 </span> b8/copy-to-EAX <a href='../064write-byte.subx.html#L332'>_test-output-buffered-file</a>/imm32 -<span id="L2957" class="LineNr">2957 </span> 05/add-to-EAX 4/imm32 -<span id="L2958" class="LineNr">2958 </span> 50/push-EAX -<span id="L2959" class="LineNr">2959 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2960" class="LineNr">2960 </span> e8/call <a href='../055stream.subx.html#L17'>clear-stream</a>/disp32 -<span id="L2961" class="LineNr">2961 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2962" class="LineNr">2962 </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="L2963" class="LineNr">2963 </span> <span class="subxComment"># emit-indirect-mode(_test-output-buffered-file, 6, 4/none, 0, -4)</span> -<span id="L2964" class="LineNr">2964 </span> <span class="subxS2Comment"># . . write args</span> -<span id="L2965" class="LineNr">2965 </span> 68/push -4/imm32/.disp -<span id="L2966" class="LineNr">2966 </span> 68/push 0/imm32/.scale -<span id="L2967" class="LineNr">2967 </span> 68/push 4/imm32/.index/none -<span id="L2968" class="LineNr">2968 </span> 68/push 6/imm32/.base -<span id="L2969" class="LineNr">2969 </span> 68/push <a href='../064write-byte.subx.html#L332'>_test-output-buffered-file</a>/imm32 -<span id="L2970" class="LineNr">2970 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2971" class="LineNr">2971 </span> e8/call <a href='desugar.subx.html#L2543'>emit-indirect-mode</a>/disp32 -<span id="L2972" class="LineNr">2972 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2973" class="LineNr">2973 </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> 0x14/imm32 <span class="subxComment"># add to ESP</span> -<span id="L2974" class="LineNr">2974 </span> <span class="subxS1Comment"># . flush(_test-output-buffered-file)</span> -<span id="L2975" class="LineNr">2975 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L2976" class="LineNr">2976 </span> 68/push <a href='../064write-byte.subx.html#L332'>_test-output-buffered-file</a>/imm32 -<span id="L2977" class="LineNr">2977 </span> <span class="subxS2Comment"># . . call</span> -<span id="L2978" class="LineNr">2978 </span> e8/call <a href='../064write-byte.subx.html#L79'>flush</a>/disp32 -<span id="L2979" class="LineNr">2979 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L2980" class="LineNr">2980 </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="L2981" class="Folded">2981 </span><span class="Folded">+-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------</span> -<span id="L3007" class="LineNr">3007 </span> <span class="subxComment"># check-stream-equal(_test-output-stream, "2/mod/*+disp32 6/rm32 -4/disp32", msg)</span> -<span id="L3008" class="LineNr">3008 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3009" class="LineNr">3009 </span> 68/push <span class="Constant">"F - test-emit-indirect-mode-with-disp"</span>/imm32 -<span id="L3010" class="LineNr">3010 </span> 68/push <span class="Constant">"2/mod/*+disp32 0x00000006/rm32 0xfffffffc/disp32"</span>/imm32 -<span id="L3011" class="LineNr">3011 </span> 68/push <a href='../064write-byte.subx.html#L290'>_test-output-stream</a>/imm32 -<span id="L3012" class="LineNr">3012 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3013" class="LineNr">3013 </span> e8/call <a href='../058stream-equal.subx.html#L193'>check-stream-equal</a>/disp32 -<span id="L3014" class="LineNr">3014 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3015" class="LineNr">3015 </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="L3016" class="LineNr">3016 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L3017" class="LineNr">3017 </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="L3018" class="LineNr">3018 </span> 5d/pop-to-EBP -<span id="L3019" class="LineNr">3019 </span> c3/return -<span id="L3020" class="LineNr">3020 </span> -<span id="L3021" class="LineNr">3021 </span><span class="subxTest">test-emit-indirect-mode-with-sib</span>: -<span id="L3022" class="LineNr">3022 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L3023" class="LineNr">3023 </span> 55/push-EBP -<span id="L3024" class="LineNr">3024 </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="L3025" class="LineNr">3025 </span> <span class="subxComment"># setup</span> -<span id="L3026" class="LineNr">3026 </span> <span class="subxS1Comment"># . clear-stream(_test-output-stream)</span> -<span id="L3027" class="LineNr">3027 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3028" class="LineNr">3028 </span> 68/push <a href='../064write-byte.subx.html#L290'>_test-output-stream</a>/imm32 -<span id="L3029" class="LineNr">3029 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3030" class="LineNr">3030 </span> e8/call <a href='../055stream.subx.html#L17'>clear-stream</a>/disp32 -<span id="L3031" class="LineNr">3031 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3032" class="LineNr">3032 </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="L3033" class="LineNr">3033 </span> <span class="subxS1Comment"># . clear-stream(_test-output-buffered-file+4)</span> -<span id="L3034" class="LineNr">3034 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3035" class="LineNr">3035 </span> b8/copy-to-EAX <a href='../064write-byte.subx.html#L332'>_test-output-buffered-file</a>/imm32 -<span id="L3036" class="LineNr">3036 </span> 05/add-to-EAX 4/imm32 -<span id="L3037" class="LineNr">3037 </span> 50/push-EAX -<span id="L3038" class="LineNr">3038 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3039" class="LineNr">3039 </span> e8/call <a href='../055stream.subx.html#L17'>clear-stream</a>/disp32 -<span id="L3040" class="LineNr">3040 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3041" class="LineNr">3041 </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="L3042" class="LineNr">3042 </span> <span class="subxComment"># emit-indirect-mode(_test-output-buffered-file, 6/base, 1/index, 2/scale, 4/disp)</span> -<span id="L3043" class="LineNr">3043 </span> <span class="subxS2Comment"># . . write args</span> -<span id="L3044" class="LineNr">3044 </span> 68/push 4/imm32/.disp -<span id="L3045" class="LineNr">3045 </span> 68/push 2/imm32/.scale -<span id="L3046" class="LineNr">3046 </span> 68/push 1/imm32/.index -<span id="L3047" class="LineNr">3047 </span> 68/push 6/imm32/.base -<span id="L3048" class="LineNr">3048 </span> 68/push <a href='../064write-byte.subx.html#L332'>_test-output-buffered-file</a>/imm32 -<span id="L3049" class="LineNr">3049 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3050" class="LineNr">3050 </span> e8/call <a href='desugar.subx.html#L2543'>emit-indirect-mode</a>/disp32 -<span id="L3051" class="LineNr">3051 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3052" class="LineNr">3052 </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> 0x14/imm32 <span class="subxComment"># add to ESP</span> -<span id="L3053" class="LineNr">3053 </span> <span class="subxS1Comment"># . flush(_test-output-buffered-file)</span> -<span id="L3054" class="LineNr">3054 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3055" class="LineNr">3055 </span> 68/push <a href='../064write-byte.subx.html#L332'>_test-output-buffered-file</a>/imm32 -<span id="L3056" class="LineNr">3056 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3057" class="LineNr">3057 </span> e8/call <a href='../064write-byte.subx.html#L79'>flush</a>/disp32 -<span id="L3058" class="LineNr">3058 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3059" class="LineNr">3059 </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="L3060" class="Folded">3060 </span><span class="Folded">+-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------</span> -<span id="L3086" class="LineNr">3086 </span> <span class="subxComment"># check-stream-equal(_test-output-stream, "2/mod/indirect 4/rm32/sib 6/base 1/index 2/scale 4/disp", msg)</span> -<span id="L3087" class="LineNr">3087 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3088" class="LineNr">3088 </span> 68/push <span class="Constant">"F - test-emit-indirect-mode-with-sib"</span>/imm32 -<span id="L3089" class="LineNr">3089 </span> 68/push <span class="Constant">"2/mod/*+disp32 4/rm32/sib 0x00000006/base 0x00000001/index 0x00000002/scale 0x00000004/disp32"</span>/imm32 -<span id="L3090" class="LineNr">3090 </span> 68/push <a href='../064write-byte.subx.html#L290'>_test-output-stream</a>/imm32 -<span id="L3091" class="LineNr">3091 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3092" class="LineNr">3092 </span> e8/call <a href='../058stream-equal.subx.html#L193'>check-stream-equal</a>/disp32 -<span id="L3093" class="LineNr">3093 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3094" class="LineNr">3094 </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="L3095" class="LineNr">3095 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L3096" class="LineNr">3096 </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="L3097" class="LineNr">3097 </span> 5d/pop-to-EBP -<span id="L3098" class="LineNr">3098 </span> c3/return -<span id="L3099" class="LineNr">3099 </span> -<span id="L3100" class="LineNr">3100 </span><span class="subxComment"># update line->read to ')'</span> -<span id="L3101" class="LineNr">3101 </span><span class="subxComment"># line->read ends at ')'</span> -<span id="L3102" class="LineNr">3102 </span><span class="subxFunction">skip-until-close-paren</span>: <span class="subxComment"># line : (address stream)</span> -<span id="L3103" class="LineNr">3103 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L3104" class="LineNr">3104 </span> 55/push-EBP -<span id="L3105" class="LineNr">3105 </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="L3106" class="LineNr">3106 </span> <span class="subxS1Comment"># . save registers</span> -<span id="L3107" class="LineNr">3107 </span> 50/push-EAX -<span id="L3108" class="LineNr">3108 </span> 51/push-ECX -<span id="L3109" class="LineNr">3109 </span> 52/push-EDX -<span id="L3110" class="LineNr">3110 </span> <span class="subxComment"># ECX = line</span> -<span id="L3111" class="LineNr">3111 </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="L3112" class="LineNr">3112 </span> <span class="subxComment"># EAX = skip-until-close-paren-in-slice(&line->data[line->read], &line->data[line->write])</span> -<span id="L3113" class="LineNr">3113 </span> <span class="subxS2Comment"># . . push &line->data[line->write]</span> -<span id="L3114" class="LineNr">3114 </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="L3115" class="LineNr">3115 </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="L3116" class="LineNr">3116 </span> 52/push-EDX -<span id="L3117" class="LineNr">3117 </span> <span class="subxS2Comment"># . . push &line->data[line->read]</span> -<span id="L3118" class="LineNr">3118 </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="L3119" class="LineNr">3119 </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="L3120" class="LineNr">3120 </span> 52/push-EDX -<span id="L3121" class="LineNr">3121 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3122" class="LineNr">3122 </span> e8/call <a href='desugar.subx.html#L3288'>skip-until-close-paren-in-slice</a>/disp32 -<span id="L3123" class="LineNr">3123 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3124" class="LineNr">3124 </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="L3125" class="LineNr">3125 </span> <span class="subxComment"># line->read = EAX - line->data</span> -<span id="L3126" class="LineNr">3126 </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="L3127" class="LineNr">3127 </span> 2d/subtract-from-EAX 0xc/imm32 -<span id="L3128" class="LineNr">3128 </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="L3129" class="LineNr">3129 </span><span class="Constant">$skip-until-close-paren:end</span>: -<span id="L3130" class="LineNr">3130 </span> <span class="subxS1Comment"># . restore registers</span> -<span id="L3131" class="LineNr">3131 </span> 5a/pop-to-EDX -<span id="L3132" class="LineNr">3132 </span> 59/pop-to-ECX -<span id="L3133" class="LineNr">3133 </span> 58/pop-to-EAX -<span id="L3134" class="LineNr">3134 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L3135" class="LineNr">3135 </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="L3136" class="LineNr">3136 </span> 5d/pop-to-EBP -<span id="L3137" class="LineNr">3137 </span> c3/return -<span id="L3138" class="LineNr">3138 </span> -<span id="L3139" class="LineNr">3139 </span><span class="subxTest">test-skip-until-close-paren</span>: -<span id="L3140" class="LineNr">3140 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L3141" class="LineNr">3141 </span> 55/push-EBP -<span id="L3142" class="LineNr">3142 </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="L3143" class="LineNr">3143 </span> <span class="subxComment"># setup</span> -<span id="L3144" class="LineNr">3144 </span> <span class="subxS1Comment"># . clear-stream(_test-input-stream)</span> -<span id="L3145" class="LineNr">3145 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3146" class="LineNr">3146 </span> 68/push <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 -<span id="L3147" class="LineNr">3147 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3148" class="LineNr">3148 </span> e8/call <a href='../055stream.subx.html#L17'>clear-stream</a>/disp32 -<span id="L3149" class="LineNr">3149 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3150" class="LineNr">3150 </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="L3151" class="LineNr">3151 </span> <span class="subxS1Comment"># . write(_test-input-stream, "*(abc) def")</span> -<span id="L3152" class="LineNr">3152 </span> <span class="subxS1Comment"># . indices: 0123 45</span> -<span id="L3153" class="LineNr">3153 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3154" class="LineNr">3154 </span> 68/push <span class="Constant">"*(abc) def"</span>/imm32 -<span id="L3155" class="LineNr">3155 </span> 68/push <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 -<span id="L3156" class="LineNr">3156 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3157" class="LineNr">3157 </span> e8/call <a href='../057write.subx.html#L24'>write</a>/disp32 -<span id="L3158" class="LineNr">3158 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3159" class="LineNr">3159 </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="L3160" class="LineNr">3160 </span> <span class="subxComment"># precondition: line->read == 0</span> -<span id="L3161" class="LineNr">3161 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3162" class="LineNr">3162 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L3139'>test-skip-until-close-paren</a>/precondition"</span>/imm32 -<span id="L3163" class="LineNr">3163 </span> 68/push 0/imm32 -<span id="L3164" class="LineNr">3164 </span> b8/copy-to-EAX <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 -<span id="L3165" class="LineNr">3165 </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="L3166" class="LineNr">3166 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3167" class="LineNr">3167 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L3168" class="LineNr">3168 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3169" class="LineNr">3169 </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="L3170" class="LineNr">3170 </span> <span class="subxComment"># skip-until-close-paren(_test-input-stream)</span> -<span id="L3171" class="LineNr">3171 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3172" class="LineNr">3172 </span> 68/push <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 -<span id="L3173" class="LineNr">3173 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3174" class="LineNr">3174 </span> e8/call <a href='desugar.subx.html#L3102'>skip-until-close-paren</a>/disp32 -<span id="L3175" class="LineNr">3175 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3176" class="LineNr">3176 </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="L3177" class="LineNr">3177 </span> <span class="subxComment"># check-ints-equal(line->read, 5, msg)</span> -<span id="L3178" class="LineNr">3178 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3179" class="LineNr">3179 </span> 68/push <span class="Constant">"F - test-skip-until-close-paren"</span>/imm32 -<span id="L3180" class="LineNr">3180 </span> 68/push 5/imm32 -<span id="L3181" class="LineNr">3181 </span> b8/copy-to-EAX <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 -<span id="L3182" class="LineNr">3182 </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="L3183" class="LineNr">3183 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3184" class="LineNr">3184 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L3185" class="LineNr">3185 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3186" class="LineNr">3186 </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="L3187" class="LineNr">3187 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L3188" class="LineNr">3188 </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="L3189" class="LineNr">3189 </span> 5d/pop-to-EBP -<span id="L3190" class="LineNr">3190 </span> c3/return -<span id="L3191" class="LineNr">3191 </span> -<span id="L3192" class="LineNr">3192 </span><span class="subxTest">test-skip-until-close-paren-ignores-spaces</span>: -<span id="L3193" class="LineNr">3193 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L3194" class="LineNr">3194 </span> 55/push-EBP -<span id="L3195" class="LineNr">3195 </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="L3196" class="LineNr">3196 </span> <span class="subxComment"># setup</span> -<span id="L3197" class="LineNr">3197 </span> <span class="subxS1Comment"># . clear-stream(_test-input-stream)</span> -<span id="L3198" class="LineNr">3198 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3199" class="LineNr">3199 </span> 68/push <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 -<span id="L3200" class="LineNr">3200 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3201" class="LineNr">3201 </span> e8/call <a href='../055stream.subx.html#L17'>clear-stream</a>/disp32 -<span id="L3202" class="LineNr">3202 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3203" class="LineNr">3203 </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="L3204" class="LineNr">3204 </span> <span class="subxS1Comment"># . write(_test-input-stream, "*(a b)/yz")</span> -<span id="L3205" class="LineNr">3205 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3206" class="LineNr">3206 </span> 68/push <span class="Constant">"*(a b)/yz"</span>/imm32 -<span id="L3207" class="LineNr">3207 </span> 68/push <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 -<span id="L3208" class="LineNr">3208 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3209" class="LineNr">3209 </span> e8/call <a href='../057write.subx.html#L24'>write</a>/disp32 -<span id="L3210" class="LineNr">3210 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3211" class="LineNr">3211 </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="L3212" class="LineNr">3212 </span> <span class="subxComment"># precondition: line->read == 0</span> -<span id="L3213" class="LineNr">3213 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3214" class="LineNr">3214 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L3192'>test-skip-until-close-paren-ignores-spaces</a>/precondition"</span>/imm32 -<span id="L3215" class="LineNr">3215 </span> 68/push 0/imm32 -<span id="L3216" class="LineNr">3216 </span> b8/copy-to-EAX <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 -<span id="L3217" class="LineNr">3217 </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="L3218" class="LineNr">3218 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3219" class="LineNr">3219 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L3220" class="LineNr">3220 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3221" class="LineNr">3221 </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="L3222" class="LineNr">3222 </span> <span class="subxComment"># skip-until-close-paren(_test-input-stream)</span> -<span id="L3223" class="LineNr">3223 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3224" class="LineNr">3224 </span> 68/push <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 -<span id="L3225" class="LineNr">3225 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3226" class="LineNr">3226 </span> e8/call <a href='desugar.subx.html#L3102'>skip-until-close-paren</a>/disp32 -<span id="L3227" class="LineNr">3227 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3228" class="LineNr">3228 </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="L3229" class="LineNr">3229 </span> <span class="subxComment"># check-ints-equal(line->read, 5, msg)</span> -<span id="L3230" class="LineNr">3230 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3231" class="LineNr">3231 </span> 68/push <span class="Constant">"F - test-skip-until-close-paren-ignores-spaces"</span>/imm32 -<span id="L3232" class="LineNr">3232 </span> 68/push 5/imm32 -<span id="L3233" class="LineNr">3233 </span> b8/copy-to-EAX <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 -<span id="L3234" class="LineNr">3234 </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="L3235" class="LineNr">3235 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3236" class="LineNr">3236 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L3237" class="LineNr">3237 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3238" class="LineNr">3238 </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="L3239" class="LineNr">3239 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L3240" class="LineNr">3240 </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="L3241" class="LineNr">3241 </span> 5d/pop-to-EBP -<span id="L3242" class="LineNr">3242 </span> c3/return -<span id="L3243" class="LineNr">3243 </span> -<span id="L3244" class="LineNr">3244 </span><span class="subxTest">test-skip-until-close-paren-works-from-mid-stream</span>: -<span id="L3245" class="LineNr">3245 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L3246" class="LineNr">3246 </span> 55/push-EBP -<span id="L3247" class="LineNr">3247 </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="L3248" class="LineNr">3248 </span> <span class="subxComment"># setup</span> -<span id="L3249" class="LineNr">3249 </span> <span class="subxS1Comment"># . clear-stream(_test-input-stream)</span> -<span id="L3250" class="LineNr">3250 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3251" class="LineNr">3251 </span> 68/push <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 -<span id="L3252" class="LineNr">3252 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3253" class="LineNr">3253 </span> e8/call <a href='../055stream.subx.html#L17'>clear-stream</a>/disp32 -<span id="L3254" class="LineNr">3254 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3255" class="LineNr">3255 </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="L3256" class="LineNr">3256 </span> <span class="subxS1Comment"># . write(_test-input-stream, "0 *(a b)/yz")</span> -<span id="L3257" class="LineNr">3257 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3258" class="LineNr">3258 </span> 68/push <span class="Constant">"0 *(a b)/yz"</span>/imm32 -<span id="L3259" class="LineNr">3259 </span> 68/push <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 -<span id="L3260" class="LineNr">3260 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3261" class="LineNr">3261 </span> e8/call <a href='../057write.subx.html#L24'>write</a>/disp32 -<span id="L3262" class="LineNr">3262 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3263" class="LineNr">3263 </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="L3264" class="LineNr">3264 </span> <span class="subxComment"># precondition: _test-input-stream->read == 2</span> -<span id="L3265" class="LineNr">3265 </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="L3266" class="LineNr">3266 </span> <span class="subxComment"># skip-until-close-paren(_test-input-stream)</span> -<span id="L3267" class="LineNr">3267 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3268" class="LineNr">3268 </span> 68/push <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 -<span id="L3269" class="LineNr">3269 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3270" class="LineNr">3270 </span> e8/call <a href='desugar.subx.html#L3102'>skip-until-close-paren</a>/disp32 -<span id="L3271" class="LineNr">3271 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3272" class="LineNr">3272 </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="L3273" class="LineNr">3273 </span> <span class="subxComment"># check-ints-equal(_test-input-stream->read, 7, msg)</span> -<span id="L3274" class="LineNr">3274 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3275" class="LineNr">3275 </span> 68/push <span class="Constant">"F - test-skip-until-close-paren-works-from-mid-stream"</span>/imm32 -<span id="L3276" class="LineNr">3276 </span> 68/push 7/imm32 -<span id="L3277" class="LineNr">3277 </span> b8/copy-to-EAX <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 -<span id="L3278" class="LineNr">3278 </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="L3279" class="LineNr">3279 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3280" class="LineNr">3280 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L3281" class="LineNr">3281 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3282" class="LineNr">3282 </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="L3283" class="LineNr">3283 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L3284" class="LineNr">3284 </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="L3285" class="LineNr">3285 </span> 5d/pop-to-EBP -<span id="L3286" class="LineNr">3286 </span> c3/return -<span id="L3287" class="LineNr">3287 </span> -<span id="L3288" class="LineNr">3288 </span><span class="subxFunction">skip-until-close-paren-in-slice</span>: <span class="subxComment"># curr : (address byte), end : (address byte) -> new_curr/EAX</span> -<span id="L3289" class="LineNr">3289 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L3290" class="LineNr">3290 </span> 55/push-EBP -<span id="L3291" class="LineNr">3291 </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="L3292" class="LineNr">3292 </span> <span class="subxS1Comment"># . save registers</span> -<span id="L3293" class="LineNr">3293 </span> 51/push-ECX -<span id="L3294" class="LineNr">3294 </span> 52/push-EDX -<span id="L3295" class="LineNr">3295 </span> <span class="subxComment"># ECX = curr</span> -<span id="L3296" class="LineNr">3296 </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="L3297" class="LineNr">3297 </span> <span class="subxComment"># EDX = end</span> -<span id="L3298" class="LineNr">3298 </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="L3299" class="LineNr">3299 </span> <span class="subxComment"># EAX = 0</span> -<span id="L3300" class="LineNr">3300 </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="L3301" class="LineNr">3301 </span> <span class="subxComment"># skip initial dquote</span> -<span id="L3302" class="LineNr">3302 </span> 41/increment-ECX -<span id="L3303" class="LineNr">3303 </span><span class="Constant">$skip-until-close-paren-in-slice:loop</span>: -<span id="L3304" class="LineNr">3304 </span> <span class="subxComment"># if (curr >= end) break</span> -<span id="L3305" class="LineNr">3305 </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="L3306" class="LineNr">3306 </span> 73/jump-if-greater-unsigned-or-equal $skip-until-close-paren-in-slice:break/disp8 -<span id="L3307" class="LineNr">3307 </span> <span class="subxComment"># AL = *curr</span> -<span id="L3308" class="LineNr">3308 </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="L3309" class="LineNr">3309 </span><span class="Constant">$skip-until-close-paren-in-slice:check-close</span>: -<span id="L3310" class="LineNr">3310 </span> <span class="subxComment"># if (EAX == ')') break</span> -<span id="L3311" class="LineNr">3311 </span> 3d/compare-EAX-and 0x29/imm32/close-paren -<span id="L3312" class="LineNr">3312 </span> 74/jump-if-equal $skip-until-close-paren-in-slice:break/disp8 -<span id="L3313" class="LineNr">3313 </span> <span class="subxComment"># ++curr</span> -<span id="L3314" class="LineNr">3314 </span> 41/increment-ECX -<span id="L3315" class="LineNr">3315 </span> eb/jump $skip-until-close-paren-in-slice:loop/disp8 -<span id="L3316" class="LineNr">3316 </span><span class="Constant">$skip-until-close-paren-in-slice:break</span>: -<span id="L3317" class="LineNr">3317 </span> <span class="subxComment"># return curr</span> -<span id="L3318" class="LineNr">3318 </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="L3319" class="LineNr">3319 </span><span class="Constant">$skip-until-close-paren-in-slice:end</span>: -<span id="L3320" class="LineNr">3320 </span> <span class="subxS1Comment"># . restore registers</span> -<span id="L3321" class="LineNr">3321 </span> 5a/pop-to-EDX -<span id="L3322" class="LineNr">3322 </span> 59/pop-to-ECX -<span id="L3323" class="LineNr">3323 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L3324" class="LineNr">3324 </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="L3325" class="LineNr">3325 </span> 5d/pop-to-EBP -<span id="L3326" class="LineNr">3326 </span> c3/return -<span id="L3327" class="LineNr">3327 </span> -<span id="L3328" class="LineNr">3328 </span><span class="subxTest">test-skip-until-close-paren-in-slice</span>: -<span id="L3329" class="LineNr">3329 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L3330" class="LineNr">3330 </span> 55/push-EBP -<span id="L3331" class="LineNr">3331 </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="L3332" class="LineNr">3332 </span> <span class="subxComment"># setup: (EAX..ECX) = "*(abc) def"</span> -<span id="L3333" class="LineNr">3333 </span> b8/copy-to-EAX <span class="Constant">"*(abc) def"</span>/imm32 -<span id="L3334" class="LineNr">3334 </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="L3335" class="LineNr">3335 </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="L3336" class="LineNr">3336 </span> 05/add-to-EAX 4/imm32 -<span id="L3337" class="LineNr">3337 </span> <span class="subxComment"># EAX = skip-until-close-paren-in-slice(EAX, ECX)</span> -<span id="L3338" class="LineNr">3338 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3339" class="LineNr">3339 </span> 51/push-ECX -<span id="L3340" class="LineNr">3340 </span> 50/push-EAX -<span id="L3341" class="LineNr">3341 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3342" class="LineNr">3342 </span> e8/call <a href='desugar.subx.html#L3288'>skip-until-close-paren-in-slice</a>/disp32 -<span id="L3343" class="LineNr">3343 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3344" class="LineNr">3344 </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="L3345" class="LineNr">3345 </span> <span class="subxComment"># check-ints-equal(ECX-EAX, 5, msg) # EAX is at the ')'</span> -<span id="L3346" class="LineNr">3346 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3347" class="LineNr">3347 </span> 68/push <span class="Constant">"F - test-skip-until-close-paren-in-slice"</span>/imm32 -<span id="L3348" class="LineNr">3348 </span> 68/push 5/imm32 -<span id="L3349" class="LineNr">3349 </span> <span class="subxS2Comment"># . . push ECX-EAX</span> -<span id="L3350" class="LineNr">3350 </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="L3351" class="LineNr">3351 </span> 51/push-ECX -<span id="L3352" class="LineNr">3352 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3353" class="LineNr">3353 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L3354" class="LineNr">3354 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3355" class="LineNr">3355 </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="L3356" class="LineNr">3356 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L3357" class="LineNr">3357 </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="L3358" class="LineNr">3358 </span> 5d/pop-to-EBP -<span id="L3359" class="LineNr">3359 </span> c3/return -<span id="L3360" class="LineNr">3360 </span> -<span id="L3361" class="LineNr">3361 </span><span class="subxTest">test-skip-until-close-paren-in-slice-ignores-spaces</span>: -<span id="L3362" class="LineNr">3362 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L3363" class="LineNr">3363 </span> 55/push-EBP -<span id="L3364" class="LineNr">3364 </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="L3365" class="LineNr">3365 </span> <span class="subxComment"># setup: (EAX..ECX) = "*(a b)/yz"</span> -<span id="L3366" class="LineNr">3366 </span> b8/copy-to-EAX <span class="Constant">"*(a b)/yz"</span>/imm32 -<span id="L3367" class="LineNr">3367 </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="L3368" class="LineNr">3368 </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="L3369" class="LineNr">3369 </span> 05/add-to-EAX 4/imm32 -<span id="L3370" class="LineNr">3370 </span> <span class="subxComment"># EAX = skip-until-close-paren-in-slice(EAX, ECX)</span> -<span id="L3371" class="LineNr">3371 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3372" class="LineNr">3372 </span> 51/push-ECX -<span id="L3373" class="LineNr">3373 </span> 50/push-EAX -<span id="L3374" class="LineNr">3374 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3375" class="LineNr">3375 </span> e8/call <a href='desugar.subx.html#L3288'>skip-until-close-paren-in-slice</a>/disp32 -<span id="L3376" class="LineNr">3376 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3377" class="LineNr">3377 </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="L3378" class="LineNr">3378 </span> <span class="subxComment"># check-ints-equal(ECX-EAX, 4, msg) # EAX is at the ')'</span> -<span id="L3379" class="LineNr">3379 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3380" class="LineNr">3380 </span> 68/push <span class="Constant">"F - test-skip-until-close-paren-in-slice-ignores-spaces"</span>/imm32 -<span id="L3381" class="LineNr">3381 </span> 68/push 4/imm32 -<span id="L3382" class="LineNr">3382 </span> <span class="subxS2Comment"># . . push ECX-EAX</span> -<span id="L3383" class="LineNr">3383 </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="L3384" class="LineNr">3384 </span> 51/push-ECX -<span id="L3385" class="LineNr">3385 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3386" class="LineNr">3386 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L3387" class="LineNr">3387 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3388" class="LineNr">3388 </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="L3389" class="LineNr">3389 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L3390" class="LineNr">3390 </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="L3391" class="LineNr">3391 </span> 5d/pop-to-EBP -<span id="L3392" class="LineNr">3392 </span> c3/return -<span id="L3393" class="LineNr">3393 </span> -<span id="L3394" class="LineNr">3394 </span><span class="subxTest">test-skip-until-close-paren-in-slice-stops-at-end</span>: -<span id="L3395" class="LineNr">3395 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L3396" class="LineNr">3396 </span> 55/push-EBP -<span id="L3397" class="LineNr">3397 </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="L3398" class="LineNr">3398 </span> <span class="subxComment"># setup: (EAX..ECX) = "*(abc" # unbalanced dquote</span> -<span id="L3399" class="LineNr">3399 </span> b8/copy-to-EAX <span class="Constant">"*(abc"</span>/imm32 -<span id="L3400" class="LineNr">3400 </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="L3401" class="LineNr">3401 </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="L3402" class="LineNr">3402 </span> 05/add-to-EAX 4/imm32 -<span id="L3403" class="LineNr">3403 </span> <span class="subxComment"># EAX = skip-until-close-paren-in-slice(EAX, ECX)</span> -<span id="L3404" class="LineNr">3404 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3405" class="LineNr">3405 </span> 51/push-ECX -<span id="L3406" class="LineNr">3406 </span> 50/push-EAX +<span id="L2791" class="LineNr">2791 </span> 68/push <span class="Constant">"/disp32"</span>/imm32 +<span id="L2792" class="LineNr">2792 </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="L2793" class="LineNr">2793 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2794" class="LineNr">2794 </span> e8/call <a href='../065write-buffered.subx.html#L8'>write-buffered</a>/disp32 +<span id="L2795" class="LineNr">2795 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2796" class="LineNr">2796 </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="L2797" class="LineNr">2797 </span> e9/jump $emit-indirect-mode:end/disp32 +<span id="L2798" class="LineNr">2798 </span><span class="Constant">$emit-indirect-mode:check-for-disp</span>: +<span id="L2799" class="LineNr">2799 </span> <span class="subxComment"># if (disp == 0) goto next check</span> +<span id="L2800" class="LineNr">2800 </span> 81 7/subop/compare 1/mod/*+disp8 5/rm32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x18/disp8 0/imm32 <span class="subxComment"># compare *(EBP+24)</span> +<span id="L2801" class="LineNr">2801 </span> 74/jump-if-equal $emit-indirect-mode:emit-indirect/disp8 +<span id="L2802" class="LineNr">2802 </span><span class="Constant">$emit-indirect-mode:emit-disp</span>: +<span id="L2803" class="LineNr">2803 </span> <span class="subxComment"># emit(out, "2/mod/*+disp32 " base "/rm32 " disp "/disp32")</span> +<span id="L2804" class="LineNr">2804 </span> <span class="subxS1Comment"># . write-buffered(out, "2/mod/*+disp32 ")</span> +<span id="L2805" class="LineNr">2805 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2806" class="LineNr">2806 </span> 68/push <span class="Constant">"2/mod/*+disp32 "</span>/imm32 +<span id="L2807" class="LineNr">2807 </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="L2808" class="LineNr">2808 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2809" class="LineNr">2809 </span> e8/call <a href='../065write-buffered.subx.html#L8'>write-buffered</a>/disp32 +<span id="L2810" class="LineNr">2810 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2811" class="LineNr">2811 </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="L2812" class="LineNr">2812 </span> <span class="subxS1Comment"># . print-int32-buffered(out, base)</span> +<span id="L2813" class="LineNr">2813 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2814" class="LineNr">2814 </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> 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(EBP+12)</span> +<span id="L2815" class="LineNr">2815 </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="L2816" class="LineNr">2816 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2817" class="LineNr">2817 </span> e8/call <a href='../066print-int.subx.html#L267'>print-int32-buffered</a>/disp32 +<span id="L2818" class="LineNr">2818 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2819" class="LineNr">2819 </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="L2820" class="LineNr">2820 </span> <span class="subxS1Comment"># . write-buffered(out, "/rm32 ")</span> +<span id="L2821" class="LineNr">2821 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2822" class="LineNr">2822 </span> 68/push <span class="Constant">"/rm32 "</span>/imm32 +<span id="L2823" class="LineNr">2823 </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="L2824" class="LineNr">2824 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2825" class="LineNr">2825 </span> e8/call <a href='../065write-buffered.subx.html#L8'>write-buffered</a>/disp32 +<span id="L2826" class="LineNr">2826 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2827" class="LineNr">2827 </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="L2828" class="LineNr">2828 </span> <span class="subxS1Comment"># . print-int32-buffered(out, disp)</span> +<span id="L2829" class="LineNr">2829 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2830" class="LineNr">2830 </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> 0x18/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(EBP+24)</span> +<span id="L2831" class="LineNr">2831 </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="L2832" class="LineNr">2832 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2833" class="LineNr">2833 </span> e8/call <a href='../066print-int.subx.html#L267'>print-int32-buffered</a>/disp32 +<span id="L2834" class="LineNr">2834 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2835" class="LineNr">2835 </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="L2836" class="LineNr">2836 </span> <span class="subxS1Comment"># . write-buffered(out, "/disp32")</span> +<span id="L2837" class="LineNr">2837 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2838" class="LineNr">2838 </span> 68/push <span class="Constant">"/disp32"</span>/imm32 +<span id="L2839" class="LineNr">2839 </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="L2840" class="LineNr">2840 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2841" class="LineNr">2841 </span> e8/call <a href='../065write-buffered.subx.html#L8'>write-buffered</a>/disp32 +<span id="L2842" class="LineNr">2842 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2843" class="LineNr">2843 </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="L2844" class="LineNr">2844 </span> eb/jump $emit-indirect-mode:end/disp8 +<span id="L2845" class="LineNr">2845 </span><span class="Constant">$emit-indirect-mode:emit-indirect</span>: +<span id="L2846" class="LineNr">2846 </span> <span class="subxComment"># emit(out, "0/mod/indirect " base "/rm32")</span> +<span id="L2847" class="LineNr">2847 </span> <span class="subxS1Comment"># . write-buffered(out, "0/mod/indirect ")</span> +<span id="L2848" class="LineNr">2848 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2849" class="LineNr">2849 </span> 68/push <span class="Constant">"0/mod/indirect "</span>/imm32 +<span id="L2850" class="LineNr">2850 </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="L2851" class="LineNr">2851 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2852" class="LineNr">2852 </span> e8/call <a href='../065write-buffered.subx.html#L8'>write-buffered</a>/disp32 +<span id="L2853" class="LineNr">2853 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2854" class="LineNr">2854 </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="L2855" class="LineNr">2855 </span> <span class="subxS1Comment"># . print-int32-buffered(out, base)</span> +<span id="L2856" class="LineNr">2856 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2857" class="LineNr">2857 </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> 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(EBP+12)</span> +<span id="L2858" class="LineNr">2858 </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="L2859" class="LineNr">2859 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2860" class="LineNr">2860 </span> e8/call <a href='../066print-int.subx.html#L267'>print-int32-buffered</a>/disp32 +<span id="L2861" class="LineNr">2861 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2862" class="LineNr">2862 </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="L2863" class="LineNr">2863 </span> <span class="subxS1Comment"># . write-buffered(out, "/rm32")</span> +<span id="L2864" class="LineNr">2864 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2865" class="LineNr">2865 </span> 68/push <span class="Constant">"/rm32"</span>/imm32 +<span id="L2866" class="LineNr">2866 </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="L2867" class="LineNr">2867 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2868" class="LineNr">2868 </span> e8/call <a href='../065write-buffered.subx.html#L8'>write-buffered</a>/disp32 +<span id="L2869" class="LineNr">2869 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2870" class="LineNr">2870 </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="L2871" class="LineNr">2871 </span><span class="Constant">$emit-indirect-mode:end</span>: +<span id="L2872" class="LineNr">2872 </span> <span class="subxS1Comment"># . epilog</span> +<span id="L2873" class="LineNr">2873 </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="L2874" class="LineNr">2874 </span> 5d/pop-to-EBP +<span id="L2875" class="LineNr">2875 </span> c3/return +<span id="L2876" class="LineNr">2876 </span> +<span id="L2877" class="LineNr">2877 </span><span class="subxTest">test-emit-indirect-mode</span>: +<span id="L2878" class="LineNr">2878 </span> <span class="subxS1Comment"># . prolog</span> +<span id="L2879" class="LineNr">2879 </span> 55/push-EBP +<span id="L2880" class="LineNr">2880 </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="L2881" class="LineNr">2881 </span> <span class="subxComment"># setup</span> +<span id="L2882" class="LineNr">2882 </span> <span class="subxS1Comment"># . clear-stream(_test-output-stream)</span> +<span id="L2883" class="LineNr">2883 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2884" class="LineNr">2884 </span> 68/push <a href='../064write-byte.subx.html#L290'>_test-output-stream</a>/imm32 +<span id="L2885" class="LineNr">2885 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2886" class="LineNr">2886 </span> e8/call <a href='../055stream.subx.html#L17'>clear-stream</a>/disp32 +<span id="L2887" class="LineNr">2887 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2888" class="LineNr">2888 </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="L2889" class="LineNr">2889 </span> <span class="subxS1Comment"># . clear-stream(_test-output-buffered-file+4)</span> +<span id="L2890" class="LineNr">2890 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2891" class="LineNr">2891 </span> b8/copy-to-EAX <a href='../064write-byte.subx.html#L332'>_test-output-buffered-file</a>/imm32 +<span id="L2892" class="LineNr">2892 </span> 05/add-to-EAX 4/imm32 +<span id="L2893" class="LineNr">2893 </span> 50/push-EAX +<span id="L2894" class="LineNr">2894 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2895" class="LineNr">2895 </span> e8/call <a href='../055stream.subx.html#L17'>clear-stream</a>/disp32 +<span id="L2896" class="LineNr">2896 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2897" class="LineNr">2897 </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="L2898" class="LineNr">2898 </span> <span class="subxComment"># emit-indirect-mode(_test-output-buffered-file, 0, 4/none, 0, 0)</span> +<span id="L2899" class="LineNr">2899 </span> <span class="subxS2Comment"># . . write args</span> +<span id="L2900" class="LineNr">2900 </span> 68/push 0/imm32/.disp +<span id="L2901" class="LineNr">2901 </span> 68/push 0/imm32/.scale +<span id="L2902" class="LineNr">2902 </span> 68/push 4/imm32/.index/none +<span id="L2903" class="LineNr">2903 </span> 68/push 0/imm32/.base +<span id="L2904" class="LineNr">2904 </span> 68/push <a href='../064write-byte.subx.html#L332'>_test-output-buffered-file</a>/imm32 +<span id="L2905" class="LineNr">2905 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2906" class="LineNr">2906 </span> e8/call <a href='desugar.subx.html#L2715'>emit-indirect-mode</a>/disp32 +<span id="L2907" class="LineNr">2907 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2908" class="LineNr">2908 </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> 0x14/imm32 <span class="subxComment"># add to ESP</span> +<span id="L2909" class="LineNr">2909 </span> <span class="subxS1Comment"># . flush(_test-output-buffered-file)</span> +<span id="L2910" class="LineNr">2910 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2911" class="LineNr">2911 </span> 68/push <a href='../064write-byte.subx.html#L332'>_test-output-buffered-file</a>/imm32 +<span id="L2912" class="LineNr">2912 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2913" class="LineNr">2913 </span> e8/call <a href='../064write-byte.subx.html#L79'>flush</a>/disp32 +<span id="L2914" class="LineNr">2914 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2915" class="LineNr">2915 </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="L2916" class="Folded">2916 </span><span class="Folded">+-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------</span> +<span id="L2942" class="LineNr">2942 </span> <span class="subxComment"># check-stream-equal(_test-output-stream, "0/mod/indirect 0/rm32", msg)</span> +<span id="L2943" class="LineNr">2943 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2944" class="LineNr">2944 </span> 68/push <span class="Constant">"F - test-emit-indirect-mode"</span>/imm32 +<span id="L2945" class="LineNr">2945 </span> 68/push <span class="Constant">"0/mod/indirect 0x00000000/rm32"</span>/imm32 +<span id="L2946" class="LineNr">2946 </span> 68/push <a href='../064write-byte.subx.html#L290'>_test-output-stream</a>/imm32 +<span id="L2947" class="LineNr">2947 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2948" class="LineNr">2948 </span> e8/call <a href='../058stream-equal.subx.html#L193'>check-stream-equal</a>/disp32 +<span id="L2949" class="LineNr">2949 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2950" class="LineNr">2950 </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="L2951" class="LineNr">2951 </span> <span class="subxS1Comment"># . epilog</span> +<span id="L2952" class="LineNr">2952 </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="L2953" class="LineNr">2953 </span> 5d/pop-to-EBP +<span id="L2954" class="LineNr">2954 </span> c3/return +<span id="L2955" class="LineNr">2955 </span> +<span id="L2956" class="LineNr">2956 </span><span class="subxTest">test-emit-indirect-mode-2</span>: +<span id="L2957" class="LineNr">2957 </span> <span class="subxS1Comment"># . prolog</span> +<span id="L2958" class="LineNr">2958 </span> 55/push-EBP +<span id="L2959" class="LineNr">2959 </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="L2960" class="LineNr">2960 </span> <span class="subxComment"># setup</span> +<span id="L2961" class="LineNr">2961 </span> <span class="subxS1Comment"># . clear-stream(_test-output-stream)</span> +<span id="L2962" class="LineNr">2962 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2963" class="LineNr">2963 </span> 68/push <a href='../064write-byte.subx.html#L290'>_test-output-stream</a>/imm32 +<span id="L2964" class="LineNr">2964 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2965" class="LineNr">2965 </span> e8/call <a href='../055stream.subx.html#L17'>clear-stream</a>/disp32 +<span id="L2966" class="LineNr">2966 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2967" class="LineNr">2967 </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="L2968" class="LineNr">2968 </span> <span class="subxS1Comment"># . clear-stream(_test-output-buffered-file+4)</span> +<span id="L2969" class="LineNr">2969 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2970" class="LineNr">2970 </span> b8/copy-to-EAX <a href='../064write-byte.subx.html#L332'>_test-output-buffered-file</a>/imm32 +<span id="L2971" class="LineNr">2971 </span> 05/add-to-EAX 4/imm32 +<span id="L2972" class="LineNr">2972 </span> 50/push-EAX +<span id="L2973" class="LineNr">2973 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2974" class="LineNr">2974 </span> e8/call <a href='../055stream.subx.html#L17'>clear-stream</a>/disp32 +<span id="L2975" class="LineNr">2975 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2976" class="LineNr">2976 </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="L2977" class="LineNr">2977 </span> <span class="subxComment"># emit-indirect-mode(_test-output-buffered-file, 6, 4/none, 0, 0)</span> +<span id="L2978" class="LineNr">2978 </span> <span class="subxS2Comment"># . . write args</span> +<span id="L2979" class="LineNr">2979 </span> 68/push 0/imm32/.disp +<span id="L2980" class="LineNr">2980 </span> 68/push 0/imm32/.scale +<span id="L2981" class="LineNr">2981 </span> 68/push 4/imm32/.index/none +<span id="L2982" class="LineNr">2982 </span> 68/push 7/imm32/.base +<span id="L2983" class="LineNr">2983 </span> 68/push <a href='../064write-byte.subx.html#L332'>_test-output-buffered-file</a>/imm32 +<span id="L2984" class="LineNr">2984 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2985" class="LineNr">2985 </span> e8/call <a href='desugar.subx.html#L2715'>emit-indirect-mode</a>/disp32 +<span id="L2986" class="LineNr">2986 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2987" class="LineNr">2987 </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> 0x14/imm32 <span class="subxComment"># add to ESP</span> +<span id="L2988" class="LineNr">2988 </span> <span class="subxS1Comment"># . flush(_test-output-buffered-file)</span> +<span id="L2989" class="LineNr">2989 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L2990" class="LineNr">2990 </span> 68/push <a href='../064write-byte.subx.html#L332'>_test-output-buffered-file</a>/imm32 +<span id="L2991" class="LineNr">2991 </span> <span class="subxS2Comment"># . . call</span> +<span id="L2992" class="LineNr">2992 </span> e8/call <a href='../064write-byte.subx.html#L79'>flush</a>/disp32 +<span id="L2993" class="LineNr">2993 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L2994" class="LineNr">2994 </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="L2995" class="Folded">2995 </span><span class="Folded">+-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------</span> +<span id="L3021" class="LineNr">3021 </span> <span class="subxComment"># check-stream-equal(_test-output-stream, "0/mod/indirect 7/rm32", msg)</span> +<span id="L3022" class="LineNr">3022 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3023" class="LineNr">3023 </span> 68/push <span class="Constant">"F - test-emit-indirect-mode-2"</span>/imm32 +<span id="L3024" class="LineNr">3024 </span> 68/push <span class="Constant">"0/mod/indirect 0x00000007/rm32"</span>/imm32 +<span id="L3025" class="LineNr">3025 </span> 68/push <a href='../064write-byte.subx.html#L290'>_test-output-stream</a>/imm32 +<span id="L3026" class="LineNr">3026 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3027" class="LineNr">3027 </span> e8/call <a href='../058stream-equal.subx.html#L193'>check-stream-equal</a>/disp32 +<span id="L3028" class="LineNr">3028 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3029" class="LineNr">3029 </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="L3030" class="LineNr">3030 </span> <span class="subxS1Comment"># . epilog</span> +<span id="L3031" class="LineNr">3031 </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="L3032" class="LineNr">3032 </span> 5d/pop-to-EBP +<span id="L3033" class="LineNr">3033 </span> c3/return +<span id="L3034" class="LineNr">3034 </span> +<span id="L3035" class="LineNr">3035 </span><span class="subxTest">test-emit-indirect-mode-with-disp</span>: +<span id="L3036" class="LineNr">3036 </span> <span class="subxS1Comment"># . prolog</span> +<span id="L3037" class="LineNr">3037 </span> 55/push-EBP +<span id="L3038" class="LineNr">3038 </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="L3039" class="LineNr">3039 </span> <span class="subxComment"># setup</span> +<span id="L3040" class="LineNr">3040 </span> <span class="subxS1Comment"># . clear-stream(_test-output-stream)</span> +<span id="L3041" class="LineNr">3041 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3042" class="LineNr">3042 </span> 68/push <a href='../064write-byte.subx.html#L290'>_test-output-stream</a>/imm32 +<span id="L3043" class="LineNr">3043 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3044" class="LineNr">3044 </span> e8/call <a href='../055stream.subx.html#L17'>clear-stream</a>/disp32 +<span id="L3045" class="LineNr">3045 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3046" class="LineNr">3046 </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="L3047" class="LineNr">3047 </span> <span class="subxS1Comment"># . clear-stream(_test-output-buffered-file+4)</span> +<span id="L3048" class="LineNr">3048 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3049" class="LineNr">3049 </span> b8/copy-to-EAX <a href='../064write-byte.subx.html#L332'>_test-output-buffered-file</a>/imm32 +<span id="L3050" class="LineNr">3050 </span> 05/add-to-EAX 4/imm32 +<span id="L3051" class="LineNr">3051 </span> 50/push-EAX +<span id="L3052" class="LineNr">3052 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3053" class="LineNr">3053 </span> e8/call <a href='../055stream.subx.html#L17'>clear-stream</a>/disp32 +<span id="L3054" class="LineNr">3054 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3055" class="LineNr">3055 </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="L3056" class="LineNr">3056 </span> <span class="subxComment"># emit-indirect-mode(_test-output-buffered-file, 6, 4/none, 0, 4)</span> +<span id="L3057" class="LineNr">3057 </span> <span class="subxS2Comment"># . . write args</span> +<span id="L3058" class="LineNr">3058 </span> 68/push 4/imm32/.disp +<span id="L3059" class="LineNr">3059 </span> 68/push 0/imm32/.scale +<span id="L3060" class="LineNr">3060 </span> 68/push 4/imm32/.index/none +<span id="L3061" class="LineNr">3061 </span> 68/push 6/imm32/.base +<span id="L3062" class="LineNr">3062 </span> 68/push <a href='../064write-byte.subx.html#L332'>_test-output-buffered-file</a>/imm32 +<span id="L3063" class="LineNr">3063 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3064" class="LineNr">3064 </span> e8/call <a href='desugar.subx.html#L2715'>emit-indirect-mode</a>/disp32 +<span id="L3065" class="LineNr">3065 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3066" class="LineNr">3066 </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> 0x14/imm32 <span class="subxComment"># add to ESP</span> +<span id="L3067" class="LineNr">3067 </span> <span class="subxS1Comment"># . flush(_test-output-buffered-file)</span> +<span id="L3068" class="LineNr">3068 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3069" class="LineNr">3069 </span> 68/push <a href='../064write-byte.subx.html#L332'>_test-output-buffered-file</a>/imm32 +<span id="L3070" class="LineNr">3070 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3071" class="LineNr">3071 </span> e8/call <a href='../064write-byte.subx.html#L79'>flush</a>/disp32 +<span id="L3072" class="LineNr">3072 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3073" class="LineNr">3073 </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="L3074" class="Folded">3074 </span><span class="Folded">+-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------</span> +<span id="L3100" class="LineNr">3100 </span> <span class="subxComment"># check-stream-equal(_test-output-stream, "2/mod/*+disp32 6/rm32 4/disp32", msg)</span> +<span id="L3101" class="LineNr">3101 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3102" class="LineNr">3102 </span> 68/push <span class="Constant">"F - test-emit-indirect-mode-with-disp"</span>/imm32 +<span id="L3103" class="LineNr">3103 </span> 68/push <span class="Constant">"2/mod/*+disp32 0x00000006/rm32 0x00000004/disp32"</span>/imm32 +<span id="L3104" class="LineNr">3104 </span> 68/push <a href='../064write-byte.subx.html#L290'>_test-output-stream</a>/imm32 +<span id="L3105" class="LineNr">3105 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3106" class="LineNr">3106 </span> e8/call <a href='../058stream-equal.subx.html#L193'>check-stream-equal</a>/disp32 +<span id="L3107" class="LineNr">3107 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3108" class="LineNr">3108 </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="L3109" class="LineNr">3109 </span> <span class="subxS1Comment"># . epilog</span> +<span id="L3110" class="LineNr">3110 </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="L3111" class="LineNr">3111 </span> 5d/pop-to-EBP +<span id="L3112" class="LineNr">3112 </span> c3/return +<span id="L3113" class="LineNr">3113 </span> +<span id="L3114" class="LineNr">3114 </span><span class="subxTest">test-emit-indirect-mode-with-disp-negative</span>: +<span id="L3115" class="LineNr">3115 </span> <span class="subxS1Comment"># . prolog</span> +<span id="L3116" class="LineNr">3116 </span> 55/push-EBP +<span id="L3117" class="LineNr">3117 </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="L3118" class="LineNr">3118 </span> <span class="subxComment"># setup</span> +<span id="L3119" class="LineNr">3119 </span> <span class="subxS1Comment"># . clear-stream(_test-output-stream)</span> +<span id="L3120" class="LineNr">3120 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3121" class="LineNr">3121 </span> 68/push <a href='../064write-byte.subx.html#L290'>_test-output-stream</a>/imm32 +<span id="L3122" class="LineNr">3122 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3123" class="LineNr">3123 </span> e8/call <a href='../055stream.subx.html#L17'>clear-stream</a>/disp32 +<span id="L3124" class="LineNr">3124 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3125" class="LineNr">3125 </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="L3126" class="LineNr">3126 </span> <span class="subxS1Comment"># . clear-stream(_test-output-buffered-file+4)</span> +<span id="L3127" class="LineNr">3127 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3128" class="LineNr">3128 </span> b8/copy-to-EAX <a href='../064write-byte.subx.html#L332'>_test-output-buffered-file</a>/imm32 +<span id="L3129" class="LineNr">3129 </span> 05/add-to-EAX 4/imm32 +<span id="L3130" class="LineNr">3130 </span> 50/push-EAX +<span id="L3131" class="LineNr">3131 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3132" class="LineNr">3132 </span> e8/call <a href='../055stream.subx.html#L17'>clear-stream</a>/disp32 +<span id="L3133" class="LineNr">3133 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3134" class="LineNr">3134 </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="L3135" class="LineNr">3135 </span> <span class="subxComment"># emit-indirect-mode(_test-output-buffered-file, 6, 4/none, 0, -4)</span> +<span id="L3136" class="LineNr">3136 </span> <span class="subxS2Comment"># . . write args</span> +<span id="L3137" class="LineNr">3137 </span> 68/push -4/imm32/.disp +<span id="L3138" class="LineNr">3138 </span> 68/push 0/imm32/.scale +<span id="L3139" class="LineNr">3139 </span> 68/push 4/imm32/.index/none +<span id="L3140" class="LineNr">3140 </span> 68/push 6/imm32/.base +<span id="L3141" class="LineNr">3141 </span> 68/push <a href='../064write-byte.subx.html#L332'>_test-output-buffered-file</a>/imm32 +<span id="L3142" class="LineNr">3142 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3143" class="LineNr">3143 </span> e8/call <a href='desugar.subx.html#L2715'>emit-indirect-mode</a>/disp32 +<span id="L3144" class="LineNr">3144 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3145" class="LineNr">3145 </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> 0x14/imm32 <span class="subxComment"># add to ESP</span> +<span id="L3146" class="LineNr">3146 </span> <span class="subxS1Comment"># . flush(_test-output-buffered-file)</span> +<span id="L3147" class="LineNr">3147 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3148" class="LineNr">3148 </span> 68/push <a href='../064write-byte.subx.html#L332'>_test-output-buffered-file</a>/imm32 +<span id="L3149" class="LineNr">3149 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3150" class="LineNr">3150 </span> e8/call <a href='../064write-byte.subx.html#L79'>flush</a>/disp32 +<span id="L3151" class="LineNr">3151 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3152" class="LineNr">3152 </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="L3153" class="Folded">3153 </span><span class="Folded">+-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------</span> +<span id="L3179" class="LineNr">3179 </span> <span class="subxComment"># check-stream-equal(_test-output-stream, "2/mod/*+disp32 6/rm32 -4/disp32", msg)</span> +<span id="L3180" class="LineNr">3180 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3181" class="LineNr">3181 </span> 68/push <span class="Constant">"F - test-emit-indirect-mode-with-disp"</span>/imm32 +<span id="L3182" class="LineNr">3182 </span> 68/push <span class="Constant">"2/mod/*+disp32 0x00000006/rm32 0xfffffffc/disp32"</span>/imm32 +<span id="L3183" class="LineNr">3183 </span> 68/push <a href='../064write-byte.subx.html#L290'>_test-output-stream</a>/imm32 +<span id="L3184" class="LineNr">3184 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3185" class="LineNr">3185 </span> e8/call <a href='../058stream-equal.subx.html#L193'>check-stream-equal</a>/disp32 +<span id="L3186" class="LineNr">3186 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3187" class="LineNr">3187 </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="L3188" class="LineNr">3188 </span> <span class="subxS1Comment"># . epilog</span> +<span id="L3189" class="LineNr">3189 </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="L3190" class="LineNr">3190 </span> 5d/pop-to-EBP +<span id="L3191" class="LineNr">3191 </span> c3/return +<span id="L3192" class="LineNr">3192 </span> +<span id="L3193" class="LineNr">3193 </span><span class="subxTest">test-emit-indirect-mode-with-sib</span>: +<span id="L3194" class="LineNr">3194 </span> <span class="subxS1Comment"># . prolog</span> +<span id="L3195" class="LineNr">3195 </span> 55/push-EBP +<span id="L3196" class="LineNr">3196 </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="L3197" class="LineNr">3197 </span> <span class="subxComment"># setup</span> +<span id="L3198" class="LineNr">3198 </span> <span class="subxS1Comment"># . clear-stream(_test-output-stream)</span> +<span id="L3199" class="LineNr">3199 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3200" class="LineNr">3200 </span> 68/push <a href='../064write-byte.subx.html#L290'>_test-output-stream</a>/imm32 +<span id="L3201" class="LineNr">3201 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3202" class="LineNr">3202 </span> e8/call <a href='../055stream.subx.html#L17'>clear-stream</a>/disp32 +<span id="L3203" class="LineNr">3203 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3204" class="LineNr">3204 </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="L3205" class="LineNr">3205 </span> <span class="subxS1Comment"># . clear-stream(_test-output-buffered-file+4)</span> +<span id="L3206" class="LineNr">3206 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3207" class="LineNr">3207 </span> b8/copy-to-EAX <a href='../064write-byte.subx.html#L332'>_test-output-buffered-file</a>/imm32 +<span id="L3208" class="LineNr">3208 </span> 05/add-to-EAX 4/imm32 +<span id="L3209" class="LineNr">3209 </span> 50/push-EAX +<span id="L3210" class="LineNr">3210 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3211" class="LineNr">3211 </span> e8/call <a href='../055stream.subx.html#L17'>clear-stream</a>/disp32 +<span id="L3212" class="LineNr">3212 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3213" class="LineNr">3213 </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="L3214" class="LineNr">3214 </span> <span class="subxComment"># emit-indirect-mode(_test-output-buffered-file, 6/base, 1/index, 2/scale, 4/disp)</span> +<span id="L3215" class="LineNr">3215 </span> <span class="subxS2Comment"># . . write args</span> +<span id="L3216" class="LineNr">3216 </span> 68/push 4/imm32/.disp +<span id="L3217" class="LineNr">3217 </span> 68/push 2/imm32/.scale +<span id="L3218" class="LineNr">3218 </span> 68/push 1/imm32/.index +<span id="L3219" class="LineNr">3219 </span> 68/push 6/imm32/.base +<span id="L3220" class="LineNr">3220 </span> 68/push <a href='../064write-byte.subx.html#L332'>_test-output-buffered-file</a>/imm32 +<span id="L3221" class="LineNr">3221 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3222" class="LineNr">3222 </span> e8/call <a href='desugar.subx.html#L2715'>emit-indirect-mode</a>/disp32 +<span id="L3223" class="LineNr">3223 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3224" class="LineNr">3224 </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> 0x14/imm32 <span class="subxComment"># add to ESP</span> +<span id="L3225" class="LineNr">3225 </span> <span class="subxS1Comment"># . flush(_test-output-buffered-file)</span> +<span id="L3226" class="LineNr">3226 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3227" class="LineNr">3227 </span> 68/push <a href='../064write-byte.subx.html#L332'>_test-output-buffered-file</a>/imm32 +<span id="L3228" class="LineNr">3228 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3229" class="LineNr">3229 </span> e8/call <a href='../064write-byte.subx.html#L79'>flush</a>/disp32 +<span id="L3230" class="LineNr">3230 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3231" class="LineNr">3231 </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="L3232" class="Folded">3232 </span><span class="Folded">+-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------</span> +<span id="L3258" class="LineNr">3258 </span> <span class="subxComment"># check-stream-equal(_test-output-stream, "2/mod/indirect 4/rm32/sib 6/base 1/index 2/scale 4/disp", msg)</span> +<span id="L3259" class="LineNr">3259 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3260" class="LineNr">3260 </span> 68/push <span class="Constant">"F - test-emit-indirect-mode-with-sib"</span>/imm32 +<span id="L3261" class="LineNr">3261 </span> 68/push <span class="Constant">"2/mod/*+disp32 4/rm32/sib 0x00000006/base 0x00000001/index 0x00000002/scale 0x00000004/disp32"</span>/imm32 +<span id="L3262" class="LineNr">3262 </span> 68/push <a href='../064write-byte.subx.html#L290'>_test-output-stream</a>/imm32 +<span id="L3263" class="LineNr">3263 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3264" class="LineNr">3264 </span> e8/call <a href='../058stream-equal.subx.html#L193'>check-stream-equal</a>/disp32 +<span id="L3265" class="LineNr">3265 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3266" class="LineNr">3266 </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="L3267" class="LineNr">3267 </span> <span class="subxS1Comment"># . epilog</span> +<span id="L3268" class="LineNr">3268 </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="L3269" class="LineNr">3269 </span> 5d/pop-to-EBP +<span id="L3270" class="LineNr">3270 </span> c3/return +<span id="L3271" class="LineNr">3271 </span> +<span id="L3272" class="LineNr">3272 </span><span class="subxComment"># update line->read to ')'</span> +<span id="L3273" class="LineNr">3273 </span><span class="subxComment"># line->read ends at ')'</span> +<span id="L3274" class="LineNr">3274 </span><span class="subxFunction">skip-until-close-paren</span>: <span class="subxComment"># line : (address stream)</span> +<span id="L3275" class="LineNr">3275 </span> <span class="subxS1Comment"># . prolog</span> +<span id="L3276" class="LineNr">3276 </span> 55/push-EBP +<span id="L3277" class="LineNr">3277 </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="L3278" class="LineNr">3278 </span> <span class="subxS1Comment"># . save registers</span> +<span id="L3279" class="LineNr">3279 </span> 50/push-EAX +<span id="L3280" class="LineNr">3280 </span> 51/push-ECX +<span id="L3281" class="LineNr">3281 </span> 52/push-EDX +<span id="L3282" class="LineNr">3282 </span> <span class="subxComment"># ECX = line</span> +<span id="L3283" class="LineNr">3283 </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="L3284" class="LineNr">3284 </span> <span class="subxComment"># EAX = skip-until-close-paren-in-slice(&line->data[line->read], &line->data[line->write])</span> +<span id="L3285" class="LineNr">3285 </span> <span class="subxS2Comment"># . . push &line->data[line->write]</span> +<span id="L3286" class="LineNr">3286 </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="L3287" class="LineNr">3287 </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="L3288" class="LineNr">3288 </span> 52/push-EDX +<span id="L3289" class="LineNr">3289 </span> <span class="subxS2Comment"># . . push &line->data[line->read]</span> +<span id="L3290" class="LineNr">3290 </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="L3291" class="LineNr">3291 </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="L3292" class="LineNr">3292 </span> 52/push-EDX +<span id="L3293" class="LineNr">3293 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3294" class="LineNr">3294 </span> e8/call <a href='desugar.subx.html#L3460'>skip-until-close-paren-in-slice</a>/disp32 +<span id="L3295" class="LineNr">3295 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3296" class="LineNr">3296 </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="L3297" class="LineNr">3297 </span> <span class="subxComment"># line->read = EAX - line->data</span> +<span id="L3298" class="LineNr">3298 </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="L3299" class="LineNr">3299 </span> 2d/subtract-from-EAX 0xc/imm32 +<span id="L3300" class="LineNr">3300 </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="L3301" class="LineNr">3301 </span><span class="Constant">$skip-until-close-paren:end</span>: +<span id="L3302" class="LineNr">3302 </span> <span class="subxS1Comment"># . restore registers</span> +<span id="L3303" class="LineNr">3303 </span> 5a/pop-to-EDX +<span id="L3304" class="LineNr">3304 </span> 59/pop-to-ECX +<span id="L3305" class="LineNr">3305 </span> 58/pop-to-EAX +<span id="L3306" class="LineNr">3306 </span> <span class="subxS1Comment"># . epilog</span> +<span id="L3307" class="LineNr">3307 </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="L3308" class="LineNr">3308 </span> 5d/pop-to-EBP +<span id="L3309" class="LineNr">3309 </span> c3/return +<span id="L3310" class="LineNr">3310 </span> +<span id="L3311" class="LineNr">3311 </span><span class="subxTest">test-skip-until-close-paren</span>: +<span id="L3312" class="LineNr">3312 </span> <span class="subxS1Comment"># . prolog</span> +<span id="L3313" class="LineNr">3313 </span> 55/push-EBP +<span id="L3314" class="LineNr">3314 </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="L3315" class="LineNr">3315 </span> <span class="subxComment"># setup</span> +<span id="L3316" class="LineNr">3316 </span> <span class="subxS1Comment"># . clear-stream(_test-input-stream)</span> +<span id="L3317" class="LineNr">3317 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3318" class="LineNr">3318 </span> 68/push <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 +<span id="L3319" class="LineNr">3319 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3320" class="LineNr">3320 </span> e8/call <a href='../055stream.subx.html#L17'>clear-stream</a>/disp32 +<span id="L3321" class="LineNr">3321 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3322" class="LineNr">3322 </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="L3323" class="LineNr">3323 </span> <span class="subxS1Comment"># . write(_test-input-stream, "*(abc) def")</span> +<span id="L3324" class="LineNr">3324 </span> <span class="subxS1Comment"># . indices: 0123 45</span> +<span id="L3325" class="LineNr">3325 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3326" class="LineNr">3326 </span> 68/push <span class="Constant">"*(abc) def"</span>/imm32 +<span id="L3327" class="LineNr">3327 </span> 68/push <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 +<span id="L3328" class="LineNr">3328 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3329" class="LineNr">3329 </span> e8/call <a href='../057write.subx.html#L24'>write</a>/disp32 +<span id="L3330" class="LineNr">3330 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3331" class="LineNr">3331 </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="L3332" class="LineNr">3332 </span> <span class="subxComment"># precondition: line->read == 0</span> +<span id="L3333" class="LineNr">3333 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3334" class="LineNr">3334 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L3311'>test-skip-until-close-paren</a>/precondition"</span>/imm32 +<span id="L3335" class="LineNr">3335 </span> 68/push 0/imm32 +<span id="L3336" class="LineNr">3336 </span> b8/copy-to-EAX <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 +<span id="L3337" class="LineNr">3337 </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="L3338" class="LineNr">3338 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3339" class="LineNr">3339 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L3340" class="LineNr">3340 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3341" class="LineNr">3341 </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="L3342" class="LineNr">3342 </span> <span class="subxComment"># skip-until-close-paren(_test-input-stream)</span> +<span id="L3343" class="LineNr">3343 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3344" class="LineNr">3344 </span> 68/push <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 +<span id="L3345" class="LineNr">3345 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3346" class="LineNr">3346 </span> e8/call <a href='desugar.subx.html#L3274'>skip-until-close-paren</a>/disp32 +<span id="L3347" class="LineNr">3347 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3348" class="LineNr">3348 </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="L3349" class="LineNr">3349 </span> <span class="subxComment"># check-ints-equal(line->read, 5, msg)</span> +<span id="L3350" class="LineNr">3350 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3351" class="LineNr">3351 </span> 68/push <span class="Constant">"F - test-skip-until-close-paren"</span>/imm32 +<span id="L3352" class="LineNr">3352 </span> 68/push 5/imm32 +<span id="L3353" class="LineNr">3353 </span> b8/copy-to-EAX <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 +<span id="L3354" class="LineNr">3354 </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="L3355" class="LineNr">3355 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3356" class="LineNr">3356 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L3357" class="LineNr">3357 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3358" class="LineNr">3358 </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="L3359" class="LineNr">3359 </span> <span class="subxS1Comment"># . epilog</span> +<span id="L3360" class="LineNr">3360 </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="L3361" class="LineNr">3361 </span> 5d/pop-to-EBP +<span id="L3362" class="LineNr">3362 </span> c3/return +<span id="L3363" class="LineNr">3363 </span> +<span id="L3364" class="LineNr">3364 </span><span class="subxTest">test-skip-until-close-paren-ignores-spaces</span>: +<span id="L3365" class="LineNr">3365 </span> <span class="subxS1Comment"># . prolog</span> +<span id="L3366" class="LineNr">3366 </span> 55/push-EBP +<span id="L3367" class="LineNr">3367 </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="L3368" class="LineNr">3368 </span> <span class="subxComment"># setup</span> +<span id="L3369" class="LineNr">3369 </span> <span class="subxS1Comment"># . clear-stream(_test-input-stream)</span> +<span id="L3370" class="LineNr">3370 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3371" class="LineNr">3371 </span> 68/push <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 +<span id="L3372" class="LineNr">3372 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3373" class="LineNr">3373 </span> e8/call <a href='../055stream.subx.html#L17'>clear-stream</a>/disp32 +<span id="L3374" class="LineNr">3374 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3375" class="LineNr">3375 </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="L3376" class="LineNr">3376 </span> <span class="subxS1Comment"># . write(_test-input-stream, "*(a b)/yz")</span> +<span id="L3377" class="LineNr">3377 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3378" class="LineNr">3378 </span> 68/push <span class="Constant">"*(a b)/yz"</span>/imm32 +<span id="L3379" class="LineNr">3379 </span> 68/push <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 +<span id="L3380" class="LineNr">3380 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3381" class="LineNr">3381 </span> e8/call <a href='../057write.subx.html#L24'>write</a>/disp32 +<span id="L3382" class="LineNr">3382 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3383" class="LineNr">3383 </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="L3384" class="LineNr">3384 </span> <span class="subxComment"># precondition: line->read == 0</span> +<span id="L3385" class="LineNr">3385 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3386" class="LineNr">3386 </span> 68/push <span class="Constant">"F - <a href='desugar.subx.html#L3364'>test-skip-until-close-paren-ignores-spaces</a>/precondition"</span>/imm32 +<span id="L3387" class="LineNr">3387 </span> 68/push 0/imm32 +<span id="L3388" class="LineNr">3388 </span> b8/copy-to-EAX <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 +<span id="L3389" class="LineNr">3389 </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="L3390" class="LineNr">3390 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3391" class="LineNr">3391 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L3392" class="LineNr">3392 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3393" class="LineNr">3393 </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="L3394" class="LineNr">3394 </span> <span class="subxComment"># skip-until-close-paren(_test-input-stream)</span> +<span id="L3395" class="LineNr">3395 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3396" class="LineNr">3396 </span> 68/push <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 +<span id="L3397" class="LineNr">3397 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3398" class="LineNr">3398 </span> e8/call <a href='desugar.subx.html#L3274'>skip-until-close-paren</a>/disp32 +<span id="L3399" class="LineNr">3399 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3400" class="LineNr">3400 </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="L3401" class="LineNr">3401 </span> <span class="subxComment"># check-ints-equal(line->read, 5, msg)</span> +<span id="L3402" class="LineNr">3402 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3403" class="LineNr">3403 </span> 68/push <span class="Constant">"F - test-skip-until-close-paren-ignores-spaces"</span>/imm32 +<span id="L3404" class="LineNr">3404 </span> 68/push 5/imm32 +<span id="L3405" class="LineNr">3405 </span> b8/copy-to-EAX <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 +<span id="L3406" class="LineNr">3406 </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="L3407" class="LineNr">3407 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3408" class="LineNr">3408 </span> e8/call <a href='desugar.subx.html#L3288'>skip-until-close-paren-in-slice</a>/disp32 +<span id="L3408" class="LineNr">3408 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 <span id="L3409" class="LineNr">3409 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3410" class="LineNr">3410 </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="L3411" class="LineNr">3411 </span> <span class="subxComment"># check-ints-equal(ECX-EAX, 0, msg) # skipped to end of slice</span> -<span id="L3412" class="LineNr">3412 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3413" class="LineNr">3413 </span> 68/push <span class="Constant">"F - test-skip-until-close-paren-in-slice-stops-at-end"</span>/imm32 -<span id="L3414" class="LineNr">3414 </span> 68/push 0/imm32 -<span id="L3415" class="LineNr">3415 </span> <span class="subxS2Comment"># . . push ECX-EAX</span> -<span id="L3416" class="LineNr">3416 </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="L3417" class="LineNr">3417 </span> 51/push-ECX -<span id="L3418" class="LineNr">3418 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3419" class="LineNr">3419 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L3420" class="LineNr">3420 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3421" class="LineNr">3421 </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="L3422" class="LineNr">3422 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L3423" class="LineNr">3423 </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="L3424" class="LineNr">3424 </span> 5d/pop-to-EBP -<span id="L3425" class="LineNr">3425 </span> c3/return -<span id="L3426" class="LineNr">3426 </span> -<span id="L3427" class="LineNr">3427 </span><span class="subxComment"># assumes 'in' starts with optional '+' or '-', optional whitespace, and an unsigned integer</span> -<span id="L3428" class="LineNr">3428 </span><span class="subxComment"># returns the value of the integer</span> -<span id="L3429" class="LineNr">3429 </span><span class="subxComment"># side-effect: modifies 'in' to skip past the integer</span> -<span id="L3430" class="LineNr">3430 </span><span class="subxFunction">next-hex-int</span>: <span class="subxComment"># in : (address slice) -> result/EAX</span> -<span id="L3431" class="LineNr">3431 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L3432" class="LineNr">3432 </span> 55/push-EBP -<span id="L3433" class="LineNr">3433 </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="L3434" class="LineNr">3434 </span> <span class="subxS1Comment"># . save registers</span> -<span id="L3435" class="LineNr">3435 </span> 51/push-ECX -<span id="L3436" class="LineNr">3436 </span> 52/push-EDX -<span id="L3437" class="LineNr">3437 </span> 53/push-EBX -<span id="L3438" class="LineNr">3438 </span> 56/push-ESI -<span id="L3439" class="LineNr">3439 </span> 57/push-EDI -<span id="L3440" class="LineNr">3440 </span> <span class="subxComment"># result/EDI = 0</span> -<span id="L3441" class="LineNr">3441 </span> 31/xor 3/mod/direct 7/rm32/EDI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 7/r32/EDI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># clear EDI</span> -<span id="L3442" class="LineNr">3442 </span> <span class="subxComment"># ESI = in</span> -<span id="L3443" class="LineNr">3443 </span> 8b/copy 1/mod/*+disp8 5/rm32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/ESI 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(EBP+8) to ESI</span> -<span id="L3444" class="LineNr">3444 </span> <span class="subxComment"># EDX = in->end</span> -<span id="L3445" class="LineNr">3445 </span> 8b/copy 1/mod/*+disp8 6/rm32/ESI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/EDX 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ESI+4) to EDX</span> -<span id="L3446" class="LineNr">3446 </span> <span class="subxComment"># curr/ECX = in->start</span> -<span id="L3447" class="LineNr">3447 </span> 8b/copy 0/mod/indirect 6/rm32/ESI <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 *ESI to ECX</span> -<span id="L3448" class="LineNr">3448 </span> <span class="subxComment"># negate?/EBX = false</span> -<span id="L3449" class="LineNr">3449 </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="L3450" class="LineNr">3450 </span> <span class="subxComment"># EAX = *curr</span> -<span id="L3451" class="LineNr">3451 </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="L3452" class="LineNr">3452 </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="L3453" class="LineNr">3453 </span><span class="Constant">$next-hex-int:positive</span>: -<span id="L3454" class="LineNr">3454 </span> <span class="subxComment"># if (*curr == '+') ++curr</span> -<span id="L3455" class="LineNr">3455 </span> 3d/compare-EAX-and 0x2b/imm32/+ -<span id="L3456" class="LineNr">3456 </span> 75/jump-if-not-equal $next-hex-int:negative/disp8 -<span id="L3457" class="LineNr">3457 </span> <span class="subxS1Comment"># . ++curr</span> -<span id="L3458" class="LineNr">3458 </span> 41/increment-ECX -<span id="L3459" class="LineNr">3459 </span> eb/jump $next-hex-int:skip-whitespace/disp8 -<span id="L3460" class="LineNr">3460 </span><span class="Constant">$next-hex-int:negative</span>: -<span id="L3461" class="LineNr">3461 </span> <span class="subxComment"># else if (*curr == '-') ++curr, negate = true</span> -<span id="L3462" class="LineNr">3462 </span> 3d/compare-EAX-and 0x2d/imm32/- -<span id="L3463" class="LineNr">3463 </span> 75/jump-if-not-equal $next-hex-int:skip-whitespace/disp8 -<span id="L3464" class="LineNr">3464 </span><span class="Constant">$next-hex-int:need-to-negate</span>: -<span id="L3465" class="LineNr">3465 </span> <span class="subxS1Comment"># . ++curr</span> -<span id="L3466" class="LineNr">3466 </span> 41/increment-ECX -<span id="L3467" class="LineNr">3467 </span> <span class="subxS1Comment"># . negate = true</span> -<span id="L3468" class="LineNr">3468 </span> bb/copy-to-EBX 1/imm32/true -<span id="L3469" class="LineNr">3469 </span> <span class="subxComment"># fall through</span> -<span id="L3470" class="LineNr">3470 </span><span class="Constant">$next-hex-int:skip-whitespace</span>: -<span id="L3471" class="LineNr">3471 </span> <span class="subxComment"># spill EAX</span> -<span id="L3472" class="LineNr">3472 </span> 50/push-EAX -<span id="L3473" class="LineNr">3473 </span> <span class="subxComment"># EAX = skip-chars-matching-whitespace-in-slice(word->start, word->end)</span> -<span id="L3474" class="LineNr">3474 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3475" class="LineNr">3475 </span> 52/push-EDX -<span id="L3476" class="LineNr">3476 </span> 51/push-ECX -<span id="L3477" class="LineNr">3477 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3478" class="LineNr">3478 </span> e8/call <a href='../073next-token.subx.html#L899'>skip-chars-matching-whitespace-in-slice</a>/disp32 -<span id="L3479" class="LineNr">3479 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3480" class="LineNr">3480 </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="L3481" class="LineNr">3481 </span> <span class="subxComment"># ECX = EAX</span> -<span id="L3482" class="LineNr">3482 </span> 89/copy 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"># copy EAX to ECX</span> -<span id="L3483" class="LineNr">3483 </span> <span class="subxComment"># restore EAX</span> -<span id="L3484" class="LineNr">3484 </span> 58/pop-to-EAX -<span id="L3485" class="LineNr">3485 </span><span class="Constant">$next-hex-int:initial-0</span>: -<span id="L3486" class="LineNr">3486 </span> <span class="subxComment"># skip past leading '0x'</span> -<span id="L3487" class="LineNr">3487 </span> <span class="subxS1Comment"># . if (*curr != '0') jump to loop</span> -<span id="L3488" class="LineNr">3488 </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="L3489" class="LineNr">3489 </span> 3d/compare-EAX-and 0x30/imm32/0 -<span id="L3490" class="LineNr">3490 </span> 75/jump-if-not-equal $next-hex-int:loop/disp8 -<span id="L3491" class="LineNr">3491 </span> <span class="subxS1Comment"># . ++curr</span> -<span id="L3492" class="LineNr">3492 </span> 41/increment-ECX -<span id="L3493" class="LineNr">3493 </span><span class="Constant">$next-hex-int:initial-0x</span>: -<span id="L3494" class="LineNr">3494 </span> <span class="subxS1Comment"># . if (curr >= in->end) return result</span> -<span id="L3495" class="LineNr">3495 </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="L3496" class="LineNr">3496 </span> 73/jump-if-greater-or-equal-unsigned $next-hex-int:end/disp8 -<span id="L3497" class="LineNr">3497 </span> <span class="subxS1Comment"># . if (*curr != 'x') jump to loop # the previous '0' is still valid so doesn't need to be checked again</span> -<span id="L3498" class="LineNr">3498 </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="L3499" class="LineNr">3499 </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="L3500" class="LineNr">3500 </span> 3d/compare-EAX-and 0x78/imm32/x -<span id="L3501" class="LineNr">3501 </span> 75/jump-if-not-equal $next-hex-int:loop/disp8 -<span id="L3502" class="LineNr">3502 </span> <span class="subxS1Comment"># . ++curr</span> -<span id="L3503" class="LineNr">3503 </span> 41/increment-ECX -<span id="L3504" class="LineNr">3504 </span><span class="Constant">$next-hex-int:loop</span>: -<span id="L3505" class="LineNr">3505 </span> <span class="subxComment"># if (curr >= in->end) break</span> -<span id="L3506" class="LineNr">3506 </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="L3507" class="LineNr">3507 </span> 73/jump-if-greater-or-equal-unsigned $next-hex-int:break/disp8 -<span id="L3508" class="LineNr">3508 </span> <span class="subxComment"># if (!is-hex-digit?(*curr)) break</span> -<span id="L3509" class="LineNr">3509 </span> <span class="subxS1Comment"># . EAX = *curr</span> -<span id="L3510" class="LineNr">3510 </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="L3511" class="LineNr">3511 </span> <span class="subxS1Comment"># . EAX = is-hex-digit?(*curr)</span> -<span id="L3512" class="LineNr">3512 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3513" class="LineNr">3513 </span> 50/push-EAX -<span id="L3514" class="LineNr">3514 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3515" class="LineNr">3515 </span> e8/call <a href='../067parse-hex.subx.html#L638'>is-hex-digit?</a>/disp32 -<span id="L3516" class="LineNr">3516 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3517" class="LineNr">3517 </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="L3518" class="LineNr">3518 </span> <span class="subxS1Comment"># . if (EAX == 0) break</span> -<span id="L3519" class="LineNr">3519 </span> 3d/compare-EAX-and 0/imm32 -<span id="L3520" class="LineNr">3520 </span> 74/jump-if-equal $next-hex-int:break/disp8 -<span id="L3521" class="LineNr">3521 </span> <span class="subxComment"># EAX = from-hex-char(*curr)</span> -<span id="L3522" class="LineNr">3522 </span> <span class="subxS2Comment"># . . copy arg to EAX</span> -<span id="L3523" class="LineNr">3523 </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="L3410" class="LineNr">3410 </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="L3411" class="LineNr">3411 </span> <span class="subxS1Comment"># . epilog</span> +<span id="L3412" class="LineNr">3412 </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="L3413" class="LineNr">3413 </span> 5d/pop-to-EBP +<span id="L3414" class="LineNr">3414 </span> c3/return +<span id="L3415" class="LineNr">3415 </span> +<span id="L3416" class="LineNr">3416 </span><span class="subxTest">test-skip-until-close-paren-works-from-mid-stream</span>: +<span id="L3417" class="LineNr">3417 </span> <span class="subxS1Comment"># . prolog</span> +<span id="L3418" class="LineNr">3418 </span> 55/push-EBP +<span id="L3419" class="LineNr">3419 </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="L3420" class="LineNr">3420 </span> <span class="subxComment"># setup</span> +<span id="L3421" class="LineNr">3421 </span> <span class="subxS1Comment"># . clear-stream(_test-input-stream)</span> +<span id="L3422" class="LineNr">3422 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3423" class="LineNr">3423 </span> 68/push <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 +<span id="L3424" class="LineNr">3424 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3425" class="LineNr">3425 </span> e8/call <a href='../055stream.subx.html#L17'>clear-stream</a>/disp32 +<span id="L3426" class="LineNr">3426 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3427" class="LineNr">3427 </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="L3428" class="LineNr">3428 </span> <span class="subxS1Comment"># . write(_test-input-stream, "0 *(a b)/yz")</span> +<span id="L3429" class="LineNr">3429 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3430" class="LineNr">3430 </span> 68/push <span class="Constant">"0 *(a b)/yz"</span>/imm32 +<span id="L3431" class="LineNr">3431 </span> 68/push <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 +<span id="L3432" class="LineNr">3432 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3433" class="LineNr">3433 </span> e8/call <a href='../057write.subx.html#L24'>write</a>/disp32 +<span id="L3434" class="LineNr">3434 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3435" class="LineNr">3435 </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="L3436" class="LineNr">3436 </span> <span class="subxComment"># precondition: _test-input-stream->read == 2</span> +<span id="L3437" class="LineNr">3437 </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="L3438" class="LineNr">3438 </span> <span class="subxComment"># skip-until-close-paren(_test-input-stream)</span> +<span id="L3439" class="LineNr">3439 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3440" class="LineNr">3440 </span> 68/push <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 +<span id="L3441" class="LineNr">3441 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3442" class="LineNr">3442 </span> e8/call <a href='desugar.subx.html#L3274'>skip-until-close-paren</a>/disp32 +<span id="L3443" class="LineNr">3443 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3444" class="LineNr">3444 </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="L3445" class="LineNr">3445 </span> <span class="subxComment"># check-ints-equal(_test-input-stream->read, 7, msg)</span> +<span id="L3446" class="LineNr">3446 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3447" class="LineNr">3447 </span> 68/push <span class="Constant">"F - test-skip-until-close-paren-works-from-mid-stream"</span>/imm32 +<span id="L3448" class="LineNr">3448 </span> 68/push 7/imm32 +<span id="L3449" class="LineNr">3449 </span> b8/copy-to-EAX <a href='../061read-byte.subx.html#L293'>_test-input-stream</a>/imm32 +<span id="L3450" class="LineNr">3450 </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="L3451" class="LineNr">3451 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3452" class="LineNr">3452 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L3453" class="LineNr">3453 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3454" class="LineNr">3454 </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="L3455" class="LineNr">3455 </span> <span class="subxS1Comment"># . epilog</span> +<span id="L3456" class="LineNr">3456 </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="L3457" class="LineNr">3457 </span> 5d/pop-to-EBP +<span id="L3458" class="LineNr">3458 </span> c3/return +<span id="L3459" class="LineNr">3459 </span> +<span id="L3460" class="LineNr">3460 </span><span class="subxFunction">skip-until-close-paren-in-slice</span>: <span class="subxComment"># curr : (address byte), end : (address byte) -> new_curr/EAX</span> +<span id="L3461" class="LineNr">3461 </span> <span class="subxS1Comment"># . prolog</span> +<span id="L3462" class="LineNr">3462 </span> 55/push-EBP +<span id="L3463" class="LineNr">3463 </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="L3464" class="LineNr">3464 </span> <span class="subxS1Comment"># . save registers</span> +<span id="L3465" class="LineNr">3465 </span> 51/push-ECX +<span id="L3466" class="LineNr">3466 </span> 52/push-EDX +<span id="L3467" class="LineNr">3467 </span> <span class="subxComment"># ECX = curr</span> +<span id="L3468" class="LineNr">3468 </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="L3469" class="LineNr">3469 </span> <span class="subxComment"># EDX = end</span> +<span id="L3470" class="LineNr">3470 </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="L3471" class="LineNr">3471 </span> <span class="subxComment"># EAX = 0</span> +<span id="L3472" class="LineNr">3472 </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="L3473" class="LineNr">3473 </span> <span class="subxComment"># skip initial dquote</span> +<span id="L3474" class="LineNr">3474 </span> 41/increment-ECX +<span id="L3475" class="LineNr">3475 </span><span class="Constant">$skip-until-close-paren-in-slice:loop</span>: +<span id="L3476" class="LineNr">3476 </span> <span class="subxComment"># if (curr >= end) break</span> +<span id="L3477" class="LineNr">3477 </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="L3478" class="LineNr">3478 </span> 73/jump-if-greater-unsigned-or-equal $skip-until-close-paren-in-slice:break/disp8 +<span id="L3479" class="LineNr">3479 </span> <span class="subxComment"># AL = *curr</span> +<span id="L3480" class="LineNr">3480 </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="L3481" class="LineNr">3481 </span><span class="Constant">$skip-until-close-paren-in-slice:check-close</span>: +<span id="L3482" class="LineNr">3482 </span> <span class="subxComment"># if (EAX == ')') break</span> +<span id="L3483" class="LineNr">3483 </span> 3d/compare-EAX-and 0x29/imm32/close-paren +<span id="L3484" class="LineNr">3484 </span> 74/jump-if-equal $skip-until-close-paren-in-slice:break/disp8 +<span id="L3485" class="LineNr">3485 </span> <span class="subxComment"># ++curr</span> +<span id="L3486" class="LineNr">3486 </span> 41/increment-ECX +<span id="L3487" class="LineNr">3487 </span> eb/jump $skip-until-close-paren-in-slice:loop/disp8 +<span id="L3488" class="LineNr">3488 </span><span class="Constant">$skip-until-close-paren-in-slice:break</span>: +<span id="L3489" class="LineNr">3489 </span> <span class="subxComment"># return curr</span> +<span id="L3490" class="LineNr">3490 </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="L3491" class="LineNr">3491 </span><span class="Constant">$skip-until-close-paren-in-slice:end</span>: +<span id="L3492" class="LineNr">3492 </span> <span class="subxS1Comment"># . restore registers</span> +<span id="L3493" class="LineNr">3493 </span> 5a/pop-to-EDX +<span id="L3494" class="LineNr">3494 </span> 59/pop-to-ECX +<span id="L3495" class="LineNr">3495 </span> <span class="subxS1Comment"># . epilog</span> +<span id="L3496" class="LineNr">3496 </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="L3497" class="LineNr">3497 </span> 5d/pop-to-EBP +<span id="L3498" class="LineNr">3498 </span> c3/return +<span id="L3499" class="LineNr">3499 </span> +<span id="L3500" class="LineNr">3500 </span><span class="subxTest">test-skip-until-close-paren-in-slice</span>: +<span id="L3501" class="LineNr">3501 </span> <span class="subxS1Comment"># . prolog</span> +<span id="L3502" class="LineNr">3502 </span> 55/push-EBP +<span id="L3503" class="LineNr">3503 </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="L3504" class="LineNr">3504 </span> <span class="subxComment"># setup: (EAX..ECX) = "*(abc) def"</span> +<span id="L3505" class="LineNr">3505 </span> b8/copy-to-EAX <span class="Constant">"*(abc) def"</span>/imm32 +<span id="L3506" class="LineNr">3506 </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="L3507" class="LineNr">3507 </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="L3508" class="LineNr">3508 </span> 05/add-to-EAX 4/imm32 +<span id="L3509" class="LineNr">3509 </span> <span class="subxComment"># EAX = skip-until-close-paren-in-slice(EAX, ECX)</span> +<span id="L3510" class="LineNr">3510 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3511" class="LineNr">3511 </span> 51/push-ECX +<span id="L3512" class="LineNr">3512 </span> 50/push-EAX +<span id="L3513" class="LineNr">3513 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3514" class="LineNr">3514 </span> e8/call <a href='desugar.subx.html#L3460'>skip-until-close-paren-in-slice</a>/disp32 +<span id="L3515" class="LineNr">3515 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3516" class="LineNr">3516 </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="L3517" class="LineNr">3517 </span> <span class="subxComment"># check-ints-equal(ECX-EAX, 5, msg) # EAX is at the ')'</span> +<span id="L3518" class="LineNr">3518 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3519" class="LineNr">3519 </span> 68/push <span class="Constant">"F - test-skip-until-close-paren-in-slice"</span>/imm32 +<span id="L3520" class="LineNr">3520 </span> 68/push 5/imm32 +<span id="L3521" class="LineNr">3521 </span> <span class="subxS2Comment"># . . push ECX-EAX</span> +<span id="L3522" class="LineNr">3522 </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="L3523" class="LineNr">3523 </span> 51/push-ECX <span id="L3524" class="LineNr">3524 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3525" class="LineNr">3525 </span> e8/call <a href='../067parse-hex.subx.html#L797'>from-hex-char</a>/disp32 -<span id="L3526" class="LineNr">3526 </span> <span class="subxComment"># result = result * 16 + EAX</span> -<span id="L3527" class="LineNr">3527 </span> c1/shift 4/subop/left 3/mod/direct 7/rm32/EDI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm8 <span class="subxComment"># shift EDI left by 4 bits</span> -<span id="L3528" class="LineNr">3528 </span> 01/add 3/mod/direct 7/rm32/EDI <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"># add EAX to EDI</span> -<span id="L3529" class="LineNr">3529 </span> <span class="subxComment"># ++curr</span> -<span id="L3530" class="LineNr">3530 </span> 41/increment-ECX -<span id="L3531" class="LineNr">3531 </span> <span class="subxComment"># loop</span> -<span id="L3532" class="LineNr">3532 </span> eb/jump $next-hex-int:loop/disp8 -<span id="L3533" class="LineNr">3533 </span><span class="Constant">$next-hex-int:break</span>: -<span id="L3534" class="LineNr">3534 </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> 0/imm32 <span class="subxComment"># compare EBX</span> -<span id="L3535" class="LineNr">3535 </span> 74/jump-if-equal $next-hex-int:end/disp8 -<span id="L3536" class="LineNr">3536 </span><span class="Constant">$next-hex-int:negate</span>: -<span id="L3537" class="LineNr">3537 </span> f7 3/subop/negate 3/mod/direct 7/rm32/EDI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># negate EDI</span> -<span id="L3538" class="LineNr">3538 </span><span class="Constant">$next-hex-int:end</span>: -<span id="L3539" class="LineNr">3539 </span> <span class="subxComment"># word->start = curr</span> -<span id="L3540" class="LineNr">3540 </span> 89/copy 0/mod/indirect 6/rm32/ESI <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 *ESI</span> -<span id="L3541" class="LineNr">3541 </span> <span class="subxComment"># return EDI</span> -<span id="L3542" class="LineNr">3542 </span> 89/copy 3/mod/direct 0/rm32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 7/r32/EDI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy EDI to EAX</span> -<span id="L3543" class="LineNr">3543 </span> <span class="subxS1Comment"># . restore registers</span> -<span id="L3544" class="LineNr">3544 </span> 5f/pop-to-EDI -<span id="L3545" class="LineNr">3545 </span> 5e/pop-to-ESI -<span id="L3546" class="LineNr">3546 </span> 5b/pop-to-EBX -<span id="L3547" class="LineNr">3547 </span> 5a/pop-to-EDX -<span id="L3548" class="LineNr">3548 </span> 59/pop-to-ECX -<span id="L3549" class="LineNr">3549 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L3550" class="LineNr">3550 </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="L3551" class="LineNr">3551 </span> 5d/pop-to-EBP -<span id="L3552" class="LineNr">3552 </span> c3/return -<span id="L3553" class="LineNr">3553 </span> -<span id="L3554" class="LineNr">3554 </span><span class="Constant">$next-hex-int:abort</span>: -<span id="L3555" class="LineNr">3555 </span> <span class="subxS1Comment"># . _write(2/stderr, error)</span> -<span id="L3556" class="LineNr">3556 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3557" class="LineNr">3557 </span> 68/push <span class="Constant">"next-hex-int: invalid hex char: "</span>/imm32 -<span id="L3558" class="LineNr">3558 </span> 68/push 2/imm32/stderr -<span id="L3559" class="LineNr">3559 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3560" class="LineNr">3560 </span> e8/call <a href='../050_write.subx.html#L14'>_write</a>/disp32 -<span id="L3561" class="LineNr">3561 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3562" class="LineNr">3562 </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="L3563" class="LineNr">3563 </span> <span class="subxS1Comment"># . clear-stream(Stderr+4)</span> -<span id="L3564" class="LineNr">3564 </span> <span class="subxS2Comment"># . . save EAX</span> -<span id="L3565" class="LineNr">3565 </span> 50/push-EAX -<span id="L3566" class="LineNr">3566 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3567" class="LineNr">3567 </span> b8/copy-to-EAX <span class="SpecialChar"><a href='../065write-buffered.subx.html#L213'>Stderr</a></span>/imm32 -<span id="L3568" class="LineNr">3568 </span> 05/add-to-EAX 4/imm32 -<span id="L3569" class="LineNr">3569 </span> 50/push-EAX -<span id="L3570" class="LineNr">3570 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3571" class="LineNr">3571 </span> e8/call <a href='../055stream.subx.html#L17'>clear-stream</a>/disp32 -<span id="L3572" class="LineNr">3572 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3573" class="LineNr">3573 </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="L3574" class="LineNr">3574 </span> <span class="subxS2Comment"># . . restore EAX</span> -<span id="L3575" class="LineNr">3575 </span> 58/pop-to-EAX -<span id="L3576" class="LineNr">3576 </span> <span class="subxS1Comment"># . print-int32-buffered(Stderr, EAX)</span> -<span id="L3577" class="LineNr">3577 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3525" class="LineNr">3525 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L3526" class="LineNr">3526 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3527" class="LineNr">3527 </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="L3528" class="LineNr">3528 </span> <span class="subxS1Comment"># . epilog</span> +<span id="L3529" class="LineNr">3529 </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="L3530" class="LineNr">3530 </span> 5d/pop-to-EBP +<span id="L3531" class="LineNr">3531 </span> c3/return +<span id="L3532" class="LineNr">3532 </span> +<span id="L3533" class="LineNr">3533 </span><span class="subxTest">test-skip-until-close-paren-in-slice-ignores-spaces</span>: +<span id="L3534" class="LineNr">3534 </span> <span class="subxS1Comment"># . prolog</span> +<span id="L3535" class="LineNr">3535 </span> 55/push-EBP +<span id="L3536" class="LineNr">3536 </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="L3537" class="LineNr">3537 </span> <span class="subxComment"># setup: (EAX..ECX) = "*(a b)/yz"</span> +<span id="L3538" class="LineNr">3538 </span> b8/copy-to-EAX <span class="Constant">"*(a b)/yz"</span>/imm32 +<span id="L3539" class="LineNr">3539 </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="L3540" class="LineNr">3540 </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="L3541" class="LineNr">3541 </span> 05/add-to-EAX 4/imm32 +<span id="L3542" class="LineNr">3542 </span> <span class="subxComment"># EAX = skip-until-close-paren-in-slice(EAX, ECX)</span> +<span id="L3543" class="LineNr">3543 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3544" class="LineNr">3544 </span> 51/push-ECX +<span id="L3545" class="LineNr">3545 </span> 50/push-EAX +<span id="L3546" class="LineNr">3546 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3547" class="LineNr">3547 </span> e8/call <a href='desugar.subx.html#L3460'>skip-until-close-paren-in-slice</a>/disp32 +<span id="L3548" class="LineNr">3548 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3549" class="LineNr">3549 </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="L3550" class="LineNr">3550 </span> <span class="subxComment"># check-ints-equal(ECX-EAX, 4, msg) # EAX is at the ')'</span> +<span id="L3551" class="LineNr">3551 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3552" class="LineNr">3552 </span> 68/push <span class="Constant">"F - test-skip-until-close-paren-in-slice-ignores-spaces"</span>/imm32 +<span id="L3553" class="LineNr">3553 </span> 68/push 4/imm32 +<span id="L3554" class="LineNr">3554 </span> <span class="subxS2Comment"># . . push ECX-EAX</span> +<span id="L3555" class="LineNr">3555 </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="L3556" class="LineNr">3556 </span> 51/push-ECX +<span id="L3557" class="LineNr">3557 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3558" class="LineNr">3558 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L3559" class="LineNr">3559 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3560" class="LineNr">3560 </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="L3561" class="LineNr">3561 </span> <span class="subxS1Comment"># . epilog</span> +<span id="L3562" class="LineNr">3562 </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="L3563" class="LineNr">3563 </span> 5d/pop-to-EBP +<span id="L3564" class="LineNr">3564 </span> c3/return +<span id="L3565" class="LineNr">3565 </span> +<span id="L3566" class="LineNr">3566 </span><span class="subxTest">test-skip-until-close-paren-in-slice-stops-at-end</span>: +<span id="L3567" class="LineNr">3567 </span> <span class="subxS1Comment"># . prolog</span> +<span id="L3568" class="LineNr">3568 </span> 55/push-EBP +<span id="L3569" class="LineNr">3569 </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="L3570" class="LineNr">3570 </span> <span class="subxComment"># setup: (EAX..ECX) = "*(abc" # unbalanced dquote</span> +<span id="L3571" class="LineNr">3571 </span> b8/copy-to-EAX <span class="Constant">"*(abc"</span>/imm32 +<span id="L3572" class="LineNr">3572 </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="L3573" class="LineNr">3573 </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="L3574" class="LineNr">3574 </span> 05/add-to-EAX 4/imm32 +<span id="L3575" class="LineNr">3575 </span> <span class="subxComment"># EAX = skip-until-close-paren-in-slice(EAX, ECX)</span> +<span id="L3576" class="LineNr">3576 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3577" class="LineNr">3577 </span> 51/push-ECX <span id="L3578" class="LineNr">3578 </span> 50/push-EAX -<span id="L3579" class="LineNr">3579 </span> 68/push <span class="SpecialChar"><a href='../065write-buffered.subx.html#L213'>Stderr</a></span>/imm32 -<span id="L3580" class="LineNr">3580 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3581" class="LineNr">3581 </span> e8/call <a href='../066print-int.subx.html#L267'>print-int32-buffered</a>/disp32 -<span id="L3582" class="LineNr">3582 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3583" class="LineNr">3583 </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="L3584" class="LineNr">3584 </span> <span class="subxS1Comment"># . flush(Stderr)</span> -<span id="L3585" class="LineNr">3585 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3586" class="LineNr">3586 </span> 68/push <span class="SpecialChar"><a href='../065write-buffered.subx.html#L213'>Stderr</a></span>/imm32 -<span id="L3587" class="LineNr">3587 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3588" class="LineNr">3588 </span> e8/call <a href='../064write-byte.subx.html#L79'>flush</a>/disp32 -<span id="L3589" class="LineNr">3589 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3590" class="LineNr">3590 </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="L3591" class="LineNr">3591 </span> <span class="subxS1Comment"># . _write(2/stderr, "\n")</span> -<span id="L3592" class="LineNr">3592 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3593" class="LineNr">3593 </span> 68/push <span class="Constant">"\n"</span>/imm32 -<span id="L3594" class="LineNr">3594 </span> 68/push 2/imm32/stderr -<span id="L3595" class="LineNr">3595 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3596" class="LineNr">3596 </span> e8/call <a href='../050_write.subx.html#L14'>_write</a>/disp32 -<span id="L3597" class="LineNr">3597 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3598" class="LineNr">3598 </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="L3599" class="LineNr">3599 </span> <span class="subxS1Comment"># . syscall(exit, 1)</span> -<span id="L3600" class="LineNr">3600 </span> bb/copy-to-EBX 1/imm32 -<span id="L3601" class="LineNr">3601 </span> b8/copy-to-EAX 1/imm32/exit -<span id="L3602" class="LineNr">3602 </span> cd/syscall 0x80/imm8 -<span id="L3603" class="LineNr">3603 </span> <span class="subxComment"># never gets here</span> -<span id="L3604" class="LineNr">3604 </span> -<span id="L3605" class="LineNr">3605 </span><span class="subxTest">test-next-hex-int-single-digit</span>: -<span id="L3606" class="LineNr">3606 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L3607" class="LineNr">3607 </span> 55/push-EBP -<span id="L3608" class="LineNr">3608 </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="L3609" class="LineNr">3609 </span> <span class="subxComment"># (EAX..ECX) = "+a)"</span> -<span id="L3610" class="LineNr">3610 </span> b8/copy-to-EAX <span class="Constant">"+a)"</span>/imm32 -<span id="L3611" class="LineNr">3611 </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="L3612" class="LineNr">3612 </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="L3613" class="LineNr">3613 </span> 05/add-to-EAX 4/imm32 -<span id="L3614" class="LineNr">3614 </span> <span class="subxComment"># var slice/ECX = {EAX, ECX}</span> -<span id="L3615" class="LineNr">3615 </span> 51/push-ECX -<span id="L3616" class="LineNr">3616 </span> 50/push-EAX -<span id="L3617" class="LineNr">3617 </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="L3618" class="LineNr">3618 </span> <span class="subxComment"># EAX = next-hex-int(slice)</span> -<span id="L3619" class="LineNr">3619 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3620" class="LineNr">3620 </span> 51/push-ECX -<span id="L3621" class="LineNr">3621 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3622" class="LineNr">3622 </span> e8/call <a href='desugar.subx.html#L3430'>next-hex-int</a>/disp32 -<span id="L3623" class="LineNr">3623 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3624" class="LineNr">3624 </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="L3625" class="LineNr">3625 </span> <span class="subxComment"># check-ints-equal(EAX, 0xa, msg)</span> -<span id="L3626" class="LineNr">3626 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3627" class="LineNr">3627 </span> 68/push <span class="Constant">"F - test-next-hex-int-single-digit"</span>/imm32 -<span id="L3628" class="LineNr">3628 </span> 68/push 0xa/imm32 -<span id="L3629" class="LineNr">3629 </span> 50/push-EAX -<span id="L3630" class="LineNr">3630 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3631" class="LineNr">3631 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L3632" class="LineNr">3632 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3633" class="LineNr">3633 </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="L3634" class="LineNr">3634 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L3635" class="LineNr">3635 </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="L3636" class="LineNr">3636 </span> 5d/pop-to-EBP -<span id="L3637" class="LineNr">3637 </span> c3/return -<span id="L3638" class="LineNr">3638 </span> -<span id="L3639" class="LineNr">3639 </span><span class="subxTest">test-next-hex-int-multi-digit</span>: -<span id="L3640" class="LineNr">3640 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L3641" class="LineNr">3641 </span> 55/push-EBP -<span id="L3642" class="LineNr">3642 </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="L3643" class="LineNr">3643 </span> <span class="subxComment"># (EAX..ECX) = "+ 34a)"</span> -<span id="L3644" class="LineNr">3644 </span> b8/copy-to-EAX <span class="Constant">"+ 34a)"</span>/imm32 -<span id="L3645" class="LineNr">3645 </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="L3646" class="LineNr">3646 </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="L3647" class="LineNr">3647 </span> 05/add-to-EAX 4/imm32 -<span id="L3648" class="LineNr">3648 </span> <span class="subxComment"># var slice/ECX = {EAX, ECX}</span> -<span id="L3649" class="LineNr">3649 </span> 51/push-ECX -<span id="L3650" class="LineNr">3650 </span> 50/push-EAX -<span id="L3651" class="LineNr">3651 </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="L3652" class="LineNr">3652 </span> <span class="subxComment"># EAX = next-hex-int(slice)</span> -<span id="L3653" class="LineNr">3653 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3654" class="LineNr">3654 </span> 51/push-ECX -<span id="L3655" class="LineNr">3655 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3656" class="LineNr">3656 </span> e8/call <a href='desugar.subx.html#L3430'>next-hex-int</a>/disp32 -<span id="L3657" class="LineNr">3657 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3658" class="LineNr">3658 </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="L3659" class="LineNr">3659 </span> <span class="subxComment"># check-ints-equal(EAX, 0x34a, msg)</span> -<span id="L3660" class="LineNr">3660 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3661" class="LineNr">3661 </span> 68/push <span class="Constant">"F - test-next-hex-int-multi-digit"</span>/imm32 -<span id="L3662" class="LineNr">3662 </span> 68/push 0x34a/imm32 -<span id="L3663" class="LineNr">3663 </span> 50/push-EAX -<span id="L3664" class="LineNr">3664 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3665" class="LineNr">3665 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L3666" class="LineNr">3666 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3667" class="LineNr">3667 </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="L3668" class="LineNr">3668 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L3669" class="LineNr">3669 </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="L3670" class="LineNr">3670 </span> 5d/pop-to-EBP -<span id="L3671" class="LineNr">3671 </span> c3/return -<span id="L3672" class="LineNr">3672 </span> -<span id="L3673" class="LineNr">3673 </span><span class="subxTest">test-next-hex-int-0x-prefix</span>: -<span id="L3674" class="LineNr">3674 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L3675" class="LineNr">3675 </span> 55/push-EBP -<span id="L3676" class="LineNr">3676 </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="L3677" class="LineNr">3677 </span> <span class="subxComment"># (EAX..ECX) = "+0x34)"</span> -<span id="L3678" class="LineNr">3678 </span> b8/copy-to-EAX <span class="Constant">"+0x34)"</span>/imm32 -<span id="L3679" class="LineNr">3679 </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="L3680" class="LineNr">3680 </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="L3681" class="LineNr">3681 </span> 05/add-to-EAX 4/imm32 -<span id="L3682" class="LineNr">3682 </span> <span class="subxComment"># var slice/ECX = {EAX, ECX}</span> -<span id="L3683" class="LineNr">3683 </span> 51/push-ECX -<span id="L3684" class="LineNr">3684 </span> 50/push-EAX -<span id="L3685" class="LineNr">3685 </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="L3686" class="LineNr">3686 </span> <span class="subxComment"># EAX = next-hex-int(slice)</span> -<span id="L3687" class="LineNr">3687 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3688" class="LineNr">3688 </span> 51/push-ECX -<span id="L3689" class="LineNr">3689 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3690" class="LineNr">3690 </span> e8/call <a href='desugar.subx.html#L3430'>next-hex-int</a>/disp32 -<span id="L3691" class="LineNr">3691 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3692" class="LineNr">3692 </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="L3693" class="LineNr">3693 </span> <span class="subxComment"># check-ints-equal(EAX, 0x34, msg)</span> -<span id="L3694" class="LineNr">3694 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3695" class="LineNr">3695 </span> 68/push <span class="Constant">"F - test-next-hex-int-0x-prefix"</span>/imm32 -<span id="L3696" class="LineNr">3696 </span> 68/push 0x34/imm32 -<span id="L3697" class="LineNr">3697 </span> 50/push-EAX -<span id="L3698" class="LineNr">3698 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3699" class="LineNr">3699 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L3700" class="LineNr">3700 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3701" class="LineNr">3701 </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="L3702" class="LineNr">3702 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L3703" class="LineNr">3703 </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="L3704" class="LineNr">3704 </span> 5d/pop-to-EBP -<span id="L3705" class="LineNr">3705 </span> c3/return -<span id="L3706" class="LineNr">3706 </span> -<span id="L3707" class="LineNr">3707 </span><span class="subxTest">test-next-hex-int-zero</span>: -<span id="L3708" class="LineNr">3708 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L3709" class="LineNr">3709 </span> 55/push-EBP -<span id="L3710" class="LineNr">3710 </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="L3711" class="LineNr">3711 </span> <span class="subxComment"># (EAX..ECX) = "+0)"</span> -<span id="L3712" class="LineNr">3712 </span> b8/copy-to-EAX <span class="Constant">"+0)"</span>/imm32 -<span id="L3713" class="LineNr">3713 </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="L3714" class="LineNr">3714 </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="L3715" class="LineNr">3715 </span> 05/add-to-EAX 4/imm32 -<span id="L3716" class="LineNr">3716 </span> <span class="subxComment"># var slice/ECX = {EAX, ECX}</span> -<span id="L3717" class="LineNr">3717 </span> 51/push-ECX -<span id="L3718" class="LineNr">3718 </span> 50/push-EAX -<span id="L3719" class="LineNr">3719 </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="L3720" class="LineNr">3720 </span> <span class="subxComment"># EAX = next-hex-int(slice)</span> -<span id="L3721" class="LineNr">3721 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3722" class="LineNr">3722 </span> 51/push-ECX -<span id="L3723" class="LineNr">3723 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3724" class="LineNr">3724 </span> e8/call <a href='desugar.subx.html#L3430'>next-hex-int</a>/disp32 -<span id="L3725" class="LineNr">3725 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3726" class="LineNr">3726 </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="L3727" class="LineNr">3727 </span> <span class="subxComment"># check-ints-equal(EAX, 0, msg)</span> +<span id="L3579" class="LineNr">3579 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3580" class="LineNr">3580 </span> e8/call <a href='desugar.subx.html#L3460'>skip-until-close-paren-in-slice</a>/disp32 +<span id="L3581" class="LineNr">3581 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3582" class="LineNr">3582 </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="L3583" class="LineNr">3583 </span> <span class="subxComment"># check-ints-equal(ECX-EAX, 0, msg) # skipped to end of slice</span> +<span id="L3584" class="LineNr">3584 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3585" class="LineNr">3585 </span> 68/push <span class="Constant">"F - test-skip-until-close-paren-in-slice-stops-at-end"</span>/imm32 +<span id="L3586" class="LineNr">3586 </span> 68/push 0/imm32 +<span id="L3587" class="LineNr">3587 </span> <span class="subxS2Comment"># . . push ECX-EAX</span> +<span id="L3588" class="LineNr">3588 </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="L3589" class="LineNr">3589 </span> 51/push-ECX +<span id="L3590" class="LineNr">3590 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3591" class="LineNr">3591 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L3592" class="LineNr">3592 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3593" class="LineNr">3593 </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="L3594" class="LineNr">3594 </span> <span class="subxS1Comment"># . epilog</span> +<span id="L3595" class="LineNr">3595 </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="L3596" class="LineNr">3596 </span> 5d/pop-to-EBP +<span id="L3597" class="LineNr">3597 </span> c3/return +<span id="L3598" class="LineNr">3598 </span> +<span id="L3599" class="LineNr">3599 </span><span class="subxComment"># assumes 'in' starts with optional '+' or '-', optional whitespace, and an unsigned integer</span> +<span id="L3600" class="LineNr">3600 </span><span class="subxComment"># returns the value of the integer</span> +<span id="L3601" class="LineNr">3601 </span><span class="subxComment"># side-effect: modifies 'in' to skip past the integer</span> +<span id="L3602" class="LineNr">3602 </span><span class="subxFunction">next-hex-int</span>: <span class="subxComment"># in : (address slice) -> result/EAX</span> +<span id="L3603" class="LineNr">3603 </span> <span class="subxS1Comment"># . prolog</span> +<span id="L3604" class="LineNr">3604 </span> 55/push-EBP +<span id="L3605" class="LineNr">3605 </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="L3606" class="LineNr">3606 </span> <span class="subxS1Comment"># . save registers</span> +<span id="L3607" class="LineNr">3607 </span> 51/push-ECX +<span id="L3608" class="LineNr">3608 </span> 52/push-EDX +<span id="L3609" class="LineNr">3609 </span> 53/push-EBX +<span id="L3610" class="LineNr">3610 </span> 56/push-ESI +<span id="L3611" class="LineNr">3611 </span> 57/push-EDI +<span id="L3612" class="LineNr">3612 </span> <span class="subxComment"># result/EDI = 0</span> +<span id="L3613" class="LineNr">3613 </span> 31/xor 3/mod/direct 7/rm32/EDI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 7/r32/EDI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># clear EDI</span> +<span id="L3614" class="LineNr">3614 </span> <span class="subxComment"># ESI = in</span> +<span id="L3615" class="LineNr">3615 </span> 8b/copy 1/mod/*+disp8 5/rm32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/ESI 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(EBP+8) to ESI</span> +<span id="L3616" class="LineNr">3616 </span> <span class="subxComment"># EDX = in->end</span> +<span id="L3617" class="LineNr">3617 </span> 8b/copy 1/mod/*+disp8 6/rm32/ESI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/EDX 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ESI+4) to EDX</span> +<span id="L3618" class="LineNr">3618 </span> <span class="subxComment"># curr/ECX = in->start</span> +<span id="L3619" class="LineNr">3619 </span> 8b/copy 0/mod/indirect 6/rm32/ESI <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 *ESI to ECX</span> +<span id="L3620" class="LineNr">3620 </span> <span class="subxComment"># negate?/EBX = false</span> +<span id="L3621" class="LineNr">3621 </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="L3622" class="LineNr">3622 </span> <span class="subxComment"># EAX = *curr</span> +<span id="L3623" class="LineNr">3623 </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="L3624" class="LineNr">3624 </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="L3625" class="LineNr">3625 </span><span class="Constant">$next-hex-int:positive</span>: +<span id="L3626" class="LineNr">3626 </span> <span class="subxComment"># if (*curr == '+') ++curr</span> +<span id="L3627" class="LineNr">3627 </span> 3d/compare-EAX-and 0x2b/imm32/+ +<span id="L3628" class="LineNr">3628 </span> 75/jump-if-not-equal $next-hex-int:negative/disp8 +<span id="L3629" class="LineNr">3629 </span> <span class="subxS1Comment"># . ++curr</span> +<span id="L3630" class="LineNr">3630 </span> 41/increment-ECX +<span id="L3631" class="LineNr">3631 </span> eb/jump $next-hex-int:skip-whitespace/disp8 +<span id="L3632" class="LineNr">3632 </span><span class="Constant">$next-hex-int:negative</span>: +<span id="L3633" class="LineNr">3633 </span> <span class="subxComment"># else if (*curr == '-') ++curr, negate = true</span> +<span id="L3634" class="LineNr">3634 </span> 3d/compare-EAX-and 0x2d/imm32/- +<span id="L3635" class="LineNr">3635 </span> 75/jump-if-not-equal $next-hex-int:skip-whitespace/disp8 +<span id="L3636" class="LineNr">3636 </span><span class="Constant">$next-hex-int:need-to-negate</span>: +<span id="L3637" class="LineNr">3637 </span> <span class="subxS1Comment"># . ++curr</span> +<span id="L3638" class="LineNr">3638 </span> 41/increment-ECX +<span id="L3639" class="LineNr">3639 </span> <span class="subxS1Comment"># . negate = true</span> +<span id="L3640" class="LineNr">3640 </span> bb/copy-to-EBX 1/imm32/true +<span id="L3641" class="LineNr">3641 </span> <span class="subxComment"># fall through</span> +<span id="L3642" class="LineNr">3642 </span><span class="Constant">$next-hex-int:skip-whitespace</span>: +<span id="L3643" class="LineNr">3643 </span> <span class="subxComment"># spill EAX</span> +<span id="L3644" class="LineNr">3644 </span> 50/push-EAX +<span id="L3645" class="LineNr">3645 </span> <span class="subxComment"># EAX = skip-chars-matching-whitespace-in-slice(word->start, word->end)</span> +<span id="L3646" class="LineNr">3646 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3647" class="LineNr">3647 </span> 52/push-EDX +<span id="L3648" class="LineNr">3648 </span> 51/push-ECX +<span id="L3649" class="LineNr">3649 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3650" class="LineNr">3650 </span> e8/call <a href='../073next-token.subx.html#L899'>skip-chars-matching-whitespace-in-slice</a>/disp32 +<span id="L3651" class="LineNr">3651 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3652" class="LineNr">3652 </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="L3653" class="LineNr">3653 </span> <span class="subxComment"># ECX = EAX</span> +<span id="L3654" class="LineNr">3654 </span> 89/copy 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"># copy EAX to ECX</span> +<span id="L3655" class="LineNr">3655 </span> <span class="subxComment"># restore EAX</span> +<span id="L3656" class="LineNr">3656 </span> 58/pop-to-EAX +<span id="L3657" class="LineNr">3657 </span><span class="Constant">$next-hex-int:initial-0</span>: +<span id="L3658" class="LineNr">3658 </span> <span class="subxComment"># skip past leading '0x'</span> +<span id="L3659" class="LineNr">3659 </span> <span class="subxS1Comment"># . if (*curr != '0') jump to loop</span> +<span id="L3660" class="LineNr">3660 </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="L3661" class="LineNr">3661 </span> 3d/compare-EAX-and 0x30/imm32/0 +<span id="L3662" class="LineNr">3662 </span> 75/jump-if-not-equal $next-hex-int:loop/disp8 +<span id="L3663" class="LineNr">3663 </span> <span class="subxS1Comment"># . ++curr</span> +<span id="L3664" class="LineNr">3664 </span> 41/increment-ECX +<span id="L3665" class="LineNr">3665 </span><span class="Constant">$next-hex-int:initial-0x</span>: +<span id="L3666" class="LineNr">3666 </span> <span class="subxS1Comment"># . if (curr >= in->end) return result</span> +<span id="L3667" class="LineNr">3667 </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="L3668" class="LineNr">3668 </span> 73/jump-if-greater-or-equal-unsigned $next-hex-int:end/disp8 +<span id="L3669" class="LineNr">3669 </span> <span class="subxS1Comment"># . if (*curr != 'x') jump to loop # the previous '0' is still valid so doesn't need to be checked again</span> +<span id="L3670" class="LineNr">3670 </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="L3671" class="LineNr">3671 </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="L3672" class="LineNr">3672 </span> 3d/compare-EAX-and 0x78/imm32/x +<span id="L3673" class="LineNr">3673 </span> 75/jump-if-not-equal $next-hex-int:loop/disp8 +<span id="L3674" class="LineNr">3674 </span> <span class="subxS1Comment"># . ++curr</span> +<span id="L3675" class="LineNr">3675 </span> 41/increment-ECX +<span id="L3676" class="LineNr">3676 </span><span class="Constant">$next-hex-int:loop</span>: +<span id="L3677" class="LineNr">3677 </span> <span class="subxComment"># if (curr >= in->end) break</span> +<span id="L3678" class="LineNr">3678 </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="L3679" class="LineNr">3679 </span> 73/jump-if-greater-or-equal-unsigned $next-hex-int:break/disp8 +<span id="L3680" class="LineNr">3680 </span> <span class="subxComment"># if (!is-hex-digit?(*curr)) break</span> +<span id="L3681" class="LineNr">3681 </span> <span class="subxS1Comment"># . EAX = *curr</span> +<span id="L3682" class="LineNr">3682 </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="L3683" class="LineNr">3683 </span> <span class="subxS1Comment"># . EAX = is-hex-digit?(*curr)</span> +<span id="L3684" class="LineNr">3684 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3685" class="LineNr">3685 </span> 50/push-EAX +<span id="L3686" class="LineNr">3686 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3687" class="LineNr">3687 </span> e8/call <a href='../067parse-hex.subx.html#L638'>is-hex-digit?</a>/disp32 +<span id="L3688" class="LineNr">3688 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3689" class="LineNr">3689 </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="L3690" class="LineNr">3690 </span> <span class="subxS1Comment"># . if (EAX == 0) break</span> +<span id="L3691" class="LineNr">3691 </span> 3d/compare-EAX-and 0/imm32 +<span id="L3692" class="LineNr">3692 </span> 74/jump-if-equal $next-hex-int:break/disp8 +<span id="L3693" class="LineNr">3693 </span> <span class="subxComment"># EAX = from-hex-char(*curr)</span> +<span id="L3694" class="LineNr">3694 </span> <span class="subxS2Comment"># . . copy arg to EAX</span> +<span id="L3695" class="LineNr">3695 </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="L3696" class="LineNr">3696 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3697" class="LineNr">3697 </span> e8/call <a href='../067parse-hex.subx.html#L797'>from-hex-char</a>/disp32 +<span id="L3698" class="LineNr">3698 </span> <span class="subxComment"># result = result * 16 + EAX</span> +<span id="L3699" class="LineNr">3699 </span> c1/shift 4/subop/left 3/mod/direct 7/rm32/EDI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm8 <span class="subxComment"># shift EDI left by 4 bits</span> +<span id="L3700" class="LineNr">3700 </span> 01/add 3/mod/direct 7/rm32/EDI <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"># add EAX to EDI</span> +<span id="L3701" class="LineNr">3701 </span> <span class="subxComment"># ++curr</span> +<span id="L3702" class="LineNr">3702 </span> 41/increment-ECX +<span id="L3703" class="LineNr">3703 </span> <span class="subxComment"># loop</span> +<span id="L3704" class="LineNr">3704 </span> eb/jump $next-hex-int:loop/disp8 +<span id="L3705" class="LineNr">3705 </span><span class="Constant">$next-hex-int:break</span>: +<span id="L3706" class="LineNr">3706 </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> 0/imm32 <span class="subxComment"># compare EBX</span> +<span id="L3707" class="LineNr">3707 </span> 74/jump-if-equal $next-hex-int:end/disp8 +<span id="L3708" class="LineNr">3708 </span><span class="Constant">$next-hex-int:negate</span>: +<span id="L3709" class="LineNr">3709 </span> f7 3/subop/negate 3/mod/direct 7/rm32/EDI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># negate EDI</span> +<span id="L3710" class="LineNr">3710 </span><span class="Constant">$next-hex-int:end</span>: +<span id="L3711" class="LineNr">3711 </span> <span class="subxComment"># word->start = curr</span> +<span id="L3712" class="LineNr">3712 </span> 89/copy 0/mod/indirect 6/rm32/ESI <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 *ESI</span> +<span id="L3713" class="LineNr">3713 </span> <span class="subxComment"># return EDI</span> +<span id="L3714" class="LineNr">3714 </span> 89/copy 3/mod/direct 0/rm32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 7/r32/EDI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy EDI to EAX</span> +<span id="L3715" class="LineNr">3715 </span> <span class="subxS1Comment"># . restore registers</span> +<span id="L3716" class="LineNr">3716 </span> 5f/pop-to-EDI +<span id="L3717" class="LineNr">3717 </span> 5e/pop-to-ESI +<span id="L3718" class="LineNr">3718 </span> 5b/pop-to-EBX +<span id="L3719" class="LineNr">3719 </span> 5a/pop-to-EDX +<span id="L3720" class="LineNr">3720 </span> 59/pop-to-ECX +<span id="L3721" class="LineNr">3721 </span> <span class="subxS1Comment"># . epilog</span> +<span id="L3722" class="LineNr">3722 </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="L3723" class="LineNr">3723 </span> 5d/pop-to-EBP +<span id="L3724" class="LineNr">3724 </span> c3/return +<span id="L3725" class="LineNr">3725 </span> +<span id="L3726" class="LineNr">3726 </span><span class="Constant">$next-hex-int:abort</span>: +<span id="L3727" class="LineNr">3727 </span> <span class="subxS1Comment"># . _write(2/stderr, error)</span> <span id="L3728" class="LineNr">3728 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3729" class="LineNr">3729 </span> 68/push <span class="Constant">"F - test-next-hex-int-zero"</span>/imm32 -<span id="L3730" class="LineNr">3730 </span> 68/push 0/imm32 -<span id="L3731" class="LineNr">3731 </span> 50/push-EAX -<span id="L3732" class="LineNr">3732 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3733" class="LineNr">3733 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L3734" class="LineNr">3734 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3735" class="LineNr">3735 </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="L3736" class="LineNr">3736 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L3737" class="LineNr">3737 </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="L3738" class="LineNr">3738 </span> 5d/pop-to-EBP -<span id="L3739" class="LineNr">3739 </span> c3/return -<span id="L3740" class="LineNr">3740 </span> -<span id="L3741" class="LineNr">3741 </span><span class="subxTest">test-next-hex-int-0-prefix</span>: -<span id="L3742" class="LineNr">3742 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L3743" class="LineNr">3743 </span> 55/push-EBP -<span id="L3744" class="LineNr">3744 </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="L3745" class="LineNr">3745 </span> <span class="subxComment"># (EAX..ECX) = "+ 03)"</span> -<span id="L3746" class="LineNr">3746 </span> b8/copy-to-EAX <span class="Constant">"+ 03)"</span>/imm32 -<span id="L3747" class="LineNr">3747 </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="L3748" class="LineNr">3748 </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="L3749" class="LineNr">3749 </span> 05/add-to-EAX 4/imm32 -<span id="L3750" class="LineNr">3750 </span> <span class="subxComment"># var slice/ECX = {EAX, ECX}</span> -<span id="L3751" class="LineNr">3751 </span> 51/push-ECX -<span id="L3752" class="LineNr">3752 </span> 50/push-EAX -<span id="L3753" class="LineNr">3753 </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="L3754" class="LineNr">3754 </span> <span class="subxComment"># EAX = next-hex-int(slice)</span> -<span id="L3755" class="LineNr">3755 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3756" class="LineNr">3756 </span> 51/push-ECX -<span id="L3757" class="LineNr">3757 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3758" class="LineNr">3758 </span> e8/call <a href='desugar.subx.html#L3430'>next-hex-int</a>/disp32 -<span id="L3759" class="LineNr">3759 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3760" class="LineNr">3760 </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="L3761" class="LineNr">3761 </span> <span class="subxComment"># check-ints-equal(EAX, 3, msg)</span> -<span id="L3762" class="LineNr">3762 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3763" class="LineNr">3763 </span> 68/push <span class="Constant">"F - test-next-hex-int-0-prefix"</span>/imm32 -<span id="L3764" class="LineNr">3764 </span> 68/push 3/imm32 -<span id="L3765" class="LineNr">3765 </span> 50/push-EAX -<span id="L3766" class="LineNr">3766 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3767" class="LineNr">3767 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L3768" class="LineNr">3768 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3769" class="LineNr">3769 </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="L3770" class="LineNr">3770 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L3771" class="LineNr">3771 </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="L3772" class="LineNr">3772 </span> 5d/pop-to-EBP -<span id="L3773" class="LineNr">3773 </span> c3/return -<span id="L3774" class="LineNr">3774 </span> -<span id="L3775" class="LineNr">3775 </span><span class="subxTest">test-next-hex-int-negative</span>: -<span id="L3776" class="LineNr">3776 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L3777" class="LineNr">3777 </span> 55/push-EBP -<span id="L3778" class="LineNr">3778 </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="L3779" class="LineNr">3779 </span> <span class="subxComment"># (EAX..ECX) = "-03)"</span> -<span id="L3780" class="LineNr">3780 </span> b8/copy-to-EAX <span class="Constant">"-03)"</span>/imm32 -<span id="L3781" class="LineNr">3781 </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="L3782" class="LineNr">3782 </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="L3783" class="LineNr">3783 </span> 05/add-to-EAX 4/imm32 -<span id="L3784" class="LineNr">3784 </span> <span class="subxComment"># var slice/ECX = {EAX, ECX}</span> -<span id="L3785" class="LineNr">3785 </span> 51/push-ECX -<span id="L3786" class="LineNr">3786 </span> 50/push-EAX -<span id="L3787" class="LineNr">3787 </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="L3788" class="LineNr">3788 </span> <span class="subxComment"># EAX = next-hex-int(slice)</span> -<span id="L3789" class="LineNr">3789 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3790" class="LineNr">3790 </span> 51/push-ECX -<span id="L3791" class="LineNr">3791 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3792" class="LineNr">3792 </span> e8/call <a href='desugar.subx.html#L3430'>next-hex-int</a>/disp32 -<span id="L3793" class="LineNr">3793 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3794" class="LineNr">3794 </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="L3795" class="LineNr">3795 </span> <span class="subxComment"># check-ints-equal(EAX, -3, msg)</span> -<span id="L3796" class="LineNr">3796 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3797" class="LineNr">3797 </span> 68/push <span class="Constant">"F - test-next-hex-int-negative"</span>/imm32 -<span id="L3798" class="LineNr">3798 </span> 68/push -3/imm32 -<span id="L3799" class="LineNr">3799 </span> 50/push-EAX -<span id="L3800" class="LineNr">3800 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3801" class="LineNr">3801 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L3802" class="LineNr">3802 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3803" class="LineNr">3803 </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="L3804" class="LineNr">3804 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L3805" class="LineNr">3805 </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="L3806" class="LineNr">3806 </span> 5d/pop-to-EBP -<span id="L3807" class="LineNr">3807 </span> c3/return -<span id="L3808" class="LineNr">3808 </span> -<span id="L3809" class="LineNr">3809 </span><span class="subxTest">test-next-hex-int-negative-with-space</span>: -<span id="L3810" class="LineNr">3810 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L3811" class="LineNr">3811 </span> 55/push-EBP -<span id="L3812" class="LineNr">3812 </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="L3813" class="LineNr">3813 </span> <span class="subxComment"># (EAX..ECX) = "- 03)"</span> -<span id="L3814" class="LineNr">3814 </span> b8/copy-to-EAX <span class="Constant">"- 03)"</span>/imm32 -<span id="L3815" class="LineNr">3815 </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="L3816" class="LineNr">3816 </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="L3817" class="LineNr">3817 </span> 05/add-to-EAX 4/imm32 -<span id="L3818" class="LineNr">3818 </span> <span class="subxComment"># var slice/ECX = {EAX, ECX}</span> -<span id="L3819" class="LineNr">3819 </span> 51/push-ECX -<span id="L3820" class="LineNr">3820 </span> 50/push-EAX -<span id="L3821" class="LineNr">3821 </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="L3822" class="LineNr">3822 </span> <span class="subxComment"># EAX = next-hex-int(slice)</span> -<span id="L3823" class="LineNr">3823 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3824" class="LineNr">3824 </span> 51/push-ECX -<span id="L3825" class="LineNr">3825 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3826" class="LineNr">3826 </span> e8/call <a href='desugar.subx.html#L3430'>next-hex-int</a>/disp32 -<span id="L3827" class="LineNr">3827 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3828" class="LineNr">3828 </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="L3829" class="LineNr">3829 </span> <span class="subxComment"># check-ints-equal(EAX, -3, msg)</span> -<span id="L3830" class="LineNr">3830 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3831" class="LineNr">3831 </span> 68/push <span class="Constant">"F - test-next-hex-int-negative-with-space"</span>/imm32 -<span id="L3832" class="LineNr">3832 </span> 68/push -3/imm32 -<span id="L3833" class="LineNr">3833 </span> 50/push-EAX -<span id="L3834" class="LineNr">3834 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3835" class="LineNr">3835 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L3836" class="LineNr">3836 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3837" class="LineNr">3837 </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="L3838" class="LineNr">3838 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L3839" class="LineNr">3839 </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="L3840" class="LineNr">3840 </span> 5d/pop-to-EBP -<span id="L3841" class="LineNr">3841 </span> c3/return -<span id="L3842" class="LineNr">3842 </span> -<span id="L3843" class="LineNr">3843 </span><span class="subxComment"># assumes 'in' starts a positive unsigned integer</span> -<span id="L3844" class="LineNr">3844 </span><span class="subxComment"># returns the value of the integer</span> -<span id="L3845" class="LineNr">3845 </span><span class="subxComment"># side-effect: modifies 'in' to skip past the integer</span> -<span id="L3846" class="LineNr">3846 </span><span class="subxFunction">next-positive-hex-int</span>: <span class="subxComment"># in : (address slice) -> result/EAX</span> -<span id="L3847" class="LineNr">3847 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L3848" class="LineNr">3848 </span> 55/push-EBP -<span id="L3849" class="LineNr">3849 </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="L3850" class="LineNr">3850 </span> <span class="subxS1Comment"># . save registers</span> -<span id="L3851" class="LineNr">3851 </span> 51/push-ECX -<span id="L3852" class="LineNr">3852 </span> 52/push-EDX -<span id="L3853" class="LineNr">3853 </span> 53/push-EBX -<span id="L3854" class="LineNr">3854 </span> 56/push-ESI -<span id="L3855" class="LineNr">3855 </span> 57/push-EDI -<span id="L3856" class="LineNr">3856 </span> <span class="subxComment"># result/EDI = 0</span> -<span id="L3857" class="LineNr">3857 </span> 31/xor 3/mod/direct 7/rm32/EDI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 7/r32/EDI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># clear EDI</span> -<span id="L3858" class="LineNr">3858 </span> <span class="subxComment"># ESI = in</span> -<span id="L3859" class="LineNr">3859 </span> 8b/copy 1/mod/*+disp8 5/rm32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/ESI 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(EBP+8) to ESI</span> -<span id="L3860" class="LineNr">3860 </span> <span class="subxComment"># EDX = in->end</span> -<span id="L3861" class="LineNr">3861 </span> 8b/copy 1/mod/*+disp8 6/rm32/ESI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/EDX 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ESI+4) to EDX</span> -<span id="L3862" class="LineNr">3862 </span> <span class="subxComment"># curr/ECX = in->start</span> -<span id="L3863" class="LineNr">3863 </span> 8b/copy 0/mod/indirect 6/rm32/ESI <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 *ESI to ECX</span> -<span id="L3864" class="LineNr">3864 </span> <span class="subxComment"># negate?/EBX = false</span> -<span id="L3865" class="LineNr">3865 </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="L3866" class="LineNr">3866 </span> <span class="subxComment"># EAX = *curr</span> -<span id="L3867" class="LineNr">3867 </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="L3868" class="LineNr">3868 </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="L3869" class="LineNr">3869 </span><span class="Constant">$next-positive-hex-int:initial-0</span>: -<span id="L3870" class="LineNr">3870 </span> <span class="subxComment"># skip past leading '0x'</span> -<span id="L3871" class="LineNr">3871 </span> <span class="subxS1Comment"># . if (*curr != '0') jump to loop</span> -<span id="L3872" class="LineNr">3872 </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="L3873" class="LineNr">3873 </span> 3d/compare-EAX-and 0x30/imm32/0 -<span id="L3874" class="LineNr">3874 </span> 75/jump-if-not-equal $next-positive-hex-int:loop/disp8 -<span id="L3875" class="LineNr">3875 </span> <span class="subxS1Comment"># . ++curr</span> -<span id="L3876" class="LineNr">3876 </span> 41/increment-ECX -<span id="L3877" class="LineNr">3877 </span><span class="Constant">$next-positive-hex-int:initial-0x</span>: -<span id="L3878" class="LineNr">3878 </span> <span class="subxS1Comment"># . if (curr >= in->end) return result</span> -<span id="L3879" class="LineNr">3879 </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="L3880" class="LineNr">3880 </span> 73/jump-if-greater-or-equal-unsigned $next-positive-hex-int:end/disp8 -<span id="L3881" class="LineNr">3881 </span> <span class="subxS1Comment"># . if (*curr != 'x') jump to loop # the previous '0' is still valid so doesn't need to be checked again</span> -<span id="L3882" class="LineNr">3882 </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="L3883" class="LineNr">3883 </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="L3884" class="LineNr">3884 </span> 3d/compare-EAX-and 0x78/imm32/x -<span id="L3885" class="LineNr">3885 </span> 75/jump-if-not-equal $next-positive-hex-int:loop/disp8 -<span id="L3886" class="LineNr">3886 </span> <span class="subxS1Comment"># . ++curr</span> -<span id="L3887" class="LineNr">3887 </span> 41/increment-ECX -<span id="L3888" class="LineNr">3888 </span><span class="Constant">$next-positive-hex-int:loop</span>: -<span id="L3889" class="LineNr">3889 </span> <span class="subxComment"># if (curr >= in->end) break</span> -<span id="L3890" class="LineNr">3890 </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="L3891" class="LineNr">3891 </span> 73/jump-if-greater-or-equal-unsigned $next-positive-hex-int:end/disp8 -<span id="L3892" class="LineNr">3892 </span> <span class="subxComment"># if (!is-hex-digit?(*curr)) break</span> -<span id="L3893" class="LineNr">3893 </span> <span class="subxS1Comment"># . EAX = *curr</span> -<span id="L3894" class="LineNr">3894 </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="L3895" class="LineNr">3895 </span> <span class="subxS1Comment"># . EAX = is-hex-digit?(*curr)</span> -<span id="L3896" class="LineNr">3896 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3897" class="LineNr">3897 </span> 50/push-EAX -<span id="L3898" class="LineNr">3898 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3899" class="LineNr">3899 </span> e8/call <a href='../067parse-hex.subx.html#L638'>is-hex-digit?</a>/disp32 -<span id="L3900" class="LineNr">3900 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3901" class="LineNr">3901 </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="L3902" class="LineNr">3902 </span> <span class="subxS1Comment"># . if (EAX == 0) break</span> -<span id="L3903" class="LineNr">3903 </span> 3d/compare-EAX-and 0/imm32 -<span id="L3904" class="LineNr">3904 </span> 74/jump-if-equal $next-positive-hex-int:end/disp8 -<span id="L3905" class="LineNr">3905 </span> <span class="subxComment"># EAX = from-hex-char(*curr)</span> -<span id="L3906" class="LineNr">3906 </span> <span class="subxS2Comment"># . . copy arg to EAX</span> -<span id="L3907" class="LineNr">3907 </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="L3908" class="LineNr">3908 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3909" class="LineNr">3909 </span> e8/call <a href='../067parse-hex.subx.html#L797'>from-hex-char</a>/disp32 -<span id="L3910" class="LineNr">3910 </span> <span class="subxComment"># result = result * 16 + EAX</span> -<span id="L3911" class="LineNr">3911 </span> c1/shift 4/subop/left 3/mod/direct 7/rm32/EDI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm8 <span class="subxComment"># shift EDI left by 4 bits</span> -<span id="L3912" class="LineNr">3912 </span> 01/add 3/mod/direct 7/rm32/EDI <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"># add EAX to EDI</span> -<span id="L3913" class="LineNr">3913 </span> <span class="subxComment"># ++curr</span> -<span id="L3914" class="LineNr">3914 </span> 41/increment-ECX -<span id="L3915" class="LineNr">3915 </span> <span class="subxComment"># loop</span> -<span id="L3916" class="LineNr">3916 </span> eb/jump $next-positive-hex-int:loop/disp8 -<span id="L3917" class="LineNr">3917 </span><span class="Constant">$next-positive-hex-int:end</span>: -<span id="L3918" class="LineNr">3918 </span> <span class="subxComment"># word->start = curr</span> -<span id="L3919" class="LineNr">3919 </span> 89/copy 0/mod/indirect 6/rm32/ESI <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 *ESI</span> -<span id="L3920" class="LineNr">3920 </span> <span class="subxComment"># return EDI</span> -<span id="L3921" class="LineNr">3921 </span> 89/copy 3/mod/direct 0/rm32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 7/r32/EDI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy EDI to EAX</span> -<span id="L3922" class="LineNr">3922 </span> <span class="subxS1Comment"># . restore registers</span> -<span id="L3923" class="LineNr">3923 </span> 5f/pop-to-EDI -<span id="L3924" class="LineNr">3924 </span> 5e/pop-to-ESI -<span id="L3925" class="LineNr">3925 </span> 5b/pop-to-EBX -<span id="L3926" class="LineNr">3926 </span> 5a/pop-to-EDX -<span id="L3927" class="LineNr">3927 </span> 59/pop-to-ECX -<span id="L3928" class="LineNr">3928 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L3929" class="LineNr">3929 </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="L3930" class="LineNr">3930 </span> 5d/pop-to-EBP -<span id="L3931" class="LineNr">3931 </span> c3/return -<span id="L3932" class="LineNr">3932 </span> -<span id="L3933" class="LineNr">3933 </span><span class="subxTest">test-next-positive-hex-int-single-digit</span>: -<span id="L3934" class="LineNr">3934 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L3935" class="LineNr">3935 </span> 55/push-EBP -<span id="L3936" class="LineNr">3936 </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="L3937" class="LineNr">3937 </span> <span class="subxComment"># (EAX..ECX) = "a)"</span> -<span id="L3938" class="LineNr">3938 </span> b8/copy-to-EAX <span class="Constant">"a)"</span>/imm32 -<span id="L3939" class="LineNr">3939 </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="L3940" class="LineNr">3940 </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="L3941" class="LineNr">3941 </span> 05/add-to-EAX 4/imm32 -<span id="L3942" class="LineNr">3942 </span> <span class="subxComment"># var slice/ECX = {EAX, ECX}</span> -<span id="L3943" class="LineNr">3943 </span> 51/push-ECX -<span id="L3944" class="LineNr">3944 </span> 50/push-EAX -<span id="L3945" class="LineNr">3945 </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="L3946" class="LineNr">3946 </span> <span class="subxComment"># EAX = next-positive-hex-int(slice)</span> -<span id="L3947" class="LineNr">3947 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3948" class="LineNr">3948 </span> 51/push-ECX -<span id="L3949" class="LineNr">3949 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3950" class="LineNr">3950 </span> e8/call <a href='desugar.subx.html#L3846'>next-positive-hex-int</a>/disp32 -<span id="L3951" class="LineNr">3951 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3952" class="LineNr">3952 </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="L3953" class="LineNr">3953 </span> <span class="subxComment"># check-ints-equal(EAX, 0xa, msg)</span> -<span id="L3954" class="LineNr">3954 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3955" class="LineNr">3955 </span> 68/push <span class="Constant">"F - test-next-positive-hex-int-single-digit"</span>/imm32 -<span id="L3956" class="LineNr">3956 </span> 68/push 0xa/imm32 -<span id="L3957" class="LineNr">3957 </span> 50/push-EAX -<span id="L3958" class="LineNr">3958 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3959" class="LineNr">3959 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L3960" class="LineNr">3960 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3961" class="LineNr">3961 </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="L3962" class="LineNr">3962 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L3963" class="LineNr">3963 </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="L3964" class="LineNr">3964 </span> 5d/pop-to-EBP -<span id="L3965" class="LineNr">3965 </span> c3/return -<span id="L3966" class="LineNr">3966 </span> -<span id="L3967" class="LineNr">3967 </span><span class="subxTest">test-next-positive-hex-int-multi-digit</span>: -<span id="L3968" class="LineNr">3968 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L3969" class="LineNr">3969 </span> 55/push-EBP -<span id="L3970" class="LineNr">3970 </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="L3971" class="LineNr">3971 </span> <span class="subxComment"># (EAX..ECX) = "34a)"</span> -<span id="L3972" class="LineNr">3972 </span> b8/copy-to-EAX <span class="Constant">"34a)"</span>/imm32 -<span id="L3973" class="LineNr">3973 </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="L3974" class="LineNr">3974 </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="L3975" class="LineNr">3975 </span> 05/add-to-EAX 4/imm32 -<span id="L3976" class="LineNr">3976 </span> <span class="subxComment"># var slice/ECX = {EAX, ECX}</span> -<span id="L3977" class="LineNr">3977 </span> 51/push-ECX -<span id="L3978" class="LineNr">3978 </span> 50/push-EAX -<span id="L3979" class="LineNr">3979 </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="L3980" class="LineNr">3980 </span> <span class="subxComment"># EAX = next-positive-hex-int(slice)</span> -<span id="L3981" class="LineNr">3981 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3982" class="LineNr">3982 </span> 51/push-ECX -<span id="L3983" class="LineNr">3983 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3984" class="LineNr">3984 </span> e8/call <a href='desugar.subx.html#L3846'>next-positive-hex-int</a>/disp32 -<span id="L3985" class="LineNr">3985 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3986" class="LineNr">3986 </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="L3987" class="LineNr">3987 </span> <span class="subxComment"># check-ints-equal(EAX, 0x34a, msg)</span> -<span id="L3988" class="LineNr">3988 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L3989" class="LineNr">3989 </span> 68/push <span class="Constant">"F - test-next-positive-hex-int-multi-digit"</span>/imm32 -<span id="L3990" class="LineNr">3990 </span> 68/push 0x34a/imm32 -<span id="L3991" class="LineNr">3991 </span> 50/push-EAX -<span id="L3992" class="LineNr">3992 </span> <span class="subxS2Comment"># . . call</span> -<span id="L3993" class="LineNr">3993 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L3994" class="LineNr">3994 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L3995" class="LineNr">3995 </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="L3996" class="LineNr">3996 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L3997" class="LineNr">3997 </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="L3998" class="LineNr">3998 </span> 5d/pop-to-EBP -<span id="L3999" class="LineNr">3999 </span> c3/return -<span id="L4000" class="LineNr">4000 </span> -<span id="L4001" class="LineNr">4001 </span><span class="subxTest">test-next-positive-hex-int-0x-prefix</span>: -<span id="L4002" class="LineNr">4002 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L4003" class="LineNr">4003 </span> 55/push-EBP -<span id="L4004" class="LineNr">4004 </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="L4005" class="LineNr">4005 </span> <span class="subxComment"># (EAX..ECX) = "0x34)"</span> -<span id="L4006" class="LineNr">4006 </span> b8/copy-to-EAX <span class="Constant">"0x34)"</span>/imm32 -<span id="L4007" class="LineNr">4007 </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="L4008" class="LineNr">4008 </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="L4009" class="LineNr">4009 </span> 05/add-to-EAX 4/imm32 -<span id="L4010" class="LineNr">4010 </span> <span class="subxComment"># var slice/ECX = {EAX, ECX}</span> -<span id="L4011" class="LineNr">4011 </span> 51/push-ECX -<span id="L4012" class="LineNr">4012 </span> 50/push-EAX -<span id="L4013" class="LineNr">4013 </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="L4014" class="LineNr">4014 </span> <span class="subxComment"># EAX = next-positive-hex-int(slice)</span> -<span id="L4015" class="LineNr">4015 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L4016" class="LineNr">4016 </span> 51/push-ECX -<span id="L4017" class="LineNr">4017 </span> <span class="subxS2Comment"># . . call</span> -<span id="L4018" class="LineNr">4018 </span> e8/call <a href='desugar.subx.html#L3846'>next-positive-hex-int</a>/disp32 -<span id="L4019" class="LineNr">4019 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L4020" class="LineNr">4020 </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="L4021" class="LineNr">4021 </span> <span class="subxComment"># check-ints-equal(EAX, 0x34, msg)</span> -<span id="L4022" class="LineNr">4022 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L4023" class="LineNr">4023 </span> 68/push <span class="Constant">"F - test-next-positive-hex-int-0x-prefix"</span>/imm32 -<span id="L4024" class="LineNr">4024 </span> 68/push 0x34/imm32 -<span id="L4025" class="LineNr">4025 </span> 50/push-EAX -<span id="L4026" class="LineNr">4026 </span> <span class="subxS2Comment"># . . call</span> -<span id="L4027" class="LineNr">4027 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L4028" class="LineNr">4028 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L4029" class="LineNr">4029 </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="L4030" class="LineNr">4030 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L4031" class="LineNr">4031 </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="L4032" class="LineNr">4032 </span> 5d/pop-to-EBP -<span id="L4033" class="LineNr">4033 </span> c3/return -<span id="L4034" class="LineNr">4034 </span> -<span id="L4035" class="LineNr">4035 </span><span class="subxTest">test-next-positive-hex-int-zero</span>: -<span id="L4036" class="LineNr">4036 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L4037" class="LineNr">4037 </span> 55/push-EBP -<span id="L4038" class="LineNr">4038 </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="L4039" class="LineNr">4039 </span> <span class="subxComment"># (EAX..ECX) = "0"</span> -<span id="L4040" class="LineNr">4040 </span> b8/copy-to-EAX <span class="Constant">"0"</span>/imm32 -<span id="L4041" class="LineNr">4041 </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="L4042" class="LineNr">4042 </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="L4043" class="LineNr">4043 </span> 05/add-to-EAX 4/imm32 -<span id="L4044" class="LineNr">4044 </span> <span class="subxComment"># var slice/ECX = {EAX, ECX}</span> -<span id="L4045" class="LineNr">4045 </span> 51/push-ECX -<span id="L4046" class="LineNr">4046 </span> 50/push-EAX -<span id="L4047" class="LineNr">4047 </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="L4048" class="LineNr">4048 </span> <span class="subxComment"># EAX = next-positive-hex-int(slice)</span> -<span id="L4049" class="LineNr">4049 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L4050" class="LineNr">4050 </span> 51/push-ECX -<span id="L4051" class="LineNr">4051 </span> <span class="subxS2Comment"># . . call</span> -<span id="L4052" class="LineNr">4052 </span> e8/call <a href='desugar.subx.html#L3846'>next-positive-hex-int</a>/disp32 -<span id="L4053" class="LineNr">4053 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L4054" class="LineNr">4054 </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="L4055" class="LineNr">4055 </span> <span class="subxComment"># check-ints-equal(EAX, 0, msg)</span> -<span id="L4056" class="LineNr">4056 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L4057" class="LineNr">4057 </span> 68/push <span class="Constant">"F - test-next-positive-hex-int-zero"</span>/imm32 -<span id="L4058" class="LineNr">4058 </span> 68/push 0/imm32 -<span id="L4059" class="LineNr">4059 </span> 50/push-EAX -<span id="L4060" class="LineNr">4060 </span> <span class="subxS2Comment"># . . call</span> -<span id="L4061" class="LineNr">4061 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L4062" class="LineNr">4062 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L4063" class="LineNr">4063 </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="L4064" class="LineNr">4064 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L4065" class="LineNr">4065 </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="L4066" class="LineNr">4066 </span> 5d/pop-to-EBP -<span id="L4067" class="LineNr">4067 </span> c3/return -<span id="L4068" class="LineNr">4068 </span> -<span id="L4069" class="LineNr">4069 </span><span class="subxTest">test-next-positive-hex-int-0-prefix</span>: -<span id="L4070" class="LineNr">4070 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L4071" class="LineNr">4071 </span> 55/push-EBP -<span id="L4072" class="LineNr">4072 </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="L4073" class="LineNr">4073 </span> <span class="subxComment"># (EAX..ECX) = "03)"</span> -<span id="L4074" class="LineNr">4074 </span> b8/copy-to-EAX <span class="Constant">"03)"</span>/imm32 -<span id="L4075" class="LineNr">4075 </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="L4076" class="LineNr">4076 </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="L4077" class="LineNr">4077 </span> 05/add-to-EAX 4/imm32 -<span id="L4078" class="LineNr">4078 </span> <span class="subxComment"># var slice/ECX = {EAX, ECX}</span> -<span id="L4079" class="LineNr">4079 </span> 51/push-ECX -<span id="L4080" class="LineNr">4080 </span> 50/push-EAX -<span id="L4081" class="LineNr">4081 </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="L4082" class="LineNr">4082 </span> <span class="subxComment"># EAX = next-positive-hex-int(slice)</span> -<span id="L4083" class="LineNr">4083 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L4084" class="LineNr">4084 </span> 51/push-ECX -<span id="L4085" class="LineNr">4085 </span> <span class="subxS2Comment"># . . call</span> -<span id="L4086" class="LineNr">4086 </span> e8/call <a href='desugar.subx.html#L3846'>next-positive-hex-int</a>/disp32 -<span id="L4087" class="LineNr">4087 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L4088" class="LineNr">4088 </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="L4089" class="LineNr">4089 </span> <span class="subxComment"># check-ints-equal(EAX, 3, msg)</span> -<span id="L4090" class="LineNr">4090 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L4091" class="LineNr">4091 </span> 68/push <span class="Constant">"F - test-next-positive-hex-int-0-prefix"</span>/imm32 -<span id="L4092" class="LineNr">4092 </span> 68/push 3/imm32 -<span id="L4093" class="LineNr">4093 </span> 50/push-EAX -<span id="L4094" class="LineNr">4094 </span> <span class="subxS2Comment"># . . call</span> -<span id="L4095" class="LineNr">4095 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 -<span id="L4096" class="LineNr">4096 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L4097" class="LineNr">4097 </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="L4098" class="LineNr">4098 </span> <span class="subxS1Comment"># . epilog</span> -<span id="L4099" class="LineNr">4099 </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="L4100" class="LineNr">4100 </span> 5d/pop-to-EBP -<span id="L4101" class="LineNr">4101 </span> c3/return -<span id="L4102" class="LineNr">4102 </span> -<span id="L4103" class="LineNr">4103 </span>== data -<span id="L4104" class="LineNr">4104 </span><span class="SpecialChar">Registers</span>: <span class="subxComment"># (table string int)</span> -<span id="L4105" class="LineNr">4105 </span> <span class="subxComment"># a table is a stream</span> -<span id="L4106" class="LineNr">4106 </span> 0x40/imm32/write -<span id="L4107" class="LineNr">4107 </span> 0/imm32/read -<span id="L4108" class="LineNr">4108 </span> 0x40/imm32/length -<span id="L4109" class="LineNr">4109 </span> <span class="subxComment"># data</span> -<span id="L4110" class="LineNr">4110 </span> <span class="Constant">"eax"</span>/imm32 0/imm32 -<span id="L4111" class="LineNr">4111 </span> <span class="Constant">"ecx"</span>/imm32 1/imm32 -<span id="L4112" class="LineNr">4112 </span> <span class="Constant">"edx"</span>/imm32 2/imm32 -<span id="L4113" class="LineNr">4113 </span> <span class="Constant">"ebx"</span>/imm32 3/imm32 -<span id="L4114" class="LineNr">4114 </span> <span class="Constant">"esp"</span>/imm32 4/imm32 -<span id="L4115" class="LineNr">4115 </span> <span class="Constant">"ebp"</span>/imm32 5/imm32 -<span id="L4116" class="LineNr">4116 </span> <span class="Constant">"esi"</span>/imm32 6/imm32 -<span id="L4117" class="LineNr">4117 </span> <span class="Constant">"edi"</span>/imm32 7/imm32 -<span id="L4118" class="LineNr">4118 </span> -<span id="L4119" class="LineNr">4119 </span><span class="subxS2Comment"># . . vim:nowrap:textwidth=0</span> +<span id="L3729" class="LineNr">3729 </span> 68/push <span class="Constant">"next-hex-int: invalid hex char: "</span>/imm32 +<span id="L3730" class="LineNr">3730 </span> 68/push 2/imm32/stderr +<span id="L3731" class="LineNr">3731 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3732" class="LineNr">3732 </span> e8/call <a href='../050_write.subx.html#L14'>_write</a>/disp32 +<span id="L3733" class="LineNr">3733 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3734" class="LineNr">3734 </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="L3735" class="LineNr">3735 </span> <span class="subxS1Comment"># . clear-stream(Stderr+4)</span> +<span id="L3736" class="LineNr">3736 </span> <span class="subxS2Comment"># . . save EAX</span> +<span id="L3737" class="LineNr">3737 </span> 50/push-EAX +<span id="L3738" class="LineNr">3738 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3739" class="LineNr">3739 </span> b8/copy-to-EAX <span class="SpecialChar"><a href='../065write-buffered.subx.html#L213'>Stderr</a></span>/imm32 +<span id="L3740" class="LineNr">3740 </span> 05/add-to-EAX 4/imm32 +<span id="L3741" class="LineNr">3741 </span> 50/push-EAX +<span id="L3742" class="LineNr">3742 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3743" class="LineNr">3743 </span> e8/call <a href='../055stream.subx.html#L17'>clear-stream</a>/disp32 +<span id="L3744" class="LineNr">3744 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3745" class="LineNr">3745 </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="L3746" class="LineNr">3746 </span> <span class="subxS2Comment"># . . restore EAX</span> +<span id="L3747" class="LineNr">3747 </span> 58/pop-to-EAX +<span id="L3748" class="LineNr">3748 </span> <span class="subxS1Comment"># . print-int32-buffered(Stderr, EAX)</span> +<span id="L3749" class="LineNr">3749 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3750" class="LineNr">3750 </span> 50/push-EAX +<span id="L3751" class="LineNr">3751 </span> 68/push <span class="SpecialChar"><a href='../065write-buffered.subx.html#L213'>Stderr</a></span>/imm32 +<span id="L3752" class="LineNr">3752 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3753" class="LineNr">3753 </span> e8/call <a href='../066print-int.subx.html#L267'>print-int32-buffered</a>/disp32 +<span id="L3754" class="LineNr">3754 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3755" class="LineNr">3755 </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="L3756" class="LineNr">3756 </span> <span class="subxS1Comment"># . flush(Stderr)</span> +<span id="L3757" class="LineNr">3757 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3758" class="LineNr">3758 </span> 68/push <span class="SpecialChar"><a href='../065write-buffered.subx.html#L213'>Stderr</a></span>/imm32 +<span id="L3759" class="LineNr">3759 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3760" class="LineNr">3760 </span> e8/call <a href='../064write-byte.subx.html#L79'>flush</a>/disp32 +<span id="L3761" class="LineNr">3761 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3762" class="LineNr">3762 </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="L3763" class="LineNr">3763 </span> <span class="subxS1Comment"># . _write(2/stderr, "\n")</span> +<span id="L3764" class="LineNr">3764 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3765" class="LineNr">3765 </span> 68/push <span class="Constant">"\n"</span>/imm32 +<span id="L3766" class="LineNr">3766 </span> 68/push 2/imm32/stderr +<span id="L3767" class="LineNr">3767 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3768" class="LineNr">3768 </span> e8/call <a href='../050_write.subx.html#L14'>_write</a>/disp32 +<span id="L3769" class="LineNr">3769 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3770" class="LineNr">3770 </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="L3771" class="LineNr">3771 </span> <span class="subxS1Comment"># . syscall(exit, 1)</span> +<span id="L3772" class="LineNr">3772 </span> bb/copy-to-EBX 1/imm32 +<span id="L3773" class="LineNr">3773 </span> b8/copy-to-EAX 1/imm32/exit +<span id="L3774" class="LineNr">3774 </span> cd/syscall 0x80/imm8 +<span id="L3775" class="LineNr">3775 </span> <span class="subxComment"># never gets here</span> +<span id="L3776" class="LineNr">3776 </span> +<span id="L3777" class="LineNr">3777 </span><span class="subxTest">test-next-hex-int-single-digit</span>: +<span id="L3778" class="LineNr">3778 </span> <span class="subxS1Comment"># . prolog</span> +<span id="L3779" class="LineNr">3779 </span> 55/push-EBP +<span id="L3780" class="LineNr">3780 </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="L3781" class="LineNr">3781 </span> <span class="subxComment"># (EAX..ECX) = "+a)"</span> +<span id="L3782" class="LineNr">3782 </span> b8/copy-to-EAX <span class="Constant">"+a)"</span>/imm32 +<span id="L3783" class="LineNr">3783 </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="L3784" class="LineNr">3784 </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="L3785" class="LineNr">3785 </span> 05/add-to-EAX 4/imm32 +<span id="L3786" class="LineNr">3786 </span> <span class="subxComment"># var slice/ECX = {EAX, ECX}</span> +<span id="L3787" class="LineNr">3787 </span> 51/push-ECX +<span id="L3788" class="LineNr">3788 </span> 50/push-EAX +<span id="L3789" class="LineNr">3789 </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="L3790" class="LineNr">3790 </span> <span class="subxComment"># EAX = next-hex-int(slice)</span> +<span id="L3791" class="LineNr">3791 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3792" class="LineNr">3792 </span> 51/push-ECX +<span id="L3793" class="LineNr">3793 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3794" class="LineNr">3794 </span> e8/call <a href='desugar.subx.html#L3602'>next-hex-int</a>/disp32 +<span id="L3795" class="LineNr">3795 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3796" class="LineNr">3796 </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="L3797" class="LineNr">3797 </span> <span class="subxComment"># check-ints-equal(EAX, 0xa, msg)</span> +<span id="L3798" class="LineNr">3798 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3799" class="LineNr">3799 </span> 68/push <span class="Constant">"F - test-next-hex-int-single-digit"</span>/imm32 +<span id="L3800" class="LineNr">3800 </span> 68/push 0xa/imm32 +<span id="L3801" class="LineNr">3801 </span> 50/push-EAX +<span id="L3802" class="LineNr">3802 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3803" class="LineNr">3803 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L3804" class="LineNr">3804 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3805" class="LineNr">3805 </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="L3806" class="LineNr">3806 </span> <span class="subxS1Comment"># . epilog</span> +<span id="L3807" class="LineNr">3807 </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="L3808" class="LineNr">3808 </span> 5d/pop-to-EBP +<span id="L3809" class="LineNr">3809 </span> c3/return +<span id="L3810" class="LineNr">3810 </span> +<span id="L3811" class="LineNr">3811 </span><span class="subxTest">test-next-hex-int-multi-digit</span>: +<span id="L3812" class="LineNr">3812 </span> <span class="subxS1Comment"># . prolog</span> +<span id="L3813" class="LineNr">3813 </span> 55/push-EBP +<span id="L3814" class="LineNr">3814 </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="L3815" class="LineNr">3815 </span> <span class="subxComment"># (EAX..ECX) = "+ 34a)"</span> +<span id="L3816" class="LineNr">3816 </span> b8/copy-to-EAX <span class="Constant">"+ 34a)"</span>/imm32 +<span id="L3817" class="LineNr">3817 </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="L3818" class="LineNr">3818 </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="L3819" class="LineNr">3819 </span> 05/add-to-EAX 4/imm32 +<span id="L3820" class="LineNr">3820 </span> <span class="subxComment"># var slice/ECX = {EAX, ECX}</span> +<span id="L3821" class="LineNr">3821 </span> 51/push-ECX +<span id="L3822" class="LineNr">3822 </span> 50/push-EAX +<span id="L3823" class="LineNr">3823 </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="L3824" class="LineNr">3824 </span> <span class="subxComment"># EAX = next-hex-int(slice)</span> +<span id="L3825" class="LineNr">3825 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3826" class="LineNr">3826 </span> 51/push-ECX +<span id="L3827" class="LineNr">3827 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3828" class="LineNr">3828 </span> e8/call <a href='desugar.subx.html#L3602'>next-hex-int</a>/disp32 +<span id="L3829" class="LineNr">3829 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3830" class="LineNr">3830 </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="L3831" class="LineNr">3831 </span> <span class="subxComment"># check-ints-equal(EAX, 0x34a, msg)</span> +<span id="L3832" class="LineNr">3832 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3833" class="LineNr">3833 </span> 68/push <span class="Constant">"F - test-next-hex-int-multi-digit"</span>/imm32 +<span id="L3834" class="LineNr">3834 </span> 68/push 0x34a/imm32 +<span id="L3835" class="LineNr">3835 </span> 50/push-EAX +<span id="L3836" class="LineNr">3836 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3837" class="LineNr">3837 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L3838" class="LineNr">3838 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3839" class="LineNr">3839 </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="L3840" class="LineNr">3840 </span> <span class="subxS1Comment"># . epilog</span> +<span id="L3841" class="LineNr">3841 </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="L3842" class="LineNr">3842 </span> 5d/pop-to-EBP +<span id="L3843" class="LineNr">3843 </span> c3/return +<span id="L3844" class="LineNr">3844 </span> +<span id="L3845" class="LineNr">3845 </span><span class="subxTest">test-next-hex-int-0x-prefix</span>: +<span id="L3846" class="LineNr">3846 </span> <span class="subxS1Comment"># . prolog</span> +<span id="L3847" class="LineNr">3847 </span> 55/push-EBP +<span id="L3848" class="LineNr">3848 </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="L3849" class="LineNr">3849 </span> <span class="subxComment"># (EAX..ECX) = "+0x34)"</span> +<span id="L3850" class="LineNr">3850 </span> b8/copy-to-EAX <span class="Constant">"+0x34)"</span>/imm32 +<span id="L3851" class="LineNr">3851 </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="L3852" class="LineNr">3852 </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="L3853" class="LineNr">3853 </span> 05/add-to-EAX 4/imm32 +<span id="L3854" class="LineNr">3854 </span> <span class="subxComment"># var slice/ECX = {EAX, ECX}</span> +<span id="L3855" class="LineNr">3855 </span> 51/push-ECX +<span id="L3856" class="LineNr">3856 </span> 50/push-EAX +<span id="L3857" class="LineNr">3857 </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="L3858" class="LineNr">3858 </span> <span class="subxComment"># EAX = next-hex-int(slice)</span> +<span id="L3859" class="LineNr">3859 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3860" class="LineNr">3860 </span> 51/push-ECX +<span id="L3861" class="LineNr">3861 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3862" class="LineNr">3862 </span> e8/call <a href='desugar.subx.html#L3602'>next-hex-int</a>/disp32 +<span id="L3863" class="LineNr">3863 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3864" class="LineNr">3864 </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="L3865" class="LineNr">3865 </span> <span class="subxComment"># check-ints-equal(EAX, 0x34, msg)</span> +<span id="L3866" class="LineNr">3866 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3867" class="LineNr">3867 </span> 68/push <span class="Constant">"F - test-next-hex-int-0x-prefix"</span>/imm32 +<span id="L3868" class="LineNr">3868 </span> 68/push 0x34/imm32 +<span id="L3869" class="LineNr">3869 </span> 50/push-EAX +<span id="L3870" class="LineNr">3870 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3871" class="LineNr">3871 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L3872" class="LineNr">3872 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3873" class="LineNr">3873 </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="L3874" class="LineNr">3874 </span> <span class="subxS1Comment"># . epilog</span> +<span id="L3875" class="LineNr">3875 </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="L3876" class="LineNr">3876 </span> 5d/pop-to-EBP +<span id="L3877" class="LineNr">3877 </span> c3/return +<span id="L3878" class="LineNr">3878 </span> +<span id="L3879" class="LineNr">3879 </span><span class="subxTest">test-next-hex-int-zero</span>: +<span id="L3880" class="LineNr">3880 </span> <span class="subxS1Comment"># . prolog</span> +<span id="L3881" class="LineNr">3881 </span> 55/push-EBP +<span id="L3882" class="LineNr">3882 </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="L3883" class="LineNr">3883 </span> <span class="subxComment"># (EAX..ECX) = "+0)"</span> +<span id="L3884" class="LineNr">3884 </span> b8/copy-to-EAX <span class="Constant">"+0)"</span>/imm32 +<span id="L3885" class="LineNr">3885 </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="L3886" class="LineNr">3886 </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="L3887" class="LineNr">3887 </span> 05/add-to-EAX 4/imm32 +<span id="L3888" class="LineNr">3888 </span> <span class="subxComment"># var slice/ECX = {EAX, ECX}</span> +<span id="L3889" class="LineNr">3889 </span> 51/push-ECX +<span id="L3890" class="LineNr">3890 </span> 50/push-EAX +<span id="L3891" class="LineNr">3891 </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="L3892" class="LineNr">3892 </span> <span class="subxComment"># EAX = next-hex-int(slice)</span> +<span id="L3893" class="LineNr">3893 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3894" class="LineNr">3894 </span> 51/push-ECX +<span id="L3895" class="LineNr">3895 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3896" class="LineNr">3896 </span> e8/call <a href='desugar.subx.html#L3602'>next-hex-int</a>/disp32 +<span id="L3897" class="LineNr">3897 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3898" class="LineNr">3898 </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="L3899" class="LineNr">3899 </span> <span class="subxComment"># check-ints-equal(EAX, 0, msg)</span> +<span id="L3900" class="LineNr">3900 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3901" class="LineNr">3901 </span> 68/push <span class="Constant">"F - test-next-hex-int-zero"</span>/imm32 +<span id="L3902" class="LineNr">3902 </span> 68/push 0/imm32 +<span id="L3903" class="LineNr">3903 </span> 50/push-EAX +<span id="L3904" class="LineNr">3904 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3905" class="LineNr">3905 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L3906" class="LineNr">3906 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3907" class="LineNr">3907 </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="L3908" class="LineNr">3908 </span> <span class="subxS1Comment"># . epilog</span> +<span id="L3909" class="LineNr">3909 </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="L3910" class="LineNr">3910 </span> 5d/pop-to-EBP +<span id="L3911" class="LineNr">3911 </span> c3/return +<span id="L3912" class="LineNr">3912 </span> +<span id="L3913" class="LineNr">3913 </span><span class="subxTest">test-next-hex-int-0-prefix</span>: +<span id="L3914" class="LineNr">3914 </span> <span class="subxS1Comment"># . prolog</span> +<span id="L3915" class="LineNr">3915 </span> 55/push-EBP +<span id="L3916" class="LineNr">3916 </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="L3917" class="LineNr">3917 </span> <span class="subxComment"># (EAX..ECX) = "+ 03)"</span> +<span id="L3918" class="LineNr">3918 </span> b8/copy-to-EAX <span class="Constant">"+ 03)"</span>/imm32 +<span id="L3919" class="LineNr">3919 </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="L3920" class="LineNr">3920 </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="L3921" class="LineNr">3921 </span> 05/add-to-EAX 4/imm32 +<span id="L3922" class="LineNr">3922 </span> <span class="subxComment"># var slice/ECX = {EAX, ECX}</span> +<span id="L3923" class="LineNr">3923 </span> 51/push-ECX +<span id="L3924" class="LineNr">3924 </span> 50/push-EAX +<span id="L3925" class="LineNr">3925 </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="L3926" class="LineNr">3926 </span> <span class="subxComment"># EAX = next-hex-int(slice)</span> +<span id="L3927" class="LineNr">3927 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3928" class="LineNr">3928 </span> 51/push-ECX +<span id="L3929" class="LineNr">3929 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3930" class="LineNr">3930 </span> e8/call <a href='desugar.subx.html#L3602'>next-hex-int</a>/disp32 +<span id="L3931" class="LineNr">3931 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3932" class="LineNr">3932 </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="L3933" class="LineNr">3933 </span> <span class="subxComment"># check-ints-equal(EAX, 3, msg)</span> +<span id="L3934" class="LineNr">3934 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3935" class="LineNr">3935 </span> 68/push <span class="Constant">"F - test-next-hex-int-0-prefix"</span>/imm32 +<span id="L3936" class="LineNr">3936 </span> 68/push 3/imm32 +<span id="L3937" class="LineNr">3937 </span> 50/push-EAX +<span id="L3938" class="LineNr">3938 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3939" class="LineNr">3939 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L3940" class="LineNr">3940 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3941" class="LineNr">3941 </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="L3942" class="LineNr">3942 </span> <span class="subxS1Comment"># . epilog</span> +<span id="L3943" class="LineNr">3943 </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="L3944" class="LineNr">3944 </span> 5d/pop-to-EBP +<span id="L3945" class="LineNr">3945 </span> c3/return +<span id="L3946" class="LineNr">3946 </span> +<span id="L3947" class="LineNr">3947 </span><span class="subxTest">test-next-hex-int-negative</span>: +<span id="L3948" class="LineNr">3948 </span> <span class="subxS1Comment"># . prolog</span> +<span id="L3949" class="LineNr">3949 </span> 55/push-EBP +<span id="L3950" class="LineNr">3950 </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="L3951" class="LineNr">3951 </span> <span class="subxComment"># (EAX..ECX) = "-03)"</span> +<span id="L3952" class="LineNr">3952 </span> b8/copy-to-EAX <span class="Constant">"-03)"</span>/imm32 +<span id="L3953" class="LineNr">3953 </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="L3954" class="LineNr">3954 </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="L3955" class="LineNr">3955 </span> 05/add-to-EAX 4/imm32 +<span id="L3956" class="LineNr">3956 </span> <span class="subxComment"># var slice/ECX = {EAX, ECX}</span> +<span id="L3957" class="LineNr">3957 </span> 51/push-ECX +<span id="L3958" class="LineNr">3958 </span> 50/push-EAX +<span id="L3959" class="LineNr">3959 </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="L3960" class="LineNr">3960 </span> <span class="subxComment"># EAX = next-hex-int(slice)</span> +<span id="L3961" class="LineNr">3961 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3962" class="LineNr">3962 </span> 51/push-ECX +<span id="L3963" class="LineNr">3963 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3964" class="LineNr">3964 </span> e8/call <a href='desugar.subx.html#L3602'>next-hex-int</a>/disp32 +<span id="L3965" class="LineNr">3965 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3966" class="LineNr">3966 </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="L3967" class="LineNr">3967 </span> <span class="subxComment"># check-ints-equal(EAX, -3, msg)</span> +<span id="L3968" class="LineNr">3968 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3969" class="LineNr">3969 </span> 68/push <span class="Constant">"F - test-next-hex-int-negative"</span>/imm32 +<span id="L3970" class="LineNr">3970 </span> 68/push -3/imm32 +<span id="L3971" class="LineNr">3971 </span> 50/push-EAX +<span id="L3972" class="LineNr">3972 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3973" class="LineNr">3973 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L3974" class="LineNr">3974 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L3975" class="LineNr">3975 </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="L3976" class="LineNr">3976 </span> <span class="subxS1Comment"># . epilog</span> +<span id="L3977" class="LineNr">3977 </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="L3978" class="LineNr">3978 </span> 5d/pop-to-EBP +<span id="L3979" class="LineNr">3979 </span> c3/return +<span id="L3980" class="LineNr">3980 </span> +<span id="L3981" class="LineNr">3981 </span><span class="subxTest">test-next-hex-int-negative-with-space</span>: +<span id="L3982" class="LineNr">3982 </span> <span class="subxS1Comment"># . prolog</span> +<span id="L3983" class="LineNr">3983 </span> 55/push-EBP +<span id="L3984" class="LineNr">3984 </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="L3985" class="LineNr">3985 </span> <span class="subxComment"># (EAX..ECX) = "- 03)"</span> +<span id="L3986" class="LineNr">3986 </span> b8/copy-to-EAX <span class="Constant">"- 03)"</span>/imm32 +<span id="L3987" class="LineNr">3987 </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="L3988" class="LineNr">3988 </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="L3989" class="LineNr">3989 </span> 05/add-to-EAX 4/imm32 +<span id="L3990" class="LineNr">3990 </span> <span class="subxComment"># var slice/ECX = {EAX, ECX}</span> +<span id="L3991" class="LineNr">3991 </span> 51/push-ECX +<span id="L3992" class="LineNr">3992 </span> 50/push-EAX +<span id="L3993" class="LineNr">3993 </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="L3994" class="LineNr">3994 </span> <span class="subxComment"># EAX = next-hex-int(slice)</span> +<span id="L3995" class="LineNr">3995 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L3996" class="LineNr">3996 </span> 51/push-ECX +<span id="L3997" class="LineNr">3997 </span> <span class="subxS2Comment"># . . call</span> +<span id="L3998" class="LineNr">3998 </span> e8/call <a href='desugar.subx.html#L3602'>next-hex-int</a>/disp32 +<span id="L3999" class="LineNr">3999 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L4000" class="LineNr">4000 </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="L4001" class="LineNr">4001 </span> <span class="subxComment"># check-ints-equal(EAX, -3, msg)</span> +<span id="L4002" class="LineNr">4002 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L4003" class="LineNr">4003 </span> 68/push <span class="Constant">"F - test-next-hex-int-negative-with-space"</span>/imm32 +<span id="L4004" class="LineNr">4004 </span> 68/push -3/imm32 +<span id="L4005" class="LineNr">4005 </span> 50/push-EAX +<span id="L4006" class="LineNr">4006 </span> <span class="subxS2Comment"># . . call</span> +<span id="L4007" class="LineNr">4007 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L4008" class="LineNr">4008 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L4009" class="LineNr">4009 </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="L4010" class="LineNr">4010 </span> <span class="subxS1Comment"># . epilog</span> +<span id="L4011" class="LineNr">4011 </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="L4012" class="LineNr">4012 </span> 5d/pop-to-EBP +<span id="L4013" class="LineNr">4013 </span> c3/return +<span id="L4014" class="LineNr">4014 </span> +<span id="L4015" class="LineNr">4015 </span><span class="subxComment"># assumes 'in' starts a positive unsigned integer</span> +<span id="L4016" class="LineNr">4016 </span><span class="subxComment"># returns the value of the integer</span> +<span id="L4017" class="LineNr">4017 </span><span class="subxComment"># side-effect: modifies 'in' to skip past the integer</span> +<span id="L4018" class="LineNr">4018 </span><span class="subxFunction">next-positive-hex-int</span>: <span class="subxComment"># in : (address slice) -> result/EAX</span> +<span id="L4019" class="LineNr">4019 </span> <span class="subxS1Comment"># . prolog</span> +<span id="L4020" class="LineNr">4020 </span> 55/push-EBP +<span id="L4021" class="LineNr">4021 </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="L4022" class="LineNr">4022 </span> <span class="subxS1Comment"># . save registers</span> +<span id="L4023" class="LineNr">4023 </span> 51/push-ECX +<span id="L4024" class="LineNr">4024 </span> 52/push-EDX +<span id="L4025" class="LineNr">4025 </span> 53/push-EBX +<span id="L4026" class="LineNr">4026 </span> 56/push-ESI +<span id="L4027" class="LineNr">4027 </span> 57/push-EDI +<span id="L4028" class="LineNr">4028 </span> <span class="subxComment"># result/EDI = 0</span> +<span id="L4029" class="LineNr">4029 </span> 31/xor 3/mod/direct 7/rm32/EDI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 7/r32/EDI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># clear EDI</span> +<span id="L4030" class="LineNr">4030 </span> <span class="subxComment"># ESI = in</span> +<span id="L4031" class="LineNr">4031 </span> 8b/copy 1/mod/*+disp8 5/rm32/EBP <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/ESI 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(EBP+8) to ESI</span> +<span id="L4032" class="LineNr">4032 </span> <span class="subxComment"># EDX = in->end</span> +<span id="L4033" class="LineNr">4033 </span> 8b/copy 1/mod/*+disp8 6/rm32/ESI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/EDX 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ESI+4) to EDX</span> +<span id="L4034" class="LineNr">4034 </span> <span class="subxComment"># curr/ECX = in->start</span> +<span id="L4035" class="LineNr">4035 </span> 8b/copy 0/mod/indirect 6/rm32/ESI <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 *ESI to ECX</span> +<span id="L4036" class="LineNr">4036 </span> <span class="subxComment"># negate?/EBX = false</span> +<span id="L4037" class="LineNr">4037 </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="L4038" class="LineNr">4038 </span> <span class="subxComment"># EAX = *curr</span> +<span id="L4039" class="LineNr">4039 </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="L4040" class="LineNr">4040 </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="L4041" class="LineNr">4041 </span><span class="Constant">$next-positive-hex-int:initial-0</span>: +<span id="L4042" class="LineNr">4042 </span> <span class="subxComment"># skip past leading '0x'</span> +<span id="L4043" class="LineNr">4043 </span> <span class="subxS1Comment"># . if (*curr != '0') jump to loop</span> +<span id="L4044" class="LineNr">4044 </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="L4045" class="LineNr">4045 </span> 3d/compare-EAX-and 0x30/imm32/0 +<span id="L4046" class="LineNr">4046 </span> 75/jump-if-not-equal $next-positive-hex-int:loop/disp8 +<span id="L4047" class="LineNr">4047 </span> <span class="subxS1Comment"># . ++curr</span> +<span id="L4048" class="LineNr">4048 </span> 41/increment-ECX +<span id="L4049" class="LineNr">4049 </span><span class="Constant">$next-positive-hex-int:initial-0x</span>: +<span id="L4050" class="LineNr">4050 </span> <span class="subxS1Comment"># . if (curr >= in->end) return result</span> +<span id="L4051" class="LineNr">4051 </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="L4052" class="LineNr">4052 </span> 73/jump-if-greater-or-equal-unsigned $next-positive-hex-int:end/disp8 +<span id="L4053" class="LineNr">4053 </span> <span class="subxS1Comment"># . if (*curr != 'x') jump to loop # the previous '0' is still valid so doesn't need to be checked again</span> +<span id="L4054" class="LineNr">4054 </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="L4055" class="LineNr">4055 </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="L4056" class="LineNr">4056 </span> 3d/compare-EAX-and 0x78/imm32/x +<span id="L4057" class="LineNr">4057 </span> 75/jump-if-not-equal $next-positive-hex-int:loop/disp8 +<span id="L4058" class="LineNr">4058 </span> <span class="subxS1Comment"># . ++curr</span> +<span id="L4059" class="LineNr">4059 </span> 41/increment-ECX +<span id="L4060" class="LineNr">4060 </span><span class="Constant">$next-positive-hex-int:loop</span>: +<span id="L4061" class="LineNr">4061 </span> <span class="subxComment"># if (curr >= in->end) break</span> +<span id="L4062" class="LineNr">4062 </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="L4063" class="LineNr">4063 </span> 73/jump-if-greater-or-equal-unsigned $next-positive-hex-int:end/disp8 +<span id="L4064" class="LineNr">4064 </span> <span class="subxComment"># if (!is-hex-digit?(*curr)) break</span> +<span id="L4065" class="LineNr">4065 </span> <span class="subxS1Comment"># . EAX = *curr</span> +<span id="L4066" class="LineNr">4066 </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="L4067" class="LineNr">4067 </span> <span class="subxS1Comment"># . EAX = is-hex-digit?(*curr)</span> +<span id="L4068" class="LineNr">4068 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L4069" class="LineNr">4069 </span> 50/push-EAX +<span id="L4070" class="LineNr">4070 </span> <span class="subxS2Comment"># . . call</span> +<span id="L4071" class="LineNr">4071 </span> e8/call <a href='../067parse-hex.subx.html#L638'>is-hex-digit?</a>/disp32 +<span id="L4072" class="LineNr">4072 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L4073" class="LineNr">4073 </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="L4074" class="LineNr">4074 </span> <span class="subxS1Comment"># . if (EAX == 0) break</span> +<span id="L4075" class="LineNr">4075 </span> 3d/compare-EAX-and 0/imm32 +<span id="L4076" class="LineNr">4076 </span> 74/jump-if-equal $next-positive-hex-int:end/disp8 +<span id="L4077" class="LineNr">4077 </span> <span class="subxComment"># EAX = from-hex-char(*curr)</span> +<span id="L4078" class="LineNr">4078 </span> <span class="subxS2Comment"># . . copy arg to EAX</span> +<span id="L4079" class="LineNr">4079 </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="L4080" class="LineNr">4080 </span> <span class="subxS2Comment"># . . call</span> +<span id="L4081" class="LineNr">4081 </span> e8/call <a href='../067parse-hex.subx.html#L797'>from-hex-char</a>/disp32 +<span id="L4082" class="LineNr">4082 </span> <span class="subxComment"># result = result * 16 + EAX</span> +<span id="L4083" class="LineNr">4083 </span> c1/shift 4/subop/left 3/mod/direct 7/rm32/EDI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm8 <span class="subxComment"># shift EDI left by 4 bits</span> +<span id="L4084" class="LineNr">4084 </span> 01/add 3/mod/direct 7/rm32/EDI <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"># add EAX to EDI</span> +<span id="L4085" class="LineNr">4085 </span> <span class="subxComment"># ++curr</span> +<span id="L4086" class="LineNr">4086 </span> 41/increment-ECX +<span id="L4087" class="LineNr">4087 </span> <span class="subxComment"># loop</span> +<span id="L4088" class="LineNr">4088 </span> eb/jump $next-positive-hex-int:loop/disp8 +<span id="L4089" class="LineNr">4089 </span><span class="Constant">$next-positive-hex-int:end</span>: +<span id="L4090" class="LineNr">4090 </span> <span class="subxComment"># word->start = curr</span> +<span id="L4091" class="LineNr">4091 </span> 89/copy 0/mod/indirect 6/rm32/ESI <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 *ESI</span> +<span id="L4092" class="LineNr">4092 </span> <span class="subxComment"># return EDI</span> +<span id="L4093" class="LineNr">4093 </span> 89/copy 3/mod/direct 0/rm32/EAX <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 7/r32/EDI <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy EDI to EAX</span> +<span id="L4094" class="LineNr">4094 </span> <span class="subxS1Comment"># . restore registers</span> +<span id="L4095" class="LineNr">4095 </span> 5f/pop-to-EDI +<span id="L4096" class="LineNr">4096 </span> 5e/pop-to-ESI +<span id="L4097" class="LineNr">4097 </span> 5b/pop-to-EBX +<span id="L4098" class="LineNr">4098 </span> 5a/pop-to-EDX +<span id="L4099" class="LineNr">4099 </span> 59/pop-to-ECX +<span id="L4100" class="LineNr">4100 </span> <span class="subxS1Comment"># . epilog</span> +<span id="L4101" class="LineNr">4101 </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="L4102" class="LineNr">4102 </span> 5d/pop-to-EBP +<span id="L4103" class="LineNr">4103 </span> c3/return +<span id="L4104" class="LineNr">4104 </span> +<span id="L4105" class="LineNr">4105 </span><span class="subxTest">test-next-positive-hex-int-single-digit</span>: +<span id="L4106" class="LineNr">4106 </span> <span class="subxS1Comment"># . prolog</span> +<span id="L4107" class="LineNr">4107 </span> 55/push-EBP +<span id="L4108" class="LineNr">4108 </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="L4109" class="LineNr">4109 </span> <span class="subxComment"># (EAX..ECX) = "a)"</span> +<span id="L4110" class="LineNr">4110 </span> b8/copy-to-EAX <span class="Constant">"a)"</span>/imm32 +<span id="L4111" class="LineNr">4111 </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="L4112" class="LineNr">4112 </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="L4113" class="LineNr">4113 </span> 05/add-to-EAX 4/imm32 +<span id="L4114" class="LineNr">4114 </span> <span class="subxComment"># var slice/ECX = {EAX, ECX}</span> +<span id="L4115" class="LineNr">4115 </span> 51/push-ECX +<span id="L4116" class="LineNr">4116 </span> 50/push-EAX +<span id="L4117" class="LineNr">4117 </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="L4118" class="LineNr">4118 </span> <span class="subxComment"># EAX = next-positive-hex-int(slice)</span> +<span id="L4119" class="LineNr">4119 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L4120" class="LineNr">4120 </span> 51/push-ECX +<span id="L4121" class="LineNr">4121 </span> <span class="subxS2Comment"># . . call</span> +<span id="L4122" class="LineNr">4122 </span> e8/call <a href='desugar.subx.html#L4018'>next-positive-hex-int</a>/disp32 +<span id="L4123" class="LineNr">4123 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L4124" class="LineNr">4124 </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="L4125" class="LineNr">4125 </span> <span class="subxComment"># check-ints-equal(EAX, 0xa, msg)</span> +<span id="L4126" class="LineNr">4126 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L4127" class="LineNr">4127 </span> 68/push <span class="Constant">"F - test-next-positive-hex-int-single-digit"</span>/imm32 +<span id="L4128" class="LineNr">4128 </span> 68/push 0xa/imm32 +<span id="L4129" class="LineNr">4129 </span> 50/push-EAX +<span id="L4130" class="LineNr">4130 </span> <span class="subxS2Comment"># . . call</span> +<span id="L4131" class="LineNr">4131 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L4132" class="LineNr">4132 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L4133" class="LineNr">4133 </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="L4134" class="LineNr">4134 </span> <span class="subxS1Comment"># . epilog</span> +<span id="L4135" class="LineNr">4135 </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="L4136" class="LineNr">4136 </span> 5d/pop-to-EBP +<span id="L4137" class="LineNr">4137 </span> c3/return +<span id="L4138" class="LineNr">4138 </span> +<span id="L4139" class="LineNr">4139 </span><span class="subxTest">test-next-positive-hex-int-multi-digit</span>: +<span id="L4140" class="LineNr">4140 </span> <span class="subxS1Comment"># . prolog</span> +<span id="L4141" class="LineNr">4141 </span> 55/push-EBP +<span id="L4142" class="LineNr">4142 </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="L4143" class="LineNr">4143 </span> <span class="subxComment"># (EAX..ECX) = "34a)"</span> +<span id="L4144" class="LineNr">4144 </span> b8/copy-to-EAX <span class="Constant">"34a)"</span>/imm32 +<span id="L4145" class="LineNr">4145 </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="L4146" class="LineNr">4146 </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="L4147" class="LineNr">4147 </span> 05/add-to-EAX 4/imm32 +<span id="L4148" class="LineNr">4148 </span> <span class="subxComment"># var slice/ECX = {EAX, ECX}</span> +<span id="L4149" class="LineNr">4149 </span> 51/push-ECX +<span id="L4150" class="LineNr">4150 </span> 50/push-EAX +<span id="L4151" class="LineNr">4151 </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="L4152" class="LineNr">4152 </span> <span class="subxComment"># EAX = next-positive-hex-int(slice)</span> +<span id="L4153" class="LineNr">4153 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L4154" class="LineNr">4154 </span> 51/push-ECX +<span id="L4155" class="LineNr">4155 </span> <span class="subxS2Comment"># . . call</span> +<span id="L4156" class="LineNr">4156 </span> e8/call <a href='desugar.subx.html#L4018'>next-positive-hex-int</a>/disp32 +<span id="L4157" class="LineNr">4157 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L4158" class="LineNr">4158 </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="L4159" class="LineNr">4159 </span> <span class="subxComment"># check-ints-equal(EAX, 0x34a, msg)</span> +<span id="L4160" class="LineNr">4160 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L4161" class="LineNr">4161 </span> 68/push <span class="Constant">"F - test-next-positive-hex-int-multi-digit"</span>/imm32 +<span id="L4162" class="LineNr">4162 </span> 68/push 0x34a/imm32 +<span id="L4163" class="LineNr">4163 </span> 50/push-EAX +<span id="L4164" class="LineNr">4164 </span> <span class="subxS2Comment"># . . call</span> +<span id="L4165" class="LineNr">4165 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L4166" class="LineNr">4166 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L4167" class="LineNr">4167 </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="L4168" class="LineNr">4168 </span> <span class="subxS1Comment"># . epilog</span> +<span id="L4169" class="LineNr">4169 </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="L4170" class="LineNr">4170 </span> 5d/pop-to-EBP +<span id="L4171" class="LineNr">4171 </span> c3/return +<span id="L4172" class="LineNr">4172 </span> +<span id="L4173" class="LineNr">4173 </span><span class="subxTest">test-next-positive-hex-int-0x-prefix</span>: +<span id="L4174" class="LineNr">4174 </span> <span class="subxS1Comment"># . prolog</span> +<span id="L4175" class="LineNr">4175 </span> 55/push-EBP +<span id="L4176" class="LineNr">4176 </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="L4177" class="LineNr">4177 </span> <span class="subxComment"># (EAX..ECX) = "0x34)"</span> +<span id="L4178" class="LineNr">4178 </span> b8/copy-to-EAX <span class="Constant">"0x34)"</span>/imm32 +<span id="L4179" class="LineNr">4179 </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="L4180" class="LineNr">4180 </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="L4181" class="LineNr">4181 </span> 05/add-to-EAX 4/imm32 +<span id="L4182" class="LineNr">4182 </span> <span class="subxComment"># var slice/ECX = {EAX, ECX}</span> +<span id="L4183" class="LineNr">4183 </span> 51/push-ECX +<span id="L4184" class="LineNr">4184 </span> 50/push-EAX +<span id="L4185" class="LineNr">4185 </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="L4186" class="LineNr">4186 </span> <span class="subxComment"># EAX = next-positive-hex-int(slice)</span> +<span id="L4187" class="LineNr">4187 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L4188" class="LineNr">4188 </span> 51/push-ECX +<span id="L4189" class="LineNr">4189 </span> <span class="subxS2Comment"># . . call</span> +<span id="L4190" class="LineNr">4190 </span> e8/call <a href='desugar.subx.html#L4018'>next-positive-hex-int</a>/disp32 +<span id="L4191" class="LineNr">4191 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L4192" class="LineNr">4192 </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="L4193" class="LineNr">4193 </span> <span class="subxComment"># check-ints-equal(EAX, 0x34, msg)</span> +<span id="L4194" class="LineNr">4194 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L4195" class="LineNr">4195 </span> 68/push <span class="Constant">"F - test-next-positive-hex-int-0x-prefix"</span>/imm32 +<span id="L4196" class="LineNr">4196 </span> 68/push 0x34/imm32 +<span id="L4197" class="LineNr">4197 </span> 50/push-EAX +<span id="L4198" class="LineNr">4198 </span> <span class="subxS2Comment"># . . call</span> +<span id="L4199" class="LineNr">4199 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L4200" class="LineNr">4200 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L4201" class="LineNr">4201 </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="L4202" class="LineNr">4202 </span> <span class="subxS1Comment"># . epilog</span> +<span id="L4203" class="LineNr">4203 </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="L4204" class="LineNr">4204 </span> 5d/pop-to-EBP +<span id="L4205" class="LineNr">4205 </span> c3/return +<span id="L4206" class="LineNr">4206 </span> +<span id="L4207" class="LineNr">4207 </span><span class="subxTest">test-next-positive-hex-int-zero</span>: +<span id="L4208" class="LineNr">4208 </span> <span class="subxS1Comment"># . prolog</span> +<span id="L4209" class="LineNr">4209 </span> 55/push-EBP +<span id="L4210" class="LineNr">4210 </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="L4211" class="LineNr">4211 </span> <span class="subxComment"># (EAX..ECX) = "0"</span> +<span id="L4212" class="LineNr">4212 </span> b8/copy-to-EAX <span class="Constant">"0"</span>/imm32 +<span id="L4213" class="LineNr">4213 </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="L4214" class="LineNr">4214 </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="L4215" class="LineNr">4215 </span> 05/add-to-EAX 4/imm32 +<span id="L4216" class="LineNr">4216 </span> <span class="subxComment"># var slice/ECX = {EAX, ECX}</span> +<span id="L4217" class="LineNr">4217 </span> 51/push-ECX +<span id="L4218" class="LineNr">4218 </span> 50/push-EAX +<span id="L4219" class="LineNr">4219 </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="L4220" class="LineNr">4220 </span> <span class="subxComment"># EAX = next-positive-hex-int(slice)</span> +<span id="L4221" class="LineNr">4221 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L4222" class="LineNr">4222 </span> 51/push-ECX +<span id="L4223" class="LineNr">4223 </span> <span class="subxS2Comment"># . . call</span> +<span id="L4224" class="LineNr">4224 </span> e8/call <a href='desugar.subx.html#L4018'>next-positive-hex-int</a>/disp32 +<span id="L4225" class="LineNr">4225 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L4226" class="LineNr">4226 </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="L4227" class="LineNr">4227 </span> <span class="subxComment"># check-ints-equal(EAX, 0, msg)</span> +<span id="L4228" class="LineNr">4228 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L4229" class="LineNr">4229 </span> 68/push <span class="Constant">"F - test-next-positive-hex-int-zero"</span>/imm32 +<span id="L4230" class="LineNr">4230 </span> 68/push 0/imm32 +<span id="L4231" class="LineNr">4231 </span> 50/push-EAX +<span id="L4232" class="LineNr">4232 </span> <span class="subxS2Comment"># . . call</span> +<span id="L4233" class="LineNr">4233 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L4234" class="LineNr">4234 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L4235" class="LineNr">4235 </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="L4236" class="LineNr">4236 </span> <span class="subxS1Comment"># . epilog</span> +<span id="L4237" class="LineNr">4237 </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="L4238" class="LineNr">4238 </span> 5d/pop-to-EBP +<span id="L4239" class="LineNr">4239 </span> c3/return +<span id="L4240" class="LineNr">4240 </span> +<span id="L4241" class="LineNr">4241 </span><span class="subxTest">test-next-positive-hex-int-0-prefix</span>: +<span id="L4242" class="LineNr">4242 </span> <span class="subxS1Comment"># . prolog</span> +<span id="L4243" class="LineNr">4243 </span> 55/push-EBP +<span id="L4244" class="LineNr">4244 </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="L4245" class="LineNr">4245 </span> <span class="subxComment"># (EAX..ECX) = "03)"</span> +<span id="L4246" class="LineNr">4246 </span> b8/copy-to-EAX <span class="Constant">"03)"</span>/imm32 +<span id="L4247" class="LineNr">4247 </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="L4248" class="LineNr">4248 </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="L4249" class="LineNr">4249 </span> 05/add-to-EAX 4/imm32 +<span id="L4250" class="LineNr">4250 </span> <span class="subxComment"># var slice/ECX = {EAX, ECX}</span> +<span id="L4251" class="LineNr">4251 </span> 51/push-ECX +<span id="L4252" class="LineNr">4252 </span> 50/push-EAX +<span id="L4253" class="LineNr">4253 </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="L4254" class="LineNr">4254 </span> <span class="subxComment"># EAX = next-positive-hex-int(slice)</span> +<span id="L4255" class="LineNr">4255 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L4256" class="LineNr">4256 </span> 51/push-ECX +<span id="L4257" class="LineNr">4257 </span> <span class="subxS2Comment"># . . call</span> +<span id="L4258" class="LineNr">4258 </span> e8/call <a href='desugar.subx.html#L4018'>next-positive-hex-int</a>/disp32 +<span id="L4259" class="LineNr">4259 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L4260" class="LineNr">4260 </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="L4261" class="LineNr">4261 </span> <span class="subxComment"># check-ints-equal(EAX, 3, msg)</span> +<span id="L4262" class="LineNr">4262 </span> <span class="subxS2Comment"># . . push args</span> +<span id="L4263" class="LineNr">4263 </span> 68/push <span class="Constant">"F - test-next-positive-hex-int-0-prefix"</span>/imm32 +<span id="L4264" class="LineNr">4264 </span> 68/push 3/imm32 +<span id="L4265" class="LineNr">4265 </span> 50/push-EAX +<span id="L4266" class="LineNr">4266 </span> <span class="subxS2Comment"># . . call</span> +<span id="L4267" class="LineNr">4267 </span> e8/call <a href='../051test.subx.html#L24'>check-ints-equal</a>/disp32 +<span id="L4268" class="LineNr">4268 </span> <span class="subxS2Comment"># . . discard args</span> +<span id="L4269" class="LineNr">4269 </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="L4270" class="LineNr">4270 </span> <span class="subxS1Comment"># . epilog</span> +<span id="L4271" class="LineNr">4271 </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="L4272" class="LineNr">4272 </span> 5d/pop-to-EBP +<span id="L4273" class="LineNr">4273 </span> c3/return +<span id="L4274" class="LineNr">4274 </span> +<span id="L4275" class="LineNr">4275 </span>== data +<span id="L4276" class="LineNr">4276 </span><span class="SpecialChar">Registers</span>: <span class="subxComment"># (table string int)</span> +<span id="L4277" class="LineNr">4277 </span> <span class="subxComment"># a table is a stream</span> +<span id="L4278" class="LineNr">4278 </span> 0x40/imm32/write +<span id="L4279" class="LineNr">4279 </span> 0/imm32/read +<span id="L4280" class="LineNr">4280 </span> 0x40/imm32/length +<span id="L4281" class="LineNr">4281 </span> <span class="subxComment"># data</span> +<span id="L4282" class="LineNr">4282 </span> <span class="Constant">"eax"</span>/imm32 0/imm32 +<span id="L4283" class="LineNr">4283 </span> <span class="Constant">"ecx"</span>/imm32 1/imm32 +<span id="L4284" class="LineNr">4284 </span> <span class="Constant">"edx"</span>/imm32 2/imm32 +<span id="L4285" class="LineNr">4285 </span> <span class="Constant">"ebx"</span>/imm32 3/imm32 +<span id="L4286" class="LineNr">4286 </span> <span class="Constant">"esp"</span>/imm32 4/imm32 +<span id="L4287" class="LineNr">4287 </span> <span class="Constant">"ebp"</span>/imm32 5/imm32 +<span id="L4288" class="LineNr">4288 </span> <span class="Constant">"esi"</span>/imm32 6/imm32 +<span id="L4289" class="LineNr">4289 </span> <span class="Constant">"edi"</span>/imm32 7/imm32 +<span id="L4290" class="LineNr">4290 </span> +<span id="L4291" class="LineNr">4291 </span><span class="subxS2Comment"># . . vim:nowrap:textwidth=0</span> </pre> </body> </html> |