This commit is contained in:
Kartik Agaram 2021-05-18 13:01:59 -07:00
parent b4c0b12542
commit 5396e24cba
74 changed files with 47941 additions and 42093 deletions

View File

@ -94,7 +94,7 @@ if ('onhashchange' in window) {
<span id="L37" class="LineNr">37 </span> <span class="subxComment"># var next-key/eax: byte = *buffer-byte-addr</span>
<span id="L38" class="LineNr">38 </span> 8a/byte-&gt; *ecx 0/r32/AL
<span id="L39" class="LineNr">39 </span> <span class="subxComment"># if (next-key != 0) lock and remove from keyboard buffer</span>
<span id="L40" class="LineNr">40 </span> 81 7/subop/compare %eax 0/imm32
<span id="L40" class="LineNr">40 </span> 3d/compare-eax-with 0/imm32
<span id="L41" class="LineNr">41 </span> {
<span id="L42" class="LineNr">42 </span> 74/jump-if-= <span class="Constant">break</span>/disp8
<span id="L43" class="LineNr">43 </span> fa/disable-interrupts

View File

@ -102,7 +102,7 @@ if ('onhashchange' in window) {
<span id="L45" class="LineNr"> 45 </span> <span class="subxComment"># var xcurr/eax: int = x*8 + 7</span>
<span id="L46" class="LineNr"> 46 </span> 8b/-&gt; *(ebp+0xc) 0/r32/eax <span class="subxComment"># font-width - 1</span>
<span id="L47" class="LineNr"> 47 </span> c1 4/subop/shift-left %eax 3/imm8
<span id="L48" class="LineNr"> 48 </span> 81 0/subop/add %eax 7/imm32
<span id="L48" class="LineNr"> 48 </span> 05/add-to-eax 7/imm32
<span id="L49" class="LineNr"> 49 </span> <span class="subxComment"># var xmin/ecx: int = x*8</span>
<span id="L50" class="LineNr"> 50 </span> 8b/-&gt; *(ebp+0xc) 1/r32/ecx
<span id="L51" class="LineNr"> 51 </span> c1 4/subop/shift-left %ecx 3/imm8

View File

@ -254,7 +254,7 @@ if ('onhashchange' in window) {
<span id="L194" class="LineNr">194 </span> 73/jump-if-addr&gt;= $_append-4:end/disp8
<span id="L195" class="LineNr">195 </span> <span class="subxComment"># if (out &gt;= outend) abort # just to catch test failures fast</span>
<span id="L196" class="LineNr">196 </span> 39/compare 3/mod/direct 7/rm32/edi <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 edi with edx</span>
<span id="L197" class="LineNr">197 </span> 73/jump-if-addr&gt;= $_append-4:end/disp8 <span class="subxComment"># TODO: abort</span>
<span id="L197" class="LineNr">197 </span> 0f 83/jump-if-addr&gt;= $_append-4:<a href='317abort.subx.html#L5'>abort</a>/disp32
<span id="L198" class="LineNr">198 </span> <span class="subxComment"># *out = *in</span>
<span id="L199" class="LineNr">199 </span> 8a/copy-byte 0/mod/indirect 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 3/r32/BL <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy byte at *esi to BL</span>
<span id="L200" class="LineNr">200 </span> 88/copy-byte 0/mod/indirect 7/rm32/edi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 3/r32/BL <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy byte at BL to *edi</span>
@ -277,7 +277,13 @@ if ('onhashchange' in window) {
<span id="L217" class="LineNr">217 </span> 5d/pop-to-ebp
<span id="L218" class="LineNr">218 </span> c3/return
<span id="L219" class="LineNr">219 </span>
<span id="L220" class="LineNr">220 </span><span class="subxS2Comment"># . . vim&#0058;nowrap:textwidth=0</span>
<span id="L220" class="LineNr">220 </span><span class="Constant">$_append-4:<a href='317abort.subx.html#L5'>abort</a></span>:
<span id="L221" class="LineNr">221 </span> (<a href='501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">&quot;_append-4: stream full at &quot;</span> 3 0) <span class="subxComment"># 3=cyan</span>
<span id="L222" class="LineNr">222 </span> (<a href='501draw-text.mu.html#L312'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 %eax 3 0)
<span id="L223" class="LineNr">223 </span> (<a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;&quot;</span>)
<span id="L224" class="LineNr">224 </span> <span class="subxComment"># never gets here</span>
<span id="L225" class="LineNr">225 </span>
<span id="L226" class="LineNr">226 </span><span class="subxS2Comment"># . . vim&#0058;nowrap:textwidth=0</span>
</pre>
</body>
</html>

View File

@ -82,7 +82,7 @@ if ('onhashchange' in window) {
<span id="L23" class="LineNr"> 23 </span> 8b/copy 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(esi+4) to ecx</span>
<span id="L24" class="LineNr"> 24 </span> <span class="subxComment"># if (f-&gt;read &gt;= f-&gt;write) abort</span>
<span id="L25" class="LineNr"> 25 </span> 3b/compare 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"># compare ecx with *esi</span>
<span id="L26" class="LineNr"> 26 </span> 0f 8d/jump-if-&gt;= $read-byte:<a href='501draw-text.mu.html#L481'>abort</a>/disp32
<span id="L26" class="LineNr"> 26 </span> 0f 8d/jump-if-&gt;= $read-byte:<a href='317abort.subx.html#L5'>abort</a>/disp32
<span id="L27" class="LineNr"> 27 </span> <span class="subxComment"># result = f-&gt;data[f-&gt;read]</span>
<span id="L28" class="LineNr"> 28 </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="L29" class="LineNr"> 29 </span> 8a/copy-byte 1/mod/*+disp8 4/rm32/sib 6/base/esi 1/index/ecx <span class="Normal"> . </span> 0/r32/AL 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy byte at *(esi+ecx+12) to AL</span>
@ -97,23 +97,23 @@ if ('onhashchange' in window) {
<span id="L38" class="LineNr"> 38 </span> 5d/pop-to-ebp
<span id="L39" class="LineNr"> 39 </span> c3/return
<span id="L40" class="LineNr"> 40 </span>
<span id="L41" class="LineNr"> 41 </span><span class="Constant">$read-byte:<a href='501draw-text.mu.html#L481'>abort</a></span>:
<span id="L42" class="LineNr"> 42 </span> (<a href='501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">&quot;read-byte: empty stream&quot;</span> 3 0) <span class="subxComment"># 3=cyan</span>
<span id="L43" class="LineNr"> 43 </span> {
<span id="L44" class="LineNr"> 44 </span> eb/jump <span class="Constant">loop</span>/disp8
<span id="L45" class="LineNr"> 45 </span> }
<span id="L46" class="LineNr"> 46 </span> <span class="subxComment"># never gets here</span>
<span id="L47" class="LineNr"> 47 </span>
<span id="L48" class="LineNr"> 48 </span>== data
<span id="L49" class="LineNr"> 49 </span>
<span id="L50" class="LineNr"> 50 </span><span class="subxMinorFunction">_test-input-stream</span>: <span class="subxComment"># (stream byte)</span>
<span id="L51" class="LineNr"> 51 </span> <span class="subxComment"># current write index</span>
<span id="L52" class="LineNr"> 52 </span> 0/imm32
<span id="L53" class="LineNr"> 53 </span> <span class="subxComment"># current read index</span>
<span id="L54" class="LineNr"> 54 </span> 0/imm32
<span id="L55" class="LineNr"> 55 </span> <span class="subxComment"># size</span>
<span id="L56" class="LineNr"> 56 </span> 0x400/imm32 <span class="subxComment"># 1024 bytes</span>
<span id="L57" class="LineNr"> 57 </span> <span class="subxComment"># data (64 lines x 16 bytes/line)</span>
<span id="L41" class="LineNr"> 41 </span><span class="Constant">$read-byte:<a href='317abort.subx.html#L5'>abort</a></span>:
<span id="L42" class="LineNr"> 42 </span> (<a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;read-byte: empty stream&quot;</span>)
<span id="L43" class="LineNr"> 43 </span> <span class="subxComment"># never gets here</span>
<span id="L44" class="LineNr"> 44 </span>
<span id="L45" class="LineNr"> 45 </span>== data
<span id="L46" class="LineNr"> 46 </span>
<span id="L47" class="LineNr"> 47 </span><span class="subxMinorFunction">_test-input-stream</span>: <span class="subxComment"># (stream byte)</span>
<span id="L48" class="LineNr"> 48 </span> <span class="subxComment"># current write index</span>
<span id="L49" class="LineNr"> 49 </span> 0/imm32
<span id="L50" class="LineNr"> 50 </span> <span class="subxComment"># current read index</span>
<span id="L51" class="LineNr"> 51 </span> 0/imm32
<span id="L52" class="LineNr"> 52 </span> <span class="subxComment"># size</span>
<span id="L53" class="LineNr"> 53 </span> 0x400/imm32 <span class="subxComment"># 1024 bytes</span>
<span id="L54" class="LineNr"> 54 </span> <span class="subxComment"># data (64 lines x 16 bytes/line)</span>
<span id="L55" class="LineNr"> 55 </span> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
<span id="L56" class="LineNr"> 56 </span> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
<span id="L57" class="LineNr"> 57 </span> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
<span id="L58" class="LineNr"> 58 </span> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
<span id="L59" class="LineNr"> 59 </span> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
<span id="L60" class="LineNr"> 60 </span> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
@ -175,11 +175,8 @@ if ('onhashchange' in window) {
<span id="L116" class="LineNr">116 </span> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
<span id="L117" class="LineNr">117 </span> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
<span id="L118" class="LineNr">118 </span> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
<span id="L119" class="LineNr">119 </span> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
<span id="L120" class="LineNr">120 </span> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
<span id="L121" class="LineNr">121 </span> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
<span id="L122" class="LineNr">122 </span>
<span id="L123" class="LineNr">123 </span><span class="subxS2Comment"># . . vim&#0058;nowrap:textwidth=0</span>
<span id="L119" class="LineNr">119 </span>
<span id="L120" class="LineNr">120 </span><span class="subxS2Comment"># . . vim&#0058;nowrap:textwidth=0</span>
</pre>
</body>
</html>

View File

@ -83,7 +83,7 @@ if ('onhashchange' in window) {
<span id="L23" class="LineNr">23 </span> 8b/copy 0/mod/indirect 7/rm32/edi <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 *edi to ecx</span>
<span id="L24" class="LineNr">24 </span> <span class="subxComment"># if (f-&gt;write &gt;= f-&gt;size) abort</span>
<span id="L25" class="LineNr">25 </span> 3b/compare 1/mod/*+disp8 7/rm32/edi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># compare ecx with *(edi+8)</span>
<span id="L26" class="LineNr">26 </span> 7d/jump-if-&gt;= $append-byte:<a href='501draw-text.mu.html#L481'>abort</a>/disp8
<span id="L26" class="LineNr">26 </span> 7d/jump-if-&gt;= $append-byte:<a href='317abort.subx.html#L5'>abort</a>/disp8
<span id="L27" class="LineNr">27 </span><span class="Constant">$append-byte:to-stream</span>:
<span id="L28" class="LineNr">28 </span> <span class="subxComment"># write to stream</span>
<span id="L29" class="LineNr">29 </span> <span class="subxComment"># f-&gt;data[f-&gt;write] = LSB(n)</span>
@ -102,44 +102,41 @@ if ('onhashchange' in window) {
<span id="L42" class="LineNr">42 </span> 5d/pop-to-ebp
<span id="L43" class="LineNr">43 </span> c3/return
<span id="L44" class="LineNr">44 </span>
<span id="L45" class="LineNr">45 </span><span class="Constant">$append-byte:<a href='501draw-text.mu.html#L481'>abort</a></span>:
<span id="L46" class="LineNr">46 </span> (<a href='501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">&quot;append-byte: out of space\n&quot;</span> 3 0) <span class="subxComment"># 3=cyan</span>
<span id="L47" class="LineNr">47 </span> {
<span id="L48" class="LineNr">48 </span> eb/jump <span class="Constant">loop</span>/disp8
<span id="L49" class="LineNr">49 </span> }
<span id="L50" class="LineNr">50 </span> <span class="subxComment"># never gets here</span>
<span id="L51" class="LineNr">51 </span>
<span id="L52" class="LineNr">52 </span><span class="subxTest">test-append-byte-single</span>:
<span id="L53" class="LineNr">53 </span> <span class="subxH1Comment"># - check that append-byte writes to first byte of 'file'</span>
<span id="L54" class="LineNr">54 </span> <span class="subxComment"># setup</span>
<span id="L55" class="LineNr">55 </span> <span class="subxS1Comment"># . clear-stream(_test-stream)</span>
<span id="L56" class="LineNr">56 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L57" class="LineNr">57 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L58" class="LineNr">58 </span> <span class="subxS2Comment"># . . call</span>
<span id="L59" class="LineNr">59 </span> e8/call <a href='106stream.subx.html#L20'>clear-stream</a>/disp32
<span id="L60" class="LineNr">60 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L61" class="LineNr">61 </span> 81 0/subop/add 3/mod/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="L62" class="LineNr">62 </span> <span class="subxComment"># append-byte(_test-stream, 'A')</span>
<span id="L63" class="LineNr">63 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L64" class="LineNr">64 </span> 68/push 0x41/imm32
<span id="L65" class="LineNr">65 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L66" class="LineNr">66 </span> <span class="subxS2Comment"># . . call</span>
<span id="L67" class="LineNr">67 </span> e8/call <a href='115write-byte.subx.html#L12'>append-byte</a>/disp32
<span id="L68" class="LineNr">68 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L69" class="LineNr">69 </span> 81 0/subop/add 3/mod/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="L70" class="LineNr">70 </span> <span class="subxComment"># check-stream-equal(_test-stream, &quot;A&quot;, msg)</span>
<span id="L71" class="LineNr">71 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L72" class="LineNr">72 </span> 68/push <span class="Constant">&quot;F - test-append-byte-single&quot;</span>/imm32
<span id="L73" class="LineNr">73 </span> 68/push <span class="Constant">&quot;A&quot;</span>/imm32
<span id="L74" class="LineNr">74 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L75" class="LineNr">75 </span> <span class="subxS2Comment"># . . call</span>
<span id="L76" class="LineNr">76 </span> e8/call <a href='109stream-equal.subx.html#L194'>check-stream-equal</a>/disp32
<span id="L77" class="LineNr">77 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L78" class="LineNr">78 </span> 81 0/subop/add 3/mod/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="L79" class="LineNr">79 </span> <span class="subxS1Comment"># . end</span>
<span id="L80" class="LineNr">80 </span> c3/return
<span id="L81" class="LineNr">81 </span>
<span id="L82" class="LineNr">82 </span><span class="subxS2Comment"># . . vim&#0058;nowrap:textwidth=0</span>
<span id="L45" class="LineNr">45 </span><span class="Constant">$append-byte:<a href='317abort.subx.html#L5'>abort</a></span>:
<span id="L46" class="LineNr">46 </span> (<a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;append-byte: out of space&quot;</span>)
<span id="L47" class="LineNr">47 </span> <span class="subxComment"># never gets here</span>
<span id="L48" class="LineNr">48 </span>
<span id="L49" class="LineNr">49 </span><span class="subxTest">test-append-byte-single</span>:
<span id="L50" class="LineNr">50 </span> <span class="subxH1Comment"># - check that append-byte writes to first byte of 'file'</span>
<span id="L51" class="LineNr">51 </span> <span class="subxComment"># setup</span>
<span id="L52" class="LineNr">52 </span> <span class="subxS1Comment"># . clear-stream(_test-stream)</span>
<span id="L53" class="LineNr">53 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L54" class="LineNr">54 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L55" class="LineNr">55 </span> <span class="subxS2Comment"># . . call</span>
<span id="L56" class="LineNr">56 </span> e8/call <a href='106stream.subx.html#L20'>clear-stream</a>/disp32
<span id="L57" class="LineNr">57 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L58" class="LineNr">58 </span> 81 0/subop/add 3/mod/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="L59" class="LineNr">59 </span> <span class="subxComment"># append-byte(_test-stream, 'A')</span>
<span id="L60" class="LineNr">60 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L61" class="LineNr">61 </span> 68/push 0x41/imm32
<span id="L62" class="LineNr">62 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L63" class="LineNr">63 </span> <span class="subxS2Comment"># . . call</span>
<span id="L64" class="LineNr">64 </span> e8/call <a href='115write-byte.subx.html#L12'>append-byte</a>/disp32
<span id="L65" class="LineNr">65 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L66" class="LineNr">66 </span> 81 0/subop/add 3/mod/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="L67" class="LineNr">67 </span> <span class="subxComment"># check-stream-equal(_test-stream, &quot;A&quot;, msg)</span>
<span id="L68" class="LineNr">68 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L69" class="LineNr">69 </span> 68/push <span class="Constant">&quot;F - test-append-byte-single&quot;</span>/imm32
<span id="L70" class="LineNr">70 </span> 68/push <span class="Constant">&quot;A&quot;</span>/imm32
<span id="L71" class="LineNr">71 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L72" class="LineNr">72 </span> <span class="subxS2Comment"># . . call</span>
<span id="L73" class="LineNr">73 </span> e8/call <a href='109stream-equal.subx.html#L194'>check-stream-equal</a>/disp32
<span id="L74" class="LineNr">74 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L75" class="LineNr">75 </span> 81 0/subop/add 3/mod/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="L76" class="LineNr">76 </span> <span class="subxS1Comment"># . end</span>
<span id="L77" class="LineNr">77 </span> c3/return
<span id="L78" class="LineNr">78 </span>
<span id="L79" class="LineNr">79 </span><span class="subxS2Comment"># . . vim&#0058;nowrap:textwidth=0</span>
</pre>
</body>
</html>

View File

@ -924,11 +924,11 @@ if ('onhashchange' in window) {
<span id="L865" class="LineNr">865 </span><span class="Constant">$from-hex-char:check0</span>:
<span id="L866" class="LineNr">866 </span> <span class="subxComment"># if (eax &lt; '0') goto abort</span>
<span id="L867" class="LineNr">867 </span> 3d/compare-eax-with 0x30/imm32/0
<span id="L868" class="LineNr">868 </span> 7c/jump-if-&lt; $from-hex-char:<a href='501draw-text.mu.html#L481'>abort</a>/disp8
<span id="L868" class="LineNr">868 </span> 7c/jump-if-&lt; $from-hex-char:<a href='317abort.subx.html#L5'>abort</a>/disp8
<span id="L869" class="LineNr">869 </span><span class="Constant">$from-hex-char:check1</span>:
<span id="L870" class="LineNr">870 </span> <span class="subxComment"># if (eax &gt; 'f') goto abort</span>
<span id="L871" class="LineNr">871 </span> 3d/compare-eax-with 0x66/imm32/f
<span id="L872" class="LineNr">872 </span> 7f/jump-if-&gt; $from-hex-char:<a href='501draw-text.mu.html#L481'>abort</a>/disp8
<span id="L872" class="LineNr">872 </span> 7f/jump-if-&gt; $from-hex-char:<a href='317abort.subx.html#L5'>abort</a>/disp8
<span id="L873" class="LineNr">873 </span><span class="Constant">$from-hex-char:check2</span>:
<span id="L874" class="LineNr">874 </span> <span class="subxComment"># if (eax &gt; '9') goto next check</span>
<span id="L875" class="LineNr">875 </span> 3d/compare-eax-with 0x39/imm32/9
@ -940,20 +940,17 @@ if ('onhashchange' in window) {
<span id="L881" class="LineNr">881 </span><span class="Constant">$from-hex-char:check3</span>:
<span id="L882" class="LineNr">882 </span> <span class="subxComment"># if (eax &lt; 'a') goto abort</span>
<span id="L883" class="LineNr">883 </span> 3d/compare-eax-with 0x61/imm32/a
<span id="L884" class="LineNr">884 </span> 7c/jump-if-&lt; $from-hex-char:<a href='501draw-text.mu.html#L481'>abort</a>/disp8
<span id="L884" class="LineNr">884 </span> 7c/jump-if-&lt; $from-hex-char:<a href='317abort.subx.html#L5'>abort</a>/disp8
<span id="L885" class="LineNr">885 </span><span class="Constant">$from-hex-char:letter</span>:
<span id="L886" class="LineNr">886 </span> <span class="subxComment"># return eax - ('a'-10)</span>
<span id="L887" class="LineNr">887 </span> 2d/subtract-from-eax 0x57/imm32/a-10
<span id="L888" class="LineNr">888 </span> c3/return
<span id="L889" class="LineNr">889 </span>
<span id="L890" class="LineNr">890 </span><span class="Constant">$from-hex-char:<a href='501draw-text.mu.html#L481'>abort</a></span>:
<span id="L891" class="LineNr">891 </span> (<a href='501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">&quot;invalid hex char&quot;</span> 3 0) <span class="subxComment"># 3=cyan</span>
<span id="L892" class="LineNr">892 </span> {
<span id="L893" class="LineNr">893 </span> eb/jump <span class="Constant">loop</span>/disp8
<span id="L894" class="LineNr">894 </span> }
<span id="L895" class="LineNr">895 </span> <span class="subxComment"># never gets here</span>
<span id="L896" class="LineNr">896 </span>
<span id="L897" class="LineNr">897 </span><span class="subxS2Comment"># . . vim&#0058;nowrap:textwidth=0</span>
<span id="L890" class="LineNr">890 </span><span class="Constant">$from-hex-char:<a href='317abort.subx.html#L5'>abort</a></span>:
<span id="L891" class="LineNr">891 </span> (<a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;invalid hex char&quot;</span>)
<span id="L892" class="LineNr">892 </span> <span class="subxComment"># never gets here</span>
<span id="L893" class="LineNr">893 </span>
<span id="L894" class="LineNr">894 </span><span class="subxS2Comment"># . . vim&#0058;nowrap:textwidth=0</span>
</pre>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@ -79,7 +79,7 @@ if ('onhashchange' in window) {
<span id="L20" class="LineNr"> 20 </span> f7 4/subop/multiply 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># multiply *(ebp+12) into edx:eax</span>
<span id="L21" class="LineNr"> 21 </span> <span class="subxS1Comment"># . if overflow abort</span>
<span id="L22" class="LineNr"> 22 </span> 81 7/subop/compare 3/mod/direct 2/rm32/edx <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 edx</span>
<span id="L23" class="LineNr"> 23 </span> 75/jump-if-!= $new-stream:<a href='501draw-text.mu.html#L481'>abort</a>/disp8
<span id="L23" class="LineNr"> 23 </span> 75/jump-if-!= $new-stream:<a href='317abort.subx.html#L5'>abort</a>/disp8
<span id="L24" class="LineNr"> 24 </span> <span class="subxS1Comment"># . edx = elemsize*length</span>
<span id="L25" class="LineNr"> 25 </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="L26" class="LineNr"> 26 </span> <span class="subxComment"># var n/eax: int = size + 12 (for read, write and size)</span>
@ -116,74 +116,71 @@ if ('onhashchange' in window) {
<span id="L57" class="LineNr"> 57 </span> 5d/pop-to-ebp
<span id="L58" class="LineNr"> 58 </span> c3/return
<span id="L59" class="LineNr"> 59 </span>
<span id="L60" class="LineNr"> 60 </span><span class="Constant">$new-stream:<a href='501draw-text.mu.html#L481'>abort</a></span>:
<span id="L61" class="LineNr"> 61 </span> (<a href='501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">&quot;new-stream: size too large&quot;</span> 3 0) <span class="subxComment"># 3=cyan</span>
<span id="L62" class="LineNr"> 62 </span> {
<span id="L63" class="LineNr"> 63 </span> eb/jump <span class="Constant">loop</span>/disp8
<span id="L64" class="LineNr"> 64 </span> }
<span id="L65" class="LineNr"> 65 </span> <span class="subxComment"># never gets here</span>
<span id="L66" class="LineNr"> 66 </span>
<span id="L67" class="LineNr"> 67 </span><span class="subxTest">test-new-stream</span>:
<span id="L68" class="LineNr"> 68 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L69" class="LineNr"> 69 </span> 55/push-ebp
<span id="L70" class="LineNr"> 70 </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="L71" class="LineNr"> 71 </span> <span class="subxComment"># var ad/ecx: allocation-descriptor containing 16 bytes</span>
<span id="L72" class="LineNr"> 72 </span> <span class="subxS1Comment"># . var end/ecx: (addr byte)</span>
<span id="L73" class="LineNr"> 73 </span> 89/&lt;- %ecx 4/r32/esp
<span id="L74" class="LineNr"> 74 </span> <span class="subxS1Comment"># . var start/edx: (addr byte) = end - 32</span>
<span id="L75" class="LineNr"> 75 </span> 81 5/subop/subtract %esp 0x20/imm32
<span id="L76" class="LineNr"> 76 </span> 89/&lt;- %edx 4/r32/esp
<span id="L77" class="LineNr"> 77 </span> <span class="subxS1Comment"># . ad = {start, end}</span>
<span id="L78" class="LineNr"> 78 </span> 51/push-ecx
<span id="L79" class="LineNr"> 79 </span> 52/push-edx
<span id="L80" class="LineNr"> 80 </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="L81" class="LineNr"> 81 </span> <span class="subxComment"># var start/edx = ad-&gt;curr</span>
<span id="L82" class="LineNr"> 82 </span> 8b/copy 0/mod/indirect 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"># copy *ecx to edx</span>
<span id="L83" class="LineNr"> 83 </span> <span class="subxComment"># var h/ebx: (handle stream byte)</span>
<span id="L84" class="LineNr"> 84 </span> 68/push 0/imm32
<span id="L85" class="LineNr"> 85 </span> 68/push 0/imm32
<span id="L86" class="LineNr"> 86 </span> 89/copy 3/mod/direct 3/rm32/ebx <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 ebx</span>
<span id="L87" class="LineNr"> 87 </span> <span class="subxComment"># new-stream(ad, 3, 2, h)</span>
<span id="L88" class="LineNr"> 88 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L89" class="LineNr"> 89 </span> 53/push-ebx
<span id="L90" class="LineNr"> 90 </span> 68/push 2/imm32
<span id="L91" class="LineNr"> 91 </span> 68/push 3/imm32
<span id="L92" class="LineNr"> 92 </span> 51/push-ecx
<span id="L93" class="LineNr"> 93 </span> <span class="subxS2Comment"># . . call</span>
<span id="L94" class="LineNr"> 94 </span> e8/call <a href='121new-stream.subx.html#L8'>new-stream</a>/disp32
<span id="L95" class="LineNr"> 95 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L96" class="LineNr"> 96 </span> 81 0/subop/add 3/mod/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="L97" class="LineNr"> 97 </span> <span class="subxComment"># eax = out-&gt;payload</span>
<span id="L98" class="LineNr"> 98 </span> 8b/copy 1/mod/*+disp8 3/rm32/ebx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebx+4) to eax</span>
<span id="L99" class="LineNr"> 99 </span> <span class="subxComment"># check-ints-equal(eax, edx, msg)</span>
<span id="L100" class="LineNr">100 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L101" class="LineNr">101 </span> 68/push <span class="Constant">&quot;F - <a href='121new-stream.subx.html#L67'>test-new-stream</a>: returns current pointer of allocation descriptor&quot;</span>/imm32
<span id="L102" class="LineNr">102 </span> 52/push-edx
<span id="L103" class="LineNr">103 </span> 50/push-eax
<span id="L104" class="LineNr">104 </span> <span class="subxS2Comment"># . . call</span>
<span id="L105" class="LineNr">105 </span> e8/call <a href='502test.mu.html#L2'>check-ints-equal</a>/disp32
<span id="L106" class="LineNr">106 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L107" class="LineNr">107 </span> 81 0/subop/add 3/mod/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="L108" class="LineNr">108 </span> <span class="subxComment"># skip payload-&gt;allocid</span>
<span id="L109" class="LineNr">109 </span> 05/add-to-eax 4/imm32
<span id="L110" class="LineNr">110 </span> <span class="subxComment"># check-ints-equal(eax-&gt;size, 6, msg)</span>
<span id="L111" class="LineNr">111 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L112" class="LineNr">112 </span> 68/push <span class="Constant">&quot;F - <a href='121new-stream.subx.html#L67'>test-new-stream</a>: sets size correctly&quot;</span>/imm32
<span id="L113" class="LineNr">113 </span> 68/push 6/imm32
<span id="L114" class="LineNr">114 </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> <span class="Normal"> . </span> 8/disp8 <span class="subxComment"># push *(eax+8)</span>
<span id="L115" class="LineNr">115 </span> <span class="subxS2Comment"># . . call</span>
<span id="L116" class="LineNr">116 </span> e8/call <a href='502test.mu.html#L2'>check-ints-equal</a>/disp32
<span id="L117" class="LineNr">117 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L118" class="LineNr">118 </span> 81 0/subop/add 3/mod/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="L119" class="LineNr">119 </span> <span class="subxComment"># the rest is delegated to clear-stream() so we won't bother checking it</span>
<span id="L120" class="LineNr">120 </span> <span class="subxS1Comment"># . reclaim locals</span>
<span id="L121" class="LineNr">121 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x30/imm32 <span class="subxComment"># add to esp</span>
<span id="L122" class="LineNr">122 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L123" class="LineNr">123 </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="L124" class="LineNr">124 </span> 5d/pop-to-ebp
<span id="L125" class="LineNr">125 </span> c3/return
<span id="L126" class="LineNr">126 </span>
<span id="L127" class="LineNr">127 </span><span class="subxS2Comment"># . . vim&#0058;nowrap:textwidth=0</span>
<span id="L60" class="LineNr"> 60 </span><span class="Constant">$new-stream:<a href='317abort.subx.html#L5'>abort</a></span>:
<span id="L61" class="LineNr"> 61 </span> (<a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;new-stream: size too large&quot;</span>)
<span id="L62" class="LineNr"> 62 </span> <span class="subxComment"># never gets here</span>
<span id="L63" class="LineNr"> 63 </span>
<span id="L64" class="LineNr"> 64 </span><span class="subxTest">test-new-stream</span>:
<span id="L65" class="LineNr"> 65 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L66" class="LineNr"> 66 </span> 55/push-ebp
<span id="L67" class="LineNr"> 67 </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="L68" class="LineNr"> 68 </span> <span class="subxComment"># var ad/ecx: allocation-descriptor containing 16 bytes</span>
<span id="L69" class="LineNr"> 69 </span> <span class="subxS1Comment"># . var end/ecx: (addr byte)</span>
<span id="L70" class="LineNr"> 70 </span> 89/&lt;- %ecx 4/r32/esp
<span id="L71" class="LineNr"> 71 </span> <span class="subxS1Comment"># . var start/edx: (addr byte) = end - 32</span>
<span id="L72" class="LineNr"> 72 </span> 81 5/subop/subtract %esp 0x20/imm32
<span id="L73" class="LineNr"> 73 </span> 89/&lt;- %edx 4/r32/esp
<span id="L74" class="LineNr"> 74 </span> <span class="subxS1Comment"># . ad = {start, end}</span>
<span id="L75" class="LineNr"> 75 </span> 51/push-ecx
<span id="L76" class="LineNr"> 76 </span> 52/push-edx
<span id="L77" class="LineNr"> 77 </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="L78" class="LineNr"> 78 </span> <span class="subxComment"># var start/edx = ad-&gt;curr</span>
<span id="L79" class="LineNr"> 79 </span> 8b/copy 0/mod/indirect 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"># copy *ecx to edx</span>
<span id="L80" class="LineNr"> 80 </span> <span class="subxComment"># var h/ebx: (handle stream byte)</span>
<span id="L81" class="LineNr"> 81 </span> 68/push 0/imm32
<span id="L82" class="LineNr"> 82 </span> 68/push 0/imm32
<span id="L83" class="LineNr"> 83 </span> 89/copy 3/mod/direct 3/rm32/ebx <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 ebx</span>
<span id="L84" class="LineNr"> 84 </span> <span class="subxComment"># new-stream(ad, 3, 2, h)</span>
<span id="L85" class="LineNr"> 85 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L86" class="LineNr"> 86 </span> 53/push-ebx
<span id="L87" class="LineNr"> 87 </span> 68/push 2/imm32
<span id="L88" class="LineNr"> 88 </span> 68/push 3/imm32
<span id="L89" class="LineNr"> 89 </span> 51/push-ecx
<span id="L90" class="LineNr"> 90 </span> <span class="subxS2Comment"># . . call</span>
<span id="L91" class="LineNr"> 91 </span> e8/call <a href='121new-stream.subx.html#L8'>new-stream</a>/disp32
<span id="L92" class="LineNr"> 92 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L93" class="LineNr"> 93 </span> 81 0/subop/add 3/mod/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="L94" class="LineNr"> 94 </span> <span class="subxComment"># eax = out-&gt;payload</span>
<span id="L95" class="LineNr"> 95 </span> 8b/copy 1/mod/*+disp8 3/rm32/ebx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebx+4) to eax</span>
<span id="L96" class="LineNr"> 96 </span> <span class="subxComment"># check-ints-equal(eax, edx, msg)</span>
<span id="L97" class="LineNr"> 97 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L98" class="LineNr"> 98 </span> 68/push <span class="Constant">&quot;F - <a href='121new-stream.subx.html#L64'>test-new-stream</a>: returns current pointer of allocation descriptor&quot;</span>/imm32
<span id="L99" class="LineNr"> 99 </span> 52/push-edx
<span id="L100" class="LineNr">100 </span> 50/push-eax
<span id="L101" class="LineNr">101 </span> <span class="subxS2Comment"># . . call</span>
<span id="L102" class="LineNr">102 </span> e8/call <a href='502test.mu.html#L2'>check-ints-equal</a>/disp32
<span id="L103" class="LineNr">103 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L104" class="LineNr">104 </span> 81 0/subop/add 3/mod/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="L105" class="LineNr">105 </span> <span class="subxComment"># skip payload-&gt;allocid</span>
<span id="L106" class="LineNr">106 </span> 05/add-to-eax 4/imm32
<span id="L107" class="LineNr">107 </span> <span class="subxComment"># check-ints-equal(eax-&gt;size, 6, msg)</span>
<span id="L108" class="LineNr">108 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L109" class="LineNr">109 </span> 68/push <span class="Constant">&quot;F - <a href='121new-stream.subx.html#L64'>test-new-stream</a>: sets size correctly&quot;</span>/imm32
<span id="L110" class="LineNr">110 </span> 68/push 6/imm32
<span id="L111" class="LineNr">111 </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> <span class="Normal"> . </span> 8/disp8 <span class="subxComment"># push *(eax+8)</span>
<span id="L112" class="LineNr">112 </span> <span class="subxS2Comment"># . . call</span>
<span id="L113" class="LineNr">113 </span> e8/call <a href='502test.mu.html#L2'>check-ints-equal</a>/disp32
<span id="L114" class="LineNr">114 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L115" class="LineNr">115 </span> 81 0/subop/add 3/mod/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="L116" class="LineNr">116 </span> <span class="subxComment"># the rest is delegated to clear-stream() so we won't bother checking it</span>
<span id="L117" class="LineNr">117 </span> <span class="subxS1Comment"># . reclaim locals</span>
<span id="L118" class="LineNr">118 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x30/imm32 <span class="subxComment"># add to esp</span>
<span id="L119" class="LineNr">119 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L120" class="LineNr">120 </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="L121" class="LineNr">121 </span> 5d/pop-to-ebp
<span id="L122" class="LineNr">122 </span> c3/return
<span id="L123" class="LineNr">123 </span>
<span id="L124" class="LineNr">124 </span><span class="subxS2Comment"># . . vim&#0058;nowrap:textwidth=0</span>
</pre>
</body>
</html>

386
html/123slice.subx.html generated
View File

@ -880,7 +880,7 @@ if ('onhashchange' in window) {
<span id="L819" class="LineNr"> 819 </span> 73/jump-if-addr&gt;= $write-slice:loop-end/disp8
<span id="L820" class="LineNr"> 820 </span> <span class="subxComment"># if (out-&gt;write &gt;= out-&gt;size) abort</span>
<span id="L821" class="LineNr"> 821 </span> 39/compare 3/mod/direct 3/rm32/ebx <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 ebx with edx</span>
<span id="L822" class="LineNr"> 822 </span> 7d/jump-if-&gt;= $write-slice:<a href='501draw-text.mu.html#L481'>abort</a>/disp8
<span id="L822" class="LineNr"> 822 </span> 7d/jump-if-&gt;= $write-slice:<a href='317abort.subx.html#L5'>abort</a>/disp8
<span id="L823" class="LineNr"> 823 </span> <span class="subxComment"># out-&gt;data[out-&gt;write] = *in</span>
<span id="L824" class="LineNr"> 824 </span> <span class="subxS1Comment"># . AL = *in</span>
<span id="L825" class="LineNr"> 825 </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>
@ -908,201 +908,195 @@ if ('onhashchange' in window) {
<span id="L847" class="LineNr"> 847 </span> 5d/pop-to-ebp
<span id="L848" class="LineNr"> 848 </span> c3/return
<span id="L849" class="LineNr"> 849 </span>
<span id="L850" class="LineNr"> 850 </span><span class="Constant">$write-slice:<a href='501draw-text.mu.html#L481'>abort</a></span>:
<span id="L851" class="LineNr"> 851 </span> (<a href='501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">&quot;write-slice: out of space&quot;</span> 3 0) <span class="subxComment"># 3=cyan</span>
<span id="L852" class="LineNr"> 852 </span> {
<span id="L853" class="LineNr"> 853 </span> eb/jump <span class="Constant">loop</span>/disp8
<span id="L854" class="LineNr"> 854 </span> }
<span id="L855" class="LineNr"> 855 </span> <span class="subxComment"># never gets here</span>
<span id="L856" class="LineNr"> 856 </span>
<span id="L857" class="LineNr"> 857 </span><span class="subxTest">test-write-slice</span>:
<span id="L858" class="LineNr"> 858 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L859" class="LineNr"> 859 </span> 55/push-ebp
<span id="L860" class="LineNr"> 860 </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="L861" class="LineNr"> 861 </span> <span class="subxComment"># setup</span>
<span id="L862" class="LineNr"> 862 </span> <span class="subxS1Comment"># . clear-stream(_test-stream)</span>
<span id="L863" class="LineNr"> 863 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L864" class="LineNr"> 864 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L865" class="LineNr"> 865 </span> <span class="subxS2Comment"># . . call</span>
<span id="L866" class="LineNr"> 866 </span> e8/call <a href='106stream.subx.html#L20'>clear-stream</a>/disp32
<span id="L867" class="LineNr"> 867 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L868" class="LineNr"> 868 </span> 81 0/subop/add 3/mod/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="L869" class="LineNr"> 869 </span> <span class="subxComment"># (eax..ecx) = &quot;Abc&quot;</span>
<span id="L870" class="LineNr"> 870 </span> b8/copy-to-eax <span class="Constant">&quot;Abc&quot;</span>/imm32
<span id="L871" class="LineNr"> 871 </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="L872" class="LineNr"> 872 </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="L873" class="LineNr"> 873 </span> 05/add-to-eax 4/imm32
<span id="L874" class="LineNr"> 874 </span> <span class="subxComment"># var slice/ecx: slice = {eax, ecx}</span>
<span id="L875" class="LineNr"> 875 </span> 51/push-ecx
<span id="L876" class="LineNr"> 876 </span> 50/push-eax
<span id="L877" class="LineNr"> 877 </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="L878" class="LineNr"> 878 </span> <span class="subxComment"># write-slice(_test-stream, slice)</span>
<span id="L879" class="LineNr"> 879 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L880" class="LineNr"> 880 </span> 51/push-ecx
<span id="L881" class="LineNr"> 881 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L882" class="LineNr"> 882 </span> <span class="subxS2Comment"># . . call</span>
<span id="L883" class="LineNr"> 883 </span> e8/call <a href='123slice.subx.html#L793'>write-slice</a>/disp32
<span id="L884" class="LineNr"> 884 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L885" class="LineNr"> 885 </span> 81 0/subop/add 3/mod/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="L886" class="LineNr"> 886 </span> <span class="subxComment"># check-stream-equal(_test-stream, &quot;Abc&quot;, msg)</span>
<span id="L887" class="LineNr"> 887 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L888" class="LineNr"> 888 </span> 68/push <span class="Constant">&quot;F - test-write-slice&quot;</span>/imm32
<span id="L889" class="LineNr"> 889 </span> 68/push <span class="Constant">&quot;Abc&quot;</span>/imm32
<span id="L890" class="LineNr"> 890 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L891" class="LineNr"> 891 </span> <span class="subxS2Comment"># . . call</span>
<span id="L892" class="LineNr"> 892 </span> e8/call <a href='109stream-equal.subx.html#L194'>check-stream-equal</a>/disp32
<span id="L893" class="LineNr"> 893 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L894" class="LineNr"> 894 </span> 81 0/subop/add 3/mod/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="L895" class="LineNr"> 895 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L896" class="LineNr"> 896 </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="L897" class="LineNr"> 897 </span> 5d/pop-to-ebp
<span id="L898" class="LineNr"> 898 </span> c3/return
<span id="L899" class="LineNr"> 899 </span>
<span id="L900" class="LineNr"> 900 </span><span class="subxComment"># copy a slice into a new (dynamically allocated) string</span>
<span id="L901" class="LineNr"> 901 </span><span class="subxFunction">slice-to-string</span>: <span class="subxComment"># ad: (addr allocation-descriptor), in: (addr slice), out: (addr handle array byte)</span>
<span id="L902" class="LineNr"> 902 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L903" class="LineNr"> 903 </span> 55/push-ebp
<span id="L904" class="LineNr"> 904 </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="L905" class="LineNr"> 905 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L906" class="LineNr"> 906 </span> 50/push-eax
<span id="L907" class="LineNr"> 907 </span> 51/push-ecx
<span id="L908" class="LineNr"> 908 </span> 52/push-edx
<span id="L909" class="LineNr"> 909 </span> 53/push-ebx
<span id="L910" class="LineNr"> 910 </span> 56/push-esi
<span id="L911" class="LineNr"> 911 </span> <span class="subxComment"># esi = in</span>
<span id="L912" class="LineNr"> 912 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+12) to esi</span>
<span id="L913" class="LineNr"> 913 </span> <span class="subxComment"># var curr/edx: (addr byte) = in-&gt;start</span>
<span id="L914" class="LineNr"> 914 </span> 8b/copy 0/mod/indirect 6/rm32/esi <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"># copy *esi to edx</span>
<span id="L915" class="LineNr"> 915 </span> <span class="subxComment"># var max/ebx: (addr byte) = in-&gt;end</span>
<span id="L916" class="LineNr"> 916 </span> 8b/copy 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 3/r32/ebx 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(esi+4) to ebx</span>
<span id="L917" class="LineNr"> 917 </span> <span class="subxComment"># var size/ecx: int = max - curr + 4 # total size of output string (including the initial 'size' field)</span>
<span id="L918" class="LineNr"> 918 </span> 89/copy 3/mod/direct 1/rm32/ecx <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"># copy ebx to ecx</span>
<span id="L919" class="LineNr"> 919 </span> 29/subtract 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"># subtract edx from ecx</span>
<span id="L920" class="LineNr"> 920 </span> 81 0/subop/add 3/mod/direct 1/rm32/ecx <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 ecx</span>
<span id="L921" class="LineNr"> 921 </span> <span class="subxComment"># allocate(ad, size, out)</span>
<span id="L922" class="LineNr"> 922 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L923" class="LineNr"> 923 </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="L924" class="LineNr"> 924 </span> 51/push-ecx
<span id="L925" class="LineNr"> 925 </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="L926" class="LineNr"> 926 </span> <span class="subxS2Comment"># . . call</span>
<span id="L927" class="LineNr"> 927 </span> e8/call <a href='120allocate.subx.html#L43'>allocate</a>/disp32
<span id="L928" class="LineNr"> 928 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L929" class="LineNr"> 929 </span> 81 0/subop/add 3/mod/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="L930" class="LineNr"> 930 </span> <span class="subxComment"># eax = out-&gt;payload</span>
<span id="L931" class="LineNr"> 931 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 0x10/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+16) to eax</span>
<span id="L932" class="LineNr"> 932 </span> 8b/copy 1/mod/*+disp8 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(eax+4) to eax</span>
<span id="L933" class="LineNr"> 933 </span> <span class="subxComment"># skip payload-&gt;allocid</span>
<span id="L934" class="LineNr"> 934 </span> 05/add-to-eax 4/imm32
<span id="L935" class="LineNr"> 935 </span> <span class="subxComment"># if (eax == 0) abort</span>
<span id="L936" class="LineNr"> 936 </span> 3d/compare-eax-and 0/imm32
<span id="L937" class="LineNr"> 937 </span> 74/jump-if-= $slice-to-string:<a href='501draw-text.mu.html#L481'>abort</a>/disp8
<span id="L938" class="LineNr"> 938 </span> <span class="subxComment"># out-&gt;size = size-4</span>
<span id="L939" class="LineNr"> 939 </span> 89/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 ecx to *eax</span>
<span id="L940" class="LineNr"> 940 </span> 81 5/subop/subtract 0/mod/indirect 0/rm32/eax <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"># subtract 4 from *eax</span>
<span id="L941" class="LineNr"> 941 </span> <span class="subxComment"># save out</span>
<span id="L942" class="LineNr"> 942 </span> 50/push-eax
<span id="L943" class="LineNr"> 943 </span><span class="Constant">$slice-to-string:initialize</span>:
<span id="L944" class="LineNr"> 944 </span> <span class="subxComment"># eax = _append-4(eax+4, eax+size, curr, max) # clobbering ecx</span>
<span id="L945" class="LineNr"> 945 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L946" class="LineNr"> 946 </span> 53/push-ebx
<span id="L947" class="LineNr"> 947 </span> 52/push-edx
<span id="L948" class="LineNr"> 948 </span> <span class="subxS2Comment"># . . push eax+size (clobbering ecx)</span>
<span id="L949" class="LineNr"> 949 </span> 01/add 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"># add eax to ecx</span>
<span id="L950" class="LineNr"> 950 </span> 51/push-ecx
<span id="L951" class="LineNr"> 951 </span> <span class="subxS2Comment"># . . push eax+4 (clobbering eax)</span>
<span id="L952" class="LineNr"> 952 </span> 81 0/subop/add 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> 4/imm32 <span class="subxComment"># add to eax</span>
<span id="L953" class="LineNr"> 953 </span> 50/push-eax
<span id="L954" class="LineNr"> 954 </span> <span class="subxS2Comment"># . . call</span>
<span id="L955" class="LineNr"> 955 </span> e8/call <a href='108write.subx.html#L171'>_append-4</a>/disp32
<span id="L956" class="LineNr"> 956 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L957" class="LineNr"> 957 </span> 81 0/subop/add 3/mod/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="L958" class="LineNr"> 958 </span> <span class="subxComment"># restore out (assumes _append-4 can't error)</span>
<span id="L959" class="LineNr"> 959 </span> 58/pop-to-eax
<span id="L960" class="LineNr"> 960 </span><span class="Constant">$slice-to-string:end</span>:
<span id="L961" class="LineNr"> 961 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L962" class="LineNr"> 962 </span> 5e/pop-to-esi
<span id="L963" class="LineNr"> 963 </span> 5b/pop-to-ebx
<span id="L964" class="LineNr"> 964 </span> 5a/pop-to-edx
<span id="L965" class="LineNr"> 965 </span> 59/pop-to-ecx
<span id="L966" class="LineNr"> 966 </span> 58/pop-to-eax
<span id="L967" class="LineNr"> 967 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L968" class="LineNr"> 968 </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="L969" class="LineNr"> 969 </span> 5d/pop-to-ebp
<span id="L970" class="LineNr"> 970 </span> c3/return
<span id="L971" class="LineNr"> 971 </span>
<span id="L972" class="LineNr"> 972 </span><span class="Constant">$slice-to-string:<a href='501draw-text.mu.html#L481'>abort</a></span>:
<span id="L973" class="LineNr"> 973 </span> (<a href='501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">&quot;slice-to-string: out of space\n&quot;</span> 3 0) <span class="subxComment"># 3=cyan</span>
<span id="L974" class="LineNr"> 974 </span> {
<span id="L975" class="LineNr"> 975 </span> eb/jump <span class="Constant">loop</span>/disp8
<span id="L976" class="LineNr"> 976 </span> }
<span id="L977" class="LineNr"> 977 </span> <span class="subxComment"># never gets here</span>
<span id="L978" class="LineNr"> 978 </span>
<span id="L979" class="LineNr"> 979 </span><span class="subxTest">test-slice-to-string</span>:
<span id="L980" class="LineNr"> 980 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L981" class="LineNr"> 981 </span> 55/push-ebp
<span id="L982" class="LineNr"> 982 </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="L983" class="LineNr"> 983 </span> <span class="subxComment"># var ad/edx: allocation-descriptor containing 16 bytes</span>
<span id="L984" class="LineNr"> 984 </span> <span class="subxS1Comment"># . var end/ecx: (addr byte)</span>
<span id="L985" class="LineNr"> 985 </span> 89/&lt;- %ecx 4/r32/esp
<span id="L986" class="LineNr"> 986 </span> 81 5/subop/subtract %esp 0x10/imm32
<span id="L987" class="LineNr"> 987 </span> <span class="subxS1Comment"># . var start/edx: (addr byte) = end - 0x10</span>
<span id="L988" class="LineNr"> 988 </span> 89/&lt;- %edx 4/r32/esp
<span id="L989" class="LineNr"> 989 </span> <span class="subxS1Comment"># . ad = {start, end}</span>
<span id="L990" class="LineNr"> 990 </span> 51/push-ecx
<span id="L991" class="LineNr"> 991 </span> 52/push-edx
<span id="L992" class="LineNr"> 992 </span> 89/copy 3/mod/direct 2/rm32/edx <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 edx</span>
<span id="L993" class="LineNr"> 993 </span> <span class="subxComment"># (eax..ecx) = &quot;Abc&quot;</span>
<span id="L994" class="LineNr"> 994 </span> b8/copy-to-eax <span class="Constant">&quot;Abc&quot;</span>/imm32
<span id="L995" class="LineNr"> 995 </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="L996" class="LineNr"> 996 </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="L997" class="LineNr"> 997 </span> 05/add-to-eax 4/imm32
<span id="L998" class="LineNr"> 998 </span> <span class="subxComment"># var slice/ecx: slice = {eax, ecx}</span>
<span id="L999" class="LineNr"> 999 </span> 51/push-ecx
<span id="L1000" class="LineNr">1000 </span> 50/push-eax
<span id="L1001" class="LineNr">1001 </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="L1002" class="LineNr">1002 </span> <span class="subxComment"># var h/ebx: (handle array byte)</span>
<span id="L1003" class="LineNr">1003 </span> 68/push 0/imm32
<span id="L1004" class="LineNr">1004 </span> 68/push 0/imm32
<span id="L1005" class="LineNr">1005 </span> 89/copy 3/mod/direct 3/rm32/ebx <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 ebx</span>
<span id="L1006" class="LineNr">1006 </span> <span class="subxComment"># slice-to-string(ad, slice, h)</span>
<span id="L1007" class="LineNr">1007 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L1008" class="LineNr">1008 </span> 53/push-ebx
<span id="L1009" class="LineNr">1009 </span> 51/push-ecx
<span id="L1010" class="LineNr">1010 </span> 52/push-edx
<span id="L1011" class="LineNr">1011 </span> <span class="subxS2Comment"># . . call</span>
<span id="L1012" class="LineNr">1012 </span> e8/call <a href='123slice.subx.html#L901'>slice-to-string</a>/disp32
<span id="L1013" class="LineNr">1013 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L1014" class="LineNr">1014 </span> 81 0/subop/add 3/mod/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="L1015" class="LineNr">1015 </span> <span class="subxComment"># eax = h-&gt;payload</span>
<span id="L1016" class="LineNr">1016 </span> 8b/copy 1/mod/*+disp8 3/rm32/ebx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebx+4) to eax</span>
<span id="L1017" class="LineNr">1017 </span> <span class="subxComment"># skip payload-&gt;allocid</span>
<span id="L1018" class="LineNr">1018 </span> 05/add-to-eax 4/imm32
<span id="L1019" class="Folded">1019 </span><span class="Folded">+-- 26 lines: #? # dump eax ---------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="L1045" class="LineNr">1045 </span> <span class="subxComment"># eax = string-equal?(eax, &quot;Abc&quot;)</span>
<span id="L1046" class="LineNr">1046 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L1047" class="LineNr">1047 </span> 68/push <span class="Constant">&quot;Abc&quot;</span>/imm32
<span id="L1048" class="LineNr">1048 </span> 50/push-eax
<span id="L1049" class="LineNr">1049 </span> <span class="subxS2Comment"># . . call</span>
<span id="L1050" class="LineNr">1050 </span> e8/call <a href='105string-equal.subx.html#L8'>string-equal?</a>/disp32
<span id="L1051" class="LineNr">1051 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L1052" class="LineNr">1052 </span> 81 0/subop/add 3/mod/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="L1053" class="LineNr">1053 </span> <span class="subxComment"># check-ints-equal(eax, 1, msg)</span>
<span id="L1054" class="LineNr">1054 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L1055" class="LineNr">1055 </span> 68/push <span class="Constant">&quot;F - test-slice-to-string&quot;</span>/imm32
<span id="L1056" class="LineNr">1056 </span> 68/push 1/imm32/true
<span id="L1057" class="LineNr">1057 </span> 50/push-eax
<span id="L1058" class="LineNr">1058 </span> <span class="subxS2Comment"># . . call</span>
<span id="L1059" class="LineNr">1059 </span> e8/call <a href='502test.mu.html#L2'>check-ints-equal</a>/disp32
<span id="L1060" class="LineNr">1060 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L1061" class="LineNr">1061 </span> 81 0/subop/add 3/mod/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="L1062" class="LineNr">1062 </span> <span class="subxS1Comment"># . reclaim locals</span>
<span id="L1063" class="LineNr">1063 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x18/imm32 <span class="subxComment"># add to esp</span>
<span id="L1064" class="LineNr">1064 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L1065" class="LineNr">1065 </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="L1066" class="LineNr">1066 </span> 5d/pop-to-ebp
<span id="L1067" class="LineNr">1067 </span> c3/return
<span id="L1068" class="LineNr">1068 </span>
<span id="L1069" class="LineNr">1069 </span><span class="subxS2Comment"># . . vim&#0058;nowrap:textwidth=0</span>
<span id="L850" class="LineNr"> 850 </span><span class="Constant">$write-slice:<a href='317abort.subx.html#L5'>abort</a></span>:
<span id="L851" class="LineNr"> 851 </span> (<a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;write-slice: out of space&quot;</span>)
<span id="L852" class="LineNr"> 852 </span> <span class="subxComment"># never gets here</span>
<span id="L853" class="LineNr"> 853 </span>
<span id="L854" class="LineNr"> 854 </span><span class="subxTest">test-write-slice</span>:
<span id="L855" class="LineNr"> 855 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L856" class="LineNr"> 856 </span> 55/push-ebp
<span id="L857" class="LineNr"> 857 </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="L858" class="LineNr"> 858 </span> <span class="subxComment"># setup</span>
<span id="L859" class="LineNr"> 859 </span> <span class="subxS1Comment"># . clear-stream(_test-stream)</span>
<span id="L860" class="LineNr"> 860 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L861" class="LineNr"> 861 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L862" class="LineNr"> 862 </span> <span class="subxS2Comment"># . . call</span>
<span id="L863" class="LineNr"> 863 </span> e8/call <a href='106stream.subx.html#L20'>clear-stream</a>/disp32
<span id="L864" class="LineNr"> 864 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L865" class="LineNr"> 865 </span> 81 0/subop/add 3/mod/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="L866" class="LineNr"> 866 </span> <span class="subxComment"># (eax..ecx) = &quot;Abc&quot;</span>
<span id="L867" class="LineNr"> 867 </span> b8/copy-to-eax <span class="Constant">&quot;Abc&quot;</span>/imm32
<span id="L868" class="LineNr"> 868 </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="L869" class="LineNr"> 869 </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="L870" class="LineNr"> 870 </span> 05/add-to-eax 4/imm32
<span id="L871" class="LineNr"> 871 </span> <span class="subxComment"># var slice/ecx: slice = {eax, ecx}</span>
<span id="L872" class="LineNr"> 872 </span> 51/push-ecx
<span id="L873" class="LineNr"> 873 </span> 50/push-eax
<span id="L874" class="LineNr"> 874 </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="L875" class="LineNr"> 875 </span> <span class="subxComment"># write-slice(_test-stream, slice)</span>
<span id="L876" class="LineNr"> 876 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L877" class="LineNr"> 877 </span> 51/push-ecx
<span id="L878" class="LineNr"> 878 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L879" class="LineNr"> 879 </span> <span class="subxS2Comment"># . . call</span>
<span id="L880" class="LineNr"> 880 </span> e8/call <a href='123slice.subx.html#L793'>write-slice</a>/disp32
<span id="L881" class="LineNr"> 881 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L882" class="LineNr"> 882 </span> 81 0/subop/add 3/mod/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="L883" class="LineNr"> 883 </span> <span class="subxComment"># check-stream-equal(_test-stream, &quot;Abc&quot;, msg)</span>
<span id="L884" class="LineNr"> 884 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L885" class="LineNr"> 885 </span> 68/push <span class="Constant">&quot;F - test-write-slice&quot;</span>/imm32
<span id="L886" class="LineNr"> 886 </span> 68/push <span class="Constant">&quot;Abc&quot;</span>/imm32
<span id="L887" class="LineNr"> 887 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L888" class="LineNr"> 888 </span> <span class="subxS2Comment"># . . call</span>
<span id="L889" class="LineNr"> 889 </span> e8/call <a href='109stream-equal.subx.html#L194'>check-stream-equal</a>/disp32
<span id="L890" class="LineNr"> 890 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L891" class="LineNr"> 891 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span>
<span id="L892" class="LineNr"> 892 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L893" class="LineNr"> 893 </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="L894" class="LineNr"> 894 </span> 5d/pop-to-ebp
<span id="L895" class="LineNr"> 895 </span> c3/return
<span id="L896" class="LineNr"> 896 </span>
<span id="L897" class="LineNr"> 897 </span><span class="subxComment"># copy a slice into a new (dynamically allocated) string</span>
<span id="L898" class="LineNr"> 898 </span><span class="subxFunction">slice-to-string</span>: <span class="subxComment"># ad: (addr allocation-descriptor), in: (addr slice), out: (addr handle array byte)</span>
<span id="L899" class="LineNr"> 899 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L900" class="LineNr"> 900 </span> 55/push-ebp
<span id="L901" class="LineNr"> 901 </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="L902" class="LineNr"> 902 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L903" class="LineNr"> 903 </span> 50/push-eax
<span id="L904" class="LineNr"> 904 </span> 51/push-ecx
<span id="L905" class="LineNr"> 905 </span> 52/push-edx
<span id="L906" class="LineNr"> 906 </span> 53/push-ebx
<span id="L907" class="LineNr"> 907 </span> 56/push-esi
<span id="L908" class="LineNr"> 908 </span> <span class="subxComment"># esi = in</span>
<span id="L909" class="LineNr"> 909 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+12) to esi</span>
<span id="L910" class="LineNr"> 910 </span> <span class="subxComment"># var curr/edx: (addr byte) = in-&gt;start</span>
<span id="L911" class="LineNr"> 911 </span> 8b/copy 0/mod/indirect 6/rm32/esi <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"># copy *esi to edx</span>
<span id="L912" class="LineNr"> 912 </span> <span class="subxComment"># var max/ebx: (addr byte) = in-&gt;end</span>
<span id="L913" class="LineNr"> 913 </span> 8b/copy 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 3/r32/ebx 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(esi+4) to ebx</span>
<span id="L914" class="LineNr"> 914 </span> <span class="subxComment"># var size/ecx: int = max - curr + 4 # total size of output string (including the initial 'size' field)</span>
<span id="L915" class="LineNr"> 915 </span> 89/copy 3/mod/direct 1/rm32/ecx <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"># copy ebx to ecx</span>
<span id="L916" class="LineNr"> 916 </span> 29/subtract 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"># subtract edx from ecx</span>
<span id="L917" class="LineNr"> 917 </span> 81 0/subop/add 3/mod/direct 1/rm32/ecx <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 ecx</span>
<span id="L918" class="LineNr"> 918 </span> <span class="subxComment"># allocate(ad, size, out)</span>
<span id="L919" class="LineNr"> 919 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L920" class="LineNr"> 920 </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="L921" class="LineNr"> 921 </span> 51/push-ecx
<span id="L922" class="LineNr"> 922 </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="L923" class="LineNr"> 923 </span> <span class="subxS2Comment"># . . call</span>
<span id="L924" class="LineNr"> 924 </span> e8/call <a href='120allocate.subx.html#L43'>allocate</a>/disp32
<span id="L925" class="LineNr"> 925 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L926" class="LineNr"> 926 </span> 81 0/subop/add 3/mod/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="L927" class="LineNr"> 927 </span> <span class="subxComment"># eax = out-&gt;payload</span>
<span id="L928" class="LineNr"> 928 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 0x10/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+16) to eax</span>
<span id="L929" class="LineNr"> 929 </span> 8b/copy 1/mod/*+disp8 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(eax+4) to eax</span>
<span id="L930" class="LineNr"> 930 </span> <span class="subxComment"># skip payload-&gt;allocid</span>
<span id="L931" class="LineNr"> 931 </span> 05/add-to-eax 4/imm32
<span id="L932" class="LineNr"> 932 </span> <span class="subxComment"># if (eax == 0) abort</span>
<span id="L933" class="LineNr"> 933 </span> 3d/compare-eax-and 0/imm32
<span id="L934" class="LineNr"> 934 </span> 74/jump-if-= $slice-to-string:<a href='317abort.subx.html#L5'>abort</a>/disp8
<span id="L935" class="LineNr"> 935 </span> <span class="subxComment"># out-&gt;size = size-4</span>
<span id="L936" class="LineNr"> 936 </span> 89/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 ecx to *eax</span>
<span id="L937" class="LineNr"> 937 </span> 81 5/subop/subtract 0/mod/indirect 0/rm32/eax <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"># subtract 4 from *eax</span>
<span id="L938" class="LineNr"> 938 </span> <span class="subxComment"># save out</span>
<span id="L939" class="LineNr"> 939 </span> 50/push-eax
<span id="L940" class="LineNr"> 940 </span><span class="Constant">$slice-to-string:initialize</span>:
<span id="L941" class="LineNr"> 941 </span> <span class="subxComment"># eax = _append-4(eax+4, eax+size, curr, max) # clobbering ecx</span>
<span id="L942" class="LineNr"> 942 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L943" class="LineNr"> 943 </span> 53/push-ebx
<span id="L944" class="LineNr"> 944 </span> 52/push-edx
<span id="L945" class="LineNr"> 945 </span> <span class="subxS2Comment"># . . push eax+size (clobbering ecx)</span>
<span id="L946" class="LineNr"> 946 </span> 01/add 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"># add eax to ecx</span>
<span id="L947" class="LineNr"> 947 </span> 51/push-ecx
<span id="L948" class="LineNr"> 948 </span> <span class="subxS2Comment"># . . push eax+4 (clobbering eax)</span>
<span id="L949" class="LineNr"> 949 </span> 81 0/subop/add 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> 4/imm32 <span class="subxComment"># add to eax</span>
<span id="L950" class="LineNr"> 950 </span> 50/push-eax
<span id="L951" class="LineNr"> 951 </span> <span class="subxS2Comment"># . . call</span>
<span id="L952" class="LineNr"> 952 </span> e8/call <a href='108write.subx.html#L171'>_append-4</a>/disp32
<span id="L953" class="LineNr"> 953 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L954" class="LineNr"> 954 </span> 81 0/subop/add 3/mod/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="L955" class="LineNr"> 955 </span> <span class="subxComment"># restore out (assumes _append-4 can't error)</span>
<span id="L956" class="LineNr"> 956 </span> 58/pop-to-eax
<span id="L957" class="LineNr"> 957 </span><span class="Constant">$slice-to-string:end</span>:
<span id="L958" class="LineNr"> 958 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L959" class="LineNr"> 959 </span> 5e/pop-to-esi
<span id="L960" class="LineNr"> 960 </span> 5b/pop-to-ebx
<span id="L961" class="LineNr"> 961 </span> 5a/pop-to-edx
<span id="L962" class="LineNr"> 962 </span> 59/pop-to-ecx
<span id="L963" class="LineNr"> 963 </span> 58/pop-to-eax
<span id="L964" class="LineNr"> 964 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L965" class="LineNr"> 965 </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="L966" class="LineNr"> 966 </span> 5d/pop-to-ebp
<span id="L967" class="LineNr"> 967 </span> c3/return
<span id="L968" class="LineNr"> 968 </span>
<span id="L969" class="LineNr"> 969 </span><span class="Constant">$slice-to-string:<a href='317abort.subx.html#L5'>abort</a></span>:
<span id="L970" class="LineNr"> 970 </span> (<a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;slice-to-string: out of space&quot;</span>)
<span id="L971" class="LineNr"> 971 </span> <span class="subxComment"># never gets here</span>
<span id="L972" class="LineNr"> 972 </span>
<span id="L973" class="LineNr"> 973 </span><span class="subxTest">test-slice-to-string</span>:
<span id="L974" class="LineNr"> 974 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L975" class="LineNr"> 975 </span> 55/push-ebp
<span id="L976" class="LineNr"> 976 </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="L977" class="LineNr"> 977 </span> <span class="subxComment"># var ad/edx: allocation-descriptor containing 16 bytes</span>
<span id="L978" class="LineNr"> 978 </span> <span class="subxS1Comment"># . var end/ecx: (addr byte)</span>
<span id="L979" class="LineNr"> 979 </span> 89/&lt;- %ecx 4/r32/esp
<span id="L980" class="LineNr"> 980 </span> 81 5/subop/subtract %esp 0x10/imm32
<span id="L981" class="LineNr"> 981 </span> <span class="subxS1Comment"># . var start/edx: (addr byte) = end - 0x10</span>
<span id="L982" class="LineNr"> 982 </span> 89/&lt;- %edx 4/r32/esp
<span id="L983" class="LineNr"> 983 </span> <span class="subxS1Comment"># . ad = {start, end}</span>
<span id="L984" class="LineNr"> 984 </span> 51/push-ecx
<span id="L985" class="LineNr"> 985 </span> 52/push-edx
<span id="L986" class="LineNr"> 986 </span> 89/copy 3/mod/direct 2/rm32/edx <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 edx</span>
<span id="L987" class="LineNr"> 987 </span> <span class="subxComment"># (eax..ecx) = &quot;Abc&quot;</span>
<span id="L988" class="LineNr"> 988 </span> b8/copy-to-eax <span class="Constant">&quot;Abc&quot;</span>/imm32
<span id="L989" class="LineNr"> 989 </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="L990" class="LineNr"> 990 </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="L991" class="LineNr"> 991 </span> 05/add-to-eax 4/imm32
<span id="L992" class="LineNr"> 992 </span> <span class="subxComment"># var slice/ecx: slice = {eax, ecx}</span>
<span id="L993" class="LineNr"> 993 </span> 51/push-ecx
<span id="L994" class="LineNr"> 994 </span> 50/push-eax
<span id="L995" class="LineNr"> 995 </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="L996" class="LineNr"> 996 </span> <span class="subxComment"># var h/ebx: (handle array byte)</span>
<span id="L997" class="LineNr"> 997 </span> 68/push 0/imm32
<span id="L998" class="LineNr"> 998 </span> 68/push 0/imm32
<span id="L999" class="LineNr"> 999 </span> 89/copy 3/mod/direct 3/rm32/ebx <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 ebx</span>
<span id="L1000" class="LineNr">1000 </span> <span class="subxComment"># slice-to-string(ad, slice, h)</span>
<span id="L1001" class="LineNr">1001 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L1002" class="LineNr">1002 </span> 53/push-ebx
<span id="L1003" class="LineNr">1003 </span> 51/push-ecx
<span id="L1004" class="LineNr">1004 </span> 52/push-edx
<span id="L1005" class="LineNr">1005 </span> <span class="subxS2Comment"># . . call</span>
<span id="L1006" class="LineNr">1006 </span> e8/call <a href='123slice.subx.html#L898'>slice-to-string</a>/disp32
<span id="L1007" class="LineNr">1007 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L1008" class="LineNr">1008 </span> 81 0/subop/add 3/mod/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="L1009" class="LineNr">1009 </span> <span class="subxComment"># eax = h-&gt;payload</span>
<span id="L1010" class="LineNr">1010 </span> 8b/copy 1/mod/*+disp8 3/rm32/ebx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebx+4) to eax</span>
<span id="L1011" class="LineNr">1011 </span> <span class="subxComment"># skip payload-&gt;allocid</span>
<span id="L1012" class="LineNr">1012 </span> 05/add-to-eax 4/imm32
<span id="L1013" class="Folded">1013 </span><span class="Folded">+-- 26 lines: #? # dump eax ---------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="L1039" class="LineNr">1039 </span> <span class="subxComment"># eax = string-equal?(eax, &quot;Abc&quot;)</span>
<span id="L1040" class="LineNr">1040 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L1041" class="LineNr">1041 </span> 68/push <span class="Constant">&quot;Abc&quot;</span>/imm32
<span id="L1042" class="LineNr">1042 </span> 50/push-eax
<span id="L1043" class="LineNr">1043 </span> <span class="subxS2Comment"># . . call</span>
<span id="L1044" class="LineNr">1044 </span> e8/call <a href='105string-equal.subx.html#L8'>string-equal?</a>/disp32
<span id="L1045" class="LineNr">1045 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L1046" class="LineNr">1046 </span> 81 0/subop/add 3/mod/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="L1047" class="LineNr">1047 </span> <span class="subxComment"># check-ints-equal(eax, 1, msg)</span>
<span id="L1048" class="LineNr">1048 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L1049" class="LineNr">1049 </span> 68/push <span class="Constant">&quot;F - test-slice-to-string&quot;</span>/imm32
<span id="L1050" class="LineNr">1050 </span> 68/push 1/imm32/true
<span id="L1051" class="LineNr">1051 </span> 50/push-eax
<span id="L1052" class="LineNr">1052 </span> <span class="subxS2Comment"># . . call</span>
<span id="L1053" class="LineNr">1053 </span> e8/call <a href='502test.mu.html#L2'>check-ints-equal</a>/disp32
<span id="L1054" class="LineNr">1054 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L1055" class="LineNr">1055 </span> 81 0/subop/add 3/mod/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="L1056" class="LineNr">1056 </span> <span class="subxS1Comment"># . reclaim locals</span>
<span id="L1057" class="LineNr">1057 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x18/imm32 <span class="subxComment"># add to esp</span>
<span id="L1058" class="LineNr">1058 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L1059" class="LineNr">1059 </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="L1060" class="LineNr">1060 </span> 5d/pop-to-ebp
<span id="L1061" class="LineNr">1061 </span> c3/return
<span id="L1062" class="LineNr">1062 </span>
<span id="L1063" class="LineNr">1063 </span><span class="subxS2Comment"># . . vim&#0058;nowrap:textwidth=0</span>
</pre>
</body>
</html>

View File

@ -150,7 +150,7 @@ if ('onhashchange' in window) {
<span id="L89" class="LineNr"> 89 </span> 74/jump-if-= $write-int32-decimal:write-break/disp8
<span id="L90" class="LineNr"> 90 </span> <span class="subxComment"># if (curr &gt;= max) abort</span>
<span id="L91" class="LineNr"> 91 </span> 39/compare 3/mod/direct 1/rm32/ecx <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"># compare ecx with ebx</span>
<span id="L92" class="LineNr"> 92 </span> 73/jump-if-addr&gt;= $write-int32-decimal:<a href='501draw-text.mu.html#L481'>abort</a>/disp8
<span id="L92" class="LineNr"> 92 </span> 73/jump-if-addr&gt;= $write-int32-decimal:<a href='317abort.subx.html#L5'>abort</a>/disp8
<span id="L93" class="LineNr"> 93 </span><span class="Constant">$write-int32-decimal:write-char</span>:
<span id="L94" class="LineNr"> 94 </span> <span class="subxComment"># *curr = AL</span>
<span id="L95" class="LineNr"> 95 </span> 88/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 AL to byte at *ecx</span>
@ -174,294 +174,288 @@ if ('onhashchange' in window) {
<span id="L113" class="LineNr">113 </span> 5d/pop-to-ebp
<span id="L114" class="LineNr">114 </span> c3/return
<span id="L115" class="LineNr">115 </span>
<span id="L116" class="LineNr">116 </span><span class="Constant">$write-int32-decimal:<a href='501draw-text.mu.html#L481'>abort</a></span>:
<span id="L117" class="LineNr">117 </span> (<a href='501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">&quot;write-int32-decimal: stream out of space&quot;</span> 3 0) <span class="subxComment"># 3=cyan</span>
<span id="L118" class="LineNr">118 </span> {
<span id="L119" class="LineNr">119 </span> eb/jump <span class="Constant">loop</span>/disp8
<span id="L120" class="LineNr">120 </span> }
<span id="L121" class="LineNr">121 </span> <span class="subxComment"># never gets here</span>
<span id="L122" class="LineNr">122 </span>
<span id="L123" class="LineNr">123 </span><span class="subxTest">test-write-int32-decimal</span>:
<span id="L124" class="LineNr">124 </span> <span class="subxH1Comment"># - check that a single-digit number converts correctly</span>
<span id="L125" class="LineNr">125 </span> <span class="subxComment"># setup</span>
<span id="L126" class="LineNr">126 </span> <span class="subxS1Comment"># . clear-stream(_test-stream)</span>
<span id="L127" class="LineNr">127 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L128" class="LineNr">128 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L129" class="LineNr">129 </span> <span class="subxS2Comment"># . . call</span>
<span id="L130" class="LineNr">130 </span> e8/call <a href='106stream.subx.html#L20'>clear-stream</a>/disp32
<span id="L131" class="LineNr">131 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L132" class="LineNr">132 </span> 81 0/subop/add 3/mod/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="L133" class="LineNr">133 </span> <span class="subxComment"># write-int32-decimal(_test-stream, 9)</span>
<span id="L134" class="LineNr">134 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L135" class="LineNr">135 </span> 68/push 9/imm32
<span id="L136" class="LineNr">136 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L137" class="LineNr">137 </span> <span class="subxS2Comment"># . . call</span>
<span id="L138" class="LineNr">138 </span> e8/call <a href='126write-int-decimal.subx.html#L8'>write-int32-decimal</a>/disp32
<span id="L139" class="LineNr">139 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L140" class="LineNr">140 </span> 81 0/subop/add 3/mod/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="L141" class="LineNr">141 </span> <span class="subxComment"># check-stream-equal(_test-stream, &quot;9&quot;, msg)</span>
<span id="L142" class="LineNr">142 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L143" class="LineNr">143 </span> 68/push <span class="Constant">&quot;F - test-write-int32-decimal&quot;</span>/imm32
<span id="L144" class="LineNr">144 </span> 68/push <span class="Constant">&quot;9&quot;</span>/imm32
<span id="L145" class="LineNr">145 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L146" class="LineNr">146 </span> <span class="subxS2Comment"># . . call</span>
<span id="L147" class="LineNr">147 </span> e8/call <a href='109stream-equal.subx.html#L194'>check-stream-equal</a>/disp32
<span id="L148" class="LineNr">148 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L149" class="LineNr">149 </span> 81 0/subop/add 3/mod/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="L150" class="LineNr">150 </span> <span class="subxS1Comment"># . end</span>
<span id="L151" class="LineNr">151 </span> c3/return
<span id="L152" class="LineNr">152 </span>
<span id="L153" class="LineNr">153 </span><span class="subxTest">test-write-int32-decimal-zero</span>:
<span id="L154" class="LineNr">154 </span> <span class="subxH1Comment"># - check that 0 converts correctly</span>
<span id="L155" class="LineNr">155 </span> <span class="subxComment"># setup</span>
<span id="L156" class="LineNr">156 </span> <span class="subxS1Comment"># . clear-stream(_test-stream)</span>
<span id="L157" class="LineNr">157 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L158" class="LineNr">158 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L159" class="LineNr">159 </span> <span class="subxS2Comment"># . . call</span>
<span id="L160" class="LineNr">160 </span> e8/call <a href='106stream.subx.html#L20'>clear-stream</a>/disp32
<span id="L161" class="LineNr">161 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L162" class="LineNr">162 </span> 81 0/subop/add 3/mod/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="L163" class="LineNr">163 </span> <span class="subxComment"># write-int32-decimal(_test-stream, 0)</span>
<span id="L164" class="LineNr">164 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L165" class="LineNr">165 </span> 68/push 0/imm32
<span id="L166" class="LineNr">166 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L167" class="LineNr">167 </span> <span class="subxS2Comment"># . . call</span>
<span id="L168" class="LineNr">168 </span> e8/call <a href='126write-int-decimal.subx.html#L8'>write-int32-decimal</a>/disp32
<span id="L169" class="LineNr">169 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L170" class="LineNr">170 </span> 81 0/subop/add 3/mod/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="L171" class="LineNr">171 </span> <span class="subxComment"># check-stream-equal(_test-stream, &quot;0&quot;, msg)</span>
<span id="L172" class="LineNr">172 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L173" class="LineNr">173 </span> 68/push <span class="Constant">&quot;F - test-write-int32-decimal-zero&quot;</span>/imm32
<span id="L174" class="LineNr">174 </span> 68/push <span class="Constant">&quot;0&quot;</span>/imm32
<span id="L175" class="LineNr">175 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L176" class="LineNr">176 </span> <span class="subxS2Comment"># . . call</span>
<span id="L177" class="LineNr">177 </span> e8/call <a href='109stream-equal.subx.html#L194'>check-stream-equal</a>/disp32
<span id="L178" class="LineNr">178 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L179" class="LineNr">179 </span> 81 0/subop/add 3/mod/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="L180" class="LineNr">180 </span> <span class="subxS1Comment"># . end</span>
<span id="L181" class="LineNr">181 </span> c3/return
<span id="L182" class="LineNr">182 </span>
<span id="L183" class="LineNr">183 </span><span class="subxTest">test-write-int32-decimal-multiple-digits</span>:
<span id="L184" class="LineNr">184 </span> <span class="subxH1Comment"># - check that a multi-digit number converts correctly</span>
<span id="L185" class="LineNr">185 </span> <span class="subxComment"># setup</span>
<span id="L186" class="LineNr">186 </span> <span class="subxS1Comment"># . clear-stream(_test-stream)</span>
<span id="L187" class="LineNr">187 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L188" class="LineNr">188 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L189" class="LineNr">189 </span> <span class="subxS2Comment"># . . call</span>
<span id="L190" class="LineNr">190 </span> e8/call <a href='106stream.subx.html#L20'>clear-stream</a>/disp32
<span id="L191" class="LineNr">191 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L192" class="LineNr">192 </span> 81 0/subop/add 3/mod/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="L193" class="LineNr">193 </span> <span class="subxComment"># write-int32-decimal(_test-stream, 10)</span>
<span id="L194" class="LineNr">194 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L195" class="LineNr">195 </span> 68/push 0xa/imm32
<span id="L196" class="LineNr">196 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L197" class="LineNr">197 </span> <span class="subxS2Comment"># . . call</span>
<span id="L198" class="LineNr">198 </span> e8/call <a href='126write-int-decimal.subx.html#L8'>write-int32-decimal</a>/disp32
<span id="L199" class="LineNr">199 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L200" class="LineNr">200 </span> 81 0/subop/add 3/mod/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="L201" class="LineNr">201 </span> <span class="subxComment"># check-stream-equal(_test-stream, &quot;10&quot;, msg)</span>
<span id="L202" class="LineNr">202 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L203" class="LineNr">203 </span> 68/push <span class="Constant">&quot;F - test-write-int32-decimal-multiple-digits&quot;</span>/imm32
<span id="L204" class="LineNr">204 </span> 68/push <span class="Constant">&quot;10&quot;</span>/imm32
<span id="L205" class="LineNr">205 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L206" class="LineNr">206 </span> <span class="subxS2Comment"># . . call</span>
<span id="L207" class="LineNr">207 </span> e8/call <a href='109stream-equal.subx.html#L194'>check-stream-equal</a>/disp32
<span id="L208" class="LineNr">208 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L209" class="LineNr">209 </span> 81 0/subop/add 3/mod/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="L210" class="LineNr">210 </span> <span class="subxS1Comment"># . end</span>
<span id="L211" class="LineNr">211 </span> c3/return
<span id="L212" class="LineNr">212 </span>
<span id="L213" class="LineNr">213 </span><span class="subxTest">test-write-int32-decimal-negative</span>:
<span id="L214" class="LineNr">214 </span> <span class="subxH1Comment"># - check that a negative single-digit number converts correctly</span>
<span id="L215" class="LineNr">215 </span> <span class="subxComment"># setup</span>
<span id="L216" class="LineNr">216 </span> <span class="subxS1Comment"># . clear-stream(_test-stream)</span>
<span id="L217" class="LineNr">217 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L218" class="LineNr">218 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L219" class="LineNr">219 </span> <span class="subxS2Comment"># . . call</span>
<span id="L220" class="LineNr">220 </span> e8/call <a href='106stream.subx.html#L20'>clear-stream</a>/disp32
<span id="L221" class="LineNr">221 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L222" class="LineNr">222 </span> 81 0/subop/add 3/mod/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="L223" class="LineNr">223 </span> <span class="subxComment"># write-int32-decimal(_test-stream, -9)</span>
<span id="L224" class="LineNr">224 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L225" class="LineNr">225 </span> 68/push -9/imm32
<span id="L226" class="LineNr">226 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L227" class="LineNr">227 </span> <span class="subxS2Comment"># . . call</span>
<span id="L228" class="LineNr">228 </span> e8/call <a href='126write-int-decimal.subx.html#L8'>write-int32-decimal</a>/disp32
<span id="L229" class="LineNr">229 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L230" class="LineNr">230 </span> 81 0/subop/add 3/mod/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="L231" class="Folded">231 </span><span class="Folded">+-- 26 lines: #? # dump _test-stream ------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="L257" class="LineNr">257 </span> <span class="subxComment"># check-stream-equal(_test-stream, &quot;-9&quot;, msg)</span>
<span id="L258" class="LineNr">258 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L259" class="LineNr">259 </span> 68/push <span class="Constant">&quot;F - test-write-int32-decimal-negative&quot;</span>/imm32
<span id="L260" class="LineNr">260 </span> 68/push <span class="Constant">&quot;-9&quot;</span>/imm32
<span id="L261" class="LineNr">261 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L262" class="LineNr">262 </span> <span class="subxS2Comment"># . . call</span>
<span id="L263" class="LineNr">263 </span> e8/call <a href='109stream-equal.subx.html#L194'>check-stream-equal</a>/disp32
<span id="L264" class="LineNr">264 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L265" class="LineNr">265 </span> 81 0/subop/add 3/mod/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="L266" class="LineNr">266 </span> <span class="subxS1Comment"># . end</span>
<span id="L267" class="LineNr">267 </span> c3/return
<span id="L268" class="LineNr">268 </span>
<span id="L269" class="LineNr">269 </span><span class="subxTest">test-write-int32-decimal-negative-multiple-digits</span>:
<span id="L270" class="LineNr">270 </span> <span class="subxH1Comment"># - check that a multi-digit number converts correctly</span>
<span id="L271" class="LineNr">271 </span> <span class="subxComment"># setup</span>
<span id="L272" class="LineNr">272 </span> <span class="subxS1Comment"># . clear-stream(_test-stream)</span>
<span id="L273" class="LineNr">273 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L274" class="LineNr">274 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L275" class="LineNr">275 </span> <span class="subxS2Comment"># . . call</span>
<span id="L276" class="LineNr">276 </span> e8/call <a href='106stream.subx.html#L20'>clear-stream</a>/disp32
<span id="L277" class="LineNr">277 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L278" class="LineNr">278 </span> 81 0/subop/add 3/mod/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="L279" class="LineNr">279 </span> <span class="subxComment"># write-int32-decimal(_test-stream, -10)</span>
<span id="L280" class="LineNr">280 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L281" class="LineNr">281 </span> 68/push -0xa/imm32
<span id="L282" class="LineNr">282 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L283" class="LineNr">283 </span> <span class="subxS2Comment"># . . call</span>
<span id="L284" class="LineNr">284 </span> e8/call <a href='126write-int-decimal.subx.html#L8'>write-int32-decimal</a>/disp32
<span id="L285" class="LineNr">285 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L286" class="LineNr">286 </span> 81 0/subop/add 3/mod/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="L287" class="LineNr">287 </span> <span class="subxComment"># check-stream-equal(_test-stream, &quot;-10&quot;, msg)</span>
<span id="L288" class="LineNr">288 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L289" class="LineNr">289 </span> 68/push <span class="Constant">&quot;F - test-write-int32-decimal-negative-multiple-digits&quot;</span>/imm32
<span id="L290" class="LineNr">290 </span> 68/push <span class="Constant">&quot;-10&quot;</span>/imm32
<span id="L291" class="LineNr">291 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L292" class="LineNr">292 </span> <span class="subxS2Comment"># . . call</span>
<span id="L293" class="LineNr">293 </span> e8/call <a href='109stream-equal.subx.html#L194'>check-stream-equal</a>/disp32
<span id="L294" class="LineNr">294 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L295" class="LineNr">295 </span> 81 0/subop/add 3/mod/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="L296" class="LineNr">296 </span> <span class="subxS1Comment"># . end</span>
<span id="L297" class="LineNr">297 </span> c3/return
<span id="L298" class="LineNr">298 </span>
<span id="L299" class="LineNr">299 </span><span class="subxFunction">decimal-digit?</span>: <span class="subxComment"># c: grapheme -&gt; result/eax: boolean</span>
<span id="L300" class="LineNr">300 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L301" class="LineNr">301 </span> 55/push-ebp
<span id="L302" class="LineNr">302 </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="L303" class="LineNr">303 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L304" class="LineNr">304 </span> 51/push-ecx
<span id="L305" class="LineNr">305 </span> <span class="subxComment"># ecx = c</span>
<span id="L306" class="LineNr">306 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <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="L307" class="LineNr">307 </span> <span class="subxComment"># result = false</span>
<span id="L308" class="LineNr">308 </span> b8/copy-to-eax 0/imm32/false
<span id="L309" class="LineNr">309 </span> <span class="subxComment"># return false if c &lt; '0'</span>
<span id="L310" class="LineNr">310 </span> 81 7/subop/compare 3/mod/direct 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x30/imm32 <span class="subxComment"># compare ecx</span>
<span id="L311" class="LineNr">311 </span> 7c/jump-if-&lt; $decimal-digit?:end/disp8
<span id="L312" class="LineNr">312 </span> <span class="subxComment"># return (c &lt;= '9')</span>
<span id="L313" class="LineNr">313 </span> 81 7/subop/compare 3/mod/direct 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x39/imm32 <span class="subxComment"># compare ecx</span>
<span id="L314" class="LineNr">314 </span> 7f/jump-if-&gt; $decimal-digit?:end/disp8
<span id="L315" class="LineNr">315 </span><span class="Constant">$decimal-digit?:true</span>:
<span id="L316" class="LineNr">316 </span> b8/copy-to-eax 1/imm32/true
<span id="L317" class="LineNr">317 </span><span class="Constant">$decimal-digit?:end</span>:
<span id="L318" class="LineNr">318 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L319" class="LineNr">319 </span> 59/pop-to-ecx
<span id="L320" class="LineNr">320 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L321" class="LineNr">321 </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="L322" class="LineNr">322 </span> 5d/pop-to-ebp
<span id="L323" class="LineNr">323 </span> c3/return
<span id="L324" class="LineNr">324 </span>
<span id="L325" class="LineNr">325 </span><span class="subxTest">test-decimal-digit-below-0</span>:
<span id="L326" class="LineNr">326 </span> <span class="subxComment"># eax = decimal-digit?(0x2f)</span>
<span id="L327" class="LineNr">327 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L328" class="LineNr">328 </span> 68/push 0x2f/imm32
<span id="L329" class="LineNr">329 </span> <span class="subxS2Comment"># . . call</span>
<span id="L330" class="LineNr">330 </span> e8/call <a href='126write-int-decimal.subx.html#L299'>decimal-digit?</a>/disp32
<span id="L331" class="LineNr">331 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L332" class="LineNr">332 </span> 81 0/subop/add 3/mod/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="L333" class="LineNr">333 </span> <span class="subxComment"># check-ints-equal(eax, 0, msg)</span>
<span id="L334" class="LineNr">334 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L335" class="LineNr">335 </span> 68/push <span class="Constant">&quot;F - test-decimal-digit-below-0&quot;</span>/imm32
<span id="L336" class="LineNr">336 </span> 68/push 0/imm32/false
<span id="L337" class="LineNr">337 </span> 50/push-eax
<span id="L338" class="LineNr">338 </span> <span class="subxS2Comment"># . . call</span>
<span id="L339" class="LineNr">339 </span> e8/call <a href='502test.mu.html#L2'>check-ints-equal</a>/disp32
<span id="L340" class="LineNr">340 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L341" class="LineNr">341 </span> 81 0/subop/add 3/mod/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="L342" class="LineNr">342 </span> c3/return
<span id="L343" class="LineNr">343 </span>
<span id="L344" class="LineNr">344 </span><span class="subxTest">test-decimal-digit-0-to-9</span>:
<span id="L345" class="LineNr">345 </span> <span class="subxComment"># eax = decimal-digit?(0x30)</span>
<span id="L346" class="LineNr">346 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L347" class="LineNr">347 </span> 68/push 0x30/imm32
<span id="L348" class="LineNr">348 </span> <span class="subxS2Comment"># . . call</span>
<span id="L349" class="LineNr">349 </span> e8/call <a href='126write-int-decimal.subx.html#L299'>decimal-digit?</a>/disp32
<span id="L350" class="LineNr">350 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L351" class="LineNr">351 </span> 81 0/subop/add 3/mod/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="L352" class="LineNr">352 </span> <span class="subxComment"># check-ints-equal(eax, 1, msg)</span>
<span id="L353" class="LineNr">353 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L354" class="LineNr">354 </span> 68/push <span class="Constant">&quot;F - test-decimal-digit-at-0&quot;</span>/imm32
<span id="L355" class="LineNr">355 </span> 68/push 1/imm32/true
<span id="L356" class="LineNr">356 </span> 50/push-eax
<span id="L357" class="LineNr">357 </span> <span class="subxS2Comment"># . . call</span>
<span id="L358" class="LineNr">358 </span> e8/call <a href='502test.mu.html#L2'>check-ints-equal</a>/disp32
<span id="L359" class="LineNr">359 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L360" class="LineNr">360 </span> 81 0/subop/add 3/mod/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="L361" class="LineNr">361 </span> <span class="subxComment"># eax = decimal-digit?(0x39)</span>
<span id="L362" class="LineNr">362 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L363" class="LineNr">363 </span> 68/push 0x39/imm32
<span id="L364" class="LineNr">364 </span> <span class="subxS2Comment"># . . call</span>
<span id="L365" class="LineNr">365 </span> e8/call <a href='126write-int-decimal.subx.html#L299'>decimal-digit?</a>/disp32
<span id="L366" class="LineNr">366 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L367" class="LineNr">367 </span> 81 0/subop/add 3/mod/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="L368" class="LineNr">368 </span> <span class="subxComment"># check-ints-equal(eax, 1, msg)</span>
<span id="L369" class="LineNr">369 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L370" class="LineNr">370 </span> 68/push <span class="Constant">&quot;F - test-decimal-digit-at-9&quot;</span>/imm32
<span id="L371" class="LineNr">371 </span> 68/push 1/imm32/true
<span id="L372" class="LineNr">372 </span> 50/push-eax
<span id="L373" class="LineNr">373 </span> <span class="subxS2Comment"># . . call</span>
<span id="L374" class="LineNr">374 </span> e8/call <a href='502test.mu.html#L2'>check-ints-equal</a>/disp32
<span id="L375" class="LineNr">375 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L376" class="LineNr">376 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span>
<span id="L377" class="LineNr">377 </span> c3/return
<span id="L378" class="LineNr">378 </span>
<span id="L379" class="LineNr">379 </span><span class="subxTest">test-decimal-digit-above-9</span>:
<span id="L380" class="LineNr">380 </span> <span class="subxComment"># eax = decimal-digit?(0x3a)</span>
<span id="L381" class="LineNr">381 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L382" class="LineNr">382 </span> 68/push 0x3a/imm32
<span id="L383" class="LineNr">383 </span> <span class="subxS2Comment"># . . call</span>
<span id="L384" class="LineNr">384 </span> e8/call <a href='126write-int-decimal.subx.html#L299'>decimal-digit?</a>/disp32
<span id="L385" class="LineNr">385 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L386" class="LineNr">386 </span> 81 0/subop/add 3/mod/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="L387" class="LineNr">387 </span> <span class="subxComment"># check-ints-equal(eax, 0, msg)</span>
<span id="L388" class="LineNr">388 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L389" class="LineNr">389 </span> 68/push <span class="Constant">&quot;F - test-decimal-digit-above-9&quot;</span>/imm32
<span id="L390" class="LineNr">390 </span> 68/push 0/imm32/false
<span id="L391" class="LineNr">391 </span> 50/push-eax
<span id="L392" class="LineNr">392 </span> <span class="subxS2Comment"># . . call</span>
<span id="L393" class="LineNr">393 </span> e8/call <a href='502test.mu.html#L2'>check-ints-equal</a>/disp32
<span id="L394" class="LineNr">394 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L395" class="LineNr">395 </span> 81 0/subop/add 3/mod/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="L396" class="LineNr">396 </span> c3/return
<span id="L397" class="LineNr">397 </span>
<span id="L398" class="LineNr">398 </span><span class="subxFunction">to-decimal-digit</span>: <span class="subxComment"># in: grapheme -&gt; out/eax: int</span>
<span id="L399" class="LineNr">399 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L400" class="LineNr">400 </span> 55/push-ebp
<span id="L401" class="LineNr">401 </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="L402" class="LineNr">402 </span> <span class="subxComment"># eax = in</span>
<span id="L403" class="LineNr">403 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to eax</span>
<span id="L404" class="LineNr">404 </span><span class="Constant">$to-decimal-digit:check0</span>:
<span id="L405" class="LineNr">405 </span> <span class="subxComment"># if (eax &lt; '0') goto abort</span>
<span id="L406" class="LineNr">406 </span> 3d/compare-eax-with 0x30/imm32/0
<span id="L407" class="LineNr">407 </span> 7c/jump-if-&lt; $to-decimal-digit:<a href='501draw-text.mu.html#L481'>abort</a>/disp8
<span id="L408" class="LineNr">408 </span><span class="Constant">$to-decimal-digit:check1</span>:
<span id="L409" class="LineNr">409 </span> <span class="subxComment"># if (eax &gt; '9') goto abort</span>
<span id="L410" class="LineNr">410 </span> 3d/compare-eax-with 0x39/imm32/f
<span id="L411" class="LineNr">411 </span> 7f/jump-if-&gt; $to-decimal-digit:<a href='501draw-text.mu.html#L481'>abort</a>/disp8
<span id="L412" class="LineNr">412 </span><span class="Constant">$to-decimal-digit:digit</span>:
<span id="L413" class="LineNr">413 </span> <span class="subxComment"># return eax - '0'</span>
<span id="L414" class="LineNr">414 </span> 2d/subtract-from-eax 0x30/imm32/0
<span id="L415" class="LineNr">415 </span><span class="Constant">$to-decimal-digit:end</span>:
<span id="L416" class="LineNr">416 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L417" class="LineNr">417 </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="L418" class="LineNr">418 </span> 5d/pop-to-ebp
<span id="L419" class="LineNr">419 </span> c3/return
<span id="L420" class="LineNr">420 </span>
<span id="L421" class="LineNr">421 </span><span class="Constant">$to-decimal-digit:<a href='501draw-text.mu.html#L481'>abort</a></span>:
<span id="L422" class="LineNr">422 </span> (<a href='501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">&quot;to-decimal-digit: not a digit character&quot;</span> 3 0) <span class="subxComment"># 3=cyan</span>
<span id="L423" class="LineNr">423 </span> {
<span id="L424" class="LineNr">424 </span> eb/jump <span class="Constant">loop</span>/disp8
<span id="L425" class="LineNr">425 </span> }
<span id="L426" class="LineNr">426 </span> <span class="subxComment"># never gets here</span>
<span id="L427" class="LineNr">427 </span>
<span id="L428" class="LineNr">428 </span><span class="subxS2Comment"># . . vim&#0058;nowrap:textwidth=0</span>
<span id="L116" class="LineNr">116 </span><span class="Constant">$write-int32-decimal:<a href='317abort.subx.html#L5'>abort</a></span>:
<span id="L117" class="LineNr">117 </span> (<a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;write-int32-decimal: stream out of space&quot;</span>)
<span id="L118" class="LineNr">118 </span> <span class="subxComment"># never gets here</span>
<span id="L119" class="LineNr">119 </span>
<span id="L120" class="LineNr">120 </span><span class="subxTest">test-write-int32-decimal</span>:
<span id="L121" class="LineNr">121 </span> <span class="subxH1Comment"># - check that a single-digit number converts correctly</span>
<span id="L122" class="LineNr">122 </span> <span class="subxComment"># setup</span>
<span id="L123" class="LineNr">123 </span> <span class="subxS1Comment"># . clear-stream(_test-stream)</span>
<span id="L124" class="LineNr">124 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L125" class="LineNr">125 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L126" class="LineNr">126 </span> <span class="subxS2Comment"># . . call</span>
<span id="L127" class="LineNr">127 </span> e8/call <a href='106stream.subx.html#L20'>clear-stream</a>/disp32
<span id="L128" class="LineNr">128 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L129" class="LineNr">129 </span> 81 0/subop/add 3/mod/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="L130" class="LineNr">130 </span> <span class="subxComment"># write-int32-decimal(_test-stream, 9)</span>
<span id="L131" class="LineNr">131 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L132" class="LineNr">132 </span> 68/push 9/imm32
<span id="L133" class="LineNr">133 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L134" class="LineNr">134 </span> <span class="subxS2Comment"># . . call</span>
<span id="L135" class="LineNr">135 </span> e8/call <a href='126write-int-decimal.subx.html#L8'>write-int32-decimal</a>/disp32
<span id="L136" class="LineNr">136 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L137" class="LineNr">137 </span> 81 0/subop/add 3/mod/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="L138" class="LineNr">138 </span> <span class="subxComment"># check-stream-equal(_test-stream, &quot;9&quot;, msg)</span>
<span id="L139" class="LineNr">139 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L140" class="LineNr">140 </span> 68/push <span class="Constant">&quot;F - test-write-int32-decimal&quot;</span>/imm32
<span id="L141" class="LineNr">141 </span> 68/push <span class="Constant">&quot;9&quot;</span>/imm32
<span id="L142" class="LineNr">142 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L143" class="LineNr">143 </span> <span class="subxS2Comment"># . . call</span>
<span id="L144" class="LineNr">144 </span> e8/call <a href='109stream-equal.subx.html#L194'>check-stream-equal</a>/disp32
<span id="L145" class="LineNr">145 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L146" class="LineNr">146 </span> 81 0/subop/add 3/mod/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="L147" class="LineNr">147 </span> <span class="subxS1Comment"># . end</span>
<span id="L148" class="LineNr">148 </span> c3/return
<span id="L149" class="LineNr">149 </span>
<span id="L150" class="LineNr">150 </span><span class="subxTest">test-write-int32-decimal-zero</span>:
<span id="L151" class="LineNr">151 </span> <span class="subxH1Comment"># - check that 0 converts correctly</span>
<span id="L152" class="LineNr">152 </span> <span class="subxComment"># setup</span>
<span id="L153" class="LineNr">153 </span> <span class="subxS1Comment"># . clear-stream(_test-stream)</span>
<span id="L154" class="LineNr">154 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L155" class="LineNr">155 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L156" class="LineNr">156 </span> <span class="subxS2Comment"># . . call</span>
<span id="L157" class="LineNr">157 </span> e8/call <a href='106stream.subx.html#L20'>clear-stream</a>/disp32
<span id="L158" class="LineNr">158 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L159" class="LineNr">159 </span> 81 0/subop/add 3/mod/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="L160" class="LineNr">160 </span> <span class="subxComment"># write-int32-decimal(_test-stream, 0)</span>
<span id="L161" class="LineNr">161 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L162" class="LineNr">162 </span> 68/push 0/imm32
<span id="L163" class="LineNr">163 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L164" class="LineNr">164 </span> <span class="subxS2Comment"># . . call</span>
<span id="L165" class="LineNr">165 </span> e8/call <a href='126write-int-decimal.subx.html#L8'>write-int32-decimal</a>/disp32
<span id="L166" class="LineNr">166 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L167" class="LineNr">167 </span> 81 0/subop/add 3/mod/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="L168" class="LineNr">168 </span> <span class="subxComment"># check-stream-equal(_test-stream, &quot;0&quot;, msg)</span>
<span id="L169" class="LineNr">169 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L170" class="LineNr">170 </span> 68/push <span class="Constant">&quot;F - test-write-int32-decimal-zero&quot;</span>/imm32
<span id="L171" class="LineNr">171 </span> 68/push <span class="Constant">&quot;0&quot;</span>/imm32
<span id="L172" class="LineNr">172 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L173" class="LineNr">173 </span> <span class="subxS2Comment"># . . call</span>
<span id="L174" class="LineNr">174 </span> e8/call <a href='109stream-equal.subx.html#L194'>check-stream-equal</a>/disp32
<span id="L175" class="LineNr">175 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L176" class="LineNr">176 </span> 81 0/subop/add 3/mod/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="L177" class="LineNr">177 </span> <span class="subxS1Comment"># . end</span>
<span id="L178" class="LineNr">178 </span> c3/return
<span id="L179" class="LineNr">179 </span>
<span id="L180" class="LineNr">180 </span><span class="subxTest">test-write-int32-decimal-multiple-digits</span>:
<span id="L181" class="LineNr">181 </span> <span class="subxH1Comment"># - check that a multi-digit number converts correctly</span>
<span id="L182" class="LineNr">182 </span> <span class="subxComment"># setup</span>
<span id="L183" class="LineNr">183 </span> <span class="subxS1Comment"># . clear-stream(_test-stream)</span>
<span id="L184" class="LineNr">184 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L185" class="LineNr">185 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L186" class="LineNr">186 </span> <span class="subxS2Comment"># . . call</span>
<span id="L187" class="LineNr">187 </span> e8/call <a href='106stream.subx.html#L20'>clear-stream</a>/disp32
<span id="L188" class="LineNr">188 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L189" class="LineNr">189 </span> 81 0/subop/add 3/mod/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="L190" class="LineNr">190 </span> <span class="subxComment"># write-int32-decimal(_test-stream, 10)</span>
<span id="L191" class="LineNr">191 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L192" class="LineNr">192 </span> 68/push 0xa/imm32
<span id="L193" class="LineNr">193 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L194" class="LineNr">194 </span> <span class="subxS2Comment"># . . call</span>
<span id="L195" class="LineNr">195 </span> e8/call <a href='126write-int-decimal.subx.html#L8'>write-int32-decimal</a>/disp32
<span id="L196" class="LineNr">196 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L197" class="LineNr">197 </span> 81 0/subop/add 3/mod/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="L198" class="LineNr">198 </span> <span class="subxComment"># check-stream-equal(_test-stream, &quot;10&quot;, msg)</span>
<span id="L199" class="LineNr">199 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L200" class="LineNr">200 </span> 68/push <span class="Constant">&quot;F - test-write-int32-decimal-multiple-digits&quot;</span>/imm32
<span id="L201" class="LineNr">201 </span> 68/push <span class="Constant">&quot;10&quot;</span>/imm32
<span id="L202" class="LineNr">202 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L203" class="LineNr">203 </span> <span class="subxS2Comment"># . . call</span>
<span id="L204" class="LineNr">204 </span> e8/call <a href='109stream-equal.subx.html#L194'>check-stream-equal</a>/disp32
<span id="L205" class="LineNr">205 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L206" class="LineNr">206 </span> 81 0/subop/add 3/mod/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="L207" class="LineNr">207 </span> <span class="subxS1Comment"># . end</span>
<span id="L208" class="LineNr">208 </span> c3/return
<span id="L209" class="LineNr">209 </span>
<span id="L210" class="LineNr">210 </span><span class="subxTest">test-write-int32-decimal-negative</span>:
<span id="L211" class="LineNr">211 </span> <span class="subxH1Comment"># - check that a negative single-digit number converts correctly</span>
<span id="L212" class="LineNr">212 </span> <span class="subxComment"># setup</span>
<span id="L213" class="LineNr">213 </span> <span class="subxS1Comment"># . clear-stream(_test-stream)</span>
<span id="L214" class="LineNr">214 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L215" class="LineNr">215 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L216" class="LineNr">216 </span> <span class="subxS2Comment"># . . call</span>
<span id="L217" class="LineNr">217 </span> e8/call <a href='106stream.subx.html#L20'>clear-stream</a>/disp32
<span id="L218" class="LineNr">218 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L219" class="LineNr">219 </span> 81 0/subop/add 3/mod/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="L220" class="LineNr">220 </span> <span class="subxComment"># write-int32-decimal(_test-stream, -9)</span>
<span id="L221" class="LineNr">221 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L222" class="LineNr">222 </span> 68/push -9/imm32
<span id="L223" class="LineNr">223 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L224" class="LineNr">224 </span> <span class="subxS2Comment"># . . call</span>
<span id="L225" class="LineNr">225 </span> e8/call <a href='126write-int-decimal.subx.html#L8'>write-int32-decimal</a>/disp32
<span id="L226" class="LineNr">226 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L227" class="LineNr">227 </span> 81 0/subop/add 3/mod/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="L228" class="Folded">228 </span><span class="Folded">+-- 26 lines: #? # dump _test-stream ------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="L254" class="LineNr">254 </span> <span class="subxComment"># check-stream-equal(_test-stream, &quot;-9&quot;, msg)</span>
<span id="L255" class="LineNr">255 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L256" class="LineNr">256 </span> 68/push <span class="Constant">&quot;F - test-write-int32-decimal-negative&quot;</span>/imm32
<span id="L257" class="LineNr">257 </span> 68/push <span class="Constant">&quot;-9&quot;</span>/imm32
<span id="L258" class="LineNr">258 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L259" class="LineNr">259 </span> <span class="subxS2Comment"># . . call</span>
<span id="L260" class="LineNr">260 </span> e8/call <a href='109stream-equal.subx.html#L194'>check-stream-equal</a>/disp32
<span id="L261" class="LineNr">261 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L262" class="LineNr">262 </span> 81 0/subop/add 3/mod/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="L263" class="LineNr">263 </span> <span class="subxS1Comment"># . end</span>
<span id="L264" class="LineNr">264 </span> c3/return
<span id="L265" class="LineNr">265 </span>
<span id="L266" class="LineNr">266 </span><span class="subxTest">test-write-int32-decimal-negative-multiple-digits</span>:
<span id="L267" class="LineNr">267 </span> <span class="subxH1Comment"># - check that a multi-digit number converts correctly</span>
<span id="L268" class="LineNr">268 </span> <span class="subxComment"># setup</span>
<span id="L269" class="LineNr">269 </span> <span class="subxS1Comment"># . clear-stream(_test-stream)</span>
<span id="L270" class="LineNr">270 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L271" class="LineNr">271 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L272" class="LineNr">272 </span> <span class="subxS2Comment"># . . call</span>
<span id="L273" class="LineNr">273 </span> e8/call <a href='106stream.subx.html#L20'>clear-stream</a>/disp32
<span id="L274" class="LineNr">274 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L275" class="LineNr">275 </span> 81 0/subop/add 3/mod/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="L276" class="LineNr">276 </span> <span class="subxComment"># write-int32-decimal(_test-stream, -10)</span>
<span id="L277" class="LineNr">277 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L278" class="LineNr">278 </span> 68/push -0xa/imm32
<span id="L279" class="LineNr">279 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L280" class="LineNr">280 </span> <span class="subxS2Comment"># . . call</span>
<span id="L281" class="LineNr">281 </span> e8/call <a href='126write-int-decimal.subx.html#L8'>write-int32-decimal</a>/disp32
<span id="L282" class="LineNr">282 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L283" class="LineNr">283 </span> 81 0/subop/add 3/mod/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="L284" class="LineNr">284 </span> <span class="subxComment"># check-stream-equal(_test-stream, &quot;-10&quot;, msg)</span>
<span id="L285" class="LineNr">285 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L286" class="LineNr">286 </span> 68/push <span class="Constant">&quot;F - test-write-int32-decimal-negative-multiple-digits&quot;</span>/imm32
<span id="L287" class="LineNr">287 </span> 68/push <span class="Constant">&quot;-10&quot;</span>/imm32
<span id="L288" class="LineNr">288 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L289" class="LineNr">289 </span> <span class="subxS2Comment"># . . call</span>
<span id="L290" class="LineNr">290 </span> e8/call <a href='109stream-equal.subx.html#L194'>check-stream-equal</a>/disp32
<span id="L291" class="LineNr">291 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L292" class="LineNr">292 </span> 81 0/subop/add 3/mod/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="L293" class="LineNr">293 </span> <span class="subxS1Comment"># . end</span>
<span id="L294" class="LineNr">294 </span> c3/return
<span id="L295" class="LineNr">295 </span>
<span id="L296" class="LineNr">296 </span><span class="subxFunction">decimal-digit?</span>: <span class="subxComment"># c: grapheme -&gt; result/eax: boolean</span>
<span id="L297" class="LineNr">297 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L298" class="LineNr">298 </span> 55/push-ebp
<span id="L299" class="LineNr">299 </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="L300" class="LineNr">300 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L301" class="LineNr">301 </span> 51/push-ecx
<span id="L302" class="LineNr">302 </span> <span class="subxComment"># ecx = c</span>
<span id="L303" class="LineNr">303 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <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="L304" class="LineNr">304 </span> <span class="subxComment"># result = false</span>
<span id="L305" class="LineNr">305 </span> b8/copy-to-eax 0/imm32/false
<span id="L306" class="LineNr">306 </span> <span class="subxComment"># return false if c &lt; '0'</span>
<span id="L307" class="LineNr">307 </span> 81 7/subop/compare 3/mod/direct 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x30/imm32 <span class="subxComment"># compare ecx</span>
<span id="L308" class="LineNr">308 </span> 7c/jump-if-&lt; $decimal-digit?:end/disp8
<span id="L309" class="LineNr">309 </span> <span class="subxComment"># return (c &lt;= '9')</span>
<span id="L310" class="LineNr">310 </span> 81 7/subop/compare 3/mod/direct 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x39/imm32 <span class="subxComment"># compare ecx</span>
<span id="L311" class="LineNr">311 </span> 7f/jump-if-&gt; $decimal-digit?:end/disp8
<span id="L312" class="LineNr">312 </span><span class="Constant">$decimal-digit?:true</span>:
<span id="L313" class="LineNr">313 </span> b8/copy-to-eax 1/imm32/true
<span id="L314" class="LineNr">314 </span><span class="Constant">$decimal-digit?:end</span>:
<span id="L315" class="LineNr">315 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L316" class="LineNr">316 </span> 59/pop-to-ecx
<span id="L317" class="LineNr">317 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L318" class="LineNr">318 </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="L319" class="LineNr">319 </span> 5d/pop-to-ebp
<span id="L320" class="LineNr">320 </span> c3/return
<span id="L321" class="LineNr">321 </span>
<span id="L322" class="LineNr">322 </span><span class="subxTest">test-decimal-digit-below-0</span>:
<span id="L323" class="LineNr">323 </span> <span class="subxComment"># eax = decimal-digit?(0x2f)</span>
<span id="L324" class="LineNr">324 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L325" class="LineNr">325 </span> 68/push 0x2f/imm32
<span id="L326" class="LineNr">326 </span> <span class="subxS2Comment"># . . call</span>
<span id="L327" class="LineNr">327 </span> e8/call <a href='126write-int-decimal.subx.html#L296'>decimal-digit?</a>/disp32
<span id="L328" class="LineNr">328 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L329" class="LineNr">329 </span> 81 0/subop/add 3/mod/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="L330" class="LineNr">330 </span> <span class="subxComment"># check-ints-equal(eax, 0, msg)</span>
<span id="L331" class="LineNr">331 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L332" class="LineNr">332 </span> 68/push <span class="Constant">&quot;F - test-decimal-digit-below-0&quot;</span>/imm32
<span id="L333" class="LineNr">333 </span> 68/push 0/imm32/false
<span id="L334" class="LineNr">334 </span> 50/push-eax
<span id="L335" class="LineNr">335 </span> <span class="subxS2Comment"># . . call</span>
<span id="L336" class="LineNr">336 </span> e8/call <a href='502test.mu.html#L2'>check-ints-equal</a>/disp32
<span id="L337" class="LineNr">337 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L338" class="LineNr">338 </span> 81 0/subop/add 3/mod/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="L339" class="LineNr">339 </span> c3/return
<span id="L340" class="LineNr">340 </span>
<span id="L341" class="LineNr">341 </span><span class="subxTest">test-decimal-digit-0-to-9</span>:
<span id="L342" class="LineNr">342 </span> <span class="subxComment"># eax = decimal-digit?(0x30)</span>
<span id="L343" class="LineNr">343 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L344" class="LineNr">344 </span> 68/push 0x30/imm32
<span id="L345" class="LineNr">345 </span> <span class="subxS2Comment"># . . call</span>
<span id="L346" class="LineNr">346 </span> e8/call <a href='126write-int-decimal.subx.html#L296'>decimal-digit?</a>/disp32
<span id="L347" class="LineNr">347 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L348" class="LineNr">348 </span> 81 0/subop/add 3/mod/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="L349" class="LineNr">349 </span> <span class="subxComment"># check-ints-equal(eax, 1, msg)</span>
<span id="L350" class="LineNr">350 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L351" class="LineNr">351 </span> 68/push <span class="Constant">&quot;F - test-decimal-digit-at-0&quot;</span>/imm32
<span id="L352" class="LineNr">352 </span> 68/push 1/imm32/true
<span id="L353" class="LineNr">353 </span> 50/push-eax
<span id="L354" class="LineNr">354 </span> <span class="subxS2Comment"># . . call</span>
<span id="L355" class="LineNr">355 </span> e8/call <a href='502test.mu.html#L2'>check-ints-equal</a>/disp32
<span id="L356" class="LineNr">356 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L357" class="LineNr">357 </span> 81 0/subop/add 3/mod/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="L358" class="LineNr">358 </span> <span class="subxComment"># eax = decimal-digit?(0x39)</span>
<span id="L359" class="LineNr">359 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L360" class="LineNr">360 </span> 68/push 0x39/imm32
<span id="L361" class="LineNr">361 </span> <span class="subxS2Comment"># . . call</span>
<span id="L362" class="LineNr">362 </span> e8/call <a href='126write-int-decimal.subx.html#L296'>decimal-digit?</a>/disp32
<span id="L363" class="LineNr">363 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L364" class="LineNr">364 </span> 81 0/subop/add 3/mod/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="L365" class="LineNr">365 </span> <span class="subxComment"># check-ints-equal(eax, 1, msg)</span>
<span id="L366" class="LineNr">366 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L367" class="LineNr">367 </span> 68/push <span class="Constant">&quot;F - test-decimal-digit-at-9&quot;</span>/imm32
<span id="L368" class="LineNr">368 </span> 68/push 1/imm32/true
<span id="L369" class="LineNr">369 </span> 50/push-eax
<span id="L370" class="LineNr">370 </span> <span class="subxS2Comment"># . . call</span>
<span id="L371" class="LineNr">371 </span> e8/call <a href='502test.mu.html#L2'>check-ints-equal</a>/disp32
<span id="L372" class="LineNr">372 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L373" class="LineNr">373 </span> 81 0/subop/add 3/mod/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="L374" class="LineNr">374 </span> c3/return
<span id="L375" class="LineNr">375 </span>
<span id="L376" class="LineNr">376 </span><span class="subxTest">test-decimal-digit-above-9</span>:
<span id="L377" class="LineNr">377 </span> <span class="subxComment"># eax = decimal-digit?(0x3a)</span>
<span id="L378" class="LineNr">378 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L379" class="LineNr">379 </span> 68/push 0x3a/imm32
<span id="L380" class="LineNr">380 </span> <span class="subxS2Comment"># . . call</span>
<span id="L381" class="LineNr">381 </span> e8/call <a href='126write-int-decimal.subx.html#L296'>decimal-digit?</a>/disp32
<span id="L382" class="LineNr">382 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L383" class="LineNr">383 </span> 81 0/subop/add 3/mod/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="L384" class="LineNr">384 </span> <span class="subxComment"># check-ints-equal(eax, 0, msg)</span>
<span id="L385" class="LineNr">385 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L386" class="LineNr">386 </span> 68/push <span class="Constant">&quot;F - test-decimal-digit-above-9&quot;</span>/imm32
<span id="L387" class="LineNr">387 </span> 68/push 0/imm32/false
<span id="L388" class="LineNr">388 </span> 50/push-eax
<span id="L389" class="LineNr">389 </span> <span class="subxS2Comment"># . . call</span>
<span id="L390" class="LineNr">390 </span> e8/call <a href='502test.mu.html#L2'>check-ints-equal</a>/disp32
<span id="L391" class="LineNr">391 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L392" class="LineNr">392 </span> 81 0/subop/add 3/mod/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="L393" class="LineNr">393 </span> c3/return
<span id="L394" class="LineNr">394 </span>
<span id="L395" class="LineNr">395 </span><span class="subxFunction">to-decimal-digit</span>: <span class="subxComment"># in: grapheme -&gt; out/eax: int</span>
<span id="L396" class="LineNr">396 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L397" class="LineNr">397 </span> 55/push-ebp
<span id="L398" class="LineNr">398 </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="L399" class="LineNr">399 </span> <span class="subxComment"># eax = in</span>
<span id="L400" class="LineNr">400 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to eax</span>
<span id="L401" class="LineNr">401 </span><span class="Constant">$to-decimal-digit:check0</span>:
<span id="L402" class="LineNr">402 </span> <span class="subxComment"># if (eax &lt; '0') goto abort</span>
<span id="L403" class="LineNr">403 </span> 3d/compare-eax-with 0x30/imm32/0
<span id="L404" class="LineNr">404 </span> 7c/jump-if-&lt; $to-decimal-digit:<a href='317abort.subx.html#L5'>abort</a>/disp8
<span id="L405" class="LineNr">405 </span><span class="Constant">$to-decimal-digit:check1</span>:
<span id="L406" class="LineNr">406 </span> <span class="subxComment"># if (eax &gt; '9') goto abort</span>
<span id="L407" class="LineNr">407 </span> 3d/compare-eax-with 0x39/imm32/f
<span id="L408" class="LineNr">408 </span> 7f/jump-if-&gt; $to-decimal-digit:<a href='317abort.subx.html#L5'>abort</a>/disp8
<span id="L409" class="LineNr">409 </span><span class="Constant">$to-decimal-digit:digit</span>:
<span id="L410" class="LineNr">410 </span> <span class="subxComment"># return eax - '0'</span>
<span id="L411" class="LineNr">411 </span> 2d/subtract-from-eax 0x30/imm32/0
<span id="L412" class="LineNr">412 </span><span class="Constant">$to-decimal-digit:end</span>:
<span id="L413" class="LineNr">413 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L414" class="LineNr">414 </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="L415" class="LineNr">415 </span> 5d/pop-to-ebp
<span id="L416" class="LineNr">416 </span> c3/return
<span id="L417" class="LineNr">417 </span>
<span id="L418" class="LineNr">418 </span><span class="Constant">$to-decimal-digit:<a href='317abort.subx.html#L5'>abort</a></span>:
<span id="L419" class="LineNr">419 </span> (<a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;to-decimal-digit: not a digit character&quot;</span>)
<span id="L420" class="LineNr">420 </span> <span class="subxComment"># never gets here</span>
<span id="L421" class="LineNr">421 </span>
<span id="L422" class="LineNr">422 </span><span class="subxS2Comment"># . . vim&#0058;nowrap:textwidth=0</span>
</pre>
</body>
</html>

View File

@ -293,7 +293,7 @@ if ('onhashchange' in window) {
<span id="L233" class="LineNr">233 </span> 81 0/subop/add %ebx 4/imm32
<span id="L234" class="LineNr">234 </span> eb/jump $_parse-array-of-ints:loop1/disp8
<span id="L235" class="LineNr">235 </span><span class="Constant">$_parse-array-of-ints:break1</span>:
<span id="L236" class="LineNr">236 </span> (<a href='120allocate.subx.html#L535'>allocate-array</a> *(ebp+8) %ebx *(ebp+0x10))
<span id="L236" class="LineNr">236 </span> (<a href='120allocate.subx.html#L556'>allocate-array</a> *(ebp+8) %ebx *(ebp+0x10))
<span id="L237" class="LineNr">237 </span><span class="Constant">$_parse-array-of-ints:pass2</span>:
<span id="L238" class="LineNr">238 </span> <span class="subxComment"># var slice/edi: slice = {s-&gt;data, 0}</span>
<span id="L239" class="LineNr">239 </span> 68/push 0/imm32/end
@ -302,7 +302,7 @@ if ('onhashchange' in window) {
<span id="L242" class="LineNr">242 </span> 89/&lt;- %edi 4/r32/esp
<span id="L243" class="LineNr">243 </span> <span class="subxComment"># curr = lookup(out)-&gt;data</span>
<span id="L244" class="LineNr">244 </span> 8b/-&gt; *(ebp+0x10) 0/r32/eax
<span id="L245" class="LineNr">245 </span> (<a href='120allocate.subx.html#L226'>lookup</a> *eax *(eax+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L245" class="LineNr">245 </span> (<a href='120allocate.subx.html#L223'>lookup</a> *eax *(eax+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L246" class="LineNr">246 </span> 8d/copy-address *(eax+4) 1/r32/ecx
<span id="L247" class="LineNr">247 </span><span class="Constant">$_parse-array-of-ints:loop2</span>:
<span id="L248" class="LineNr">248 </span> <span class="subxComment"># if (slice-&gt;start &gt;= end) break</span>
@ -357,7 +357,7 @@ if ('onhashchange' in window) {
<span id="L297" class="LineNr">297 </span> 89/&lt;- %ecx 4/r32/esp
<span id="L298" class="LineNr">298 </span> <span class="subxComment">#</span>
<span id="L299" class="LineNr">299 </span> (<a href='301array-equal.subx.html#L174'>_parse-array-of-ints</a> <span class="SpecialChar"><a href='120allocate.subx.html#L27'>Heap</a></span> <span class="Constant">&quot;1 2 3&quot;</span> %esi)
<span id="L300" class="LineNr">300 </span> (<a href='120allocate.subx.html#L226'>lookup</a> *esi *(esi+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L300" class="LineNr">300 </span> (<a href='120allocate.subx.html#L223'>lookup</a> *esi *(esi+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L301" class="LineNr">301 </span> (<a href='301array-equal.subx.html#L5'>array-equal?</a> %ecx %eax) <span class="subxComment"># =&gt; eax</span>
<span id="L302" class="LineNr">302 </span> (<a href='502test.mu.html#L2'>check-ints-equal</a> %eax 1 <span class="Constant">&quot;F - test-parse-array-of-ints&quot;</span>)
<span id="L303" class="LineNr">303 </span> <span class="subxS1Comment"># . epilogue</span>
@ -376,7 +376,7 @@ if ('onhashchange' in window) {
<span id="L316" class="LineNr">316 </span> 89/&lt;- %esi 4/r32/esp
<span id="L317" class="LineNr">317 </span> <span class="subxComment">#</span>
<span id="L318" class="LineNr">318 </span> (<a href='301array-equal.subx.html#L174'>_parse-array-of-ints</a> <span class="SpecialChar"><a href='120allocate.subx.html#L27'>Heap</a></span> <span class="Constant">&quot;&quot;</span> %esi)
<span id="L319" class="LineNr">319 </span> (<a href='120allocate.subx.html#L226'>lookup</a> *esi *(esi+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L319" class="LineNr">319 </span> (<a href='120allocate.subx.html#L223'>lookup</a> *esi *(esi+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L320" class="LineNr">320 </span> (<a href='502test.mu.html#L2'>check-ints-equal</a> *eax 0 <span class="Constant">&quot;F - test-parse-array-of-ints-empty&quot;</span>)
<span id="L321" class="LineNr">321 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L322" class="LineNr">322 </span> 89/&lt;- %esp 5/r32/ebp
@ -394,7 +394,7 @@ if ('onhashchange' in window) {
<span id="L334" class="LineNr">334 </span> 89/&lt;- %esi 4/r32/esp
<span id="L335" class="LineNr">335 </span> <span class="subxComment">#</span>
<span id="L336" class="LineNr">336 </span> (<a href='301array-equal.subx.html#L174'>_parse-array-of-ints</a> <span class="SpecialChar"><a href='120allocate.subx.html#L27'>Heap</a></span> <span class="SpecialChar"><a href='301array-equal.subx.html#L428'>Space</a></span> %esi)
<span id="L337" class="LineNr">337 </span> (<a href='120allocate.subx.html#L226'>lookup</a> *esi *(esi+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L337" class="LineNr">337 </span> (<a href='120allocate.subx.html#L223'>lookup</a> *esi *(esi+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L338" class="LineNr">338 </span> (<a href='502test.mu.html#L2'>check-ints-equal</a> *eax 0 <span class="Constant">&quot;F - test-parse-array-of-ints-just-whitespace&quot;</span>)
<span id="L339" class="LineNr">339 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L340" class="LineNr">340 </span> 89/&lt;- %esp 5/r32/ebp
@ -417,7 +417,7 @@ if ('onhashchange' in window) {
<span id="L357" class="LineNr">357 </span> 89/&lt;- %ecx 4/r32/esp
<span id="L358" class="LineNr">358 </span> <span class="subxComment">#</span>
<span id="L359" class="LineNr">359 </span> (<a href='301array-equal.subx.html#L174'>_parse-array-of-ints</a> <span class="SpecialChar"><a href='120allocate.subx.html#L27'>Heap</a></span> <span class="Constant">&quot; 1 2 3 &quot;</span> %esi)
<span id="L360" class="LineNr">360 </span> (<a href='120allocate.subx.html#L226'>lookup</a> *esi *(esi+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L360" class="LineNr">360 </span> (<a href='120allocate.subx.html#L223'>lookup</a> *esi *(esi+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L361" class="LineNr">361 </span> (<a href='301array-equal.subx.html#L5'>array-equal?</a> %ecx %eax) <span class="subxComment"># =&gt; eax</span>
<span id="L362" class="LineNr">362 </span> (<a href='502test.mu.html#L2'>check-ints-equal</a> %eax 1 <span class="Constant">&quot;F - test-parse-array-of-ints-extra-whitespace&quot;</span>)
<span id="L363" class="LineNr">363 </span> <span class="subxS1Comment"># . epilogue</span>
@ -452,7 +452,7 @@ if ('onhashchange' in window) {
<span id="L392" class="LineNr">392 </span> 89/&lt;- %esi 4/r32/esp
<span id="L393" class="LineNr">393 </span> <span class="subxComment"># var b/eax: (addr array int) = parse-array-of-ints(Heap, expected)</span>
<span id="L394" class="LineNr">394 </span> (<a href='301array-equal.subx.html#L368'>parse-array-of-ints</a> *(ebp+0xc) %esi)
<span id="L395" class="LineNr">395 </span> (<a href='120allocate.subx.html#L226'>lookup</a> *esi *(esi+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L395" class="LineNr">395 </span> (<a href='120allocate.subx.html#L223'>lookup</a> *esi *(esi+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L396" class="LineNr">396 </span> <span class="subxComment">#</span>
<span id="L397" class="LineNr">397 </span> (<a href='301array-equal.subx.html#L5'>array-equal?</a> *(ebp+8) %eax)
<span id="L398" class="LineNr">398 </span> (<a href='502test.mu.html#L2'>check-ints-equal</a> %eax 1 *(ebp+0x10))

View File

@ -104,7 +104,7 @@ if ('onhashchange' in window) {
<span id="L47" class="LineNr">47 </span> 89/&lt;- *<span class="SpecialChar"><a href='302stack_allocate.subx.html#L58'>Push-n-zero-bytes-esp</a></span> 4/r32/esp
<span id="L48" class="LineNr">48 </span> 81 0/subop/add *<span class="SpecialChar"><a href='302stack_allocate.subx.html#L58'>Push-n-zero-bytes-esp</a></span> 4/imm32
<span id="L49" class="LineNr">49 </span> 81 0/subop/add *(ebp+4) 4/imm32
<span id="L50" class="LineNr">50 </span> (<a href='120allocate.subx.html#L836'>zero-out</a> *<span class="SpecialChar"><a href='302stack_allocate.subx.html#L58'>Push-n-zero-bytes-esp</a></span> *(ebp+4)) <span class="subxComment"># n+4</span>
<span id="L50" class="LineNr">50 </span> (<a href='120allocate.subx.html#L857'>zero-out</a> *<span class="SpecialChar"><a href='302stack_allocate.subx.html#L58'>Push-n-zero-bytes-esp</a></span> *(ebp+4)) <span class="subxComment"># n+4</span>
<span id="L51" class="LineNr">51 </span><span class="Constant">$push-n-zero-bytes:epilogue</span>:
<span id="L52" class="LineNr">52 </span> 8b/-&gt; *<span class="SpecialChar"><a href='302stack_allocate.subx.html#L56'>Push-n-zero-bytes-ebp</a></span> 5/r32/ebp <span class="subxComment"># restore spill</span>
<span id="L53" class="LineNr">53 </span> c3/return

View File

@ -70,7 +70,7 @@ if ('onhashchange' in window) {
<span id="L14" class="LineNr">14 </span> 8b/-&gt; *(ebp+0xc) 0/r32/eax
<span id="L15" class="LineNr">15 </span> f7 4/subop/multiply-into-edx-eax *(ebp+0x10)
<span id="L16" class="LineNr">16 </span> <span class="subxComment"># TODO: check edx for overflow</span>
<span id="L17" class="LineNr">17 </span> (<a href='120allocate.subx.html#L535'>allocate-array</a> *(ebp+8) %eax *(ebp+0x14))
<span id="L17" class="LineNr">17 </span> (<a href='120allocate.subx.html#L556'>allocate-array</a> *(ebp+8) %eax *(ebp+0x14))
<span id="L18" class="LineNr">18 </span><span class="Constant">$allocate-array2:end</span>:
<span id="L19" class="LineNr">19 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L20" class="LineNr">20 </span> 5a/pop-to-edx

404
html/309stream.subx.html generated
View File

@ -125,7 +125,7 @@ if ('onhashchange' in window) {
<span id="L69" class="LineNr"> 69 </span> 8b/-&gt; *(ebp+0x10) 1/r32/ecx
<span id="L70" class="LineNr"> 70 </span> 01/add-to %ecx 2/r32/edx
<span id="L71" class="LineNr"> 71 </span> 3b/compare 1/r32/ecx *(edi+8)
<span id="L72" class="LineNr"> 72 </span> 0f 8f/jump-if-&gt; $write-to-stream:<a href='501draw-text.mu.html#L481'>abort</a>/disp32
<span id="L72" class="LineNr"> 72 </span> 0f 8f/jump-if-&gt; $write-to-stream:<a href='317abort.subx.html#L5'>abort</a>/disp32
<span id="L73" class="LineNr"> 73 </span> <span class="subxComment"># var out/edx: (addr byte) = s-&gt;data + s-&gt;write</span>
<span id="L74" class="LineNr"> 74 </span> 8d/copy-address *(edi+edx+0xc) 2/r32/edx
<span id="L75" class="LineNr"> 75 </span> <span class="subxComment"># var outend/ebx: (addr byte) = out + n</span>
@ -153,210 +153,204 @@ if ('onhashchange' in window) {
<span id="L97" class="LineNr"> 97 </span> 5d/pop-to-ebp
<span id="L98" class="LineNr"> 98 </span> c3/return
<span id="L99" class="LineNr"> 99 </span>
<span id="L100" class="LineNr">100 </span><span class="Constant">$write-to-stream:<a href='501draw-text.mu.html#L481'>abort</a></span>:
<span id="L101" class="LineNr">101 </span> (<a href='501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">&quot;write-to-stream: stream full&quot;</span> 3 0) <span class="subxComment"># 3=cyan</span>
<span id="L102" class="LineNr">102 </span> {
<span id="L103" class="LineNr">103 </span> eb/jump <span class="Constant">loop</span>/disp8
<span id="L104" class="LineNr">104 </span> }
<span id="L105" class="LineNr">105 </span> <span class="subxComment"># never gets here</span>
<span id="L106" class="LineNr">106 </span>
<span id="L107" class="LineNr">107 </span><span class="subxFunction">read-from-stream</span>: <span class="subxComment"># s: (addr stream _), out: (addr byte), n: int</span>
<span id="L108" class="LineNr">108 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L109" class="LineNr">109 </span> 55/push-ebp
<span id="L110" class="LineNr">110 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L111" class="LineNr">111 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L112" class="LineNr">112 </span> 50/push-eax
<span id="L113" class="LineNr">113 </span> 51/push-ecx
<span id="L114" class="LineNr">114 </span> 52/push-edx
<span id="L115" class="LineNr">115 </span> 53/push-ebx
<span id="L116" class="LineNr">116 </span> 56/push-esi
<span id="L117" class="LineNr">117 </span> <span class="subxComment"># esi = s</span>
<span id="L118" class="LineNr">118 </span> 8b/-&gt; *(ebp+8) 6/r32/esi
<span id="L119" class="LineNr">119 </span> <span class="subxComment"># var sread/edx: int = s-&gt;read</span>
<span id="L120" class="LineNr">120 </span> 8b/-&gt; *(esi+4) 2/r32/edx
<span id="L121" class="LineNr">121 </span> <span class="subxComment"># if (sread + n &gt; s-&gt;write) abort</span>
<span id="L122" class="LineNr">122 </span> 8b/-&gt; *(ebp+0x10) 1/r32/ecx
<span id="L123" class="LineNr">123 </span> 01/add-to %ecx 2/r32/edx
<span id="L124" class="LineNr">124 </span> 3b/compare 1/r32/ecx *esi
<span id="L125" class="LineNr">125 </span> 0f 8f/jump-if-&gt; $read-from-stream:<a href='501draw-text.mu.html#L481'>abort</a>/disp32
<span id="L126" class="LineNr">126 </span> <span class="subxComment"># var in/edx: (addr byte) = s-&gt;data + s-&gt;read</span>
<span id="L127" class="LineNr">127 </span> 8d/copy-address *(esi+edx+0xc) 2/r32/edx
<span id="L128" class="LineNr">128 </span> <span class="subxComment"># var inend/ebx: (addr byte) = in + n</span>
<span id="L129" class="LineNr">129 </span> 8b/-&gt; *(ebp+0x10) 3/r32/ebx
<span id="L130" class="LineNr">130 </span> 8d/copy-address *(edx+ebx) 3/r32/ebx
<span id="L131" class="LineNr">131 </span> <span class="subxComment"># eax = out</span>
<span id="L132" class="LineNr">132 </span> 8b/-&gt; *(ebp+0xc) 0/r32/eax
<span id="L133" class="LineNr">133 </span> <span class="subxComment"># var outend/ecx: (addr byte) = out + n</span>
<span id="L134" class="LineNr">134 </span> 8b/-&gt; *(ebp+0x10) 1/r32/ecx
<span id="L135" class="LineNr">135 </span> 8d/copy-address *(eax+ecx) 1/r32/ecx
<span id="L136" class="LineNr">136 </span> <span class="subxComment">#</span>
<span id="L137" class="LineNr">137 </span> (<a href='108write.subx.html#L171'>_append-4</a> %eax %ecx %edx %ebx) <span class="subxComment"># =&gt; eax</span>
<span id="L138" class="LineNr">138 </span> <span class="subxComment"># s-&gt;read += n</span>
<span id="L139" class="LineNr">139 </span> 8b/-&gt; *(ebp+0x10) 1/r32/ecx
<span id="L140" class="LineNr">140 </span> 01/add-to *(esi+4) 1/r32/ecx
<span id="L141" class="LineNr">141 </span><span class="Constant">$read-from-stream:end</span>:
<span id="L142" class="LineNr">142 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L143" class="LineNr">143 </span> 5e/pop-to-esi
<span id="L144" class="LineNr">144 </span> 5b/pop-to-ebx
<span id="L145" class="LineNr">145 </span> 5a/pop-to-edx
<span id="L146" class="LineNr">146 </span> 59/pop-to-ecx
<span id="L147" class="LineNr">147 </span> 58/pop-to-eax
<span id="L148" class="LineNr">148 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L149" class="LineNr">149 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L150" class="LineNr">150 </span> 5d/pop-to-ebp
<span id="L151" class="LineNr">151 </span> c3/return
<span id="L152" class="LineNr">152 </span>
<span id="L153" class="LineNr">153 </span><span class="Constant">$read-from-stream:<a href='501draw-text.mu.html#L481'>abort</a></span>:
<span id="L154" class="LineNr">154 </span> (<a href='501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">&quot;read-from-stream: stream empty&quot;</span> 3 0) <span class="subxComment"># 3=cyan</span>
<span id="L155" class="LineNr">155 </span> {
<span id="L156" class="LineNr">156 </span> eb/jump <span class="Constant">loop</span>/disp8
<span id="L157" class="LineNr">157 </span> }
<span id="L158" class="LineNr">158 </span> <span class="subxComment"># never gets here</span>
<span id="L159" class="LineNr">159 </span>
<span id="L160" class="LineNr">160 </span><span class="subxFunction">stream-first</span>: <span class="subxComment"># s: (addr stream byte) -&gt; result/eax: byte</span>
<span id="L161" class="LineNr">161 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L162" class="LineNr">162 </span> 55/push-ebp
<span id="L163" class="LineNr">163 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L164" class="LineNr">164 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L165" class="LineNr">165 </span> 51/push-ecx
<span id="L166" class="LineNr">166 </span> 56/push-esi
<span id="L167" class="LineNr">167 </span> <span class="subxComment"># result = false</span>
<span id="L168" class="LineNr">168 </span> b8/copy-to-eax 0/imm32
<span id="L169" class="LineNr">169 </span> <span class="subxComment"># esi = s</span>
<span id="L170" class="LineNr">170 </span> 8b/-&gt; *(ebp+8) 6/r32/esi
<span id="L171" class="LineNr">171 </span> <span class="subxComment"># var idx/ecx: int = s-&gt;read</span>
<span id="L172" class="LineNr">172 </span> 8b/-&gt; *(esi+4) 1/r32/ecx
<span id="L173" class="LineNr">173 </span> <span class="subxComment"># if idx &gt;= s-&gt;write return 0</span>
<span id="L174" class="LineNr">174 </span> 3b/compare-with 1/r32/ecx *esi
<span id="L175" class="LineNr">175 </span> 7d/jump-if-&gt;= $stream-first:end/disp8
<span id="L176" class="LineNr">176 </span> <span class="subxComment"># result = s-&gt;data[idx]</span>
<span id="L177" class="LineNr">177 </span> 8a/byte-&gt; *(esi+ecx+0xc) 0/r32/AL
<span id="L178" class="LineNr">178 </span><span class="Constant">$stream-first:end</span>:
<span id="L179" class="LineNr">179 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L180" class="LineNr">180 </span> 5e/pop-to-esi
<span id="L181" class="LineNr">181 </span> 59/pop-to-ecx
<span id="L182" class="LineNr">182 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L183" class="LineNr">183 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L184" class="LineNr">184 </span> 5d/pop-to-ebp
<span id="L185" class="LineNr">185 </span> c3/return
<span id="L186" class="LineNr">186 </span>
<span id="L187" class="LineNr">187 </span><span class="subxFunction">stream-final</span>: <span class="subxComment"># s: (addr stream byte) -&gt; result/eax: byte</span>
<span id="L188" class="LineNr">188 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L189" class="LineNr">189 </span> 55/push-ebp
<span id="L190" class="LineNr">190 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L191" class="LineNr">191 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L192" class="LineNr">192 </span> 51/push-ecx
<span id="L193" class="LineNr">193 </span> 56/push-esi
<span id="L194" class="LineNr">194 </span> <span class="subxComment"># result = false</span>
<span id="L195" class="LineNr">195 </span> b8/copy-to-eax 0/imm32
<span id="L196" class="LineNr">196 </span> <span class="subxComment"># esi = s</span>
<span id="L197" class="LineNr">197 </span> 8b/-&gt; *(ebp+8) 6/r32/esi
<span id="L198" class="LineNr">198 </span> <span class="subxComment"># var max/ecx: int = s-&gt;write</span>
<span id="L199" class="LineNr">199 </span> 8b/-&gt; *esi 1/r32/ecx
<span id="L200" class="LineNr">200 </span> <span class="subxComment"># if s-&gt;read &gt;= max return 0</span>
<span id="L201" class="LineNr">201 </span> 39/compare-with *(esi+4) 1/r32/ecx
<span id="L202" class="LineNr">202 </span> 7d/jump-if-&gt;= $stream-final:end/disp8
<span id="L203" class="LineNr">203 </span> <span class="subxComment"># var idx/ecx: int = max - 1</span>
<span id="L204" class="LineNr">204 </span> 49/decrement-ecx
<span id="L205" class="LineNr">205 </span> <span class="subxComment"># result = s-&gt;data[idx]</span>
<span id="L206" class="LineNr">206 </span> 8a/byte-&gt; *(esi+ecx+0xc) 0/r32/AL
<span id="L207" class="LineNr">207 </span><span class="Constant">$stream-final:end</span>:
<span id="L208" class="LineNr">208 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L209" class="LineNr">209 </span> 5e/pop-to-esi
<span id="L210" class="LineNr">210 </span> 59/pop-to-ecx
<span id="L211" class="LineNr">211 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L212" class="LineNr">212 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L213" class="LineNr">213 </span> 5d/pop-to-ebp
<span id="L214" class="LineNr">214 </span> c3/return
<span id="L215" class="LineNr">215 </span>
<span id="L216" class="LineNr">216 </span><span class="subxComment"># compare all the data in two streams (ignoring the read pointer)</span>
<span id="L217" class="LineNr">217 </span><span class="subxFunction">streams-data-equal?</span>: <span class="subxComment"># f: (addr stream byte), s: (addr array byte) -&gt; result/eax: boolean</span>
<span id="L218" class="LineNr">218 </span> <span class="subxComment"># pseudocode:</span>
<span id="L219" class="LineNr">219 </span> <span class="subxComment"># awrite = a-&gt;write</span>
<span id="L220" class="LineNr">220 </span> <span class="subxComment"># if (awrite != b-&gt;write) return false</span>
<span id="L221" class="LineNr">221 </span> <span class="subxComment"># i = 0</span>
<span id="L222" class="LineNr">222 </span> <span class="subxComment"># curra = a-&gt;data</span>
<span id="L223" class="LineNr">223 </span> <span class="subxComment"># currb = b-&gt;data</span>
<span id="L224" class="LineNr">224 </span> <span class="subxComment"># while i &lt; awrite</span>
<span id="L225" class="LineNr">225 </span> <span class="subxComment"># i1 = *curra</span>
<span id="L226" class="LineNr">226 </span> <span class="subxComment"># i2 = *currb</span>
<span id="L227" class="LineNr">227 </span> <span class="subxComment"># if (c1 != c2) return false</span>
<span id="L228" class="LineNr">228 </span> <span class="subxComment"># i+=4, curra+=4, currb+=4</span>
<span id="L229" class="LineNr">229 </span> <span class="subxComment"># return true</span>
<span id="L230" class="LineNr">230 </span> <span class="subxComment">#</span>
<span id="L231" class="LineNr">231 </span> <span class="subxComment"># registers:</span>
<span id="L232" class="LineNr">232 </span> <span class="subxComment"># i: ecx</span>
<span id="L233" class="LineNr">233 </span> <span class="subxComment"># awrite: edx</span>
<span id="L234" class="LineNr">234 </span> <span class="subxComment"># curra: esi</span>
<span id="L235" class="LineNr">235 </span> <span class="subxComment"># currb: edi</span>
<span id="L236" class="LineNr">236 </span> <span class="subxComment"># i1: eax</span>
<span id="L237" class="LineNr">237 </span> <span class="subxComment"># i2: ebx</span>
<span id="L238" class="LineNr">238 </span> <span class="subxComment">#</span>
<span id="L239" class="LineNr">239 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L240" class="LineNr">240 </span> 55/push-ebp
<span id="L241" class="LineNr">241 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L242" class="LineNr">242 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L243" class="LineNr">243 </span> 51/push-ecx
<span id="L244" class="LineNr">244 </span> 52/push-edx
<span id="L245" class="LineNr">245 </span> 53/push-ebx
<span id="L246" class="LineNr">246 </span> 56/push-esi
<span id="L247" class="LineNr">247 </span> 57/push-edi
<span id="L248" class="LineNr">248 </span> <span class="subxComment"># esi = a</span>
<span id="L249" class="LineNr">249 </span> 8b/-&gt; *(ebp+8) 6/r32/esi
<span id="L250" class="LineNr">250 </span> <span class="subxComment"># edi = b</span>
<span id="L251" class="LineNr">251 </span> 8b/-&gt; *(ebp+0xc) 7/r32/edi
<span id="L252" class="LineNr">252 </span> <span class="subxComment"># var awrite/edx: int = a-&gt;write</span>
<span id="L253" class="LineNr">253 </span> 8b/-&gt; *esi 2/r32/edx
<span id="L254" class="LineNr">254 </span><span class="Constant">$streams-data-equal?:sizes</span>:
<span id="L255" class="LineNr">255 </span> <span class="subxComment"># if (awrite != b-&gt;write) return false</span>
<span id="L256" class="LineNr">256 </span> 39/compare *edi 2/r32/edx
<span id="L257" class="LineNr">257 </span> 75/jump-if-!= $streams-data-equal?:false/disp8
<span id="L258" class="LineNr">258 </span> <span class="subxComment"># var curra/esi: (addr byte) = a-&gt;data</span>
<span id="L259" class="LineNr">259 </span> 81 0/subop/add %esi 0xc/imm32
<span id="L260" class="LineNr">260 </span> <span class="subxComment"># var currb/edi: (addr byte) = b-&gt;data</span>
<span id="L261" class="LineNr">261 </span> 81 0/subop/add %edi 0xc/imm32
<span id="L262" class="LineNr">262 </span> <span class="subxComment"># var i/ecx: int = 0</span>
<span id="L263" class="LineNr">263 </span> 31/xor-with %ecx 1/r32/ecx
<span id="L264" class="LineNr">264 </span> <span class="subxComment"># var vala/eax: int</span>
<span id="L265" class="LineNr">265 </span> 31/xor-with %eax 0/r32/eax
<span id="L266" class="LineNr">266 </span> <span class="subxComment"># var valb/ebx: int</span>
<span id="L267" class="LineNr">267 </span> 31/xor-with %ebx 3/r32/ebx
<span id="L268" class="LineNr">268 </span><span class="Constant">$streams-data-equal?:loop</span>:
<span id="L269" class="LineNr">269 </span> {
<span id="L270" class="LineNr">270 </span> <span class="subxComment"># if (i &gt;= awrite) return true</span>
<span id="L271" class="LineNr">271 </span> 39/compare %ecx 2/r32/edx
<span id="L272" class="LineNr">272 </span> 7d/jump-if-&gt;= $streams-data-equal?:true/disp8
<span id="L273" class="LineNr">273 </span> <span class="subxComment"># var vala/eax: int = *curra</span>
<span id="L274" class="LineNr">274 </span> 8a/byte-&gt; *esi 0/r32/eax
<span id="L275" class="LineNr">275 </span> <span class="subxComment"># var valb/ebx: int = *currb</span>
<span id="L276" class="LineNr">276 </span> 8a/byte-&gt; *edi 3/r32/ebx
<span id="L277" class="LineNr">277 </span> <span class="subxComment"># if (vala != valb) return false</span>
<span id="L278" class="LineNr">278 </span> 39/compare %eax 3/r32/ebx
<span id="L279" class="LineNr">279 </span> 75/jump-if-!= $streams-data-equal?:false/disp8
<span id="L280" class="LineNr">280 </span> <span class="subxComment"># i++</span>
<span id="L281" class="LineNr">281 </span> 41/increment-ecx
<span id="L282" class="LineNr">282 </span> <span class="subxComment"># curra++</span>
<span id="L283" class="LineNr">283 </span> 46/increment-esi
<span id="L284" class="LineNr">284 </span> <span class="subxComment"># currb++</span>
<span id="L285" class="LineNr">285 </span> 47/increment-edi
<span id="L286" class="LineNr">286 </span> eb/jump <span class="Constant">loop</span>/disp8
<span id="L287" class="LineNr">287 </span> }
<span id="L288" class="LineNr">288 </span><span class="Constant">$streams-data-equal?:true</span>:
<span id="L289" class="LineNr">289 </span> b8/copy-to-eax 1/imm32
<span id="L290" class="LineNr">290 </span> eb/jump $streams-data-equal?:end/disp8
<span id="L291" class="LineNr">291 </span><span class="Constant">$streams-data-equal?:false</span>:
<span id="L292" class="LineNr">292 </span> b8/copy-to-eax 0/imm32
<span id="L293" class="LineNr">293 </span><span class="Constant">$streams-data-equal?:end</span>:
<span id="L294" class="LineNr">294 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L295" class="LineNr">295 </span> 5f/pop-to-edi
<span id="L296" class="LineNr">296 </span> 5e/pop-to-esi
<span id="L297" class="LineNr">297 </span> 5b/pop-to-ebx
<span id="L298" class="LineNr">298 </span> 5a/pop-to-edx
<span id="L299" class="LineNr">299 </span> 59/pop-to-ecx
<span id="L300" class="LineNr">300 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L301" class="LineNr">301 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L302" class="LineNr">302 </span> 5d/pop-to-ebp
<span id="L303" class="LineNr">303 </span> c3/return
<span id="L100" class="LineNr">100 </span><span class="Constant">$write-to-stream:<a href='317abort.subx.html#L5'>abort</a></span>:
<span id="L101" class="LineNr">101 </span> (<a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;write-to-stream: stream full&quot;</span>)
<span id="L102" class="LineNr">102 </span> <span class="subxComment"># never gets here</span>
<span id="L103" class="LineNr">103 </span>
<span id="L104" class="LineNr">104 </span><span class="subxFunction">read-from-stream</span>: <span class="subxComment"># s: (addr stream _), out: (addr byte), n: int</span>
<span id="L105" class="LineNr">105 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L106" class="LineNr">106 </span> 55/push-ebp
<span id="L107" class="LineNr">107 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L108" class="LineNr">108 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L109" class="LineNr">109 </span> 50/push-eax
<span id="L110" class="LineNr">110 </span> 51/push-ecx
<span id="L111" class="LineNr">111 </span> 52/push-edx
<span id="L112" class="LineNr">112 </span> 53/push-ebx
<span id="L113" class="LineNr">113 </span> 56/push-esi
<span id="L114" class="LineNr">114 </span> <span class="subxComment"># esi = s</span>
<span id="L115" class="LineNr">115 </span> 8b/-&gt; *(ebp+8) 6/r32/esi
<span id="L116" class="LineNr">116 </span> <span class="subxComment"># var sread/edx: int = s-&gt;read</span>
<span id="L117" class="LineNr">117 </span> 8b/-&gt; *(esi+4) 2/r32/edx
<span id="L118" class="LineNr">118 </span> <span class="subxComment"># if (sread + n &gt; s-&gt;write) abort</span>
<span id="L119" class="LineNr">119 </span> 8b/-&gt; *(ebp+0x10) 1/r32/ecx
<span id="L120" class="LineNr">120 </span> 01/add-to %ecx 2/r32/edx
<span id="L121" class="LineNr">121 </span> 3b/compare 1/r32/ecx *esi
<span id="L122" class="LineNr">122 </span> 0f 8f/jump-if-&gt; $read-from-stream:<a href='317abort.subx.html#L5'>abort</a>/disp32
<span id="L123" class="LineNr">123 </span> <span class="subxComment"># var in/edx: (addr byte) = s-&gt;data + s-&gt;read</span>
<span id="L124" class="LineNr">124 </span> 8d/copy-address *(esi+edx+0xc) 2/r32/edx
<span id="L125" class="LineNr">125 </span> <span class="subxComment"># var inend/ebx: (addr byte) = in + n</span>
<span id="L126" class="LineNr">126 </span> 8b/-&gt; *(ebp+0x10) 3/r32/ebx
<span id="L127" class="LineNr">127 </span> 8d/copy-address *(edx+ebx) 3/r32/ebx
<span id="L128" class="LineNr">128 </span> <span class="subxComment"># eax = out</span>
<span id="L129" class="LineNr">129 </span> 8b/-&gt; *(ebp+0xc) 0/r32/eax
<span id="L130" class="LineNr">130 </span> <span class="subxComment"># var outend/ecx: (addr byte) = out + n</span>
<span id="L131" class="LineNr">131 </span> 8b/-&gt; *(ebp+0x10) 1/r32/ecx
<span id="L132" class="LineNr">132 </span> 8d/copy-address *(eax+ecx) 1/r32/ecx
<span id="L133" class="LineNr">133 </span> <span class="subxComment">#</span>
<span id="L134" class="LineNr">134 </span> (<a href='108write.subx.html#L171'>_append-4</a> %eax %ecx %edx %ebx) <span class="subxComment"># =&gt; eax</span>
<span id="L135" class="LineNr">135 </span> <span class="subxComment"># s-&gt;read += n</span>
<span id="L136" class="LineNr">136 </span> 8b/-&gt; *(ebp+0x10) 1/r32/ecx
<span id="L137" class="LineNr">137 </span> 01/add-to *(esi+4) 1/r32/ecx
<span id="L138" class="LineNr">138 </span><span class="Constant">$read-from-stream:end</span>:
<span id="L139" class="LineNr">139 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L140" class="LineNr">140 </span> 5e/pop-to-esi
<span id="L141" class="LineNr">141 </span> 5b/pop-to-ebx
<span id="L142" class="LineNr">142 </span> 5a/pop-to-edx
<span id="L143" class="LineNr">143 </span> 59/pop-to-ecx
<span id="L144" class="LineNr">144 </span> 58/pop-to-eax
<span id="L145" class="LineNr">145 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L146" class="LineNr">146 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L147" class="LineNr">147 </span> 5d/pop-to-ebp
<span id="L148" class="LineNr">148 </span> c3/return
<span id="L149" class="LineNr">149 </span>
<span id="L150" class="LineNr">150 </span><span class="Constant">$read-from-stream:<a href='317abort.subx.html#L5'>abort</a></span>:
<span id="L151" class="LineNr">151 </span> (<a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;read-from-stream: stream empty&quot;</span>)
<span id="L152" class="LineNr">152 </span> <span class="subxComment"># never gets here</span>
<span id="L153" class="LineNr">153 </span>
<span id="L154" class="LineNr">154 </span><span class="subxFunction">stream-first</span>: <span class="subxComment"># s: (addr stream byte) -&gt; result/eax: byte</span>
<span id="L155" class="LineNr">155 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L156" class="LineNr">156 </span> 55/push-ebp
<span id="L157" class="LineNr">157 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L158" class="LineNr">158 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L159" class="LineNr">159 </span> 51/push-ecx
<span id="L160" class="LineNr">160 </span> 56/push-esi
<span id="L161" class="LineNr">161 </span> <span class="subxComment"># result = false</span>
<span id="L162" class="LineNr">162 </span> b8/copy-to-eax 0/imm32
<span id="L163" class="LineNr">163 </span> <span class="subxComment"># esi = s</span>
<span id="L164" class="LineNr">164 </span> 8b/-&gt; *(ebp+8) 6/r32/esi
<span id="L165" class="LineNr">165 </span> <span class="subxComment"># var idx/ecx: int = s-&gt;read</span>
<span id="L166" class="LineNr">166 </span> 8b/-&gt; *(esi+4) 1/r32/ecx
<span id="L167" class="LineNr">167 </span> <span class="subxComment"># if idx &gt;= s-&gt;write return 0</span>
<span id="L168" class="LineNr">168 </span> 3b/compare-with 1/r32/ecx *esi
<span id="L169" class="LineNr">169 </span> 7d/jump-if-&gt;= $stream-first:end/disp8
<span id="L170" class="LineNr">170 </span> <span class="subxComment"># result = s-&gt;data[idx]</span>
<span id="L171" class="LineNr">171 </span> 8a/byte-&gt; *(esi+ecx+0xc) 0/r32/AL
<span id="L172" class="LineNr">172 </span><span class="Constant">$stream-first:end</span>:
<span id="L173" class="LineNr">173 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L174" class="LineNr">174 </span> 5e/pop-to-esi
<span id="L175" class="LineNr">175 </span> 59/pop-to-ecx
<span id="L176" class="LineNr">176 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L177" class="LineNr">177 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L178" class="LineNr">178 </span> 5d/pop-to-ebp
<span id="L179" class="LineNr">179 </span> c3/return
<span id="L180" class="LineNr">180 </span>
<span id="L181" class="LineNr">181 </span><span class="subxFunction">stream-final</span>: <span class="subxComment"># s: (addr stream byte) -&gt; result/eax: byte</span>
<span id="L182" class="LineNr">182 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L183" class="LineNr">183 </span> 55/push-ebp
<span id="L184" class="LineNr">184 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L185" class="LineNr">185 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L186" class="LineNr">186 </span> 51/push-ecx
<span id="L187" class="LineNr">187 </span> 56/push-esi
<span id="L188" class="LineNr">188 </span> <span class="subxComment"># result = false</span>
<span id="L189" class="LineNr">189 </span> b8/copy-to-eax 0/imm32
<span id="L190" class="LineNr">190 </span> <span class="subxComment"># esi = s</span>
<span id="L191" class="LineNr">191 </span> 8b/-&gt; *(ebp+8) 6/r32/esi
<span id="L192" class="LineNr">192 </span> <span class="subxComment"># var max/ecx: int = s-&gt;write</span>
<span id="L193" class="LineNr">193 </span> 8b/-&gt; *esi 1/r32/ecx
<span id="L194" class="LineNr">194 </span> <span class="subxComment"># if s-&gt;read &gt;= max return 0</span>
<span id="L195" class="LineNr">195 </span> 39/compare-with *(esi+4) 1/r32/ecx
<span id="L196" class="LineNr">196 </span> 7d/jump-if-&gt;= $stream-final:end/disp8
<span id="L197" class="LineNr">197 </span> <span class="subxComment"># var idx/ecx: int = max - 1</span>
<span id="L198" class="LineNr">198 </span> 49/decrement-ecx
<span id="L199" class="LineNr">199 </span> <span class="subxComment"># result = s-&gt;data[idx]</span>
<span id="L200" class="LineNr">200 </span> 8a/byte-&gt; *(esi+ecx+0xc) 0/r32/AL
<span id="L201" class="LineNr">201 </span><span class="Constant">$stream-final:end</span>:
<span id="L202" class="LineNr">202 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L203" class="LineNr">203 </span> 5e/pop-to-esi
<span id="L204" class="LineNr">204 </span> 59/pop-to-ecx
<span id="L205" class="LineNr">205 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L206" class="LineNr">206 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L207" class="LineNr">207 </span> 5d/pop-to-ebp
<span id="L208" class="LineNr">208 </span> c3/return
<span id="L209" class="LineNr">209 </span>
<span id="L210" class="LineNr">210 </span><span class="subxComment"># compare all the data in two streams (ignoring the read pointer)</span>
<span id="L211" class="LineNr">211 </span><span class="subxFunction">streams-data-equal?</span>: <span class="subxComment"># f: (addr stream byte), s: (addr array byte) -&gt; result/eax: boolean</span>
<span id="L212" class="LineNr">212 </span> <span class="subxComment"># pseudocode:</span>
<span id="L213" class="LineNr">213 </span> <span class="subxComment"># awrite = a-&gt;write</span>
<span id="L214" class="LineNr">214 </span> <span class="subxComment"># if (awrite != b-&gt;write) return false</span>
<span id="L215" class="LineNr">215 </span> <span class="subxComment"># i = 0</span>
<span id="L216" class="LineNr">216 </span> <span class="subxComment"># curra = a-&gt;data</span>
<span id="L217" class="LineNr">217 </span> <span class="subxComment"># currb = b-&gt;data</span>
<span id="L218" class="LineNr">218 </span> <span class="subxComment"># while i &lt; awrite</span>
<span id="L219" class="LineNr">219 </span> <span class="subxComment"># i1 = *curra</span>
<span id="L220" class="LineNr">220 </span> <span class="subxComment"># i2 = *currb</span>
<span id="L221" class="LineNr">221 </span> <span class="subxComment"># if (c1 != c2) return false</span>
<span id="L222" class="LineNr">222 </span> <span class="subxComment"># i+=4, curra+=4, currb+=4</span>
<span id="L223" class="LineNr">223 </span> <span class="subxComment"># return true</span>
<span id="L224" class="LineNr">224 </span> <span class="subxComment">#</span>
<span id="L225" class="LineNr">225 </span> <span class="subxComment"># registers:</span>
<span id="L226" class="LineNr">226 </span> <span class="subxComment"># i: ecx</span>
<span id="L227" class="LineNr">227 </span> <span class="subxComment"># awrite: edx</span>
<span id="L228" class="LineNr">228 </span> <span class="subxComment"># curra: esi</span>
<span id="L229" class="LineNr">229 </span> <span class="subxComment"># currb: edi</span>
<span id="L230" class="LineNr">230 </span> <span class="subxComment"># i1: eax</span>
<span id="L231" class="LineNr">231 </span> <span class="subxComment"># i2: ebx</span>
<span id="L232" class="LineNr">232 </span> <span class="subxComment">#</span>
<span id="L233" class="LineNr">233 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L234" class="LineNr">234 </span> 55/push-ebp
<span id="L235" class="LineNr">235 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L236" class="LineNr">236 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L237" class="LineNr">237 </span> 51/push-ecx
<span id="L238" class="LineNr">238 </span> 52/push-edx
<span id="L239" class="LineNr">239 </span> 53/push-ebx
<span id="L240" class="LineNr">240 </span> 56/push-esi
<span id="L241" class="LineNr">241 </span> 57/push-edi
<span id="L242" class="LineNr">242 </span> <span class="subxComment"># esi = a</span>
<span id="L243" class="LineNr">243 </span> 8b/-&gt; *(ebp+8) 6/r32/esi
<span id="L244" class="LineNr">244 </span> <span class="subxComment"># edi = b</span>
<span id="L245" class="LineNr">245 </span> 8b/-&gt; *(ebp+0xc) 7/r32/edi
<span id="L246" class="LineNr">246 </span> <span class="subxComment"># var awrite/edx: int = a-&gt;write</span>
<span id="L247" class="LineNr">247 </span> 8b/-&gt; *esi 2/r32/edx
<span id="L248" class="LineNr">248 </span><span class="Constant">$streams-data-equal?:sizes</span>:
<span id="L249" class="LineNr">249 </span> <span class="subxComment"># if (awrite != b-&gt;write) return false</span>
<span id="L250" class="LineNr">250 </span> 39/compare *edi 2/r32/edx
<span id="L251" class="LineNr">251 </span> 75/jump-if-!= $streams-data-equal?:false/disp8
<span id="L252" class="LineNr">252 </span> <span class="subxComment"># var curra/esi: (addr byte) = a-&gt;data</span>
<span id="L253" class="LineNr">253 </span> 81 0/subop/add %esi 0xc/imm32
<span id="L254" class="LineNr">254 </span> <span class="subxComment"># var currb/edi: (addr byte) = b-&gt;data</span>
<span id="L255" class="LineNr">255 </span> 81 0/subop/add %edi 0xc/imm32
<span id="L256" class="LineNr">256 </span> <span class="subxComment"># var i/ecx: int = 0</span>
<span id="L257" class="LineNr">257 </span> 31/xor-with %ecx 1/r32/ecx
<span id="L258" class="LineNr">258 </span> <span class="subxComment"># var vala/eax: int</span>
<span id="L259" class="LineNr">259 </span> 31/xor-with %eax 0/r32/eax
<span id="L260" class="LineNr">260 </span> <span class="subxComment"># var valb/ebx: int</span>
<span id="L261" class="LineNr">261 </span> 31/xor-with %ebx 3/r32/ebx
<span id="L262" class="LineNr">262 </span><span class="Constant">$streams-data-equal?:loop</span>:
<span id="L263" class="LineNr">263 </span> {
<span id="L264" class="LineNr">264 </span> <span class="subxComment"># if (i &gt;= awrite) return true</span>
<span id="L265" class="LineNr">265 </span> 39/compare %ecx 2/r32/edx
<span id="L266" class="LineNr">266 </span> 7d/jump-if-&gt;= $streams-data-equal?:true/disp8
<span id="L267" class="LineNr">267 </span> <span class="subxComment"># var vala/eax: int = *curra</span>
<span id="L268" class="LineNr">268 </span> 8a/byte-&gt; *esi 0/r32/eax
<span id="L269" class="LineNr">269 </span> <span class="subxComment"># var valb/ebx: int = *currb</span>
<span id="L270" class="LineNr">270 </span> 8a/byte-&gt; *edi 3/r32/ebx
<span id="L271" class="LineNr">271 </span> <span class="subxComment"># if (vala != valb) return false</span>
<span id="L272" class="LineNr">272 </span> 39/compare %eax 3/r32/ebx
<span id="L273" class="LineNr">273 </span> 75/jump-if-!= $streams-data-equal?:false/disp8
<span id="L274" class="LineNr">274 </span> <span class="subxComment"># i++</span>
<span id="L275" class="LineNr">275 </span> 41/increment-ecx
<span id="L276" class="LineNr">276 </span> <span class="subxComment"># curra++</span>
<span id="L277" class="LineNr">277 </span> 46/increment-esi
<span id="L278" class="LineNr">278 </span> <span class="subxComment"># currb++</span>
<span id="L279" class="LineNr">279 </span> 47/increment-edi
<span id="L280" class="LineNr">280 </span> eb/jump <span class="Constant">loop</span>/disp8
<span id="L281" class="LineNr">281 </span> }
<span id="L282" class="LineNr">282 </span><span class="Constant">$streams-data-equal?:true</span>:
<span id="L283" class="LineNr">283 </span> b8/copy-to-eax 1/imm32
<span id="L284" class="LineNr">284 </span> eb/jump $streams-data-equal?:end/disp8
<span id="L285" class="LineNr">285 </span><span class="Constant">$streams-data-equal?:false</span>:
<span id="L286" class="LineNr">286 </span> b8/copy-to-eax 0/imm32
<span id="L287" class="LineNr">287 </span><span class="Constant">$streams-data-equal?:end</span>:
<span id="L288" class="LineNr">288 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L289" class="LineNr">289 </span> 5f/pop-to-edi
<span id="L290" class="LineNr">290 </span> 5e/pop-to-esi
<span id="L291" class="LineNr">291 </span> 5b/pop-to-ebx
<span id="L292" class="LineNr">292 </span> 5a/pop-to-edx
<span id="L293" class="LineNr">293 </span> 59/pop-to-ecx
<span id="L294" class="LineNr">294 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L295" class="LineNr">295 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L296" class="LineNr">296 </span> 5d/pop-to-ebp
<span id="L297" class="LineNr">297 </span> c3/return
</pre>
</body>
</html>

View File

@ -130,13 +130,13 @@ if ('onhashchange' in window) {
<span id="L72" class="LineNr"> 72 </span> 8b/-&gt; *esi 1/r32/ecx
<span id="L73" class="LineNr"> 73 </span> 2b/subtract *(esi+4) 1/r32/ecx
<span id="L74" class="LineNr"> 74 </span> <span class="subxComment"># allocate</span>
<span id="L75" class="LineNr"> 75 </span> (<a href='120allocate.subx.html#L535'>allocate-array</a> <span class="SpecialChar"><a href='120allocate.subx.html#L27'>Heap</a></span> %ecx *(ebp+0xc))
<span id="L75" class="LineNr"> 75 </span> (<a href='120allocate.subx.html#L556'>allocate-array</a> <span class="SpecialChar"><a href='120allocate.subx.html#L27'>Heap</a></span> %ecx *(ebp+0xc))
<span id="L76" class="LineNr"> 76 </span> <span class="subxComment"># var in/edx: (addr byte) = s-&gt;data + s-&gt;read</span>
<span id="L77" class="LineNr"> 77 </span> 8b/-&gt; *(esi+4) 2/r32/edx
<span id="L78" class="LineNr"> 78 </span> 8d/copy-address *(esi+edx+0xc) 2/r32/edx
<span id="L79" class="LineNr"> 79 </span> <span class="subxComment"># var dest/eax: (addr byte) = data for out</span>
<span id="L80" class="LineNr"> 80 </span> 8b/-&gt; *(ebp+0xc) 0/r32/eax
<span id="L81" class="LineNr"> 81 </span> (<a href='120allocate.subx.html#L226'>lookup</a> *eax *(eax+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L81" class="LineNr"> 81 </span> (<a href='120allocate.subx.html#L223'>lookup</a> *eax *(eax+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L82" class="LineNr"> 82 </span> 8d/copy-address *(eax+4) 0/r32/eax
<span id="L83" class="LineNr"> 83 </span> <span class="subxComment">#</span>
<span id="L84" class="LineNr"> 84 </span> (<a href='310copy-bytes.subx.html#L6'>copy-bytes</a> %edx %eax %ecx)
@ -156,17 +156,17 @@ if ('onhashchange' in window) {
<span id="L98" class="LineNr"> 98 </span> 55/push-ebp
<span id="L99" class="LineNr"> 99 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L100" class="LineNr">100 </span> <span class="subxComment"># setup</span>
<span id="L101" class="LineNr">101 </span> (<a href='106stream.subx.html#L20'>clear-stream</a> <a href='112read-byte.subx.html#L50'>_test-input-stream</a>)
<span id="L102" class="LineNr">102 </span> (<a href='108write.subx.html#L11'>write</a> <a href='112read-byte.subx.html#L50'>_test-input-stream</a> <span class="Constant">&quot;abc&quot;</span>)
<span id="L101" class="LineNr">101 </span> (<a href='106stream.subx.html#L20'>clear-stream</a> <a href='112read-byte.subx.html#L47'>_test-input-stream</a>)
<span id="L102" class="LineNr">102 </span> (<a href='108write.subx.html#L11'>write</a> <a href='112read-byte.subx.html#L47'>_test-input-stream</a> <span class="Constant">&quot;abc&quot;</span>)
<span id="L103" class="LineNr">103 </span> <span class="subxComment"># skip something</span>
<span id="L104" class="LineNr">104 </span> (<a href='112read-byte.subx.html#L13'>read-byte</a> <a href='112read-byte.subx.html#L50'>_test-input-stream</a>) <span class="subxComment"># =&gt; eax</span>
<span id="L104" class="LineNr">104 </span> (<a href='112read-byte.subx.html#L13'>read-byte</a> <a href='112read-byte.subx.html#L47'>_test-input-stream</a>) <span class="subxComment"># =&gt; eax</span>
<span id="L105" class="LineNr">105 </span> <span class="subxComment"># var out/ecx: (handle array byte)</span>
<span id="L106" class="LineNr">106 </span> 68/push 0/imm32
<span id="L107" class="LineNr">107 </span> 68/push 0/imm32
<span id="L108" class="LineNr">108 </span> 89/&lt;- %ecx 4/r32/esp
<span id="L109" class="LineNr">109 </span> <span class="subxComment">#</span>
<span id="L110" class="LineNr">110 </span> (<a href='310copy-bytes.subx.html#L60'>stream-to-array</a> <a href='112read-byte.subx.html#L50'>_test-input-stream</a> %ecx)
<span id="L111" class="LineNr">111 </span> (<a href='120allocate.subx.html#L226'>lookup</a> *ecx *(ecx+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L110" class="LineNr">110 </span> (<a href='310copy-bytes.subx.html#L60'>stream-to-array</a> <a href='112read-byte.subx.html#L47'>_test-input-stream</a> %ecx)
<span id="L111" class="LineNr">111 </span> (<a href='120allocate.subx.html#L223'>lookup</a> *ecx *(ecx+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L112" class="LineNr">112 </span> (<a href='105string-equal.subx.html#L213'>check-strings-equal</a> %eax <span class="Constant">&quot;bc&quot;</span>)
<span id="L113" class="LineNr">113 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L114" class="LineNr">114 </span> 89/&lt;- %esp 5/r32/ebp
@ -193,13 +193,13 @@ if ('onhashchange' in window) {
<span id="L135" class="LineNr">135 </span> 7c/jump-if-&lt; $unquote-stream-to-array:end/disp8
<span id="L136" class="LineNr">136 </span> 81 5/subop/subtract %ecx 2/imm32
<span id="L137" class="LineNr">137 </span> <span class="subxComment"># allocate</span>
<span id="L138" class="LineNr">138 </span> (<a href='120allocate.subx.html#L535'>allocate-array</a> <span class="SpecialChar"><a href='120allocate.subx.html#L27'>Heap</a></span> %ecx *(ebp+0xc))
<span id="L138" class="LineNr">138 </span> (<a href='120allocate.subx.html#L556'>allocate-array</a> <span class="SpecialChar"><a href='120allocate.subx.html#L27'>Heap</a></span> %ecx *(ebp+0xc))
<span id="L139" class="LineNr">139 </span> <span class="subxComment"># var in/edx: (addr byte) = s-&gt;data + s-&gt;read + 1</span>
<span id="L140" class="LineNr">140 </span> 8b/-&gt; *(esi+4) 2/r32/edx
<span id="L141" class="LineNr">141 </span> 8d/copy-address *(esi+edx+0xd) 2/r32/edx <span class="subxComment"># Stream-data + 1</span>
<span id="L142" class="LineNr">142 </span> <span class="subxComment"># var dest/eax: (addr byte) = data for out</span>
<span id="L143" class="LineNr">143 </span> 8b/-&gt; *(ebp+0xc) 0/r32/eax
<span id="L144" class="LineNr">144 </span> (<a href='120allocate.subx.html#L226'>lookup</a> *eax *(eax+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L144" class="LineNr">144 </span> (<a href='120allocate.subx.html#L223'>lookup</a> *eax *(eax+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L145" class="LineNr">145 </span> 8d/copy-address *(eax+4) 0/r32/eax
<span id="L146" class="LineNr">146 </span> <span class="subxComment">#</span>
<span id="L147" class="LineNr">147 </span> (<a href='310copy-bytes.subx.html#L6'>copy-bytes</a> %edx %eax %ecx)

View File

@ -126,7 +126,7 @@ if ('onhashchange' in window) {
<span id="L66" class="LineNr"> 66 </span> 4a/decrement-edx
<span id="L67" class="LineNr"> 67 </span> <span class="subxComment"># if it's a newline, break</span>
<span id="L68" class="LineNr"> 68 </span> 8a/byte-&gt; *edx 0/r32/eax
<span id="L69" class="LineNr"> 69 </span> 81 4/subop/and %eax 0xff/imm32
<span id="L69" class="LineNr"> 69 </span> 25/and-eax-with 0xff/imm32
<span id="L70" class="LineNr"> 70 </span> 3d/compare-eax-and 0xa/imm32/newline
<span id="L71" class="LineNr"> 71 </span> 74/jump-if-= <span class="Constant">break</span>/disp8
<span id="L72" class="LineNr"> 72 </span> <span class="subxComment"># not a newline, so restore it</span>
@ -187,7 +187,7 @@ if ('onhashchange' in window) {
<span id="L127" class="LineNr">127 </span> <span class="subxComment"># if !decimal-digit?(*curr) return 0</span>
<span id="L128" class="LineNr">128 </span> 8a/copy-byte *esi 1/r32/CL
<span id="L129" class="LineNr">129 </span> 50/push-eax
<span id="L130" class="LineNr">130 </span> (<a href='126write-int-decimal.subx.html#L299'>decimal-digit?</a> %ecx) <span class="subxComment"># =&gt; eax</span>
<span id="L130" class="LineNr">130 </span> (<a href='126write-int-decimal.subx.html#L296'>decimal-digit?</a> %ecx) <span class="subxComment"># =&gt; eax</span>
<span id="L131" class="LineNr">131 </span> {
<span id="L132" class="LineNr">132 </span> 3d/compare-eax-and 0/imm32/false
<span id="L133" class="LineNr">133 </span> 75/jump-if-!= <span class="Constant">break</span>/disp8
@ -548,7 +548,7 @@ if ('onhashchange' in window) {
<span id="L488" class="LineNr">488 </span> 81 0/subop/add %ebx 4/imm32
<span id="L489" class="LineNr">489 </span> eb/jump $_parse-array-of-decimal-ints:loop1/disp8
<span id="L490" class="LineNr">490 </span><span class="Constant">$_parse-array-of-decimal-ints:break1</span>:
<span id="L491" class="LineNr">491 </span> (<a href='120allocate.subx.html#L535'>allocate-array</a> *(ebp+8) %ebx *(ebp+0x10))
<span id="L491" class="LineNr">491 </span> (<a href='120allocate.subx.html#L556'>allocate-array</a> *(ebp+8) %ebx *(ebp+0x10))
<span id="L492" class="LineNr">492 </span><span class="Constant">$_parse-array-of-decimal-ints:pass2</span>:
<span id="L493" class="LineNr">493 </span> <span class="subxComment"># var slice/edi: slice = {s-&gt;data, 0}</span>
<span id="L494" class="LineNr">494 </span> 68/push 0/imm32/end
@ -557,7 +557,7 @@ if ('onhashchange' in window) {
<span id="L497" class="LineNr">497 </span> 89/&lt;- %edi 4/r32/esp
<span id="L498" class="LineNr">498 </span> <span class="subxComment"># curr = lookup(out)-&gt;data</span>
<span id="L499" class="LineNr">499 </span> 8b/-&gt; *(ebp+0x10) 0/r32/eax
<span id="L500" class="LineNr">500 </span> (<a href='120allocate.subx.html#L226'>lookup</a> *eax *(eax+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L500" class="LineNr">500 </span> (<a href='120allocate.subx.html#L223'>lookup</a> *eax *(eax+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L501" class="LineNr">501 </span> 8d/copy-address *(eax+4) 1/r32/ecx
<span id="L502" class="LineNr">502 </span><span class="Constant">$_parse-array-of-decimal-ints:loop2</span>:
<span id="L503" class="LineNr">503 </span> <span class="subxComment"># if (slice-&gt;start &gt;= end) break</span>
@ -612,7 +612,7 @@ if ('onhashchange' in window) {
<span id="L552" class="LineNr">552 </span> 89/&lt;- %ecx 4/r32/esp
<span id="L553" class="LineNr">553 </span> <span class="subxComment">#</span>
<span id="L554" class="LineNr">554 </span> (<a href='311decimal-int.subx.html#L429'>_parse-array-of-decimal-ints</a> <span class="SpecialChar"><a href='120allocate.subx.html#L27'>Heap</a></span> <span class="Constant">&quot;1 2 3&quot;</span> %esi)
<span id="L555" class="LineNr">555 </span> (<a href='120allocate.subx.html#L226'>lookup</a> *esi *(esi+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L555" class="LineNr">555 </span> (<a href='120allocate.subx.html#L223'>lookup</a> *esi *(esi+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L556" class="LineNr">556 </span> (<a href='301array-equal.subx.html#L5'>array-equal?</a> %ecx %eax) <span class="subxComment"># =&gt; eax</span>
<span id="L557" class="LineNr">557 </span> (<a href='502test.mu.html#L2'>check-ints-equal</a> %eax 1 <span class="Constant">&quot;F - test-parse-array-of-decimal-ints&quot;</span>)
<span id="L558" class="LineNr">558 </span> <span class="subxS1Comment"># . epilogue</span>
@ -631,7 +631,7 @@ if ('onhashchange' in window) {
<span id="L571" class="LineNr">571 </span> 89/&lt;- %esi 4/r32/esp
<span id="L572" class="LineNr">572 </span> <span class="subxComment">#</span>
<span id="L573" class="LineNr">573 </span> (<a href='311decimal-int.subx.html#L429'>_parse-array-of-decimal-ints</a> <span class="SpecialChar"><a href='120allocate.subx.html#L27'>Heap</a></span> <span class="Constant">&quot;&quot;</span> %esi)
<span id="L574" class="LineNr">574 </span> (<a href='120allocate.subx.html#L226'>lookup</a> *esi *(esi+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L574" class="LineNr">574 </span> (<a href='120allocate.subx.html#L223'>lookup</a> *esi *(esi+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L575" class="LineNr">575 </span> (<a href='502test.mu.html#L2'>check-ints-equal</a> *eax 0 <span class="Constant">&quot;F - test-parse-array-of-decimal-ints-empty&quot;</span>)
<span id="L576" class="LineNr">576 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L577" class="LineNr">577 </span> 89/&lt;- %esp 5/r32/ebp
@ -649,7 +649,7 @@ if ('onhashchange' in window) {
<span id="L589" class="LineNr">589 </span> 89/&lt;- %esi 4/r32/esp
<span id="L590" class="LineNr">590 </span> <span class="subxComment">#</span>
<span id="L591" class="LineNr">591 </span> (<a href='311decimal-int.subx.html#L429'>_parse-array-of-decimal-ints</a> <span class="SpecialChar"><a href='120allocate.subx.html#L27'>Heap</a></span> <span class="SpecialChar"><a href='301array-equal.subx.html#L428'>Space</a></span> %esi)
<span id="L592" class="LineNr">592 </span> (<a href='120allocate.subx.html#L226'>lookup</a> *esi *(esi+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L592" class="LineNr">592 </span> (<a href='120allocate.subx.html#L223'>lookup</a> *esi *(esi+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L593" class="LineNr">593 </span> (<a href='502test.mu.html#L2'>check-ints-equal</a> *eax 0 <span class="Constant">&quot;F - test-parse-array-of-decimal-ints-just-whitespace&quot;</span>)
<span id="L594" class="LineNr">594 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L595" class="LineNr">595 </span> 89/&lt;- %esp 5/r32/ebp
@ -672,7 +672,7 @@ if ('onhashchange' in window) {
<span id="L612" class="LineNr">612 </span> 89/&lt;- %ecx 4/r32/esp
<span id="L613" class="LineNr">613 </span> <span class="subxComment">#</span>
<span id="L614" class="LineNr">614 </span> (<a href='311decimal-int.subx.html#L429'>_parse-array-of-decimal-ints</a> <span class="SpecialChar"><a href='120allocate.subx.html#L27'>Heap</a></span> <span class="Constant">&quot; 1 2 3 &quot;</span> %esi)
<span id="L615" class="LineNr">615 </span> (<a href='120allocate.subx.html#L226'>lookup</a> *esi *(esi+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L615" class="LineNr">615 </span> (<a href='120allocate.subx.html#L223'>lookup</a> *esi *(esi+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L616" class="LineNr">616 </span> (<a href='301array-equal.subx.html#L5'>array-equal?</a> %ecx %eax) <span class="subxComment"># =&gt; eax</span>
<span id="L617" class="LineNr">617 </span> (<a href='502test.mu.html#L2'>check-ints-equal</a> %eax 1 <span class="Constant">&quot;F - test-parse-array-of-decimal-ints-extra-whitespace&quot;</span>)
<span id="L618" class="LineNr">618 </span> <span class="subxS1Comment"># . epilogue</span>

View File

@ -62,7 +62,7 @@ if ('onhashchange' in window) {
<span id="L5" class="LineNr"> 5 </span> 55/push-ebp
<span id="L6" class="LineNr"> 6 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L7" class="LineNr"> 7 </span> <span class="subxComment">#</span>
<span id="L8" class="LineNr"> 8 </span> (<a href='120allocate.subx.html#L669'>copy-array</a> <span class="SpecialChar"><a href='120allocate.subx.html#L27'>Heap</a></span> *(ebp+8) *(ebp+0xc))
<span id="L8" class="LineNr"> 8 </span> (<a href='120allocate.subx.html#L690'>copy-array</a> <span class="SpecialChar"><a href='120allocate.subx.html#L27'>Heap</a></span> *(ebp+8) *(ebp+0xc))
<span id="L9" class="LineNr"> 9 </span><span class="Constant">$copy-array-object:end</span>:
<span id="L10" class="LineNr">10 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L11" class="LineNr">11 </span> 89/&lt;- %esp 5/r32/ebp

View File

@ -89,30 +89,32 @@ if ('onhashchange' in window) {
<span id="L33" class="LineNr">33 </span> (<a href='501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">&quot; is too large for array '&quot;</span> 3 0) <span class="subxComment"># 3=cyan</span>
<span id="L34" class="LineNr">34 </span> (<a href='501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *(ebp+0x18) 3 0) <span class="subxComment"># 3=cyan</span>
<span id="L35" class="LineNr">35 </span> (<a href='501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">&quot;'&quot;</span> 3 0) <span class="subxComment"># 3=cyan</span>
<span id="L36" class="LineNr">36 </span> {
<span id="L37" class="LineNr">37 </span> eb/jump <span class="Constant">loop</span>/disp8
<span id="L38" class="LineNr">38 </span> }
<span id="L39" class="LineNr">39 </span> <span class="subxComment"># never gets here</span>
<span id="L40" class="LineNr">40 </span><span class="Constant">$__check-mu-array-bounds:end</span>:
<span id="L41" class="LineNr">41 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L42" class="LineNr">42 </span> 5a/pop-to-edx
<span id="L43" class="LineNr">43 </span> 59/pop-to-ecx
<span id="L44" class="LineNr">44 </span> 58/pop-to-eax
<span id="L45" class="LineNr">45 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L46" class="LineNr">46 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L47" class="LineNr">47 </span> 5d/pop-to-ebp
<span id="L48" class="LineNr">48 </span> c3/return
<span id="L49" class="LineNr">49 </span>
<span id="L50" class="LineNr">50 </span><span class="subxMinorFunction">__check-mu-array-bounds:overflow</span>:
<span id="L51" class="LineNr">51 </span> (<a href='501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">&quot;fn &quot;</span> 3 0) <span class="subxComment"># 3=cyan</span>
<span id="L52" class="LineNr">52 </span> (<a href='501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *(ebp+0x14) 3 0) <span class="subxComment"># 3=cyan</span>
<span id="L53" class="LineNr">53 </span> (<a href='501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">&quot;: offset to array '&quot;</span> 3 0) <span class="subxComment"># 3=cyan</span>
<span id="L54" class="LineNr">54 </span> (<a href='501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *(ebp+0x18) 3 0) <span class="subxComment"># 3=cyan</span>
<span id="L55" class="LineNr">55 </span> (<a href='501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">&quot;' overflowed 32 bits&quot;</span> 3 0) <span class="subxComment"># 3=cyan</span>
<span id="L56" class="LineNr">56 </span> {
<span id="L57" class="LineNr">57 </span> eb/jump <span class="Constant">loop</span>/disp8
<span id="L58" class="LineNr">58 </span> }
<span id="L59" class="LineNr">59 </span> <span class="subxComment"># never gets here</span>
<span id="L36" class="LineNr">36 </span> (<a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;&quot;</span>)
<span id="L37" class="LineNr">37 </span> <span class="subxComment"># never gets here</span>
<span id="L38" class="LineNr">38 </span><span class="Constant">$__check-mu-array-bounds:end</span>:
<span id="L39" class="LineNr">39 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L40" class="LineNr">40 </span> 5a/pop-to-edx
<span id="L41" class="LineNr">41 </span> 59/pop-to-ecx
<span id="L42" class="LineNr">42 </span> 58/pop-to-eax
<span id="L43" class="LineNr">43 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L44" class="LineNr">44 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L45" class="LineNr">45 </span> 5d/pop-to-ebp
<span id="L46" class="LineNr">46 </span> c3/return
<span id="L47" class="LineNr">47 </span>
<span id="L48" class="LineNr">48 </span><span class="subxMinorFunction">__check-mu-array-bounds:overflow</span>:
<span id="L49" class="LineNr">49 </span> (<a href='501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">&quot;fn &quot;</span> 3 0) <span class="subxComment"># 3=cyan</span>
<span id="L50" class="LineNr">50 </span> (<a href='501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *(ebp+0x14) 3 0) <span class="subxComment"># 3=cyan</span>
<span id="L51" class="LineNr">51 </span> (<a href='501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">&quot;: offset to array '&quot;</span> 3 0) <span class="subxComment"># 3=cyan</span>
<span id="L52" class="LineNr">52 </span> (<a href='501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *(ebp+0x18) 3 0) <span class="subxComment"># 3=cyan</span>
<span id="L53" class="LineNr">53 </span> (<a href='501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">&quot;' overflowed 32 bits&quot;</span> 3 0) <span class="subxComment"># 3=cyan</span>
<span id="L54" class="LineNr">54 </span> (<a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;&quot;</span>)
<span id="L55" class="LineNr">55 </span> <span class="subxComment"># never gets here</span>
<span id="L56" class="LineNr">56 </span>
<span id="L57" class="LineNr">57 </span><span class="subxMinorFunction">__mu-abort-null-index-base-address</span>:
<span id="L58" class="LineNr">58 </span> (<a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;null address in 'index'&quot;</span>)
<span id="L59" class="LineNr">59 </span>
<span id="L60" class="LineNr">60 </span><span class="subxMinorFunction">__mu-abort-null-get-base-address</span>:
<span id="L61" class="LineNr">61 </span> (<a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;null address in 'get'&quot;</span>)
</pre>
</body>
</html>

View File

@ -68,10 +68,10 @@ if ('onhashchange' in window) {
<span id="L10" class="LineNr"> 10 </span> 50/push-eax
<span id="L11" class="LineNr"> 11 </span> <span class="subxComment">#</span>
<span id="L12" class="LineNr"> 12 </span> 89/&lt;- %eax 4/r32/esp
<span id="L13" class="LineNr"> 13 </span> 81 7/subop/compare %eax 0x01000000/imm32
<span id="L13" class="LineNr"> 13 </span> 3d/compare-eax-and 0x01000000/imm32
<span id="L14" class="LineNr"> 14 </span> {
<span id="L15" class="LineNr"> 15 </span> 7f/jump-if-&gt; <span class="Constant">break</span>/disp8
<span id="L16" class="LineNr"> 16 </span> (<a href='501draw-text.mu.html#L481'>abort</a> <span class="Constant">&quot;stack overflow&quot;</span>)
<span id="L16" class="LineNr"> 16 </span> (<a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;stack overflow&quot;</span>)
<span id="L17" class="LineNr"> 17 </span> }
<span id="L18" class="LineNr"> 18 </span><span class="Constant">$check-stack:end</span>:
<span id="L19" class="LineNr"> 19 </span> <span class="subxS1Comment"># . restore registers</span>
@ -98,7 +98,7 @@ if ('onhashchange' in window) {
<span id="L40" class="LineNr"> 40 </span> (<a href='501draw-text.mu.html#L312'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 %edx 0xf 0xc)
<span id="L41" class="LineNr"> 41 </span> <span class="subxComment"># restore cursor position</span>
<span id="L42" class="LineNr"> 42 </span> (<a href='500fake-screen.mu.html#L169'>set-cursor-position</a> %eax %ecx)
<span id="L43" class="LineNr"> 43 </span><span class="Constant">$check-stack:end</span>:
<span id="L43" class="LineNr"> 43 </span><span class="Constant">$show-stack-state:end</span>:
<span id="L44" class="LineNr"> 44 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L45" class="LineNr"> 45 </span> 5a/pop-to-edx
<span id="L46" class="LineNr"> 46 </span> 59/pop-to-ecx

View File

@ -75,7 +75,7 @@ if ('onhashchange' in window) {
<span id="L17" class="LineNr"> 17 </span> 81 7/subop/compare %esi 0x100/imm32
<span id="L18" class="LineNr"> 18 </span> {
<span id="L19" class="LineNr"> 19 </span> 7c/jump-if-&lt; <span class="Constant">break</span>/disp8
<span id="L20" class="LineNr"> 20 </span> (<a href='501draw-text.mu.html#L481'>abort</a> <span class="Constant">&quot;invalid color&quot;</span>)
<span id="L20" class="LineNr"> 20 </span> (<a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;invalid color&quot;</span>)
<span id="L21" class="LineNr"> 21 </span> }
<span id="L22" class="LineNr"> 22 </span> <span class="subxComment"># var color/esi: int = Colors-rgb[color]</span>
<span id="L23" class="LineNr"> 23 </span> b8/copy-to-eax <span class="SpecialChar"><a href='316colors.subx.html#L71'>Colors-rgb</a></span>/imm32

394
html/317abort.subx.html generated Normal file
View File

@ -0,0 +1,394 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Mu - 317abort.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="colorscheme" content="minimal-dark">
<style type="text/css">
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #a8a8a8; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #a8a8a8; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.SpecialChar { color: #d70000; }
.subxComment { color: #005faf; }
.subxS1Comment { color: #0000af; }
.LineNr { }
.subxH1Comment { color: #005faf; text-decoration: underline; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.Constant { color: #008787; }
-->
</style>
<script type='text/javascript'>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
function JumpToLine()
{
var lineNum;
lineNum = window.location.hash;
lineNum = lineNum.substr(1); /* strip off '#' */
if (lineNum.indexOf('L') == -1) {
lineNum = 'L'+lineNum;
}
var lineElem = document.getElementById(lineNum);
/* Always jump to new location even if the line was hidden inside a fold, or
* we corrected the raw number to a line ID.
*/
if (lineElem) {
lineElem.scrollIntoView(true);
}
return true;
}
if ('onhashchange' in window) {
window.onhashchange = JumpToLine;
}
-->
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/main/317abort.subx'>https://github.com/akkartik/mu/blob/main/317abort.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># Dump a stack trace when you abort.</span>
<span id="L2" class="LineNr"> 2 </span>
<span id="L3" class="LineNr"> 3 </span>== code
<span id="L4" class="LineNr"> 4 </span>
<span id="L5" class="LineNr"> 5 </span><span class="subxFunction">abort</span>: <span class="subxComment"># e: (addr array byte)</span>
<span id="L6" class="LineNr"> 6 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L7" class="LineNr"> 7 </span> 55/push-ebp
<span id="L8" class="LineNr"> 8 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L9" class="LineNr"> 9 </span> <span class="subxComment">#</span>
<span id="L10" class="LineNr"> 10 </span> (<a href='103grapheme.subx.html#L109'>set-cursor-position-on-real-screen</a> 0 0)
<span id="L11" class="LineNr"> 11 </span> (<a href='501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *(ebp+8) 0xf 0xc) <span class="subxComment"># 0/real-screen, 0xf/fg=white, 0xc/bg=red</span>
<span id="L12" class="LineNr"> 12 </span> (<a href='317abort.subx.html#L21'>dump-call-stack</a>)
<span id="L13" class="LineNr"> 13 </span> <span class="subxComment"># crash</span>
<span id="L14" class="LineNr"> 14 </span> {
<span id="L15" class="LineNr"> 15 </span> eb/jump <span class="Constant">loop</span>/disp8
<span id="L16" class="LineNr"> 16 </span> }
<span id="L17" class="LineNr"> 17 </span>
<span id="L18" class="LineNr"> 18 </span><span class="subxComment"># Helpers below this point are not intended to be reused; they assume the</span>
<span id="L19" class="LineNr"> 19 </span><span class="subxComment"># program will soon crash. In particular, they destroy the heap.</span>
<span id="L20" class="LineNr"> 20 </span>
<span id="L21" class="LineNr"> 21 </span><span class="subxFunction">dump-call-stack</span>:
<span id="L22" class="LineNr"> 22 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L23" class="LineNr"> 23 </span> 55/push-ebp
<span id="L24" class="LineNr"> 24 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L25" class="LineNr"> 25 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L26" class="LineNr"> 26 </span> 50/push-eax
<span id="L27" class="LineNr"> 27 </span> 51/push-ecx
<span id="L28" class="LineNr"> 28 </span> 52/push-edx
<span id="L29" class="LineNr"> 29 </span> 53/push-ebx
<span id="L30" class="LineNr"> 30 </span> <span class="subxComment"># var labels/edx: (addr stream {start-address, label-slice} 0x4000)</span>
<span id="L31" class="LineNr"> 31 </span> <span class="subxComment"># start addresses are in ascending order</span>
<span id="L32" class="LineNr"> 32 </span> 81 5/subop/subtract %esp 0x30000/imm32 <span class="subxComment"># 0x4000 labels * 12 bytes per label</span>
<span id="L33" class="LineNr"> 33 </span> 68/push 0x30000/imm32
<span id="L34" class="LineNr"> 34 </span> 68/push 0/imm32/read
<span id="L35" class="LineNr"> 35 </span> 68/push 0/imm32/write
<span id="L36" class="LineNr"> 36 </span> 89/&lt;- %edx 4/r32/esp
<span id="L37" class="LineNr"> 37 </span> <span class="subxComment">#</span>
<span id="L38" class="LineNr"> 38 </span> (<a href='317abort.subx.html#L69'>load-debug-symbols</a> %edx) <span class="subxComment"># destroys the heap</span>
<span id="L39" class="LineNr"> 39 </span> <span class="subxComment"># traverse the linked list of ebp pointers: <a href="https://wiki.osdev.org/Stack_Trace">https://wiki.osdev.org/Stack_Trace</a></span>
<span id="L40" class="LineNr"> 40 </span> 8b/-&gt; *ebp 3/r32/ebx
<span id="L41" class="LineNr"> 41 </span> {
<span id="L42" class="LineNr"> 42 </span> <span class="subxComment"># loop termination check</span>
<span id="L43" class="LineNr"> 43 </span> 81 7/subop/compare %ebx 0/imm32
<span id="L44" class="LineNr"> 44 </span> 0f 84/jump-if-= <span class="Constant">break</span>/disp32
<span id="L45" class="LineNr"> 45 </span> <span class="subxComment"># loop body</span>
<span id="L46" class="LineNr"> 46 </span> (<a href='501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">&quot;\n&quot;</span> 0 0xc)
<span id="L47" class="LineNr"> 47 </span> (<a href='501draw-text.mu.html#L312'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *(ebx+4) 0xf 0xc)
<span id="L48" class="LineNr"> 48 </span> (<a href='501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">&quot; &quot;</span> 0 0xc)
<span id="L49" class="LineNr"> 49 </span> (<a href='317abort.subx.html#L236'>containing-function</a> %edx *(ebx+4)) <span class="subxComment"># =&gt; eax, ecx</span>
<span id="L50" class="LineNr"> 50 </span> (<a href='317abort.subx.html#L297'>draw-slice-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 %eax %ecx 0 0xc)
<span id="L51" class="LineNr"> 51 </span> <span class="subxComment"># loop update</span>
<span id="L52" class="LineNr"> 52 </span> 8b/-&gt; *ebx 3/r32/ebx
<span id="L53" class="LineNr"> 53 </span> <span class="subxComment">#</span>
<span id="L54" class="LineNr"> 54 </span> e9/jump <span class="Constant">loop</span>/disp32
<span id="L55" class="LineNr"> 55 </span> }
<span id="L56" class="LineNr"> 56 </span><span class="Constant">$dump-call-stack:end</span>:
<span id="L57" class="LineNr"> 57 </span> <span class="subxS1Comment"># . reclaim locals</span>
<span id="L58" class="LineNr"> 58 </span> 81 0/subop/add %esp 0x100c/imm32
<span id="L59" class="LineNr"> 59 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L60" class="LineNr"> 60 </span> 5b/pop-to-ebx
<span id="L61" class="LineNr"> 61 </span> 5a/pop-to-edx
<span id="L62" class="LineNr"> 62 </span> 59/pop-to-ecx
<span id="L63" class="LineNr"> 63 </span> 58/pop-to-eax
<span id="L64" class="LineNr"> 64 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L65" class="LineNr"> 65 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L66" class="LineNr"> 66 </span> 5d/pop-to-ebp
<span id="L67" class="LineNr"> 67 </span> c3/return
<span id="L68" class="LineNr"> 68 </span>
<span id="L69" class="LineNr"> 69 </span><span class="subxFunction">load-debug-symbols</span>: <span class="subxComment"># labels: (addr stream {start-address, label-slice})</span>
<span id="L70" class="LineNr"> 70 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L71" class="LineNr"> 71 </span> 55/push-ebp
<span id="L72" class="LineNr"> 72 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L73" class="LineNr"> 73 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L74" class="LineNr"> 74 </span> 50/push-eax
<span id="L75" class="LineNr"> 75 </span> 51/push-ecx
<span id="L76" class="LineNr"> 76 </span> 52/push-edx
<span id="L77" class="LineNr"> 77 </span> 53/push-ebx
<span id="L78" class="LineNr"> 78 </span> <span class="subxComment"># create space for a stream on the heap, clobbering any existing data</span>
<span id="L79" class="LineNr"> 79 </span> <span class="subxComment"># var s/ecx: (addr stream byte)</span>
<span id="L80" class="LineNr"> 80 </span> b9/copy-to-ecx 0x03000000/imm32
<span id="L81" class="LineNr"> 81 </span> c7 0/subop/copy *ecx 0/imm32 <span class="subxComment"># write index</span>
<span id="L82" class="LineNr"> 82 </span> c7 0/subop/copy *(ecx+4) 0/imm32 <span class="subxComment"># read index</span>
<span id="L83" class="LineNr"> 83 </span> c7 0/subop/copy *(ecx+8) 0x01000000/imm32 <span class="subxComment"># stream capacity = 16MB</span>
<span id="L84" class="LineNr"> 84 </span> <span class="subxComment"># load 0x400 sectors starting from sector 10080 = 0x2760</span>
<span id="L85" class="LineNr"> 85 </span> (<a href='boot.subx.html#L946'>load-sectors</a> <span class="SpecialChar"><a href='boot.subx.html#L894'>Primary-bus-primary-drive</a></span> 0x2760 0x100 %ecx)
<span id="L86" class="LineNr"> 86 </span> (<a href='boot.subx.html#L946'>load-sectors</a> <span class="SpecialChar"><a href='boot.subx.html#L894'>Primary-bus-primary-drive</a></span> 0x2860 0x100 %ecx)
<span id="L87" class="LineNr"> 87 </span> (<a href='boot.subx.html#L946'>load-sectors</a> <span class="SpecialChar"><a href='boot.subx.html#L894'>Primary-bus-primary-drive</a></span> 0x2960 0x100 %ecx)
<span id="L88" class="LineNr"> 88 </span> (<a href='boot.subx.html#L946'>load-sectors</a> <span class="SpecialChar"><a href='boot.subx.html#L894'>Primary-bus-primary-drive</a></span> 0x2a60 0x100 %ecx)
<span id="L89" class="LineNr"> 89 </span> <span class="subxH1Comment"># - parse pointers to portions of this stream into labels</span>
<span id="L90" class="LineNr"> 90 </span> <span class="subxComment"># var curr/ecx: (addr byte) = s-&gt;data</span>
<span id="L91" class="LineNr"> 91 </span> 81 0/subop/add %ecx 0xc/imm32
<span id="L92" class="LineNr"> 92 </span> {
<span id="L93" class="LineNr"> 93 </span> <span class="subxComment"># loop termination check</span>
<span id="L94" class="LineNr"> 94 </span> b8/copy-to-eax 0/imm32
<span id="L95" class="LineNr"> 95 </span> 8a/byte-&gt; *ecx 0/r32/eax
<span id="L96" class="LineNr"> 96 </span> 3d/compare-eax-and 0/imm32
<span id="L97" class="LineNr"> 97 </span> 0f 84/jump-if-= <span class="Constant">break</span>/disp32
<span id="L98" class="LineNr"> 98 </span> <span class="subxComment"># loop body</span>
<span id="L99" class="LineNr"> 99 </span> (<a href='317abort.subx.html#L121'>skip-to-next-space</a> %ecx) <span class="subxComment"># =&gt; edx</span>
<span id="L100" class="LineNr">100 </span> 42/increment-edx
<span id="L101" class="LineNr">101 </span> (<a href='317abort.subx.html#L162'>skip-to-next-newline</a> %edx) <span class="subxComment"># =&gt; ebx</span>
<span id="L102" class="LineNr">102 </span> (<a href='118parse-hex-int.subx.html#L417'>parse-hex-int-helper</a> %edx %ebx) <span class="subxComment"># =&gt; eax</span>
<span id="L103" class="LineNr">103 </span> 43/increment-ebx
<span id="L104" class="LineNr">104 </span> (<a href='317abort.subx.html#L203'>label-append</a> *(ebp+8) %eax %ecx %edx)
<span id="L105" class="LineNr">105 </span> <span class="subxComment"># loop update</span>
<span id="L106" class="LineNr">106 </span> 89/&lt;- %ecx 3/r32/ebx
<span id="L107" class="LineNr">107 </span> <span class="subxComment">#</span>
<span id="L108" class="LineNr">108 </span> e9/jump <span class="Constant">loop</span>/disp32
<span id="L109" class="LineNr">109 </span> }
<span id="L110" class="LineNr">110 </span><span class="Constant">$load-debug-symbols:end</span>:
<span id="L111" class="LineNr">111 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L112" class="LineNr">112 </span> 5b/pop-to-ebx
<span id="L113" class="LineNr">113 </span> 5a/pop-to-edx
<span id="L114" class="LineNr">114 </span> 59/pop-to-ecx
<span id="L115" class="LineNr">115 </span> 58/pop-to-eax
<span id="L116" class="LineNr">116 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L117" class="LineNr">117 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L118" class="LineNr">118 </span> 5d/pop-to-ebp
<span id="L119" class="LineNr">119 </span> c3/return
<span id="L120" class="LineNr">120 </span>
<span id="L121" class="LineNr">121 </span><span class="subxFunction">skip-to-next-space</span>: <span class="subxComment"># curr: (addr byte) -&gt; _/edx: (addr byte)</span>
<span id="L122" class="LineNr">122 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L123" class="LineNr">123 </span> 55/push-ebp
<span id="L124" class="LineNr">124 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L125" class="LineNr">125 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L126" class="LineNr">126 </span> 50/push-eax
<span id="L127" class="LineNr">127 </span> <span class="subxComment"># eax = 0</span>
<span id="L128" class="LineNr">128 </span> b8/copy-to-eax 0/imm32
<span id="L129" class="LineNr">129 </span> <span class="subxComment">#</span>
<span id="L130" class="LineNr">130 </span> 8b/-&gt; *(ebp+8) 2/r32/edx
<span id="L131" class="LineNr">131 </span> {
<span id="L132" class="LineNr">132 </span> 8a/byte-&gt; *edx 0/r32/eax
<span id="L133" class="LineNr">133 </span> 3d/compare-eax-and 0x20/imm32/space
<span id="L134" class="LineNr">134 </span> 0f 84/jump-if-= <span class="Constant">break</span>/disp32
<span id="L135" class="LineNr">135 </span> 3d/compare-eax-and 0/imm32
<span id="L136" class="LineNr">136 </span> {
<span id="L137" class="LineNr">137 </span> 75/jump-if-!= <span class="Constant">break</span>/disp8
<span id="L138" class="LineNr">138 </span> (<a href='501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">&quot;done loading&quot;</span> 7 0)
<span id="L139" class="LineNr">139 </span> {
<span id="L140" class="LineNr">140 </span> eb/jump <span class="Constant">loop</span>/disp8
<span id="L141" class="LineNr">141 </span> }
<span id="L142" class="LineNr">142 </span> }
<span id="L143" class="LineNr">143 </span> 3d/compare-eax-and 0xa/imm32/newline
<span id="L144" class="LineNr">144 </span> {
<span id="L145" class="LineNr">145 </span> 75/jump-if-!= <span class="Constant">break</span>/disp8
<span id="L146" class="LineNr">146 </span> (<a href='501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">&quot;unexpected newline&quot;</span> 7 0)
<span id="L147" class="LineNr">147 </span> {
<span id="L148" class="LineNr">148 </span> eb/jump <span class="Constant">loop</span>/disp8
<span id="L149" class="LineNr">149 </span> }
<span id="L150" class="LineNr">150 </span> }
<span id="L151" class="LineNr">151 </span> 42/increment-edx
<span id="L152" class="LineNr">152 </span> e9/jump <span class="Constant">loop</span>/disp32
<span id="L153" class="LineNr">153 </span> }
<span id="L154" class="LineNr">154 </span><span class="Constant">$skip-to-next-space:end</span>:
<span id="L155" class="LineNr">155 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L156" class="LineNr">156 </span> 58/pop-to-eax
<span id="L157" class="LineNr">157 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L158" class="LineNr">158 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L159" class="LineNr">159 </span> 5d/pop-to-ebp
<span id="L160" class="LineNr">160 </span> c3/return
<span id="L161" class="LineNr">161 </span>
<span id="L162" class="LineNr">162 </span><span class="subxFunction">skip-to-next-newline</span>: <span class="subxComment"># curr: (addr byte) -&gt; _/ebx: (addr byte)</span>
<span id="L163" class="LineNr">163 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L164" class="LineNr">164 </span> 55/push-ebp
<span id="L165" class="LineNr">165 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L166" class="LineNr">166 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L167" class="LineNr">167 </span> 50/push-eax
<span id="L168" class="LineNr">168 </span> <span class="subxComment"># eax = 0</span>
<span id="L169" class="LineNr">169 </span> b8/copy-to-eax 0/imm32
<span id="L170" class="LineNr">170 </span> <span class="subxComment">#</span>
<span id="L171" class="LineNr">171 </span> 8b/-&gt; *(ebp+8) 3/r32/ebx
<span id="L172" class="LineNr">172 </span> {
<span id="L173" class="LineNr">173 </span> 8a/byte-&gt; *ebx 0/r32/eax
<span id="L174" class="LineNr">174 </span> 3d/compare-eax-and 0xa/imm32/newline
<span id="L175" class="LineNr">175 </span> 0f 84/jump-if-= <span class="Constant">break</span>/disp32
<span id="L176" class="LineNr">176 </span> 3d/compare-eax-and 0/imm32
<span id="L177" class="LineNr">177 </span> {
<span id="L178" class="LineNr">178 </span> 75/jump-if-!= <span class="Constant">break</span>/disp8
<span id="L179" class="LineNr">179 </span> (<a href='501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">&quot;done loading&quot;</span> 7 0)
<span id="L180" class="LineNr">180 </span> {
<span id="L181" class="LineNr">181 </span> eb/jump <span class="Constant">loop</span>/disp8
<span id="L182" class="LineNr">182 </span> }
<span id="L183" class="LineNr">183 </span> }
<span id="L184" class="LineNr">184 </span> 3d/compare-eax-and 0x20/imm32/space
<span id="L185" class="LineNr">185 </span> {
<span id="L186" class="LineNr">186 </span> 75/jump-if-!= <span class="Constant">break</span>/disp8
<span id="L187" class="LineNr">187 </span> (<a href='501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">&quot;unexpected space&quot;</span> 7 0)
<span id="L188" class="LineNr">188 </span> {
<span id="L189" class="LineNr">189 </span> eb/jump <span class="Constant">loop</span>/disp8
<span id="L190" class="LineNr">190 </span> }
<span id="L191" class="LineNr">191 </span> }
<span id="L192" class="LineNr">192 </span> 43/increment-ebx
<span id="L193" class="LineNr">193 </span> e9/jump <span class="Constant">loop</span>/disp32
<span id="L194" class="LineNr">194 </span> }
<span id="L195" class="LineNr">195 </span><span class="Constant">$skip-to-next-newline:end</span>:
<span id="L196" class="LineNr">196 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L197" class="LineNr">197 </span> 58/pop-to-eax
<span id="L198" class="LineNr">198 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L199" class="LineNr">199 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L200" class="LineNr">200 </span> 5d/pop-to-ebp
<span id="L201" class="LineNr">201 </span> c3/return
<span id="L202" class="LineNr">202 </span>
<span id="L203" class="LineNr">203 </span><span class="subxFunction">label-append</span>: <span class="subxComment"># labels: (addr stream {start-address, label-slice}), address: int, start: int, end: int</span>
<span id="L204" class="LineNr">204 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L205" class="LineNr">205 </span> 55/push-ebp
<span id="L206" class="LineNr">206 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L207" class="LineNr">207 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L208" class="LineNr">208 </span> 50/push-eax
<span id="L209" class="LineNr">209 </span> 51/push-ecx
<span id="L210" class="LineNr">210 </span> 56/push-esi
<span id="L211" class="LineNr">211 </span> <span class="subxComment"># esi = labels</span>
<span id="L212" class="LineNr">212 </span> 8b/-&gt; *(ebp+8) 6/r32/esi
<span id="L213" class="LineNr">213 </span> <span class="subxComment"># ecx = labels-&gt;write</span>
<span id="L214" class="LineNr">214 </span> 8b/-&gt; *esi 1/r32/ecx
<span id="L215" class="LineNr">215 </span> <span class="subxComment"># labels-&gt;data[labels-&gt;write] = address</span>
<span id="L216" class="LineNr">216 </span> 8b/-&gt; *(ebp+0xc) 0/r32/eax
<span id="L217" class="LineNr">217 </span> 89/&lt;- *(esi+ecx+0xc) 0/r32/eax
<span id="L218" class="LineNr">218 </span> <span class="subxComment"># labels-&gt;data[labels-&gt;write+4] = start</span>
<span id="L219" class="LineNr">219 </span> 8b/-&gt; *(ebp+0x10) 0/r32/eax
<span id="L220" class="LineNr">220 </span> 89/&lt;- *(esi+ecx+0x10) 0/r32/eax
<span id="L221" class="LineNr">221 </span> <span class="subxComment"># labels-&gt;data[labels-&gt;write+8] = end</span>
<span id="L222" class="LineNr">222 </span> 8b/-&gt; *(ebp+0x14) 0/r32/eax
<span id="L223" class="LineNr">223 </span> 89/&lt;- *(esi+ecx+0x14) 0/r32/eax
<span id="L224" class="LineNr">224 </span> <span class="subxComment"># labels-&gt;write += 12</span>
<span id="L225" class="LineNr">225 </span> 81 0/subop/add *esi 0xc/imm32
<span id="L226" class="LineNr">226 </span><span class="Constant">$label-append:end</span>:
<span id="L227" class="LineNr">227 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L228" class="LineNr">228 </span> 5e/pop-to-esi
<span id="L229" class="LineNr">229 </span> 59/pop-to-ecx
<span id="L230" class="LineNr">230 </span> 58/pop-to-eax
<span id="L231" class="LineNr">231 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L232" class="LineNr">232 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L233" class="LineNr">233 </span> 5d/pop-to-ebp
<span id="L234" class="LineNr">234 </span> c3/return
<span id="L235" class="LineNr">235 </span>
<span id="L236" class="LineNr">236 </span><span class="subxFunction">containing-function</span>: <span class="subxComment"># labels: (addr stream {start-address, label-slice}), address: int -&gt; start/eax: (addr byte), end/ecx: (addr byte)</span>
<span id="L237" class="LineNr">237 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L238" class="LineNr">238 </span> 55/push-ebp
<span id="L239" class="LineNr">239 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L240" class="LineNr">240 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L241" class="LineNr">241 </span> 52/push-edx
<span id="L242" class="LineNr">242 </span> 53/push-ebx
<span id="L243" class="LineNr">243 </span> 56/push-esi
<span id="L244" class="LineNr">244 </span> <span class="subxComment"># esi = labels</span>
<span id="L245" class="LineNr">245 </span> 8b/-&gt; *(ebp+8) 6/r32/esi
<span id="L246" class="LineNr">246 </span> <span class="subxComment"># var curr/ecx: (addr byte) = labels-&gt;data</span>
<span id="L247" class="LineNr">247 </span> 8d/copy-address *(esi+0xc) 1/r32/ecx
<span id="L248" class="LineNr">248 </span> <span class="subxComment"># var max/edx: (addr byte) = labels-&gt;data + labels-&gt;write</span>
<span id="L249" class="LineNr">249 </span> 8b/-&gt; *esi 2/r32/edx
<span id="L250" class="LineNr">250 </span> 01/add-to %edx 1/r32/ecx
<span id="L251" class="LineNr">251 </span> <span class="subxComment"># var previous-function-name/ebx: (addr slice) = 0</span>
<span id="L252" class="LineNr">252 </span> bb/copy-to-ebx 0/imm32
<span id="L253" class="LineNr">253 </span> {
<span id="L254" class="LineNr">254 </span> <span class="subxComment"># abort if not found</span>
<span id="L255" class="LineNr">255 </span> 39/compare %ecx 2/r32/edx
<span id="L256" class="LineNr">256 </span> {
<span id="L257" class="LineNr">257 </span> 0f 82/jump-if-addr&lt; <span class="Constant">break</span>/disp32
<span id="L258" class="LineNr">258 </span> (<a href='501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">&quot;failed to find function for address &quot;</span> 7 0)
<span id="L259" class="LineNr">259 </span> (<a href='501draw-text.mu.html#L312'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *(ebp+0xc) 7 0)
<span id="L260" class="LineNr">260 </span> {
<span id="L261" class="LineNr">261 </span> eb/jump <span class="Constant">loop</span>/disp8
<span id="L262" class="LineNr">262 </span> }
<span id="L263" class="LineNr">263 </span> }
<span id="L264" class="LineNr">264 </span> <span class="subxComment"># if *curr &gt; address, break</span>
<span id="L265" class="LineNr">265 </span> 8b/-&gt; *ecx 0/r32/eax
<span id="L266" class="LineNr">266 </span> 3b/compare 0/r32/eax *(ebp+0xc)
<span id="L267" class="LineNr">267 </span> 0f 87/jump-if-addr&gt; <span class="Constant">break</span>/disp32
<span id="L268" class="LineNr">268 </span> <span class="subxComment"># if **(curr+4) not '$' or '@', save curr to previous-function-name</span>
<span id="L269" class="LineNr">269 </span> {
<span id="L270" class="LineNr">270 </span> 8b/-&gt; *(ecx+4) 0/r32/eax
<span id="L271" class="LineNr">271 </span> 8a/byte-&gt; *eax 0/r32/eax
<span id="L272" class="LineNr">272 </span> 25/and-with-eax 0xff/imm32
<span id="L273" class="LineNr">273 </span> 3d/compare-eax-and 0x24/imm32/$
<span id="L274" class="LineNr">274 </span> 74/jump-if-= <span class="Constant">break</span>/disp8
<span id="L275" class="LineNr">275 </span> 3d/compare-eax-and 0x40/imm32/@
<span id="L276" class="LineNr">276 </span> 74/jump-if-= <span class="Constant">break</span>/disp8
<span id="L277" class="LineNr">277 </span> 8d/copy-address *(ecx+4) 3/r32/ebx
<span id="L278" class="LineNr">278 </span> }
<span id="L279" class="LineNr">279 </span> <span class="subxComment"># loop update</span>
<span id="L280" class="LineNr">280 </span> 81 0/subop/add %ecx 0xc/imm32
<span id="L281" class="LineNr">281 </span> <span class="subxComment">#</span>
<span id="L282" class="LineNr">282 </span> e9/jump <span class="Constant">loop</span>/disp32
<span id="L283" class="LineNr">283 </span> }
<span id="L284" class="LineNr">284 </span> 8b/-&gt; *ebx 0/r32/eax
<span id="L285" class="LineNr">285 </span> 8b/-&gt; *(ebx+4) 1/r32/ecx
<span id="L286" class="LineNr">286 </span><span class="Constant">$containing-function:end</span>:
<span id="L287" class="LineNr">287 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L288" class="LineNr">288 </span> 5e/pop-to-esi
<span id="L289" class="LineNr">289 </span> 5b/pop-to-ebx
<span id="L290" class="LineNr">290 </span> 5a/pop-to-edx
<span id="L291" class="LineNr">291 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L292" class="LineNr">292 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L293" class="LineNr">293 </span> 5d/pop-to-ebp
<span id="L294" class="LineNr">294 </span> c3/return
<span id="L295" class="LineNr">295 </span>
<span id="L296" class="LineNr">296 </span><span class="subxComment"># unlike variants in .mu files, this only supports ASCII</span>
<span id="L297" class="LineNr">297 </span><span class="subxFunction">draw-slice-wrapping-right-then-down-from-cursor-over-full-screen</span>: <span class="subxComment"># screen: (addr screen), start: (addr byte), end: (addr byte), color: int, background-color: int</span>
<span id="L298" class="LineNr">298 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L299" class="LineNr">299 </span> 55/push-ebp
<span id="L300" class="LineNr">300 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L301" class="LineNr">301 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L302" class="LineNr">302 </span> 50/push-eax
<span id="L303" class="LineNr">303 </span> 51/push-ecx
<span id="L304" class="LineNr">304 </span> 52/push-edx
<span id="L305" class="LineNr">305 </span> <span class="subxComment"># var curr/ecx: (addr byte) = start</span>
<span id="L306" class="LineNr">306 </span> 8b/-&gt; *(ebp+0xc) 1/r32/ecx
<span id="L307" class="LineNr">307 </span> <span class="subxComment"># edx = end</span>
<span id="L308" class="LineNr">308 </span> 8b/-&gt; *(ebp+0x10) 2/r32/edx
<span id="L309" class="LineNr">309 </span> <span class="subxComment"># eax = 0</span>
<span id="L310" class="LineNr">310 </span> b8/copy-to-eax 0/imm32
<span id="L311" class="LineNr">311 </span> {
<span id="L312" class="LineNr">312 </span> <span class="subxComment"># if (curr &gt;= end) break</span>
<span id="L313" class="LineNr">313 </span> 39/compare %ecx 2/r32/edx
<span id="L314" class="LineNr">314 </span> 73/jump-if-addr&gt;= <span class="Constant">break</span>/disp8
<span id="L315" class="LineNr">315 </span> <span class="subxComment"># print *curr</span>
<span id="L316" class="LineNr">316 </span> 8a/byte-&gt; *ecx 0/r32/eax
<span id="L317" class="LineNr">317 </span> (<a href='501draw-text.mu.html#L84'>draw-grapheme-at-cursor</a> *(ebp+8) %eax *(ebp+0x14) *(ebp+0x18))
<span id="L318" class="LineNr">318 </span> (<a href='501draw-text.mu.html#L221'>move-cursor-rightward-and-downward</a> *(ebp+8))
<span id="L319" class="LineNr">319 </span> <span class="subxComment">#</span>
<span id="L320" class="LineNr">320 </span> 41/increment-ecx
<span id="L321" class="LineNr">321 </span> <span class="subxComment">#</span>
<span id="L322" class="LineNr">322 </span> eb/jump <span class="Constant">loop</span>/disp8
<span id="L323" class="LineNr">323 </span> }
<span id="L324" class="LineNr">324 </span><span class="Constant">$draw-slice-wrapping-right-then-down-from-cursor-over-full-screen:end</span>:
<span id="L325" class="LineNr">325 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L326" class="LineNr">326 </span> 5a/pop-to-edx
<span id="L327" class="LineNr">327 </span> 59/pop-to-ecx
<span id="L328" class="LineNr">328 </span> 58/pop-to-eax
<span id="L329" class="LineNr">329 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L330" class="LineNr">330 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L331" class="LineNr">331 </span> 5d/pop-to-ebp
<span id="L332" class="LineNr">332 </span> c3/return
</pre>
</body>
</html>
<!-- vim: set foldmethod=manual : -->

200
html/400.mu.html generated
View File

@ -53,105 +53,107 @@ if ('onhashchange' in window) {
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/main/400.mu'>https://github.com/akkartik/mu/blob/main/400.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># screen</span>
<span id="L2" class="LineNr"> 2 </span><span class="PreProc">sig</span> <a href='101screen.subx.html#L8'>pixel-on-real-screen</a> x: int, y: int, color: int
<span id="L3" class="LineNr"> 3 </span><span class="PreProc">sig</span> <a href='103grapheme.subx.html#L17'>draw-grapheme-on-real-screen</a> g: grapheme, x: int, y: int, color: int, background-color: int
<span id="L4" class="LineNr"> 4 </span><span class="PreProc">sig</span> <a href='103grapheme.subx.html#L96'>cursor-position-on-real-screen</a><span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int
<span id="L5" class="LineNr"> 5 </span><span class="PreProc">sig</span> <a href='103grapheme.subx.html#L109'>set-cursor-position-on-real-screen</a> x: int, y: int
<span id="L6" class="LineNr"> 6 </span><span class="PreProc">sig</span> <a href='103grapheme.subx.html#L134'>draw-cursor-on-real-screen</a> g: grapheme
<span id="L7" class="LineNr"> 7 </span><span class="PreProc">sig</span> <a href='316colors.subx.html#L7'>color-rgb</a> color: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">ecx</span>: int, _/<span class="Constant">edx</span>: int, _/<span class="Constant">ebx</span>: int
<span id="L8" class="LineNr"> 8 </span>
<span id="L9" class="LineNr"> 9 </span><span class="muComment"># keyboard</span>
<span id="L10" class="LineNr">10 </span><span class="PreProc">sig</span> <a href='102keyboard.subx.html#L21'>read-key</a> kbd: (addr keyboard)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: byte
<span id="L11" class="LineNr">11 </span>
<span id="L12" class="LineNr">12 </span><span class="muComment"># disk</span>
<span id="L13" class="LineNr">13 </span><span class="PreProc">sig</span> <a href='boot.subx.html#L925'>load-sectors</a> disk: (addr disk), lba: int, n: int, out: (addr stream byte)
<span id="L14" class="LineNr">14 </span><span class="PreProc">sig</span> <a href='boot.subx.html#L987'>store-sectors</a> disk: (addr disk), lba: int, n: int, out: (addr stream byte)
<span id="L15" class="LineNr">15 </span>
<span id="L16" class="LineNr">16 </span><span class="muComment"># mouse</span>
<span id="L17" class="LineNr">17 </span><span class="PreProc">sig</span> <a href='boot.subx.html#L1393'>read-mouse-event</a><span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int
<span id="L18" class="LineNr">18 </span>
<span id="L19" class="LineNr">19 </span><span class="muComment"># tests</span>
<span id="L20" class="LineNr">20 </span><span class="PreProc">sig</span> <a href='104test.subx.html#L5'>count-test-failure</a>
<span id="L21" class="LineNr">21 </span><span class="PreProc">sig</span> <a href='104test.subx.html#L17'>num-test-failures</a><span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int
<span id="L22" class="LineNr">22 </span>
<span id="L23" class="LineNr">23 </span><span class="PreProc">sig</span> <a href='105string-equal.subx.html#L8'>string-equal?</a> s: (addr array byte), benchmark: (addr array byte)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean
<span id="L24" class="LineNr">24 </span><span class="PreProc">sig</span> <a href='105string-equal.subx.html#L50'>string-starts-with?</a> s: (addr array byte), benchmark: (addr array byte)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean
<span id="L25" class="LineNr">25 </span><span class="PreProc">sig</span> <a href='105string-equal.subx.html#L213'>check-strings-equal</a> s: (addr array byte), expected: (addr array byte), msg: (addr array byte)
<span id="L26" class="LineNr">26 </span>
<span id="L27" class="LineNr">27 </span><span class="muComment"># debugging</span>
<span id="L28" class="LineNr">28 </span><span class="PreProc">sig</span> <a href='315stack-debug.subx.html#L5'>check-stack</a>
<span id="L29" class="LineNr">29 </span><span class="PreProc">sig</span> <a href='315stack-debug.subx.html#L26'>show-stack-state</a>
<span id="L30" class="LineNr">30 </span><span class="PreProc">sig</span> <a href='315stack-debug.subx.html#L56'>debug-print</a> x: (addr array byte), fg: int, bg: int
<span id="L31" class="LineNr">31 </span><span class="PreProc">sig</span> <a href='315stack-debug.subx.html#L84'>debug-print?</a><span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean
<span id="L32" class="LineNr">32 </span><span class="PreProc">sig</span> <a href='315stack-debug.subx.html#L96'>turn-on-debug-print</a>
<span id="L33" class="LineNr">33 </span><span class="PreProc">sig</span> <a href='315stack-debug.subx.html#L108'>turn-off-debug-print</a>
<span id="L34" class="LineNr">34 </span>
<span id="L35" class="LineNr">35 </span><span class="muComment"># streams</span>
<span id="L36" class="LineNr">36 </span><span class="PreProc">sig</span> <a href='106stream.subx.html#L20'>clear-stream</a> f: (addr stream _)
<span id="L37" class="LineNr">37 </span><span class="PreProc">sig</span> <a href='106stream.subx.html#L59'>rewind-stream</a> f: (addr stream _)
<span id="L38" class="LineNr">38 </span><span class="PreProc">sig</span> <a href='109stream-equal.subx.html#L9'>stream-data-equal?</a> f: (addr stream byte), s: (addr array byte)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean
<span id="L39" class="LineNr">39 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L217'>streams-data-equal?</a> f: (addr stream byte), s: (addr stream byte)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean
<span id="L40" class="LineNr">40 </span><span class="PreProc">sig</span> <a href='109stream-equal.subx.html#L194'>check-stream-equal</a> f: (addr stream byte), s: (addr array byte), msg: (addr array byte)
<span id="L41" class="LineNr">41 </span><span class="PreProc">sig</span> <a href='109stream-equal.subx.html#L230'>next-stream-line-equal?</a> f: (addr stream byte), s: (addr array byte)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean
<span id="L42" class="LineNr">42 </span><span class="PreProc">sig</span> <a href='109stream-equal.subx.html#L565'>check-next-stream-line-equal</a> f: (addr stream byte), s: (addr array byte), msg: (addr array byte)
<span id="L43" class="LineNr">43 </span><span class="PreProc">sig</span> <a href='108write.subx.html#L11'>write</a> f: (addr stream byte), s: (addr array byte)
<span id="L44" class="LineNr">44 </span><span class="PreProc">sig</span> <a href='113write-stream.subx.html#L8'>write-stream</a> f: (addr stream byte), s: (addr stream byte)
<span id="L45" class="LineNr">45 </span><span class="PreProc">sig</span> <a href='112read-byte.subx.html#L13'>read-byte</a> s: (addr stream byte)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: byte
<span id="L46" class="LineNr">46 </span><span class="PreProc">sig</span> <a href='115write-byte.subx.html#L12'>append-byte</a> f: (addr stream byte), n: int <span class="muComment"># really just a byte, but I want to pass in literal numbers</span>
<span id="L47" class="LineNr">47 </span><span class="muComment">#sig to-hex-char in/eax: int -&gt; out/eax: int</span>
<span id="L48" class="LineNr">48 </span><span class="PreProc">sig</span> <a href='117write-int-hex.subx.html#L21'>append-byte-hex</a> f: (addr stream byte), n: int <span class="muComment"># really just a byte, but I want to pass in literal numbers</span>
<span id="L49" class="LineNr">49 </span><span class="PreProc">sig</span> <a href='117write-int-hex.subx.html#L92'>write-int32-hex</a> f: (addr stream byte), n: int
<span id="L50" class="LineNr">50 </span><span class="PreProc">sig</span> <a href='117write-int-hex.subx.html#L123'>write-int32-hex-bits</a> f: (addr stream byte), n: int, bits: int
<span id="L51" class="LineNr">51 </span><span class="PreProc">sig</span> <a href='118parse-hex-int.subx.html#L9'>hex-int?</a> in: (addr slice)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean
<span id="L52" class="LineNr">52 </span><span class="PreProc">sig</span> <a href='118parse-hex-int.subx.html#L354'>parse-hex-int</a> in: (addr array byte)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int
<span id="L53" class="LineNr">53 </span><span class="PreProc">sig</span> <a href='118parse-hex-int.subx.html#L387'>parse-hex-int-from-slice</a> in: (addr slice)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int
<span id="L54" class="LineNr">54 </span><span class="muComment">#sig parse-hex-int-helper start: (addr byte), end: (addr byte) -&gt; _/eax: int</span>
<span id="L55" class="LineNr">55 </span><span class="PreProc">sig</span> <a href='118parse-hex-int.subx.html#L701'>hex-digit?</a> c: byte<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean
<span id="L56" class="LineNr">56 </span><span class="muComment">#sig from-hex-char in/eax: byte -&gt; out/eax: nibble</span>
<span id="L57" class="LineNr">57 </span><span class="PreProc">sig</span> <a href='311decimal-int.subx.html#L23'>parse-decimal-int</a> in: (addr array byte)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int
<span id="L58" class="LineNr">58 </span><span class="PreProc">sig</span> <a href='311decimal-int.subx.html#L4'>parse-decimal-int-from-slice</a> in: (addr slice)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int
<span id="L59" class="LineNr">59 </span><span class="PreProc">sig</span> <a href='311decimal-int.subx.html#L48'>parse-decimal-int-from-stream</a> in: (addr stream byte)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int
<span id="L60" class="LineNr">60 </span><span class="muComment">#sig parse-decimal-int-helper start: (addr byte), end: (addr byte) -&gt; _/eax: int</span>
<span id="L61" class="LineNr">61 </span><span class="PreProc">sig</span> <a href='311decimal-int.subx.html#L312'>decimal-size</a> n: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int
<span id="L62" class="LineNr">62 </span><span class="muComment">#sig allocate ad: (addr allocation-descriptor), n: int, out: (addr handle _)</span>
<span id="L63" class="LineNr">63 </span><span class="muComment">#sig allocate-raw ad: (addr allocation-descriptor), n: int, out: (addr handle _)</span>
<span id="L64" class="LineNr">64 </span><span class="PreProc">sig</span> <a href='120allocate.subx.html#L226'>lookup</a> h: (handle _T)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: (addr _T)
<span id="L65" class="LineNr">65 </span><span class="PreProc">sig</span> <a href='120allocate.subx.html#L424'>handle-equal?</a> a: (handle _T), b: (handle _T)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean
<span id="L66" class="LineNr">66 </span><span class="PreProc">sig</span> <a href='120allocate.subx.html#L455'>copy-handle</a> src: (handle _T), dest: (addr handle _T)
<span id="L67" class="LineNr">67 </span><span class="muComment">#sig allocate-region ad: (addr allocation-descriptor), n: int, out: (addr handle allocation-descriptor)</span>
<span id="L68" class="LineNr">68 </span><span class="muComment">#sig allocate-array ad: (addr allocation-descriptor), n: int, out: (addr handle _)</span>
<span id="L69" class="LineNr">69 </span><span class="PreProc">sig</span> <a href='120allocate.subx.html#L669'>copy-array</a> ad: (addr allocation-descriptor), src: (addr array _T), out: (addr handle array _T)
<span id="L70" class="LineNr">70 </span><span class="muComment">#sig zero-out start: (addr byte), size: int</span>
<span id="L71" class="LineNr">71 </span><span class="PreProc">sig</span> <a href='123slice.subx.html#L9'>slice-empty?</a> s: (addr slice)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean
<span id="L72" class="LineNr">72 </span><span class="PreProc">sig</span> <a href='123slice.subx.html#L120'>slice-equal?</a> s: (addr slice), p: (addr array byte)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean
<span id="L73" class="LineNr">73 </span><span class="PreProc">sig</span> <a href='123slice.subx.html#L487'>slice-starts-with?</a> s: (addr slice), head: (addr array byte)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean
<span id="L74" class="LineNr">74 </span><span class="PreProc">sig</span> <a href='123slice.subx.html#L793'>write-slice</a> out: (addr stream byte), s: (addr slice)
<span id="L75" class="LineNr">75 </span><span class="muComment"># bad name alert</span>
<span id="L76" class="LineNr">76 </span><span class="PreProc">sig</span> <a href='123slice.subx.html#L901'>slice-to-string</a> ad: (addr allocation-descriptor), in: (addr slice), out: (addr handle array byte)
<span id="L77" class="LineNr">77 </span><span class="PreProc">sig</span> <a href='126write-int-decimal.subx.html#L8'>write-int32-decimal</a> out: (addr stream byte), n: int
<span id="L78" class="LineNr">78 </span><span class="PreProc">sig</span> <a href='126write-int-decimal.subx.html#L299'>decimal-digit?</a> c: grapheme<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean
<span id="L79" class="LineNr">79 </span><span class="PreProc">sig</span> <a href='126write-int-decimal.subx.html#L398'>to-decimal-digit</a> in: grapheme<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int
<span id="L80" class="LineNr">80 </span><span class="muComment"># bad name alert</span>
<span id="L81" class="LineNr">81 </span><span class="muComment"># next-word really tokenizes</span>
<span id="L82" class="LineNr">82 </span><span class="muComment"># next-raw-word really reads whitespace-separated words</span>
<span id="L83" class="LineNr">83 </span><span class="PreProc">sig</span> <a href='127next-word.subx.html#L11'>next-word</a> line: (addr stream byte), out: (addr slice) <span class="muComment"># skips '#' comments</span>
<span id="L84" class="LineNr">84 </span><span class="PreProc">sig</span> <a href='127next-word.subx.html#L306'>next-raw-word</a> line: (addr stream byte), out: (addr slice) <span class="muComment"># does not skip '#' comments</span>
<span id="L85" class="LineNr">85 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L6'>stream-empty?</a> s: (addr stream _)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean
<span id="L86" class="LineNr">86 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L30'>stream-full?</a> s: (addr stream _)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean
<span id="L87" class="LineNr">87 </span><span class="PreProc">sig</span> <a href='310copy-bytes.subx.html#L60'>stream-to-array</a> in: (addr stream _), out: (addr handle array _)
<span id="L88" class="LineNr">88 </span><span class="PreProc">sig</span> <a href='310copy-bytes.subx.html#L120'>unquote-stream-to-array</a> in: (addr stream _), out: (addr handle array _)
<span id="L89" class="LineNr">89 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L160'>stream-first</a> s: (addr stream byte)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: byte
<span id="L90" class="LineNr">90 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L187'>stream-final</a> s: (addr stream byte)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: byte
<span id="L91" class="LineNr">91 </span>
<span id="L92" class="LineNr">92 </span><span class="muComment">#sig copy-bytes src: (addr byte), dest: (addr byte), n: int</span>
<span id="L93" class="LineNr">93 </span><span class="PreProc">sig</span> <a href='312copy.subx.html#L3'>copy-array-object</a> src: (addr array _), dest-ah: (addr handle array _)
<span id="L94" class="LineNr">94 </span><span class="PreProc">sig</span> <a href='301array-equal.subx.html#L5'>array-equal?</a> a: (addr array int), b: (addr array int)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean
<span id="L95" class="LineNr">95 </span><span class="PreProc">sig</span> <a href='301array-equal.subx.html#L368'>parse-array-of-ints</a> s: (addr array byte), out: (addr handle array int)
<span id="L96" class="LineNr">96 </span><span class="PreProc">sig</span> <a href='311decimal-int.subx.html#L623'>parse-array-of-decimal-ints</a> s: (addr array byte), out: (addr handle array int)
<span id="L97" class="LineNr">97 </span><span class="PreProc">sig</span> <a href='301array-equal.subx.html#L382'>check-array-equal</a> a: (addr array int), expected: (addr string), msg: (addr string)
<span id="L98" class="LineNr">98 </span>
<span id="L99" class="LineNr">99 </span><span class="PreProc">sig</span> <a href='314divide.subx.html#L3'>integer-divide</a> a: int, b: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">edx</span>: int
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># screen</span>
<span id="L2" class="LineNr"> 2 </span><span class="PreProc">sig</span> <a href='101screen.subx.html#L8'>pixel-on-real-screen</a> x: int, y: int, color: int
<span id="L3" class="LineNr"> 3 </span><span class="PreProc">sig</span> <a href='103grapheme.subx.html#L17'>draw-grapheme-on-real-screen</a> g: grapheme, x: int, y: int, color: int, background-color: int
<span id="L4" class="LineNr"> 4 </span><span class="PreProc">sig</span> <a href='103grapheme.subx.html#L96'>cursor-position-on-real-screen</a><span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int
<span id="L5" class="LineNr"> 5 </span><span class="PreProc">sig</span> <a href='103grapheme.subx.html#L109'>set-cursor-position-on-real-screen</a> x: int, y: int
<span id="L6" class="LineNr"> 6 </span><span class="PreProc">sig</span> <a href='103grapheme.subx.html#L134'>draw-cursor-on-real-screen</a> g: grapheme
<span id="L7" class="LineNr"> 7 </span><span class="PreProc">sig</span> <a href='316colors.subx.html#L7'>color-rgb</a> color: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">ecx</span>: int, _/<span class="Constant">edx</span>: int, _/<span class="Constant">ebx</span>: int
<span id="L8" class="LineNr"> 8 </span>
<span id="L9" class="LineNr"> 9 </span><span class="muComment"># keyboard</span>
<span id="L10" class="LineNr"> 10 </span><span class="PreProc">sig</span> <a href='102keyboard.subx.html#L21'>read-key</a> kbd: (addr keyboard)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: byte
<span id="L11" class="LineNr"> 11 </span>
<span id="L12" class="LineNr"> 12 </span><span class="muComment"># disk</span>
<span id="L13" class="LineNr"> 13 </span><span class="PreProc">sig</span> <a href='boot.subx.html#L946'>load-sectors</a> disk: (addr disk), lba: int, n: int, out: (addr stream byte)
<span id="L14" class="LineNr"> 14 </span><span class="PreProc">sig</span> <a href='boot.subx.html#L1009'>store-sectors</a> disk: (addr disk), lba: int, n: int, out: (addr stream byte)
<span id="L15" class="LineNr"> 15 </span>
<span id="L16" class="LineNr"> 16 </span><span class="muComment"># mouse</span>
<span id="L17" class="LineNr"> 17 </span><span class="PreProc">sig</span> <a href='boot.subx.html#L1415'>read-mouse-event</a><span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int
<span id="L18" class="LineNr"> 18 </span>
<span id="L19" class="LineNr"> 19 </span><span class="muComment"># tests</span>
<span id="L20" class="LineNr"> 20 </span><span class="PreProc">sig</span> <a href='104test.subx.html#L5'>count-test-failure</a>
<span id="L21" class="LineNr"> 21 </span><span class="PreProc">sig</span> <a href='104test.subx.html#L17'>num-test-failures</a><span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int
<span id="L22" class="LineNr"> 22 </span>
<span id="L23" class="LineNr"> 23 </span><span class="PreProc">sig</span> <a href='105string-equal.subx.html#L8'>string-equal?</a> s: (addr array byte), benchmark: (addr array byte)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean
<span id="L24" class="LineNr"> 24 </span><span class="PreProc">sig</span> <a href='105string-equal.subx.html#L50'>string-starts-with?</a> s: (addr array byte), benchmark: (addr array byte)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean
<span id="L25" class="LineNr"> 25 </span><span class="PreProc">sig</span> <a href='105string-equal.subx.html#L213'>check-strings-equal</a> s: (addr array byte), expected: (addr array byte), msg: (addr array byte)
<span id="L26" class="LineNr"> 26 </span>
<span id="L27" class="LineNr"> 27 </span><span class="muComment"># debugging</span>
<span id="L28" class="LineNr"> 28 </span><span class="PreProc">sig</span> <a href='315stack-debug.subx.html#L5'>check-stack</a>
<span id="L29" class="LineNr"> 29 </span><span class="PreProc">sig</span> <a href='315stack-debug.subx.html#L26'>show-stack-state</a>
<span id="L30" class="LineNr"> 30 </span><span class="PreProc">sig</span> <a href='315stack-debug.subx.html#L56'>debug-print</a> x: (addr array byte), fg: int, bg: int
<span id="L31" class="LineNr"> 31 </span><span class="PreProc">sig</span> <a href='315stack-debug.subx.html#L84'>debug-print?</a><span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean
<span id="L32" class="LineNr"> 32 </span><span class="PreProc">sig</span> <a href='315stack-debug.subx.html#L96'>turn-on-debug-print</a>
<span id="L33" class="LineNr"> 33 </span><span class="PreProc">sig</span> <a href='315stack-debug.subx.html#L108'>turn-off-debug-print</a>
<span id="L34" class="LineNr"> 34 </span><span class="PreProc">sig</span> <a href='317abort.subx.html#L5'>abort</a> e: (addr array byte)
<span id="L35" class="LineNr"> 35 </span><span class="PreProc">sig</span> <a href='317abort.subx.html#L21'>dump-call-stack</a>
<span id="L36" class="LineNr"> 36 </span>
<span id="L37" class="LineNr"> 37 </span><span class="muComment"># streams</span>
<span id="L38" class="LineNr"> 38 </span><span class="PreProc">sig</span> <a href='106stream.subx.html#L20'>clear-stream</a> f: (addr stream _)
<span id="L39" class="LineNr"> 39 </span><span class="PreProc">sig</span> <a href='106stream.subx.html#L59'>rewind-stream</a> f: (addr stream _)
<span id="L40" class="LineNr"> 40 </span><span class="PreProc">sig</span> <a href='109stream-equal.subx.html#L9'>stream-data-equal?</a> f: (addr stream byte), s: (addr array byte)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean
<span id="L41" class="LineNr"> 41 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L211'>streams-data-equal?</a> f: (addr stream byte), s: (addr stream byte)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean
<span id="L42" class="LineNr"> 42 </span><span class="PreProc">sig</span> <a href='109stream-equal.subx.html#L194'>check-stream-equal</a> f: (addr stream byte), s: (addr array byte), msg: (addr array byte)
<span id="L43" class="LineNr"> 43 </span><span class="PreProc">sig</span> <a href='109stream-equal.subx.html#L230'>next-stream-line-equal?</a> f: (addr stream byte), s: (addr array byte)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean
<span id="L44" class="LineNr"> 44 </span><span class="PreProc">sig</span> <a href='109stream-equal.subx.html#L565'>check-next-stream-line-equal</a> f: (addr stream byte), s: (addr array byte), msg: (addr array byte)
<span id="L45" class="LineNr"> 45 </span><span class="PreProc">sig</span> <a href='108write.subx.html#L11'>write</a> f: (addr stream byte), s: (addr array byte)
<span id="L46" class="LineNr"> 46 </span><span class="PreProc">sig</span> <a href='113write-stream.subx.html#L8'>write-stream</a> f: (addr stream byte), s: (addr stream byte)
<span id="L47" class="LineNr"> 47 </span><span class="PreProc">sig</span> <a href='112read-byte.subx.html#L13'>read-byte</a> s: (addr stream byte)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: byte
<span id="L48" class="LineNr"> 48 </span><span class="PreProc">sig</span> <a href='115write-byte.subx.html#L12'>append-byte</a> f: (addr stream byte), n: int <span class="muComment"># really just a byte, but I want to pass in literal numbers</span>
<span id="L49" class="LineNr"> 49 </span><span class="muComment">#sig to-hex-char in/eax: int -&gt; out/eax: int</span>
<span id="L50" class="LineNr"> 50 </span><span class="PreProc">sig</span> <a href='117write-int-hex.subx.html#L21'>append-byte-hex</a> f: (addr stream byte), n: int <span class="muComment"># really just a byte, but I want to pass in literal numbers</span>
<span id="L51" class="LineNr"> 51 </span><span class="PreProc">sig</span> <a href='117write-int-hex.subx.html#L92'>write-int32-hex</a> f: (addr stream byte), n: int
<span id="L52" class="LineNr"> 52 </span><span class="PreProc">sig</span> <a href='117write-int-hex.subx.html#L123'>write-int32-hex-bits</a> f: (addr stream byte), n: int, bits: int
<span id="L53" class="LineNr"> 53 </span><span class="PreProc">sig</span> <a href='118parse-hex-int.subx.html#L9'>hex-int?</a> in: (addr slice)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean
<span id="L54" class="LineNr"> 54 </span><span class="PreProc">sig</span> <a href='118parse-hex-int.subx.html#L354'>parse-hex-int</a> in: (addr array byte)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int
<span id="L55" class="LineNr"> 55 </span><span class="PreProc">sig</span> <a href='118parse-hex-int.subx.html#L387'>parse-hex-int-from-slice</a> in: (addr slice)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int
<span id="L56" class="LineNr"> 56 </span><span class="muComment">#sig parse-hex-int-helper start: (addr byte), end: (addr byte) -&gt; _/eax: int</span>
<span id="L57" class="LineNr"> 57 </span><span class="PreProc">sig</span> <a href='118parse-hex-int.subx.html#L701'>hex-digit?</a> c: byte<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean
<span id="L58" class="LineNr"> 58 </span><span class="muComment">#sig from-hex-char in/eax: byte -&gt; out/eax: nibble</span>
<span id="L59" class="LineNr"> 59 </span><span class="PreProc">sig</span> <a href='311decimal-int.subx.html#L23'>parse-decimal-int</a> in: (addr array byte)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int
<span id="L60" class="LineNr"> 60 </span><span class="PreProc">sig</span> <a href='311decimal-int.subx.html#L4'>parse-decimal-int-from-slice</a> in: (addr slice)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int
<span id="L61" class="LineNr"> 61 </span><span class="PreProc">sig</span> <a href='311decimal-int.subx.html#L48'>parse-decimal-int-from-stream</a> in: (addr stream byte)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int
<span id="L62" class="LineNr"> 62 </span><span class="muComment">#sig parse-decimal-int-helper start: (addr byte), end: (addr byte) -&gt; _/eax: int</span>
<span id="L63" class="LineNr"> 63 </span><span class="PreProc">sig</span> <a href='311decimal-int.subx.html#L312'>decimal-size</a> n: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int
<span id="L64" class="LineNr"> 64 </span><span class="muComment">#sig allocate ad: (addr allocation-descriptor), n: int, out: (addr handle _)</span>
<span id="L65" class="LineNr"> 65 </span><span class="muComment">#sig allocate-raw ad: (addr allocation-descriptor), n: int, out: (addr handle _)</span>
<span id="L66" class="LineNr"> 66 </span><span class="PreProc">sig</span> <a href='120allocate.subx.html#L223'>lookup</a> h: (handle _T)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: (addr _T)
<span id="L67" class="LineNr"> 67 </span><span class="PreProc">sig</span> <a href='120allocate.subx.html#L448'>handle-equal?</a> a: (handle _T), b: (handle _T)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean
<span id="L68" class="LineNr"> 68 </span><span class="PreProc">sig</span> <a href='120allocate.subx.html#L479'>copy-handle</a> src: (handle _T), dest: (addr handle _T)
<span id="L69" class="LineNr"> 69 </span><span class="muComment">#sig allocate-region ad: (addr allocation-descriptor), n: int, out: (addr handle allocation-descriptor)</span>
<span id="L70" class="LineNr"> 70 </span><span class="muComment">#sig allocate-array ad: (addr allocation-descriptor), n: int, out: (addr handle _)</span>
<span id="L71" class="LineNr"> 71 </span><span class="PreProc">sig</span> <a href='120allocate.subx.html#L690'>copy-array</a> ad: (addr allocation-descriptor), src: (addr array _T), out: (addr handle array _T)
<span id="L72" class="LineNr"> 72 </span><span class="muComment">#sig zero-out start: (addr byte), size: int</span>
<span id="L73" class="LineNr"> 73 </span><span class="PreProc">sig</span> <a href='123slice.subx.html#L9'>slice-empty?</a> s: (addr slice)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean
<span id="L74" class="LineNr"> 74 </span><span class="PreProc">sig</span> <a href='123slice.subx.html#L120'>slice-equal?</a> s: (addr slice), p: (addr array byte)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean
<span id="L75" class="LineNr"> 75 </span><span class="PreProc">sig</span> <a href='123slice.subx.html#L487'>slice-starts-with?</a> s: (addr slice), head: (addr array byte)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean
<span id="L76" class="LineNr"> 76 </span><span class="PreProc">sig</span> <a href='123slice.subx.html#L793'>write-slice</a> out: (addr stream byte), s: (addr slice)
<span id="L77" class="LineNr"> 77 </span><span class="muComment"># bad name alert</span>
<span id="L78" class="LineNr"> 78 </span><span class="PreProc">sig</span> <a href='123slice.subx.html#L898'>slice-to-string</a> ad: (addr allocation-descriptor), in: (addr slice), out: (addr handle array byte)
<span id="L79" class="LineNr"> 79 </span><span class="PreProc">sig</span> <a href='126write-int-decimal.subx.html#L8'>write-int32-decimal</a> out: (addr stream byte), n: int
<span id="L80" class="LineNr"> 80 </span><span class="PreProc">sig</span> <a href='126write-int-decimal.subx.html#L296'>decimal-digit?</a> c: grapheme<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean
<span id="L81" class="LineNr"> 81 </span><span class="PreProc">sig</span> <a href='126write-int-decimal.subx.html#L395'>to-decimal-digit</a> in: grapheme<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int
<span id="L82" class="LineNr"> 82 </span><span class="muComment"># bad name alert</span>
<span id="L83" class="LineNr"> 83 </span><span class="muComment"># next-word really tokenizes</span>
<span id="L84" class="LineNr"> 84 </span><span class="muComment"># next-raw-word really reads whitespace-separated words</span>
<span id="L85" class="LineNr"> 85 </span><span class="PreProc">sig</span> <a href='127next-word.subx.html#L11'>next-word</a> line: (addr stream byte), out: (addr slice) <span class="muComment"># skips '#' comments</span>
<span id="L86" class="LineNr"> 86 </span><span class="PreProc">sig</span> <a href='127next-word.subx.html#L306'>next-raw-word</a> line: (addr stream byte), out: (addr slice) <span class="muComment"># does not skip '#' comments</span>
<span id="L87" class="LineNr"> 87 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L6'>stream-empty?</a> s: (addr stream _)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean
<span id="L88" class="LineNr"> 88 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L30'>stream-full?</a> s: (addr stream _)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean
<span id="L89" class="LineNr"> 89 </span><span class="PreProc">sig</span> <a href='310copy-bytes.subx.html#L60'>stream-to-array</a> in: (addr stream _), out: (addr handle array _)
<span id="L90" class="LineNr"> 90 </span><span class="PreProc">sig</span> <a href='310copy-bytes.subx.html#L120'>unquote-stream-to-array</a> in: (addr stream _), out: (addr handle array _)
<span id="L91" class="LineNr"> 91 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L154'>stream-first</a> s: (addr stream byte)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: byte
<span id="L92" class="LineNr"> 92 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L181'>stream-final</a> s: (addr stream byte)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: byte
<span id="L93" class="LineNr"> 93 </span>
<span id="L94" class="LineNr"> 94 </span><span class="muComment">#sig copy-bytes src: (addr byte), dest: (addr byte), n: int</span>
<span id="L95" class="LineNr"> 95 </span><span class="PreProc">sig</span> <a href='312copy.subx.html#L3'>copy-array-object</a> src: (addr array _), dest-ah: (addr handle array _)
<span id="L96" class="LineNr"> 96 </span><span class="PreProc">sig</span> <a href='301array-equal.subx.html#L5'>array-equal?</a> a: (addr array int), b: (addr array int)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean
<span id="L97" class="LineNr"> 97 </span><span class="PreProc">sig</span> <a href='301array-equal.subx.html#L368'>parse-array-of-ints</a> s: (addr array byte), out: (addr handle array int)
<span id="L98" class="LineNr"> 98 </span><span class="PreProc">sig</span> <a href='311decimal-int.subx.html#L623'>parse-array-of-decimal-ints</a> s: (addr array byte), out: (addr handle array int)
<span id="L99" class="LineNr"> 99 </span><span class="PreProc">sig</span> <a href='301array-equal.subx.html#L382'>check-array-equal</a> a: (addr array int), expected: (addr string), msg: (addr string)
<span id="L100" class="LineNr">100 </span>
<span id="L101" class="LineNr">101 </span><span class="PreProc">sig</span> <a href='314divide.subx.html#L3'>integer-divide</a> a: int, b: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">edx</span>: int
</pre>
</body>
</html>

20
html/411string.mu.html generated
View File

@ -102,46 +102,46 @@ if ('onhashchange' in window) {
<span id="L42" class="LineNr"> 42 </span> <span class="PreProc">var</span> out-ah/<span class="Constant">edi</span>: (addr handle array byte) <span class="Special">&lt;-</span> address out-h
<span id="L43" class="LineNr"> 43 </span> <span class="muComment"># prefix substrings</span>
<span id="L44" class="LineNr"> 44 </span> <a href='411string.mu.html#L2'>substring</a> <span class="Constant">0</span>, <span class="Constant">0</span>, <span class="Constant">3</span>, out-ah
<span id="L45" class="LineNr"> 45 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr array byte) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L226'>lookup</a> *out-ah
<span id="L45" class="LineNr"> 45 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr array byte) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *out-ah
<span id="L46" class="LineNr"> 46 </span> <a href='105string-equal.subx.html#L213'>check-strings-equal</a> out, <span class="Constant">&quot;&quot;</span>, <span class="Constant">&quot;F - <a href='411string.mu.html#L40'>test-substring</a>/null&quot;</span>
<span id="L47" class="LineNr"> 47 </span> <a href='411string.mu.html#L2'>substring</a> <span class="Constant">&quot;&quot;</span>, <span class="Constant">0</span>, <span class="Constant">3</span>, out-ah
<span id="L48" class="LineNr"> 48 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr array byte) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L226'>lookup</a> *out-ah
<span id="L48" class="LineNr"> 48 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr array byte) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *out-ah
<span id="L49" class="LineNr"> 49 </span><span class="CommentedCode">#? print-string-to-real-screen out</span>
<span id="L50" class="LineNr"> 50 </span><span class="CommentedCode">#? print-string-to-real-screen &quot;\n&quot;</span>
<span id="L51" class="LineNr"> 51 </span> <a href='105string-equal.subx.html#L213'>check-strings-equal</a> out, <span class="Constant">&quot;&quot;</span>, <span class="Constant">&quot;F - <a href='411string.mu.html#L40'>test-substring</a>/empty&quot;</span>
<span id="L52" class="LineNr"> 52 </span> <span class="muComment">#</span>
<span id="L53" class="LineNr"> 53 </span> <a href='411string.mu.html#L2'>substring</a> <span class="Constant">&quot;abcde&quot;</span>, <span class="Constant">0</span>, <span class="Constant">3</span>, out-ah
<span id="L54" class="LineNr"> 54 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr array byte) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L226'>lookup</a> *out-ah
<span id="L54" class="LineNr"> 54 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr array byte) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *out-ah
<span id="L55" class="LineNr"> 55 </span><span class="CommentedCode">#? print-string-to-real-screen out</span>
<span id="L56" class="LineNr"> 56 </span><span class="CommentedCode">#? print-string-to-real-screen &quot;\n&quot;</span>
<span id="L57" class="LineNr"> 57 </span> <a href='105string-equal.subx.html#L213'>check-strings-equal</a> out, <span class="Constant">&quot;abc&quot;</span>, <span class="Constant">&quot;F - <a href='411string.mu.html#L40'>test-substring</a>/truncate&quot;</span>
<span id="L58" class="LineNr"> 58 </span> <span class="muComment">#</span>
<span id="L59" class="LineNr"> 59 </span> <a href='411string.mu.html#L2'>substring</a> <span class="Constant">&quot;abcde&quot;</span>, <span class="Constant">0</span>, <span class="Constant">5</span>, out-ah
<span id="L60" class="LineNr"> 60 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr array byte) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L226'>lookup</a> *out-ah
<span id="L60" class="LineNr"> 60 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr array byte) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *out-ah
<span id="L61" class="LineNr"> 61 </span> <a href='105string-equal.subx.html#L213'>check-strings-equal</a> out, <span class="Constant">&quot;abcde&quot;</span>, <span class="Constant">&quot;F - <a href='411string.mu.html#L40'>test-substring</a>/all&quot;</span>
<span id="L62" class="LineNr"> 62 </span> <span class="muComment">#</span>
<span id="L63" class="LineNr"> 63 </span> <a href='411string.mu.html#L2'>substring</a> <span class="Constant">&quot;abcde&quot;</span>, <span class="Constant">0</span>, <span class="Constant">7</span>, out-ah
<span id="L64" class="LineNr"> 64 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr array byte) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L226'>lookup</a> *out-ah
<span id="L64" class="LineNr"> 64 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr array byte) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *out-ah
<span id="L65" class="LineNr"> 65 </span> <a href='105string-equal.subx.html#L213'>check-strings-equal</a> out, <span class="Constant">&quot;abcde&quot;</span>, <span class="Constant">&quot;F - <a href='411string.mu.html#L40'>test-substring</a>/too-small&quot;</span>
<span id="L66" class="LineNr"> 66 </span> <span class="muComment"># substrings outside string</span>
<span id="L67" class="LineNr"> 67 </span> <a href='411string.mu.html#L2'>substring</a> <span class="Constant">&quot;abcde&quot;</span>, <span class="Constant">6</span>, <span class="Constant">1</span>, out-ah
<span id="L68" class="LineNr"> 68 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr array byte) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L226'>lookup</a> *out-ah
<span id="L68" class="LineNr"> 68 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr array byte) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *out-ah
<span id="L69" class="LineNr"> 69 </span> <a href='105string-equal.subx.html#L213'>check-strings-equal</a> out, <span class="Constant">&quot;&quot;</span>, <span class="Constant">&quot;F - <a href='411string.mu.html#L40'>test-substring</a>/start-too-large&quot;</span>
<span id="L70" class="LineNr"> 70 </span> <span class="muComment"># trim prefix</span>
<span id="L71" class="LineNr"> 71 </span> <a href='411string.mu.html#L2'>substring</a> <span class="Constant">&quot;&quot;</span>, <span class="Constant">2</span>, <span class="Constant">3</span>, out-ah
<span id="L72" class="LineNr"> 72 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr array byte) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L226'>lookup</a> *out-ah
<span id="L72" class="LineNr"> 72 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr array byte) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *out-ah
<span id="L73" class="LineNr"> 73 </span> <a href='105string-equal.subx.html#L213'>check-strings-equal</a> out, <span class="Constant">&quot;&quot;</span>, <span class="Constant">&quot;F - <a href='411string.mu.html#L40'>test-substring</a>/middle-empty&quot;</span>
<span id="L74" class="LineNr"> 74 </span> <span class="muComment">#</span>
<span id="L75" class="LineNr"> 75 </span> <a href='411string.mu.html#L2'>substring</a> <span class="Constant">&quot;abcde&quot;</span>, <span class="Constant">1</span>, <span class="Constant">2</span>, out-ah
<span id="L76" class="LineNr"> 76 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr array byte) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L226'>lookup</a> *out-ah
<span id="L76" class="LineNr"> 76 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr array byte) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *out-ah
<span id="L77" class="LineNr"> 77 </span> <a href='105string-equal.subx.html#L213'>check-strings-equal</a> out, <span class="Constant">&quot;bc&quot;</span>, <span class="Constant">&quot;F - <a href='411string.mu.html#L40'>test-substring</a>/middle-truncate&quot;</span>
<span id="L78" class="LineNr"> 78 </span> <span class="muComment">#</span>
<span id="L79" class="LineNr"> 79 </span> <a href='411string.mu.html#L2'>substring</a> <span class="Constant">&quot;abcde&quot;</span>, <span class="Constant">1</span>, <span class="Constant">4</span>, out-ah
<span id="L80" class="LineNr"> 80 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr array byte) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L226'>lookup</a> *out-ah
<span id="L80" class="LineNr"> 80 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr array byte) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *out-ah
<span id="L81" class="LineNr"> 81 </span> <a href='105string-equal.subx.html#L213'>check-strings-equal</a> out, <span class="Constant">&quot;bcde&quot;</span>, <span class="Constant">&quot;F - <a href='411string.mu.html#L40'>test-substring</a>/middle-all&quot;</span>
<span id="L82" class="LineNr"> 82 </span> <span class="muComment">#</span>
<span id="L83" class="LineNr"> 83 </span> <a href='411string.mu.html#L2'>substring</a> <span class="Constant">&quot;abcde&quot;</span>, <span class="Constant">1</span>, <span class="Constant">5</span>, out-ah
<span id="L84" class="LineNr"> 84 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr array byte) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L226'>lookup</a> *out-ah
<span id="L84" class="LineNr"> 84 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr array byte) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *out-ah
<span id="L85" class="LineNr"> 85 </span> <a href='105string-equal.subx.html#L213'>check-strings-equal</a> out, <span class="Constant">&quot;bcde&quot;</span>, <span class="Constant">&quot;F - <a href='411string.mu.html#L40'>test-substring</a>/middle-too-small&quot;</span>
<span id="L86" class="LineNr"> 86 </span><span class="Delimiter">}</span>
<span id="L87" class="LineNr"> 87 </span>

View File

@ -154,7 +154,7 @@ if ('onhashchange' in window) {
<span id="L96" class="LineNr"> 96 </span> <span class="muComment"># fake screen</span>
<span id="L97" class="LineNr"> 97 </span> <span class="PreProc">var</span> idx/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L120'>screen-cell-index</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y
<span id="L98" class="LineNr"> 98 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">eax</span>: (addr handle array <a href='500fake-screen.mu.html#L25'>screen-cell</a>) <span class="Special">&lt;-</span> get <a href='500fake-screen.mu.html#L14'>screen</a>, data
<span id="L99" class="LineNr"> 99 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array <a href='500fake-screen.mu.html#L25'>screen-cell</a>) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L99" class="LineNr"> 99 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array <a href='500fake-screen.mu.html#L25'>screen-cell</a>) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L100" class="LineNr">100 </span> <span class="PreProc">var</span> offset/<span class="Constant">ecx</span>: (offset <a href='500fake-screen.mu.html#L25'>screen-cell</a>) <span class="Special">&lt;-</span> compute-offset data, idx
<span id="L101" class="LineNr">101 </span> <span class="PreProc">var</span> dest-cell/<span class="Constant">ecx</span>: (addr <a href='500fake-screen.mu.html#L25'>screen-cell</a>) <span class="Special">&lt;-</span> index data, offset
<span id="L102" class="LineNr">102 </span> <span class="PreProc">var</span> dest-grapheme/<span class="Constant">eax</span>: (addr grapheme) <span class="Special">&lt;-</span> get dest-cell, data
@ -180,26 +180,26 @@ if ('onhashchange' in window) {
<span id="L122" class="LineNr">122 </span> <span class="Delimiter">{</span>
<span id="L123" class="LineNr">123 </span> compare x, <span class="Constant">0</span>
<span id="L124" class="LineNr">124 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L125" class="LineNr">125 </span> <a href='501draw-text.mu.html#L481'>abort</a> <span class="Constant">&quot;screen-cell-index: negative x&quot;</span>
<span id="L125" class="LineNr">125 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;screen-cell-index: negative x&quot;</span>
<span id="L126" class="LineNr">126 </span> <span class="Delimiter">}</span>
<span id="L127" class="LineNr">127 </span> <span class="Delimiter">{</span>
<span id="L128" class="LineNr">128 </span> <span class="PreProc">var</span> xmax/<span class="Constant">eax</span>: (addr int) <span class="Special">&lt;-</span> get <a href='500fake-screen.mu.html#L14'>screen</a>, width
<span id="L129" class="LineNr">129 </span> <span class="PreProc">var</span> xcurr/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy x
<span id="L130" class="LineNr">130 </span> compare xcurr, *xmax
<span id="L131" class="LineNr">131 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L132" class="LineNr">132 </span> <a href='501draw-text.mu.html#L481'>abort</a> <span class="Constant">&quot;screen-cell-index: x too high&quot;</span>
<span id="L132" class="LineNr">132 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;screen-cell-index: x too high&quot;</span>
<span id="L133" class="LineNr">133 </span> <span class="Delimiter">}</span>
<span id="L134" class="LineNr">134 </span> <span class="Delimiter">{</span>
<span id="L135" class="LineNr">135 </span> compare y, <span class="Constant">0</span>
<span id="L136" class="LineNr">136 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L137" class="LineNr">137 </span> <a href='501draw-text.mu.html#L481'>abort</a> <span class="Constant">&quot;screen-cell-index: negative y&quot;</span>
<span id="L137" class="LineNr">137 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;screen-cell-index: negative y&quot;</span>
<span id="L138" class="LineNr">138 </span> <span class="Delimiter">}</span>
<span id="L139" class="LineNr">139 </span> <span class="Delimiter">{</span>
<span id="L140" class="LineNr">140 </span> <span class="PreProc">var</span> ymax/<span class="Constant">eax</span>: (addr int) <span class="Special">&lt;-</span> get <a href='500fake-screen.mu.html#L14'>screen</a>, height
<span id="L141" class="LineNr">141 </span> <span class="PreProc">var</span> ycurr/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy y
<span id="L142" class="LineNr">142 </span> compare ycurr, *ymax
<span id="L143" class="LineNr">143 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L144" class="LineNr">144 </span> <a href='501draw-text.mu.html#L481'>abort</a> <span class="Constant">&quot;screen-cell-index: y too high&quot;</span>
<span id="L144" class="LineNr">144 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;screen-cell-index: y too high&quot;</span>
<span id="L145" class="LineNr">145 </span> <span class="Delimiter">}</span>
<span id="L146" class="LineNr">146 </span> <span class="PreProc">var</span> width-addr/<span class="Constant">eax</span>: (addr int) <span class="Special">&lt;-</span> get <a href='500fake-screen.mu.html#L14'>screen</a>, width
<span id="L147" class="LineNr">147 </span> <span class="PreProc">var</span> result/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy y
@ -314,7 +314,7 @@ if ('onhashchange' in window) {
<span id="L256" class="LineNr">256 </span> <span class="Delimiter">}</span>
<span id="L257" class="LineNr">257 </span> <a href='500fake-screen.mu.html#L169'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0</span>, <span class="Constant">0</span>
<span id="L258" class="LineNr">258 </span> <span class="PreProc">var</span> pixels-ah/<span class="Constant">eax</span>: (addr handle array byte) <span class="Special">&lt;-</span> get <a href='500fake-screen.mu.html#L14'>screen</a>, pixels
<span id="L259" class="LineNr">259 </span> <span class="PreProc">var</span> pixels/<span class="Constant">eax</span>: (addr array byte) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L226'>lookup</a> *pixels-ah
<span id="L259" class="LineNr">259 </span> <span class="PreProc">var</span> pixels/<span class="Constant">eax</span>: (addr array byte) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *pixels-ah
<span id="L260" class="LineNr">260 </span> <span class="PreProc">var</span> i/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L261" class="LineNr">261 </span> <span class="PreProc">var</span> max/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> length pixels
<span id="L262" class="LineNr">262 </span> <span class="Delimiter">{</span>
@ -355,7 +355,7 @@ if ('onhashchange' in window) {
<span id="L297" class="LineNr">297 </span> <span class="PreProc">loop</span>
<span id="L298" class="LineNr">298 </span> <span class="Delimiter">}</span>
<span id="L299" class="LineNr">299 </span> <span class="PreProc">var</span> pixels-ah/<span class="Constant">eax</span>: (addr handle array byte) <span class="Special">&lt;-</span> get <a href='500fake-screen.mu.html#L14'>screen</a>, pixels
<span id="L300" class="LineNr">300 </span> <span class="PreProc">var</span> pixels/<span class="Constant">eax</span>: (addr array byte) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L226'>lookup</a> *pixels-ah
<span id="L300" class="LineNr">300 </span> <span class="PreProc">var</span> pixels/<span class="Constant">eax</span>: (addr array byte) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *pixels-ah
<span id="L301" class="LineNr">301 </span> <span class="PreProc">var</span> y/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L302" class="LineNr">302 </span> <span class="PreProc">var</span> height-addr/<span class="Constant">edx</span>: (addr int) <span class="Special">&lt;-</span> get <a href='500fake-screen.mu.html#L14'>screen</a>, height
<span id="L303" class="LineNr">303 </span> <span class="PreProc">var</span> height/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy *height-addr
@ -471,7 +471,7 @@ if ('onhashchange' in window) {
<span id="L413" class="LineNr">413 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='500fake-screen.mu.html#L413'>screen-grapheme-at-idx</a></span> _screen: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), idx-on-stack: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: grapheme <span class="Delimiter">{</span>
<span id="L414" class="LineNr">414 </span> <span class="PreProc">var</span> <a href='500fake-screen.mu.html#L14'>screen</a>/<span class="Constant">esi</span>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> copy _screen
<span id="L415" class="LineNr">415 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">eax</span>: (addr handle array <a href='500fake-screen.mu.html#L25'>screen-cell</a>) <span class="Special">&lt;-</span> get <a href='500fake-screen.mu.html#L14'>screen</a>, data
<span id="L416" class="LineNr">416 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array <a href='500fake-screen.mu.html#L25'>screen-cell</a>) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L416" class="LineNr">416 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array <a href='500fake-screen.mu.html#L25'>screen-cell</a>) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L417" class="LineNr">417 </span> <span class="PreProc">var</span> idx/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy idx-on-stack
<span id="L418" class="LineNr">418 </span> <span class="PreProc">var</span> offset/<span class="Constant">ecx</span>: (offset <a href='500fake-screen.mu.html#L25'>screen-cell</a>) <span class="Special">&lt;-</span> compute-offset data, idx
<span id="L419" class="LineNr">419 </span> <span class="PreProc">var</span> cell/<span class="Constant">eax</span>: (addr <a href='500fake-screen.mu.html#L25'>screen-cell</a>) <span class="Special">&lt;-</span> index data, offset
@ -489,7 +489,7 @@ if ('onhashchange' in window) {
<span id="L431" class="LineNr">431 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='500fake-screen.mu.html#L431'>screen-color-at-idx</a></span> _screen: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), idx-on-stack: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
<span id="L432" class="LineNr">432 </span> <span class="PreProc">var</span> <a href='500fake-screen.mu.html#L14'>screen</a>/<span class="Constant">esi</span>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> copy _screen
<span id="L433" class="LineNr">433 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">eax</span>: (addr handle array <a href='500fake-screen.mu.html#L25'>screen-cell</a>) <span class="Special">&lt;-</span> get <a href='500fake-screen.mu.html#L14'>screen</a>, data
<span id="L434" class="LineNr">434 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array <a href='500fake-screen.mu.html#L25'>screen-cell</a>) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L434" class="LineNr">434 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array <a href='500fake-screen.mu.html#L25'>screen-cell</a>) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L435" class="LineNr">435 </span> <span class="PreProc">var</span> idx/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy idx-on-stack
<span id="L436" class="LineNr">436 </span> <span class="PreProc">var</span> offset/<span class="Constant">ecx</span>: (offset <a href='500fake-screen.mu.html#L25'>screen-cell</a>) <span class="Special">&lt;-</span> compute-offset data, idx
<span id="L437" class="LineNr">437 </span> <span class="PreProc">var</span> cell/<span class="Constant">eax</span>: (addr <a href='500fake-screen.mu.html#L25'>screen-cell</a>) <span class="Special">&lt;-</span> index data, offset
@ -508,7 +508,7 @@ if ('onhashchange' in window) {
<span id="L450" class="LineNr">450 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='500fake-screen.mu.html#L450'>screen-background-color-at-idx</a></span> _screen: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), idx-on-stack: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
<span id="L451" class="LineNr">451 </span> <span class="PreProc">var</span> <a href='500fake-screen.mu.html#L14'>screen</a>/<span class="Constant">esi</span>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> copy _screen
<span id="L452" class="LineNr">452 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">eax</span>: (addr handle array <a href='500fake-screen.mu.html#L25'>screen-cell</a>) <span class="Special">&lt;-</span> get <a href='500fake-screen.mu.html#L14'>screen</a>, data
<span id="L453" class="LineNr">453 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array <a href='500fake-screen.mu.html#L25'>screen-cell</a>) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L453" class="LineNr">453 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array <a href='500fake-screen.mu.html#L25'>screen-cell</a>) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L454" class="LineNr">454 </span> <span class="PreProc">var</span> idx/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy idx-on-stack
<span id="L455" class="LineNr">455 </span> <span class="PreProc">var</span> offset/<span class="Constant">ecx</span>: (offset <a href='500fake-screen.mu.html#L25'>screen-cell</a>) <span class="Special">&lt;-</span> compute-offset data, idx
<span id="L456" class="LineNr">456 </span> <span class="PreProc">var</span> cell/<span class="Constant">eax</span>: (addr <a href='500fake-screen.mu.html#L25'>screen-cell</a>) <span class="Special">&lt;-</span> index data, offset
@ -527,11 +527,11 @@ if ('onhashchange' in window) {
<span id="L469" class="LineNr">469 </span> <span class="muComment"># fake screen</span>
<span id="L470" class="LineNr">470 </span> <span class="PreProc">var</span> <a href='500fake-screen.mu.html#L14'>screen</a>/<span class="Constant">esi</span>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> copy <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L471" class="LineNr">471 </span> <span class="PreProc">var</span> pixels-ah/<span class="Constant">eax</span>: (addr handle array byte) <span class="Special">&lt;-</span> get <a href='500fake-screen.mu.html#L14'>screen</a>, pixels
<span id="L472" class="LineNr">472 </span> <span class="PreProc">var</span> pixels/<span class="Constant">eax</span>: (addr array byte) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L226'>lookup</a> *pixels-ah
<span id="L472" class="LineNr">472 </span> <span class="PreProc">var</span> pixels/<span class="Constant">eax</span>: (addr array byte) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *pixels-ah
<span id="L473" class="LineNr">473 </span> <span class="Delimiter">{</span>
<span id="L474" class="LineNr">474 </span> compare pixels, <span class="Constant">0</span>
<span id="L475" class="LineNr">475 </span> <span class="PreProc">break-if-!=</span>
<span id="L476" class="LineNr">476 </span> <a href='501draw-text.mu.html#L481'>abort</a> <span class="Constant">&quot;pixel graphics not enabled for this screen&quot;</span>
<span id="L476" class="LineNr">476 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;pixel graphics not enabled for this screen&quot;</span>
<span id="L477" class="LineNr">477 </span> <span class="Delimiter">}</span>
<span id="L478" class="LineNr">478 </span> <span class="PreProc">var</span> idx/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L484'>pixel-index</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y
<span id="L479" class="LineNr">479 </span> <span class="PreProc">var</span> dest/<span class="Constant">ecx</span>: (addr byte) <span class="Special">&lt;-</span> index pixels, idx
@ -544,7 +544,7 @@ if ('onhashchange' in window) {
<span id="L486" class="LineNr">486 </span> <span class="Delimiter">{</span>
<span id="L487" class="LineNr">487 </span> compare x, <span class="Constant">0</span>
<span id="L488" class="LineNr">488 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L489" class="LineNr">489 </span> <a href='501draw-text.mu.html#L481'>abort</a> <span class="Constant">&quot;screen-cell-index: negative x&quot;</span>
<span id="L489" class="LineNr">489 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;screen-cell-index: negative x&quot;</span>
<span id="L490" class="LineNr">490 </span> <span class="Delimiter">}</span>
<span id="L491" class="LineNr">491 </span> <span class="Delimiter">{</span>
<span id="L492" class="LineNr">492 </span> <span class="PreProc">var</span> xmax-a/<span class="Constant">eax</span>: (addr int) <span class="Special">&lt;-</span> get <a href='500fake-screen.mu.html#L14'>screen</a>, width
@ -552,12 +552,12 @@ if ('onhashchange' in window) {
<span id="L494" class="LineNr">494 </span> xmax <span class="Special">&lt;-</span> shift-left <span class="Constant">3</span>/log2-font-width
<span id="L495" class="LineNr">495 </span> compare x, xmax
<span id="L496" class="LineNr">496 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L497" class="LineNr">497 </span> <a href='501draw-text.mu.html#L481'>abort</a> <span class="Constant">&quot;screen-cell-index: x too high&quot;</span>
<span id="L497" class="LineNr">497 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;screen-cell-index: x too high&quot;</span>
<span id="L498" class="LineNr">498 </span> <span class="Delimiter">}</span>
<span id="L499" class="LineNr">499 </span> <span class="Delimiter">{</span>
<span id="L500" class="LineNr">500 </span> compare y, <span class="Constant">0</span>
<span id="L501" class="LineNr">501 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L502" class="LineNr">502 </span> <a href='501draw-text.mu.html#L481'>abort</a> <span class="Constant">&quot;screen-cell-index: negative y&quot;</span>
<span id="L502" class="LineNr">502 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;screen-cell-index: negative y&quot;</span>
<span id="L503" class="LineNr">503 </span> <span class="Delimiter">}</span>
<span id="L504" class="LineNr">504 </span> <span class="Delimiter">{</span>
<span id="L505" class="LineNr">505 </span> <span class="PreProc">var</span> ymax-a/<span class="Constant">eax</span>: (addr int) <span class="Special">&lt;-</span> get <a href='500fake-screen.mu.html#L14'>screen</a>, height
@ -565,7 +565,7 @@ if ('onhashchange' in window) {
<span id="L507" class="LineNr">507 </span> ymax <span class="Special">&lt;-</span> shift-left <span class="Constant">4</span>/log2-font-height
<span id="L508" class="LineNr">508 </span> compare y, ymax
<span id="L509" class="LineNr">509 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L510" class="LineNr">510 </span> <a href='501draw-text.mu.html#L481'>abort</a> <span class="Constant">&quot;screen-cell-index: y too high&quot;</span>
<span id="L510" class="LineNr">510 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;screen-cell-index: y too high&quot;</span>
<span id="L511" class="LineNr">511 </span> <span class="Delimiter">}</span>
<span id="L512" class="LineNr">512 </span> <span class="PreProc">var</span> width-addr/<span class="Constant">eax</span>: (addr int) <span class="Special">&lt;-</span> get <a href='500fake-screen.mu.html#L14'>screen</a>, width
<span id="L513" class="LineNr">513 </span> <span class="PreProc">var</span> result/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy y
@ -574,6 +574,45 @@ if ('onhashchange' in window) {
<span id="L516" class="LineNr">516 </span> result <span class="Special">&lt;-</span> add x
<span id="L517" class="LineNr">517 </span> <span class="PreProc">return</span> result
<span id="L518" class="LineNr">518 </span><span class="Delimiter">}</span>
<span id="L519" class="LineNr">519 </span>
<span id="L520" class="LineNr">520 </span><span class="muComment"># double-buffering primitive</span>
<span id="L521" class="LineNr">521 </span><span class="muComment"># 'screen' must be a fake screen. 'target-screen' is usually real.</span>
<span id="L522" class="LineNr">522 </span><span class="muComment"># Both screens must have the same size.</span>
<span id="L523" class="LineNr">523 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='500fake-screen.mu.html#L523'>copy-pixels</a></span> _screen: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), target-screen: (addr <a href='500fake-screen.mu.html#L14'>screen</a>) <span class="Delimiter">{</span>
<span id="L524" class="LineNr">524 </span> <span class="PreProc">var</span> <a href='500fake-screen.mu.html#L14'>screen</a>/<span class="Constant">esi</span>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> copy _screen
<span id="L525" class="LineNr">525 </span> <span class="PreProc">var</span> pixels-ah/<span class="Constant">eax</span>: (addr handle array byte) <span class="Special">&lt;-</span> get <a href='500fake-screen.mu.html#L14'>screen</a>, pixels
<span id="L526" class="LineNr">526 </span> <span class="PreProc">var</span> _pixels/<span class="Constant">eax</span>: (addr array byte) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *pixels-ah
<span id="L527" class="LineNr">527 </span> <span class="PreProc">var</span> pixels/<span class="Constant">edi</span>: (addr array byte) <span class="Special">&lt;-</span> copy _pixels
<span id="L528" class="LineNr">528 </span> <span class="PreProc">var</span> width-a/<span class="Constant">edx</span>: (addr int) <span class="Special">&lt;-</span> get <a href='500fake-screen.mu.html#L14'>screen</a>, width
<span id="L529" class="LineNr">529 </span> <span class="PreProc">var</span> width/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy *width-a
<span id="L530" class="LineNr">530 </span> width <span class="Special">&lt;-</span> shift-left <span class="Constant">3</span>/log2-font-width
<span id="L531" class="LineNr">531 </span> <span class="PreProc">var</span> height-a/<span class="Constant">ebx</span>: (addr int) <span class="Special">&lt;-</span> get <a href='500fake-screen.mu.html#L14'>screen</a>, height
<span id="L532" class="LineNr">532 </span> <span class="PreProc">var</span> height/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy *height-a
<span id="L533" class="LineNr">533 </span> height <span class="Special">&lt;-</span> shift-left <span class="Constant">4</span>/log2-font-height
<span id="L534" class="LineNr">534 </span> <span class="PreProc">var</span> i/<span class="Constant">esi</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L535" class="LineNr">535 </span> <span class="PreProc">var</span> y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L536" class="LineNr">536 </span> <span class="Delimiter">{</span>
<span id="L537" class="LineNr">537 </span> <span class="muComment"># screen top left pixels x y width height</span>
<span id="L538" class="LineNr">538 </span> compare y, height
<span id="L539" class="LineNr">539 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L540" class="LineNr">540 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L541" class="LineNr">541 </span> <span class="Delimiter">{</span>
<span id="L542" class="LineNr">542 </span> compare x, width
<span id="L543" class="LineNr">543 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L544" class="LineNr">544 </span> <span class="Delimiter">{</span>
<span id="L545" class="LineNr">545 </span> <span class="PreProc">var</span> color-addr/<span class="Constant">ebx</span>: (addr byte) <span class="Special">&lt;-</span> index pixels, i
<span id="L546" class="LineNr">546 </span> <span class="PreProc">var</span> color/<span class="Constant">ebx</span>: byte <span class="Special">&lt;-</span> copy-byte *color-addr
<span id="L547" class="LineNr">547 </span> <span class="PreProc">var</span> color2/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy color
<span id="L548" class="LineNr">548 </span> <a href='500fake-screen.mu.html#L462'>pixel</a> target-screen, x, y, color2
<span id="L549" class="LineNr">549 </span> <span class="Delimiter">}</span>
<span id="L550" class="LineNr">550 </span> x <span class="Special">&lt;-</span> increment
<span id="L551" class="LineNr">551 </span> i <span class="Special">&lt;-</span> increment
<span id="L552" class="LineNr">552 </span> <span class="PreProc">loop</span>
<span id="L553" class="LineNr">553 </span> <span class="Delimiter">}</span>
<span id="L554" class="LineNr">554 </span> y <span class="Special">&lt;-</span> increment
<span id="L555" class="LineNr">555 </span> <span class="PreProc">loop</span>
<span id="L556" class="LineNr">556 </span> <span class="Delimiter">}</span>
<span id="L557" class="LineNr">557 </span><span class="Delimiter">}</span>
</pre>
</body>
</html>

View File

@ -533,17 +533,6 @@ if ('onhashchange' in window) {
<span id="L475" class="LineNr">475 </span> width, height <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L70'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L476" class="LineNr">476 </span> <a href='501draw-text.mu.html#L457'>draw-text-wrapping-down-then-right-from-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, text, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, width, height, color, background-color
<span id="L477" class="LineNr">477 </span><span class="Delimiter">}</span>
<span id="L478" class="LineNr">478 </span>
<span id="L479" class="LineNr">479 </span><span class="muComment"># hacky error-handling</span>
<span id="L480" class="LineNr">480 </span><span class="muComment"># just go into an infinite loop</span>
<span id="L481" class="LineNr">481 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L481'>abort</a></span> e: (addr array byte) <span class="Delimiter">{</span>
<span id="L482" class="LineNr">482 </span> <span class="PreProc">var</span> dummy1/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L483" class="LineNr">483 </span> <span class="PreProc">var</span> dummy2/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L484" class="LineNr">484 </span> dummy1, dummy2 <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L235'>draw-text-wrapping-right-then-down-over-full-screen</a> <span class="Constant">0</span>/screen, e, <span class="Constant">0</span>/x, <span class="Constant">0x2f</span>/y, <span class="Constant">0xf</span>/fg=white, <span class="Constant">0xc</span>/bg=red
<span id="L485" class="LineNr">485 </span> <span class="Delimiter">{</span>
<span id="L486" class="LineNr">486 </span> <span class="PreProc">loop</span>
<span id="L487" class="LineNr">487 </span> <span class="Delimiter">}</span>
<span id="L488" class="LineNr">488 </span><span class="Delimiter">}</span>
</pre>
</body>
</html>

114
html/506math.mu.html generated Normal file
View File

@ -0,0 +1,114 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Mu - 506math.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="colorscheme" content="minimal-dark">
<style type="text/css">
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #a8a8a8; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #a8a8a8; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.LineNr { }
.Delimiter { color: #c000c0; }
.Constant { color: #008787; }
.muFunction { color: #af5f00; text-decoration: underline; }
.Special { color: #ff6060; }
-->
</style>
<script type='text/javascript'>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
function JumpToLine()
{
var lineNum;
lineNum = window.location.hash;
lineNum = lineNum.substr(1); /* strip off '#' */
if (lineNum.indexOf('L') == -1) {
lineNum = 'L'+lineNum;
}
var lineElem = document.getElementById(lineNum);
/* Always jump to new location even if the line was hidden inside a fold, or
* we corrected the raw number to a line ID.
*/
if (lineElem) {
lineElem.scrollIntoView(true);
}
return true;
}
if ('onhashchange' in window) {
window.onhashchange = JumpToLine;
}
-->
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/main/506math.mu'>https://github.com/akkartik/mu/blob/main/506math.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='506math.mu.html#L1'>abs</a></span> n: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
<span id="L2" class="LineNr"> 2 </span> compare n, <span class="Constant">0</span>
<span id="L3" class="LineNr"> 3 </span> <span class="Delimiter">{</span>
<span id="L4" class="LineNr"> 4 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L5" class="LineNr"> 5 </span> negate n
<span id="L6" class="LineNr"> 6 </span> <span class="Delimiter">}</span>
<span id="L7" class="LineNr"> 7 </span> <span class="PreProc">return</span> n
<span id="L8" class="LineNr"> 8 </span><span class="Delimiter">}</span>
<span id="L9" class="LineNr"> 9 </span>
<span id="L10" class="LineNr">10 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='506math.mu.html#L10'>sgn</a></span> n: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
<span id="L11" class="LineNr">11 </span> compare n, <span class="Constant">0</span>
<span id="L12" class="LineNr">12 </span> <span class="Delimiter">{</span>
<span id="L13" class="LineNr">13 </span> <span class="PreProc">break-if-&lt;=</span>
<span id="L14" class="LineNr">14 </span> <span class="PreProc">return</span> <span class="Constant">1</span>
<span id="L15" class="LineNr">15 </span> <span class="Delimiter">}</span>
<span id="L16" class="LineNr">16 </span> <span class="Delimiter">{</span>
<span id="L17" class="LineNr">17 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L18" class="LineNr">18 </span> <span class="PreProc">return</span> <span class="Constant">-1</span>
<span id="L19" class="LineNr">19 </span> <span class="Delimiter">}</span>
<span id="L20" class="LineNr">20 </span> <span class="PreProc">return</span> <span class="Constant">0</span>
<span id="L21" class="LineNr">21 </span><span class="Delimiter">}</span>
<span id="L22" class="LineNr">22 </span>
<span id="L23" class="LineNr">23 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='506math.mu.html#L23'>shift-left-by</a></span> n: int, bits: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
<span id="L24" class="LineNr">24 </span> <span class="PreProc">var</span> i/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy bits
<span id="L25" class="LineNr">25 </span> <span class="Delimiter">{</span>
<span id="L26" class="LineNr">26 </span> compare i, <span class="Constant">0</span>
<span id="L27" class="LineNr">27 </span> <span class="PreProc">break-if-&lt;=</span>
<span id="L28" class="LineNr">28 </span> shift-left n, <span class="Constant">1</span>
<span id="L29" class="LineNr">29 </span> i <span class="Special">&lt;-</span> decrement
<span id="L30" class="LineNr">30 </span> <span class="PreProc">loop</span>
<span id="L31" class="LineNr">31 </span> <span class="Delimiter">}</span>
<span id="L32" class="LineNr">32 </span> <span class="PreProc">return</span> n
<span id="L33" class="LineNr">33 </span><span class="Delimiter">}</span>
<span id="L34" class="LineNr">34 </span>
<span id="L35" class="LineNr">35 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='506math.mu.html#L35'>shift-right-by</a></span> n: int, bits: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
<span id="L36" class="LineNr">36 </span> <span class="PreProc">var</span> i/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy bits
<span id="L37" class="LineNr">37 </span> <span class="Delimiter">{</span>
<span id="L38" class="LineNr">38 </span> compare i, <span class="Constant">0</span>
<span id="L39" class="LineNr">39 </span> <span class="PreProc">break-if-&lt;=</span>
<span id="L40" class="LineNr">40 </span> shift-right n, <span class="Constant">1</span>
<span id="L41" class="LineNr">41 </span> i <span class="Special">&lt;-</span> decrement
<span id="L42" class="LineNr">42 </span> <span class="PreProc">loop</span>
<span id="L43" class="LineNr">43 </span> <span class="Delimiter">}</span>
<span id="L44" class="LineNr">44 </span> <span class="PreProc">return</span> n
<span id="L45" class="LineNr">45 </span><span class="Delimiter">}</span>
<span id="L46" class="LineNr">46 </span>
<span id="L47" class="LineNr">47 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='506math.mu.html#L47'>clear-lowest-bits</a></span> _n: (addr int), bits: int <span class="Delimiter">{</span>
<span id="L48" class="LineNr">48 </span> <span class="PreProc">var</span> dest/<span class="Constant">edi</span>: (addr int) <span class="Special">&lt;-</span> copy _n
<span id="L49" class="LineNr">49 </span> <span class="PreProc">var</span> n/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy *dest
<span id="L50" class="LineNr">50 </span> n <span class="Special">&lt;-</span> <a href='506math.mu.html#L35'>shift-right-by</a> n, bits
<span id="L51" class="LineNr">51 </span> n <span class="Special">&lt;-</span> <a href='506math.mu.html#L23'>shift-left-by</a> n, bits
<span id="L52" class="LineNr">52 </span> copy-to *dest, n
<span id="L53" class="LineNr">53 </span><span class="Delimiter">}</span>
</pre>
</body>
</html>
<!-- vim: set foldmethod=manual : -->

171
html/507line.mu.html generated Normal file
View File

@ -0,0 +1,171 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Mu - 507line.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="colorscheme" content="minimal-dark">
<style type="text/css">
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #a8a8a8; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #a8a8a8; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.Special { color: #ff6060; }
.LineNr { }
.Constant { color: #008787; }
.Delimiter { color: #c000c0; }
.muFunction { color: #af5f00; text-decoration: underline; }
.muComment { color: #005faf; }
-->
</style>
<script type='text/javascript'>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
function JumpToLine()
{
var lineNum;
lineNum = window.location.hash;
lineNum = lineNum.substr(1); /* strip off '#' */
if (lineNum.indexOf('L') == -1) {
lineNum = 'L'+lineNum;
}
var lineElem = document.getElementById(lineNum);
/* Always jump to new location even if the line was hidden inside a fold, or
* we corrected the raw number to a line ID.
*/
if (lineElem) {
lineElem.scrollIntoView(true);
}
return true;
}
if ('onhashchange' in window) {
window.onhashchange = JumpToLine;
}
-->
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/main/507line.mu'>https://github.com/akkartik/mu/blob/main/507line.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='507line.mu.html#L1'>draw-line</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), x0: int, y0: int, x1: int, y1: int, color: int <span class="Delimiter">{</span>
<span id="L2" class="LineNr"> 2 </span> <span class="PreProc">var</span> dx: int
<span id="L3" class="LineNr"> 3 </span> <span class="PreProc">var</span> dy: int
<span id="L4" class="LineNr"> 4 </span> <span class="PreProc">var</span> sx: int
<span id="L5" class="LineNr"> 5 </span> <span class="PreProc">var</span> sy: int
<span id="L6" class="LineNr"> 6 </span> <span class="PreProc">var</span> err: int
<span id="L7" class="LineNr"> 7 </span> <span class="muComment"># dx = abs(x1-x0)</span>
<span id="L8" class="LineNr"> 8 </span> <span class="PreProc">var</span> tmp2/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy x1
<span id="L9" class="LineNr"> 9 </span> tmp2 <span class="Special">&lt;-</span> subtract x0
<span id="L10" class="LineNr"> 10 </span> <span class="PreProc">var</span> tmp/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='506math.mu.html#L1'>abs</a> tmp2
<span id="L11" class="LineNr"> 11 </span> copy-to dx, tmp
<span id="L12" class="LineNr"> 12 </span> <span class="muComment"># sx = sgn(x1-x0)</span>
<span id="L13" class="LineNr"> 13 </span> tmp <span class="Special">&lt;-</span> <a href='506math.mu.html#L10'>sgn</a> tmp2
<span id="L14" class="LineNr"> 14 </span> copy-to sx, tmp
<span id="L15" class="LineNr"> 15 </span> <span class="muComment"># dy = -abs(y1-y0)</span>
<span id="L16" class="LineNr"> 16 </span> tmp2 <span class="Special">&lt;-</span> copy y1
<span id="L17" class="LineNr"> 17 </span> tmp2 <span class="Special">&lt;-</span> subtract y0
<span id="L18" class="LineNr"> 18 </span> tmp <span class="Special">&lt;-</span> <a href='506math.mu.html#L1'>abs</a> tmp2
<span id="L19" class="LineNr"> 19 </span> tmp <span class="Special">&lt;-</span> negate
<span id="L20" class="LineNr"> 20 </span> copy-to dy, tmp
<span id="L21" class="LineNr"> 21 </span> <span class="muComment"># sy = sgn(y1-y0)</span>
<span id="L22" class="LineNr"> 22 </span> tmp <span class="Special">&lt;-</span> <a href='506math.mu.html#L10'>sgn</a> tmp2
<span id="L23" class="LineNr"> 23 </span> copy-to sy, tmp
<span id="L24" class="LineNr"> 24 </span> <span class="muComment"># err = dx + dy</span>
<span id="L25" class="LineNr"> 25 </span> tmp <span class="Special">&lt;-</span> copy dy
<span id="L26" class="LineNr"> 26 </span> tmp <span class="Special">&lt;-</span> add dx
<span id="L27" class="LineNr"> 27 </span> copy-to err, tmp
<span id="L28" class="LineNr"> 28 </span> <span class="muComment">#</span>
<span id="L29" class="LineNr"> 29 </span> <span class="PreProc">var</span> x/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy x0
<span id="L30" class="LineNr"> 30 </span> <span class="PreProc">var</span> y/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy y0
<span id="L31" class="LineNr"> 31 </span> $draw-line:<span class="PreProc">loop</span>: <span class="Delimiter">{</span>
<span id="L32" class="LineNr"> 32 </span> <a href='500fake-screen.mu.html#L462'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y, color
<span id="L33" class="LineNr"> 33 </span> <span class="muComment"># if (x == x1 &amp;&amp; y == y1) break</span>
<span id="L34" class="LineNr"> 34 </span> <span class="Delimiter">{</span>
<span id="L35" class="LineNr"> 35 </span> compare x, x1
<span id="L36" class="LineNr"> 36 </span> <span class="PreProc">break-if-!=</span>
<span id="L37" class="LineNr"> 37 </span> compare y, y1
<span id="L38" class="LineNr"> 38 </span> <span class="PreProc">break-if-!=</span>
<span id="L39" class="LineNr"> 39 </span> <span class="PreProc">break</span> $draw-line:<span class="PreProc">loop</span>
<span id="L40" class="LineNr"> 40 </span> <span class="Delimiter">}</span>
<span id="L41" class="LineNr"> 41 </span> <span class="muComment"># e2 = err*2</span>
<span id="L42" class="LineNr"> 42 </span> <span class="PreProc">var</span> e2/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy err
<span id="L43" class="LineNr"> 43 </span> e2 <span class="Special">&lt;-</span> shift-left <span class="Constant">1</span>
<span id="L44" class="LineNr"> 44 </span> <span class="muComment"># if (e2 &gt;= dy) { err += dy; x += sx; }</span>
<span id="L45" class="LineNr"> 45 </span> <span class="Delimiter">{</span>
<span id="L46" class="LineNr"> 46 </span> compare e2, dy
<span id="L47" class="LineNr"> 47 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L48" class="LineNr"> 48 </span> tmp <span class="Special">&lt;-</span> copy dy
<span id="L49" class="LineNr"> 49 </span> add-to err, tmp
<span id="L50" class="LineNr"> 50 </span> x <span class="Special">&lt;-</span> add sx
<span id="L51" class="LineNr"> 51 </span> <span class="Delimiter">}</span>
<span id="L52" class="LineNr"> 52 </span> <span class="muComment"># if (e2 &lt;= dx) { err += dx; y += sy; }</span>
<span id="L53" class="LineNr"> 53 </span> <span class="Delimiter">{</span>
<span id="L54" class="LineNr"> 54 </span> compare e2, dx
<span id="L55" class="LineNr"> 55 </span> <span class="PreProc">break-if-&gt;</span>
<span id="L56" class="LineNr"> 56 </span> tmp <span class="Special">&lt;-</span> copy dx
<span id="L57" class="LineNr"> 57 </span> add-to err, tmp
<span id="L58" class="LineNr"> 58 </span> y <span class="Special">&lt;-</span> add sy
<span id="L59" class="LineNr"> 59 </span> <span class="Delimiter">}</span>
<span id="L60" class="LineNr"> 60 </span> <span class="PreProc">loop</span>
<span id="L61" class="LineNr"> 61 </span> <span class="Delimiter">}</span>
<span id="L62" class="LineNr"> 62 </span><span class="Delimiter">}</span>
<span id="L63" class="LineNr"> 63 </span>
<span id="L64" class="LineNr"> 64 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='507line.mu.html#L64'>draw-horizontal-line</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), y: int, x0: int, x1: int, color: int <span class="Delimiter">{</span>
<span id="L65" class="LineNr"> 65 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy x0
<span id="L66" class="LineNr"> 66 </span> <span class="Delimiter">{</span>
<span id="L67" class="LineNr"> 67 </span> compare x, x1
<span id="L68" class="LineNr"> 68 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L69" class="LineNr"> 69 </span> <a href='500fake-screen.mu.html#L462'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y, color
<span id="L70" class="LineNr"> 70 </span> x <span class="Special">&lt;-</span> increment
<span id="L71" class="LineNr"> 71 </span> <span class="PreProc">loop</span>
<span id="L72" class="LineNr"> 72 </span> <span class="Delimiter">}</span>
<span id="L73" class="LineNr"> 73 </span><span class="Delimiter">}</span>
<span id="L74" class="LineNr"> 74 </span>
<span id="L75" class="LineNr"> 75 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='507line.mu.html#L75'>draw-vertical-line</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), x: int, y0: int, y1: int, color: int <span class="Delimiter">{</span>
<span id="L76" class="LineNr"> 76 </span> <span class="PreProc">var</span> y/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy y0
<span id="L77" class="LineNr"> 77 </span> <span class="Delimiter">{</span>
<span id="L78" class="LineNr"> 78 </span> compare y, y1
<span id="L79" class="LineNr"> 79 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L80" class="LineNr"> 80 </span> <a href='500fake-screen.mu.html#L462'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y, color
<span id="L81" class="LineNr"> 81 </span> y <span class="Special">&lt;-</span> increment
<span id="L82" class="LineNr"> 82 </span> <span class="PreProc">loop</span>
<span id="L83" class="LineNr"> 83 </span> <span class="Delimiter">}</span>
<span id="L84" class="LineNr"> 84 </span><span class="Delimiter">}</span>
<span id="L85" class="LineNr"> 85 </span>
<span id="L86" class="LineNr"> 86 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='507line.mu.html#L86'>draw-rect</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), xmin: int, ymin: int, xmax: int, ymax: int, color: int <span class="Delimiter">{</span>
<span id="L87" class="LineNr"> 87 </span> <span class="PreProc">var</span> y/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy ymin
<span id="L88" class="LineNr"> 88 </span> <span class="Delimiter">{</span>
<span id="L89" class="LineNr"> 89 </span> compare y, ymax
<span id="L90" class="LineNr"> 90 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L91" class="LineNr"> 91 </span> <a href='507line.mu.html#L64'>draw-horizontal-line</a> <a href='500fake-screen.mu.html#L14'>screen</a>, y, xmin, xmax, color
<span id="L92" class="LineNr"> 92 </span> y <span class="Special">&lt;-</span> increment
<span id="L93" class="LineNr"> 93 </span> <span class="PreProc">loop</span>
<span id="L94" class="LineNr"> 94 </span> <span class="Delimiter">}</span>
<span id="L95" class="LineNr"> 95 </span><span class="Delimiter">}</span>
<span id="L96" class="LineNr"> 96 </span>
<span id="L97" class="LineNr"> 97 </span><span class="muComment"># 0 &lt;= u &lt;= 1</span>
<span id="L98" class="LineNr"> 98 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='507line.mu.html#L98'>line-point</a></span> u: float, x0: int, x1: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
<span id="L99" class="LineNr"> 99 </span> <span class="PreProc">var</span> one/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">1</span>
<span id="L100" class="LineNr">100 </span> <span class="PreProc">var</span> u-prime/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> convert one
<span id="L101" class="LineNr">101 </span> u-prime <span class="Special">&lt;-</span> subtract u
<span id="L102" class="LineNr">102 </span> <span class="PreProc">var</span> result/<span class="Constant">xmm1</span>: float <span class="Special">&lt;-</span> convert x0
<span id="L103" class="LineNr">103 </span> result <span class="Special">&lt;-</span> multiply u-prime
<span id="L104" class="LineNr">104 </span> <span class="PreProc">var</span> term2/<span class="Constant">xmm2</span>: float <span class="Special">&lt;-</span> convert x1
<span id="L105" class="LineNr">105 </span> term2 <span class="Special">&lt;-</span> multiply u
<span id="L106" class="LineNr">106 </span> result <span class="Special">&lt;-</span> add term2
<span id="L107" class="LineNr">107 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> convert result
<span id="L108" class="LineNr">108 </span> <span class="PreProc">return</span> result
<span id="L109" class="LineNr">109 </span><span class="Delimiter">}</span>
</pre>
</body>
</html>
<!-- vim: set foldmethod=manual : -->

152
html/508circle.mu.html generated Normal file
View File

@ -0,0 +1,152 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Mu - 508circle.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="colorscheme" content="minimal-dark">
<style type="text/css">
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #a8a8a8; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #a8a8a8; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.Special { color: #ff6060; }
.LineNr { }
.Constant { color: #008787; }
.Delimiter { color: #c000c0; }
.muFunction { color: #af5f00; text-decoration: underline; }
.muComment { color: #005faf; }
-->
</style>
<script type='text/javascript'>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
function JumpToLine()
{
var lineNum;
lineNum = window.location.hash;
lineNum = lineNum.substr(1); /* strip off '#' */
if (lineNum.indexOf('L') == -1) {
lineNum = 'L'+lineNum;
}
var lineElem = document.getElementById(lineNum);
/* Always jump to new location even if the line was hidden inside a fold, or
* we corrected the raw number to a line ID.
*/
if (lineElem) {
lineElem.scrollIntoView(true);
}
return true;
}
if ('onhashchange' in window) {
window.onhashchange = JumpToLine;
}
-->
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/main/508circle.mu'>https://github.com/akkartik/mu/blob/main/508circle.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='508circle.mu.html#L1'>draw-circle</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), cx: int, cy: int, radius: int, color: int <span class="Delimiter">{</span>
<span id="L2" class="LineNr"> 2 </span> <span class="PreProc">var</span> x: int
<span id="L3" class="LineNr"> 3 </span> <span class="PreProc">var</span> y: int
<span id="L4" class="LineNr"> 4 </span> <span class="PreProc">var</span> err: int
<span id="L5" class="LineNr"> 5 </span> <span class="muComment"># x = -r</span>
<span id="L6" class="LineNr"> 6 </span> <span class="PreProc">var</span> tmp/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy radius
<span id="L7" class="LineNr"> 7 </span> tmp <span class="Special">&lt;-</span> negate
<span id="L8" class="LineNr"> 8 </span> copy-to x, tmp
<span id="L9" class="LineNr"> 9 </span> <span class="muComment"># err = 2 - 2*r</span>
<span id="L10" class="LineNr">10 </span> tmp <span class="Special">&lt;-</span> copy radius
<span id="L11" class="LineNr">11 </span> tmp <span class="Special">&lt;-</span> shift-left <span class="Constant">1</span>
<span id="L12" class="LineNr">12 </span> tmp <span class="Special">&lt;-</span> negate
<span id="L13" class="LineNr">13 </span> tmp <span class="Special">&lt;-</span> add <span class="Constant">2</span>
<span id="L14" class="LineNr">14 </span> copy-to err, tmp
<span id="L15" class="LineNr">15 </span> <span class="muComment">#</span>
<span id="L16" class="LineNr">16 </span> <span class="PreProc">var</span> tmpx/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L17" class="LineNr">17 </span> <span class="PreProc">var</span> tmpy/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L18" class="LineNr">18 </span> <span class="Delimiter">{</span>
<span id="L19" class="LineNr">19 </span> <span class="muComment"># pixel(cx-x, cy+y)</span>
<span id="L20" class="LineNr">20 </span> tmpx <span class="Special">&lt;-</span> copy cx
<span id="L21" class="LineNr">21 </span> tmpx <span class="Special">&lt;-</span> subtract x
<span id="L22" class="LineNr">22 </span> tmpy <span class="Special">&lt;-</span> copy cy
<span id="L23" class="LineNr">23 </span> tmpy <span class="Special">&lt;-</span> add y
<span id="L24" class="LineNr">24 </span> <a href='500fake-screen.mu.html#L462'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, tmpx, tmpy, color
<span id="L25" class="LineNr">25 </span> <span class="muComment"># pixel(cx-y, cy-x)</span>
<span id="L26" class="LineNr">26 </span> tmpx <span class="Special">&lt;-</span> copy cx
<span id="L27" class="LineNr">27 </span> tmpx <span class="Special">&lt;-</span> subtract y
<span id="L28" class="LineNr">28 </span> tmpy <span class="Special">&lt;-</span> copy cy
<span id="L29" class="LineNr">29 </span> tmpy <span class="Special">&lt;-</span> subtract x
<span id="L30" class="LineNr">30 </span> <a href='500fake-screen.mu.html#L462'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, tmpx, tmpy, color
<span id="L31" class="LineNr">31 </span> <span class="muComment"># pixel(cx+x, cy-y)</span>
<span id="L32" class="LineNr">32 </span> tmpx <span class="Special">&lt;-</span> copy cx
<span id="L33" class="LineNr">33 </span> tmpx <span class="Special">&lt;-</span> add x
<span id="L34" class="LineNr">34 </span> tmpy <span class="Special">&lt;-</span> copy cy
<span id="L35" class="LineNr">35 </span> tmpy <span class="Special">&lt;-</span> subtract y
<span id="L36" class="LineNr">36 </span> <a href='500fake-screen.mu.html#L462'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, tmpx, tmpy, color
<span id="L37" class="LineNr">37 </span> <span class="muComment"># pixel(cx+y, cy+x)</span>
<span id="L38" class="LineNr">38 </span> tmpx <span class="Special">&lt;-</span> copy cx
<span id="L39" class="LineNr">39 </span> tmpx <span class="Special">&lt;-</span> add y
<span id="L40" class="LineNr">40 </span> tmpy <span class="Special">&lt;-</span> copy cy
<span id="L41" class="LineNr">41 </span> tmpy <span class="Special">&lt;-</span> add x
<span id="L42" class="LineNr">42 </span> <a href='500fake-screen.mu.html#L462'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, tmpx, tmpy, color
<span id="L43" class="LineNr">43 </span> <span class="muComment"># r = err</span>
<span id="L44" class="LineNr">44 </span> tmp <span class="Special">&lt;-</span> copy err
<span id="L45" class="LineNr">45 </span> copy-to radius, tmp
<span id="L46" class="LineNr">46 </span> <span class="muComment"># if (r &lt;= y) { ++y; err += (y*2 + 1); }</span>
<span id="L47" class="LineNr">47 </span> <span class="Delimiter">{</span>
<span id="L48" class="LineNr">48 </span> tmpy <span class="Special">&lt;-</span> copy y
<span id="L49" class="LineNr">49 </span> compare radius, tmpy
<span id="L50" class="LineNr">50 </span> <span class="PreProc">break-if-&gt;</span>
<span id="L51" class="LineNr">51 </span> increment y
<span id="L52" class="LineNr">52 </span> tmpy <span class="Special">&lt;-</span> copy y
<span id="L53" class="LineNr">53 </span> tmpy <span class="Special">&lt;-</span> shift-left <span class="Constant">1</span>
<span id="L54" class="LineNr">54 </span> tmpy <span class="Special">&lt;-</span> increment
<span id="L55" class="LineNr">55 </span> add-to err, tmpy
<span id="L56" class="LineNr">56 </span> <span class="Delimiter">}</span>
<span id="L57" class="LineNr">57 </span> <span class="muComment"># if (r &gt; x || err &gt; y) { ++x; err += (x*2 + 1); }</span>
<span id="L58" class="LineNr">58 </span> $draw-circle:second-check: <span class="Delimiter">{</span>
<span id="L59" class="LineNr">59 </span> <span class="Delimiter">{</span>
<span id="L60" class="LineNr">60 </span> tmpx <span class="Special">&lt;-</span> copy x
<span id="L61" class="LineNr">61 </span> compare radius, tmpx
<span id="L62" class="LineNr">62 </span> <span class="PreProc">break-if-&gt;</span>
<span id="L63" class="LineNr">63 </span> tmpy <span class="Special">&lt;-</span> copy y
<span id="L64" class="LineNr">64 </span> compare err, tmpy
<span id="L65" class="LineNr">65 </span> <span class="PreProc">break-if-&gt;</span>
<span id="L66" class="LineNr">66 </span> <span class="PreProc">break</span> $draw-circle:second-check
<span id="L67" class="LineNr">67 </span> <span class="Delimiter">}</span>
<span id="L68" class="LineNr">68 </span> increment x
<span id="L69" class="LineNr">69 </span> tmpx <span class="Special">&lt;-</span> copy x
<span id="L70" class="LineNr">70 </span> tmpx <span class="Special">&lt;-</span> shift-left <span class="Constant">1</span>
<span id="L71" class="LineNr">71 </span> tmpx <span class="Special">&lt;-</span> increment
<span id="L72" class="LineNr">72 </span> add-to err, tmpx
<span id="L73" class="LineNr">73 </span> <span class="Delimiter">}</span>
<span id="L74" class="LineNr">74 </span> <span class="muComment"># loop termination condition</span>
<span id="L75" class="LineNr">75 </span> compare x, <span class="Constant">0</span>
<span id="L76" class="LineNr">76 </span> <span class="PreProc">loop-if-&lt;</span>
<span id="L77" class="LineNr">77 </span> <span class="Delimiter">}</span>
<span id="L78" class="LineNr">78 </span><span class="Delimiter">}</span>
<span id="L79" class="LineNr">79 </span>
<span id="L80" class="LineNr">80 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='508circle.mu.html#L80'>draw-disc</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), cx: int, cy: int, radius: int, color: int, border-color: int <span class="Delimiter">{</span>
<span id="L81" class="LineNr">81 </span> <span class="PreProc">var</span> r/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L82" class="LineNr">82 </span> <span class="Delimiter">{</span>
<span id="L83" class="LineNr">83 </span> compare r, radius
<span id="L84" class="LineNr">84 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L85" class="LineNr">85 </span> <a href='508circle.mu.html#L1'>draw-circle</a> <a href='500fake-screen.mu.html#L14'>screen</a>, cx cy, r, color
<span id="L86" class="LineNr">86 </span> r <span class="Special">&lt;-</span> increment
<span id="L87" class="LineNr">87 </span> <span class="PreProc">loop</span>
<span id="L88" class="LineNr">88 </span> <span class="Delimiter">}</span>
<span id="L89" class="LineNr">89 </span> <a href='508circle.mu.html#L1'>draw-circle</a> <a href='500fake-screen.mu.html#L14'>screen</a>, cx cy, r, border-color
<span id="L90" class="LineNr">90 </span><span class="Delimiter">}</span>
</pre>
</body>
</html>
<!-- vim: set foldmethod=manual : -->

378
html/509bezier.mu.html generated Normal file
View File

@ -0,0 +1,378 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Mu - 509bezier.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="colorscheme" content="minimal-dark">
<style type="text/css">
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #a8a8a8; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #a8a8a8; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.Special { color: #ff6060; }
.LineNr { }
.Constant { color: #008787; }
.Delimiter { color: #c000c0; }
.muFunction { color: #af5f00; text-decoration: underline; }
.muComment { color: #005faf; }
-->
</style>
<script type='text/javascript'>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
function JumpToLine()
{
var lineNum;
lineNum = window.location.hash;
lineNum = lineNum.substr(1); /* strip off '#' */
if (lineNum.indexOf('L') == -1) {
lineNum = 'L'+lineNum;
}
var lineElem = document.getElementById(lineNum);
/* Always jump to new location even if the line was hidden inside a fold, or
* we corrected the raw number to a line ID.
*/
if (lineElem) {
lineElem.scrollIntoView(true);
}
return true;
}
if ('onhashchange' in window) {
window.onhashchange = JumpToLine;
}
-->
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/main/509bezier.mu'>https://github.com/akkartik/mu/blob/main/509bezier.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># Draw a second-degree bezier curve using 3 control points.</span>
<span id="L2" class="LineNr"> 2 </span><span class="muComment">#</span>
<span id="L3" class="LineNr"> 3 </span><span class="muComment"># <a href="http://members.chello.at/easyfilter/bresenham.html">http://members.chello.at/easyfilter/bresenham.html</a> says that this algorithm</span>
<span id="L4" class="LineNr"> 4 </span><span class="muComment"># works only if &quot;the gradient does not change sign&quot;. Either:</span>
<span id="L5" class="LineNr"> 5 </span><span class="muComment"># x0 &gt;= x1 &gt;= x2</span>
<span id="L6" class="LineNr"> 6 </span><span class="muComment"># or:</span>
<span id="L7" class="LineNr"> 7 </span><span class="muComment"># x0 &lt;= x1 &lt;= x2</span>
<span id="L8" class="LineNr"> 8 </span><span class="muComment"># Similarly for y0, y1 and y2.</span>
<span id="L9" class="LineNr"> 9 </span><span class="muComment">#</span>
<span id="L10" class="LineNr"> 10 </span><span class="muComment"># This seems superficially similar to the notions of convex and concave, but I</span>
<span id="L11" class="LineNr"> 11 </span><span class="muComment"># think it isn't. I think it's purely a property of the frame of reference.</span>
<span id="L12" class="LineNr"> 12 </span><span class="muComment"># Rotating the axes can make the gradient change sign or stop changing sign</span>
<span id="L13" class="LineNr"> 13 </span><span class="muComment"># even as 3 points preserve fixed relative bearings to each other.</span>
<span id="L14" class="LineNr"> 14 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='509bezier.mu.html#L14'>draw-monotonic-bezier</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), x0: int, y0: int, x1: int, y1: int, x2: int, y2: int, color: int <span class="Delimiter">{</span>
<span id="L15" class="LineNr"> 15 </span> <span class="PreProc">var</span> xx: int
<span id="L16" class="LineNr"> 16 </span> <span class="PreProc">var</span> yy: int
<span id="L17" class="LineNr"> 17 </span> <span class="PreProc">var</span> xy: int
<span id="L18" class="LineNr"> 18 </span> <span class="PreProc">var</span> sx: int
<span id="L19" class="LineNr"> 19 </span> <span class="PreProc">var</span> sy: int
<span id="L20" class="LineNr"> 20 </span> <span class="muComment"># sx = x2-x1</span>
<span id="L21" class="LineNr"> 21 </span> <span class="PreProc">var</span> tmp/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy x2
<span id="L22" class="LineNr"> 22 </span> tmp <span class="Special">&lt;-</span> subtract x1
<span id="L23" class="LineNr"> 23 </span> copy-to sx, tmp
<span id="L24" class="LineNr"> 24 </span> <span class="muComment"># sy = y2-y1</span>
<span id="L25" class="LineNr"> 25 </span> tmp <span class="Special">&lt;-</span> copy y2
<span id="L26" class="LineNr"> 26 </span> tmp <span class="Special">&lt;-</span> subtract y1
<span id="L27" class="LineNr"> 27 </span> copy-to sy, tmp
<span id="L28" class="LineNr"> 28 </span> <span class="muComment"># xx = x0-x1</span>
<span id="L29" class="LineNr"> 29 </span> tmp <span class="Special">&lt;-</span> copy x0
<span id="L30" class="LineNr"> 30 </span> tmp <span class="Special">&lt;-</span> subtract x1
<span id="L31" class="LineNr"> 31 </span> copy-to xx, tmp
<span id="L32" class="LineNr"> 32 </span> <span class="muComment"># yy = y0-y1</span>
<span id="L33" class="LineNr"> 33 </span> tmp <span class="Special">&lt;-</span> copy y0
<span id="L34" class="LineNr"> 34 </span> tmp <span class="Special">&lt;-</span> subtract y1
<span id="L35" class="LineNr"> 35 </span> copy-to yy, tmp
<span id="L36" class="LineNr"> 36 </span> <span class="muComment"># cur = xx*sy - yy*sx</span>
<span id="L37" class="LineNr"> 37 </span> <span class="PreProc">var</span> cur-f/<span class="Constant">xmm4</span>: float <span class="Special">&lt;-</span> convert xx
<span id="L38" class="LineNr"> 38 </span> <span class="Delimiter">{</span>
<span id="L39" class="LineNr"> 39 </span> <span class="PreProc">var</span> sy-f/<span class="Constant">xmm1</span>: float <span class="Special">&lt;-</span> convert sy
<span id="L40" class="LineNr"> 40 </span> cur-f <span class="Special">&lt;-</span> multiply sy-f
<span id="L41" class="LineNr"> 41 </span> <span class="PreProc">var</span> tmp2-f/<span class="Constant">xmm1</span>: float <span class="Special">&lt;-</span> convert yy
<span id="L42" class="LineNr"> 42 </span> <span class="PreProc">var</span> sx-f/<span class="Constant">xmm2</span>: float <span class="Special">&lt;-</span> convert sx
<span id="L43" class="LineNr"> 43 </span> tmp2-f <span class="Special">&lt;-</span> multiply sx-f
<span id="L44" class="LineNr"> 44 </span> cur-f <span class="Special">&lt;-</span> subtract tmp2-f
<span id="L45" class="LineNr"> 45 </span> <span class="Delimiter">}</span>
<span id="L46" class="LineNr"> 46 </span> <span class="muComment"># if (xx*sx &gt; 0) abort</span>
<span id="L47" class="LineNr"> 47 </span> <span class="Delimiter">{</span>
<span id="L48" class="LineNr"> 48 </span> tmp <span class="Special">&lt;-</span> copy xx
<span id="L49" class="LineNr"> 49 </span> tmp <span class="Special">&lt;-</span> multiply sx
<span id="L50" class="LineNr"> 50 </span> compare tmp, <span class="Constant">0</span>
<span id="L51" class="LineNr"> 51 </span> <span class="PreProc">break-if-&lt;=</span>
<span id="L52" class="LineNr"> 52 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;bezier: gradient of x changes sign&quot;</span>
<span id="L53" class="LineNr"> 53 </span> <span class="Delimiter">}</span>
<span id="L54" class="LineNr"> 54 </span> <span class="muComment"># if (yy*sy &gt; 0) abort</span>
<span id="L55" class="LineNr"> 55 </span> <span class="Delimiter">{</span>
<span id="L56" class="LineNr"> 56 </span> tmp <span class="Special">&lt;-</span> copy yy
<span id="L57" class="LineNr"> 57 </span> tmp <span class="Special">&lt;-</span> multiply sy
<span id="L58" class="LineNr"> 58 </span> compare tmp, <span class="Constant">0</span>
<span id="L59" class="LineNr"> 59 </span> <span class="PreProc">break-if-&lt;=</span>
<span id="L60" class="LineNr"> 60 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;bezier: gradient of y changes sign&quot;</span>
<span id="L61" class="LineNr"> 61 </span> <span class="Delimiter">}</span>
<span id="L62" class="LineNr"> 62 </span> <span class="muComment"># swap P0 and P2 if necessary</span>
<span id="L63" class="LineNr"> 63 </span> <span class="Delimiter">{</span>
<span id="L64" class="LineNr"> 64 </span> <span class="muComment"># dist1 = sx*sx + sy*sy</span>
<span id="L65" class="LineNr"> 65 </span> <span class="PreProc">var</span> dist1/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy sx
<span id="L66" class="LineNr"> 66 </span> <span class="Delimiter">{</span>
<span id="L67" class="LineNr"> 67 </span> dist1 <span class="Special">&lt;-</span> multiply sx
<span id="L68" class="LineNr"> 68 </span> <span class="Delimiter">{</span>
<span id="L69" class="LineNr"> 69 </span> <span class="PreProc">break-if-not-overflow</span>
<span id="L70" class="LineNr"> 70 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;bezier: overflow 1&quot;</span>
<span id="L71" class="LineNr"> 71 </span> <span class="Delimiter">}</span>
<span id="L72" class="LineNr"> 72 </span> tmp <span class="Special">&lt;-</span> copy sy
<span id="L73" class="LineNr"> 73 </span> tmp <span class="Special">&lt;-</span> multiply sy
<span id="L74" class="LineNr"> 74 </span> <span class="Delimiter">{</span>
<span id="L75" class="LineNr"> 75 </span> <span class="PreProc">break-if-not-overflow</span>
<span id="L76" class="LineNr"> 76 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;bezier: overflow 2&quot;</span>
<span id="L77" class="LineNr"> 77 </span> <span class="Delimiter">}</span>
<span id="L78" class="LineNr"> 78 </span> dist1 <span class="Special">&lt;-</span> add tmp
<span id="L79" class="LineNr"> 79 </span> <span class="Delimiter">}</span>
<span id="L80" class="LineNr"> 80 </span> <span class="muComment"># dist2 = xx*xx + yy*yy</span>
<span id="L81" class="LineNr"> 81 </span> <span class="PreProc">var</span> dist2/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy xx
<span id="L82" class="LineNr"> 82 </span> <span class="Delimiter">{</span>
<span id="L83" class="LineNr"> 83 </span> dist2 <span class="Special">&lt;-</span> multiply xx
<span id="L84" class="LineNr"> 84 </span> <span class="Delimiter">{</span>
<span id="L85" class="LineNr"> 85 </span> <span class="PreProc">break-if-not-overflow</span>
<span id="L86" class="LineNr"> 86 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;bezier: overflow 3&quot;</span>
<span id="L87" class="LineNr"> 87 </span> <span class="Delimiter">}</span>
<span id="L88" class="LineNr"> 88 </span> tmp <span class="Special">&lt;-</span> copy yy
<span id="L89" class="LineNr"> 89 </span> tmp <span class="Special">&lt;-</span> multiply yy
<span id="L90" class="LineNr"> 90 </span> <span class="Delimiter">{</span>
<span id="L91" class="LineNr"> 91 </span> <span class="PreProc">break-if-not-overflow</span>
<span id="L92" class="LineNr"> 92 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;bezier: overflow 4&quot;</span>
<span id="L93" class="LineNr"> 93 </span> <span class="Delimiter">}</span>
<span id="L94" class="LineNr"> 94 </span> dist2 <span class="Special">&lt;-</span> add tmp
<span id="L95" class="LineNr"> 95 </span> <span class="Delimiter">}</span>
<span id="L96" class="LineNr"> 96 </span> <span class="muComment"># if (dist1 &lt;= dist2) break</span>
<span id="L97" class="LineNr"> 97 </span> compare dist1, dist2
<span id="L98" class="LineNr"> 98 </span> <span class="PreProc">break-if-&lt;=</span>
<span id="L99" class="LineNr"> 99 </span> <span class="muComment"># swap x0 and x2</span>
<span id="L100" class="LineNr">100 </span> tmp <span class="Special">&lt;-</span> copy x0
<span id="L101" class="LineNr">101 </span> copy-to x2, tmp
<span id="L102" class="LineNr">102 </span> tmp <span class="Special">&lt;-</span> copy sx
<span id="L103" class="LineNr">103 </span> tmp <span class="Special">&lt;-</span> add x1
<span id="L104" class="LineNr">104 </span> copy-to x0, tmp
<span id="L105" class="LineNr">105 </span> <span class="muComment"># swap y0 and y2</span>
<span id="L106" class="LineNr">106 </span> tmp <span class="Special">&lt;-</span> copy y0
<span id="L107" class="LineNr">107 </span> copy-to y2, tmp
<span id="L108" class="LineNr">108 </span> tmp <span class="Special">&lt;-</span> copy sy
<span id="L109" class="LineNr">109 </span> tmp <span class="Special">&lt;-</span> add y1
<span id="L110" class="LineNr">110 </span> copy-to y0, tmp
<span id="L111" class="LineNr">111 </span> <span class="muComment"># cur = -cur</span>
<span id="L112" class="LineNr">112 </span> <span class="PreProc">var</span> negative-1/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">-1</span>
<span id="L113" class="LineNr">113 </span> <span class="PreProc">var</span> negative-1-f/<span class="Constant">xmm1</span>: float <span class="Special">&lt;-</span> convert negative-1
<span id="L114" class="LineNr">114 </span> cur-f <span class="Special">&lt;-</span> multiply negative-1-f
<span id="L115" class="LineNr">115 </span> <span class="Delimiter">}</span>
<span id="L116" class="LineNr">116 </span> <span class="PreProc">var</span> x/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy x0
<span id="L117" class="LineNr">117 </span> <span class="PreProc">var</span> y/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy y0
<span id="L118" class="LineNr">118 </span> <span class="PreProc">var</span> zero-f: float
<span id="L119" class="LineNr">119 </span> <span class="muComment"># plot a curved part if necessary</span>
<span id="L120" class="LineNr">120 </span> $draw-monotonic-bezier:curve: <span class="Delimiter">{</span>
<span id="L121" class="LineNr">121 </span> compare cur-f, zero-f
<span id="L122" class="LineNr">122 </span> <span class="PreProc">break-if-=</span>
<span id="L123" class="LineNr">123 </span> <span class="muComment"># xx += sx</span>
<span id="L124" class="LineNr">124 </span> tmp <span class="Special">&lt;-</span> copy sx
<span id="L125" class="LineNr">125 </span> add-to xx, tmp
<span id="L126" class="LineNr">126 </span> <span class="muComment"># sx = sgn(x2-x)</span>
<span id="L127" class="LineNr">127 </span> tmp <span class="Special">&lt;-</span> copy x2
<span id="L128" class="LineNr">128 </span> tmp <span class="Special">&lt;-</span> subtract x
<span id="L129" class="LineNr">129 </span> tmp <span class="Special">&lt;-</span> <a href='506math.mu.html#L10'>sgn</a> tmp
<span id="L130" class="LineNr">130 </span> copy-to sx, tmp
<span id="L131" class="LineNr">131 </span> <span class="muComment"># xx *= sx</span>
<span id="L132" class="LineNr">132 </span> tmp <span class="Special">&lt;-</span> copy sx
<span id="L133" class="LineNr">133 </span> tmp <span class="Special">&lt;-</span> multiply xx
<span id="L134" class="LineNr">134 </span> copy-to xx, tmp
<span id="L135" class="LineNr">135 </span> <span class="muComment"># yy += sy</span>
<span id="L136" class="LineNr">136 </span> tmp <span class="Special">&lt;-</span> copy sy
<span id="L137" class="LineNr">137 </span> add-to yy, tmp
<span id="L138" class="LineNr">138 </span> <span class="muComment"># sy = sgn(y2-y)</span>
<span id="L139" class="LineNr">139 </span> tmp <span class="Special">&lt;-</span> copy y2
<span id="L140" class="LineNr">140 </span> tmp <span class="Special">&lt;-</span> subtract y
<span id="L141" class="LineNr">141 </span> tmp <span class="Special">&lt;-</span> <a href='506math.mu.html#L10'>sgn</a> tmp
<span id="L142" class="LineNr">142 </span> copy-to sy, tmp
<span id="L143" class="LineNr">143 </span> <span class="muComment"># yy *= sy</span>
<span id="L144" class="LineNr">144 </span> tmp <span class="Special">&lt;-</span> copy sy
<span id="L145" class="LineNr">145 </span> tmp <span class="Special">&lt;-</span> multiply yy
<span id="L146" class="LineNr">146 </span> copy-to yy, tmp
<span id="L147" class="LineNr">147 </span> <span class="muComment"># xy = 2*xx*xy</span>
<span id="L148" class="LineNr">148 </span> tmp <span class="Special">&lt;-</span> copy xx
<span id="L149" class="LineNr">149 </span> tmp <span class="Special">&lt;-</span> multiply yy
<span id="L150" class="LineNr">150 </span> <span class="Delimiter">{</span>
<span id="L151" class="LineNr">151 </span> <span class="PreProc">break-if-not-overflow</span>
<span id="L152" class="LineNr">152 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;bezier: overflow 5&quot;</span>
<span id="L153" class="LineNr">153 </span> <span class="Delimiter">}</span>
<span id="L154" class="LineNr">154 </span> tmp <span class="Special">&lt;-</span> shift-left <span class="Constant">1</span>
<span id="L155" class="LineNr">155 </span> <span class="Delimiter">{</span>
<span id="L156" class="LineNr">156 </span> <span class="PreProc">break-if-not-overflow</span>
<span id="L157" class="LineNr">157 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;bezier: overflow 6&quot;</span>
<span id="L158" class="LineNr">158 </span> <span class="Delimiter">}</span>
<span id="L159" class="LineNr">159 </span> copy-to xy, tmp
<span id="L160" class="LineNr">160 </span> <span class="muComment"># xx *= xx</span>
<span id="L161" class="LineNr">161 </span> tmp <span class="Special">&lt;-</span> copy xx
<span id="L162" class="LineNr">162 </span> tmp <span class="Special">&lt;-</span> multiply tmp
<span id="L163" class="LineNr">163 </span> <span class="Delimiter">{</span>
<span id="L164" class="LineNr">164 </span> <span class="PreProc">break-if-not-overflow</span>
<span id="L165" class="LineNr">165 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;bezier: overflow 7&quot;</span>
<span id="L166" class="LineNr">166 </span> <span class="Delimiter">}</span>
<span id="L167" class="LineNr">167 </span> copy-to xx, tmp
<span id="L168" class="LineNr">168 </span> <span class="muComment"># yy *= yy</span>
<span id="L169" class="LineNr">169 </span> tmp <span class="Special">&lt;-</span> copy yy
<span id="L170" class="LineNr">170 </span> tmp <span class="Special">&lt;-</span> multiply tmp
<span id="L171" class="LineNr">171 </span> <span class="Delimiter">{</span>
<span id="L172" class="LineNr">172 </span> <span class="PreProc">break-if-not-overflow</span>
<span id="L173" class="LineNr">173 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;bezier: overflow 7&quot;</span>
<span id="L174" class="LineNr">174 </span> <span class="Delimiter">}</span>
<span id="L175" class="LineNr">175 </span> copy-to yy, tmp
<span id="L176" class="LineNr">176 </span> <span class="muComment"># if (cur*sx*sy &lt; 0) negative curvature</span>
<span id="L177" class="LineNr">177 </span> <span class="Delimiter">{</span>
<span id="L178" class="LineNr">178 </span> <span class="PreProc">var</span> tmp-f/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> copy cur-f
<span id="L179" class="LineNr">179 </span> <span class="PreProc">var</span> sx-f/<span class="Constant">xmm1</span>: float <span class="Special">&lt;-</span> convert sx
<span id="L180" class="LineNr">180 </span> tmp-f <span class="Special">&lt;-</span> multiply sx-f
<span id="L181" class="LineNr">181 </span> <span class="PreProc">var</span> sy-f/<span class="Constant">xmm1</span>: float <span class="Special">&lt;-</span> convert sy
<span id="L182" class="LineNr">182 </span> tmp-f <span class="Special">&lt;-</span> multiply sy-f
<span id="L183" class="LineNr">183 </span> compare tmp-f, zero-f
<span id="L184" class="LineNr">184 </span> <span class="PreProc">break-if-float&gt;=</span>
<span id="L185" class="LineNr">185 </span> <span class="muComment">#</span>
<span id="L186" class="LineNr">186 </span> negate xx
<span id="L187" class="LineNr">187 </span> negate yy
<span id="L188" class="LineNr">188 </span> negate xy
<span id="L189" class="LineNr">189 </span> <span class="muComment"># cur = -cur</span>
<span id="L190" class="LineNr">190 </span> <span class="PreProc">var</span> negative-1/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">-1</span>
<span id="L191" class="LineNr">191 </span> <span class="PreProc">var</span> negative-1-f/<span class="Constant">xmm1</span>: float <span class="Special">&lt;-</span> convert negative-1
<span id="L192" class="LineNr">192 </span> cur-f <span class="Special">&lt;-</span> multiply negative-1-f
<span id="L193" class="LineNr">193 </span> <span class="Delimiter">}</span>
<span id="L194" class="LineNr">194 </span> <span class="PreProc">var</span> four/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">4</span>
<span id="L195" class="LineNr">195 </span> <span class="PreProc">var</span> dx-f/<span class="Constant">xmm5</span>: float <span class="Special">&lt;-</span> convert four
<span id="L196" class="LineNr">196 </span> <span class="PreProc">var</span> dy-f/<span class="Constant">xmm6</span>: float <span class="Special">&lt;-</span> convert four
<span id="L197" class="LineNr">197 </span> <span class="muComment"># dx = 4*sy*cur*(x1-x0) + xx - xy</span>
<span id="L198" class="LineNr">198 </span> <span class="Delimiter">{</span>
<span id="L199" class="LineNr">199 </span> <span class="PreProc">var</span> tmp/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> convert sy
<span id="L200" class="LineNr">200 </span> dx-f <span class="Special">&lt;-</span> multiply tmp
<span id="L201" class="LineNr">201 </span> dx-f <span class="Special">&lt;-</span> multiply cur-f
<span id="L202" class="LineNr">202 </span> tmp <span class="Special">&lt;-</span> convert x1
<span id="L203" class="LineNr">203 </span> <span class="PreProc">var</span> tmp2/<span class="Constant">xmm3</span>: float <span class="Special">&lt;-</span> convert x
<span id="L204" class="LineNr">204 </span> tmp <span class="Special">&lt;-</span> subtract tmp2
<span id="L205" class="LineNr">205 </span> dx-f <span class="Special">&lt;-</span> multiply tmp
<span id="L206" class="LineNr">206 </span> tmp <span class="Special">&lt;-</span> convert xx
<span id="L207" class="LineNr">207 </span> dx-f <span class="Special">&lt;-</span> add tmp
<span id="L208" class="LineNr">208 </span> tmp <span class="Special">&lt;-</span> convert xy
<span id="L209" class="LineNr">209 </span> dx-f <span class="Special">&lt;-</span> subtract tmp
<span id="L210" class="LineNr">210 </span> <span class="Delimiter">}</span>
<span id="L211" class="LineNr">211 </span> <span class="muComment"># dy-f = 4*sx*cur*(y0-y1) + yy - xy</span>
<span id="L212" class="LineNr">212 </span> <span class="Delimiter">{</span>
<span id="L213" class="LineNr">213 </span> <span class="PreProc">var</span> tmp/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> convert sx
<span id="L214" class="LineNr">214 </span> dy-f <span class="Special">&lt;-</span> multiply tmp
<span id="L215" class="LineNr">215 </span> dy-f <span class="Special">&lt;-</span> multiply cur-f
<span id="L216" class="LineNr">216 </span> tmp <span class="Special">&lt;-</span> convert y
<span id="L217" class="LineNr">217 </span> <span class="PreProc">var</span> tmp2/<span class="Constant">xmm3</span>: float <span class="Special">&lt;-</span> convert y1
<span id="L218" class="LineNr">218 </span> tmp <span class="Special">&lt;-</span> subtract tmp2
<span id="L219" class="LineNr">219 </span> dy-f <span class="Special">&lt;-</span> multiply tmp
<span id="L220" class="LineNr">220 </span> tmp <span class="Special">&lt;-</span> convert yy
<span id="L221" class="LineNr">221 </span> dy-f <span class="Special">&lt;-</span> add tmp
<span id="L222" class="LineNr">222 </span> tmp <span class="Special">&lt;-</span> convert xy
<span id="L223" class="LineNr">223 </span> dy-f <span class="Special">&lt;-</span> subtract tmp
<span id="L224" class="LineNr">224 </span> <span class="Delimiter">}</span>
<span id="L225" class="LineNr">225 </span> <span class="muComment"># xx += xx</span>
<span id="L226" class="LineNr">226 </span> tmp <span class="Special">&lt;-</span> copy xx
<span id="L227" class="LineNr">227 </span> add-to xx, tmp
<span id="L228" class="LineNr">228 </span> <span class="muComment"># yy += yy</span>
<span id="L229" class="LineNr">229 </span> tmp <span class="Special">&lt;-</span> copy yy
<span id="L230" class="LineNr">230 </span> add-to yy, tmp
<span id="L231" class="LineNr">231 </span> <span class="muComment"># err = dx+dy+xy</span>
<span id="L232" class="LineNr">232 </span> <span class="PreProc">var</span> err-f/<span class="Constant">xmm7</span>: float <span class="Special">&lt;-</span> copy dx-f
<span id="L233" class="LineNr">233 </span> err-f <span class="Special">&lt;-</span> add dy-f
<span id="L234" class="LineNr">234 </span> <span class="PreProc">var</span> xy-f/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> convert xy
<span id="L235" class="LineNr">235 </span> err-f <span class="Special">&lt;-</span> add xy-f
<span id="L236" class="LineNr">236 </span> <span class="muComment">#</span>
<span id="L237" class="LineNr">237 </span> $draw-monotonic-bezier:<span class="PreProc">loop</span>: <span class="Delimiter">{</span>
<span id="L238" class="LineNr">238 </span> <a href='500fake-screen.mu.html#L462'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y, color
<span id="L239" class="LineNr">239 </span> <span class="muComment"># if (x == x2 &amp;&amp; y == y2) return</span>
<span id="L240" class="LineNr">240 </span> <span class="Delimiter">{</span>
<span id="L241" class="LineNr">241 </span> compare x, x2
<span id="L242" class="LineNr">242 </span> <span class="PreProc">break-if-!=</span>
<span id="L243" class="LineNr">243 </span> compare y, y2
<span id="L244" class="LineNr">244 </span> <span class="PreProc">break-if-!=</span>
<span id="L245" class="LineNr">245 </span> <span class="PreProc">return</span>
<span id="L246" class="LineNr">246 </span> <span class="Delimiter">}</span>
<span id="L247" class="LineNr">247 </span> <span class="muComment"># perform-y-step? = (2*err &lt; dx)</span>
<span id="L248" class="LineNr">248 </span> <span class="PreProc">var</span> perform-y-step?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> copy <span class="Constant">0</span>/false
<span id="L249" class="LineNr">249 </span> <span class="PreProc">var</span> two-err-f/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> copy err-f
<span id="L250" class="LineNr">250 </span> <span class="Delimiter">{</span>
<span id="L251" class="LineNr">251 </span> <span class="PreProc">var</span> two/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">2</span>
<span id="L252" class="LineNr">252 </span> <span class="PreProc">var</span> two-f/<span class="Constant">xmm1</span>: float <span class="Special">&lt;-</span> convert two
<span id="L253" class="LineNr">253 </span> two-err-f <span class="Special">&lt;-</span> multiply two-f
<span id="L254" class="LineNr">254 </span> compare two-err-f, dx-f
<span id="L255" class="LineNr">255 </span> <span class="PreProc">break-if-float&gt;=</span>
<span id="L256" class="LineNr">256 </span> perform-y-step? <span class="Special">&lt;-</span> copy <span class="Constant">1</span>/true
<span id="L257" class="LineNr">257 </span> <span class="Delimiter">}</span>
<span id="L258" class="LineNr">258 </span> <span class="muComment"># if (2*err &gt; dy)</span>
<span id="L259" class="LineNr">259 </span> <span class="Delimiter">{</span>
<span id="L260" class="LineNr">260 </span> compare two-err-f, dy-f
<span id="L261" class="LineNr">261 </span> <span class="PreProc">break-if-float&lt;=</span>
<span id="L262" class="LineNr">262 </span> <span class="muComment"># x += sx</span>
<span id="L263" class="LineNr">263 </span> x <span class="Special">&lt;-</span> add sx
<span id="L264" class="LineNr">264 </span> <span class="muComment"># dx -= xy</span>
<span id="L265" class="LineNr">265 </span> <span class="PreProc">var</span> xy-f/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> convert xy
<span id="L266" class="LineNr">266 </span> dx-f <span class="Special">&lt;-</span> subtract xy-f
<span id="L267" class="LineNr">267 </span> <span class="muComment"># dy += yy</span>
<span id="L268" class="LineNr">268 </span> <span class="PreProc">var</span> yy-f/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> convert yy
<span id="L269" class="LineNr">269 </span> dy-f <span class="Special">&lt;-</span> add yy-f
<span id="L270" class="LineNr">270 </span> <span class="muComment"># err += dy</span>
<span id="L271" class="LineNr">271 </span> err-f <span class="Special">&lt;-</span> add dy-f
<span id="L272" class="LineNr">272 </span> <span class="Delimiter">}</span>
<span id="L273" class="LineNr">273 </span> <span class="muComment"># if perform-y-step?</span>
<span id="L274" class="LineNr">274 </span> <span class="Delimiter">{</span>
<span id="L275" class="LineNr">275 </span> compare perform-y-step?, <span class="Constant">0</span>/false
<span id="L276" class="LineNr">276 </span> <span class="PreProc">break-if-=</span>
<span id="L277" class="LineNr">277 </span> <span class="muComment"># y += sy</span>
<span id="L278" class="LineNr">278 </span> y <span class="Special">&lt;-</span> add sy
<span id="L279" class="LineNr">279 </span> <span class="muComment"># dy -= xy</span>
<span id="L280" class="LineNr">280 </span> <span class="PreProc">var</span> xy-f/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> convert xy
<span id="L281" class="LineNr">281 </span> dy-f <span class="Special">&lt;-</span> subtract xy-f
<span id="L282" class="LineNr">282 </span> <span class="muComment"># dx += xx</span>
<span id="L283" class="LineNr">283 </span> <span class="PreProc">var</span> xx-f/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> convert xx
<span id="L284" class="LineNr">284 </span> dx-f <span class="Special">&lt;-</span> add xx-f
<span id="L285" class="LineNr">285 </span> <span class="muComment"># err += dx</span>
<span id="L286" class="LineNr">286 </span> err-f <span class="Special">&lt;-</span> add dx-f
<span id="L287" class="LineNr">287 </span> <span class="Delimiter">}</span>
<span id="L288" class="LineNr">288 </span> <span class="muComment"># if (dy &lt; dx) loop</span>
<span id="L289" class="LineNr">289 </span> compare dy-f, dx-f
<span id="L290" class="LineNr">290 </span> <span class="PreProc">loop-if-float&lt;</span>
<span id="L291" class="LineNr">291 </span> <span class="Delimiter">}</span>
<span id="L292" class="LineNr">292 </span> <span class="Delimiter">}</span>
<span id="L293" class="LineNr">293 </span> <span class="muComment"># plot the remaining straight line</span>
<span id="L294" class="LineNr">294 </span> <a href='507line.mu.html#L1'>draw-line</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x y, x2 y2, color
<span id="L295" class="LineNr">295 </span><span class="Delimiter">}</span>
<span id="L296" class="LineNr">296 </span>
<span id="L297" class="LineNr">297 </span><span class="muComment"># 0 &lt;= u &lt;= 1</span>
<span id="L298" class="LineNr">298 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='509bezier.mu.html#L298'>bezier-point</a></span> u: float, x0: int, x1: int, x2: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
<span id="L299" class="LineNr">299 </span> <span class="PreProc">var</span> one/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">1</span>
<span id="L300" class="LineNr">300 </span> <span class="PreProc">var</span> u-prime/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> convert one
<span id="L301" class="LineNr">301 </span> u-prime <span class="Special">&lt;-</span> subtract u
<span id="L302" class="LineNr">302 </span> <span class="PreProc">var</span> result/<span class="Constant">xmm1</span>: float <span class="Special">&lt;-</span> convert x0
<span id="L303" class="LineNr">303 </span> result <span class="Special">&lt;-</span> multiply u-prime
<span id="L304" class="LineNr">304 </span> result <span class="Special">&lt;-</span> multiply u-prime
<span id="L305" class="LineNr">305 </span> <span class="PreProc">var</span> term2/<span class="Constant">xmm2</span>: float <span class="Special">&lt;-</span> convert x1
<span id="L306" class="LineNr">306 </span> term2 <span class="Special">&lt;-</span> multiply u
<span id="L307" class="LineNr">307 </span> term2 <span class="Special">&lt;-</span> multiply u-prime
<span id="L308" class="LineNr">308 </span> result <span class="Special">&lt;-</span> add term2
<span id="L309" class="LineNr">309 </span> result <span class="Special">&lt;-</span> add term2
<span id="L310" class="LineNr">310 </span> <span class="PreProc">var</span> term3/<span class="Constant">xmm2</span>: float <span class="Special">&lt;-</span> convert x2
<span id="L311" class="LineNr">311 </span> term3 <span class="Special">&lt;-</span> multiply u
<span id="L312" class="LineNr">312 </span> term3 <span class="Special">&lt;-</span> multiply u
<span id="L313" class="LineNr">313 </span> result <span class="Special">&lt;-</span> add term3
<span id="L314" class="LineNr">314 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> convert result
<span id="L315" class="LineNr">315 </span> <span class="PreProc">return</span> result
<span id="L316" class="LineNr">316 </span><span class="Delimiter">}</span>
</pre>
</body>
</html>
<!-- vim: set foldmethod=manual : -->

554
html/boot.subx.html generated
View File

@ -292,7 +292,7 @@ if ('onhashchange' in window) {
<span id="L232" class="LineNr"> 232 </span>
<span id="L233" class="LineNr"> 233 </span> fb/enable-interrupts
<span id="L234" class="LineNr"> 234 </span>
<span id="L235" class="LineNr"> 235 </span> (<a href='boot.subx.html#L1470'>initialize-mouse</a>)
<span id="L235" class="LineNr"> 235 </span> (<a href='boot.subx.html#L1492'>initialize-mouse</a>)
<span id="L236" class="LineNr"> 236 </span>
<span id="L237" class="LineNr"> 237 </span> <span class="subxComment">## enable floating point</span>
<span id="L238" class="LineNr"> 238 </span> db/floating-point-coprocessor e3/initialize
@ -514,272 +514,294 @@ if ('onhashchange' in window) {
<span id="L889" class="LineNr"> 889 </span>
<span id="L890" class="LineNr"> 890 </span>== data
<span id="L891" class="LineNr"> 891 </span>
<span id="L892" class="LineNr"> 892 </span><span class="subxComment"># We'll be gaining access just to the secondary drive on the primary bus for</span>
<span id="L893" class="LineNr"> 893 </span><span class="subxComment"># now. It will have the designated 'data' disk so we don't mess with the code</span>
<span id="L894" class="LineNr"> 894 </span><span class="subxComment"># disk.</span>
<span id="L895" class="LineNr"> 895 </span><span class="subxComment">#</span>
<span id="L896" class="LineNr"> 896 </span><span class="subxComment"># The type definition for this variable is in safe Mu (rather than unsafe</span>
<span id="L897" class="LineNr"> 897 </span><span class="subxComment"># SubX) code.</span>
<span id="L898" class="LineNr"> 898 </span><span class="subxComment"># All ports are 8-bit except data-port, which is 16-bit.</span>
<span id="L899" class="LineNr"> 899 </span><span class="SpecialChar">Primary-bus-secondary-drive</span>:
<span id="L900" class="LineNr"> 900 </span> <span class="subxComment"># command-port: int (write)</span>
<span id="L901" class="LineNr"> 901 </span> 0x1f7/imm32
<span id="L902" class="LineNr"> 902 </span> <span class="subxComment"># status-port: int (read)</span>
<span id="L903" class="LineNr"> 903 </span> 0x1f7/imm32
<span id="L904" class="LineNr"> 904 </span> <span class="subxComment"># alternative-status-port: int (read)</span>
<span id="L905" class="LineNr"> 905 </span> 0x3f6/imm32
<span id="L906" class="LineNr"> 906 </span> <span class="subxComment"># error-port: int (read)</span>
<span id="L907" class="LineNr"> 907 </span> 0x1f1/imm32
<span id="L908" class="LineNr"> 908 </span> <span class="subxComment"># drive-and-head-port: int</span>
<span id="L909" class="LineNr"> 909 </span> 0x1f6/imm32
<span id="L910" class="LineNr"> 910 </span> <span class="subxComment"># sector-count-port: int</span>
<span id="L911" class="LineNr"> 911 </span> 0x1f2/imm32
<span id="L912" class="LineNr"> 912 </span> <span class="subxComment"># lba-low-port: int</span>
<span id="L913" class="LineNr"> 913 </span> 0x1f3/imm32
<span id="L914" class="LineNr"> 914 </span> <span class="subxComment"># lba-mid-port: int</span>
<span id="L915" class="LineNr"> 915 </span> 0x1f4/imm32
<span id="L916" class="LineNr"> 916 </span> <span class="subxComment"># lba-high-port: int</span>
<span id="L917" class="LineNr"> 917 </span> 0x1f5/imm32
<span id="L918" class="LineNr"> 918 </span> <span class="subxComment"># data-port: int</span>
<span id="L919" class="LineNr"> 919 </span> 0x1f0/imm32
<span id="L920" class="LineNr"> 920 </span> <span class="subxComment"># drive-code: byte # only drive-specific field</span>
<span id="L921" class="LineNr"> 921 </span> 0xf0/imm32 <span class="subxComment"># LBA mode also enabled</span>
<span id="L922" class="LineNr"> 922 </span>
<span id="L923" class="LineNr"> 923 </span>== code
<span id="L924" class="LineNr"> 924 </span>
<span id="L925" class="LineNr"> 925 </span><span class="subxFunction">load-sectors</span>: <span class="subxComment"># disk: (addr disk), lba: int, n: int, out: (addr stream byte)</span>
<span id="L926" class="LineNr"> 926 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L927" class="LineNr"> 927 </span> 55/push-ebp
<span id="L928" class="LineNr"> 928 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L929" class="LineNr"> 929 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L930" class="LineNr"> 930 </span> 50/push-eax
<span id="L931" class="LineNr"> 931 </span> 51/push-ecx
<span id="L932" class="LineNr"> 932 </span> 52/push-edx
<span id="L933" class="LineNr"> 933 </span> <span class="subxComment"># check for drive</span>
<span id="L934" class="LineNr"> 934 </span> (<a href='boot.subx.html#L1096'>drive-exists?</a> *(ebp+8)) <span class="subxComment"># =&gt; eax</span>
<span id="L935" class="LineNr"> 935 </span> 3d/compare-eax-and 0/imm32/false
<span id="L936" class="LineNr"> 936 </span> 0f 84/jump-if-= $load-sectors:end/disp32
<span id="L937" class="LineNr"> 937 </span> <span class="subxComment"># kick off read</span>
<span id="L938" class="LineNr"> 938 </span> (<a href='boot.subx.html#L1160'>ata-drive-select</a> *(ebp+8) *(ebp+0xc))
<span id="L939" class="LineNr"> 939 </span> (<a href='boot.subx.html#L1189'>clear-ata-error</a> *(ebp+8))
<span id="L940" class="LineNr"> 940 </span> (<a href='boot.subx.html#L1211'>ata-sector-count</a> *(ebp+8) *(ebp+0x10))
<span id="L941" class="LineNr"> 941 </span> (<a href='boot.subx.html#L1233'>ata-lba</a> *(ebp+8) *(ebp+0xc))
<span id="L942" class="LineNr"> 942 </span> (<a href='boot.subx.html#L1264'>ata-command</a> *(ebp+8) 0x20) <span class="subxComment"># read sectors with retries</span>
<span id="L943" class="LineNr"> 943 </span> <span class="subxComment"># for each sector</span>
<span id="L944" class="LineNr"> 944 </span> {
<span id="L945" class="LineNr"> 945 </span> <span class="subxComment"># poll for results</span>
<span id="L946" class="LineNr"> 946 </span><span class="CommentedCode">#? (draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 &quot;waiting for sector..&quot; 7 0)</span>
<span id="L947" class="LineNr"> 947 </span> (<a href='boot.subx.html#L1286'>while-ata-busy</a> *(ebp+8))
<span id="L948" class="LineNr"> 948 </span> (<a href='boot.subx.html#L1305'>until-ata-data-available</a> *(ebp+8))
<span id="L949" class="LineNr"> 949 </span><span class="CommentedCode">#? (draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 &quot;reading\n&quot; 7 0)</span>
<span id="L950" class="LineNr"> 950 </span> <span class="subxComment"># var data-port/edx = disk-&gt;data-port</span>
<span id="L951" class="LineNr"> 951 </span> 8b/-&gt; *(ebp+8) 0/r32/eax
<span id="L952" class="LineNr"> 952 </span> 8b/-&gt; *(eax+0x24) 2/r32/edx
<span id="L953" class="LineNr"> 953 </span> <span class="subxComment"># emit results</span>
<span id="L954" class="LineNr"> 954 </span> 31/xor %eax 0/r32/eax
<span id="L955" class="LineNr"> 955 </span> b9/copy-to-ecx 0x200/imm32 <span class="subxComment"># 512 bytes per sector</span>
<span id="L956" class="LineNr"> 956 </span> {
<span id="L957" class="LineNr"> 957 </span> 81 7/subop/compare %ecx 0/imm32
<span id="L958" class="LineNr"> 958 </span> 74/jump-if-= <span class="Constant">break</span>/disp8
<span id="L959" class="LineNr"> 959 </span> 66 ed/read-port-dx-into-ax
<span id="L960" class="LineNr"> 960 </span> <span class="subxComment"># write 2 bytes to stream one at a time</span>
<span id="L961" class="LineNr"> 961 </span> (<a href='115write-byte.subx.html#L12'>append-byte</a> *(ebp+0x14) %eax)
<span id="L962" class="LineNr"> 962 </span> 49/decrement-ecx
<span id="L963" class="LineNr"> 963 </span> c1/shift 5/subop/right-padding-zeroes %eax 8/imm8
<span id="L964" class="LineNr"> 964 </span> (<a href='115write-byte.subx.html#L12'>append-byte</a> *(ebp+0x14) %eax)
<span id="L965" class="LineNr"> 965 </span> 49/decrement-ecx
<span id="L966" class="LineNr"> 966 </span> eb/jump <span class="Constant">loop</span>/disp8
<span id="L967" class="LineNr"> 967 </span> }
<span id="L968" class="LineNr"> 968 </span> <span class="subxComment"># next sector</span>
<span id="L969" class="LineNr"> 969 </span> ff 1/subop/decrement *(ebp+0x10)
<span id="L970" class="LineNr"> 970 </span><span class="CommentedCode">#? (draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0 *(ebp+0x10) 0xc 0)</span>
<span id="L971" class="LineNr"> 971 </span> 81 7/subop/compare *(ebp+0x10) 0/imm32
<span id="L972" class="LineNr"> 972 </span> 7e/jump-if-&lt;= <span class="Constant">break</span>/disp8
<span id="L973" class="LineNr"> 973 </span> (<a href='boot.subx.html#L1329'>wait-400ns</a> *(ebp+8))
<span id="L974" class="LineNr"> 974 </span><span class="CommentedCode">#? (draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 &quot;next sector\n&quot; 7 0)</span>
<span id="L975" class="LineNr"> 975 </span> e9/jump <span class="Constant">loop</span>/disp32
<span id="L976" class="LineNr"> 976 </span> }
<span id="L977" class="LineNr"> 977 </span><span class="Constant">$load-sectors:end</span>:
<span id="L978" class="LineNr"> 978 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L979" class="LineNr"> 979 </span> 5a/pop-to-edx
<span id="L980" class="LineNr"> 980 </span> 59/pop-to-ecx
<span id="L981" class="LineNr"> 981 </span> 58/pop-to-eax
<span id="L982" class="LineNr"> 982 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L983" class="LineNr"> 983 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L984" class="LineNr"> 984 </span> 5d/pop-to-ebp
<span id="L985" class="LineNr"> 985 </span> c3/return
<span id="L986" class="LineNr"> 986 </span>
<span id="L987" class="LineNr"> 987 </span><span class="subxFunction">store-sectors</span>: <span class="subxComment"># disk: (addr disk), lba: int, n: int, in: (addr stream byte)</span>
<span id="L988" class="LineNr"> 988 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L989" class="LineNr"> 989 </span> 55/push-ebp
<span id="L990" class="LineNr"> 990 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L991" class="LineNr"> 991 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L992" class="LineNr"> 992 </span> 50/push-eax
<span id="L993" class="LineNr"> 993 </span> 51/push-ecx
<span id="L994" class="LineNr"> 994 </span> 52/push-edx
<span id="L995" class="LineNr"> 995 </span> 53/push-ebx
<span id="L996" class="LineNr"> 996 </span> <span class="subxComment"># check for drive</span>
<span id="L997" class="LineNr"> 997 </span> (<a href='boot.subx.html#L1096'>drive-exists?</a> *(ebp+8)) <span class="subxComment"># =&gt; eax</span>
<span id="L998" class="LineNr"> 998 </span> 3d/compare-eax-and 0/imm32/false
<span id="L999" class="LineNr"> 999 </span> 0f 84/jump-if-= $store-sectors:end/disp32
<span id="L1000" class="LineNr">1000 </span> <span class="subxComment"># kick off write</span>
<span id="L1001" class="LineNr">1001 </span> (<a href='boot.subx.html#L1160'>ata-drive-select</a> *(ebp+8) *(ebp+0xc))
<span id="L1002" class="LineNr">1002 </span> (<a href='boot.subx.html#L1189'>clear-ata-error</a> *(ebp+8))
<span id="L1003" class="LineNr">1003 </span> (<a href='boot.subx.html#L1211'>ata-sector-count</a> *(ebp+8) *(ebp+0x10))
<span id="L1004" class="LineNr">1004 </span> (<a href='boot.subx.html#L1233'>ata-lba</a> *(ebp+8) *(ebp+0xc))
<span id="L1005" class="LineNr">1005 </span> (<a href='boot.subx.html#L1264'>ata-command</a> *(ebp+8) 0x30) <span class="subxComment"># write sectors with retries</span>
<span id="L1006" class="LineNr">1006 </span> <span class="subxComment"># for each sector</span>
<span id="L1007" class="LineNr">1007 </span><span class="CommentedCode">#? (set-cursor-position 0 0 0)</span>
<span id="L1008" class="LineNr">1008 </span><span class="CommentedCode">#? (draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 &quot;0&quot; 7 0)</span>
<span id="L1009" class="LineNr">1009 </span> {
<span id="L1010" class="LineNr">1010 </span> <span class="subxComment"># wait</span>
<span id="L1011" class="LineNr">1011 </span> (<a href='boot.subx.html#L1286'>while-ata-busy</a> *(ebp+8))
<span id="L1012" class="LineNr">1012 </span> (<a href='boot.subx.html#L1324'>until-ata-ready-for-data</a> *(ebp+8))
<span id="L1013" class="LineNr">1013 </span> <span class="subxComment"># var data-port/edx = disk-&gt;data-port</span>
<span id="L1014" class="LineNr">1014 </span> 8b/-&gt; *(ebp+8) 0/r32/eax
<span id="L1015" class="LineNr">1015 </span> 8b/-&gt; *(eax+0x24) 2/r32/edx
<span id="L1016" class="LineNr">1016 </span> <span class="subxComment"># send data</span>
<span id="L1017" class="LineNr">1017 </span> b9/copy-to-ecx 0x200/imm32 <span class="subxComment"># 512 bytes per sector</span>
<span id="L1018" class="LineNr">1018 </span> <span class="subxS1Comment"># . var first-byte/ebx: byte</span>
<span id="L1019" class="LineNr">1019 </span> <span class="subxS1Comment"># . when it's more than 0xff, we're at an even-numbered byte</span>
<span id="L1020" class="LineNr">1020 </span> bb/copy-to-ebx 0xffff/imm32
<span id="L1021" class="LineNr">1021 </span><span class="CommentedCode">#? (draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 &quot;D&quot; 7 0)</span>
<span id="L1022" class="LineNr">1022 </span><span class="Constant">$store-sectors:store-sector</span>:
<span id="L1023" class="LineNr">1023 </span> {
<span id="L1024" class="LineNr">1024 </span> 81 7/subop/compare %ecx 0/imm32
<span id="L1025" class="LineNr">1025 </span> 74/jump-if-= <span class="Constant">break</span>/disp8
<span id="L1026" class="LineNr">1026 </span> <span class="subxComment"># this loop is slow, but the ATA spec also requires a small delay</span>
<span id="L1027" class="LineNr">1027 </span> (<a href='309stream.subx.html#L6'>stream-empty?</a> *(ebp+0x14)) <span class="subxComment"># =&gt; eax</span>
<span id="L1028" class="LineNr">1028 </span> 3d/compare-eax-and 0/imm32/false
<span id="L1029" class="LineNr">1029 </span> 75/jump-if-!= <span class="Constant">break</span>/disp8
<span id="L1030" class="LineNr">1030 </span> <span class="subxComment"># read byte from stream</span>
<span id="L1031" class="LineNr">1031 </span> (<a href='112read-byte.subx.html#L13'>read-byte</a> *(ebp+0x14)) <span class="subxComment"># =&gt; eax</span>
<span id="L1032" class="LineNr">1032 </span> <span class="subxComment"># if we're at an odd-numbered byte, save it to first-byte</span>
<span id="L1033" class="LineNr">1033 </span> 81 7/subop/compare %ebx 0xff/imm32
<span id="L1034" class="LineNr">1034 </span> {
<span id="L1035" class="LineNr">1035 </span> 7e/jump-if-&lt;= <span class="Constant">break</span>/disp8
<span id="L1036" class="LineNr">1036 </span> 89/&lt;- %ebx 0/r32/eax
<span id="L1037" class="LineNr">1037 </span> eb/jump $store-sectors:store-sector/disp8
<span id="L1038" class="LineNr">1038 </span> }
<span id="L1039" class="LineNr">1039 </span> <span class="subxComment"># otherwise OR it with first-byte and write it out</span>
<span id="L1040" class="LineNr">1040 </span> c1/shift 4/subop/left %eax 8/imm8
<span id="L1041" class="LineNr">1041 </span> 09/or %eax 3/r32/ebx
<span id="L1042" class="LineNr">1042 </span> 66 ef/write-ax-into-port-dx
<span id="L1043" class="LineNr">1043 </span> 49/decrement-ecx
<span id="L1044" class="LineNr">1044 </span> 49/decrement-ecx
<span id="L1045" class="LineNr">1045 </span> <span class="subxComment"># reset first-byte</span>
<span id="L1046" class="LineNr">1046 </span> bb/copy-to-ebx 0xffff/imm32
<span id="L1047" class="LineNr">1047 </span> eb/jump <span class="Constant">loop</span>/disp8
<span id="L1048" class="LineNr">1048 </span> }
<span id="L1049" class="LineNr">1049 </span> <span class="subxComment"># write out final first-byte if necessary</span>
<span id="L1050" class="LineNr">1050 </span><span class="CommentedCode">#? (draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 &quot;I&quot; 7 0)</span>
<span id="L1051" class="LineNr">1051 </span> 81 7/subop/compare %ebx 0xff/imm32
<span id="L1052" class="LineNr">1052 </span> {
<span id="L1053" class="LineNr">1053 </span> 7f/jump-if-&gt; <span class="Constant">break</span>/disp8
<span id="L1054" class="LineNr">1054 </span> 89/&lt;- %eax 3/r32/ebx
<span id="L1055" class="LineNr">1055 </span> 66 ef/write-ax-into-port-dx
<span id="L1056" class="LineNr">1056 </span> 49/decrement-ecx
<span id="L1057" class="LineNr">1057 </span> 49/decrement-ecx
<span id="L1058" class="LineNr">1058 </span> }
<span id="L1059" class="LineNr">1059 </span> <span class="subxComment"># pad zeroes</span>
<span id="L1060" class="LineNr">1060 </span><span class="CommentedCode">#? (draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 &quot;P&quot; 7 0)</span>
<span id="L1061" class="LineNr">1061 </span> 31/xor %eax 0/r32/eax
<span id="L1062" class="LineNr">1062 </span> {
<span id="L1063" class="LineNr">1063 </span> 81 7/subop/compare %ecx 0/imm32
<span id="L1064" class="LineNr">1064 </span> 74/jump-if-= <span class="Constant">break</span>/disp8
<span id="L1065" class="LineNr">1065 </span> 66 ef/write-ax-into-port-dx
<span id="L892" class="LineNr"> 892 </span><span class="subxComment"># code disk</span>
<span id="L893" class="LineNr"> 893 </span><span class="subxComment"># All ports are 8-bit except data-port, which is 16-bit.</span>
<span id="L894" class="LineNr"> 894 </span><span class="SpecialChar">Primary-bus-primary-drive</span>:
<span id="L895" class="LineNr"> 895 </span> <span class="subxComment"># command-port: int (write)</span>
<span id="L896" class="LineNr"> 896 </span> 0x1f7/imm32
<span id="L897" class="LineNr"> 897 </span> <span class="subxComment"># status-port: int (read)</span>
<span id="L898" class="LineNr"> 898 </span> 0x1f7/imm32
<span id="L899" class="LineNr"> 899 </span> <span class="subxComment"># alternative-status-port: int (read)</span>
<span id="L900" class="LineNr"> 900 </span> 0x3f6/imm32
<span id="L901" class="LineNr"> 901 </span> <span class="subxComment"># error-port: int (read)</span>
<span id="L902" class="LineNr"> 902 </span> 0x1f1/imm32
<span id="L903" class="LineNr"> 903 </span> <span class="subxComment"># drive-and-head-port: int</span>
<span id="L904" class="LineNr"> 904 </span> 0x1f6/imm32
<span id="L905" class="LineNr"> 905 </span> <span class="subxComment"># sector-count-port: int</span>
<span id="L906" class="LineNr"> 906 </span> 0x1f2/imm32
<span id="L907" class="LineNr"> 907 </span> <span class="subxComment"># lba-low-port: int</span>
<span id="L908" class="LineNr"> 908 </span> 0x1f3/imm32
<span id="L909" class="LineNr"> 909 </span> <span class="subxComment"># lba-mid-port: int</span>
<span id="L910" class="LineNr"> 910 </span> 0x1f4/imm32
<span id="L911" class="LineNr"> 911 </span> <span class="subxComment"># lba-high-port: int</span>
<span id="L912" class="LineNr"> 912 </span> 0x1f5/imm32
<span id="L913" class="LineNr"> 913 </span> <span class="subxComment"># data-port: int</span>
<span id="L914" class="LineNr"> 914 </span> 0x1f0/imm32
<span id="L915" class="LineNr"> 915 </span> <span class="subxComment"># drive-code: byte # only drive-specific field</span>
<span id="L916" class="LineNr"> 916 </span> 0xe0/imm32 <span class="subxComment"># LBA mode also enabled</span>
<span id="L917" class="LineNr"> 917 </span>
<span id="L918" class="LineNr"> 918 </span><span class="subxComment"># data disk</span>
<span id="L919" class="LineNr"> 919 </span><span class="subxComment"># All ports are 8-bit except data-port, which is 16-bit.</span>
<span id="L920" class="LineNr"> 920 </span><span class="SpecialChar">Primary-bus-secondary-drive</span>:
<span id="L921" class="LineNr"> 921 </span> <span class="subxComment"># command-port: int (write)</span>
<span id="L922" class="LineNr"> 922 </span> 0x1f7/imm32
<span id="L923" class="LineNr"> 923 </span> <span class="subxComment"># status-port: int (read)</span>
<span id="L924" class="LineNr"> 924 </span> 0x1f7/imm32
<span id="L925" class="LineNr"> 925 </span> <span class="subxComment"># alternative-status-port: int (read)</span>
<span id="L926" class="LineNr"> 926 </span> 0x3f6/imm32
<span id="L927" class="LineNr"> 927 </span> <span class="subxComment"># error-port: int (read)</span>
<span id="L928" class="LineNr"> 928 </span> 0x1f1/imm32
<span id="L929" class="LineNr"> 929 </span> <span class="subxComment"># drive-and-head-port: int</span>
<span id="L930" class="LineNr"> 930 </span> 0x1f6/imm32
<span id="L931" class="LineNr"> 931 </span> <span class="subxComment"># sector-count-port: int</span>
<span id="L932" class="LineNr"> 932 </span> 0x1f2/imm32
<span id="L933" class="LineNr"> 933 </span> <span class="subxComment"># lba-low-port: int</span>
<span id="L934" class="LineNr"> 934 </span> 0x1f3/imm32
<span id="L935" class="LineNr"> 935 </span> <span class="subxComment"># lba-mid-port: int</span>
<span id="L936" class="LineNr"> 936 </span> 0x1f4/imm32
<span id="L937" class="LineNr"> 937 </span> <span class="subxComment"># lba-high-port: int</span>
<span id="L938" class="LineNr"> 938 </span> 0x1f5/imm32
<span id="L939" class="LineNr"> 939 </span> <span class="subxComment"># data-port: int</span>
<span id="L940" class="LineNr"> 940 </span> 0x1f0/imm32
<span id="L941" class="LineNr"> 941 </span> <span class="subxComment"># drive-code: byte # only drive-specific field</span>
<span id="L942" class="LineNr"> 942 </span> 0xf0/imm32 <span class="subxComment"># LBA mode also enabled</span>
<span id="L943" class="LineNr"> 943 </span>
<span id="L944" class="LineNr"> 944 </span>== code
<span id="L945" class="LineNr"> 945 </span>
<span id="L946" class="LineNr"> 946 </span><span class="subxFunction">load-sectors</span>: <span class="subxComment"># disk: (addr disk), lba: int, n: int, out: (addr stream byte)</span>
<span id="L947" class="LineNr"> 947 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L948" class="LineNr"> 948 </span> 55/push-ebp
<span id="L949" class="LineNr"> 949 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L950" class="LineNr"> 950 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L951" class="LineNr"> 951 </span> 50/push-eax
<span id="L952" class="LineNr"> 952 </span> 51/push-ecx
<span id="L953" class="LineNr"> 953 </span> 52/push-edx
<span id="L954" class="LineNr"> 954 </span> <span class="subxComment"># check for drive</span>
<span id="L955" class="LineNr"> 955 </span> (<a href='boot.subx.html#L1118'>drive-exists?</a> *(ebp+8)) <span class="subxComment"># =&gt; eax</span>
<span id="L956" class="LineNr"> 956 </span> 3d/compare-eax-and 0/imm32/false
<span id="L957" class="LineNr"> 957 </span> 0f 84/jump-if-= $load-sectors:end/disp32
<span id="L958" class="LineNr"> 958 </span> <span class="subxComment"># kick off read</span>
<span id="L959" class="LineNr"> 959 </span> (<a href='boot.subx.html#L1182'>ata-drive-select</a> *(ebp+8) *(ebp+0xc))
<span id="L960" class="LineNr"> 960 </span> (<a href='boot.subx.html#L1211'>clear-ata-error</a> *(ebp+8))
<span id="L961" class="LineNr"> 961 </span> (<a href='boot.subx.html#L1233'>ata-sector-count</a> *(ebp+8) *(ebp+0x10))
<span id="L962" class="LineNr"> 962 </span> (<a href='boot.subx.html#L1255'>ata-lba</a> *(ebp+8) *(ebp+0xc))
<span id="L963" class="LineNr"> 963 </span> (<a href='boot.subx.html#L1286'>ata-command</a> *(ebp+8) 0x20) <span class="subxComment"># read sectors with retries</span>
<span id="L964" class="LineNr"> 964 </span> <span class="subxComment"># for each sector</span>
<span id="L965" class="LineNr"> 965 </span> {
<span id="L966" class="LineNr"> 966 </span> <span class="subxComment"># poll for results</span>
<span id="L967" class="LineNr"> 967 </span><span class="CommentedCode">#? (draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 &quot;waiting for sector..&quot; 7 0)</span>
<span id="L968" class="LineNr"> 968 </span><span class="CommentedCode">#? (draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 &quot;.&quot; 7 0)</span>
<span id="L969" class="LineNr"> 969 </span> (<a href='boot.subx.html#L1308'>while-ata-busy</a> *(ebp+8))
<span id="L970" class="LineNr"> 970 </span> (<a href='boot.subx.html#L1327'>until-ata-data-available</a> *(ebp+8))
<span id="L971" class="LineNr"> 971 </span><span class="CommentedCode">#? (draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 &quot;reading\n&quot; 7 0)</span>
<span id="L972" class="LineNr"> 972 </span> <span class="subxComment"># var data-port/edx = disk-&gt;data-port</span>
<span id="L973" class="LineNr"> 973 </span> 8b/-&gt; *(ebp+8) 0/r32/eax
<span id="L974" class="LineNr"> 974 </span> 8b/-&gt; *(eax+0x24) 2/r32/edx
<span id="L975" class="LineNr"> 975 </span> <span class="subxComment"># emit results</span>
<span id="L976" class="LineNr"> 976 </span> 31/xor %eax 0/r32/eax
<span id="L977" class="LineNr"> 977 </span> b9/copy-to-ecx 0x200/imm32 <span class="subxComment"># 512 bytes per sector</span>
<span id="L978" class="LineNr"> 978 </span> {
<span id="L979" class="LineNr"> 979 </span> 81 7/subop/compare %ecx 0/imm32
<span id="L980" class="LineNr"> 980 </span> 74/jump-if-= <span class="Constant">break</span>/disp8
<span id="L981" class="LineNr"> 981 </span> 66 ed/read-port-dx-into-ax
<span id="L982" class="LineNr"> 982 </span> <span class="subxComment"># write 2 bytes to stream one at a time</span>
<span id="L983" class="LineNr"> 983 </span> (<a href='115write-byte.subx.html#L12'>append-byte</a> *(ebp+0x14) %eax)
<span id="L984" class="LineNr"> 984 </span> 49/decrement-ecx
<span id="L985" class="LineNr"> 985 </span> c1/shift 5/subop/right-padding-zeroes %eax 8/imm8
<span id="L986" class="LineNr"> 986 </span> (<a href='115write-byte.subx.html#L12'>append-byte</a> *(ebp+0x14) %eax)
<span id="L987" class="LineNr"> 987 </span> 49/decrement-ecx
<span id="L988" class="LineNr"> 988 </span> eb/jump <span class="Constant">loop</span>/disp8
<span id="L989" class="LineNr"> 989 </span> }
<span id="L990" class="LineNr"> 990 </span> <span class="subxComment"># next sector</span>
<span id="L991" class="LineNr"> 991 </span> ff 1/subop/decrement *(ebp+0x10)
<span id="L992" class="LineNr"> 992 </span><span class="CommentedCode">#? (draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0 *(ebp+0x10) 0xc 0)</span>
<span id="L993" class="LineNr"> 993 </span> 81 7/subop/compare *(ebp+0x10) 0/imm32
<span id="L994" class="LineNr"> 994 </span> 7e/jump-if-&lt;= <span class="Constant">break</span>/disp8
<span id="L995" class="LineNr"> 995 </span> (<a href='boot.subx.html#L1351'>wait-400ns</a> *(ebp+8))
<span id="L996" class="LineNr"> 996 </span><span class="CommentedCode">#? (draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 &quot;next sector\n&quot; 7 0)</span>
<span id="L997" class="LineNr"> 997 </span> e9/jump <span class="Constant">loop</span>/disp32
<span id="L998" class="LineNr"> 998 </span> }
<span id="L999" class="LineNr"> 999 </span><span class="Constant">$load-sectors:end</span>:
<span id="L1000" class="LineNr">1000 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L1001" class="LineNr">1001 </span> 5a/pop-to-edx
<span id="L1002" class="LineNr">1002 </span> 59/pop-to-ecx
<span id="L1003" class="LineNr">1003 </span> 58/pop-to-eax
<span id="L1004" class="LineNr">1004 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L1005" class="LineNr">1005 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L1006" class="LineNr">1006 </span> 5d/pop-to-ebp
<span id="L1007" class="LineNr">1007 </span> c3/return
<span id="L1008" class="LineNr">1008 </span>
<span id="L1009" class="LineNr">1009 </span><span class="subxFunction">store-sectors</span>: <span class="subxComment"># disk: (addr disk), lba: int, n: int, in: (addr stream byte)</span>
<span id="L1010" class="LineNr">1010 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L1011" class="LineNr">1011 </span> 55/push-ebp
<span id="L1012" class="LineNr">1012 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L1013" class="LineNr">1013 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L1014" class="LineNr">1014 </span> 50/push-eax
<span id="L1015" class="LineNr">1015 </span> 51/push-ecx
<span id="L1016" class="LineNr">1016 </span> 52/push-edx
<span id="L1017" class="LineNr">1017 </span> 53/push-ebx
<span id="L1018" class="LineNr">1018 </span> <span class="subxComment"># check for drive</span>
<span id="L1019" class="LineNr">1019 </span> (<a href='boot.subx.html#L1118'>drive-exists?</a> *(ebp+8)) <span class="subxComment"># =&gt; eax</span>
<span id="L1020" class="LineNr">1020 </span> 3d/compare-eax-and 0/imm32/false
<span id="L1021" class="LineNr">1021 </span> 0f 84/jump-if-= $store-sectors:end/disp32
<span id="L1022" class="LineNr">1022 </span> <span class="subxComment"># kick off write</span>
<span id="L1023" class="LineNr">1023 </span> (<a href='boot.subx.html#L1182'>ata-drive-select</a> *(ebp+8) *(ebp+0xc))
<span id="L1024" class="LineNr">1024 </span> (<a href='boot.subx.html#L1211'>clear-ata-error</a> *(ebp+8))
<span id="L1025" class="LineNr">1025 </span> (<a href='boot.subx.html#L1233'>ata-sector-count</a> *(ebp+8) *(ebp+0x10))
<span id="L1026" class="LineNr">1026 </span> (<a href='boot.subx.html#L1255'>ata-lba</a> *(ebp+8) *(ebp+0xc))
<span id="L1027" class="LineNr">1027 </span> (<a href='boot.subx.html#L1286'>ata-command</a> *(ebp+8) 0x30) <span class="subxComment"># write sectors with retries</span>
<span id="L1028" class="LineNr">1028 </span> <span class="subxComment"># for each sector</span>
<span id="L1029" class="LineNr">1029 </span><span class="CommentedCode">#? (set-cursor-position 0 0 0)</span>
<span id="L1030" class="LineNr">1030 </span><span class="CommentedCode">#? (draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 &quot;0&quot; 7 0)</span>
<span id="L1031" class="LineNr">1031 </span> {
<span id="L1032" class="LineNr">1032 </span> <span class="subxComment"># wait</span>
<span id="L1033" class="LineNr">1033 </span> (<a href='boot.subx.html#L1308'>while-ata-busy</a> *(ebp+8))
<span id="L1034" class="LineNr">1034 </span> (<a href='boot.subx.html#L1346'>until-ata-ready-for-data</a> *(ebp+8))
<span id="L1035" class="LineNr">1035 </span> <span class="subxComment"># var data-port/edx = disk-&gt;data-port</span>
<span id="L1036" class="LineNr">1036 </span> 8b/-&gt; *(ebp+8) 0/r32/eax
<span id="L1037" class="LineNr">1037 </span> 8b/-&gt; *(eax+0x24) 2/r32/edx
<span id="L1038" class="LineNr">1038 </span> <span class="subxComment"># send data</span>
<span id="L1039" class="LineNr">1039 </span> b9/copy-to-ecx 0x200/imm32 <span class="subxComment"># 512 bytes per sector</span>
<span id="L1040" class="LineNr">1040 </span> <span class="subxS1Comment"># . var first-byte/ebx: byte</span>
<span id="L1041" class="LineNr">1041 </span> <span class="subxS1Comment"># . when it's more than 0xff, we're at an even-numbered byte</span>
<span id="L1042" class="LineNr">1042 </span> bb/copy-to-ebx 0xffff/imm32
<span id="L1043" class="LineNr">1043 </span><span class="CommentedCode">#? (draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 &quot;D&quot; 7 0)</span>
<span id="L1044" class="LineNr">1044 </span><span class="Constant">$store-sectors:store-sector</span>:
<span id="L1045" class="LineNr">1045 </span> {
<span id="L1046" class="LineNr">1046 </span> 81 7/subop/compare %ecx 0/imm32
<span id="L1047" class="LineNr">1047 </span> 74/jump-if-= <span class="Constant">break</span>/disp8
<span id="L1048" class="LineNr">1048 </span> <span class="subxComment"># this loop is slow, but the ATA spec also requires a small delay</span>
<span id="L1049" class="LineNr">1049 </span> (<a href='309stream.subx.html#L6'>stream-empty?</a> *(ebp+0x14)) <span class="subxComment"># =&gt; eax</span>
<span id="L1050" class="LineNr">1050 </span> 3d/compare-eax-and 0/imm32/false
<span id="L1051" class="LineNr">1051 </span> 75/jump-if-!= <span class="Constant">break</span>/disp8
<span id="L1052" class="LineNr">1052 </span> <span class="subxComment"># read byte from stream</span>
<span id="L1053" class="LineNr">1053 </span> (<a href='112read-byte.subx.html#L13'>read-byte</a> *(ebp+0x14)) <span class="subxComment"># =&gt; eax</span>
<span id="L1054" class="LineNr">1054 </span> <span class="subxComment"># if we're at an odd-numbered byte, save it to first-byte</span>
<span id="L1055" class="LineNr">1055 </span> 81 7/subop/compare %ebx 0xff/imm32
<span id="L1056" class="LineNr">1056 </span> {
<span id="L1057" class="LineNr">1057 </span> 7e/jump-if-&lt;= <span class="Constant">break</span>/disp8
<span id="L1058" class="LineNr">1058 </span> 89/&lt;- %ebx 0/r32/eax
<span id="L1059" class="LineNr">1059 </span> eb/jump $store-sectors:store-sector/disp8
<span id="L1060" class="LineNr">1060 </span> }
<span id="L1061" class="LineNr">1061 </span> <span class="subxComment"># otherwise OR it with first-byte and write it out</span>
<span id="L1062" class="LineNr">1062 </span> c1/shift 4/subop/left %eax 8/imm8
<span id="L1063" class="LineNr">1063 </span> 09/or %eax 3/r32/ebx
<span id="L1064" class="LineNr">1064 </span> 66 ef/write-ax-into-port-dx
<span id="L1065" class="LineNr">1065 </span> 49/decrement-ecx
<span id="L1066" class="LineNr">1066 </span> 49/decrement-ecx
<span id="L1067" class="LineNr">1067 </span> 49/decrement-ecx
<span id="L1068" class="LineNr">1068 </span> eb/jump <span class="Constant">loop</span>/disp8
<span id="L1069" class="LineNr">1069 </span> }
<span id="L1070" class="LineNr">1070 </span> <span class="subxComment"># next sector</span>
<span id="L1071" class="LineNr">1071 </span><span class="CommentedCode">#? (draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 &quot;N&quot; 7 0)</span>
<span id="L1072" class="LineNr">1072 </span> ff 1/subop/decrement *(ebp+0x10)
<span id="L1073" class="LineNr">1073 </span> 81 7/subop/compare *(ebp+0x10) 0/imm32
<span id="L1074" class="LineNr">1074 </span> 7e/jump-if-&lt;= <span class="Constant">break</span>/disp8
<span id="L1075" class="LineNr">1075 </span><span class="CommentedCode">#? (draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 &quot;W&quot; 7 0)</span>
<span id="L1076" class="LineNr">1076 </span> (<a href='boot.subx.html#L1329'>wait-400ns</a> *(ebp+8))
<span id="L1077" class="LineNr">1077 </span><span class="CommentedCode">#? (draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 &quot;L&quot; 7 0)</span>
<span id="L1078" class="LineNr">1078 </span> e9/jump <span class="Constant">loop</span>/disp32
<span id="L1079" class="LineNr">1079 </span> }
<span id="L1080" class="LineNr">1080 </span><span class="CommentedCode">#? (draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 &quot;F&quot; 7 0)</span>
<span id="L1081" class="LineNr">1081 </span> (<a href='boot.subx.html#L1363'>flush-ata-cache</a> *(ebp+8))
<span id="L1082" class="LineNr">1082 </span><span class="CommentedCode">#? (draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 &quot;Y&quot; 7 0)</span>
<span id="L1083" class="LineNr">1083 </span><span class="Constant">$store-sectors:end</span>:
<span id="L1084" class="LineNr">1084 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L1085" class="LineNr">1085 </span> 5b/pop-to-ebx
<span id="L1086" class="LineNr">1086 </span> 5a/pop-to-edx
<span id="L1087" class="LineNr">1087 </span> 59/pop-to-ecx
<span id="L1088" class="LineNr">1088 </span> 58/pop-to-eax
<span id="L1089" class="LineNr">1089 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L1090" class="LineNr">1090 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L1091" class="LineNr">1091 </span> 5d/pop-to-ebp
<span id="L1092" class="LineNr">1092 </span> c3/return
<span id="L1093" class="LineNr">1093 </span>
<span id="L1094" class="Folded">1094 </span><span class="Folded">+--289 lines: # disk helpers ------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="L1383" class="LineNr">1383 </span>
<span id="L1384" class="LineNr">1384 </span><span class="subxComment">## Controlling a PS/2 mouse</span>
<span id="L1385" class="LineNr">1385 </span><span class="subxComment"># Uses no IRQs, just polling.</span>
<span id="L1386" class="LineNr">1386 </span><span class="subxComment"># Thanks Dave Long: <a href="https://github.com/jtauber/cleese/blob/master/necco/kernel/bochs/py8042.py">https://github.com/jtauber/cleese/blob/master/necco/kernel/bochs/py8042.py</a></span>
<span id="L1387" class="LineNr">1387 </span><span class="subxComment">#</span>
<span id="L1388" class="LineNr">1388 </span><span class="subxComment"># Resources:</span>
<span id="L1389" class="LineNr">1389 </span><span class="subxComment"># <a href="https://wiki.osdev.org/Mouse_Input">https://wiki.osdev.org/Mouse_Input</a></span>
<span id="L1390" class="LineNr">1390 </span>
<span id="L1391" class="LineNr">1391 </span><span class="subxComment"># results x/eax, y/ecx range from -256 to +255</span>
<span id="L1392" class="LineNr">1392 </span><span class="subxComment"># See <a href="https://wiki.osdev.org/index.php?title=Mouse_Input&amp;oldid=25663#Format_of_First_3_Packet_Bytes">https://wiki.osdev.org/index.php?title=Mouse_Input&amp;oldid=25663#Format_of_First_3_Packet_Bytes</a></span>
<span id="L1393" class="LineNr">1393 </span><span class="subxFunction">read-mouse-event</span>: <span class="subxComment"># -&gt; _/eax: int, _/ecx: int</span>
<span id="L1394" class="LineNr">1394 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L1395" class="LineNr">1395 </span> 55/push-ebp
<span id="L1396" class="LineNr">1396 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L1397" class="LineNr">1397 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L1398" class="LineNr">1398 </span> 52/push-edx
<span id="L1399" class="LineNr">1399 </span> 53/push-ebx
<span id="L1400" class="LineNr">1400 </span> <span class="subxComment"># if no event, return 0, 0</span>
<span id="L1401" class="LineNr">1401 </span> b8/copy-to-eax 0/imm32
<span id="L1402" class="LineNr">1402 </span> b9/copy-to-ecx 0/imm32
<span id="L1403" class="LineNr">1403 </span> (<a href='boot.subx.html#L1460'>any-mouse-event?</a>) <span class="subxComment"># =&gt; eax</span>
<span id="L1404" class="LineNr">1404 </span> 3d/compare-eax-and 0/imm32/false
<span id="L1405" class="LineNr">1405 </span> 74/jump-if-= $read-mouse-event:end/disp8
<span id="L1406" class="LineNr">1406 </span> <span class="subxComment"># var f1/edx: byte = inb(0x60)</span>
<span id="L1407" class="LineNr">1407 </span> 31/xor %eax 0/r32/eax
<span id="L1408" class="LineNr">1408 </span> e4/read-port-into-al 0x60/imm8
<span id="L1409" class="LineNr">1409 </span> 89/&lt;- %edx 0/r32/eax
<span id="L1410" class="LineNr">1410 </span> (<a href='boot.subx.html#L1445'>wait-for-mouse-event</a>)
<span id="L1411" class="LineNr">1411 </span> <span class="subxComment"># var dx/ebx: byte = inb(0x60)</span>
<span id="L1412" class="LineNr">1412 </span> 31/xor %eax 0/r32/eax
<span id="L1413" class="LineNr">1413 </span> e4/read-port-into-al 0x60/imm8
<span id="L1414" class="LineNr">1414 </span> 89/&lt;- %ebx 0/r32/eax
<span id="L1415" class="LineNr">1415 </span> (<a href='boot.subx.html#L1445'>wait-for-mouse-event</a>)
<span id="L1416" class="LineNr">1416 </span> <span class="subxComment"># var dy/ecx: byte = inb(0x60)</span>
<span id="L1417" class="LineNr">1417 </span> 31/xor %eax 0/r32/eax
<span id="L1418" class="LineNr">1418 </span> e4/read-port-into-al 0x60/imm8
<span id="L1419" class="LineNr">1419 </span> 89/&lt;- %ecx 0/r32/eax
<span id="L1420" class="LineNr">1420 </span> <span class="subxComment"># eax = dx</span>
<span id="L1421" class="LineNr">1421 </span> 89/&lt;- %eax 3/r32/ebx
<span id="L1422" class="LineNr">1422 </span> <span class="subxComment"># if (f1 &amp; 0x10) dx = -dx</span>
<span id="L1423" class="LineNr">1423 </span> {
<span id="L1424" class="LineNr">1424 </span> f6 0/subop/test-bits %dl 0x10/imm8
<span id="L1425" class="LineNr">1425 </span> 74/jump-if-zero <span class="Constant">break</span>/disp8
<span id="L1426" class="LineNr">1426 </span> 0d/or-eax-with 0xffffff00/imm32
<span id="L1427" class="LineNr">1427 </span> }
<span id="L1428" class="LineNr">1428 </span> <span class="subxComment"># if (f1 &amp; 0x20) dy = -dy</span>
<span id="L1429" class="LineNr">1429 </span> {
<span id="L1430" class="LineNr">1430 </span> f6 0/subop/test-bits %dl 0x20/imm8
<span id="L1431" class="LineNr">1431 </span> 74/jump-if-zero <span class="Constant">break</span>/disp8
<span id="L1432" class="LineNr">1432 </span> 81 1/subop/or %ecx 0xffffff00/imm32
<span id="L1433" class="LineNr">1433 </span> }
<span id="L1434" class="LineNr">1434 </span><span class="Constant">$read-mouse-event:end</span>:
<span id="L1435" class="LineNr">1435 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L1436" class="LineNr">1436 </span> 5b/pop-to-ebx
<span id="L1437" class="LineNr">1437 </span> 5a/pop-to-edx
<span id="L1438" class="LineNr">1438 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L1439" class="LineNr">1439 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L1440" class="LineNr">1440 </span> 5d/pop-to-ebp
<span id="L1441" class="LineNr">1441 </span> c3/return
<span id="L1442" class="LineNr">1442 </span>
<span id="L1443" class="Folded">1443 </span><span class="Folded">+--147 lines: # mouse helpers -----------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="L1590" class="LineNr">1590 </span>
<span id="L1591" class="LineNr">1591 </span><span class="subxComment"># vim&#0058;ft=subx</span>
<span id="L1067" class="LineNr">1067 </span> <span class="subxComment"># reset first-byte</span>
<span id="L1068" class="LineNr">1068 </span> bb/copy-to-ebx 0xffff/imm32
<span id="L1069" class="LineNr">1069 </span> eb/jump <span class="Constant">loop</span>/disp8
<span id="L1070" class="LineNr">1070 </span> }
<span id="L1071" class="LineNr">1071 </span> <span class="subxComment"># write out final first-byte if necessary</span>
<span id="L1072" class="LineNr">1072 </span><span class="CommentedCode">#? (draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 &quot;I&quot; 7 0)</span>
<span id="L1073" class="LineNr">1073 </span> 81 7/subop/compare %ebx 0xff/imm32
<span id="L1074" class="LineNr">1074 </span> {
<span id="L1075" class="LineNr">1075 </span> 7f/jump-if-&gt; <span class="Constant">break</span>/disp8
<span id="L1076" class="LineNr">1076 </span> 89/&lt;- %eax 3/r32/ebx
<span id="L1077" class="LineNr">1077 </span> 66 ef/write-ax-into-port-dx
<span id="L1078" class="LineNr">1078 </span> 49/decrement-ecx
<span id="L1079" class="LineNr">1079 </span> 49/decrement-ecx
<span id="L1080" class="LineNr">1080 </span> }
<span id="L1081" class="LineNr">1081 </span> <span class="subxComment"># pad zeroes</span>
<span id="L1082" class="LineNr">1082 </span><span class="CommentedCode">#? (draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 &quot;P&quot; 7 0)</span>
<span id="L1083" class="LineNr">1083 </span> 31/xor %eax 0/r32/eax
<span id="L1084" class="LineNr">1084 </span> {
<span id="L1085" class="LineNr">1085 </span> 81 7/subop/compare %ecx 0/imm32
<span id="L1086" class="LineNr">1086 </span> 74/jump-if-= <span class="Constant">break</span>/disp8
<span id="L1087" class="LineNr">1087 </span> 66 ef/write-ax-into-port-dx
<span id="L1088" class="LineNr">1088 </span> 49/decrement-ecx
<span id="L1089" class="LineNr">1089 </span> 49/decrement-ecx
<span id="L1090" class="LineNr">1090 </span> eb/jump <span class="Constant">loop</span>/disp8
<span id="L1091" class="LineNr">1091 </span> }
<span id="L1092" class="LineNr">1092 </span> <span class="subxComment"># next sector</span>
<span id="L1093" class="LineNr">1093 </span><span class="CommentedCode">#? (draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 &quot;N&quot; 7 0)</span>
<span id="L1094" class="LineNr">1094 </span> ff 1/subop/decrement *(ebp+0x10)
<span id="L1095" class="LineNr">1095 </span> 81 7/subop/compare *(ebp+0x10) 0/imm32
<span id="L1096" class="LineNr">1096 </span> 7e/jump-if-&lt;= <span class="Constant">break</span>/disp8
<span id="L1097" class="LineNr">1097 </span><span class="CommentedCode">#? (draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 &quot;W&quot; 7 0)</span>
<span id="L1098" class="LineNr">1098 </span> (<a href='boot.subx.html#L1351'>wait-400ns</a> *(ebp+8))
<span id="L1099" class="LineNr">1099 </span><span class="CommentedCode">#? (draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 &quot;L&quot; 7 0)</span>
<span id="L1100" class="LineNr">1100 </span> e9/jump <span class="Constant">loop</span>/disp32
<span id="L1101" class="LineNr">1101 </span> }
<span id="L1102" class="LineNr">1102 </span><span class="CommentedCode">#? (draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 &quot;F&quot; 7 0)</span>
<span id="L1103" class="LineNr">1103 </span> (<a href='boot.subx.html#L1385'>flush-ata-cache</a> *(ebp+8))
<span id="L1104" class="LineNr">1104 </span><span class="CommentedCode">#? (draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 &quot;Y&quot; 7 0)</span>
<span id="L1105" class="LineNr">1105 </span><span class="Constant">$store-sectors:end</span>:
<span id="L1106" class="LineNr">1106 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L1107" class="LineNr">1107 </span> 5b/pop-to-ebx
<span id="L1108" class="LineNr">1108 </span> 5a/pop-to-edx
<span id="L1109" class="LineNr">1109 </span> 59/pop-to-ecx
<span id="L1110" class="LineNr">1110 </span> 58/pop-to-eax
<span id="L1111" class="LineNr">1111 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L1112" class="LineNr">1112 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L1113" class="LineNr">1113 </span> 5d/pop-to-ebp
<span id="L1114" class="LineNr">1114 </span> c3/return
<span id="L1115" class="LineNr">1115 </span>
<span id="L1116" class="Folded">1116 </span><span class="Folded">+--289 lines: # disk helpers ------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="L1405" class="LineNr">1405 </span>
<span id="L1406" class="LineNr">1406 </span><span class="subxComment">## Controlling a PS/2 mouse</span>
<span id="L1407" class="LineNr">1407 </span><span class="subxComment"># Uses no IRQs, just polling.</span>
<span id="L1408" class="LineNr">1408 </span><span class="subxComment"># Thanks Dave Long: <a href="https://github.com/jtauber/cleese/blob/master/necco/kernel/bochs/py8042.py">https://github.com/jtauber/cleese/blob/master/necco/kernel/bochs/py8042.py</a></span>
<span id="L1409" class="LineNr">1409 </span><span class="subxComment">#</span>
<span id="L1410" class="LineNr">1410 </span><span class="subxComment"># Resources:</span>
<span id="L1411" class="LineNr">1411 </span><span class="subxComment"># <a href="https://wiki.osdev.org/Mouse_Input">https://wiki.osdev.org/Mouse_Input</a></span>
<span id="L1412" class="LineNr">1412 </span>
<span id="L1413" class="LineNr">1413 </span><span class="subxComment"># results x/eax, y/ecx range from -256 to +255</span>
<span id="L1414" class="LineNr">1414 </span><span class="subxComment"># See <a href="https://wiki.osdev.org/index.php?title=Mouse_Input&amp;oldid=25663#Format_of_First_3_Packet_Bytes">https://wiki.osdev.org/index.php?title=Mouse_Input&amp;oldid=25663#Format_of_First_3_Packet_Bytes</a></span>
<span id="L1415" class="LineNr">1415 </span><span class="subxFunction">read-mouse-event</span>: <span class="subxComment"># -&gt; _/eax: int, _/ecx: int</span>
<span id="L1416" class="LineNr">1416 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L1417" class="LineNr">1417 </span> 55/push-ebp
<span id="L1418" class="LineNr">1418 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L1419" class="LineNr">1419 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L1420" class="LineNr">1420 </span> 52/push-edx
<span id="L1421" class="LineNr">1421 </span> 53/push-ebx
<span id="L1422" class="LineNr">1422 </span> <span class="subxComment"># if no event, return 0, 0</span>
<span id="L1423" class="LineNr">1423 </span> b8/copy-to-eax 0/imm32
<span id="L1424" class="LineNr">1424 </span> b9/copy-to-ecx 0/imm32
<span id="L1425" class="LineNr">1425 </span> (<a href='boot.subx.html#L1482'>any-mouse-event?</a>) <span class="subxComment"># =&gt; eax</span>
<span id="L1426" class="LineNr">1426 </span> 3d/compare-eax-and 0/imm32/false
<span id="L1427" class="LineNr">1427 </span> 74/jump-if-= $read-mouse-event:end/disp8
<span id="L1428" class="LineNr">1428 </span> <span class="subxComment"># var f1/edx: byte = inb(0x60)</span>
<span id="L1429" class="LineNr">1429 </span> 31/xor %eax 0/r32/eax
<span id="L1430" class="LineNr">1430 </span> e4/read-port-into-al 0x60/imm8
<span id="L1431" class="LineNr">1431 </span> 89/&lt;- %edx 0/r32/eax
<span id="L1432" class="LineNr">1432 </span> (<a href='boot.subx.html#L1467'>wait-for-mouse-event</a>)
<span id="L1433" class="LineNr">1433 </span> <span class="subxComment"># var dx/ebx: byte = inb(0x60)</span>
<span id="L1434" class="LineNr">1434 </span> 31/xor %eax 0/r32/eax
<span id="L1435" class="LineNr">1435 </span> e4/read-port-into-al 0x60/imm8
<span id="L1436" class="LineNr">1436 </span> 89/&lt;- %ebx 0/r32/eax
<span id="L1437" class="LineNr">1437 </span> (<a href='boot.subx.html#L1467'>wait-for-mouse-event</a>)
<span id="L1438" class="LineNr">1438 </span> <span class="subxComment"># var dy/ecx: byte = inb(0x60)</span>
<span id="L1439" class="LineNr">1439 </span> 31/xor %eax 0/r32/eax
<span id="L1440" class="LineNr">1440 </span> e4/read-port-into-al 0x60/imm8
<span id="L1441" class="LineNr">1441 </span> 89/&lt;- %ecx 0/r32/eax
<span id="L1442" class="LineNr">1442 </span> <span class="subxComment"># eax = dx</span>
<span id="L1443" class="LineNr">1443 </span> 89/&lt;- %eax 3/r32/ebx
<span id="L1444" class="LineNr">1444 </span> <span class="subxComment"># if (f1 &amp; 0x10) dx = -dx</span>
<span id="L1445" class="LineNr">1445 </span> {
<span id="L1446" class="LineNr">1446 </span> f6 0/subop/test-bits %dl 0x10/imm8
<span id="L1447" class="LineNr">1447 </span> 74/jump-if-zero <span class="Constant">break</span>/disp8
<span id="L1448" class="LineNr">1448 </span> 0d/or-eax-with 0xffffff00/imm32
<span id="L1449" class="LineNr">1449 </span> }
<span id="L1450" class="LineNr">1450 </span> <span class="subxComment"># if (f1 &amp; 0x20) dy = -dy</span>
<span id="L1451" class="LineNr">1451 </span> {
<span id="L1452" class="LineNr">1452 </span> f6 0/subop/test-bits %dl 0x20/imm8
<span id="L1453" class="LineNr">1453 </span> 74/jump-if-zero <span class="Constant">break</span>/disp8
<span id="L1454" class="LineNr">1454 </span> 81 1/subop/or %ecx 0xffffff00/imm32
<span id="L1455" class="LineNr">1455 </span> }
<span id="L1456" class="LineNr">1456 </span><span class="Constant">$read-mouse-event:end</span>:
<span id="L1457" class="LineNr">1457 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L1458" class="LineNr">1458 </span> 5b/pop-to-ebx
<span id="L1459" class="LineNr">1459 </span> 5a/pop-to-edx
<span id="L1460" class="LineNr">1460 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L1461" class="LineNr">1461 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L1462" class="LineNr">1462 </span> 5d/pop-to-ebp
<span id="L1463" class="LineNr">1463 </span> c3/return
<span id="L1464" class="LineNr">1464 </span>
<span id="L1465" class="Folded">1465 </span><span class="Folded">+--147 lines: # mouse helpers -----------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="L1612" class="LineNr">1612 </span>
<span id="L1613" class="LineNr">1613 </span><span class="subxComment"># vim&#0058;ft=subx</span>
</pre>
</body>
</html>

6
html/colors.mu.html generated
View File

@ -121,7 +121,7 @@ if ('onhashchange' in window) {
<span id="L62" class="LineNr"> 62 </span> <span class="PreProc">var</span> valid?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='118parse-hex-int.subx.html#L701'>hex-digit?</a> tmp
<span id="L63" class="LineNr"> 63 </span> compare valid?, <span class="Constant">0</span>/false
<span id="L64" class="LineNr"> 64 </span> <span class="PreProc">break-if-!=</span>
<span id="L65" class="LineNr"> 65 </span> <a href='501draw-text.mu.html#L481'>abort</a> <span class="Constant">&quot;invalid byte 0 of r&quot;</span>
<span id="L65" class="LineNr"> 65 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;invalid byte 0 of r&quot;</span>
<span id="L66" class="LineNr"> 66 </span> <span class="Delimiter">}</span>
<span id="L67" class="LineNr"> 67 </span> tmp <span class="Special">&lt;-</span> <a href='colors.mu.html#L169'>fast-hex-digit-value</a> tmp
<span id="L68" class="LineNr"> 68 </span> <span class="PreProc">var</span> r/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy tmp
@ -155,7 +155,7 @@ if ('onhashchange' in window) {
<span id="L96" class="LineNr"> 96 </span> <span class="PreProc">var</span> valid?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='118parse-hex-int.subx.html#L701'>hex-digit?</a> tmp
<span id="L97" class="LineNr"> 97 </span> compare valid?, <span class="Constant">0</span>/false
<span id="L98" class="LineNr"> 98 </span> <span class="PreProc">break-if-!=</span>
<span id="L99" class="LineNr"> 99 </span> <a href='501draw-text.mu.html#L481'>abort</a> <span class="Constant">&quot;invalid byte 0 of g&quot;</span>
<span id="L99" class="LineNr"> 99 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;invalid byte 0 of g&quot;</span>
<span id="L100" class="LineNr">100 </span> <span class="Delimiter">}</span>
<span id="L101" class="LineNr">101 </span> tmp <span class="Special">&lt;-</span> <a href='colors.mu.html#L169'>fast-hex-digit-value</a> tmp
<span id="L102" class="LineNr">102 </span> <span class="PreProc">var</span> g/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy tmp
@ -189,7 +189,7 @@ if ('onhashchange' in window) {
<span id="L130" class="LineNr">130 </span> <span class="PreProc">var</span> valid?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='118parse-hex-int.subx.html#L701'>hex-digit?</a> tmp
<span id="L131" class="LineNr">131 </span> compare valid?, <span class="Constant">0</span>/false
<span id="L132" class="LineNr">132 </span> <span class="PreProc">break-if-!=</span>
<span id="L133" class="LineNr">133 </span> <a href='501draw-text.mu.html#L481'>abort</a> <span class="Constant">&quot;invalid byte 0 of b&quot;</span>
<span id="L133" class="LineNr">133 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;invalid byte 0 of b&quot;</span>
<span id="L134" class="LineNr">134 </span> <span class="Delimiter">}</span>
<span id="L135" class="LineNr">135 </span> tmp <span class="Special">&lt;-</span> <a href='colors.mu.html#L169'>fast-hex-digit-value</a> tmp
<span id="L136" class="LineNr">136 </span> <span class="PreProc">var</span> b/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy tmp

2
html/ex10.mu.html generated
View File

@ -74,7 +74,7 @@ if ('onhashchange' in window) {
<span id="L16" class="LineNr">16 </span> $main:event-loop: <span class="Delimiter">{</span>
<span id="L17" class="LineNr">17 </span> <span class="PreProc">var</span> dx/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L18" class="LineNr">18 </span> <span class="PreProc">var</span> dy/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L19" class="LineNr">19 </span> dx, dy <span class="Special">&lt;-</span> <a href='boot.subx.html#L1393'>read-mouse-event</a>
<span id="L19" class="LineNr">19 </span> dx, dy <span class="Special">&lt;-</span> <a href='boot.subx.html#L1415'>read-mouse-event</a>
<span id="L20" class="LineNr">20 </span> <span class="Delimiter">{</span>
<span id="L21" class="LineNr">21 </span> compare dx, <span class="Constant">0</span>
<span id="L22" class="LineNr">22 </span> <span class="PreProc">break-if-!=</span>

323
html/ex11.mu.html generated Normal file
View File

@ -0,0 +1,323 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Mu - ex11.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="colorscheme" content="minimal-dark">
<style type="text/css">
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #a8a8a8; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #a8a8a8; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.Special { color: #ff6060; }
.LineNr { }
.Constant { color: #008787; }
.Delimiter { color: #c000c0; }
.muFunction { color: #af5f00; text-decoration: underline; }
.muComment { color: #005faf; }
-->
</style>
<script type='text/javascript'>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
function JumpToLine()
{
var lineNum;
lineNum = window.location.hash;
lineNum = lineNum.substr(1); /* strip off '#' */
if (lineNum.indexOf('L') == -1) {
lineNum = 'L'+lineNum;
}
var lineElem = document.getElementById(lineNum);
/* Always jump to new location even if the line was hidden inside a fold, or
* we corrected the raw number to a line ID.
*/
if (lineElem) {
lineElem.scrollIntoView(true);
}
return true;
}
if ('onhashchange' in window) {
window.onhashchange = JumpToLine;
}
-->
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/main/ex11.mu'>https://github.com/akkartik/mu/blob/main/ex11.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># Demo of an interactive app: controlling a Bezier curve on screen</span>
<span id="L2" class="LineNr"> 2 </span><span class="muComment">#</span>
<span id="L3" class="LineNr"> 3 </span><span class="muComment"># To build a disk image:</span>
<span id="L4" class="LineNr"> 4 </span><span class="muComment"># ./translate ex11.mu # emits code.img</span>
<span id="L5" class="LineNr"> 5 </span><span class="muComment"># To run:</span>
<span id="L6" class="LineNr"> 6 </span><span class="muComment"># qemu-system-i386 code.img</span>
<span id="L7" class="LineNr"> 7 </span><span class="muComment"># Or:</span>
<span id="L8" class="LineNr"> 8 </span><span class="muComment"># bochs -f bochsrc # bochsrc loads code.img</span>
<span id="L9" class="LineNr"> 9 </span><span class="muComment">#</span>
<span id="L10" class="LineNr"> 10 </span><span class="muComment"># Expected output: a spline with 3 control points. Use `Tab` to switch cursor</span>
<span id="L11" class="LineNr"> 11 </span><span class="muComment"># between control points, and arrow keys to move the control point at the</span>
<span id="L12" class="LineNr"> 12 </span><span class="muComment"># cursor.</span>
<span id="L13" class="LineNr"> 13 </span>
<span id="L14" class="LineNr"> 14 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L14'>main</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L15" class="LineNr"> 15 </span> <span class="PreProc">var</span> env-storage: <a href='ex11.mu.html#L25'>environment</a>
<span id="L16" class="LineNr"> 16 </span> <span class="PreProc">var</span> env/<span class="Constant">esi</span>: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Special">&lt;-</span> address env-storage
<span id="L17" class="LineNr"> 17 </span> <a href='ex11.mu.html#L233'>initialize-environment</a> env, <span class="Constant">0x200</span> <span class="Constant">0x20</span>, <span class="Constant">0x180</span> <span class="Constant">0x90</span>, <span class="Constant">0x180</span> <span class="Constant">0x160</span>
<span id="L18" class="LineNr"> 18 </span> <span class="Delimiter">{</span>
<span id="L19" class="LineNr"> 19 </span> <a href='ex11.mu.html#L37'>render</a> <a href='500fake-screen.mu.html#L14'>screen</a>, env
<span id="L20" class="LineNr"> 20 </span> <a href='ex11.mu.html#L101'>edit</a> keyboard, env
<span id="L21" class="LineNr"> 21 </span> <span class="PreProc">loop</span>
<span id="L22" class="LineNr"> 22 </span> <span class="Delimiter">}</span>
<span id="L23" class="LineNr"> 23 </span><span class="Delimiter">}</span>
<span id="L24" class="LineNr"> 24 </span>
<span id="L25" class="LineNr"> 25 </span><span class="PreProc">type</span> <a href='ex11.mu.html#L25'>environment</a> <span class="Delimiter">{</span>
<span id="L26" class="LineNr"> 26 </span> p0: (handle <a href='ex11.mu.html#L32'>point</a>)
<span id="L27" class="LineNr"> 27 </span> p1: (handle <a href='ex11.mu.html#L32'>point</a>)
<span id="L28" class="LineNr"> 28 </span> p2: (handle <a href='ex11.mu.html#L32'>point</a>)
<span id="L29" class="LineNr"> 29 </span> <a href='ex11.mu.html#L77'>cursor</a>: (handle <a href='ex11.mu.html#L32'>point</a>) <span class="muComment"># one of p0, p1 or p2</span>
<span id="L30" class="LineNr"> 30 </span><span class="Delimiter">}</span>
<span id="L31" class="LineNr"> 31 </span>
<span id="L32" class="LineNr"> 32 </span><span class="PreProc">type</span> <a href='ex11.mu.html#L32'>point</a> <span class="Delimiter">{</span>
<span id="L33" class="LineNr"> 33 </span> x: int
<span id="L34" class="LineNr"> 34 </span> y: int
<span id="L35" class="LineNr"> 35 </span><span class="Delimiter">}</span>
<span id="L36" class="LineNr"> 36 </span>
<span id="L37" class="LineNr"> 37 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L37'>render</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), _self: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Delimiter">{</span>
<span id="L38" class="LineNr"> 38 </span> <a href='500fake-screen.mu.html#L230'>clear-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L39" class="LineNr"> 39 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Special">&lt;-</span> copy _self
<span id="L40" class="LineNr"> 40 </span> <span class="PreProc">var</span> tmp-ah/<span class="Constant">ecx</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> get self, p0
<span id="L41" class="LineNr"> 41 </span> <span class="PreProc">var</span> tmp/<span class="Constant">eax</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *tmp-ah
<span id="L42" class="LineNr"> 42 </span> <span class="PreProc">var</span> p0/<span class="Constant">ebx</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> copy tmp
<span id="L43" class="LineNr"> 43 </span> tmp-ah <span class="Special">&lt;-</span> get self, p1
<span id="L44" class="LineNr"> 44 </span> tmp <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *tmp-ah
<span id="L45" class="LineNr"> 45 </span> <span class="PreProc">var</span> p1/<span class="Constant">edx</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> copy tmp
<span id="L46" class="LineNr"> 46 </span> tmp-ah <span class="Special">&lt;-</span> get self, p2
<span id="L47" class="LineNr"> 47 </span> tmp <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *tmp-ah
<span id="L48" class="LineNr"> 48 </span> <span class="PreProc">var</span> p2/<span class="Constant">ecx</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> copy tmp
<span id="L49" class="LineNr"> 49 </span> <span class="muComment"># control lines</span>
<span id="L50" class="LineNr"> 50 </span> <a href='ex11.mu.html#L216'>line</a> <a href='500fake-screen.mu.html#L14'>screen</a>, p0, p1, <span class="Constant">7</span>/color
<span id="L51" class="LineNr"> 51 </span> <a href='ex11.mu.html#L216'>line</a> <a href='500fake-screen.mu.html#L14'>screen</a>, p1, p2, <span class="Constant">7</span>/color
<span id="L52" class="LineNr"> 52 </span> <span class="muComment"># curve above control lines</span>
<span id="L53" class="LineNr"> 53 </span> <a href='ex11.mu.html#L64'>bezier</a> <a href='500fake-screen.mu.html#L14'>screen</a>, p0, p1, p2, <span class="Constant">0xc</span>/color
<span id="L54" class="LineNr"> 54 </span> <span class="muComment"># points above curve</span>
<span id="L55" class="LineNr"> 55 </span> <a href='ex11.mu.html#L226'>disc</a> <a href='500fake-screen.mu.html#L14'>screen</a>, p0, <span class="Constant">3</span>/radius, <span class="Constant">7</span>/color <span class="Constant">0xf</span>/border
<span id="L56" class="LineNr"> 56 </span> <a href='ex11.mu.html#L226'>disc</a> <a href='500fake-screen.mu.html#L14'>screen</a>, p1, <span class="Constant">3</span>/radius, <span class="Constant">7</span>/color <span class="Constant">0xf</span>/border
<span id="L57" class="LineNr"> 57 </span> <a href='ex11.mu.html#L226'>disc</a> <a href='500fake-screen.mu.html#L14'>screen</a>, p2, <span class="Constant">3</span>/radius, <span class="Constant">7</span>/color <span class="Constant">0xf</span>/border
<span id="L58" class="LineNr"> 58 </span> <span class="muComment"># cursor last of all</span>
<span id="L59" class="LineNr"> 59 </span> <span class="PreProc">var</span> cursor-ah/<span class="Constant">eax</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> get self, <a href='ex11.mu.html#L77'>cursor</a>
<span id="L60" class="LineNr"> 60 </span> <span class="PreProc">var</span> <a href='ex11.mu.html#L77'>cursor</a>/<span class="Constant">eax</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *cursor-ah
<span id="L61" class="LineNr"> 61 </span> <a href='ex11.mu.html#L77'>cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <a href='ex11.mu.html#L77'>cursor</a>, <span class="Constant">0xa</span>/side, <span class="Constant">3</span>/color
<span id="L62" class="LineNr"> 62 </span><span class="Delimiter">}</span>
<span id="L63" class="LineNr"> 63 </span>
<span id="L64" class="LineNr"> 64 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L64'>bezier</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), _p0: (addr <a href='ex11.mu.html#L32'>point</a>), _p1: (addr <a href='ex11.mu.html#L32'>point</a>), _p2: (addr <a href='ex11.mu.html#L32'>point</a>), color: int <span class="Delimiter">{</span>
<span id="L65" class="LineNr"> 65 </span> <span class="PreProc">var</span> p0/<span class="Constant">esi</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> copy _p0
<span id="L66" class="LineNr"> 66 </span> <span class="PreProc">var</span> x0/<span class="Constant">ecx</span>: (addr int) <span class="Special">&lt;-</span> get p0, x
<span id="L67" class="LineNr"> 67 </span> <span class="PreProc">var</span> y0/<span class="Constant">edx</span>: (addr int) <span class="Special">&lt;-</span> get p0, y
<span id="L68" class="LineNr"> 68 </span> <span class="PreProc">var</span> p1/<span class="Constant">esi</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> copy _p1
<span id="L69" class="LineNr"> 69 </span> <span class="PreProc">var</span> x1/<span class="Constant">ebx</span>: (addr int) <span class="Special">&lt;-</span> get p1, x
<span id="L70" class="LineNr"> 70 </span> <span class="PreProc">var</span> y1/<span class="Constant">eax</span>: (addr int) <span class="Special">&lt;-</span> get p1, y
<span id="L71" class="LineNr"> 71 </span> <span class="PreProc">var</span> p2/<span class="Constant">esi</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> copy _p2
<span id="L72" class="LineNr"> 72 </span> <span class="PreProc">var</span> x2/<span class="Constant">edi</span>: (addr int) <span class="Special">&lt;-</span> get p2, x
<span id="L73" class="LineNr"> 73 </span> <span class="PreProc">var</span> y2/<span class="Constant">esi</span>: (addr int) <span class="Special">&lt;-</span> get p2, y
<span id="L74" class="LineNr"> 74 </span> <a href='509bezier.mu.html#L14'>draw-monotonic-bezier</a> <a href='500fake-screen.mu.html#L14'>screen</a>, *x0 *y0, *x1 *y1, *x2 *y2, color
<span id="L75" class="LineNr"> 75 </span><span class="Delimiter">}</span>
<span id="L76" class="LineNr"> 76 </span>
<span id="L77" class="LineNr"> 77 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L77'>cursor</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), _p: (addr <a href='ex11.mu.html#L32'>point</a>), side: int, color: int <span class="Delimiter">{</span>
<span id="L78" class="LineNr"> 78 </span> <span class="PreProc">var</span> half-side/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy side
<span id="L79" class="LineNr"> 79 </span> half-side <span class="Special">&lt;-</span> shift-right <span class="Constant">1</span>
<span id="L80" class="LineNr"> 80 </span> <span class="PreProc">var</span> p/<span class="Constant">esi</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> copy _p
<span id="L81" class="LineNr"> 81 </span> <span class="PreProc">var</span> x-a/<span class="Constant">ecx</span>: (addr int) <span class="Special">&lt;-</span> get p, x
<span id="L82" class="LineNr"> 82 </span> <span class="PreProc">var</span> left-x/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy *x-a
<span id="L83" class="LineNr"> 83 </span> left-x <span class="Special">&lt;-</span> subtract half-side
<span id="L84" class="LineNr"> 84 </span> <span class="PreProc">var</span> y-a/<span class="Constant">edx</span>: (addr int) <span class="Special">&lt;-</span> get p, y
<span id="L85" class="LineNr"> 85 </span> <span class="PreProc">var</span> top-y/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy *y-a
<span id="L86" class="LineNr"> 86 </span> top-y <span class="Special">&lt;-</span> subtract half-side
<span id="L87" class="LineNr"> 87 </span> <span class="PreProc">var</span> max/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy left-x
<span id="L88" class="LineNr"> 88 </span> max <span class="Special">&lt;-</span> add side
<span id="L89" class="LineNr"> 89 </span> <a href='507line.mu.html#L64'>draw-horizontal-line</a> <a href='500fake-screen.mu.html#L14'>screen</a>, top-y, left-x, max, color
<span id="L90" class="LineNr"> 90 </span> max <span class="Special">&lt;-</span> copy top-y
<span id="L91" class="LineNr"> 91 </span> max <span class="Special">&lt;-</span> add side
<span id="L92" class="LineNr"> 92 </span> <a href='507line.mu.html#L75'>draw-vertical-line</a> <a href='500fake-screen.mu.html#L14'>screen</a>, left-x, top-y, max, color
<span id="L93" class="LineNr"> 93 </span> <span class="PreProc">var</span> right-x/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy left-x
<span id="L94" class="LineNr"> 94 </span> right-x <span class="Special">&lt;-</span> add side
<span id="L95" class="LineNr"> 95 </span> <a href='507line.mu.html#L75'>draw-vertical-line</a> <a href='500fake-screen.mu.html#L14'>screen</a>, right-x, top-y, max, color
<span id="L96" class="LineNr"> 96 </span> <span class="PreProc">var</span> bottom-y/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy top-y
<span id="L97" class="LineNr"> 97 </span> bottom-y <span class="Special">&lt;-</span> add side
<span id="L98" class="LineNr"> 98 </span> <a href='507line.mu.html#L64'>draw-horizontal-line</a> <a href='500fake-screen.mu.html#L14'>screen</a>, bottom-y, left-x, right-x, color
<span id="L99" class="LineNr"> 99 </span><span class="Delimiter">}</span>
<span id="L100" class="LineNr">100 </span>
<span id="L101" class="LineNr">101 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L101'>edit</a></span> keyboard: (addr keyboard), _self: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Delimiter">{</span>
<span id="L102" class="LineNr">102 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Special">&lt;-</span> copy _self
<span id="L103" class="LineNr">103 </span> <span class="PreProc">var</span> key/<span class="Constant">eax</span>: byte <span class="Special">&lt;-</span> <a href='102keyboard.subx.html#L21'>read-key</a> keyboard
<span id="L104" class="LineNr">104 </span> compare key, <span class="Constant">0</span>
<span id="L105" class="LineNr">105 </span> <span class="PreProc">loop-if-=</span>
<span id="L106" class="LineNr">106 </span> <span class="Delimiter">{</span>
<span id="L107" class="LineNr">107 </span> compare key, <span class="Constant">9</span>/tab
<span id="L108" class="LineNr">108 </span> <span class="PreProc">break-if-!=</span>
<span id="L109" class="LineNr">109 </span> <a href='ex11.mu.html#L138'>toggle-cursor</a> self
<span id="L110" class="LineNr">110 </span> <span class="PreProc">return</span>
<span id="L111" class="LineNr">111 </span> <span class="Delimiter">}</span>
<span id="L112" class="LineNr">112 </span> <span class="Delimiter">{</span>
<span id="L113" class="LineNr">113 </span> compare key, <span class="Constant">0x80</span>/left-arrow
<span id="L114" class="LineNr">114 </span> <span class="PreProc">break-if-!=</span>
<span id="L115" class="LineNr">115 </span> <a href='ex11.mu.html#L168'>cursor-left</a> self
<span id="L116" class="LineNr">116 </span> <span class="PreProc">return</span>
<span id="L117" class="LineNr">117 </span> <span class="Delimiter">}</span>
<span id="L118" class="LineNr">118 </span> <span class="Delimiter">{</span>
<span id="L119" class="LineNr">119 </span> compare key, <span class="Constant">0x83</span>/right-arrow
<span id="L120" class="LineNr">120 </span> <span class="PreProc">break-if-!=</span>
<span id="L121" class="LineNr">121 </span> <a href='ex11.mu.html#L180'>cursor-right</a> self
<span id="L122" class="LineNr">122 </span> <span class="PreProc">return</span>
<span id="L123" class="LineNr">123 </span> <span class="Delimiter">}</span>
<span id="L124" class="LineNr">124 </span> <span class="Delimiter">{</span>
<span id="L125" class="LineNr">125 </span> compare key, <span class="Constant">0x81</span>/down-arrow
<span id="L126" class="LineNr">126 </span> <span class="PreProc">break-if-!=</span>
<span id="L127" class="LineNr">127 </span> <a href='ex11.mu.html#L204'>cursor-down</a> self
<span id="L128" class="LineNr">128 </span> <span class="PreProc">return</span>
<span id="L129" class="LineNr">129 </span> <span class="Delimiter">}</span>
<span id="L130" class="LineNr">130 </span> <span class="Delimiter">{</span>
<span id="L131" class="LineNr">131 </span> compare key, <span class="Constant">0x82</span>/up-arrow
<span id="L132" class="LineNr">132 </span> <span class="PreProc">break-if-!=</span>
<span id="L133" class="LineNr">133 </span> <a href='ex11.mu.html#L192'>cursor-up</a> self
<span id="L134" class="LineNr">134 </span> <span class="PreProc">return</span>
<span id="L135" class="LineNr">135 </span> <span class="Delimiter">}</span>
<span id="L136" class="LineNr">136 </span><span class="Delimiter">}</span>
<span id="L137" class="LineNr">137 </span>
<span id="L138" class="LineNr">138 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L138'>toggle-cursor</a></span> _self: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Delimiter">{</span>
<span id="L139" class="LineNr">139 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Special">&lt;-</span> copy _self
<span id="L140" class="LineNr">140 </span> <span class="PreProc">var</span> cursor-ah/<span class="Constant">edi</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> get self, <a href='ex11.mu.html#L77'>cursor</a>
<span id="L141" class="LineNr">141 </span> <span class="PreProc">var</span> p0-ah/<span class="Constant">ecx</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> get self, p0
<span id="L142" class="LineNr">142 </span> <span class="PreProc">var</span> p1-ah/<span class="Constant">edx</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> get self, p1
<span id="L143" class="LineNr">143 </span> <span class="PreProc">var</span> p2-ah/<span class="Constant">ebx</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> get self, p2
<span id="L144" class="LineNr">144 </span> <span class="Delimiter">{</span>
<span id="L145" class="LineNr">145 </span> <span class="PreProc">var</span> p0?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L448'>handle-equal?</a> *p0-ah, *cursor-ah
<span id="L146" class="LineNr">146 </span> compare p0?, <span class="Constant">0</span>/false
<span id="L147" class="LineNr">147 </span> <span class="PreProc">break-if-=</span>
<span id="L148" class="LineNr">148 </span> copy-object p1-ah, cursor-ah
<span id="L149" class="LineNr">149 </span> <span class="PreProc">return</span>
<span id="L150" class="LineNr">150 </span> <span class="Delimiter">}</span>
<span id="L151" class="LineNr">151 </span> <span class="Delimiter">{</span>
<span id="L152" class="LineNr">152 </span> <span class="PreProc">var</span> p1?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L448'>handle-equal?</a> *p1-ah, *cursor-ah
<span id="L153" class="LineNr">153 </span> compare p1?, <span class="Constant">0</span>/false
<span id="L154" class="LineNr">154 </span> <span class="PreProc">break-if-=</span>
<span id="L155" class="LineNr">155 </span> copy-object p2-ah, cursor-ah
<span id="L156" class="LineNr">156 </span> <span class="PreProc">return</span>
<span id="L157" class="LineNr">157 </span> <span class="Delimiter">}</span>
<span id="L158" class="LineNr">158 </span> <span class="Delimiter">{</span>
<span id="L159" class="LineNr">159 </span> <span class="PreProc">var</span> p2?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L448'>handle-equal?</a> *p2-ah, *cursor-ah
<span id="L160" class="LineNr">160 </span> compare p2?, <span class="Constant">0</span>/false
<span id="L161" class="LineNr">161 </span> <span class="PreProc">break-if-=</span>
<span id="L162" class="LineNr">162 </span> copy-object p0-ah, cursor-ah
<span id="L163" class="LineNr">163 </span> <span class="PreProc">return</span>
<span id="L164" class="LineNr">164 </span> <span class="Delimiter">}</span>
<span id="L165" class="LineNr">165 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;lost cursor&quot;</span>
<span id="L166" class="LineNr">166 </span><span class="Delimiter">}</span>
<span id="L167" class="LineNr">167 </span>
<span id="L168" class="LineNr">168 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L168'>cursor-left</a></span> _self: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Delimiter">{</span>
<span id="L169" class="LineNr">169 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Special">&lt;-</span> copy _self
<span id="L170" class="LineNr">170 </span> <span class="PreProc">var</span> cursor-ah/<span class="Constant">esi</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> get self, <a href='ex11.mu.html#L77'>cursor</a>
<span id="L171" class="LineNr">171 </span> <span class="PreProc">var</span> <a href='ex11.mu.html#L77'>cursor</a>/<span class="Constant">eax</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *cursor-ah
<span id="L172" class="LineNr">172 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: (addr int) <span class="Special">&lt;-</span> get <a href='ex11.mu.html#L77'>cursor</a>, x
<span id="L173" class="LineNr">173 </span> compare *cursor-x, <span class="Constant">0x20</span>
<span id="L174" class="LineNr">174 </span> <span class="Delimiter">{</span>
<span id="L175" class="LineNr">175 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L176" class="LineNr">176 </span> subtract-from *cursor-x, <span class="Constant">0x20</span>
<span id="L177" class="LineNr">177 </span> <span class="Delimiter">}</span>
<span id="L178" class="LineNr">178 </span><span class="Delimiter">}</span>
<span id="L179" class="LineNr">179 </span>
<span id="L180" class="LineNr">180 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L180'>cursor-right</a></span> _self: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Delimiter">{</span>
<span id="L181" class="LineNr">181 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Special">&lt;-</span> copy _self
<span id="L182" class="LineNr">182 </span> <span class="PreProc">var</span> cursor-ah/<span class="Constant">esi</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> get self, <a href='ex11.mu.html#L77'>cursor</a>
<span id="L183" class="LineNr">183 </span> <span class="PreProc">var</span> <a href='ex11.mu.html#L77'>cursor</a>/<span class="Constant">eax</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *cursor-ah
<span id="L184" class="LineNr">184 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: (addr int) <span class="Special">&lt;-</span> get <a href='ex11.mu.html#L77'>cursor</a>, x
<span id="L185" class="LineNr">185 </span> compare *cursor-x, <span class="Constant">0x3f0</span>
<span id="L186" class="LineNr">186 </span> <span class="Delimiter">{</span>
<span id="L187" class="LineNr">187 </span> <span class="PreProc">break-if-&gt;</span>
<span id="L188" class="LineNr">188 </span> add-to *cursor-x, <span class="Constant">0x20</span>
<span id="L189" class="LineNr">189 </span> <span class="Delimiter">}</span>
<span id="L190" class="LineNr">190 </span><span class="Delimiter">}</span>
<span id="L191" class="LineNr">191 </span>
<span id="L192" class="LineNr">192 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L192'>cursor-up</a></span> _self: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Delimiter">{</span>
<span id="L193" class="LineNr">193 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Special">&lt;-</span> copy _self
<span id="L194" class="LineNr">194 </span> <span class="PreProc">var</span> cursor-ah/<span class="Constant">esi</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> get self, <a href='ex11.mu.html#L77'>cursor</a>
<span id="L195" class="LineNr">195 </span> <span class="PreProc">var</span> <a href='ex11.mu.html#L77'>cursor</a>/<span class="Constant">eax</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *cursor-ah
<span id="L196" class="LineNr">196 </span> <span class="PreProc">var</span> cursor-y/<span class="Constant">eax</span>: (addr int) <span class="Special">&lt;-</span> get <a href='ex11.mu.html#L77'>cursor</a>, y
<span id="L197" class="LineNr">197 </span> compare *cursor-y, <span class="Constant">0x20</span>
<span id="L198" class="LineNr">198 </span> <span class="Delimiter">{</span>
<span id="L199" class="LineNr">199 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L200" class="LineNr">200 </span> subtract-from *cursor-y, <span class="Constant">0x20</span>
<span id="L201" class="LineNr">201 </span> <span class="Delimiter">}</span>
<span id="L202" class="LineNr">202 </span><span class="Delimiter">}</span>
<span id="L203" class="LineNr">203 </span>
<span id="L204" class="LineNr">204 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L204'>cursor-down</a></span> _self: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Delimiter">{</span>
<span id="L205" class="LineNr">205 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Special">&lt;-</span> copy _self
<span id="L206" class="LineNr">206 </span> <span class="PreProc">var</span> cursor-ah/<span class="Constant">esi</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> get self, <a href='ex11.mu.html#L77'>cursor</a>
<span id="L207" class="LineNr">207 </span> <span class="PreProc">var</span> <a href='ex11.mu.html#L77'>cursor</a>/<span class="Constant">eax</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *cursor-ah
<span id="L208" class="LineNr">208 </span> <span class="PreProc">var</span> cursor-y/<span class="Constant">eax</span>: (addr int) <span class="Special">&lt;-</span> get <a href='ex11.mu.html#L77'>cursor</a>, y
<span id="L209" class="LineNr">209 </span> compare *cursor-y, <span class="Constant">0x2f0</span>
<span id="L210" class="LineNr">210 </span> <span class="Delimiter">{</span>
<span id="L211" class="LineNr">211 </span> <span class="PreProc">break-if-&gt;</span>
<span id="L212" class="LineNr">212 </span> add-to *cursor-y, <span class="Constant">0x20</span>
<span id="L213" class="LineNr">213 </span> <span class="Delimiter">}</span>
<span id="L214" class="LineNr">214 </span><span class="Delimiter">}</span>
<span id="L215" class="LineNr">215 </span>
<span id="L216" class="LineNr">216 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L216'>line</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), _p0: (addr <a href='ex11.mu.html#L32'>point</a>), _p1: (addr <a href='ex11.mu.html#L32'>point</a>), color: int <span class="Delimiter">{</span>
<span id="L217" class="LineNr">217 </span> <span class="PreProc">var</span> p0/<span class="Constant">esi</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> copy _p0
<span id="L218" class="LineNr">218 </span> <span class="PreProc">var</span> x0/<span class="Constant">ecx</span>: (addr int) <span class="Special">&lt;-</span> get p0, x
<span id="L219" class="LineNr">219 </span> <span class="PreProc">var</span> y0/<span class="Constant">edx</span>: (addr int) <span class="Special">&lt;-</span> get p0, y
<span id="L220" class="LineNr">220 </span> <span class="PreProc">var</span> p1/<span class="Constant">esi</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> copy _p1
<span id="L221" class="LineNr">221 </span> <span class="PreProc">var</span> x1/<span class="Constant">ebx</span>: (addr int) <span class="Special">&lt;-</span> get p1, x
<span id="L222" class="LineNr">222 </span> <span class="PreProc">var</span> y1/<span class="Constant">eax</span>: (addr int) <span class="Special">&lt;-</span> get p1, y
<span id="L223" class="LineNr">223 </span> <a href='507line.mu.html#L1'>draw-line</a> <a href='500fake-screen.mu.html#L14'>screen</a>, *x0 *y0, *x1 *y1, color
<span id="L224" class="LineNr">224 </span><span class="Delimiter">}</span>
<span id="L225" class="LineNr">225 </span>
<span id="L226" class="LineNr">226 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L226'>disc</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), _p: (addr <a href='ex11.mu.html#L32'>point</a>), radius: int, color: int, border-color: int <span class="Delimiter">{</span>
<span id="L227" class="LineNr">227 </span> <span class="PreProc">var</span> p/<span class="Constant">esi</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> copy _p
<span id="L228" class="LineNr">228 </span> <span class="PreProc">var</span> x/<span class="Constant">ecx</span>: (addr int) <span class="Special">&lt;-</span> get p, x
<span id="L229" class="LineNr">229 </span> <span class="PreProc">var</span> y/<span class="Constant">edx</span>: (addr int) <span class="Special">&lt;-</span> get p, y
<span id="L230" class="LineNr">230 </span> <a href='508circle.mu.html#L80'>draw-disc</a> <a href='500fake-screen.mu.html#L14'>screen</a>, *x *y, radius, color, border-color
<span id="L231" class="LineNr">231 </span><span class="Delimiter">}</span>
<span id="L232" class="LineNr">232 </span>
<span id="L233" class="LineNr">233 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L233'>initialize-environment</a></span> _self: (addr <a href='ex11.mu.html#L25'>environment</a>), x0: int, y0: int, x1: int, y1: int, x2: int, y2: int <span class="Delimiter">{</span>
<span id="L234" class="LineNr">234 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Special">&lt;-</span> copy _self
<span id="L235" class="LineNr">235 </span> <span class="PreProc">var</span> p0-ah/<span class="Constant">eax</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> get self, p0
<span id="L236" class="LineNr">236 </span> <a href='120allocate.subx.html#L43'>allocate</a> p0-ah
<span id="L237" class="LineNr">237 </span> <span class="PreProc">var</span> p0/<span class="Constant">eax</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *p0-ah
<span id="L238" class="LineNr">238 </span> <a href='ex11.mu.html#L253'>initialize-point</a> p0, x0 y0
<span id="L239" class="LineNr">239 </span> <span class="PreProc">var</span> p1-ah/<span class="Constant">eax</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> get self, p1
<span id="L240" class="LineNr">240 </span> <a href='120allocate.subx.html#L43'>allocate</a> p1-ah
<span id="L241" class="LineNr">241 </span> <span class="PreProc">var</span> p1/<span class="Constant">eax</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *p1-ah
<span id="L242" class="LineNr">242 </span> <a href='ex11.mu.html#L253'>initialize-point</a> p1, x1 y1
<span id="L243" class="LineNr">243 </span> <span class="PreProc">var</span> p2-ah/<span class="Constant">eax</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> get self, p2
<span id="L244" class="LineNr">244 </span> <a href='120allocate.subx.html#L43'>allocate</a> p2-ah
<span id="L245" class="LineNr">245 </span> <span class="PreProc">var</span> p2/<span class="Constant">eax</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *p2-ah
<span id="L246" class="LineNr">246 </span> <a href='ex11.mu.html#L253'>initialize-point</a> p2, x2 y2
<span id="L247" class="LineNr">247 </span> <span class="muComment"># cursor initially at p0</span>
<span id="L248" class="LineNr">248 </span> <span class="PreProc">var</span> cursor-ah/<span class="Constant">edi</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> get self, <a href='ex11.mu.html#L77'>cursor</a>
<span id="L249" class="LineNr">249 </span> <span class="PreProc">var</span> src-ah/<span class="Constant">esi</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> get self, p0
<span id="L250" class="LineNr">250 </span> copy-object src-ah, cursor-ah
<span id="L251" class="LineNr">251 </span><span class="Delimiter">}</span>
<span id="L252" class="LineNr">252 </span>
<span id="L253" class="LineNr">253 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L253'>initialize-point</a></span> _p: (addr <a href='ex11.mu.html#L32'>point</a>), x: int, y: int <span class="Delimiter">{</span>
<span id="L254" class="LineNr">254 </span> <span class="PreProc">var</span> p/<span class="Constant">esi</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> copy _p
<span id="L255" class="LineNr">255 </span> <span class="PreProc">var</span> dest/<span class="Constant">eax</span>: (addr int) <span class="Special">&lt;-</span> get p, x
<span id="L256" class="LineNr">256 </span> <span class="PreProc">var</span> src/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy x
<span id="L257" class="LineNr">257 </span> copy-to *dest, src
<span id="L258" class="LineNr">258 </span> dest <span class="Special">&lt;-</span> get p, y
<span id="L259" class="LineNr">259 </span> src <span class="Special">&lt;-</span> copy y
<span id="L260" class="LineNr">260 </span> copy-to *dest, src
<span id="L261" class="LineNr">261 </span><span class="Delimiter">}</span>
</pre>
</body>
</html>
<!-- vim: set foldmethod=manual : -->

11
html/ex2.mu.html generated
View File

@ -83,7 +83,16 @@ if ('onhashchange' in window) {
<span id="L25" class="LineNr">25 </span> y <span class="Special">&lt;-</span> increment
<span id="L26" class="LineNr">26 </span> <span class="PreProc">loop</span>
<span id="L27" class="LineNr">27 </span> <span class="Delimiter">}</span>
<span id="L28" class="LineNr">28 </span><span class="Delimiter">}</span>
<span id="L28" class="LineNr">28 </span> <a href='ex2.mu.html#L31'>foo</a>
<span id="L29" class="LineNr">29 </span><span class="Delimiter">}</span>
<span id="L30" class="LineNr">30 </span>
<span id="L31" class="LineNr">31 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex2.mu.html#L31'>foo</a></span> <span class="Delimiter">{</span>
<span id="L32" class="LineNr">32 </span> <a href='ex2.mu.html#L35'>bar</a>
<span id="L33" class="LineNr">33 </span><span class="Delimiter">}</span>
<span id="L34" class="LineNr">34 </span>
<span id="L35" class="LineNr">35 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex2.mu.html#L35'>bar</a></span> <span class="Delimiter">{</span>
<span id="L36" class="LineNr">36 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;aaa&quot;</span>
<span id="L37" class="LineNr">37 </span><span class="Delimiter">}</span>
</pre>
</body>
</html>

4
html/ex9.mu.html generated
View File

@ -76,14 +76,14 @@ if ('onhashchange' in window) {
<span id="L18" class="LineNr">18 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex9.mu.html#L18'>main</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L19" class="LineNr">19 </span> <span class="PreProc">var</span> text-storage: (stream byte <span class="Constant">0x200</span>)
<span id="L20" class="LineNr">20 </span> <span class="PreProc">var</span> text/<span class="Constant">esi</span>: (addr stream byte) <span class="Special">&lt;-</span> address text-storage
<span id="L21" class="LineNr">21 </span> <a href='boot.subx.html#L925'>load-sectors</a> data-disk, <span class="Constant">0</span>/lba, <span class="Constant">1</span>/num-sectors, text
<span id="L21" class="LineNr">21 </span> <a href='boot.subx.html#L946'>load-sectors</a> data-disk, <span class="Constant">0</span>/lba, <span class="Constant">1</span>/num-sectors, text
<span id="L22" class="LineNr">22 </span>
<span id="L23" class="LineNr">23 </span> <span class="PreProc">var</span> <a href='ex9.mu.html#L31'>word-count</a>/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='ex9.mu.html#L31'>word-count</a> text
<span id="L24" class="LineNr">24 </span>
<span id="L25" class="LineNr">25 </span> <span class="PreProc">var</span> result-storage: (stream byte <span class="Constant">0x10</span>)
<span id="L26" class="LineNr">26 </span> <span class="PreProc">var</span> result/<span class="Constant">edi</span>: (addr stream byte) <span class="Special">&lt;-</span> address result-storage
<span id="L27" class="LineNr">27 </span> <a href='126write-int-decimal.subx.html#L8'>write-int32-decimal</a> result, <a href='ex9.mu.html#L31'>word-count</a>
<span id="L28" class="LineNr">28 </span> <a href='boot.subx.html#L987'>store-sectors</a> data-disk, <span class="Constant">0</span>/lba, <span class="Constant">1</span>/num-sectors, result
<span id="L28" class="LineNr">28 </span> <a href='boot.subx.html#L1009'>store-sectors</a> data-disk, <span class="Constant">0</span>/lba, <span class="Constant">1</span>/num-sectors, result
<span id="L29" class="LineNr">29 </span><span class="Delimiter">}</span>
<span id="L30" class="LineNr">30 </span>
<span id="L31" class="LineNr">31 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex9.mu.html#L31'>word-count</a></span> in: (addr stream byte)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>

1089
html/hest-life.mu.html generated Normal file

File diff suppressed because it is too large Load Diff

4
html/life.mu.html generated
View File

@ -280,12 +280,12 @@ if ('onhashchange' in window) {
<span id="L221" class="LineNr">221 </span> <span class="PreProc">var</span> grid1-storage: (handle array boolean)
<span id="L222" class="LineNr">222 </span> <span class="PreProc">var</span> grid1-ah/<span class="Constant">eax</span>: (addr handle array boolean) <span class="Special">&lt;-</span> address grid1-storage
<span id="L223" class="LineNr">223 </span> populate grid1-ah, <span class="Constant">0xc000</span> <span class="muComment"># width * height</span>
<span id="L224" class="LineNr">224 </span> <span class="PreProc">var</span> _grid1/<span class="Constant">eax</span>: (addr array boolean) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L226'>lookup</a> *grid1-ah
<span id="L224" class="LineNr">224 </span> <span class="PreProc">var</span> _grid1/<span class="Constant">eax</span>: (addr array boolean) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *grid1-ah
<span id="L225" class="LineNr">225 </span> <span class="PreProc">var</span> grid1/<span class="Constant">esi</span>: (addr array boolean) <span class="Special">&lt;-</span> copy _grid1
<span id="L226" class="LineNr">226 </span> <span class="PreProc">var</span> grid2-storage: (handle array boolean)
<span id="L227" class="LineNr">227 </span> <span class="PreProc">var</span> grid2-ah/<span class="Constant">eax</span>: (addr handle array boolean) <span class="Special">&lt;-</span> address grid2-storage
<span id="L228" class="LineNr">228 </span> populate grid2-ah, <span class="Constant">0xc000</span> <span class="muComment"># width * height</span>
<span id="L229" class="LineNr">229 </span> <span class="PreProc">var</span> _grid2/<span class="Constant">eax</span>: (addr array boolean) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L226'>lookup</a> *grid2-ah
<span id="L229" class="LineNr">229 </span> <span class="PreProc">var</span> _grid2/<span class="Constant">eax</span>: (addr array boolean) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *grid2-ah
<span id="L230" class="LineNr">230 </span> <span class="PreProc">var</span> grid2/<span class="Constant">edi</span>: (addr array boolean) <span class="Special">&lt;-</span> copy _grid2
<span id="L231" class="LineNr">231 </span> <span class="muComment"># initialize grid1</span>
<span id="L232" class="LineNr">232 </span> <a href='life.mu.html#L38'>set-state</a> grid1, <span class="Constant">0x80</span>, <span class="Constant">0x5f</span>, <span class="Constant">1</span>/live

View File

@ -115,7 +115,7 @@ if ('onhashchange' in window) {
<span id="L56" class="LineNr"> 56 </span> e8/call <a href='000init.subx.html#L77'>syscall_ioctl</a>/disp32
<span id="L57" class="LineNr"> 57 </span> <span class="subxComment"># some bitworking to extract 2 16-bit shorts</span>
<span id="L58" class="LineNr"> 58 </span> 8b/-&gt; *esi 0/r32/eax
<span id="L59" class="LineNr"> 59 </span> 81 4/subop/and %eax 0xffff/imm32
<span id="L59" class="LineNr"> 59 </span> 25/and-eax-with 0xffff/imm32
<span id="L60" class="LineNr"> 60 </span> 8b/-&gt; *esi 1/r32/ecx
<span id="L61" class="LineNr"> 61 </span> c1/shift 5/subop/logical-right %ecx 0x10/imm8
<span id="L62" class="LineNr"> 62 </span><span class="Constant">$real-screen-size:end</span>:

View File

@ -57,173 +57,171 @@ if ('onhashchange' in window) {
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># Methods for constructing buffered-file objects.</span>
<span id="L2" class="LineNr"> 2 </span><span class="subxComment">#</span>
<span id="L3" class="LineNr"> 3 </span><span class="subxComment"># TODO: There are hard-coded parameters here for buffer sizes. When they</span>
<span id="L4" class="LineNr"> 4 </span><span class="subxComment"># overflow, tracking down what's going on can get hairy.</span>
<span id="L5" class="LineNr"> 5 </span><span class="subxComment">#</span>
<span id="L6" class="LineNr"> 6 </span><span class="subxComment"># HACK: buffered-file stores naked addrs. This is safe because buffered-file</span>
<span id="L7" class="LineNr"> 7 </span><span class="subxComment"># objects are opaque. But still sub-optimal; they'll be harder to reclaim when</span>
<span id="L8" class="LineNr"> 8 </span><span class="subxComment"># we get around to that.</span>
<span id="L9" class="LineNr"> 9 </span>
<span id="L10" class="LineNr"> 10 </span>== code
<span id="L11" class="LineNr"> 11 </span>
<span id="L12" class="LineNr"> 12 </span><span class="subxFunction">open</span>: <span class="subxComment"># filename: (addr array byte), write?: boolean, out: (addr handle buffered-file)</span>
<span id="L13" class="LineNr"> 13 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L14" class="LineNr"> 14 </span> 55/push-ebp
<span id="L15" class="LineNr"> 15 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L16" class="LineNr"> 16 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L17" class="LineNr"> 17 </span> 50/push-eax
<span id="L18" class="LineNr"> 18 </span> 51/push-ecx
<span id="L19" class="LineNr"> 19 </span> <span class="subxComment"># var new-fd/ecx: fd</span>
<span id="L20" class="LineNr"> 20 </span> (<a href='306files.subx.html#L43'>open-fd</a> *(ebp+8) *(ebp+0xc)) <span class="subxComment"># =&gt; eax</span>
<span id="L21" class="LineNr"> 21 </span> 89/&lt;- %ecx 0/r32/eax
<span id="L22" class="LineNr"> 22 </span> <span class="subxComment"># if fd &lt; 0 return</span>
<span id="L23" class="LineNr"> 23 </span> 3d/compare-eax-with 0/imm32
<span id="L24" class="LineNr"> 24 </span> 7c/jump-if-&lt; $open:end/disp8
<span id="L25" class="LineNr"> 25 </span> <span class="subxComment"># allocate a buffered-file</span>
<span id="L26" class="LineNr"> 26 </span> (<a href='120allocate.subx.html#L66'>allocate</a> <span class="SpecialChar"><a href='120allocate.subx.html#L27'>Heap</a></span> 0x1010 *(ebp+0x10)) <span class="subxComment"># file-buffer-size + 16 for other fields</span>
<span id="L27" class="LineNr"> 27 </span> <span class="subxComment"># var out-addr/eax: (addr buffered-file)</span>
<span id="L28" class="LineNr"> 28 </span> 8b/-&gt; *(ebp+0x10) 0/r32/eax
<span id="L29" class="LineNr"> 29 </span> (<a href='120allocate.subx.html#L258'>lookup</a> *eax *(eax+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L30" class="LineNr"> 30 </span> <span class="subxComment"># out-addr-&gt;size = 4KB</span>
<span id="L31" class="LineNr"> 31 </span> c7 0/subop/copy *(eax+0xc) 0x1000/imm32/file-buffer-size <span class="subxComment"># Stream-size + 4 for fd</span>
<span id="L32" class="LineNr"> 32 </span> <span class="subxComment"># out-addr-&gt;fd = fd</span>
<span id="L33" class="LineNr"> 33 </span> 89/&lt;- *eax 1/r32/ecx
<span id="L34" class="LineNr"> 34 </span><span class="Constant">$open:end</span>:
<span id="L35" class="LineNr"> 35 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L36" class="LineNr"> 36 </span> 59/pop-to-ecx
<span id="L37" class="LineNr"> 37 </span> 58/pop-to-eax
<span id="L38" class="LineNr"> 38 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L39" class="LineNr"> 39 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L40" class="LineNr"> 40 </span> 5d/pop-to-ebp
<span id="L41" class="LineNr"> 41 </span> c3/return
<span id="L42" class="LineNr"> 42 </span>
<span id="L43" class="LineNr"> 43 </span><span class="subxFunction">open-fd</span>: <span class="subxComment"># filename: (addr array byte), write?: boolean -&gt; result/eax: fd</span>
<span id="L44" class="LineNr"> 44 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L45" class="LineNr"> 45 </span> 55/push-ebp
<span id="L46" class="LineNr"> 46 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L47" class="LineNr"> 47 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L48" class="LineNr"> 48 </span> 51/push-ecx
<span id="L49" class="LineNr"> 49 </span> 52/push-edx
<span id="L50" class="LineNr"> 50 </span> 53/push-ebx
<span id="L51" class="LineNr"> 51 </span> 56/push-esi
<span id="L52" class="LineNr"> 52 </span> <span class="subxComment"># ecx = filename</span>
<span id="L53" class="LineNr"> 53 </span> 8b/-&gt; *(ebp+8) 1/r32/ecx
<span id="L54" class="LineNr"> 54 </span> <span class="subxComment"># var size/edx: int = filename-&gt;length + 1 for the trailing null character</span>
<span id="L55" class="LineNr"> 55 </span> 8b/-&gt; *ecx 2/r32/edx
<span id="L56" class="LineNr"> 56 </span> 42/increment-edx
<span id="L57" class="LineNr"> 57 </span> <span class="subxComment"># var s/esi: (stream size)</span>
<span id="L58" class="LineNr"> 58 </span> 29/subtract-from %esp 2/r32/edx
<span id="L59" class="LineNr"> 59 </span> 52/push-edx <span class="subxComment"># size</span>
<span id="L60" class="LineNr"> 60 </span> 68/push 0/imm32/read
<span id="L61" class="LineNr"> 61 </span> 68/push 0/imm32/write
<span id="L62" class="LineNr"> 62 </span> 89/&lt;- %esi 4/r32/esp
<span id="L63" class="LineNr"> 63 </span> <span class="subxComment"># copy filename and a final null character</span>
<span id="L64" class="LineNr"> 64 </span> (<a href='106stream.subx.html#L17'>clear-stream</a> %esi)
<span id="L65" class="LineNr"> 65 </span> (<a href='108write.subx.html#L24'>write</a> %esi %ecx)
<span id="L66" class="LineNr"> 66 </span> <span class="subxComment"># spill edx</span>
<span id="L67" class="LineNr"> 67 </span> 52/push-edx
<span id="L68" class="LineNr"> 68 </span> <span class="subxComment"># var fd/eax: fd = open(filename)</span>
<span id="L69" class="LineNr"> 69 </span> 8d/copy-address *(esi+0xc) 3/r32/ebx
<span id="L70" class="LineNr"> 70 </span> 8b/-&gt; *(ebp+0xc) 1/r32/ecx/flags
<span id="L71" class="LineNr"> 71 </span> ba/copy-to-edx 0x180/imm32/permissions
<span id="L72" class="LineNr"> 72 </span> e8/call <a href='000init.subx.html#L35'>syscall_open</a>/disp32
<span id="L73" class="LineNr"> 73 </span> <span class="subxComment"># restore edx</span>
<span id="L74" class="LineNr"> 74 </span> 5a/pop-to-edx
<span id="L75" class="LineNr"> 75 </span><span class="Constant">$open-fd:end</span>:
<span id="L76" class="LineNr"> 76 </span> <span class="subxS1Comment"># . reclaim locals</span>
<span id="L77" class="LineNr"> 77 </span> 01/add-to %esp 2/r32/edx
<span id="L78" class="LineNr"> 78 </span> 81 0/subop/add %esp 0xc/imm32
<span id="L79" class="LineNr"> 79 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L80" class="LineNr"> 80 </span> 5e/pop-to-esi
<span id="L81" class="LineNr"> 81 </span> 5b/pop-to-ebx
<span id="L82" class="LineNr"> 82 </span> 5a/pop-to-edx
<span id="L83" class="LineNr"> 83 </span> 59/pop-to-ecx
<span id="L84" class="LineNr"> 84 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L85" class="LineNr"> 85 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L86" class="LineNr"> 86 </span> 5d/pop-to-ebp
<span id="L87" class="LineNr"> 87 </span> c3/return
<span id="L88" class="LineNr"> 88 </span>
<span id="L89" class="LineNr"> 89 </span><span class="subxFunction">populate-buffered-file-containing</span>: <span class="subxComment"># contents: (addr array byte), out: (addr handle buffered-file)</span>
<span id="L90" class="LineNr"> 90 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L91" class="LineNr"> 91 </span> 55/push-ebp
<span id="L92" class="LineNr"> 92 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L93" class="LineNr"> 93 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L94" class="LineNr"> 94 </span> 50/push-eax
<span id="L95" class="LineNr"> 95 </span> 51/push-ecx
<span id="L96" class="LineNr"> 96 </span> 56/push-esi
<span id="L97" class="LineNr"> 97 </span> 57/push-edi
<span id="L98" class="LineNr"> 98 </span> <span class="subxComment"># esi = contents</span>
<span id="L99" class="LineNr"> 99 </span> 8b/-&gt; *(ebp+8) 6/r32/esi
<span id="L100" class="LineNr">100 </span> <span class="subxComment"># var n/ecx: int = len(contents)</span>
<span id="L101" class="LineNr">101 </span> 8b/-&gt; *esi 1/r32/ecx
<span id="L102" class="LineNr">102 </span> <span class="subxComment"># var stream/edi: (handle stream byte)</span>
<span id="L103" class="LineNr">103 </span> 68/push 0/imm32
<span id="L104" class="LineNr">104 </span> 68/push 0/imm32
<span id="L105" class="LineNr">105 </span> 89/&lt;- %edi 4/r32/esp
<span id="L106" class="LineNr">106 </span> <span class="subxComment"># allocate stream</span>
<span id="L107" class="LineNr">107 </span> (<a href='121new-stream.subx.html#L8'>new-stream</a> <span class="SpecialChar"><a href='120allocate.subx.html#L27'>Heap</a></span> %ecx 1 %edi)
<span id="L108" class="LineNr">108 </span> <span class="subxComment"># var stream-addr/edi: (addr stream byte) = lookup(stream)</span>
<span id="L109" class="LineNr">109 </span> (<a href='120allocate.subx.html#L258'>lookup</a> *edi *(edi+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L110" class="LineNr">110 </span> 89/&lt;- %edi 0/r32/eax
<span id="L111" class="LineNr">111 </span> <span class="subxComment"># write contents to stream</span>
<span id="L112" class="LineNr">112 </span> (<a href='108write.subx.html#L24'>write</a> %edi %esi)
<span id="L113" class="LineNr">113 </span> <span class="subxComment"># allocate buffered-file</span>
<span id="L114" class="LineNr">114 </span> (<a href='120allocate.subx.html#L66'>allocate</a> <span class="SpecialChar"><a href='120allocate.subx.html#L27'>Heap</a></span> 0x110 *(ebp+0xc))
<span id="L115" class="LineNr">115 </span> <span class="subxComment"># var out-addr/eax: (addr buffered-file)</span>
<span id="L116" class="LineNr">116 </span> 8b/-&gt; *(ebp+0xc) 0/r32/eax
<span id="L117" class="LineNr">117 </span> (<a href='120allocate.subx.html#L258'>lookup</a> *eax *(eax+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L118" class="LineNr">118 </span> <span class="subxComment"># out-addr-&gt;size = 256 bytes</span>
<span id="L119" class="LineNr">119 </span> c7 0/subop/copy *(eax+0xc) 0x100/imm32/file-buffer-size
<span id="L120" class="LineNr">120 </span> <span class="subxComment"># out-addr-&gt;fd = stream</span>
<span id="L121" class="LineNr">121 </span> 89/&lt;- *eax 7/r32/edi
<span id="L122" class="LineNr">122 </span><span class="Constant">$populate-buffered-file-containing:end</span>:
<span id="L123" class="LineNr">123 </span> <span class="subxS1Comment"># . reclaim locals</span>
<span id="L124" class="LineNr">124 </span> 81 0/subop/add %esp 8/imm32
<span id="L125" class="LineNr">125 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L126" class="LineNr">126 </span> 5f/pop-to-edi
<span id="L127" class="LineNr">127 </span> 5e/pop-to-esi
<span id="L128" class="LineNr">128 </span> 59/pop-to-ecx
<span id="L129" class="LineNr">129 </span> 58/pop-to-eax
<span id="L130" class="LineNr">130 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L131" class="LineNr">131 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L132" class="LineNr">132 </span> 5d/pop-to-ebp
<span id="L133" class="LineNr">133 </span> c3/return
<span id="L134" class="LineNr">134 </span>
<span id="L135" class="LineNr">135 </span><span class="subxFunction">new-buffered-file</span>: <span class="subxComment"># out: (addr handle buffered-file)</span>
<span id="L136" class="LineNr">136 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L137" class="LineNr">137 </span> 55/push-ebp
<span id="L138" class="LineNr">138 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L139" class="LineNr">139 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L140" class="LineNr">140 </span> 50/push-eax
<span id="L141" class="LineNr">141 </span> 51/push-ecx
<span id="L142" class="LineNr">142 </span> <span class="subxComment"># var stream/ecx: (handle stream byte)</span>
<span id="L143" class="LineNr">143 </span> 68/push 0/imm32
<span id="L144" class="LineNr">144 </span> 68/push 0/imm32
<span id="L145" class="LineNr">145 </span> 89/&lt;- %ecx 4/r32/esp
<span id="L146" class="LineNr">146 </span> <span class="subxComment"># allocate stream</span>
<span id="L147" class="LineNr">147 </span> (<a href='121new-stream.subx.html#L8'>new-stream</a> <span class="SpecialChar"><a href='120allocate.subx.html#L27'>Heap</a></span> 0x100 1 %ecx)
<span id="L148" class="LineNr">148 </span> <span class="subxComment"># var stream-addr/ecx: (addr stream byte) = lookup(stream)</span>
<span id="L149" class="LineNr">149 </span> (<a href='120allocate.subx.html#L258'>lookup</a> *ecx *(ecx+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L150" class="LineNr">150 </span> 89/&lt;- %ecx 0/r32/eax
<span id="L151" class="LineNr">151 </span> <span class="subxComment"># allocate buffered-file</span>
<span id="L152" class="LineNr">152 </span> (<a href='120allocate.subx.html#L66'>allocate</a> <span class="SpecialChar"><a href='120allocate.subx.html#L27'>Heap</a></span> 0x110 *(ebp+8))
<span id="L153" class="LineNr">153 </span> <span class="subxComment"># var out-addr/eax: (addr buffered-file)</span>
<span id="L154" class="LineNr">154 </span> 8b/-&gt; *(ebp+8) 0/r32/eax
<span id="L155" class="LineNr">155 </span> (<a href='120allocate.subx.html#L258'>lookup</a> *eax *(eax+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L156" class="LineNr">156 </span> <span class="subxComment"># out-addr-&gt;size = 256 bytes</span>
<span id="L157" class="LineNr">157 </span> c7 0/subop/copy *(eax+0xc) 0x100/imm32/file-buffer-size
<span id="L158" class="LineNr">158 </span> <span class="subxComment"># out-addr-&gt;fd = stream</span>
<span id="L159" class="LineNr">159 </span> 89/&lt;- *eax 1/r32/ecx
<span id="L160" class="LineNr">160 </span><span class="Constant">$new-buffered-file:end</span>:
<span id="L161" class="LineNr">161 </span> <span class="subxS1Comment"># . reclaim locals</span>
<span id="L162" class="LineNr">162 </span> 81 0/subop/add %esp 8/imm32
<span id="L163" class="LineNr">163 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L164" class="LineNr">164 </span> 59/pop-to-ecx
<span id="L165" class="LineNr">165 </span> 58/pop-to-eax
<span id="L166" class="LineNr">166 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L167" class="LineNr">167 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L168" class="LineNr">168 </span> 5d/pop-to-ebp
<span id="L169" class="LineNr">169 </span> c3/return
<span id="L3" class="LineNr"> 3 </span><span class="subxComment"># HACK: buffered-file stores naked addrs. This is safe because buffered-file</span>
<span id="L4" class="LineNr"> 4 </span><span class="subxComment"># objects are opaque. But still sub-optimal; they'll be harder to reclaim when</span>
<span id="L5" class="LineNr"> 5 </span><span class="subxComment"># we get around to that.</span>
<span id="L6" class="LineNr"> 6 </span>
<span id="L7" class="LineNr"> 7 </span>== code
<span id="L8" class="LineNr"> 8 </span>
<span id="L9" class="LineNr"> 9 </span><span class="subxFunction">open</span>: <span class="subxComment"># filename: (addr array byte), write?: boolean, out: (addr handle buffered-file)</span>
<span id="L10" class="LineNr"> 10 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L11" class="LineNr"> 11 </span> 55/push-ebp
<span id="L12" class="LineNr"> 12 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L13" class="LineNr"> 13 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L14" class="LineNr"> 14 </span> 50/push-eax
<span id="L15" class="LineNr"> 15 </span> 51/push-ecx
<span id="L16" class="LineNr"> 16 </span> <span class="subxComment"># var new-fd/ecx: fd</span>
<span id="L17" class="LineNr"> 17 </span> (<a href='306files.subx.html#L40'>open-fd</a> *(ebp+8) *(ebp+0xc)) <span class="subxComment"># =&gt; eax</span>
<span id="L18" class="LineNr"> 18 </span> 89/&lt;- %ecx 0/r32/eax
<span id="L19" class="LineNr"> 19 </span> <span class="subxComment"># if fd &lt; 0 return</span>
<span id="L20" class="LineNr"> 20 </span> 3d/compare-eax-with 0/imm32
<span id="L21" class="LineNr"> 21 </span> 7c/jump-if-&lt; $open:end/disp8
<span id="L22" class="LineNr"> 22 </span> <span class="subxComment"># allocate a buffered-file</span>
<span id="L23" class="LineNr"> 23 </span> (<a href='120allocate.subx.html#L66'>allocate</a> <span class="SpecialChar"><a href='120allocate.subx.html#L27'>Heap</a></span> 0x1010 *(ebp+0x10)) <span class="subxComment"># file-buffer-size + 16 for other fields</span>
<span id="L24" class="LineNr"> 24 </span> <span class="subxComment"># var out-addr/eax: (addr buffered-file)</span>
<span id="L25" class="LineNr"> 25 </span> 8b/-&gt; *(ebp+0x10) 0/r32/eax
<span id="L26" class="LineNr"> 26 </span> (<a href='120allocate.subx.html#L258'>lookup</a> *eax *(eax+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L27" class="LineNr"> 27 </span> <span class="subxComment"># out-addr-&gt;size = 4KB</span>
<span id="L28" class="LineNr"> 28 </span> c7 0/subop/copy *(eax+0xc) 0x1000/imm32/file-buffer-size <span class="subxComment"># Stream-size + 4 for fd</span>
<span id="L29" class="LineNr"> 29 </span> <span class="subxComment"># out-addr-&gt;fd = fd</span>
<span id="L30" class="LineNr"> 30 </span> 89/&lt;- *eax 1/r32/ecx
<span id="L31" class="LineNr"> 31 </span><span class="Constant">$open:end</span>:
<span id="L32" class="LineNr"> 32 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L33" class="LineNr"> 33 </span> 59/pop-to-ecx
<span id="L34" class="LineNr"> 34 </span> 58/pop-to-eax
<span id="L35" class="LineNr"> 35 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L36" class="LineNr"> 36 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L37" class="LineNr"> 37 </span> 5d/pop-to-ebp
<span id="L38" class="LineNr"> 38 </span> c3/return
<span id="L39" class="LineNr"> 39 </span>
<span id="L40" class="LineNr"> 40 </span><span class="subxFunction">open-fd</span>: <span class="subxComment"># filename: (addr array byte), write?: boolean -&gt; result/eax: fd</span>
<span id="L41" class="LineNr"> 41 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L42" class="LineNr"> 42 </span> 55/push-ebp
<span id="L43" class="LineNr"> 43 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L44" class="LineNr"> 44 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L45" class="LineNr"> 45 </span> 51/push-ecx
<span id="L46" class="LineNr"> 46 </span> 52/push-edx
<span id="L47" class="LineNr"> 47 </span> 53/push-ebx
<span id="L48" class="LineNr"> 48 </span> 56/push-esi
<span id="L49" class="LineNr"> 49 </span> <span class="subxComment"># ecx = filename</span>
<span id="L50" class="LineNr"> 50 </span> 8b/-&gt; *(ebp+8) 1/r32/ecx
<span id="L51" class="LineNr"> 51 </span> <span class="subxComment"># var size/edx: int = filename-&gt;length + 1 for the trailing null character</span>
<span id="L52" class="LineNr"> 52 </span> 8b/-&gt; *ecx 2/r32/edx
<span id="L53" class="LineNr"> 53 </span> 42/increment-edx
<span id="L54" class="LineNr"> 54 </span> <span class="subxComment"># var s/esi: (stream size)</span>
<span id="L55" class="LineNr"> 55 </span> 29/subtract-from %esp 2/r32/edx
<span id="L56" class="LineNr"> 56 </span> 52/push-edx <span class="subxComment"># size</span>
<span id="L57" class="LineNr"> 57 </span> 68/push 0/imm32/read
<span id="L58" class="LineNr"> 58 </span> 68/push 0/imm32/write
<span id="L59" class="LineNr"> 59 </span> 89/&lt;- %esi 4/r32/esp
<span id="L60" class="LineNr"> 60 </span> <span class="subxComment"># copy filename and a final null character</span>
<span id="L61" class="LineNr"> 61 </span> (<a href='106stream.subx.html#L17'>clear-stream</a> %esi)
<span id="L62" class="LineNr"> 62 </span> (<a href='108write.subx.html#L24'>write</a> %esi %ecx)
<span id="L63" class="LineNr"> 63 </span> <span class="subxComment"># spill edx</span>
<span id="L64" class="LineNr"> 64 </span> 52/push-edx
<span id="L65" class="LineNr"> 65 </span> <span class="subxComment"># var fd/eax: fd = open(filename)</span>
<span id="L66" class="LineNr"> 66 </span> 8d/copy-address *(esi+0xc) 3/r32/ebx
<span id="L67" class="LineNr"> 67 </span> 8b/-&gt; *(ebp+0xc) 1/r32/ecx/flags
<span id="L68" class="LineNr"> 68 </span> ba/copy-to-edx 0x180/imm32/permissions
<span id="L69" class="LineNr"> 69 </span> e8/call <a href='000init.subx.html#L35'>syscall_open</a>/disp32
<span id="L70" class="LineNr"> 70 </span> <span class="subxComment"># restore edx</span>
<span id="L71" class="LineNr"> 71 </span> 5a/pop-to-edx
<span id="L72" class="LineNr"> 72 </span><span class="Constant">$open-fd:end</span>:
<span id="L73" class="LineNr"> 73 </span> <span class="subxS1Comment"># . reclaim locals</span>
<span id="L74" class="LineNr"> 74 </span> 01/add-to %esp 2/r32/edx
<span id="L75" class="LineNr"> 75 </span> 81 0/subop/add %esp 0xc/imm32
<span id="L76" class="LineNr"> 76 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L77" class="LineNr"> 77 </span> 5e/pop-to-esi
<span id="L78" class="LineNr"> 78 </span> 5b/pop-to-ebx
<span id="L79" class="LineNr"> 79 </span> 5a/pop-to-edx
<span id="L80" class="LineNr"> 80 </span> 59/pop-to-ecx
<span id="L81" class="LineNr"> 81 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L82" class="LineNr"> 82 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L83" class="LineNr"> 83 </span> 5d/pop-to-ebp
<span id="L84" class="LineNr"> 84 </span> c3/return
<span id="L85" class="LineNr"> 85 </span>
<span id="L86" class="LineNr"> 86 </span><span class="subxFunction">populate-buffered-file-containing</span>: <span class="subxComment"># contents: (addr array byte), out: (addr handle buffered-file)</span>
<span id="L87" class="LineNr"> 87 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L88" class="LineNr"> 88 </span> 55/push-ebp
<span id="L89" class="LineNr"> 89 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L90" class="LineNr"> 90 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L91" class="LineNr"> 91 </span> 50/push-eax
<span id="L92" class="LineNr"> 92 </span> 51/push-ecx
<span id="L93" class="LineNr"> 93 </span> 56/push-esi
<span id="L94" class="LineNr"> 94 </span> 57/push-edi
<span id="L95" class="LineNr"> 95 </span> <span class="subxComment"># esi = contents</span>
<span id="L96" class="LineNr"> 96 </span> 8b/-&gt; *(ebp+8) 6/r32/esi
<span id="L97" class="LineNr"> 97 </span> <span class="subxComment"># var n/ecx: int = len(contents)</span>
<span id="L98" class="LineNr"> 98 </span> 8b/-&gt; *esi 1/r32/ecx
<span id="L99" class="LineNr"> 99 </span> <span class="subxComment"># var stream/edi: (handle stream byte)</span>
<span id="L100" class="LineNr">100 </span> 68/push 0/imm32
<span id="L101" class="LineNr">101 </span> 68/push 0/imm32
<span id="L102" class="LineNr">102 </span> 89/&lt;- %edi 4/r32/esp
<span id="L103" class="LineNr">103 </span> <span class="subxComment"># allocate stream</span>
<span id="L104" class="LineNr">104 </span> (<a href='121new-stream.subx.html#L8'>new-stream</a> <span class="SpecialChar"><a href='120allocate.subx.html#L27'>Heap</a></span> %ecx 1 %edi)
<span id="L105" class="LineNr">105 </span> <span class="subxComment"># var stream-addr/edi: (addr stream byte) = lookup(stream)</span>
<span id="L106" class="LineNr">106 </span> (<a href='120allocate.subx.html#L258'>lookup</a> *edi *(edi+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L107" class="LineNr">107 </span> 89/&lt;- %edi 0/r32/eax
<span id="L108" class="LineNr">108 </span> <span class="subxComment"># write contents to stream</span>
<span id="L109" class="LineNr">109 </span> (<a href='108write.subx.html#L24'>write</a> %edi %esi)
<span id="L110" class="LineNr">110 </span> <span class="subxComment"># allocate buffered-file</span>
<span id="L111" class="LineNr">111 </span> (<a href='120allocate.subx.html#L66'>allocate</a> <span class="SpecialChar"><a href='120allocate.subx.html#L27'>Heap</a></span> 0x110 *(ebp+0xc))
<span id="L112" class="LineNr">112 </span> <span class="subxComment"># var out-addr/eax: (addr buffered-file)</span>
<span id="L113" class="LineNr">113 </span> 8b/-&gt; *(ebp+0xc) 0/r32/eax
<span id="L114" class="LineNr">114 </span> (<a href='120allocate.subx.html#L258'>lookup</a> *eax *(eax+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L115" class="LineNr">115 </span> <span class="subxComment"># out-addr-&gt;size = 256 bytes</span>
<span id="L116" class="LineNr">116 </span> c7 0/subop/copy *(eax+0xc) 0x100/imm32/file-buffer-size
<span id="L117" class="LineNr">117 </span> <span class="subxComment"># out-addr-&gt;fd = stream</span>
<span id="L118" class="LineNr">118 </span> 89/&lt;- *eax 7/r32/edi
<span id="L119" class="LineNr">119 </span><span class="Constant">$populate-buffered-file-containing:end</span>:
<span id="L120" class="LineNr">120 </span> <span class="subxS1Comment"># . reclaim locals</span>
<span id="L121" class="LineNr">121 </span> 81 0/subop/add %esp 8/imm32
<span id="L122" class="LineNr">122 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L123" class="LineNr">123 </span> 5f/pop-to-edi
<span id="L124" class="LineNr">124 </span> 5e/pop-to-esi
<span id="L125" class="LineNr">125 </span> 59/pop-to-ecx
<span id="L126" class="LineNr">126 </span> 58/pop-to-eax
<span id="L127" class="LineNr">127 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L128" class="LineNr">128 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L129" class="LineNr">129 </span> 5d/pop-to-ebp
<span id="L130" class="LineNr">130 </span> c3/return
<span id="L131" class="LineNr">131 </span>
<span id="L132" class="LineNr">132 </span><span class="subxComment"># TODO: hard-coded parameter</span>
<span id="L133" class="LineNr">133 </span><span class="subxFunction">new-buffered-file</span>: <span class="subxComment"># out: (addr handle buffered-file)</span>
<span id="L134" class="LineNr">134 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L135" class="LineNr">135 </span> 55/push-ebp
<span id="L136" class="LineNr">136 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L137" class="LineNr">137 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L138" class="LineNr">138 </span> 50/push-eax
<span id="L139" class="LineNr">139 </span> 51/push-ecx
<span id="L140" class="LineNr">140 </span> <span class="subxComment"># var stream/ecx: (handle stream byte)</span>
<span id="L141" class="LineNr">141 </span> 68/push 0/imm32
<span id="L142" class="LineNr">142 </span> 68/push 0/imm32
<span id="L143" class="LineNr">143 </span> 89/&lt;- %ecx 4/r32/esp
<span id="L144" class="LineNr">144 </span> <span class="subxComment"># allocate stream</span>
<span id="L145" class="LineNr">145 </span> (<a href='121new-stream.subx.html#L8'>new-stream</a> <span class="SpecialChar"><a href='120allocate.subx.html#L27'>Heap</a></span> 0x100 1 %ecx)
<span id="L146" class="LineNr">146 </span> <span class="subxComment"># var stream-addr/ecx: (addr stream byte) = lookup(stream)</span>
<span id="L147" class="LineNr">147 </span> (<a href='120allocate.subx.html#L258'>lookup</a> *ecx *(ecx+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L148" class="LineNr">148 </span> 89/&lt;- %ecx 0/r32/eax
<span id="L149" class="LineNr">149 </span> <span class="subxComment"># allocate buffered-file</span>
<span id="L150" class="LineNr">150 </span> (<a href='120allocate.subx.html#L66'>allocate</a> <span class="SpecialChar"><a href='120allocate.subx.html#L27'>Heap</a></span> 0x110 *(ebp+8))
<span id="L151" class="LineNr">151 </span> <span class="subxComment"># var out-addr/eax: (addr buffered-file)</span>
<span id="L152" class="LineNr">152 </span> 8b/-&gt; *(ebp+8) 0/r32/eax
<span id="L153" class="LineNr">153 </span> (<a href='120allocate.subx.html#L258'>lookup</a> *eax *(eax+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L154" class="LineNr">154 </span> <span class="subxComment"># out-addr-&gt;size = 256 bytes</span>
<span id="L155" class="LineNr">155 </span> c7 0/subop/copy *(eax+0xc) 0x100/imm32/file-buffer-size
<span id="L156" class="LineNr">156 </span> <span class="subxComment"># out-addr-&gt;fd = stream</span>
<span id="L157" class="LineNr">157 </span> 89/&lt;- *eax 1/r32/ecx
<span id="L158" class="LineNr">158 </span><span class="Constant">$new-buffered-file:end</span>:
<span id="L159" class="LineNr">159 </span> <span class="subxS1Comment"># . reclaim locals</span>
<span id="L160" class="LineNr">160 </span> 81 0/subop/add %esp 8/imm32
<span id="L161" class="LineNr">161 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L162" class="LineNr">162 </span> 59/pop-to-ecx
<span id="L163" class="LineNr">163 </span> 58/pop-to-eax
<span id="L164" class="LineNr">164 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L165" class="LineNr">165 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L166" class="LineNr">166 </span> 5d/pop-to-ebp
<span id="L167" class="LineNr">167 </span> c3/return
</pre>
</body>
</html>

View File

@ -126,7 +126,7 @@ if ('onhashchange' in window) {
<span id="L66" class="LineNr"> 66 </span> 4a/decrement-edx
<span id="L67" class="LineNr"> 67 </span> <span class="subxComment"># if it's a newline, break</span>
<span id="L68" class="LineNr"> 68 </span> 8a/byte-&gt; *edx 0/r32/eax
<span id="L69" class="LineNr"> 69 </span> 81 4/subop/and %eax 0xff/imm32
<span id="L69" class="LineNr"> 69 </span> 25/and-eax-with 0xff/imm32
<span id="L70" class="LineNr"> 70 </span> 3d/compare-eax-and 0xa/imm32/newline
<span id="L71" class="LineNr"> 71 </span> 74/jump-if-= <span class="Constant">break</span>/disp8
<span id="L72" class="LineNr"> 72 </span> <span class="subxComment"># not a newline, so restore it</span>

View File

@ -104,7 +104,7 @@ if ('onhashchange' in window) {
<span id="L47" class="LineNr">47 </span> 89/&lt;- %ecx 0/r32/eax
<span id="L48" class="LineNr">48 </span> <span class="subxComment"># at this point dest is identical to src, including file descriptor. Now</span>
<span id="L49" class="LineNr">49 </span> <span class="subxComment"># create an independent copy of the file descriptor</span>
<span id="L50" class="LineNr">50 </span> (<a href='306files.subx.html#L43'>open-fd</a> *(ebp+0x10) 0) <span class="subxComment"># false =&gt; eax</span>
<span id="L50" class="LineNr">50 </span> (<a href='306files.subx.html#L40'>open-fd</a> *(ebp+0x10) 0) <span class="subxComment"># false =&gt; eax</span>
<span id="L51" class="LineNr">51 </span> 89/&lt;- *edi 0/r32/eax
<span id="L52" class="LineNr">52 </span> <span class="subxComment"># replicate offset in the new fd</span>
<span id="L53" class="LineNr">53 </span> 89/&lt;- %ebx 0/r32/eax <span class="subxComment"># fd</span>

View File

@ -56,92 +56,108 @@ if ('onhashchange' in window) {
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/main/linux/313index-bounds-check.subx'>https://github.com/akkartik/mu/blob/main/linux/313index-bounds-check.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># Helper to check an array's bounds, and to abort if they're violated.</span>
<span id="L2" class="LineNr"> 2 </span><span class="subxComment"># Really only intended to be called from code generated by mu.subx.</span>
<span id="L3" class="LineNr"> 3 </span>
<span id="L4" class="LineNr"> 4 </span>== code
<span id="L5" class="LineNr"> 5 </span>
<span id="L6" class="LineNr"> 6 </span><span class="subxMinorFunction">__check-mu-array-bounds</span>: <span class="subxComment"># index: int, elem-size: int, arr-size: int, function-name: (addr array byte), array-name: (addr array byte)</span>
<span id="L7" class="LineNr"> 7 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L8" class="LineNr"> 8 </span> 55/push-ebp
<span id="L9" class="LineNr"> 9 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L10" class="LineNr">10 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L11" class="LineNr">11 </span> 50/push-eax
<span id="L12" class="LineNr">12 </span> 51/push-ecx
<span id="L13" class="LineNr">13 </span> 52/push-edx
<span id="L14" class="LineNr">14 </span> <span class="subxS1Comment"># . not bothering saving ebx; it's only clobbered if we're going to abort</span>
<span id="L15" class="LineNr">15 </span> <span class="subxComment"># ecx = arr-size</span>
<span id="L16" class="LineNr">16 </span> 8b/-&gt; *(ebp+0x10) 1/r32/ecx
<span id="L17" class="LineNr">17 </span> <span class="subxComment"># var overflow/edx: int = 0</span>
<span id="L18" class="LineNr">18 </span> ba/copy-to-edx 0/imm32
<span id="L19" class="LineNr">19 </span> <span class="subxComment"># var offset/eax: int = index * elem-size</span>
<span id="L20" class="LineNr">20 </span> 8b/-&gt; *(ebp+8) 0/r32/eax
<span id="L21" class="LineNr">21 </span> f7 4/subop/multiply-eax-with *(ebp+0xc)
<span id="L22" class="LineNr">22 </span> <span class="subxComment"># check for overflow</span>
<span id="L23" class="LineNr">23 </span> 81 7/subop/compare %edx 0/imm32
<span id="L24" class="LineNr">24 </span> 0f 85/jump-if-!= <a href='313index-bounds-check.subx.html#L6'>__check-mu-array-bounds</a>:overflow/disp32
<span id="L25" class="LineNr">25 </span> <span class="subxComment"># check bounds</span>
<span id="L26" class="LineNr">26 </span> 39/compare %eax 1/r32/ecx
<span id="L27" class="LineNr">27 </span> 0f 82/jump-if-unsigned&lt; $__check-mu-array-bounds:end/disp32 <span class="subxComment"># negative index should always abort</span>
<span id="L28" class="LineNr">28 </span> <span class="subxComment"># abort if necessary</span>
<span id="L29" class="LineNr">29 </span> (<a href='116write-buffered.subx.html#L8'>write-buffered</a> <span class="SpecialChar"><a href='116write-buffered.subx.html#L209'>Stderr</a></span> <span class="Constant">&quot;fn &quot;</span>)
<span id="L30" class="LineNr">30 </span> (<a href='116write-buffered.subx.html#L8'>write-buffered</a> <span class="SpecialChar"><a href='116write-buffered.subx.html#L209'>Stderr</a></span> *(ebp+0x14))
<span id="L31" class="LineNr">31 </span> (<a href='116write-buffered.subx.html#L8'>write-buffered</a> <span class="SpecialChar"><a href='116write-buffered.subx.html#L209'>Stderr</a></span> <span class="Constant">&quot;: offset &quot;</span>)
<span id="L32" class="LineNr">32 </span> (<a href='117write-int-hex.subx.html#L288'>write-int32-hex-buffered</a> <span class="SpecialChar"><a href='116write-buffered.subx.html#L209'>Stderr</a></span> %eax)
<span id="L33" class="LineNr">33 </span> (<a href='116write-buffered.subx.html#L8'>write-buffered</a> <span class="SpecialChar"><a href='116write-buffered.subx.html#L209'>Stderr</a></span> <span class="Constant">&quot; is too large for array '&quot;</span>)
<span id="L34" class="LineNr">34 </span> (<a href='116write-buffered.subx.html#L8'>write-buffered</a> <span class="SpecialChar"><a href='116write-buffered.subx.html#L209'>Stderr</a></span> *(ebp+0x18))
<span id="L35" class="LineNr">35 </span> (<a href='116write-buffered.subx.html#L8'>write-buffered</a> <span class="SpecialChar"><a href='116write-buffered.subx.html#L209'>Stderr</a></span> <span class="Constant">&quot;'\n&quot;</span>)
<span id="L36" class="LineNr">36 </span> (<a href='115write-byte.subx.html#L81'>flush</a> <span class="SpecialChar"><a href='116write-buffered.subx.html#L209'>Stderr</a></span>)
<span id="L37" class="LineNr">37 </span> <span class="subxComment"># exit(1)</span>
<span id="L38" class="LineNr">38 </span> bb/copy-to-ebx 1/imm32
<span id="L39" class="LineNr">39 </span> e8/call <a href='000init.subx.html#L18'>syscall_exit</a>/disp32
<span id="L40" class="LineNr">40 </span> <span class="subxComment"># never gets here</span>
<span id="L41" class="LineNr">41 </span><span class="Constant">$__check-mu-array-bounds:end</span>:
<span id="L42" class="LineNr">42 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L43" class="LineNr">43 </span> 5a/pop-to-edx
<span id="L44" class="LineNr">44 </span> 59/pop-to-ecx
<span id="L45" class="LineNr">45 </span> 58/pop-to-eax
<span id="L46" class="LineNr">46 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L47" class="LineNr">47 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L48" class="LineNr">48 </span> 5d/pop-to-ebp
<span id="L49" class="LineNr">49 </span> c3/return
<span id="L50" class="LineNr">50 </span>
<span id="L51" class="LineNr">51 </span><span class="subxMinorFunction">__check-mu-array-bounds:overflow</span>:
<span id="L52" class="LineNr">52 </span> <span class="subxComment"># &quot;fn &quot; function-name &quot;: offset to array '&quot; array-name &quot;' overflowed 32 bits\n&quot;</span>
<span id="L53" class="LineNr">53 </span> (<a href='116write-buffered.subx.html#L8'>write-buffered</a> <span class="SpecialChar"><a href='116write-buffered.subx.html#L209'>Stderr</a></span> <span class="Constant">&quot;fn &quot;</span>)
<span id="L54" class="LineNr">54 </span> (<a href='116write-buffered.subx.html#L8'>write-buffered</a> <span class="SpecialChar"><a href='116write-buffered.subx.html#L209'>Stderr</a></span> *(ebp+0x14))
<span id="L55" class="LineNr">55 </span> (<a href='116write-buffered.subx.html#L8'>write-buffered</a> <span class="SpecialChar"><a href='116write-buffered.subx.html#L209'>Stderr</a></span> <span class="Constant">&quot;: offset to array '&quot;</span>)
<span id="L56" class="LineNr">56 </span> (<a href='116write-buffered.subx.html#L8'>write-buffered</a> <span class="SpecialChar"><a href='116write-buffered.subx.html#L209'>Stderr</a></span> *(ebp+0x18))
<span id="L57" class="LineNr">57 </span> (<a href='116write-buffered.subx.html#L8'>write-buffered</a> <span class="SpecialChar"><a href='116write-buffered.subx.html#L209'>Stderr</a></span> <span class="Constant">&quot;' overflowed 32 bits\n&quot;</span>)
<span id="L58" class="LineNr">58 </span> (<a href='115write-byte.subx.html#L81'>flush</a> <span class="SpecialChar"><a href='116write-buffered.subx.html#L209'>Stderr</a></span>)
<span id="L59" class="LineNr">59 </span> <span class="subxComment"># exit(1)</span>
<span id="L60" class="LineNr">60 </span> bb/copy-to-ebx 1/imm32
<span id="L61" class="LineNr">61 </span> e8/call <a href='000init.subx.html#L18'>syscall_exit</a>/disp32
<span id="L62" class="LineNr">62 </span> <span class="subxComment"># never gets here</span>
<span id="L63" class="LineNr">63 </span>
<span id="L64" class="LineNr">64 </span><span class="subxComment"># potential alternative</span>
<span id="L65" class="LineNr">65 </span>
<span id="L66" class="LineNr">66 </span><span class="CommentedCode">#? __bounds-check: # msg: (addr array byte)</span>
<span id="L67" class="LineNr">67 </span><span class="CommentedCode">#? (write-buffered Stderr &quot;abort: array bounds exceeded in fn &quot;)</span>
<span id="L68" class="LineNr">68 </span><span class="CommentedCode">#? 8b/-&gt; *(esp+4) 0/r32/eax # we're going to abort, so just clobber away</span>
<span id="L69" class="LineNr">69 </span><span class="CommentedCode">#? (write-buffered Stderr %eax)</span>
<span id="L70" class="LineNr">70 </span><span class="CommentedCode">#? (write-buffered Stderr Newline)</span>
<span id="L71" class="LineNr">71 </span><span class="CommentedCode">#? # exit(1)</span>
<span id="L72" class="LineNr">72 </span><span class="CommentedCode">#? bb/copy-to-ebx 1/imm32</span>
<span id="L73" class="LineNr">73 </span><span class="CommentedCode">#? e8/call syscall_exit/disp32</span>
<span id="L74" class="LineNr">74 </span>
<span id="L75" class="LineNr">75 </span><span class="subxComment"># to be called as follows:</span>
<span id="L76" class="LineNr">76 </span><span class="subxComment"># var/reg &lt;- index arr/rega: (addr array T), idx/regi: int</span>
<span id="L77" class="LineNr">77 </span><span class="subxComment"># | if size-of(T) is 1, 2, 4 or 8</span>
<span id="L78" class="LineNr">78 </span><span class="subxComment"># =&gt; # temporarily save array size to reg to check bounds</span>
<span id="L79" class="LineNr">79 </span><span class="subxComment"># &quot;8b/-&gt; *&quot; rega &quot; &quot; reg &quot;/r32&quot;</span>
<span id="L80" class="LineNr">80 </span><span class="subxComment"># &quot;c1/shift 5/subop/right %&quot; reg &quot; &quot; log2(size-of(T)) &quot;/imm32&quot;</span>
<span id="L81" class="LineNr">81 </span><span class="subxComment"># &quot;3b/compare &quot; reg &quot;/r32 *&quot; rega</span>
<span id="L82" class="LineNr">82 </span><span class="subxComment"># &quot;68/push \&quot;&quot; function &quot;\&quot;/imm32&quot; # pass function name to error message</span>
<span id="L83" class="LineNr">83 </span><span class="subxComment"># &quot;0f 8d/jump-if-&gt;= __bounds_check/disp32&quot;</span>
<span id="L84" class="LineNr">84 </span><span class="subxComment"># &quot;81 0/subop/add %esp 4/imm32&quot; # drop function name</span>
<span id="L85" class="LineNr">85 </span><span class="subxComment"># # actually save the index addr in reg</span>
<span id="L86" class="LineNr">86 </span><span class="subxComment"># &quot;8d/copy-address *(&quot; rega &quot;+&quot; regi &quot;&lt;&lt;&quot; log2(size-of(T)) &quot;+4) &quot; reg &quot;/r32&quot;</span>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># Helper to check an array's bounds, and to abort if they're violated.</span>
<span id="L2" class="LineNr"> 2 </span><span class="subxComment"># Really only intended to be called from code generated by mu.subx.</span>
<span id="L3" class="LineNr"> 3 </span>
<span id="L4" class="LineNr"> 4 </span>== code
<span id="L5" class="LineNr"> 5 </span>
<span id="L6" class="LineNr"> 6 </span><span class="subxMinorFunction">__check-mu-array-bounds</span>: <span class="subxComment"># index: int, elem-size: int, arr-size: int, function-name: (addr array byte), array-name: (addr array byte)</span>
<span id="L7" class="LineNr"> 7 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L8" class="LineNr"> 8 </span> 55/push-ebp
<span id="L9" class="LineNr"> 9 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L10" class="LineNr"> 10 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L11" class="LineNr"> 11 </span> 50/push-eax
<span id="L12" class="LineNr"> 12 </span> 51/push-ecx
<span id="L13" class="LineNr"> 13 </span> 52/push-edx
<span id="L14" class="LineNr"> 14 </span> <span class="subxS1Comment"># . not bothering saving ebx; it's only clobbered if we're going to abort</span>
<span id="L15" class="LineNr"> 15 </span> <span class="subxComment"># ecx = arr-size</span>
<span id="L16" class="LineNr"> 16 </span> 8b/-&gt; *(ebp+0x10) 1/r32/ecx
<span id="L17" class="LineNr"> 17 </span> <span class="subxComment"># var overflow/edx: int = 0</span>
<span id="L18" class="LineNr"> 18 </span> ba/copy-to-edx 0/imm32
<span id="L19" class="LineNr"> 19 </span> <span class="subxComment"># var offset/eax: int = index * elem-size</span>
<span id="L20" class="LineNr"> 20 </span> 8b/-&gt; *(ebp+8) 0/r32/eax
<span id="L21" class="LineNr"> 21 </span> f7 4/subop/multiply-eax-with *(ebp+0xc)
<span id="L22" class="LineNr"> 22 </span> <span class="subxComment"># check for overflow</span>
<span id="L23" class="LineNr"> 23 </span> 81 7/subop/compare %edx 0/imm32
<span id="L24" class="LineNr"> 24 </span> 0f 85/jump-if-!= <a href='313index-bounds-check.subx.html#L6'>__check-mu-array-bounds</a>:overflow/disp32
<span id="L25" class="LineNr"> 25 </span> <span class="subxComment"># check bounds</span>
<span id="L26" class="LineNr"> 26 </span> 39/compare %eax 1/r32/ecx
<span id="L27" class="LineNr"> 27 </span> 0f 82/jump-if-unsigned&lt; $__check-mu-array-bounds:end/disp32 <span class="subxComment"># negative index should always abort</span>
<span id="L28" class="LineNr"> 28 </span> <span class="subxComment"># abort if necessary</span>
<span id="L29" class="LineNr"> 29 </span> (<a href='116write-buffered.subx.html#L8'>write-buffered</a> <span class="SpecialChar"><a href='116write-buffered.subx.html#L209'>Stderr</a></span> <span class="Constant">&quot;fn &quot;</span>)
<span id="L30" class="LineNr"> 30 </span> (<a href='116write-buffered.subx.html#L8'>write-buffered</a> <span class="SpecialChar"><a href='116write-buffered.subx.html#L209'>Stderr</a></span> *(ebp+0x14))
<span id="L31" class="LineNr"> 31 </span> (<a href='116write-buffered.subx.html#L8'>write-buffered</a> <span class="SpecialChar"><a href='116write-buffered.subx.html#L209'>Stderr</a></span> <span class="Constant">&quot;: offset &quot;</span>)
<span id="L32" class="LineNr"> 32 </span> (<a href='117write-int-hex.subx.html#L288'>write-int32-hex-buffered</a> <span class="SpecialChar"><a href='116write-buffered.subx.html#L209'>Stderr</a></span> %eax)
<span id="L33" class="LineNr"> 33 </span> (<a href='116write-buffered.subx.html#L8'>write-buffered</a> <span class="SpecialChar"><a href='116write-buffered.subx.html#L209'>Stderr</a></span> <span class="Constant">&quot; is too large for array '&quot;</span>)
<span id="L34" class="LineNr"> 34 </span> (<a href='116write-buffered.subx.html#L8'>write-buffered</a> <span class="SpecialChar"><a href='116write-buffered.subx.html#L209'>Stderr</a></span> *(ebp+0x18))
<span id="L35" class="LineNr"> 35 </span> (<a href='116write-buffered.subx.html#L8'>write-buffered</a> <span class="SpecialChar"><a href='116write-buffered.subx.html#L209'>Stderr</a></span> <span class="Constant">&quot;'\n&quot;</span>)
<span id="L36" class="LineNr"> 36 </span> (<a href='115write-byte.subx.html#L81'>flush</a> <span class="SpecialChar"><a href='116write-buffered.subx.html#L209'>Stderr</a></span>)
<span id="L37" class="LineNr"> 37 </span> <span class="subxComment"># exit(1)</span>
<span id="L38" class="LineNr"> 38 </span> bb/copy-to-ebx 1/imm32
<span id="L39" class="LineNr"> 39 </span> e8/call <a href='000init.subx.html#L18'>syscall_exit</a>/disp32
<span id="L40" class="LineNr"> 40 </span> <span class="subxComment"># never gets here</span>
<span id="L41" class="LineNr"> 41 </span><span class="Constant">$__check-mu-array-bounds:end</span>:
<span id="L42" class="LineNr"> 42 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L43" class="LineNr"> 43 </span> 5a/pop-to-edx
<span id="L44" class="LineNr"> 44 </span> 59/pop-to-ecx
<span id="L45" class="LineNr"> 45 </span> 58/pop-to-eax
<span id="L46" class="LineNr"> 46 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L47" class="LineNr"> 47 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L48" class="LineNr"> 48 </span> 5d/pop-to-ebp
<span id="L49" class="LineNr"> 49 </span> c3/return
<span id="L50" class="LineNr"> 50 </span>
<span id="L51" class="LineNr"> 51 </span><span class="subxMinorFunction">__check-mu-array-bounds:overflow</span>:
<span id="L52" class="LineNr"> 52 </span> <span class="subxComment"># &quot;fn &quot; function-name &quot;: offset to array '&quot; array-name &quot;' overflowed 32 bits\n&quot;</span>
<span id="L53" class="LineNr"> 53 </span> (<a href='116write-buffered.subx.html#L8'>write-buffered</a> <span class="SpecialChar"><a href='116write-buffered.subx.html#L209'>Stderr</a></span> <span class="Constant">&quot;fn &quot;</span>)
<span id="L54" class="LineNr"> 54 </span> (<a href='116write-buffered.subx.html#L8'>write-buffered</a> <span class="SpecialChar"><a href='116write-buffered.subx.html#L209'>Stderr</a></span> *(ebp+0x14))
<span id="L55" class="LineNr"> 55 </span> (<a href='116write-buffered.subx.html#L8'>write-buffered</a> <span class="SpecialChar"><a href='116write-buffered.subx.html#L209'>Stderr</a></span> <span class="Constant">&quot;: offset to array '&quot;</span>)
<span id="L56" class="LineNr"> 56 </span> (<a href='116write-buffered.subx.html#L8'>write-buffered</a> <span class="SpecialChar"><a href='116write-buffered.subx.html#L209'>Stderr</a></span> *(ebp+0x18))
<span id="L57" class="LineNr"> 57 </span> (<a href='116write-buffered.subx.html#L8'>write-buffered</a> <span class="SpecialChar"><a href='116write-buffered.subx.html#L209'>Stderr</a></span> <span class="Constant">&quot;' overflowed 32 bits\n&quot;</span>)
<span id="L58" class="LineNr"> 58 </span> (<a href='115write-byte.subx.html#L81'>flush</a> <span class="SpecialChar"><a href='116write-buffered.subx.html#L209'>Stderr</a></span>)
<span id="L59" class="LineNr"> 59 </span> <span class="subxComment"># exit(1)</span>
<span id="L60" class="LineNr"> 60 </span> bb/copy-to-ebx 1/imm32
<span id="L61" class="LineNr"> 61 </span> e8/call <a href='000init.subx.html#L18'>syscall_exit</a>/disp32
<span id="L62" class="LineNr"> 62 </span> <span class="subxComment"># never gets here</span>
<span id="L63" class="LineNr"> 63 </span>
<span id="L64" class="LineNr"> 64 </span><span class="subxComment"># potential alternative</span>
<span id="L65" class="LineNr"> 65 </span>
<span id="L66" class="LineNr"> 66 </span><span class="CommentedCode">#? __bounds-check: # msg: (addr array byte)</span>
<span id="L67" class="LineNr"> 67 </span><span class="CommentedCode">#? (write-buffered Stderr &quot;abort: array bounds exceeded in fn &quot;)</span>
<span id="L68" class="LineNr"> 68 </span><span class="CommentedCode">#? 8b/-&gt; *(esp+4) 0/r32/eax # we're going to abort, so just clobber away</span>
<span id="L69" class="LineNr"> 69 </span><span class="CommentedCode">#? (write-buffered Stderr %eax)</span>
<span id="L70" class="LineNr"> 70 </span><span class="CommentedCode">#? (write-buffered Stderr Newline)</span>
<span id="L71" class="LineNr"> 71 </span><span class="CommentedCode">#? # exit(1)</span>
<span id="L72" class="LineNr"> 72 </span><span class="CommentedCode">#? bb/copy-to-ebx 1/imm32</span>
<span id="L73" class="LineNr"> 73 </span><span class="CommentedCode">#? e8/call syscall_exit/disp32</span>
<span id="L74" class="LineNr"> 74 </span>
<span id="L75" class="LineNr"> 75 </span><span class="subxComment"># to be called as follows:</span>
<span id="L76" class="LineNr"> 76 </span><span class="subxComment"># var/reg &lt;- index arr/rega: (addr array T), idx/regi: int</span>
<span id="L77" class="LineNr"> 77 </span><span class="subxComment"># | if size-of(T) is 1, 2, 4 or 8</span>
<span id="L78" class="LineNr"> 78 </span><span class="subxComment"># =&gt; # temporarily save array size to reg to check bounds</span>
<span id="L79" class="LineNr"> 79 </span><span class="subxComment"># &quot;8b/-&gt; *&quot; rega &quot; &quot; reg &quot;/r32&quot;</span>
<span id="L80" class="LineNr"> 80 </span><span class="subxComment"># &quot;c1/shift 5/subop/right %&quot; reg &quot; &quot; log2(size-of(T)) &quot;/imm32&quot;</span>
<span id="L81" class="LineNr"> 81 </span><span class="subxComment"># &quot;3b/compare &quot; reg &quot;/r32 *&quot; rega</span>
<span id="L82" class="LineNr"> 82 </span><span class="subxComment"># &quot;68/push \&quot;&quot; function &quot;\&quot;/imm32&quot; # pass function name to error message</span>
<span id="L83" class="LineNr"> 83 </span><span class="subxComment"># &quot;0f 8d/jump-if-&gt;= __bounds_check/disp32&quot;</span>
<span id="L84" class="LineNr"> 84 </span><span class="subxComment"># &quot;81 0/subop/add %esp 4/imm32&quot; # drop function name</span>
<span id="L85" class="LineNr"> 85 </span><span class="subxComment"># # actually save the index addr in reg</span>
<span id="L86" class="LineNr"> 86 </span><span class="subxComment"># &quot;8d/copy-address *(&quot; rega &quot;+&quot; regi &quot;&lt;&lt;&quot; log2(size-of(T)) &quot;+4) &quot; reg &quot;/r32&quot;</span>
<span id="L87" class="LineNr"> 87 </span>
<span id="L88" class="LineNr"> 88 </span><span class="subxMinorFunction">__mu-abort-null-index-base-address</span>:
<span id="L89" class="LineNr"> 89 </span> (<a href='116write-buffered.subx.html#L8'>write-buffered</a> <span class="SpecialChar"><a href='116write-buffered.subx.html#L209'>Stderr</a></span> <span class="Constant">&quot;null address in 'index'\n&quot;</span>)
<span id="L90" class="LineNr"> 90 </span> (<a href='115write-byte.subx.html#L81'>flush</a> <span class="SpecialChar"><a href='116write-buffered.subx.html#L209'>Stderr</a></span>)
<span id="L91" class="LineNr"> 91 </span> <span class="subxComment"># exit(1)</span>
<span id="L92" class="LineNr"> 92 </span> bb/copy-to-ebx 1/imm32
<span id="L93" class="LineNr"> 93 </span> e8/call <a href='000init.subx.html#L18'>syscall_exit</a>/disp32
<span id="L94" class="LineNr"> 94 </span> <span class="subxComment"># never gets here</span>
<span id="L95" class="LineNr"> 95 </span>
<span id="L96" class="LineNr"> 96 </span><span class="subxMinorFunction">__mu-abort-null-get-base-address</span>:
<span id="L97" class="LineNr"> 97 </span> (<a href='116write-buffered.subx.html#L8'>write-buffered</a> <span class="SpecialChar"><a href='116write-buffered.subx.html#L209'>Stderr</a></span> <span class="Constant">&quot;null address in 'get'\n&quot;</span>)
<span id="L98" class="LineNr"> 98 </span> (<a href='115write-byte.subx.html#L81'>flush</a> <span class="SpecialChar"><a href='116write-buffered.subx.html#L209'>Stderr</a></span>)
<span id="L99" class="LineNr"> 99 </span> <span class="subxComment"># exit(1)</span>
<span id="L100" class="LineNr">100 </span> bb/copy-to-ebx 1/imm32
<span id="L101" class="LineNr">101 </span> e8/call <a href='000init.subx.html#L18'>syscall_exit</a>/disp32
<span id="L102" class="LineNr">102 </span> <span class="subxComment"># never gets here</span>
</pre>
</body>
</html>

View File

@ -231,9 +231,9 @@ if ('onhashchange' in window) {
<span id="L176" class="LineNr">176 </span><span class="PreProc">sig</span> <a href='305keyboard.subx.html#L72'>enable-keyboard-type-mode</a>
<span id="L177" class="LineNr">177 </span><span class="PreProc">sig</span> <a href='305keyboard.subx.html#L132'>read-key-from-real-keyboard</a><span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: grapheme
<span id="L178" class="LineNr">178 </span><span class="PreProc">sig</span> <a href='305keyboard.subx.html#L158'>read-line-from-real-keyboard</a> out: (addr stream byte)
<span id="L179" class="LineNr">179 </span><span class="PreProc">sig</span> <a href='306files.subx.html#L12'>open</a> filename: (addr array byte), write?: boolean, out: (addr handle buffered-file)
<span id="L180" class="LineNr">180 </span><span class="PreProc">sig</span> <a href='306files.subx.html#L89'>populate-buffered-file-containing</a> contents: (addr array byte), out: (addr handle buffered-file)
<span id="L181" class="LineNr">181 </span><span class="PreProc">sig</span> <a href='306files.subx.html#L135'>new-buffered-file</a> out: (addr handle buffered-file)
<span id="L179" class="LineNr">179 </span><span class="PreProc">sig</span> <a href='306files.subx.html#L9'>open</a> filename: (addr array byte), write?: boolean, out: (addr handle buffered-file)
<span id="L180" class="LineNr">180 </span><span class="PreProc">sig</span> <a href='306files.subx.html#L86'>populate-buffered-file-containing</a> contents: (addr array byte), out: (addr handle buffered-file)
<span id="L181" class="LineNr">181 </span><span class="PreProc">sig</span> <a href='306files.subx.html#L133'>new-buffered-file</a> out: (addr handle buffered-file)
<span id="L182" class="LineNr">182 </span><span class="muComment">#sig size in: (addr array _) -&gt; _/eax: int</span>
<span id="L183" class="LineNr">183 </span>
<span id="L184" class="LineNr">184 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L6'>stream-empty?</a> s: (addr stream _)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean

View File

@ -106,7 +106,7 @@ if ('onhashchange' in window) {
<span id="L48" class="LineNr">48 </span><span class="PreProc">fn</span> <span class="muTest"><a href='404stream.mu.html#L48'>test-fake-input-buffered-file</a></span> <span class="Delimiter">{</span>
<span id="L49" class="LineNr">49 </span> <span class="PreProc">var</span> foo: (handle buffered-file)
<span id="L50" class="LineNr">50 </span> <span class="PreProc">var</span> foo-ah/<span class="Constant">eax</span>: (addr handle buffered-file) <span class="Special">&lt;-</span> address foo
<span id="L51" class="LineNr">51 </span> <a href='306files.subx.html#L89'>populate-buffered-file-containing</a> <span class="Constant">&quot;abc&quot;</span>, foo-ah
<span id="L51" class="LineNr">51 </span> <a href='306files.subx.html#L86'>populate-buffered-file-containing</a> <span class="Constant">&quot;abc&quot;</span>, foo-ah
<span id="L52" class="LineNr">52 </span> <span class="PreProc">var</span> foo-addr/<span class="Constant">eax</span>: (addr buffered-file) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L258'>lookup</a> foo
<span id="L53" class="LineNr">53 </span> <span class="PreProc">var</span> s: (stream byte <span class="Constant">0x100</span>)
<span id="L54" class="LineNr">54 </span> <span class="PreProc">var</span> result/<span class="Constant">ecx</span>: (addr stream byte) <span class="Special">&lt;-</span> address s
@ -117,7 +117,7 @@ if ('onhashchange' in window) {
<span id="L59" class="LineNr">59 </span><span class="PreProc">fn</span> <span class="muTest"><a href='404stream.mu.html#L59'>test-fake-output-buffered-file</a></span> <span class="Delimiter">{</span>
<span id="L60" class="LineNr">60 </span> <span class="PreProc">var</span> foo: (handle buffered-file)
<span id="L61" class="LineNr">61 </span> <span class="PreProc">var</span> foo-ah/<span class="Constant">eax</span>: (addr handle buffered-file) <span class="Special">&lt;-</span> address foo
<span id="L62" class="LineNr">62 </span> <a href='306files.subx.html#L135'>new-buffered-file</a> foo-ah
<span id="L62" class="LineNr">62 </span> <a href='306files.subx.html#L133'>new-buffered-file</a> foo-ah
<span id="L63" class="LineNr">63 </span> <span class="PreProc">var</span> foo-addr/<span class="Constant">eax</span>: (addr buffered-file) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L258'>lookup</a> foo
<span id="L64" class="LineNr">64 </span> <a href='116write-buffered.subx.html#L8'>write-buffered</a> foo-addr, <span class="Constant">&quot;abc&quot;</span>
<span id="L65" class="LineNr">65 </span> <span class="PreProc">var</span> s: (stream byte <span class="Constant">0x100</span>)

View File

@ -463,6 +463,30 @@ if ('onhashchange' in window) {
<span id="L405" class="LineNr">405 </span> <span class="Delimiter">);</span>
<span id="L406" class="LineNr">406 </span> <a href='003trace.cc.html#L292'>CHECK_TRACE_DOESNT_CONTAIN</a><span class="Delimiter">(</span><span class="Constant">&quot;run: jump 5&quot;</span><span class="Delimiter">);</span>
<span id="L407" class="LineNr">407 </span><span class="Delimiter">}</span>
<span id="L408" class="LineNr">408 </span>
<span id="L409" class="LineNr">409 </span><span class="Comment">//:: jump if overflow</span>
<span id="L410" class="LineNr">410 </span>
<span id="L411" class="LineNr">411 </span><span class="Delimiter">:(before &quot;End Initialize Op Names&quot;)</span>
<span id="L412" class="LineNr">412 </span><a href='001help.cc.html#L237'>put_new</a><span class="Delimiter">(</span><a href='010vm.cc.html#L355'>Name</a><span class="Delimiter">,</span> <span class="Constant">&quot;70&quot;</span><span class="Delimiter">,</span> <span class="Constant">&quot;jump disp8 bytes away if <a href='010vm.cc.html#L91'>OF</a> is set (jcc/jo)&quot;</span><span class="Delimiter">);</span>
<span id="L413" class="LineNr">413 </span><a href='001help.cc.html#L237'>put_new</a><span class="Delimiter">(</span><a href='010vm.cc.html#L355'>Name</a><span class="Delimiter">,</span> <span class="Constant">&quot;71&quot;</span><span class="Delimiter">,</span> <span class="Constant">&quot;jump disp8 bytes away if <a href='010vm.cc.html#L91'>OF</a> is unset (jcc/jno)&quot;</span><span class="Delimiter">);</span>
<span id="L414" class="LineNr">414 </span>
<span id="L415" class="LineNr">415 </span><span class="Delimiter">:(before &quot;End Single-Byte Opcodes&quot;)</span>
<span id="L416" class="LineNr">416 </span><span class="Normal">case</span> <span class="Constant">0x70</span>: <span class="Delimiter">{</span> <span class="Comment">// jump disp8 if OF is set</span>
<span id="L417" class="LineNr">417 </span> <span class="Normal">const</span> <span class="Normal">int8_t</span> offset = <span class="Normal">static_cast</span>&lt;<span class="Normal">int</span>&gt;<span class="Delimiter">(</span><a href='010vm.cc.html#L338'>next</a><span class="Delimiter">());</span>
<span id="L418" class="LineNr">418 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='010vm.cc.html#L91'>OF</a><span class="Delimiter">)</span> <span class="Delimiter">{</span>
<span id="L419" class="LineNr">419 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span>Callstack_depth+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">&quot;run&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;jump &quot;</span> &lt;&lt; <a href='010vm.cc.html#L410'>NUM</a><span class="Delimiter">(</span>offset<span class="Delimiter">)</span> &lt;&lt; end<span class="Delimiter">();</span>
<span id="L420" class="LineNr">420 </span> <a href='010vm.cc.html#L26'>EIP</a> += offset<span class="Delimiter">;</span>
<span id="L421" class="LineNr">421 </span> <span class="Delimiter">}</span>
<span id="L422" class="LineNr">422 </span> <span class="Identifier">break</span><span class="Delimiter">;</span>
<span id="L423" class="LineNr">423 </span><span class="Delimiter">}</span>
<span id="L424" class="LineNr">424 </span><span class="Normal">case</span> <span class="Constant">0x71</span>: <span class="Delimiter">{</span> <span class="Comment">// jump disp8 if OF is unset</span>
<span id="L425" class="LineNr">425 </span> <span class="Normal">const</span> <span class="Normal">int8_t</span> offset = <span class="Normal">static_cast</span>&lt;<span class="Normal">int</span>&gt;<span class="Delimiter">(</span><a href='010vm.cc.html#L338'>next</a><span class="Delimiter">());</span>
<span id="L426" class="LineNr">426 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!OF<span class="Delimiter">)</span> <span class="Delimiter">{</span>
<span id="L427" class="LineNr">427 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span>Callstack_depth+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">&quot;run&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;jump &quot;</span> &lt;&lt; <a href='010vm.cc.html#L410'>NUM</a><span class="Delimiter">(</span>offset<span class="Delimiter">)</span> &lt;&lt; end<span class="Delimiter">();</span>
<span id="L428" class="LineNr">428 </span> <a href='010vm.cc.html#L26'>EIP</a> += offset<span class="Delimiter">;</span>
<span id="L429" class="LineNr">429 </span> <span class="Delimiter">}</span>
<span id="L430" class="LineNr">430 </span> <span class="Identifier">break</span><span class="Delimiter">;</span>
<span id="L431" class="LineNr">431 </span><span class="Delimiter">}</span>
</pre>
</body>
</html>

View File

@ -463,6 +463,30 @@ if ('onhashchange' in window) {
<span id="L405" class="LineNr">405 </span> <span class="Delimiter">);</span>
<span id="L406" class="LineNr">406 </span> <a href='003trace.cc.html#L292'>CHECK_TRACE_DOESNT_CONTAIN</a><span class="Delimiter">(</span><span class="Constant">&quot;run: jump 5&quot;</span><span class="Delimiter">);</span>
<span id="L407" class="LineNr">407 </span><span class="Delimiter">}</span>
<span id="L408" class="LineNr">408 </span>
<span id="L409" class="LineNr">409 </span><span class="Comment">//:: jump if overflow</span>
<span id="L410" class="LineNr">410 </span>
<span id="L411" class="LineNr">411 </span><span class="Delimiter">:(before &quot;End Initialize Op Names&quot;)</span>
<span id="L412" class="LineNr">412 </span><a href='001help.cc.html#L237'>put_new</a><span class="Delimiter">(</span><a href='010vm.cc.html#L356'>Name_0f</a><span class="Delimiter">,</span> <span class="Constant">&quot;80&quot;</span><span class="Delimiter">,</span> <span class="Constant">&quot;jump <a href='040tests.cc.html#L82'>disp32</a> bytes away if <a href='010vm.cc.html#L91'>OF</a> is set (jcc/jo)&quot;</span><span class="Delimiter">);</span>
<span id="L413" class="LineNr">413 </span><a href='001help.cc.html#L237'>put_new</a><span class="Delimiter">(</span><a href='010vm.cc.html#L356'>Name_0f</a><span class="Delimiter">,</span> <span class="Constant">&quot;81&quot;</span><span class="Delimiter">,</span> <span class="Constant">&quot;jump <a href='040tests.cc.html#L82'>disp32</a> bytes away if <a href='010vm.cc.html#L91'>OF</a> is unset (jcc/jno)&quot;</span><span class="Delimiter">);</span>
<span id="L414" class="LineNr">414 </span>
<span id="L415" class="LineNr">415 </span><span class="Delimiter">:(before &quot;End Two-Byte Opcodes Starting With 0f&quot;)</span>
<span id="L416" class="LineNr">416 </span><span class="Normal">case</span> <span class="Constant">0x80</span>: <span class="Delimiter">{</span> <span class="Comment">// jump disp8 if OF is set</span>
<span id="L417" class="LineNr">417 </span> <span class="Normal">const</span> <span class="Normal">int32_t</span> offset = <a href='011run.cc.html#L433'>next32</a><span class="Delimiter">();</span>
<span id="L418" class="LineNr">418 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='010vm.cc.html#L91'>OF</a><span class="Delimiter">)</span> <span class="Delimiter">{</span>
<span id="L419" class="LineNr">419 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span>Callstack_depth+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">&quot;run&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;jump &quot;</span> &lt;&lt; <a href='010vm.cc.html#L410'>NUM</a><span class="Delimiter">(</span>offset<span class="Delimiter">)</span> &lt;&lt; end<span class="Delimiter">();</span>
<span id="L420" class="LineNr">420 </span> <a href='010vm.cc.html#L26'>EIP</a> += offset<span class="Delimiter">;</span>
<span id="L421" class="LineNr">421 </span> <span class="Delimiter">}</span>
<span id="L422" class="LineNr">422 </span> <span class="Identifier">break</span><span class="Delimiter">;</span>
<span id="L423" class="LineNr">423 </span><span class="Delimiter">}</span>
<span id="L424" class="LineNr">424 </span><span class="Normal">case</span> <span class="Constant">0x81</span>: <span class="Delimiter">{</span> <span class="Comment">// jump disp8 if OF is unset</span>
<span id="L425" class="LineNr">425 </span> <span class="Normal">const</span> <span class="Normal">int32_t</span> offset = <a href='011run.cc.html#L433'>next32</a><span class="Delimiter">();</span>
<span id="L426" class="LineNr">426 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!OF<span class="Delimiter">)</span> <span class="Delimiter">{</span>
<span id="L427" class="LineNr">427 </span> <a href='003trace.cc.html#L96'>trace</a><span class="Delimiter">(</span>Callstack_depth+<span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">&quot;run&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;jump &quot;</span> &lt;&lt; <a href='010vm.cc.html#L410'>NUM</a><span class="Delimiter">(</span>offset<span class="Delimiter">)</span> &lt;&lt; end<span class="Delimiter">();</span>
<span id="L428" class="LineNr">428 </span> <a href='010vm.cc.html#L26'>EIP</a> += offset<span class="Delimiter">;</span>
<span id="L429" class="LineNr">429 </span> <span class="Delimiter">}</span>
<span id="L430" class="LineNr">430 </span> <span class="Identifier">break</span><span class="Delimiter">;</span>
<span id="L431" class="LineNr">431 </span><span class="Delimiter">}</span>
</pre>
</body>
</html>

View File

@ -70,10 +70,10 @@ if ('onhashchange' in window) {
<span id="L11" class="LineNr"> 11 </span><span class="subxComment"># 74/jump-if-= loop/disp8</span>
<span id="L12" class="LineNr"> 12 </span><span class="subxComment"># }</span>
<span id="L13" class="LineNr"> 13 </span><span class="subxComment"># $ cat x.subx |braces</span>
<span id="L14" class="LineNr"> 14 </span><span class="subxComment"># _loop1:</span>
<span id="L15" class="LineNr"> 15 </span><span class="subxComment"># 7c/jump-if-&lt; _break1/disp8</span>
<span id="L16" class="LineNr"> 16 </span><span class="subxComment"># 74/jump-if-= _loop1/disp8</span>
<span id="L17" class="LineNr"> 17 </span><span class="subxComment"># _break1:</span>
<span id="L14" class="LineNr"> 14 </span><span class="subxComment"># @loop1:</span>
<span id="L15" class="LineNr"> 15 </span><span class="subxComment"># 7c/jump-if-&lt; @break1/disp8</span>
<span id="L16" class="LineNr"> 16 </span><span class="subxComment"># 74/jump-if-= @loop1/disp8</span>
<span id="L17" class="LineNr"> 17 </span><span class="subxComment"># @break1:</span>
<span id="L18" class="LineNr"> 18 </span><span class="subxComment">#</span>
<span id="L19" class="LineNr"> 19 </span><span class="subxComment"># Example 2:</span>
<span id="L20" class="LineNr"> 20 </span><span class="subxComment"># $ cat x.subx</span>
@ -84,12 +84,12 @@ if ('onhashchange' in window) {
<span id="L25" class="LineNr"> 25 </span><span class="subxComment"># 74/jump-if-= loop/disp8</span>
<span id="L26" class="LineNr"> 26 </span><span class="subxComment"># }</span>
<span id="L27" class="LineNr"> 27 </span><span class="subxComment"># $ cat x.subx |braces</span>
<span id="L28" class="LineNr"> 28 </span><span class="subxComment"># _loop1:</span>
<span id="L29" class="LineNr"> 29 </span><span class="subxComment"># 7c/jump-if-&lt; _break1/disp8</span>
<span id="L30" class="LineNr"> 30 </span><span class="subxComment"># _break1:</span>
<span id="L31" class="LineNr"> 31 </span><span class="subxComment"># _loop2:</span>
<span id="L32" class="LineNr"> 32 </span><span class="subxComment"># 74/jump-if-= _loop2/disp8</span>
<span id="L33" class="LineNr"> 33 </span><span class="subxComment"># _break2:</span>
<span id="L28" class="LineNr"> 28 </span><span class="subxComment"># @loop1:</span>
<span id="L29" class="LineNr"> 29 </span><span class="subxComment"># 7c/jump-if-&lt; @break1/disp8</span>
<span id="L30" class="LineNr"> 30 </span><span class="subxComment"># @break1:</span>
<span id="L31" class="LineNr"> 31 </span><span class="subxComment"># @loop2:</span>
<span id="L32" class="LineNr"> 32 </span><span class="subxComment"># 74/jump-if-= @loop2/disp8</span>
<span id="L33" class="LineNr"> 33 </span><span class="subxComment"># @break2:</span>
<span id="L34" class="LineNr"> 34 </span><span class="subxComment">#</span>
<span id="L35" class="LineNr"> 35 </span><span class="subxComment"># Example 3:</span>
<span id="L36" class="LineNr"> 36 </span><span class="subxComment"># $ cat x.subx</span>
@ -100,12 +100,12 @@ if ('onhashchange' in window) {
<span id="L41" class="LineNr"> 41 </span><span class="subxComment"># 7c/jump-if-&lt; loop/disp8</span>
<span id="L42" class="LineNr"> 42 </span><span class="subxComment"># }</span>
<span id="L43" class="LineNr"> 43 </span><span class="subxComment"># $ cat x.subx |braces</span>
<span id="L44" class="LineNr"> 44 </span><span class="subxComment"># _loop1:</span>
<span id="L45" class="LineNr"> 45 </span><span class="subxComment"># _loop2:</span>
<span id="L46" class="LineNr"> 46 </span><span class="subxComment"># 74/jump-if-= _loop2/disp8</span>
<span id="L47" class="LineNr"> 47 </span><span class="subxComment"># _break2:</span>
<span id="L48" class="LineNr"> 48 </span><span class="subxComment"># 7c/jump-if-&lt; _loop1/disp8</span>
<span id="L49" class="LineNr"> 49 </span><span class="subxComment"># _break1:</span>
<span id="L44" class="LineNr"> 44 </span><span class="subxComment"># @loop1:</span>
<span id="L45" class="LineNr"> 45 </span><span class="subxComment"># @loop2:</span>
<span id="L46" class="LineNr"> 46 </span><span class="subxComment"># 74/jump-if-= @loop2/disp8</span>
<span id="L47" class="LineNr"> 47 </span><span class="subxComment"># @break2:</span>
<span id="L48" class="LineNr"> 48 </span><span class="subxComment"># 7c/jump-if-&lt; @loop1/disp8</span>
<span id="L49" class="LineNr"> 49 </span><span class="subxComment"># @break1:</span>
<span id="L50" class="LineNr"> 50 </span>
<span id="L51" class="LineNr"> 51 </span>== code
<span id="L52" class="LineNr"> 52 </span>
@ -144,13 +144,13 @@ if ('onhashchange' in window) {
<span id="L85" class="LineNr"> 85 </span> <span class="subxComment"># if (line-&gt;write == 0) break # end of file</span>
<span id="L86" class="LineNr"> 86 </span> <span class="subxComment"># skip-chars-matching-whitespace(line)</span>
<span id="L87" class="LineNr"> 87 </span> <span class="subxComment"># if line-&gt;data[line-&gt;read] == '{'</span>
<span id="L88" class="LineNr"> 88 </span> <span class="subxComment"># print(out, &quot;_loop&quot; next-label-id &quot;:\n&quot;)</span>
<span id="L88" class="LineNr"> 88 </span> <span class="subxComment"># print(out, &quot;@loop&quot; next-label-id &quot;:\n&quot;)</span>
<span id="L89" class="LineNr"> 89 </span> <span class="subxComment"># push(label-stack, next-label-id)</span>
<span id="L90" class="LineNr"> 90 </span> <span class="subxComment"># ++next-label-id</span>
<span id="L91" class="LineNr"> 91 </span> <span class="subxComment"># continue</span>
<span id="L92" class="LineNr"> 92 </span> <span class="subxComment"># if line-&gt;data[line-&gt;read] == '}'</span>
<span id="L93" class="LineNr"> 93 </span> <span class="subxComment"># var top = pop(label-stack)</span>
<span id="L94" class="LineNr"> 94 </span> <span class="subxComment"># print(out, &quot;_break&quot; top &quot;:\n&quot;)</span>
<span id="L94" class="LineNr"> 94 </span> <span class="subxComment"># print(out, &quot;@break&quot; top &quot;:\n&quot;)</span>
<span id="L95" class="LineNr"> 95 </span> <span class="subxComment"># continue</span>
<span id="L96" class="LineNr"> 96 </span> <span class="subxComment"># while true</span>
<span id="L97" class="LineNr"> 97 </span> <span class="subxComment"># var word-slice: (addr slice) = next-word-or-string(line)</span>
@ -160,11 +160,11 @@ if ('onhashchange' in window) {
<span id="L101" class="LineNr">101 </span> <span class="subxComment"># continue</span>
<span id="L102" class="LineNr">102 </span> <span class="subxComment"># if slice-starts-with?(word-slice, &quot;break/&quot;)</span>
<span id="L103" class="LineNr">103 </span> <span class="subxComment"># var top = top(label-stack)</span>
<span id="L104" class="LineNr">104 </span> <span class="subxComment"># print(out, &quot;_break&quot; top)</span>
<span id="L104" class="LineNr">104 </span> <span class="subxComment"># print(out, &quot;@break&quot; top)</span>
<span id="L105" class="LineNr">105 </span> <span class="subxComment"># word-slice-&gt;start += len(&quot;break&quot;)</span>
<span id="L106" class="LineNr">106 </span> <span class="subxComment"># else if slice-starts-with?(word-slice, &quot;loop/&quot;)</span>
<span id="L107" class="LineNr">107 </span> <span class="subxComment"># var top = top(label-stack)</span>
<span id="L108" class="LineNr">108 </span> <span class="subxComment"># print(out, &quot;_loop&quot; top)</span>
<span id="L108" class="LineNr">108 </span> <span class="subxComment"># print(out, &quot;@loop&quot; top)</span>
<span id="L109" class="LineNr">109 </span> <span class="subxComment"># word-slice-&gt;start += len(&quot;loop&quot;)</span>
<span id="L110" class="LineNr">110 </span> <span class="subxComment"># print(out, word-slice &quot; &quot;)</span>
<span id="L111" class="LineNr">111 </span> <span class="subxComment"># print(out, &quot;\n&quot;)</span>
@ -211,13 +211,13 @@ if ('onhashchange' in window) {
<span id="L152" class="LineNr">152 </span> <span class="subxS1Comment"># . eax = line-&gt;data[line-&gt;read]</span>
<span id="L153" class="LineNr">153 </span> 8b/-&gt; *(ecx+4) 0/r32/eax
<span id="L154" class="LineNr">154 </span> 8a/copy-byte *(ecx+eax+0xc) 0/r32/AL
<span id="L155" class="LineNr">155 </span> 81 4/subop/and %eax 0xff/imm32
<span id="L155" class="LineNr">155 </span> 25/and-eax-with 0xff/imm32
<span id="L156" class="LineNr">156 </span> <span class="subxS1Comment"># . if (eax != '{') continue</span>
<span id="L157" class="LineNr">157 </span> 3d/compare-eax-and 0x7b/imm32/open-curly
<span id="L158" class="LineNr">158 </span> 0f 85/jump-if-!= $subx-braces:check-for-curly-closed/disp32
<span id="L159" class="LineNr">159 </span><span class="Constant">$subx-braces:emit-curly-open</span>:
<span id="L160" class="LineNr">160 </span> <span class="subxComment"># print(out, &quot;_loop&quot; next-label-id &quot;:&quot;)</span>
<span id="L161" class="LineNr">161 </span> (<a href='116write-buffered.subx.html#L8'>write-buffered</a> *(ebp+0xc) <span class="Constant">&quot;_loop&quot;</span>)
<span id="L160" class="LineNr">160 </span> <span class="subxComment"># print(out, &quot;@loop&quot; next-label-id &quot;:&quot;)</span>
<span id="L161" class="LineNr">161 </span> (<a href='116write-buffered.subx.html#L8'>write-buffered</a> *(ebp+0xc) <span class="Constant">&quot;@loop&quot;</span>)
<span id="L162" class="LineNr">162 </span> (<a href='117write-int-hex.subx.html#L288'>write-int32-hex-buffered</a> *(ebp+0xc) %ebx)
<span id="L163" class="LineNr">163 </span> (<a href='116write-buffered.subx.html#L8'>write-buffered</a> *(ebp+0xc) <span class="Constant">&quot;:&quot;</span>)
<span id="L164" class="LineNr">164 </span> <span class="subxComment"># push(label-stack, next-label-id)</span>
@ -233,8 +233,8 @@ if ('onhashchange' in window) {
<span id="L174" class="LineNr">174 </span><span class="Constant">$subx-braces:emit-curly-closed</span>:
<span id="L175" class="LineNr">175 </span> <span class="subxComment"># eax = pop(label-stack)</span>
<span id="L176" class="LineNr">176 </span> (<a href='203stack.subx.html#L234'>pop</a> %edx)
<span id="L177" class="LineNr">177 </span> <span class="subxComment"># print(out, &quot;_break&quot; eax &quot;:&quot;)</span>
<span id="L178" class="LineNr">178 </span> (<a href='116write-buffered.subx.html#L8'>write-buffered</a> *(ebp+0xc) <span class="Constant">&quot;_break&quot;</span>)
<span id="L177" class="LineNr">177 </span> <span class="subxComment"># print(out, &quot;@break&quot; eax &quot;:&quot;)</span>
<span id="L178" class="LineNr">178 </span> (<a href='116write-buffered.subx.html#L8'>write-buffered</a> *(ebp+0xc) <span class="Constant">&quot;@break&quot;</span>)
<span id="L179" class="LineNr">179 </span> (<a href='117write-int-hex.subx.html#L288'>write-int32-hex-buffered</a> *(ebp+0xc) %eax)
<span id="L180" class="LineNr">180 </span> (<a href='116write-buffered.subx.html#L8'>write-buffered</a> *(ebp+0xc) <span class="Constant">&quot;:&quot;</span>)
<span id="L181" class="LineNr">181 </span> <span class="subxComment"># continue</span>
@ -251,7 +251,7 @@ if ('onhashchange' in window) {
<span id="L192" class="LineNr">192 </span> <span class="subxS1Comment"># . eax = *word-slice-&gt;start</span>
<span id="L193" class="LineNr">193 </span> 8b/-&gt; *edi 0/r32/eax
<span id="L194" class="LineNr">194 </span> 8a/copy-byte *eax 0/r32/AL
<span id="L195" class="LineNr">195 </span> 81 4/subop/and %eax 0xff/imm32
<span id="L195" class="LineNr">195 </span> 25/and-eax-with 0xff/imm32
<span id="L196" class="LineNr">196 </span> <span class="subxS1Comment"># . if (eax == '#') continue</span>
<span id="L197" class="LineNr">197 </span> 3d/compare-eax-and 0x23/imm32/hash
<span id="L198" class="LineNr">198 </span> 74/jump-if-= $subx-braces:word-loop/disp8
@ -264,8 +264,8 @@ if ('onhashchange' in window) {
<span id="L205" class="LineNr">205 </span> 74/jump-if-= $subx-braces:check-for-loop/disp8
<span id="L206" class="LineNr">206 </span><span class="Constant">$subx-braces:emit-break</span>:
<span id="L207" class="LineNr">207 </span> (<a href='203stack.subx.html#L338'>top</a> %edx)
<span id="L208" class="LineNr">208 </span> <span class="subxComment"># print(out, &quot;_break&quot; eax)</span>
<span id="L209" class="LineNr">209 </span> (<a href='116write-buffered.subx.html#L8'>write-buffered</a> *(ebp+0xc) <span class="Constant">&quot;_break&quot;</span>)
<span id="L208" class="LineNr">208 </span> <span class="subxComment"># print(out, &quot;@break&quot; eax)</span>
<span id="L209" class="LineNr">209 </span> (<a href='116write-buffered.subx.html#L8'>write-buffered</a> *(ebp+0xc) <span class="Constant">&quot;@break&quot;</span>)
<span id="L210" class="LineNr">210 </span> (<a href='117write-int-hex.subx.html#L288'>write-int32-hex-buffered</a> *(ebp+0xc) %eax)
<span id="L211" class="LineNr">211 </span> <span class="subxComment"># word-slice-&gt;start += len(&quot;break&quot;)</span>
<span id="L212" class="LineNr">212 </span> 81 0/subop/add *edi 5/imm32/strlen
@ -280,8 +280,8 @@ if ('onhashchange' in window) {
<span id="L221" class="LineNr">221 </span> 74/jump-if-= $subx-braces:emit-word-slice/disp8
<span id="L222" class="LineNr">222 </span><span class="Constant">$subx-braces:emit-loop</span>:
<span id="L223" class="LineNr">223 </span> (<a href='203stack.subx.html#L338'>top</a> %edx)
<span id="L224" class="LineNr">224 </span> <span class="subxComment"># print(out, &quot;_loop&quot; eax)</span>
<span id="L225" class="LineNr">225 </span> (<a href='116write-buffered.subx.html#L8'>write-buffered</a> *(ebp+0xc) <span class="Constant">&quot;_loop&quot;</span>)
<span id="L224" class="LineNr">224 </span> <span class="subxComment"># print(out, &quot;@loop&quot; eax)</span>
<span id="L225" class="LineNr">225 </span> (<a href='116write-buffered.subx.html#L8'>write-buffered</a> *(ebp+0xc) <span class="Constant">&quot;@loop&quot;</span>)
<span id="L226" class="LineNr">226 </span> (<a href='117write-int-hex.subx.html#L288'>write-int32-hex-buffered</a> *(ebp+0xc) %eax)
<span id="L227" class="LineNr">227 </span> <span class="subxComment"># word-slice-&gt;start += len(&quot;loop&quot;)</span>
<span id="L228" class="LineNr">228 </span> 81 0/subop/add *edi 4/imm32/strlen
@ -343,10 +343,10 @@ if ('onhashchange' in window) {
<span id="L288" class="LineNr">288 </span> <span class="subxComment"># }</span>
<span id="L289" class="LineNr">289 </span> <span class="subxComment">#</span>
<span id="L290" class="LineNr">290 </span> <span class="subxComment"># output:</span>
<span id="L291" class="LineNr">291 </span> <span class="subxComment"># _loop1:</span>
<span id="L292" class="LineNr">292 </span> <span class="subxComment"># ab _break1/imm32</span>
<span id="L293" class="LineNr">293 </span> <span class="subxComment"># cd _loop1/imm32</span>
<span id="L294" class="LineNr">294 </span> <span class="subxComment"># _break1:</span>
<span id="L291" class="LineNr">291 </span> <span class="subxComment"># @loop1:</span>
<span id="L292" class="LineNr">292 </span> <span class="subxComment"># ab @break1/imm32</span>
<span id="L293" class="LineNr">293 </span> <span class="subxComment"># cd @loop1/imm32</span>
<span id="L294" class="LineNr">294 </span> <span class="subxComment"># @break1:</span>
<span id="L295" class="LineNr">295 </span> <span class="subxComment">#</span>
<span id="L296" class="LineNr">296 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L297" class="LineNr">297 </span> 55/push-ebp
@ -362,7 +362,7 @@ if ('onhashchange' in window) {
<span id="L307" class="LineNr">307 </span> <span class="subxComment"># check that the line just passed through</span>
<span id="L308" class="LineNr">308 </span> (<a href='115write-byte.subx.html#L81'>flush</a> <a href='115write-byte.subx.html#L425'>_test-output-buffered-file</a>)
<span id="L309" class="Folded">309 </span><span class="Folded">+-- 5 lines: #? # dump _test-output-stream -----------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="L314" class="LineNr">314 </span> (<a href='109stream-equal.subx.html#L194'>check-stream-equal</a> <a href='115write-byte.subx.html#L287'>_test-output-stream</a> <span class="Constant">&quot;_loop0x00000001:\nab _break0x00000001/imm32 \ncd _loop0x00000001/imm32 \n_break0x00000001:\n&quot;</span> <span class="Constant">&quot;F - test-subx-braces-1&quot;</span>)
<span id="L314" class="LineNr">314 </span> (<a href='109stream-equal.subx.html#L194'>check-stream-equal</a> <a href='115write-byte.subx.html#L287'>_test-output-stream</a> <span class="Constant">&quot;@loop0x00000001:\nab @break0x00000001/imm32 \ncd @loop0x00000001/imm32 \n@break0x00000001:\n&quot;</span> <span class="Constant">&quot;F - test-subx-braces-1&quot;</span>)
<span id="L315" class="LineNr">315 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L316" class="LineNr">316 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L317" class="LineNr">317 </span> 5d/pop-to-ebp
@ -378,12 +378,12 @@ if ('onhashchange' in window) {
<span id="L327" class="LineNr">327 </span> <span class="subxComment"># }</span>
<span id="L328" class="LineNr">328 </span> <span class="subxComment">#</span>
<span id="L329" class="LineNr">329 </span> <span class="subxComment"># output:</span>
<span id="L330" class="LineNr">330 </span> <span class="subxComment"># _loop1:</span>
<span id="L331" class="LineNr">331 </span> <span class="subxComment"># _loop2:</span>
<span id="L332" class="LineNr">332 </span> <span class="subxComment"># ab _break2/imm32</span>
<span id="L333" class="LineNr">333 </span> <span class="subxComment"># _break2:</span>
<span id="L334" class="LineNr">334 </span> <span class="subxComment"># cd _loop1/imm32</span>
<span id="L335" class="LineNr">335 </span> <span class="subxComment"># _break1:</span>
<span id="L330" class="LineNr">330 </span> <span class="subxComment"># @loop1:</span>
<span id="L331" class="LineNr">331 </span> <span class="subxComment"># @loop2:</span>
<span id="L332" class="LineNr">332 </span> <span class="subxComment"># ab @break2/imm32</span>
<span id="L333" class="LineNr">333 </span> <span class="subxComment"># @break2:</span>
<span id="L334" class="LineNr">334 </span> <span class="subxComment"># cd @loop1/imm32</span>
<span id="L335" class="LineNr">335 </span> <span class="subxComment"># @break1:</span>
<span id="L336" class="LineNr">336 </span> <span class="subxComment">#</span>
<span id="L337" class="LineNr">337 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L338" class="LineNr">338 </span> 55/push-ebp
@ -399,7 +399,7 @@ if ('onhashchange' in window) {
<span id="L348" class="LineNr">348 </span> <span class="subxComment"># check that the line just passed through</span>
<span id="L349" class="LineNr">349 </span> (<a href='115write-byte.subx.html#L81'>flush</a> <a href='115write-byte.subx.html#L425'>_test-output-buffered-file</a>)
<span id="L350" class="Folded">350 </span><span class="Folded">+-- 5 lines: #? # dump _test-output-stream -----------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="L355" class="LineNr">355 </span> (<a href='109stream-equal.subx.html#L194'>check-stream-equal</a> <a href='115write-byte.subx.html#L287'>_test-output-stream</a> <span class="Constant">&quot;_loop0x00000001:\n_loop0x00000002:\nab _break0x00000002/imm32 \n_break0x00000002:\ncd _loop0x00000001/imm32 \n_break0x00000001:\n&quot;</span> <span class="Constant">&quot;F - test-subx-braces-2&quot;</span>)
<span id="L355" class="LineNr">355 </span> (<a href='109stream-equal.subx.html#L194'>check-stream-equal</a> <a href='115write-byte.subx.html#L287'>_test-output-stream</a> <span class="Constant">&quot;@loop0x00000001:\n@loop0x00000002:\nab @break0x00000002/imm32 \n@break0x00000002:\ncd @loop0x00000001/imm32 \n@break0x00000001:\n&quot;</span> <span class="Constant">&quot;F - test-subx-braces-2&quot;</span>)
<span id="L356" class="LineNr">356 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L357" class="LineNr">357 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L358" class="LineNr">358 </span> 5d/pop-to-ebp

99
html/linux/branches.mu.html generated Normal file
View File

@ -0,0 +1,99 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Mu - linux/branches.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="colorscheme" content="minimal-dark">
<style type="text/css">
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #a8a8a8; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #a8a8a8; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.LineNr { }
.Delimiter { color: #c000c0; }
.muFunction { color: #af5f00; text-decoration: underline; }
-->
</style>
<script type='text/javascript'>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
function JumpToLine()
{
var lineNum;
lineNum = window.location.hash;
lineNum = lineNum.substr(1); /* strip off '#' */
if (lineNum.indexOf('L') == -1) {
lineNum = 'L'+lineNum;
}
var lineElem = document.getElementById(lineNum);
/* Always jump to new location even if the line was hidden inside a fold, or
* we corrected the raw number to a line ID.
*/
if (lineElem) {
lineElem.scrollIntoView(true);
}
return true;
}
if ('onhashchange' in window) {
window.onhashchange = JumpToLine;
}
-->
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/main/linux/branches.mu'>https://github.com/akkartik/mu/blob/main/linux/branches.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='branches.mu.html#L1'>foo</a></span> <span class="Delimiter">{</span>
<span id="L2" class="LineNr"> 2 </span> $foo: <span class="Delimiter">{</span>
<span id="L3" class="LineNr"> 3 </span> <span class="PreProc">break-if-=</span>
<span id="L4" class="LineNr"> 4 </span> <span class="PreProc">break-if-=</span> $foo
<span id="L5" class="LineNr"> 5 </span> <span class="PreProc">break-if-!=</span>
<span id="L6" class="LineNr"> 6 </span> <span class="PreProc">break-if-!=</span> $foo
<span id="L7" class="LineNr"> 7 </span> <span class="PreProc">break-if-&lt;=</span>
<span id="L8" class="LineNr"> 8 </span> <span class="PreProc">break-if-&lt;=</span> $foo
<span id="L9" class="LineNr"> 9 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L10" class="LineNr">10 </span> <span class="PreProc">break-if-&gt;=</span> $foo
<span id="L11" class="LineNr">11 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L12" class="LineNr">12 </span> <span class="PreProc">break-if-&lt;</span> $foo
<span id="L13" class="LineNr">13 </span> <span class="PreProc">break-if-&gt;</span>
<span id="L14" class="LineNr">14 </span> <span class="PreProc">break-if-&gt;</span> $foo
<span id="L15" class="LineNr">15 </span> <span class="PreProc">break-if-carry</span>
<span id="L16" class="LineNr">16 </span> <span class="PreProc">break-if-carry</span> $foo
<span id="L17" class="LineNr">17 </span> <span class="PreProc">break-if-overflow</span>
<span id="L18" class="LineNr">18 </span> <span class="PreProc">break-if-overflow</span> $foo
<span id="L19" class="LineNr">19 </span> <span class="PreProc">loop-if-=</span>
<span id="L20" class="LineNr">20 </span> <span class="PreProc">loop-if-=</span> $foo
<span id="L21" class="LineNr">21 </span> <span class="PreProc">loop-if-!=</span>
<span id="L22" class="LineNr">22 </span> <span class="PreProc">loop-if-!=</span> $foo
<span id="L23" class="LineNr">23 </span> <span class="PreProc">loop-if-&lt;=</span>
<span id="L24" class="LineNr">24 </span> <span class="PreProc">loop-if-&lt;=</span> $foo
<span id="L25" class="LineNr">25 </span> <span class="PreProc">loop-if-&gt;=</span>
<span id="L26" class="LineNr">26 </span> <span class="PreProc">loop-if-&gt;=</span> $foo
<span id="L27" class="LineNr">27 </span> <span class="PreProc">loop-if-&lt;</span>
<span id="L28" class="LineNr">28 </span> <span class="PreProc">loop-if-&lt;</span> $foo
<span id="L29" class="LineNr">29 </span> <span class="PreProc">loop-if-&gt;</span>
<span id="L30" class="LineNr">30 </span> <span class="PreProc">loop-if-&gt;</span> $foo
<span id="L31" class="LineNr">31 </span> <span class="PreProc">loop-if-carry</span>
<span id="L32" class="LineNr">32 </span> <span class="PreProc">loop-if-carry</span> $foo
<span id="L33" class="LineNr">33 </span> <span class="PreProc">loop-if-not-carry</span>
<span id="L34" class="LineNr">34 </span> <span class="PreProc">loop-if-not-carry</span> $foo
<span id="L35" class="LineNr">35 </span> <span class="PreProc">loop-if-overflow</span>
<span id="L36" class="LineNr">36 </span> <span class="PreProc">loop-if-overflow</span> $foo
<span id="L37" class="LineNr">37 </span> <span class="PreProc">loop-if-not-overflow</span>
<span id="L38" class="LineNr">38 </span> <span class="PreProc">loop-if-not-overflow</span> $foo
<span id="L39" class="LineNr">39 </span> <span class="Delimiter">}</span>
<span id="L40" class="LineNr">40 </span><span class="Delimiter">}</span>
</pre>
</body>
</html>
<!-- vim: set foldmethod=manual : -->

View File

@ -450,7 +450,7 @@ if ('onhashchange' in window) {
<span id="L428" class="LineNr"> 428 </span> <span class="subxS2Comment"># . . eax = *(curr-&gt;start+4)</span>
<span id="L429" class="LineNr"> 429 </span> 8b/-&gt; *ecx 0/r32/eax
<span id="L430" class="LineNr"> 430 </span> 8a/copy-byte *(eax+4) 0/r32/eax
<span id="L431" class="LineNr"> 431 </span> 81 4/subop/and %eax 0xff/imm32
<span id="L431" class="LineNr"> 431 </span> 25/and-eax-with 0xff/imm32
<span id="L432" class="LineNr"> 432 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L433" class="LineNr"> 433 </span> 50/push-eax
<span id="L434" class="LineNr"> 434 </span> ff 6/subop/push *(ebp+8)
@ -473,7 +473,7 @@ if ('onhashchange' in window) {
<span id="L451" class="LineNr"> 451 </span> 8b/-&gt; *ecx 0/r32/eax
<span id="L452" class="LineNr"> 452 </span> <span class="subxS1Comment"># . var c/eax: byte = *eax</span>
<span id="L453" class="LineNr"> 453 </span> 8b/-&gt; *eax 0/r32/eax
<span id="L454" class="LineNr"> 454 </span> 81 4/subop/and %eax 0xff/imm32
<span id="L454" class="LineNr"> 454 </span> 25/and-eax-with 0xff/imm32
<span id="L455" class="LineNr"> 455 </span> <span class="subxS1Comment"># . if (c == '%') goto push-rm32</span>
<span id="L456" class="LineNr"> 456 </span> 3d/compare-eax-and 0x25/imm32/percent
<span id="L457" class="LineNr"> 457 </span> 74/jump-if-= $emit-call:push-rm32/disp8
@ -1351,7 +1351,7 @@ if ('onhashchange' in window) {
<span id="L1361" class="LineNr">1361 </span> 68/push 0xe/imm32
<span id="L1362" class="LineNr">1362 </span> <span class="subxS2Comment"># . . push slice-&gt;start - _test-input-stream</span>
<span id="L1363" class="LineNr">1363 </span> 8b/-&gt; *ecx 0/r32/eax
<span id="L1364" class="LineNr">1364 </span> 81 5/subop/subtract %eax <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32
<span id="L1364" class="LineNr">1364 </span> 2d/subtract-from-eax <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32
<span id="L1365" class="LineNr">1365 </span> 50/push-eax
<span id="L1366" class="LineNr">1366 </span> <span class="subxS2Comment"># . . call</span>
<span id="L1367" class="LineNr">1367 </span> e8/call <a href='102test.subx.html#L23'>check-ints-equal</a>/disp32
@ -1364,7 +1364,7 @@ if ('onhashchange' in window) {
<span id="L1374" class="LineNr">1374 </span> 68/push 0x10/imm32
<span id="L1375" class="LineNr">1375 </span> <span class="subxS2Comment"># . . push slice-&gt;end - _test-input-stream</span>
<span id="L1376" class="LineNr">1376 </span> 8b/-&gt; *(ecx+4) 0/r32/eax
<span id="L1377" class="LineNr">1377 </span> 81 5/subop/subtract %eax <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32
<span id="L1377" class="LineNr">1377 </span> 2d/subtract-from-eax <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32
<span id="L1378" class="LineNr">1378 </span> 50/push-eax
<span id="L1379" class="LineNr">1379 </span> <span class="subxS2Comment"># . . call</span>
<span id="L1380" class="LineNr">1380 </span> e8/call <a href='102test.subx.html#L23'>check-ints-equal</a>/disp32
@ -1424,7 +1424,7 @@ if ('onhashchange' in window) {
<span id="L1434" class="LineNr">1434 </span> 68/push 0xe/imm32
<span id="L1435" class="LineNr">1435 </span> <span class="subxS2Comment"># . . push slice-&gt;start - _test-input-stream</span>
<span id="L1436" class="LineNr">1436 </span> 8b/-&gt; *ecx 0/r32/eax
<span id="L1437" class="LineNr">1437 </span> 81 5/subop/subtract %eax <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32
<span id="L1437" class="LineNr">1437 </span> 2d/subtract-from-eax <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32
<span id="L1438" class="LineNr">1438 </span> 50/push-eax
<span id="L1439" class="LineNr">1439 </span> <span class="subxS2Comment"># . . call</span>
<span id="L1440" class="LineNr">1440 </span> e8/call <a href='102test.subx.html#L23'>check-ints-equal</a>/disp32
@ -1437,7 +1437,7 @@ if ('onhashchange' in window) {
<span id="L1447" class="LineNr">1447 </span> 68/push 0x11/imm32
<span id="L1448" class="LineNr">1448 </span> <span class="subxS2Comment"># . . push slice-&gt;end - _test-input-stream</span>
<span id="L1449" class="LineNr">1449 </span> 8b/-&gt; *(ecx+4) 0/r32/eax
<span id="L1450" class="LineNr">1450 </span> 81 5/subop/subtract %eax <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32
<span id="L1450" class="LineNr">1450 </span> 2d/subtract-from-eax <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32
<span id="L1451" class="LineNr">1451 </span> 50/push-eax
<span id="L1452" class="LineNr">1452 </span> <span class="subxS2Comment"># . . call</span>
<span id="L1453" class="LineNr">1453 </span> e8/call <a href='102test.subx.html#L23'>check-ints-equal</a>/disp32
@ -1487,7 +1487,7 @@ if ('onhashchange' in window) {
<span id="L1497" class="LineNr">1497 </span> 68/push 0xd/imm32
<span id="L1498" class="LineNr">1498 </span> <span class="subxS2Comment"># . . push slice-&gt;start - _test-input-stream</span>
<span id="L1499" class="LineNr">1499 </span> 8b/-&gt; *ecx 0/r32/eax
<span id="L1500" class="LineNr">1500 </span> 81 5/subop/subtract %eax <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32
<span id="L1500" class="LineNr">1500 </span> 2d/subtract-from-eax <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32
<span id="L1501" class="LineNr">1501 </span> 50/push-eax
<span id="L1502" class="LineNr">1502 </span> <span class="subxS2Comment"># . . call</span>
<span id="L1503" class="LineNr">1503 </span> e8/call <a href='102test.subx.html#L23'>check-ints-equal</a>/disp32
@ -1500,7 +1500,7 @@ if ('onhashchange' in window) {
<span id="L1510" class="LineNr">1510 </span> 68/push 0x12/imm32
<span id="L1511" class="LineNr">1511 </span> <span class="subxS2Comment"># . . push slice-&gt;end - _test-input-stream</span>
<span id="L1512" class="LineNr">1512 </span> 8b/-&gt; *(ecx+4) 0/r32/eax
<span id="L1513" class="LineNr">1513 </span> 81 5/subop/subtract %eax <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32
<span id="L1513" class="LineNr">1513 </span> 2d/subtract-from-eax <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32
<span id="L1514" class="LineNr">1514 </span> 50/push-eax
<span id="L1515" class="LineNr">1515 </span> <span class="subxS2Comment"># . . call</span>
<span id="L1516" class="LineNr">1516 </span> e8/call <a href='102test.subx.html#L23'>check-ints-equal</a>/disp32
@ -1550,7 +1550,7 @@ if ('onhashchange' in window) {
<span id="L1560" class="LineNr">1560 </span> 68/push 0xd/imm32
<span id="L1561" class="LineNr">1561 </span> <span class="subxS2Comment"># . . push slice-&gt;start - _test-input-stream</span>
<span id="L1562" class="LineNr">1562 </span> 8b/-&gt; *ecx 0/r32/eax
<span id="L1563" class="LineNr">1563 </span> 81 5/subop/subtract %eax <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32
<span id="L1563" class="LineNr">1563 </span> 2d/subtract-from-eax <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32
<span id="L1564" class="LineNr">1564 </span> 50/push-eax
<span id="L1565" class="LineNr">1565 </span> <span class="subxS2Comment"># . . call</span>
<span id="L1566" class="LineNr">1566 </span> e8/call <a href='102test.subx.html#L23'>check-ints-equal</a>/disp32
@ -1563,7 +1563,7 @@ if ('onhashchange' in window) {
<span id="L1573" class="LineNr">1573 </span> 68/push 0x13/imm32
<span id="L1574" class="LineNr">1574 </span> <span class="subxS2Comment"># . . push slice-&gt;end - _test-input-stream</span>
<span id="L1575" class="LineNr">1575 </span> 8b/-&gt; *(ecx+4) 0/r32/eax
<span id="L1576" class="LineNr">1576 </span> 81 5/subop/subtract %eax <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32
<span id="L1576" class="LineNr">1576 </span> 2d/subtract-from-eax <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32
<span id="L1577" class="LineNr">1577 </span> 50/push-eax
<span id="L1578" class="LineNr">1578 </span> <span class="subxS2Comment"># . . call</span>
<span id="L1579" class="LineNr">1579 </span> e8/call <a href='102test.subx.html#L23'>check-ints-equal</a>/disp32
@ -1613,7 +1613,7 @@ if ('onhashchange' in window) {
<span id="L1623" class="LineNr">1623 </span> 68/push 0xd/imm32
<span id="L1624" class="LineNr">1624 </span> <span class="subxS2Comment"># . . push slice-&gt;start - _test-input-stream</span>
<span id="L1625" class="LineNr">1625 </span> 8b/-&gt; *ecx 0/r32/eax
<span id="L1626" class="LineNr">1626 </span> 81 5/subop/subtract %eax <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32
<span id="L1626" class="LineNr">1626 </span> 2d/subtract-from-eax <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32
<span id="L1627" class="LineNr">1627 </span> 50/push-eax
<span id="L1628" class="LineNr">1628 </span> <span class="subxS2Comment"># . . call</span>
<span id="L1629" class="LineNr">1629 </span> e8/call <a href='102test.subx.html#L23'>check-ints-equal</a>/disp32
@ -1626,7 +1626,7 @@ if ('onhashchange' in window) {
<span id="L1636" class="LineNr">1636 </span> 68/push 0x13/imm32
<span id="L1637" class="LineNr">1637 </span> <span class="subxS2Comment"># . . push slice-&gt;end - _test-input-stream</span>
<span id="L1638" class="LineNr">1638 </span> 8b/-&gt; *(ecx+4) 0/r32/eax
<span id="L1639" class="LineNr">1639 </span> 81 5/subop/subtract %eax <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32
<span id="L1639" class="LineNr">1639 </span> 2d/subtract-from-eax <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32
<span id="L1640" class="LineNr">1640 </span> 50/push-eax
<span id="L1641" class="LineNr">1641 </span> <span class="subxS2Comment"># . . call</span>
<span id="L1642" class="LineNr">1642 </span> e8/call <a href='102test.subx.html#L23'>check-ints-equal</a>/disp32
@ -1841,7 +1841,7 @@ if ('onhashchange' in window) {
<span id="L1851" class="LineNr">1851 </span> 68/push 0xd/imm32
<span id="L1852" class="LineNr">1852 </span> <span class="subxS2Comment"># . . push slice-&gt;start - _test-input-stream</span>
<span id="L1853" class="LineNr">1853 </span> 8b/-&gt; *ecx 0/r32/eax
<span id="L1854" class="LineNr">1854 </span> 81 5/subop/subtract %eax <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32
<span id="L1854" class="LineNr">1854 </span> 2d/subtract-from-eax <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32
<span id="L1855" class="LineNr">1855 </span> 50/push-eax
<span id="L1856" class="LineNr">1856 </span> <span class="subxS2Comment"># . . call</span>
<span id="L1857" class="LineNr">1857 </span> e8/call <a href='102test.subx.html#L23'>check-ints-equal</a>/disp32
@ -1854,7 +1854,7 @@ if ('onhashchange' in window) {
<span id="L1864" class="LineNr">1864 </span> 68/push 0x10/imm32
<span id="L1865" class="LineNr">1865 </span> <span class="subxS2Comment"># . . push slice-&gt;end - _test-input-stream</span>
<span id="L1866" class="LineNr">1866 </span> 8b/-&gt; *(ecx+4) 0/r32/eax
<span id="L1867" class="LineNr">1867 </span> 81 5/subop/subtract %eax <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32
<span id="L1867" class="LineNr">1867 </span> 2d/subtract-from-eax <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32
<span id="L1868" class="LineNr">1868 </span> 50/push-eax
<span id="L1869" class="LineNr">1869 </span> <span class="subxS2Comment"># . . call</span>
<span id="L1870" class="LineNr">1870 </span> e8/call <a href='102test.subx.html#L23'>check-ints-equal</a>/disp32

2458
html/linux/labels_baremetal.subx.html generated Normal file

File diff suppressed because it is too large Load Diff

61381
html/linux/mu.subx.html generated

File diff suppressed because it is too large Load Diff

View File

@ -80,7 +80,7 @@ if ('onhashchange' in window) {
<span id="L22" class="LineNr">22 </span> <span class="PreProc">var</span> in: (handle buffered-file)
<span id="L23" class="LineNr">23 </span> <span class="Delimiter">{</span>
<span id="L24" class="LineNr">24 </span> <span class="PreProc">var</span> addr-in/<span class="Constant">eax</span>: (addr handle buffered-file) <span class="Special">&lt;-</span> address in
<span id="L25" class="LineNr">25 </span> <a href='306files.subx.html#L12'>open</a> *filename, <span class="Constant">0</span>/read-only, addr-in
<span id="L25" class="LineNr">25 </span> <a href='306files.subx.html#L9'>open</a> *filename, <span class="Constant">0</span>/read-only, addr-in
<span id="L26" class="LineNr">26 </span> <span class="Delimiter">}</span>
<span id="L27" class="LineNr">27 </span> <span class="PreProc">var</span> _in-addr/<span class="Constant">eax</span>: (addr buffered-file) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L258'>lookup</a> in
<span id="L28" class="LineNr">28 </span> <span class="PreProc">var</span> in-addr/<span class="Constant">ecx</span>: (addr buffered-file) <span class="Special">&lt;-</span> copy _in-addr

View File

@ -1645,7 +1645,7 @@ if ('onhashchange' in window) {
<span id="L1895" class="LineNr">1895 </span> 68/push 0xe/imm32
<span id="L1896" class="LineNr">1896 </span> <span class="subxS2Comment"># . . push slice-&gt;start - _test-input-stream</span>
<span id="L1897" class="LineNr">1897 </span> 8b/copy 0/mod/indirect 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *ecx to eax</span>
<span id="L1898" class="LineNr">1898 </span> 81 5/subop/subtract 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> <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32 <span class="subxComment"># subtract from eax</span>
<span id="L1898" class="LineNr">1898 </span> 2d/subtract-from-eax <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32
<span id="L1899" class="LineNr">1899 </span> 50/push-eax
<span id="L1900" class="LineNr">1900 </span> <span class="subxS2Comment"># . . call</span>
<span id="L1901" class="LineNr">1901 </span> e8/call <a href='102test.subx.html#L23'>check-ints-equal</a>/disp32
@ -1658,7 +1658,7 @@ if ('onhashchange' in window) {
<span id="L1908" class="LineNr">1908 </span> 68/push 0x10/imm32
<span id="L1909" class="LineNr">1909 </span> <span class="subxS2Comment"># . . push slice-&gt;end - _test-input-stream</span>
<span id="L1910" class="LineNr">1910 </span> 8b/copy 1/mod/*+disp8 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ecx+4) to eax</span>
<span id="L1911" class="LineNr">1911 </span> 81 5/subop/subtract 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> <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32 <span class="subxComment"># subtract from eax</span>
<span id="L1911" class="LineNr">1911 </span> 2d/subtract-from-eax <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32
<span id="L1912" class="LineNr">1912 </span> 50/push-eax
<span id="L1913" class="LineNr">1913 </span> <span class="subxS2Comment"># . . call</span>
<span id="L1914" class="LineNr">1914 </span> e8/call <a href='102test.subx.html#L23'>check-ints-equal</a>/disp32
@ -1718,7 +1718,7 @@ if ('onhashchange' in window) {
<span id="L1968" class="LineNr">1968 </span> 68/push 0xe/imm32
<span id="L1969" class="LineNr">1969 </span> <span class="subxS2Comment"># . . push slice-&gt;start - _test-input-stream</span>
<span id="L1970" class="LineNr">1970 </span> 8b/copy 0/mod/indirect 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *ecx to eax</span>
<span id="L1971" class="LineNr">1971 </span> 81 5/subop/subtract 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> <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32 <span class="subxComment"># subtract from eax</span>
<span id="L1971" class="LineNr">1971 </span> 2d/subtract-from-eax <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32
<span id="L1972" class="LineNr">1972 </span> 50/push-eax
<span id="L1973" class="LineNr">1973 </span> <span class="subxS2Comment"># . . call</span>
<span id="L1974" class="LineNr">1974 </span> e8/call <a href='102test.subx.html#L23'>check-ints-equal</a>/disp32
@ -1731,7 +1731,7 @@ if ('onhashchange' in window) {
<span id="L1981" class="LineNr">1981 </span> 68/push 0x11/imm32
<span id="L1982" class="LineNr">1982 </span> <span class="subxS2Comment"># . . push slice-&gt;end - _test-input-stream</span>
<span id="L1983" class="LineNr">1983 </span> 8b/copy 1/mod/*+disp8 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ecx+4) to eax</span>
<span id="L1984" class="LineNr">1984 </span> 81 5/subop/subtract 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> <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32 <span class="subxComment"># subtract from eax</span>
<span id="L1984" class="LineNr">1984 </span> 2d/subtract-from-eax <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32
<span id="L1985" class="LineNr">1985 </span> 50/push-eax
<span id="L1986" class="LineNr">1986 </span> <span class="subxS2Comment"># . . call</span>
<span id="L1987" class="LineNr">1987 </span> e8/call <a href='102test.subx.html#L23'>check-ints-equal</a>/disp32
@ -1823,7 +1823,7 @@ if ('onhashchange' in window) {
<span id="L2073" class="LineNr">2073 </span> 68/push 0xd/imm32
<span id="L2074" class="LineNr">2074 </span> <span class="subxS2Comment"># . . push slice-&gt;start - _test-input-stream</span>
<span id="L2075" class="LineNr">2075 </span> 8b/copy 0/mod/indirect 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *ecx to eax</span>
<span id="L2076" class="LineNr">2076 </span> 81 5/subop/subtract 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> <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32 <span class="subxComment"># subtract from eax</span>
<span id="L2076" class="LineNr">2076 </span> 2d/subtract-from-eax <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32
<span id="L2077" class="LineNr">2077 </span> 50/push-eax
<span id="L2078" class="LineNr">2078 </span> <span class="subxS2Comment"># . . call</span>
<span id="L2079" class="LineNr">2079 </span> e8/call <a href='102test.subx.html#L23'>check-ints-equal</a>/disp32
@ -1836,7 +1836,7 @@ if ('onhashchange' in window) {
<span id="L2086" class="LineNr">2086 </span> 68/push 0x18/imm32
<span id="L2087" class="LineNr">2087 </span> <span class="subxS2Comment"># . . push slice-&gt;end - _test-input-stream</span>
<span id="L2088" class="LineNr">2088 </span> 8b/copy 1/mod/*+disp8 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ecx+4) to eax</span>
<span id="L2089" class="LineNr">2089 </span> 81 5/subop/subtract 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> <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32 <span class="subxComment"># subtract from eax</span>
<span id="L2089" class="LineNr">2089 </span> 2d/subtract-from-eax <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32
<span id="L2090" class="LineNr">2090 </span> 50/push-eax
<span id="L2091" class="LineNr">2091 </span> <span class="subxS2Comment"># . . call</span>
<span id="L2092" class="LineNr">2092 </span> e8/call <a href='102test.subx.html#L23'>check-ints-equal</a>/disp32
@ -1886,7 +1886,7 @@ if ('onhashchange' in window) {
<span id="L2136" class="LineNr">2136 </span> 68/push 0xd/imm32
<span id="L2137" class="LineNr">2137 </span> <span class="subxS2Comment"># . . push slice-&gt;start - _test-input-stream</span>
<span id="L2138" class="LineNr">2138 </span> 8b/copy 0/mod/indirect 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *ecx to eax</span>
<span id="L2139" class="LineNr">2139 </span> 81 5/subop/subtract 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> <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32 <span class="subxComment"># subtract from eax</span>
<span id="L2139" class="LineNr">2139 </span> 2d/subtract-from-eax <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32
<span id="L2140" class="LineNr">2140 </span> 50/push-eax
<span id="L2141" class="LineNr">2141 </span> <span class="subxS2Comment"># . . call</span>
<span id="L2142" class="LineNr">2142 </span> e8/call <a href='102test.subx.html#L23'>check-ints-equal</a>/disp32
@ -1899,7 +1899,7 @@ if ('onhashchange' in window) {
<span id="L2149" class="LineNr">2149 </span> 68/push 0x15/imm32
<span id="L2150" class="LineNr">2150 </span> <span class="subxS2Comment"># . . push slice-&gt;end - _test-input-stream</span>
<span id="L2151" class="LineNr">2151 </span> 8b/copy 1/mod/*+disp8 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ecx+4) to eax</span>
<span id="L2152" class="LineNr">2152 </span> 81 5/subop/subtract 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> <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32 <span class="subxComment"># subtract from eax</span>
<span id="L2152" class="LineNr">2152 </span> 2d/subtract-from-eax <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32
<span id="L2153" class="LineNr">2153 </span> 50/push-eax
<span id="L2154" class="LineNr">2154 </span> <span class="subxS2Comment"># . . call</span>
<span id="L2155" class="LineNr">2155 </span> e8/call <a href='102test.subx.html#L23'>check-ints-equal</a>/disp32
@ -1949,7 +1949,7 @@ if ('onhashchange' in window) {
<span id="L2199" class="LineNr">2199 </span> 68/push 0xd/imm32
<span id="L2200" class="LineNr">2200 </span> <span class="subxS2Comment"># . . push slice-&gt;start - _test-input-stream</span>
<span id="L2201" class="LineNr">2201 </span> 8b/copy 0/mod/indirect 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *ecx to eax</span>
<span id="L2202" class="LineNr">2202 </span> 81 5/subop/subtract 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> <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32 <span class="subxComment"># subtract from eax</span>
<span id="L2202" class="LineNr">2202 </span> 2d/subtract-from-eax <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32
<span id="L2203" class="LineNr">2203 </span> 50/push-eax
<span id="L2204" class="LineNr">2204 </span> <span class="subxS2Comment"># . . call</span>
<span id="L2205" class="LineNr">2205 </span> e8/call <a href='102test.subx.html#L23'>check-ints-equal</a>/disp32
@ -1962,7 +1962,7 @@ if ('onhashchange' in window) {
<span id="L2212" class="LineNr">2212 </span> 68/push 0x19/imm32
<span id="L2213" class="LineNr">2213 </span> <span class="subxS2Comment"># . . push slice-&gt;end - _test-input-stream</span>
<span id="L2214" class="LineNr">2214 </span> 8b/copy 1/mod/*+disp8 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ecx+4) to eax</span>
<span id="L2215" class="LineNr">2215 </span> 81 5/subop/subtract 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> <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32 <span class="subxComment"># subtract from eax</span>
<span id="L2215" class="LineNr">2215 </span> 2d/subtract-from-eax <a href='112read-byte.subx.html#L331'>_test-input-stream</a>/imm32
<span id="L2216" class="LineNr">2216 </span> 50/push-eax
<span id="L2217" class="LineNr">2217 </span> <span class="subxS2Comment"># . . call</span>
<span id="L2218" class="LineNr">2218 </span> e8/call <a href='102test.subx.html#L23'>check-ints-equal</a>/disp32
@ -2041,7 +2041,7 @@ if ('onhashchange' in window) {
<span id="L2291" class="LineNr">2291 </span> <span class="subxComment"># if (*local-slice-&gt;start == '(') goto compound expression</span>
<span id="L2292" class="LineNr">2292 </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="L2293" class="LineNr">2293 </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="L2294" class="LineNr">2294 </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="L2294" class="LineNr">2294 </span> 25/and-eax-with 0xff/imm32
<span id="L2295" class="LineNr">2295 </span> 3d/compare-eax-and 0x28/imm32/open-paren
<span id="L2296" class="LineNr">2296 </span> 74/jump-if-= $parse-effective-address:compound-expression/disp8
<span id="L2297" class="LineNr">2297 </span><span class="Constant">$parse-effective-address:simple-register</span>:
@ -2107,7 +2107,7 @@ if ('onhashchange' in window) {
<span id="L2357" class="LineNr">2357 </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="L2358" class="LineNr">2358 </span> <span class="subxComment"># if (*local-slice-&gt;start == ')') goto end</span>
<span id="L2359" class="LineNr">2359 </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="L2360" class="LineNr">2360 </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="L2360" class="LineNr">2360 </span> 25/and-eax-with 0xff/imm32
<span id="L2361" class="LineNr">2361 </span> 3d/compare-eax-and 0x29/imm32/close-paren
<span id="L2362" class="LineNr">2362 </span> 0f 84/jump-if-= $parse-effective-address:end/disp32
<span id="L2363" class="LineNr">2363 </span> <span class="subxComment"># if (*local-slice-&gt;start == '-') goto displacement</span>
@ -2184,7 +2184,7 @@ if ('onhashchange' in window) {
<span id="L2434" class="LineNr">2434 </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="L2435" class="LineNr">2435 </span> <span class="subxComment"># if (*local-slice-&gt;start == ')') goto end</span>
<span id="L2436" class="LineNr">2436 </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="L2437" class="LineNr">2437 </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="L2437" class="LineNr">2437 </span> 25/and-eax-with 0xff/imm32
<span id="L2438" class="LineNr">2438 </span> 3d/compare-eax-and 0x29/imm32/close-paren
<span id="L2439" class="LineNr">2439 </span> 0f 84/jump-if-= $parse-effective-address:end/disp32
<span id="L2440" class="LineNr">2440 </span><span class="Constant">$parse-effective-address:check-for-scale</span>:
@ -2196,7 +2196,7 @@ if ('onhashchange' in window) {
<span id="L2446" class="LineNr">2446 </span> <span class="subxComment"># if (*local-slice-&gt;start != '&lt;') goto error2</span>
<span id="L2447" class="LineNr">2447 </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="L2448" class="LineNr">2448 </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="L2449" class="LineNr">2449 </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="L2449" class="LineNr">2449 </span> 25/and-eax-with 0xff/imm32
<span id="L2450" class="LineNr">2450 </span> 3d/compare-eax-and 0x3c/imm32/less-than
<span id="L2451" class="LineNr">2451 </span> 0f 85/jump-if-!= $parse-effective-address:error2/disp32
<span id="L2452" class="LineNr">2452 </span> <span class="subxComment"># ++local-slice-&gt;start to skip '&lt;'</span>
@ -2236,7 +2236,7 @@ if ('onhashchange' in window) {
<span id="L2486" class="LineNr">2486 </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="L2487" class="LineNr">2487 </span> <span class="subxComment"># if (*local-slice-&gt;start == ')') goto end</span>
<span id="L2488" class="LineNr">2488 </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="L2489" class="LineNr">2489 </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="L2489" class="LineNr">2489 </span> 25/and-eax-with 0xff/imm32
<span id="L2490" class="LineNr">2490 </span> 3d/compare-eax-and 0x29/imm32/close-paren
<span id="L2491" class="LineNr">2491 </span> 74/jump-if-= $parse-effective-address:end/disp8
<span id="L2492" class="LineNr">2492 </span><span class="Constant">$parse-effective-address:check-for-displacement</span>:
@ -2270,7 +2270,7 @@ if ('onhashchange' in window) {
<span id="L2520" class="LineNr">2520 </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="L2521" class="LineNr">2521 </span> <span class="subxComment"># if (*local-slice-&gt;start != ')') goto error4</span>
<span id="L2522" class="LineNr">2522 </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="L2523" class="LineNr">2523 </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="L2523" class="LineNr">2523 </span> 25/and-eax-with 0xff/imm32
<span id="L2524" class="LineNr">2524 </span> 3d/compare-eax-and 0x29/imm32/close-paren
<span id="L2525" class="LineNr">2525 </span> 0f 85/jump-if-!= $parse-effective-address:error4/disp32
<span id="L2526" class="LineNr">2526 </span><span class="Constant">$parse-effective-address:end</span>:
@ -3470,7 +3470,7 @@ if ('onhashchange' in window) {
<span id="L3895" class="LineNr">3895 </span> <span class="subxComment"># if (*local-slice-&gt;start == '(') return false</span>
<span id="L3896" class="LineNr">3896 </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="L3897" class="LineNr">3897 </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="L3898" class="LineNr">3898 </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="L3898" class="LineNr">3898 </span> 25/and-eax-with 0xff/imm32
<span id="L3899" class="LineNr">3899 </span> 3d/compare-eax-and 0x28/imm32/open-paren
<span id="L3900" class="LineNr">3900 </span> 74/jump-if-= $disp32-mode?:false/disp8
<span id="L3901" class="LineNr">3901 </span><span class="Constant">$disp32-mode?:check-for-register</span>:

699
html/linux/stack_array.subx.html generated Normal file
View File

@ -0,0 +1,699 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Mu - linux/stack_array.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="colorscheme" content="minimal-dark">
<style type="text/css">
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #a8a8a8; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #a8a8a8; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.subxComment { color: #005faf; }
.subxS1Comment { color: #0000af; }
.LineNr { }
.Normal { color: #000000; background-color: #a8a8a8; padding-bottom: 1px; }
.SpecialChar { color: #d70000; }
.Constant { color: #008787; }
.CommentedCode { color: #8a8a8a; }
.subxFunction { color: #af5f00; text-decoration: underline; }
-->
</style>
<script type='text/javascript'>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
function JumpToLine()
{
var lineNum;
lineNum = window.location.hash;
lineNum = lineNum.substr(1); /* strip off '#' */
if (lineNum.indexOf('L') == -1) {
lineNum = 'L'+lineNum;
}
var lineElem = document.getElementById(lineNum);
/* Always jump to new location even if the line was hidden inside a fold, or
* we corrected the raw number to a line ID.
*/
if (lineElem) {
lineElem.scrollIntoView(true);
}
return true;
}
if ('onhashchange' in window) {
window.onhashchange = JumpToLine;
}
-->
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/main/linux/stack_array.subx'>https://github.com/akkartik/mu/blob/main/linux/stack_array.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span>== code
<span id="L2" class="LineNr"> 2 </span>
<span id="L3" class="LineNr"> 3 </span><span class="subxComment"># Problem: create a function which pushes n zeros on the stack.</span>
<span id="L4" class="LineNr"> 4 </span><span class="subxComment"># This is not a regular function, so it won't be idiomatic.</span>
<span id="L5" class="LineNr"> 5 </span><span class="subxComment"># Registers must be properly restored.</span>
<span id="L6" class="LineNr"> 6 </span><span class="subxComment"># Registers can be spilled, but that modifies the stack and needs to be</span>
<span id="L7" class="LineNr"> 7 </span><span class="subxComment"># cleaned up.</span>
<span id="L8" class="LineNr"> 8 </span>
<span id="L9" class="LineNr"> 9 </span><span class="subxComment"># This file is kinda like a research notebook, to interactively arrive at the</span>
<span id="L10" class="LineNr"> 10 </span><span class="subxComment"># solution. Nobody should have to do this without a computer. To run it:</span>
<span id="L11" class="LineNr"> 11 </span><span class="subxComment"># $ ./translate_subx_debug 000init.linux stack_array.subx &amp;&amp; bootstrap/bootstrap --debug --trace --dump run a.elf</span>
<span id="L12" class="LineNr"> 12 </span><span class="subxComment"># There are multiple versions. You'll need to uncomment exactly one.</span>
<span id="L13" class="LineNr"> 13 </span>
<span id="L14" class="LineNr"> 14 </span><span class="subxComment"># The final version has its own Entry, but the others share this one.</span>
<span id="L15" class="LineNr"> 15 </span><span class="CommentedCode">#? Entry:</span>
<span id="L16" class="LineNr"> 16 </span><span class="CommentedCode">#? # . prologue</span>
<span id="L17" class="LineNr"> 17 </span><span class="CommentedCode">#? 89/&lt;- %ebp 4/r32/esp</span>
<span id="L18" class="LineNr"> 18 </span><span class="CommentedCode">#? #</span>
<span id="L19" class="LineNr"> 19 </span><span class="CommentedCode">#? 68/push 0xfcfdfeff/imm32</span>
<span id="L20" class="LineNr"> 20 </span><span class="CommentedCode">#? b8/copy-to-eax 0x34353637/imm32</span>
<span id="L21" class="LineNr"> 21 </span><span class="CommentedCode">#? $dump-stack:</span>
<span id="L22" class="LineNr"> 22 </span><span class="CommentedCode">#? (push-n-zero-bytes 0x20)</span>
<span id="L23" class="LineNr"> 23 </span><span class="CommentedCode">#? $dump-stack2:</span>
<span id="L24" class="LineNr"> 24 </span><span class="CommentedCode">#? 68/push 0x20202020/imm32</span>
<span id="L25" class="LineNr"> 25 </span><span class="CommentedCode">#? $dump-stack3:</span>
<span id="L26" class="LineNr"> 26 </span><span class="CommentedCode">#? b8/copy-to-eax 1/imm32/exit</span>
<span id="L27" class="LineNr"> 27 </span><span class="CommentedCode">#? cd/syscall 0x80/imm8</span>
<span id="L28" class="LineNr"> 28 </span>
<span id="L29" class="LineNr"> 29 </span><span class="subxComment">## 0</span>
<span id="L30" class="LineNr"> 30 </span>
<span id="L31" class="LineNr"> 31 </span><span class="CommentedCode">#? push-n-zero-bytes: # n: int</span>
<span id="L32" class="LineNr"> 32 </span><span class="CommentedCode">#? # . prologue</span>
<span id="L33" class="LineNr"> 33 </span><span class="CommentedCode">#? 55/push-ebp</span>
<span id="L34" class="LineNr"> 34 </span><span class="CommentedCode">#? 89/&lt;- %ebp 4/r32/esp</span>
<span id="L35" class="LineNr"> 35 </span><span class="CommentedCode">#? $push-n-zero-bytes:end:</span>
<span id="L36" class="LineNr"> 36 </span><span class="CommentedCode">#? # . epilogue</span>
<span id="L37" class="LineNr"> 37 </span><span class="CommentedCode">#? 89/&lt;- %esp 5/r32/ebp</span>
<span id="L38" class="LineNr"> 38 </span><span class="CommentedCode">#? 5d/pop-to-ebp</span>
<span id="L39" class="LineNr"> 39 </span><span class="CommentedCode">#? c3/return</span>
<span id="L40" class="LineNr"> 40 </span>
<span id="L41" class="LineNr"> 41 </span><span class="subxComment"># stack at dump-stack:</span>
<span id="L42" class="LineNr"> 42 </span><span class="subxComment"># 0 a: bdffffd0: 00000000 00000000 00000000 00000000</span>
<span id="L43" class="LineNr"> 43 </span><span class="subxComment"># 0 a: bdffffe0: 00000000 00000000 00000000 00000000</span>
<span id="L44" class="LineNr"> 44 </span><span class="subxComment"># 0 a: bdfffff0: 00000000 fcfdfeff 00000001 bf000000</span>
<span id="L45" class="LineNr"> 45 </span><span class="subxComment">#</span>
<span id="L46" class="LineNr"> 46 </span><span class="subxComment"># =&gt;</span>
<span id="L47" class="LineNr"> 47 </span><span class="subxComment">#</span>
<span id="L48" class="LineNr"> 48 </span><span class="subxComment"># stack at dump-stack3:</span>
<span id="L49" class="LineNr"> 49 </span><span class="subxComment"># 0 a: stack:</span>
<span id="L50" class="LineNr"> 50 </span><span class="subxComment"># 0 a: bdffffd0: 00000000 00000000 00000000 00000000</span>
<span id="L51" class="LineNr"> 51 </span><span class="subxComment"># 0 a: bdffffe0: 00000000 00000000 bdfffff8/ebp 090000cc/ra</span>
<span id="L52" class="LineNr"> 52 </span><span class="subxComment"># 0 a: bdfffff0: 00000004/arg fcfdfeff 00000001 bf000000</span>
<span id="L53" class="LineNr"> 53 </span>
<span id="L54" class="LineNr"> 54 </span><span class="subxComment">## 1</span>
<span id="L55" class="LineNr"> 55 </span>
<span id="L56" class="LineNr"> 56 </span><span class="CommentedCode">#? push-n-zero-bytes: # n: int</span>
<span id="L57" class="LineNr"> 57 </span><span class="CommentedCode">#? # . prologue</span>
<span id="L58" class="LineNr"> 58 </span><span class="CommentedCode">#? 55/push-ebp</span>
<span id="L59" class="LineNr"> 59 </span><span class="CommentedCode">#? 89/&lt;- %ebp 4/r32/esp</span>
<span id="L60" class="LineNr"> 60 </span><span class="CommentedCode">#? # . save registers</span>
<span id="L61" class="LineNr"> 61 </span><span class="CommentedCode">#? 50/push-eax</span>
<span id="L62" class="LineNr"> 62 </span><span class="CommentedCode">#? $push-n-zero-bytes:end:</span>
<span id="L63" class="LineNr"> 63 </span><span class="CommentedCode">#? # . restore registers</span>
<span id="L64" class="LineNr"> 64 </span><span class="CommentedCode">#? 58/pop-to-eax</span>
<span id="L65" class="LineNr"> 65 </span><span class="CommentedCode">#? # . epilogue</span>
<span id="L66" class="LineNr"> 66 </span><span class="CommentedCode">#? 5d/pop-to-ebp</span>
<span id="L67" class="LineNr"> 67 </span><span class="CommentedCode">#? c3/return</span>
<span id="L68" class="LineNr"> 68 </span>
<span id="L69" class="LineNr"> 69 </span><span class="subxComment"># stack at dump-stack3:</span>
<span id="L70" class="LineNr"> 70 </span><span class="subxComment"># 0 a: bdffffd0: 00000000 00000000 00000000 00000000</span>
<span id="L71" class="LineNr"> 71 </span><span class="subxComment"># 0 a: bdffffe0: 00000000 34353637 bdfffff8 090000d1</span>
<span id="L72" class="LineNr"> 72 </span><span class="subxComment"># 0 a: bdfffff0: 00000004 fcfdfeff 00000001 bf000000</span>
<span id="L73" class="LineNr"> 73 </span>
<span id="L74" class="LineNr"> 74 </span><span class="subxComment">## 2</span>
<span id="L75" class="LineNr"> 75 </span>
<span id="L76" class="LineNr"> 76 </span><span class="CommentedCode">#? push-n-zero-bytes: # n: int</span>
<span id="L77" class="LineNr"> 77 </span><span class="CommentedCode">#? # . prologue</span>
<span id="L78" class="LineNr"> 78 </span><span class="CommentedCode">#? 55/push-ebp</span>
<span id="L79" class="LineNr"> 79 </span><span class="CommentedCode">#? 89/&lt;- %ebp 4/r32/esp</span>
<span id="L80" class="LineNr"> 80 </span><span class="CommentedCode">#? # . save registers</span>
<span id="L81" class="LineNr"> 81 </span><span class="CommentedCode">#? 50/push-eax</span>
<span id="L82" class="LineNr"> 82 </span><span class="CommentedCode">#? #</span>
<span id="L83" class="LineNr"> 83 </span><span class="CommentedCode">#? 8b/-&gt; *(esp+8) 0/r32/eax</span>
<span id="L84" class="LineNr"> 84 </span><span class="CommentedCode">#? 2b/subtract *(ebp+8) 4/r32/esp</span>
<span id="L85" class="LineNr"> 85 </span><span class="CommentedCode">#? 89/&lt;- *(esp+8) 0/r32/eax</span>
<span id="L86" class="LineNr"> 86 </span><span class="CommentedCode">#? $push-n-zero-bytes:end:</span>
<span id="L87" class="LineNr"> 87 </span><span class="CommentedCode">#? # . restore registers</span>
<span id="L88" class="LineNr"> 88 </span><span class="CommentedCode">#? 58/pop-to-eax</span>
<span id="L89" class="LineNr"> 89 </span><span class="CommentedCode">#? # . epilogue</span>
<span id="L90" class="LineNr"> 90 </span><span class="CommentedCode">#? 5d/pop-to-ebp</span>
<span id="L91" class="LineNr"> 91 </span><span class="CommentedCode">#? c3/return</span>
<span id="L92" class="LineNr"> 92 </span>
<span id="L93" class="LineNr"> 93 </span><span class="subxComment"># stack at dump-stack3:</span>
<span id="L94" class="LineNr"> 94 </span><span class="subxComment"># 0 a: bdffff90: 00000000 00000000 00000000 00000000</span>
<span id="L95" class="LineNr"> 95 </span><span class="subxComment"># 0 a: bdffffa0: 00000000 00000000 00000000 00000000</span>
<span id="L96" class="LineNr"> 96 </span><span class="subxComment"># 0 a: bdffffb0: 00000000 00000000 00000000 00000000</span>
<span id="L97" class="LineNr"> 97 </span><span class="subxComment"># 0 a: bdffffc0: 00000000 00000000 00000000 090000d1</span>
<span id="L98" class="LineNr"> 98 </span><span class="subxComment"># 0 a: bdffffd0: 00000000 00000000 00000000 00000000</span>
<span id="L99" class="LineNr"> 99 </span><span class="subxComment"># 0 a: bdffffe0: 00000000 34353637 bdfffff8 090000d1</span>
<span id="L100" class="LineNr">100 </span><span class="subxComment"># 0 a: bdfffff0: 00000020 fcfdfeff 00000001 bf000000</span>
<span id="L101" class="LineNr">101 </span>
<span id="L102" class="LineNr">102 </span><span class="subxComment">## 3</span>
<span id="L103" class="LineNr">103 </span>
<span id="L104" class="LineNr">104 </span><span class="CommentedCode">#? push-n-zero-bytes: # n: int</span>
<span id="L105" class="LineNr">105 </span><span class="CommentedCode">#? # . prologue</span>
<span id="L106" class="LineNr">106 </span><span class="CommentedCode">#? 55/push-ebp</span>
<span id="L107" class="LineNr">107 </span><span class="CommentedCode">#? 89/&lt;- %ebp 4/r32/esp</span>
<span id="L108" class="LineNr">108 </span><span class="CommentedCode">#? # . save registers</span>
<span id="L109" class="LineNr">109 </span><span class="CommentedCode">#? # -- esp = ebp</span>
<span id="L110" class="LineNr">110 </span><span class="CommentedCode">#? 50/push-eax</span>
<span id="L111" class="LineNr">111 </span><span class="CommentedCode">#? # -- esp+8 = ebp+4</span>
<span id="L112" class="LineNr">112 </span><span class="CommentedCode">#? 8b/-&gt; *(esp+8) 0/r32/eax</span>
<span id="L113" class="LineNr">113 </span><span class="CommentedCode">#? 2b/subtract *(ebp+8) 4/r32/esp</span>
<span id="L114" class="LineNr">114 </span><span class="CommentedCode">#? 89/&lt;- *(esp+8) 0/r32/eax</span>
<span id="L115" class="LineNr">115 </span><span class="CommentedCode">#? c7 0/subop/copy *(ebp+4) 0/imm32</span>
<span id="L116" class="LineNr">116 </span><span class="CommentedCode">#? $push-n-zero-bytes:end:</span>
<span id="L117" class="LineNr">117 </span><span class="CommentedCode">#? # . restore registers</span>
<span id="L118" class="LineNr">118 </span><span class="CommentedCode">#? 58/pop-to-eax</span>
<span id="L119" class="LineNr">119 </span><span class="CommentedCode">#? # . epilogue</span>
<span id="L120" class="LineNr">120 </span><span class="CommentedCode">#? 5d/pop-to-ebp</span>
<span id="L121" class="LineNr">121 </span><span class="CommentedCode">#? c3/return</span>
<span id="L122" class="LineNr">122 </span>
<span id="L123" class="LineNr">123 </span><span class="subxComment"># stack at dump-stack3:</span>
<span id="L124" class="LineNr">124 </span><span class="subxComment"># 0 a: bdffff90: 00000000 00000000 00000000 00000000</span>
<span id="L125" class="LineNr">125 </span><span class="subxComment"># 0 a: bdffffa0: 00000000 00000000 00000000 00000000</span>
<span id="L126" class="LineNr">126 </span><span class="subxComment"># 0 a: bdffffb0: 00000000 00000000 00000000 00000000</span>
<span id="L127" class="LineNr">127 </span><span class="subxComment"># 0 a: bdffffc0: 00000000 00000000 00000000 090000d1</span>
<span id="L128" class="LineNr">128 </span><span class="subxComment"># 0 a: bdffffd0: 20202020 00000000 00000000 00000000</span>
<span id="L129" class="LineNr">129 </span><span class="subxComment"># 0 a: bdffffe0: 00000000 34353637 bdfffff8 00000000</span>
<span id="L130" class="LineNr">130 </span><span class="subxComment"># 0 a: bdfffff0: 00000020 fcfdfeff 00000001 bf000000</span>
<span id="L131" class="LineNr">131 </span>
<span id="L132" class="LineNr">132 </span><span class="subxComment">## 4</span>
<span id="L133" class="LineNr">133 </span>
<span id="L134" class="LineNr">134 </span><span class="CommentedCode">#? push-n-zero-bytes: # n: int</span>
<span id="L135" class="LineNr">135 </span><span class="CommentedCode">#? # . prologue</span>
<span id="L136" class="LineNr">136 </span><span class="CommentedCode">#? 55/push-ebp</span>
<span id="L137" class="LineNr">137 </span><span class="CommentedCode">#? 89/&lt;- %ebp 4/r32/esp</span>
<span id="L138" class="LineNr">138 </span><span class="CommentedCode">#? # . save registers</span>
<span id="L139" class="LineNr">139 </span><span class="CommentedCode">#? # -- esp = ebp</span>
<span id="L140" class="LineNr">140 </span><span class="CommentedCode">#? 50/push-eax</span>
<span id="L141" class="LineNr">141 </span><span class="CommentedCode">#? # copy return address over</span>
<span id="L142" class="LineNr">142 </span><span class="CommentedCode">#? # -- esp+8 = ebp+4</span>
<span id="L143" class="LineNr">143 </span><span class="CommentedCode">#? 8b/-&gt; *(esp+8) 0/r32/eax</span>
<span id="L144" class="LineNr">144 </span><span class="CommentedCode">#? 2b/subtract *(ebp+8) 4/r32/esp</span>
<span id="L145" class="LineNr">145 </span><span class="CommentedCode">#? 89/&lt;- *(esp+8) 0/r32/eax</span>
<span id="L146" class="LineNr">146 </span><span class="CommentedCode">#? 58/pop-to-eax</span>
<span id="L147" class="LineNr">147 </span><span class="CommentedCode">#? c7 0/subop/copy *(ebp+8) 0/imm32</span>
<span id="L148" class="LineNr">148 </span><span class="CommentedCode">#? c7 0/subop/copy *(ebp+4) 0/imm32</span>
<span id="L149" class="LineNr">149 </span><span class="CommentedCode">#? c7 0/subop/copy *(ebp+0) 0/imm32</span>
<span id="L150" class="LineNr">150 </span><span class="CommentedCode">#? c7 0/subop/copy *(ebp-4) 0/imm32</span>
<span id="L151" class="LineNr">151 </span><span class="CommentedCode">#? # . epilogue</span>
<span id="L152" class="LineNr">152 </span><span class="CommentedCode">#? 5d/pop-to-ebp</span>
<span id="L153" class="LineNr">153 </span><span class="CommentedCode">#? c3/return</span>
<span id="L154" class="LineNr">154 </span>
<span id="L155" class="LineNr">155 </span><span class="subxComment"># stack at dump-stack3:</span>
<span id="L156" class="LineNr">156 </span><span class="subxComment"># 0 a: bdffff90: 00000000 00000000 00000000 00000000</span>
<span id="L157" class="LineNr">157 </span><span class="subxComment"># 0 a: bdffffa0: 00000000 00000000 00000000 00000000</span>
<span id="L158" class="LineNr">158 </span><span class="subxComment"># 0 a: bdffffb0: 00000000 00000000 00000000 00000000</span>
<span id="L159" class="LineNr">159 </span><span class="subxComment"># 0 a: bdffffc0: 00000000 00000000 00000000 090000d1</span>
<span id="L160" class="LineNr">160 </span><span class="subxComment"># 0 a: bdffffd0: 20202020 00000000 00000000 00000000</span>
<span id="L161" class="LineNr">161 </span><span class="subxComment"># 0 a: bdffffe0: 00000000 00000000 00000000 00000000</span>
<span id="L162" class="LineNr">162 </span><span class="subxComment"># 0 a: bdfffff0: 00000000 fcfdfeff 00000001 bf000000</span>
<span id="L163" class="LineNr">163 </span>
<span id="L164" class="LineNr">164 </span><span class="subxComment"># Stack looks good now (the 20202020 marks where the array length 0x20 will</span>
<span id="L165" class="LineNr">165 </span><span class="subxComment"># go, and the next 0x20 bytes show the space for the array has been zeroed</span>
<span id="L166" class="LineNr">166 </span><span class="subxComment"># out).</span>
<span id="L167" class="LineNr">167 </span><span class="subxComment"># Final issue: ebp has been clobbered on return.</span>
<span id="L168" class="LineNr">168 </span>
<span id="L169" class="LineNr">169 </span><span class="subxComment">## 5</span>
<span id="L170" class="LineNr">170 </span>
<span id="L171" class="LineNr">171 </span><span class="subxComment"># I'd like to translate ebp to esp so we can stop pushing ebp. But we need to</span>
<span id="L172" class="LineNr">172 </span><span class="subxComment"># hold 'n' somewhere, which would require a register, which we then need to</span>
<span id="L173" class="LineNr">173 </span><span class="subxComment"># push.</span>
<span id="L174" class="LineNr">174 </span>
<span id="L175" class="LineNr">175 </span><span class="CommentedCode">#? push-n-zero-bytes: # n: int</span>
<span id="L176" class="LineNr">176 </span><span class="CommentedCode">#? 55/push-ebp</span>
<span id="L177" class="LineNr">177 </span><span class="CommentedCode">#? 89/&lt;- %ebp 4/r32/esp</span>
<span id="L178" class="LineNr">178 </span><span class="CommentedCode">#? # -- esp = ebp</span>
<span id="L179" class="LineNr">179 </span><span class="CommentedCode">#? 50/push-eax</span>
<span id="L180" class="LineNr">180 </span><span class="CommentedCode">#? $push-n-zero-bytes:bulk-cleaning:</span>
<span id="L181" class="LineNr">181 </span><span class="CommentedCode">#? $push-n-zero-bytes:copy-ra:</span>
<span id="L182" class="LineNr">182 </span><span class="CommentedCode">#? # -- esp+8 = ebp+4</span>
<span id="L183" class="LineNr">183 </span><span class="CommentedCode">#? 8b/-&gt; *(esp+8) 0/r32/eax</span>
<span id="L184" class="LineNr">184 </span><span class="CommentedCode">#? 2b/subtract *(esp+0xc) 4/r32/esp</span>
<span id="L185" class="LineNr">185 </span><span class="CommentedCode">#? # -- esp+8+n = ebp+4</span>
<span id="L186" class="LineNr">186 </span><span class="CommentedCode">#? 89/&lt;- *(esp+8) 0/r32/eax</span>
<span id="L187" class="LineNr">187 </span><span class="CommentedCode">#? 58/pop-to-eax</span>
<span id="L188" class="LineNr">188 </span><span class="CommentedCode">#? # -- esp+n = ebp</span>
<span id="L189" class="LineNr">189 </span><span class="CommentedCode">#? $push-n-zero-bytes:spot-cleaning:</span>
<span id="L190" class="LineNr">190 </span><span class="CommentedCode">#? c7 0/subop/copy *(ebp+8) 0/imm32</span>
<span id="L191" class="LineNr">191 </span><span class="CommentedCode">#? c7 0/subop/copy *(ebp+4) 0/imm32</span>
<span id="L192" class="LineNr">192 </span><span class="CommentedCode">#? c7 0/subop/copy *(ebp+0) 0/imm32</span>
<span id="L193" class="LineNr">193 </span><span class="CommentedCode">#? c7 0/subop/copy *(ebp-4) 0/imm32</span>
<span id="L194" class="LineNr">194 </span><span class="CommentedCode">#? 5d/pop-to-ebp</span>
<span id="L195" class="LineNr">195 </span><span class="CommentedCode">#? c3/return</span>
<span id="L196" class="LineNr">196 </span>
<span id="L197" class="LineNr">197 </span><span class="subxComment"># stack at dump-stack3:</span>
<span id="L198" class="LineNr">198 </span><span class="subxComment"># 0 a: bdffff90: 00000000 00000000 00000000 00000000</span>
<span id="L199" class="LineNr">199 </span><span class="subxComment"># 0 a: bdffffa0: 00000000 00000000 00000000 00000000</span>
<span id="L200" class="LineNr">200 </span><span class="subxComment"># 0 a: bdffffb0: 00000000 00000000 00000000 00000000</span>
<span id="L201" class="LineNr">201 </span><span class="subxComment"># 0 a: bdffffc0: 00000000 00000000 00000000 090000d1</span>
<span id="L202" class="LineNr">202 </span><span class="subxComment"># 0 a: bdffffd0: 20202020 00000000 00000000 00000000</span>
<span id="L203" class="LineNr">203 </span><span class="subxComment"># 0 a: bdffffe0: 00000000 00000000 00000000 00000000</span>
<span id="L204" class="LineNr">204 </span><span class="subxComment"># 0 a: bdfffff0: 00000000 fcfdfeff 00000001 bf000000</span>
<span id="L205" class="LineNr">205 </span>
<span id="L206" class="LineNr">206 </span><span class="subxComment"># Bah. May be simpler to just create a new segment of global space for this</span>
<span id="L207" class="LineNr">207 </span><span class="subxComment"># function.</span>
<span id="L208" class="LineNr">208 </span>
<span id="L209" class="LineNr">209 </span><span class="subxComment">## 6</span>
<span id="L210" class="LineNr">210 </span>
<span id="L211" class="LineNr">211 </span><span class="CommentedCode">#? push-n-zero-bytes: # n: int</span>
<span id="L212" class="LineNr">212 </span><span class="CommentedCode">#? 89/&lt;- *Push-n-zero-bytes-ebp 5/r32/ebp # spill ebp without affecting stack</span>
<span id="L213" class="LineNr">213 </span><span class="CommentedCode">#? 89/&lt;- %ebp 4/r32/esp</span>
<span id="L214" class="LineNr">214 </span><span class="CommentedCode">#? # -- esp = ebp</span>
<span id="L215" class="LineNr">215 </span><span class="CommentedCode">#? 50/push-eax</span>
<span id="L216" class="LineNr">216 </span><span class="CommentedCode">#? $push-n-zero-bytes:bulk-cleaning:</span>
<span id="L217" class="LineNr">217 </span><span class="CommentedCode">#? $push-n-zero-bytes:copy-ra:</span>
<span id="L218" class="LineNr">218 </span><span class="CommentedCode">#? # -- esp+8 = ebp+4</span>
<span id="L219" class="LineNr">219 </span><span class="CommentedCode">#? # -- esp+4 = ebp</span>
<span id="L220" class="LineNr">220 </span><span class="CommentedCode">#? 8b/-&gt; *(esp+4) 0/r32/eax</span>
<span id="L221" class="LineNr">221 </span><span class="CommentedCode">#? 2b/subtract *(ebp+4) 4/r32/esp</span>
<span id="L222" class="LineNr">222 </span><span class="CommentedCode">#? # -- esp+4+n = ebp</span>
<span id="L223" class="LineNr">223 </span><span class="CommentedCode">#? 89/&lt;- *(esp+4) 0/r32/eax</span>
<span id="L224" class="LineNr">224 </span><span class="CommentedCode">#? 58/pop-to-eax</span>
<span id="L225" class="LineNr">225 </span><span class="CommentedCode">#? # -- esp+n = ebp</span>
<span id="L226" class="LineNr">226 </span><span class="CommentedCode">#? $push-n-zero-bytes:spot-cleaning:</span>
<span id="L227" class="LineNr">227 </span><span class="CommentedCode">#? c7 0/subop/copy *(ebp+4) 0/imm32</span>
<span id="L228" class="LineNr">228 </span><span class="CommentedCode">#? c7 0/subop/copy *(ebp+0) 0/imm32</span>
<span id="L229" class="LineNr">229 </span><span class="CommentedCode">#? c7 0/subop/copy *(ebp-4) 0/imm32</span>
<span id="L230" class="LineNr">230 </span><span class="CommentedCode">#? c7 0/subop/copy *(ebp-8) 0/imm32</span>
<span id="L231" class="LineNr">231 </span><span class="CommentedCode">#? 8b/-&gt; *Push-n-zero-bytes-ebp 5/r32/ebp # restore spill</span>
<span id="L232" class="LineNr">232 </span><span class="CommentedCode">#? c3/return</span>
<span id="L233" class="LineNr">233 </span><span class="CommentedCode">#? </span>
<span id="L234" class="LineNr">234 </span><span class="CommentedCode">#? == data</span>
<span id="L235" class="LineNr">235 </span><span class="CommentedCode">#? Push-n-zero-bytes-ebp: # (addr int)</span>
<span id="L236" class="LineNr">236 </span><span class="CommentedCode">#? 0/imm32</span>
<span id="L237" class="LineNr">237 </span><span class="CommentedCode">#? == code</span>
<span id="L238" class="LineNr">238 </span>
<span id="L239" class="LineNr">239 </span><span class="subxComment"># stack at dump-stack3:</span>
<span id="L240" class="LineNr">240 </span><span class="subxComment"># 0 a: bdffff90: 00000000 00000000 00000000 00000000</span>
<span id="L241" class="LineNr">241 </span><span class="subxComment"># 0 a: bdffffa0: 00000000 00000000 00000000 00000000</span>
<span id="L242" class="LineNr">242 </span><span class="subxComment"># 0 a: bdffffb0: 00000000 00000000 00000000 00000000</span>
<span id="L243" class="LineNr">243 </span><span class="subxComment"># 0 a: bdffffc0: 00000000 00000000 00000000 090000d1</span>
<span id="L244" class="LineNr">244 </span><span class="subxComment"># 0 a: bdffffd0: 20202020 00000000 00000000 00000000</span>
<span id="L245" class="LineNr">245 </span><span class="subxComment"># 0 a: bdffffe0: 00000000 00000000 00000000 00000000</span>
<span id="L246" class="LineNr">246 </span><span class="subxComment"># 0 a: bdfffff0: 00000000 fcfdfeff 00000001 bf000000</span>
<span id="L247" class="LineNr">247 </span>
<span id="L248" class="LineNr">248 </span><span class="subxComment"># Ok, we're there. Now start using zero-out rather than spot-cleaning.</span>
<span id="L249" class="LineNr">249 </span>
<span id="L250" class="LineNr">250 </span><span class="subxComment">## 7: we need to zero out the return address, but we can't do it inside the function.</span>
<span id="L251" class="LineNr">251 </span><span class="subxComment">## So we'll change the signature slightly.</span>
<span id="L252" class="LineNr">252 </span><span class="subxComment">## Before: clear N bytes and then push N as the array length.</span>
<span id="L253" class="LineNr">253 </span><span class="subxComment">## After: clear N bytes, set *esp to N.</span>
<span id="L254" class="LineNr">254 </span><span class="subxComment">## The helper adds and clears N bytes *before* esp. esp can't be cleared since</span>
<span id="L255" class="LineNr">255 </span><span class="subxComment">## it contains the return address.</span>
<span id="L256" class="LineNr">256 </span>
<span id="L257" class="LineNr">257 </span><span class="CommentedCode">#? Entry:</span>
<span id="L258" class="LineNr">258 </span><span class="CommentedCode">#? # . prologue</span>
<span id="L259" class="LineNr">259 </span><span class="CommentedCode">#? 89/&lt;- %ebp 4/r32/esp</span>
<span id="L260" class="LineNr">260 </span><span class="CommentedCode">#? #</span>
<span id="L261" class="LineNr">261 </span><span class="CommentedCode">#? 68/push 0xfcfdfeff/imm32</span>
<span id="L262" class="LineNr">262 </span><span class="CommentedCode">#? b8/copy-to-eax 0x34353637/imm32</span>
<span id="L263" class="LineNr">263 </span><span class="CommentedCode">#? $dump-stack0:</span>
<span id="L264" class="LineNr">264 </span><span class="CommentedCode">#? (push-n-zero-bytes 0x20)</span>
<span id="L265" class="LineNr">265 </span><span class="CommentedCode">#? $dump-stack9:</span>
<span id="L266" class="LineNr">266 </span><span class="CommentedCode">#? c7 0/subop/copy *esp 0x20/imm32</span>
<span id="L267" class="LineNr">267 </span><span class="CommentedCode">#? $dump-stacka:</span>
<span id="L268" class="LineNr">268 </span><span class="CommentedCode">#? b8/copy-to-eax 1/imm32/exit</span>
<span id="L269" class="LineNr">269 </span><span class="CommentedCode">#? cd/syscall 0x80/imm8</span>
<span id="L270" class="LineNr">270 </span><span class="CommentedCode">#? </span>
<span id="L271" class="LineNr">271 </span><span class="CommentedCode">#? push-n-zero-bytes: # n: int</span>
<span id="L272" class="LineNr">272 </span><span class="CommentedCode">#? $push-n-zero-bytes:prologue:</span>
<span id="L273" class="LineNr">273 </span><span class="CommentedCode">#? 89/&lt;- *Push-n-zero-bytes-ebp 5/r32/ebp # spill ebp without affecting stack</span>
<span id="L274" class="LineNr">274 </span><span class="CommentedCode">#? 89/&lt;- %ebp 4/r32/esp</span>
<span id="L275" class="LineNr">275 </span><span class="CommentedCode">#? $push-n-zero-bytes:copy-ra:</span>
<span id="L276" class="LineNr">276 </span><span class="CommentedCode">#? $dump-stack1:</span>
<span id="L277" class="LineNr">277 </span><span class="CommentedCode">#? # -- esp = ebp</span>
<span id="L278" class="LineNr">278 </span><span class="CommentedCode">#? 50/push-eax</span>
<span id="L279" class="LineNr">279 </span><span class="CommentedCode">#? $dump-stack2:</span>
<span id="L280" class="LineNr">280 </span><span class="CommentedCode">#? # -- esp+8 = ebp+4</span>
<span id="L281" class="LineNr">281 </span><span class="CommentedCode">#? # -- esp+4 = ebp</span>
<span id="L282" class="LineNr">282 </span><span class="CommentedCode">#? 8b/-&gt; *(esp+4) 0/r32/eax</span>
<span id="L283" class="LineNr">283 </span><span class="CommentedCode">#? $dump-stack3:</span>
<span id="L284" class="LineNr">284 </span><span class="CommentedCode">#? 2b/subtract *(ebp+4) 4/r32/esp</span>
<span id="L285" class="LineNr">285 </span><span class="CommentedCode">#? $dump-stack4:</span>
<span id="L286" class="LineNr">286 </span><span class="CommentedCode">#? # -- esp+4+n = ebp</span>
<span id="L287" class="LineNr">287 </span><span class="CommentedCode">#? 89/&lt;- *(esp+4) 0/r32/eax</span>
<span id="L288" class="LineNr">288 </span><span class="CommentedCode">#? $dump-stack5:</span>
<span id="L289" class="LineNr">289 </span><span class="CommentedCode">#? 58/pop-to-eax</span>
<span id="L290" class="LineNr">290 </span><span class="CommentedCode">#? # -- esp+n = ebp</span>
<span id="L291" class="LineNr">291 </span><span class="CommentedCode">#? $push-n-zero-bytes:bulk-cleaning:</span>
<span id="L292" class="LineNr">292 </span><span class="CommentedCode">#? $dump-stack6:</span>
<span id="L293" class="LineNr">293 </span><span class="CommentedCode">#? 89/&lt;- *Push-n-zero-bytes-esp 4/r32/esp</span>
<span id="L294" class="LineNr">294 </span><span class="CommentedCode">#? 81 0/subop/add *Push-n-zero-bytes-esp 4/imm32</span>
<span id="L295" class="LineNr">295 </span><span class="CommentedCode">#? $dump-stack7:</span>
<span id="L296" class="LineNr">296 </span><span class="CommentedCode">#? (zero-out *Push-n-zero-bytes-esp *(ebp+4)) # n</span>
<span id="L297" class="LineNr">297 </span><span class="CommentedCode">#? $push-n-zero-bytes:epilogue:</span>
<span id="L298" class="LineNr">298 </span><span class="CommentedCode">#? $dump-stack8:</span>
<span id="L299" class="LineNr">299 </span><span class="CommentedCode">#? 8b/-&gt; *Push-n-zero-bytes-ebp 5/r32/ebp # restore spill</span>
<span id="L300" class="LineNr">300 </span><span class="CommentedCode">#? c3/return</span>
<span id="L301" class="LineNr">301 </span><span class="CommentedCode">#? </span>
<span id="L302" class="LineNr">302 </span><span class="CommentedCode">#? zero-out: # start: (addr byte), len: int</span>
<span id="L303" class="LineNr">303 </span><span class="CommentedCode">#? # pseudocode:</span>
<span id="L304" class="LineNr">304 </span><span class="CommentedCode">#? # curr/esi = start</span>
<span id="L305" class="LineNr">305 </span><span class="CommentedCode">#? # i/ecx = 0</span>
<span id="L306" class="LineNr">306 </span><span class="CommentedCode">#? # while true</span>
<span id="L307" class="LineNr">307 </span><span class="CommentedCode">#? # if (i &gt;= len) break</span>
<span id="L308" class="LineNr">308 </span><span class="CommentedCode">#? # *curr = 0</span>
<span id="L309" class="LineNr">309 </span><span class="CommentedCode">#? # ++curr</span>
<span id="L310" class="LineNr">310 </span><span class="CommentedCode">#? # ++i</span>
<span id="L311" class="LineNr">311 </span><span class="CommentedCode">#? #</span>
<span id="L312" class="LineNr">312 </span><span class="CommentedCode">#? # . prologue</span>
<span id="L313" class="LineNr">313 </span><span class="CommentedCode">#? 55/push-ebp</span>
<span id="L314" class="LineNr">314 </span><span class="CommentedCode">#? 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp</span>
<span id="L315" class="LineNr">315 </span><span class="CommentedCode">#? # . save registers</span>
<span id="L316" class="LineNr">316 </span><span class="CommentedCode">#? 50/push-eax</span>
<span id="L317" class="LineNr">317 </span><span class="CommentedCode">#? 51/push-ecx</span>
<span id="L318" class="LineNr">318 </span><span class="CommentedCode">#? 52/push-edx</span>
<span id="L319" class="LineNr">319 </span><span class="CommentedCode">#? 56/push-esi</span>
<span id="L320" class="LineNr">320 </span><span class="CommentedCode">#? # curr/esi = start</span>
<span id="L321" class="LineNr">321 </span><span class="CommentedCode">#? 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 . # copy *(ebp+8) to esi</span>
<span id="L322" class="LineNr">322 </span><span class="CommentedCode">#? # var i/ecx: int = 0</span>
<span id="L323" class="LineNr">323 </span><span class="CommentedCode">#? 31/xor 3/mod/direct 1/rm32/ecx . . . 1/r32/ecx . . # clear ecx</span>
<span id="L324" class="LineNr">324 </span><span class="CommentedCode">#? # edx = len</span>
<span id="L325" class="LineNr">325 </span><span class="CommentedCode">#? 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 2/r32/edx 0xc/disp8 . # copy *(ebp+12) to edx</span>
<span id="L326" class="LineNr">326 </span><span class="CommentedCode">#? $zero-out:loop:</span>
<span id="L327" class="LineNr">327 </span><span class="CommentedCode">#? # if (i &gt;= len) break</span>
<span id="L328" class="LineNr">328 </span><span class="CommentedCode">#? 39/compare 3/mod/direct 1/rm32/ecx . . . 2/r32/edx . . # compare ecx with edx</span>
<span id="L329" class="LineNr">329 </span><span class="CommentedCode">#? 7d/jump-if-&gt;= $zero-out:end/disp8</span>
<span id="L330" class="LineNr">330 </span><span class="CommentedCode">#? # *curr = 0</span>
<span id="L331" class="LineNr">331 </span><span class="CommentedCode">#? c6 0/subop/copy 0/mod/direct 6/rm32/esi . . . . . 0/imm8 # copy byte to *esi</span>
<span id="L332" class="LineNr">332 </span><span class="CommentedCode">#? # ++curr</span>
<span id="L333" class="LineNr">333 </span><span class="CommentedCode">#? 46/increment-esi</span>
<span id="L334" class="LineNr">334 </span><span class="CommentedCode">#? # ++i</span>
<span id="L335" class="LineNr">335 </span><span class="CommentedCode">#? 41/increment-ecx</span>
<span id="L336" class="LineNr">336 </span><span class="CommentedCode">#? eb/jump $zero-out:loop/disp8</span>
<span id="L337" class="LineNr">337 </span><span class="CommentedCode">#? $zero-out:end:</span>
<span id="L338" class="LineNr">338 </span><span class="CommentedCode">#? # . restore registers</span>
<span id="L339" class="LineNr">339 </span><span class="CommentedCode">#? 5e/pop-to-esi</span>
<span id="L340" class="LineNr">340 </span><span class="CommentedCode">#? 5a/pop-to-edx</span>
<span id="L341" class="LineNr">341 </span><span class="CommentedCode">#? 59/pop-to-ecx</span>
<span id="L342" class="LineNr">342 </span><span class="CommentedCode">#? 58/pop-to-eax</span>
<span id="L343" class="LineNr">343 </span><span class="CommentedCode">#? # . epilogue</span>
<span id="L344" class="LineNr">344 </span><span class="CommentedCode">#? 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . . # copy ebp to esp</span>
<span id="L345" class="LineNr">345 </span><span class="CommentedCode">#? 5d/pop-to-ebp</span>
<span id="L346" class="LineNr">346 </span><span class="CommentedCode">#? c3/return</span>
<span id="L347" class="LineNr">347 </span><span class="CommentedCode">#? </span>
<span id="L348" class="LineNr">348 </span><span class="CommentedCode">#? == data</span>
<span id="L349" class="LineNr">349 </span><span class="CommentedCode">#? Push-n-zero-bytes-ebp: # (addr int)</span>
<span id="L350" class="LineNr">350 </span><span class="CommentedCode">#? 0/imm32</span>
<span id="L351" class="LineNr">351 </span><span class="CommentedCode">#? Push-n-zero-bytes-esp: # (addr int)</span>
<span id="L352" class="LineNr">352 </span><span class="CommentedCode">#? 0/imm32</span>
<span id="L353" class="LineNr">353 </span><span class="CommentedCode">#? == code</span>
<span id="L354" class="LineNr">354 </span>
<span id="L355" class="LineNr">355 </span><span class="subxComment"># stack at dump-stack0:</span>
<span id="L356" class="LineNr">356 </span><span class="subxComment"># 0 a: bdffffb0: 00000000 00000000 00000000 00000000 </span>
<span id="L357" class="LineNr">357 </span><span class="subxComment"># 0 a: bdffffc0: 00000000 00000000 00000000 00000000 </span>
<span id="L358" class="LineNr">358 </span><span class="subxComment"># 0 a: bdffffd0: 00000000 00000000 00000000 00000000 </span>
<span id="L359" class="LineNr">359 </span><span class="subxComment"># 0 a: bdffffe0: 00000000 00000000 00000000 00000000 </span>
<span id="L360" class="LineNr">360 </span><span class="subxComment"># 0 a: bdfffff0: 00000000 [fcfdfeff] 00000001 bf000000 </span>
<span id="L361" class="LineNr">361 </span>
<span id="L362" class="LineNr">362 </span><span class="subxComment"># desired state after push-n-zero-bytes:</span>
<span id="L363" class="LineNr">363 </span><span class="subxComment"># 0 a: bdffff90: 00000000 00000000 00000000 00000000 </span>
<span id="L364" class="LineNr">364 </span><span class="subxComment"># 0 a: bdffffa0: 00000000 00000000 00000000 00000000 </span>
<span id="L365" class="LineNr">365 </span><span class="subxComment"># 0 a: bdffffb0: 00000000 00000000 00000000 bdffffec </span>
<span id="L366" class="LineNr">366 </span><span class="subxComment"># 0 a: bdffffc0: 0900012a bdffffd0 00000020 090000d1 </span>
<span id="L367" class="LineNr">367 </span><span class="subxComment"># 0 a: bdffffd0: [rrrrrrrr] 00000000 00000000 00000000 </span>
<span id="L368" class="LineNr">368 </span><span class="subxComment"># 0 a: bdffffe0: 00000000 00000000 00000000 00000000 </span>
<span id="L369" class="LineNr">369 </span><span class="subxComment"># 0 a: bdfffff0: 00000000 fcfdfeff 00000001 bf000000 </span>
<span id="L370" class="LineNr">370 </span>
<span id="L371" class="LineNr">371 </span><span class="subxComment"># Stack pointer contains ra is caller's responsibility to over-write with array length.</span>
<span id="L372" class="LineNr">372 </span>
<span id="L373" class="LineNr">373 </span><span class="subxComment"># actual state:</span>
<span id="L374" class="LineNr">374 </span><span class="subxComment"># 0 a: bdffff90: 00000000 00000000 00000000 00000000</span>
<span id="L375" class="LineNr">375 </span><span class="subxComment"># 0 a: bdffffa0: 00000000 00000000 00000000 00000000</span>
<span id="L376" class="LineNr">376 </span><span class="subxComment"># 0 a: bdffffb0: 00000000 00000000 00000000 bdffffec</span>
<span id="L377" class="LineNr">377 </span><span class="subxComment"># 0 a: bdffffc0: 0900012a bdffffd0 00000020 090000d1</span>
<span id="L378" class="LineNr">378 </span><span class="subxComment"># 0 a: bdffffd0: 00000000 [00000000] 00000000 00000000</span>
<span id="L379" class="LineNr">379 </span><span class="subxComment"># 0 a: bdffffe0: 00000000 00000000 00000000 00000000</span>
<span id="L380" class="LineNr">380 </span><span class="subxComment"># 0 a: bdfffff0: 00000020 fcfdfeff 00000001 bf000000</span>
<span id="L381" class="LineNr">381 </span>
<span id="L382" class="LineNr">382 </span><span class="subxComment"># Couple of issues. But where does the return address disappear to?</span>
<span id="L383" class="LineNr">383 </span>
<span id="L384" class="LineNr">384 </span><span class="subxComment">## 8:</span>
<span id="L385" class="LineNr">385 </span>
<span id="L386" class="LineNr">386 </span><span class="CommentedCode">#? Entry:</span>
<span id="L387" class="LineNr">387 </span><span class="CommentedCode">#? # . prologue</span>
<span id="L388" class="LineNr">388 </span><span class="CommentedCode">#? 89/&lt;- %ebp 4/r32/esp</span>
<span id="L389" class="LineNr">389 </span><span class="CommentedCode">#? #</span>
<span id="L390" class="LineNr">390 </span><span class="CommentedCode">#? 68/push 0xfcfdfeff/imm32</span>
<span id="L391" class="LineNr">391 </span><span class="CommentedCode">#? b8/copy-to-eax 0x34353637/imm32</span>
<span id="L392" class="LineNr">392 </span><span class="CommentedCode">#? $dump-stack0:</span>
<span id="L393" class="LineNr">393 </span><span class="CommentedCode">#? (push-n-zero-bytes 0x20)</span>
<span id="L394" class="LineNr">394 </span><span class="CommentedCode">#? $dump-stack9:</span>
<span id="L395" class="LineNr">395 </span><span class="CommentedCode">#? 68/push 0x20/imm32</span>
<span id="L396" class="LineNr">396 </span><span class="CommentedCode">#? #? c7 0/subop/copy *esp 0x20/imm32</span>
<span id="L397" class="LineNr">397 </span><span class="CommentedCode">#? $dump-stacka:</span>
<span id="L398" class="LineNr">398 </span><span class="CommentedCode">#? b8/copy-to-eax 1/imm32/exit</span>
<span id="L399" class="LineNr">399 </span><span class="CommentedCode">#? cd/syscall 0x80/imm8</span>
<span id="L400" class="LineNr">400 </span><span class="CommentedCode">#? </span>
<span id="L401" class="LineNr">401 </span><span class="CommentedCode">#? push-n-zero-bytes: # n: int</span>
<span id="L402" class="LineNr">402 </span><span class="CommentedCode">#? $push-n-zero-bytes:prologue:</span>
<span id="L403" class="LineNr">403 </span><span class="CommentedCode">#? 89/&lt;- *Push-n-zero-bytes-ebp 5/r32/ebp # spill ebp without affecting stack</span>
<span id="L404" class="LineNr">404 </span><span class="CommentedCode">#? 89/&lt;- %ebp 4/r32/esp</span>
<span id="L405" class="LineNr">405 </span><span class="CommentedCode">#? $push-n-zero-bytes:copy-ra:</span>
<span id="L406" class="LineNr">406 </span><span class="CommentedCode">#? $dump-stack1:</span>
<span id="L407" class="LineNr">407 </span><span class="CommentedCode">#? # -- esp = ebp</span>
<span id="L408" class="LineNr">408 </span><span class="CommentedCode">#? 50/push-eax</span>
<span id="L409" class="LineNr">409 </span><span class="CommentedCode">#? $dump-stack2:</span>
<span id="L410" class="LineNr">410 </span><span class="CommentedCode">#? # -- esp+8 = ebp+4</span>
<span id="L411" class="LineNr">411 </span><span class="CommentedCode">#? # -- esp+4 = ebp</span>
<span id="L412" class="LineNr">412 </span><span class="CommentedCode">#? 8b/-&gt; *(esp+4) 0/r32/eax</span>
<span id="L413" class="LineNr">413 </span><span class="CommentedCode">#? $dump-stack3:</span>
<span id="L414" class="LineNr">414 </span><span class="CommentedCode">#? 2b/subtract *(ebp+4) 4/r32/esp</span>
<span id="L415" class="LineNr">415 </span><span class="CommentedCode">#? $dump-stack4:</span>
<span id="L416" class="LineNr">416 </span><span class="CommentedCode">#? # -- esp+4+n = ebp</span>
<span id="L417" class="LineNr">417 </span><span class="CommentedCode">#? 89/&lt;- *(esp+4) 0/r32/eax</span>
<span id="L418" class="LineNr">418 </span><span class="CommentedCode">#? $dump-stack5:</span>
<span id="L419" class="LineNr">419 </span><span class="CommentedCode">#? 58/pop-to-eax</span>
<span id="L420" class="LineNr">420 </span><span class="CommentedCode">#? # -- esp+n = ebp</span>
<span id="L421" class="LineNr">421 </span><span class="CommentedCode">#? $push-n-zero-bytes:bulk-cleaning:</span>
<span id="L422" class="LineNr">422 </span><span class="CommentedCode">#? $dump-stack6:</span>
<span id="L423" class="LineNr">423 </span><span class="CommentedCode">#? 89/&lt;- *Push-n-zero-bytes-esp 4/r32/esp</span>
<span id="L424" class="LineNr">424 </span><span class="CommentedCode">#? 81 0/subop/add *Push-n-zero-bytes-esp 4/imm32</span>
<span id="L425" class="LineNr">425 </span><span class="CommentedCode">#? $dump-stack7:</span>
<span id="L426" class="LineNr">426 </span><span class="CommentedCode">#? (zero-out *Push-n-zero-bytes-esp *(ebp+4)) # n</span>
<span id="L427" class="LineNr">427 </span><span class="CommentedCode">#? $push-n-zero-bytes:epilogue:</span>
<span id="L428" class="LineNr">428 </span><span class="CommentedCode">#? $dump-stack8:</span>
<span id="L429" class="LineNr">429 </span><span class="CommentedCode">#? 8b/-&gt; *Push-n-zero-bytes-ebp 5/r32/ebp # restore spill</span>
<span id="L430" class="LineNr">430 </span><span class="CommentedCode">#? c3/return</span>
<span id="L431" class="LineNr">431 </span><span class="CommentedCode">#? </span>
<span id="L432" class="LineNr">432 </span><span class="CommentedCode">#? zero-out: # start: (addr byte), len: int</span>
<span id="L433" class="LineNr">433 </span><span class="CommentedCode">#? # pseudocode:</span>
<span id="L434" class="LineNr">434 </span><span class="CommentedCode">#? # curr/esi = start</span>
<span id="L435" class="LineNr">435 </span><span class="CommentedCode">#? # i/ecx = 0</span>
<span id="L436" class="LineNr">436 </span><span class="CommentedCode">#? # while true</span>
<span id="L437" class="LineNr">437 </span><span class="CommentedCode">#? # if (i &gt;= len) break</span>
<span id="L438" class="LineNr">438 </span><span class="CommentedCode">#? # *curr = 0</span>
<span id="L439" class="LineNr">439 </span><span class="CommentedCode">#? # ++curr</span>
<span id="L440" class="LineNr">440 </span><span class="CommentedCode">#? # ++i</span>
<span id="L441" class="LineNr">441 </span><span class="CommentedCode">#? #</span>
<span id="L442" class="LineNr">442 </span><span class="CommentedCode">#? # . prologue</span>
<span id="L443" class="LineNr">443 </span><span class="CommentedCode">#? 55/push-ebp</span>
<span id="L444" class="LineNr">444 </span><span class="CommentedCode">#? 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp</span>
<span id="L445" class="LineNr">445 </span><span class="CommentedCode">#? # . save registers</span>
<span id="L446" class="LineNr">446 </span><span class="CommentedCode">#? 50/push-eax</span>
<span id="L447" class="LineNr">447 </span><span class="CommentedCode">#? 51/push-ecx</span>
<span id="L448" class="LineNr">448 </span><span class="CommentedCode">#? 52/push-edx</span>
<span id="L449" class="LineNr">449 </span><span class="CommentedCode">#? 56/push-esi</span>
<span id="L450" class="LineNr">450 </span><span class="CommentedCode">#? # curr/esi = start</span>
<span id="L451" class="LineNr">451 </span><span class="CommentedCode">#? 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 . # copy *(ebp+8) to esi</span>
<span id="L452" class="LineNr">452 </span><span class="CommentedCode">#? # var i/ecx: int = 0</span>
<span id="L453" class="LineNr">453 </span><span class="CommentedCode">#? 31/xor 3/mod/direct 1/rm32/ecx . . . 1/r32/ecx . . # clear ecx</span>
<span id="L454" class="LineNr">454 </span><span class="CommentedCode">#? # edx = len</span>
<span id="L455" class="LineNr">455 </span><span class="CommentedCode">#? 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 2/r32/edx 0xc/disp8 . # copy *(ebp+12) to edx</span>
<span id="L456" class="LineNr">456 </span><span class="CommentedCode">#? $zero-out:loop:</span>
<span id="L457" class="LineNr">457 </span><span class="CommentedCode">#? # if (i &gt;= len) break</span>
<span id="L458" class="LineNr">458 </span><span class="CommentedCode">#? 39/compare 3/mod/direct 1/rm32/ecx . . . 2/r32/edx . . # compare ecx with edx</span>
<span id="L459" class="LineNr">459 </span><span class="CommentedCode">#? 7d/jump-if-&gt;= $zero-out:end/disp8</span>
<span id="L460" class="LineNr">460 </span><span class="CommentedCode">#? # *curr = 0</span>
<span id="L461" class="LineNr">461 </span><span class="CommentedCode">#? c6 0/subop/copy 0/mod/direct 6/rm32/esi . . . . . 0/imm8 # copy byte to *esi</span>
<span id="L462" class="LineNr">462 </span><span class="CommentedCode">#? # ++curr</span>
<span id="L463" class="LineNr">463 </span><span class="CommentedCode">#? 46/increment-esi</span>
<span id="L464" class="LineNr">464 </span><span class="CommentedCode">#? # ++i</span>
<span id="L465" class="LineNr">465 </span><span class="CommentedCode">#? 41/increment-ecx</span>
<span id="L466" class="LineNr">466 </span><span class="CommentedCode">#? eb/jump $zero-out:loop/disp8</span>
<span id="L467" class="LineNr">467 </span><span class="CommentedCode">#? $zero-out:end:</span>
<span id="L468" class="LineNr">468 </span><span class="CommentedCode">#? # . restore registers</span>
<span id="L469" class="LineNr">469 </span><span class="CommentedCode">#? 5e/pop-to-esi</span>
<span id="L470" class="LineNr">470 </span><span class="CommentedCode">#? 5a/pop-to-edx</span>
<span id="L471" class="LineNr">471 </span><span class="CommentedCode">#? 59/pop-to-ecx</span>
<span id="L472" class="LineNr">472 </span><span class="CommentedCode">#? 58/pop-to-eax</span>
<span id="L473" class="LineNr">473 </span><span class="CommentedCode">#? # . epilogue</span>
<span id="L474" class="LineNr">474 </span><span class="CommentedCode">#? 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . . # copy ebp to esp</span>
<span id="L475" class="LineNr">475 </span><span class="CommentedCode">#? 5d/pop-to-ebp</span>
<span id="L476" class="LineNr">476 </span><span class="CommentedCode">#? c3/return</span>
<span id="L477" class="LineNr">477 </span><span class="CommentedCode">#? </span>
<span id="L478" class="LineNr">478 </span><span class="CommentedCode">#? == data</span>
<span id="L479" class="LineNr">479 </span><span class="CommentedCode">#? Push-n-zero-bytes-ebp: # (addr int)</span>
<span id="L480" class="LineNr">480 </span><span class="CommentedCode">#? 0/imm32</span>
<span id="L481" class="LineNr">481 </span><span class="CommentedCode">#? Push-n-zero-bytes-esp: # (addr int)</span>
<span id="L482" class="LineNr">482 </span><span class="CommentedCode">#? 0/imm32</span>
<span id="L483" class="LineNr">483 </span><span class="CommentedCode">#? == code</span>
<span id="L484" class="LineNr">484 </span>
<span id="L485" class="LineNr">485 </span><span class="subxComment"># stack at dump-stack0:</span>
<span id="L486" class="LineNr">486 </span><span class="subxComment"># 0 a: bdffffb0: 00000000 00000000 00000000 00000000 </span>
<span id="L487" class="LineNr">487 </span><span class="subxComment"># 0 a: bdffffc0: 00000000 00000000 00000000 00000000 </span>
<span id="L488" class="LineNr">488 </span><span class="subxComment"># 0 a: bdffffd0: 00000000 00000000 00000000 00000000 </span>
<span id="L489" class="LineNr">489 </span><span class="subxComment"># 0 a: bdffffe0: 00000000 00000000 00000000 00000000 </span>
<span id="L490" class="LineNr">490 </span><span class="subxComment"># 0 a: bdfffff0: 00000000 [fcfdfeff] 00000001 bf000000 </span>
<span id="L491" class="LineNr">491 </span>
<span id="L492" class="LineNr">492 </span><span class="subxComment"># desired state after push-n-zero-bytes:</span>
<span id="L493" class="LineNr">493 </span><span class="subxComment"># 0 a: bdffff90: 00000000 00000000 00000000 00000000 </span>
<span id="L494" class="LineNr">494 </span><span class="subxComment"># 0 a: bdffffa0: 00000000 00000000 00000000 00000000 </span>
<span id="L495" class="LineNr">495 </span><span class="subxComment"># 0 a: bdffffb0: 00000000 00000000 00000000 bdffffec </span>
<span id="L496" class="LineNr">496 </span><span class="subxComment"># 0 a: bdffffc0: 0900012a bdffffd0 00000020 090000d1 </span>
<span id="L497" class="LineNr">497 </span><span class="subxComment"># 0 a: bdffffd0: [rrrrrrrr] 00000000 00000000 00000000 </span>
<span id="L498" class="LineNr">498 </span><span class="subxComment"># 0 a: bdffffe0: 00000000 00000000 00000000 00000000 </span>
<span id="L499" class="LineNr">499 </span><span class="subxComment"># 0 a: bdfffff0: 00000000 fcfdfeff 00000001 bf000000 </span>
<span id="L500" class="LineNr">500 </span>
<span id="L501" class="LineNr">501 </span><span class="subxComment"># actual state:</span>
<span id="L502" class="LineNr">502 </span><span class="subxComment"># 0 a: bdffff90: 00000000 00000000 00000000 00000000</span>
<span id="L503" class="LineNr">503 </span><span class="subxComment"># 0 a: bdffffa0: 00000000 00000000 00000000 00000000</span>
<span id="L504" class="LineNr">504 </span><span class="subxComment"># 0 a: bdffffb0: 00000000 00000000 00000000 bdffffec</span>
<span id="L505" class="LineNr">505 </span><span class="subxComment"># 0 a: bdffffc0: 09000124 bdffffd0 00000020 090000d1</span>
<span id="L506" class="LineNr">506 </span><span class="subxComment"># 0 a: bdffffd0: [00000000] 00000000 00000000 00000000</span>
<span id="L507" class="LineNr">507 </span><span class="subxComment"># 0 a: bdffffe0: 00000000 00000000 00000000 00000000</span>
<span id="L508" class="LineNr">508 </span><span class="subxComment"># 0 a: bdfffff0: 00000020 fcfdfeff 00000001 bf000000</span>
<span id="L509" class="LineNr">509 </span>
<span id="L510" class="LineNr">510 </span><span class="subxComment"># Ok, just one diff, at bdfffff0</span>
<span id="L511" class="LineNr">511 </span>
<span id="L512" class="LineNr">512 </span><span class="subxComment">## 9:</span>
<span id="L513" class="LineNr">513 </span>
<span id="L514" class="LineNr">514 </span><span class="SpecialChar">Entry</span>:
<span id="L515" class="LineNr">515 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L516" class="LineNr">516 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L517" class="LineNr">517 </span> <span class="subxComment">#</span>
<span id="L518" class="LineNr">518 </span> 68/push 0xfcfdfeff/imm32
<span id="L519" class="LineNr">519 </span> b8/copy-to-eax 0x34353637/imm32
<span id="L520" class="LineNr">520 </span><span class="Constant">$dump-stack0</span>:
<span id="L521" class="LineNr">521 </span> (push-n-zero-bytes 0x20)
<span id="L522" class="LineNr">522 </span><span class="Constant">$dump-stack9</span>:
<span id="L523" class="LineNr">523 </span> 68/push 0x20/imm32
<span id="L524" class="LineNr">524 </span><span class="Constant">$dump-stacka</span>:
<span id="L525" class="LineNr">525 </span> b8/copy-to-eax 1/imm32/exit
<span id="L526" class="LineNr">526 </span> cd/syscall 0x80/imm8
<span id="L527" class="LineNr">527 </span>
<span id="L528" class="LineNr">528 </span><span class="subxFunction">push-n-zero-bytes</span>: <span class="subxComment"># n: int</span>
<span id="L529" class="LineNr">529 </span><span class="Constant">$push-n-zero-bytes:prologue</span>:
<span id="L530" class="LineNr">530 </span> 89/&lt;- *<span class="SpecialChar">Push-n-zero-bytes-ebp</span> 5/r32/ebp <span class="subxComment"># spill ebp without affecting stack</span>
<span id="L531" class="LineNr">531 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L532" class="LineNr">532 </span><span class="Constant">$push-n-zero-bytes:copy-ra</span>:
<span id="L533" class="LineNr">533 </span><span class="Constant">$dump-stack1</span>:
<span id="L534" class="LineNr">534 </span> <span class="subxComment"># -- esp = ebp</span>
<span id="L535" class="LineNr">535 </span> 50/push-eax
<span id="L536" class="LineNr">536 </span><span class="Constant">$dump-stack2</span>:
<span id="L537" class="LineNr">537 </span> <span class="subxComment"># -- esp+8 = ebp+4</span>
<span id="L538" class="LineNr">538 </span> <span class="subxComment"># -- esp+4 = ebp</span>
<span id="L539" class="LineNr">539 </span> 8b/-&gt; *(esp+4) 0/r32/eax
<span id="L540" class="LineNr">540 </span><span class="Constant">$dump-stack3</span>:
<span id="L541" class="LineNr">541 </span> 2b/subtract *(ebp+4) 4/r32/esp
<span id="L542" class="LineNr">542 </span><span class="Constant">$dump-stack4</span>:
<span id="L543" class="LineNr">543 </span> <span class="subxComment"># -- esp+4+n = ebp</span>
<span id="L544" class="LineNr">544 </span> 89/&lt;- *(esp+4) 0/r32/eax
<span id="L545" class="LineNr">545 </span><span class="Constant">$dump-stack5</span>:
<span id="L546" class="LineNr">546 </span> 58/pop-to-eax
<span id="L547" class="LineNr">547 </span> <span class="subxComment"># -- esp+n = ebp</span>
<span id="L548" class="LineNr">548 </span><span class="Constant">$push-n-zero-bytes:bulk-cleaning</span>:
<span id="L549" class="LineNr">549 </span><span class="Constant">$dump-stack6</span>:
<span id="L550" class="LineNr">550 </span> 89/&lt;- *<span class="SpecialChar">Push-n-zero-bytes-esp</span> 4/r32/esp
<span id="L551" class="LineNr">551 </span> 81 0/subop/add *<span class="SpecialChar">Push-n-zero-bytes-esp</span> 4/imm32
<span id="L552" class="LineNr">552 </span><span class="Constant">$dump-stack7</span>:
<span id="L553" class="LineNr">553 </span> 81 0/subop/add *(ebp+4) 4/imm32
<span id="L554" class="LineNr">554 </span> (zero-out *<span class="SpecialChar">Push-n-zero-bytes-esp</span> *(ebp+4)) <span class="subxComment"># n</span>
<span id="L555" class="LineNr">555 </span><span class="Constant">$push-n-zero-bytes:epilogue</span>:
<span id="L556" class="LineNr">556 </span><span class="Constant">$dump-stack8</span>:
<span id="L557" class="LineNr">557 </span> 8b/-&gt; *<span class="SpecialChar">Push-n-zero-bytes-ebp</span> 5/r32/ebp <span class="subxComment"># restore spill</span>
<span id="L558" class="LineNr">558 </span> c3/return
<span id="L559" class="LineNr">559 </span>
<span id="L560" class="LineNr">560 </span><span class="subxFunction">zero-out</span>: <span class="subxComment"># start: (addr byte), len: int</span>
<span id="L561" class="LineNr">561 </span> <span class="subxComment"># pseudocode:</span>
<span id="L562" class="LineNr">562 </span> <span class="subxComment"># curr/esi = start</span>
<span id="L563" class="LineNr">563 </span> <span class="subxComment"># i/ecx = 0</span>
<span id="L564" class="LineNr">564 </span> <span class="subxComment"># while true</span>
<span id="L565" class="LineNr">565 </span> <span class="subxComment"># if (i &gt;= len) break</span>
<span id="L566" class="LineNr">566 </span> <span class="subxComment"># *curr = 0</span>
<span id="L567" class="LineNr">567 </span> <span class="subxComment"># ++curr</span>
<span id="L568" class="LineNr">568 </span> <span class="subxComment"># ++i</span>
<span id="L569" class="LineNr">569 </span> <span class="subxComment">#</span>
<span id="L570" class="LineNr">570 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L571" class="LineNr">571 </span> 55/push-ebp
<span id="L572" class="LineNr">572 </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="L573" class="LineNr">573 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L574" class="LineNr">574 </span> 50/push-eax
<span id="L575" class="LineNr">575 </span> 51/push-ecx
<span id="L576" class="LineNr">576 </span> 52/push-edx
<span id="L577" class="LineNr">577 </span> 56/push-esi
<span id="L578" class="LineNr">578 </span> <span class="subxComment"># curr/esi = start</span>
<span id="L579" class="LineNr">579 </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="L580" class="LineNr">580 </span> <span class="subxComment"># var i/ecx: int = 0</span>
<span id="L581" class="LineNr">581 </span> 31/xor 3/mod/direct 1/rm32/ecx <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"># clear ecx</span>
<span id="L582" class="LineNr">582 </span> <span class="subxComment"># edx = len</span>
<span id="L583" class="LineNr">583 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <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="L584" class="LineNr">584 </span><span class="Constant">$zero-out:loop</span>:
<span id="L585" class="LineNr">585 </span> <span class="subxComment"># if (i &gt;= len) break</span>
<span id="L586" class="LineNr">586 </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="L587" class="LineNr">587 </span> 7d/jump-if-&gt;= $zero-out:end/disp8
<span id="L588" class="LineNr">588 </span> <span class="subxComment"># *curr = 0</span>
<span id="L589" class="LineNr">589 </span> c6 0/subop/copy 0/mod/direct 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/imm8 <span class="subxComment"># copy byte to *esi</span>
<span id="L590" class="LineNr">590 </span> <span class="subxComment"># ++curr</span>
<span id="L591" class="LineNr">591 </span> 46/increment-esi
<span id="L592" class="LineNr">592 </span> <span class="subxComment"># ++i</span>
<span id="L593" class="LineNr">593 </span> 41/increment-ecx
<span id="L594" class="LineNr">594 </span> eb/jump $zero-out:<span class="Constant">loop</span>/disp8
<span id="L595" class="LineNr">595 </span><span class="Constant">$zero-out:end</span>:
<span id="L596" class="LineNr">596 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L597" class="LineNr">597 </span> 5e/pop-to-esi
<span id="L598" class="LineNr">598 </span> 5a/pop-to-edx
<span id="L599" class="LineNr">599 </span> 59/pop-to-ecx
<span id="L600" class="LineNr">600 </span> 58/pop-to-eax
<span id="L601" class="LineNr">601 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L602" class="LineNr">602 </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="L603" class="LineNr">603 </span> 5d/pop-to-ebp
<span id="L604" class="LineNr">604 </span> c3/return
<span id="L605" class="LineNr">605 </span>
<span id="L606" class="LineNr">606 </span>== data
<span id="L607" class="LineNr">607 </span><span class="SpecialChar">Push-n-zero-bytes-ebp</span>: <span class="subxComment"># (addr int)</span>
<span id="L608" class="LineNr">608 </span> 0/imm32
<span id="L609" class="LineNr">609 </span><span class="SpecialChar">Push-n-zero-bytes-esp</span>: <span class="subxComment"># (addr int)</span>
<span id="L610" class="LineNr">610 </span> 0/imm32
<span id="L611" class="LineNr">611 </span>== code
<span id="L612" class="LineNr">612 </span>
<span id="L613" class="LineNr">613 </span><span class="subxComment"># stack at dump-stack0:</span>
<span id="L614" class="LineNr">614 </span><span class="subxComment"># 0 a: bdffffb0: 00000000 00000000 00000000 00000000 </span>
<span id="L615" class="LineNr">615 </span><span class="subxComment"># 0 a: bdffffc0: 00000000 00000000 00000000 00000000 </span>
<span id="L616" class="LineNr">616 </span><span class="subxComment"># 0 a: bdffffd0: 00000000 00000000 00000000 00000000 </span>
<span id="L617" class="LineNr">617 </span><span class="subxComment"># 0 a: bdffffe0: 00000000 00000000 00000000 00000000 </span>
<span id="L618" class="LineNr">618 </span><span class="subxComment"># 0 a: bdfffff0: 00000000 [fcfdfeff] 00000001 bf000000 </span>
<span id="L619" class="LineNr">619 </span>
<span id="L620" class="LineNr">620 </span><span class="subxComment"># desired state after push-n-zero-bytes:</span>
<span id="L621" class="LineNr">621 </span><span class="subxComment"># 0 a: bdffff90: 00000000 00000000 00000000 00000000 </span>
<span id="L622" class="LineNr">622 </span><span class="subxComment"># 0 a: bdffffa0: 00000000 00000000 00000000 00000000 </span>
<span id="L623" class="LineNr">623 </span><span class="subxComment"># 0 a: bdffffb0: 00000000 00000000 00000000 bdffffec </span>
<span id="L624" class="LineNr">624 </span><span class="subxComment"># 0 a: bdffffc0: 0900012a bdffffd0 00000020 090000d1 </span>
<span id="L625" class="LineNr">625 </span><span class="subxComment"># 0 a: bdffffd0: [xxxxxxxx] 00000000 00000000 00000000 </span>
<span id="L626" class="LineNr">626 </span><span class="subxComment"># 0 a: bdffffe0: 00000000 00000000 00000000 00000000 </span>
<span id="L627" class="LineNr">627 </span><span class="subxComment"># 0 a: bdfffff0: 00000000 fcfdfeff 00000001 bf000000 </span>
<span id="L628" class="LineNr">628 </span>
<span id="L629" class="LineNr">629 </span><span class="subxComment"># actual state:</span>
<span id="L630" class="LineNr">630 </span><span class="subxComment"># 0 a: bdffff90: 00000000 00000000 00000000 00000000</span>
<span id="L631" class="LineNr">631 </span><span class="subxComment"># 0 a: bdffffa0: 00000000 00000000 00000000 00000000</span>
<span id="L632" class="LineNr">632 </span><span class="subxComment"># 0 a: bdffffb0: 00000000 00000000 00000000 bdffffec</span>
<span id="L633" class="LineNr">633 </span><span class="subxComment"># 0 a: bdffffc0: 0900012f bdffffd0 00000024 090000d1</span>
<span id="L634" class="LineNr">634 </span><span class="subxComment"># 0 a: bdffffd0: [00000000] 00000000 00000000 00000000</span>
<span id="L635" class="LineNr">635 </span><span class="subxComment"># 0 a: bdffffe0: 00000000 00000000 00000000 00000000</span>
<span id="L636" class="LineNr">636 </span><span class="subxComment"># 0 a: bdfffff0: 00000000 fcfdfeff 00000001 bf000000</span>
</pre>
</body>
</html>
<!-- vim: set foldmethod=manual : -->

File diff suppressed because it is too large Load Diff

View File

@ -2695,7 +2695,7 @@ if ('onhashchange' in window) {
<span id="L3119" class="LineNr">3119 </span> 8b/copy 0/mod/indirect 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 *edx to eax</span>
<span id="L3120" class="LineNr">3120 </span> <span class="subxS1Comment"># . c/eax = *start</span>
<span id="L3121" class="LineNr">3121 </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="L3122" class="LineNr">3122 </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="L3122" class="LineNr">3122 </span> 25/and-eax-with 0xff/imm32
<span id="L3123" class="LineNr">3123 </span> <span class="subxS1Comment"># . if (eax != '8') return</span>
<span id="L3124" class="LineNr">3124 </span> 3d/compare-eax-and 0x38/imm32/8
<span id="L3125" class="LineNr">3125 </span> 75/jump-if-!= $far-jump-or-call?:end/disp8
@ -2763,7 +2763,7 @@ if ('onhashchange' in window) {
<span id="L3257" class="LineNr">3257 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L3258" class="LineNr">3258 </span> 81 0/subop/add 3/mod/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="L3259" class="LineNr">3259 </span> <span class="subxComment"># curr-segment += 20 # size of a row</span>
<span id="L3260" class="LineNr">3260 </span> 81 0/subop/add 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> 0x14/imm32 <span class="subxComment"># add to eax</span>
<span id="L3260" class="LineNr">3260 </span> 05/add-to-eax 0x14/imm32
<span id="L3261" class="LineNr">3261 </span> e9/jump $emit-headers:<span class="Constant">loop</span>/disp32
<span id="L3262" class="LineNr">3262 </span><span class="Constant">$emit-headers:end</span>:
<span id="L3263" class="LineNr">3263 </span> <span class="subxS1Comment"># . restore registers</span>

View File

@ -209,7 +209,7 @@ if ('onhashchange' in window) {
<span id="L149" class="LineNr">149 </span> <span class="PreProc">var</span> src-ah/<span class="Constant">eax</span>: (addr handle array byte) <span class="Special">&lt;-</span> <a href='../131table.subx.html#L26'>get</a> target-val, text-data
<span id="L150" class="LineNr">150 </span> <span class="PreProc">var</span> src/<span class="Constant">eax</span>: (addr array byte) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L258'>lookup</a> *src-ah
<span id="L151" class="LineNr">151 </span> <span class="PreProc">var</span> result-ah/<span class="Constant">ecx</span>: (addr handle buffered-file) <span class="Special">&lt;-</span> <a href='../131table.subx.html#L26'>get</a> target-val, file-data
<span id="L152" class="LineNr">152 </span> <a href='../306files.subx.html#L12'>open</a> src, <span class="Constant">0</span>, result-ah <span class="muComment"># write? = false</span>
<span id="L152" class="LineNr">152 </span> <a href='../306files.subx.html#L9'>open</a> src, <span class="Constant">0</span>, result-ah <span class="muComment"># write? = false</span>
<span id="L153" class="LineNr">153 </span> <span class="muComment"># save result into target-val</span>
<span id="L154" class="LineNr">154 </span> <span class="PreProc">var</span> type-addr/<span class="Constant">eax</span>: (addr int) <span class="Special">&lt;-</span> <a href='../131table.subx.html#L26'>get</a> target-val, <span class="PreProc">type</span>
<span id="L155" class="LineNr">155 </span> copy-to *type-addr, <span class="Constant">3</span>/file

View File

@ -70,223 +70,255 @@ if ('onhashchange' in window) {
<span id="L11" class="LineNr"> 11 </span><span class="muComment"># $ qemu-system-i386 code.img</span>
<span id="L12" class="LineNr"> 12 </span>
<span id="L13" class="LineNr"> 13 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L13'>main</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L14" class="LineNr"> 14 </span> <a href='mandelbrot-fixed.mu.html#L111'>mandelbrot</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L15" class="LineNr"> 15 </span><span class="Delimiter">}</span>
<span id="L16" class="LineNr"> 16 </span>
<span id="L17" class="LineNr"> 17 </span><span class="muComment"># Since they still look like int types, we'll append a '-f' suffix to variable</span>
<span id="L18" class="LineNr"> 18 </span><span class="muComment"># names to designate fixed-point numbers.</span>
<span id="L19" class="LineNr"> 19 </span>
<span id="L20" class="LineNr"> 20 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L20'>int-to-fixed</a></span> in: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
<span id="L21" class="LineNr"> 21 </span> <span class="PreProc">var</span> result-f/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy in
<span id="L22" class="LineNr"> 22 </span> result-f <span class="Special">&lt;-</span> shift-left <span class="Constant">8</span>/fixed-precision
<span id="L23" class="LineNr"> 23 </span> <span class="Delimiter">{</span>
<span id="L24" class="LineNr"> 24 </span> <span class="PreProc">break-if-not-overflow</span>
<span id="L25" class="LineNr"> 25 </span> <a href='501draw-text.mu.html#L481'>abort</a> <span class="Constant">&quot;int-to-fixed: overflow&quot;</span>
<span id="L26" class="LineNr"> 26 </span> <span class="Delimiter">}</span>
<span id="L27" class="LineNr"> 27 </span> <span class="PreProc">return</span> result-f
<span id="L28" class="LineNr"> 28 </span><span class="Delimiter">}</span>
<span id="L29" class="LineNr"> 29 </span>
<span id="L30" class="LineNr"> 30 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L30'>fixed-to-int</a></span> in-f: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
<span id="L31" class="LineNr"> 31 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy in-f
<span id="L32" class="LineNr"> 32 </span> result <span class="Special">&lt;-</span> shift-right-signed <span class="Constant">8</span>/fixed-precision
<span id="L33" class="LineNr"> 33 </span> <span class="PreProc">return</span> result
<span id="L34" class="LineNr"> 34 </span><span class="Delimiter">}</span>
<span id="L14" class="LineNr"> 14 </span> <span class="muComment"># Initially the viewport is centered at 0, 0 in the scene.</span>
<span id="L15" class="LineNr"> 15 </span> <span class="PreProc">var</span> scene-cx-f: int
<span id="L16" class="LineNr"> 16 </span> <span class="PreProc">var</span> scene-cy-f: int
<span id="L17" class="LineNr"> 17 </span> <span class="muComment"># Initially the viewport shows a section of the scene 4 units wide.</span>
<span id="L18" class="LineNr"> 18 </span> <span class="PreProc">var</span> scene-width-f: int
<span id="L19" class="LineNr"> 19 </span> copy-to scene-width-f, <span class="Constant">0x400</span>/<span class="Constant">4</span>
<span id="L20" class="LineNr"> 20 </span> <span class="Delimiter">{</span>
<span id="L21" class="LineNr"> 21 </span> <a href='mandelbrot-fixed.mu.html#L127'>mandelbrot</a> <a href='500fake-screen.mu.html#L14'>screen</a> scene-cx-f, scene-cy-f, scene-width-f
<span id="L22" class="LineNr"> 22 </span> <span class="muComment"># move at an angle slowly towards the edge</span>
<span id="L23" class="LineNr"> 23 </span> <span class="PreProc">var</span> adj-f/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L100'>multiply-fixed</a> scene-width-f, <span class="Constant">0x12</span>/<span class="Constant">0</span>.<span class="Constant">07</span>
<span id="L24" class="LineNr"> 24 </span> subtract-from scene-cx-f, adj-f
<span id="L25" class="LineNr"> 25 </span> add-to scene-cy-f, adj-f
<span id="L26" class="LineNr"> 26 </span> <span class="muComment"># slowly shrink the scene width to zoom in</span>
<span id="L27" class="LineNr"> 27 </span> <span class="PreProc">var</span> tmp-f/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L100'>multiply-fixed</a> scene-width-f, <span class="Constant">0x80</span>/<span class="Constant">0</span>.<span class="Constant">5</span>
<span id="L28" class="LineNr"> 28 </span> copy-to scene-width-f, tmp-f
<span id="L29" class="LineNr"> 29 </span> <span class="PreProc">loop</span>
<span id="L30" class="LineNr"> 30 </span> <span class="Delimiter">}</span>
<span id="L31" class="LineNr"> 31 </span><span class="Delimiter">}</span>
<span id="L32" class="LineNr"> 32 </span>
<span id="L33" class="LineNr"> 33 </span><span class="muComment"># Since they still look like int types, we'll append a '-f' suffix to variable</span>
<span id="L34" class="LineNr"> 34 </span><span class="muComment"># names to designate fixed-point numbers.</span>
<span id="L35" class="LineNr"> 35 </span>
<span id="L36" class="LineNr"> 36 </span><span class="muComment"># The process of throwing bits away always adjusts a number towards -infinity.</span>
<span id="L37" class="LineNr"> 37 </span><span class="PreProc">fn</span> <span class="muTest"><a href='mandelbrot-fixed.mu.html#L37'>test-fixed-conversion</a></span> <span class="Delimiter">{</span>
<span id="L38" class="LineNr"> 38 </span> <span class="muComment"># 0</span>
<span id="L39" class="LineNr"> 39 </span> <span class="PreProc">var</span> f/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L20'>int-to-fixed</a> <span class="Constant">0</span>
<span id="L40" class="LineNr"> 40 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L30'>fixed-to-int</a> f
<span id="L41" class="LineNr"> 41 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">0</span>, <span class="Constant">&quot;F - <a href='mandelbrot-fixed.mu.html#L37'>test-fixed-conversion</a> - 0&quot;</span>
<span id="L42" class="LineNr"> 42 </span> <span class="muComment"># 1</span>
<span id="L43" class="LineNr"> 43 </span> <span class="PreProc">var</span> f/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L20'>int-to-fixed</a> <span class="Constant">1</span>
<span id="L44" class="LineNr"> 44 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L30'>fixed-to-int</a> f
<span id="L45" class="LineNr"> 45 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">1</span>, <span class="Constant">&quot;F - <a href='mandelbrot-fixed.mu.html#L37'>test-fixed-conversion</a> - 1&quot;</span>
<span id="L46" class="LineNr"> 46 </span> <span class="muComment"># -1</span>
<span id="L47" class="LineNr"> 47 </span> <span class="PreProc">var</span> f/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L20'>int-to-fixed</a> <span class="Constant">-1</span>
<span id="L48" class="LineNr"> 48 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L30'>fixed-to-int</a> f
<span id="L49" class="LineNr"> 49 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">-1</span>, <span class="Constant">&quot;F - <a href='mandelbrot-fixed.mu.html#L37'>test-fixed-conversion</a> - -1&quot;</span>
<span id="L50" class="LineNr"> 50 </span> <span class="muComment"># 0.5 = 1/2</span>
<span id="L51" class="LineNr"> 51 </span> <span class="PreProc">var</span> f/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L20'>int-to-fixed</a> <span class="Constant">1</span>
<span id="L52" class="LineNr"> 52 </span> f <span class="Special">&lt;-</span> shift-right-signed <span class="Constant">1</span>
<span id="L53" class="LineNr"> 53 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L30'>fixed-to-int</a> f
<span id="L54" class="LineNr"> 54 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">0</span>, <span class="Constant">&quot;F - <a href='mandelbrot-fixed.mu.html#L37'>test-fixed-conversion</a> - 0.5&quot;</span>
<span id="L55" class="LineNr"> 55 </span> <span class="muComment"># -0.5 = -1/2</span>
<span id="L56" class="LineNr"> 56 </span> <span class="PreProc">var</span> f/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L20'>int-to-fixed</a> <span class="Constant">-1</span>
<span id="L57" class="LineNr"> 57 </span> f <span class="Special">&lt;-</span> shift-right-signed <span class="Constant">1</span>
<span id="L58" class="LineNr"> 58 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L30'>fixed-to-int</a> f
<span id="L59" class="LineNr"> 59 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">-1</span>, <span class="Constant">&quot;F - <a href='mandelbrot-fixed.mu.html#L37'>test-fixed-conversion</a> - -0.5&quot;</span>
<span id="L60" class="LineNr"> 60 </span> <span class="muComment"># 1.5 = 3/2</span>
<span id="L61" class="LineNr"> 61 </span> <span class="PreProc">var</span> f/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L20'>int-to-fixed</a> <span class="Constant">3</span>
<span id="L62" class="LineNr"> 62 </span> f <span class="Special">&lt;-</span> shift-right-signed <span class="Constant">1</span>
<span id="L63" class="LineNr"> 63 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L30'>fixed-to-int</a> f
<span id="L64" class="LineNr"> 64 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">1</span>, <span class="Constant">&quot;F - <a href='mandelbrot-fixed.mu.html#L37'>test-fixed-conversion</a> - 1.5&quot;</span>
<span id="L65" class="LineNr"> 65 </span> <span class="muComment"># -1.5 = -3/2</span>
<span id="L66" class="LineNr"> 66 </span> <span class="PreProc">var</span> f/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L20'>int-to-fixed</a> <span class="Constant">-3</span>
<span id="L67" class="LineNr"> 67 </span> f <span class="Special">&lt;-</span> shift-right-signed <span class="Constant">1</span>
<span id="L68" class="LineNr"> 68 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L30'>fixed-to-int</a> f
<span id="L69" class="LineNr"> 69 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">-2</span>, <span class="Constant">&quot;F - <a href='mandelbrot-fixed.mu.html#L37'>test-fixed-conversion</a> - -1.5&quot;</span>
<span id="L70" class="LineNr"> 70 </span> <span class="muComment"># 1.25 = 5/4</span>
<span id="L71" class="LineNr"> 71 </span> <span class="PreProc">var</span> f/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L20'>int-to-fixed</a> <span class="Constant">5</span>
<span id="L72" class="LineNr"> 72 </span> f <span class="Special">&lt;-</span> shift-right-signed <span class="Constant">2</span>
<span id="L73" class="LineNr"> 73 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L30'>fixed-to-int</a> f
<span id="L74" class="LineNr"> 74 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">1</span>, <span class="Constant">&quot;F - <a href='mandelbrot-fixed.mu.html#L37'>test-fixed-conversion</a> - 1.25&quot;</span>
<span id="L75" class="LineNr"> 75 </span> <span class="muComment"># -1.25 = -5/4</span>
<span id="L76" class="LineNr"> 76 </span> <span class="PreProc">var</span> f/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L20'>int-to-fixed</a> <span class="Constant">-5</span>
<span id="L77" class="LineNr"> 77 </span> f <span class="Special">&lt;-</span> shift-right-signed <span class="Constant">2</span>
<span id="L78" class="LineNr"> 78 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L30'>fixed-to-int</a> f
<span id="L79" class="LineNr"> 79 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">-2</span>, <span class="Constant">&quot;F - <a href='mandelbrot-fixed.mu.html#L37'>test-fixed-conversion</a> - -1.25&quot;</span>
<span id="L80" class="LineNr"> 80 </span><span class="Delimiter">}</span>
<span id="L81" class="LineNr"> 81 </span>
<span id="L82" class="LineNr"> 82 </span><span class="muComment"># special routines for multiplying and dividing fixed-point numbers</span>
<span id="L83" class="LineNr"> 83 </span>
<span id="L84" class="LineNr"> 84 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L84'>multiply-fixed</a></span> a-f: int, b-f: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
<span id="L85" class="LineNr"> 85 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy a-f
<span id="L86" class="LineNr"> 86 </span> result <span class="Special">&lt;-</span> multiply b-f
<span id="L87" class="LineNr"> 87 </span> <span class="Delimiter">{</span>
<span id="L88" class="LineNr"> 88 </span> <span class="PreProc">break-if-not-overflow</span>
<span id="L89" class="LineNr"> 89 </span> <a href='501draw-text.mu.html#L481'>abort</a> <span class="Constant">&quot;multiply-fixed: overflow&quot;</span>
<span id="L90" class="LineNr"> 90 </span> <span class="Delimiter">}</span>
<span id="L91" class="LineNr"> 91 </span> result <span class="Special">&lt;-</span> shift-right-signed <span class="Constant">8</span>/fixed-precision
<span id="L92" class="LineNr"> 92 </span> <span class="PreProc">return</span> result
<span id="L93" class="LineNr"> 93 </span><span class="Delimiter">}</span>
<span id="L94" class="LineNr"> 94 </span>
<span id="L95" class="LineNr"> 95 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L95'>divide-fixed</a></span> a-f: int, b-f: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
<span id="L96" class="LineNr"> 96 </span> <span class="PreProc">var</span> result-f/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy a-f
<span id="L97" class="LineNr"> 97 </span> result-f <span class="Special">&lt;-</span> shift-left <span class="Constant">8</span>/fixed-precision
<span id="L98" class="LineNr"> 98 </span> <span class="Delimiter">{</span>
<span id="L99" class="LineNr"> 99 </span> <span class="PreProc">break-if-not-overflow</span>
<span id="L100" class="LineNr">100 </span> <a href='501draw-text.mu.html#L481'>abort</a> <span class="Constant">&quot;divide-fixed: overflow&quot;</span>
<span id="L101" class="LineNr">101 </span> <span class="Delimiter">}</span>
<span id="L102" class="LineNr">102 </span> <span class="PreProc">var</span> dummy-remainder/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L103" class="LineNr">103 </span> result-f, dummy-remainder <span class="Special">&lt;-</span> <a href='314divide.subx.html#L3'>integer-divide</a> result-f, b-f
<span id="L104" class="LineNr">104 </span> <span class="PreProc">return</span> result-f
<span id="L105" class="LineNr">105 </span><span class="Delimiter">}</span>
<span id="L106" class="LineNr">106 </span>
<span id="L107" class="LineNr">107 </span><span class="muComment"># multiplying or dividing by an integer can use existing instructions.</span>
<span id="L108" class="LineNr">108 </span>
<span id="L109" class="LineNr">109 </span><span class="muComment"># adding and subtracting two fixed-point numbers can use existing instructions.</span>
<span id="L36" class="LineNr"> 36 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a></span> in: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
<span id="L37" class="LineNr"> 37 </span> <span class="PreProc">var</span> result-f/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy in
<span id="L38" class="LineNr"> 38 </span> result-f <span class="Special">&lt;-</span> shift-left <span class="Constant">8</span>/fixed-precision
<span id="L39" class="LineNr"> 39 </span> <span class="Delimiter">{</span>
<span id="L40" class="LineNr"> 40 </span> <span class="PreProc">break-if-not-overflow</span>
<span id="L41" class="LineNr"> 41 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;int-to-fixed: overflow&quot;</span>
<span id="L42" class="LineNr"> 42 </span> <span class="Delimiter">}</span>
<span id="L43" class="LineNr"> 43 </span> <span class="PreProc">return</span> result-f
<span id="L44" class="LineNr"> 44 </span><span class="Delimiter">}</span>
<span id="L45" class="LineNr"> 45 </span>
<span id="L46" class="LineNr"> 46 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L46'>fixed-to-int</a></span> in-f: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
<span id="L47" class="LineNr"> 47 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy in-f
<span id="L48" class="LineNr"> 48 </span> result <span class="Special">&lt;-</span> shift-right-signed <span class="Constant">8</span>/fixed-precision
<span id="L49" class="LineNr"> 49 </span> <span class="PreProc">return</span> result
<span id="L50" class="LineNr"> 50 </span><span class="Delimiter">}</span>
<span id="L51" class="LineNr"> 51 </span>
<span id="L52" class="LineNr"> 52 </span><span class="muComment"># The process of throwing bits away always adjusts a number towards -infinity.</span>
<span id="L53" class="LineNr"> 53 </span><span class="PreProc">fn</span> <span class="muTest"><a href='mandelbrot-fixed.mu.html#L53'>test-fixed-conversion</a></span> <span class="Delimiter">{</span>
<span id="L54" class="LineNr"> 54 </span> <span class="muComment"># 0</span>
<span id="L55" class="LineNr"> 55 </span> <span class="PreProc">var</span> f/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> <span class="Constant">0</span>
<span id="L56" class="LineNr"> 56 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L46'>fixed-to-int</a> f
<span id="L57" class="LineNr"> 57 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">0</span>, <span class="Constant">&quot;F - <a href='mandelbrot-fixed.mu.html#L53'>test-fixed-conversion</a> - 0&quot;</span>
<span id="L58" class="LineNr"> 58 </span> <span class="muComment"># 1</span>
<span id="L59" class="LineNr"> 59 </span> <span class="PreProc">var</span> f/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> <span class="Constant">1</span>
<span id="L60" class="LineNr"> 60 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L46'>fixed-to-int</a> f
<span id="L61" class="LineNr"> 61 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">1</span>, <span class="Constant">&quot;F - <a href='mandelbrot-fixed.mu.html#L53'>test-fixed-conversion</a> - 1&quot;</span>
<span id="L62" class="LineNr"> 62 </span> <span class="muComment"># -1</span>
<span id="L63" class="LineNr"> 63 </span> <span class="PreProc">var</span> f/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> <span class="Constant">-1</span>
<span id="L64" class="LineNr"> 64 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L46'>fixed-to-int</a> f
<span id="L65" class="LineNr"> 65 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">-1</span>, <span class="Constant">&quot;F - <a href='mandelbrot-fixed.mu.html#L53'>test-fixed-conversion</a> - -1&quot;</span>
<span id="L66" class="LineNr"> 66 </span> <span class="muComment"># 0.5 = 1/2</span>
<span id="L67" class="LineNr"> 67 </span> <span class="PreProc">var</span> f/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> <span class="Constant">1</span>
<span id="L68" class="LineNr"> 68 </span> f <span class="Special">&lt;-</span> shift-right-signed <span class="Constant">1</span>
<span id="L69" class="LineNr"> 69 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L46'>fixed-to-int</a> f
<span id="L70" class="LineNr"> 70 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">0</span>, <span class="Constant">&quot;F - <a href='mandelbrot-fixed.mu.html#L53'>test-fixed-conversion</a> - 0.5&quot;</span>
<span id="L71" class="LineNr"> 71 </span> <span class="muComment"># -0.5 = -1/2</span>
<span id="L72" class="LineNr"> 72 </span> <span class="PreProc">var</span> f/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> <span class="Constant">-1</span>
<span id="L73" class="LineNr"> 73 </span> f <span class="Special">&lt;-</span> shift-right-signed <span class="Constant">1</span>
<span id="L74" class="LineNr"> 74 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L46'>fixed-to-int</a> f
<span id="L75" class="LineNr"> 75 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">-1</span>, <span class="Constant">&quot;F - <a href='mandelbrot-fixed.mu.html#L53'>test-fixed-conversion</a> - -0.5&quot;</span>
<span id="L76" class="LineNr"> 76 </span> <span class="muComment"># 1.5 = 3/2</span>
<span id="L77" class="LineNr"> 77 </span> <span class="PreProc">var</span> f/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> <span class="Constant">3</span>
<span id="L78" class="LineNr"> 78 </span> f <span class="Special">&lt;-</span> shift-right-signed <span class="Constant">1</span>
<span id="L79" class="LineNr"> 79 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L46'>fixed-to-int</a> f
<span id="L80" class="LineNr"> 80 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">1</span>, <span class="Constant">&quot;F - <a href='mandelbrot-fixed.mu.html#L53'>test-fixed-conversion</a> - 1.5&quot;</span>
<span id="L81" class="LineNr"> 81 </span> <span class="muComment"># -1.5 = -3/2</span>
<span id="L82" class="LineNr"> 82 </span> <span class="PreProc">var</span> f/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> <span class="Constant">-3</span>
<span id="L83" class="LineNr"> 83 </span> f <span class="Special">&lt;-</span> shift-right-signed <span class="Constant">1</span>
<span id="L84" class="LineNr"> 84 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L46'>fixed-to-int</a> f
<span id="L85" class="LineNr"> 85 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">-2</span>, <span class="Constant">&quot;F - <a href='mandelbrot-fixed.mu.html#L53'>test-fixed-conversion</a> - -1.5&quot;</span>
<span id="L86" class="LineNr"> 86 </span> <span class="muComment"># 1.25 = 5/4</span>
<span id="L87" class="LineNr"> 87 </span> <span class="PreProc">var</span> f/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> <span class="Constant">5</span>
<span id="L88" class="LineNr"> 88 </span> f <span class="Special">&lt;-</span> shift-right-signed <span class="Constant">2</span>
<span id="L89" class="LineNr"> 89 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L46'>fixed-to-int</a> f
<span id="L90" class="LineNr"> 90 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">1</span>, <span class="Constant">&quot;F - <a href='mandelbrot-fixed.mu.html#L53'>test-fixed-conversion</a> - 1.25&quot;</span>
<span id="L91" class="LineNr"> 91 </span> <span class="muComment"># -1.25 = -5/4</span>
<span id="L92" class="LineNr"> 92 </span> <span class="PreProc">var</span> f/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> <span class="Constant">-5</span>
<span id="L93" class="LineNr"> 93 </span> f <span class="Special">&lt;-</span> shift-right-signed <span class="Constant">2</span>
<span id="L94" class="LineNr"> 94 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L46'>fixed-to-int</a> f
<span id="L95" class="LineNr"> 95 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">-2</span>, <span class="Constant">&quot;F - <a href='mandelbrot-fixed.mu.html#L53'>test-fixed-conversion</a> - -1.25&quot;</span>
<span id="L96" class="LineNr"> 96 </span><span class="Delimiter">}</span>
<span id="L97" class="LineNr"> 97 </span>
<span id="L98" class="LineNr"> 98 </span><span class="muComment"># special routines for multiplying and dividing fixed-point numbers</span>
<span id="L99" class="LineNr"> 99 </span>
<span id="L100" class="LineNr">100 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L100'>multiply-fixed</a></span> a-f: int, b-f: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
<span id="L101" class="LineNr">101 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy a-f
<span id="L102" class="LineNr">102 </span> result <span class="Special">&lt;-</span> multiply b-f
<span id="L103" class="LineNr">103 </span> <span class="Delimiter">{</span>
<span id="L104" class="LineNr">104 </span> <span class="PreProc">break-if-not-overflow</span>
<span id="L105" class="LineNr">105 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;multiply-fixed: overflow&quot;</span>
<span id="L106" class="LineNr">106 </span> <span class="Delimiter">}</span>
<span id="L107" class="LineNr">107 </span> result <span class="Special">&lt;-</span> shift-right-signed <span class="Constant">8</span>/fixed-precision
<span id="L108" class="LineNr">108 </span> <span class="PreProc">return</span> result
<span id="L109" class="LineNr">109 </span><span class="Delimiter">}</span>
<span id="L110" class="LineNr">110 </span>
<span id="L111" class="LineNr">111 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L111'>mandelbrot</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>) <span class="Delimiter">{</span>
<span id="L112" class="LineNr">112 </span> <span class="PreProc">var</span> a/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L113" class="LineNr">113 </span> <span class="PreProc">var</span> b/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L114" class="LineNr">114 </span> a, b <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L70'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L115" class="LineNr">115 </span> <span class="PreProc">var</span> width/<span class="Constant">esi</span>: int <span class="Special">&lt;-</span> copy a
<span id="L116" class="LineNr">116 </span> width <span class="Special">&lt;-</span> shift-left <span class="Constant">3</span>/log2-font-width
<span id="L117" class="LineNr">117 </span> <span class="PreProc">var</span> height/<span class="Constant">edi</span>: int <span class="Special">&lt;-</span> copy b
<span id="L118" class="LineNr">118 </span> height <span class="Special">&lt;-</span> shift-left <span class="Constant">4</span>/log2-font-height
<span id="L119" class="LineNr">119 </span> <span class="PreProc">var</span> y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L120" class="LineNr">120 </span> <span class="Delimiter">{</span>
<span id="L121" class="LineNr">121 </span> compare y, height
<span id="L122" class="LineNr">122 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L123" class="LineNr">123 </span> <span class="PreProc">var</span> imaginary-f/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L218'>viewport-to-imaginary-f</a> y, width, height
<span id="L124" class="LineNr">124 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L125" class="LineNr">125 </span> <span class="Delimiter">{</span>
<span id="L126" class="LineNr">126 </span> compare x, width
<span id="L127" class="LineNr">127 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L128" class="LineNr">128 </span> <span class="PreProc">var</span> real-f/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L205'>viewport-to-real-f</a> x, width
<span id="L129" class="LineNr">129 </span> <span class="PreProc">var</span> iterations/<span class="Constant">esi</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L148'>mandelbrot-iterations-for-point</a> real-f, imaginary-f, <span class="Constant">0x400</span>/max
<span id="L130" class="LineNr">130 </span> compare iterations, <span class="Constant">0x400</span>/max
<span id="L131" class="LineNr">131 </span> <span class="Delimiter">{</span>
<span id="L132" class="LineNr">132 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L133" class="LineNr">133 </span> <a href='500fake-screen.mu.html#L462'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y, <span class="Constant">0xf</span>/white
<span id="L134" class="LineNr">134 </span> <span class="Delimiter">}</span>
<span id="L135" class="LineNr">135 </span> compare iterations, <span class="Constant">0x400</span>/max
<span id="L136" class="LineNr">136 </span> <span class="Delimiter">{</span>
<span id="L137" class="LineNr">137 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L138" class="LineNr">138 </span> <a href='500fake-screen.mu.html#L462'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y, <span class="Constant">0</span>/black
<span id="L139" class="LineNr">139 </span> <span class="Delimiter">}</span>
<span id="L140" class="LineNr">140 </span> x <span class="Special">&lt;-</span> increment
<span id="L141" class="LineNr">141 </span> <span class="PreProc">loop</span>
<span id="L142" class="LineNr">142 </span> <span class="Delimiter">}</span>
<span id="L143" class="LineNr">143 </span> y <span class="Special">&lt;-</span> increment
<span id="L144" class="LineNr">144 </span> <span class="PreProc">loop</span>
<span id="L145" class="LineNr">145 </span> <span class="Delimiter">}</span>
<span id="L146" class="LineNr">146 </span><span class="Delimiter">}</span>
<span id="L147" class="LineNr">147 </span>
<span id="L148" class="LineNr">148 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L148'>mandelbrot-iterations-for-point</a></span> real-f: int, imaginary-f: int, max: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">esi</span>: int <span class="Delimiter">{</span>
<span id="L149" class="LineNr">149 </span> <span class="PreProc">var</span> x-f/<span class="Constant">esi</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L150" class="LineNr">150 </span> <span class="PreProc">var</span> y-f/<span class="Constant">edi</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L151" class="LineNr">151 </span> <span class="PreProc">var</span> iterations/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L152" class="LineNr">152 </span> <span class="Delimiter">{</span>
<span id="L153" class="LineNr">153 </span> <span class="PreProc">var</span> done?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L168'>mandelbrot-done?</a> x-f, y-f
<span id="L154" class="LineNr">154 </span> compare done?, <span class="Constant">0</span>/false
<span id="L155" class="LineNr">155 </span> <span class="PreProc">break-if-!=</span>
<span id="L156" class="LineNr">156 </span> compare iterations, max
<span id="L157" class="LineNr">157 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L158" class="LineNr">158 </span> <span class="PreProc">var</span> x2-f/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L182'>mandelbrot-x</a> x-f, y-f, real-f
<span id="L159" class="LineNr">159 </span> <span class="PreProc">var</span> y2-f/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L192'>mandelbrot-y</a> x-f, y-f, imaginary-f
<span id="L160" class="LineNr">160 </span> x-f <span class="Special">&lt;-</span> copy x2-f
<span id="L161" class="LineNr">161 </span> y-f <span class="Special">&lt;-</span> copy y2-f
<span id="L162" class="LineNr">162 </span> iterations <span class="Special">&lt;-</span> increment
<span id="L163" class="LineNr">163 </span> <span class="PreProc">loop</span>
<span id="L164" class="LineNr">164 </span> <span class="Delimiter">}</span>
<span id="L165" class="LineNr">165 </span> <span class="PreProc">return</span> iterations
<span id="L166" class="LineNr">166 </span><span class="Delimiter">}</span>
<span id="L167" class="LineNr">167 </span>
<span id="L168" class="LineNr">168 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L168'>mandelbrot-done?</a></span> x-f: int, y-f: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean <span class="Delimiter">{</span>
<span id="L169" class="LineNr">169 </span> <span class="muComment"># x*x + y*y &gt; 4</span>
<span id="L170" class="LineNr">170 </span> <span class="PreProc">var</span> tmp-f/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L84'>multiply-fixed</a> x-f, x-f
<span id="L171" class="LineNr">171 </span> <span class="PreProc">var</span> result-f/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy tmp-f
<span id="L172" class="LineNr">172 </span> tmp-f <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L84'>multiply-fixed</a> y-f, y-f
<span id="L173" class="LineNr">173 </span> result-f <span class="Special">&lt;-</span> add tmp-f
<span id="L174" class="LineNr">174 </span> compare result-f, <span class="Constant">0x400</span>/<span class="Constant">4</span>
<span id="L175" class="LineNr">175 </span> <span class="Delimiter">{</span>
<span id="L176" class="LineNr">176 </span> <span class="PreProc">break-if-&gt;</span>
<span id="L177" class="LineNr">177 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L111" class="LineNr">111 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L111'>divide-fixed</a></span> a-f: int, b-f: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
<span id="L112" class="LineNr">112 </span> <span class="PreProc">var</span> result-f/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy a-f
<span id="L113" class="LineNr">113 </span> result-f <span class="Special">&lt;-</span> shift-left <span class="Constant">8</span>/fixed-precision
<span id="L114" class="LineNr">114 </span> <span class="Delimiter">{</span>
<span id="L115" class="LineNr">115 </span> <span class="PreProc">break-if-not-overflow</span>
<span id="L116" class="LineNr">116 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;divide-fixed: overflow&quot;</span>
<span id="L117" class="LineNr">117 </span> <span class="Delimiter">}</span>
<span id="L118" class="LineNr">118 </span> <span class="PreProc">var</span> dummy-remainder/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L119" class="LineNr">119 </span> result-f, dummy-remainder <span class="Special">&lt;-</span> <a href='314divide.subx.html#L3'>integer-divide</a> result-f, b-f
<span id="L120" class="LineNr">120 </span> <span class="PreProc">return</span> result-f
<span id="L121" class="LineNr">121 </span><span class="Delimiter">}</span>
<span id="L122" class="LineNr">122 </span>
<span id="L123" class="LineNr">123 </span><span class="muComment"># multiplying or dividing by an integer can use existing instructions.</span>
<span id="L124" class="LineNr">124 </span>
<span id="L125" class="LineNr">125 </span><span class="muComment"># adding and subtracting two fixed-point numbers can use existing instructions.</span>
<span id="L126" class="LineNr">126 </span>
<span id="L127" class="LineNr">127 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L127'>mandelbrot</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), scene-cx-f: int, scene-cy-f: int, scene-width-f: int <span class="Delimiter">{</span>
<span id="L128" class="LineNr">128 </span> <span class="PreProc">var</span> a/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L129" class="LineNr">129 </span> <span class="PreProc">var</span> b/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L130" class="LineNr">130 </span> a, b <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L70'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L131" class="LineNr">131 </span> <span class="PreProc">var</span> width/<span class="Constant">esi</span>: int <span class="Special">&lt;-</span> copy a
<span id="L132" class="LineNr">132 </span> width <span class="Special">&lt;-</span> shift-left <span class="Constant">3</span>/log2-font-width
<span id="L133" class="LineNr">133 </span> <span class="PreProc">var</span> height/<span class="Constant">edi</span>: int <span class="Special">&lt;-</span> copy b
<span id="L134" class="LineNr">134 </span> height <span class="Special">&lt;-</span> shift-left <span class="Constant">4</span>/log2-font-height
<span id="L135" class="LineNr">135 </span> <span class="PreProc">var</span> y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L136" class="LineNr">136 </span> <span class="Delimiter">{</span>
<span id="L137" class="LineNr">137 </span> compare y, height
<span id="L138" class="LineNr">138 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L139" class="LineNr">139 </span> <span class="PreProc">var</span> imaginary-f/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L237'>viewport-to-imaginary-f</a> y, width, height, scene-cy-f, scene-width-f
<span id="L140" class="LineNr">140 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L141" class="LineNr">141 </span> <span class="Delimiter">{</span>
<span id="L142" class="LineNr">142 </span> compare x, width
<span id="L143" class="LineNr">143 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L144" class="LineNr">144 </span> <span class="PreProc">var</span> real-f/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L219'>viewport-to-real-f</a> x, width, scene-cx-f, scene-width-f
<span id="L145" class="LineNr">145 </span> <span class="PreProc">var</span> iterations/<span class="Constant">esi</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L162'>mandelbrot-iterations-for-point</a> real-f, imaginary-f, <span class="Constant">0x400</span>/max
<span id="L146" class="LineNr">146 </span> iterations <span class="Special">&lt;-</span> shift-right <span class="Constant">3</span>
<span id="L147" class="LineNr">147 </span> <span class="PreProc">var</span> color/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L148" class="LineNr">148 </span> <span class="Delimiter">{</span>
<span id="L149" class="LineNr">149 </span> <span class="PreProc">var</span> dummy/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L150" class="LineNr">150 </span> dummy, color <span class="Special">&lt;-</span> <a href='314divide.subx.html#L3'>integer-divide</a> iterations, <span class="Constant">0x18</span>/<span class="Constant">24</span>/size-of-cycle-0
<span id="L151" class="LineNr">151 </span> color <span class="Special">&lt;-</span> add <span class="Constant">0x20</span>/cycle-0
<span id="L152" class="LineNr">152 </span> <span class="Delimiter">}</span>
<span id="L153" class="LineNr">153 </span> <a href='500fake-screen.mu.html#L462'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y, color
<span id="L154" class="LineNr">154 </span> x <span class="Special">&lt;-</span> increment
<span id="L155" class="LineNr">155 </span> <span class="PreProc">loop</span>
<span id="L156" class="LineNr">156 </span> <span class="Delimiter">}</span>
<span id="L157" class="LineNr">157 </span> y <span class="Special">&lt;-</span> increment
<span id="L158" class="LineNr">158 </span> <span class="PreProc">loop</span>
<span id="L159" class="LineNr">159 </span> <span class="Delimiter">}</span>
<span id="L160" class="LineNr">160 </span><span class="Delimiter">}</span>
<span id="L161" class="LineNr">161 </span>
<span id="L162" class="LineNr">162 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L162'>mandelbrot-iterations-for-point</a></span> real-f: int, imaginary-f: int, max: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">esi</span>: int <span class="Delimiter">{</span>
<span id="L163" class="LineNr">163 </span> <span class="PreProc">var</span> x-f/<span class="Constant">esi</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L164" class="LineNr">164 </span> <span class="PreProc">var</span> y-f/<span class="Constant">edi</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L165" class="LineNr">165 </span> <span class="PreProc">var</span> iterations/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L166" class="LineNr">166 </span> <span class="Delimiter">{</span>
<span id="L167" class="LineNr">167 </span> <span class="PreProc">var</span> done?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L182'>mandelbrot-done?</a> x-f, y-f
<span id="L168" class="LineNr">168 </span> compare done?, <span class="Constant">0</span>/false
<span id="L169" class="LineNr">169 </span> <span class="PreProc">break-if-!=</span>
<span id="L170" class="LineNr">170 </span> compare iterations, max
<span id="L171" class="LineNr">171 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L172" class="LineNr">172 </span> <span class="PreProc">var</span> x2-f/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L196'>mandelbrot-x</a> x-f, y-f, real-f
<span id="L173" class="LineNr">173 </span> <span class="PreProc">var</span> y2-f/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L206'>mandelbrot-y</a> x-f, y-f, imaginary-f
<span id="L174" class="LineNr">174 </span> x-f <span class="Special">&lt;-</span> copy x2-f
<span id="L175" class="LineNr">175 </span> y-f <span class="Special">&lt;-</span> copy y2-f
<span id="L176" class="LineNr">176 </span> iterations <span class="Special">&lt;-</span> increment
<span id="L177" class="LineNr">177 </span> <span class="PreProc">loop</span>
<span id="L178" class="LineNr">178 </span> <span class="Delimiter">}</span>
<span id="L179" class="LineNr">179 </span> <span class="PreProc">return</span> <span class="Constant">1</span>/true
<span id="L179" class="LineNr">179 </span> <span class="PreProc">return</span> iterations
<span id="L180" class="LineNr">180 </span><span class="Delimiter">}</span>
<span id="L181" class="LineNr">181 </span>
<span id="L182" class="LineNr">182 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L182'>mandelbrot-x</a></span> x-f: int, y-f: int, real-f: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">edx</span>: int <span class="Delimiter">{</span>
<span id="L183" class="LineNr">183 </span> <span class="muComment"># x*x - y*y + real</span>
<span id="L184" class="LineNr">184 </span> <span class="PreProc">var</span> tmp-f/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L84'>multiply-fixed</a> x-f, x-f
<span id="L182" class="LineNr">182 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L182'>mandelbrot-done?</a></span> x-f: int, y-f: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean <span class="Delimiter">{</span>
<span id="L183" class="LineNr">183 </span> <span class="muComment"># x*x + y*y &gt; 4</span>
<span id="L184" class="LineNr">184 </span> <span class="PreProc">var</span> tmp-f/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L100'>multiply-fixed</a> x-f, x-f
<span id="L185" class="LineNr">185 </span> <span class="PreProc">var</span> result-f/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy tmp-f
<span id="L186" class="LineNr">186 </span> tmp-f <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L84'>multiply-fixed</a> y-f, y-f
<span id="L187" class="LineNr">187 </span> result-f <span class="Special">&lt;-</span> subtract tmp-f
<span id="L188" class="LineNr">188 </span> result-f <span class="Special">&lt;-</span> add real-f
<span id="L189" class="LineNr">189 </span> <span class="PreProc">return</span> result-f
<span id="L190" class="LineNr">190 </span><span class="Delimiter">}</span>
<span id="L191" class="LineNr">191 </span>
<span id="L192" class="LineNr">192 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L192'>mandelbrot-y</a></span> x-f: int, y-f: int, imaginary-f: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">ebx</span>: int <span class="Delimiter">{</span>
<span id="L193" class="LineNr">193 </span> <span class="muComment"># 2*x*y + imaginary</span>
<span id="L194" class="LineNr">194 </span> <span class="PreProc">var</span> result-f/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy x-f
<span id="L195" class="LineNr">195 </span> result-f <span class="Special">&lt;-</span> shift-left <span class="Constant">1</span>/log2
<span id="L196" class="LineNr">196 </span> result-f <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L84'>multiply-fixed</a> result-f, y-f
<span id="L197" class="LineNr">197 </span> result-f <span class="Special">&lt;-</span> add imaginary-f
<span id="L198" class="LineNr">198 </span> <span class="PreProc">return</span> result-f
<span id="L199" class="LineNr">199 </span><span class="Delimiter">}</span>
<span id="L200" class="LineNr">200 </span>
<span id="L201" class="LineNr">201 </span><span class="muComment"># Scale (x, y) pixel coordinates to a complex plane where the viewport width</span>
<span id="L202" class="LineNr">202 </span><span class="muComment"># ranges from -2 to +2. Viewport height just follows the viewport's aspect</span>
<span id="L203" class="LineNr">203 </span><span class="muComment"># ratio.</span>
<span id="L204" class="LineNr">204 </span>
<span id="L205" class="LineNr">205 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L205'>viewport-to-real-f</a></span> x: int, width: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">edx</span>: int <span class="Delimiter">{</span>
<span id="L206" class="LineNr">206 </span> <span class="muComment"># (x - width/2)*4/width</span>
<span id="L207" class="LineNr">207 </span> <span class="PreProc">var</span> result-f/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L20'>int-to-fixed</a> x
<span id="L208" class="LineNr">208 </span> <span class="PreProc">var</span> width-f/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy width
<span id="L209" class="LineNr">209 </span> width-f <span class="Special">&lt;-</span> shift-left <span class="Constant">8</span>/fixed-precision
<span id="L210" class="LineNr">210 </span> <span class="PreProc">var</span> half-width-f/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy width-f
<span id="L211" class="LineNr">211 </span> half-width-f <span class="Special">&lt;-</span> shift-right-signed <span class="Constant">1</span>/log2
<span id="L212" class="LineNr">212 </span> result-f <span class="Special">&lt;-</span> subtract half-width-f
<span id="L213" class="LineNr">213 </span> result-f <span class="Special">&lt;-</span> shift-left <span class="Constant">2</span>/log4
<span id="L214" class="LineNr">214 </span> result-f <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L95'>divide-fixed</a> result-f, width-f
<span id="L215" class="LineNr">215 </span> <span class="PreProc">return</span> result-f
<span id="L216" class="LineNr">216 </span><span class="Delimiter">}</span>
<span id="L217" class="LineNr">217 </span>
<span id="L218" class="LineNr">218 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L218'>viewport-to-imaginary-f</a></span> y: int, width: int, height: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">ebx</span>: int <span class="Delimiter">{</span>
<span id="L219" class="LineNr">219 </span> <span class="muComment"># (y - height/2)*4/width</span>
<span id="L220" class="LineNr">220 </span> <span class="PreProc">var</span> result-f/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L20'>int-to-fixed</a> y
<span id="L221" class="LineNr">221 </span> <span class="PreProc">var</span> half-height-f/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy height
<span id="L222" class="LineNr">222 </span> half-height-f <span class="Special">&lt;-</span> shift-left <span class="Constant">8</span>/fixed-precision
<span id="L223" class="LineNr">223 </span> half-height-f <span class="Special">&lt;-</span> shift-right-signed <span class="Constant">1</span>/log2
<span id="L224" class="LineNr">224 </span> result-f <span class="Special">&lt;-</span> subtract half-height-f
<span id="L225" class="LineNr">225 </span> result-f <span class="Special">&lt;-</span> shift-left <span class="Constant">2</span>/log4
<span id="L226" class="LineNr">226 </span> <span class="PreProc">var</span> width-f/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy width
<span id="L227" class="LineNr">227 </span> width-f <span class="Special">&lt;-</span> shift-left <span class="Constant">8</span>/fixed-precision
<span id="L228" class="LineNr">228 </span> result-f <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L95'>divide-fixed</a> result-f, width-f
<span id="L229" class="LineNr">229 </span> <span class="PreProc">return</span> result-f
<span id="L230" class="LineNr">230 </span><span class="Delimiter">}</span>
<span id="L186" class="LineNr">186 </span> tmp-f <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L100'>multiply-fixed</a> y-f, y-f
<span id="L187" class="LineNr">187 </span> result-f <span class="Special">&lt;-</span> add tmp-f
<span id="L188" class="LineNr">188 </span> compare result-f, <span class="Constant">0x400</span>/<span class="Constant">4</span>
<span id="L189" class="LineNr">189 </span> <span class="Delimiter">{</span>
<span id="L190" class="LineNr">190 </span> <span class="PreProc">break-if-&gt;</span>
<span id="L191" class="LineNr">191 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L192" class="LineNr">192 </span> <span class="Delimiter">}</span>
<span id="L193" class="LineNr">193 </span> <span class="PreProc">return</span> <span class="Constant">1</span>/true
<span id="L194" class="LineNr">194 </span><span class="Delimiter">}</span>
<span id="L195" class="LineNr">195 </span>
<span id="L196" class="LineNr">196 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L196'>mandelbrot-x</a></span> x-f: int, y-f: int, real-f: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">edx</span>: int <span class="Delimiter">{</span>
<span id="L197" class="LineNr">197 </span> <span class="muComment"># x*x - y*y + real</span>
<span id="L198" class="LineNr">198 </span> <span class="PreProc">var</span> tmp-f/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L100'>multiply-fixed</a> x-f, x-f
<span id="L199" class="LineNr">199 </span> <span class="PreProc">var</span> result-f/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy tmp-f
<span id="L200" class="LineNr">200 </span> tmp-f <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L100'>multiply-fixed</a> y-f, y-f
<span id="L201" class="LineNr">201 </span> result-f <span class="Special">&lt;-</span> subtract tmp-f
<span id="L202" class="LineNr">202 </span> result-f <span class="Special">&lt;-</span> add real-f
<span id="L203" class="LineNr">203 </span> <span class="PreProc">return</span> result-f
<span id="L204" class="LineNr">204 </span><span class="Delimiter">}</span>
<span id="L205" class="LineNr">205 </span>
<span id="L206" class="LineNr">206 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L206'>mandelbrot-y</a></span> x-f: int, y-f: int, imaginary-f: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">ebx</span>: int <span class="Delimiter">{</span>
<span id="L207" class="LineNr">207 </span> <span class="muComment"># 2*x*y + imaginary</span>
<span id="L208" class="LineNr">208 </span> <span class="PreProc">var</span> result-f/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy x-f
<span id="L209" class="LineNr">209 </span> result-f <span class="Special">&lt;-</span> shift-left <span class="Constant">1</span>/log2
<span id="L210" class="LineNr">210 </span> result-f <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L100'>multiply-fixed</a> result-f, y-f
<span id="L211" class="LineNr">211 </span> result-f <span class="Special">&lt;-</span> add imaginary-f
<span id="L212" class="LineNr">212 </span> <span class="PreProc">return</span> result-f
<span id="L213" class="LineNr">213 </span><span class="Delimiter">}</span>
<span id="L214" class="LineNr">214 </span>
<span id="L215" class="LineNr">215 </span><span class="muComment"># Scale (x, y) pixel coordinates to a complex plane where the viewport width</span>
<span id="L216" class="LineNr">216 </span><span class="muComment"># ranges from -2 to +2. Viewport height just follows the viewport's aspect</span>
<span id="L217" class="LineNr">217 </span><span class="muComment"># ratio.</span>
<span id="L218" class="LineNr">218 </span>
<span id="L219" class="LineNr">219 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L219'>viewport-to-real-f</a></span> x: int, width: int, scene-cx-f: int, scene-width-f: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">edx</span>: int <span class="Delimiter">{</span>
<span id="L220" class="LineNr">220 </span> <span class="muComment"># 0 in the viewport goes to scene-cx - scene-width/2 </span>
<span id="L221" class="LineNr">221 </span> <span class="muComment"># width in the viewport goes to scene-cx + scene-width/2</span>
<span id="L222" class="LineNr">222 </span> <span class="muComment"># Therefore:</span>
<span id="L223" class="LineNr">223 </span> <span class="muComment"># x in the viewport goes to (scene-cx - scene-width/2) + x*scene-width/width</span>
<span id="L224" class="LineNr">224 </span> <span class="muComment"># At most two numbers being multiplied before a divide, so no risk of overflow.</span>
<span id="L225" class="LineNr">225 </span> <span class="PreProc">var</span> result-f/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> x
<span id="L226" class="LineNr">226 </span> result-f <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L100'>multiply-fixed</a> result-f, scene-width-f
<span id="L227" class="LineNr">227 </span> <span class="PreProc">var</span> width-f/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy width
<span id="L228" class="LineNr">228 </span> width-f <span class="Special">&lt;-</span> shift-left <span class="Constant">8</span>/fixed-precision
<span id="L229" class="LineNr">229 </span> result-f <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L111'>divide-fixed</a> result-f, width-f
<span id="L230" class="LineNr">230 </span> result-f <span class="Special">&lt;-</span> add scene-cx-f
<span id="L231" class="LineNr">231 </span> <span class="PreProc">var</span> half-scene-width-f/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy scene-width-f
<span id="L232" class="LineNr">232 </span> half-scene-width-f <span class="Special">&lt;-</span> shift-right <span class="Constant">1</span>
<span id="L233" class="LineNr">233 </span> result-f <span class="Special">&lt;-</span> subtract half-scene-width-f
<span id="L234" class="LineNr">234 </span> <span class="PreProc">return</span> result-f
<span id="L235" class="LineNr">235 </span><span class="Delimiter">}</span>
<span id="L236" class="LineNr">236 </span>
<span id="L237" class="LineNr">237 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L237'>viewport-to-imaginary-f</a></span> y: int, width: int, height: int, scene-cy-f: int, scene-width-f: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">ebx</span>: int <span class="Delimiter">{</span>
<span id="L238" class="LineNr">238 </span> <span class="muComment"># 0 in the viewport goes to scene-cy - scene-width/2*height/width</span>
<span id="L239" class="LineNr">239 </span> <span class="muComment"># height in the viewport goes to scene-cy + scene-width/2*height/width</span>
<span id="L240" class="LineNr">240 </span> <span class="muComment"># Therefore:</span>
<span id="L241" class="LineNr">241 </span> <span class="muComment"># y in the viewport goes to (scene-cy - scene-width/2*height/width) + y*scene-width/width</span>
<span id="L242" class="LineNr">242 </span> <span class="muComment"># scene-cy - scene-width/width * (height/2 + y)</span>
<span id="L243" class="LineNr">243 </span> <span class="muComment"># At most two numbers being multiplied before a divide, so no risk of overflow.</span>
<span id="L244" class="LineNr">244 </span> <span class="PreProc">var</span> result-f/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> y
<span id="L245" class="LineNr">245 </span> result-f <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L100'>multiply-fixed</a> result-f, scene-width-f
<span id="L246" class="LineNr">246 </span> <span class="PreProc">var</span> width-f/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy width
<span id="L247" class="LineNr">247 </span> width-f <span class="Special">&lt;-</span> shift-left <span class="Constant">8</span>/fixed-precision
<span id="L248" class="LineNr">248 </span> result-f <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L111'>divide-fixed</a> result-f, width-f
<span id="L249" class="LineNr">249 </span> result-f <span class="Special">&lt;-</span> add scene-cy-f
<span id="L250" class="LineNr">250 </span> <span class="PreProc">var</span> second-term-f/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L251" class="LineNr">251 </span> <span class="Delimiter">{</span>
<span id="L252" class="LineNr">252 </span> <span class="PreProc">var</span> _second-term-f/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy scene-width-f
<span id="L253" class="LineNr">253 </span> _second-term-f <span class="Special">&lt;-</span> shift-right <span class="Constant">1</span>
<span id="L254" class="LineNr">254 </span> <span class="PreProc">var</span> height-f/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy height
<span id="L255" class="LineNr">255 </span> height-f <span class="Special">&lt;-</span> shift-left <span class="Constant">8</span>/fixed-precision
<span id="L256" class="LineNr">256 </span> _second-term-f <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L100'>multiply-fixed</a> _second-term-f, height-f
<span id="L257" class="LineNr">257 </span> _second-term-f <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L111'>divide-fixed</a> _second-term-f, width-f
<span id="L258" class="LineNr">258 </span> second-term-f <span class="Special">&lt;-</span> copy _second-term-f
<span id="L259" class="LineNr">259 </span> <span class="Delimiter">}</span>
<span id="L260" class="LineNr">260 </span> result-f <span class="Special">&lt;-</span> subtract second-term-f
<span id="L261" class="LineNr">261 </span> <span class="PreProc">return</span> result-f
<span id="L262" class="LineNr">262 </span><span class="Delimiter">}</span>
</pre>
</body>
</html>

303
html/mandelbrot.mu.html generated
View File

@ -69,143 +69,172 @@ if ('onhashchange' in window) {
<span id="L11" class="LineNr"> 11 </span><span class="muComment"># $ qemu-system-i386 code.img</span>
<span id="L12" class="LineNr"> 12 </span>
<span id="L13" class="LineNr"> 13 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot.mu.html#L13'>main</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L14" class="LineNr"> 14 </span> <a href='mandelbrot.mu.html#L17'>mandelbrot</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L15" class="LineNr"> 15 </span><span class="Delimiter">}</span>
<span id="L16" class="LineNr"> 16 </span>
<span id="L17" class="LineNr"> 17 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot.mu.html#L17'>mandelbrot</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>) <span class="Delimiter">{</span>
<span id="L18" class="LineNr"> 18 </span> <span class="PreProc">var</span> a/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L19" class="LineNr"> 19 </span> <span class="PreProc">var</span> b/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L20" class="LineNr"> 20 </span> a, b <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L70'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L21" class="LineNr"> 21 </span> <span class="PreProc">var</span> width/<span class="Constant">esi</span>: int <span class="Special">&lt;-</span> copy a
<span id="L22" class="LineNr"> 22 </span> width <span class="Special">&lt;-</span> shift-left <span class="Constant">3</span>/log2-font-width
<span id="L23" class="LineNr"> 23 </span> <span class="PreProc">var</span> height/<span class="Constant">edi</span>: int <span class="Special">&lt;-</span> copy b
<span id="L24" class="LineNr"> 24 </span> height <span class="Special">&lt;-</span> shift-left <span class="Constant">4</span>/log2-font-height
<span id="L25" class="LineNr"> 25 </span> <span class="PreProc">var</span> y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L26" class="LineNr"> 26 </span> <span class="Delimiter">{</span>
<span id="L27" class="LineNr"> 27 </span> compare y, height
<span id="L28" class="LineNr"> 28 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L29" class="LineNr"> 29 </span> <span class="PreProc">var</span> imaginary/<span class="Constant">xmm1</span>: float <span class="Special">&lt;-</span> <a href='mandelbrot.mu.html#L135'>viewport-to-imaginary</a> y, width, height
<span id="L30" class="LineNr"> 30 </span> <span class="PreProc">var</span> x/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L31" class="LineNr"> 31 </span> <span class="Delimiter">{</span>
<span id="L32" class="LineNr"> 32 </span> compare x, width
<span id="L33" class="LineNr"> 33 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L34" class="LineNr"> 34 </span> <span class="PreProc">var</span> real/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> <a href='mandelbrot.mu.html#L119'>viewport-to-real</a> x, width
<span id="L35" class="LineNr"> 35 </span> <span class="PreProc">var</span> iterations/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot.mu.html#L54'>mandelbrot-iterations-for-point</a> real, imaginary, <span class="Constant">0x400</span>/max
<span id="L36" class="LineNr"> 36 </span> compare iterations, <span class="Constant">0x400</span>/max
<span id="L37" class="LineNr"> 37 </span> <span class="Delimiter">{</span>
<span id="L38" class="LineNr"> 38 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L39" class="LineNr"> 39 </span> <a href='500fake-screen.mu.html#L462'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y, <span class="Constant">0xf</span>/white
<span id="L40" class="LineNr"> 40 </span> <span class="Delimiter">}</span>
<span id="L41" class="LineNr"> 41 </span> compare iterations, <span class="Constant">0x400</span>/max
<span id="L42" class="LineNr"> 42 </span> <span class="Delimiter">{</span>
<span id="L43" class="LineNr"> 43 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L44" class="LineNr"> 44 </span> <a href='500fake-screen.mu.html#L462'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y, <span class="Constant">0</span>/black
<span id="L45" class="LineNr"> 45 </span> <span class="Delimiter">}</span>
<span id="L46" class="LineNr"> 46 </span> x <span class="Special">&lt;-</span> increment
<span id="L47" class="LineNr"> 47 </span> <span class="PreProc">loop</span>
<span id="L48" class="LineNr"> 48 </span> <span class="Delimiter">}</span>
<span id="L49" class="LineNr"> 49 </span> y <span class="Special">&lt;-</span> increment
<span id="L50" class="LineNr"> 50 </span> <span class="PreProc">loop</span>
<span id="L51" class="LineNr"> 51 </span> <span class="Delimiter">}</span>
<span id="L52" class="LineNr"> 52 </span><span class="Delimiter">}</span>
<span id="L53" class="LineNr"> 53 </span>
<span id="L54" class="LineNr"> 54 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot.mu.html#L54'>mandelbrot-iterations-for-point</a></span> real: float, imaginary: float, max: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
<span id="L55" class="LineNr"> 55 </span> <span class="PreProc">var</span> zero: float
<span id="L56" class="LineNr"> 56 </span> <span class="PreProc">var</span> x/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> copy zero
<span id="L57" class="LineNr"> 57 </span> <span class="PreProc">var</span> y/<span class="Constant">xmm1</span>: float <span class="Special">&lt;-</span> copy zero
<span id="L58" class="LineNr"> 58 </span> <span class="PreProc">var</span> iterations/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L59" class="LineNr"> 59 </span> <span class="Delimiter">{</span>
<span id="L60" class="LineNr"> 60 </span> <span class="PreProc">var</span> done?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='mandelbrot.mu.html#L75'>mandelbrot-done?</a> x, y
<span id="L61" class="LineNr"> 61 </span> compare done?, <span class="Constant">0</span>/false
<span id="L62" class="LineNr"> 62 </span> <span class="PreProc">break-if-!=</span>
<span id="L63" class="LineNr"> 63 </span> compare iterations, max
<span id="L64" class="LineNr"> 64 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L65" class="LineNr"> 65 </span> <span class="PreProc">var</span> newx/<span class="Constant">xmm2</span>: float <span class="Special">&lt;-</span> <a href='mandelbrot.mu.html#L93'>mandelbrot-x</a> x, y, real
<span id="L66" class="LineNr"> 66 </span> <span class="PreProc">var</span> newy/<span class="Constant">xmm3</span>: float <span class="Special">&lt;-</span> <a href='mandelbrot.mu.html#L105'>mandelbrot-y</a> x, y, imaginary
<span id="L67" class="LineNr"> 67 </span> x <span class="Special">&lt;-</span> copy newx
<span id="L68" class="LineNr"> 68 </span> y <span class="Special">&lt;-</span> copy newy
<span id="L69" class="LineNr"> 69 </span> iterations <span class="Special">&lt;-</span> increment
<span id="L70" class="LineNr"> 70 </span> <span class="PreProc">loop</span>
<span id="L71" class="LineNr"> 71 </span> <span class="Delimiter">}</span>
<span id="L72" class="LineNr"> 72 </span> <span class="PreProc">return</span> iterations
<span id="L73" class="LineNr"> 73 </span><span class="Delimiter">}</span>
<span id="L74" class="LineNr"> 74 </span>
<span id="L75" class="LineNr"> 75 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot.mu.html#L75'>mandelbrot-done?</a></span> x: float, y: float<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean <span class="Delimiter">{</span>
<span id="L76" class="LineNr"> 76 </span> <span class="muComment"># x*x + y*y &gt; 4</span>
<span id="L77" class="LineNr"> 77 </span> <span class="PreProc">var</span> x2/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> copy x
<span id="L78" class="LineNr"> 78 </span> x2 <span class="Special">&lt;-</span> multiply x
<span id="L79" class="LineNr"> 79 </span> <span class="PreProc">var</span> y2/<span class="Constant">xmm1</span>: float <span class="Special">&lt;-</span> copy y
<span id="L80" class="LineNr"> 80 </span> y2 <span class="Special">&lt;-</span> multiply y
<span id="L81" class="LineNr"> 81 </span> <span class="PreProc">var</span> sum/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> copy x2
<span id="L82" class="LineNr"> 82 </span> sum <span class="Special">&lt;-</span> add y2
<span id="L83" class="LineNr"> 83 </span> <span class="PreProc">var</span> four/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">4</span>
<span id="L84" class="LineNr"> 84 </span> <span class="PreProc">var</span> four-f/<span class="Constant">xmm1</span>: float <span class="Special">&lt;-</span> convert four
<span id="L85" class="LineNr"> 85 </span> compare sum, four-f
<span id="L86" class="LineNr"> 86 </span> <span class="Delimiter">{</span>
<span id="L87" class="LineNr"> 87 </span> <span class="PreProc">break-if-float&gt;</span>
<span id="L88" class="LineNr"> 88 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L89" class="LineNr"> 89 </span> <span class="Delimiter">}</span>
<span id="L90" class="LineNr"> 90 </span> <span class="PreProc">return</span> <span class="Constant">1</span>/true
<span id="L91" class="LineNr"> 91 </span><span class="Delimiter">}</span>
<span id="L92" class="LineNr"> 92 </span>
<span id="L93" class="LineNr"> 93 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot.mu.html#L93'>mandelbrot-x</a></span> x: float, y: float, real: float<span class="PreProc"> -&gt; </span>_/<span class="Constant">xmm2</span>: float <span class="Delimiter">{</span>
<span id="L94" class="LineNr"> 94 </span> <span class="muComment"># x*x - y*y + real</span>
<span id="L95" class="LineNr"> 95 </span> <span class="PreProc">var</span> x2/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> copy x
<span id="L96" class="LineNr"> 96 </span> x2 <span class="Special">&lt;-</span> multiply x
<span id="L97" class="LineNr"> 97 </span> <span class="PreProc">var</span> y2/<span class="Constant">xmm1</span>: float <span class="Special">&lt;-</span> copy y
<span id="L98" class="LineNr"> 98 </span> y2 <span class="Special">&lt;-</span> multiply y
<span id="L99" class="LineNr"> 99 </span> <span class="PreProc">var</span> result/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> copy x2
<span id="L100" class="LineNr">100 </span> result <span class="Special">&lt;-</span> subtract y2
<span id="L101" class="LineNr">101 </span> result <span class="Special">&lt;-</span> add real
<span id="L102" class="LineNr">102 </span> <span class="PreProc">return</span> result
<span id="L103" class="LineNr">103 </span><span class="Delimiter">}</span>
<span id="L104" class="LineNr">104 </span>
<span id="L105" class="LineNr">105 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot.mu.html#L105'>mandelbrot-y</a></span> x: float, y: float, imaginary: float<span class="PreProc"> -&gt; </span>_/<span class="Constant">xmm3</span>: float <span class="Delimiter">{</span>
<span id="L106" class="LineNr">106 </span> <span class="muComment"># 2*x*y + imaginary</span>
<span id="L107" class="LineNr">107 </span> <span class="PreProc">var</span> two/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">2</span>
<span id="L108" class="LineNr">108 </span> <span class="PreProc">var</span> result/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> convert two
<span id="L109" class="LineNr">109 </span> result <span class="Special">&lt;-</span> multiply x
<span id="L110" class="LineNr">110 </span> result <span class="Special">&lt;-</span> multiply y
<span id="L111" class="LineNr">111 </span> result <span class="Special">&lt;-</span> add imaginary
<span id="L112" class="LineNr">112 </span> <span class="PreProc">return</span> result
<span id="L113" class="LineNr">113 </span><span class="Delimiter">}</span>
<span id="L114" class="LineNr">114 </span>
<span id="L115" class="LineNr">115 </span><span class="muComment"># Scale (x, y) pixel coordinates to a complex plane where the viewport width</span>
<span id="L116" class="LineNr">116 </span><span class="muComment"># ranges from -2 to +2. Viewport height just follows the viewport's aspect</span>
<span id="L117" class="LineNr">117 </span><span class="muComment"># ratio.</span>
<span id="L118" class="LineNr">118 </span>
<span id="L119" class="LineNr">119 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot.mu.html#L119'>viewport-to-real</a></span> x: int, width: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">xmm0</span>: float <span class="Delimiter">{</span>
<span id="L120" class="LineNr">120 </span> <span class="muComment"># (x - width/2)*4/width</span>
<span id="L121" class="LineNr">121 </span> <span class="PreProc">var</span> result/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> convert x
<span id="L122" class="LineNr">122 </span> <span class="PreProc">var</span> width-f/<span class="Constant">xmm1</span>: float <span class="Special">&lt;-</span> convert width
<span id="L123" class="LineNr">123 </span> <span class="PreProc">var</span> two/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">2</span>
<span id="L124" class="LineNr">124 </span> <span class="PreProc">var</span> two-f/<span class="Constant">xmm2</span>: float <span class="Special">&lt;-</span> convert two
<span id="L125" class="LineNr">125 </span> <span class="PreProc">var</span> half-width-f/<span class="Constant">xmm2</span>: float <span class="Special">&lt;-</span> reciprocal two-f
<span id="L126" class="LineNr">126 </span> half-width-f <span class="Special">&lt;-</span> multiply width-f
<span id="L127" class="LineNr">127 </span> result <span class="Special">&lt;-</span> subtract half-width-f
<span id="L128" class="LineNr">128 </span> <span class="PreProc">var</span> four/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">4</span>
<span id="L129" class="LineNr">129 </span> <span class="PreProc">var</span> four-f/<span class="Constant">xmm2</span>: float <span class="Special">&lt;-</span> convert four
<span id="L130" class="LineNr">130 </span> result <span class="Special">&lt;-</span> multiply four-f
<span id="L131" class="LineNr">131 </span> result <span class="Special">&lt;-</span> divide width-f
<span id="L132" class="LineNr">132 </span> <span class="PreProc">return</span> result
<span id="L133" class="LineNr">133 </span><span class="Delimiter">}</span>
<span id="L134" class="LineNr">134 </span>
<span id="L135" class="LineNr">135 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot.mu.html#L135'>viewport-to-imaginary</a></span> y: int, width: int, height: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">xmm1</span>: float <span class="Delimiter">{</span>
<span id="L136" class="LineNr">136 </span> <span class="muComment"># (y - height/2)*4/width</span>
<span id="L137" class="LineNr">137 </span> <span class="PreProc">var</span> result/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> convert y
<span id="L138" class="LineNr">138 </span> <span class="PreProc">var</span> height-f/<span class="Constant">xmm1</span>: float <span class="Special">&lt;-</span> convert height
<span id="L139" class="LineNr">139 </span> <span class="PreProc">var</span> half-height-f/<span class="Constant">xmm1</span>: float <span class="Special">&lt;-</span> copy height-f
<span id="L140" class="LineNr">140 </span> <span class="PreProc">var</span> two/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">2</span>
<span id="L141" class="LineNr">141 </span> <span class="PreProc">var</span> two-f/<span class="Constant">xmm2</span>: float <span class="Special">&lt;-</span> convert two
<span id="L142" class="LineNr">142 </span> half-height-f <span class="Special">&lt;-</span> divide two-f
<span id="L143" class="LineNr">143 </span> result <span class="Special">&lt;-</span> subtract half-height-f
<span id="L144" class="LineNr">144 </span> <span class="PreProc">var</span> four/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">4</span>
<span id="L145" class="LineNr">145 </span> <span class="PreProc">var</span> four-f/<span class="Constant">xmm1</span>: float <span class="Special">&lt;-</span> convert four
<span id="L146" class="LineNr">146 </span> result <span class="Special">&lt;-</span> multiply four-f
<span id="L147" class="LineNr">147 </span> <span class="PreProc">var</span> width-f/<span class="Constant">xmm1</span>: float <span class="Special">&lt;-</span> convert width
<span id="L148" class="LineNr">148 </span> result <span class="Special">&lt;-</span> divide width-f
<span id="L149" class="LineNr">149 </span> <span class="PreProc">return</span> result
<span id="L150" class="LineNr">150 </span><span class="Delimiter">}</span>
<span id="L14" class="LineNr"> 14 </span> <span class="muComment"># Initially the viewport is centered at 0, 0 in the scene.</span>
<span id="L15" class="LineNr"> 15 </span> <span class="PreProc">var</span> zero: float
<span id="L16" class="LineNr"> 16 </span> <span class="PreProc">var</span> scene-cx/<span class="Constant">xmm1</span>: float <span class="Special">&lt;-</span> copy zero
<span id="L17" class="LineNr"> 17 </span> <span class="PreProc">var</span> scene-cy/<span class="Constant">xmm2</span>: float <span class="Special">&lt;-</span> copy zero
<span id="L18" class="LineNr"> 18 </span> <span class="muComment"># Initially the viewport shows a section of the scene 4 units wide.</span>
<span id="L19" class="LineNr"> 19 </span> <span class="muComment"># scene-width-scale = 0.5</span>
<span id="L20" class="LineNr"> 20 </span> <span class="PreProc">var</span> scene-width-scale: float
<span id="L21" class="LineNr"> 21 </span> <span class="PreProc">var</span> dest/<span class="Constant">eax</span>: (addr float) <span class="Special">&lt;-</span> address scene-width-scale
<span id="L22" class="LineNr"> 22 </span> <a href='408float.mu.html#L3'>fill-in-rational</a> dest, <span class="Constant">1</span>, <span class="Constant">2</span>
<span id="L23" class="LineNr"> 23 </span> <span class="muComment"># scene-width = 4</span>
<span id="L24" class="LineNr"> 24 </span> <span class="PreProc">var</span> four: float
<span id="L25" class="LineNr"> 25 </span> <span class="PreProc">var</span> dest/<span class="Constant">eax</span>: (addr float) <span class="Special">&lt;-</span> address four
<span id="L26" class="LineNr"> 26 </span> <a href='408float.mu.html#L3'>fill-in-rational</a> dest, <span class="Constant">4</span>, <span class="Constant">1</span>
<span id="L27" class="LineNr"> 27 </span> <span class="PreProc">var</span> scene-width/<span class="Constant">xmm3</span>: float <span class="Special">&lt;-</span> copy four
<span id="L28" class="LineNr"> 28 </span> <span class="Delimiter">{</span>
<span id="L29" class="LineNr"> 29 </span> <a href='mandelbrot.mu.html#L41'>mandelbrot</a> <a href='500fake-screen.mu.html#L14'>screen</a> scene-cx, scene-cy, scene-width
<span id="L30" class="LineNr"> 30 </span> <span class="muComment"># move the center some % of the current screen-width</span>
<span id="L31" class="LineNr"> 31 </span> <span class="PreProc">var</span> adj/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> <a href='408float.mu.html#L18'>rational</a> <span class="Constant">2</span>, <span class="Constant">0x1c</span>/<span class="Constant">28</span>
<span id="L32" class="LineNr"> 32 </span> adj <span class="Special">&lt;-</span> multiply scene-width
<span id="L33" class="LineNr"> 33 </span> scene-cx <span class="Special">&lt;-</span> subtract adj
<span id="L34" class="LineNr"> 34 </span> scene-cy <span class="Special">&lt;-</span> add adj
<span id="L35" class="LineNr"> 35 </span> <span class="muComment"># slowly shrink the scene width to zoom in</span>
<span id="L36" class="LineNr"> 36 </span> scene-width <span class="Special">&lt;-</span> multiply scene-width-scale
<span id="L37" class="LineNr"> 37 </span> <span class="PreProc">loop</span>
<span id="L38" class="LineNr"> 38 </span> <span class="Delimiter">}</span>
<span id="L39" class="LineNr"> 39 </span><span class="Delimiter">}</span>
<span id="L40" class="LineNr"> 40 </span>
<span id="L41" class="LineNr"> 41 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot.mu.html#L41'>mandelbrot</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), scene-cx: float, scene-cy: float, scene-width: float <span class="Delimiter">{</span>
<span id="L42" class="LineNr"> 42 </span> <span class="PreProc">var</span> a/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L43" class="LineNr"> 43 </span> <span class="PreProc">var</span> b/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L44" class="LineNr"> 44 </span> a, b <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L70'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L45" class="LineNr"> 45 </span> <span class="PreProc">var</span> width/<span class="Constant">esi</span>: int <span class="Special">&lt;-</span> copy a
<span id="L46" class="LineNr"> 46 </span> width <span class="Special">&lt;-</span> shift-left <span class="Constant">3</span>/log2-font-width
<span id="L47" class="LineNr"> 47 </span> <span class="PreProc">var</span> height/<span class="Constant">edi</span>: int <span class="Special">&lt;-</span> copy b
<span id="L48" class="LineNr"> 48 </span> height <span class="Special">&lt;-</span> shift-left <span class="Constant">4</span>/log2-font-height
<span id="L49" class="LineNr"> 49 </span> <span class="PreProc">var</span> y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L50" class="LineNr"> 50 </span> <span class="Delimiter">{</span>
<span id="L51" class="LineNr"> 51 </span> compare y, height
<span id="L52" class="LineNr"> 52 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L53" class="LineNr"> 53 </span> <span class="PreProc">var</span> imaginary/<span class="Constant">xmm1</span>: float <span class="Special">&lt;-</span> <a href='mandelbrot.mu.html#L157'>viewport-to-imaginary</a> y, width, height, scene-cy, scene-width
<span id="L54" class="LineNr"> 54 </span> <span class="PreProc">var</span> x/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L55" class="LineNr"> 55 </span> <span class="Delimiter">{</span>
<span id="L56" class="LineNr"> 56 </span> compare x, width
<span id="L57" class="LineNr"> 57 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L58" class="LineNr"> 58 </span> <span class="PreProc">var</span> real/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> <a href='mandelbrot.mu.html#L138'>viewport-to-real</a> x, width, scene-cx, scene-width
<span id="L59" class="LineNr"> 59 </span> <span class="PreProc">var</span> iterations/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='mandelbrot.mu.html#L73'>mandelbrot-iterations-for-point</a> real, imaginary, <span class="Constant">0x400</span>/max
<span id="L60" class="LineNr"> 60 </span> iterations <span class="Special">&lt;-</span> shift-right <span class="Constant">3</span>
<span id="L61" class="LineNr"> 61 </span> <span class="PreProc">var</span> color/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L62" class="LineNr"> 62 </span> iterations, color <span class="Special">&lt;-</span> <a href='314divide.subx.html#L3'>integer-divide</a> iterations, <span class="Constant">0x18</span>/<span class="Constant">24</span>/size-of-cycle-0
<span id="L63" class="LineNr"> 63 </span> color <span class="Special">&lt;-</span> add <span class="Constant">0x20</span>/cycle-0
<span id="L64" class="LineNr"> 64 </span> <a href='500fake-screen.mu.html#L462'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y, color
<span id="L65" class="LineNr"> 65 </span> x <span class="Special">&lt;-</span> increment
<span id="L66" class="LineNr"> 66 </span> <span class="PreProc">loop</span>
<span id="L67" class="LineNr"> 67 </span> <span class="Delimiter">}</span>
<span id="L68" class="LineNr"> 68 </span> y <span class="Special">&lt;-</span> increment
<span id="L69" class="LineNr"> 69 </span> <span class="PreProc">loop</span>
<span id="L70" class="LineNr"> 70 </span> <span class="Delimiter">}</span>
<span id="L71" class="LineNr"> 71 </span><span class="Delimiter">}</span>
<span id="L72" class="LineNr"> 72 </span>
<span id="L73" class="LineNr"> 73 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot.mu.html#L73'>mandelbrot-iterations-for-point</a></span> real: float, imaginary: float, max: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
<span id="L74" class="LineNr"> 74 </span> <span class="PreProc">var</span> zero: float
<span id="L75" class="LineNr"> 75 </span> <span class="PreProc">var</span> x/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> copy zero
<span id="L76" class="LineNr"> 76 </span> <span class="PreProc">var</span> y/<span class="Constant">xmm1</span>: float <span class="Special">&lt;-</span> copy zero
<span id="L77" class="LineNr"> 77 </span> <span class="PreProc">var</span> iterations/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L78" class="LineNr"> 78 </span> <span class="Delimiter">{</span>
<span id="L79" class="LineNr"> 79 </span> <span class="PreProc">var</span> done?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='mandelbrot.mu.html#L94'>mandelbrot-done?</a> x, y
<span id="L80" class="LineNr"> 80 </span> compare done?, <span class="Constant">0</span>/false
<span id="L81" class="LineNr"> 81 </span> <span class="PreProc">break-if-!=</span>
<span id="L82" class="LineNr"> 82 </span> compare iterations, max
<span id="L83" class="LineNr"> 83 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L84" class="LineNr"> 84 </span> <span class="PreProc">var</span> newx/<span class="Constant">xmm2</span>: float <span class="Special">&lt;-</span> <a href='mandelbrot.mu.html#L112'>mandelbrot-x</a> x, y, real
<span id="L85" class="LineNr"> 85 </span> <span class="PreProc">var</span> newy/<span class="Constant">xmm3</span>: float <span class="Special">&lt;-</span> <a href='mandelbrot.mu.html#L124'>mandelbrot-y</a> x, y, imaginary
<span id="L86" class="LineNr"> 86 </span> x <span class="Special">&lt;-</span> copy newx
<span id="L87" class="LineNr"> 87 </span> y <span class="Special">&lt;-</span> copy newy
<span id="L88" class="LineNr"> 88 </span> iterations <span class="Special">&lt;-</span> increment
<span id="L89" class="LineNr"> 89 </span> <span class="PreProc">loop</span>
<span id="L90" class="LineNr"> 90 </span> <span class="Delimiter">}</span>
<span id="L91" class="LineNr"> 91 </span> <span class="PreProc">return</span> iterations
<span id="L92" class="LineNr"> 92 </span><span class="Delimiter">}</span>
<span id="L93" class="LineNr"> 93 </span>
<span id="L94" class="LineNr"> 94 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot.mu.html#L94'>mandelbrot-done?</a></span> x: float, y: float<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean <span class="Delimiter">{</span>
<span id="L95" class="LineNr"> 95 </span> <span class="muComment"># x*x + y*y &gt; 4</span>
<span id="L96" class="LineNr"> 96 </span> <span class="PreProc">var</span> x2/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> copy x
<span id="L97" class="LineNr"> 97 </span> x2 <span class="Special">&lt;-</span> multiply x
<span id="L98" class="LineNr"> 98 </span> <span class="PreProc">var</span> y2/<span class="Constant">xmm1</span>: float <span class="Special">&lt;-</span> copy y
<span id="L99" class="LineNr"> 99 </span> y2 <span class="Special">&lt;-</span> multiply y
<span id="L100" class="LineNr">100 </span> <span class="PreProc">var</span> sum/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> copy x2
<span id="L101" class="LineNr">101 </span> sum <span class="Special">&lt;-</span> add y2
<span id="L102" class="LineNr">102 </span> <span class="PreProc">var</span> four/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">4</span>
<span id="L103" class="LineNr">103 </span> <span class="PreProc">var</span> four-f/<span class="Constant">xmm1</span>: float <span class="Special">&lt;-</span> convert four
<span id="L104" class="LineNr">104 </span> compare sum, four-f
<span id="L105" class="LineNr">105 </span> <span class="Delimiter">{</span>
<span id="L106" class="LineNr">106 </span> <span class="PreProc">break-if-float&gt;</span>
<span id="L107" class="LineNr">107 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L108" class="LineNr">108 </span> <span class="Delimiter">}</span>
<span id="L109" class="LineNr">109 </span> <span class="PreProc">return</span> <span class="Constant">1</span>/true
<span id="L110" class="LineNr">110 </span><span class="Delimiter">}</span>
<span id="L111" class="LineNr">111 </span>
<span id="L112" class="LineNr">112 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot.mu.html#L112'>mandelbrot-x</a></span> x: float, y: float, real: float<span class="PreProc"> -&gt; </span>_/<span class="Constant">xmm2</span>: float <span class="Delimiter">{</span>
<span id="L113" class="LineNr">113 </span> <span class="muComment"># x*x - y*y + real</span>
<span id="L114" class="LineNr">114 </span> <span class="PreProc">var</span> x2/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> copy x
<span id="L115" class="LineNr">115 </span> x2 <span class="Special">&lt;-</span> multiply x
<span id="L116" class="LineNr">116 </span> <span class="PreProc">var</span> y2/<span class="Constant">xmm1</span>: float <span class="Special">&lt;-</span> copy y
<span id="L117" class="LineNr">117 </span> y2 <span class="Special">&lt;-</span> multiply y
<span id="L118" class="LineNr">118 </span> <span class="PreProc">var</span> result/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> copy x2
<span id="L119" class="LineNr">119 </span> result <span class="Special">&lt;-</span> subtract y2
<span id="L120" class="LineNr">120 </span> result <span class="Special">&lt;-</span> add real
<span id="L121" class="LineNr">121 </span> <span class="PreProc">return</span> result
<span id="L122" class="LineNr">122 </span><span class="Delimiter">}</span>
<span id="L123" class="LineNr">123 </span>
<span id="L124" class="LineNr">124 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot.mu.html#L124'>mandelbrot-y</a></span> x: float, y: float, imaginary: float<span class="PreProc"> -&gt; </span>_/<span class="Constant">xmm3</span>: float <span class="Delimiter">{</span>
<span id="L125" class="LineNr">125 </span> <span class="muComment"># 2*x*y + imaginary</span>
<span id="L126" class="LineNr">126 </span> <span class="PreProc">var</span> two/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">2</span>
<span id="L127" class="LineNr">127 </span> <span class="PreProc">var</span> result/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> convert two
<span id="L128" class="LineNr">128 </span> result <span class="Special">&lt;-</span> multiply x
<span id="L129" class="LineNr">129 </span> result <span class="Special">&lt;-</span> multiply y
<span id="L130" class="LineNr">130 </span> result <span class="Special">&lt;-</span> add imaginary
<span id="L131" class="LineNr">131 </span> <span class="PreProc">return</span> result
<span id="L132" class="LineNr">132 </span><span class="Delimiter">}</span>
<span id="L133" class="LineNr">133 </span>
<span id="L134" class="LineNr">134 </span><span class="muComment"># Scale (x, y) pixel coordinates to a complex plane where the viewport width</span>
<span id="L135" class="LineNr">135 </span><span class="muComment"># ranges from -2 to +2. Viewport height just follows the viewport's aspect</span>
<span id="L136" class="LineNr">136 </span><span class="muComment"># ratio.</span>
<span id="L137" class="LineNr">137 </span>
<span id="L138" class="LineNr">138 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot.mu.html#L138'>viewport-to-real</a></span> x: int, width: int, scene-cx: float, scene-width: float<span class="PreProc"> -&gt; </span>_/<span class="Constant">xmm0</span>: float <span class="Delimiter">{</span>
<span id="L139" class="LineNr">139 </span> <span class="muComment"># 0 in the viewport goes to scene-cx - scene-width/2 </span>
<span id="L140" class="LineNr">140 </span> <span class="muComment"># width in the viewport goes to scene-cx + scene-width/2</span>
<span id="L141" class="LineNr">141 </span> <span class="muComment"># Therefore:</span>
<span id="L142" class="LineNr">142 </span> <span class="muComment"># x in the viewport goes to (scene-cx - scene-width/2) + x*scene-width/width</span>
<span id="L143" class="LineNr">143 </span> <span class="muComment"># At most two numbers being multiplied before a divide, so no risk of overflow.</span>
<span id="L144" class="LineNr">144 </span> <span class="PreProc">var</span> result/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> convert x
<span id="L145" class="LineNr">145 </span> result <span class="Special">&lt;-</span> multiply scene-width
<span id="L146" class="LineNr">146 </span> <span class="PreProc">var</span> width-f/<span class="Constant">xmm1</span>: float <span class="Special">&lt;-</span> convert width
<span id="L147" class="LineNr">147 </span> result <span class="Special">&lt;-</span> divide width-f
<span id="L148" class="LineNr">148 </span> result <span class="Special">&lt;-</span> add scene-cx
<span id="L149" class="LineNr">149 </span> <span class="PreProc">var</span> two/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">2</span>
<span id="L150" class="LineNr">150 </span> <span class="PreProc">var</span> two-f/<span class="Constant">xmm2</span>: float <span class="Special">&lt;-</span> convert two
<span id="L151" class="LineNr">151 </span> <span class="PreProc">var</span> half-scene-width/<span class="Constant">xmm1</span>: float <span class="Special">&lt;-</span> copy scene-width
<span id="L152" class="LineNr">152 </span> half-scene-width <span class="Special">&lt;-</span> divide two-f
<span id="L153" class="LineNr">153 </span> result <span class="Special">&lt;-</span> subtract half-scene-width
<span id="L154" class="LineNr">154 </span> <span class="PreProc">return</span> result
<span id="L155" class="LineNr">155 </span><span class="Delimiter">}</span>
<span id="L156" class="LineNr">156 </span>
<span id="L157" class="LineNr">157 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot.mu.html#L157'>viewport-to-imaginary</a></span> y: int, width: int, height: int, scene-cy: float, scene-width: float<span class="PreProc"> -&gt; </span>_/<span class="Constant">xmm1</span>: float <span class="Delimiter">{</span>
<span id="L158" class="LineNr">158 </span> <span class="muComment"># 0 in the viewport goes to scene-cy - scene-width/2*height/width</span>
<span id="L159" class="LineNr">159 </span> <span class="muComment"># height in the viewport goes to scene-cy + scene-width/2*height/width</span>
<span id="L160" class="LineNr">160 </span> <span class="muComment"># Therefore:</span>
<span id="L161" class="LineNr">161 </span> <span class="muComment"># y in the viewport goes to (scene-cy - scene-width/2*height/width) + y*scene-width/width</span>
<span id="L162" class="LineNr">162 </span> <span class="muComment"># scene-cy - scene-width/width * (height/2 + y)</span>
<span id="L163" class="LineNr">163 </span> <span class="muComment"># At most two numbers being multiplied before a divide, so no risk of overflow.</span>
<span id="L164" class="LineNr">164 </span> <span class="PreProc">var</span> result/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> convert y
<span id="L165" class="LineNr">165 </span> result <span class="Special">&lt;-</span> multiply scene-width
<span id="L166" class="LineNr">166 </span> <span class="PreProc">var</span> width-f/<span class="Constant">xmm1</span>: float <span class="Special">&lt;-</span> convert width
<span id="L167" class="LineNr">167 </span> result <span class="Special">&lt;-</span> divide width-f
<span id="L168" class="LineNr">168 </span> result <span class="Special">&lt;-</span> add scene-cy
<span id="L169" class="LineNr">169 </span> <span class="PreProc">var</span> two/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">2</span>
<span id="L170" class="LineNr">170 </span> <span class="PreProc">var</span> two-f/<span class="Constant">xmm2</span>: float <span class="Special">&lt;-</span> convert two
<span id="L171" class="LineNr">171 </span> <span class="PreProc">var</span> second-term/<span class="Constant">xmm1</span>: float <span class="Special">&lt;-</span> copy scene-width
<span id="L172" class="LineNr">172 </span> second-term <span class="Special">&lt;-</span> divide two-f
<span id="L173" class="LineNr">173 </span> <span class="PreProc">var</span> height-f/<span class="Constant">xmm2</span>: float <span class="Special">&lt;-</span> convert height
<span id="L174" class="LineNr">174 </span> second-term <span class="Special">&lt;-</span> multiply height-f
<span id="L175" class="LineNr">175 </span> <span class="PreProc">var</span> width-f/<span class="Constant">xmm2</span>: float <span class="Special">&lt;-</span> convert width
<span id="L176" class="LineNr">176 </span> second-term <span class="Special">&lt;-</span> divide width-f
<span id="L177" class="LineNr">177 </span> result <span class="Special">&lt;-</span> subtract second-term
<span id="L178" class="LineNr">178 </span> <span class="PreProc">return</span> result
<span id="L179" class="LineNr">179 </span><span class="Delimiter">}</span>
</pre>
</body>
</html>

41
html/mu-init.subx.html generated
View File

@ -68,30 +68,25 @@ if ('onhashchange' in window) {
<span id="L12" class="LineNr">12 </span><span class="SpecialChar">Entry</span>:
<span id="L13" class="LineNr">13 </span> <span class="subxComment"># initialize stack</span>
<span id="L14" class="LineNr">14 </span> bd/copy-to-ebp 0/imm32
<span id="L15" class="LineNr">15 </span> <span class="subxComment"># Clear memory location 0 to ensure that uninitialized arrays run afoul of</span>
<span id="L16" class="LineNr">16 </span> <span class="subxComment"># the bounds checker.</span>
<span id="L17" class="LineNr">17 </span> <span class="subxComment"># TODO: This is utterly bonkers, and does not actually protect us against</span>
<span id="L18" class="LineNr">18 </span> <span class="subxComment"># all null pointer reads/writes. Create a real page table sometime.</span>
<span id="L19" class="LineNr">19 </span> b8/copy-to-eax 0/imm32
<span id="L20" class="LineNr">20 </span> c7 0/subop/copy *eax 0/imm32
<span id="L21" class="LineNr">21 </span><span class="CommentedCode">#? (main 0 0 Primary-bus-secondary-drive)</span>
<span id="L22" class="LineNr">22 </span> <span class="subxComment"># always first run tests</span>
<span id="L23" class="LineNr">23 </span> (run-tests)
<span id="L24" class="LineNr">24 </span> (<a href='104test.subx.html#L17'>num-test-failures</a>) <span class="subxComment"># =&gt; eax</span>
<span id="L25" class="LineNr">25 </span> <span class="subxComment"># call main if tests all passed</span>
<span id="L26" class="LineNr">26 </span> {
<span id="L27" class="LineNr">27 </span> 3d/compare-eax-and 0/imm32
<span id="L28" class="LineNr">28 </span> 75/jump-if-!= <span class="Constant">break</span>/disp8
<span id="L29" class="LineNr">29 </span> (<a href='500fake-screen.mu.html#L364'>clear-real-screen</a>)
<span id="L30" class="LineNr">30 </span> c7 0/subop/copy *<span class="SpecialChar"><a href='103grapheme.subx.html#L170'>Real-screen-cursor-x</a></span> 0/imm32
<span id="L31" class="LineNr">31 </span> c7 0/subop/copy *<span class="SpecialChar"><a href='103grapheme.subx.html#L172'>Real-screen-cursor-y</a></span> 0/imm32
<span id="L32" class="LineNr">32 </span> (main 0 0 <span class="SpecialChar"><a href='boot.subx.html#L899'>Primary-bus-secondary-drive</a></span>)
<span id="L15" class="LineNr">15 </span> <span class="subxComment">#</span>
<span id="L16" class="LineNr">16 </span><span class="CommentedCode">#? (main 0 0 Primary-bus-secondary-drive)</span>
<span id="L17" class="LineNr">17 </span> <span class="subxComment"># always first run tests</span>
<span id="L18" class="LineNr">18 </span> (run-tests)
<span id="L19" class="LineNr">19 </span> (<a href='104test.subx.html#L17'>num-test-failures</a>) <span class="subxComment"># =&gt; eax</span>
<span id="L20" class="LineNr">20 </span> <span class="subxComment"># call main if tests all passed</span>
<span id="L21" class="LineNr">21 </span> {
<span id="L22" class="LineNr">22 </span> 3d/compare-eax-and 0/imm32
<span id="L23" class="LineNr">23 </span> 75/jump-if-!= <span class="Constant">break</span>/disp8
<span id="L24" class="LineNr">24 </span> (<a href='500fake-screen.mu.html#L364'>clear-real-screen</a>)
<span id="L25" class="LineNr">25 </span> c7 0/subop/copy *<span class="SpecialChar"><a href='103grapheme.subx.html#L170'>Real-screen-cursor-x</a></span> 0/imm32
<span id="L26" class="LineNr">26 </span> c7 0/subop/copy *<span class="SpecialChar"><a href='103grapheme.subx.html#L172'>Real-screen-cursor-y</a></span> 0/imm32
<span id="L27" class="LineNr">27 </span> (main 0 0 <span class="SpecialChar"><a href='boot.subx.html#L920'>Primary-bus-secondary-drive</a></span>)
<span id="L28" class="LineNr">28 </span> }
<span id="L29" class="LineNr">29 </span>
<span id="L30" class="LineNr">30 </span> <span class="subxComment"># hang indefinitely</span>
<span id="L31" class="LineNr">31 </span> {
<span id="L32" class="LineNr">32 </span> eb/jump <span class="Constant">loop</span>/disp8
<span id="L33" class="LineNr">33 </span> }
<span id="L34" class="LineNr">34 </span>
<span id="L35" class="LineNr">35 </span> <span class="subxComment"># hang indefinitely</span>
<span id="L36" class="LineNr">36 </span> {
<span id="L37" class="LineNr">37 </span> eb/jump <span class="Constant">loop</span>/disp8
<span id="L38" class="LineNr">38 </span> }
</pre>
</body>
</html>

View File

@ -100,6 +100,10 @@ var/reg <span class="Special">&lt;-</span> or n =&gt; <span cl
or-with var, n =&gt; <span class="Constant">&quot;81 1/subop/or *(ebp+&quot;</span> var.stack-offset <span class="Constant">&quot;) &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
or-with *var/reg, n =&gt; <span class="Constant">&quot;81 1/subop/or *&quot;</span> reg <span class="Constant">&quot; &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
var/reg <span class="Special">&lt;-</span> not =&gt; <span class="Constant">&quot;f7 2/subop/not %&quot;</span> reg
not var =&gt; <span class="Constant">&quot;f7 2/subop/not *(ebp+&quot;</span> var.stack-offset <span class="Constant">&quot;)&quot;</span>
not *var/reg =&gt; <span class="Constant">&quot;f7 2/subop/not *&quot;</span> reg
var/reg <span class="Special">&lt;-</span> xor var2/reg2 =&gt; <span class="Constant">&quot;31/xor-with %&quot;</span> reg <span class="Constant">&quot; &quot;</span> reg2 <span class="Constant">&quot;/r32&quot;</span>
var/reg <span class="Special">&lt;-</span> xor var2 =&gt; <span class="Constant">&quot;33/xor *(ebp+&quot;</span> var2.stack-offset <span class="Constant">&quot;) &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
var/reg <span class="Special">&lt;-</span> xor *var2/reg2 =&gt; <span class="Constant">&quot;33/xor *&quot;</span> reg2 <span class="Constant">&quot; &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>

4
html/rpn.mu.html generated
View File

@ -183,7 +183,7 @@ if ('onhashchange' in window) {
<span id="L125" class="LineNr">125 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='rpn.mu.html#L57'>int-stack</a>) <span class="Special">&lt;-</span> copy _self
<span id="L126" class="LineNr">126 </span> <span class="PreProc">var</span> top-addr/<span class="Constant">ecx</span>: (addr int) <span class="Special">&lt;-</span> get self, top
<span id="L127" class="LineNr">127 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">edx</span>: (addr handle array int) <span class="Special">&lt;-</span> get self, data
<span id="L128" class="LineNr">128 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array int) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L128" class="LineNr">128 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array int) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L129" class="LineNr">129 </span> <span class="PreProc">var</span> top/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy *top-addr
<span id="L130" class="LineNr">130 </span> <span class="PreProc">var</span> dest-addr/<span class="Constant">edx</span>: (addr int) <span class="Special">&lt;-</span> index data, top
<span id="L131" class="LineNr">131 </span> <span class="PreProc">var</span> val/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy _val
@ -201,7 +201,7 @@ if ('onhashchange' in window) {
<span id="L143" class="LineNr">143 </span> <span class="Delimiter">}</span>
<span id="L144" class="LineNr">144 </span> subtract-from *top-addr, <span class="Constant">1</span>
<span id="L145" class="LineNr">145 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">edx</span>: (addr handle array int) <span class="Special">&lt;-</span> get self, data
<span id="L146" class="LineNr">146 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array int) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L146" class="LineNr">146 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array int) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L147" class="LineNr">147 </span> <span class="PreProc">var</span> top/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy *top-addr
<span id="L148" class="LineNr">148 </span> <span class="PreProc">var</span> result-addr/<span class="Constant">eax</span>: (addr int) <span class="Special">&lt;-</span> index data, top
<span id="L149" class="LineNr">149 </span> <span class="PreProc">var</span> val/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy *result-addr

377
html/shell/cell.mu.html generated
View File

@ -73,194 +73,195 @@ if ('onhashchange' in window) {
<span id="L15" class="LineNr"> 15 </span> <span class="muComment"># type 6: keyboard</span>
<span id="L16" class="LineNr"> 16 </span> keyboard-data: (handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>)
<span id="L17" class="LineNr"> 17 </span> <span class="muComment"># TODO: array, (associative) table</span>
<span id="L18" class="LineNr"> 18 </span><span class="Delimiter">}</span>
<span id="L19" class="LineNr"> 19 </span>
<span id="L20" class="LineNr"> 20 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L20'>allocate-symbol</a></span> _out: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Delimiter">{</span>
<span id="L21" class="LineNr"> 21 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L22" class="LineNr"> 22 </span> <a href='../120allocate.subx.html#L43'>allocate</a> out
<span id="L23" class="LineNr"> 23 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *out
<span id="L24" class="LineNr"> 24 </span> <span class="PreProc">var</span> <span class="PreProc">type</span>/<span class="Constant">ecx</span>: (addr int) <span class="Special">&lt;-</span> get out-addr, <span class="PreProc">type</span>
<span id="L25" class="LineNr"> 25 </span> copy-to *<span class="PreProc">type</span>, <span class="Constant">2</span>/symbol
<span id="L26" class="LineNr"> 26 </span> <span class="PreProc">var</span> dest-ah/<span class="Constant">eax</span>: (addr handle stream byte) <span class="Special">&lt;-</span> get out-addr, text-data
<span id="L27" class="LineNr"> 27 </span> populate-stream dest-ah, <span class="Constant">0x40</span>/max-symbol-size
<span id="L28" class="LineNr"> 28 </span><span class="Delimiter">}</span>
<span id="L29" class="LineNr"> 29 </span>
<span id="L30" class="LineNr"> 30 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L30'>initialize-symbol</a></span> _out: (addr handle <a href='cell.mu.html#L1'>cell</a>), val: (addr array byte) <span class="Delimiter">{</span>
<span id="L31" class="LineNr"> 31 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L32" class="LineNr"> 32 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *out
<span id="L33" class="LineNr"> 33 </span> <span class="PreProc">var</span> dest-ah/<span class="Constant">eax</span>: (addr handle stream byte) <span class="Special">&lt;-</span> get out-addr, text-data
<span id="L34" class="LineNr"> 34 </span> <span class="PreProc">var</span> dest/<span class="Constant">eax</span>: (addr stream byte) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *dest-ah
<span id="L35" class="LineNr"> 35 </span> <a href='../108write.subx.html#L11'>write</a> dest, val
<span id="L36" class="LineNr"> 36 </span><span class="Delimiter">}</span>
<span id="L37" class="LineNr"> 37 </span>
<span id="L38" class="LineNr"> 38 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L38'>new-symbol</a></span> out: (addr handle <a href='cell.mu.html#L1'>cell</a>), val: (addr array byte) <span class="Delimiter">{</span>
<span id="L39" class="LineNr"> 39 </span> <a href='cell.mu.html#L20'>allocate-symbol</a> out
<span id="L40" class="LineNr"> 40 </span> <a href='cell.mu.html#L30'>initialize-symbol</a> out, val
<span id="L41" class="LineNr"> 41 </span><span class="Delimiter">}</span>
<span id="L42" class="LineNr"> 42 </span>
<span id="L43" class="LineNr"> 43 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L43'>symbol-equal?</a></span> _in: (addr <a href='cell.mu.html#L1'>cell</a>), name: (addr array byte)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean <span class="Delimiter">{</span>
<span id="L44" class="LineNr"> 44 </span> <span class="PreProc">var</span> in/<span class="Constant">esi</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _in
<span id="L45" class="LineNr"> 45 </span> <span class="PreProc">var</span> in-type/<span class="Constant">eax</span>: (addr int) <span class="Special">&lt;-</span> get in, <span class="PreProc">type</span>
<span id="L46" class="LineNr"> 46 </span> compare *in-type, <span class="Constant">2</span>/symbol
<span id="L47" class="LineNr"> 47 </span> <span class="Delimiter">{</span>
<span id="L48" class="LineNr"> 48 </span> <span class="PreProc">break-if-=</span>
<span id="L49" class="LineNr"> 49 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L50" class="LineNr"> 50 </span> <span class="Delimiter">}</span>
<span id="L51" class="LineNr"> 51 </span> <span class="PreProc">var</span> in-data-ah/<span class="Constant">eax</span>: (addr handle stream byte) <span class="Special">&lt;-</span> get in, text-data
<span id="L52" class="LineNr"> 52 </span> <span class="PreProc">var</span> in-data/<span class="Constant">eax</span>: (addr stream byte) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *in-data-ah
<span id="L53" class="LineNr"> 53 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='../109stream-equal.subx.html#L9'>stream-data-equal?</a> in-data, name
<span id="L54" class="LineNr"> 54 </span> <span class="PreProc">return</span> result
<span id="L55" class="LineNr"> 55 </span><span class="Delimiter">}</span>
<span id="L56" class="LineNr"> 56 </span>
<span id="L57" class="LineNr"> 57 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L57'>allocate-stream</a></span> _out: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Delimiter">{</span>
<span id="L58" class="LineNr"> 58 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L59" class="LineNr"> 59 </span> <a href='../120allocate.subx.html#L43'>allocate</a> out
<span id="L60" class="LineNr"> 60 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *out
<span id="L61" class="LineNr"> 61 </span> <span class="PreProc">var</span> <span class="PreProc">type</span>/<span class="Constant">ecx</span>: (addr int) <span class="Special">&lt;-</span> get out-addr, <span class="PreProc">type</span>
<span id="L62" class="LineNr"> 62 </span> copy-to *<span class="PreProc">type</span>, <span class="Constant">3</span>/stream
<span id="L63" class="LineNr"> 63 </span> <span class="PreProc">var</span> dest-ah/<span class="Constant">eax</span>: (addr handle stream byte) <span class="Special">&lt;-</span> get out-addr, text-data
<span id="L64" class="LineNr"> 64 </span> populate-stream dest-ah, <span class="Constant">0x40</span>/max-stream-size
<span id="L65" class="LineNr"> 65 </span><span class="Delimiter">}</span>
<span id="L66" class="LineNr"> 66 </span>
<span id="L67" class="LineNr"> 67 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L67'>allocate-number</a></span> _out: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Delimiter">{</span>
<span id="L68" class="LineNr"> 68 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L69" class="LineNr"> 69 </span> <a href='../120allocate.subx.html#L43'>allocate</a> out
<span id="L70" class="LineNr"> 70 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *out
<span id="L71" class="LineNr"> 71 </span> <span class="PreProc">var</span> <span class="PreProc">type</span>/<span class="Constant">ecx</span>: (addr int) <span class="Special">&lt;-</span> get out-addr, <span class="PreProc">type</span>
<span id="L72" class="LineNr"> 72 </span> copy-to *<span class="PreProc">type</span>, <span class="Constant">1</span>/number
<span id="L73" class="LineNr"> 73 </span><span class="Delimiter">}</span>
<span id="L74" class="LineNr"> 74 </span>
<span id="L75" class="LineNr"> 75 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L75'>initialize-integer</a></span> _out: (addr handle <a href='cell.mu.html#L1'>cell</a>), n: int <span class="Delimiter">{</span>
<span id="L76" class="LineNr"> 76 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L77" class="LineNr"> 77 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *out
<span id="L78" class="LineNr"> 78 </span> <span class="PreProc">var</span> dest-addr/<span class="Constant">eax</span>: (addr float) <span class="Special">&lt;-</span> get out-addr, number-data
<span id="L79" class="LineNr"> 79 </span> <span class="PreProc">var</span> src/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> convert n
<span id="L80" class="LineNr"> 80 </span> copy-to *dest-addr, src
<span id="L81" class="LineNr"> 81 </span><span class="Delimiter">}</span>
<span id="L82" class="LineNr"> 82 </span>
<span id="L83" class="LineNr"> 83 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L83'>new-integer</a></span> out: (addr handle <a href='cell.mu.html#L1'>cell</a>), n: int <span class="Delimiter">{</span>
<span id="L84" class="LineNr"> 84 </span> <a href='cell.mu.html#L67'>allocate-number</a> out
<span id="L85" class="LineNr"> 85 </span> <a href='cell.mu.html#L75'>initialize-integer</a> out, n
<span id="L86" class="LineNr"> 86 </span><span class="Delimiter">}</span>
<span id="L87" class="LineNr"> 87 </span>
<span id="L88" class="LineNr"> 88 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L88'>initialize-float</a></span> _out: (addr handle <a href='cell.mu.html#L1'>cell</a>), n: float <span class="Delimiter">{</span>
<span id="L89" class="LineNr"> 89 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L90" class="LineNr"> 90 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *out
<span id="L91" class="LineNr"> 91 </span> <span class="PreProc">var</span> dest-ah/<span class="Constant">eax</span>: (addr float) <span class="Special">&lt;-</span> get out-addr, number-data
<span id="L92" class="LineNr"> 92 </span> <span class="PreProc">var</span> src/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> copy n
<span id="L93" class="LineNr"> 93 </span> copy-to *dest-ah, src
<span id="L94" class="LineNr"> 94 </span><span class="Delimiter">}</span>
<span id="L95" class="LineNr"> 95 </span>
<span id="L96" class="LineNr"> 96 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L96'>new-float</a></span> out: (addr handle <a href='cell.mu.html#L1'>cell</a>), n: float <span class="Delimiter">{</span>
<span id="L97" class="LineNr"> 97 </span> <a href='cell.mu.html#L67'>allocate-number</a> out
<span id="L98" class="LineNr"> 98 </span> <a href='cell.mu.html#L88'>initialize-float</a> out, n
<span id="L99" class="LineNr"> 99 </span><span class="Delimiter">}</span>
<span id="L100" class="LineNr">100 </span>
<span id="L101" class="LineNr">101 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L101'>allocate-pair</a></span> out: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Delimiter">{</span>
<span id="L102" class="LineNr">102 </span> <a href='../120allocate.subx.html#L43'>allocate</a> out
<span id="L103" class="LineNr">103 </span> <span class="muComment"># new cells have type pair by default</span>
<span id="L104" class="LineNr">104 </span><span class="Delimiter">}</span>
<span id="L105" class="LineNr">105 </span>
<span id="L106" class="LineNr">106 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L106'>initialize-pair</a></span> _out: (addr handle <a href='cell.mu.html#L1'>cell</a>), left: (handle <a href='cell.mu.html#L1'>cell</a>), right: (handle <a href='cell.mu.html#L1'>cell</a>) <span class="Delimiter">{</span>
<span id="L107" class="LineNr">107 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L108" class="LineNr">108 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *out
<span id="L109" class="LineNr">109 </span> <span class="PreProc">var</span> dest-ah/<span class="Constant">ecx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get out-addr, left
<span id="L110" class="LineNr">110 </span> <a href='../120allocate.subx.html#L455'>copy-handle</a> left, dest-ah
<span id="L111" class="LineNr">111 </span> dest-ah <span class="Special">&lt;-</span> get out-addr, right
<span id="L112" class="LineNr">112 </span> <a href='../120allocate.subx.html#L455'>copy-handle</a> right, dest-ah
<span id="L113" class="LineNr">113 </span><span class="Delimiter">}</span>
<span id="L114" class="LineNr">114 </span>
<span id="L115" class="LineNr">115 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L115'>new-pair</a></span> out: (addr handle <a href='cell.mu.html#L1'>cell</a>), left: (handle <a href='cell.mu.html#L1'>cell</a>), right: (handle <a href='cell.mu.html#L1'>cell</a>) <span class="Delimiter">{</span>
<span id="L116" class="LineNr">116 </span> <a href='cell.mu.html#L101'>allocate-pair</a> out
<span id="L117" class="LineNr">117 </span> <a href='cell.mu.html#L106'>initialize-pair</a> out, left, right
<span id="L118" class="LineNr">118 </span><span class="Delimiter">}</span>
<span id="L119" class="LineNr">119 </span>
<span id="L120" class="LineNr">120 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L120'>nil</a></span> out: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Delimiter">{</span>
<span id="L121" class="LineNr">121 </span> <a href='cell.mu.html#L101'>allocate-pair</a> out
<span id="L122" class="LineNr">122 </span><span class="Delimiter">}</span>
<span id="L123" class="LineNr">123 </span>
<span id="L124" class="LineNr">124 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L124'>allocate-primitive-function</a></span> _out: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Delimiter">{</span>
<span id="L125" class="LineNr">125 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L126" class="LineNr">126 </span> <a href='../120allocate.subx.html#L43'>allocate</a> out
<span id="L127" class="LineNr">127 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *out
<span id="L128" class="LineNr">128 </span> <span class="PreProc">var</span> <span class="PreProc">type</span>/<span class="Constant">ecx</span>: (addr int) <span class="Special">&lt;-</span> get out-addr, <span class="PreProc">type</span>
<span id="L129" class="LineNr">129 </span> copy-to *<span class="PreProc">type</span>, <span class="Constant">4</span>/primitive-function
<span id="L130" class="LineNr">130 </span><span class="Delimiter">}</span>
<span id="L131" class="LineNr">131 </span>
<span id="L132" class="LineNr">132 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L132'>initialize-primitive-function</a></span> _out: (addr handle <a href='cell.mu.html#L1'>cell</a>), n: int <span class="Delimiter">{</span>
<span id="L133" class="LineNr">133 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L134" class="LineNr">134 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *out
<span id="L135" class="LineNr">135 </span> <span class="PreProc">var</span> dest-addr/<span class="Constant">eax</span>: (addr int) <span class="Special">&lt;-</span> get out-addr, index-data
<span id="L136" class="LineNr">136 </span> <span class="PreProc">var</span> src/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy n
<span id="L137" class="LineNr">137 </span> copy-to *dest-addr, src
<span id="L138" class="LineNr">138 </span><span class="Delimiter">}</span>
<span id="L139" class="LineNr">139 </span>
<span id="L140" class="LineNr">140 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L140'>new-primitive-function</a></span> out: (addr handle <a href='cell.mu.html#L1'>cell</a>), n: int <span class="Delimiter">{</span>
<span id="L141" class="LineNr">141 </span> <a href='cell.mu.html#L124'>allocate-primitive-function</a> out
<span id="L142" class="LineNr">142 </span> <a href='cell.mu.html#L132'>initialize-primitive-function</a> out, n
<span id="L143" class="LineNr">143 </span><span class="Delimiter">}</span>
<span id="L144" class="LineNr">144 </span>
<span id="L145" class="LineNr">145 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L145'>allocate-screen</a></span> _out: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Delimiter">{</span>
<span id="L146" class="LineNr">146 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L147" class="LineNr">147 </span> <a href='../120allocate.subx.html#L43'>allocate</a> out
<span id="L148" class="LineNr">148 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *out
<span id="L149" class="LineNr">149 </span> <span class="PreProc">var</span> <span class="PreProc">type</span>/<span class="Constant">ecx</span>: (addr int) <span class="Special">&lt;-</span> get out-addr, <span class="PreProc">type</span>
<span id="L150" class="LineNr">150 </span> copy-to *<span class="PreProc">type</span>, <span class="Constant">5</span>/screen
<span id="L151" class="LineNr">151 </span><span class="Delimiter">}</span>
<span id="L152" class="LineNr">152 </span>
<span id="L153" class="LineNr">153 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L153'>new-fake-screen</a></span> _out: (addr handle <a href='cell.mu.html#L1'>cell</a>), width: int, height: int, pixel-graphics?: boolean <span class="Delimiter">{</span>
<span id="L154" class="LineNr">154 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L155" class="LineNr">155 </span> <a href='cell.mu.html#L145'>allocate-screen</a> out
<span id="L156" class="LineNr">156 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *out
<span id="L157" class="LineNr">157 </span> <span class="PreProc">var</span> dest-ah/<span class="Constant">eax</span>: (addr handle <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> get out-addr, screen-data
<span id="L158" class="LineNr">158 </span> <a href='../120allocate.subx.html#L43'>allocate</a> dest-ah
<span id="L159" class="LineNr">159 </span> <span class="PreProc">var</span> dest-addr/<span class="Constant">eax</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *dest-ah
<span id="L160" class="LineNr">160 </span> <a href='../500fake-screen.mu.html#L31'>initialize-screen</a> dest-addr, width, height, pixel-graphics?
<span id="L161" class="LineNr">161 </span><span class="Delimiter">}</span>
<span id="L162" class="LineNr">162 </span>
<span id="L163" class="LineNr">163 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L163'>clear-screen-cell</a></span> _self-ah: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Delimiter">{</span>
<span id="L164" class="LineNr">164 </span> <span class="PreProc">var</span> self-ah/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _self-ah
<span id="L165" class="LineNr">165 </span> <span class="PreProc">var</span> self/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *self-ah
<span id="L166" class="LineNr">166 </span> compare self, <span class="Constant">0</span>
<span id="L167" class="LineNr">167 </span> <span class="Delimiter">{</span>
<span id="L168" class="LineNr">168 </span> <span class="PreProc">break-if-!=</span>
<span id="L169" class="LineNr">169 </span> <span class="PreProc">return</span>
<span id="L170" class="LineNr">170 </span> <span class="Delimiter">}</span>
<span id="L171" class="LineNr">171 </span> <span class="PreProc">var</span> screen-ah/<span class="Constant">eax</span>: (addr handle <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> get self, screen-data
<span id="L172" class="LineNr">172 </span> <span class="PreProc">var</span> <a href='../500fake-screen.mu.html#L14'>screen</a>/<span class="Constant">eax</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *screen-ah
<span id="L173" class="LineNr">173 </span> <a href='../500fake-screen.mu.html#L230'>clear-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L174" class="LineNr">174 </span><span class="Delimiter">}</span>
<span id="L175" class="LineNr">175 </span>
<span id="L176" class="LineNr">176 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L176'>allocate-keyboard</a></span> _out: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Delimiter">{</span>
<span id="L177" class="LineNr">177 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L178" class="LineNr">178 </span> <a href='../120allocate.subx.html#L43'>allocate</a> out
<span id="L179" class="LineNr">179 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *out
<span id="L180" class="LineNr">180 </span> <span class="PreProc">var</span> <span class="PreProc">type</span>/<span class="Constant">ecx</span>: (addr int) <span class="Special">&lt;-</span> get out-addr, <span class="PreProc">type</span>
<span id="L181" class="LineNr">181 </span> copy-to *<span class="PreProc">type</span>, <span class="Constant">6</span>/keyboard
<span id="L182" class="LineNr">182 </span><span class="Delimiter">}</span>
<span id="L183" class="LineNr">183 </span>
<span id="L184" class="LineNr">184 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L184'>new-fake-keyboard</a></span> _out: (addr handle <a href='cell.mu.html#L1'>cell</a>), capacity: int <span class="Delimiter">{</span>
<span id="L185" class="LineNr">185 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L186" class="LineNr">186 </span> <a href='cell.mu.html#L176'>allocate-keyboard</a> out
<span id="L187" class="LineNr">187 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *out
<span id="L188" class="LineNr">188 </span> <span class="PreProc">var</span> dest-ah/<span class="Constant">eax</span>: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> get out-addr, keyboard-data
<span id="L189" class="LineNr">189 </span> <a href='../120allocate.subx.html#L43'>allocate</a> dest-ah
<span id="L190" class="LineNr">190 </span> <span class="PreProc">var</span> dest-addr/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *dest-ah
<span id="L191" class="LineNr">191 </span> <a href='gap-buffer.mu.html#L11'>initialize-gap-buffer</a> dest-addr, capacity
<span id="L192" class="LineNr">192 </span><span class="Delimiter">}</span>
<span id="L193" class="LineNr">193 </span>
<span id="L194" class="LineNr">194 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L194'>rewind-keyboard-cell</a></span> _self-ah: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Delimiter">{</span>
<span id="L195" class="LineNr">195 </span> <span class="PreProc">var</span> self-ah/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _self-ah
<span id="L196" class="LineNr">196 </span> <span class="PreProc">var</span> self/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *self-ah
<span id="L197" class="LineNr">197 </span> compare self, <span class="Constant">0</span>
<span id="L198" class="LineNr">198 </span> <span class="Delimiter">{</span>
<span id="L199" class="LineNr">199 </span> <span class="PreProc">break-if-!=</span>
<span id="L200" class="LineNr">200 </span> <span class="PreProc">return</span>
<span id="L201" class="LineNr">201 </span> <span class="Delimiter">}</span>
<span id="L202" class="LineNr">202 </span> <span class="PreProc">var</span> keyboard-ah/<span class="Constant">eax</span>: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> get self, keyboard-data
<span id="L203" class="LineNr">203 </span> <span class="PreProc">var</span> keyboard/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *keyboard-ah
<span id="L204" class="LineNr">204 </span> <a href='gap-buffer.mu.html#L749'>rewind-gap-buffer</a> keyboard
<span id="L205" class="LineNr">205 </span><span class="Delimiter">}</span>
<span id="L18" class="LineNr"> 18 </span> <span class="muComment"># if you add types here, don't forget to update cell-isomorphic?</span>
<span id="L19" class="LineNr"> 19 </span><span class="Delimiter">}</span>
<span id="L20" class="LineNr"> 20 </span>
<span id="L21" class="LineNr"> 21 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L21'>allocate-symbol</a></span> _out: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Delimiter">{</span>
<span id="L22" class="LineNr"> 22 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L23" class="LineNr"> 23 </span> <a href='../120allocate.subx.html#L43'>allocate</a> out
<span id="L24" class="LineNr"> 24 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *out
<span id="L25" class="LineNr"> 25 </span> <span class="PreProc">var</span> <span class="PreProc">type</span>/<span class="Constant">ecx</span>: (addr int) <span class="Special">&lt;-</span> get out-addr, <span class="PreProc">type</span>
<span id="L26" class="LineNr"> 26 </span> copy-to *<span class="PreProc">type</span>, <span class="Constant">2</span>/symbol
<span id="L27" class="LineNr"> 27 </span> <span class="PreProc">var</span> dest-ah/<span class="Constant">eax</span>: (addr handle stream byte) <span class="Special">&lt;-</span> get out-addr, text-data
<span id="L28" class="LineNr"> 28 </span> populate-stream dest-ah, <span class="Constant">0x40</span>/max-symbol-size
<span id="L29" class="LineNr"> 29 </span><span class="Delimiter">}</span>
<span id="L30" class="LineNr"> 30 </span>
<span id="L31" class="LineNr"> 31 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L31'>initialize-symbol</a></span> _out: (addr handle <a href='cell.mu.html#L1'>cell</a>), val: (addr array byte) <span class="Delimiter">{</span>
<span id="L32" class="LineNr"> 32 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L33" class="LineNr"> 33 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *out
<span id="L34" class="LineNr"> 34 </span> <span class="PreProc">var</span> dest-ah/<span class="Constant">eax</span>: (addr handle stream byte) <span class="Special">&lt;-</span> get out-addr, text-data
<span id="L35" class="LineNr"> 35 </span> <span class="PreProc">var</span> dest/<span class="Constant">eax</span>: (addr stream byte) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *dest-ah
<span id="L36" class="LineNr"> 36 </span> <a href='../108write.subx.html#L11'>write</a> dest, val
<span id="L37" class="LineNr"> 37 </span><span class="Delimiter">}</span>
<span id="L38" class="LineNr"> 38 </span>
<span id="L39" class="LineNr"> 39 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L39'>new-symbol</a></span> out: (addr handle <a href='cell.mu.html#L1'>cell</a>), val: (addr array byte) <span class="Delimiter">{</span>
<span id="L40" class="LineNr"> 40 </span> <a href='cell.mu.html#L21'>allocate-symbol</a> out
<span id="L41" class="LineNr"> 41 </span> <a href='cell.mu.html#L31'>initialize-symbol</a> out, val
<span id="L42" class="LineNr"> 42 </span><span class="Delimiter">}</span>
<span id="L43" class="LineNr"> 43 </span>
<span id="L44" class="LineNr"> 44 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L44'>symbol-equal?</a></span> _in: (addr <a href='cell.mu.html#L1'>cell</a>), name: (addr array byte)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean <span class="Delimiter">{</span>
<span id="L45" class="LineNr"> 45 </span> <span class="PreProc">var</span> in/<span class="Constant">esi</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _in
<span id="L46" class="LineNr"> 46 </span> <span class="PreProc">var</span> in-type/<span class="Constant">eax</span>: (addr int) <span class="Special">&lt;-</span> get in, <span class="PreProc">type</span>
<span id="L47" class="LineNr"> 47 </span> compare *in-type, <span class="Constant">2</span>/symbol
<span id="L48" class="LineNr"> 48 </span> <span class="Delimiter">{</span>
<span id="L49" class="LineNr"> 49 </span> <span class="PreProc">break-if-=</span>
<span id="L50" class="LineNr"> 50 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L51" class="LineNr"> 51 </span> <span class="Delimiter">}</span>
<span id="L52" class="LineNr"> 52 </span> <span class="PreProc">var</span> in-data-ah/<span class="Constant">eax</span>: (addr handle stream byte) <span class="Special">&lt;-</span> get in, text-data
<span id="L53" class="LineNr"> 53 </span> <span class="PreProc">var</span> in-data/<span class="Constant">eax</span>: (addr stream byte) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *in-data-ah
<span id="L54" class="LineNr"> 54 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='../109stream-equal.subx.html#L9'>stream-data-equal?</a> in-data, name
<span id="L55" class="LineNr"> 55 </span> <span class="PreProc">return</span> result
<span id="L56" class="LineNr"> 56 </span><span class="Delimiter">}</span>
<span id="L57" class="LineNr"> 57 </span>
<span id="L58" class="LineNr"> 58 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L58'>allocate-stream</a></span> _out: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Delimiter">{</span>
<span id="L59" class="LineNr"> 59 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L60" class="LineNr"> 60 </span> <a href='../120allocate.subx.html#L43'>allocate</a> out
<span id="L61" class="LineNr"> 61 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *out
<span id="L62" class="LineNr"> 62 </span> <span class="PreProc">var</span> <span class="PreProc">type</span>/<span class="Constant">ecx</span>: (addr int) <span class="Special">&lt;-</span> get out-addr, <span class="PreProc">type</span>
<span id="L63" class="LineNr"> 63 </span> copy-to *<span class="PreProc">type</span>, <span class="Constant">3</span>/stream
<span id="L64" class="LineNr"> 64 </span> <span class="PreProc">var</span> dest-ah/<span class="Constant">eax</span>: (addr handle stream byte) <span class="Special">&lt;-</span> get out-addr, text-data
<span id="L65" class="LineNr"> 65 </span> populate-stream dest-ah, <span class="Constant">0x40</span>/max-stream-size
<span id="L66" class="LineNr"> 66 </span><span class="Delimiter">}</span>
<span id="L67" class="LineNr"> 67 </span>
<span id="L68" class="LineNr"> 68 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L68'>allocate-number</a></span> _out: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Delimiter">{</span>
<span id="L69" class="LineNr"> 69 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L70" class="LineNr"> 70 </span> <a href='../120allocate.subx.html#L43'>allocate</a> out
<span id="L71" class="LineNr"> 71 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *out
<span id="L72" class="LineNr"> 72 </span> <span class="PreProc">var</span> <span class="PreProc">type</span>/<span class="Constant">ecx</span>: (addr int) <span class="Special">&lt;-</span> get out-addr, <span class="PreProc">type</span>
<span id="L73" class="LineNr"> 73 </span> copy-to *<span class="PreProc">type</span>, <span class="Constant">1</span>/number
<span id="L74" class="LineNr"> 74 </span><span class="Delimiter">}</span>
<span id="L75" class="LineNr"> 75 </span>
<span id="L76" class="LineNr"> 76 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L76'>initialize-integer</a></span> _out: (addr handle <a href='cell.mu.html#L1'>cell</a>), n: int <span class="Delimiter">{</span>
<span id="L77" class="LineNr"> 77 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L78" class="LineNr"> 78 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *out
<span id="L79" class="LineNr"> 79 </span> <span class="PreProc">var</span> dest-addr/<span class="Constant">eax</span>: (addr float) <span class="Special">&lt;-</span> get out-addr, number-data
<span id="L80" class="LineNr"> 80 </span> <span class="PreProc">var</span> src/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> convert n
<span id="L81" class="LineNr"> 81 </span> copy-to *dest-addr, src
<span id="L82" class="LineNr"> 82 </span><span class="Delimiter">}</span>
<span id="L83" class="LineNr"> 83 </span>
<span id="L84" class="LineNr"> 84 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L84'>new-integer</a></span> out: (addr handle <a href='cell.mu.html#L1'>cell</a>), n: int <span class="Delimiter">{</span>
<span id="L85" class="LineNr"> 85 </span> <a href='cell.mu.html#L68'>allocate-number</a> out
<span id="L86" class="LineNr"> 86 </span> <a href='cell.mu.html#L76'>initialize-integer</a> out, n
<span id="L87" class="LineNr"> 87 </span><span class="Delimiter">}</span>
<span id="L88" class="LineNr"> 88 </span>
<span id="L89" class="LineNr"> 89 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L89'>initialize-float</a></span> _out: (addr handle <a href='cell.mu.html#L1'>cell</a>), n: float <span class="Delimiter">{</span>
<span id="L90" class="LineNr"> 90 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L91" class="LineNr"> 91 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *out
<span id="L92" class="LineNr"> 92 </span> <span class="PreProc">var</span> dest-ah/<span class="Constant">eax</span>: (addr float) <span class="Special">&lt;-</span> get out-addr, number-data
<span id="L93" class="LineNr"> 93 </span> <span class="PreProc">var</span> src/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> copy n
<span id="L94" class="LineNr"> 94 </span> copy-to *dest-ah, src
<span id="L95" class="LineNr"> 95 </span><span class="Delimiter">}</span>
<span id="L96" class="LineNr"> 96 </span>
<span id="L97" class="LineNr"> 97 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L97'>new-float</a></span> out: (addr handle <a href='cell.mu.html#L1'>cell</a>), n: float <span class="Delimiter">{</span>
<span id="L98" class="LineNr"> 98 </span> <a href='cell.mu.html#L68'>allocate-number</a> out
<span id="L99" class="LineNr"> 99 </span> <a href='cell.mu.html#L89'>initialize-float</a> out, n
<span id="L100" class="LineNr">100 </span><span class="Delimiter">}</span>
<span id="L101" class="LineNr">101 </span>
<span id="L102" class="LineNr">102 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L102'>allocate-pair</a></span> out: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Delimiter">{</span>
<span id="L103" class="LineNr">103 </span> <a href='../120allocate.subx.html#L43'>allocate</a> out
<span id="L104" class="LineNr">104 </span> <span class="muComment"># new cells have type pair by default</span>
<span id="L105" class="LineNr">105 </span><span class="Delimiter">}</span>
<span id="L106" class="LineNr">106 </span>
<span id="L107" class="LineNr">107 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L107'>initialize-pair</a></span> _out: (addr handle <a href='cell.mu.html#L1'>cell</a>), left: (handle <a href='cell.mu.html#L1'>cell</a>), right: (handle <a href='cell.mu.html#L1'>cell</a>) <span class="Delimiter">{</span>
<span id="L108" class="LineNr">108 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L109" class="LineNr">109 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *out
<span id="L110" class="LineNr">110 </span> <span class="PreProc">var</span> dest-ah/<span class="Constant">ecx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get out-addr, left
<span id="L111" class="LineNr">111 </span> <a href='../120allocate.subx.html#L479'>copy-handle</a> left, dest-ah
<span id="L112" class="LineNr">112 </span> dest-ah <span class="Special">&lt;-</span> get out-addr, right
<span id="L113" class="LineNr">113 </span> <a href='../120allocate.subx.html#L479'>copy-handle</a> right, dest-ah
<span id="L114" class="LineNr">114 </span><span class="Delimiter">}</span>
<span id="L115" class="LineNr">115 </span>
<span id="L116" class="LineNr">116 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L116'>new-pair</a></span> out: (addr handle <a href='cell.mu.html#L1'>cell</a>), left: (handle <a href='cell.mu.html#L1'>cell</a>), right: (handle <a href='cell.mu.html#L1'>cell</a>) <span class="Delimiter">{</span>
<span id="L117" class="LineNr">117 </span> <a href='cell.mu.html#L102'>allocate-pair</a> out
<span id="L118" class="LineNr">118 </span> <a href='cell.mu.html#L107'>initialize-pair</a> out, left, right
<span id="L119" class="LineNr">119 </span><span class="Delimiter">}</span>
<span id="L120" class="LineNr">120 </span>
<span id="L121" class="LineNr">121 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L121'>nil</a></span> out: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Delimiter">{</span>
<span id="L122" class="LineNr">122 </span> <a href='cell.mu.html#L102'>allocate-pair</a> out
<span id="L123" class="LineNr">123 </span><span class="Delimiter">}</span>
<span id="L124" class="LineNr">124 </span>
<span id="L125" class="LineNr">125 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L125'>allocate-primitive-function</a></span> _out: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Delimiter">{</span>
<span id="L126" class="LineNr">126 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L127" class="LineNr">127 </span> <a href='../120allocate.subx.html#L43'>allocate</a> out
<span id="L128" class="LineNr">128 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *out
<span id="L129" class="LineNr">129 </span> <span class="PreProc">var</span> <span class="PreProc">type</span>/<span class="Constant">ecx</span>: (addr int) <span class="Special">&lt;-</span> get out-addr, <span class="PreProc">type</span>
<span id="L130" class="LineNr">130 </span> copy-to *<span class="PreProc">type</span>, <span class="Constant">4</span>/primitive-function
<span id="L131" class="LineNr">131 </span><span class="Delimiter">}</span>
<span id="L132" class="LineNr">132 </span>
<span id="L133" class="LineNr">133 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L133'>initialize-primitive-function</a></span> _out: (addr handle <a href='cell.mu.html#L1'>cell</a>), n: int <span class="Delimiter">{</span>
<span id="L134" class="LineNr">134 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L135" class="LineNr">135 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *out
<span id="L136" class="LineNr">136 </span> <span class="PreProc">var</span> dest-addr/<span class="Constant">eax</span>: (addr int) <span class="Special">&lt;-</span> get out-addr, index-data
<span id="L137" class="LineNr">137 </span> <span class="PreProc">var</span> src/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy n
<span id="L138" class="LineNr">138 </span> copy-to *dest-addr, src
<span id="L139" class="LineNr">139 </span><span class="Delimiter">}</span>
<span id="L140" class="LineNr">140 </span>
<span id="L141" class="LineNr">141 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L141'>new-primitive-function</a></span> out: (addr handle <a href='cell.mu.html#L1'>cell</a>), n: int <span class="Delimiter">{</span>
<span id="L142" class="LineNr">142 </span> <a href='cell.mu.html#L125'>allocate-primitive-function</a> out
<span id="L143" class="LineNr">143 </span> <a href='cell.mu.html#L133'>initialize-primitive-function</a> out, n
<span id="L144" class="LineNr">144 </span><span class="Delimiter">}</span>
<span id="L145" class="LineNr">145 </span>
<span id="L146" class="LineNr">146 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L146'>allocate-screen</a></span> _out: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Delimiter">{</span>
<span id="L147" class="LineNr">147 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L148" class="LineNr">148 </span> <a href='../120allocate.subx.html#L43'>allocate</a> out
<span id="L149" class="LineNr">149 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *out
<span id="L150" class="LineNr">150 </span> <span class="PreProc">var</span> <span class="PreProc">type</span>/<span class="Constant">ecx</span>: (addr int) <span class="Special">&lt;-</span> get out-addr, <span class="PreProc">type</span>
<span id="L151" class="LineNr">151 </span> copy-to *<span class="PreProc">type</span>, <span class="Constant">5</span>/screen
<span id="L152" class="LineNr">152 </span><span class="Delimiter">}</span>
<span id="L153" class="LineNr">153 </span>
<span id="L154" class="LineNr">154 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L154'>new-fake-screen</a></span> _out: (addr handle <a href='cell.mu.html#L1'>cell</a>), width: int, height: int, pixel-graphics?: boolean <span class="Delimiter">{</span>
<span id="L155" class="LineNr">155 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L156" class="LineNr">156 </span> <a href='cell.mu.html#L146'>allocate-screen</a> out
<span id="L157" class="LineNr">157 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *out
<span id="L158" class="LineNr">158 </span> <span class="PreProc">var</span> dest-ah/<span class="Constant">eax</span>: (addr handle <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> get out-addr, screen-data
<span id="L159" class="LineNr">159 </span> <a href='../120allocate.subx.html#L43'>allocate</a> dest-ah
<span id="L160" class="LineNr">160 </span> <span class="PreProc">var</span> dest-addr/<span class="Constant">eax</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *dest-ah
<span id="L161" class="LineNr">161 </span> <a href='../500fake-screen.mu.html#L31'>initialize-screen</a> dest-addr, width, height, pixel-graphics?
<span id="L162" class="LineNr">162 </span><span class="Delimiter">}</span>
<span id="L163" class="LineNr">163 </span>
<span id="L164" class="LineNr">164 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L164'>clear-screen-cell</a></span> _self-ah: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Delimiter">{</span>
<span id="L165" class="LineNr">165 </span> <span class="PreProc">var</span> self-ah/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _self-ah
<span id="L166" class="LineNr">166 </span> <span class="PreProc">var</span> self/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *self-ah
<span id="L167" class="LineNr">167 </span> compare self, <span class="Constant">0</span>
<span id="L168" class="LineNr">168 </span> <span class="Delimiter">{</span>
<span id="L169" class="LineNr">169 </span> <span class="PreProc">break-if-!=</span>
<span id="L170" class="LineNr">170 </span> <span class="PreProc">return</span>
<span id="L171" class="LineNr">171 </span> <span class="Delimiter">}</span>
<span id="L172" class="LineNr">172 </span> <span class="PreProc">var</span> screen-ah/<span class="Constant">eax</span>: (addr handle <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> get self, screen-data
<span id="L173" class="LineNr">173 </span> <span class="PreProc">var</span> <a href='../500fake-screen.mu.html#L14'>screen</a>/<span class="Constant">eax</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *screen-ah
<span id="L174" class="LineNr">174 </span> <a href='../500fake-screen.mu.html#L230'>clear-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L175" class="LineNr">175 </span><span class="Delimiter">}</span>
<span id="L176" class="LineNr">176 </span>
<span id="L177" class="LineNr">177 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L177'>allocate-keyboard</a></span> _out: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Delimiter">{</span>
<span id="L178" class="LineNr">178 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L179" class="LineNr">179 </span> <a href='../120allocate.subx.html#L43'>allocate</a> out
<span id="L180" class="LineNr">180 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *out
<span id="L181" class="LineNr">181 </span> <span class="PreProc">var</span> <span class="PreProc">type</span>/<span class="Constant">ecx</span>: (addr int) <span class="Special">&lt;-</span> get out-addr, <span class="PreProc">type</span>
<span id="L182" class="LineNr">182 </span> copy-to *<span class="PreProc">type</span>, <span class="Constant">6</span>/keyboard
<span id="L183" class="LineNr">183 </span><span class="Delimiter">}</span>
<span id="L184" class="LineNr">184 </span>
<span id="L185" class="LineNr">185 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L185'>new-fake-keyboard</a></span> _out: (addr handle <a href='cell.mu.html#L1'>cell</a>), capacity: int <span class="Delimiter">{</span>
<span id="L186" class="LineNr">186 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L187" class="LineNr">187 </span> <a href='cell.mu.html#L177'>allocate-keyboard</a> out
<span id="L188" class="LineNr">188 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *out
<span id="L189" class="LineNr">189 </span> <span class="PreProc">var</span> dest-ah/<span class="Constant">eax</span>: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> get out-addr, keyboard-data
<span id="L190" class="LineNr">190 </span> <a href='../120allocate.subx.html#L43'>allocate</a> dest-ah
<span id="L191" class="LineNr">191 </span> <span class="PreProc">var</span> dest-addr/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *dest-ah
<span id="L192" class="LineNr">192 </span> <a href='gap-buffer.mu.html#L11'>initialize-gap-buffer</a> dest-addr, capacity
<span id="L193" class="LineNr">193 </span><span class="Delimiter">}</span>
<span id="L194" class="LineNr">194 </span>
<span id="L195" class="LineNr">195 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L195'>rewind-keyboard-cell</a></span> _self-ah: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Delimiter">{</span>
<span id="L196" class="LineNr">196 </span> <span class="PreProc">var</span> self-ah/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _self-ah
<span id="L197" class="LineNr">197 </span> <span class="PreProc">var</span> self/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *self-ah
<span id="L198" class="LineNr">198 </span> compare self, <span class="Constant">0</span>
<span id="L199" class="LineNr">199 </span> <span class="Delimiter">{</span>
<span id="L200" class="LineNr">200 </span> <span class="PreProc">break-if-!=</span>
<span id="L201" class="LineNr">201 </span> <span class="PreProc">return</span>
<span id="L202" class="LineNr">202 </span> <span class="Delimiter">}</span>
<span id="L203" class="LineNr">203 </span> <span class="PreProc">var</span> keyboard-ah/<span class="Constant">eax</span>: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> get self, keyboard-data
<span id="L204" class="LineNr">204 </span> <span class="PreProc">var</span> keyboard/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *keyboard-ah
<span id="L205" class="LineNr">205 </span> <a href='gap-buffer.mu.html#L749'>rewind-gap-buffer</a> keyboard
<span id="L206" class="LineNr">206 </span><span class="Delimiter">}</span>
</pre>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@ -87,15 +87,15 @@ if ('onhashchange' in window) {
<span id="L28" class="LineNr"> 28 </span> <span class="PreProc">var</span> gap/<span class="Constant">esi</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> copy _gap
<span id="L29" class="LineNr"> 29 </span> <span class="PreProc">var</span> left/<span class="Constant">eax</span>: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special">&lt;-</span> get gap, left
<span id="L30" class="LineNr"> 30 </span> <span class="PreProc">var</span> left-data-ah/<span class="Constant">eax</span>: (addr handle array grapheme) <span class="Special">&lt;-</span> get left, data
<span id="L31" class="LineNr"> 31 </span> <span class="PreProc">var</span> left-data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *left-data-ah
<span id="L31" class="LineNr"> 31 </span> <span class="PreProc">var</span> left-data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *left-data-ah
<span id="L32" class="LineNr"> 32 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> length left-data
<span id="L33" class="LineNr"> 33 </span> <span class="PreProc">return</span> result
<span id="L34" class="LineNr"> 34 </span><span class="Delimiter">}</span>
<span id="L35" class="LineNr"> 35 </span>
<span id="L36" class="LineNr"> 36 </span><span class="muComment"># just for tests</span>
<span id="L37" class="LineNr"> 37 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='gap-buffer.mu.html#L37'>initialize-gap-buffer-with</a></span> self: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>), s: (addr array byte) <span class="Delimiter">{</span>
<span id="L38" class="LineNr"> 38 </span> <a href='gap-buffer.mu.html#L11'>initialize-gap-buffer</a> self, <span class="Constant">0x10</span>/capacity
<span id="L39" class="LineNr"> 39 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x10</span>/capacity)
<span id="L38" class="LineNr"> 38 </span> <a href='gap-buffer.mu.html#L11'>initialize-gap-buffer</a> self, <span class="Constant">0x40</span>/capacity
<span id="L39" class="LineNr"> 39 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x40</span>/capacity)
<span id="L40" class="LineNr"> 40 </span> <span class="PreProc">var</span> stream/<span class="Constant">ecx</span>: (addr stream byte) <span class="Special">&lt;-</span> address stream-storage
<span id="L41" class="LineNr"> 41 </span> <a href='../108write.subx.html#L11'>write</a> stream, s
<span id="L42" class="LineNr"> 42 </span> <span class="Delimiter">{</span>
@ -144,7 +144,7 @@ if ('onhashchange' in window) {
<span id="L85" class="LineNr"> 85 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='gap-buffer.mu.html#L85'>emit-stack-from-bottom</a></span> _self: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>), out: (addr stream byte) <span class="Delimiter">{</span>
<span id="L86" class="LineNr"> 86 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special">&lt;-</span> copy _self
<span id="L87" class="LineNr"> 87 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">edi</span>: (addr handle array grapheme) <span class="Special">&lt;-</span> get self, data
<span id="L88" class="LineNr"> 88 </span> <span class="PreProc">var</span> _data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L88" class="LineNr"> 88 </span> <span class="PreProc">var</span> _data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L89" class="LineNr"> 89 </span> <span class="PreProc">var</span> data/<span class="Constant">edi</span>: (addr array grapheme) <span class="Special">&lt;-</span> copy _data
<span id="L90" class="LineNr"> 90 </span> <span class="PreProc">var</span> top-addr/<span class="Constant">ecx</span>: (addr int) <span class="Special">&lt;-</span> get self, top
<span id="L91" class="LineNr"> 91 </span> <span class="PreProc">var</span> i/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
@ -162,7 +162,7 @@ if ('onhashchange' in window) {
<span id="L103" class="LineNr"> 103 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='gap-buffer.mu.html#L103'>emit-stack-from-top</a></span> _self: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>), out: (addr stream byte) <span class="Delimiter">{</span>
<span id="L104" class="LineNr"> 104 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special">&lt;-</span> copy _self
<span id="L105" class="LineNr"> 105 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">edi</span>: (addr handle array grapheme) <span class="Special">&lt;-</span> get self, data
<span id="L106" class="LineNr"> 106 </span> <span class="PreProc">var</span> _data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L106" class="LineNr"> 106 </span> <span class="PreProc">var</span> _data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L107" class="LineNr"> 107 </span> <span class="PreProc">var</span> data/<span class="Constant">edi</span>: (addr array grapheme) <span class="Special">&lt;-</span> copy _data
<span id="L108" class="LineNr"> 108 </span> <span class="PreProc">var</span> top-addr/<span class="Constant">ecx</span>: (addr int) <span class="Special">&lt;-</span> get self, top
<span id="L109" class="LineNr"> 109 </span> <span class="PreProc">var</span> i/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy *top-addr
@ -319,7 +319,7 @@ if ('onhashchange' in window) {
<span id="L260" class="LineNr"> 260 </span> <span class="Delimiter">{</span>
<span id="L261" class="LineNr"> 261 </span> <span class="PreProc">break-if-&lt;=</span>
<span id="L262" class="LineNr"> 262 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">eax</span>: (addr handle array grapheme) <span class="Special">&lt;-</span> get left, data
<span id="L263" class="LineNr"> 263 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L263" class="LineNr"> 263 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L264" class="LineNr"> 264 </span> <span class="PreProc">var</span> result-addr/<span class="Constant">eax</span>: (addr grapheme) <span class="Special">&lt;-</span> index data, <span class="Constant">0</span>
<span id="L265" class="LineNr"> 265 </span> <span class="PreProc">return</span> *result-addr
<span id="L266" class="LineNr"> 266 </span> <span class="Delimiter">}</span>
@ -330,7 +330,7 @@ if ('onhashchange' in window) {
<span id="L271" class="LineNr"> 271 </span> <span class="Delimiter">{</span>
<span id="L272" class="LineNr"> 272 </span> <span class="PreProc">break-if-&lt;=</span>
<span id="L273" class="LineNr"> 273 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">eax</span>: (addr handle array grapheme) <span class="Special">&lt;-</span> get right, data
<span id="L274" class="LineNr"> 274 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L274" class="LineNr"> 274 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L275" class="LineNr"> 275 </span> <span class="PreProc">var</span> top/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy *top-addr
<span id="L276" class="LineNr"> 276 </span> top <span class="Special">&lt;-</span> decrement
<span id="L277" class="LineNr"> 277 </span> <span class="PreProc">var</span> result-addr/<span class="Constant">eax</span>: (addr grapheme) <span class="Special">&lt;-</span> index data, top
@ -491,7 +491,7 @@ if ('onhashchange' in window) {
<span id="L432" class="LineNr"> 432 </span> <span class="Delimiter">{</span>
<span id="L433" class="LineNr"> 433 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L434" class="LineNr"> 434 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">eax</span>: (addr handle array grapheme) <span class="Special">&lt;-</span> get left, data
<span id="L435" class="LineNr"> 435 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L435" class="LineNr"> 435 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L436" class="LineNr"> 436 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: (addr grapheme) <span class="Special">&lt;-</span> index data, n
<span id="L437" class="LineNr"> 437 </span> <span class="PreProc">return</span> *result
<span id="L438" class="LineNr"> 438 </span> <span class="Delimiter">}</span>
@ -504,7 +504,7 @@ if ('onhashchange' in window) {
<span id="L445" class="LineNr"> 445 </span> <span class="Delimiter">{</span>
<span id="L446" class="LineNr"> 446 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L447" class="LineNr"> 447 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">eax</span>: (addr handle array grapheme) <span class="Special">&lt;-</span> get right, data
<span id="L448" class="LineNr"> 448 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L448" class="LineNr"> 448 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L449" class="LineNr"> 449 </span> <span class="muComment"># idx = right-&gt;len - n - 1</span>
<span id="L450" class="LineNr"> 450 </span> <span class="PreProc">var</span> idx/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy n
<span id="L451" class="LineNr"> 451 </span> idx <span class="Special">&lt;-</span> subtract *right-len-a
@ -514,7 +514,7 @@ if ('onhashchange' in window) {
<span id="L455" class="LineNr"> 455 </span> <span class="PreProc">return</span> *result
<span id="L456" class="LineNr"> 456 </span> <span class="Delimiter">}</span>
<span id="L457" class="LineNr"> 457 </span> <span class="muComment"># error</span>
<span id="L458" class="LineNr"> 458 </span> <a href='../501draw-text.mu.html#L481'>abort</a> <span class="Constant">&quot;gap-index: out of bounds&quot;</span>
<span id="L458" class="LineNr"> 458 </span> <a href='../317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;gap-index: out of bounds&quot;</span>
<span id="L459" class="LineNr"> 459 </span> <span class="PreProc">return</span> <span class="Constant">0</span>
<span id="L460" class="LineNr"> 460 </span><span class="Delimiter">}</span>
<span id="L461" class="LineNr"> 461 </span>
@ -577,10 +577,10 @@ if ('onhashchange' in window) {
<span id="L518" class="LineNr"> 518 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='gap-buffer.mu.html#L518'>copy-gap-buffer</a></span> _src-ah: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>), _dest-ah: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Delimiter">{</span>
<span id="L519" class="LineNr"> 519 </span> <span class="muComment"># obtain src-a, dest-a</span>
<span id="L520" class="LineNr"> 520 </span> <span class="PreProc">var</span> src-ah/<span class="Constant">eax</span>: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> copy _src-ah
<span id="L521" class="LineNr"> 521 </span> <span class="PreProc">var</span> _src-a/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *src-ah
<span id="L521" class="LineNr"> 521 </span> <span class="PreProc">var</span> _src-a/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *src-ah
<span id="L522" class="LineNr"> 522 </span> <span class="PreProc">var</span> src-a/<span class="Constant">esi</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> copy _src-a
<span id="L523" class="LineNr"> 523 </span> <span class="PreProc">var</span> dest-ah/<span class="Constant">eax</span>: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> copy _dest-ah
<span id="L524" class="LineNr"> 524 </span> <span class="PreProc">var</span> _dest-a/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *dest-ah
<span id="L524" class="LineNr"> 524 </span> <span class="PreProc">var</span> _dest-a/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *dest-ah
<span id="L525" class="LineNr"> 525 </span> <span class="PreProc">var</span> dest-a/<span class="Constant">edi</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> copy _dest-a
<span id="L526" class="LineNr"> 526 </span> <span class="muComment"># copy left grapheme-stack</span>
<span id="L527" class="LineNr"> 527 </span> <span class="PreProc">var</span> src/<span class="Constant">ecx</span>: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special">&lt;-</span> get src-a, left
@ -758,7 +758,7 @@ if ('onhashchange' in window) {
<span id="L699" class="LineNr"> 699 </span> <span class="Delimiter">}</span>
<span id="L700" class="LineNr"> 700 </span> top-index <span class="Special">&lt;-</span> decrement
<span id="L701" class="LineNr"> 701 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">eax</span>: (addr handle array grapheme) <span class="Special">&lt;-</span> get stack, data
<span id="L702" class="LineNr"> 702 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L702" class="LineNr"> 702 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L703" class="LineNr"> 703 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: (addr grapheme) <span class="Special">&lt;-</span> index data, top-index
<span id="L704" class="LineNr"> 704 </span> compare *g, <span class="Constant">0x29</span>/close-paren
<span id="L705" class="LineNr"> 705 </span> <span class="Delimiter">{</span>
@ -770,7 +770,7 @@ if ('onhashchange' in window) {
<span id="L711" class="LineNr"> 711 </span> <span class="muComment"># cursor is not at end; return (char at cursor == ')')</span>
<span id="L712" class="LineNr"> 712 </span> top-index <span class="Special">&lt;-</span> decrement
<span id="L713" class="LineNr"> 713 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">eax</span>: (addr handle array grapheme) <span class="Special">&lt;-</span> get stack, data
<span id="L714" class="LineNr"> 714 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L714" class="LineNr"> 714 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L715" class="LineNr"> 715 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: (addr grapheme) <span class="Special">&lt;-</span> index data, top-index
<span id="L716" class="LineNr"> 716 </span> compare *g, <span class="Constant">0x29</span>/close-paren
<span id="L717" class="LineNr"> 717 </span> <span class="Delimiter">{</span>
@ -847,7 +847,7 @@ if ('onhashchange' in window) {
<span id="L788" class="LineNr"> 788 </span> <span class="Delimiter">{</span>
<span id="L789" class="LineNr"> 789 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L790" class="LineNr"> 790 </span> <span class="PreProc">var</span> left-data-ah/<span class="Constant">eax</span>: (addr handle array grapheme) <span class="Special">&lt;-</span> get left, data
<span id="L791" class="LineNr"> 791 </span> <span class="PreProc">var</span> left-data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *left-data-ah
<span id="L791" class="LineNr"> 791 </span> <span class="PreProc">var</span> left-data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *left-data-ah
<span id="L792" class="LineNr"> 792 </span> <span class="PreProc">var</span> left-read-index/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy *left-read-index-a
<span id="L793" class="LineNr"> 793 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: (addr grapheme) <span class="Special">&lt;-</span> index left-data, left-read-index
<span id="L794" class="LineNr"> 794 </span> <span class="PreProc">return</span> *result
@ -862,7 +862,7 @@ if ('onhashchange' in window) {
<span id="L803" class="LineNr"> 803 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L804" class="LineNr"> 804 </span> <span class="muComment"># read the right from reverse</span>
<span id="L805" class="LineNr"> 805 </span> <span class="PreProc">var</span> right-data-ah/<span class="Constant">eax</span>: (addr handle array grapheme) <span class="Special">&lt;-</span> get right, data
<span id="L806" class="LineNr"> 806 </span> <span class="PreProc">var</span> right-data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *right-data-ah
<span id="L806" class="LineNr"> 806 </span> <span class="PreProc">var</span> right-data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *right-data-ah
<span id="L807" class="LineNr"> 807 </span> <span class="PreProc">var</span> right-read-index/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy right-size
<span id="L808" class="LineNr"> 808 </span> right-read-index <span class="Special">&lt;-</span> subtract *right-read-index-a
<span id="L809" class="LineNr"> 809 </span> right-read-index <span class="Special">&lt;-</span> subtract <span class="Constant">1</span>
@ -883,7 +883,7 @@ if ('onhashchange' in window) {
<span id="L824" class="LineNr"> 824 </span> <span class="Delimiter">{</span>
<span id="L825" class="LineNr"> 825 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L826" class="LineNr"> 826 </span> <span class="PreProc">var</span> left-data-ah/<span class="Constant">eax</span>: (addr handle array grapheme) <span class="Special">&lt;-</span> get left, data
<span id="L827" class="LineNr"> 827 </span> <span class="PreProc">var</span> left-data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *left-data-ah
<span id="L827" class="LineNr"> 827 </span> <span class="PreProc">var</span> left-data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *left-data-ah
<span id="L828" class="LineNr"> 828 </span> <span class="PreProc">var</span> left-read-index/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy *left-read-index-a
<span id="L829" class="LineNr"> 829 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: (addr grapheme) <span class="Special">&lt;-</span> index left-data, left-read-index
<span id="L830" class="LineNr"> 830 </span> increment *left-read-index-a
@ -899,7 +899,7 @@ if ('onhashchange' in window) {
<span id="L840" class="LineNr"> 840 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L841" class="LineNr"> 841 </span> <span class="muComment"># read the right from reverse</span>
<span id="L842" class="LineNr"> 842 </span> <span class="PreProc">var</span> right-data-ah/<span class="Constant">eax</span>: (addr handle array grapheme) <span class="Special">&lt;-</span> get right, data
<span id="L843" class="LineNr"> 843 </span> <span class="PreProc">var</span> right-data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *right-data-ah
<span id="L843" class="LineNr"> 843 </span> <span class="PreProc">var</span> right-data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *right-data-ah
<span id="L844" class="LineNr"> 844 </span> <span class="PreProc">var</span> right-read-index/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy right-size
<span id="L845" class="LineNr"> 845 </span> right-read-index <span class="Special">&lt;-</span> subtract *right-read-index-a
<span id="L846" class="LineNr"> 846 </span> right-read-index <span class="Special">&lt;-</span> subtract <span class="Constant">1</span>

3984
html/shell/global.mu.html generated

File diff suppressed because it is too large Load Diff

View File

@ -99,7 +99,7 @@ if ('onhashchange' in window) {
<span id="L40" class="LineNr"> 40 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special">&lt;-</span> copy _self
<span id="L41" class="LineNr"> 41 </span> <span class="PreProc">var</span> top-addr/<span class="Constant">ecx</span>: (addr int) <span class="Special">&lt;-</span> get self, top
<span id="L42" class="LineNr"> 42 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">edx</span>: (addr handle array grapheme) <span class="Special">&lt;-</span> get self, data
<span id="L43" class="LineNr"> 43 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L43" class="LineNr"> 43 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L44" class="LineNr"> 44 </span> <span class="PreProc">var</span> top/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy *top-addr
<span id="L45" class="LineNr"> 45 </span> <span class="PreProc">var</span> dest-addr/<span class="Constant">edx</span>: (addr grapheme) <span class="Special">&lt;-</span> index data, top
<span id="L46" class="LineNr"> 46 </span> <span class="PreProc">var</span> val/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> copy _val
@ -117,7 +117,7 @@ if ('onhashchange' in window) {
<span id="L58" class="LineNr"> 58 </span> <span class="Delimiter">}</span>
<span id="L59" class="LineNr"> 59 </span> subtract-from *top-addr, <span class="Constant">1</span>
<span id="L60" class="LineNr"> 60 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">edx</span>: (addr handle array grapheme) <span class="Special">&lt;-</span> get self, data
<span id="L61" class="LineNr"> 61 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L61" class="LineNr"> 61 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L62" class="LineNr"> 62 </span> <span class="PreProc">var</span> top/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy *top-addr
<span id="L63" class="LineNr"> 63 </span> <span class="PreProc">var</span> result-addr/<span class="Constant">eax</span>: (addr grapheme) <span class="Special">&lt;-</span> index data, top
<span id="L64" class="LineNr"> 64 </span> <span class="PreProc">return</span> *result-addr
@ -126,7 +126,7 @@ if ('onhashchange' in window) {
<span id="L67" class="LineNr"> 67 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='grapheme-stack.mu.html#L67'>copy-grapheme-stack</a></span> _src: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>), dest: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Delimiter">{</span>
<span id="L68" class="LineNr"> 68 </span> <span class="PreProc">var</span> src/<span class="Constant">esi</span>: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special">&lt;-</span> copy _src
<span id="L69" class="LineNr"> 69 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">edi</span>: (addr handle array grapheme) <span class="Special">&lt;-</span> get src, data
<span id="L70" class="LineNr"> 70 </span> <span class="PreProc">var</span> _data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L70" class="LineNr"> 70 </span> <span class="PreProc">var</span> _data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L71" class="LineNr"> 71 </span> <span class="PreProc">var</span> data/<span class="Constant">edi</span>: (addr array grapheme) <span class="Special">&lt;-</span> copy _data
<span id="L72" class="LineNr"> 72 </span> <span class="PreProc">var</span> top-addr/<span class="Constant">ecx</span>: (addr int) <span class="Special">&lt;-</span> get src, top
<span id="L73" class="LineNr"> 73 </span> <span class="PreProc">var</span> i/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
@ -147,7 +147,7 @@ if ('onhashchange' in window) {
<span id="L88" class="LineNr"> 88 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special">&lt;-</span> copy _self
<span id="L89" class="LineNr"> 89 </span> <span class="PreProc">var</span> matching-open-paren-index/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> <a href='grapheme-stack.mu.html#L434'>get-matching-open-paren-index</a> self, <a href='gap-buffer.mu.html#L677'>highlight-matching-open-paren?</a>, open-paren-depth
<span id="L90" class="LineNr"> 90 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">edi</span>: (addr handle array grapheme) <span class="Special">&lt;-</span> get self, data
<span id="L91" class="LineNr"> 91 </span> <span class="PreProc">var</span> _data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L91" class="LineNr"> 91 </span> <span class="PreProc">var</span> _data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L92" class="LineNr"> 92 </span> <span class="PreProc">var</span> data/<span class="Constant">edi</span>: (addr array grapheme) <span class="Special">&lt;-</span> copy _data
<span id="L93" class="LineNr"> 93 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy _x
<span id="L94" class="LineNr"> 94 </span> <span class="PreProc">var</span> y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy _y
@ -198,7 +198,7 @@ if ('onhashchange' in window) {
<span id="L139" class="LineNr">139 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special">&lt;-</span> copy _self
<span id="L140" class="LineNr">140 </span> <span class="PreProc">var</span> matching-close-paren-index/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> <a href='grapheme-stack.mu.html#L378'>get-matching-close-paren-index</a> self, render-cursor?
<span id="L141" class="LineNr">141 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">eax</span>: (addr handle array grapheme) <span class="Special">&lt;-</span> get self, data
<span id="L142" class="LineNr">142 </span> <span class="PreProc">var</span> _data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L142" class="LineNr">142 </span> <span class="PreProc">var</span> _data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L143" class="LineNr">143 </span> <span class="PreProc">var</span> data/<span class="Constant">edi</span>: (addr array grapheme) <span class="Special">&lt;-</span> copy _data
<span id="L144" class="LineNr">144 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy _x
<span id="L145" class="LineNr">145 </span> <span class="PreProc">var</span> y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy _y
@ -444,7 +444,7 @@ if ('onhashchange' in window) {
<span id="L385" class="LineNr">385 </span> <span class="PreProc">return</span> *top-addr
<span id="L386" class="LineNr">386 </span> <span class="Delimiter">}</span>
<span id="L387" class="LineNr">387 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">eax</span>: (addr handle array grapheme) <span class="Special">&lt;-</span> get self, data
<span id="L388" class="LineNr">388 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L388" class="LineNr">388 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L389" class="LineNr">389 </span> <span class="PreProc">var</span> i/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy *top-addr
<span id="L390" class="LineNr">390 </span> <span class="muComment"># if stack is empty, return</span>
<span id="L391" class="LineNr">391 </span> compare i, <span class="Constant">0</span>
@ -500,7 +500,7 @@ if ('onhashchange' in window) {
<span id="L441" class="LineNr">441 </span> <span class="PreProc">return</span> *top-addr
<span id="L442" class="LineNr">442 </span> <span class="Delimiter">}</span>
<span id="L443" class="LineNr">443 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">eax</span>: (addr handle array grapheme) <span class="Special">&lt;-</span> get self, data
<span id="L444" class="LineNr">444 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L444" class="LineNr">444 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L445" class="LineNr">445 </span> <span class="PreProc">var</span> i/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy *top-addr
<span id="L446" class="LineNr">446 </span> <span class="muComment"># if stack is empty, return</span>
<span id="L447" class="LineNr">447 </span> compare i, <span class="Constant">0</span>
@ -541,7 +541,7 @@ if ('onhashchange' in window) {
<span id="L482" class="LineNr">482 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='grapheme-stack.mu.html#L482'>prefix-match?</a></span> _self: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>), s: (addr stream byte)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean <span class="Delimiter">{</span>
<span id="L483" class="LineNr">483 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special">&lt;-</span> copy _self
<span id="L484" class="LineNr">484 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">edi</span>: (addr handle array grapheme) <span class="Special">&lt;-</span> get self, data
<span id="L485" class="LineNr">485 </span> <span class="PreProc">var</span> _data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L485" class="LineNr">485 </span> <span class="PreProc">var</span> _data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L486" class="LineNr">486 </span> <span class="PreProc">var</span> data/<span class="Constant">edi</span>: (addr array grapheme) <span class="Special">&lt;-</span> copy _data
<span id="L487" class="LineNr">487 </span> <span class="PreProc">var</span> top-addr/<span class="Constant">ecx</span>: (addr int) <span class="Special">&lt;-</span> get self, top
<span id="L488" class="LineNr">488 </span> <span class="PreProc">var</span> i/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
@ -569,7 +569,7 @@ if ('onhashchange' in window) {
<span id="L510" class="LineNr">510 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='grapheme-stack.mu.html#L510'>suffix-match?</a></span> _self: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>), s: (addr stream byte)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean <span class="Delimiter">{</span>
<span id="L511" class="LineNr">511 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special">&lt;-</span> copy _self
<span id="L512" class="LineNr">512 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">edi</span>: (addr handle array grapheme) <span class="Special">&lt;-</span> get self, data
<span id="L513" class="LineNr">513 </span> <span class="PreProc">var</span> _data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L513" class="LineNr">513 </span> <span class="PreProc">var</span> _data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L514" class="LineNr">514 </span> <span class="PreProc">var</span> data/<span class="Constant">edi</span>: (addr array grapheme) <span class="Special">&lt;-</span> copy _data
<span id="L515" class="LineNr">515 </span> <span class="PreProc">var</span> top-addr/<span class="Constant">eax</span>: (addr int) <span class="Special">&lt;-</span> get self, top
<span id="L516" class="LineNr">516 </span> <span class="PreProc">var</span> i/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy *top-addr
@ -596,7 +596,7 @@ if ('onhashchange' in window) {
<span id="L537" class="LineNr">537 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='grapheme-stack.mu.html#L537'>grapheme-stack-is-decimal-integer?</a></span> _self: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean <span class="Delimiter">{</span>
<span id="L538" class="LineNr">538 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special">&lt;-</span> copy _self
<span id="L539" class="LineNr">539 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">eax</span>: (addr handle array grapheme) <span class="Special">&lt;-</span> get self, data
<span id="L540" class="LineNr">540 </span> <span class="PreProc">var</span> _data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L540" class="LineNr">540 </span> <span class="PreProc">var</span> _data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L541" class="LineNr">541 </span> <span class="PreProc">var</span> data/<span class="Constant">edx</span>: (addr array grapheme) <span class="Special">&lt;-</span> copy _data
<span id="L542" class="LineNr">542 </span> <span class="PreProc">var</span> top-addr/<span class="Constant">ecx</span>: (addr int) <span class="Special">&lt;-</span> get self, top
<span id="L543" class="LineNr">543 </span> <span class="PreProc">var</span> i/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
@ -605,7 +605,7 @@ if ('onhashchange' in window) {
<span id="L546" class="LineNr">546 </span> compare i, *top-addr
<span id="L547" class="LineNr">547 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L548" class="LineNr">548 </span> <span class="PreProc">var</span> g/<span class="Constant">edx</span>: (addr grapheme) <span class="Special">&lt;-</span> index data, i
<span id="L549" class="LineNr">549 </span> result <span class="Special">&lt;-</span> <a href='../126write-int-decimal.subx.html#L299'>decimal-digit?</a> *g
<span id="L549" class="LineNr">549 </span> result <span class="Special">&lt;-</span> <a href='../126write-int-decimal.subx.html#L296'>decimal-digit?</a> *g
<span id="L550" class="LineNr">550 </span> compare result, <span class="Constant">0</span>/false
<span id="L551" class="LineNr">551 </span> <span class="PreProc">break-if-=</span>
<span id="L552" class="LineNr">552 </span> i <span class="Special">&lt;-</span> increment

428
html/shell/macroexpand.mu.html generated Normal file
View File

@ -0,0 +1,428 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Mu - shell/macroexpand.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="colorscheme" content="minimal-dark">
<style type="text/css">
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #a8a8a8; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #a8a8a8; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.Special { color: #ff6060; }
.LineNr { }
.CommentedCode { color: #8a8a8a; }
.Constant { color: #008787; }
.muComment { color: #005faf; }
.Delimiter { color: #c000c0; }
.muFunction { color: #af5f00; text-decoration: underline; }
.muTest { color: #5f8700; }
.Folded { color: #080808; background-color: #949494; }
-->
</style>
<script type='text/javascript'>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
function JumpToLine()
{
var lineNum;
lineNum = window.location.hash;
lineNum = lineNum.substr(1); /* strip off '#' */
if (lineNum.indexOf('L') == -1) {
lineNum = 'L'+lineNum;
}
var lineElem = document.getElementById(lineNum);
/* Always jump to new location even if the line was hidden inside a fold, or
* we corrected the raw number to a line ID.
*/
if (lineElem) {
lineElem.scrollIntoView(true);
}
return true;
}
if ('onhashchange' in window) {
window.onhashchange = JumpToLine;
}
-->
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/main/shell/macroexpand.mu'>https://github.com/akkartik/mu/blob/main/shell/macroexpand.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='macroexpand.mu.html#L1'>macroexpand</a></span> expr-ah: (addr handle <a href='cell.mu.html#L1'>cell</a>), globals: (addr <a href='global.mu.html#L7'>global-table</a>), trace: (addr trace) <span class="Delimiter">{</span>
<span id="L2" class="Folded"> 2 </span><span class="Folded">+-- 11 lines: # trace &quot;macroexpand &quot; expr-ah --------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="L13" class="LineNr"> 13 </span> <span class="muComment"># loop until convergence</span>
<span id="L14" class="LineNr"> 14 </span> <span class="Delimiter">{</span>
<span id="L15" class="LineNr"> 15 </span> <span class="PreProc">var</span> expanded?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='macroexpand.mu.html#L33'>macroexpand-iter</a> expr-ah, globals, trace
<span id="L16" class="LineNr"> 16 </span> compare expanded?, <span class="Constant">0</span>/false
<span id="L17" class="LineNr"> 17 </span> <span class="PreProc">loop-if-!=</span>
<span id="L18" class="LineNr"> 18 </span> <span class="Delimiter">}</span>
<span id="L19" class="Folded"> 19 </span><span class="Folded">+-- 11 lines: # trace &quot;=&gt; &quot; expr-ah -----------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="L30" class="LineNr"> 30 </span><span class="Delimiter">}</span>
<span id="L31" class="LineNr"> 31 </span>
<span id="L32" class="LineNr"> 32 </span><span class="muComment"># return true if we found any macros</span>
<span id="L33" class="LineNr"> 33 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='macroexpand.mu.html#L33'>macroexpand-iter</a></span> _expr-ah: (addr handle <a href='cell.mu.html#L1'>cell</a>), globals: (addr <a href='global.mu.html#L7'>global-table</a>), trace: (addr trace)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean <span class="Delimiter">{</span>
<span id="L34" class="LineNr"> 34 </span> <span class="PreProc">var</span> expr-ah/<span class="Constant">esi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _expr-ah
<span id="L35" class="Folded"> 35 </span><span class="Folded">+-- 11 lines: # trace &quot;macroexpand-iter &quot; expr ------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="L46" class="LineNr"> 46 </span> <span class="muComment"># if expr is a non-pair, return</span>
<span id="L47" class="LineNr"> 47 </span> <span class="PreProc">var</span> expr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *expr-ah
<span id="L48" class="LineNr"> 48 </span> <span class="Delimiter">{</span>
<span id="L49" class="LineNr"> 49 </span> <span class="PreProc">var</span> <a href='print.mu.html#L236'>nil?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='print.mu.html#L236'>nil?</a> expr
<span id="L50" class="LineNr"> 50 </span> compare <a href='print.mu.html#L236'>nil?</a>, <span class="Constant">0</span>/false
<span id="L51" class="LineNr"> 51 </span> <span class="PreProc">break-if-=</span>
<span id="L52" class="LineNr"> 52 </span> <span class="muComment"># nil is a literal</span>
<span id="L53" class="LineNr"> 53 </span> <a href='trace.mu.html#L120'>trace-text</a> trace, <span class="Constant">&quot;mac&quot;</span>, <span class="Constant">&quot;nil&quot;</span>
<span id="L54" class="LineNr"> 54 </span> <a href='trace.mu.html#L155'>trace-higher</a> trace
<span id="L55" class="LineNr"> 55 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L56" class="LineNr"> 56 </span> <span class="Delimiter">}</span>
<span id="L57" class="LineNr"> 57 </span> <span class="Delimiter">{</span>
<span id="L58" class="LineNr"> 58 </span> <span class="PreProc">var</span> expr-type/<span class="Constant">eax</span>: (addr int) <span class="Special">&lt;-</span> get expr, <span class="PreProc">type</span>
<span id="L59" class="LineNr"> 59 </span> compare *expr-type, <span class="Constant">0</span>/pair
<span id="L60" class="LineNr"> 60 </span> <span class="PreProc">break-if-=</span>
<span id="L61" class="LineNr"> 61 </span> <span class="muComment"># non-pairs are literals</span>
<span id="L62" class="LineNr"> 62 </span> <a href='trace.mu.html#L120'>trace-text</a> trace, <span class="Constant">&quot;mac&quot;</span>, <span class="Constant">&quot;non-pair&quot;</span>
<span id="L63" class="LineNr"> 63 </span> <a href='trace.mu.html#L155'>trace-higher</a> trace
<span id="L64" class="LineNr"> 64 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L65" class="LineNr"> 65 </span> <span class="Delimiter">}</span>
<span id="L66" class="LineNr"> 66 </span> <span class="muComment"># if expr is a literal pair, return</span>
<span id="L67" class="LineNr"> 67 </span> <span class="PreProc">var</span> first-ah/<span class="Constant">ebx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get expr, left
<span id="L68" class="LineNr"> 68 </span> <span class="PreProc">var</span> rest-ah/<span class="Constant">ecx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get expr, right
<span id="L69" class="LineNr"> 69 </span> <span class="PreProc">var</span> first/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *first-ah
<span id="L70" class="LineNr"> 70 </span> <span class="Delimiter">{</span>
<span id="L71" class="LineNr"> 71 </span> <span class="PreProc">var</span> <a href='evaluate.mu.html#L1221'>litfn?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='evaluate.mu.html#L1221'>litfn?</a> first
<span id="L72" class="LineNr"> 72 </span> compare <a href='evaluate.mu.html#L1221'>litfn?</a>, <span class="Constant">0</span>/false
<span id="L73" class="LineNr"> 73 </span> <span class="PreProc">break-if-=</span>
<span id="L74" class="LineNr"> 74 </span> <span class="muComment"># litfn is a literal</span>
<span id="L75" class="LineNr"> 75 </span> <a href='trace.mu.html#L120'>trace-text</a> trace, <span class="Constant">&quot;mac&quot;</span>, <span class="Constant">&quot;literal function&quot;</span>
<span id="L76" class="LineNr"> 76 </span> <a href='trace.mu.html#L155'>trace-higher</a> trace
<span id="L77" class="LineNr"> 77 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L78" class="LineNr"> 78 </span> <span class="Delimiter">}</span>
<span id="L79" class="LineNr"> 79 </span> <span class="Delimiter">{</span>
<span id="L80" class="LineNr"> 80 </span> <span class="PreProc">var</span> <a href='evaluate.mu.html#L1235'>litmac?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='evaluate.mu.html#L1235'>litmac?</a> first
<span id="L81" class="LineNr"> 81 </span> compare <a href='evaluate.mu.html#L1235'>litmac?</a>, <span class="Constant">0</span>/false
<span id="L82" class="LineNr"> 82 </span> <span class="PreProc">break-if-=</span>
<span id="L83" class="LineNr"> 83 </span> <span class="muComment"># litmac is a literal</span>
<span id="L84" class="LineNr"> 84 </span> <a href='trace.mu.html#L120'>trace-text</a> trace, <span class="Constant">&quot;mac&quot;</span>, <span class="Constant">&quot;literal macro&quot;</span>
<span id="L85" class="LineNr"> 85 </span> <a href='trace.mu.html#L155'>trace-higher</a> trace
<span id="L86" class="LineNr"> 86 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L87" class="LineNr"> 87 </span> <span class="Delimiter">}</span>
<span id="L88" class="LineNr"> 88 </span> <span class="PreProc">var</span> result/<span class="Constant">edi</span>: boolean <span class="Special">&lt;-</span> copy <span class="Constant">0</span>/false
<span id="L89" class="LineNr"> 89 </span> <span class="muComment"># for each builtin, expand only what will later be evaluated</span>
<span id="L90" class="LineNr"> 90 </span> $macroexpand-iter:anonymous-function: <span class="Delimiter">{</span>
<span id="L91" class="LineNr"> 91 </span> <span class="PreProc">var</span> <a href='evaluate.mu.html#L1207'>fn?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='evaluate.mu.html#L1207'>fn?</a> first
<span id="L92" class="LineNr"> 92 </span> compare <a href='evaluate.mu.html#L1207'>fn?</a>, <span class="Constant">0</span>/false
<span id="L93" class="LineNr"> 93 </span> <span class="PreProc">break-if-=</span>
<span id="L94" class="LineNr"> 94 </span> <span class="muComment"># fn: expand every expression in the body</span>
<span id="L95" class="LineNr"> 95 </span> <a href='trace.mu.html#L120'>trace-text</a> trace, <span class="Constant">&quot;mac&quot;</span>, <span class="Constant">&quot;anonymous function&quot;</span>
<span id="L96" class="LineNr"> 96 </span> <span class="muComment"># skip parameters</span>
<span id="L97" class="LineNr"> 97 </span> <span class="PreProc">var</span> rest/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *rest-ah
<span id="L98" class="LineNr"> 98 </span> <span class="Delimiter">{</span>
<span id="L99" class="LineNr"> 99 </span> rest-ah <span class="Special">&lt;-</span> get rest, right
<span id="L100" class="LineNr">100 </span> rest <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *rest-ah
<span id="L101" class="LineNr">101 </span> <span class="Delimiter">{</span>
<span id="L102" class="LineNr">102 </span> <span class="PreProc">var</span> done?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='print.mu.html#L236'>nil?</a> rest
<span id="L103" class="LineNr">103 </span> compare done?, <span class="Constant">0</span>/false
<span id="L104" class="LineNr">104 </span> <span class="Delimiter">}</span>
<span id="L105" class="LineNr">105 </span> <span class="PreProc">break-if-!=</span>
<span id="L106" class="LineNr">106 </span> <span class="PreProc">var</span> curr-ah/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get rest, left
<span id="L107" class="LineNr">107 </span> <span class="PreProc">var</span> macro-found?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='macroexpand.mu.html#L33'>macroexpand-iter</a> curr-ah, globals, trace
<span id="L108" class="LineNr">108 </span> result <span class="Special">&lt;-</span> or macro-found?
<span id="L109" class="LineNr">109 </span> <span class="PreProc">loop</span>
<span id="L110" class="LineNr">110 </span> <span class="Delimiter">}</span>
<span id="L111" class="LineNr">111 </span> <a href='trace.mu.html#L155'>trace-higher</a> trace
<span id="L112" class="LineNr">112 </span> <span class="PreProc">return</span> result
<span id="L113" class="LineNr">113 </span> <span class="Delimiter">}</span>
<span id="L114" class="LineNr">114 </span> <span class="muComment"># builtins with &quot;special&quot; evaluation rules</span>
<span id="L115" class="LineNr">115 </span> $macroexpand-iter:quote: <span class="Delimiter">{</span>
<span id="L116" class="LineNr">116 </span> <span class="muComment"># trees starting with single quote create literals</span>
<span id="L117" class="LineNr">117 </span> <span class="PreProc">var</span> quote?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='cell.mu.html#L44'>symbol-equal?</a> first, <span class="Constant">&quot;'&quot;</span>
<span id="L118" class="LineNr">118 </span> compare quote?, <span class="Constant">0</span>/false
<span id="L119" class="LineNr">119 </span> <span class="PreProc">break-if-=</span>
<span id="L120" class="LineNr">120 </span> <span class="muComment">#</span>
<span id="L121" class="LineNr">121 </span> <a href='trace.mu.html#L120'>trace-text</a> trace, <span class="Constant">&quot;mac&quot;</span>, <span class="Constant">&quot;quote&quot;</span>
<span id="L122" class="LineNr">122 </span> <a href='trace.mu.html#L155'>trace-higher</a> trace
<span id="L123" class="LineNr">123 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L124" class="LineNr">124 </span> <span class="Delimiter">}</span>
<span id="L125" class="LineNr">125 </span> $macroexpand-iter:backquote: <span class="Delimiter">{</span>
<span id="L126" class="LineNr">126 </span> <span class="muComment"># nested backquote not supported for now</span>
<span id="L127" class="LineNr">127 </span> <span class="PreProc">var</span> backquote?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='cell.mu.html#L44'>symbol-equal?</a> first, <span class="Constant">&quot;`&quot;</span>
<span id="L128" class="LineNr">128 </span> compare backquote?, <span class="Constant">0</span>/false
<span id="L129" class="LineNr">129 </span> <span class="PreProc">break-if-=</span>
<span id="L130" class="LineNr">130 </span> <span class="muComment">#</span>
<span id="L131" class="LineNr">131 </span> <span class="Special"><a href='trace.mu.html#L129'>error</a></span> trace, <span class="Constant">&quot;nested backquote not supported yet&quot;</span>
<span id="L132" class="LineNr">132 </span> <a href='trace.mu.html#L155'>trace-higher</a> trace
<span id="L133" class="LineNr">133 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L134" class="LineNr">134 </span> <span class="Delimiter">}</span>
<span id="L135" class="LineNr">135 </span> $macroexpand-iter:def: <span class="Delimiter">{</span>
<span id="L136" class="LineNr">136 </span> <span class="muComment"># trees starting with &quot;def&quot; define globals</span>
<span id="L137" class="LineNr">137 </span> <span class="PreProc">var</span> def?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='cell.mu.html#L44'>symbol-equal?</a> first, <span class="Constant">&quot;def&quot;</span>
<span id="L138" class="LineNr">138 </span> compare def?, <span class="Constant">0</span>/false
<span id="L139" class="LineNr">139 </span> <span class="PreProc">break-if-=</span>
<span id="L140" class="LineNr">140 </span> <span class="muComment">#</span>
<span id="L141" class="LineNr">141 </span> <a href='trace.mu.html#L120'>trace-text</a> trace, <span class="Constant">&quot;mac&quot;</span>, <span class="Constant">&quot;def&quot;</span>
<span id="L142" class="LineNr">142 </span> <span class="PreProc">var</span> rest/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *rest-ah
<span id="L143" class="LineNr">143 </span> rest-ah <span class="Special">&lt;-</span> get rest, right <span class="muComment"># skip name</span>
<span id="L144" class="LineNr">144 </span> rest <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *rest-ah
<span id="L145" class="LineNr">145 </span> <span class="PreProc">var</span> val-ah/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get rest, left
<span id="L146" class="LineNr">146 </span> <span class="PreProc">var</span> macro-found?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='macroexpand.mu.html#L33'>macroexpand-iter</a> val-ah, globals, trace
<span id="L147" class="LineNr">147 </span> <a href='trace.mu.html#L155'>trace-higher</a> trace
<span id="L148" class="LineNr">148 </span> <span class="PreProc">return</span> macro-found?
<span id="L149" class="LineNr">149 </span> <span class="Delimiter">}</span>
<span id="L150" class="LineNr">150 </span> $macroexpand-iter:set: <span class="Delimiter">{</span>
<span id="L151" class="LineNr">151 </span> <span class="muComment"># trees starting with &quot;set&quot; mutate bindings</span>
<span id="L152" class="LineNr">152 </span> <span class="PreProc">var</span> set?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='cell.mu.html#L44'>symbol-equal?</a> first, <span class="Constant">&quot;set&quot;</span>
<span id="L153" class="LineNr">153 </span> compare set?, <span class="Constant">0</span>/false
<span id="L154" class="LineNr">154 </span> <span class="PreProc">break-if-=</span>
<span id="L155" class="LineNr">155 </span> <span class="muComment">#</span>
<span id="L156" class="LineNr">156 </span> <a href='trace.mu.html#L120'>trace-text</a> trace, <span class="Constant">&quot;mac&quot;</span>, <span class="Constant">&quot;set&quot;</span>
<span id="L157" class="LineNr">157 </span> <span class="PreProc">var</span> rest/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *rest-ah
<span id="L158" class="LineNr">158 </span> rest-ah <span class="Special">&lt;-</span> get rest, right <span class="muComment"># skip name</span>
<span id="L159" class="LineNr">159 </span> rest <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *rest-ah
<span id="L160" class="LineNr">160 </span> <span class="PreProc">var</span> val-ah/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get rest, left
<span id="L161" class="LineNr">161 </span> <span class="PreProc">var</span> macro-found?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='macroexpand.mu.html#L33'>macroexpand-iter</a> val-ah, globals, trace
<span id="L162" class="LineNr">162 </span> <a href='trace.mu.html#L155'>trace-higher</a> trace
<span id="L163" class="LineNr">163 </span> <span class="PreProc">return</span> macro-found?
<span id="L164" class="LineNr">164 </span> <span class="Delimiter">}</span>
<span id="L165" class="LineNr">165 </span> <span class="muComment"># 'and' is like a function for macroexpansion purposes</span>
<span id="L166" class="LineNr">166 </span> <span class="muComment"># 'or' is like a function for macroexpansion purposes</span>
<span id="L167" class="LineNr">167 </span> <span class="muComment"># 'if' is like a function for macroexpansion purposes</span>
<span id="L168" class="LineNr">168 </span> <span class="muComment"># 'while' is like a function for macroexpansion purposes</span>
<span id="L169" class="LineNr">169 </span> <span class="muComment"># if car(expr) is a symbol defined as a macro, expand it</span>
<span id="L170" class="LineNr">170 </span> <span class="Delimiter">{</span>
<span id="L171" class="LineNr">171 </span> <span class="PreProc">var</span> definition-h: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L172" class="LineNr">172 </span> <span class="PreProc">var</span> definition-ah/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address definition-h
<span id="L173" class="LineNr">173 </span> <a href='global.mu.html#L401'>maybe-lookup-symbol-in-globals</a> first, definition-ah, globals, trace
<span id="L174" class="LineNr">174 </span> <span class="PreProc">var</span> definition/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *definition-ah
<span id="L175" class="LineNr">175 </span> compare definition, <span class="Constant">0</span>
<span id="L176" class="LineNr">176 </span> <span class="PreProc">break-if-=</span>
<span id="L177" class="LineNr">177 </span> <span class="muComment"># definition found</span>
<span id="L178" class="LineNr">178 </span> <span class="Delimiter">{</span>
<span id="L179" class="LineNr">179 </span> <span class="PreProc">var</span> definition-type/<span class="Constant">eax</span>: (addr int) <span class="Special">&lt;-</span> get definition, <span class="PreProc">type</span>
<span id="L180" class="LineNr">180 </span> compare *definition-type, <span class="Constant">0</span>/pair
<span id="L181" class="LineNr">181 </span> <span class="Delimiter">}</span>
<span id="L182" class="LineNr">182 </span> <span class="PreProc">break-if-!=</span>
<span id="L183" class="LineNr">183 </span> <span class="muComment"># definition is a pair</span>
<span id="L184" class="LineNr">184 </span> <span class="Delimiter">{</span>
<span id="L185" class="LineNr">185 </span> <span class="PreProc">var</span> definition-car-ah/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get definition, left
<span id="L186" class="LineNr">186 </span> <span class="PreProc">var</span> definition-car/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *definition-car-ah
<span id="L187" class="LineNr">187 </span> <span class="PreProc">var</span> macro?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='evaluate.mu.html#L1235'>litmac?</a> definition-car
<span id="L188" class="LineNr">188 </span> compare macro?, <span class="Constant">0</span>/false
<span id="L189" class="LineNr">189 </span> <span class="Delimiter">}</span>
<span id="L190" class="LineNr">190 </span> <span class="PreProc">break-if-=</span>
<span id="L191" class="LineNr">191 </span> <span class="muComment"># definition is a macro</span>
<span id="L192" class="LineNr">192 </span> <span class="PreProc">var</span> macro-definition-ah/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get definition, right
<span id="L193" class="LineNr">193 </span> <span class="muComment"># TODO: check car(macro-definition) is litfn</span>
<span id="L194" class="LineNr">194 </span><span class="CommentedCode">#? turn-on-debug-print</span>
<span id="L195" class="LineNr">195 </span> <a href='evaluate.mu.html#L517'>apply</a> macro-definition-ah, rest-ah, expr-ah, globals, trace, <span class="Constant">0</span>/no-screen, <span class="Constant">0</span>/no-keyboard, <span class="Constant">0</span>/call-number
<span id="L196" class="LineNr">196 </span> <span class="PreProc">return</span> <span class="Constant">1</span>/true
<span id="L197" class="LineNr">197 </span> <span class="Delimiter">}</span>
<span id="L198" class="LineNr">198 </span> <span class="muComment"># no macro found; process any macros within args</span>
<span id="L199" class="LineNr">199 </span> <a href='trace.mu.html#L120'>trace-text</a> trace, <span class="Constant">&quot;mac&quot;</span>, <span class="Constant">&quot;recursing into function definition&quot;</span>
<span id="L200" class="LineNr">200 </span> <span class="PreProc">var</span> curr-ah/<span class="Constant">ebx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy first-ah
<span id="L201" class="LineNr">201 </span> $macroexpand-iter:<span class="PreProc">loop</span>: <span class="Delimiter">{</span>
<span id="L202" class="LineNr">202 </span><span class="CommentedCode">#? clear-screen 0/screen</span>
<span id="L203" class="LineNr">203 </span><span class="CommentedCode">#? dump-trace trace</span>
<span id="L204" class="LineNr">204 </span> <span class="PreProc">var</span> macro-found?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='macroexpand.mu.html#L33'>macroexpand-iter</a> curr-ah, globals, trace
<span id="L205" class="LineNr">205 </span> result <span class="Special">&lt;-</span> or macro-found?
<span id="L206" class="LineNr">206 </span> <span class="PreProc">var</span> rest/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *rest-ah
<span id="L207" class="LineNr">207 </span> <span class="Delimiter">{</span>
<span id="L208" class="LineNr">208 </span> <span class="PreProc">var</span> <a href='print.mu.html#L236'>nil?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='print.mu.html#L236'>nil?</a> rest
<span id="L209" class="LineNr">209 </span> compare <a href='print.mu.html#L236'>nil?</a>, <span class="Constant">0</span>/false
<span id="L210" class="LineNr">210 </span> <span class="Delimiter">}</span>
<span id="L211" class="LineNr">211 </span> <span class="PreProc">break-if-!=</span>
<span id="L212" class="LineNr">212 </span> curr-ah <span class="Special">&lt;-</span> get rest, left
<span id="L213" class="LineNr">213 </span> rest-ah <span class="Special">&lt;-</span> get rest, right
<span id="L214" class="LineNr">214 </span> <span class="PreProc">loop</span>
<span id="L215" class="LineNr">215 </span> <span class="Delimiter">}</span>
<span id="L216" class="LineNr">216 </span> <span class="PreProc">return</span> result
<span id="L217" class="LineNr">217 </span><span class="Delimiter">}</span>
<span id="L218" class="LineNr">218 </span>
<span id="L219" class="LineNr">219 </span><span class="PreProc">fn</span> <span class="muTest"><a href='macroexpand.mu.html#L219'>test-macroexpand</a></span> <span class="Delimiter">{</span>
<span id="L220" class="LineNr">220 </span> <span class="PreProc">var</span> globals-storage: <a href='global.mu.html#L7'>global-table</a>
<span id="L221" class="LineNr">221 </span> <span class="PreProc">var</span> globals/<span class="Constant">edx</span>: (addr <a href='global.mu.html#L7'>global-table</a>) <span class="Special">&lt;-</span> address globals-storage
<span id="L222" class="LineNr">222 </span> <a href='global.mu.html#L12'>initialize-globals</a> globals
<span id="L223" class="LineNr">223 </span> <span class="muComment"># new macro: m</span>
<span id="L224" class="LineNr">224 </span> <span class="PreProc">var</span> sandbox-storage: <a href='sandbox.mu.html#L1'>sandbox</a>
<span id="L225" class="LineNr">225 </span> <span class="PreProc">var</span> <a href='sandbox.mu.html#L1'>sandbox</a>/<span class="Constant">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> address sandbox-storage
<span id="L226" class="LineNr">226 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">&quot;(def m (litmac litfn () (a b) `(+ ,a ,b)))&quot;</span>
<span id="L227" class="LineNr">227 </span> <a href='sandbox.mu.html#L460'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0x13</span>/ctrl-s, globals, <span class="Constant">0</span>/no-disk, <span class="Constant">0</span>/no-screen, <span class="Constant">0</span>/no-tweak-screen
<span id="L228" class="LineNr">228 </span> <span class="PreProc">var</span> trace-ah/<span class="Constant">eax</span>: (addr handle trace) <span class="Special">&lt;-</span> get <a href='sandbox.mu.html#L1'>sandbox</a>, trace
<span id="L229" class="LineNr">229 </span> <span class="PreProc">var</span> trace/<span class="Constant">eax</span>: (addr trace) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *trace-ah
<span id="L230" class="LineNr">230 </span> <span class="muComment"># invoke macro</span>
<span id="L231" class="LineNr">231 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">&quot;(m 3 4)&quot;</span>
<span id="L232" class="LineNr">232 </span> <span class="PreProc">var</span> gap-ah/<span class="Constant">ecx</span>: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> get <a href='sandbox.mu.html#L1'>sandbox</a>, data
<span id="L233" class="LineNr">233 </span> <span class="PreProc">var</span> gap/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *gap-ah
<span id="L234" class="LineNr">234 </span> <span class="PreProc">var</span> result-h: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L235" class="LineNr">235 </span> <span class="PreProc">var</span> result-ah/<span class="Constant">ebx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address result-h
<span id="L236" class="LineNr">236 </span> <a href='read.mu.html#L1'>read-cell</a> gap, result-ah, <span class="Constant">0</span>/no-trace
<span id="L237" class="LineNr">237 </span> <span class="PreProc">var</span> dummy/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='macroexpand.mu.html#L33'>macroexpand-iter</a> result-ah, globals, <span class="Constant">0</span>/no-trace
<span id="L238" class="LineNr">238 </span><span class="CommentedCode">#? dump-cell-from-cursor-over-full-screen result-ah</span>
<span id="L239" class="LineNr">239 </span> <span class="PreProc">var</span> _result/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *result-ah
<span id="L240" class="LineNr">240 </span> <span class="PreProc">var</span> result/<span class="Constant">edi</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _result
<span id="L241" class="LineNr">241 </span> <span class="muComment"># expected</span>
<span id="L242" class="LineNr">242 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">&quot;(+ 3 4)&quot;</span>
<span id="L243" class="LineNr">243 </span> <span class="PreProc">var</span> expected-gap-ah/<span class="Constant">ecx</span>: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> get <a href='sandbox.mu.html#L1'>sandbox</a>, data
<span id="L244" class="LineNr">244 </span> <span class="PreProc">var</span> expected-gap/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *expected-gap-ah
<span id="L245" class="LineNr">245 </span> <span class="PreProc">var</span> expected-h: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L246" class="LineNr">246 </span> <span class="PreProc">var</span> expected-ah/<span class="Constant">ecx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address expected-h
<span id="L247" class="LineNr">247 </span> <a href='read.mu.html#L1'>read-cell</a> expected-gap, expected-ah, <span class="Constant">0</span>/no-trace
<span id="L248" class="LineNr">248 </span><span class="CommentedCode">#? dump-cell-from-cursor-over-full-screen expected-ah</span>
<span id="L249" class="LineNr">249 </span> <span class="PreProc">var</span> expected/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *expected-ah
<span id="L250" class="LineNr">250 </span> <span class="muComment">#</span>
<span id="L251" class="LineNr">251 </span> <span class="PreProc">var</span> assertion/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='evaluate.mu.html#L1037'>cell-isomorphic?</a> result, expected, <span class="Constant">0</span>/no-trace
<span id="L252" class="LineNr">252 </span> <a href='../502test.mu.html#L19'>check</a> assertion, <span class="Constant">&quot;F - test-macroexpand&quot;</span>
<span id="L253" class="LineNr">253 </span><span class="Delimiter">}</span>
<span id="L254" class="LineNr">254 </span>
<span id="L255" class="LineNr">255 </span><span class="PreProc">fn</span> <span class="muTest"><a href='macroexpand.mu.html#L255'>test-macroexpand-inside-anonymous-fn</a></span> <span class="muFunction">{</span>
<span id="L256" class="LineNr">256 </span> <span class="PreProc">var</span> globals-storage: <a href='global.mu.html#L7'>global-table</a>
<span id="L257" class="LineNr">257 </span> <span class="PreProc">var</span> globals/<span class="Constant">edx</span>: (addr <a href='global.mu.html#L7'>global-table</a>) <span class="Special">&lt;-</span> address globals-storage
<span id="L258" class="LineNr">258 </span> <a href='global.mu.html#L12'>initialize-globals</a> globals
<span id="L259" class="LineNr">259 </span> <span class="muComment"># new macro: m</span>
<span id="L260" class="LineNr">260 </span> <span class="PreProc">var</span> sandbox-storage: <a href='sandbox.mu.html#L1'>sandbox</a>
<span id="L261" class="LineNr">261 </span> <span class="PreProc">var</span> <a href='sandbox.mu.html#L1'>sandbox</a>/<span class="Constant">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> address sandbox-storage
<span id="L262" class="LineNr">262 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">&quot;(def m (litmac litfn () (a b) `(+ ,a ,b)))&quot;</span>
<span id="L263" class="LineNr">263 </span> <a href='sandbox.mu.html#L460'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0x13</span>/ctrl-s, globals, <span class="Constant">0</span>/no-disk, <span class="Constant">0</span>/no-screen, <span class="Constant">0</span>/no-tweak-screen
<span id="L264" class="LineNr">264 </span> <span class="PreProc">var</span> trace-ah/<span class="Constant">eax</span>: (addr handle trace) <span class="Special">&lt;-</span> get <a href='sandbox.mu.html#L1'>sandbox</a>, trace
<span id="L265" class="LineNr">265 </span> <span class="PreProc">var</span> trace/<span class="Constant">eax</span>: (addr trace) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *trace-ah
<span id="L266" class="LineNr">266 </span> <span class="muComment"># invoke macro</span>
<span id="L267" class="LineNr">267 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">&quot;(fn() (m 3 4))&quot;</span>
<span id="L268" class="LineNr">268 </span> <span class="PreProc">var</span> gap-ah/<span class="Constant">ecx</span>: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> get <a href='sandbox.mu.html#L1'>sandbox</a>, data
<span id="L269" class="LineNr">269 </span> <span class="PreProc">var</span> gap/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *gap-ah
<span id="L270" class="LineNr">270 </span> <span class="PreProc">var</span> result-h: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L271" class="LineNr">271 </span> <span class="PreProc">var</span> result-ah/<span class="Constant">ebx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address result-h
<span id="L272" class="LineNr">272 </span> <a href='read.mu.html#L1'>read-cell</a> gap, result-ah, <span class="Constant">0</span>/no-trace
<span id="L273" class="LineNr">273 </span> <span class="PreProc">var</span> dummy/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='macroexpand.mu.html#L33'>macroexpand-iter</a> result-ah, globals, <span class="Constant">0</span>/no-trace
<span id="L274" class="LineNr">274 </span><span class="CommentedCode">#? dump-cell-from-cursor-over-full-screen result-ah</span>
<span id="L275" class="LineNr">275 </span> <span class="PreProc">var</span> _result/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *result-ah
<span id="L276" class="LineNr">276 </span> <span class="PreProc">var</span> result/<span class="Constant">edi</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _result
<span id="L277" class="LineNr">277 </span> <span class="muComment"># expected</span>
<span id="L278" class="LineNr">278 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">&quot;(fn() (+ 3 4))&quot;</span>
<span id="L279" class="LineNr">279 </span> <span class="PreProc">var</span> expected-gap-ah/<span class="Constant">ecx</span>: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> get <a href='sandbox.mu.html#L1'>sandbox</a>, data
<span id="L280" class="LineNr">280 </span> <span class="PreProc">var</span> expected-gap/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *expected-gap-ah
<span id="L281" class="LineNr">281 </span> <span class="PreProc">var</span> expected-h: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L282" class="LineNr">282 </span> <span class="PreProc">var</span> expected-ah/<span class="Constant">ecx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address expected-h
<span id="L283" class="LineNr">283 </span> <a href='read.mu.html#L1'>read-cell</a> expected-gap, expected-ah, <span class="Constant">0</span>/no-trace
<span id="L284" class="LineNr">284 </span><span class="CommentedCode">#? dump-cell-from-cursor-over-full-screen expected-ah</span>
<span id="L285" class="LineNr">285 </span> <span class="PreProc">var</span> expected/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *expected-ah
<span id="L286" class="LineNr">286 </span> <span class="muComment">#</span>
<span id="L287" class="LineNr">287 </span> <span class="PreProc">var</span> assertion/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='evaluate.mu.html#L1037'>cell-isomorphic?</a> result, expected, <span class="Constant">0</span>/no-trace
<span id="L288" class="LineNr">288 </span> <a href='../502test.mu.html#L19'>check</a> assertion, <span class="Constant">&quot;F - test-macroexpand-inside-anonymous-fn&quot;</span>
<span id="L289" class="LineNr">289 </span><span class="Delimiter">}</span>
<span id="L290" class="LineNr">290 </span>
<span id="L291" class="LineNr">291 </span><span class="PreProc">fn</span> <span class="muTest"><a href='macroexpand.mu.html#L291'>test-macroexpand-inside-fn-call</a></span> <span class="Delimiter">{</span>
<span id="L292" class="LineNr">292 </span> <span class="PreProc">var</span> globals-storage: <a href='global.mu.html#L7'>global-table</a>
<span id="L293" class="LineNr">293 </span> <span class="PreProc">var</span> globals/<span class="Constant">edx</span>: (addr <a href='global.mu.html#L7'>global-table</a>) <span class="Special">&lt;-</span> address globals-storage
<span id="L294" class="LineNr">294 </span> <a href='global.mu.html#L12'>initialize-globals</a> globals
<span id="L295" class="LineNr">295 </span> <span class="muComment"># new macro: m</span>
<span id="L296" class="LineNr">296 </span> <span class="PreProc">var</span> sandbox-storage: <a href='sandbox.mu.html#L1'>sandbox</a>
<span id="L297" class="LineNr">297 </span> <span class="PreProc">var</span> <a href='sandbox.mu.html#L1'>sandbox</a>/<span class="Constant">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> address sandbox-storage
<span id="L298" class="LineNr">298 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">&quot;(def m (litmac litfn () (a b) `(+ ,a ,b)))&quot;</span>
<span id="L299" class="LineNr">299 </span> <a href='sandbox.mu.html#L460'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0x13</span>/ctrl-s, globals, <span class="Constant">0</span>/no-disk, <span class="Constant">0</span>/no-screen, <span class="Constant">0</span>/no-tweak-screen
<span id="L300" class="LineNr">300 </span> <span class="muComment"># invoke macro</span>
<span id="L301" class="LineNr">301 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">&quot;((fn() (m 3 4)))&quot;</span>
<span id="L302" class="LineNr">302 </span> <span class="PreProc">var</span> gap-ah/<span class="Constant">ecx</span>: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> get <a href='sandbox.mu.html#L1'>sandbox</a>, data
<span id="L303" class="LineNr">303 </span> <span class="PreProc">var</span> gap/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *gap-ah
<span id="L304" class="LineNr">304 </span> <span class="PreProc">var</span> result-h: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L305" class="LineNr">305 </span> <span class="PreProc">var</span> result-ah/<span class="Constant">ebx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address result-h
<span id="L306" class="LineNr">306 </span> <a href='read.mu.html#L1'>read-cell</a> gap, result-ah, <span class="Constant">0</span>/no-trace
<span id="L307" class="LineNr">307 </span> <span class="PreProc">var</span> dummy/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='macroexpand.mu.html#L33'>macroexpand-iter</a> result-ah, globals, <span class="Constant">0</span>/no-trace
<span id="L308" class="LineNr">308 </span><span class="CommentedCode">#? dump-cell-from-cursor-over-full-screen result-ah</span>
<span id="L309" class="LineNr">309 </span> <span class="PreProc">var</span> _result/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *result-ah
<span id="L310" class="LineNr">310 </span> <span class="PreProc">var</span> result/<span class="Constant">edi</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _result
<span id="L311" class="LineNr">311 </span> <span class="muComment"># expected</span>
<span id="L312" class="LineNr">312 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">&quot;((fn() (+ 3 4)))&quot;</span>
<span id="L313" class="LineNr">313 </span> <span class="PreProc">var</span> expected-gap-ah/<span class="Constant">ecx</span>: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> get <a href='sandbox.mu.html#L1'>sandbox</a>, data
<span id="L314" class="LineNr">314 </span> <span class="PreProc">var</span> expected-gap/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *expected-gap-ah
<span id="L315" class="LineNr">315 </span> <span class="PreProc">var</span> expected-h: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L316" class="LineNr">316 </span> <span class="PreProc">var</span> expected-ah/<span class="Constant">ecx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address expected-h
<span id="L317" class="LineNr">317 </span> <a href='read.mu.html#L1'>read-cell</a> expected-gap, expected-ah, <span class="Constant">0</span>/no-trace
<span id="L318" class="LineNr">318 </span><span class="CommentedCode">#? dump-cell-from-cursor-over-full-screen expected-ah</span>
<span id="L319" class="LineNr">319 </span> <span class="PreProc">var</span> expected/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *expected-ah
<span id="L320" class="LineNr">320 </span> <span class="muComment">#</span>
<span id="L321" class="LineNr">321 </span> <span class="PreProc">var</span> assertion/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='evaluate.mu.html#L1037'>cell-isomorphic?</a> result, expected, <span class="Constant">0</span>/no-trace
<span id="L322" class="LineNr">322 </span> <a href='../502test.mu.html#L19'>check</a> assertion, <span class="Constant">&quot;F - test-macroexpand-inside-fn-call&quot;</span>
<span id="L323" class="LineNr">323 </span><span class="Delimiter">}</span>
<span id="L324" class="LineNr">324 </span>
<span id="L325" class="LineNr">325 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='macroexpand.mu.html#L325'>pending-test-macroexpand-inside-backquote-unquote</a></span> <span class="Delimiter">{</span>
<span id="L326" class="LineNr">326 </span> <span class="PreProc">var</span> globals-storage: <a href='global.mu.html#L7'>global-table</a>
<span id="L327" class="LineNr">327 </span> <span class="PreProc">var</span> globals/<span class="Constant">edx</span>: (addr <a href='global.mu.html#L7'>global-table</a>) <span class="Special">&lt;-</span> address globals-storage
<span id="L328" class="LineNr">328 </span> <a href='global.mu.html#L12'>initialize-globals</a> globals
<span id="L329" class="LineNr">329 </span> <span class="muComment"># new macro: m</span>
<span id="L330" class="LineNr">330 </span> <span class="PreProc">var</span> sandbox-storage: <a href='sandbox.mu.html#L1'>sandbox</a>
<span id="L331" class="LineNr">331 </span> <span class="PreProc">var</span> <a href='sandbox.mu.html#L1'>sandbox</a>/<span class="Constant">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> address sandbox-storage
<span id="L332" class="LineNr">332 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">&quot;(def m (litmac litfn () (a b) `(+ ,a ,b)))&quot;</span>
<span id="L333" class="LineNr">333 </span> <a href='sandbox.mu.html#L460'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0x13</span>/ctrl-s, globals, <span class="Constant">0</span>/no-disk, <span class="Constant">0</span>/no-screen, <span class="Constant">0</span>/no-tweak-screen
<span id="L334" class="LineNr">334 </span> <span class="muComment"># invoke macro</span>
<span id="L335" class="LineNr">335 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">&quot;`(print [result is ] ,(m 3 4)))&quot;</span>
<span id="L336" class="LineNr">336 </span> <span class="PreProc">var</span> gap-ah/<span class="Constant">ecx</span>: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> get <a href='sandbox.mu.html#L1'>sandbox</a>, data
<span id="L337" class="LineNr">337 </span> <span class="PreProc">var</span> gap/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *gap-ah
<span id="L338" class="LineNr">338 </span> <span class="PreProc">var</span> result-h: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L339" class="LineNr">339 </span> <span class="PreProc">var</span> result-ah/<span class="Constant">ebx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address result-h
<span id="L340" class="LineNr">340 </span> <a href='read.mu.html#L1'>read-cell</a> gap, result-ah, <span class="Constant">0</span>/no-trace
<span id="L341" class="LineNr">341 </span> <span class="PreProc">var</span> dummy/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='macroexpand.mu.html#L33'>macroexpand-iter</a> result-ah, globals, <span class="Constant">0</span>/no-trace
<span id="L342" class="LineNr">342 </span> <a href='print.mu.html#L94'>dump-cell-from-cursor-over-full-screen</a> result-ah
<span id="L343" class="LineNr">343 </span> <span class="PreProc">var</span> _result/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *result-ah
<span id="L344" class="LineNr">344 </span> <span class="PreProc">var</span> result/<span class="Constant">edi</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _result
<span id="L345" class="LineNr">345 </span> <span class="muComment"># expected</span>
<span id="L346" class="LineNr">346 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">&quot;`(print [result is ] ,(+ 3 4)))&quot;</span>
<span id="L347" class="LineNr">347 </span> <span class="PreProc">var</span> expected-gap-ah/<span class="Constant">ecx</span>: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> get <a href='sandbox.mu.html#L1'>sandbox</a>, data
<span id="L348" class="LineNr">348 </span> <span class="PreProc">var</span> expected-gap/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *expected-gap-ah
<span id="L349" class="LineNr">349 </span> <span class="PreProc">var</span> expected-h: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L350" class="LineNr">350 </span> <span class="PreProc">var</span> expected-ah/<span class="Constant">ecx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address expected-h
<span id="L351" class="LineNr">351 </span> <a href='read.mu.html#L1'>read-cell</a> expected-gap, expected-ah, <span class="Constant">0</span>/no-trace
<span id="L352" class="LineNr">352 </span> <a href='print.mu.html#L94'>dump-cell-from-cursor-over-full-screen</a> expected-ah
<span id="L353" class="LineNr">353 </span> <span class="PreProc">var</span> expected/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *expected-ah
<span id="L354" class="LineNr">354 </span> <span class="muComment">#</span>
<span id="L355" class="LineNr">355 </span> <span class="PreProc">var</span> assertion/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='evaluate.mu.html#L1037'>cell-isomorphic?</a> result, expected, <span class="Constant">0</span>/no-trace
<span id="L356" class="LineNr">356 </span> <a href='../502test.mu.html#L19'>check</a> assertion, <span class="Constant">&quot;F - test-macroexpand-inside-backquote-unquote&quot;</span>
<span id="L357" class="LineNr">357 </span><span class="Delimiter">}</span>
<span id="L358" class="LineNr">358 </span>
<span id="L359" class="LineNr">359 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='macroexpand.mu.html#L359'>pending-test-macroexpand-inside-nested-backquote-unquote</a></span> <span class="Delimiter">{</span>
<span id="L360" class="LineNr">360 </span> <span class="PreProc">var</span> globals-storage: <a href='global.mu.html#L7'>global-table</a>
<span id="L361" class="LineNr">361 </span> <span class="PreProc">var</span> globals/<span class="Constant">edx</span>: (addr <a href='global.mu.html#L7'>global-table</a>) <span class="Special">&lt;-</span> address globals-storage
<span id="L362" class="LineNr">362 </span> <a href='global.mu.html#L12'>initialize-globals</a> globals
<span id="L363" class="LineNr">363 </span> <span class="muComment"># new macro: m</span>
<span id="L364" class="LineNr">364 </span> <span class="PreProc">var</span> sandbox-storage: <a href='sandbox.mu.html#L1'>sandbox</a>
<span id="L365" class="LineNr">365 </span> <span class="PreProc">var</span> <a href='sandbox.mu.html#L1'>sandbox</a>/<span class="Constant">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> address sandbox-storage
<span id="L366" class="LineNr">366 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">&quot;(def m (litmac litfn () (a b) `(+ ,a ,b)))&quot;</span>
<span id="L367" class="LineNr">367 </span> <a href='sandbox.mu.html#L460'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0x13</span>/ctrl-s, globals, <span class="Constant">0</span>/no-disk, <span class="Constant">0</span>/no-screen, <span class="Constant">0</span>/no-tweak-screen
<span id="L368" class="LineNr">368 </span> <span class="muComment"># invoke macro</span>
<span id="L369" class="LineNr">369 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">&quot;`(a ,(m 3 4) `(b ,(m 3 4) ,,(m 3 4)))&quot;</span>
<span id="L370" class="LineNr">370 </span> <span class="PreProc">var</span> gap-ah/<span class="Constant">ecx</span>: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> get <a href='sandbox.mu.html#L1'>sandbox</a>, data
<span id="L371" class="LineNr">371 </span> <span class="PreProc">var</span> gap/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *gap-ah
<span id="L372" class="LineNr">372 </span> <span class="PreProc">var</span> result-h: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L373" class="LineNr">373 </span> <span class="PreProc">var</span> result-ah/<span class="Constant">ebx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address result-h
<span id="L374" class="LineNr">374 </span> <a href='read.mu.html#L1'>read-cell</a> gap, result-ah, <span class="Constant">0</span>/no-trace
<span id="L375" class="LineNr">375 </span> <span class="PreProc">var</span> dummy/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='macroexpand.mu.html#L33'>macroexpand-iter</a> result-ah, globals, <span class="Constant">0</span>/no-trace
<span id="L376" class="LineNr">376 </span> <a href='print.mu.html#L94'>dump-cell-from-cursor-over-full-screen</a> result-ah
<span id="L377" class="LineNr">377 </span> <span class="PreProc">var</span> _result/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *result-ah
<span id="L378" class="LineNr">378 </span> <span class="PreProc">var</span> result/<span class="Constant">edi</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _result
<span id="L379" class="LineNr">379 </span> <span class="muComment"># expected</span>
<span id="L380" class="LineNr">380 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">&quot;`(a ,(+ 3 4) `(b ,(m 3 4) ,,(+ 3 4)))&quot;</span>
<span id="L381" class="LineNr">381 </span> <span class="PreProc">var</span> expected-gap-ah/<span class="Constant">ecx</span>: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> get <a href='sandbox.mu.html#L1'>sandbox</a>, data
<span id="L382" class="LineNr">382 </span> <span class="PreProc">var</span> expected-gap/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *expected-gap-ah
<span id="L383" class="LineNr">383 </span> <span class="PreProc">var</span> expected-h: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L384" class="LineNr">384 </span> <span class="PreProc">var</span> expected-ah/<span class="Constant">ecx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address expected-h
<span id="L385" class="LineNr">385 </span> <a href='read.mu.html#L1'>read-cell</a> expected-gap, expected-ah, <span class="Constant">0</span>/no-trace
<span id="L386" class="LineNr">386 </span> <a href='print.mu.html#L94'>dump-cell-from-cursor-over-full-screen</a> expected-ah
<span id="L387" class="LineNr">387 </span> <span class="PreProc">var</span> expected/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *expected-ah
<span id="L388" class="LineNr">388 </span> <span class="muComment">#</span>
<span id="L389" class="LineNr">389 </span> <span class="PreProc">var</span> assertion/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='evaluate.mu.html#L1037'>cell-isomorphic?</a> result, expected, <span class="Constant">0</span>/no-trace
<span id="L390" class="LineNr">390 </span> <a href='../502test.mu.html#L19'>check</a> assertion, <span class="Constant">&quot;F - test-macroexpand-inside-nested-backquote-unquote&quot;</span>
<span id="L391" class="LineNr">391 </span><span class="Delimiter">}</span>
<span id="L392" class="LineNr">392 </span>
<span id="L393" class="LineNr">393 </span><span class="muComment"># TODO: unquote-splice, nested and unnested</span>
</pre>
</body>
</html>
<!-- vim: set foldmethod=manual : -->

169
html/shell/main.mu.html generated
View File

@ -72,7 +72,7 @@ if ('onhashchange' in window) {
<span id="L13" class="LineNr"> 13 </span> <span class="muComment"># globals layout: 1 char padding, 41 code, 1 padding, 41 code, 1 padding = 85</span>
<span id="L14" class="LineNr"> 14 </span> <span class="muComment"># sandbox layout: 1 padding, 41 code, 1 padding = 43</span>
<span id="L15" class="LineNr"> 15 </span> <span class="muComment"># total = 128 chars</span>
<span id="L16" class="LineNr"> 16 </span> <a href='global.mu.html#L127'>render-globals</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, globals
<span id="L16" class="LineNr"> 16 </span> <a href='global.mu.html#L156'>render-globals</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, globals
<span id="L17" class="LineNr"> 17 </span> <a href='sandbox.mu.html#L81'>render-sandbox</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0x55</span>/sandbox-left-margin, <span class="Constant">0</span>/sandbox-top-margin, <span class="Constant">0x80</span>/screen-width, <span class="Constant">0x2f</span>/screen-height-without-menu
<span id="L18" class="LineNr"> 18 </span> <span class="Delimiter">{</span>
<span id="L19" class="LineNr"> 19 </span> <span class="PreProc">var</span> key/<span class="Constant">eax</span>: byte <span class="Special">&lt;-</span> <a href='../102keyboard.subx.html#L21'>read-key</a> keyboard
@ -83,39 +83,39 @@ if ('onhashchange' in window) {
<span id="L24" class="LineNr"> 24 </span> compare key, <span class="Constant">0x12</span>/ctrl-r
<span id="L25" class="LineNr"> 25 </span> <span class="PreProc">break-if-!=</span>
<span id="L26" class="LineNr"> 26 </span> <span class="PreProc">var</span> tmp/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L27" class="LineNr"> 27 </span> <span class="PreProc">var</span> <a href='cell.mu.html#L120'>nil</a>: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L28" class="LineNr"> 28 </span> tmp <span class="Special">&lt;-</span> address <a href='cell.mu.html#L120'>nil</a>
<span id="L29" class="LineNr"> 29 </span> <a href='cell.mu.html#L101'>allocate-pair</a> tmp
<span id="L27" class="LineNr"> 27 </span> <span class="PreProc">var</span> <a href='cell.mu.html#L121'>nil</a>: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L28" class="LineNr"> 28 </span> tmp <span class="Special">&lt;-</span> address <a href='cell.mu.html#L121'>nil</a>
<span id="L29" class="LineNr"> 29 </span> <a href='cell.mu.html#L102'>allocate-pair</a> tmp
<span id="L30" class="LineNr"> 30 </span> <span class="muComment"># (main 0/real-screen 0/real-keyboard)</span>
<span id="L31" class="LineNr"> 31 </span> <span class="muComment"># We're using the fact that 'screen' and 'keyboard' in this function are always 0.</span>
<span id="L32" class="LineNr"> 32 </span> <span class="PreProc">var</span> real-keyboard: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L33" class="LineNr"> 33 </span> tmp <span class="Special">&lt;-</span> address real-keyboard
<span id="L34" class="LineNr"> 34 </span> <a href='cell.mu.html#L176'>allocate-keyboard</a> tmp
<span id="L34" class="LineNr"> 34 </span> <a href='cell.mu.html#L177'>allocate-keyboard</a> tmp
<span id="L35" class="LineNr"> 35 </span> <span class="muComment"># args = cons(real-keyboard, nil)</span>
<span id="L36" class="LineNr"> 36 </span> <span class="PreProc">var</span> args: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L37" class="LineNr"> 37 </span> tmp <span class="Special">&lt;-</span> address args
<span id="L38" class="LineNr"> 38 </span> <a href='cell.mu.html#L115'>new-pair</a> tmp, real-keyboard, <a href='cell.mu.html#L120'>nil</a>
<span id="L38" class="LineNr"> 38 </span> <a href='cell.mu.html#L116'>new-pair</a> tmp, real-keyboard, <a href='cell.mu.html#L121'>nil</a>
<span id="L39" class="LineNr"> 39 </span> <span class="muComment">#</span>
<span id="L40" class="LineNr"> 40 </span> <span class="PreProc">var</span> real-screen: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L41" class="LineNr"> 41 </span> tmp <span class="Special">&lt;-</span> address real-screen
<span id="L42" class="LineNr"> 42 </span> <a href='cell.mu.html#L145'>allocate-screen</a> tmp
<span id="L42" class="LineNr"> 42 </span> <a href='cell.mu.html#L146'>allocate-screen</a> tmp
<span id="L43" class="LineNr"> 43 </span> <span class="muComment"># args = cons(real-screen, args)</span>
<span id="L44" class="LineNr"> 44 </span> tmp <span class="Special">&lt;-</span> address args
<span id="L45" class="LineNr"> 45 </span> <a href='cell.mu.html#L115'>new-pair</a> tmp, real-screen, *tmp
<span id="L45" class="LineNr"> 45 </span> <a href='cell.mu.html#L116'>new-pair</a> tmp, real-screen, *tmp
<span id="L46" class="LineNr"> 46 </span> <span class="muComment">#</span>
<span id="L47" class="LineNr"> 47 </span> <span class="PreProc">var</span> <a href='main.mu.html#L4'>main</a>: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L48" class="LineNr"> 48 </span> tmp <span class="Special">&lt;-</span> address <a href='main.mu.html#L4'>main</a>
<span id="L49" class="LineNr"> 49 </span> <a href='cell.mu.html#L38'>new-symbol</a> tmp, <span class="Constant">&quot;main&quot;</span>
<span id="L49" class="LineNr"> 49 </span> <a href='cell.mu.html#L39'>new-symbol</a> tmp, <span class="Constant">&quot;main&quot;</span>
<span id="L50" class="LineNr"> 50 </span> <span class="muComment"># args = cons(main, args)</span>
<span id="L51" class="LineNr"> 51 </span> tmp <span class="Special">&lt;-</span> address args
<span id="L52" class="LineNr"> 52 </span> <a href='cell.mu.html#L115'>new-pair</a> tmp, <a href='main.mu.html#L4'>main</a>, *tmp
<span id="L52" class="LineNr"> 52 </span> <a href='cell.mu.html#L116'>new-pair</a> tmp, <a href='main.mu.html#L4'>main</a>, *tmp
<span id="L53" class="LineNr"> 53 </span> <span class="muComment"># clear real screen</span>
<span id="L54" class="LineNr"> 54 </span> <a href='../500fake-screen.mu.html#L230'>clear-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L55" class="LineNr"> 55 </span> <a href='../500fake-screen.mu.html#L169'>set-cursor-position</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0</span>, <span class="Constant">0</span>
<span id="L56" class="LineNr"> 56 </span> <span class="muComment"># run</span>
<span id="L57" class="LineNr"> 57 </span> <span class="PreProc">var</span> out: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L58" class="LineNr"> 58 </span> <span class="PreProc">var</span> out-ah/<span class="Constant">ecx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address out
<span id="L59" class="LineNr"> 59 </span> <a href='evaluate.mu.html#L5'>evaluate</a> tmp, out-ah, <a href='cell.mu.html#L120'>nil</a>, globals, <span class="Constant">0</span>/trace, <span class="Constant">0</span>/no-fake-screen, <span class="Constant">0</span>/no-fake-keyboard, <span class="Constant">0</span>/call-number
<span id="L59" class="LineNr"> 59 </span> <a href='evaluate.mu.html#L5'>evaluate</a> tmp, out-ah, <a href='cell.mu.html#L121'>nil</a>, globals, <span class="Constant">0</span>/trace, <span class="Constant">0</span>/no-fake-screen, <span class="Constant">0</span>/no-fake-keyboard, <span class="Constant">0</span>/call-number
<span id="L60" class="LineNr"> 60 </span> <span class="Delimiter">{</span>
<span id="L61" class="LineNr"> 61 </span> <span class="PreProc">var</span> tmp/<span class="Constant">eax</span>: byte <span class="Special">&lt;-</span> <a href='../102keyboard.subx.html#L21'>read-key</a> keyboard
<span id="L62" class="LineNr"> 62 </span> compare tmp, <span class="Constant">0</span>
@ -135,79 +135,88 @@ if ('onhashchange' in window) {
<span id="L76" class="LineNr"> 76 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='main.mu.html#L76'>load-state</a></span> data-disk: (addr disk), _sandbox: (addr <a href='sandbox.mu.html#L1'>sandbox</a>), globals: (addr <a href='global.mu.html#L7'>global-table</a>) <span class="Delimiter">{</span>
<span id="L77" class="LineNr"> 77 </span> <span class="PreProc">var</span> <a href='sandbox.mu.html#L1'>sandbox</a>/<span class="Constant">eax</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> copy _sandbox
<span id="L78" class="LineNr"> 78 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">eax</span>: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> get <a href='sandbox.mu.html#L1'>sandbox</a>, data
<span id="L79" class="LineNr"> 79 </span> <span class="PreProc">var</span> _data/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L79" class="LineNr"> 79 </span> <span class="PreProc">var</span> _data/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L80" class="LineNr"> 80 </span> <span class="PreProc">var</span> data/<span class="Constant">esi</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> copy _data
<span id="L81" class="LineNr"> 81 </span> <span class="muComment"># data-disk -&gt; stream</span>
<span id="L82" class="LineNr"> 82 </span> <span class="PreProc">var</span> s-storage: (stream byte <span class="Constant">0x1000</span>) <span class="muComment"># space for 8/sectors</span>
<span id="L83" class="LineNr"> 83 </span> <span class="PreProc">var</span> s/<span class="Constant">ebx</span>: (addr stream byte) <span class="Special">&lt;-</span> address s-storage
<span id="L84" class="LineNr"> 84 </span> <a href='../boot.subx.html#L925'>load-sectors</a> data-disk, <span class="Constant">0</span>/lba, <span class="Constant">8</span>/sectors, s
<span id="L85" class="LineNr"> 85 </span><span class="CommentedCode">#? draw-stream-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, s, 7/fg, 0xc5/bg=blue-bg</span>
<span id="L86" class="LineNr"> 86 </span> <span class="muComment"># stream -&gt; gap-buffer</span>
<span id="L87" class="LineNr"> 87 </span> <a href='gap-buffer.mu.html#L52'>load-gap-buffer-from-stream</a> data, s
<span id="L88" class="LineNr"> 88 </span> <a href='../106stream.subx.html#L20'>clear-stream</a> s
<span id="L89" class="LineNr"> 89 </span> <span class="muComment"># read: gap-buffer -&gt; cell</span>
<span id="L90" class="LineNr"> 90 </span> <span class="PreProc">var</span> initial-root-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L91" class="LineNr"> 91 </span> <span class="PreProc">var</span> initial-root/<span class="Constant">ecx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address initial-root-storage
<span id="L92" class="LineNr"> 92 </span> <a href='read.mu.html#L1'>read-cell</a> data, initial-root, <span class="Constant">0</span>/no-trace
<span id="L93" class="LineNr"> 93 </span> <a href='gap-buffer.mu.html#L19'>clear-gap-buffer</a> data
<span id="L94" class="LineNr"> 94 </span> <span class="muComment">#</span>
<span id="L95" class="LineNr"> 95 </span> <span class="Delimiter">{</span>
<span id="L96" class="LineNr"> 96 </span> <span class="PreProc">var</span> initial-root-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *initial-root
<span id="L97" class="LineNr"> 97 </span> compare initial-root-addr, <span class="Constant">0</span>
<span id="L98" class="LineNr"> 98 </span> <span class="PreProc">break-if-!=</span>
<span id="L99" class="LineNr"> 99 </span> <span class="PreProc">return</span>
<span id="L100" class="LineNr">100 </span> <span class="Delimiter">}</span>
<span id="L101" class="LineNr">101 </span> <span class="muComment"># load globals from assoc(initial-root, 'globals)</span>
<span id="L102" class="LineNr">102 </span> <span class="PreProc">var</span> globals-literal-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L103" class="LineNr">103 </span> <span class="PreProc">var</span> globals-literal-ah/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address globals-literal-storage
<span id="L104" class="LineNr">104 </span> <a href='cell.mu.html#L38'>new-symbol</a> globals-literal-ah, <span class="Constant">&quot;globals&quot;</span>
<span id="L105" class="LineNr">105 </span> <span class="PreProc">var</span> globals-literal/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *globals-literal-ah
<span id="L106" class="LineNr">106 </span> <span class="PreProc">var</span> globals-cell-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L107" class="LineNr">107 </span> <span class="PreProc">var</span> globals-cell-ah/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address globals-cell-storage
<span id="L108" class="LineNr">108 </span> <a href='evaluate.mu.html#L632'>lookup-symbol</a> globals-literal, globals-cell-ah, *initial-root, <span class="Constant">0</span>/no-globals, <span class="Constant">0</span>/no-trace, <span class="Constant">0</span>/no-screen, <span class="Constant">0</span>/no-keyboard
<span id="L109" class="LineNr">109 </span> <span class="PreProc">var</span> globals-cell/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *globals-cell-ah
<span id="L110" class="LineNr">110 </span> <span class="Delimiter">{</span>
<span id="L111" class="LineNr">111 </span> compare globals-cell, <span class="Constant">0</span>
<span id="L112" class="LineNr">112 </span> <span class="PreProc">break-if-=</span>
<span id="L113" class="LineNr">113 </span> <a href='global.mu.html#L59'>load-globals</a> globals-cell-ah, globals
<span id="L114" class="LineNr">114 </span> <span class="Delimiter">}</span>
<span id="L115" class="LineNr">115 </span> <span class="muComment"># sandbox = assoc(initial-root, 'sandbox)</span>
<span id="L116" class="LineNr">116 </span> <span class="PreProc">var</span> sandbox-literal-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L117" class="LineNr">117 </span> <span class="PreProc">var</span> sandbox-literal-ah/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address sandbox-literal-storage
<span id="L118" class="LineNr">118 </span> <a href='cell.mu.html#L38'>new-symbol</a> sandbox-literal-ah, <span class="Constant">&quot;sandbox&quot;</span>
<span id="L119" class="LineNr">119 </span> <span class="PreProc">var</span> sandbox-literal/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *sandbox-literal-ah
<span id="L120" class="LineNr">120 </span> <span class="PreProc">var</span> sandbox-cell-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L121" class="LineNr">121 </span> <span class="PreProc">var</span> sandbox-cell-ah/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address sandbox-cell-storage
<span id="L122" class="LineNr">122 </span> <a href='evaluate.mu.html#L632'>lookup-symbol</a> sandbox-literal, sandbox-cell-ah, *initial-root, <span class="Constant">0</span>/no-globals, <span class="Constant">0</span>/no-trace, <span class="Constant">0</span>/no-screen, <span class="Constant">0</span>/no-keyboard
<span id="L123" class="LineNr">123 </span> <span class="PreProc">var</span> sandbox-cell/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *sandbox-cell-ah
<span id="L124" class="LineNr">124 </span> <span class="Delimiter">{</span>
<span id="L125" class="LineNr">125 </span> compare sandbox-cell, <span class="Constant">0</span>
<span id="L126" class="LineNr">126 </span> <span class="PreProc">break-if-=</span>
<span id="L127" class="LineNr">127 </span> <span class="muComment"># print: cell -&gt; stream</span>
<span id="L128" class="LineNr">128 </span> <a href='print.mu.html#L1'>print-cell</a> sandbox-cell-ah, s, <span class="Constant">0</span>/no-trace
<span id="L129" class="LineNr">129 </span> <span class="muComment"># stream -&gt; gap-buffer</span>
<span id="L130" class="LineNr">130 </span> <a href='gap-buffer.mu.html#L52'>load-gap-buffer-from-stream</a> data, s
<span id="L131" class="LineNr">131 </span> <span class="Delimiter">}</span>
<span id="L132" class="LineNr">132 </span><span class="Delimiter">}</span>
<span id="L133" class="LineNr">133 </span>
<span id="L134" class="LineNr">134 </span><span class="muComment"># Save state as an alist of alists:</span>
<span id="L135" class="LineNr">135 </span><span class="muComment"># ((globals . ((a . (fn ...))</span>
<span id="L136" class="LineNr">136 </span><span class="muComment"># ...))</span>
<span id="L137" class="LineNr">137 </span><span class="muComment"># (sandbox . ...))</span>
<span id="L138" class="LineNr">138 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='main.mu.html#L138'>store-state</a></span> data-disk: (addr disk), <a href='sandbox.mu.html#L1'>sandbox</a>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>), globals: (addr <a href='global.mu.html#L7'>global-table</a>) <span class="Delimiter">{</span>
<span id="L139" class="LineNr">139 </span> compare data-disk, <span class="Constant">0</span>/no-disk
<span id="L140" class="LineNr">140 </span> <span class="Delimiter">{</span>
<span id="L141" class="LineNr">141 </span> <span class="PreProc">break-if-!=</span>
<span id="L142" class="LineNr">142 </span> <span class="PreProc">return</span>
<span id="L143" class="LineNr">143 </span> <span class="Delimiter">}</span>
<span id="L144" class="LineNr">144 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x1000</span>) <span class="muComment"># space enough for 8/sectors</span>
<span id="L145" class="LineNr">145 </span> <span class="PreProc">var</span> stream/<span class="Constant">edi</span>: (addr stream byte) <span class="Special">&lt;-</span> address stream-storage
<span id="L146" class="LineNr">146 </span> <a href='../108write.subx.html#L11'>write</a> stream, <span class="Constant">&quot;(\n&quot;</span>
<span id="L147" class="LineNr">147 </span> <a href='global.mu.html#L86'>write-globals</a> stream, globals
<span id="L148" class="LineNr">148 </span> <a href='sandbox.mu.html#L64'>write-sandbox</a> stream, <a href='sandbox.mu.html#L1'>sandbox</a>
<span id="L149" class="LineNr">149 </span> <a href='../108write.subx.html#L11'>write</a> stream, <span class="Constant">&quot;)\n&quot;</span>
<span id="L150" class="LineNr">150 </span> <a href='../boot.subx.html#L987'>store-sectors</a> data-disk, <span class="Constant">0</span>/lba, <span class="Constant">8</span>/sectors, stream
<span id="L151" class="LineNr">151 </span><span class="Delimiter">}</span>
<span id="L84" class="LineNr"> 84 </span> <a href='../501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;loading sectors from data disk&quot;</span>, <span class="Constant">3</span>/fg, <span class="Constant">0</span>/bg
<span id="L85" class="LineNr"> 85 </span> <a href='../501draw-text.mu.html#L65'>move-cursor-to-left-margin-of-next-line</a> <span class="Constant">0</span>/screen
<span id="L86" class="LineNr"> 86 </span> <a href='../boot.subx.html#L946'>load-sectors</a> data-disk, <span class="Constant">0</span>/lba, <span class="Constant">8</span>/sectors, s
<span id="L87" class="LineNr"> 87 </span><span class="CommentedCode">#? draw-stream-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, s, 7/fg, 0xc5/bg=blue-bg</span>
<span id="L88" class="LineNr"> 88 </span> <span class="muComment"># stream -&gt; gap-buffer</span>
<span id="L89" class="LineNr"> 89 </span> <a href='../501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;parsing&quot;</span>, <span class="Constant">3</span>/fg, <span class="Constant">0</span>/bg
<span id="L90" class="LineNr"> 90 </span> <a href='../501draw-text.mu.html#L65'>move-cursor-to-left-margin-of-next-line</a> <span class="Constant">0</span>/screen
<span id="L91" class="LineNr"> 91 </span> <a href='gap-buffer.mu.html#L52'>load-gap-buffer-from-stream</a> data, s
<span id="L92" class="LineNr"> 92 </span> <a href='../501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot; into gap buffer&quot;</span>, <span class="Constant">3</span>/fg, <span class="Constant">0</span>/bg
<span id="L93" class="LineNr"> 93 </span> <a href='../501draw-text.mu.html#L65'>move-cursor-to-left-margin-of-next-line</a> <span class="Constant">0</span>/screen
<span id="L94" class="LineNr"> 94 </span> <a href='../106stream.subx.html#L20'>clear-stream</a> s
<span id="L95" class="LineNr"> 95 </span> <span class="muComment"># read: gap-buffer -&gt; cell</span>
<span id="L96" class="LineNr"> 96 </span> <span class="PreProc">var</span> initial-root-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L97" class="LineNr"> 97 </span> <span class="PreProc">var</span> initial-root/<span class="Constant">ecx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address initial-root-storage
<span id="L98" class="LineNr"> 98 </span> <a href='read.mu.html#L1'>read-cell</a> data, initial-root, <span class="Constant">0</span>/no-trace
<span id="L99" class="LineNr"> 99 </span> <a href='../501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot; into s-expressions&quot;</span>, <span class="Constant">3</span>/fg, <span class="Constant">0</span>/bg
<span id="L100" class="LineNr">100 </span> <a href='../501draw-text.mu.html#L65'>move-cursor-to-left-margin-of-next-line</a> <span class="Constant">0</span>/screen
<span id="L101" class="LineNr">101 </span> <a href='gap-buffer.mu.html#L19'>clear-gap-buffer</a> data
<span id="L102" class="LineNr">102 </span> <span class="muComment">#</span>
<span id="L103" class="LineNr">103 </span> <span class="Delimiter">{</span>
<span id="L104" class="LineNr">104 </span> <span class="PreProc">var</span> initial-root-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *initial-root
<span id="L105" class="LineNr">105 </span> compare initial-root-addr, <span class="Constant">0</span>
<span id="L106" class="LineNr">106 </span> <span class="PreProc">break-if-!=</span>
<span id="L107" class="LineNr">107 </span> <span class="PreProc">return</span>
<span id="L108" class="LineNr">108 </span> <span class="Delimiter">}</span>
<span id="L109" class="LineNr">109 </span> <span class="muComment"># load globals from assoc(initial-root, 'globals)</span>
<span id="L110" class="LineNr">110 </span> <span class="PreProc">var</span> globals-literal-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L111" class="LineNr">111 </span> <span class="PreProc">var</span> globals-literal-ah/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address globals-literal-storage
<span id="L112" class="LineNr">112 </span> <a href='cell.mu.html#L39'>new-symbol</a> globals-literal-ah, <span class="Constant">&quot;globals&quot;</span>
<span id="L113" class="LineNr">113 </span> <span class="PreProc">var</span> globals-literal/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *globals-literal-ah
<span id="L114" class="LineNr">114 </span> <span class="PreProc">var</span> globals-cell-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L115" class="LineNr">115 </span> <span class="PreProc">var</span> globals-cell-ah/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address globals-cell-storage
<span id="L116" class="LineNr">116 </span> <a href='evaluate.mu.html#L691'>lookup-symbol</a> globals-literal, globals-cell-ah, *initial-root, <span class="Constant">0</span>/no-globals, <span class="Constant">0</span>/no-trace, <span class="Constant">0</span>/no-screen, <span class="Constant">0</span>/no-keyboard
<span id="L117" class="LineNr">117 </span> <span class="PreProc">var</span> globals-cell/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *globals-cell-ah
<span id="L118" class="LineNr">118 </span> <span class="Delimiter">{</span>
<span id="L119" class="LineNr">119 </span> compare globals-cell, <span class="Constant">0</span>
<span id="L120" class="LineNr">120 </span> <span class="PreProc">break-if-=</span>
<span id="L121" class="LineNr">121 </span> <a href='global.mu.html#L66'>load-globals</a> globals-cell-ah, globals
<span id="L122" class="LineNr">122 </span> <span class="Delimiter">}</span>
<span id="L123" class="LineNr">123 </span> <span class="muComment"># sandbox = assoc(initial-root, 'sandbox)</span>
<span id="L124" class="LineNr">124 </span> <a href='../501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;loading sandbox&quot;</span>, <span class="Constant">3</span>/fg, <span class="Constant">0</span>/bg
<span id="L125" class="LineNr">125 </span> <span class="PreProc">var</span> sandbox-literal-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L126" class="LineNr">126 </span> <span class="PreProc">var</span> sandbox-literal-ah/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address sandbox-literal-storage
<span id="L127" class="LineNr">127 </span> <a href='cell.mu.html#L39'>new-symbol</a> sandbox-literal-ah, <span class="Constant">&quot;sandbox&quot;</span>
<span id="L128" class="LineNr">128 </span> <span class="PreProc">var</span> sandbox-literal/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *sandbox-literal-ah
<span id="L129" class="LineNr">129 </span> <span class="PreProc">var</span> sandbox-cell-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L130" class="LineNr">130 </span> <span class="PreProc">var</span> sandbox-cell-ah/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address sandbox-cell-storage
<span id="L131" class="LineNr">131 </span> <a href='evaluate.mu.html#L691'>lookup-symbol</a> sandbox-literal, sandbox-cell-ah, *initial-root, <span class="Constant">0</span>/no-globals, <span class="Constant">0</span>/no-trace, <span class="Constant">0</span>/no-screen, <span class="Constant">0</span>/no-keyboard
<span id="L132" class="LineNr">132 </span> <span class="PreProc">var</span> sandbox-cell/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *sandbox-cell-ah
<span id="L133" class="LineNr">133 </span> <span class="Delimiter">{</span>
<span id="L134" class="LineNr">134 </span> compare sandbox-cell, <span class="Constant">0</span>
<span id="L135" class="LineNr">135 </span> <span class="PreProc">break-if-=</span>
<span id="L136" class="LineNr">136 </span> <span class="muComment"># print: cell -&gt; stream</span>
<span id="L137" class="LineNr">137 </span> <a href='print.mu.html#L1'>print-cell</a> sandbox-cell-ah, s, <span class="Constant">0</span>/no-trace
<span id="L138" class="LineNr">138 </span> <span class="muComment"># stream -&gt; gap-buffer</span>
<span id="L139" class="LineNr">139 </span> <a href='gap-buffer.mu.html#L52'>load-gap-buffer-from-stream</a> data, s
<span id="L140" class="LineNr">140 </span> <span class="Delimiter">}</span>
<span id="L141" class="LineNr">141 </span><span class="Delimiter">}</span>
<span id="L142" class="LineNr">142 </span>
<span id="L143" class="LineNr">143 </span><span class="muComment"># Save state as an alist of alists:</span>
<span id="L144" class="LineNr">144 </span><span class="muComment"># ((globals . ((a . (fn ...))</span>
<span id="L145" class="LineNr">145 </span><span class="muComment"># ...))</span>
<span id="L146" class="LineNr">146 </span><span class="muComment"># (sandbox . ...))</span>
<span id="L147" class="LineNr">147 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='main.mu.html#L147'>store-state</a></span> data-disk: (addr disk), <a href='sandbox.mu.html#L1'>sandbox</a>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>), globals: (addr <a href='global.mu.html#L7'>global-table</a>) <span class="Delimiter">{</span>
<span id="L148" class="LineNr">148 </span> compare data-disk, <span class="Constant">0</span>/no-disk
<span id="L149" class="LineNr">149 </span> <span class="Delimiter">{</span>
<span id="L150" class="LineNr">150 </span> <span class="PreProc">break-if-!=</span>
<span id="L151" class="LineNr">151 </span> <span class="PreProc">return</span>
<span id="L152" class="LineNr">152 </span> <span class="Delimiter">}</span>
<span id="L153" class="LineNr">153 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x1000</span>) <span class="muComment"># space enough for 8/sectors</span>
<span id="L154" class="LineNr">154 </span> <span class="PreProc">var</span> stream/<span class="Constant">edi</span>: (addr stream byte) <span class="Special">&lt;-</span> address stream-storage
<span id="L155" class="LineNr">155 </span> <a href='../108write.subx.html#L11'>write</a> stream, <span class="Constant">&quot;(\n&quot;</span>
<span id="L156" class="LineNr">156 </span> <a href='global.mu.html#L109'>write-globals</a> stream, globals
<span id="L157" class="LineNr">157 </span> <a href='sandbox.mu.html#L64'>write-sandbox</a> stream, <a href='sandbox.mu.html#L1'>sandbox</a>
<span id="L158" class="LineNr">158 </span> <a href='../108write.subx.html#L11'>write</a> stream, <span class="Constant">&quot;)\n&quot;</span>
<span id="L159" class="LineNr">159 </span> <a href='../boot.subx.html#L1009'>store-sectors</a> data-disk, <span class="Constant">0</span>/lba, <span class="Constant">8</span>/sectors, stream
<span id="L160" class="LineNr">160 </span><span class="Delimiter">}</span>
</pre>
</body>
</html>

410
html/shell/parse.mu.html generated
View File

@ -86,7 +86,7 @@ if ('onhashchange' in window) {
<span id="L28" class="LineNr"> 28 </span><span class="muComment"># unmatched close-paren encountered?</span>
<span id="L29" class="LineNr"> 29 </span><span class="muComment"># dot encountered? (only used internally by recursive calls)</span>
<span id="L30" class="LineNr"> 30 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='parse.mu.html#L30'>parse-sexpression</a></span> tokens: (addr stream <a href='cell.mu.html#L1'>cell</a>), _out: (addr handle <a href='cell.mu.html#L1'>cell</a>), trace: (addr trace)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean, _/<span class="Constant">ecx</span>: boolean <span class="Delimiter">{</span>
<span id="L31" class="LineNr"> 31 </span> <a href='trace.mu.html#L120'>trace-text</a> trace, <span class="Constant">&quot;read&quot;</span>, <span class="Constant">&quot;parse&quot;</span>
<span id="L31" class="LineNr"> 31 </span> <a href='trace.mu.html#L120'>trace-text</a> trace, <span class="Constant">&quot;parse&quot;</span>, <span class="Constant">&quot;parse&quot;</span>
<span id="L32" class="LineNr"> 32 </span> <a href='trace.mu.html#L147'>trace-lower</a> trace
<span id="L33" class="LineNr"> 33 </span> <span class="PreProc">var</span> curr-token-storage: <a href='cell.mu.html#L1'>cell</a>
<span id="L34" class="LineNr"> 34 </span> <span class="PreProc">var</span> curr-token/<span class="Constant">ecx</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address curr-token-storage
@ -97,204 +97,252 @@ if ('onhashchange' in window) {
<span id="L39" class="LineNr"> 39 </span> <span class="Special"><a href='trace.mu.html#L129'>error</a></span> trace, <span class="Constant">&quot;end of stream; never found a balancing ')'&quot;</span>
<span id="L40" class="LineNr"> 40 </span> <span class="PreProc">return</span> <span class="Constant">1</span>/true, <span class="Constant">0</span>/false
<span id="L41" class="LineNr"> 41 </span> <span class="Delimiter">}</span>
<span id="L42" class="LineNr"> 42 </span> <a href='../309stream.subx.html#L107'>read-from-stream</a> tokens, curr-token
<span id="L42" class="LineNr"> 42 </span> <a href='../309stream.subx.html#L104'>read-from-stream</a> tokens, curr-token
<span id="L43" class="LineNr"> 43 </span> $parse-sexpression:type-check: <span class="Delimiter">{</span>
<span id="L44" class="LineNr"> 44 </span> <span class="muComment"># single quote -&gt; parse as list with a special car</span>
<span id="L45" class="LineNr"> 45 </span> <span class="PreProc">var</span> <a href='tokenize.mu.html#L705'>quote-token?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='tokenize.mu.html#L705'>quote-token?</a> curr-token
<span id="L46" class="LineNr"> 46 </span> compare <a href='tokenize.mu.html#L705'>quote-token?</a>, <span class="Constant">0</span>/false
<span id="L45" class="LineNr"> 45 </span> <span class="PreProc">var</span> <a href='tokenize.mu.html#L840'>quote-token?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='tokenize.mu.html#L840'>quote-token?</a> curr-token
<span id="L46" class="LineNr"> 46 </span> compare <a href='tokenize.mu.html#L840'>quote-token?</a>, <span class="Constant">0</span>/false
<span id="L47" class="LineNr"> 47 </span> <span class="Delimiter">{</span>
<span id="L48" class="LineNr"> 48 </span> <span class="PreProc">break-if-=</span>
<span id="L49" class="LineNr"> 49 </span> <span class="PreProc">var</span> out/<span class="Constant">edi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L50" class="LineNr"> 50 </span> <a href='cell.mu.html#L101'>allocate-pair</a> out
<span id="L51" class="LineNr"> 51 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *out
<span id="L50" class="LineNr"> 50 </span> <a href='cell.mu.html#L102'>allocate-pair</a> out
<span id="L51" class="LineNr"> 51 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *out
<span id="L52" class="LineNr"> 52 </span> <span class="PreProc">var</span> left-ah/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get out-addr, left
<span id="L53" class="LineNr"> 53 </span> <a href='cell.mu.html#L38'>new-symbol</a> left-ah, <span class="Constant">&quot;'&quot;</span>
<span id="L53" class="LineNr"> 53 </span> <a href='cell.mu.html#L39'>new-symbol</a> left-ah, <span class="Constant">&quot;'&quot;</span>
<span id="L54" class="LineNr"> 54 </span> <span class="PreProc">var</span> right-ah/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get out-addr, right
<span id="L55" class="LineNr"> 55 </span> <span class="PreProc">var</span> close-paren?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> copy <span class="Constant">0</span>/false
<span id="L56" class="LineNr"> 56 </span> <span class="PreProc">var</span> dot?/<span class="Constant">ecx</span>: boolean <span class="Special">&lt;-</span> copy <span class="Constant">0</span>/false
<span id="L57" class="LineNr"> 57 </span> close-paren?, dot? <span class="Special">&lt;-</span> <a href='parse.mu.html#L30'>parse-sexpression</a> tokens, right-ah, trace
<span id="L58" class="LineNr"> 58 </span> <span class="PreProc">return</span> close-paren?, dot?
<span id="L59" class="LineNr"> 59 </span> <span class="Delimiter">}</span>
<span id="L60" class="LineNr"> 60 </span> <span class="muComment"># dot -&gt; return</span>
<span id="L61" class="LineNr"> 61 </span> <span class="PreProc">var</span> dot?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='tokenize.mu.html#L751'>dot-token?</a> curr-token
<span id="L62" class="LineNr"> 62 </span> compare dot?, <span class="Constant">0</span>/false
<span id="L60" class="LineNr"> 60 </span> <span class="muComment"># backquote quote -&gt; parse as list with a special car</span>
<span id="L61" class="LineNr"> 61 </span> <span class="PreProc">var</span> <a href='tokenize.mu.html#L849'>backquote-token?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='tokenize.mu.html#L849'>backquote-token?</a> curr-token
<span id="L62" class="LineNr"> 62 </span> compare <a href='tokenize.mu.html#L849'>backquote-token?</a>, <span class="Constant">0</span>/false
<span id="L63" class="LineNr"> 63 </span> <span class="Delimiter">{</span>
<span id="L64" class="LineNr"> 64 </span> <span class="PreProc">break-if-=</span>
<span id="L65" class="LineNr"> 65 </span> <a href='trace.mu.html#L155'>trace-higher</a> trace
<span id="L66" class="LineNr"> 66 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false, <span class="Constant">1</span>/true
<span id="L67" class="LineNr"> 67 </span> <span class="Delimiter">}</span>
<span id="L68" class="LineNr"> 68 </span> <span class="muComment"># not bracket -&gt; parse atom</span>
<span id="L69" class="LineNr"> 69 </span> <span class="PreProc">var</span> <a href='tokenize.mu.html#L688'>bracket-token?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='tokenize.mu.html#L688'>bracket-token?</a> curr-token
<span id="L70" class="LineNr"> 70 </span> compare <a href='tokenize.mu.html#L688'>bracket-token?</a>, <span class="Constant">0</span>/false
<span id="L71" class="LineNr"> 71 </span> <span class="Delimiter">{</span>
<span id="L72" class="LineNr"> 72 </span> <span class="PreProc">break-if-!=</span>
<span id="L73" class="LineNr"> 73 </span> <a href='parse.mu.html#L148'>parse-atom</a> curr-token, _out, trace
<span id="L74" class="LineNr"> 74 </span> <span class="PreProc">break</span> $parse-sexpression:type-check
<span id="L65" class="LineNr"> 65 </span> <span class="PreProc">var</span> out/<span class="Constant">edi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L66" class="LineNr"> 66 </span> <a href='cell.mu.html#L102'>allocate-pair</a> out
<span id="L67" class="LineNr"> 67 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *out
<span id="L68" class="LineNr"> 68 </span> <span class="PreProc">var</span> left-ah/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get out-addr, left
<span id="L69" class="LineNr"> 69 </span> <a href='cell.mu.html#L39'>new-symbol</a> left-ah, <span class="Constant">&quot;`&quot;</span>
<span id="L70" class="LineNr"> 70 </span> <span class="PreProc">var</span> right-ah/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get out-addr, right
<span id="L71" class="LineNr"> 71 </span> <span class="PreProc">var</span> close-paren?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> copy <span class="Constant">0</span>/false
<span id="L72" class="LineNr"> 72 </span> <span class="PreProc">var</span> dot?/<span class="Constant">ecx</span>: boolean <span class="Special">&lt;-</span> copy <span class="Constant">0</span>/false
<span id="L73" class="LineNr"> 73 </span> close-paren?, dot? <span class="Special">&lt;-</span> <a href='parse.mu.html#L30'>parse-sexpression</a> tokens, right-ah, trace
<span id="L74" class="LineNr"> 74 </span> <span class="PreProc">return</span> close-paren?, dot?
<span id="L75" class="LineNr"> 75 </span> <span class="Delimiter">}</span>
<span id="L76" class="LineNr"> 76 </span> <span class="muComment"># open paren -&gt; parse list</span>
<span id="L77" class="LineNr"> 77 </span> <span class="PreProc">var</span> open-paren?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='tokenize.mu.html#L719'>open-paren-token?</a> curr-token
<span id="L78" class="LineNr"> 78 </span> compare open-paren?, <span class="Constant">0</span>/false
<span id="L76" class="LineNr"> 76 </span> <span class="muComment"># unquote -&gt; parse as list with a special car</span>
<span id="L77" class="LineNr"> 77 </span> <span class="PreProc">var</span> <a href='tokenize.mu.html#L858'>unquote-token?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='tokenize.mu.html#L858'>unquote-token?</a> curr-token
<span id="L78" class="LineNr"> 78 </span> compare <a href='tokenize.mu.html#L858'>unquote-token?</a>, <span class="Constant">0</span>/false
<span id="L79" class="LineNr"> 79 </span> <span class="Delimiter">{</span>
<span id="L80" class="LineNr"> 80 </span> <span class="PreProc">break-if-=</span>
<span id="L81" class="LineNr"> 81 </span> <span class="PreProc">var</span> curr/<span class="Constant">esi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L82" class="LineNr"> 82 </span> <a href='cell.mu.html#L101'>allocate-pair</a> curr
<span id="L83" class="LineNr"> 83 </span> <span class="PreProc">var</span> curr-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *curr
<span id="L84" class="LineNr"> 84 </span> <span class="PreProc">var</span> left/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get curr-addr, left
<span id="L85" class="LineNr"> 85 </span> <span class="Delimiter">{</span>
<span id="L86" class="LineNr"> 86 </span> <span class="PreProc">var</span> close-paren?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> copy <span class="Constant">0</span>/false
<span id="L87" class="LineNr"> 87 </span> <span class="PreProc">var</span> dot?/<span class="Constant">ecx</span>: boolean <span class="Special">&lt;-</span> copy <span class="Constant">0</span>/false
<span id="L88" class="LineNr"> 88 </span> close-paren?, dot? <span class="Special">&lt;-</span> <a href='parse.mu.html#L30'>parse-sexpression</a> tokens, left, trace
<span id="L89" class="LineNr"> 89 </span> <span class="Delimiter">{</span>
<span id="L90" class="LineNr"> 90 </span> compare dot?, <span class="Constant">0</span>/false
<span id="L91" class="LineNr"> 91 </span> <span class="PreProc">break-if-=</span>
<span id="L92" class="LineNr"> 92 </span> <span class="Special"><a href='trace.mu.html#L129'>error</a></span> trace, <span class="Constant">&quot;'.' cannot be at the start of a list&quot;</span>
<span id="L93" class="LineNr"> 93 </span> <span class="PreProc">return</span> <span class="Constant">1</span>/true, dot?
<span id="L94" class="LineNr"> 94 </span> <span class="Delimiter">}</span>
<span id="L95" class="LineNr"> 95 </span> compare close-paren?, <span class="Constant">0</span>/false
<span id="L96" class="LineNr"> 96 </span> <span class="PreProc">break-if-!=</span>
<span id="L97" class="LineNr"> 97 </span> <span class="PreProc">var</span> curr-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *curr
<span id="L98" class="LineNr"> 98 </span> curr <span class="Special">&lt;-</span> get curr-addr, right
<span id="L99" class="LineNr"> 99 </span> <span class="PreProc">var</span> tmp-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L100" class="LineNr">100 </span> <span class="PreProc">var</span> tmp/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address tmp-storage
<span id="L101" class="LineNr">101 </span> $parse-sexpression:list-loop: <span class="Delimiter">{</span>
<span id="L102" class="LineNr">102 </span> <span class="PreProc">var</span> close-paren?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> copy <span class="Constant">0</span>/false
<span id="L103" class="LineNr">103 </span> <span class="PreProc">var</span> dot?/<span class="Constant">ecx</span>: boolean <span class="Special">&lt;-</span> copy <span class="Constant">0</span>/false
<span id="L104" class="LineNr">104 </span> close-paren?, dot? <span class="Special">&lt;-</span> <a href='parse.mu.html#L30'>parse-sexpression</a> tokens, tmp, trace
<span id="L105" class="LineNr">105 </span> <span class="muComment"># '.' -&gt; clean up right here and return</span>
<span id="L106" class="LineNr">106 </span> compare dot?, <span class="Constant">0</span>/false
<span id="L107" class="LineNr">107 </span> <span class="Delimiter">{</span>
<span id="L108" class="LineNr">108 </span> <span class="PreProc">break-if-=</span>
<span id="L109" class="LineNr">109 </span> <a href='parse.mu.html#L206'>parse-dot-tail</a> tokens, curr, trace
<span id="L110" class="LineNr">110 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false, <span class="Constant">0</span>/false
<span id="L111" class="LineNr">111 </span> <span class="Delimiter">}</span>
<span id="L112" class="LineNr">112 </span> <a href='cell.mu.html#L101'>allocate-pair</a> curr
<span id="L113" class="LineNr">113 </span> <span class="muComment"># ')' -&gt; return</span>
<span id="L114" class="LineNr">114 </span> compare close-paren?, <span class="Constant">0</span>/false
<span id="L115" class="LineNr">115 </span> <span class="PreProc">break-if-!=</span>
<span id="L116" class="LineNr">116 </span> <span class="PreProc">var</span> curr-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *curr
<span id="L117" class="LineNr">117 </span> <span class="PreProc">var</span> left/<span class="Constant">ecx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get curr-addr, left
<span id="L118" class="LineNr">118 </span> copy-object tmp, left
<span id="L119" class="LineNr">119 </span> <span class="muComment">#</span>
<span id="L120" class="LineNr">120 </span> curr <span class="Special">&lt;-</span> get curr-addr, right
<span id="L121" class="LineNr">121 </span> <span class="PreProc">loop</span>
<span id="L122" class="LineNr">122 </span> <span class="Delimiter">}</span>
<span id="L123" class="LineNr">123 </span> <span class="Delimiter">}</span>
<span id="L124" class="LineNr">124 </span> <span class="PreProc">break</span> $parse-sexpression:type-check
<span id="L125" class="LineNr">125 </span> <span class="Delimiter">}</span>
<span id="L126" class="LineNr">126 </span> <span class="muComment"># close paren -&gt; return</span>
<span id="L127" class="LineNr">127 </span> <span class="PreProc">var</span> close-paren?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='tokenize.mu.html#L735'>close-paren-token?</a> curr-token
<span id="L128" class="LineNr">128 </span> compare close-paren?, <span class="Constant">0</span>/false
<span id="L129" class="LineNr">129 </span> <span class="Delimiter">{</span>
<span id="L130" class="LineNr">130 </span> <span class="PreProc">break-if-=</span>
<span id="L131" class="LineNr">131 </span> <a href='trace.mu.html#L155'>trace-higher</a> trace
<span id="L132" class="LineNr">132 </span> <span class="PreProc">return</span> <span class="Constant">1</span>/true, <span class="Constant">0</span>/false
<span id="L133" class="LineNr">133 </span> <span class="Delimiter">}</span>
<span id="L134" class="LineNr">134 </span> <span class="muComment"># otherwise abort</span>
<span id="L135" class="LineNr">135 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x40</span>)
<span id="L136" class="LineNr">136 </span> <span class="PreProc">var</span> stream/<span class="Constant">edx</span>: (addr stream byte) <span class="Special">&lt;-</span> address stream-storage
<span id="L137" class="LineNr">137 </span> <a href='../108write.subx.html#L11'>write</a> stream, <span class="Constant">&quot;unexpected token &quot;</span>
<span id="L138" class="LineNr">138 </span> <span class="PreProc">var</span> curr-token-data-ah/<span class="Constant">eax</span>: (addr handle stream byte) <span class="Special">&lt;-</span> get curr-token, text-data
<span id="L139" class="LineNr">139 </span> <span class="PreProc">var</span> curr-token-data/<span class="Constant">eax</span>: (addr stream byte) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *curr-token-data-ah
<span id="L140" class="LineNr">140 </span> <a href='../106stream.subx.html#L59'>rewind-stream</a> curr-token-data
<span id="L141" class="LineNr">141 </span> <a href='../113write-stream.subx.html#L8'>write-stream</a> stream, curr-token-data
<span id="L142" class="LineNr">142 </span> trace trace, <span class="Constant">&quot;error&quot;</span>, stream
<span id="L143" class="LineNr">143 </span> <span class="Delimiter">}</span>
<span id="L144" class="LineNr">144 </span> <a href='trace.mu.html#L155'>trace-higher</a> trace
<span id="L145" class="LineNr">145 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false, <span class="Constant">0</span>/false
<span id="L146" class="LineNr">146 </span><span class="Delimiter">}</span>
<span id="L147" class="LineNr">147 </span>
<span id="L148" class="LineNr">148 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='parse.mu.html#L148'>parse-atom</a></span> _curr-token: (addr <a href='cell.mu.html#L1'>cell</a>), _out: (addr handle <a href='cell.mu.html#L1'>cell</a>), trace: (addr trace) <span class="Delimiter">{</span>
<span id="L149" class="LineNr">149 </span> <a href='trace.mu.html#L120'>trace-text</a> trace, <span class="Constant">&quot;read&quot;</span>, <span class="Constant">&quot;parse atom&quot;</span>
<span id="L150" class="LineNr">150 </span> <span class="PreProc">var</span> curr-token/<span class="Constant">ecx</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _curr-token
<span id="L151" class="LineNr">151 </span> <span class="PreProc">var</span> curr-token-data-ah/<span class="Constant">eax</span>: (addr handle stream byte) <span class="Special">&lt;-</span> get curr-token, text-data
<span id="L152" class="LineNr">152 </span> <span class="PreProc">var</span> _curr-token-data/<span class="Constant">eax</span>: (addr stream byte) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *curr-token-data-ah
<span id="L153" class="LineNr">153 </span> <span class="PreProc">var</span> curr-token-data/<span class="Constant">esi</span>: (addr stream byte) <span class="Special">&lt;-</span> copy _curr-token-data
<span id="L154" class="LineNr">154 </span> trace trace, <span class="Constant">&quot;read&quot;</span>, curr-token-data
<span id="L155" class="LineNr">155 </span> <span class="muComment"># number</span>
<span id="L156" class="LineNr">156 </span> <span class="PreProc">var</span> <a href='tokenize.mu.html#L678'>number-token?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='tokenize.mu.html#L678'>number-token?</a> curr-token
<span id="L157" class="LineNr">157 </span> compare <a href='tokenize.mu.html#L678'>number-token?</a>, <span class="Constant">0</span>/false
<span id="L158" class="LineNr">158 </span> <span class="Delimiter">{</span>
<span id="L159" class="LineNr">159 </span> <span class="PreProc">break-if-=</span>
<span id="L160" class="LineNr">160 </span> <a href='../106stream.subx.html#L59'>rewind-stream</a> curr-token-data
<span id="L161" class="LineNr">161 </span> <span class="PreProc">var</span> _val/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='../311decimal-int.subx.html#L48'>parse-decimal-int-from-stream</a> curr-token-data
<span id="L162" class="LineNr">162 </span> <span class="PreProc">var</span> val/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy _val
<span id="L163" class="LineNr">163 </span> <span class="PreProc">var</span> val-float/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> convert val
<span id="L164" class="LineNr">164 </span> <a href='cell.mu.html#L67'>allocate-number</a> _out
<span id="L165" class="LineNr">165 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L166" class="LineNr">166 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *out
<span id="L167" class="LineNr">167 </span> <span class="PreProc">var</span> dest/<span class="Constant">edi</span>: (addr float) <span class="Special">&lt;-</span> get out-addr, number-data
<span id="L168" class="LineNr">168 </span> copy-to *dest, val-float
<span id="L169" class="LineNr">169 </span> <span class="Delimiter">{</span>
<span id="L170" class="LineNr">170 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x40</span>)
<span id="L171" class="LineNr">171 </span> <span class="PreProc">var</span> stream/<span class="Constant">ecx</span>: (addr stream byte) <span class="Special">&lt;-</span> address stream-storage
<span id="L172" class="LineNr">172 </span> <a href='../108write.subx.html#L11'>write</a> stream, <span class="Constant">&quot;=&gt; number &quot;</span>
<span id="L173" class="LineNr">173 </span> <a href='print.mu.html#L141'>print-number</a> out-addr, stream, <span class="Constant">0</span>/no-trace
<span id="L174" class="LineNr">174 </span> trace trace, <span class="Constant">&quot;read&quot;</span>, stream
<span id="L175" class="LineNr">175 </span> <span class="Delimiter">}</span>
<span id="L176" class="LineNr">176 </span> <span class="PreProc">return</span>
<span id="L177" class="LineNr">177 </span> <span class="Delimiter">}</span>
<span id="L178" class="LineNr">178 </span> <span class="muComment"># default: copy either to a symbol or a stream</span>
<span id="L179" class="LineNr">179 </span> <span class="muComment"># stream token -&gt; literal</span>
<span id="L180" class="LineNr">180 </span> <span class="PreProc">var</span> <a href='tokenize.mu.html#L776'>stream-token?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='tokenize.mu.html#L776'>stream-token?</a> curr-token
<span id="L181" class="LineNr">181 </span> compare <a href='tokenize.mu.html#L776'>stream-token?</a>, <span class="Constant">0</span>/false
<span id="L182" class="LineNr">182 </span> <span class="Delimiter">{</span>
<span id="L183" class="LineNr">183 </span> <span class="PreProc">break-if-=</span>
<span id="L184" class="LineNr">184 </span> <a href='cell.mu.html#L57'>allocate-stream</a> _out
<span id="L185" class="LineNr">185 </span> <span class="Delimiter">}</span>
<span id="L186" class="LineNr">186 </span> compare <a href='tokenize.mu.html#L776'>stream-token?</a>, <span class="Constant">0</span>/false
<span id="L187" class="LineNr">187 </span> <span class="Delimiter">{</span>
<span id="L188" class="LineNr">188 </span> <span class="PreProc">break-if-!=</span>
<span id="L189" class="LineNr">189 </span> <a href='cell.mu.html#L20'>allocate-symbol</a> _out
<span id="L190" class="LineNr">190 </span> <span class="Delimiter">}</span>
<span id="L191" class="LineNr">191 </span> <span class="muComment"># copy token data</span>
<span id="L192" class="LineNr">192 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L193" class="LineNr">193 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *out
<span id="L194" class="LineNr">194 </span> <span class="PreProc">var</span> curr-token-data-ah/<span class="Constant">ecx</span>: (addr handle stream byte) <span class="Special">&lt;-</span> get curr-token, text-data
<span id="L195" class="LineNr">195 </span> <span class="PreProc">var</span> dest-ah/<span class="Constant">edx</span>: (addr handle stream byte) <span class="Special">&lt;-</span> get out-addr, text-data
<span id="L196" class="LineNr">196 </span> copy-object curr-token-data-ah, dest-ah
<span id="L197" class="LineNr">197 </span> <span class="Delimiter">{</span>
<span id="L198" class="LineNr">198 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x40</span>)
<span id="L199" class="LineNr">199 </span> <span class="PreProc">var</span> stream/<span class="Constant">ecx</span>: (addr stream byte) <span class="Special">&lt;-</span> address stream-storage
<span id="L200" class="LineNr">200 </span> <a href='../108write.subx.html#L11'>write</a> stream, <span class="Constant">&quot;=&gt; symbol &quot;</span>
<span id="L201" class="LineNr">201 </span> <a href='print.mu.html#L101'>print-symbol</a> out-addr, stream, <span class="Constant">0</span>/no-trace
<span id="L202" class="LineNr">202 </span> trace trace, <span class="Constant">&quot;read&quot;</span>, stream
<span id="L203" class="LineNr">203 </span> <span class="Delimiter">}</span>
<span id="L204" class="LineNr">204 </span><span class="Delimiter">}</span>
<span id="L205" class="LineNr">205 </span>
<span id="L206" class="LineNr">206 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='parse.mu.html#L206'>parse-dot-tail</a></span> tokens: (addr stream <a href='cell.mu.html#L1'>cell</a>), _out: (addr handle <a href='cell.mu.html#L1'>cell</a>), trace: (addr trace) <span class="Delimiter">{</span>
<span id="L207" class="LineNr">207 </span> <span class="PreProc">var</span> out/<span class="Constant">edi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L208" class="LineNr">208 </span> <span class="PreProc">var</span> close-paren?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> copy <span class="Constant">0</span>/false
<span id="L209" class="LineNr">209 </span> <span class="PreProc">var</span> dot?/<span class="Constant">ecx</span>: boolean <span class="Special">&lt;-</span> copy <span class="Constant">0</span>/false
<span id="L210" class="LineNr">210 </span> close-paren?, dot? <span class="Special">&lt;-</span> <a href='parse.mu.html#L30'>parse-sexpression</a> tokens, out, trace
<span id="L211" class="LineNr">211 </span> compare close-paren?, <span class="Constant">0</span>/false
<span id="L212" class="LineNr">212 </span> <span class="Delimiter">{</span>
<span id="L213" class="LineNr">213 </span> <span class="PreProc">break-if-=</span>
<span id="L214" class="LineNr">214 </span> <span class="Special"><a href='trace.mu.html#L129'>error</a></span> trace, <span class="Constant">&quot;'. )' makes no sense&quot;</span>
<span id="L215" class="LineNr">215 </span> <span class="PreProc">return</span>
<span id="L216" class="LineNr">216 </span> <span class="Delimiter">}</span>
<span id="L217" class="LineNr">217 </span> compare dot?, <span class="Constant">0</span>/false
<span id="L218" class="LineNr">218 </span> <span class="Delimiter">{</span>
<span id="L219" class="LineNr">219 </span> <span class="PreProc">break-if-=</span>
<span id="L220" class="LineNr">220 </span> <span class="Special"><a href='trace.mu.html#L129'>error</a></span> trace, <span class="Constant">&quot;'. .' makes no sense&quot;</span>
<span id="L221" class="LineNr">221 </span> <span class="PreProc">return</span>
<span id="L222" class="LineNr">222 </span> <span class="Delimiter">}</span>
<span id="L223" class="LineNr">223 </span> <span class="muComment">#</span>
<span id="L224" class="LineNr">224 </span> <span class="PreProc">var</span> dummy: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L225" class="LineNr">225 </span> <span class="PreProc">var</span> dummy-ah/<span class="Constant">edi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address dummy
<span id="L226" class="LineNr">226 </span> close-paren?, dot? <span class="Special">&lt;-</span> <a href='parse.mu.html#L30'>parse-sexpression</a> tokens, dummy-ah, trace
<span id="L227" class="LineNr">227 </span> compare close-paren?, <span class="Constant">0</span>/false
<span id="L228" class="LineNr">228 </span> <span class="Delimiter">{</span>
<span id="L229" class="LineNr">229 </span> <span class="PreProc">break-if-!=</span>
<span id="L230" class="LineNr">230 </span> <span class="Special"><a href='trace.mu.html#L129'>error</a></span> trace, <span class="Constant">&quot;cannot have multiple expressions between '.' and ')'&quot;</span>
<span id="L231" class="LineNr">231 </span> <span class="PreProc">return</span>
<span id="L232" class="LineNr">232 </span> <span class="Delimiter">}</span>
<span id="L233" class="LineNr">233 </span> compare dot?, <span class="Constant">0</span>/false
<span id="L234" class="LineNr">234 </span> <span class="Delimiter">{</span>
<span id="L235" class="LineNr">235 </span> <span class="PreProc">break-if-=</span>
<span id="L236" class="LineNr">236 </span> <span class="Special"><a href='trace.mu.html#L129'>error</a></span> trace, <span class="Constant">&quot;cannot have two dots in a single list&quot;</span>
<span id="L237" class="LineNr">237 </span> <span class="PreProc">return</span>
<span id="L81" class="LineNr"> 81 </span> <span class="PreProc">var</span> out/<span class="Constant">edi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L82" class="LineNr"> 82 </span> <a href='cell.mu.html#L102'>allocate-pair</a> out
<span id="L83" class="LineNr"> 83 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *out
<span id="L84" class="LineNr"> 84 </span> <span class="PreProc">var</span> left-ah/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get out-addr, left
<span id="L85" class="LineNr"> 85 </span> <a href='cell.mu.html#L39'>new-symbol</a> left-ah, <span class="Constant">&quot;,&quot;</span>
<span id="L86" class="LineNr"> 86 </span> <span class="PreProc">var</span> right-ah/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get out-addr, right
<span id="L87" class="LineNr"> 87 </span> <span class="PreProc">var</span> close-paren?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> copy <span class="Constant">0</span>/false
<span id="L88" class="LineNr"> 88 </span> <span class="PreProc">var</span> dot?/<span class="Constant">ecx</span>: boolean <span class="Special">&lt;-</span> copy <span class="Constant">0</span>/false
<span id="L89" class="LineNr"> 89 </span> close-paren?, dot? <span class="Special">&lt;-</span> <a href='parse.mu.html#L30'>parse-sexpression</a> tokens, right-ah, trace
<span id="L90" class="LineNr"> 90 </span> <span class="PreProc">return</span> close-paren?, dot?
<span id="L91" class="LineNr"> 91 </span> <span class="Delimiter">}</span>
<span id="L92" class="LineNr"> 92 </span> <span class="muComment"># unquote-splice -&gt; parse as list with a special car</span>
<span id="L93" class="LineNr"> 93 </span> <span class="PreProc">var</span> <a href='tokenize.mu.html#L867'>unquote-splice-token?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='tokenize.mu.html#L867'>unquote-splice-token?</a> curr-token
<span id="L94" class="LineNr"> 94 </span> compare <a href='tokenize.mu.html#L867'>unquote-splice-token?</a>, <span class="Constant">0</span>/false
<span id="L95" class="LineNr"> 95 </span> <span class="Delimiter">{</span>
<span id="L96" class="LineNr"> 96 </span> <span class="PreProc">break-if-=</span>
<span id="L97" class="LineNr"> 97 </span> <span class="PreProc">var</span> out/<span class="Constant">edi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L98" class="LineNr"> 98 </span> <a href='cell.mu.html#L102'>allocate-pair</a> out
<span id="L99" class="LineNr"> 99 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *out
<span id="L100" class="LineNr">100 </span> <span class="PreProc">var</span> left-ah/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get out-addr, left
<span id="L101" class="LineNr">101 </span> <a href='cell.mu.html#L39'>new-symbol</a> left-ah, <span class="Constant">&quot;,@&quot;</span>
<span id="L102" class="LineNr">102 </span> <span class="PreProc">var</span> right-ah/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get out-addr, right
<span id="L103" class="LineNr">103 </span> <span class="PreProc">var</span> close-paren?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> copy <span class="Constant">0</span>/false
<span id="L104" class="LineNr">104 </span> <span class="PreProc">var</span> dot?/<span class="Constant">ecx</span>: boolean <span class="Special">&lt;-</span> copy <span class="Constant">0</span>/false
<span id="L105" class="LineNr">105 </span> close-paren?, dot? <span class="Special">&lt;-</span> <a href='parse.mu.html#L30'>parse-sexpression</a> tokens, right-ah, trace
<span id="L106" class="LineNr">106 </span> <span class="PreProc">return</span> close-paren?, dot?
<span id="L107" class="LineNr">107 </span> <span class="Delimiter">}</span>
<span id="L108" class="LineNr">108 </span> <span class="muComment"># dot -&gt; return</span>
<span id="L109" class="LineNr">109 </span> <span class="PreProc">var</span> dot?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='tokenize.mu.html#L908'>dot-token?</a> curr-token
<span id="L110" class="LineNr">110 </span> compare dot?, <span class="Constant">0</span>/false
<span id="L111" class="LineNr">111 </span> <span class="Delimiter">{</span>
<span id="L112" class="LineNr">112 </span> <span class="PreProc">break-if-=</span>
<span id="L113" class="LineNr">113 </span> <a href='trace.mu.html#L155'>trace-higher</a> trace
<span id="L114" class="LineNr">114 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false, <span class="Constant">1</span>/true
<span id="L115" class="LineNr">115 </span> <span class="Delimiter">}</span>
<span id="L116" class="LineNr">116 </span> <span class="muComment"># not bracket -&gt; parse atom</span>
<span id="L117" class="LineNr">117 </span> <span class="PreProc">var</span> <a href='tokenize.mu.html#L823'>bracket-token?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='tokenize.mu.html#L823'>bracket-token?</a> curr-token
<span id="L118" class="LineNr">118 </span> compare <a href='tokenize.mu.html#L823'>bracket-token?</a>, <span class="Constant">0</span>/false
<span id="L119" class="LineNr">119 </span> <span class="Delimiter">{</span>
<span id="L120" class="LineNr">120 </span> <span class="PreProc">break-if-!=</span>
<span id="L121" class="LineNr">121 </span> <a href='parse.mu.html#L196'>parse-atom</a> curr-token, _out, trace
<span id="L122" class="LineNr">122 </span> <span class="PreProc">break</span> $parse-sexpression:type-check
<span id="L123" class="LineNr">123 </span> <span class="Delimiter">}</span>
<span id="L124" class="LineNr">124 </span> <span class="muComment"># open paren -&gt; parse list</span>
<span id="L125" class="LineNr">125 </span> <span class="PreProc">var</span> open-paren?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='tokenize.mu.html#L876'>open-paren-token?</a> curr-token
<span id="L126" class="LineNr">126 </span> compare open-paren?, <span class="Constant">0</span>/false
<span id="L127" class="LineNr">127 </span> <span class="Delimiter">{</span>
<span id="L128" class="LineNr">128 </span> <span class="PreProc">break-if-=</span>
<span id="L129" class="LineNr">129 </span> <span class="PreProc">var</span> curr/<span class="Constant">esi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L130" class="LineNr">130 </span> <a href='cell.mu.html#L102'>allocate-pair</a> curr
<span id="L131" class="LineNr">131 </span> <span class="PreProc">var</span> curr-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *curr
<span id="L132" class="LineNr">132 </span> <span class="PreProc">var</span> left/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get curr-addr, left
<span id="L133" class="LineNr">133 </span> <span class="Delimiter">{</span>
<span id="L134" class="LineNr">134 </span> <span class="PreProc">var</span> close-paren?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> copy <span class="Constant">0</span>/false
<span id="L135" class="LineNr">135 </span> <span class="PreProc">var</span> dot?/<span class="Constant">ecx</span>: boolean <span class="Special">&lt;-</span> copy <span class="Constant">0</span>/false
<span id="L136" class="LineNr">136 </span> close-paren?, dot? <span class="Special">&lt;-</span> <a href='parse.mu.html#L30'>parse-sexpression</a> tokens, left, trace
<span id="L137" class="LineNr">137 </span> <span class="Delimiter">{</span>
<span id="L138" class="LineNr">138 </span> compare dot?, <span class="Constant">0</span>/false
<span id="L139" class="LineNr">139 </span> <span class="PreProc">break-if-=</span>
<span id="L140" class="LineNr">140 </span> <span class="Special"><a href='trace.mu.html#L129'>error</a></span> trace, <span class="Constant">&quot;'.' cannot be at the start of a list&quot;</span>
<span id="L141" class="LineNr">141 </span> <span class="PreProc">return</span> <span class="Constant">1</span>/true, dot?
<span id="L142" class="LineNr">142 </span> <span class="Delimiter">}</span>
<span id="L143" class="LineNr">143 </span> compare close-paren?, <span class="Constant">0</span>/false
<span id="L144" class="LineNr">144 </span> <span class="PreProc">break-if-!=</span>
<span id="L145" class="LineNr">145 </span> <span class="PreProc">var</span> curr-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *curr
<span id="L146" class="LineNr">146 </span> curr <span class="Special">&lt;-</span> get curr-addr, right
<span id="L147" class="LineNr">147 </span> <span class="PreProc">var</span> tmp-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L148" class="LineNr">148 </span> <span class="PreProc">var</span> tmp/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address tmp-storage
<span id="L149" class="LineNr">149 </span> $parse-sexpression:list-loop: <span class="Delimiter">{</span>
<span id="L150" class="LineNr">150 </span> <span class="PreProc">var</span> close-paren?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> copy <span class="Constant">0</span>/false
<span id="L151" class="LineNr">151 </span> <span class="PreProc">var</span> dot?/<span class="Constant">ecx</span>: boolean <span class="Special">&lt;-</span> copy <span class="Constant">0</span>/false
<span id="L152" class="LineNr">152 </span> close-paren?, dot? <span class="Special">&lt;-</span> <a href='parse.mu.html#L30'>parse-sexpression</a> tokens, tmp, trace
<span id="L153" class="LineNr">153 </span> <span class="muComment"># '.' -&gt; clean up right here and return</span>
<span id="L154" class="LineNr">154 </span> compare dot?, <span class="Constant">0</span>/false
<span id="L155" class="LineNr">155 </span> <span class="Delimiter">{</span>
<span id="L156" class="LineNr">156 </span> <span class="PreProc">break-if-=</span>
<span id="L157" class="LineNr">157 </span> <a href='parse.mu.html#L254'>parse-dot-tail</a> tokens, curr, trace
<span id="L158" class="LineNr">158 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false, <span class="Constant">0</span>/false
<span id="L159" class="LineNr">159 </span> <span class="Delimiter">}</span>
<span id="L160" class="LineNr">160 </span> <a href='cell.mu.html#L102'>allocate-pair</a> curr
<span id="L161" class="LineNr">161 </span> <span class="muComment"># ')' -&gt; return</span>
<span id="L162" class="LineNr">162 </span> compare close-paren?, <span class="Constant">0</span>/false
<span id="L163" class="LineNr">163 </span> <span class="PreProc">break-if-!=</span>
<span id="L164" class="LineNr">164 </span> <span class="PreProc">var</span> curr-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *curr
<span id="L165" class="LineNr">165 </span> <span class="PreProc">var</span> left/<span class="Constant">ecx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get curr-addr, left
<span id="L166" class="LineNr">166 </span> copy-object tmp, left
<span id="L167" class="LineNr">167 </span> <span class="muComment">#</span>
<span id="L168" class="LineNr">168 </span> curr <span class="Special">&lt;-</span> get curr-addr, right
<span id="L169" class="LineNr">169 </span> <span class="PreProc">loop</span>
<span id="L170" class="LineNr">170 </span> <span class="Delimiter">}</span>
<span id="L171" class="LineNr">171 </span> <span class="Delimiter">}</span>
<span id="L172" class="LineNr">172 </span> <span class="PreProc">break</span> $parse-sexpression:type-check
<span id="L173" class="LineNr">173 </span> <span class="Delimiter">}</span>
<span id="L174" class="LineNr">174 </span> <span class="muComment"># close paren -&gt; return</span>
<span id="L175" class="LineNr">175 </span> <span class="PreProc">var</span> close-paren?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='tokenize.mu.html#L892'>close-paren-token?</a> curr-token
<span id="L176" class="LineNr">176 </span> compare close-paren?, <span class="Constant">0</span>/false
<span id="L177" class="LineNr">177 </span> <span class="Delimiter">{</span>
<span id="L178" class="LineNr">178 </span> <span class="PreProc">break-if-=</span>
<span id="L179" class="LineNr">179 </span> <a href='trace.mu.html#L155'>trace-higher</a> trace
<span id="L180" class="LineNr">180 </span> <span class="PreProc">return</span> <span class="Constant">1</span>/true, <span class="Constant">0</span>/false
<span id="L181" class="LineNr">181 </span> <span class="Delimiter">}</span>
<span id="L182" class="LineNr">182 </span> <span class="muComment"># otherwise abort</span>
<span id="L183" class="LineNr">183 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x400</span>)
<span id="L184" class="LineNr">184 </span> <span class="PreProc">var</span> stream/<span class="Constant">edx</span>: (addr stream byte) <span class="Special">&lt;-</span> address stream-storage
<span id="L185" class="LineNr">185 </span> <a href='../108write.subx.html#L11'>write</a> stream, <span class="Constant">&quot;unexpected token &quot;</span>
<span id="L186" class="LineNr">186 </span> <span class="PreProc">var</span> curr-token-data-ah/<span class="Constant">eax</span>: (addr handle stream byte) <span class="Special">&lt;-</span> get curr-token, text-data
<span id="L187" class="LineNr">187 </span> <span class="PreProc">var</span> curr-token-data/<span class="Constant">eax</span>: (addr stream byte) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *curr-token-data-ah
<span id="L188" class="LineNr">188 </span> <a href='../106stream.subx.html#L59'>rewind-stream</a> curr-token-data
<span id="L189" class="LineNr">189 </span> <a href='../113write-stream.subx.html#L8'>write-stream</a> stream, curr-token-data
<span id="L190" class="LineNr">190 </span> trace trace, <span class="Constant">&quot;error&quot;</span>, stream
<span id="L191" class="LineNr">191 </span> <span class="Delimiter">}</span>
<span id="L192" class="LineNr">192 </span> <a href='trace.mu.html#L155'>trace-higher</a> trace
<span id="L193" class="LineNr">193 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false, <span class="Constant">0</span>/false
<span id="L194" class="LineNr">194 </span><span class="Delimiter">}</span>
<span id="L195" class="LineNr">195 </span>
<span id="L196" class="LineNr">196 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='parse.mu.html#L196'>parse-atom</a></span> _curr-token: (addr <a href='cell.mu.html#L1'>cell</a>), _out: (addr handle <a href='cell.mu.html#L1'>cell</a>), trace: (addr trace) <span class="Delimiter">{</span>
<span id="L197" class="LineNr">197 </span> <a href='trace.mu.html#L120'>trace-text</a> trace, <span class="Constant">&quot;parse&quot;</span>, <span class="Constant">&quot;parse atom&quot;</span>
<span id="L198" class="LineNr">198 </span> <span class="PreProc">var</span> curr-token/<span class="Constant">ecx</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _curr-token
<span id="L199" class="LineNr">199 </span> <span class="PreProc">var</span> curr-token-data-ah/<span class="Constant">eax</span>: (addr handle stream byte) <span class="Special">&lt;-</span> get curr-token, text-data
<span id="L200" class="LineNr">200 </span> <span class="PreProc">var</span> _curr-token-data/<span class="Constant">eax</span>: (addr stream byte) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *curr-token-data-ah
<span id="L201" class="LineNr">201 </span> <span class="PreProc">var</span> curr-token-data/<span class="Constant">esi</span>: (addr stream byte) <span class="Special">&lt;-</span> copy _curr-token-data
<span id="L202" class="LineNr">202 </span> trace trace, <span class="Constant">&quot;parse&quot;</span>, curr-token-data
<span id="L203" class="LineNr">203 </span> <span class="muComment"># number</span>
<span id="L204" class="LineNr">204 </span> <span class="PreProc">var</span> <a href='tokenize.mu.html#L813'>number-token?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='tokenize.mu.html#L813'>number-token?</a> curr-token
<span id="L205" class="LineNr">205 </span> compare <a href='tokenize.mu.html#L813'>number-token?</a>, <span class="Constant">0</span>/false
<span id="L206" class="LineNr">206 </span> <span class="Delimiter">{</span>
<span id="L207" class="LineNr">207 </span> <span class="PreProc">break-if-=</span>
<span id="L208" class="LineNr">208 </span> <a href='../106stream.subx.html#L59'>rewind-stream</a> curr-token-data
<span id="L209" class="LineNr">209 </span> <span class="PreProc">var</span> _val/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='../311decimal-int.subx.html#L48'>parse-decimal-int-from-stream</a> curr-token-data
<span id="L210" class="LineNr">210 </span> <span class="PreProc">var</span> val/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy _val
<span id="L211" class="LineNr">211 </span> <span class="PreProc">var</span> val-float/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> convert val
<span id="L212" class="LineNr">212 </span> <a href='cell.mu.html#L68'>allocate-number</a> _out
<span id="L213" class="LineNr">213 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L214" class="LineNr">214 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *out
<span id="L215" class="LineNr">215 </span> <span class="PreProc">var</span> dest/<span class="Constant">edi</span>: (addr float) <span class="Special">&lt;-</span> get out-addr, number-data
<span id="L216" class="LineNr">216 </span> copy-to *dest, val-float
<span id="L217" class="LineNr">217 </span> <span class="Delimiter">{</span>
<span id="L218" class="LineNr">218 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x400</span>)
<span id="L219" class="LineNr">219 </span> <span class="PreProc">var</span> stream/<span class="Constant">ecx</span>: (addr stream byte) <span class="Special">&lt;-</span> address stream-storage
<span id="L220" class="LineNr">220 </span> <a href='../108write.subx.html#L11'>write</a> stream, <span class="Constant">&quot;=&gt; number &quot;</span>
<span id="L221" class="LineNr">221 </span> <a href='print.mu.html#L141'>print-number</a> out-addr, stream, <span class="Constant">0</span>/no-trace
<span id="L222" class="LineNr">222 </span> trace trace, <span class="Constant">&quot;parse&quot;</span>, stream
<span id="L223" class="LineNr">223 </span> <span class="Delimiter">}</span>
<span id="L224" class="LineNr">224 </span> <span class="PreProc">return</span>
<span id="L225" class="LineNr">225 </span> <span class="Delimiter">}</span>
<span id="L226" class="LineNr">226 </span> <span class="muComment"># default: copy either to a symbol or a stream</span>
<span id="L227" class="LineNr">227 </span> <span class="muComment"># stream token -&gt; literal</span>
<span id="L228" class="LineNr">228 </span> <span class="PreProc">var</span> <a href='tokenize.mu.html#L933'>stream-token?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='tokenize.mu.html#L933'>stream-token?</a> curr-token
<span id="L229" class="LineNr">229 </span> compare <a href='tokenize.mu.html#L933'>stream-token?</a>, <span class="Constant">0</span>/false
<span id="L230" class="LineNr">230 </span> <span class="Delimiter">{</span>
<span id="L231" class="LineNr">231 </span> <span class="PreProc">break-if-=</span>
<span id="L232" class="LineNr">232 </span> <a href='cell.mu.html#L58'>allocate-stream</a> _out
<span id="L233" class="LineNr">233 </span> <span class="Delimiter">}</span>
<span id="L234" class="LineNr">234 </span> compare <a href='tokenize.mu.html#L933'>stream-token?</a>, <span class="Constant">0</span>/false
<span id="L235" class="LineNr">235 </span> <span class="Delimiter">{</span>
<span id="L236" class="LineNr">236 </span> <span class="PreProc">break-if-!=</span>
<span id="L237" class="LineNr">237 </span> <a href='cell.mu.html#L21'>allocate-symbol</a> _out
<span id="L238" class="LineNr">238 </span> <span class="Delimiter">}</span>
<span id="L239" class="LineNr">239 </span><span class="Delimiter">}</span>
<span id="L239" class="LineNr">239 </span> <span class="muComment"># copy token data</span>
<span id="L240" class="LineNr">240 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L241" class="LineNr">241 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *out
<span id="L242" class="LineNr">242 </span> <span class="PreProc">var</span> curr-token-data-ah/<span class="Constant">ecx</span>: (addr handle stream byte) <span class="Special">&lt;-</span> get curr-token, text-data
<span id="L243" class="LineNr">243 </span> <span class="PreProc">var</span> dest-ah/<span class="Constant">edx</span>: (addr handle stream byte) <span class="Special">&lt;-</span> get out-addr, text-data
<span id="L244" class="LineNr">244 </span> copy-object curr-token-data-ah, dest-ah
<span id="L245" class="LineNr">245 </span> <span class="Delimiter">{</span>
<span id="L246" class="LineNr">246 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x400</span>)
<span id="L247" class="LineNr">247 </span> <span class="PreProc">var</span> stream/<span class="Constant">ecx</span>: (addr stream byte) <span class="Special">&lt;-</span> address stream-storage
<span id="L248" class="LineNr">248 </span> <a href='../108write.subx.html#L11'>write</a> stream, <span class="Constant">&quot;=&gt; symbol &quot;</span>
<span id="L249" class="LineNr">249 </span> <a href='print.mu.html#L101'>print-symbol</a> out-addr, stream, <span class="Constant">0</span>/no-trace
<span id="L250" class="LineNr">250 </span> trace trace, <span class="Constant">&quot;parse&quot;</span>, stream
<span id="L251" class="LineNr">251 </span> <span class="Delimiter">}</span>
<span id="L252" class="LineNr">252 </span><span class="Delimiter">}</span>
<span id="L253" class="LineNr">253 </span>
<span id="L254" class="LineNr">254 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='parse.mu.html#L254'>parse-dot-tail</a></span> tokens: (addr stream <a href='cell.mu.html#L1'>cell</a>), _out: (addr handle <a href='cell.mu.html#L1'>cell</a>), trace: (addr trace) <span class="Delimiter">{</span>
<span id="L255" class="LineNr">255 </span> <span class="PreProc">var</span> out/<span class="Constant">edi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L256" class="LineNr">256 </span> <span class="PreProc">var</span> close-paren?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> copy <span class="Constant">0</span>/false
<span id="L257" class="LineNr">257 </span> <span class="PreProc">var</span> dot?/<span class="Constant">ecx</span>: boolean <span class="Special">&lt;-</span> copy <span class="Constant">0</span>/false
<span id="L258" class="LineNr">258 </span> close-paren?, dot? <span class="Special">&lt;-</span> <a href='parse.mu.html#L30'>parse-sexpression</a> tokens, out, trace
<span id="L259" class="LineNr">259 </span> compare close-paren?, <span class="Constant">0</span>/false
<span id="L260" class="LineNr">260 </span> <span class="Delimiter">{</span>
<span id="L261" class="LineNr">261 </span> <span class="PreProc">break-if-=</span>
<span id="L262" class="LineNr">262 </span> <span class="Special"><a href='trace.mu.html#L129'>error</a></span> trace, <span class="Constant">&quot;'. )' makes no sense&quot;</span>
<span id="L263" class="LineNr">263 </span> <span class="PreProc">return</span>
<span id="L264" class="LineNr">264 </span> <span class="Delimiter">}</span>
<span id="L265" class="LineNr">265 </span> compare dot?, <span class="Constant">0</span>/false
<span id="L266" class="LineNr">266 </span> <span class="Delimiter">{</span>
<span id="L267" class="LineNr">267 </span> <span class="PreProc">break-if-=</span>
<span id="L268" class="LineNr">268 </span> <span class="Special"><a href='trace.mu.html#L129'>error</a></span> trace, <span class="Constant">&quot;'. .' makes no sense&quot;</span>
<span id="L269" class="LineNr">269 </span> <span class="PreProc">return</span>
<span id="L270" class="LineNr">270 </span> <span class="Delimiter">}</span>
<span id="L271" class="LineNr">271 </span> <span class="muComment">#</span>
<span id="L272" class="LineNr">272 </span> <span class="PreProc">var</span> dummy: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L273" class="LineNr">273 </span> <span class="PreProc">var</span> dummy-ah/<span class="Constant">edi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address dummy
<span id="L274" class="LineNr">274 </span> close-paren?, dot? <span class="Special">&lt;-</span> <a href='parse.mu.html#L30'>parse-sexpression</a> tokens, dummy-ah, trace
<span id="L275" class="LineNr">275 </span> compare close-paren?, <span class="Constant">0</span>/false
<span id="L276" class="LineNr">276 </span> <span class="Delimiter">{</span>
<span id="L277" class="LineNr">277 </span> <span class="PreProc">break-if-!=</span>
<span id="L278" class="LineNr">278 </span> <span class="Special"><a href='trace.mu.html#L129'>error</a></span> trace, <span class="Constant">&quot;cannot have multiple expressions between '.' and ')'&quot;</span>
<span id="L279" class="LineNr">279 </span> <span class="PreProc">return</span>
<span id="L280" class="LineNr">280 </span> <span class="Delimiter">}</span>
<span id="L281" class="LineNr">281 </span> compare dot?, <span class="Constant">0</span>/false
<span id="L282" class="LineNr">282 </span> <span class="Delimiter">{</span>
<span id="L283" class="LineNr">283 </span> <span class="PreProc">break-if-=</span>
<span id="L284" class="LineNr">284 </span> <span class="Special"><a href='trace.mu.html#L129'>error</a></span> trace, <span class="Constant">&quot;cannot have two dots in a single list&quot;</span>
<span id="L285" class="LineNr">285 </span> <span class="PreProc">return</span>
<span id="L286" class="LineNr">286 </span> <span class="Delimiter">}</span>
<span id="L287" class="LineNr">287 </span><span class="Delimiter">}</span>
</pre>
</body>
</html>

452
html/shell/print.mu.html generated
View File

@ -62,7 +62,7 @@ if ('onhashchange' in window) {
<span id="L3" class="LineNr"> 3 </span> <a href='trace.mu.html#L120'>trace-text</a> trace, <span class="Constant">&quot;print&quot;</span>, <span class="Constant">&quot;print&quot;</span>
<span id="L4" class="LineNr"> 4 </span> <a href='trace.mu.html#L147'>trace-lower</a> trace
<span id="L5" class="LineNr"> 5 </span> <span class="PreProc">var</span> in/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _in
<span id="L6" class="LineNr"> 6 </span> <span class="PreProc">var</span> in-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *in
<span id="L6" class="LineNr"> 6 </span> <span class="PreProc">var</span> in-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *in
<span id="L7" class="LineNr"> 7 </span> <span class="Delimiter">{</span>
<span id="L8" class="LineNr"> 8 </span> compare in-addr, <span class="Constant">0</span>
<span id="L9" class="LineNr"> 9 </span> <span class="PreProc">break-if-!=</span>
@ -71,8 +71,8 @@ if ('onhashchange' in window) {
<span id="L12" class="LineNr"> 12 </span> <span class="PreProc">return</span>
<span id="L13" class="LineNr"> 13 </span> <span class="Delimiter">}</span>
<span id="L14" class="LineNr"> 14 </span> <span class="Delimiter">{</span>
<span id="L15" class="LineNr"> 15 </span> <span class="PreProc">var</span> <a href='print.mu.html#L194'>nil?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='print.mu.html#L194'>nil?</a> in-addr
<span id="L16" class="LineNr"> 16 </span> compare <a href='print.mu.html#L194'>nil?</a>, <span class="Constant">0</span>/false
<span id="L15" class="LineNr"> 15 </span> <span class="PreProc">var</span> <a href='print.mu.html#L236'>nil?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='print.mu.html#L236'>nil?</a> in-addr
<span id="L16" class="LineNr"> 16 </span> compare <a href='print.mu.html#L236'>nil?</a>, <span class="Constant">0</span>/false
<span id="L17" class="LineNr"> 17 </span> <span class="PreProc">break-if-=</span>
<span id="L18" class="LineNr"> 18 </span> <a href='../108write.subx.html#L11'>write</a> out, <span class="Constant">&quot;()&quot;</span>
<span id="L19" class="LineNr"> 19 </span> <a href='trace.mu.html#L155'>trace-higher</a> trace
@ -82,7 +82,7 @@ if ('onhashchange' in window) {
<span id="L23" class="LineNr"> 23 </span> compare *in-type, <span class="Constant">0</span>/pair
<span id="L24" class="LineNr"> 24 </span> <span class="Delimiter">{</span>
<span id="L25" class="LineNr"> 25 </span> <span class="PreProc">break-if-!=</span>
<span id="L26" class="LineNr"> 26 </span> <a href='print.mu.html#L155'>print-list</a> in-addr, out, trace
<span id="L26" class="LineNr"> 26 </span> <a href='print.mu.html#L155'>print-pair</a> in-addr, out, trace
<span id="L27" class="LineNr"> 27 </span> <a href='trace.mu.html#L155'>trace-higher</a> trace
<span id="L28" class="LineNr"> 28 </span> <span class="PreProc">return</span>
<span id="L29" class="LineNr"> 29 </span> <span class="Delimiter">}</span>
@ -119,7 +119,7 @@ if ('onhashchange' in window) {
<span id="L60" class="LineNr"> 60 </span> <span class="PreProc">break-if-!=</span>
<span id="L61" class="LineNr"> 61 </span> <a href='../108write.subx.html#L11'>write</a> out, <span class="Constant">&quot;[screen &quot;</span>
<span id="L62" class="LineNr"> 62 </span> <span class="PreProc">var</span> screen-ah/<span class="Constant">eax</span>: (addr handle <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> get in-addr, screen-data
<span id="L63" class="LineNr"> 63 </span> <span class="PreProc">var</span> <a href='../500fake-screen.mu.html#L14'>screen</a>/<span class="Constant">eax</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *screen-ah
<span id="L63" class="LineNr"> 63 </span> <span class="PreProc">var</span> <a href='../500fake-screen.mu.html#L14'>screen</a>/<span class="Constant">eax</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *screen-ah
<span id="L64" class="LineNr"> 64 </span> <span class="PreProc">var</span> screen-addr/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L65" class="LineNr"> 65 </span> <a href='../117write-int-hex.subx.html#L92'>write-int32-hex</a> out, screen-addr
<span id="L66" class="LineNr"> 66 </span> <a href='../108write.subx.html#L11'>write</a> out, <span class="Constant">&quot;]&quot;</span>
@ -131,7 +131,7 @@ if ('onhashchange' in window) {
<span id="L72" class="LineNr"> 72 </span> <span class="PreProc">break-if-!=</span>
<span id="L73" class="LineNr"> 73 </span> <a href='../108write.subx.html#L11'>write</a> out, <span class="Constant">&quot;[keyboard &quot;</span>
<span id="L74" class="LineNr"> 74 </span> <span class="PreProc">var</span> keyboard-ah/<span class="Constant">eax</span>: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> get in-addr, keyboard-data
<span id="L75" class="LineNr"> 75 </span> <span class="PreProc">var</span> keyboard/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *keyboard-ah
<span id="L75" class="LineNr"> 75 </span> <span class="PreProc">var</span> keyboard/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *keyboard-ah
<span id="L76" class="LineNr"> 76 </span> <span class="PreProc">var</span> keyboard-addr/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy keyboard
<span id="L77" class="LineNr"> 77 </span> <a href='../117write-int-hex.subx.html#L92'>write-int32-hex</a> out, keyboard-addr
<span id="L78" class="LineNr"> 78 </span> <a href='../108write.subx.html#L11'>write</a> out, <span class="Constant">&quot;]&quot;</span>
@ -142,7 +142,7 @@ if ('onhashchange' in window) {
<span id="L83" class="LineNr"> 83 </span>
<span id="L84" class="LineNr"> 84 </span><span class="muComment"># debug helper</span>
<span id="L85" class="LineNr"> 85 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='print.mu.html#L85'>dump-cell-at-top-right</a></span> in-ah: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Delimiter">{</span>
<span id="L86" class="LineNr"> 86 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x200</span>)
<span id="L86" class="LineNr"> 86 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x1000</span>)
<span id="L87" class="LineNr"> 87 </span> <span class="PreProc">var</span> stream/<span class="Constant">edx</span>: (addr stream byte) <span class="Special">&lt;-</span> address stream-storage
<span id="L88" class="LineNr"> 88 </span> <a href='print.mu.html#L1'>print-cell</a> in-ah, stream, <span class="Constant">0</span>/no-trace
<span id="L89" class="LineNr"> 89 </span> <span class="PreProc">var</span> d1/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
@ -154,14 +154,14 @@ if ('onhashchange' in window) {
<span id="L95" class="LineNr"> 95 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x200</span>)
<span id="L96" class="LineNr"> 96 </span> <span class="PreProc">var</span> stream/<span class="Constant">edx</span>: (addr stream byte) <span class="Special">&lt;-</span> address stream-storage
<span id="L97" class="LineNr"> 97 </span> <a href='print.mu.html#L1'>print-cell</a> in-ah, stream, <span class="Constant">0</span>/no-trace
<span id="L98" class="LineNr"> 98 </span> <a href='../501draw-text.mu.html#L214'>draw-stream-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, stream, <span class="Constant">7</span>/fg, <span class="Constant">0xc5</span>/bg=blue-bg
<span id="L98" class="LineNr"> 98 </span> <a href='../501draw-text.mu.html#L214'>draw-stream-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, stream, <span class="Constant">7</span>/fg, <span class="Constant">0</span>/bg
<span id="L99" class="LineNr"> 99 </span><span class="Delimiter">}</span>
<span id="L100" class="LineNr">100 </span>
<span id="L101" class="LineNr">101 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='print.mu.html#L101'>print-symbol</a></span> _in: (addr <a href='cell.mu.html#L1'>cell</a>), out: (addr stream byte), trace: (addr trace) <span class="Delimiter">{</span>
<span id="L102" class="LineNr">102 </span> <a href='trace.mu.html#L120'>trace-text</a> trace, <span class="Constant">&quot;print&quot;</span>, <span class="Constant">&quot;symbol&quot;</span>
<span id="L103" class="LineNr">103 </span> <span class="PreProc">var</span> in/<span class="Constant">esi</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _in
<span id="L104" class="LineNr">104 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">eax</span>: (addr handle stream byte) <span class="Special">&lt;-</span> get in, text-data
<span id="L105" class="LineNr">105 </span> <span class="PreProc">var</span> _data/<span class="Constant">eax</span>: (addr stream byte) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L105" class="LineNr">105 </span> <span class="PreProc">var</span> _data/<span class="Constant">eax</span>: (addr stream byte) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L106" class="LineNr">106 </span> <span class="PreProc">var</span> data/<span class="Constant">esi</span>: (addr stream byte) <span class="Special">&lt;-</span> copy _data
<span id="L107" class="LineNr">107 </span> <a href='../106stream.subx.html#L59'>rewind-stream</a> data
<span id="L108" class="LineNr">108 </span> <a href='../113write-stream.subx.html#L8'>write-stream</a> out, data
@ -180,7 +180,7 @@ if ('onhashchange' in window) {
<span id="L121" class="LineNr">121 </span> <a href='trace.mu.html#L120'>trace-text</a> trace, <span class="Constant">&quot;print&quot;</span>, <span class="Constant">&quot;stream&quot;</span>
<span id="L122" class="LineNr">122 </span> <span class="PreProc">var</span> in/<span class="Constant">esi</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _in
<span id="L123" class="LineNr">123 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">eax</span>: (addr handle stream byte) <span class="Special">&lt;-</span> get in, text-data
<span id="L124" class="LineNr">124 </span> <span class="PreProc">var</span> _data/<span class="Constant">eax</span>: (addr stream byte) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L124" class="LineNr">124 </span> <span class="PreProc">var</span> _data/<span class="Constant">eax</span>: (addr stream byte) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L125" class="LineNr">125 </span> <span class="PreProc">var</span> data/<span class="Constant">esi</span>: (addr stream byte) <span class="Special">&lt;-</span> copy _data
<span id="L126" class="LineNr">126 </span> <a href='../106stream.subx.html#L59'>rewind-stream</a> data
<span id="L127" class="LineNr">127 </span> <a href='../108write.subx.html#L11'>write</a> out, <span class="Constant">&quot;[&quot;</span>
@ -211,211 +211,253 @@ if ('onhashchange' in window) {
<span id="L152" class="LineNr">152 </span> trace trace, <span class="Constant">&quot;print&quot;</span>, stream
<span id="L153" class="LineNr">153 </span><span class="Delimiter">}</span>
<span id="L154" class="LineNr">154 </span>
<span id="L155" class="LineNr">155 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='print.mu.html#L155'>print-list</a></span> _in: (addr <a href='cell.mu.html#L1'>cell</a>), out: (addr stream byte), trace: (addr trace) <span class="Delimiter">{</span>
<span id="L156" class="LineNr">156 </span> <span class="PreProc">var</span> curr/<span class="Constant">esi</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _in
<span id="L157" class="LineNr">157 </span> <a href='../108write.subx.html#L11'>write</a> out, <span class="Constant">&quot;(&quot;</span>
<span id="L158" class="LineNr">158 </span> $print-list:<span class="PreProc">loop</span>: <span class="Delimiter">{</span>
<span id="L159" class="LineNr">159 </span> <span class="PreProc">var</span> left/<span class="Constant">ecx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get curr, left
<span id="L160" class="LineNr">160 </span> <a href='print.mu.html#L1'>print-cell</a> left, out, trace
<span id="L161" class="LineNr">161 </span> <span class="PreProc">var</span> right/<span class="Constant">ecx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get curr, right
<span id="L162" class="LineNr">162 </span> <span class="PreProc">var</span> right-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *right
<span id="L163" class="LineNr">163 </span> <span class="Delimiter">{</span>
<span id="L164" class="LineNr">164 </span> compare right-addr, <span class="Constant">0</span>
<span id="L165" class="LineNr">165 </span> <span class="PreProc">break-if-!=</span>
<span id="L166" class="LineNr">166 </span> <a href='../501draw-text.mu.html#L481'>abort</a> <span class="Constant">&quot;null encountered&quot;</span>
<span id="L167" class="LineNr">167 </span> <span class="Delimiter">}</span>
<span id="L168" class="LineNr">168 </span> <span class="Delimiter">{</span>
<span id="L169" class="LineNr">169 </span> <span class="PreProc">var</span> right-nil?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='print.mu.html#L194'>nil?</a> right-addr
<span id="L170" class="LineNr">170 </span> compare right-nil?, <span class="Constant">0</span>/false
<span id="L171" class="LineNr">171 </span> <span class="Delimiter">{</span>
<span id="L172" class="LineNr">172 </span> <span class="PreProc">break-if-=</span>
<span id="L173" class="LineNr">173 </span> <a href='trace.mu.html#L120'>trace-text</a> trace, <span class="Constant">&quot;print&quot;</span>, <span class="Constant">&quot;right is nil&quot;</span>
<span id="L174" class="LineNr">174 </span> <span class="PreProc">break</span> $print-list:<span class="PreProc">loop</span>
<span id="L175" class="LineNr">175 </span> <span class="Delimiter">}</span>
<span id="L176" class="LineNr">176 </span> <span class="Delimiter">}</span>
<span id="L177" class="LineNr">177 </span> <a href='../108write.subx.html#L11'>write</a> out, <span class="Constant">&quot; &quot;</span>
<span id="L178" class="LineNr">178 </span> <span class="PreProc">var</span> right-type-addr/<span class="Constant">edx</span>: (addr int) <span class="Special">&lt;-</span> get right-addr, <span class="PreProc">type</span>
<span id="L179" class="LineNr">179 </span> <span class="Delimiter">{</span>
<span id="L180" class="LineNr">180 </span> compare *right-type-addr, <span class="Constant">0</span>/pair
<span id="L181" class="LineNr">181 </span> <span class="PreProc">break-if-=</span>
<span id="L182" class="LineNr">182 </span> <a href='../108write.subx.html#L11'>write</a> out, <span class="Constant">&quot;. &quot;</span>
<span id="L183" class="LineNr">183 </span> <a href='print.mu.html#L1'>print-cell</a> right, out, trace
<span id="L184" class="LineNr">184 </span> <span class="PreProc">break</span> $print-list:<span class="PreProc">loop</span>
<span id="L185" class="LineNr">185 </span> <span class="Delimiter">}</span>
<span id="L186" class="LineNr">186 </span> curr <span class="Special">&lt;-</span> copy right-addr
<span id="L187" class="LineNr">187 </span> <span class="PreProc">loop</span>
<span id="L188" class="LineNr">188 </span> <span class="Delimiter">}</span>
<span id="L189" class="LineNr">189 </span> <a href='../108write.subx.html#L11'>write</a> out, <span class="Constant">&quot;)&quot;</span>
<span id="L190" class="LineNr">190 </span><span class="Delimiter">}</span>
<span id="L191" class="LineNr">191 </span>
<span id="L192" class="LineNr">192 </span><span class="muComment"># Most lisps intern nil, but we don't really have globals yet, so we'll be</span>
<span id="L193" class="LineNr">193 </span><span class="muComment"># less efficient for now.</span>
<span id="L194" class="LineNr">194 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='print.mu.html#L194'>nil?</a></span> _in: (addr <a href='cell.mu.html#L1'>cell</a>)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean <span class="Delimiter">{</span>
<span id="L195" class="LineNr">195 </span> <span class="PreProc">var</span> in/<span class="Constant">esi</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _in
<span id="L196" class="LineNr">196 </span> <span class="muComment"># if type != pair, return false</span>
<span id="L197" class="LineNr">197 </span> <span class="PreProc">var</span> <span class="PreProc">type</span>/<span class="Constant">eax</span>: (addr int) <span class="Special">&lt;-</span> get in, <span class="PreProc">type</span>
<span id="L198" class="LineNr">198 </span> compare *<span class="PreProc">type</span>, <span class="Constant">0</span>/pair
<span id="L199" class="LineNr">199 </span> <span class="Delimiter">{</span>
<span id="L200" class="LineNr">200 </span> <span class="PreProc">break-if-=</span>
<span id="L201" class="LineNr">201 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L202" class="LineNr">202 </span> <span class="Delimiter">}</span>
<span id="L203" class="LineNr">203 </span> <span class="muComment"># if left != null, return false</span>
<span id="L204" class="LineNr">204 </span> <span class="PreProc">var</span> left-ah/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get in, left
<span id="L205" class="LineNr">205 </span> <span class="PreProc">var</span> left/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *left-ah
<span id="L206" class="LineNr">206 </span> compare left, <span class="Constant">0</span>
<span id="L207" class="LineNr">207 </span> <span class="Delimiter">{</span>
<span id="L208" class="LineNr">208 </span> <span class="PreProc">break-if-=</span>
<span id="L209" class="LineNr">209 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L210" class="LineNr">210 </span> <span class="Delimiter">}</span>
<span id="L211" class="LineNr">211 </span> <span class="muComment"># if right != null, return false</span>
<span id="L212" class="LineNr">212 </span> <span class="PreProc">var</span> right-ah/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get in, right
<span id="L213" class="LineNr">213 </span> <span class="PreProc">var</span> right/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *right-ah
<span id="L214" class="LineNr">214 </span> compare right, <span class="Constant">0</span>
<span id="L215" class="LineNr">215 </span> <span class="Delimiter">{</span>
<span id="L216" class="LineNr">216 </span> <span class="PreProc">break-if-=</span>
<span id="L217" class="LineNr">217 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L218" class="LineNr">218 </span> <span class="Delimiter">}</span>
<span id="L219" class="LineNr">219 </span> <span class="PreProc">return</span> <span class="Constant">1</span>/true
<span id="L220" class="LineNr">220 </span><span class="Delimiter">}</span>
<span id="L221" class="LineNr">221 </span>
<span id="L222" class="LineNr">222 </span><span class="PreProc">fn</span> <span class="muTest"><a href='print.mu.html#L222'>test-print-cell-zero</a></span> <span class="Delimiter">{</span>
<span id="L223" class="LineNr">223 </span> <span class="PreProc">var</span> num-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L224" class="LineNr">224 </span> <span class="PreProc">var</span> num/<span class="Constant">esi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address num-storage
<span id="L225" class="LineNr">225 </span> <a href='cell.mu.html#L83'>new-integer</a> num, <span class="Constant">0</span>
<span id="L226" class="LineNr">226 </span> <span class="PreProc">var</span> out-storage: (stream byte <span class="Constant">0x40</span>)
<span id="L227" class="LineNr">227 </span> <span class="PreProc">var</span> out/<span class="Constant">edi</span>: (addr stream byte) <span class="Special">&lt;-</span> address out-storage
<span id="L228" class="LineNr">228 </span> <a href='print.mu.html#L1'>print-cell</a> num, out, <span class="Constant">0</span>/no-trace
<span id="L229" class="LineNr">229 </span> <a href='../109stream-equal.subx.html#L194'>check-stream-equal</a> out, <span class="Constant">&quot;0&quot;</span>, <span class="Constant">&quot;F - test-print-cell-zero&quot;</span>
<span id="L230" class="LineNr">230 </span><span class="Delimiter">}</span>
<span id="L231" class="LineNr">231 </span>
<span id="L232" class="LineNr">232 </span><span class="PreProc">fn</span> <span class="muTest"><a href='print.mu.html#L232'>test-print-cell-integer</a></span> <span class="Delimiter">{</span>
<span id="L233" class="LineNr">233 </span> <span class="PreProc">var</span> num-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L234" class="LineNr">234 </span> <span class="PreProc">var</span> num/<span class="Constant">esi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address num-storage
<span id="L235" class="LineNr">235 </span> <a href='cell.mu.html#L83'>new-integer</a> num, <span class="Constant">1</span>
<span id="L236" class="LineNr">236 </span> <span class="PreProc">var</span> out-storage: (stream byte <span class="Constant">0x40</span>)
<span id="L237" class="LineNr">237 </span> <span class="PreProc">var</span> out/<span class="Constant">edi</span>: (addr stream byte) <span class="Special">&lt;-</span> address out-storage
<span id="L238" class="LineNr">238 </span> <a href='print.mu.html#L1'>print-cell</a> num, out, <span class="Constant">0</span>/no-trace
<span id="L239" class="LineNr">239 </span> <a href='../109stream-equal.subx.html#L194'>check-stream-equal</a> out, <span class="Constant">&quot;1&quot;</span>, <span class="Constant">&quot;F - test-print-cell-integer&quot;</span>
<span id="L240" class="LineNr">240 </span><span class="Delimiter">}</span>
<span id="L241" class="LineNr">241 </span>
<span id="L242" class="LineNr">242 </span><span class="PreProc">fn</span> <span class="muTest"><a href='print.mu.html#L242'>test-print-cell-integer-2</a></span> <span class="Delimiter">{</span>
<span id="L243" class="LineNr">243 </span> <span class="PreProc">var</span> num-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L244" class="LineNr">244 </span> <span class="PreProc">var</span> num/<span class="Constant">esi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address num-storage
<span id="L245" class="LineNr">245 </span> <a href='cell.mu.html#L83'>new-integer</a> num, <span class="Constant">0x30</span>
<span id="L246" class="LineNr">246 </span> <span class="PreProc">var</span> out-storage: (stream byte <span class="Constant">0x40</span>)
<span id="L247" class="LineNr">247 </span> <span class="PreProc">var</span> out/<span class="Constant">edi</span>: (addr stream byte) <span class="Special">&lt;-</span> address out-storage
<span id="L248" class="LineNr">248 </span> <a href='print.mu.html#L1'>print-cell</a> num, out, <span class="Constant">0</span>/no-trace
<span id="L249" class="LineNr">249 </span> <a href='../109stream-equal.subx.html#L194'>check-stream-equal</a> out, <span class="Constant">&quot;48&quot;</span>, <span class="Constant">&quot;F - test-print-cell-integer-2&quot;</span>
<span id="L250" class="LineNr">250 </span><span class="Delimiter">}</span>
<span id="L251" class="LineNr">251 </span>
<span id="L252" class="LineNr">252 </span><span class="PreProc">fn</span> <span class="muTest"><a href='print.mu.html#L252'>test-print-cell-fraction</a></span> <span class="Delimiter">{</span>
<span id="L253" class="LineNr">253 </span> <span class="PreProc">var</span> num-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L254" class="LineNr">254 </span> <span class="PreProc">var</span> num/<span class="Constant">esi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address num-storage
<span id="L255" class="LineNr">255 </span> <span class="PreProc">var</span> val/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> <a href='../408float.mu.html#L18'>rational</a> <span class="Constant">1</span>, <span class="Constant">2</span>
<span id="L256" class="LineNr">256 </span> <a href='cell.mu.html#L96'>new-float</a> num, val
<span id="L257" class="LineNr">257 </span> <span class="PreProc">var</span> out-storage: (stream byte <span class="Constant">0x40</span>)
<span id="L258" class="LineNr">258 </span> <span class="PreProc">var</span> out/<span class="Constant">edi</span>: (addr stream byte) <span class="Special">&lt;-</span> address out-storage
<span id="L259" class="LineNr">259 </span> <a href='print.mu.html#L1'>print-cell</a> num, out, <span class="Constant">0</span>/no-trace
<span id="L260" class="LineNr">260 </span> <a href='../109stream-equal.subx.html#L194'>check-stream-equal</a> out, <span class="Constant">&quot;0.5&quot;</span>, <span class="Constant">&quot;F - test-print-cell-fraction&quot;</span>
<span id="L261" class="LineNr">261 </span><span class="Delimiter">}</span>
<span id="L262" class="LineNr">262 </span>
<span id="L263" class="LineNr">263 </span><span class="PreProc">fn</span> <span class="muTest"><a href='print.mu.html#L263'>test-print-cell-symbol</a></span> <span class="Delimiter">{</span>
<span id="L264" class="LineNr">264 </span> <span class="PreProc">var</span> sym-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L265" class="LineNr">265 </span> <span class="PreProc">var</span> sym/<span class="Constant">esi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address sym-storage
<span id="L266" class="LineNr">266 </span> <a href='cell.mu.html#L38'>new-symbol</a> sym, <span class="Constant">&quot;abc&quot;</span>
<span id="L267" class="LineNr">267 </span> <span class="PreProc">var</span> out-storage: (stream byte <span class="Constant">0x40</span>)
<span id="L268" class="LineNr">268 </span> <span class="PreProc">var</span> out/<span class="Constant">edi</span>: (addr stream byte) <span class="Special">&lt;-</span> address out-storage
<span id="L269" class="LineNr">269 </span> <a href='print.mu.html#L1'>print-cell</a> sym, out, <span class="Constant">0</span>/no-trace
<span id="L270" class="LineNr">270 </span> <a href='../109stream-equal.subx.html#L194'>check-stream-equal</a> out, <span class="Constant">&quot;abc&quot;</span>, <span class="Constant">&quot;F - test-print-cell-symbol&quot;</span>
<span id="L271" class="LineNr">271 </span><span class="Delimiter">}</span>
<span id="L272" class="LineNr">272 </span>
<span id="L273" class="LineNr">273 </span><span class="PreProc">fn</span> <span class="muTest"><a href='print.mu.html#L273'>test-print-cell-nil-list</a></span> <span class="Delimiter">{</span>
<span id="L274" class="LineNr">274 </span> <span class="PreProc">var</span> nil-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L275" class="LineNr">275 </span> <span class="PreProc">var</span> <a href='cell.mu.html#L120'>nil</a>/<span class="Constant">esi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address nil-storage
<span id="L276" class="LineNr">276 </span> <a href='cell.mu.html#L101'>allocate-pair</a> <a href='cell.mu.html#L120'>nil</a>
<span id="L277" class="LineNr">277 </span> <span class="PreProc">var</span> out-storage: (stream byte <span class="Constant">0x40</span>)
<span id="L278" class="LineNr">278 </span> <span class="PreProc">var</span> out/<span class="Constant">edi</span>: (addr stream byte) <span class="Special">&lt;-</span> address out-storage
<span id="L279" class="LineNr">279 </span> <a href='print.mu.html#L1'>print-cell</a> <a href='cell.mu.html#L120'>nil</a>, out, <span class="Constant">0</span>/no-trace
<span id="L280" class="LineNr">280 </span> <a href='../109stream-equal.subx.html#L194'>check-stream-equal</a> out, <span class="Constant">&quot;()&quot;</span>, <span class="Constant">&quot;F - test-print-cell-nil-list&quot;</span>
<span id="L281" class="LineNr">281 </span><span class="Delimiter">}</span>
<span id="L282" class="LineNr">282 </span>
<span id="L283" class="LineNr">283 </span><span class="PreProc">fn</span> <span class="muTest"><a href='print.mu.html#L283'>test-print-cell-singleton-list</a></span> <span class="Delimiter">{</span>
<span id="L284" class="LineNr">284 </span> <span class="muComment"># list</span>
<span id="L285" class="LineNr">285 </span> <span class="PreProc">var</span> left-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L286" class="LineNr">286 </span> <span class="PreProc">var</span> left/<span class="Constant">ecx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address left-storage
<span id="L287" class="LineNr">287 </span> <a href='cell.mu.html#L38'>new-symbol</a> left, <span class="Constant">&quot;abc&quot;</span>
<span id="L288" class="LineNr">288 </span> <span class="PreProc">var</span> nil-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L289" class="LineNr">289 </span> <span class="PreProc">var</span> <a href='cell.mu.html#L120'>nil</a>/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address nil-storage
<span id="L290" class="LineNr">290 </span> <a href='cell.mu.html#L101'>allocate-pair</a> <a href='cell.mu.html#L120'>nil</a>
<span id="L291" class="LineNr">291 </span> <span class="PreProc">var</span> list-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L292" class="LineNr">292 </span> <span class="PreProc">var</span> list/<span class="Constant">esi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address list-storage
<span id="L293" class="LineNr">293 </span> <a href='cell.mu.html#L115'>new-pair</a> list, *left, *nil
<span id="L294" class="LineNr">294 </span> <span class="muComment">#</span>
<span id="L295" class="LineNr">295 </span> <span class="PreProc">var</span> out-storage: (stream byte <span class="Constant">0x40</span>)
<span id="L296" class="LineNr">296 </span> <span class="PreProc">var</span> out/<span class="Constant">edi</span>: (addr stream byte) <span class="Special">&lt;-</span> address out-storage
<span id="L297" class="LineNr">297 </span> <a href='print.mu.html#L1'>print-cell</a> list, out, <span class="Constant">0</span>/no-trace
<span id="L298" class="LineNr">298 </span> <a href='../109stream-equal.subx.html#L194'>check-stream-equal</a> out, <span class="Constant">&quot;(abc)&quot;</span>, <span class="Constant">&quot;F - test-print-cell-singleton-list&quot;</span>
<span id="L299" class="LineNr">299 </span><span class="Delimiter">}</span>
<span id="L300" class="LineNr">300 </span>
<span id="L301" class="LineNr">301 </span><span class="PreProc">fn</span> <span class="muTest"><a href='print.mu.html#L301'>test-print-cell-list</a></span> <span class="Delimiter">{</span>
<span id="L302" class="LineNr">302 </span> <span class="muComment"># list = cons &quot;abc&quot;, nil</span>
<span id="L303" class="LineNr">303 </span> <span class="PreProc">var</span> left-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L304" class="LineNr">304 </span> <span class="PreProc">var</span> left/<span class="Constant">ecx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address left-storage
<span id="L305" class="LineNr">305 </span> <a href='cell.mu.html#L38'>new-symbol</a> left, <span class="Constant">&quot;abc&quot;</span>
<span id="L306" class="LineNr">306 </span> <span class="PreProc">var</span> nil-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L307" class="LineNr">307 </span> <span class="PreProc">var</span> <a href='cell.mu.html#L120'>nil</a>/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address nil-storage
<span id="L308" class="LineNr">308 </span> <a href='cell.mu.html#L101'>allocate-pair</a> <a href='cell.mu.html#L120'>nil</a>
<span id="L309" class="LineNr">309 </span> <span class="PreProc">var</span> list-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L310" class="LineNr">310 </span> <span class="PreProc">var</span> list/<span class="Constant">esi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address list-storage
<span id="L311" class="LineNr">311 </span> <a href='cell.mu.html#L115'>new-pair</a> list, *left, *nil
<span id="L312" class="LineNr">312 </span> <span class="muComment"># list = cons 64, list</span>
<span id="L313" class="LineNr">313 </span> <a href='cell.mu.html#L83'>new-integer</a> left, <span class="Constant">0x40</span>
<span id="L314" class="LineNr">314 </span> <a href='cell.mu.html#L115'>new-pair</a> list, *left, *list
<span id="L315" class="LineNr">315 </span> <span class="muComment">#</span>
<span id="L316" class="LineNr">316 </span> <span class="PreProc">var</span> out-storage: (stream byte <span class="Constant">0x40</span>)
<span id="L317" class="LineNr">317 </span> <span class="PreProc">var</span> out/<span class="Constant">edi</span>: (addr stream byte) <span class="Special">&lt;-</span> address out-storage
<span id="L318" class="LineNr">318 </span> <a href='print.mu.html#L1'>print-cell</a> list, out, <span class="Constant">0</span>/no-trace
<span id="L319" class="LineNr">319 </span> <a href='../109stream-equal.subx.html#L194'>check-stream-equal</a> out, <span class="Constant">&quot;(64 abc)&quot;</span>, <span class="Constant">&quot;F - test-print-cell-list&quot;</span>
<span id="L320" class="LineNr">320 </span><span class="Delimiter">}</span>
<span id="L321" class="LineNr">321 </span>
<span id="L322" class="LineNr">322 </span><span class="PreProc">fn</span> <span class="muTest"><a href='print.mu.html#L322'>test-print-cell-list-of-nil</a></span> <span class="Delimiter">{</span>
<span id="L323" class="LineNr">323 </span> <span class="muComment"># list = cons &quot;abc&quot;, nil</span>
<span id="L324" class="LineNr">324 </span> <span class="PreProc">var</span> left-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L325" class="LineNr">325 </span> <span class="PreProc">var</span> left/<span class="Constant">ecx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address left-storage
<span id="L326" class="LineNr">326 </span> <a href='cell.mu.html#L101'>allocate-pair</a> left
<span id="L327" class="LineNr">327 </span> <span class="PreProc">var</span> nil-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L328" class="LineNr">328 </span> <span class="PreProc">var</span> <a href='cell.mu.html#L120'>nil</a>/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address nil-storage
<span id="L329" class="LineNr">329 </span> <a href='cell.mu.html#L101'>allocate-pair</a> <a href='cell.mu.html#L120'>nil</a>
<span id="L330" class="LineNr">330 </span> <span class="PreProc">var</span> list-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L331" class="LineNr">331 </span> <span class="PreProc">var</span> list/<span class="Constant">esi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address list-storage
<span id="L332" class="LineNr">332 </span> <a href='cell.mu.html#L115'>new-pair</a> list, *left, *nil
<span id="L333" class="LineNr">333 </span> <span class="muComment"># list = cons 64, list</span>
<span id="L334" class="LineNr">334 </span> <a href='cell.mu.html#L83'>new-integer</a> left, <span class="Constant">0x40</span>
<span id="L335" class="LineNr">335 </span> <a href='cell.mu.html#L115'>new-pair</a> list, *left, *list
<span id="L155" class="LineNr">155 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='print.mu.html#L155'>print-pair</a></span> _in: (addr <a href='cell.mu.html#L1'>cell</a>), out: (addr stream byte), trace: (addr trace) <span class="Delimiter">{</span>
<span id="L156" class="LineNr">156 </span> <span class="muComment"># if in starts with a quote, print the quote outside the expression</span>
<span id="L157" class="LineNr">157 </span> <span class="PreProc">var</span> in/<span class="Constant">esi</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _in
<span id="L158" class="LineNr">158 </span> <span class="PreProc">var</span> left-ah/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get in, left
<span id="L159" class="LineNr">159 </span> <span class="PreProc">var</span> _left/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *left-ah
<span id="L160" class="LineNr">160 </span> <span class="PreProc">var</span> left/<span class="Constant">ecx</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _left
<span id="L161" class="LineNr">161 </span> <span class="PreProc">var</span> is-quote?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='cell.mu.html#L44'>symbol-equal?</a> left, <span class="Constant">&quot;'&quot;</span>
<span id="L162" class="LineNr">162 </span> compare is-quote?, <span class="Constant">0</span>/false
<span id="L163" class="LineNr">163 </span> <span class="Delimiter">{</span>
<span id="L164" class="LineNr">164 </span> <span class="PreProc">break-if-=</span>
<span id="L165" class="LineNr">165 </span> <a href='../108write.subx.html#L11'>write</a> out, <span class="Constant">&quot;'&quot;</span>
<span id="L166" class="LineNr">166 </span> <span class="PreProc">var</span> right-ah/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get in, right
<span id="L167" class="LineNr">167 </span> <a href='print.mu.html#L1'>print-cell</a> right-ah, out, trace
<span id="L168" class="LineNr">168 </span> <span class="PreProc">return</span>
<span id="L169" class="LineNr">169 </span> <span class="Delimiter">}</span>
<span id="L170" class="LineNr">170 </span> <span class="PreProc">var</span> is-backquote?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='cell.mu.html#L44'>symbol-equal?</a> left, <span class="Constant">&quot;`&quot;</span>
<span id="L171" class="LineNr">171 </span> compare is-backquote?, <span class="Constant">0</span>/false
<span id="L172" class="LineNr">172 </span> <span class="Delimiter">{</span>
<span id="L173" class="LineNr">173 </span> <span class="PreProc">break-if-=</span>
<span id="L174" class="LineNr">174 </span> <a href='../108write.subx.html#L11'>write</a> out, <span class="Constant">&quot;`&quot;</span>
<span id="L175" class="LineNr">175 </span> <span class="PreProc">var</span> right-ah/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get in, right
<span id="L176" class="LineNr">176 </span> <a href='print.mu.html#L1'>print-cell</a> right-ah, out, trace
<span id="L177" class="LineNr">177 </span> <span class="PreProc">return</span>
<span id="L178" class="LineNr">178 </span> <span class="Delimiter">}</span>
<span id="L179" class="LineNr">179 </span> <span class="PreProc">var</span> is-unquote?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='cell.mu.html#L44'>symbol-equal?</a> left, <span class="Constant">&quot;,&quot;</span>
<span id="L180" class="LineNr">180 </span> compare is-unquote?, <span class="Constant">0</span>/false
<span id="L181" class="LineNr">181 </span> <span class="Delimiter">{</span>
<span id="L182" class="LineNr">182 </span> <span class="PreProc">break-if-=</span>
<span id="L183" class="LineNr">183 </span> <a href='../108write.subx.html#L11'>write</a> out, <span class="Constant">&quot;,&quot;</span>
<span id="L184" class="LineNr">184 </span> <span class="PreProc">var</span> right-ah/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get in, right
<span id="L185" class="LineNr">185 </span> <a href='print.mu.html#L1'>print-cell</a> right-ah, out, trace
<span id="L186" class="LineNr">186 </span> <span class="PreProc">return</span>
<span id="L187" class="LineNr">187 </span> <span class="Delimiter">}</span>
<span id="L188" class="LineNr">188 </span> <span class="PreProc">var</span> is-unquote-splice?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='cell.mu.html#L44'>symbol-equal?</a> left, <span class="Constant">&quot;,@&quot;</span>
<span id="L189" class="LineNr">189 </span> compare is-unquote-splice?, <span class="Constant">0</span>/false
<span id="L190" class="LineNr">190 </span> <span class="Delimiter">{</span>
<span id="L191" class="LineNr">191 </span> <span class="PreProc">break-if-=</span>
<span id="L192" class="LineNr">192 </span> <a href='../108write.subx.html#L11'>write</a> out, <span class="Constant">&quot;,@&quot;</span>
<span id="L193" class="LineNr">193 </span> <span class="PreProc">var</span> right-ah/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get in, right
<span id="L194" class="LineNr">194 </span> <a href='print.mu.html#L1'>print-cell</a> right-ah, out, trace
<span id="L195" class="LineNr">195 </span> <span class="PreProc">return</span>
<span id="L196" class="LineNr">196 </span> <span class="Delimiter">}</span>
<span id="L197" class="LineNr">197 </span> <span class="muComment">#</span>
<span id="L198" class="LineNr">198 </span> <span class="PreProc">var</span> curr/<span class="Constant">esi</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _in
<span id="L199" class="LineNr">199 </span> <a href='../108write.subx.html#L11'>write</a> out, <span class="Constant">&quot;(&quot;</span>
<span id="L200" class="LineNr">200 </span> $print-pair:<span class="PreProc">loop</span>: <span class="Delimiter">{</span>
<span id="L201" class="LineNr">201 </span> <span class="PreProc">var</span> left/<span class="Constant">ecx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get curr, left
<span id="L202" class="LineNr">202 </span> <a href='print.mu.html#L1'>print-cell</a> left, out, trace
<span id="L203" class="LineNr">203 </span> <span class="PreProc">var</span> right/<span class="Constant">ecx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get curr, right
<span id="L204" class="LineNr">204 </span> <span class="PreProc">var</span> right-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *right
<span id="L205" class="LineNr">205 </span> <span class="Delimiter">{</span>
<span id="L206" class="LineNr">206 </span> compare right-addr, <span class="Constant">0</span>
<span id="L207" class="LineNr">207 </span> <span class="PreProc">break-if-!=</span>
<span id="L208" class="LineNr">208 </span> <a href='../317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;null encountered&quot;</span>
<span id="L209" class="LineNr">209 </span> <span class="Delimiter">}</span>
<span id="L210" class="LineNr">210 </span> <span class="Delimiter">{</span>
<span id="L211" class="LineNr">211 </span> <span class="PreProc">var</span> right-nil?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='print.mu.html#L236'>nil?</a> right-addr
<span id="L212" class="LineNr">212 </span> compare right-nil?, <span class="Constant">0</span>/false
<span id="L213" class="LineNr">213 </span> <span class="Delimiter">{</span>
<span id="L214" class="LineNr">214 </span> <span class="PreProc">break-if-=</span>
<span id="L215" class="LineNr">215 </span> <a href='trace.mu.html#L120'>trace-text</a> trace, <span class="Constant">&quot;print&quot;</span>, <span class="Constant">&quot;right is nil&quot;</span>
<span id="L216" class="LineNr">216 </span> <span class="PreProc">break</span> $print-pair:<span class="PreProc">loop</span>
<span id="L217" class="LineNr">217 </span> <span class="Delimiter">}</span>
<span id="L218" class="LineNr">218 </span> <span class="Delimiter">}</span>
<span id="L219" class="LineNr">219 </span> <a href='../108write.subx.html#L11'>write</a> out, <span class="Constant">&quot; &quot;</span>
<span id="L220" class="LineNr">220 </span> <span class="PreProc">var</span> right-type-addr/<span class="Constant">edx</span>: (addr int) <span class="Special">&lt;-</span> get right-addr, <span class="PreProc">type</span>
<span id="L221" class="LineNr">221 </span> <span class="Delimiter">{</span>
<span id="L222" class="LineNr">222 </span> compare *right-type-addr, <span class="Constant">0</span>/pair
<span id="L223" class="LineNr">223 </span> <span class="PreProc">break-if-=</span>
<span id="L224" class="LineNr">224 </span> <a href='../108write.subx.html#L11'>write</a> out, <span class="Constant">&quot;. &quot;</span>
<span id="L225" class="LineNr">225 </span> <a href='print.mu.html#L1'>print-cell</a> right, out, trace
<span id="L226" class="LineNr">226 </span> <span class="PreProc">break</span> $print-pair:<span class="PreProc">loop</span>
<span id="L227" class="LineNr">227 </span> <span class="Delimiter">}</span>
<span id="L228" class="LineNr">228 </span> curr <span class="Special">&lt;-</span> copy right-addr
<span id="L229" class="LineNr">229 </span> <span class="PreProc">loop</span>
<span id="L230" class="LineNr">230 </span> <span class="Delimiter">}</span>
<span id="L231" class="LineNr">231 </span> <a href='../108write.subx.html#L11'>write</a> out, <span class="Constant">&quot;)&quot;</span>
<span id="L232" class="LineNr">232 </span><span class="Delimiter">}</span>
<span id="L233" class="LineNr">233 </span>
<span id="L234" class="LineNr">234 </span><span class="muComment"># Most lisps intern nil, but we don't really have globals yet, so we'll be</span>
<span id="L235" class="LineNr">235 </span><span class="muComment"># less efficient for now.</span>
<span id="L236" class="LineNr">236 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='print.mu.html#L236'>nil?</a></span> _in: (addr <a href='cell.mu.html#L1'>cell</a>)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean <span class="Delimiter">{</span>
<span id="L237" class="LineNr">237 </span> <span class="PreProc">var</span> in/<span class="Constant">esi</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _in
<span id="L238" class="LineNr">238 </span> <span class="muComment"># if type != pair, return false</span>
<span id="L239" class="LineNr">239 </span> <span class="PreProc">var</span> <span class="PreProc">type</span>/<span class="Constant">eax</span>: (addr int) <span class="Special">&lt;-</span> get in, <span class="PreProc">type</span>
<span id="L240" class="LineNr">240 </span> compare *<span class="PreProc">type</span>, <span class="Constant">0</span>/pair
<span id="L241" class="LineNr">241 </span> <span class="Delimiter">{</span>
<span id="L242" class="LineNr">242 </span> <span class="PreProc">break-if-=</span>
<span id="L243" class="LineNr">243 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L244" class="LineNr">244 </span> <span class="Delimiter">}</span>
<span id="L245" class="LineNr">245 </span> <span class="muComment"># if left != null, return false</span>
<span id="L246" class="LineNr">246 </span> <span class="PreProc">var</span> left-ah/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get in, left
<span id="L247" class="LineNr">247 </span> <span class="PreProc">var</span> left/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *left-ah
<span id="L248" class="LineNr">248 </span> compare left, <span class="Constant">0</span>
<span id="L249" class="LineNr">249 </span> <span class="Delimiter">{</span>
<span id="L250" class="LineNr">250 </span> <span class="PreProc">break-if-=</span>
<span id="L251" class="LineNr">251 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L252" class="LineNr">252 </span> <span class="Delimiter">}</span>
<span id="L253" class="LineNr">253 </span> <span class="muComment"># if right != null, return false</span>
<span id="L254" class="LineNr">254 </span> <span class="PreProc">var</span> right-ah/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get in, right
<span id="L255" class="LineNr">255 </span> <span class="PreProc">var</span> right/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *right-ah
<span id="L256" class="LineNr">256 </span> compare right, <span class="Constant">0</span>
<span id="L257" class="LineNr">257 </span> <span class="Delimiter">{</span>
<span id="L258" class="LineNr">258 </span> <span class="PreProc">break-if-=</span>
<span id="L259" class="LineNr">259 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L260" class="LineNr">260 </span> <span class="Delimiter">}</span>
<span id="L261" class="LineNr">261 </span> <span class="PreProc">return</span> <span class="Constant">1</span>/true
<span id="L262" class="LineNr">262 </span><span class="Delimiter">}</span>
<span id="L263" class="LineNr">263 </span>
<span id="L264" class="LineNr">264 </span><span class="PreProc">fn</span> <span class="muTest"><a href='print.mu.html#L264'>test-print-cell-zero</a></span> <span class="Delimiter">{</span>
<span id="L265" class="LineNr">265 </span> <span class="PreProc">var</span> num-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L266" class="LineNr">266 </span> <span class="PreProc">var</span> num/<span class="Constant">esi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address num-storage
<span id="L267" class="LineNr">267 </span> <a href='cell.mu.html#L84'>new-integer</a> num, <span class="Constant">0</span>
<span id="L268" class="LineNr">268 </span> <span class="PreProc">var</span> out-storage: (stream byte <span class="Constant">0x40</span>)
<span id="L269" class="LineNr">269 </span> <span class="PreProc">var</span> out/<span class="Constant">edi</span>: (addr stream byte) <span class="Special">&lt;-</span> address out-storage
<span id="L270" class="LineNr">270 </span> <a href='print.mu.html#L1'>print-cell</a> num, out, <span class="Constant">0</span>/no-trace
<span id="L271" class="LineNr">271 </span> <a href='../109stream-equal.subx.html#L194'>check-stream-equal</a> out, <span class="Constant">&quot;0&quot;</span>, <span class="Constant">&quot;F - test-print-cell-zero&quot;</span>
<span id="L272" class="LineNr">272 </span><span class="Delimiter">}</span>
<span id="L273" class="LineNr">273 </span>
<span id="L274" class="LineNr">274 </span><span class="PreProc">fn</span> <span class="muTest"><a href='print.mu.html#L274'>test-print-cell-integer</a></span> <span class="Delimiter">{</span>
<span id="L275" class="LineNr">275 </span> <span class="PreProc">var</span> num-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L276" class="LineNr">276 </span> <span class="PreProc">var</span> num/<span class="Constant">esi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address num-storage
<span id="L277" class="LineNr">277 </span> <a href='cell.mu.html#L84'>new-integer</a> num, <span class="Constant">1</span>
<span id="L278" class="LineNr">278 </span> <span class="PreProc">var</span> out-storage: (stream byte <span class="Constant">0x40</span>)
<span id="L279" class="LineNr">279 </span> <span class="PreProc">var</span> out/<span class="Constant">edi</span>: (addr stream byte) <span class="Special">&lt;-</span> address out-storage
<span id="L280" class="LineNr">280 </span> <a href='print.mu.html#L1'>print-cell</a> num, out, <span class="Constant">0</span>/no-trace
<span id="L281" class="LineNr">281 </span> <a href='../109stream-equal.subx.html#L194'>check-stream-equal</a> out, <span class="Constant">&quot;1&quot;</span>, <span class="Constant">&quot;F - test-print-cell-integer&quot;</span>
<span id="L282" class="LineNr">282 </span><span class="Delimiter">}</span>
<span id="L283" class="LineNr">283 </span>
<span id="L284" class="LineNr">284 </span><span class="PreProc">fn</span> <span class="muTest"><a href='print.mu.html#L284'>test-print-cell-integer-2</a></span> <span class="Delimiter">{</span>
<span id="L285" class="LineNr">285 </span> <span class="PreProc">var</span> num-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L286" class="LineNr">286 </span> <span class="PreProc">var</span> num/<span class="Constant">esi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address num-storage
<span id="L287" class="LineNr">287 </span> <a href='cell.mu.html#L84'>new-integer</a> num, <span class="Constant">0x30</span>
<span id="L288" class="LineNr">288 </span> <span class="PreProc">var</span> out-storage: (stream byte <span class="Constant">0x40</span>)
<span id="L289" class="LineNr">289 </span> <span class="PreProc">var</span> out/<span class="Constant">edi</span>: (addr stream byte) <span class="Special">&lt;-</span> address out-storage
<span id="L290" class="LineNr">290 </span> <a href='print.mu.html#L1'>print-cell</a> num, out, <span class="Constant">0</span>/no-trace
<span id="L291" class="LineNr">291 </span> <a href='../109stream-equal.subx.html#L194'>check-stream-equal</a> out, <span class="Constant">&quot;48&quot;</span>, <span class="Constant">&quot;F - test-print-cell-integer-2&quot;</span>
<span id="L292" class="LineNr">292 </span><span class="Delimiter">}</span>
<span id="L293" class="LineNr">293 </span>
<span id="L294" class="LineNr">294 </span><span class="PreProc">fn</span> <span class="muTest"><a href='print.mu.html#L294'>test-print-cell-fraction</a></span> <span class="Delimiter">{</span>
<span id="L295" class="LineNr">295 </span> <span class="PreProc">var</span> num-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L296" class="LineNr">296 </span> <span class="PreProc">var</span> num/<span class="Constant">esi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address num-storage
<span id="L297" class="LineNr">297 </span> <span class="PreProc">var</span> val/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> <a href='../408float.mu.html#L18'>rational</a> <span class="Constant">1</span>, <span class="Constant">2</span>
<span id="L298" class="LineNr">298 </span> <a href='cell.mu.html#L97'>new-float</a> num, val
<span id="L299" class="LineNr">299 </span> <span class="PreProc">var</span> out-storage: (stream byte <span class="Constant">0x40</span>)
<span id="L300" class="LineNr">300 </span> <span class="PreProc">var</span> out/<span class="Constant">edi</span>: (addr stream byte) <span class="Special">&lt;-</span> address out-storage
<span id="L301" class="LineNr">301 </span> <a href='print.mu.html#L1'>print-cell</a> num, out, <span class="Constant">0</span>/no-trace
<span id="L302" class="LineNr">302 </span> <a href='../109stream-equal.subx.html#L194'>check-stream-equal</a> out, <span class="Constant">&quot;0.5&quot;</span>, <span class="Constant">&quot;F - test-print-cell-fraction&quot;</span>
<span id="L303" class="LineNr">303 </span><span class="Delimiter">}</span>
<span id="L304" class="LineNr">304 </span>
<span id="L305" class="LineNr">305 </span><span class="PreProc">fn</span> <span class="muTest"><a href='print.mu.html#L305'>test-print-cell-symbol</a></span> <span class="Delimiter">{</span>
<span id="L306" class="LineNr">306 </span> <span class="PreProc">var</span> sym-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L307" class="LineNr">307 </span> <span class="PreProc">var</span> sym/<span class="Constant">esi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address sym-storage
<span id="L308" class="LineNr">308 </span> <a href='cell.mu.html#L39'>new-symbol</a> sym, <span class="Constant">&quot;abc&quot;</span>
<span id="L309" class="LineNr">309 </span> <span class="PreProc">var</span> out-storage: (stream byte <span class="Constant">0x40</span>)
<span id="L310" class="LineNr">310 </span> <span class="PreProc">var</span> out/<span class="Constant">edi</span>: (addr stream byte) <span class="Special">&lt;-</span> address out-storage
<span id="L311" class="LineNr">311 </span> <a href='print.mu.html#L1'>print-cell</a> sym, out, <span class="Constant">0</span>/no-trace
<span id="L312" class="LineNr">312 </span> <a href='../109stream-equal.subx.html#L194'>check-stream-equal</a> out, <span class="Constant">&quot;abc&quot;</span>, <span class="Constant">&quot;F - test-print-cell-symbol&quot;</span>
<span id="L313" class="LineNr">313 </span><span class="Delimiter">}</span>
<span id="L314" class="LineNr">314 </span>
<span id="L315" class="LineNr">315 </span><span class="PreProc">fn</span> <span class="muTest"><a href='print.mu.html#L315'>test-print-cell-nil-list</a></span> <span class="Delimiter">{</span>
<span id="L316" class="LineNr">316 </span> <span class="PreProc">var</span> nil-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L317" class="LineNr">317 </span> <span class="PreProc">var</span> <a href='cell.mu.html#L121'>nil</a>/<span class="Constant">esi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address nil-storage
<span id="L318" class="LineNr">318 </span> <a href='cell.mu.html#L102'>allocate-pair</a> <a href='cell.mu.html#L121'>nil</a>
<span id="L319" class="LineNr">319 </span> <span class="PreProc">var</span> out-storage: (stream byte <span class="Constant">0x40</span>)
<span id="L320" class="LineNr">320 </span> <span class="PreProc">var</span> out/<span class="Constant">edi</span>: (addr stream byte) <span class="Special">&lt;-</span> address out-storage
<span id="L321" class="LineNr">321 </span> <a href='print.mu.html#L1'>print-cell</a> <a href='cell.mu.html#L121'>nil</a>, out, <span class="Constant">0</span>/no-trace
<span id="L322" class="LineNr">322 </span> <a href='../109stream-equal.subx.html#L194'>check-stream-equal</a> out, <span class="Constant">&quot;()&quot;</span>, <span class="Constant">&quot;F - test-print-cell-nil-list&quot;</span>
<span id="L323" class="LineNr">323 </span><span class="Delimiter">}</span>
<span id="L324" class="LineNr">324 </span>
<span id="L325" class="LineNr">325 </span><span class="PreProc">fn</span> <span class="muTest"><a href='print.mu.html#L325'>test-print-cell-singleton-list</a></span> <span class="Delimiter">{</span>
<span id="L326" class="LineNr">326 </span> <span class="muComment"># list</span>
<span id="L327" class="LineNr">327 </span> <span class="PreProc">var</span> left-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L328" class="LineNr">328 </span> <span class="PreProc">var</span> left/<span class="Constant">ecx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address left-storage
<span id="L329" class="LineNr">329 </span> <a href='cell.mu.html#L39'>new-symbol</a> left, <span class="Constant">&quot;abc&quot;</span>
<span id="L330" class="LineNr">330 </span> <span class="PreProc">var</span> nil-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L331" class="LineNr">331 </span> <span class="PreProc">var</span> <a href='cell.mu.html#L121'>nil</a>/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address nil-storage
<span id="L332" class="LineNr">332 </span> <a href='cell.mu.html#L102'>allocate-pair</a> <a href='cell.mu.html#L121'>nil</a>
<span id="L333" class="LineNr">333 </span> <span class="PreProc">var</span> list-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L334" class="LineNr">334 </span> <span class="PreProc">var</span> list/<span class="Constant">esi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address list-storage
<span id="L335" class="LineNr">335 </span> <a href='cell.mu.html#L116'>new-pair</a> list, *left, *nil
<span id="L336" class="LineNr">336 </span> <span class="muComment">#</span>
<span id="L337" class="LineNr">337 </span> <span class="PreProc">var</span> out-storage: (stream byte <span class="Constant">0x40</span>)
<span id="L338" class="LineNr">338 </span> <span class="PreProc">var</span> out/<span class="Constant">edi</span>: (addr stream byte) <span class="Special">&lt;-</span> address out-storage
<span id="L339" class="LineNr">339 </span> <a href='print.mu.html#L1'>print-cell</a> list, out, <span class="Constant">0</span>/no-trace
<span id="L340" class="LineNr">340 </span> <a href='../109stream-equal.subx.html#L194'>check-stream-equal</a> out, <span class="Constant">&quot;(64 ())&quot;</span>, <span class="Constant">&quot;F - test-print-cell-list-nil&quot;</span>
<span id="L340" class="LineNr">340 </span> <a href='../109stream-equal.subx.html#L194'>check-stream-equal</a> out, <span class="Constant">&quot;(abc)&quot;</span>, <span class="Constant">&quot;F - test-print-cell-singleton-list&quot;</span>
<span id="L341" class="LineNr">341 </span><span class="Delimiter">}</span>
<span id="L342" class="LineNr">342 </span>
<span id="L343" class="LineNr">343 </span><span class="PreProc">fn</span> <span class="muTest"><a href='print.mu.html#L343'>test-print-dotted-list</a></span> <span class="Delimiter">{</span>
<span id="L344" class="LineNr">344 </span> <span class="muComment"># list = cons 64, &quot;abc&quot;</span>
<span id="L343" class="LineNr">343 </span><span class="PreProc">fn</span> <span class="muTest"><a href='print.mu.html#L343'>test-print-cell-list</a></span> <span class="Delimiter">{</span>
<span id="L344" class="LineNr">344 </span> <span class="muComment"># list = cons &quot;abc&quot;, nil</span>
<span id="L345" class="LineNr">345 </span> <span class="PreProc">var</span> left-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L346" class="LineNr">346 </span> <span class="PreProc">var</span> left/<span class="Constant">ecx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address left-storage
<span id="L347" class="LineNr">347 </span> <a href='cell.mu.html#L38'>new-symbol</a> left, <span class="Constant">&quot;abc&quot;</span>
<span id="L348" class="LineNr">348 </span> <span class="PreProc">var</span> right-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L349" class="LineNr">349 </span> <span class="PreProc">var</span> right/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address right-storage
<span id="L350" class="LineNr">350 </span> <a href='cell.mu.html#L83'>new-integer</a> right, <span class="Constant">0x40</span>
<span id="L347" class="LineNr">347 </span> <a href='cell.mu.html#L39'>new-symbol</a> left, <span class="Constant">&quot;abc&quot;</span>
<span id="L348" class="LineNr">348 </span> <span class="PreProc">var</span> nil-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L349" class="LineNr">349 </span> <span class="PreProc">var</span> <a href='cell.mu.html#L121'>nil</a>/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address nil-storage
<span id="L350" class="LineNr">350 </span> <a href='cell.mu.html#L102'>allocate-pair</a> <a href='cell.mu.html#L121'>nil</a>
<span id="L351" class="LineNr">351 </span> <span class="PreProc">var</span> list-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L352" class="LineNr">352 </span> <span class="PreProc">var</span> list/<span class="Constant">esi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address list-storage
<span id="L353" class="LineNr">353 </span> <a href='cell.mu.html#L115'>new-pair</a> list, *left, *right
<span id="L354" class="LineNr">354 </span> <span class="muComment">#</span>
<span id="L355" class="LineNr">355 </span> <span class="PreProc">var</span> out-storage: (stream byte <span class="Constant">0x40</span>)
<span id="L356" class="LineNr">356 </span> <span class="PreProc">var</span> out/<span class="Constant">edi</span>: (addr stream byte) <span class="Special">&lt;-</span> address out-storage
<span id="L357" class="LineNr">357 </span> <a href='print.mu.html#L1'>print-cell</a> list, out, <span class="Constant">0</span>/no-trace
<span id="L358" class="LineNr">358 </span> <a href='../109stream-equal.subx.html#L194'>check-stream-equal</a> out, <span class="Constant">&quot;(abc . 64)&quot;</span>, <span class="Constant">&quot;F - test-print-dotted-list&quot;</span>
<span id="L359" class="LineNr">359 </span><span class="Delimiter">}</span>
<span id="L353" class="LineNr">353 </span> <a href='cell.mu.html#L116'>new-pair</a> list, *left, *nil
<span id="L354" class="LineNr">354 </span> <span class="muComment"># list = cons 64, list</span>
<span id="L355" class="LineNr">355 </span> <a href='cell.mu.html#L84'>new-integer</a> left, <span class="Constant">0x40</span>
<span id="L356" class="LineNr">356 </span> <a href='cell.mu.html#L116'>new-pair</a> list, *left, *list
<span id="L357" class="LineNr">357 </span> <span class="muComment">#</span>
<span id="L358" class="LineNr">358 </span> <span class="PreProc">var</span> out-storage: (stream byte <span class="Constant">0x40</span>)
<span id="L359" class="LineNr">359 </span> <span class="PreProc">var</span> out/<span class="Constant">edi</span>: (addr stream byte) <span class="Special">&lt;-</span> address out-storage
<span id="L360" class="LineNr">360 </span> <a href='print.mu.html#L1'>print-cell</a> list, out, <span class="Constant">0</span>/no-trace
<span id="L361" class="LineNr">361 </span> <a href='../109stream-equal.subx.html#L194'>check-stream-equal</a> out, <span class="Constant">&quot;(64 abc)&quot;</span>, <span class="Constant">&quot;F - test-print-cell-list&quot;</span>
<span id="L362" class="LineNr">362 </span><span class="Delimiter">}</span>
<span id="L363" class="LineNr">363 </span>
<span id="L364" class="LineNr">364 </span><span class="PreProc">fn</span> <span class="muTest"><a href='print.mu.html#L364'>test-print-cell-list-of-nil</a></span> <span class="Delimiter">{</span>
<span id="L365" class="LineNr">365 </span> <span class="muComment"># list = cons &quot;abc&quot;, nil</span>
<span id="L366" class="LineNr">366 </span> <span class="PreProc">var</span> left-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L367" class="LineNr">367 </span> <span class="PreProc">var</span> left/<span class="Constant">ecx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address left-storage
<span id="L368" class="LineNr">368 </span> <a href='cell.mu.html#L102'>allocate-pair</a> left
<span id="L369" class="LineNr">369 </span> <span class="PreProc">var</span> nil-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L370" class="LineNr">370 </span> <span class="PreProc">var</span> <a href='cell.mu.html#L121'>nil</a>/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address nil-storage
<span id="L371" class="LineNr">371 </span> <a href='cell.mu.html#L102'>allocate-pair</a> <a href='cell.mu.html#L121'>nil</a>
<span id="L372" class="LineNr">372 </span> <span class="PreProc">var</span> list-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L373" class="LineNr">373 </span> <span class="PreProc">var</span> list/<span class="Constant">esi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address list-storage
<span id="L374" class="LineNr">374 </span> <a href='cell.mu.html#L116'>new-pair</a> list, *left, *nil
<span id="L375" class="LineNr">375 </span> <span class="muComment"># list = cons 64, list</span>
<span id="L376" class="LineNr">376 </span> <a href='cell.mu.html#L84'>new-integer</a> left, <span class="Constant">0x40</span>
<span id="L377" class="LineNr">377 </span> <a href='cell.mu.html#L116'>new-pair</a> list, *left, *list
<span id="L378" class="LineNr">378 </span> <span class="muComment">#</span>
<span id="L379" class="LineNr">379 </span> <span class="PreProc">var</span> out-storage: (stream byte <span class="Constant">0x40</span>)
<span id="L380" class="LineNr">380 </span> <span class="PreProc">var</span> out/<span class="Constant">edi</span>: (addr stream byte) <span class="Special">&lt;-</span> address out-storage
<span id="L381" class="LineNr">381 </span> <a href='print.mu.html#L1'>print-cell</a> list, out, <span class="Constant">0</span>/no-trace
<span id="L382" class="LineNr">382 </span> <a href='../109stream-equal.subx.html#L194'>check-stream-equal</a> out, <span class="Constant">&quot;(64 ())&quot;</span>, <span class="Constant">&quot;F - test-print-cell-list-nil&quot;</span>
<span id="L383" class="LineNr">383 </span><span class="Delimiter">}</span>
<span id="L384" class="LineNr">384 </span>
<span id="L385" class="LineNr">385 </span><span class="PreProc">fn</span> <span class="muTest"><a href='print.mu.html#L385'>test-print-dotted-list</a></span> <span class="Delimiter">{</span>
<span id="L386" class="LineNr">386 </span> <span class="muComment"># list = cons 64, &quot;abc&quot;</span>
<span id="L387" class="LineNr">387 </span> <span class="PreProc">var</span> left-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L388" class="LineNr">388 </span> <span class="PreProc">var</span> left/<span class="Constant">ecx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address left-storage
<span id="L389" class="LineNr">389 </span> <a href='cell.mu.html#L39'>new-symbol</a> left, <span class="Constant">&quot;abc&quot;</span>
<span id="L390" class="LineNr">390 </span> <span class="PreProc">var</span> right-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L391" class="LineNr">391 </span> <span class="PreProc">var</span> right/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address right-storage
<span id="L392" class="LineNr">392 </span> <a href='cell.mu.html#L84'>new-integer</a> right, <span class="Constant">0x40</span>
<span id="L393" class="LineNr">393 </span> <span class="PreProc">var</span> list-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L394" class="LineNr">394 </span> <span class="PreProc">var</span> list/<span class="Constant">esi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address list-storage
<span id="L395" class="LineNr">395 </span> <a href='cell.mu.html#L116'>new-pair</a> list, *left, *right
<span id="L396" class="LineNr">396 </span> <span class="muComment">#</span>
<span id="L397" class="LineNr">397 </span> <span class="PreProc">var</span> out-storage: (stream byte <span class="Constant">0x40</span>)
<span id="L398" class="LineNr">398 </span> <span class="PreProc">var</span> out/<span class="Constant">edi</span>: (addr stream byte) <span class="Special">&lt;-</span> address out-storage
<span id="L399" class="LineNr">399 </span> <a href='print.mu.html#L1'>print-cell</a> list, out, <span class="Constant">0</span>/no-trace
<span id="L400" class="LineNr">400 </span> <a href='../109stream-equal.subx.html#L194'>check-stream-equal</a> out, <span class="Constant">&quot;(abc . 64)&quot;</span>, <span class="Constant">&quot;F - test-print-dotted-list&quot;</span>
<span id="L401" class="LineNr">401 </span><span class="Delimiter">}</span>
</pre>
</body>
</html>

View File

@ -16,6 +16,7 @@ a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.LineNr { }
.CommentedCode { color: #8a8a8a; }
.Constant { color: #008787; }
.muComment { color: #005faf; }
.Delimiter { color: #c000c0; }
@ -72,7 +73,7 @@ if ('onhashchange' in window) {
<span id="L13" class="LineNr"> 13 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> copy _self
<span id="L14" class="LineNr"> 14 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">eax</span>: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> get self, data
<span id="L15" class="LineNr"> 15 </span> <a href='../120allocate.subx.html#L43'>allocate</a> data-ah
<span id="L16" class="LineNr"> 16 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L16" class="LineNr"> 16 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L17" class="LineNr"> 17 </span> <a href='gap-buffer.mu.html#L11'>initialize-gap-buffer</a> data, <span class="Constant">0x1000</span>/4KB
<span id="L18" class="LineNr"> 18 </span> <span class="muComment">#</span>
<span id="L19" class="LineNr"> 19 </span> <span class="PreProc">var</span> value-ah/<span class="Constant">eax</span>: (addr handle stream byte) <span class="Special">&lt;-</span> get self, value
@ -82,14 +83,14 @@ if ('onhashchange' in window) {
<span id="L23" class="LineNr"> 23 </span> compare fake-screen-and-keyboard?, <span class="Constant">0</span>/false
<span id="L24" class="LineNr"> 24 </span> <span class="PreProc">break-if-=</span>
<span id="L25" class="LineNr"> 25 </span> <span class="PreProc">var</span> screen-ah/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get self, screen-var
<span id="L26" class="LineNr"> 26 </span> <a href='cell.mu.html#L153'>new-fake-screen</a> screen-ah, <span class="Constant">8</span>/width, <span class="Constant">3</span>/height, <span class="Constant">1</span>/enable-pixel-graphics
<span id="L26" class="LineNr"> 26 </span> <a href='cell.mu.html#L154'>new-fake-screen</a> screen-ah, <span class="Constant">8</span>/width, <span class="Constant">3</span>/height, <span class="Constant">1</span>/enable-pixel-graphics
<span id="L27" class="LineNr"> 27 </span> <span class="PreProc">var</span> keyboard-ah/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get self, keyboard-var
<span id="L28" class="LineNr"> 28 </span> <a href='cell.mu.html#L184'>new-fake-keyboard</a> keyboard-ah, <span class="Constant">0x10</span>/keyboard-capacity
<span id="L28" class="LineNr"> 28 </span> <a href='cell.mu.html#L185'>new-fake-keyboard</a> keyboard-ah, <span class="Constant">0x10</span>/keyboard-capacity
<span id="L29" class="LineNr"> 29 </span> <span class="Delimiter">}</span>
<span id="L30" class="LineNr"> 30 </span> <span class="muComment">#</span>
<span id="L31" class="LineNr"> 31 </span> <span class="PreProc">var</span> trace-ah/<span class="Constant">eax</span>: (addr handle trace) <span class="Special">&lt;-</span> get self, trace
<span id="L32" class="LineNr"> 32 </span> <a href='../120allocate.subx.html#L43'>allocate</a> trace-ah
<span id="L33" class="LineNr"> 33 </span> <span class="PreProc">var</span> trace/<span class="Constant">eax</span>: (addr trace) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *trace-ah
<span id="L33" class="LineNr"> 33 </span> <span class="PreProc">var</span> trace/<span class="Constant">eax</span>: (addr trace) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *trace-ah
<span id="L34" class="LineNr"> 34 </span> <a href='trace.mu.html#L35'>initialize-trace</a> trace, <span class="Constant">0x8000</span>/lines, <span class="Constant">0x80</span>/visible-lines
<span id="L35" class="LineNr"> 35 </span> <span class="PreProc">var</span> cursor-in-data?/<span class="Constant">eax</span>: (addr boolean) <span class="Special">&lt;-</span> get self, cursor-in-data?
<span id="L36" class="LineNr"> 36 </span> copy-to *cursor-in-data?, <span class="Constant">1</span>/true
@ -101,13 +102,13 @@ if ('onhashchange' in window) {
<span id="L42" class="LineNr"> 42 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> copy _self
<span id="L43" class="LineNr"> 43 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">eax</span>: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> get self, data
<span id="L44" class="LineNr"> 44 </span> <a href='../120allocate.subx.html#L43'>allocate</a> data-ah
<span id="L45" class="LineNr"> 45 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L45" class="LineNr"> 45 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L46" class="LineNr"> 46 </span> <a href='gap-buffer.mu.html#L37'>initialize-gap-buffer-with</a> data, s
<span id="L47" class="LineNr"> 47 </span> <span class="PreProc">var</span> value-ah/<span class="Constant">eax</span>: (addr handle stream byte) <span class="Special">&lt;-</span> get self, value
<span id="L48" class="LineNr"> 48 </span> populate-stream value-ah, <span class="Constant">0x1000</span>/4KB
<span id="L49" class="LineNr"> 49 </span> <span class="PreProc">var</span> trace-ah/<span class="Constant">eax</span>: (addr handle trace) <span class="Special">&lt;-</span> get self, trace
<span id="L50" class="LineNr"> 50 </span> <a href='../120allocate.subx.html#L43'>allocate</a> trace-ah
<span id="L51" class="LineNr"> 51 </span> <span class="PreProc">var</span> trace/<span class="Constant">eax</span>: (addr trace) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *trace-ah
<span id="L51" class="LineNr"> 51 </span> <span class="PreProc">var</span> trace/<span class="Constant">eax</span>: (addr trace) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *trace-ah
<span id="L52" class="LineNr"> 52 </span> <a href='trace.mu.html#L35'>initialize-trace</a> trace, <span class="Constant">0x8000</span>/lines, <span class="Constant">0x80</span>/visible-lines
<span id="L53" class="LineNr"> 53 </span> <span class="PreProc">var</span> cursor-in-data?/<span class="Constant">eax</span>: (addr boolean) <span class="Special">&lt;-</span> get self, cursor-in-data?
<span id="L54" class="LineNr"> 54 </span> copy-to *cursor-in-data?, <span class="Constant">1</span>/true
@ -116,14 +117,14 @@ if ('onhashchange' in window) {
<span id="L57" class="LineNr"> 57 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='sandbox.mu.html#L57'>allocate-sandbox-with</a></span> _out: (addr handle <a href='sandbox.mu.html#L1'>sandbox</a>), s: (addr array byte) <span class="Delimiter">{</span>
<span id="L58" class="LineNr"> 58 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr handle <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> copy _out
<span id="L59" class="LineNr"> 59 </span> <a href='../120allocate.subx.html#L43'>allocate</a> out
<span id="L60" class="LineNr"> 60 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *out
<span id="L60" class="LineNr"> 60 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *out
<span id="L61" class="LineNr"> 61 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> out-addr, s
<span id="L62" class="LineNr"> 62 </span><span class="Delimiter">}</span>
<span id="L63" class="LineNr"> 63 </span>
<span id="L64" class="LineNr"> 64 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='sandbox.mu.html#L64'>write-sandbox</a></span> out: (addr stream byte), _self: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Delimiter">{</span>
<span id="L65" class="LineNr"> 65 </span> <span class="PreProc">var</span> self/<span class="Constant">eax</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> copy _self
<span id="L66" class="LineNr"> 66 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">eax</span>: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> get self, data
<span id="L67" class="LineNr"> 67 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L67" class="LineNr"> 67 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L68" class="LineNr"> 68 </span> <span class="Delimiter">{</span>
<span id="L69" class="LineNr"> 69 </span> <span class="PreProc">var</span> len/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='gap-buffer.mu.html#L163'>gap-buffer-length</a> data
<span id="L70" class="LineNr"> 70 </span> compare len, <span class="Constant">0</span>
@ -145,7 +146,7 @@ if ('onhashchange' in window) {
<span id="L86" class="LineNr"> 86 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> copy _self
<span id="L87" class="LineNr"> 87 </span> <span class="muComment"># data</span>
<span id="L88" class="LineNr"> 88 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">eax</span>: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> get self, data
<span id="L89" class="LineNr"> 89 </span> <span class="PreProc">var</span> _data/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L89" class="LineNr"> 89 </span> <span class="PreProc">var</span> _data/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L90" class="LineNr"> 90 </span> <span class="PreProc">var</span> data/<span class="Constant">edx</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> copy _data
<span id="L91" class="LineNr"> 91 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy xmin
<span id="L92" class="LineNr"> 92 </span> <span class="PreProc">var</span> y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy ymin
@ -156,14 +157,14 @@ if ('onhashchange' in window) {
<span id="L97" class="LineNr"> 97 </span> y <span class="Special">&lt;-</span> increment
<span id="L98" class="LineNr"> 98 </span> <span class="muComment"># trace</span>
<span id="L99" class="LineNr"> 99 </span> <span class="PreProc">var</span> trace-ah/<span class="Constant">eax</span>: (addr handle trace) <span class="Special">&lt;-</span> get self, trace
<span id="L100" class="LineNr">100 </span> <span class="PreProc">var</span> _trace/<span class="Constant">eax</span>: (addr trace) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *trace-ah
<span id="L100" class="LineNr">100 </span> <span class="PreProc">var</span> _trace/<span class="Constant">eax</span>: (addr trace) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *trace-ah
<span id="L101" class="LineNr">101 </span> <span class="PreProc">var</span> trace/<span class="Constant">edx</span>: (addr trace) <span class="Special">&lt;-</span> copy _trace
<span id="L102" class="LineNr">102 </span> <span class="PreProc">var</span> cursor-in-trace?/<span class="Constant">eax</span>: (addr boolean) <span class="Special">&lt;-</span> get self, cursor-in-trace?
<span id="L103" class="LineNr">103 </span> y <span class="Special">&lt;-</span> <a href='trace.mu.html#L326'>render-trace</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, trace, xmin, y, xmax, ymax, *cursor-in-trace?
<span id="L103" class="LineNr">103 </span> y <span class="Special">&lt;-</span> <a href='trace.mu.html#L357'>render-trace</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, trace, xmin, y, xmax, ymax, *cursor-in-trace?
<span id="L104" class="LineNr">104 </span> <span class="muComment"># value</span>
<span id="L105" class="LineNr">105 </span> $render-sandbox:value: <span class="Delimiter">{</span>
<span id="L106" class="LineNr">106 </span> <span class="PreProc">var</span> value-ah/<span class="Constant">eax</span>: (addr handle stream byte) <span class="Special">&lt;-</span> get self, value
<span id="L107" class="LineNr">107 </span> <span class="PreProc">var</span> _value/<span class="Constant">eax</span>: (addr stream byte) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *value-ah
<span id="L107" class="LineNr">107 </span> <span class="PreProc">var</span> _value/<span class="Constant">eax</span>: (addr stream byte) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *value-ah
<span id="L108" class="LineNr">108 </span> <span class="PreProc">var</span> value/<span class="Constant">esi</span>: (addr stream byte) <span class="Special">&lt;-</span> copy _value
<span id="L109" class="LineNr">109 </span> <a href='../106stream.subx.html#L59'>rewind-stream</a> value
<span id="L110" class="LineNr">110 </span> <span class="PreProc">var</span> done?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='../309stream.subx.html#L6'>stream-empty?</a> value
@ -188,7 +189,7 @@ if ('onhashchange' in window) {
<span id="L129" class="LineNr">129 </span> compare *cursor-in-trace?, <span class="Constant">0</span>/false
<span id="L130" class="LineNr">130 </span> <span class="Delimiter">{</span>
<span id="L131" class="LineNr">131 </span> <span class="PreProc">break-if-=</span>
<span id="L132" class="LineNr">132 </span> <a href='trace.mu.html#L681'>render-trace-menu</a> <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L132" class="LineNr">132 </span> <a href='trace.mu.html#L712'>render-trace-menu</a> <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L133" class="LineNr">133 </span> <span class="PreProc">return</span>
<span id="L134" class="LineNr">134 </span> <span class="Delimiter">}</span>
<span id="L135" class="LineNr">135 </span> <span class="PreProc">var</span> cursor-in-keyboard?/<span class="Constant">eax</span>: (addr boolean) <span class="Special">&lt;-</span> get self, cursor-in-keyboard?
@ -204,7 +205,7 @@ if ('onhashchange' in window) {
<span id="L145" class="LineNr">145 </span> <span class="muComment"># render just enough of the sandbox to figure out what to erase</span>
<span id="L146" class="LineNr">146 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> copy _self
<span id="L147" class="LineNr">147 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">eax</span>: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> get self, data
<span id="L148" class="LineNr">148 </span> <span class="PreProc">var</span> _data/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L148" class="LineNr">148 </span> <span class="PreProc">var</span> _data/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L149" class="LineNr">149 </span> <span class="PreProc">var</span> data/<span class="Constant">edx</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> copy _data
<span id="L150" class="LineNr">150 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy xmin
<span id="L151" class="LineNr">151 </span> <span class="PreProc">var</span> y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy ymin
@ -219,7 +220,7 @@ if ('onhashchange' in window) {
<span id="L160" class="LineNr">160 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='sandbox.mu.html#L160'>maybe-render-empty-screen</a></span> <a href='../500fake-screen.mu.html#L14'>screen</a>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>), _self: (addr <a href='sandbox.mu.html#L1'>sandbox</a>), xmin: int, ymin: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
<span id="L161" class="LineNr">161 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> copy _self
<span id="L162" class="LineNr">162 </span> <span class="PreProc">var</span> screen-obj-cell-ah/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get self, screen-var
<span id="L163" class="LineNr">163 </span> <span class="PreProc">var</span> screen-obj-cell/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *screen-obj-cell-ah
<span id="L163" class="LineNr">163 </span> <span class="PreProc">var</span> screen-obj-cell/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *screen-obj-cell-ah
<span id="L164" class="LineNr">164 </span> compare screen-obj-cell, <span class="Constant">0</span>
<span id="L165" class="LineNr">165 </span> <span class="Delimiter">{</span>
<span id="L166" class="LineNr">166 </span> <span class="PreProc">break-if-!=</span>
@ -233,9 +234,9 @@ if ('onhashchange' in window) {
<span id="L174" class="LineNr">174 </span> <span class="Delimiter">}</span>
<span id="L175" class="LineNr">175 </span> <span class="PreProc">var</span> y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy ymin
<span id="L176" class="LineNr">176 </span> <span class="PreProc">var</span> screen-obj-ah/<span class="Constant">eax</span>: (addr handle <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> get screen-obj-cell, screen-data
<span id="L177" class="LineNr">177 </span> <span class="PreProc">var</span> _screen-obj/<span class="Constant">eax</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *screen-obj-ah
<span id="L177" class="LineNr">177 </span> <span class="PreProc">var</span> _screen-obj/<span class="Constant">eax</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *screen-obj-ah
<span id="L178" class="LineNr">178 </span> <span class="PreProc">var</span> screen-obj/<span class="Constant">edx</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> copy _screen-obj
<span id="L179" class="LineNr">179 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='../501draw-text.mu.html#L100'>draw-text-rightward</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;screen: &quot;</span>, xmin, <span class="Constant">0x99</span>/xmax, y, <span class="Constant">7</span>/fg, <span class="Constant">0xc5</span>/bg=blue-bg
<span id="L179" class="LineNr">179 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='../501draw-text.mu.html#L100'>draw-text-rightward</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;screen: &quot;</span>, xmin, <span class="Constant">0x99</span>/xmax, y, <span class="Constant">0x17</span>/fg, <span class="Constant">0xc5</span>/bg=blue-bg
<span id="L180" class="LineNr">180 </span> y <span class="Special">&lt;-</span> <a href='sandbox.mu.html#L214'>render-empty-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, screen-obj, x, y
<span id="L181" class="LineNr">181 </span> <span class="PreProc">return</span> y
<span id="L182" class="LineNr">182 </span><span class="Delimiter">}</span>
@ -243,7 +244,7 @@ if ('onhashchange' in window) {
<span id="L184" class="LineNr">184 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='sandbox.mu.html#L184'>maybe-render-screen</a></span> <a href='../500fake-screen.mu.html#L14'>screen</a>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>), _self: (addr <a href='sandbox.mu.html#L1'>sandbox</a>), xmin: int, ymin: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
<span id="L185" class="LineNr">185 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> copy _self
<span id="L186" class="LineNr">186 </span> <span class="PreProc">var</span> screen-obj-cell-ah/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get self, screen-var
<span id="L187" class="LineNr">187 </span> <span class="PreProc">var</span> screen-obj-cell/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *screen-obj-cell-ah
<span id="L187" class="LineNr">187 </span> <span class="PreProc">var</span> screen-obj-cell/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *screen-obj-cell-ah
<span id="L188" class="LineNr">188 </span> compare screen-obj-cell, <span class="Constant">0</span>
<span id="L189" class="LineNr">189 </span> <span class="Delimiter">{</span>
<span id="L190" class="LineNr">190 </span> <span class="PreProc">break-if-!=</span>
@ -256,7 +257,7 @@ if ('onhashchange' in window) {
<span id="L197" class="LineNr">197 </span> <span class="PreProc">return</span> ymin <span class="muComment"># silently give up on rendering the screen</span>
<span id="L198" class="LineNr">198 </span> <span class="Delimiter">}</span>
<span id="L199" class="LineNr">199 </span> <span class="PreProc">var</span> screen-obj-ah/<span class="Constant">eax</span>: (addr handle <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> get screen-obj-cell, screen-data
<span id="L200" class="LineNr">200 </span> <span class="PreProc">var</span> _screen-obj/<span class="Constant">eax</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *screen-obj-ah
<span id="L200" class="LineNr">200 </span> <span class="PreProc">var</span> _screen-obj/<span class="Constant">eax</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *screen-obj-ah
<span id="L201" class="LineNr">201 </span> <span class="PreProc">var</span> screen-obj/<span class="Constant">edx</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> copy _screen-obj
<span id="L202" class="LineNr">202 </span> <span class="Delimiter">{</span>
<span id="L203" class="LineNr">203 </span> <span class="PreProc">var</span> screen-empty?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='../500fake-screen.mu.html#L273'>fake-screen-empty?</a> screen-obj
@ -264,7 +265,7 @@ if ('onhashchange' in window) {
<span id="L205" class="LineNr">205 </span> <span class="PreProc">break-if-=</span>
<span id="L206" class="LineNr">206 </span> <span class="PreProc">return</span> ymin
<span id="L207" class="LineNr">207 </span> <span class="Delimiter">}</span>
<span id="L208" class="LineNr">208 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='../501draw-text.mu.html#L100'>draw-text-rightward</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;screen: &quot;</span>, xmin, <span class="Constant">0x99</span>/xmax, ymin, <span class="Constant">7</span>/fg, <span class="Constant">0xc5</span>/bg=blue-bg
<span id="L208" class="LineNr">208 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='../501draw-text.mu.html#L100'>draw-text-rightward</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;screen: &quot;</span>, xmin, <span class="Constant">0x99</span>/xmax, ymin, <span class="Constant">0x17</span>/fg, <span class="Constant">0xc5</span>/bg=blue-bg
<span id="L209" class="LineNr">209 </span> <span class="PreProc">var</span> y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy ymin
<span id="L210" class="LineNr">210 </span> y <span class="Special">&lt;-</span> <a href='sandbox.mu.html#L241'>render-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, screen-obj, x, y
<span id="L211" class="LineNr">211 </span> <span class="PreProc">return</span> y
@ -335,7 +336,7 @@ if ('onhashchange' in window) {
<span id="L276" class="LineNr">276 </span> <span class="PreProc">var</span> top: int
<span id="L277" class="LineNr">277 </span> copy-to top, tmp
<span id="L278" class="LineNr">278 </span> <span class="PreProc">var</span> pixels-ah/<span class="Constant">eax</span>: (addr handle array byte) <span class="Special">&lt;-</span> get target-screen, pixels
<span id="L279" class="LineNr">279 </span> <span class="PreProc">var</span> _pixels/<span class="Constant">eax</span>: (addr array byte) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *pixels-ah
<span id="L279" class="LineNr">279 </span> <span class="PreProc">var</span> _pixels/<span class="Constant">eax</span>: (addr array byte) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *pixels-ah
<span id="L280" class="LineNr">280 </span> <span class="PreProc">var</span> pixels/<span class="Constant">edi</span>: (addr array byte) <span class="Special">&lt;-</span> copy _pixels
<span id="L281" class="LineNr">281 </span> compare pixels, <span class="Constant">0</span>
<span id="L282" class="LineNr">282 </span> <span class="PreProc">break-if-=</span>
@ -379,7 +380,7 @@ if ('onhashchange' in window) {
<span id="L320" class="LineNr">320 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='sandbox.mu.html#L320'>has-keyboard?</a></span> _self: (addr <a href='sandbox.mu.html#L1'>sandbox</a>)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean <span class="Delimiter">{</span>
<span id="L321" class="LineNr">321 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> copy _self
<span id="L322" class="LineNr">322 </span> <span class="PreProc">var</span> keyboard-obj-cell-ah/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get self, keyboard-var
<span id="L323" class="LineNr">323 </span> <span class="PreProc">var</span> keyboard-obj-cell/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *keyboard-obj-cell-ah
<span id="L323" class="LineNr">323 </span> <span class="PreProc">var</span> keyboard-obj-cell/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *keyboard-obj-cell-ah
<span id="L324" class="LineNr">324 </span> compare keyboard-obj-cell, <span class="Constant">0</span>
<span id="L325" class="LineNr">325 </span> <span class="Delimiter">{</span>
<span id="L326" class="LineNr">326 </span> <span class="PreProc">break-if-!=</span>
@ -392,7 +393,7 @@ if ('onhashchange' in window) {
<span id="L333" class="LineNr">333 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L334" class="LineNr">334 </span> <span class="Delimiter">}</span>
<span id="L335" class="LineNr">335 </span> <span class="PreProc">var</span> keyboard-obj-ah/<span class="Constant">eax</span>: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> get keyboard-obj-cell, keyboard-data
<span id="L336" class="LineNr">336 </span> <span class="PreProc">var</span> _keyboard-obj/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *keyboard-obj-ah
<span id="L336" class="LineNr">336 </span> <span class="PreProc">var</span> _keyboard-obj/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *keyboard-obj-ah
<span id="L337" class="LineNr">337 </span> <span class="PreProc">var</span> keyboard-obj/<span class="Constant">edx</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> copy _keyboard-obj
<span id="L338" class="LineNr">338 </span> compare keyboard-obj, <span class="Constant">0</span>
<span id="L339" class="LineNr">339 </span> <span class="Delimiter">{</span>
@ -405,7 +406,7 @@ if ('onhashchange' in window) {
<span id="L346" class="LineNr">346 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='sandbox.mu.html#L346'>maybe-render-keyboard</a></span> <a href='../500fake-screen.mu.html#L14'>screen</a>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>), _self: (addr <a href='sandbox.mu.html#L1'>sandbox</a>), xmin: int, ymin: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
<span id="L347" class="LineNr">347 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> copy _self
<span id="L348" class="LineNr">348 </span> <span class="PreProc">var</span> keyboard-obj-cell-ah/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get self, keyboard-var
<span id="L349" class="LineNr">349 </span> <span class="PreProc">var</span> keyboard-obj-cell/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *keyboard-obj-cell-ah
<span id="L349" class="LineNr">349 </span> <span class="PreProc">var</span> keyboard-obj-cell/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *keyboard-obj-cell-ah
<span id="L350" class="LineNr">350 </span> compare keyboard-obj-cell, <span class="Constant">0</span>
<span id="L351" class="LineNr">351 </span> <span class="Delimiter">{</span>
<span id="L352" class="LineNr">352 </span> <span class="PreProc">break-if-!=</span>
@ -418,11 +419,11 @@ if ('onhashchange' in window) {
<span id="L359" class="LineNr">359 </span> <span class="PreProc">return</span> ymin <span class="muComment"># silently give up on rendering the keyboard</span>
<span id="L360" class="LineNr">360 </span> <span class="Delimiter">}</span>
<span id="L361" class="LineNr">361 </span> <span class="PreProc">var</span> keyboard-obj-ah/<span class="Constant">eax</span>: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> get keyboard-obj-cell, keyboard-data
<span id="L362" class="LineNr">362 </span> <span class="PreProc">var</span> _keyboard-obj/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *keyboard-obj-ah
<span id="L362" class="LineNr">362 </span> <span class="PreProc">var</span> _keyboard-obj/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *keyboard-obj-ah
<span id="L363" class="LineNr">363 </span> <span class="PreProc">var</span> keyboard-obj/<span class="Constant">edx</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> copy _keyboard-obj
<span id="L364" class="LineNr">364 </span> <span class="PreProc">var</span> y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy ymin
<span id="L365" class="LineNr">365 </span> y <span class="Special">&lt;-</span> increment <span class="muComment"># padding</span>
<span id="L366" class="LineNr">366 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='../501draw-text.mu.html#L100'>draw-text-rightward</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;keyboard: &quot;</span>, xmin, <span class="Constant">0x99</span>/xmax, y, <span class="Constant">7</span>/fg, <span class="Constant">0xc5</span>/bg=blue-bg
<span id="L366" class="LineNr">366 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='../501draw-text.mu.html#L100'>draw-text-rightward</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;keyboard: &quot;</span>, xmin, <span class="Constant">0x99</span>/xmax, y, <span class="Constant">0x17</span>/fg, <span class="Constant">0xc5</span>/bg=blue-bg
<span id="L367" class="LineNr">367 </span> <span class="PreProc">var</span> cursor-in-keyboard?/<span class="Constant">esi</span>: (addr boolean) <span class="Special">&lt;-</span> get self, cursor-in-keyboard?
<span id="L368" class="LineNr">368 </span> y <span class="Special">&lt;-</span> <a href='sandbox.mu.html#L373'>render-keyboard</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, keyboard-obj, x, y, *cursor-in-keyboard?
<span id="L369" class="LineNr">369 </span> y <span class="Special">&lt;-</span> increment <span class="muComment"># padding</span>
@ -448,7 +449,7 @@ if ('onhashchange' in window) {
<span id="L389" class="LineNr">389 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='sandbox.mu.html#L389'>print-screen-cell-of-fake-screen</a></span> <a href='../500fake-screen.mu.html#L14'>screen</a>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>), _target: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>), x: int, y: int <span class="Delimiter">{</span>
<span id="L390" class="LineNr">390 </span> <span class="PreProc">var</span> target/<span class="Constant">ecx</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> copy _target
<span id="L391" class="LineNr">391 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">eax</span>: (addr handle array <a href='../500fake-screen.mu.html#L25'>screen-cell</a>) <span class="Special">&lt;-</span> get target, data
<span id="L392" class="LineNr">392 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array <a href='../500fake-screen.mu.html#L25'>screen-cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L392" class="LineNr">392 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array <a href='../500fake-screen.mu.html#L25'>screen-cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L393" class="LineNr">393 </span> <span class="PreProc">var</span> index/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> <a href='../500fake-screen.mu.html#L120'>screen-cell-index</a> target, x, y
<span id="L394" class="LineNr">394 </span> <span class="PreProc">var</span> offset/<span class="Constant">ecx</span>: (offset <a href='../500fake-screen.mu.html#L25'>screen-cell</a>) <span class="Special">&lt;-</span> compute-offset data, index
<span id="L395" class="LineNr">395 </span> <span class="PreProc">var</span> src-cell/<span class="Constant">esi</span>: (addr <a href='../500fake-screen.mu.html#L25'>screen-cell</a>) <span class="Special">&lt;-</span> index data, offset
@ -476,8 +477,8 @@ if ('onhashchange' in window) {
<span id="L417" class="LineNr">417 </span> <a href='../501draw-text.mu.html#L133'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; <a href='sandbox.mu.html#L600'>run</a> <a href='sandbox.mu.html#L1'>sandbox</a> &quot;</span>, width, <span class="Constant">7</span>/fg, <span class="Constant">0xc5</span>/bg=blue-bg
<span id="L418" class="LineNr">418 </span> $render-sandbox-menu:render-ctrl-m: <span class="Delimiter">{</span>
<span id="L419" class="LineNr">419 </span> <span class="PreProc">var</span> self/<span class="Constant">eax</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> copy _self
<span id="L420" class="LineNr">420 </span> <span class="PreProc">var</span> <a href='sandbox.mu.html#L879'>has-trace?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='sandbox.mu.html#L879'>has-trace?</a> self
<span id="L421" class="LineNr">421 </span> compare <a href='sandbox.mu.html#L879'>has-trace?</a>, <span class="Constant">0</span>/false
<span id="L420" class="LineNr">420 </span> <span class="PreProc">var</span> <a href='sandbox.mu.html#L883'>has-trace?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='sandbox.mu.html#L883'>has-trace?</a> self
<span id="L421" class="LineNr">421 </span> compare <a href='sandbox.mu.html#L883'>has-trace?</a>, <span class="Constant">0</span>/false
<span id="L422" class="LineNr">422 </span> <span class="Delimiter">{</span>
<span id="L423" class="LineNr">423 </span> <span class="PreProc">break-if-=</span>
<span id="L424" class="LineNr">424 </span> <a href='../501draw-text.mu.html#L133'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; m &quot;</span>, width, <span class="Constant">0</span>/fg, <span class="Constant">0x38</span>/bg=trace
@ -525,14 +526,14 @@ if ('onhashchange' in window) {
<span id="L466" class="LineNr">466 </span> <span class="PreProc">break-if-!=</span>
<span id="L467" class="LineNr">467 </span> <span class="muComment"># minor gotcha here: any bindings created later in this iteration won't be</span>
<span id="L468" class="LineNr">468 </span> <span class="muComment"># persisted until the next call to ctrl-s.</span>
<span id="L469" class="LineNr">469 </span> <a href='main.mu.html#L138'>store-state</a> data-disk, self, globals
<span id="L469" class="LineNr">469 </span> <a href='main.mu.html#L147'>store-state</a> data-disk, self, globals
<span id="L470" class="LineNr">470 </span> <span class="muComment"># run sandbox</span>
<span id="L471" class="LineNr">471 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">ecx</span>: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> get self, data
<span id="L472" class="LineNr">472 </span> <span class="PreProc">var</span> value-ah/<span class="Constant">eax</span>: (addr handle stream byte) <span class="Special">&lt;-</span> get self, value
<span id="L473" class="LineNr">473 </span> <span class="PreProc">var</span> _value/<span class="Constant">eax</span>: (addr stream byte) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *value-ah
<span id="L473" class="LineNr">473 </span> <span class="PreProc">var</span> _value/<span class="Constant">eax</span>: (addr stream byte) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *value-ah
<span id="L474" class="LineNr">474 </span> <span class="PreProc">var</span> value/<span class="Constant">edx</span>: (addr stream byte) <span class="Special">&lt;-</span> copy _value
<span id="L475" class="LineNr">475 </span> <span class="PreProc">var</span> trace-ah/<span class="Constant">eax</span>: (addr handle trace) <span class="Special">&lt;-</span> get self, trace
<span id="L476" class="LineNr">476 </span> <span class="PreProc">var</span> _trace/<span class="Constant">eax</span>: (addr trace) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *trace-ah
<span id="L476" class="LineNr">476 </span> <span class="PreProc">var</span> _trace/<span class="Constant">eax</span>: (addr trace) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *trace-ah
<span id="L477" class="LineNr">477 </span> <span class="PreProc">var</span> trace/<span class="Constant">ebx</span>: (addr trace) <span class="Special">&lt;-</span> copy _trace
<span id="L478" class="LineNr">478 </span> <a href='trace.mu.html#L45'>clear-trace</a> trace
<span id="L479" class="LineNr">479 </span> <span class="Delimiter">{</span>
@ -541,9 +542,9 @@ if ('onhashchange' in window) {
<span id="L482" class="LineNr">482 </span> <a href='sandbox.mu.html#L144'>clear-sandbox-output</a> real-screen, self, <span class="Constant">0x56</span>/sandbox-left-margin, <span class="Constant">1</span>/y, <span class="Constant">0x80</span>/screen-width, <span class="Constant">0x2f</span>/screen-height-without-menu
<span id="L483" class="LineNr">483 </span> <span class="Delimiter">}</span>
<span id="L484" class="LineNr">484 </span> <span class="PreProc">var</span> <a href='../500fake-screen.mu.html#L25'>screen-cell</a>/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get self, screen-var
<span id="L485" class="LineNr">485 </span> <a href='cell.mu.html#L163'>clear-screen-cell</a> <a href='../500fake-screen.mu.html#L25'>screen-cell</a>
<span id="L485" class="LineNr">485 </span> <a href='cell.mu.html#L164'>clear-screen-cell</a> <a href='../500fake-screen.mu.html#L25'>screen-cell</a>
<span id="L486" class="LineNr">486 </span> <span class="PreProc">var</span> keyboard-cell/<span class="Constant">esi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get self, keyboard-var
<span id="L487" class="LineNr">487 </span> <a href='cell.mu.html#L194'>rewind-keyboard-cell</a> keyboard-cell <span class="muComment"># don't clear keys from before</span>
<span id="L487" class="LineNr">487 </span> <a href='cell.mu.html#L195'>rewind-keyboard-cell</a> keyboard-cell <span class="muComment"># don't clear keys from before</span>
<span id="L488" class="LineNr">488 </span> <span class="Delimiter">{</span>
<span id="L489" class="LineNr">489 </span> compare tweak-real-screen?, <span class="Constant">0</span>/false
<span id="L490" class="LineNr">490 </span> <span class="PreProc">break-if-=</span>
@ -561,8 +562,8 @@ if ('onhashchange' in window) {
<span id="L502" class="LineNr">502 </span> <span class="PreProc">var</span> cursor-in-data?/<span class="Constant">eax</span>: (addr boolean) <span class="Special">&lt;-</span> get self, cursor-in-data?
<span id="L503" class="LineNr">503 </span> compare *cursor-in-data?, <span class="Constant">0</span>/false
<span id="L504" class="LineNr">504 </span> <span class="PreProc">break-if-=</span>
<span id="L505" class="LineNr">505 </span> <span class="PreProc">var</span> <a href='sandbox.mu.html#L879'>has-trace?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='sandbox.mu.html#L879'>has-trace?</a> self
<span id="L506" class="LineNr">506 </span> compare <a href='sandbox.mu.html#L879'>has-trace?</a>, <span class="Constant">0</span>/false
<span id="L505" class="LineNr">505 </span> <span class="PreProc">var</span> <a href='sandbox.mu.html#L883'>has-trace?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='sandbox.mu.html#L883'>has-trace?</a> self
<span id="L506" class="LineNr">506 </span> compare <a href='sandbox.mu.html#L883'>has-trace?</a>, <span class="Constant">0</span>/false
<span id="L507" class="LineNr">507 </span> <span class="Delimiter">{</span>
<span id="L508" class="LineNr">508 </span> <span class="PreProc">break-if-=</span>
<span id="L509" class="LineNr">509 </span> <span class="PreProc">var</span> cursor-in-data?/<span class="Constant">eax</span>: (addr boolean) <span class="Special">&lt;-</span> get self, cursor-in-data?
@ -617,7 +618,7 @@ if ('onhashchange' in window) {
<span id="L558" class="LineNr">558 </span> compare *cursor-in-data?, <span class="Constant">0</span>/false
<span id="L559" class="LineNr">559 </span> <span class="PreProc">break-if-=</span>
<span id="L560" class="LineNr">560 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">eax</span>: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> get self, data
<span id="L561" class="LineNr">561 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L561" class="LineNr">561 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L562" class="LineNr">562 </span> <a href='gap-buffer.mu.html#L921'>edit-gap-buffer</a> data, g
<span id="L563" class="LineNr">563 </span> <span class="PreProc">return</span>
<span id="L564" class="LineNr">564 </span> <span class="Delimiter">}</span>
@ -627,7 +628,7 @@ if ('onhashchange' in window) {
<span id="L568" class="LineNr">568 </span> compare *cursor-in-keyboard?, <span class="Constant">0</span>/false
<span id="L569" class="LineNr">569 </span> <span class="PreProc">break-if-=</span>
<span id="L570" class="LineNr">570 </span> <span class="PreProc">var</span> keyboard-cell-ah/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get self, keyboard-var
<span id="L571" class="LineNr">571 </span> <span class="PreProc">var</span> keyboard-cell/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *keyboard-cell-ah
<span id="L571" class="LineNr">571 </span> <span class="PreProc">var</span> keyboard-cell/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *keyboard-cell-ah
<span id="L572" class="LineNr">572 </span> compare keyboard-cell, <span class="Constant">0</span>
<span id="L573" class="LineNr">573 </span> <span class="Delimiter">{</span>
<span id="L574" class="LineNr">574 </span> <span class="PreProc">break-if-!=</span>
@ -640,7 +641,7 @@ if ('onhashchange' in window) {
<span id="L581" class="LineNr">581 </span> <span class="PreProc">return</span>
<span id="L582" class="LineNr">582 </span> <span class="Delimiter">}</span>
<span id="L583" class="LineNr">583 </span> <span class="PreProc">var</span> keyboard-ah/<span class="Constant">eax</span>: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> get keyboard-cell, keyboard-data
<span id="L584" class="LineNr">584 </span> <span class="PreProc">var</span> keyboard/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *keyboard-ah
<span id="L584" class="LineNr">584 </span> <span class="PreProc">var</span> keyboard/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *keyboard-ah
<span id="L585" class="LineNr">585 </span> <a href='gap-buffer.mu.html#L921'>edit-gap-buffer</a> keyboard, g
<span id="L586" class="LineNr">586 </span> <span class="PreProc">return</span>
<span id="L587" class="LineNr">587 </span> <span class="Delimiter">}</span>
@ -650,15 +651,15 @@ if ('onhashchange' in window) {
<span id="L591" class="LineNr">591 </span> compare *cursor-in-trace?, <span class="Constant">0</span>/false
<span id="L592" class="LineNr">592 </span> <span class="PreProc">break-if-=</span>
<span id="L593" class="LineNr">593 </span> <span class="PreProc">var</span> trace-ah/<span class="Constant">eax</span>: (addr handle trace) <span class="Special">&lt;-</span> get self, trace
<span id="L594" class="LineNr">594 </span> <span class="PreProc">var</span> trace/<span class="Constant">eax</span>: (addr trace) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *trace-ah
<span id="L595" class="LineNr">595 </span> <a href='trace.mu.html#L704'>edit-trace</a> trace, g
<span id="L594" class="LineNr">594 </span> <span class="PreProc">var</span> trace/<span class="Constant">eax</span>: (addr trace) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *trace-ah
<span id="L595" class="LineNr">595 </span> <a href='trace.mu.html#L735'>edit-trace</a> trace, g
<span id="L596" class="LineNr">596 </span> <span class="PreProc">return</span>
<span id="L597" class="LineNr">597 </span> <span class="Delimiter">}</span>
<span id="L598" class="LineNr">598 </span><span class="Delimiter">}</span>
<span id="L599" class="LineNr">599 </span>
<span id="L600" class="LineNr">600 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='sandbox.mu.html#L600'>run</a></span> _in-ah: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>), out: (addr stream byte), globals: (addr <a href='global.mu.html#L7'>global-table</a>), trace: (addr trace), <a href='../500fake-screen.mu.html#L25'>screen-cell</a>: (addr handle <a href='cell.mu.html#L1'>cell</a>), keyboard-cell: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Delimiter">{</span>
<span id="L601" class="LineNr">601 </span> <span class="PreProc">var</span> in-ah/<span class="Constant">eax</span>: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> copy _in-ah
<span id="L602" class="LineNr">602 </span> <span class="PreProc">var</span> in/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *in-ah
<span id="L602" class="LineNr">602 </span> <span class="PreProc">var</span> in/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *in-ah
<span id="L603" class="LineNr">603 </span> <span class="PreProc">var</span> read-result-h: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L604" class="LineNr">604 </span> <span class="PreProc">var</span> read-result-ah/<span class="Constant">esi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address read-result-h
<span id="L605" class="LineNr">605 </span> <a href='read.mu.html#L1'>read-cell</a> in, read-result-ah, trace
@ -668,291 +669,295 @@ if ('onhashchange' in window) {
<span id="L609" class="LineNr">609 </span> <span class="PreProc">break-if-=</span>
<span id="L610" class="LineNr">610 </span> <span class="PreProc">return</span>
<span id="L611" class="LineNr">611 </span> <span class="Delimiter">}</span>
<span id="L612" class="LineNr">612 </span> <span class="PreProc">var</span> nil-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L613" class="LineNr">613 </span> <span class="PreProc">var</span> nil-ah/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address nil-storage
<span id="L614" class="LineNr">614 </span> <a href='cell.mu.html#L101'>allocate-pair</a> nil-ah
<span id="L615" class="LineNr">615 </span> <span class="PreProc">var</span> eval-result-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L616" class="LineNr">616 </span> <span class="PreProc">var</span> eval-result/<span class="Constant">edi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address eval-result-storage
<span id="L617" class="LineNr">617 </span> <a href='../315stack-debug.subx.html#L56'>debug-print</a> <span class="Constant">&quot;^&quot;</span>, <span class="Constant">4</span>/fg, <span class="Constant">0xc5</span>/bg=blue-bg
<span id="L618" class="LineNr">618 </span> <a href='evaluate.mu.html#L5'>evaluate</a> read-result-ah, eval-result, *nil-ah, globals, trace, <a href='../500fake-screen.mu.html#L25'>screen-cell</a>, keyboard-cell, <span class="Constant">1</span>/call-number
<span id="L619" class="LineNr">619 </span> <a href='../315stack-debug.subx.html#L56'>debug-print</a> <span class="Constant">&quot;$&quot;</span>, <span class="Constant">4</span>/fg, <span class="Constant">0xc5</span>/bg=blue-bg
<span id="L620" class="LineNr">620 </span> <span class="PreProc">var</span> error?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='trace.mu.html#L54'>has-errors?</a> trace
<span id="L621" class="LineNr">621 </span> <span class="Delimiter">{</span>
<span id="L622" class="LineNr">622 </span> compare error?, <span class="Constant">0</span>/false
<span id="L623" class="LineNr">623 </span> <span class="PreProc">break-if-=</span>
<span id="L624" class="LineNr">624 </span> <span class="PreProc">return</span>
<span id="L625" class="LineNr">625 </span> <span class="Delimiter">}</span>
<span id="L626" class="LineNr">626 </span> <span class="muComment"># if there was no error and the read-result starts with &quot;set&quot; or &quot;def&quot;, save</span>
<span id="L627" class="LineNr">627 </span> <span class="muComment"># the gap buffer in the modified global, then create a new one for the next</span>
<span id="L628" class="LineNr">628 </span> <span class="muComment"># command.</span>
<span id="L629" class="LineNr">629 </span> <a href='global.mu.html#L1861'>maybe-stash-gap-buffer-to-global</a> globals, read-result-ah, _in-ah
<span id="L630" class="LineNr">630 </span> <a href='../106stream.subx.html#L20'>clear-stream</a> out
<span id="L631" class="LineNr">631 </span> <a href='print.mu.html#L1'>print-cell</a> eval-result, out, trace
<span id="L632" class="LineNr">632 </span> <a href='trace.mu.html#L314'>mark-lines-dirty</a> trace
<span id="L633" class="LineNr">633 </span><span class="Delimiter">}</span>
<span id="L634" class="LineNr">634 </span>
<span id="L635" class="LineNr">635 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='sandbox.mu.html#L635'>read-evaluate-and-move-to-globals</a></span> _in-ah: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>), globals: (addr <a href='global.mu.html#L7'>global-table</a>) <span class="Delimiter">{</span>
<span id="L636" class="LineNr">636 </span> <span class="PreProc">var</span> in-ah/<span class="Constant">eax</span>: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> copy _in-ah
<span id="L637" class="LineNr">637 </span> <span class="PreProc">var</span> in/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *in-ah
<span id="L638" class="LineNr">638 </span> <span class="PreProc">var</span> read-result-h: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L639" class="LineNr">639 </span> <span class="PreProc">var</span> read-result-ah/<span class="Constant">esi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address read-result-h
<span id="L640" class="LineNr">640 </span> <a href='read.mu.html#L1'>read-cell</a> in, read-result-ah, <span class="Constant">0</span>/no-trace
<span id="L641" class="LineNr">641 </span> <span class="PreProc">var</span> nil-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L642" class="LineNr">642 </span> <span class="PreProc">var</span> nil-ah/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address nil-storage
<span id="L643" class="LineNr">643 </span> <a href='cell.mu.html#L101'>allocate-pair</a> nil-ah
<span id="L644" class="LineNr">644 </span> <span class="PreProc">var</span> eval-result-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L645" class="LineNr">645 </span> <span class="PreProc">var</span> eval-result/<span class="Constant">edi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address eval-result-storage
<span id="L646" class="LineNr">646 </span> <a href='../315stack-debug.subx.html#L56'>debug-print</a> <span class="Constant">&quot;^&quot;</span>, <span class="Constant">4</span>/fg, <span class="Constant">0xc5</span>/bg=blue-bg
<span id="L647" class="LineNr">647 </span> <a href='evaluate.mu.html#L5'>evaluate</a> read-result-ah, eval-result, *nil-ah, globals, <span class="Constant">0</span>/no-trace, <span class="Constant">0</span>/no-screen-cell, <span class="Constant">0</span>/no-keyboard-cell, <span class="Constant">1</span>/call-number
<span id="L648" class="LineNr">648 </span> <a href='../315stack-debug.subx.html#L56'>debug-print</a> <span class="Constant">&quot;$&quot;</span>, <span class="Constant">4</span>/fg, <span class="Constant">0xc5</span>/bg=blue-bg
<span id="L649" class="LineNr">649 </span> <a href='global.mu.html#L1917'>move-gap-buffer-to-global</a> globals, read-result-ah, _in-ah
<span id="L650" class="LineNr">650 </span><span class="Delimiter">}</span>
<span id="L651" class="LineNr">651 </span>
<span id="L652" class="LineNr">652 </span><span class="PreProc">fn</span> <span class="muTest"><a href='sandbox.mu.html#L652'>test-run-integer</a></span> <span class="Delimiter">{</span>
<span id="L653" class="LineNr">653 </span> <span class="PreProc">var</span> sandbox-storage: <a href='sandbox.mu.html#L1'>sandbox</a>
<span id="L654" class="LineNr">654 </span> <span class="PreProc">var</span> <a href='sandbox.mu.html#L1'>sandbox</a>/<span class="Constant">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> address sandbox-storage
<span id="L655" class="LineNr">655 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">&quot;1&quot;</span>
<span id="L656" class="LineNr">656 </span> <span class="muComment"># eval</span>
<span id="L657" class="LineNr">657 </span> <a href='sandbox.mu.html#L460'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0x13</span>/ctrl-s, <span class="Constant">0</span>/no-globals, <span class="Constant">0</span>/no-disk, <span class="Constant">0</span>/no-screen, <span class="Constant">0</span>/no-tweak-screen
<span id="L658" class="LineNr">658 </span> <span class="muComment"># setup: screen</span>
<span id="L659" class="LineNr">659 </span> <span class="PreProc">var</span> screen-on-stack: <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L660" class="LineNr">660 </span> <span class="PreProc">var</span> <a href='../500fake-screen.mu.html#L14'>screen</a>/<span class="Constant">edi</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> address screen-on-stack
<span id="L661" class="LineNr">661 </span> <a href='../500fake-screen.mu.html#L31'>initialize-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height, <span class="Constant">0</span>/no-pixel-graphics
<span id="L662" class="LineNr">662 </span> <span class="muComment">#</span>
<span id="L663" class="LineNr">663 </span> <a href='sandbox.mu.html#L81'>render-sandbox</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0</span>/x, <span class="Constant">0</span>/y, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height
<span id="L664" class="LineNr">664 </span> <span class="muComment"># skip one line of padding</span>
<span id="L665" class="LineNr">665 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">1</span>/y, <span class="Constant">&quot; 1 &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L652'>test-run-integer</a>/0&quot;</span>
<span id="L666" class="LineNr">666 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">&quot; ... &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L652'>test-run-integer</a>/1&quot;</span>
<span id="L667" class="LineNr">667 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">3</span>/y, <span class="Constant">&quot; =&gt; 1 &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L652'>test-run-integer</a>/2&quot;</span>
<span id="L668" class="LineNr">668 </span><span class="Delimiter">}</span>
<span id="L669" class="LineNr">669 </span>
<span id="L670" class="LineNr">670 </span><span class="PreProc">fn</span> <span class="muTest"><a href='sandbox.mu.html#L670'>test-run-error-invalid-integer</a></span> <span class="Delimiter">{</span>
<span id="L671" class="LineNr">671 </span> <span class="PreProc">var</span> sandbox-storage: <a href='sandbox.mu.html#L1'>sandbox</a>
<span id="L672" class="LineNr">672 </span> <span class="PreProc">var</span> <a href='sandbox.mu.html#L1'>sandbox</a>/<span class="Constant">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> address sandbox-storage
<span id="L673" class="LineNr">673 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">&quot;1a&quot;</span>
<span id="L674" class="LineNr">674 </span> <span class="muComment"># eval</span>
<span id="L675" class="LineNr">675 </span> <a href='sandbox.mu.html#L460'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0x13</span>/ctrl-s, <span class="Constant">0</span>/no-globals, <span class="Constant">0</span>/no-disk, <span class="Constant">0</span>/no-screen, <span class="Constant">0</span>/no-tweak-screen
<span id="L676" class="LineNr">676 </span> <span class="muComment"># setup: screen</span>
<span id="L677" class="LineNr">677 </span> <span class="PreProc">var</span> screen-on-stack: <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L678" class="LineNr">678 </span> <span class="PreProc">var</span> <a href='../500fake-screen.mu.html#L14'>screen</a>/<span class="Constant">edi</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> address screen-on-stack
<span id="L679" class="LineNr">679 </span> <a href='../500fake-screen.mu.html#L31'>initialize-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height, <span class="Constant">0</span>/no-pixel-graphics
<span id="L680" class="LineNr">680 </span> <span class="muComment">#</span>
<span id="L681" class="LineNr">681 </span> <a href='sandbox.mu.html#L81'>render-sandbox</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0</span>/x, <span class="Constant">0</span>/y, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height
<span id="L682" class="LineNr">682 </span> <span class="muComment"># skip one line of padding</span>
<span id="L683" class="LineNr">683 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">1</span>/y, <span class="Constant">&quot; 1a &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L670'>test-run-error-invalid-integer</a>/0&quot;</span>
<span id="L684" class="LineNr">684 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">&quot; ... &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L670'>test-run-error-invalid-integer</a>/0&quot;</span>
<span id="L685" class="LineNr">685 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">3</span>/y, <span class="Constant">&quot; invalid number &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L670'>test-run-error-invalid-integer</a>/2&quot;</span>
<span id="L686" class="LineNr">686 </span><span class="Delimiter">}</span>
<span id="L687" class="LineNr">687 </span>
<span id="L688" class="LineNr">688 </span><span class="PreProc">fn</span> <span class="muTest"><a href='sandbox.mu.html#L688'>test-run-with-spaces</a></span> <span class="Delimiter">{</span>
<span id="L689" class="LineNr">689 </span> <span class="PreProc">var</span> sandbox-storage: <a href='sandbox.mu.html#L1'>sandbox</a>
<span id="L690" class="LineNr">690 </span> <span class="PreProc">var</span> <a href='sandbox.mu.html#L1'>sandbox</a>/<span class="Constant">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> address sandbox-storage
<span id="L691" class="LineNr">691 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">&quot; 1 \n&quot;</span>
<span id="L692" class="LineNr">692 </span> <span class="muComment"># eval</span>
<span id="L693" class="LineNr">693 </span> <a href='sandbox.mu.html#L460'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0x13</span>/ctrl-s, <span class="Constant">0</span>/no-globals, <span class="Constant">0</span>/no-disk, <span class="Constant">0</span>/no-screen, <span class="Constant">0</span>/no-tweak-screen
<span id="L694" class="LineNr">694 </span> <span class="muComment"># setup: screen</span>
<span id="L695" class="LineNr">695 </span> <span class="PreProc">var</span> screen-on-stack: <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L696" class="LineNr">696 </span> <span class="PreProc">var</span> <a href='../500fake-screen.mu.html#L14'>screen</a>/<span class="Constant">edi</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> address screen-on-stack
<span id="L697" class="LineNr">697 </span> <a href='../500fake-screen.mu.html#L31'>initialize-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height, <span class="Constant">0</span>/no-pixel-graphics
<span id="L698" class="LineNr">698 </span> <span class="muComment">#</span>
<span id="L699" class="LineNr">699 </span> <a href='sandbox.mu.html#L81'>render-sandbox</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0</span>/x, <span class="Constant">0</span>/y, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height
<span id="L700" class="LineNr">700 </span> <span class="muComment"># skip one line of padding</span>
<span id="L701" class="LineNr">701 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">1</span>/y, <span class="Constant">&quot; 1 &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L688'>test-run-with-spaces</a>/0&quot;</span>
<span id="L702" class="LineNr">702 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">&quot; &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L688'>test-run-with-spaces</a>/1&quot;</span>
<span id="L703" class="LineNr">703 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">3</span>/y, <span class="Constant">&quot; ... &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L688'>test-run-with-spaces</a>/2&quot;</span>
<span id="L704" class="LineNr">704 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">4</span>/y, <span class="Constant">&quot; =&gt; 1 &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L688'>test-run-with-spaces</a>/3&quot;</span>
<span id="L705" class="LineNr">705 </span><span class="Delimiter">}</span>
<span id="L706" class="LineNr">706 </span>
<span id="L707" class="LineNr">707 </span><span class="PreProc">fn</span> <span class="muTest"><a href='sandbox.mu.html#L707'>test-run-quote</a></span> <span class="Delimiter">{</span>
<span id="L708" class="LineNr">708 </span> <span class="PreProc">var</span> sandbox-storage: <a href='sandbox.mu.html#L1'>sandbox</a>
<span id="L709" class="LineNr">709 </span> <span class="PreProc">var</span> <a href='sandbox.mu.html#L1'>sandbox</a>/<span class="Constant">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> address sandbox-storage
<span id="L710" class="LineNr">710 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">&quot;'a&quot;</span>
<span id="L711" class="LineNr">711 </span> <span class="muComment"># eval</span>
<span id="L712" class="LineNr">712 </span> <a href='sandbox.mu.html#L460'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0x13</span>/ctrl-s, <span class="Constant">0</span>/no-globals, <span class="Constant">0</span>/no-disk, <span class="Constant">0</span>/no-screen, <span class="Constant">0</span>/no-tweak-screen
<span id="L713" class="LineNr">713 </span> <span class="muComment"># setup: screen</span>
<span id="L714" class="LineNr">714 </span> <span class="PreProc">var</span> screen-on-stack: <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L715" class="LineNr">715 </span> <span class="PreProc">var</span> <a href='../500fake-screen.mu.html#L14'>screen</a>/<span class="Constant">edi</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> address screen-on-stack
<span id="L716" class="LineNr">716 </span> <a href='../500fake-screen.mu.html#L31'>initialize-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height, <span class="Constant">0</span>/no-pixel-graphics
<span id="L717" class="LineNr">717 </span> <span class="muComment">#</span>
<span id="L718" class="LineNr">718 </span> <a href='sandbox.mu.html#L81'>render-sandbox</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0</span>/x, <span class="Constant">0</span>/y, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height
<span id="L719" class="LineNr">719 </span> <span class="muComment"># skip one line of padding</span>
<span id="L720" class="LineNr">720 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">1</span>/y, <span class="Constant">&quot; 'a &quot;</span>, <span class="Constant">&quot;F - test-run-quote/0&quot;</span>
<span id="L721" class="LineNr">721 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">&quot; ... &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L707'>test-run-quote</a>/1&quot;</span>
<span id="L722" class="LineNr">722 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">3</span>/y, <span class="Constant">&quot; =&gt; a &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L707'>test-run-quote</a>/2&quot;</span>
<span id="L723" class="LineNr">723 </span><span class="Delimiter">}</span>
<span id="L724" class="LineNr">724 </span>
<span id="L725" class="LineNr">725 </span><span class="PreProc">fn</span> <span class="muTest"><a href='sandbox.mu.html#L725'>test-run-dotted-list</a></span> <span class="Delimiter">{</span>
<span id="L726" class="LineNr">726 </span> <span class="PreProc">var</span> sandbox-storage: <a href='sandbox.mu.html#L1'>sandbox</a>
<span id="L727" class="LineNr">727 </span> <span class="PreProc">var</span> <a href='sandbox.mu.html#L1'>sandbox</a>/<span class="Constant">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> address sandbox-storage
<span id="L728" class="LineNr">728 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">&quot;'(a . b)&quot;</span>
<span id="L729" class="LineNr">729 </span> <span class="muComment"># eval</span>
<span id="L730" class="LineNr">730 </span> <a href='sandbox.mu.html#L460'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0x13</span>/ctrl-s, <span class="Constant">0</span>/no-globals, <span class="Constant">0</span>/no-disk, <span class="Constant">0</span>/no-screen, <span class="Constant">0</span>/no-tweak-screen
<span id="L731" class="LineNr">731 </span> <span class="muComment"># setup: screen</span>
<span id="L732" class="LineNr">732 </span> <span class="PreProc">var</span> screen-on-stack: <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L733" class="LineNr">733 </span> <span class="PreProc">var</span> <a href='../500fake-screen.mu.html#L14'>screen</a>/<span class="Constant">edi</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> address screen-on-stack
<span id="L734" class="LineNr">734 </span> <a href='../500fake-screen.mu.html#L31'>initialize-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height, <span class="Constant">0</span>/no-pixel-graphics
<span id="L735" class="LineNr">735 </span> <span class="muComment">#</span>
<span id="L736" class="LineNr">736 </span> <a href='sandbox.mu.html#L81'>render-sandbox</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0</span>/x, <span class="Constant">0</span>/y, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height
<span id="L737" class="LineNr">737 </span> <span class="muComment"># skip one line of padding</span>
<span id="L738" class="LineNr">738 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">1</span>/y, <span class="Constant">&quot; '(a . b) &quot;</span>, <span class="Constant">&quot;F - test-run-dotted-list/0&quot;</span>
<span id="L739" class="LineNr">739 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">&quot; ... &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L725'>test-run-dotted-list</a>/1&quot;</span>
<span id="L740" class="LineNr">740 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">3</span>/y, <span class="Constant">&quot; =&gt; (a . b) &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L725'>test-run-dotted-list</a>/2&quot;</span>
<span id="L741" class="LineNr">741 </span><span class="Delimiter">}</span>
<span id="L742" class="LineNr">742 </span>
<span id="L743" class="LineNr">743 </span><span class="PreProc">fn</span> <span class="muTest"><a href='sandbox.mu.html#L743'>test-run-dot-and-list</a></span> <span class="Delimiter">{</span>
<span id="L744" class="LineNr">744 </span> <span class="PreProc">var</span> sandbox-storage: <a href='sandbox.mu.html#L1'>sandbox</a>
<span id="L745" class="LineNr">745 </span> <span class="PreProc">var</span> <a href='sandbox.mu.html#L1'>sandbox</a>/<span class="Constant">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> address sandbox-storage
<span id="L746" class="LineNr">746 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">&quot;'(a . (b))&quot;</span>
<span id="L747" class="LineNr">747 </span> <span class="muComment"># eval</span>
<span id="L748" class="LineNr">748 </span> <a href='sandbox.mu.html#L460'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0x13</span>/ctrl-s, <span class="Constant">0</span>/no-globals, <span class="Constant">0</span>/no-disk, <span class="Constant">0</span>/no-screen, <span class="Constant">0</span>/no-tweak-screen
<span id="L749" class="LineNr">749 </span> <span class="muComment"># setup: screen</span>
<span id="L750" class="LineNr">750 </span> <span class="PreProc">var</span> screen-on-stack: <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L751" class="LineNr">751 </span> <span class="PreProc">var</span> <a href='../500fake-screen.mu.html#L14'>screen</a>/<span class="Constant">edi</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> address screen-on-stack
<span id="L752" class="LineNr">752 </span> <a href='../500fake-screen.mu.html#L31'>initialize-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height, <span class="Constant">0</span>/no-pixel-graphics
<span id="L753" class="LineNr">753 </span> <span class="muComment">#</span>
<span id="L754" class="LineNr">754 </span> <a href='sandbox.mu.html#L81'>render-sandbox</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0</span>/x, <span class="Constant">0</span>/y, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height
<span id="L755" class="LineNr">755 </span> <span class="muComment"># skip one line of padding</span>
<span id="L756" class="LineNr">756 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">1</span>/y, <span class="Constant">&quot; '(a . (b)) &quot;</span>, <span class="Constant">&quot;F - test-run-dot-and-list/0&quot;</span>
<span id="L757" class="LineNr">757 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">&quot; ... &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L743'>test-run-dot-and-list</a>/1&quot;</span>
<span id="L758" class="LineNr">758 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">3</span>/y, <span class="Constant">&quot; =&gt; (a b) &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L743'>test-run-dot-and-list</a>/2&quot;</span>
<span id="L759" class="LineNr">759 </span><span class="Delimiter">}</span>
<span id="L760" class="LineNr">760 </span>
<span id="L761" class="LineNr">761 </span><span class="PreProc">fn</span> <span class="muTest"><a href='sandbox.mu.html#L761'>test-run-final-dot</a></span> <span class="Delimiter">{</span>
<span id="L762" class="LineNr">762 </span> <span class="PreProc">var</span> sandbox-storage: <a href='sandbox.mu.html#L1'>sandbox</a>
<span id="L763" class="LineNr">763 </span> <span class="PreProc">var</span> <a href='sandbox.mu.html#L1'>sandbox</a>/<span class="Constant">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> address sandbox-storage
<span id="L764" class="LineNr">764 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">&quot;'(a .)&quot;</span>
<span id="L765" class="LineNr">765 </span> <span class="muComment"># eval</span>
<span id="L766" class="LineNr">766 </span> <a href='sandbox.mu.html#L460'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0x13</span>/ctrl-s, <span class="Constant">0</span>/no-globals, <span class="Constant">0</span>/no-disk, <span class="Constant">0</span>/no-screen, <span class="Constant">0</span>/no-tweak-screen
<span id="L767" class="LineNr">767 </span> <span class="muComment"># setup: screen</span>
<span id="L768" class="LineNr">768 </span> <span class="PreProc">var</span> screen-on-stack: <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L769" class="LineNr">769 </span> <span class="PreProc">var</span> <a href='../500fake-screen.mu.html#L14'>screen</a>/<span class="Constant">edi</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> address screen-on-stack
<span id="L770" class="LineNr">770 </span> <a href='../500fake-screen.mu.html#L31'>initialize-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height, <span class="Constant">0</span>/no-pixel-graphics
<span id="L771" class="LineNr">771 </span> <span class="muComment">#</span>
<span id="L772" class="LineNr">772 </span> <a href='sandbox.mu.html#L81'>render-sandbox</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0</span>/x, <span class="Constant">0</span>/y, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height
<span id="L773" class="LineNr">773 </span> <span class="muComment"># skip one line of padding</span>
<span id="L774" class="LineNr">774 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">1</span>/y, <span class="Constant">&quot; '(a .) &quot;</span>, <span class="Constant">&quot;F - test-run-final-dot/0&quot;</span>
<span id="L775" class="LineNr">775 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">&quot; ... &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L761'>test-run-final-dot</a>/1&quot;</span>
<span id="L776" class="LineNr">776 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">3</span>/y, <span class="Constant">&quot; '. )' makes no sense &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L761'>test-run-final-dot</a>/2&quot;</span>
<span id="L777" class="LineNr">777 </span> <span class="muComment"># further errors may occur</span>
<span id="L778" class="LineNr">778 </span><span class="Delimiter">}</span>
<span id="L779" class="LineNr">779 </span>
<span id="L780" class="LineNr">780 </span><span class="PreProc">fn</span> <span class="muTest"><a href='sandbox.mu.html#L780'>test-run-double-dot</a></span> <span class="Delimiter">{</span>
<span id="L781" class="LineNr">781 </span> <span class="PreProc">var</span> sandbox-storage: <a href='sandbox.mu.html#L1'>sandbox</a>
<span id="L782" class="LineNr">782 </span> <span class="PreProc">var</span> <a href='sandbox.mu.html#L1'>sandbox</a>/<span class="Constant">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> address sandbox-storage
<span id="L783" class="LineNr">783 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">&quot;'(a . .)&quot;</span>
<span id="L784" class="LineNr">784 </span> <span class="muComment"># eval</span>
<span id="L785" class="LineNr">785 </span> <a href='sandbox.mu.html#L460'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0x13</span>/ctrl-s, <span class="Constant">0</span>/no-globals, <span class="Constant">0</span>/no-disk, <span class="Constant">0</span>/no-screen, <span class="Constant">0</span>/no-tweak-screen
<span id="L786" class="LineNr">786 </span> <span class="muComment"># setup: screen</span>
<span id="L787" class="LineNr">787 </span> <span class="PreProc">var</span> screen-on-stack: <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L788" class="LineNr">788 </span> <span class="PreProc">var</span> <a href='../500fake-screen.mu.html#L14'>screen</a>/<span class="Constant">edi</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> address screen-on-stack
<span id="L789" class="LineNr">789 </span> <a href='../500fake-screen.mu.html#L31'>initialize-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height, <span class="Constant">0</span>/no-pixel-graphics
<span id="L790" class="LineNr">790 </span> <span class="muComment">#</span>
<span id="L791" class="LineNr">791 </span> <a href='sandbox.mu.html#L81'>render-sandbox</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0</span>/x, <span class="Constant">0</span>/y, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height
<span id="L792" class="LineNr">792 </span> <span class="muComment"># skip one line of padding</span>
<span id="L793" class="LineNr">793 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">1</span>/y, <span class="Constant">&quot; '(a . .) &quot;</span>, <span class="Constant">&quot;F - test-run-double-dot/0&quot;</span>
<span id="L794" class="LineNr">794 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">&quot; ... &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L780'>test-run-double-dot</a>/1&quot;</span>
<span id="L795" class="LineNr">795 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">3</span>/y, <span class="Constant">&quot; '. .' makes no sense &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L780'>test-run-double-dot</a>/2&quot;</span>
<span id="L796" class="LineNr">796 </span> <span class="muComment"># further errors may occur</span>
<span id="L797" class="LineNr">797 </span><span class="Delimiter">}</span>
<span id="L798" class="LineNr">798 </span>
<span id="L799" class="LineNr">799 </span><span class="PreProc">fn</span> <span class="muTest"><a href='sandbox.mu.html#L799'>test-run-multiple-expressions-after-dot</a></span> <span class="Delimiter">{</span>
<span id="L800" class="LineNr">800 </span> <span class="PreProc">var</span> sandbox-storage: <a href='sandbox.mu.html#L1'>sandbox</a>
<span id="L801" class="LineNr">801 </span> <span class="PreProc">var</span> <a href='sandbox.mu.html#L1'>sandbox</a>/<span class="Constant">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> address sandbox-storage
<span id="L802" class="LineNr">802 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">&quot;'(a . b c)&quot;</span>
<span id="L803" class="LineNr">803 </span> <span class="muComment"># eval</span>
<span id="L804" class="LineNr">804 </span> <a href='sandbox.mu.html#L460'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0x13</span>/ctrl-s, <span class="Constant">0</span>/no-globals, <span class="Constant">0</span>/no-disk, <span class="Constant">0</span>/no-screen, <span class="Constant">0</span>/no-tweak-screen
<span id="L805" class="LineNr">805 </span> <span class="muComment"># setup: screen</span>
<span id="L806" class="LineNr">806 </span> <span class="PreProc">var</span> screen-on-stack: <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L807" class="LineNr">807 </span> <span class="PreProc">var</span> <a href='../500fake-screen.mu.html#L14'>screen</a>/<span class="Constant">edi</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> address screen-on-stack
<span id="L808" class="LineNr">808 </span> <a href='../500fake-screen.mu.html#L31'>initialize-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height, <span class="Constant">0</span>/no-pixel-graphics
<span id="L809" class="LineNr">809 </span> <span class="muComment">#</span>
<span id="L810" class="LineNr">810 </span> <a href='sandbox.mu.html#L81'>render-sandbox</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0</span>/x, <span class="Constant">0</span>/y, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height
<span id="L811" class="LineNr">811 </span> <span class="muComment"># skip one line of padding</span>
<span id="L812" class="LineNr">812 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">1</span>/y, <span class="Constant">&quot; '(a . b c) &quot;</span>, <span class="Constant">&quot;F - test-run-multiple-expressions-after-dot/0&quot;</span>
<span id="L813" class="LineNr">813 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">&quot; ... &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L799'>test-run-multiple-expressions-after-dot</a>/1&quot;</span>
<span id="L814" class="LineNr">814 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">3</span>/y, <span class="Constant">&quot; cannot have multiple expressions between '.' and ')' &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L799'>test-run-multiple-expressions-after-dot</a>/2&quot;</span>
<span id="L815" class="LineNr">815 </span> <span class="muComment"># further errors may occur</span>
<span id="L816" class="LineNr">816 </span><span class="Delimiter">}</span>
<span id="L817" class="LineNr">817 </span>
<span id="L818" class="LineNr">818 </span><span class="PreProc">fn</span> <span class="muTest"><a href='sandbox.mu.html#L818'>test-run-stream</a></span> <span class="Delimiter">{</span>
<span id="L819" class="LineNr">819 </span> <span class="PreProc">var</span> sandbox-storage: <a href='sandbox.mu.html#L1'>sandbox</a>
<span id="L820" class="LineNr">820 </span> <span class="PreProc">var</span> <a href='sandbox.mu.html#L1'>sandbox</a>/<span class="Constant">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> address sandbox-storage
<span id="L821" class="LineNr">821 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">&quot;[a b]&quot;</span>
<span id="L822" class="LineNr">822 </span> <span class="muComment"># eval</span>
<span id="L823" class="LineNr">823 </span> <a href='sandbox.mu.html#L460'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0x13</span>/ctrl-s, <span class="Constant">0</span>/no-globals, <span class="Constant">0</span>/no-disk, <span class="Constant">0</span>/no-screen, <span class="Constant">0</span>/no-tweak-screen
<span id="L824" class="LineNr">824 </span> <span class="muComment"># setup: screen</span>
<span id="L825" class="LineNr">825 </span> <span class="PreProc">var</span> screen-on-stack: <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L826" class="LineNr">826 </span> <span class="PreProc">var</span> <a href='../500fake-screen.mu.html#L14'>screen</a>/<span class="Constant">edi</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> address screen-on-stack
<span id="L827" class="LineNr">827 </span> <a href='../500fake-screen.mu.html#L31'>initialize-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height, <span class="Constant">0</span>/no-pixel-graphics
<span id="L828" class="LineNr">828 </span> <span class="muComment">#</span>
<span id="L829" class="LineNr">829 </span> <a href='sandbox.mu.html#L81'>render-sandbox</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0</span>/x, <span class="Constant">0</span>/y, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height
<span id="L830" class="LineNr">830 </span> <span class="muComment"># skip one line of padding</span>
<span id="L831" class="LineNr">831 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">1</span>/y, <span class="Constant">&quot; [a b] &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L818'>test-run-stream</a>/0&quot;</span>
<span id="L832" class="LineNr">832 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">&quot; ... &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L818'>test-run-stream</a>/1&quot;</span>
<span id="L833" class="LineNr">833 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">3</span>/y, <span class="Constant">&quot; =&gt; [a b] &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L818'>test-run-stream</a>/2&quot;</span>
<span id="L834" class="LineNr">834 </span><span class="Delimiter">}</span>
<span id="L835" class="LineNr">835 </span>
<span id="L836" class="LineNr">836 </span><span class="PreProc">fn</span> <span class="muTest"><a href='sandbox.mu.html#L836'>test-run-move-cursor-into-trace</a></span> <span class="Delimiter">{</span>
<span id="L837" class="LineNr">837 </span> <span class="PreProc">var</span> sandbox-storage: <a href='sandbox.mu.html#L1'>sandbox</a>
<span id="L838" class="LineNr">838 </span> <span class="PreProc">var</span> <a href='sandbox.mu.html#L1'>sandbox</a>/<span class="Constant">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> address sandbox-storage
<span id="L839" class="LineNr">839 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">&quot;12&quot;</span>
<span id="L840" class="LineNr">840 </span> <span class="muComment"># eval</span>
<span id="L841" class="LineNr">841 </span> <a href='sandbox.mu.html#L460'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0x13</span>/ctrl-s, <span class="Constant">0</span>/no-globals, <span class="Constant">0</span>/no-disk, <span class="Constant">0</span>/no-screen, <span class="Constant">0</span>/no-tweak-screen
<span id="L842" class="LineNr">842 </span> <span class="muComment"># setup: screen</span>
<span id="L843" class="LineNr">843 </span> <span class="PreProc">var</span> screen-on-stack: <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L844" class="LineNr">844 </span> <span class="PreProc">var</span> <a href='../500fake-screen.mu.html#L14'>screen</a>/<span class="Constant">edi</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> address screen-on-stack
<span id="L845" class="LineNr">845 </span> <a href='../500fake-screen.mu.html#L31'>initialize-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height, <span class="Constant">0</span>/no-pixel-graphics
<span id="L846" class="LineNr">846 </span> <span class="muComment">#</span>
<span id="L847" class="LineNr">847 </span> <a href='sandbox.mu.html#L81'>render-sandbox</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0</span>/x, <span class="Constant">0</span>/y, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height
<span id="L848" class="LineNr">848 </span> <span class="muComment"># skip one line of padding</span>
<span id="L849" class="LineNr">849 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">1</span>/y, <span class="Constant">&quot; 12 &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L836'>test-run-move-cursor-into-trace</a>/pre-0&quot;</span>
<span id="L850" class="LineNr">850 </span> <a href='../504test-screen.mu.html#L251'>check-background-color-in-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">7</span>/bg=cursor, <span class="Constant">1</span>/y, <span class="Constant">&quot; | &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L836'>test-run-move-cursor-into-trace</a>/pre-0/cursor&quot;</span>
<span id="L851" class="LineNr">851 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">&quot; ... &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L836'>test-run-move-cursor-into-trace</a>/pre-1&quot;</span>
<span id="L852" class="LineNr">852 </span> <a href='../504test-screen.mu.html#L251'>check-background-color-in-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">7</span>/bg=cursor, <span class="Constant">2</span>/y, <span class="Constant">&quot; &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L836'>test-run-move-cursor-into-trace</a>/pre-1/cursor&quot;</span>
<span id="L853" class="LineNr">853 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">3</span>/y, <span class="Constant">&quot; =&gt; 12 &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L836'>test-run-move-cursor-into-trace</a>/pre-2&quot;</span>
<span id="L854" class="LineNr">854 </span> <a href='../504test-screen.mu.html#L251'>check-background-color-in-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">7</span>/bg=cursor, <span class="Constant">3</span>/y, <span class="Constant">&quot; &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L836'>test-run-move-cursor-into-trace</a>/pre-2/cursor&quot;</span>
<span id="L855" class="LineNr">855 </span> <span class="muComment"># move cursor into trace</span>
<span id="L856" class="LineNr">856 </span> <a href='sandbox.mu.html#L460'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0xd</span>/ctrl-m, <span class="Constant">0</span>/no-globals, <span class="Constant">0</span>/no-disk, <span class="Constant">0</span>/no-screen, <span class="Constant">0</span>/no-tweak-screen
<span id="L857" class="LineNr">857 </span> <span class="muComment">#</span>
<span id="L858" class="LineNr">858 </span> <a href='sandbox.mu.html#L81'>render-sandbox</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0</span>/x, <span class="Constant">0</span>/y, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height
<span id="L859" class="LineNr">859 </span> <span class="muComment"># skip one line of padding</span>
<span id="L860" class="LineNr">860 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">1</span>/y, <span class="Constant">&quot; 12 &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L836'>test-run-move-cursor-into-trace</a>/trace-0&quot;</span>
<span id="L861" class="LineNr">861 </span> <a href='../504test-screen.mu.html#L251'>check-background-color-in-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">7</span>/bg=cursor, <span class="Constant">1</span>/y, <span class="Constant">&quot; &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L836'>test-run-move-cursor-into-trace</a>/trace-0/cursor&quot;</span>
<span id="L862" class="LineNr">862 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">&quot; ... &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L836'>test-run-move-cursor-into-trace</a>/trace-1&quot;</span>
<span id="L863" class="LineNr">863 </span> <a href='../504test-screen.mu.html#L251'>check-background-color-in-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">7</span>/bg=cursor, <span class="Constant">2</span>/y, <span class="Constant">&quot; ||| &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L836'>test-run-move-cursor-into-trace</a>/trace-1/cursor&quot;</span>
<span id="L864" class="LineNr">864 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">3</span>/y, <span class="Constant">&quot; =&gt; 12 &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L836'>test-run-move-cursor-into-trace</a>/trace-2&quot;</span>
<span id="L865" class="LineNr">865 </span> <a href='../504test-screen.mu.html#L251'>check-background-color-in-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">7</span>/bg=cursor, <span class="Constant">3</span>/y, <span class="Constant">&quot; &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L836'>test-run-move-cursor-into-trace</a>/trace-2/cursor&quot;</span>
<span id="L866" class="LineNr">866 </span> <span class="muComment"># move cursor into input</span>
<span id="L867" class="LineNr">867 </span> <a href='sandbox.mu.html#L460'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0xd</span>/ctrl-m, <span class="Constant">0</span>/no-globals, <span class="Constant">0</span>/no-disk, <span class="Constant">0</span>/no-screen, <span class="Constant">0</span>/no-tweak-screen
<span id="L868" class="LineNr">868 </span> <span class="muComment">#</span>
<span id="L869" class="LineNr">869 </span> <a href='sandbox.mu.html#L81'>render-sandbox</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0</span>/x, <span class="Constant">0</span>/y, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height
<span id="L870" class="LineNr">870 </span> <span class="muComment"># skip one line of padding</span>
<span id="L871" class="LineNr">871 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">1</span>/y, <span class="Constant">&quot; 12 &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L836'>test-run-move-cursor-into-trace</a>/input-0&quot;</span>
<span id="L872" class="LineNr">872 </span> <a href='../504test-screen.mu.html#L251'>check-background-color-in-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">7</span>/bg=cursor, <span class="Constant">1</span>/y, <span class="Constant">&quot; | &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L836'>test-run-move-cursor-into-trace</a>/input-0/cursor&quot;</span>
<span id="L873" class="LineNr">873 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">&quot; ... &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L836'>test-run-move-cursor-into-trace</a>/input-1&quot;</span>
<span id="L874" class="LineNr">874 </span> <a href='../504test-screen.mu.html#L251'>check-background-color-in-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">7</span>/bg=cursor, <span class="Constant">2</span>/y, <span class="Constant">&quot; &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L836'>test-run-move-cursor-into-trace</a>/input-1/cursor&quot;</span>
<span id="L875" class="LineNr">875 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">3</span>/y, <span class="Constant">&quot; =&gt; 12 &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L836'>test-run-move-cursor-into-trace</a>/input-2&quot;</span>
<span id="L876" class="LineNr">876 </span> <a href='../504test-screen.mu.html#L251'>check-background-color-in-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">7</span>/bg=cursor, <span class="Constant">3</span>/y, <span class="Constant">&quot; &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L836'>test-run-move-cursor-into-trace</a>/input-2/cursor&quot;</span>
<span id="L877" class="LineNr">877 </span><span class="Delimiter">}</span>
<span id="L878" class="LineNr">878 </span>
<span id="L879" class="LineNr">879 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='sandbox.mu.html#L879'>has-trace?</a></span> _self: (addr <a href='sandbox.mu.html#L1'>sandbox</a>)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean <span class="Delimiter">{</span>
<span id="L880" class="LineNr">880 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> copy _self
<span id="L881" class="LineNr">881 </span> <span class="PreProc">var</span> trace-ah/<span class="Constant">eax</span>: (addr handle trace) <span class="Special">&lt;-</span> get self, trace
<span id="L882" class="LineNr">882 </span> <span class="PreProc">var</span> _trace/<span class="Constant">eax</span>: (addr trace) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *trace-ah
<span id="L883" class="LineNr">883 </span> <span class="PreProc">var</span> trace/<span class="Constant">edx</span>: (addr trace) <span class="Special">&lt;-</span> copy _trace
<span id="L884" class="LineNr">884 </span> compare trace, <span class="Constant">0</span>
<span id="L885" class="LineNr">885 </span> <span class="Delimiter">{</span>
<span id="L886" class="LineNr">886 </span> <span class="PreProc">break-if-!=</span>
<span id="L887" class="LineNr">887 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L888" class="LineNr">888 </span> <span class="Delimiter">}</span>
<span id="L889" class="LineNr">889 </span> <span class="PreProc">var</span> first-free/<span class="Constant">ebx</span>: (addr int) <span class="Special">&lt;-</span> get trace, first-free
<span id="L890" class="LineNr">890 </span> compare *first-free, <span class="Constant">0</span>
<span id="L891" class="LineNr">891 </span> <span class="Delimiter">{</span>
<span id="L892" class="LineNr">892 </span> <span class="PreProc">break-if-&gt;</span>
<span id="L893" class="LineNr">893 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L894" class="LineNr">894 </span> <span class="Delimiter">}</span>
<span id="L895" class="LineNr">895 </span> <span class="PreProc">return</span> <span class="Constant">1</span>/true
<span id="L896" class="LineNr">896 </span><span class="Delimiter">}</span>
<span id="L612" class="LineNr">612 </span> <a href='macroexpand.mu.html#L1'>macroexpand</a> read-result-ah, globals, trace
<span id="L613" class="LineNr">613 </span> <span class="PreProc">var</span> nil-h: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L614" class="LineNr">614 </span> <span class="PreProc">var</span> nil-ah/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address nil-h
<span id="L615" class="LineNr">615 </span> <a href='cell.mu.html#L102'>allocate-pair</a> nil-ah
<span id="L616" class="LineNr">616 </span> <span class="PreProc">var</span> eval-result-h: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L617" class="LineNr">617 </span> <span class="PreProc">var</span> eval-result-ah/<span class="Constant">edi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address eval-result-h
<span id="L618" class="LineNr">618 </span><span class="CommentedCode">#? set-cursor-position 0/screen, 0 0</span>
<span id="L619" class="LineNr">619 </span><span class="CommentedCode">#? turn-on-debug-print</span>
<span id="L620" class="LineNr">620 </span> <a href='../315stack-debug.subx.html#L56'>debug-print</a> <span class="Constant">&quot;^&quot;</span>, <span class="Constant">4</span>/fg, <span class="Constant">0</span>/bg
<span id="L621" class="LineNr">621 </span> <a href='evaluate.mu.html#L5'>evaluate</a> read-result-ah, eval-result-ah, *nil-ah, globals, trace, <a href='../500fake-screen.mu.html#L25'>screen-cell</a>, keyboard-cell, <span class="Constant">1</span>/call-number
<span id="L622" class="LineNr">622 </span> <a href='../315stack-debug.subx.html#L56'>debug-print</a> <span class="Constant">&quot;$&quot;</span>, <span class="Constant">4</span>/fg, <span class="Constant">0</span>/bg
<span id="L623" class="LineNr">623 </span> <span class="PreProc">var</span> error?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='trace.mu.html#L54'>has-errors?</a> trace
<span id="L624" class="LineNr">624 </span> <span class="Delimiter">{</span>
<span id="L625" class="LineNr">625 </span> compare error?, <span class="Constant">0</span>/false
<span id="L626" class="LineNr">626 </span> <span class="PreProc">break-if-=</span>
<span id="L627" class="LineNr">627 </span> <span class="PreProc">return</span>
<span id="L628" class="LineNr">628 </span> <span class="Delimiter">}</span>
<span id="L629" class="LineNr">629 </span> <span class="muComment"># if there was no error and the read-result starts with &quot;set&quot; or &quot;def&quot;, save</span>
<span id="L630" class="LineNr">630 </span> <span class="muComment"># the gap buffer in the modified global, then create a new one for the next</span>
<span id="L631" class="LineNr">631 </span> <span class="muComment"># command.</span>
<span id="L632" class="LineNr">632 </span> <a href='global.mu.html#L1967'>maybe-stash-gap-buffer-to-global</a> globals, read-result-ah, _in-ah
<span id="L633" class="LineNr">633 </span> <a href='../106stream.subx.html#L20'>clear-stream</a> out
<span id="L634" class="LineNr">634 </span> <a href='print.mu.html#L1'>print-cell</a> eval-result-ah, out, trace
<span id="L635" class="LineNr">635 </span> <a href='trace.mu.html#L345'>mark-lines-dirty</a> trace
<span id="L636" class="LineNr">636 </span><span class="Delimiter">}</span>
<span id="L637" class="LineNr">637 </span>
<span id="L638" class="LineNr">638 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='sandbox.mu.html#L638'>read-evaluate-and-move-to-globals</a></span> _in-ah: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>), globals: (addr <a href='global.mu.html#L7'>global-table</a>) <span class="Delimiter">{</span>
<span id="L639" class="LineNr">639 </span> <span class="PreProc">var</span> in-ah/<span class="Constant">eax</span>: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> copy _in-ah
<span id="L640" class="LineNr">640 </span> <span class="PreProc">var</span> in/<span class="Constant">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *in-ah
<span id="L641" class="LineNr">641 </span> <span class="PreProc">var</span> read-result-h: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L642" class="LineNr">642 </span> <span class="PreProc">var</span> read-result-ah/<span class="Constant">esi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address read-result-h
<span id="L643" class="LineNr">643 </span> <a href='read.mu.html#L1'>read-cell</a> in, read-result-ah, <span class="Constant">0</span>/no-trace
<span id="L644" class="LineNr">644 </span> <a href='macroexpand.mu.html#L1'>macroexpand</a> read-result-ah, globals, <span class="Constant">0</span>/no-trace
<span id="L645" class="LineNr">645 </span> <span class="PreProc">var</span> nil-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L646" class="LineNr">646 </span> <span class="PreProc">var</span> nil-ah/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address nil-storage
<span id="L647" class="LineNr">647 </span> <a href='cell.mu.html#L102'>allocate-pair</a> nil-ah
<span id="L648" class="LineNr">648 </span> <span class="PreProc">var</span> eval-result-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L649" class="LineNr">649 </span> <span class="PreProc">var</span> eval-result/<span class="Constant">edi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address eval-result-storage
<span id="L650" class="LineNr">650 </span> <a href='../315stack-debug.subx.html#L56'>debug-print</a> <span class="Constant">&quot;^&quot;</span>, <span class="Constant">4</span>/fg, <span class="Constant">0</span>/bg
<span id="L651" class="LineNr">651 </span> <a href='evaluate.mu.html#L5'>evaluate</a> read-result-ah, eval-result, *nil-ah, globals, <span class="Constant">0</span>/no-trace, <span class="Constant">0</span>/no-screen-cell, <span class="Constant">0</span>/no-keyboard-cell, <span class="Constant">1</span>/call-number
<span id="L652" class="LineNr">652 </span> <a href='../315stack-debug.subx.html#L56'>debug-print</a> <span class="Constant">&quot;$&quot;</span>, <span class="Constant">4</span>/fg, <span class="Constant">0</span>/bg
<span id="L653" class="LineNr">653 </span> <a href='global.mu.html#L2029'>move-gap-buffer-to-global</a> globals, read-result-ah, _in-ah
<span id="L654" class="LineNr">654 </span><span class="Delimiter">}</span>
<span id="L655" class="LineNr">655 </span>
<span id="L656" class="LineNr">656 </span><span class="PreProc">fn</span> <span class="muTest"><a href='sandbox.mu.html#L656'>test-run-integer</a></span> <span class="Delimiter">{</span>
<span id="L657" class="LineNr">657 </span> <span class="PreProc">var</span> sandbox-storage: <a href='sandbox.mu.html#L1'>sandbox</a>
<span id="L658" class="LineNr">658 </span> <span class="PreProc">var</span> <a href='sandbox.mu.html#L1'>sandbox</a>/<span class="Constant">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> address sandbox-storage
<span id="L659" class="LineNr">659 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">&quot;1&quot;</span>
<span id="L660" class="LineNr">660 </span> <span class="muComment"># eval</span>
<span id="L661" class="LineNr">661 </span> <a href='sandbox.mu.html#L460'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0x13</span>/ctrl-s, <span class="Constant">0</span>/no-globals, <span class="Constant">0</span>/no-disk, <span class="Constant">0</span>/no-screen, <span class="Constant">0</span>/no-tweak-screen
<span id="L662" class="LineNr">662 </span> <span class="muComment"># setup: screen</span>
<span id="L663" class="LineNr">663 </span> <span class="PreProc">var</span> screen-on-stack: <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L664" class="LineNr">664 </span> <span class="PreProc">var</span> <a href='../500fake-screen.mu.html#L14'>screen</a>/<span class="Constant">edi</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> address screen-on-stack
<span id="L665" class="LineNr">665 </span> <a href='../500fake-screen.mu.html#L31'>initialize-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height, <span class="Constant">0</span>/no-pixel-graphics
<span id="L666" class="LineNr">666 </span> <span class="muComment">#</span>
<span id="L667" class="LineNr">667 </span> <a href='sandbox.mu.html#L81'>render-sandbox</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0</span>/x, <span class="Constant">0</span>/y, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height
<span id="L668" class="LineNr">668 </span> <span class="muComment"># skip one line of padding</span>
<span id="L669" class="LineNr">669 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">1</span>/y, <span class="Constant">&quot; 1 &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L656'>test-run-integer</a>/0&quot;</span>
<span id="L670" class="LineNr">670 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">&quot; ... &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L656'>test-run-integer</a>/1&quot;</span>
<span id="L671" class="LineNr">671 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">3</span>/y, <span class="Constant">&quot; =&gt; 1 &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L656'>test-run-integer</a>/2&quot;</span>
<span id="L672" class="LineNr">672 </span><span class="Delimiter">}</span>
<span id="L673" class="LineNr">673 </span>
<span id="L674" class="LineNr">674 </span><span class="PreProc">fn</span> <span class="muTest"><a href='sandbox.mu.html#L674'>test-run-error-invalid-integer</a></span> <span class="Delimiter">{</span>
<span id="L675" class="LineNr">675 </span> <span class="PreProc">var</span> sandbox-storage: <a href='sandbox.mu.html#L1'>sandbox</a>
<span id="L676" class="LineNr">676 </span> <span class="PreProc">var</span> <a href='sandbox.mu.html#L1'>sandbox</a>/<span class="Constant">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> address sandbox-storage
<span id="L677" class="LineNr">677 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">&quot;1a&quot;</span>
<span id="L678" class="LineNr">678 </span> <span class="muComment"># eval</span>
<span id="L679" class="LineNr">679 </span> <a href='sandbox.mu.html#L460'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0x13</span>/ctrl-s, <span class="Constant">0</span>/no-globals, <span class="Constant">0</span>/no-disk, <span class="Constant">0</span>/no-screen, <span class="Constant">0</span>/no-tweak-screen
<span id="L680" class="LineNr">680 </span> <span class="muComment"># setup: screen</span>
<span id="L681" class="LineNr">681 </span> <span class="PreProc">var</span> screen-on-stack: <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L682" class="LineNr">682 </span> <span class="PreProc">var</span> <a href='../500fake-screen.mu.html#L14'>screen</a>/<span class="Constant">edi</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> address screen-on-stack
<span id="L683" class="LineNr">683 </span> <a href='../500fake-screen.mu.html#L31'>initialize-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height, <span class="Constant">0</span>/no-pixel-graphics
<span id="L684" class="LineNr">684 </span> <span class="muComment">#</span>
<span id="L685" class="LineNr">685 </span> <a href='sandbox.mu.html#L81'>render-sandbox</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0</span>/x, <span class="Constant">0</span>/y, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height
<span id="L686" class="LineNr">686 </span> <span class="muComment"># skip one line of padding</span>
<span id="L687" class="LineNr">687 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">1</span>/y, <span class="Constant">&quot; 1a &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L674'>test-run-error-invalid-integer</a>/0&quot;</span>
<span id="L688" class="LineNr">688 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">&quot; ... &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L674'>test-run-error-invalid-integer</a>/0&quot;</span>
<span id="L689" class="LineNr">689 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">3</span>/y, <span class="Constant">&quot; invalid number &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L674'>test-run-error-invalid-integer</a>/2&quot;</span>
<span id="L690" class="LineNr">690 </span><span class="Delimiter">}</span>
<span id="L691" class="LineNr">691 </span>
<span id="L692" class="LineNr">692 </span><span class="PreProc">fn</span> <span class="muTest"><a href='sandbox.mu.html#L692'>test-run-with-spaces</a></span> <span class="Delimiter">{</span>
<span id="L693" class="LineNr">693 </span> <span class="PreProc">var</span> sandbox-storage: <a href='sandbox.mu.html#L1'>sandbox</a>
<span id="L694" class="LineNr">694 </span> <span class="PreProc">var</span> <a href='sandbox.mu.html#L1'>sandbox</a>/<span class="Constant">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> address sandbox-storage
<span id="L695" class="LineNr">695 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">&quot; 1 \n&quot;</span>
<span id="L696" class="LineNr">696 </span> <span class="muComment"># eval</span>
<span id="L697" class="LineNr">697 </span> <a href='sandbox.mu.html#L460'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0x13</span>/ctrl-s, <span class="Constant">0</span>/no-globals, <span class="Constant">0</span>/no-disk, <span class="Constant">0</span>/no-screen, <span class="Constant">0</span>/no-tweak-screen
<span id="L698" class="LineNr">698 </span> <span class="muComment"># setup: screen</span>
<span id="L699" class="LineNr">699 </span> <span class="PreProc">var</span> screen-on-stack: <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L700" class="LineNr">700 </span> <span class="PreProc">var</span> <a href='../500fake-screen.mu.html#L14'>screen</a>/<span class="Constant">edi</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> address screen-on-stack
<span id="L701" class="LineNr">701 </span> <a href='../500fake-screen.mu.html#L31'>initialize-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height, <span class="Constant">0</span>/no-pixel-graphics
<span id="L702" class="LineNr">702 </span> <span class="muComment">#</span>
<span id="L703" class="LineNr">703 </span> <a href='sandbox.mu.html#L81'>render-sandbox</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0</span>/x, <span class="Constant">0</span>/y, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height
<span id="L704" class="LineNr">704 </span> <span class="muComment"># skip one line of padding</span>
<span id="L705" class="LineNr">705 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">1</span>/y, <span class="Constant">&quot; 1 &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L692'>test-run-with-spaces</a>/0&quot;</span>
<span id="L706" class="LineNr">706 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">&quot; &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L692'>test-run-with-spaces</a>/1&quot;</span>
<span id="L707" class="LineNr">707 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">3</span>/y, <span class="Constant">&quot; ... &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L692'>test-run-with-spaces</a>/2&quot;</span>
<span id="L708" class="LineNr">708 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">4</span>/y, <span class="Constant">&quot; =&gt; 1 &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L692'>test-run-with-spaces</a>/3&quot;</span>
<span id="L709" class="LineNr">709 </span><span class="Delimiter">}</span>
<span id="L710" class="LineNr">710 </span>
<span id="L711" class="LineNr">711 </span><span class="PreProc">fn</span> <span class="muTest"><a href='sandbox.mu.html#L711'>test-run-quote</a></span> <span class="Delimiter">{</span>
<span id="L712" class="LineNr">712 </span> <span class="PreProc">var</span> sandbox-storage: <a href='sandbox.mu.html#L1'>sandbox</a>
<span id="L713" class="LineNr">713 </span> <span class="PreProc">var</span> <a href='sandbox.mu.html#L1'>sandbox</a>/<span class="Constant">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> address sandbox-storage
<span id="L714" class="LineNr">714 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">&quot;'a&quot;</span>
<span id="L715" class="LineNr">715 </span> <span class="muComment"># eval</span>
<span id="L716" class="LineNr">716 </span> <a href='sandbox.mu.html#L460'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0x13</span>/ctrl-s, <span class="Constant">0</span>/no-globals, <span class="Constant">0</span>/no-disk, <span class="Constant">0</span>/no-screen, <span class="Constant">0</span>/no-tweak-screen
<span id="L717" class="LineNr">717 </span> <span class="muComment"># setup: screen</span>
<span id="L718" class="LineNr">718 </span> <span class="PreProc">var</span> screen-on-stack: <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L719" class="LineNr">719 </span> <span class="PreProc">var</span> <a href='../500fake-screen.mu.html#L14'>screen</a>/<span class="Constant">edi</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> address screen-on-stack
<span id="L720" class="LineNr">720 </span> <a href='../500fake-screen.mu.html#L31'>initialize-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height, <span class="Constant">0</span>/no-pixel-graphics
<span id="L721" class="LineNr">721 </span> <span class="muComment">#</span>
<span id="L722" class="LineNr">722 </span> <a href='sandbox.mu.html#L81'>render-sandbox</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0</span>/x, <span class="Constant">0</span>/y, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height
<span id="L723" class="LineNr">723 </span> <span class="muComment"># skip one line of padding</span>
<span id="L724" class="LineNr">724 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">1</span>/y, <span class="Constant">&quot; 'a &quot;</span>, <span class="Constant">&quot;F - test-run-quote/0&quot;</span>
<span id="L725" class="LineNr">725 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">&quot; ... &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L711'>test-run-quote</a>/1&quot;</span>
<span id="L726" class="LineNr">726 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">3</span>/y, <span class="Constant">&quot; =&gt; a &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L711'>test-run-quote</a>/2&quot;</span>
<span id="L727" class="LineNr">727 </span><span class="Delimiter">}</span>
<span id="L728" class="LineNr">728 </span>
<span id="L729" class="LineNr">729 </span><span class="PreProc">fn</span> <span class="muTest"><a href='sandbox.mu.html#L729'>test-run-dotted-list</a></span> <span class="Delimiter">{</span>
<span id="L730" class="LineNr">730 </span> <span class="PreProc">var</span> sandbox-storage: <a href='sandbox.mu.html#L1'>sandbox</a>
<span id="L731" class="LineNr">731 </span> <span class="PreProc">var</span> <a href='sandbox.mu.html#L1'>sandbox</a>/<span class="Constant">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> address sandbox-storage
<span id="L732" class="LineNr">732 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">&quot;'(a . b)&quot;</span>
<span id="L733" class="LineNr">733 </span> <span class="muComment"># eval</span>
<span id="L734" class="LineNr">734 </span> <a href='sandbox.mu.html#L460'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0x13</span>/ctrl-s, <span class="Constant">0</span>/no-globals, <span class="Constant">0</span>/no-disk, <span class="Constant">0</span>/no-screen, <span class="Constant">0</span>/no-tweak-screen
<span id="L735" class="LineNr">735 </span> <span class="muComment"># setup: screen</span>
<span id="L736" class="LineNr">736 </span> <span class="PreProc">var</span> screen-on-stack: <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L737" class="LineNr">737 </span> <span class="PreProc">var</span> <a href='../500fake-screen.mu.html#L14'>screen</a>/<span class="Constant">edi</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> address screen-on-stack
<span id="L738" class="LineNr">738 </span> <a href='../500fake-screen.mu.html#L31'>initialize-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height, <span class="Constant">0</span>/no-pixel-graphics
<span id="L739" class="LineNr">739 </span> <span class="muComment">#</span>
<span id="L740" class="LineNr">740 </span> <a href='sandbox.mu.html#L81'>render-sandbox</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0</span>/x, <span class="Constant">0</span>/y, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height
<span id="L741" class="LineNr">741 </span> <span class="muComment"># skip one line of padding</span>
<span id="L742" class="LineNr">742 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">1</span>/y, <span class="Constant">&quot; '(a . b) &quot;</span>, <span class="Constant">&quot;F - test-run-dotted-list/0&quot;</span>
<span id="L743" class="LineNr">743 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">&quot; ... &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L729'>test-run-dotted-list</a>/1&quot;</span>
<span id="L744" class="LineNr">744 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">3</span>/y, <span class="Constant">&quot; =&gt; (a . b) &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L729'>test-run-dotted-list</a>/2&quot;</span>
<span id="L745" class="LineNr">745 </span><span class="Delimiter">}</span>
<span id="L746" class="LineNr">746 </span>
<span id="L747" class="LineNr">747 </span><span class="PreProc">fn</span> <span class="muTest"><a href='sandbox.mu.html#L747'>test-run-dot-and-list</a></span> <span class="Delimiter">{</span>
<span id="L748" class="LineNr">748 </span> <span class="PreProc">var</span> sandbox-storage: <a href='sandbox.mu.html#L1'>sandbox</a>
<span id="L749" class="LineNr">749 </span> <span class="PreProc">var</span> <a href='sandbox.mu.html#L1'>sandbox</a>/<span class="Constant">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> address sandbox-storage
<span id="L750" class="LineNr">750 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">&quot;'(a . (b))&quot;</span>
<span id="L751" class="LineNr">751 </span> <span class="muComment"># eval</span>
<span id="L752" class="LineNr">752 </span> <a href='sandbox.mu.html#L460'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0x13</span>/ctrl-s, <span class="Constant">0</span>/no-globals, <span class="Constant">0</span>/no-disk, <span class="Constant">0</span>/no-screen, <span class="Constant">0</span>/no-tweak-screen
<span id="L753" class="LineNr">753 </span> <span class="muComment"># setup: screen</span>
<span id="L754" class="LineNr">754 </span> <span class="PreProc">var</span> screen-on-stack: <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L755" class="LineNr">755 </span> <span class="PreProc">var</span> <a href='../500fake-screen.mu.html#L14'>screen</a>/<span class="Constant">edi</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> address screen-on-stack
<span id="L756" class="LineNr">756 </span> <a href='../500fake-screen.mu.html#L31'>initialize-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height, <span class="Constant">0</span>/no-pixel-graphics
<span id="L757" class="LineNr">757 </span> <span class="muComment">#</span>
<span id="L758" class="LineNr">758 </span> <a href='sandbox.mu.html#L81'>render-sandbox</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0</span>/x, <span class="Constant">0</span>/y, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height
<span id="L759" class="LineNr">759 </span> <span class="muComment"># skip one line of padding</span>
<span id="L760" class="LineNr">760 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">1</span>/y, <span class="Constant">&quot; '(a . (b)) &quot;</span>, <span class="Constant">&quot;F - test-run-dot-and-list/0&quot;</span>
<span id="L761" class="LineNr">761 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">&quot; ... &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L747'>test-run-dot-and-list</a>/1&quot;</span>
<span id="L762" class="LineNr">762 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">3</span>/y, <span class="Constant">&quot; =&gt; (a b) &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L747'>test-run-dot-and-list</a>/2&quot;</span>
<span id="L763" class="LineNr">763 </span><span class="Delimiter">}</span>
<span id="L764" class="LineNr">764 </span>
<span id="L765" class="LineNr">765 </span><span class="PreProc">fn</span> <span class="muTest"><a href='sandbox.mu.html#L765'>test-run-final-dot</a></span> <span class="Delimiter">{</span>
<span id="L766" class="LineNr">766 </span> <span class="PreProc">var</span> sandbox-storage: <a href='sandbox.mu.html#L1'>sandbox</a>
<span id="L767" class="LineNr">767 </span> <span class="PreProc">var</span> <a href='sandbox.mu.html#L1'>sandbox</a>/<span class="Constant">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> address sandbox-storage
<span id="L768" class="LineNr">768 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">&quot;'(a .)&quot;</span>
<span id="L769" class="LineNr">769 </span> <span class="muComment"># eval</span>
<span id="L770" class="LineNr">770 </span> <a href='sandbox.mu.html#L460'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0x13</span>/ctrl-s, <span class="Constant">0</span>/no-globals, <span class="Constant">0</span>/no-disk, <span class="Constant">0</span>/no-screen, <span class="Constant">0</span>/no-tweak-screen
<span id="L771" class="LineNr">771 </span> <span class="muComment"># setup: screen</span>
<span id="L772" class="LineNr">772 </span> <span class="PreProc">var</span> screen-on-stack: <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L773" class="LineNr">773 </span> <span class="PreProc">var</span> <a href='../500fake-screen.mu.html#L14'>screen</a>/<span class="Constant">edi</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> address screen-on-stack
<span id="L774" class="LineNr">774 </span> <a href='../500fake-screen.mu.html#L31'>initialize-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height, <span class="Constant">0</span>/no-pixel-graphics
<span id="L775" class="LineNr">775 </span> <span class="muComment">#</span>
<span id="L776" class="LineNr">776 </span> <a href='sandbox.mu.html#L81'>render-sandbox</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0</span>/x, <span class="Constant">0</span>/y, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height
<span id="L777" class="LineNr">777 </span> <span class="muComment"># skip one line of padding</span>
<span id="L778" class="LineNr">778 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">1</span>/y, <span class="Constant">&quot; '(a .) &quot;</span>, <span class="Constant">&quot;F - test-run-final-dot/0&quot;</span>
<span id="L779" class="LineNr">779 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">&quot; ... &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L765'>test-run-final-dot</a>/1&quot;</span>
<span id="L780" class="LineNr">780 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">3</span>/y, <span class="Constant">&quot; '. )' makes no sense &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L765'>test-run-final-dot</a>/2&quot;</span>
<span id="L781" class="LineNr">781 </span> <span class="muComment"># further errors may occur</span>
<span id="L782" class="LineNr">782 </span><span class="Delimiter">}</span>
<span id="L783" class="LineNr">783 </span>
<span id="L784" class="LineNr">784 </span><span class="PreProc">fn</span> <span class="muTest"><a href='sandbox.mu.html#L784'>test-run-double-dot</a></span> <span class="Delimiter">{</span>
<span id="L785" class="LineNr">785 </span> <span class="PreProc">var</span> sandbox-storage: <a href='sandbox.mu.html#L1'>sandbox</a>
<span id="L786" class="LineNr">786 </span> <span class="PreProc">var</span> <a href='sandbox.mu.html#L1'>sandbox</a>/<span class="Constant">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> address sandbox-storage
<span id="L787" class="LineNr">787 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">&quot;'(a . .)&quot;</span>
<span id="L788" class="LineNr">788 </span> <span class="muComment"># eval</span>
<span id="L789" class="LineNr">789 </span> <a href='sandbox.mu.html#L460'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0x13</span>/ctrl-s, <span class="Constant">0</span>/no-globals, <span class="Constant">0</span>/no-disk, <span class="Constant">0</span>/no-screen, <span class="Constant">0</span>/no-tweak-screen
<span id="L790" class="LineNr">790 </span> <span class="muComment"># setup: screen</span>
<span id="L791" class="LineNr">791 </span> <span class="PreProc">var</span> screen-on-stack: <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L792" class="LineNr">792 </span> <span class="PreProc">var</span> <a href='../500fake-screen.mu.html#L14'>screen</a>/<span class="Constant">edi</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> address screen-on-stack
<span id="L793" class="LineNr">793 </span> <a href='../500fake-screen.mu.html#L31'>initialize-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height, <span class="Constant">0</span>/no-pixel-graphics
<span id="L794" class="LineNr">794 </span> <span class="muComment">#</span>
<span id="L795" class="LineNr">795 </span> <a href='sandbox.mu.html#L81'>render-sandbox</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0</span>/x, <span class="Constant">0</span>/y, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height
<span id="L796" class="LineNr">796 </span> <span class="muComment"># skip one line of padding</span>
<span id="L797" class="LineNr">797 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">1</span>/y, <span class="Constant">&quot; '(a . .) &quot;</span>, <span class="Constant">&quot;F - test-run-double-dot/0&quot;</span>
<span id="L798" class="LineNr">798 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">&quot; ... &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L784'>test-run-double-dot</a>/1&quot;</span>
<span id="L799" class="LineNr">799 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">3</span>/y, <span class="Constant">&quot; '. .' makes no sense &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L784'>test-run-double-dot</a>/2&quot;</span>
<span id="L800" class="LineNr">800 </span> <span class="muComment"># further errors may occur</span>
<span id="L801" class="LineNr">801 </span><span class="Delimiter">}</span>
<span id="L802" class="LineNr">802 </span>
<span id="L803" class="LineNr">803 </span><span class="PreProc">fn</span> <span class="muTest"><a href='sandbox.mu.html#L803'>test-run-multiple-expressions-after-dot</a></span> <span class="Delimiter">{</span>
<span id="L804" class="LineNr">804 </span> <span class="PreProc">var</span> sandbox-storage: <a href='sandbox.mu.html#L1'>sandbox</a>
<span id="L805" class="LineNr">805 </span> <span class="PreProc">var</span> <a href='sandbox.mu.html#L1'>sandbox</a>/<span class="Constant">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> address sandbox-storage
<span id="L806" class="LineNr">806 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">&quot;'(a . b c)&quot;</span>
<span id="L807" class="LineNr">807 </span> <span class="muComment"># eval</span>
<span id="L808" class="LineNr">808 </span> <a href='sandbox.mu.html#L460'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0x13</span>/ctrl-s, <span class="Constant">0</span>/no-globals, <span class="Constant">0</span>/no-disk, <span class="Constant">0</span>/no-screen, <span class="Constant">0</span>/no-tweak-screen
<span id="L809" class="LineNr">809 </span> <span class="muComment"># setup: screen</span>
<span id="L810" class="LineNr">810 </span> <span class="PreProc">var</span> screen-on-stack: <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L811" class="LineNr">811 </span> <span class="PreProc">var</span> <a href='../500fake-screen.mu.html#L14'>screen</a>/<span class="Constant">edi</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> address screen-on-stack
<span id="L812" class="LineNr">812 </span> <a href='../500fake-screen.mu.html#L31'>initialize-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height, <span class="Constant">0</span>/no-pixel-graphics
<span id="L813" class="LineNr">813 </span> <span class="muComment">#</span>
<span id="L814" class="LineNr">814 </span> <a href='sandbox.mu.html#L81'>render-sandbox</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0</span>/x, <span class="Constant">0</span>/y, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height
<span id="L815" class="LineNr">815 </span> <span class="muComment"># skip one line of padding</span>
<span id="L816" class="LineNr">816 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">1</span>/y, <span class="Constant">&quot; '(a . b c) &quot;</span>, <span class="Constant">&quot;F - test-run-multiple-expressions-after-dot/0&quot;</span>
<span id="L817" class="LineNr">817 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">&quot; ... &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L803'>test-run-multiple-expressions-after-dot</a>/1&quot;</span>
<span id="L818" class="LineNr">818 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">3</span>/y, <span class="Constant">&quot; cannot have multiple expressions between '.' and ')' &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L803'>test-run-multiple-expressions-after-dot</a>/2&quot;</span>
<span id="L819" class="LineNr">819 </span> <span class="muComment"># further errors may occur</span>
<span id="L820" class="LineNr">820 </span><span class="Delimiter">}</span>
<span id="L821" class="LineNr">821 </span>
<span id="L822" class="LineNr">822 </span><span class="PreProc">fn</span> <span class="muTest"><a href='sandbox.mu.html#L822'>test-run-stream</a></span> <span class="Delimiter">{</span>
<span id="L823" class="LineNr">823 </span> <span class="PreProc">var</span> sandbox-storage: <a href='sandbox.mu.html#L1'>sandbox</a>
<span id="L824" class="LineNr">824 </span> <span class="PreProc">var</span> <a href='sandbox.mu.html#L1'>sandbox</a>/<span class="Constant">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> address sandbox-storage
<span id="L825" class="LineNr">825 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">&quot;[a b]&quot;</span>
<span id="L826" class="LineNr">826 </span> <span class="muComment"># eval</span>
<span id="L827" class="LineNr">827 </span> <a href='sandbox.mu.html#L460'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0x13</span>/ctrl-s, <span class="Constant">0</span>/no-globals, <span class="Constant">0</span>/no-disk, <span class="Constant">0</span>/no-screen, <span class="Constant">0</span>/no-tweak-screen
<span id="L828" class="LineNr">828 </span> <span class="muComment"># setup: screen</span>
<span id="L829" class="LineNr">829 </span> <span class="PreProc">var</span> screen-on-stack: <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L830" class="LineNr">830 </span> <span class="PreProc">var</span> <a href='../500fake-screen.mu.html#L14'>screen</a>/<span class="Constant">edi</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> address screen-on-stack
<span id="L831" class="LineNr">831 </span> <a href='../500fake-screen.mu.html#L31'>initialize-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height, <span class="Constant">0</span>/no-pixel-graphics
<span id="L832" class="LineNr">832 </span> <span class="muComment">#</span>
<span id="L833" class="LineNr">833 </span> <a href='sandbox.mu.html#L81'>render-sandbox</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0</span>/x, <span class="Constant">0</span>/y, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height
<span id="L834" class="LineNr">834 </span> <span class="muComment"># skip one line of padding</span>
<span id="L835" class="LineNr">835 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">1</span>/y, <span class="Constant">&quot; [a b] &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L822'>test-run-stream</a>/0&quot;</span>
<span id="L836" class="LineNr">836 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">&quot; ... &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L822'>test-run-stream</a>/1&quot;</span>
<span id="L837" class="LineNr">837 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">3</span>/y, <span class="Constant">&quot; =&gt; [a b] &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L822'>test-run-stream</a>/2&quot;</span>
<span id="L838" class="LineNr">838 </span><span class="Delimiter">}</span>
<span id="L839" class="LineNr">839 </span>
<span id="L840" class="LineNr">840 </span><span class="PreProc">fn</span> <span class="muTest"><a href='sandbox.mu.html#L840'>test-run-move-cursor-into-trace</a></span> <span class="Delimiter">{</span>
<span id="L841" class="LineNr">841 </span> <span class="PreProc">var</span> sandbox-storage: <a href='sandbox.mu.html#L1'>sandbox</a>
<span id="L842" class="LineNr">842 </span> <span class="PreProc">var</span> <a href='sandbox.mu.html#L1'>sandbox</a>/<span class="Constant">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> address sandbox-storage
<span id="L843" class="LineNr">843 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">&quot;12&quot;</span>
<span id="L844" class="LineNr">844 </span> <span class="muComment"># eval</span>
<span id="L845" class="LineNr">845 </span> <a href='sandbox.mu.html#L460'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0x13</span>/ctrl-s, <span class="Constant">0</span>/no-globals, <span class="Constant">0</span>/no-disk, <span class="Constant">0</span>/no-screen, <span class="Constant">0</span>/no-tweak-screen
<span id="L846" class="LineNr">846 </span> <span class="muComment"># setup: screen</span>
<span id="L847" class="LineNr">847 </span> <span class="PreProc">var</span> screen-on-stack: <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L848" class="LineNr">848 </span> <span class="PreProc">var</span> <a href='../500fake-screen.mu.html#L14'>screen</a>/<span class="Constant">edi</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> address screen-on-stack
<span id="L849" class="LineNr">849 </span> <a href='../500fake-screen.mu.html#L31'>initialize-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height, <span class="Constant">0</span>/no-pixel-graphics
<span id="L850" class="LineNr">850 </span> <span class="muComment">#</span>
<span id="L851" class="LineNr">851 </span> <a href='sandbox.mu.html#L81'>render-sandbox</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0</span>/x, <span class="Constant">0</span>/y, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height
<span id="L852" class="LineNr">852 </span> <span class="muComment"># skip one line of padding</span>
<span id="L853" class="LineNr">853 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">1</span>/y, <span class="Constant">&quot; 12 &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L840'>test-run-move-cursor-into-trace</a>/pre-0&quot;</span>
<span id="L854" class="LineNr">854 </span> <a href='../504test-screen.mu.html#L251'>check-background-color-in-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">7</span>/bg=cursor, <span class="Constant">1</span>/y, <span class="Constant">&quot; | &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L840'>test-run-move-cursor-into-trace</a>/pre-0/cursor&quot;</span>
<span id="L855" class="LineNr">855 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">&quot; ... &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L840'>test-run-move-cursor-into-trace</a>/pre-1&quot;</span>
<span id="L856" class="LineNr">856 </span> <a href='../504test-screen.mu.html#L251'>check-background-color-in-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">7</span>/bg=cursor, <span class="Constant">2</span>/y, <span class="Constant">&quot; &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L840'>test-run-move-cursor-into-trace</a>/pre-1/cursor&quot;</span>
<span id="L857" class="LineNr">857 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">3</span>/y, <span class="Constant">&quot; =&gt; 12 &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L840'>test-run-move-cursor-into-trace</a>/pre-2&quot;</span>
<span id="L858" class="LineNr">858 </span> <a href='../504test-screen.mu.html#L251'>check-background-color-in-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">7</span>/bg=cursor, <span class="Constant">3</span>/y, <span class="Constant">&quot; &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L840'>test-run-move-cursor-into-trace</a>/pre-2/cursor&quot;</span>
<span id="L859" class="LineNr">859 </span> <span class="muComment"># move cursor into trace</span>
<span id="L860" class="LineNr">860 </span> <a href='sandbox.mu.html#L460'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0xd</span>/ctrl-m, <span class="Constant">0</span>/no-globals, <span class="Constant">0</span>/no-disk, <span class="Constant">0</span>/no-screen, <span class="Constant">0</span>/no-tweak-screen
<span id="L861" class="LineNr">861 </span> <span class="muComment">#</span>
<span id="L862" class="LineNr">862 </span> <a href='sandbox.mu.html#L81'>render-sandbox</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0</span>/x, <span class="Constant">0</span>/y, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height
<span id="L863" class="LineNr">863 </span> <span class="muComment"># skip one line of padding</span>
<span id="L864" class="LineNr">864 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">1</span>/y, <span class="Constant">&quot; 12 &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L840'>test-run-move-cursor-into-trace</a>/trace-0&quot;</span>
<span id="L865" class="LineNr">865 </span> <a href='../504test-screen.mu.html#L251'>check-background-color-in-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">7</span>/bg=cursor, <span class="Constant">1</span>/y, <span class="Constant">&quot; &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L840'>test-run-move-cursor-into-trace</a>/trace-0/cursor&quot;</span>
<span id="L866" class="LineNr">866 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">&quot; ... &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L840'>test-run-move-cursor-into-trace</a>/trace-1&quot;</span>
<span id="L867" class="LineNr">867 </span> <a href='../504test-screen.mu.html#L251'>check-background-color-in-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">7</span>/bg=cursor, <span class="Constant">2</span>/y, <span class="Constant">&quot; ||| &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L840'>test-run-move-cursor-into-trace</a>/trace-1/cursor&quot;</span>
<span id="L868" class="LineNr">868 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">3</span>/y, <span class="Constant">&quot; =&gt; 12 &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L840'>test-run-move-cursor-into-trace</a>/trace-2&quot;</span>
<span id="L869" class="LineNr">869 </span> <a href='../504test-screen.mu.html#L251'>check-background-color-in-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">7</span>/bg=cursor, <span class="Constant">3</span>/y, <span class="Constant">&quot; &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L840'>test-run-move-cursor-into-trace</a>/trace-2/cursor&quot;</span>
<span id="L870" class="LineNr">870 </span> <span class="muComment"># move cursor into input</span>
<span id="L871" class="LineNr">871 </span> <a href='sandbox.mu.html#L460'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0xd</span>/ctrl-m, <span class="Constant">0</span>/no-globals, <span class="Constant">0</span>/no-disk, <span class="Constant">0</span>/no-screen, <span class="Constant">0</span>/no-tweak-screen
<span id="L872" class="LineNr">872 </span> <span class="muComment">#</span>
<span id="L873" class="LineNr">873 </span> <a href='sandbox.mu.html#L81'>render-sandbox</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0</span>/x, <span class="Constant">0</span>/y, <span class="Constant">0x80</span>/width, <span class="Constant">0x10</span>/height
<span id="L874" class="LineNr">874 </span> <span class="muComment"># skip one line of padding</span>
<span id="L875" class="LineNr">875 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">1</span>/y, <span class="Constant">&quot; 12 &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L840'>test-run-move-cursor-into-trace</a>/input-0&quot;</span>
<span id="L876" class="LineNr">876 </span> <a href='../504test-screen.mu.html#L251'>check-background-color-in-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">7</span>/bg=cursor, <span class="Constant">1</span>/y, <span class="Constant">&quot; | &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L840'>test-run-move-cursor-into-trace</a>/input-0/cursor&quot;</span>
<span id="L877" class="LineNr">877 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">&quot; ... &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L840'>test-run-move-cursor-into-trace</a>/input-1&quot;</span>
<span id="L878" class="LineNr">878 </span> <a href='../504test-screen.mu.html#L251'>check-background-color-in-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">7</span>/bg=cursor, <span class="Constant">2</span>/y, <span class="Constant">&quot; &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L840'>test-run-move-cursor-into-trace</a>/input-1/cursor&quot;</span>
<span id="L879" class="LineNr">879 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">3</span>/y, <span class="Constant">&quot; =&gt; 12 &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L840'>test-run-move-cursor-into-trace</a>/input-2&quot;</span>
<span id="L880" class="LineNr">880 </span> <a href='../504test-screen.mu.html#L251'>check-background-color-in-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">7</span>/bg=cursor, <span class="Constant">3</span>/y, <span class="Constant">&quot; &quot;</span>, <span class="Constant">&quot;F - <a href='sandbox.mu.html#L840'>test-run-move-cursor-into-trace</a>/input-2/cursor&quot;</span>
<span id="L881" class="LineNr">881 </span><span class="Delimiter">}</span>
<span id="L882" class="LineNr">882 </span>
<span id="L883" class="LineNr">883 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='sandbox.mu.html#L883'>has-trace?</a></span> _self: (addr <a href='sandbox.mu.html#L1'>sandbox</a>)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean <span class="Delimiter">{</span>
<span id="L884" class="LineNr">884 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special">&lt;-</span> copy _self
<span id="L885" class="LineNr">885 </span> <span class="PreProc">var</span> trace-ah/<span class="Constant">eax</span>: (addr handle trace) <span class="Special">&lt;-</span> get self, trace
<span id="L886" class="LineNr">886 </span> <span class="PreProc">var</span> _trace/<span class="Constant">eax</span>: (addr trace) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *trace-ah
<span id="L887" class="LineNr">887 </span> <span class="PreProc">var</span> trace/<span class="Constant">edx</span>: (addr trace) <span class="Special">&lt;-</span> copy _trace
<span id="L888" class="LineNr">888 </span> compare trace, <span class="Constant">0</span>
<span id="L889" class="LineNr">889 </span> <span class="Delimiter">{</span>
<span id="L890" class="LineNr">890 </span> <span class="PreProc">break-if-!=</span>
<span id="L891" class="LineNr">891 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L892" class="LineNr">892 </span> <span class="Delimiter">}</span>
<span id="L893" class="LineNr">893 </span> <span class="PreProc">var</span> first-free/<span class="Constant">ebx</span>: (addr int) <span class="Special">&lt;-</span> get trace, first-free
<span id="L894" class="LineNr">894 </span> compare *first-free, <span class="Constant">0</span>
<span id="L895" class="LineNr">895 </span> <span class="Delimiter">{</span>
<span id="L896" class="LineNr">896 </span> <span class="PreProc">break-if-&gt;</span>
<span id="L897" class="LineNr">897 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L898" class="LineNr">898 </span> <span class="Delimiter">}</span>
<span id="L899" class="LineNr">899 </span> <span class="PreProc">return</span> <span class="Constant">1</span>/true
<span id="L900" class="LineNr">900 </span><span class="Delimiter">}</span>
</pre>
</body>
</html>

File diff suppressed because it is too large Load Diff

2619
html/shell/trace.mu.html generated

File diff suppressed because it is too large Load Diff