This commit is contained in:
Kartik Agaram 2021-05-31 10:47:05 -07:00
parent e3c7445330
commit 82171a0fdf
45 changed files with 9504 additions and 8126 deletions

View File

@ -85,7 +85,7 @@ if ('onhashchange' in window) {
<span id="L28" class="LineNr">28 </span> c1/shift 4/subop/left %eax 0xa/imm8
<span id="L29" class="LineNr">29 </span> 03/add-&gt; *(ebp+8) 0/r32/eax
<span id="L30" class="LineNr">30 </span> <span class="subxComment"># eax += location of frame buffer</span>
<span id="L31" class="LineNr">31 </span> 03/add-&gt; *<span class="SpecialChar"><a href='boot.subx.html#L622'>Video-memory-addr</a></span> 0/r32/eax
<span id="L31" class="LineNr">31 </span> 03/add-&gt; *<span class="SpecialChar"><a href='boot.subx.html#L636'>Video-memory-addr</a></span> 0/r32/eax
<span id="L32" class="LineNr">32 </span> <span class="subxComment"># *eax = color</span>
<span id="L33" class="LineNr">33 </span> 8b/-&gt; *(ebp+0x10) 1/r32/ecx
<span id="L34" class="LineNr">34 </span> 88/byte&lt;- *eax 1/r32/CL

View File

@ -84,7 +84,7 @@ if ('onhashchange' in window) {
<span id="L27" class="LineNr"> 27 </span> <span class="subxComment"># var letter-bitmap/esi = font[g]</span>
<span id="L28" class="LineNr"> 28 </span> 8b/-&gt; *(ebp+8) 6/r32/esi
<span id="L29" class="LineNr"> 29 </span> c1 4/subop/shift-left %esi 4/imm8
<span id="L30" class="LineNr"> 30 </span> 81 0/subop/add %esi <span class="SpecialChar"><a href='boot.subx.html#L643'>Font</a></span>/imm32
<span id="L30" class="LineNr"> 30 </span> 81 0/subop/add %esi <span class="SpecialChar"><a href='boot.subx.html#L657'>Font</a></span>/imm32
<span id="L31" class="LineNr"> 31 </span> <span class="subxComment"># if (letter-bitmap &gt;= 0x9400) return # characters beyond ASCII currently not supported</span>
<span id="L32" class="LineNr"> 32 </span> 81 7/subop/compare %esi 0x9400/imm32
<span id="L33" class="LineNr"> 33 </span> 7d/jump-if-&gt;= $draw-grapheme-on-real-screen:end/disp8

266
html/108write.subx.html generated
View File

@ -96,7 +96,7 @@ if ('onhashchange' in window) {
<span id="L36" class="LineNr"> 36 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 1/base/ecx 2/index/edx <span class="Normal"> . </span> 3/r32/ebx 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy ecx+edx+12 to ebx</span>
<span id="L37" class="LineNr"> 37 </span> 53/push-ebx
<span id="L38" class="LineNr"> 38 </span> <span class="subxS2Comment"># . . call</span>
<span id="L39" class="LineNr"> 39 </span> e8/call <a href='108write.subx.html#L139'>_append-3</a>/disp32
<span id="L39" class="LineNr"> 39 </span> e8/call <a href='108write.subx.html#L212'>_append-3</a>/disp32
<span id="L40" class="LineNr"> 40 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L41" class="LineNr"> 41 </span> 81 0/subop/add 3/mod/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="L42" class="LineNr"> 42 </span> <span class="subxComment"># f-&gt;write += eax</span>
@ -195,95 +195,181 @@ if ('onhashchange' in window) {
<span id="L135" class="LineNr">135 </span>
<span id="L136" class="LineNr">136 </span>== code
<span id="L137" class="LineNr">137 </span>
<span id="L138" class="LineNr">138 </span><span class="subxComment"># 3-argument variant of _append</span>
<span id="L139" class="LineNr">139 </span><span class="subxMinorFunction">_append-3</span>: <span class="subxComment"># out: (addr byte), outend: (addr byte), s: (addr array byte) -&gt; num_bytes_appended/eax</span>
<span id="L140" class="LineNr">140 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L141" class="LineNr">141 </span> 55/push-ebp
<span id="L142" class="LineNr">142 </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="L143" class="LineNr">143 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L144" class="LineNr">144 </span> 51/push-ecx
<span id="L145" class="LineNr">145 </span> <span class="subxComment"># eax = _append-4(out, outend, &amp;s-&gt;data[0], &amp;s-&gt;data[s-&gt;size])</span>
<span id="L146" class="LineNr">146 </span> <span class="subxS2Comment"># . . push &amp;s-&gt;data[s-&gt;size]</span>
<span id="L147" class="LineNr">147 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <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="L148" class="LineNr">148 </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="L149" class="LineNr">149 </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="L150" class="LineNr">150 </span> 51/push-ecx
<span id="L151" class="LineNr">151 </span> <span class="subxS2Comment"># . . push &amp;s-&gt;data[0]</span>
<span id="L152" class="LineNr">152 </span> 8d/copy-address 1/mod/*+disp8 0/rm32/eax <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 eax+4 to ecx</span>
<span id="L153" class="LineNr">153 </span> 51/push-ecx
<span id="L154" class="LineNr">154 </span> <span class="subxS2Comment"># . . push outend</span>
<span id="L155" class="LineNr">155 </span> ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(ebp+12)</span>
<span id="L156" class="LineNr">156 </span> <span class="subxS2Comment"># . . push out</span>
<span id="L157" class="LineNr">157 </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="L158" class="LineNr">158 </span> <span class="subxS2Comment"># . . call</span>
<span id="L159" class="LineNr">159 </span> e8/call <a href='108write.subx.html#L171'>_append-4</a>/disp32
<span id="L160" class="LineNr">160 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L161" class="LineNr">161 </span> 81 0/subop/add 3/mod/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="L162" class="LineNr">162 </span><span class="Constant">$_append-3:end</span>:
<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> <span class="subxS1Comment"># . epilogue</span>
<span id="L166" class="LineNr">166 </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="L167" class="LineNr">167 </span> 5d/pop-to-ebp
<span id="L168" class="LineNr">168 </span> c3/return
<span id="L169" class="LineNr">169 </span>
<span id="L170" class="LineNr">170 </span><span class="subxComment"># 4-argument variant of _append</span>
<span id="L171" class="LineNr">171 </span><span class="subxMinorFunction">_append-4</span>: <span class="subxComment"># out: (addr byte), outend: (addr byte), in: (addr byte), inend: (addr byte) -&gt; num_bytes_appended/eax: int</span>
<span id="L172" class="LineNr">172 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L173" class="LineNr">173 </span> 55/push-ebp
<span id="L174" class="LineNr">174 </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="L175" class="LineNr">175 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L176" class="LineNr">176 </span> 51/push-ecx
<span id="L177" class="LineNr">177 </span> 52/push-edx
<span id="L178" class="LineNr">178 </span> 53/push-ebx
<span id="L179" class="LineNr">179 </span> 56/push-esi
<span id="L180" class="LineNr">180 </span> 57/push-edi
<span id="L181" class="LineNr">181 </span> <span class="subxComment"># num_bytes_appended = 0</span>
<span id="L182" class="LineNr">182 </span> b8/copy-to-eax 0/imm32
<span id="L183" class="LineNr">183 </span> <span class="subxComment"># edi = out</span>
<span id="L184" class="LineNr">184 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 7/r32/edi 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to edi</span>
<span id="L185" class="LineNr">185 </span> <span class="subxComment"># edx = outend</span>
<span id="L186" class="LineNr">186 </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="L187" class="LineNr">187 </span> <span class="subxComment"># esi = in</span>
<span id="L188" class="LineNr">188 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 0x10/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+16) to esi</span>
<span id="L189" class="LineNr">189 </span> <span class="subxComment"># ecx = inend</span>
<span id="L190" class="LineNr">190 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 0x14/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+20) to ecx</span>
<span id="L191" class="LineNr">191 </span><span class="Constant">$_append-4:loop</span>:
<span id="L192" class="LineNr">192 </span> <span class="subxComment"># if (in &gt;= inend) break</span>
<span id="L193" class="LineNr">193 </span> 39/compare 3/mod/direct 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 esi with ecx</span>
<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> 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>
<span id="L201" class="LineNr">201 </span> <span class="subxComment"># ++num_bytes_appended</span>
<span id="L202" class="LineNr">202 </span> 40/increment-eax
<span id="L203" class="LineNr">203 </span> <span class="subxComment"># ++in</span>
<span id="L204" class="LineNr">204 </span> 46/increment-esi
<span id="L205" class="LineNr">205 </span> <span class="subxComment"># ++out</span>
<span id="L206" class="LineNr">206 </span> 47/increment-edi
<span id="L207" class="LineNr">207 </span> eb/jump $_append-4:<span class="Constant">loop</span>/disp8
<span id="L208" class="LineNr">208 </span><span class="Constant">$_append-4:end</span>:
<span id="L209" class="LineNr">209 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L210" class="LineNr">210 </span> 5f/pop-to-edi
<span id="L211" class="LineNr">211 </span> 5e/pop-to-esi
<span id="L212" class="LineNr">212 </span> 5b/pop-to-ebx
<span id="L213" class="LineNr">213 </span> 5a/pop-to-edx
<span id="L214" class="LineNr">214 </span> 59/pop-to-ecx
<span id="L215" class="LineNr">215 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L216" class="LineNr">216 </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="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="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>
<span id="L138" class="LineNr">138 </span><span class="subxFunction">try-write</span>: <span class="subxComment"># f: (addr stream byte), s: (addr array byte) -&gt; overflow?/eax: boolean</span>
<span id="L139" class="LineNr">139 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L140" class="LineNr">140 </span> 55/push-ebp
<span id="L141" class="LineNr">141 </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="L142" class="LineNr">142 </span> <span class="subxComment"># if (s == 0) return</span>
<span id="L143" class="LineNr">143 </span> 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/disp8 0/imm32 <span class="subxComment"># compare *(ebp+12)</span>
<span id="L144" class="LineNr">144 </span> 74/jump-if-= $write:end/disp8
<span id="L145" class="LineNr">145 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L146" class="LineNr">146 </span> 51/push-ecx
<span id="L147" class="LineNr">147 </span> <span class="subxComment"># if (f-&gt;size - f-&gt;write &lt; s-&gt;size) return</span>
<span id="L148" class="LineNr">148 </span> <span class="subxS1Comment"># . eax = f-&gt;size - f-&gt;write - s-&gt;size</span>
<span id="L149" class="LineNr">149 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to ecx</span>
<span id="L150" class="LineNr">150 </span> 8b/copy 1/mod/*+disp8 1/rm32/ecx <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 *(ecx+8) to eax</span>
<span id="L151" class="LineNr">151 </span> 2b/subtract 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"># subtract *ecx from eax</span>
<span id="L152" class="LineNr">152 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+12) to ecx</span>
<span id="L153" class="LineNr">153 </span> 2b/subtract 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"># subtract *ecx from eax</span>
<span id="L154" class="LineNr">154 </span> <span class="subxS1Comment"># . if (eax &lt; 0) return</span>
<span id="L155" class="LineNr">155 </span> 3d/compare-eax-and 0/imm32
<span id="L156" class="LineNr">156 </span> 7c/jump-if-&lt; $try-write:end/disp8
<span id="L157" class="LineNr">157 </span> <span class="subxComment"># write(f, s)</span>
<span id="L158" class="LineNr">158 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L159" class="LineNr">159 </span> ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(ebp+12)</span>
<span id="L160" class="LineNr">160 </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="L161" class="LineNr">161 </span> <span class="subxS2Comment"># . . call</span>
<span id="L162" class="LineNr">162 </span> e8/call <a href='108write.subx.html#L11'>write</a>/disp32
<span id="L163" class="LineNr">163 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L164" class="LineNr">164 </span> 81 0/subop/add 3/mod/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="L165" class="LineNr">165 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L166" class="LineNr">166 </span> 59/pop-to-ecx
<span id="L167" class="LineNr">167 </span> <span class="subxComment"># return 0</span>
<span id="L168" class="LineNr">168 </span> b8/copy-to-eax 0/imm32
<span id="L169" class="LineNr">169 </span><span class="Constant">$try-write:end</span>:
<span id="L170" class="LineNr">170 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L171" class="LineNr">171 </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="L172" class="LineNr">172 </span> 5d/pop-to-ebp
<span id="L173" class="LineNr">173 </span> c3/return
<span id="L174" class="LineNr">174 </span>
<span id="L175" class="LineNr">175 </span><span class="subxComment"># probably a bad idea</span>
<span id="L176" class="LineNr">176 </span><span class="subxFunction">space-remaining-in-stream</span>: <span class="subxComment"># f: (addr stream byte) -&gt; n/eax: int</span>
<span id="L177" class="LineNr">177 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L178" class="LineNr">178 </span> 55/push-ebp
<span id="L179" class="LineNr">179 </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="L180" class="LineNr">180 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L181" class="LineNr">181 </span> 51/push-ecx
<span id="L182" class="LineNr">182 </span> <span class="subxComment"># return f-&gt;size - f-&gt;write</span>
<span id="L183" class="LineNr">183 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to ecx</span>
<span id="L184" class="LineNr">184 </span> 8b/copy 1/mod/*+disp8 1/rm32/ecx <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 *(ecx+8) to eax</span>
<span id="L185" class="LineNr">185 </span> 2b/subtract 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"># subtract *ecx from eax</span>
<span id="L186" class="LineNr">186 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L187" class="LineNr">187 </span> 59/pop-to-ecx
<span id="L188" class="LineNr">188 </span><span class="Constant">$space-remaining-in-stream:end</span>:
<span id="L189" class="LineNr">189 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L190" class="LineNr">190 </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="L191" class="LineNr">191 </span> 5d/pop-to-ebp
<span id="L192" class="LineNr">192 </span> c3/return
<span id="L193" class="LineNr">193 </span>
<span id="L194" class="LineNr">194 </span><span class="subxFunction">stream-size</span>: <span class="subxComment"># f: (addr stream byte) -&gt; n/eax: int</span>
<span id="L195" class="LineNr">195 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L196" class="LineNr">196 </span> 55/push-ebp
<span id="L197" class="LineNr">197 </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="L198" class="LineNr">198 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L199" class="LineNr">199 </span> 51/push-ecx
<span id="L200" class="LineNr">200 </span> <span class="subxComment"># return f-&gt;write</span>
<span id="L201" class="LineNr">201 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to ecx</span>
<span id="L202" class="LineNr">202 </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="L203" class="LineNr">203 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L204" class="LineNr">204 </span> 59/pop-to-ecx
<span id="L205" class="LineNr">205 </span><span class="Constant">$space-remaining-in-stream:end</span>:
<span id="L206" class="LineNr">206 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L207" class="LineNr">207 </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="L208" class="LineNr">208 </span> 5d/pop-to-ebp
<span id="L209" class="LineNr">209 </span> c3/return
<span id="L210" class="LineNr">210 </span>
<span id="L211" class="LineNr">211 </span><span class="subxComment"># 3-argument variant of _append</span>
<span id="L212" class="LineNr">212 </span><span class="subxMinorFunction">_append-3</span>: <span class="subxComment"># out: (addr byte), outend: (addr byte), s: (addr array byte) -&gt; num_bytes_appended/eax</span>
<span id="L213" class="LineNr">213 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L214" class="LineNr">214 </span> 55/push-ebp
<span id="L215" class="LineNr">215 </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="L216" class="LineNr">216 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L217" class="LineNr">217 </span> 51/push-ecx
<span id="L218" class="LineNr">218 </span> <span class="subxComment"># if (outend - out &lt; s-&gt;size) abort</span>
<span id="L219" class="LineNr">219 </span> <span class="subxS1Comment"># . eax = f-&gt;size - f-&gt;write - s-&gt;size</span>
<span id="L220" class="LineNr">220 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+12) to eax</span>
<span id="L221" class="LineNr">221 </span> 2b/subtract 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"># subtract *(ebp+8) from eax</span>
<span id="L222" class="LineNr">222 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 0x10/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+16) to ecx</span>
<span id="L223" class="LineNr">223 </span> 2b/subtract 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"># subtract *ecx from eax</span>
<span id="L224" class="LineNr">224 </span> <span class="subxS1Comment"># . if (eax &lt; 0) abort</span>
<span id="L225" class="LineNr">225 </span> 3d/compare-eax-and 0/imm32
<span id="L226" class="LineNr">226 </span> 7c/jump-if-&lt; $_append-3:<a href='317abort.subx.html#L5'>abort</a>/disp8
<span id="L227" class="LineNr">227 </span> <span class="subxComment"># eax = _append-4(out, outend, &amp;s-&gt;data[0], &amp;s-&gt;data[s-&gt;size])</span>
<span id="L228" class="LineNr">228 </span> <span class="subxS2Comment"># . . push &amp;s-&gt;data[s-&gt;size]</span>
<span id="L229" class="LineNr">229 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <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="L230" class="LineNr">230 </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="L231" class="LineNr">231 </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="L232" class="LineNr">232 </span> 51/push-ecx
<span id="L233" class="LineNr">233 </span> <span class="subxS2Comment"># . . push &amp;s-&gt;data[0]</span>
<span id="L234" class="LineNr">234 </span> 8d/copy-address 1/mod/*+disp8 0/rm32/eax <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 eax+4 to ecx</span>
<span id="L235" class="LineNr">235 </span> 51/push-ecx
<span id="L236" class="LineNr">236 </span> <span class="subxS2Comment"># . . push outend</span>
<span id="L237" class="LineNr">237 </span> ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(ebp+12)</span>
<span id="L238" class="LineNr">238 </span> <span class="subxS2Comment"># . . push out</span>
<span id="L239" class="LineNr">239 </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="L240" class="LineNr">240 </span> <span class="subxS2Comment"># . . call</span>
<span id="L241" class="LineNr">241 </span> e8/call <a href='108write.subx.html#L257'>_append-4</a>/disp32
<span id="L242" class="LineNr">242 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L243" class="LineNr">243 </span> 81 0/subop/add 3/mod/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="L244" class="LineNr">244 </span><span class="Constant">$_append-3:end</span>:
<span id="L245" class="LineNr">245 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L246" class="LineNr">246 </span> 59/pop-to-ecx
<span id="L247" class="LineNr">247 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L248" class="LineNr">248 </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="L249" class="LineNr">249 </span> 5d/pop-to-ebp
<span id="L250" class="LineNr">250 </span> c3/return
<span id="L251" class="LineNr">251 </span>
<span id="L252" class="LineNr">252 </span><span class="Constant">$_append-3:<a href='317abort.subx.html#L5'>abort</a></span>:
<span id="L253" class="LineNr">253 </span> (<a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;_append-3 about to overflow&quot;</span>) <span class="subxComment"># 3=cyan</span>
<span id="L254" class="LineNr">254 </span> <span class="subxComment"># never gets here</span>
<span id="L255" class="LineNr">255 </span>
<span id="L256" class="LineNr">256 </span><span class="subxComment"># 4-argument variant of _append</span>
<span id="L257" class="LineNr">257 </span><span class="subxMinorFunction">_append-4</span>: <span class="subxComment"># out: (addr byte), outend: (addr byte), in: (addr byte), inend: (addr byte) -&gt; num_bytes_appended/eax: int</span>
<span id="L258" class="LineNr">258 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L259" class="LineNr">259 </span> 55/push-ebp
<span id="L260" class="LineNr">260 </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="L261" class="LineNr">261 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L262" class="LineNr">262 </span> 51/push-ecx
<span id="L263" class="LineNr">263 </span> 52/push-edx
<span id="L264" class="LineNr">264 </span> 53/push-ebx
<span id="L265" class="LineNr">265 </span> 56/push-esi
<span id="L266" class="LineNr">266 </span> 57/push-edi
<span id="L267" class="LineNr">267 </span> <span class="subxComment"># num_bytes_appended = 0</span>
<span id="L268" class="LineNr">268 </span> b8/copy-to-eax 0/imm32
<span id="L269" class="LineNr">269 </span> <span class="subxComment"># edi = out</span>
<span id="L270" class="LineNr">270 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 7/r32/edi 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to edi</span>
<span id="L271" class="LineNr">271 </span> <span class="subxComment"># edx = outend</span>
<span id="L272" class="LineNr">272 </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="L273" class="LineNr">273 </span> <span class="subxComment"># esi = in</span>
<span id="L274" class="LineNr">274 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 0x10/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+16) to esi</span>
<span id="L275" class="LineNr">275 </span> <span class="subxComment"># ecx = inend</span>
<span id="L276" class="LineNr">276 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 0x14/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+20) to ecx</span>
<span id="L277" class="LineNr">277 </span><span class="Constant">$_append-4:loop</span>:
<span id="L278" class="LineNr">278 </span> <span class="subxComment"># if (in &gt;= inend) break</span>
<span id="L279" class="LineNr">279 </span> 39/compare 3/mod/direct 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 esi with ecx</span>
<span id="L280" class="LineNr">280 </span> 73/jump-if-addr&gt;= $_append-4:end/disp8
<span id="L281" class="LineNr">281 </span> <span class="subxComment"># if (out &gt;= outend) abort # just to catch test failures fast</span>
<span id="L282" class="LineNr">282 </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="L283" class="LineNr">283 </span> 0f 83/jump-if-addr&gt;= $_append-4:<a href='317abort.subx.html#L5'>abort</a>/disp32
<span id="L284" class="LineNr">284 </span> <span class="subxComment"># *out = *in</span>
<span id="L285" class="LineNr">285 </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="L286" class="LineNr">286 </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>
<span id="L287" class="LineNr">287 </span> <span class="subxComment"># ++num_bytes_appended</span>
<span id="L288" class="LineNr">288 </span> 40/increment-eax
<span id="L289" class="LineNr">289 </span> <span class="subxComment"># ++in</span>
<span id="L290" class="LineNr">290 </span> 46/increment-esi
<span id="L291" class="LineNr">291 </span> <span class="subxComment"># ++out</span>
<span id="L292" class="LineNr">292 </span> 47/increment-edi
<span id="L293" class="LineNr">293 </span> eb/jump $_append-4:<span class="Constant">loop</span>/disp8
<span id="L294" class="LineNr">294 </span><span class="Constant">$_append-4:end</span>:
<span id="L295" class="LineNr">295 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L296" class="LineNr">296 </span> 5f/pop-to-edi
<span id="L297" class="LineNr">297 </span> 5e/pop-to-esi
<span id="L298" class="LineNr">298 </span> 5b/pop-to-ebx
<span id="L299" class="LineNr">299 </span> 5a/pop-to-edx
<span id="L300" class="LineNr">300 </span> 59/pop-to-ecx
<span id="L301" class="LineNr">301 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L302" class="LineNr">302 </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="L303" class="LineNr">303 </span> 5d/pop-to-ebp
<span id="L304" class="LineNr">304 </span> c3/return
<span id="L305" class="LineNr">305 </span>
<span id="L306" class="LineNr">306 </span><span class="Constant">$_append-4:<a href='317abort.subx.html#L5'>abort</a></span>:
<span id="L307" class="LineNr">307 </span> (<a href='501draw-text.mu.html#L279'>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="L308" class="LineNr">308 </span> (<a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 %eax 3 0)
<span id="L309" class="LineNr">309 </span> (<a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;&quot;</span>)
<span id="L310" class="LineNr">310 </span> <span class="subxComment"># never gets here</span>
<span id="L311" class="LineNr">311 </span>
<span id="L312" class="LineNr">312 </span><span class="subxS2Comment"># . . vim&#0058;nowrap:textwidth=0</span>
</pre>
</body>
</html>

View File

@ -95,7 +95,7 @@ if ('onhashchange' in window) {
<span id="L35" class="LineNr"> 35 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 7/base/edi 0/index/eax <span class="Normal"> . </span> 0/r32/eax 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy edi+eax+12 to eax</span>
<span id="L36" class="LineNr"> 36 </span> 50/push-eax
<span id="L37" class="LineNr"> 37 </span> <span class="subxS2Comment"># . . call</span>
<span id="L38" class="LineNr"> 38 </span> e8/call <a href='108write.subx.html#L171'>_append-4</a>/disp32
<span id="L38" class="LineNr"> 38 </span> e8/call <a href='108write.subx.html#L257'>_append-4</a>/disp32
<span id="L39" class="LineNr"> 39 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L40" class="LineNr"> 40 </span> 81 0/subop/add 3/mod/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="L41" class="LineNr"> 41 </span> <span class="subxComment"># f-&gt;write += eax</span>

View File

@ -310,36 +310,36 @@ if ('onhashchange' in window) {
<span id="L249" class="LineNr">249 </span> c3/return
<span id="L250" class="LineNr">250 </span>
<span id="L251" class="LineNr">251 </span><span class="Constant">$lookup:<a href='317abort.subx.html#L5'>abort</a></span>:
<span id="L252" class="LineNr">252 </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;lookup failed: (&quot;</span> 3 0) <span class="subxComment"># 3=cyan</span>
<span id="L253" class="LineNr">253 </span> (<a href='501draw-text.mu.html#L312'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *(ebp+8) 3 0)
<span id="L254" class="LineNr">254 </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 id="L255" class="LineNr">255 </span> (<a href='501draw-text.mu.html#L312'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *(ebp+0xc) 3 0)
<span id="L256" class="LineNr">256 </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;) -&gt; &quot;</span> 3 0)
<span id="L257" class="LineNr">257 </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="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;. Contents of a few words starting from address 0: &quot;</span> 3 0)
<span id="L252" class="LineNr">252 </span> (<a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">&quot;lookup failed: (&quot;</span> 3 0) <span class="subxComment"># 3=cyan</span>
<span id="L253" class="LineNr">253 </span> (<a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *(ebp+8) 3 0)
<span id="L254" class="LineNr">254 </span> (<a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">&quot;, &quot;</span> 3 0)
<span id="L255" class="LineNr">255 </span> (<a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *(ebp+0xc) 3 0)
<span id="L256" class="LineNr">256 </span> (<a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">&quot;) -&gt; &quot;</span> 3 0)
<span id="L257" class="LineNr">257 </span> (<a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *eax 3 0)
<span id="L258" class="LineNr">258 </span> (<a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">&quot;. Contents of a few words starting from address 0: &quot;</span> 3 0)
<span id="L259" class="LineNr">259 </span> b8/copy-to-eax 0/imm32
<span id="L260" class="LineNr">260 </span> (<a href='501draw-text.mu.html#L312'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *eax 2 0)
<span id="L261" class="LineNr">261 </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> 2 0)
<span id="L260" class="LineNr">260 </span> (<a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *eax 2 0)
<span id="L261" class="LineNr">261 </span> (<a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">&quot; &quot;</span> 2 0)
<span id="L262" class="LineNr">262 </span> 40/increment-eax
<span id="L263" class="LineNr">263 </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="L264" class="LineNr">264 </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> 2 0)
<span id="L263" class="LineNr">263 </span> (<a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *eax 3 0)
<span id="L264" class="LineNr">264 </span> (<a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">&quot; &quot;</span> 2 0)
<span id="L265" class="LineNr">265 </span> 40/increment-eax
<span id="L266" class="LineNr">266 </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="L267" class="LineNr">267 </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> 2 0)
<span id="L266" class="LineNr">266 </span> (<a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *eax 3 0)
<span id="L267" class="LineNr">267 </span> (<a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">&quot; &quot;</span> 2 0)
<span id="L268" class="LineNr">268 </span> 40/increment-eax
<span id="L269" class="LineNr">269 </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="L270" class="LineNr">270 </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> 2 0)
<span id="L269" class="LineNr">269 </span> (<a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *eax 3 0)
<span id="L270" class="LineNr">270 </span> (<a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">&quot; &quot;</span> 2 0)
<span id="L271" class="LineNr">271 </span> 40/increment-eax
<span id="L272" class="LineNr">272 </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="L273" class="LineNr">273 </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> 2 0)
<span id="L272" class="LineNr">272 </span> (<a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *eax 3 0)
<span id="L273" class="LineNr">273 </span> (<a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">&quot; &quot;</span> 2 0)
<span id="L274" class="LineNr">274 </span> 40/increment-eax
<span id="L275" class="LineNr">275 </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="L276" class="LineNr">276 </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> 2 0)
<span id="L275" class="LineNr">275 </span> (<a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *eax 3 0)
<span id="L276" class="LineNr">276 </span> (<a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">&quot; &quot;</span> 2 0)
<span id="L277" class="LineNr">277 </span> 40/increment-eax
<span id="L278" class="LineNr">278 </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="L279" class="LineNr">279 </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> 2 0)
<span id="L278" class="LineNr">278 </span> (<a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *eax 3 0)
<span id="L279" class="LineNr">279 </span> (<a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">&quot; &quot;</span> 2 0)
<span id="L280" class="LineNr">280 </span> 40/increment-eax
<span id="L281" class="LineNr">281 </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="L281" class="LineNr">281 </span> (<a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *eax 3 0)
<span id="L282" class="LineNr">282 </span> (<a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;\n&quot;</span>)
<span id="L283" class="LineNr">283 </span> <span class="subxComment"># never gets here</span>
<span id="L284" class="LineNr">284 </span>
@ -790,7 +790,7 @@ if ('onhashchange' in window) {
<span id="L729" class="LineNr">729 </span> <span class="subxS2Comment"># . . push payload</span>
<span id="L730" class="LineNr">730 </span> 50/push-eax
<span id="L731" class="LineNr">731 </span> <span class="subxS2Comment"># . . call</span>
<span id="L732" class="LineNr">732 </span> e8/call <a href='108write.subx.html#L171'>_append-4</a>/disp32
<span id="L732" class="LineNr">732 </span> e8/call <a href='108write.subx.html#L257'>_append-4</a>/disp32
<span id="L733" class="LineNr">733 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L734" class="LineNr">734 </span> 81 0/subop/add 3/mod/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="L735" class="LineNr">735 </span><span class="Constant">$copy-array:end</span>:

View File

@ -1010,7 +1010,7 @@ if ('onhashchange' in window) {
<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="L952" class="LineNr"> 952 </span> e8/call <a href='108write.subx.html#L257'>_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>

View File

@ -137,7 +137,7 @@ if ('onhashchange' in window) {
<span id="L81" class="LineNr"> 81 </span> 8b/-&gt; *(ebp+0x10) 1/r32/ecx
<span id="L82" class="LineNr"> 82 </span> 8d/copy-address *(eax+ecx) 1/r32/ecx
<span id="L83" class="LineNr"> 83 </span> <span class="subxComment">#</span>
<span id="L84" class="LineNr"> 84 </span> (<a href='108write.subx.html#L171'>_append-4</a> %edx %ebx %eax %ecx) <span class="subxComment"># =&gt; eax</span>
<span id="L84" class="LineNr"> 84 </span> (<a href='108write.subx.html#L257'>_append-4</a> %edx %ebx %eax %ecx) <span class="subxComment"># =&gt; eax</span>
<span id="L85" class="LineNr"> 85 </span> <span class="subxComment"># s-&gt;write += n</span>
<span id="L86" class="LineNr"> 86 </span> 8b/-&gt; *(ebp+0x10) 1/r32/ecx
<span id="L87" class="LineNr"> 87 </span> 01/add-to *edi 1/r32/ecx
@ -187,7 +187,7 @@ if ('onhashchange' in window) {
<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="L134" class="LineNr">134 </span> (<a href='108write.subx.html#L257'>_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

View File

@ -82,13 +82,13 @@ if ('onhashchange' in window) {
<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='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="L30" class="LineNr">30 </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="L31" class="LineNr">31 </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 &quot;</span> 3 0) <span class="subxComment"># 3=cyan</span>
<span id="L32" class="LineNr">32 </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 class="subxComment"># 3=cyan</span>
<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="L29" class="LineNr">29 </span> (<a href='501draw-text.mu.html#L279'>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="L30" class="LineNr">30 </span> (<a href='501draw-text.mu.html#L279'>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="L31" class="LineNr">31 </span> (<a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">&quot;: offset &quot;</span> 3 0) <span class="subxComment"># 3=cyan</span>
<span id="L32" class="LineNr">32 </span> (<a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 %eax 3 0) <span class="subxComment"># 3=cyan</span>
<span id="L33" class="LineNr">33 </span> (<a href='501draw-text.mu.html#L279'>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#L279'>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#L279'>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> (<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>:
@ -102,11 +102,11 @@ if ('onhashchange' in window) {
<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="L49" class="LineNr">49 </span> (<a href='501draw-text.mu.html#L279'>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#L279'>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#L279'>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#L279'>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#L279'>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>

View File

@ -92,12 +92,12 @@ if ('onhashchange' in window) {
<span id="L34" class="LineNr"> 34 </span> <span class="subxComment">#</span>
<span id="L35" class="LineNr"> 35 </span> 89/&lt;- %edx 4/r32/esp
<span id="L36" class="LineNr"> 36 </span> <span class="subxComment"># save old cursor position</span>
<span id="L37" class="LineNr"> 37 </span> (<a href='500fake-screen.mu.html#L153'>cursor-position</a> 0) <span class="subxComment"># =&gt; eax, ecx</span>
<span id="L37" class="LineNr"> 37 </span> (<a href='500fake-screen.mu.html#L154'>cursor-position</a> 0) <span class="subxComment"># =&gt; eax, ecx</span>
<span id="L38" class="LineNr"> 38 </span> <span class="subxComment"># print at top-right</span>
<span id="L39" class="LineNr"> 39 </span> (<a href='500fake-screen.mu.html#L169'>set-cursor-position</a> 0 0x70 0)
<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="L39" class="LineNr"> 39 </span> (<a href='500fake-screen.mu.html#L170'>set-cursor-position</a> 0 0x70 0)
<span id="L40" class="LineNr"> 40 </span> (<a href='501draw-text.mu.html#L333'>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="L42" class="LineNr"> 42 </span> (<a href='500fake-screen.mu.html#L170'>set-cursor-position</a> %eax %ecx)
<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
@ -122,13 +122,13 @@ if ('onhashchange' in window) {
<span id="L64" class="LineNr"> 64 </span> {
<span id="L65" class="LineNr"> 65 </span> 81 7/subop/compare *<span class="SpecialChar"><a href='315stack-debug.subx.html#L121'>Really-debug-print</a></span> 0/imm32/false
<span id="L66" class="LineNr"> 66 </span> 74/jump-if-= <span class="Constant">break</span>/disp8
<span id="L67" class="LineNr"> 67 </span> (<a href='501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *(ebp+8) *(ebp+0xc) *(ebp+0x10))
<span id="L67" class="LineNr"> 67 </span> (<a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *(ebp+8) *(ebp+0xc) *(ebp+0x10))
<span id="L68" class="LineNr"> 68 </span> <span class="subxComment"># clear the screen and continue if we got too close to the bottom</span>
<span id="L69" class="LineNr"> 69 </span> (<a href='500fake-screen.mu.html#L153'>cursor-position</a> 0) <span class="subxComment"># =&gt; eax, ecx</span>
<span id="L69" class="LineNr"> 69 </span> (<a href='500fake-screen.mu.html#L154'>cursor-position</a> 0) <span class="subxComment"># =&gt; eax, ecx</span>
<span id="L70" class="LineNr"> 70 </span> 81 7/subop/compare %ecx 0x28/imm32
<span id="L71" class="LineNr"> 71 </span> 75/jump-if-!= <span class="Constant">break</span>/disp8
<span id="L72" class="LineNr"> 72 </span> (<a href='500fake-screen.mu.html#L230'>clear-screen</a> 0)
<span id="L73" class="LineNr"> 73 </span> (<a href='500fake-screen.mu.html#L169'>set-cursor-position</a> 0 0 0)
<span id="L72" class="LineNr"> 72 </span> (<a href='500fake-screen.mu.html#L231'>clear-screen</a> 0)
<span id="L73" class="LineNr"> 73 </span> (<a href='500fake-screen.mu.html#L170'>set-cursor-position</a> 0 0 0)
<span id="L74" class="LineNr"> 74 </span> }
<span id="L75" class="LineNr"> 75 </span><span class="Constant">$debug-print:end</span>:
<span id="L76" class="LineNr"> 76 </span> <span class="subxS1Comment"># . restore registers</span>

View File

@ -66,7 +66,7 @@ if ('onhashchange' in window) {
<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="L11" class="LineNr"> 11 </span> (<a href='501draw-text.mu.html#L279'>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> {
@ -101,9 +101,9 @@ if ('onhashchange' in window) {
<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="L46" class="LineNr"> 46 </span> (<a href='501draw-text.mu.html#L279'>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#L333'>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#L279'>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>
@ -140,10 +140,10 @@ if ('onhashchange' in window) {
<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="L85" class="LineNr"> 85 </span> (<a href='boot.subx.html#L960'>load-sectors</a> <span class="SpecialChar"><a href='boot.subx.html#L908'>Primary-bus-primary-drive</a></span> 0x2760 0x100 %ecx)
<span id="L86" class="LineNr"> 86 </span> (<a href='boot.subx.html#L960'>load-sectors</a> <span class="SpecialChar"><a href='boot.subx.html#L908'>Primary-bus-primary-drive</a></span> 0x2860 0x100 %ecx)
<span id="L87" class="LineNr"> 87 </span> (<a href='boot.subx.html#L960'>load-sectors</a> <span class="SpecialChar"><a href='boot.subx.html#L908'>Primary-bus-primary-drive</a></span> 0x2960 0x100 %ecx)
<span id="L88" class="LineNr"> 88 </span> (<a href='boot.subx.html#L960'>load-sectors</a> <span class="SpecialChar"><a href='boot.subx.html#L908'>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
@ -193,7 +193,7 @@ if ('onhashchange' in window) {
<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="L138" class="LineNr">138 </span> (<a href='501draw-text.mu.html#L279'>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> }
@ -201,7 +201,7 @@ if ('onhashchange' in window) {
<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="L146" class="LineNr">146 </span> (<a href='501draw-text.mu.html#L279'>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> }
@ -234,7 +234,7 @@ if ('onhashchange' in window) {
<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="L179" class="LineNr">179 </span> (<a href='501draw-text.mu.html#L279'>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> }
@ -242,7 +242,7 @@ if ('onhashchange' in window) {
<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="L187" class="LineNr">187 </span> (<a href='501draw-text.mu.html#L279'>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> }
@ -313,8 +313,8 @@ if ('onhashchange' in window) {
<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="L258" class="LineNr">258 </span> (<a href='501draw-text.mu.html#L279'>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#L333'>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> }
@ -373,7 +373,7 @@ if ('onhashchange' in window) {
<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="L318" class="LineNr">318 </span> (<a href='501draw-text.mu.html#L242'>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>

92
html/318counter.subx.html generated Normal file
View File

@ -0,0 +1,92 @@
<!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 - 318counter.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 { }
.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/318counter.subx'>https://github.com/akkartik/mu/blob/main/318counter.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># A rudimentary counter that can be called from anywhere.</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">count-event</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> ff 0/subop/increment *<span class="SpecialChar"><a href='318counter.subx.html#L30'>Foo</a></span>
<span id="L11" class="LineNr">11 </span><span class="Constant">$count-event:end</span>:
<span id="L12" class="LineNr">12 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L13" class="LineNr">13 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L14" class="LineNr">14 </span> 5d/pop-to-ebp
<span id="L15" class="LineNr">15 </span> c3/return
<span id="L16" class="LineNr">16 </span>
<span id="L17" class="LineNr">17 </span><span class="subxFunction">count-of-events</span>: <span class="subxComment"># -&gt; _/eax: int</span>
<span id="L18" class="LineNr">18 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L19" class="LineNr">19 </span> 55/push-ebp
<span id="L20" class="LineNr">20 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L21" class="LineNr">21 </span> <span class="subxComment">#</span>
<span id="L22" class="LineNr">22 </span> 8b/-&gt; *<span class="SpecialChar"><a href='318counter.subx.html#L30'>Foo</a></span> 0/r32/eax
<span id="L23" class="LineNr">23 </span><span class="Constant">$count-of-events:end</span>:
<span id="L24" class="LineNr">24 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L25" class="LineNr">25 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L26" class="LineNr">26 </span> 5d/pop-to-ebp
<span id="L27" class="LineNr">27 </span> c3/return
<span id="L28" class="LineNr">28 </span>
<span id="L29" class="LineNr">29 </span>== data
<span id="L30" class="LineNr">30 </span><span class="SpecialChar">Foo</span>:
<span id="L31" class="LineNr">31 </span> 0/imm32
</pre>
</body>
</html>
<!-- vim: set foldmethod=manual : -->

141
html/400.mu.html generated
View File

@ -65,11 +65,11 @@ if ('onhashchange' in window) {
<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="L13" class="LineNr"> 13 </span><span class="PreProc">sig</span> <a href='boot.subx.html#L960'>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#L1023'>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="L17" class="LineNr"> 17 </span><span class="PreProc">sig</span> <a href='boot.subx.html#L1429'>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>
@ -89,71 +89,78 @@ if ('onhashchange' in window) {
<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="L37" class="LineNr"> 37 </span><span class="PreProc">sig</span> <a href='318counter.subx.html#L5'>count-event</a>
<span id="L38" class="LineNr"> 38 </span><span class="PreProc">sig</span> <a href='318counter.subx.html#L17'>count-of-events</a><span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int
<span id="L39" class="LineNr"> 39 </span>
<span id="L40" class="LineNr"> 40 </span><span class="muComment"># streams</span>
<span id="L41" class="LineNr"> 41 </span><span class="PreProc">sig</span> <a href='106stream.subx.html#L20'>clear-stream</a> f: (addr stream _)
<span id="L42" class="LineNr"> 42 </span><span class="PreProc">sig</span> <a href='106stream.subx.html#L59'>rewind-stream</a> f: (addr stream _)
<span id="L43" class="LineNr"> 43 </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="L44" class="LineNr"> 44 </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="L45" class="LineNr"> 45 </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="L46" class="LineNr"> 46 </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="L47" class="LineNr"> 47 </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="L48" class="LineNr"> 48 </span><span class="PreProc">sig</span> <a href='108write.subx.html#L11'>write</a> f: (addr stream byte), s: (addr array byte)
<span id="L49" class="LineNr"> 49 </span><span class="PreProc">sig</span> <a href='108write.subx.html#L138'>try-write</a> f: (addr stream byte), s: (addr array byte)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean
<span id="L50" class="LineNr"> 50 </span><span class="muComment"># probably a bad idea; I definitely want to discourage its use for streams of non-bytes</span>
<span id="L51" class="LineNr"> 51 </span><span class="PreProc">sig</span> <a href='108write.subx.html#L194'>stream-size</a> f: (addr stream byte)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int
<span id="L52" class="LineNr"> 52 </span><span class="PreProc">sig</span> <a href='108write.subx.html#L176'>space-remaining-in-stream</a> f: (addr stream 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='113write-stream.subx.html#L8'>write-stream</a> f: (addr stream byte), s: (addr stream byte)
<span id="L54" class="LineNr"> 54 </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="L55" class="LineNr"> 55 </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="L56" class="LineNr"> 56 </span><span class="muComment">#sig to-hex-char in/eax: int -&gt; out/eax: int</span>
<span id="L57" class="LineNr"> 57 </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="L58" class="LineNr"> 58 </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="L59" class="LineNr"> 59 </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="L60" class="LineNr"> 60 </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="L61" class="LineNr"> 61 </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="L62" class="LineNr"> 62 </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="L63" class="LineNr"> 63 </span><span class="muComment">#sig parse-hex-int-helper start: (addr byte), end: (addr byte) -&gt; _/eax: int</span>
<span id="L64" class="LineNr"> 64 </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="L65" class="LineNr"> 65 </span><span class="muComment">#sig from-hex-char in/eax: byte -&gt; out/eax: nibble</span>
<span id="L66" class="LineNr"> 66 </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="L67" class="LineNr"> 67 </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="L68" class="LineNr"> 68 </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="L69" class="LineNr"> 69 </span><span class="muComment">#sig parse-decimal-int-helper start: (addr byte), end: (addr byte) -&gt; _/eax: int</span>
<span id="L70" class="LineNr"> 70 </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="L71" class="LineNr"> 71 </span><span class="muComment">#sig allocate ad: (addr allocation-descriptor), n: int, out: (addr handle _)</span>
<span id="L72" class="LineNr"> 72 </span><span class="muComment">#sig allocate-raw ad: (addr allocation-descriptor), n: int, out: (addr handle _)</span>
<span id="L73" class="LineNr"> 73 </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="L74" class="LineNr"> 74 </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="L75" class="LineNr"> 75 </span><span class="PreProc">sig</span> <a href='120allocate.subx.html#L479'>copy-handle</a> src: (handle _T), dest: (addr handle _T)
<span id="L76" class="LineNr"> 76 </span><span class="muComment">#sig allocate-region ad: (addr allocation-descriptor), n: int, out: (addr handle allocation-descriptor)</span>
<span id="L77" class="LineNr"> 77 </span><span class="muComment">#sig allocate-array ad: (addr allocation-descriptor), n: int, out: (addr handle _)</span>
<span id="L78" class="LineNr"> 78 </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="L79" class="LineNr"> 79 </span><span class="muComment">#sig zero-out start: (addr byte), size: int</span>
<span id="L80" class="LineNr"> 80 </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="L81" class="LineNr"> 81 </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="L82" class="LineNr"> 82 </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="L83" class="LineNr"> 83 </span><span class="PreProc">sig</span> <a href='123slice.subx.html#L793'>write-slice</a> out: (addr stream byte), s: (addr slice)
<span id="L84" class="LineNr"> 84 </span><span class="muComment"># bad name alert</span>
<span id="L85" class="LineNr"> 85 </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="L86" class="LineNr"> 86 </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="L87" class="LineNr"> 87 </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="L88" class="LineNr"> 88 </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="L89" class="LineNr"> 89 </span><span class="muComment"># bad name alert</span>
<span id="L90" class="LineNr"> 90 </span><span class="muComment"># next-word really tokenizes</span>
<span id="L91" class="LineNr"> 91 </span><span class="muComment"># next-raw-word really reads whitespace-separated words</span>
<span id="L92" class="LineNr"> 92 </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="L93" class="LineNr"> 93 </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="L94" class="LineNr"> 94 </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="L95" class="LineNr"> 95 </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="L96" class="LineNr"> 96 </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="L97" class="LineNr"> 97 </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="L98" class="LineNr"> 98 </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="L99" class="LineNr"> 99 </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="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
<span id="L101" class="LineNr">101 </span><span class="muComment">#sig copy-bytes src: (addr byte), dest: (addr byte), n: int</span>
<span id="L102" class="LineNr">102 </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="L103" class="LineNr">103 </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="L104" class="LineNr">104 </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="L105" class="LineNr">105 </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="L106" class="LineNr">106 </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="L107" class="LineNr">107 </span>
<span id="L108" class="LineNr">108 </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>

View File

@ -174,445 +174,446 @@ if ('onhashchange' in window) {
<span id="L116" class="LineNr">116 </span> <a href='500fake-screen.mu.html#L88'>draw-grapheme</a> <a href='500fake-screen.mu.html#L14'>screen</a>, g, x, y, color, background-color
<span id="L117" class="LineNr">117 </span><span class="Delimiter">}</span>
<span id="L118" class="LineNr">118 </span>
<span id="L119" class="LineNr">119 </span><span class="muComment"># not really needed for a real screen, though it shouldn't do any harm</span>
<span id="L119" class="LineNr">119 </span><span class="muComment"># fake screens only</span>
<span id="L120" class="LineNr">120 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='500fake-screen.mu.html#L120'>screen-cell-index</a></span> _screen: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), x: int, y: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
<span id="L121" class="LineNr">121 </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="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='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='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='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='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
<span id="L148" class="LineNr">148 </span> result <span class="Special">&lt;-</span> multiply *width-addr
<span id="L149" class="LineNr">149 </span> result <span class="Special">&lt;-</span> add x
<span id="L150" class="LineNr">150 </span> <span class="PreProc">return</span> result
<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='500fake-screen.mu.html#L153'>cursor-position</a></span> _screen: (addr <a href='500fake-screen.mu.html#L14'>screen</a>)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
<span id="L154" class="LineNr">154 </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="L155" class="LineNr">155 </span> <span class="Delimiter">{</span>
<span id="L156" class="LineNr">156 </span> compare <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0</span>
<span id="L157" class="LineNr">157 </span> <span class="PreProc">break-if-!=</span>
<span id="L158" class="LineNr">158 </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="L159" class="LineNr">159 </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="L160" class="LineNr">160 </span> x, y <span class="Special">&lt;-</span> <a href='103grapheme.subx.html#L96'>cursor-position-on-real-screen</a>
<span id="L161" class="LineNr">161 </span> <span class="PreProc">return</span> x, y
<span id="L162" class="LineNr">162 </span> <span class="Delimiter">}</span>
<span id="L163" class="LineNr">163 </span> <span class="muComment"># fake screen</span>
<span id="L164" class="LineNr">164 </span> <span class="PreProc">var</span> cursor-x-addr/<span class="Constant">eax</span>: (addr int) <span class="Special">&lt;-</span> get <a href='500fake-screen.mu.html#L14'>screen</a>, cursor-x
<span id="L165" class="LineNr">165 </span> <span class="PreProc">var</span> cursor-y-addr/<span class="Constant">ecx</span>: (addr int) <span class="Special">&lt;-</span> get <a href='500fake-screen.mu.html#L14'>screen</a>, cursor-y
<span id="L166" class="LineNr">166 </span> <span class="PreProc">return</span> *cursor-x-addr, *cursor-y-addr
<span id="L167" class="LineNr">167 </span><span class="Delimiter">}</span>
<span id="L168" class="LineNr">168 </span>
<span id="L169" class="LineNr">169 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='500fake-screen.mu.html#L169'>set-cursor-position</a></span> _screen: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), x: int, y: int <span class="Delimiter">{</span>
<span id="L170" class="LineNr">170 </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="L171" class="LineNr">171 </span> <span class="Delimiter">{</span>
<span id="L172" class="LineNr">172 </span> compare <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0</span>
<span id="L173" class="LineNr">173 </span> <span class="PreProc">break-if-!=</span>
<span id="L174" class="LineNr">174 </span> <a href='103grapheme.subx.html#L109'>set-cursor-position-on-real-screen</a> x, y
<span id="L175" class="LineNr">175 </span> <span class="PreProc">return</span>
<span id="L176" class="LineNr">176 </span> <span class="Delimiter">}</span>
<span id="L177" class="LineNr">177 </span> <span class="muComment"># fake screen</span>
<span id="L178" class="LineNr">178 </span> <span class="muComment"># ignore x &lt; 0</span>
<span id="L179" class="LineNr">179 </span> <span class="Delimiter">{</span>
<span id="L180" class="LineNr">180 </span> compare x, <span class="Constant">0</span>
<span id="L181" class="LineNr">181 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L182" class="LineNr">182 </span> <span class="PreProc">return</span>
<span id="L183" class="LineNr">183 </span> <span class="Delimiter">}</span>
<span id="L184" class="LineNr">184 </span> <span class="muComment"># ignore x &gt;= width</span>
<span id="L185" class="LineNr">185 </span> <span class="Delimiter">{</span>
<span id="L186" class="LineNr">186 </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="L187" class="LineNr">187 </span> <span class="PreProc">var</span> width/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy *width-addr
<span id="L188" class="LineNr">188 </span> compare x, width
<span id="L189" class="LineNr">189 </span> <span class="PreProc">break-if-&lt;=</span>
<span id="L190" class="LineNr">190 </span> <span class="PreProc">return</span>
<span id="L191" class="LineNr">191 </span> <span class="Delimiter">}</span>
<span id="L192" class="LineNr">192 </span> <span class="muComment"># ignore y &lt; 0</span>
<span id="L193" class="LineNr">193 </span> <span class="Delimiter">{</span>
<span id="L194" class="LineNr">194 </span> compare y, <span class="Constant">0</span>
<span id="L195" class="LineNr">195 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L196" class="LineNr">196 </span> <span class="PreProc">return</span>
<span id="L197" class="LineNr">197 </span> <span class="Delimiter">}</span>
<span id="L198" class="LineNr">198 </span> <span class="muComment"># ignore y &gt;= height</span>
<span id="L199" class="LineNr">199 </span> <span class="Delimiter">{</span>
<span id="L200" class="LineNr">200 </span> <span class="PreProc">var</span> height-addr/<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="L201" class="LineNr">201 </span> <span class="PreProc">var</span> height/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy *height-addr
<span id="L202" class="LineNr">202 </span> compare y, height
<span id="L203" class="LineNr">203 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L204" class="LineNr">204 </span> <span class="PreProc">return</span>
<span id="L205" class="LineNr">205 </span> <span class="Delimiter">}</span>
<span id="L206" class="LineNr">206 </span> <span class="muComment"># screen-&gt;cursor-x = x</span>
<span id="L207" class="LineNr">207 </span> <span class="PreProc">var</span> dest/<span class="Constant">edi</span>: (addr int) <span class="Special">&lt;-</span> get <a href='500fake-screen.mu.html#L14'>screen</a>, cursor-x
<span id="L208" class="LineNr">208 </span> <span class="PreProc">var</span> src/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy x
<span id="L209" class="LineNr">209 </span> copy-to *dest, src
<span id="L210" class="LineNr">210 </span> <span class="muComment"># screen-&gt;cursor-y = y</span>
<span id="L211" class="LineNr">211 </span> dest <span class="Special">&lt;-</span> get <a href='500fake-screen.mu.html#L14'>screen</a>, cursor-y
<span id="L212" class="LineNr">212 </span> src <span class="Special">&lt;-</span> copy y
<span id="L213" class="LineNr">213 </span> copy-to *dest, src
<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='500fake-screen.mu.html#L216'>draw-cursor</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), g: grapheme <span class="Delimiter">{</span>
<span id="L217" class="LineNr">217 </span> <span class="Delimiter">{</span>
<span id="L218" class="LineNr">218 </span> compare <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0</span>
<span id="L219" class="LineNr">219 </span> <span class="PreProc">break-if-!=</span>
<span id="L220" class="LineNr">220 </span> <a href='103grapheme.subx.html#L134'>draw-cursor-on-real-screen</a> g
<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"># fake screen</span>
<span id="L224" class="LineNr">224 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L225" class="LineNr">225 </span> <span class="PreProc">var</span> cursor-y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L226" class="LineNr">226 </span> cursor-x, cursor-y <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L153'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L227" class="LineNr">227 </span> <a href='500fake-screen.mu.html#L88'>draw-grapheme</a> <a href='500fake-screen.mu.html#L14'>screen</a>, g, cursor-x, cursor-y, <span class="Constant">0</span>/fg, <span class="Constant">7</span>/bg
<span id="L228" class="LineNr">228 </span><span class="Delimiter">}</span>
<span id="L229" class="LineNr">229 </span>
<span id="L230" class="LineNr">230 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='500fake-screen.mu.html#L230'>clear-screen</a></span> _screen: (addr <a href='500fake-screen.mu.html#L14'>screen</a>) <span class="Delimiter">{</span>
<span id="L231" class="LineNr">231 </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="L232" class="LineNr">232 </span> <span class="Delimiter">{</span>
<span id="L233" class="LineNr">233 </span> compare <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0</span>
<span id="L234" class="LineNr">234 </span> <span class="PreProc">break-if-!=</span>
<span id="L235" class="LineNr">235 </span> <a href='500fake-screen.mu.html#L364'>clear-real-screen</a>
<span id="L236" class="LineNr">236 </span> <span class="PreProc">return</span>
<span id="L237" class="LineNr">237 </span> <span class="Delimiter">}</span>
<span id="L238" class="LineNr">238 </span> <span class="muComment"># fake screen</span>
<span id="L239" class="LineNr">239 </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="L240" class="LineNr">240 </span> <span class="PreProc">var</span> y/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L241" class="LineNr">241 </span> <span class="PreProc">var</span> height/<span class="Constant">ecx</span>: (addr int) <span class="Special">&lt;-</span> get <a href='500fake-screen.mu.html#L14'>screen</a>, height
<span id="L242" class="LineNr">242 </span> <span class="Delimiter">{</span>
<span id="L243" class="LineNr">243 </span> compare y, *height
<span id="L244" class="LineNr">244 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L245" class="LineNr">245 </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="L246" class="LineNr">246 </span> <span class="PreProc">var</span> width/<span class="Constant">ebx</span>: (addr int) <span class="Special">&lt;-</span> get <a href='500fake-screen.mu.html#L14'>screen</a>, width
<span id="L247" class="LineNr">247 </span> <span class="Delimiter">{</span>
<span id="L248" class="LineNr">248 </span> compare x, *width
<span id="L249" class="LineNr">249 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L250" class="LineNr">250 </span> <a href='500fake-screen.mu.html#L114'>draw-code-point</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x20</span>/space, x, y, <span class="Constant">0</span>/fg=black, <span class="Constant">0</span>/bg=black
<span id="L251" class="LineNr">251 </span> x <span class="Special">&lt;-</span> increment
<span id="L252" class="LineNr">252 </span> <span class="PreProc">loop</span>
<span id="L253" class="LineNr">253 </span> <span class="Delimiter">}</span>
<span id="L254" class="LineNr">254 </span> y <span class="Special">&lt;-</span> increment
<span id="L255" class="LineNr">255 </span> <span class="PreProc">loop</span>
<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#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>
<span id="L263" class="LineNr">263 </span> compare i, max
<span id="L264" class="LineNr">264 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L265" class="LineNr">265 </span> <span class="PreProc">var</span> curr/<span class="Constant">eax</span>: (addr byte) <span class="Special">&lt;-</span> index pixels, i
<span id="L266" class="LineNr">266 </span> <span class="PreProc">var</span> zero/<span class="Constant">ebx</span>: byte <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L267" class="LineNr">267 </span> copy-byte-to *curr, zero
<span id="L268" class="LineNr">268 </span> i <span class="Special">&lt;-</span> increment
<span id="L269" class="LineNr">269 </span> <span class="PreProc">loop</span>
<span id="L270" class="LineNr">270 </span> <span class="Delimiter">}</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="muFunction"><a href='500fake-screen.mu.html#L273'>fake-screen-empty?</a></span> _screen: (addr <a href='500fake-screen.mu.html#L14'>screen</a>)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean <span class="Delimiter">{</span>
<span id="L274" class="LineNr">274 </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="L275" class="LineNr">275 </span> <span class="PreProc">var</span> y/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L276" class="LineNr">276 </span> <span class="PreProc">var</span> height/<span class="Constant">ecx</span>: (addr int) <span class="Special">&lt;-</span> get <a href='500fake-screen.mu.html#L14'>screen</a>, height
<span id="L277" class="LineNr">277 </span> <span class="Delimiter">{</span>
<span id="L278" class="LineNr">278 </span> compare y, *height
<span id="L279" class="LineNr">279 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L280" class="LineNr">280 </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="L281" class="LineNr">281 </span> <span class="PreProc">var</span> width/<span class="Constant">ebx</span>: (addr int) <span class="Special">&lt;-</span> get <a href='500fake-screen.mu.html#L14'>screen</a>, width
<span id="L282" class="LineNr">282 </span> <span class="Delimiter">{</span>
<span id="L283" class="LineNr">283 </span> compare x, *width
<span id="L284" class="LineNr">284 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L285" class="LineNr">285 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L406'>screen-grapheme-at</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y
<span id="L286" class="LineNr">286 </span> <span class="Delimiter">{</span>
<span id="L287" class="LineNr">287 </span> compare g, <span class="Constant">0</span>
<span id="L288" class="LineNr">288 </span> <span class="PreProc">break-if-=</span>
<span id="L289" class="LineNr">289 </span> compare g, <span class="Constant">0x20</span>/space
<span id="L290" class="LineNr">290 </span> <span class="PreProc">break-if-=</span>
<span id="L291" class="LineNr">291 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L292" class="LineNr">292 </span> <span class="Delimiter">}</span>
<span id="L293" class="LineNr">293 </span> x <span class="Special">&lt;-</span> increment
<span id="L294" class="LineNr">294 </span> <span class="PreProc">loop</span>
<span id="L295" class="LineNr">295 </span> <span class="Delimiter">}</span>
<span id="L296" class="LineNr">296 </span> y <span class="Special">&lt;-</span> increment
<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#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
<span id="L304" class="LineNr">304 </span> height <span class="Special">&lt;-</span> shift-left <span class="Constant">4</span>/log2-font-height
<span id="L305" class="LineNr">305 </span> <span class="Delimiter">{</span>
<span id="L306" class="LineNr">306 </span> compare y, height
<span id="L307" class="LineNr">307 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L308" class="LineNr">308 </span> <span class="PreProc">var</span> width-addr/<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="L309" class="LineNr">309 </span> <span class="PreProc">var</span> width/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy *width-addr
<span id="L310" class="LineNr">310 </span> width <span class="Special">&lt;-</span> shift-left <span class="Constant">3</span>/log2-font-width
<span id="L311" class="LineNr">311 </span> <span class="PreProc">var</span> x/<span class="Constant">edi</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L312" class="LineNr">312 </span> <span class="Delimiter">{</span>
<span id="L313" class="LineNr">313 </span> compare x, width
<span id="L314" class="LineNr">314 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L315" class="LineNr">315 </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="L316" class="LineNr">316 </span> <span class="PreProc">var</span> color-addr/<span class="Constant">ecx</span>: (addr byte) <span class="Special">&lt;-</span> index pixels, idx
<span id="L317" class="LineNr">317 </span> <span class="PreProc">var</span> color/<span class="Constant">ecx</span>: byte <span class="Special">&lt;-</span> copy-byte *color-addr
<span id="L318" class="LineNr">318 </span> compare color, <span class="Constant">0</span>
<span id="L319" class="LineNr">319 </span> <span class="Delimiter">{</span>
<span id="L320" class="LineNr">320 </span> <span class="PreProc">break-if-=</span>
<span id="L321" class="LineNr">321 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L322" class="LineNr">322 </span> <span class="Delimiter">}</span>
<span id="L323" class="LineNr">323 </span> x <span class="Special">&lt;-</span> increment
<span id="L324" class="LineNr">324 </span> <span class="PreProc">loop</span>
<span id="L325" class="LineNr">325 </span> <span class="Delimiter">}</span>
<span id="L326" class="LineNr">326 </span> y <span class="Special">&lt;-</span> increment
<span id="L327" class="LineNr">327 </span> <span class="PreProc">loop</span>
<span id="L328" class="LineNr">328 </span> <span class="Delimiter">}</span>
<span id="L329" class="LineNr">329 </span> <span class="PreProc">return</span> <span class="Constant">1</span>/true
<span id="L330" class="LineNr">330 </span><span class="Delimiter">}</span>
<span id="L331" class="LineNr">331 </span>
<span id="L332" class="LineNr">332 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='500fake-screen.mu.html#L332'>clear-rect</a></span> _screen: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), xmin: int, ymin: int, xmax: int, ymax: int, background-color: int <span class="Delimiter">{</span>
<span id="L333" class="LineNr">333 </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="L334" class="LineNr">334 </span> <span class="Delimiter">{</span>
<span id="L335" class="LineNr">335 </span> compare <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0</span>
<span id="L336" class="LineNr">336 </span> <span class="PreProc">break-if-!=</span>
<span id="L337" class="LineNr">337 </span> <a href='500fake-screen.mu.html#L382'>clear-rect-on-real-screen</a> xmin, ymin, xmax, ymax, background-color
<span id="L338" class="LineNr">338 </span> <span class="PreProc">return</span>
<span id="L339" class="LineNr">339 </span> <span class="Delimiter">}</span>
<span id="L340" class="LineNr">340 </span> <span class="muComment"># fake screen</span>
<span id="L341" class="LineNr">341 </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="L342" class="LineNr">342 </span> <span class="PreProc">var</span> y/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy ymin
<span id="L343" class="LineNr">343 </span> <span class="PreProc">var</span> ymax/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy ymax
<span id="L344" class="LineNr">344 </span> <span class="Delimiter">{</span>
<span id="L345" class="LineNr">345 </span> compare y, ymax
<span id="L346" class="LineNr">346 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L347" class="LineNr">347 </span> <span class="PreProc">var</span> x/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy xmin
<span id="L348" class="LineNr">348 </span> <span class="PreProc">var</span> xmax/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy xmax
<span id="L349" class="LineNr">349 </span> <span class="Delimiter">{</span>
<span id="L350" class="LineNr">350 </span> compare x, xmax
<span id="L351" class="LineNr">351 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L352" class="LineNr">352 </span> <a href='500fake-screen.mu.html#L114'>draw-code-point</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x20</span>/space, x, y, <span class="Constant">0</span>/fg, background-color
<span id="L353" class="LineNr">353 </span> x <span class="Special">&lt;-</span> increment
<span id="L354" class="LineNr">354 </span> <span class="PreProc">loop</span>
<span id="L355" class="LineNr">355 </span> <span class="Delimiter">}</span>
<span id="L356" class="LineNr">356 </span> y <span class="Special">&lt;-</span> increment
<span id="L357" class="LineNr">357 </span> <span class="PreProc">loop</span>
<span id="L358" class="LineNr">358 </span> <span class="Delimiter">}</span>
<span id="L359" class="LineNr">359 </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="L360" class="LineNr">360 </span><span class="Delimiter">}</span>
<span id="L361" class="LineNr">361 </span>
<span id="L362" class="LineNr">362 </span><span class="muComment"># there's no grapheme that guarantees to cover every pixel, so we'll bump down</span>
<span id="L363" class="LineNr">363 </span><span class="muComment"># to pixels for a real screen</span>
<span id="L364" class="LineNr">364 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='500fake-screen.mu.html#L364'>clear-real-screen</a></span> <span class="Delimiter">{</span>
<span id="L365" class="LineNr">365 </span> <span class="PreProc">var</span> y/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L366" class="LineNr">366 </span> <span class="Delimiter">{</span>
<span id="L367" class="LineNr">367 </span> compare y, <span class="Constant">0x300</span>/screen-height=<span class="Constant">768</span>
<span id="L368" class="LineNr">368 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L369" class="LineNr">369 </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="L370" class="LineNr">370 </span> <span class="Delimiter">{</span>
<span id="L371" class="LineNr">371 </span> compare x, <span class="Constant">0x400</span>/screen-width=<span class="Constant">1024</span>
<span id="L372" class="LineNr">372 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L373" class="LineNr">373 </span> <a href='101screen.subx.html#L8'>pixel-on-real-screen</a> x, y, <span class="Constant">0</span>/color=black
<span id="L374" class="LineNr">374 </span> x <span class="Special">&lt;-</span> increment
<span id="L375" class="LineNr">375 </span> <span class="PreProc">loop</span>
<span id="L376" class="LineNr">376 </span> <span class="Delimiter">}</span>
<span id="L377" class="LineNr">377 </span> y <span class="Special">&lt;-</span> increment
<span id="L378" class="LineNr">378 </span> <span class="PreProc">loop</span>
<span id="L379" class="LineNr">379 </span> <span class="Delimiter">}</span>
<span id="L380" class="LineNr">380 </span><span class="Delimiter">}</span>
<span id="L381" class="LineNr">381 </span>
<span id="L382" class="LineNr">382 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='500fake-screen.mu.html#L382'>clear-rect-on-real-screen</a></span> xmin: int, ymin: int, xmax: int, ymax: int, background-color: int <span class="Delimiter">{</span>
<span id="L383" class="LineNr">383 </span> <span class="PreProc">var</span> y/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy ymin
<span id="L384" class="LineNr">384 </span> y <span class="Special">&lt;-</span> shift-left <span class="Constant">4</span>/log2-font-height
<span id="L385" class="LineNr">385 </span> <span class="PreProc">var</span> ymax/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy ymax
<span id="L386" class="LineNr">386 </span> ymax <span class="Special">&lt;-</span> shift-left <span class="Constant">4</span>/log2-font-height
<span id="L387" class="LineNr">387 </span> <span class="Delimiter">{</span>
<span id="L388" class="LineNr">388 </span> compare y, ymax
<span id="L389" class="LineNr">389 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L390" class="LineNr">390 </span> <span class="PreProc">var</span> x/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy xmin
<span id="L391" class="LineNr">391 </span> x <span class="Special">&lt;-</span> shift-left <span class="Constant">3</span>/log2-font-width
<span id="L392" class="LineNr">392 </span> <span class="PreProc">var</span> xmax/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy xmax
<span id="L393" class="LineNr">393 </span> xmax <span class="Special">&lt;-</span> shift-left <span class="Constant">3</span>/log2-font-width
<span id="L394" class="LineNr">394 </span> <span class="Delimiter">{</span>
<span id="L395" class="LineNr">395 </span> compare x, xmax
<span id="L396" class="LineNr">396 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L397" class="LineNr">397 </span> <a href='101screen.subx.html#L8'>pixel-on-real-screen</a> x, y, background-color
<span id="L398" class="LineNr">398 </span> x <span class="Special">&lt;-</span> increment
<span id="L399" class="LineNr">399 </span> <span class="PreProc">loop</span>
<span id="L400" class="LineNr">400 </span> <span class="Delimiter">}</span>
<span id="L401" class="LineNr">401 </span> y <span class="Special">&lt;-</span> increment
<span id="L402" class="LineNr">402 </span> <span class="PreProc">loop</span>
<span id="L403" class="LineNr">403 </span> <span class="Delimiter">}</span>
<span id="L404" class="LineNr">404 </span><span class="Delimiter">}</span>
<span id="L405" class="LineNr">405 </span>
<span id="L406" class="LineNr">406 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='500fake-screen.mu.html#L406'>screen-grapheme-at</a></span> _screen: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), x: int, y: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: grapheme <span class="Delimiter">{</span>
<span id="L407" class="LineNr">407 </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="L408" class="LineNr">408 </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="L409" class="LineNr">409 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L413'>screen-grapheme-at-idx</a> <a href='500fake-screen.mu.html#L14'>screen</a>, idx
<span id="L410" class="LineNr">410 </span> <span class="PreProc">return</span> result
<span id="L411" class="LineNr">411 </span><span class="Delimiter">}</span>
<span id="L412" class="LineNr">412 </span>
<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#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
<span id="L420" class="LineNr">420 </span> <span class="PreProc">var</span> src/<span class="Constant">eax</span>: (addr grapheme) <span class="Special">&lt;-</span> get cell, data
<span id="L421" class="LineNr">421 </span> <span class="PreProc">return</span> *src
<span id="L422" class="LineNr">422 </span><span class="Delimiter">}</span>
<span id="L423" class="LineNr">423 </span>
<span id="L424" class="LineNr">424 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='500fake-screen.mu.html#L424'>screen-color-at</a></span> _screen: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), x: int, y: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
<span id="L425" class="LineNr">425 </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="L426" class="LineNr">426 </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="L427" class="LineNr">427 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L431'>screen-color-at-idx</a> <a href='500fake-screen.mu.html#L14'>screen</a>, idx
<span id="L428" class="LineNr">428 </span> <span class="PreProc">return</span> result
<span id="L429" class="LineNr">429 </span><span class="Delimiter">}</span>
<span id="L430" class="LineNr">430 </span>
<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#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
<span id="L438" class="LineNr">438 </span> <span class="PreProc">var</span> src/<span class="Constant">eax</span>: (addr int) <span class="Special">&lt;-</span> get cell, color
<span id="L439" class="LineNr">439 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy *src
<span id="L440" class="LineNr">440 </span> <span class="PreProc">return</span> result
<span id="L441" class="LineNr">441 </span><span class="Delimiter">}</span>
<span id="L442" class="LineNr">442 </span>
<span id="L443" class="LineNr">443 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='500fake-screen.mu.html#L443'>screen-background-color-at</a></span> _screen: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), x: int, y: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
<span id="L444" class="LineNr">444 </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="L445" class="LineNr">445 </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="L446" class="LineNr">446 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L450'>screen-background-color-at-idx</a> <a href='500fake-screen.mu.html#L14'>screen</a>, idx
<span id="L447" class="LineNr">447 </span> <span class="PreProc">return</span> result
<span id="L448" class="LineNr">448 </span><span class="Delimiter">}</span>
<span id="L449" class="LineNr">449 </span>
<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#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
<span id="L457" class="LineNr">457 </span> <span class="PreProc">var</span> src/<span class="Constant">eax</span>: (addr int) <span class="Special">&lt;-</span> get cell, background-color
<span id="L458" class="LineNr">458 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy *src
<span id="L459" class="LineNr">459 </span> <span class="PreProc">return</span> result
<span id="L460" class="LineNr">460 </span><span class="Delimiter">}</span>
<span id="L461" class="LineNr">461 </span>
<span id="L462" class="LineNr">462 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='500fake-screen.mu.html#L462'>pixel</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), x: int, y: int, color: int <span class="Delimiter">{</span>
<span id="L463" class="LineNr">463 </span> <span class="Delimiter">{</span>
<span id="L464" class="LineNr">464 </span> compare <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0</span>
<span id="L465" class="LineNr">465 </span> <span class="PreProc">break-if-!=</span>
<span id="L466" class="LineNr">466 </span> <a href='101screen.subx.html#L8'>pixel-on-real-screen</a> x, y, color
<span id="L467" class="LineNr">467 </span> <span class="PreProc">return</span>
<span id="L468" class="LineNr">468 </span> <span class="Delimiter">}</span>
<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#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='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
<span id="L480" class="LineNr">480 </span> <span class="PreProc">var</span> src/<span class="Constant">eax</span>: byte <span class="Special">&lt;-</span> copy-byte color
<span id="L481" class="LineNr">481 </span> copy-byte-to *dest, src
<span id="L482" class="LineNr">482 </span><span class="Delimiter">}</span>
<span id="L483" class="LineNr">483 </span>
<span id="L484" class="LineNr">484 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='500fake-screen.mu.html#L484'>pixel-index</a></span> _screen: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), x: int, y: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
<span id="L485" class="LineNr">485 </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="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='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
<span id="L493" class="LineNr">493 </span> <span class="PreProc">var</span> xmax/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy *xmax-a
<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='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='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
<span id="L506" class="LineNr">506 </span> <span class="PreProc">var</span> ymax/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy *ymax-a
<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='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
<span id="L514" class="LineNr">514 </span> result <span class="Special">&lt;-</span> multiply *width-addr
<span id="L515" class="LineNr">515 </span> result <span class="Special">&lt;-</span> shift-left <span class="Constant">3</span>/log2-font-width
<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>
<span id="L122" class="LineNr">122 </span> <span class="muComment"># some bounds checks that aren't needed for a real screen, but might help catch problems</span>
<span id="L123" class="LineNr">123 </span> <span class="Delimiter">{</span>
<span id="L124" class="LineNr">124 </span> compare x, <span class="Constant">0</span>
<span id="L125" class="LineNr">125 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L126" class="LineNr">126 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;screen-cell-index: negative x&quot;</span>
<span id="L127" class="LineNr">127 </span> <span class="Delimiter">}</span>
<span id="L128" class="LineNr">128 </span> <span class="Delimiter">{</span>
<span id="L129" class="LineNr">129 </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="L130" class="LineNr">130 </span> <span class="PreProc">var</span> xcurr/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy x
<span id="L131" class="LineNr">131 </span> compare xcurr, *xmax
<span id="L132" class="LineNr">132 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L133" class="LineNr">133 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;screen-cell-index: x too high&quot;</span>
<span id="L134" class="LineNr">134 </span> <span class="Delimiter">}</span>
<span id="L135" class="LineNr">135 </span> <span class="Delimiter">{</span>
<span id="L136" class="LineNr">136 </span> compare y, <span class="Constant">0</span>
<span id="L137" class="LineNr">137 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L138" class="LineNr">138 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;screen-cell-index: negative y&quot;</span>
<span id="L139" class="LineNr">139 </span> <span class="Delimiter">}</span>
<span id="L140" class="LineNr">140 </span> <span class="Delimiter">{</span>
<span id="L141" class="LineNr">141 </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="L142" class="LineNr">142 </span> <span class="PreProc">var</span> ycurr/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy y
<span id="L143" class="LineNr">143 </span> compare ycurr, *ymax
<span id="L144" class="LineNr">144 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L145" class="LineNr">145 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;screen-cell-index: y too high&quot;</span>
<span id="L146" class="LineNr">146 </span> <span class="Delimiter">}</span>
<span id="L147" class="LineNr">147 </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="L148" class="LineNr">148 </span> <span class="PreProc">var</span> result/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy y
<span id="L149" class="LineNr">149 </span> result <span class="Special">&lt;-</span> multiply *width-addr
<span id="L150" class="LineNr">150 </span> result <span class="Special">&lt;-</span> add x
<span id="L151" class="LineNr">151 </span> <span class="PreProc">return</span> result
<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='500fake-screen.mu.html#L154'>cursor-position</a></span> _screen: (addr <a href='500fake-screen.mu.html#L14'>screen</a>)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
<span id="L155" class="LineNr">155 </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="L156" class="LineNr">156 </span> <span class="Delimiter">{</span>
<span id="L157" class="LineNr">157 </span> compare <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0</span>
<span id="L158" class="LineNr">158 </span> <span class="PreProc">break-if-!=</span>
<span id="L159" class="LineNr">159 </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="L160" class="LineNr">160 </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="L161" class="LineNr">161 </span> x, y <span class="Special">&lt;-</span> <a href='103grapheme.subx.html#L96'>cursor-position-on-real-screen</a>
<span id="L162" class="LineNr">162 </span> <span class="PreProc">return</span> x, y
<span id="L163" class="LineNr">163 </span> <span class="Delimiter">}</span>
<span id="L164" class="LineNr">164 </span> <span class="muComment"># fake screen</span>
<span id="L165" class="LineNr">165 </span> <span class="PreProc">var</span> cursor-x-addr/<span class="Constant">eax</span>: (addr int) <span class="Special">&lt;-</span> get <a href='500fake-screen.mu.html#L14'>screen</a>, cursor-x
<span id="L166" class="LineNr">166 </span> <span class="PreProc">var</span> cursor-y-addr/<span class="Constant">ecx</span>: (addr int) <span class="Special">&lt;-</span> get <a href='500fake-screen.mu.html#L14'>screen</a>, cursor-y
<span id="L167" class="LineNr">167 </span> <span class="PreProc">return</span> *cursor-x-addr, *cursor-y-addr
<span id="L168" class="LineNr">168 </span><span class="Delimiter">}</span>
<span id="L169" class="LineNr">169 </span>
<span id="L170" class="LineNr">170 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='500fake-screen.mu.html#L170'>set-cursor-position</a></span> _screen: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), x: int, y: int <span class="Delimiter">{</span>
<span id="L171" class="LineNr">171 </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="L172" class="LineNr">172 </span> <span class="Delimiter">{</span>
<span id="L173" class="LineNr">173 </span> compare <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0</span>
<span id="L174" class="LineNr">174 </span> <span class="PreProc">break-if-!=</span>
<span id="L175" class="LineNr">175 </span> <a href='103grapheme.subx.html#L109'>set-cursor-position-on-real-screen</a> x, y
<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"># fake screen</span>
<span id="L179" class="LineNr">179 </span> <span class="muComment"># ignore x &lt; 0</span>
<span id="L180" class="LineNr">180 </span> <span class="Delimiter">{</span>
<span id="L181" class="LineNr">181 </span> compare x, <span class="Constant">0</span>
<span id="L182" class="LineNr">182 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L183" class="LineNr">183 </span> <span class="PreProc">return</span>
<span id="L184" class="LineNr">184 </span> <span class="Delimiter">}</span>
<span id="L185" class="LineNr">185 </span> <span class="muComment"># ignore x &gt;= width</span>
<span id="L186" class="LineNr">186 </span> <span class="Delimiter">{</span>
<span id="L187" class="LineNr">187 </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="L188" class="LineNr">188 </span> <span class="PreProc">var</span> width/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy *width-addr
<span id="L189" class="LineNr">189 </span> compare x, width
<span id="L190" class="LineNr">190 </span> <span class="PreProc">break-if-&lt;=</span>
<span id="L191" class="LineNr">191 </span> <span class="PreProc">return</span>
<span id="L192" class="LineNr">192 </span> <span class="Delimiter">}</span>
<span id="L193" class="LineNr">193 </span> <span class="muComment"># ignore y &lt; 0</span>
<span id="L194" class="LineNr">194 </span> <span class="Delimiter">{</span>
<span id="L195" class="LineNr">195 </span> compare y, <span class="Constant">0</span>
<span id="L196" class="LineNr">196 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L197" class="LineNr">197 </span> <span class="PreProc">return</span>
<span id="L198" class="LineNr">198 </span> <span class="Delimiter">}</span>
<span id="L199" class="LineNr">199 </span> <span class="muComment"># ignore y &gt;= height</span>
<span id="L200" class="LineNr">200 </span> <span class="Delimiter">{</span>
<span id="L201" class="LineNr">201 </span> <span class="PreProc">var</span> height-addr/<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="L202" class="LineNr">202 </span> <span class="PreProc">var</span> height/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy *height-addr
<span id="L203" class="LineNr">203 </span> compare y, height
<span id="L204" class="LineNr">204 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L205" class="LineNr">205 </span> <span class="PreProc">return</span>
<span id="L206" class="LineNr">206 </span> <span class="Delimiter">}</span>
<span id="L207" class="LineNr">207 </span> <span class="muComment"># screen-&gt;cursor-x = x</span>
<span id="L208" class="LineNr">208 </span> <span class="PreProc">var</span> dest/<span class="Constant">edi</span>: (addr int) <span class="Special">&lt;-</span> get <a href='500fake-screen.mu.html#L14'>screen</a>, cursor-x
<span id="L209" class="LineNr">209 </span> <span class="PreProc">var</span> src/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy x
<span id="L210" class="LineNr">210 </span> copy-to *dest, src
<span id="L211" class="LineNr">211 </span> <span class="muComment"># screen-&gt;cursor-y = y</span>
<span id="L212" class="LineNr">212 </span> dest <span class="Special">&lt;-</span> get <a href='500fake-screen.mu.html#L14'>screen</a>, cursor-y
<span id="L213" class="LineNr">213 </span> src <span class="Special">&lt;-</span> copy y
<span id="L214" class="LineNr">214 </span> copy-to *dest, src
<span id="L215" class="LineNr">215 </span><span class="Delimiter">}</span>
<span id="L216" class="LineNr">216 </span>
<span id="L217" class="LineNr">217 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='500fake-screen.mu.html#L217'>draw-cursor</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), g: grapheme <span class="Delimiter">{</span>
<span id="L218" class="LineNr">218 </span> <span class="Delimiter">{</span>
<span id="L219" class="LineNr">219 </span> compare <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0</span>
<span id="L220" class="LineNr">220 </span> <span class="PreProc">break-if-!=</span>
<span id="L221" class="LineNr">221 </span> <a href='103grapheme.subx.html#L134'>draw-cursor-on-real-screen</a> g
<span id="L222" class="LineNr">222 </span> <span class="PreProc">return</span>
<span id="L223" class="LineNr">223 </span> <span class="Delimiter">}</span>
<span id="L224" class="LineNr">224 </span> <span class="muComment"># fake screen</span>
<span id="L225" class="LineNr">225 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L226" class="LineNr">226 </span> <span class="PreProc">var</span> cursor-y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L227" class="LineNr">227 </span> cursor-x, cursor-y <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L154'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L228" class="LineNr">228 </span> <a href='500fake-screen.mu.html#L88'>draw-grapheme</a> <a href='500fake-screen.mu.html#L14'>screen</a>, g, cursor-x, cursor-y, <span class="Constant">0</span>/fg, <span class="Constant">7</span>/bg
<span id="L229" class="LineNr">229 </span><span class="Delimiter">}</span>
<span id="L230" class="LineNr">230 </span>
<span id="L231" class="LineNr">231 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='500fake-screen.mu.html#L231'>clear-screen</a></span> _screen: (addr <a href='500fake-screen.mu.html#L14'>screen</a>) <span class="Delimiter">{</span>
<span id="L232" class="LineNr">232 </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="L233" class="LineNr">233 </span> <span class="Delimiter">{</span>
<span id="L234" class="LineNr">234 </span> compare <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0</span>
<span id="L235" class="LineNr">235 </span> <span class="PreProc">break-if-!=</span>
<span id="L236" class="LineNr">236 </span> <a href='500fake-screen.mu.html#L365'>clear-real-screen</a>
<span id="L237" class="LineNr">237 </span> <span class="PreProc">return</span>
<span id="L238" class="LineNr">238 </span> <span class="Delimiter">}</span>
<span id="L239" class="LineNr">239 </span> <span class="muComment"># fake screen</span>
<span id="L240" class="LineNr">240 </span> <a href='500fake-screen.mu.html#L170'>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="L241" class="LineNr">241 </span> <span class="PreProc">var</span> y/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L242" class="LineNr">242 </span> <span class="PreProc">var</span> height/<span class="Constant">ecx</span>: (addr int) <span class="Special">&lt;-</span> get <a href='500fake-screen.mu.html#L14'>screen</a>, height
<span id="L243" class="LineNr">243 </span> <span class="Delimiter">{</span>
<span id="L244" class="LineNr">244 </span> compare y, *height
<span id="L245" class="LineNr">245 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L246" class="LineNr">246 </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="L247" class="LineNr">247 </span> <span class="PreProc">var</span> width/<span class="Constant">ebx</span>: (addr int) <span class="Special">&lt;-</span> get <a href='500fake-screen.mu.html#L14'>screen</a>, width
<span id="L248" class="LineNr">248 </span> <span class="Delimiter">{</span>
<span id="L249" class="LineNr">249 </span> compare x, *width
<span id="L250" class="LineNr">250 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L251" class="LineNr">251 </span> <a href='500fake-screen.mu.html#L114'>draw-code-point</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x20</span>/space, x, y, <span class="Constant">0</span>/fg=black, <span class="Constant">0</span>/bg=black
<span id="L252" class="LineNr">252 </span> x <span class="Special">&lt;-</span> increment
<span id="L253" class="LineNr">253 </span> <span class="PreProc">loop</span>
<span id="L254" class="LineNr">254 </span> <span class="Delimiter">}</span>
<span id="L255" class="LineNr">255 </span> y <span class="Special">&lt;-</span> increment
<span id="L256" class="LineNr">256 </span> <span class="PreProc">loop</span>
<span id="L257" class="LineNr">257 </span> <span class="Delimiter">}</span>
<span id="L258" class="LineNr">258 </span> <a href='500fake-screen.mu.html#L170'>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="L259" class="LineNr">259 </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="L260" class="LineNr">260 </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="L261" class="LineNr">261 </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="L262" class="LineNr">262 </span> <span class="PreProc">var</span> max/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> length pixels
<span id="L263" class="LineNr">263 </span> <span class="Delimiter">{</span>
<span id="L264" class="LineNr">264 </span> compare i, max
<span id="L265" class="LineNr">265 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L266" class="LineNr">266 </span> <span class="PreProc">var</span> curr/<span class="Constant">eax</span>: (addr byte) <span class="Special">&lt;-</span> index pixels, i
<span id="L267" class="LineNr">267 </span> <span class="PreProc">var</span> zero/<span class="Constant">ebx</span>: byte <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L268" class="LineNr">268 </span> copy-byte-to *curr, zero
<span id="L269" class="LineNr">269 </span> i <span class="Special">&lt;-</span> increment
<span id="L270" class="LineNr">270 </span> <span class="PreProc">loop</span>
<span id="L271" class="LineNr">271 </span> <span class="Delimiter">}</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="muFunction"><a href='500fake-screen.mu.html#L274'>fake-screen-empty?</a></span> _screen: (addr <a href='500fake-screen.mu.html#L14'>screen</a>)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean <span class="Delimiter">{</span>
<span id="L275" class="LineNr">275 </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="L276" class="LineNr">276 </span> <span class="PreProc">var</span> y/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L277" class="LineNr">277 </span> <span class="PreProc">var</span> height/<span class="Constant">ecx</span>: (addr int) <span class="Special">&lt;-</span> get <a href='500fake-screen.mu.html#L14'>screen</a>, height
<span id="L278" class="LineNr">278 </span> <span class="Delimiter">{</span>
<span id="L279" class="LineNr">279 </span> compare y, *height
<span id="L280" class="LineNr">280 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L281" class="LineNr">281 </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="L282" class="LineNr">282 </span> <span class="PreProc">var</span> width/<span class="Constant">ebx</span>: (addr int) <span class="Special">&lt;-</span> get <a href='500fake-screen.mu.html#L14'>screen</a>, width
<span id="L283" class="LineNr">283 </span> <span class="Delimiter">{</span>
<span id="L284" class="LineNr">284 </span> compare x, *width
<span id="L285" class="LineNr">285 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L286" class="LineNr">286 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L407'>screen-grapheme-at</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y
<span id="L287" class="LineNr">287 </span> <span class="Delimiter">{</span>
<span id="L288" class="LineNr">288 </span> compare g, <span class="Constant">0</span>
<span id="L289" class="LineNr">289 </span> <span class="PreProc">break-if-=</span>
<span id="L290" class="LineNr">290 </span> compare g, <span class="Constant">0x20</span>/space
<span id="L291" class="LineNr">291 </span> <span class="PreProc">break-if-=</span>
<span id="L292" class="LineNr">292 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L293" class="LineNr">293 </span> <span class="Delimiter">}</span>
<span id="L294" class="LineNr">294 </span> x <span class="Special">&lt;-</span> increment
<span id="L295" class="LineNr">295 </span> <span class="PreProc">loop</span>
<span id="L296" class="LineNr">296 </span> <span class="Delimiter">}</span>
<span id="L297" class="LineNr">297 </span> y <span class="Special">&lt;-</span> increment
<span id="L298" class="LineNr">298 </span> <span class="PreProc">loop</span>
<span id="L299" class="LineNr">299 </span> <span class="Delimiter">}</span>
<span id="L300" class="LineNr">300 </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="L301" class="LineNr">301 </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="L302" class="LineNr">302 </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="L303" class="LineNr">303 </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="L304" class="LineNr">304 </span> <span class="PreProc">var</span> height/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy *height-addr
<span id="L305" class="LineNr">305 </span> height <span class="Special">&lt;-</span> shift-left <span class="Constant">4</span>/log2-font-height
<span id="L306" class="LineNr">306 </span> <span class="Delimiter">{</span>
<span id="L307" class="LineNr">307 </span> compare y, height
<span id="L308" class="LineNr">308 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L309" class="LineNr">309 </span> <span class="PreProc">var</span> width-addr/<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="L310" class="LineNr">310 </span> <span class="PreProc">var</span> width/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy *width-addr
<span id="L311" class="LineNr">311 </span> width <span class="Special">&lt;-</span> shift-left <span class="Constant">3</span>/log2-font-width
<span id="L312" class="LineNr">312 </span> <span class="PreProc">var</span> x/<span class="Constant">edi</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L313" class="LineNr">313 </span> <span class="Delimiter">{</span>
<span id="L314" class="LineNr">314 </span> compare x, width
<span id="L315" class="LineNr">315 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L316" class="LineNr">316 </span> <span class="PreProc">var</span> idx/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L485'>pixel-index</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y
<span id="L317" class="LineNr">317 </span> <span class="PreProc">var</span> color-addr/<span class="Constant">ecx</span>: (addr byte) <span class="Special">&lt;-</span> index pixels, idx
<span id="L318" class="LineNr">318 </span> <span class="PreProc">var</span> color/<span class="Constant">ecx</span>: byte <span class="Special">&lt;-</span> copy-byte *color-addr
<span id="L319" class="LineNr">319 </span> compare color, <span class="Constant">0</span>
<span id="L320" class="LineNr">320 </span> <span class="Delimiter">{</span>
<span id="L321" class="LineNr">321 </span> <span class="PreProc">break-if-=</span>
<span id="L322" class="LineNr">322 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L323" class="LineNr">323 </span> <span class="Delimiter">}</span>
<span id="L324" class="LineNr">324 </span> x <span class="Special">&lt;-</span> increment
<span id="L325" class="LineNr">325 </span> <span class="PreProc">loop</span>
<span id="L326" class="LineNr">326 </span> <span class="Delimiter">}</span>
<span id="L327" class="LineNr">327 </span> y <span class="Special">&lt;-</span> increment
<span id="L328" class="LineNr">328 </span> <span class="PreProc">loop</span>
<span id="L329" class="LineNr">329 </span> <span class="Delimiter">}</span>
<span id="L330" class="LineNr">330 </span> <span class="PreProc">return</span> <span class="Constant">1</span>/true
<span id="L331" class="LineNr">331 </span><span class="Delimiter">}</span>
<span id="L332" class="LineNr">332 </span>
<span id="L333" class="LineNr">333 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='500fake-screen.mu.html#L333'>clear-rect</a></span> _screen: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), xmin: int, ymin: int, xmax: int, ymax: int, background-color: int <span class="Delimiter">{</span>
<span id="L334" class="LineNr">334 </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="L335" class="LineNr">335 </span> <span class="Delimiter">{</span>
<span id="L336" class="LineNr">336 </span> compare <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0</span>
<span id="L337" class="LineNr">337 </span> <span class="PreProc">break-if-!=</span>
<span id="L338" class="LineNr">338 </span> <a href='500fake-screen.mu.html#L383'>clear-rect-on-real-screen</a> xmin, ymin, xmax, ymax, background-color
<span id="L339" class="LineNr">339 </span> <span class="PreProc">return</span>
<span id="L340" class="LineNr">340 </span> <span class="Delimiter">}</span>
<span id="L341" class="LineNr">341 </span> <span class="muComment"># fake screen</span>
<span id="L342" class="LineNr">342 </span> <a href='500fake-screen.mu.html#L170'>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="L343" class="LineNr">343 </span> <span class="PreProc">var</span> y/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy ymin
<span id="L344" class="LineNr">344 </span> <span class="PreProc">var</span> ymax/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy ymax
<span id="L345" class="LineNr">345 </span> <span class="Delimiter">{</span>
<span id="L346" class="LineNr">346 </span> compare y, ymax
<span id="L347" class="LineNr">347 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L348" class="LineNr">348 </span> <span class="PreProc">var</span> x/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy xmin
<span id="L349" class="LineNr">349 </span> <span class="PreProc">var</span> xmax/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy xmax
<span id="L350" class="LineNr">350 </span> <span class="Delimiter">{</span>
<span id="L351" class="LineNr">351 </span> compare x, xmax
<span id="L352" class="LineNr">352 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L353" class="LineNr">353 </span> <a href='500fake-screen.mu.html#L114'>draw-code-point</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x20</span>/space, x, y, <span class="Constant">0</span>/fg, background-color
<span id="L354" class="LineNr">354 </span> x <span class="Special">&lt;-</span> increment
<span id="L355" class="LineNr">355 </span> <span class="PreProc">loop</span>
<span id="L356" class="LineNr">356 </span> <span class="Delimiter">}</span>
<span id="L357" class="LineNr">357 </span> y <span class="Special">&lt;-</span> increment
<span id="L358" class="LineNr">358 </span> <span class="PreProc">loop</span>
<span id="L359" class="LineNr">359 </span> <span class="Delimiter">}</span>
<span id="L360" class="LineNr">360 </span> <a href='500fake-screen.mu.html#L170'>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="L361" class="LineNr">361 </span><span class="Delimiter">}</span>
<span id="L362" class="LineNr">362 </span>
<span id="L363" class="LineNr">363 </span><span class="muComment"># there's no grapheme that guarantees to cover every pixel, so we'll bump down</span>
<span id="L364" class="LineNr">364 </span><span class="muComment"># to pixels for a real screen</span>
<span id="L365" class="LineNr">365 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='500fake-screen.mu.html#L365'>clear-real-screen</a></span> <span class="Delimiter">{</span>
<span id="L366" class="LineNr">366 </span> <span class="PreProc">var</span> y/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L367" class="LineNr">367 </span> <span class="Delimiter">{</span>
<span id="L368" class="LineNr">368 </span> compare y, <span class="Constant">0x300</span>/screen-height=<span class="Constant">768</span>
<span id="L369" class="LineNr">369 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L370" class="LineNr">370 </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="L371" class="LineNr">371 </span> <span class="Delimiter">{</span>
<span id="L372" class="LineNr">372 </span> compare x, <span class="Constant">0x400</span>/screen-width=<span class="Constant">1024</span>
<span id="L373" class="LineNr">373 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L374" class="LineNr">374 </span> <a href='101screen.subx.html#L8'>pixel-on-real-screen</a> x, y, <span class="Constant">0</span>/color=black
<span id="L375" class="LineNr">375 </span> x <span class="Special">&lt;-</span> increment
<span id="L376" class="LineNr">376 </span> <span class="PreProc">loop</span>
<span id="L377" class="LineNr">377 </span> <span class="Delimiter">}</span>
<span id="L378" class="LineNr">378 </span> y <span class="Special">&lt;-</span> increment
<span id="L379" class="LineNr">379 </span> <span class="PreProc">loop</span>
<span id="L380" class="LineNr">380 </span> <span class="Delimiter">}</span>
<span id="L381" class="LineNr">381 </span><span class="Delimiter">}</span>
<span id="L382" class="LineNr">382 </span>
<span id="L383" class="LineNr">383 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='500fake-screen.mu.html#L383'>clear-rect-on-real-screen</a></span> xmin: int, ymin: int, xmax: int, ymax: int, background-color: int <span class="Delimiter">{</span>
<span id="L384" class="LineNr">384 </span> <span class="PreProc">var</span> y/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy ymin
<span id="L385" class="LineNr">385 </span> y <span class="Special">&lt;-</span> shift-left <span class="Constant">4</span>/log2-font-height
<span id="L386" class="LineNr">386 </span> <span class="PreProc">var</span> ymax/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy ymax
<span id="L387" class="LineNr">387 </span> ymax <span class="Special">&lt;-</span> shift-left <span class="Constant">4</span>/log2-font-height
<span id="L388" class="LineNr">388 </span> <span class="Delimiter">{</span>
<span id="L389" class="LineNr">389 </span> compare y, ymax
<span id="L390" class="LineNr">390 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L391" class="LineNr">391 </span> <span class="PreProc">var</span> x/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy xmin
<span id="L392" class="LineNr">392 </span> x <span class="Special">&lt;-</span> shift-left <span class="Constant">3</span>/log2-font-width
<span id="L393" class="LineNr">393 </span> <span class="PreProc">var</span> xmax/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy xmax
<span id="L394" class="LineNr">394 </span> xmax <span class="Special">&lt;-</span> shift-left <span class="Constant">3</span>/log2-font-width
<span id="L395" class="LineNr">395 </span> <span class="Delimiter">{</span>
<span id="L396" class="LineNr">396 </span> compare x, xmax
<span id="L397" class="LineNr">397 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L398" class="LineNr">398 </span> <a href='101screen.subx.html#L8'>pixel-on-real-screen</a> x, y, background-color
<span id="L399" class="LineNr">399 </span> x <span class="Special">&lt;-</span> increment
<span id="L400" class="LineNr">400 </span> <span class="PreProc">loop</span>
<span id="L401" class="LineNr">401 </span> <span class="Delimiter">}</span>
<span id="L402" class="LineNr">402 </span> y <span class="Special">&lt;-</span> increment
<span id="L403" class="LineNr">403 </span> <span class="PreProc">loop</span>
<span id="L404" class="LineNr">404 </span> <span class="Delimiter">}</span>
<span id="L405" class="LineNr">405 </span><span class="Delimiter">}</span>
<span id="L406" class="LineNr">406 </span>
<span id="L407" class="LineNr">407 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='500fake-screen.mu.html#L407'>screen-grapheme-at</a></span> _screen: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), x: int, y: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: grapheme <span class="Delimiter">{</span>
<span id="L408" class="LineNr">408 </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="L409" class="LineNr">409 </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="L410" class="LineNr">410 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L414'>screen-grapheme-at-idx</a> <a href='500fake-screen.mu.html#L14'>screen</a>, idx
<span id="L411" class="LineNr">411 </span> <span class="PreProc">return</span> result
<span id="L412" class="LineNr">412 </span><span class="Delimiter">}</span>
<span id="L413" class="LineNr">413 </span>
<span id="L414" class="LineNr">414 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='500fake-screen.mu.html#L414'>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="L415" class="LineNr">415 </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="L416" class="LineNr">416 </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="L417" class="LineNr">417 </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="L418" class="LineNr">418 </span> <span class="PreProc">var</span> idx/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy idx-on-stack
<span id="L419" class="LineNr">419 </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="L420" class="LineNr">420 </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
<span id="L421" class="LineNr">421 </span> <span class="PreProc">var</span> src/<span class="Constant">eax</span>: (addr grapheme) <span class="Special">&lt;-</span> get cell, data
<span id="L422" class="LineNr">422 </span> <span class="PreProc">return</span> *src
<span id="L423" class="LineNr">423 </span><span class="Delimiter">}</span>
<span id="L424" class="LineNr">424 </span>
<span id="L425" class="LineNr">425 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='500fake-screen.mu.html#L425'>screen-color-at</a></span> _screen: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), x: int, y: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
<span id="L426" class="LineNr">426 </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="L427" class="LineNr">427 </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="L428" class="LineNr">428 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L432'>screen-color-at-idx</a> <a href='500fake-screen.mu.html#L14'>screen</a>, idx
<span id="L429" class="LineNr">429 </span> <span class="PreProc">return</span> result
<span id="L430" class="LineNr">430 </span><span class="Delimiter">}</span>
<span id="L431" class="LineNr">431 </span>
<span id="L432" class="LineNr">432 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='500fake-screen.mu.html#L432'>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="L433" class="LineNr">433 </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="L434" class="LineNr">434 </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="L435" class="LineNr">435 </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="L436" class="LineNr">436 </span> <span class="PreProc">var</span> idx/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy idx-on-stack
<span id="L437" class="LineNr">437 </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="L438" class="LineNr">438 </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
<span id="L439" class="LineNr">439 </span> <span class="PreProc">var</span> src/<span class="Constant">eax</span>: (addr int) <span class="Special">&lt;-</span> get cell, color
<span id="L440" class="LineNr">440 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy *src
<span id="L441" class="LineNr">441 </span> <span class="PreProc">return</span> result
<span id="L442" class="LineNr">442 </span><span class="Delimiter">}</span>
<span id="L443" class="LineNr">443 </span>
<span id="L444" class="LineNr">444 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='500fake-screen.mu.html#L444'>screen-background-color-at</a></span> _screen: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), x: int, y: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
<span id="L445" class="LineNr">445 </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="L446" class="LineNr">446 </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="L447" class="LineNr">447 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L451'>screen-background-color-at-idx</a> <a href='500fake-screen.mu.html#L14'>screen</a>, idx
<span id="L448" class="LineNr">448 </span> <span class="PreProc">return</span> result
<span id="L449" class="LineNr">449 </span><span class="Delimiter">}</span>
<span id="L450" class="LineNr">450 </span>
<span id="L451" class="LineNr">451 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='500fake-screen.mu.html#L451'>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="L452" class="LineNr">452 </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="L453" class="LineNr">453 </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="L454" class="LineNr">454 </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="L455" class="LineNr">455 </span> <span class="PreProc">var</span> idx/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy idx-on-stack
<span id="L456" class="LineNr">456 </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="L457" class="LineNr">457 </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
<span id="L458" class="LineNr">458 </span> <span class="PreProc">var</span> src/<span class="Constant">eax</span>: (addr int) <span class="Special">&lt;-</span> get cell, background-color
<span id="L459" class="LineNr">459 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy *src
<span id="L460" class="LineNr">460 </span> <span class="PreProc">return</span> result
<span id="L461" class="LineNr">461 </span><span class="Delimiter">}</span>
<span id="L462" class="LineNr">462 </span>
<span id="L463" class="LineNr">463 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='500fake-screen.mu.html#L463'>pixel</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), x: int, y: int, color: int <span class="Delimiter">{</span>
<span id="L464" class="LineNr">464 </span> <span class="Delimiter">{</span>
<span id="L465" class="LineNr">465 </span> compare <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0</span>
<span id="L466" class="LineNr">466 </span> <span class="PreProc">break-if-!=</span>
<span id="L467" class="LineNr">467 </span> <a href='101screen.subx.html#L8'>pixel-on-real-screen</a> x, y, color
<span id="L468" class="LineNr">468 </span> <span class="PreProc">return</span>
<span id="L469" class="LineNr">469 </span> <span class="Delimiter">}</span>
<span id="L470" class="LineNr">470 </span> <span class="muComment"># fake screen</span>
<span id="L471" class="LineNr">471 </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="L472" class="LineNr">472 </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="L473" class="LineNr">473 </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="L474" class="LineNr">474 </span> <span class="Delimiter">{</span>
<span id="L475" class="LineNr">475 </span> compare pixels, <span class="Constant">0</span>
<span id="L476" class="LineNr">476 </span> <span class="PreProc">break-if-!=</span>
<span id="L477" class="LineNr">477 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;pixel graphics not enabled for this screen&quot;</span>
<span id="L478" class="LineNr">478 </span> <span class="Delimiter">}</span>
<span id="L479" class="LineNr">479 </span> <span class="PreProc">var</span> idx/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L485'>pixel-index</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y
<span id="L480" class="LineNr">480 </span> <span class="PreProc">var</span> dest/<span class="Constant">ecx</span>: (addr byte) <span class="Special">&lt;-</span> index pixels, idx
<span id="L481" class="LineNr">481 </span> <span class="PreProc">var</span> src/<span class="Constant">eax</span>: byte <span class="Special">&lt;-</span> copy-byte color
<span id="L482" class="LineNr">482 </span> copy-byte-to *dest, src
<span id="L483" class="LineNr">483 </span><span class="Delimiter">}</span>
<span id="L484" class="LineNr">484 </span>
<span id="L485" class="LineNr">485 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='500fake-screen.mu.html#L485'>pixel-index</a></span> _screen: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), x: int, y: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
<span id="L486" class="LineNr">486 </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="L487" class="LineNr">487 </span> <span class="Delimiter">{</span>
<span id="L488" class="LineNr">488 </span> compare x, <span class="Constant">0</span>
<span id="L489" class="LineNr">489 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L490" class="LineNr">490 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;screen-cell-index: negative x&quot;</span>
<span id="L491" class="LineNr">491 </span> <span class="Delimiter">}</span>
<span id="L492" class="LineNr">492 </span> <span class="Delimiter">{</span>
<span id="L493" class="LineNr">493 </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
<span id="L494" class="LineNr">494 </span> <span class="PreProc">var</span> xmax/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy *xmax-a
<span id="L495" class="LineNr">495 </span> xmax <span class="Special">&lt;-</span> shift-left <span class="Constant">3</span>/log2-font-width
<span id="L496" class="LineNr">496 </span> compare x, xmax
<span id="L497" class="LineNr">497 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L498" class="LineNr">498 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;screen-cell-index: x too high&quot;</span>
<span id="L499" class="LineNr">499 </span> <span class="Delimiter">}</span>
<span id="L500" class="LineNr">500 </span> <span class="Delimiter">{</span>
<span id="L501" class="LineNr">501 </span> compare y, <span class="Constant">0</span>
<span id="L502" class="LineNr">502 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L503" class="LineNr">503 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;screen-cell-index: negative y&quot;</span>
<span id="L504" class="LineNr">504 </span> <span class="Delimiter">}</span>
<span id="L505" class="LineNr">505 </span> <span class="Delimiter">{</span>
<span id="L506" class="LineNr">506 </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
<span id="L507" class="LineNr">507 </span> <span class="PreProc">var</span> ymax/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy *ymax-a
<span id="L508" class="LineNr">508 </span> ymax <span class="Special">&lt;-</span> shift-left <span class="Constant">4</span>/log2-font-height
<span id="L509" class="LineNr">509 </span> compare y, ymax
<span id="L510" class="LineNr">510 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L511" class="LineNr">511 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;screen-cell-index: y too high&quot;</span>
<span id="L512" class="LineNr">512 </span> <span class="Delimiter">}</span>
<span id="L513" class="LineNr">513 </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="L514" class="LineNr">514 </span> <span class="PreProc">var</span> result/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy y
<span id="L515" class="LineNr">515 </span> result <span class="Special">&lt;-</span> multiply *width-addr
<span id="L516" class="LineNr">516 </span> result <span class="Special">&lt;-</span> shift-left <span class="Constant">3</span>/log2-font-width
<span id="L517" class="LineNr">517 </span> result <span class="Special">&lt;-</span> add x
<span id="L518" class="LineNr">518 </span> <span class="PreProc">return</span> result
<span id="L519" class="LineNr">519 </span><span class="Delimiter">}</span>
<span id="L520" class="LineNr">520 </span>
<span id="L521" class="LineNr">521 </span><span class="muComment"># double-buffering primitive</span>
<span id="L522" class="LineNr">522 </span><span class="muComment"># 'screen' must be a fake screen. 'target-screen' is usually real.</span>
<span id="L523" class="LineNr">523 </span><span class="muComment"># Both screens must have the same size.</span>
<span id="L524" class="LineNr">524 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='500fake-screen.mu.html#L524'>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="L525" class="LineNr">525 </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="L526" class="LineNr">526 </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="L527" class="LineNr">527 </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="L528" class="LineNr">528 </span> <span class="PreProc">var</span> pixels/<span class="Constant">edi</span>: (addr array byte) <span class="Special">&lt;-</span> copy _pixels
<span id="L529" class="LineNr">529 </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="L530" class="LineNr">530 </span> <span class="PreProc">var</span> width/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy *width-a
<span id="L531" class="LineNr">531 </span> width <span class="Special">&lt;-</span> shift-left <span class="Constant">3</span>/log2-font-width
<span id="L532" class="LineNr">532 </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="L533" class="LineNr">533 </span> <span class="PreProc">var</span> height/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy *height-a
<span id="L534" class="LineNr">534 </span> height <span class="Special">&lt;-</span> shift-left <span class="Constant">4</span>/log2-font-height
<span id="L535" class="LineNr">535 </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="L536" class="LineNr">536 </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="L537" class="LineNr">537 </span> <span class="Delimiter">{</span>
<span id="L538" class="LineNr">538 </span> <span class="muComment"># screen top left pixels x y width height</span>
<span id="L539" class="LineNr">539 </span> compare y, height
<span id="L540" class="LineNr">540 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L541" class="LineNr">541 </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="L542" class="LineNr">542 </span> <span class="Delimiter">{</span>
<span id="L543" class="LineNr">543 </span> compare x, width
<span id="L544" class="LineNr">544 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L545" class="LineNr">545 </span> <span class="Delimiter">{</span>
<span id="L546" class="LineNr">546 </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="L547" class="LineNr">547 </span> <span class="PreProc">var</span> color/<span class="Constant">ebx</span>: byte <span class="Special">&lt;-</span> copy-byte *color-addr
<span id="L548" class="LineNr">548 </span> <span class="PreProc">var</span> color2/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy color
<span id="L549" class="LineNr">549 </span> <a href='500fake-screen.mu.html#L463'>pixel</a> target-screen, x, y, color2
<span id="L550" class="LineNr">550 </span> <span class="Delimiter">}</span>
<span id="L551" class="LineNr">551 </span> x <span class="Special">&lt;-</span> increment
<span id="L552" class="LineNr">552 </span> i <span class="Special">&lt;-</span> increment
<span id="L553" class="LineNr">553 </span> <span class="PreProc">loop</span>
<span id="L554" class="LineNr">554 </span> <span class="Delimiter">}</span>
<span id="L555" class="LineNr">555 </span> y <span class="Special">&lt;-</span> increment
<span id="L556" class="LineNr">556 </span> <span class="PreProc">loop</span>
<span id="L557" class="LineNr">557 </span> <span class="Delimiter">}</span>
<span id="L558" class="LineNr">558 </span><span class="Delimiter">}</span>
</pre>
</body>
</html>

View File

@ -61,14 +61,14 @@ if ('onhashchange' in window) {
<span id="L3" class="LineNr"> 3 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L3'>move-cursor-left</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="L4" class="LineNr"> 4 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L5" class="LineNr"> 5 </span> <span class="PreProc">var</span> cursor-y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L6" class="LineNr"> 6 </span> cursor-x, cursor-y <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L153'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L6" class="LineNr"> 6 </span> cursor-x, cursor-y <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L154'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L7" class="LineNr"> 7 </span> compare cursor-x, <span class="Constant">0</span>
<span id="L8" class="LineNr"> 8 </span> <span class="Delimiter">{</span>
<span id="L9" class="LineNr"> 9 </span> <span class="PreProc">break-if-&gt;</span>
<span id="L10" class="LineNr"> 10 </span> <span class="PreProc">return</span>
<span id="L11" class="LineNr"> 11 </span> <span class="Delimiter">}</span>
<span id="L12" class="LineNr"> 12 </span> cursor-x <span class="Special">&lt;-</span> decrement
<span id="L13" class="LineNr"> 13 </span> <a href='500fake-screen.mu.html#L169'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, cursor-x, cursor-y
<span id="L13" class="LineNr"> 13 </span> <a href='500fake-screen.mu.html#L170'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, cursor-x, cursor-y
<span id="L14" class="LineNr"> 14 </span><span class="Delimiter">}</span>
<span id="L15" class="LineNr"> 15 </span>
<span id="L16" class="LineNr"> 16 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L16'>move-cursor-right</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>
@ -79,27 +79,27 @@ if ('onhashchange' in window) {
<span id="L21" class="LineNr"> 21 </span> limit <span class="Special">&lt;-</span> decrement
<span id="L22" class="LineNr"> 22 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L23" class="LineNr"> 23 </span> <span class="PreProc">var</span> cursor-y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L24" class="LineNr"> 24 </span> cursor-x, cursor-y <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L153'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L24" class="LineNr"> 24 </span> cursor-x, cursor-y <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L154'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L25" class="LineNr"> 25 </span> compare cursor-x, limit
<span id="L26" class="LineNr"> 26 </span> <span class="Delimiter">{</span>
<span id="L27" class="LineNr"> 27 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L28" class="LineNr"> 28 </span> <span class="PreProc">return</span>
<span id="L29" class="LineNr"> 29 </span> <span class="Delimiter">}</span>
<span id="L30" class="LineNr"> 30 </span> cursor-x <span class="Special">&lt;-</span> increment
<span id="L31" class="LineNr"> 31 </span> <a href='500fake-screen.mu.html#L169'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, cursor-x, cursor-y
<span id="L31" class="LineNr"> 31 </span> <a href='500fake-screen.mu.html#L170'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, cursor-x, cursor-y
<span id="L32" class="LineNr"> 32 </span><span class="Delimiter">}</span>
<span id="L33" class="LineNr"> 33 </span>
<span id="L34" class="LineNr"> 34 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L34'>move-cursor-up</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="L35" class="LineNr"> 35 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L36" class="LineNr"> 36 </span> <span class="PreProc">var</span> cursor-y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L37" class="LineNr"> 37 </span> cursor-x, cursor-y <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L153'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L37" class="LineNr"> 37 </span> cursor-x, cursor-y <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L154'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L38" class="LineNr"> 38 </span> compare cursor-y, <span class="Constant">0</span>
<span id="L39" class="LineNr"> 39 </span> <span class="Delimiter">{</span>
<span id="L40" class="LineNr"> 40 </span> <span class="PreProc">break-if-&gt;</span>
<span id="L41" class="LineNr"> 41 </span> <span class="PreProc">return</span>
<span id="L42" class="LineNr"> 42 </span> <span class="Delimiter">}</span>
<span id="L43" class="LineNr"> 43 </span> cursor-y <span class="Special">&lt;-</span> decrement
<span id="L44" class="LineNr"> 44 </span> <a href='500fake-screen.mu.html#L169'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, cursor-x, cursor-y
<span id="L44" class="LineNr"> 44 </span> <a href='500fake-screen.mu.html#L170'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, cursor-x, cursor-y
<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='501draw-text.mu.html#L47'>move-cursor-down</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>
@ -110,14 +110,14 @@ if ('onhashchange' in window) {
<span id="L52" class="LineNr"> 52 </span> limit <span class="Special">&lt;-</span> decrement
<span id="L53" class="LineNr"> 53 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L54" class="LineNr"> 54 </span> <span class="PreProc">var</span> cursor-y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L55" class="LineNr"> 55 </span> cursor-x, cursor-y <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L153'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L55" class="LineNr"> 55 </span> cursor-x, cursor-y <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L154'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L56" class="LineNr"> 56 </span> compare cursor-y, limit
<span id="L57" class="LineNr"> 57 </span> <span class="Delimiter">{</span>
<span id="L58" class="LineNr"> 58 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L59" class="LineNr"> 59 </span> <span class="PreProc">return</span>
<span id="L60" class="LineNr"> 60 </span> <span class="Delimiter">}</span>
<span id="L61" class="LineNr"> 61 </span> cursor-y <span class="Special">&lt;-</span> increment
<span id="L62" class="LineNr"> 62 </span> <a href='500fake-screen.mu.html#L169'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, cursor-x, cursor-y
<span id="L62" class="LineNr"> 62 </span> <a href='500fake-screen.mu.html#L170'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, cursor-x, cursor-y
<span id="L63" class="LineNr"> 63 </span><span class="Delimiter">}</span>
<span id="L64" class="LineNr"> 64 </span>
<span id="L65" class="LineNr"> 65 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L65'>move-cursor-to-left-margin-of-next-line</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>
@ -128,7 +128,7 @@ if ('onhashchange' in window) {
<span id="L70" class="LineNr"> 70 </span> limit <span class="Special">&lt;-</span> decrement
<span id="L71" class="LineNr"> 71 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L72" class="LineNr"> 72 </span> <span class="PreProc">var</span> cursor-y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L73" class="LineNr"> 73 </span> cursor-x, cursor-y <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L153'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L73" class="LineNr"> 73 </span> cursor-x, cursor-y <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L154'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L74" class="LineNr"> 74 </span> compare cursor-y, limit
<span id="L75" class="LineNr"> 75 </span> <span class="Delimiter">{</span>
<span id="L76" class="LineNr"> 76 </span> <span class="PreProc">break-if-&lt;</span>
@ -136,13 +136,13 @@ if ('onhashchange' in window) {
<span id="L78" class="LineNr"> 78 </span> <span class="Delimiter">}</span>
<span id="L79" class="LineNr"> 79 </span> cursor-y <span class="Special">&lt;-</span> increment
<span id="L80" class="LineNr"> 80 </span> cursor-x <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L81" class="LineNr"> 81 </span> <a href='500fake-screen.mu.html#L169'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, cursor-x, cursor-y
<span id="L81" class="LineNr"> 81 </span> <a href='500fake-screen.mu.html#L170'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, cursor-x, cursor-y
<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='501draw-text.mu.html#L84'>draw-grapheme-at-cursor</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), g: grapheme, color: int, background-color: int <span class="Delimiter">{</span>
<span id="L85" class="LineNr"> 85 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L86" class="LineNr"> 86 </span> <span class="PreProc">var</span> cursor-y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L87" class="LineNr"> 87 </span> cursor-x, cursor-y <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L153'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L87" class="LineNr"> 87 </span> cursor-x, cursor-y <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L154'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L88" class="LineNr"> 88 </span> <a href='500fake-screen.mu.html#L88'>draw-grapheme</a> <a href='500fake-screen.mu.html#L14'>screen</a>, g, cursor-x, cursor-y, color, background-color
<span id="L89" class="LineNr"> 89 </span><span class="Delimiter">}</span>
<span id="L90" class="LineNr"> 90 </span>
@ -156,7 +156,7 @@ if ('onhashchange' in window) {
<span id="L98" class="LineNr"> 98 </span><span class="muComment"># return the next 'x' coordinate</span>
<span id="L99" class="LineNr"> 99 </span><span class="muComment"># if there isn't enough space, truncate</span>
<span id="L100" class="LineNr">100 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L100'>draw-text-rightward</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), x: int, xmax: int, y: int, color: int, background-color: 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> stream-storage: (stream byte <span class="Constant">0x100</span>)
<span id="L101" class="LineNr">101 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x200</span>/print-buffer-size)
<span id="L102" class="LineNr">102 </span> <span class="PreProc">var</span> stream/<span class="Constant">esi</span>: (addr stream byte) <span class="Special">&lt;-</span> address stream-storage
<span id="L103" class="LineNr">103 </span> <a href='108write.subx.html#L11'>write</a> stream, text
<span id="L104" class="LineNr">104 </span> <span class="PreProc">var</span> xcurr/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L111'>draw-stream-rightward</a> <a href='500fake-screen.mu.html#L14'>screen</a>, stream, x, xmax, y, color, background-color
@ -176,7 +176,7 @@ if ('onhashchange' in window) {
<span id="L118" class="LineNr">118 </span> xcurr <span class="Special">&lt;-</span> increment
<span id="L119" class="LineNr">119 </span> <span class="PreProc">loop</span>
<span id="L120" class="LineNr">120 </span> <span class="Delimiter">}</span>
<span id="L121" class="LineNr">121 </span> <a href='500fake-screen.mu.html#L169'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, xcurr, y
<span id="L121" class="LineNr">121 </span> <a href='500fake-screen.mu.html#L170'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, xcurr, y
<span id="L122" class="LineNr">122 </span> <span class="PreProc">return</span> xcurr
<span id="L123" class="LineNr">123 </span><span class="Delimiter">}</span>
<span id="L124" class="LineNr">124 </span>
@ -191,348 +191,369 @@ if ('onhashchange' in window) {
<span id="L133" class="LineNr">133 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L133'>draw-text-rightward-from-cursor</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), xmax: int, color: int, background-color: int <span class="Delimiter">{</span>
<span id="L134" class="LineNr">134 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L135" class="LineNr">135 </span> <span class="PreProc">var</span> cursor-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> cursor-x, cursor-y <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L153'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L136" class="LineNr">136 </span> cursor-x, cursor-y <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L154'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L137" class="LineNr">137 </span> cursor-x <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>, text, cursor-x, xmax, cursor-y, color, background-color
<span id="L138" class="LineNr">138 </span> <a href='500fake-screen.mu.html#L169'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, cursor-x, cursor-y
<span id="L138" class="LineNr">138 </span> <a href='500fake-screen.mu.html#L170'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, cursor-x, cursor-y
<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='501draw-text.mu.html#L141'>render-grapheme</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), g: grapheme, xmin: int, ymin: int, xmax: int, ymax: int, x: int, y: int, color: int, background-color: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
<span id="L142" class="LineNr">142 </span> compare g, <span class="Constant">0xa</span>/newline
<span id="L143" class="LineNr">143 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy x
<span id="L144" class="LineNr">144 </span> <span class="Delimiter">{</span>
<span id="L145" class="LineNr">145 </span> <span class="PreProc">break-if-!=</span>
<span id="L146" class="LineNr">146 </span> <span class="muComment"># minimum effort to clear cursor</span>
<span id="L147" class="LineNr">147 </span> <a href='500fake-screen.mu.html#L114'>draw-code-point</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x20</span>/space, x, y, color, background-color
<span id="L148" class="LineNr">148 </span> x <span class="Special">&lt;-</span> copy xmin
<span id="L149" class="LineNr">149 </span> increment y
<span id="L150" class="LineNr">150 </span> <span class="PreProc">return</span> x, y
<span id="L151" class="LineNr">151 </span> <span class="Delimiter">}</span>
<span id="L152" class="LineNr">152 </span> <a href='500fake-screen.mu.html#L88'>draw-grapheme</a> <a href='500fake-screen.mu.html#L14'>screen</a>, g, x, y, color, background-color
<span id="L153" class="LineNr">153 </span> x <span class="Special">&lt;-</span> increment
<span id="L154" class="LineNr">154 </span> compare x, xmax
<span id="L155" class="LineNr">155 </span> <span class="Delimiter">{</span>
<span id="L156" class="LineNr">156 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L157" class="LineNr">157 </span> x <span class="Special">&lt;-</span> copy xmin
<span id="L158" class="LineNr">158 </span> increment y
<span id="L159" class="LineNr">159 </span> <span class="Delimiter">}</span>
<span id="L160" class="LineNr">160 </span> <span class="PreProc">return</span> x, y
<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="muComment"># draw text in the rectangle from (xmin, ymin) to (xmax, ymax), starting from (x, y), wrapping as necessary</span>
<span id="L164" class="LineNr">164 </span><span class="muComment"># return the next (x, y) coordinate in raster order where drawing stopped</span>
<span id="L165" class="LineNr">165 </span><span class="muComment"># that way the caller can draw more if given the same min and max bounding-box.</span>
<span id="L166" class="LineNr">166 </span><span class="muComment"># if there isn't enough space, truncate</span>
<span id="L167" class="LineNr">167 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L167'>draw-text-wrapping-right-then-down</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), xmin: int, ymin: int, xmax: int, ymax: int, _x: int, _y: int, color: int, background-color: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
<span id="L168" class="LineNr">168 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x100</span>)
<span id="L169" class="LineNr">169 </span> <span class="PreProc">var</span> stream/<span class="Constant">esi</span>: (addr stream byte) <span class="Special">&lt;-</span> address stream-storage
<span id="L170" class="LineNr">170 </span> <a href='108write.subx.html#L11'>write</a> stream, text
<span id="L171" class="LineNr">171 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy _x
<span id="L172" class="LineNr">172 </span> <span class="PreProc">var</span> y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy _y
<span id="L173" class="LineNr">173 </span> x, y <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L181'>draw-stream-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L14'>screen</a>, stream, xmin, ymin, xmax, ymax, x, y, color, background-color
<span id="L174" class="LineNr">174 </span> <span class="PreProc">return</span> x, y
<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="muComment"># draw a stream in the rectangle from (xmin, ymin) to (xmax, ymax), starting from (x, y), wrapping as necessary</span>
<span id="L178" class="LineNr">178 </span><span class="muComment"># return the next (x, y) coordinate in raster order where drawing stopped</span>
<span id="L179" class="LineNr">179 </span><span class="muComment"># that way the caller can draw more if given the same min and max bounding-box.</span>
<span id="L180" class="LineNr">180 </span><span class="muComment"># if there isn't enough space, truncate</span>
<span id="L181" class="LineNr">181 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L181'>draw-stream-wrapping-right-then-down</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), stream: (addr stream byte), xmin: int, ymin: int, xmax: int, ymax: int, x: int, y: int, color: int, background-color: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
<span id="L182" class="LineNr">182 </span> <span class="PreProc">var</span> xcurr/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy x
<span id="L183" class="LineNr">183 </span> <span class="PreProc">var</span> ycurr/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy y
<span id="L184" class="LineNr">184 </span> <span class="PreProc">var</span> g/<span class="Constant">ebx</span>: grapheme <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L185" class="LineNr">185 </span> <span class="Delimiter">{</span>
<span id="L186" class="LineNr">186 </span> <span class="Delimiter">{</span>
<span id="L187" class="LineNr">187 </span> <span class="PreProc">var</span> _g/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> stream
<span id="L188" class="LineNr">188 </span> g <span class="Special">&lt;-</span> copy _g
<span id="L189" class="LineNr">189 </span> <span class="Delimiter">}</span>
<span id="L190" class="LineNr">190 </span> compare g, <span class="Constant">0xffffffff</span>/end-of-file
<span id="L191" class="LineNr">191 </span> <span class="PreProc">break-if-=</span>
<span id="L192" class="LineNr">192 </span> xcurr, ycurr <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L141'>render-grapheme</a> <a href='500fake-screen.mu.html#L14'>screen</a>, g, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color
<span id="L193" class="LineNr">193 </span> <span class="PreProc">loop</span>
<span id="L194" class="LineNr">194 </span> <span class="Delimiter">}</span>
<span id="L195" class="LineNr">195 </span> <a href='500fake-screen.mu.html#L169'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, xcurr, ycurr
<span id="L196" class="LineNr">196 </span> <span class="PreProc">return</span> xcurr, ycurr
<span id="L197" class="LineNr">197 </span><span class="Delimiter">}</span>
<span id="L198" class="LineNr">198 </span>
<span id="L199" class="LineNr">199 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L199'>draw-stream-wrapping-right-then-down-from-cursor</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), stream: (addr stream byte), xmin: int, ymin: int, xmax: int, ymax: int, color: int, background-color: int <span class="Delimiter">{</span>
<span id="L200" class="LineNr">200 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L201" class="LineNr">201 </span> <span class="PreProc">var</span> cursor-y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L202" class="LineNr">202 </span> cursor-x, cursor-y <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L153'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L203" class="LineNr">203 </span> <span class="PreProc">var</span> end-x/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy cursor-x
<span id="L204" class="LineNr">204 </span> end-x <span class="Special">&lt;-</span> increment
<span id="L205" class="LineNr">205 </span> compare end-x, xmax
<span id="L141" class="LineNr">141 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L141'>draw-text-rightward-from-cursor-over-full-screen</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), color: int, background-color: int <span class="Delimiter">{</span>
<span id="L142" class="LineNr">142 </span> <span class="PreProc">var</span> width/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L143" class="LineNr">143 </span> <span class="PreProc">var</span> height/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L144" class="LineNr">144 </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="L145" class="LineNr">145 </span> <a href='501draw-text.mu.html#L133'>draw-text-rightward-from-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, text, width, color, background-color
<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='501draw-text.mu.html#L148'>render-grapheme</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), g: grapheme, xmin: int, ymin: int, xmax: int, ymax: int, x: int, y: int, color: int, background-color: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
<span id="L149" class="LineNr">149 </span> compare g, <span class="Constant">0xa</span>/newline
<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 x
<span id="L151" class="LineNr">151 </span> <span class="Delimiter">{</span>
<span id="L152" class="LineNr">152 </span> <span class="PreProc">break-if-!=</span>
<span id="L153" class="LineNr">153 </span> <span class="muComment"># minimum effort to clear cursor</span>
<span id="L154" class="LineNr">154 </span> <a href='500fake-screen.mu.html#L114'>draw-code-point</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x20</span>/space, x, y, color, background-color
<span id="L155" class="LineNr">155 </span> x <span class="Special">&lt;-</span> copy xmin
<span id="L156" class="LineNr">156 </span> increment y
<span id="L157" class="LineNr">157 </span> <span class="PreProc">return</span> x, y
<span id="L158" class="LineNr">158 </span> <span class="Delimiter">}</span>
<span id="L159" class="LineNr">159 </span> <a href='500fake-screen.mu.html#L88'>draw-grapheme</a> <a href='500fake-screen.mu.html#L14'>screen</a>, g, x, y, color, background-color
<span id="L160" class="LineNr">160 </span> x <span class="Special">&lt;-</span> increment
<span id="L161" class="LineNr">161 </span> compare x, xmax
<span id="L162" class="LineNr">162 </span> <span class="Delimiter">{</span>
<span id="L163" class="LineNr">163 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L164" class="LineNr">164 </span> x <span class="Special">&lt;-</span> copy xmin
<span id="L165" class="LineNr">165 </span> increment y
<span id="L166" class="LineNr">166 </span> <span class="Delimiter">}</span>
<span id="L167" class="LineNr">167 </span> <span class="PreProc">return</span> x, y
<span id="L168" class="LineNr">168 </span><span class="Delimiter">}</span>
<span id="L169" class="LineNr">169 </span>
<span id="L170" class="LineNr">170 </span><span class="muComment"># draw text in the rectangle from (xmin, ymin) to (xmax, ymax), starting from (x, y), wrapping as necessary</span>
<span id="L171" class="LineNr">171 </span><span class="muComment"># return the next (x, y) coordinate in raster order where drawing stopped</span>
<span id="L172" class="LineNr">172 </span><span class="muComment"># that way the caller can draw more if given the same min and max bounding-box.</span>
<span id="L173" class="LineNr">173 </span><span class="muComment"># if there isn't enough space, truncate</span>
<span id="L174" class="LineNr">174 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L174'>draw-text-wrapping-right-then-down</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), _text: (addr array byte), xmin: int, ymin: int, xmax: int, ymax: int, _x: int, _y: int, color: int, background-color: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
<span id="L175" class="LineNr">175 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x200</span>/print-buffer-size) <span class="muComment"># 4 rows of text = 1/12th of a real screen</span>
<span id="L176" class="LineNr">176 </span> <span class="muComment"># fake screens unlikely to be larger</span>
<span id="L177" class="LineNr">177 </span> <span class="muComment"># so this seems a reasonable size</span>
<span id="L178" class="LineNr">178 </span> <span class="muComment"># allocated on the stack, so quickly reclaimed</span>
<span id="L179" class="LineNr">179 </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="L180" class="LineNr">180 </span> <span class="PreProc">var</span> text/<span class="Constant">esi</span>: (addr array byte) <span class="Special">&lt;-</span> copy _text
<span id="L181" class="LineNr">181 </span> <span class="PreProc">var</span> len/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> length text
<span id="L182" class="LineNr">182 </span> compare len, <span class="Constant">0x200</span>
<span id="L183" class="LineNr">183 </span> <span class="Delimiter">{</span>
<span id="L184" class="LineNr">184 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L185" class="LineNr">185 </span> <a href='108write.subx.html#L11'>write</a> stream, <span class="Constant">&quot;ERROR: stream too small in draw-text-wrapping-right-then-down&quot;</span>
<span id="L186" class="LineNr">186 </span> <span class="Delimiter">}</span>
<span id="L187" class="LineNr">187 </span> compare len, <span class="Constant">0x200</span>
<span id="L188" class="LineNr">188 </span> <span class="Delimiter">{</span>
<span id="L189" class="LineNr">189 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L190" class="LineNr">190 </span> <a href='108write.subx.html#L11'>write</a> stream, text
<span id="L191" class="LineNr">191 </span> <span class="Delimiter">}</span>
<span id="L192" class="LineNr">192 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy _x
<span id="L193" class="LineNr">193 </span> <span class="PreProc">var</span> y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy _y
<span id="L194" class="LineNr">194 </span> x, y <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L202'>draw-stream-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L14'>screen</a>, stream, xmin, ymin, xmax, ymax, x, y, color, background-color
<span id="L195" class="LineNr">195 </span> <span class="PreProc">return</span> x, y
<span id="L196" class="LineNr">196 </span><span class="Delimiter">}</span>
<span id="L197" class="LineNr">197 </span>
<span id="L198" class="LineNr">198 </span><span class="muComment"># draw a stream in the rectangle from (xmin, ymin) to (xmax, ymax), starting from (x, y), wrapping as necessary</span>
<span id="L199" class="LineNr">199 </span><span class="muComment"># return the next (x, y) coordinate in raster order where drawing stopped</span>
<span id="L200" class="LineNr">200 </span><span class="muComment"># that way the caller can draw more if given the same min and max bounding-box.</span>
<span id="L201" class="LineNr">201 </span><span class="muComment"># if there isn't enough space, truncate</span>
<span id="L202" class="LineNr">202 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L202'>draw-stream-wrapping-right-then-down</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), stream: (addr stream byte), xmin: int, ymin: int, xmax: int, ymax: int, x: int, y: int, color: int, background-color: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
<span id="L203" class="LineNr">203 </span> <span class="PreProc">var</span> xcurr/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy x
<span id="L204" class="LineNr">204 </span> <span class="PreProc">var</span> ycurr/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy y
<span id="L205" class="LineNr">205 </span> <span class="PreProc">var</span> g/<span class="Constant">ebx</span>: grapheme <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L206" class="LineNr">206 </span> <span class="Delimiter">{</span>
<span id="L207" class="LineNr">207 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L208" class="LineNr">208 </span> cursor-x <span class="Special">&lt;-</span> copy xmin
<span id="L209" class="LineNr">209 </span> cursor-y <span class="Special">&lt;-</span> increment
<span id="L210" class="LineNr">210 </span> <span class="Delimiter">}</span>
<span id="L211" class="LineNr">211 </span> cursor-x, cursor-y <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L181'>draw-stream-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L14'>screen</a>, stream, xmin, ymin, xmax, ymax, cursor-x, cursor-y, color, background-color
<span id="L212" class="LineNr">212 </span><span class="Delimiter">}</span>
<span id="L213" class="LineNr">213 </span>
<span id="L214" class="LineNr">214 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L214'>draw-stream-wrapping-right-then-down-from-cursor-over-full-screen</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), stream: (addr stream byte), color: int, background-color: int <span class="Delimiter">{</span>
<span id="L215" class="LineNr">215 </span> <span class="PreProc">var</span> width/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L216" class="LineNr">216 </span> <span class="PreProc">var</span> height/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L217" class="LineNr">217 </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="L218" class="LineNr">218 </span> <a href='501draw-text.mu.html#L199'>draw-stream-wrapping-right-then-down-from-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, stream, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, width, height, color, background-color
<span id="L219" class="LineNr">219 </span><span class="Delimiter">}</span>
<span id="L220" class="LineNr">220 </span>
<span id="L221" class="LineNr">221 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L221'>move-cursor-rightward-and-downward</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), xmin: int, xmax: int <span class="Delimiter">{</span>
<span id="L222" class="LineNr">222 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L223" class="LineNr">223 </span> <span class="PreProc">var</span> cursor-y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L224" class="LineNr">224 </span> cursor-x, cursor-y <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L153'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L225" class="LineNr">225 </span> cursor-x <span class="Special">&lt;-</span> increment
<span id="L226" class="LineNr">226 </span> compare cursor-x, xmax
<span id="L207" class="LineNr">207 </span> <span class="Delimiter">{</span>
<span id="L208" class="LineNr">208 </span> <span class="PreProc">var</span> _g/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> stream
<span id="L209" class="LineNr">209 </span> g <span class="Special">&lt;-</span> copy _g
<span id="L210" class="LineNr">210 </span> <span class="Delimiter">}</span>
<span id="L211" class="LineNr">211 </span> compare g, <span class="Constant">0xffffffff</span>/end-of-file
<span id="L212" class="LineNr">212 </span> <span class="PreProc">break-if-=</span>
<span id="L213" class="LineNr">213 </span> xcurr, ycurr <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L148'>render-grapheme</a> <a href='500fake-screen.mu.html#L14'>screen</a>, g, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color
<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> <a href='500fake-screen.mu.html#L170'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, xcurr, ycurr
<span id="L217" class="LineNr">217 </span> <span class="PreProc">return</span> xcurr, ycurr
<span id="L218" class="LineNr">218 </span><span class="Delimiter">}</span>
<span id="L219" class="LineNr">219 </span>
<span id="L220" class="LineNr">220 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L220'>draw-stream-wrapping-right-then-down-from-cursor</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), stream: (addr stream byte), xmin: int, ymin: int, xmax: int, ymax: int, color: int, background-color: int <span class="Delimiter">{</span>
<span id="L221" class="LineNr">221 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L222" class="LineNr">222 </span> <span class="PreProc">var</span> cursor-y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L223" class="LineNr">223 </span> cursor-x, cursor-y <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L154'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L224" class="LineNr">224 </span> <span class="PreProc">var</span> end-x/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy cursor-x
<span id="L225" class="LineNr">225 </span> end-x <span class="Special">&lt;-</span> increment
<span id="L226" class="LineNr">226 </span> compare end-x, xmax
<span id="L227" class="LineNr">227 </span> <span class="Delimiter">{</span>
<span id="L228" class="LineNr">228 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L229" class="LineNr">229 </span> cursor-x <span class="Special">&lt;-</span> copy xmin
<span id="L230" class="LineNr">230 </span> cursor-y <span class="Special">&lt;-</span> increment
<span id="L231" class="LineNr">231 </span> <span class="Delimiter">}</span>
<span id="L232" class="LineNr">232 </span> <a href='500fake-screen.mu.html#L169'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, cursor-x, cursor-y
<span id="L232" class="LineNr">232 </span> cursor-x, cursor-y <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L202'>draw-stream-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L14'>screen</a>, stream, xmin, ymin, xmax, ymax, cursor-x, cursor-y, color, background-color
<span id="L233" class="LineNr">233 </span><span class="Delimiter">}</span>
<span id="L234" class="LineNr">234 </span>
<span id="L235" class="LineNr">235 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L235'>draw-text-wrapping-right-then-down-over-full-screen</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), x: int, y: int, color: int, background-color: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
<span id="L236" class="LineNr">236 </span> <span class="PreProc">var</span> x2/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L237" class="LineNr">237 </span> <span class="PreProc">var</span> y2/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L238" class="LineNr">238 </span> x2, y2 <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 class="muComment"># width, height</span>
<span id="L239" class="LineNr">239 </span> x2, y2 <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L167'>draw-text-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L14'>screen</a>, text, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, x2, y2, x, y, color, background-color
<span id="L240" class="LineNr">240 </span> <span class="PreProc">return</span> x2, y2 <span class="muComment"># cursor-x, cursor-y</span>
<span id="L241" class="LineNr">241 </span><span class="Delimiter">}</span>
<span id="L242" class="LineNr">242 </span>
<span id="L243" class="LineNr">243 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L243'>draw-text-wrapping-right-then-down-from-cursor</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), xmin: int, ymin: int, xmax: int, ymax: int, color: int, background-color: int <span class="Delimiter">{</span>
<span id="L244" class="LineNr">244 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L245" class="LineNr">245 </span> <span class="PreProc">var</span> cursor-y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L246" class="LineNr">246 </span> cursor-x, cursor-y <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L153'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L247" class="LineNr">247 </span> <span class="PreProc">var</span> end-x/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy cursor-x
<span id="L248" class="LineNr">248 </span> end-x <span class="Special">&lt;-</span> increment
<span id="L249" class="LineNr">249 </span> compare end-x, xmax
<span id="L250" class="LineNr">250 </span> <span class="Delimiter">{</span>
<span id="L251" class="LineNr">251 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L252" class="LineNr">252 </span> cursor-x <span class="Special">&lt;-</span> copy xmin
<span id="L253" class="LineNr">253 </span> cursor-y <span class="Special">&lt;-</span> increment
<span id="L254" class="LineNr">254 </span> <span class="Delimiter">}</span>
<span id="L255" class="LineNr">255 </span> cursor-x, cursor-y <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L167'>draw-text-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L14'>screen</a>, text, xmin, ymin, xmax, ymax, cursor-x, cursor-y, color, background-color
<span id="L256" class="LineNr">256 </span><span class="Delimiter">}</span>
<span id="L257" class="LineNr">257 </span>
<span id="L258" class="LineNr">258 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), color: int, background-color: int <span class="Delimiter">{</span>
<span id="L259" class="LineNr">259 </span> <span class="PreProc">var</span> width/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L260" class="LineNr">260 </span> <span class="PreProc">var</span> height/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L261" class="LineNr">261 </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="L262" class="LineNr">262 </span> <a href='501draw-text.mu.html#L243'>draw-text-wrapping-right-then-down-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="L263" class="LineNr">263 </span><span class="Delimiter">}</span>
<span id="L264" class="LineNr">264 </span>
<span id="L265" class="LineNr">265 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L265'>draw-int32-hex-wrapping-right-then-down</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), n: int, xmin: int, ymin: int, xmax: int, ymax: int, x: int, y: int, color: int, background-color: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
<span id="L266" class="LineNr">266 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x100</span>)
<span id="L267" class="LineNr">267 </span> <span class="PreProc">var</span> stream/<span class="Constant">esi</span>: (addr stream byte) <span class="Special">&lt;-</span> address stream-storage
<span id="L268" class="LineNr">268 </span> <a href='117write-int-hex.subx.html#L92'>write-int32-hex</a> stream, n
<span id="L269" class="LineNr">269 </span> <span class="PreProc">var</span> xcurr/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy x
<span id="L270" class="LineNr">270 </span> <span class="PreProc">var</span> ycurr/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy y
<span id="L235" class="LineNr">235 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L235'>draw-stream-wrapping-right-then-down-from-cursor-over-full-screen</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), stream: (addr stream byte), color: int, background-color: int <span class="Delimiter">{</span>
<span id="L236" class="LineNr">236 </span> <span class="PreProc">var</span> width/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L237" class="LineNr">237 </span> <span class="PreProc">var</span> height/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L238" class="LineNr">238 </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="L239" class="LineNr">239 </span> <a href='501draw-text.mu.html#L220'>draw-stream-wrapping-right-then-down-from-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, stream, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, width, height, color, background-color
<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="muFunction"><a href='501draw-text.mu.html#L242'>move-cursor-rightward-and-downward</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), xmin: int, xmax: int <span class="Delimiter">{</span>
<span id="L243" class="LineNr">243 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L244" class="LineNr">244 </span> <span class="PreProc">var</span> cursor-y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L245" class="LineNr">245 </span> cursor-x, cursor-y <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L154'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L246" class="LineNr">246 </span> cursor-x <span class="Special">&lt;-</span> increment
<span id="L247" class="LineNr">247 </span> compare cursor-x, xmax
<span id="L248" class="LineNr">248 </span> <span class="Delimiter">{</span>
<span id="L249" class="LineNr">249 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L250" class="LineNr">250 </span> cursor-x <span class="Special">&lt;-</span> copy xmin
<span id="L251" class="LineNr">251 </span> cursor-y <span class="Special">&lt;-</span> increment
<span id="L252" class="LineNr">252 </span> <span class="Delimiter">}</span>
<span id="L253" class="LineNr">253 </span> <a href='500fake-screen.mu.html#L170'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, cursor-x, cursor-y
<span id="L254" class="LineNr">254 </span><span class="Delimiter">}</span>
<span id="L255" class="LineNr">255 </span>
<span id="L256" class="LineNr">256 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L256'>draw-text-wrapping-right-then-down-over-full-screen</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), x: int, y: int, color: int, background-color: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
<span id="L257" class="LineNr">257 </span> <span class="PreProc">var</span> x2/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L258" class="LineNr">258 </span> <span class="PreProc">var</span> y2/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L259" class="LineNr">259 </span> x2, y2 <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 class="muComment"># width, height</span>
<span id="L260" class="LineNr">260 </span> x2, y2 <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L174'>draw-text-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L14'>screen</a>, text, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, x2, y2, x, y, color, background-color
<span id="L261" class="LineNr">261 </span> <span class="PreProc">return</span> x2, y2 <span class="muComment"># cursor-x, cursor-y</span>
<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="muFunction"><a href='501draw-text.mu.html#L264'>draw-text-wrapping-right-then-down-from-cursor</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), xmin: int, ymin: int, xmax: int, ymax: int, color: int, background-color: int <span class="Delimiter">{</span>
<span id="L265" class="LineNr">265 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L266" class="LineNr">266 </span> <span class="PreProc">var</span> cursor-y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L267" class="LineNr">267 </span> cursor-x, cursor-y <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L154'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L268" class="LineNr">268 </span> <span class="PreProc">var</span> end-x/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy cursor-x
<span id="L269" class="LineNr">269 </span> end-x <span class="Special">&lt;-</span> increment
<span id="L270" class="LineNr">270 </span> compare end-x, xmax
<span id="L271" class="LineNr">271 </span> <span class="Delimiter">{</span>
<span id="L272" class="LineNr">272 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> stream
<span id="L273" class="LineNr">273 </span> compare g, <span class="Constant">0xffffffff</span>/end-of-file
<span id="L274" class="LineNr">274 </span> <span class="PreProc">break-if-=</span>
<span id="L275" class="LineNr">275 </span> <a href='500fake-screen.mu.html#L88'>draw-grapheme</a> <a href='500fake-screen.mu.html#L14'>screen</a>, g, xcurr, ycurr, color, background-color
<span id="L276" class="LineNr">276 </span> xcurr <span class="Special">&lt;-</span> increment
<span id="L277" class="LineNr">277 </span> compare xcurr, xmax
<span id="L278" class="LineNr">278 </span> <span class="Delimiter">{</span>
<span id="L279" class="LineNr">279 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L280" class="LineNr">280 </span> xcurr <span class="Special">&lt;-</span> copy xmin
<span id="L281" class="LineNr">281 </span> ycurr <span class="Special">&lt;-</span> increment
<span id="L282" class="LineNr">282 </span> <span class="Delimiter">}</span>
<span id="L283" class="LineNr">283 </span> <span class="PreProc">loop</span>
<span id="L284" class="LineNr">284 </span> <span class="Delimiter">}</span>
<span id="L285" class="LineNr">285 </span> <a href='500fake-screen.mu.html#L169'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, xcurr, ycurr
<span id="L286" class="LineNr">286 </span> <span class="PreProc">return</span> xcurr, ycurr
<span id="L287" class="LineNr">287 </span><span class="Delimiter">}</span>
<span id="L288" class="LineNr">288 </span>
<span id="L289" class="LineNr">289 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L289'>draw-int32-hex-wrapping-right-then-down-over-full-screen</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), n: int, x: int, y: int, color: int, background-color: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
<span id="L290" class="LineNr">290 </span> <span class="PreProc">var</span> x2/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L291" class="LineNr">291 </span> <span class="PreProc">var</span> y2/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L292" class="LineNr">292 </span> x2, y2 <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 class="muComment"># width, height</span>
<span id="L293" class="LineNr">293 </span> x2, y2 <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L265'>draw-int32-hex-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L14'>screen</a>, n, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, x2, y2, x, y, color, background-color
<span id="L294" class="LineNr">294 </span> <span class="PreProc">return</span> x2, y2 <span class="muComment"># cursor-x, cursor-y</span>
<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="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L297'>draw-int32-hex-wrapping-right-then-down-from-cursor</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), n: int, xmin: int, ymin: int, xmax: int, ymax: int, color: int, background-color: int <span class="Delimiter">{</span>
<span id="L298" class="LineNr">298 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L299" class="LineNr">299 </span> <span class="PreProc">var</span> cursor-y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L300" class="LineNr">300 </span> cursor-x, cursor-y <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L153'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L301" class="LineNr">301 </span> <span class="PreProc">var</span> end-x/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy cursor-x
<span id="L302" class="LineNr">302 </span> end-x <span class="Special">&lt;-</span> increment
<span id="L303" class="LineNr">303 </span> compare end-x, xmax
<span id="L304" class="LineNr">304 </span> <span class="Delimiter">{</span>
<span id="L305" class="LineNr">305 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L306" class="LineNr">306 </span> cursor-x <span class="Special">&lt;-</span> copy xmin
<span id="L307" class="LineNr">307 </span> cursor-y <span class="Special">&lt;-</span> increment
<span id="L308" class="LineNr">308 </span> <span class="Delimiter">}</span>
<span id="L309" class="LineNr">309 </span> cursor-x, cursor-y <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L265'>draw-int32-hex-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L14'>screen</a>, n, xmin, ymin, xmax, ymax, cursor-x, cursor-y, color, background-color
<span id="L310" class="LineNr">310 </span><span class="Delimiter">}</span>
<span id="L311" class="LineNr">311 </span>
<span id="L312" class="LineNr">312 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L312'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), n: int, color: int, background-color: int <span class="Delimiter">{</span>
<span id="L313" class="LineNr">313 </span> <span class="PreProc">var</span> width/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L314" class="LineNr">314 </span> <span class="PreProc">var</span> height/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L315" class="LineNr">315 </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="L316" class="LineNr">316 </span> <a href='501draw-text.mu.html#L297'>draw-int32-hex-wrapping-right-then-down-from-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, n, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, width, height, color, background-color
<span id="L317" class="LineNr">317 </span><span class="Delimiter">}</span>
<span id="L318" class="LineNr">318 </span>
<span id="L319" class="LineNr">319 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L319'>draw-int32-decimal-wrapping-right-then-down</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), n: int, xmin: int, ymin: int, xmax: int, ymax: int, x: int, y: int, color: int, background-color: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
<span id="L320" class="LineNr">320 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x100</span>)
<span id="L321" class="LineNr">321 </span> <span class="PreProc">var</span> stream/<span class="Constant">esi</span>: (addr stream byte) <span class="Special">&lt;-</span> address stream-storage
<span id="L322" class="LineNr">322 </span> <a href='126write-int-decimal.subx.html#L8'>write-int32-decimal</a> stream, n
<span id="L323" class="LineNr">323 </span> <span class="PreProc">var</span> xcurr/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy x
<span id="L324" class="LineNr">324 </span> <span class="PreProc">var</span> ycurr/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy y
<span id="L272" class="LineNr">272 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L273" class="LineNr">273 </span> cursor-x <span class="Special">&lt;-</span> copy xmin
<span id="L274" class="LineNr">274 </span> cursor-y <span class="Special">&lt;-</span> increment
<span id="L275" class="LineNr">275 </span> <span class="Delimiter">}</span>
<span id="L276" class="LineNr">276 </span> cursor-x, cursor-y <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L174'>draw-text-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L14'>screen</a>, text, xmin, ymin, xmax, ymax, cursor-x, cursor-y, color, background-color
<span id="L277" class="LineNr">277 </span><span class="Delimiter">}</span>
<span id="L278" class="LineNr">278 </span>
<span id="L279" class="LineNr">279 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), color: int, background-color: int <span class="Delimiter">{</span>
<span id="L280" class="LineNr">280 </span> <span class="PreProc">var</span> width/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L281" class="LineNr">281 </span> <span class="PreProc">var</span> height/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L282" class="LineNr">282 </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="L283" class="LineNr">283 </span> <a href='501draw-text.mu.html#L264'>draw-text-wrapping-right-then-down-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="L284" class="LineNr">284 </span><span class="Delimiter">}</span>
<span id="L285" class="LineNr">285 </span>
<span id="L286" class="LineNr">286 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L286'>draw-int32-hex-wrapping-right-then-down</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), n: int, xmin: int, ymin: int, xmax: int, ymax: int, x: int, y: int, color: int, background-color: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
<span id="L287" class="LineNr">287 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x100</span>)
<span id="L288" class="LineNr">288 </span> <span class="PreProc">var</span> stream/<span class="Constant">esi</span>: (addr stream byte) <span class="Special">&lt;-</span> address stream-storage
<span id="L289" class="LineNr">289 </span> <a href='117write-int-hex.subx.html#L92'>write-int32-hex</a> stream, n
<span id="L290" class="LineNr">290 </span> <span class="PreProc">var</span> xcurr/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy x
<span id="L291" class="LineNr">291 </span> <span class="PreProc">var</span> ycurr/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy y
<span id="L292" class="LineNr">292 </span> <span class="Delimiter">{</span>
<span id="L293" class="LineNr">293 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> stream
<span id="L294" class="LineNr">294 </span> compare g, <span class="Constant">0xffffffff</span>/end-of-file
<span id="L295" class="LineNr">295 </span> <span class="PreProc">break-if-=</span>
<span id="L296" class="LineNr">296 </span> <a href='500fake-screen.mu.html#L88'>draw-grapheme</a> <a href='500fake-screen.mu.html#L14'>screen</a>, g, xcurr, ycurr, color, background-color
<span id="L297" class="LineNr">297 </span> xcurr <span class="Special">&lt;-</span> increment
<span id="L298" class="LineNr">298 </span> compare xcurr, xmax
<span id="L299" class="LineNr">299 </span> <span class="Delimiter">{</span>
<span id="L300" class="LineNr">300 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L301" class="LineNr">301 </span> xcurr <span class="Special">&lt;-</span> copy xmin
<span id="L302" class="LineNr">302 </span> ycurr <span class="Special">&lt;-</span> increment
<span id="L303" class="LineNr">303 </span> <span class="Delimiter">}</span>
<span id="L304" class="LineNr">304 </span> <span class="PreProc">loop</span>
<span id="L305" class="LineNr">305 </span> <span class="Delimiter">}</span>
<span id="L306" class="LineNr">306 </span> <a href='500fake-screen.mu.html#L170'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, xcurr, ycurr
<span id="L307" class="LineNr">307 </span> <span class="PreProc">return</span> xcurr, ycurr
<span id="L308" class="LineNr">308 </span><span class="Delimiter">}</span>
<span id="L309" class="LineNr">309 </span>
<span id="L310" class="LineNr">310 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L310'>draw-int32-hex-wrapping-right-then-down-over-full-screen</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), n: int, x: int, y: int, color: int, background-color: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
<span id="L311" class="LineNr">311 </span> <span class="PreProc">var</span> x2/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L312" class="LineNr">312 </span> <span class="PreProc">var</span> y2/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L313" class="LineNr">313 </span> x2, y2 <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 class="muComment"># width, height</span>
<span id="L314" class="LineNr">314 </span> x2, y2 <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L286'>draw-int32-hex-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L14'>screen</a>, n, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, x2, y2, x, y, color, background-color
<span id="L315" class="LineNr">315 </span> <span class="PreProc">return</span> x2, y2 <span class="muComment"># cursor-x, cursor-y</span>
<span id="L316" class="LineNr">316 </span><span class="Delimiter">}</span>
<span id="L317" class="LineNr">317 </span>
<span id="L318" class="LineNr">318 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L318'>draw-int32-hex-wrapping-right-then-down-from-cursor</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), n: int, xmin: int, ymin: int, xmax: int, ymax: int, color: int, background-color: int <span class="Delimiter">{</span>
<span id="L319" class="LineNr">319 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L320" class="LineNr">320 </span> <span class="PreProc">var</span> cursor-y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L321" class="LineNr">321 </span> cursor-x, cursor-y <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L154'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L322" class="LineNr">322 </span> <span class="PreProc">var</span> end-x/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy cursor-x
<span id="L323" class="LineNr">323 </span> end-x <span class="Special">&lt;-</span> increment
<span id="L324" class="LineNr">324 </span> compare end-x, xmax
<span id="L325" class="LineNr">325 </span> <span class="Delimiter">{</span>
<span id="L326" class="LineNr">326 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> stream
<span id="L327" class="LineNr">327 </span> compare g, <span class="Constant">0xffffffff</span>/end-of-file
<span id="L328" class="LineNr">328 </span> <span class="PreProc">break-if-=</span>
<span id="L329" class="LineNr">329 </span> <a href='500fake-screen.mu.html#L88'>draw-grapheme</a> <a href='500fake-screen.mu.html#L14'>screen</a>, g, xcurr, ycurr, color, background-color
<span id="L330" class="LineNr">330 </span> xcurr <span class="Special">&lt;-</span> increment
<span id="L331" class="LineNr">331 </span> compare xcurr, xmax
<span id="L332" class="LineNr">332 </span> <span class="Delimiter">{</span>
<span id="L333" class="LineNr">333 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L334" class="LineNr">334 </span> xcurr <span class="Special">&lt;-</span> copy xmin
<span id="L335" class="LineNr">335 </span> ycurr <span class="Special">&lt;-</span> increment
<span id="L336" class="LineNr">336 </span> <span class="Delimiter">}</span>
<span id="L337" class="LineNr">337 </span> <span class="PreProc">loop</span>
<span id="L338" class="LineNr">338 </span> <span class="Delimiter">}</span>
<span id="L339" class="LineNr">339 </span> <a href='500fake-screen.mu.html#L169'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, xcurr, ycurr
<span id="L340" class="LineNr">340 </span> <span class="PreProc">return</span> xcurr, ycurr
<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="muFunction"><a href='501draw-text.mu.html#L343'>draw-int32-decimal-wrapping-right-then-down-over-full-screen</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), n: int, x: int, y: int, color: int, background-color: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
<span id="L344" class="LineNr">344 </span> <span class="PreProc">var</span> x2/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L345" class="LineNr">345 </span> <span class="PreProc">var</span> y2/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L346" class="LineNr">346 </span> x2, y2 <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 class="muComment"># width, height</span>
<span id="L347" class="LineNr">347 </span> x2, y2 <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L319'>draw-int32-decimal-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L14'>screen</a>, n, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, x2, y2, x, y, color, background-color
<span id="L348" class="LineNr">348 </span> <span class="PreProc">return</span> x2, y2 <span class="muComment"># cursor-x, cursor-y</span>
<span id="L349" class="LineNr">349 </span><span class="Delimiter">}</span>
<span id="L350" class="LineNr">350 </span>
<span id="L351" class="LineNr">351 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L351'>draw-int32-decimal-wrapping-right-then-down-from-cursor</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), n: int, xmin: int, ymin: int, xmax: int, ymax: int, color: int, background-color: int <span class="Delimiter">{</span>
<span id="L352" class="LineNr">352 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L353" class="LineNr">353 </span> <span class="PreProc">var</span> cursor-y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L354" class="LineNr">354 </span> cursor-x, cursor-y <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L153'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L355" class="LineNr">355 </span> <span class="PreProc">var</span> end-x/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy cursor-x
<span id="L356" class="LineNr">356 </span> end-x <span class="Special">&lt;-</span> increment
<span id="L357" class="LineNr">357 </span> compare end-x, xmax
<span id="L358" class="LineNr">358 </span> <span class="Delimiter">{</span>
<span id="L359" class="LineNr">359 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L360" class="LineNr">360 </span> cursor-x <span class="Special">&lt;-</span> copy xmin
<span id="L361" class="LineNr">361 </span> cursor-y <span class="Special">&lt;-</span> increment
<span id="L362" class="LineNr">362 </span> <span class="Delimiter">}</span>
<span id="L363" class="LineNr">363 </span> cursor-x, cursor-y <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L319'>draw-int32-decimal-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L14'>screen</a>, n, xmin, ymin, xmax, ymax, cursor-x, cursor-y, color, background-color
<span id="L364" class="LineNr">364 </span><span class="Delimiter">}</span>
<span id="L365" class="LineNr">365 </span>
<span id="L366" class="LineNr">366 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L366'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), n: int, color: int, background-color: int <span class="Delimiter">{</span>
<span id="L367" class="LineNr">367 </span> <span class="PreProc">var</span> width/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L368" class="LineNr">368 </span> <span class="PreProc">var</span> height/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L369" class="LineNr">369 </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="L370" class="LineNr">370 </span> <a href='501draw-text.mu.html#L351'>draw-int32-decimal-wrapping-right-then-down-from-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, n, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, width, height, color, background-color
<span id="L371" class="LineNr">371 </span><span class="Delimiter">}</span>
<span id="L372" class="LineNr">372 </span>
<span id="L373" class="LineNr">373 </span><span class="muComment">## Text direction: down then right</span>
<span id="L374" class="LineNr">374 </span>
<span id="L375" class="LineNr">375 </span><span class="muComment"># draw a single line of text vertically from x, y to ymax</span>
<span id="L376" class="LineNr">376 </span><span class="muComment"># return the next 'y' coordinate</span>
<span id="L377" class="LineNr">377 </span><span class="muComment"># if there isn't enough space, truncate</span>
<span id="L378" class="LineNr">378 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L378'>draw-text-downward</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), x: int, y: int, ymax: int, color: int, background-color: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
<span id="L379" class="LineNr">379 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x100</span>)
<span id="L380" class="LineNr">380 </span> <span class="PreProc">var</span> stream/<span class="Constant">esi</span>: (addr stream byte) <span class="Special">&lt;-</span> address stream-storage
<span id="L381" class="LineNr">381 </span> <a href='108write.subx.html#L11'>write</a> stream, text
<span id="L382" class="LineNr">382 </span> <span class="PreProc">var</span> ycurr/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L389'>draw-stream-downward</a> <a href='500fake-screen.mu.html#L14'>screen</a>, stream, x, y, ymax, color, background-color
<span id="L383" class="LineNr">383 </span> <span class="PreProc">return</span> ycurr
<span id="L384" class="LineNr">384 </span><span class="Delimiter">}</span>
<span id="L385" class="LineNr">385 </span>
<span id="L386" class="LineNr">386 </span><span class="muComment"># draw a single-line stream vertically from x, y to ymax</span>
<span id="L387" class="LineNr">387 </span><span class="muComment"># return the next 'y' coordinate</span>
<span id="L388" class="LineNr">388 </span><span class="muComment"># if there isn't enough space, truncate</span>
<span id="L389" class="LineNr">389 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L389'>draw-stream-downward</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), stream: (addr stream byte), x: int, y: int, ymax: int, color: int, background-color: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
<span id="L390" class="LineNr">390 </span> <span class="PreProc">var</span> ycurr/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy y
<span id="L391" class="LineNr">391 </span> <span class="Delimiter">{</span>
<span id="L392" class="LineNr">392 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> stream
<span id="L393" class="LineNr">393 </span> compare g, <span class="Constant">0xffffffff</span>/end-of-file
<span id="L394" class="LineNr">394 </span> <span class="PreProc">break-if-=</span>
<span id="L395" class="LineNr">395 </span> <a href='500fake-screen.mu.html#L88'>draw-grapheme</a> <a href='500fake-screen.mu.html#L14'>screen</a>, g, x, ycurr, color, background-color
<span id="L396" class="LineNr">396 </span> ycurr <span class="Special">&lt;-</span> increment
<span id="L397" class="LineNr">397 </span> <span class="PreProc">loop</span>
<span id="L398" class="LineNr">398 </span> <span class="Delimiter">}</span>
<span id="L399" class="LineNr">399 </span> <a href='500fake-screen.mu.html#L169'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, ycurr
<span id="L400" class="LineNr">400 </span> <span class="PreProc">return</span> ycurr
<span id="L401" class="LineNr">401 </span><span class="Delimiter">}</span>
<span id="L402" class="LineNr">402 </span>
<span id="L403" class="LineNr">403 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L403'>draw-text-downward-from-cursor</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), ymax: int, color: int, background-color: int <span class="Delimiter">{</span>
<span id="L404" class="LineNr">404 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L405" class="LineNr">405 </span> <span class="PreProc">var</span> cursor-y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L406" class="LineNr">406 </span> cursor-x, cursor-y <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L153'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L407" class="LineNr">407 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L378'>draw-text-downward</a> <a href='500fake-screen.mu.html#L14'>screen</a>, text, cursor-x, cursor-y, ymax, color, background-color
<span id="L408" class="LineNr">408 </span><span class="Delimiter">}</span>
<span id="L409" class="LineNr">409 </span>
<span id="L410" class="LineNr">410 </span><span class="muComment"># draw text down and right in the rectangle from (xmin, ymin) to (xmax, ymax), starting from (x, y), wrapping as necessary</span>
<span id="L411" class="LineNr">411 </span><span class="muComment"># return the next (x, y) coordinate in raster order where drawing stopped</span>
<span id="L412" class="LineNr">412 </span><span class="muComment"># that way the caller can draw more if given the same min and max bounding-box.</span>
<span id="L413" class="LineNr">413 </span><span class="muComment"># if there isn't enough space, truncate</span>
<span id="L414" class="LineNr">414 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L414'>draw-text-wrapping-down-then-right</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), xmin: int, ymin: int, xmax: int, ymax: int, _x: int, _y: int, color: int, background-color: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
<span id="L415" class="LineNr">415 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x100</span>)
<span id="L416" class="LineNr">416 </span> <span class="PreProc">var</span> stream/<span class="Constant">esi</span>: (addr stream byte) <span class="Special">&lt;-</span> address stream-storage
<span id="L417" class="LineNr">417 </span> <a href='108write.subx.html#L11'>write</a> stream, text
<span id="L418" class="LineNr">418 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy _x
<span id="L419" class="LineNr">419 </span> <span class="PreProc">var</span> y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy _y
<span id="L420" class="LineNr">420 </span> x, y <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L428'>draw-stream-wrapping-down-then-right</a> <a href='500fake-screen.mu.html#L14'>screen</a>, stream, xmin, ymin, xmax, ymax, x, y, color, background-color
<span id="L421" class="LineNr">421 </span> <span class="PreProc">return</span> x, y
<span id="L326" class="LineNr">326 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L327" class="LineNr">327 </span> cursor-x <span class="Special">&lt;-</span> copy xmin
<span id="L328" class="LineNr">328 </span> cursor-y <span class="Special">&lt;-</span> increment
<span id="L329" class="LineNr">329 </span> <span class="Delimiter">}</span>
<span id="L330" class="LineNr">330 </span> cursor-x, cursor-y <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L286'>draw-int32-hex-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L14'>screen</a>, n, xmin, ymin, xmax, ymax, cursor-x, cursor-y, color, background-color
<span id="L331" class="LineNr">331 </span><span class="Delimiter">}</span>
<span id="L332" class="LineNr">332 </span>
<span id="L333" class="LineNr">333 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), n: int, color: int, background-color: int <span class="Delimiter">{</span>
<span id="L334" class="LineNr">334 </span> <span class="PreProc">var</span> width/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L335" class="LineNr">335 </span> <span class="PreProc">var</span> height/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L336" class="LineNr">336 </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="L337" class="LineNr">337 </span> <a href='501draw-text.mu.html#L318'>draw-int32-hex-wrapping-right-then-down-from-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, n, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, width, height, color, background-color
<span id="L338" class="LineNr">338 </span><span class="Delimiter">}</span>
<span id="L339" class="LineNr">339 </span>
<span id="L340" class="LineNr">340 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L340'>draw-int32-decimal-wrapping-right-then-down</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), n: int, xmin: int, ymin: int, xmax: int, ymax: int, x: int, y: int, color: int, background-color: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
<span id="L341" class="LineNr">341 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x100</span>)
<span id="L342" class="LineNr">342 </span> <span class="PreProc">var</span> stream/<span class="Constant">esi</span>: (addr stream byte) <span class="Special">&lt;-</span> address stream-storage
<span id="L343" class="LineNr">343 </span> <a href='126write-int-decimal.subx.html#L8'>write-int32-decimal</a> stream, n
<span id="L344" class="LineNr">344 </span> <span class="PreProc">var</span> xcurr/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy x
<span id="L345" class="LineNr">345 </span> <span class="PreProc">var</span> ycurr/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy y
<span id="L346" class="LineNr">346 </span> <span class="Delimiter">{</span>
<span id="L347" class="LineNr">347 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> stream
<span id="L348" class="LineNr">348 </span> compare g, <span class="Constant">0xffffffff</span>/end-of-file
<span id="L349" class="LineNr">349 </span> <span class="PreProc">break-if-=</span>
<span id="L350" class="LineNr">350 </span> <a href='500fake-screen.mu.html#L88'>draw-grapheme</a> <a href='500fake-screen.mu.html#L14'>screen</a>, g, xcurr, ycurr, color, background-color
<span id="L351" class="LineNr">351 </span> xcurr <span class="Special">&lt;-</span> increment
<span id="L352" class="LineNr">352 </span> compare xcurr, xmax
<span id="L353" class="LineNr">353 </span> <span class="Delimiter">{</span>
<span id="L354" class="LineNr">354 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L355" class="LineNr">355 </span> xcurr <span class="Special">&lt;-</span> copy xmin
<span id="L356" class="LineNr">356 </span> ycurr <span class="Special">&lt;-</span> increment
<span id="L357" class="LineNr">357 </span> <span class="Delimiter">}</span>
<span id="L358" class="LineNr">358 </span> <span class="PreProc">loop</span>
<span id="L359" class="LineNr">359 </span> <span class="Delimiter">}</span>
<span id="L360" class="LineNr">360 </span> <a href='500fake-screen.mu.html#L170'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, xcurr, ycurr
<span id="L361" class="LineNr">361 </span> <span class="PreProc">return</span> xcurr, ycurr
<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="muFunction"><a href='501draw-text.mu.html#L364'>draw-int32-decimal-wrapping-right-then-down-over-full-screen</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), n: int, x: int, y: int, color: int, background-color: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
<span id="L365" class="LineNr">365 </span> <span class="PreProc">var</span> x2/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L366" class="LineNr">366 </span> <span class="PreProc">var</span> y2/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L367" class="LineNr">367 </span> x2, y2 <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 class="muComment"># width, height</span>
<span id="L368" class="LineNr">368 </span> x2, y2 <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L340'>draw-int32-decimal-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L14'>screen</a>, n, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, x2, y2, x, y, color, background-color
<span id="L369" class="LineNr">369 </span> <span class="PreProc">return</span> x2, y2 <span class="muComment"># cursor-x, cursor-y</span>
<span id="L370" class="LineNr">370 </span><span class="Delimiter">}</span>
<span id="L371" class="LineNr">371 </span>
<span id="L372" class="LineNr">372 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L372'>draw-int32-decimal-wrapping-right-then-down-from-cursor</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), n: int, xmin: int, ymin: int, xmax: int, ymax: int, color: int, background-color: int <span class="Delimiter">{</span>
<span id="L373" class="LineNr">373 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L374" class="LineNr">374 </span> <span class="PreProc">var</span> cursor-y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L375" class="LineNr">375 </span> cursor-x, cursor-y <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L154'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L376" class="LineNr">376 </span> <span class="PreProc">var</span> end-x/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy cursor-x
<span id="L377" class="LineNr">377 </span> end-x <span class="Special">&lt;-</span> increment
<span id="L378" class="LineNr">378 </span> compare end-x, xmax
<span id="L379" class="LineNr">379 </span> <span class="Delimiter">{</span>
<span id="L380" class="LineNr">380 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L381" class="LineNr">381 </span> cursor-x <span class="Special">&lt;-</span> copy xmin
<span id="L382" class="LineNr">382 </span> cursor-y <span class="Special">&lt;-</span> increment
<span id="L383" class="LineNr">383 </span> <span class="Delimiter">}</span>
<span id="L384" class="LineNr">384 </span> cursor-x, cursor-y <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L340'>draw-int32-decimal-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L14'>screen</a>, n, xmin, ymin, xmax, ymax, cursor-x, cursor-y, color, background-color
<span id="L385" class="LineNr">385 </span><span class="Delimiter">}</span>
<span id="L386" class="LineNr">386 </span>
<span id="L387" class="LineNr">387 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L387'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), n: int, color: int, background-color: int <span class="Delimiter">{</span>
<span id="L388" class="LineNr">388 </span> <span class="PreProc">var</span> width/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L389" class="LineNr">389 </span> <span class="PreProc">var</span> height/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L390" class="LineNr">390 </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="L391" class="LineNr">391 </span> <a href='501draw-text.mu.html#L372'>draw-int32-decimal-wrapping-right-then-down-from-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, n, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, width, height, color, background-color
<span id="L392" class="LineNr">392 </span><span class="Delimiter">}</span>
<span id="L393" class="LineNr">393 </span>
<span id="L394" class="LineNr">394 </span><span class="muComment">## Text direction: down then right</span>
<span id="L395" class="LineNr">395 </span>
<span id="L396" class="LineNr">396 </span><span class="muComment"># draw a single line of text vertically from x, y to ymax</span>
<span id="L397" class="LineNr">397 </span><span class="muComment"># return the next 'y' coordinate</span>
<span id="L398" class="LineNr">398 </span><span class="muComment"># if there isn't enough space, truncate</span>
<span id="L399" class="LineNr">399 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L399'>draw-text-downward</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), x: int, y: int, ymax: int, color: int, background-color: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
<span id="L400" class="LineNr">400 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x100</span>)
<span id="L401" class="LineNr">401 </span> <span class="PreProc">var</span> stream/<span class="Constant">esi</span>: (addr stream byte) <span class="Special">&lt;-</span> address stream-storage
<span id="L402" class="LineNr">402 </span> <a href='108write.subx.html#L11'>write</a> stream, text
<span id="L403" class="LineNr">403 </span> <span class="PreProc">var</span> ycurr/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L410'>draw-stream-downward</a> <a href='500fake-screen.mu.html#L14'>screen</a>, stream, x, y, ymax, color, background-color
<span id="L404" class="LineNr">404 </span> <span class="PreProc">return</span> ycurr
<span id="L405" class="LineNr">405 </span><span class="Delimiter">}</span>
<span id="L406" class="LineNr">406 </span>
<span id="L407" class="LineNr">407 </span><span class="muComment"># draw a single-line stream vertically from x, y to ymax</span>
<span id="L408" class="LineNr">408 </span><span class="muComment"># return the next 'y' coordinate</span>
<span id="L409" class="LineNr">409 </span><span class="muComment"># if there isn't enough space, truncate</span>
<span id="L410" class="LineNr">410 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L410'>draw-stream-downward</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), stream: (addr stream byte), x: int, y: int, ymax: int, color: int, background-color: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
<span id="L411" class="LineNr">411 </span> <span class="PreProc">var</span> ycurr/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy y
<span id="L412" class="LineNr">412 </span> <span class="Delimiter">{</span>
<span id="L413" class="LineNr">413 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> stream
<span id="L414" class="LineNr">414 </span> compare g, <span class="Constant">0xffffffff</span>/end-of-file
<span id="L415" class="LineNr">415 </span> <span class="PreProc">break-if-=</span>
<span id="L416" class="LineNr">416 </span> <a href='500fake-screen.mu.html#L88'>draw-grapheme</a> <a href='500fake-screen.mu.html#L14'>screen</a>, g, x, ycurr, color, background-color
<span id="L417" class="LineNr">417 </span> ycurr <span class="Special">&lt;-</span> increment
<span id="L418" class="LineNr">418 </span> <span class="PreProc">loop</span>
<span id="L419" class="LineNr">419 </span> <span class="Delimiter">}</span>
<span id="L420" class="LineNr">420 </span> <a href='500fake-screen.mu.html#L170'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, ycurr
<span id="L421" class="LineNr">421 </span> <span class="PreProc">return</span> ycurr
<span id="L422" class="LineNr">422 </span><span class="Delimiter">}</span>
<span id="L423" class="LineNr">423 </span>
<span id="L424" class="LineNr">424 </span><span class="muComment"># draw a stream down and right in the rectangle from (xmin, ymin) to (xmax, ymax), starting from (x, y), wrapping as necessary</span>
<span id="L425" class="LineNr">425 </span><span class="muComment"># return the next (x, y) coordinate in raster order where drawing stopped</span>
<span id="L426" class="LineNr">426 </span><span class="muComment"># that way the caller can draw more if given the same min and max bounding-box.</span>
<span id="L427" class="LineNr">427 </span><span class="muComment"># if there isn't enough space, truncate</span>
<span id="L428" class="LineNr">428 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L428'>draw-stream-wrapping-down-then-right</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), stream: (addr stream byte), xmin: int, ymin: int, xmax: int, ymax: int, x: int, y: int, color: int, background-color: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
<span id="L429" class="LineNr">429 </span> <span class="PreProc">var</span> xcurr/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy x
<span id="L430" class="LineNr">430 </span> <span class="PreProc">var</span> ycurr/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy y
<span id="L431" class="LineNr">431 </span> <span class="Delimiter">{</span>
<span id="L432" class="LineNr">432 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> stream
<span id="L433" class="LineNr">433 </span> compare g, <span class="Constant">0xffffffff</span>/end-of-file
<span id="L434" class="LineNr">434 </span> <span class="PreProc">break-if-=</span>
<span id="L435" class="LineNr">435 </span> <a href='500fake-screen.mu.html#L88'>draw-grapheme</a> <a href='500fake-screen.mu.html#L14'>screen</a>, g, xcurr, ycurr, color, background-color
<span id="L436" class="LineNr">436 </span> ycurr <span class="Special">&lt;-</span> increment
<span id="L437" class="LineNr">437 </span> compare ycurr, ymax
<span id="L438" class="LineNr">438 </span> <span class="Delimiter">{</span>
<span id="L439" class="LineNr">439 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L440" class="LineNr">440 </span> xcurr <span class="Special">&lt;-</span> increment
<span id="L441" class="LineNr">441 </span> ycurr <span class="Special">&lt;-</span> copy ymin
<span id="L442" class="LineNr">442 </span> <span class="Delimiter">}</span>
<span id="L443" class="LineNr">443 </span> <span class="PreProc">loop</span>
<span id="L444" class="LineNr">444 </span> <span class="Delimiter">}</span>
<span id="L445" class="LineNr">445 </span> <a href='500fake-screen.mu.html#L169'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, xcurr, ycurr
<span id="L446" class="LineNr">446 </span> <span class="PreProc">return</span> xcurr, ycurr
<span id="L447" class="LineNr">447 </span><span class="Delimiter">}</span>
<span id="L448" class="LineNr">448 </span>
<span id="L449" class="LineNr">449 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L449'>draw-text-wrapping-down-then-right-over-full-screen</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), x: int, y: int, color: int, background-color: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
<span id="L450" class="LineNr">450 </span> <span class="PreProc">var</span> x2/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L451" class="LineNr">451 </span> <span class="PreProc">var</span> y2/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L452" class="LineNr">452 </span> x2, y2 <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 class="muComment"># width, height</span>
<span id="L453" class="LineNr">453 </span> x2, y2 <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L414'>draw-text-wrapping-down-then-right</a> <a href='500fake-screen.mu.html#L14'>screen</a>, text, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, x2, y2, x, y, color, background-color
<span id="L454" class="LineNr">454 </span> <span class="PreProc">return</span> x2, y2 <span class="muComment"># cursor-x, cursor-y</span>
<span id="L455" class="LineNr">455 </span><span class="Delimiter">}</span>
<span id="L456" class="LineNr">456 </span>
<span id="L457" class="LineNr">457 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L457'>draw-text-wrapping-down-then-right-from-cursor</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), xmin: int, ymin: int, xmax: int, ymax: int, color: int, background-color: int <span class="Delimiter">{</span>
<span id="L458" class="LineNr">458 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L459" class="LineNr">459 </span> <span class="PreProc">var</span> cursor-y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L460" class="LineNr">460 </span> cursor-x, cursor-y <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L153'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L461" class="LineNr">461 </span> <span class="PreProc">var</span> end-y/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy cursor-y
<span id="L462" class="LineNr">462 </span> end-y <span class="Special">&lt;-</span> increment
<span id="L463" class="LineNr">463 </span> compare end-y, ymax
<span id="L464" class="LineNr">464 </span> <span class="Delimiter">{</span>
<span id="L465" class="LineNr">465 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L466" class="LineNr">466 </span> cursor-x <span class="Special">&lt;-</span> increment
<span id="L467" class="LineNr">467 </span> cursor-y <span class="Special">&lt;-</span> copy ymin
<span id="L468" class="LineNr">468 </span> <span class="Delimiter">}</span>
<span id="L469" class="LineNr">469 </span> cursor-x, cursor-y <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L414'>draw-text-wrapping-down-then-right</a> <a href='500fake-screen.mu.html#L14'>screen</a>, text, xmin, ymin, xmax, ymax, cursor-x, cursor-y, color, background-color
<span id="L470" class="LineNr">470 </span><span class="Delimiter">}</span>
<span id="L471" class="LineNr">471 </span>
<span id="L472" class="LineNr">472 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L472'>draw-text-wrapping-down-then-right-from-cursor-over-full-screen</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), color: int, background-color: int <span class="Delimiter">{</span>
<span id="L473" class="LineNr">473 </span> <span class="PreProc">var</span> width/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L474" class="LineNr">474 </span> <span class="PreProc">var</span> height/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<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="L424" class="LineNr">424 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L424'>draw-text-downward-from-cursor</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), ymax: int, color: int, background-color: int <span class="Delimiter">{</span>
<span id="L425" class="LineNr">425 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L426" class="LineNr">426 </span> <span class="PreProc">var</span> cursor-y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L427" class="LineNr">427 </span> cursor-x, cursor-y <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L154'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L428" class="LineNr">428 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L399'>draw-text-downward</a> <a href='500fake-screen.mu.html#L14'>screen</a>, text, cursor-x, cursor-y, ymax, color, background-color
<span id="L429" class="LineNr">429 </span><span class="Delimiter">}</span>
<span id="L430" class="LineNr">430 </span>
<span id="L431" class="LineNr">431 </span><span class="muComment"># draw text down and right in the rectangle from (xmin, ymin) to (xmax, ymax), starting from (x, y), wrapping as necessary</span>
<span id="L432" class="LineNr">432 </span><span class="muComment"># return the next (x, y) coordinate in raster order where drawing stopped</span>
<span id="L433" class="LineNr">433 </span><span class="muComment"># that way the caller can draw more if given the same min and max bounding-box.</span>
<span id="L434" class="LineNr">434 </span><span class="muComment"># if there isn't enough space, truncate</span>
<span id="L435" class="LineNr">435 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L435'>draw-text-wrapping-down-then-right</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), xmin: int, ymin: int, xmax: int, ymax: int, _x: int, _y: int, color: int, background-color: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
<span id="L436" class="LineNr">436 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x100</span>)
<span id="L437" class="LineNr">437 </span> <span class="PreProc">var</span> stream/<span class="Constant">esi</span>: (addr stream byte) <span class="Special">&lt;-</span> address stream-storage
<span id="L438" class="LineNr">438 </span> <a href='108write.subx.html#L11'>write</a> stream, text
<span id="L439" class="LineNr">439 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy _x
<span id="L440" class="LineNr">440 </span> <span class="PreProc">var</span> y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy _y
<span id="L441" class="LineNr">441 </span> x, y <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L449'>draw-stream-wrapping-down-then-right</a> <a href='500fake-screen.mu.html#L14'>screen</a>, stream, xmin, ymin, xmax, ymax, x, y, color, background-color
<span id="L442" class="LineNr">442 </span> <span class="PreProc">return</span> x, y
<span id="L443" class="LineNr">443 </span><span class="Delimiter">}</span>
<span id="L444" class="LineNr">444 </span>
<span id="L445" class="LineNr">445 </span><span class="muComment"># draw a stream down and right in the rectangle from (xmin, ymin) to (xmax, ymax), starting from (x, y), wrapping as necessary</span>
<span id="L446" class="LineNr">446 </span><span class="muComment"># return the next (x, y) coordinate in raster order where drawing stopped</span>
<span id="L447" class="LineNr">447 </span><span class="muComment"># that way the caller can draw more if given the same min and max bounding-box.</span>
<span id="L448" class="LineNr">448 </span><span class="muComment"># if there isn't enough space, truncate</span>
<span id="L449" class="LineNr">449 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L449'>draw-stream-wrapping-down-then-right</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), stream: (addr stream byte), xmin: int, ymin: int, xmax: int, ymax: int, x: int, y: int, color: int, background-color: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
<span id="L450" class="LineNr">450 </span> <span class="PreProc">var</span> xcurr/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy x
<span id="L451" class="LineNr">451 </span> <span class="PreProc">var</span> ycurr/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy y
<span id="L452" class="LineNr">452 </span> <span class="Delimiter">{</span>
<span id="L453" class="LineNr">453 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> stream
<span id="L454" class="LineNr">454 </span> compare g, <span class="Constant">0xffffffff</span>/end-of-file
<span id="L455" class="LineNr">455 </span> <span class="PreProc">break-if-=</span>
<span id="L456" class="LineNr">456 </span> <a href='500fake-screen.mu.html#L88'>draw-grapheme</a> <a href='500fake-screen.mu.html#L14'>screen</a>, g, xcurr, ycurr, color, background-color
<span id="L457" class="LineNr">457 </span> ycurr <span class="Special">&lt;-</span> increment
<span id="L458" class="LineNr">458 </span> compare ycurr, ymax
<span id="L459" class="LineNr">459 </span> <span class="Delimiter">{</span>
<span id="L460" class="LineNr">460 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L461" class="LineNr">461 </span> xcurr <span class="Special">&lt;-</span> increment
<span id="L462" class="LineNr">462 </span> ycurr <span class="Special">&lt;-</span> copy ymin
<span id="L463" class="LineNr">463 </span> <span class="Delimiter">}</span>
<span id="L464" class="LineNr">464 </span> <span class="PreProc">loop</span>
<span id="L465" class="LineNr">465 </span> <span class="Delimiter">}</span>
<span id="L466" class="LineNr">466 </span> <a href='500fake-screen.mu.html#L170'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, xcurr, ycurr
<span id="L467" class="LineNr">467 </span> <span class="PreProc">return</span> xcurr, ycurr
<span id="L468" class="LineNr">468 </span><span class="Delimiter">}</span>
<span id="L469" class="LineNr">469 </span>
<span id="L470" class="LineNr">470 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L470'>draw-text-wrapping-down-then-right-over-full-screen</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), x: int, y: int, color: int, background-color: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
<span id="L471" class="LineNr">471 </span> <span class="PreProc">var</span> x2/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L472" class="LineNr">472 </span> <span class="PreProc">var</span> y2/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L473" class="LineNr">473 </span> x2, y2 <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 class="muComment"># width, height</span>
<span id="L474" class="LineNr">474 </span> x2, y2 <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L435'>draw-text-wrapping-down-then-right</a> <a href='500fake-screen.mu.html#L14'>screen</a>, text, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, x2, y2, x, y, color, background-color
<span id="L475" class="LineNr">475 </span> <span class="PreProc">return</span> x2, y2 <span class="muComment"># cursor-x, cursor-y</span>
<span id="L476" class="LineNr">476 </span><span class="Delimiter">}</span>
<span id="L477" class="LineNr">477 </span>
<span id="L478" class="LineNr">478 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L478'>draw-text-wrapping-down-then-right-from-cursor</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), xmin: int, ymin: int, xmax: int, ymax: int, color: int, background-color: int <span class="Delimiter">{</span>
<span id="L479" class="LineNr">479 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L480" class="LineNr">480 </span> <span class="PreProc">var</span> cursor-y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L481" class="LineNr">481 </span> cursor-x, cursor-y <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L154'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L482" class="LineNr">482 </span> <span class="PreProc">var</span> end-y/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy cursor-y
<span id="L483" class="LineNr">483 </span> end-y <span class="Special">&lt;-</span> increment
<span id="L484" class="LineNr">484 </span> compare end-y, ymax
<span id="L485" class="LineNr">485 </span> <span class="Delimiter">{</span>
<span id="L486" class="LineNr">486 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L487" class="LineNr">487 </span> cursor-x <span class="Special">&lt;-</span> increment
<span id="L488" class="LineNr">488 </span> cursor-y <span class="Special">&lt;-</span> copy ymin
<span id="L489" class="LineNr">489 </span> <span class="Delimiter">}</span>
<span id="L490" class="LineNr">490 </span> cursor-x, cursor-y <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L435'>draw-text-wrapping-down-then-right</a> <a href='500fake-screen.mu.html#L14'>screen</a>, text, xmin, ymin, xmax, ymax, cursor-x, cursor-y, color, background-color
<span id="L491" class="LineNr">491 </span><span class="Delimiter">}</span>
<span id="L492" class="LineNr">492 </span>
<span id="L493" class="LineNr">493 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L493'>draw-text-wrapping-down-then-right-from-cursor-over-full-screen</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), color: int, background-color: int <span class="Delimiter">{</span>
<span id="L494" class="LineNr">494 </span> <span class="PreProc">var</span> width/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L495" class="LineNr">495 </span> <span class="PreProc">var</span> height/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L496" class="LineNr">496 </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="L497" class="LineNr">497 </span> <a href='501draw-text.mu.html#L478'>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="L498" class="LineNr">498 </span><span class="Delimiter">}</span>
</pre>
</body>
</html>

12
html/502test.mu.html generated
View File

@ -63,10 +63,10 @@ if ('onhashchange' in window) {
<span id="L4" class="LineNr"> 4 </span> compare a, b
<span id="L5" class="LineNr"> 5 </span> <span class="Delimiter">{</span>
<span id="L6" class="LineNr"> 6 </span> <span class="PreProc">break-if-!=</span>
<span id="L7" class="LineNr"> 7 </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;.&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L7" class="LineNr"> 7 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;.&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L8" class="LineNr"> 8 </span> <span class="PreProc">return</span>
<span id="L9" class="LineNr"> 9 </span> <span class="Delimiter">}</span>
<span id="L10" class="LineNr">10 </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, msg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L10" class="LineNr">10 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, msg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L11" class="LineNr">11 </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="L12" class="LineNr">12 </span> <a href='104test.subx.html#L5'>count-test-failure</a>
<span id="L13" class="LineNr">13 </span><span class="Delimiter">}</span>
@ -80,10 +80,10 @@ if ('onhashchange' in window) {
<span id="L21" class="LineNr">21 </span> compare a, <span class="Constant">0</span>/false
<span id="L22" class="LineNr">22 </span> <span class="Delimiter">{</span>
<span id="L23" class="LineNr">23 </span> <span class="PreProc">break-if-=</span>
<span id="L24" class="LineNr">24 </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;.&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L24" class="LineNr">24 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;.&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L25" class="LineNr">25 </span> <span class="PreProc">return</span>
<span id="L26" class="LineNr">26 </span> <span class="Delimiter">}</span>
<span id="L27" class="LineNr">27 </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, msg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L27" class="LineNr">27 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, msg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L28" class="LineNr">28 </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="L29" class="LineNr">29 </span> <a href='104test.subx.html#L5'>count-test-failure</a>
<span id="L30" class="LineNr">30 </span><span class="Delimiter">}</span>
@ -93,10 +93,10 @@ if ('onhashchange' in window) {
<span id="L34" class="LineNr">34 </span> compare a, <span class="Constant">0</span>/false
<span id="L35" class="LineNr">35 </span> <span class="Delimiter">{</span>
<span id="L36" class="LineNr">36 </span> <span class="PreProc">break-if-!=</span>
<span id="L37" class="LineNr">37 </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;.&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L37" class="LineNr">37 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;.&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L38" class="LineNr">38 </span> <span class="PreProc">return</span>
<span id="L39" class="LineNr">39 </span> <span class="Delimiter">}</span>
<span id="L40" class="LineNr">40 </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, msg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L40" class="LineNr">40 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, msg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L41" class="LineNr">41 </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="L42" class="LineNr">42 </span> <a href='104test.subx.html#L5'>count-test-failure</a>
<span id="L43" class="LineNr">43 </span><span class="Delimiter">}</span>

View File

@ -78,7 +78,7 @@ if ('onhashchange' in window) {
<span id="L19" class="LineNr"> 19 </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> e-addr
<span id="L20" class="LineNr"> 20 </span> compare done?, <span class="Constant">0</span>
<span id="L21" class="LineNr"> 21 </span> <span class="PreProc">break-if-!=</span>
<span id="L22" class="LineNr"> 22 </span> <span class="PreProc">var</span> _g/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L413'>screen-grapheme-at-idx</a> <a href='500fake-screen.mu.html#L14'>screen</a>, idx
<span id="L22" class="LineNr"> 22 </span> <span class="PreProc">var</span> _g/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L414'>screen-grapheme-at-idx</a> <a href='500fake-screen.mu.html#L14'>screen</a>, idx
<span id="L23" class="LineNr"> 23 </span> <span class="PreProc">var</span> g/<span class="Constant">ebx</span>: grapheme <span class="Special">&lt;-</span> copy _g
<span id="L24" class="LineNr"> 24 </span> <span class="PreProc">var</span> expected-grapheme/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> e-addr
<span id="L25" class="LineNr"> 25 </span> <span class="muComment"># compare graphemes</span>
@ -94,23 +94,23 @@ if ('onhashchange' in window) {
<span id="L35" class="LineNr"> 35 </span> compare g, expected-grapheme
<span id="L36" class="LineNr"> 36 </span> <span class="Delimiter">{</span>
<span id="L37" class="LineNr"> 37 </span> <span class="PreProc">break-if-!=</span>
<span id="L38" class="LineNr"> 38 </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;.&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L38" class="LineNr"> 38 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;.&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L39" class="LineNr"> 39 </span> <span class="PreProc">break</span> $check-screen-row-from:compare-graphemes
<span id="L40" class="LineNr"> 40 </span> <span class="Delimiter">}</span>
<span id="L41" class="LineNr"> 41 </span> <span class="muComment"># otherwise print an error</span>
<span id="L42" class="LineNr"> 42 </span> <a href='104test.subx.html#L5'>count-test-failure</a>
<span id="L43" class="LineNr"> 43 </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, msg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L44" class="LineNr"> 44 </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;: expected '&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L43" class="LineNr"> 43 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, msg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L44" class="LineNr"> 44 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;: expected '&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L45" class="LineNr"> 45 </span> <a href='501draw-text.mu.html#L84'>draw-grapheme-at-cursor</a> <span class="Constant">0</span>/screen, expected-grapheme, <span class="Constant">3</span>/cyan, <span class="Constant">0</span>/bg
<span id="L46" class="LineNr"> 46 </span> <a href='501draw-text.mu.html#L221'>move-cursor-rightward-and-downward</a> <span class="Constant">0</span>/screen, <span class="Constant">0</span>/xmin, <span class="Constant">0x80</span>/xmax=screen-width
<span id="L47" class="LineNr"> 47 </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;' at (&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L48" class="LineNr"> 48 </span> <a href='501draw-text.mu.html#L312'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, x, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<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> <span class="Constant">0</span>/screen, <span class="Constant">&quot;, &quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L50" class="LineNr"> 50 </span> <a href='501draw-text.mu.html#L312'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, y, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<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> <span class="Constant">0</span>/screen, <span class="Constant">&quot;) but observed '&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L46" class="LineNr"> 46 </span> <a href='501draw-text.mu.html#L242'>move-cursor-rightward-and-downward</a> <span class="Constant">0</span>/screen, <span class="Constant">0</span>/xmin, <span class="Constant">0x80</span>/xmax=screen-width
<span id="L47" class="LineNr"> 47 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;' at (&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L48" class="LineNr"> 48 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, x, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L49" class="LineNr"> 49 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;, &quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L50" class="LineNr"> 50 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, y, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L51" class="LineNr"> 51 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;) but observed '&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L52" class="LineNr"> 52 </span> <a href='501draw-text.mu.html#L84'>draw-grapheme-at-cursor</a> <span class="Constant">0</span>/screen, g, <span class="Constant">3</span>/cyan, <span class="Constant">0</span>/bg
<span id="L53" class="LineNr"> 53 </span> <a href='501draw-text.mu.html#L221'>move-cursor-rightward-and-downward</a> <span class="Constant">0</span>/screen, <span class="Constant">0</span>/xmin, <span class="Constant">0x80</span>/xmax=screen-width
<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> <span class="Constant">0</span>/screen, <span class="Constant">&quot;'&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L53" class="LineNr"> 53 </span> <a href='501draw-text.mu.html#L242'>move-cursor-rightward-and-downward</a> <span class="Constant">0</span>/screen, <span class="Constant">0</span>/xmin, <span class="Constant">0x80</span>/xmax=screen-width
<span id="L54" class="LineNr"> 54 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;'&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L55" class="LineNr"> 55 </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="L56" class="LineNr"> 56 </span> <span class="Delimiter">}</span>
<span id="L57" class="LineNr"> 57 </span> idx <span class="Special">&lt;-</span> increment
@ -136,7 +136,7 @@ if ('onhashchange' in window) {
<span id="L77" class="LineNr"> 77 </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> e-addr
<span id="L78" class="LineNr"> 78 </span> compare done?, <span class="Constant">0</span>
<span id="L79" class="LineNr"> 79 </span> <span class="PreProc">break-if-!=</span>
<span id="L80" class="LineNr"> 80 </span> <span class="PreProc">var</span> _g/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L413'>screen-grapheme-at-idx</a> <a href='500fake-screen.mu.html#L14'>screen</a>, idx
<span id="L80" class="LineNr"> 80 </span> <span class="PreProc">var</span> _g/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L414'>screen-grapheme-at-idx</a> <a href='500fake-screen.mu.html#L14'>screen</a>, idx
<span id="L81" class="LineNr"> 81 </span> <span class="PreProc">var</span> g/<span class="Constant">ebx</span>: grapheme <span class="Special">&lt;-</span> copy _g
<span id="L82" class="LineNr"> 82 </span> <span class="PreProc">var</span> _expected-grapheme/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> e-addr
<span id="L83" class="LineNr"> 83 </span> <span class="PreProc">var</span> expected-grapheme/<span class="Constant">edi</span>: grapheme <span class="Special">&lt;-</span> copy _expected-grapheme
@ -152,7 +152,7 @@ if ('onhashchange' in window) {
<span id="L93" class="LineNr"> 93 </span> <span class="Delimiter">{</span>
<span id="L94" class="LineNr"> 94 </span> compare expected-grapheme, <span class="Constant">0x20</span>
<span id="L95" class="LineNr"> 95 </span> <span class="PreProc">break-if-!=</span>
<span id="L96" class="LineNr"> 96 </span> <span class="PreProc">var</span> color/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L431'>screen-color-at-idx</a> <a href='500fake-screen.mu.html#L14'>screen</a>, idx
<span id="L96" class="LineNr"> 96 </span> <span class="PreProc">var</span> color/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L432'>screen-color-at-idx</a> <a href='500fake-screen.mu.html#L14'>screen</a>, idx
<span id="L97" class="LineNr"> 97 </span> compare color, fg
<span id="L98" class="LineNr"> 98 </span> <span class="PreProc">break-if-!=</span> $check-screen-row-in-color-from:compare-cells
<span id="L99" class="LineNr"> 99 </span> <span class="Delimiter">}</span>
@ -162,47 +162,47 @@ if ('onhashchange' in window) {
<span id="L103" class="LineNr">103 </span> compare g, expected-grapheme
<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> <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;.&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L106" class="LineNr">106 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;.&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L107" class="LineNr">107 </span> <span class="PreProc">break</span> $check-screen-row-in-color-from:compare-graphemes
<span id="L108" class="LineNr">108 </span> <span class="Delimiter">}</span>
<span id="L109" class="LineNr">109 </span> <span class="muComment"># otherwise print an error</span>
<span id="L110" class="LineNr">110 </span> <a href='104test.subx.html#L5'>count-test-failure</a>
<span id="L111" class="LineNr">111 </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, msg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L112" class="LineNr">112 </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;: expected '&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L111" class="LineNr">111 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, msg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L112" class="LineNr">112 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;: expected '&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L113" class="LineNr">113 </span> <a href='501draw-text.mu.html#L84'>draw-grapheme-at-cursor</a> <span class="Constant">0</span>/screen, expected-grapheme, <span class="Constant">3</span>/cyan, <span class="Constant">0</span>/bg
<span id="L114" class="LineNr">114 </span> <a href='501draw-text.mu.html#L221'>move-cursor-rightward-and-downward</a> <span class="Constant">0</span>/screen, <span class="Constant">0</span>/xmin, <span class="Constant">0x80</span>/xmax=screen-width
<span id="L115" class="LineNr">115 </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;' at (&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L116" class="LineNr">116 </span> <a href='501draw-text.mu.html#L312'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, x, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<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> <span class="Constant">0</span>/screen, <span class="Constant">&quot;, &quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L118" class="LineNr">118 </span> <a href='501draw-text.mu.html#L312'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, y, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L119" class="LineNr">119 </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;) but observed '&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L114" class="LineNr">114 </span> <a href='501draw-text.mu.html#L242'>move-cursor-rightward-and-downward</a> <span class="Constant">0</span>/screen, <span class="Constant">0</span>/xmin, <span class="Constant">0x80</span>/xmax=screen-width
<span id="L115" class="LineNr">115 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;' at (&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L116" class="LineNr">116 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, x, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L117" class="LineNr">117 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;, &quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L118" class="LineNr">118 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, y, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L119" class="LineNr">119 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;) but observed '&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L120" class="LineNr">120 </span> <a href='501draw-text.mu.html#L84'>draw-grapheme-at-cursor</a> <span class="Constant">0</span>/screen, g, <span class="Constant">3</span>/cyan, <span class="Constant">0</span>/bg
<span id="L121" class="LineNr">121 </span> <a href='501draw-text.mu.html#L221'>move-cursor-rightward-and-downward</a> <span class="Constant">0</span>/screen, <span class="Constant">0</span>/xmin, <span class="Constant">0x80</span>/xmax=screen-width
<span id="L122" class="LineNr">122 </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;'&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L121" class="LineNr">121 </span> <a href='501draw-text.mu.html#L242'>move-cursor-rightward-and-downward</a> <span class="Constant">0</span>/screen, <span class="Constant">0</span>/xmin, <span class="Constant">0x80</span>/xmax=screen-width
<span id="L122" class="LineNr">122 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;'&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L123" class="LineNr">123 </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="L124" class="LineNr">124 </span> <span class="Delimiter">}</span>
<span id="L125" class="LineNr">125 </span> $check-screen-row-in-color-from:compare-colors: <span class="Delimiter">{</span>
<span id="L126" class="LineNr">126 </span> <span class="PreProc">var</span> color/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L431'>screen-color-at-idx</a> <a href='500fake-screen.mu.html#L14'>screen</a>, idx
<span id="L126" class="LineNr">126 </span> <span class="PreProc">var</span> color/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L432'>screen-color-at-idx</a> <a href='500fake-screen.mu.html#L14'>screen</a>, idx
<span id="L127" class="LineNr">127 </span> compare fg, color
<span id="L128" class="LineNr">128 </span> <span class="Delimiter">{</span>
<span id="L129" class="LineNr">129 </span> <span class="PreProc">break-if-!=</span>
<span id="L130" class="LineNr">130 </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;.&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L130" class="LineNr">130 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;.&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L131" class="LineNr">131 </span> <span class="PreProc">break</span> $check-screen-row-in-color-from:compare-colors
<span id="L132" class="LineNr">132 </span> <span class="Delimiter">}</span>
<span id="L133" class="LineNr">133 </span> <span class="muComment"># otherwise print an error</span>
<span id="L134" class="LineNr">134 </span> <a href='104test.subx.html#L5'>count-test-failure</a>
<span id="L135" class="LineNr">135 </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, msg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L136" class="LineNr">136 </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;: expected '&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L135" class="LineNr">135 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, msg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L136" class="LineNr">136 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;: expected '&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L137" class="LineNr">137 </span> <a href='501draw-text.mu.html#L84'>draw-grapheme-at-cursor</a> <span class="Constant">0</span>/screen, expected-grapheme, <span class="Constant">3</span>/cyan, <span class="Constant">0</span>/bg
<span id="L138" class="LineNr">138 </span> <a href='501draw-text.mu.html#L221'>move-cursor-rightward-and-downward</a> <span class="Constant">0</span>/screen, <span class="Constant">0</span>/xmin, <span class="Constant">0x80</span>/xmax=screen-width
<span id="L139" class="LineNr">139 </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;' at (&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L140" class="LineNr">140 </span> <a href='501draw-text.mu.html#L312'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, x, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L141" class="LineNr">141 </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;, &quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L142" class="LineNr">142 </span> <a href='501draw-text.mu.html#L312'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, y, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L143" class="LineNr">143 </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;) in color &quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L144" class="LineNr">144 </span> <a href='501draw-text.mu.html#L312'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, fg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L145" class="LineNr">145 </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; but observed color &quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L146" class="LineNr">146 </span> <a href='501draw-text.mu.html#L312'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, color, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L138" class="LineNr">138 </span> <a href='501draw-text.mu.html#L242'>move-cursor-rightward-and-downward</a> <span class="Constant">0</span>/screen, <span class="Constant">0</span>/xmin, <span class="Constant">0x80</span>/xmax=screen-width
<span id="L139" class="LineNr">139 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;' at (&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L140" class="LineNr">140 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, x, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L141" class="LineNr">141 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;, &quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L142" class="LineNr">142 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, y, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L143" class="LineNr">143 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;) in color &quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L144" class="LineNr">144 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, fg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L145" class="LineNr">145 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot; but observed color &quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L146" class="LineNr">146 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, color, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L147" class="LineNr">147 </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="L148" class="LineNr">148 </span> <span class="Delimiter">}</span>
<span id="L149" class="LineNr">149 </span> <span class="Delimiter">}</span>
@ -227,7 +227,7 @@ if ('onhashchange' in window) {
<span id="L168" class="LineNr">168 </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> e-addr
<span id="L169" class="LineNr">169 </span> compare done?, <span class="Constant">0</span>
<span id="L170" class="LineNr">170 </span> <span class="PreProc">break-if-!=</span>
<span id="L171" class="LineNr">171 </span> <span class="PreProc">var</span> _g/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L413'>screen-grapheme-at-idx</a> <a href='500fake-screen.mu.html#L14'>screen</a>, idx
<span id="L171" class="LineNr">171 </span> <span class="PreProc">var</span> _g/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L414'>screen-grapheme-at-idx</a> <a href='500fake-screen.mu.html#L14'>screen</a>, idx
<span id="L172" class="LineNr">172 </span> <span class="PreProc">var</span> g/<span class="Constant">ebx</span>: grapheme <span class="Special">&lt;-</span> copy _g
<span id="L173" class="LineNr">173 </span> <span class="PreProc">var</span> _expected-grapheme/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> e-addr
<span id="L174" class="LineNr">174 </span> <span class="PreProc">var</span> expected-grapheme/<span class="Constant">edi</span>: grapheme <span class="Special">&lt;-</span> copy _expected-grapheme
@ -243,7 +243,7 @@ if ('onhashchange' in window) {
<span id="L184" class="LineNr">184 </span> <span class="Delimiter">{</span>
<span id="L185" class="LineNr">185 </span> compare expected-grapheme, <span class="Constant">0x20</span>
<span id="L186" class="LineNr">186 </span> <span class="PreProc">break-if-!=</span>
<span id="L187" class="LineNr">187 </span> <span class="PreProc">var</span> background-color/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L450'>screen-background-color-at-idx</a> <a href='500fake-screen.mu.html#L14'>screen</a>, idx
<span id="L187" class="LineNr">187 </span> <span class="PreProc">var</span> background-color/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L451'>screen-background-color-at-idx</a> <a href='500fake-screen.mu.html#L14'>screen</a>, idx
<span id="L188" class="LineNr">188 </span> compare background-color, bg
<span id="L189" class="LineNr">189 </span> <span class="PreProc">break-if-!=</span> $check-screen-row-in-background-color-from:compare-cells
<span id="L190" class="LineNr">190 </span> <span class="Delimiter">}</span>
@ -253,48 +253,48 @@ if ('onhashchange' in window) {
<span id="L194" class="LineNr">194 </span> compare g, expected-grapheme
<span id="L195" class="LineNr">195 </span> <span class="Delimiter">{</span>
<span id="L196" class="LineNr">196 </span> <span class="PreProc">break-if-!=</span>
<span id="L197" class="LineNr">197 </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;.&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L197" class="LineNr">197 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;.&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L198" class="LineNr">198 </span> <span class="PreProc">break</span> $check-screen-row-in-background-color-from:compare-graphemes
<span id="L199" class="LineNr">199 </span> <span class="Delimiter">}</span>
<span id="L200" class="LineNr">200 </span> <span class="muComment"># otherwise print an error</span>
<span id="L201" class="LineNr">201 </span> <a href='104test.subx.html#L5'>count-test-failure</a>
<span id="L202" class="LineNr">202 </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, msg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L203" class="LineNr">203 </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;: expected '&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L202" class="LineNr">202 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, msg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L203" class="LineNr">203 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;: expected '&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L204" class="LineNr">204 </span> <a href='501draw-text.mu.html#L84'>draw-grapheme-at-cursor</a> <span class="Constant">0</span>/screen, expected-grapheme, <span class="Constant">3</span>/cyan, <span class="Constant">0</span>/bg
<span id="L205" class="LineNr">205 </span> <a href='501draw-text.mu.html#L221'>move-cursor-rightward-and-downward</a> <span class="Constant">0</span>/screen, <span class="Constant">0</span>/xmin, <span class="Constant">0x80</span>/xmax=screen-width
<span id="L206" class="LineNr">206 </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;' at (&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L207" class="LineNr">207 </span> <a href='501draw-text.mu.html#L312'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, x, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L208" class="LineNr">208 </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;, &quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L209" class="LineNr">209 </span> <a href='501draw-text.mu.html#L312'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, y, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L210" class="LineNr">210 </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;) but observed '&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L205" class="LineNr">205 </span> <a href='501draw-text.mu.html#L242'>move-cursor-rightward-and-downward</a> <span class="Constant">0</span>/screen, <span class="Constant">0</span>/xmin, <span class="Constant">0x80</span>/xmax=screen-width
<span id="L206" class="LineNr">206 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;' at (&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L207" class="LineNr">207 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, x, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L208" class="LineNr">208 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;, &quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L209" class="LineNr">209 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, y, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L210" class="LineNr">210 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;) but observed '&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L211" class="LineNr">211 </span> <a href='501draw-text.mu.html#L84'>draw-grapheme-at-cursor</a> <span class="Constant">0</span>/screen, g, <span class="Constant">3</span>/cyan, <span class="Constant">0</span>/bg
<span id="L212" class="LineNr">212 </span> <a href='501draw-text.mu.html#L221'>move-cursor-rightward-and-downward</a> <span class="Constant">0</span>/screen, <span class="Constant">0</span>/xmin, <span class="Constant">0x80</span>/xmax=screen-width
<span id="L213" class="LineNr">213 </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;'&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L212" class="LineNr">212 </span> <a href='501draw-text.mu.html#L242'>move-cursor-rightward-and-downward</a> <span class="Constant">0</span>/screen, <span class="Constant">0</span>/xmin, <span class="Constant">0x80</span>/xmax=screen-width
<span id="L213" class="LineNr">213 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;'&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L214" class="LineNr">214 </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="L215" class="LineNr">215 </span> <span class="PreProc">break</span> $check-screen-row-in-background-color-from:compare-graphemes
<span id="L216" class="LineNr">216 </span> <span class="Delimiter">}</span>
<span id="L217" class="LineNr">217 </span> $check-screen-row-in-background-color-from:compare-background-colors: <span class="Delimiter">{</span>
<span id="L218" class="LineNr">218 </span> <span class="PreProc">var</span> background-color/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L450'>screen-background-color-at-idx</a> <a href='500fake-screen.mu.html#L14'>screen</a>, idx
<span id="L218" class="LineNr">218 </span> <span class="PreProc">var</span> background-color/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L451'>screen-background-color-at-idx</a> <a href='500fake-screen.mu.html#L14'>screen</a>, idx
<span id="L219" class="LineNr">219 </span> compare bg, background-color
<span id="L220" class="LineNr">220 </span> <span class="Delimiter">{</span>
<span id="L221" class="LineNr">221 </span> <span class="PreProc">break-if-!=</span>
<span id="L222" class="LineNr">222 </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;.&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L222" class="LineNr">222 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;.&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L223" class="LineNr">223 </span> <span class="PreProc">break</span> $check-screen-row-in-background-color-from:compare-background-colors
<span id="L224" class="LineNr">224 </span> <span class="Delimiter">}</span>
<span id="L225" class="LineNr">225 </span> <span class="muComment"># otherwise print an error</span>
<span id="L226" class="LineNr">226 </span> <a href='104test.subx.html#L5'>count-test-failure</a>
<span id="L227" class="LineNr">227 </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, msg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L228" class="LineNr">228 </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;: expected '&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L227" class="LineNr">227 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, msg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L228" class="LineNr">228 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;: expected '&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L229" class="LineNr">229 </span> <a href='501draw-text.mu.html#L84'>draw-grapheme-at-cursor</a> <span class="Constant">0</span>/screen, expected-grapheme, <span class="Constant">3</span>/cyan, <span class="Constant">0</span>/bg
<span id="L230" class="LineNr">230 </span> <a href='501draw-text.mu.html#L221'>move-cursor-rightward-and-downward</a> <span class="Constant">0</span>/screen, <span class="Constant">0</span>/xmin, <span class="Constant">0x80</span>/xmax=screen-width
<span id="L231" class="LineNr">231 </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;' at (&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L232" class="LineNr">232 </span> <a href='501draw-text.mu.html#L312'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, x, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L233" class="LineNr">233 </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;, &quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L234" class="LineNr">234 </span> <a href='501draw-text.mu.html#L312'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, y, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L235" class="LineNr">235 </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;) in background-color &quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L236" class="LineNr">236 </span> <a href='501draw-text.mu.html#L312'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, bg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L237" class="LineNr">237 </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; but observed background-color &quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L238" class="LineNr">238 </span> <a href='501draw-text.mu.html#L312'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, background-color, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L230" class="LineNr">230 </span> <a href='501draw-text.mu.html#L242'>move-cursor-rightward-and-downward</a> <span class="Constant">0</span>/screen, <span class="Constant">0</span>/xmin, <span class="Constant">0x80</span>/xmax=screen-width
<span id="L231" class="LineNr">231 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;' at (&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L232" class="LineNr">232 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, x, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L233" class="LineNr">233 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;, &quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L234" class="LineNr">234 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, y, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L235" class="LineNr">235 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;) in background-color &quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L236" class="LineNr">236 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, bg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L237" class="LineNr">237 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot; but observed background-color &quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L238" class="LineNr">238 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, background-color, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L239" class="LineNr">239 </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="L240" class="LineNr">240 </span> <span class="Delimiter">}</span>
<span id="L241" class="LineNr">241 </span> <span class="Delimiter">}</span>
@ -325,7 +325,7 @@ if ('onhashchange' in window) {
<span id="L266" class="LineNr">266 </span> <span class="PreProc">var</span> _expected-bit/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> e-addr
<span id="L267" class="LineNr">267 </span> <span class="PreProc">var</span> expected-bit/<span class="Constant">edi</span>: grapheme <span class="Special">&lt;-</span> copy _expected-bit
<span id="L268" class="LineNr">268 </span> $check-background-color-in-screen-row-from:compare-cells: <span class="Delimiter">{</span>
<span id="L269" class="LineNr">269 </span> <span class="PreProc">var</span> background-color/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L450'>screen-background-color-at-idx</a> <a href='500fake-screen.mu.html#L14'>screen</a>, idx
<span id="L269" class="LineNr">269 </span> <span class="PreProc">var</span> background-color/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L451'>screen-background-color-at-idx</a> <a href='500fake-screen.mu.html#L14'>screen</a>, idx
<span id="L270" class="LineNr">270 </span> <span class="muComment"># if expected-bit is space, assert that background is NOT bg</span>
<span id="L271" class="LineNr">271 </span> compare expected-bit, <span class="Constant">0x20</span>
<span id="L272" class="LineNr">272 </span> <span class="Delimiter">{</span>
@ -333,13 +333,13 @@ if ('onhashchange' in window) {
<span id="L274" class="LineNr">274 </span> compare background-color, bg
<span id="L275" class="LineNr">275 </span> <span class="PreProc">break-if-!=</span> $check-background-color-in-screen-row-from:compare-cells
<span id="L276" class="LineNr">276 </span> <a href='104test.subx.html#L5'>count-test-failure</a>
<span id="L277" class="LineNr">277 </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, msg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L278" class="LineNr">278 </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;: expected (&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L279" class="LineNr">279 </span> <a href='501draw-text.mu.html#L312'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, x, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L280" class="LineNr">280 </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;, &quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L281" class="LineNr">281 </span> <a href='501draw-text.mu.html#L312'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, y, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L282" class="LineNr">282 </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;) to not be in background-color &quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L283" class="LineNr">283 </span> <a href='501draw-text.mu.html#L312'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, bg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L277" class="LineNr">277 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, msg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L278" class="LineNr">278 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;: expected (&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L279" class="LineNr">279 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, x, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L280" class="LineNr">280 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;, &quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L281" class="LineNr">281 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, y, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L282" class="LineNr">282 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;) to not be in background-color &quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L283" class="LineNr">283 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, bg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L284" class="LineNr">284 </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="L285" class="LineNr">285 </span> <span class="PreProc">break</span> $check-background-color-in-screen-row-from:compare-cells
<span id="L286" class="LineNr">286 </span> <span class="Delimiter">}</span>
@ -347,15 +347,15 @@ if ('onhashchange' in window) {
<span id="L288" class="LineNr">288 </span> compare background-color, bg
<span id="L289" class="LineNr">289 </span> <span class="PreProc">break-if-=</span> $check-background-color-in-screen-row-from:compare-cells
<span id="L290" class="LineNr">290 </span> <a href='104test.subx.html#L5'>count-test-failure</a>
<span id="L291" class="LineNr">291 </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, msg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L292" class="LineNr">292 </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;: expected (&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L293" class="LineNr">293 </span> <a href='501draw-text.mu.html#L312'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, x, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L294" class="LineNr">294 </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;, &quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L295" class="LineNr">295 </span> <a href='501draw-text.mu.html#L312'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, y, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L296" class="LineNr">296 </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;) in background-color &quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L297" class="LineNr">297 </span> <a href='501draw-text.mu.html#L312'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, bg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L298" class="LineNr">298 </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; but observed background-color &quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L299" class="LineNr">299 </span> <a href='501draw-text.mu.html#L312'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, background-color, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L291" class="LineNr">291 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, msg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L292" class="LineNr">292 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;: expected (&quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L293" class="LineNr">293 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, x, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L294" class="LineNr">294 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;, &quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L295" class="LineNr">295 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, y, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L296" class="LineNr">296 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;) in background-color &quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L297" class="LineNr">297 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, bg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L298" class="LineNr">298 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot; but observed background-color &quot;</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L299" class="LineNr">299 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, background-color, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L300" class="LineNr">300 </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="L301" class="LineNr">301 </span> <span class="Delimiter">}</span>
<span id="L302" class="LineNr">302 </span> idx <span class="Special">&lt;-</span> increment
@ -379,7 +379,7 @@ if ('onhashchange' in window) {
<span id="L320" class="LineNr">320 </span> <span class="PreProc">var</span> screen-on-stack: <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L321" class="LineNr">321 </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> address screen-on-stack
<span id="L322" class="LineNr">322 </span> <a href='500fake-screen.mu.html#L31'>initialize-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x10</span>/rows, <span class="Constant">4</span>/cols, <span class="Constant">0</span>/no-pixel-graphics
<span id="L323" class="LineNr">323 </span> <a href='501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;Hello, 世界&quot;</span>, <span class="Constant">1</span>/fg, <span class="Constant">2</span>/bg
<span id="L323" class="LineNr">323 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;Hello, 世界&quot;</span>, <span class="Constant">1</span>/fg, <span class="Constant">2</span>/bg
<span id="L324" class="LineNr">324 </span> <a href='504test-screen.mu.html#L7'>check-screen-row</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0</span>/y, <span class="Constant">&quot;Hello, 世界&quot;</span>, <span class="Constant">&quot;F - test-draw-multiple-graphemes&quot;</span>
<span id="L325" class="LineNr">325 </span> <a href='504test-screen.mu.html#L65'>check-screen-row-in-color</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">1</span>/fg, <span class="Constant">0</span>/y, <span class="Constant">&quot;Hello, 世界&quot;</span>, <span class="Constant">&quot;F - test-draw-multiple-graphemes-fg&quot;</span>
<span id="L326" class="LineNr">326 </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">2</span>/bg, <span class="Constant">0</span>/y, <span class="Constant">&quot;xxxxxxxxx &quot;</span>, <span class="Constant">&quot;F - test-draw-multiple-graphemes-bg2&quot;</span>

6
html/507line.mu.html generated
View File

@ -87,7 +87,7 @@ if ('onhashchange' in window) {
<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="L32" class="LineNr"> 32 </span> <a href='500fake-screen.mu.html#L463'>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
@ -124,7 +124,7 @@ if ('onhashchange' in window) {
<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="L69" class="LineNr"> 69 </span> <a href='500fake-screen.mu.html#L463'>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>
@ -135,7 +135,7 @@ if ('onhashchange' in window) {
<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="L80" class="LineNr"> 80 </span> <a href='500fake-screen.mu.html#L463'>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>

View File

@ -79,25 +79,25 @@ if ('onhashchange' in window) {
<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="L24" class="LineNr">24 </span> <a href='500fake-screen.mu.html#L463'>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="L30" class="LineNr">30 </span> <a href='500fake-screen.mu.html#L463'>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="L36" class="LineNr">36 </span> <a href='500fake-screen.mu.html#L463'>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="L42" class="LineNr">42 </span> <a href='500fake-screen.mu.html#L463'>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

View File

@ -293,7 +293,7 @@ if ('onhashchange' in window) {
<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="L238" class="LineNr">238 </span> <a href='500fake-screen.mu.html#L463'>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

1262
html/boot.subx.html generated

File diff suppressed because it is too large Load Diff

14
html/colors.mu.html generated
View File

@ -78,7 +78,7 @@ if ('onhashchange' in window) {
<span id="L19" class="LineNr"> 19 </span> <span class="muComment"># read line from keyboard</span>
<span id="L20" class="LineNr"> 20 </span> <a href='106stream.subx.html#L20'>clear-stream</a> in
<span id="L21" class="LineNr"> 21 </span> <span class="Delimiter">{</span>
<span id="L22" class="LineNr"> 22 </span> <a href='500fake-screen.mu.html#L216'>draw-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x20</span>/space
<span id="L22" class="LineNr"> 22 </span> <a href='500fake-screen.mu.html#L217'>draw-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x20</span>/space
<span id="L23" class="LineNr"> 23 </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="L24" class="LineNr"> 24 </span> compare key, <span class="Constant">0xa</span>/newline
<span id="L25" class="LineNr"> 25 </span> <span class="PreProc">break-if-=</span>
@ -91,7 +91,7 @@ if ('onhashchange' in window) {
<span id="L32" class="LineNr"> 32 </span> <a href='501draw-text.mu.html#L16'>move-cursor-right</a> <span class="Constant">0</span>
<span id="L33" class="LineNr"> 33 </span> <span class="PreProc">loop</span>
<span id="L34" class="LineNr"> 34 </span> <span class="Delimiter">}</span>
<span id="L35" class="LineNr"> 35 </span> <a href='500fake-screen.mu.html#L230'>clear-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L35" class="LineNr"> 35 </span> <a href='500fake-screen.mu.html#L231'>clear-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L36" class="LineNr"> 36 </span> <span class="muComment"># parse</span>
<span id="L37" class="LineNr"> 37 </span> <span class="PreProc">var</span> a/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L38" class="LineNr"> 38 </span> <span class="PreProc">var</span> b/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
@ -275,11 +275,11 @@ if ('onhashchange' in window) {
<span id="L216" class="LineNr">216 </span> <span class="PreProc">break-if-!=</span>
<span id="L217" class="LineNr">217 </span> compare c, l
<span id="L218" class="LineNr">218 </span> <span class="PreProc">break-if-!=</span>
<span id="L219" class="LineNr">219 </span> <a href='500fake-screen.mu.html#L169'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x10</span>/x, y
<span id="L220" class="LineNr">220 </span> <a href='501draw-text.mu.html#L366'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, color, <span class="Constant">7</span>/fg, <span class="Constant">0</span>/bg
<span id="L221" class="LineNr">221 </span> <a href='500fake-screen.mu.html#L169'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x14</span>/x, y
<span id="L222" class="LineNr">222 </span> <a href='501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; &quot;</span>, <span class="Constant">7</span>/fg, <span class="Constant">0</span>/bg
<span id="L223" class="LineNr">223 </span> <a href='501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; &quot;</span>, <span class="Constant">0</span>/fg, color
<span id="L219" class="LineNr">219 </span> <a href='500fake-screen.mu.html#L170'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x10</span>/x, y
<span id="L220" class="LineNr">220 </span> <a href='501draw-text.mu.html#L387'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, color, <span class="Constant">7</span>/fg, <span class="Constant">0</span>/bg
<span id="L221" class="LineNr">221 </span> <a href='500fake-screen.mu.html#L170'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x14</span>/x, y
<span id="L222" class="LineNr">222 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; &quot;</span>, <span class="Constant">7</span>/fg, <span class="Constant">0</span>/bg
<span id="L223" class="LineNr">223 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; &quot;</span>, <span class="Constant">0</span>/fg, color
<span id="L224" class="LineNr">224 </span><span class="CommentedCode">#? draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, &quot; &quot;, 7/fg, 0/bg</span>
<span id="L225" class="LineNr">225 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen, a, 7/fg, 0/bg</span>
<span id="L226" class="LineNr">226 </span><span class="CommentedCode">#? draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, &quot; &quot;, 7/fg, 0/bg</span>

8
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#L1415'>read-mouse-event</a>
<span id="L19" class="LineNr">19 </span> dx, dy <span class="Special">&lt;-</span> <a href='boot.subx.html#L1429'>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>
@ -85,15 +85,15 @@ if ('onhashchange' in window) {
<span id="L27" class="LineNr">27 </span> <span class="Delimiter">{</span>
<span id="L28" class="LineNr">28 </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="L29" class="LineNr">29 </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="L30" class="LineNr">30 </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> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; &quot;</span>, <span class="Constant">0</span>/x, <span class="Constant">0x10</span>/y, <span class="Constant">0x31</span>/fg, <span class="Constant">0</span>/bg
<span id="L30" class="LineNr">30 </span> dummy1, dummy2 <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L256'>draw-text-wrapping-right-then-down-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; &quot;</span>, <span class="Constant">0</span>/x, <span class="Constant">0x10</span>/y, <span class="Constant">0x31</span>/fg, <span class="Constant">0</span>/bg
<span id="L31" class="LineNr">31 </span> <span class="Delimiter">}</span>
<span id="L32" class="LineNr">32 </span> <span class="Delimiter">{</span>
<span id="L33" class="LineNr">33 </span> <span class="PreProc">var</span> dummy/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L34" class="LineNr">34 </span> dx, dummy <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L343'>draw-int32-decimal-wrapping-right-then-down-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, dx, <span class="Constant">0</span>/x, <span class="Constant">0x10</span>/y, <span class="Constant">0x31</span>/fg, <span class="Constant">0</span>/bg
<span id="L34" class="LineNr">34 </span> dx, dummy <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L364'>draw-int32-decimal-wrapping-right-then-down-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, dx, <span class="Constant">0</span>/x, <span class="Constant">0x10</span>/y, <span class="Constant">0x31</span>/fg, <span class="Constant">0</span>/bg
<span id="L35" class="LineNr">35 </span> <span class="Delimiter">}</span>
<span id="L36" class="LineNr">36 </span> <span class="Delimiter">{</span>
<span id="L37" class="LineNr">37 </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="L38" class="LineNr">38 </span> dummy, dy <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L343'>draw-int32-decimal-wrapping-right-then-down-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, dy, <span class="Constant">5</span>/x, <span class="Constant">0x10</span>/y, <span class="Constant">0x31</span>/fg, <span class="Constant">0</span>/bg
<span id="L38" class="LineNr">38 </span> dummy, dy <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L364'>draw-int32-decimal-wrapping-right-then-down-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, dy, <span class="Constant">5</span>/x, <span class="Constant">0x10</span>/y, <span class="Constant">0x31</span>/fg, <span class="Constant">0</span>/bg
<span id="L39" class="LineNr">39 </span> <span class="Delimiter">}</span>
<span id="L40" class="LineNr">40 </span> <span class="PreProc">loop</span>
<span id="L41" class="LineNr">41 </span> <span class="Delimiter">}</span>

2
html/ex11.mu.html generated
View File

@ -93,7 +93,7 @@ if ('onhashchange' in window) {
<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="L38" class="LineNr"> 38 </span> <a href='500fake-screen.mu.html#L231'>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

2
html/ex2.mu.html generated
View File

@ -76,7 +76,7 @@ if ('onhashchange' in window) {
<span id="L18" class="LineNr">18 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L19" class="LineNr">19 </span> <span class="PreProc">var</span> color/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy x
<span id="L20" class="LineNr">20 </span> color <span class="Special">&lt;-</span> and <span class="Constant">0xff</span>
<span id="L21" class="LineNr">21 </span> <a href='500fake-screen.mu.html#L462'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a> x, y, color
<span id="L21" class="LineNr">21 </span> <a href='500fake-screen.mu.html#L463'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a> x, y, color
<span id="L22" class="LineNr">22 </span> x <span class="Special">&lt;-</span> increment
<span id="L23" class="LineNr">23 </span> <span class="PreProc">loop</span>
<span id="L24" class="LineNr">24 </span> <span class="Delimiter">}</span>

18
html/ex6.mu.html generated
View File

@ -72,21 +72,21 @@ if ('onhashchange' in window) {
<span id="L14" class="LineNr">14 </span> <a href='503manhattan-line.mu.html#L1'>draw-box-on-real-screen</a> <span class="Constant">0xf</span>, <span class="Constant">0x1f</span>, <span class="Constant">0x79</span>, <span class="Constant">0x51</span>, <span class="Constant">0x4</span>
<span id="L15" class="LineNr">15 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0x20</span>
<span id="L16" class="LineNr">16 </span> <span class="PreProc">var</span> y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0x20</span>
<span id="L17" class="LineNr">17 </span> x, y <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L167'>draw-text-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;hello &quot;</span>, <span class="Constant">0x10</span>/xmin, <span class="Constant">0x20</span>/ymin, <span class="Constant">0x78</span>/xmax, <span class="Constant">0x50</span>/ymax, x, y, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L18" class="LineNr">18 </span> x, y <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L167'>draw-text-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;from &quot;</span>, <span class="Constant">0x10</span>/xmin, <span class="Constant">0x20</span>/ymin, <span class="Constant">0x78</span>/xmax, <span class="Constant">0x50</span>/ymax, x, y, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L19" class="LineNr">19 </span> x, y <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L167'>draw-text-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;baremetal &quot;</span>, <span class="Constant">0x10</span>/xmin, <span class="Constant">0x20</span>/ymin, <span class="Constant">0x78</span>/xmax, <span class="Constant">0x50</span>/ymax, x, y, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L20" class="LineNr">20 </span> x, y <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L167'>draw-text-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;Mu!&quot;</span>, <span class="Constant">0x10</span>/xmin, <span class="Constant">0x20</span>/ymin, <span class="Constant">0x78</span>/xmax, <span class="Constant">0x50</span>/ymax, x, y, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L17" class="LineNr">17 </span> x, y <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L174'>draw-text-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;hello &quot;</span>, <span class="Constant">0x10</span>/xmin, <span class="Constant">0x20</span>/ymin, <span class="Constant">0x78</span>/xmax, <span class="Constant">0x50</span>/ymax, x, y, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L18" class="LineNr">18 </span> x, y <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L174'>draw-text-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;from &quot;</span>, <span class="Constant">0x10</span>/xmin, <span class="Constant">0x20</span>/ymin, <span class="Constant">0x78</span>/xmax, <span class="Constant">0x50</span>/ymax, x, y, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L19" class="LineNr">19 </span> x, y <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L174'>draw-text-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;baremetal &quot;</span>, <span class="Constant">0x10</span>/xmin, <span class="Constant">0x20</span>/ymin, <span class="Constant">0x78</span>/xmax, <span class="Constant">0x50</span>/ymax, x, y, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L20" class="LineNr">20 </span> x, y <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L174'>draw-text-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;Mu!&quot;</span>, <span class="Constant">0x10</span>/xmin, <span class="Constant">0x20</span>/ymin, <span class="Constant">0x78</span>/xmax, <span class="Constant">0x50</span>/ymax, x, y, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L21" class="LineNr">21 </span>
<span id="L22" class="LineNr">22 </span> <span class="muComment"># drawing at the cursor in multiple directions</span>
<span id="L23" class="LineNr">23 </span> <a href='501draw-text.mu.html#L472'>draw-text-wrapping-down-then-right-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;abc&quot;</span>, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L24" class="LineNr">24 </span> <a href='501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;def&quot;</span>, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L23" class="LineNr">23 </span> <a href='501draw-text.mu.html#L493'>draw-text-wrapping-down-then-right-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;abc&quot;</span>, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L24" class="LineNr">24 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;def&quot;</span>, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L25" class="LineNr">25 </span>
<span id="L26" class="LineNr">26 </span> <span class="muComment"># test drawing near the edge</span>
<span id="L27" class="LineNr">27 </span> x <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;R&quot;</span>, <span class="Constant">0x7f</span>/x, <span class="Constant">0x80</span>/xmax=screen-width, <span class="Constant">0x18</span>/y, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L28" class="LineNr">28 </span> <a href='501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;wrapped from R&quot;</span>, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L28" class="LineNr">28 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;wrapped from R&quot;</span>, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L29" class="LineNr">29 </span>
<span id="L30" class="LineNr">30 </span> x <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L378'>draw-text-downward</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;D&quot;</span>, <span class="Constant">0x20</span>/x, <span class="Constant">0x2f</span>/y, <span class="Constant">0x30</span>/ymax=screen-height, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L31" class="LineNr">31 </span> <a href='501draw-text.mu.html#L472'>draw-text-wrapping-down-then-right-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;wrapped from D&quot;</span>, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L30" class="LineNr">30 </span> x <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L399'>draw-text-downward</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;D&quot;</span>, <span class="Constant">0x20</span>/x, <span class="Constant">0x2f</span>/y, <span class="Constant">0x30</span>/ymax=screen-height, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L31" class="LineNr">31 </span> <a href='501draw-text.mu.html#L493'>draw-text-wrapping-down-then-right-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;wrapped from D&quot;</span>, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L32" class="LineNr">32 </span><span class="Delimiter">}</span>
</pre>
</body>

4
html/ex7.mu.html generated
View File

@ -70,9 +70,9 @@ if ('onhashchange' in window) {
<span id="L12" class="LineNr">12 </span>
<span id="L13" class="LineNr">13 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex7.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> <span class="PreProc">var</span> space/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> copy <span class="Constant">0x20</span>
<span id="L15" class="LineNr">15 </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="L15" class="LineNr">15 </span> <a href='500fake-screen.mu.html#L170'>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="L16" class="LineNr">16 </span> <span class="Delimiter">{</span>
<span id="L17" class="LineNr">17 </span> <a href='500fake-screen.mu.html#L216'>draw-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, space
<span id="L17" class="LineNr">17 </span> <a href='500fake-screen.mu.html#L217'>draw-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, space
<span id="L18" class="LineNr">18 </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="L19" class="LineNr">19 </span> <span class="Delimiter">{</span>
<span id="L20" class="LineNr">20 </span> compare key, <span class="Constant">0x68</span>/h

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#L946'>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#L960'>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#L1009'>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#L1023'>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>

40
html/hest-life.mu.html generated
View File

@ -87,7 +87,7 @@ if ('onhashchange' in window) {
<span id="L28" class="LineNr"> 28 </span> <span class="PreProc">var</span> second-screen/<span class="Constant">edi</span>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>) <span class="Special">&lt;-</span> address second-buffer
<span id="L29" class="LineNr"> 29 </span> <a href='500fake-screen.mu.html#L31'>initialize-screen</a> second-screen, <span class="Constant">0x80</span>, <span class="Constant">0x30</span>, <span class="Constant">1</span>/include-pixels
<span id="L30" class="LineNr"> 30 </span> <a href='hest-life.mu.html#L60'>render</a> second-screen, env
<span id="L31" class="LineNr"> 31 </span> <a href='500fake-screen.mu.html#L523'>copy-pixels</a> second-screen, <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L31" class="LineNr"> 31 </span> <a href='500fake-screen.mu.html#L524'>copy-pixels</a> second-screen, <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L32" class="LineNr"> 32 </span> <span class="Delimiter">{</span>
<span id="L33" class="LineNr"> 33 </span> <a href='hest-life.mu.html#L592'>edit</a> keyboard, env
<span id="L34" class="LineNr"> 34 </span> <span class="PreProc">var</span> play?/<span class="Constant">eax</span>: (addr boolean) <span class="Special">&lt;-</span> get env, play?
@ -96,7 +96,7 @@ if ('onhashchange' in window) {
<span id="L37" class="LineNr"> 37 </span> <span class="PreProc">break-if-=</span>
<span id="L38" class="LineNr"> 38 </span> <a href='hest-life.mu.html#L676'>step</a> env
<span id="L39" class="LineNr"> 39 </span> <a href='hest-life.mu.html#L60'>render</a> second-screen, env
<span id="L40" class="LineNr"> 40 </span> <a href='500fake-screen.mu.html#L523'>copy-pixels</a> second-screen, <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L40" class="LineNr"> 40 </span> <a href='500fake-screen.mu.html#L524'>copy-pixels</a> second-screen, <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L41" class="LineNr"> 41 </span> <span class="Delimiter">}</span>
<span id="L42" class="LineNr"> 42 </span> <a href='hest-life.mu.html#L1016'>linger</a> env
<span id="L43" class="LineNr"> 43 </span> <span class="PreProc">loop</span>
@ -122,13 +122,13 @@ if ('onhashchange' in window) {
<span id="L63" class="LineNr"> 63 </span> compare *zoom, <span class="Constant">0</span>
<span id="L64" class="LineNr"> 64 </span> <span class="Delimiter">{</span>
<span id="L65" class="LineNr"> 65 </span> <span class="PreProc">break-if-!=</span>
<span id="L66" class="LineNr"> 66 </span> <a href='500fake-screen.mu.html#L230'>clear-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L66" class="LineNr"> 66 </span> <a href='500fake-screen.mu.html#L231'>clear-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L67" class="LineNr"> 67 </span> <a href='hest-life.mu.html#L89'>render0</a> <a href='500fake-screen.mu.html#L14'>screen</a>, self
<span id="L68" class="LineNr"> 68 </span> <span class="Delimiter">}</span>
<span id="L69" class="LineNr"> 69 </span> compare *zoom, <span class="Constant">1</span>
<span id="L70" class="LineNr"> 70 </span> <span class="Delimiter">{</span>
<span id="L71" class="LineNr"> 71 </span> <span class="PreProc">break-if-!=</span>
<span id="L72" class="LineNr"> 72 </span> <a href='500fake-screen.mu.html#L230'>clear-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L72" class="LineNr"> 72 </span> <a href='500fake-screen.mu.html#L231'>clear-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L73" class="LineNr"> 73 </span> <a href='hest-life.mu.html#L209'>render1</a> <a href='500fake-screen.mu.html#L14'>screen</a>, self
<span id="L74" class="LineNr"> 74 </span> <span class="Delimiter">}</span>
<span id="L75" class="LineNr"> 75 </span> compare *zoom, <span class="Constant">4</span>
@ -138,8 +138,8 @@ if ('onhashchange' in window) {
<span id="L79" class="LineNr"> 79 </span> <span class="Delimiter">}</span>
<span id="L80" class="LineNr"> 80 </span> <span class="muComment"># clock</span>
<span id="L81" class="LineNr"> 81 </span> <span class="PreProc">var</span> tick-a/<span class="Constant">eax</span>: (addr int) <span class="Special">&lt;-</span> get self, tick
<span id="L82" class="LineNr"> 82 </span> <a href='500fake-screen.mu.html#L169'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x78</span>/x, <span class="Constant">0</span>/y
<span id="L83" class="LineNr"> 83 </span> <a href='501draw-text.mu.html#L366'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, *tick-a, <span class="Constant">7</span>/fg <span class="Constant">0</span>/bg
<span id="L82" class="LineNr"> 82 </span> <a href='500fake-screen.mu.html#L170'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x78</span>/x, <span class="Constant">0</span>/y
<span id="L83" class="LineNr"> 83 </span> <a href='501draw-text.mu.html#L387'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, *tick-a, <span class="Constant">7</span>/fg <span class="Constant">0</span>/bg
<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="muComment"># Lots of hardcoded constants for now.</span>
@ -172,8 +172,8 @@ if ('onhashchange' in window) {
<span id="L113" class="LineNr"> 113 </span> <a href='507line.mu.html#L86'>draw-rect</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x350</span>/xmin <span class="Constant">0x170</span>/ymin, <span class="Constant">0x370</span>/xmax <span class="Constant">0x190</span>/ymax, color
<span id="L114" class="LineNr"> 114 </span> <span class="muComment"># sum node</span>
<span id="L115" class="LineNr"> 115 </span> <a href='507line.mu.html#L86'>draw-rect</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x170</span>/xsmin <span class="Constant">0x140</span>/ysmin, <span class="Constant">0x190</span>/xsmax <span class="Constant">0x160</span>/ysmax, <span class="Constant">0x40</span>/color
<span id="L116" class="LineNr"> 116 </span> <a href='500fake-screen.mu.html#L169'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x2d</span>/scol, <span class="Constant">0x13</span>/srow
<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> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;+&quot;</span>, <span class="Constant">0xf</span>/color, <span class="Constant">0</span>/bg
<span id="L116" class="LineNr"> 116 </span> <a href='500fake-screen.mu.html#L170'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x2d</span>/scol, <span class="Constant">0x13</span>/srow
<span id="L117" class="LineNr"> 117 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;+&quot;</span>, <span class="Constant">0xf</span>/color, <span class="Constant">0</span>/bg
<span id="L118" class="LineNr"> 118 </span> <span class="muComment"># conveyors from neighboring inputs to sum node</span>
<span id="L119" class="LineNr"> 119 </span> <a href='509bezier.mu.html#L14'>draw-monotonic-bezier</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0xa0</span>/x0 <span class="Constant">0x20</span>/y0, <span class="Constant">0x100</span>/x1 <span class="Constant">0x150</span>/ys, <span class="Constant">0x180</span>/xs <span class="Constant">0x150</span>/ys, <span class="Constant">4</span>/color
<span id="L120" class="LineNr"> 120 </span> <a href='509bezier.mu.html#L14'>draw-monotonic-bezier</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0xa0</span>/x0 <span class="Constant">0x180</span>/y0, <span class="Constant">0xc0</span>/x1 <span class="Constant">0x150</span>/ys, <span class="Constant">0x180</span>/xs <span class="Constant">0x150</span>/ys, <span class="Constant">4</span>/color
@ -185,8 +185,8 @@ if ('onhashchange' in window) {
<span id="L126" class="LineNr"> 126 </span> <a href='509bezier.mu.html#L14'>draw-monotonic-bezier</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x360</span>/x0 <span class="Constant">0x2e0</span>/y0, <span class="Constant">0x180</span>/x1 <span class="Constant">0x200</span>/y1, <span class="Constant">0x180</span>/xs <span class="Constant">0x150</span>/ys, <span class="Constant">4</span>/color
<span id="L127" class="LineNr"> 127 </span> <span class="muComment"># filter node</span>
<span id="L128" class="LineNr"> 128 </span> <a href='507line.mu.html#L86'>draw-rect</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x200</span>/xfmin <span class="Constant">0x1c0</span>/yfmin, <span class="Constant">0x220</span>/xfmax <span class="Constant">0x1e0</span>/yfmax, <span class="Constant">0x31</span>/color
<span id="L129" class="LineNr"> 129 </span> <a href='500fake-screen.mu.html#L169'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x40</span>/fcol, <span class="Constant">0x1b</span>/frow
<span id="L130" class="LineNr"> 130 </span> <a href='501draw-text.mu.html#L258'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;?&quot;</span>, <span class="Constant">0xf</span>/color, <span class="Constant">0</span>/bg
<span id="L129" class="LineNr"> 129 </span> <a href='500fake-screen.mu.html#L170'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x40</span>/fcol, <span class="Constant">0x1b</span>/frow
<span id="L130" class="LineNr"> 130 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;?&quot;</span>, <span class="Constant">0xf</span>/color, <span class="Constant">0</span>/bg
<span id="L131" class="LineNr"> 131 </span> <span class="muComment"># conveyor from sum node to filter node</span>
<span id="L132" class="LineNr"> 132 </span> <a href='507line.mu.html#L1'>draw-line</a> <a href='500fake-screen.mu.html#L14'>screen</a> <span class="Constant">0x180</span>/xs, <span class="Constant">0x150</span>/ys, <span class="Constant">0x210</span>/xf, <span class="Constant">0x1d0</span>/yf, <span class="Constant">0xa2</span>/color
<span id="L133" class="LineNr"> 133 </span> <span class="muComment"># cell outputs at corners</span>
@ -243,9 +243,9 @@ if ('onhashchange' in window) {
<span id="L184" class="LineNr"> 184 </span> <span class="PreProc">var</span> three-f/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> convert three
<span id="L185" class="LineNr"> 185 </span> u <span class="Special">&lt;-</span> divide three-f
<span id="L186" class="LineNr"> 186 </span> <a href='hest-life.mu.html#L585'>draw-linear-point</a> <a href='500fake-screen.mu.html#L14'>screen</a>, u, <span class="Constant">0x180</span>/xs, <span class="Constant">0x150</span>/ys, <span class="Constant">0x210</span>/xf, <span class="Constant">0x1d0</span>/yf, <span class="Constant">7</span>/color, <span class="Constant">4</span>/radius
<span id="L187" class="LineNr"> 187 </span> <a href='500fake-screen.mu.html#L169'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x3a</span>/scol, <span class="Constant">0x18</span>/srow
<span id="L187" class="LineNr"> 187 </span> <a href='500fake-screen.mu.html#L170'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x3a</span>/scol, <span class="Constant">0x18</span>/srow
<span id="L188" class="LineNr"> 188 </span> <span class="PreProc">var</span> n/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='hest-life.mu.html#L950'>num-live-neighbors</a> self, <span class="Constant">0x80</span>/curx, <span class="Constant">0x60</span>/cury
<span id="L189" class="LineNr"> 189 </span> <a href='501draw-text.mu.html#L366'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, n, <span class="Constant">0xf</span>/fg <span class="Constant">0</span>/bg
<span id="L189" class="LineNr"> 189 </span> <a href='501draw-text.mu.html#L387'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, n, <span class="Constant">0xf</span>/fg <span class="Constant">0</span>/bg
<span id="L190" class="LineNr"> 190 </span> <span class="PreProc">return</span>
<span id="L191" class="LineNr"> 191 </span> <span class="Delimiter">}</span>
<span id="L192" class="LineNr"> 192 </span> <span class="muComment"># final 7 time steps for updating output</span>
@ -361,17 +361,17 @@ if ('onhashchange' in window) {
<span id="L302" class="LineNr"> 302 </span> <a href='507line.mu.html#L86'>draw-rect</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x2a0</span>/xfmin <span class="Constant">0x218</span>/yfmin, <span class="Constant">0x2b0</span>/xfmax <span class="Constant">0x228</span>/yfmax, <span class="Constant">0x31</span>/color
<span id="L303" class="LineNr"> 303 </span> <span class="muComment"># neighbor counts</span>
<span id="L304" class="LineNr"> 304 </span> <span class="PreProc">var</span> n/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='hest-life.mu.html#L950'>num-live-neighbors</a> self, <span class="Constant">0x80</span>/curx, <span class="Constant">0x60</span>/cury
<span id="L305" class="LineNr"> 305 </span> <a href='500fake-screen.mu.html#L169'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x2d</span>, <span class="Constant">0xe</span>
<span id="L306" class="LineNr"> 306 </span> <a href='501draw-text.mu.html#L366'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, n, <span class="Constant">0xf</span>/fg <span class="Constant">0</span>/bg
<span id="L305" class="LineNr"> 305 </span> <a href='500fake-screen.mu.html#L170'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x2d</span>, <span class="Constant">0xe</span>
<span id="L306" class="LineNr"> 306 </span> <a href='501draw-text.mu.html#L387'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, n, <span class="Constant">0xf</span>/fg <span class="Constant">0</span>/bg
<span id="L307" class="LineNr"> 307 </span> <span class="PreProc">var</span> n/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='hest-life.mu.html#L950'>num-live-neighbors</a> self, <span class="Constant">0x81</span>/curx, <span class="Constant">0x60</span>/cury
<span id="L308" class="LineNr"> 308 </span> <a href='500fake-screen.mu.html#L169'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x52</span>, <span class="Constant">0xe</span>
<span id="L309" class="LineNr"> 309 </span> <a href='501draw-text.mu.html#L366'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, n, <span class="Constant">0xf</span>/fg <span class="Constant">0</span>/bg
<span id="L308" class="LineNr"> 308 </span> <a href='500fake-screen.mu.html#L170'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x52</span>, <span class="Constant">0xe</span>
<span id="L309" class="LineNr"> 309 </span> <a href='501draw-text.mu.html#L387'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, n, <span class="Constant">0xf</span>/fg <span class="Constant">0</span>/bg
<span id="L310" class="LineNr"> 310 </span> <span class="PreProc">var</span> n/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='hest-life.mu.html#L950'>num-live-neighbors</a> self, <span class="Constant">0x80</span>/curx, <span class="Constant">0x61</span>/cury
<span id="L311" class="LineNr"> 311 </span> <a href='500fake-screen.mu.html#L169'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x2d</span>, <span class="Constant">0x20</span>
<span id="L312" class="LineNr"> 312 </span> <a href='501draw-text.mu.html#L366'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, n, <span class="Constant">0xf</span>/fg <span class="Constant">0</span>/bg
<span id="L311" class="LineNr"> 311 </span> <a href='500fake-screen.mu.html#L170'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x2d</span>, <span class="Constant">0x20</span>
<span id="L312" class="LineNr"> 312 </span> <a href='501draw-text.mu.html#L387'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, n, <span class="Constant">0xf</span>/fg <span class="Constant">0</span>/bg
<span id="L313" class="LineNr"> 313 </span> <span class="PreProc">var</span> n/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='hest-life.mu.html#L950'>num-live-neighbors</a> self, <span class="Constant">0x81</span>/curx, <span class="Constant">0x61</span>/cury
<span id="L314" class="LineNr"> 314 </span> <a href='500fake-screen.mu.html#L169'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x52</span>, <span class="Constant">0x20</span>
<span id="L315" class="LineNr"> 315 </span> <a href='501draw-text.mu.html#L366'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, n, <span class="Constant">0xf</span>/fg <span class="Constant">0</span>/bg
<span id="L314" class="LineNr"> 314 </span> <a href='500fake-screen.mu.html#L170'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x52</span>, <span class="Constant">0x20</span>
<span id="L315" class="LineNr"> 315 </span> <a href='501draw-text.mu.html#L387'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, n, <span class="Constant">0xf</span>/fg <span class="Constant">0</span>/bg
<span id="L316" class="LineNr"> 316 </span> <span class="muComment"># cell 0: conveyors from neighboring inputs to sum node</span>
<span id="L317" class="LineNr"> 317 </span> <a href='509bezier.mu.html#L14'>draw-monotonic-bezier</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0xc0</span>/x0 <span class="Constant">0x40</span>/y0, <span class="Constant">0x100</span>/x1 <span class="Constant">0xd0</span>/ys, <span class="Constant">0x150</span>/xs <span class="Constant">0xd0</span>/ys, <span class="Constant">4</span>/color
<span id="L318" class="LineNr"> 318 </span> <a href='509bezier.mu.html#L14'>draw-monotonic-bezier</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0xc0</span>/x0 <span class="Constant">0xe8</span>/y0, <span class="Constant">0xc0</span>/x1 <span class="Constant">0xd0</span>/ys, <span class="Constant">0x150</span>/xs <span class="Constant">0xd0</span>/ys, <span class="Constant">4</span>/color

View File

@ -209,7 +209,7 @@ if ('onhashchange' in window) {
<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="L153" class="LineNr">153 </span> <a href='500fake-screen.mu.html#L463'>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>

View File

@ -119,7 +119,7 @@ if ('onhashchange' in window) {
<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="L64" class="LineNr"> 64 </span> <a href='500fake-screen.mu.html#L463'>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>

View File

@ -77,10 +77,10 @@ if ('onhashchange' in window) {
<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="L24" class="LineNr">24 </span> (<a href='500fake-screen.mu.html#L365'>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="L27" class="LineNr">27 </span> (main 0 0 <span class="SpecialChar"><a href='boot.subx.html#L934'>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>

4
html/rpn.mu.html generated
View File

@ -85,7 +85,7 @@ if ('onhashchange' in window) {
<span id="L27" class="LineNr"> 27 </span> <span class="muComment"># read line from keyboard</span>
<span id="L28" class="LineNr"> 28 </span> <a href='106stream.subx.html#L20'>clear-stream</a> in
<span id="L29" class="LineNr"> 29 </span> <span class="Delimiter">{</span>
<span id="L30" class="LineNr"> 30 </span> <a href='500fake-screen.mu.html#L216'>draw-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, space
<span id="L30" class="LineNr"> 30 </span> <a href='500fake-screen.mu.html#L217'>draw-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, space
<span id="L31" class="LineNr"> 31 </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="L32" class="LineNr"> 32 </span> compare key, <span class="Constant">0xa</span>/newline
<span id="L33" class="LineNr"> 33 </span> <span class="PreProc">break-if-=</span>
@ -104,7 +104,7 @@ if ('onhashchange' in window) {
<span id="L46" class="LineNr"> 46 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='rpn.mu.html#L62'>simplify</a> in
<span id="L47" class="LineNr"> 47 </span> <span class="muComment"># print</span>
<span id="L48" class="LineNr"> 48 </span> y <span class="Special">&lt;-</span> increment
<span id="L49" class="LineNr"> 49 </span> out, y <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L319'>draw-int32-decimal-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L14'>screen</a>, out, <span class="Constant">0</span>/xmin, y, <span class="Constant">0x80</span>/xmax, <span class="Constant">0x30</span>/ymax, <span class="Constant">0</span>/x, y, <span class="Constant">7</span>/fg, <span class="Constant">0</span>/bg
<span id="L49" class="LineNr"> 49 </span> out, y <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L340'>draw-int32-decimal-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L14'>screen</a>, out, <span class="Constant">0</span>/xmin, y, <span class="Constant">0x80</span>/xmax, <span class="Constant">0x30</span>/ymax, <span class="Constant">0</span>/x, y, <span class="Constant">7</span>/fg, <span class="Constant">0</span>/bg
<span id="L50" class="LineNr"> 50 </span> <span class="muComment"># newline</span>
<span id="L51" class="LineNr"> 51 </span> y <span class="Special">&lt;-</span> increment
<span id="L52" class="LineNr"> 52 </span> <span class="muComment">#</span>

View File

@ -229,7 +229,7 @@ if ('onhashchange' in window) {
<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="L174" class="LineNr">174 </span> <a href='../500fake-screen.mu.html#L231'>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>

File diff suppressed because it is too large Load Diff

View File

@ -203,7 +203,7 @@ if ('onhashchange' in window) {
<span id="L144" class="LineNr"> 144 </span> <span class="Delimiter">}</span>
<span id="L145" class="LineNr"> 145 </span> <span class="muComment"># print a grapheme either way so that cursor position doesn't affect printed width</span>
<span id="L146" class="LineNr"> 146 </span> <span class="PreProc">var</span> space/<span class="Constant">edx</span>: grapheme <span class="Special">&lt;-</span> copy <span class="Constant">0x20</span>
<span id="L147" class="LineNr"> 147 </span> x2, y2 <span class="Special">&lt;-</span> <a href='../501draw-text.mu.html#L141'>render-grapheme</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, space, xmin, ymin, xmax, ymax, x2, y2, color, bg
<span id="L147" class="LineNr"> 147 </span> x2, y2 <span class="Special">&lt;-</span> <a href='../501draw-text.mu.html#L148'>render-grapheme</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, space, xmin, ymin, xmax, ymax, x2, y2, color, bg
<span id="L148" class="LineNr"> 148 </span> <span class="PreProc">return</span> x2, y2
<span id="L149" class="LineNr"> 149 </span><span class="Delimiter">}</span>
<span id="L150" class="LineNr"> 150 </span>

File diff suppressed because it is too large Load Diff

View File

@ -168,7 +168,7 @@ if ('onhashchange' in window) {
<span id="L109" class="LineNr">109 </span> <span class="PreProc">break-if-!=</span>
<span id="L110" class="LineNr">110 </span> copy-to fg, <span class="Constant">0xf</span>/highlight
<span id="L111" class="LineNr">111 </span> <span class="Delimiter">}</span>
<span id="L112" class="LineNr">112 </span> x, y <span class="Special">&lt;-</span> <a href='../501draw-text.mu.html#L141'>render-grapheme</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, *g, xmin, ymin, xmax, ymax, x, y, fg, background-color
<span id="L112" class="LineNr">112 </span> x, y <span class="Special">&lt;-</span> <a href='../501draw-text.mu.html#L148'>render-grapheme</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, *g, xmin, ymin, xmax, ymax, x, y, fg, background-color
<span id="L113" class="LineNr">113 </span> <span class="Delimiter">}</span>
<span id="L114" class="LineNr">114 </span> i <span class="Special">&lt;-</span> increment
<span id="L115" class="LineNr">115 </span> <span class="PreProc">loop</span>
@ -212,7 +212,7 @@ if ('onhashchange' in window) {
<span id="L153" class="LineNr">153 </span> compare i, <span class="Constant">0</span>
<span id="L154" class="LineNr">154 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L155" class="LineNr">155 </span> <span class="PreProc">var</span> g/<span class="Constant">esi</span>: (addr grapheme) <span class="Special">&lt;-</span> index data, i
<span id="L156" class="LineNr">156 </span> x, y <span class="Special">&lt;-</span> <a href='../501draw-text.mu.html#L141'>render-grapheme</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, *g, xmin, ymin, xmax, ymax, x, y, color, <span class="Constant">7</span>/bg=cursor
<span id="L156" class="LineNr">156 </span> x, y <span class="Special">&lt;-</span> <a href='../501draw-text.mu.html#L148'>render-grapheme</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, *g, xmin, ymin, xmax, ymax, x, y, color, <span class="Constant">7</span>/bg=cursor
<span id="L157" class="LineNr">157 </span> i <span class="Special">&lt;-</span> decrement
<span id="L158" class="LineNr">158 </span> <span class="Delimiter">}</span>
<span id="L159" class="LineNr">159 </span> <span class="muComment"># remaining iterations</span>
@ -232,7 +232,7 @@ if ('onhashchange' in window) {
<span id="L173" class="LineNr">173 </span> <span class="Delimiter">}</span>
<span id="L174" class="LineNr">174 </span> <span class="muComment">#</span>
<span id="L175" class="LineNr">175 </span> <span class="PreProc">var</span> g/<span class="Constant">esi</span>: (addr grapheme) <span class="Special">&lt;-</span> index data, i
<span id="L176" class="LineNr">176 </span> x, y <span class="Special">&lt;-</span> <a href='../501draw-text.mu.html#L141'>render-grapheme</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, *g, xmin, ymin, xmax, ymax, x, y, fg, background-color
<span id="L176" class="LineNr">176 </span> x, y <span class="Special">&lt;-</span> <a href='../501draw-text.mu.html#L148'>render-grapheme</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, *g, xmin, ymin, xmax, ymax, x, y, fg, background-color
<span id="L177" class="LineNr">177 </span> i <span class="Special">&lt;-</span> decrement
<span id="L178" class="LineNr">178 </span> <span class="PreProc">loop</span>
<span id="L179" class="LineNr">179 </span> <span class="Delimiter">}</span>

View File

@ -60,368 +60,513 @@ if ('onhashchange' in window) {
<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="L2" class="Folded"> 2 </span><span class="Folded">+-- 15 lines: # trace &quot;macroexpand &quot; expr-ah --------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="L17" class="LineNr"> 17 </span> <a href='trace.mu.html#L228'>trace-lower</a> trace
<span id="L18" class="LineNr"> 18 </span> <span class="muComment"># loop until convergence</span>
<span id="L19" class="LineNr"> 19 </span> <span class="Delimiter">{</span>
<span id="L20" class="LineNr"> 20 </span> <span class="PreProc">var</span> error?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='trace.mu.html#L83'>has-errors?</a> trace
<span id="L21" class="LineNr"> 21 </span> compare error?, <span class="Constant">0</span>/false
<span id="L22" class="LineNr"> 22 </span> <span class="PreProc">break-if-!=</span>
<span id="L23" class="LineNr"> 23 </span> <span class="PreProc">var</span> expanded?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='macroexpand.mu.html#L46'>macroexpand-iter</a> expr-ah, globals, trace
<span id="L24" class="LineNr"> 24 </span> compare expanded?, <span class="Constant">0</span>/false
<span id="L25" class="LineNr"> 25 </span> <span class="PreProc">loop-if-!=</span>
<span id="L26" class="LineNr"> 26 </span> <span class="Delimiter">}</span>
<span id="L27" class="LineNr"> 27 </span> <a href='trace.mu.html#L239'>trace-higher</a> trace
<span id="L28" class="Folded"> 28 </span><span class="Folded">+-- 15 lines: # trace &quot;=&gt; &quot; expr-ah -----------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="L43" class="LineNr"> 43 </span><span class="Delimiter">}</span>
<span id="L44" class="LineNr"> 44 </span>
<span id="L45" class="LineNr"> 45 </span><span class="muComment"># return true if we found any macros</span>
<span id="L46" class="LineNr"> 46 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='macroexpand.mu.html#L46'>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="L47" class="LineNr"> 47 </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="L48" class="Folded"> 48 </span><span class="Folded">+-- 15 lines: # trace &quot;macroexpand-iter &quot; expr ------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="L63" class="LineNr"> 63 </span> <a href='trace.mu.html#L228'>trace-lower</a> trace
<span id="L64" class="LineNr"> 64 </span> <span class="muComment"># if expr is a non-pair, return</span>
<span id="L65" class="LineNr"> 65 </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="L66" class="LineNr"> 66 </span> <span class="Delimiter">{</span>
<span id="L67" class="LineNr"> 67 </span> <span class="PreProc">var</span> <a href='print.mu.html#L347'>nil?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='print.mu.html#L347'>nil?</a> expr
<span id="L68" class="LineNr"> 68 </span> compare <a href='print.mu.html#L347'>nil?</a>, <span class="Constant">0</span>/false
<span id="L69" class="LineNr"> 69 </span> <span class="PreProc">break-if-=</span>
<span id="L70" class="LineNr"> 70 </span> <span class="muComment"># nil is a literal</span>
<span id="L71" class="LineNr"> 71 </span> <a href='trace.mu.html#L174'>trace-text</a> trace, <span class="Constant">&quot;mac&quot;</span>, <span class="Constant">&quot;nil&quot;</span>
<span id="L72" class="LineNr"> 72 </span> <a href='trace.mu.html#L239'>trace-higher</a> trace
<span id="L73" class="LineNr"> 73 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L74" class="LineNr"> 74 </span> <span class="Delimiter">}</span>
<span id="L75" class="LineNr"> 75 </span> <span class="Delimiter">{</span>
<span id="L76" class="LineNr"> 76 </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="L77" class="LineNr"> 77 </span> compare *expr-type, <span class="Constant">0</span>/pair
<span id="L78" class="LineNr"> 78 </span> <span class="PreProc">break-if-=</span>
<span id="L79" class="LineNr"> 79 </span> <span class="muComment"># non-pairs are literals</span>
<span id="L80" class="LineNr"> 80 </span> <a href='trace.mu.html#L174'>trace-text</a> trace, <span class="Constant">&quot;mac&quot;</span>, <span class="Constant">&quot;non-pair&quot;</span>
<span id="L81" class="LineNr"> 81 </span> <a href='trace.mu.html#L239'>trace-higher</a> trace
<span id="L82" class="LineNr"> 82 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L83" class="LineNr"> 83 </span> <span class="Delimiter">}</span>
<span id="L84" class="LineNr"> 84 </span> <span class="muComment"># if expr is a literal pair, return</span>
<span id="L85" class="LineNr"> 85 </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="L86" class="LineNr"> 86 </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="L87" class="LineNr"> 87 </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="L88" class="LineNr"> 88 </span> <span class="Delimiter">{</span>
<span id="L89" class="LineNr"> 89 </span> <span class="PreProc">var</span> <a href='evaluate.mu.html#L1370'>litfn?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='evaluate.mu.html#L1370'>litfn?</a> first
<span id="L90" class="LineNr"> 90 </span> compare <a href='evaluate.mu.html#L1370'>litfn?</a>, <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="muComment"># litfn is a literal</span>
<span id="L93" class="LineNr"> 93 </span> <a href='trace.mu.html#L174'>trace-text</a> trace, <span class="Constant">&quot;mac&quot;</span>, <span class="Constant">&quot;literal function&quot;</span>
<span id="L94" class="LineNr"> 94 </span> <a href='trace.mu.html#L239'>trace-higher</a> trace
<span id="L95" class="LineNr"> 95 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L96" class="LineNr"> 96 </span> <span class="Delimiter">}</span>
<span id="L97" class="LineNr"> 97 </span> <span class="Delimiter">{</span>
<span id="L98" class="LineNr"> 98 </span> <span class="PreProc">var</span> <a href='evaluate.mu.html#L1384'>litmac?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='evaluate.mu.html#L1384'>litmac?</a> first
<span id="L99" class="LineNr"> 99 </span> compare <a href='evaluate.mu.html#L1384'>litmac?</a>, <span class="Constant">0</span>/false
<span id="L100" class="LineNr">100 </span> <span class="PreProc">break-if-=</span>
<span id="L101" class="LineNr">101 </span> <span class="muComment"># litmac is a literal</span>
<span id="L102" class="LineNr">102 </span> <a href='trace.mu.html#L174'>trace-text</a> trace, <span class="Constant">&quot;mac&quot;</span>, <span class="Constant">&quot;literal macro&quot;</span>
<span id="L103" class="LineNr">103 </span> <a href='trace.mu.html#L239'>trace-higher</a> trace
<span id="L104" class="LineNr">104 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L105" class="LineNr">105 </span> <span class="Delimiter">}</span>
<span id="L106" class="LineNr">106 </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="L107" class="LineNr">107 </span> <span class="muComment"># for each builtin, expand only what will later be evaluated</span>
<span id="L108" class="LineNr">108 </span> $macroexpand-iter:anonymous-function: <span class="Delimiter">{</span>
<span id="L109" class="LineNr">109 </span> <span class="PreProc">var</span> <a href='evaluate.mu.html#L1356'>fn?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='evaluate.mu.html#L1356'>fn?</a> first
<span id="L110" class="LineNr">110 </span> compare <a href='evaluate.mu.html#L1356'>fn?</a>, <span class="Constant">0</span>/false
<span id="L111" class="LineNr">111 </span> <span class="PreProc">break-if-=</span>
<span id="L112" class="LineNr">112 </span> <span class="muComment"># fn: expand every expression in the body</span>
<span id="L113" class="LineNr">113 </span> <a href='trace.mu.html#L174'>trace-text</a> trace, <span class="Constant">&quot;mac&quot;</span>, <span class="Constant">&quot;anonymous function&quot;</span>
<span id="L114" class="LineNr">114 </span> <span class="muComment"># skip parameters</span>
<span id="L115" class="LineNr">115 </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="L116" class="LineNr">116 </span> <span class="Delimiter">{</span>
<span id="L117" class="LineNr">117 </span> rest-ah <span class="Special">&lt;-</span> get rest, right
<span id="L118" class="LineNr">118 </span> rest <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *rest-ah
<span id="L119" class="LineNr">119 </span> <span class="Delimiter">{</span>
<span id="L120" class="LineNr">120 </span> <span class="PreProc">var</span> done?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='print.mu.html#L347'>nil?</a> rest
<span id="L121" class="LineNr">121 </span> compare done?, <span class="Constant">0</span>/false
<span id="L122" class="LineNr">122 </span> <span class="Delimiter">}</span>
<span id="L123" class="LineNr">123 </span> <span class="PreProc">break-if-!=</span>
<span id="L124" class="LineNr">124 </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="L125" class="LineNr">125 </span> <span class="PreProc">var</span> macro-found?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='macroexpand.mu.html#L46'>macroexpand-iter</a> curr-ah, globals, trace
<span id="L126" class="LineNr">126 </span> result <span class="Special">&lt;-</span> or macro-found?
<span id="L127" class="LineNr">127 </span> <span class="Delimiter">{</span>
<span id="L128" class="LineNr">128 </span> <span class="PreProc">var</span> error?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='trace.mu.html#L83'>has-errors?</a> trace
<span id="L129" class="LineNr">129 </span> compare error?, <span class="Constant">0</span>/false
<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#L239'>trace-higher</a> trace
<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 class="PreProc">loop</span>
<span id="L135" class="LineNr">135 </span> <span class="Delimiter">}</span>
<span id="L136" class="LineNr">136 </span> <a href='trace.mu.html#L239'>trace-higher</a> trace
<span id="L137" class="Folded">137 </span><span class="Folded">+-- 15 lines: # trace &quot;fn=&gt; &quot; _expr-ah --------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="L152" class="LineNr">152 </span> <span class="PreProc">return</span> result
<span id="L153" class="LineNr">153 </span> <span class="Delimiter">}</span>
<span id="L154" class="LineNr">154 </span> <span class="muComment"># builtins with &quot;special&quot; evaluation rules</span>
<span id="L155" class="LineNr">155 </span> $macroexpand-iter:quote: <span class="Delimiter">{</span>
<span id="L156" class="LineNr">156 </span> <span class="muComment"># trees starting with single quote create literals</span>
<span id="L157" class="LineNr">157 </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="L158" class="LineNr">158 </span> compare quote?, <span class="Constant">0</span>/false
<span id="L159" class="LineNr">159 </span> <span class="PreProc">break-if-=</span>
<span id="L160" class="LineNr">160 </span> <span class="muComment">#</span>
<span id="L161" class="LineNr">161 </span> <a href='trace.mu.html#L174'>trace-text</a> trace, <span class="Constant">&quot;mac&quot;</span>, <span class="Constant">&quot;quote&quot;</span>
<span id="L162" class="LineNr">162 </span> <a href='trace.mu.html#L239'>trace-higher</a> trace
<span id="L163" class="LineNr">163 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<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>
<span id="L165" class="LineNr">165 </span> $macroexpand-iter:backquote: <span class="Delimiter">{</span>
<span id="L166" class="LineNr">166 </span> <span class="muComment"># nested backquote not supported for now</span>
<span id="L167" class="LineNr">167 </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="L168" class="LineNr">168 </span> compare backquote?, <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> <span class="muComment">#</span>
<span id="L171" class="LineNr">171 </span><span class="CommentedCode">#? set-cursor-position 0/screen, 0x40/x 0x10/y</span>
<span id="L172" class="LineNr">172 </span><span class="CommentedCode">#? dump-cell-from-cursor-over-full-screen rest-ah</span>
<span id="L173" class="LineNr">173 </span> <span class="PreProc">var</span> double-unquote-found?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='macroexpand.mu.html#L331'>look-for-double-unquote</a> rest-ah
<span id="L174" class="LineNr">174 </span> compare double-unquote-found?, <span class="Constant">0</span>/false
<span id="L175" class="LineNr">175 </span> <span class="Delimiter">{</span>
<span id="L176" class="LineNr">176 </span> <span class="PreProc">break-if-=</span>
<span id="L177" class="LineNr">177 </span> <span class="Special"><a href='trace.mu.html#L186'>error</a></span> trace, <span class="Constant">&quot;double unquote not supported yet&quot;</span>
<span id="L178" class="LineNr">178 </span> <span class="Delimiter">}</span>
<span id="L179" class="LineNr">179 </span> <a href='trace.mu.html#L239'>trace-higher</a> trace
<span id="L180" class="LineNr">180 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L181" class="LineNr">181 </span> <span class="Delimiter">}</span>
<span id="L182" class="LineNr">182 </span> $macroexpand-iter:def: <span class="Delimiter">{</span>
<span id="L183" class="LineNr">183 </span> <span class="muComment"># trees starting with &quot;def&quot; define globals</span>
<span id="L184" class="LineNr">184 </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="L185" class="LineNr">185 </span> compare def?, <span class="Constant">0</span>/false
<span id="L186" class="LineNr">186 </span> <span class="PreProc">break-if-=</span>
<span id="L187" class="LineNr">187 </span> <span class="muComment">#</span>
<span id="L188" class="LineNr">188 </span> <a href='trace.mu.html#L174'>trace-text</a> trace, <span class="Constant">&quot;mac&quot;</span>, <span class="Constant">&quot;def&quot;</span>
<span id="L189" class="LineNr">189 </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="L190" class="LineNr">190 </span> rest-ah <span class="Special">&lt;-</span> get rest, right <span class="muComment"># skip name</span>
<span id="L191" class="LineNr">191 </span> rest <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *rest-ah
<span id="L192" class="LineNr">192 </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="L193" class="LineNr">193 </span> <span class="PreProc">var</span> macro-found?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='macroexpand.mu.html#L46'>macroexpand-iter</a> val-ah, globals, trace
<span id="L194" class="LineNr">194 </span> <a href='trace.mu.html#L239'>trace-higher</a> trace
<span id="L195" class="Folded">195 </span><span class="Folded">+-- 15 lines: # trace &quot;def=&gt; &quot; _expr-ah -------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="L210" class="LineNr">210 </span> <span class="PreProc">return</span> macro-found?
<span id="L211" class="LineNr">211 </span> <span class="Delimiter">}</span>
<span id="L212" class="LineNr">212 </span> $macroexpand-iter:set: <span class="Delimiter">{</span>
<span id="L213" class="LineNr">213 </span> <span class="muComment"># trees starting with &quot;set&quot; mutate bindings</span>
<span id="L214" class="LineNr">214 </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="L215" class="LineNr">215 </span> compare set?, <span class="Constant">0</span>/false
<span id="L216" class="LineNr">216 </span> <span class="PreProc">break-if-=</span>
<span id="L217" class="LineNr">217 </span> <span class="muComment">#</span>
<span id="L218" class="LineNr">218 </span> <a href='trace.mu.html#L174'>trace-text</a> trace, <span class="Constant">&quot;mac&quot;</span>, <span class="Constant">&quot;set&quot;</span>
<span id="L219" class="LineNr">219 </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="L220" class="LineNr">220 </span> rest-ah <span class="Special">&lt;-</span> get rest, right <span class="muComment"># skip name</span>
<span id="L221" class="LineNr">221 </span> rest <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *rest-ah
<span id="L222" class="LineNr">222 </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="L223" class="LineNr">223 </span> <span class="PreProc">var</span> macro-found?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='macroexpand.mu.html#L46'>macroexpand-iter</a> val-ah, globals, trace
<span id="L224" class="LineNr">224 </span> <a href='trace.mu.html#L239'>trace-higher</a> trace
<span id="L225" class="Folded">225 </span><span class="Folded">+-- 15 lines: # trace &quot;set=&gt; &quot; _expr-ah -------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="L240" class="LineNr">240 </span> <span class="PreProc">return</span> macro-found?
<span id="L241" class="LineNr">241 </span> <span class="Delimiter">}</span>
<span id="L242" class="LineNr">242 </span> <span class="muComment"># 'and' is like a function for macroexpansion purposes</span>
<span id="L243" class="LineNr">243 </span> <span class="muComment"># 'or' is like a function for macroexpansion purposes</span>
<span id="L244" class="LineNr">244 </span> <span class="muComment"># 'if' is like a function for macroexpansion purposes</span>
<span id="L245" class="LineNr">245 </span> <span class="muComment"># 'while' is like a function for macroexpansion purposes</span>
<span id="L246" class="LineNr">246 </span> <span class="muComment"># if car(expr) is a symbol defined as a macro, expand it</span>
<span id="L247" class="LineNr">247 </span> <span class="Delimiter">{</span>
<span id="L248" class="LineNr">248 </span> <span class="PreProc">var</span> definition-h: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L249" class="LineNr">249 </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="L250" class="LineNr">250 </span> <a href='global.mu.html#L401'>maybe-lookup-symbol-in-globals</a> first, definition-ah, globals, trace
<span id="L251" class="LineNr">251 </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="L252" class="LineNr">252 </span> compare definition, <span class="Constant">0</span>
<span id="L253" class="LineNr">253 </span> <span class="PreProc">break-if-=</span>
<span id="L254" class="LineNr">254 </span> <span class="muComment"># definition found</span>
<span id="L255" class="LineNr">255 </span> <span class="Delimiter">{</span>
<span id="L256" class="LineNr">256 </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="L257" class="LineNr">257 </span> compare *definition-type, <span class="Constant">0</span>/pair
<span id="L258" class="LineNr">258 </span> <span class="Delimiter">}</span>
<span id="L259" class="LineNr">259 </span> <span class="PreProc">break-if-!=</span>
<span id="L260" class="LineNr">260 </span> <span class="muComment"># definition is a pair</span>
<span id="L261" class="LineNr">261 </span> <span class="Delimiter">{</span>
<span id="L262" class="LineNr">262 </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="L263" class="LineNr">263 </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="L264" class="LineNr">264 </span> <span class="PreProc">var</span> macro?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='evaluate.mu.html#L1384'>litmac?</a> definition-car
<span id="L265" class="LineNr">265 </span> compare macro?, <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="muComment"># definition is a macro</span>
<span id="L269" class="LineNr">269 </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="L270" class="LineNr">270 </span> <span class="muComment"># TODO: check car(macro-definition) is litfn</span>
<span id="L271" class="LineNr">271 </span><span class="CommentedCode">#? turn-on-debug-print</span>
<span id="L272" class="LineNr">272 </span> <a href='evaluate.mu.html#L586'>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="L273" class="LineNr">273 </span> <a href='trace.mu.html#L239'>trace-higher</a> trace
<span id="L274" class="Folded">274 </span><span class="Folded">+-- 15 lines: # trace &quot;1=&gt; &quot; _expr-ah ---------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="L289" class="LineNr">289 </span> <span class="PreProc">return</span> <span class="Constant">1</span>/true
<span id="L290" class="LineNr">290 </span> <span class="Delimiter">}</span>
<span id="L291" class="LineNr">291 </span> <span class="muComment"># no macro found; process any macros within args</span>
<span id="L292" class="LineNr">292 </span> <a href='trace.mu.html#L174'>trace-text</a> trace, <span class="Constant">&quot;mac&quot;</span>, <span class="Constant">&quot;recursing into function definition&quot;</span>
<span id="L293" class="LineNr">293 </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="L294" class="LineNr">294 </span> $macroexpand-iter:<span class="PreProc">loop</span>: <span class="Delimiter">{</span>
<span id="L295" class="LineNr">295 </span><span class="CommentedCode">#? clear-screen 0/screen</span>
<span id="L296" class="LineNr">296 </span><span class="CommentedCode">#? dump-trace trace</span>
<span id="L297" class="LineNr">297 </span> <span class="PreProc">var</span> macro-found?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='macroexpand.mu.html#L46'>macroexpand-iter</a> curr-ah, globals, trace
<span id="L298" class="LineNr">298 </span> result <span class="Special">&lt;-</span> or macro-found?
<span id="L299" class="LineNr">299 </span> <span class="PreProc">var</span> error?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='trace.mu.html#L83'>has-errors?</a> trace
<span id="L300" class="LineNr">300 </span> compare error?, <span class="Constant">0</span>/false
<span id="L301" class="LineNr">301 </span> <span class="PreProc">break-if-!=</span>
<span id="L302" class="LineNr">302 </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="L303" class="LineNr">303 </span> <span class="Delimiter">{</span>
<span id="L304" class="LineNr">304 </span> <span class="PreProc">var</span> <a href='print.mu.html#L347'>nil?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='print.mu.html#L347'>nil?</a> rest
<span id="L305" class="LineNr">305 </span> compare <a href='print.mu.html#L347'>nil?</a>, <span class="Constant">0</span>/false
<span id="L306" class="LineNr">306 </span> <span class="Delimiter">}</span>
<span id="L307" class="LineNr">307 </span> <span class="PreProc">break-if-!=</span>
<span id="L308" class="LineNr">308 </span> curr-ah <span class="Special">&lt;-</span> get rest, left
<span id="L309" class="LineNr">309 </span> rest-ah <span class="Special">&lt;-</span> get rest, right
<span id="L310" class="LineNr">310 </span> <span class="PreProc">loop</span>
<span id="L311" class="LineNr">311 </span> <span class="Delimiter">}</span>
<span id="L312" class="LineNr">312 </span> <a href='trace.mu.html#L239'>trace-higher</a> trace
<span id="L313" class="Folded">313 </span><span class="Folded">+-- 15 lines: # trace &quot;=&gt; &quot; _expr-ah ----------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="L328" class="LineNr">328 </span> <span class="PreProc">return</span> result
<span id="L329" class="LineNr">329 </span><span class="Delimiter">}</span>
<span id="L330" class="LineNr">330 </span>
<span id="L331" class="LineNr">331 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='macroexpand.mu.html#L331'>look-for-double-unquote</a></span> _expr-ah: (addr handle <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="L332" class="LineNr">332 </span> <span class="muComment"># if expr is a non-pair, return false</span>
<span id="L333" class="LineNr">333 </span> <span class="PreProc">var</span> expr-ah/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _expr-ah
<span id="L334" class="LineNr">334 </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="L335" class="LineNr">335 </span> <span class="Delimiter">{</span>
<span id="L336" class="LineNr">336 </span> <span class="PreProc">var</span> <a href='print.mu.html#L347'>nil?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='print.mu.html#L347'>nil?</a> expr
<span id="L337" class="LineNr">337 </span> compare <a href='print.mu.html#L347'>nil?</a>, <span class="Constant">0</span>/false
<span id="L338" class="LineNr">338 </span> <span class="PreProc">break-if-=</span>
<span id="L339" class="LineNr">339 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L340" class="LineNr">340 </span> <span class="Delimiter">}</span>
<span id="L341" class="LineNr">341 </span> <span class="Delimiter">{</span>
<span id="L342" class="LineNr">342 </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="L343" class="LineNr">343 </span> compare *expr-type, <span class="Constant">0</span>/pair
<span id="L344" class="LineNr">344 </span> <span class="PreProc">break-if-=</span>
<span id="L345" class="LineNr">345 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L346" class="LineNr">346 </span> <span class="Delimiter">}</span>
<span id="L347" class="LineNr">347 </span> <span class="PreProc">var</span> cdr-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="L348" class="LineNr">348 </span> <span class="PreProc">var</span> car-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="L349" class="LineNr">349 </span> <span class="PreProc">var</span> <a href='evaluate.mu.html#L1130'>car</a>/<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> *car-ah
<span id="L350" class="LineNr">350 </span> <span class="muComment"># if car is unquote or unquote-splice, check if cadr is unquote or</span>
<span id="L351" class="LineNr">351 </span> <span class="muComment"># unquote-splice.</span>
<span id="L352" class="LineNr">352 </span> $look-for-double-unquote:<a href='../502test.mu.html#L19'>check</a>: <span class="Delimiter">{</span>
<span id="L353" class="LineNr">353 </span> <span class="muComment"># if car is not an unquote, break</span>
<span id="L354" class="LineNr">354 </span> <span class="Delimiter">{</span>
<span id="L355" class="LineNr">355 </span> <span class="Delimiter">{</span>
<span id="L356" class="LineNr">356 </span> <span class="PreProc">var</span> unquote?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='cell.mu.html#L44'>symbol-equal?</a> <a href='evaluate.mu.html#L1130'>car</a>, <span class="Constant">&quot;,&quot;</span>
<span id="L357" class="LineNr">357 </span> compare unquote?, <span class="Constant">0</span>/false
<span id="L358" class="LineNr">358 </span> <span class="Delimiter">}</span>
<span id="L359" class="LineNr">359 </span> <span class="PreProc">break-if-!=</span>
<span id="L360" class="LineNr">360 </span> <span class="PreProc">var</span> unquote-splice?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='cell.mu.html#L44'>symbol-equal?</a> <a href='evaluate.mu.html#L1130'>car</a>, <span class="Constant">&quot;,@&quot;</span>
<span id="L361" class="LineNr">361 </span> compare unquote-splice?, <span class="Constant">0</span>/false
<span id="L362" class="LineNr">362 </span> <span class="PreProc">break-if-!=</span>
<span id="L363" class="LineNr">363 </span> <span class="PreProc">break</span> $look-for-double-unquote:<a href='../502test.mu.html#L19'>check</a>
<span id="L364" class="LineNr">364 </span> <span class="Delimiter">}</span>
<span id="L365" class="LineNr">365 </span> <span class="muComment"># if cdr is not a pair, break</span>
<span id="L366" class="LineNr">366 </span> <span class="PreProc">var</span> <a href='evaluate.mu.html#L1158'>cdr</a>/<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> *cdr-ah
<span id="L367" class="LineNr">367 </span> <span class="PreProc">var</span> cdr-type/<span class="Constant">ecx</span>: (addr int) <span class="Special">&lt;-</span> get <a href='evaluate.mu.html#L1158'>cdr</a>, <span class="PreProc">type</span>
<span id="L368" class="LineNr">368 </span> compare *cdr-type, <span class="Constant">0</span>/pair
<span id="L369" class="LineNr">369 </span> <span class="PreProc">break-if-!=</span>
<span id="L370" class="LineNr">370 </span> <span class="muComment"># if cadr is not an unquote, break</span>
<span id="L371" class="LineNr">371 </span> <span class="PreProc">var</span> cadr-ah/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get <a href='evaluate.mu.html#L1158'>cdr</a>, left
<span id="L372" class="LineNr">372 </span> <span class="PreProc">var</span> cadr/<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> *cadr-ah
<span id="L373" class="LineNr">373 </span> <span class="Delimiter">{</span>
<span id="L374" class="LineNr">374 </span> <span class="Delimiter">{</span>
<span id="L375" class="LineNr">375 </span> <span class="PreProc">var</span> unquote?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='cell.mu.html#L44'>symbol-equal?</a> cadr, <span class="Constant">&quot;,&quot;</span>
<span id="L376" class="LineNr">376 </span> compare unquote?, <span class="Constant">0</span>/false
<span id="L377" class="LineNr">377 </span> <span class="Delimiter">}</span>
<span id="L378" class="LineNr">378 </span> <span class="PreProc">break-if-!=</span>
<span id="L379" class="LineNr">379 </span> <span class="PreProc">var</span> unquote-splice?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='cell.mu.html#L44'>symbol-equal?</a> cadr, <span class="Constant">&quot;,@&quot;</span>
<span id="L380" class="LineNr">380 </span> compare unquote-splice?, <span class="Constant">0</span>/false
<span id="L381" class="LineNr">381 </span> <span class="PreProc">break-if-!=</span>
<span id="L382" class="LineNr">382 </span> <span class="PreProc">break</span> $look-for-double-unquote:<a href='../502test.mu.html#L19'>check</a>
<span id="L383" class="LineNr">383 </span> <span class="Delimiter">}</span>
<span id="L384" class="LineNr">384 </span> <span class="muComment"># error</span>
<span id="L385" class="LineNr">385 </span> <span class="PreProc">return</span> <span class="Constant">1</span>/true
<span id="L386" class="LineNr">386 </span> <span class="Delimiter">}</span>
<span id="L387" class="LineNr">387 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='macroexpand.mu.html#L331'>look-for-double-unquote</a> car-ah
<span id="L388" class="LineNr">388 </span> compare result, <span class="Constant">0</span>/false
<span id="L389" class="LineNr">389 </span> <span class="Delimiter">{</span>
<span id="L390" class="LineNr">390 </span> <span class="PreProc">break-if-=</span>
<span id="L391" class="LineNr">391 </span> <span class="PreProc">return</span> result
<span id="L392" class="LineNr">392 </span> <span class="Delimiter">}</span>
<span id="L393" class="LineNr">393 </span> result <span class="Special">&lt;-</span> <a href='macroexpand.mu.html#L331'>look-for-double-unquote</a> cdr-ah
<span id="L394" class="LineNr">394 </span> <span class="PreProc">return</span> result
<span id="L395" class="LineNr">395 </span><span class="Delimiter">}</span>
<span id="L396" class="LineNr">396 </span>
<span id="L397" class="LineNr">397 </span><span class="PreProc">fn</span> <span class="muTest"><a href='macroexpand.mu.html#L397'>test-macroexpand</a></span> <span class="Delimiter">{</span>
<span id="L398" class="LineNr">398 </span> <span class="PreProc">var</span> globals-storage: <a href='global.mu.html#L7'>global-table</a>
<span id="L399" class="LineNr">399 </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="L400" class="LineNr">400 </span> <a href='global.mu.html#L12'>initialize-globals</a> globals
<span id="L401" class="LineNr">401 </span> <span class="muComment"># new macro: m</span>
<span id="L402" class="LineNr">402 </span> <span class="PreProc">var</span> sandbox-storage: <a href='sandbox.mu.html#L1'>sandbox</a>
<span id="L403" class="LineNr">403 </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="L404" class="LineNr">404 </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="L405" class="LineNr">405 </span> <a href='sandbox.mu.html#L462'>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="L406" class="LineNr">406 </span> <span class="muComment"># invoke macro</span>
<span id="L407" class="LineNr">407 </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="L408" class="LineNr">408 </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="L409" class="LineNr">409 </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="L410" class="LineNr">410 </span> <span class="PreProc">var</span> result-h: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L411" class="LineNr">411 </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="L412" class="LineNr">412 </span> <span class="PreProc">var</span> trace-storage: trace
<span id="L413" class="LineNr">413 </span> <span class="PreProc">var</span> trace/<span class="Constant">ecx</span>: (addr trace) <span class="Special">&lt;-</span> address trace-storage
<span id="L414" class="LineNr">414 </span> <a href='trace.mu.html#L50'>initialize-trace</a> trace, <span class="Constant">1</span>/only-errors, <span class="Constant">0x10</span>/capacity, <span class="Constant">0</span>/visible
<span id="L415" class="LineNr">415 </span> <a href='read.mu.html#L1'>read-cell</a> gap, result-ah, trace
<span id="L416" class="LineNr">416 </span> <span class="PreProc">var</span> dummy/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='macroexpand.mu.html#L46'>macroexpand-iter</a> result-ah, globals, trace
<span id="L417" class="LineNr">417 </span> <span class="PreProc">var</span> error?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='trace.mu.html#L83'>has-errors?</a> trace
<span id="L418" class="LineNr">418 </span> <a href='../502test.mu.html#L32'>check-not</a> error?, <span class="Constant">&quot;F - <a href='macroexpand.mu.html#L397'>test-macroexpand</a>/error&quot;</span>
<span id="L419" class="LineNr">419 </span><span class="CommentedCode">#? dump-cell-from-cursor-over-full-screen result-ah</span>
<span id="L420" class="LineNr">420 </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="L421" class="LineNr">421 </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="L422" class="LineNr">422 </span> <span class="muComment"># expected</span>
<span id="L423" class="LineNr">423 </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="L424" class="LineNr">424 </span> <span class="PreProc">var</span> expected-gap-ah/<span class="Constant">edx</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="L425" class="LineNr">425 </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="L426" class="LineNr">426 </span> <span class="PreProc">var</span> expected-h: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L427" class="LineNr">427 </span> <span class="PreProc">var</span> expected-ah/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address expected-h
<span id="L428" class="LineNr">428 </span> <a href='read.mu.html#L1'>read-cell</a> expected-gap, expected-ah, trace
<span id="L429" class="LineNr">429 </span><span class="CommentedCode">#? dump-cell-from-cursor-over-full-screen expected-ah</span>
<span id="L430" class="LineNr">430 </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="L431" class="LineNr">431 </span> <span class="muComment">#</span>
<span id="L432" class="LineNr">432 </span> <span class="PreProc">var</span> assertion/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='evaluate.mu.html#L1186'>cell-isomorphic?</a> result, expected, trace
<span id="L433" class="LineNr">433 </span> <a href='../502test.mu.html#L19'>check</a> assertion, <span class="Constant">&quot;F - test-macroexpand&quot;</span>
<span id="L434" class="LineNr">434 </span><span class="Delimiter">}</span>
<span id="L435" class="LineNr">435 </span>
<span id="L436" class="LineNr">436 </span><span class="PreProc">fn</span> <span class="muTest"><a href='macroexpand.mu.html#L436'>test-macroexpand-inside-anonymous-fn</a></span> <span class="muFunction">{</span>
<span id="L437" class="LineNr">437 </span> <span class="PreProc">var</span> globals-storage: <a href='global.mu.html#L7'>global-table</a>
<span id="L438" class="LineNr">438 </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="L439" class="LineNr">439 </span> <a href='global.mu.html#L12'>initialize-globals</a> globals
<span id="L440" class="LineNr">440 </span> <span class="muComment"># new macro: m</span>
<span id="L441" class="LineNr">441 </span> <span class="PreProc">var</span> sandbox-storage: <a href='sandbox.mu.html#L1'>sandbox</a>
<span id="L442" class="LineNr">442 </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="L443" class="LineNr">443 </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="L444" class="LineNr">444 </span> <a href='sandbox.mu.html#L462'>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="L445" class="LineNr">445 </span> <span class="muComment"># invoke macro</span>
<span id="L446" class="LineNr">446 </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="L447" class="LineNr">447 </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="L448" class="LineNr">448 </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="L449" class="LineNr">449 </span> <span class="PreProc">var</span> result-h: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L450" class="LineNr">450 </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="L451" class="LineNr">451 </span> <span class="PreProc">var</span> trace-storage: trace
<span id="L452" class="LineNr">452 </span> <span class="PreProc">var</span> trace/<span class="Constant">ecx</span>: (addr trace) <span class="Special">&lt;-</span> address trace-storage
<span id="L453" class="LineNr">453 </span> <a href='trace.mu.html#L50'>initialize-trace</a> trace, <span class="Constant">1</span>/only-errors, <span class="Constant">0x10</span>/capacity, <span class="Constant">0</span>/visible
<span id="L454" class="LineNr">454 </span> <a href='read.mu.html#L1'>read-cell</a> gap, result-ah, trace
<span id="L455" class="LineNr">455 </span> <span class="PreProc">var</span> dummy/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='macroexpand.mu.html#L46'>macroexpand-iter</a> result-ah, globals, trace
<span id="L456" class="LineNr">456 </span> <span class="PreProc">var</span> error?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='trace.mu.html#L83'>has-errors?</a> trace
<span id="L457" class="LineNr">457 </span> <a href='../502test.mu.html#L32'>check-not</a> error?, <span class="Constant">&quot;F - <a href='macroexpand.mu.html#L436'>test-macroexpand-inside-anonymous-fn</a>/error&quot;</span>
<span id="L458" class="LineNr">458 </span><span class="CommentedCode">#? dump-cell-from-cursor-over-full-screen result-ah</span>
<span id="L459" class="LineNr">459 </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="L460" class="LineNr">460 </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="L461" class="LineNr">461 </span> <span class="muComment"># expected</span>
<span id="L462" class="LineNr">462 </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="L463" class="LineNr">463 </span> <span class="PreProc">var</span> expected-gap-ah/<span class="Constant">edx</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="L464" class="LineNr">464 </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="L465" class="LineNr">465 </span> <span class="PreProc">var</span> expected-h: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L466" class="LineNr">466 </span> <span class="PreProc">var</span> expected-ah/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address expected-h
<span id="L467" class="LineNr">467 </span> <a href='read.mu.html#L1'>read-cell</a> expected-gap, expected-ah, trace
<span id="L468" class="LineNr">468 </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="L469" class="LineNr">469 </span> <span class="muComment">#</span>
<span id="L470" class="LineNr">470 </span> <span class="PreProc">var</span> assertion/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='evaluate.mu.html#L1186'>cell-isomorphic?</a> result, expected, trace
<span id="L471" class="LineNr">471 </span> <a href='../502test.mu.html#L19'>check</a> assertion, <span class="Constant">&quot;F - test-macroexpand-inside-anonymous-fn&quot;</span>
<span id="L472" class="LineNr">472 </span><span class="Delimiter">}</span>
<span id="L473" class="LineNr">473 </span>
<span id="L474" class="LineNr">474 </span><span class="PreProc">fn</span> <span class="muTest"><a href='macroexpand.mu.html#L474'>test-macroexpand-inside-fn-call</a></span> <span class="Delimiter">{</span>
<span id="L475" class="LineNr">475 </span> <span class="PreProc">var</span> globals-storage: <a href='global.mu.html#L7'>global-table</a>
<span id="L476" class="LineNr">476 </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="L477" class="LineNr">477 </span> <a href='global.mu.html#L12'>initialize-globals</a> globals
<span id="L478" class="LineNr">478 </span> <span class="muComment"># new macro: m</span>
<span id="L479" class="LineNr">479 </span> <span class="PreProc">var</span> sandbox-storage: <a href='sandbox.mu.html#L1'>sandbox</a>
<span id="L480" class="LineNr">480 </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="L481" class="LineNr">481 </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="L482" class="LineNr">482 </span> <a href='sandbox.mu.html#L462'>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="L483" class="LineNr">483 </span> <span class="muComment"># invoke macro</span>
<span id="L484" class="LineNr">484 </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="L485" class="LineNr">485 </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="L486" class="LineNr">486 </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="L487" class="LineNr">487 </span> <span class="PreProc">var</span> result-h: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L488" class="LineNr">488 </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="L489" class="LineNr">489 </span> <span class="PreProc">var</span> trace-storage: trace
<span id="L490" class="LineNr">490 </span> <span class="PreProc">var</span> trace/<span class="Constant">ecx</span>: (addr trace) <span class="Special">&lt;-</span> address trace-storage
<span id="L491" class="LineNr">491 </span> <a href='trace.mu.html#L50'>initialize-trace</a> trace, <span class="Constant">1</span>/only-errors, <span class="Constant">0x10</span>/capacity, <span class="Constant">0</span>/visible
<span id="L492" class="LineNr">492 </span> <a href='read.mu.html#L1'>read-cell</a> gap, result-ah, trace
<span id="L493" class="LineNr">493 </span> <span class="PreProc">var</span> dummy/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='macroexpand.mu.html#L46'>macroexpand-iter</a> result-ah, globals, trace
<span id="L494" class="LineNr">494 </span> <span class="PreProc">var</span> error?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='trace.mu.html#L83'>has-errors?</a> trace
<span id="L495" class="LineNr">495 </span> <a href='../502test.mu.html#L32'>check-not</a> error?, <span class="Constant">&quot;F - <a href='macroexpand.mu.html#L474'>test-macroexpand-inside-fn-call</a>/error&quot;</span>
<span id="L496" class="LineNr">496 </span><span class="CommentedCode">#? dump-cell-from-cursor-over-full-screen result-ah</span>
<span id="L497" class="LineNr">497 </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="L498" class="LineNr">498 </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="L499" class="LineNr">499 </span> <span class="muComment"># expected</span>
<span id="L500" class="LineNr">500 </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="L501" class="LineNr">501 </span> <span class="PreProc">var</span> expected-gap-ah/<span class="Constant">edx</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="L502" class="LineNr">502 </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="L503" class="LineNr">503 </span> <span class="PreProc">var</span> expected-h: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L504" class="LineNr">504 </span> <span class="PreProc">var</span> expected-ah/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address expected-h
<span id="L505" class="LineNr">505 </span> <a href='read.mu.html#L1'>read-cell</a> expected-gap, expected-ah, trace
<span id="L506" class="LineNr">506 </span><span class="CommentedCode">#? dump-cell-from-cursor-over-full-screen expected-ah</span>
<span id="L507" class="LineNr">507 </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="L508" class="LineNr">508 </span> <span class="muComment">#</span>
<span id="L509" class="LineNr">509 </span> <span class="PreProc">var</span> assertion/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='evaluate.mu.html#L1186'>cell-isomorphic?</a> result, expected, trace
<span id="L510" class="LineNr">510 </span> <a href='../502test.mu.html#L19'>check</a> assertion, <span class="Constant">&quot;F - test-macroexpand-inside-fn-call&quot;</span>
<span id="L511" class="LineNr">511 </span><span class="Delimiter">}</span>
<span id="L512" class="LineNr">512 </span>
<span id="L513" class="LineNr">513 </span><span class="PreProc">fn</span> <span class="muTest"><a href='macroexpand.mu.html#L513'>test-macroexpand-repeatedly-with-backquoted-arg</a></span> <span class="Delimiter">{</span>
<span id="L514" class="LineNr">514 </span> <span class="PreProc">var</span> globals-storage: <a href='global.mu.html#L7'>global-table</a>
<span id="L515" class="LineNr">515 </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="L516" class="LineNr">516 </span> <a href='global.mu.html#L12'>initialize-globals</a> globals
<span id="L517" class="LineNr">517 </span> <span class="muComment"># macroexpand an expression with a backquote but no macro</span>
<span id="L518" class="LineNr">518 </span> <span class="PreProc">var</span> sandbox-storage: <a href='sandbox.mu.html#L1'>sandbox</a>
<span id="L519" class="LineNr">519 </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="L520" class="LineNr">520 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">&quot;(cons 1 `(3))&quot;</span>
<span id="L521" class="LineNr">521 </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="L522" class="LineNr">522 </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="L523" class="LineNr">523 </span> <span class="PreProc">var</span> result-h: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L524" class="LineNr">524 </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="L525" class="LineNr">525 </span> <span class="PreProc">var</span> trace-storage: trace
<span id="L526" class="LineNr">526 </span> <span class="PreProc">var</span> trace/<span class="Constant">ecx</span>: (addr trace) <span class="Special">&lt;-</span> address trace-storage
<span id="L527" class="LineNr">527 </span> <a href='trace.mu.html#L50'>initialize-trace</a> trace, <span class="Constant">1</span>/only-errors, <span class="Constant">0x10</span>/capacity, <span class="Constant">0</span>/visible
<span id="L528" class="LineNr">528 </span> <a href='read.mu.html#L1'>read-cell</a> gap, result-ah, trace
<span id="L529" class="LineNr">529 </span> <span class="PreProc">var</span> dummy/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='macroexpand.mu.html#L46'>macroexpand-iter</a> result-ah, globals, trace
<span id="L530" class="LineNr">530 </span> <span class="PreProc">var</span> error?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='trace.mu.html#L83'>has-errors?</a> trace
<span id="L531" class="LineNr">531 </span> <a href='../502test.mu.html#L32'>check-not</a> error?, <span class="Constant">&quot;F - test-macroexpand-repeatedly-with-backquoted-arg&quot;</span>
<span id="L532" class="LineNr">532 </span> <span class="Delimiter">{</span>
<span id="L533" class="LineNr">533 </span> compare error?, <span class="Constant">0</span>/false
<span id="L534" class="LineNr">534 </span> <span class="PreProc">break-if-=</span>
<span id="L535" class="LineNr">535 </span> <span class="muComment"># we need space to display traces, so just stop rendering future tests on failure here</span>
<span id="L536" class="LineNr">536 </span> <a href='trace.mu.html#L369'>dump-trace</a> trace
<span id="L537" class="LineNr">537 </span> <span class="Delimiter">{</span>
<span id="L538" class="LineNr">538 </span> <span class="PreProc">loop</span>
<span id="L539" class="LineNr">539 </span> <span class="Delimiter">}</span>
<span id="L540" class="LineNr">540 </span> <span class="Delimiter">}</span>
<span id="L541" class="LineNr">541 </span><span class="Delimiter">}</span>
<span id="L542" class="LineNr">542 </span>
<span id="L543" class="LineNr">543 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='macroexpand.mu.html#L543'>pending-test-macroexpand-inside-backquote-unquote</a></span> <span class="Delimiter">{</span>
<span id="L544" class="LineNr">544 </span> <span class="PreProc">var</span> globals-storage: <a href='global.mu.html#L7'>global-table</a>
<span id="L545" class="LineNr">545 </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="L546" class="LineNr">546 </span> <a href='global.mu.html#L12'>initialize-globals</a> globals
<span id="L547" class="LineNr">547 </span> <span class="muComment"># new macro: m</span>
<span id="L548" class="LineNr">548 </span> <span class="PreProc">var</span> sandbox-storage: <a href='sandbox.mu.html#L1'>sandbox</a>
<span id="L549" class="LineNr">549 </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="L550" class="LineNr">550 </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="L551" class="LineNr">551 </span> <a href='sandbox.mu.html#L462'>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="L552" class="LineNr">552 </span> <span class="muComment"># invoke macro</span>
<span id="L553" class="LineNr">553 </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="L554" class="LineNr">554 </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="L555" class="LineNr">555 </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="L556" class="LineNr">556 </span> <span class="PreProc">var</span> result-h: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L557" class="LineNr">557 </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="L558" class="LineNr">558 </span> <span class="PreProc">var</span> trace-storage: trace
<span id="L559" class="LineNr">559 </span> <span class="PreProc">var</span> trace/<span class="Constant">ecx</span>: (addr trace) <span class="Special">&lt;-</span> address trace-storage
<span id="L560" class="LineNr">560 </span> <a href='trace.mu.html#L50'>initialize-trace</a> trace, <span class="Constant">1</span>/only-errors, <span class="Constant">0x10</span>/capacity, <span class="Constant">0</span>/visible
<span id="L561" class="LineNr">561 </span> <a href='read.mu.html#L1'>read-cell</a> gap, result-ah, trace
<span id="L562" class="LineNr">562 </span> <span class="PreProc">var</span> dummy/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='macroexpand.mu.html#L46'>macroexpand-iter</a> result-ah, globals, trace
<span id="L563" class="LineNr">563 </span> <span class="PreProc">var</span> error?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='trace.mu.html#L83'>has-errors?</a> trace
<span id="L564" class="LineNr">564 </span> <a href='../502test.mu.html#L32'>check-not</a> error?, <span class="Constant">&quot;F - test-macroexpand-inside-backquote-unquote/error&quot;</span>
<span id="L565" class="LineNr">565 </span><span class="CommentedCode">#? dump-cell-from-cursor-over-full-screen result-ah</span>
<span id="L566" class="LineNr">566 </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="L567" class="LineNr">567 </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="L568" class="LineNr">568 </span> <span class="muComment"># expected</span>
<span id="L569" class="LineNr">569 </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="L570" class="LineNr">570 </span> <span class="PreProc">var</span> expected-gap-ah/<span class="Constant">edx</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="L571" class="LineNr">571 </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="L572" class="LineNr">572 </span> <span class="PreProc">var</span> expected-h: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L573" class="LineNr">573 </span> <span class="PreProc">var</span> expected-ah/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address expected-h
<span id="L574" class="LineNr">574 </span> <a href='read.mu.html#L1'>read-cell</a> expected-gap, expected-ah, trace
<span id="L575" class="LineNr">575 </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="L576" class="LineNr">576 </span> <span class="muComment">#</span>
<span id="L577" class="LineNr">577 </span> <span class="PreProc">var</span> assertion/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='evaluate.mu.html#L1186'>cell-isomorphic?</a> result, expected, trace
<span id="L578" class="LineNr">578 </span> <a href='../502test.mu.html#L19'>check</a> assertion, <span class="Constant">&quot;F - test-macroexpand-inside-backquote-unquote&quot;</span>
<span id="L579" class="LineNr">579 </span><span class="Delimiter">}</span>
<span id="L580" class="LineNr">580 </span>
<span id="L581" class="LineNr">581 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='macroexpand.mu.html#L581'>pending-test-macroexpand-inside-nested-backquote-unquote</a></span> <span class="Delimiter">{</span>
<span id="L582" class="LineNr">582 </span> <span class="PreProc">var</span> globals-storage: <a href='global.mu.html#L7'>global-table</a>
<span id="L583" class="LineNr">583 </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="L584" class="LineNr">584 </span> <a href='global.mu.html#L12'>initialize-globals</a> globals
<span id="L585" class="LineNr">585 </span> <span class="muComment"># new macro: m</span>
<span id="L586" class="LineNr">586 </span> <span class="PreProc">var</span> sandbox-storage: <a href='sandbox.mu.html#L1'>sandbox</a>
<span id="L587" class="LineNr">587 </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="L588" class="LineNr">588 </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="L589" class="LineNr">589 </span> <a href='sandbox.mu.html#L462'>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="L590" class="LineNr">590 </span> <span class="muComment"># invoke macro</span>
<span id="L591" class="LineNr">591 </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="L592" class="LineNr">592 </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="L593" class="LineNr">593 </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="L594" class="LineNr">594 </span> <span class="PreProc">var</span> result-h: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L595" class="LineNr">595 </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="L596" class="LineNr">596 </span> <span class="PreProc">var</span> trace-storage: trace
<span id="L597" class="LineNr">597 </span> <span class="PreProc">var</span> trace/<span class="Constant">ecx</span>: (addr trace) <span class="Special">&lt;-</span> address trace-storage
<span id="L598" class="LineNr">598 </span> <a href='trace.mu.html#L50'>initialize-trace</a> trace, <span class="Constant">1</span>/only-errors, <span class="Constant">0x10</span>/capacity, <span class="Constant">0</span>/visible
<span id="L599" class="LineNr">599 </span> <a href='read.mu.html#L1'>read-cell</a> gap, result-ah, trace
<span id="L600" class="LineNr">600 </span> <span class="PreProc">var</span> dummy/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='macroexpand.mu.html#L46'>macroexpand-iter</a> result-ah, globals, trace
<span id="L601" class="LineNr">601 </span> <span class="PreProc">var</span> error?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='trace.mu.html#L83'>has-errors?</a> trace
<span id="L602" class="LineNr">602 </span> <a href='../502test.mu.html#L32'>check-not</a> error?, <span class="Constant">&quot;F - test-macroexpand-inside-nested-backquote-unquote/error&quot;</span>
<span id="L603" class="LineNr">603 </span> <a href='print.mu.html#L136'>dump-cell-from-cursor-over-full-screen</a> result-ah
<span id="L604" class="LineNr">604 </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="L605" class="LineNr">605 </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="L606" class="LineNr">606 </span> <span class="muComment"># expected</span>
<span id="L607" class="LineNr">607 </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="L608" class="LineNr">608 </span> <span class="PreProc">var</span> expected-gap-ah/<span class="Constant">edx</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="L609" class="LineNr">609 </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="L610" class="LineNr">610 </span> <span class="PreProc">var</span> expected-h: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L611" class="LineNr">611 </span> <span class="PreProc">var</span> expected-ah/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address expected-h
<span id="L612" class="LineNr">612 </span> <a href='read.mu.html#L1'>read-cell</a> expected-gap, expected-ah, trace
<span id="L613" class="LineNr">613 </span> <a href='print.mu.html#L136'>dump-cell-from-cursor-over-full-screen</a> expected-ah
<span id="L614" class="LineNr">614 </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="L615" class="LineNr">615 </span> <span class="muComment">#</span>
<span id="L616" class="LineNr">616 </span> <span class="PreProc">var</span> assertion/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='evaluate.mu.html#L1186'>cell-isomorphic?</a> result, expected, trace
<span id="L617" class="LineNr">617 </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="L618" class="LineNr">618 </span><span class="Delimiter">}</span>
<span id="L619" class="LineNr">619 </span>
<span id="L620" class="LineNr">620 </span><span class="muComment"># TODO: unquote-splice, nested and unnested</span>
</pre>
</body>
</html>

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

@ -67,7 +67,7 @@ if ('onhashchange' in window) {
<span id="L8" class="LineNr"> 8 </span> <span class="PreProc">var</span> sandbox-storage: <a href='sandbox.mu.html#L1'>sandbox</a>
<span id="L9" class="LineNr"> 9 </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="L10" class="LineNr"> 10 </span> <a href='sandbox.mu.html#L12'>initialize-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">1</span>/with-screen
<span id="L11" class="LineNr"> 11 </span> <a href='main.mu.html#L76'>load-state</a> data-disk, <a href='sandbox.mu.html#L1'>sandbox</a>, globals
<span id="L11" class="LineNr"> 11 </span> <a href='main.mu.html#L79'>load-state</a> data-disk, <a href='sandbox.mu.html#L1'>sandbox</a>, globals
<span id="L12" class="LineNr"> 12 </span> $main:<span class="PreProc">loop</span>: <span class="Delimiter">{</span>
<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>
@ -110,113 +110,122 @@ if ('onhashchange' in window) {
<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#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="L54" class="LineNr"> 54 </span> <a href='../500fake-screen.mu.html#L231'>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#L170'>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#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>
<span id="L63" class="LineNr"> 63 </span> <span class="PreProc">loop-if-=</span>
<span id="L64" class="LineNr"> 64 </span> <span class="Delimiter">}</span>
<span id="L65" class="LineNr"> 65 </span> <span class="muComment">#</span>
<span id="L66" class="LineNr"> 66 </span> <span class="PreProc">loop</span> $main:<span class="PreProc">loop</span>
<span id="L67" class="LineNr"> 67 </span> <span class="Delimiter">}</span>
<span id="L68" class="LineNr"> 68 </span> <span class="muComment"># no way to quit right now; just reboot</span>
<span id="L69" class="LineNr"> 69 </span> <a href='sandbox.mu.html#L460'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, key, globals, data-disk, <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">1</span>/tweak-real-screen
<span id="L70" class="LineNr"> 70 </span> <span class="Delimiter">}</span>
<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="muComment"># Gotcha: some saved state may not load.</span>
<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#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='../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="L59" class="LineNr"> 59 </span> <span class="PreProc">var</span> trace-storage: trace
<span id="L60" class="LineNr"> 60 </span> <span class="PreProc">var</span> trace/<span class="Constant">ebx</span>: (addr trace) <span class="Special">&lt;-</span> address trace-storage
<span id="L61" class="LineNr"> 61 </span> <a href='trace.mu.html#L50'>initialize-trace</a> trace, <span class="Constant">1</span>/only-errors, <span class="Constant">0x10</span>/capacity, <span class="Constant">0</span>/visible
<span id="L62" class="LineNr"> 62 </span> <a href='evaluate.mu.html#L5'>evaluate</a> tmp, out-ah, <a href='cell.mu.html#L121'>nil</a>, globals, 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="L63" class="LineNr"> 63 </span> <span class="Delimiter">{</span>
<span id="L64" class="LineNr"> 64 </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="L65" class="LineNr"> 65 </span> compare tmp, <span class="Constant">0</span>
<span id="L66" class="LineNr"> 66 </span> <span class="PreProc">loop-if-=</span>
<span id="L67" class="LineNr"> 67 </span> <span class="Delimiter">}</span>
<span id="L68" class="LineNr"> 68 </span> <span class="muComment">#</span>
<span id="L69" class="LineNr"> 69 </span> <span class="PreProc">loop</span> $main:<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="muComment"># no way to quit right now; just reboot</span>
<span id="L72" class="LineNr"> 72 </span> <a href='sandbox.mu.html#L462'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, key, globals, data-disk, <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">1</span>/tweak-real-screen
<span id="L73" class="LineNr"> 73 </span> <span class="Delimiter">}</span>
<span id="L74" class="LineNr"> 74 </span> <span class="PreProc">loop</span>
<span id="L75" class="LineNr"> 75 </span> <span class="Delimiter">}</span>
<span id="L76" class="LineNr"> 76 </span><span class="Delimiter">}</span>
<span id="L77" class="LineNr"> 77 </span>
<span id="L78" class="LineNr"> 78 </span><span class="muComment"># Gotcha: some saved state may not load.</span>
<span id="L79" class="LineNr"> 79 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='main.mu.html#L79'>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="L80" class="LineNr"> 80 </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="L81" class="LineNr"> 81 </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="L82" class="LineNr"> 82 </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="L83" class="LineNr"> 83 </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="L84" class="LineNr"> 84 </span> <span class="muComment"># data-disk -&gt; stream</span>
<span id="L85" class="LineNr"> 85 </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="L86" class="LineNr"> 86 </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="L87" class="LineNr"> 87 </span> <a href='../501draw-text.mu.html#L279'>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="L88" class="LineNr"> 88 </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="L89" class="LineNr"> 89 </span> <a href='../boot.subx.html#L960'>load-sectors</a> data-disk, <span class="Constant">0</span>/lba, <span class="Constant">8</span>/sectors, s
<span id="L90" class="LineNr"> 90 </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="L91" class="LineNr"> 91 </span> <span class="muComment"># stream -&gt; gap-buffer</span>
<span id="L92" class="LineNr"> 92 </span> <a href='../501draw-text.mu.html#L279'>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="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>
<span id="L94" class="LineNr"> 94 </span> <a href='gap-buffer.mu.html#L52'>load-gap-buffer-from-stream</a> data, s
<span id="L95" class="LineNr"> 95 </span> <a href='../501draw-text.mu.html#L279'>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="L96" class="LineNr"> 96 </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="L97" class="LineNr"> 97 </span> <a href='../106stream.subx.html#L20'>clear-stream</a> s
<span id="L98" class="LineNr"> 98 </span> <span class="muComment"># read: gap-buffer -&gt; cell</span>
<span id="L99" class="LineNr"> 99 </span> <span class="PreProc">var</span> initial-root-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L100" class="LineNr">100 </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="L101" class="LineNr">101 </span> <span class="PreProc">var</span> trace-storage: trace
<span id="L102" class="LineNr">102 </span> <span class="PreProc">var</span> trace/<span class="Constant">edi</span>: (addr trace) <span class="Special">&lt;-</span> address trace-storage
<span id="L103" class="LineNr">103 </span> <a href='trace.mu.html#L50'>initialize-trace</a> trace, <span class="Constant">1</span>/only-errors, <span class="Constant">0x10</span>/capacity, <span class="Constant">0</span>/visible
<span id="L104" class="LineNr">104 </span> <a href='read.mu.html#L1'>read-cell</a> data, initial-root, trace
<span id="L105" class="LineNr">105 </span> <a href='../501draw-text.mu.html#L279'>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="L106" class="LineNr">106 </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="L107" class="LineNr">107 </span> <a href='gap-buffer.mu.html#L19'>clear-gap-buffer</a> data
<span id="L108" class="LineNr">108 </span> <span class="muComment">#</span>
<span id="L109" class="LineNr">109 </span> <span class="Delimiter">{</span>
<span id="L110" class="LineNr">110 </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="L111" class="LineNr">111 </span> compare initial-root-addr, <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> <span class="PreProc">return</span>
<span id="L114" class="LineNr">114 </span> <span class="Delimiter">}</span>
<span id="L115" class="LineNr">115 </span> <span class="muComment"># load globals from assoc(initial-root, 'globals)</span>
<span id="L116" class="LineNr">116 </span> <span class="PreProc">var</span> globals-literal-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L117" class="LineNr">117 </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="L118" class="LineNr">118 </span> <a href='cell.mu.html#L39'>new-symbol</a> globals-literal-ah, <span class="Constant">&quot;globals&quot;</span>
<span id="L119" class="LineNr">119 </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="L120" class="LineNr">120 </span> <span class="PreProc">var</span> globals-cell-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L121" class="LineNr">121 </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="L122" class="LineNr">122 </span> <a href='trace.mu.html#L69'>clear-trace</a> trace
<span id="L123" class="LineNr">123 </span> <a href='evaluate.mu.html#L800'>lookup-symbol</a> globals-literal, globals-cell-ah, *initial-root, <span class="Constant">0</span>/no-globals, trace, <span class="Constant">0</span>/no-screen, <span class="Constant">0</span>/no-keyboard
<span id="L124" class="LineNr">124 </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="L125" class="LineNr">125 </span> <span class="Delimiter">{</span>
<span id="L126" class="LineNr">126 </span> compare globals-cell, <span class="Constant">0</span>
<span id="L127" class="LineNr">127 </span> <span class="PreProc">break-if-=</span>
<span id="L128" class="LineNr">128 </span> <a href='global.mu.html#L66'>load-globals</a> globals-cell-ah, globals
<span id="L129" class="LineNr">129 </span> <span class="Delimiter">}</span>
<span id="L130" class="LineNr">130 </span> <span class="muComment"># sandbox = assoc(initial-root, 'sandbox)</span>
<span id="L131" class="LineNr">131 </span> <a href='../501draw-text.mu.html#L279'>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="L132" class="LineNr">132 </span> <span class="PreProc">var</span> sandbox-literal-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L133" class="LineNr">133 </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="L134" class="LineNr">134 </span> <a href='cell.mu.html#L39'>new-symbol</a> sandbox-literal-ah, <span class="Constant">&quot;sandbox&quot;</span>
<span id="L135" class="LineNr">135 </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="L136" class="LineNr">136 </span> <span class="PreProc">var</span> sandbox-cell-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L137" class="LineNr">137 </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="L138" class="LineNr">138 </span> <a href='trace.mu.html#L69'>clear-trace</a> trace
<span id="L139" class="LineNr">139 </span> <a href='evaluate.mu.html#L800'>lookup-symbol</a> sandbox-literal, sandbox-cell-ah, *initial-root, <span class="Constant">0</span>/no-globals, trace, <span class="Constant">0</span>/no-screen, <span class="Constant">0</span>/no-keyboard
<span id="L140" class="LineNr">140 </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="L141" class="LineNr">141 </span> <span class="Delimiter">{</span>
<span id="L142" class="LineNr">142 </span> compare sandbox-cell, <span class="Constant">0</span>
<span id="L143" class="LineNr">143 </span> <span class="PreProc">break-if-=</span>
<span id="L144" class="LineNr">144 </span> <span class="muComment"># print: cell -&gt; stream</span>
<span id="L145" class="LineNr">145 </span> <a href='trace.mu.html#L69'>clear-trace</a> trace
<span id="L146" class="LineNr">146 </span> <a href='print.mu.html#L7'>print-cell</a> sandbox-cell-ah, s, trace
<span id="L147" class="LineNr">147 </span> <span class="muComment"># stream -&gt; gap-buffer</span>
<span id="L148" class="LineNr">148 </span> <a href='gap-buffer.mu.html#L52'>load-gap-buffer-from-stream</a> data, s
<span id="L149" class="LineNr">149 </span> <span class="Delimiter">}</span>
<span id="L150" class="LineNr">150 </span><span class="Delimiter">}</span>
<span id="L151" class="LineNr">151 </span>
<span id="L152" class="LineNr">152 </span><span class="muComment"># Save state as an alist of alists:</span>
<span id="L153" class="LineNr">153 </span><span class="muComment"># ((globals . ((a . (fn ...))</span>
<span id="L154" class="LineNr">154 </span><span class="muComment"># ...))</span>
<span id="L155" class="LineNr">155 </span><span class="muComment"># (sandbox . ...))</span>
<span id="L156" class="LineNr">156 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='main.mu.html#L156'>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="L157" class="LineNr">157 </span> compare data-disk, <span class="Constant">0</span>/no-disk
<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> <span class="PreProc">return</span>
<span id="L161" class="LineNr">161 </span> <span class="Delimiter">}</span>
<span id="L162" class="LineNr">162 </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="L163" class="LineNr">163 </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="L164" class="LineNr">164 </span> <a href='../108write.subx.html#L11'>write</a> stream, <span class="Constant">&quot;(\n&quot;</span>
<span id="L165" class="LineNr">165 </span> <a href='global.mu.html#L109'>write-globals</a> stream, globals
<span id="L166" class="LineNr">166 </span> <a href='sandbox.mu.html#L64'>write-sandbox</a> stream, <a href='sandbox.mu.html#L1'>sandbox</a>
<span id="L167" class="LineNr">167 </span> <a href='../108write.subx.html#L11'>write</a> stream, <span class="Constant">&quot;)\n&quot;</span>
<span id="L168" class="LineNr">168 </span> <a href='../boot.subx.html#L1023'>store-sectors</a> data-disk, <span class="Constant">0</span>/lba, <span class="Constant">8</span>/sectors, stream
<span id="L169" class="LineNr">169 </span><span class="Delimiter">}</span>
</pre>
</body>
</html>

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

@ -62,7 +62,7 @@ if ('onhashchange' in window) {
<span id="L4" class="LineNr"> 4 </span> compare empty?, <span class="Constant">0</span>/false
<span id="L5" class="LineNr"> 5 </span> <span class="Delimiter">{</span>
<span id="L6" class="LineNr"> 6 </span> <span class="PreProc">break-if-=</span>
<span id="L7" class="LineNr"> 7 </span> <span class="Special"><a href='trace.mu.html#L129'>error</a></span> trace, <span class="Constant">&quot;nothing to parse&quot;</span>
<span id="L7" class="LineNr"> 7 </span> <span class="Special"><a href='trace.mu.html#L186'>error</a></span> trace, <span class="Constant">&quot;nothing to parse&quot;</span>
<span id="L8" class="LineNr"> 8 </span> <span class="PreProc">return</span>
<span id="L9" class="LineNr"> 9 </span> <span class="Delimiter">}</span>
<span id="L10" class="LineNr"> 10 </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
@ -71,14 +71,14 @@ if ('onhashchange' in window) {
<span id="L13" class="LineNr"> 13 </span> <span class="Delimiter">{</span>
<span id="L14" class="LineNr"> 14 </span> compare close-paren?, <span class="Constant">0</span>/false
<span id="L15" class="LineNr"> 15 </span> <span class="PreProc">break-if-=</span>
<span id="L16" class="LineNr"> 16 </span> <span class="Special"><a href='trace.mu.html#L129'>error</a></span> trace, <span class="Constant">&quot;')' is not a valid expression&quot;</span>
<span id="L16" class="LineNr"> 16 </span> <span class="Special"><a href='trace.mu.html#L186'>error</a></span> trace, <span class="Constant">&quot;')' is not a valid expression&quot;</span>
<span id="L17" class="LineNr"> 17 </span> <span class="PreProc">return</span>
<span id="L18" class="LineNr"> 18 </span> <span class="Delimiter">}</span>
<span id="L19" class="LineNr"> 19 </span> <span class="Delimiter">{</span>
<span id="L20" class="LineNr"> 20 </span> <span class="PreProc">var</span> empty?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='../309stream.subx.html#L6'>stream-empty?</a> tokens
<span id="L21" class="LineNr"> 21 </span> compare empty?, <span class="Constant">0</span>/false
<span id="L22" class="LineNr"> 22 </span> <span class="PreProc">break-if-!=</span>
<span id="L23" class="LineNr"> 23 </span> <span class="Special"><a href='trace.mu.html#L129'>error</a></span> trace, <span class="Constant">&quot;unexpected tokens at end; only type in a single expression at a time&quot;</span>
<span id="L23" class="LineNr"> 23 </span> <span class="Special"><a href='trace.mu.html#L186'>error</a></span> trace, <span class="Constant">&quot;unexpected tokens at end; only type in a single expression at a time&quot;</span>
<span id="L24" class="LineNr"> 24 </span> <span class="Delimiter">}</span>
<span id="L25" class="LineNr"> 25 </span><span class="Delimiter">}</span>
<span id="L26" class="LineNr"> 26 </span>
@ -86,263 +86,274 @@ 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;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="L31" class="LineNr"> 31 </span> <a href='trace.mu.html#L174'>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#L228'>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
<span id="L35" class="LineNr"> 35 </span> <span class="PreProc">var</span> empty?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='../309stream.subx.html#L6'>stream-empty?</a> tokens
<span id="L36" class="LineNr"> 36 </span> compare empty?, <span class="Constant">0</span>/false
<span id="L37" class="LineNr"> 37 </span> <span class="Delimiter">{</span>
<span id="L38" class="LineNr"> 38 </span> <span class="PreProc">break-if-=</span>
<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#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#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#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#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"># 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> <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"># 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> 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="L39" class="LineNr"> 39 </span> <span class="Special"><a href='trace.mu.html#L186'>error</a></span> trace, <span class="Constant">&quot;end of stream; never found a balancing ')'&quot;</span>
<span id="L40" class="LineNr"> 40 </span> <a href='trace.mu.html#L239'>trace-higher</a> trace
<span id="L41" class="LineNr"> 41 </span> <span class="PreProc">return</span> <span class="Constant">1</span>/true, <span class="Constant">0</span>/false
<span id="L42" class="LineNr"> 42 </span> <span class="Delimiter">}</span>
<span id="L43" class="LineNr"> 43 </span> <a href='../309stream.subx.html#L104'>read-from-stream</a> tokens, curr-token
<span id="L44" class="LineNr"> 44 </span> $parse-sexpression:type-check: <span class="Delimiter">{</span>
<span id="L45" class="LineNr"> 45 </span> <span class="muComment"># single quote -&gt; parse as list with a special car</span>
<span id="L46" class="LineNr"> 46 </span> <span class="PreProc">var</span> <a href='tokenize.mu.html#L868'>quote-token?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='tokenize.mu.html#L868'>quote-token?</a> curr-token
<span id="L47" class="LineNr"> 47 </span> compare <a href='tokenize.mu.html#L868'>quote-token?</a>, <span class="Constant">0</span>/false
<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">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="L51" class="LineNr"> 51 </span> <a href='cell.mu.html#L102'>allocate-pair</a> out
<span id="L52" class="LineNr"> 52 </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="L53" class="LineNr"> 53 </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="L54" class="LineNr"> 54 </span> <a href='cell.mu.html#L39'>new-symbol</a> left-ah, <span class="Constant">&quot;'&quot;</span>
<span id="L55" class="LineNr"> 55 </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="L56" class="LineNr"> 56 </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="L57" class="LineNr"> 57 </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="L58" class="LineNr"> 58 </span> close-paren?, dot? <span class="Special">&lt;-</span> <a href='parse.mu.html#L30'>parse-sexpression</a> tokens, right-ah, trace
<span id="L59" class="LineNr"> 59 </span> <a href='trace.mu.html#L239'>trace-higher</a> trace
<span id="L60" class="LineNr"> 60 </span> <span class="PreProc">return</span> close-paren?, dot?
<span id="L61" class="LineNr"> 61 </span> <span class="Delimiter">}</span>
<span id="L62" class="LineNr"> 62 </span> <span class="muComment"># backquote quote -&gt; parse as list with a special car</span>
<span id="L63" class="LineNr"> 63 </span> <span class="PreProc">var</span> <a href='tokenize.mu.html#L877'>backquote-token?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='tokenize.mu.html#L877'>backquote-token?</a> curr-token
<span id="L64" class="LineNr"> 64 </span> compare <a href='tokenize.mu.html#L877'>backquote-token?</a>, <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="PreProc">break-if-=</span>
<span id="L67" class="LineNr"> 67 </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="L68" class="LineNr"> 68 </span> <a href='cell.mu.html#L102'>allocate-pair</a> out
<span id="L69" class="LineNr"> 69 </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="L70" class="LineNr"> 70 </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="L71" class="LineNr"> 71 </span> <a href='cell.mu.html#L39'>new-symbol</a> left-ah, <span class="Constant">&quot;`&quot;</span>
<span id="L72" class="LineNr"> 72 </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="L73" class="LineNr"> 73 </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="L74" class="LineNr"> 74 </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="L75" class="LineNr"> 75 </span> close-paren?, dot? <span class="Special">&lt;-</span> <a href='parse.mu.html#L30'>parse-sexpression</a> tokens, right-ah, trace
<span id="L76" class="LineNr"> 76 </span> <a href='trace.mu.html#L239'>trace-higher</a> trace
<span id="L77" class="LineNr"> 77 </span> <span class="PreProc">return</span> close-paren?, dot?
<span id="L78" class="LineNr"> 78 </span> <span class="Delimiter">}</span>
<span id="L79" class="LineNr"> 79 </span> <span class="muComment"># unquote -&gt; parse as list with a special car</span>
<span id="L80" class="LineNr"> 80 </span> <span class="PreProc">var</span> <a href='tokenize.mu.html#L886'>unquote-token?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='tokenize.mu.html#L886'>unquote-token?</a> curr-token
<span id="L81" class="LineNr"> 81 </span> compare <a href='tokenize.mu.html#L886'>unquote-token?</a>, <span class="Constant">0</span>/false
<span id="L82" class="LineNr"> 82 </span> <span class="Delimiter">{</span>
<span id="L83" class="LineNr"> 83 </span> <span class="PreProc">break-if-=</span>
<span id="L84" class="LineNr"> 84 </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="L85" class="LineNr"> 85 </span> <a href='cell.mu.html#L102'>allocate-pair</a> out
<span id="L86" class="LineNr"> 86 </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="L87" class="LineNr"> 87 </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="L88" class="LineNr"> 88 </span> <a href='cell.mu.html#L39'>new-symbol</a> left-ah, <span class="Constant">&quot;,&quot;</span>
<span id="L89" class="LineNr"> 89 </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="L90" class="LineNr"> 90 </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="L91" class="LineNr"> 91 </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="L92" class="LineNr"> 92 </span> close-paren?, dot? <span class="Special">&lt;-</span> <a href='parse.mu.html#L30'>parse-sexpression</a> tokens, right-ah, trace
<span id="L93" class="LineNr"> 93 </span> <a href='trace.mu.html#L239'>trace-higher</a> trace
<span id="L94" class="LineNr"> 94 </span> <span class="PreProc">return</span> close-paren?, dot?
<span id="L95" class="LineNr"> 95 </span> <span class="Delimiter">}</span>
<span id="L96" class="LineNr"> 96 </span> <span class="muComment"># unquote-splice -&gt; parse as list with a special car</span>
<span id="L97" class="LineNr"> 97 </span> <span class="PreProc">var</span> <a href='tokenize.mu.html#L895'>unquote-splice-token?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='tokenize.mu.html#L895'>unquote-splice-token?</a> curr-token
<span id="L98" class="LineNr"> 98 </span> compare <a href='tokenize.mu.html#L895'>unquote-splice-token?</a>, <span class="Constant">0</span>/false
<span id="L99" class="LineNr"> 99 </span> <span class="Delimiter">{</span>
<span id="L100" class="LineNr">100 </span> <span class="PreProc">break-if-=</span>
<span id="L101" class="LineNr">101 </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="L102" class="LineNr">102 </span> <a href='cell.mu.html#L102'>allocate-pair</a> out
<span id="L103" class="LineNr">103 </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="L104" class="LineNr">104 </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="L105" class="LineNr">105 </span> <a href='cell.mu.html#L39'>new-symbol</a> left-ah, <span class="Constant">&quot;,@&quot;</span>
<span id="L106" class="LineNr">106 </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="L107" class="LineNr">107 </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="L108" class="LineNr">108 </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="L109" class="LineNr">109 </span> close-paren?, dot? <span class="Special">&lt;-</span> <a href='parse.mu.html#L30'>parse-sexpression</a> tokens, right-ah, trace
<span id="L110" class="LineNr">110 </span> <a href='trace.mu.html#L239'>trace-higher</a> trace
<span id="L111" class="LineNr">111 </span> <span class="PreProc">return</span> close-paren?, dot?
<span id="L112" class="LineNr">112 </span> <span class="Delimiter">}</span>
<span id="L113" class="LineNr">113 </span> <span class="muComment"># dot -&gt; return</span>
<span id="L114" class="LineNr">114 </span> <span class="PreProc">var</span> dot?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='tokenize.mu.html#L936'>dot-token?</a> curr-token
<span id="L115" class="LineNr">115 </span> compare dot?, <span class="Constant">0</span>/false
<span id="L116" class="LineNr">116 </span> <span class="Delimiter">{</span>
<span id="L117" class="LineNr">117 </span> <span class="PreProc">break-if-=</span>
<span id="L118" class="LineNr">118 </span> <a href='trace.mu.html#L239'>trace-higher</a> trace
<span id="L119" class="LineNr">119 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false, <span class="Constant">1</span>/true
<span id="L120" class="LineNr">120 </span> <span class="Delimiter">}</span>
<span id="L121" class="LineNr">121 </span> <span class="muComment"># not bracket -&gt; parse atom</span>
<span id="L122" class="LineNr">122 </span> <span class="PreProc">var</span> <a href='tokenize.mu.html#L851'>bracket-token?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='tokenize.mu.html#L851'>bracket-token?</a> curr-token
<span id="L123" class="LineNr">123 </span> compare <a href='tokenize.mu.html#L851'>bracket-token?</a>, <span class="Constant">0</span>/false
<span id="L124" class="LineNr">124 </span> <span class="Delimiter">{</span>
<span id="L125" class="LineNr">125 </span> <span class="PreProc">break-if-!=</span>
<span id="L126" class="LineNr">126 </span> <a href='parse.mu.html#L201'>parse-atom</a> curr-token, _out, trace
<span id="L127" class="LineNr">127 </span> <span class="PreProc">break</span> $parse-sexpression:type-check
<span id="L128" class="LineNr">128 </span> <span class="Delimiter">}</span>
<span id="L129" class="LineNr">129 </span> <span class="muComment"># open paren -&gt; parse list</span>
<span id="L130" class="LineNr">130 </span> <span class="PreProc">var</span> open-paren?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='tokenize.mu.html#L904'>open-paren-token?</a> curr-token
<span id="L131" class="LineNr">131 </span> compare open-paren?, <span class="Constant">0</span>/false
<span id="L132" class="LineNr">132 </span> <span class="Delimiter">{</span>
<span id="L133" class="LineNr">133 </span> <span class="PreProc">break-if-=</span>
<span id="L134" class="LineNr">134 </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="L135" class="LineNr">135 </span> <a href='cell.mu.html#L102'>allocate-pair</a> curr
<span id="L136" class="LineNr">136 </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="L137" class="LineNr">137 </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="L138" class="LineNr">138 </span> <span class="Delimiter">{</span>
<span id="L139" class="LineNr">139 </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="L140" class="LineNr">140 </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="L141" class="LineNr">141 </span> close-paren?, dot? <span class="Special">&lt;-</span> <a href='parse.mu.html#L30'>parse-sexpression</a> tokens, left, trace
<span id="L142" class="LineNr">142 </span> <span class="Delimiter">{</span>
<span id="L143" class="LineNr">143 </span> compare dot?, <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="Special"><a href='trace.mu.html#L186'>error</a></span> trace, <span class="Constant">&quot;'.' cannot be at the start of a list&quot;</span>
<span id="L146" class="LineNr">146 </span> <span class="PreProc">return</span> <span class="Constant">1</span>/true, dot?
<span id="L147" class="LineNr">147 </span> <span class="Delimiter">}</span>
<span id="L148" class="LineNr">148 </span> compare close-paren?, <span class="Constant">0</span>/false
<span id="L149" class="LineNr">149 </span> <span class="PreProc">break-if-!=</span>
<span id="L150" class="LineNr">150 </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="L151" class="LineNr">151 </span> curr <span class="Special">&lt;-</span> get curr-addr, right
<span id="L152" class="LineNr">152 </span> <span class="PreProc">var</span> tmp-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L153" class="LineNr">153 </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="L154" class="LineNr">154 </span> $parse-sexpression:list-loop: <span class="Delimiter">{</span>
<span id="L155" class="LineNr">155 </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="L156" class="LineNr">156 </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="L157" class="LineNr">157 </span> close-paren?, dot? <span class="Special">&lt;-</span> <a href='parse.mu.html#L30'>parse-sexpression</a> tokens, tmp, trace
<span id="L158" class="LineNr">158 </span> <span class="muComment"># '.' -&gt; clean up right here and return</span>
<span id="L159" class="LineNr">159 </span> compare dot?, <span class="Constant">0</span>/false
<span id="L160" class="LineNr">160 </span> <span class="Delimiter">{</span>
<span id="L161" class="LineNr">161 </span> <span class="PreProc">break-if-=</span>
<span id="L162" class="LineNr">162 </span> <a href='parse.mu.html#L265'>parse-dot-tail</a> tokens, curr, trace
<span id="L163" class="LineNr">163 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false, <span class="Constant">0</span>/false
<span id="L164" class="LineNr">164 </span> <span class="Delimiter">}</span>
<span id="L165" class="LineNr">165 </span> <a href='cell.mu.html#L102'>allocate-pair</a> curr
<span id="L166" class="LineNr">166 </span> <span class="muComment"># ')' -&gt; return</span>
<span id="L167" class="LineNr">167 </span> compare close-paren?, <span class="Constant">0</span>/false
<span id="L168" class="LineNr">168 </span> <span class="PreProc">break-if-!=</span>
<span id="L169" class="LineNr">169 </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="L170" class="LineNr">170 </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="L171" class="LineNr">171 </span> copy-object tmp, left
<span id="L172" class="LineNr">172 </span> <span class="muComment">#</span>
<span id="L173" class="LineNr">173 </span> curr <span class="Special">&lt;-</span> get curr-addr, right
<span id="L174" class="LineNr">174 </span> <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> <span class="PreProc">break</span> $parse-sexpression:type-check
<span id="L178" class="LineNr">178 </span> <span class="Delimiter">}</span>
<span id="L179" class="LineNr">179 </span> <span class="muComment"># close paren -&gt; return</span>
<span id="L180" class="LineNr">180 </span> <span class="PreProc">var</span> close-paren?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='tokenize.mu.html#L920'>close-paren-token?</a> curr-token
<span id="L181" class="LineNr">181 </span> compare close-paren?, <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='trace.mu.html#L239'>trace-higher</a> trace
<span id="L185" class="LineNr">185 </span> <span class="PreProc">return</span> <span class="Constant">1</span>/true, <span class="Constant">0</span>/false
<span id="L186" class="LineNr">186 </span> <span class="Delimiter">}</span>
<span id="L187" class="LineNr">187 </span> <span class="muComment"># otherwise abort</span>
<span id="L188" class="LineNr">188 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x400</span>)
<span id="L189" class="LineNr">189 </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="L190" class="LineNr">190 </span> <a href='../108write.subx.html#L11'>write</a> stream, <span class="Constant">&quot;unexpected token &quot;</span>
<span id="L191" class="LineNr">191 </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="L192" class="LineNr">192 </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="L193" class="LineNr">193 </span> <a href='../106stream.subx.html#L59'>rewind-stream</a> curr-token-data
<span id="L194" class="LineNr">194 </span> <a href='../113write-stream.subx.html#L8'>write-stream</a> stream, curr-token-data
<span id="L195" class="LineNr">195 </span> <span class="Special"><a href='trace.mu.html#L200'>error-stream</a></span> trace, stream
<span id="L196" class="LineNr">196 </span> <span class="Delimiter">}</span>
<span id="L197" class="LineNr">197 </span> <a href='trace.mu.html#L239'>trace-higher</a> trace
<span id="L198" class="LineNr">198 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false, <span class="Constant">0</span>/false
<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="PreProc">fn</span> <span class="muFunction"><a href='parse.mu.html#L201'>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="L202" class="LineNr">202 </span> <a href='trace.mu.html#L174'>trace-text</a> trace, <span class="Constant">&quot;parse&quot;</span>, <span class="Constant">&quot;parse atom&quot;</span>
<span id="L203" class="LineNr">203 </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="L204" class="LineNr">204 </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="L205" class="LineNr">205 </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="L206" class="LineNr">206 </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="L207" class="LineNr">207 </span> trace trace, <span class="Constant">&quot;parse&quot;</span>, curr-token-data
<span id="L208" class="LineNr">208 </span> <span class="muComment"># number</span>
<span id="L209" class="LineNr">209 </span> <span class="PreProc">var</span> <a href='tokenize.mu.html#L841'>number-token?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='tokenize.mu.html#L841'>number-token?</a> curr-token
<span id="L210" class="LineNr">210 </span> compare <a href='tokenize.mu.html#L841'>number-token?</a>, <span class="Constant">0</span>/false
<span id="L211" class="LineNr">211 </span> <span class="Delimiter">{</span>
<span id="L212" class="LineNr">212 </span> <span class="PreProc">break-if-=</span>
<span id="L213" class="LineNr">213 </span> <a href='../106stream.subx.html#L59'>rewind-stream</a> curr-token-data
<span id="L214" class="LineNr">214 </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="L215" class="LineNr">215 </span> <span class="PreProc">var</span> val/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy _val
<span id="L216" class="LineNr">216 </span> <span class="PreProc">var</span> val-float/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> convert val
<span id="L217" class="LineNr">217 </span> <a href='cell.mu.html#L68'>allocate-number</a> _out
<span id="L218" class="LineNr">218 </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="L219" class="LineNr">219 </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="L220" class="LineNr">220 </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="L221" class="LineNr">221 </span> copy-to *dest, val-float
<span id="L222" class="LineNr">222 </span> <span class="Delimiter">{</span>
<span id="L223" class="LineNr">223 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x400</span>)
<span id="L224" class="LineNr">224 </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="L225" class="LineNr">225 </span> <a href='../108write.subx.html#L11'>write</a> stream, <span class="Constant">&quot;=&gt; number &quot;</span>
<span id="L226" class="LineNr">226 </span> <span class="PreProc">var</span> nested-trace-storage: trace
<span id="L227" class="LineNr">227 </span> <span class="PreProc">var</span> nested-trace/<span class="Constant">edi</span>: (addr trace) <span class="Special">&lt;-</span> address nested-trace-storage
<span id="L228" class="LineNr">228 </span> <a href='trace.mu.html#L50'>initialize-trace</a> nested-trace, <span class="Constant">1</span>/only-errors, <span class="Constant">0x10</span>/capacity, <span class="Constant">0</span>/visible
<span id="L229" class="LineNr">229 </span> <a href='print.mu.html#L209'>print-number</a> out-addr, stream, nested-trace
<span id="L230" class="LineNr">230 </span> trace trace, <span class="Constant">&quot;parse&quot;</span>, stream
<span id="L231" class="LineNr">231 </span> <span class="Delimiter">}</span>
<span id="L232" class="LineNr">232 </span> <span class="PreProc">return</span>
<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="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>
<span id="L234" class="LineNr">234 </span> <span class="muComment"># default: copy either to a symbol or a stream</span>
<span id="L235" class="LineNr">235 </span> <span class="muComment"># stream token -&gt; literal</span>
<span id="L236" class="LineNr">236 </span> <span class="PreProc">var</span> <a href='tokenize.mu.html#L961'>stream-token?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='tokenize.mu.html#L961'>stream-token?</a> curr-token
<span id="L237" class="LineNr">237 </span> compare <a href='tokenize.mu.html#L961'>stream-token?</a>, <span class="Constant">0</span>/false
<span id="L238" class="LineNr">238 </span> <span class="Delimiter">{</span>
<span id="L239" class="LineNr">239 </span> <span class="PreProc">break-if-=</span>
<span id="L240" class="LineNr">240 </span> <a href='cell.mu.html#L58'>allocate-stream</a> _out
<span id="L241" class="LineNr">241 </span> <span class="Delimiter">}</span>
<span id="L242" class="LineNr">242 </span> compare <a href='tokenize.mu.html#L961'>stream-token?</a>, <span class="Constant">0</span>/false
<span id="L243" class="LineNr">243 </span> <span class="Delimiter">{</span>
<span id="L244" class="LineNr">244 </span> <span class="PreProc">break-if-!=</span>
<span id="L245" class="LineNr">245 </span> <a href='cell.mu.html#L21'>allocate-symbol</a> _out
<span id="L246" class="LineNr">246 </span> <span class="Delimiter">}</span>
<span id="L247" class="LineNr">247 </span> <span class="muComment"># copy token data</span>
<span id="L248" class="LineNr">248 </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="L249" class="LineNr">249 </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="L250" class="LineNr">250 </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="L251" class="LineNr">251 </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="L252" class="LineNr">252 </span> copy-object curr-token-data-ah, dest-ah
<span id="L253" class="LineNr">253 </span> <span class="Delimiter">{</span>
<span id="L254" class="LineNr">254 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x400</span>)
<span id="L255" class="LineNr">255 </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="L256" class="LineNr">256 </span> <a href='../108write.subx.html#L11'>write</a> stream, <span class="Constant">&quot;=&gt; symbol &quot;</span>
<span id="L257" class="LineNr">257 </span> <span class="PreProc">var</span> nested-trace-storage: trace
<span id="L258" class="LineNr">258 </span> <span class="PreProc">var</span> nested-trace/<span class="Constant">edi</span>: (addr trace) <span class="Special">&lt;-</span> address nested-trace-storage
<span id="L259" class="LineNr">259 </span> <a href='trace.mu.html#L50'>initialize-trace</a> nested-trace, <span class="Constant">1</span>/only-errors, <span class="Constant">0x10</span>/capacity, <span class="Constant">0</span>/visible
<span id="L260" class="LineNr">260 </span> <a href='print.mu.html#L146'>print-symbol</a> out-addr, stream, nested-trace
<span id="L261" class="LineNr">261 </span> trace trace, <span class="Constant">&quot;parse&quot;</span>, stream
<span id="L262" class="LineNr">262 </span> <span class="Delimiter">}</span>
<span id="L263" class="LineNr">263 </span><span class="Delimiter">}</span>
<span id="L264" class="LineNr">264 </span>
<span id="L265" class="LineNr">265 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='parse.mu.html#L265'>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="L266" class="LineNr">266 </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="L267" class="LineNr">267 </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="L268" class="LineNr">268 </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="L269" class="LineNr">269 </span> close-paren?, dot? <span class="Special">&lt;-</span> <a href='parse.mu.html#L30'>parse-sexpression</a> tokens, out, trace
<span id="L270" class="LineNr">270 </span> compare close-paren?, <span class="Constant">0</span>/false
<span id="L271" class="LineNr">271 </span> <span class="Delimiter">{</span>
<span id="L272" class="LineNr">272 </span> <span class="PreProc">break-if-=</span>
<span id="L273" class="LineNr">273 </span> <span class="Special"><a href='trace.mu.html#L186'>error</a></span> trace, <span class="Constant">&quot;'. )' makes no sense&quot;</span>
<span id="L274" class="LineNr">274 </span> <span class="PreProc">return</span>
<span id="L275" class="LineNr">275 </span> <span class="Delimiter">}</span>
<span id="L276" class="LineNr">276 </span> compare dot?, <span class="Constant">0</span>/false
<span id="L277" class="LineNr">277 </span> <span class="Delimiter">{</span>
<span id="L278" class="LineNr">278 </span> <span class="PreProc">break-if-=</span>
<span id="L279" class="LineNr">279 </span> <span class="Special"><a href='trace.mu.html#L186'>error</a></span> trace, <span class="Constant">&quot;'. .' makes no sense&quot;</span>
<span id="L280" class="LineNr">280 </span> <span class="PreProc">return</span>
<span id="L281" class="LineNr">281 </span> <span class="Delimiter">}</span>
<span id="L282" class="LineNr">282 </span> <span class="muComment">#</span>
<span id="L283" class="LineNr">283 </span> <span class="PreProc">var</span> dummy: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L284" class="LineNr">284 </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="L285" class="LineNr">285 </span> close-paren?, dot? <span class="Special">&lt;-</span> <a href='parse.mu.html#L30'>parse-sexpression</a> tokens, dummy-ah, trace
<span id="L286" class="LineNr">286 </span> compare close-paren?, <span class="Constant">0</span>/false
<span id="L287" class="LineNr">287 </span> <span class="Delimiter">{</span>
<span id="L288" class="LineNr">288 </span> <span class="PreProc">break-if-!=</span>
<span id="L289" class="LineNr">289 </span> <span class="Special"><a href='trace.mu.html#L186'>error</a></span> trace, <span class="Constant">&quot;cannot have multiple expressions between '.' and ')'&quot;</span>
<span id="L290" class="LineNr">290 </span> <span class="PreProc">return</span>
<span id="L291" class="LineNr">291 </span> <span class="Delimiter">}</span>
<span id="L292" class="LineNr">292 </span> compare dot?, <span class="Constant">0</span>/false
<span id="L293" class="LineNr">293 </span> <span class="Delimiter">{</span>
<span id="L294" class="LineNr">294 </span> <span class="PreProc">break-if-=</span>
<span id="L295" class="LineNr">295 </span> <span class="Special"><a href='trace.mu.html#L186'>error</a></span> trace, <span class="Constant">&quot;cannot have two dots in a single list&quot;</span>
<span id="L296" class="LineNr">296 </span> <span class="PreProc">return</span>
<span id="L297" class="LineNr">297 </span> <span class="Delimiter">}</span>
<span id="L298" class="LineNr">298 </span><span class="Delimiter">}</span>
</pre>
</body>
</html>

990
html/shell/print.mu.html generated

File diff suppressed because it is too large Load Diff

View File

@ -15,12 +15,12 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.Special { color: #ff6060; }
.LineNr { }
.Constant { color: #008787; }
.muComment { color: #005faf; }
.Delimiter { color: #c000c0; }
.muFunction { color: #af5f00; text-decoration: underline; }
.Special { color: #ff6060; }
.muComment { color: #005faf; }
-->
</style>
@ -57,19 +57,21 @@ if ('onhashchange' in window) {
<a href='https://github.com/akkartik/mu/blob/main/shell/read.mu'>https://github.com/akkartik/mu/blob/main/shell/read.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='read.mu.html#L1'>read-cell</a></span> in: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>), out: (addr handle <a href='cell.mu.html#L1'>cell</a>), trace: (addr trace) <span class="Delimiter">{</span>
<span id="L2" class="LineNr"> 2 </span> <span class="PreProc">var</span> tokens-storage: (stream <a href='cell.mu.html#L1'>cell</a> <span class="Constant">0x400</span>)
<span id="L3" class="LineNr"> 3 </span> <span class="PreProc">var</span> tokens/<span class="Constant">ecx</span>: (addr stream <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address tokens-storage
<span id="L4" class="LineNr"> 4 </span> <a href='tokenize.mu.html#L5'>tokenize</a> in, tokens, trace
<span id="L5" class="LineNr"> 5 </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="L6" class="LineNr"> 6 </span> compare error?, <span class="Constant">0</span>/false
<span id="L7" class="LineNr"> 7 </span> <span class="Delimiter">{</span>
<span id="L8" class="LineNr"> 8 </span> <span class="PreProc">break-if-=</span>
<span id="L9" class="LineNr"> 9 </span> <span class="PreProc">return</span>
<span id="L10" class="LineNr">10 </span> <span class="Delimiter">}</span>
<span id="L11" class="LineNr">11 </span> <span class="muComment"># TODO: insert parens</span>
<span id="L12" class="LineNr">12 </span> <span class="muComment"># TODO: transform infix</span>
<span id="L13" class="LineNr">13 </span> <a href='parse.mu.html#L1'>parse-input</a> tokens, out, trace
<span id="L14" class="LineNr">14 </span><span class="Delimiter">}</span>
<span id="L2" class="LineNr"> 2 </span> <span class="muComment"># TODO: we may be able to generate tokens lazily and drop this stream.</span>
<span id="L3" class="LineNr"> 3 </span> <span class="muComment"># Depends on how we implement indent-sensitivity and infix.</span>
<span id="L4" class="LineNr"> 4 </span> <span class="PreProc">var</span> tokens-storage: (stream <a href='cell.mu.html#L1'>cell</a> <span class="Constant">0x400</span>)
<span id="L5" class="LineNr"> 5 </span> <span class="PreProc">var</span> tokens/<span class="Constant">ecx</span>: (addr stream <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address tokens-storage
<span id="L6" class="LineNr"> 6 </span> <a href='tokenize.mu.html#L5'>tokenize</a> in, tokens, trace
<span id="L7" class="LineNr"> 7 </span> <span class="PreProc">var</span> error?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='trace.mu.html#L83'>has-errors?</a> trace
<span id="L8" class="LineNr"> 8 </span> compare error?, <span class="Constant">0</span>/false
<span id="L9" class="LineNr"> 9 </span> <span class="Delimiter">{</span>
<span id="L10" class="LineNr">10 </span> <span class="PreProc">break-if-=</span>
<span id="L11" class="LineNr">11 </span> <span class="PreProc">return</span>
<span id="L12" class="LineNr">12 </span> <span class="Delimiter">}</span>
<span id="L13" class="LineNr">13 </span> <span class="muComment"># TODO: insert parens</span>
<span id="L14" class="LineNr">14 </span> <span class="muComment"># TODO: transform infix</span>
<span id="L15" class="LineNr">15 </span> <a href='parse.mu.html#L1'>parse-input</a> tokens, out, trace
<span id="L16" class="LineNr">16 </span><span class="Delimiter">}</span>
</pre>
</body>
</html>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

3692
html/shell/trace.mu.html generated

File diff suppressed because it is too large Load Diff