.
This commit is contained in:
parent
678c936633
commit
dd60caa3f5
75
html/101screen.subx.html
generated
75
html/101screen.subx.html
generated
|
@ -66,37 +66,50 @@ if ('onhashchange' in window) {
|
|||
<span id="L9" class="LineNr"> 9 </span> <span class="subxS1Comment"># . prologue</span>
|
||||
<span id="L10" class="LineNr">10 </span> 55/push-ebp
|
||||
<span id="L11" class="LineNr">11 </span> 89/<- %ebp 4/r32/esp
|
||||
<span id="L12" class="LineNr">12 </span> <span class="subxS1Comment"># . save registers</span>
|
||||
<span id="L13" class="LineNr">13 </span> 50/push-eax
|
||||
<span id="L14" class="LineNr">14 </span> 51/push-ecx
|
||||
<span id="L15" class="LineNr">15 </span> <span class="subxComment"># bounds checks</span>
|
||||
<span id="L16" class="LineNr">16 </span> 8b/-> *(ebp+8) 0/r32/eax
|
||||
<span id="L17" class="LineNr">17 </span> 3d/compare-eax-and 0/imm32
|
||||
<span id="L18" class="LineNr">18 </span> 7c/jump-if-< $pixel-on-real-screen:end/disp8
|
||||
<span id="L19" class="LineNr">19 </span> 3d/compare-eax-and 0x400/imm32/screen-width=1024
|
||||
<span id="L20" class="LineNr">20 </span> 7d/jump-if->= $pixel-on-real-screen:end/disp8
|
||||
<span id="L21" class="LineNr">21 </span> 8b/-> *(ebp+0xc) 0/r32/eax
|
||||
<span id="L22" class="LineNr">22 </span> 3d/compare-eax-and 0/imm32
|
||||
<span id="L23" class="LineNr">23 </span> 7c/jump-if-< $pixel-on-real-screen:end/disp8
|
||||
<span id="L24" class="LineNr">24 </span> 3d/compare-eax-and 0x300/imm32/screen-height=768
|
||||
<span id="L25" class="LineNr">25 </span> 7d/jump-if->= $pixel-on-real-screen:end/disp8
|
||||
<span id="L26" class="LineNr">26 </span> <span class="subxComment"># eax = y*1024 + x</span>
|
||||
<span id="L27" class="LineNr">27 </span> 8b/-> *(ebp+0xc) 0/r32/eax
|
||||
<span id="L28" class="LineNr">28 </span> c1/shift 4/subop/left %eax 0xa/imm8
|
||||
<span id="L29" class="LineNr">29 </span> 03/add-> *(ebp+8) 0/r32/eax
|
||||
<span id="L30" class="LineNr">30 </span> <span class="subxComment"># eax += location of frame buffer</span>
|
||||
<span id="L31" class="LineNr">31 </span> 03/add-> *<span class="SpecialChar"><a href='boot.subx.html#L636'>Video-memory-addr</a></span> 0/r32/eax
|
||||
<span id="L32" class="LineNr">32 </span> <span class="subxComment"># *eax = color</span>
|
||||
<span id="L33" class="LineNr">33 </span> 8b/-> *(ebp+0x10) 1/r32/ecx
|
||||
<span id="L34" class="LineNr">34 </span> 88/byte<- *eax 1/r32/CL
|
||||
<span id="L35" class="LineNr">35 </span><span class="Constant">$pixel-on-real-screen:end</span>:
|
||||
<span id="L36" class="LineNr">36 </span> <span class="subxS1Comment"># . restore registers</span>
|
||||
<span id="L37" class="LineNr">37 </span> 59/pop-to-ecx
|
||||
<span id="L38" class="LineNr">38 </span> 58/pop-to-eax
|
||||
<span id="L39" class="LineNr">39 </span> <span class="subxS1Comment"># . epilogue</span>
|
||||
<span id="L40" class="LineNr">40 </span> 89/<- %esp 5/r32/ebp
|
||||
<span id="L41" class="LineNr">41 </span> 5d/pop-to-ebp
|
||||
<span id="L42" class="LineNr">42 </span> c3/return
|
||||
<span id="L12" class="LineNr">12 </span> <span class="subxComment">#</span>
|
||||
<span id="L13" class="LineNr">13 </span> (<a href='101screen.subx.html#L21'>pixel-on-screen-buffer</a> *<span class="SpecialChar"><a href='boot.subx.html#L650'>Video-memory-addr</a></span> *(ebp+8) *(ebp+0xc) *(ebp+0x10) 0x400 0x300)
|
||||
<span id="L14" class="LineNr">14 </span><span class="Constant">$pixel-on-real-screen:end</span>:
|
||||
<span id="L15" class="LineNr">15 </span> <span class="subxS1Comment"># . epilogue</span>
|
||||
<span id="L16" class="LineNr">16 </span> 89/<- %esp 5/r32/ebp
|
||||
<span id="L17" class="LineNr">17 </span> 5d/pop-to-ebp
|
||||
<span id="L18" class="LineNr">18 </span> c3/return
|
||||
<span id="L19" class="LineNr">19 </span>
|
||||
<span id="L20" class="LineNr">20 </span><span class="subxComment"># 'buffer' here is not a valid Mu type: a naked address without a length.</span>
|
||||
<span id="L21" class="LineNr">21 </span><span class="subxFunction">pixel-on-screen-buffer</span>: <span class="subxComment"># buffer: (addr byte), x: int, y: int, color: int, width: int, height: int</span>
|
||||
<span id="L22" class="LineNr">22 </span> <span class="subxS1Comment"># . prologue</span>
|
||||
<span id="L23" class="LineNr">23 </span> 55/push-ebp
|
||||
<span id="L24" class="LineNr">24 </span> 89/<- %ebp 4/r32/esp
|
||||
<span id="L25" class="LineNr">25 </span> <span class="subxS1Comment"># . save registers</span>
|
||||
<span id="L26" class="LineNr">26 </span> 50/push-eax
|
||||
<span id="L27" class="LineNr">27 </span> 51/push-ecx
|
||||
<span id="L28" class="LineNr">28 </span> <span class="subxComment"># bounds checks</span>
|
||||
<span id="L29" class="LineNr">29 </span> 8b/-> *(ebp+0xc) 0/r32/eax <span class="subxComment"># foo</span>
|
||||
<span id="L30" class="LineNr">30 </span> 3d/compare-eax-and 0/imm32
|
||||
<span id="L31" class="LineNr">31 </span> 7c/jump-if-< $pixel-on-screen-buffer:end/disp8
|
||||
<span id="L32" class="LineNr">32 </span> 3b/compare 0/r32/eax *(ebp+0x18)
|
||||
<span id="L33" class="LineNr">33 </span> 7d/jump-if->= $pixel-on-screen-buffer:end/disp8
|
||||
<span id="L34" class="LineNr">34 </span> 8b/-> *(ebp+0x10) 0/r32/eax
|
||||
<span id="L35" class="LineNr">35 </span> 3d/compare-eax-and 0/imm32
|
||||
<span id="L36" class="LineNr">36 </span> 7c/jump-if-< $pixel-on-screen-buffer:end/disp8
|
||||
<span id="L37" class="LineNr">37 </span> 3b/compare 0/r32/eax *(ebp+0x1c)
|
||||
<span id="L38" class="LineNr">38 </span> 7d/jump-if->= $pixel-on-screen-buffer:end/disp8
|
||||
<span id="L39" class="LineNr">39 </span> <span class="subxComment"># eax = y*width + x</span>
|
||||
<span id="L40" class="LineNr">40 </span> 8b/-> *(ebp+0x10) 0/r32/eax
|
||||
<span id="L41" class="LineNr">41 </span> 0f af/multiply-> *(ebp+0x18) 0/r32/eax
|
||||
<span id="L42" class="LineNr">42 </span> 03/add-> *(ebp+0xc) 0/r32/eax
|
||||
<span id="L43" class="LineNr">43 </span> <span class="subxComment"># eax += location of frame buffer</span>
|
||||
<span id="L44" class="LineNr">44 </span> 03/add-> *(ebp+8) 0/r32/eax
|
||||
<span id="L45" class="LineNr">45 </span> <span class="subxComment"># *eax = color</span>
|
||||
<span id="L46" class="LineNr">46 </span> 8b/-> *(ebp+0x14) 1/r32/ecx
|
||||
<span id="L47" class="LineNr">47 </span> 88/byte<- *eax 1/r32/CL
|
||||
<span id="L48" class="LineNr">48 </span><span class="Constant">$pixel-on-screen-buffer:end</span>:
|
||||
<span id="L49" class="LineNr">49 </span> <span class="subxS1Comment"># . restore registers</span>
|
||||
<span id="L50" class="LineNr">50 </span> 59/pop-to-ecx
|
||||
<span id="L51" class="LineNr">51 </span> 58/pop-to-eax
|
||||
<span id="L52" class="LineNr">52 </span> <span class="subxS1Comment"># . epilogue</span>
|
||||
<span id="L53" class="LineNr">53 </span> 89/<- %esp 5/r32/ebp
|
||||
<span id="L54" class="LineNr">54 </span> 5d/pop-to-ebp
|
||||
<span id="L55" class="LineNr">55 </span> c3/return
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
367
html/103grapheme.subx.html
generated
367
html/103grapheme.subx.html
generated
|
@ -75,159 +75,220 @@ if ('onhashchange' in window) {
|
|||
<span id="L18" class="LineNr"> 18 </span> <span class="subxS1Comment"># . prologue</span>
|
||||
<span id="L19" class="LineNr"> 19 </span> 55/push-ebp
|
||||
<span id="L20" class="LineNr"> 20 </span> 89/<- %ebp 4/r32/esp
|
||||
<span id="L21" class="LineNr"> 21 </span> <span class="subxS1Comment"># . save registers</span>
|
||||
<span id="L22" class="LineNr"> 22 </span> 50/push-eax
|
||||
<span id="L23" class="LineNr"> 23 </span> 51/push-ecx
|
||||
<span id="L24" class="LineNr"> 24 </span> 52/push-edx
|
||||
<span id="L25" class="LineNr"> 25 </span> 53/push-ebx
|
||||
<span id="L26" class="LineNr"> 26 </span> 56/push-esi
|
||||
<span id="L27" class="LineNr"> 27 </span> <span class="subxComment"># var letter-bitmap/esi = font[g]</span>
|
||||
<span id="L28" class="LineNr"> 28 </span> 8b/-> *(ebp+8) 6/r32/esi
|
||||
<span id="L29" class="LineNr"> 29 </span> c1 4/subop/shift-left %esi 4/imm8
|
||||
<span id="L30" class="LineNr"> 30 </span> 81 0/subop/add %esi <span class="SpecialChar"><a href='boot.subx.html#L657'>Font</a></span>/imm32
|
||||
<span id="L31" class="LineNr"> 31 </span> <span class="subxComment"># if (letter-bitmap >= 0x9400) return # characters beyond ASCII currently not supported</span>
|
||||
<span id="L32" class="LineNr"> 32 </span> 81 7/subop/compare %esi 0x9400/imm32
|
||||
<span id="L33" class="LineNr"> 33 </span> 7d/jump-if->= $draw-grapheme-on-real-screen:end/disp8
|
||||
<span id="L34" class="LineNr"> 34 </span> <span class="subxComment"># var ycurr/edx: int = y*16</span>
|
||||
<span id="L35" class="LineNr"> 35 </span> 8b/-> *(ebp+0x10) 2/r32/edx
|
||||
<span id="L36" class="LineNr"> 36 </span> c1 4/subop/shift-left %edx 4/imm8
|
||||
<span id="L37" class="LineNr"> 37 </span> <span class="subxComment"># var ymax/ebx: int = ycurr + 16</span>
|
||||
<span id="L38" class="LineNr"> 38 </span> 8b/-> *(ebp+0x10) 3/r32/ebx
|
||||
<span id="L39" class="LineNr"> 39 </span> c1 4/subop/shift-left %ebx 4/imm8
|
||||
<span id="L40" class="LineNr"> 40 </span> 81 0/subop/add %ebx 0x10/imm32
|
||||
<span id="L41" class="LineNr"> 41 </span> {
|
||||
<span id="L42" class="LineNr"> 42 </span> <span class="subxComment"># if (ycurr >= ymax) break</span>
|
||||
<span id="L43" class="LineNr"> 43 </span> 39/compare %edx 3/r32/ebx
|
||||
<span id="L44" class="LineNr"> 44 </span> 7d/jump-if->= <span class="Constant">break</span>/disp8
|
||||
<span id="L45" class="LineNr"> 45 </span> <span class="subxComment"># var xcurr/eax: int = x*8 + 7</span>
|
||||
<span id="L46" class="LineNr"> 46 </span> 8b/-> *(ebp+0xc) 0/r32/eax <span class="subxComment"># font-width - 1</span>
|
||||
<span id="L47" class="LineNr"> 47 </span> c1 4/subop/shift-left %eax 3/imm8
|
||||
<span id="L48" class="LineNr"> 48 </span> 05/add-to-eax 7/imm32
|
||||
<span id="L49" class="LineNr"> 49 </span> <span class="subxComment"># var xmin/ecx: int = x*8</span>
|
||||
<span id="L50" class="LineNr"> 50 </span> 8b/-> *(ebp+0xc) 1/r32/ecx
|
||||
<span id="L51" class="LineNr"> 51 </span> c1 4/subop/shift-left %ecx 3/imm8
|
||||
<span id="L52" class="LineNr"> 52 </span> <span class="subxComment"># var row-bitmap/ebx: int = *letter-bitmap</span>
|
||||
<span id="L53" class="LineNr"> 53 </span> 53/push-ebx
|
||||
<span id="L54" class="LineNr"> 54 </span> 8b/-> *esi 3/r32/ebx
|
||||
<span id="L55" class="LineNr"> 55 </span> {
|
||||
<span id="L56" class="LineNr"> 56 </span> <span class="subxComment"># if (xcurr < xmin) break</span>
|
||||
<span id="L57" class="LineNr"> 57 </span> 39/compare %eax 1/r32/ecx
|
||||
<span id="L58" class="LineNr"> 58 </span> 7c/jump-if-< <span class="Constant">break</span>/disp8
|
||||
<span id="L59" class="LineNr"> 59 </span> <span class="subxComment"># shift LSB from row-bitmap into carry flag (CF)</span>
|
||||
<span id="L60" class="LineNr"> 60 </span> c1 5/subop/shift-right-logical %ebx 1/imm8
|
||||
<span id="L61" class="LineNr"> 61 </span> <span class="subxComment"># if LSB, draw a pixel in the given color</span>
|
||||
<span id="L62" class="LineNr"> 62 </span> {
|
||||
<span id="L63" class="LineNr"> 63 </span> 73/jump-if-not-CF <span class="Constant">break</span>/disp8
|
||||
<span id="L64" class="LineNr"> 64 </span> (<a href='101screen.subx.html#L8'>pixel-on-real-screen</a> %eax %edx *(ebp+0x14))
|
||||
<span id="L65" class="LineNr"> 65 </span> eb/jump $draw-grapheme-on-real-screen:continue/disp8
|
||||
<span id="L66" class="LineNr"> 66 </span> }
|
||||
<span id="L67" class="LineNr"> 67 </span> <span class="subxComment"># otherwise use the background color</span>
|
||||
<span id="L68" class="LineNr"> 68 </span> (<a href='101screen.subx.html#L8'>pixel-on-real-screen</a> %eax %edx *(ebp+0x18))
|
||||
<span id="L69" class="LineNr"> 69 </span><span class="Constant">$draw-grapheme-on-real-screen:continue</span>:
|
||||
<span id="L70" class="LineNr"> 70 </span> <span class="subxComment"># --x</span>
|
||||
<span id="L71" class="LineNr"> 71 </span> 48/decrement-eax
|
||||
<span id="L72" class="LineNr"> 72 </span> <span class="subxComment">#</span>
|
||||
<span id="L73" class="LineNr"> 73 </span> eb/jump <span class="Constant">loop</span>/disp8
|
||||
<span id="L74" class="LineNr"> 74 </span> }
|
||||
<span id="L75" class="LineNr"> 75 </span> <span class="subxComment"># reclaim row-bitmap</span>
|
||||
<span id="L76" class="LineNr"> 76 </span> 5b/pop-to-ebx
|
||||
<span id="L77" class="LineNr"> 77 </span> <span class="subxComment"># ++y</span>
|
||||
<span id="L78" class="LineNr"> 78 </span> 42/increment-edx
|
||||
<span id="L79" class="LineNr"> 79 </span> <span class="subxComment"># next bitmap row</span>
|
||||
<span id="L80" class="LineNr"> 80 </span> 46/increment-esi
|
||||
<span id="L81" class="LineNr"> 81 </span> <span class="subxComment">#</span>
|
||||
<span id="L82" class="LineNr"> 82 </span> eb/jump <span class="Constant">loop</span>/disp8
|
||||
<span id="L83" class="LineNr"> 83 </span> }
|
||||
<span id="L84" class="LineNr"> 84 </span><span class="Constant">$draw-grapheme-on-real-screen:end</span>:
|
||||
<span id="L85" class="LineNr"> 85 </span> <span class="subxS1Comment"># . restore registers</span>
|
||||
<span id="L86" class="LineNr"> 86 </span> 5e/pop-to-esi
|
||||
<span id="L87" class="LineNr"> 87 </span> 5b/pop-to-ebx
|
||||
<span id="L88" class="LineNr"> 88 </span> 5a/pop-to-edx
|
||||
<span id="L89" class="LineNr"> 89 </span> 59/pop-to-ecx
|
||||
<span id="L90" class="LineNr"> 90 </span> 58/pop-to-eax
|
||||
<span id="L91" class="LineNr"> 91 </span> <span class="subxS1Comment"># . epilogue</span>
|
||||
<span id="L92" class="LineNr"> 92 </span> 89/<- %esp 5/r32/ebp
|
||||
<span id="L93" class="LineNr"> 93 </span> 5d/pop-to-ebp
|
||||
<span id="L94" class="LineNr"> 94 </span> c3/return
|
||||
<span id="L95" class="LineNr"> 95 </span>
|
||||
<span id="L96" class="LineNr"> 96 </span><span class="subxFunction">cursor-position-on-real-screen</span>: <span class="subxComment"># -> _/eax: int, _/ecx: int</span>
|
||||
<span id="L97" class="LineNr"> 97 </span> <span class="subxS1Comment"># . prologue</span>
|
||||
<span id="L98" class="LineNr"> 98 </span> 55/push-ebp
|
||||
<span id="L99" class="LineNr"> 99 </span> 89/<- %ebp 4/r32/esp
|
||||
<span id="L100" class="LineNr">100 </span> <span class="subxComment"># TODO: support fake screen; we currently assume 'screen' is always 0 (real)</span>
|
||||
<span id="L101" class="LineNr">101 </span> 8b/-> *<span class="SpecialChar"><a href='103grapheme.subx.html#L170'>Real-screen-cursor-x</a></span> 0/r32/eax
|
||||
<span id="L102" class="LineNr">102 </span> 8b/-> *<span class="SpecialChar"><a href='103grapheme.subx.html#L172'>Real-screen-cursor-y</a></span> 1/r32/ecx
|
||||
<span id="L103" class="LineNr">103 </span><span class="Constant">$cursor-position-on-real-screen:end</span>:
|
||||
<span id="L104" class="LineNr">104 </span> <span class="subxS1Comment"># . epilogue</span>
|
||||
<span id="L105" class="LineNr">105 </span> 89/<- %esp 5/r32/ebp
|
||||
<span id="L106" class="LineNr">106 </span> 5d/pop-to-ebp
|
||||
<span id="L107" class="LineNr">107 </span> c3/return
|
||||
<span id="L108" class="LineNr">108 </span>
|
||||
<span id="L109" class="LineNr">109 </span><span class="subxFunction">set-cursor-position-on-real-screen</span>: <span class="subxComment"># x: int, y: int</span>
|
||||
<span id="L110" class="LineNr">110 </span> <span class="subxS1Comment"># . prologue</span>
|
||||
<span id="L111" class="LineNr">111 </span> 55/push-ebp
|
||||
<span id="L112" class="LineNr">112 </span> 89/<- %ebp 4/r32/esp
|
||||
<span id="L113" class="LineNr">113 </span> <span class="subxS1Comment"># . save registers</span>
|
||||
<span id="L114" class="LineNr">114 </span> 50/push-eax
|
||||
<span id="L115" class="LineNr">115 </span> <span class="subxComment">#</span>
|
||||
<span id="L116" class="LineNr">116 </span> 8b/-> *(ebp+8) 0/r32/eax
|
||||
<span id="L117" class="LineNr">117 </span> 89/<- *<span class="SpecialChar"><a href='103grapheme.subx.html#L170'>Real-screen-cursor-x</a></span> 0/r32/eax
|
||||
<span id="L118" class="LineNr">118 </span> 8b/-> *(ebp+0xc) 0/r32/eax
|
||||
<span id="L119" class="LineNr">119 </span> 89/<- *<span class="SpecialChar"><a href='103grapheme.subx.html#L172'>Real-screen-cursor-y</a></span> 0/r32/eax
|
||||
<span id="L120" class="LineNr">120 </span><span class="Constant">$set-cursor-position-on-real-screen:end</span>:
|
||||
<span id="L121" class="LineNr">121 </span> <span class="subxS1Comment"># . restore registers</span>
|
||||
<span id="L122" class="LineNr">122 </span> 58/pop-to-eax
|
||||
<span id="L123" class="LineNr">123 </span> <span class="subxS1Comment"># . epilogue</span>
|
||||
<span id="L124" class="LineNr">124 </span> 89/<- %esp 5/r32/ebp
|
||||
<span id="L125" class="LineNr">125 </span> 5d/pop-to-ebp
|
||||
<span id="L126" class="LineNr">126 </span> c3/return
|
||||
<span id="L127" class="LineNr">127 </span>
|
||||
<span id="L128" class="LineNr">128 </span><span class="subxComment"># Not a real `show-cursor` primitive:</span>
|
||||
<span id="L129" class="LineNr">129 </span><span class="subxComment"># - does not clear previous location cursor was shown at.</span>
|
||||
<span id="L130" class="LineNr">130 </span><span class="subxComment"># - does not preserve what was at the cursor. Caller is responsible for</span>
|
||||
<span id="L131" class="LineNr">131 </span><span class="subxComment"># tracking what was on the screen at this position before and passing it</span>
|
||||
<span id="L132" class="LineNr">132 </span><span class="subxComment"># in again.</span>
|
||||
<span id="L133" class="LineNr">133 </span><span class="subxComment"># - does not stop showing the cursor at this location when the cursor moves</span>
|
||||
<span id="L134" class="LineNr">134 </span><span class="subxFunction">draw-cursor-on-real-screen</span>: <span class="subxComment"># g: grapheme</span>
|
||||
<span id="L135" class="LineNr">135 </span> <span class="subxS1Comment"># . prologue</span>
|
||||
<span id="L136" class="LineNr">136 </span> 55/push-ebp
|
||||
<span id="L137" class="LineNr">137 </span> 89/<- %ebp 4/r32/esp
|
||||
<span id="L138" class="LineNr">138 </span> <span class="subxS1Comment"># . save registers</span>
|
||||
<span id="L139" class="LineNr">139 </span> 50/push-eax
|
||||
<span id="L140" class="LineNr">140 </span> 51/push-ecx
|
||||
<span id="L141" class="LineNr">141 </span> <span class="subxComment">#</span>
|
||||
<span id="L142" class="LineNr">142 </span> (<a href='103grapheme.subx.html#L96'>cursor-position-on-real-screen</a>) <span class="subxComment"># => eax, ecx</span>
|
||||
<span id="L143" class="LineNr">143 </span> (<a href='103grapheme.subx.html#L17'>draw-grapheme-on-real-screen</a> *(ebp+8) %eax %ecx 0 7)
|
||||
<span id="L144" class="LineNr">144 </span><span class="Constant">$draw-cursor-on-real-screen:end</span>:
|
||||
<span id="L145" class="LineNr">145 </span> <span class="subxS1Comment"># . restore registers</span>
|
||||
<span id="L146" class="LineNr">146 </span> 59/pop-to-ecx
|
||||
<span id="L147" class="LineNr">147 </span> 58/pop-to-eax
|
||||
<span id="L148" class="LineNr">148 </span> <span class="subxS1Comment"># . epilogue</span>
|
||||
<span id="L149" class="LineNr">149 </span> 89/<- %esp 5/r32/ebp
|
||||
<span id="L150" class="LineNr">150 </span> 5d/pop-to-ebp
|
||||
<span id="L151" class="LineNr">151 </span> c3/return
|
||||
<span id="L152" class="LineNr">152 </span>
|
||||
<span id="L153" class="LineNr">153 </span>== data
|
||||
<span id="L154" class="LineNr">154 </span>
|
||||
<span id="L155" class="LineNr">155 </span><span class="subxComment"># The cursor is where certain Mu functions (usually of the form</span>
|
||||
<span id="L156" class="LineNr">156 </span><span class="subxComment"># 'draw*cursor*') print to by default.</span>
|
||||
<span id="L157" class="LineNr">157 </span><span class="subxComment">#</span>
|
||||
<span id="L158" class="LineNr">158 </span><span class="subxComment"># We don't bother displaying the cursor when drawing. It only becomes visible</span>
|
||||
<span id="L159" class="LineNr">159 </span><span class="subxComment"># on draw-cursor, which is quite rickety (see above)</span>
|
||||
<span id="L160" class="LineNr">160 </span><span class="subxComment">#</span>
|
||||
<span id="L161" class="LineNr">161 </span><span class="subxComment"># It's up to applications to manage cursor display:</span>
|
||||
<span id="L162" class="LineNr">162 </span><span class="subxComment"># - clean up where it used to be</span>
|
||||
<span id="L163" class="LineNr">163 </span><span class="subxComment"># - display the cursor before waiting for a key</span>
|
||||
<span id="L164" class="LineNr">164 </span><span class="subxComment"># - ensure its location appropriately suggests the effect keystrokes will have</span>
|
||||
<span id="L165" class="LineNr">165 </span><span class="subxComment"># - ensure its contents (and colors) appropriately reflect the state of the</span>
|
||||
<span id="L166" class="LineNr">166 </span><span class="subxComment"># screen</span>
|
||||
<span id="L167" class="LineNr">167 </span><span class="subxComment">#</span>
|
||||
<span id="L168" class="LineNr">168 </span><span class="subxComment"># There's no blinking, etc. We aren't using any hardware-supported text mode</span>
|
||||
<span id="L169" class="LineNr">169 </span><span class="subxComment"># here.</span>
|
||||
<span id="L170" class="LineNr">170 </span><span class="SpecialChar">Real-screen-cursor-x</span>:
|
||||
<span id="L171" class="LineNr">171 </span> 0/imm32
|
||||
<span id="L172" class="LineNr">172 </span><span class="SpecialChar">Real-screen-cursor-y</span>:
|
||||
<span id="L173" class="LineNr">173 </span> 0/imm32
|
||||
<span id="L21" class="LineNr"> 21 </span> <span class="subxComment">#</span>
|
||||
<span id="L22" class="LineNr"> 22 </span> (<a href='103grapheme.subx.html#L74'>draw-grapheme-on-screen-buffer</a> *<span class="SpecialChar"><a href='boot.subx.html#L650'>Video-memory-addr</a></span> *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14) *(ebp+0x18) 0x80 0x30)
|
||||
<span id="L23" class="LineNr"> 23 </span><span class="Constant">$draw-grapheme-on-real-screen:end</span>:
|
||||
<span id="L24" class="LineNr"> 24 </span> <span class="subxS1Comment"># . epilogue</span>
|
||||
<span id="L25" class="LineNr"> 25 </span> 89/<- %esp 5/r32/ebp
|
||||
<span id="L26" class="LineNr"> 26 </span> 5d/pop-to-ebp
|
||||
<span id="L27" class="LineNr"> 27 </span> c3/return
|
||||
<span id="L28" class="LineNr"> 28 </span>
|
||||
<span id="L29" class="LineNr"> 29 </span><span class="subxFunction">draw-grapheme-on-screen-array</span>: <span class="subxComment"># screen-data: (addr array byte), g: grapheme, x: int, y: int, color: int, background-color: int, screen-width: int, screen-height: int</span>
|
||||
<span id="L30" class="LineNr"> 30 </span> <span class="subxS1Comment"># . prologue</span>
|
||||
<span id="L31" class="LineNr"> 31 </span> 55/push-ebp
|
||||
<span id="L32" class="LineNr"> 32 </span> 89/<- %ebp 4/r32/esp
|
||||
<span id="L33" class="LineNr"> 33 </span> <span class="subxS1Comment"># . save registers</span>
|
||||
<span id="L34" class="LineNr"> 34 </span> 50/push-eax
|
||||
<span id="L35" class="LineNr"> 35 </span> 51/push-ecx
|
||||
<span id="L36" class="LineNr"> 36 </span> 52/push-edx
|
||||
<span id="L37" class="LineNr"> 37 </span> <span class="subxComment"># if screen-width*screen-height > len(screen-data) abort</span>
|
||||
<span id="L38" class="LineNr"> 38 </span> {
|
||||
<span id="L39" class="LineNr"> 39 </span> <span class="subxComment"># ecx = len(screen-data)</span>
|
||||
<span id="L40" class="LineNr"> 40 </span> 8b/-> *(ebp+8) 1/r32/ecx
|
||||
<span id="L41" class="LineNr"> 41 </span> 8b/-> *ecx 1/r32/ecx
|
||||
<span id="L42" class="LineNr"> 42 </span> <span class="subxComment"># eax = screen-width*screen-height</span>
|
||||
<span id="L43" class="LineNr"> 43 </span> ba/copy-to-edx 0/imm32
|
||||
<span id="L44" class="LineNr"> 44 </span> 8b/-> *(ebp+0x20) 0/r32/eax
|
||||
<span id="L45" class="LineNr"> 45 </span> f7 4/subop/multiply-into-eax *(ebp+0x24)
|
||||
<span id="L46" class="LineNr"> 46 </span> 81 7/subop/compare %edx 0/imm32
|
||||
<span id="L47" class="LineNr"> 47 </span> 0f 85/jump-if-!= $draw-grapheme-on-screen-array:overflow/disp32
|
||||
<span id="L48" class="LineNr"> 48 </span> <span class="subxComment"># if (eax > ecx) abort</span>
|
||||
<span id="L49" class="LineNr"> 49 </span> 39/compare %eax 1/r32/ecx
|
||||
<span id="L50" class="LineNr"> 50 </span> 0f 8f/jump-if-> $draw-grapheme-on-screen-array:<a href='317abort.subx.html#L5'>abort</a>/disp32
|
||||
<span id="L51" class="LineNr"> 51 </span> }
|
||||
<span id="L52" class="LineNr"> 52 </span> <span class="subxComment"># eax = screen-data+4 (skip length)</span>
|
||||
<span id="L53" class="LineNr"> 53 </span> 8b/-> *(ebp+8) 0/r32/eax
|
||||
<span id="L54" class="LineNr"> 54 </span> 05/add-to-eax 4/imm32
|
||||
<span id="L55" class="LineNr"> 55 </span> <span class="subxComment">#</span>
|
||||
<span id="L56" class="LineNr"> 56 </span> (<a href='103grapheme.subx.html#L74'>draw-grapheme-on-screen-buffer</a> %eax *(ebp+0xc) *(ebp+0x10) *(ebp+0x14) *(ebp+0x18) *(ebp+0x1c) *(ebp+0x20) *(ebp+0x24))
|
||||
<span id="L57" class="LineNr"> 57 </span><span class="Constant">$draw-grapheme-on-screen-array:end</span>:
|
||||
<span id="L58" class="LineNr"> 58 </span> <span class="subxS1Comment"># . restore registers</span>
|
||||
<span id="L59" class="LineNr"> 59 </span> 5a/pop-to-edx
|
||||
<span id="L60" class="LineNr"> 60 </span> 59/pop-to-ecx
|
||||
<span id="L61" class="LineNr"> 61 </span> 58/pop-to-eax
|
||||
<span id="L62" class="LineNr"> 62 </span> <span class="subxS1Comment"># . epilogue</span>
|
||||
<span id="L63" class="LineNr"> 63 </span> 89/<- %esp 5/r32/ebp
|
||||
<span id="L64" class="LineNr"> 64 </span> 5d/pop-to-ebp
|
||||
<span id="L65" class="LineNr"> 65 </span> c3/return
|
||||
<span id="L66" class="LineNr"> 66 </span>
|
||||
<span id="L67" class="LineNr"> 67 </span><span class="Constant">$draw-grapheme-on-screen-array:overflow</span>:
|
||||
<span id="L68" class="LineNr"> 68 </span> (<a href='317abort.subx.html#L5'>abort</a> <span class="Constant">"draw-grapheme-on-screen-array: <a href='500fake-screen.mu.html#L14'>screen</a> dimensions too large"</span>)
|
||||
<span id="L69" class="LineNr"> 69 </span>
|
||||
<span id="L70" class="LineNr"> 70 </span><span class="Constant">$draw-grapheme-on-screen-array:<a href='317abort.subx.html#L5'>abort</a></span>:
|
||||
<span id="L71" class="LineNr"> 71 </span> (<a href='317abort.subx.html#L5'>abort</a> <span class="Constant">"draw-grapheme-on-screen-array: coordinates are off the screen. Are the <a href='500fake-screen.mu.html#L14'>screen</a> dimensions correct?"</span>)
|
||||
<span id="L72" class="LineNr"> 72 </span>
|
||||
<span id="L73" class="LineNr"> 73 </span><span class="subxComment"># 'buffer' here is not a valid Mu type: a naked address without a length.</span>
|
||||
<span id="L74" class="LineNr"> 74 </span><span class="subxFunction">draw-grapheme-on-screen-buffer</span>: <span class="subxComment"># buffer: (addr byte), g: grapheme, x: int, y: int, color: int, background-color: int, screen-width: int, screen-height: int</span>
|
||||
<span id="L75" class="LineNr"> 75 </span> <span class="subxS1Comment"># . prologue</span>
|
||||
<span id="L76" class="LineNr"> 76 </span> 55/push-ebp
|
||||
<span id="L77" class="LineNr"> 77 </span> 89/<- %ebp 4/r32/esp
|
||||
<span id="L78" class="LineNr"> 78 </span> <span class="subxS1Comment"># . save registers</span>
|
||||
<span id="L79" class="LineNr"> 79 </span> 50/push-eax
|
||||
<span id="L80" class="LineNr"> 80 </span> 51/push-ecx
|
||||
<span id="L81" class="LineNr"> 81 </span> 52/push-edx
|
||||
<span id="L82" class="LineNr"> 82 </span> 53/push-ebx
|
||||
<span id="L83" class="LineNr"> 83 </span> 56/push-esi
|
||||
<span id="L84" class="LineNr"> 84 </span> <span class="subxComment"># switch screen-width and screen-height from grapheme to pixel units</span>
|
||||
<span id="L85" class="LineNr"> 85 </span> c1 4/subop/shift-left *(ebp+20) 3/imm8/log2-font-width
|
||||
<span id="L86" class="LineNr"> 86 </span> c1 4/subop/shift-left *(ebp+24) 4/imm8/log2-font-height
|
||||
<span id="L87" class="LineNr"> 87 </span> <span class="subxComment"># esi = g</span>
|
||||
<span id="L88" class="LineNr"> 88 </span> 8b/-> *(ebp+0xc) 6/r32/esi
|
||||
<span id="L89" class="LineNr"> 89 </span> <span class="subxComment"># if (g >= 128) return # characters beyond ASCII currently not supported</span>
|
||||
<span id="L90" class="LineNr"> 90 </span> 81 7/subop/compare %esi 0x80/imm32
|
||||
<span id="L91" class="LineNr"> 91 </span> 0f 8d/jump-if->= $draw-grapheme-on-screen-buffer:end/disp32
|
||||
<span id="L92" class="LineNr"> 92 </span> <span class="subxComment"># var letter-bitmap/esi = font[g]</span>
|
||||
<span id="L93" class="LineNr"> 93 </span> c1 4/subop/shift-left %esi 4/imm8
|
||||
<span id="L94" class="LineNr"> 94 </span> 81 0/subop/add %esi <span class="SpecialChar"><a href='boot.subx.html#L671'>Font</a></span>/imm32
|
||||
<span id="L95" class="LineNr"> 95 </span> <span class="subxComment"># var ycurr/edx: int = y*16</span>
|
||||
<span id="L96" class="LineNr"> 96 </span> 8b/-> *(ebp+0x14) 2/r32/edx
|
||||
<span id="L97" class="LineNr"> 97 </span> c1 4/subop/shift-left %edx 4/imm8
|
||||
<span id="L98" class="LineNr"> 98 </span> <span class="subxComment"># var ymax/ebx: int = ycurr + 16</span>
|
||||
<span id="L99" class="LineNr"> 99 </span> 8b/-> *(ebp+0x14) 3/r32/ebx
|
||||
<span id="L100" class="LineNr">100 </span> c1 4/subop/shift-left %ebx 4/imm8
|
||||
<span id="L101" class="LineNr">101 </span> 81 0/subop/add %ebx 0x10/imm32
|
||||
<span id="L102" class="LineNr">102 </span> {
|
||||
<span id="L103" class="LineNr">103 </span> <span class="subxComment"># if (ycurr >= ymax) break</span>
|
||||
<span id="L104" class="LineNr">104 </span> 39/compare %edx 3/r32/ebx
|
||||
<span id="L105" class="LineNr">105 </span> 0f 8d/jump-if->= <span class="Constant">break</span>/disp32
|
||||
<span id="L106" class="LineNr">106 </span> <span class="subxComment"># var xcurr/eax: int = x*8 + 7</span>
|
||||
<span id="L107" class="LineNr">107 </span> 8b/-> *(ebp+0x10) 0/r32/eax <span class="subxComment"># font-width - 1</span>
|
||||
<span id="L108" class="LineNr">108 </span> c1 4/subop/shift-left %eax 3/imm8
|
||||
<span id="L109" class="LineNr">109 </span> 05/add-to-eax 7/imm32
|
||||
<span id="L110" class="LineNr">110 </span> <span class="subxComment"># var xmin/ecx: int = x*8</span>
|
||||
<span id="L111" class="LineNr">111 </span> 8b/-> *(ebp+0x10) 1/r32/ecx
|
||||
<span id="L112" class="LineNr">112 </span> c1 4/subop/shift-left %ecx 3/imm8
|
||||
<span id="L113" class="LineNr">113 </span> <span class="subxComment"># var row-bitmap/ebx: int = *letter-bitmap</span>
|
||||
<span id="L114" class="LineNr">114 </span> 53/push-ebx
|
||||
<span id="L115" class="LineNr">115 </span> 8b/-> *esi 3/r32/ebx
|
||||
<span id="L116" class="LineNr">116 </span> {
|
||||
<span id="L117" class="LineNr">117 </span> <span class="subxComment"># if (xcurr < xmin) break</span>
|
||||
<span id="L118" class="LineNr">118 </span> 39/compare %eax 1/r32/ecx
|
||||
<span id="L119" class="LineNr">119 </span> 7c/jump-if-< <span class="Constant">break</span>/disp8
|
||||
<span id="L120" class="LineNr">120 </span> <span class="subxComment"># shift LSB from row-bitmap into carry flag (CF)</span>
|
||||
<span id="L121" class="LineNr">121 </span> c1 5/subop/shift-right-logical %ebx 1/imm8
|
||||
<span id="L122" class="LineNr">122 </span> <span class="subxComment"># if LSB, draw a pixel in the given color</span>
|
||||
<span id="L123" class="LineNr">123 </span> {
|
||||
<span id="L124" class="LineNr">124 </span> 73/jump-if-not-CF <span class="Constant">break</span>/disp8
|
||||
<span id="L125" class="LineNr">125 </span> (<a href='101screen.subx.html#L21'>pixel-on-screen-buffer</a> *(ebp+8) %eax %edx *(ebp+0x18) *(ebp+0x20) *(ebp+0x24))
|
||||
<span id="L126" class="LineNr">126 </span> eb/jump $draw-grapheme-on-screen-buffer:continue/disp8
|
||||
<span id="L127" class="LineNr">127 </span> }
|
||||
<span id="L128" class="LineNr">128 </span> <span class="subxComment"># otherwise use the background color</span>
|
||||
<span id="L129" class="LineNr">129 </span> (<a href='101screen.subx.html#L21'>pixel-on-screen-buffer</a> *(ebp+8) %eax %edx *(ebp+0x1c) *(ebp+0x20) *(ebp+0x24))
|
||||
<span id="L130" class="LineNr">130 </span><span class="Constant">$draw-grapheme-on-screen-buffer:continue</span>:
|
||||
<span id="L131" class="LineNr">131 </span> <span class="subxComment"># --x</span>
|
||||
<span id="L132" class="LineNr">132 </span> 48/decrement-eax
|
||||
<span id="L133" class="LineNr">133 </span> <span class="subxComment">#</span>
|
||||
<span id="L134" class="LineNr">134 </span> eb/jump <span class="Constant">loop</span>/disp8
|
||||
<span id="L135" class="LineNr">135 </span> }
|
||||
<span id="L136" class="LineNr">136 </span> <span class="subxComment"># reclaim row-bitmap</span>
|
||||
<span id="L137" class="LineNr">137 </span> 5b/pop-to-ebx
|
||||
<span id="L138" class="LineNr">138 </span> <span class="subxComment"># ++y</span>
|
||||
<span id="L139" class="LineNr">139 </span> 42/increment-edx
|
||||
<span id="L140" class="LineNr">140 </span> <span class="subxComment"># next bitmap row</span>
|
||||
<span id="L141" class="LineNr">141 </span> 46/increment-esi
|
||||
<span id="L142" class="LineNr">142 </span> <span class="subxComment">#</span>
|
||||
<span id="L143" class="LineNr">143 </span> e9/jump <span class="Constant">loop</span>/disp32
|
||||
<span id="L144" class="LineNr">144 </span> }
|
||||
<span id="L145" class="LineNr">145 </span><span class="Constant">$draw-grapheme-on-screen-buffer:end</span>:
|
||||
<span id="L146" class="LineNr">146 </span> <span class="subxS1Comment"># . restore registers</span>
|
||||
<span id="L147" class="LineNr">147 </span> 5e/pop-to-esi
|
||||
<span id="L148" class="LineNr">148 </span> 5b/pop-to-ebx
|
||||
<span id="L149" class="LineNr">149 </span> 5a/pop-to-edx
|
||||
<span id="L150" class="LineNr">150 </span> 59/pop-to-ecx
|
||||
<span id="L151" class="LineNr">151 </span> 58/pop-to-eax
|
||||
<span id="L152" class="LineNr">152 </span> <span class="subxS1Comment"># . epilogue</span>
|
||||
<span id="L153" class="LineNr">153 </span> 89/<- %esp 5/r32/ebp
|
||||
<span id="L154" class="LineNr">154 </span> 5d/pop-to-ebp
|
||||
<span id="L155" class="LineNr">155 </span> c3/return
|
||||
<span id="L156" class="LineNr">156 </span>
|
||||
<span id="L157" class="LineNr">157 </span><span class="subxFunction">cursor-position-on-real-screen</span>: <span class="subxComment"># -> _/eax: int, _/ecx: int</span>
|
||||
<span id="L158" class="LineNr">158 </span> <span class="subxS1Comment"># . prologue</span>
|
||||
<span id="L159" class="LineNr">159 </span> 55/push-ebp
|
||||
<span id="L160" class="LineNr">160 </span> 89/<- %ebp 4/r32/esp
|
||||
<span id="L161" class="LineNr">161 </span> <span class="subxComment"># TODO: support fake screen; we currently assume 'screen' is always 0 (real)</span>
|
||||
<span id="L162" class="LineNr">162 </span> 8b/-> *<span class="SpecialChar"><a href='103grapheme.subx.html#L231'>Real-screen-cursor-x</a></span> 0/r32/eax
|
||||
<span id="L163" class="LineNr">163 </span> 8b/-> *<span class="SpecialChar"><a href='103grapheme.subx.html#L233'>Real-screen-cursor-y</a></span> 1/r32/ecx
|
||||
<span id="L164" class="LineNr">164 </span><span class="Constant">$cursor-position-on-real-screen:end</span>:
|
||||
<span id="L165" class="LineNr">165 </span> <span class="subxS1Comment"># . epilogue</span>
|
||||
<span id="L166" class="LineNr">166 </span> 89/<- %esp 5/r32/ebp
|
||||
<span id="L167" class="LineNr">167 </span> 5d/pop-to-ebp
|
||||
<span id="L168" class="LineNr">168 </span> c3/return
|
||||
<span id="L169" class="LineNr">169 </span>
|
||||
<span id="L170" class="LineNr">170 </span><span class="subxFunction">set-cursor-position-on-real-screen</span>: <span class="subxComment"># x: int, y: int</span>
|
||||
<span id="L171" class="LineNr">171 </span> <span class="subxS1Comment"># . prologue</span>
|
||||
<span id="L172" class="LineNr">172 </span> 55/push-ebp
|
||||
<span id="L173" class="LineNr">173 </span> 89/<- %ebp 4/r32/esp
|
||||
<span id="L174" class="LineNr">174 </span> <span class="subxS1Comment"># . save registers</span>
|
||||
<span id="L175" class="LineNr">175 </span> 50/push-eax
|
||||
<span id="L176" class="LineNr">176 </span> <span class="subxComment">#</span>
|
||||
<span id="L177" class="LineNr">177 </span> 8b/-> *(ebp+8) 0/r32/eax
|
||||
<span id="L178" class="LineNr">178 </span> 89/<- *<span class="SpecialChar"><a href='103grapheme.subx.html#L231'>Real-screen-cursor-x</a></span> 0/r32/eax
|
||||
<span id="L179" class="LineNr">179 </span> 8b/-> *(ebp+0xc) 0/r32/eax
|
||||
<span id="L180" class="LineNr">180 </span> 89/<- *<span class="SpecialChar"><a href='103grapheme.subx.html#L233'>Real-screen-cursor-y</a></span> 0/r32/eax
|
||||
<span id="L181" class="LineNr">181 </span><span class="Constant">$set-cursor-position-on-real-screen:end</span>:
|
||||
<span id="L182" class="LineNr">182 </span> <span class="subxS1Comment"># . restore registers</span>
|
||||
<span id="L183" class="LineNr">183 </span> 58/pop-to-eax
|
||||
<span id="L184" class="LineNr">184 </span> <span class="subxS1Comment"># . epilogue</span>
|
||||
<span id="L185" class="LineNr">185 </span> 89/<- %esp 5/r32/ebp
|
||||
<span id="L186" class="LineNr">186 </span> 5d/pop-to-ebp
|
||||
<span id="L187" class="LineNr">187 </span> c3/return
|
||||
<span id="L188" class="LineNr">188 </span>
|
||||
<span id="L189" class="LineNr">189 </span><span class="subxComment"># Not a real `show-cursor` primitive:</span>
|
||||
<span id="L190" class="LineNr">190 </span><span class="subxComment"># - does not clear previous location cursor was shown at.</span>
|
||||
<span id="L191" class="LineNr">191 </span><span class="subxComment"># - does not preserve what was at the cursor. Caller is responsible for</span>
|
||||
<span id="L192" class="LineNr">192 </span><span class="subxComment"># tracking what was on the screen at this position before and passing it</span>
|
||||
<span id="L193" class="LineNr">193 </span><span class="subxComment"># in again.</span>
|
||||
<span id="L194" class="LineNr">194 </span><span class="subxComment"># - does not stop showing the cursor at this location when the cursor moves</span>
|
||||
<span id="L195" class="LineNr">195 </span><span class="subxFunction">draw-cursor-on-real-screen</span>: <span class="subxComment"># g: grapheme</span>
|
||||
<span id="L196" class="LineNr">196 </span> <span class="subxS1Comment"># . prologue</span>
|
||||
<span id="L197" class="LineNr">197 </span> 55/push-ebp
|
||||
<span id="L198" class="LineNr">198 </span> 89/<- %ebp 4/r32/esp
|
||||
<span id="L199" class="LineNr">199 </span> <span class="subxS1Comment"># . save registers</span>
|
||||
<span id="L200" class="LineNr">200 </span> 50/push-eax
|
||||
<span id="L201" class="LineNr">201 </span> 51/push-ecx
|
||||
<span id="L202" class="LineNr">202 </span> <span class="subxComment">#</span>
|
||||
<span id="L203" class="LineNr">203 </span> (<a href='103grapheme.subx.html#L157'>cursor-position-on-real-screen</a>) <span class="subxComment"># => eax, ecx</span>
|
||||
<span id="L204" class="LineNr">204 </span> (<a href='103grapheme.subx.html#L17'>draw-grapheme-on-real-screen</a> *(ebp+8) %eax %ecx 0 7)
|
||||
<span id="L205" class="LineNr">205 </span><span class="Constant">$draw-cursor-on-real-screen:end</span>:
|
||||
<span id="L206" class="LineNr">206 </span> <span class="subxS1Comment"># . restore registers</span>
|
||||
<span id="L207" class="LineNr">207 </span> 59/pop-to-ecx
|
||||
<span id="L208" class="LineNr">208 </span> 58/pop-to-eax
|
||||
<span id="L209" class="LineNr">209 </span> <span class="subxS1Comment"># . epilogue</span>
|
||||
<span id="L210" class="LineNr">210 </span> 89/<- %esp 5/r32/ebp
|
||||
<span id="L211" class="LineNr">211 </span> 5d/pop-to-ebp
|
||||
<span id="L212" class="LineNr">212 </span> c3/return
|
||||
<span id="L213" class="LineNr">213 </span>
|
||||
<span id="L214" class="LineNr">214 </span>== data
|
||||
<span id="L215" class="LineNr">215 </span>
|
||||
<span id="L216" class="LineNr">216 </span><span class="subxComment"># The cursor is where certain Mu functions (usually of the form</span>
|
||||
<span id="L217" class="LineNr">217 </span><span class="subxComment"># 'draw*cursor*') print to by default.</span>
|
||||
<span id="L218" class="LineNr">218 </span><span class="subxComment">#</span>
|
||||
<span id="L219" class="LineNr">219 </span><span class="subxComment"># We don't bother displaying the cursor when drawing. It only becomes visible</span>
|
||||
<span id="L220" class="LineNr">220 </span><span class="subxComment"># on draw-cursor, which is quite rickety (see above)</span>
|
||||
<span id="L221" class="LineNr">221 </span><span class="subxComment">#</span>
|
||||
<span id="L222" class="LineNr">222 </span><span class="subxComment"># It's up to applications to manage cursor display:</span>
|
||||
<span id="L223" class="LineNr">223 </span><span class="subxComment"># - clean up where it used to be</span>
|
||||
<span id="L224" class="LineNr">224 </span><span class="subxComment"># - display the cursor before waiting for a key</span>
|
||||
<span id="L225" class="LineNr">225 </span><span class="subxComment"># - ensure its location appropriately suggests the effect keystrokes will have</span>
|
||||
<span id="L226" class="LineNr">226 </span><span class="subxComment"># - ensure its contents (and colors) appropriately reflect the state of the</span>
|
||||
<span id="L227" class="LineNr">227 </span><span class="subxComment"># screen</span>
|
||||
<span id="L228" class="LineNr">228 </span><span class="subxComment">#</span>
|
||||
<span id="L229" class="LineNr">229 </span><span class="subxComment"># There's no blinking, etc. We aren't using any hardware-supported text mode</span>
|
||||
<span id="L230" class="LineNr">230 </span><span class="subxComment"># here.</span>
|
||||
<span id="L231" class="LineNr">231 </span><span class="SpecialChar">Real-screen-cursor-x</span>:
|
||||
<span id="L232" class="LineNr">232 </span> 0/imm32
|
||||
<span id="L233" class="LineNr">233 </span><span class="SpecialChar">Real-screen-cursor-y</span>:
|
||||
<span id="L234" class="LineNr">234 </span> 0/imm32
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
27
html/104test.subx.html
generated
27
html/104test.subx.html
generated
|
@ -64,7 +64,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L7" class="LineNr"> 7 </span> 55/push-ebp
|
||||
<span id="L8" class="LineNr"> 8 </span> 89/<- %ebp 4/r32/esp
|
||||
<span id="L9" class="LineNr"> 9 </span> <span class="subxComment">#</span>
|
||||
<span id="L10" class="LineNr">10 </span> ff 0/subop/increment *<span class="SpecialChar"><a href='104test.subx.html#L31'>Num-test-failures</a></span>
|
||||
<span id="L10" class="LineNr">10 </span> ff 0/subop/increment *<span class="SpecialChar"><a href='104test.subx.html#L43'>Num-test-failures</a></span>
|
||||
<span id="L11" class="LineNr">11 </span><span class="Constant">$count-test-failure:end</span>:
|
||||
<span id="L12" class="LineNr">12 </span> <span class="subxS1Comment"># . epilogue</span>
|
||||
<span id="L13" class="LineNr">13 </span> 89/<- %esp 5/r32/ebp
|
||||
|
@ -76,17 +76,32 @@ if ('onhashchange' in window) {
|
|||
<span id="L19" class="LineNr">19 </span> 55/push-ebp
|
||||
<span id="L20" class="LineNr">20 </span> 89/<- %ebp 4/r32/esp
|
||||
<span id="L21" class="LineNr">21 </span> <span class="subxComment">#</span>
|
||||
<span id="L22" class="LineNr">22 </span> 8b/-> *<span class="SpecialChar"><a href='104test.subx.html#L31'>Num-test-failures</a></span> 0/r32/eax
|
||||
<span id="L22" class="LineNr">22 </span> 8b/-> *<span class="SpecialChar"><a href='104test.subx.html#L43'>Num-test-failures</a></span> 0/r32/eax
|
||||
<span id="L23" class="LineNr">23 </span><span class="Constant">$num-test-failures:end</span>:
|
||||
<span id="L24" class="LineNr">24 </span> <span class="subxS1Comment"># . epilogue</span>
|
||||
<span id="L25" class="LineNr">25 </span> 89/<- %esp 5/r32/ebp
|
||||
<span id="L26" class="LineNr">26 </span> 5d/pop-to-ebp
|
||||
<span id="L27" class="LineNr">27 </span> c3/return
|
||||
<span id="L28" class="LineNr">28 </span>
|
||||
<span id="L29" class="LineNr">29 </span>== data
|
||||
<span id="L30" class="LineNr">30 </span>
|
||||
<span id="L31" class="LineNr">31 </span><span class="SpecialChar">Num-test-failures</span>:
|
||||
<span id="L32" class="LineNr">32 </span> 0/imm32
|
||||
<span id="L29" class="LineNr">29 </span><span class="subxFunction">running-tests?</span>: <span class="subxComment"># -> _/eax: int</span>
|
||||
<span id="L30" class="LineNr">30 </span> <span class="subxS1Comment"># . prologue</span>
|
||||
<span id="L31" class="LineNr">31 </span> 55/push-ebp
|
||||
<span id="L32" class="LineNr">32 </span> 89/<- %ebp 4/r32/esp
|
||||
<span id="L33" class="LineNr">33 </span> <span class="subxComment">#</span>
|
||||
<span id="L34" class="LineNr">34 </span> 8b/-> *Running-tests? 0/r32/eax
|
||||
<span id="L35" class="LineNr">35 </span><span class="Constant">$running-tests?:end</span>:
|
||||
<span id="L36" class="LineNr">36 </span> <span class="subxS1Comment"># . epilogue</span>
|
||||
<span id="L37" class="LineNr">37 </span> 89/<- %esp 5/r32/ebp
|
||||
<span id="L38" class="LineNr">38 </span> 5d/pop-to-ebp
|
||||
<span id="L39" class="LineNr">39 </span> c3/return
|
||||
<span id="L40" class="LineNr">40 </span>
|
||||
<span id="L41" class="LineNr">41 </span>== data
|
||||
<span id="L42" class="LineNr">42 </span>
|
||||
<span id="L43" class="LineNr">43 </span><span class="SpecialChar">Num-test-failures</span>:
|
||||
<span id="L44" class="LineNr">44 </span> 0/imm32
|
||||
<span id="L45" class="LineNr">45 </span>
|
||||
<span id="L46" class="LineNr">46 </span>Running-tests?:
|
||||
<span id="L47" class="LineNr">47 </span> 1/imm32/true
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
4
html/108write.subx.html
generated
4
html/108write.subx.html
generated
|
@ -201,7 +201,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L141" class="LineNr">141 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span>
|
||||
<span id="L142" class="LineNr">142 </span> <span class="subxComment"># if (s == 0) return</span>
|
||||
<span id="L143" class="LineNr">143 </span> 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/disp8 0/imm32 <span class="subxComment"># compare *(ebp+12)</span>
|
||||
<span id="L144" class="LineNr">144 </span> 74/jump-if-= $write:end/disp8
|
||||
<span id="L144" class="LineNr">144 </span> 74/jump-if-= $try-write:end/disp8
|
||||
<span id="L145" class="LineNr">145 </span> <span class="subxS1Comment"># . save registers</span>
|
||||
<span id="L146" class="LineNr">146 </span> 51/push-ecx
|
||||
<span id="L147" class="LineNr">147 </span> <span class="subxComment"># if (f->size - f->write < s->size) return</span>
|
||||
|
@ -262,7 +262,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L202" class="LineNr">202 </span> 8b/copy 0/mod/indirect 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *ecx to eax</span>
|
||||
<span id="L203" class="LineNr">203 </span> <span class="subxS1Comment"># . restore registers</span>
|
||||
<span id="L204" class="LineNr">204 </span> 59/pop-to-ecx
|
||||
<span id="L205" class="LineNr">205 </span><span class="Constant">$space-remaining-in-stream:end</span>:
|
||||
<span id="L205" class="LineNr">205 </span><span class="Constant">$stream-size:end</span>:
|
||||
<span id="L206" class="LineNr">206 </span> <span class="subxS1Comment"># . epilogue</span>
|
||||
<span id="L207" class="LineNr">207 </span> 89/copy 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 5/r32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ebp to esp</span>
|
||||
<span id="L208" class="LineNr">208 </span> 5d/pop-to-ebp
|
||||
|
|
12
html/315stack-debug.subx.html
generated
12
html/315stack-debug.subx.html
generated
|
@ -92,12 +92,12 @@ if ('onhashchange' in window) {
|
|||
<span id="L34" class="LineNr"> 34 </span> <span class="subxComment">#</span>
|
||||
<span id="L35" class="LineNr"> 35 </span> 89/<- %edx 4/r32/esp
|
||||
<span id="L36" class="LineNr"> 36 </span> <span class="subxComment"># save old cursor position</span>
|
||||
<span id="L37" class="LineNr"> 37 </span> (<a href='500fake-screen.mu.html#L154'>cursor-position</a> 0) <span class="subxComment"># => eax, ecx</span>
|
||||
<span id="L37" class="LineNr"> 37 </span> (<a href='500fake-screen.mu.html#L174'>cursor-position</a> 0) <span class="subxComment"># => eax, ecx</span>
|
||||
<span id="L38" class="LineNr"> 38 </span> <span class="subxComment"># print at top-right</span>
|
||||
<span id="L39" class="LineNr"> 39 </span> (<a href='500fake-screen.mu.html#L170'>set-cursor-position</a> 0 0x70 0)
|
||||
<span id="L39" class="LineNr"> 39 </span> (<a href='500fake-screen.mu.html#L190'>set-cursor-position</a> 0 0x70 0)
|
||||
<span id="L40" class="LineNr"> 40 </span> (<a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 %edx 0xf 0xc)
|
||||
<span id="L41" class="LineNr"> 41 </span> <span class="subxComment"># restore cursor position</span>
|
||||
<span id="L42" class="LineNr"> 42 </span> (<a href='500fake-screen.mu.html#L170'>set-cursor-position</a> %eax %ecx)
|
||||
<span id="L42" class="LineNr"> 42 </span> (<a href='500fake-screen.mu.html#L190'>set-cursor-position</a> %eax %ecx)
|
||||
<span id="L43" class="LineNr"> 43 </span><span class="Constant">$show-stack-state:end</span>:
|
||||
<span id="L44" class="LineNr"> 44 </span> <span class="subxS1Comment"># . restore registers</span>
|
||||
<span id="L45" class="LineNr"> 45 </span> 5a/pop-to-edx
|
||||
|
@ -124,11 +124,11 @@ if ('onhashchange' in window) {
|
|||
<span id="L66" class="LineNr"> 66 </span> 74/jump-if-= <span class="Constant">break</span>/disp8
|
||||
<span id="L67" class="LineNr"> 67 </span> (<a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *(ebp+8) *(ebp+0xc) *(ebp+0x10))
|
||||
<span id="L68" class="LineNr"> 68 </span> <span class="subxComment"># clear the screen and continue if we got too close to the bottom</span>
|
||||
<span id="L69" class="LineNr"> 69 </span> (<a href='500fake-screen.mu.html#L154'>cursor-position</a> 0) <span class="subxComment"># => eax, ecx</span>
|
||||
<span id="L69" class="LineNr"> 69 </span> (<a href='500fake-screen.mu.html#L174'>cursor-position</a> 0) <span class="subxComment"># => eax, ecx</span>
|
||||
<span id="L70" class="LineNr"> 70 </span> 81 7/subop/compare %ecx 0x28/imm32
|
||||
<span id="L71" class="LineNr"> 71 </span> 75/jump-if-!= <span class="Constant">break</span>/disp8
|
||||
<span id="L72" class="LineNr"> 72 </span> (<a href='500fake-screen.mu.html#L231'>clear-screen</a> 0)
|
||||
<span id="L73" class="LineNr"> 73 </span> (<a href='500fake-screen.mu.html#L170'>set-cursor-position</a> 0 0 0)
|
||||
<span id="L72" class="LineNr"> 72 </span> (<a href='500fake-screen.mu.html#L251'>clear-screen</a> 0)
|
||||
<span id="L73" class="LineNr"> 73 </span> (<a href='500fake-screen.mu.html#L190'>set-cursor-position</a> 0 0 0)
|
||||
<span id="L74" class="LineNr"> 74 </span> }
|
||||
<span id="L75" class="LineNr"> 75 </span><span class="Constant">$debug-print:end</span>:
|
||||
<span id="L76" class="LineNr"> 76 </span> <span class="subxS1Comment"># . restore registers</span>
|
||||
|
|
10
html/317abort.subx.html
generated
10
html/317abort.subx.html
generated
|
@ -65,7 +65,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L7" class="LineNr"> 7 </span> 55/push-ebp
|
||||
<span id="L8" class="LineNr"> 8 </span> 89/<- %ebp 4/r32/esp
|
||||
<span id="L9" class="LineNr"> 9 </span> <span class="subxComment">#</span>
|
||||
<span id="L10" class="LineNr"> 10 </span> (<a href='103grapheme.subx.html#L109'>set-cursor-position-on-real-screen</a> 0 0)
|
||||
<span id="L10" class="LineNr"> 10 </span> (<a href='103grapheme.subx.html#L170'>set-cursor-position-on-real-screen</a> 0 0)
|
||||
<span id="L11" class="LineNr"> 11 </span> (<a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *(ebp+8) 0xf 0xc) <span class="subxComment"># 0/real-screen, 0xf/fg=white, 0xc/bg=red</span>
|
||||
<span id="L12" class="LineNr"> 12 </span> (<a href='317abort.subx.html#L21'>dump-call-stack</a>)
|
||||
<span id="L13" class="LineNr"> 13 </span> <span class="subxComment"># crash</span>
|
||||
|
@ -140,10 +140,10 @@ if ('onhashchange' in window) {
|
|||
<span id="L82" class="LineNr"> 82 </span> c7 0/subop/copy *(ecx+4) 0/imm32 <span class="subxComment"># read index</span>
|
||||
<span id="L83" class="LineNr"> 83 </span> c7 0/subop/copy *(ecx+8) 0x01000000/imm32 <span class="subxComment"># stream capacity = 16MB</span>
|
||||
<span id="L84" class="LineNr"> 84 </span> <span class="subxComment"># load 0x400 sectors starting from sector 10080 = 0x2760</span>
|
||||
<span id="L85" class="LineNr"> 85 </span> (<a href='boot.subx.html#L960'>load-sectors</a> <span class="SpecialChar"><a href='boot.subx.html#L908'>Primary-bus-primary-drive</a></span> 0x2760 0x100 %ecx)
|
||||
<span id="L86" class="LineNr"> 86 </span> (<a href='boot.subx.html#L960'>load-sectors</a> <span class="SpecialChar"><a href='boot.subx.html#L908'>Primary-bus-primary-drive</a></span> 0x2860 0x100 %ecx)
|
||||
<span id="L87" class="LineNr"> 87 </span> (<a href='boot.subx.html#L960'>load-sectors</a> <span class="SpecialChar"><a href='boot.subx.html#L908'>Primary-bus-primary-drive</a></span> 0x2960 0x100 %ecx)
|
||||
<span id="L88" class="LineNr"> 88 </span> (<a href='boot.subx.html#L960'>load-sectors</a> <span class="SpecialChar"><a href='boot.subx.html#L908'>Primary-bus-primary-drive</a></span> 0x2a60 0x100 %ecx)
|
||||
<span id="L85" class="LineNr"> 85 </span> (<a href='boot.subx.html#L974'>load-sectors</a> <span class="SpecialChar"><a href='boot.subx.html#L922'>Primary-bus-primary-drive</a></span> 0x2760 0x100 %ecx)
|
||||
<span id="L86" class="LineNr"> 86 </span> (<a href='boot.subx.html#L974'>load-sectors</a> <span class="SpecialChar"><a href='boot.subx.html#L922'>Primary-bus-primary-drive</a></span> 0x2860 0x100 %ecx)
|
||||
<span id="L87" class="LineNr"> 87 </span> (<a href='boot.subx.html#L974'>load-sectors</a> <span class="SpecialChar"><a href='boot.subx.html#L922'>Primary-bus-primary-drive</a></span> 0x2960 0x100 %ecx)
|
||||
<span id="L88" class="LineNr"> 88 </span> (<a href='boot.subx.html#L974'>load-sectors</a> <span class="SpecialChar"><a href='boot.subx.html#L922'>Primary-bus-primary-drive</a></span> 0x2a60 0x100 %ecx)
|
||||
<span id="L89" class="LineNr"> 89 </span> <span class="subxH1Comment"># - parse pointers to portions of this stream into labels</span>
|
||||
<span id="L90" class="LineNr"> 90 </span> <span class="subxComment"># var curr/ecx: (addr byte) = s->data</span>
|
||||
<span id="L91" class="LineNr"> 91 </span> 81 0/subop/add %ecx 0xc/imm32
|
||||
|
|
217
html/400.mu.html
generated
217
html/400.mu.html
generated
|
@ -16,7 +16,10 @@ a { color:inherit; }
|
|||
* { font-size:12pt; font-size: 1em; }
|
||||
.PreProc { color: #c000c0; }
|
||||
.LineNr { }
|
||||
.Constant { color: #008787; }
|
||||
.muRegEdx { color: #878700; }
|
||||
.muRegEbx { color: #8787af; }
|
||||
.muRegEax { color: #875f00; }
|
||||
.muRegEcx { color: #af875f; }
|
||||
.muComment { color: #005faf; }
|
||||
-->
|
||||
</style>
|
||||
|
@ -56,111 +59,113 @@ if ('onhashchange' in window) {
|
|||
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># screen</span>
|
||||
<span id="L2" class="LineNr"> 2 </span><span class="PreProc">sig</span> <a href='101screen.subx.html#L8'>pixel-on-real-screen</a> x: int, y: int, color: int
|
||||
<span id="L3" class="LineNr"> 3 </span><span class="PreProc">sig</span> <a href='103grapheme.subx.html#L17'>draw-grapheme-on-real-screen</a> g: grapheme, x: int, y: int, color: int, background-color: int
|
||||
<span id="L4" class="LineNr"> 4 </span><span class="PreProc">sig</span> <a href='103grapheme.subx.html#L96'>cursor-position-on-real-screen</a><span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int
|
||||
<span id="L5" class="LineNr"> 5 </span><span class="PreProc">sig</span> <a href='103grapheme.subx.html#L109'>set-cursor-position-on-real-screen</a> x: int, y: int
|
||||
<span id="L6" class="LineNr"> 6 </span><span class="PreProc">sig</span> <a href='103grapheme.subx.html#L134'>draw-cursor-on-real-screen</a> g: grapheme
|
||||
<span id="L7" class="LineNr"> 7 </span><span class="PreProc">sig</span> <a href='316colors.subx.html#L7'>color-rgb</a> color: int<span class="PreProc"> -> </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"> -> </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#L960'>load-sectors</a> disk: (addr disk), lba: int, n: int, out: (addr stream byte)
|
||||
<span id="L14" class="LineNr"> 14 </span><span class="PreProc">sig</span> <a href='boot.subx.html#L1023'>store-sectors</a> disk: (addr disk), lba: int, n: int, out: (addr stream byte)
|
||||
<span id="L15" class="LineNr"> 15 </span>
|
||||
<span id="L16" class="LineNr"> 16 </span><span class="muComment"># mouse</span>
|
||||
<span id="L17" class="LineNr"> 17 </span><span class="PreProc">sig</span> <a href='boot.subx.html#L1429'>read-mouse-event</a><span class="PreProc"> -> </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"> -> </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"> -> </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"> -> </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"> -> </span>_/<span class="Constant">eax</span>: boolean
|
||||
<span id="L32" class="LineNr"> 32 </span><span class="PreProc">sig</span> <a href='315stack-debug.subx.html#L96'>turn-on-debug-print</a>
|
||||
<span id="L33" class="LineNr"> 33 </span><span class="PreProc">sig</span> <a href='315stack-debug.subx.html#L108'>turn-off-debug-print</a>
|
||||
<span id="L34" class="LineNr"> 34 </span><span class="PreProc">sig</span> <a href='317abort.subx.html#L5'>abort</a> e: (addr array byte)
|
||||
<span id="L35" class="LineNr"> 35 </span><span class="PreProc">sig</span> <a href='317abort.subx.html#L21'>dump-call-stack</a>
|
||||
<span id="L36" class="LineNr"> 36 </span>
|
||||
<span id="L37" class="LineNr"> 37 </span><span class="PreProc">sig</span> <a href='318counter.subx.html#L5'>count-event</a>
|
||||
<span id="L38" class="LineNr"> 38 </span><span class="PreProc">sig</span> <a href='318counter.subx.html#L17'>count-of-events</a><span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int
|
||||
<span id="L39" class="LineNr"> 39 </span>
|
||||
<span id="L40" class="LineNr"> 40 </span><span class="muComment"># streams</span>
|
||||
<span id="L41" class="LineNr"> 41 </span><span class="PreProc">sig</span> <a href='106stream.subx.html#L20'>clear-stream</a> f: (addr stream _)
|
||||
<span id="L42" class="LineNr"> 42 </span><span class="PreProc">sig</span> <a href='106stream.subx.html#L59'>rewind-stream</a> f: (addr stream _)
|
||||
<span id="L43" class="LineNr"> 43 </span><span class="PreProc">sig</span> <a href='109stream-equal.subx.html#L9'>stream-data-equal?</a> f: (addr stream byte), s: (addr array byte)<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: boolean
|
||||
<span id="L44" class="LineNr"> 44 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L211'>streams-data-equal?</a> f: (addr stream byte), s: (addr stream byte)<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: boolean
|
||||
<span id="L45" class="LineNr"> 45 </span><span class="PreProc">sig</span> <a href='109stream-equal.subx.html#L194'>check-stream-equal</a> f: (addr stream byte), s: (addr array byte), msg: (addr array byte)
|
||||
<span id="L46" class="LineNr"> 46 </span><span class="PreProc">sig</span> <a href='109stream-equal.subx.html#L230'>next-stream-line-equal?</a> f: (addr stream byte), s: (addr array byte)<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: boolean
|
||||
<span id="L47" class="LineNr"> 47 </span><span class="PreProc">sig</span> <a href='109stream-equal.subx.html#L565'>check-next-stream-line-equal</a> f: (addr stream byte), s: (addr array byte), msg: (addr array byte)
|
||||
<span id="L48" class="LineNr"> 48 </span><span class="PreProc">sig</span> <a href='108write.subx.html#L11'>write</a> f: (addr stream byte), s: (addr array byte)
|
||||
<span id="L49" class="LineNr"> 49 </span><span class="PreProc">sig</span> <a href='108write.subx.html#L138'>try-write</a> f: (addr stream byte), s: (addr array byte)<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: boolean
|
||||
<span id="L50" class="LineNr"> 50 </span><span class="muComment"># probably a bad idea; I definitely want to discourage its use for streams of non-bytes</span>
|
||||
<span id="L51" class="LineNr"> 51 </span><span class="PreProc">sig</span> <a href='108write.subx.html#L194'>stream-size</a> f: (addr stream byte)<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int
|
||||
<span id="L52" class="LineNr"> 52 </span><span class="PreProc">sig</span> <a href='108write.subx.html#L176'>space-remaining-in-stream</a> f: (addr stream byte)<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int
|
||||
<span id="L53" class="LineNr"> 53 </span><span class="PreProc">sig</span> <a href='113write-stream.subx.html#L8'>write-stream</a> f: (addr stream byte), s: (addr stream byte)
|
||||
<span id="L54" class="LineNr"> 54 </span><span class="PreProc">sig</span> <a href='112read-byte.subx.html#L13'>read-byte</a> s: (addr stream byte)<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: byte
|
||||
<span id="L55" class="LineNr"> 55 </span><span class="PreProc">sig</span> <a href='115write-byte.subx.html#L12'>append-byte</a> f: (addr stream byte), n: int <span class="muComment"># really just a byte, but I want to pass in literal numbers</span>
|
||||
<span id="L56" class="LineNr"> 56 </span><span class="muComment">#sig to-hex-char in/eax: int -> out/eax: int</span>
|
||||
<span id="L57" class="LineNr"> 57 </span><span class="PreProc">sig</span> <a href='117write-int-hex.subx.html#L21'>append-byte-hex</a> f: (addr stream byte), n: int <span class="muComment"># really just a byte, but I want to pass in literal numbers</span>
|
||||
<span id="L58" class="LineNr"> 58 </span><span class="PreProc">sig</span> <a href='117write-int-hex.subx.html#L92'>write-int32-hex</a> f: (addr stream byte), n: int
|
||||
<span id="L59" class="LineNr"> 59 </span><span class="PreProc">sig</span> <a href='117write-int-hex.subx.html#L123'>write-int32-hex-bits</a> f: (addr stream byte), n: int, bits: int
|
||||
<span id="L60" class="LineNr"> 60 </span><span class="PreProc">sig</span> <a href='118parse-hex-int.subx.html#L9'>hex-int?</a> in: (addr slice)<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: boolean
|
||||
<span id="L61" class="LineNr"> 61 </span><span class="PreProc">sig</span> <a href='118parse-hex-int.subx.html#L354'>parse-hex-int</a> in: (addr array byte)<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int
|
||||
<span id="L62" class="LineNr"> 62 </span><span class="PreProc">sig</span> <a href='118parse-hex-int.subx.html#L387'>parse-hex-int-from-slice</a> in: (addr slice)<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int
|
||||
<span id="L63" class="LineNr"> 63 </span><span class="muComment">#sig parse-hex-int-helper start: (addr byte), end: (addr byte) -> _/eax: int</span>
|
||||
<span id="L64" class="LineNr"> 64 </span><span class="PreProc">sig</span> <a href='118parse-hex-int.subx.html#L701'>hex-digit?</a> c: byte<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: boolean
|
||||
<span id="L65" class="LineNr"> 65 </span><span class="muComment">#sig from-hex-char in/eax: byte -> out/eax: nibble</span>
|
||||
<span id="L66" class="LineNr"> 66 </span><span class="PreProc">sig</span> <a href='311decimal-int.subx.html#L23'>parse-decimal-int</a> in: (addr array byte)<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int
|
||||
<span id="L67" class="LineNr"> 67 </span><span class="PreProc">sig</span> <a href='311decimal-int.subx.html#L4'>parse-decimal-int-from-slice</a> in: (addr slice)<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int
|
||||
<span id="L68" class="LineNr"> 68 </span><span class="PreProc">sig</span> <a href='311decimal-int.subx.html#L48'>parse-decimal-int-from-stream</a> in: (addr stream byte)<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int
|
||||
<span id="L69" class="LineNr"> 69 </span><span class="muComment">#sig parse-decimal-int-helper start: (addr byte), end: (addr byte) -> _/eax: int</span>
|
||||
<span id="L70" class="LineNr"> 70 </span><span class="PreProc">sig</span> <a href='311decimal-int.subx.html#L312'>decimal-size</a> n: int<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int
|
||||
<span id="L71" class="LineNr"> 71 </span><span class="muComment">#sig allocate ad: (addr allocation-descriptor), n: int, out: (addr handle _)</span>
|
||||
<span id="L72" class="LineNr"> 72 </span><span class="muComment">#sig allocate-raw ad: (addr allocation-descriptor), n: int, out: (addr handle _)</span>
|
||||
<span id="L73" class="LineNr"> 73 </span><span class="PreProc">sig</span> <a href='120allocate.subx.html#L223'>lookup</a> h: (handle _T)<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: (addr _T)
|
||||
<span id="L74" class="LineNr"> 74 </span><span class="PreProc">sig</span> <a href='120allocate.subx.html#L448'>handle-equal?</a> a: (handle _T), b: (handle _T)<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: boolean
|
||||
<span id="L75" class="LineNr"> 75 </span><span class="PreProc">sig</span> <a href='120allocate.subx.html#L479'>copy-handle</a> src: (handle _T), dest: (addr handle _T)
|
||||
<span id="L76" class="LineNr"> 76 </span><span class="muComment">#sig allocate-region ad: (addr allocation-descriptor), n: int, out: (addr handle allocation-descriptor)</span>
|
||||
<span id="L77" class="LineNr"> 77 </span><span class="muComment">#sig allocate-array ad: (addr allocation-descriptor), n: int, out: (addr handle _)</span>
|
||||
<span id="L78" class="LineNr"> 78 </span><span class="PreProc">sig</span> <a href='120allocate.subx.html#L690'>copy-array</a> ad: (addr allocation-descriptor), src: (addr array _T), out: (addr handle array _T)
|
||||
<span id="L79" class="LineNr"> 79 </span><span class="muComment">#sig zero-out start: (addr byte), size: int</span>
|
||||
<span id="L80" class="LineNr"> 80 </span><span class="PreProc">sig</span> <a href='123slice.subx.html#L9'>slice-empty?</a> s: (addr slice)<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: boolean
|
||||
<span id="L81" class="LineNr"> 81 </span><span class="PreProc">sig</span> <a href='123slice.subx.html#L120'>slice-equal?</a> s: (addr slice), p: (addr array byte)<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: boolean
|
||||
<span id="L82" class="LineNr"> 82 </span><span class="PreProc">sig</span> <a href='123slice.subx.html#L487'>slice-starts-with?</a> s: (addr slice), head: (addr array byte)<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: boolean
|
||||
<span id="L83" class="LineNr"> 83 </span><span class="PreProc">sig</span> <a href='123slice.subx.html#L793'>write-slice</a> out: (addr stream byte), s: (addr slice)
|
||||
<span id="L84" class="LineNr"> 84 </span><span class="muComment"># bad name alert</span>
|
||||
<span id="L85" class="LineNr"> 85 </span><span class="PreProc">sig</span> <a href='123slice.subx.html#L898'>slice-to-string</a> ad: (addr allocation-descriptor), in: (addr slice), out: (addr handle array byte)
|
||||
<span id="L86" class="LineNr"> 86 </span><span class="PreProc">sig</span> <a href='126write-int-decimal.subx.html#L8'>write-int32-decimal</a> out: (addr stream byte), n: int
|
||||
<span id="L87" class="LineNr"> 87 </span><span class="PreProc">sig</span> <a href='126write-int-decimal.subx.html#L296'>decimal-digit?</a> c: grapheme<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: boolean
|
||||
<span id="L88" class="LineNr"> 88 </span><span class="PreProc">sig</span> <a href='126write-int-decimal.subx.html#L395'>to-decimal-digit</a> in: grapheme<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int
|
||||
<span id="L89" class="LineNr"> 89 </span><span class="muComment"># bad name alert</span>
|
||||
<span id="L90" class="LineNr"> 90 </span><span class="muComment"># next-word really tokenizes</span>
|
||||
<span id="L91" class="LineNr"> 91 </span><span class="muComment"># next-raw-word really reads whitespace-separated words</span>
|
||||
<span id="L92" class="LineNr"> 92 </span><span class="PreProc">sig</span> <a href='127next-word.subx.html#L11'>next-word</a> line: (addr stream byte), out: (addr slice) <span class="muComment"># skips '#' comments</span>
|
||||
<span id="L93" class="LineNr"> 93 </span><span class="PreProc">sig</span> <a href='127next-word.subx.html#L306'>next-raw-word</a> line: (addr stream byte), out: (addr slice) <span class="muComment"># does not skip '#' comments</span>
|
||||
<span id="L94" class="LineNr"> 94 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L6'>stream-empty?</a> s: (addr stream _)<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: boolean
|
||||
<span id="L95" class="LineNr"> 95 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L30'>stream-full?</a> s: (addr stream _)<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: boolean
|
||||
<span id="L96" class="LineNr"> 96 </span><span class="PreProc">sig</span> <a href='310copy-bytes.subx.html#L60'>stream-to-array</a> in: (addr stream _), out: (addr handle array _)
|
||||
<span id="L97" class="LineNr"> 97 </span><span class="PreProc">sig</span> <a href='310copy-bytes.subx.html#L120'>unquote-stream-to-array</a> in: (addr stream _), out: (addr handle array _)
|
||||
<span id="L98" class="LineNr"> 98 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L154'>stream-first</a> s: (addr stream byte)<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: byte
|
||||
<span id="L99" class="LineNr"> 99 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L181'>stream-final</a> s: (addr stream byte)<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: byte
|
||||
<span id="L100" class="LineNr">100 </span>
|
||||
<span id="L101" class="LineNr">101 </span><span class="muComment">#sig copy-bytes src: (addr byte), dest: (addr byte), n: int</span>
|
||||
<span id="L102" class="LineNr">102 </span><span class="PreProc">sig</span> <a href='312copy.subx.html#L3'>copy-array-object</a> src: (addr array _), dest-ah: (addr handle array _)
|
||||
<span id="L103" class="LineNr">103 </span><span class="PreProc">sig</span> <a href='301array-equal.subx.html#L5'>array-equal?</a> a: (addr array int), b: (addr array int)<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: boolean
|
||||
<span id="L104" class="LineNr">104 </span><span class="PreProc">sig</span> <a href='301array-equal.subx.html#L368'>parse-array-of-ints</a> s: (addr array byte), out: (addr handle array int)
|
||||
<span id="L105" class="LineNr">105 </span><span class="PreProc">sig</span> <a href='311decimal-int.subx.html#L623'>parse-array-of-decimal-ints</a> s: (addr array byte), out: (addr handle array int)
|
||||
<span id="L106" class="LineNr">106 </span><span class="PreProc">sig</span> <a href='301array-equal.subx.html#L382'>check-array-equal</a> a: (addr array int), expected: (addr string), msg: (addr string)
|
||||
<span id="L107" class="LineNr">107 </span>
|
||||
<span id="L108" class="LineNr">108 </span><span class="PreProc">sig</span> <a href='314divide.subx.html#L3'>integer-divide</a> a: int, b: int<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">edx</span>: int
|
||||
<span id="L4" class="LineNr"> 4 </span><span class="PreProc">sig</span> <a href='103grapheme.subx.html#L29'>draw-grapheme-on-screen-array</a> screen-data: (addr array byte), g: grapheme, x: int, y: int, color: int, background-color: int, screen-width: int, screen-height: int
|
||||
<span id="L5" class="LineNr"> 5 </span><span class="PreProc">sig</span> <a href='103grapheme.subx.html#L157'>cursor-position-on-real-screen</a><span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int, _/<span class="muRegEcx">ecx</span>: int
|
||||
<span id="L6" class="LineNr"> 6 </span><span class="PreProc">sig</span> <a href='103grapheme.subx.html#L170'>set-cursor-position-on-real-screen</a> x: int, y: int
|
||||
<span id="L7" class="LineNr"> 7 </span><span class="PreProc">sig</span> <a href='103grapheme.subx.html#L195'>draw-cursor-on-real-screen</a> g: grapheme
|
||||
<span id="L8" class="LineNr"> 8 </span><span class="PreProc">sig</span> <a href='316colors.subx.html#L7'>color-rgb</a> color: int<span class="PreProc"> -> </span>_/<span class="muRegEcx">ecx</span>: int, _/<span class="muRegEdx">edx</span>: int, _/<span class="muRegEbx">ebx</span>: int
|
||||
<span id="L9" class="LineNr"> 9 </span>
|
||||
<span id="L10" class="LineNr"> 10 </span><span class="muComment"># keyboard</span>
|
||||
<span id="L11" class="LineNr"> 11 </span><span class="PreProc">sig</span> <a href='102keyboard.subx.html#L21'>read-key</a> kbd: (addr keyboard)<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: byte
|
||||
<span id="L12" class="LineNr"> 12 </span>
|
||||
<span id="L13" class="LineNr"> 13 </span><span class="muComment"># disk</span>
|
||||
<span id="L14" class="LineNr"> 14 </span><span class="PreProc">sig</span> <a href='boot.subx.html#L974'>load-sectors</a> disk: (addr disk), lba: int, n: int, out: (addr stream byte)
|
||||
<span id="L15" class="LineNr"> 15 </span><span class="PreProc">sig</span> <a href='boot.subx.html#L1037'>store-sectors</a> disk: (addr disk), lba: int, n: int, out: (addr stream byte)
|
||||
<span id="L16" class="LineNr"> 16 </span>
|
||||
<span id="L17" class="LineNr"> 17 </span><span class="muComment"># mouse</span>
|
||||
<span id="L18" class="LineNr"> 18 </span><span class="PreProc">sig</span> <a href='boot.subx.html#L1443'>read-mouse-event</a><span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int, _/<span class="muRegEcx">ecx</span>: int
|
||||
<span id="L19" class="LineNr"> 19 </span>
|
||||
<span id="L20" class="LineNr"> 20 </span><span class="muComment"># tests</span>
|
||||
<span id="L21" class="LineNr"> 21 </span><span class="PreProc">sig</span> <a href='104test.subx.html#L5'>count-test-failure</a>
|
||||
<span id="L22" class="LineNr"> 22 </span><span class="PreProc">sig</span> <a href='104test.subx.html#L17'>num-test-failures</a><span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int
|
||||
<span id="L23" class="LineNr"> 23 </span><span class="PreProc">sig</span> <a href='104test.subx.html#L29'>running-tests?</a><span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: boolean
|
||||
<span id="L24" class="LineNr"> 24 </span>
|
||||
<span id="L25" class="LineNr"> 25 </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"> -> </span>_/<span class="muRegEax">eax</span>: boolean
|
||||
<span id="L26" class="LineNr"> 26 </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"> -> </span>_/<span class="muRegEax">eax</span>: boolean
|
||||
<span id="L27" class="LineNr"> 27 </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="L28" class="LineNr"> 28 </span>
|
||||
<span id="L29" class="LineNr"> 29 </span><span class="muComment"># debugging</span>
|
||||
<span id="L30" class="LineNr"> 30 </span><span class="PreProc">sig</span> <a href='315stack-debug.subx.html#L5'>check-stack</a>
|
||||
<span id="L31" class="LineNr"> 31 </span><span class="PreProc">sig</span> <a href='315stack-debug.subx.html#L26'>show-stack-state</a>
|
||||
<span id="L32" class="LineNr"> 32 </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="L33" class="LineNr"> 33 </span><span class="PreProc">sig</span> <a href='315stack-debug.subx.html#L84'>debug-print?</a><span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: boolean
|
||||
<span id="L34" class="LineNr"> 34 </span><span class="PreProc">sig</span> <a href='315stack-debug.subx.html#L96'>turn-on-debug-print</a>
|
||||
<span id="L35" class="LineNr"> 35 </span><span class="PreProc">sig</span> <a href='315stack-debug.subx.html#L108'>turn-off-debug-print</a>
|
||||
<span id="L36" class="LineNr"> 36 </span><span class="PreProc">sig</span> <a href='317abort.subx.html#L5'>abort</a> e: (addr array byte)
|
||||
<span id="L37" class="LineNr"> 37 </span><span class="PreProc">sig</span> <a href='317abort.subx.html#L21'>dump-call-stack</a>
|
||||
<span id="L38" class="LineNr"> 38 </span>
|
||||
<span id="L39" class="LineNr"> 39 </span><span class="PreProc">sig</span> <a href='318counter.subx.html#L5'>count-event</a>
|
||||
<span id="L40" class="LineNr"> 40 </span><span class="PreProc">sig</span> <a href='318counter.subx.html#L17'>count-of-events</a><span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int
|
||||
<span id="L41" class="LineNr"> 41 </span>
|
||||
<span id="L42" class="LineNr"> 42 </span><span class="muComment"># streams</span>
|
||||
<span id="L43" class="LineNr"> 43 </span><span class="PreProc">sig</span> <a href='106stream.subx.html#L20'>clear-stream</a> f: (addr stream _)
|
||||
<span id="L44" class="LineNr"> 44 </span><span class="PreProc">sig</span> <a href='106stream.subx.html#L59'>rewind-stream</a> f: (addr stream _)
|
||||
<span id="L45" class="LineNr"> 45 </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"> -> </span>_/<span class="muRegEax">eax</span>: boolean
|
||||
<span id="L46" class="LineNr"> 46 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L211'>streams-data-equal?</a> f: (addr stream byte), s: (addr stream byte)<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: boolean
|
||||
<span id="L47" class="LineNr"> 47 </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="L48" class="LineNr"> 48 </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"> -> </span>_/<span class="muRegEax">eax</span>: boolean
|
||||
<span id="L49" class="LineNr"> 49 </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="L50" class="LineNr"> 50 </span><span class="PreProc">sig</span> <a href='108write.subx.html#L11'>write</a> f: (addr stream byte), s: (addr array byte)
|
||||
<span id="L51" class="LineNr"> 51 </span><span class="PreProc">sig</span> <a href='108write.subx.html#L138'>try-write</a> f: (addr stream byte), s: (addr array byte)<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: boolean
|
||||
<span id="L52" class="LineNr"> 52 </span><span class="muComment"># probably a bad idea; I definitely want to discourage its use for streams of non-bytes</span>
|
||||
<span id="L53" class="LineNr"> 53 </span><span class="PreProc">sig</span> <a href='108write.subx.html#L194'>stream-size</a> f: (addr stream byte)<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int
|
||||
<span id="L54" class="LineNr"> 54 </span><span class="PreProc">sig</span> <a href='108write.subx.html#L176'>space-remaining-in-stream</a> f: (addr stream byte)<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int
|
||||
<span id="L55" class="LineNr"> 55 </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="L56" class="LineNr"> 56 </span><span class="PreProc">sig</span> <a href='112read-byte.subx.html#L13'>read-byte</a> s: (addr stream byte)<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: byte
|
||||
<span id="L57" class="LineNr"> 57 </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="L58" class="LineNr"> 58 </span><span class="muComment">#sig to-hex-char in/eax: int -> out/eax: int</span>
|
||||
<span id="L59" class="LineNr"> 59 </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="L60" class="LineNr"> 60 </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="L61" class="LineNr"> 61 </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="L62" class="LineNr"> 62 </span><span class="PreProc">sig</span> <a href='118parse-hex-int.subx.html#L9'>hex-int?</a> in: (addr slice)<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: boolean
|
||||
<span id="L63" class="LineNr"> 63 </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"> -> </span>_/<span class="muRegEax">eax</span>: int
|
||||
<span id="L64" class="LineNr"> 64 </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"> -> </span>_/<span class="muRegEax">eax</span>: int
|
||||
<span id="L65" class="LineNr"> 65 </span><span class="muComment">#sig parse-hex-int-helper start: (addr byte), end: (addr byte) -> _/eax: int</span>
|
||||
<span id="L66" class="LineNr"> 66 </span><span class="PreProc">sig</span> <a href='118parse-hex-int.subx.html#L701'>hex-digit?</a> c: byte<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: boolean
|
||||
<span id="L67" class="LineNr"> 67 </span><span class="muComment">#sig from-hex-char in/eax: byte -> out/eax: nibble</span>
|
||||
<span id="L68" class="LineNr"> 68 </span><span class="PreProc">sig</span> <a href='311decimal-int.subx.html#L23'>parse-decimal-int</a> in: (addr array byte)<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int
|
||||
<span id="L69" class="LineNr"> 69 </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"> -> </span>_/<span class="muRegEax">eax</span>: int
|
||||
<span id="L70" class="LineNr"> 70 </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"> -> </span>_/<span class="muRegEax">eax</span>: int
|
||||
<span id="L71" class="LineNr"> 71 </span><span class="muComment">#sig parse-decimal-int-helper start: (addr byte), end: (addr byte) -> _/eax: int</span>
|
||||
<span id="L72" class="LineNr"> 72 </span><span class="PreProc">sig</span> <a href='311decimal-int.subx.html#L312'>decimal-size</a> n: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int
|
||||
<span id="L73" class="LineNr"> 73 </span><span class="muComment">#sig allocate ad: (addr allocation-descriptor), n: int, out: (addr handle _)</span>
|
||||
<span id="L74" class="LineNr"> 74 </span><span class="muComment">#sig allocate-raw ad: (addr allocation-descriptor), n: int, out: (addr handle _)</span>
|
||||
<span id="L75" class="LineNr"> 75 </span><span class="PreProc">sig</span> <a href='120allocate.subx.html#L223'>lookup</a> h: (handle _T)<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: (addr _T)
|
||||
<span id="L76" class="LineNr"> 76 </span><span class="PreProc">sig</span> <a href='120allocate.subx.html#L448'>handle-equal?</a> a: (handle _T), b: (handle _T)<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: boolean
|
||||
<span id="L77" class="LineNr"> 77 </span><span class="PreProc">sig</span> <a href='120allocate.subx.html#L479'>copy-handle</a> src: (handle _T), dest: (addr handle _T)
|
||||
<span id="L78" class="LineNr"> 78 </span><span class="muComment">#sig allocate-region ad: (addr allocation-descriptor), n: int, out: (addr handle allocation-descriptor)</span>
|
||||
<span id="L79" class="LineNr"> 79 </span><span class="muComment">#sig allocate-array ad: (addr allocation-descriptor), n: int, out: (addr handle _)</span>
|
||||
<span id="L80" class="LineNr"> 80 </span><span class="PreProc">sig</span> <a href='120allocate.subx.html#L690'>copy-array</a> ad: (addr allocation-descriptor), src: (addr array _T), out: (addr handle array _T)
|
||||
<span id="L81" class="LineNr"> 81 </span><span class="muComment">#sig zero-out start: (addr byte), size: int</span>
|
||||
<span id="L82" class="LineNr"> 82 </span><span class="PreProc">sig</span> <a href='123slice.subx.html#L9'>slice-empty?</a> s: (addr slice)<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: boolean
|
||||
<span id="L83" class="LineNr"> 83 </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"> -> </span>_/<span class="muRegEax">eax</span>: boolean
|
||||
<span id="L84" class="LineNr"> 84 </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"> -> </span>_/<span class="muRegEax">eax</span>: boolean
|
||||
<span id="L85" class="LineNr"> 85 </span><span class="PreProc">sig</span> <a href='123slice.subx.html#L793'>write-slice</a> out: (addr stream byte), s: (addr slice)
|
||||
<span id="L86" class="LineNr"> 86 </span><span class="muComment"># bad name alert</span>
|
||||
<span id="L87" class="LineNr"> 87 </span><span class="PreProc">sig</span> <a href='123slice.subx.html#L898'>slice-to-string</a> ad: (addr allocation-descriptor), in: (addr slice), out: (addr handle array byte)
|
||||
<span id="L88" class="LineNr"> 88 </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="L89" class="LineNr"> 89 </span><span class="PreProc">sig</span> <a href='126write-int-decimal.subx.html#L296'>decimal-digit?</a> c: grapheme<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: boolean
|
||||
<span id="L90" class="LineNr"> 90 </span><span class="PreProc">sig</span> <a href='126write-int-decimal.subx.html#L395'>to-decimal-digit</a> in: grapheme<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int
|
||||
<span id="L91" class="LineNr"> 91 </span><span class="muComment"># bad name alert</span>
|
||||
<span id="L92" class="LineNr"> 92 </span><span class="muComment"># next-word really tokenizes</span>
|
||||
<span id="L93" class="LineNr"> 93 </span><span class="muComment"># next-raw-word really reads whitespace-separated words</span>
|
||||
<span id="L94" class="LineNr"> 94 </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="L95" class="LineNr"> 95 </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="L96" class="LineNr"> 96 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L6'>stream-empty?</a> s: (addr stream _)<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: boolean
|
||||
<span id="L97" class="LineNr"> 97 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L30'>stream-full?</a> s: (addr stream _)<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: boolean
|
||||
<span id="L98" class="LineNr"> 98 </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="L99" class="LineNr"> 99 </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="L100" class="LineNr">100 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L154'>stream-first</a> s: (addr stream byte)<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: byte
|
||||
<span id="L101" class="LineNr">101 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L181'>stream-final</a> s: (addr stream byte)<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: byte
|
||||
<span id="L102" class="LineNr">102 </span>
|
||||
<span id="L103" class="LineNr">103 </span><span class="muComment">#sig copy-bytes src: (addr byte), dest: (addr byte), n: int</span>
|
||||
<span id="L104" class="LineNr">104 </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="L105" class="LineNr">105 </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"> -> </span>_/<span class="muRegEax">eax</span>: boolean
|
||||
<span id="L106" class="LineNr">106 </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="L107" class="LineNr">107 </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="L108" class="LineNr">108 </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="L109" class="LineNr">109 </span>
|
||||
<span id="L110" class="LineNr">110 </span><span class="PreProc">sig</span> <a href='314divide.subx.html#L3'>integer-divide</a> a: int, b: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int, _/<span class="muRegEdx">edx</span>: int
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
49
html/403unicode.mu.html
generated
49
html/403unicode.mu.html
generated
|
@ -15,10 +15,15 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.PreProc { color: #c000c0; }
|
||||
.muRegEdi { color: #87ffd7; }
|
||||
.Special { color: #ff6060; }
|
||||
.LineNr { }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.Constant { color: #008787; }
|
||||
.muRegEdx { color: #878700; }
|
||||
.muRegEcx { color: #af875f; }
|
||||
.muRegEsi { color: #87d787; }
|
||||
.muRegEax { color: #875f00; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muComment { color: #005faf; }
|
||||
-->
|
||||
|
@ -77,16 +82,16 @@ if ('onhashchange' in window) {
|
|||
<span id="L19" class="LineNr"> 19 </span><span class="muComment">#</span>
|
||||
<span id="L20" class="LineNr"> 20 </span><span class="muComment"># The day we want to support combining characters, this function will need to</span>
|
||||
<span id="L21" class="LineNr"> 21 </span><span class="muComment"># take multiple code points. Or something.</span>
|
||||
<span id="L22" class="LineNr"> 22 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='403unicode.mu.html#L22'>to-grapheme</a></span> in: code-point<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: grapheme <span class="Delimiter">{</span>
|
||||
<span id="L23" class="LineNr"> 23 </span> <span class="PreProc">var</span> c/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy in
|
||||
<span id="L24" class="LineNr"> 24 </span> <span class="PreProc">var</span> num-trailers/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L25" class="LineNr"> 25 </span> <span class="PreProc">var</span> first/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L22" class="LineNr"> 22 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='403unicode.mu.html#L22'>to-grapheme</a></span> in: code-point<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: grapheme <span class="Delimiter">{</span>
|
||||
<span id="L23" class="LineNr"> 23 </span> <span class="PreProc">var</span> c/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy in
|
||||
<span id="L24" class="LineNr"> 24 </span> <span class="PreProc">var</span> num-trailers/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L25" class="LineNr"> 25 </span> <span class="PreProc">var</span> first/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L26" class="LineNr"> 26 </span> $to-grapheme:compute-length: <span class="Delimiter">{</span>
|
||||
<span id="L27" class="LineNr"> 27 </span> <span class="muComment"># single byte: just return it</span>
|
||||
<span id="L28" class="LineNr"> 28 </span> compare c, <span class="Constant">0x7f</span>
|
||||
<span id="L29" class="LineNr"> 29 </span> <span class="Delimiter">{</span>
|
||||
<span id="L30" class="LineNr"> 30 </span> <span class="PreProc">break-if-></span>
|
||||
<span id="L31" class="LineNr"> 31 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: grapheme <span class="Special"><-</span> copy c
|
||||
<span id="L31" class="LineNr"> 31 </span> <span class="PreProc">var</span> g/<span class="muRegEax">eax</span>: grapheme <span class="Special"><-</span> copy c
|
||||
<span id="L32" class="LineNr"> 32 </span> <span class="PreProc">return</span> g
|
||||
<span id="L33" class="LineNr"> 33 </span> <span class="Delimiter">}</span>
|
||||
<span id="L34" class="LineNr"> 34 </span> <span class="muComment"># 2 bytes</span>
|
||||
|
@ -122,11 +127,11 @@ if ('onhashchange' in window) {
|
|||
<span id="L64" class="LineNr"> 64 </span> <span class="Delimiter">}</span>
|
||||
<span id="L65" class="LineNr"> 65 </span> <span class="Delimiter">}</span>
|
||||
<span id="L66" class="LineNr"> 66 </span> <span class="muComment"># emit trailer bytes, 6 bits from 'in', first two bits '10'</span>
|
||||
<span id="L67" class="LineNr"> 67 </span> <span class="PreProc">var</span> result/<span class="Constant">edi</span>: grapheme <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L67" class="LineNr"> 67 </span> <span class="PreProc">var</span> result/<span class="muRegEdi">edi</span>: grapheme <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L68" class="LineNr"> 68 </span> <span class="Delimiter">{</span>
|
||||
<span id="L69" class="LineNr"> 69 </span> compare num-trailers, <span class="Constant">0</span>
|
||||
<span id="L70" class="LineNr"> 70 </span> <span class="PreProc">break-if-<=</span>
|
||||
<span id="L71" class="LineNr"> 71 </span> <span class="PreProc">var</span> tmp/<span class="Constant">esi</span>: int <span class="Special"><-</span> copy c
|
||||
<span id="L71" class="LineNr"> 71 </span> <span class="PreProc">var</span> tmp/<span class="muRegEsi">esi</span>: int <span class="Special"><-</span> copy c
|
||||
<span id="L72" class="LineNr"> 72 </span> tmp <span class="Special"><-</span> and <span class="Constant">0x3f</span>
|
||||
<span id="L73" class="LineNr"> 73 </span> tmp <span class="Special"><-</span> or <span class="Constant">0x80</span>
|
||||
<span id="L74" class="LineNr"> 74 </span> result <span class="Special"><-</span> shift-left <span class="Constant">8</span>
|
||||
|
@ -147,28 +152,28 @@ if ('onhashchange' in window) {
|
|||
<span id="L89" class="LineNr"> 89 </span><span class="muComment"># TODO: bring in tests once we have check-ints-equal</span>
|
||||
<span id="L90" class="LineNr"> 90 </span>
|
||||
<span id="L91" class="LineNr"> 91 </span><span class="muComment"># read the next grapheme from a stream of bytes</span>
|
||||
<span id="L92" class="LineNr"> 92 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='403unicode.mu.html#L92'>read-grapheme</a></span> in: (addr stream byte)<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: grapheme <span class="Delimiter">{</span>
|
||||
<span id="L92" class="LineNr"> 92 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='403unicode.mu.html#L92'>read-grapheme</a></span> in: (addr stream byte)<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: grapheme <span class="Delimiter">{</span>
|
||||
<span id="L93" class="LineNr"> 93 </span> <span class="muComment"># if at eof, return EOF</span>
|
||||
<span id="L94" class="LineNr"> 94 </span> <span class="Delimiter">{</span>
|
||||
<span id="L95" class="LineNr"> 95 </span> <span class="PreProc">var</span> eof?/<span class="Constant">eax</span>: boolean <span class="Special"><-</span> <a href='309stream.subx.html#L6'>stream-empty?</a> in
|
||||
<span id="L95" class="LineNr"> 95 </span> <span class="PreProc">var</span> eof?/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='309stream.subx.html#L6'>stream-empty?</a> in
|
||||
<span id="L96" class="LineNr"> 96 </span> compare eof?, <span class="Constant">0</span>/false
|
||||
<span id="L97" class="LineNr"> 97 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L98" class="LineNr"> 98 </span> <span class="PreProc">return</span> <span class="Constant">0xffffffff</span>
|
||||
<span id="L99" class="LineNr"> 99 </span> <span class="Delimiter">}</span>
|
||||
<span id="L100" class="LineNr">100 </span> <span class="PreProc">var</span> c/<span class="Constant">eax</span>: byte <span class="Special"><-</span> <a href='112read-byte.subx.html#L13'>read-byte</a> in
|
||||
<span id="L101" class="LineNr">101 </span> <span class="PreProc">var</span> num-trailers/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L100" class="LineNr">100 </span> <span class="PreProc">var</span> c/<span class="muRegEax">eax</span>: byte <span class="Special"><-</span> <a href='112read-byte.subx.html#L13'>read-byte</a> in
|
||||
<span id="L101" class="LineNr">101 </span> <span class="PreProc">var</span> num-trailers/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L102" class="LineNr">102 </span> $read-grapheme:compute-length: <span class="Delimiter">{</span>
|
||||
<span id="L103" class="LineNr">103 </span> <span class="muComment"># single byte: just return it</span>
|
||||
<span id="L104" class="LineNr">104 </span> compare c, <span class="Constant">0xc0</span>
|
||||
<span id="L105" class="LineNr">105 </span> <span class="Delimiter">{</span>
|
||||
<span id="L106" class="LineNr">106 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L107" class="LineNr">107 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: grapheme <span class="Special"><-</span> copy c
|
||||
<span id="L107" class="LineNr">107 </span> <span class="PreProc">var</span> g/<span class="muRegEax">eax</span>: grapheme <span class="Special"><-</span> copy c
|
||||
<span id="L108" class="LineNr">108 </span> <span class="PreProc">return</span> g
|
||||
<span id="L109" class="LineNr">109 </span> <span class="Delimiter">}</span>
|
||||
<span id="L110" class="LineNr">110 </span> compare c, <span class="Constant">0xfe</span>
|
||||
<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> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: grapheme <span class="Special"><-</span> copy c
|
||||
<span id="L113" class="LineNr">113 </span> <span class="PreProc">var</span> g/<span class="muRegEax">eax</span>: grapheme <span class="Special"><-</span> copy c
|
||||
<span id="L114" class="LineNr">114 </span> <span class="PreProc">return</span> g
|
||||
<span id="L115" class="LineNr">115 </span> <span class="Delimiter">}</span>
|
||||
<span id="L116" class="LineNr">116 </span> <span class="muComment"># 2 bytes</span>
|
||||
|
@ -196,13 +201,13 @@ if ('onhashchange' in window) {
|
|||
<span id="L138" class="LineNr">138 </span> <span class="PreProc">return</span> <span class="Constant">0</span>
|
||||
<span id="L139" class="LineNr">139 </span> <span class="Delimiter">}</span>
|
||||
<span id="L140" class="LineNr">140 </span> <span class="muComment"># prepend trailer bytes</span>
|
||||
<span id="L141" class="LineNr">141 </span> <span class="PreProc">var</span> result/<span class="Constant">edi</span>: grapheme <span class="Special"><-</span> copy c
|
||||
<span id="L142" class="LineNr">142 </span> <span class="PreProc">var</span> num-byte-shifts/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">1</span>
|
||||
<span id="L141" class="LineNr">141 </span> <span class="PreProc">var</span> result/<span class="muRegEdi">edi</span>: grapheme <span class="Special"><-</span> copy c
|
||||
<span id="L142" class="LineNr">142 </span> <span class="PreProc">var</span> num-byte-shifts/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">1</span>
|
||||
<span id="L143" class="LineNr">143 </span> <span class="Delimiter">{</span>
|
||||
<span id="L144" class="LineNr">144 </span> compare num-trailers, <span class="Constant">0</span>
|
||||
<span id="L145" class="LineNr">145 </span> <span class="PreProc">break-if-<=</span>
|
||||
<span id="L146" class="LineNr">146 </span> <span class="PreProc">var</span> tmp/<span class="Constant">eax</span>: byte <span class="Special"><-</span> <a href='112read-byte.subx.html#L13'>read-byte</a> in
|
||||
<span id="L147" class="LineNr">147 </span> <span class="PreProc">var</span> tmp2/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy tmp
|
||||
<span id="L146" class="LineNr">146 </span> <span class="PreProc">var</span> tmp/<span class="muRegEax">eax</span>: byte <span class="Special"><-</span> <a href='112read-byte.subx.html#L13'>read-byte</a> in
|
||||
<span id="L147" class="LineNr">147 </span> <span class="PreProc">var</span> tmp2/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy tmp
|
||||
<span id="L148" class="LineNr">148 </span> tmp2 <span class="Special"><-</span> <a href='403unicode.mu.html#L159'>shift-left-bytes</a> tmp2, num-byte-shifts
|
||||
<span id="L149" class="LineNr">149 </span> result <span class="Special"><-</span> or tmp2
|
||||
<span id="L150" class="LineNr">150 </span> <span class="muComment"># update loop state</span>
|
||||
|
@ -214,9 +219,9 @@ if ('onhashchange' in window) {
|
|||
<span id="L156" class="LineNr">156 </span><span class="Delimiter">}</span>
|
||||
<span id="L157" class="LineNr">157 </span>
|
||||
<span id="L158" class="LineNr">158 </span><span class="muComment"># needed because available primitives only shift by a literal/constant number of bits</span>
|
||||
<span id="L159" class="LineNr">159 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='403unicode.mu.html#L159'>shift-left-bytes</a></span> n: int, k: int<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L160" class="LineNr">160 </span> <span class="PreProc">var</span> i/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L161" class="LineNr">161 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy n
|
||||
<span id="L159" class="LineNr">159 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='403unicode.mu.html#L159'>shift-left-bytes</a></span> n: int, k: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L160" class="LineNr">160 </span> <span class="PreProc">var</span> i/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L161" class="LineNr">161 </span> <span class="PreProc">var</span> result/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy n
|
||||
<span id="L162" class="LineNr">162 </span> <span class="Delimiter">{</span>
|
||||
<span id="L163" class="LineNr">163 </span> compare i, k
|
||||
<span id="L164" class="LineNr">164 </span> <span class="PreProc">break-if->=</span>
|
||||
|
@ -233,7 +238,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L175" class="LineNr">175 </span><span class="muComment"># this is like write-to-stream, except we skip leading 0 bytes</span>
|
||||
<span id="L176" class="LineNr">176 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='403unicode.mu.html#L176'>write-grapheme</a></span> out: (addr stream byte), g: grapheme <span class="Delimiter">{</span>
|
||||
<span id="L177" class="LineNr">177 </span>$write-grapheme:body: <span class="Delimiter">{</span>
|
||||
<span id="L178" class="LineNr">178 </span> <span class="PreProc">var</span> c/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy g
|
||||
<span id="L178" class="LineNr">178 </span> <span class="PreProc">var</span> c/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy g
|
||||
<span id="L179" class="LineNr">179 </span> <a href='115write-byte.subx.html#L12'>append-byte</a> out, c <span class="muComment"># first byte is always written</span>
|
||||
<span id="L180" class="LineNr">180 </span> c <span class="Special"><-</span> shift-right <span class="Constant">8</span>
|
||||
<span id="L181" class="LineNr">181 </span> compare c, <span class="Constant">0</span>
|
||||
|
|
5
html/408float.mu.html
generated
5
html/408float.mu.html
generated
|
@ -18,6 +18,7 @@ a { color:inherit; }
|
|||
.Special { color: #ff6060; }
|
||||
.LineNr { }
|
||||
.Constant { color: #008787; }
|
||||
.muRegEdi { color: #87ffd7; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muComment { color: #005faf; }
|
||||
|
@ -59,7 +60,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># Some quick-n-dirty ways to create floats.</span>
|
||||
<span id="L2" class="LineNr"> 2 </span>
|
||||
<span id="L3" class="LineNr"> 3 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='408float.mu.html#L3'>fill-in-rational</a></span> _out: (addr float), nr: int, dr: int <span class="Delimiter">{</span>
|
||||
<span id="L4" class="LineNr"> 4 </span> <span class="PreProc">var</span> out/<span class="Constant">edi</span>: (addr float) <span class="Special"><-</span> copy _out
|
||||
<span id="L4" class="LineNr"> 4 </span> <span class="PreProc">var</span> out/<span class="muRegEdi">edi</span>: (addr float) <span class="Special"><-</span> copy _out
|
||||
<span id="L5" class="LineNr"> 5 </span> <span class="PreProc">var</span> result/<span class="Constant">xmm0</span>: float <span class="Special"><-</span> convert nr
|
||||
<span id="L6" class="LineNr"> 6 </span> <span class="PreProc">var</span> divisor/<span class="Constant">xmm1</span>: float <span class="Special"><-</span> convert dr
|
||||
<span id="L7" class="LineNr"> 7 </span> result <span class="Special"><-</span> divide divisor
|
||||
|
@ -67,7 +68,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L9" class="LineNr"> 9 </span><span class="Delimiter">}</span>
|
||||
<span id="L10" class="LineNr">10 </span>
|
||||
<span id="L11" class="LineNr">11 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='408float.mu.html#L11'>fill-in-sqrt</a></span> _out: (addr float), n: int <span class="Delimiter">{</span>
|
||||
<span id="L12" class="LineNr">12 </span> <span class="PreProc">var</span> out/<span class="Constant">edi</span>: (addr float) <span class="Special"><-</span> copy _out
|
||||
<span id="L12" class="LineNr">12 </span> <span class="PreProc">var</span> out/<span class="muRegEdi">edi</span>: (addr float) <span class="Special"><-</span> copy _out
|
||||
<span id="L13" class="LineNr">13 </span> <span class="PreProc">var</span> result/<span class="Constant">xmm0</span>: float <span class="Special"><-</span> convert n
|
||||
<span id="L14" class="LineNr">14 </span> result <span class="Special"><-</span> square-root result
|
||||
<span id="L15" class="LineNr">15 </span> copy-to *out, result
|
||||
|
|
50
html/411string.mu.html
generated
50
html/411string.mu.html
generated
|
@ -15,10 +15,14 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.PreProc { color: #c000c0; }
|
||||
.muRegEcx { color: #af875f; }
|
||||
.muRegEax { color: #875f00; }
|
||||
.Special { color: #ff6060; }
|
||||
.LineNr { }
|
||||
.Constant { color: #008787; }
|
||||
.CommentedCode { color: #8a8a8a; }
|
||||
.Constant { color: #008787; }
|
||||
.muRegEsi { color: #87d787; }
|
||||
.muRegEdi { color: #87ffd7; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muTest { color: #5f8700; }
|
||||
|
@ -61,18 +65,18 @@ if ('onhashchange' in window) {
|
|||
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># read up to 'len' graphemes after skipping the first 'start' ones</span>
|
||||
<span id="L2" class="LineNr"> 2 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='411string.mu.html#L2'>substring</a></span> in: (addr array byte), start: int, len: int, out-ah: (addr handle array byte) <span class="Delimiter">{</span>
|
||||
<span id="L3" class="LineNr"> 3 </span> <span class="PreProc">var</span> in-stream: (stream byte <span class="Constant">0x100</span>)
|
||||
<span id="L4" class="LineNr"> 4 </span> <span class="PreProc">var</span> in-stream-addr/<span class="Constant">esi</span>: (addr stream byte) <span class="Special"><-</span> address in-stream
|
||||
<span id="L4" class="LineNr"> 4 </span> <span class="PreProc">var</span> in-stream-addr/<span class="muRegEsi">esi</span>: (addr stream byte) <span class="Special"><-</span> address in-stream
|
||||
<span id="L5" class="LineNr"> 5 </span> <a href='108write.subx.html#L11'>write</a> in-stream-addr, in
|
||||
<span id="L6" class="LineNr"> 6 </span> <span class="PreProc">var</span> out-stream: (stream byte <span class="Constant">0x100</span>)
|
||||
<span id="L7" class="LineNr"> 7 </span> <span class="PreProc">var</span> out-stream-addr/<span class="Constant">edi</span>: (addr stream byte) <span class="Special"><-</span> address out-stream
|
||||
<span id="L7" class="LineNr"> 7 </span> <span class="PreProc">var</span> out-stream-addr/<span class="muRegEdi">edi</span>: (addr stream byte) <span class="Special"><-</span> address out-stream
|
||||
<span id="L8" class="LineNr"> 8 </span> $substring:core: <span class="Delimiter">{</span>
|
||||
<span id="L9" class="LineNr"> 9 </span> <span class="muComment"># skip 'start' graphemes</span>
|
||||
<span id="L10" class="LineNr"> 10 </span> <span class="PreProc">var</span> i/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L10" class="LineNr"> 10 </span> <span class="PreProc">var</span> i/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L11" class="LineNr"> 11 </span> <span class="Delimiter">{</span>
|
||||
<span id="L12" class="LineNr"> 12 </span> compare i, start
|
||||
<span id="L13" class="LineNr"> 13 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L14" class="LineNr"> 14 </span> <span class="Delimiter">{</span>
|
||||
<span id="L15" class="LineNr"> 15 </span> <span class="PreProc">var</span> dummy/<span class="Constant">eax</span>: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> in-stream-addr
|
||||
<span id="L15" class="LineNr"> 15 </span> <span class="PreProc">var</span> dummy/<span class="muRegEax">eax</span>: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> in-stream-addr
|
||||
<span id="L16" class="LineNr"> 16 </span> compare dummy, <span class="Constant">0xffffffff</span>/end-of-file
|
||||
<span id="L17" class="LineNr"> 17 </span> <span class="PreProc">break-if-=</span> $substring:core
|
||||
<span id="L18" class="LineNr"> 18 </span> <span class="Delimiter">}</span>
|
||||
|
@ -85,7 +89,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L25" class="LineNr"> 25 </span> compare i, len
|
||||
<span id="L26" class="LineNr"> 26 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L27" class="LineNr"> 27 </span> <span class="Delimiter">{</span>
|
||||
<span id="L28" class="LineNr"> 28 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> in-stream-addr
|
||||
<span id="L28" class="LineNr"> 28 </span> <span class="PreProc">var</span> g/<span class="muRegEax">eax</span>: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> in-stream-addr
|
||||
<span id="L29" class="LineNr"> 29 </span> compare g, <span class="Constant">0xffffffff</span>/end-of-file
|
||||
<span id="L30" class="LineNr"> 30 </span> <span class="PreProc">break-if-=</span> $substring:core
|
||||
<span id="L31" class="LineNr"> 31 </span> <a href='403unicode.mu.html#L176'>write-grapheme</a> out-stream-addr, g
|
||||
|
@ -99,62 +103,62 @@ if ('onhashchange' in window) {
|
|||
<span id="L39" class="LineNr"> 39 </span>
|
||||
<span id="L40" class="LineNr"> 40 </span><span class="PreProc">fn</span> <span class="muTest"><a href='411string.mu.html#L40'>test-substring</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L41" class="LineNr"> 41 </span> <span class="PreProc">var</span> out-h: (handle array byte)
|
||||
<span id="L42" class="LineNr"> 42 </span> <span class="PreProc">var</span> out-ah/<span class="Constant">edi</span>: (addr handle array byte) <span class="Special"><-</span> address out-h
|
||||
<span id="L42" class="LineNr"> 42 </span> <span class="PreProc">var</span> out-ah/<span class="muRegEdi">edi</span>: (addr handle array byte) <span class="Special"><-</span> address out-h
|
||||
<span id="L43" class="LineNr"> 43 </span> <span class="muComment"># prefix substrings</span>
|
||||
<span id="L44" class="LineNr"> 44 </span> <a href='411string.mu.html#L2'>substring</a> <span class="Constant">0</span>, <span class="Constant">0</span>, <span class="Constant">3</span>, out-ah
|
||||
<span id="L45" class="LineNr"> 45 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr array byte) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *out-ah
|
||||
<span id="L45" class="LineNr"> 45 </span> <span class="PreProc">var</span> out/<span class="muRegEax">eax</span>: (addr array byte) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *out-ah
|
||||
<span id="L46" class="LineNr"> 46 </span> <a href='105string-equal.subx.html#L213'>check-strings-equal</a> out, <span class="Constant">""</span>, <span class="Constant">"F - <a href='411string.mu.html#L40'>test-substring</a>/null"</span>
|
||||
<span id="L47" class="LineNr"> 47 </span> <a href='411string.mu.html#L2'>substring</a> <span class="Constant">""</span>, <span class="Constant">0</span>, <span class="Constant">3</span>, out-ah
|
||||
<span id="L48" class="LineNr"> 48 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr array byte) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *out-ah
|
||||
<span id="L48" class="LineNr"> 48 </span> <span class="PreProc">var</span> out/<span class="muRegEax">eax</span>: (addr array byte) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *out-ah
|
||||
<span id="L49" class="LineNr"> 49 </span><span class="CommentedCode">#? print-string-to-real-screen out</span>
|
||||
<span id="L50" class="LineNr"> 50 </span><span class="CommentedCode">#? print-string-to-real-screen "\n"</span>
|
||||
<span id="L51" class="LineNr"> 51 </span> <a href='105string-equal.subx.html#L213'>check-strings-equal</a> out, <span class="Constant">""</span>, <span class="Constant">"F - <a href='411string.mu.html#L40'>test-substring</a>/empty"</span>
|
||||
<span id="L52" class="LineNr"> 52 </span> <span class="muComment">#</span>
|
||||
<span id="L53" class="LineNr"> 53 </span> <a href='411string.mu.html#L2'>substring</a> <span class="Constant">"abcde"</span>, <span class="Constant">0</span>, <span class="Constant">3</span>, out-ah
|
||||
<span id="L54" class="LineNr"> 54 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr array byte) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *out-ah
|
||||
<span id="L54" class="LineNr"> 54 </span> <span class="PreProc">var</span> out/<span class="muRegEax">eax</span>: (addr array byte) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *out-ah
|
||||
<span id="L55" class="LineNr"> 55 </span><span class="CommentedCode">#? print-string-to-real-screen out</span>
|
||||
<span id="L56" class="LineNr"> 56 </span><span class="CommentedCode">#? print-string-to-real-screen "\n"</span>
|
||||
<span id="L57" class="LineNr"> 57 </span> <a href='105string-equal.subx.html#L213'>check-strings-equal</a> out, <span class="Constant">"abc"</span>, <span class="Constant">"F - <a href='411string.mu.html#L40'>test-substring</a>/truncate"</span>
|
||||
<span id="L58" class="LineNr"> 58 </span> <span class="muComment">#</span>
|
||||
<span id="L59" class="LineNr"> 59 </span> <a href='411string.mu.html#L2'>substring</a> <span class="Constant">"abcde"</span>, <span class="Constant">0</span>, <span class="Constant">5</span>, out-ah
|
||||
<span id="L60" class="LineNr"> 60 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr array byte) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *out-ah
|
||||
<span id="L60" class="LineNr"> 60 </span> <span class="PreProc">var</span> out/<span class="muRegEax">eax</span>: (addr array byte) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *out-ah
|
||||
<span id="L61" class="LineNr"> 61 </span> <a href='105string-equal.subx.html#L213'>check-strings-equal</a> out, <span class="Constant">"abcde"</span>, <span class="Constant">"F - <a href='411string.mu.html#L40'>test-substring</a>/all"</span>
|
||||
<span id="L62" class="LineNr"> 62 </span> <span class="muComment">#</span>
|
||||
<span id="L63" class="LineNr"> 63 </span> <a href='411string.mu.html#L2'>substring</a> <span class="Constant">"abcde"</span>, <span class="Constant">0</span>, <span class="Constant">7</span>, out-ah
|
||||
<span id="L64" class="LineNr"> 64 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr array byte) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *out-ah
|
||||
<span id="L64" class="LineNr"> 64 </span> <span class="PreProc">var</span> out/<span class="muRegEax">eax</span>: (addr array byte) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *out-ah
|
||||
<span id="L65" class="LineNr"> 65 </span> <a href='105string-equal.subx.html#L213'>check-strings-equal</a> out, <span class="Constant">"abcde"</span>, <span class="Constant">"F - <a href='411string.mu.html#L40'>test-substring</a>/too-small"</span>
|
||||
<span id="L66" class="LineNr"> 66 </span> <span class="muComment"># substrings outside string</span>
|
||||
<span id="L67" class="LineNr"> 67 </span> <a href='411string.mu.html#L2'>substring</a> <span class="Constant">"abcde"</span>, <span class="Constant">6</span>, <span class="Constant">1</span>, out-ah
|
||||
<span id="L68" class="LineNr"> 68 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr array byte) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *out-ah
|
||||
<span id="L68" class="LineNr"> 68 </span> <span class="PreProc">var</span> out/<span class="muRegEax">eax</span>: (addr array byte) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *out-ah
|
||||
<span id="L69" class="LineNr"> 69 </span> <a href='105string-equal.subx.html#L213'>check-strings-equal</a> out, <span class="Constant">""</span>, <span class="Constant">"F - <a href='411string.mu.html#L40'>test-substring</a>/start-too-large"</span>
|
||||
<span id="L70" class="LineNr"> 70 </span> <span class="muComment"># trim prefix</span>
|
||||
<span id="L71" class="LineNr"> 71 </span> <a href='411string.mu.html#L2'>substring</a> <span class="Constant">""</span>, <span class="Constant">2</span>, <span class="Constant">3</span>, out-ah
|
||||
<span id="L72" class="LineNr"> 72 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr array byte) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *out-ah
|
||||
<span id="L72" class="LineNr"> 72 </span> <span class="PreProc">var</span> out/<span class="muRegEax">eax</span>: (addr array byte) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *out-ah
|
||||
<span id="L73" class="LineNr"> 73 </span> <a href='105string-equal.subx.html#L213'>check-strings-equal</a> out, <span class="Constant">""</span>, <span class="Constant">"F - <a href='411string.mu.html#L40'>test-substring</a>/middle-empty"</span>
|
||||
<span id="L74" class="LineNr"> 74 </span> <span class="muComment">#</span>
|
||||
<span id="L75" class="LineNr"> 75 </span> <a href='411string.mu.html#L2'>substring</a> <span class="Constant">"abcde"</span>, <span class="Constant">1</span>, <span class="Constant">2</span>, out-ah
|
||||
<span id="L76" class="LineNr"> 76 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr array byte) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *out-ah
|
||||
<span id="L76" class="LineNr"> 76 </span> <span class="PreProc">var</span> out/<span class="muRegEax">eax</span>: (addr array byte) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *out-ah
|
||||
<span id="L77" class="LineNr"> 77 </span> <a href='105string-equal.subx.html#L213'>check-strings-equal</a> out, <span class="Constant">"bc"</span>, <span class="Constant">"F - <a href='411string.mu.html#L40'>test-substring</a>/middle-truncate"</span>
|
||||
<span id="L78" class="LineNr"> 78 </span> <span class="muComment">#</span>
|
||||
<span id="L79" class="LineNr"> 79 </span> <a href='411string.mu.html#L2'>substring</a> <span class="Constant">"abcde"</span>, <span class="Constant">1</span>, <span class="Constant">4</span>, out-ah
|
||||
<span id="L80" class="LineNr"> 80 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr array byte) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *out-ah
|
||||
<span id="L80" class="LineNr"> 80 </span> <span class="PreProc">var</span> out/<span class="muRegEax">eax</span>: (addr array byte) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *out-ah
|
||||
<span id="L81" class="LineNr"> 81 </span> <a href='105string-equal.subx.html#L213'>check-strings-equal</a> out, <span class="Constant">"bcde"</span>, <span class="Constant">"F - <a href='411string.mu.html#L40'>test-substring</a>/middle-all"</span>
|
||||
<span id="L82" class="LineNr"> 82 </span> <span class="muComment">#</span>
|
||||
<span id="L83" class="LineNr"> 83 </span> <a href='411string.mu.html#L2'>substring</a> <span class="Constant">"abcde"</span>, <span class="Constant">1</span>, <span class="Constant">5</span>, out-ah
|
||||
<span id="L84" class="LineNr"> 84 </span> <span class="PreProc">var</span> out/<span class="Constant">eax</span>: (addr array byte) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *out-ah
|
||||
<span id="L84" class="LineNr"> 84 </span> <span class="PreProc">var</span> out/<span class="muRegEax">eax</span>: (addr array byte) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *out-ah
|
||||
<span id="L85" class="LineNr"> 85 </span> <a href='105string-equal.subx.html#L213'>check-strings-equal</a> out, <span class="Constant">"bcde"</span>, <span class="Constant">"F - <a href='411string.mu.html#L40'>test-substring</a>/middle-too-small"</span>
|
||||
<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='411string.mu.html#L88'>split-string</a></span> in: (addr array byte), delim: grapheme, out: (addr handle array (handle array byte)) <span class="Delimiter">{</span>
|
||||
<span id="L89" class="LineNr"> 89 </span> <span class="PreProc">var</span> in-stream: (stream byte <span class="Constant">0x100</span>)
|
||||
<span id="L90" class="LineNr"> 90 </span> <span class="PreProc">var</span> in-stream-addr/<span class="Constant">esi</span>: (addr stream byte) <span class="Special"><-</span> address in-stream
|
||||
<span id="L90" class="LineNr"> 90 </span> <span class="PreProc">var</span> in-stream-addr/<span class="muRegEsi">esi</span>: (addr stream byte) <span class="Special"><-</span> address in-stream
|
||||
<span id="L91" class="LineNr"> 91 </span> <a href='108write.subx.html#L11'>write</a> in-stream-addr, in
|
||||
<span id="L92" class="LineNr"> 92 </span> <span class="PreProc">var</span> tokens-stream: (stream (handle array byte) <span class="Constant">0x100</span>)
|
||||
<span id="L93" class="LineNr"> 93 </span> <span class="PreProc">var</span> tokens-stream-addr/<span class="Constant">edi</span>: (addr stream (handle array byte)) <span class="Special"><-</span> address tokens-stream
|
||||
<span id="L93" class="LineNr"> 93 </span> <span class="PreProc">var</span> tokens-stream-addr/<span class="muRegEdi">edi</span>: (addr stream (handle array byte)) <span class="Special"><-</span> address tokens-stream
|
||||
<span id="L94" class="LineNr"> 94 </span> <span class="PreProc">var</span> curr-stream: (stream byte <span class="Constant">0x100</span>)
|
||||
<span id="L95" class="LineNr"> 95 </span> <span class="PreProc">var</span> curr-stream-addr/<span class="Constant">ecx</span>: (addr stream byte) <span class="Special"><-</span> address curr-stream
|
||||
<span id="L95" class="LineNr"> 95 </span> <span class="PreProc">var</span> curr-stream-addr/<span class="muRegEcx">ecx</span>: (addr stream byte) <span class="Special"><-</span> address curr-stream
|
||||
<span id="L96" class="LineNr"> 96 </span> $split-string:core: <span class="Delimiter">{</span>
|
||||
<span id="L97" class="LineNr"> 97 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> in-stream-addr
|
||||
<span id="L97" class="LineNr"> 97 </span> <span class="PreProc">var</span> g/<span class="muRegEax">eax</span>: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> in-stream-addr
|
||||
<span id="L98" class="LineNr"> 98 </span> compare g, <span class="Constant">0xffffffff</span>
|
||||
<span id="L99" class="LineNr"> 99 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L100" class="LineNr">100 </span><span class="CommentedCode">#? print-grapheme-to-real-screen g</span>
|
||||
|
@ -164,7 +168,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L104" class="LineNr">104 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L105" class="LineNr">105 </span> <span class="muComment"># token complete; flush</span>
|
||||
<span id="L106" class="LineNr">106 </span> <span class="PreProc">var</span> token: (handle array byte)
|
||||
<span id="L107" class="LineNr">107 </span> <span class="PreProc">var</span> token-ah/<span class="Constant">eax</span>: (addr handle array byte) <span class="Special"><-</span> address token
|
||||
<span id="L107" class="LineNr">107 </span> <span class="PreProc">var</span> token-ah/<span class="muRegEax">eax</span>: (addr handle array byte) <span class="Special"><-</span> address token
|
||||
<span id="L108" class="LineNr">108 </span> <a href='310copy-bytes.subx.html#L60'>stream-to-array</a> curr-stream-addr, token-ah
|
||||
<span id="L109" class="LineNr">109 </span> <a href='309stream.subx.html#L54'>write-to-stream</a> tokens-stream-addr, token-ah
|
||||
<span id="L110" class="LineNr">110 </span> <a href='106stream.subx.html#L20'>clear-stream</a> curr-stream-addr
|
||||
|
@ -178,7 +182,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L118" class="LineNr">118 </span>
|
||||
<span id="L119" class="LineNr">119 </span><span class="PreProc">fn</span> <span class="muTest"><a href='411string.mu.html#L119'>test-split-string</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L120" class="LineNr">120 </span> <span class="PreProc">var</span> out-h: (handle array (handle array byte))
|
||||
<span id="L121" class="LineNr">121 </span> <span class="PreProc">var</span> out-ah/<span class="Constant">edi</span>: (addr handle array (handle array byte)) <span class="Special"><-</span> address out-h
|
||||
<span id="L121" class="LineNr">121 </span> <span class="PreProc">var</span> out-ah/<span class="muRegEdi">edi</span>: (addr handle array (handle array byte)) <span class="Special"><-</span> address out-h
|
||||
<span id="L122" class="LineNr">122 </span> <span class="muComment"># prefix substrings</span>
|
||||
<span id="L123" class="LineNr">123 </span> <a href='411string.mu.html#L88'>split-string</a> <span class="Constant">"bab"</span>, <span class="Constant">0x61</span>, out-ah
|
||||
<span id="L124" class="LineNr">124 </span> <span class="muComment"># no crash</span>
|
||||
|
|
206
html/412render-float-decimal.mu.html
generated
206
html/412render-float-decimal.mu.html
generated
|
@ -14,14 +14,20 @@ pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-
|
|||
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #a8a8a8; }
|
||||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.PreProc { color: #c000c0; }
|
||||
.LineNr { }
|
||||
.Constant { color: #008787; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muRegEdx { color: #878700; }
|
||||
.muRegEbx { color: #8787af; }
|
||||
.muRegEsi { color: #87d787; }
|
||||
.muRegEdi { color: #87ffd7; }
|
||||
.Constant { color: #008787; }
|
||||
.Special { color: #ff6060; }
|
||||
.PreProc { color: #c000c0; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muTest { color: #5f8700; }
|
||||
.muComment { color: #005faf; }
|
||||
.muRegEax { color: #875f00; }
|
||||
.muRegEcx { color: #af875f; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
@ -83,7 +89,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L24" class="LineNr"> 24 </span>
|
||||
<span id="L25" class="LineNr"> 25 </span><span class="PreProc">fn</span> <span class="muTest"><a href='412render-float-decimal.mu.html#L25'>test-write-float-decimal-approximate-normal</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L26" class="LineNr"> 26 </span> <span class="PreProc">var</span> s-storage: (stream byte <span class="Constant">0x10</span>)
|
||||
<span id="L27" class="LineNr"> 27 </span> <span class="PreProc">var</span> s/<span class="Constant">ecx</span>: (addr stream byte) <span class="Special"><-</span> address s-storage
|
||||
<span id="L27" class="LineNr"> 27 </span> <span class="PreProc">var</span> s/<span class="muRegEcx">ecx</span>: (addr stream byte) <span class="Special"><-</span> address s-storage
|
||||
<span id="L28" class="LineNr"> 28 </span> <span class="muComment"># 0.5</span>
|
||||
<span id="L29" class="LineNr"> 29 </span> <span class="PreProc">var</span> half/<span class="Constant">xmm0</span>: float <span class="Special"><-</span> <a href='408float.mu.html#L18'>rational</a> <span class="Constant">1</span>, <span class="Constant">2</span>
|
||||
<span id="L30" class="LineNr"> 30 </span> <a href='412render-float-decimal.mu.html#L163'>write-float-decimal-approximate</a> s, half, <span class="Constant">3</span>
|
||||
|
@ -119,7 +125,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L60" class="LineNr"> 60 </span><span class="muComment"># print whole integers without decimals</span>
|
||||
<span id="L61" class="LineNr"> 61 </span><span class="PreProc">fn</span> <span class="muTest"><a href='412render-float-decimal.mu.html#L61'>test-write-float-decimal-approximate-integer</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L62" class="LineNr"> 62 </span> <span class="PreProc">var</span> s-storage: (stream byte <span class="Constant">0x10</span>)
|
||||
<span id="L63" class="LineNr"> 63 </span> <span class="PreProc">var</span> s/<span class="Constant">ecx</span>: (addr stream byte) <span class="Special"><-</span> address s-storage
|
||||
<span id="L63" class="LineNr"> 63 </span> <span class="PreProc">var</span> s/<span class="muRegEcx">ecx</span>: (addr stream byte) <span class="Special"><-</span> address s-storage
|
||||
<span id="L64" class="LineNr"> 64 </span> <span class="muComment"># 1</span>
|
||||
<span id="L65" class="LineNr"> 65 </span> <span class="PreProc">var</span> one-f/<span class="Constant">xmm0</span>: float <span class="Special"><-</span> <a href='408float.mu.html#L18'>rational</a> <span class="Constant">1</span>, <span class="Constant">1</span>
|
||||
<span id="L66" class="LineNr"> 66 </span> <a href='412render-float-decimal.mu.html#L163'>write-float-decimal-approximate</a> s, one-f, <span class="Constant">3</span>
|
||||
|
@ -151,7 +157,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L92" class="LineNr"> 92 </span> <a href='109stream-equal.subx.html#L194'>check-stream-equal</a> s, <span class="Constant">"1.00e3"</span>, <span class="Constant">"F - <a href='412render-float-decimal.mu.html#L61'>test-write-float-decimal-approximate-integer</a> 1000"</span>
|
||||
<span id="L93" class="LineNr"> 93 </span> <span class="muComment"># 100,000</span>
|
||||
<span id="L94" class="LineNr"> 94 </span> <a href='106stream.subx.html#L20'>clear-stream</a> s
|
||||
<span id="L95" class="LineNr"> 95 </span> <span class="PreProc">var</span> hundred-thousand/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0x186a0</span>
|
||||
<span id="L95" class="LineNr"> 95 </span> <span class="PreProc">var</span> hundred-thousand/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0x186a0</span>
|
||||
<span id="L96" class="LineNr"> 96 </span> <span class="PreProc">var</span> hundred-thousand-f/<span class="Constant">xmm0</span>: float <span class="Special"><-</span> convert hundred-thousand
|
||||
<span id="L97" class="LineNr"> 97 </span> <a href='412render-float-decimal.mu.html#L163'>write-float-decimal-approximate</a> s, hundred-thousand-f, <span class="Constant">3</span>
|
||||
<span id="L98" class="LineNr"> 98 </span> <a href='109stream-equal.subx.html#L194'>check-stream-equal</a> s, <span class="Constant">"1.00e5"</span>, <span class="Constant">"F - <a href='412render-float-decimal.mu.html#L61'>test-write-float-decimal-approximate-integer</a> 100,000"</span>
|
||||
|
@ -159,7 +165,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L100" class="LineNr">100 </span>
|
||||
<span id="L101" class="LineNr">101 </span><span class="PreProc">fn</span> <span class="muTest"><a href='412render-float-decimal.mu.html#L101'>test-write-float-decimal-approximate-zero</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L102" class="LineNr">102 </span> <span class="PreProc">var</span> s-storage: (stream byte <span class="Constant">0x10</span>)
|
||||
<span id="L103" class="LineNr">103 </span> <span class="PreProc">var</span> s/<span class="Constant">ecx</span>: (addr stream byte) <span class="Special"><-</span> address s-storage
|
||||
<span id="L103" class="LineNr">103 </span> <span class="PreProc">var</span> s/<span class="muRegEcx">ecx</span>: (addr stream byte) <span class="Special"><-</span> address s-storage
|
||||
<span id="L104" class="LineNr">104 </span> <span class="PreProc">var</span> zero: float
|
||||
<span id="L105" class="LineNr">105 </span> <a href='412render-float-decimal.mu.html#L163'>write-float-decimal-approximate</a> s, zero, <span class="Constant">3</span>
|
||||
<span id="L106" class="LineNr">106 </span> <a href='109stream-equal.subx.html#L194'>check-stream-equal</a> s, <span class="Constant">"0"</span>, <span class="Constant">"F - test-write-float-decimal-approximate-zero"</span>
|
||||
|
@ -167,7 +173,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L108" class="LineNr">108 </span>
|
||||
<span id="L109" class="LineNr">109 </span><span class="PreProc">fn</span> <span class="muTest"><a href='412render-float-decimal.mu.html#L109'>test-write-float-decimal-approximate-negative-zero</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L110" class="LineNr">110 </span> <span class="PreProc">var</span> s-storage: (stream byte <span class="Constant">0x10</span>)
|
||||
<span id="L111" class="LineNr">111 </span> <span class="PreProc">var</span> s/<span class="Constant">ecx</span>: (addr stream byte) <span class="Special"><-</span> address s-storage
|
||||
<span id="L111" class="LineNr">111 </span> <span class="PreProc">var</span> s/<span class="muRegEcx">ecx</span>: (addr stream byte) <span class="Special"><-</span> address s-storage
|
||||
<span id="L112" class="LineNr">112 </span> <span class="PreProc">var</span> n: int
|
||||
<span id="L113" class="LineNr">113 </span> copy-to n, <span class="Constant">0x80000000</span>
|
||||
<span id="L114" class="LineNr">114 </span> <span class="PreProc">var</span> negative-zero/<span class="Constant">xmm0</span>: float <span class="Special"><-</span> reinterpret n
|
||||
|
@ -177,7 +183,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L118" class="LineNr">118 </span>
|
||||
<span id="L119" class="LineNr">119 </span><span class="PreProc">fn</span> <span class="muTest"><a href='412render-float-decimal.mu.html#L119'>test-write-float-decimal-approximate-infinity</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L120" class="LineNr">120 </span> <span class="PreProc">var</span> s-storage: (stream byte <span class="Constant">0x10</span>)
|
||||
<span id="L121" class="LineNr">121 </span> <span class="PreProc">var</span> s/<span class="Constant">ecx</span>: (addr stream byte) <span class="Special"><-</span> address s-storage
|
||||
<span id="L121" class="LineNr">121 </span> <span class="PreProc">var</span> s/<span class="muRegEcx">ecx</span>: (addr stream byte) <span class="Special"><-</span> address s-storage
|
||||
<span id="L122" class="LineNr">122 </span> <span class="PreProc">var</span> n: int
|
||||
<span id="L123" class="LineNr">123 </span> <span class="muComment"># 0|11111111|00000000000000000000000</span>
|
||||
<span id="L124" class="LineNr">124 </span> <span class="muComment"># 0111|1111|1000|0000|0000|0000|0000|0000</span>
|
||||
|
@ -189,7 +195,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L130" class="LineNr">130 </span>
|
||||
<span id="L131" class="LineNr">131 </span><span class="PreProc">fn</span> <span class="muTest"><a href='412render-float-decimal.mu.html#L131'>test-write-float-decimal-approximate-negative-infinity</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L132" class="LineNr">132 </span> <span class="PreProc">var</span> s-storage: (stream byte <span class="Constant">0x10</span>)
|
||||
<span id="L133" class="LineNr">133 </span> <span class="PreProc">var</span> s/<span class="Constant">ecx</span>: (addr stream byte) <span class="Special"><-</span> address s-storage
|
||||
<span id="L133" class="LineNr">133 </span> <span class="PreProc">var</span> s/<span class="muRegEcx">ecx</span>: (addr stream byte) <span class="Special"><-</span> address s-storage
|
||||
<span id="L134" class="LineNr">134 </span> <span class="PreProc">var</span> n: int
|
||||
<span id="L135" class="LineNr">135 </span> copy-to n, <span class="Constant">0xff800000</span>
|
||||
<span id="L136" class="LineNr">136 </span> <span class="PreProc">var</span> negative-infinity/<span class="Constant">xmm0</span>: float <span class="Special"><-</span> reinterpret n
|
||||
|
@ -199,7 +205,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L140" class="LineNr">140 </span>
|
||||
<span id="L141" class="LineNr">141 </span><span class="PreProc">fn</span> <span class="muTest"><a href='412render-float-decimal.mu.html#L141'>test-write-float-decimal-approximate-not-a-number</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L142" class="LineNr">142 </span> <span class="PreProc">var</span> s-storage: (stream byte <span class="Constant">0x10</span>)
|
||||
<span id="L143" class="LineNr">143 </span> <span class="PreProc">var</span> s/<span class="Constant">ecx</span>: (addr stream byte) <span class="Special"><-</span> address s-storage
|
||||
<span id="L143" class="LineNr">143 </span> <span class="PreProc">var</span> s/<span class="muRegEcx">ecx</span>: (addr stream byte) <span class="Special"><-</span> address s-storage
|
||||
<span id="L144" class="LineNr">144 </span> <span class="PreProc">var</span> n: int
|
||||
<span id="L145" class="LineNr">145 </span> copy-to n, <span class="Constant">0xffffffff</span> <span class="muComment"># exponent must be all 1's, and mantissa must be non-zero</span>
|
||||
<span id="L146" class="LineNr">146 </span> <span class="PreProc">var</span> nan/<span class="Constant">xmm0</span>: float <span class="Special"><-</span> reinterpret n
|
||||
|
@ -207,21 +213,21 @@ if ('onhashchange' in window) {
|
|||
<span id="L148" class="LineNr">148 </span> <a href='109stream-equal.subx.html#L194'>check-stream-equal</a> s, <span class="Constant">"NaN"</span>, <span class="Constant">"F - test-write-float-decimal-approximate-not-a-number"</span>
|
||||
<span id="L149" class="LineNr">149 </span><span class="Delimiter">}</span>
|
||||
<span id="L150" class="LineNr">150 </span>
|
||||
<span id="L151" class="LineNr">151 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='412render-float-decimal.mu.html#L151'>render-float-decimal</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), in: float, precision: int, x: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L151" class="LineNr">151 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='412render-float-decimal.mu.html#L151'>render-float-decimal</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), in: float, precision: int, x: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L152" class="LineNr">152 </span> <span class="PreProc">var</span> s-storage: (stream byte <span class="Constant">0x10</span>)
|
||||
<span id="L153" class="LineNr">153 </span> <span class="PreProc">var</span> s/<span class="Constant">esi</span>: (addr stream byte) <span class="Special"><-</span> address s-storage
|
||||
<span id="L153" class="LineNr">153 </span> <span class="PreProc">var</span> s/<span class="muRegEsi">esi</span>: (addr stream byte) <span class="Special"><-</span> address s-storage
|
||||
<span id="L154" class="LineNr">154 </span> <a href='412render-float-decimal.mu.html#L163'>write-float-decimal-approximate</a> s, in, precision
|
||||
<span id="L155" class="LineNr">155 </span> <span class="PreProc">var</span> width/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L156" class="LineNr">156 </span> <span class="PreProc">var</span> height/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L157" class="LineNr">157 </span> width, height <span class="Special"><-</span> <a href='500fake-screen.mu.html#L70'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L158" class="LineNr">158 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='501draw-text.mu.html#L111'>draw-stream-rightward</a> <a href='500fake-screen.mu.html#L14'>screen</a>, s, x, width, y, color, background-color
|
||||
<span id="L155" class="LineNr">155 </span> <span class="PreProc">var</span> width/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L156" class="LineNr">156 </span> <span class="PreProc">var</span> height/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L157" class="LineNr">157 </span> width, height <span class="Special"><-</span> <a href='500fake-screen.mu.html#L86'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L158" class="LineNr">158 </span> <span class="PreProc">var</span> result/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='501draw-text.mu.html#L111'>draw-stream-rightward</a> <a href='500fake-screen.mu.html#L14'>screen</a>, s, x, width, y, color, background-color
|
||||
<span id="L159" class="LineNr">159 </span> <span class="PreProc">return</span> result
|
||||
<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="muComment"># 'precision' controls the maximum width past which we resort to scientific notation</span>
|
||||
<span id="L163" class="LineNr">163 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='412render-float-decimal.mu.html#L163'>write-float-decimal-approximate</a></span> out: (addr stream byte), in: float, precision: int <span class="Delimiter">{</span>
|
||||
<span id="L164" class="LineNr">164 </span> <span class="muComment"># - special names</span>
|
||||
<span id="L165" class="LineNr">165 </span> <span class="PreProc">var</span> bits/<span class="Constant">eax</span>: int <span class="Special"><-</span> reinterpret in
|
||||
<span id="L165" class="LineNr">165 </span> <span class="PreProc">var</span> bits/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> reinterpret in
|
||||
<span id="L166" class="LineNr">166 </span> compare bits, <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>
|
||||
|
@ -246,7 +252,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L187" class="LineNr">187 </span> <a href='108write.subx.html#L11'>write</a> out, <span class="Constant">"-Inf"</span>
|
||||
<span id="L188" class="LineNr">188 </span> <span class="PreProc">return</span>
|
||||
<span id="L189" class="LineNr">189 </span> <span class="Delimiter">}</span>
|
||||
<span id="L190" class="LineNr">190 </span> <span class="PreProc">var</span> exponent/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy bits
|
||||
<span id="L190" class="LineNr">190 </span> <span class="PreProc">var</span> exponent/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy bits
|
||||
<span id="L191" class="LineNr">191 </span> exponent <span class="Special"><-</span> shift-right <span class="Constant">0x17</span> <span class="muComment"># 23 bits of mantissa</span>
|
||||
<span id="L192" class="LineNr">192 </span> exponent <span class="Special"><-</span> and <span class="Constant">0xff</span>
|
||||
<span id="L193" class="LineNr">193 </span> exponent <span class="Special"><-</span> subtract <span class="Constant">0x7f</span>
|
||||
|
@ -257,7 +263,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L198" class="LineNr">198 </span> <span class="PreProc">return</span>
|
||||
<span id="L199" class="LineNr">199 </span> <span class="Delimiter">}</span>
|
||||
<span id="L200" class="LineNr">200 </span> <span class="muComment"># - regular numbers</span>
|
||||
<span id="L201" class="LineNr">201 </span> <span class="PreProc">var</span> sign/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy bits
|
||||
<span id="L201" class="LineNr">201 </span> <span class="PreProc">var</span> sign/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy bits
|
||||
<span id="L202" class="LineNr">202 </span> sign <span class="Special"><-</span> shift-right <span class="Constant">0x1f</span>
|
||||
<span id="L203" class="LineNr">203 </span> <span class="Delimiter">{</span>
|
||||
<span id="L204" class="LineNr">204 </span> compare sign, <span class="Constant">1</span>
|
||||
|
@ -266,18 +272,18 @@ if ('onhashchange' in window) {
|
|||
<span id="L207" class="LineNr">207 </span> <span class="Delimiter">}</span>
|
||||
<span id="L208" class="LineNr">208 </span>
|
||||
<span id="L209" class="LineNr">209 </span> <span class="muComment"># v = 1.mantissa (in base 2) << 0x17</span>
|
||||
<span id="L210" class="LineNr">210 </span> <span class="PreProc">var</span> v/<span class="Constant">ebx</span>: int <span class="Special"><-</span> copy bits
|
||||
<span id="L210" class="LineNr">210 </span> <span class="PreProc">var</span> v/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> copy bits
|
||||
<span id="L211" class="LineNr">211 </span> v <span class="Special"><-</span> and <span class="Constant">0x7fffff</span>
|
||||
<span id="L212" class="LineNr">212 </span> v <span class="Special"><-</span> or <span class="Constant">0x00800000</span> <span class="muComment"># insert implicit 1</span>
|
||||
<span id="L213" class="LineNr">213 </span> <span class="muComment"># e = exponent - 0x17</span>
|
||||
<span id="L214" class="LineNr">214 </span> <span class="PreProc">var</span> e/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy exponent
|
||||
<span id="L214" class="LineNr">214 </span> <span class="PreProc">var</span> e/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy exponent
|
||||
<span id="L215" class="LineNr">215 </span> e <span class="Special"><-</span> subtract <span class="Constant">0x17</span> <span class="muComment"># move decimal place from before mantissa to after</span>
|
||||
<span id="L216" class="LineNr">216 </span>
|
||||
<span id="L217" class="LineNr">217 </span> <span class="muComment"># initialize buffer with decimal representation of v</span>
|
||||
<span id="L218" class="LineNr">218 </span> <span class="muComment"># unlike <a href="https://research.swtch.com/ftoa">https://research.swtch.com/ftoa</a>, no ascii here</span>
|
||||
<span id="L219" class="LineNr">219 </span> <span class="PreProc">var</span> buf-storage: (array byte <span class="Constant">0x7f</span>)
|
||||
<span id="L220" class="LineNr">220 </span> <span class="PreProc">var</span> buf/<span class="Constant">edi</span>: (addr array byte) <span class="Special"><-</span> address buf-storage
|
||||
<span id="L221" class="LineNr">221 </span> <span class="PreProc">var</span> n/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='412render-float-decimal.mu.html#L251'>decimal-digits</a> v, buf
|
||||
<span id="L220" class="LineNr">220 </span> <span class="PreProc">var</span> buf/<span class="muRegEdi">edi</span>: (addr array byte) <span class="Special"><-</span> address buf-storage
|
||||
<span id="L221" class="LineNr">221 </span> <span class="PreProc">var</span> n/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='412render-float-decimal.mu.html#L251'>decimal-digits</a> v, buf
|
||||
<span id="L222" class="LineNr">222 </span> <span class="muComment"># I suspect we can do without reversing, but we'll follow <a href="https://research.swtch.com/ftoa">https://research.swtch.com/ftoa</a></span>
|
||||
<span id="L223" class="LineNr">223 </span> <span class="muComment"># closely for now.</span>
|
||||
<span id="L224" class="LineNr">224 </span> <a href='412render-float-decimal.mu.html#L268'>reverse-digits</a> buf, n
|
||||
|
@ -291,7 +297,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L232" class="LineNr">232 </span> <span class="PreProc">loop</span>
|
||||
<span id="L233" class="LineNr">233 </span> <span class="Delimiter">}</span>
|
||||
<span id="L234" class="LineNr">234 </span>
|
||||
<span id="L235" class="LineNr">235 </span> <span class="PreProc">var</span> dp/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy n
|
||||
<span id="L235" class="LineNr">235 </span> <span class="PreProc">var</span> dp/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy n
|
||||
<span id="L236" class="LineNr">236 </span>
|
||||
<span id="L237" class="LineNr">237 </span> <span class="muComment"># loop if e < 0</span>
|
||||
<span id="L238" class="LineNr">238 </span> <span class="Delimiter">{</span>
|
||||
|
@ -307,16 +313,16 @@ if ('onhashchange' in window) {
|
|||
<span id="L248" class="LineNr">248 </span>
|
||||
<span id="L249" class="LineNr">249 </span><span class="muComment"># store the decimal digits of 'n' into 'buf', units first</span>
|
||||
<span id="L250" class="LineNr">250 </span><span class="muComment"># n must be positive</span>
|
||||
<span id="L251" class="LineNr">251 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='412render-float-decimal.mu.html#L251'>decimal-digits</a></span> n: int, _buf: (addr array byte)<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L252" class="LineNr">252 </span> <span class="PreProc">var</span> buf/<span class="Constant">edi</span>: (addr array byte) <span class="Special"><-</span> copy _buf
|
||||
<span id="L253" class="LineNr">253 </span> <span class="PreProc">var</span> i/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L254" class="LineNr">254 </span> <span class="PreProc">var</span> curr/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy n
|
||||
<span id="L255" class="LineNr">255 </span> <span class="PreProc">var</span> curr-byte/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L251" class="LineNr">251 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='412render-float-decimal.mu.html#L251'>decimal-digits</a></span> n: int, _buf: (addr array byte)<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L252" class="LineNr">252 </span> <span class="PreProc">var</span> buf/<span class="muRegEdi">edi</span>: (addr array byte) <span class="Special"><-</span> copy _buf
|
||||
<span id="L253" class="LineNr">253 </span> <span class="PreProc">var</span> i/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L254" class="LineNr">254 </span> <span class="PreProc">var</span> curr/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy n
|
||||
<span id="L255" class="LineNr">255 </span> <span class="PreProc">var</span> curr-byte/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L256" class="LineNr">256 </span> <span class="Delimiter">{</span>
|
||||
<span id="L257" class="LineNr">257 </span> compare curr, <span class="Constant">0</span>
|
||||
<span id="L258" class="LineNr">258 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L259" class="LineNr">259 </span> curr, curr-byte <span class="Special"><-</span> <a href='314divide.subx.html#L3'>integer-divide</a> curr, <span class="Constant">0xa</span>
|
||||
<span id="L260" class="LineNr">260 </span> <span class="PreProc">var</span> dest/<span class="Constant">ebx</span>: (addr byte) <span class="Special"><-</span> index buf, i
|
||||
<span id="L260" class="LineNr">260 </span> <span class="PreProc">var</span> dest/<span class="muRegEbx">ebx</span>: (addr byte) <span class="Special"><-</span> index buf, i
|
||||
<span id="L261" class="LineNr">261 </span> copy-byte-to *dest, curr-byte
|
||||
<span id="L262" class="LineNr">262 </span> i <span class="Special"><-</span> increment
|
||||
<span id="L263" class="LineNr">263 </span> <span class="PreProc">loop</span>
|
||||
|
@ -325,18 +331,18 @@ if ('onhashchange' in window) {
|
|||
<span id="L266" class="LineNr">266 </span><span class="Delimiter">}</span>
|
||||
<span id="L267" class="LineNr">267 </span>
|
||||
<span id="L268" class="LineNr">268 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='412render-float-decimal.mu.html#L268'>reverse-digits</a></span> _buf: (addr array byte), n: int <span class="Delimiter">{</span>
|
||||
<span id="L269" class="LineNr">269 </span> <span class="PreProc">var</span> buf/<span class="Constant">esi</span>: (addr array byte) <span class="Special"><-</span> copy _buf
|
||||
<span id="L270" class="LineNr">270 </span> <span class="PreProc">var</span> left/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L271" class="LineNr">271 </span> <span class="PreProc">var</span> right/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy n
|
||||
<span id="L269" class="LineNr">269 </span> <span class="PreProc">var</span> buf/<span class="muRegEsi">esi</span>: (addr array byte) <span class="Special"><-</span> copy _buf
|
||||
<span id="L270" class="LineNr">270 </span> <span class="PreProc">var</span> left/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L271" class="LineNr">271 </span> <span class="PreProc">var</span> right/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy n
|
||||
<span id="L272" class="LineNr">272 </span> right <span class="Special"><-</span> decrement
|
||||
<span id="L273" class="LineNr">273 </span> <span class="Delimiter">{</span>
|
||||
<span id="L274" class="LineNr">274 </span> compare left, right
|
||||
<span id="L275" class="LineNr">275 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L276" class="LineNr">276 </span> <span class="Delimiter">{</span>
|
||||
<span id="L277" class="LineNr">277 </span> <span class="PreProc">var</span> l-a/<span class="Constant">ecx</span>: (addr byte) <span class="Special"><-</span> index buf, left
|
||||
<span id="L278" class="LineNr">278 </span> <span class="PreProc">var</span> r-a/<span class="Constant">edx</span>: (addr byte) <span class="Special"><-</span> index buf, right
|
||||
<span id="L279" class="LineNr">279 </span> <span class="PreProc">var</span> l/<span class="Constant">ebx</span>: byte <span class="Special"><-</span> copy-byte *l-a
|
||||
<span id="L280" class="LineNr">280 </span> <span class="PreProc">var</span> r/<span class="Constant">eax</span>: byte <span class="Special"><-</span> copy-byte *r-a
|
||||
<span id="L277" class="LineNr">277 </span> <span class="PreProc">var</span> l-a/<span class="muRegEcx">ecx</span>: (addr byte) <span class="Special"><-</span> index buf, left
|
||||
<span id="L278" class="LineNr">278 </span> <span class="PreProc">var</span> r-a/<span class="muRegEdx">edx</span>: (addr byte) <span class="Special"><-</span> index buf, right
|
||||
<span id="L279" class="LineNr">279 </span> <span class="PreProc">var</span> l/<span class="muRegEbx">ebx</span>: byte <span class="Special"><-</span> copy-byte *l-a
|
||||
<span id="L280" class="LineNr">280 </span> <span class="PreProc">var</span> r/<span class="muRegEax">eax</span>: byte <span class="Special"><-</span> copy-byte *r-a
|
||||
<span id="L281" class="LineNr">281 </span> copy-byte-to *l-a, r
|
||||
<span id="L282" class="LineNr">282 </span> copy-byte-to *r-a, l
|
||||
<span id="L283" class="LineNr">283 </span> <span class="Delimiter">}</span>
|
||||
|
@ -346,37 +352,37 @@ if ('onhashchange' in window) {
|
|||
<span id="L287" class="LineNr">287 </span> <span class="Delimiter">}</span>
|
||||
<span id="L288" class="LineNr">288 </span><span class="Delimiter">}</span>
|
||||
<span id="L289" class="LineNr">289 </span>
|
||||
<span id="L290" class="LineNr">290 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='412render-float-decimal.mu.html#L290'>double-array-of-decimal-digits</a></span> _buf: (addr array byte), _n: int<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L291" class="LineNr">291 </span> <span class="PreProc">var</span> buf/<span class="Constant">edi</span>: (addr array byte) <span class="Special"><-</span> copy _buf
|
||||
<span id="L290" class="LineNr">290 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='412render-float-decimal.mu.html#L290'>double-array-of-decimal-digits</a></span> _buf: (addr array byte), _n: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L291" class="LineNr">291 </span> <span class="PreProc">var</span> buf/<span class="muRegEdi">edi</span>: (addr array byte) <span class="Special"><-</span> copy _buf
|
||||
<span id="L292" class="LineNr">292 </span> <span class="muComment"># initialize delta</span>
|
||||
<span id="L293" class="LineNr">293 </span> <span class="PreProc">var</span> delta/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L293" class="LineNr">293 </span> <span class="PreProc">var</span> delta/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L294" class="LineNr">294 </span> <span class="Delimiter">{</span>
|
||||
<span id="L295" class="LineNr">295 </span> <span class="PreProc">var</span> curr/<span class="Constant">ebx</span>: (addr byte) <span class="Special"><-</span> index buf, <span class="Constant">0</span>
|
||||
<span id="L296" class="LineNr">296 </span> <span class="PreProc">var</span> tmp/<span class="Constant">eax</span>: byte <span class="Special"><-</span> copy-byte *curr
|
||||
<span id="L295" class="LineNr">295 </span> <span class="PreProc">var</span> curr/<span class="muRegEbx">ebx</span>: (addr byte) <span class="Special"><-</span> index buf, <span class="Constant">0</span>
|
||||
<span id="L296" class="LineNr">296 </span> <span class="PreProc">var</span> tmp/<span class="muRegEax">eax</span>: byte <span class="Special"><-</span> copy-byte *curr
|
||||
<span id="L297" class="LineNr">297 </span> compare tmp, <span class="Constant">5</span>
|
||||
<span id="L298" class="LineNr">298 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L299" class="LineNr">299 </span> delta <span class="Special"><-</span> copy <span class="Constant">1</span>
|
||||
<span id="L300" class="LineNr">300 </span> <span class="Delimiter">}</span>
|
||||
<span id="L301" class="LineNr">301 </span> <span class="muComment"># loop</span>
|
||||
<span id="L302" class="LineNr">302 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L303" class="LineNr">303 </span> <span class="PreProc">var</span> i/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy _n
|
||||
<span id="L302" class="LineNr">302 </span> <span class="PreProc">var</span> x/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L303" class="LineNr">303 </span> <span class="PreProc">var</span> i/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy _n
|
||||
<span id="L304" class="LineNr">304 </span> i <span class="Special"><-</span> decrement
|
||||
<span id="L305" class="LineNr">305 </span> <span class="Delimiter">{</span>
|
||||
<span id="L306" class="LineNr">306 </span> compare i, <span class="Constant">0</span>
|
||||
<span id="L307" class="LineNr">307 </span> <span class="PreProc">break-if-<=</span>
|
||||
<span id="L308" class="LineNr">308 </span> <span class="muComment"># x += 2*buf[i]</span>
|
||||
<span id="L309" class="LineNr">309 </span> <span class="Delimiter">{</span>
|
||||
<span id="L310" class="LineNr">310 </span> <span class="PreProc">var</span> tmp/<span class="Constant">ecx</span>: (addr byte) <span class="Special"><-</span> index buf, i
|
||||
<span id="L311" class="LineNr">311 </span> <span class="PreProc">var</span> tmp2/<span class="Constant">ecx</span>: byte <span class="Special"><-</span> copy-byte *tmp
|
||||
<span id="L310" class="LineNr">310 </span> <span class="PreProc">var</span> tmp/<span class="muRegEcx">ecx</span>: (addr byte) <span class="Special"><-</span> index buf, i
|
||||
<span id="L311" class="LineNr">311 </span> <span class="PreProc">var</span> tmp2/<span class="muRegEcx">ecx</span>: byte <span class="Special"><-</span> copy-byte *tmp
|
||||
<span id="L312" class="LineNr">312 </span> x <span class="Special"><-</span> add tmp2
|
||||
<span id="L313" class="LineNr">313 </span> x <span class="Special"><-</span> add tmp2
|
||||
<span id="L314" class="LineNr">314 </span> <span class="Delimiter">}</span>
|
||||
<span id="L315" class="LineNr">315 </span> <span class="muComment"># x, buf[i+delta] = x/10, x%10</span>
|
||||
<span id="L316" class="LineNr">316 </span> <span class="Delimiter">{</span>
|
||||
<span id="L317" class="LineNr">317 </span> <span class="PreProc">var</span> dest-index/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy i
|
||||
<span id="L317" class="LineNr">317 </span> <span class="PreProc">var</span> dest-index/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy i
|
||||
<span id="L318" class="LineNr">318 </span> dest-index <span class="Special"><-</span> add delta
|
||||
<span id="L319" class="LineNr">319 </span> <span class="PreProc">var</span> dest/<span class="Constant">edi</span>: (addr byte) <span class="Special"><-</span> index buf, dest-index
|
||||
<span id="L320" class="LineNr">320 </span> <span class="PreProc">var</span> next-digit/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L319" class="LineNr">319 </span> <span class="PreProc">var</span> dest/<span class="muRegEdi">edi</span>: (addr byte) <span class="Special"><-</span> index buf, dest-index
|
||||
<span id="L320" class="LineNr">320 </span> <span class="PreProc">var</span> next-digit/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L321" class="LineNr">321 </span> x, next-digit <span class="Special"><-</span> <a href='314divide.subx.html#L3'>integer-divide</a> x, <span class="Constant">0xa</span>
|
||||
<span id="L322" class="LineNr">322 </span> copy-byte-to *dest, next-digit
|
||||
<span id="L323" class="LineNr">323 </span> <span class="Delimiter">}</span>
|
||||
|
@ -385,51 +391,51 @@ if ('onhashchange' in window) {
|
|||
<span id="L326" class="LineNr">326 </span> <span class="PreProc">loop</span>
|
||||
<span id="L327" class="LineNr">327 </span> <span class="Delimiter">}</span>
|
||||
<span id="L328" class="LineNr">328 </span> <span class="muComment"># final patch-up</span>
|
||||
<span id="L329" class="LineNr">329 </span> <span class="PreProc">var</span> n/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy _n
|
||||
<span id="L329" class="LineNr">329 </span> <span class="PreProc">var</span> n/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy _n
|
||||
<span id="L330" class="LineNr">330 </span> compare delta, <span class="Constant">1</span>
|
||||
<span id="L331" class="LineNr">331 </span> <span class="Delimiter">{</span>
|
||||
<span id="L332" class="LineNr">332 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L333" class="LineNr">333 </span> <span class="PreProc">var</span> curr/<span class="Constant">ebx</span>: (addr byte) <span class="Special"><-</span> index buf, <span class="Constant">0</span>
|
||||
<span id="L334" class="LineNr">334 </span> <span class="PreProc">var</span> one/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">1</span>
|
||||
<span id="L333" class="LineNr">333 </span> <span class="PreProc">var</span> curr/<span class="muRegEbx">ebx</span>: (addr byte) <span class="Special"><-</span> index buf, <span class="Constant">0</span>
|
||||
<span id="L334" class="LineNr">334 </span> <span class="PreProc">var</span> one/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">1</span>
|
||||
<span id="L335" class="LineNr">335 </span> copy-byte-to *curr, one
|
||||
<span id="L336" class="LineNr">336 </span> n <span class="Special"><-</span> increment
|
||||
<span id="L337" class="LineNr">337 </span> <span class="Delimiter">}</span>
|
||||
<span id="L338" class="LineNr">338 </span> <span class="PreProc">return</span> n
|
||||
<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="muFunction"><a href='412render-float-decimal.mu.html#L341'>halve-array-of-decimal-digits</a></span> _buf: (addr array byte), _n: int, _dp: int<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">edx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L342" class="LineNr">342 </span> <span class="PreProc">var</span> buf/<span class="Constant">edi</span>: (addr array byte) <span class="Special"><-</span> copy _buf
|
||||
<span id="L343" class="LineNr">343 </span> <span class="PreProc">var</span> n/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy _n
|
||||
<span id="L344" class="LineNr">344 </span> <span class="PreProc">var</span> dp/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy _dp
|
||||
<span id="L341" class="LineNr">341 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='412render-float-decimal.mu.html#L341'>halve-array-of-decimal-digits</a></span> _buf: (addr array byte), _n: int, _dp: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int, _/<span class="muRegEdx">edx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L342" class="LineNr">342 </span> <span class="PreProc">var</span> buf/<span class="muRegEdi">edi</span>: (addr array byte) <span class="Special"><-</span> copy _buf
|
||||
<span id="L343" class="LineNr">343 </span> <span class="PreProc">var</span> n/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy _n
|
||||
<span id="L344" class="LineNr">344 </span> <span class="PreProc">var</span> dp/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy _dp
|
||||
<span id="L345" class="LineNr">345 </span> <span class="muComment"># initialize one side</span>
|
||||
<span id="L346" class="LineNr">346 </span> <span class="Delimiter">{</span>
|
||||
<span id="L347" class="LineNr">347 </span> <span class="muComment"># if buf[n-1]%2 == 0, break</span>
|
||||
<span id="L348" class="LineNr">348 </span> <span class="PreProc">var</span> right-index/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy n
|
||||
<span id="L348" class="LineNr">348 </span> <span class="PreProc">var</span> right-index/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy n
|
||||
<span id="L349" class="LineNr">349 </span> right-index <span class="Special"><-</span> decrement
|
||||
<span id="L350" class="LineNr">350 </span> <span class="PreProc">var</span> right-a/<span class="Constant">ecx</span>: (addr byte) <span class="Special"><-</span> index buf, right-index
|
||||
<span id="L351" class="LineNr">351 </span> <span class="PreProc">var</span> right/<span class="Constant">ecx</span>: byte <span class="Special"><-</span> copy-byte *right-a
|
||||
<span id="L352" class="LineNr">352 </span> <span class="PreProc">var</span> right-int/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy right
|
||||
<span id="L353" class="LineNr">353 </span> <span class="PreProc">var</span> remainder/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L350" class="LineNr">350 </span> <span class="PreProc">var</span> right-a/<span class="muRegEcx">ecx</span>: (addr byte) <span class="Special"><-</span> index buf, right-index
|
||||
<span id="L351" class="LineNr">351 </span> <span class="PreProc">var</span> right/<span class="muRegEcx">ecx</span>: byte <span class="Special"><-</span> copy-byte *right-a
|
||||
<span id="L352" class="LineNr">352 </span> <span class="PreProc">var</span> right-int/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy right
|
||||
<span id="L353" class="LineNr">353 </span> <span class="PreProc">var</span> remainder/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L354" class="LineNr">354 </span> <span class="Delimiter">{</span>
|
||||
<span id="L355" class="LineNr">355 </span> <span class="PreProc">var</span> dummy/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L355" class="LineNr">355 </span> <span class="PreProc">var</span> dummy/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L356" class="LineNr">356 </span> dummy, remainder <span class="Special"><-</span> <a href='314divide.subx.html#L3'>integer-divide</a> right-int, <span class="Constant">2</span>
|
||||
<span id="L357" class="LineNr">357 </span> <span class="Delimiter">}</span>
|
||||
<span id="L358" class="LineNr">358 </span> compare remainder, <span class="Constant">0</span>
|
||||
<span id="L359" class="LineNr">359 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L360" class="LineNr">360 </span> <span class="muComment"># buf[n] = 0</span>
|
||||
<span id="L361" class="LineNr">361 </span> <span class="PreProc">var</span> next-a/<span class="Constant">ecx</span>: (addr byte) <span class="Special"><-</span> index buf, n
|
||||
<span id="L362" class="LineNr">362 </span> <span class="PreProc">var</span> zero/<span class="Constant">edx</span>: byte <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L361" class="LineNr">361 </span> <span class="PreProc">var</span> next-a/<span class="muRegEcx">ecx</span>: (addr byte) <span class="Special"><-</span> index buf, n
|
||||
<span id="L362" class="LineNr">362 </span> <span class="PreProc">var</span> zero/<span class="muRegEdx">edx</span>: byte <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L363" class="LineNr">363 </span> copy-byte-to *next-a, zero
|
||||
<span id="L364" class="LineNr">364 </span> <span class="muComment"># n++</span>
|
||||
<span id="L365" class="LineNr">365 </span> n <span class="Special"><-</span> increment
|
||||
<span id="L366" class="LineNr">366 </span> <span class="Delimiter">}</span>
|
||||
<span id="L367" class="LineNr">367 </span> <span class="muComment"># initialize the other</span>
|
||||
<span id="L368" class="LineNr">368 </span> <span class="PreProc">var</span> delta/<span class="Constant">ebx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L369" class="LineNr">369 </span> <span class="PreProc">var</span> x/<span class="Constant">esi</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L368" class="LineNr">368 </span> <span class="PreProc">var</span> delta/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L369" class="LineNr">369 </span> <span class="PreProc">var</span> x/<span class="muRegEsi">esi</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L370" class="LineNr">370 </span> <span class="Delimiter">{</span>
|
||||
<span id="L371" class="LineNr">371 </span> <span class="muComment"># if buf[0] >= 2, break</span>
|
||||
<span id="L372" class="LineNr">372 </span> <span class="PreProc">var</span> left/<span class="Constant">ecx</span>: (addr byte) <span class="Special"><-</span> index buf, <span class="Constant">0</span>
|
||||
<span id="L373" class="LineNr">373 </span> <span class="PreProc">var</span> src/<span class="Constant">ecx</span>: byte <span class="Special"><-</span> copy-byte *left
|
||||
<span id="L372" class="LineNr">372 </span> <span class="PreProc">var</span> left/<span class="muRegEcx">ecx</span>: (addr byte) <span class="Special"><-</span> index buf, <span class="Constant">0</span>
|
||||
<span id="L373" class="LineNr">373 </span> <span class="PreProc">var</span> src/<span class="muRegEcx">ecx</span>: byte <span class="Special"><-</span> copy-byte *left
|
||||
<span id="L374" class="LineNr">374 </span> compare src, <span class="Constant">2</span>
|
||||
<span id="L375" class="LineNr">375 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L376" class="LineNr">376 </span> <span class="muComment"># delta, x = 1, buf[0]</span>
|
||||
|
@ -441,27 +447,27 @@ if ('onhashchange' in window) {
|
|||
<span id="L382" class="LineNr">382 </span> dp <span class="Special"><-</span> decrement
|
||||
<span id="L383" class="LineNr">383 </span> <span class="Delimiter">}</span>
|
||||
<span id="L384" class="LineNr">384 </span> <span class="muComment"># loop</span>
|
||||
<span id="L385" class="LineNr">385 </span> <span class="PreProc">var</span> i/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L385" class="LineNr">385 </span> <span class="PreProc">var</span> i/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L386" class="LineNr">386 </span> <span class="Delimiter">{</span>
|
||||
<span id="L387" class="LineNr">387 </span> compare i, n
|
||||
<span id="L388" class="LineNr">388 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L389" class="LineNr">389 </span> <span class="muComment"># x = x*10 + buf[i+delta]</span>
|
||||
<span id="L390" class="LineNr">390 </span> <span class="Delimiter">{</span>
|
||||
<span id="L391" class="LineNr">391 </span> <span class="PreProc">var</span> ten/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0xa</span>
|
||||
<span id="L391" class="LineNr">391 </span> <span class="PreProc">var</span> ten/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0xa</span>
|
||||
<span id="L392" class="LineNr">392 </span> x <span class="Special"><-</span> multiply ten
|
||||
<span id="L393" class="LineNr">393 </span> <span class="PreProc">var</span> src-index/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy i
|
||||
<span id="L393" class="LineNr">393 </span> <span class="PreProc">var</span> src-index/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy i
|
||||
<span id="L394" class="LineNr">394 </span> src-index <span class="Special"><-</span> add delta
|
||||
<span id="L395" class="LineNr">395 </span> <span class="PreProc">var</span> src-a/<span class="Constant">edx</span>: (addr byte) <span class="Special"><-</span> index buf, src-index
|
||||
<span id="L396" class="LineNr">396 </span> <span class="PreProc">var</span> src/<span class="Constant">edx</span>: byte <span class="Special"><-</span> copy-byte *src-a
|
||||
<span id="L395" class="LineNr">395 </span> <span class="PreProc">var</span> src-a/<span class="muRegEdx">edx</span>: (addr byte) <span class="Special"><-</span> index buf, src-index
|
||||
<span id="L396" class="LineNr">396 </span> <span class="PreProc">var</span> src/<span class="muRegEdx">edx</span>: byte <span class="Special"><-</span> copy-byte *src-a
|
||||
<span id="L397" class="LineNr">397 </span> x <span class="Special"><-</span> add src
|
||||
<span id="L398" class="LineNr">398 </span> <span class="Delimiter">}</span>
|
||||
<span id="L399" class="LineNr">399 </span> <span class="muComment"># buf[i], x = x/2, x%2</span>
|
||||
<span id="L400" class="LineNr">400 </span> <span class="Delimiter">{</span>
|
||||
<span id="L401" class="LineNr">401 </span> <span class="PreProc">var</span> quotient/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L402" class="LineNr">402 </span> <span class="PreProc">var</span> remainder/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L401" class="LineNr">401 </span> <span class="PreProc">var</span> quotient/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L402" class="LineNr">402 </span> <span class="PreProc">var</span> remainder/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L403" class="LineNr">403 </span> quotient, remainder <span class="Special"><-</span> <a href='314divide.subx.html#L3'>integer-divide</a> x, <span class="Constant">2</span>
|
||||
<span id="L404" class="LineNr">404 </span> x <span class="Special"><-</span> copy remainder
|
||||
<span id="L405" class="LineNr">405 </span> <span class="PreProc">var</span> dest/<span class="Constant">edx</span>: (addr byte) <span class="Special"><-</span> index buf, i
|
||||
<span id="L405" class="LineNr">405 </span> <span class="PreProc">var</span> dest/<span class="muRegEdx">edx</span>: (addr byte) <span class="Special"><-</span> index buf, i
|
||||
<span id="L406" class="LineNr">406 </span> copy-byte-to *dest, quotient
|
||||
<span id="L407" class="LineNr">407 </span> <span class="Delimiter">}</span>
|
||||
<span id="L408" class="LineNr">408 </span> <span class="muComment">#</span>
|
||||
|
@ -472,7 +478,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L413" class="LineNr">413 </span><span class="Delimiter">}</span>
|
||||
<span id="L414" class="LineNr">414 </span>
|
||||
<span id="L415" class="LineNr">415 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='412render-float-decimal.mu.html#L415'>_write-float-array-of-decimal-digits</a></span> out: (addr stream byte), _buf: (addr array byte), n: int, dp: int, precision: int <span class="Delimiter">{</span>
|
||||
<span id="L416" class="LineNr">416 </span> <span class="PreProc">var</span> buf/<span class="Constant">edi</span>: (addr array byte) <span class="Special"><-</span> copy _buf
|
||||
<span id="L416" class="LineNr">416 </span> <span class="PreProc">var</span> buf/<span class="muRegEdi">edi</span>: (addr array byte) <span class="Special"><-</span> copy _buf
|
||||
<span id="L417" class="LineNr">417 </span> <span class="Delimiter">{</span>
|
||||
<span id="L418" class="LineNr">418 </span> compare dp, <span class="Constant">0</span>
|
||||
<span id="L419" class="LineNr">419 </span> <span class="PreProc">break-if->=</span>
|
||||
|
@ -480,7 +486,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L421" class="LineNr">421 </span> <span class="PreProc">return</span>
|
||||
<span id="L422" class="LineNr">422 </span> <span class="Delimiter">}</span>
|
||||
<span id="L423" class="LineNr">423 </span> <span class="Delimiter">{</span>
|
||||
<span id="L424" class="LineNr">424 </span> <span class="PreProc">var</span> dp2/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy dp
|
||||
<span id="L424" class="LineNr">424 </span> <span class="PreProc">var</span> dp2/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy dp
|
||||
<span id="L425" class="LineNr">425 </span> compare dp2, precision
|
||||
<span id="L426" class="LineNr">426 </span> <span class="PreProc">break-if-<=</span>
|
||||
<span id="L427" class="LineNr">427 </span> <a href='412render-float-decimal.mu.html#L464'>_write-float-array-of-decimal-digits-in-scientific-notation</a> out, buf, n, dp, precision
|
||||
|
@ -491,9 +497,9 @@ if ('onhashchange' in window) {
|
|||
<span id="L432" class="LineNr">432 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L433" class="LineNr">433 </span> <a href='115write-byte.subx.html#L12'>append-byte</a> out, <span class="Constant">0x30</span>/<span class="Constant">0</span>
|
||||
<span id="L434" class="LineNr">434 </span> <span class="Delimiter">}</span>
|
||||
<span id="L435" class="LineNr">435 </span> <span class="PreProc">var</span> i/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L435" class="LineNr">435 </span> <span class="PreProc">var</span> i/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L436" class="LineNr">436 </span> <span class="muComment"># bounds = min(n, dp+3)</span>
|
||||
<span id="L437" class="LineNr">437 </span> <span class="PreProc">var</span> limit/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy dp
|
||||
<span id="L437" class="LineNr">437 </span> <span class="PreProc">var</span> limit/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy dp
|
||||
<span id="L438" class="LineNr">438 </span> limit <span class="Special"><-</span> add <span class="Constant">3</span>
|
||||
<span id="L439" class="LineNr">439 </span> <span class="Delimiter">{</span>
|
||||
<span id="L440" class="LineNr">440 </span> compare limit, n
|
||||
|
@ -509,9 +515,9 @@ if ('onhashchange' in window) {
|
|||
<span id="L450" class="LineNr">450 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L451" class="LineNr">451 </span> <a href='115write-byte.subx.html#L12'>append-byte</a> out, <span class="Constant">0x2e</span>/decimal-point
|
||||
<span id="L452" class="LineNr">452 </span> <span class="Delimiter">}</span>
|
||||
<span id="L453" class="LineNr">453 </span> <span class="PreProc">var</span> curr-a/<span class="Constant">ecx</span>: (addr byte) <span class="Special"><-</span> index buf, i
|
||||
<span id="L454" class="LineNr">454 </span> <span class="PreProc">var</span> curr/<span class="Constant">ecx</span>: byte <span class="Special"><-</span> copy-byte *curr-a
|
||||
<span id="L455" class="LineNr">455 </span> <span class="PreProc">var</span> curr-int/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy curr
|
||||
<span id="L453" class="LineNr">453 </span> <span class="PreProc">var</span> curr-a/<span class="muRegEcx">ecx</span>: (addr byte) <span class="Special"><-</span> index buf, i
|
||||
<span id="L454" class="LineNr">454 </span> <span class="PreProc">var</span> curr/<span class="muRegEcx">ecx</span>: byte <span class="Special"><-</span> copy-byte *curr-a
|
||||
<span id="L455" class="LineNr">455 </span> <span class="PreProc">var</span> curr-int/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy curr
|
||||
<span id="L456" class="LineNr">456 </span> curr-int <span class="Special"><-</span> add <span class="Constant">0x30</span>/<span class="Constant">0</span>
|
||||
<span id="L457" class="LineNr">457 </span> <a href='115write-byte.subx.html#L12'>append-byte</a> out, curr-int
|
||||
<span id="L458" class="LineNr">458 </span> <span class="muComment">#</span>
|
||||
|
@ -521,8 +527,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L462" class="LineNr">462 </span><span class="Delimiter">}</span>
|
||||
<span id="L463" class="LineNr">463 </span>
|
||||
<span id="L464" class="LineNr">464 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='412render-float-decimal.mu.html#L464'>_write-float-array-of-decimal-digits-in-scientific-notation</a></span> out: (addr stream byte), _buf: (addr array byte), n: int, dp: int, precision: int <span class="Delimiter">{</span>
|
||||
<span id="L465" class="LineNr">465 </span> <span class="PreProc">var</span> buf/<span class="Constant">edi</span>: (addr array byte) <span class="Special"><-</span> copy _buf
|
||||
<span id="L466" class="LineNr">466 </span> <span class="PreProc">var</span> i/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L465" class="LineNr">465 </span> <span class="PreProc">var</span> buf/<span class="muRegEdi">edi</span>: (addr array byte) <span class="Special"><-</span> copy _buf
|
||||
<span id="L466" class="LineNr">466 </span> <span class="PreProc">var</span> i/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L467" class="LineNr">467 </span> <span class="Delimiter">{</span>
|
||||
<span id="L468" class="LineNr">468 </span> compare i, n
|
||||
<span id="L469" class="LineNr">469 </span> <span class="PreProc">break-if->=</span>
|
||||
|
@ -533,9 +539,9 @@ if ('onhashchange' in window) {
|
|||
<span id="L474" class="LineNr">474 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L475" class="LineNr">475 </span> <a href='115write-byte.subx.html#L12'>append-byte</a> out, <span class="Constant">0x2e</span>/decimal-point
|
||||
<span id="L476" class="LineNr">476 </span> <span class="Delimiter">}</span>
|
||||
<span id="L477" class="LineNr">477 </span> <span class="PreProc">var</span> curr-a/<span class="Constant">ecx</span>: (addr byte) <span class="Special"><-</span> index buf, i
|
||||
<span id="L478" class="LineNr">478 </span> <span class="PreProc">var</span> curr/<span class="Constant">ecx</span>: byte <span class="Special"><-</span> copy-byte *curr-a
|
||||
<span id="L479" class="LineNr">479 </span> <span class="PreProc">var</span> curr-int/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy curr
|
||||
<span id="L477" class="LineNr">477 </span> <span class="PreProc">var</span> curr-a/<span class="muRegEcx">ecx</span>: (addr byte) <span class="Special"><-</span> index buf, i
|
||||
<span id="L478" class="LineNr">478 </span> <span class="PreProc">var</span> curr/<span class="muRegEcx">ecx</span>: byte <span class="Special"><-</span> copy-byte *curr-a
|
||||
<span id="L479" class="LineNr">479 </span> <span class="PreProc">var</span> curr-int/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy curr
|
||||
<span id="L480" class="LineNr">480 </span> curr-int <span class="Special"><-</span> add <span class="Constant">0x30</span>/<span class="Constant">0</span>
|
||||
<span id="L481" class="LineNr">481 </span> <a href='115write-byte.subx.html#L12'>append-byte</a> out, curr-int
|
||||
<span id="L482" class="LineNr">482 </span> <span class="muComment">#</span>
|
||||
|
@ -549,9 +555,9 @@ if ('onhashchange' in window) {
|
|||
<span id="L490" class="LineNr">490 </span>
|
||||
<span id="L491" class="LineNr">491 </span><span class="muComment"># follows the structure of write-float-decimal-approximate</span>
|
||||
<span id="L492" class="LineNr">492 </span><span class="muComment"># 'precision' controls the maximum width past which we resort to scientific notation</span>
|
||||
<span id="L493" class="LineNr">493 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='412render-float-decimal.mu.html#L493'>float-size</a></span> in: float, precision: int<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L493" class="LineNr">493 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='412render-float-decimal.mu.html#L493'>float-size</a></span> in: float, precision: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L494" class="LineNr">494 </span> <span class="muComment"># - special names</span>
|
||||
<span id="L495" class="LineNr">495 </span> <span class="PreProc">var</span> bits/<span class="Constant">eax</span>: int <span class="Special"><-</span> reinterpret in
|
||||
<span id="L495" class="LineNr">495 </span> <span class="PreProc">var</span> bits/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> reinterpret in
|
||||
<span id="L496" class="LineNr">496 </span> compare bits, <span class="Constant">0</span>
|
||||
<span id="L497" class="LineNr">497 </span> <span class="Delimiter">{</span>
|
||||
<span id="L498" class="LineNr">498 </span> <span class="PreProc">break-if-!=</span>
|
||||
|
@ -572,7 +578,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L513" class="LineNr">513 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L514" class="LineNr">514 </span> <span class="PreProc">return</span> <span class="Constant">4</span> <span class="muComment"># for "-Inf"</span>
|
||||
<span id="L515" class="LineNr">515 </span> <span class="Delimiter">}</span>
|
||||
<span id="L516" class="LineNr">516 </span> <span class="PreProc">var</span> exponent/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy bits
|
||||
<span id="L516" class="LineNr">516 </span> <span class="PreProc">var</span> exponent/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy bits
|
||||
<span id="L517" class="LineNr">517 </span> exponent <span class="Special"><-</span> shift-right <span class="Constant">0x17</span> <span class="muComment"># 23 bits of mantissa</span>
|
||||
<span id="L518" class="LineNr">518 </span> exponent <span class="Special"><-</span> and <span class="Constant">0xff</span>
|
||||
<span id="L519" class="LineNr">519 </span> exponent <span class="Special"><-</span> subtract <span class="Constant">0x7f</span>
|
||||
|
@ -583,17 +589,17 @@ if ('onhashchange' in window) {
|
|||
<span id="L524" class="LineNr">524 </span> <span class="Delimiter">}</span>
|
||||
<span id="L525" class="LineNr">525 </span> <span class="muComment"># - regular numbers</span>
|
||||
<span id="L526" class="LineNr">526 </span> <span class="muComment"># v = 1.mantissa (in base 2) << 0x17</span>
|
||||
<span id="L527" class="LineNr">527 </span> <span class="PreProc">var</span> v/<span class="Constant">ebx</span>: int <span class="Special"><-</span> copy bits
|
||||
<span id="L527" class="LineNr">527 </span> <span class="PreProc">var</span> v/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> copy bits
|
||||
<span id="L528" class="LineNr">528 </span> v <span class="Special"><-</span> and <span class="Constant">0x7fffff</span>
|
||||
<span id="L529" class="LineNr">529 </span> v <span class="Special"><-</span> or <span class="Constant">0x00800000</span> <span class="muComment"># insert implicit 1</span>
|
||||
<span id="L530" class="LineNr">530 </span> <span class="muComment"># e = exponent - 0x17</span>
|
||||
<span id="L531" class="LineNr">531 </span> <span class="PreProc">var</span> e/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy exponent
|
||||
<span id="L531" class="LineNr">531 </span> <span class="PreProc">var</span> e/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy exponent
|
||||
<span id="L532" class="LineNr">532 </span> e <span class="Special"><-</span> subtract <span class="Constant">0x17</span> <span class="muComment"># move decimal place from before mantissa to after</span>
|
||||
<span id="L533" class="LineNr">533 </span>
|
||||
<span id="L534" class="LineNr">534 </span> <span class="muComment"># initialize buffer with decimal representation of v</span>
|
||||
<span id="L535" class="LineNr">535 </span> <span class="PreProc">var</span> buf-storage: (array byte <span class="Constant">0x7f</span>)
|
||||
<span id="L536" class="LineNr">536 </span> <span class="PreProc">var</span> buf/<span class="Constant">edi</span>: (addr array byte) <span class="Special"><-</span> address buf-storage
|
||||
<span id="L537" class="LineNr">537 </span> <span class="PreProc">var</span> n/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='412render-float-decimal.mu.html#L251'>decimal-digits</a> v, buf
|
||||
<span id="L536" class="LineNr">536 </span> <span class="PreProc">var</span> buf/<span class="muRegEdi">edi</span>: (addr array byte) <span class="Special"><-</span> address buf-storage
|
||||
<span id="L537" class="LineNr">537 </span> <span class="PreProc">var</span> n/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='412render-float-decimal.mu.html#L251'>decimal-digits</a> v, buf
|
||||
<span id="L538" class="LineNr">538 </span> <a href='412render-float-decimal.mu.html#L268'>reverse-digits</a> buf, n
|
||||
<span id="L539" class="LineNr">539 </span>
|
||||
<span id="L540" class="LineNr">540 </span> <span class="muComment"># loop if e > 0</span>
|
||||
|
@ -605,7 +611,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L546" class="LineNr">546 </span> <span class="PreProc">loop</span>
|
||||
<span id="L547" class="LineNr">547 </span> <span class="Delimiter">}</span>
|
||||
<span id="L548" class="LineNr">548 </span>
|
||||
<span id="L549" class="LineNr">549 </span> <span class="PreProc">var</span> dp/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy n
|
||||
<span id="L549" class="LineNr">549 </span> <span class="PreProc">var</span> dp/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy n
|
||||
<span id="L550" class="LineNr">550 </span>
|
||||
<span id="L551" class="LineNr">551 </span> <span class="muComment"># loop if e < 0</span>
|
||||
<span id="L552" class="LineNr">552 </span> <span class="Delimiter">{</span>
|
||||
|
@ -622,14 +628,14 @@ if ('onhashchange' in window) {
|
|||
<span id="L563" class="LineNr">563 </span> <span class="PreProc">return</span> <span class="Constant">8</span> <span class="muComment"># hacky for scientific notation</span>
|
||||
<span id="L564" class="LineNr">564 </span> <span class="Delimiter">}</span>
|
||||
<span id="L565" class="LineNr">565 </span> <span class="Delimiter">{</span>
|
||||
<span id="L566" class="LineNr">566 </span> <span class="PreProc">var</span> dp2/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy dp
|
||||
<span id="L566" class="LineNr">566 </span> <span class="PreProc">var</span> dp2/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy dp
|
||||
<span id="L567" class="LineNr">567 </span> compare dp2, precision
|
||||
<span id="L568" class="LineNr">568 </span> <span class="PreProc">break-if-<=</span>
|
||||
<span id="L569" class="LineNr">569 </span> <span class="PreProc">return</span> <span class="Constant">8</span> <span class="muComment"># hacky for scientific notation</span>
|
||||
<span id="L570" class="LineNr">570 </span> <span class="Delimiter">}</span>
|
||||
<span id="L571" class="LineNr">571 </span>
|
||||
<span id="L572" class="LineNr">572 </span> <span class="muComment"># result = min(n, dp+3)</span>
|
||||
<span id="L573" class="LineNr">573 </span> <span class="PreProc">var</span> result/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy dp
|
||||
<span id="L573" class="LineNr">573 </span> <span class="PreProc">var</span> result/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy dp
|
||||
<span id="L574" class="LineNr">574 </span> result <span class="Special"><-</span> add <span class="Constant">3</span>
|
||||
<span id="L575" class="LineNr">575 </span> <span class="Delimiter">{</span>
|
||||
<span id="L576" class="LineNr">576 </span> compare result, n
|
||||
|
@ -645,7 +651,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L586" class="LineNr">586 </span> <span class="Delimiter">}</span>
|
||||
<span id="L587" class="LineNr">587 </span>
|
||||
<span id="L588" class="LineNr">588 </span> <span class="muComment"># account for sign</span>
|
||||
<span id="L589" class="LineNr">589 </span> <span class="PreProc">var</span> sign/<span class="Constant">edx</span>: int <span class="Special"><-</span> reinterpret in
|
||||
<span id="L589" class="LineNr">589 </span> <span class="PreProc">var</span> sign/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> reinterpret in
|
||||
<span id="L590" class="LineNr">590 </span> sign <span class="Special"><-</span> shift-right <span class="Constant">0x1f</span>
|
||||
<span id="L591" class="LineNr">591 </span> <span class="Delimiter">{</span>
|
||||
<span id="L592" class="LineNr">592 </span> compare sign, <span class="Constant">1</span>
|
||||
|
|
1137
html/500fake-screen.mu.html
generated
1137
html/500fake-screen.mu.html
generated
File diff suppressed because it is too large
Load Diff
334
html/501draw-text.mu.html
generated
334
html/501draw-text.mu.html
generated
|
@ -15,9 +15,15 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.PreProc { color: #c000c0; }
|
||||
.muRegEcx { color: #af875f; }
|
||||
.Special { color: #ff6060; }
|
||||
.LineNr { }
|
||||
.muRegEdi { color: #87ffd7; }
|
||||
.muRegEbx { color: #8787af; }
|
||||
.muRegEdx { color: #878700; }
|
||||
.Constant { color: #008787; }
|
||||
.muRegEsi { color: #87d787; }
|
||||
.muRegEax { color: #875f00; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muComment { color: #005faf; }
|
||||
|
@ -59,76 +65,76 @@ if ('onhashchange' in window) {
|
|||
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># some primitives for moving the cursor without making assumptions about</span>
|
||||
<span id="L2" class="LineNr"> 2 </span><span class="muComment"># raster order</span>
|
||||
<span id="L3" class="LineNr"> 3 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L3'>move-cursor-left</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>) <span class="Delimiter">{</span>
|
||||
<span id="L4" class="LineNr"> 4 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L5" class="LineNr"> 5 </span> <span class="PreProc">var</span> cursor-y/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L6" class="LineNr"> 6 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L154'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L4" class="LineNr"> 4 </span> <span class="PreProc">var</span> cursor-x/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L5" class="LineNr"> 5 </span> <span class="PreProc">var</span> cursor-y/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L6" class="LineNr"> 6 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L174'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L7" class="LineNr"> 7 </span> compare cursor-x, <span class="Constant">0</span>
|
||||
<span id="L8" class="LineNr"> 8 </span> <span class="Delimiter">{</span>
|
||||
<span id="L9" class="LineNr"> 9 </span> <span class="PreProc">break-if-></span>
|
||||
<span id="L10" class="LineNr"> 10 </span> <span class="PreProc">return</span>
|
||||
<span id="L11" class="LineNr"> 11 </span> <span class="Delimiter">}</span>
|
||||
<span id="L12" class="LineNr"> 12 </span> cursor-x <span class="Special"><-</span> decrement
|
||||
<span id="L13" class="LineNr"> 13 </span> <a href='500fake-screen.mu.html#L170'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, cursor-x, cursor-y
|
||||
<span id="L13" class="LineNr"> 13 </span> <a href='500fake-screen.mu.html#L190'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, cursor-x, cursor-y
|
||||
<span id="L14" class="LineNr"> 14 </span><span class="Delimiter">}</span>
|
||||
<span id="L15" class="LineNr"> 15 </span>
|
||||
<span id="L16" class="LineNr"> 16 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L16'>move-cursor-right</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>) <span class="Delimiter">{</span>
|
||||
<span id="L17" class="LineNr"> 17 </span> <span class="PreProc">var</span> _width/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L18" class="LineNr"> 18 </span> <span class="PreProc">var</span> dummy/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L19" class="LineNr"> 19 </span> _width, dummy <span class="Special"><-</span> <a href='500fake-screen.mu.html#L70'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L20" class="LineNr"> 20 </span> <span class="PreProc">var</span> limit/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy _width
|
||||
<span id="L17" class="LineNr"> 17 </span> <span class="PreProc">var</span> _width/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L18" class="LineNr"> 18 </span> <span class="PreProc">var</span> dummy/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L19" class="LineNr"> 19 </span> _width, dummy <span class="Special"><-</span> <a href='500fake-screen.mu.html#L86'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L20" class="LineNr"> 20 </span> <span class="PreProc">var</span> limit/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy _width
|
||||
<span id="L21" class="LineNr"> 21 </span> limit <span class="Special"><-</span> decrement
|
||||
<span id="L22" class="LineNr"> 22 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L23" class="LineNr"> 23 </span> <span class="PreProc">var</span> cursor-y/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L24" class="LineNr"> 24 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L154'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L22" class="LineNr"> 22 </span> <span class="PreProc">var</span> cursor-x/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L23" class="LineNr"> 23 </span> <span class="PreProc">var</span> cursor-y/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L24" class="LineNr"> 24 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L174'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L25" class="LineNr"> 25 </span> compare cursor-x, limit
|
||||
<span id="L26" class="LineNr"> 26 </span> <span class="Delimiter">{</span>
|
||||
<span id="L27" class="LineNr"> 27 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L28" class="LineNr"> 28 </span> <span class="PreProc">return</span>
|
||||
<span id="L29" class="LineNr"> 29 </span> <span class="Delimiter">}</span>
|
||||
<span id="L30" class="LineNr"> 30 </span> cursor-x <span class="Special"><-</span> increment
|
||||
<span id="L31" class="LineNr"> 31 </span> <a href='500fake-screen.mu.html#L170'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, cursor-x, cursor-y
|
||||
<span id="L31" class="LineNr"> 31 </span> <a href='500fake-screen.mu.html#L190'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, cursor-x, cursor-y
|
||||
<span id="L32" class="LineNr"> 32 </span><span class="Delimiter">}</span>
|
||||
<span id="L33" class="LineNr"> 33 </span>
|
||||
<span id="L34" class="LineNr"> 34 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L34'>move-cursor-up</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>) <span class="Delimiter">{</span>
|
||||
<span id="L35" class="LineNr"> 35 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L36" class="LineNr"> 36 </span> <span class="PreProc">var</span> cursor-y/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L37" class="LineNr"> 37 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L154'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L35" class="LineNr"> 35 </span> <span class="PreProc">var</span> cursor-x/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L36" class="LineNr"> 36 </span> <span class="PreProc">var</span> cursor-y/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L37" class="LineNr"> 37 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L174'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L38" class="LineNr"> 38 </span> compare cursor-y, <span class="Constant">0</span>
|
||||
<span id="L39" class="LineNr"> 39 </span> <span class="Delimiter">{</span>
|
||||
<span id="L40" class="LineNr"> 40 </span> <span class="PreProc">break-if-></span>
|
||||
<span id="L41" class="LineNr"> 41 </span> <span class="PreProc">return</span>
|
||||
<span id="L42" class="LineNr"> 42 </span> <span class="Delimiter">}</span>
|
||||
<span id="L43" class="LineNr"> 43 </span> cursor-y <span class="Special"><-</span> decrement
|
||||
<span id="L44" class="LineNr"> 44 </span> <a href='500fake-screen.mu.html#L170'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, cursor-x, cursor-y
|
||||
<span id="L44" class="LineNr"> 44 </span> <a href='500fake-screen.mu.html#L190'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, cursor-x, cursor-y
|
||||
<span id="L45" class="LineNr"> 45 </span><span class="Delimiter">}</span>
|
||||
<span id="L46" class="LineNr"> 46 </span>
|
||||
<span id="L47" class="LineNr"> 47 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L47'>move-cursor-down</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>) <span class="Delimiter">{</span>
|
||||
<span id="L48" class="LineNr"> 48 </span> <span class="PreProc">var</span> dummy/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L49" class="LineNr"> 49 </span> <span class="PreProc">var</span> _height/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L50" class="LineNr"> 50 </span> dummy, _height <span class="Special"><-</span> <a href='500fake-screen.mu.html#L70'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L51" class="LineNr"> 51 </span> <span class="PreProc">var</span> limit/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy _height
|
||||
<span id="L48" class="LineNr"> 48 </span> <span class="PreProc">var</span> dummy/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L49" class="LineNr"> 49 </span> <span class="PreProc">var</span> _height/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L50" class="LineNr"> 50 </span> dummy, _height <span class="Special"><-</span> <a href='500fake-screen.mu.html#L86'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L51" class="LineNr"> 51 </span> <span class="PreProc">var</span> limit/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy _height
|
||||
<span id="L52" class="LineNr"> 52 </span> limit <span class="Special"><-</span> decrement
|
||||
<span id="L53" class="LineNr"> 53 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L54" class="LineNr"> 54 </span> <span class="PreProc">var</span> cursor-y/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L55" class="LineNr"> 55 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L154'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L53" class="LineNr"> 53 </span> <span class="PreProc">var</span> cursor-x/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L54" class="LineNr"> 54 </span> <span class="PreProc">var</span> cursor-y/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L55" class="LineNr"> 55 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L174'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L56" class="LineNr"> 56 </span> compare cursor-y, limit
|
||||
<span id="L57" class="LineNr"> 57 </span> <span class="Delimiter">{</span>
|
||||
<span id="L58" class="LineNr"> 58 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L59" class="LineNr"> 59 </span> <span class="PreProc">return</span>
|
||||
<span id="L60" class="LineNr"> 60 </span> <span class="Delimiter">}</span>
|
||||
<span id="L61" class="LineNr"> 61 </span> cursor-y <span class="Special"><-</span> increment
|
||||
<span id="L62" class="LineNr"> 62 </span> <a href='500fake-screen.mu.html#L170'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, cursor-x, cursor-y
|
||||
<span id="L62" class="LineNr"> 62 </span> <a href='500fake-screen.mu.html#L190'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, cursor-x, cursor-y
|
||||
<span id="L63" class="LineNr"> 63 </span><span class="Delimiter">}</span>
|
||||
<span id="L64" class="LineNr"> 64 </span>
|
||||
<span id="L65" class="LineNr"> 65 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L65'>move-cursor-to-left-margin-of-next-line</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>) <span class="Delimiter">{</span>
|
||||
<span id="L66" class="LineNr"> 66 </span> <span class="PreProc">var</span> dummy/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L67" class="LineNr"> 67 </span> <span class="PreProc">var</span> _height/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L68" class="LineNr"> 68 </span> dummy, _height <span class="Special"><-</span> <a href='500fake-screen.mu.html#L70'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L69" class="LineNr"> 69 </span> <span class="PreProc">var</span> limit/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy _height
|
||||
<span id="L66" class="LineNr"> 66 </span> <span class="PreProc">var</span> dummy/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L67" class="LineNr"> 67 </span> <span class="PreProc">var</span> _height/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L68" class="LineNr"> 68 </span> dummy, _height <span class="Special"><-</span> <a href='500fake-screen.mu.html#L86'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L69" class="LineNr"> 69 </span> <span class="PreProc">var</span> limit/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy _height
|
||||
<span id="L70" class="LineNr"> 70 </span> limit <span class="Special"><-</span> decrement
|
||||
<span id="L71" class="LineNr"> 71 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L72" class="LineNr"> 72 </span> <span class="PreProc">var</span> cursor-y/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L73" class="LineNr"> 73 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L154'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L71" class="LineNr"> 71 </span> <span class="PreProc">var</span> cursor-x/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L72" class="LineNr"> 72 </span> <span class="PreProc">var</span> cursor-y/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L73" class="LineNr"> 73 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L174'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L74" class="LineNr"> 74 </span> compare cursor-y, limit
|
||||
<span id="L75" class="LineNr"> 75 </span> <span class="Delimiter">{</span>
|
||||
<span id="L76" class="LineNr"> 76 </span> <span class="PreProc">break-if-<</span>
|
||||
|
@ -136,85 +142,85 @@ if ('onhashchange' in window) {
|
|||
<span id="L78" class="LineNr"> 78 </span> <span class="Delimiter">}</span>
|
||||
<span id="L79" class="LineNr"> 79 </span> cursor-y <span class="Special"><-</span> increment
|
||||
<span id="L80" class="LineNr"> 80 </span> cursor-x <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L81" class="LineNr"> 81 </span> <a href='500fake-screen.mu.html#L170'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, cursor-x, cursor-y
|
||||
<span id="L81" class="LineNr"> 81 </span> <a href='500fake-screen.mu.html#L190'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, cursor-x, cursor-y
|
||||
<span id="L82" class="LineNr"> 82 </span><span class="Delimiter">}</span>
|
||||
<span id="L83" class="LineNr"> 83 </span>
|
||||
<span id="L84" class="LineNr"> 84 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L84'>draw-grapheme-at-cursor</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), g: grapheme, color: int, background-color: int <span class="Delimiter">{</span>
|
||||
<span id="L85" class="LineNr"> 85 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L86" class="LineNr"> 86 </span> <span class="PreProc">var</span> cursor-y/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L87" class="LineNr"> 87 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L154'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L88" class="LineNr"> 88 </span> <a href='500fake-screen.mu.html#L88'>draw-grapheme</a> <a href='500fake-screen.mu.html#L14'>screen</a>, g, cursor-x, cursor-y, color, background-color
|
||||
<span id="L85" class="LineNr"> 85 </span> <span class="PreProc">var</span> cursor-x/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L86" class="LineNr"> 86 </span> <span class="PreProc">var</span> cursor-y/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L87" class="LineNr"> 87 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L174'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L88" class="LineNr"> 88 </span> <a href='500fake-screen.mu.html#L104'>draw-grapheme</a> <a href='500fake-screen.mu.html#L14'>screen</a>, g, cursor-x, cursor-y, color, background-color
|
||||
<span id="L89" class="LineNr"> 89 </span><span class="Delimiter">}</span>
|
||||
<span id="L90" class="LineNr"> 90 </span>
|
||||
<span id="L91" class="LineNr"> 91 </span><span class="muComment"># we can't really render non-ASCII yet, but when we do we'll be ready</span>
|
||||
<span id="L92" class="LineNr"> 92 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L92'>draw-code-point-at-cursor</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), c: code-point, color: int, background-color: int <span class="Delimiter">{</span>
|
||||
<span id="L93" class="LineNr"> 93 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: grapheme <span class="Special"><-</span> copy c
|
||||
<span id="L93" class="LineNr"> 93 </span> <span class="PreProc">var</span> g/<span class="muRegEax">eax</span>: grapheme <span class="Special"><-</span> copy c
|
||||
<span id="L94" class="LineNr"> 94 </span> <a href='501draw-text.mu.html#L84'>draw-grapheme-at-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, g, color, background-color
|
||||
<span id="L95" class="LineNr"> 95 </span><span class="Delimiter">}</span>
|
||||
<span id="L96" class="LineNr"> 96 </span>
|
||||
<span id="L97" class="LineNr"> 97 </span><span class="muComment"># draw a single line of text from x, y to xmax</span>
|
||||
<span id="L98" class="LineNr"> 98 </span><span class="muComment"># return the next 'x' coordinate</span>
|
||||
<span id="L99" class="LineNr"> 99 </span><span class="muComment"># if there isn't enough space, truncate</span>
|
||||
<span id="L100" class="LineNr">100 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L100'>draw-text-rightward</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), x: int, xmax: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L100" class="LineNr">100 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L100'>draw-text-rightward</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), x: int, xmax: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L101" class="LineNr">101 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x200</span>/print-buffer-size)
|
||||
<span id="L102" class="LineNr">102 </span> <span class="PreProc">var</span> stream/<span class="Constant">esi</span>: (addr stream byte) <span class="Special"><-</span> address stream-storage
|
||||
<span id="L102" class="LineNr">102 </span> <span class="PreProc">var</span> stream/<span class="muRegEsi">esi</span>: (addr stream byte) <span class="Special"><-</span> address stream-storage
|
||||
<span id="L103" class="LineNr">103 </span> <a href='108write.subx.html#L11'>write</a> stream, text
|
||||
<span id="L104" class="LineNr">104 </span> <span class="PreProc">var</span> xcurr/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='501draw-text.mu.html#L111'>draw-stream-rightward</a> <a href='500fake-screen.mu.html#L14'>screen</a>, stream, x, xmax, y, color, background-color
|
||||
<span id="L104" class="LineNr">104 </span> <span class="PreProc">var</span> xcurr/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='501draw-text.mu.html#L111'>draw-stream-rightward</a> <a href='500fake-screen.mu.html#L14'>screen</a>, stream, x, xmax, y, color, background-color
|
||||
<span id="L105" class="LineNr">105 </span> <span class="PreProc">return</span> xcurr
|
||||
<span id="L106" class="LineNr">106 </span><span class="Delimiter">}</span>
|
||||
<span id="L107" class="LineNr">107 </span>
|
||||
<span id="L108" class="LineNr">108 </span><span class="muComment"># draw a single-line stream from x, y to xmax</span>
|
||||
<span id="L109" class="LineNr">109 </span><span class="muComment"># return the next 'x' coordinate</span>
|
||||
<span id="L110" class="LineNr">110 </span><span class="muComment"># if there isn't enough space, truncate</span>
|
||||
<span id="L111" class="LineNr">111 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L111'>draw-stream-rightward</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), stream: (addr stream byte), x: int, xmax: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L112" class="LineNr">112 </span> <span class="PreProc">var</span> xcurr/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy x
|
||||
<span id="L111" class="LineNr">111 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L111'>draw-stream-rightward</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), stream: (addr stream byte), x: int, xmax: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L112" class="LineNr">112 </span> <span class="PreProc">var</span> xcurr/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy x
|
||||
<span id="L113" class="LineNr">113 </span> <span class="Delimiter">{</span>
|
||||
<span id="L114" class="LineNr">114 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> stream
|
||||
<span id="L114" class="LineNr">114 </span> <span class="PreProc">var</span> g/<span class="muRegEax">eax</span>: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> stream
|
||||
<span id="L115" class="LineNr">115 </span> compare g, <span class="Constant">0xffffffff</span>/end-of-file
|
||||
<span id="L116" class="LineNr">116 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L117" class="LineNr">117 </span> <a href='500fake-screen.mu.html#L88'>draw-grapheme</a> <a href='500fake-screen.mu.html#L14'>screen</a>, g, xcurr, y, color, background-color
|
||||
<span id="L117" class="LineNr">117 </span> <a href='500fake-screen.mu.html#L104'>draw-grapheme</a> <a href='500fake-screen.mu.html#L14'>screen</a>, g, xcurr, y, color, background-color
|
||||
<span id="L118" class="LineNr">118 </span> xcurr <span class="Special"><-</span> increment
|
||||
<span id="L119" class="LineNr">119 </span> <span class="PreProc">loop</span>
|
||||
<span id="L120" class="LineNr">120 </span> <span class="Delimiter">}</span>
|
||||
<span id="L121" class="LineNr">121 </span> <a href='500fake-screen.mu.html#L170'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, xcurr, y
|
||||
<span id="L121" class="LineNr">121 </span> <a href='500fake-screen.mu.html#L190'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, xcurr, y
|
||||
<span id="L122" class="LineNr">122 </span> <span class="PreProc">return</span> xcurr
|
||||
<span id="L123" class="LineNr">123 </span><span class="Delimiter">}</span>
|
||||
<span id="L124" class="LineNr">124 </span>
|
||||
<span id="L125" class="LineNr">125 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L125'>draw-text-rightward-over-full-screen</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), x: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L126" class="LineNr">126 </span> <span class="PreProc">var</span> width/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L127" class="LineNr">127 </span> <span class="PreProc">var</span> height/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L128" class="LineNr">128 </span> width, height <span class="Special"><-</span> <a href='500fake-screen.mu.html#L70'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L129" class="LineNr">129 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='501draw-text.mu.html#L100'>draw-text-rightward</a> <a href='500fake-screen.mu.html#L14'>screen</a>, text, x, width, y, color, background-color
|
||||
<span id="L125" class="LineNr">125 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L125'>draw-text-rightward-over-full-screen</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), x: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L126" class="LineNr">126 </span> <span class="PreProc">var</span> width/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L127" class="LineNr">127 </span> <span class="PreProc">var</span> height/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L128" class="LineNr">128 </span> width, height <span class="Special"><-</span> <a href='500fake-screen.mu.html#L86'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L129" class="LineNr">129 </span> <span class="PreProc">var</span> result/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='501draw-text.mu.html#L100'>draw-text-rightward</a> <a href='500fake-screen.mu.html#L14'>screen</a>, text, x, width, y, color, background-color
|
||||
<span id="L130" class="LineNr">130 </span> <span class="PreProc">return</span> result
|
||||
<span id="L131" class="LineNr">131 </span><span class="Delimiter">}</span>
|
||||
<span id="L132" class="LineNr">132 </span>
|
||||
<span id="L133" class="LineNr">133 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L133'>draw-text-rightward-from-cursor</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), xmax: int, color: int, background-color: int <span class="Delimiter">{</span>
|
||||
<span id="L134" class="LineNr">134 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L135" class="LineNr">135 </span> <span class="PreProc">var</span> cursor-y/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L136" class="LineNr">136 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L154'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L134" class="LineNr">134 </span> <span class="PreProc">var</span> cursor-x/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L135" class="LineNr">135 </span> <span class="PreProc">var</span> cursor-y/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L136" class="LineNr">136 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L174'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L137" class="LineNr">137 </span> cursor-x <span class="Special"><-</span> <a href='501draw-text.mu.html#L100'>draw-text-rightward</a> <a href='500fake-screen.mu.html#L14'>screen</a>, text, cursor-x, xmax, cursor-y, color, background-color
|
||||
<span id="L138" class="LineNr">138 </span> <a href='500fake-screen.mu.html#L170'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, cursor-x, cursor-y
|
||||
<span id="L138" class="LineNr">138 </span> <a href='500fake-screen.mu.html#L190'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, cursor-x, cursor-y
|
||||
<span id="L139" class="LineNr">139 </span><span class="Delimiter">}</span>
|
||||
<span id="L140" class="LineNr">140 </span>
|
||||
<span id="L141" class="LineNr">141 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L141'>draw-text-rightward-from-cursor-over-full-screen</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), color: int, background-color: int <span class="Delimiter">{</span>
|
||||
<span id="L142" class="LineNr">142 </span> <span class="PreProc">var</span> width/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L143" class="LineNr">143 </span> <span class="PreProc">var</span> height/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L144" class="LineNr">144 </span> width, height <span class="Special"><-</span> <a href='500fake-screen.mu.html#L70'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L142" class="LineNr">142 </span> <span class="PreProc">var</span> width/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L143" class="LineNr">143 </span> <span class="PreProc">var</span> height/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L144" class="LineNr">144 </span> width, height <span class="Special"><-</span> <a href='500fake-screen.mu.html#L86'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L145" class="LineNr">145 </span> <a href='501draw-text.mu.html#L133'>draw-text-rightward-from-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, text, width, color, background-color
|
||||
<span id="L146" class="LineNr">146 </span><span class="Delimiter">}</span>
|
||||
<span id="L147" class="LineNr">147 </span>
|
||||
<span id="L148" class="LineNr">148 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L148'>render-grapheme</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), g: grapheme, xmin: int, ymin: int, xmax: int, ymax: int, x: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L148" class="LineNr">148 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L148'>render-grapheme</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), g: grapheme, xmin: int, ymin: int, xmax: int, ymax: int, x: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int, _/<span class="muRegEcx">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L149" class="LineNr">149 </span> compare g, <span class="Constant">0xa</span>/newline
|
||||
<span id="L150" class="LineNr">150 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy x
|
||||
<span id="L150" class="LineNr">150 </span> <span class="PreProc">var</span> x/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy x
|
||||
<span id="L151" class="LineNr">151 </span> <span class="Delimiter">{</span>
|
||||
<span id="L152" class="LineNr">152 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L153" class="LineNr">153 </span> <span class="muComment"># minimum effort to clear cursor</span>
|
||||
<span id="L154" class="LineNr">154 </span> <a href='500fake-screen.mu.html#L114'>draw-code-point</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x20</span>/space, x, y, color, background-color
|
||||
<span id="L154" class="LineNr">154 </span> <a href='500fake-screen.mu.html#L130'>draw-code-point</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x20</span>/space, x, y, color, background-color
|
||||
<span id="L155" class="LineNr">155 </span> x <span class="Special"><-</span> copy xmin
|
||||
<span id="L156" class="LineNr">156 </span> increment y
|
||||
<span id="L157" class="LineNr">157 </span> <span class="PreProc">return</span> x, y
|
||||
<span id="L158" class="LineNr">158 </span> <span class="Delimiter">}</span>
|
||||
<span id="L159" class="LineNr">159 </span> <a href='500fake-screen.mu.html#L88'>draw-grapheme</a> <a href='500fake-screen.mu.html#L14'>screen</a>, g, x, y, color, background-color
|
||||
<span id="L159" class="LineNr">159 </span> <a href='500fake-screen.mu.html#L104'>draw-grapheme</a> <a href='500fake-screen.mu.html#L14'>screen</a>, g, x, y, color, background-color
|
||||
<span id="L160" class="LineNr">160 </span> x <span class="Special"><-</span> increment
|
||||
<span id="L161" class="LineNr">161 </span> compare x, xmax
|
||||
<span id="L162" class="LineNr">162 </span> <span class="Delimiter">{</span>
|
||||
|
@ -229,14 +235,14 @@ if ('onhashchange' in window) {
|
|||
<span id="L171" class="LineNr">171 </span><span class="muComment"># return the next (x, y) coordinate in raster order where drawing stopped</span>
|
||||
<span id="L172" class="LineNr">172 </span><span class="muComment"># that way the caller can draw more if given the same min and max bounding-box.</span>
|
||||
<span id="L173" class="LineNr">173 </span><span class="muComment"># if there isn't enough space, truncate</span>
|
||||
<span id="L174" class="LineNr">174 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L174'>draw-text-wrapping-right-then-down</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), _text: (addr array byte), xmin: int, ymin: int, xmax: int, ymax: int, _x: int, _y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L174" class="LineNr">174 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L174'>draw-text-wrapping-right-then-down</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), _text: (addr array byte), xmin: int, ymin: int, xmax: int, ymax: int, _x: int, _y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int, _/<span class="muRegEcx">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L175" class="LineNr">175 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x200</span>/print-buffer-size) <span class="muComment"># 4 rows of text = 1/12th of a real screen</span>
|
||||
<span id="L176" class="LineNr">176 </span> <span class="muComment"># fake screens unlikely to be larger</span>
|
||||
<span id="L177" class="LineNr">177 </span> <span class="muComment"># so this seems a reasonable size</span>
|
||||
<span id="L178" class="LineNr">178 </span> <span class="muComment"># allocated on the stack, so quickly reclaimed</span>
|
||||
<span id="L179" class="LineNr">179 </span> <span class="PreProc">var</span> stream/<span class="Constant">edi</span>: (addr stream byte) <span class="Special"><-</span> address stream-storage
|
||||
<span id="L180" class="LineNr">180 </span> <span class="PreProc">var</span> text/<span class="Constant">esi</span>: (addr array byte) <span class="Special"><-</span> copy _text
|
||||
<span id="L181" class="LineNr">181 </span> <span class="PreProc">var</span> len/<span class="Constant">eax</span>: int <span class="Special"><-</span> length text
|
||||
<span id="L179" class="LineNr">179 </span> <span class="PreProc">var</span> stream/<span class="muRegEdi">edi</span>: (addr stream byte) <span class="Special"><-</span> address stream-storage
|
||||
<span id="L180" class="LineNr">180 </span> <span class="PreProc">var</span> text/<span class="muRegEsi">esi</span>: (addr array byte) <span class="Special"><-</span> copy _text
|
||||
<span id="L181" class="LineNr">181 </span> <span class="PreProc">var</span> len/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> length text
|
||||
<span id="L182" class="LineNr">182 </span> compare len, <span class="Constant">0x200</span>
|
||||
<span id="L183" class="LineNr">183 </span> <span class="Delimiter">{</span>
|
||||
<span id="L184" class="LineNr">184 </span> <span class="PreProc">break-if-<</span>
|
||||
|
@ -247,8 +253,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L189" class="LineNr">189 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L190" class="LineNr">190 </span> <a href='108write.subx.html#L11'>write</a> stream, text
|
||||
<span id="L191" class="LineNr">191 </span> <span class="Delimiter">}</span>
|
||||
<span id="L192" class="LineNr">192 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy _x
|
||||
<span id="L193" class="LineNr">193 </span> <span class="PreProc">var</span> y/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy _y
|
||||
<span id="L192" class="LineNr">192 </span> <span class="PreProc">var</span> x/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy _x
|
||||
<span id="L193" class="LineNr">193 </span> <span class="PreProc">var</span> y/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy _y
|
||||
<span id="L194" class="LineNr">194 </span> x, y <span class="Special"><-</span> <a href='501draw-text.mu.html#L202'>draw-stream-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L14'>screen</a>, stream, xmin, ymin, xmax, ymax, x, y, color, background-color
|
||||
<span id="L195" class="LineNr">195 </span> <span class="PreProc">return</span> x, y
|
||||
<span id="L196" class="LineNr">196 </span><span class="Delimiter">}</span>
|
||||
|
@ -257,13 +263,13 @@ if ('onhashchange' in window) {
|
|||
<span id="L199" class="LineNr">199 </span><span class="muComment"># return the next (x, y) coordinate in raster order where drawing stopped</span>
|
||||
<span id="L200" class="LineNr">200 </span><span class="muComment"># that way the caller can draw more if given the same min and max bounding-box.</span>
|
||||
<span id="L201" class="LineNr">201 </span><span class="muComment"># if there isn't enough space, truncate</span>
|
||||
<span id="L202" class="LineNr">202 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L202'>draw-stream-wrapping-right-then-down</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), stream: (addr stream byte), xmin: int, ymin: int, xmax: int, ymax: int, x: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L203" class="LineNr">203 </span> <span class="PreProc">var</span> xcurr/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy x
|
||||
<span id="L204" class="LineNr">204 </span> <span class="PreProc">var</span> ycurr/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy y
|
||||
<span id="L205" class="LineNr">205 </span> <span class="PreProc">var</span> g/<span class="Constant">ebx</span>: grapheme <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L202" class="LineNr">202 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L202'>draw-stream-wrapping-right-then-down</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), stream: (addr stream byte), xmin: int, ymin: int, xmax: int, ymax: int, x: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int, _/<span class="muRegEcx">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L203" class="LineNr">203 </span> <span class="PreProc">var</span> xcurr/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy x
|
||||
<span id="L204" class="LineNr">204 </span> <span class="PreProc">var</span> ycurr/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy y
|
||||
<span id="L205" class="LineNr">205 </span> <span class="PreProc">var</span> g/<span class="muRegEbx">ebx</span>: grapheme <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L206" class="LineNr">206 </span> <span class="Delimiter">{</span>
|
||||
<span id="L207" class="LineNr">207 </span> <span class="Delimiter">{</span>
|
||||
<span id="L208" class="LineNr">208 </span> <span class="PreProc">var</span> _g/<span class="Constant">eax</span>: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> stream
|
||||
<span id="L208" class="LineNr">208 </span> <span class="PreProc">var</span> _g/<span class="muRegEax">eax</span>: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> stream
|
||||
<span id="L209" class="LineNr">209 </span> g <span class="Special"><-</span> copy _g
|
||||
<span id="L210" class="LineNr">210 </span> <span class="Delimiter">}</span>
|
||||
<span id="L211" class="LineNr">211 </span> compare g, <span class="Constant">0xffffffff</span>/end-of-file
|
||||
|
@ -271,15 +277,15 @@ if ('onhashchange' in window) {
|
|||
<span id="L213" class="LineNr">213 </span> xcurr, ycurr <span class="Special"><-</span> <a href='501draw-text.mu.html#L148'>render-grapheme</a> <a href='500fake-screen.mu.html#L14'>screen</a>, g, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color
|
||||
<span id="L214" class="LineNr">214 </span> <span class="PreProc">loop</span>
|
||||
<span id="L215" class="LineNr">215 </span> <span class="Delimiter">}</span>
|
||||
<span id="L216" class="LineNr">216 </span> <a href='500fake-screen.mu.html#L170'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, xcurr, ycurr
|
||||
<span id="L216" class="LineNr">216 </span> <a href='500fake-screen.mu.html#L190'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, xcurr, ycurr
|
||||
<span id="L217" class="LineNr">217 </span> <span class="PreProc">return</span> xcurr, ycurr
|
||||
<span id="L218" class="LineNr">218 </span><span class="Delimiter">}</span>
|
||||
<span id="L219" class="LineNr">219 </span>
|
||||
<span id="L220" class="LineNr">220 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L220'>draw-stream-wrapping-right-then-down-from-cursor</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), stream: (addr stream byte), xmin: int, ymin: int, xmax: int, ymax: int, color: int, background-color: int <span class="Delimiter">{</span>
|
||||
<span id="L221" class="LineNr">221 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L222" class="LineNr">222 </span> <span class="PreProc">var</span> cursor-y/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L223" class="LineNr">223 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L154'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L224" class="LineNr">224 </span> <span class="PreProc">var</span> end-x/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy cursor-x
|
||||
<span id="L221" class="LineNr">221 </span> <span class="PreProc">var</span> cursor-x/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L222" class="LineNr">222 </span> <span class="PreProc">var</span> cursor-y/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L223" class="LineNr">223 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L174'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L224" class="LineNr">224 </span> <span class="PreProc">var</span> end-x/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy cursor-x
|
||||
<span id="L225" class="LineNr">225 </span> end-x <span class="Special"><-</span> increment
|
||||
<span id="L226" class="LineNr">226 </span> compare end-x, xmax
|
||||
<span id="L227" class="LineNr">227 </span> <span class="Delimiter">{</span>
|
||||
|
@ -291,16 +297,16 @@ if ('onhashchange' in window) {
|
|||
<span id="L233" class="LineNr">233 </span><span class="Delimiter">}</span>
|
||||
<span id="L234" class="LineNr">234 </span>
|
||||
<span id="L235" class="LineNr">235 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L235'>draw-stream-wrapping-right-then-down-from-cursor-over-full-screen</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), stream: (addr stream byte), color: int, background-color: int <span class="Delimiter">{</span>
|
||||
<span id="L236" class="LineNr">236 </span> <span class="PreProc">var</span> width/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L237" class="LineNr">237 </span> <span class="PreProc">var</span> height/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L238" class="LineNr">238 </span> width, height <span class="Special"><-</span> <a href='500fake-screen.mu.html#L70'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L236" class="LineNr">236 </span> <span class="PreProc">var</span> width/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L237" class="LineNr">237 </span> <span class="PreProc">var</span> height/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L238" class="LineNr">238 </span> width, height <span class="Special"><-</span> <a href='500fake-screen.mu.html#L86'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L239" class="LineNr">239 </span> <a href='501draw-text.mu.html#L220'>draw-stream-wrapping-right-then-down-from-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, stream, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, width, height, color, background-color
|
||||
<span id="L240" class="LineNr">240 </span><span class="Delimiter">}</span>
|
||||
<span id="L241" class="LineNr">241 </span>
|
||||
<span id="L242" class="LineNr">242 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L242'>move-cursor-rightward-and-downward</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), xmin: int, xmax: int <span class="Delimiter">{</span>
|
||||
<span id="L243" class="LineNr">243 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L244" class="LineNr">244 </span> <span class="PreProc">var</span> cursor-y/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L245" class="LineNr">245 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L154'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L243" class="LineNr">243 </span> <span class="PreProc">var</span> cursor-x/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L244" class="LineNr">244 </span> <span class="PreProc">var</span> cursor-y/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L245" class="LineNr">245 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L174'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L246" class="LineNr">246 </span> cursor-x <span class="Special"><-</span> increment
|
||||
<span id="L247" class="LineNr">247 </span> compare cursor-x, xmax
|
||||
<span id="L248" class="LineNr">248 </span> <span class="Delimiter">{</span>
|
||||
|
@ -308,22 +314,22 @@ if ('onhashchange' in window) {
|
|||
<span id="L250" class="LineNr">250 </span> cursor-x <span class="Special"><-</span> copy xmin
|
||||
<span id="L251" class="LineNr">251 </span> cursor-y <span class="Special"><-</span> increment
|
||||
<span id="L252" class="LineNr">252 </span> <span class="Delimiter">}</span>
|
||||
<span id="L253" class="LineNr">253 </span> <a href='500fake-screen.mu.html#L170'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, cursor-x, cursor-y
|
||||
<span id="L253" class="LineNr">253 </span> <a href='500fake-screen.mu.html#L190'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, cursor-x, cursor-y
|
||||
<span id="L254" class="LineNr">254 </span><span class="Delimiter">}</span>
|
||||
<span id="L255" class="LineNr">255 </span>
|
||||
<span id="L256" class="LineNr">256 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L256'>draw-text-wrapping-right-then-down-over-full-screen</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), x: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L257" class="LineNr">257 </span> <span class="PreProc">var</span> x2/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L258" class="LineNr">258 </span> <span class="PreProc">var</span> y2/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L259" class="LineNr">259 </span> x2, y2 <span class="Special"><-</span> <a href='500fake-screen.mu.html#L70'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a> <span class="muComment"># width, height</span>
|
||||
<span id="L256" class="LineNr">256 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L256'>draw-text-wrapping-right-then-down-over-full-screen</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), x: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int, _/<span class="muRegEcx">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L257" class="LineNr">257 </span> <span class="PreProc">var</span> x2/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L258" class="LineNr">258 </span> <span class="PreProc">var</span> y2/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L259" class="LineNr">259 </span> x2, y2 <span class="Special"><-</span> <a href='500fake-screen.mu.html#L86'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a> <span class="muComment"># width, height</span>
|
||||
<span id="L260" class="LineNr">260 </span> x2, y2 <span class="Special"><-</span> <a href='501draw-text.mu.html#L174'>draw-text-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L14'>screen</a>, text, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, x2, y2, x, y, color, background-color
|
||||
<span id="L261" class="LineNr">261 </span> <span class="PreProc">return</span> x2, y2 <span class="muComment"># cursor-x, cursor-y</span>
|
||||
<span id="L262" class="LineNr">262 </span><span class="Delimiter">}</span>
|
||||
<span id="L263" class="LineNr">263 </span>
|
||||
<span id="L264" class="LineNr">264 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L264'>draw-text-wrapping-right-then-down-from-cursor</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), xmin: int, ymin: int, xmax: int, ymax: int, color: int, background-color: int <span class="Delimiter">{</span>
|
||||
<span id="L265" class="LineNr">265 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L266" class="LineNr">266 </span> <span class="PreProc">var</span> cursor-y/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L267" class="LineNr">267 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L154'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L268" class="LineNr">268 </span> <span class="PreProc">var</span> end-x/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy cursor-x
|
||||
<span id="L265" class="LineNr">265 </span> <span class="PreProc">var</span> cursor-x/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L266" class="LineNr">266 </span> <span class="PreProc">var</span> cursor-y/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L267" class="LineNr">267 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L174'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L268" class="LineNr">268 </span> <span class="PreProc">var</span> end-x/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy cursor-x
|
||||
<span id="L269" class="LineNr">269 </span> end-x <span class="Special"><-</span> increment
|
||||
<span id="L270" class="LineNr">270 </span> compare end-x, xmax
|
||||
<span id="L271" class="LineNr">271 </span> <span class="Delimiter">{</span>
|
||||
|
@ -335,23 +341,23 @@ if ('onhashchange' in window) {
|
|||
<span id="L277" class="LineNr">277 </span><span class="Delimiter">}</span>
|
||||
<span id="L278" class="LineNr">278 </span>
|
||||
<span id="L279" class="LineNr">279 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), color: int, background-color: int <span class="Delimiter">{</span>
|
||||
<span id="L280" class="LineNr">280 </span> <span class="PreProc">var</span> width/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L281" class="LineNr">281 </span> <span class="PreProc">var</span> height/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L282" class="LineNr">282 </span> width, height <span class="Special"><-</span> <a href='500fake-screen.mu.html#L70'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L280" class="LineNr">280 </span> <span class="PreProc">var</span> width/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L281" class="LineNr">281 </span> <span class="PreProc">var</span> height/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L282" class="LineNr">282 </span> width, height <span class="Special"><-</span> <a href='500fake-screen.mu.html#L86'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L283" class="LineNr">283 </span> <a href='501draw-text.mu.html#L264'>draw-text-wrapping-right-then-down-from-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, text, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, width, height, color, background-color
|
||||
<span id="L284" class="LineNr">284 </span><span class="Delimiter">}</span>
|
||||
<span id="L285" class="LineNr">285 </span>
|
||||
<span id="L286" class="LineNr">286 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L286'>draw-int32-hex-wrapping-right-then-down</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), n: int, xmin: int, ymin: int, xmax: int, ymax: int, x: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L286" class="LineNr">286 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L286'>draw-int32-hex-wrapping-right-then-down</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), n: int, xmin: int, ymin: int, xmax: int, ymax: int, x: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int, _/<span class="muRegEcx">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L287" class="LineNr">287 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x100</span>)
|
||||
<span id="L288" class="LineNr">288 </span> <span class="PreProc">var</span> stream/<span class="Constant">esi</span>: (addr stream byte) <span class="Special"><-</span> address stream-storage
|
||||
<span id="L288" class="LineNr">288 </span> <span class="PreProc">var</span> stream/<span class="muRegEsi">esi</span>: (addr stream byte) <span class="Special"><-</span> address stream-storage
|
||||
<span id="L289" class="LineNr">289 </span> <a href='117write-int-hex.subx.html#L92'>write-int32-hex</a> stream, n
|
||||
<span id="L290" class="LineNr">290 </span> <span class="PreProc">var</span> xcurr/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy x
|
||||
<span id="L291" class="LineNr">291 </span> <span class="PreProc">var</span> ycurr/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy y
|
||||
<span id="L290" class="LineNr">290 </span> <span class="PreProc">var</span> xcurr/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy x
|
||||
<span id="L291" class="LineNr">291 </span> <span class="PreProc">var</span> ycurr/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy y
|
||||
<span id="L292" class="LineNr">292 </span> <span class="Delimiter">{</span>
|
||||
<span id="L293" class="LineNr">293 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> stream
|
||||
<span id="L293" class="LineNr">293 </span> <span class="PreProc">var</span> g/<span class="muRegEax">eax</span>: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> stream
|
||||
<span id="L294" class="LineNr">294 </span> compare g, <span class="Constant">0xffffffff</span>/end-of-file
|
||||
<span id="L295" class="LineNr">295 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L296" class="LineNr">296 </span> <a href='500fake-screen.mu.html#L88'>draw-grapheme</a> <a href='500fake-screen.mu.html#L14'>screen</a>, g, xcurr, ycurr, color, background-color
|
||||
<span id="L296" class="LineNr">296 </span> <a href='500fake-screen.mu.html#L104'>draw-grapheme</a> <a href='500fake-screen.mu.html#L14'>screen</a>, g, xcurr, ycurr, color, background-color
|
||||
<span id="L297" class="LineNr">297 </span> xcurr <span class="Special"><-</span> increment
|
||||
<span id="L298" class="LineNr">298 </span> compare xcurr, xmax
|
||||
<span id="L299" class="LineNr">299 </span> <span class="Delimiter">{</span>
|
||||
|
@ -361,23 +367,23 @@ if ('onhashchange' in window) {
|
|||
<span id="L303" class="LineNr">303 </span> <span class="Delimiter">}</span>
|
||||
<span id="L304" class="LineNr">304 </span> <span class="PreProc">loop</span>
|
||||
<span id="L305" class="LineNr">305 </span> <span class="Delimiter">}</span>
|
||||
<span id="L306" class="LineNr">306 </span> <a href='500fake-screen.mu.html#L170'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, xcurr, ycurr
|
||||
<span id="L306" class="LineNr">306 </span> <a href='500fake-screen.mu.html#L190'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, xcurr, ycurr
|
||||
<span id="L307" class="LineNr">307 </span> <span class="PreProc">return</span> xcurr, ycurr
|
||||
<span id="L308" class="LineNr">308 </span><span class="Delimiter">}</span>
|
||||
<span id="L309" class="LineNr">309 </span>
|
||||
<span id="L310" class="LineNr">310 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L310'>draw-int32-hex-wrapping-right-then-down-over-full-screen</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), n: int, x: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L311" class="LineNr">311 </span> <span class="PreProc">var</span> x2/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L312" class="LineNr">312 </span> <span class="PreProc">var</span> y2/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L313" class="LineNr">313 </span> x2, y2 <span class="Special"><-</span> <a href='500fake-screen.mu.html#L70'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a> <span class="muComment"># width, height</span>
|
||||
<span id="L310" class="LineNr">310 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L310'>draw-int32-hex-wrapping-right-then-down-over-full-screen</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), n: int, x: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int, _/<span class="muRegEcx">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L311" class="LineNr">311 </span> <span class="PreProc">var</span> x2/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L312" class="LineNr">312 </span> <span class="PreProc">var</span> y2/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L313" class="LineNr">313 </span> x2, y2 <span class="Special"><-</span> <a href='500fake-screen.mu.html#L86'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a> <span class="muComment"># width, height</span>
|
||||
<span id="L314" class="LineNr">314 </span> x2, y2 <span class="Special"><-</span> <a href='501draw-text.mu.html#L286'>draw-int32-hex-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L14'>screen</a>, n, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, x2, y2, x, y, color, background-color
|
||||
<span id="L315" class="LineNr">315 </span> <span class="PreProc">return</span> x2, y2 <span class="muComment"># cursor-x, cursor-y</span>
|
||||
<span id="L316" class="LineNr">316 </span><span class="Delimiter">}</span>
|
||||
<span id="L317" class="LineNr">317 </span>
|
||||
<span id="L318" class="LineNr">318 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L318'>draw-int32-hex-wrapping-right-then-down-from-cursor</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), n: int, xmin: int, ymin: int, xmax: int, ymax: int, color: int, background-color: int <span class="Delimiter">{</span>
|
||||
<span id="L319" class="LineNr">319 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L320" class="LineNr">320 </span> <span class="PreProc">var</span> cursor-y/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L321" class="LineNr">321 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L154'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L322" class="LineNr">322 </span> <span class="PreProc">var</span> end-x/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy cursor-x
|
||||
<span id="L319" class="LineNr">319 </span> <span class="PreProc">var</span> cursor-x/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L320" class="LineNr">320 </span> <span class="PreProc">var</span> cursor-y/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L321" class="LineNr">321 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L174'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L322" class="LineNr">322 </span> <span class="PreProc">var</span> end-x/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy cursor-x
|
||||
<span id="L323" class="LineNr">323 </span> end-x <span class="Special"><-</span> increment
|
||||
<span id="L324" class="LineNr">324 </span> compare end-x, xmax
|
||||
<span id="L325" class="LineNr">325 </span> <span class="Delimiter">{</span>
|
||||
|
@ -389,23 +395,23 @@ if ('onhashchange' in window) {
|
|||
<span id="L331" class="LineNr">331 </span><span class="Delimiter">}</span>
|
||||
<span id="L332" class="LineNr">332 </span>
|
||||
<span id="L333" class="LineNr">333 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), n: int, color: int, background-color: int <span class="Delimiter">{</span>
|
||||
<span id="L334" class="LineNr">334 </span> <span class="PreProc">var</span> width/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L335" class="LineNr">335 </span> <span class="PreProc">var</span> height/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L336" class="LineNr">336 </span> width, height <span class="Special"><-</span> <a href='500fake-screen.mu.html#L70'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L334" class="LineNr">334 </span> <span class="PreProc">var</span> width/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L335" class="LineNr">335 </span> <span class="PreProc">var</span> height/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L336" class="LineNr">336 </span> width, height <span class="Special"><-</span> <a href='500fake-screen.mu.html#L86'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L337" class="LineNr">337 </span> <a href='501draw-text.mu.html#L318'>draw-int32-hex-wrapping-right-then-down-from-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, n, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, width, height, color, background-color
|
||||
<span id="L338" class="LineNr">338 </span><span class="Delimiter">}</span>
|
||||
<span id="L339" class="LineNr">339 </span>
|
||||
<span id="L340" class="LineNr">340 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L340'>draw-int32-decimal-wrapping-right-then-down</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), n: int, xmin: int, ymin: int, xmax: int, ymax: int, x: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L340" class="LineNr">340 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L340'>draw-int32-decimal-wrapping-right-then-down</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), n: int, xmin: int, ymin: int, xmax: int, ymax: int, x: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int, _/<span class="muRegEcx">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L341" class="LineNr">341 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x100</span>)
|
||||
<span id="L342" class="LineNr">342 </span> <span class="PreProc">var</span> stream/<span class="Constant">esi</span>: (addr stream byte) <span class="Special"><-</span> address stream-storage
|
||||
<span id="L342" class="LineNr">342 </span> <span class="PreProc">var</span> stream/<span class="muRegEsi">esi</span>: (addr stream byte) <span class="Special"><-</span> address stream-storage
|
||||
<span id="L343" class="LineNr">343 </span> <a href='126write-int-decimal.subx.html#L8'>write-int32-decimal</a> stream, n
|
||||
<span id="L344" class="LineNr">344 </span> <span class="PreProc">var</span> xcurr/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy x
|
||||
<span id="L345" class="LineNr">345 </span> <span class="PreProc">var</span> ycurr/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy y
|
||||
<span id="L344" class="LineNr">344 </span> <span class="PreProc">var</span> xcurr/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy x
|
||||
<span id="L345" class="LineNr">345 </span> <span class="PreProc">var</span> ycurr/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy y
|
||||
<span id="L346" class="LineNr">346 </span> <span class="Delimiter">{</span>
|
||||
<span id="L347" class="LineNr">347 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> stream
|
||||
<span id="L347" class="LineNr">347 </span> <span class="PreProc">var</span> g/<span class="muRegEax">eax</span>: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> stream
|
||||
<span id="L348" class="LineNr">348 </span> compare g, <span class="Constant">0xffffffff</span>/end-of-file
|
||||
<span id="L349" class="LineNr">349 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L350" class="LineNr">350 </span> <a href='500fake-screen.mu.html#L88'>draw-grapheme</a> <a href='500fake-screen.mu.html#L14'>screen</a>, g, xcurr, ycurr, color, background-color
|
||||
<span id="L350" class="LineNr">350 </span> <a href='500fake-screen.mu.html#L104'>draw-grapheme</a> <a href='500fake-screen.mu.html#L14'>screen</a>, g, xcurr, ycurr, color, background-color
|
||||
<span id="L351" class="LineNr">351 </span> xcurr <span class="Special"><-</span> increment
|
||||
<span id="L352" class="LineNr">352 </span> compare xcurr, xmax
|
||||
<span id="L353" class="LineNr">353 </span> <span class="Delimiter">{</span>
|
||||
|
@ -415,23 +421,23 @@ if ('onhashchange' in window) {
|
|||
<span id="L357" class="LineNr">357 </span> <span class="Delimiter">}</span>
|
||||
<span id="L358" class="LineNr">358 </span> <span class="PreProc">loop</span>
|
||||
<span id="L359" class="LineNr">359 </span> <span class="Delimiter">}</span>
|
||||
<span id="L360" class="LineNr">360 </span> <a href='500fake-screen.mu.html#L170'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, xcurr, ycurr
|
||||
<span id="L360" class="LineNr">360 </span> <a href='500fake-screen.mu.html#L190'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, xcurr, ycurr
|
||||
<span id="L361" class="LineNr">361 </span> <span class="PreProc">return</span> xcurr, ycurr
|
||||
<span id="L362" class="LineNr">362 </span><span class="Delimiter">}</span>
|
||||
<span id="L363" class="LineNr">363 </span>
|
||||
<span id="L364" class="LineNr">364 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L364'>draw-int32-decimal-wrapping-right-then-down-over-full-screen</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), n: int, x: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L365" class="LineNr">365 </span> <span class="PreProc">var</span> x2/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L366" class="LineNr">366 </span> <span class="PreProc">var</span> y2/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L367" class="LineNr">367 </span> x2, y2 <span class="Special"><-</span> <a href='500fake-screen.mu.html#L70'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a> <span class="muComment"># width, height</span>
|
||||
<span id="L364" class="LineNr">364 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L364'>draw-int32-decimal-wrapping-right-then-down-over-full-screen</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), n: int, x: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int, _/<span class="muRegEcx">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L365" class="LineNr">365 </span> <span class="PreProc">var</span> x2/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L366" class="LineNr">366 </span> <span class="PreProc">var</span> y2/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L367" class="LineNr">367 </span> x2, y2 <span class="Special"><-</span> <a href='500fake-screen.mu.html#L86'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a> <span class="muComment"># width, height</span>
|
||||
<span id="L368" class="LineNr">368 </span> x2, y2 <span class="Special"><-</span> <a href='501draw-text.mu.html#L340'>draw-int32-decimal-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L14'>screen</a>, n, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, x2, y2, x, y, color, background-color
|
||||
<span id="L369" class="LineNr">369 </span> <span class="PreProc">return</span> x2, y2 <span class="muComment"># cursor-x, cursor-y</span>
|
||||
<span id="L370" class="LineNr">370 </span><span class="Delimiter">}</span>
|
||||
<span id="L371" class="LineNr">371 </span>
|
||||
<span id="L372" class="LineNr">372 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L372'>draw-int32-decimal-wrapping-right-then-down-from-cursor</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), n: int, xmin: int, ymin: int, xmax: int, ymax: int, color: int, background-color: int <span class="Delimiter">{</span>
|
||||
<span id="L373" class="LineNr">373 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L374" class="LineNr">374 </span> <span class="PreProc">var</span> cursor-y/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L375" class="LineNr">375 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L154'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L376" class="LineNr">376 </span> <span class="PreProc">var</span> end-x/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy cursor-x
|
||||
<span id="L373" class="LineNr">373 </span> <span class="PreProc">var</span> cursor-x/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L374" class="LineNr">374 </span> <span class="PreProc">var</span> cursor-y/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L375" class="LineNr">375 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L174'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L376" class="LineNr">376 </span> <span class="PreProc">var</span> end-x/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy cursor-x
|
||||
<span id="L377" class="LineNr">377 </span> end-x <span class="Special"><-</span> increment
|
||||
<span id="L378" class="LineNr">378 </span> compare end-x, xmax
|
||||
<span id="L379" class="LineNr">379 </span> <span class="Delimiter">{</span>
|
||||
|
@ -443,9 +449,9 @@ if ('onhashchange' in window) {
|
|||
<span id="L385" class="LineNr">385 </span><span class="Delimiter">}</span>
|
||||
<span id="L386" class="LineNr">386 </span>
|
||||
<span id="L387" class="LineNr">387 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L387'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), n: int, color: int, background-color: int <span class="Delimiter">{</span>
|
||||
<span id="L388" class="LineNr">388 </span> <span class="PreProc">var</span> width/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L389" class="LineNr">389 </span> <span class="PreProc">var</span> height/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L390" class="LineNr">390 </span> width, height <span class="Special"><-</span> <a href='500fake-screen.mu.html#L70'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L388" class="LineNr">388 </span> <span class="PreProc">var</span> width/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L389" class="LineNr">389 </span> <span class="PreProc">var</span> height/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L390" class="LineNr">390 </span> width, height <span class="Special"><-</span> <a href='500fake-screen.mu.html#L86'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L391" class="LineNr">391 </span> <a href='501draw-text.mu.html#L372'>draw-int32-decimal-wrapping-right-then-down-from-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, n, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, width, height, color, background-color
|
||||
<span id="L392" class="LineNr">392 </span><span class="Delimiter">}</span>
|
||||
<span id="L393" class="LineNr">393 </span>
|
||||
|
@ -454,48 +460,48 @@ if ('onhashchange' in window) {
|
|||
<span id="L396" class="LineNr">396 </span><span class="muComment"># draw a single line of text vertically from x, y to ymax</span>
|
||||
<span id="L397" class="LineNr">397 </span><span class="muComment"># return the next 'y' coordinate</span>
|
||||
<span id="L398" class="LineNr">398 </span><span class="muComment"># if there isn't enough space, truncate</span>
|
||||
<span id="L399" class="LineNr">399 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L399'>draw-text-downward</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), x: int, y: int, ymax: int, color: int, background-color: int<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L399" class="LineNr">399 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L399'>draw-text-downward</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), x: int, y: int, ymax: int, color: int, background-color: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L400" class="LineNr">400 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x100</span>)
|
||||
<span id="L401" class="LineNr">401 </span> <span class="PreProc">var</span> stream/<span class="Constant">esi</span>: (addr stream byte) <span class="Special"><-</span> address stream-storage
|
||||
<span id="L401" class="LineNr">401 </span> <span class="PreProc">var</span> stream/<span class="muRegEsi">esi</span>: (addr stream byte) <span class="Special"><-</span> address stream-storage
|
||||
<span id="L402" class="LineNr">402 </span> <a href='108write.subx.html#L11'>write</a> stream, text
|
||||
<span id="L403" class="LineNr">403 </span> <span class="PreProc">var</span> ycurr/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='501draw-text.mu.html#L410'>draw-stream-downward</a> <a href='500fake-screen.mu.html#L14'>screen</a>, stream, x, y, ymax, color, background-color
|
||||
<span id="L403" class="LineNr">403 </span> <span class="PreProc">var</span> ycurr/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='501draw-text.mu.html#L410'>draw-stream-downward</a> <a href='500fake-screen.mu.html#L14'>screen</a>, stream, x, y, ymax, color, background-color
|
||||
<span id="L404" class="LineNr">404 </span> <span class="PreProc">return</span> ycurr
|
||||
<span id="L405" class="LineNr">405 </span><span class="Delimiter">}</span>
|
||||
<span id="L406" class="LineNr">406 </span>
|
||||
<span id="L407" class="LineNr">407 </span><span class="muComment"># draw a single-line stream vertically from x, y to ymax</span>
|
||||
<span id="L408" class="LineNr">408 </span><span class="muComment"># return the next 'y' coordinate</span>
|
||||
<span id="L409" class="LineNr">409 </span><span class="muComment"># if there isn't enough space, truncate</span>
|
||||
<span id="L410" class="LineNr">410 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L410'>draw-stream-downward</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), stream: (addr stream byte), x: int, y: int, ymax: int, color: int, background-color: int<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L411" class="LineNr">411 </span> <span class="PreProc">var</span> ycurr/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy y
|
||||
<span id="L410" class="LineNr">410 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L410'>draw-stream-downward</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), stream: (addr stream byte), x: int, y: int, ymax: int, color: int, background-color: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L411" class="LineNr">411 </span> <span class="PreProc">var</span> ycurr/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy y
|
||||
<span id="L412" class="LineNr">412 </span> <span class="Delimiter">{</span>
|
||||
<span id="L413" class="LineNr">413 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> stream
|
||||
<span id="L413" class="LineNr">413 </span> <span class="PreProc">var</span> g/<span class="muRegEax">eax</span>: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> stream
|
||||
<span id="L414" class="LineNr">414 </span> compare g, <span class="Constant">0xffffffff</span>/end-of-file
|
||||
<span id="L415" class="LineNr">415 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L416" class="LineNr">416 </span> <a href='500fake-screen.mu.html#L88'>draw-grapheme</a> <a href='500fake-screen.mu.html#L14'>screen</a>, g, x, ycurr, color, background-color
|
||||
<span id="L416" class="LineNr">416 </span> <a href='500fake-screen.mu.html#L104'>draw-grapheme</a> <a href='500fake-screen.mu.html#L14'>screen</a>, g, x, ycurr, color, background-color
|
||||
<span id="L417" class="LineNr">417 </span> ycurr <span class="Special"><-</span> increment
|
||||
<span id="L418" class="LineNr">418 </span> <span class="PreProc">loop</span>
|
||||
<span id="L419" class="LineNr">419 </span> <span class="Delimiter">}</span>
|
||||
<span id="L420" class="LineNr">420 </span> <a href='500fake-screen.mu.html#L170'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, ycurr
|
||||
<span id="L420" class="LineNr">420 </span> <a href='500fake-screen.mu.html#L190'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, ycurr
|
||||
<span id="L421" class="LineNr">421 </span> <span class="PreProc">return</span> ycurr
|
||||
<span id="L422" class="LineNr">422 </span><span class="Delimiter">}</span>
|
||||
<span id="L423" class="LineNr">423 </span>
|
||||
<span id="L424" class="LineNr">424 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L424'>draw-text-downward-from-cursor</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), ymax: int, color: int, background-color: int <span class="Delimiter">{</span>
|
||||
<span id="L425" class="LineNr">425 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L426" class="LineNr">426 </span> <span class="PreProc">var</span> cursor-y/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L427" class="LineNr">427 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L154'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L428" class="LineNr">428 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='501draw-text.mu.html#L399'>draw-text-downward</a> <a href='500fake-screen.mu.html#L14'>screen</a>, text, cursor-x, cursor-y, ymax, color, background-color
|
||||
<span id="L425" class="LineNr">425 </span> <span class="PreProc">var</span> cursor-x/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L426" class="LineNr">426 </span> <span class="PreProc">var</span> cursor-y/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L427" class="LineNr">427 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L174'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L428" class="LineNr">428 </span> <span class="PreProc">var</span> result/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='501draw-text.mu.html#L399'>draw-text-downward</a> <a href='500fake-screen.mu.html#L14'>screen</a>, text, cursor-x, cursor-y, ymax, color, background-color
|
||||
<span id="L429" class="LineNr">429 </span><span class="Delimiter">}</span>
|
||||
<span id="L430" class="LineNr">430 </span>
|
||||
<span id="L431" class="LineNr">431 </span><span class="muComment"># draw text down and right in the rectangle from (xmin, ymin) to (xmax, ymax), starting from (x, y), wrapping as necessary</span>
|
||||
<span id="L432" class="LineNr">432 </span><span class="muComment"># return the next (x, y) coordinate in raster order where drawing stopped</span>
|
||||
<span id="L433" class="LineNr">433 </span><span class="muComment"># that way the caller can draw more if given the same min and max bounding-box.</span>
|
||||
<span id="L434" class="LineNr">434 </span><span class="muComment"># if there isn't enough space, truncate</span>
|
||||
<span id="L435" class="LineNr">435 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L435'>draw-text-wrapping-down-then-right</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), xmin: int, ymin: int, xmax: int, ymax: int, _x: int, _y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L435" class="LineNr">435 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L435'>draw-text-wrapping-down-then-right</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), xmin: int, ymin: int, xmax: int, ymax: int, _x: int, _y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int, _/<span class="muRegEcx">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L436" class="LineNr">436 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x100</span>)
|
||||
<span id="L437" class="LineNr">437 </span> <span class="PreProc">var</span> stream/<span class="Constant">esi</span>: (addr stream byte) <span class="Special"><-</span> address stream-storage
|
||||
<span id="L437" class="LineNr">437 </span> <span class="PreProc">var</span> stream/<span class="muRegEsi">esi</span>: (addr stream byte) <span class="Special"><-</span> address stream-storage
|
||||
<span id="L438" class="LineNr">438 </span> <a href='108write.subx.html#L11'>write</a> stream, text
|
||||
<span id="L439" class="LineNr">439 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy _x
|
||||
<span id="L440" class="LineNr">440 </span> <span class="PreProc">var</span> y/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy _y
|
||||
<span id="L439" class="LineNr">439 </span> <span class="PreProc">var</span> x/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy _x
|
||||
<span id="L440" class="LineNr">440 </span> <span class="PreProc">var</span> y/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy _y
|
||||
<span id="L441" class="LineNr">441 </span> x, y <span class="Special"><-</span> <a href='501draw-text.mu.html#L449'>draw-stream-wrapping-down-then-right</a> <a href='500fake-screen.mu.html#L14'>screen</a>, stream, xmin, ymin, xmax, ymax, x, y, color, background-color
|
||||
<span id="L442" class="LineNr">442 </span> <span class="PreProc">return</span> x, y
|
||||
<span id="L443" class="LineNr">443 </span><span class="Delimiter">}</span>
|
||||
|
@ -504,14 +510,14 @@ if ('onhashchange' in window) {
|
|||
<span id="L446" class="LineNr">446 </span><span class="muComment"># return the next (x, y) coordinate in raster order where drawing stopped</span>
|
||||
<span id="L447" class="LineNr">447 </span><span class="muComment"># that way the caller can draw more if given the same min and max bounding-box.</span>
|
||||
<span id="L448" class="LineNr">448 </span><span class="muComment"># if there isn't enough space, truncate</span>
|
||||
<span id="L449" class="LineNr">449 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L449'>draw-stream-wrapping-down-then-right</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), stream: (addr stream byte), xmin: int, ymin: int, xmax: int, ymax: int, x: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L450" class="LineNr">450 </span> <span class="PreProc">var</span> xcurr/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy x
|
||||
<span id="L451" class="LineNr">451 </span> <span class="PreProc">var</span> ycurr/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy y
|
||||
<span id="L449" class="LineNr">449 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L449'>draw-stream-wrapping-down-then-right</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), stream: (addr stream byte), xmin: int, ymin: int, xmax: int, ymax: int, x: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int, _/<span class="muRegEcx">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L450" class="LineNr">450 </span> <span class="PreProc">var</span> xcurr/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy x
|
||||
<span id="L451" class="LineNr">451 </span> <span class="PreProc">var</span> ycurr/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy y
|
||||
<span id="L452" class="LineNr">452 </span> <span class="Delimiter">{</span>
|
||||
<span id="L453" class="LineNr">453 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> stream
|
||||
<span id="L453" class="LineNr">453 </span> <span class="PreProc">var</span> g/<span class="muRegEax">eax</span>: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> stream
|
||||
<span id="L454" class="LineNr">454 </span> compare g, <span class="Constant">0xffffffff</span>/end-of-file
|
||||
<span id="L455" class="LineNr">455 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L456" class="LineNr">456 </span> <a href='500fake-screen.mu.html#L88'>draw-grapheme</a> <a href='500fake-screen.mu.html#L14'>screen</a>, g, xcurr, ycurr, color, background-color
|
||||
<span id="L456" class="LineNr">456 </span> <a href='500fake-screen.mu.html#L104'>draw-grapheme</a> <a href='500fake-screen.mu.html#L14'>screen</a>, g, xcurr, ycurr, color, background-color
|
||||
<span id="L457" class="LineNr">457 </span> ycurr <span class="Special"><-</span> increment
|
||||
<span id="L458" class="LineNr">458 </span> compare ycurr, ymax
|
||||
<span id="L459" class="LineNr">459 </span> <span class="Delimiter">{</span>
|
||||
|
@ -521,23 +527,23 @@ if ('onhashchange' in window) {
|
|||
<span id="L463" class="LineNr">463 </span> <span class="Delimiter">}</span>
|
||||
<span id="L464" class="LineNr">464 </span> <span class="PreProc">loop</span>
|
||||
<span id="L465" class="LineNr">465 </span> <span class="Delimiter">}</span>
|
||||
<span id="L466" class="LineNr">466 </span> <a href='500fake-screen.mu.html#L170'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, xcurr, ycurr
|
||||
<span id="L466" class="LineNr">466 </span> <a href='500fake-screen.mu.html#L190'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, xcurr, ycurr
|
||||
<span id="L467" class="LineNr">467 </span> <span class="PreProc">return</span> xcurr, ycurr
|
||||
<span id="L468" class="LineNr">468 </span><span class="Delimiter">}</span>
|
||||
<span id="L469" class="LineNr">469 </span>
|
||||
<span id="L470" class="LineNr">470 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L470'>draw-text-wrapping-down-then-right-over-full-screen</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), x: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int, _/<span class="Constant">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L471" class="LineNr">471 </span> <span class="PreProc">var</span> x2/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L472" class="LineNr">472 </span> <span class="PreProc">var</span> y2/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L473" class="LineNr">473 </span> x2, y2 <span class="Special"><-</span> <a href='500fake-screen.mu.html#L70'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a> <span class="muComment"># width, height</span>
|
||||
<span id="L470" class="LineNr">470 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L470'>draw-text-wrapping-down-then-right-over-full-screen</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), x: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int, _/<span class="muRegEcx">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L471" class="LineNr">471 </span> <span class="PreProc">var</span> x2/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L472" class="LineNr">472 </span> <span class="PreProc">var</span> y2/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L473" class="LineNr">473 </span> x2, y2 <span class="Special"><-</span> <a href='500fake-screen.mu.html#L86'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a> <span class="muComment"># width, height</span>
|
||||
<span id="L474" class="LineNr">474 </span> x2, y2 <span class="Special"><-</span> <a href='501draw-text.mu.html#L435'>draw-text-wrapping-down-then-right</a> <a href='500fake-screen.mu.html#L14'>screen</a>, text, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, x2, y2, x, y, color, background-color
|
||||
<span id="L475" class="LineNr">475 </span> <span class="PreProc">return</span> x2, y2 <span class="muComment"># cursor-x, cursor-y</span>
|
||||
<span id="L476" class="LineNr">476 </span><span class="Delimiter">}</span>
|
||||
<span id="L477" class="LineNr">477 </span>
|
||||
<span id="L478" class="LineNr">478 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L478'>draw-text-wrapping-down-then-right-from-cursor</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), xmin: int, ymin: int, xmax: int, ymax: int, color: int, background-color: int <span class="Delimiter">{</span>
|
||||
<span id="L479" class="LineNr">479 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L480" class="LineNr">480 </span> <span class="PreProc">var</span> cursor-y/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L481" class="LineNr">481 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L154'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L482" class="LineNr">482 </span> <span class="PreProc">var</span> end-y/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy cursor-y
|
||||
<span id="L479" class="LineNr">479 </span> <span class="PreProc">var</span> cursor-x/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L480" class="LineNr">480 </span> <span class="PreProc">var</span> cursor-y/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L481" class="LineNr">481 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L174'>cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L482" class="LineNr">482 </span> <span class="PreProc">var</span> end-y/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy cursor-y
|
||||
<span id="L483" class="LineNr">483 </span> end-y <span class="Special"><-</span> increment
|
||||
<span id="L484" class="LineNr">484 </span> compare end-y, ymax
|
||||
<span id="L485" class="LineNr">485 </span> <span class="Delimiter">{</span>
|
||||
|
@ -549,9 +555,9 @@ if ('onhashchange' in window) {
|
|||
<span id="L491" class="LineNr">491 </span><span class="Delimiter">}</span>
|
||||
<span id="L492" class="LineNr">492 </span>
|
||||
<span id="L493" class="LineNr">493 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L493'>draw-text-wrapping-down-then-right-from-cursor-over-full-screen</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), text: (addr array byte), color: int, background-color: int <span class="Delimiter">{</span>
|
||||
<span id="L494" class="LineNr">494 </span> <span class="PreProc">var</span> width/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L495" class="LineNr">495 </span> <span class="PreProc">var</span> height/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L496" class="LineNr">496 </span> width, height <span class="Special"><-</span> <a href='500fake-screen.mu.html#L70'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L494" class="LineNr">494 </span> <span class="PreProc">var</span> width/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L495" class="LineNr">495 </span> <span class="PreProc">var</span> height/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L496" class="LineNr">496 </span> width, height <span class="Special"><-</span> <a href='500fake-screen.mu.html#L86'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L497" class="LineNr">497 </span> <a href='501draw-text.mu.html#L478'>draw-text-wrapping-down-then-right-from-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, text, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, width, height, color, background-color
|
||||
<span id="L498" class="LineNr">498 </span><span class="Delimiter">}</span>
|
||||
</pre>
|
||||
|
|
7
html/502test.mu.html
generated
7
html/502test.mu.html
generated
|
@ -18,6 +18,7 @@ a { color:inherit; }
|
|||
.Special { color: #ff6060; }
|
||||
.LineNr { }
|
||||
.Constant { color: #008787; }
|
||||
.muRegEax { color: #875f00; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muTest { color: #5f8700; }
|
||||
|
@ -59,7 +60,7 @@ if ('onhashchange' in window) {
|
|||
<pre id='vimCodeElement'>
|
||||
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># print msg to screen if a != b, otherwise print "."</span>
|
||||
<span id="L2" class="LineNr"> 2 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='502test.mu.html#L2'>check-ints-equal</a></span> _a: int, b: int, msg: (addr array byte) <span class="Delimiter">{</span>
|
||||
<span id="L3" class="LineNr"> 3 </span> <span class="PreProc">var</span> a/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy _a
|
||||
<span id="L3" class="LineNr"> 3 </span> <span class="PreProc">var</span> a/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy _a
|
||||
<span id="L4" class="LineNr"> 4 </span> compare a, b
|
||||
<span id="L5" class="LineNr"> 5 </span> <span class="Delimiter">{</span>
|
||||
<span id="L6" class="LineNr"> 6 </span> <span class="PreProc">break-if-!=</span>
|
||||
|
@ -76,7 +77,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L17" class="LineNr">17 </span><span class="Delimiter">}</span>
|
||||
<span id="L18" class="LineNr">18 </span>
|
||||
<span id="L19" class="LineNr">19 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='502test.mu.html#L19'>check</a></span> _a: boolean, msg: (addr array byte) <span class="Delimiter">{</span>
|
||||
<span id="L20" class="LineNr">20 </span> <span class="PreProc">var</span> a/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy _a
|
||||
<span id="L20" class="LineNr">20 </span> <span class="PreProc">var</span> a/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy _a
|
||||
<span id="L21" class="LineNr">21 </span> compare a, <span class="Constant">0</span>/false
|
||||
<span id="L22" class="LineNr">22 </span> <span class="Delimiter">{</span>
|
||||
<span id="L23" class="LineNr">23 </span> <span class="PreProc">break-if-=</span>
|
||||
|
@ -89,7 +90,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L30" class="LineNr">30 </span><span class="Delimiter">}</span>
|
||||
<span id="L31" class="LineNr">31 </span>
|
||||
<span id="L32" class="LineNr">32 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='502test.mu.html#L32'>check-not</a></span> _a: boolean, msg: (addr array byte) <span class="Delimiter">{</span>
|
||||
<span id="L33" class="LineNr">33 </span> <span class="PreProc">var</span> a/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy _a
|
||||
<span id="L33" class="LineNr">33 </span> <span class="PreProc">var</span> a/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy _a
|
||||
<span id="L34" class="LineNr">34 </span> compare a, <span class="Constant">0</span>/false
|
||||
<span id="L35" class="LineNr">35 </span> <span class="Delimiter">{</span>
|
||||
<span id="L36" class="LineNr">36 </span> <span class="PreProc">break-if-!=</span>
|
||||
|
|
6
html/503manhattan-line.mu.html
generated
6
html/503manhattan-line.mu.html
generated
|
@ -16,7 +16,7 @@ a { color:inherit; }
|
|||
* { font-size:12pt; font-size: 1em; }
|
||||
.PreProc { color: #c000c0; }
|
||||
.LineNr { }
|
||||
.Constant { color: #008787; }
|
||||
.muRegEax { color: #875f00; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Special { color: #ff6060; }
|
||||
|
@ -63,7 +63,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L6" class="LineNr"> 6 </span><span class="Delimiter">}</span>
|
||||
<span id="L7" class="LineNr"> 7 </span>
|
||||
<span id="L8" class="LineNr"> 8 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='503manhattan-line.mu.html#L8'>draw-horizontal-line-on-real-screen</a></span> x1: int, x2: int, y: int, color: int <span class="Delimiter">{</span>
|
||||
<span id="L9" class="LineNr"> 9 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy x1
|
||||
<span id="L9" class="LineNr"> 9 </span> <span class="PreProc">var</span> x/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy x1
|
||||
<span id="L10" class="LineNr">10 </span> <span class="Delimiter">{</span>
|
||||
<span id="L11" class="LineNr">11 </span> compare x, x2
|
||||
<span id="L12" class="LineNr">12 </span> <span class="PreProc">break-if->=</span>
|
||||
|
@ -74,7 +74,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L17" class="LineNr">17 </span><span class="Delimiter">}</span>
|
||||
<span id="L18" class="LineNr">18 </span>
|
||||
<span id="L19" class="LineNr">19 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='503manhattan-line.mu.html#L19'>draw-vertical-line-on-real-screen</a></span> x: int, y1: int, y2: int, color: int <span class="Delimiter">{</span>
|
||||
<span id="L20" class="LineNr">20 </span> <span class="PreProc">var</span> y/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy y1
|
||||
<span id="L20" class="LineNr">20 </span> <span class="PreProc">var</span> y/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy y1
|
||||
<span id="L21" class="LineNr">21 </span> <span class="Delimiter">{</span>
|
||||
<span id="L22" class="LineNr">22 </span> compare y, y2
|
||||
<span id="L23" class="LineNr">23 </span> <span class="PreProc">break-if->=</span>
|
||||
|
|
656
html/504test-screen.mu.html
generated
656
html/504test-screen.mu.html
generated
|
@ -14,14 +14,20 @@ pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-
|
|||
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #a8a8a8; }
|
||||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.PreProc { color: #c000c0; }
|
||||
.Special { color: #ff6060; }
|
||||
.LineNr { }
|
||||
.Constant { color: #008787; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muRegEdx { color: #878700; }
|
||||
.muRegEbx { color: #8787af; }
|
||||
.muRegEsi { color: #87d787; }
|
||||
.muRegEdi { color: #87ffd7; }
|
||||
.Constant { color: #008787; }
|
||||
.Special { color: #ff6060; }
|
||||
.PreProc { color: #c000c0; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muTest { color: #5f8700; }
|
||||
.muComment { color: #005faf; }
|
||||
.muRegEax { color: #875f00; }
|
||||
.muRegEcx { color: #af875f; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
@ -68,322 +74,338 @@ if ('onhashchange' in window) {
|
|||
<span id="L9" class="LineNr"> 9 </span><span class="Delimiter">}</span>
|
||||
<span id="L10" class="LineNr"> 10 </span>
|
||||
<span id="L11" class="LineNr"> 11 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='504test-screen.mu.html#L11'>check-screen-row-from</a></span> screen-on-stack: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), x: int, y: int, expected: (addr array byte), msg: (addr array byte) <span class="Delimiter">{</span>
|
||||
<span id="L12" class="LineNr"> 12 </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"><-</span> copy screen-on-stack
|
||||
<span id="L13" class="LineNr"> 13 </span> <span class="PreProc">var</span> idx/<span class="Constant">ecx</span>: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L120'>screen-cell-index</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y
|
||||
<span id="L14" class="LineNr"> 14 </span> <span class="muComment"># compare 'expected' with the screen contents starting at 'idx', grapheme by grapheme</span>
|
||||
<span id="L15" class="LineNr"> 15 </span> <span class="PreProc">var</span> e: (stream byte <span class="Constant">0x100</span>)
|
||||
<span id="L16" class="LineNr"> 16 </span> <span class="PreProc">var</span> e-addr/<span class="Constant">edx</span>: (addr stream byte) <span class="Special"><-</span> address e
|
||||
<span id="L17" class="LineNr"> 17 </span> <a href='108write.subx.html#L11'>write</a> e-addr, expected
|
||||
<span id="L18" class="LineNr"> 18 </span> <span class="Delimiter">{</span>
|
||||
<span id="L19" class="LineNr"> 19 </span> <span class="PreProc">var</span> done?/<span class="Constant">eax</span>: boolean <span class="Special"><-</span> <a href='309stream.subx.html#L6'>stream-empty?</a> e-addr
|
||||
<span id="L20" class="LineNr"> 20 </span> compare done?, <span class="Constant">0</span>
|
||||
<span id="L21" class="LineNr"> 21 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L22" class="LineNr"> 22 </span> <span class="PreProc">var</span> _g/<span class="Constant">eax</span>: grapheme <span class="Special"><-</span> <a href='500fake-screen.mu.html#L414'>screen-grapheme-at-idx</a> <a href='500fake-screen.mu.html#L14'>screen</a>, idx
|
||||
<span id="L23" class="LineNr"> 23 </span> <span class="PreProc">var</span> g/<span class="Constant">ebx</span>: grapheme <span class="Special"><-</span> copy _g
|
||||
<span id="L24" class="LineNr"> 24 </span> <span class="PreProc">var</span> expected-grapheme/<span class="Constant">eax</span>: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> e-addr
|
||||
<span id="L25" class="LineNr"> 25 </span> <span class="muComment"># compare graphemes</span>
|
||||
<span id="L26" class="LineNr"> 26 </span> $check-screen-row-from:compare-graphemes: <span class="Delimiter">{</span>
|
||||
<span id="L27" class="LineNr"> 27 </span> <span class="muComment"># if expected-grapheme is space, null grapheme is also ok</span>
|
||||
<span id="L28" class="LineNr"> 28 </span> <span class="Delimiter">{</span>
|
||||
<span id="L29" class="LineNr"> 29 </span> compare expected-grapheme, <span class="Constant">0x20</span>
|
||||
<span id="L30" class="LineNr"> 30 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L31" class="LineNr"> 31 </span> compare g, <span class="Constant">0</span>
|
||||
<span id="L32" class="LineNr"> 32 </span> <span class="PreProc">break-if-=</span> $check-screen-row-from:compare-graphemes
|
||||
<span id="L33" class="LineNr"> 33 </span> <span class="Delimiter">}</span>
|
||||
<span id="L34" class="LineNr"> 34 </span> <span class="muComment"># if (g == expected-grapheme) print "."</span>
|
||||
<span id="L35" class="LineNr"> 35 </span> compare g, expected-grapheme
|
||||
<span id="L36" class="LineNr"> 36 </span> <span class="Delimiter">{</span>
|
||||
<span id="L37" class="LineNr"> 37 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L38" class="LineNr"> 38 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">"."</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L39" class="LineNr"> 39 </span> <span class="PreProc">break</span> $check-screen-row-from:compare-graphemes
|
||||
<span id="L40" class="LineNr"> 40 </span> <span class="Delimiter">}</span>
|
||||
<span id="L41" class="LineNr"> 41 </span> <span class="muComment"># otherwise print an error</span>
|
||||
<span id="L42" class="LineNr"> 42 </span> <a href='104test.subx.html#L5'>count-test-failure</a>
|
||||
<span id="L43" class="LineNr"> 43 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, msg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L44" class="LineNr"> 44 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">": expected '"</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L45" class="LineNr"> 45 </span> <a href='501draw-text.mu.html#L84'>draw-grapheme-at-cursor</a> <span class="Constant">0</span>/screen, expected-grapheme, <span class="Constant">3</span>/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L46" class="LineNr"> 46 </span> <a href='501draw-text.mu.html#L242'>move-cursor-rightward-and-downward</a> <span class="Constant">0</span>/screen, <span class="Constant">0</span>/xmin, <span class="Constant">0x80</span>/xmax=screen-width
|
||||
<span id="L47" class="LineNr"> 47 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">"' at ("</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L48" class="LineNr"> 48 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, x, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L49" class="LineNr"> 49 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">", "</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L50" class="LineNr"> 50 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, y, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L51" class="LineNr"> 51 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">") but observed '"</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L52" class="LineNr"> 52 </span> <a href='501draw-text.mu.html#L84'>draw-grapheme-at-cursor</a> <span class="Constant">0</span>/screen, g, <span class="Constant">3</span>/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L53" class="LineNr"> 53 </span> <a href='501draw-text.mu.html#L242'>move-cursor-rightward-and-downward</a> <span class="Constant">0</span>/screen, <span class="Constant">0</span>/xmin, <span class="Constant">0x80</span>/xmax=screen-width
|
||||
<span id="L54" class="LineNr"> 54 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">"'"</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L55" class="LineNr"> 55 </span> <a href='501draw-text.mu.html#L65'>move-cursor-to-left-margin-of-next-line</a> <span class="Constant">0</span>/screen
|
||||
<span id="L56" class="LineNr"> 56 </span> <span class="Delimiter">}</span>
|
||||
<span id="L57" class="LineNr"> 57 </span> idx <span class="Special"><-</span> increment
|
||||
<span id="L58" class="LineNr"> 58 </span> increment x
|
||||
<span id="L59" class="LineNr"> 59 </span> <span class="PreProc">loop</span>
|
||||
<span id="L60" class="LineNr"> 60 </span> <span class="Delimiter">}</span>
|
||||
<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="muComment"># various variants by screen-cell attribute; spaces in the 'expected' data should not match the attribute</span>
|
||||
<span id="L64" class="LineNr"> 64 </span>
|
||||
<span id="L65" class="LineNr"> 65 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='504test-screen.mu.html#L65'>check-screen-row-in-color</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), fg: int, y: int, expected: (addr array byte), msg: (addr array byte) <span class="Delimiter">{</span>
|
||||
<span id="L66" class="LineNr"> 66 </span> <a href='504test-screen.mu.html#L69'>check-screen-row-in-color-from</a> <a href='500fake-screen.mu.html#L14'>screen</a>, fg, y, <span class="Constant">0</span>/x, expected, msg
|
||||
<span id="L12" class="LineNr"> 12 </span> <span class="PreProc">var</span> <a href='500fake-screen.mu.html#L14'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>) <span class="Special"><-</span> copy screen-on-stack
|
||||
<span id="L13" class="LineNr"> 13 </span> <span class="PreProc">var</span> failure-count/<span class="muRegEdi">edi</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L14" class="LineNr"> 14 </span> <span class="PreProc">var</span> idx/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L136'>screen-cell-index</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y
|
||||
<span id="L15" class="LineNr"> 15 </span> <span class="muComment"># compare 'expected' with the screen contents starting at 'idx', grapheme by grapheme</span>
|
||||
<span id="L16" class="LineNr"> 16 </span> <span class="PreProc">var</span> e: (stream byte <span class="Constant">0x100</span>)
|
||||
<span id="L17" class="LineNr"> 17 </span> <span class="PreProc">var</span> e-addr/<span class="muRegEdx">edx</span>: (addr stream byte) <span class="Special"><-</span> address e
|
||||
<span id="L18" class="LineNr"> 18 </span> <a href='108write.subx.html#L11'>write</a> e-addr, expected
|
||||
<span id="L19" class="LineNr"> 19 </span> <span class="Delimiter">{</span>
|
||||
<span id="L20" class="LineNr"> 20 </span> <span class="PreProc">var</span> done?/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='309stream.subx.html#L6'>stream-empty?</a> e-addr
|
||||
<span id="L21" class="LineNr"> 21 </span> compare done?, <span class="Constant">0</span>
|
||||
<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> _g/<span class="muRegEax">eax</span>: grapheme <span class="Special"><-</span> <a href='500fake-screen.mu.html#L434'>screen-grapheme-at-idx</a> <a href='500fake-screen.mu.html#L14'>screen</a>, idx
|
||||
<span id="L24" class="LineNr"> 24 </span> <span class="PreProc">var</span> g/<span class="muRegEbx">ebx</span>: grapheme <span class="Special"><-</span> copy _g
|
||||
<span id="L25" class="LineNr"> 25 </span> <span class="PreProc">var</span> expected-grapheme/<span class="muRegEax">eax</span>: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> e-addr
|
||||
<span id="L26" class="LineNr"> 26 </span> <span class="muComment"># compare graphemes</span>
|
||||
<span id="L27" class="LineNr"> 27 </span> $check-screen-row-from:compare-graphemes: <span class="Delimiter">{</span>
|
||||
<span id="L28" class="LineNr"> 28 </span> <span class="muComment"># if expected-grapheme is space, null grapheme is also ok</span>
|
||||
<span id="L29" class="LineNr"> 29 </span> <span class="Delimiter">{</span>
|
||||
<span id="L30" class="LineNr"> 30 </span> compare expected-grapheme, <span class="Constant">0x20</span>
|
||||
<span id="L31" class="LineNr"> 31 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L32" class="LineNr"> 32 </span> compare g, <span class="Constant">0</span>
|
||||
<span id="L33" class="LineNr"> 33 </span> <span class="PreProc">break-if-=</span> $check-screen-row-from:compare-graphemes
|
||||
<span id="L34" class="LineNr"> 34 </span> <span class="Delimiter">}</span>
|
||||
<span id="L35" class="LineNr"> 35 </span> <span class="muComment"># if (g == expected-grapheme) print "."</span>
|
||||
<span id="L36" class="LineNr"> 36 </span> compare g, expected-grapheme
|
||||
<span id="L37" class="LineNr"> 37 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L38" class="LineNr"> 38 </span> <span class="muComment"># otherwise print an error</span>
|
||||
<span id="L39" class="LineNr"> 39 </span> failure-count <span class="Special"><-</span> increment
|
||||
<span id="L40" class="LineNr"> 40 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, msg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L41" class="LineNr"> 41 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">": expected '"</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L42" class="LineNr"> 42 </span> <a href='501draw-text.mu.html#L84'>draw-grapheme-at-cursor</a> <span class="Constant">0</span>/screen, expected-grapheme, <span class="Constant">3</span>/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L43" class="LineNr"> 43 </span> <a href='501draw-text.mu.html#L242'>move-cursor-rightward-and-downward</a> <span class="Constant">0</span>/screen, <span class="Constant">0</span>/xmin, <span class="Constant">0x80</span>/xmax=screen-width
|
||||
<span id="L44" class="LineNr"> 44 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">"' at ("</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L45" class="LineNr"> 45 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, x, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L46" class="LineNr"> 46 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">", "</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L47" class="LineNr"> 47 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, y, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L48" class="LineNr"> 48 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">") but observed '"</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L49" class="LineNr"> 49 </span> <a href='501draw-text.mu.html#L84'>draw-grapheme-at-cursor</a> <span class="Constant">0</span>/screen, g, <span class="Constant">3</span>/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L50" class="LineNr"> 50 </span> <a href='501draw-text.mu.html#L242'>move-cursor-rightward-and-downward</a> <span class="Constant">0</span>/screen, <span class="Constant">0</span>/xmin, <span class="Constant">0x80</span>/xmax=screen-width
|
||||
<span id="L51" class="LineNr"> 51 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">"'"</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L52" class="LineNr"> 52 </span> <a href='501draw-text.mu.html#L65'>move-cursor-to-left-margin-of-next-line</a> <span class="Constant">0</span>/screen
|
||||
<span id="L53" class="LineNr"> 53 </span> <span class="Delimiter">}</span>
|
||||
<span id="L54" class="LineNr"> 54 </span> idx <span class="Special"><-</span> increment
|
||||
<span id="L55" class="LineNr"> 55 </span> increment x
|
||||
<span id="L56" class="LineNr"> 56 </span> <span class="PreProc">loop</span>
|
||||
<span id="L57" class="LineNr"> 57 </span> <span class="Delimiter">}</span>
|
||||
<span id="L58" class="LineNr"> 58 </span> <span class="muComment"># if any assertions failed, count the test as failed</span>
|
||||
<span id="L59" class="LineNr"> 59 </span> compare failure-count, <span class="Constant">0</span>
|
||||
<span id="L60" class="LineNr"> 60 </span> <span class="Delimiter">{</span>
|
||||
<span id="L61" class="LineNr"> 61 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L62" class="LineNr"> 62 </span> <a href='104test.subx.html#L5'>count-test-failure</a>
|
||||
<span id="L63" class="LineNr"> 63 </span> <span class="PreProc">return</span>
|
||||
<span id="L64" class="LineNr"> 64 </span> <span class="Delimiter">}</span>
|
||||
<span id="L65" class="LineNr"> 65 </span> <span class="muComment"># otherwise print a "."</span>
|
||||
<span id="L66" class="LineNr"> 66 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">"."</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<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='504test-screen.mu.html#L69'>check-screen-row-in-color-from</a></span> screen-on-stack: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), fg: int, y: int, x: int, expected: (addr array byte), msg: (addr array byte) <span class="Delimiter">{</span>
|
||||
<span id="L70" class="LineNr"> 70 </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"><-</span> copy screen-on-stack
|
||||
<span id="L71" class="LineNr"> 71 </span> <span class="PreProc">var</span> idx/<span class="Constant">ecx</span>: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L120'>screen-cell-index</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y
|
||||
<span id="L72" class="LineNr"> 72 </span> <span class="muComment"># compare 'expected' with the screen contents starting at 'idx', grapheme by grapheme</span>
|
||||
<span id="L73" class="LineNr"> 73 </span> <span class="PreProc">var</span> e: (stream byte <span class="Constant">0x100</span>)
|
||||
<span id="L74" class="LineNr"> 74 </span> <span class="PreProc">var</span> e-addr/<span class="Constant">edx</span>: (addr stream byte) <span class="Special"><-</span> address e
|
||||
<span id="L75" class="LineNr"> 75 </span> <a href='108write.subx.html#L11'>write</a> e-addr, expected
|
||||
<span id="L76" class="LineNr"> 76 </span> <span class="Delimiter">{</span>
|
||||
<span id="L77" class="LineNr"> 77 </span> <span class="PreProc">var</span> done?/<span class="Constant">eax</span>: boolean <span class="Special"><-</span> <a href='309stream.subx.html#L6'>stream-empty?</a> e-addr
|
||||
<span id="L78" class="LineNr"> 78 </span> compare done?, <span class="Constant">0</span>
|
||||
<span id="L79" class="LineNr"> 79 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L80" class="LineNr"> 80 </span> <span class="PreProc">var</span> _g/<span class="Constant">eax</span>: grapheme <span class="Special"><-</span> <a href='500fake-screen.mu.html#L414'>screen-grapheme-at-idx</a> <a href='500fake-screen.mu.html#L14'>screen</a>, idx
|
||||
<span id="L81" class="LineNr"> 81 </span> <span class="PreProc">var</span> g/<span class="Constant">ebx</span>: grapheme <span class="Special"><-</span> copy _g
|
||||
<span id="L82" class="LineNr"> 82 </span> <span class="PreProc">var</span> _expected-grapheme/<span class="Constant">eax</span>: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> e-addr
|
||||
<span id="L83" class="LineNr"> 83 </span> <span class="PreProc">var</span> expected-grapheme/<span class="Constant">edi</span>: grapheme <span class="Special"><-</span> copy _expected-grapheme
|
||||
<span id="L84" class="LineNr"> 84 </span> $check-screen-row-in-color-from:compare-cells: <span class="Delimiter">{</span>
|
||||
<span id="L85" class="LineNr"> 85 </span> <span class="muComment"># if expected-grapheme is space, null grapheme is also ok</span>
|
||||
<span id="L86" class="LineNr"> 86 </span> <span class="Delimiter">{</span>
|
||||
<span id="L87" class="LineNr"> 87 </span> compare expected-grapheme, <span class="Constant">0x20</span>
|
||||
<span id="L88" class="LineNr"> 88 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L89" class="LineNr"> 89 </span> compare g, <span class="Constant">0</span>
|
||||
<span id="L90" class="LineNr"> 90 </span> <span class="PreProc">break-if-=</span> $check-screen-row-in-color-from:compare-cells
|
||||
<span id="L91" class="LineNr"> 91 </span> <span class="Delimiter">}</span>
|
||||
<span id="L92" class="LineNr"> 92 </span> <span class="muComment"># if expected-grapheme is space, a different color is ok</span>
|
||||
<span id="L93" class="LineNr"> 93 </span> <span class="Delimiter">{</span>
|
||||
<span id="L94" class="LineNr"> 94 </span> compare expected-grapheme, <span class="Constant">0x20</span>
|
||||
<span id="L95" class="LineNr"> 95 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L96" class="LineNr"> 96 </span> <span class="PreProc">var</span> color/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L432'>screen-color-at-idx</a> <a href='500fake-screen.mu.html#L14'>screen</a>, idx
|
||||
<span id="L97" class="LineNr"> 97 </span> compare color, fg
|
||||
<span id="L98" class="LineNr"> 98 </span> <span class="PreProc">break-if-!=</span> $check-screen-row-in-color-from:compare-cells
|
||||
<span id="L99" class="LineNr"> 99 </span> <span class="Delimiter">}</span>
|
||||
<span id="L100" class="LineNr">100 </span> <span class="muComment"># compare graphemes</span>
|
||||
<span id="L101" class="LineNr">101 </span> $check-screen-row-in-color-from:compare-graphemes: <span class="Delimiter">{</span>
|
||||
<span id="L102" class="LineNr">102 </span> <span class="muComment"># if (g == expected-grapheme) print "."</span>
|
||||
<span id="L103" class="LineNr">103 </span> compare g, expected-grapheme
|
||||
<span id="L104" class="LineNr">104 </span> <span class="Delimiter">{</span>
|
||||
<span id="L105" class="LineNr">105 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L106" class="LineNr">106 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">"."</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L107" class="LineNr">107 </span> <span class="PreProc">break</span> $check-screen-row-in-color-from:compare-graphemes
|
||||
<span id="L108" class="LineNr">108 </span> <span class="Delimiter">}</span>
|
||||
<span id="L109" class="LineNr">109 </span> <span class="muComment"># otherwise print an error</span>
|
||||
<span id="L110" class="LineNr">110 </span> <a href='104test.subx.html#L5'>count-test-failure</a>
|
||||
<span id="L111" class="LineNr">111 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, msg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L112" class="LineNr">112 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">": expected '"</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L113" class="LineNr">113 </span> <a href='501draw-text.mu.html#L84'>draw-grapheme-at-cursor</a> <span class="Constant">0</span>/screen, expected-grapheme, <span class="Constant">3</span>/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L114" class="LineNr">114 </span> <a href='501draw-text.mu.html#L242'>move-cursor-rightward-and-downward</a> <span class="Constant">0</span>/screen, <span class="Constant">0</span>/xmin, <span class="Constant">0x80</span>/xmax=screen-width
|
||||
<span id="L115" class="LineNr">115 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">"' at ("</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L116" class="LineNr">116 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, x, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L117" class="LineNr">117 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">", "</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L118" class="LineNr">118 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, y, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L119" class="LineNr">119 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">") but observed '"</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L120" class="LineNr">120 </span> <a href='501draw-text.mu.html#L84'>draw-grapheme-at-cursor</a> <span class="Constant">0</span>/screen, g, <span class="Constant">3</span>/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L121" class="LineNr">121 </span> <a href='501draw-text.mu.html#L242'>move-cursor-rightward-and-downward</a> <span class="Constant">0</span>/screen, <span class="Constant">0</span>/xmin, <span class="Constant">0x80</span>/xmax=screen-width
|
||||
<span id="L122" class="LineNr">122 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">"'"</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L123" class="LineNr">123 </span> <a href='501draw-text.mu.html#L65'>move-cursor-to-left-margin-of-next-line</a> <span class="Constant">0</span>/screen
|
||||
<span id="L124" class="LineNr">124 </span> <span class="Delimiter">}</span>
|
||||
<span id="L125" class="LineNr">125 </span> $check-screen-row-in-color-from:compare-colors: <span class="Delimiter">{</span>
|
||||
<span id="L126" class="LineNr">126 </span> <span class="PreProc">var</span> color/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L432'>screen-color-at-idx</a> <a href='500fake-screen.mu.html#L14'>screen</a>, idx
|
||||
<span id="L127" class="LineNr">127 </span> compare fg, color
|
||||
<span id="L128" class="LineNr">128 </span> <span class="Delimiter">{</span>
|
||||
<span id="L129" class="LineNr">129 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L130" class="LineNr">130 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">"."</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L131" class="LineNr">131 </span> <span class="PreProc">break</span> $check-screen-row-in-color-from:compare-colors
|
||||
<span id="L132" class="LineNr">132 </span> <span class="Delimiter">}</span>
|
||||
<span id="L133" class="LineNr">133 </span> <span class="muComment"># otherwise print an error</span>
|
||||
<span id="L134" class="LineNr">134 </span> <a href='104test.subx.html#L5'>count-test-failure</a>
|
||||
<span id="L135" class="LineNr">135 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, msg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L136" class="LineNr">136 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">": expected '"</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L137" class="LineNr">137 </span> <a href='501draw-text.mu.html#L84'>draw-grapheme-at-cursor</a> <span class="Constant">0</span>/screen, expected-grapheme, <span class="Constant">3</span>/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L138" class="LineNr">138 </span> <a href='501draw-text.mu.html#L242'>move-cursor-rightward-and-downward</a> <span class="Constant">0</span>/screen, <span class="Constant">0</span>/xmin, <span class="Constant">0x80</span>/xmax=screen-width
|
||||
<span id="L139" class="LineNr">139 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">"' at ("</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L140" class="LineNr">140 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, x, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L141" class="LineNr">141 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">", "</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L142" class="LineNr">142 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, y, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L143" class="LineNr">143 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">") in color "</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L144" class="LineNr">144 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, fg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L145" class="LineNr">145 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">" but observed color "</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L146" class="LineNr">146 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, color, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L147" class="LineNr">147 </span> <a href='501draw-text.mu.html#L65'>move-cursor-to-left-margin-of-next-line</a> <span class="Constant">0</span>/screen
|
||||
<span id="L148" class="LineNr">148 </span> <span class="Delimiter">}</span>
|
||||
<span id="L149" class="LineNr">149 </span> <span class="Delimiter">}</span>
|
||||
<span id="L150" class="LineNr">150 </span> idx <span class="Special"><-</span> increment
|
||||
<span id="L151" class="LineNr">151 </span> increment x
|
||||
<span id="L152" class="LineNr">152 </span> <span class="PreProc">loop</span>
|
||||
<span id="L153" class="LineNr">153 </span> <span class="Delimiter">}</span>
|
||||
<span id="L154" class="LineNr">154 </span><span class="Delimiter">}</span>
|
||||
<span id="L155" class="LineNr">155 </span>
|
||||
<span id="L156" class="LineNr">156 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='504test-screen.mu.html#L156'>check-screen-row-in-background-color</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), bg: int, y: int, expected: (addr array byte), msg: (addr array byte) <span class="Delimiter">{</span>
|
||||
<span id="L157" class="LineNr">157 </span> <a href='504test-screen.mu.html#L160'>check-screen-row-in-background-color-from</a> <a href='500fake-screen.mu.html#L14'>screen</a>, bg, y, <span class="Constant">0</span>/x, expected, msg
|
||||
<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="PreProc">fn</span> <span class="muFunction"><a href='504test-screen.mu.html#L160'>check-screen-row-in-background-color-from</a></span> screen-on-stack: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), bg: int, y: int, x: int, expected: (addr array byte), msg: (addr array byte) <span class="Delimiter">{</span>
|
||||
<span id="L161" class="LineNr">161 </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"><-</span> copy screen-on-stack
|
||||
<span id="L162" class="LineNr">162 </span> <span class="PreProc">var</span> idx/<span class="Constant">ecx</span>: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L120'>screen-cell-index</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y
|
||||
<span id="L163" class="LineNr">163 </span> <span class="muComment"># compare 'expected' with the screen contents starting at 'idx', grapheme by grapheme</span>
|
||||
<span id="L164" class="LineNr">164 </span> <span class="PreProc">var</span> e: (stream byte <span class="Constant">0x100</span>)
|
||||
<span id="L165" class="LineNr">165 </span> <span class="PreProc">var</span> e-addr/<span class="Constant">edx</span>: (addr stream byte) <span class="Special"><-</span> address e
|
||||
<span id="L166" class="LineNr">166 </span> <a href='108write.subx.html#L11'>write</a> e-addr, expected
|
||||
<span id="L167" class="LineNr">167 </span> <span class="Delimiter">{</span>
|
||||
<span id="L168" class="LineNr">168 </span> <span class="PreProc">var</span> done?/<span class="Constant">eax</span>: boolean <span class="Special"><-</span> <a href='309stream.subx.html#L6'>stream-empty?</a> e-addr
|
||||
<span id="L169" class="LineNr">169 </span> compare done?, <span class="Constant">0</span>
|
||||
<span id="L170" class="LineNr">170 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L171" class="LineNr">171 </span> <span class="PreProc">var</span> _g/<span class="Constant">eax</span>: grapheme <span class="Special"><-</span> <a href='500fake-screen.mu.html#L414'>screen-grapheme-at-idx</a> <a href='500fake-screen.mu.html#L14'>screen</a>, idx
|
||||
<span id="L172" class="LineNr">172 </span> <span class="PreProc">var</span> g/<span class="Constant">ebx</span>: grapheme <span class="Special"><-</span> copy _g
|
||||
<span id="L173" class="LineNr">173 </span> <span class="PreProc">var</span> _expected-grapheme/<span class="Constant">eax</span>: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> e-addr
|
||||
<span id="L174" class="LineNr">174 </span> <span class="PreProc">var</span> expected-grapheme/<span class="Constant">edi</span>: grapheme <span class="Special"><-</span> copy _expected-grapheme
|
||||
<span id="L175" class="LineNr">175 </span> $check-screen-row-in-background-color-from:compare-cells: <span class="Delimiter">{</span>
|
||||
<span id="L176" class="LineNr">176 </span> <span class="muComment"># if expected-grapheme is space, null grapheme is also ok</span>
|
||||
<span id="L177" class="LineNr">177 </span> <span class="Delimiter">{</span>
|
||||
<span id="L178" class="LineNr">178 </span> compare expected-grapheme, <span class="Constant">0x20</span>
|
||||
<span id="L179" class="LineNr">179 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L180" class="LineNr">180 </span> compare g, <span class="Constant">0</span>
|
||||
<span id="L181" class="LineNr">181 </span> <span class="PreProc">break-if-=</span> $check-screen-row-in-background-color-from:compare-cells
|
||||
<span id="L182" class="LineNr">182 </span> <span class="Delimiter">}</span>
|
||||
<span id="L183" class="LineNr">183 </span> <span class="muComment"># if expected-grapheme is space, a different background-color is ok</span>
|
||||
<span id="L184" class="LineNr">184 </span> <span class="Delimiter">{</span>
|
||||
<span id="L185" class="LineNr">185 </span> compare expected-grapheme, <span class="Constant">0x20</span>
|
||||
<span id="L186" class="LineNr">186 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L187" class="LineNr">187 </span> <span class="PreProc">var</span> background-color/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L451'>screen-background-color-at-idx</a> <a href='500fake-screen.mu.html#L14'>screen</a>, idx
|
||||
<span id="L188" class="LineNr">188 </span> compare background-color, bg
|
||||
<span id="L189" class="LineNr">189 </span> <span class="PreProc">break-if-!=</span> $check-screen-row-in-background-color-from:compare-cells
|
||||
<span id="L190" class="LineNr">190 </span> <span class="Delimiter">}</span>
|
||||
<span id="L191" class="LineNr">191 </span> <span class="muComment"># compare graphemes</span>
|
||||
<span id="L192" class="LineNr">192 </span> $check-screen-row-in-background-color-from:compare-graphemes: <span class="Delimiter">{</span>
|
||||
<span id="L193" class="LineNr">193 </span> <span class="muComment"># if (g == expected-grapheme) print "."</span>
|
||||
<span id="L194" class="LineNr">194 </span> compare g, expected-grapheme
|
||||
<span id="L195" class="LineNr">195 </span> <span class="Delimiter">{</span>
|
||||
<span id="L196" class="LineNr">196 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L197" class="LineNr">197 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">"."</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L198" class="LineNr">198 </span> <span class="PreProc">break</span> $check-screen-row-in-background-color-from:compare-graphemes
|
||||
<span id="L199" class="LineNr">199 </span> <span class="Delimiter">}</span>
|
||||
<span id="L200" class="LineNr">200 </span> <span class="muComment"># otherwise print an error</span>
|
||||
<span id="L201" class="LineNr">201 </span> <a href='104test.subx.html#L5'>count-test-failure</a>
|
||||
<span id="L202" class="LineNr">202 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, msg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L203" class="LineNr">203 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">": expected '"</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L204" class="LineNr">204 </span> <a href='501draw-text.mu.html#L84'>draw-grapheme-at-cursor</a> <span class="Constant">0</span>/screen, expected-grapheme, <span class="Constant">3</span>/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L205" class="LineNr">205 </span> <a href='501draw-text.mu.html#L242'>move-cursor-rightward-and-downward</a> <span class="Constant">0</span>/screen, <span class="Constant">0</span>/xmin, <span class="Constant">0x80</span>/xmax=screen-width
|
||||
<span id="L206" class="LineNr">206 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">"' at ("</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L207" class="LineNr">207 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, x, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L208" class="LineNr">208 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">", "</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L209" class="LineNr">209 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, y, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L210" class="LineNr">210 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">") but observed '"</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L211" class="LineNr">211 </span> <a href='501draw-text.mu.html#L84'>draw-grapheme-at-cursor</a> <span class="Constant">0</span>/screen, g, <span class="Constant">3</span>/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L212" class="LineNr">212 </span> <a href='501draw-text.mu.html#L242'>move-cursor-rightward-and-downward</a> <span class="Constant">0</span>/screen, <span class="Constant">0</span>/xmin, <span class="Constant">0x80</span>/xmax=screen-width
|
||||
<span id="L213" class="LineNr">213 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">"'"</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L214" class="LineNr">214 </span> <a href='501draw-text.mu.html#L65'>move-cursor-to-left-margin-of-next-line</a> <span class="Constant">0</span>/screen
|
||||
<span id="L215" class="LineNr">215 </span> <span class="PreProc">break</span> $check-screen-row-in-background-color-from:compare-graphemes
|
||||
<span id="L216" class="LineNr">216 </span> <span class="Delimiter">}</span>
|
||||
<span id="L217" class="LineNr">217 </span> $check-screen-row-in-background-color-from:compare-background-colors: <span class="Delimiter">{</span>
|
||||
<span id="L218" class="LineNr">218 </span> <span class="PreProc">var</span> background-color/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L451'>screen-background-color-at-idx</a> <a href='500fake-screen.mu.html#L14'>screen</a>, idx
|
||||
<span id="L219" class="LineNr">219 </span> compare bg, background-color
|
||||
<span id="L220" class="LineNr">220 </span> <span class="Delimiter">{</span>
|
||||
<span id="L221" class="LineNr">221 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L222" class="LineNr">222 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">"."</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L223" class="LineNr">223 </span> <span class="PreProc">break</span> $check-screen-row-in-background-color-from:compare-background-colors
|
||||
<span id="L224" class="LineNr">224 </span> <span class="Delimiter">}</span>
|
||||
<span id="L225" class="LineNr">225 </span> <span class="muComment"># otherwise print an error</span>
|
||||
<span id="L226" class="LineNr">226 </span> <a href='104test.subx.html#L5'>count-test-failure</a>
|
||||
<span id="L227" class="LineNr">227 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, msg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L228" class="LineNr">228 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">": expected '"</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L229" class="LineNr">229 </span> <a href='501draw-text.mu.html#L84'>draw-grapheme-at-cursor</a> <span class="Constant">0</span>/screen, expected-grapheme, <span class="Constant">3</span>/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L230" class="LineNr">230 </span> <a href='501draw-text.mu.html#L242'>move-cursor-rightward-and-downward</a> <span class="Constant">0</span>/screen, <span class="Constant">0</span>/xmin, <span class="Constant">0x80</span>/xmax=screen-width
|
||||
<span id="L231" class="LineNr">231 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">"' at ("</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L232" class="LineNr">232 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, x, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L233" class="LineNr">233 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">", "</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L234" class="LineNr">234 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, y, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L235" class="LineNr">235 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">") in background-color "</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L236" class="LineNr">236 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, bg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L237" class="LineNr">237 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">" but observed background-color "</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L238" class="LineNr">238 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, background-color, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L239" class="LineNr">239 </span> <a href='501draw-text.mu.html#L65'>move-cursor-to-left-margin-of-next-line</a> <span class="Constant">0</span>/screen
|
||||
<span id="L240" class="LineNr">240 </span> <span class="Delimiter">}</span>
|
||||
<span id="L241" class="LineNr">241 </span> <span class="Delimiter">}</span>
|
||||
<span id="L242" class="LineNr">242 </span> idx <span class="Special"><-</span> increment
|
||||
<span id="L243" class="LineNr">243 </span> increment x
|
||||
<span id="L244" class="LineNr">244 </span> <span class="PreProc">loop</span>
|
||||
<span id="L245" class="LineNr">245 </span> <span class="Delimiter">}</span>
|
||||
<span id="L246" class="LineNr">246 </span><span class="Delimiter">}</span>
|
||||
<span id="L247" class="LineNr">247 </span>
|
||||
<span id="L248" class="LineNr">248 </span><span class="muComment"># helpers for checking just background color, not screen contents</span>
|
||||
<span id="L249" class="LineNr">249 </span><span class="muComment"># these can validate bg for spaces</span>
|
||||
<span id="L250" class="LineNr">250 </span>
|
||||
<span id="L251" class="LineNr">251 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='504test-screen.mu.html#L251'>check-background-color-in-screen-row</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), bg: int, y: int, expected-bitmap: (addr array byte), msg: (addr array byte) <span class="Delimiter">{</span>
|
||||
<span id="L252" class="LineNr">252 </span> <a href='504test-screen.mu.html#L255'>check-background-color-in-screen-row-from</a> <a href='500fake-screen.mu.html#L14'>screen</a>, bg, y, <span class="Constant">0</span>/x, expected-bitmap, msg
|
||||
<span id="L253" class="LineNr">253 </span><span class="Delimiter">}</span>
|
||||
<span id="L254" class="LineNr">254 </span>
|
||||
<span id="L255" class="LineNr">255 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='504test-screen.mu.html#L255'>check-background-color-in-screen-row-from</a></span> screen-on-stack: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), bg: int, y: int, x: int, expected-bitmap: (addr array byte), msg: (addr array byte) <span class="Delimiter">{</span>
|
||||
<span id="L256" class="LineNr">256 </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"><-</span> copy screen-on-stack
|
||||
<span id="L257" class="LineNr">257 </span> <span class="PreProc">var</span> idx/<span class="Constant">ecx</span>: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L120'>screen-cell-index</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y
|
||||
<span id="L258" class="LineNr">258 </span> <span class="muComment"># compare background color where 'expected-bitmap' is a non-space</span>
|
||||
<span id="L259" class="LineNr">259 </span> <span class="PreProc">var</span> e: (stream byte <span class="Constant">0x100</span>)
|
||||
<span id="L260" class="LineNr">260 </span> <span class="PreProc">var</span> e-addr/<span class="Constant">edx</span>: (addr stream byte) <span class="Special"><-</span> address e
|
||||
<span id="L261" class="LineNr">261 </span> <a href='108write.subx.html#L11'>write</a> e-addr, expected-bitmap
|
||||
<span id="L262" class="LineNr">262 </span> <span class="Delimiter">{</span>
|
||||
<span id="L263" class="LineNr">263 </span> <span class="PreProc">var</span> done?/<span class="Constant">eax</span>: boolean <span class="Special"><-</span> <a href='309stream.subx.html#L6'>stream-empty?</a> e-addr
|
||||
<span id="L264" class="LineNr">264 </span> compare done?, <span class="Constant">0</span>
|
||||
<span id="L265" class="LineNr">265 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L266" class="LineNr">266 </span> <span class="PreProc">var</span> _expected-bit/<span class="Constant">eax</span>: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> e-addr
|
||||
<span id="L267" class="LineNr">267 </span> <span class="PreProc">var</span> expected-bit/<span class="Constant">edi</span>: grapheme <span class="Special"><-</span> copy _expected-bit
|
||||
<span id="L268" class="LineNr">268 </span> $check-background-color-in-screen-row-from:compare-cells: <span class="Delimiter">{</span>
|
||||
<span id="L269" class="LineNr">269 </span> <span class="PreProc">var</span> background-color/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L451'>screen-background-color-at-idx</a> <a href='500fake-screen.mu.html#L14'>screen</a>, idx
|
||||
<span id="L270" class="LineNr">270 </span> <span class="muComment"># if expected-bit is space, assert that background is NOT bg</span>
|
||||
<span id="L271" class="LineNr">271 </span> compare expected-bit, <span class="Constant">0x20</span>
|
||||
<span id="L272" class="LineNr">272 </span> <span class="Delimiter">{</span>
|
||||
<span id="L273" class="LineNr">273 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L274" class="LineNr">274 </span> compare background-color, bg
|
||||
<span id="L275" class="LineNr">275 </span> <span class="PreProc">break-if-!=</span> $check-background-color-in-screen-row-from:compare-cells
|
||||
<span id="L276" class="LineNr">276 </span> <a href='104test.subx.html#L5'>count-test-failure</a>
|
||||
<span id="L277" class="LineNr">277 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, msg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L278" class="LineNr">278 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">": expected ("</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L279" class="LineNr">279 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, x, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L280" class="LineNr">280 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">", "</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L281" class="LineNr">281 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, y, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L282" class="LineNr">282 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">") to not be in background-color "</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L283" class="LineNr">283 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, bg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L284" class="LineNr">284 </span> <a href='501draw-text.mu.html#L65'>move-cursor-to-left-margin-of-next-line</a> <span class="Constant">0</span>/screen
|
||||
<span id="L285" class="LineNr">285 </span> <span class="PreProc">break</span> $check-background-color-in-screen-row-from:compare-cells
|
||||
<span id="L286" class="LineNr">286 </span> <span class="Delimiter">}</span>
|
||||
<span id="L287" class="LineNr">287 </span> <span class="muComment"># otherwise assert that background IS bg</span>
|
||||
<span id="L288" class="LineNr">288 </span> compare background-color, bg
|
||||
<span id="L289" class="LineNr">289 </span> <span class="PreProc">break-if-=</span> $check-background-color-in-screen-row-from:compare-cells
|
||||
<span id="L290" class="LineNr">290 </span> <a href='104test.subx.html#L5'>count-test-failure</a>
|
||||
<span id="L291" class="LineNr">291 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, msg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L292" class="LineNr">292 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">": expected ("</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L293" class="LineNr">293 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, x, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L294" class="LineNr">294 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">", "</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L295" class="LineNr">295 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, y, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L296" class="LineNr">296 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">") in background-color "</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L297" class="LineNr">297 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, bg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L298" class="LineNr">298 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">" but observed background-color "</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L299" class="LineNr">299 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, background-color, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L300" class="LineNr">300 </span> <a href='501draw-text.mu.html#L65'>move-cursor-to-left-margin-of-next-line</a> <span class="Constant">0</span>/screen
|
||||
<span id="L301" class="LineNr">301 </span> <span class="Delimiter">}</span>
|
||||
<span id="L302" class="LineNr">302 </span> idx <span class="Special"><-</span> increment
|
||||
<span id="L303" class="LineNr">303 </span> increment x
|
||||
<span id="L304" class="LineNr">304 </span> <span class="PreProc">loop</span>
|
||||
<span id="L305" class="LineNr">305 </span> <span class="Delimiter">}</span>
|
||||
<span id="L306" class="LineNr">306 </span><span class="Delimiter">}</span>
|
||||
<span id="L307" class="LineNr">307 </span>
|
||||
<span id="L308" class="LineNr">308 </span><span class="PreProc">fn</span> <span class="muTest"><a href='504test-screen.mu.html#L308'>test-draw-single-grapheme</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L309" class="LineNr">309 </span> <span class="PreProc">var</span> screen-on-stack: <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L310" class="LineNr">310 </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"><-</span> address screen-on-stack
|
||||
<span id="L311" class="LineNr">311 </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="L312" class="LineNr">312 </span> <a href='500fake-screen.mu.html#L114'>draw-code-point</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x61</span>/a, <span class="Constant">0</span>/x, <span class="Constant">0</span>/y, <span class="Constant">1</span>/fg, <span class="Constant">2</span>/bg
|
||||
<span id="L313" class="LineNr">313 </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">"a"</span>, <span class="Constant">"F - test-draw-single-grapheme"</span> <span class="muComment"># top-left corner of the screen</span>
|
||||
<span id="L314" class="LineNr">314 </span> <a href='504test-screen.mu.html#L65'>check-screen-row-in-color</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">1</span>/fg, <span class="Constant">0</span>/y, <span class="Constant">"a"</span>, <span class="Constant">"F - test-draw-single-grapheme-fg"</span>
|
||||
<span id="L315" class="LineNr">315 </span> <a href='504test-screen.mu.html#L156'>check-screen-row-in-background-color</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/bg, <span class="Constant">0</span>/y, <span class="Constant">"a"</span>, <span class="Constant">"F - test-draw-single-grapheme-bg"</span>
|
||||
<span id="L316" class="LineNr">316 </span> <a href='504test-screen.mu.html#L251'>check-background-color-in-screen-row</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/bg, <span class="Constant">0</span>/y, <span class="Constant">"x "</span>, <span class="Constant">"F - test-draw-single-grapheme-bg2"</span>
|
||||
<span id="L317" class="LineNr">317 </span><span class="Delimiter">}</span>
|
||||
<span id="L318" class="LineNr">318 </span>
|
||||
<span id="L319" class="LineNr">319 </span><span class="PreProc">fn</span> <span class="muTest"><a href='504test-screen.mu.html#L319'>test-draw-multiple-graphemes</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L320" class="LineNr">320 </span> <span class="PreProc">var</span> screen-on-stack: <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L321" class="LineNr">321 </span> <span class="PreProc">var</span> <a href='500fake-screen.mu.html#L14'>screen</a>/<span class="Constant">esi</span>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>) <span class="Special"><-</span> address screen-on-stack
|
||||
<span id="L322" class="LineNr">322 </span> <a href='500fake-screen.mu.html#L31'>initialize-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x10</span>/rows, <span class="Constant">4</span>/cols, <span class="Constant">0</span>/no-pixel-graphics
|
||||
<span id="L323" class="LineNr">323 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">"Hello, 世界"</span>, <span class="Constant">1</span>/fg, <span class="Constant">2</span>/bg
|
||||
<span id="L324" class="LineNr">324 </span> <a href='504test-screen.mu.html#L7'>check-screen-row</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0</span>/y, <span class="Constant">"Hello, 世界"</span>, <span class="Constant">"F - test-draw-multiple-graphemes"</span>
|
||||
<span id="L325" class="LineNr">325 </span> <a href='504test-screen.mu.html#L65'>check-screen-row-in-color</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">1</span>/fg, <span class="Constant">0</span>/y, <span class="Constant">"Hello, 世界"</span>, <span class="Constant">"F - test-draw-multiple-graphemes-fg"</span>
|
||||
<span id="L326" class="LineNr">326 </span> <a href='504test-screen.mu.html#L251'>check-background-color-in-screen-row</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/bg, <span class="Constant">0</span>/y, <span class="Constant">"xxxxxxxxx "</span>, <span class="Constant">"F - test-draw-multiple-graphemes-bg2"</span>
|
||||
<span id="L327" class="LineNr">327 </span><span class="Delimiter">}</span>
|
||||
<span id="L69" class="LineNr"> 69 </span><span class="muComment"># various variants by screen-cell attribute; spaces in the 'expected' data should not match the attribute</span>
|
||||
<span id="L70" class="LineNr"> 70 </span>
|
||||
<span id="L71" class="LineNr"> 71 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='504test-screen.mu.html#L71'>check-screen-row-in-color</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), fg: int, y: int, expected: (addr array byte), msg: (addr array byte) <span class="Delimiter">{</span>
|
||||
<span id="L72" class="LineNr"> 72 </span> <a href='504test-screen.mu.html#L75'>check-screen-row-in-color-from</a> <a href='500fake-screen.mu.html#L14'>screen</a>, fg, y, <span class="Constant">0</span>/x, expected, msg
|
||||
<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='504test-screen.mu.html#L75'>check-screen-row-in-color-from</a></span> screen-on-stack: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), fg: int, y: int, x: int, expected: (addr array byte), msg: (addr array byte) <span class="Delimiter">{</span>
|
||||
<span id="L76" class="LineNr"> 76 </span> <span class="PreProc">var</span> <a href='500fake-screen.mu.html#L14'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>) <span class="Special"><-</span> copy screen-on-stack
|
||||
<span id="L77" class="LineNr"> 77 </span> <span class="PreProc">var</span> idx/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L136'>screen-cell-index</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y
|
||||
<span id="L78" class="LineNr"> 78 </span> <span class="muComment"># compare 'expected' with the screen contents starting at 'idx', grapheme by grapheme</span>
|
||||
<span id="L79" class="LineNr"> 79 </span> <span class="PreProc">var</span> e: (stream byte <span class="Constant">0x100</span>)
|
||||
<span id="L80" class="LineNr"> 80 </span> <span class="PreProc">var</span> e-addr/<span class="muRegEdx">edx</span>: (addr stream byte) <span class="Special"><-</span> address e
|
||||
<span id="L81" class="LineNr"> 81 </span> <a href='108write.subx.html#L11'>write</a> e-addr, expected
|
||||
<span id="L82" class="LineNr"> 82 </span> <span class="Delimiter">{</span>
|
||||
<span id="L83" class="LineNr"> 83 </span> <span class="PreProc">var</span> done?/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='309stream.subx.html#L6'>stream-empty?</a> e-addr
|
||||
<span id="L84" class="LineNr"> 84 </span> compare done?, <span class="Constant">0</span>
|
||||
<span id="L85" class="LineNr"> 85 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L86" class="LineNr"> 86 </span> <span class="PreProc">var</span> _g/<span class="muRegEax">eax</span>: grapheme <span class="Special"><-</span> <a href='500fake-screen.mu.html#L434'>screen-grapheme-at-idx</a> <a href='500fake-screen.mu.html#L14'>screen</a>, idx
|
||||
<span id="L87" class="LineNr"> 87 </span> <span class="PreProc">var</span> g/<span class="muRegEbx">ebx</span>: grapheme <span class="Special"><-</span> copy _g
|
||||
<span id="L88" class="LineNr"> 88 </span> <span class="PreProc">var</span> _expected-grapheme/<span class="muRegEax">eax</span>: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> e-addr
|
||||
<span id="L89" class="LineNr"> 89 </span> <span class="PreProc">var</span> expected-grapheme/<span class="muRegEdi">edi</span>: grapheme <span class="Special"><-</span> copy _expected-grapheme
|
||||
<span id="L90" class="LineNr"> 90 </span> $check-screen-row-in-color-from:compare-cells: <span class="Delimiter">{</span>
|
||||
<span id="L91" class="LineNr"> 91 </span> <span class="muComment"># if expected-grapheme is space, null grapheme is also ok</span>
|
||||
<span id="L92" class="LineNr"> 92 </span> <span class="Delimiter">{</span>
|
||||
<span id="L93" class="LineNr"> 93 </span> compare expected-grapheme, <span class="Constant">0x20</span>
|
||||
<span id="L94" class="LineNr"> 94 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L95" class="LineNr"> 95 </span> compare g, <span class="Constant">0</span>
|
||||
<span id="L96" class="LineNr"> 96 </span> <span class="PreProc">break-if-=</span> $check-screen-row-in-color-from:compare-cells
|
||||
<span id="L97" class="LineNr"> 97 </span> <span class="Delimiter">}</span>
|
||||
<span id="L98" class="LineNr"> 98 </span> <span class="muComment"># if expected-grapheme is space, a different color is ok</span>
|
||||
<span id="L99" class="LineNr"> 99 </span> <span class="Delimiter">{</span>
|
||||
<span id="L100" class="LineNr">100 </span> compare expected-grapheme, <span class="Constant">0x20</span>
|
||||
<span id="L101" class="LineNr">101 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L102" class="LineNr">102 </span> <span class="PreProc">var</span> color/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L452'>screen-color-at-idx</a> <a href='500fake-screen.mu.html#L14'>screen</a>, idx
|
||||
<span id="L103" class="LineNr">103 </span> compare color, fg
|
||||
<span id="L104" class="LineNr">104 </span> <span class="PreProc">break-if-!=</span> $check-screen-row-in-color-from:compare-cells
|
||||
<span id="L105" class="LineNr">105 </span> <span class="Delimiter">}</span>
|
||||
<span id="L106" class="LineNr">106 </span> <span class="muComment"># compare graphemes</span>
|
||||
<span id="L107" class="LineNr">107 </span> $check-screen-row-in-color-from:compare-graphemes: <span class="Delimiter">{</span>
|
||||
<span id="L108" class="LineNr">108 </span> <span class="muComment"># if (g == expected-grapheme) print "."</span>
|
||||
<span id="L109" class="LineNr">109 </span> compare g, expected-grapheme
|
||||
<span id="L110" class="LineNr">110 </span> <span class="Delimiter">{</span>
|
||||
<span id="L111" class="LineNr">111 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L112" class="LineNr">112 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">"."</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L113" class="LineNr">113 </span> <span class="PreProc">break</span> $check-screen-row-in-color-from:compare-graphemes
|
||||
<span id="L114" class="LineNr">114 </span> <span class="Delimiter">}</span>
|
||||
<span id="L115" class="LineNr">115 </span> <span class="muComment"># otherwise print an error</span>
|
||||
<span id="L116" class="LineNr">116 </span> <a href='104test.subx.html#L5'>count-test-failure</a>
|
||||
<span id="L117" class="LineNr">117 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, msg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L118" class="LineNr">118 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">": expected '"</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L119" class="LineNr">119 </span> <a href='501draw-text.mu.html#L84'>draw-grapheme-at-cursor</a> <span class="Constant">0</span>/screen, expected-grapheme, <span class="Constant">3</span>/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L120" class="LineNr">120 </span> <a href='501draw-text.mu.html#L242'>move-cursor-rightward-and-downward</a> <span class="Constant">0</span>/screen, <span class="Constant">0</span>/xmin, <span class="Constant">0x80</span>/xmax=screen-width
|
||||
<span id="L121" class="LineNr">121 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">"' at ("</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L122" class="LineNr">122 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, x, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L123" class="LineNr">123 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">", "</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L124" class="LineNr">124 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, y, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L125" class="LineNr">125 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">") but observed '"</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L126" class="LineNr">126 </span> <a href='501draw-text.mu.html#L84'>draw-grapheme-at-cursor</a> <span class="Constant">0</span>/screen, g, <span class="Constant">3</span>/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L127" class="LineNr">127 </span> <a href='501draw-text.mu.html#L242'>move-cursor-rightward-and-downward</a> <span class="Constant">0</span>/screen, <span class="Constant">0</span>/xmin, <span class="Constant">0x80</span>/xmax=screen-width
|
||||
<span id="L128" class="LineNr">128 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">"'"</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L129" class="LineNr">129 </span> <a href='501draw-text.mu.html#L65'>move-cursor-to-left-margin-of-next-line</a> <span class="Constant">0</span>/screen
|
||||
<span id="L130" class="LineNr">130 </span> <span class="Delimiter">}</span>
|
||||
<span id="L131" class="LineNr">131 </span> $check-screen-row-in-color-from:compare-colors: <span class="Delimiter">{</span>
|
||||
<span id="L132" class="LineNr">132 </span> <span class="PreProc">var</span> color/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L452'>screen-color-at-idx</a> <a href='500fake-screen.mu.html#L14'>screen</a>, idx
|
||||
<span id="L133" class="LineNr">133 </span> compare fg, color
|
||||
<span id="L134" class="LineNr">134 </span> <span class="Delimiter">{</span>
|
||||
<span id="L135" class="LineNr">135 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L136" class="LineNr">136 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">"."</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L137" class="LineNr">137 </span> <span class="PreProc">break</span> $check-screen-row-in-color-from:compare-colors
|
||||
<span id="L138" class="LineNr">138 </span> <span class="Delimiter">}</span>
|
||||
<span id="L139" class="LineNr">139 </span> <span class="muComment"># otherwise print an error</span>
|
||||
<span id="L140" class="LineNr">140 </span> <a href='104test.subx.html#L5'>count-test-failure</a>
|
||||
<span id="L141" class="LineNr">141 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, msg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L142" class="LineNr">142 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">": expected '"</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L143" class="LineNr">143 </span> <a href='501draw-text.mu.html#L84'>draw-grapheme-at-cursor</a> <span class="Constant">0</span>/screen, expected-grapheme, <span class="Constant">3</span>/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L144" class="LineNr">144 </span> <a href='501draw-text.mu.html#L242'>move-cursor-rightward-and-downward</a> <span class="Constant">0</span>/screen, <span class="Constant">0</span>/xmin, <span class="Constant">0x80</span>/xmax=screen-width
|
||||
<span id="L145" class="LineNr">145 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">"' at ("</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L146" class="LineNr">146 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, x, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L147" class="LineNr">147 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">", "</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L148" class="LineNr">148 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, y, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L149" class="LineNr">149 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">") in color "</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L150" class="LineNr">150 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, fg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L151" class="LineNr">151 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">" but observed color "</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L152" class="LineNr">152 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, color, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L153" class="LineNr">153 </span> <a href='501draw-text.mu.html#L65'>move-cursor-to-left-margin-of-next-line</a> <span class="Constant">0</span>/screen
|
||||
<span id="L154" class="LineNr">154 </span> <span class="Delimiter">}</span>
|
||||
<span id="L155" class="LineNr">155 </span> <span class="Delimiter">}</span>
|
||||
<span id="L156" class="LineNr">156 </span> idx <span class="Special"><-</span> increment
|
||||
<span id="L157" class="LineNr">157 </span> increment x
|
||||
<span id="L158" class="LineNr">158 </span> <span class="PreProc">loop</span>
|
||||
<span id="L159" class="LineNr">159 </span> <span class="Delimiter">}</span>
|
||||
<span id="L160" class="LineNr">160 </span><span class="Delimiter">}</span>
|
||||
<span id="L161" class="LineNr">161 </span>
|
||||
<span id="L162" class="LineNr">162 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='504test-screen.mu.html#L162'>check-screen-row-in-background-color</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), bg: int, y: int, expected: (addr array byte), msg: (addr array byte) <span class="Delimiter">{</span>
|
||||
<span id="L163" class="LineNr">163 </span> <a href='504test-screen.mu.html#L166'>check-screen-row-in-background-color-from</a> <a href='500fake-screen.mu.html#L14'>screen</a>, bg, y, <span class="Constant">0</span>/x, expected, msg
|
||||
<span id="L164" class="LineNr">164 </span><span class="Delimiter">}</span>
|
||||
<span id="L165" class="LineNr">165 </span>
|
||||
<span id="L166" class="LineNr">166 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='504test-screen.mu.html#L166'>check-screen-row-in-background-color-from</a></span> screen-on-stack: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), bg: int, y: int, x: int, expected: (addr array byte), msg: (addr array byte) <span class="Delimiter">{</span>
|
||||
<span id="L167" class="LineNr">167 </span> <span class="PreProc">var</span> <a href='500fake-screen.mu.html#L14'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>) <span class="Special"><-</span> copy screen-on-stack
|
||||
<span id="L168" class="LineNr">168 </span> <span class="PreProc">var</span> idx/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L136'>screen-cell-index</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y
|
||||
<span id="L169" class="LineNr">169 </span> <span class="muComment"># compare 'expected' with the screen contents starting at 'idx', grapheme by grapheme</span>
|
||||
<span id="L170" class="LineNr">170 </span> <span class="PreProc">var</span> e: (stream byte <span class="Constant">0x100</span>)
|
||||
<span id="L171" class="LineNr">171 </span> <span class="PreProc">var</span> e-addr/<span class="muRegEdx">edx</span>: (addr stream byte) <span class="Special"><-</span> address e
|
||||
<span id="L172" class="LineNr">172 </span> <a href='108write.subx.html#L11'>write</a> e-addr, expected
|
||||
<span id="L173" class="LineNr">173 </span> <span class="Delimiter">{</span>
|
||||
<span id="L174" class="LineNr">174 </span> <span class="PreProc">var</span> done?/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='309stream.subx.html#L6'>stream-empty?</a> e-addr
|
||||
<span id="L175" class="LineNr">175 </span> compare done?, <span class="Constant">0</span>
|
||||
<span id="L176" class="LineNr">176 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L177" class="LineNr">177 </span> <span class="PreProc">var</span> _g/<span class="muRegEax">eax</span>: grapheme <span class="Special"><-</span> <a href='500fake-screen.mu.html#L434'>screen-grapheme-at-idx</a> <a href='500fake-screen.mu.html#L14'>screen</a>, idx
|
||||
<span id="L178" class="LineNr">178 </span> <span class="PreProc">var</span> g/<span class="muRegEbx">ebx</span>: grapheme <span class="Special"><-</span> copy _g
|
||||
<span id="L179" class="LineNr">179 </span> <span class="PreProc">var</span> _expected-grapheme/<span class="muRegEax">eax</span>: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> e-addr
|
||||
<span id="L180" class="LineNr">180 </span> <span class="PreProc">var</span> expected-grapheme/<span class="muRegEdi">edi</span>: grapheme <span class="Special"><-</span> copy _expected-grapheme
|
||||
<span id="L181" class="LineNr">181 </span> $check-screen-row-in-background-color-from:compare-cells: <span class="Delimiter">{</span>
|
||||
<span id="L182" class="LineNr">182 </span> <span class="muComment"># if expected-grapheme is space, null grapheme is also ok</span>
|
||||
<span id="L183" class="LineNr">183 </span> <span class="Delimiter">{</span>
|
||||
<span id="L184" class="LineNr">184 </span> compare expected-grapheme, <span class="Constant">0x20</span>
|
||||
<span id="L185" class="LineNr">185 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L186" class="LineNr">186 </span> compare g, <span class="Constant">0</span>
|
||||
<span id="L187" class="LineNr">187 </span> <span class="PreProc">break-if-=</span> $check-screen-row-in-background-color-from:compare-cells
|
||||
<span id="L188" class="LineNr">188 </span> <span class="Delimiter">}</span>
|
||||
<span id="L189" class="LineNr">189 </span> <span class="muComment"># if expected-grapheme is space, a different background-color is ok</span>
|
||||
<span id="L190" class="LineNr">190 </span> <span class="Delimiter">{</span>
|
||||
<span id="L191" class="LineNr">191 </span> compare expected-grapheme, <span class="Constant">0x20</span>
|
||||
<span id="L192" class="LineNr">192 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L193" class="LineNr">193 </span> <span class="PreProc">var</span> background-color/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L471'>screen-background-color-at-idx</a> <a href='500fake-screen.mu.html#L14'>screen</a>, idx
|
||||
<span id="L194" class="LineNr">194 </span> compare background-color, bg
|
||||
<span id="L195" class="LineNr">195 </span> <span class="PreProc">break-if-!=</span> $check-screen-row-in-background-color-from:compare-cells
|
||||
<span id="L196" class="LineNr">196 </span> <span class="Delimiter">}</span>
|
||||
<span id="L197" class="LineNr">197 </span> <span class="muComment"># compare graphemes</span>
|
||||
<span id="L198" class="LineNr">198 </span> $check-screen-row-in-background-color-from:compare-graphemes: <span class="Delimiter">{</span>
|
||||
<span id="L199" class="LineNr">199 </span> <span class="muComment"># if (g == expected-grapheme) print "."</span>
|
||||
<span id="L200" class="LineNr">200 </span> compare g, expected-grapheme
|
||||
<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> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">"."</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L204" class="LineNr">204 </span> <span class="PreProc">break</span> $check-screen-row-in-background-color-from:compare-graphemes
|
||||
<span id="L205" class="LineNr">205 </span> <span class="Delimiter">}</span>
|
||||
<span id="L206" class="LineNr">206 </span> <span class="muComment"># otherwise print an error</span>
|
||||
<span id="L207" class="LineNr">207 </span> <a href='104test.subx.html#L5'>count-test-failure</a>
|
||||
<span id="L208" class="LineNr">208 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, msg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L209" class="LineNr">209 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">": expected '"</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L210" class="LineNr">210 </span> <a href='501draw-text.mu.html#L84'>draw-grapheme-at-cursor</a> <span class="Constant">0</span>/screen, expected-grapheme, <span class="Constant">3</span>/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L211" class="LineNr">211 </span> <a href='501draw-text.mu.html#L242'>move-cursor-rightward-and-downward</a> <span class="Constant">0</span>/screen, <span class="Constant">0</span>/xmin, <span class="Constant">0x80</span>/xmax=screen-width
|
||||
<span id="L212" class="LineNr">212 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">"' at ("</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L213" class="LineNr">213 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, x, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L214" class="LineNr">214 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">", "</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L215" class="LineNr">215 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, y, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L216" class="LineNr">216 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">") but observed '"</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L217" class="LineNr">217 </span> <a href='501draw-text.mu.html#L84'>draw-grapheme-at-cursor</a> <span class="Constant">0</span>/screen, g, <span class="Constant">3</span>/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L218" class="LineNr">218 </span> <a href='501draw-text.mu.html#L242'>move-cursor-rightward-and-downward</a> <span class="Constant">0</span>/screen, <span class="Constant">0</span>/xmin, <span class="Constant">0x80</span>/xmax=screen-width
|
||||
<span id="L219" class="LineNr">219 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">"'"</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L220" class="LineNr">220 </span> <a href='501draw-text.mu.html#L65'>move-cursor-to-left-margin-of-next-line</a> <span class="Constant">0</span>/screen
|
||||
<span id="L221" class="LineNr">221 </span> <span class="PreProc">break</span> $check-screen-row-in-background-color-from:compare-graphemes
|
||||
<span id="L222" class="LineNr">222 </span> <span class="Delimiter">}</span>
|
||||
<span id="L223" class="LineNr">223 </span> $check-screen-row-in-background-color-from:compare-background-colors: <span class="Delimiter">{</span>
|
||||
<span id="L224" class="LineNr">224 </span> <span class="PreProc">var</span> background-color/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L471'>screen-background-color-at-idx</a> <a href='500fake-screen.mu.html#L14'>screen</a>, idx
|
||||
<span id="L225" class="LineNr">225 </span> compare bg, background-color
|
||||
<span id="L226" class="LineNr">226 </span> <span class="Delimiter">{</span>
|
||||
<span id="L227" class="LineNr">227 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L228" class="LineNr">228 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">"."</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L229" class="LineNr">229 </span> <span class="PreProc">break</span> $check-screen-row-in-background-color-from:compare-background-colors
|
||||
<span id="L230" class="LineNr">230 </span> <span class="Delimiter">}</span>
|
||||
<span id="L231" class="LineNr">231 </span> <span class="muComment"># otherwise print an error</span>
|
||||
<span id="L232" class="LineNr">232 </span> <a href='104test.subx.html#L5'>count-test-failure</a>
|
||||
<span id="L233" class="LineNr">233 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, msg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L234" class="LineNr">234 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">": expected '"</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L235" class="LineNr">235 </span> <a href='501draw-text.mu.html#L84'>draw-grapheme-at-cursor</a> <span class="Constant">0</span>/screen, expected-grapheme, <span class="Constant">3</span>/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L236" class="LineNr">236 </span> <a href='501draw-text.mu.html#L242'>move-cursor-rightward-and-downward</a> <span class="Constant">0</span>/screen, <span class="Constant">0</span>/xmin, <span class="Constant">0x80</span>/xmax=screen-width
|
||||
<span id="L237" class="LineNr">237 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">"' at ("</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L238" class="LineNr">238 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, x, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L239" class="LineNr">239 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">", "</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L240" class="LineNr">240 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, y, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L241" class="LineNr">241 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">") in background-color "</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L242" class="LineNr">242 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, bg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L243" class="LineNr">243 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">" but observed background-color "</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L244" class="LineNr">244 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, background-color, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L245" class="LineNr">245 </span> <a href='501draw-text.mu.html#L65'>move-cursor-to-left-margin-of-next-line</a> <span class="Constant">0</span>/screen
|
||||
<span id="L246" class="LineNr">246 </span> <span class="Delimiter">}</span>
|
||||
<span id="L247" class="LineNr">247 </span> <span class="Delimiter">}</span>
|
||||
<span id="L248" class="LineNr">248 </span> idx <span class="Special"><-</span> increment
|
||||
<span id="L249" class="LineNr">249 </span> increment x
|
||||
<span id="L250" class="LineNr">250 </span> <span class="PreProc">loop</span>
|
||||
<span id="L251" class="LineNr">251 </span> <span class="Delimiter">}</span>
|
||||
<span id="L252" class="LineNr">252 </span><span class="Delimiter">}</span>
|
||||
<span id="L253" class="LineNr">253 </span>
|
||||
<span id="L254" class="LineNr">254 </span><span class="muComment"># helpers for checking just background color, not screen contents</span>
|
||||
<span id="L255" class="LineNr">255 </span><span class="muComment"># these can validate bg for spaces</span>
|
||||
<span id="L256" class="LineNr">256 </span>
|
||||
<span id="L257" class="LineNr">257 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='504test-screen.mu.html#L257'>check-background-color-in-screen-row</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), bg: int, y: int, expected-bitmap: (addr array byte), msg: (addr array byte) <span class="Delimiter">{</span>
|
||||
<span id="L258" class="LineNr">258 </span> <a href='504test-screen.mu.html#L261'>check-background-color-in-screen-row-from</a> <a href='500fake-screen.mu.html#L14'>screen</a>, bg, y, <span class="Constant">0</span>/x, expected-bitmap, msg
|
||||
<span id="L259" class="LineNr">259 </span><span class="Delimiter">}</span>
|
||||
<span id="L260" class="LineNr">260 </span>
|
||||
<span id="L261" class="LineNr">261 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='504test-screen.mu.html#L261'>check-background-color-in-screen-row-from</a></span> screen-on-stack: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), bg: int, y: int, x: int, expected-bitmap: (addr array byte), msg: (addr array byte) <span class="Delimiter">{</span>
|
||||
<span id="L262" class="LineNr">262 </span> <span class="PreProc">var</span> <a href='500fake-screen.mu.html#L14'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>) <span class="Special"><-</span> copy screen-on-stack
|
||||
<span id="L263" class="LineNr">263 </span> <span class="PreProc">var</span> failure-count: int
|
||||
<span id="L264" class="LineNr">264 </span> <span class="PreProc">var</span> idx/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L136'>screen-cell-index</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y
|
||||
<span id="L265" class="LineNr">265 </span> <span class="muComment"># compare background color where 'expected-bitmap' is a non-space</span>
|
||||
<span id="L266" class="LineNr">266 </span> <span class="PreProc">var</span> e: (stream byte <span class="Constant">0x100</span>)
|
||||
<span id="L267" class="LineNr">267 </span> <span class="PreProc">var</span> e-addr/<span class="muRegEdx">edx</span>: (addr stream byte) <span class="Special"><-</span> address e
|
||||
<span id="L268" class="LineNr">268 </span> <a href='108write.subx.html#L11'>write</a> e-addr, expected-bitmap
|
||||
<span id="L269" class="LineNr">269 </span> <span class="Delimiter">{</span>
|
||||
<span id="L270" class="LineNr">270 </span> <span class="PreProc">var</span> done?/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='309stream.subx.html#L6'>stream-empty?</a> e-addr
|
||||
<span id="L271" class="LineNr">271 </span> compare done?, <span class="Constant">0</span>
|
||||
<span id="L272" class="LineNr">272 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L273" class="LineNr">273 </span> <span class="PreProc">var</span> _expected-bit/<span class="muRegEax">eax</span>: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> e-addr
|
||||
<span id="L274" class="LineNr">274 </span> <span class="PreProc">var</span> expected-bit/<span class="muRegEdi">edi</span>: grapheme <span class="Special"><-</span> copy _expected-bit
|
||||
<span id="L275" class="LineNr">275 </span> $check-background-color-in-screen-row-from:compare-cells: <span class="Delimiter">{</span>
|
||||
<span id="L276" class="LineNr">276 </span> <span class="PreProc">var</span> background-color/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L471'>screen-background-color-at-idx</a> <a href='500fake-screen.mu.html#L14'>screen</a>, idx
|
||||
<span id="L277" class="LineNr">277 </span> <span class="muComment"># if expected-bit is space, assert that background is NOT bg</span>
|
||||
<span id="L278" class="LineNr">278 </span> compare expected-bit, <span class="Constant">0x20</span>
|
||||
<span id="L279" class="LineNr">279 </span> <span class="Delimiter">{</span>
|
||||
<span id="L280" class="LineNr">280 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L281" class="LineNr">281 </span> compare background-color, bg
|
||||
<span id="L282" class="LineNr">282 </span> <span class="PreProc">break-if-!=</span> $check-background-color-in-screen-row-from:compare-cells
|
||||
<span id="L283" class="LineNr">283 </span> increment failure-count
|
||||
<span id="L284" class="LineNr">284 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, msg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L285" class="LineNr">285 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">": expected ("</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L286" class="LineNr">286 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, x, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L287" class="LineNr">287 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">", "</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L288" class="LineNr">288 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, y, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L289" class="LineNr">289 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">") to not be in background-color "</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L290" class="LineNr">290 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, bg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L291" class="LineNr">291 </span> <a href='501draw-text.mu.html#L65'>move-cursor-to-left-margin-of-next-line</a> <span class="Constant">0</span>/screen
|
||||
<span id="L292" class="LineNr">292 </span> <span class="PreProc">break</span> $check-background-color-in-screen-row-from:compare-cells
|
||||
<span id="L293" class="LineNr">293 </span> <span class="Delimiter">}</span>
|
||||
<span id="L294" class="LineNr">294 </span> <span class="muComment"># otherwise assert that background IS bg</span>
|
||||
<span id="L295" class="LineNr">295 </span> compare background-color, bg
|
||||
<span id="L296" class="LineNr">296 </span> <span class="PreProc">break-if-=</span> $check-background-color-in-screen-row-from:compare-cells
|
||||
<span id="L297" class="LineNr">297 </span> increment failure-count
|
||||
<span id="L298" class="LineNr">298 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, msg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L299" class="LineNr">299 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">": expected ("</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L300" class="LineNr">300 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, x, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L301" class="LineNr">301 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">", "</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L302" class="LineNr">302 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, y, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L303" class="LineNr">303 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">") in background-color "</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L304" class="LineNr">304 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, bg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L305" class="LineNr">305 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">" but observed background-color "</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L306" class="LineNr">306 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, background-color, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L307" class="LineNr">307 </span> <a href='501draw-text.mu.html#L65'>move-cursor-to-left-margin-of-next-line</a> <span class="Constant">0</span>/screen
|
||||
<span id="L308" class="LineNr">308 </span> <span class="Delimiter">}</span>
|
||||
<span id="L309" class="LineNr">309 </span> idx <span class="Special"><-</span> increment
|
||||
<span id="L310" class="LineNr">310 </span> increment x
|
||||
<span id="L311" class="LineNr">311 </span> <span class="PreProc">loop</span>
|
||||
<span id="L312" class="LineNr">312 </span> <span class="Delimiter">}</span>
|
||||
<span id="L313" class="LineNr">313 </span> <span class="muComment"># if any assertions failed, count the test as failed</span>
|
||||
<span id="L314" class="LineNr">314 </span> compare failure-count, <span class="Constant">0</span>
|
||||
<span id="L315" class="LineNr">315 </span> <span class="Delimiter">{</span>
|
||||
<span id="L316" class="LineNr">316 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L317" class="LineNr">317 </span> <a href='104test.subx.html#L5'>count-test-failure</a>
|
||||
<span id="L318" class="LineNr">318 </span> <span class="PreProc">return</span>
|
||||
<span id="L319" class="LineNr">319 </span> <span class="Delimiter">}</span>
|
||||
<span id="L320" class="LineNr">320 </span> <span class="muComment"># otherwise print a "."</span>
|
||||
<span id="L321" class="LineNr">321 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">"."</span>, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L322" class="LineNr">322 </span><span class="Delimiter">}</span>
|
||||
<span id="L323" class="LineNr">323 </span>
|
||||
<span id="L324" class="LineNr">324 </span><span class="PreProc">fn</span> <span class="muTest"><a href='504test-screen.mu.html#L324'>test-draw-single-grapheme</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L325" class="LineNr">325 </span> <span class="PreProc">var</span> screen-on-stack: <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L326" class="LineNr">326 </span> <span class="PreProc">var</span> <a href='500fake-screen.mu.html#L14'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>) <span class="Special"><-</span> address screen-on-stack
|
||||
<span id="L327" class="LineNr">327 </span> <a href='500fake-screen.mu.html#L33'>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="L328" class="LineNr">328 </span> <a href='500fake-screen.mu.html#L130'>draw-code-point</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x61</span>/a, <span class="Constant">0</span>/x, <span class="Constant">0</span>/y, <span class="Constant">1</span>/fg, <span class="Constant">2</span>/bg
|
||||
<span id="L329" class="LineNr">329 </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">"a"</span>, <span class="Constant">"F - test-draw-single-grapheme"</span> <span class="muComment"># top-left corner of the screen</span>
|
||||
<span id="L330" class="LineNr">330 </span> <a href='504test-screen.mu.html#L71'>check-screen-row-in-color</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">1</span>/fg, <span class="Constant">0</span>/y, <span class="Constant">"a"</span>, <span class="Constant">"F - test-draw-single-grapheme-fg"</span>
|
||||
<span id="L331" class="LineNr">331 </span> <a href='504test-screen.mu.html#L162'>check-screen-row-in-background-color</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/bg, <span class="Constant">0</span>/y, <span class="Constant">"a"</span>, <span class="Constant">"F - test-draw-single-grapheme-bg"</span>
|
||||
<span id="L332" class="LineNr">332 </span> <a href='504test-screen.mu.html#L257'>check-background-color-in-screen-row</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/bg, <span class="Constant">0</span>/y, <span class="Constant">"x "</span>, <span class="Constant">"F - test-draw-single-grapheme-bg2"</span>
|
||||
<span id="L333" class="LineNr">333 </span><span class="Delimiter">}</span>
|
||||
<span id="L334" class="LineNr">334 </span>
|
||||
<span id="L335" class="LineNr">335 </span><span class="PreProc">fn</span> <span class="muTest"><a href='504test-screen.mu.html#L335'>test-draw-multiple-graphemes</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L336" class="LineNr">336 </span> <span class="PreProc">var</span> screen-on-stack: <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L337" class="LineNr">337 </span> <span class="PreProc">var</span> <a href='500fake-screen.mu.html#L14'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>) <span class="Special"><-</span> address screen-on-stack
|
||||
<span id="L338" class="LineNr">338 </span> <a href='500fake-screen.mu.html#L33'>initialize-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x10</span>/rows, <span class="Constant">4</span>/cols, <span class="Constant">0</span>/no-pixel-graphics
|
||||
<span id="L339" class="LineNr">339 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">"Hello, 世界"</span>, <span class="Constant">1</span>/fg, <span class="Constant">2</span>/bg
|
||||
<span id="L340" class="LineNr">340 </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">"Hello, 世界"</span>, <span class="Constant">"F - test-draw-multiple-graphemes"</span>
|
||||
<span id="L341" class="LineNr">341 </span> <a href='504test-screen.mu.html#L71'>check-screen-row-in-color</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">1</span>/fg, <span class="Constant">0</span>/y, <span class="Constant">"Hello, 世界"</span>, <span class="Constant">"F - test-draw-multiple-graphemes-fg"</span>
|
||||
<span id="L342" class="LineNr">342 </span> <a href='504test-screen.mu.html#L257'>check-background-color-in-screen-row</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">2</span>/bg, <span class="Constant">0</span>/y, <span class="Constant">"xxxxxxxxx "</span>, <span class="Constant">"F - test-draw-multiple-graphemes-bg2"</span>
|
||||
<span id="L343" class="LineNr">343 </span><span class="Delimiter">}</span>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
119
html/505colors.mu.html
generated
119
html/505colors.mu.html
generated
|
@ -18,9 +18,14 @@ a { color:inherit; }
|
|||
.Special { color: #ff6060; }
|
||||
.LineNr { }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.Constant { color: #008787; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muTest { color: #5f8700; }
|
||||
.muRegEdx { color: #878700; }
|
||||
.muRegEbx { color: #8787af; }
|
||||
.Constant { color: #008787; }
|
||||
.muRegEax { color: #875f00; }
|
||||
.muRegEcx { color: #af875f; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muRegEsi { color: #87d787; }
|
||||
.muComment { color: #005faf; }
|
||||
-->
|
||||
</style>
|
||||
|
@ -61,14 +66,14 @@ if ('onhashchange' in window) {
|
|||
<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"> -> </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"><-</span> <a href='505colors.mu.html#L216'>maximum</a> r, g
|
||||
<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"> -> </span>_/<span class="muRegEcx">ecx</span>: int, _/<span class="muRegEdx">edx</span>: int, _/<span class="muRegEbx">ebx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L6" class="LineNr"> 6 </span> <span class="PreProc">var</span> _max/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='505colors.mu.html#L216'>maximum</a> r, g
|
||||
<span id="L7" class="LineNr"> 7 </span> _max <span class="Special"><-</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"><-</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"><-</span> <a href='505colors.mu.html#L226'>minimum</a> r, g
|
||||
<span id="L8" class="LineNr"> 8 </span> <span class="PreProc">var</span> max/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy _max
|
||||
<span id="L9" class="LineNr"> 9 </span> <span class="PreProc">var</span> _min/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='505colors.mu.html#L226'>minimum</a> r, g
|
||||
<span id="L10" class="LineNr"> 10 </span> _min <span class="Special"><-</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"><-</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"><-</span> copy min
|
||||
<span id="L11" class="LineNr"> 11 </span> <span class="PreProc">var</span> min/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy _min
|
||||
<span id="L12" class="LineNr"> 12 </span> <span class="PreProc">var</span> luminance/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> copy min
|
||||
<span id="L13" class="LineNr"> 13 </span> luminance <span class="Special"><-</span> add max
|
||||
<span id="L14" class="LineNr"> 14 </span> luminance <span class="Special"><-</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>
|
||||
|
@ -80,9 +85,9 @@ if ('onhashchange' in window) {
|
|||
<span id="L21" class="LineNr"> 21 </span> <span class="muComment"># saturation =</span>
|
||||
<span id="L22" class="LineNr"> 22 </span> <span class="muComment"># luminance < 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"><-</span> copy max
|
||||
<span id="L24" class="LineNr"> 24 </span> <span class="PreProc">var</span> nr/<span class="muRegEsi">esi</span>: int <span class="Special"><-</span> copy max
|
||||
<span id="L25" class="LineNr"> 25 </span> nr <span class="Special"><-</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"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L26" class="LineNr"> 26 </span> <span class="PreProc">var</span> dr/<span class="muRegEax">eax</span>: int <span class="Special"><-</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->=</span>
|
||||
|
@ -99,24 +104,24 @@ if ('onhashchange' in window) {
|
|||
<span id="L40" class="LineNr"> 40 </span> <span class="PreProc">var</span> q/<span class="Constant">xmm0</span>: float <span class="Special"><-</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"><-</span> convert dr
|
||||
<span id="L42" class="LineNr"> 42 </span> q <span class="Special"><-</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"><-</span> copy <span class="Constant">0xff</span>
|
||||
<span id="L43" class="LineNr"> 43 </span> <span class="PreProc">var</span> int-255/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0xff</span>
|
||||
<span id="L44" class="LineNr"> 44 </span> tmp <span class="Special"><-</span> convert int-255
|
||||
<span id="L45" class="LineNr"> 45 </span> q <span class="Special"><-</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"><-</span> convert q
|
||||
<span id="L46" class="LineNr"> 46 </span> <span class="PreProc">var</span> saturation/<span class="muRegEsi">esi</span>: int <span class="Special"><-</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"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L51" class="LineNr"> 51 </span> <span class="PreProc">var</span> zero/<span class="muRegEax">eax</span>: int <span class="Special"><-</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"><-</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"><-</span> copy max
|
||||
<span id="L53" class="LineNr"> 53 </span> <span class="PreProc">var</span> dr/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy max
|
||||
<span id="L54" class="LineNr"> 54 </span> dr <span class="Special"><-</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"><-</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"><-</span> copy g
|
||||
<span id="L60" class="LineNr"> 60 </span> <span class="PreProc">var</span> nr/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy g
|
||||
<span id="L61" class="LineNr"> 61 </span> nr <span class="Special"><-</span> subtract b
|
||||
<span id="L62" class="LineNr"> 62 </span> hue-f <span class="Special"><-</span> convert nr
|
||||
<span id="L63" class="LineNr"> 63 </span> hue-f <span class="Special"><-</span> divide dr-f
|
||||
|
@ -125,11 +130,11 @@ if ('onhashchange' in window) {
|
|||
<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"><-</span> copy b
|
||||
<span id="L69" class="LineNr"> 69 </span> <span class="PreProc">var</span> nr/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy b
|
||||
<span id="L70" class="LineNr"> 70 </span> nr <span class="Special"><-</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"><-</span> convert nr
|
||||
<span id="L72" class="LineNr"> 72 </span> f <span class="Special"><-</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"><-</span> copy <span class="Constant">2</span>
|
||||
<span id="L73" class="LineNr"> 73 </span> <span class="PreProc">var</span> two/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">2</span>
|
||||
<span id="L74" class="LineNr"> 74 </span> hue-f <span class="Special"><-</span> convert two
|
||||
<span id="L75" class="LineNr"> 75 </span> hue-f <span class="Special"><-</span> add f
|
||||
<span id="L76" class="LineNr"> 76 </span> <span class="PreProc">break</span> $hsl:compute-hue-normalized
|
||||
|
@ -137,28 +142,28 @@ if ('onhashchange' in window) {
|
|||
<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"><-</span> copy r
|
||||
<span id="L81" class="LineNr"> 81 </span> <span class="PreProc">var</span> nr/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy r
|
||||
<span id="L82" class="LineNr"> 82 </span> nr <span class="Special"><-</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"><-</span> convert nr
|
||||
<span id="L84" class="LineNr"> 84 </span> f <span class="Special"><-</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"><-</span> copy <span class="Constant">4</span>
|
||||
<span id="L85" class="LineNr"> 85 </span> <span class="PreProc">var</span> two/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">4</span>
|
||||
<span id="L86" class="LineNr"> 86 </span> hue-f <span class="Special"><-</span> convert two
|
||||
<span id="L87" class="LineNr"> 87 </span> hue-f <span class="Special"><-</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"><-</span> copy <span class="Constant">0x100</span>
|
||||
<span id="L91" class="LineNr"> 91 </span> <span class="PreProc">var</span> int-256/<span class="muRegEax">eax</span>: int <span class="Special"><-</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"><-</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"><-</span> copy <span class="Constant">6</span>
|
||||
<span id="L93" class="LineNr"> 93 </span> <span class="PreProc">var</span> int-6/<span class="muRegEax">eax</span>: int <span class="Special"><-</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"><-</span> convert int-6
|
||||
<span id="L95" class="LineNr"> 95 </span> scaling-factor <span class="Special"><-</span> divide six-f
|
||||
<span id="L96" class="LineNr"> 96 </span> hue-f <span class="Special"><-</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"><-</span> convert hue-f
|
||||
<span id="L97" class="LineNr"> 97 </span> <span class="PreProc">var</span> hue/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> convert hue-f
|
||||
<span id="L98" class="LineNr"> 98 </span> <span class="muComment"># if hue < 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->=</span>
|
||||
<span id="L102" class="LineNr">102 </span> <span class="PreProc">var</span> tmp/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0x100</span>
|
||||
<span id="L102" class="LineNr">102 </span> <span class="PreProc">var</span> tmp/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0x100</span>
|
||||
<span id="L103" class="LineNr">103 </span> tmp <span class="Special"><-</span> subtract hue
|
||||
<span id="L104" class="LineNr">104 </span> hue <span class="Special"><-</span> copy tmp
|
||||
<span id="L105" class="LineNr">105 </span> <span class="Delimiter">}</span>
|
||||
|
@ -166,9 +171,9 @@ if ('onhashchange' in window) {
|
|||
<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"><-</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"><-</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"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L110" class="LineNr">110 </span> <span class="PreProc">var</span> h/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L111" class="LineNr">111 </span> <span class="PreProc">var</span> s/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L112" class="LineNr">112 </span> <span class="PreProc">var</span> l/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L113" class="LineNr">113 </span> h, s, l <span class="Special"><-</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">"F - <a href='505colors.mu.html#L109'>test-hsl-black</a>/hue"</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">"F - <a href='505colors.mu.html#L109'>test-hsl-black</a>/saturation"</span>
|
||||
|
@ -176,9 +181,9 @@ if ('onhashchange' in window) {
|
|||
<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"><-</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"><-</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"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L120" class="LineNr">120 </span> <span class="PreProc">var</span> h/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L121" class="LineNr">121 </span> <span class="PreProc">var</span> s/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L122" class="LineNr">122 </span> <span class="PreProc">var</span> l/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L123" class="LineNr">123 </span> h, s, l <span class="Special"><-</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">"F - <a href='505colors.mu.html#L119'>test-hsl-white</a>/hue"</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">"F - <a href='505colors.mu.html#L119'>test-hsl-white</a>/saturation"</span>
|
||||
|
@ -186,9 +191,9 @@ if ('onhashchange' in window) {
|
|||
<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"><-</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"><-</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"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L130" class="LineNr">130 </span> <span class="PreProc">var</span> h/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L131" class="LineNr">131 </span> <span class="PreProc">var</span> s/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L132" class="LineNr">132 </span> <span class="PreProc">var</span> l/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L133" class="LineNr">133 </span> h, s, l <span class="Special"><-</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">"F - <a href='505colors.mu.html#L129'>test-hsl-grey</a>/hue"</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">"F - <a href='505colors.mu.html#L129'>test-hsl-grey</a>/saturation"</span>
|
||||
|
@ -197,9 +202,9 @@ if ('onhashchange' in window) {
|
|||
<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"><-</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"><-</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"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L141" class="LineNr">141 </span> <span class="PreProc">var</span> h/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L142" class="LineNr">142 </span> <span class="PreProc">var</span> s/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L143" class="LineNr">143 </span> <span class="PreProc">var</span> l/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L144" class="LineNr">144 </span> h, s, l <span class="Special"><-</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">"F - <a href='505colors.mu.html#L140'>test-hsl-slightly-red</a>/hue"</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">"F - <a href='505colors.mu.html#L140'>test-hsl-slightly-red</a>/saturation"</span>
|
||||
|
@ -207,9 +212,9 @@ if ('onhashchange' in window) {
|
|||
<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"><-</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"><-</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"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L151" class="LineNr">151 </span> <span class="PreProc">var</span> h/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L152" class="LineNr">152 </span> <span class="PreProc">var</span> s/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L153" class="LineNr">153 </span> <span class="PreProc">var</span> l/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L154" class="LineNr">154 </span> h, s, l <span class="Special"><-</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">"F - <a href='505colors.mu.html#L150'>test-hsl-extremely-red</a>/hue"</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">"F - <a href='505colors.mu.html#L150'>test-hsl-extremely-red</a>/saturation"</span>
|
||||
|
@ -218,9 +223,9 @@ if ('onhashchange' in window) {
|
|||
<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"><-</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"><-</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"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L162" class="LineNr">162 </span> <span class="PreProc">var</span> h/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L163" class="LineNr">163 </span> <span class="PreProc">var</span> s/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L164" class="LineNr">164 </span> <span class="PreProc">var</span> l/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L165" class="LineNr">165 </span> h, s, l <span class="Special"><-</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">"F - <a href='505colors.mu.html#L161'>test-hsl-slightly-green</a>/hue"</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">"F - <a href='505colors.mu.html#L161'>test-hsl-slightly-green</a>/saturation"</span>
|
||||
|
@ -228,9 +233,9 @@ if ('onhashchange' in window) {
|
|||
<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"><-</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"><-</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"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L172" class="LineNr">172 </span> <span class="PreProc">var</span> h/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L173" class="LineNr">173 </span> <span class="PreProc">var</span> s/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L174" class="LineNr">174 </span> <span class="PreProc">var</span> l/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L175" class="LineNr">175 </span> h, s, l <span class="Special"><-</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">"F - <a href='505colors.mu.html#L171'>test-hsl-extremely-green</a>/hue"</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">"F - <a href='505colors.mu.html#L171'>test-hsl-extremely-green</a>/saturation"</span>
|
||||
|
@ -239,9 +244,9 @@ if ('onhashchange' in window) {
|
|||
<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"><-</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"><-</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"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L183" class="LineNr">183 </span> <span class="PreProc">var</span> h/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L184" class="LineNr">184 </span> <span class="PreProc">var</span> s/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L185" class="LineNr">185 </span> <span class="PreProc">var</span> l/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L186" class="LineNr">186 </span> h, s, l <span class="Special"><-</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">"F - <a href='505colors.mu.html#L182'>test-hsl-slightly-blue</a>/hue"</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">"F - <a href='505colors.mu.html#L182'>test-hsl-slightly-blue</a>/saturation"</span>
|
||||
|
@ -249,9 +254,9 @@ if ('onhashchange' in window) {
|
|||
<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"><-</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"><-</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"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L193" class="LineNr">193 </span> <span class="PreProc">var</span> h/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L194" class="LineNr">194 </span> <span class="PreProc">var</span> s/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L195" class="LineNr">195 </span> <span class="PreProc">var</span> l/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L196" class="LineNr">196 </span> h, s, l <span class="Special"><-</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">"F - <a href='505colors.mu.html#L192'>test-hsl-extremely-blue</a>/hue"</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">"F - <a href='505colors.mu.html#L192'>test-hsl-extremely-blue</a>/saturation"</span>
|
||||
|
@ -261,9 +266,9 @@ if ('onhashchange' in window) {
|
|||
<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"><-</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"><-</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"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L205" class="LineNr">205 </span> <span class="PreProc">var</span> h/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L206" class="LineNr">206 </span> <span class="PreProc">var</span> s/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L207" class="LineNr">207 </span> <span class="PreProc">var</span> l/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L208" class="LineNr">208 </span> h, s, l <span class="Special"><-</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">"F - <a href='505colors.mu.html#L204'>test-hsl-cyan</a>/hue"</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">"F - <a href='505colors.mu.html#L204'>test-hsl-cyan</a>/saturation"</span>
|
||||
|
@ -272,8 +277,8 @@ if ('onhashchange' in window) {
|
|||
<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"> -> </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"><-</span> copy a
|
||||
<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"> -> </span>_/<span class="muRegEax">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L217" class="LineNr">217 </span> <span class="PreProc">var</span> a2/<span class="muRegEax">eax</span>: int <span class="Special"><-</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-<</span>
|
||||
|
@ -282,8 +287,8 @@ if ('onhashchange' in window) {
|
|||
<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"> -> </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"><-</span> copy a
|
||||
<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"> -> </span>_/<span class="muRegEax">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L227" class="LineNr">227 </span> <span class="PreProc">var</span> a2/<span class="muRegEax">eax</span>: int <span class="Special"><-</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-></span>
|
||||
|
|
20
html/506math.mu.html
generated
20
html/506math.mu.html
generated
|
@ -15,9 +15,11 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.PreProc { color: #c000c0; }
|
||||
.muRegEdi { color: #87ffd7; }
|
||||
.LineNr { }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.Constant { color: #008787; }
|
||||
.muRegEax { color: #875f00; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Special { color: #ff6060; }
|
||||
-->
|
||||
|
@ -55,7 +57,7 @@ if ('onhashchange' in window) {
|
|||
<body onload='JumpToLine();'>
|
||||
<a href='https://github.com/akkartik/mu/blob/main/506math.mu'>https://github.com/akkartik/mu/blob/main/506math.mu</a>
|
||||
<pre id='vimCodeElement'>
|
||||
<span id="L1" class="LineNr"> 1 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='506math.mu.html#L1'>abs</a></span> n: int<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L1" class="LineNr"> 1 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='506math.mu.html#L1'>abs</a></span> n: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L2" class="LineNr"> 2 </span> compare n, <span class="Constant">0</span>
|
||||
<span id="L3" class="LineNr"> 3 </span> <span class="Delimiter">{</span>
|
||||
<span id="L4" class="LineNr"> 4 </span> <span class="PreProc">break-if->=</span>
|
||||
|
@ -64,7 +66,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L7" class="LineNr"> 7 </span> <span class="PreProc">return</span> n
|
||||
<span id="L8" class="LineNr"> 8 </span><span class="Delimiter">}</span>
|
||||
<span id="L9" class="LineNr"> 9 </span>
|
||||
<span id="L10" class="LineNr">10 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='506math.mu.html#L10'>sgn</a></span> n: int<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L10" class="LineNr">10 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='506math.mu.html#L10'>sgn</a></span> n: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L11" class="LineNr">11 </span> compare n, <span class="Constant">0</span>
|
||||
<span id="L12" class="LineNr">12 </span> <span class="Delimiter">{</span>
|
||||
<span id="L13" class="LineNr">13 </span> <span class="PreProc">break-if-<=</span>
|
||||
|
@ -77,8 +79,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L20" class="LineNr">20 </span> <span class="PreProc">return</span> <span class="Constant">0</span>
|
||||
<span id="L21" class="LineNr">21 </span><span class="Delimiter">}</span>
|
||||
<span id="L22" class="LineNr">22 </span>
|
||||
<span id="L23" class="LineNr">23 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='506math.mu.html#L23'>shift-left-by</a></span> n: int, bits: int<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L24" class="LineNr">24 </span> <span class="PreProc">var</span> i/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy bits
|
||||
<span id="L23" class="LineNr">23 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='506math.mu.html#L23'>shift-left-by</a></span> n: int, bits: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L24" class="LineNr">24 </span> <span class="PreProc">var</span> i/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy bits
|
||||
<span id="L25" class="LineNr">25 </span> <span class="Delimiter">{</span>
|
||||
<span id="L26" class="LineNr">26 </span> compare i, <span class="Constant">0</span>
|
||||
<span id="L27" class="LineNr">27 </span> <span class="PreProc">break-if-<=</span>
|
||||
|
@ -89,8 +91,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L32" class="LineNr">32 </span> <span class="PreProc">return</span> n
|
||||
<span id="L33" class="LineNr">33 </span><span class="Delimiter">}</span>
|
||||
<span id="L34" class="LineNr">34 </span>
|
||||
<span id="L35" class="LineNr">35 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='506math.mu.html#L35'>shift-right-by</a></span> n: int, bits: int<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L36" class="LineNr">36 </span> <span class="PreProc">var</span> i/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy bits
|
||||
<span id="L35" class="LineNr">35 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='506math.mu.html#L35'>shift-right-by</a></span> n: int, bits: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L36" class="LineNr">36 </span> <span class="PreProc">var</span> i/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy bits
|
||||
<span id="L37" class="LineNr">37 </span> <span class="Delimiter">{</span>
|
||||
<span id="L38" class="LineNr">38 </span> compare i, <span class="Constant">0</span>
|
||||
<span id="L39" class="LineNr">39 </span> <span class="PreProc">break-if-<=</span>
|
||||
|
@ -102,8 +104,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L45" class="LineNr">45 </span><span class="Delimiter">}</span>
|
||||
<span id="L46" class="LineNr">46 </span>
|
||||
<span id="L47" class="LineNr">47 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='506math.mu.html#L47'>clear-lowest-bits</a></span> _n: (addr int), bits: int <span class="Delimiter">{</span>
|
||||
<span id="L48" class="LineNr">48 </span> <span class="PreProc">var</span> dest/<span class="Constant">edi</span>: (addr int) <span class="Special"><-</span> copy _n
|
||||
<span id="L49" class="LineNr">49 </span> <span class="PreProc">var</span> n/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy *dest
|
||||
<span id="L48" class="LineNr">48 </span> <span class="PreProc">var</span> dest/<span class="muRegEdi">edi</span>: (addr int) <span class="Special"><-</span> copy _n
|
||||
<span id="L49" class="LineNr">49 </span> <span class="PreProc">var</span> n/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy *dest
|
||||
<span id="L50" class="LineNr">50 </span> n <span class="Special"><-</span> <a href='506math.mu.html#L35'>shift-right-by</a> n, bits
|
||||
<span id="L51" class="LineNr">51 </span> n <span class="Special"><-</span> <a href='506math.mu.html#L23'>shift-left-by</a> n, bits
|
||||
<span id="L52" class="LineNr">52 </span> copy-to *dest, n
|
||||
|
|
32
html/507line.mu.html
generated
32
html/507line.mu.html
generated
|
@ -18,6 +18,10 @@ a { color:inherit; }
|
|||
.Special { color: #ff6060; }
|
||||
.LineNr { }
|
||||
.Constant { color: #008787; }
|
||||
.muRegEbx { color: #8787af; }
|
||||
.muRegEdx { color: #878700; }
|
||||
.muRegEcx { color: #af875f; }
|
||||
.muRegEax { color: #875f00; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muComment { color: #005faf; }
|
||||
|
@ -63,9 +67,9 @@ if ('onhashchange' in window) {
|
|||
<span id="L5" class="LineNr"> 5 </span> <span class="PreProc">var</span> sy: int
|
||||
<span id="L6" class="LineNr"> 6 </span> <span class="PreProc">var</span> err: int
|
||||
<span id="L7" class="LineNr"> 7 </span> <span class="muComment"># dx = abs(x1-x0)</span>
|
||||
<span id="L8" class="LineNr"> 8 </span> <span class="PreProc">var</span> tmp2/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy x1
|
||||
<span id="L8" class="LineNr"> 8 </span> <span class="PreProc">var</span> tmp2/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy x1
|
||||
<span id="L9" class="LineNr"> 9 </span> tmp2 <span class="Special"><-</span> subtract x0
|
||||
<span id="L10" class="LineNr"> 10 </span> <span class="PreProc">var</span> tmp/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='506math.mu.html#L1'>abs</a> tmp2
|
||||
<span id="L10" class="LineNr"> 10 </span> <span class="PreProc">var</span> tmp/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='506math.mu.html#L1'>abs</a> tmp2
|
||||
<span id="L11" class="LineNr"> 11 </span> copy-to dx, tmp
|
||||
<span id="L12" class="LineNr"> 12 </span> <span class="muComment"># sx = sgn(x1-x0)</span>
|
||||
<span id="L13" class="LineNr"> 13 </span> tmp <span class="Special"><-</span> <a href='506math.mu.html#L10'>sgn</a> tmp2
|
||||
|
@ -84,10 +88,10 @@ if ('onhashchange' in window) {
|
|||
<span id="L26" class="LineNr"> 26 </span> tmp <span class="Special"><-</span> add dx
|
||||
<span id="L27" class="LineNr"> 27 </span> copy-to err, tmp
|
||||
<span id="L28" class="LineNr"> 28 </span> <span class="muComment">#</span>
|
||||
<span id="L29" class="LineNr"> 29 </span> <span class="PreProc">var</span> x/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy x0
|
||||
<span id="L30" class="LineNr"> 30 </span> <span class="PreProc">var</span> y/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy y0
|
||||
<span id="L29" class="LineNr"> 29 </span> <span class="PreProc">var</span> x/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy x0
|
||||
<span id="L30" class="LineNr"> 30 </span> <span class="PreProc">var</span> y/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy y0
|
||||
<span id="L31" class="LineNr"> 31 </span> $draw-line:<span class="PreProc">loop</span>: <span class="Delimiter">{</span>
|
||||
<span id="L32" class="LineNr"> 32 </span> <a href='500fake-screen.mu.html#L463'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y, color
|
||||
<span id="L32" class="LineNr"> 32 </span> <a href='500fake-screen.mu.html#L483'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y, color
|
||||
<span id="L33" class="LineNr"> 33 </span> <span class="muComment"># if (x == x1 && y == y1) break</span>
|
||||
<span id="L34" class="LineNr"> 34 </span> <span class="Delimiter">{</span>
|
||||
<span id="L35" class="LineNr"> 35 </span> compare x, x1
|
||||
|
@ -97,7 +101,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L39" class="LineNr"> 39 </span> <span class="PreProc">break</span> $draw-line:<span class="PreProc">loop</span>
|
||||
<span id="L40" class="LineNr"> 40 </span> <span class="Delimiter">}</span>
|
||||
<span id="L41" class="LineNr"> 41 </span> <span class="muComment"># e2 = err*2</span>
|
||||
<span id="L42" class="LineNr"> 42 </span> <span class="PreProc">var</span> e2/<span class="Constant">ebx</span>: int <span class="Special"><-</span> copy err
|
||||
<span id="L42" class="LineNr"> 42 </span> <span class="PreProc">var</span> e2/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> copy err
|
||||
<span id="L43" class="LineNr"> 43 </span> e2 <span class="Special"><-</span> shift-left <span class="Constant">1</span>
|
||||
<span id="L44" class="LineNr"> 44 </span> <span class="muComment"># if (e2 >= dy) { err += dy; x += sx; }</span>
|
||||
<span id="L45" class="LineNr"> 45 </span> <span class="Delimiter">{</span>
|
||||
|
@ -120,29 +124,29 @@ if ('onhashchange' in window) {
|
|||
<span id="L62" class="LineNr"> 62 </span><span class="Delimiter">}</span>
|
||||
<span id="L63" class="LineNr"> 63 </span>
|
||||
<span id="L64" class="LineNr"> 64 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='507line.mu.html#L64'>draw-horizontal-line</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), y: int, x0: int, x1: int, color: int <span class="Delimiter">{</span>
|
||||
<span id="L65" class="LineNr"> 65 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy x0
|
||||
<span id="L65" class="LineNr"> 65 </span> <span class="PreProc">var</span> x/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy x0
|
||||
<span id="L66" class="LineNr"> 66 </span> <span class="Delimiter">{</span>
|
||||
<span id="L67" class="LineNr"> 67 </span> compare x, x1
|
||||
<span id="L68" class="LineNr"> 68 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L69" class="LineNr"> 69 </span> <a href='500fake-screen.mu.html#L463'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y, color
|
||||
<span id="L69" class="LineNr"> 69 </span> <a href='500fake-screen.mu.html#L483'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y, color
|
||||
<span id="L70" class="LineNr"> 70 </span> x <span class="Special"><-</span> increment
|
||||
<span id="L71" class="LineNr"> 71 </span> <span class="PreProc">loop</span>
|
||||
<span id="L72" class="LineNr"> 72 </span> <span class="Delimiter">}</span>
|
||||
<span id="L73" class="LineNr"> 73 </span><span class="Delimiter">}</span>
|
||||
<span id="L74" class="LineNr"> 74 </span>
|
||||
<span id="L75" class="LineNr"> 75 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='507line.mu.html#L75'>draw-vertical-line</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), x: int, y0: int, y1: int, color: int <span class="Delimiter">{</span>
|
||||
<span id="L76" class="LineNr"> 76 </span> <span class="PreProc">var</span> y/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy y0
|
||||
<span id="L76" class="LineNr"> 76 </span> <span class="PreProc">var</span> y/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy y0
|
||||
<span id="L77" class="LineNr"> 77 </span> <span class="Delimiter">{</span>
|
||||
<span id="L78" class="LineNr"> 78 </span> compare y, y1
|
||||
<span id="L79" class="LineNr"> 79 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L80" class="LineNr"> 80 </span> <a href='500fake-screen.mu.html#L463'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y, color
|
||||
<span id="L80" class="LineNr"> 80 </span> <a href='500fake-screen.mu.html#L483'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y, color
|
||||
<span id="L81" class="LineNr"> 81 </span> y <span class="Special"><-</span> increment
|
||||
<span id="L82" class="LineNr"> 82 </span> <span class="PreProc">loop</span>
|
||||
<span id="L83" class="LineNr"> 83 </span> <span class="Delimiter">}</span>
|
||||
<span id="L84" class="LineNr"> 84 </span><span class="Delimiter">}</span>
|
||||
<span id="L85" class="LineNr"> 85 </span>
|
||||
<span id="L86" class="LineNr"> 86 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='507line.mu.html#L86'>draw-rect</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), xmin: int, ymin: int, xmax: int, ymax: int, color: int <span class="Delimiter">{</span>
|
||||
<span id="L87" class="LineNr"> 87 </span> <span class="PreProc">var</span> y/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy ymin
|
||||
<span id="L87" class="LineNr"> 87 </span> <span class="PreProc">var</span> y/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy ymin
|
||||
<span id="L88" class="LineNr"> 88 </span> <span class="Delimiter">{</span>
|
||||
<span id="L89" class="LineNr"> 89 </span> compare y, ymax
|
||||
<span id="L90" class="LineNr"> 90 </span> <span class="PreProc">break-if->=</span>
|
||||
|
@ -153,8 +157,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L95" class="LineNr"> 95 </span><span class="Delimiter">}</span>
|
||||
<span id="L96" class="LineNr"> 96 </span>
|
||||
<span id="L97" class="LineNr"> 97 </span><span class="muComment"># 0 <= u <= 1</span>
|
||||
<span id="L98" class="LineNr"> 98 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='507line.mu.html#L98'>line-point</a></span> u: float, x0: int, x1: int<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L99" class="LineNr"> 99 </span> <span class="PreProc">var</span> one/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">1</span>
|
||||
<span id="L98" class="LineNr"> 98 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='507line.mu.html#L98'>line-point</a></span> u: float, x0: int, x1: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L99" class="LineNr"> 99 </span> <span class="PreProc">var</span> one/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">1</span>
|
||||
<span id="L100" class="LineNr">100 </span> <span class="PreProc">var</span> u-prime/<span class="Constant">xmm0</span>: float <span class="Special"><-</span> convert one
|
||||
<span id="L101" class="LineNr">101 </span> u-prime <span class="Special"><-</span> subtract u
|
||||
<span id="L102" class="LineNr">102 </span> <span class="PreProc">var</span> result/<span class="Constant">xmm1</span>: float <span class="Special"><-</span> convert x0
|
||||
|
@ -162,7 +166,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L104" class="LineNr">104 </span> <span class="PreProc">var</span> term2/<span class="Constant">xmm2</span>: float <span class="Special"><-</span> convert x1
|
||||
<span id="L105" class="LineNr">105 </span> term2 <span class="Special"><-</span> multiply u
|
||||
<span id="L106" class="LineNr">106 </span> result <span class="Special"><-</span> add term2
|
||||
<span id="L107" class="LineNr">107 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special"><-</span> convert result
|
||||
<span id="L107" class="LineNr">107 </span> <span class="PreProc">var</span> result/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> convert result
|
||||
<span id="L108" class="LineNr">108 </span> <span class="PreProc">return</span> result
|
||||
<span id="L109" class="LineNr">109 </span><span class="Delimiter">}</span>
|
||||
</pre>
|
||||
|
|
19
html/508circle.mu.html
generated
19
html/508circle.mu.html
generated
|
@ -15,9 +15,12 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.PreProc { color: #c000c0; }
|
||||
.muRegEcx { color: #af875f; }
|
||||
.Special { color: #ff6060; }
|
||||
.LineNr { }
|
||||
.muRegEdx { color: #878700; }
|
||||
.Constant { color: #008787; }
|
||||
.muRegEax { color: #875f00; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muComment { color: #005faf; }
|
||||
|
@ -61,7 +64,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L3" class="LineNr"> 3 </span> <span class="PreProc">var</span> y: int
|
||||
<span id="L4" class="LineNr"> 4 </span> <span class="PreProc">var</span> err: int
|
||||
<span id="L5" class="LineNr"> 5 </span> <span class="muComment"># x = -r</span>
|
||||
<span id="L6" class="LineNr"> 6 </span> <span class="PreProc">var</span> tmp/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy radius
|
||||
<span id="L6" class="LineNr"> 6 </span> <span class="PreProc">var</span> tmp/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy radius
|
||||
<span id="L7" class="LineNr"> 7 </span> tmp <span class="Special"><-</span> negate
|
||||
<span id="L8" class="LineNr"> 8 </span> copy-to x, tmp
|
||||
<span id="L9" class="LineNr"> 9 </span> <span class="muComment"># err = 2 - 2*r</span>
|
||||
|
@ -71,33 +74,33 @@ if ('onhashchange' in window) {
|
|||
<span id="L13" class="LineNr">13 </span> tmp <span class="Special"><-</span> add <span class="Constant">2</span>
|
||||
<span id="L14" class="LineNr">14 </span> copy-to err, tmp
|
||||
<span id="L15" class="LineNr">15 </span> <span class="muComment">#</span>
|
||||
<span id="L16" class="LineNr">16 </span> <span class="PreProc">var</span> tmpx/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L17" class="LineNr">17 </span> <span class="PreProc">var</span> tmpy/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L16" class="LineNr">16 </span> <span class="PreProc">var</span> tmpx/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L17" class="LineNr">17 </span> <span class="PreProc">var</span> tmpy/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L18" class="LineNr">18 </span> <span class="Delimiter">{</span>
|
||||
<span id="L19" class="LineNr">19 </span> <span class="muComment"># pixel(cx-x, cy+y)</span>
|
||||
<span id="L20" class="LineNr">20 </span> tmpx <span class="Special"><-</span> copy cx
|
||||
<span id="L21" class="LineNr">21 </span> tmpx <span class="Special"><-</span> subtract x
|
||||
<span id="L22" class="LineNr">22 </span> tmpy <span class="Special"><-</span> copy cy
|
||||
<span id="L23" class="LineNr">23 </span> tmpy <span class="Special"><-</span> add y
|
||||
<span id="L24" class="LineNr">24 </span> <a href='500fake-screen.mu.html#L463'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, tmpx, tmpy, color
|
||||
<span id="L24" class="LineNr">24 </span> <a href='500fake-screen.mu.html#L483'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, tmpx, tmpy, color
|
||||
<span id="L25" class="LineNr">25 </span> <span class="muComment"># pixel(cx-y, cy-x)</span>
|
||||
<span id="L26" class="LineNr">26 </span> tmpx <span class="Special"><-</span> copy cx
|
||||
<span id="L27" class="LineNr">27 </span> tmpx <span class="Special"><-</span> subtract y
|
||||
<span id="L28" class="LineNr">28 </span> tmpy <span class="Special"><-</span> copy cy
|
||||
<span id="L29" class="LineNr">29 </span> tmpy <span class="Special"><-</span> subtract x
|
||||
<span id="L30" class="LineNr">30 </span> <a href='500fake-screen.mu.html#L463'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, tmpx, tmpy, color
|
||||
<span id="L30" class="LineNr">30 </span> <a href='500fake-screen.mu.html#L483'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, tmpx, tmpy, color
|
||||
<span id="L31" class="LineNr">31 </span> <span class="muComment"># pixel(cx+x, cy-y)</span>
|
||||
<span id="L32" class="LineNr">32 </span> tmpx <span class="Special"><-</span> copy cx
|
||||
<span id="L33" class="LineNr">33 </span> tmpx <span class="Special"><-</span> add x
|
||||
<span id="L34" class="LineNr">34 </span> tmpy <span class="Special"><-</span> copy cy
|
||||
<span id="L35" class="LineNr">35 </span> tmpy <span class="Special"><-</span> subtract y
|
||||
<span id="L36" class="LineNr">36 </span> <a href='500fake-screen.mu.html#L463'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, tmpx, tmpy, color
|
||||
<span id="L36" class="LineNr">36 </span> <a href='500fake-screen.mu.html#L483'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, tmpx, tmpy, color
|
||||
<span id="L37" class="LineNr">37 </span> <span class="muComment"># pixel(cx+y, cy+x)</span>
|
||||
<span id="L38" class="LineNr">38 </span> tmpx <span class="Special"><-</span> copy cx
|
||||
<span id="L39" class="LineNr">39 </span> tmpx <span class="Special"><-</span> add y
|
||||
<span id="L40" class="LineNr">40 </span> tmpy <span class="Special"><-</span> copy cy
|
||||
<span id="L41" class="LineNr">41 </span> tmpy <span class="Special"><-</span> add x
|
||||
<span id="L42" class="LineNr">42 </span> <a href='500fake-screen.mu.html#L463'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, tmpx, tmpy, color
|
||||
<span id="L42" class="LineNr">42 </span> <a href='500fake-screen.mu.html#L483'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, tmpx, tmpy, color
|
||||
<span id="L43" class="LineNr">43 </span> <span class="muComment"># r = err</span>
|
||||
<span id="L44" class="LineNr">44 </span> tmp <span class="Special"><-</span> copy err
|
||||
<span id="L45" class="LineNr">45 </span> copy-to radius, tmp
|
||||
|
@ -136,7 +139,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L78" class="LineNr">78 </span><span class="Delimiter">}</span>
|
||||
<span id="L79" class="LineNr">79 </span>
|
||||
<span id="L80" class="LineNr">80 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='508circle.mu.html#L80'>draw-disc</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), cx: int, cy: int, radius: int, color: int, border-color: int <span class="Delimiter">{</span>
|
||||
<span id="L81" class="LineNr">81 </span> <span class="PreProc">var</span> r/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L81" class="LineNr">81 </span> <span class="PreProc">var</span> r/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L82" class="LineNr">82 </span> <span class="Delimiter">{</span>
|
||||
<span id="L83" class="LineNr">83 </span> compare r, radius
|
||||
<span id="L84" class="LineNr">84 </span> <span class="PreProc">break-if->=</span>
|
||||
|
|
32
html/509bezier.mu.html
generated
32
html/509bezier.mu.html
generated
|
@ -15,9 +15,13 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.PreProc { color: #c000c0; }
|
||||
.muRegEcx { color: #af875f; }
|
||||
.Special { color: #ff6060; }
|
||||
.LineNr { }
|
||||
.muRegEbx { color: #8787af; }
|
||||
.muRegEdx { color: #878700; }
|
||||
.Constant { color: #008787; }
|
||||
.muRegEax { color: #875f00; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muComment { color: #005faf; }
|
||||
|
@ -76,7 +80,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L18" class="LineNr"> 18 </span> <span class="PreProc">var</span> sx: int
|
||||
<span id="L19" class="LineNr"> 19 </span> <span class="PreProc">var</span> sy: int
|
||||
<span id="L20" class="LineNr"> 20 </span> <span class="muComment"># sx = x2-x1</span>
|
||||
<span id="L21" class="LineNr"> 21 </span> <span class="PreProc">var</span> tmp/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy x2
|
||||
<span id="L21" class="LineNr"> 21 </span> <span class="PreProc">var</span> tmp/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy x2
|
||||
<span id="L22" class="LineNr"> 22 </span> tmp <span class="Special"><-</span> subtract x1
|
||||
<span id="L23" class="LineNr"> 23 </span> copy-to sx, tmp
|
||||
<span id="L24" class="LineNr"> 24 </span> <span class="muComment"># sy = y2-y1</span>
|
||||
|
@ -120,7 +124,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L62" class="LineNr"> 62 </span> <span class="muComment"># swap P0 and P2 if necessary</span>
|
||||
<span id="L63" class="LineNr"> 63 </span> <span class="Delimiter">{</span>
|
||||
<span id="L64" class="LineNr"> 64 </span> <span class="muComment"># dist1 = sx*sx + sy*sy</span>
|
||||
<span id="L65" class="LineNr"> 65 </span> <span class="PreProc">var</span> dist1/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy sx
|
||||
<span id="L65" class="LineNr"> 65 </span> <span class="PreProc">var</span> dist1/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy sx
|
||||
<span id="L66" class="LineNr"> 66 </span> <span class="Delimiter">{</span>
|
||||
<span id="L67" class="LineNr"> 67 </span> dist1 <span class="Special"><-</span> multiply sx
|
||||
<span id="L68" class="LineNr"> 68 </span> <span class="Delimiter">{</span>
|
||||
|
@ -136,7 +140,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L78" class="LineNr"> 78 </span> dist1 <span class="Special"><-</span> add tmp
|
||||
<span id="L79" class="LineNr"> 79 </span> <span class="Delimiter">}</span>
|
||||
<span id="L80" class="LineNr"> 80 </span> <span class="muComment"># dist2 = xx*xx + yy*yy</span>
|
||||
<span id="L81" class="LineNr"> 81 </span> <span class="PreProc">var</span> dist2/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy xx
|
||||
<span id="L81" class="LineNr"> 81 </span> <span class="PreProc">var</span> dist2/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy xx
|
||||
<span id="L82" class="LineNr"> 82 </span> <span class="Delimiter">{</span>
|
||||
<span id="L83" class="LineNr"> 83 </span> dist2 <span class="Special"><-</span> multiply xx
|
||||
<span id="L84" class="LineNr"> 84 </span> <span class="Delimiter">{</span>
|
||||
|
@ -167,12 +171,12 @@ if ('onhashchange' in window) {
|
|||
<span id="L109" class="LineNr">109 </span> tmp <span class="Special"><-</span> add y1
|
||||
<span id="L110" class="LineNr">110 </span> copy-to y0, tmp
|
||||
<span id="L111" class="LineNr">111 </span> <span class="muComment"># cur = -cur</span>
|
||||
<span id="L112" class="LineNr">112 </span> <span class="PreProc">var</span> negative-1/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">-1</span>
|
||||
<span id="L112" class="LineNr">112 </span> <span class="PreProc">var</span> negative-1/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">-1</span>
|
||||
<span id="L113" class="LineNr">113 </span> <span class="PreProc">var</span> negative-1-f/<span class="Constant">xmm1</span>: float <span class="Special"><-</span> convert negative-1
|
||||
<span id="L114" class="LineNr">114 </span> cur-f <span class="Special"><-</span> multiply negative-1-f
|
||||
<span id="L115" class="LineNr">115 </span> <span class="Delimiter">}</span>
|
||||
<span id="L116" class="LineNr">116 </span> <span class="PreProc">var</span> x/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy x0
|
||||
<span id="L117" class="LineNr">117 </span> <span class="PreProc">var</span> y/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy y0
|
||||
<span id="L116" class="LineNr">116 </span> <span class="PreProc">var</span> x/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy x0
|
||||
<span id="L117" class="LineNr">117 </span> <span class="PreProc">var</span> y/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy y0
|
||||
<span id="L118" class="LineNr">118 </span> <span class="PreProc">var</span> zero-f: float
|
||||
<span id="L119" class="LineNr">119 </span> <span class="muComment"># plot a curved part if necessary</span>
|
||||
<span id="L120" class="LineNr">120 </span> $draw-monotonic-bezier:curve: <span class="Delimiter">{</span>
|
||||
|
@ -245,11 +249,11 @@ if ('onhashchange' in window) {
|
|||
<span id="L187" class="LineNr">187 </span> negate yy
|
||||
<span id="L188" class="LineNr">188 </span> negate xy
|
||||
<span id="L189" class="LineNr">189 </span> <span class="muComment"># cur = -cur</span>
|
||||
<span id="L190" class="LineNr">190 </span> <span class="PreProc">var</span> negative-1/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">-1</span>
|
||||
<span id="L190" class="LineNr">190 </span> <span class="PreProc">var</span> negative-1/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">-1</span>
|
||||
<span id="L191" class="LineNr">191 </span> <span class="PreProc">var</span> negative-1-f/<span class="Constant">xmm1</span>: float <span class="Special"><-</span> convert negative-1
|
||||
<span id="L192" class="LineNr">192 </span> cur-f <span class="Special"><-</span> multiply negative-1-f
|
||||
<span id="L193" class="LineNr">193 </span> <span class="Delimiter">}</span>
|
||||
<span id="L194" class="LineNr">194 </span> <span class="PreProc">var</span> four/<span class="Constant">ebx</span>: int <span class="Special"><-</span> copy <span class="Constant">4</span>
|
||||
<span id="L194" class="LineNr">194 </span> <span class="PreProc">var</span> four/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> copy <span class="Constant">4</span>
|
||||
<span id="L195" class="LineNr">195 </span> <span class="PreProc">var</span> dx-f/<span class="Constant">xmm5</span>: float <span class="Special"><-</span> convert four
|
||||
<span id="L196" class="LineNr">196 </span> <span class="PreProc">var</span> dy-f/<span class="Constant">xmm6</span>: float <span class="Special"><-</span> convert four
|
||||
<span id="L197" class="LineNr">197 </span> <span class="muComment"># dx = 4*sy*cur*(x1-x0) + xx - xy</span>
|
||||
|
@ -293,7 +297,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L235" class="LineNr">235 </span> err-f <span class="Special"><-</span> add xy-f
|
||||
<span id="L236" class="LineNr">236 </span> <span class="muComment">#</span>
|
||||
<span id="L237" class="LineNr">237 </span> $draw-monotonic-bezier:<span class="PreProc">loop</span>: <span class="Delimiter">{</span>
|
||||
<span id="L238" class="LineNr">238 </span> <a href='500fake-screen.mu.html#L463'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y, color
|
||||
<span id="L238" class="LineNr">238 </span> <a href='500fake-screen.mu.html#L483'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y, color
|
||||
<span id="L239" class="LineNr">239 </span> <span class="muComment"># if (x == x2 && y == y2) return</span>
|
||||
<span id="L240" class="LineNr">240 </span> <span class="Delimiter">{</span>
|
||||
<span id="L241" class="LineNr">241 </span> compare x, x2
|
||||
|
@ -303,10 +307,10 @@ if ('onhashchange' in window) {
|
|||
<span id="L245" class="LineNr">245 </span> <span class="PreProc">return</span>
|
||||
<span id="L246" class="LineNr">246 </span> <span class="Delimiter">}</span>
|
||||
<span id="L247" class="LineNr">247 </span> <span class="muComment"># perform-y-step? = (2*err < dx)</span>
|
||||
<span id="L248" class="LineNr">248 </span> <span class="PreProc">var</span> perform-y-step?/<span class="Constant">eax</span>: boolean <span class="Special"><-</span> copy <span class="Constant">0</span>/false
|
||||
<span id="L248" class="LineNr">248 </span> <span class="PreProc">var</span> perform-y-step?/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> copy <span class="Constant">0</span>/false
|
||||
<span id="L249" class="LineNr">249 </span> <span class="PreProc">var</span> two-err-f/<span class="Constant">xmm0</span>: float <span class="Special"><-</span> copy err-f
|
||||
<span id="L250" class="LineNr">250 </span> <span class="Delimiter">{</span>
|
||||
<span id="L251" class="LineNr">251 </span> <span class="PreProc">var</span> two/<span class="Constant">ebx</span>: int <span class="Special"><-</span> copy <span class="Constant">2</span>
|
||||
<span id="L251" class="LineNr">251 </span> <span class="PreProc">var</span> two/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> copy <span class="Constant">2</span>
|
||||
<span id="L252" class="LineNr">252 </span> <span class="PreProc">var</span> two-f/<span class="Constant">xmm1</span>: float <span class="Special"><-</span> convert two
|
||||
<span id="L253" class="LineNr">253 </span> two-err-f <span class="Special"><-</span> multiply two-f
|
||||
<span id="L254" class="LineNr">254 </span> compare two-err-f, dx-f
|
||||
|
@ -353,8 +357,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L295" class="LineNr">295 </span><span class="Delimiter">}</span>
|
||||
<span id="L296" class="LineNr">296 </span>
|
||||
<span id="L297" class="LineNr">297 </span><span class="muComment"># 0 <= u <= 1</span>
|
||||
<span id="L298" class="LineNr">298 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='509bezier.mu.html#L298'>bezier-point</a></span> u: float, x0: int, x1: int, x2: int<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L299" class="LineNr">299 </span> <span class="PreProc">var</span> one/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">1</span>
|
||||
<span id="L298" class="LineNr">298 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='509bezier.mu.html#L298'>bezier-point</a></span> u: float, x0: int, x1: int, x2: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L299" class="LineNr">299 </span> <span class="PreProc">var</span> one/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">1</span>
|
||||
<span id="L300" class="LineNr">300 </span> <span class="PreProc">var</span> u-prime/<span class="Constant">xmm0</span>: float <span class="Special"><-</span> convert one
|
||||
<span id="L301" class="LineNr">301 </span> u-prime <span class="Special"><-</span> subtract u
|
||||
<span id="L302" class="LineNr">302 </span> <span class="PreProc">var</span> result/<span class="Constant">xmm1</span>: float <span class="Special"><-</span> convert x0
|
||||
|
@ -369,7 +373,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L311" class="LineNr">311 </span> term3 <span class="Special"><-</span> multiply u
|
||||
<span id="L312" class="LineNr">312 </span> term3 <span class="Special"><-</span> multiply u
|
||||
<span id="L313" class="LineNr">313 </span> result <span class="Special"><-</span> add term3
|
||||
<span id="L314" class="LineNr">314 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special"><-</span> convert result
|
||||
<span id="L314" class="LineNr">314 </span> <span class="PreProc">var</span> result/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> convert result
|
||||
<span id="L315" class="LineNr">315 </span> <span class="PreProc">return</span> result
|
||||
<span id="L316" class="LineNr">316 </span><span class="Delimiter">}</span>
|
||||
</pre>
|
||||
|
|
1248
html/boot.subx.html
generated
1248
html/boot.subx.html
generated
File diff suppressed because it is too large
Load Diff
73
html/colors.mu.html
generated
73
html/colors.mu.html
generated
|
@ -15,12 +15,17 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.PreProc { color: #c000c0; }
|
||||
.muRegEcx { color: #af875f; }
|
||||
.Special { color: #ff6060; }
|
||||
.LineNr { }
|
||||
.muRegEbx { color: #8787af; }
|
||||
.muRegEdx { color: #878700; }
|
||||
.Constant { color: #008787; }
|
||||
.CommentedCode { color: #8a8a8a; }
|
||||
.muRegEsi { color: #87d787; }
|
||||
.muRegEax { color: #875f00; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.CommentedCode { color: #8a8a8a; }
|
||||
.muComment { color: #005faf; }
|
||||
-->
|
||||
</style>
|
||||
|
@ -71,31 +76,31 @@ if ('onhashchange' in window) {
|
|||
<span id="L12" class="LineNr"> 12 </span>
|
||||
<span id="L13" class="LineNr"> 13 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='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"><-</span> address in-storage
|
||||
<span id="L15" class="LineNr"> 15 </span> <span class="PreProc">var</span> in/<span class="muRegEsi">esi</span>: (addr stream byte) <span class="Special"><-</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"><-</span> <a href='501draw-text.mu.html#L100'>draw-text-rightward</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">"Enter 3 hex bytes for r, g, b (lowercase; no 0x prefix) separated by a single space> "</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="L18" class="LineNr"> 18 </span> <span class="PreProc">var</span> x/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='501draw-text.mu.html#L100'>draw-text-rightward</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">"Enter 3 hex bytes for r, g, b (lowercase; no 0x prefix) separated by a single space> "</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#L217'>draw-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x20</span>/space
|
||||
<span id="L23" class="LineNr"> 23 </span> <span class="PreProc">var</span> key/<span class="Constant">eax</span>: byte <span class="Special"><-</span> <a href='102keyboard.subx.html#L21'>read-key</a> keyboard
|
||||
<span id="L22" class="LineNr"> 22 </span> <a href='500fake-screen.mu.html#L237'>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="muRegEax">eax</span>: byte <span class="Special"><-</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"><-</span> copy key
|
||||
<span id="L28" class="LineNr"> 28 </span> <span class="PreProc">var</span> key2/<span class="muRegEax">eax</span>: int <span class="Special"><-</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"><-</span> copy key2
|
||||
<span id="L30" class="LineNr"> 30 </span> <span class="PreProc">var</span> g/<span class="muRegEax">eax</span>: grapheme <span class="Special"><-</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#L231'>clear-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L35" class="LineNr"> 35 </span> <a href='500fake-screen.mu.html#L251'>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"><-</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"><-</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"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L37" class="LineNr"> 37 </span> <span class="PreProc">var</span> a/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L38" class="LineNr"> 38 </span> <span class="PreProc">var</span> b/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L39" class="LineNr"> 39 </span> <span class="PreProc">var</span> c/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</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"><-</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>
|
||||
|
@ -114,24 +119,24 @@ if ('onhashchange' in window) {
|
|||
<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"> -> </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="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"> -> </span>_/<span class="muRegEcx">ecx</span>: int, _/<span class="muRegEdx">edx</span>: int, _/<span class="muRegEbx">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"><-</span> <a href='112read-byte.subx.html#L13'>read-byte</a> in
|
||||
<span id="L60" class="LineNr"> 60 </span> <span class="PreProc">var</span> tmp/<span class="muRegEax">eax</span>: byte <span class="Special"><-</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"><-</span> <a href='118parse-hex-int.subx.html#L701'>hex-digit?</a> tmp
|
||||
<span id="L62" class="LineNr"> 62 </span> <span class="PreProc">var</span> valid?/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</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='317abort.subx.html#L5'>abort</a> <span class="Constant">"invalid byte 0 of r"</span>
|
||||
<span id="L66" class="LineNr"> 66 </span> <span class="Delimiter">}</span>
|
||||
<span id="L67" class="LineNr"> 67 </span> tmp <span class="Special"><-</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"><-</span> copy tmp
|
||||
<span id="L68" class="LineNr"> 68 </span> <span class="PreProc">var</span> r/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</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"><-</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"><-</span> <a href='118parse-hex-int.subx.html#L701'>hex-digit?</a> tmp
|
||||
<span id="L75" class="LineNr"> 75 </span> <span class="PreProc">var</span> valid?/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</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>
|
||||
|
@ -150,22 +155,22 @@ if ('onhashchange' in window) {
|
|||
<span id="L91" class="LineNr"> 91 </span> tmp <span class="Special"><-</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"><-</span> <a href='112read-byte.subx.html#L13'>read-byte</a> in
|
||||
<span id="L94" class="LineNr"> 94 </span> <span class="PreProc">var</span> tmp/<span class="muRegEax">eax</span>: byte <span class="Special"><-</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"><-</span> <a href='118parse-hex-int.subx.html#L701'>hex-digit?</a> tmp
|
||||
<span id="L96" class="LineNr"> 96 </span> <span class="PreProc">var</span> valid?/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</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='317abort.subx.html#L5'>abort</a> <span class="Constant">"invalid byte 0 of g"</span>
|
||||
<span id="L100" class="LineNr">100 </span> <span class="Delimiter">}</span>
|
||||
<span id="L101" class="LineNr">101 </span> tmp <span class="Special"><-</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"><-</span> copy tmp
|
||||
<span id="L102" class="LineNr">102 </span> <span class="PreProc">var</span> g/<span class="muRegEdx">edx</span>: int <span class="Special"><-</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"><-</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"><-</span> <a href='118parse-hex-int.subx.html#L701'>hex-digit?</a> tmp
|
||||
<span id="L109" class="LineNr">109 </span> <span class="PreProc">var</span> valid?/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</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>
|
||||
|
@ -184,27 +189,27 @@ if ('onhashchange' in window) {
|
|||
<span id="L125" class="LineNr">125 </span> tmp <span class="Special"><-</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"><-</span> <a href='112read-byte.subx.html#L13'>read-byte</a> in
|
||||
<span id="L128" class="LineNr">128 </span> <span class="PreProc">var</span> tmp/<span class="muRegEax">eax</span>: byte <span class="Special"><-</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"><-</span> <a href='118parse-hex-int.subx.html#L701'>hex-digit?</a> tmp
|
||||
<span id="L130" class="LineNr">130 </span> <span class="PreProc">var</span> valid?/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</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='317abort.subx.html#L5'>abort</a> <span class="Constant">"invalid byte 0 of b"</span>
|
||||
<span id="L134" class="LineNr">134 </span> <span class="Delimiter">}</span>
|
||||
<span id="L135" class="LineNr">135 </span> tmp <span class="Special"><-</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"><-</span> copy tmp
|
||||
<span id="L136" class="LineNr">136 </span> <span class="PreProc">var</span> b/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</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"><-</span> <a href='309stream.subx.html#L6'>stream-empty?</a> in
|
||||
<span id="L142" class="LineNr">142 </span> <span class="PreProc">var</span> done?/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</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"><-</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"><-</span> <a href='118parse-hex-int.subx.html#L701'>hex-digit?</a> tmp
|
||||
<span id="L148" class="LineNr">148 </span> <span class="PreProc">var</span> valid?/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</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>
|
||||
|
@ -225,8 +230,8 @@ if ('onhashchange' in window) {
|
|||
<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"> -> </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"><-</span> copy in
|
||||
<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"> -> </span>_/<span class="muRegEax">eax</span>: byte <span class="Delimiter">{</span>
|
||||
<span id="L170" class="LineNr">170 </span> <span class="PreProc">var</span> result/<span class="muRegEax">eax</span>: byte <span class="Special"><-</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-></span>
|
||||
|
@ -255,11 +260,11 @@ if ('onhashchange' in window) {
|
|||
<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, " ", 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"><-</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"><-</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"><-</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"><-</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"><-</span> copy <span class="Constant">2</span>
|
||||
<span id="L199" class="LineNr">199 </span> <span class="PreProc">var</span> a/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L200" class="LineNr">200 </span> <span class="PreProc">var</span> b/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L201" class="LineNr">201 </span> <span class="PreProc">var</span> c/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L202" class="LineNr">202 </span> <span class="PreProc">var</span> color/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L203" class="LineNr">203 </span> <span class="PreProc">var</span> y/<span class="muRegEsi">esi</span>: int <span class="Special"><-</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->=</span>
|
||||
|
@ -275,9 +280,9 @@ if ('onhashchange' in window) {
|
|||
<span id="L216" class="LineNr">216 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L217" class="LineNr">217 </span> compare c, l
|
||||
<span id="L218" class="LineNr">218 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L219" class="LineNr">219 </span> <a href='500fake-screen.mu.html#L170'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x10</span>/x, y
|
||||
<span id="L219" class="LineNr">219 </span> <a href='500fake-screen.mu.html#L190'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x10</span>/x, y
|
||||
<span id="L220" class="LineNr">220 </span> <a href='501draw-text.mu.html#L387'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, color, <span class="Constant">7</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L221" class="LineNr">221 </span> <a href='500fake-screen.mu.html#L170'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x14</span>/x, y
|
||||
<span id="L221" class="LineNr">221 </span> <a href='500fake-screen.mu.html#L190'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x14</span>/x, y
|
||||
<span id="L222" class="LineNr">222 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">" "</span>, <span class="Constant">7</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L223" class="LineNr">223 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">" "</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, " ", 7/fg, 0/bg</span>
|
||||
|
|
16
html/ex10.mu.html
generated
16
html/ex10.mu.html
generated
|
@ -15,9 +15,11 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.PreProc { color: #c000c0; }
|
||||
.muRegEcx { color: #af875f; }
|
||||
.Special { color: #ff6060; }
|
||||
.LineNr { }
|
||||
.Constant { color: #008787; }
|
||||
.muRegEax { color: #875f00; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muComment { color: #005faf; }
|
||||
|
@ -72,9 +74,9 @@ if ('onhashchange' in window) {
|
|||
<span id="L14" class="LineNr">14 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex10.mu.html#L14'>main</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
|
||||
<span id="L15" class="LineNr">15 </span> <span class="muComment"># repeatedly print out mouse driver results if non-zero</span>
|
||||
<span id="L16" class="LineNr">16 </span> $main:event-loop: <span class="Delimiter">{</span>
|
||||
<span id="L17" class="LineNr">17 </span> <span class="PreProc">var</span> dx/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L18" class="LineNr">18 </span> <span class="PreProc">var</span> dy/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L19" class="LineNr">19 </span> dx, dy <span class="Special"><-</span> <a href='boot.subx.html#L1429'>read-mouse-event</a>
|
||||
<span id="L17" class="LineNr">17 </span> <span class="PreProc">var</span> dx/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L18" class="LineNr">18 </span> <span class="PreProc">var</span> dy/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L19" class="LineNr">19 </span> dx, dy <span class="Special"><-</span> <a href='boot.subx.html#L1443'>read-mouse-event</a>
|
||||
<span id="L20" class="LineNr">20 </span> <span class="Delimiter">{</span>
|
||||
<span id="L21" class="LineNr">21 </span> compare dx, <span class="Constant">0</span>
|
||||
<span id="L22" class="LineNr">22 </span> <span class="PreProc">break-if-!=</span>
|
||||
|
@ -83,16 +85,16 @@ if ('onhashchange' in window) {
|
|||
<span id="L25" class="LineNr">25 </span> <span class="PreProc">loop</span> $main:event-loop
|
||||
<span id="L26" class="LineNr">26 </span> <span class="Delimiter">}</span>
|
||||
<span id="L27" class="LineNr">27 </span> <span class="Delimiter">{</span>
|
||||
<span id="L28" class="LineNr">28 </span> <span class="PreProc">var</span> dummy1/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L29" class="LineNr">29 </span> <span class="PreProc">var</span> dummy2/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L28" class="LineNr">28 </span> <span class="PreProc">var</span> dummy1/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L29" class="LineNr">29 </span> <span class="PreProc">var</span> dummy2/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L30" class="LineNr">30 </span> dummy1, dummy2 <span class="Special"><-</span> <a href='501draw-text.mu.html#L256'>draw-text-wrapping-right-then-down-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">" "</span>, <span class="Constant">0</span>/x, <span class="Constant">0x10</span>/y, <span class="Constant">0x31</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L31" class="LineNr">31 </span> <span class="Delimiter">}</span>
|
||||
<span id="L32" class="LineNr">32 </span> <span class="Delimiter">{</span>
|
||||
<span id="L33" class="LineNr">33 </span> <span class="PreProc">var</span> dummy/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L33" class="LineNr">33 </span> <span class="PreProc">var</span> dummy/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L34" class="LineNr">34 </span> dx, dummy <span class="Special"><-</span> <a href='501draw-text.mu.html#L364'>draw-int32-decimal-wrapping-right-then-down-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, dx, <span class="Constant">0</span>/x, <span class="Constant">0x10</span>/y, <span class="Constant">0x31</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L35" class="LineNr">35 </span> <span class="Delimiter">}</span>
|
||||
<span id="L36" class="LineNr">36 </span> <span class="Delimiter">{</span>
|
||||
<span id="L37" class="LineNr">37 </span> <span class="PreProc">var</span> dummy/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L37" class="LineNr">37 </span> <span class="PreProc">var</span> dummy/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L38" class="LineNr">38 </span> dummy, dy <span class="Special"><-</span> <a href='501draw-text.mu.html#L364'>draw-int32-decimal-wrapping-right-then-down-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, dy, <span class="Constant">5</span>/x, <span class="Constant">0x10</span>/y, <span class="Constant">0x31</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L39" class="LineNr">39 </span> <span class="Delimiter">}</span>
|
||||
<span id="L40" class="LineNr">40 </span> <span class="PreProc">loop</span>
|
||||
|
|
156
html/ex11.mu.html
generated
156
html/ex11.mu.html
generated
|
@ -15,9 +15,15 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.PreProc { color: #c000c0; }
|
||||
.muRegEcx { color: #af875f; }
|
||||
.Special { color: #ff6060; }
|
||||
.LineNr { }
|
||||
.muRegEdi { color: #87ffd7; }
|
||||
.muRegEbx { color: #8787af; }
|
||||
.muRegEdx { color: #878700; }
|
||||
.Constant { color: #008787; }
|
||||
.muRegEsi { color: #87d787; }
|
||||
.muRegEax { color: #875f00; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muComment { color: #005faf; }
|
||||
|
@ -71,7 +77,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L13" class="LineNr"> 13 </span>
|
||||
<span id="L14" class="LineNr"> 14 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L14'>main</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
|
||||
<span id="L15" class="LineNr"> 15 </span> <span class="PreProc">var</span> env-storage: <a href='ex11.mu.html#L25'>environment</a>
|
||||
<span id="L16" class="LineNr"> 16 </span> <span class="PreProc">var</span> env/<span class="Constant">esi</span>: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Special"><-</span> address env-storage
|
||||
<span id="L16" class="LineNr"> 16 </span> <span class="PreProc">var</span> env/<span class="muRegEsi">esi</span>: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Special"><-</span> address env-storage
|
||||
<span id="L17" class="LineNr"> 17 </span> <a href='ex11.mu.html#L233'>initialize-environment</a> env, <span class="Constant">0x200</span> <span class="Constant">0x20</span>, <span class="Constant">0x180</span> <span class="Constant">0x90</span>, <span class="Constant">0x180</span> <span class="Constant">0x160</span>
|
||||
<span id="L18" class="LineNr"> 18 </span> <span class="Delimiter">{</span>
|
||||
<span id="L19" class="LineNr"> 19 </span> <a href='ex11.mu.html#L37'>render</a> <a href='500fake-screen.mu.html#L14'>screen</a>, env
|
||||
|
@ -93,17 +99,17 @@ if ('onhashchange' in window) {
|
|||
<span id="L35" class="LineNr"> 35 </span><span class="Delimiter">}</span>
|
||||
<span id="L36" class="LineNr"> 36 </span>
|
||||
<span id="L37" class="LineNr"> 37 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L37'>render</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), _self: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Delimiter">{</span>
|
||||
<span id="L38" class="LineNr"> 38 </span> <a href='500fake-screen.mu.html#L231'>clear-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L39" class="LineNr"> 39 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L40" class="LineNr"> 40 </span> <span class="PreProc">var</span> tmp-ah/<span class="Constant">ecx</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> get self, p0
|
||||
<span id="L41" class="LineNr"> 41 </span> <span class="PreProc">var</span> tmp/<span class="Constant">eax</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *tmp-ah
|
||||
<span id="L42" class="LineNr"> 42 </span> <span class="PreProc">var</span> p0/<span class="Constant">ebx</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> copy tmp
|
||||
<span id="L38" class="LineNr"> 38 </span> <a href='500fake-screen.mu.html#L251'>clear-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L39" class="LineNr"> 39 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L40" class="LineNr"> 40 </span> <span class="PreProc">var</span> tmp-ah/<span class="muRegEcx">ecx</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> get self, p0
|
||||
<span id="L41" class="LineNr"> 41 </span> <span class="PreProc">var</span> tmp/<span class="muRegEax">eax</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *tmp-ah
|
||||
<span id="L42" class="LineNr"> 42 </span> <span class="PreProc">var</span> p0/<span class="muRegEbx">ebx</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> copy tmp
|
||||
<span id="L43" class="LineNr"> 43 </span> tmp-ah <span class="Special"><-</span> get self, p1
|
||||
<span id="L44" class="LineNr"> 44 </span> tmp <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *tmp-ah
|
||||
<span id="L45" class="LineNr"> 45 </span> <span class="PreProc">var</span> p1/<span class="Constant">edx</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> copy tmp
|
||||
<span id="L45" class="LineNr"> 45 </span> <span class="PreProc">var</span> p1/<span class="muRegEdx">edx</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> copy tmp
|
||||
<span id="L46" class="LineNr"> 46 </span> tmp-ah <span class="Special"><-</span> get self, p2
|
||||
<span id="L47" class="LineNr"> 47 </span> tmp <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *tmp-ah
|
||||
<span id="L48" class="LineNr"> 48 </span> <span class="PreProc">var</span> p2/<span class="Constant">ecx</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> copy tmp
|
||||
<span id="L48" class="LineNr"> 48 </span> <span class="PreProc">var</span> p2/<span class="muRegEcx">ecx</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> copy tmp
|
||||
<span id="L49" class="LineNr"> 49 </span> <span class="muComment"># control lines</span>
|
||||
<span id="L50" class="LineNr"> 50 </span> <a href='ex11.mu.html#L216'>line</a> <a href='500fake-screen.mu.html#L14'>screen</a>, p0, p1, <span class="Constant">7</span>/color
|
||||
<span id="L51" class="LineNr"> 51 </span> <a href='ex11.mu.html#L216'>line</a> <a href='500fake-screen.mu.html#L14'>screen</a>, p1, p2, <span class="Constant">7</span>/color
|
||||
|
@ -114,51 +120,51 @@ if ('onhashchange' in window) {
|
|||
<span id="L56" class="LineNr"> 56 </span> <a href='ex11.mu.html#L226'>disc</a> <a href='500fake-screen.mu.html#L14'>screen</a>, p1, <span class="Constant">3</span>/radius, <span class="Constant">7</span>/color <span class="Constant">0xf</span>/border
|
||||
<span id="L57" class="LineNr"> 57 </span> <a href='ex11.mu.html#L226'>disc</a> <a href='500fake-screen.mu.html#L14'>screen</a>, p2, <span class="Constant">3</span>/radius, <span class="Constant">7</span>/color <span class="Constant">0xf</span>/border
|
||||
<span id="L58" class="LineNr"> 58 </span> <span class="muComment"># cursor last of all</span>
|
||||
<span id="L59" class="LineNr"> 59 </span> <span class="PreProc">var</span> cursor-ah/<span class="Constant">eax</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> get self, <a href='ex11.mu.html#L77'>cursor</a>
|
||||
<span id="L60" class="LineNr"> 60 </span> <span class="PreProc">var</span> <a href='ex11.mu.html#L77'>cursor</a>/<span class="Constant">eax</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *cursor-ah
|
||||
<span id="L59" class="LineNr"> 59 </span> <span class="PreProc">var</span> cursor-ah/<span class="muRegEax">eax</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> get self, <a href='ex11.mu.html#L77'>cursor</a>
|
||||
<span id="L60" class="LineNr"> 60 </span> <span class="PreProc">var</span> <a href='ex11.mu.html#L77'>cursor</a>/<span class="muRegEax">eax</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *cursor-ah
|
||||
<span id="L61" class="LineNr"> 61 </span> <a href='ex11.mu.html#L77'>cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <a href='ex11.mu.html#L77'>cursor</a>, <span class="Constant">0xa</span>/side, <span class="Constant">3</span>/color
|
||||
<span id="L62" class="LineNr"> 62 </span><span class="Delimiter">}</span>
|
||||
<span id="L63" class="LineNr"> 63 </span>
|
||||
<span id="L64" class="LineNr"> 64 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L64'>bezier</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), _p0: (addr <a href='ex11.mu.html#L32'>point</a>), _p1: (addr <a href='ex11.mu.html#L32'>point</a>), _p2: (addr <a href='ex11.mu.html#L32'>point</a>), color: int <span class="Delimiter">{</span>
|
||||
<span id="L65" class="LineNr"> 65 </span> <span class="PreProc">var</span> p0/<span class="Constant">esi</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> copy _p0
|
||||
<span id="L66" class="LineNr"> 66 </span> <span class="PreProc">var</span> x0/<span class="Constant">ecx</span>: (addr int) <span class="Special"><-</span> get p0, x
|
||||
<span id="L67" class="LineNr"> 67 </span> <span class="PreProc">var</span> y0/<span class="Constant">edx</span>: (addr int) <span class="Special"><-</span> get p0, y
|
||||
<span id="L68" class="LineNr"> 68 </span> <span class="PreProc">var</span> p1/<span class="Constant">esi</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> copy _p1
|
||||
<span id="L69" class="LineNr"> 69 </span> <span class="PreProc">var</span> x1/<span class="Constant">ebx</span>: (addr int) <span class="Special"><-</span> get p1, x
|
||||
<span id="L70" class="LineNr"> 70 </span> <span class="PreProc">var</span> y1/<span class="Constant">eax</span>: (addr int) <span class="Special"><-</span> get p1, y
|
||||
<span id="L71" class="LineNr"> 71 </span> <span class="PreProc">var</span> p2/<span class="Constant">esi</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> copy _p2
|
||||
<span id="L72" class="LineNr"> 72 </span> <span class="PreProc">var</span> x2/<span class="Constant">edi</span>: (addr int) <span class="Special"><-</span> get p2, x
|
||||
<span id="L73" class="LineNr"> 73 </span> <span class="PreProc">var</span> y2/<span class="Constant">esi</span>: (addr int) <span class="Special"><-</span> get p2, y
|
||||
<span id="L65" class="LineNr"> 65 </span> <span class="PreProc">var</span> p0/<span class="muRegEsi">esi</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> copy _p0
|
||||
<span id="L66" class="LineNr"> 66 </span> <span class="PreProc">var</span> x0/<span class="muRegEcx">ecx</span>: (addr int) <span class="Special"><-</span> get p0, x
|
||||
<span id="L67" class="LineNr"> 67 </span> <span class="PreProc">var</span> y0/<span class="muRegEdx">edx</span>: (addr int) <span class="Special"><-</span> get p0, y
|
||||
<span id="L68" class="LineNr"> 68 </span> <span class="PreProc">var</span> p1/<span class="muRegEsi">esi</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> copy _p1
|
||||
<span id="L69" class="LineNr"> 69 </span> <span class="PreProc">var</span> x1/<span class="muRegEbx">ebx</span>: (addr int) <span class="Special"><-</span> get p1, x
|
||||
<span id="L70" class="LineNr"> 70 </span> <span class="PreProc">var</span> y1/<span class="muRegEax">eax</span>: (addr int) <span class="Special"><-</span> get p1, y
|
||||
<span id="L71" class="LineNr"> 71 </span> <span class="PreProc">var</span> p2/<span class="muRegEsi">esi</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> copy _p2
|
||||
<span id="L72" class="LineNr"> 72 </span> <span class="PreProc">var</span> x2/<span class="muRegEdi">edi</span>: (addr int) <span class="Special"><-</span> get p2, x
|
||||
<span id="L73" class="LineNr"> 73 </span> <span class="PreProc">var</span> y2/<span class="muRegEsi">esi</span>: (addr int) <span class="Special"><-</span> get p2, y
|
||||
<span id="L74" class="LineNr"> 74 </span> <a href='509bezier.mu.html#L14'>draw-monotonic-bezier</a> <a href='500fake-screen.mu.html#L14'>screen</a>, *x0 *y0, *x1 *y1, *x2 *y2, color
|
||||
<span id="L75" class="LineNr"> 75 </span><span class="Delimiter">}</span>
|
||||
<span id="L76" class="LineNr"> 76 </span>
|
||||
<span id="L77" class="LineNr"> 77 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L77'>cursor</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), _p: (addr <a href='ex11.mu.html#L32'>point</a>), side: int, color: int <span class="Delimiter">{</span>
|
||||
<span id="L78" class="LineNr"> 78 </span> <span class="PreProc">var</span> half-side/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy side
|
||||
<span id="L78" class="LineNr"> 78 </span> <span class="PreProc">var</span> half-side/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy side
|
||||
<span id="L79" class="LineNr"> 79 </span> half-side <span class="Special"><-</span> shift-right <span class="Constant">1</span>
|
||||
<span id="L80" class="LineNr"> 80 </span> <span class="PreProc">var</span> p/<span class="Constant">esi</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> copy _p
|
||||
<span id="L81" class="LineNr"> 81 </span> <span class="PreProc">var</span> x-a/<span class="Constant">ecx</span>: (addr int) <span class="Special"><-</span> get p, x
|
||||
<span id="L82" class="LineNr"> 82 </span> <span class="PreProc">var</span> left-x/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy *x-a
|
||||
<span id="L80" class="LineNr"> 80 </span> <span class="PreProc">var</span> p/<span class="muRegEsi">esi</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> copy _p
|
||||
<span id="L81" class="LineNr"> 81 </span> <span class="PreProc">var</span> x-a/<span class="muRegEcx">ecx</span>: (addr int) <span class="Special"><-</span> get p, x
|
||||
<span id="L82" class="LineNr"> 82 </span> <span class="PreProc">var</span> left-x/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy *x-a
|
||||
<span id="L83" class="LineNr"> 83 </span> left-x <span class="Special"><-</span> subtract half-side
|
||||
<span id="L84" class="LineNr"> 84 </span> <span class="PreProc">var</span> y-a/<span class="Constant">edx</span>: (addr int) <span class="Special"><-</span> get p, y
|
||||
<span id="L85" class="LineNr"> 85 </span> <span class="PreProc">var</span> top-y/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy *y-a
|
||||
<span id="L84" class="LineNr"> 84 </span> <span class="PreProc">var</span> y-a/<span class="muRegEdx">edx</span>: (addr int) <span class="Special"><-</span> get p, y
|
||||
<span id="L85" class="LineNr"> 85 </span> <span class="PreProc">var</span> top-y/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy *y-a
|
||||
<span id="L86" class="LineNr"> 86 </span> top-y <span class="Special"><-</span> subtract half-side
|
||||
<span id="L87" class="LineNr"> 87 </span> <span class="PreProc">var</span> max/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy left-x
|
||||
<span id="L87" class="LineNr"> 87 </span> <span class="PreProc">var</span> max/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy left-x
|
||||
<span id="L88" class="LineNr"> 88 </span> max <span class="Special"><-</span> add side
|
||||
<span id="L89" class="LineNr"> 89 </span> <a href='507line.mu.html#L64'>draw-horizontal-line</a> <a href='500fake-screen.mu.html#L14'>screen</a>, top-y, left-x, max, color
|
||||
<span id="L90" class="LineNr"> 90 </span> max <span class="Special"><-</span> copy top-y
|
||||
<span id="L91" class="LineNr"> 91 </span> max <span class="Special"><-</span> add side
|
||||
<span id="L92" class="LineNr"> 92 </span> <a href='507line.mu.html#L75'>draw-vertical-line</a> <a href='500fake-screen.mu.html#L14'>screen</a>, left-x, top-y, max, color
|
||||
<span id="L93" class="LineNr"> 93 </span> <span class="PreProc">var</span> right-x/<span class="Constant">ebx</span>: int <span class="Special"><-</span> copy left-x
|
||||
<span id="L93" class="LineNr"> 93 </span> <span class="PreProc">var</span> right-x/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> copy left-x
|
||||
<span id="L94" class="LineNr"> 94 </span> right-x <span class="Special"><-</span> add side
|
||||
<span id="L95" class="LineNr"> 95 </span> <a href='507line.mu.html#L75'>draw-vertical-line</a> <a href='500fake-screen.mu.html#L14'>screen</a>, right-x, top-y, max, color
|
||||
<span id="L96" class="LineNr"> 96 </span> <span class="PreProc">var</span> bottom-y/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy top-y
|
||||
<span id="L96" class="LineNr"> 96 </span> <span class="PreProc">var</span> bottom-y/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy top-y
|
||||
<span id="L97" class="LineNr"> 97 </span> bottom-y <span class="Special"><-</span> add side
|
||||
<span id="L98" class="LineNr"> 98 </span> <a href='507line.mu.html#L64'>draw-horizontal-line</a> <a href='500fake-screen.mu.html#L14'>screen</a>, bottom-y, left-x, right-x, color
|
||||
<span id="L99" class="LineNr"> 99 </span><span class="Delimiter">}</span>
|
||||
<span id="L100" class="LineNr">100 </span>
|
||||
<span id="L101" class="LineNr">101 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L101'>edit</a></span> keyboard: (addr keyboard), _self: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Delimiter">{</span>
|
||||
<span id="L102" class="LineNr">102 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L103" class="LineNr">103 </span> <span class="PreProc">var</span> key/<span class="Constant">eax</span>: byte <span class="Special"><-</span> <a href='102keyboard.subx.html#L21'>read-key</a> keyboard
|
||||
<span id="L102" class="LineNr">102 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L103" class="LineNr">103 </span> <span class="PreProc">var</span> key/<span class="muRegEax">eax</span>: byte <span class="Special"><-</span> <a href='102keyboard.subx.html#L21'>read-key</a> keyboard
|
||||
<span id="L104" class="LineNr">104 </span> compare key, <span class="Constant">0</span>
|
||||
<span id="L105" class="LineNr">105 </span> <span class="PreProc">loop-if-=</span>
|
||||
<span id="L106" class="LineNr">106 </span> <span class="Delimiter">{</span>
|
||||
|
@ -194,27 +200,27 @@ if ('onhashchange' in window) {
|
|||
<span id="L136" class="LineNr">136 </span><span class="Delimiter">}</span>
|
||||
<span id="L137" class="LineNr">137 </span>
|
||||
<span id="L138" class="LineNr">138 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L138'>toggle-cursor</a></span> _self: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Delimiter">{</span>
|
||||
<span id="L139" class="LineNr">139 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L140" class="LineNr">140 </span> <span class="PreProc">var</span> cursor-ah/<span class="Constant">edi</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> get self, <a href='ex11.mu.html#L77'>cursor</a>
|
||||
<span id="L141" class="LineNr">141 </span> <span class="PreProc">var</span> p0-ah/<span class="Constant">ecx</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> get self, p0
|
||||
<span id="L142" class="LineNr">142 </span> <span class="PreProc">var</span> p1-ah/<span class="Constant">edx</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> get self, p1
|
||||
<span id="L143" class="LineNr">143 </span> <span class="PreProc">var</span> p2-ah/<span class="Constant">ebx</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> get self, p2
|
||||
<span id="L139" class="LineNr">139 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L140" class="LineNr">140 </span> <span class="PreProc">var</span> cursor-ah/<span class="muRegEdi">edi</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> get self, <a href='ex11.mu.html#L77'>cursor</a>
|
||||
<span id="L141" class="LineNr">141 </span> <span class="PreProc">var</span> p0-ah/<span class="muRegEcx">ecx</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> get self, p0
|
||||
<span id="L142" class="LineNr">142 </span> <span class="PreProc">var</span> p1-ah/<span class="muRegEdx">edx</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> get self, p1
|
||||
<span id="L143" class="LineNr">143 </span> <span class="PreProc">var</span> p2-ah/<span class="muRegEbx">ebx</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> get self, p2
|
||||
<span id="L144" class="LineNr">144 </span> <span class="Delimiter">{</span>
|
||||
<span id="L145" class="LineNr">145 </span> <span class="PreProc">var</span> p0?/<span class="Constant">eax</span>: boolean <span class="Special"><-</span> <a href='120allocate.subx.html#L448'>handle-equal?</a> *p0-ah, *cursor-ah
|
||||
<span id="L145" class="LineNr">145 </span> <span class="PreProc">var</span> p0?/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='120allocate.subx.html#L448'>handle-equal?</a> *p0-ah, *cursor-ah
|
||||
<span id="L146" class="LineNr">146 </span> compare p0?, <span class="Constant">0</span>/false
|
||||
<span id="L147" class="LineNr">147 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L148" class="LineNr">148 </span> copy-object p1-ah, cursor-ah
|
||||
<span id="L149" class="LineNr">149 </span> <span class="PreProc">return</span>
|
||||
<span id="L150" class="LineNr">150 </span> <span class="Delimiter">}</span>
|
||||
<span id="L151" class="LineNr">151 </span> <span class="Delimiter">{</span>
|
||||
<span id="L152" class="LineNr">152 </span> <span class="PreProc">var</span> p1?/<span class="Constant">eax</span>: boolean <span class="Special"><-</span> <a href='120allocate.subx.html#L448'>handle-equal?</a> *p1-ah, *cursor-ah
|
||||
<span id="L152" class="LineNr">152 </span> <span class="PreProc">var</span> p1?/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='120allocate.subx.html#L448'>handle-equal?</a> *p1-ah, *cursor-ah
|
||||
<span id="L153" class="LineNr">153 </span> compare p1?, <span class="Constant">0</span>/false
|
||||
<span id="L154" class="LineNr">154 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L155" class="LineNr">155 </span> copy-object p2-ah, cursor-ah
|
||||
<span id="L156" class="LineNr">156 </span> <span class="PreProc">return</span>
|
||||
<span id="L157" class="LineNr">157 </span> <span class="Delimiter">}</span>
|
||||
<span id="L158" class="LineNr">158 </span> <span class="Delimiter">{</span>
|
||||
<span id="L159" class="LineNr">159 </span> <span class="PreProc">var</span> p2?/<span class="Constant">eax</span>: boolean <span class="Special"><-</span> <a href='120allocate.subx.html#L448'>handle-equal?</a> *p2-ah, *cursor-ah
|
||||
<span id="L159" class="LineNr">159 </span> <span class="PreProc">var</span> p2?/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='120allocate.subx.html#L448'>handle-equal?</a> *p2-ah, *cursor-ah
|
||||
<span id="L160" class="LineNr">160 </span> compare p2?, <span class="Constant">0</span>/false
|
||||
<span id="L161" class="LineNr">161 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L162" class="LineNr">162 </span> copy-object p0-ah, cursor-ah
|
||||
|
@ -224,10 +230,10 @@ if ('onhashchange' in window) {
|
|||
<span id="L166" class="LineNr">166 </span><span class="Delimiter">}</span>
|
||||
<span id="L167" class="LineNr">167 </span>
|
||||
<span id="L168" class="LineNr">168 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L168'>cursor-left</a></span> _self: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Delimiter">{</span>
|
||||
<span id="L169" class="LineNr">169 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L170" class="LineNr">170 </span> <span class="PreProc">var</span> cursor-ah/<span class="Constant">esi</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> get self, <a href='ex11.mu.html#L77'>cursor</a>
|
||||
<span id="L171" class="LineNr">171 </span> <span class="PreProc">var</span> <a href='ex11.mu.html#L77'>cursor</a>/<span class="Constant">eax</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *cursor-ah
|
||||
<span id="L172" class="LineNr">172 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: (addr int) <span class="Special"><-</span> get <a href='ex11.mu.html#L77'>cursor</a>, x
|
||||
<span id="L169" class="LineNr">169 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L170" class="LineNr">170 </span> <span class="PreProc">var</span> cursor-ah/<span class="muRegEsi">esi</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> get self, <a href='ex11.mu.html#L77'>cursor</a>
|
||||
<span id="L171" class="LineNr">171 </span> <span class="PreProc">var</span> <a href='ex11.mu.html#L77'>cursor</a>/<span class="muRegEax">eax</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *cursor-ah
|
||||
<span id="L172" class="LineNr">172 </span> <span class="PreProc">var</span> cursor-x/<span class="muRegEax">eax</span>: (addr int) <span class="Special"><-</span> get <a href='ex11.mu.html#L77'>cursor</a>, x
|
||||
<span id="L173" class="LineNr">173 </span> compare *cursor-x, <span class="Constant">0x20</span>
|
||||
<span id="L174" class="LineNr">174 </span> <span class="Delimiter">{</span>
|
||||
<span id="L175" class="LineNr">175 </span> <span class="PreProc">break-if-<</span>
|
||||
|
@ -236,10 +242,10 @@ if ('onhashchange' in window) {
|
|||
<span id="L178" class="LineNr">178 </span><span class="Delimiter">}</span>
|
||||
<span id="L179" class="LineNr">179 </span>
|
||||
<span id="L180" class="LineNr">180 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L180'>cursor-right</a></span> _self: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Delimiter">{</span>
|
||||
<span id="L181" class="LineNr">181 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L182" class="LineNr">182 </span> <span class="PreProc">var</span> cursor-ah/<span class="Constant">esi</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> get self, <a href='ex11.mu.html#L77'>cursor</a>
|
||||
<span id="L183" class="LineNr">183 </span> <span class="PreProc">var</span> <a href='ex11.mu.html#L77'>cursor</a>/<span class="Constant">eax</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *cursor-ah
|
||||
<span id="L184" class="LineNr">184 </span> <span class="PreProc">var</span> cursor-x/<span class="Constant">eax</span>: (addr int) <span class="Special"><-</span> get <a href='ex11.mu.html#L77'>cursor</a>, x
|
||||
<span id="L181" class="LineNr">181 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L182" class="LineNr">182 </span> <span class="PreProc">var</span> cursor-ah/<span class="muRegEsi">esi</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> get self, <a href='ex11.mu.html#L77'>cursor</a>
|
||||
<span id="L183" class="LineNr">183 </span> <span class="PreProc">var</span> <a href='ex11.mu.html#L77'>cursor</a>/<span class="muRegEax">eax</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *cursor-ah
|
||||
<span id="L184" class="LineNr">184 </span> <span class="PreProc">var</span> cursor-x/<span class="muRegEax">eax</span>: (addr int) <span class="Special"><-</span> get <a href='ex11.mu.html#L77'>cursor</a>, x
|
||||
<span id="L185" class="LineNr">185 </span> compare *cursor-x, <span class="Constant">0x3f0</span>
|
||||
<span id="L186" class="LineNr">186 </span> <span class="Delimiter">{</span>
|
||||
<span id="L187" class="LineNr">187 </span> <span class="PreProc">break-if-></span>
|
||||
|
@ -248,10 +254,10 @@ if ('onhashchange' in window) {
|
|||
<span id="L190" class="LineNr">190 </span><span class="Delimiter">}</span>
|
||||
<span id="L191" class="LineNr">191 </span>
|
||||
<span id="L192" class="LineNr">192 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L192'>cursor-up</a></span> _self: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Delimiter">{</span>
|
||||
<span id="L193" class="LineNr">193 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L194" class="LineNr">194 </span> <span class="PreProc">var</span> cursor-ah/<span class="Constant">esi</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> get self, <a href='ex11.mu.html#L77'>cursor</a>
|
||||
<span id="L195" class="LineNr">195 </span> <span class="PreProc">var</span> <a href='ex11.mu.html#L77'>cursor</a>/<span class="Constant">eax</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *cursor-ah
|
||||
<span id="L196" class="LineNr">196 </span> <span class="PreProc">var</span> cursor-y/<span class="Constant">eax</span>: (addr int) <span class="Special"><-</span> get <a href='ex11.mu.html#L77'>cursor</a>, y
|
||||
<span id="L193" class="LineNr">193 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L194" class="LineNr">194 </span> <span class="PreProc">var</span> cursor-ah/<span class="muRegEsi">esi</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> get self, <a href='ex11.mu.html#L77'>cursor</a>
|
||||
<span id="L195" class="LineNr">195 </span> <span class="PreProc">var</span> <a href='ex11.mu.html#L77'>cursor</a>/<span class="muRegEax">eax</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *cursor-ah
|
||||
<span id="L196" class="LineNr">196 </span> <span class="PreProc">var</span> cursor-y/<span class="muRegEax">eax</span>: (addr int) <span class="Special"><-</span> get <a href='ex11.mu.html#L77'>cursor</a>, y
|
||||
<span id="L197" class="LineNr">197 </span> compare *cursor-y, <span class="Constant">0x20</span>
|
||||
<span id="L198" class="LineNr">198 </span> <span class="Delimiter">{</span>
|
||||
<span id="L199" class="LineNr">199 </span> <span class="PreProc">break-if-<</span>
|
||||
|
@ -260,10 +266,10 @@ if ('onhashchange' in window) {
|
|||
<span id="L202" class="LineNr">202 </span><span class="Delimiter">}</span>
|
||||
<span id="L203" class="LineNr">203 </span>
|
||||
<span id="L204" class="LineNr">204 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L204'>cursor-down</a></span> _self: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Delimiter">{</span>
|
||||
<span id="L205" class="LineNr">205 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L206" class="LineNr">206 </span> <span class="PreProc">var</span> cursor-ah/<span class="Constant">esi</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> get self, <a href='ex11.mu.html#L77'>cursor</a>
|
||||
<span id="L207" class="LineNr">207 </span> <span class="PreProc">var</span> <a href='ex11.mu.html#L77'>cursor</a>/<span class="Constant">eax</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *cursor-ah
|
||||
<span id="L208" class="LineNr">208 </span> <span class="PreProc">var</span> cursor-y/<span class="Constant">eax</span>: (addr int) <span class="Special"><-</span> get <a href='ex11.mu.html#L77'>cursor</a>, y
|
||||
<span id="L205" class="LineNr">205 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L206" class="LineNr">206 </span> <span class="PreProc">var</span> cursor-ah/<span class="muRegEsi">esi</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> get self, <a href='ex11.mu.html#L77'>cursor</a>
|
||||
<span id="L207" class="LineNr">207 </span> <span class="PreProc">var</span> <a href='ex11.mu.html#L77'>cursor</a>/<span class="muRegEax">eax</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *cursor-ah
|
||||
<span id="L208" class="LineNr">208 </span> <span class="PreProc">var</span> cursor-y/<span class="muRegEax">eax</span>: (addr int) <span class="Special"><-</span> get <a href='ex11.mu.html#L77'>cursor</a>, y
|
||||
<span id="L209" class="LineNr">209 </span> compare *cursor-y, <span class="Constant">0x2f0</span>
|
||||
<span id="L210" class="LineNr">210 </span> <span class="Delimiter">{</span>
|
||||
<span id="L211" class="LineNr">211 </span> <span class="PreProc">break-if-></span>
|
||||
|
@ -272,46 +278,46 @@ if ('onhashchange' in window) {
|
|||
<span id="L214" class="LineNr">214 </span><span class="Delimiter">}</span>
|
||||
<span id="L215" class="LineNr">215 </span>
|
||||
<span id="L216" class="LineNr">216 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L216'>line</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), _p0: (addr <a href='ex11.mu.html#L32'>point</a>), _p1: (addr <a href='ex11.mu.html#L32'>point</a>), color: int <span class="Delimiter">{</span>
|
||||
<span id="L217" class="LineNr">217 </span> <span class="PreProc">var</span> p0/<span class="Constant">esi</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> copy _p0
|
||||
<span id="L218" class="LineNr">218 </span> <span class="PreProc">var</span> x0/<span class="Constant">ecx</span>: (addr int) <span class="Special"><-</span> get p0, x
|
||||
<span id="L219" class="LineNr">219 </span> <span class="PreProc">var</span> y0/<span class="Constant">edx</span>: (addr int) <span class="Special"><-</span> get p0, y
|
||||
<span id="L220" class="LineNr">220 </span> <span class="PreProc">var</span> p1/<span class="Constant">esi</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> copy _p1
|
||||
<span id="L221" class="LineNr">221 </span> <span class="PreProc">var</span> x1/<span class="Constant">ebx</span>: (addr int) <span class="Special"><-</span> get p1, x
|
||||
<span id="L222" class="LineNr">222 </span> <span class="PreProc">var</span> y1/<span class="Constant">eax</span>: (addr int) <span class="Special"><-</span> get p1, y
|
||||
<span id="L217" class="LineNr">217 </span> <span class="PreProc">var</span> p0/<span class="muRegEsi">esi</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> copy _p0
|
||||
<span id="L218" class="LineNr">218 </span> <span class="PreProc">var</span> x0/<span class="muRegEcx">ecx</span>: (addr int) <span class="Special"><-</span> get p0, x
|
||||
<span id="L219" class="LineNr">219 </span> <span class="PreProc">var</span> y0/<span class="muRegEdx">edx</span>: (addr int) <span class="Special"><-</span> get p0, y
|
||||
<span id="L220" class="LineNr">220 </span> <span class="PreProc">var</span> p1/<span class="muRegEsi">esi</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> copy _p1
|
||||
<span id="L221" class="LineNr">221 </span> <span class="PreProc">var</span> x1/<span class="muRegEbx">ebx</span>: (addr int) <span class="Special"><-</span> get p1, x
|
||||
<span id="L222" class="LineNr">222 </span> <span class="PreProc">var</span> y1/<span class="muRegEax">eax</span>: (addr int) <span class="Special"><-</span> get p1, y
|
||||
<span id="L223" class="LineNr">223 </span> <a href='507line.mu.html#L1'>draw-line</a> <a href='500fake-screen.mu.html#L14'>screen</a>, *x0 *y0, *x1 *y1, color
|
||||
<span id="L224" class="LineNr">224 </span><span class="Delimiter">}</span>
|
||||
<span id="L225" class="LineNr">225 </span>
|
||||
<span id="L226" class="LineNr">226 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L226'>disc</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), _p: (addr <a href='ex11.mu.html#L32'>point</a>), radius: int, color: int, border-color: int <span class="Delimiter">{</span>
|
||||
<span id="L227" class="LineNr">227 </span> <span class="PreProc">var</span> p/<span class="Constant">esi</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> copy _p
|
||||
<span id="L228" class="LineNr">228 </span> <span class="PreProc">var</span> x/<span class="Constant">ecx</span>: (addr int) <span class="Special"><-</span> get p, x
|
||||
<span id="L229" class="LineNr">229 </span> <span class="PreProc">var</span> y/<span class="Constant">edx</span>: (addr int) <span class="Special"><-</span> get p, y
|
||||
<span id="L227" class="LineNr">227 </span> <span class="PreProc">var</span> p/<span class="muRegEsi">esi</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> copy _p
|
||||
<span id="L228" class="LineNr">228 </span> <span class="PreProc">var</span> x/<span class="muRegEcx">ecx</span>: (addr int) <span class="Special"><-</span> get p, x
|
||||
<span id="L229" class="LineNr">229 </span> <span class="PreProc">var</span> y/<span class="muRegEdx">edx</span>: (addr int) <span class="Special"><-</span> get p, y
|
||||
<span id="L230" class="LineNr">230 </span> <a href='508circle.mu.html#L80'>draw-disc</a> <a href='500fake-screen.mu.html#L14'>screen</a>, *x *y, radius, color, border-color
|
||||
<span id="L231" class="LineNr">231 </span><span class="Delimiter">}</span>
|
||||
<span id="L232" class="LineNr">232 </span>
|
||||
<span id="L233" class="LineNr">233 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L233'>initialize-environment</a></span> _self: (addr <a href='ex11.mu.html#L25'>environment</a>), x0: int, y0: int, x1: int, y1: int, x2: int, y2: int <span class="Delimiter">{</span>
|
||||
<span id="L234" class="LineNr">234 </span> <span class="PreProc">var</span> self/<span class="Constant">esi</span>: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L235" class="LineNr">235 </span> <span class="PreProc">var</span> p0-ah/<span class="Constant">eax</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> get self, p0
|
||||
<span id="L234" class="LineNr">234 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L235" class="LineNr">235 </span> <span class="PreProc">var</span> p0-ah/<span class="muRegEax">eax</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> get self, p0
|
||||
<span id="L236" class="LineNr">236 </span> <a href='120allocate.subx.html#L43'>allocate</a> p0-ah
|
||||
<span id="L237" class="LineNr">237 </span> <span class="PreProc">var</span> p0/<span class="Constant">eax</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *p0-ah
|
||||
<span id="L237" class="LineNr">237 </span> <span class="PreProc">var</span> p0/<span class="muRegEax">eax</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *p0-ah
|
||||
<span id="L238" class="LineNr">238 </span> <a href='ex11.mu.html#L253'>initialize-point</a> p0, x0 y0
|
||||
<span id="L239" class="LineNr">239 </span> <span class="PreProc">var</span> p1-ah/<span class="Constant">eax</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> get self, p1
|
||||
<span id="L239" class="LineNr">239 </span> <span class="PreProc">var</span> p1-ah/<span class="muRegEax">eax</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> get self, p1
|
||||
<span id="L240" class="LineNr">240 </span> <a href='120allocate.subx.html#L43'>allocate</a> p1-ah
|
||||
<span id="L241" class="LineNr">241 </span> <span class="PreProc">var</span> p1/<span class="Constant">eax</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *p1-ah
|
||||
<span id="L241" class="LineNr">241 </span> <span class="PreProc">var</span> p1/<span class="muRegEax">eax</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *p1-ah
|
||||
<span id="L242" class="LineNr">242 </span> <a href='ex11.mu.html#L253'>initialize-point</a> p1, x1 y1
|
||||
<span id="L243" class="LineNr">243 </span> <span class="PreProc">var</span> p2-ah/<span class="Constant">eax</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> get self, p2
|
||||
<span id="L243" class="LineNr">243 </span> <span class="PreProc">var</span> p2-ah/<span class="muRegEax">eax</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> get self, p2
|
||||
<span id="L244" class="LineNr">244 </span> <a href='120allocate.subx.html#L43'>allocate</a> p2-ah
|
||||
<span id="L245" class="LineNr">245 </span> <span class="PreProc">var</span> p2/<span class="Constant">eax</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *p2-ah
|
||||
<span id="L245" class="LineNr">245 </span> <span class="PreProc">var</span> p2/<span class="muRegEax">eax</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *p2-ah
|
||||
<span id="L246" class="LineNr">246 </span> <a href='ex11.mu.html#L253'>initialize-point</a> p2, x2 y2
|
||||
<span id="L247" class="LineNr">247 </span> <span class="muComment"># cursor initially at p0</span>
|
||||
<span id="L248" class="LineNr">248 </span> <span class="PreProc">var</span> cursor-ah/<span class="Constant">edi</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> get self, <a href='ex11.mu.html#L77'>cursor</a>
|
||||
<span id="L249" class="LineNr">249 </span> <span class="PreProc">var</span> src-ah/<span class="Constant">esi</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> get self, p0
|
||||
<span id="L248" class="LineNr">248 </span> <span class="PreProc">var</span> cursor-ah/<span class="muRegEdi">edi</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> get self, <a href='ex11.mu.html#L77'>cursor</a>
|
||||
<span id="L249" class="LineNr">249 </span> <span class="PreProc">var</span> src-ah/<span class="muRegEsi">esi</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> get self, p0
|
||||
<span id="L250" class="LineNr">250 </span> copy-object src-ah, cursor-ah
|
||||
<span id="L251" class="LineNr">251 </span><span class="Delimiter">}</span>
|
||||
<span id="L252" class="LineNr">252 </span>
|
||||
<span id="L253" class="LineNr">253 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L253'>initialize-point</a></span> _p: (addr <a href='ex11.mu.html#L32'>point</a>), x: int, y: int <span class="Delimiter">{</span>
|
||||
<span id="L254" class="LineNr">254 </span> <span class="PreProc">var</span> p/<span class="Constant">esi</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> copy _p
|
||||
<span id="L255" class="LineNr">255 </span> <span class="PreProc">var</span> dest/<span class="Constant">eax</span>: (addr int) <span class="Special"><-</span> get p, x
|
||||
<span id="L256" class="LineNr">256 </span> <span class="PreProc">var</span> src/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy x
|
||||
<span id="L254" class="LineNr">254 </span> <span class="PreProc">var</span> p/<span class="muRegEsi">esi</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special"><-</span> copy _p
|
||||
<span id="L255" class="LineNr">255 </span> <span class="PreProc">var</span> dest/<span class="muRegEax">eax</span>: (addr int) <span class="Special"><-</span> get p, x
|
||||
<span id="L256" class="LineNr">256 </span> <span class="PreProc">var</span> src/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy x
|
||||
<span id="L257" class="LineNr">257 </span> copy-to *dest, src
|
||||
<span id="L258" class="LineNr">258 </span> dest <span class="Special"><-</span> get p, y
|
||||
<span id="L259" class="LineNr">259 </span> src <span class="Special"><-</span> copy y
|
||||
|
|
11
html/ex2.mu.html
generated
11
html/ex2.mu.html
generated
|
@ -15,9 +15,12 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.PreProc { color: #c000c0; }
|
||||
.muRegEcx { color: #af875f; }
|
||||
.Special { color: #ff6060; }
|
||||
.LineNr { }
|
||||
.muRegEdx { color: #878700; }
|
||||
.Constant { color: #008787; }
|
||||
.muRegEax { color: #875f00; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muComment { color: #005faf; }
|
||||
|
@ -66,17 +69,17 @@ if ('onhashchange' in window) {
|
|||
<span id="L8" class="LineNr"> 8 </span><span class="muComment"># bochs -f bochsrc # bochsrc loads code.img</span>
|
||||
<span id="L9" class="LineNr"> 9 </span>
|
||||
<span id="L10" class="LineNr">10 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex2.mu.html#L10'>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="L11" class="LineNr">11 </span> <span class="PreProc">var</span> y/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L11" class="LineNr">11 </span> <span class="PreProc">var</span> y/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L12" class="LineNr">12 </span> <span class="Delimiter">{</span>
|
||||
<span id="L13" class="LineNr">13 </span> compare y, <span class="Constant">0x300</span>/screen-height=<span class="Constant">768</span>
|
||||
<span id="L14" class="LineNr">14 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L15" class="LineNr">15 </span> <span class="PreProc">var</span> x/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L15" class="LineNr">15 </span> <span class="PreProc">var</span> x/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L16" class="LineNr">16 </span> <span class="Delimiter">{</span>
|
||||
<span id="L17" class="LineNr">17 </span> compare x, <span class="Constant">0x400</span>/screen-width=<span class="Constant">1024</span>
|
||||
<span id="L18" class="LineNr">18 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L19" class="LineNr">19 </span> <span class="PreProc">var</span> color/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy x
|
||||
<span id="L19" class="LineNr">19 </span> <span class="PreProc">var</span> color/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy x
|
||||
<span id="L20" class="LineNr">20 </span> color <span class="Special"><-</span> and <span class="Constant">0xff</span>
|
||||
<span id="L21" class="LineNr">21 </span> <a href='500fake-screen.mu.html#L463'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a> x, y, color
|
||||
<span id="L21" class="LineNr">21 </span> <a href='500fake-screen.mu.html#L483'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a> x, y, color
|
||||
<span id="L22" class="LineNr">22 </span> x <span class="Special"><-</span> increment
|
||||
<span id="L23" class="LineNr">23 </span> <span class="PreProc">loop</span>
|
||||
<span id="L24" class="LineNr">24 </span> <span class="Delimiter">}</span>
|
||||
|
|
9
html/ex3.mu.html
generated
9
html/ex3.mu.html
generated
|
@ -18,6 +18,9 @@ a { color:inherit; }
|
|||
.Special { color: #ff6060; }
|
||||
.LineNr { }
|
||||
.Constant { color: #008787; }
|
||||
.muRegEdx { color: #878700; }
|
||||
.muRegEcx { color: #af875f; }
|
||||
.muRegEax { color: #875f00; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muComment { color: #005faf; }
|
||||
|
@ -70,10 +73,10 @@ if ('onhashchange' in window) {
|
|||
<span id="L12" class="LineNr">12 </span><span class="muComment"># screen every time you press a key (letter or digit)</span>
|
||||
<span id="L13" class="LineNr">13 </span>
|
||||
<span id="L14" class="LineNr">14 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex3.mu.html#L14'>main</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
|
||||
<span id="L15" class="LineNr">15 </span> <span class="PreProc">var</span> x/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L16" class="LineNr">16 </span> <span class="PreProc">var</span> y/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L15" class="LineNr">15 </span> <span class="PreProc">var</span> x/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L16" class="LineNr">16 </span> <span class="PreProc">var</span> y/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L17" class="LineNr">17 </span> <span class="Delimiter">{</span>
|
||||
<span id="L18" class="LineNr">18 </span> <span class="PreProc">var</span> key/<span class="Constant">eax</span>: byte <span class="Special"><-</span> <a href='102keyboard.subx.html#L21'>read-key</a> keyboard
|
||||
<span id="L18" class="LineNr">18 </span> <span class="PreProc">var</span> key/<span class="muRegEax">eax</span>: byte <span class="Special"><-</span> <a href='102keyboard.subx.html#L21'>read-key</a> keyboard
|
||||
<span id="L19" class="LineNr">19 </span> compare key, <span class="Constant">0</span>
|
||||
<span id="L20" class="LineNr">20 </span> <span class="PreProc">loop-if-=</span> <span class="muComment"># busy wait</span>
|
||||
<span id="L21" class="LineNr">21 </span> <a href='101screen.subx.html#L8'>pixel-on-real-screen</a> x, y, <span class="Constant">0x31</span>/green
|
||||
|
|
2
html/ex4.mu.html
generated
2
html/ex4.mu.html
generated
|
@ -67,7 +67,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L10" class="LineNr">10 </span><span class="muComment"># Expected output: letter 'A' in green near the top-left corner of screen</span>
|
||||
<span id="L11" class="LineNr">11 </span>
|
||||
<span id="L12" class="LineNr">12 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex4.mu.html#L12'>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="L13" class="LineNr">13 </span> <a href='500fake-screen.mu.html#L114'>draw-code-point</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x41</span>/A, <span class="Constant">2</span>/row, <span class="Constant">1</span>/col, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L13" class="LineNr">13 </span> <a href='500fake-screen.mu.html#L130'>draw-code-point</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x41</span>/A, <span class="Constant">2</span>/row, <span class="Constant">1</span>/col, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L14" class="LineNr">14 </span><span class="Delimiter">}</span>
|
||||
</pre>
|
||||
</body>
|
||||
|
|
3
html/ex5.mu.html
generated
3
html/ex5.mu.html
generated
|
@ -18,6 +18,7 @@ a { color:inherit; }
|
|||
.Special { color: #ff6060; }
|
||||
.LineNr { }
|
||||
.Constant { color: #008787; }
|
||||
.muRegEax { color: #875f00; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muComment { color: #005faf; }
|
||||
|
@ -69,7 +70,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L11" class="LineNr">11 </span><span class="muComment"># Expected output: text in green near the top-left corner of screen</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='ex5.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> dummy/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='501draw-text.mu.html#L100'>draw-text-rightward</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">"hello from baremetal Mu!"</span>, <span class="Constant">0x10</span>/x, <span class="Constant">0x400</span>/xmax, <span class="Constant">0x10</span>/y, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L14" class="LineNr">14 </span> <span class="PreProc">var</span> dummy/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='501draw-text.mu.html#L100'>draw-text-rightward</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">"hello from baremetal Mu!"</span>, <span class="Constant">0x10</span>/x, <span class="Constant">0x400</span>/xmax, <span class="Constant">0x10</span>/y, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L15" class="LineNr">15 </span> dummy <span class="Special"><-</span> <a href='501draw-text.mu.html#L100'>draw-text-rightward</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">"you shouldn't see this"</span>, <span class="Constant">0x10</span>/x, <span class="Constant">0xa0</span>/xmax, <span class="Constant">0x30</span>/y, <span class="Constant">3</span>/fg, <span class="Constant">0</span>/bg <span class="muComment"># xmax is too narrow</span>
|
||||
<span id="L16" class="LineNr">16 </span><span class="Delimiter">}</span>
|
||||
</pre>
|
||||
|
|
6
html/ex6.mu.html
generated
6
html/ex6.mu.html
generated
|
@ -15,9 +15,11 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.PreProc { color: #c000c0; }
|
||||
.muRegEcx { color: #af875f; }
|
||||
.Special { color: #ff6060; }
|
||||
.LineNr { }
|
||||
.Constant { color: #008787; }
|
||||
.muRegEax { color: #875f00; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muComment { color: #005faf; }
|
||||
|
@ -70,8 +72,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L12" class="LineNr">12 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex6.mu.html#L12'>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="L13" class="LineNr">13 </span> <span class="muComment"># drawing text within a bounding box</span>
|
||||
<span id="L14" class="LineNr">14 </span> <a href='503manhattan-line.mu.html#L1'>draw-box-on-real-screen</a> <span class="Constant">0xf</span>, <span class="Constant">0x1f</span>, <span class="Constant">0x79</span>, <span class="Constant">0x51</span>, <span class="Constant">0x4</span>
|
||||
<span id="L15" class="LineNr">15 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0x20</span>
|
||||
<span id="L16" class="LineNr">16 </span> <span class="PreProc">var</span> y/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0x20</span>
|
||||
<span id="L15" class="LineNr">15 </span> <span class="PreProc">var</span> x/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0x20</span>
|
||||
<span id="L16" class="LineNr">16 </span> <span class="PreProc">var</span> y/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0x20</span>
|
||||
<span id="L17" class="LineNr">17 </span> x, y <span class="Special"><-</span> <a href='501draw-text.mu.html#L174'>draw-text-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">"hello "</span>, <span class="Constant">0x10</span>/xmin, <span class="Constant">0x20</span>/ymin, <span class="Constant">0x78</span>/xmax, <span class="Constant">0x50</span>/ymax, x, y, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L18" class="LineNr">18 </span> x, y <span class="Special"><-</span> <a href='501draw-text.mu.html#L174'>draw-text-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">"from "</span>, <span class="Constant">0x10</span>/xmin, <span class="Constant">0x20</span>/ymin, <span class="Constant">0x78</span>/xmax, <span class="Constant">0x50</span>/ymax, x, y, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L19" class="LineNr">19 </span> x, y <span class="Special"><-</span> <a href='501draw-text.mu.html#L174'>draw-text-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">"baremetal "</span>, <span class="Constant">0x10</span>/xmin, <span class="Constant">0x20</span>/ymin, <span class="Constant">0x78</span>/xmax, <span class="Constant">0x50</span>/ymax, x, y, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
|
||||
|
|
11
html/ex7.mu.html
generated
11
html/ex7.mu.html
generated
|
@ -18,6 +18,7 @@ a { color:inherit; }
|
|||
.Special { color: #ff6060; }
|
||||
.LineNr { }
|
||||
.Constant { color: #008787; }
|
||||
.muRegEax { color: #875f00; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muComment { color: #005faf; }
|
||||
|
@ -69,11 +70,11 @@ if ('onhashchange' in window) {
|
|||
<span id="L11" class="LineNr">11 </span><span class="muComment"># k, l.</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='ex7.mu.html#L13'>main</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
|
||||
<span id="L14" class="LineNr">14 </span> <span class="PreProc">var</span> space/<span class="Constant">eax</span>: grapheme <span class="Special"><-</span> copy <span class="Constant">0x20</span>
|
||||
<span id="L15" class="LineNr">15 </span> <a href='500fake-screen.mu.html#L170'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0</span>, <span class="Constant">0</span>
|
||||
<span id="L14" class="LineNr">14 </span> <span class="PreProc">var</span> space/<span class="muRegEax">eax</span>: grapheme <span class="Special"><-</span> copy <span class="Constant">0x20</span>
|
||||
<span id="L15" class="LineNr">15 </span> <a href='500fake-screen.mu.html#L190'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0</span>, <span class="Constant">0</span>
|
||||
<span id="L16" class="LineNr">16 </span> <span class="Delimiter">{</span>
|
||||
<span id="L17" class="LineNr">17 </span> <a href='500fake-screen.mu.html#L217'>draw-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, space
|
||||
<span id="L18" class="LineNr">18 </span> <span class="PreProc">var</span> key/<span class="Constant">eax</span>: byte <span class="Special"><-</span> <a href='102keyboard.subx.html#L21'>read-key</a> keyboard
|
||||
<span id="L17" class="LineNr">17 </span> <a href='500fake-screen.mu.html#L237'>draw-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, space
|
||||
<span id="L18" class="LineNr">18 </span> <span class="PreProc">var</span> key/<span class="muRegEax">eax</span>: byte <span class="Special"><-</span> <a href='102keyboard.subx.html#L21'>read-key</a> keyboard
|
||||
<span id="L19" class="LineNr">19 </span> <span class="Delimiter">{</span>
|
||||
<span id="L20" class="LineNr">20 </span> compare key, <span class="Constant">0x68</span>/h
|
||||
<span id="L21" class="LineNr">21 </span> <span class="PreProc">break-if-!=</span>
|
||||
|
@ -95,7 +96,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L37" class="LineNr">37 </span> <span class="Delimiter">{</span>
|
||||
<span id="L38" class="LineNr">38 </span> compare key, <span class="Constant">0x6c</span>/l
|
||||
<span id="L39" class="LineNr">39 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L40" class="LineNr">40 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: code-point <span class="Special"><-</span> copy <span class="Constant">0x2d</span>/dash
|
||||
<span id="L40" class="LineNr">40 </span> <span class="PreProc">var</span> g/<span class="muRegEax">eax</span>: code-point <span class="Special"><-</span> copy <span class="Constant">0x2d</span>/dash
|
||||
<span id="L41" class="LineNr">41 </span> <a href='501draw-text.mu.html#L92'>draw-code-point-at-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x2d</span>/dash, <span class="Constant">0x31</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L42" class="LineNr">42 </span> <a href='501draw-text.mu.html#L16'>move-cursor-right</a> <span class="Constant">0</span>
|
||||
<span id="L43" class="LineNr">43 </span> <span class="Delimiter">}</span>
|
||||
|
|
3
html/ex8.mu.html
generated
3
html/ex8.mu.html
generated
|
@ -18,6 +18,7 @@ a { color:inherit; }
|
|||
.Special { color: #ff6060; }
|
||||
.LineNr { }
|
||||
.Constant { color: #008787; }
|
||||
.muRegEax { color: #875f00; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muComment { color: #005faf; }
|
||||
|
@ -65,7 +66,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L7" class="LineNr"> 7 </span><span class="muComment"># Set a breakpoint at 0x7c00 and start stepping.</span>
|
||||
<span id="L8" class="LineNr"> 8 </span>
|
||||
<span id="L9" class="LineNr"> 9 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex8.mu.html#L9'>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="L10" class="LineNr">10 </span> <span class="PreProc">var</span> n/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L10" class="LineNr">10 </span> <span class="PreProc">var</span> n/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L11" class="LineNr">11 </span> <span class="PreProc">var</span> result/<span class="Constant">xmm0</span>: float <span class="Special"><-</span> convert n
|
||||
<span id="L12" class="LineNr">12 </span><span class="Delimiter">}</span>
|
||||
</pre>
|
||||
|
|
21
html/ex9.mu.html
generated
21
html/ex9.mu.html
generated
|
@ -15,9 +15,12 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.PreProc { color: #c000c0; }
|
||||
.muRegEdi { color: #87ffd7; }
|
||||
.Special { color: #ff6060; }
|
||||
.LineNr { }
|
||||
.Constant { color: #008787; }
|
||||
.muRegEsi { color: #87d787; }
|
||||
.muRegEax { color: #875f00; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muComment { color: #005faf; }
|
||||
|
@ -75,24 +78,24 @@ if ('onhashchange' in window) {
|
|||
<span id="L17" class="LineNr">17 </span>
|
||||
<span id="L18" class="LineNr">18 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex9.mu.html#L18'>main</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
|
||||
<span id="L19" class="LineNr">19 </span> <span class="PreProc">var</span> text-storage: (stream byte <span class="Constant">0x200</span>)
|
||||
<span id="L20" class="LineNr">20 </span> <span class="PreProc">var</span> text/<span class="Constant">esi</span>: (addr stream byte) <span class="Special"><-</span> address text-storage
|
||||
<span id="L21" class="LineNr">21 </span> <a href='boot.subx.html#L960'>load-sectors</a> data-disk, <span class="Constant">0</span>/lba, <span class="Constant">1</span>/num-sectors, text
|
||||
<span id="L20" class="LineNr">20 </span> <span class="PreProc">var</span> text/<span class="muRegEsi">esi</span>: (addr stream byte) <span class="Special"><-</span> address text-storage
|
||||
<span id="L21" class="LineNr">21 </span> <a href='boot.subx.html#L974'>load-sectors</a> data-disk, <span class="Constant">0</span>/lba, <span class="Constant">1</span>/num-sectors, text
|
||||
<span id="L22" class="LineNr">22 </span>
|
||||
<span id="L23" class="LineNr">23 </span> <span class="PreProc">var</span> <a href='ex9.mu.html#L31'>word-count</a>/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='ex9.mu.html#L31'>word-count</a> text
|
||||
<span id="L23" class="LineNr">23 </span> <span class="PreProc">var</span> <a href='ex9.mu.html#L31'>word-count</a>/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='ex9.mu.html#L31'>word-count</a> text
|
||||
<span id="L24" class="LineNr">24 </span>
|
||||
<span id="L25" class="LineNr">25 </span> <span class="PreProc">var</span> result-storage: (stream byte <span class="Constant">0x10</span>)
|
||||
<span id="L26" class="LineNr">26 </span> <span class="PreProc">var</span> result/<span class="Constant">edi</span>: (addr stream byte) <span class="Special"><-</span> address result-storage
|
||||
<span id="L26" class="LineNr">26 </span> <span class="PreProc">var</span> result/<span class="muRegEdi">edi</span>: (addr stream byte) <span class="Special"><-</span> address result-storage
|
||||
<span id="L27" class="LineNr">27 </span> <a href='126write-int-decimal.subx.html#L8'>write-int32-decimal</a> result, <a href='ex9.mu.html#L31'>word-count</a>
|
||||
<span id="L28" class="LineNr">28 </span> <a href='boot.subx.html#L1023'>store-sectors</a> data-disk, <span class="Constant">0</span>/lba, <span class="Constant">1</span>/num-sectors, result
|
||||
<span id="L28" class="LineNr">28 </span> <a href='boot.subx.html#L1037'>store-sectors</a> data-disk, <span class="Constant">0</span>/lba, <span class="Constant">1</span>/num-sectors, result
|
||||
<span id="L29" class="LineNr">29 </span><span class="Delimiter">}</span>
|
||||
<span id="L30" class="LineNr">30 </span>
|
||||
<span id="L31" class="LineNr">31 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex9.mu.html#L31'>word-count</a></span> in: (addr stream byte)<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L32" class="LineNr">32 </span> <span class="PreProc">var</span> result/<span class="Constant">edi</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L31" class="LineNr">31 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex9.mu.html#L31'>word-count</a></span> in: (addr stream byte)<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L32" class="LineNr">32 </span> <span class="PreProc">var</span> result/<span class="muRegEdi">edi</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L33" class="LineNr">33 </span> <span class="Delimiter">{</span>
|
||||
<span id="L34" class="LineNr">34 </span> <span class="PreProc">var</span> done?/<span class="Constant">eax</span>: boolean <span class="Special"><-</span> <a href='309stream.subx.html#L6'>stream-empty?</a> in
|
||||
<span id="L34" class="LineNr">34 </span> <span class="PreProc">var</span> done?/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='309stream.subx.html#L6'>stream-empty?</a> in
|
||||
<span id="L35" class="LineNr">35 </span> compare done?, <span class="Constant">0</span>/false
|
||||
<span id="L36" class="LineNr">36 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L37" class="LineNr">37 </span> <span class="PreProc">var</span> g/<span class="Constant">eax</span>: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> in
|
||||
<span id="L37" class="LineNr">37 </span> <span class="PreProc">var</span> g/<span class="muRegEax">eax</span>: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> in
|
||||
<span id="L38" class="LineNr">38 </span> <span class="Delimiter">{</span>
|
||||
<span id="L39" class="LineNr">39 </span> compare g, <span class="Constant">0x20</span>/space
|
||||
<span id="L40" class="LineNr">40 </span> <span class="PreProc">break-if-!=</span>
|
||||
|
|
2015
html/hest-life.mu.html
generated
2015
html/hest-life.mu.html
generated
File diff suppressed because it is too large
Load Diff
70
html/life.mu.html
generated
70
html/life.mu.html
generated
|
@ -14,14 +14,20 @@ pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-
|
|||
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; }
|
||||
.CommentedCode { color: #8a8a8a; }
|
||||
.muRegEdx { color: #878700; }
|
||||
.muRegEbx { color: #8787af; }
|
||||
.muRegEsi { color: #87d787; }
|
||||
.muRegEdi { color: #87ffd7; }
|
||||
.Constant { color: #008787; }
|
||||
.Special { color: #ff6060; }
|
||||
.PreProc { color: #c000c0; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muComment { color: #005faf; }
|
||||
.muRegEax { color: #875f00; }
|
||||
.muRegEcx { color: #af875f; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
@ -64,7 +70,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L5" class="LineNr"> 5 </span><span class="muComment"># To run:</span>
|
||||
<span id="L6" class="LineNr"> 6 </span><span class="muComment"># $ qemu-system-i386 code.img</span>
|
||||
<span id="L7" class="LineNr"> 7 </span>
|
||||
<span id="L8" class="LineNr"> 8 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='life.mu.html#L8'>state</a></span> _grid: (addr array boolean), x: int, y: int<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: boolean <span class="Delimiter">{</span>
|
||||
<span id="L8" class="LineNr"> 8 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='life.mu.html#L8'>state</a></span> _grid: (addr array boolean), x: int, y: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: boolean <span class="Delimiter">{</span>
|
||||
<span id="L9" class="LineNr"> 9 </span> <span class="muComment"># clip at the edge</span>
|
||||
<span id="L10" class="LineNr"> 10 </span> compare x, <span class="Constant">0</span>
|
||||
<span id="L11" class="LineNr"> 11 </span> <span class="Delimiter">{</span>
|
||||
|
@ -86,31 +92,31 @@ if ('onhashchange' in window) {
|
|||
<span id="L27" class="LineNr"> 27 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L28" class="LineNr"> 28 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
|
||||
<span id="L29" class="LineNr"> 29 </span> <span class="Delimiter">}</span>
|
||||
<span id="L30" class="LineNr"> 30 </span> <span class="PreProc">var</span> idx/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy y
|
||||
<span id="L30" class="LineNr"> 30 </span> <span class="PreProc">var</span> idx/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy y
|
||||
<span id="L31" class="LineNr"> 31 </span> idx <span class="Special"><-</span> shift-left <span class="Constant">8</span>/log2width
|
||||
<span id="L32" class="LineNr"> 32 </span> idx <span class="Special"><-</span> add x
|
||||
<span id="L33" class="LineNr"> 33 </span> <span class="PreProc">var</span> grid/<span class="Constant">esi</span>: (addr array boolean) <span class="Special"><-</span> copy _grid
|
||||
<span id="L34" class="LineNr"> 34 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: (addr boolean) <span class="Special"><-</span> index grid, idx
|
||||
<span id="L33" class="LineNr"> 33 </span> <span class="PreProc">var</span> grid/<span class="muRegEsi">esi</span>: (addr array boolean) <span class="Special"><-</span> copy _grid
|
||||
<span id="L34" class="LineNr"> 34 </span> <span class="PreProc">var</span> result/<span class="muRegEax">eax</span>: (addr boolean) <span class="Special"><-</span> index grid, idx
|
||||
<span id="L35" class="LineNr"> 35 </span> <span class="PreProc">return</span> *result
|
||||
<span id="L36" class="LineNr"> 36 </span><span class="Delimiter">}</span>
|
||||
<span id="L37" class="LineNr"> 37 </span>
|
||||
<span id="L38" class="LineNr"> 38 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='life.mu.html#L38'>set-state</a></span> _grid: (addr array boolean), x: int, y: int, val: boolean <span class="Delimiter">{</span>
|
||||
<span id="L39" class="LineNr"> 39 </span> <span class="muComment"># don't bother checking bounds</span>
|
||||
<span id="L40" class="LineNr"> 40 </span> <span class="PreProc">var</span> idx/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy y
|
||||
<span id="L40" class="LineNr"> 40 </span> <span class="PreProc">var</span> idx/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy y
|
||||
<span id="L41" class="LineNr"> 41 </span> idx <span class="Special"><-</span> shift-left <span class="Constant">8</span>/log2width
|
||||
<span id="L42" class="LineNr"> 42 </span> idx <span class="Special"><-</span> add x
|
||||
<span id="L43" class="LineNr"> 43 </span> <span class="PreProc">var</span> grid/<span class="Constant">esi</span>: (addr array boolean) <span class="Special"><-</span> copy _grid
|
||||
<span id="L44" class="LineNr"> 44 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: (addr boolean) <span class="Special"><-</span> index grid, idx
|
||||
<span id="L45" class="LineNr"> 45 </span> <span class="PreProc">var</span> src/<span class="Constant">ecx</span>: boolean <span class="Special"><-</span> copy val
|
||||
<span id="L43" class="LineNr"> 43 </span> <span class="PreProc">var</span> grid/<span class="muRegEsi">esi</span>: (addr array boolean) <span class="Special"><-</span> copy _grid
|
||||
<span id="L44" class="LineNr"> 44 </span> <span class="PreProc">var</span> result/<span class="muRegEax">eax</span>: (addr boolean) <span class="Special"><-</span> index grid, idx
|
||||
<span id="L45" class="LineNr"> 45 </span> <span class="PreProc">var</span> src/<span class="muRegEcx">ecx</span>: boolean <span class="Special"><-</span> copy val
|
||||
<span id="L46" class="LineNr"> 46 </span> copy-to *result, src
|
||||
<span id="L47" class="LineNr"> 47 </span><span class="Delimiter">}</span>
|
||||
<span id="L48" class="LineNr"> 48 </span>
|
||||
<span id="L49" class="LineNr"> 49 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='life.mu.html#L49'>num-live-neighbors</a></span> grid: (addr array boolean), x: int, y: int<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L50" class="LineNr"> 50 </span> <span class="PreProc">var</span> result/<span class="Constant">edi</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L49" class="LineNr"> 49 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='life.mu.html#L49'>num-live-neighbors</a></span> grid: (addr array boolean), x: int, y: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L50" class="LineNr"> 50 </span> <span class="PreProc">var</span> result/<span class="muRegEdi">edi</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L51" class="LineNr"> 51 </span> <span class="muComment"># row above: zig</span>
|
||||
<span id="L52" class="LineNr"> 52 </span> decrement y
|
||||
<span id="L53" class="LineNr"> 53 </span> decrement x
|
||||
<span id="L54" class="LineNr"> 54 </span> <span class="PreProc">var</span> s/<span class="Constant">eax</span>: boolean <span class="Special"><-</span> <a href='life.mu.html#L8'>state</a> grid, x, y
|
||||
<span id="L54" class="LineNr"> 54 </span> <span class="PreProc">var</span> s/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='life.mu.html#L8'>state</a> grid, x, y
|
||||
<span id="L55" class="LineNr"> 55 </span> <span class="Delimiter">{</span>
|
||||
<span id="L56" class="LineNr"> 56 </span> compare s, <span class="Constant">0</span>/false
|
||||
<span id="L57" class="LineNr"> 57 </span> <span class="PreProc">break-if-=</span>
|
||||
|
@ -171,15 +177,15 @@ if ('onhashchange' in window) {
|
|||
<span id="L112" class="LineNr">112 </span><span class="Delimiter">}</span>
|
||||
<span id="L113" class="LineNr">113 </span>
|
||||
<span id="L114" class="LineNr">114 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='life.mu.html#L114'>step</a></span> old-grid: (addr array boolean), new-grid: (addr array boolean) <span class="Delimiter">{</span>
|
||||
<span id="L115" class="LineNr">115 </span> <span class="PreProc">var</span> y/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L115" class="LineNr">115 </span> <span class="PreProc">var</span> y/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L116" class="LineNr">116 </span> <span class="Delimiter">{</span>
|
||||
<span id="L117" class="LineNr">117 </span> compare y, <span class="Constant">0xc0</span>/height
|
||||
<span id="L118" class="LineNr">118 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L119" class="LineNr">119 </span> <span class="PreProc">var</span> x/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L119" class="LineNr">119 </span> <span class="PreProc">var</span> x/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L120" class="LineNr">120 </span> <span class="Delimiter">{</span>
|
||||
<span id="L121" class="LineNr">121 </span> compare x, <span class="Constant">0x100</span>/width
|
||||
<span id="L122" class="LineNr">122 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L123" class="LineNr">123 </span> <span class="PreProc">var</span> n/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='life.mu.html#L49'>num-live-neighbors</a> old-grid, x, y
|
||||
<span id="L123" class="LineNr">123 </span> <span class="PreProc">var</span> n/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='life.mu.html#L49'>num-live-neighbors</a> old-grid, x, y
|
||||
<span id="L124" class="LineNr">124 </span> <span class="muComment"># if neighbors < 2, die of loneliness</span>
|
||||
<span id="L125" class="LineNr">125 </span> <span class="Delimiter">{</span>
|
||||
<span id="L126" class="LineNr">126 </span> compare n, <span class="Constant">2</span>
|
||||
|
@ -196,7 +202,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L137" class="LineNr">137 </span> <span class="Delimiter">{</span>
|
||||
<span id="L138" class="LineNr">138 </span> compare n, <span class="Constant">2</span>
|
||||
<span id="L139" class="LineNr">139 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L140" class="LineNr">140 </span> <span class="PreProc">var</span> old-state/<span class="Constant">eax</span>: boolean <span class="Special"><-</span> <a href='life.mu.html#L8'>state</a> old-grid, x, y
|
||||
<span id="L140" class="LineNr">140 </span> <span class="PreProc">var</span> old-state/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='life.mu.html#L8'>state</a> old-grid, x, y
|
||||
<span id="L141" class="LineNr">141 </span> <a href='life.mu.html#L38'>set-state</a> new-grid, x, y, old-state
|
||||
<span id="L142" class="LineNr">142 </span> <span class="Delimiter">}</span>
|
||||
<span id="L143" class="LineNr">143 </span> <span class="muComment"># if neighbors = 3, cell quickens to life</span>
|
||||
|
@ -215,19 +221,19 @@ if ('onhashchange' in window) {
|
|||
<span id="L156" class="LineNr">156 </span>
|
||||
<span id="L157" class="LineNr">157 </span><span class="muComment"># color a square of size 'side' starting at x*side, y*side</span>
|
||||
<span id="L158" class="LineNr">158 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='life.mu.html#L158'>render-square</a></span> _x: int, _y: int, color: int <span class="Delimiter">{</span>
|
||||
<span id="L159" class="LineNr">159 </span> <span class="PreProc">var</span> y/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy _y
|
||||
<span id="L159" class="LineNr">159 </span> <span class="PreProc">var</span> y/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy _y
|
||||
<span id="L160" class="LineNr">160 </span> y <span class="Special"><-</span> shift-left <span class="Constant">2</span>/log2side
|
||||
<span id="L161" class="LineNr">161 </span> <span class="PreProc">var</span> side/<span class="Constant">ebx</span>: int <span class="Special"><-</span> copy <span class="Constant">1</span>
|
||||
<span id="L161" class="LineNr">161 </span> <span class="PreProc">var</span> side/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> copy <span class="Constant">1</span>
|
||||
<span id="L162" class="LineNr">162 </span> side <span class="Special"><-</span> shift-left <span class="Constant">2</span>/log2side
|
||||
<span id="L163" class="LineNr">163 </span> <span class="PreProc">var</span> ymax/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy y
|
||||
<span id="L163" class="LineNr">163 </span> <span class="PreProc">var</span> ymax/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy y
|
||||
<span id="L164" class="LineNr">164 </span> ymax <span class="Special"><-</span> add side
|
||||
<span id="L165" class="LineNr">165 </span> <span class="Delimiter">{</span>
|
||||
<span id="L166" class="LineNr">166 </span> compare y, ymax
|
||||
<span id="L167" class="LineNr">167 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L168" class="LineNr">168 </span> <span class="Delimiter">{</span>
|
||||
<span id="L169" class="LineNr">169 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy _x
|
||||
<span id="L169" class="LineNr">169 </span> <span class="PreProc">var</span> x/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy _x
|
||||
<span id="L170" class="LineNr">170 </span> x <span class="Special"><-</span> shift-left <span class="Constant">2</span>/log2side
|
||||
<span id="L171" class="LineNr">171 </span> <span class="PreProc">var</span> xmax/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy x
|
||||
<span id="L171" class="LineNr">171 </span> <span class="PreProc">var</span> xmax/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy x
|
||||
<span id="L172" class="LineNr">172 </span> xmax <span class="Special"><-</span> add side
|
||||
<span id="L173" class="LineNr">173 </span> <span class="Delimiter">{</span>
|
||||
<span id="L174" class="LineNr">174 </span> compare x, xmax
|
||||
|
@ -243,15 +249,15 @@ if ('onhashchange' in window) {
|
|||
<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="muFunction"><a href='life.mu.html#L186'>render</a></span> grid: (addr array boolean) <span class="Delimiter">{</span>
|
||||
<span id="L187" class="LineNr">187 </span> <span class="PreProc">var</span> y/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L187" class="LineNr">187 </span> <span class="PreProc">var</span> y/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L188" class="LineNr">188 </span> <span class="Delimiter">{</span>
|
||||
<span id="L189" class="LineNr">189 </span> compare y, <span class="Constant">0xc0</span>/height
|
||||
<span id="L190" class="LineNr">190 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L191" class="LineNr">191 </span> <span class="PreProc">var</span> x/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L191" class="LineNr">191 </span> <span class="PreProc">var</span> x/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L192" class="LineNr">192 </span> <span class="Delimiter">{</span>
|
||||
<span id="L193" class="LineNr">193 </span> compare x, <span class="Constant">0x100</span>/width
|
||||
<span id="L194" class="LineNr">194 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L195" class="LineNr">195 </span> <span class="PreProc">var</span> <a href='life.mu.html#L8'>state</a>/<span class="Constant">eax</span>: boolean <span class="Special"><-</span> <a href='life.mu.html#L8'>state</a> grid, x, y
|
||||
<span id="L195" class="LineNr">195 </span> <span class="PreProc">var</span> <a href='life.mu.html#L8'>state</a>/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='life.mu.html#L8'>state</a> grid, x, y
|
||||
<span id="L196" class="LineNr">196 </span> compare <a href='life.mu.html#L8'>state</a>, <span class="Constant">0</span>/false
|
||||
<span id="L197" class="LineNr">197 </span> <span class="Delimiter">{</span>
|
||||
<span id="L198" class="LineNr">198 </span> <span class="PreProc">break-if-=</span>
|
||||
|
@ -278,15 +284,15 @@ if ('onhashchange' in window) {
|
|||
<span id="L219" class="LineNr">219 </span><span class="CommentedCode">#? var grid2/edi: (addr array boolean) <- address grid2-storage</span>
|
||||
<span id="L220" class="LineNr">220 </span> <span class="muComment"># allocate on the heap</span>
|
||||
<span id="L221" class="LineNr">221 </span> <span class="PreProc">var</span> grid1-storage: (handle array boolean)
|
||||
<span id="L222" class="LineNr">222 </span> <span class="PreProc">var</span> grid1-ah/<span class="Constant">eax</span>: (addr handle array boolean) <span class="Special"><-</span> address grid1-storage
|
||||
<span id="L222" class="LineNr">222 </span> <span class="PreProc">var</span> grid1-ah/<span class="muRegEax">eax</span>: (addr handle array boolean) <span class="Special"><-</span> address grid1-storage
|
||||
<span id="L223" class="LineNr">223 </span> populate grid1-ah, <span class="Constant">0xc000</span> <span class="muComment"># width * height</span>
|
||||
<span id="L224" class="LineNr">224 </span> <span class="PreProc">var</span> _grid1/<span class="Constant">eax</span>: (addr array boolean) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *grid1-ah
|
||||
<span id="L225" class="LineNr">225 </span> <span class="PreProc">var</span> grid1/<span class="Constant">esi</span>: (addr array boolean) <span class="Special"><-</span> copy _grid1
|
||||
<span id="L224" class="LineNr">224 </span> <span class="PreProc">var</span> _grid1/<span class="muRegEax">eax</span>: (addr array boolean) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *grid1-ah
|
||||
<span id="L225" class="LineNr">225 </span> <span class="PreProc">var</span> grid1/<span class="muRegEsi">esi</span>: (addr array boolean) <span class="Special"><-</span> copy _grid1
|
||||
<span id="L226" class="LineNr">226 </span> <span class="PreProc">var</span> grid2-storage: (handle array boolean)
|
||||
<span id="L227" class="LineNr">227 </span> <span class="PreProc">var</span> grid2-ah/<span class="Constant">eax</span>: (addr handle array boolean) <span class="Special"><-</span> address grid2-storage
|
||||
<span id="L227" class="LineNr">227 </span> <span class="PreProc">var</span> grid2-ah/<span class="muRegEax">eax</span>: (addr handle array boolean) <span class="Special"><-</span> address grid2-storage
|
||||
<span id="L228" class="LineNr">228 </span> populate grid2-ah, <span class="Constant">0xc000</span> <span class="muComment"># width * height</span>
|
||||
<span id="L229" class="LineNr">229 </span> <span class="PreProc">var</span> _grid2/<span class="Constant">eax</span>: (addr array boolean) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *grid2-ah
|
||||
<span id="L230" class="LineNr">230 </span> <span class="PreProc">var</span> grid2/<span class="Constant">edi</span>: (addr array boolean) <span class="Special"><-</span> copy _grid2
|
||||
<span id="L229" class="LineNr">229 </span> <span class="PreProc">var</span> _grid2/<span class="muRegEax">eax</span>: (addr array boolean) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *grid2-ah
|
||||
<span id="L230" class="LineNr">230 </span> <span class="PreProc">var</span> grid2/<span class="muRegEdi">edi</span>: (addr array boolean) <span class="Special"><-</span> copy _grid2
|
||||
<span id="L231" class="LineNr">231 </span> <span class="muComment"># initialize grid1</span>
|
||||
<span id="L232" class="LineNr">232 </span> <a href='life.mu.html#L38'>set-state</a> grid1, <span class="Constant">0x80</span>, <span class="Constant">0x5f</span>, <span class="Constant">1</span>/live
|
||||
<span id="L233" class="LineNr">233 </span> <a href='life.mu.html#L38'>set-state</a> grid1, <span class="Constant">0x81</span>, <span class="Constant">0x5f</span>, <span class="Constant">1</span>/live
|
||||
|
@ -296,7 +302,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L237" class="LineNr">237 </span> <span class="muComment"># render grid1</span>
|
||||
<span id="L238" class="LineNr">238 </span> <a href='life.mu.html#L186'>render</a> grid1
|
||||
<span id="L239" class="LineNr">239 </span> <span class="Delimiter">{</span>
|
||||
<span id="L240" class="LineNr">240 </span> <span class="PreProc">var</span> key/<span class="Constant">eax</span>: byte <span class="Special"><-</span> <a href='102keyboard.subx.html#L21'>read-key</a> keyboard
|
||||
<span id="L240" class="LineNr">240 </span> <span class="PreProc">var</span> key/<span class="muRegEax">eax</span>: byte <span class="Special"><-</span> <a href='102keyboard.subx.html#L21'>read-key</a> keyboard
|
||||
<span id="L241" class="LineNr">241 </span> compare key, <span class="Constant">0</span>
|
||||
<span id="L242" class="LineNr">242 </span><span class="CommentedCode">#? loop-if-= # press key to step</span>
|
||||
<span id="L243" class="LineNr">243 </span> <span class="PreProc">break-if-!=</span> <span class="muComment"># press key to quit # comment this out to run under bochs; I'm not sure why there's a newline in the keyboard buffer</span>
|
||||
|
|
67676
html/linux/mu.subx.html
generated
67676
html/linux/mu.subx.html
generated
File diff suppressed because it is too large
Load Diff
146
html/mandelbrot-fixed.mu.html
generated
146
html/mandelbrot-fixed.mu.html
generated
|
@ -14,14 +14,20 @@ pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-
|
|||
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #a8a8a8; }
|
||||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.PreProc { color: #c000c0; }
|
||||
.Special { color: #ff6060; }
|
||||
.LineNr { }
|
||||
.Constant { color: #008787; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muRegEdx { color: #878700; }
|
||||
.muRegEbx { color: #8787af; }
|
||||
.muRegEsi { color: #87d787; }
|
||||
.muRegEdi { color: #87ffd7; }
|
||||
.Constant { color: #008787; }
|
||||
.Special { color: #ff6060; }
|
||||
.PreProc { color: #c000c0; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muTest { color: #5f8700; }
|
||||
.muComment { color: #005faf; }
|
||||
.muRegEax { color: #875f00; }
|
||||
.muRegEcx { color: #af875f; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
@ -79,11 +85,11 @@ if ('onhashchange' in window) {
|
|||
<span id="L20" class="LineNr"> 20 </span> <span class="Delimiter">{</span>
|
||||
<span id="L21" class="LineNr"> 21 </span> <a href='mandelbrot-fixed.mu.html#L127'>mandelbrot</a> <a href='500fake-screen.mu.html#L14'>screen</a> scene-cx-f, scene-cy-f, scene-width-f
|
||||
<span id="L22" class="LineNr"> 22 </span> <span class="muComment"># move at an angle slowly towards the edge</span>
|
||||
<span id="L23" class="LineNr"> 23 </span> <span class="PreProc">var</span> adj-f/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L100'>multiply-fixed</a> scene-width-f, <span class="Constant">0x12</span>/<span class="Constant">0</span>.<span class="Constant">07</span>
|
||||
<span id="L23" class="LineNr"> 23 </span> <span class="PreProc">var</span> adj-f/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L100'>multiply-fixed</a> scene-width-f, <span class="Constant">0x12</span>/<span class="Constant">0</span>.<span class="Constant">07</span>
|
||||
<span id="L24" class="LineNr"> 24 </span> subtract-from scene-cx-f, adj-f
|
||||
<span id="L25" class="LineNr"> 25 </span> add-to scene-cy-f, adj-f
|
||||
<span id="L26" class="LineNr"> 26 </span> <span class="muComment"># slowly shrink the scene width to zoom in</span>
|
||||
<span id="L27" class="LineNr"> 27 </span> <span class="PreProc">var</span> tmp-f/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L100'>multiply-fixed</a> scene-width-f, <span class="Constant">0x80</span>/<span class="Constant">0</span>.<span class="Constant">5</span>
|
||||
<span id="L27" class="LineNr"> 27 </span> <span class="PreProc">var</span> tmp-f/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L100'>multiply-fixed</a> scene-width-f, <span class="Constant">0x80</span>/<span class="Constant">0</span>.<span class="Constant">5</span>
|
||||
<span id="L28" class="LineNr"> 28 </span> copy-to scene-width-f, tmp-f
|
||||
<span id="L29" class="LineNr"> 29 </span> <span class="PreProc">loop</span>
|
||||
<span id="L30" class="LineNr"> 30 </span> <span class="Delimiter">}</span>
|
||||
|
@ -92,8 +98,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L33" class="LineNr"> 33 </span><span class="muComment"># Since they still look like int types, we'll append a '-f' suffix to variable</span>
|
||||
<span id="L34" class="LineNr"> 34 </span><span class="muComment"># names to designate fixed-point numbers.</span>
|
||||
<span id="L35" class="LineNr"> 35 </span>
|
||||
<span id="L36" class="LineNr"> 36 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a></span> in: int<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L37" class="LineNr"> 37 </span> <span class="PreProc">var</span> result-f/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy in
|
||||
<span id="L36" class="LineNr"> 36 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a></span> in: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L37" class="LineNr"> 37 </span> <span class="PreProc">var</span> result-f/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy in
|
||||
<span id="L38" class="LineNr"> 38 </span> result-f <span class="Special"><-</span> shift-left <span class="Constant">8</span>/fixed-precision
|
||||
<span id="L39" class="LineNr"> 39 </span> <span class="Delimiter">{</span>
|
||||
<span id="L40" class="LineNr"> 40 </span> <span class="PreProc">break-if-not-overflow</span>
|
||||
|
@ -102,8 +108,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L43" class="LineNr"> 43 </span> <span class="PreProc">return</span> result-f
|
||||
<span id="L44" class="LineNr"> 44 </span><span class="Delimiter">}</span>
|
||||
<span id="L45" class="LineNr"> 45 </span>
|
||||
<span id="L46" class="LineNr"> 46 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L46'>fixed-to-int</a></span> in-f: int<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L47" class="LineNr"> 47 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy in-f
|
||||
<span id="L46" class="LineNr"> 46 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L46'>fixed-to-int</a></span> in-f: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L47" class="LineNr"> 47 </span> <span class="PreProc">var</span> result/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy in-f
|
||||
<span id="L48" class="LineNr"> 48 </span> result <span class="Special"><-</span> shift-right-signed <span class="Constant">8</span>/fixed-precision
|
||||
<span id="L49" class="LineNr"> 49 </span> <span class="PreProc">return</span> result
|
||||
<span id="L50" class="LineNr"> 50 </span><span class="Delimiter">}</span>
|
||||
|
@ -111,53 +117,53 @@ if ('onhashchange' in window) {
|
|||
<span id="L52" class="LineNr"> 52 </span><span class="muComment"># The process of throwing bits away always adjusts a number towards -infinity.</span>
|
||||
<span id="L53" class="LineNr"> 53 </span><span class="PreProc">fn</span> <span class="muTest"><a href='mandelbrot-fixed.mu.html#L53'>test-fixed-conversion</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L54" class="LineNr"> 54 </span> <span class="muComment"># 0</span>
|
||||
<span id="L55" class="LineNr"> 55 </span> <span class="PreProc">var</span> f/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> <span class="Constant">0</span>
|
||||
<span id="L56" class="LineNr"> 56 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L46'>fixed-to-int</a> f
|
||||
<span id="L55" class="LineNr"> 55 </span> <span class="PreProc">var</span> f/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> <span class="Constant">0</span>
|
||||
<span id="L56" class="LineNr"> 56 </span> <span class="PreProc">var</span> result/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L46'>fixed-to-int</a> f
|
||||
<span id="L57" class="LineNr"> 57 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">0</span>, <span class="Constant">"F - <a href='mandelbrot-fixed.mu.html#L53'>test-fixed-conversion</a> - 0"</span>
|
||||
<span id="L58" class="LineNr"> 58 </span> <span class="muComment"># 1</span>
|
||||
<span id="L59" class="LineNr"> 59 </span> <span class="PreProc">var</span> f/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> <span class="Constant">1</span>
|
||||
<span id="L60" class="LineNr"> 60 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L46'>fixed-to-int</a> f
|
||||
<span id="L59" class="LineNr"> 59 </span> <span class="PreProc">var</span> f/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> <span class="Constant">1</span>
|
||||
<span id="L60" class="LineNr"> 60 </span> <span class="PreProc">var</span> result/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L46'>fixed-to-int</a> f
|
||||
<span id="L61" class="LineNr"> 61 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">1</span>, <span class="Constant">"F - <a href='mandelbrot-fixed.mu.html#L53'>test-fixed-conversion</a> - 1"</span>
|
||||
<span id="L62" class="LineNr"> 62 </span> <span class="muComment"># -1</span>
|
||||
<span id="L63" class="LineNr"> 63 </span> <span class="PreProc">var</span> f/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> <span class="Constant">-1</span>
|
||||
<span id="L64" class="LineNr"> 64 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L46'>fixed-to-int</a> f
|
||||
<span id="L63" class="LineNr"> 63 </span> <span class="PreProc">var</span> f/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> <span class="Constant">-1</span>
|
||||
<span id="L64" class="LineNr"> 64 </span> <span class="PreProc">var</span> result/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L46'>fixed-to-int</a> f
|
||||
<span id="L65" class="LineNr"> 65 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">-1</span>, <span class="Constant">"F - <a href='mandelbrot-fixed.mu.html#L53'>test-fixed-conversion</a> - -1"</span>
|
||||
<span id="L66" class="LineNr"> 66 </span> <span class="muComment"># 0.5 = 1/2</span>
|
||||
<span id="L67" class="LineNr"> 67 </span> <span class="PreProc">var</span> f/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> <span class="Constant">1</span>
|
||||
<span id="L67" class="LineNr"> 67 </span> <span class="PreProc">var</span> f/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> <span class="Constant">1</span>
|
||||
<span id="L68" class="LineNr"> 68 </span> f <span class="Special"><-</span> shift-right-signed <span class="Constant">1</span>
|
||||
<span id="L69" class="LineNr"> 69 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L46'>fixed-to-int</a> f
|
||||
<span id="L69" class="LineNr"> 69 </span> <span class="PreProc">var</span> result/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L46'>fixed-to-int</a> f
|
||||
<span id="L70" class="LineNr"> 70 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">0</span>, <span class="Constant">"F - <a href='mandelbrot-fixed.mu.html#L53'>test-fixed-conversion</a> - 0.5"</span>
|
||||
<span id="L71" class="LineNr"> 71 </span> <span class="muComment"># -0.5 = -1/2</span>
|
||||
<span id="L72" class="LineNr"> 72 </span> <span class="PreProc">var</span> f/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> <span class="Constant">-1</span>
|
||||
<span id="L72" class="LineNr"> 72 </span> <span class="PreProc">var</span> f/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> <span class="Constant">-1</span>
|
||||
<span id="L73" class="LineNr"> 73 </span> f <span class="Special"><-</span> shift-right-signed <span class="Constant">1</span>
|
||||
<span id="L74" class="LineNr"> 74 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L46'>fixed-to-int</a> f
|
||||
<span id="L74" class="LineNr"> 74 </span> <span class="PreProc">var</span> result/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L46'>fixed-to-int</a> f
|
||||
<span id="L75" class="LineNr"> 75 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">-1</span>, <span class="Constant">"F - <a href='mandelbrot-fixed.mu.html#L53'>test-fixed-conversion</a> - -0.5"</span>
|
||||
<span id="L76" class="LineNr"> 76 </span> <span class="muComment"># 1.5 = 3/2</span>
|
||||
<span id="L77" class="LineNr"> 77 </span> <span class="PreProc">var</span> f/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> <span class="Constant">3</span>
|
||||
<span id="L77" class="LineNr"> 77 </span> <span class="PreProc">var</span> f/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> <span class="Constant">3</span>
|
||||
<span id="L78" class="LineNr"> 78 </span> f <span class="Special"><-</span> shift-right-signed <span class="Constant">1</span>
|
||||
<span id="L79" class="LineNr"> 79 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L46'>fixed-to-int</a> f
|
||||
<span id="L79" class="LineNr"> 79 </span> <span class="PreProc">var</span> result/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L46'>fixed-to-int</a> f
|
||||
<span id="L80" class="LineNr"> 80 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">1</span>, <span class="Constant">"F - <a href='mandelbrot-fixed.mu.html#L53'>test-fixed-conversion</a> - 1.5"</span>
|
||||
<span id="L81" class="LineNr"> 81 </span> <span class="muComment"># -1.5 = -3/2</span>
|
||||
<span id="L82" class="LineNr"> 82 </span> <span class="PreProc">var</span> f/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> <span class="Constant">-3</span>
|
||||
<span id="L82" class="LineNr"> 82 </span> <span class="PreProc">var</span> f/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> <span class="Constant">-3</span>
|
||||
<span id="L83" class="LineNr"> 83 </span> f <span class="Special"><-</span> shift-right-signed <span class="Constant">1</span>
|
||||
<span id="L84" class="LineNr"> 84 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L46'>fixed-to-int</a> f
|
||||
<span id="L84" class="LineNr"> 84 </span> <span class="PreProc">var</span> result/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L46'>fixed-to-int</a> f
|
||||
<span id="L85" class="LineNr"> 85 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">-2</span>, <span class="Constant">"F - <a href='mandelbrot-fixed.mu.html#L53'>test-fixed-conversion</a> - -1.5"</span>
|
||||
<span id="L86" class="LineNr"> 86 </span> <span class="muComment"># 1.25 = 5/4</span>
|
||||
<span id="L87" class="LineNr"> 87 </span> <span class="PreProc">var</span> f/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> <span class="Constant">5</span>
|
||||
<span id="L87" class="LineNr"> 87 </span> <span class="PreProc">var</span> f/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> <span class="Constant">5</span>
|
||||
<span id="L88" class="LineNr"> 88 </span> f <span class="Special"><-</span> shift-right-signed <span class="Constant">2</span>
|
||||
<span id="L89" class="LineNr"> 89 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L46'>fixed-to-int</a> f
|
||||
<span id="L89" class="LineNr"> 89 </span> <span class="PreProc">var</span> result/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L46'>fixed-to-int</a> f
|
||||
<span id="L90" class="LineNr"> 90 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">1</span>, <span class="Constant">"F - <a href='mandelbrot-fixed.mu.html#L53'>test-fixed-conversion</a> - 1.25"</span>
|
||||
<span id="L91" class="LineNr"> 91 </span> <span class="muComment"># -1.25 = -5/4</span>
|
||||
<span id="L92" class="LineNr"> 92 </span> <span class="PreProc">var</span> f/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> <span class="Constant">-5</span>
|
||||
<span id="L92" class="LineNr"> 92 </span> <span class="PreProc">var</span> f/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> <span class="Constant">-5</span>
|
||||
<span id="L93" class="LineNr"> 93 </span> f <span class="Special"><-</span> shift-right-signed <span class="Constant">2</span>
|
||||
<span id="L94" class="LineNr"> 94 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L46'>fixed-to-int</a> f
|
||||
<span id="L94" class="LineNr"> 94 </span> <span class="PreProc">var</span> result/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L46'>fixed-to-int</a> f
|
||||
<span id="L95" class="LineNr"> 95 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">-2</span>, <span class="Constant">"F - <a href='mandelbrot-fixed.mu.html#L53'>test-fixed-conversion</a> - -1.25"</span>
|
||||
<span id="L96" class="LineNr"> 96 </span><span class="Delimiter">}</span>
|
||||
<span id="L97" class="LineNr"> 97 </span>
|
||||
<span id="L98" class="LineNr"> 98 </span><span class="muComment"># special routines for multiplying and dividing fixed-point numbers</span>
|
||||
<span id="L99" class="LineNr"> 99 </span>
|
||||
<span id="L100" class="LineNr">100 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L100'>multiply-fixed</a></span> a-f: int, b-f: int<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L101" class="LineNr">101 </span> <span class="PreProc">var</span> result/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy a-f
|
||||
<span id="L100" class="LineNr">100 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L100'>multiply-fixed</a></span> a-f: int, b-f: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L101" class="LineNr">101 </span> <span class="PreProc">var</span> result/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy a-f
|
||||
<span id="L102" class="LineNr">102 </span> result <span class="Special"><-</span> multiply b-f
|
||||
<span id="L103" class="LineNr">103 </span> <span class="Delimiter">{</span>
|
||||
<span id="L104" class="LineNr">104 </span> <span class="PreProc">break-if-not-overflow</span>
|
||||
|
@ -167,14 +173,14 @@ if ('onhashchange' in window) {
|
|||
<span id="L108" class="LineNr">108 </span> <span class="PreProc">return</span> result
|
||||
<span id="L109" class="LineNr">109 </span><span class="Delimiter">}</span>
|
||||
<span id="L110" class="LineNr">110 </span>
|
||||
<span id="L111" class="LineNr">111 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L111'>divide-fixed</a></span> a-f: int, b-f: int<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L112" class="LineNr">112 </span> <span class="PreProc">var</span> result-f/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy a-f
|
||||
<span id="L111" class="LineNr">111 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L111'>divide-fixed</a></span> a-f: int, b-f: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L112" class="LineNr">112 </span> <span class="PreProc">var</span> result-f/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy a-f
|
||||
<span id="L113" class="LineNr">113 </span> result-f <span class="Special"><-</span> shift-left <span class="Constant">8</span>/fixed-precision
|
||||
<span id="L114" class="LineNr">114 </span> <span class="Delimiter">{</span>
|
||||
<span id="L115" class="LineNr">115 </span> <span class="PreProc">break-if-not-overflow</span>
|
||||
<span id="L116" class="LineNr">116 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">"divide-fixed: overflow"</span>
|
||||
<span id="L117" class="LineNr">117 </span> <span class="Delimiter">}</span>
|
||||
<span id="L118" class="LineNr">118 </span> <span class="PreProc">var</span> dummy-remainder/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L118" class="LineNr">118 </span> <span class="PreProc">var</span> dummy-remainder/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L119" class="LineNr">119 </span> result-f, dummy-remainder <span class="Special"><-</span> <a href='314divide.subx.html#L3'>integer-divide</a> result-f, b-f
|
||||
<span id="L120" class="LineNr">120 </span> <span class="PreProc">return</span> result-f
|
||||
<span id="L121" class="LineNr">121 </span><span class="Delimiter">}</span>
|
||||
|
@ -184,32 +190,32 @@ if ('onhashchange' in window) {
|
|||
<span id="L125" class="LineNr">125 </span><span class="muComment"># adding and subtracting two fixed-point numbers can use existing instructions.</span>
|
||||
<span id="L126" class="LineNr">126 </span>
|
||||
<span id="L127" class="LineNr">127 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L127'>mandelbrot</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), scene-cx-f: int, scene-cy-f: int, scene-width-f: int <span class="Delimiter">{</span>
|
||||
<span id="L128" class="LineNr">128 </span> <span class="PreProc">var</span> a/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L129" class="LineNr">129 </span> <span class="PreProc">var</span> b/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L130" class="LineNr">130 </span> a, b <span class="Special"><-</span> <a href='500fake-screen.mu.html#L70'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L131" class="LineNr">131 </span> <span class="PreProc">var</span> width/<span class="Constant">esi</span>: int <span class="Special"><-</span> copy a
|
||||
<span id="L128" class="LineNr">128 </span> <span class="PreProc">var</span> a/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L129" class="LineNr">129 </span> <span class="PreProc">var</span> b/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L130" class="LineNr">130 </span> a, b <span class="Special"><-</span> <a href='500fake-screen.mu.html#L86'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L131" class="LineNr">131 </span> <span class="PreProc">var</span> width/<span class="muRegEsi">esi</span>: int <span class="Special"><-</span> copy a
|
||||
<span id="L132" class="LineNr">132 </span> width <span class="Special"><-</span> shift-left <span class="Constant">3</span>/log2-font-width
|
||||
<span id="L133" class="LineNr">133 </span> <span class="PreProc">var</span> height/<span class="Constant">edi</span>: int <span class="Special"><-</span> copy b
|
||||
<span id="L133" class="LineNr">133 </span> <span class="PreProc">var</span> height/<span class="muRegEdi">edi</span>: int <span class="Special"><-</span> copy b
|
||||
<span id="L134" class="LineNr">134 </span> height <span class="Special"><-</span> shift-left <span class="Constant">4</span>/log2-font-height
|
||||
<span id="L135" class="LineNr">135 </span> <span class="PreProc">var</span> y/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L135" class="LineNr">135 </span> <span class="PreProc">var</span> y/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L136" class="LineNr">136 </span> <span class="Delimiter">{</span>
|
||||
<span id="L137" class="LineNr">137 </span> compare y, height
|
||||
<span id="L138" class="LineNr">138 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L139" class="LineNr">139 </span> <span class="PreProc">var</span> imaginary-f/<span class="Constant">ebx</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L237'>viewport-to-imaginary-f</a> y, width, height, scene-cy-f, scene-width-f
|
||||
<span id="L140" class="LineNr">140 </span> <span class="PreProc">var</span> x/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L139" class="LineNr">139 </span> <span class="PreProc">var</span> imaginary-f/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L237'>viewport-to-imaginary-f</a> y, width, height, scene-cy-f, scene-width-f
|
||||
<span id="L140" class="LineNr">140 </span> <span class="PreProc">var</span> x/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L141" class="LineNr">141 </span> <span class="Delimiter">{</span>
|
||||
<span id="L142" class="LineNr">142 </span> compare x, width
|
||||
<span id="L143" class="LineNr">143 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L144" class="LineNr">144 </span> <span class="PreProc">var</span> real-f/<span class="Constant">edx</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L219'>viewport-to-real-f</a> x, width, scene-cx-f, scene-width-f
|
||||
<span id="L145" class="LineNr">145 </span> <span class="PreProc">var</span> iterations/<span class="Constant">esi</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L162'>mandelbrot-iterations-for-point</a> real-f, imaginary-f, <span class="Constant">0x400</span>/max
|
||||
<span id="L144" class="LineNr">144 </span> <span class="PreProc">var</span> real-f/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L219'>viewport-to-real-f</a> x, width, scene-cx-f, scene-width-f
|
||||
<span id="L145" class="LineNr">145 </span> <span class="PreProc">var</span> iterations/<span class="muRegEsi">esi</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L162'>mandelbrot-iterations-for-point</a> real-f, imaginary-f, <span class="Constant">0x400</span>/max
|
||||
<span id="L146" class="LineNr">146 </span> iterations <span class="Special"><-</span> shift-right <span class="Constant">3</span>
|
||||
<span id="L147" class="LineNr">147 </span> <span class="PreProc">var</span> color/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L147" class="LineNr">147 </span> <span class="PreProc">var</span> color/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L148" class="LineNr">148 </span> <span class="Delimiter">{</span>
|
||||
<span id="L149" class="LineNr">149 </span> <span class="PreProc">var</span> dummy/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L149" class="LineNr">149 </span> <span class="PreProc">var</span> dummy/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L150" class="LineNr">150 </span> dummy, color <span class="Special"><-</span> <a href='314divide.subx.html#L3'>integer-divide</a> iterations, <span class="Constant">0x18</span>/<span class="Constant">24</span>/size-of-cycle-0
|
||||
<span id="L151" class="LineNr">151 </span> color <span class="Special"><-</span> add <span class="Constant">0x20</span>/cycle-0
|
||||
<span id="L152" class="LineNr">152 </span> <span class="Delimiter">}</span>
|
||||
<span id="L153" class="LineNr">153 </span> <a href='500fake-screen.mu.html#L463'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y, color
|
||||
<span id="L153" class="LineNr">153 </span> <a href='500fake-screen.mu.html#L483'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y, color
|
||||
<span id="L154" class="LineNr">154 </span> x <span class="Special"><-</span> increment
|
||||
<span id="L155" class="LineNr">155 </span> <span class="PreProc">loop</span>
|
||||
<span id="L156" class="LineNr">156 </span> <span class="Delimiter">}</span>
|
||||
|
@ -218,18 +224,18 @@ if ('onhashchange' in window) {
|
|||
<span id="L159" class="LineNr">159 </span> <span class="Delimiter">}</span>
|
||||
<span id="L160" class="LineNr">160 </span><span class="Delimiter">}</span>
|
||||
<span id="L161" class="LineNr">161 </span>
|
||||
<span id="L162" class="LineNr">162 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L162'>mandelbrot-iterations-for-point</a></span> real-f: int, imaginary-f: int, max: int<span class="PreProc"> -> </span>_/<span class="Constant">esi</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L163" class="LineNr">163 </span> <span class="PreProc">var</span> x-f/<span class="Constant">esi</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L164" class="LineNr">164 </span> <span class="PreProc">var</span> y-f/<span class="Constant">edi</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L165" class="LineNr">165 </span> <span class="PreProc">var</span> iterations/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L162" class="LineNr">162 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L162'>mandelbrot-iterations-for-point</a></span> real-f: int, imaginary-f: int, max: int<span class="PreProc"> -> </span>_/<span class="muRegEsi">esi</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L163" class="LineNr">163 </span> <span class="PreProc">var</span> x-f/<span class="muRegEsi">esi</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L164" class="LineNr">164 </span> <span class="PreProc">var</span> y-f/<span class="muRegEdi">edi</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L165" class="LineNr">165 </span> <span class="PreProc">var</span> iterations/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L166" class="LineNr">166 </span> <span class="Delimiter">{</span>
|
||||
<span id="L167" class="LineNr">167 </span> <span class="PreProc">var</span> done?/<span class="Constant">eax</span>: boolean <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L182'>mandelbrot-done?</a> x-f, y-f
|
||||
<span id="L167" class="LineNr">167 </span> <span class="PreProc">var</span> done?/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L182'>mandelbrot-done?</a> x-f, y-f
|
||||
<span id="L168" class="LineNr">168 </span> compare done?, <span class="Constant">0</span>/false
|
||||
<span id="L169" class="LineNr">169 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L170" class="LineNr">170 </span> compare iterations, max
|
||||
<span id="L171" class="LineNr">171 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L172" class="LineNr">172 </span> <span class="PreProc">var</span> x2-f/<span class="Constant">edx</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L196'>mandelbrot-x</a> x-f, y-f, real-f
|
||||
<span id="L173" class="LineNr">173 </span> <span class="PreProc">var</span> y2-f/<span class="Constant">ebx</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L206'>mandelbrot-y</a> x-f, y-f, imaginary-f
|
||||
<span id="L172" class="LineNr">172 </span> <span class="PreProc">var</span> x2-f/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L196'>mandelbrot-x</a> x-f, y-f, real-f
|
||||
<span id="L173" class="LineNr">173 </span> <span class="PreProc">var</span> y2-f/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L206'>mandelbrot-y</a> x-f, y-f, imaginary-f
|
||||
<span id="L174" class="LineNr">174 </span> x-f <span class="Special"><-</span> copy x2-f
|
||||
<span id="L175" class="LineNr">175 </span> y-f <span class="Special"><-</span> copy y2-f
|
||||
<span id="L176" class="LineNr">176 </span> iterations <span class="Special"><-</span> increment
|
||||
|
@ -238,10 +244,10 @@ if ('onhashchange' in window) {
|
|||
<span id="L179" class="LineNr">179 </span> <span class="PreProc">return</span> iterations
|
||||
<span id="L180" class="LineNr">180 </span><span class="Delimiter">}</span>
|
||||
<span id="L181" class="LineNr">181 </span>
|
||||
<span id="L182" class="LineNr">182 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L182'>mandelbrot-done?</a></span> x-f: int, y-f: int<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: boolean <span class="Delimiter">{</span>
|
||||
<span id="L182" class="LineNr">182 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L182'>mandelbrot-done?</a></span> x-f: int, y-f: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: boolean <span class="Delimiter">{</span>
|
||||
<span id="L183" class="LineNr">183 </span> <span class="muComment"># x*x + y*y > 4</span>
|
||||
<span id="L184" class="LineNr">184 </span> <span class="PreProc">var</span> tmp-f/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L100'>multiply-fixed</a> x-f, x-f
|
||||
<span id="L185" class="LineNr">185 </span> <span class="PreProc">var</span> result-f/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy tmp-f
|
||||
<span id="L184" class="LineNr">184 </span> <span class="PreProc">var</span> tmp-f/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L100'>multiply-fixed</a> x-f, x-f
|
||||
<span id="L185" class="LineNr">185 </span> <span class="PreProc">var</span> result-f/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy tmp-f
|
||||
<span id="L186" class="LineNr">186 </span> tmp-f <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L100'>multiply-fixed</a> y-f, y-f
|
||||
<span id="L187" class="LineNr">187 </span> result-f <span class="Special"><-</span> add tmp-f
|
||||
<span id="L188" class="LineNr">188 </span> compare result-f, <span class="Constant">0x400</span>/<span class="Constant">4</span>
|
||||
|
@ -252,19 +258,19 @@ if ('onhashchange' in window) {
|
|||
<span id="L193" class="LineNr">193 </span> <span class="PreProc">return</span> <span class="Constant">1</span>/true
|
||||
<span id="L194" class="LineNr">194 </span><span class="Delimiter">}</span>
|
||||
<span id="L195" class="LineNr">195 </span>
|
||||
<span id="L196" class="LineNr">196 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L196'>mandelbrot-x</a></span> x-f: int, y-f: int, real-f: int<span class="PreProc"> -> </span>_/<span class="Constant">edx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L196" class="LineNr">196 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L196'>mandelbrot-x</a></span> x-f: int, y-f: int, real-f: int<span class="PreProc"> -> </span>_/<span class="muRegEdx">edx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L197" class="LineNr">197 </span> <span class="muComment"># x*x - y*y + real</span>
|
||||
<span id="L198" class="LineNr">198 </span> <span class="PreProc">var</span> tmp-f/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L100'>multiply-fixed</a> x-f, x-f
|
||||
<span id="L199" class="LineNr">199 </span> <span class="PreProc">var</span> result-f/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy tmp-f
|
||||
<span id="L198" class="LineNr">198 </span> <span class="PreProc">var</span> tmp-f/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L100'>multiply-fixed</a> x-f, x-f
|
||||
<span id="L199" class="LineNr">199 </span> <span class="PreProc">var</span> result-f/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy tmp-f
|
||||
<span id="L200" class="LineNr">200 </span> tmp-f <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L100'>multiply-fixed</a> y-f, y-f
|
||||
<span id="L201" class="LineNr">201 </span> result-f <span class="Special"><-</span> subtract tmp-f
|
||||
<span id="L202" class="LineNr">202 </span> result-f <span class="Special"><-</span> add real-f
|
||||
<span id="L203" class="LineNr">203 </span> <span class="PreProc">return</span> result-f
|
||||
<span id="L204" class="LineNr">204 </span><span class="Delimiter">}</span>
|
||||
<span id="L205" class="LineNr">205 </span>
|
||||
<span id="L206" class="LineNr">206 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L206'>mandelbrot-y</a></span> x-f: int, y-f: int, imaginary-f: int<span class="PreProc"> -> </span>_/<span class="Constant">ebx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L206" class="LineNr">206 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L206'>mandelbrot-y</a></span> x-f: int, y-f: int, imaginary-f: int<span class="PreProc"> -> </span>_/<span class="muRegEbx">ebx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L207" class="LineNr">207 </span> <span class="muComment"># 2*x*y + imaginary</span>
|
||||
<span id="L208" class="LineNr">208 </span> <span class="PreProc">var</span> result-f/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy x-f
|
||||
<span id="L208" class="LineNr">208 </span> <span class="PreProc">var</span> result-f/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy x-f
|
||||
<span id="L209" class="LineNr">209 </span> result-f <span class="Special"><-</span> shift-left <span class="Constant">1</span>/log2
|
||||
<span id="L210" class="LineNr">210 </span> result-f <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L100'>multiply-fixed</a> result-f, y-f
|
||||
<span id="L211" class="LineNr">211 </span> result-f <span class="Special"><-</span> add imaginary-f
|
||||
|
@ -275,42 +281,42 @@ if ('onhashchange' in window) {
|
|||
<span id="L216" class="LineNr">216 </span><span class="muComment"># ranges from -2 to +2. Viewport height just follows the viewport's aspect</span>
|
||||
<span id="L217" class="LineNr">217 </span><span class="muComment"># ratio.</span>
|
||||
<span id="L218" class="LineNr">218 </span>
|
||||
<span id="L219" class="LineNr">219 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L219'>viewport-to-real-f</a></span> x: int, width: int, scene-cx-f: int, scene-width-f: int<span class="PreProc"> -> </span>_/<span class="Constant">edx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L219" class="LineNr">219 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L219'>viewport-to-real-f</a></span> x: int, width: int, scene-cx-f: int, scene-width-f: int<span class="PreProc"> -> </span>_/<span class="muRegEdx">edx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L220" class="LineNr">220 </span> <span class="muComment"># 0 in the viewport goes to scene-cx - scene-width/2 </span>
|
||||
<span id="L221" class="LineNr">221 </span> <span class="muComment"># width in the viewport goes to scene-cx + scene-width/2</span>
|
||||
<span id="L222" class="LineNr">222 </span> <span class="muComment"># Therefore:</span>
|
||||
<span id="L223" class="LineNr">223 </span> <span class="muComment"># x in the viewport goes to (scene-cx - scene-width/2) + x*scene-width/width</span>
|
||||
<span id="L224" class="LineNr">224 </span> <span class="muComment"># At most two numbers being multiplied before a divide, so no risk of overflow.</span>
|
||||
<span id="L225" class="LineNr">225 </span> <span class="PreProc">var</span> result-f/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> x
|
||||
<span id="L225" class="LineNr">225 </span> <span class="PreProc">var</span> result-f/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> x
|
||||
<span id="L226" class="LineNr">226 </span> result-f <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L100'>multiply-fixed</a> result-f, scene-width-f
|
||||
<span id="L227" class="LineNr">227 </span> <span class="PreProc">var</span> width-f/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy width
|
||||
<span id="L227" class="LineNr">227 </span> <span class="PreProc">var</span> width-f/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy width
|
||||
<span id="L228" class="LineNr">228 </span> width-f <span class="Special"><-</span> shift-left <span class="Constant">8</span>/fixed-precision
|
||||
<span id="L229" class="LineNr">229 </span> result-f <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L111'>divide-fixed</a> result-f, width-f
|
||||
<span id="L230" class="LineNr">230 </span> result-f <span class="Special"><-</span> add scene-cx-f
|
||||
<span id="L231" class="LineNr">231 </span> <span class="PreProc">var</span> half-scene-width-f/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy scene-width-f
|
||||
<span id="L231" class="LineNr">231 </span> <span class="PreProc">var</span> half-scene-width-f/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy scene-width-f
|
||||
<span id="L232" class="LineNr">232 </span> half-scene-width-f <span class="Special"><-</span> shift-right <span class="Constant">1</span>
|
||||
<span id="L233" class="LineNr">233 </span> result-f <span class="Special"><-</span> subtract half-scene-width-f
|
||||
<span id="L234" class="LineNr">234 </span> <span class="PreProc">return</span> result-f
|
||||
<span id="L235" class="LineNr">235 </span><span class="Delimiter">}</span>
|
||||
<span id="L236" class="LineNr">236 </span>
|
||||
<span id="L237" class="LineNr">237 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L237'>viewport-to-imaginary-f</a></span> y: int, width: int, height: int, scene-cy-f: int, scene-width-f: int<span class="PreProc"> -> </span>_/<span class="Constant">ebx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L237" class="LineNr">237 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L237'>viewport-to-imaginary-f</a></span> y: int, width: int, height: int, scene-cy-f: int, scene-width-f: int<span class="PreProc"> -> </span>_/<span class="muRegEbx">ebx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L238" class="LineNr">238 </span> <span class="muComment"># 0 in the viewport goes to scene-cy - scene-width/2*height/width</span>
|
||||
<span id="L239" class="LineNr">239 </span> <span class="muComment"># height in the viewport goes to scene-cy + scene-width/2*height/width</span>
|
||||
<span id="L240" class="LineNr">240 </span> <span class="muComment"># Therefore:</span>
|
||||
<span id="L241" class="LineNr">241 </span> <span class="muComment"># y in the viewport goes to (scene-cy - scene-width/2*height/width) + y*scene-width/width</span>
|
||||
<span id="L242" class="LineNr">242 </span> <span class="muComment"># scene-cy - scene-width/width * (height/2 + y)</span>
|
||||
<span id="L243" class="LineNr">243 </span> <span class="muComment"># At most two numbers being multiplied before a divide, so no risk of overflow.</span>
|
||||
<span id="L244" class="LineNr">244 </span> <span class="PreProc">var</span> result-f/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> y
|
||||
<span id="L244" class="LineNr">244 </span> <span class="PreProc">var</span> result-f/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> y
|
||||
<span id="L245" class="LineNr">245 </span> result-f <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L100'>multiply-fixed</a> result-f, scene-width-f
|
||||
<span id="L246" class="LineNr">246 </span> <span class="PreProc">var</span> width-f/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy width
|
||||
<span id="L246" class="LineNr">246 </span> <span class="PreProc">var</span> width-f/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy width
|
||||
<span id="L247" class="LineNr">247 </span> width-f <span class="Special"><-</span> shift-left <span class="Constant">8</span>/fixed-precision
|
||||
<span id="L248" class="LineNr">248 </span> result-f <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L111'>divide-fixed</a> result-f, width-f
|
||||
<span id="L249" class="LineNr">249 </span> result-f <span class="Special"><-</span> add scene-cy-f
|
||||
<span id="L250" class="LineNr">250 </span> <span class="PreProc">var</span> second-term-f/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L250" class="LineNr">250 </span> <span class="PreProc">var</span> second-term-f/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L251" class="LineNr">251 </span> <span class="Delimiter">{</span>
|
||||
<span id="L252" class="LineNr">252 </span> <span class="PreProc">var</span> _second-term-f/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy scene-width-f
|
||||
<span id="L252" class="LineNr">252 </span> <span class="PreProc">var</span> _second-term-f/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy scene-width-f
|
||||
<span id="L253" class="LineNr">253 </span> _second-term-f <span class="Special"><-</span> shift-right <span class="Constant">1</span>
|
||||
<span id="L254" class="LineNr">254 </span> <span class="PreProc">var</span> height-f/<span class="Constant">ebx</span>: int <span class="Special"><-</span> copy height
|
||||
<span id="L254" class="LineNr">254 </span> <span class="PreProc">var</span> height-f/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> copy height
|
||||
<span id="L255" class="LineNr">255 </span> height-f <span class="Special"><-</span> shift-left <span class="Constant">8</span>/fixed-precision
|
||||
<span id="L256" class="LineNr">256 </span> _second-term-f <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L100'>multiply-fixed</a> _second-term-f, height-f
|
||||
<span id="L257" class="LineNr">257 </span> _second-term-f <span class="Special"><-</span> <a href='mandelbrot-fixed.mu.html#L111'>divide-fixed</a> _second-term-f, width-f
|
||||
|
|
217
html/mandelbrot-silhouette.mu.html
generated
Normal file
217
html/mandelbrot-silhouette.mu.html
generated
Normal file
|
@ -0,0 +1,217 @@
|
|||
<!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 - mandelbrot-silhouette.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; }
|
||||
.muRegEcx { color: #af875f; }
|
||||
.Special { color: #ff6060; }
|
||||
.LineNr { }
|
||||
.muRegEdi { color: #87ffd7; }
|
||||
.muRegEdx { color: #878700; }
|
||||
.Constant { color: #008787; }
|
||||
.muRegEsi { color: #87d787; }
|
||||
.muRegEax { color: #875f00; }
|
||||
.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/mandelbrot-silhouette.mu'>https://github.com/akkartik/mu/blob/main/mandelbrot-silhouette.mu</a>
|
||||
<pre id='vimCodeElement'>
|
||||
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># Mandelbrot set</span>
|
||||
<span id="L2" class="LineNr"> 2 </span><span class="muComment">#</span>
|
||||
<span id="L3" class="LineNr"> 3 </span><span class="muComment"># Install:</span>
|
||||
<span id="L4" class="LineNr"> 4 </span><span class="muComment"># $ git clone <a href="https://github.com/akkartik/mu">https://github.com/akkartik/mu</a></span>
|
||||
<span id="L5" class="LineNr"> 5 </span><span class="muComment"># $ cd mu</span>
|
||||
<span id="L6" class="LineNr"> 6 </span><span class="muComment"># Build on Linux:</span>
|
||||
<span id="L7" class="LineNr"> 7 </span><span class="muComment"># $ ./translate mandelbrot.mu</span>
|
||||
<span id="L8" class="LineNr"> 8 </span><span class="muComment"># Build on other platforms (slow):</span>
|
||||
<span id="L9" class="LineNr"> 9 </span><span class="muComment"># $ ./translate_emulated mandelbrot.mu</span>
|
||||
<span id="L10" class="LineNr"> 10 </span><span class="muComment"># Run:</span>
|
||||
<span id="L11" class="LineNr"> 11 </span><span class="muComment"># $ qemu-system-i386 code.img</span>
|
||||
<span id="L12" class="LineNr"> 12 </span>
|
||||
<span id="L13" class="LineNr"> 13 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-silhouette.mu.html#L13'>main</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
|
||||
<span id="L14" class="LineNr"> 14 </span> <a href='mandelbrot-silhouette.mu.html#L17'>mandelbrot</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L15" class="LineNr"> 15 </span><span class="Delimiter">}</span>
|
||||
<span id="L16" class="LineNr"> 16 </span>
|
||||
<span id="L17" class="LineNr"> 17 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-silhouette.mu.html#L17'>mandelbrot</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>) <span class="Delimiter">{</span>
|
||||
<span id="L18" class="LineNr"> 18 </span> <span class="PreProc">var</span> a/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L19" class="LineNr"> 19 </span> <span class="PreProc">var</span> b/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L20" class="LineNr"> 20 </span> a, b <span class="Special"><-</span> <a href='500fake-screen.mu.html#L86'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L21" class="LineNr"> 21 </span> <span class="PreProc">var</span> width/<span class="muRegEsi">esi</span>: int <span class="Special"><-</span> copy a
|
||||
<span id="L22" class="LineNr"> 22 </span> width <span class="Special"><-</span> shift-left <span class="Constant">3</span>/log2-font-width
|
||||
<span id="L23" class="LineNr"> 23 </span> <span class="PreProc">var</span> height/<span class="muRegEdi">edi</span>: int <span class="Special"><-</span> copy b
|
||||
<span id="L24" class="LineNr"> 24 </span> height <span class="Special"><-</span> shift-left <span class="Constant">4</span>/log2-font-height
|
||||
<span id="L25" class="LineNr"> 25 </span> <span class="PreProc">var</span> y/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L26" class="LineNr"> 26 </span> <span class="Delimiter">{</span>
|
||||
<span id="L27" class="LineNr"> 27 </span> compare y, height
|
||||
<span id="L28" class="LineNr"> 28 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L29" class="LineNr"> 29 </span> <span class="PreProc">var</span> imaginary/<span class="Constant">xmm1</span>: float <span class="Special"><-</span> <a href='mandelbrot-silhouette.mu.html#L135'>viewport-to-imaginary</a> y, width, height
|
||||
<span id="L30" class="LineNr"> 30 </span> <span class="PreProc">var</span> x/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L31" class="LineNr"> 31 </span> <span class="Delimiter">{</span>
|
||||
<span id="L32" class="LineNr"> 32 </span> compare x, width
|
||||
<span id="L33" class="LineNr"> 33 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L34" class="LineNr"> 34 </span> <span class="PreProc">var</span> real/<span class="Constant">xmm0</span>: float <span class="Special"><-</span> <a href='mandelbrot-silhouette.mu.html#L119'>viewport-to-real</a> x, width
|
||||
<span id="L35" class="LineNr"> 35 </span> <span class="PreProc">var</span> iterations/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot-silhouette.mu.html#L54'>mandelbrot-iterations-for-point</a> real, imaginary, <span class="Constant">0x400</span>/max
|
||||
<span id="L36" class="LineNr"> 36 </span> compare iterations, <span class="Constant">0x400</span>/max
|
||||
<span id="L37" class="LineNr"> 37 </span> <span class="Delimiter">{</span>
|
||||
<span id="L38" class="LineNr"> 38 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L39" class="LineNr"> 39 </span> <a href='500fake-screen.mu.html#L483'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y, <span class="Constant">0xf</span>/white
|
||||
<span id="L40" class="LineNr"> 40 </span> <span class="Delimiter">}</span>
|
||||
<span id="L41" class="LineNr"> 41 </span> compare iterations, <span class="Constant">0x400</span>/max
|
||||
<span id="L42" class="LineNr"> 42 </span> <span class="Delimiter">{</span>
|
||||
<span id="L43" class="LineNr"> 43 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L44" class="LineNr"> 44 </span> <a href='500fake-screen.mu.html#L483'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y, <span class="Constant">0</span>/black
|
||||
<span id="L45" class="LineNr"> 45 </span> <span class="Delimiter">}</span>
|
||||
<span id="L46" class="LineNr"> 46 </span> x <span class="Special"><-</span> increment
|
||||
<span id="L47" class="LineNr"> 47 </span> <span class="PreProc">loop</span>
|
||||
<span id="L48" class="LineNr"> 48 </span> <span class="Delimiter">}</span>
|
||||
<span id="L49" class="LineNr"> 49 </span> y <span class="Special"><-</span> increment
|
||||
<span id="L50" class="LineNr"> 50 </span> <span class="PreProc">loop</span>
|
||||
<span id="L51" class="LineNr"> 51 </span> <span class="Delimiter">}</span>
|
||||
<span id="L52" class="LineNr"> 52 </span><span class="Delimiter">}</span>
|
||||
<span id="L53" class="LineNr"> 53 </span>
|
||||
<span id="L54" class="LineNr"> 54 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-silhouette.mu.html#L54'>mandelbrot-iterations-for-point</a></span> real: float, imaginary: float, max: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L55" class="LineNr"> 55 </span> <span class="PreProc">var</span> zero: float
|
||||
<span id="L56" class="LineNr"> 56 </span> <span class="PreProc">var</span> x/<span class="Constant">xmm0</span>: float <span class="Special"><-</span> copy zero
|
||||
<span id="L57" class="LineNr"> 57 </span> <span class="PreProc">var</span> y/<span class="Constant">xmm1</span>: float <span class="Special"><-</span> copy zero
|
||||
<span id="L58" class="LineNr"> 58 </span> <span class="PreProc">var</span> iterations/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L59" class="LineNr"> 59 </span> <span class="Delimiter">{</span>
|
||||
<span id="L60" class="LineNr"> 60 </span> <span class="PreProc">var</span> done?/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='mandelbrot-silhouette.mu.html#L75'>mandelbrot-done?</a> x, y
|
||||
<span id="L61" class="LineNr"> 61 </span> compare done?, <span class="Constant">0</span>/false
|
||||
<span id="L62" class="LineNr"> 62 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L63" class="LineNr"> 63 </span> compare iterations, max
|
||||
<span id="L64" class="LineNr"> 64 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L65" class="LineNr"> 65 </span> <span class="PreProc">var</span> newx/<span class="Constant">xmm2</span>: float <span class="Special"><-</span> <a href='mandelbrot-silhouette.mu.html#L93'>mandelbrot-x</a> x, y, real
|
||||
<span id="L66" class="LineNr"> 66 </span> <span class="PreProc">var</span> newy/<span class="Constant">xmm3</span>: float <span class="Special"><-</span> <a href='mandelbrot-silhouette.mu.html#L105'>mandelbrot-y</a> x, y, imaginary
|
||||
<span id="L67" class="LineNr"> 67 </span> x <span class="Special"><-</span> copy newx
|
||||
<span id="L68" class="LineNr"> 68 </span> y <span class="Special"><-</span> copy newy
|
||||
<span id="L69" class="LineNr"> 69 </span> iterations <span class="Special"><-</span> increment
|
||||
<span id="L70" class="LineNr"> 70 </span> <span class="PreProc">loop</span>
|
||||
<span id="L71" class="LineNr"> 71 </span> <span class="Delimiter">}</span>
|
||||
<span id="L72" class="LineNr"> 72 </span> <span class="PreProc">return</span> iterations
|
||||
<span id="L73" class="LineNr"> 73 </span><span class="Delimiter">}</span>
|
||||
<span id="L74" class="LineNr"> 74 </span>
|
||||
<span id="L75" class="LineNr"> 75 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-silhouette.mu.html#L75'>mandelbrot-done?</a></span> x: float, y: float<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: boolean <span class="Delimiter">{</span>
|
||||
<span id="L76" class="LineNr"> 76 </span> <span class="muComment"># x*x + y*y > 4</span>
|
||||
<span id="L77" class="LineNr"> 77 </span> <span class="PreProc">var</span> x2/<span class="Constant">xmm0</span>: float <span class="Special"><-</span> copy x
|
||||
<span id="L78" class="LineNr"> 78 </span> x2 <span class="Special"><-</span> multiply x
|
||||
<span id="L79" class="LineNr"> 79 </span> <span class="PreProc">var</span> y2/<span class="Constant">xmm1</span>: float <span class="Special"><-</span> copy y
|
||||
<span id="L80" class="LineNr"> 80 </span> y2 <span class="Special"><-</span> multiply y
|
||||
<span id="L81" class="LineNr"> 81 </span> <span class="PreProc">var</span> sum/<span class="Constant">xmm0</span>: float <span class="Special"><-</span> copy x2
|
||||
<span id="L82" class="LineNr"> 82 </span> sum <span class="Special"><-</span> add y2
|
||||
<span id="L83" class="LineNr"> 83 </span> <span class="PreProc">var</span> four/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">4</span>
|
||||
<span id="L84" class="LineNr"> 84 </span> <span class="PreProc">var</span> four-f/<span class="Constant">xmm1</span>: float <span class="Special"><-</span> convert four
|
||||
<span id="L85" class="LineNr"> 85 </span> compare sum, four-f
|
||||
<span id="L86" class="LineNr"> 86 </span> <span class="Delimiter">{</span>
|
||||
<span id="L87" class="LineNr"> 87 </span> <span class="PreProc">break-if-float></span>
|
||||
<span id="L88" class="LineNr"> 88 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
|
||||
<span id="L89" class="LineNr"> 89 </span> <span class="Delimiter">}</span>
|
||||
<span id="L90" class="LineNr"> 90 </span> <span class="PreProc">return</span> <span class="Constant">1</span>/true
|
||||
<span id="L91" class="LineNr"> 91 </span><span class="Delimiter">}</span>
|
||||
<span id="L92" class="LineNr"> 92 </span>
|
||||
<span id="L93" class="LineNr"> 93 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-silhouette.mu.html#L93'>mandelbrot-x</a></span> x: float, y: float, real: float<span class="PreProc"> -> </span>_/<span class="Constant">xmm2</span>: float <span class="Delimiter">{</span>
|
||||
<span id="L94" class="LineNr"> 94 </span> <span class="muComment"># x*x - y*y + real</span>
|
||||
<span id="L95" class="LineNr"> 95 </span> <span class="PreProc">var</span> x2/<span class="Constant">xmm0</span>: float <span class="Special"><-</span> copy x
|
||||
<span id="L96" class="LineNr"> 96 </span> x2 <span class="Special"><-</span> multiply x
|
||||
<span id="L97" class="LineNr"> 97 </span> <span class="PreProc">var</span> y2/<span class="Constant">xmm1</span>: float <span class="Special"><-</span> copy y
|
||||
<span id="L98" class="LineNr"> 98 </span> y2 <span class="Special"><-</span> multiply y
|
||||
<span id="L99" class="LineNr"> 99 </span> <span class="PreProc">var</span> result/<span class="Constant">xmm0</span>: float <span class="Special"><-</span> copy x2
|
||||
<span id="L100" class="LineNr">100 </span> result <span class="Special"><-</span> subtract y2
|
||||
<span id="L101" class="LineNr">101 </span> result <span class="Special"><-</span> add real
|
||||
<span id="L102" class="LineNr">102 </span> <span class="PreProc">return</span> result
|
||||
<span id="L103" class="LineNr">103 </span><span class="Delimiter">}</span>
|
||||
<span id="L104" class="LineNr">104 </span>
|
||||
<span id="L105" class="LineNr">105 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-silhouette.mu.html#L105'>mandelbrot-y</a></span> x: float, y: float, imaginary: float<span class="PreProc"> -> </span>_/<span class="Constant">xmm3</span>: float <span class="Delimiter">{</span>
|
||||
<span id="L106" class="LineNr">106 </span> <span class="muComment"># 2*x*y + imaginary</span>
|
||||
<span id="L107" class="LineNr">107 </span> <span class="PreProc">var</span> two/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">2</span>
|
||||
<span id="L108" class="LineNr">108 </span> <span class="PreProc">var</span> result/<span class="Constant">xmm0</span>: float <span class="Special"><-</span> convert two
|
||||
<span id="L109" class="LineNr">109 </span> result <span class="Special"><-</span> multiply x
|
||||
<span id="L110" class="LineNr">110 </span> result <span class="Special"><-</span> multiply y
|
||||
<span id="L111" class="LineNr">111 </span> result <span class="Special"><-</span> add imaginary
|
||||
<span id="L112" class="LineNr">112 </span> <span class="PreProc">return</span> result
|
||||
<span id="L113" class="LineNr">113 </span><span class="Delimiter">}</span>
|
||||
<span id="L114" class="LineNr">114 </span>
|
||||
<span id="L115" class="LineNr">115 </span><span class="muComment"># Scale (x, y) pixel coordinates to a complex plane where the viewport width</span>
|
||||
<span id="L116" class="LineNr">116 </span><span class="muComment"># ranges from -2 to +2. Viewport height just follows the viewport's aspect</span>
|
||||
<span id="L117" class="LineNr">117 </span><span class="muComment"># ratio.</span>
|
||||
<span id="L118" class="LineNr">118 </span>
|
||||
<span id="L119" class="LineNr">119 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-silhouette.mu.html#L119'>viewport-to-real</a></span> x: int, width: int<span class="PreProc"> -> </span>_/<span class="Constant">xmm0</span>: float <span class="Delimiter">{</span>
|
||||
<span id="L120" class="LineNr">120 </span> <span class="muComment"># (x - width/2)*4/width</span>
|
||||
<span id="L121" class="LineNr">121 </span> <span class="PreProc">var</span> result/<span class="Constant">xmm0</span>: float <span class="Special"><-</span> convert x
|
||||
<span id="L122" class="LineNr">122 </span> <span class="PreProc">var</span> width-f/<span class="Constant">xmm1</span>: float <span class="Special"><-</span> convert width
|
||||
<span id="L123" class="LineNr">123 </span> <span class="PreProc">var</span> two/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">2</span>
|
||||
<span id="L124" class="LineNr">124 </span> <span class="PreProc">var</span> two-f/<span class="Constant">xmm2</span>: float <span class="Special"><-</span> convert two
|
||||
<span id="L125" class="LineNr">125 </span> <span class="PreProc">var</span> half-width-f/<span class="Constant">xmm2</span>: float <span class="Special"><-</span> reciprocal two-f
|
||||
<span id="L126" class="LineNr">126 </span> half-width-f <span class="Special"><-</span> multiply width-f
|
||||
<span id="L127" class="LineNr">127 </span> result <span class="Special"><-</span> subtract half-width-f
|
||||
<span id="L128" class="LineNr">128 </span> <span class="PreProc">var</span> four/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">4</span>
|
||||
<span id="L129" class="LineNr">129 </span> <span class="PreProc">var</span> four-f/<span class="Constant">xmm2</span>: float <span class="Special"><-</span> convert four
|
||||
<span id="L130" class="LineNr">130 </span> result <span class="Special"><-</span> multiply four-f
|
||||
<span id="L131" class="LineNr">131 </span> result <span class="Special"><-</span> divide width-f
|
||||
<span id="L132" class="LineNr">132 </span> <span class="PreProc">return</span> result
|
||||
<span id="L133" class="LineNr">133 </span><span class="Delimiter">}</span>
|
||||
<span id="L134" class="LineNr">134 </span>
|
||||
<span id="L135" class="LineNr">135 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-silhouette.mu.html#L135'>viewport-to-imaginary</a></span> y: int, width: int, height: int<span class="PreProc"> -> </span>_/<span class="Constant">xmm1</span>: float <span class="Delimiter">{</span>
|
||||
<span id="L136" class="LineNr">136 </span> <span class="muComment"># (y - height/2)*4/width</span>
|
||||
<span id="L137" class="LineNr">137 </span> <span class="PreProc">var</span> result/<span class="Constant">xmm0</span>: float <span class="Special"><-</span> convert y
|
||||
<span id="L138" class="LineNr">138 </span> <span class="PreProc">var</span> height-f/<span class="Constant">xmm1</span>: float <span class="Special"><-</span> convert height
|
||||
<span id="L139" class="LineNr">139 </span> <span class="PreProc">var</span> half-height-f/<span class="Constant">xmm1</span>: float <span class="Special"><-</span> copy height-f
|
||||
<span id="L140" class="LineNr">140 </span> <span class="PreProc">var</span> two/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">2</span>
|
||||
<span id="L141" class="LineNr">141 </span> <span class="PreProc">var</span> two-f/<span class="Constant">xmm2</span>: float <span class="Special"><-</span> convert two
|
||||
<span id="L142" class="LineNr">142 </span> half-height-f <span class="Special"><-</span> divide two-f
|
||||
<span id="L143" class="LineNr">143 </span> result <span class="Special"><-</span> subtract half-height-f
|
||||
<span id="L144" class="LineNr">144 </span> <span class="PreProc">var</span> four/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">4</span>
|
||||
<span id="L145" class="LineNr">145 </span> <span class="PreProc">var</span> four-f/<span class="Constant">xmm1</span>: float <span class="Special"><-</span> convert four
|
||||
<span id="L146" class="LineNr">146 </span> result <span class="Special"><-</span> multiply four-f
|
||||
<span id="L147" class="LineNr">147 </span> <span class="PreProc">var</span> width-f/<span class="Constant">xmm1</span>: float <span class="Special"><-</span> convert width
|
||||
<span id="L148" class="LineNr">148 </span> result <span class="Special"><-</span> divide width-f
|
||||
<span id="L149" class="LineNr">149 </span> <span class="PreProc">return</span> result
|
||||
<span id="L150" class="LineNr">150 </span><span class="Delimiter">}</span>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
<!-- vim: set foldmethod=manual : -->
|
46
html/mandelbrot.mu.html
generated
46
html/mandelbrot.mu.html
generated
|
@ -15,9 +15,15 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.PreProc { color: #c000c0; }
|
||||
.muRegEcx { color: #af875f; }
|
||||
.Special { color: #ff6060; }
|
||||
.LineNr { }
|
||||
.muRegEdi { color: #87ffd7; }
|
||||
.muRegEbx { color: #8787af; }
|
||||
.muRegEdx { color: #878700; }
|
||||
.Constant { color: #008787; }
|
||||
.muRegEsi { color: #87d787; }
|
||||
.muRegEax { color: #875f00; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muComment { color: #005faf; }
|
||||
|
@ -76,11 +82,11 @@ if ('onhashchange' in window) {
|
|||
<span id="L18" class="LineNr"> 18 </span> <span class="muComment"># Initially the viewport shows a section of the scene 4 units wide.</span>
|
||||
<span id="L19" class="LineNr"> 19 </span> <span class="muComment"># scene-width-scale = 0.5</span>
|
||||
<span id="L20" class="LineNr"> 20 </span> <span class="PreProc">var</span> scene-width-scale: float
|
||||
<span id="L21" class="LineNr"> 21 </span> <span class="PreProc">var</span> dest/<span class="Constant">eax</span>: (addr float) <span class="Special"><-</span> address scene-width-scale
|
||||
<span id="L21" class="LineNr"> 21 </span> <span class="PreProc">var</span> dest/<span class="muRegEax">eax</span>: (addr float) <span class="Special"><-</span> address scene-width-scale
|
||||
<span id="L22" class="LineNr"> 22 </span> <a href='408float.mu.html#L3'>fill-in-rational</a> dest, <span class="Constant">1</span>, <span class="Constant">2</span>
|
||||
<span id="L23" class="LineNr"> 23 </span> <span class="muComment"># scene-width = 4</span>
|
||||
<span id="L24" class="LineNr"> 24 </span> <span class="PreProc">var</span> four: float
|
||||
<span id="L25" class="LineNr"> 25 </span> <span class="PreProc">var</span> dest/<span class="Constant">eax</span>: (addr float) <span class="Special"><-</span> address four
|
||||
<span id="L25" class="LineNr"> 25 </span> <span class="PreProc">var</span> dest/<span class="muRegEax">eax</span>: (addr float) <span class="Special"><-</span> address four
|
||||
<span id="L26" class="LineNr"> 26 </span> <a href='408float.mu.html#L3'>fill-in-rational</a> dest, <span class="Constant">4</span>, <span class="Constant">1</span>
|
||||
<span id="L27" class="LineNr"> 27 </span> <span class="PreProc">var</span> scene-width/<span class="Constant">xmm3</span>: float <span class="Special"><-</span> copy four
|
||||
<span id="L28" class="LineNr"> 28 </span> <span class="Delimiter">{</span>
|
||||
|
@ -97,29 +103,29 @@ if ('onhashchange' in window) {
|
|||
<span id="L39" class="LineNr"> 39 </span><span class="Delimiter">}</span>
|
||||
<span id="L40" class="LineNr"> 40 </span>
|
||||
<span id="L41" class="LineNr"> 41 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot.mu.html#L41'>mandelbrot</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), scene-cx: float, scene-cy: float, scene-width: float <span class="Delimiter">{</span>
|
||||
<span id="L42" class="LineNr"> 42 </span> <span class="PreProc">var</span> a/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L43" class="LineNr"> 43 </span> <span class="PreProc">var</span> b/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L44" class="LineNr"> 44 </span> a, b <span class="Special"><-</span> <a href='500fake-screen.mu.html#L70'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L45" class="LineNr"> 45 </span> <span class="PreProc">var</span> width/<span class="Constant">esi</span>: int <span class="Special"><-</span> copy a
|
||||
<span id="L42" class="LineNr"> 42 </span> <span class="PreProc">var</span> a/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L43" class="LineNr"> 43 </span> <span class="PreProc">var</span> b/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L44" class="LineNr"> 44 </span> a, b <span class="Special"><-</span> <a href='500fake-screen.mu.html#L86'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L45" class="LineNr"> 45 </span> <span class="PreProc">var</span> width/<span class="muRegEsi">esi</span>: int <span class="Special"><-</span> copy a
|
||||
<span id="L46" class="LineNr"> 46 </span> width <span class="Special"><-</span> shift-left <span class="Constant">3</span>/log2-font-width
|
||||
<span id="L47" class="LineNr"> 47 </span> <span class="PreProc">var</span> height/<span class="Constant">edi</span>: int <span class="Special"><-</span> copy b
|
||||
<span id="L47" class="LineNr"> 47 </span> <span class="PreProc">var</span> height/<span class="muRegEdi">edi</span>: int <span class="Special"><-</span> copy b
|
||||
<span id="L48" class="LineNr"> 48 </span> height <span class="Special"><-</span> shift-left <span class="Constant">4</span>/log2-font-height
|
||||
<span id="L49" class="LineNr"> 49 </span> <span class="PreProc">var</span> y/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L49" class="LineNr"> 49 </span> <span class="PreProc">var</span> y/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L50" class="LineNr"> 50 </span> <span class="Delimiter">{</span>
|
||||
<span id="L51" class="LineNr"> 51 </span> compare y, height
|
||||
<span id="L52" class="LineNr"> 52 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L53" class="LineNr"> 53 </span> <span class="PreProc">var</span> imaginary/<span class="Constant">xmm1</span>: float <span class="Special"><-</span> <a href='mandelbrot.mu.html#L157'>viewport-to-imaginary</a> y, width, height, scene-cy, scene-width
|
||||
<span id="L54" class="LineNr"> 54 </span> <span class="PreProc">var</span> x/<span class="Constant">ebx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L54" class="LineNr"> 54 </span> <span class="PreProc">var</span> x/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L55" class="LineNr"> 55 </span> <span class="Delimiter">{</span>
|
||||
<span id="L56" class="LineNr"> 56 </span> compare x, width
|
||||
<span id="L57" class="LineNr"> 57 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L58" class="LineNr"> 58 </span> <span class="PreProc">var</span> real/<span class="Constant">xmm0</span>: float <span class="Special"><-</span> <a href='mandelbrot.mu.html#L138'>viewport-to-real</a> x, width, scene-cx, scene-width
|
||||
<span id="L59" class="LineNr"> 59 </span> <span class="PreProc">var</span> iterations/<span class="Constant">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot.mu.html#L73'>mandelbrot-iterations-for-point</a> real, imaginary, <span class="Constant">0x400</span>/max
|
||||
<span id="L59" class="LineNr"> 59 </span> <span class="PreProc">var</span> iterations/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='mandelbrot.mu.html#L73'>mandelbrot-iterations-for-point</a> real, imaginary, <span class="Constant">0x400</span>/max
|
||||
<span id="L60" class="LineNr"> 60 </span> iterations <span class="Special"><-</span> shift-right <span class="Constant">3</span>
|
||||
<span id="L61" class="LineNr"> 61 </span> <span class="PreProc">var</span> color/<span class="Constant">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L61" class="LineNr"> 61 </span> <span class="PreProc">var</span> color/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L62" class="LineNr"> 62 </span> iterations, color <span class="Special"><-</span> <a href='314divide.subx.html#L3'>integer-divide</a> iterations, <span class="Constant">0x18</span>/<span class="Constant">24</span>/size-of-cycle-0
|
||||
<span id="L63" class="LineNr"> 63 </span> color <span class="Special"><-</span> add <span class="Constant">0x20</span>/cycle-0
|
||||
<span id="L64" class="LineNr"> 64 </span> <a href='500fake-screen.mu.html#L463'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y, color
|
||||
<span id="L64" class="LineNr"> 64 </span> <a href='500fake-screen.mu.html#L483'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y, color
|
||||
<span id="L65" class="LineNr"> 65 </span> x <span class="Special"><-</span> increment
|
||||
<span id="L66" class="LineNr"> 66 </span> <span class="PreProc">loop</span>
|
||||
<span id="L67" class="LineNr"> 67 </span> <span class="Delimiter">}</span>
|
||||
|
@ -128,13 +134,13 @@ if ('onhashchange' in window) {
|
|||
<span id="L70" class="LineNr"> 70 </span> <span class="Delimiter">}</span>
|
||||
<span id="L71" class="LineNr"> 71 </span><span class="Delimiter">}</span>
|
||||
<span id="L72" class="LineNr"> 72 </span>
|
||||
<span id="L73" class="LineNr"> 73 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot.mu.html#L73'>mandelbrot-iterations-for-point</a></span> real: float, imaginary: float, max: int<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L73" class="LineNr"> 73 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot.mu.html#L73'>mandelbrot-iterations-for-point</a></span> real: float, imaginary: float, max: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L74" class="LineNr"> 74 </span> <span class="PreProc">var</span> zero: float
|
||||
<span id="L75" class="LineNr"> 75 </span> <span class="PreProc">var</span> x/<span class="Constant">xmm0</span>: float <span class="Special"><-</span> copy zero
|
||||
<span id="L76" class="LineNr"> 76 </span> <span class="PreProc">var</span> y/<span class="Constant">xmm1</span>: float <span class="Special"><-</span> copy zero
|
||||
<span id="L77" class="LineNr"> 77 </span> <span class="PreProc">var</span> iterations/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L77" class="LineNr"> 77 </span> <span class="PreProc">var</span> iterations/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L78" class="LineNr"> 78 </span> <span class="Delimiter">{</span>
|
||||
<span id="L79" class="LineNr"> 79 </span> <span class="PreProc">var</span> done?/<span class="Constant">eax</span>: boolean <span class="Special"><-</span> <a href='mandelbrot.mu.html#L94'>mandelbrot-done?</a> x, y
|
||||
<span id="L79" class="LineNr"> 79 </span> <span class="PreProc">var</span> done?/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='mandelbrot.mu.html#L94'>mandelbrot-done?</a> x, y
|
||||
<span id="L80" class="LineNr"> 80 </span> compare done?, <span class="Constant">0</span>/false
|
||||
<span id="L81" class="LineNr"> 81 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L82" class="LineNr"> 82 </span> compare iterations, max
|
||||
|
@ -149,7 +155,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L91" class="LineNr"> 91 </span> <span class="PreProc">return</span> iterations
|
||||
<span id="L92" class="LineNr"> 92 </span><span class="Delimiter">}</span>
|
||||
<span id="L93" class="LineNr"> 93 </span>
|
||||
<span id="L94" class="LineNr"> 94 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot.mu.html#L94'>mandelbrot-done?</a></span> x: float, y: float<span class="PreProc"> -> </span>_/<span class="Constant">eax</span>: boolean <span class="Delimiter">{</span>
|
||||
<span id="L94" class="LineNr"> 94 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot.mu.html#L94'>mandelbrot-done?</a></span> x: float, y: float<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: boolean <span class="Delimiter">{</span>
|
||||
<span id="L95" class="LineNr"> 95 </span> <span class="muComment"># x*x + y*y > 4</span>
|
||||
<span id="L96" class="LineNr"> 96 </span> <span class="PreProc">var</span> x2/<span class="Constant">xmm0</span>: float <span class="Special"><-</span> copy x
|
||||
<span id="L97" class="LineNr"> 97 </span> x2 <span class="Special"><-</span> multiply x
|
||||
|
@ -157,7 +163,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L99" class="LineNr"> 99 </span> y2 <span class="Special"><-</span> multiply y
|
||||
<span id="L100" class="LineNr">100 </span> <span class="PreProc">var</span> sum/<span class="Constant">xmm0</span>: float <span class="Special"><-</span> copy x2
|
||||
<span id="L101" class="LineNr">101 </span> sum <span class="Special"><-</span> add y2
|
||||
<span id="L102" class="LineNr">102 </span> <span class="PreProc">var</span> four/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">4</span>
|
||||
<span id="L102" class="LineNr">102 </span> <span class="PreProc">var</span> four/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">4</span>
|
||||
<span id="L103" class="LineNr">103 </span> <span class="PreProc">var</span> four-f/<span class="Constant">xmm1</span>: float <span class="Special"><-</span> convert four
|
||||
<span id="L104" class="LineNr">104 </span> compare sum, four-f
|
||||
<span id="L105" class="LineNr">105 </span> <span class="Delimiter">{</span>
|
||||
|
@ -181,7 +187,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L123" class="LineNr">123 </span>
|
||||
<span id="L124" class="LineNr">124 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot.mu.html#L124'>mandelbrot-y</a></span> x: float, y: float, imaginary: float<span class="PreProc"> -> </span>_/<span class="Constant">xmm3</span>: float <span class="Delimiter">{</span>
|
||||
<span id="L125" class="LineNr">125 </span> <span class="muComment"># 2*x*y + imaginary</span>
|
||||
<span id="L126" class="LineNr">126 </span> <span class="PreProc">var</span> two/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">2</span>
|
||||
<span id="L126" class="LineNr">126 </span> <span class="PreProc">var</span> two/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">2</span>
|
||||
<span id="L127" class="LineNr">127 </span> <span class="PreProc">var</span> result/<span class="Constant">xmm0</span>: float <span class="Special"><-</span> convert two
|
||||
<span id="L128" class="LineNr">128 </span> result <span class="Special"><-</span> multiply x
|
||||
<span id="L129" class="LineNr">129 </span> result <span class="Special"><-</span> multiply y
|
||||
|
@ -204,7 +210,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L146" class="LineNr">146 </span> <span class="PreProc">var</span> width-f/<span class="Constant">xmm1</span>: float <span class="Special"><-</span> convert width
|
||||
<span id="L147" class="LineNr">147 </span> result <span class="Special"><-</span> divide width-f
|
||||
<span id="L148" class="LineNr">148 </span> result <span class="Special"><-</span> add scene-cx
|
||||
<span id="L149" class="LineNr">149 </span> <span class="PreProc">var</span> two/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">2</span>
|
||||
<span id="L149" class="LineNr">149 </span> <span class="PreProc">var</span> two/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">2</span>
|
||||
<span id="L150" class="LineNr">150 </span> <span class="PreProc">var</span> two-f/<span class="Constant">xmm2</span>: float <span class="Special"><-</span> convert two
|
||||
<span id="L151" class="LineNr">151 </span> <span class="PreProc">var</span> half-scene-width/<span class="Constant">xmm1</span>: float <span class="Special"><-</span> copy scene-width
|
||||
<span id="L152" class="LineNr">152 </span> half-scene-width <span class="Special"><-</span> divide two-f
|
||||
|
@ -224,7 +230,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L166" class="LineNr">166 </span> <span class="PreProc">var</span> width-f/<span class="Constant">xmm1</span>: float <span class="Special"><-</span> convert width
|
||||
<span id="L167" class="LineNr">167 </span> result <span class="Special"><-</span> divide width-f
|
||||
<span id="L168" class="LineNr">168 </span> result <span class="Special"><-</span> add scene-cy
|
||||
<span id="L169" class="LineNr">169 </span> <span class="PreProc">var</span> two/<span class="Constant">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">2</span>
|
||||
<span id="L169" class="LineNr">169 </span> <span class="PreProc">var</span> two/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">2</span>
|
||||
<span id="L170" class="LineNr">170 </span> <span class="PreProc">var</span> two-f/<span class="Constant">xmm2</span>: float <span class="Special"><-</span> convert two
|
||||
<span id="L171" class="LineNr">171 </span> <span class="PreProc">var</span> second-term/<span class="Constant">xmm1</span>: float <span class="Special"><-</span> copy scene-width
|
||||
<span id="L172" class="LineNr">172 </span> second-term <span class="Special"><-</span> divide two-f
|
||||
|
|
21
html/mu-init.subx.html
generated
21
html/mu-init.subx.html
generated
|
@ -77,16 +77,17 @@ if ('onhashchange' in window) {
|
|||
<span id="L21" class="LineNr">21 </span> {
|
||||
<span id="L22" class="LineNr">22 </span> 3d/compare-eax-and 0/imm32
|
||||
<span id="L23" class="LineNr">23 </span> 75/jump-if-!= <span class="Constant">break</span>/disp8
|
||||
<span id="L24" class="LineNr">24 </span> (<a href='500fake-screen.mu.html#L365'>clear-real-screen</a>)
|
||||
<span id="L25" class="LineNr">25 </span> c7 0/subop/copy *<span class="SpecialChar"><a href='103grapheme.subx.html#L170'>Real-screen-cursor-x</a></span> 0/imm32
|
||||
<span id="L26" class="LineNr">26 </span> c7 0/subop/copy *<span class="SpecialChar"><a href='103grapheme.subx.html#L172'>Real-screen-cursor-y</a></span> 0/imm32
|
||||
<span id="L27" class="LineNr">27 </span> (main 0 0 <span class="SpecialChar"><a href='boot.subx.html#L934'>Primary-bus-secondary-drive</a></span>)
|
||||
<span id="L28" class="LineNr">28 </span> }
|
||||
<span id="L29" class="LineNr">29 </span>
|
||||
<span id="L30" class="LineNr">30 </span> <span class="subxComment"># hang indefinitely</span>
|
||||
<span id="L31" class="LineNr">31 </span> {
|
||||
<span id="L32" class="LineNr">32 </span> eb/jump <span class="Constant">loop</span>/disp8
|
||||
<span id="L33" class="LineNr">33 </span> }
|
||||
<span id="L24" class="LineNr">24 </span> c7 0/subop/copy *Running-tests? 0/imm32/false
|
||||
<span id="L25" class="LineNr">25 </span> (<a href='500fake-screen.mu.html#L385'>clear-real-screen</a>)
|
||||
<span id="L26" class="LineNr">26 </span> c7 0/subop/copy *<span class="SpecialChar"><a href='103grapheme.subx.html#L231'>Real-screen-cursor-x</a></span> 0/imm32
|
||||
<span id="L27" class="LineNr">27 </span> c7 0/subop/copy *<span class="SpecialChar"><a href='103grapheme.subx.html#L233'>Real-screen-cursor-y</a></span> 0/imm32
|
||||
<span id="L28" class="LineNr">28 </span> (main 0 0 <span class="SpecialChar"><a href='boot.subx.html#L948'>Primary-bus-secondary-drive</a></span>)
|
||||
<span id="L29" class="LineNr">29 </span> }
|
||||
<span id="L30" class="LineNr">30 </span>
|
||||
<span id="L31" class="LineNr">31 </span> <span class="subxComment"># hang indefinitely</span>
|
||||
<span id="L32" class="LineNr">32 </span> {
|
||||
<span id="L33" class="LineNr">33 </span> eb/jump <span class="Constant">loop</span>/disp8
|
||||
<span id="L34" class="LineNr">34 </span> }
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
95
html/rpn.mu.html
generated
95
html/rpn.mu.html
generated
|
@ -15,9 +15,14 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.PreProc { color: #c000c0; }
|
||||
.muRegEcx { color: #af875f; }
|
||||
.Special { color: #ff6060; }
|
||||
.LineNr { }
|
||||
.muRegEdi { color: #87ffd7; }
|
||||
.muRegEdx { color: #878700; }
|
||||
.Constant { color: #008787; }
|
||||
.muRegEsi { color: #87d787; }
|
||||
.muRegEax { color: #875f00; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muComment { color: #005faf; }
|
||||
|
@ -75,25 +80,25 @@ if ('onhashchange' in window) {
|
|||
<span id="L17" class="LineNr"> 17 </span>
|
||||
<span id="L18" class="LineNr"> 18 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='rpn.mu.html#L18'>main</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
|
||||
<span id="L19" class="LineNr"> 19 </span> <span class="PreProc">var</span> in-storage: (stream byte <span class="Constant">0x80</span>)
|
||||
<span id="L20" class="LineNr"> 20 </span> <span class="PreProc">var</span> in/<span class="Constant">esi</span>: (addr stream byte) <span class="Special"><-</span> address in-storage
|
||||
<span id="L21" class="LineNr"> 21 </span> <span class="PreProc">var</span> y/<span class="Constant">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L22" class="LineNr"> 22 </span> <span class="PreProc">var</span> space/<span class="Constant">edx</span>: grapheme <span class="Special"><-</span> copy <span class="Constant">0x20</span>
|
||||
<span id="L20" class="LineNr"> 20 </span> <span class="PreProc">var</span> in/<span class="muRegEsi">esi</span>: (addr stream byte) <span class="Special"><-</span> address in-storage
|
||||
<span id="L21" class="LineNr"> 21 </span> <span class="PreProc">var</span> y/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L22" class="LineNr"> 22 </span> <span class="PreProc">var</span> space/<span class="muRegEdx">edx</span>: grapheme <span class="Special"><-</span> copy <span class="Constant">0x20</span>
|
||||
<span id="L23" class="LineNr"> 23 </span> <span class="muComment"># read-eval-print loop</span>
|
||||
<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"><-</span> <a href='501draw-text.mu.html#L100'>draw-text-rightward</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">"> "</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="L26" class="LineNr"> 26 </span> <span class="PreProc">var</span> x/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='501draw-text.mu.html#L100'>draw-text-rightward</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">"> "</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> <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#L217'>draw-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, space
|
||||
<span id="L31" class="LineNr"> 31 </span> <span class="PreProc">var</span> key/<span class="Constant">eax</span>: byte <span class="Special"><-</span> <a href='102keyboard.subx.html#L21'>read-key</a> keyboard
|
||||
<span id="L30" class="LineNr"> 30 </span> <a href='500fake-screen.mu.html#L237'>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="muRegEax">eax</span>: byte <span class="Special"><-</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"><-</span> copy key
|
||||
<span id="L36" class="LineNr"> 36 </span> <span class="PreProc">var</span> key2/<span class="muRegEax">eax</span>: int <span class="Special"><-</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"><-</span> copy key2
|
||||
<span id="L38" class="LineNr"> 38 </span> <span class="PreProc">var</span> g/<span class="muRegEax">eax</span>: grapheme <span class="Special"><-</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>
|
||||
|
@ -101,7 +106,7 @@ if ('onhashchange' in window) {
|
|||
<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"><-</span> <a href='rpn.mu.html#L62'>simplify</a> in
|
||||
<span id="L46" class="LineNr"> 46 </span> <span class="PreProc">var</span> out/<span class="muRegEax">eax</span>: int <span class="Special"><-</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"><-</span> increment
|
||||
<span id="L49" class="LineNr"> 49 </span> out, y <span class="Special"><-</span> <a href='501draw-text.mu.html#L340'>draw-int32-decimal-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L14'>screen</a>, out, <span class="Constant">0</span>/xmin, y, <span class="Constant">0x80</span>/xmax, <span class="Constant">0x30</span>/ymax, <span class="Constant">0</span>/x, y, <span class="Constant">7</span>/fg, <span class="Constant">0</span>/bg
|
||||
|
@ -117,94 +122,94 @@ if ('onhashchange' in window) {
|
|||
<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"> -> </span>_/<span class="Constant">eax</span>: int <span class="Delimiter">{</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"> -> </span>_/<span class="muRegEax">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"><-</span> address word-storage
|
||||
<span id="L64" class="LineNr"> 64 </span> <span class="PreProc">var</span> word/<span class="muRegEcx">ecx</span>: (addr slice) <span class="Special"><-</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"><-</span> address stack-storage
|
||||
<span id="L66" class="LineNr"> 66 </span> <span class="PreProc">var</span> stack/<span class="muRegEsi">esi</span>: (addr <a href='rpn.mu.html#L57'>int-stack</a>) <span class="Special"><-</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"><-</span> <a href='123slice.subx.html#L9'>slice-empty?</a> word
|
||||
<span id="L70" class="LineNr"> 70 </span> <span class="PreProc">var</span> done?/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</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"><-</span> <a href='123slice.subx.html#L120'>slice-equal?</a> word, <span class="Constant">"+"</span>
|
||||
<span id="L75" class="LineNr"> 75 </span> <span class="PreProc">var</span> is-add?/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='123slice.subx.html#L120'>slice-equal?</a> word, <span class="Constant">"+"</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"><-</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"><-</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"><-</span> <a href='rpn.mu.html#L136'>pop-int-stack</a> stack
|
||||
<span id="L78" class="LineNr"> 78 </span> <span class="PreProc">var</span> _b/<span class="muRegEax">eax</span>: int <span class="Special"><-</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="muRegEdx">edx</span>: int <span class="Special"><-</span> copy _b
|
||||
<span id="L80" class="LineNr"> 80 </span> <span class="PreProc">var</span> a/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='rpn.mu.html#L136'>pop-int-stack</a> stack
|
||||
<span id="L81" class="LineNr"> 81 </span> a <span class="Special"><-</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"><-</span> <a href='123slice.subx.html#L120'>slice-equal?</a> word, <span class="Constant">"-"</span>
|
||||
<span id="L86" class="LineNr"> 86 </span> <span class="PreProc">var</span> is-sub?/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='123slice.subx.html#L120'>slice-equal?</a> word, <span class="Constant">"-"</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"><-</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"><-</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"><-</span> <a href='rpn.mu.html#L136'>pop-int-stack</a> stack
|
||||
<span id="L89" class="LineNr"> 89 </span> <span class="PreProc">var</span> _b/<span class="muRegEax">eax</span>: int <span class="Special"><-</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="muRegEdx">edx</span>: int <span class="Special"><-</span> copy _b
|
||||
<span id="L91" class="LineNr"> 91 </span> <span class="PreProc">var</span> a/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='rpn.mu.html#L136'>pop-int-stack</a> stack
|
||||
<span id="L92" class="LineNr"> 92 </span> a <span class="Special"><-</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"><-</span> <a href='123slice.subx.html#L120'>slice-equal?</a> word, <span class="Constant">"*"</span>
|
||||
<span id="L97" class="LineNr"> 97 </span> <span class="PreProc">var</span> is-mul?/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='123slice.subx.html#L120'>slice-equal?</a> word, <span class="Constant">"*"</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"><-</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"><-</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"><-</span> <a href='rpn.mu.html#L136'>pop-int-stack</a> stack
|
||||
<span id="L100" class="LineNr">100 </span> <span class="PreProc">var</span> _b/<span class="muRegEax">eax</span>: int <span class="Special"><-</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="muRegEdx">edx</span>: int <span class="Special"><-</span> copy _b
|
||||
<span id="L102" class="LineNr">102 </span> <span class="PreProc">var</span> a/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> <a href='rpn.mu.html#L136'>pop-int-stack</a> stack
|
||||
<span id="L103" class="LineNr">103 </span> a <span class="Special"><-</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"><-</span> <a href='311decimal-int.subx.html#L4'>parse-decimal-int-from-slice</a> word
|
||||
<span id="L108" class="LineNr">108 </span> <span class="PreProc">var</span> n/<span class="muRegEax">eax</span>: int <span class="Special"><-</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"><-</span> <a href='rpn.mu.html#L136'>pop-int-stack</a> stack
|
||||
<span id="L112" class="LineNr">112 </span> <span class="PreProc">var</span> result/<span class="muRegEax">eax</span>: int <span class="Special"><-</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"><-</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"><-</span> get self, data
|
||||
<span id="L117" class="LineNr">117 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='rpn.mu.html#L57'>int-stack</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L118" class="LineNr">118 </span> <span class="PreProc">var</span> d/<span class="muRegEdi">edi</span>: (addr handle array int) <span class="Special"><-</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"><-</span> get self, top
|
||||
<span id="L120" class="LineNr">120 </span> <span class="PreProc">var</span> top/<span class="muRegEax">eax</span>: (addr int) <span class="Special"><-</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"><-</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"><-</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"><-</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"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *data-ah
|
||||
<span id="L129" class="LineNr">129 </span> <span class="PreProc">var</span> top/<span class="Constant">edx</span>: int <span class="Special"><-</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"><-</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"><-</span> copy _val
|
||||
<span id="L125" class="LineNr">125 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='rpn.mu.html#L57'>int-stack</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L126" class="LineNr">126 </span> <span class="PreProc">var</span> top-addr/<span class="muRegEcx">ecx</span>: (addr int) <span class="Special"><-</span> get self, top
|
||||
<span id="L127" class="LineNr">127 </span> <span class="PreProc">var</span> data-ah/<span class="muRegEdx">edx</span>: (addr handle array int) <span class="Special"><-</span> get self, data
|
||||
<span id="L128" class="LineNr">128 </span> <span class="PreProc">var</span> data/<span class="muRegEax">eax</span>: (addr array int) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *data-ah
|
||||
<span id="L129" class="LineNr">129 </span> <span class="PreProc">var</span> top/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy *top-addr
|
||||
<span id="L130" class="LineNr">130 </span> <span class="PreProc">var</span> dest-addr/<span class="muRegEdx">edx</span>: (addr int) <span class="Special"><-</span> index data, top
|
||||
<span id="L131" class="LineNr">131 </span> <span class="PreProc">var</span> val/<span class="muRegEax">eax</span>: int <span class="Special"><-</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"> -> </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"><-</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"><-</span> get self, top
|
||||
<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"> -> </span>_/<span class="muRegEax">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L137" class="LineNr">137 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='rpn.mu.html#L57'>int-stack</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L138" class="LineNr">138 </span> <span class="PreProc">var</span> top-addr/<span class="muRegEcx">ecx</span>: (addr int) <span class="Special"><-</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-></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"><-</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"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *data-ah
|
||||
<span id="L147" class="LineNr">147 </span> <span class="PreProc">var</span> top/<span class="Constant">edx</span>: int <span class="Special"><-</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"><-</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"><-</span> copy *result-addr
|
||||
<span id="L145" class="LineNr">145 </span> <span class="PreProc">var</span> data-ah/<span class="muRegEdx">edx</span>: (addr handle array int) <span class="Special"><-</span> get self, data
|
||||
<span id="L146" class="LineNr">146 </span> <span class="PreProc">var</span> data/<span class="muRegEax">eax</span>: (addr array int) <span class="Special"><-</span> <a href='120allocate.subx.html#L223'>lookup</a> *data-ah
|
||||
<span id="L147" class="LineNr">147 </span> <span class="PreProc">var</span> top/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy *top-addr
|
||||
<span id="L148" class="LineNr">148 </span> <span class="PreProc">var</span> result-addr/<span class="muRegEax">eax</span>: (addr int) <span class="Special"><-</span> index data, top
|
||||
<span id="L149" class="LineNr">149 </span> <span class="PreProc">var</span> val/<span class="muRegEax">eax</span>: int <span class="Special"><-</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>
|
||||
|
|
14
html/shell/cell.mu.html
generated
14
html/shell/cell.mu.html
generated
|
@ -17,10 +17,10 @@ a { color:inherit; }
|
|||
.PreProc { color: #c000c0; }
|
||||
.Special { color: #ff6060; }
|
||||
.LineNr { }
|
||||
.muRegEsi { color: #87d787; }
|
||||
.Constant { color: #008787; }
|
||||
.muRegEax { color: #875f00; }
|
||||
.muRegEcx { color: #af875f; }
|
||||
.muRegEsi { color: #87d787; }
|
||||
.muRegEax { color: #875f00; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muComment { color: #005faf; }
|
||||
|
@ -219,10 +219,10 @@ if ('onhashchange' in window) {
|
|||
<span id="L158" class="LineNr">158 </span> <span class="PreProc">var</span> dest-ah/<span class="muRegEax">eax</span>: (addr handle <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special"><-</span> get out-addr, screen-data
|
||||
<span id="L159" class="LineNr">159 </span> <a href='../120allocate.subx.html#L43'>allocate</a> dest-ah
|
||||
<span id="L160" class="LineNr">160 </span> <span class="PreProc">var</span> dest-addr/<span class="muRegEax">eax</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special"><-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *dest-ah
|
||||
<span id="L161" class="LineNr">161 </span> <a href='../500fake-screen.mu.html#L31'>initialize-screen</a> dest-addr, width, height, pixel-graphics?
|
||||
<span id="L161" class="LineNr">161 </span> <a href='../500fake-screen.mu.html#L33'>initialize-screen</a> dest-addr, width, height, pixel-graphics?
|
||||
<span id="L162" class="LineNr">162 </span><span class="Delimiter">}</span>
|
||||
<span id="L163" class="LineNr">163 </span>
|
||||
<span id="L164" class="LineNr">164 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L164'>clear-screen-cell</a></span> _self-ah: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Delimiter">{</span>
|
||||
<span id="L164" class="LineNr">164 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L164'>clear-screen-var</a></span> _self-ah: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Delimiter">{</span>
|
||||
<span id="L165" class="LineNr">165 </span> <span class="PreProc">var</span> self-ah/<span class="muRegEax">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special"><-</span> copy _self-ah
|
||||
<span id="L166" class="LineNr">166 </span> <span class="PreProc">var</span> self/<span class="muRegEax">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special"><-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *self-ah
|
||||
<span id="L167" class="LineNr">167 </span> compare self, <span class="Constant">0</span>
|
||||
|
@ -232,7 +232,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L171" class="LineNr">171 </span> <span class="Delimiter">}</span>
|
||||
<span id="L172" class="LineNr">172 </span> <span class="PreProc">var</span> screen-ah/<span class="muRegEax">eax</span>: (addr handle <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special"><-</span> get self, screen-data
|
||||
<span id="L173" class="LineNr">173 </span> <span class="PreProc">var</span> <a href='../500fake-screen.mu.html#L14'>screen</a>/<span class="muRegEax">eax</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special"><-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *screen-ah
|
||||
<span id="L174" class="LineNr">174 </span> <a href='../500fake-screen.mu.html#L231'>clear-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L174" class="LineNr">174 </span> <a href='../500fake-screen.mu.html#L251'>clear-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L175" class="LineNr">175 </span><span class="Delimiter">}</span>
|
||||
<span id="L176" class="LineNr">176 </span>
|
||||
<span id="L177" class="LineNr">177 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L177'>allocate-keyboard</a></span> _out: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Delimiter">{</span>
|
||||
|
@ -253,7 +253,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L192" class="LineNr">192 </span> <a href='gap-buffer.mu.html#L11'>initialize-gap-buffer</a> dest-addr, capacity
|
||||
<span id="L193" class="LineNr">193 </span><span class="Delimiter">}</span>
|
||||
<span id="L194" class="LineNr">194 </span>
|
||||
<span id="L195" class="LineNr">195 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L195'>rewind-keyboard-cell</a></span> _self-ah: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Delimiter">{</span>
|
||||
<span id="L195" class="LineNr">195 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='cell.mu.html#L195'>rewind-keyboard-var</a></span> _self-ah: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Delimiter">{</span>
|
||||
<span id="L196" class="LineNr">196 </span> <span class="PreProc">var</span> self-ah/<span class="muRegEax">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special"><-</span> copy _self-ah
|
||||
<span id="L197" class="LineNr">197 </span> <span class="PreProc">var</span> self/<span class="muRegEax">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special"><-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *self-ah
|
||||
<span id="L198" class="LineNr">198 </span> compare self, <span class="Constant">0</span>
|
||||
|
@ -263,7 +263,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L202" class="LineNr">202 </span> <span class="Delimiter">}</span>
|
||||
<span id="L203" class="LineNr">203 </span> <span class="PreProc">var</span> keyboard-ah/<span class="muRegEax">eax</span>: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special"><-</span> get self, keyboard-data
|
||||
<span id="L204" class="LineNr">204 </span> <span class="PreProc">var</span> keyboard/<span class="muRegEax">eax</span>: (addr <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special"><-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *keyboard-ah
|
||||
<span id="L205" class="LineNr">205 </span> <a href='gap-buffer.mu.html#L1012'>rewind-gap-buffer</a> keyboard
|
||||
<span id="L205" class="LineNr">205 </span> <a href='gap-buffer.mu.html#L1015'>rewind-gap-buffer</a> keyboard
|
||||
<span id="L206" class="LineNr">206 </span><span class="Delimiter">}</span>
|
||||
</pre>
|
||||
</body>
|
||||
|
|
1459
html/shell/environment.mu.html
generated
1459
html/shell/environment.mu.html
generated
File diff suppressed because it is too large
Load Diff
3397
html/shell/evaluate.mu.html
generated
3397
html/shell/evaluate.mu.html
generated
File diff suppressed because it is too large
Load Diff
2116
html/shell/gap-buffer.mu.html
generated
2116
html/shell/gap-buffer.mu.html
generated
File diff suppressed because it is too large
Load Diff
1112
html/shell/global.mu.html
generated
1112
html/shell/global.mu.html
generated
File diff suppressed because it is too large
Load Diff
52
html/shell/grapheme-stack.mu.html
generated
52
html/shell/grapheme-stack.mu.html
generated
|
@ -16,6 +16,7 @@ a { color:inherit; }
|
|||
* { font-size:12pt; font-size: 1em; }
|
||||
.LineNr { }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muRegEdx { color: #878700; }
|
||||
.muRegEbx { color: #8787af; }
|
||||
.muRegEsi { color: #87d787; }
|
||||
.muRegEdi { color: #87ffd7; }
|
||||
|
@ -27,7 +28,6 @@ a { color:inherit; }
|
|||
.muComment { color: #005faf; }
|
||||
.muRegEax { color: #875f00; }
|
||||
.muRegEcx { color: #af875f; }
|
||||
.muRegEdx { color: #878700; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
@ -149,9 +149,9 @@ if ('onhashchange' in window) {
|
|||
<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"># 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#L940'>highlight-matching-open-paren?</a>: boolean, open-paren-depth: int, color: int, background-color: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int, _/<span class="muRegEcx">ecx</span>: int <span class="Delimiter">{</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#L943'>highlight-matching-open-paren?</a>: boolean, open-paren-depth: int, color: int, background-color: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int, _/<span class="muRegEcx">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L88" class="LineNr"> 88 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L89" class="LineNr"> 89 </span> <span class="PreProc">var</span> matching-open-paren-index/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> <a href='grapheme-stack.mu.html#L434'>get-matching-open-paren-index</a> self, <a href='gap-buffer.mu.html#L940'>highlight-matching-open-paren?</a>, open-paren-depth
|
||||
<span id="L89" class="LineNr"> 89 </span> <span class="PreProc">var</span> matching-open-paren-index/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> <a href='grapheme-stack.mu.html#L434'>get-matching-open-paren-index</a> self, <a href='gap-buffer.mu.html#L943'>highlight-matching-open-paren?</a>, open-paren-depth
|
||||
<span id="L90" class="LineNr"> 90 </span> <span class="PreProc">var</span> data-ah/<span class="muRegEdi">edi</span>: (addr handle array grapheme) <span class="Special"><-</span> get self, data
|
||||
<span id="L91" class="LineNr"> 91 </span> <span class="PreProc">var</span> _data/<span class="muRegEax">eax</span>: (addr array grapheme) <span class="Special"><-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *data-ah
|
||||
<span id="L92" class="LineNr"> 92 </span> <span class="PreProc">var</span> data/<span class="muRegEdi">edi</span>: (addr array grapheme) <span class="Special"><-</span> copy _data
|
||||
|
@ -183,15 +183,15 @@ if ('onhashchange' in window) {
|
|||
<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#L940'>highlight-matching-open-paren?</a>: boolean, open-paren-depth: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int <span class="Delimiter">{</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#L943'>highlight-matching-open-paren?</a>: boolean, open-paren-depth: int<span class="PreProc"> -> </span>_/<span class="muRegEax">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L122" class="LineNr">122 </span> <span class="PreProc">var</span> _width/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L123" class="LineNr">123 </span> <span class="PreProc">var</span> _height/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L124" class="LineNr">124 </span> _width, _height <span class="Special"><-</span> <a href='../500fake-screen.mu.html#L70'>screen-size</a> <a href='../500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L124" class="LineNr">124 </span> _width, _height <span class="Special"><-</span> <a href='../500fake-screen.mu.html#L86'>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="muRegEdx">edx</span>: int <span class="Special"><-</span> copy _width
|
||||
<span id="L126" class="LineNr">126 </span> <span class="PreProc">var</span> height/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> copy _height
|
||||
<span id="L127" class="LineNr">127 </span> <span class="PreProc">var</span> x2/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L128" class="LineNr">128 </span> <span class="PreProc">var</span> y2/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L129" class="LineNr">129 </span> x2, y2 <span class="Special"><-</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#L940'>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="L129" class="LineNr">129 </span> x2, y2 <span class="Special"><-</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#L943'>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>
|
||||
|
@ -218,7 +218,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L153" class="LineNr">153 </span> compare i, <span class="Constant">0</span>
|
||||
<span id="L154" class="LineNr">154 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L155" class="LineNr">155 </span> <span class="PreProc">var</span> g/<span class="muRegEsi">esi</span>: (addr grapheme) <span class="Special"><-</span> index data, i
|
||||
<span id="L156" class="LineNr">156 </span> x, y <span class="Special"><-</span> <a href='../501draw-text.mu.html#L148'>render-grapheme</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, *g, xmin, ymin, xmax, ymax, x, y, color, <span class="Constant">7</span>/bg=cursor
|
||||
<span id="L156" class="LineNr">156 </span> x, y <span class="Special"><-</span> <a href='../501draw-text.mu.html#L148'>render-grapheme</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, *g, xmin, ymin, xmax, ymax, x, y, background-color, color
|
||||
<span id="L157" class="LineNr">157 </span> i <span class="Special"><-</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>
|
||||
|
@ -249,7 +249,7 @@ if ('onhashchange' in window) {
|
|||
<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"> -> </span>_/<span class="muRegEax">eax</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L185" class="LineNr">185 </span> <span class="PreProc">var</span> _width/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L186" class="LineNr">186 </span> <span class="PreProc">var</span> _height/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L187" class="LineNr">187 </span> _width, _height <span class="Special"><-</span> <a href='../500fake-screen.mu.html#L70'>screen-size</a> <a href='../500fake-screen.mu.html#L14'>screen</a>
|
||||
<span id="L187" class="LineNr">187 </span> _width, _height <span class="Special"><-</span> <a href='../500fake-screen.mu.html#L86'>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="muRegEdx">edx</span>: int <span class="Special"><-</span> copy _width
|
||||
<span id="L189" class="LineNr">189 </span> <span class="PreProc">var</span> height/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> copy _height
|
||||
<span id="L190" class="LineNr">190 </span> <span class="PreProc">var</span> x2/<span class="muRegEax">eax</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
|
@ -272,22 +272,22 @@ if ('onhashchange' in window) {
|
|||
<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="muRegEsi">esi</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special"><-</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="L210" class="LineNr">210 </span> <a href='../500fake-screen.mu.html#L33'>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="muRegEax">eax</span>: int <span class="Special"><-</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">"abc "</span>, <span class="Constant">"F - <a href='grapheme-stack.mu.html#L196'>test-render-grapheme-stack</a> from bottom"</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">"F - <a href='grapheme-stack.mu.html#L196'>test-render-grapheme-stack</a> from bottom: result"</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">" "</span>, <span class="Constant">"F - <a href='grapheme-stack.mu.html#L196'>test-render-grapheme-stack</a> from bottom: bg"</span>
|
||||
<span id="L215" class="LineNr">215 </span> <a href='../504test-screen.mu.html#L257'>check-background-color-in-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">3</span>/bg=reverse, <span class="Constant">0</span>/y, <span class="Constant">" "</span>, <span class="Constant">"F - <a href='grapheme-stack.mu.html#L196'>test-render-grapheme-stack</a> from bottom: bg"</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="muRegEax">eax</span>: int <span class="Special"><-</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">"cba "</span>, <span class="Constant">"F - <a href='grapheme-stack.mu.html#L196'>test-render-grapheme-stack</a> from top without cursor"</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">"F - <a href='grapheme-stack.mu.html#L196'>test-render-grapheme-stack</a> from top without cursor: result"</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">" "</span>, <span class="Constant">"F - <a href='grapheme-stack.mu.html#L196'>test-render-grapheme-stack</a> from top without cursor: bg"</span>
|
||||
<span id="L220" class="LineNr">220 </span> <a href='../504test-screen.mu.html#L257'>check-background-color-in-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">3</span>/bg=reverse, <span class="Constant">1</span>/y, <span class="Constant">" "</span>, <span class="Constant">"F - <a href='grapheme-stack.mu.html#L196'>test-render-grapheme-stack</a> from top without cursor: bg"</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="muRegEax">eax</span>: int <span class="Special"><-</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">"cba "</span>, <span class="Constant">"F - <a href='grapheme-stack.mu.html#L196'>test-render-grapheme-stack</a> from top with cursor"</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">"F - <a href='grapheme-stack.mu.html#L196'>test-render-grapheme-stack</a> from top with cursor: result"</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">"| "</span>, <span class="Constant">"F - <a href='grapheme-stack.mu.html#L196'>test-render-grapheme-stack</a> from top with cursor: bg"</span>
|
||||
<span id="L225" class="LineNr">225 </span> <a href='../504test-screen.mu.html#L257'>check-background-color-in-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">3</span>/bg=reverse, <span class="Constant">2</span>/y, <span class="Constant">"| "</span>, <span class="Constant">"F - <a href='grapheme-stack.mu.html#L196'>test-render-grapheme-stack</a> from top with cursor: bg"</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>
|
||||
|
@ -304,12 +304,12 @@ if ('onhashchange' in window) {
|
|||
<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="muRegEsi">esi</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special"><-</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="L242" class="LineNr">242 </span> <a href='../500fake-screen.mu.html#L33'>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="muRegEax">eax</span>: int <span class="Special"><-</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">"(b) "</span>, <span class="Constant">"F - test-render-grapheme-stack-while-highlighting-matching-close-paren"</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">"| "</span>, <span class="Constant">"F - <a href='grapheme-stack.mu.html#L228'>test-render-grapheme-stack-while-highlighting-matching-close-paren</a>: cursor"</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">" ) "</span>, <span class="Constant">"F - <a href='grapheme-stack.mu.html#L228'>test-render-grapheme-stack-while-highlighting-matching-close-paren</a>: matching paren"</span>
|
||||
<span id="L246" class="LineNr">246 </span> <a href='../504test-screen.mu.html#L257'>check-background-color-in-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">3</span>/bg=reverse, <span class="Constant">2</span>/y, <span class="Constant">"| "</span>, <span class="Constant">"F - <a href='grapheme-stack.mu.html#L228'>test-render-grapheme-stack-while-highlighting-matching-close-paren</a>: cursor"</span>
|
||||
<span id="L247" class="LineNr">247 </span> <a href='../504test-screen.mu.html#L71'>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">" ) "</span>, <span class="Constant">"F - <a href='grapheme-stack.mu.html#L228'>test-render-grapheme-stack-while-highlighting-matching-close-paren</a>: matching paren"</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>
|
||||
|
@ -338,12 +338,12 @@ if ('onhashchange' in window) {
|
|||
<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="muRegEsi">esi</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special"><-</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="L276" class="LineNr">276 </span> <a href='../500fake-screen.mu.html#L33'>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="muRegEax">eax</span>: int <span class="Special"><-</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">"(a (b)) c "</span>, <span class="Constant">"F - test-render-grapheme-stack-while-highlighting-matching-close-paren-2"</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">"| "</span>, <span class="Constant">"F - <a href='grapheme-stack.mu.html#L250'>test-render-grapheme-stack-while-highlighting-matching-close-paren-2</a>: cursor"</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">" ) "</span>, <span class="Constant">"F - <a href='grapheme-stack.mu.html#L250'>test-render-grapheme-stack-while-highlighting-matching-close-paren-2</a>: matching paren"</span>
|
||||
<span id="L280" class="LineNr">280 </span> <a href='../504test-screen.mu.html#L257'>check-background-color-in-screen-row</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">3</span>/bg=reverse, <span class="Constant">2</span>/y, <span class="Constant">"| "</span>, <span class="Constant">"F - <a href='grapheme-stack.mu.html#L250'>test-render-grapheme-stack-while-highlighting-matching-close-paren-2</a>: cursor"</span>
|
||||
<span id="L281" class="LineNr">281 </span> <a href='../504test-screen.mu.html#L71'>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">" ) "</span>, <span class="Constant">"F - <a href='grapheme-stack.mu.html#L250'>test-render-grapheme-stack-while-highlighting-matching-close-paren-2</a>: matching paren"</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>
|
||||
|
@ -360,11 +360,11 @@ if ('onhashchange' in window) {
|
|||
<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="muRegEsi">esi</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special"><-</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="L298" class="LineNr">298 </span> <a href='../500fake-screen.mu.html#L33'>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="muRegEax">eax</span>: int <span class="Special"><-</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">"(b) "</span>, <span class="Constant">"F - test-render-grapheme-stack-while-highlighting-matching-open-paren-with-close-paren-at-end"</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">"( "</span>, <span class="Constant">"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"</span>
|
||||
<span id="L302" class="LineNr">302 </span> <a href='../504test-screen.mu.html#L71'>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">"( "</span>, <span class="Constant">"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"</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>
|
||||
|
@ -387,11 +387,11 @@ if ('onhashchange' in window) {
|
|||
<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="muRegEsi">esi</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special"><-</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="L325" class="LineNr">325 </span> <a href='../500fake-screen.mu.html#L33'>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="muRegEax">eax</span>: int <span class="Special"><-</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">"a((b)) "</span>, <span class="Constant">"F - test-render-grapheme-stack-while-highlighting-matching-open-paren-with-close-paren-at-end-2"</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">" ( "</span>, <span class="Constant">"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"</span>
|
||||
<span id="L329" class="LineNr">329 </span> <a href='../504test-screen.mu.html#L71'>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">" ( "</span>, <span class="Constant">"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"</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>
|
||||
|
@ -406,11 +406,11 @@ if ('onhashchange' in window) {
|
|||
<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="muRegEsi">esi</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special"><-</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="L344" class="LineNr">344 </span> <a href='../500fake-screen.mu.html#L33'>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="muRegEax">eax</span>: int <span class="Special"><-</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">"(b "</span>, <span class="Constant">"F - test-render-grapheme-stack-while-highlighting-matching-open-paren"</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">"( "</span>, <span class="Constant">"F - <a href='grapheme-stack.mu.html#L332'>test-render-grapheme-stack-while-highlighting-matching-open-paren</a>: matching paren"</span>
|
||||
<span id="L348" class="LineNr">348 </span> <a href='../504test-screen.mu.html#L71'>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">"( "</span>, <span class="Constant">"F - <a href='grapheme-stack.mu.html#L332'>test-render-grapheme-stack-while-highlighting-matching-open-paren</a>: matching paren"</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>
|
||||
|
@ -431,11 +431,11 @@ if ('onhashchange' in window) {
|
|||
<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="muRegEsi">esi</span>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Special"><-</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="L369" class="LineNr">369 </span> <a href='../500fake-screen.mu.html#L33'>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="muRegEax">eax</span>: int <span class="Special"><-</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">"a((b) "</span>, <span class="Constant">"F - test-render-grapheme-stack-while-highlighting-matching-open-paren-2"</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">" ( "</span>, <span class="Constant">"F - <a href='grapheme-stack.mu.html#L351'>test-render-grapheme-stack-while-highlighting-matching-open-paren-2</a>: matching paren"</span>
|
||||
<span id="L373" class="LineNr">373 </span> <a href='../504test-screen.mu.html#L71'>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">" ( "</span>, <span class="Constant">"F - <a href='grapheme-stack.mu.html#L351'>test-render-grapheme-stack-while-highlighting-matching-open-paren-2</a>: matching paren"</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>
|
||||
|
|
68
html/shell/macroexpand.mu.html
generated
68
html/shell/macroexpand.mu.html
generated
|
@ -16,7 +16,8 @@ a { color:inherit; }
|
|||
* { font-size:12pt; font-size: 1em; }
|
||||
.LineNr { }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.CommentedCode { color: #8a8a8a; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muRegEdx { color: #878700; }
|
||||
.muRegEbx { color: #8787af; }
|
||||
.muRegEsi { color: #87d787; }
|
||||
.muRegEdi { color: #87ffd7; }
|
||||
|
@ -24,12 +25,11 @@ a { color:inherit; }
|
|||
.Special { color: #ff6060; }
|
||||
.PreProc { color: #c000c0; }
|
||||
.Folded { color: #080808; background-color: #949494; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.CommentedCode { color: #8a8a8a; }
|
||||
.muTest { color: #5f8700; }
|
||||
.muComment { color: #005faf; }
|
||||
.muRegEax { color: #875f00; }
|
||||
.muRegEcx { color: #af875f; }
|
||||
.muRegEdx { color: #878700; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
@ -111,8 +111,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L86" class="LineNr"> 86 </span> <span class="PreProc">var</span> rest-ah/<span class="muRegEcx">ecx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special"><-</span> get expr, right
|
||||
<span id="L87" class="LineNr"> 87 </span> <span class="PreProc">var</span> first/<span class="muRegEax">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special"><-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *first-ah
|
||||
<span id="L88" class="LineNr"> 88 </span> <span class="Delimiter">{</span>
|
||||
<span id="L89" class="LineNr"> 89 </span> <span class="PreProc">var</span> <a href='evaluate.mu.html#L1382'>litfn?</a>/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='evaluate.mu.html#L1382'>litfn?</a> first
|
||||
<span id="L90" class="LineNr"> 90 </span> compare <a href='evaluate.mu.html#L1382'>litfn?</a>, <span class="Constant">0</span>/false
|
||||
<span id="L89" class="LineNr"> 89 </span> <span class="PreProc">var</span> <a href='evaluate.mu.html#L1381'>litfn?</a>/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='evaluate.mu.html#L1381'>litfn?</a> first
|
||||
<span id="L90" class="LineNr"> 90 </span> compare <a href='evaluate.mu.html#L1381'>litfn?</a>, <span class="Constant">0</span>/false
|
||||
<span id="L91" class="LineNr"> 91 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L92" class="LineNr"> 92 </span> <span class="muComment"># litfn is a literal</span>
|
||||
<span id="L93" class="LineNr"> 93 </span> <a href='trace.mu.html#L185'>trace-text</a> trace, <span class="Constant">"mac"</span>, <span class="Constant">"literal function"</span>
|
||||
|
@ -120,8 +120,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L95" class="LineNr"> 95 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
|
||||
<span id="L96" class="LineNr"> 96 </span> <span class="Delimiter">}</span>
|
||||
<span id="L97" class="LineNr"> 97 </span> <span class="Delimiter">{</span>
|
||||
<span id="L98" class="LineNr"> 98 </span> <span class="PreProc">var</span> <a href='evaluate.mu.html#L1396'>litmac?</a>/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='evaluate.mu.html#L1396'>litmac?</a> first
|
||||
<span id="L99" class="LineNr"> 99 </span> compare <a href='evaluate.mu.html#L1396'>litmac?</a>, <span class="Constant">0</span>/false
|
||||
<span id="L98" class="LineNr"> 98 </span> <span class="PreProc">var</span> <a href='evaluate.mu.html#L1395'>litmac?</a>/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='evaluate.mu.html#L1395'>litmac?</a> first
|
||||
<span id="L99" class="LineNr"> 99 </span> compare <a href='evaluate.mu.html#L1395'>litmac?</a>, <span class="Constant">0</span>/false
|
||||
<span id="L100" class="LineNr">100 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L101" class="LineNr">101 </span> <span class="muComment"># litmac is a literal</span>
|
||||
<span id="L102" class="LineNr">102 </span> <a href='trace.mu.html#L185'>trace-text</a> trace, <span class="Constant">"mac"</span>, <span class="Constant">"literal macro"</span>
|
||||
|
@ -131,8 +131,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L106" class="LineNr">106 </span> <span class="PreProc">var</span> result/<span class="muRegEdi">edi</span>: boolean <span class="Special"><-</span> copy <span class="Constant">0</span>/false
|
||||
<span id="L107" class="LineNr">107 </span> <span class="muComment"># for each builtin, expand only what will later be evaluated</span>
|
||||
<span id="L108" class="LineNr">108 </span> $macroexpand-iter:anonymous-function: <span class="Delimiter">{</span>
|
||||
<span id="L109" class="LineNr">109 </span> <span class="PreProc">var</span> <a href='evaluate.mu.html#L1368'>fn?</a>/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='evaluate.mu.html#L1368'>fn?</a> first
|
||||
<span id="L110" class="LineNr">110 </span> compare <a href='evaluate.mu.html#L1368'>fn?</a>, <span class="Constant">0</span>/false
|
||||
<span id="L109" class="LineNr">109 </span> <span class="PreProc">var</span> <a href='evaluate.mu.html#L1367'>fn?</a>/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='evaluate.mu.html#L1367'>fn?</a> first
|
||||
<span id="L110" class="LineNr">110 </span> compare <a href='evaluate.mu.html#L1367'>fn?</a>, <span class="Constant">0</span>/false
|
||||
<span id="L111" class="LineNr">111 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L112" class="LineNr">112 </span> <span class="muComment"># fn: expand every expression in the body</span>
|
||||
<span id="L113" class="LineNr">113 </span> <a href='trace.mu.html#L185'>trace-text</a> trace, <span class="Constant">"mac"</span>, <span class="Constant">"anonymous function"</span>
|
||||
|
@ -230,7 +230,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L247" class="LineNr">247 </span> <span class="Delimiter">{</span>
|
||||
<span id="L248" class="LineNr">248 </span> <span class="PreProc">var</span> definition-h: (handle <a href='cell.mu.html#L1'>cell</a>)
|
||||
<span id="L249" class="LineNr">249 </span> <span class="PreProc">var</span> definition-ah/<span class="muRegEdx">edx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special"><-</span> address definition-h
|
||||
<span id="L250" class="LineNr">250 </span> <a href='global.mu.html#L352'>maybe-lookup-symbol-in-globals</a> first, definition-ah, globals, trace
|
||||
<span id="L250" class="LineNr">250 </span> <a href='global.mu.html#L378'>maybe-lookup-symbol-in-globals</a> first, definition-ah, globals, trace
|
||||
<span id="L251" class="LineNr">251 </span> <span class="PreProc">var</span> definition/<span class="muRegEax">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special"><-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *definition-ah
|
||||
<span id="L252" class="LineNr">252 </span> compare definition, <span class="Constant">0</span>
|
||||
<span id="L253" class="LineNr">253 </span> <span class="PreProc">break-if-=</span>
|
||||
|
@ -244,7 +244,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L261" class="LineNr">261 </span> <span class="Delimiter">{</span>
|
||||
<span id="L262" class="LineNr">262 </span> <span class="PreProc">var</span> definition-car-ah/<span class="muRegEax">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special"><-</span> get definition, left
|
||||
<span id="L263" class="LineNr">263 </span> <span class="PreProc">var</span> definition-car/<span class="muRegEax">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special"><-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *definition-car-ah
|
||||
<span id="L264" class="LineNr">264 </span> <span class="PreProc">var</span> macro?/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='evaluate.mu.html#L1396'>litmac?</a> definition-car
|
||||
<span id="L264" class="LineNr">264 </span> <span class="PreProc">var</span> macro?/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='evaluate.mu.html#L1395'>litmac?</a> definition-car
|
||||
<span id="L265" class="LineNr">265 </span> compare macro?, <span class="Constant">0</span>/false
|
||||
<span id="L266" class="LineNr">266 </span> <span class="Delimiter">}</span>
|
||||
<span id="L267" class="LineNr">267 </span> <span class="PreProc">break-if-=</span>
|
||||
|
@ -252,7 +252,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L269" class="LineNr">269 </span> <span class="PreProc">var</span> macro-definition-ah/<span class="muRegEax">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special"><-</span> get definition, right
|
||||
<span id="L270" class="LineNr">270 </span> <span class="muComment"># TODO: check car(macro-definition) is litfn</span>
|
||||
<span id="L271" class="LineNr">271 </span><span class="CommentedCode">#? turn-on-debug-print</span>
|
||||
<span id="L272" class="LineNr">272 </span> <a href='evaluate.mu.html#L607'>apply</a> macro-definition-ah, rest-ah, expr-ah, globals, trace, <span class="Constant">0</span>/no-screen, <span class="Constant">0</span>/no-keyboard, <span class="Constant">0</span>/call-number
|
||||
<span id="L272" class="LineNr">272 </span> <a href='evaluate.mu.html#L607'>apply</a> macro-definition-ah, rest-ah, expr-ah, globals, trace, <span class="Constant">0</span>/no-screen, <span class="Constant">0</span>/no-keyboard, <span class="Constant">0</span>/definitions-created, <span class="Constant">0</span>/call-number
|
||||
<span id="L273" class="LineNr">273 </span> <a href='trace.mu.html#L250'>trace-higher</a> trace
|
||||
<span id="L274" class="Folded">274 </span><span class="Folded">+-- 15 lines: # trace "1=> " _expr-ah ---------------------------------------------------------------------------------------------------------------------------------------------------</span>
|
||||
<span id="L289" class="LineNr">289 </span> <span class="PreProc">return</span> <span class="Constant">1</span>/true
|
||||
|
@ -301,29 +301,29 @@ if ('onhashchange' in window) {
|
|||
<span id="L346" class="LineNr">346 </span> <span class="Delimiter">}</span>
|
||||
<span id="L347" class="LineNr">347 </span> <span class="PreProc">var</span> cdr-ah/<span class="muRegEcx">ecx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special"><-</span> get expr, right
|
||||
<span id="L348" class="LineNr">348 </span> <span class="PreProc">var</span> car-ah/<span class="muRegEbx">ebx</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special"><-</span> get expr, left
|
||||
<span id="L349" class="LineNr">349 </span> <span class="PreProc">var</span> <a href='evaluate.mu.html#L1142'>car</a>/<span class="muRegEax">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special"><-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *car-ah
|
||||
<span id="L349" class="LineNr">349 </span> <span class="PreProc">var</span> <a href='evaluate.mu.html#L1141'>car</a>/<span class="muRegEax">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special"><-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *car-ah
|
||||
<span id="L350" class="LineNr">350 </span> <span class="muComment"># if car is unquote or unquote-splice, check if cadr is unquote or</span>
|
||||
<span id="L351" class="LineNr">351 </span> <span class="muComment"># unquote-splice.</span>
|
||||
<span id="L352" class="LineNr">352 </span> $look-for-double-unquote:<a href='../502test.mu.html#L19'>check</a>: <span class="Delimiter">{</span>
|
||||
<span id="L353" class="LineNr">353 </span> <span class="muComment"># if car is not an unquote, break</span>
|
||||
<span id="L354" class="LineNr">354 </span> <span class="Delimiter">{</span>
|
||||
<span id="L355" class="LineNr">355 </span> <span class="Delimiter">{</span>
|
||||
<span id="L356" class="LineNr">356 </span> <span class="PreProc">var</span> unquote?/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='cell.mu.html#L44'>symbol-equal?</a> <a href='evaluate.mu.html#L1142'>car</a>, <span class="Constant">","</span>
|
||||
<span id="L356" class="LineNr">356 </span> <span class="PreProc">var</span> unquote?/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='cell.mu.html#L44'>symbol-equal?</a> <a href='evaluate.mu.html#L1141'>car</a>, <span class="Constant">","</span>
|
||||
<span id="L357" class="LineNr">357 </span> compare unquote?, <span class="Constant">0</span>/false
|
||||
<span id="L358" class="LineNr">358 </span> <span class="Delimiter">}</span>
|
||||
<span id="L359" class="LineNr">359 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L360" class="LineNr">360 </span> <span class="PreProc">var</span> unquote-splice?/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='cell.mu.html#L44'>symbol-equal?</a> <a href='evaluate.mu.html#L1142'>car</a>, <span class="Constant">",@"</span>
|
||||
<span id="L360" class="LineNr">360 </span> <span class="PreProc">var</span> unquote-splice?/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='cell.mu.html#L44'>symbol-equal?</a> <a href='evaluate.mu.html#L1141'>car</a>, <span class="Constant">",@"</span>
|
||||
<span id="L361" class="LineNr">361 </span> compare unquote-splice?, <span class="Constant">0</span>/false
|
||||
<span id="L362" class="LineNr">362 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L363" class="LineNr">363 </span> <span class="PreProc">break</span> $look-for-double-unquote:<a href='../502test.mu.html#L19'>check</a>
|
||||
<span id="L364" class="LineNr">364 </span> <span class="Delimiter">}</span>
|
||||
<span id="L365" class="LineNr">365 </span> <span class="muComment"># if cdr is not a pair, break</span>
|
||||
<span id="L366" class="LineNr">366 </span> <span class="PreProc">var</span> <a href='evaluate.mu.html#L1170'>cdr</a>/<span class="muRegEax">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special"><-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *cdr-ah
|
||||
<span id="L367" class="LineNr">367 </span> <span class="PreProc">var</span> cdr-type/<span class="muRegEcx">ecx</span>: (addr int) <span class="Special"><-</span> get <a href='evaluate.mu.html#L1170'>cdr</a>, <span class="PreProc">type</span>
|
||||
<span id="L366" class="LineNr">366 </span> <span class="PreProc">var</span> <a href='evaluate.mu.html#L1169'>cdr</a>/<span class="muRegEax">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special"><-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *cdr-ah
|
||||
<span id="L367" class="LineNr">367 </span> <span class="PreProc">var</span> cdr-type/<span class="muRegEcx">ecx</span>: (addr int) <span class="Special"><-</span> get <a href='evaluate.mu.html#L1169'>cdr</a>, <span class="PreProc">type</span>
|
||||
<span id="L368" class="LineNr">368 </span> compare *cdr-type, <span class="Constant">0</span>/pair
|
||||
<span id="L369" class="LineNr">369 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L370" class="LineNr">370 </span> <span class="muComment"># if cadr is not an unquote, break</span>
|
||||
<span id="L371" class="LineNr">371 </span> <span class="PreProc">var</span> cadr-ah/<span class="muRegEax">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special"><-</span> get <a href='evaluate.mu.html#L1170'>cdr</a>, left
|
||||
<span id="L371" class="LineNr">371 </span> <span class="PreProc">var</span> cadr-ah/<span class="muRegEax">eax</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special"><-</span> get <a href='evaluate.mu.html#L1169'>cdr</a>, left
|
||||
<span id="L372" class="LineNr">372 </span> <span class="PreProc">var</span> cadr/<span class="muRegEax">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special"><-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *cadr-ah
|
||||
<span id="L373" class="LineNr">373 </span> <span class="Delimiter">{</span>
|
||||
<span id="L374" class="LineNr">374 </span> <span class="Delimiter">{</span>
|
||||
|
@ -352,12 +352,12 @@ if ('onhashchange' in window) {
|
|||
<span id="L397" class="LineNr">397 </span><span class="PreProc">fn</span> <span class="muTest"><a href='macroexpand.mu.html#L397'>test-macroexpand</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L398" class="LineNr">398 </span> <span class="PreProc">var</span> globals-storage: <a href='global.mu.html#L1'>global-table</a>
|
||||
<span id="L399" class="LineNr">399 </span> <span class="PreProc">var</span> globals/<span class="muRegEdx">edx</span>: (addr <a href='global.mu.html#L1'>global-table</a>) <span class="Special"><-</span> address globals-storage
|
||||
<span id="L400" class="LineNr">400 </span> <a href='global.mu.html#L13'>initialize-globals</a> globals
|
||||
<span id="L400" class="LineNr">400 </span> <a href='global.mu.html#L14'>initialize-globals</a> globals
|
||||
<span id="L401" class="LineNr">401 </span> <span class="muComment"># new macro: m</span>
|
||||
<span id="L402" class="LineNr">402 </span> <span class="PreProc">var</span> sandbox-storage: <a href='sandbox.mu.html#L1'>sandbox</a>
|
||||
<span id="L403" class="LineNr">403 </span> <span class="PreProc">var</span> <a href='sandbox.mu.html#L1'>sandbox</a>/<span class="muRegEsi">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special"><-</span> address sandbox-storage
|
||||
<span id="L404" class="LineNr">404 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">"(define m (litmac litfn () (a b) `(+ ,a ,b)))"</span>
|
||||
<span id="L405" class="LineNr">405 </span> <a href='sandbox.mu.html#L473'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0x13</span>/ctrl-s, globals, <span class="Constant">0</span>/no-disk, <span class="Constant">0</span>/no-tweak-screen
|
||||
<span id="L405" class="LineNr">405 </span> <a href='sandbox.mu.html#L453'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0x13</span>/ctrl-s, globals, <span class="Constant">0</span>/no-disk
|
||||
<span id="L406" class="LineNr">406 </span> <span class="muComment"># invoke macro</span>
|
||||
<span id="L407" class="LineNr">407 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">"(m 3 4)"</span>
|
||||
<span id="L408" class="LineNr">408 </span> <span class="PreProc">var</span> gap-ah/<span class="muRegEcx">ecx</span>: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special"><-</span> get <a href='sandbox.mu.html#L1'>sandbox</a>, data
|
||||
|
@ -384,19 +384,19 @@ if ('onhashchange' in window) {
|
|||
<span id="L429" class="LineNr">429 </span><span class="CommentedCode">#? dump-cell-from-cursor-over-full-screen expected-ah</span>
|
||||
<span id="L430" class="LineNr">430 </span> <span class="PreProc">var</span> expected/<span class="muRegEax">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special"><-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *expected-ah
|
||||
<span id="L431" class="LineNr">431 </span> <span class="muComment">#</span>
|
||||
<span id="L432" class="LineNr">432 </span> <span class="PreProc">var</span> assertion/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='evaluate.mu.html#L1198'>cell-isomorphic?</a> result, expected, trace
|
||||
<span id="L432" class="LineNr">432 </span> <span class="PreProc">var</span> assertion/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='evaluate.mu.html#L1197'>cell-isomorphic?</a> result, expected, trace
|
||||
<span id="L433" class="LineNr">433 </span> <a href='../502test.mu.html#L19'>check</a> assertion, <span class="Constant">"F - test-macroexpand"</span>
|
||||
<span id="L434" class="LineNr">434 </span><span class="Delimiter">}</span>
|
||||
<span id="L435" class="LineNr">435 </span>
|
||||
<span id="L436" class="LineNr">436 </span><span class="PreProc">fn</span> <span class="muTest"><a href='macroexpand.mu.html#L436'>test-macroexpand-inside-anonymous-fn</a></span> <span class="muFunction">{</span>
|
||||
<span id="L437" class="LineNr">437 </span> <span class="PreProc">var</span> globals-storage: <a href='global.mu.html#L1'>global-table</a>
|
||||
<span id="L438" class="LineNr">438 </span> <span class="PreProc">var</span> globals/<span class="muRegEdx">edx</span>: (addr <a href='global.mu.html#L1'>global-table</a>) <span class="Special"><-</span> address globals-storage
|
||||
<span id="L439" class="LineNr">439 </span> <a href='global.mu.html#L13'>initialize-globals</a> globals
|
||||
<span id="L439" class="LineNr">439 </span> <a href='global.mu.html#L14'>initialize-globals</a> globals
|
||||
<span id="L440" class="LineNr">440 </span> <span class="muComment"># new macro: m</span>
|
||||
<span id="L441" class="LineNr">441 </span> <span class="PreProc">var</span> sandbox-storage: <a href='sandbox.mu.html#L1'>sandbox</a>
|
||||
<span id="L442" class="LineNr">442 </span> <span class="PreProc">var</span> <a href='sandbox.mu.html#L1'>sandbox</a>/<span class="muRegEsi">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special"><-</span> address sandbox-storage
|
||||
<span id="L443" class="LineNr">443 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">"(define m (litmac litfn () (a b) `(+ ,a ,b)))"</span>
|
||||
<span id="L444" class="LineNr">444 </span> <a href='sandbox.mu.html#L473'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0x13</span>/ctrl-s, globals, <span class="Constant">0</span>/no-disk, <span class="Constant">0</span>/no-tweak-screen
|
||||
<span id="L444" class="LineNr">444 </span> <a href='sandbox.mu.html#L453'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0x13</span>/ctrl-s, globals, <span class="Constant">0</span>/no-disk
|
||||
<span id="L445" class="LineNr">445 </span> <span class="muComment"># invoke macro</span>
|
||||
<span id="L446" class="LineNr">446 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">"(fn() (m 3 4))"</span>
|
||||
<span id="L447" class="LineNr">447 </span> <span class="PreProc">var</span> gap-ah/<span class="muRegEcx">ecx</span>: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special"><-</span> get <a href='sandbox.mu.html#L1'>sandbox</a>, data
|
||||
|
@ -422,19 +422,19 @@ if ('onhashchange' in window) {
|
|||
<span id="L467" class="LineNr">467 </span> <a href='read.mu.html#L1'>read-cell</a> expected-gap, expected-ah, trace
|
||||
<span id="L468" class="LineNr">468 </span> <span class="PreProc">var</span> expected/<span class="muRegEax">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special"><-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *expected-ah
|
||||
<span id="L469" class="LineNr">469 </span> <span class="muComment">#</span>
|
||||
<span id="L470" class="LineNr">470 </span> <span class="PreProc">var</span> assertion/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='evaluate.mu.html#L1198'>cell-isomorphic?</a> result, expected, trace
|
||||
<span id="L470" class="LineNr">470 </span> <span class="PreProc">var</span> assertion/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='evaluate.mu.html#L1197'>cell-isomorphic?</a> result, expected, trace
|
||||
<span id="L471" class="LineNr">471 </span> <a href='../502test.mu.html#L19'>check</a> assertion, <span class="Constant">"F - test-macroexpand-inside-anonymous-fn"</span>
|
||||
<span id="L472" class="LineNr">472 </span><span class="Delimiter">}</span>
|
||||
<span id="L473" class="LineNr">473 </span>
|
||||
<span id="L474" class="LineNr">474 </span><span class="PreProc">fn</span> <span class="muTest"><a href='macroexpand.mu.html#L474'>test-macroexpand-inside-fn-call</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L475" class="LineNr">475 </span> <span class="PreProc">var</span> globals-storage: <a href='global.mu.html#L1'>global-table</a>
|
||||
<span id="L476" class="LineNr">476 </span> <span class="PreProc">var</span> globals/<span class="muRegEdx">edx</span>: (addr <a href='global.mu.html#L1'>global-table</a>) <span class="Special"><-</span> address globals-storage
|
||||
<span id="L477" class="LineNr">477 </span> <a href='global.mu.html#L13'>initialize-globals</a> globals
|
||||
<span id="L477" class="LineNr">477 </span> <a href='global.mu.html#L14'>initialize-globals</a> globals
|
||||
<span id="L478" class="LineNr">478 </span> <span class="muComment"># new macro: m</span>
|
||||
<span id="L479" class="LineNr">479 </span> <span class="PreProc">var</span> sandbox-storage: <a href='sandbox.mu.html#L1'>sandbox</a>
|
||||
<span id="L480" class="LineNr">480 </span> <span class="PreProc">var</span> <a href='sandbox.mu.html#L1'>sandbox</a>/<span class="muRegEsi">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special"><-</span> address sandbox-storage
|
||||
<span id="L481" class="LineNr">481 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">"(define m (litmac litfn () (a b) `(+ ,a ,b)))"</span>
|
||||
<span id="L482" class="LineNr">482 </span> <a href='sandbox.mu.html#L473'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0x13</span>/ctrl-s, globals, <span class="Constant">0</span>/no-disk, <span class="Constant">0</span>/no-tweak-screen
|
||||
<span id="L482" class="LineNr">482 </span> <a href='sandbox.mu.html#L453'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0x13</span>/ctrl-s, globals, <span class="Constant">0</span>/no-disk
|
||||
<span id="L483" class="LineNr">483 </span> <span class="muComment"># invoke macro</span>
|
||||
<span id="L484" class="LineNr">484 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">"((fn() (m 3 4)))"</span>
|
||||
<span id="L485" class="LineNr">485 </span> <span class="PreProc">var</span> gap-ah/<span class="muRegEcx">ecx</span>: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special"><-</span> get <a href='sandbox.mu.html#L1'>sandbox</a>, data
|
||||
|
@ -461,14 +461,14 @@ if ('onhashchange' in window) {
|
|||
<span id="L506" class="LineNr">506 </span><span class="CommentedCode">#? dump-cell-from-cursor-over-full-screen expected-ah</span>
|
||||
<span id="L507" class="LineNr">507 </span> <span class="PreProc">var</span> expected/<span class="muRegEax">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special"><-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *expected-ah
|
||||
<span id="L508" class="LineNr">508 </span> <span class="muComment">#</span>
|
||||
<span id="L509" class="LineNr">509 </span> <span class="PreProc">var</span> assertion/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='evaluate.mu.html#L1198'>cell-isomorphic?</a> result, expected, trace
|
||||
<span id="L509" class="LineNr">509 </span> <span class="PreProc">var</span> assertion/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='evaluate.mu.html#L1197'>cell-isomorphic?</a> result, expected, trace
|
||||
<span id="L510" class="LineNr">510 </span> <a href='../502test.mu.html#L19'>check</a> assertion, <span class="Constant">"F - test-macroexpand-inside-fn-call"</span>
|
||||
<span id="L511" class="LineNr">511 </span><span class="Delimiter">}</span>
|
||||
<span id="L512" class="LineNr">512 </span>
|
||||
<span id="L513" class="LineNr">513 </span><span class="PreProc">fn</span> <span class="muTest"><a href='macroexpand.mu.html#L513'>test-macroexpand-repeatedly-with-backquoted-arg</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L514" class="LineNr">514 </span> <span class="PreProc">var</span> globals-storage: <a href='global.mu.html#L1'>global-table</a>
|
||||
<span id="L515" class="LineNr">515 </span> <span class="PreProc">var</span> globals/<span class="muRegEdx">edx</span>: (addr <a href='global.mu.html#L1'>global-table</a>) <span class="Special"><-</span> address globals-storage
|
||||
<span id="L516" class="LineNr">516 </span> <a href='global.mu.html#L13'>initialize-globals</a> globals
|
||||
<span id="L516" class="LineNr">516 </span> <a href='global.mu.html#L14'>initialize-globals</a> globals
|
||||
<span id="L517" class="LineNr">517 </span> <span class="muComment"># macroexpand an expression with a backquote but no macro</span>
|
||||
<span id="L518" class="LineNr">518 </span> <span class="PreProc">var</span> sandbox-storage: <a href='sandbox.mu.html#L1'>sandbox</a>
|
||||
<span id="L519" class="LineNr">519 </span> <span class="PreProc">var</span> <a href='sandbox.mu.html#L1'>sandbox</a>/<span class="muRegEsi">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special"><-</span> address sandbox-storage
|
||||
|
@ -498,12 +498,12 @@ if ('onhashchange' in window) {
|
|||
<span id="L543" class="LineNr">543 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='macroexpand.mu.html#L543'>pending-test-macroexpand-inside-backquote-unquote</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L544" class="LineNr">544 </span> <span class="PreProc">var</span> globals-storage: <a href='global.mu.html#L1'>global-table</a>
|
||||
<span id="L545" class="LineNr">545 </span> <span class="PreProc">var</span> globals/<span class="muRegEdx">edx</span>: (addr <a href='global.mu.html#L1'>global-table</a>) <span class="Special"><-</span> address globals-storage
|
||||
<span id="L546" class="LineNr">546 </span> <a href='global.mu.html#L13'>initialize-globals</a> globals
|
||||
<span id="L546" class="LineNr">546 </span> <a href='global.mu.html#L14'>initialize-globals</a> globals
|
||||
<span id="L547" class="LineNr">547 </span> <span class="muComment"># new macro: m</span>
|
||||
<span id="L548" class="LineNr">548 </span> <span class="PreProc">var</span> sandbox-storage: <a href='sandbox.mu.html#L1'>sandbox</a>
|
||||
<span id="L549" class="LineNr">549 </span> <span class="PreProc">var</span> <a href='sandbox.mu.html#L1'>sandbox</a>/<span class="muRegEsi">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special"><-</span> address sandbox-storage
|
||||
<span id="L550" class="LineNr">550 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">"(define m (litmac litfn () (a b) `(+ ,a ,b)))"</span>
|
||||
<span id="L551" class="LineNr">551 </span> <a href='sandbox.mu.html#L473'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0x13</span>/ctrl-s, globals, <span class="Constant">0</span>/no-disk, <span class="Constant">0</span>/no-tweak-screen
|
||||
<span id="L551" class="LineNr">551 </span> <a href='sandbox.mu.html#L453'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0x13</span>/ctrl-s, globals, <span class="Constant">0</span>/no-disk
|
||||
<span id="L552" class="LineNr">552 </span> <span class="muComment"># invoke macro</span>
|
||||
<span id="L553" class="LineNr">553 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">"`(print [result is ] ,(m 3 4)))"</span>
|
||||
<span id="L554" class="LineNr">554 </span> <span class="PreProc">var</span> gap-ah/<span class="muRegEcx">ecx</span>: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special"><-</span> get <a href='sandbox.mu.html#L1'>sandbox</a>, data
|
||||
|
@ -529,19 +529,19 @@ if ('onhashchange' in window) {
|
|||
<span id="L574" class="LineNr">574 </span> <a href='read.mu.html#L1'>read-cell</a> expected-gap, expected-ah, trace
|
||||
<span id="L575" class="LineNr">575 </span> <span class="PreProc">var</span> expected/<span class="muRegEax">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special"><-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *expected-ah
|
||||
<span id="L576" class="LineNr">576 </span> <span class="muComment">#</span>
|
||||
<span id="L577" class="LineNr">577 </span> <span class="PreProc">var</span> assertion/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='evaluate.mu.html#L1198'>cell-isomorphic?</a> result, expected, trace
|
||||
<span id="L577" class="LineNr">577 </span> <span class="PreProc">var</span> assertion/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='evaluate.mu.html#L1197'>cell-isomorphic?</a> result, expected, trace
|
||||
<span id="L578" class="LineNr">578 </span> <a href='../502test.mu.html#L19'>check</a> assertion, <span class="Constant">"F - test-macroexpand-inside-backquote-unquote"</span>
|
||||
<span id="L579" class="LineNr">579 </span><span class="Delimiter">}</span>
|
||||
<span id="L580" class="LineNr">580 </span>
|
||||
<span id="L581" class="LineNr">581 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='macroexpand.mu.html#L581'>pending-test-macroexpand-inside-nested-backquote-unquote</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L582" class="LineNr">582 </span> <span class="PreProc">var</span> globals-storage: <a href='global.mu.html#L1'>global-table</a>
|
||||
<span id="L583" class="LineNr">583 </span> <span class="PreProc">var</span> globals/<span class="muRegEdx">edx</span>: (addr <a href='global.mu.html#L1'>global-table</a>) <span class="Special"><-</span> address globals-storage
|
||||
<span id="L584" class="LineNr">584 </span> <a href='global.mu.html#L13'>initialize-globals</a> globals
|
||||
<span id="L584" class="LineNr">584 </span> <a href='global.mu.html#L14'>initialize-globals</a> globals
|
||||
<span id="L585" class="LineNr">585 </span> <span class="muComment"># new macro: m</span>
|
||||
<span id="L586" class="LineNr">586 </span> <span class="PreProc">var</span> sandbox-storage: <a href='sandbox.mu.html#L1'>sandbox</a>
|
||||
<span id="L587" class="LineNr">587 </span> <span class="PreProc">var</span> <a href='sandbox.mu.html#L1'>sandbox</a>/<span class="muRegEsi">esi</span>: (addr <a href='sandbox.mu.html#L1'>sandbox</a>) <span class="Special"><-</span> address sandbox-storage
|
||||
<span id="L588" class="LineNr">588 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">"(define m (litmac litfn () (a b) `(+ ,a ,b)))"</span>
|
||||
<span id="L589" class="LineNr">589 </span> <a href='sandbox.mu.html#L473'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0x13</span>/ctrl-s, globals, <span class="Constant">0</span>/no-disk, <span class="Constant">0</span>/no-tweak-screen
|
||||
<span id="L589" class="LineNr">589 </span> <a href='sandbox.mu.html#L453'>edit-sandbox</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">0x13</span>/ctrl-s, globals, <span class="Constant">0</span>/no-disk
|
||||
<span id="L590" class="LineNr">590 </span> <span class="muComment"># invoke macro</span>
|
||||
<span id="L591" class="LineNr">591 </span> <a href='sandbox.mu.html#L41'>initialize-sandbox-with</a> <a href='sandbox.mu.html#L1'>sandbox</a>, <span class="Constant">"`(a ,(m 3 4) `(b ,(m 3 4) ,,(m 3 4)))"</span>
|
||||
<span id="L592" class="LineNr">592 </span> <span class="PreProc">var</span> gap-ah/<span class="muRegEcx">ecx</span>: (addr handle <a href='gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special"><-</span> get <a href='sandbox.mu.html#L1'>sandbox</a>, data
|
||||
|
@ -568,7 +568,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L613" class="LineNr">613 </span> <a href='print.mu.html#L136'>dump-cell-from-cursor-over-full-screen</a> expected-ah
|
||||
<span id="L614" class="LineNr">614 </span> <span class="PreProc">var</span> expected/<span class="muRegEax">eax</span>: (addr <a href='cell.mu.html#L1'>cell</a>) <span class="Special"><-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *expected-ah
|
||||
<span id="L615" class="LineNr">615 </span> <span class="muComment">#</span>
|
||||
<span id="L616" class="LineNr">616 </span> <span class="PreProc">var</span> assertion/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='evaluate.mu.html#L1198'>cell-isomorphic?</a> result, expected, trace
|
||||
<span id="L616" class="LineNr">616 </span> <span class="PreProc">var</span> assertion/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='evaluate.mu.html#L1197'>cell-isomorphic?</a> result, expected, trace
|
||||
<span id="L617" class="LineNr">617 </span> <a href='../502test.mu.html#L19'>check</a> assertion, <span class="Constant">"F - test-macroexpand-inside-nested-backquote-unquote"</span>
|
||||
<span id="L618" class="LineNr">618 </span><span class="Delimiter">}</span>
|
||||
<span id="L619" class="LineNr">619 </span>
|
||||
|
|
14
html/shell/main.mu.html
generated
14
html/shell/main.mu.html
generated
|
@ -59,22 +59,22 @@ if ('onhashchange' in window) {
|
|||
<a href='https://github.com/akkartik/mu/blob/main/shell/main.mu'>https://github.com/akkartik/mu/blob/main/shell/main.mu</a>
|
||||
<pre id='vimCodeElement'>
|
||||
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># Experimental Mu shell</span>
|
||||
<span id="L2" class="LineNr"> 2 </span><span class="muComment"># A Lisp with indent-sensitivity and infix.</span>
|
||||
<span id="L2" class="LineNr"> 2 </span><span class="muComment"># Currently based on Lisp.</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> env-storage: <a href='environment.mu.html#L1'>environment</a>
|
||||
<span id="L6" class="LineNr"> 6 </span> <span class="PreProc">var</span> env/<span class="muRegEsi">esi</span>: (addr <a href='environment.mu.html#L1'>environment</a>) <span class="Special"><-</span> address env-storage
|
||||
<span id="L7" class="LineNr"> 7 </span> <a href='environment.mu.html#L9'>initialize-environment</a> env
|
||||
<span id="L8" class="LineNr"> 8 </span> <a href='environment.mu.html#L329'>load-state</a> env, data-disk
|
||||
<span id="L5" class="LineNr"> 5 </span> <span class="PreProc">var</span> env-storage: <a href='environment.mu.html#L8'>environment</a>
|
||||
<span id="L6" class="LineNr"> 6 </span> <span class="PreProc">var</span> env/<span class="muRegEsi">esi</span>: (addr <a href='environment.mu.html#L8'>environment</a>) <span class="Special"><-</span> address env-storage
|
||||
<span id="L7" class="LineNr"> 7 </span> <a href='environment.mu.html#L103'>initialize-environment</a> env, <span class="Constant">0x20</span>/fake-screen-width, <span class="Constant">8</span>/fake-screen-height
|
||||
<span id="L8" class="LineNr"> 8 </span> <a href='environment.mu.html#L935'>load-state</a> env, data-disk
|
||||
<span id="L9" class="LineNr"> 9 </span> $main:<span class="PreProc">loop</span>: <span class="Delimiter">{</span>
|
||||
<span id="L10" class="LineNr">10 </span> <a href='environment.mu.html#L21'>render-environment</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, env
|
||||
<span id="L10" class="LineNr">10 </span> <a href='environment.mu.html#L115'>render-environment</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, env
|
||||
<span id="L11" class="LineNr">11 </span> <span class="muComment"># no way to quit right now; just reboot</span>
|
||||
<span id="L12" class="LineNr">12 </span> <span class="Delimiter">{</span>
|
||||
<span id="L13" class="LineNr">13 </span> <span class="PreProc">var</span> key/<span class="muRegEax">eax</span>: byte <span class="Special"><-</span> <a href='../102keyboard.subx.html#L21'>read-key</a> keyboard
|
||||
<span id="L14" class="LineNr">14 </span> compare key, <span class="Constant">0</span>
|
||||
<span id="L15" class="LineNr">15 </span> <span class="PreProc">loop-if-=</span>
|
||||
<span id="L16" class="LineNr">16 </span> <span class="PreProc">var</span> key/<span class="muRegEax">eax</span>: grapheme <span class="Special"><-</span> copy key
|
||||
<span id="L17" class="LineNr">17 </span> <a href='environment.mu.html#L54'>edit-environment</a> env, key, data-disk
|
||||
<span id="L17" class="LineNr">17 </span> <a href='environment.mu.html#L148'>edit-environment</a> env, key, data-disk
|
||||
<span id="L18" class="LineNr">18 </span> <span class="Delimiter">}</span>
|
||||
<span id="L19" class="LineNr">19 </span> <span class="PreProc">loop</span>
|
||||
<span id="L20" class="LineNr">20 </span> <span class="Delimiter">}</span>
|
||||
|
|
42
html/shell/parse.mu.html
generated
42
html/shell/parse.mu.html
generated
|
@ -15,16 +15,16 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.PreProc { color: #c000c0; }
|
||||
.muRegEdx { color: #878700; }
|
||||
.muRegEcx { color: #af875f; }
|
||||
.LineNr { }
|
||||
.muRegEdi { color: #87ffd7; }
|
||||
.muRegEsi { color: #87d787; }
|
||||
.muComment { color: #005faf; }
|
||||
.Constant { color: #008787; }
|
||||
.muRegEdx { color: #878700; }
|
||||
.muRegEax { color: #875f00; }
|
||||
.muRegEcx { color: #af875f; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muRegEsi { color: #87d787; }
|
||||
.Special { color: #ff6060; }
|
||||
-->
|
||||
</style>
|
||||
|
@ -106,8 +106,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L43" class="LineNr"> 43 </span> <a href='../309stream.subx.html#L104'>read-from-stream</a> tokens, curr-token
|
||||
<span id="L44" class="LineNr"> 44 </span> $parse-sexpression:type-check: <span class="Delimiter">{</span>
|
||||
<span id="L45" class="LineNr"> 45 </span> <span class="muComment"># single quote -> parse as list with a special car</span>
|
||||
<span id="L46" class="LineNr"> 46 </span> <span class="PreProc">var</span> <a href='tokenize.mu.html#L868'>quote-token?</a>/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='tokenize.mu.html#L868'>quote-token?</a> curr-token
|
||||
<span id="L47" class="LineNr"> 47 </span> compare <a href='tokenize.mu.html#L868'>quote-token?</a>, <span class="Constant">0</span>/false
|
||||
<span id="L46" class="LineNr"> 46 </span> <span class="PreProc">var</span> <a href='tokenize.mu.html#L1011'>quote-token?</a>/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='tokenize.mu.html#L1011'>quote-token?</a> curr-token
|
||||
<span id="L47" class="LineNr"> 47 </span> compare <a href='tokenize.mu.html#L1011'>quote-token?</a>, <span class="Constant">0</span>/false
|
||||
<span id="L48" class="LineNr"> 48 </span> <span class="Delimiter">{</span>
|
||||
<span id="L49" class="LineNr"> 49 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L50" class="LineNr"> 50 </span> <span class="PreProc">var</span> out/<span class="muRegEdi">edi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special"><-</span> copy _out
|
||||
|
@ -123,8 +123,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L60" class="LineNr"> 60 </span> <span class="PreProc">return</span> close-paren?, dot?
|
||||
<span id="L61" class="LineNr"> 61 </span> <span class="Delimiter">}</span>
|
||||
<span id="L62" class="LineNr"> 62 </span> <span class="muComment"># backquote quote -> parse as list with a special car</span>
|
||||
<span id="L63" class="LineNr"> 63 </span> <span class="PreProc">var</span> <a href='tokenize.mu.html#L877'>backquote-token?</a>/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='tokenize.mu.html#L877'>backquote-token?</a> curr-token
|
||||
<span id="L64" class="LineNr"> 64 </span> compare <a href='tokenize.mu.html#L877'>backquote-token?</a>, <span class="Constant">0</span>/false
|
||||
<span id="L63" class="LineNr"> 63 </span> <span class="PreProc">var</span> <a href='tokenize.mu.html#L1020'>backquote-token?</a>/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='tokenize.mu.html#L1020'>backquote-token?</a> curr-token
|
||||
<span id="L64" class="LineNr"> 64 </span> compare <a href='tokenize.mu.html#L1020'>backquote-token?</a>, <span class="Constant">0</span>/false
|
||||
<span id="L65" class="LineNr"> 65 </span> <span class="Delimiter">{</span>
|
||||
<span id="L66" class="LineNr"> 66 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L67" class="LineNr"> 67 </span> <span class="PreProc">var</span> out/<span class="muRegEdi">edi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special"><-</span> copy _out
|
||||
|
@ -140,8 +140,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L77" class="LineNr"> 77 </span> <span class="PreProc">return</span> close-paren?, dot?
|
||||
<span id="L78" class="LineNr"> 78 </span> <span class="Delimiter">}</span>
|
||||
<span id="L79" class="LineNr"> 79 </span> <span class="muComment"># unquote -> parse as list with a special car</span>
|
||||
<span id="L80" class="LineNr"> 80 </span> <span class="PreProc">var</span> <a href='tokenize.mu.html#L886'>unquote-token?</a>/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='tokenize.mu.html#L886'>unquote-token?</a> curr-token
|
||||
<span id="L81" class="LineNr"> 81 </span> compare <a href='tokenize.mu.html#L886'>unquote-token?</a>, <span class="Constant">0</span>/false
|
||||
<span id="L80" class="LineNr"> 80 </span> <span class="PreProc">var</span> <a href='tokenize.mu.html#L1029'>unquote-token?</a>/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='tokenize.mu.html#L1029'>unquote-token?</a> curr-token
|
||||
<span id="L81" class="LineNr"> 81 </span> compare <a href='tokenize.mu.html#L1029'>unquote-token?</a>, <span class="Constant">0</span>/false
|
||||
<span id="L82" class="LineNr"> 82 </span> <span class="Delimiter">{</span>
|
||||
<span id="L83" class="LineNr"> 83 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L84" class="LineNr"> 84 </span> <span class="PreProc">var</span> out/<span class="muRegEdi">edi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special"><-</span> copy _out
|
||||
|
@ -157,8 +157,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L94" class="LineNr"> 94 </span> <span class="PreProc">return</span> close-paren?, dot?
|
||||
<span id="L95" class="LineNr"> 95 </span> <span class="Delimiter">}</span>
|
||||
<span id="L96" class="LineNr"> 96 </span> <span class="muComment"># unquote-splice -> parse as list with a special car</span>
|
||||
<span id="L97" class="LineNr"> 97 </span> <span class="PreProc">var</span> <a href='tokenize.mu.html#L895'>unquote-splice-token?</a>/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='tokenize.mu.html#L895'>unquote-splice-token?</a> curr-token
|
||||
<span id="L98" class="LineNr"> 98 </span> compare <a href='tokenize.mu.html#L895'>unquote-splice-token?</a>, <span class="Constant">0</span>/false
|
||||
<span id="L97" class="LineNr"> 97 </span> <span class="PreProc">var</span> <a href='tokenize.mu.html#L1038'>unquote-splice-token?</a>/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='tokenize.mu.html#L1038'>unquote-splice-token?</a> curr-token
|
||||
<span id="L98" class="LineNr"> 98 </span> compare <a href='tokenize.mu.html#L1038'>unquote-splice-token?</a>, <span class="Constant">0</span>/false
|
||||
<span id="L99" class="LineNr"> 99 </span> <span class="Delimiter">{</span>
|
||||
<span id="L100" class="LineNr">100 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L101" class="LineNr">101 </span> <span class="PreProc">var</span> out/<span class="muRegEdi">edi</span>: (addr handle <a href='cell.mu.html#L1'>cell</a>) <span class="Special"><-</span> copy _out
|
||||
|
@ -174,7 +174,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L111" class="LineNr">111 </span> <span class="PreProc">return</span> close-paren?, dot?
|
||||
<span id="L112" class="LineNr">112 </span> <span class="Delimiter">}</span>
|
||||
<span id="L113" class="LineNr">113 </span> <span class="muComment"># dot -> return</span>
|
||||
<span id="L114" class="LineNr">114 </span> <span class="PreProc">var</span> dot?/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='tokenize.mu.html#L936'>dot-token?</a> curr-token
|
||||
<span id="L114" class="LineNr">114 </span> <span class="PreProc">var</span> dot?/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='tokenize.mu.html#L1079'>dot-token?</a> curr-token
|
||||
<span id="L115" class="LineNr">115 </span> compare dot?, <span class="Constant">0</span>/false
|
||||
<span id="L116" class="LineNr">116 </span> <span class="Delimiter">{</span>
|
||||
<span id="L117" class="LineNr">117 </span> <span class="PreProc">break-if-=</span>
|
||||
|
@ -182,15 +182,15 @@ if ('onhashchange' in window) {
|
|||
<span id="L119" class="LineNr">119 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false, <span class="Constant">1</span>/true
|
||||
<span id="L120" class="LineNr">120 </span> <span class="Delimiter">}</span>
|
||||
<span id="L121" class="LineNr">121 </span> <span class="muComment"># not bracket -> parse atom</span>
|
||||
<span id="L122" class="LineNr">122 </span> <span class="PreProc">var</span> <a href='tokenize.mu.html#L851'>bracket-token?</a>/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='tokenize.mu.html#L851'>bracket-token?</a> curr-token
|
||||
<span id="L123" class="LineNr">123 </span> compare <a href='tokenize.mu.html#L851'>bracket-token?</a>, <span class="Constant">0</span>/false
|
||||
<span id="L122" class="LineNr">122 </span> <span class="PreProc">var</span> <a href='tokenize.mu.html#L994'>bracket-token?</a>/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='tokenize.mu.html#L994'>bracket-token?</a> curr-token
|
||||
<span id="L123" class="LineNr">123 </span> compare <a href='tokenize.mu.html#L994'>bracket-token?</a>, <span class="Constant">0</span>/false
|
||||
<span id="L124" class="LineNr">124 </span> <span class="Delimiter">{</span>
|
||||
<span id="L125" class="LineNr">125 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L126" class="LineNr">126 </span> <a href='parse.mu.html#L201'>parse-atom</a> curr-token, _out, trace
|
||||
<span id="L127" class="LineNr">127 </span> <span class="PreProc">break</span> $parse-sexpression:type-check
|
||||
<span id="L128" class="LineNr">128 </span> <span class="Delimiter">}</span>
|
||||
<span id="L129" class="LineNr">129 </span> <span class="muComment"># open paren -> parse list</span>
|
||||
<span id="L130" class="LineNr">130 </span> <span class="PreProc">var</span> open-paren?/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='tokenize.mu.html#L904'>open-paren-token?</a> curr-token
|
||||
<span id="L130" class="LineNr">130 </span> <span class="PreProc">var</span> open-paren?/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='tokenize.mu.html#L1047'>open-paren-token?</a> curr-token
|
||||
<span id="L131" class="LineNr">131 </span> compare open-paren?, <span class="Constant">0</span>/false
|
||||
<span id="L132" class="LineNr">132 </span> <span class="Delimiter">{</span>
|
||||
<span id="L133" class="LineNr">133 </span> <span class="PreProc">break-if-=</span>
|
||||
|
@ -240,7 +240,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L177" class="LineNr">177 </span> <span class="PreProc">break</span> $parse-sexpression:type-check
|
||||
<span id="L178" class="LineNr">178 </span> <span class="Delimiter">}</span>
|
||||
<span id="L179" class="LineNr">179 </span> <span class="muComment"># close paren -> return</span>
|
||||
<span id="L180" class="LineNr">180 </span> <span class="PreProc">var</span> close-paren?/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='tokenize.mu.html#L920'>close-paren-token?</a> curr-token
|
||||
<span id="L180" class="LineNr">180 </span> <span class="PreProc">var</span> close-paren?/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='tokenize.mu.html#L1063'>close-paren-token?</a> curr-token
|
||||
<span id="L181" class="LineNr">181 </span> compare close-paren?, <span class="Constant">0</span>/false
|
||||
<span id="L182" class="LineNr">182 </span> <span class="Delimiter">{</span>
|
||||
<span id="L183" class="LineNr">183 </span> <span class="PreProc">break-if-=</span>
|
||||
|
@ -269,8 +269,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L206" class="LineNr">206 </span> <span class="PreProc">var</span> curr-token-data/<span class="muRegEsi">esi</span>: (addr stream byte) <span class="Special"><-</span> copy _curr-token-data
|
||||
<span id="L207" class="LineNr">207 </span> trace trace, <span class="Constant">"parse"</span>, curr-token-data
|
||||
<span id="L208" class="LineNr">208 </span> <span class="muComment"># number</span>
|
||||
<span id="L209" class="LineNr">209 </span> <span class="PreProc">var</span> <a href='tokenize.mu.html#L841'>number-token?</a>/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='tokenize.mu.html#L841'>number-token?</a> curr-token
|
||||
<span id="L210" class="LineNr">210 </span> compare <a href='tokenize.mu.html#L841'>number-token?</a>, <span class="Constant">0</span>/false
|
||||
<span id="L209" class="LineNr">209 </span> <span class="PreProc">var</span> <a href='tokenize.mu.html#L977'>number-token?</a>/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='tokenize.mu.html#L977'>number-token?</a> curr-token
|
||||
<span id="L210" class="LineNr">210 </span> compare <a href='tokenize.mu.html#L977'>number-token?</a>, <span class="Constant">0</span>/false
|
||||
<span id="L211" class="LineNr">211 </span> <span class="Delimiter">{</span>
|
||||
<span id="L212" class="LineNr">212 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L213" class="LineNr">213 </span> <a href='../106stream.subx.html#L59'>rewind-stream</a> curr-token-data
|
||||
|
@ -301,13 +301,13 @@ if ('onhashchange' in window) {
|
|||
<span id="L238" class="LineNr">238 </span> <span class="Delimiter">}</span>
|
||||
<span id="L239" class="LineNr">239 </span> <span class="muComment"># default: copy either to a symbol or a stream</span>
|
||||
<span id="L240" class="LineNr">240 </span> <span class="muComment"># stream token -> literal</span>
|
||||
<span id="L241" class="LineNr">241 </span> <span class="PreProc">var</span> <a href='tokenize.mu.html#L961'>stream-token?</a>/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='tokenize.mu.html#L961'>stream-token?</a> curr-token
|
||||
<span id="L242" class="LineNr">242 </span> compare <a href='tokenize.mu.html#L961'>stream-token?</a>, <span class="Constant">0</span>/false
|
||||
<span id="L241" class="LineNr">241 </span> <span class="PreProc">var</span> <a href='tokenize.mu.html#L1104'>stream-token?</a>/<span class="muRegEax">eax</span>: boolean <span class="Special"><-</span> <a href='tokenize.mu.html#L1104'>stream-token?</a> curr-token
|
||||
<span id="L242" class="LineNr">242 </span> compare <a href='tokenize.mu.html#L1104'>stream-token?</a>, <span class="Constant">0</span>/false
|
||||
<span id="L243" class="LineNr">243 </span> <span class="Delimiter">{</span>
|
||||
<span id="L244" class="LineNr">244 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L245" class="LineNr">245 </span> <a href='cell.mu.html#L58'>allocate-stream</a> _out
|
||||
<span id="L246" class="LineNr">246 </span> <span class="Delimiter">}</span>
|
||||
<span id="L247" class="LineNr">247 </span> compare <a href='tokenize.mu.html#L961'>stream-token?</a>, <span class="Constant">0</span>/false
|
||||
<span id="L247" class="LineNr">247 </span> compare <a href='tokenize.mu.html#L1104'>stream-token?</a>, <span class="Constant">0</span>/false
|
||||
<span id="L248" class="LineNr">248 </span> <span class="Delimiter">{</span>
|
||||
<span id="L249" class="LineNr">249 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L250" class="LineNr">250 </span> <a href='cell.mu.html#L21'>allocate-symbol</a> _out
|
||||
|
|
3412
html/shell/primitives.mu.html
generated
3412
html/shell/primitives.mu.html
generated
File diff suppressed because it is too large
Load Diff
6
html/shell/print.mu.html
generated
6
html/shell/print.mu.html
generated
|
@ -15,14 +15,14 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.PreProc { color: #c000c0; }
|
||||
.muRegEdx { color: #878700; }
|
||||
.muRegEcx { color: #af875f; }
|
||||
.Special { color: #ff6060; }
|
||||
.LineNr { }
|
||||
.muRegEsi { color: #87d787; }
|
||||
.muRegEdi { color: #87ffd7; }
|
||||
.muRegEdx { color: #878700; }
|
||||
.Constant { color: #008787; }
|
||||
.muRegEsi { color: #87d787; }
|
||||
.muRegEax { color: #875f00; }
|
||||
.muRegEcx { color: #af875f; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muTest { color: #5f8700; }
|
||||
|
|
2
html/shell/read.mu.html
generated
2
html/shell/read.mu.html
generated
|
@ -15,11 +15,11 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.PreProc { color: #c000c0; }
|
||||
.muRegEcx { color: #af875f; }
|
||||
.Special { color: #ff6060; }
|
||||
.LineNr { }
|
||||
.Constant { color: #008787; }
|
||||
.muRegEax { color: #875f00; }
|
||||
.muRegEcx { color: #af875f; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muComment { color: #005faf; }
|
||||
|
|
1969
html/shell/sandbox.mu.html
generated
1969
html/shell/sandbox.mu.html
generated
File diff suppressed because it is too large
Load Diff
2113
html/shell/tokenize.mu.html
generated
2113
html/shell/tokenize.mu.html
generated
File diff suppressed because it is too large
Load Diff
426
html/shell/trace.mu.html
generated
426
html/shell/trace.mu.html
generated
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user