This commit is contained in:
Kartik Agaram 2021-05-01 23:52:28 -07:00
parent f3fe2ac195
commit f0e146fc7b
21 changed files with 7950 additions and 6684 deletions

View File

@ -87,9 +87,9 @@ if ('onhashchange' in window) {
<span id="L26" class="LineNr"> 26 </span><span class="subxComment"># A default allocation descriptor for programs to use.</span>
<span id="L27" class="LineNr"> 27 </span><span class="SpecialChar">Heap</span>: <span class="subxComment"># allocation-descriptor</span>
<span id="L28" class="LineNr"> 28 </span> <span class="subxComment"># curr</span>
<span id="L29" class="LineNr"> 29 </span> 0x01000000/imm32 <span class="subxComment"># 16 MB</span>
<span id="L29" class="LineNr"> 29 </span> 0x02000000/imm32 <span class="subxComment"># 32 MB</span>
<span id="L30" class="LineNr"> 30 </span> <span class="subxComment"># limit</span>
<span id="L31" class="LineNr"> 31 </span> 0x02000000/imm32 <span class="subxComment"># 32 MB</span>
<span id="L31" class="LineNr"> 31 </span> 0x80000000/imm32 <span class="subxComment"># 2 GB</span>
<span id="L32" class="LineNr"> 32 </span>
<span id="L33" class="LineNr"> 33 </span><span class="SpecialChar">Next-alloc-id</span>: <span class="subxComment"># int</span>
<span id="L34" class="LineNr"> 34 </span> 0x100/imm32 <span class="subxComment"># save a few alloc ids for fake handles</span>

View File

@ -68,7 +68,7 @@ if ('onhashchange' in window) {
<span id="L10" class="LineNr"> 10 </span> 50/push-eax
<span id="L11" class="LineNr"> 11 </span> <span class="subxComment">#</span>
<span id="L12" class="LineNr"> 12 </span> 89/&lt;- %eax 4/r32/esp
<span id="L13" class="LineNr"> 13 </span> 81 7/subop/compare %eax 0x48600/imm32
<span id="L13" class="LineNr"> 13 </span> 81 7/subop/compare %eax 0x01000000/imm32
<span id="L14" class="LineNr"> 14 </span> {
<span id="L15" class="LineNr"> 15 </span> 7f/jump-if-&gt; <span class="Constant">break</span>/disp8
<span id="L16" class="LineNr"> 16 </span> (<a href='501draw-text.mu.html#L481'>abort</a> <span class="Constant">&quot;stack overflow&quot;</span>)

390
html/316colors.subx.html generated Normal file
View File

@ -0,0 +1,390 @@
<!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 - 316colors.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 { }
.subxTest { color: #5f8700; }
.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/316colors.subx'>https://github.com/akkartik/mu/blob/main/316colors.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># Some information about the default palette of 256 colors provided by the</span>
<span id="L2" class="LineNr"> 2 </span><span class="subxComment"># BIOS on x86 computers.</span>
<span id="L3" class="LineNr"> 3 </span>
<span id="L4" class="LineNr"> 4 </span>== code
<span id="L5" class="LineNr"> 5 </span>
<span id="L6" class="LineNr"> 6 </span><span class="subxComment"># Return the r/g/b for color [0, 256) in ecx/edx/ebx respectively.</span>
<span id="L7" class="LineNr"> 7 </span><span class="subxFunction">color-rgb</span>: <span class="subxComment"># color: int -&gt; _/ecx: int, _/edx: int, _/ebx: int</span>
<span id="L8" class="LineNr"> 8 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L9" class="LineNr"> 9 </span> 55/push-ebp
<span id="L10" class="LineNr"> 10 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L11" class="LineNr"> 11 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L12" class="LineNr"> 12 </span> 50/push-eax
<span id="L13" class="LineNr"> 13 </span> 56/push-esi
<span id="L14" class="LineNr"> 14 </span> <span class="subxComment"># esi = color</span>
<span id="L15" class="LineNr"> 15 </span> 8b/-&gt; *(ebp+8) 6/r32/esi
<span id="L16" class="LineNr"> 16 </span> <span class="subxComment">#</span>
<span id="L17" class="LineNr"> 17 </span> 81 7/subop/compare %esi 0x100/imm32
<span id="L18" class="LineNr"> 18 </span> {
<span id="L19" class="LineNr"> 19 </span> 7c/jump-if-&lt; <span class="Constant">break</span>/disp8
<span id="L20" class="LineNr"> 20 </span> (<a href='501draw-text.mu.html#L481'>abort</a> <span class="Constant">&quot;invalid color&quot;</span>)
<span id="L21" class="LineNr"> 21 </span> }
<span id="L22" class="LineNr"> 22 </span> <span class="subxComment"># var color/esi: int = Colors-rgb[color]</span>
<span id="L23" class="LineNr"> 23 </span> b8/copy-to-eax <span class="SpecialChar"><a href='316colors.subx.html#L71'>Colors-rgb</a></span>/imm32
<span id="L24" class="LineNr"> 24 </span> 8b/-&gt; *(eax+esi&lt;&lt;2+4) 6/r32/esi
<span id="L25" class="LineNr"> 25 </span> <span class="subxComment"># var red/ecx: int = color &amp; 0xff</span>
<span id="L26" class="LineNr"> 26 </span> 89/&lt;- %eax 6/r32/esi
<span id="L27" class="LineNr"> 27 </span> 25/and-eax-with 0xff/imm32
<span id="L28" class="LineNr"> 28 </span> 89/&lt;- %ecx 0/r32/eax
<span id="L29" class="LineNr"> 29 </span> <span class="subxComment"># var green/edx: int = (color &gt;&gt; 8) &amp; 0xff</span>
<span id="L30" class="LineNr"> 30 </span> 89/&lt;- %eax 6/r32/esi
<span id="L31" class="LineNr"> 31 </span> c1 5/subop/shift-right-logical %eax 8/imm8
<span id="L32" class="LineNr"> 32 </span> 25/and-eax-with 0xff/imm32
<span id="L33" class="LineNr"> 33 </span> 89/&lt;- %edx 0/r32/eax
<span id="L34" class="LineNr"> 34 </span> <span class="subxComment"># var blue/ebx: int = (color &gt;&gt; 16)</span>
<span id="L35" class="LineNr"> 35 </span> 89/&lt;- %eax 6/r32/esi
<span id="L36" class="LineNr"> 36 </span> c1 5/subop/shift-right-logical %eax 0x10/imm8
<span id="L37" class="LineNr"> 37 </span> 89/&lt;- %ebx 0/r32/eax
<span id="L38" class="LineNr"> 38 </span><span class="Constant">$colors-rgb:end</span>:
<span id="L39" class="LineNr"> 39 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L40" class="LineNr"> 40 </span> 5e/pop-to-esi
<span id="L41" class="LineNr"> 41 </span> 58/pop-to-eax
<span id="L42" class="LineNr"> 42 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L43" class="LineNr"> 43 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L44" class="LineNr"> 44 </span> 5d/pop-to-ebp
<span id="L45" class="LineNr"> 45 </span> c3/return
<span id="L46" class="LineNr"> 46 </span>
<span id="L47" class="LineNr"> 47 </span><span class="subxTest">test-color-rgb</span>:
<span id="L48" class="LineNr"> 48 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L49" class="LineNr"> 49 </span> 55/push-ebp
<span id="L50" class="LineNr"> 50 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L51" class="LineNr"> 51 </span> <span class="subxComment">#</span>
<span id="L52" class="LineNr"> 52 </span> (<a href='316colors.subx.html#L7'>color-rgb</a> 0x10) <span class="subxComment"># =&gt; eax ecx edx</span>
<span id="L53" class="LineNr"> 53 </span> (<a href='502test.mu.html#L2'>check-ints-equal</a> %ecx 0 <span class="Constant">&quot;F - <a href='316colors.subx.html#L47'>test-color-rgb</a>/0x10/r&quot;</span>)
<span id="L54" class="LineNr"> 54 </span> (<a href='502test.mu.html#L2'>check-ints-equal</a> %edx 0 <span class="Constant">&quot;F - <a href='316colors.subx.html#L47'>test-color-rgb</a>/0x10/g&quot;</span>)
<span id="L55" class="LineNr"> 55 </span> (<a href='502test.mu.html#L2'>check-ints-equal</a> %ebx 0 <span class="Constant">&quot;F - <a href='316colors.subx.html#L47'>test-color-rgb</a>/0x10/b&quot;</span>)
<span id="L56" class="LineNr"> 56 </span> (<a href='316colors.subx.html#L7'>color-rgb</a> 1) <span class="subxComment"># =&gt; eax ecx edx</span>
<span id="L57" class="LineNr"> 57 </span> (<a href='502test.mu.html#L2'>check-ints-equal</a> %ecx 0 <span class="Constant">&quot;F - <a href='316colors.subx.html#L47'>test-color-rgb</a>/1/r&quot;</span>)
<span id="L58" class="LineNr"> 58 </span> (<a href='502test.mu.html#L2'>check-ints-equal</a> %edx 0 <span class="Constant">&quot;F - <a href='316colors.subx.html#L47'>test-color-rgb</a>/1/g&quot;</span>)
<span id="L59" class="LineNr"> 59 </span> (<a href='502test.mu.html#L2'>check-ints-equal</a> %ebx 0xaa <span class="Constant">&quot;F - <a href='316colors.subx.html#L47'>test-color-rgb</a>/1/b&quot;</span>)
<span id="L60" class="LineNr"> 60 </span> (<a href='316colors.subx.html#L7'>color-rgb</a> 0xf) <span class="subxComment"># =&gt; eax ecx edx</span>
<span id="L61" class="LineNr"> 61 </span> (<a href='502test.mu.html#L2'>check-ints-equal</a> %ecx 0xff <span class="Constant">&quot;F - <a href='316colors.subx.html#L47'>test-color-rgb</a>/0xf/r&quot;</span>)
<span id="L62" class="LineNr"> 62 </span> (<a href='502test.mu.html#L2'>check-ints-equal</a> %edx 0xff <span class="Constant">&quot;F - <a href='316colors.subx.html#L47'>test-color-rgb</a>/0xf/g&quot;</span>)
<span id="L63" class="LineNr"> 63 </span> (<a href='502test.mu.html#L2'>check-ints-equal</a> %ebx 0xff <span class="Constant">&quot;F - <a href='316colors.subx.html#L47'>test-color-rgb</a>/0xf/b&quot;</span>)
<span id="L64" class="LineNr"> 64 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L65" class="LineNr"> 65 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L66" class="LineNr"> 66 </span> 5d/pop-to-ebp
<span id="L67" class="LineNr"> 67 </span> c3/return
<span id="L68" class="LineNr"> 68 </span>
<span id="L69" class="LineNr"> 69 </span>== data
<span id="L70" class="LineNr"> 70 </span>
<span id="L71" class="LineNr"> 71 </span><span class="SpecialChar">Colors-rgb</span>:
<span id="L72" class="LineNr"> 72 </span> 0x400/imm32
<span id="L73" class="LineNr"> 73 </span> 00 00 00 00
<span id="L74" class="LineNr"> 74 </span> 00 00 aa 00
<span id="L75" class="LineNr"> 75 </span> 00 aa 00 00
<span id="L76" class="LineNr"> 76 </span> 00 aa aa 00
<span id="L77" class="LineNr"> 77 </span> aa 00 00 00
<span id="L78" class="LineNr"> 78 </span> aa 00 aa 00
<span id="L79" class="LineNr"> 79 </span> aa 55 00 00
<span id="L80" class="LineNr"> 80 </span> aa aa aa 00
<span id="L81" class="LineNr"> 81 </span> 55 55 55 00
<span id="L82" class="LineNr"> 82 </span> 55 55 ff 00
<span id="L83" class="LineNr"> 83 </span> 55 ff 55 00
<span id="L84" class="LineNr"> 84 </span> 55 ff ff 00
<span id="L85" class="LineNr"> 85 </span> ff 55 55 00
<span id="L86" class="LineNr"> 86 </span> ff 55 ff 00
<span id="L87" class="LineNr"> 87 </span> ff ff 55 00
<span id="L88" class="LineNr"> 88 </span> ff ff ff 00
<span id="L89" class="LineNr"> 89 </span> 00 00 00 00
<span id="L90" class="LineNr"> 90 </span> 14 14 14 00
<span id="L91" class="LineNr"> 91 </span> 20 20 20 00
<span id="L92" class="LineNr"> 92 </span> 2c 2c 2c 00
<span id="L93" class="LineNr"> 93 </span> 38 38 38 00
<span id="L94" class="LineNr"> 94 </span> 45 45 45 00
<span id="L95" class="LineNr"> 95 </span> 51 51 51 00
<span id="L96" class="LineNr"> 96 </span> 61 61 61 00
<span id="L97" class="LineNr"> 97 </span> 71 71 71 00
<span id="L98" class="LineNr"> 98 </span> 82 82 82 00
<span id="L99" class="LineNr"> 99 </span> 92 92 92 00
<span id="L100" class="LineNr">100 </span> a2 a2 a2 00
<span id="L101" class="LineNr">101 </span> b6 b6 b6 00
<span id="L102" class="LineNr">102 </span> cb cb cb 00
<span id="L103" class="LineNr">103 </span> e3 e3 e3 00
<span id="L104" class="LineNr">104 </span> ff ff ff 00
<span id="L105" class="LineNr">105 </span> 00 00 ff 00
<span id="L106" class="LineNr">106 </span> 41 00 ff 00
<span id="L107" class="LineNr">107 </span> 7d 00 ff 00
<span id="L108" class="LineNr">108 </span> be 00 ff 00
<span id="L109" class="LineNr">109 </span> ff 00 ff 00
<span id="L110" class="LineNr">110 </span> ff 00 be 00
<span id="L111" class="LineNr">111 </span> ff 00 7d 00
<span id="L112" class="LineNr">112 </span> ff 00 41 00
<span id="L113" class="LineNr">113 </span> ff 00 00 00
<span id="L114" class="LineNr">114 </span> ff 41 00 00
<span id="L115" class="LineNr">115 </span> ff 7d 00 00
<span id="L116" class="LineNr">116 </span> ff be 00 00
<span id="L117" class="LineNr">117 </span> ff ff 00 00
<span id="L118" class="LineNr">118 </span> be ff 00 00
<span id="L119" class="LineNr">119 </span> 7d ff 00 00
<span id="L120" class="LineNr">120 </span> 41 ff 00 00
<span id="L121" class="LineNr">121 </span> 00 ff 00 00
<span id="L122" class="LineNr">122 </span> 00 ff 41 00
<span id="L123" class="LineNr">123 </span> 00 ff 7d 00
<span id="L124" class="LineNr">124 </span> 00 ff be 00
<span id="L125" class="LineNr">125 </span> 00 ff ff 00
<span id="L126" class="LineNr">126 </span> 00 be ff 00
<span id="L127" class="LineNr">127 </span> 00 7d ff 00
<span id="L128" class="LineNr">128 </span> 00 41 ff 00
<span id="L129" class="LineNr">129 </span> 7d 7d ff 00
<span id="L130" class="LineNr">130 </span> 9e 7d ff 00
<span id="L131" class="LineNr">131 </span> be 7d ff 00
<span id="L132" class="LineNr">132 </span> df 7d ff 00
<span id="L133" class="LineNr">133 </span> ff 7d ff 00
<span id="L134" class="LineNr">134 </span> ff 7d df 00
<span id="L135" class="LineNr">135 </span> ff 7d be 00
<span id="L136" class="LineNr">136 </span> ff 7d 9e 00
<span id="L137" class="LineNr">137 </span> ff 7d 7d 00
<span id="L138" class="LineNr">138 </span> ff 9e 7d 00
<span id="L139" class="LineNr">139 </span> ff be 7d 00
<span id="L140" class="LineNr">140 </span> ff df 7d 00
<span id="L141" class="LineNr">141 </span> ff ff 7d 00
<span id="L142" class="LineNr">142 </span> df ff 7d 00
<span id="L143" class="LineNr">143 </span> be ff 7d 00
<span id="L144" class="LineNr">144 </span> 9e ff 7d 00
<span id="L145" class="LineNr">145 </span> 7d ff 7d 00
<span id="L146" class="LineNr">146 </span> 7d ff 9e 00
<span id="L147" class="LineNr">147 </span> 7d ff be 00
<span id="L148" class="LineNr">148 </span> 7d ff df 00
<span id="L149" class="LineNr">149 </span> 7d ff ff 00
<span id="L150" class="LineNr">150 </span> 7d df ff 00
<span id="L151" class="LineNr">151 </span> 7d be ff 00
<span id="L152" class="LineNr">152 </span> 7d 9e ff 00
<span id="L153" class="LineNr">153 </span> b6 b6 ff 00
<span id="L154" class="LineNr">154 </span> c7 b6 ff 00
<span id="L155" class="LineNr">155 </span> db b6 ff 00
<span id="L156" class="LineNr">156 </span> eb b6 ff 00
<span id="L157" class="LineNr">157 </span> ff b6 ff 00
<span id="L158" class="LineNr">158 </span> ff b6 eb 00
<span id="L159" class="LineNr">159 </span> ff b6 db 00
<span id="L160" class="LineNr">160 </span> ff b6 c7 00
<span id="L161" class="LineNr">161 </span> ff b6 b6 00
<span id="L162" class="LineNr">162 </span> ff c7 b6 00
<span id="L163" class="LineNr">163 </span> ff db b6 00
<span id="L164" class="LineNr">164 </span> ff eb b6 00
<span id="L165" class="LineNr">165 </span> ff ff b6 00
<span id="L166" class="LineNr">166 </span> eb ff b6 00
<span id="L167" class="LineNr">167 </span> db ff b6 00
<span id="L168" class="LineNr">168 </span> c7 ff b6 00
<span id="L169" class="LineNr">169 </span> b6 ff b6 00
<span id="L170" class="LineNr">170 </span> b6 ff c7 00
<span id="L171" class="LineNr">171 </span> b6 ff db 00
<span id="L172" class="LineNr">172 </span> b6 ff eb 00
<span id="L173" class="LineNr">173 </span> b6 ff ff 00
<span id="L174" class="LineNr">174 </span> b6 eb ff 00
<span id="L175" class="LineNr">175 </span> b6 db ff 00
<span id="L176" class="LineNr">176 </span> b6 c7 ff 00
<span id="L177" class="LineNr">177 </span> 00 00 71 00
<span id="L178" class="LineNr">178 </span> 1c 00 71 00
<span id="L179" class="LineNr">179 </span> 38 00 71 00
<span id="L180" class="LineNr">180 </span> 55 00 71 00
<span id="L181" class="LineNr">181 </span> 71 00 71 00
<span id="L182" class="LineNr">182 </span> 71 00 55 00
<span id="L183" class="LineNr">183 </span> 71 00 38 00
<span id="L184" class="LineNr">184 </span> 71 00 1c 00
<span id="L185" class="LineNr">185 </span> 71 00 00 00
<span id="L186" class="LineNr">186 </span> 71 1c 00 00
<span id="L187" class="LineNr">187 </span> 71 38 00 00
<span id="L188" class="LineNr">188 </span> 71 55 00 00
<span id="L189" class="LineNr">189 </span> 71 71 00 00
<span id="L190" class="LineNr">190 </span> 55 71 00 00
<span id="L191" class="LineNr">191 </span> 38 71 00 00
<span id="L192" class="LineNr">192 </span> 1c 71 00 00
<span id="L193" class="LineNr">193 </span> 00 71 00 00
<span id="L194" class="LineNr">194 </span> 00 71 1c 00
<span id="L195" class="LineNr">195 </span> 00 71 38 00
<span id="L196" class="LineNr">196 </span> 00 71 55 00
<span id="L197" class="LineNr">197 </span> 00 71 71 00
<span id="L198" class="LineNr">198 </span> 00 55 71 00
<span id="L199" class="LineNr">199 </span> 00 38 71 00
<span id="L200" class="LineNr">200 </span> 00 1c 71 00
<span id="L201" class="LineNr">201 </span> 38 38 71 00
<span id="L202" class="LineNr">202 </span> 45 38 71 00
<span id="L203" class="LineNr">203 </span> 55 38 71 00
<span id="L204" class="LineNr">204 </span> 61 38 71 00
<span id="L205" class="LineNr">205 </span> 71 38 71 00
<span id="L206" class="LineNr">206 </span> 71 38 61 00
<span id="L207" class="LineNr">207 </span> 71 38 55 00
<span id="L208" class="LineNr">208 </span> 71 38 45 00
<span id="L209" class="LineNr">209 </span> 71 38 38 00
<span id="L210" class="LineNr">210 </span> 71 45 38 00
<span id="L211" class="LineNr">211 </span> 71 55 38 00
<span id="L212" class="LineNr">212 </span> 71 61 38 00
<span id="L213" class="LineNr">213 </span> 71 71 38 00
<span id="L214" class="LineNr">214 </span> 61 71 38 00
<span id="L215" class="LineNr">215 </span> 55 71 38 00
<span id="L216" class="LineNr">216 </span> 45 71 38 00
<span id="L217" class="LineNr">217 </span> 38 71 38 00
<span id="L218" class="LineNr">218 </span> 38 71 45 00
<span id="L219" class="LineNr">219 </span> 38 71 55 00
<span id="L220" class="LineNr">220 </span> 38 71 61 00
<span id="L221" class="LineNr">221 </span> 38 71 71 00
<span id="L222" class="LineNr">222 </span> 38 61 71 00
<span id="L223" class="LineNr">223 </span> 38 55 71 00
<span id="L224" class="LineNr">224 </span> 38 45 71 00
<span id="L225" class="LineNr">225 </span> 51 51 71 00
<span id="L226" class="LineNr">226 </span> 59 51 71 00
<span id="L227" class="LineNr">227 </span> 61 51 71 00
<span id="L228" class="LineNr">228 </span> 69 51 71 00
<span id="L229" class="LineNr">229 </span> 71 51 71 00
<span id="L230" class="LineNr">230 </span> 71 51 69 00
<span id="L231" class="LineNr">231 </span> 71 51 61 00
<span id="L232" class="LineNr">232 </span> 71 51 59 00
<span id="L233" class="LineNr">233 </span> 71 51 51 00
<span id="L234" class="LineNr">234 </span> 71 59 51 00
<span id="L235" class="LineNr">235 </span> 71 61 51 00
<span id="L236" class="LineNr">236 </span> 71 69 51 00
<span id="L237" class="LineNr">237 </span> 71 71 51 00
<span id="L238" class="LineNr">238 </span> 69 71 51 00
<span id="L239" class="LineNr">239 </span> 61 71 51 00
<span id="L240" class="LineNr">240 </span> 59 71 51 00
<span id="L241" class="LineNr">241 </span> 51 71 51 00
<span id="L242" class="LineNr">242 </span> 51 71 59 00
<span id="L243" class="LineNr">243 </span> 51 71 61 00
<span id="L244" class="LineNr">244 </span> 51 71 69 00
<span id="L245" class="LineNr">245 </span> 51 71 71 00
<span id="L246" class="LineNr">246 </span> 51 69 71 00
<span id="L247" class="LineNr">247 </span> 51 61 71 00
<span id="L248" class="LineNr">248 </span> 51 59 71 00
<span id="L249" class="LineNr">249 </span> 00 00 41 00
<span id="L250" class="LineNr">250 </span> 10 00 41 00
<span id="L251" class="LineNr">251 </span> 20 00 41 00
<span id="L252" class="LineNr">252 </span> 30 00 41 00
<span id="L253" class="LineNr">253 </span> 41 00 41 00
<span id="L254" class="LineNr">254 </span> 41 00 30 00
<span id="L255" class="LineNr">255 </span> 41 00 20 00
<span id="L256" class="LineNr">256 </span> 41 00 10 00
<span id="L257" class="LineNr">257 </span> 41 00 00 00
<span id="L258" class="LineNr">258 </span> 41 10 00 00
<span id="L259" class="LineNr">259 </span> 41 20 00 00
<span id="L260" class="LineNr">260 </span> 41 30 00 00
<span id="L261" class="LineNr">261 </span> 41 41 00 00
<span id="L262" class="LineNr">262 </span> 30 41 00 00
<span id="L263" class="LineNr">263 </span> 20 41 00 00
<span id="L264" class="LineNr">264 </span> 10 41 00 00
<span id="L265" class="LineNr">265 </span> 00 41 00 00
<span id="L266" class="LineNr">266 </span> 00 41 10 00
<span id="L267" class="LineNr">267 </span> 00 41 20 00
<span id="L268" class="LineNr">268 </span> 00 41 30 00
<span id="L269" class="LineNr">269 </span> 00 41 41 00
<span id="L270" class="LineNr">270 </span> 00 30 41 00
<span id="L271" class="LineNr">271 </span> 00 20 41 00
<span id="L272" class="LineNr">272 </span> 00 10 41 00
<span id="L273" class="LineNr">273 </span> 20 20 41 00
<span id="L274" class="LineNr">274 </span> 28 20 41 00
<span id="L275" class="LineNr">275 </span> 30 20 41 00
<span id="L276" class="LineNr">276 </span> 38 20 41 00
<span id="L277" class="LineNr">277 </span> 41 20 41 00
<span id="L278" class="LineNr">278 </span> 41 20 38 00
<span id="L279" class="LineNr">279 </span> 41 20 30 00
<span id="L280" class="LineNr">280 </span> 41 20 28 00
<span id="L281" class="LineNr">281 </span> 41 20 20 00
<span id="L282" class="LineNr">282 </span> 41 28 20 00
<span id="L283" class="LineNr">283 </span> 41 30 20 00
<span id="L284" class="LineNr">284 </span> 41 38 20 00
<span id="L285" class="LineNr">285 </span> 41 41 20 00
<span id="L286" class="LineNr">286 </span> 38 41 20 00
<span id="L287" class="LineNr">287 </span> 30 41 20 00
<span id="L288" class="LineNr">288 </span> 28 41 20 00
<span id="L289" class="LineNr">289 </span> 20 41 20 00
<span id="L290" class="LineNr">290 </span> 20 41 28 00
<span id="L291" class="LineNr">291 </span> 20 41 30 00
<span id="L292" class="LineNr">292 </span> 20 41 38 00
<span id="L293" class="LineNr">293 </span> 20 41 41 00
<span id="L294" class="LineNr">294 </span> 20 38 41 00
<span id="L295" class="LineNr">295 </span> 20 30 41 00
<span id="L296" class="LineNr">296 </span> 20 28 41 00
<span id="L297" class="LineNr">297 </span> 2c 2c 41 00
<span id="L298" class="LineNr">298 </span> 30 2c 41 00
<span id="L299" class="LineNr">299 </span> 34 2c 41 00
<span id="L300" class="LineNr">300 </span> 3c 2c 41 00
<span id="L301" class="LineNr">301 </span> 41 2c 41 00
<span id="L302" class="LineNr">302 </span> 41 2c 3c 00
<span id="L303" class="LineNr">303 </span> 41 2c 34 00
<span id="L304" class="LineNr">304 </span> 41 2c 30 00
<span id="L305" class="LineNr">305 </span> 41 2c 2c 00
<span id="L306" class="LineNr">306 </span> 41 30 2c 00
<span id="L307" class="LineNr">307 </span> 41 34 2c 00
<span id="L308" class="LineNr">308 </span> 41 3c 2c 00
<span id="L309" class="LineNr">309 </span> 41 41 2c 00
<span id="L310" class="LineNr">310 </span> 3c 41 2c 00
<span id="L311" class="LineNr">311 </span> 34 41 2c 00
<span id="L312" class="LineNr">312 </span> 30 41 2c 00
<span id="L313" class="LineNr">313 </span> 2c 41 2c 00
<span id="L314" class="LineNr">314 </span> 2c 41 30 00
<span id="L315" class="LineNr">315 </span> 2c 41 34 00
<span id="L316" class="LineNr">316 </span> 2c 41 3c 00
<span id="L317" class="LineNr">317 </span> 2c 41 41 00
<span id="L318" class="LineNr">318 </span> 2c 3c 41 00
<span id="L319" class="LineNr">319 </span> 2c 34 41 00
<span id="L320" class="LineNr">320 </span> 2c 30 41 00
<span id="L321" class="LineNr">321 </span> 00 00 00 00
<span id="L322" class="LineNr">322 </span> 00 00 00 00
<span id="L323" class="LineNr">323 </span> 00 00 00 00
<span id="L324" class="LineNr">324 </span> 00 00 00 00
<span id="L325" class="LineNr">325 </span> 00 00 00 00
<span id="L326" class="LineNr">326 </span> 00 00 00 00
<span id="L327" class="LineNr">327 </span> 00 00 00 00
<span id="L328" class="LineNr">328 </span> 00 00 00 00
</pre>
</body>
</html>
<!-- vim: set foldmethod=manual : -->

185
html/400.mu.html generated
View File

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

297
html/505colors.mu.html generated Normal file
View File

@ -0,0 +1,297 @@
<!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 - 505colors.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="colorscheme" content="minimal-dark">
<style type="text/css">
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #a8a8a8; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #a8a8a8; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.Special { color: #ff6060; }
.LineNr { }
.Delimiter { color: #c000c0; }
.Constant { color: #008787; }
.muFunction { color: #af5f00; text-decoration: underline; }
.muTest { color: #5f8700; }
.muComment { color: #005faf; }
-->
</style>
<script type='text/javascript'>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
function JumpToLine()
{
var lineNum;
lineNum = window.location.hash;
lineNum = lineNum.substr(1); /* strip off '#' */
if (lineNum.indexOf('L') == -1) {
lineNum = 'L'+lineNum;
}
var lineElem = document.getElementById(lineNum);
/* Always jump to new location even if the line was hidden inside a fold, or
* we corrected the raw number to a line ID.
*/
if (lineElem) {
lineElem.scrollIntoView(true);
}
return true;
}
if ('onhashchange' in window) {
window.onhashchange = JumpToLine;
}
-->
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/main/505colors.mu'>https://github.com/akkartik/mu/blob/main/505colors.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># Hue/saturation/luminance for an rgb triple.</span>
<span id="L2" class="LineNr"> 2 </span><span class="muComment"># rgb are in [0, 256)</span>
<span id="L3" class="LineNr"> 3 </span><span class="muComment"># hsl are also returned in [0, 256)</span>
<span id="L4" class="LineNr"> 4 </span><span class="muComment"># from <a href="https://www.niwa.nu/2013/05/math-behind-colorspace-conversions-rgb-hsl">https://www.niwa.nu/2013/05/math-behind-colorspace-conversions-rgb-hsl</a></span>
<span id="L5" class="LineNr"> 5 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='505colors.mu.html#L5'>hsl</a></span> r: int, g: int, b: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">ecx</span>: int, _/<span class="Constant">edx</span>: int, _/<span class="Constant">ebx</span>: int <span class="Delimiter">{</span>
<span id="L6" class="LineNr"> 6 </span> <span class="PreProc">var</span> _max/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='505colors.mu.html#L216'>maximum</a> r, g
<span id="L7" class="LineNr"> 7 </span> _max <span class="Special">&lt;-</span> <a href='505colors.mu.html#L216'>maximum</a> _max, b
<span id="L8" class="LineNr"> 8 </span> <span class="PreProc">var</span> max/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy _max
<span id="L9" class="LineNr"> 9 </span> <span class="PreProc">var</span> _min/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='505colors.mu.html#L226'>minimum</a> r, g
<span id="L10" class="LineNr"> 10 </span> _min <span class="Special">&lt;-</span> <a href='505colors.mu.html#L226'>minimum</a> _min, b
<span id="L11" class="LineNr"> 11 </span> <span class="PreProc">var</span> min/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy _min
<span id="L12" class="LineNr"> 12 </span> <span class="PreProc">var</span> luminance/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy min
<span id="L13" class="LineNr"> 13 </span> luminance <span class="Special">&lt;-</span> add max
<span id="L14" class="LineNr"> 14 </span> luminance <span class="Special">&lt;-</span> shift-right <span class="Constant">1</span> <span class="muComment"># TODO: round up instead of down</span>
<span id="L15" class="LineNr"> 15 </span> <span class="muComment"># if rgb are all equal, it's a shade of grey</span>
<span id="L16" class="LineNr"> 16 </span> compare min, max
<span id="L17" class="LineNr"> 17 </span> <span class="Delimiter">{</span>
<span id="L18" class="LineNr"> 18 </span> <span class="PreProc">break-if-!=</span>
<span id="L19" class="LineNr"> 19 </span> <span class="PreProc">return</span> <span class="Constant">0</span>, <span class="Constant">0</span>, luminance
<span id="L20" class="LineNr"> 20 </span> <span class="Delimiter">}</span>
<span id="L21" class="LineNr"> 21 </span> <span class="muComment"># saturation =</span>
<span id="L22" class="LineNr"> 22 </span> <span class="muComment"># luminance &lt; 128 | 255*(max-min)/ (max+min)</span>
<span id="L23" class="LineNr"> 23 </span> <span class="muComment"># otherwise | 255*(max-min)/(2*255 - (max+min))</span>
<span id="L24" class="LineNr"> 24 </span> <span class="PreProc">var</span> nr/<span class="Constant">esi</span>: int <span class="Special">&lt;-</span> copy max
<span id="L25" class="LineNr"> 25 </span> nr <span class="Special">&lt;-</span> subtract min
<span id="L26" class="LineNr"> 26 </span> <span class="PreProc">var</span> dr/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L27" class="LineNr"> 27 </span> compare luminance, <span class="Constant">0x80</span>
<span id="L28" class="LineNr"> 28 </span> <span class="Delimiter">{</span>
<span id="L29" class="LineNr"> 29 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L30" class="LineNr"> 30 </span> dr <span class="Special">&lt;-</span> copy max
<span id="L31" class="LineNr"> 31 </span> dr <span class="Special">&lt;-</span> add min
<span id="L32" class="LineNr"> 32 </span> <span class="Delimiter">}</span>
<span id="L33" class="LineNr"> 33 </span> <span class="Delimiter">{</span>
<span id="L34" class="LineNr"> 34 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L35" class="LineNr"> 35 </span> dr <span class="Special">&lt;-</span> copy <span class="Constant">0xff</span>
<span id="L36" class="LineNr"> 36 </span> dr <span class="Special">&lt;-</span> shift-left <span class="Constant">1</span>
<span id="L37" class="LineNr"> 37 </span> dr <span class="Special">&lt;-</span> subtract max
<span id="L38" class="LineNr"> 38 </span> dr <span class="Special">&lt;-</span> subtract min
<span id="L39" class="LineNr"> 39 </span> <span class="Delimiter">}</span>
<span id="L40" class="LineNr"> 40 </span> <span class="PreProc">var</span> q/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> convert nr
<span id="L41" class="LineNr"> 41 </span> <span class="PreProc">var</span> tmp/<span class="Constant">xmm1</span>: float <span class="Special">&lt;-</span> convert dr
<span id="L42" class="LineNr"> 42 </span> q <span class="Special">&lt;-</span> divide tmp
<span id="L43" class="LineNr"> 43 </span> <span class="PreProc">var</span> int-255/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0xff</span>
<span id="L44" class="LineNr"> 44 </span> tmp <span class="Special">&lt;-</span> convert int-255
<span id="L45" class="LineNr"> 45 </span> q <span class="Special">&lt;-</span> multiply tmp
<span id="L46" class="LineNr"> 46 </span> <span class="PreProc">var</span> saturation/<span class="Constant">esi</span>: int <span class="Special">&lt;-</span> convert q
<span id="L47" class="LineNr"> 47 </span> <span class="muComment"># hue = </span>
<span id="L48" class="LineNr"> 48 </span> <span class="muComment"># red is max | 256.0/6* (g-b)/(max-min)</span>
<span id="L49" class="LineNr"> 49 </span> <span class="muComment"># green is max | 256.0/6*(2.0 + (b-r)/(max-min))</span>
<span id="L50" class="LineNr"> 50 </span> <span class="muComment"># blue is max | 256.0/6*(4.0 + (r-g)/(max-min))</span>
<span id="L51" class="LineNr"> 51 </span> <span class="PreProc">var</span> zero/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L52" class="LineNr"> 52 </span> <span class="PreProc">var</span> hue-f/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> convert zero
<span id="L53" class="LineNr"> 53 </span> <span class="PreProc">var</span> dr/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy max
<span id="L54" class="LineNr"> 54 </span> dr <span class="Special">&lt;-</span> subtract min
<span id="L55" class="LineNr"> 55 </span> <span class="PreProc">var</span> dr-f/<span class="Constant">xmm1</span>: float <span class="Special">&lt;-</span> convert dr
<span id="L56" class="LineNr"> 56 </span> $hsl:compute-hue-normalized: <span class="Delimiter">{</span>
<span id="L57" class="LineNr"> 57 </span> compare r, max
<span id="L58" class="LineNr"> 58 </span> <span class="Delimiter">{</span>
<span id="L59" class="LineNr"> 59 </span> <span class="PreProc">break-if-!=</span>
<span id="L60" class="LineNr"> 60 </span> <span class="PreProc">var</span> nr/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy g
<span id="L61" class="LineNr"> 61 </span> nr <span class="Special">&lt;-</span> subtract b
<span id="L62" class="LineNr"> 62 </span> hue-f <span class="Special">&lt;-</span> convert nr
<span id="L63" class="LineNr"> 63 </span> hue-f <span class="Special">&lt;-</span> divide dr-f
<span id="L64" class="LineNr"> 64 </span> <span class="PreProc">break</span> $hsl:compute-hue-normalized
<span id="L65" class="LineNr"> 65 </span> <span class="Delimiter">}</span>
<span id="L66" class="LineNr"> 66 </span> compare g, max
<span id="L67" class="LineNr"> 67 </span> <span class="Delimiter">{</span>
<span id="L68" class="LineNr"> 68 </span> <span class="PreProc">break-if-!=</span>
<span id="L69" class="LineNr"> 69 </span> <span class="PreProc">var</span> nr/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy b
<span id="L70" class="LineNr"> 70 </span> nr <span class="Special">&lt;-</span> subtract r
<span id="L71" class="LineNr"> 71 </span> <span class="PreProc">var</span> f/<span class="Constant">xmm2</span>: float <span class="Special">&lt;-</span> convert nr
<span id="L72" class="LineNr"> 72 </span> f <span class="Special">&lt;-</span> divide dr-f
<span id="L73" class="LineNr"> 73 </span> <span class="PreProc">var</span> two/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">2</span>
<span id="L74" class="LineNr"> 74 </span> hue-f <span class="Special">&lt;-</span> convert two
<span id="L75" class="LineNr"> 75 </span> hue-f <span class="Special">&lt;-</span> add f
<span id="L76" class="LineNr"> 76 </span> <span class="PreProc">break</span> $hsl:compute-hue-normalized
<span id="L77" class="LineNr"> 77 </span> <span class="Delimiter">}</span>
<span id="L78" class="LineNr"> 78 </span> compare b, max
<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> nr/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy r
<span id="L82" class="LineNr"> 82 </span> nr <span class="Special">&lt;-</span> subtract g
<span id="L83" class="LineNr"> 83 </span> <span class="PreProc">var</span> f/<span class="Constant">xmm2</span>: float <span class="Special">&lt;-</span> convert nr
<span id="L84" class="LineNr"> 84 </span> f <span class="Special">&lt;-</span> divide dr-f
<span id="L85" class="LineNr"> 85 </span> <span class="PreProc">var</span> two/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">4</span>
<span id="L86" class="LineNr"> 86 </span> hue-f <span class="Special">&lt;-</span> convert two
<span id="L87" class="LineNr"> 87 </span> hue-f <span class="Special">&lt;-</span> add f
<span id="L88" class="LineNr"> 88 </span> <span class="PreProc">break</span> $hsl:compute-hue-normalized
<span id="L89" class="LineNr"> 89 </span> <span class="Delimiter">}</span>
<span id="L90" class="LineNr"> 90 </span> <span class="Delimiter">}</span>
<span id="L91" class="LineNr"> 91 </span> <span class="PreProc">var</span> int-256/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0x100</span>
<span id="L92" class="LineNr"> 92 </span> <span class="PreProc">var</span> scaling-factor/<span class="Constant">xmm1</span>: float <span class="Special">&lt;-</span> convert int-256
<span id="L93" class="LineNr"> 93 </span> <span class="PreProc">var</span> int-6/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">6</span>
<span id="L94" class="LineNr"> 94 </span> <span class="PreProc">var</span> six-f/<span class="Constant">xmm2</span>: float <span class="Special">&lt;-</span> convert int-6
<span id="L95" class="LineNr"> 95 </span> scaling-factor <span class="Special">&lt;-</span> divide six-f
<span id="L96" class="LineNr"> 96 </span> hue-f <span class="Special">&lt;-</span> multiply scaling-factor
<span id="L97" class="LineNr"> 97 </span> <span class="PreProc">var</span> hue/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> convert hue-f
<span id="L98" class="LineNr"> 98 </span> <span class="muComment"># if hue &lt; 0, hue = 256 - hue</span>
<span id="L99" class="LineNr"> 99 </span> compare hue, <span class="Constant">0</span>
<span id="L100" class="LineNr">100 </span> <span class="Delimiter">{</span>
<span id="L101" class="LineNr">101 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L102" class="LineNr">102 </span> <span class="PreProc">var</span> tmp/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0x100</span>
<span id="L103" class="LineNr">103 </span> tmp <span class="Special">&lt;-</span> subtract hue
<span id="L104" class="LineNr">104 </span> hue <span class="Special">&lt;-</span> copy tmp
<span id="L105" class="LineNr">105 </span> <span class="Delimiter">}</span>
<span id="L106" class="LineNr">106 </span> <span class="PreProc">return</span> hue, saturation, luminance
<span id="L107" class="LineNr">107 </span><span class="Delimiter">}</span>
<span id="L108" class="LineNr">108 </span>
<span id="L109" class="LineNr">109 </span><span class="PreProc">fn</span> <span class="muTest"><a href='505colors.mu.html#L109'>test-hsl-black</a></span> <span class="Delimiter">{</span>
<span id="L110" class="LineNr">110 </span> <span class="PreProc">var</span> h/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L111" class="LineNr">111 </span> <span class="PreProc">var</span> s/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L112" class="LineNr">112 </span> <span class="PreProc">var</span> l/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L113" class="LineNr">113 </span> h, s, l <span class="Special">&lt;-</span> <a href='505colors.mu.html#L5'>hsl</a> <span class="Constant">0</span>, <span class="Constant">0</span>, <span class="Constant">0</span>
<span id="L114" class="LineNr">114 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> h, <span class="Constant">0</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L109'>test-hsl-black</a>/hue&quot;</span>
<span id="L115" class="LineNr">115 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> s, <span class="Constant">0</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L109'>test-hsl-black</a>/saturation&quot;</span>
<span id="L116" class="LineNr">116 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> l, <span class="Constant">0</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L109'>test-hsl-black</a>/luminance&quot;</span>
<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="PreProc">fn</span> <span class="muTest"><a href='505colors.mu.html#L119'>test-hsl-white</a></span> <span class="Delimiter">{</span>
<span id="L120" class="LineNr">120 </span> <span class="PreProc">var</span> h/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L121" class="LineNr">121 </span> <span class="PreProc">var</span> s/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L122" class="LineNr">122 </span> <span class="PreProc">var</span> l/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L123" class="LineNr">123 </span> h, s, l <span class="Special">&lt;-</span> <a href='505colors.mu.html#L5'>hsl</a> <span class="Constant">0xff</span>, <span class="Constant">0xff</span>, <span class="Constant">0xff</span>
<span id="L124" class="LineNr">124 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> h, <span class="Constant">0</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L119'>test-hsl-white</a>/hue&quot;</span>
<span id="L125" class="LineNr">125 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> s, <span class="Constant">0</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L119'>test-hsl-white</a>/saturation&quot;</span>
<span id="L126" class="LineNr">126 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> l, <span class="Constant">0xff</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L119'>test-hsl-white</a>/luminance&quot;</span>
<span id="L127" class="LineNr">127 </span><span class="Delimiter">}</span>
<span id="L128" class="LineNr">128 </span>
<span id="L129" class="LineNr">129 </span><span class="PreProc">fn</span> <span class="muTest"><a href='505colors.mu.html#L129'>test-hsl-grey</a></span> <span class="Delimiter">{</span>
<span id="L130" class="LineNr">130 </span> <span class="PreProc">var</span> h/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L131" class="LineNr">131 </span> <span class="PreProc">var</span> s/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L132" class="LineNr">132 </span> <span class="PreProc">var</span> l/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L133" class="LineNr">133 </span> h, s, l <span class="Special">&lt;-</span> <a href='505colors.mu.html#L5'>hsl</a> <span class="Constant">0x30</span>, <span class="Constant">0x30</span>, <span class="Constant">0x30</span>
<span id="L134" class="LineNr">134 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> h, <span class="Constant">0</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L129'>test-hsl-grey</a>/hue&quot;</span>
<span id="L135" class="LineNr">135 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> s, <span class="Constant">0</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L129'>test-hsl-grey</a>/saturation&quot;</span>
<span id="L136" class="LineNr">136 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> l, <span class="Constant">0x30</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L129'>test-hsl-grey</a>/luminance&quot;</span>
<span id="L137" class="LineNr">137 </span><span class="Delimiter">}</span>
<span id="L138" class="LineNr">138 </span>
<span id="L139" class="LineNr">139 </span><span class="muComment"># red hues: 0-0x54</span>
<span id="L140" class="LineNr">140 </span><span class="PreProc">fn</span> <span class="muTest"><a href='505colors.mu.html#L140'>test-hsl-slightly-red</a></span> <span class="Delimiter">{</span>
<span id="L141" class="LineNr">141 </span> <span class="PreProc">var</span> h/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L142" class="LineNr">142 </span> <span class="PreProc">var</span> s/<span class="Constant">edx</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> l/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L144" class="LineNr">144 </span> h, s, l <span class="Special">&lt;-</span> <a href='505colors.mu.html#L5'>hsl</a> <span class="Constant">0xff</span>, <span class="Constant">0xfe</span>, <span class="Constant">0xfe</span>
<span id="L145" class="LineNr">145 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> h, <span class="Constant">0</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L140'>test-hsl-slightly-red</a>/hue&quot;</span>
<span id="L146" class="LineNr">146 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> s, <span class="Constant">0xff</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L140'>test-hsl-slightly-red</a>/saturation&quot;</span>
<span id="L147" class="LineNr">147 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> l, <span class="Constant">0xfe</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L140'>test-hsl-slightly-red</a>/luminance&quot;</span> <span class="muComment"># TODO: should round up</span>
<span id="L148" class="LineNr">148 </span><span class="Delimiter">}</span>
<span id="L149" class="LineNr">149 </span>
<span id="L150" class="LineNr">150 </span><span class="PreProc">fn</span> <span class="muTest"><a href='505colors.mu.html#L150'>test-hsl-extremely-red</a></span> <span class="Delimiter">{</span>
<span id="L151" class="LineNr">151 </span> <span class="PreProc">var</span> h/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L152" class="LineNr">152 </span> <span class="PreProc">var</span> s/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L153" class="LineNr">153 </span> <span class="PreProc">var</span> l/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L154" class="LineNr">154 </span> h, s, l <span class="Special">&lt;-</span> <a href='505colors.mu.html#L5'>hsl</a> <span class="Constant">0xff</span>, <span class="Constant">0</span>, <span class="Constant">0</span>
<span id="L155" class="LineNr">155 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> h, <span class="Constant">0</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L150'>test-hsl-extremely-red</a>/hue&quot;</span>
<span id="L156" class="LineNr">156 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> s, <span class="Constant">0xff</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L150'>test-hsl-extremely-red</a>/saturation&quot;</span>
<span id="L157" class="LineNr">157 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> l, <span class="Constant">0x7f</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L150'>test-hsl-extremely-red</a>/luminance&quot;</span> <span class="muComment"># TODO: should round up</span>
<span id="L158" class="LineNr">158 </span><span class="Delimiter">}</span>
<span id="L159" class="LineNr">159 </span>
<span id="L160" class="LineNr">160 </span><span class="muComment"># green hues: 0x55-0xaa</span>
<span id="L161" class="LineNr">161 </span><span class="PreProc">fn</span> <span class="muTest"><a href='505colors.mu.html#L161'>test-hsl-slightly-green</a></span> <span class="Delimiter">{</span>
<span id="L162" class="LineNr">162 </span> <span class="PreProc">var</span> h/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L163" class="LineNr">163 </span> <span class="PreProc">var</span> s/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L164" class="LineNr">164 </span> <span class="PreProc">var</span> l/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L165" class="LineNr">165 </span> h, s, l <span class="Special">&lt;-</span> <a href='505colors.mu.html#L5'>hsl</a> <span class="Constant">0xfe</span>, <span class="Constant">0xff</span>, <span class="Constant">0xfe</span>
<span id="L166" class="LineNr">166 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> h, <span class="Constant">0x55</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L161'>test-hsl-slightly-green</a>/hue&quot;</span>
<span id="L167" class="LineNr">167 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> s, <span class="Constant">0xff</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L161'>test-hsl-slightly-green</a>/saturation&quot;</span>
<span id="L168" class="LineNr">168 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> l, <span class="Constant">0xfe</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L161'>test-hsl-slightly-green</a>/luminance&quot;</span> <span class="muComment"># TODO: should round up</span>
<span id="L169" class="LineNr">169 </span><span class="Delimiter">}</span>
<span id="L170" class="LineNr">170 </span>
<span id="L171" class="LineNr">171 </span><span class="PreProc">fn</span> <span class="muTest"><a href='505colors.mu.html#L171'>test-hsl-extremely-green</a></span> <span class="Delimiter">{</span>
<span id="L172" class="LineNr">172 </span> <span class="PreProc">var</span> h/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L173" class="LineNr">173 </span> <span class="PreProc">var</span> s/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L174" class="LineNr">174 </span> <span class="PreProc">var</span> l/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L175" class="LineNr">175 </span> h, s, l <span class="Special">&lt;-</span> <a href='505colors.mu.html#L5'>hsl</a> <span class="Constant">0</span>, <span class="Constant">0xff</span>, <span class="Constant">0</span>
<span id="L176" class="LineNr">176 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> h, <span class="Constant">0x55</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L171'>test-hsl-extremely-green</a>/hue&quot;</span>
<span id="L177" class="LineNr">177 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> s, <span class="Constant">0xff</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L171'>test-hsl-extremely-green</a>/saturation&quot;</span>
<span id="L178" class="LineNr">178 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> l, <span class="Constant">0x7f</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L171'>test-hsl-extremely-green</a>/luminance&quot;</span> <span class="muComment"># TODO: should round up</span>
<span id="L179" class="LineNr">179 </span><span class="Delimiter">}</span>
<span id="L180" class="LineNr">180 </span>
<span id="L181" class="LineNr">181 </span><span class="muComment"># blue hues: 0xab-0xff</span>
<span id="L182" class="LineNr">182 </span><span class="PreProc">fn</span> <span class="muTest"><a href='505colors.mu.html#L182'>test-hsl-slightly-blue</a></span> <span class="Delimiter">{</span>
<span id="L183" class="LineNr">183 </span> <span class="PreProc">var</span> h/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L184" class="LineNr">184 </span> <span class="PreProc">var</span> s/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L185" class="LineNr">185 </span> <span class="PreProc">var</span> l/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L186" class="LineNr">186 </span> h, s, l <span class="Special">&lt;-</span> <a href='505colors.mu.html#L5'>hsl</a> <span class="Constant">0xfe</span>, <span class="Constant">0xfe</span>, <span class="Constant">0xff</span>
<span id="L187" class="LineNr">187 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> h, <span class="Constant">0xab</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L182'>test-hsl-slightly-blue</a>/hue&quot;</span>
<span id="L188" class="LineNr">188 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> s, <span class="Constant">0xff</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L182'>test-hsl-slightly-blue</a>/saturation&quot;</span>
<span id="L189" class="LineNr">189 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> l, <span class="Constant">0xfe</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L182'>test-hsl-slightly-blue</a>/luminance&quot;</span> <span class="muComment"># TODO: should round up</span>
<span id="L190" class="LineNr">190 </span><span class="Delimiter">}</span>
<span id="L191" class="LineNr">191 </span>
<span id="L192" class="LineNr">192 </span><span class="PreProc">fn</span> <span class="muTest"><a href='505colors.mu.html#L192'>test-hsl-extremely-blue</a></span> <span class="Delimiter">{</span>
<span id="L193" class="LineNr">193 </span> <span class="PreProc">var</span> h/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L194" class="LineNr">194 </span> <span class="PreProc">var</span> s/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L195" class="LineNr">195 </span> <span class="PreProc">var</span> l/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L196" class="LineNr">196 </span> h, s, l <span class="Special">&lt;-</span> <a href='505colors.mu.html#L5'>hsl</a> <span class="Constant">0</span>, <span class="Constant">0</span>, <span class="Constant">0xff</span>
<span id="L197" class="LineNr">197 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> h, <span class="Constant">0xab</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L192'>test-hsl-extremely-blue</a>/hue&quot;</span>
<span id="L198" class="LineNr">198 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> s, <span class="Constant">0xff</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L192'>test-hsl-extremely-blue</a>/saturation&quot;</span>
<span id="L199" class="LineNr">199 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> l, <span class="Constant">0x7f</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L192'>test-hsl-extremely-blue</a>/luminance&quot;</span> <span class="muComment"># TODO: should round up</span>
<span id="L200" class="LineNr">200 </span><span class="Delimiter">}</span>
<span id="L201" class="LineNr">201 </span>
<span id="L202" class="LineNr">202 </span><span class="muComment"># cyan: 0x7f</span>
<span id="L203" class="LineNr">203 </span>
<span id="L204" class="LineNr">204 </span><span class="PreProc">fn</span> <span class="muTest"><a href='505colors.mu.html#L204'>test-hsl-cyan</a></span> <span class="Delimiter">{</span>
<span id="L205" class="LineNr">205 </span> <span class="PreProc">var</span> h/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L206" class="LineNr">206 </span> <span class="PreProc">var</span> s/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L207" class="LineNr">207 </span> <span class="PreProc">var</span> l/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L208" class="LineNr">208 </span> h, s, l <span class="Special">&lt;-</span> <a href='505colors.mu.html#L5'>hsl</a> <span class="Constant">0</span>, <span class="Constant">0xff</span>, <span class="Constant">0xff</span>
<span id="L209" class="LineNr">209 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> h, <span class="Constant">0x80</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L204'>test-hsl-cyan</a>/hue&quot;</span>
<span id="L210" class="LineNr">210 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> s, <span class="Constant">0xff</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L204'>test-hsl-cyan</a>/saturation&quot;</span>
<span id="L211" class="LineNr">211 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> l, <span class="Constant">0x7f</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L204'>test-hsl-cyan</a>/luminance&quot;</span> <span class="muComment"># TODO: should round up</span>
<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="muComment">###</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='505colors.mu.html#L216'>maximum</a></span> a: int, b: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
<span id="L217" class="LineNr">217 </span> <span class="PreProc">var</span> a2/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy a
<span id="L218" class="LineNr">218 </span> compare a2, b
<span id="L219" class="LineNr">219 </span> <span class="Delimiter">{</span>
<span id="L220" class="LineNr">220 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L221" class="LineNr">221 </span> <span class="PreProc">return</span> a
<span id="L222" class="LineNr">222 </span> <span class="Delimiter">}</span>
<span id="L223" class="LineNr">223 </span> <span class="PreProc">return</span> b
<span id="L224" class="LineNr">224 </span><span class="Delimiter">}</span>
<span id="L225" class="LineNr">225 </span>
<span id="L226" class="LineNr">226 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='505colors.mu.html#L226'>minimum</a></span> a: int, b: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
<span id="L227" class="LineNr">227 </span> <span class="PreProc">var</span> a2/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy a
<span id="L228" class="LineNr">228 </span> compare a2, b
<span id="L229" class="LineNr">229 </span> <span class="Delimiter">{</span>
<span id="L230" class="LineNr">230 </span> <span class="PreProc">break-if-&gt;</span>
<span id="L231" class="LineNr">231 </span> <span class="PreProc">return</span> a
<span id="L232" class="LineNr">232 </span> <span class="Delimiter">}</span>
<span id="L233" class="LineNr">233 </span> <span class="PreProc">return</span> b
<span id="L234" class="LineNr">234 </span><span class="Delimiter">}</span>
</pre>
</body>
</html>
<!-- vim: set foldmethod=manual : -->

10
html/boot.subx.html generated
View File

@ -76,9 +76,9 @@ if ('onhashchange' in window) {
<span id="L16" class="LineNr"> 16 </span>
<span id="L17" class="LineNr"> 17 </span><span class="subxComment"># Memory map of a Mu computer:</span>
<span id="L18" class="LineNr"> 18 </span><span class="subxComment"># code: currently 4 tracks loaded from the primary disk to [0x00007c00, 0x00048600)</span>
<span id="L19" class="LineNr"> 19 </span><span class="subxComment"># stack: grows down from 0x00070000</span>
<span id="L20" class="LineNr"> 20 </span><span class="subxComment"># heap: [0x01000000, 0x02000000)</span>
<span id="L21" class="LineNr"> 21 </span><span class="subxComment"># see 120allocate.subx</span>
<span id="L19" class="LineNr"> 19 </span><span class="subxComment"># stack: grows down from 0x02000000 to 0x01000000</span>
<span id="L20" class="LineNr"> 20 </span><span class="subxComment"># heap: [0x02000000, 0x08000000)</span>
<span id="L21" class="LineNr"> 21 </span><span class="subxComment"># see 120allocate.subx; Qemu initializes with 128MB RAM by default</span>
<span id="L22" class="LineNr"> 22 </span><span class="subxComment"># Consult <a href="https://wiki.osdev.org/Memory_Map_(x86)">https://wiki.osdev.org/Memory_Map_(x86)</a> before modifying any of</span>
<span id="L23" class="LineNr"> 23 </span><span class="subxComment"># this. And don't forget to keep *stack-debug.subx in sync.</span>
<span id="L24" class="LineNr"> 24 </span>
@ -101,7 +101,7 @@ if ('onhashchange' in window) {
<span id="L41" class="LineNr"> 41 </span> 8e/-&gt;seg 3/mod/direct 0/rm32/ax 4/r32/fs
<span id="L42" class="LineNr"> 42 </span> 8e/-&gt;seg 3/mod/direct 0/rm32/ax 5/r32/gs
<span id="L43" class="LineNr"> 43 </span>
<span id="L44" class="LineNr"> 44 </span> <span class="subxComment"># initialize stack to 0x00070000</span>
<span id="L44" class="LineNr"> 44 </span> <span class="subxComment"># Temporarily initialize stack to 0x00070000 in real mode.</span>
<span id="L45" class="LineNr"> 45 </span> <span class="subxComment"># We don't read or write the stack before we get to 32-bit mode, but BIOS</span>
<span id="L46" class="LineNr"> 46 </span> <span class="subxComment"># calls do. We need to move the stack in case BIOS initializes it to some</span>
<span id="L47" class="LineNr"> 47 </span> <span class="subxComment"># low address that we want to write code into.</span>
@ -269,7 +269,7 @@ if ('onhashchange' in window) {
<span id="L209" class="LineNr"> 209 </span> 8e/-&gt;seg 3/mod/direct 0/rm32/ax 4/r32/fs
<span id="L210" class="LineNr"> 210 </span> 8e/-&gt;seg 3/mod/direct 0/rm32/ax 5/r32/gs
<span id="L211" class="LineNr"> 211 </span>
<span id="L212" class="LineNr"> 212 </span> bc/copy-to-esp 0x00070000/imm32
<span id="L212" class="LineNr"> 212 </span> bc/copy-to-esp 0x02000000/imm32
<span id="L213" class="LineNr"> 213 </span>
<span id="L214" class="LineNr"> 214 </span> <span class="subxComment">## load interrupt handlers</span>
<span id="L215" class="LineNr"> 215 </span> <span class="subxComment"># We can't refer to the label directly because SubX doesn't do the right</span>

298
html/colors.mu.html generated Normal file
View File

@ -0,0 +1,298 @@
<!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 - colors.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="colorscheme" content="minimal-dark">
<style type="text/css">
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #a8a8a8; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #a8a8a8; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.Special { color: #ff6060; }
.LineNr { }
.Constant { color: #008787; }
.CommentedCode { color: #8a8a8a; }
.Delimiter { color: #c000c0; }
.muFunction { color: #af5f00; text-decoration: underline; }
.muComment { color: #005faf; }
-->
</style>
<script type='text/javascript'>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
function JumpToLine()
{
var lineNum;
lineNum = window.location.hash;
lineNum = lineNum.substr(1); /* strip off '#' */
if (lineNum.indexOf('L') == -1) {
lineNum = 'L'+lineNum;
}
var lineElem = document.getElementById(lineNum);
/* Always jump to new location even if the line was hidden inside a fold, or
* we corrected the raw number to a line ID.
*/
if (lineElem) {
lineElem.scrollIntoView(true);
}
return true;
}
if ('onhashchange' in window) {
window.onhashchange = JumpToLine;
}
-->
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/main/colors.mu'>https://github.com/akkartik/mu/blob/main/colors.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># Return colors 'near' a given r/g/b value (expressed in hex)</span>
<span id="L2" class="LineNr"> 2 </span><span class="muComment"># If we did this rigorously we'd need to implement cosines. So we won't.</span>
<span id="L3" class="LineNr"> 3 </span><span class="muComment">#</span>
<span id="L4" class="LineNr"> 4 </span><span class="muComment"># To build:</span>
<span id="L5" class="LineNr"> 5 </span><span class="muComment"># $ ./translate colors.mu</span>
<span id="L6" class="LineNr"> 6 </span><span class="muComment">#</span>
<span id="L7" class="LineNr"> 7 </span><span class="muComment"># Example session:</span>
<span id="L8" class="LineNr"> 8 </span><span class="muComment"># $ qemu-system-i386 code.img</span>
<span id="L9" class="LineNr"> 9 </span><span class="muComment"># Enter 3 hex bytes for r, g, b (lowercase; no 0x prefix) separated by a single space&gt; aa 0 aa</span>
<span id="L10" class="LineNr"> 10 </span><span class="muComment"># 5</span>
<span id="L11" class="LineNr"> 11 </span><span class="muComment"># This means only color 5 in the default palette is similar to #aa00aa.</span>
<span id="L12" class="LineNr"> 12 </span>
<span id="L13" class="LineNr"> 13 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='colors.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> in-storage: (stream byte <span class="Constant">0x10</span>)
<span id="L15" class="LineNr"> 15 </span> <span class="PreProc">var</span> in/<span class="Constant">esi</span>: (addr stream byte) <span class="Special">&lt;-</span> address in-storage
<span id="L16" class="LineNr"> 16 </span> <span class="Delimiter">{</span>
<span id="L17" class="LineNr"> 17 </span> <span class="muComment"># print prompt</span>
<span id="L18" class="LineNr"> 18 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L100'>draw-text-rightward</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;Enter 3 hex bytes for r, g, b (lowercase; no 0x prefix) separated by a single space&gt; &quot;</span>, <span class="Constant">0x10</span>/x, <span class="Constant">0x80</span>/xmax, <span class="Constant">0x28</span>/y, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<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="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>
<span id="L26" class="LineNr"> 26 </span> compare key, <span class="Constant">0</span>
<span id="L27" class="LineNr"> 27 </span> <span class="PreProc">loop-if-=</span>
<span id="L28" class="LineNr"> 28 </span> <span class="PreProc">var</span> key2/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy key
<span id="L29" class="LineNr"> 29 </span> <a href='115write-byte.subx.html#L12'>append-byte</a> in, key2
<span id="L30" class="LineNr"> 30 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> copy key2
<span id="L31" class="LineNr"> 31 </span> <a href='501draw-text.mu.html#L84'>draw-grapheme-at-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, g, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
<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="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>
<span id="L39" class="LineNr"> 39 </span> <span class="PreProc">var</span> c/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L40" class="LineNr"> 40 </span> <span class="muComment"># a, b, c = r, g, b</span>
<span id="L41" class="LineNr"> 41 </span> a, b, c <span class="Special">&lt;-</span> <a href='colors.mu.html#L58'>parse</a> in
<span id="L42" class="LineNr"> 42 </span><span class="CommentedCode">#? set-cursor-position screen, 0x10/x, 0x1a/y</span>
<span id="L43" class="LineNr"> 43 </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="L44" class="LineNr"> 44 </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="L45" class="LineNr"> 45 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen, b, 7/fg, 0/bg</span>
<span id="L46" class="LineNr"> 46 </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="L47" class="LineNr"> 47 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen, c, 7/fg, 0/bg</span>
<span id="L48" class="LineNr"> 48 </span> a, b, c <span class="Special">&lt;-</span> <a href='505colors.mu.html#L5'>hsl</a> a, b, c
<span id="L49" class="LineNr"> 49 </span> <span class="muComment"># return all colors in the same quadrant in h, s and l</span>
<span id="L50" class="LineNr"> 50 </span> <a href='colors.mu.html#L182'>print-nearby-colors</a> <a href='500fake-screen.mu.html#L14'>screen</a>, a, b, c
<span id="L51" class="LineNr"> 51 </span> <span class="muComment">#</span>
<span id="L52" class="LineNr"> 52 </span> <span class="PreProc">loop</span>
<span id="L53" class="LineNr"> 53 </span> <span class="Delimiter">}</span>
<span id="L54" class="LineNr"> 54 </span><span class="Delimiter">}</span>
<span id="L55" class="LineNr"> 55 </span>
<span id="L56" class="LineNr"> 56 </span><span class="muComment"># read exactly 3 words in a single line</span>
<span id="L57" class="LineNr"> 57 </span><span class="muComment"># Each word consists of exactly 1 or 2 hex bytes. No hex prefix.</span>
<span id="L58" class="LineNr"> 58 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='colors.mu.html#L58'>parse</a></span> in: (addr stream byte)<span class="PreProc"> -&gt; </span>_/<span class="Constant">ecx</span>: int, _/<span class="Constant">edx</span>: int, _/<span class="Constant">ebx</span>: int <span class="Delimiter">{</span>
<span id="L59" class="LineNr"> 59 </span> <span class="muComment"># read first byte of r</span>
<span id="L60" class="LineNr"> 60 </span> <span class="PreProc">var</span> tmp/<span class="Constant">eax</span>: byte <span class="Special">&lt;-</span> <a href='112read-byte.subx.html#L13'>read-byte</a> in
<span id="L61" class="LineNr"> 61 </span> <span class="Delimiter">{</span>
<span id="L62" class="LineNr"> 62 </span> <span class="PreProc">var</span> valid?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='118parse-hex-int.subx.html#L701'>hex-digit?</a> tmp
<span id="L63" class="LineNr"> 63 </span> compare valid?, <span class="Constant">0</span>/false
<span id="L64" class="LineNr"> 64 </span> <span class="PreProc">break-if-!=</span>
<span id="L65" class="LineNr"> 65 </span> <a href='501draw-text.mu.html#L481'>abort</a> <span class="Constant">&quot;invalid byte 0 of r&quot;</span>
<span id="L66" class="LineNr"> 66 </span> <span class="Delimiter">}</span>
<span id="L67" class="LineNr"> 67 </span> tmp <span class="Special">&lt;-</span> <a href='colors.mu.html#L169'>fast-hex-digit-value</a> tmp
<span id="L68" class="LineNr"> 68 </span> <span class="PreProc">var</span> r/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy tmp
<span id="L69" class="LineNr"> 69 </span><span class="CommentedCode">#? set-cursor-position 0/screen, 0x10/x, 0x10/y</span>
<span id="L70" class="LineNr"> 70 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, r, 7/fg, 0/bg</span>
<span id="L71" class="LineNr"> 71 </span> <span class="muComment"># read second byte of r</span>
<span id="L72" class="LineNr"> 72 </span> tmp <span class="Special">&lt;-</span> <a href='112read-byte.subx.html#L13'>read-byte</a> in
<span id="L73" class="LineNr"> 73 </span> <span class="Delimiter">{</span>
<span id="L74" class="LineNr"> 74 </span> <span class="Delimiter">{</span>
<span id="L75" class="LineNr"> 75 </span> <span class="PreProc">var</span> valid?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='118parse-hex-int.subx.html#L701'>hex-digit?</a> tmp
<span id="L76" class="LineNr"> 76 </span> compare valid?, <span class="Constant">0</span>/false
<span id="L77" class="LineNr"> 77 </span> <span class="Delimiter">}</span>
<span id="L78" class="LineNr"> 78 </span> <span class="PreProc">break-if-=</span>
<span id="L79" class="LineNr"> 79 </span> r <span class="Special">&lt;-</span> shift-left <span class="Constant">4</span>
<span id="L80" class="LineNr"> 80 </span> tmp <span class="Special">&lt;-</span> <a href='colors.mu.html#L169'>fast-hex-digit-value</a> tmp
<span id="L81" class="LineNr"> 81 </span><span class="CommentedCode">#? {</span>
<span id="L82" class="LineNr"> 82 </span><span class="CommentedCode">#? var foo/eax: int &lt;- copy tmp</span>
<span id="L83" class="LineNr"> 83 </span><span class="CommentedCode">#? set-cursor-position 0/screen, 0x10/x, 0x11/y</span>
<span id="L84" class="LineNr"> 84 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, foo, 7/fg, 0/bg</span>
<span id="L85" class="LineNr"> 85 </span><span class="CommentedCode">#? }</span>
<span id="L86" class="LineNr"> 86 </span> r <span class="Special">&lt;-</span> add tmp
<span id="L87" class="LineNr"> 87 </span><span class="CommentedCode">#? {</span>
<span id="L88" class="LineNr"> 88 </span><span class="CommentedCode">#? set-cursor-position 0/screen, 0x10/x, 0x12/y</span>
<span id="L89" class="LineNr"> 89 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, r, 7/fg, 0/bg</span>
<span id="L90" class="LineNr"> 90 </span><span class="CommentedCode">#? }</span>
<span id="L91" class="LineNr"> 91 </span> tmp <span class="Special">&lt;-</span> <a href='112read-byte.subx.html#L13'>read-byte</a> in <span class="muComment"># skip space</span>
<span id="L92" class="LineNr"> 92 </span> <span class="Delimiter">}</span>
<span id="L93" class="LineNr"> 93 </span> <span class="muComment"># read first byte of g</span>
<span id="L94" class="LineNr"> 94 </span> <span class="PreProc">var</span> tmp/<span class="Constant">eax</span>: byte <span class="Special">&lt;-</span> <a href='112read-byte.subx.html#L13'>read-byte</a> in
<span id="L95" class="LineNr"> 95 </span> <span class="Delimiter">{</span>
<span id="L96" class="LineNr"> 96 </span> <span class="PreProc">var</span> valid?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='118parse-hex-int.subx.html#L701'>hex-digit?</a> tmp
<span id="L97" class="LineNr"> 97 </span> compare valid?, <span class="Constant">0</span>/false
<span id="L98" class="LineNr"> 98 </span> <span class="PreProc">break-if-!=</span>
<span id="L99" class="LineNr"> 99 </span> <a href='501draw-text.mu.html#L481'>abort</a> <span class="Constant">&quot;invalid byte 0 of g&quot;</span>
<span id="L100" class="LineNr">100 </span> <span class="Delimiter">}</span>
<span id="L101" class="LineNr">101 </span> tmp <span class="Special">&lt;-</span> <a href='colors.mu.html#L169'>fast-hex-digit-value</a> tmp
<span id="L102" class="LineNr">102 </span> <span class="PreProc">var</span> g/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy tmp
<span id="L103" class="LineNr">103 </span><span class="CommentedCode">#? set-cursor-position 0/screen, 0x10/x, 0x13/y</span>
<span id="L104" class="LineNr">104 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, g, 7/fg, 0/bg</span>
<span id="L105" class="LineNr">105 </span> <span class="muComment"># read second byte of g</span>
<span id="L106" class="LineNr">106 </span> tmp <span class="Special">&lt;-</span> <a href='112read-byte.subx.html#L13'>read-byte</a> in
<span id="L107" class="LineNr">107 </span> <span class="Delimiter">{</span>
<span id="L108" class="LineNr">108 </span> <span class="Delimiter">{</span>
<span id="L109" class="LineNr">109 </span> <span class="PreProc">var</span> valid?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='118parse-hex-int.subx.html#L701'>hex-digit?</a> tmp
<span id="L110" class="LineNr">110 </span> compare valid?, <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> g <span class="Special">&lt;-</span> shift-left <span class="Constant">4</span>
<span id="L114" class="LineNr">114 </span> tmp <span class="Special">&lt;-</span> <a href='colors.mu.html#L169'>fast-hex-digit-value</a> tmp
<span id="L115" class="LineNr">115 </span><span class="CommentedCode">#? {</span>
<span id="L116" class="LineNr">116 </span><span class="CommentedCode">#? var foo/eax: int &lt;- copy tmp</span>
<span id="L117" class="LineNr">117 </span><span class="CommentedCode">#? set-cursor-position 0/screen, 0x10/x, 0x14/y</span>
<span id="L118" class="LineNr">118 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, foo, 7/fg, 0/bg</span>
<span id="L119" class="LineNr">119 </span><span class="CommentedCode">#? }</span>
<span id="L120" class="LineNr">120 </span> g <span class="Special">&lt;-</span> add tmp
<span id="L121" class="LineNr">121 </span><span class="CommentedCode">#? {</span>
<span id="L122" class="LineNr">122 </span><span class="CommentedCode">#? set-cursor-position 0/screen, 0x10/x, 0x15/y</span>
<span id="L123" class="LineNr">123 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, g, 7/fg, 0/bg</span>
<span id="L124" class="LineNr">124 </span><span class="CommentedCode">#? }</span>
<span id="L125" class="LineNr">125 </span> tmp <span class="Special">&lt;-</span> <a href='112read-byte.subx.html#L13'>read-byte</a> in <span class="muComment"># skip space</span>
<span id="L126" class="LineNr">126 </span> <span class="Delimiter">}</span>
<span id="L127" class="LineNr">127 </span> <span class="muComment"># read first byte of b</span>
<span id="L128" class="LineNr">128 </span> <span class="PreProc">var</span> tmp/<span class="Constant">eax</span>: byte <span class="Special">&lt;-</span> <a href='112read-byte.subx.html#L13'>read-byte</a> in
<span id="L129" class="LineNr">129 </span> <span class="Delimiter">{</span>
<span id="L130" class="LineNr">130 </span> <span class="PreProc">var</span> valid?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='118parse-hex-int.subx.html#L701'>hex-digit?</a> tmp
<span id="L131" class="LineNr">131 </span> compare valid?, <span class="Constant">0</span>/false
<span id="L132" class="LineNr">132 </span> <span class="PreProc">break-if-!=</span>
<span id="L133" class="LineNr">133 </span> <a href='501draw-text.mu.html#L481'>abort</a> <span class="Constant">&quot;invalid byte 0 of b&quot;</span>
<span id="L134" class="LineNr">134 </span> <span class="Delimiter">}</span>
<span id="L135" class="LineNr">135 </span> tmp <span class="Special">&lt;-</span> <a href='colors.mu.html#L169'>fast-hex-digit-value</a> tmp
<span id="L136" class="LineNr">136 </span> <span class="PreProc">var</span> b/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy tmp
<span id="L137" class="LineNr">137 </span><span class="CommentedCode">#? set-cursor-position 0/screen, 0x10/x, 0x16/y</span>
<span id="L138" class="LineNr">138 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, b, 7/fg, 0/bg</span>
<span id="L139" class="LineNr">139 </span> <span class="muComment"># read second byte of b</span>
<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 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> in
<span id="L143" class="LineNr">143 </span> compare done?, <span class="Constant">0</span>/false
<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> tmp <span class="Special">&lt;-</span> <a href='112read-byte.subx.html#L13'>read-byte</a> in
<span id="L147" class="LineNr">147 </span> <span class="Delimiter">{</span>
<span id="L148" class="LineNr">148 </span> <span class="PreProc">var</span> valid?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='118parse-hex-int.subx.html#L701'>hex-digit?</a> tmp
<span id="L149" class="LineNr">149 </span> compare valid?, <span class="Constant">0</span>/false
<span id="L150" class="LineNr">150 </span> <span class="Delimiter">}</span>
<span id="L151" class="LineNr">151 </span> <span class="PreProc">break-if-=</span>
<span id="L152" class="LineNr">152 </span> b <span class="Special">&lt;-</span> shift-left <span class="Constant">4</span>
<span id="L153" class="LineNr">153 </span> tmp <span class="Special">&lt;-</span> <a href='colors.mu.html#L169'>fast-hex-digit-value</a> tmp
<span id="L154" class="LineNr">154 </span><span class="CommentedCode">#? {</span>
<span id="L155" class="LineNr">155 </span><span class="CommentedCode">#? var foo/eax: int &lt;- copy tmp</span>
<span id="L156" class="LineNr">156 </span><span class="CommentedCode">#? set-cursor-position 0/screen, 0x10/x, 0x17/y</span>
<span id="L157" class="LineNr">157 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, foo, 7/fg, 0/bg</span>
<span id="L158" class="LineNr">158 </span><span class="CommentedCode">#? }</span>
<span id="L159" class="LineNr">159 </span> b <span class="Special">&lt;-</span> add tmp
<span id="L160" class="LineNr">160 </span><span class="CommentedCode">#? {</span>
<span id="L161" class="LineNr">161 </span><span class="CommentedCode">#? set-cursor-position 0/screen, 0x10/x, 0x18/y</span>
<span id="L162" class="LineNr">162 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, b, 7/fg, 0/bg</span>
<span id="L163" class="LineNr">163 </span><span class="CommentedCode">#? }</span>
<span id="L164" class="LineNr">164 </span> <span class="Delimiter">}</span>
<span id="L165" class="LineNr">165 </span> <span class="PreProc">return</span> r, g, b
<span id="L166" class="LineNr">166 </span><span class="Delimiter">}</span>
<span id="L167" class="LineNr">167 </span>
<span id="L168" class="LineNr">168 </span><span class="muComment"># no error checking</span>
<span id="L169" class="LineNr">169 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='colors.mu.html#L169'>fast-hex-digit-value</a></span> in: byte<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: byte <span class="Delimiter">{</span>
<span id="L170" class="LineNr">170 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: byte <span class="Special">&lt;-</span> copy in
<span id="L171" class="LineNr">171 </span> compare result, <span class="Constant">0x39</span>
<span id="L172" class="LineNr">172 </span> <span class="Delimiter">{</span>
<span id="L173" class="LineNr">173 </span> <span class="PreProc">break-if-&gt;</span>
<span id="L174" class="LineNr">174 </span> result <span class="Special">&lt;-</span> subtract <span class="Constant">0x30</span>/<span class="Constant">0</span>
<span id="L175" class="LineNr">175 </span> <span class="PreProc">return</span> result
<span id="L176" class="LineNr">176 </span> <span class="Delimiter">}</span>
<span id="L177" class="LineNr">177 </span> result <span class="Special">&lt;-</span> subtract <span class="Constant">0x61</span>/a
<span id="L178" class="LineNr">178 </span> result <span class="Special">&lt;-</span> add <span class="Constant">0xa</span>/<span class="Constant">10</span>
<span id="L179" class="LineNr">179 </span> <span class="PreProc">return</span> result
<span id="L180" class="LineNr">180 </span><span class="Delimiter">}</span>
<span id="L181" class="LineNr">181 </span>
<span id="L182" class="LineNr">182 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='colors.mu.html#L182'>print-nearby-colors</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), h: int, s: int, l: int <span class="Delimiter">{</span>
<span id="L183" class="LineNr">183 </span><span class="CommentedCode">#? set-cursor-position screen, 0x10/x, 0x1c/y</span>
<span id="L184" class="LineNr">184 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen, h, 7/fg, 0/bg</span>
<span id="L185" class="LineNr">185 </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="L186" class="LineNr">186 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen, s, 7/fg, 0/bg</span>
<span id="L187" class="LineNr">187 </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="L188" class="LineNr">188 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen, l, 7/fg, 0/bg</span>
<span id="L189" class="LineNr">189 </span> <span class="muComment"># save just top 2 bits of each, so that we narrow down to 1/64th of the volume</span>
<span id="L190" class="LineNr">190 </span> shift-right h, <span class="Constant">6</span>
<span id="L191" class="LineNr">191 </span> shift-right s, <span class="Constant">6</span>
<span id="L192" class="LineNr">192 </span> shift-right l, <span class="Constant">6</span>
<span id="L193" class="LineNr">193 </span><span class="CommentedCode">#? set-cursor-position screen, 0x10/x, 0x1/y</span>
<span id="L194" class="LineNr">194 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen, h, 7/fg, 0/bg</span>
<span id="L195" class="LineNr">195 </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="L196" class="LineNr">196 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen, s, 7/fg, 0/bg</span>
<span id="L197" class="LineNr">197 </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="L198" class="LineNr">198 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen, l, 7/fg, 0/bg</span>
<span id="L199" class="LineNr">199 </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="L200" class="LineNr">200 </span> <span class="PreProc">var</span> b/<span class="Constant">edx</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> c/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L202" class="LineNr">202 </span> <span class="PreProc">var</span> color/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L203" class="LineNr">203 </span> <span class="PreProc">var</span> y/<span class="Constant">esi</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">2</span>
<span id="L204" class="LineNr">204 </span> <span class="Delimiter">{</span>
<span id="L205" class="LineNr">205 </span> compare color, <span class="Constant">0x100</span>
<span id="L206" class="LineNr">206 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L207" class="LineNr">207 </span> a, b, c <span class="Special">&lt;-</span> <a href='316colors.subx.html#L7'>color-rgb</a> color
<span id="L208" class="LineNr">208 </span> a, b, c <span class="Special">&lt;-</span> <a href='505colors.mu.html#L5'>hsl</a> a, b, c
<span id="L209" class="LineNr">209 </span> a <span class="Special">&lt;-</span> shift-right <span class="Constant">6</span>
<span id="L210" class="LineNr">210 </span> b <span class="Special">&lt;-</span> shift-right <span class="Constant">6</span>
<span id="L211" class="LineNr">211 </span> c <span class="Special">&lt;-</span> shift-right <span class="Constant">6</span>
<span id="L212" class="LineNr">212 </span> <span class="Delimiter">{</span>
<span id="L213" class="LineNr">213 </span> compare a, h
<span id="L214" class="LineNr">214 </span> <span class="PreProc">break-if-!=</span>
<span id="L215" class="LineNr">215 </span> compare b, s
<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="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>
<span id="L227" class="LineNr">227 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen, b, 7/fg, 0/bg</span>
<span id="L228" class="LineNr">228 </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="L229" class="LineNr">229 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen, c, 7/fg, 0/bg</span>
<span id="L230" class="LineNr">230 </span> 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> color <span class="Special">&lt;-</span> increment
<span id="L233" class="LineNr">233 </span> <span class="PreProc">loop</span>
<span id="L234" class="LineNr">234 </span> <span class="Delimiter">}</span>
<span id="L235" class="LineNr">235 </span><span class="Delimiter">}</span>
</pre>
</body>
</html>
<!-- vim: set foldmethod=manual : -->

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

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

251
html/rpn.mu.html generated
View File

@ -82,132 +82,131 @@ if ('onhashchange' in window) {
<span id="L24" class="LineNr"> 24 </span> <span class="Delimiter">{</span>
<span id="L25" class="LineNr"> 25 </span> <span class="muComment"># print prompt</span>
<span id="L26" class="LineNr"> 26 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L100'>draw-text-rightward</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;&gt; &quot;</span>, <span class="Constant">0</span>/x, <span class="Constant">0x80</span>/xmax, y, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L27" class="LineNr"> 27 </span> <a href='500fake-screen.mu.html#L169'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y
<span id="L28" class="LineNr"> 28 </span> <span class="muComment"># read line from keyboard</span>
<span id="L29" class="LineNr"> 29 </span> <a href='106stream.subx.html#L20'>clear-stream</a> in
<span id="L30" class="LineNr"> 30 </span> <span class="Delimiter">{</span>
<span id="L31" class="LineNr"> 31 </span> <a href='500fake-screen.mu.html#L216'>draw-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, space
<span id="L32" class="LineNr"> 32 </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="L33" class="LineNr"> 33 </span> compare key, <span class="Constant">0xa</span>/newline
<span id="L34" class="LineNr"> 34 </span> <span class="PreProc">break-if-=</span>
<span id="L35" class="LineNr"> 35 </span> compare key, <span class="Constant">0</span>
<span id="L36" class="LineNr"> 36 </span> <span class="PreProc">loop-if-=</span>
<span id="L37" class="LineNr"> 37 </span> <span class="PreProc">var</span> key2/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy key
<span id="L38" class="LineNr"> 38 </span> <a href='115write-byte.subx.html#L12'>append-byte</a> in, key2
<span id="L39" class="LineNr"> 39 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> copy key2
<span id="L40" class="LineNr"> 40 </span> <a href='501draw-text.mu.html#L84'>draw-grapheme-at-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, g, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
<span id="L41" class="LineNr"> 41 </span> <a href='501draw-text.mu.html#L16'>move-cursor-right</a> <span class="Constant">0</span>
<span id="L42" class="LineNr"> 42 </span> <span class="PreProc">loop</span>
<span id="L43" class="LineNr"> 43 </span> <span class="Delimiter">}</span>
<span id="L44" class="LineNr"> 44 </span> <span class="muComment"># clear cursor</span>
<span id="L45" class="LineNr"> 45 </span> <a href='501draw-text.mu.html#L84'>draw-grapheme-at-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, space, <span class="Constant">3</span>/fg/never-used, <span class="Constant">0</span>/bg
<span id="L46" class="LineNr"> 46 </span> <span class="muComment"># parse and eval</span>
<span id="L47" class="LineNr"> 47 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='rpn.mu.html#L63'>simplify</a> in
<span id="L48" class="LineNr"> 48 </span> <span class="muComment"># print</span>
<span id="L49" class="LineNr"> 49 </span> y <span class="Special">&lt;-</span> increment
<span id="L50" class="LineNr"> 50 </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="L51" class="LineNr"> 51 </span> <span class="muComment"># newline</span>
<span id="L52" class="LineNr"> 52 </span> y <span class="Special">&lt;-</span> increment
<span id="L53" class="LineNr"> 53 </span> <span class="muComment">#</span>
<span id="L54" class="LineNr"> 54 </span> <span class="PreProc">loop</span>
<span id="L55" class="LineNr"> 55 </span> <span class="Delimiter">}</span>
<span id="L56" class="LineNr"> 56 </span><span class="Delimiter">}</span>
<span id="L57" class="LineNr"> 57 </span>
<span id="L58" class="LineNr"> 58 </span><span class="PreProc">type</span> <a href='rpn.mu.html#L58'>int-stack</a> <span class="Delimiter">{</span>
<span id="L59" class="LineNr"> 59 </span> data: (handle array int)
<span id="L60" class="LineNr"> 60 </span> top: int
<span id="L61" class="LineNr"> 61 </span><span class="Delimiter">}</span>
<span id="L62" class="LineNr"> 62 </span>
<span id="L63" class="LineNr"> 63 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='rpn.mu.html#L63'>simplify</a></span> in: (addr stream byte)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
<span id="L64" class="LineNr"> 64 </span> <span class="PreProc">var</span> word-storage: slice
<span id="L65" class="LineNr"> 65 </span> <span class="PreProc">var</span> word/<span class="Constant">ecx</span>: (addr slice) <span class="Special">&lt;-</span> address word-storage
<span id="L66" class="LineNr"> 66 </span> <span class="PreProc">var</span> stack-storage: <a href='rpn.mu.html#L58'>int-stack</a>
<span id="L67" class="LineNr"> 67 </span> <span class="PreProc">var</span> stack/<span class="Constant">esi</span>: (addr <a href='rpn.mu.html#L58'>int-stack</a>) <span class="Special">&lt;-</span> address stack-storage
<span id="L68" class="LineNr"> 68 </span> <a href='rpn.mu.html#L117'>initialize-int-stack</a> stack, <span class="Constant">0x10</span>
<span id="L69" class="LineNr"> 69 </span> $simplify:word-loop: <span class="Delimiter">{</span>
<span id="L70" class="LineNr"> 70 </span> <a href='127next-word.subx.html#L11'>next-word</a> in, word
<span id="L71" class="LineNr"> 71 </span> <span class="PreProc">var</span> done?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='123slice.subx.html#L9'>slice-empty?</a> word
<span id="L72" class="LineNr"> 72 </span> compare done?, <span class="Constant">0</span>
<span id="L73" class="LineNr"> 73 </span> <span class="PreProc">break-if-!=</span>
<span id="L74" class="LineNr"> 74 </span> <span class="muComment"># if word is an operator, perform it</span>
<span id="L75" class="LineNr"> 75 </span> <span class="Delimiter">{</span>
<span id="L76" class="LineNr"> 76 </span> <span class="PreProc">var</span> is-add?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='123slice.subx.html#L120'>slice-equal?</a> word, <span class="Constant">&quot;+&quot;</span>
<span id="L77" class="LineNr"> 77 </span> compare is-add?, <span class="Constant">0</span>
<span id="L78" class="LineNr"> 78 </span> <span class="PreProc">break-if-=</span>
<span id="L79" class="LineNr"> 79 </span> <span class="PreProc">var</span> _b/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='rpn.mu.html#L137'>pop-int-stack</a> stack
<span id="L80" class="LineNr"> 80 </span> <span class="PreProc">var</span> b/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy _b
<span id="L81" class="LineNr"> 81 </span> <span class="PreProc">var</span> a/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='rpn.mu.html#L137'>pop-int-stack</a> stack
<span id="L82" class="LineNr"> 82 </span> a <span class="Special">&lt;-</span> add b
<span id="L83" class="LineNr"> 83 </span> <a href='rpn.mu.html#L125'>push-int-stack</a> stack, a
<span id="L84" class="LineNr"> 84 </span> <span class="PreProc">loop</span> $simplify:word-loop
<span id="L85" class="LineNr"> 85 </span> <span class="Delimiter">}</span>
<span id="L86" class="LineNr"> 86 </span> <span class="Delimiter">{</span>
<span id="L87" class="LineNr"> 87 </span> <span class="PreProc">var</span> is-sub?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='123slice.subx.html#L120'>slice-equal?</a> word, <span class="Constant">&quot;-&quot;</span>
<span id="L88" class="LineNr"> 88 </span> compare is-sub?, <span class="Constant">0</span>
<span id="L89" class="LineNr"> 89 </span> <span class="PreProc">break-if-=</span>
<span id="L90" class="LineNr"> 90 </span> <span class="PreProc">var</span> _b/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='rpn.mu.html#L137'>pop-int-stack</a> stack
<span id="L91" class="LineNr"> 91 </span> <span class="PreProc">var</span> b/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy _b
<span id="L92" class="LineNr"> 92 </span> <span class="PreProc">var</span> a/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='rpn.mu.html#L137'>pop-int-stack</a> stack
<span id="L93" class="LineNr"> 93 </span> a <span class="Special">&lt;-</span> subtract b
<span id="L94" class="LineNr"> 94 </span> <a href='rpn.mu.html#L125'>push-int-stack</a> stack, a
<span id="L95" class="LineNr"> 95 </span> <span class="PreProc">loop</span> $simplify:word-loop
<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> is-mul?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='123slice.subx.html#L120'>slice-equal?</a> word, <span class="Constant">&quot;*&quot;</span>
<span id="L99" class="LineNr"> 99 </span> compare is-mul?, <span class="Constant">0</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> _b/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='rpn.mu.html#L137'>pop-int-stack</a> stack
<span id="L102" class="LineNr">102 </span> <span class="PreProc">var</span> b/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy _b
<span id="L103" class="LineNr">103 </span> <span class="PreProc">var</span> a/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='rpn.mu.html#L137'>pop-int-stack</a> stack
<span id="L104" class="LineNr">104 </span> a <span class="Special">&lt;-</span> multiply b
<span id="L105" class="LineNr">105 </span> <a href='rpn.mu.html#L125'>push-int-stack</a> stack, a
<span id="L106" class="LineNr">106 </span> <span class="PreProc">loop</span> $simplify:word-loop
<span id="L107" class="LineNr">107 </span> <span class="Delimiter">}</span>
<span id="L108" class="LineNr">108 </span> <span class="muComment"># otherwise it's an int</span>
<span id="L109" class="LineNr">109 </span> <span class="PreProc">var</span> n/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='311decimal-int.subx.html#L4'>parse-decimal-int-from-slice</a> word
<span id="L110" class="LineNr">110 </span> <a href='rpn.mu.html#L125'>push-int-stack</a> stack, n
<span id="L111" class="LineNr">111 </span> <span class="PreProc">loop</span>
<span id="L112" class="LineNr">112 </span> <span class="Delimiter">}</span>
<span id="L113" class="LineNr">113 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='rpn.mu.html#L137'>pop-int-stack</a> stack
<span id="L114" class="LineNr">114 </span> <span class="PreProc">return</span> result
<span id="L115" class="LineNr">115 </span><span class="Delimiter">}</span>
<span id="L116" class="LineNr">116 </span>
<span id="L117" class="LineNr">117 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='rpn.mu.html#L117'>initialize-int-stack</a></span> _self: (addr <a href='rpn.mu.html#L58'>int-stack</a>), n: int <span class="Delimiter">{</span>
<span id="L118" class="LineNr">118 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='rpn.mu.html#L58'>int-stack</a>) <span class="Special">&lt;-</span> copy _self
<span id="L119" class="LineNr">119 </span> <span class="PreProc">var</span> d/<span class="Constant">edi</span>: (addr handle array int) <span class="Special">&lt;-</span> get self, data
<span id="L120" class="LineNr">120 </span> populate d, n
<span id="L121" class="LineNr">121 </span> <span class="PreProc">var</span> top/<span class="Constant">eax</span>: (addr int) <span class="Special">&lt;-</span> get self, top
<span id="L122" class="LineNr">122 </span> copy-to *top, <span class="Constant">0</span>
<span id="L123" class="LineNr">123 </span><span class="Delimiter">}</span>
<span id="L124" class="LineNr">124 </span>
<span id="L125" class="LineNr">125 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='rpn.mu.html#L125'>push-int-stack</a></span> _self: (addr <a href='rpn.mu.html#L58'>int-stack</a>), _val: int <span class="Delimiter">{</span>
<span id="L126" class="LineNr">126 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='rpn.mu.html#L58'>int-stack</a>) <span class="Special">&lt;-</span> copy _self
<span id="L127" class="LineNr">127 </span> <span class="PreProc">var</span> top-addr/<span class="Constant">ecx</span>: (addr int) <span class="Special">&lt;-</span> get self, top
<span id="L128" class="LineNr">128 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">edx</span>: (addr handle array int) <span class="Special">&lt;-</span> get self, data
<span id="L129" class="LineNr">129 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array int) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L130" class="LineNr">130 </span> <span class="PreProc">var</span> top/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy *top-addr
<span id="L131" class="LineNr">131 </span> <span class="PreProc">var</span> dest-addr/<span class="Constant">edx</span>: (addr int) <span class="Special">&lt;-</span> index data, top
<span id="L132" class="LineNr">132 </span> <span class="PreProc">var</span> val/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy _val
<span id="L133" class="LineNr">133 </span> copy-to *dest-addr, val
<span id="L134" class="LineNr">134 </span> add-to *top-addr, <span class="Constant">1</span>
<span id="L135" class="LineNr">135 </span><span class="Delimiter">}</span>
<span id="L136" class="LineNr">136 </span>
<span id="L137" class="LineNr">137 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='rpn.mu.html#L137'>pop-int-stack</a></span> _self: (addr <a href='rpn.mu.html#L58'>int-stack</a>)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
<span id="L138" class="LineNr">138 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='rpn.mu.html#L58'>int-stack</a>) <span class="Special">&lt;-</span> copy _self
<span id="L139" class="LineNr">139 </span> <span class="PreProc">var</span> top-addr/<span class="Constant">ecx</span>: (addr int) <span class="Special">&lt;-</span> get self, top
<span id="L140" class="LineNr">140 </span> <span class="Delimiter">{</span>
<span id="L141" class="LineNr">141 </span> compare *top-addr, <span class="Constant">0</span>
<span id="L142" class="LineNr">142 </span> <span class="PreProc">break-if-&gt;</span>
<span id="L143" class="LineNr">143 </span> <span class="PreProc">return</span> <span class="Constant">0</span>
<span id="L144" class="LineNr">144 </span> <span class="Delimiter">}</span>
<span id="L145" class="LineNr">145 </span> subtract-from *top-addr, <span class="Constant">1</span>
<span id="L146" class="LineNr">146 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">edx</span>: (addr handle array int) <span class="Special">&lt;-</span> get self, data
<span id="L147" class="LineNr">147 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array int) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L148" class="LineNr">148 </span> <span class="PreProc">var</span> top/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy *top-addr
<span id="L149" class="LineNr">149 </span> <span class="PreProc">var</span> result-addr/<span class="Constant">eax</span>: (addr int) <span class="Special">&lt;-</span> index data, top
<span id="L150" class="LineNr">150 </span> <span class="PreProc">var</span> val/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy *result-addr
<span id="L151" class="LineNr">151 </span> <span class="PreProc">return</span> val
<span id="L152" class="LineNr">152 </span><span class="Delimiter">}</span>
<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="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>
<span id="L34" class="LineNr"> 34 </span> compare key, <span class="Constant">0</span>
<span id="L35" class="LineNr"> 35 </span> <span class="PreProc">loop-if-=</span>
<span id="L36" class="LineNr"> 36 </span> <span class="PreProc">var</span> key2/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy key
<span id="L37" class="LineNr"> 37 </span> <a href='115write-byte.subx.html#L12'>append-byte</a> in, key2
<span id="L38" class="LineNr"> 38 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> copy key2
<span id="L39" class="LineNr"> 39 </span> <a href='501draw-text.mu.html#L84'>draw-grapheme-at-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, g, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
<span id="L40" class="LineNr"> 40 </span> <a href='501draw-text.mu.html#L16'>move-cursor-right</a> <span class="Constant">0</span>
<span id="L41" class="LineNr"> 41 </span> <span class="PreProc">loop</span>
<span id="L42" class="LineNr"> 42 </span> <span class="Delimiter">}</span>
<span id="L43" class="LineNr"> 43 </span> <span class="muComment"># clear cursor</span>
<span id="L44" class="LineNr"> 44 </span> <a href='501draw-text.mu.html#L84'>draw-grapheme-at-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, space, <span class="Constant">3</span>/fg/never-used, <span class="Constant">0</span>/bg
<span id="L45" class="LineNr"> 45 </span> <span class="muComment"># parse and eval</span>
<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="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>
<span id="L53" class="LineNr"> 53 </span> <span class="PreProc">loop</span>
<span id="L54" class="LineNr"> 54 </span> <span class="Delimiter">}</span>
<span id="L55" class="LineNr"> 55 </span><span class="Delimiter">}</span>
<span id="L56" class="LineNr"> 56 </span>
<span id="L57" class="LineNr"> 57 </span><span class="PreProc">type</span> <a href='rpn.mu.html#L57'>int-stack</a> <span class="Delimiter">{</span>
<span id="L58" class="LineNr"> 58 </span> data: (handle array int)
<span id="L59" class="LineNr"> 59 </span> top: int
<span id="L60" class="LineNr"> 60 </span><span class="Delimiter">}</span>
<span id="L61" class="LineNr"> 61 </span>
<span id="L62" class="LineNr"> 62 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='rpn.mu.html#L62'>simplify</a></span> in: (addr stream byte)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
<span id="L63" class="LineNr"> 63 </span> <span class="PreProc">var</span> word-storage: slice
<span id="L64" class="LineNr"> 64 </span> <span class="PreProc">var</span> word/<span class="Constant">ecx</span>: (addr slice) <span class="Special">&lt;-</span> address word-storage
<span id="L65" class="LineNr"> 65 </span> <span class="PreProc">var</span> stack-storage: <a href='rpn.mu.html#L57'>int-stack</a>
<span id="L66" class="LineNr"> 66 </span> <span class="PreProc">var</span> stack/<span class="Constant">esi</span>: (addr <a href='rpn.mu.html#L57'>int-stack</a>) <span class="Special">&lt;-</span> address stack-storage
<span id="L67" class="LineNr"> 67 </span> <a href='rpn.mu.html#L116'>initialize-int-stack</a> stack, <span class="Constant">0x10</span>
<span id="L68" class="LineNr"> 68 </span> $simplify:word-loop: <span class="Delimiter">{</span>
<span id="L69" class="LineNr"> 69 </span> <a href='127next-word.subx.html#L11'>next-word</a> in, word
<span id="L70" class="LineNr"> 70 </span> <span class="PreProc">var</span> done?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='123slice.subx.html#L9'>slice-empty?</a> word
<span id="L71" class="LineNr"> 71 </span> compare done?, <span class="Constant">0</span>
<span id="L72" class="LineNr"> 72 </span> <span class="PreProc">break-if-!=</span>
<span id="L73" class="LineNr"> 73 </span> <span class="muComment"># if word is an operator, perform it</span>
<span id="L74" class="LineNr"> 74 </span> <span class="Delimiter">{</span>
<span id="L75" class="LineNr"> 75 </span> <span class="PreProc">var</span> is-add?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='123slice.subx.html#L120'>slice-equal?</a> word, <span class="Constant">&quot;+&quot;</span>
<span id="L76" class="LineNr"> 76 </span> compare is-add?, <span class="Constant">0</span>
<span id="L77" class="LineNr"> 77 </span> <span class="PreProc">break-if-=</span>
<span id="L78" class="LineNr"> 78 </span> <span class="PreProc">var</span> _b/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='rpn.mu.html#L136'>pop-int-stack</a> stack
<span id="L79" class="LineNr"> 79 </span> <span class="PreProc">var</span> b/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy _b
<span id="L80" class="LineNr"> 80 </span> <span class="PreProc">var</span> a/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='rpn.mu.html#L136'>pop-int-stack</a> stack
<span id="L81" class="LineNr"> 81 </span> a <span class="Special">&lt;-</span> add b
<span id="L82" class="LineNr"> 82 </span> <a href='rpn.mu.html#L124'>push-int-stack</a> stack, a
<span id="L83" class="LineNr"> 83 </span> <span class="PreProc">loop</span> $simplify:word-loop
<span id="L84" class="LineNr"> 84 </span> <span class="Delimiter">}</span>
<span id="L85" class="LineNr"> 85 </span> <span class="Delimiter">{</span>
<span id="L86" class="LineNr"> 86 </span> <span class="PreProc">var</span> is-sub?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='123slice.subx.html#L120'>slice-equal?</a> word, <span class="Constant">&quot;-&quot;</span>
<span id="L87" class="LineNr"> 87 </span> compare is-sub?, <span class="Constant">0</span>
<span id="L88" class="LineNr"> 88 </span> <span class="PreProc">break-if-=</span>
<span id="L89" class="LineNr"> 89 </span> <span class="PreProc">var</span> _b/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='rpn.mu.html#L136'>pop-int-stack</a> stack
<span id="L90" class="LineNr"> 90 </span> <span class="PreProc">var</span> b/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy _b
<span id="L91" class="LineNr"> 91 </span> <span class="PreProc">var</span> a/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='rpn.mu.html#L136'>pop-int-stack</a> stack
<span id="L92" class="LineNr"> 92 </span> a <span class="Special">&lt;-</span> subtract b
<span id="L93" class="LineNr"> 93 </span> <a href='rpn.mu.html#L124'>push-int-stack</a> stack, a
<span id="L94" class="LineNr"> 94 </span> <span class="PreProc">loop</span> $simplify:word-loop
<span id="L95" class="LineNr"> 95 </span> <span class="Delimiter">}</span>
<span id="L96" class="LineNr"> 96 </span> <span class="Delimiter">{</span>
<span id="L97" class="LineNr"> 97 </span> <span class="PreProc">var</span> is-mul?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='123slice.subx.html#L120'>slice-equal?</a> word, <span class="Constant">&quot;*&quot;</span>
<span id="L98" class="LineNr"> 98 </span> compare is-mul?, <span class="Constant">0</span>
<span id="L99" class="LineNr"> 99 </span> <span class="PreProc">break-if-=</span>
<span id="L100" class="LineNr">100 </span> <span class="PreProc">var</span> _b/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='rpn.mu.html#L136'>pop-int-stack</a> stack
<span id="L101" class="LineNr">101 </span> <span class="PreProc">var</span> b/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy _b
<span id="L102" class="LineNr">102 </span> <span class="PreProc">var</span> a/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='rpn.mu.html#L136'>pop-int-stack</a> stack
<span id="L103" class="LineNr">103 </span> a <span class="Special">&lt;-</span> multiply b
<span id="L104" class="LineNr">104 </span> <a href='rpn.mu.html#L124'>push-int-stack</a> stack, a
<span id="L105" class="LineNr">105 </span> <span class="PreProc">loop</span> $simplify:word-loop
<span id="L106" class="LineNr">106 </span> <span class="Delimiter">}</span>
<span id="L107" class="LineNr">107 </span> <span class="muComment"># otherwise it's an int</span>
<span id="L108" class="LineNr">108 </span> <span class="PreProc">var</span> n/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='311decimal-int.subx.html#L4'>parse-decimal-int-from-slice</a> word
<span id="L109" class="LineNr">109 </span> <a href='rpn.mu.html#L124'>push-int-stack</a> stack, n
<span id="L110" class="LineNr">110 </span> <span class="PreProc">loop</span>
<span id="L111" class="LineNr">111 </span> <span class="Delimiter">}</span>
<span id="L112" class="LineNr">112 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='rpn.mu.html#L136'>pop-int-stack</a> stack
<span id="L113" class="LineNr">113 </span> <span class="PreProc">return</span> result
<span id="L114" class="LineNr">114 </span><span class="Delimiter">}</span>
<span id="L115" class="LineNr">115 </span>
<span id="L116" class="LineNr">116 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='rpn.mu.html#L116'>initialize-int-stack</a></span> _self: (addr <a href='rpn.mu.html#L57'>int-stack</a>), n: int <span class="Delimiter">{</span>
<span id="L117" class="LineNr">117 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='rpn.mu.html#L57'>int-stack</a>) <span class="Special">&lt;-</span> copy _self
<span id="L118" class="LineNr">118 </span> <span class="PreProc">var</span> d/<span class="Constant">edi</span>: (addr handle array int) <span class="Special">&lt;-</span> get self, data
<span id="L119" class="LineNr">119 </span> populate d, n
<span id="L120" class="LineNr">120 </span> <span class="PreProc">var</span> top/<span class="Constant">eax</span>: (addr int) <span class="Special">&lt;-</span> get self, top
<span id="L121" class="LineNr">121 </span> copy-to *top, <span class="Constant">0</span>
<span id="L122" class="LineNr">122 </span><span class="Delimiter">}</span>
<span id="L123" class="LineNr">123 </span>
<span id="L124" class="LineNr">124 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='rpn.mu.html#L124'>push-int-stack</a></span> _self: (addr <a href='rpn.mu.html#L57'>int-stack</a>), _val: int <span class="Delimiter">{</span>
<span id="L125" class="LineNr">125 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='rpn.mu.html#L57'>int-stack</a>) <span class="Special">&lt;-</span> copy _self
<span id="L126" class="LineNr">126 </span> <span class="PreProc">var</span> top-addr/<span class="Constant">ecx</span>: (addr int) <span class="Special">&lt;-</span> get self, top
<span id="L127" class="LineNr">127 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">edx</span>: (addr handle array int) <span class="Special">&lt;-</span> get self, data
<span id="L128" class="LineNr">128 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array int) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L129" class="LineNr">129 </span> <span class="PreProc">var</span> top/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy *top-addr
<span id="L130" class="LineNr">130 </span> <span class="PreProc">var</span> dest-addr/<span class="Constant">edx</span>: (addr int) <span class="Special">&lt;-</span> index data, top
<span id="L131" class="LineNr">131 </span> <span class="PreProc">var</span> val/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy _val
<span id="L132" class="LineNr">132 </span> copy-to *dest-addr, val
<span id="L133" class="LineNr">133 </span> add-to *top-addr, <span class="Constant">1</span>
<span id="L134" class="LineNr">134 </span><span class="Delimiter">}</span>
<span id="L135" class="LineNr">135 </span>
<span id="L136" class="LineNr">136 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='rpn.mu.html#L136'>pop-int-stack</a></span> _self: (addr <a href='rpn.mu.html#L57'>int-stack</a>)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
<span id="L137" class="LineNr">137 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='rpn.mu.html#L57'>int-stack</a>) <span class="Special">&lt;-</span> copy _self
<span id="L138" class="LineNr">138 </span> <span class="PreProc">var</span> top-addr/<span class="Constant">ecx</span>: (addr int) <span class="Special">&lt;-</span> get self, top
<span id="L139" class="LineNr">139 </span> <span class="Delimiter">{</span>
<span id="L140" class="LineNr">140 </span> compare *top-addr, <span class="Constant">0</span>
<span id="L141" class="LineNr">141 </span> <span class="PreProc">break-if-&gt;</span>
<span id="L142" class="LineNr">142 </span> <span class="PreProc">return</span> <span class="Constant">0</span>
<span id="L143" class="LineNr">143 </span> <span class="Delimiter">}</span>
<span id="L144" class="LineNr">144 </span> subtract-from *top-addr, <span class="Constant">1</span>
<span id="L145" class="LineNr">145 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">edx</span>: (addr handle array int) <span class="Special">&lt;-</span> get self, data
<span id="L146" class="LineNr">146 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array int) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L147" class="LineNr">147 </span> <span class="PreProc">var</span> top/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy *top-addr
<span id="L148" class="LineNr">148 </span> <span class="PreProc">var</span> result-addr/<span class="Constant">eax</span>: (addr int) <span class="Special">&lt;-</span> index data, top
<span id="L149" class="LineNr">149 </span> <span class="PreProc">var</span> val/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy *result-addr
<span id="L150" class="LineNr">150 </span> <span class="PreProc">return</span> val
<span id="L151" class="LineNr">151 </span><span class="Delimiter">}</span>
</pre>
</body>
</html>

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

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

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

3685
html/shell/global.mu.html generated

File diff suppressed because it is too large Load Diff

View File

@ -141,468 +141,478 @@ if ('onhashchange' in window) {
<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="muComment"># dump stack to screen from bottom to top</span>
<span id="L85" class="LineNr"> 85 </span><span class="muComment"># colors hardcoded</span>
<span id="L86" class="LineNr"> 86 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='grapheme-stack.mu.html#L86'>render-stack-from-bottom-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>), _self: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>), xmin: int, ymin: int, xmax: int, ymax: int, _x: int, _y: int, <a href='gap-buffer.mu.html#L668'>highlight-matching-open-paren?</a>: boolean, open-paren-depth: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
<span id="L87" class="LineNr"> 87 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special">&lt;-</span> copy _self
<span id="L88" class="LineNr"> 88 </span> <span class="PreProc">var</span> matching-open-paren-index/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> <a href='grapheme-stack.mu.html#L424'>get-matching-open-paren-index</a> self, <a href='gap-buffer.mu.html#L668'>highlight-matching-open-paren?</a>, open-paren-depth
<span id="L89" class="LineNr"> 89 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">edi</span>: (addr handle array grapheme) <span class="Special">&lt;-</span> get self, data
<span id="L90" class="LineNr"> 90 </span> <span class="PreProc">var</span> _data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L91" class="LineNr"> 91 </span> <span class="PreProc">var</span> data/<span class="Constant">edi</span>: (addr array grapheme) <span class="Special">&lt;-</span> copy _data
<span id="L92" class="LineNr"> 92 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy _x
<span id="L93" class="LineNr"> 93 </span> <span class="PreProc">var</span> y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy _y
<span id="L94" class="LineNr"> 94 </span> <span class="PreProc">var</span> top-addr/<span class="Constant">esi</span>: (addr int) <span class="Special">&lt;-</span> get self, top
<span id="L95" class="LineNr"> 95 </span> <span class="PreProc">var</span> i/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L96" class="LineNr"> 96 </span> <span class="Delimiter">{</span>
<span id="L97" class="LineNr"> 97 </span> compare i, *top-addr
<span id="L98" class="LineNr"> 98 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L99" class="LineNr"> 99 </span> <span class="Delimiter">{</span>
<span id="L100" class="LineNr">100 </span> <span class="PreProc">var</span> g/<span class="Constant">esi</span>: (addr grapheme) <span class="Special">&lt;-</span> index data, i
<span id="L101" class="LineNr">101 </span> <span class="PreProc">var</span> fg: int
<span id="L102" class="LineNr">102 </span> copy-to fg, <span class="Constant">3</span>/cyan
<span id="L85" class="LineNr"> 85 </span><span class="muComment"># hardcoded colors:</span>
<span id="L86" class="LineNr"> 86 </span><span class="muComment"># matching paren</span>
<span id="L87" class="LineNr"> 87 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='grapheme-stack.mu.html#L87'>render-stack-from-bottom-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>), _self: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>), xmin: int, ymin: int, xmax: int, ymax: int, _x: int, _y: int, <a href='gap-buffer.mu.html#L677'>highlight-matching-open-paren?</a>: boolean, open-paren-depth: 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="L88" class="LineNr"> 88 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special">&lt;-</span> copy _self
<span id="L89" class="LineNr"> 89 </span> <span class="PreProc">var</span> matching-open-paren-index/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> <a href='grapheme-stack.mu.html#L434'>get-matching-open-paren-index</a> self, <a href='gap-buffer.mu.html#L677'>highlight-matching-open-paren?</a>, open-paren-depth
<span id="L90" class="LineNr"> 90 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">edi</span>: (addr handle array grapheme) <span class="Special">&lt;-</span> get self, data
<span id="L91" class="LineNr"> 91 </span> <span class="PreProc">var</span> _data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L92" class="LineNr"> 92 </span> <span class="PreProc">var</span> data/<span class="Constant">edi</span>: (addr array grapheme) <span class="Special">&lt;-</span> copy _data
<span id="L93" class="LineNr"> 93 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy _x
<span id="L94" class="LineNr"> 94 </span> <span class="PreProc">var</span> y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy _y
<span id="L95" class="LineNr"> 95 </span> <span class="PreProc">var</span> top-addr/<span class="Constant">esi</span>: (addr int) <span class="Special">&lt;-</span> get self, top
<span id="L96" class="LineNr"> 96 </span> <span class="PreProc">var</span> i/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L97" class="LineNr"> 97 </span> <span class="Delimiter">{</span>
<span id="L98" class="LineNr"> 98 </span> compare i, *top-addr
<span id="L99" class="LineNr"> 99 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L100" class="LineNr">100 </span> <span class="Delimiter">{</span>
<span id="L101" class="LineNr">101 </span> <span class="PreProc">var</span> g/<span class="Constant">esi</span>: (addr grapheme) <span class="Special">&lt;-</span> index data, i
<span id="L102" class="LineNr">102 </span> <span class="PreProc">var</span> fg: int
<span id="L103" class="LineNr">103 </span> <span class="Delimiter">{</span>
<span id="L104" class="LineNr">104 </span> compare i, matching-open-paren-index
<span id="L105" class="LineNr">105 </span> <span class="PreProc">break-if-!=</span>
<span id="L106" class="LineNr">106 </span> copy-to fg, <span class="Constant">0xf</span>/highlight
<span id="L107" class="LineNr">107 </span> <span class="Delimiter">}</span>
<span id="L108" class="LineNr">108 </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, <span class="Constant">0</span>/bg
<span id="L109" class="LineNr">109 </span> <span class="Delimiter">}</span>
<span id="L110" class="LineNr">110 </span> i <span class="Special">&lt;-</span> increment
<span id="L111" class="LineNr">111 </span> <span class="PreProc">loop</span>
<span id="L112" class="LineNr">112 </span> <span class="Delimiter">}</span>
<span id="L113" class="LineNr">113 </span> <span class="PreProc">return</span> x, y
<span id="L114" class="LineNr">114 </span><span class="Delimiter">}</span>
<span id="L115" class="LineNr">115 </span>
<span id="L116" class="LineNr">116 </span><span class="muComment"># helper for small words</span>
<span id="L117" class="LineNr">117 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='grapheme-stack.mu.html#L117'>render-stack-from-bottom</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='grapheme-stack.mu.html#L3'>grapheme-stack</a>), x: int, y: int, <a href='gap-buffer.mu.html#L668'>highlight-matching-open-paren?</a>: boolean, open-paren-depth: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
<span id="L118" class="LineNr">118 </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="L119" class="LineNr">119 </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="L120" class="LineNr">120 </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="L121" class="LineNr">121 </span> <span class="PreProc">var</span> width/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy _width
<span id="L122" class="LineNr">122 </span> <span class="PreProc">var</span> height/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy _height
<span id="L123" class="LineNr">123 </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="L124" class="LineNr">124 </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="L125" class="LineNr">125 </span> x2, y2 <span class="Special">&lt;-</span> <a href='grapheme-stack.mu.html#L86'>render-stack-from-bottom-wrapping-right-then-down</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, self, x, y, width, height, x, y, <a href='gap-buffer.mu.html#L668'>highlight-matching-open-paren?</a>, open-paren-depth
<span id="L126" class="LineNr">126 </span> <span class="PreProc">return</span> x2 <span class="muComment"># y2? yolo</span>
<span id="L127" class="LineNr">127 </span><span class="Delimiter">}</span>
<span id="L128" class="LineNr">128 </span>
<span id="L129" class="LineNr">129 </span><span class="muComment"># dump stack to screen from top to bottom</span>
<span id="L130" class="LineNr">130 </span><span class="muComment"># optionally render a 'cursor' with the top grapheme</span>
<span id="L131" class="LineNr">131 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='grapheme-stack.mu.html#L131'>render-stack-from-top-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>), _self: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>), xmin: int, ymin: int, xmax: int, ymax: int, _x: int, _y: int, render-cursor?: boolean<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
<span id="L132" class="LineNr">132 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special">&lt;-</span> copy _self
<span id="L133" class="LineNr">133 </span> <span class="PreProc">var</span> matching-close-paren-index/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> <a href='grapheme-stack.mu.html#L368'>get-matching-close-paren-index</a> self, render-cursor?
<span id="L134" class="LineNr">134 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">eax</span>: (addr handle array grapheme) <span class="Special">&lt;-</span> get self, data
<span id="L135" class="LineNr">135 </span> <span class="PreProc">var</span> _data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L136" class="LineNr">136 </span> <span class="PreProc">var</span> data/<span class="Constant">edi</span>: (addr array grapheme) <span class="Special">&lt;-</span> copy _data
<span id="L137" class="LineNr">137 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy _x
<span id="L138" class="LineNr">138 </span> <span class="PreProc">var</span> y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy _y
<span id="L139" class="LineNr">139 </span> <span class="PreProc">var</span> top-addr/<span class="Constant">ebx</span>: (addr int) <span class="Special">&lt;-</span> get self, top
<span id="L140" class="LineNr">140 </span> <span class="PreProc">var</span> i/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy *top-addr
<span id="L141" class="LineNr">141 </span> i <span class="Special">&lt;-</span> decrement
<span id="L142" class="LineNr">142 </span> <span class="muComment"># if render-cursor?, peel off first iteration</span>
<span id="L143" class="LineNr">143 </span> <span class="Delimiter">{</span>
<span id="L144" class="LineNr">144 </span> compare render-cursor?, <span class="Constant">0</span>/false
<span id="L145" class="LineNr">145 </span> <span class="PreProc">break-if-=</span>
<span id="L146" class="LineNr">146 </span> compare i, <span class="Constant">0</span>
<span id="L147" class="LineNr">147 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L148" class="LineNr">148 </span> <span class="PreProc">var</span> g/<span class="Constant">esi</span>: (addr grapheme) <span class="Special">&lt;-</span> index data, i
<span id="L149" class="LineNr">149 </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, <span class="Constant">3</span>/fg=cyan, <span class="Constant">7</span>/bg=cursor
<span id="L150" class="LineNr">150 </span> i <span class="Special">&lt;-</span> decrement
<span id="L151" class="LineNr">151 </span> <span class="Delimiter">}</span>
<span id="L152" class="LineNr">152 </span> <span class="muComment"># remaining iterations</span>
<span id="L153" class="LineNr">153 </span> <span class="Delimiter">{</span>
<span id="L154" class="LineNr">154 </span> compare i, <span class="Constant">0</span>
<span id="L155" class="LineNr">155 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L156" class="LineNr">156 </span> <span class="muComment"># highlight matching paren if needed</span>
<span id="L157" class="LineNr">157 </span> <span class="PreProc">var</span> fg: int
<span id="L158" class="LineNr">158 </span> copy-to fg, <span class="Constant">3</span>/cyan
<span id="L159" class="LineNr">159 </span> compare i, matching-close-paren-index
<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> copy-to fg, <span class="Constant">0xf</span>/highlight
<span id="L163" class="LineNr">163 </span> <span class="Delimiter">}</span>
<span id="L164" class="LineNr">164 </span> <span class="muComment">#</span>
<span id="L165" class="LineNr">165 </span> <span class="PreProc">var</span> g/<span class="Constant">esi</span>: (addr grapheme) <span class="Special">&lt;-</span> index data, i
<span id="L166" class="LineNr">166 </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, <span class="Constant">0</span>/bg=cursor
<span id="L167" class="LineNr">167 </span> i <span class="Special">&lt;-</span> decrement
<span id="L168" class="LineNr">168 </span> <span class="PreProc">loop</span>
<span id="L169" class="LineNr">169 </span> <span class="Delimiter">}</span>
<span id="L170" class="LineNr">170 </span> <span class="PreProc">return</span> x, y
<span id="L171" class="LineNr">171 </span><span class="Delimiter">}</span>
<span id="L172" class="LineNr">172 </span>
<span id="L173" class="LineNr">173 </span><span class="muComment"># helper for small words</span>
<span id="L174" class="LineNr">174 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='grapheme-stack.mu.html#L174'>render-stack-from-top</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='grapheme-stack.mu.html#L3'>grapheme-stack</a>), x: int, y: int, render-cursor?: boolean<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
<span id="L175" class="LineNr">175 </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="L176" class="LineNr">176 </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="L177" class="LineNr">177 </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="L178" class="LineNr">178 </span> <span class="PreProc">var</span> width/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy _width
<span id="L179" class="LineNr">179 </span> <span class="PreProc">var</span> height/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy _height
<span id="L180" class="LineNr">180 </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="L181" class="LineNr">181 </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="L182" class="LineNr">182 </span> x2, y2 <span class="Special">&lt;-</span> <a href='grapheme-stack.mu.html#L131'>render-stack-from-top-wrapping-right-then-down</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, self, x, y, width, height, x, y, render-cursor?
<span id="L183" class="LineNr">183 </span> <span class="PreProc">return</span> x2 <span class="muComment"># y2? yolo</span>
<span id="L184" class="LineNr">184 </span><span class="Delimiter">}</span>
<span id="L185" class="LineNr">185 </span>
<span id="L186" class="LineNr">186 </span><span class="PreProc">fn</span> <span class="muTest"><a href='grapheme-stack.mu.html#L186'>test-render-grapheme-stack</a></span> <span class="Delimiter">{</span>
<span id="L187" class="LineNr">187 </span> <span class="muComment"># setup: gs = &quot;abc&quot;</span>
<span id="L188" class="LineNr">188 </span> <span class="PreProc">var</span> gs-storage: <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>
<span id="L189" class="LineNr">189 </span> <span class="PreProc">var</span> gs/<span class="Constant">edi</span>: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special">&lt;-</span> address gs-storage
<span id="L190" class="LineNr">190 </span> <a href='grapheme-stack.mu.html#L8'>initialize-grapheme-stack</a> gs, <span class="Constant">5</span>
<span id="L191" class="LineNr">191 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> copy <span class="Constant">0x61</span>/a
<span id="L192" class="LineNr">192 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L193" class="LineNr">193 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x62</span>/b
<span id="L194" class="LineNr">194 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L195" class="LineNr">195 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x63</span>/c
<span id="L196" class="LineNr">196 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L197" class="LineNr">197 </span> <span class="muComment"># setup: screen</span>
<span id="L198" class="LineNr">198 </span> <span class="PreProc">var</span> screen-on-stack: <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L199" class="LineNr">199 </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="L200" class="LineNr">200 </span> <a href='../500fake-screen.mu.html#L31'>initialize-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">5</span>, <span class="Constant">4</span>, <span class="Constant">0</span>/no-pixel-graphics
<span id="L201" class="LineNr">201 </span> <span class="muComment">#</span>
<span id="L202" class="LineNr">202 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='grapheme-stack.mu.html#L117'>render-stack-from-bottom</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, gs, <span class="Constant">0</span>/x, <span class="Constant">0</span>/y, <span class="Constant">0</span>/no-highlight-matching-open-paren, <span class="Constant">0</span>/open-paren-depth
<span id="L203" class="LineNr">203 </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;abc &quot;</span>, <span class="Constant">&quot;F - <a href='grapheme-stack.mu.html#L186'>test-render-grapheme-stack</a> from bottom&quot;</span>
<span id="L204" class="LineNr">204 </span> <a href='../502test.mu.html#L2'>check-ints-equal</a> x, <span class="Constant">3</span>, <span class="Constant">&quot;F - <a href='grapheme-stack.mu.html#L186'>test-render-grapheme-stack</a> from bottom: result&quot;</span>
<span id="L205" class="LineNr">205 </span> <a href='../504test-screen.mu.html#L251'>check-background-color-in-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">7</span>/bg=cursor, <span class="Constant">0</span>/y, <span class="Constant">&quot; &quot;</span>, <span class="Constant">&quot;F - <a href='grapheme-stack.mu.html#L186'>test-render-grapheme-stack</a> from bottom: bg&quot;</span>
<span id="L206" class="LineNr">206 </span> <span class="muComment">#</span>
<span id="L207" class="LineNr">207 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='grapheme-stack.mu.html#L174'>render-stack-from-top</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, gs, <span class="Constant">0</span>/x, <span class="Constant">1</span>/y, <span class="Constant">0</span>/cursor=false
<span id="L208" class="LineNr">208 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">1</span>/y, <span class="Constant">&quot;cba &quot;</span>, <span class="Constant">&quot;F - <a href='grapheme-stack.mu.html#L186'>test-render-grapheme-stack</a> from top without cursor&quot;</span>
<span id="L209" class="LineNr">209 </span> <a href='../502test.mu.html#L2'>check-ints-equal</a> x, <span class="Constant">3</span>, <span class="Constant">&quot;F - <a href='grapheme-stack.mu.html#L186'>test-render-grapheme-stack</a> from top without cursor: result&quot;</span>
<span id="L210" class="LineNr">210 </span> <a href='../504test-screen.mu.html#L251'>check-background-color-in-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">7</span>/bg=cursor, <span class="Constant">1</span>/y, <span class="Constant">&quot; &quot;</span>, <span class="Constant">&quot;F - <a href='grapheme-stack.mu.html#L186'>test-render-grapheme-stack</a> from top without cursor: bg&quot;</span>
<span id="L104" class="LineNr">104 </span> <span class="PreProc">var</span> tmp/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy color
<span id="L105" class="LineNr">105 </span> copy-to fg, tmp
<span id="L106" class="LineNr">106 </span> <span class="Delimiter">}</span>
<span id="L107" class="LineNr">107 </span> <span class="Delimiter">{</span>
<span id="L108" class="LineNr">108 </span> compare i, matching-open-paren-index
<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="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>
<span id="L116" class="LineNr">116 </span> <span class="Delimiter">}</span>
<span id="L117" class="LineNr">117 </span> <span class="PreProc">return</span> x, y
<span id="L118" class="LineNr">118 </span><span class="Delimiter">}</span>
<span id="L119" class="LineNr">119 </span>
<span id="L120" class="LineNr">120 </span><span class="muComment"># helper for small words</span>
<span id="L121" class="LineNr">121 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='grapheme-stack.mu.html#L121'>render-stack-from-bottom</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='grapheme-stack.mu.html#L3'>grapheme-stack</a>), x: int, y: int, <a href='gap-buffer.mu.html#L677'>highlight-matching-open-paren?</a>: boolean, open-paren-depth: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
<span id="L122" class="LineNr">122 </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="L123" class="LineNr">123 </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="L124" class="LineNr">124 </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="L125" class="LineNr">125 </span> <span class="PreProc">var</span> width/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy _width
<span id="L126" class="LineNr">126 </span> <span class="PreProc">var</span> height/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy _height
<span id="L127" class="LineNr">127 </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="L128" class="LineNr">128 </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="L129" class="LineNr">129 </span> x2, y2 <span class="Special">&lt;-</span> <a href='grapheme-stack.mu.html#L87'>render-stack-from-bottom-wrapping-right-then-down</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, self, x, y, width, height, x, y, <a href='gap-buffer.mu.html#L677'>highlight-matching-open-paren?</a>, open-paren-depth, <span class="Constant">3</span>/fg=cyan, <span class="Constant">0xc5</span>/bg=blue-bg
<span id="L130" class="LineNr">130 </span> <span class="PreProc">return</span> x2 <span class="muComment"># y2? yolo</span>
<span id="L131" class="LineNr">131 </span><span class="Delimiter">}</span>
<span id="L132" class="LineNr">132 </span>
<span id="L133" class="LineNr">133 </span><span class="muComment"># dump stack to screen from top to bottom</span>
<span id="L134" class="LineNr">134 </span><span class="muComment"># optionally render a 'cursor' with the top grapheme</span>
<span id="L135" class="LineNr">135 </span><span class="muComment"># hard-coded colors:</span>
<span id="L136" class="LineNr">136 </span><span class="muComment"># matching paren</span>
<span id="L137" class="LineNr">137 </span><span class="muComment"># cursor</span>
<span id="L138" class="LineNr">138 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='grapheme-stack.mu.html#L138'>render-stack-from-top-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>), _self: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>), xmin: int, ymin: int, xmax: int, ymax: int, _x: int, _y: int, render-cursor?: boolean, 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="L139" class="LineNr">139 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special">&lt;-</span> copy _self
<span id="L140" class="LineNr">140 </span> <span class="PreProc">var</span> matching-close-paren-index/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> <a href='grapheme-stack.mu.html#L378'>get-matching-close-paren-index</a> self, render-cursor?
<span id="L141" class="LineNr">141 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">eax</span>: (addr handle array grapheme) <span class="Special">&lt;-</span> get self, data
<span id="L142" class="LineNr">142 </span> <span class="PreProc">var</span> _data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L143" class="LineNr">143 </span> <span class="PreProc">var</span> data/<span class="Constant">edi</span>: (addr array grapheme) <span class="Special">&lt;-</span> copy _data
<span id="L144" class="LineNr">144 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy _x
<span id="L145" class="LineNr">145 </span> <span class="PreProc">var</span> y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy _y
<span id="L146" class="LineNr">146 </span> <span class="PreProc">var</span> top-addr/<span class="Constant">ebx</span>: (addr int) <span class="Special">&lt;-</span> get self, top
<span id="L147" class="LineNr">147 </span> <span class="PreProc">var</span> i/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy *top-addr
<span id="L148" class="LineNr">148 </span> i <span class="Special">&lt;-</span> decrement
<span id="L149" class="LineNr">149 </span> <span class="muComment"># if render-cursor?, peel off first iteration</span>
<span id="L150" class="LineNr">150 </span> <span class="Delimiter">{</span>
<span id="L151" class="LineNr">151 </span> compare render-cursor?, <span class="Constant">0</span>/false
<span id="L152" class="LineNr">152 </span> <span class="PreProc">break-if-=</span>
<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="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>
<span id="L160" class="LineNr">160 </span> <span class="Delimiter">{</span>
<span id="L161" class="LineNr">161 </span> compare i, <span class="Constant">0</span>
<span id="L162" class="LineNr">162 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L163" class="LineNr">163 </span> <span class="muComment"># highlight matching paren if needed</span>
<span id="L164" class="LineNr">164 </span> <span class="PreProc">var</span> fg: int
<span id="L165" class="LineNr">165 </span> <span class="Delimiter">{</span>
<span id="L166" class="LineNr">166 </span> <span class="PreProc">var</span> tmp/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy color
<span id="L167" class="LineNr">167 </span> copy-to fg, tmp
<span id="L168" class="LineNr">168 </span> <span class="Delimiter">}</span>
<span id="L169" class="LineNr">169 </span> compare i, matching-close-paren-index
<span id="L170" class="LineNr">170 </span> <span class="Delimiter">{</span>
<span id="L171" class="LineNr">171 </span> <span class="PreProc">break-if-!=</span>
<span id="L172" class="LineNr">172 </span> copy-to fg, <span class="Constant">0xf</span>/highlight
<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="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>
<span id="L180" class="LineNr">180 </span> <span class="PreProc">return</span> x, y
<span id="L181" class="LineNr">181 </span><span class="Delimiter">}</span>
<span id="L182" class="LineNr">182 </span>
<span id="L183" class="LineNr">183 </span><span class="muComment"># helper for small words</span>
<span id="L184" class="LineNr">184 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='grapheme-stack.mu.html#L184'>render-stack-from-top</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='grapheme-stack.mu.html#L3'>grapheme-stack</a>), x: int, y: int, render-cursor?: boolean<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
<span id="L185" class="LineNr">185 </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="L186" class="LineNr">186 </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="L187" class="LineNr">187 </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="L188" class="LineNr">188 </span> <span class="PreProc">var</span> width/<span class="Constant">edx</span>: int <span class="Special">&lt;-</span> copy _width
<span id="L189" class="LineNr">189 </span> <span class="PreProc">var</span> height/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy _height
<span id="L190" class="LineNr">190 </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="L191" class="LineNr">191 </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="L192" class="LineNr">192 </span> x2, y2 <span class="Special">&lt;-</span> <a href='grapheme-stack.mu.html#L138'>render-stack-from-top-wrapping-right-then-down</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, self, x, y, width, height, x, y, render-cursor?, <span class="Constant">3</span>/fg=cyan, <span class="Constant">0xc5</span>/bg=blue-bg
<span id="L193" class="LineNr">193 </span> <span class="PreProc">return</span> x2 <span class="muComment"># y2? yolo</span>
<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="muTest"><a href='grapheme-stack.mu.html#L196'>test-render-grapheme-stack</a></span> <span class="Delimiter">{</span>
<span id="L197" class="LineNr">197 </span> <span class="muComment"># setup: gs = &quot;abc&quot;</span>
<span id="L198" class="LineNr">198 </span> <span class="PreProc">var</span> gs-storage: <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>
<span id="L199" class="LineNr">199 </span> <span class="PreProc">var</span> gs/<span class="Constant">edi</span>: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special">&lt;-</span> address gs-storage
<span id="L200" class="LineNr">200 </span> <a href='grapheme-stack.mu.html#L8'>initialize-grapheme-stack</a> gs, <span class="Constant">5</span>
<span id="L201" class="LineNr">201 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> copy <span class="Constant">0x61</span>/a
<span id="L202" class="LineNr">202 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L203" class="LineNr">203 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x62</span>/b
<span id="L204" class="LineNr">204 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L205" class="LineNr">205 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x63</span>/c
<span id="L206" class="LineNr">206 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L207" class="LineNr">207 </span> <span class="muComment"># setup: screen</span>
<span id="L208" class="LineNr">208 </span> <span class="PreProc">var</span> screen-on-stack: <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L209" class="LineNr">209 </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="L210" class="LineNr">210 </span> <a href='../500fake-screen.mu.html#L31'>initialize-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">5</span>, <span class="Constant">4</span>, <span class="Constant">0</span>/no-pixel-graphics
<span id="L211" class="LineNr">211 </span> <span class="muComment">#</span>
<span id="L212" class="LineNr">212 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='grapheme-stack.mu.html#L174'>render-stack-from-top</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, gs, <span class="Constant">0</span>/x, <span class="Constant">2</span>/y, <span class="Constant">1</span>/cursor=true
<span id="L213" class="LineNr">213 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">&quot;cba &quot;</span>, <span class="Constant">&quot;F - <a href='grapheme-stack.mu.html#L186'>test-render-grapheme-stack</a> from top with cursor&quot;</span>
<span id="L214" class="LineNr">214 </span> <a href='../502test.mu.html#L2'>check-ints-equal</a> x, <span class="Constant">3</span>, <span class="Constant">&quot;F - <a href='grapheme-stack.mu.html#L186'>test-render-grapheme-stack</a> from top with cursor: result&quot;</span>
<span id="L215" class="LineNr">215 </span> <a href='../504test-screen.mu.html#L251'>check-background-color-in-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">7</span>/bg=cursor, <span class="Constant">2</span>/y, <span class="Constant">&quot;| &quot;</span>, <span class="Constant">&quot;F - <a href='grapheme-stack.mu.html#L186'>test-render-grapheme-stack</a> from top with cursor: bg&quot;</span>
<span id="L216" class="LineNr">216 </span><span class="Delimiter">}</span>
<span id="L217" class="LineNr">217 </span>
<span id="L218" class="LineNr">218 </span><span class="PreProc">fn</span> <span class="muTest"><a href='grapheme-stack.mu.html#L218'>test-render-grapheme-stack-while-highlighting-matching-close-paren</a></span> <span class="Delimiter">{</span>
<span id="L219" class="LineNr">219 </span> <span class="muComment"># setup: gs = &quot;(b)&quot;</span>
<span id="L220" class="LineNr">220 </span> <span class="PreProc">var</span> gs-storage: <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>
<span id="L221" class="LineNr">221 </span> <span class="PreProc">var</span> gs/<span class="Constant">edi</span>: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special">&lt;-</span> address gs-storage
<span id="L222" class="LineNr">222 </span> <a href='grapheme-stack.mu.html#L8'>initialize-grapheme-stack</a> gs, <span class="Constant">5</span>
<span id="L223" class="LineNr">223 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> copy <span class="Constant">0x29</span>/close-paren
<span id="L224" class="LineNr">224 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L225" class="LineNr">225 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x62</span>/b
<span id="L226" class="LineNr">226 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L227" class="LineNr">227 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x28</span>/open-paren
<span id="L228" class="LineNr">228 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L229" class="LineNr">229 </span> <span class="muComment"># setup: screen</span>
<span id="L230" class="LineNr">230 </span> <span class="PreProc">var</span> screen-on-stack: <a href='../500fake-screen.mu.html#L14'>screen</a>
<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> address screen-on-stack
<span id="L232" class="LineNr">232 </span> <a href='../500fake-screen.mu.html#L31'>initialize-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">5</span>, <span class="Constant">4</span>, <span class="Constant">0</span>/no-pixel-graphics
<span id="L233" class="LineNr">233 </span> <span class="muComment">#</span>
<span id="L234" class="LineNr">234 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='grapheme-stack.mu.html#L174'>render-stack-from-top</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, gs, <span class="Constant">0</span>/x, <span class="Constant">2</span>/y, <span class="Constant">1</span>/cursor=true
<span id="L235" class="LineNr">235 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">&quot;(b) &quot;</span>, <span class="Constant">&quot;F - test-render-grapheme-stack-while-highlighting-matching-close-paren&quot;</span>
<span id="L236" class="LineNr">236 </span> <a href='../504test-screen.mu.html#L251'>check-background-color-in-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">7</span>/bg=cursor, <span class="Constant">2</span>/y, <span class="Constant">&quot;| &quot;</span>, <span class="Constant">&quot;F - <a href='grapheme-stack.mu.html#L218'>test-render-grapheme-stack-while-highlighting-matching-close-paren</a>: cursor&quot;</span>
<span id="L237" class="LineNr">237 </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">0xf</span>/fg=white, <span class="Constant">2</span>/y, <span class="Constant">&quot; ) &quot;</span>, <span class="Constant">&quot;F - <a href='grapheme-stack.mu.html#L218'>test-render-grapheme-stack-while-highlighting-matching-close-paren</a>: matching paren&quot;</span>
<span id="L238" class="LineNr">238 </span><span class="Delimiter">}</span>
<span id="L239" class="LineNr">239 </span>
<span id="L240" class="LineNr">240 </span><span class="PreProc">fn</span> <span class="muTest"><a href='grapheme-stack.mu.html#L240'>test-render-grapheme-stack-while-highlighting-matching-close-paren-2</a></span> <span class="Delimiter">{</span>
<span id="L241" class="LineNr">241 </span> <span class="muComment"># setup: gs = &quot;(a (b)) c&quot;</span>
<span id="L242" class="LineNr">242 </span> <span class="PreProc">var</span> gs-storage: <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>
<span id="L243" class="LineNr">243 </span> <span class="PreProc">var</span> gs/<span class="Constant">edi</span>: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special">&lt;-</span> address gs-storage
<span id="L244" class="LineNr">244 </span> <a href='grapheme-stack.mu.html#L8'>initialize-grapheme-stack</a> gs, <span class="Constant">0x10</span>
<span id="L245" class="LineNr">245 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> copy <span class="Constant">0x63</span>/c
<span id="L246" class="LineNr">246 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L247" class="LineNr">247 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x20</span>/space
<span id="L248" class="LineNr">248 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L249" class="LineNr">249 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x29</span>/close-paren
<span id="L250" class="LineNr">250 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L251" class="LineNr">251 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x29</span>/close-paren
<span id="L252" class="LineNr">252 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L253" class="LineNr">253 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x62</span>/b
<span id="L254" class="LineNr">254 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L255" class="LineNr">255 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x28</span>/open-paren
<span id="L212" class="LineNr">212 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='grapheme-stack.mu.html#L121'>render-stack-from-bottom</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, gs, <span class="Constant">0</span>/x, <span class="Constant">0</span>/y, <span class="Constant">0</span>/no-highlight-matching-open-paren, <span class="Constant">0</span>/open-paren-depth
<span id="L213" class="LineNr">213 </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;abc &quot;</span>, <span class="Constant">&quot;F - <a href='grapheme-stack.mu.html#L196'>test-render-grapheme-stack</a> from bottom&quot;</span>
<span id="L214" class="LineNr">214 </span> <a href='../502test.mu.html#L2'>check-ints-equal</a> x, <span class="Constant">3</span>, <span class="Constant">&quot;F - <a href='grapheme-stack.mu.html#L196'>test-render-grapheme-stack</a> from bottom: result&quot;</span>
<span id="L215" class="LineNr">215 </span> <a href='../504test-screen.mu.html#L251'>check-background-color-in-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">7</span>/bg=cursor, <span class="Constant">0</span>/y, <span class="Constant">&quot; &quot;</span>, <span class="Constant">&quot;F - <a href='grapheme-stack.mu.html#L196'>test-render-grapheme-stack</a> from bottom: bg&quot;</span>
<span id="L216" class="LineNr">216 </span> <span class="muComment">#</span>
<span id="L217" class="LineNr">217 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='grapheme-stack.mu.html#L184'>render-stack-from-top</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, gs, <span class="Constant">0</span>/x, <span class="Constant">1</span>/y, <span class="Constant">0</span>/cursor=false
<span id="L218" class="LineNr">218 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">1</span>/y, <span class="Constant">&quot;cba &quot;</span>, <span class="Constant">&quot;F - <a href='grapheme-stack.mu.html#L196'>test-render-grapheme-stack</a> from top without cursor&quot;</span>
<span id="L219" class="LineNr">219 </span> <a href='../502test.mu.html#L2'>check-ints-equal</a> x, <span class="Constant">3</span>, <span class="Constant">&quot;F - <a href='grapheme-stack.mu.html#L196'>test-render-grapheme-stack</a> from top without cursor: result&quot;</span>
<span id="L220" class="LineNr">220 </span> <a href='../504test-screen.mu.html#L251'>check-background-color-in-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">7</span>/bg=cursor, <span class="Constant">1</span>/y, <span class="Constant">&quot; &quot;</span>, <span class="Constant">&quot;F - <a href='grapheme-stack.mu.html#L196'>test-render-grapheme-stack</a> from top without cursor: bg&quot;</span>
<span id="L221" class="LineNr">221 </span> <span class="muComment">#</span>
<span id="L222" class="LineNr">222 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='grapheme-stack.mu.html#L184'>render-stack-from-top</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, gs, <span class="Constant">0</span>/x, <span class="Constant">2</span>/y, <span class="Constant">1</span>/cursor=true
<span id="L223" class="LineNr">223 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">&quot;cba &quot;</span>, <span class="Constant">&quot;F - <a href='grapheme-stack.mu.html#L196'>test-render-grapheme-stack</a> from top with cursor&quot;</span>
<span id="L224" class="LineNr">224 </span> <a href='../502test.mu.html#L2'>check-ints-equal</a> x, <span class="Constant">3</span>, <span class="Constant">&quot;F - <a href='grapheme-stack.mu.html#L196'>test-render-grapheme-stack</a> from top with cursor: result&quot;</span>
<span id="L225" class="LineNr">225 </span> <a href='../504test-screen.mu.html#L251'>check-background-color-in-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">7</span>/bg=cursor, <span class="Constant">2</span>/y, <span class="Constant">&quot;| &quot;</span>, <span class="Constant">&quot;F - <a href='grapheme-stack.mu.html#L196'>test-render-grapheme-stack</a> from top with cursor: bg&quot;</span>
<span id="L226" class="LineNr">226 </span><span class="Delimiter">}</span>
<span id="L227" class="LineNr">227 </span>
<span id="L228" class="LineNr">228 </span><span class="PreProc">fn</span> <span class="muTest"><a href='grapheme-stack.mu.html#L228'>test-render-grapheme-stack-while-highlighting-matching-close-paren</a></span> <span class="Delimiter">{</span>
<span id="L229" class="LineNr">229 </span> <span class="muComment"># setup: gs = &quot;(b)&quot;</span>
<span id="L230" class="LineNr">230 </span> <span class="PreProc">var</span> gs-storage: <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>
<span id="L231" class="LineNr">231 </span> <span class="PreProc">var</span> gs/<span class="Constant">edi</span>: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special">&lt;-</span> address gs-storage
<span id="L232" class="LineNr">232 </span> <a href='grapheme-stack.mu.html#L8'>initialize-grapheme-stack</a> gs, <span class="Constant">5</span>
<span id="L233" class="LineNr">233 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> copy <span class="Constant">0x29</span>/close-paren
<span id="L234" class="LineNr">234 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L235" class="LineNr">235 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x62</span>/b
<span id="L236" class="LineNr">236 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L237" class="LineNr">237 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x28</span>/open-paren
<span id="L238" class="LineNr">238 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L239" class="LineNr">239 </span> <span class="muComment"># setup: screen</span>
<span id="L240" class="LineNr">240 </span> <span class="PreProc">var</span> screen-on-stack: <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L241" class="LineNr">241 </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="L242" class="LineNr">242 </span> <a href='../500fake-screen.mu.html#L31'>initialize-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">5</span>, <span class="Constant">4</span>, <span class="Constant">0</span>/no-pixel-graphics
<span id="L243" class="LineNr">243 </span> <span class="muComment">#</span>
<span id="L244" class="LineNr">244 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='grapheme-stack.mu.html#L184'>render-stack-from-top</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, gs, <span class="Constant">0</span>/x, <span class="Constant">2</span>/y, <span class="Constant">1</span>/cursor=true
<span id="L245" class="LineNr">245 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">&quot;(b) &quot;</span>, <span class="Constant">&quot;F - test-render-grapheme-stack-while-highlighting-matching-close-paren&quot;</span>
<span id="L246" class="LineNr">246 </span> <a href='../504test-screen.mu.html#L251'>check-background-color-in-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">7</span>/bg=cursor, <span class="Constant">2</span>/y, <span class="Constant">&quot;| &quot;</span>, <span class="Constant">&quot;F - <a href='grapheme-stack.mu.html#L228'>test-render-grapheme-stack-while-highlighting-matching-close-paren</a>: cursor&quot;</span>
<span id="L247" class="LineNr">247 </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">0xf</span>/fg=white, <span class="Constant">2</span>/y, <span class="Constant">&quot; ) &quot;</span>, <span class="Constant">&quot;F - <a href='grapheme-stack.mu.html#L228'>test-render-grapheme-stack-while-highlighting-matching-close-paren</a>: matching paren&quot;</span>
<span id="L248" class="LineNr">248 </span><span class="Delimiter">}</span>
<span id="L249" class="LineNr">249 </span>
<span id="L250" class="LineNr">250 </span><span class="PreProc">fn</span> <span class="muTest"><a href='grapheme-stack.mu.html#L250'>test-render-grapheme-stack-while-highlighting-matching-close-paren-2</a></span> <span class="Delimiter">{</span>
<span id="L251" class="LineNr">251 </span> <span class="muComment"># setup: gs = &quot;(a (b)) c&quot;</span>
<span id="L252" class="LineNr">252 </span> <span class="PreProc">var</span> gs-storage: <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>
<span id="L253" class="LineNr">253 </span> <span class="PreProc">var</span> gs/<span class="Constant">edi</span>: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special">&lt;-</span> address gs-storage
<span id="L254" class="LineNr">254 </span> <a href='grapheme-stack.mu.html#L8'>initialize-grapheme-stack</a> gs, <span class="Constant">0x10</span>
<span id="L255" class="LineNr">255 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> copy <span class="Constant">0x63</span>/c
<span id="L256" class="LineNr">256 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L257" class="LineNr">257 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x20</span>/space
<span id="L258" class="LineNr">258 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L259" class="LineNr">259 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x61</span>/a
<span id="L259" class="LineNr">259 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x29</span>/close-paren
<span id="L260" class="LineNr">260 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L261" class="LineNr">261 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x28</span>/open-paren
<span id="L261" class="LineNr">261 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x29</span>/close-paren
<span id="L262" class="LineNr">262 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L263" class="LineNr">263 </span> <span class="muComment"># setup: screen</span>
<span id="L264" class="LineNr">264 </span> <span class="PreProc">var</span> screen-on-stack: <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L265" class="LineNr">265 </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="L266" class="LineNr">266 </span> <a href='../500fake-screen.mu.html#L31'>initialize-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">5</span>, <span class="Constant">4</span>, <span class="Constant">0</span>/no-pixel-graphics
<span id="L267" class="LineNr">267 </span> <span class="muComment">#</span>
<span id="L268" class="LineNr">268 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='grapheme-stack.mu.html#L174'>render-stack-from-top</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, gs, <span class="Constant">0</span>/x, <span class="Constant">2</span>/y, <span class="Constant">1</span>/cursor=true
<span id="L269" class="LineNr">269 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">&quot;(a (b)) c &quot;</span>, <span class="Constant">&quot;F - test-render-grapheme-stack-while-highlighting-matching-close-paren-2&quot;</span>
<span id="L270" class="LineNr">270 </span> <a href='../504test-screen.mu.html#L251'>check-background-color-in-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">7</span>/bg=cursor, <span class="Constant">2</span>/y, <span class="Constant">&quot;| &quot;</span>, <span class="Constant">&quot;F - <a href='grapheme-stack.mu.html#L240'>test-render-grapheme-stack-while-highlighting-matching-close-paren-2</a>: cursor&quot;</span>
<span id="L271" class="LineNr">271 </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">0xf</span>/fg=white, <span class="Constant">2</span>/y, <span class="Constant">&quot; ) &quot;</span>, <span class="Constant">&quot;F - <a href='grapheme-stack.mu.html#L240'>test-render-grapheme-stack-while-highlighting-matching-close-paren-2</a>: matching paren&quot;</span>
<span id="L272" class="LineNr">272 </span><span class="Delimiter">}</span>
<span id="L273" class="LineNr">273 </span>
<span id="L274" class="LineNr">274 </span><span class="PreProc">fn</span> <span class="muTest"><a href='grapheme-stack.mu.html#L274'>test-render-grapheme-stack-while-highlighting-matching-open-paren-with-close-paren-at-end</a></span> <span class="Delimiter">{</span>
<span id="L275" class="LineNr">275 </span> <span class="muComment"># setup: gs = &quot;(b)&quot;</span>
<span id="L276" class="LineNr">276 </span> <span class="PreProc">var</span> gs-storage: <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>
<span id="L277" class="LineNr">277 </span> <span class="PreProc">var</span> gs/<span class="Constant">edi</span>: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special">&lt;-</span> address gs-storage
<span id="L278" class="LineNr">278 </span> <a href='grapheme-stack.mu.html#L8'>initialize-grapheme-stack</a> gs, <span class="Constant">5</span>
<span id="L279" class="LineNr">279 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> copy <span class="Constant">0x28</span>/open-paren
<span id="L280" class="LineNr">280 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L281" class="LineNr">281 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x62</span>/b
<span id="L282" class="LineNr">282 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L283" class="LineNr">283 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x29</span>/close-paren
<span id="L284" class="LineNr">284 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L285" class="LineNr">285 </span> <span class="muComment"># setup: screen</span>
<span id="L286" class="LineNr">286 </span> <span class="PreProc">var</span> screen-on-stack: <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L287" class="LineNr">287 </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="L288" class="LineNr">288 </span> <a href='../500fake-screen.mu.html#L31'>initialize-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">5</span>, <span class="Constant">4</span>, <span class="Constant">0</span>/no-pixel-graphics
<span id="L289" class="LineNr">289 </span> <span class="muComment">#</span>
<span id="L290" class="LineNr">290 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='grapheme-stack.mu.html#L117'>render-stack-from-bottom</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, gs, <span class="Constant">0</span>/x, <span class="Constant">2</span>/y, <span class="Constant">1</span>/highlight-matching-open-paren, <span class="Constant">1</span>/open-paren-depth
<span id="L291" class="LineNr">291 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">&quot;(b) &quot;</span>, <span class="Constant">&quot;F - test-render-grapheme-stack-while-highlighting-matching-open-paren-with-close-paren-at-end&quot;</span>
<span id="L292" class="LineNr">292 </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">0xf</span>/fg=white, <span class="Constant">2</span>/y, <span class="Constant">&quot;( &quot;</span>, <span class="Constant">&quot;F - <a href='grapheme-stack.mu.html#L274'>test-render-grapheme-stack-while-highlighting-matching-open-paren-with-close-paren-at-end</a>: matching paren&quot;</span>
<span id="L293" class="LineNr">293 </span><span class="Delimiter">}</span>
<span id="L294" class="LineNr">294 </span>
<span id="L295" class="LineNr">295 </span><span class="PreProc">fn</span> <span class="muTest"><a href='grapheme-stack.mu.html#L295'>test-render-grapheme-stack-while-highlighting-matching-open-paren-with-close-paren-at-end-2</a></span> <span class="Delimiter">{</span>
<span id="L296" class="LineNr">296 </span> <span class="muComment"># setup: gs = &quot;a((b))&quot;</span>
<span id="L297" class="LineNr">297 </span> <span class="PreProc">var</span> gs-storage: <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>
<span id="L298" class="LineNr">298 </span> <span class="PreProc">var</span> gs/<span class="Constant">edi</span>: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special">&lt;-</span> address gs-storage
<span id="L299" class="LineNr">299 </span> <a href='grapheme-stack.mu.html#L8'>initialize-grapheme-stack</a> gs, <span class="Constant">0x10</span>
<span id="L300" class="LineNr">300 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> copy <span class="Constant">0x61</span>/a
<span id="L301" class="LineNr">301 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L302" class="LineNr">302 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x28</span>/open-paren
<span id="L303" class="LineNr">303 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L304" class="LineNr">304 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x28</span>/open-paren
<span id="L305" class="LineNr">305 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L306" class="LineNr">306 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x62</span>/b
<span id="L307" class="LineNr">307 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L308" class="LineNr">308 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x29</span>/close-paren
<span id="L309" class="LineNr">309 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L310" class="LineNr">310 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x29</span>/close-paren
<span id="L263" class="LineNr">263 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x62</span>/b
<span id="L264" class="LineNr">264 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L265" class="LineNr">265 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x28</span>/open-paren
<span id="L266" class="LineNr">266 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L267" class="LineNr">267 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x20</span>/space
<span id="L268" class="LineNr">268 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L269" class="LineNr">269 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x61</span>/a
<span id="L270" class="LineNr">270 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L271" class="LineNr">271 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x28</span>/open-paren
<span id="L272" class="LineNr">272 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L273" class="LineNr">273 </span> <span class="muComment"># setup: screen</span>
<span id="L274" class="LineNr">274 </span> <span class="PreProc">var</span> screen-on-stack: <a href='../500fake-screen.mu.html#L14'>screen</a>
<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> address screen-on-stack
<span id="L276" class="LineNr">276 </span> <a href='../500fake-screen.mu.html#L31'>initialize-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">5</span>, <span class="Constant">4</span>, <span class="Constant">0</span>/no-pixel-graphics
<span id="L277" class="LineNr">277 </span> <span class="muComment">#</span>
<span id="L278" class="LineNr">278 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='grapheme-stack.mu.html#L184'>render-stack-from-top</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, gs, <span class="Constant">0</span>/x, <span class="Constant">2</span>/y, <span class="Constant">1</span>/cursor=true
<span id="L279" class="LineNr">279 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">&quot;(a (b)) c &quot;</span>, <span class="Constant">&quot;F - test-render-grapheme-stack-while-highlighting-matching-close-paren-2&quot;</span>
<span id="L280" class="LineNr">280 </span> <a href='../504test-screen.mu.html#L251'>check-background-color-in-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">7</span>/bg=cursor, <span class="Constant">2</span>/y, <span class="Constant">&quot;| &quot;</span>, <span class="Constant">&quot;F - <a href='grapheme-stack.mu.html#L250'>test-render-grapheme-stack-while-highlighting-matching-close-paren-2</a>: cursor&quot;</span>
<span id="L281" class="LineNr">281 </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">0xf</span>/fg=white, <span class="Constant">2</span>/y, <span class="Constant">&quot; ) &quot;</span>, <span class="Constant">&quot;F - <a href='grapheme-stack.mu.html#L250'>test-render-grapheme-stack-while-highlighting-matching-close-paren-2</a>: matching paren&quot;</span>
<span id="L282" class="LineNr">282 </span><span class="Delimiter">}</span>
<span id="L283" class="LineNr">283 </span>
<span id="L284" class="LineNr">284 </span><span class="PreProc">fn</span> <span class="muTest"><a href='grapheme-stack.mu.html#L284'>test-render-grapheme-stack-while-highlighting-matching-open-paren-with-close-paren-at-end</a></span> <span class="Delimiter">{</span>
<span id="L285" class="LineNr">285 </span> <span class="muComment"># setup: gs = &quot;(b)&quot;</span>
<span id="L286" class="LineNr">286 </span> <span class="PreProc">var</span> gs-storage: <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>
<span id="L287" class="LineNr">287 </span> <span class="PreProc">var</span> gs/<span class="Constant">edi</span>: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special">&lt;-</span> address gs-storage
<span id="L288" class="LineNr">288 </span> <a href='grapheme-stack.mu.html#L8'>initialize-grapheme-stack</a> gs, <span class="Constant">5</span>
<span id="L289" class="LineNr">289 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> copy <span class="Constant">0x28</span>/open-paren
<span id="L290" class="LineNr">290 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L291" class="LineNr">291 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x62</span>/b
<span id="L292" class="LineNr">292 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L293" class="LineNr">293 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x29</span>/close-paren
<span id="L294" class="LineNr">294 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L295" class="LineNr">295 </span> <span class="muComment"># setup: screen</span>
<span id="L296" class="LineNr">296 </span> <span class="PreProc">var</span> screen-on-stack: <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L297" class="LineNr">297 </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="L298" class="LineNr">298 </span> <a href='../500fake-screen.mu.html#L31'>initialize-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">5</span>, <span class="Constant">4</span>, <span class="Constant">0</span>/no-pixel-graphics
<span id="L299" class="LineNr">299 </span> <span class="muComment">#</span>
<span id="L300" class="LineNr">300 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='grapheme-stack.mu.html#L121'>render-stack-from-bottom</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, gs, <span class="Constant">0</span>/x, <span class="Constant">2</span>/y, <span class="Constant">1</span>/highlight-matching-open-paren, <span class="Constant">1</span>/open-paren-depth
<span id="L301" class="LineNr">301 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">&quot;(b) &quot;</span>, <span class="Constant">&quot;F - test-render-grapheme-stack-while-highlighting-matching-open-paren-with-close-paren-at-end&quot;</span>
<span id="L302" class="LineNr">302 </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">0xf</span>/fg=white, <span class="Constant">2</span>/y, <span class="Constant">&quot;( &quot;</span>, <span class="Constant">&quot;F - <a href='grapheme-stack.mu.html#L284'>test-render-grapheme-stack-while-highlighting-matching-open-paren-with-close-paren-at-end</a>: matching paren&quot;</span>
<span id="L303" class="LineNr">303 </span><span class="Delimiter">}</span>
<span id="L304" class="LineNr">304 </span>
<span id="L305" class="LineNr">305 </span><span class="PreProc">fn</span> <span class="muTest"><a href='grapheme-stack.mu.html#L305'>test-render-grapheme-stack-while-highlighting-matching-open-paren-with-close-paren-at-end-2</a></span> <span class="Delimiter">{</span>
<span id="L306" class="LineNr">306 </span> <span class="muComment"># setup: gs = &quot;a((b))&quot;</span>
<span id="L307" class="LineNr">307 </span> <span class="PreProc">var</span> gs-storage: <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>
<span id="L308" class="LineNr">308 </span> <span class="PreProc">var</span> gs/<span class="Constant">edi</span>: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special">&lt;-</span> address gs-storage
<span id="L309" class="LineNr">309 </span> <a href='grapheme-stack.mu.html#L8'>initialize-grapheme-stack</a> gs, <span class="Constant">0x10</span>
<span id="L310" class="LineNr">310 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> copy <span class="Constant">0x61</span>/a
<span id="L311" class="LineNr">311 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L312" class="LineNr">312 </span> <span class="muComment"># setup: screen</span>
<span id="L313" class="LineNr">313 </span> <span class="PreProc">var</span> screen-on-stack: <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L314" class="LineNr">314 </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="L315" class="LineNr">315 </span> <a href='../500fake-screen.mu.html#L31'>initialize-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">5</span>, <span class="Constant">4</span>, <span class="Constant">0</span>/no-pixel-graphics
<span id="L316" class="LineNr">316 </span> <span class="muComment">#</span>
<span id="L317" class="LineNr">317 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='grapheme-stack.mu.html#L117'>render-stack-from-bottom</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, gs, <span class="Constant">0</span>/x, <span class="Constant">2</span>/y, <span class="Constant">1</span>/highlight-matching-open-paren, <span class="Constant">1</span>/open-paren-depth
<span id="L318" class="LineNr">318 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">&quot;a((b)) &quot;</span>, <span class="Constant">&quot;F - test-render-grapheme-stack-while-highlighting-matching-open-paren-with-close-paren-at-end-2&quot;</span>
<span id="L319" class="LineNr">319 </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">0xf</span>/fg=white, <span class="Constant">2</span>/y, <span class="Constant">&quot; ( &quot;</span>, <span class="Constant">&quot;F - <a href='grapheme-stack.mu.html#L295'>test-render-grapheme-stack-while-highlighting-matching-open-paren-with-close-paren-at-end-2</a>: matching paren&quot;</span>
<span id="L320" class="LineNr">320 </span><span class="Delimiter">}</span>
<span id="L321" class="LineNr">321 </span>
<span id="L322" class="LineNr">322 </span><span class="PreProc">fn</span> <span class="muTest"><a href='grapheme-stack.mu.html#L322'>test-render-grapheme-stack-while-highlighting-matching-open-paren</a></span> <span class="Delimiter">{</span>
<span id="L323" class="LineNr">323 </span> <span class="muComment"># setup: gs = &quot;(b&quot;</span>
<span id="L324" class="LineNr">324 </span> <span class="PreProc">var</span> gs-storage: <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>
<span id="L325" class="LineNr">325 </span> <span class="PreProc">var</span> gs/<span class="Constant">edi</span>: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special">&lt;-</span> address gs-storage
<span id="L326" class="LineNr">326 </span> <a href='grapheme-stack.mu.html#L8'>initialize-grapheme-stack</a> gs, <span class="Constant">5</span>
<span id="L327" class="LineNr">327 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> copy <span class="Constant">0x28</span>/open-paren
<span id="L328" class="LineNr">328 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L329" class="LineNr">329 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x62</span>/b
<span id="L330" class="LineNr">330 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L331" class="LineNr">331 </span> <span class="muComment"># setup: screen</span>
<span id="L332" class="LineNr">332 </span> <span class="PreProc">var</span> screen-on-stack: <a href='../500fake-screen.mu.html#L14'>screen</a>
<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> address screen-on-stack
<span id="L334" class="LineNr">334 </span> <a href='../500fake-screen.mu.html#L31'>initialize-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">5</span>, <span class="Constant">4</span>, <span class="Constant">0</span>/no-pixel-graphics
<span id="L335" class="LineNr">335 </span> <span class="muComment">#</span>
<span id="L336" class="LineNr">336 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='grapheme-stack.mu.html#L117'>render-stack-from-bottom</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, gs, <span class="Constant">0</span>/x, <span class="Constant">2</span>/y, <span class="Constant">1</span>/highlight-matching-open-paren, <span class="Constant">0</span>/open-paren-depth
<span id="L337" class="LineNr">337 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">&quot;(b &quot;</span>, <span class="Constant">&quot;F - test-render-grapheme-stack-while-highlighting-matching-open-paren&quot;</span>
<span id="L338" class="LineNr">338 </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">0xf</span>/fg=white, <span class="Constant">2</span>/y, <span class="Constant">&quot;( &quot;</span>, <span class="Constant">&quot;F - <a href='grapheme-stack.mu.html#L322'>test-render-grapheme-stack-while-highlighting-matching-open-paren</a>: matching paren&quot;</span>
<span id="L339" class="LineNr">339 </span><span class="Delimiter">}</span>
<span id="L340" class="LineNr">340 </span>
<span id="L341" class="LineNr">341 </span><span class="PreProc">fn</span> <span class="muTest"><a href='grapheme-stack.mu.html#L341'>test-render-grapheme-stack-while-highlighting-matching-open-paren-2</a></span> <span class="Delimiter">{</span>
<span id="L342" class="LineNr">342 </span> <span class="muComment"># setup: gs = &quot;a((b)&quot;</span>
<span id="L343" class="LineNr">343 </span> <span class="PreProc">var</span> gs-storage: <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>
<span id="L344" class="LineNr">344 </span> <span class="PreProc">var</span> gs/<span class="Constant">edi</span>: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special">&lt;-</span> address gs-storage
<span id="L345" class="LineNr">345 </span> <a href='grapheme-stack.mu.html#L8'>initialize-grapheme-stack</a> gs, <span class="Constant">0x10</span>
<span id="L346" class="LineNr">346 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> copy <span class="Constant">0x61</span>/a
<span id="L347" class="LineNr">347 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L348" class="LineNr">348 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x28</span>/open-paren
<span id="L349" class="LineNr">349 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L350" class="LineNr">350 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x28</span>/open-paren
<span id="L351" class="LineNr">351 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L352" class="LineNr">352 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x62</span>/b
<span id="L353" class="LineNr">353 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L354" class="LineNr">354 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x29</span>/close-paren
<span id="L355" class="LineNr">355 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L356" class="LineNr">356 </span> <span class="muComment"># setup: screen</span>
<span id="L357" class="LineNr">357 </span> <span class="PreProc">var</span> screen-on-stack: <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L358" class="LineNr">358 </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="L359" class="LineNr">359 </span> <a href='../500fake-screen.mu.html#L31'>initialize-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">5</span>, <span class="Constant">4</span>, <span class="Constant">0</span>/no-pixel-graphics
<span id="L360" class="LineNr">360 </span> <span class="muComment">#</span>
<span id="L361" class="LineNr">361 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='grapheme-stack.mu.html#L117'>render-stack-from-bottom</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, gs, <span class="Constant">0</span>/x, <span class="Constant">2</span>/y, <span class="Constant">1</span>/highlight-matching-open-paren, <span class="Constant">0</span>/open-paren-depth
<span id="L362" class="LineNr">362 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">&quot;a((b) &quot;</span>, <span class="Constant">&quot;F - test-render-grapheme-stack-while-highlighting-matching-open-paren-2&quot;</span>
<span id="L363" class="LineNr">363 </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">0xf</span>/fg=white, <span class="Constant">2</span>/y, <span class="Constant">&quot; ( &quot;</span>, <span class="Constant">&quot;F - <a href='grapheme-stack.mu.html#L341'>test-render-grapheme-stack-while-highlighting-matching-open-paren-2</a>: matching paren&quot;</span>
<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="muComment"># return the index of the matching close-paren of the grapheme at cursor (top of stack)</span>
<span id="L367" class="LineNr">367 </span><span class="muComment"># or top index if there's no matching close-paren</span>
<span id="L368" class="LineNr">368 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='grapheme-stack.mu.html#L368'>get-matching-close-paren-index</a></span> _self: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>), render-cursor?: boolean<span class="PreProc"> -&gt; </span>_/<span class="Constant">edx</span>: int <span class="Delimiter">{</span>
<span id="L369" class="LineNr">369 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special">&lt;-</span> copy _self
<span id="L370" class="LineNr">370 </span> <span class="PreProc">var</span> top-addr/<span class="Constant">edx</span>: (addr int) <span class="Special">&lt;-</span> get self, top
<span id="L371" class="LineNr">371 </span> <span class="muComment"># if not rendering cursor, return</span>
<span id="L372" class="LineNr">372 </span> compare render-cursor?, <span class="Constant">0</span>/false
<span id="L373" class="LineNr">373 </span> <span class="Delimiter">{</span>
<span id="L374" class="LineNr">374 </span> <span class="PreProc">break-if-!=</span>
<span id="L375" class="LineNr">375 </span> <span class="PreProc">return</span> *top-addr
<span id="L376" class="LineNr">376 </span> <span class="Delimiter">}</span>
<span id="L377" class="LineNr">377 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">eax</span>: (addr handle array grapheme) <span class="Special">&lt;-</span> get self, data
<span id="L378" class="LineNr">378 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L379" class="LineNr">379 </span> <span class="PreProc">var</span> i/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy *top-addr
<span id="L380" class="LineNr">380 </span> <span class="muComment"># if stack is empty, return</span>
<span id="L381" class="LineNr">381 </span> compare i, <span class="Constant">0</span>
<span id="L382" class="LineNr">382 </span> <span class="Delimiter">{</span>
<span id="L383" class="LineNr">383 </span> <span class="PreProc">break-if-&gt;</span>
<span id="L384" class="LineNr">384 </span> <span class="PreProc">return</span> *top-addr
<span id="L385" class="LineNr">385 </span> <span class="Delimiter">}</span>
<span id="L386" class="LineNr">386 </span> <span class="muComment"># if cursor is not '(' return</span>
<span id="L387" class="LineNr">387 </span> i <span class="Special">&lt;-</span> decrement
<span id="L388" class="LineNr">388 </span> <span class="PreProc">var</span> g/<span class="Constant">esi</span>: (addr grapheme) <span class="Special">&lt;-</span> index data, i
<span id="L389" class="LineNr">389 </span> compare *g, <span class="Constant">0x28</span>/open-paren
<span id="L390" class="LineNr">390 </span> <span class="Delimiter">{</span>
<span id="L391" class="LineNr">391 </span> <span class="PreProc">break-if-=</span>
<span id="L392" class="LineNr">392 </span> <span class="PreProc">return</span> *top-addr
<span id="L393" class="LineNr">393 </span> <span class="Delimiter">}</span>
<span id="L394" class="LineNr">394 </span> <span class="muComment"># otherwise scan to matching paren</span>
<span id="L395" class="LineNr">395 </span> <span class="PreProc">var</span> paren-count/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">1</span>
<span id="L396" class="LineNr">396 </span> i <span class="Special">&lt;-</span> decrement
<span id="L397" class="LineNr">397 </span> <span class="Delimiter">{</span>
<span id="L398" class="LineNr">398 </span> compare i, <span class="Constant">0</span>
<span id="L399" class="LineNr">399 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L400" class="LineNr">400 </span> <span class="PreProc">var</span> g/<span class="Constant">esi</span>: (addr grapheme) <span class="Special">&lt;-</span> index data, i
<span id="L401" class="LineNr">401 </span> compare *g, <span class="Constant">0x28</span>/open-paren
<span id="L402" class="LineNr">402 </span> <span class="Delimiter">{</span>
<span id="L403" class="LineNr">403 </span> <span class="PreProc">break-if-!=</span>
<span id="L404" class="LineNr">404 </span> paren-count <span class="Special">&lt;-</span> increment
<span id="L405" class="LineNr">405 </span> <span class="Delimiter">}</span>
<span id="L406" class="LineNr">406 </span> compare *g, <span class="Constant">0x29</span>/close-paren
<span id="L407" class="LineNr">407 </span> <span class="Delimiter">{</span>
<span id="L408" class="LineNr">408 </span> <span class="PreProc">break-if-!=</span>
<span id="L409" class="LineNr">409 </span> compare paren-count, <span class="Constant">1</span>
<span id="L410" class="LineNr">410 </span> <span class="Delimiter">{</span>
<span id="L411" class="LineNr">411 </span> <span class="PreProc">break-if-!=</span>
<span id="L412" class="LineNr">412 </span> <span class="PreProc">return</span> i
<span id="L413" class="LineNr">413 </span> <span class="Delimiter">}</span>
<span id="L414" class="LineNr">414 </span> paren-count <span class="Special">&lt;-</span> decrement
<span id="L312" class="LineNr">312 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x28</span>/open-paren
<span id="L313" class="LineNr">313 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L314" class="LineNr">314 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x28</span>/open-paren
<span id="L315" class="LineNr">315 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L316" class="LineNr">316 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x62</span>/b
<span id="L317" class="LineNr">317 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L318" class="LineNr">318 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x29</span>/close-paren
<span id="L319" class="LineNr">319 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L320" class="LineNr">320 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x29</span>/close-paren
<span id="L321" class="LineNr">321 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L322" class="LineNr">322 </span> <span class="muComment"># setup: screen</span>
<span id="L323" class="LineNr">323 </span> <span class="PreProc">var</span> screen-on-stack: <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L324" class="LineNr">324 </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="L325" class="LineNr">325 </span> <a href='../500fake-screen.mu.html#L31'>initialize-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">5</span>, <span class="Constant">4</span>, <span class="Constant">0</span>/no-pixel-graphics
<span id="L326" class="LineNr">326 </span> <span class="muComment">#</span>
<span id="L327" class="LineNr">327 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='grapheme-stack.mu.html#L121'>render-stack-from-bottom</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, gs, <span class="Constant">0</span>/x, <span class="Constant">2</span>/y, <span class="Constant">1</span>/highlight-matching-open-paren, <span class="Constant">1</span>/open-paren-depth
<span id="L328" class="LineNr">328 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">&quot;a((b)) &quot;</span>, <span class="Constant">&quot;F - test-render-grapheme-stack-while-highlighting-matching-open-paren-with-close-paren-at-end-2&quot;</span>
<span id="L329" class="LineNr">329 </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">0xf</span>/fg=white, <span class="Constant">2</span>/y, <span class="Constant">&quot; ( &quot;</span>, <span class="Constant">&quot;F - <a href='grapheme-stack.mu.html#L305'>test-render-grapheme-stack-while-highlighting-matching-open-paren-with-close-paren-at-end-2</a>: matching paren&quot;</span>
<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="muTest"><a href='grapheme-stack.mu.html#L332'>test-render-grapheme-stack-while-highlighting-matching-open-paren</a></span> <span class="Delimiter">{</span>
<span id="L333" class="LineNr">333 </span> <span class="muComment"># setup: gs = &quot;(b&quot;</span>
<span id="L334" class="LineNr">334 </span> <span class="PreProc">var</span> gs-storage: <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>
<span id="L335" class="LineNr">335 </span> <span class="PreProc">var</span> gs/<span class="Constant">edi</span>: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special">&lt;-</span> address gs-storage
<span id="L336" class="LineNr">336 </span> <a href='grapheme-stack.mu.html#L8'>initialize-grapheme-stack</a> gs, <span class="Constant">5</span>
<span id="L337" class="LineNr">337 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> copy <span class="Constant">0x28</span>/open-paren
<span id="L338" class="LineNr">338 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L339" class="LineNr">339 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x62</span>/b
<span id="L340" class="LineNr">340 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L341" class="LineNr">341 </span> <span class="muComment"># setup: screen</span>
<span id="L342" class="LineNr">342 </span> <span class="PreProc">var</span> screen-on-stack: <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L343" class="LineNr">343 </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="L344" class="LineNr">344 </span> <a href='../500fake-screen.mu.html#L31'>initialize-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">5</span>, <span class="Constant">4</span>, <span class="Constant">0</span>/no-pixel-graphics
<span id="L345" class="LineNr">345 </span> <span class="muComment">#</span>
<span id="L346" class="LineNr">346 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='grapheme-stack.mu.html#L121'>render-stack-from-bottom</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, gs, <span class="Constant">0</span>/x, <span class="Constant">2</span>/y, <span class="Constant">1</span>/highlight-matching-open-paren, <span class="Constant">0</span>/open-paren-depth
<span id="L347" class="LineNr">347 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">&quot;(b &quot;</span>, <span class="Constant">&quot;F - test-render-grapheme-stack-while-highlighting-matching-open-paren&quot;</span>
<span id="L348" class="LineNr">348 </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">0xf</span>/fg=white, <span class="Constant">2</span>/y, <span class="Constant">&quot;( &quot;</span>, <span class="Constant">&quot;F - <a href='grapheme-stack.mu.html#L332'>test-render-grapheme-stack-while-highlighting-matching-open-paren</a>: matching paren&quot;</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="muTest"><a href='grapheme-stack.mu.html#L351'>test-render-grapheme-stack-while-highlighting-matching-open-paren-2</a></span> <span class="Delimiter">{</span>
<span id="L352" class="LineNr">352 </span> <span class="muComment"># setup: gs = &quot;a((b)&quot;</span>
<span id="L353" class="LineNr">353 </span> <span class="PreProc">var</span> gs-storage: <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>
<span id="L354" class="LineNr">354 </span> <span class="PreProc">var</span> gs/<span class="Constant">edi</span>: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special">&lt;-</span> address gs-storage
<span id="L355" class="LineNr">355 </span> <a href='grapheme-stack.mu.html#L8'>initialize-grapheme-stack</a> gs, <span class="Constant">0x10</span>
<span id="L356" class="LineNr">356 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> copy <span class="Constant">0x61</span>/a
<span id="L357" class="LineNr">357 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L358" class="LineNr">358 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x28</span>/open-paren
<span id="L359" class="LineNr">359 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L360" class="LineNr">360 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x28</span>/open-paren
<span id="L361" class="LineNr">361 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L362" class="LineNr">362 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x62</span>/b
<span id="L363" class="LineNr">363 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L364" class="LineNr">364 </span> g <span class="Special">&lt;-</span> copy <span class="Constant">0x29</span>/close-paren
<span id="L365" class="LineNr">365 </span> <a href='grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
<span id="L366" class="LineNr">366 </span> <span class="muComment"># setup: screen</span>
<span id="L367" class="LineNr">367 </span> <span class="PreProc">var</span> screen-on-stack: <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L368" class="LineNr">368 </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="L369" class="LineNr">369 </span> <a href='../500fake-screen.mu.html#L31'>initialize-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">5</span>, <span class="Constant">4</span>, <span class="Constant">0</span>/no-pixel-graphics
<span id="L370" class="LineNr">370 </span> <span class="muComment">#</span>
<span id="L371" class="LineNr">371 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='grapheme-stack.mu.html#L121'>render-stack-from-bottom</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, gs, <span class="Constant">0</span>/x, <span class="Constant">2</span>/y, <span class="Constant">1</span>/highlight-matching-open-paren, <span class="Constant">0</span>/open-paren-depth
<span id="L372" class="LineNr">372 </span> <a href='../504test-screen.mu.html#L7'>check-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">&quot;a((b) &quot;</span>, <span class="Constant">&quot;F - test-render-grapheme-stack-while-highlighting-matching-open-paren-2&quot;</span>
<span id="L373" class="LineNr">373 </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">0xf</span>/fg=white, <span class="Constant">2</span>/y, <span class="Constant">&quot; ( &quot;</span>, <span class="Constant">&quot;F - <a href='grapheme-stack.mu.html#L351'>test-render-grapheme-stack-while-highlighting-matching-open-paren-2</a>: matching paren&quot;</span>
<span id="L374" class="LineNr">374 </span><span class="Delimiter">}</span>
<span id="L375" class="LineNr">375 </span>
<span id="L376" class="LineNr">376 </span><span class="muComment"># return the index of the matching close-paren of the grapheme at cursor (top of stack)</span>
<span id="L377" class="LineNr">377 </span><span class="muComment"># or top index if there's no matching close-paren</span>
<span id="L378" class="LineNr">378 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='grapheme-stack.mu.html#L378'>get-matching-close-paren-index</a></span> _self: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>), render-cursor?: boolean<span class="PreProc"> -&gt; </span>_/<span class="Constant">edx</span>: int <span class="Delimiter">{</span>
<span id="L379" class="LineNr">379 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special">&lt;-</span> copy _self
<span id="L380" class="LineNr">380 </span> <span class="PreProc">var</span> top-addr/<span class="Constant">edx</span>: (addr int) <span class="Special">&lt;-</span> get self, top
<span id="L381" class="LineNr">381 </span> <span class="muComment"># if not rendering cursor, return</span>
<span id="L382" class="LineNr">382 </span> compare render-cursor?, <span class="Constant">0</span>/false
<span id="L383" class="LineNr">383 </span> <span class="Delimiter">{</span>
<span id="L384" class="LineNr">384 </span> <span class="PreProc">break-if-!=</span>
<span id="L385" class="LineNr">385 </span> <span class="PreProc">return</span> *top-addr
<span id="L386" class="LineNr">386 </span> <span class="Delimiter">}</span>
<span id="L387" class="LineNr">387 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">eax</span>: (addr handle array grapheme) <span class="Special">&lt;-</span> get self, data
<span id="L388" class="LineNr">388 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L389" class="LineNr">389 </span> <span class="PreProc">var</span> i/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy *top-addr
<span id="L390" class="LineNr">390 </span> <span class="muComment"># if stack is empty, return</span>
<span id="L391" class="LineNr">391 </span> compare i, <span class="Constant">0</span>
<span id="L392" class="LineNr">392 </span> <span class="Delimiter">{</span>
<span id="L393" class="LineNr">393 </span> <span class="PreProc">break-if-&gt;</span>
<span id="L394" class="LineNr">394 </span> <span class="PreProc">return</span> *top-addr
<span id="L395" class="LineNr">395 </span> <span class="Delimiter">}</span>
<span id="L396" class="LineNr">396 </span> <span class="muComment"># if cursor is not '(' return</span>
<span id="L397" class="LineNr">397 </span> i <span class="Special">&lt;-</span> decrement
<span id="L398" class="LineNr">398 </span> <span class="PreProc">var</span> g/<span class="Constant">esi</span>: (addr grapheme) <span class="Special">&lt;-</span> index data, i
<span id="L399" class="LineNr">399 </span> compare *g, <span class="Constant">0x28</span>/open-paren
<span id="L400" class="LineNr">400 </span> <span class="Delimiter">{</span>
<span id="L401" class="LineNr">401 </span> <span class="PreProc">break-if-=</span>
<span id="L402" class="LineNr">402 </span> <span class="PreProc">return</span> *top-addr
<span id="L403" class="LineNr">403 </span> <span class="Delimiter">}</span>
<span id="L404" class="LineNr">404 </span> <span class="muComment"># otherwise scan to matching paren</span>
<span id="L405" class="LineNr">405 </span> <span class="PreProc">var</span> paren-count/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">1</span>
<span id="L406" class="LineNr">406 </span> i <span class="Special">&lt;-</span> decrement
<span id="L407" class="LineNr">407 </span> <span class="Delimiter">{</span>
<span id="L408" class="LineNr">408 </span> compare i, <span class="Constant">0</span>
<span id="L409" class="LineNr">409 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L410" class="LineNr">410 </span> <span class="PreProc">var</span> g/<span class="Constant">esi</span>: (addr grapheme) <span class="Special">&lt;-</span> index data, i
<span id="L411" class="LineNr">411 </span> compare *g, <span class="Constant">0x28</span>/open-paren
<span id="L412" class="LineNr">412 </span> <span class="Delimiter">{</span>
<span id="L413" class="LineNr">413 </span> <span class="PreProc">break-if-!=</span>
<span id="L414" class="LineNr">414 </span> paren-count <span class="Special">&lt;-</span> increment
<span id="L415" class="LineNr">415 </span> <span class="Delimiter">}</span>
<span id="L416" class="LineNr">416 </span> i <span class="Special">&lt;-</span> decrement
<span id="L417" class="LineNr">417 </span> <span class="PreProc">loop</span>
<span id="L418" class="LineNr">418 </span> <span class="Delimiter">}</span>
<span id="L419" class="LineNr">419 </span> <span class="PreProc">return</span> *top-addr
<span id="L420" class="LineNr">420 </span><span class="Delimiter">}</span>
<span id="L421" class="LineNr">421 </span>
<span id="L422" class="LineNr">422 </span><span class="muComment"># return the index of the first open-paren at the given depth</span>
<span id="L423" class="LineNr">423 </span><span class="muComment"># or top index if there's no matching close-paren</span>
<span id="L424" class="LineNr">424 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='grapheme-stack.mu.html#L424'>get-matching-open-paren-index</a></span> _self: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>), control: boolean, depth: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">edx</span>: int <span class="Delimiter">{</span>
<span id="L425" class="LineNr">425 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special">&lt;-</span> copy _self
<span id="L426" class="LineNr">426 </span> <span class="PreProc">var</span> top-addr/<span class="Constant">edx</span>: (addr int) <span class="Special">&lt;-</span> get self, top
<span id="L427" class="LineNr">427 </span> <span class="muComment"># if not rendering cursor, return</span>
<span id="L428" class="LineNr">428 </span> compare control, <span class="Constant">0</span>/false
<span id="L429" class="LineNr">429 </span> <span class="Delimiter">{</span>
<span id="L430" class="LineNr">430 </span> <span class="PreProc">break-if-!=</span>
<span id="L431" class="LineNr">431 </span> <span class="PreProc">return</span> *top-addr
<span id="L432" class="LineNr">432 </span> <span class="Delimiter">}</span>
<span id="L433" class="LineNr">433 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">eax</span>: (addr handle array grapheme) <span class="Special">&lt;-</span> get self, data
<span id="L434" class="LineNr">434 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L435" class="LineNr">435 </span> <span class="PreProc">var</span> i/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy *top-addr
<span id="L436" class="LineNr">436 </span> <span class="muComment"># if stack is empty, return</span>
<span id="L437" class="LineNr">437 </span> compare i, <span class="Constant">0</span>
<span id="L438" class="LineNr">438 </span> <span class="Delimiter">{</span>
<span id="L439" class="LineNr">439 </span> <span class="PreProc">break-if-&gt;</span>
<span id="L440" class="LineNr">440 </span> <span class="PreProc">return</span> *top-addr
<span id="L441" class="LineNr">441 </span> <span class="Delimiter">}</span>
<span id="L442" class="LineNr">442 </span> <span class="muComment"># scan to matching open paren</span>
<span id="L443" class="LineNr">443 </span> <span class="PreProc">var</span> paren-count/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L444" class="LineNr">444 </span> i <span class="Special">&lt;-</span> decrement
<span id="L445" class="LineNr">445 </span> <span class="Delimiter">{</span>
<span id="L446" class="LineNr">446 </span> compare i, <span class="Constant">0</span>
<span id="L447" class="LineNr">447 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L448" class="LineNr">448 </span> <span class="PreProc">var</span> g/<span class="Constant">esi</span>: (addr grapheme) <span class="Special">&lt;-</span> index data, i
<span id="L449" class="LineNr">449 </span> compare *g, <span class="Constant">0x29</span>/close-paren
<span id="L450" class="LineNr">450 </span> <span class="Delimiter">{</span>
<span id="L451" class="LineNr">451 </span> <span class="PreProc">break-if-!=</span>
<span id="L452" class="LineNr">452 </span> paren-count <span class="Special">&lt;-</span> increment
<span id="L453" class="LineNr">453 </span> <span class="Delimiter">}</span>
<span id="L454" class="LineNr">454 </span> compare *g, <span class="Constant">0x28</span>/open-paren
<span id="L455" class="LineNr">455 </span> <span class="Delimiter">{</span>
<span id="L456" class="LineNr">456 </span> <span class="PreProc">break-if-!=</span>
<span id="L457" class="LineNr">457 </span> compare paren-count, depth
<span id="L458" class="LineNr">458 </span> <span class="Delimiter">{</span>
<span id="L459" class="LineNr">459 </span> <span class="PreProc">break-if-!=</span>
<span id="L460" class="LineNr">460 </span> <span class="PreProc">return</span> i
<span id="L461" class="LineNr">461 </span> <span class="Delimiter">}</span>
<span id="L462" class="LineNr">462 </span> paren-count <span class="Special">&lt;-</span> decrement
<span id="L416" class="LineNr">416 </span> compare *g, <span class="Constant">0x29</span>/close-paren
<span id="L417" class="LineNr">417 </span> <span class="Delimiter">{</span>
<span id="L418" class="LineNr">418 </span> <span class="PreProc">break-if-!=</span>
<span id="L419" class="LineNr">419 </span> compare paren-count, <span class="Constant">1</span>
<span id="L420" class="LineNr">420 </span> <span class="Delimiter">{</span>
<span id="L421" class="LineNr">421 </span> <span class="PreProc">break-if-!=</span>
<span id="L422" class="LineNr">422 </span> <span class="PreProc">return</span> i
<span id="L423" class="LineNr">423 </span> <span class="Delimiter">}</span>
<span id="L424" class="LineNr">424 </span> paren-count <span class="Special">&lt;-</span> decrement
<span id="L425" class="LineNr">425 </span> <span class="Delimiter">}</span>
<span id="L426" class="LineNr">426 </span> i <span class="Special">&lt;-</span> decrement
<span id="L427" class="LineNr">427 </span> <span class="PreProc">loop</span>
<span id="L428" class="LineNr">428 </span> <span class="Delimiter">}</span>
<span id="L429" class="LineNr">429 </span> <span class="PreProc">return</span> *top-addr
<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="muComment"># return the index of the first open-paren at the given depth</span>
<span id="L433" class="LineNr">433 </span><span class="muComment"># or top index if there's no matching close-paren</span>
<span id="L434" class="LineNr">434 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='grapheme-stack.mu.html#L434'>get-matching-open-paren-index</a></span> _self: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>), control: boolean, depth: int<span class="PreProc"> -&gt; </span>_/<span class="Constant">edx</span>: int <span class="Delimiter">{</span>
<span id="L435" class="LineNr">435 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special">&lt;-</span> copy _self
<span id="L436" class="LineNr">436 </span> <span class="PreProc">var</span> top-addr/<span class="Constant">edx</span>: (addr int) <span class="Special">&lt;-</span> get self, top
<span id="L437" class="LineNr">437 </span> <span class="muComment"># if not rendering cursor, return</span>
<span id="L438" class="LineNr">438 </span> compare control, <span class="Constant">0</span>/false
<span id="L439" class="LineNr">439 </span> <span class="Delimiter">{</span>
<span id="L440" class="LineNr">440 </span> <span class="PreProc">break-if-!=</span>
<span id="L441" class="LineNr">441 </span> <span class="PreProc">return</span> *top-addr
<span id="L442" class="LineNr">442 </span> <span class="Delimiter">}</span>
<span id="L443" class="LineNr">443 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">eax</span>: (addr handle array grapheme) <span class="Special">&lt;-</span> get self, data
<span id="L444" class="LineNr">444 </span> <span class="PreProc">var</span> data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L445" class="LineNr">445 </span> <span class="PreProc">var</span> i/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy *top-addr
<span id="L446" class="LineNr">446 </span> <span class="muComment"># if stack is empty, return</span>
<span id="L447" class="LineNr">447 </span> compare i, <span class="Constant">0</span>
<span id="L448" class="LineNr">448 </span> <span class="Delimiter">{</span>
<span id="L449" class="LineNr">449 </span> <span class="PreProc">break-if-&gt;</span>
<span id="L450" class="LineNr">450 </span> <span class="PreProc">return</span> *top-addr
<span id="L451" class="LineNr">451 </span> <span class="Delimiter">}</span>
<span id="L452" class="LineNr">452 </span> <span class="muComment"># scan to matching open paren</span>
<span id="L453" class="LineNr">453 </span> <span class="PreProc">var</span> paren-count/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L454" class="LineNr">454 </span> i <span class="Special">&lt;-</span> decrement
<span id="L455" class="LineNr">455 </span> <span class="Delimiter">{</span>
<span id="L456" class="LineNr">456 </span> compare i, <span class="Constant">0</span>
<span id="L457" class="LineNr">457 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L458" class="LineNr">458 </span> <span class="PreProc">var</span> g/<span class="Constant">esi</span>: (addr grapheme) <span class="Special">&lt;-</span> index data, i
<span id="L459" class="LineNr">459 </span> compare *g, <span class="Constant">0x29</span>/close-paren
<span id="L460" class="LineNr">460 </span> <span class="Delimiter">{</span>
<span id="L461" class="LineNr">461 </span> <span class="PreProc">break-if-!=</span>
<span id="L462" class="LineNr">462 </span> paren-count <span class="Special">&lt;-</span> increment
<span id="L463" class="LineNr">463 </span> <span class="Delimiter">}</span>
<span id="L464" class="LineNr">464 </span> i <span class="Special">&lt;-</span> decrement
<span id="L465" class="LineNr">465 </span> <span class="PreProc">loop</span>
<span id="L466" class="LineNr">466 </span> <span class="Delimiter">}</span>
<span id="L467" class="LineNr">467 </span> <span class="PreProc">return</span> *top-addr
<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="muComment"># compare from bottom</span>
<span id="L471" class="LineNr">471 </span><span class="muComment"># beware: modifies 'stream', which must be disposed of after a false result</span>
<span id="L472" class="LineNr">472 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='grapheme-stack.mu.html#L472'>prefix-match?</a></span> _self: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>), s: (addr stream byte)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean <span class="Delimiter">{</span>
<span id="L473" class="LineNr">473 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special">&lt;-</span> copy _self
<span id="L474" class="LineNr">474 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">edi</span>: (addr handle array grapheme) <span class="Special">&lt;-</span> get self, data
<span id="L475" class="LineNr">475 </span> <span class="PreProc">var</span> _data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L476" class="LineNr">476 </span> <span class="PreProc">var</span> data/<span class="Constant">edi</span>: (addr array grapheme) <span class="Special">&lt;-</span> copy _data
<span id="L477" class="LineNr">477 </span> <span class="PreProc">var</span> top-addr/<span class="Constant">ecx</span>: (addr int) <span class="Special">&lt;-</span> get self, top
<span id="L478" class="LineNr">478 </span> <span class="PreProc">var</span> i/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L479" class="LineNr">479 </span> <span class="Delimiter">{</span>
<span id="L480" class="LineNr">480 </span> compare i, *top-addr
<span id="L481" class="LineNr">481 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L482" class="LineNr">482 </span> <span class="muComment"># if curr != expected, return false</span>
<span id="L483" class="LineNr">483 </span> <span class="Delimiter">{</span>
<span id="L484" class="LineNr">484 </span> <span class="PreProc">var</span> curr-a/<span class="Constant">edx</span>: (addr grapheme) <span class="Special">&lt;-</span> index data, i
<span id="L485" class="LineNr">485 </span> <span class="PreProc">var</span> expected/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> <a href='../403unicode.mu.html#L92'>read-grapheme</a> s
<span id="L486" class="LineNr">486 </span> <span class="Delimiter">{</span>
<span id="L487" class="LineNr">487 </span> compare expected, *curr-a
<span id="L488" class="LineNr">488 </span> <span class="PreProc">break-if-=</span>
<span id="L489" class="LineNr">489 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<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> i <span class="Special">&lt;-</span> increment
<span id="L493" class="LineNr">493 </span> <span class="PreProc">loop</span>
<span id="L494" class="LineNr">494 </span> <span class="Delimiter">}</span>
<span id="L495" class="LineNr">495 </span> <span class="PreProc">return</span> <span class="Constant">1</span> <span class="muComment"># true</span>
<span id="L496" class="LineNr">496 </span><span class="Delimiter">}</span>
<span id="L497" class="LineNr">497 </span>
<span id="L498" class="LineNr">498 </span><span class="muComment"># compare from bottom</span>
<span id="L499" class="LineNr">499 </span><span class="muComment"># beware: modifies 'stream', which must be disposed of after a false result</span>
<span id="L500" class="LineNr">500 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='grapheme-stack.mu.html#L500'>suffix-match?</a></span> _self: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>), s: (addr stream byte)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean <span class="Delimiter">{</span>
<span id="L501" class="LineNr">501 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special">&lt;-</span> copy _self
<span id="L502" class="LineNr">502 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">edi</span>: (addr handle array grapheme) <span class="Special">&lt;-</span> get self, data
<span id="L503" class="LineNr">503 </span> <span class="PreProc">var</span> _data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L504" class="LineNr">504 </span> <span class="PreProc">var</span> data/<span class="Constant">edi</span>: (addr array grapheme) <span class="Special">&lt;-</span> copy _data
<span id="L505" class="LineNr">505 </span> <span class="PreProc">var</span> top-addr/<span class="Constant">eax</span>: (addr int) <span class="Special">&lt;-</span> get self, top
<span id="L506" class="LineNr">506 </span> <span class="PreProc">var</span> i/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy *top-addr
<span id="L507" class="LineNr">507 </span> i <span class="Special">&lt;-</span> decrement
<span id="L508" class="LineNr">508 </span> <span class="Delimiter">{</span>
<span id="L509" class="LineNr">509 </span> compare i, <span class="Constant">0</span>
<span id="L510" class="LineNr">510 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L511" class="LineNr">511 </span> <span class="Delimiter">{</span>
<span id="L512" class="LineNr">512 </span> <span class="PreProc">var</span> curr-a/<span class="Constant">edx</span>: (addr grapheme) <span class="Special">&lt;-</span> index data, i
<span id="L513" class="LineNr">513 </span> <span class="PreProc">var</span> expected/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> <a href='../403unicode.mu.html#L92'>read-grapheme</a> s
<span id="L514" class="LineNr">514 </span> <span class="muComment"># if curr != expected, return false</span>
<span id="L515" class="LineNr">515 </span> <span class="Delimiter">{</span>
<span id="L516" class="LineNr">516 </span> compare expected, *curr-a
<span id="L517" class="LineNr">517 </span> <span class="PreProc">break-if-=</span>
<span id="L518" class="LineNr">518 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L519" class="LineNr">519 </span> <span class="Delimiter">}</span>
<span id="L520" class="LineNr">520 </span> <span class="Delimiter">}</span>
<span id="L521" class="LineNr">521 </span> i <span class="Special">&lt;-</span> decrement
<span id="L522" class="LineNr">522 </span> <span class="PreProc">loop</span>
<span id="L523" class="LineNr">523 </span> <span class="Delimiter">}</span>
<span id="L524" class="LineNr">524 </span> <span class="PreProc">return</span> <span class="Constant">1</span> <span class="muComment"># true</span>
<span id="L525" class="LineNr">525 </span><span class="Delimiter">}</span>
<span id="L526" class="LineNr">526 </span>
<span id="L527" class="LineNr">527 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='grapheme-stack.mu.html#L527'>grapheme-stack-is-decimal-integer?</a></span> _self: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean <span class="Delimiter">{</span>
<span id="L528" class="LineNr">528 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special">&lt;-</span> copy _self
<span id="L529" class="LineNr">529 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">eax</span>: (addr handle array grapheme) <span class="Special">&lt;-</span> get self, data
<span id="L530" class="LineNr">530 </span> <span class="PreProc">var</span> _data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L531" class="LineNr">531 </span> <span class="PreProc">var</span> data/<span class="Constant">edx</span>: (addr array grapheme) <span class="Special">&lt;-</span> copy _data
<span id="L532" class="LineNr">532 </span> <span class="PreProc">var</span> top-addr/<span class="Constant">ecx</span>: (addr int) <span class="Special">&lt;-</span> get self, top
<span id="L533" class="LineNr">533 </span> <span class="PreProc">var</span> i/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L534" class="LineNr">534 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> copy <span class="Constant">1</span>/true
<span id="L535" class="LineNr">535 </span> $grapheme-stack-is-integer?:<span class="PreProc">loop</span>: <span class="Delimiter">{</span>
<span id="L536" class="LineNr">536 </span> compare i, *top-addr
<span id="L537" class="LineNr">537 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L538" class="LineNr">538 </span> <span class="PreProc">var</span> g/<span class="Constant">edx</span>: (addr grapheme) <span class="Special">&lt;-</span> index data, i
<span id="L539" class="LineNr">539 </span> result <span class="Special">&lt;-</span> <a href='../126write-int-decimal.subx.html#L299'>decimal-digit?</a> *g
<span id="L540" class="LineNr">540 </span> compare result, <span class="Constant">0</span>/false
<span id="L541" class="LineNr">541 </span> <span class="PreProc">break-if-=</span>
<span id="L542" class="LineNr">542 </span> i <span class="Special">&lt;-</span> increment
<span id="L543" class="LineNr">543 </span> <span class="PreProc">loop</span>
<span id="L544" class="LineNr">544 </span> <span class="Delimiter">}</span>
<span id="L545" class="LineNr">545 </span> <span class="PreProc">return</span> result
<span id="L546" class="LineNr">546 </span><span class="Delimiter">}</span>
<span id="L464" class="LineNr">464 </span> compare *g, <span class="Constant">0x28</span>/open-paren
<span id="L465" class="LineNr">465 </span> <span class="Delimiter">{</span>
<span id="L466" class="LineNr">466 </span> <span class="PreProc">break-if-!=</span>
<span id="L467" class="LineNr">467 </span> compare paren-count, depth
<span id="L468" class="LineNr">468 </span> <span class="Delimiter">{</span>
<span id="L469" class="LineNr">469 </span> <span class="PreProc">break-if-!=</span>
<span id="L470" class="LineNr">470 </span> <span class="PreProc">return</span> i
<span id="L471" class="LineNr">471 </span> <span class="Delimiter">}</span>
<span id="L472" class="LineNr">472 </span> paren-count <span class="Special">&lt;-</span> decrement
<span id="L473" class="LineNr">473 </span> <span class="Delimiter">}</span>
<span id="L474" class="LineNr">474 </span> i <span class="Special">&lt;-</span> decrement
<span id="L475" class="LineNr">475 </span> <span class="PreProc">loop</span>
<span id="L476" class="LineNr">476 </span> <span class="Delimiter">}</span>
<span id="L477" class="LineNr">477 </span> <span class="PreProc">return</span> *top-addr
<span id="L478" class="LineNr">478 </span><span class="Delimiter">}</span>
<span id="L479" class="LineNr">479 </span>
<span id="L480" class="LineNr">480 </span><span class="muComment"># compare from bottom</span>
<span id="L481" class="LineNr">481 </span><span class="muComment"># beware: modifies 'stream', which must be disposed of after a false result</span>
<span id="L482" class="LineNr">482 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='grapheme-stack.mu.html#L482'>prefix-match?</a></span> _self: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>), s: (addr stream byte)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean <span class="Delimiter">{</span>
<span id="L483" class="LineNr">483 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special">&lt;-</span> copy _self
<span id="L484" class="LineNr">484 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">edi</span>: (addr handle array grapheme) <span class="Special">&lt;-</span> get self, data
<span id="L485" class="LineNr">485 </span> <span class="PreProc">var</span> _data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L486" class="LineNr">486 </span> <span class="PreProc">var</span> data/<span class="Constant">edi</span>: (addr array grapheme) <span class="Special">&lt;-</span> copy _data
<span id="L487" class="LineNr">487 </span> <span class="PreProc">var</span> top-addr/<span class="Constant">ecx</span>: (addr int) <span class="Special">&lt;-</span> get self, top
<span id="L488" class="LineNr">488 </span> <span class="PreProc">var</span> i/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L489" class="LineNr">489 </span> <span class="Delimiter">{</span>
<span id="L490" class="LineNr">490 </span> compare i, *top-addr
<span id="L491" class="LineNr">491 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L492" class="LineNr">492 </span> <span class="muComment"># if curr != expected, return false</span>
<span id="L493" class="LineNr">493 </span> <span class="Delimiter">{</span>
<span id="L494" class="LineNr">494 </span> <span class="PreProc">var</span> curr-a/<span class="Constant">edx</span>: (addr grapheme) <span class="Special">&lt;-</span> index data, i
<span id="L495" class="LineNr">495 </span> <span class="PreProc">var</span> expected/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> <a href='../403unicode.mu.html#L92'>read-grapheme</a> s
<span id="L496" class="LineNr">496 </span> <span class="Delimiter">{</span>
<span id="L497" class="LineNr">497 </span> compare expected, *curr-a
<span id="L498" class="LineNr">498 </span> <span class="PreProc">break-if-=</span>
<span id="L499" class="LineNr">499 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L500" class="LineNr">500 </span> <span class="Delimiter">}</span>
<span id="L501" class="LineNr">501 </span> <span class="Delimiter">}</span>
<span id="L502" class="LineNr">502 </span> i <span class="Special">&lt;-</span> increment
<span id="L503" class="LineNr">503 </span> <span class="PreProc">loop</span>
<span id="L504" class="LineNr">504 </span> <span class="Delimiter">}</span>
<span id="L505" class="LineNr">505 </span> <span class="PreProc">return</span> <span class="Constant">1</span> <span class="muComment"># true</span>
<span id="L506" class="LineNr">506 </span><span class="Delimiter">}</span>
<span id="L507" class="LineNr">507 </span>
<span id="L508" class="LineNr">508 </span><span class="muComment"># compare from bottom</span>
<span id="L509" class="LineNr">509 </span><span class="muComment"># beware: modifies 'stream', which must be disposed of after a false result</span>
<span id="L510" class="LineNr">510 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='grapheme-stack.mu.html#L510'>suffix-match?</a></span> _self: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>), s: (addr stream byte)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean <span class="Delimiter">{</span>
<span id="L511" class="LineNr">511 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special">&lt;-</span> copy _self
<span id="L512" class="LineNr">512 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">edi</span>: (addr handle array grapheme) <span class="Special">&lt;-</span> get self, data
<span id="L513" class="LineNr">513 </span> <span class="PreProc">var</span> _data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L514" class="LineNr">514 </span> <span class="PreProc">var</span> data/<span class="Constant">edi</span>: (addr array grapheme) <span class="Special">&lt;-</span> copy _data
<span id="L515" class="LineNr">515 </span> <span class="PreProc">var</span> top-addr/<span class="Constant">eax</span>: (addr int) <span class="Special">&lt;-</span> get self, top
<span id="L516" class="LineNr">516 </span> <span class="PreProc">var</span> i/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy *top-addr
<span id="L517" class="LineNr">517 </span> i <span class="Special">&lt;-</span> decrement
<span id="L518" class="LineNr">518 </span> <span class="Delimiter">{</span>
<span id="L519" class="LineNr">519 </span> compare i, <span class="Constant">0</span>
<span id="L520" class="LineNr">520 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L521" class="LineNr">521 </span> <span class="Delimiter">{</span>
<span id="L522" class="LineNr">522 </span> <span class="PreProc">var</span> curr-a/<span class="Constant">edx</span>: (addr grapheme) <span class="Special">&lt;-</span> index data, i
<span id="L523" class="LineNr">523 </span> <span class="PreProc">var</span> expected/<span class="Constant">eax</span>: grapheme <span class="Special">&lt;-</span> <a href='../403unicode.mu.html#L92'>read-grapheme</a> s
<span id="L524" class="LineNr">524 </span> <span class="muComment"># if curr != expected, return false</span>
<span id="L525" class="LineNr">525 </span> <span class="Delimiter">{</span>
<span id="L526" class="LineNr">526 </span> compare expected, *curr-a
<span id="L527" class="LineNr">527 </span> <span class="PreProc">break-if-=</span>
<span id="L528" class="LineNr">528 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L529" class="LineNr">529 </span> <span class="Delimiter">}</span>
<span id="L530" class="LineNr">530 </span> <span class="Delimiter">}</span>
<span id="L531" class="LineNr">531 </span> i <span class="Special">&lt;-</span> decrement
<span id="L532" class="LineNr">532 </span> <span class="PreProc">loop</span>
<span id="L533" class="LineNr">533 </span> <span class="Delimiter">}</span>
<span id="L534" class="LineNr">534 </span> <span class="PreProc">return</span> <span class="Constant">1</span> <span class="muComment"># true</span>
<span id="L535" class="LineNr">535 </span><span class="Delimiter">}</span>
<span id="L536" class="LineNr">536 </span>
<span id="L537" class="LineNr">537 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='grapheme-stack.mu.html#L537'>grapheme-stack-is-decimal-integer?</a></span> _self: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>)<span class="PreProc"> -&gt; </span>_/<span class="Constant">eax</span>: boolean <span class="Delimiter">{</span>
<span id="L538" class="LineNr">538 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special">&lt;-</span> copy _self
<span id="L539" class="LineNr">539 </span> <span class="PreProc">var</span> data-ah/<span class="Constant">eax</span>: (addr handle array grapheme) <span class="Special">&lt;-</span> get self, data
<span id="L540" class="LineNr">540 </span> <span class="PreProc">var</span> _data/<span class="Constant">eax</span>: (addr array grapheme) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *data-ah
<span id="L541" class="LineNr">541 </span> <span class="PreProc">var</span> data/<span class="Constant">edx</span>: (addr array grapheme) <span class="Special">&lt;-</span> copy _data
<span id="L542" class="LineNr">542 </span> <span class="PreProc">var</span> top-addr/<span class="Constant">ecx</span>: (addr int) <span class="Special">&lt;-</span> get self, top
<span id="L543" class="LineNr">543 </span> <span class="PreProc">var</span> i/<span class="Constant">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L544" class="LineNr">544 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> copy <span class="Constant">1</span>/true
<span id="L545" class="LineNr">545 </span> $grapheme-stack-is-integer?:<span class="PreProc">loop</span>: <span class="Delimiter">{</span>
<span id="L546" class="LineNr">546 </span> compare i, *top-addr
<span id="L547" class="LineNr">547 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L548" class="LineNr">548 </span> <span class="PreProc">var</span> g/<span class="Constant">edx</span>: (addr grapheme) <span class="Special">&lt;-</span> index data, i
<span id="L549" class="LineNr">549 </span> result <span class="Special">&lt;-</span> <a href='../126write-int-decimal.subx.html#L299'>decimal-digit?</a> *g
<span id="L550" class="LineNr">550 </span> compare result, <span class="Constant">0</span>/false
<span id="L551" class="LineNr">551 </span> <span class="PreProc">break-if-=</span>
<span id="L552" class="LineNr">552 </span> i <span class="Special">&lt;-</span> increment
<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> <span class="PreProc">return</span> result
<span id="L556" class="LineNr">556 </span><span class="Delimiter">}</span>
</pre>
</body>
</html>

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

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

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

@ -100,12 +100,12 @@ if ('onhashchange' in window) {
<span id="L42" class="LineNr"> 42 </span> <a href='../309stream.subx.html#L107'>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#L576'>quote-token?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='tokenize.mu.html#L576'>quote-token?</a> curr-token
<span id="L46" class="LineNr"> 46 </span> compare <a href='tokenize.mu.html#L576'>quote-token?</a>, <span class="Constant">0</span>/false
<span id="L45" class="LineNr"> 45 </span> <span class="PreProc">var</span> <a href='tokenize.mu.html#L705'>quote-token?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='tokenize.mu.html#L705'>quote-token?</a> curr-token
<span id="L46" class="LineNr"> 46 </span> compare <a href='tokenize.mu.html#L705'>quote-token?</a>, <span class="Constant">0</span>/false
<span id="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#L87'>allocate-pair</a> out
<span id="L50" class="LineNr"> 50 </span> <a href='cell.mu.html#L101'>allocate-pair</a> out
<span id="L51" class="LineNr"> 51 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *out
<span id="L52" class="LineNr"> 52 </span> <span class="PreProc">var</span> left-ah/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get out-addr, left
<span id="L53" class="LineNr"> 53 </span> <a href='cell.mu.html#L38'>new-symbol</a> left-ah, <span class="Constant">&quot;'&quot;</span>
@ -116,7 +116,7 @@ if ('onhashchange' in window) {
<span id="L58" class="LineNr"> 58 </span> <span class="PreProc">return</span> close-paren?, dot?
<span id="L59" class="LineNr"> 59 </span> <span class="Delimiter">}</span>
<span id="L60" class="LineNr"> 60 </span> <span class="muComment"># dot -&gt; return</span>
<span id="L61" class="LineNr"> 61 </span> <span class="PreProc">var</span> dot?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='tokenize.mu.html#L622'>dot-token?</a> curr-token
<span id="L61" class="LineNr"> 61 </span> <span class="PreProc">var</span> dot?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='tokenize.mu.html#L751'>dot-token?</a> curr-token
<span id="L62" class="LineNr"> 62 </span> compare dot?, <span class="Constant">0</span>/false
<span id="L63" class="LineNr"> 63 </span> <span class="Delimiter">{</span>
<span id="L64" class="LineNr"> 64 </span> <span class="PreProc">break-if-=</span>
@ -124,20 +124,20 @@ if ('onhashchange' in window) {
<span id="L66" class="LineNr"> 66 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false, <span class="Constant">1</span>/true
<span id="L67" class="LineNr"> 67 </span> <span class="Delimiter">}</span>
<span id="L68" class="LineNr"> 68 </span> <span class="muComment"># not bracket -&gt; parse atom</span>
<span id="L69" class="LineNr"> 69 </span> <span class="PreProc">var</span> <a href='tokenize.mu.html#L566'>bracket-token?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='tokenize.mu.html#L566'>bracket-token?</a> curr-token
<span id="L70" class="LineNr"> 70 </span> compare <a href='tokenize.mu.html#L566'>bracket-token?</a>, <span class="Constant">0</span>/false
<span id="L69" class="LineNr"> 69 </span> <span class="PreProc">var</span> <a href='tokenize.mu.html#L688'>bracket-token?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='tokenize.mu.html#L688'>bracket-token?</a> curr-token
<span id="L70" class="LineNr"> 70 </span> compare <a href='tokenize.mu.html#L688'>bracket-token?</a>, <span class="Constant">0</span>/false
<span id="L71" class="LineNr"> 71 </span> <span class="Delimiter">{</span>
<span id="L72" class="LineNr"> 72 </span> <span class="PreProc">break-if-!=</span>
<span id="L73" class="LineNr"> 73 </span> <a href='parse.mu.html#L148'>parse-atom</a> curr-token, _out, trace
<span id="L74" class="LineNr"> 74 </span> <span class="PreProc">break</span> $parse-sexpression:type-check
<span id="L75" class="LineNr"> 75 </span> <span class="Delimiter">}</span>
<span id="L76" class="LineNr"> 76 </span> <span class="muComment"># open paren -&gt; parse list</span>
<span id="L77" class="LineNr"> 77 </span> <span class="PreProc">var</span> open-paren?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='tokenize.mu.html#L590'>open-paren-token?</a> curr-token
<span id="L77" class="LineNr"> 77 </span> <span class="PreProc">var</span> open-paren?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='tokenize.mu.html#L719'>open-paren-token?</a> curr-token
<span id="L78" class="LineNr"> 78 </span> compare open-paren?, <span class="Constant">0</span>/false
<span id="L79" class="LineNr"> 79 </span> <span class="Delimiter">{</span>
<span id="L80" class="LineNr"> 80 </span> <span class="PreProc">break-if-=</span>
<span id="L81" class="LineNr"> 81 </span> <span class="PreProc">var</span> curr/<span class="Constant">esi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L82" class="LineNr"> 82 </span> <a href='cell.mu.html#L87'>allocate-pair</a> curr
<span id="L82" class="LineNr"> 82 </span> <a href='cell.mu.html#L101'>allocate-pair</a> curr
<span id="L83" class="LineNr"> 83 </span> <span class="PreProc">var</span> curr-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *curr
<span id="L84" class="LineNr"> 84 </span> <span class="PreProc">var</span> left/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> get curr-addr, left
<span id="L85" class="LineNr"> 85 </span> <span class="Delimiter">{</span>
@ -164,10 +164,10 @@ if ('onhashchange' in window) {
<span id="L106" class="LineNr">106 </span> compare dot?, <span class="Constant">0</span>/false
<span id="L107" class="LineNr">107 </span> <span class="Delimiter">{</span>
<span id="L108" class="LineNr">108 </span> <span class="PreProc">break-if-=</span>
<span id="L109" class="LineNr">109 </span> <a href='parse.mu.html#L195'>parse-dot-tail</a> tokens, curr, trace
<span id="L109" class="LineNr">109 </span> <a href='parse.mu.html#L206'>parse-dot-tail</a> tokens, curr, trace
<span id="L110" class="LineNr">110 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false, <span class="Constant">0</span>/false
<span id="L111" class="LineNr">111 </span> <span class="Delimiter">}</span>
<span id="L112" class="LineNr">112 </span> <a href='cell.mu.html#L87'>allocate-pair</a> curr
<span id="L112" class="LineNr">112 </span> <a href='cell.mu.html#L101'>allocate-pair</a> curr
<span id="L113" class="LineNr">113 </span> <span class="muComment"># ')' -&gt; return</span>
<span id="L114" class="LineNr">114 </span> compare close-paren?, <span class="Constant">0</span>/false
<span id="L115" class="LineNr">115 </span> <span class="PreProc">break-if-!=</span>
@ -182,7 +182,7 @@ if ('onhashchange' in window) {
<span id="L124" class="LineNr">124 </span> <span class="PreProc">break</span> $parse-sexpression:type-check
<span id="L125" class="LineNr">125 </span> <span class="Delimiter">}</span>
<span id="L126" class="LineNr">126 </span> <span class="muComment"># close paren -&gt; return</span>
<span id="L127" class="LineNr">127 </span> <span class="PreProc">var</span> close-paren?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='tokenize.mu.html#L606'>close-paren-token?</a> curr-token
<span id="L127" class="LineNr">127 </span> <span class="PreProc">var</span> close-paren?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='tokenize.mu.html#L735'>close-paren-token?</a> curr-token
<span id="L128" class="LineNr">128 </span> compare close-paren?, <span class="Constant">0</span>/false
<span id="L129" class="LineNr">129 </span> <span class="Delimiter">{</span>
<span id="L130" class="LineNr">130 </span> <span class="PreProc">break-if-=</span>
@ -211,15 +211,15 @@ if ('onhashchange' in window) {
<span id="L153" class="LineNr">153 </span> <span class="PreProc">var</span> curr-token-data/<span class="Constant">esi</span>: (addr stream byte) <span class="Special">&lt;-</span> copy _curr-token-data
<span id="L154" class="LineNr">154 </span> trace trace, <span class="Constant">&quot;read&quot;</span>, curr-token-data
<span id="L155" class="LineNr">155 </span> <span class="muComment"># number</span>
<span id="L156" class="LineNr">156 </span> <span class="PreProc">var</span> <a href='tokenize.mu.html#L556'>number-token?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='tokenize.mu.html#L556'>number-token?</a> curr-token
<span id="L157" class="LineNr">157 </span> compare <a href='tokenize.mu.html#L556'>number-token?</a>, <span class="Constant">0</span>/false
<span id="L156" class="LineNr">156 </span> <span class="PreProc">var</span> <a href='tokenize.mu.html#L678'>number-token?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='tokenize.mu.html#L678'>number-token?</a> curr-token
<span id="L157" class="LineNr">157 </span> compare <a href='tokenize.mu.html#L678'>number-token?</a>, <span class="Constant">0</span>/false
<span id="L158" class="LineNr">158 </span> <span class="Delimiter">{</span>
<span id="L159" class="LineNr">159 </span> <span class="PreProc">break-if-=</span>
<span id="L160" class="LineNr">160 </span> <a href='../106stream.subx.html#L59'>rewind-stream</a> curr-token-data
<span id="L161" class="LineNr">161 </span> <span class="PreProc">var</span> _val/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> <a href='../311decimal-int.subx.html#L48'>parse-decimal-int-from-stream</a> curr-token-data
<span id="L162" class="LineNr">162 </span> <span class="PreProc">var</span> val/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy _val
<span id="L163" class="LineNr">163 </span> <span class="PreProc">var</span> val-float/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> convert val
<span id="L164" class="LineNr">164 </span> <a href='cell.mu.html#L53'>allocate-number</a> _out
<span id="L164" class="LineNr">164 </span> <a href='cell.mu.html#L67'>allocate-number</a> _out
<span id="L165" class="LineNr">165 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L166" class="LineNr">166 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *out
<span id="L167" class="LineNr">167 </span> <span class="PreProc">var</span> dest/<span class="Constant">edi</span>: (addr float) <span class="Special">&lt;-</span> get out-addr, number-data
@ -233,57 +233,68 @@ if ('onhashchange' in window) {
<span id="L175" class="LineNr">175 </span> <span class="Delimiter">}</span>
<span id="L176" class="LineNr">176 </span> <span class="PreProc">return</span>
<span id="L177" class="LineNr">177 </span> <span class="Delimiter">}</span>
<span id="L178" class="LineNr">178 </span> <span class="muComment"># default: symbol</span>
<span id="L179" class="LineNr">179 </span> <span class="muComment"># just copy token data</span>
<span id="L180" class="LineNr">180 </span> <a href='cell.mu.html#L20'>allocate-symbol</a> _out
<span id="L181" class="LineNr">181 </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="L182" class="LineNr">182 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *out
<span id="L183" class="LineNr">183 </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="L184" class="LineNr">184 </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="L185" class="LineNr">185 </span> copy-object curr-token-data-ah, dest-ah
<span id="L186" class="LineNr">186 </span> <span class="Delimiter">{</span>
<span id="L187" class="LineNr">187 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x40</span>)
<span id="L188" class="LineNr">188 </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="L189" class="LineNr">189 </span> <a href='../108write.subx.html#L11'>write</a> stream, <span class="Constant">&quot;=&gt; symbol &quot;</span>
<span id="L190" class="LineNr">190 </span> <a href='print.mu.html#L101'>print-symbol</a> out-addr, stream, <span class="Constant">0</span>/no-trace
<span id="L191" class="LineNr">191 </span> trace trace, <span class="Constant">&quot;read&quot;</span>, stream
<span id="L192" class="LineNr">192 </span> <span class="Delimiter">}</span>
<span id="L193" class="LineNr">193 </span><span class="Delimiter">}</span>
<span id="L194" class="LineNr">194 </span>
<span id="L195" class="LineNr">195 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='parse.mu.html#L195'>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="L196" class="LineNr">196 </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="L197" class="LineNr">197 </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="L198" class="LineNr">198 </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="L199" class="LineNr">199 </span> close-paren?, dot? <span class="Special">&lt;-</span> <a href='parse.mu.html#L30'>parse-sexpression</a> tokens, out, trace
<span id="L200" class="LineNr">200 </span> compare close-paren?, <span class="Constant">0</span>/false
<span id="L201" class="LineNr">201 </span> <span class="Delimiter">{</span>
<span id="L202" class="LineNr">202 </span> <span class="PreProc">break-if-=</span>
<span id="L203" class="LineNr">203 </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="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> compare dot?, <span class="Constant">0</span>/false
<span id="L207" class="LineNr">207 </span> <span class="Delimiter">{</span>
<span id="L208" class="LineNr">208 </span> <span class="PreProc">break-if-=</span>
<span id="L209" class="LineNr">209 </span> <span class="Special"><a href='trace.mu.html#L129'>error</a></span> trace, <span class="Constant">&quot;'. .' makes no sense&quot;</span>
<span id="L210" class="LineNr">210 </span> <span class="PreProc">return</span>
<span id="L211" class="LineNr">211 </span> <span class="Delimiter">}</span>
<span id="L212" class="LineNr">212 </span> <span class="muComment">#</span>
<span id="L213" class="LineNr">213 </span> <span class="PreProc">var</span> dummy: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L214" class="LineNr">214 </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="L215" class="LineNr">215 </span> close-paren?, dot? <span class="Special">&lt;-</span> <a href='parse.mu.html#L30'>parse-sexpression</a> tokens, dummy-ah, trace
<span id="L216" class="LineNr">216 </span> compare close-paren?, <span class="Constant">0</span>/false
<span id="L217" class="LineNr">217 </span> <span class="Delimiter">{</span>
<span id="L218" class="LineNr">218 </span> <span class="PreProc">break-if-!=</span>
<span id="L219" class="LineNr">219 </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="L220" class="LineNr">220 </span> <span class="PreProc">return</span>
<span id="L221" class="LineNr">221 </span> <span class="Delimiter">}</span>
<span id="L222" class="LineNr">222 </span> compare dot?, <span class="Constant">0</span>/false
<span id="L223" class="LineNr">223 </span> <span class="Delimiter">{</span>
<span id="L224" class="LineNr">224 </span> <span class="PreProc">break-if-=</span>
<span id="L225" class="LineNr">225 </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="L226" class="LineNr">226 </span> <span class="PreProc">return</span>
<span id="L227" class="LineNr">227 </span> <span class="Delimiter">}</span>
<span id="L228" class="LineNr">228 </span><span class="Delimiter">}</span>
<span id="L178" class="LineNr">178 </span> <span class="muComment"># default: copy either to a symbol or a stream</span>
<span id="L179" class="LineNr">179 </span> <span class="muComment"># stream token -&gt; literal</span>
<span id="L180" class="LineNr">180 </span> <span class="PreProc">var</span> <a href='tokenize.mu.html#L776'>stream-token?</a>/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> <a href='tokenize.mu.html#L776'>stream-token?</a> curr-token
<span id="L181" class="LineNr">181 </span> compare <a href='tokenize.mu.html#L776'>stream-token?</a>, <span class="Constant">0</span>/false
<span id="L182" class="LineNr">182 </span> <span class="Delimiter">{</span>
<span id="L183" class="LineNr">183 </span> <span class="PreProc">break-if-=</span>
<span id="L184" class="LineNr">184 </span> <a href='cell.mu.html#L57'>allocate-stream</a> _out
<span id="L185" class="LineNr">185 </span> <span class="Delimiter">}</span>
<span id="L186" class="LineNr">186 </span> compare <a href='tokenize.mu.html#L776'>stream-token?</a>, <span class="Constant">0</span>/false
<span id="L187" class="LineNr">187 </span> <span class="Delimiter">{</span>
<span id="L188" class="LineNr">188 </span> <span class="PreProc">break-if-!=</span>
<span id="L189" class="LineNr">189 </span> <a href='cell.mu.html#L20'>allocate-symbol</a> _out
<span id="L190" class="LineNr">190 </span> <span class="Delimiter">}</span>
<span id="L191" class="LineNr">191 </span> <span class="muComment"># copy token data</span>
<span id="L192" class="LineNr">192 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L193" class="LineNr">193 </span> <span class="PreProc">var</span> out-addr/<span class="Constant">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *out
<span id="L194" class="LineNr">194 </span> <span class="PreProc">var</span> curr-token-data-ah/<span class="Constant">ecx</span>: (addr handle stream byte) <span class="Special">&lt;-</span> get curr-token, text-data
<span id="L195" class="LineNr">195 </span> <span class="PreProc">var</span> dest-ah/<span class="Constant">edx</span>: (addr handle stream byte) <span class="Special">&lt;-</span> get out-addr, text-data
<span id="L196" class="LineNr">196 </span> copy-object curr-token-data-ah, dest-ah
<span id="L197" class="LineNr">197 </span> <span class="Delimiter">{</span>
<span id="L198" class="LineNr">198 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x40</span>)
<span id="L199" class="LineNr">199 </span> <span class="PreProc">var</span> stream/<span class="Constant">ecx</span>: (addr stream byte) <span class="Special">&lt;-</span> address stream-storage
<span id="L200" class="LineNr">200 </span> <a href='../108write.subx.html#L11'>write</a> stream, <span class="Constant">&quot;=&gt; symbol &quot;</span>
<span id="L201" class="LineNr">201 </span> <a href='print.mu.html#L101'>print-symbol</a> out-addr, stream, <span class="Constant">0</span>/no-trace
<span id="L202" class="LineNr">202 </span> trace trace, <span class="Constant">&quot;read&quot;</span>, stream
<span id="L203" class="LineNr">203 </span> <span class="Delimiter">}</span>
<span id="L204" class="LineNr">204 </span><span class="Delimiter">}</span>
<span id="L205" class="LineNr">205 </span>
<span id="L206" class="LineNr">206 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='parse.mu.html#L206'>parse-dot-tail</a></span> tokens: (addr stream <a href='cell.mu.html#L1'>cell</a>), _out: (addr handle <a href='cell.mu.html#L1'>cell</a>), trace: (addr trace) <span class="Delimiter">{</span>
<span id="L207" class="LineNr">207 </span> <span class="PreProc">var</span> out/<span class="Constant">edi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> copy _out
<span id="L208" class="LineNr">208 </span> <span class="PreProc">var</span> close-paren?/<span class="Constant">eax</span>: boolean <span class="Special">&lt;-</span> copy <span class="Constant">0</span>/false
<span id="L209" class="LineNr">209 </span> <span class="PreProc">var</span> dot?/<span class="Constant">ecx</span>: boolean <span class="Special">&lt;-</span> copy <span class="Constant">0</span>/false
<span id="L210" class="LineNr">210 </span> close-paren?, dot? <span class="Special">&lt;-</span> <a href='parse.mu.html#L30'>parse-sexpression</a> tokens, out, trace
<span id="L211" class="LineNr">211 </span> compare close-paren?, <span class="Constant">0</span>/false
<span id="L212" class="LineNr">212 </span> <span class="Delimiter">{</span>
<span id="L213" class="LineNr">213 </span> <span class="PreProc">break-if-=</span>
<span id="L214" class="LineNr">214 </span> <span class="Special"><a href='trace.mu.html#L129'>error</a></span> trace, <span class="Constant">&quot;'. )' makes no sense&quot;</span>
<span id="L215" class="LineNr">215 </span> <span class="PreProc">return</span>
<span id="L216" class="LineNr">216 </span> <span class="Delimiter">}</span>
<span id="L217" class="LineNr">217 </span> compare dot?, <span class="Constant">0</span>/false
<span id="L218" class="LineNr">218 </span> <span class="Delimiter">{</span>
<span id="L219" class="LineNr">219 </span> <span class="PreProc">break-if-=</span>
<span id="L220" class="LineNr">220 </span> <span class="Special"><a href='trace.mu.html#L129'>error</a></span> trace, <span class="Constant">&quot;'. .' makes no sense&quot;</span>
<span id="L221" class="LineNr">221 </span> <span class="PreProc">return</span>
<span id="L222" class="LineNr">222 </span> <span class="Delimiter">}</span>
<span id="L223" class="LineNr">223 </span> <span class="muComment">#</span>
<span id="L224" class="LineNr">224 </span> <span class="PreProc">var</span> dummy: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L225" class="LineNr">225 </span> <span class="PreProc">var</span> dummy-ah/<span class="Constant">edi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address dummy
<span id="L226" class="LineNr">226 </span> close-paren?, dot? <span class="Special">&lt;-</span> <a href='parse.mu.html#L30'>parse-sexpression</a> tokens, dummy-ah, trace
<span id="L227" class="LineNr">227 </span> compare close-paren?, <span class="Constant">0</span>/false
<span id="L228" class="LineNr">228 </span> <span class="Delimiter">{</span>
<span id="L229" class="LineNr">229 </span> <span class="PreProc">break-if-!=</span>
<span id="L230" class="LineNr">230 </span> <span class="Special"><a href='trace.mu.html#L129'>error</a></span> trace, <span class="Constant">&quot;cannot have multiple expressions between '.' and ')'&quot;</span>
<span id="L231" class="LineNr">231 </span> <span class="PreProc">return</span>
<span id="L232" class="LineNr">232 </span> <span class="Delimiter">}</span>
<span id="L233" class="LineNr">233 </span> compare dot?, <span class="Constant">0</span>/false
<span id="L234" class="LineNr">234 </span> <span class="Delimiter">{</span>
<span id="L235" class="LineNr">235 </span> <span class="PreProc">break-if-=</span>
<span id="L236" class="LineNr">236 </span> <span class="Special"><a href='trace.mu.html#L129'>error</a></span> trace, <span class="Constant">&quot;cannot have two dots in a single list&quot;</span>
<span id="L237" class="LineNr">237 </span> <span class="PreProc">return</span>
<span id="L238" class="LineNr">238 </span> <span class="Delimiter">}</span>
<span id="L239" class="LineNr">239 </span><span class="Delimiter">}</span>
</pre>
</body>
</html>

View File

@ -147,14 +147,14 @@ if ('onhashchange' in window) {
<span id="L88" class="LineNr"> 88 </span> <a href='print.mu.html#L1'>print-cell</a> in-ah, stream, <span class="Constant">0</span>/no-trace
<span id="L89" class="LineNr"> 89 </span> <span class="PreProc">var</span> d1/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L90" class="LineNr"> 90 </span> <span class="PreProc">var</span> d2/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L91" class="LineNr"> 91 </span> d1, d2 <span class="Special">&lt;-</span> <a href='../501draw-text.mu.html#L181'>draw-stream-wrapping-right-then-down</a> <span class="Constant">0</span>/screen, stream, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, <span class="Constant">0x80</span>/xmax, <span class="Constant">0x30</span>/ymax, <span class="Constant">0</span>/x, <span class="Constant">0</span>/y, <span class="Constant">7</span>/fg, <span class="Constant">0</span>/bg
<span id="L91" class="LineNr"> 91 </span> d1, d2 <span class="Special">&lt;-</span> <a href='../501draw-text.mu.html#L181'>draw-stream-wrapping-right-then-down</a> <span class="Constant">0</span>/screen, stream, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, <span class="Constant">0x80</span>/xmax, <span class="Constant">0x30</span>/ymax, <span class="Constant">0</span>/x, <span class="Constant">0</span>/y, <span class="Constant">7</span>/fg, <span class="Constant">0xc5</span>/bg=blue-bg
<span id="L92" class="LineNr"> 92 </span><span class="Delimiter">}</span>
<span id="L93" class="LineNr"> 93 </span>
<span id="L94" class="LineNr"> 94 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='print.mu.html#L94'>dump-cell-from-cursor-over-full-screen</a></span> in-ah: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Delimiter">{</span>
<span id="L95" class="LineNr"> 95 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x200</span>)
<span id="L96" class="LineNr"> 96 </span> <span class="PreProc">var</span> stream/<span class="Constant">edx</span>: (addr stream byte) <span class="Special">&lt;-</span> address stream-storage
<span id="L97" class="LineNr"> 97 </span> <a href='print.mu.html#L1'>print-cell</a> in-ah, stream, <span class="Constant">0</span>/no-trace
<span id="L98" class="LineNr"> 98 </span> <a href='../501draw-text.mu.html#L214'>draw-stream-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, stream, <span class="Constant">7</span>/fg, <span class="Constant">0</span>/bg
<span id="L98" class="LineNr"> 98 </span> <a href='../501draw-text.mu.html#L214'>draw-stream-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, stream, <span class="Constant">7</span>/fg, <span class="Constant">0xc5</span>/bg=blue-bg
<span id="L99" class="LineNr"> 99 </span><span class="Delimiter">}</span>
<span id="L100" class="LineNr">100 </span>
<span id="L101" class="LineNr">101 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='print.mu.html#L101'>print-symbol</a></span> _in: (addr <a href='cell.mu.html#L1'>cell</a>), out: (addr stream byte), trace: (addr trace) <span class="Delimiter">{</span>
@ -281,7 +281,7 @@ if ('onhashchange' in window) {
<span id="L222" class="LineNr">222 </span><span class="PreProc">fn</span> <span class="muTest"><a href='print.mu.html#L222'>test-print-cell-zero</a></span> <span class="Delimiter">{</span>
<span id="L223" class="LineNr">223 </span> <span class="PreProc">var</span> num-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L224" class="LineNr">224 </span> <span class="PreProc">var</span> num/<span class="Constant">esi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address num-storage
<span id="L225" class="LineNr">225 </span> <a href='cell.mu.html#L69'>new-integer</a> num, <span class="Constant">0</span>
<span id="L225" class="LineNr">225 </span> <a href='cell.mu.html#L83'>new-integer</a> num, <span class="Constant">0</span>
<span id="L226" class="LineNr">226 </span> <span class="PreProc">var</span> out-storage: (stream byte <span class="Constant">0x40</span>)
<span id="L227" class="LineNr">227 </span> <span class="PreProc">var</span> out/<span class="Constant">edi</span>: (addr stream byte) <span class="Special">&lt;-</span> address out-storage
<span id="L228" class="LineNr">228 </span> <a href='print.mu.html#L1'>print-cell</a> num, out, <span class="Constant">0</span>/no-trace
@ -291,7 +291,7 @@ if ('onhashchange' in window) {
<span id="L232" class="LineNr">232 </span><span class="PreProc">fn</span> <span class="muTest"><a href='print.mu.html#L232'>test-print-cell-integer</a></span> <span class="Delimiter">{</span>
<span id="L233" class="LineNr">233 </span> <span class="PreProc">var</span> num-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L234" class="LineNr">234 </span> <span class="PreProc">var</span> num/<span class="Constant">esi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address num-storage
<span id="L235" class="LineNr">235 </span> <a href='cell.mu.html#L69'>new-integer</a> num, <span class="Constant">1</span>
<span id="L235" class="LineNr">235 </span> <a href='cell.mu.html#L83'>new-integer</a> num, <span class="Constant">1</span>
<span id="L236" class="LineNr">236 </span> <span class="PreProc">var</span> out-storage: (stream byte <span class="Constant">0x40</span>)
<span id="L237" class="LineNr">237 </span> <span class="PreProc">var</span> out/<span class="Constant">edi</span>: (addr stream byte) <span class="Special">&lt;-</span> address out-storage
<span id="L238" class="LineNr">238 </span> <a href='print.mu.html#L1'>print-cell</a> num, out, <span class="Constant">0</span>/no-trace
@ -301,7 +301,7 @@ if ('onhashchange' in window) {
<span id="L242" class="LineNr">242 </span><span class="PreProc">fn</span> <span class="muTest"><a href='print.mu.html#L242'>test-print-cell-integer-2</a></span> <span class="Delimiter">{</span>
<span id="L243" class="LineNr">243 </span> <span class="PreProc">var</span> num-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L244" class="LineNr">244 </span> <span class="PreProc">var</span> num/<span class="Constant">esi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address num-storage
<span id="L245" class="LineNr">245 </span> <a href='cell.mu.html#L69'>new-integer</a> num, <span class="Constant">0x30</span>
<span id="L245" class="LineNr">245 </span> <a href='cell.mu.html#L83'>new-integer</a> num, <span class="Constant">0x30</span>
<span id="L246" class="LineNr">246 </span> <span class="PreProc">var</span> out-storage: (stream byte <span class="Constant">0x40</span>)
<span id="L247" class="LineNr">247 </span> <span class="PreProc">var</span> out/<span class="Constant">edi</span>: (addr stream byte) <span class="Special">&lt;-</span> address out-storage
<span id="L248" class="LineNr">248 </span> <a href='print.mu.html#L1'>print-cell</a> num, out, <span class="Constant">0</span>/no-trace
@ -312,7 +312,7 @@ if ('onhashchange' in window) {
<span id="L253" class="LineNr">253 </span> <span class="PreProc">var</span> num-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L254" class="LineNr">254 </span> <span class="PreProc">var</span> num/<span class="Constant">esi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address num-storage
<span id="L255" class="LineNr">255 </span> <span class="PreProc">var</span> val/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> <a href='../408float.mu.html#L18'>rational</a> <span class="Constant">1</span>, <span class="Constant">2</span>
<span id="L256" class="LineNr">256 </span> <a href='cell.mu.html#L82'>new-float</a> num, val
<span id="L256" class="LineNr">256 </span> <a href='cell.mu.html#L96'>new-float</a> num, val
<span id="L257" class="LineNr">257 </span> <span class="PreProc">var</span> out-storage: (stream byte <span class="Constant">0x40</span>)
<span id="L258" class="LineNr">258 </span> <span class="PreProc">var</span> out/<span class="Constant">edi</span>: (addr stream byte) <span class="Special">&lt;-</span> address out-storage
<span id="L259" class="LineNr">259 </span> <a href='print.mu.html#L1'>print-cell</a> num, out, <span class="Constant">0</span>/no-trace
@ -331,11 +331,11 @@ if ('onhashchange' in window) {
<span id="L272" class="LineNr">272 </span>
<span id="L273" class="LineNr">273 </span><span class="PreProc">fn</span> <span class="muTest"><a href='print.mu.html#L273'>test-print-cell-nil-list</a></span> <span class="Delimiter">{</span>
<span id="L274" class="LineNr">274 </span> <span class="PreProc">var</span> nil-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L275" class="LineNr">275 </span> <span class="PreProc">var</span> <a href='cell.mu.html#L106'>nil</a>/<span class="Constant">esi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address nil-storage
<span id="L276" class="LineNr">276 </span> <a href='cell.mu.html#L87'>allocate-pair</a> <a href='cell.mu.html#L106'>nil</a>
<span id="L275" class="LineNr">275 </span> <span class="PreProc">var</span> <a href='cell.mu.html#L120'>nil</a>/<span class="Constant">esi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address nil-storage
<span id="L276" class="LineNr">276 </span> <a href='cell.mu.html#L101'>allocate-pair</a> <a href='cell.mu.html#L120'>nil</a>
<span id="L277" class="LineNr">277 </span> <span class="PreProc">var</span> out-storage: (stream byte <span class="Constant">0x40</span>)
<span id="L278" class="LineNr">278 </span> <span class="PreProc">var</span> out/<span class="Constant">edi</span>: (addr stream byte) <span class="Special">&lt;-</span> address out-storage
<span id="L279" class="LineNr">279 </span> <a href='print.mu.html#L1'>print-cell</a> <a href='cell.mu.html#L106'>nil</a>, out, <span class="Constant">0</span>/no-trace
<span id="L279" class="LineNr">279 </span> <a href='print.mu.html#L1'>print-cell</a> <a href='cell.mu.html#L120'>nil</a>, out, <span class="Constant">0</span>/no-trace
<span id="L280" class="LineNr">280 </span> <a href='../109stream-equal.subx.html#L194'>check-stream-equal</a> out, <span class="Constant">&quot;()&quot;</span>, <span class="Constant">&quot;F - test-print-cell-nil-list&quot;</span>
<span id="L281" class="LineNr">281 </span><span class="Delimiter">}</span>
<span id="L282" class="LineNr">282 </span>
@ -345,11 +345,11 @@ if ('onhashchange' in window) {
<span id="L286" class="LineNr">286 </span> <span class="PreProc">var</span> left/<span class="Constant">ecx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address left-storage
<span id="L287" class="LineNr">287 </span> <a href='cell.mu.html#L38'>new-symbol</a> left, <span class="Constant">&quot;abc&quot;</span>
<span id="L288" class="LineNr">288 </span> <span class="PreProc">var</span> nil-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L289" class="LineNr">289 </span> <span class="PreProc">var</span> <a href='cell.mu.html#L106'>nil</a>/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address nil-storage
<span id="L290" class="LineNr">290 </span> <a href='cell.mu.html#L87'>allocate-pair</a> <a href='cell.mu.html#L106'>nil</a>
<span id="L289" class="LineNr">289 </span> <span class="PreProc">var</span> <a href='cell.mu.html#L120'>nil</a>/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address nil-storage
<span id="L290" class="LineNr">290 </span> <a href='cell.mu.html#L101'>allocate-pair</a> <a href='cell.mu.html#L120'>nil</a>
<span id="L291" class="LineNr">291 </span> <span class="PreProc">var</span> list-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L292" class="LineNr">292 </span> <span class="PreProc">var</span> list/<span class="Constant">esi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address list-storage
<span id="L293" class="LineNr">293 </span> <a href='cell.mu.html#L101'>new-pair</a> list, *left, *nil
<span id="L293" class="LineNr">293 </span> <a href='cell.mu.html#L115'>new-pair</a> list, *left, *nil
<span id="L294" class="LineNr">294 </span> <span class="muComment">#</span>
<span id="L295" class="LineNr">295 </span> <span class="PreProc">var</span> out-storage: (stream byte <span class="Constant">0x40</span>)
<span id="L296" class="LineNr">296 </span> <span class="PreProc">var</span> out/<span class="Constant">edi</span>: (addr stream byte) <span class="Special">&lt;-</span> address out-storage
@ -363,14 +363,14 @@ if ('onhashchange' in window) {
<span id="L304" class="LineNr">304 </span> <span class="PreProc">var</span> left/<span class="Constant">ecx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address left-storage
<span id="L305" class="LineNr">305 </span> <a href='cell.mu.html#L38'>new-symbol</a> left, <span class="Constant">&quot;abc&quot;</span>
<span id="L306" class="LineNr">306 </span> <span class="PreProc">var</span> nil-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L307" class="LineNr">307 </span> <span class="PreProc">var</span> <a href='cell.mu.html#L106'>nil</a>/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address nil-storage
<span id="L308" class="LineNr">308 </span> <a href='cell.mu.html#L87'>allocate-pair</a> <a href='cell.mu.html#L106'>nil</a>
<span id="L307" class="LineNr">307 </span> <span class="PreProc">var</span> <a href='cell.mu.html#L120'>nil</a>/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address nil-storage
<span id="L308" class="LineNr">308 </span> <a href='cell.mu.html#L101'>allocate-pair</a> <a href='cell.mu.html#L120'>nil</a>
<span id="L309" class="LineNr">309 </span> <span class="PreProc">var</span> list-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L310" class="LineNr">310 </span> <span class="PreProc">var</span> list/<span class="Constant">esi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address list-storage
<span id="L311" class="LineNr">311 </span> <a href='cell.mu.html#L101'>new-pair</a> list, *left, *nil
<span id="L311" class="LineNr">311 </span> <a href='cell.mu.html#L115'>new-pair</a> list, *left, *nil
<span id="L312" class="LineNr">312 </span> <span class="muComment"># list = cons 64, list</span>
<span id="L313" class="LineNr">313 </span> <a href='cell.mu.html#L69'>new-integer</a> left, <span class="Constant">0x40</span>
<span id="L314" class="LineNr">314 </span> <a href='cell.mu.html#L101'>new-pair</a> list, *left, *list
<span id="L313" class="LineNr">313 </span> <a href='cell.mu.html#L83'>new-integer</a> left, <span class="Constant">0x40</span>
<span id="L314" class="LineNr">314 </span> <a href='cell.mu.html#L115'>new-pair</a> list, *left, *list
<span id="L315" class="LineNr">315 </span> <span class="muComment">#</span>
<span id="L316" class="LineNr">316 </span> <span class="PreProc">var</span> out-storage: (stream byte <span class="Constant">0x40</span>)
<span id="L317" class="LineNr">317 </span> <span class="PreProc">var</span> out/<span class="Constant">edi</span>: (addr stream byte) <span class="Special">&lt;-</span> address out-storage
@ -382,16 +382,16 @@ if ('onhashchange' in window) {
<span id="L323" class="LineNr">323 </span> <span class="muComment"># list = cons &quot;abc&quot;, nil</span>
<span id="L324" class="LineNr">324 </span> <span class="PreProc">var</span> left-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L325" class="LineNr">325 </span> <span class="PreProc">var</span> left/<span class="Constant">ecx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address left-storage
<span id="L326" class="LineNr">326 </span> <a href='cell.mu.html#L87'>allocate-pair</a> left
<span id="L326" class="LineNr">326 </span> <a href='cell.mu.html#L101'>allocate-pair</a> left
<span id="L327" class="LineNr">327 </span> <span class="PreProc">var</span> nil-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L328" class="LineNr">328 </span> <span class="PreProc">var</span> <a href='cell.mu.html#L106'>nil</a>/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address nil-storage
<span id="L329" class="LineNr">329 </span> <a href='cell.mu.html#L87'>allocate-pair</a> <a href='cell.mu.html#L106'>nil</a>
<span id="L328" class="LineNr">328 </span> <span class="PreProc">var</span> <a href='cell.mu.html#L120'>nil</a>/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address nil-storage
<span id="L329" class="LineNr">329 </span> <a href='cell.mu.html#L101'>allocate-pair</a> <a href='cell.mu.html#L120'>nil</a>
<span id="L330" class="LineNr">330 </span> <span class="PreProc">var</span> list-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L331" class="LineNr">331 </span> <span class="PreProc">var</span> list/<span class="Constant">esi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address list-storage
<span id="L332" class="LineNr">332 </span> <a href='cell.mu.html#L101'>new-pair</a> list, *left, *nil
<span id="L332" class="LineNr">332 </span> <a href='cell.mu.html#L115'>new-pair</a> list, *left, *nil
<span id="L333" class="LineNr">333 </span> <span class="muComment"># list = cons 64, list</span>
<span id="L334" class="LineNr">334 </span> <a href='cell.mu.html#L69'>new-integer</a> left, <span class="Constant">0x40</span>
<span id="L335" class="LineNr">335 </span> <a href='cell.mu.html#L101'>new-pair</a> list, *left, *list
<span id="L334" class="LineNr">334 </span> <a href='cell.mu.html#L83'>new-integer</a> left, <span class="Constant">0x40</span>
<span id="L335" class="LineNr">335 </span> <a href='cell.mu.html#L115'>new-pair</a> list, *left, *list
<span id="L336" class="LineNr">336 </span> <span class="muComment">#</span>
<span id="L337" class="LineNr">337 </span> <span class="PreProc">var</span> out-storage: (stream byte <span class="Constant">0x40</span>)
<span id="L338" class="LineNr">338 </span> <span class="PreProc">var</span> out/<span class="Constant">edi</span>: (addr stream byte) <span class="Special">&lt;-</span> address out-storage
@ -406,10 +406,10 @@ if ('onhashchange' in window) {
<span id="L347" class="LineNr">347 </span> <a href='cell.mu.html#L38'>new-symbol</a> left, <span class="Constant">&quot;abc&quot;</span>
<span id="L348" class="LineNr">348 </span> <span class="PreProc">var</span> right-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L349" class="LineNr">349 </span> <span class="PreProc">var</span> right/<span class="Constant">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address right-storage
<span id="L350" class="LineNr">350 </span> <a href='cell.mu.html#L69'>new-integer</a> right, <span class="Constant">0x40</span>
<span id="L350" class="LineNr">350 </span> <a href='cell.mu.html#L83'>new-integer</a> right, <span class="Constant">0x40</span>
<span id="L351" class="LineNr">351 </span> <span class="PreProc">var</span> list-storage: (handle <a href='cell.mu.html#L1'>cell</a>)
<span id="L352" class="LineNr">352 </span> <span class="PreProc">var</span> list/<span class="Constant">esi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special">&lt;-</span> address list-storage
<span id="L353" class="LineNr">353 </span> <a href='cell.mu.html#L101'>new-pair</a> list, *left, *right
<span id="L353" class="LineNr">353 </span> <a href='cell.mu.html#L115'>new-pair</a> list, *left, *right
<span id="L354" class="LineNr">354 </span> <span class="muComment">#</span>
<span id="L355" class="LineNr">355 </span> <span class="PreProc">var</span> out-storage: (stream byte <span class="Constant">0x40</span>)
<span id="L356" class="LineNr">356 </span> <span class="PreProc">var</span> out/<span class="Constant">edi</span>: (addr stream byte) <span class="Special">&lt;-</span> address out-storage

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -167,7 +167,7 @@ if ('onhashchange' in window) {
<span id="L108" class="LineNr"> 108 </span> <a href='../108write.subx.html#L11'>write</a> message, <span class="Constant">&quot; - find a smaller sub-computation to test,\n&quot;</span>
<span id="L109" class="LineNr"> 109 </span> <a href='../108write.subx.html#L11'>write</a> message, <span class="Constant">&quot; - <a href='../120allocate.subx.html#L43'>allocate</a> more space to the trace in initialize-sandbox\n&quot;</span>
<span id="L110" class="LineNr"> 110 </span> <a href='../108write.subx.html#L11'>write</a> message, <span class="Constant">&quot; (shell/sandbox.mu), or\n&quot;</span>
<span id="L111" class="LineNr"> 111 </span> <a href='../108write.subx.html#L11'>write</a> message, <span class="Constant">&quot; - move the computation to 'main' and <a href='sandbox.mu.html#L694'>run</a> it using ctrl-s&quot;</span>
<span id="L111" class="LineNr"> 111 </span> <a href='../108write.subx.html#L11'>write</a> message, <span class="Constant">&quot; - move the computation to 'main' and <a href='sandbox.mu.html#L600'>run</a> it using ctrl-s&quot;</span>
<span id="L112" class="LineNr"> 112 </span> <a href='trace.mu.html#L133'>initialize-trace-line</a> <span class="Constant">0</span>/depth, <span class="Constant">&quot;error&quot;</span>, message, dest
<span id="L113" class="LineNr"> 113 </span> increment *index-addr
<span id="L114" class="LineNr"> 114 </span> <span class="PreProc">return</span>
@ -361,7 +361,7 @@ if ('onhashchange' in window) {
<span id="L302" class="LineNr"> 302 </span> <span class="PreProc">var</span> curr/<span class="Constant">ebx</span>: (addr <a href='trace.mu.html#L26'>trace-line</a>) <span class="Special">&lt;-</span> index trace, offset
<span id="L303" class="LineNr"> 303 </span> <span class="PreProc">var</span> curr-label-ah/<span class="Constant">eax</span>: (addr handle array byte) <span class="Special">&lt;-</span> get curr, label
<span id="L304" class="LineNr"> 304 </span> <span class="PreProc">var</span> curr-label/<span class="Constant">eax</span>: (addr array byte) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *curr-label-ah
<span id="L305" class="LineNr"> 305 </span> y <span class="Special">&lt;-</span> <a href='trace.mu.html#L398'>render-trace-line</a> <span class="Constant">0</span>/screen, curr, <span class="Constant">0</span>, y, <span class="Constant">0x80</span>/width, <span class="Constant">0x30</span>/height, <span class="Constant">7</span>/fg, <span class="Constant">0</span>/bg
<span id="L305" class="LineNr"> 305 </span> y <span class="Special">&lt;-</span> <a href='trace.mu.html#L398'>render-trace-line</a> <span class="Constant">0</span>/screen, curr, <span class="Constant">0</span>, y, <span class="Constant">0x80</span>/width, <span class="Constant">0x30</span>/height, <span class="Constant">7</span>/fg, <span class="Constant">0xc5</span>/bg=blue-bg
<span id="L306" class="LineNr"> 306 </span> <span class="Delimiter">}</span>
<span id="L307" class="LineNr"> 307 </span> i <span class="Special">&lt;-</span> increment
<span id="L308" class="LineNr"> 308 </span> <span class="PreProc">loop</span>
@ -406,7 +406,7 @@ if ('onhashchange' in window) {
<span id="L347" class="LineNr"> 347 </span> <span class="PreProc">var</span> curr/<span class="Constant">ebx</span>: (addr <a href='trace.mu.html#L26'>trace-line</a>) <span class="Special">&lt;-</span> index trace, offset
<span id="L348" class="LineNr"> 348 </span> <span class="PreProc">var</span> curr-label-ah/<span class="Constant">eax</span>: (addr handle array byte) <span class="Special">&lt;-</span> get curr, label
<span id="L349" class="LineNr"> 349 </span> <span class="PreProc">var</span> curr-label/<span class="Constant">eax</span>: (addr array byte) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L226'>lookup</a> *curr-label-ah
<span id="L350" class="LineNr"> 350 </span> <span class="PreProc">var</span> bg/<span class="Constant">edi</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>/black
<span id="L350" class="LineNr"> 350 </span> <span class="PreProc">var</span> bg/<span class="Constant">edi</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0xc5</span>/bg=blue-bg
<span id="L351" class="LineNr"> 351 </span> compare show-cursor?, <span class="Constant">0</span>/false
<span id="L352" class="LineNr"> 352 </span> <span class="Delimiter">{</span>
<span id="L353" class="LineNr"> 353 </span> <span class="PreProc">break-if-=</span>
@ -431,7 +431,7 @@ if ('onhashchange' in window) {
<span id="L372" class="LineNr"> 372 </span> <span class="Delimiter">{</span>
<span id="L373" class="LineNr"> 373 </span> compare display?, <span class="Constant">0</span>/false
<span id="L374" class="LineNr"> 374 </span> <span class="PreProc">break-if-=</span>
<span id="L375" class="LineNr"> 375 </span> y <span class="Special">&lt;-</span> <a href='trace.mu.html#L398'>render-trace-line</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, curr, xmin, y, xmax, ymax, <span class="Constant">9</span>/fg=blue, bg
<span id="L375" class="LineNr"> 375 </span> y <span class="Special">&lt;-</span> <a href='trace.mu.html#L398'>render-trace-line</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, curr, xmin, y, xmax, ymax, <span class="Constant">0x38</span>/fg=trace, bg
<span id="L376" class="LineNr"> 376 </span> copy-to already-hiding-lines?, <span class="Constant">0</span>/false
<span id="L377" class="LineNr"> 377 </span> <span class="PreProc">break</span> $render-trace:iter
<span id="L378" class="LineNr"> 378 </span> <span class="Delimiter">}</span>
@ -565,7 +565,7 @@ if ('onhashchange' in window) {
<span id="L506" class="LineNr"> 506 </span> <span class="Delimiter">{</span>
<span id="L507" class="LineNr"> 507 </span> compare display?, <span class="Constant">0</span>/false
<span id="L508" class="LineNr"> 508 </span> <span class="PreProc">break-if-=</span>
<span id="L509" class="LineNr"> 509 </span> <span class="PreProc">var</span> dummy/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> <a href='trace.mu.html#L398'>render-trace-line</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, cursor-line, xmin, y, xmax, ymax, <span class="Constant">9</span>/fg=blue, <span class="Constant">7</span>/cursor-line-bg
<span id="L509" class="LineNr"> 509 </span> <span class="PreProc">var</span> dummy/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> <a href='trace.mu.html#L398'>render-trace-line</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, cursor-line, xmin, y, xmax, ymax, <span class="Constant">0x38</span>/fg=trace, <span class="Constant">7</span>/cursor-line-bg
<span id="L510" class="LineNr"> 510 </span> <span class="PreProc">return</span>
<span id="L511" class="LineNr"> 511 </span> <span class="Delimiter">}</span>
<span id="L512" class="LineNr"> 512 </span> <span class="PreProc">var</span> dummy1/<span class="Constant">eax</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
@ -744,20 +744,20 @@ if ('onhashchange' in window) {
<span id="L685" class="LineNr"> 685 </span> <span class="PreProc">var</span> y/<span class="Constant">ecx</span>: int <span class="Special">&lt;-</span> copy height
<span id="L686" class="LineNr"> 686 </span> y <span class="Special">&lt;-</span> decrement
<span id="L687" class="LineNr"> 687 </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>/x, y
<span id="L688" class="LineNr"> 688 </span> <a href='../501draw-text.mu.html#L133'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; ctrl-r &quot;</span>, width, <span class="Constant">0</span>/fg, <span class="Constant">7</span>/bg=grey
<span id="L689" class="LineNr"> 689 </span> <a href='../501draw-text.mu.html#L133'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; <a href='sandbox.mu.html#L694'>run</a> <a href='main.mu.html#L4'>main</a> &quot;</span>, width, <span class="Constant">7</span>/fg, <span class="Constant">0</span>/bg
<span id="L690" class="LineNr"> 690 </span> <a href='../501draw-text.mu.html#L133'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; ctrl-s &quot;</span>, width, <span class="Constant">0</span>/fg, <span class="Constant">7</span>/bg=grey
<span id="L691" class="LineNr"> 691 </span> <a href='../501draw-text.mu.html#L133'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; <a href='sandbox.mu.html#L694'>run</a> <a href='sandbox.mu.html#L1'>sandbox</a> &quot;</span>, width, <span class="Constant">7</span>/fg, <span class="Constant">0</span>/bg
<span id="L692" class="LineNr"> 692 </span> <a href='../501draw-text.mu.html#L133'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; tab &quot;</span>, width, <span class="Constant">0</span>/fg, <span class="Constant">0x18</span>/bg=keyboard
<span id="L693" class="LineNr"> 693 </span> <a href='../501draw-text.mu.html#L133'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; to keyboard &quot;</span>, width, <span class="Constant">7</span>/fg, <span class="Constant">0</span>/bg
<span id="L694" class="LineNr"> 694 </span> <a href='../501draw-text.mu.html#L133'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; j &quot;</span>, width, <span class="Constant">0</span>/fg, <span class="Constant">7</span>/bg=grey
<span id="L695" class="LineNr"> 695 </span> <a href='../501draw-text.mu.html#L133'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; down &quot;</span>, width, <span class="Constant">7</span>/fg, <span class="Constant">0</span>/bg
<span id="L696" class="LineNr"> 696 </span> <a href='../501draw-text.mu.html#L133'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; k &quot;</span>, width, <span class="Constant">0</span>/fg, <span class="Constant">7</span>/bg=grey
<span id="L697" class="LineNr"> 697 </span> <a href='../501draw-text.mu.html#L133'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; up &quot;</span>, width, <span class="Constant">7</span>/fg, <span class="Constant">0</span>/bg
<span id="L698" class="LineNr"> 698 </span> <a href='../501draw-text.mu.html#L133'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; enter &quot;</span>, width, <span class="Constant">0</span>/fg, <span class="Constant">7</span>/bg=grey
<span id="L699" class="LineNr"> 699 </span> <a href='../501draw-text.mu.html#L133'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; <a href='trace.mu.html#L752'>expand</a> &quot;</span>, width, <span class="Constant">7</span>/fg, <span class="Constant">0</span>/bg
<span id="L700" class="LineNr"> 700 </span> <a href='../501draw-text.mu.html#L133'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; backspace &quot;</span>, width, <span class="Constant">0</span>/fg, <span class="Constant">7</span>/bg=grey
<span id="L701" class="LineNr"> 701 </span> <a href='../501draw-text.mu.html#L133'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; <a href='trace.mu.html#L792'>collapse</a> &quot;</span>, width, <span class="Constant">7</span>/fg, <span class="Constant">0</span>/bg
<span id="L688" class="LineNr"> 688 </span> <a href='../501draw-text.mu.html#L133'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; ctrl-r &quot;</span>, width, <span class="Constant">0</span>/fg, <span class="Constant">0x5c</span>/bg=black
<span id="L689" class="LineNr"> 689 </span> <a href='../501draw-text.mu.html#L133'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; <a href='sandbox.mu.html#L600'>run</a> <a href='main.mu.html#L4'>main</a> &quot;</span>, width, <span class="Constant">7</span>/fg, <span class="Constant">0xc5</span>/bg=blue-bg
<span id="L690" class="LineNr"> 690 </span> <a href='../501draw-text.mu.html#L133'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; ctrl-s &quot;</span>, width, <span class="Constant">0</span>/fg, <span class="Constant">0x5c</span>/bg=black
<span id="L691" class="LineNr"> 691 </span> <a href='../501draw-text.mu.html#L133'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; <a href='sandbox.mu.html#L600'>run</a> <a href='sandbox.mu.html#L1'>sandbox</a> &quot;</span>, width, <span class="Constant">7</span>/fg, <span class="Constant">0xc5</span>/bg=blue-bg
<span id="L692" class="LineNr"> 692 </span> <a href='../501draw-text.mu.html#L133'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; ctrl-m &quot;</span>, width, <span class="Constant">0</span>/fg, <span class="Constant">3</span>/bg=keyboard
<span id="L693" class="LineNr"> 693 </span> <a href='../501draw-text.mu.html#L133'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; to keyboard &quot;</span>, width, <span class="Constant">7</span>/fg, <span class="Constant">0xc5</span>/bg=blue-bg
<span id="L694" class="LineNr"> 694 </span> <a href='../501draw-text.mu.html#L133'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; j &quot;</span>, width, <span class="Constant">0</span>/fg, <span class="Constant">0x5c</span>/bg=black
<span id="L695" class="LineNr"> 695 </span> <a href='../501draw-text.mu.html#L133'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; down &quot;</span>, width, <span class="Constant">7</span>/fg, <span class="Constant">0xc5</span>/bg=blue-bg
<span id="L696" class="LineNr"> 696 </span> <a href='../501draw-text.mu.html#L133'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; k &quot;</span>, width, <span class="Constant">0</span>/fg, <span class="Constant">0x5c</span>/bg=black
<span id="L697" class="LineNr"> 697 </span> <a href='../501draw-text.mu.html#L133'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; up &quot;</span>, width, <span class="Constant">7</span>/fg, <span class="Constant">0xc5</span>/bg=blue-bg
<span id="L698" class="LineNr"> 698 </span> <a href='../501draw-text.mu.html#L133'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; enter &quot;</span>, width, <span class="Constant">0</span>/fg, <span class="Constant">0x5c</span>/bg=black
<span id="L699" class="LineNr"> 699 </span> <a href='../501draw-text.mu.html#L133'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; <a href='trace.mu.html#L752'>expand</a> &quot;</span>, width, <span class="Constant">7</span>/fg, <span class="Constant">0xc5</span>/bg=blue-bg
<span id="L700" class="LineNr"> 700 </span> <a href='../501draw-text.mu.html#L133'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; backspace &quot;</span>, width, <span class="Constant">0</span>/fg, <span class="Constant">0x5c</span>/bg=black
<span id="L701" class="LineNr"> 701 </span> <a href='../501draw-text.mu.html#L133'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; <a href='trace.mu.html#L792'>collapse</a> &quot;</span>, width, <span class="Constant">7</span>/fg, <span class="Constant">0xc5</span>/bg=blue-bg
<span id="L702" class="LineNr"> 702 </span><span class="Delimiter">}</span>
<span id="L703" class="LineNr"> 703 </span>
<span id="L704" class="LineNr"> 704 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='trace.mu.html#L704'>edit-trace</a></span> _self: (addr trace), key: grapheme <span class="Delimiter">{</span>

View File

@ -19,7 +19,7 @@ process() {
URL_BASE='https://github.com/akkartik/mu/blob/main'
convert_html() {
vim -c "set number" -c TOhtml -c write -c qall $1
vim -u $MYVIM/vimrc.vim -c "set number" -c TOhtml -c write -c qall $1
sed -i 's,<title>.*/mu/,<title>Mu - ,' $1.html
sed -i 's,\.html</title>,</title>,' $1.html
@ -62,47 +62,4 @@ do
process $f
done
( cd linux
ctags -x [0-9]*.subx [0-9]*.mu > /tmp/tags
)
for f in linux/[0-9]*.subx linux/[0-9]*.mu
do
process $f
done
for f in linux/[^0-9]*.subx linux/[^0-9]*.mu
do
( cd $(dirname $f)
ctags -x [0-9]*.subx [0-9]*.mu $(basename $f) > /tmp/tags
)
process $f
done
for f in linux/advent2020/*.mu
do
( cd $(dirname $f)
ctags -x ../[0-9]*.subx ../[0-9]*.mu $(basename $f) > /tmp/tags
)
process $f
done
for dir in linux/raytracing linux/tile
do
( cd $dir
ctags -x ../[0-9]*.subx ../[0-9]*.mu *.mu > /tmp/tags
)
for f in $dir/*.mu
do
process $f
done
done
( cd linux/bootstrap
ctags -x *.cc |grep -v '^. ' > /tmp/tags # don't hyperlink every 'i' to the integer register variant
)
for f in linux/bootstrap/*.cc
do
process $f
done
rm /tmp/tags