This commit is contained in:
parent
ef8fd8851a
commit
3ff2fe607c
|
@ -364,8 +364,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L304" class="LineNr">304 </span> c3/return
|
||||
<span id="L305" class="LineNr">305 </span>
|
||||
<span id="L306" class="LineNr">306 </span><span class="Constant">$_append-4:<a href='317abort.subx.html#L5'>abort</a></span>:
|
||||
<span id="L307" class="LineNr">307 </span> (<a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">"_append-4: stream full at "</span> 3 0) <span class="subxComment"># 3=cyan</span>
|
||||
<span id="L308" class="LineNr">308 </span> (<a href='501draw-text.mu.html#L394'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 %eax 3 0)
|
||||
<span id="L307" class="LineNr">307 </span> (<a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">"_append-4: stream full at "</span> 3 0) <span class="subxComment"># 3=cyan</span>
|
||||
<span id="L308" class="LineNr">308 </span> (<a href='501draw-text.mu.html#L387'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 %eax 3 0)
|
||||
<span id="L309" class="LineNr">309 </span> (<a href='317abort.subx.html#L5'>abort</a> <span class="Constant">""</span>)
|
||||
<span id="L310" class="LineNr">310 </span> <span class="subxComment"># never gets here</span>
|
||||
<span id="L311" class="LineNr">311 </span>
|
||||
|
|
|
@ -58,85 +58,110 @@ if ('onhashchange' in window) {
|
|||
<body onload='JumpToLine();'>
|
||||
<a href='https://github.com/akkartik/mu/blob/main/115write-byte.subx'>https://github.com/akkartik/mu/blob/main/115write-byte.subx</a>
|
||||
<pre id='vimCodeElement'>
|
||||
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># Write a single byte to a stream.</span>
|
||||
<span id="L2" class="LineNr"> 2 </span><span class="subxComment">#</span>
|
||||
<span id="L3" class="LineNr"> 3 </span><span class="subxComment"># We need to do this in machine code because streams need to be opaque types,</span>
|
||||
<span id="L4" class="LineNr"> 4 </span><span class="subxComment"># and we don't yet support opaque types in Mu.</span>
|
||||
<span id="L5" class="LineNr"> 5 </span>
|
||||
<span id="L6" class="LineNr"> 6 </span>== code
|
||||
<span id="L7" class="LineNr"> 7 </span><span class="subxComment"># instruction effective address register displacement immediate</span>
|
||||
<span id="L8" class="LineNr"> 8 </span><span class="subxS1Comment"># . op subop mod rm32 base index scale r32</span>
|
||||
<span id="L9" class="LineNr"> 9 </span><span class="subxS1Comment"># . 1-3 bytes 3 bits 2 bits 3 bits 3 bits 3 bits 2 bits 2 bits 0/1/2/4 bytes 0/1/2/4 bytes</span>
|
||||
<span id="L10" class="LineNr">10 </span>
|
||||
<span id="L11" class="LineNr">11 </span><span class="subxComment"># Write lower byte of 'n' to 'f'.</span>
|
||||
<span id="L12" class="LineNr">12 </span><span class="subxFunction">append-byte</span>: <span class="subxComment"># f: (addr stream byte), n: int</span>
|
||||
<span id="L13" class="LineNr">13 </span> <span class="subxS1Comment"># . prologue</span>
|
||||
<span id="L14" class="LineNr">14 </span> 55/push-ebp
|
||||
<span id="L15" class="LineNr">15 </span> 89/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="L16" class="LineNr">16 </span> <span class="subxS1Comment"># . save registers</span>
|
||||
<span id="L17" class="LineNr">17 </span> 50/push-eax
|
||||
<span id="L18" class="LineNr">18 </span> 51/push-ecx
|
||||
<span id="L19" class="LineNr">19 </span> 57/push-edi
|
||||
<span id="L20" class="LineNr">20 </span> <span class="subxComment"># edi = f</span>
|
||||
<span id="L21" class="LineNr">21 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 7/r32/edi 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to edi</span>
|
||||
<span id="L22" class="LineNr">22 </span> <span class="subxComment"># ecx = f->write</span>
|
||||
<span id="L23" class="LineNr">23 </span> 8b/copy 0/mod/indirect 7/rm32/edi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *edi to ecx</span>
|
||||
<span id="L24" class="LineNr">24 </span> <span class="subxComment"># if (f->write >= f->size) abort</span>
|
||||
<span id="L25" class="LineNr">25 </span> 3b/compare 1/mod/*+disp8 7/rm32/edi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># compare ecx with *(edi+8)</span>
|
||||
<span id="L26" class="LineNr">26 </span> 7d/jump-if->= $append-byte:<a href='317abort.subx.html#L5'>abort</a>/disp8
|
||||
<span id="L27" class="LineNr">27 </span><span class="Constant">$append-byte:to-stream</span>:
|
||||
<span id="L28" class="LineNr">28 </span> <span class="subxComment"># write to stream</span>
|
||||
<span id="L29" class="LineNr">29 </span> <span class="subxComment"># f->data[f->write] = LSB(n)</span>
|
||||
<span id="L30" class="LineNr">30 </span> 31/xor 3/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># clear eax</span>
|
||||
<span id="L31" class="LineNr">31 </span> 8a/copy-byte 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/AL 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy byte at *(ebp+12) to AL</span>
|
||||
<span id="L32" class="LineNr">32 </span> 88/copy-byte 1/mod/*+disp8 4/rm32/sib 7/base/edi 1/index/ecx <span class="Normal"> . </span> 0/r32/AL 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy AL to *(edi+ecx+12)</span>
|
||||
<span id="L33" class="LineNr">33 </span> <span class="subxComment"># ++f->write</span>
|
||||
<span id="L34" class="LineNr">34 </span> ff 0/subop/increment 0/mod/indirect 7/rm32/edi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># increment *edi</span>
|
||||
<span id="L35" class="LineNr">35 </span><span class="Constant">$append-byte:end</span>:
|
||||
<span id="L36" class="LineNr">36 </span> <span class="subxS1Comment"># . restore registers</span>
|
||||
<span id="L37" class="LineNr">37 </span> 5f/pop-to-edi
|
||||
<span id="L38" class="LineNr">38 </span> 59/pop-to-ecx
|
||||
<span id="L39" class="LineNr">39 </span> 58/pop-to-eax
|
||||
<span id="L40" class="LineNr">40 </span> <span class="subxS1Comment"># . epilogue</span>
|
||||
<span id="L41" class="LineNr">41 </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="L42" class="LineNr">42 </span> 5d/pop-to-ebp
|
||||
<span id="L43" class="LineNr">43 </span> c3/return
|
||||
<span id="L44" class="LineNr">44 </span>
|
||||
<span id="L45" class="LineNr">45 </span><span class="Constant">$append-byte:<a href='317abort.subx.html#L5'>abort</a></span>:
|
||||
<span id="L46" class="LineNr">46 </span> (<a href='317abort.subx.html#L5'>abort</a> <span class="Constant">"append-byte: out of space"</span>)
|
||||
<span id="L47" class="LineNr">47 </span> <span class="subxComment"># never gets here</span>
|
||||
<span id="L48" class="LineNr">48 </span>
|
||||
<span id="L49" class="LineNr">49 </span><span class="subxTest">test-append-byte-single</span>:
|
||||
<span id="L50" class="LineNr">50 </span> <span class="subxH1Comment"># - check that append-byte writes to first byte of 'file'</span>
|
||||
<span id="L51" class="LineNr">51 </span> <span class="subxComment"># setup</span>
|
||||
<span id="L52" class="LineNr">52 </span> <span class="subxS1Comment"># . clear-stream(_test-stream)</span>
|
||||
<span id="L53" class="LineNr">53 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L54" class="LineNr">54 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
|
||||
<span id="L55" class="LineNr">55 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L56" class="LineNr">56 </span> e8/call <a href='106stream.subx.html#L20'>clear-stream</a>/disp32
|
||||
<span id="L57" class="LineNr">57 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L58" class="LineNr">58 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L59" class="LineNr">59 </span> <span class="subxComment"># append-byte(_test-stream, 'A')</span>
|
||||
<span id="L60" class="LineNr">60 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L61" class="LineNr">61 </span> 68/push 0x41/imm32
|
||||
<span id="L62" class="LineNr">62 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
|
||||
<span id="L63" class="LineNr">63 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L64" class="LineNr">64 </span> e8/call <a href='115write-byte.subx.html#L12'>append-byte</a>/disp32
|
||||
<span id="L65" class="LineNr">65 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L66" class="LineNr">66 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L67" class="LineNr">67 </span> <span class="subxComment"># check-stream-equal(_test-stream, "A", msg)</span>
|
||||
<span id="L68" class="LineNr">68 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L69" class="LineNr">69 </span> 68/push <span class="Constant">"F - test-append-byte-single"</span>/imm32
|
||||
<span id="L70" class="LineNr">70 </span> 68/push <span class="Constant">"A"</span>/imm32
|
||||
<span id="L71" class="LineNr">71 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
|
||||
<span id="L72" class="LineNr">72 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L73" class="LineNr">73 </span> e8/call <a href='109stream-equal.subx.html#L194'>check-stream-equal</a>/disp32
|
||||
<span id="L74" class="LineNr">74 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L75" class="LineNr">75 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L76" class="LineNr">76 </span> <span class="subxS1Comment"># . end</span>
|
||||
<span id="L77" class="LineNr">77 </span> c3/return
|
||||
<span id="L78" class="LineNr">78 </span>
|
||||
<span id="L79" class="LineNr">79 </span><span class="subxS2Comment"># . . vim:nowrap:textwidth=0</span>
|
||||
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># Write a single byte to a stream.</span>
|
||||
<span id="L2" class="LineNr"> 2 </span><span class="subxComment">#</span>
|
||||
<span id="L3" class="LineNr"> 3 </span><span class="subxComment"># We need to do this in machine code because streams need to be opaque types,</span>
|
||||
<span id="L4" class="LineNr"> 4 </span><span class="subxComment"># and we don't yet support opaque types in Mu.</span>
|
||||
<span id="L5" class="LineNr"> 5 </span>
|
||||
<span id="L6" class="LineNr"> 6 </span>== code
|
||||
<span id="L7" class="LineNr"> 7 </span><span class="subxComment"># instruction effective address register displacement immediate</span>
|
||||
<span id="L8" class="LineNr"> 8 </span><span class="subxS1Comment"># . op subop mod rm32 base index scale r32</span>
|
||||
<span id="L9" class="LineNr"> 9 </span><span class="subxS1Comment"># . 1-3 bytes 3 bits 2 bits 3 bits 3 bits 3 bits 2 bits 2 bits 0/1/2/4 bytes 0/1/2/4 bytes</span>
|
||||
<span id="L10" class="LineNr"> 10 </span>
|
||||
<span id="L11" class="LineNr"> 11 </span><span class="subxComment"># Write lower byte of 'n' to 'f'.</span>
|
||||
<span id="L12" class="LineNr"> 12 </span><span class="subxFunction">append-byte</span>: <span class="subxComment"># f: (addr stream byte), n: int</span>
|
||||
<span id="L13" class="LineNr"> 13 </span> <span class="subxS1Comment"># . prologue</span>
|
||||
<span id="L14" class="LineNr"> 14 </span> 55/push-ebp
|
||||
<span id="L15" class="LineNr"> 15 </span> 89/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="L16" class="LineNr"> 16 </span> <span class="subxS1Comment"># . save registers</span>
|
||||
<span id="L17" class="LineNr"> 17 </span> 50/push-eax
|
||||
<span id="L18" class="LineNr"> 18 </span> 51/push-ecx
|
||||
<span id="L19" class="LineNr"> 19 </span> 57/push-edi
|
||||
<span id="L20" class="LineNr"> 20 </span> <span class="subxComment"># edi = f</span>
|
||||
<span id="L21" class="LineNr"> 21 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 7/r32/edi 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to edi</span>
|
||||
<span id="L22" class="LineNr"> 22 </span> <span class="subxComment"># ecx = f->write</span>
|
||||
<span id="L23" class="LineNr"> 23 </span> 8b/copy 0/mod/indirect 7/rm32/edi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *edi to ecx</span>
|
||||
<span id="L24" class="LineNr"> 24 </span> <span class="subxComment"># if (f->write >= f->size) abort</span>
|
||||
<span id="L25" class="LineNr"> 25 </span> 3b/compare 1/mod/*+disp8 7/rm32/edi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># compare ecx with *(edi+8)</span>
|
||||
<span id="L26" class="LineNr"> 26 </span> 7d/jump-if->= $append-byte:<a href='317abort.subx.html#L5'>abort</a>/disp8
|
||||
<span id="L27" class="LineNr"> 27 </span><span class="Constant">$append-byte:to-stream</span>:
|
||||
<span id="L28" class="LineNr"> 28 </span> <span class="subxComment"># write to stream</span>
|
||||
<span id="L29" class="LineNr"> 29 </span> <span class="subxComment"># f->data[f->write] = LSB(n)</span>
|
||||
<span id="L30" class="LineNr"> 30 </span> 31/xor 3/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># clear eax</span>
|
||||
<span id="L31" class="LineNr"> 31 </span> 8a/copy-byte 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/AL 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy byte at *(ebp+12) to AL</span>
|
||||
<span id="L32" class="LineNr"> 32 </span> 88/copy-byte 1/mod/*+disp8 4/rm32/sib 7/base/edi 1/index/ecx <span class="Normal"> . </span> 0/r32/AL 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy AL to *(edi+ecx+12)</span>
|
||||
<span id="L33" class="LineNr"> 33 </span> <span class="subxComment"># ++f->write</span>
|
||||
<span id="L34" class="LineNr"> 34 </span> ff 0/subop/increment 0/mod/indirect 7/rm32/edi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># increment *edi</span>
|
||||
<span id="L35" class="LineNr"> 35 </span><span class="Constant">$append-byte:end</span>:
|
||||
<span id="L36" class="LineNr"> 36 </span> <span class="subxS1Comment"># . restore registers</span>
|
||||
<span id="L37" class="LineNr"> 37 </span> 5f/pop-to-edi
|
||||
<span id="L38" class="LineNr"> 38 </span> 59/pop-to-ecx
|
||||
<span id="L39" class="LineNr"> 39 </span> 58/pop-to-eax
|
||||
<span id="L40" class="LineNr"> 40 </span> <span class="subxS1Comment"># . epilogue</span>
|
||||
<span id="L41" class="LineNr"> 41 </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="L42" class="LineNr"> 42 </span> 5d/pop-to-ebp
|
||||
<span id="L43" class="LineNr"> 43 </span> c3/return
|
||||
<span id="L44" class="LineNr"> 44 </span>
|
||||
<span id="L45" class="LineNr"> 45 </span><span class="Constant">$append-byte:<a href='317abort.subx.html#L5'>abort</a></span>:
|
||||
<span id="L46" class="LineNr"> 46 </span> (<a href='317abort.subx.html#L5'>abort</a> <span class="Constant">"append-byte: out of space"</span>)
|
||||
<span id="L47" class="LineNr"> 47 </span> <span class="subxComment"># never gets here</span>
|
||||
<span id="L48" class="LineNr"> 48 </span>
|
||||
<span id="L49" class="LineNr"> 49 </span><span class="subxTest">test-append-byte-single</span>:
|
||||
<span id="L50" class="LineNr"> 50 </span> <span class="subxH1Comment"># - check that append-byte writes to first byte of 'file'</span>
|
||||
<span id="L51" class="LineNr"> 51 </span> <span class="subxComment"># setup</span>
|
||||
<span id="L52" class="LineNr"> 52 </span> <span class="subxS1Comment"># . clear-stream(_test-stream)</span>
|
||||
<span id="L53" class="LineNr"> 53 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L54" class="LineNr"> 54 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
|
||||
<span id="L55" class="LineNr"> 55 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L56" class="LineNr"> 56 </span> e8/call <a href='106stream.subx.html#L20'>clear-stream</a>/disp32
|
||||
<span id="L57" class="LineNr"> 57 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L58" class="LineNr"> 58 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L59" class="LineNr"> 59 </span> <span class="subxComment"># append-byte(_test-stream, 'A')</span>
|
||||
<span id="L60" class="LineNr"> 60 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L61" class="LineNr"> 61 </span> 68/push 0x41/imm32
|
||||
<span id="L62" class="LineNr"> 62 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
|
||||
<span id="L63" class="LineNr"> 63 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L64" class="LineNr"> 64 </span> e8/call <a href='115write-byte.subx.html#L12'>append-byte</a>/disp32
|
||||
<span id="L65" class="LineNr"> 65 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L66" class="LineNr"> 66 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L67" class="LineNr"> 67 </span> <span class="subxComment"># check-stream-equal(_test-stream, "A", msg)</span>
|
||||
<span id="L68" class="LineNr"> 68 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L69" class="LineNr"> 69 </span> 68/push <span class="Constant">"F - test-append-byte-single"</span>/imm32
|
||||
<span id="L70" class="LineNr"> 70 </span> 68/push <span class="Constant">"A"</span>/imm32
|
||||
<span id="L71" class="LineNr"> 71 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
|
||||
<span id="L72" class="LineNr"> 72 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L73" class="LineNr"> 73 </span> e8/call <a href='109stream-equal.subx.html#L194'>check-stream-equal</a>/disp32
|
||||
<span id="L74" class="LineNr"> 74 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L75" class="LineNr"> 75 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L76" class="LineNr"> 76 </span> <span class="subxS1Comment"># . end</span>
|
||||
<span id="L77" class="LineNr"> 77 </span> c3/return
|
||||
<span id="L78" class="LineNr"> 78 </span>
|
||||
<span id="L79" class="LineNr"> 79 </span><span class="subxFunction">undo-append-byte</span>: <span class="subxComment"># f: (addr stream byte)</span>
|
||||
<span id="L80" class="LineNr"> 80 </span> <span class="subxS1Comment"># . prologue</span>
|
||||
<span id="L81" class="LineNr"> 81 </span> 55/push-ebp
|
||||
<span id="L82" class="LineNr"> 82 </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="L83" class="LineNr"> 83 </span> <span class="subxS1Comment"># . save registers</span>
|
||||
<span id="L84" class="LineNr"> 84 </span> 50/push-eax
|
||||
<span id="L85" class="LineNr"> 85 </span> <span class="subxComment"># eax = f</span>
|
||||
<span id="L86" class="LineNr"> 86 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to eax</span>
|
||||
<span id="L87" class="LineNr"> 87 </span> <span class="subxComment"># if (f->write <= 0) abort</span>
|
||||
<span id="L88" class="LineNr"> 88 </span> 81 7/subop/compare 0/mod/indirect 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/imm32 <span class="subxComment"># compare *eax</span>
|
||||
<span id="L89" class="LineNr"> 89 </span> 7e/jump-if-<= $undo-append-byte:<a href='317abort.subx.html#L5'>abort</a>/disp8
|
||||
<span id="L90" class="LineNr"> 90 </span> <span class="subxComment"># --f->write</span>
|
||||
<span id="L91" class="LineNr"> 91 </span> ff 1/subop/decrement 0/mod/indirect 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># decrement *eax</span>
|
||||
<span id="L92" class="LineNr"> 92 </span><span class="Constant">$undo-append-byte:end</span>:
|
||||
<span id="L93" class="LineNr"> 93 </span> <span class="subxS1Comment"># . restore registers</span>
|
||||
<span id="L94" class="LineNr"> 94 </span> 58/pop-to-eax
|
||||
<span id="L95" class="LineNr"> 95 </span> <span class="subxS1Comment"># . epilogue</span>
|
||||
<span id="L96" class="LineNr"> 96 </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="L97" class="LineNr"> 97 </span> 5d/pop-to-ebp
|
||||
<span id="L98" class="LineNr"> 98 </span> c3/return
|
||||
<span id="L99" class="LineNr"> 99 </span>
|
||||
<span id="L100" class="LineNr">100 </span><span class="Constant">$undo-append-byte:<a href='317abort.subx.html#L5'>abort</a></span>:
|
||||
<span id="L101" class="LineNr">101 </span> (<a href='317abort.subx.html#L5'>abort</a> <span class="Constant">"undo-append-byte: empty stream"</span>)
|
||||
<span id="L102" class="LineNr">102 </span> <span class="subxComment"># never gets here</span>
|
||||
<span id="L103" class="LineNr">103 </span>
|
||||
<span id="L104" class="LineNr">104 </span><span class="subxS2Comment"># . . vim:nowrap:textwidth=0</span>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -322,36 +322,36 @@ if ('onhashchange' in window) {
|
|||
<span id="L261" class="LineNr">261 </span> c3/return
|
||||
<span id="L262" class="LineNr">262 </span>
|
||||
<span id="L263" class="LineNr">263 </span><span class="Constant">$lookup:<a href='317abort.subx.html#L5'>abort</a></span>:
|
||||
<span id="L264" class="LineNr">264 </span> (<a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">"lookup failed: ("</span> 3 0) <span class="subxComment"># 3=cyan</span>
|
||||
<span id="L265" class="LineNr">265 </span> (<a href='501draw-text.mu.html#L394'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *(ebp+8) 3 0)
|
||||
<span id="L266" class="LineNr">266 </span> (<a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">", "</span> 3 0)
|
||||
<span id="L267" class="LineNr">267 </span> (<a href='501draw-text.mu.html#L394'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *(ebp+0xc) 3 0)
|
||||
<span id="L268" class="LineNr">268 </span> (<a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">") -> "</span> 3 0)
|
||||
<span id="L269" class="LineNr">269 </span> (<a href='501draw-text.mu.html#L394'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *eax 3 0)
|
||||
<span id="L270" class="LineNr">270 </span> (<a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">". Contents of a few words starting from address 0: "</span> 3 0)
|
||||
<span id="L264" class="LineNr">264 </span> (<a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">"lookup failed: ("</span> 3 0) <span class="subxComment"># 3=cyan</span>
|
||||
<span id="L265" class="LineNr">265 </span> (<a href='501draw-text.mu.html#L387'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *(ebp+8) 3 0)
|
||||
<span id="L266" class="LineNr">266 </span> (<a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">", "</span> 3 0)
|
||||
<span id="L267" class="LineNr">267 </span> (<a href='501draw-text.mu.html#L387'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *(ebp+0xc) 3 0)
|
||||
<span id="L268" class="LineNr">268 </span> (<a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">") -> "</span> 3 0)
|
||||
<span id="L269" class="LineNr">269 </span> (<a href='501draw-text.mu.html#L387'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *eax 3 0)
|
||||
<span id="L270" class="LineNr">270 </span> (<a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">". Contents of a few words starting from address 0: "</span> 3 0)
|
||||
<span id="L271" class="LineNr">271 </span> b8/copy-to-eax 0/imm32
|
||||
<span id="L272" class="LineNr">272 </span> (<a href='501draw-text.mu.html#L394'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *eax 2 0)
|
||||
<span id="L273" class="LineNr">273 </span> (<a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">" "</span> 2 0)
|
||||
<span id="L272" class="LineNr">272 </span> (<a href='501draw-text.mu.html#L387'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *eax 2 0)
|
||||
<span id="L273" class="LineNr">273 </span> (<a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">" "</span> 2 0)
|
||||
<span id="L274" class="LineNr">274 </span> 40/increment-eax
|
||||
<span id="L275" class="LineNr">275 </span> (<a href='501draw-text.mu.html#L394'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *eax 3 0)
|
||||
<span id="L276" class="LineNr">276 </span> (<a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">" "</span> 2 0)
|
||||
<span id="L275" class="LineNr">275 </span> (<a href='501draw-text.mu.html#L387'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *eax 3 0)
|
||||
<span id="L276" class="LineNr">276 </span> (<a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">" "</span> 2 0)
|
||||
<span id="L277" class="LineNr">277 </span> 40/increment-eax
|
||||
<span id="L278" class="LineNr">278 </span> (<a href='501draw-text.mu.html#L394'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *eax 3 0)
|
||||
<span id="L279" class="LineNr">279 </span> (<a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">" "</span> 2 0)
|
||||
<span id="L278" class="LineNr">278 </span> (<a href='501draw-text.mu.html#L387'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *eax 3 0)
|
||||
<span id="L279" class="LineNr">279 </span> (<a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">" "</span> 2 0)
|
||||
<span id="L280" class="LineNr">280 </span> 40/increment-eax
|
||||
<span id="L281" class="LineNr">281 </span> (<a href='501draw-text.mu.html#L394'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *eax 3 0)
|
||||
<span id="L282" class="LineNr">282 </span> (<a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">" "</span> 2 0)
|
||||
<span id="L281" class="LineNr">281 </span> (<a href='501draw-text.mu.html#L387'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *eax 3 0)
|
||||
<span id="L282" class="LineNr">282 </span> (<a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">" "</span> 2 0)
|
||||
<span id="L283" class="LineNr">283 </span> 40/increment-eax
|
||||
<span id="L284" class="LineNr">284 </span> (<a href='501draw-text.mu.html#L394'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *eax 3 0)
|
||||
<span id="L285" class="LineNr">285 </span> (<a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">" "</span> 2 0)
|
||||
<span id="L284" class="LineNr">284 </span> (<a href='501draw-text.mu.html#L387'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *eax 3 0)
|
||||
<span id="L285" class="LineNr">285 </span> (<a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">" "</span> 2 0)
|
||||
<span id="L286" class="LineNr">286 </span> 40/increment-eax
|
||||
<span id="L287" class="LineNr">287 </span> (<a href='501draw-text.mu.html#L394'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *eax 3 0)
|
||||
<span id="L288" class="LineNr">288 </span> (<a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">" "</span> 2 0)
|
||||
<span id="L287" class="LineNr">287 </span> (<a href='501draw-text.mu.html#L387'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *eax 3 0)
|
||||
<span id="L288" class="LineNr">288 </span> (<a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">" "</span> 2 0)
|
||||
<span id="L289" class="LineNr">289 </span> 40/increment-eax
|
||||
<span id="L290" class="LineNr">290 </span> (<a href='501draw-text.mu.html#L394'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *eax 3 0)
|
||||
<span id="L291" class="LineNr">291 </span> (<a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">" "</span> 2 0)
|
||||
<span id="L290" class="LineNr">290 </span> (<a href='501draw-text.mu.html#L387'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *eax 3 0)
|
||||
<span id="L291" class="LineNr">291 </span> (<a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">" "</span> 2 0)
|
||||
<span id="L292" class="LineNr">292 </span> 40/increment-eax
|
||||
<span id="L293" class="LineNr">293 </span> (<a href='501draw-text.mu.html#L394'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *eax 3 0)
|
||||
<span id="L293" class="LineNr">293 </span> (<a href='501draw-text.mu.html#L387'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *eax 3 0)
|
||||
<span id="L294" class="LineNr">294 </span> (<a href='317abort.subx.html#L5'>abort</a> <span class="Constant">"\n"</span>)
|
||||
<span id="L295" class="LineNr">295 </span> <span class="subxComment"># never gets here</span>
|
||||
<span id="L296" class="LineNr">296 </span>
|
||||
|
|
|
@ -360,7 +360,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L324" class="LineNr">324 </span> <span class="subxS1Comment"># . end</span>
|
||||
<span id="L325" class="LineNr">325 </span> c3/return
|
||||
<span id="L326" class="LineNr">326 </span>
|
||||
<span id="L327" class="LineNr">327 </span><span class="subxFunction">decimal-digit?</span>: <span class="subxComment"># c: grapheme -> result/eax: boolean</span>
|
||||
<span id="L327" class="LineNr">327 </span><span class="subxFunction">decimal-digit?</span>: <span class="subxComment"># c: code-point-utf8 -> result/eax: boolean</span>
|
||||
<span id="L328" class="LineNr">328 </span> <span class="subxS1Comment"># . prologue</span>
|
||||
<span id="L329" class="LineNr">329 </span> 55/push-ebp
|
||||
<span id="L330" class="LineNr">330 </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>
|
||||
|
@ -459,7 +459,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L423" class="LineNr">423 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L424" class="LineNr">424 </span> c3/return
|
||||
<span id="L425" class="LineNr">425 </span>
|
||||
<span id="L426" class="LineNr">426 </span><span class="subxFunction">to-decimal-digit</span>: <span class="subxComment"># in: grapheme -> out/eax: int</span>
|
||||
<span id="L426" class="LineNr">426 </span><span class="subxFunction">to-decimal-digit</span>: <span class="subxComment"># in: code-point-utf8 -> out/eax: int</span>
|
||||
<span id="L427" class="LineNr">427 </span> <span class="subxS1Comment"># . prologue</span>
|
||||
<span id="L428" class="LineNr">428 </span> 55/push-ebp
|
||||
<span id="L429" class="LineNr">429 </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>
|
||||
|
|
|
@ -82,13 +82,13 @@ if ('onhashchange' in window) {
|
|||
<span id="L26" class="LineNr">26 </span> 39/compare %eax 1/r32/ecx
|
||||
<span id="L27" class="LineNr">27 </span> 0f 82/jump-if-unsigned< $__check-mu-array-bounds:end/disp32 <span class="subxComment"># negative index should always abort</span>
|
||||
<span id="L28" class="LineNr">28 </span> <span class="subxComment"># abort if necessary</span>
|
||||
<span id="L29" class="LineNr">29 </span> (<a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">"fn "</span> 3 0) <span class="subxComment"># 3=cyan</span>
|
||||
<span id="L30" class="LineNr">30 </span> (<a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *(ebp+0x14) 3 0) <span class="subxComment"># 3=cyan</span>
|
||||
<span id="L31" class="LineNr">31 </span> (<a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">": offset "</span> 3 0) <span class="subxComment"># 3=cyan</span>
|
||||
<span id="L32" class="LineNr">32 </span> (<a href='501draw-text.mu.html#L394'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 %eax 3 0) <span class="subxComment"># 3=cyan</span>
|
||||
<span id="L33" class="LineNr">33 </span> (<a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">" is too large for array '"</span> 3 0) <span class="subxComment"># 3=cyan</span>
|
||||
<span id="L34" class="LineNr">34 </span> (<a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *(ebp+0x18) 3 0) <span class="subxComment"># 3=cyan</span>
|
||||
<span id="L35" class="LineNr">35 </span> (<a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">"'"</span> 3 0) <span class="subxComment"># 3=cyan</span>
|
||||
<span id="L29" class="LineNr">29 </span> (<a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">"fn "</span> 3 0) <span class="subxComment"># 3=cyan</span>
|
||||
<span id="L30" class="LineNr">30 </span> (<a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *(ebp+0x14) 3 0) <span class="subxComment"># 3=cyan</span>
|
||||
<span id="L31" class="LineNr">31 </span> (<a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">": offset "</span> 3 0) <span class="subxComment"># 3=cyan</span>
|
||||
<span id="L32" class="LineNr">32 </span> (<a href='501draw-text.mu.html#L387'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 %eax 3 0) <span class="subxComment"># 3=cyan</span>
|
||||
<span id="L33" class="LineNr">33 </span> (<a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">" is too large for array '"</span> 3 0) <span class="subxComment"># 3=cyan</span>
|
||||
<span id="L34" class="LineNr">34 </span> (<a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *(ebp+0x18) 3 0) <span class="subxComment"># 3=cyan</span>
|
||||
<span id="L35" class="LineNr">35 </span> (<a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">"'"</span> 3 0) <span class="subxComment"># 3=cyan</span>
|
||||
<span id="L36" class="LineNr">36 </span> (<a href='317abort.subx.html#L5'>abort</a> <span class="Constant">""</span>)
|
||||
<span id="L37" class="LineNr">37 </span> <span class="subxComment"># never gets here</span>
|
||||
<span id="L38" class="LineNr">38 </span><span class="Constant">$__check-mu-array-bounds:end</span>:
|
||||
|
@ -102,11 +102,11 @@ if ('onhashchange' in window) {
|
|||
<span id="L46" class="LineNr">46 </span> c3/return
|
||||
<span id="L47" class="LineNr">47 </span>
|
||||
<span id="L48" class="LineNr">48 </span><span class="subxMinorFunction">__check-mu-array-bounds:overflow</span>:
|
||||
<span id="L49" class="LineNr">49 </span> (<a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">"fn "</span> 3 0) <span class="subxComment"># 3=cyan</span>
|
||||
<span id="L50" class="LineNr">50 </span> (<a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *(ebp+0x14) 3 0) <span class="subxComment"># 3=cyan</span>
|
||||
<span id="L51" class="LineNr">51 </span> (<a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">": offset to array '"</span> 3 0) <span class="subxComment"># 3=cyan</span>
|
||||
<span id="L52" class="LineNr">52 </span> (<a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *(ebp+0x18) 3 0) <span class="subxComment"># 3=cyan</span>
|
||||
<span id="L53" class="LineNr">53 </span> (<a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">"' overflowed 32 bits"</span> 3 0) <span class="subxComment"># 3=cyan</span>
|
||||
<span id="L49" class="LineNr">49 </span> (<a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">"fn "</span> 3 0) <span class="subxComment"># 3=cyan</span>
|
||||
<span id="L50" class="LineNr">50 </span> (<a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *(ebp+0x14) 3 0) <span class="subxComment"># 3=cyan</span>
|
||||
<span id="L51" class="LineNr">51 </span> (<a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">": offset to array '"</span> 3 0) <span class="subxComment"># 3=cyan</span>
|
||||
<span id="L52" class="LineNr">52 </span> (<a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *(ebp+0x18) 3 0) <span class="subxComment"># 3=cyan</span>
|
||||
<span id="L53" class="LineNr">53 </span> (<a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">"' overflowed 32 bits"</span> 3 0) <span class="subxComment"># 3=cyan</span>
|
||||
<span id="L54" class="LineNr">54 </span> (<a href='317abort.subx.html#L5'>abort</a> <span class="Constant">""</span>)
|
||||
<span id="L55" class="LineNr">55 </span> <span class="subxComment"># never gets here</span>
|
||||
<span id="L56" class="LineNr">56 </span>
|
||||
|
|
|
@ -95,7 +95,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L37" class="LineNr"> 37 </span> (<a href='500fake-screen.mu.html#L253'>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#L269'>set-cursor-position</a> 0 0x70 0)
|
||||
<span id="L40" class="LineNr"> 40 </span> (<a href='501draw-text.mu.html#L394'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 %edx 0xf 0xc)
|
||||
<span id="L40" class="LineNr"> 40 </span> (<a href='501draw-text.mu.html#L387'>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#L269'>set-cursor-position</a> %eax %ecx)
|
||||
<span id="L43" class="LineNr"> 43 </span><span class="Constant">$show-stack-state:end</span>:
|
||||
|
@ -122,7 +122,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L64" class="LineNr"> 64 </span> {
|
||||
<span id="L65" class="LineNr"> 65 </span> 81 7/subop/compare *<span class="SpecialChar"><a href='315stack-debug.subx.html#L121'>Really-debug-print</a></span> 0/imm32/false
|
||||
<span id="L66" class="LineNr"> 66 </span> 74/jump-if-= <span class="Constant">break</span>/disp8
|
||||
<span id="L67" class="LineNr"> 67 </span> (<a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *(ebp+8) *(ebp+0xc) *(ebp+0x10))
|
||||
<span id="L67" class="LineNr"> 67 </span> (<a href='501draw-text.mu.html#L332'>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#L253'>cursor-position</a> 0) <span class="subxComment"># => eax, ecx</span>
|
||||
<span id="L70" class="LineNr"> 70 </span> 81 7/subop/compare %ecx 0x28/imm32
|
||||
|
|
|
@ -66,7 +66,7 @@ if ('onhashchange' in window) {
|
|||
<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='103glyph.subx.html#L354'>set-cursor-position-on-real-screen</a> 0 0)
|
||||
<span id="L11" class="LineNr"> 11 </span> (<a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *(ebp+8) 0xf 0xc) <span class="subxComment"># 0/real-screen, 0xf/fg=white, 0xc/bg=red</span>
|
||||
<span id="L11" class="LineNr"> 11 </span> (<a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *(ebp+8) 0xf 0xc) <span class="subxComment"># 0/real-screen, 0xf/fg=white, 0xc/bg=red</span>
|
||||
<span id="L12" class="LineNr"> 12 </span> (<a href='317abort.subx.html#L21'>dump-call-stack</a>)
|
||||
<span id="L13" class="LineNr"> 13 </span> <span class="subxComment"># crash</span>
|
||||
<span id="L14" class="LineNr"> 14 </span> {
|
||||
|
@ -101,9 +101,9 @@ if ('onhashchange' in window) {
|
|||
<span id="L43" class="LineNr"> 43 </span> 81 7/subop/compare %ebx 0/imm32
|
||||
<span id="L44" class="LineNr"> 44 </span> 0f 84/jump-if-= <span class="Constant">break</span>/disp32
|
||||
<span id="L45" class="LineNr"> 45 </span> <span class="subxComment"># loop body</span>
|
||||
<span id="L46" class="LineNr"> 46 </span> (<a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">"\n"</span> 0 0xc)
|
||||
<span id="L47" class="LineNr"> 47 </span> (<a href='501draw-text.mu.html#L394'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *(ebx+4) 0xf 0xc)
|
||||
<span id="L48" class="LineNr"> 48 </span> (<a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">" "</span> 0 0xc)
|
||||
<span id="L46" class="LineNr"> 46 </span> (<a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">"\n"</span> 0 0xc)
|
||||
<span id="L47" class="LineNr"> 47 </span> (<a href='501draw-text.mu.html#L387'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *(ebx+4) 0xf 0xc)
|
||||
<span id="L48" class="LineNr"> 48 </span> (<a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">" "</span> 0 0xc)
|
||||
<span id="L49" class="LineNr"> 49 </span> (<a href='317abort.subx.html#L233'>containing-function</a> %edx *(ebx+4)) <span class="subxComment"># => eax, ecx</span>
|
||||
<span id="L50" class="LineNr"> 50 </span> (<a href='317abort.subx.html#L294'>draw-slice-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 %eax %ecx 0 0xc)
|
||||
<span id="L51" class="LineNr"> 51 </span> <span class="subxComment"># loop update</span>
|
||||
|
@ -190,7 +190,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L132" class="LineNr">132 </span> 3d/compare-eax-and 0/imm32
|
||||
<span id="L133" class="LineNr">133 </span> {
|
||||
<span id="L134" class="LineNr">134 </span> 75/jump-if-!= <span class="Constant">break</span>/disp8
|
||||
<span id="L135" class="LineNr">135 </span> (<a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">"done loading"</span> 7 0)
|
||||
<span id="L135" class="LineNr">135 </span> (<a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">"done loading"</span> 7 0)
|
||||
<span id="L136" class="LineNr">136 </span> {
|
||||
<span id="L137" class="LineNr">137 </span> eb/jump <span class="Constant">loop</span>/disp8
|
||||
<span id="L138" class="LineNr">138 </span> }
|
||||
|
@ -198,7 +198,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L140" class="LineNr">140 </span> 3d/compare-eax-and 0xa/imm32/newline
|
||||
<span id="L141" class="LineNr">141 </span> {
|
||||
<span id="L142" class="LineNr">142 </span> 75/jump-if-!= <span class="Constant">break</span>/disp8
|
||||
<span id="L143" class="LineNr">143 </span> (<a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">"unexpected newline"</span> 7 0)
|
||||
<span id="L143" class="LineNr">143 </span> (<a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">"unexpected newline"</span> 7 0)
|
||||
<span id="L144" class="LineNr">144 </span> {
|
||||
<span id="L145" class="LineNr">145 </span> eb/jump <span class="Constant">loop</span>/disp8
|
||||
<span id="L146" class="LineNr">146 </span> }
|
||||
|
@ -231,7 +231,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L173" class="LineNr">173 </span> 3d/compare-eax-and 0/imm32
|
||||
<span id="L174" class="LineNr">174 </span> {
|
||||
<span id="L175" class="LineNr">175 </span> 75/jump-if-!= <span class="Constant">break</span>/disp8
|
||||
<span id="L176" class="LineNr">176 </span> (<a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">"done loading"</span> 7 0)
|
||||
<span id="L176" class="LineNr">176 </span> (<a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">"done loading"</span> 7 0)
|
||||
<span id="L177" class="LineNr">177 </span> {
|
||||
<span id="L178" class="LineNr">178 </span> eb/jump <span class="Constant">loop</span>/disp8
|
||||
<span id="L179" class="LineNr">179 </span> }
|
||||
|
@ -239,7 +239,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L181" class="LineNr">181 </span> 3d/compare-eax-and 0x20/imm32/space
|
||||
<span id="L182" class="LineNr">182 </span> {
|
||||
<span id="L183" class="LineNr">183 </span> 75/jump-if-!= <span class="Constant">break</span>/disp8
|
||||
<span id="L184" class="LineNr">184 </span> (<a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">"unexpected space"</span> 7 0)
|
||||
<span id="L184" class="LineNr">184 </span> (<a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">"unexpected space"</span> 7 0)
|
||||
<span id="L185" class="LineNr">185 </span> {
|
||||
<span id="L186" class="LineNr">186 </span> eb/jump <span class="Constant">loop</span>/disp8
|
||||
<span id="L187" class="LineNr">187 </span> }
|
||||
|
@ -310,8 +310,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L252" class="LineNr">252 </span> 39/compare %ecx 2/r32/edx
|
||||
<span id="L253" class="LineNr">253 </span> {
|
||||
<span id="L254" class="LineNr">254 </span> 0f 82/jump-if-addr< <span class="Constant">break</span>/disp32
|
||||
<span id="L255" class="LineNr">255 </span> (<a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">"failed to find function for address "</span> 7 0)
|
||||
<span id="L256" class="LineNr">256 </span> (<a href='501draw-text.mu.html#L394'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *(ebp+0xc) 7 0)
|
||||
<span id="L255" class="LineNr">255 </span> (<a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 <span class="Constant">"failed to find function for address "</span> 7 0)
|
||||
<span id="L256" class="LineNr">256 </span> (<a href='501draw-text.mu.html#L387'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> 0 *(ebp+0xc) 7 0)
|
||||
<span id="L257" class="LineNr">257 </span> {
|
||||
<span id="L258" class="LineNr">258 </span> eb/jump <span class="Constant">loop</span>/disp8
|
||||
<span id="L259" class="LineNr">259 </span> }
|
||||
|
@ -369,7 +369,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L311" class="LineNr">311 </span> 73/jump-if-addr>= <span class="Constant">break</span>/disp8
|
||||
<span id="L312" class="LineNr">312 </span> <span class="subxComment"># print *curr</span>
|
||||
<span id="L313" class="LineNr">313 </span> 8a/byte-> *ecx 0/r32/eax
|
||||
<span id="L314" class="LineNr">314 </span> (<a href='501draw-text.mu.html#L91'>draw-code-point-at-cursor-over-full-screen</a> *(ebp+8) %eax *(ebp+0x14) *(ebp+0x18))
|
||||
<span id="L314" class="LineNr">314 </span> (<a href='501draw-text.mu.html#L84'>draw-code-point-at-cursor-over-full-screen</a> *(ebp+8) %eax *(ebp+0x14) *(ebp+0x18))
|
||||
<span id="L315" class="LineNr">315 </span> <span class="subxComment">#</span>
|
||||
<span id="L316" class="LineNr">316 </span> 41/increment-ecx
|
||||
<span id="L317" class="LineNr">317 </span> <span class="subxComment">#</span>
|
||||
|
|
|
@ -122,63 +122,64 @@ if ('onhashchange' in window) {
|
|||
<span id="L65" class="LineNr"> 65 </span><span class="PreProc">sig</span> <a href='112read-byte.subx.html#L13'>read-byte</a> s: (addr stream byte)<span class="PreProc"> -> </span>_/eax: byte
|
||||
<span id="L66" class="LineNr"> 66 </span><span class="PreProc">sig</span> <a href='112read-byte.subx.html#L47'>peek-byte</a> s: (addr stream byte)<span class="PreProc"> -> </span>_/eax: byte
|
||||
<span id="L67" class="LineNr"> 67 </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="L68" class="LineNr"> 68 </span><span class="muComment">#sig to-hex-char in/eax: int -> out/eax: int</span>
|
||||
<span id="L69" class="LineNr"> 69 </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="L70" class="LineNr"> 70 </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="L71" class="LineNr"> 71 </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="L72" class="LineNr"> 72 </span><span class="PreProc">sig</span> <a href='118parse-hex-int.subx.html#L9'>hex-int?</a> in: (addr slice)<span class="PreProc"> -> </span>_/eax: boolean
|
||||
<span id="L73" class="LineNr"> 73 </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>_/eax: int
|
||||
<span id="L74" class="LineNr"> 74 </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>_/eax: int
|
||||
<span id="L75" class="LineNr"> 75 </span><span class="muComment">#sig parse-hex-int-helper start: (addr byte), end: (addr byte) -> _/eax: int</span>
|
||||
<span id="L76" class="LineNr"> 76 </span><span class="PreProc">sig</span> <a href='118parse-hex-int.subx.html#L701'>hex-digit?</a> c: byte<span class="PreProc"> -> </span>_/eax: boolean
|
||||
<span id="L77" class="LineNr"> 77 </span><span class="muComment">#sig from-hex-char in/eax: byte -> out/eax: nibble</span>
|
||||
<span id="L78" class="LineNr"> 78 </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>_/eax: int
|
||||
<span id="L79" class="LineNr"> 79 </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>_/eax: int
|
||||
<span id="L80" class="LineNr"> 80 </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>_/eax: int
|
||||
<span id="L81" class="LineNr"> 81 </span><span class="muComment">#sig parse-decimal-int-helper start: (addr byte), end: (addr byte) -> _/eax: int</span>
|
||||
<span id="L82" class="LineNr"> 82 </span><span class="PreProc">sig</span> <a href='311decimal-int.subx.html#L312'>decimal-size</a> n: int<span class="PreProc"> -> </span>_/eax: int
|
||||
<span id="L83" class="LineNr"> 83 </span><span class="muComment">#sig allocate ad: (addr allocation-descriptor), n: int, out: (addr handle _)</span>
|
||||
<span id="L84" class="LineNr"> 84 </span><span class="muComment">#sig allocate-raw ad: (addr allocation-descriptor), n: int, out: (addr handle _)</span>
|
||||
<span id="L85" class="LineNr"> 85 </span><span class="PreProc">sig</span> <a href='120allocate.subx.html#L235'>lookup</a> h: (handle _T)<span class="PreProc"> -> </span>_/eax: (addr _T)
|
||||
<span id="L86" class="LineNr"> 86 </span><span class="PreProc">sig</span> <a href='120allocate.subx.html#L460'>handle-equal?</a> a: (handle _T), b: (handle _T)<span class="PreProc"> -> </span>_/eax: boolean
|
||||
<span id="L87" class="LineNr"> 87 </span><span class="PreProc">sig</span> <a href='120allocate.subx.html#L491'>copy-handle</a> src: (handle _T), dest: (addr handle _T)
|
||||
<span id="L88" class="LineNr"> 88 </span><span class="muComment">#sig allocate-region ad: (addr allocation-descriptor), n: int, out: (addr handle allocation-descriptor)</span>
|
||||
<span id="L89" class="LineNr"> 89 </span><span class="muComment">#sig allocate-array ad: (addr allocation-descriptor), n: int, out: (addr handle _)</span>
|
||||
<span id="L90" class="LineNr"> 90 </span><span class="PreProc">sig</span> <a href='120allocate.subx.html#L702'>copy-array</a> ad: (addr allocation-descriptor), src: (addr array _T), out: (addr handle array _T)
|
||||
<span id="L91" class="LineNr"> 91 </span><span class="muComment">#sig zero-out start: (addr byte), size: int</span>
|
||||
<span id="L92" class="LineNr"> 92 </span><span class="PreProc">sig</span> <a href='123slice.subx.html#L9'>slice-empty?</a> s: (addr slice)<span class="PreProc"> -> </span>_/eax: boolean
|
||||
<span id="L93" class="LineNr"> 93 </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>_/eax: boolean
|
||||
<span id="L94" class="LineNr"> 94 </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>_/eax: boolean
|
||||
<span id="L95" class="LineNr"> 95 </span><span class="PreProc">sig</span> <a href='123slice.subx.html#L793'>write-slice</a> out: (addr stream byte), s: (addr slice)
|
||||
<span id="L96" class="LineNr"> 96 </span><span class="muComment"># bad name alert</span>
|
||||
<span id="L97" class="LineNr"> 97 </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="L98" class="LineNr"> 98 </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="L99" class="LineNr"> 99 </span><span class="PreProc">sig</span> <a href='126write-int-decimal.subx.html#L327'>decimal-digit?</a> c: grapheme<span class="PreProc"> -> </span>_/eax: boolean
|
||||
<span id="L100" class="LineNr">100 </span><span class="PreProc">sig</span> <a href='126write-int-decimal.subx.html#L426'>to-decimal-digit</a> in: grapheme<span class="PreProc"> -> </span>_/eax: int
|
||||
<span id="L101" class="LineNr">101 </span><span class="muComment"># bad name alert</span>
|
||||
<span id="L102" class="LineNr">102 </span><span class="muComment"># next-word really tokenizes</span>
|
||||
<span id="L103" class="LineNr">103 </span><span class="muComment"># next-raw-word really reads whitespace-separated words</span>
|
||||
<span id="L104" class="LineNr">104 </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"># merges '#' comments into a single word</span>
|
||||
<span id="L105" class="LineNr">105 </span><span class="PreProc">sig</span> <a href='127next-word.subx.html#L321'>next-raw-word</a> line: (addr stream byte), out: (addr slice) <span class="muComment"># does not merge '#' comments</span>
|
||||
<span id="L106" class="LineNr">106 </span><span class="PreProc">sig</span> <a href='124next-token.subx.html#L188'>skip-chars-matching</a> in: (addr stream byte), delimiter: byte
|
||||
<span id="L107" class="LineNr">107 </span><span class="PreProc">sig</span> <a href='124next-token.subx.html#L311'>skip-chars-matching-whitespace</a> in: (addr stream byte)
|
||||
<span id="L108" class="LineNr">108 </span><span class="PreProc">sig</span> <a href='124next-token.subx.html#L401'>skip-chars-not-matching</a> in: (addr stream byte), delimiter: byte
|
||||
<span id="L109" class="LineNr">109 </span><span class="PreProc">sig</span> <a href='124next-token.subx.html#L563'>skip-chars-not-matching-whitespace</a> in: (addr stream byte)
|
||||
<span id="L110" class="LineNr">110 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L6'>stream-empty?</a> s: (addr stream _)<span class="PreProc"> -> </span>_/eax: boolean
|
||||
<span id="L111" class="LineNr">111 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L30'>stream-full?</a> s: (addr stream _)<span class="PreProc"> -> </span>_/eax: boolean
|
||||
<span id="L112" class="LineNr">112 </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="L113" class="LineNr">113 </span><span class="PreProc">sig</span> <a href='310copy-bytes.subx.html#L124'>unquote-stream-to-array</a> in: (addr stream _), out: (addr handle array _)
|
||||
<span id="L114" class="LineNr">114 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L154'>stream-first</a> s: (addr stream byte)<span class="PreProc"> -> </span>_/eax: byte
|
||||
<span id="L115" class="LineNr">115 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L181'>stream-final</a> s: (addr stream byte)<span class="PreProc"> -> </span>_/eax: byte
|
||||
<span id="L116" class="LineNr">116 </span>
|
||||
<span id="L117" class="LineNr">117 </span><span class="muComment">#sig copy-bytes src: (addr byte), dest: (addr byte), n: int</span>
|
||||
<span id="L118" class="LineNr">118 </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="L119" class="LineNr">119 </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>_/eax: boolean
|
||||
<span id="L120" class="LineNr">120 </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="L121" class="LineNr">121 </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="L122" class="LineNr">122 </span><span class="PreProc">sig</span> <a href='301array-equal.subx.html#L382'>check-array-equal</a> a: (addr array int), expected: (addr array byte), msg: (addr array byte)
|
||||
<span id="L123" class="LineNr">123 </span>
|
||||
<span id="L124" class="LineNr">124 </span><span class="PreProc">sig</span> <a href='314divide.subx.html#L3'>integer-divide</a> a: int, b: int<span class="PreProc"> -> </span>_/eax: int, _/<span class="muRegEdx">edx</span>: int
|
||||
<span id="L68" class="LineNr"> 68 </span><span class="PreProc">sig</span> <a href='115write-byte.subx.html#L79'>undo-append-byte</a> f: (addr stream byte) <span class="muComment"># take most recent append back out</span>
|
||||
<span id="L69" class="LineNr"> 69 </span><span class="muComment">#sig to-hex-char in/eax: int -> out/eax: int</span>
|
||||
<span id="L70" class="LineNr"> 70 </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="L71" class="LineNr"> 71 </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="L72" class="LineNr"> 72 </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="L73" class="LineNr"> 73 </span><span class="PreProc">sig</span> <a href='118parse-hex-int.subx.html#L9'>hex-int?</a> in: (addr slice)<span class="PreProc"> -> </span>_/eax: boolean
|
||||
<span id="L74" class="LineNr"> 74 </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>_/eax: int
|
||||
<span id="L75" class="LineNr"> 75 </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>_/eax: int
|
||||
<span id="L76" class="LineNr"> 76 </span><span class="muComment">#sig parse-hex-int-helper start: (addr byte), end: (addr byte) -> _/eax: int</span>
|
||||
<span id="L77" class="LineNr"> 77 </span><span class="PreProc">sig</span> <a href='118parse-hex-int.subx.html#L701'>hex-digit?</a> c: byte<span class="PreProc"> -> </span>_/eax: boolean
|
||||
<span id="L78" class="LineNr"> 78 </span><span class="muComment">#sig from-hex-char in/eax: byte -> out/eax: nibble</span>
|
||||
<span id="L79" class="LineNr"> 79 </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>_/eax: int
|
||||
<span id="L80" class="LineNr"> 80 </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>_/eax: int
|
||||
<span id="L81" class="LineNr"> 81 </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>_/eax: int
|
||||
<span id="L82" class="LineNr"> 82 </span><span class="muComment">#sig parse-decimal-int-helper start: (addr byte), end: (addr byte) -> _/eax: int</span>
|
||||
<span id="L83" class="LineNr"> 83 </span><span class="PreProc">sig</span> <a href='311decimal-int.subx.html#L312'>decimal-size</a> n: int<span class="PreProc"> -> </span>_/eax: int
|
||||
<span id="L84" class="LineNr"> 84 </span><span class="muComment">#sig allocate ad: (addr allocation-descriptor), n: int, out: (addr handle _)</span>
|
||||
<span id="L85" class="LineNr"> 85 </span><span class="muComment">#sig allocate-raw ad: (addr allocation-descriptor), n: int, out: (addr handle _)</span>
|
||||
<span id="L86" class="LineNr"> 86 </span><span class="PreProc">sig</span> <a href='120allocate.subx.html#L235'>lookup</a> h: (handle _T)<span class="PreProc"> -> </span>_/eax: (addr _T)
|
||||
<span id="L87" class="LineNr"> 87 </span><span class="PreProc">sig</span> <a href='120allocate.subx.html#L460'>handle-equal?</a> a: (handle _T), b: (handle _T)<span class="PreProc"> -> </span>_/eax: boolean
|
||||
<span id="L88" class="LineNr"> 88 </span><span class="PreProc">sig</span> <a href='120allocate.subx.html#L491'>copy-handle</a> src: (handle _T), dest: (addr handle _T)
|
||||
<span id="L89" class="LineNr"> 89 </span><span class="muComment">#sig allocate-region ad: (addr allocation-descriptor), n: int, out: (addr handle allocation-descriptor)</span>
|
||||
<span id="L90" class="LineNr"> 90 </span><span class="muComment">#sig allocate-array ad: (addr allocation-descriptor), n: int, out: (addr handle _)</span>
|
||||
<span id="L91" class="LineNr"> 91 </span><span class="PreProc">sig</span> <a href='120allocate.subx.html#L702'>copy-array</a> ad: (addr allocation-descriptor), src: (addr array _T), out: (addr handle array _T)
|
||||
<span id="L92" class="LineNr"> 92 </span><span class="muComment">#sig zero-out start: (addr byte), size: int</span>
|
||||
<span id="L93" class="LineNr"> 93 </span><span class="PreProc">sig</span> <a href='123slice.subx.html#L9'>slice-empty?</a> s: (addr slice)<span class="PreProc"> -> </span>_/eax: boolean
|
||||
<span id="L94" class="LineNr"> 94 </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>_/eax: boolean
|
||||
<span id="L95" class="LineNr"> 95 </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>_/eax: boolean
|
||||
<span id="L96" class="LineNr"> 96 </span><span class="PreProc">sig</span> <a href='123slice.subx.html#L793'>write-slice</a> out: (addr stream byte), s: (addr slice)
|
||||
<span id="L97" class="LineNr"> 97 </span><span class="muComment"># bad name alert</span>
|
||||
<span id="L98" class="LineNr"> 98 </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="L99" class="LineNr"> 99 </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="L100" class="LineNr">100 </span><span class="PreProc">sig</span> <a href='126write-int-decimal.subx.html#L327'>decimal-digit?</a> c: code-point-utf8<span class="PreProc"> -> </span>_/eax: boolean
|
||||
<span id="L101" class="LineNr">101 </span><span class="PreProc">sig</span> <a href='126write-int-decimal.subx.html#L426'>to-decimal-digit</a> in: code-point-utf8<span class="PreProc"> -> </span>_/eax: int
|
||||
<span id="L102" class="LineNr">102 </span><span class="muComment"># bad name alert</span>
|
||||
<span id="L103" class="LineNr">103 </span><span class="muComment"># next-word really tokenizes</span>
|
||||
<span id="L104" class="LineNr">104 </span><span class="muComment"># next-raw-word really reads whitespace-separated words</span>
|
||||
<span id="L105" class="LineNr">105 </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"># merges '#' comments into a single word</span>
|
||||
<span id="L106" class="LineNr">106 </span><span class="PreProc">sig</span> <a href='127next-word.subx.html#L321'>next-raw-word</a> line: (addr stream byte), out: (addr slice) <span class="muComment"># does not merge '#' comments</span>
|
||||
<span id="L107" class="LineNr">107 </span><span class="PreProc">sig</span> <a href='124next-token.subx.html#L188'>skip-chars-matching</a> in: (addr stream byte), delimiter: byte
|
||||
<span id="L108" class="LineNr">108 </span><span class="PreProc">sig</span> <a href='124next-token.subx.html#L311'>skip-chars-matching-whitespace</a> in: (addr stream byte)
|
||||
<span id="L109" class="LineNr">109 </span><span class="PreProc">sig</span> <a href='124next-token.subx.html#L401'>skip-chars-not-matching</a> in: (addr stream byte), delimiter: byte
|
||||
<span id="L110" class="LineNr">110 </span><span class="PreProc">sig</span> <a href='124next-token.subx.html#L563'>skip-chars-not-matching-whitespace</a> in: (addr stream byte)
|
||||
<span id="L111" class="LineNr">111 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L6'>stream-empty?</a> s: (addr stream _)<span class="PreProc"> -> </span>_/eax: boolean
|
||||
<span id="L112" class="LineNr">112 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L30'>stream-full?</a> s: (addr stream _)<span class="PreProc"> -> </span>_/eax: boolean
|
||||
<span id="L113" class="LineNr">113 </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="L114" class="LineNr">114 </span><span class="PreProc">sig</span> <a href='310copy-bytes.subx.html#L124'>unquote-stream-to-array</a> in: (addr stream _), out: (addr handle array _)
|
||||
<span id="L115" class="LineNr">115 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L154'>stream-first</a> s: (addr stream byte)<span class="PreProc"> -> </span>_/eax: byte
|
||||
<span id="L116" class="LineNr">116 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L181'>stream-final</a> s: (addr stream byte)<span class="PreProc"> -> </span>_/eax: byte
|
||||
<span id="L117" class="LineNr">117 </span>
|
||||
<span id="L118" class="LineNr">118 </span><span class="muComment">#sig copy-bytes src: (addr byte), dest: (addr byte), n: int</span>
|
||||
<span id="L119" class="LineNr">119 </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="L120" class="LineNr">120 </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>_/eax: boolean
|
||||
<span id="L121" class="LineNr">121 </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="L122" class="LineNr">122 </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="L123" class="LineNr">123 </span><span class="PreProc">sig</span> <a href='301array-equal.subx.html#L382'>check-array-equal</a> a: (addr array int), expected: (addr array byte), msg: (addr array byte)
|
||||
<span id="L124" class="LineNr">124 </span>
|
||||
<span id="L125" class="LineNr">125 </span><span class="PreProc">sig</span> <a href='314divide.subx.html#L3'>integer-divide</a> a: int, b: int<span class="PreProc"> -> </span>_/eax: int, _/<span class="muRegEdx">edx</span>: int
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -64,360 +64,410 @@ if ('onhashchange' in window) {
|
|||
<pre id='vimCodeElement'>
|
||||
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># Helpers for Unicode.</span>
|
||||
<span id="L2" class="LineNr"> 2 </span><span class="muComment">#</span>
|
||||
<span id="L3" class="LineNr"> 3 </span><span class="muComment"># Mu has no characters, only code points and graphemes.</span>
|
||||
<span id="L4" class="LineNr"> 4 </span><span class="muComment"># Code points are the indivisible atoms of text streams.</span>
|
||||
<span id="L5" class="LineNr"> 5 </span><span class="muComment"># <a href="https://en.wikipedia.org/wiki/Code_point">https://en.wikipedia.org/wiki/Code_point</a></span>
|
||||
<span id="L6" class="LineNr"> 6 </span><span class="muComment"># Graphemes are the smallest self-contained unit of text.</span>
|
||||
<span id="L7" class="LineNr"> 7 </span><span class="muComment"># Graphemes may consist of multiple code points.</span>
|
||||
<span id="L8" class="LineNr"> 8 </span><span class="muComment">#</span>
|
||||
<span id="L9" class="LineNr"> 9 </span><span class="muComment"># Mu graphemes are always represented in utf-8, and they are required to fit</span>
|
||||
<span id="L10" class="LineNr"> 10 </span><span class="muComment"># in 4 bytes. (This can be confusing if you focus just on ASCII, where Mu's</span>
|
||||
<span id="L11" class="LineNr"> 11 </span><span class="muComment"># graphemes and code-points are identical.)</span>
|
||||
<span id="L12" class="LineNr"> 12 </span><span class="muComment">#</span>
|
||||
<span id="L13" class="LineNr"> 13 </span><span class="muComment"># Mu doesn't currently support combining code points, or graphemes made of</span>
|
||||
<span id="L14" class="LineNr"> 14 </span><span class="muComment"># multiple code points. One day we will.</span>
|
||||
<span id="L15" class="LineNr"> 15 </span><span class="muComment"># <a href="https://en.wikipedia.org/wiki/Combining_character">https://en.wikipedia.org/wiki/Combining_character</a></span>
|
||||
<span id="L16" class="LineNr"> 16 </span>
|
||||
<span id="L17" class="LineNr"> 17 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L17'>test-unicode-serialization-and-deserialization</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L18" class="LineNr"> 18 </span> <span class="PreProc">var</span> i/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L19" class="LineNr"> 19 </span> <span class="PreProc">var</span> init?/<span class="muRegEsi">esi</span>: boolean <span class="Special"><-</span> copy <span class="Constant">1</span>/true
|
||||
<span id="L20" class="LineNr"> 20 </span> <span class="Delimiter">{</span>
|
||||
<span id="L21" class="LineNr"> 21 </span> compare i, <span class="Constant">0x10000</span> <span class="muComment"># 32 bits of utf-8 are sufficient for <a href="https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_Multilingual_Plane">https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_Multilingual_Plane</a></span>
|
||||
<span id="L22" class="LineNr"> 22 </span> <span class="muComment"># but not emoji</span>
|
||||
<span id="L23" class="LineNr"> 23 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L24" class="LineNr"> 24 </span> <span class="PreProc">var</span> c/eax: code-point <span class="Special"><-</span> copy i
|
||||
<span id="L25" class="LineNr"> 25 </span> <span class="PreProc">var</span> _g/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L104'>to-grapheme</a> c
|
||||
<span id="L26" class="LineNr"> 26 </span> <span class="PreProc">var</span> g/<span class="muRegEcx">ecx</span>: grapheme <span class="Special"><-</span> copy _g
|
||||
<span id="L27" class="LineNr"> 27 </span> <span class="PreProc">var</span> c2/eax: code-point <span class="Special"><-</span> <a href='403unicode.mu.html#L56'>to-code-point</a> g
|
||||
<span id="L28" class="LineNr"> 28 </span> compare i, c2
|
||||
<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="Delimiter">{</span>
|
||||
<span id="L32" class="LineNr"> 32 </span> compare init?, <span class="Constant">0</span>/false
|
||||
<span id="L33" class="LineNr"> 33 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L34" class="LineNr"> 34 </span> <a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">"F - <a href='403unicode.mu.html#L17'>test-unicode-serialization-and-deserialization</a>: "</span>, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L3" class="LineNr"> 3 </span><span class="muComment"># The basic unit for rendering Unicode is the code point.</span>
|
||||
<span id="L4" class="LineNr"> 4 </span><span class="muComment"># <a href="https://en.wikipedia.org/wiki/Code_point">https://en.wikipedia.org/wiki/Code_point</a></span>
|
||||
<span id="L5" class="LineNr"> 5 </span><span class="muComment"># The glyph a non-cursive font displays may represent multiple code points.</span>
|
||||
<span id="L6" class="LineNr"> 6 </span><span class="muComment">#</span>
|
||||
<span id="L7" class="LineNr"> 7 </span><span class="muComment"># In addition to raw code points (just integers assigned special meaning), Mu</span>
|
||||
<span id="L8" class="LineNr"> 8 </span><span class="muComment"># provides a common encoding as a convenience: code-point-utf8.</span>
|
||||
<span id="L9" class="LineNr"> 9 </span>
|
||||
<span id="L10" class="LineNr"> 10 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L10'>test-unicode-serialization-and-deserialization</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L11" class="LineNr"> 11 </span> <span class="PreProc">var</span> i/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L12" class="LineNr"> 12 </span> <span class="PreProc">var</span> init?/<span class="muRegEsi">esi</span>: boolean <span class="Special"><-</span> copy <span class="Constant">1</span>/true
|
||||
<span id="L13" class="LineNr"> 13 </span> <span class="Delimiter">{</span>
|
||||
<span id="L14" class="LineNr"> 14 </span> compare i, <span class="Constant">0x10000</span> <span class="muComment"># 32 bits of utf-8 are sufficient for <a href="https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_Multilingual_Plane">https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_Multilingual_Plane</a></span>
|
||||
<span id="L15" class="LineNr"> 15 </span> <span class="muComment"># but not emoji</span>
|
||||
<span id="L16" class="LineNr"> 16 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L17" class="LineNr"> 17 </span> <span class="PreProc">var</span> c/eax: code-point <span class="Special"><-</span> copy i
|
||||
<span id="L18" class="LineNr"> 18 </span> <span class="PreProc">var</span> _g/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L97'>to-utf8</a> c
|
||||
<span id="L19" class="LineNr"> 19 </span> <span class="PreProc">var</span> g/<span class="muRegEcx">ecx</span>: code-point-utf8 <span class="Special"><-</span> copy _g
|
||||
<span id="L20" class="LineNr"> 20 </span> <span class="PreProc">var</span> c2/eax: code-point <span class="Special"><-</span> <a href='403unicode.mu.html#L49'>to-code-point</a> g
|
||||
<span id="L21" class="LineNr"> 21 </span> compare i, c2
|
||||
<span id="L22" class="LineNr"> 22 </span> <span class="Delimiter">{</span>
|
||||
<span id="L23" class="LineNr"> 23 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L24" class="LineNr"> 24 </span> <span class="Delimiter">{</span>
|
||||
<span id="L25" class="LineNr"> 25 </span> compare init?, <span class="Constant">0</span>/false
|
||||
<span id="L26" class="LineNr"> 26 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L27" class="LineNr"> 27 </span> <a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">"F - <a href='403unicode.mu.html#L10'>test-unicode-serialization-and-deserialization</a>: "</span>, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L28" class="LineNr"> 28 </span> <span class="Delimiter">}</span>
|
||||
<span id="L29" class="LineNr"> 29 </span> init? <span class="Special"><-</span> copy <span class="Constant">0</span>/false
|
||||
<span id="L30" class="LineNr"> 30 </span> <a href='501draw-text.mu.html#L387'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, i, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L31" class="LineNr"> 31 </span> <a href='501draw-text.mu.html#L332'>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 <span class="Constant">0</span>/bg
|
||||
<span id="L32" class="LineNr"> 32 </span> <span class="Delimiter">{</span>
|
||||
<span id="L33" class="LineNr"> 33 </span> <span class="PreProc">var</span> x/eax: int <span class="Special"><-</span> copy g
|
||||
<span id="L34" class="LineNr"> 34 </span> <a href='501draw-text.mu.html#L387'>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 <span class="Constant">0</span>/bg
|
||||
<span id="L35" class="LineNr"> 35 </span> <span class="Delimiter">}</span>
|
||||
<span id="L36" class="LineNr"> 36 </span> init? <span class="Special"><-</span> copy <span class="Constant">0</span>/false
|
||||
<span id="L37" class="LineNr"> 37 </span> <a href='501draw-text.mu.html#L394'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, i, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L38" class="LineNr"> 38 </span> <a href='501draw-text.mu.html#L339'>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 <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">var</span> x/eax: int <span class="Special"><-</span> copy g
|
||||
<span id="L41" class="LineNr"> 41 </span> <a href='501draw-text.mu.html#L394'>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 <span class="Constant">0</span>/bg
|
||||
<span id="L42" class="LineNr"> 42 </span> <span class="Delimiter">}</span>
|
||||
<span id="L43" class="LineNr"> 43 </span> <a href='501draw-text.mu.html#L339'>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 <span class="Constant">0</span>/bg
|
||||
<span id="L44" class="LineNr"> 44 </span> <span class="Delimiter">{</span>
|
||||
<span id="L45" class="LineNr"> 45 </span> <span class="PreProc">var</span> x2/eax: int <span class="Special"><-</span> copy c2
|
||||
<span id="L46" class="LineNr"> 46 </span> <a href='501draw-text.mu.html#L394'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, x2, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L47" class="LineNr"> 47 </span> <span class="Delimiter">}</span>
|
||||
<span id="L48" class="LineNr"> 48 </span> <a href='501draw-text.mu.html#L339'>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 <span class="Constant">0</span>/bg
|
||||
<span id="L49" class="LineNr"> 49 </span> <span class="Delimiter">}</span>
|
||||
<span id="L50" class="LineNr"> 50 </span> i <span class="Special"><-</span> add <span class="Constant">0xf</span> <span class="muComment"># to speed things up; ensure increment is not a power of 2</span>
|
||||
<span id="L51" class="LineNr"> 51 </span> <span class="PreProc">loop</span>
|
||||
<span id="L52" class="LineNr"> 52 </span> <span class="Delimiter">}</span>
|
||||
<span id="L53" class="LineNr"> 53 </span><span class="Delimiter">}</span>
|
||||
<span id="L54" class="LineNr"> 54 </span>
|
||||
<span id="L55" class="LineNr"> 55 </span><span class="muComment"># transliterated from tb_utf8_char_to_unicode in <a href="https://github.com/nsf/termbox">https://github.com/nsf/termbox</a></span>
|
||||
<span id="L56" class="LineNr"> 56 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='403unicode.mu.html#L56'>to-code-point</a></span> in: grapheme<span class="PreProc"> -> </span>_/eax: code-point <span class="Delimiter">{</span>
|
||||
<span id="L57" class="LineNr"> 57 </span> <span class="PreProc">var</span> g/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> copy in
|
||||
<span id="L58" class="LineNr"> 58 </span> <span class="muComment"># if single byte, just return it</span>
|
||||
<span id="L59" class="LineNr"> 59 </span> <span class="Delimiter">{</span>
|
||||
<span id="L60" class="LineNr"> 60 </span> compare g, <span class="Constant">0xff</span>
|
||||
<span id="L61" class="LineNr"> 61 </span> <span class="PreProc">break-if-></span>
|
||||
<span id="L62" class="LineNr"> 62 </span> <span class="PreProc">var</span> result/eax: code-point <span class="Special"><-</span> copy g
|
||||
<span id="L63" class="LineNr"> 63 </span> <span class="PreProc">return</span> result
|
||||
<span id="L64" class="LineNr"> 64 </span> <span class="Delimiter">}</span>
|
||||
<span id="L65" class="LineNr"> 65 </span> <span class="muComment">#</span>
|
||||
<span id="L66" class="LineNr"> 66 </span> <span class="PreProc">var</span> len/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> <a href='403unicode.mu.html#L302'>grapheme-length</a> in
|
||||
<span id="L67" class="LineNr"> 67 </span> <span class="muComment"># extract bits from first byte</span>
|
||||
<span id="L68" class="LineNr"> 68 </span> <span class="PreProc">var</span> b/eax: byte <span class="Special"><-</span> copy-byte g
|
||||
<span id="L69" class="LineNr"> 69 </span> <span class="PreProc">var</span> result/<span class="muRegEdi">edi</span>: code-point <span class="Special"><-</span> copy b
|
||||
<span id="L70" class="LineNr"> 70 </span> <span class="Delimiter">{</span>
|
||||
<span id="L71" class="LineNr"> 71 </span> compare len, <span class="Constant">2</span>
|
||||
<span id="L72" class="LineNr"> 72 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L73" class="LineNr"> 73 </span> result <span class="Special"><-</span> and <span class="Constant">0x1f</span>
|
||||
<span id="L74" class="LineNr"> 74 </span> <span class="Delimiter">}</span>
|
||||
<span id="L75" class="LineNr"> 75 </span> <span class="Delimiter">{</span>
|
||||
<span id="L76" class="LineNr"> 76 </span> compare len, <span class="Constant">3</span>
|
||||
<span id="L77" class="LineNr"> 77 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L78" class="LineNr"> 78 </span> result <span class="Special"><-</span> and <span class="Constant">0x0f</span>
|
||||
<span id="L79" class="LineNr"> 79 </span> <span class="Delimiter">}</span>
|
||||
<span id="L80" class="LineNr"> 80 </span> <span class="Delimiter">{</span>
|
||||
<span id="L81" class="LineNr"> 81 </span> compare len, <span class="Constant">4</span>
|
||||
<span id="L82" class="LineNr"> 82 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L83" class="LineNr"> 83 </span> result <span class="Special"><-</span> and <span class="Constant">0x07</span>
|
||||
<span id="L84" class="LineNr"> 84 </span> <span class="Delimiter">}</span>
|
||||
<span id="L85" class="LineNr"> 85 </span> <span class="muComment"># extract bits from remaining bytes</span>
|
||||
<span id="L86" class="LineNr"> 86 </span> g <span class="Special"><-</span> shift-right <span class="Constant">8</span>
|
||||
<span id="L87" class="LineNr"> 87 </span> <span class="PreProc">var</span> i/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">1</span>
|
||||
<span id="L88" class="LineNr"> 88 </span> <span class="Delimiter">{</span>
|
||||
<span id="L89" class="LineNr"> 89 </span> compare i, len
|
||||
<span id="L90" class="LineNr"> 90 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L91" class="LineNr"> 91 </span> <span class="PreProc">var</span> b/eax: byte <span class="Special"><-</span> copy-byte g
|
||||
<span id="L92" class="LineNr"> 92 </span> b <span class="Special"><-</span> and <span class="Constant">0x3f</span>
|
||||
<span id="L93" class="LineNr"> 93 </span> result <span class="Special"><-</span> shift-left <span class="Constant">6</span>
|
||||
<span id="L94" class="LineNr"> 94 </span> result <span class="Special"><-</span> or b
|
||||
<span id="L95" class="LineNr"> 95 </span> g <span class="Special"><-</span> shift-right <span class="Constant">8</span>
|
||||
<span id="L96" class="LineNr"> 96 </span> i <span class="Special"><-</span> increment
|
||||
<span id="L97" class="LineNr"> 97 </span> <span class="PreProc">loop</span>
|
||||
<span id="L98" class="LineNr"> 98 </span> <span class="Delimiter">}</span>
|
||||
<span id="L99" class="LineNr"> 99 </span> <span class="PreProc">return</span> result
|
||||
<span id="L100" class="LineNr">100 </span><span class="Delimiter">}</span>
|
||||
<span id="L101" class="LineNr">101 </span>
|
||||
<span id="L102" class="LineNr">102 </span><span class="muComment"># transliterated from tb_utf8_unicode_to_char in <a href="https://github.com/nsf/termbox">https://github.com/nsf/termbox</a></span>
|
||||
<span id="L103" class="LineNr">103 </span><span class="muComment"># <a href="https://wiki.tcl-lang.org/page/UTF%2D8+bit+by+bit">https://wiki.tcl-lang.org/page/UTF%2D8+bit+by+bit</a> explains the algorithm</span>
|
||||
<span id="L104" class="LineNr">104 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='403unicode.mu.html#L104'>to-grapheme</a></span> in: code-point<span class="PreProc"> -> </span>_/eax: grapheme <span class="Delimiter">{</span>
|
||||
<span id="L105" class="LineNr">105 </span> <span class="PreProc">var</span> c/eax: int <span class="Special"><-</span> copy in
|
||||
<span id="L106" class="LineNr">106 </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="L107" class="LineNr">107 </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="L108" class="LineNr">108 </span> $to-grapheme:compute-length: <span class="Delimiter">{</span>
|
||||
<span id="L109" class="LineNr">109 </span> <span class="muComment"># single byte: just return it</span>
|
||||
<span id="L110" class="LineNr">110 </span> compare c, <span class="Constant">0x7f</span>
|
||||
<span id="L36" class="LineNr"> 36 </span> <a href='501draw-text.mu.html#L332'>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 <span class="Constant">0</span>/bg
|
||||
<span id="L37" class="LineNr"> 37 </span> <span class="Delimiter">{</span>
|
||||
<span id="L38" class="LineNr"> 38 </span> <span class="PreProc">var</span> x2/eax: int <span class="Special"><-</span> copy c2
|
||||
<span id="L39" class="LineNr"> 39 </span> <a href='501draw-text.mu.html#L387'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, x2, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L40" class="LineNr"> 40 </span> <span class="Delimiter">}</span>
|
||||
<span id="L41" class="LineNr"> 41 </span> <a href='501draw-text.mu.html#L332'>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 <span class="Constant">0</span>/bg
|
||||
<span id="L42" class="LineNr"> 42 </span> <span class="Delimiter">}</span>
|
||||
<span id="L43" class="LineNr"> 43 </span> i <span class="Special"><-</span> add <span class="Constant">0xf</span> <span class="muComment"># to speed things up; ensure increment is not a power of 2</span>
|
||||
<span id="L44" class="LineNr"> 44 </span> <span class="PreProc">loop</span>
|
||||
<span id="L45" class="LineNr"> 45 </span> <span class="Delimiter">}</span>
|
||||
<span id="L46" class="LineNr"> 46 </span><span class="Delimiter">}</span>
|
||||
<span id="L47" class="LineNr"> 47 </span>
|
||||
<span id="L48" class="LineNr"> 48 </span><span class="muComment"># transliterated from tb_utf8_char_to_unicode in <a href="https://github.com/nsf/termbox">https://github.com/nsf/termbox</a></span>
|
||||
<span id="L49" class="LineNr"> 49 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='403unicode.mu.html#L49'>to-code-point</a></span> in: code-point-utf8<span class="PreProc"> -> </span>_/eax: code-point <span class="Delimiter">{</span>
|
||||
<span id="L50" class="LineNr"> 50 </span> <span class="PreProc">var</span> g/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> copy in
|
||||
<span id="L51" class="LineNr"> 51 </span> <span class="muComment"># if single byte, just return it</span>
|
||||
<span id="L52" class="LineNr"> 52 </span> <span class="Delimiter">{</span>
|
||||
<span id="L53" class="LineNr"> 53 </span> compare g, <span class="Constant">0xff</span>
|
||||
<span id="L54" class="LineNr"> 54 </span> <span class="PreProc">break-if-></span>
|
||||
<span id="L55" class="LineNr"> 55 </span> <span class="PreProc">var</span> result/eax: code-point <span class="Special"><-</span> copy g
|
||||
<span id="L56" class="LineNr"> 56 </span> <span class="PreProc">return</span> result
|
||||
<span id="L57" class="LineNr"> 57 </span> <span class="Delimiter">}</span>
|
||||
<span id="L58" class="LineNr"> 58 </span> <span class="muComment">#</span>
|
||||
<span id="L59" class="LineNr"> 59 </span> <span class="PreProc">var</span> len/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> <a href='403unicode.mu.html#L322'>utf8-length</a> in
|
||||
<span id="L60" class="LineNr"> 60 </span> <span class="muComment"># extract bits from first byte</span>
|
||||
<span id="L61" class="LineNr"> 61 </span> <span class="PreProc">var</span> b/eax: byte <span class="Special"><-</span> copy-byte g
|
||||
<span id="L62" class="LineNr"> 62 </span> <span class="PreProc">var</span> result/<span class="muRegEdi">edi</span>: code-point <span class="Special"><-</span> copy b
|
||||
<span id="L63" class="LineNr"> 63 </span> <span class="Delimiter">{</span>
|
||||
<span id="L64" class="LineNr"> 64 </span> compare len, <span class="Constant">2</span>
|
||||
<span id="L65" class="LineNr"> 65 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L66" class="LineNr"> 66 </span> result <span class="Special"><-</span> and <span class="Constant">0x1f</span>
|
||||
<span id="L67" class="LineNr"> 67 </span> <span class="Delimiter">}</span>
|
||||
<span id="L68" class="LineNr"> 68 </span> <span class="Delimiter">{</span>
|
||||
<span id="L69" class="LineNr"> 69 </span> compare len, <span class="Constant">3</span>
|
||||
<span id="L70" class="LineNr"> 70 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L71" class="LineNr"> 71 </span> result <span class="Special"><-</span> and <span class="Constant">0x0f</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> compare len, <span class="Constant">4</span>
|
||||
<span id="L75" class="LineNr"> 75 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L76" class="LineNr"> 76 </span> result <span class="Special"><-</span> and <span class="Constant">0x07</span>
|
||||
<span id="L77" class="LineNr"> 77 </span> <span class="Delimiter">}</span>
|
||||
<span id="L78" class="LineNr"> 78 </span> <span class="muComment"># extract bits from remaining bytes</span>
|
||||
<span id="L79" class="LineNr"> 79 </span> g <span class="Special"><-</span> shift-right <span class="Constant">8</span>
|
||||
<span id="L80" class="LineNr"> 80 </span> <span class="PreProc">var</span> i/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">1</span>
|
||||
<span id="L81" class="LineNr"> 81 </span> <span class="Delimiter">{</span>
|
||||
<span id="L82" class="LineNr"> 82 </span> compare i, len
|
||||
<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> b/eax: byte <span class="Special"><-</span> copy-byte g
|
||||
<span id="L85" class="LineNr"> 85 </span> b <span class="Special"><-</span> and <span class="Constant">0x3f</span>
|
||||
<span id="L86" class="LineNr"> 86 </span> result <span class="Special"><-</span> shift-left <span class="Constant">6</span>
|
||||
<span id="L87" class="LineNr"> 87 </span> result <span class="Special"><-</span> or b
|
||||
<span id="L88" class="LineNr"> 88 </span> g <span class="Special"><-</span> shift-right <span class="Constant">8</span>
|
||||
<span id="L89" class="LineNr"> 89 </span> i <span class="Special"><-</span> increment
|
||||
<span id="L90" class="LineNr"> 90 </span> <span class="PreProc">loop</span>
|
||||
<span id="L91" class="LineNr"> 91 </span> <span class="Delimiter">}</span>
|
||||
<span id="L92" class="LineNr"> 92 </span> <span class="PreProc">return</span> result
|
||||
<span id="L93" class="LineNr"> 93 </span><span class="Delimiter">}</span>
|
||||
<span id="L94" class="LineNr"> 94 </span>
|
||||
<span id="L95" class="LineNr"> 95 </span><span class="muComment"># transliterated from tb_utf8_unicode_to_char in <a href="https://github.com/nsf/termbox">https://github.com/nsf/termbox</a></span>
|
||||
<span id="L96" class="LineNr"> 96 </span><span class="muComment"># <a href="https://wiki.tcl-lang.org/page/UTF%2D8+bit+by+bit">https://wiki.tcl-lang.org/page/UTF%2D8+bit+by+bit</a> explains the algorithm</span>
|
||||
<span id="L97" class="LineNr"> 97 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='403unicode.mu.html#L97'>to-utf8</a></span> in: code-point<span class="PreProc"> -> </span>_/eax: code-point-utf8 <span class="Delimiter">{</span>
|
||||
<span id="L98" class="LineNr"> 98 </span> <span class="PreProc">var</span> c/eax: int <span class="Special"><-</span> copy in
|
||||
<span id="L99" class="LineNr"> 99 </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="L100" class="LineNr">100 </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="L101" class="LineNr">101 </span> $to-utf8:compute-length: <span class="Delimiter">{</span>
|
||||
<span id="L102" class="LineNr">102 </span> <span class="muComment"># single byte: just return it</span>
|
||||
<span id="L103" class="LineNr">103 </span> compare c, <span class="Constant">0x7f</span>
|
||||
<span id="L104" class="LineNr">104 </span> <span class="Delimiter">{</span>
|
||||
<span id="L105" class="LineNr">105 </span> <span class="PreProc">break-if-></span>
|
||||
<span id="L106" class="LineNr">106 </span> <span class="PreProc">var</span> g/eax: code-point-utf8 <span class="Special"><-</span> copy c
|
||||
<span id="L107" class="LineNr">107 </span> <span class="PreProc">return</span> g
|
||||
<span id="L108" class="LineNr">108 </span> <span class="Delimiter">}</span>
|
||||
<span id="L109" class="LineNr">109 </span> <span class="muComment"># 2 bytes</span>
|
||||
<span id="L110" class="LineNr">110 </span> compare c, <span class="Constant">0x7ff</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/eax: 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>
|
||||
<span id="L117" class="LineNr">117 </span> compare c, <span class="Constant">0x7ff</span>
|
||||
<span id="L118" class="LineNr">118 </span> <span class="Delimiter">{</span>
|
||||
<span id="L119" class="LineNr">119 </span> <span class="PreProc">break-if-></span>
|
||||
<span id="L120" class="LineNr">120 </span> num-trailers <span class="Special"><-</span> copy <span class="Constant">1</span>
|
||||
<span id="L121" class="LineNr">121 </span> first <span class="Special"><-</span> copy <span class="Constant">0xc0</span>
|
||||
<span id="L122" class="LineNr">122 </span> <span class="PreProc">break</span> $to-grapheme:compute-length
|
||||
<span id="L123" class="LineNr">123 </span> <span class="Delimiter">}</span>
|
||||
<span id="L124" class="LineNr">124 </span> <span class="muComment"># 3 bytes</span>
|
||||
<span id="L125" class="LineNr">125 </span> compare c, <span class="Constant">0xffff</span>
|
||||
<span id="L126" class="LineNr">126 </span> <span class="Delimiter">{</span>
|
||||
<span id="L127" class="LineNr">127 </span> <span class="PreProc">break-if-></span>
|
||||
<span id="L128" class="LineNr">128 </span> num-trailers <span class="Special"><-</span> copy <span class="Constant">2</span>
|
||||
<span id="L129" class="LineNr">129 </span> first <span class="Special"><-</span> copy <span class="Constant">0xe0</span>
|
||||
<span id="L130" class="LineNr">130 </span> <span class="PreProc">break</span> $to-grapheme:compute-length
|
||||
<span id="L131" class="LineNr">131 </span> <span class="Delimiter">}</span>
|
||||
<span id="L132" class="LineNr">132 </span> <span class="muComment"># 4 bytes</span>
|
||||
<span id="L133" class="LineNr">133 </span> compare c, <span class="Constant">0x1fffff</span>
|
||||
<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> num-trailers <span class="Special"><-</span> copy <span class="Constant">3</span>
|
||||
<span id="L137" class="LineNr">137 </span> first <span class="Special"><-</span> copy <span class="Constant">0xf0</span>
|
||||
<span id="L138" class="LineNr">138 </span> <span class="PreProc">break</span> $to-grapheme:compute-length
|
||||
<span id="L113" class="LineNr">113 </span> num-trailers <span class="Special"><-</span> copy <span class="Constant">1</span>
|
||||
<span id="L114" class="LineNr">114 </span> first <span class="Special"><-</span> copy <span class="Constant">0xc0</span>
|
||||
<span id="L115" class="LineNr">115 </span> <span class="PreProc">break</span> $to-utf8:compute-length
|
||||
<span id="L116" class="LineNr">116 </span> <span class="Delimiter">}</span>
|
||||
<span id="L117" class="LineNr">117 </span> <span class="muComment"># 3 bytes</span>
|
||||
<span id="L118" class="LineNr">118 </span> compare c, <span class="Constant">0xffff</span>
|
||||
<span id="L119" class="LineNr">119 </span> <span class="Delimiter">{</span>
|
||||
<span id="L120" class="LineNr">120 </span> <span class="PreProc">break-if-></span>
|
||||
<span id="L121" class="LineNr">121 </span> num-trailers <span class="Special"><-</span> copy <span class="Constant">2</span>
|
||||
<span id="L122" class="LineNr">122 </span> first <span class="Special"><-</span> copy <span class="Constant">0xe0</span>
|
||||
<span id="L123" class="LineNr">123 </span> <span class="PreProc">break</span> $to-utf8:compute-length
|
||||
<span id="L124" class="LineNr">124 </span> <span class="Delimiter">}</span>
|
||||
<span id="L125" class="LineNr">125 </span> <span class="muComment"># 4 bytes</span>
|
||||
<span id="L126" class="LineNr">126 </span> compare c, <span class="Constant">0x1fffff</span>
|
||||
<span id="L127" class="LineNr">127 </span> <span class="Delimiter">{</span>
|
||||
<span id="L128" class="LineNr">128 </span> <span class="PreProc">break-if-></span>
|
||||
<span id="L129" class="LineNr">129 </span> num-trailers <span class="Special"><-</span> copy <span class="Constant">3</span>
|
||||
<span id="L130" class="LineNr">130 </span> first <span class="Special"><-</span> copy <span class="Constant">0xf0</span>
|
||||
<span id="L131" class="LineNr">131 </span> <span class="PreProc">break</span> $to-utf8:compute-length
|
||||
<span id="L132" class="LineNr">132 </span> <span class="Delimiter">}</span>
|
||||
<span id="L133" class="LineNr">133 </span> <span class="muComment"># more than 4 bytes: unsupported</span>
|
||||
<span id="L134" class="LineNr">134 </span> compare c, <span class="Constant">0x1fffff</span>
|
||||
<span id="L135" class="LineNr">135 </span> <span class="Delimiter">{</span>
|
||||
<span id="L136" class="LineNr">136 </span> <span class="PreProc">break-if-></span>
|
||||
<span id="L137" class="LineNr">137 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">"unsupported code point"</span>
|
||||
<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"># more than 4 bytes: unsupported</span>
|
||||
<span id="L141" class="LineNr">141 </span> <span class="muComment"># TODO: print error message to stderr</span>
|
||||
<span id="L142" class="LineNr">142 </span> compare c, <span class="Constant">0x1fffff</span>
|
||||
<span id="L143" class="LineNr">143 </span> <span class="Delimiter">{</span>
|
||||
<span id="L144" class="LineNr">144 </span> <span class="PreProc">break-if-></span>
|
||||
<span id="L145" class="LineNr">145 </span> <span class="PreProc">return</span> <span class="Constant">0</span>
|
||||
<span id="L146" class="LineNr">146 </span> <span class="Delimiter">}</span>
|
||||
<span id="L147" class="LineNr">147 </span> <span class="Delimiter">}</span>
|
||||
<span id="L148" class="LineNr">148 </span> <span class="muComment"># emit trailer bytes, 6 bits from 'in', first two bits '10'</span>
|
||||
<span id="L149" class="LineNr">149 </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="L150" class="LineNr">150 </span> <span class="Delimiter">{</span>
|
||||
<span id="L151" class="LineNr">151 </span> compare num-trailers, <span class="Constant">0</span>
|
||||
<span id="L152" class="LineNr">152 </span> <span class="PreProc">break-if-<=</span>
|
||||
<span id="L153" class="LineNr">153 </span> <span class="PreProc">var</span> tmp/<span class="muRegEsi">esi</span>: int <span class="Special"><-</span> copy c
|
||||
<span id="L154" class="LineNr">154 </span> tmp <span class="Special"><-</span> and <span class="Constant">0x3f</span>
|
||||
<span id="L155" class="LineNr">155 </span> tmp <span class="Special"><-</span> or <span class="Constant">0x80</span>
|
||||
<span id="L156" class="LineNr">156 </span> result <span class="Special"><-</span> shift-left <span class="Constant">8</span>
|
||||
<span id="L157" class="LineNr">157 </span> result <span class="Special"><-</span> or tmp
|
||||
<span id="L158" class="LineNr">158 </span> <span class="muComment"># update loop state</span>
|
||||
<span id="L159" class="LineNr">159 </span> c <span class="Special"><-</span> shift-right <span class="Constant">6</span>
|
||||
<span id="L160" class="LineNr">160 </span> num-trailers <span class="Special"><-</span> decrement
|
||||
<span id="L161" class="LineNr">161 </span> <span class="PreProc">loop</span>
|
||||
<span id="L162" class="LineNr">162 </span> <span class="Delimiter">}</span>
|
||||
<span id="L163" class="LineNr">163 </span> <span class="muComment"># emit engine</span>
|
||||
<span id="L164" class="LineNr">164 </span> result <span class="Special"><-</span> shift-left <span class="Constant">8</span>
|
||||
<span id="L165" class="LineNr">165 </span> result <span class="Special"><-</span> or c
|
||||
<span id="L166" class="LineNr">166 </span> result <span class="Special"><-</span> or first
|
||||
<span id="L167" class="LineNr">167 </span> <span class="muComment">#</span>
|
||||
<span id="L168" class="LineNr">168 </span> <span class="PreProc">return</span> result
|
||||
<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="muComment"># single-byte code point have identical graphemes</span>
|
||||
<span id="L172" class="LineNr">172 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L172'>test-to-grapheme-single-byte</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L173" class="LineNr">173 </span> <span class="PreProc">var</span> in-int/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L174" class="LineNr">174 </span> <span class="Delimiter">{</span>
|
||||
<span id="L175" class="LineNr">175 </span> compare in-int, <span class="Constant">0x7f</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> in/eax: code-point <span class="Special"><-</span> copy in-int
|
||||
<span id="L178" class="LineNr">178 </span> <span class="PreProc">var</span> out/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L104'>to-grapheme</a> in
|
||||
<span id="L179" class="LineNr">179 </span> <span class="PreProc">var</span> out-int/eax: int <span class="Special"><-</span> copy out
|
||||
<span id="L180" class="LineNr">180 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> out-int, in-int, <span class="Constant">"F - test-to-grapheme-single-byte"</span>
|
||||
<span id="L181" class="LineNr">181 </span> in-int <span class="Special"><-</span> increment
|
||||
<span id="L182" class="LineNr">182 </span> <span class="PreProc">loop</span>
|
||||
<span id="L183" class="LineNr">183 </span> <span class="Delimiter">}</span>
|
||||
<span id="L184" class="LineNr">184 </span><span class="Delimiter">}</span>
|
||||
<span id="L185" class="LineNr">185 </span>
|
||||
<span id="L186" class="LineNr">186 </span> <span class="muComment"># byte | byte | byte | byte</span>
|
||||
<span id="L187" class="LineNr">187 </span><span class="muComment"># smallest 2-byte utf-8</span>
|
||||
<span id="L188" class="LineNr">188 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L188'>test-to-grapheme-two-bytes-min</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L189" class="LineNr">189 </span> <span class="PreProc">var</span> in/eax: code-point <span class="Special"><-</span> copy <span class="Constant">0x80</span> <span class="muComment"># 10 00-0000</span>
|
||||
<span id="L190" class="LineNr">190 </span> <span class="PreProc">var</span> out/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L104'>to-grapheme</a> in
|
||||
<span id="L191" class="LineNr">191 </span> <span class="PreProc">var</span> out-int/eax: int <span class="Special"><-</span> copy out
|
||||
<span id="L192" class="LineNr">192 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> out-int, <span class="Constant">0x80c2</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L104'>to-grapheme</a>/2a"</span> <span class="muComment"># 110 0-0010 10 00-0000</span>
|
||||
<span id="L193" class="LineNr">193 </span><span class="Delimiter">}</span>
|
||||
<span id="L194" class="LineNr">194 </span>
|
||||
<span id="L195" class="LineNr">195 </span><span class="muComment"># largest 2-byte utf-8</span>
|
||||
<span id="L196" class="LineNr">196 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L196'>test-to-grapheme-two-bytes-max</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L197" class="LineNr">197 </span> <span class="PreProc">var</span> in/eax: code-point <span class="Special"><-</span> copy <span class="Constant">0x7ff</span> <span class="muComment"># 1-1111 11-1111</span>
|
||||
<span id="L198" class="LineNr">198 </span> <span class="PreProc">var</span> out/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L104'>to-grapheme</a> in
|
||||
<span id="L199" class="LineNr">199 </span> <span class="PreProc">var</span> out-int/eax: int <span class="Special"><-</span> copy out
|
||||
<span id="L200" class="LineNr">200 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> out-int, <span class="Constant">0xbfdf</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L104'>to-grapheme</a>/2b"</span> <span class="muComment"># 110 1-1111 10 11-1111</span>
|
||||
<span id="L201" class="LineNr">201 </span><span class="Delimiter">}</span>
|
||||
<span id="L202" class="LineNr">202 </span>
|
||||
<span id="L203" class="LineNr">203 </span><span class="muComment"># smallest 3-byte utf-8</span>
|
||||
<span id="L204" class="LineNr">204 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L204'>test-to-grapheme-three-bytes-min</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L205" class="LineNr">205 </span> <span class="PreProc">var</span> in/eax: code-point <span class="Special"><-</span> copy <span class="Constant">0x800</span> <span class="muComment"># 10-0000 00-0000</span>
|
||||
<span id="L206" class="LineNr">206 </span> <span class="PreProc">var</span> out/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L104'>to-grapheme</a> in
|
||||
<span id="L207" class="LineNr">207 </span> <span class="PreProc">var</span> out-int/eax: int <span class="Special"><-</span> copy out
|
||||
<span id="L208" class="LineNr">208 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> out-int, <span class="Constant">0x80a0e0</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L104'>to-grapheme</a>/3a"</span> <span class="muComment"># 1110 0000 10 10-0000 10 00-0000</span>
|
||||
<span id="L209" class="LineNr">209 </span><span class="Delimiter">}</span>
|
||||
<span id="L210" class="LineNr">210 </span>
|
||||
<span id="L211" class="LineNr">211 </span><span class="muComment"># largest 3-byte utf-8</span>
|
||||
<span id="L212" class="LineNr">212 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L212'>test-to-grapheme-three-bytes-max</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L213" class="LineNr">213 </span> <span class="PreProc">var</span> in/eax: code-point <span class="Special"><-</span> copy <span class="Constant">0xffff</span> <span class="muComment"># 1111 11-1111 11-1111</span>
|
||||
<span id="L214" class="LineNr">214 </span> <span class="PreProc">var</span> out/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L104'>to-grapheme</a> in
|
||||
<span id="L215" class="LineNr">215 </span> <span class="PreProc">var</span> out-int/eax: int <span class="Special"><-</span> copy out
|
||||
<span id="L216" class="LineNr">216 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> out-int, <span class="Constant">0xbfbfef</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L104'>to-grapheme</a>/3b"</span> <span class="muComment"># 1110 1111 10 11-1111 10 11-1111</span>
|
||||
<span id="L217" class="LineNr">217 </span><span class="Delimiter">}</span>
|
||||
<span id="L218" class="LineNr">218 </span>
|
||||
<span id="L219" class="LineNr">219 </span><span class="muComment"># smallest 4-byte utf-8</span>
|
||||
<span id="L220" class="LineNr">220 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L220'>test-to-grapheme-four-bytes-min</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L221" class="LineNr">221 </span> <span class="PreProc">var</span> in/eax: code-point <span class="Special"><-</span> copy <span class="Constant">0x10000</span> <span class="muComment"># 1-0000 00-0000 00-0000</span>
|
||||
<span id="L222" class="LineNr">222 </span> <span class="PreProc">var</span> out/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L104'>to-grapheme</a> in
|
||||
<span id="L223" class="LineNr">223 </span> <span class="PreProc">var</span> out-int/eax: int <span class="Special"><-</span> copy out
|
||||
<span id="L224" class="LineNr">224 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> out-int, <span class="Constant">0x808090f0</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L104'>to-grapheme</a>/4a"</span> <span class="muComment"># 1111-0 000 10 01-0000 10 00-0000 10 00-0000</span>
|
||||
<span id="L225" class="LineNr">225 </span><span class="Delimiter">}</span>
|
||||
<span id="L226" class="LineNr">226 </span>
|
||||
<span id="L227" class="LineNr">227 </span><span class="muComment"># largest 4-byte utf-8</span>
|
||||
<span id="L228" class="LineNr">228 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L228'>test-to-grapheme-four-bytes-max</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L229" class="LineNr">229 </span> <span class="PreProc">var</span> in/eax: code-point <span class="Special"><-</span> copy <span class="Constant">0x1fffff</span> <span class="muComment"># 111 11-1111 11-1111 11-1111</span>
|
||||
<span id="L230" class="LineNr">230 </span> <span class="PreProc">var</span> out/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L104'>to-grapheme</a> in
|
||||
<span id="L231" class="LineNr">231 </span> <span class="PreProc">var</span> out-int/eax: int <span class="Special"><-</span> copy out
|
||||
<span id="L232" class="LineNr">232 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> out-int, <span class="Constant">0xbfbfbff7</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L104'>to-grapheme</a>/4b"</span> <span class="muComment"># 1111-0 111 10 11-1111 10 11-1111 10 11-1111</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="muComment"># read the next grapheme from a stream of bytes</span>
|
||||
<span id="L236" class="LineNr">236 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='403unicode.mu.html#L236'>read-grapheme</a></span> in: (addr stream byte)<span class="PreProc"> -> </span>_/eax: grapheme <span class="Delimiter">{</span>
|
||||
<span id="L237" class="LineNr">237 </span> <span class="muComment"># if at eof, return EOF</span>
|
||||
<span id="L238" class="LineNr">238 </span> <span class="Delimiter">{</span>
|
||||
<span id="L239" class="LineNr">239 </span> <span class="PreProc">var</span> eof?/eax: boolean <span class="Special"><-</span> <a href='309stream.subx.html#L6'>stream-empty?</a> in
|
||||
<span id="L240" class="LineNr">240 </span> compare eof?, <span class="Constant">0</span>/false
|
||||
<span id="L241" class="LineNr">241 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L242" class="LineNr">242 </span> <span class="PreProc">return</span> <span class="Constant">0xffffffff</span>
|
||||
<span id="L243" class="LineNr">243 </span> <span class="Delimiter">}</span>
|
||||
<span id="L244" class="LineNr">244 </span> <span class="PreProc">var</span> c/eax: byte <span class="Special"><-</span> <a href='112read-byte.subx.html#L13'>read-byte</a> in
|
||||
<span id="L245" class="LineNr">245 </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="L246" class="LineNr">246 </span> $read-grapheme:compute-length: <span class="Delimiter">{</span>
|
||||
<span id="L247" class="LineNr">247 </span> <span class="muComment"># single byte: just return it</span>
|
||||
<span id="L248" class="LineNr">248 </span> compare c, <span class="Constant">0xc0</span>
|
||||
<span id="L249" class="LineNr">249 </span> <span class="Delimiter">{</span>
|
||||
<span id="L250" class="LineNr">250 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L251" class="LineNr">251 </span> <span class="PreProc">var</span> g/eax: grapheme <span class="Special"><-</span> copy c
|
||||
<span id="L252" class="LineNr">252 </span> <span class="PreProc">return</span> g
|
||||
<span id="L253" class="LineNr">253 </span> <span class="Delimiter">}</span>
|
||||
<span id="L254" class="LineNr">254 </span> compare c, <span class="Constant">0xfe</span>
|
||||
<span id="L140" class="LineNr">140 </span> <span class="Delimiter">}</span>
|
||||
<span id="L141" class="LineNr">141 </span> <span class="muComment"># emit trailer bytes, 6 bits from 'in', first two bits '10'</span>
|
||||
<span id="L142" class="LineNr">142 </span> <span class="PreProc">var</span> result/<span class="muRegEdi">edi</span>: code-point-utf8 <span class="Special"><-</span> copy <span class="Constant">0</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="muRegEsi">esi</span>: int <span class="Special"><-</span> copy c
|
||||
<span id="L147" class="LineNr">147 </span> tmp <span class="Special"><-</span> and <span class="Constant">0x3f</span>
|
||||
<span id="L148" class="LineNr">148 </span> tmp <span class="Special"><-</span> or <span class="Constant">0x80</span>
|
||||
<span id="L149" class="LineNr">149 </span> result <span class="Special"><-</span> shift-left <span class="Constant">8</span>
|
||||
<span id="L150" class="LineNr">150 </span> result <span class="Special"><-</span> or tmp
|
||||
<span id="L151" class="LineNr">151 </span> <span class="muComment"># update loop state</span>
|
||||
<span id="L152" class="LineNr">152 </span> c <span class="Special"><-</span> shift-right <span class="Constant">6</span>
|
||||
<span id="L153" class="LineNr">153 </span> num-trailers <span class="Special"><-</span> decrement
|
||||
<span id="L154" class="LineNr">154 </span> <span class="PreProc">loop</span>
|
||||
<span id="L155" class="LineNr">155 </span> <span class="Delimiter">}</span>
|
||||
<span id="L156" class="LineNr">156 </span> <span class="muComment"># emit engine</span>
|
||||
<span id="L157" class="LineNr">157 </span> result <span class="Special"><-</span> shift-left <span class="Constant">8</span>
|
||||
<span id="L158" class="LineNr">158 </span> result <span class="Special"><-</span> or c
|
||||
<span id="L159" class="LineNr">159 </span> result <span class="Special"><-</span> or first
|
||||
<span id="L160" class="LineNr">160 </span> <span class="muComment">#</span>
|
||||
<span id="L161" class="LineNr">161 </span> <span class="PreProc">return</span> result
|
||||
<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="muComment"># single-byte code point have identical code-point-utf8s</span>
|
||||
<span id="L165" class="LineNr">165 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L165'>test-to-utf8-single-byte</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L166" class="LineNr">166 </span> <span class="PreProc">var</span> in-int/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L167" class="LineNr">167 </span> <span class="Delimiter">{</span>
|
||||
<span id="L168" class="LineNr">168 </span> compare in-int, <span class="Constant">0x7f</span>
|
||||
<span id="L169" class="LineNr">169 </span> <span class="PreProc">break-if-></span>
|
||||
<span id="L170" class="LineNr">170 </span> <span class="PreProc">var</span> in/eax: code-point <span class="Special"><-</span> copy in-int
|
||||
<span id="L171" class="LineNr">171 </span> <span class="PreProc">var</span> out/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L97'>to-utf8</a> in
|
||||
<span id="L172" class="LineNr">172 </span> <span class="PreProc">var</span> out-int/eax: int <span class="Special"><-</span> copy out
|
||||
<span id="L173" class="LineNr">173 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> out-int, in-int, <span class="Constant">"F - test-to-utf8-single-byte"</span>
|
||||
<span id="L174" class="LineNr">174 </span> in-int <span class="Special"><-</span> increment
|
||||
<span id="L175" class="LineNr">175 </span> <span class="PreProc">loop</span>
|
||||
<span id="L176" class="LineNr">176 </span> <span class="Delimiter">}</span>
|
||||
<span id="L177" class="LineNr">177 </span><span class="Delimiter">}</span>
|
||||
<span id="L178" class="LineNr">178 </span>
|
||||
<span id="L179" class="LineNr">179 </span> <span class="muComment"># byte | byte | byte | byte</span>
|
||||
<span id="L180" class="LineNr">180 </span><span class="muComment"># smallest 2-byte utf-8</span>
|
||||
<span id="L181" class="LineNr">181 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L181'>test-to-utf8-two-bytes-min</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L182" class="LineNr">182 </span> <span class="PreProc">var</span> in/eax: code-point <span class="Special"><-</span> copy <span class="Constant">0x80</span> <span class="muComment"># 10 00-0000</span>
|
||||
<span id="L183" class="LineNr">183 </span> <span class="PreProc">var</span> out/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L97'>to-utf8</a> in
|
||||
<span id="L184" class="LineNr">184 </span> <span class="PreProc">var</span> out-int/eax: int <span class="Special"><-</span> copy out
|
||||
<span id="L185" class="LineNr">185 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> out-int, <span class="Constant">0x80c2</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L97'>to-utf8</a>/2a"</span> <span class="muComment"># 110 0-0010 10 00-0000</span>
|
||||
<span id="L186" class="LineNr">186 </span><span class="Delimiter">}</span>
|
||||
<span id="L187" class="LineNr">187 </span>
|
||||
<span id="L188" class="LineNr">188 </span><span class="muComment"># largest 2-byte utf-8</span>
|
||||
<span id="L189" class="LineNr">189 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L189'>test-to-utf8-two-bytes-max</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L190" class="LineNr">190 </span> <span class="PreProc">var</span> in/eax: code-point <span class="Special"><-</span> copy <span class="Constant">0x7ff</span> <span class="muComment"># 1-1111 11-1111</span>
|
||||
<span id="L191" class="LineNr">191 </span> <span class="PreProc">var</span> out/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L97'>to-utf8</a> in
|
||||
<span id="L192" class="LineNr">192 </span> <span class="PreProc">var</span> out-int/eax: int <span class="Special"><-</span> copy out
|
||||
<span id="L193" class="LineNr">193 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> out-int, <span class="Constant">0xbfdf</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L97'>to-utf8</a>/2b"</span> <span class="muComment"># 110 1-1111 10 11-1111</span>
|
||||
<span id="L194" class="LineNr">194 </span><span class="Delimiter">}</span>
|
||||
<span id="L195" class="LineNr">195 </span>
|
||||
<span id="L196" class="LineNr">196 </span><span class="muComment"># smallest 3-byte utf-8</span>
|
||||
<span id="L197" class="LineNr">197 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L197'>test-to-utf8-three-bytes-min</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L198" class="LineNr">198 </span> <span class="PreProc">var</span> in/eax: code-point <span class="Special"><-</span> copy <span class="Constant">0x800</span> <span class="muComment"># 10-0000 00-0000</span>
|
||||
<span id="L199" class="LineNr">199 </span> <span class="PreProc">var</span> out/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L97'>to-utf8</a> in
|
||||
<span id="L200" class="LineNr">200 </span> <span class="PreProc">var</span> out-int/eax: int <span class="Special"><-</span> copy out
|
||||
<span id="L201" class="LineNr">201 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> out-int, <span class="Constant">0x80a0e0</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L97'>to-utf8</a>/3a"</span> <span class="muComment"># 1110 0000 10 10-0000 10 00-0000</span>
|
||||
<span id="L202" class="LineNr">202 </span><span class="Delimiter">}</span>
|
||||
<span id="L203" class="LineNr">203 </span>
|
||||
<span id="L204" class="LineNr">204 </span><span class="muComment"># largest 3-byte utf-8</span>
|
||||
<span id="L205" class="LineNr">205 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L205'>test-to-utf8-three-bytes-max</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L206" class="LineNr">206 </span> <span class="PreProc">var</span> in/eax: code-point <span class="Special"><-</span> copy <span class="Constant">0xffff</span> <span class="muComment"># 1111 11-1111 11-1111</span>
|
||||
<span id="L207" class="LineNr">207 </span> <span class="PreProc">var</span> out/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L97'>to-utf8</a> in
|
||||
<span id="L208" class="LineNr">208 </span> <span class="PreProc">var</span> out-int/eax: int <span class="Special"><-</span> copy out
|
||||
<span id="L209" class="LineNr">209 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> out-int, <span class="Constant">0xbfbfef</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L97'>to-utf8</a>/3b"</span> <span class="muComment"># 1110 1111 10 11-1111 10 11-1111</span>
|
||||
<span id="L210" class="LineNr">210 </span><span class="Delimiter">}</span>
|
||||
<span id="L211" class="LineNr">211 </span>
|
||||
<span id="L212" class="LineNr">212 </span><span class="muComment"># smallest 4-byte utf-8</span>
|
||||
<span id="L213" class="LineNr">213 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L213'>test-to-utf8-four-bytes-min</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L214" class="LineNr">214 </span> <span class="PreProc">var</span> in/eax: code-point <span class="Special"><-</span> copy <span class="Constant">0x10000</span> <span class="muComment"># 1-0000 00-0000 00-0000</span>
|
||||
<span id="L215" class="LineNr">215 </span> <span class="PreProc">var</span> out/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L97'>to-utf8</a> in
|
||||
<span id="L216" class="LineNr">216 </span> <span class="PreProc">var</span> out-int/eax: int <span class="Special"><-</span> copy out
|
||||
<span id="L217" class="LineNr">217 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> out-int, <span class="Constant">0x808090f0</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L97'>to-utf8</a>/4a"</span> <span class="muComment"># 1111-0 000 10 01-0000 10 00-0000 10 00-0000</span>
|
||||
<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="muComment"># largest 4-byte utf-8</span>
|
||||
<span id="L221" class="LineNr">221 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L221'>test-to-utf8-four-bytes-max</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L222" class="LineNr">222 </span> <span class="PreProc">var</span> in/eax: code-point <span class="Special"><-</span> copy <span class="Constant">0x1fffff</span> <span class="muComment"># 111 11-1111 11-1111 11-1111</span>
|
||||
<span id="L223" class="LineNr">223 </span> <span class="PreProc">var</span> out/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L97'>to-utf8</a> in
|
||||
<span id="L224" class="LineNr">224 </span> <span class="PreProc">var</span> out-int/eax: int <span class="Special"><-</span> copy out
|
||||
<span id="L225" class="LineNr">225 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> out-int, <span class="Constant">0xbfbfbff7</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L97'>to-utf8</a>/4b"</span> <span class="muComment"># 1111-0 111 10 11-1111 10 11-1111 10 11-1111</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="muComment"># read the next code-point-utf8 from a stream of bytes</span>
|
||||
<span id="L229" class="LineNr">229 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='403unicode.mu.html#L229'>read-code-point-utf8</a></span> in: (addr stream byte)<span class="PreProc"> -> </span>_/eax: code-point-utf8 <span class="Delimiter">{</span>
|
||||
<span id="L230" class="LineNr">230 </span> <span class="muComment"># if at eof, return EOF</span>
|
||||
<span id="L231" class="LineNr">231 </span> <span class="Delimiter">{</span>
|
||||
<span id="L232" class="LineNr">232 </span> <span class="PreProc">var</span> eof?/eax: boolean <span class="Special"><-</span> <a href='309stream.subx.html#L6'>stream-empty?</a> in
|
||||
<span id="L233" class="LineNr">233 </span> compare eof?, <span class="Constant">0</span>/false
|
||||
<span id="L234" class="LineNr">234 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L235" class="LineNr">235 </span> <span class="PreProc">return</span> <span class="Constant">0xffffffff</span>
|
||||
<span id="L236" class="LineNr">236 </span> <span class="Delimiter">}</span>
|
||||
<span id="L237" class="LineNr">237 </span> <span class="PreProc">var</span> c/eax: byte <span class="Special"><-</span> <a href='112read-byte.subx.html#L13'>read-byte</a> in
|
||||
<span id="L238" class="LineNr">238 </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="L239" class="LineNr">239 </span> $read-code-point-utf8:compute-length: <span class="Delimiter">{</span>
|
||||
<span id="L240" class="LineNr">240 </span> <span class="muComment"># single byte: just return it</span>
|
||||
<span id="L241" class="LineNr">241 </span> compare c, <span class="Constant">0xc0</span>
|
||||
<span id="L242" class="LineNr">242 </span> <span class="Delimiter">{</span>
|
||||
<span id="L243" class="LineNr">243 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L244" class="LineNr">244 </span> <span class="PreProc">var</span> g/eax: code-point-utf8 <span class="Special"><-</span> copy c
|
||||
<span id="L245" class="LineNr">245 </span> <span class="PreProc">return</span> g
|
||||
<span id="L246" class="LineNr">246 </span> <span class="Delimiter">}</span>
|
||||
<span id="L247" class="LineNr">247 </span> compare c, <span class="Constant">0xfe</span>
|
||||
<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> <span class="PreProc">var</span> g/eax: code-point-utf8 <span class="Special"><-</span> copy c
|
||||
<span id="L251" class="LineNr">251 </span> <span class="PreProc">return</span> g
|
||||
<span id="L252" class="LineNr">252 </span> <span class="Delimiter">}</span>
|
||||
<span id="L253" class="LineNr">253 </span> <span class="muComment"># 2 bytes</span>
|
||||
<span id="L254" class="LineNr">254 </span> compare c, <span class="Constant">0xe0</span>
|
||||
<span id="L255" class="LineNr">255 </span> <span class="Delimiter">{</span>
|
||||
<span id="L256" class="LineNr">256 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L257" class="LineNr">257 </span> <span class="PreProc">var</span> g/eax: grapheme <span class="Special"><-</span> copy c
|
||||
<span id="L258" class="LineNr">258 </span> <span class="PreProc">return</span> g
|
||||
<span id="L256" class="LineNr">256 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L257" class="LineNr">257 </span> num-trailers <span class="Special"><-</span> copy <span class="Constant">1</span>
|
||||
<span id="L258" class="LineNr">258 </span> <span class="PreProc">break</span> $read-code-point-utf8:compute-length
|
||||
<span id="L259" class="LineNr">259 </span> <span class="Delimiter">}</span>
|
||||
<span id="L260" class="LineNr">260 </span> <span class="muComment"># 2 bytes</span>
|
||||
<span id="L261" class="LineNr">261 </span> compare c, <span class="Constant">0xe0</span>
|
||||
<span id="L260" class="LineNr">260 </span> <span class="muComment"># 3 bytes</span>
|
||||
<span id="L261" class="LineNr">261 </span> compare c, <span class="Constant">0xf0</span>
|
||||
<span id="L262" class="LineNr">262 </span> <span class="Delimiter">{</span>
|
||||
<span id="L263" class="LineNr">263 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L264" class="LineNr">264 </span> num-trailers <span class="Special"><-</span> copy <span class="Constant">1</span>
|
||||
<span id="L265" class="LineNr">265 </span> <span class="PreProc">break</span> $read-grapheme:compute-length
|
||||
<span id="L264" class="LineNr">264 </span> num-trailers <span class="Special"><-</span> copy <span class="Constant">2</span>
|
||||
<span id="L265" class="LineNr">265 </span> <span class="PreProc">break</span> $read-code-point-utf8:compute-length
|
||||
<span id="L266" class="LineNr">266 </span> <span class="Delimiter">}</span>
|
||||
<span id="L267" class="LineNr">267 </span> <span class="muComment"># 3 bytes</span>
|
||||
<span id="L268" class="LineNr">268 </span> compare c, <span class="Constant">0xf0</span>
|
||||
<span id="L267" class="LineNr">267 </span> <span class="muComment"># 4 bytes</span>
|
||||
<span id="L268" class="LineNr">268 </span> compare c, <span class="Constant">0xf8</span>
|
||||
<span id="L269" class="LineNr">269 </span> <span class="Delimiter">{</span>
|
||||
<span id="L270" class="LineNr">270 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L271" class="LineNr">271 </span> num-trailers <span class="Special"><-</span> copy <span class="Constant">2</span>
|
||||
<span id="L272" class="LineNr">272 </span> <span class="PreProc">break</span> $read-grapheme:compute-length
|
||||
<span id="L271" class="LineNr">271 </span> num-trailers <span class="Special"><-</span> copy <span class="Constant">3</span>
|
||||
<span id="L272" class="LineNr">272 </span> <span class="PreProc">break</span> $read-code-point-utf8:compute-length
|
||||
<span id="L273" class="LineNr">273 </span> <span class="Delimiter">}</span>
|
||||
<span id="L274" class="LineNr">274 </span> <span class="muComment"># 4 bytes</span>
|
||||
<span id="L275" class="LineNr">275 </span> compare c, <span class="Constant">0xf8</span>
|
||||
<span id="L276" class="LineNr">276 </span> <span class="Delimiter">{</span>
|
||||
<span id="L277" class="LineNr">277 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L278" class="LineNr">278 </span> num-trailers <span class="Special"><-</span> copy <span class="Constant">3</span>
|
||||
<span id="L279" class="LineNr">279 </span> <span class="PreProc">break</span> $read-grapheme:compute-length
|
||||
<span id="L280" class="LineNr">280 </span> <span class="Delimiter">}</span>
|
||||
<span id="L281" class="LineNr">281 </span> <span class="muComment"># TODO: print error message</span>
|
||||
<span id="L282" class="LineNr">282 </span> <span class="PreProc">return</span> <span class="Constant">0</span>
|
||||
<span id="L283" class="LineNr">283 </span> <span class="Delimiter">}</span>
|
||||
<span id="L284" class="LineNr">284 </span> <span class="muComment"># prepend trailer bytes</span>
|
||||
<span id="L285" class="LineNr">285 </span> <span class="PreProc">var</span> result/<span class="muRegEdi">edi</span>: grapheme <span class="Special"><-</span> copy c
|
||||
<span id="L286" class="LineNr">286 </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="L287" class="LineNr">287 </span> <span class="Delimiter">{</span>
|
||||
<span id="L288" class="LineNr">288 </span> compare num-trailers, <span class="Constant">0</span>
|
||||
<span id="L289" class="LineNr">289 </span> <span class="PreProc">break-if-<=</span>
|
||||
<span id="L290" class="LineNr">290 </span> <span class="PreProc">var</span> tmp/eax: byte <span class="Special"><-</span> <a href='112read-byte.subx.html#L13'>read-byte</a> in
|
||||
<span id="L291" class="LineNr">291 </span> <span class="PreProc">var</span> tmp2/eax: int <span class="Special"><-</span> copy tmp
|
||||
<span id="L292" class="LineNr">292 </span> tmp2 <span class="Special"><-</span> <a href='403unicode.mu.html#L322'>shift-left-bytes</a> tmp2, num-byte-shifts
|
||||
<span id="L293" class="LineNr">293 </span> result <span class="Special"><-</span> or tmp2
|
||||
<span id="L294" class="LineNr">294 </span> <span class="muComment"># update loop state</span>
|
||||
<span id="L295" class="LineNr">295 </span> num-byte-shifts <span class="Special"><-</span> increment
|
||||
<span id="L296" class="LineNr">296 </span> num-trailers <span class="Special"><-</span> decrement
|
||||
<span id="L297" class="LineNr">297 </span> <span class="PreProc">loop</span>
|
||||
<span id="L298" class="LineNr">298 </span> <span class="Delimiter">}</span>
|
||||
<span id="L299" class="LineNr">299 </span> <span class="PreProc">return</span> result
|
||||
<span id="L300" class="LineNr">300 </span><span class="Delimiter">}</span>
|
||||
<span id="L301" class="LineNr">301 </span>
|
||||
<span id="L302" class="LineNr">302 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='403unicode.mu.html#L302'>grapheme-length</a></span> g: grapheme<span class="PreProc"> -> </span>_/<span class="muRegEdx">edx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L303" class="LineNr">303 </span> <span class="Delimiter">{</span>
|
||||
<span id="L304" class="LineNr">304 </span> compare g, <span class="Constant">0xff</span>
|
||||
<span id="L305" class="LineNr">305 </span> <span class="PreProc">break-if-></span>
|
||||
<span id="L306" class="LineNr">306 </span> <span class="PreProc">return</span> <span class="Constant">1</span>
|
||||
<span id="L307" class="LineNr">307 </span> <span class="Delimiter">}</span>
|
||||
<span id="L308" class="LineNr">308 </span> <span class="Delimiter">{</span>
|
||||
<span id="L309" class="LineNr">309 </span> compare g, <span class="Constant">0xffff</span>
|
||||
<span id="L310" class="LineNr">310 </span> <span class="PreProc">break-if-></span>
|
||||
<span id="L311" class="LineNr">311 </span> <span class="PreProc">return</span> <span class="Constant">2</span>
|
||||
<span id="L312" class="LineNr">312 </span> <span class="Delimiter">}</span>
|
||||
<span id="L313" class="LineNr">313 </span> <span class="Delimiter">{</span>
|
||||
<span id="L314" class="LineNr">314 </span> compare g, <span class="Constant">0xffffff</span>
|
||||
<span id="L315" class="LineNr">315 </span> <span class="PreProc">break-if-></span>
|
||||
<span id="L316" class="LineNr">316 </span> <span class="PreProc">return</span> <span class="Constant">3</span>
|
||||
<span id="L317" class="LineNr">317 </span> <span class="Delimiter">}</span>
|
||||
<span id="L318" class="LineNr">318 </span> <span class="PreProc">return</span> <span class="Constant">4</span>
|
||||
<span id="L319" class="LineNr">319 </span><span class="Delimiter">}</span>
|
||||
<span id="L320" class="LineNr">320 </span>
|
||||
<span id="L321" class="LineNr">321 </span><span class="muComment"># needed because available primitives only shift by a literal/constant number of bits</span>
|
||||
<span id="L322" class="LineNr">322 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='403unicode.mu.html#L322'>shift-left-bytes</a></span> n: int, k: int<span class="PreProc"> -> </span>_/eax: int <span class="Delimiter">{</span>
|
||||
<span id="L323" class="LineNr">323 </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="L324" class="LineNr">324 </span> <span class="PreProc">var</span> result/eax: int <span class="Special"><-</span> copy n
|
||||
<span id="L325" class="LineNr">325 </span> <span class="Delimiter">{</span>
|
||||
<span id="L326" class="LineNr">326 </span> compare i, k
|
||||
<span id="L327" class="LineNr">327 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L328" class="LineNr">328 </span> compare i, <span class="Constant">4</span> <span class="muComment"># only 4 bytes in 32 bits</span>
|
||||
<span id="L329" class="LineNr">329 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L330" class="LineNr">330 </span> result <span class="Special"><-</span> shift-left <span class="Constant">8</span>
|
||||
<span id="L331" class="LineNr">331 </span> i <span class="Special"><-</span> increment
|
||||
<span id="L332" class="LineNr">332 </span> <span class="PreProc">loop</span>
|
||||
<span id="L333" class="LineNr">333 </span> <span class="Delimiter">}</span>
|
||||
<span id="L334" class="LineNr">334 </span> <span class="PreProc">return</span> result
|
||||
<span id="L335" class="LineNr">335 </span><span class="Delimiter">}</span>
|
||||
<span id="L336" class="LineNr">336 </span>
|
||||
<span id="L337" class="LineNr">337 </span><span class="muComment"># write a grapheme to a stream of bytes</span>
|
||||
<span id="L338" class="LineNr">338 </span><span class="muComment"># this is like write-to-stream, except we skip leading 0 bytes</span>
|
||||
<span id="L339" class="LineNr">339 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='403unicode.mu.html#L339'>write-grapheme</a></span> out: (addr stream byte), g: grapheme <span class="Delimiter">{</span>
|
||||
<span id="L340" class="LineNr">340 </span>$write-grapheme:body: <span class="Delimiter">{</span>
|
||||
<span id="L341" class="LineNr">341 </span> <span class="PreProc">var</span> c/eax: int <span class="Special"><-</span> copy g
|
||||
<span id="L342" class="LineNr">342 </span> <a href='115write-byte.subx.html#L12'>append-byte</a> out, c <span class="muComment"># first byte is always written</span>
|
||||
<span id="L343" class="LineNr">343 </span> c <span class="Special"><-</span> shift-right <span class="Constant">8</span>
|
||||
<span id="L344" class="LineNr">344 </span> compare c, <span class="Constant">0</span>
|
||||
<span id="L345" class="LineNr">345 </span> <span class="PreProc">break-if-=</span> $write-grapheme:body
|
||||
<span id="L346" class="LineNr">346 </span> <a href='115write-byte.subx.html#L12'>append-byte</a> out, c
|
||||
<span id="L347" class="LineNr">347 </span> c <span class="Special"><-</span> shift-right <span class="Constant">8</span>
|
||||
<span id="L348" class="LineNr">348 </span> compare c, <span class="Constant">0</span>
|
||||
<span id="L349" class="LineNr">349 </span> <span class="PreProc">break-if-=</span> $write-grapheme:body
|
||||
<span id="L350" class="LineNr">350 </span> <a href='115write-byte.subx.html#L12'>append-byte</a> out, c
|
||||
<span id="L351" class="LineNr">351 </span> c <span class="Special"><-</span> shift-right <span class="Constant">8</span>
|
||||
<span id="L352" class="LineNr">352 </span> compare c, <span class="Constant">0</span>
|
||||
<span id="L353" class="LineNr">353 </span> <span class="PreProc">break-if-=</span> $write-grapheme:body
|
||||
<span id="L354" class="LineNr">354 </span> <a href='115write-byte.subx.html#L12'>append-byte</a> out, c
|
||||
<span id="L274" class="LineNr">274 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">"utf-8 encodings larger than 4 bytes are not yet supported"</span>
|
||||
<span id="L275" class="LineNr">275 </span> <span class="PreProc">return</span> <span class="Constant">0</span>
|
||||
<span id="L276" class="LineNr">276 </span> <span class="Delimiter">}</span>
|
||||
<span id="L277" class="LineNr">277 </span> <span class="muComment"># prepend trailer bytes</span>
|
||||
<span id="L278" class="LineNr">278 </span> <span class="PreProc">var</span> result/<span class="muRegEdi">edi</span>: code-point-utf8 <span class="Special"><-</span> copy c
|
||||
<span id="L279" class="LineNr">279 </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="L280" class="LineNr">280 </span> <span class="Delimiter">{</span>
|
||||
<span id="L281" class="LineNr">281 </span> compare num-trailers, <span class="Constant">0</span>
|
||||
<span id="L282" class="LineNr">282 </span> <span class="PreProc">break-if-<=</span>
|
||||
<span id="L283" class="LineNr">283 </span> <span class="PreProc">var</span> tmp/eax: byte <span class="Special"><-</span> <a href='112read-byte.subx.html#L13'>read-byte</a> in
|
||||
<span id="L284" class="LineNr">284 </span> <span class="PreProc">var</span> tmp2/eax: int <span class="Special"><-</span> copy tmp
|
||||
<span id="L285" class="LineNr">285 </span> tmp2 <span class="Special"><-</span> <a href='403unicode.mu.html#L342'>shift-left-bytes</a> tmp2, num-byte-shifts
|
||||
<span id="L286" class="LineNr">286 </span> result <span class="Special"><-</span> or tmp2
|
||||
<span id="L287" class="LineNr">287 </span> <span class="muComment"># update loop state</span>
|
||||
<span id="L288" class="LineNr">288 </span> num-byte-shifts <span class="Special"><-</span> increment
|
||||
<span id="L289" class="LineNr">289 </span> num-trailers <span class="Special"><-</span> decrement
|
||||
<span id="L290" class="LineNr">290 </span> <span class="PreProc">loop</span>
|
||||
<span id="L291" class="LineNr">291 </span> <span class="Delimiter">}</span>
|
||||
<span id="L292" class="LineNr">292 </span> <span class="PreProc">return</span> result
|
||||
<span id="L293" class="LineNr">293 </span><span class="Delimiter">}</span>
|
||||
<span id="L294" class="LineNr">294 </span>
|
||||
<span id="L295" class="LineNr">295 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L295'>test-read-code-point-utf8</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L296" class="LineNr">296 </span> <span class="PreProc">var</span> s: (stream byte <span class="Constant">0x30</span>)
|
||||
<span id="L297" class="LineNr">297 </span> <span class="PreProc">var</span> s2/<span class="muRegEcx">ecx</span>: (addr stream byte) <span class="Special"><-</span> address s
|
||||
<span id="L298" class="LineNr">298 </span> <a href='108write.subx.html#L11'>write</a> s2, <span class="Constant">"aΒc世d界e"</span>
|
||||
<span id="L299" class="LineNr">299 </span> <span class="PreProc">var</span> c/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L229'>read-code-point-utf8</a> s2
|
||||
<span id="L300" class="LineNr">300 </span> <span class="PreProc">var</span> n/eax: int <span class="Special"><-</span> copy c
|
||||
<span id="L301" class="LineNr">301 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> n, <span class="Constant">0x61</span>, <span class="Constant">"F - test code-point-utf8/0"</span>
|
||||
<span id="L302" class="LineNr">302 </span> <span class="PreProc">var</span> c/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L229'>read-code-point-utf8</a> s2
|
||||
<span id="L303" class="LineNr">303 </span> <span class="PreProc">var</span> n/eax: int <span class="Special"><-</span> copy c
|
||||
<span id="L304" class="LineNr">304 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> n, <span class="Constant">0x92ce</span>/greek-capital-letter-beta, <span class="Constant">"F - test code-point-utf8/1"</span>
|
||||
<span id="L305" class="LineNr">305 </span> <span class="PreProc">var</span> c/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L229'>read-code-point-utf8</a> s2
|
||||
<span id="L306" class="LineNr">306 </span> <span class="PreProc">var</span> n/eax: int <span class="Special"><-</span> copy c
|
||||
<span id="L307" class="LineNr">307 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> n, <span class="Constant">0x63</span>, <span class="Constant">"F - test code-point-utf8/2"</span>
|
||||
<span id="L308" class="LineNr">308 </span> <span class="PreProc">var</span> c/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L229'>read-code-point-utf8</a> s2
|
||||
<span id="L309" class="LineNr">309 </span> <span class="PreProc">var</span> n/eax: int <span class="Special"><-</span> copy c
|
||||
<span id="L310" class="LineNr">310 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> n, <span class="Constant">0x96b8e4</span>, <span class="Constant">"F - test code-point-utf8/3"</span>
|
||||
<span id="L311" class="LineNr">311 </span> <span class="PreProc">var</span> c/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L229'>read-code-point-utf8</a> s2
|
||||
<span id="L312" class="LineNr">312 </span> <span class="PreProc">var</span> n/eax: int <span class="Special"><-</span> copy c
|
||||
<span id="L313" class="LineNr">313 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> n, <span class="Constant">0x64</span>, <span class="Constant">"F - test code-point-utf8/4"</span>
|
||||
<span id="L314" class="LineNr">314 </span> <span class="PreProc">var</span> c/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L229'>read-code-point-utf8</a> s2
|
||||
<span id="L315" class="LineNr">315 </span> <span class="PreProc">var</span> n/eax: int <span class="Special"><-</span> copy c
|
||||
<span id="L316" class="LineNr">316 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> n, <span class="Constant">0x8c95e7</span>, <span class="Constant">"F - test code-point-utf8/5"</span>
|
||||
<span id="L317" class="LineNr">317 </span> <span class="PreProc">var</span> c/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L229'>read-code-point-utf8</a> s2
|
||||
<span id="L318" class="LineNr">318 </span> <span class="PreProc">var</span> n/eax: int <span class="Special"><-</span> copy c
|
||||
<span id="L319" class="LineNr">319 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> n, <span class="Constant">0x65</span>, <span class="Constant">"F - test code-point-utf8/6"</span>
|
||||
<span id="L320" class="LineNr">320 </span><span class="Delimiter">}</span>
|
||||
<span id="L321" class="LineNr">321 </span>
|
||||
<span id="L322" class="LineNr">322 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='403unicode.mu.html#L322'>utf8-length</a></span> g: code-point-utf8<span class="PreProc"> -> </span>_/<span class="muRegEdx">edx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L323" class="LineNr">323 </span> <span class="Delimiter">{</span>
|
||||
<span id="L324" class="LineNr">324 </span> compare g, <span class="Constant">0xff</span>
|
||||
<span id="L325" class="LineNr">325 </span> <span class="PreProc">break-if-></span>
|
||||
<span id="L326" class="LineNr">326 </span> <span class="PreProc">return</span> <span class="Constant">1</span>
|
||||
<span id="L327" class="LineNr">327 </span> <span class="Delimiter">}</span>
|
||||
<span id="L328" class="LineNr">328 </span> <span class="Delimiter">{</span>
|
||||
<span id="L329" class="LineNr">329 </span> compare g, <span class="Constant">0xffff</span>
|
||||
<span id="L330" class="LineNr">330 </span> <span class="PreProc">break-if-></span>
|
||||
<span id="L331" class="LineNr">331 </span> <span class="PreProc">return</span> <span class="Constant">2</span>
|
||||
<span id="L332" class="LineNr">332 </span> <span class="Delimiter">}</span>
|
||||
<span id="L333" class="LineNr">333 </span> <span class="Delimiter">{</span>
|
||||
<span id="L334" class="LineNr">334 </span> compare g, <span class="Constant">0xffffff</span>
|
||||
<span id="L335" class="LineNr">335 </span> <span class="PreProc">break-if-></span>
|
||||
<span id="L336" class="LineNr">336 </span> <span class="PreProc">return</span> <span class="Constant">3</span>
|
||||
<span id="L337" class="LineNr">337 </span> <span class="Delimiter">}</span>
|
||||
<span id="L338" class="LineNr">338 </span> <span class="PreProc">return</span> <span class="Constant">4</span>
|
||||
<span id="L339" class="LineNr">339 </span><span class="Delimiter">}</span>
|
||||
<span id="L340" class="LineNr">340 </span>
|
||||
<span id="L341" class="LineNr">341 </span><span class="muComment"># needed because available primitives only shift by a literal/constant number of bits</span>
|
||||
<span id="L342" class="LineNr">342 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='403unicode.mu.html#L342'>shift-left-bytes</a></span> n: int, k: int<span class="PreProc"> -> </span>_/eax: int <span class="Delimiter">{</span>
|
||||
<span id="L343" class="LineNr">343 </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="L344" class="LineNr">344 </span> <span class="PreProc">var</span> result/eax: int <span class="Special"><-</span> copy n
|
||||
<span id="L345" class="LineNr">345 </span> <span class="Delimiter">{</span>
|
||||
<span id="L346" class="LineNr">346 </span> compare i, k
|
||||
<span id="L347" class="LineNr">347 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L348" class="LineNr">348 </span> compare i, <span class="Constant">4</span> <span class="muComment"># only 4 bytes in 32 bits</span>
|
||||
<span id="L349" class="LineNr">349 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L350" class="LineNr">350 </span> result <span class="Special"><-</span> shift-left <span class="Constant">8</span>
|
||||
<span id="L351" class="LineNr">351 </span> i <span class="Special"><-</span> increment
|
||||
<span id="L352" class="LineNr">352 </span> <span class="PreProc">loop</span>
|
||||
<span id="L353" class="LineNr">353 </span> <span class="Delimiter">}</span>
|
||||
<span id="L354" class="LineNr">354 </span> <span class="PreProc">return</span> result
|
||||
<span id="L355" class="LineNr">355 </span><span class="Delimiter">}</span>
|
||||
<span id="L356" class="LineNr">356 </span><span class="Delimiter">}</span>
|
||||
<span id="L356" class="LineNr">356 </span>
|
||||
<span id="L357" class="LineNr">357 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L357'>test-shift-left-bytes-0</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L358" class="LineNr">358 </span> <span class="PreProc">var</span> result/eax: int <span class="Special"><-</span> <a href='403unicode.mu.html#L342'>shift-left-bytes</a> <span class="Constant">1</span>, <span class="Constant">0</span>
|
||||
<span id="L359" class="LineNr">359 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">1</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L342'>shift-left-bytes</a> 0"</span>
|
||||
<span id="L360" class="LineNr">360 </span><span class="Delimiter">}</span>
|
||||
<span id="L361" class="LineNr">361 </span>
|
||||
<span id="L362" class="LineNr">362 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L362'>test-shift-left-bytes-1</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L363" class="LineNr">363 </span> <span class="PreProc">var</span> result/eax: int <span class="Special"><-</span> <a href='403unicode.mu.html#L342'>shift-left-bytes</a> <span class="Constant">1</span>, <span class="Constant">1</span>
|
||||
<span id="L364" class="LineNr">364 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">0x100</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L342'>shift-left-bytes</a> 1"</span>
|
||||
<span id="L365" class="LineNr">365 </span><span class="Delimiter">}</span>
|
||||
<span id="L366" class="LineNr">366 </span>
|
||||
<span id="L367" class="LineNr">367 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L367'>test-shift-left-bytes-2</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L368" class="LineNr">368 </span> <span class="PreProc">var</span> result/eax: int <span class="Special"><-</span> <a href='403unicode.mu.html#L342'>shift-left-bytes</a> <span class="Constant">1</span>, <span class="Constant">2</span>
|
||||
<span id="L369" class="LineNr">369 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">0x10000</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L342'>shift-left-bytes</a> 2"</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="muTest"><a href='403unicode.mu.html#L372'>test-shift-left-bytes-3</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L373" class="LineNr">373 </span> <span class="PreProc">var</span> result/eax: int <span class="Special"><-</span> <a href='403unicode.mu.html#L342'>shift-left-bytes</a> <span class="Constant">1</span>, <span class="Constant">3</span>
|
||||
<span id="L374" class="LineNr">374 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">0x1000000</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L342'>shift-left-bytes</a> 3"</span>
|
||||
<span id="L375" class="LineNr">375 </span><span class="Delimiter">}</span>
|
||||
<span id="L376" class="LineNr">376 </span>
|
||||
<span id="L377" class="LineNr">377 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L377'>test-shift-left-bytes-4</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L378" class="LineNr">378 </span> <span class="PreProc">var</span> result/eax: int <span class="Special"><-</span> <a href='403unicode.mu.html#L342'>shift-left-bytes</a> <span class="Constant">1</span>, <span class="Constant">4</span>
|
||||
<span id="L379" class="LineNr">379 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">0</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L342'>shift-left-bytes</a> 4"</span>
|
||||
<span id="L380" class="LineNr">380 </span><span class="Delimiter">}</span>
|
||||
<span id="L381" class="LineNr">381 </span>
|
||||
<span id="L382" class="LineNr">382 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L382'>test-shift-left-bytes-5</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L383" class="LineNr">383 </span> <span class="PreProc">var</span> result/eax: int <span class="Special"><-</span> <a href='403unicode.mu.html#L342'>shift-left-bytes</a> <span class="Constant">1</span>, <span class="Constant">5</span>
|
||||
<span id="L384" class="LineNr">384 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">0</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L342'>shift-left-bytes</a> >4"</span>
|
||||
<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="muComment"># write a code-point-utf8 to a stream of bytes</span>
|
||||
<span id="L388" class="LineNr">388 </span><span class="muComment"># this is like write-to-stream, except we skip leading 0 bytes</span>
|
||||
<span id="L389" class="LineNr">389 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='403unicode.mu.html#L389'>write-code-point-utf8</a></span> out: (addr stream byte), g: code-point-utf8 <span class="Delimiter">{</span>
|
||||
<span id="L390" class="LineNr">390 </span>$write-code-point-utf8:body: <span class="Delimiter">{</span>
|
||||
<span id="L391" class="LineNr">391 </span> <span class="PreProc">var</span> c/eax: int <span class="Special"><-</span> copy g
|
||||
<span id="L392" class="LineNr">392 </span> <a href='115write-byte.subx.html#L12'>append-byte</a> out, c <span class="muComment"># first byte is always written</span>
|
||||
<span id="L393" class="LineNr">393 </span> c <span class="Special"><-</span> shift-right <span class="Constant">8</span>
|
||||
<span id="L394" class="LineNr">394 </span> compare c, <span class="Constant">0</span>
|
||||
<span id="L395" class="LineNr">395 </span> <span class="PreProc">break-if-=</span> $write-code-point-utf8:body
|
||||
<span id="L396" class="LineNr">396 </span> <a href='115write-byte.subx.html#L12'>append-byte</a> out, c
|
||||
<span id="L397" class="LineNr">397 </span> c <span class="Special"><-</span> shift-right <span class="Constant">8</span>
|
||||
<span id="L398" class="LineNr">398 </span> compare c, <span class="Constant">0</span>
|
||||
<span id="L399" class="LineNr">399 </span> <span class="PreProc">break-if-=</span> $write-code-point-utf8:body
|
||||
<span id="L400" class="LineNr">400 </span> <a href='115write-byte.subx.html#L12'>append-byte</a> out, c
|
||||
<span id="L401" class="LineNr">401 </span> c <span class="Special"><-</span> shift-right <span class="Constant">8</span>
|
||||
<span id="L402" class="LineNr">402 </span> compare c, <span class="Constant">0</span>
|
||||
<span id="L403" class="LineNr">403 </span> <span class="PreProc">break-if-=</span> $write-code-point-utf8:body
|
||||
<span id="L404" class="LineNr">404 </span> <a href='115write-byte.subx.html#L12'>append-byte</a> out, c
|
||||
<span id="L405" class="LineNr">405 </span><span class="Delimiter">}</span>
|
||||
<span id="L406" class="LineNr">406 </span><span class="Delimiter">}</span>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -61,7 +61,7 @@ if ('onhashchange' in window) {
|
|||
<body onload='JumpToLine();'>
|
||||
<a href='https://github.com/akkartik/mu/blob/main/411string.mu'>https://github.com/akkartik/mu/blob/main/411string.mu</a>
|
||||
<pre id='vimCodeElement'>
|
||||
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># read up to 'len' graphemes after skipping the first 'start' ones</span>
|
||||
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># read up to 'len' code-point-utf8s 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="muRegEsi">esi</span>: (addr stream byte) <span class="Special"><-</span> address in-stream
|
||||
|
@ -69,29 +69,29 @@ if ('onhashchange' in window) {
|
|||
<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="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="L9" class="LineNr"> 9 </span> <span class="muComment"># skip 'start' code-point-utf8s</span>
|
||||
<span id="L10" class="LineNr"> 10 </span> <span class="PreProc">var</span> i/eax: 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/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L236'>read-grapheme</a> in-stream-addr
|
||||
<span id="L15" class="LineNr"> 15 </span> <span class="PreProc">var</span> dummy/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L229'>read-code-point-utf8</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>
|
||||
<span id="L19" class="LineNr"> 19 </span> i <span class="Special"><-</span> increment
|
||||
<span id="L20" class="LineNr"> 20 </span> <span class="PreProc">loop</span>
|
||||
<span id="L21" class="LineNr"> 21 </span> <span class="Delimiter">}</span>
|
||||
<span id="L22" class="LineNr"> 22 </span> <span class="muComment"># copy 'len' graphemes</span>
|
||||
<span id="L22" class="LineNr"> 22 </span> <span class="muComment"># copy 'len' code-point-utf8s</span>
|
||||
<span id="L23" class="LineNr"> 23 </span> i <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L24" class="LineNr"> 24 </span> <span class="Delimiter">{</span>
|
||||
<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/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L236'>read-grapheme</a> in-stream-addr
|
||||
<span id="L28" class="LineNr"> 28 </span> <span class="PreProc">var</span> g/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L229'>read-code-point-utf8</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#L339'>write-grapheme</a> out-stream-addr, g
|
||||
<span id="L31" class="LineNr"> 31 </span> <a href='403unicode.mu.html#L389'>write-code-point-utf8</a> out-stream-addr, g
|
||||
<span id="L32" class="LineNr"> 32 </span> <span class="Delimiter">}</span>
|
||||
<span id="L33" class="LineNr"> 33 </span> i <span class="Special"><-</span> increment
|
||||
<span id="L34" class="LineNr"> 34 </span> <span class="PreProc">loop</span>
|
||||
|
@ -148,7 +148,7 @@ if ('onhashchange' in window) {
|
|||
<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="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: code-point-utf8, 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="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
|
||||
|
@ -157,10 +157,10 @@ if ('onhashchange' in window) {
|
|||
<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="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/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L236'>read-grapheme</a> in-stream-addr
|
||||
<span id="L97" class="LineNr"> 97 </span> <span class="PreProc">var</span> g/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L229'>read-code-point-utf8</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>
|
||||
<span id="L100" class="LineNr">100 </span><span class="CommentedCode">#? print-code-point-utf8-to-real-screen g</span>
|
||||
<span id="L101" class="LineNr">101 </span><span class="CommentedCode">#? print-string-to-real-screen "\n"</span>
|
||||
<span id="L102" class="LineNr">102 </span> compare g, delim
|
||||
<span id="L103" class="LineNr">103 </span> <span class="Delimiter">{</span>
|
||||
|
@ -173,7 +173,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L110" class="LineNr">110 </span> <a href='106stream.subx.html#L20'>clear-stream</a> curr-stream-addr
|
||||
<span id="L111" class="LineNr">111 </span> <span class="PreProc">loop</span> $split-string:core
|
||||
<span id="L112" class="LineNr">112 </span> <span class="Delimiter">}</span>
|
||||
<span id="L113" class="LineNr">113 </span> <a href='403unicode.mu.html#L339'>write-grapheme</a> curr-stream-addr, g
|
||||
<span id="L113" class="LineNr">113 </span> <a href='403unicode.mu.html#L389'>write-code-point-utf8</a> curr-stream-addr, g
|
||||
<span id="L114" class="LineNr">114 </span> <span class="PreProc">loop</span>
|
||||
<span id="L115" class="LineNr">115 </span> <span class="Delimiter">}</span>
|
||||
<span id="L116" class="LineNr">116 </span> <a href='310copy-bytes.subx.html#L60'>stream-to-array</a> tokens-stream-addr, out
|
||||
|
|
|
@ -219,7 +219,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L155" class="LineNr">155 </span> <span class="PreProc">var</span> width/eax: 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#L75'>screen-size</a> <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L158" class="LineNr">158 </span> <span class="PreProc">var</span> result/eax: int <span class="Special"><-</span> <a href='501draw-text.mu.html#L124'>draw-stream-rightward</a> <a href='500fake-screen.mu.html#L16'>screen</a>, s, x, width, y, color, background-color
|
||||
<span id="L158" class="LineNr">158 </span> <span class="PreProc">var</span> result/eax: int <span class="Special"><-</span> <a href='501draw-text.mu.html#L117'>draw-stream-rightward</a> <a href='500fake-screen.mu.html#L16'>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>
|
||||
|
|
|
@ -134,7 +134,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L71" class="LineNr"> 71 </span> copy-to *dest, <span class="Constant">0</span>
|
||||
<span id="L72" class="LineNr"> 72 </span><span class="Delimiter">}</span>
|
||||
<span id="L73" class="LineNr"> 73 </span>
|
||||
<span id="L74" class="LineNr"> 74 </span><span class="muComment"># in graphemes</span>
|
||||
<span id="L74" class="LineNr"> 74 </span><span class="muComment"># in code-point-utf8s</span>
|
||||
<span id="L75" class="LineNr"> 75 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='500fake-screen.mu.html#L75'>screen-size</a></span> _screen: (addr <a href='500fake-screen.mu.html#L16'>screen</a>)<span class="PreProc"> -> </span>_/eax: int, _/<span class="muRegEcx">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L76" class="LineNr"> 76 </span> <span class="PreProc">var</span> <a href='500fake-screen.mu.html#L16'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>) <span class="Special"><-</span> copy _screen
|
||||
<span id="L77" class="LineNr"> 77 </span> <span class="PreProc">var</span> width/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
|
@ -522,7 +522,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L459" class="LineNr">459 </span> <a href='500fake-screen.mu.html#L269'>set-cursor-position</a> <a href='500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0</span>, <span class="Constant">0</span>
|
||||
<span id="L460" class="LineNr">460 </span><span class="Delimiter">}</span>
|
||||
<span id="L461" class="LineNr">461 </span>
|
||||
<span id="L462" class="LineNr">462 </span><span class="muComment"># there's no grapheme that guarantees to cover every pixel, so we'll bump down</span>
|
||||
<span id="L462" class="LineNr">462 </span><span class="muComment"># there's no code-point-utf8 that guarantees to cover every pixel, so we'll bump down</span>
|
||||
<span id="L463" class="LineNr">463 </span><span class="muComment"># to pixels for a real screen</span>
|
||||
<span id="L464" class="LineNr">464 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='500fake-screen.mu.html#L464'>clear-real-screen</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L465" class="LineNr">465 </span> <span class="PreProc">var</span> y/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
|
|
|
@ -144,487 +144,480 @@ if ('onhashchange' in window) {
|
|||
<span id="L81" class="LineNr"> 81 </span> <a href='500fake-screen.mu.html#L269'>set-cursor-position</a> <a href='500fake-screen.mu.html#L16'>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-code-point-at-cursor</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), c: code-point, color: int, background-color: int <span class="Delimiter">{</span>
|
||||
<span id="L84" class="LineNr"> 84 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L84'>draw-code-point-at-cursor-over-full-screen</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), c: code-point, color: int, background-color: int <span class="Delimiter">{</span>
|
||||
<span id="L85" class="LineNr"> 85 </span> <span class="PreProc">var</span> cursor-x/eax: 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#L253'>cursor-position</a> <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L88" class="LineNr"> 88 </span> <span class="PreProc">var</span> dummy/eax: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L94'>draw-code-point</a> <a href='500fake-screen.mu.html#L16'>screen</a>, c, 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="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L91'>draw-code-point-at-cursor-over-full-screen</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), c: code-point, color: int, background-color: int <span class="Delimiter">{</span>
|
||||
<span id="L92" class="LineNr"> 92 </span> <span class="PreProc">var</span> cursor-x/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L93" class="LineNr"> 93 </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="L94" class="LineNr"> 94 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L253'>cursor-position</a> <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L95" class="LineNr"> 95 </span> <span class="PreProc">var</span> _offset/eax: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L94'>draw-code-point</a> <a href='500fake-screen.mu.html#L16'>screen</a>, c, cursor-x, cursor-y, color, background-color
|
||||
<span id="L96" class="LineNr"> 96 </span> <span class="PreProc">var</span> offset/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy _offset
|
||||
<span id="L97" class="LineNr"> 97 </span> <span class="PreProc">var</span> width/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L98" class="LineNr"> 98 </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="L99" class="LineNr"> 99 </span> width, dummy <span class="Special"><-</span> <a href='500fake-screen.mu.html#L75'>screen-size</a> <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L100" class="LineNr">100 </span> <a href='501draw-text.mu.html#L302'>move-cursor-rightward-and-downward</a> <a href='500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0</span> width
|
||||
<span id="L101" class="LineNr">101 </span> offset <span class="Special"><-</span> decrement
|
||||
<span id="L102" class="LineNr">102 </span> compare offset, <span class="Constant">0</span>
|
||||
<span id="L103" class="LineNr">103 </span> <span class="Delimiter">{</span>
|
||||
<span id="L104" class="LineNr">104 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L105" class="LineNr">105 </span> <span class="muComment"># should never move downward here</span>
|
||||
<span id="L106" class="LineNr">106 </span> <a href='501draw-text.mu.html#L302'>move-cursor-rightward-and-downward</a> <a href='500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0</span> width
|
||||
<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 id="L110" class="LineNr">110 </span><span class="muComment"># draw a single line of text from x, y to xmax</span>
|
||||
<span id="L111" class="LineNr">111 </span><span class="muComment"># return the next 'x' coordinate</span>
|
||||
<span id="L112" class="LineNr">112 </span><span class="muComment"># if there isn't enough space, truncate</span>
|
||||
<span id="L113" class="LineNr">113 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L113'>draw-text-rightward</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), text: (addr array byte), x: int, xmax: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/eax: int <span class="Delimiter">{</span>
|
||||
<span id="L114" class="LineNr">114 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x400</span>/print-buffer-size)
|
||||
<span id="L115" class="LineNr">115 </span> <span class="PreProc">var</span> stream/<span class="muRegEsi">esi</span>: (addr stream byte) <span class="Special"><-</span> address stream-storage
|
||||
<span id="L116" class="LineNr">116 </span> <a href='108write.subx.html#L11'>write</a> stream, text
|
||||
<span id="L117" class="LineNr">117 </span> <span class="PreProc">var</span> xcurr/eax: int <span class="Special"><-</span> <a href='501draw-text.mu.html#L124'>draw-stream-rightward</a> <a href='500fake-screen.mu.html#L16'>screen</a>, stream, x, xmax, y, color, background-color
|
||||
<span id="L118" class="LineNr">118 </span> <span class="PreProc">return</span> xcurr
|
||||
<span id="L119" class="LineNr">119 </span><span class="Delimiter">}</span>
|
||||
<span id="L120" class="LineNr">120 </span>
|
||||
<span id="L121" class="LineNr">121 </span><span class="muComment"># draw a single-line stream from x, y to xmax</span>
|
||||
<span id="L122" class="LineNr">122 </span><span class="muComment"># return the next 'x' coordinate</span>
|
||||
<span id="L123" class="LineNr">123 </span><span class="muComment"># if there isn't enough space, truncate</span>
|
||||
<span id="L124" class="LineNr">124 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L124'>draw-stream-rightward</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), stream: (addr stream byte), x: int, xmax: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/eax: int <span class="Delimiter">{</span>
|
||||
<span id="L125" class="LineNr">125 </span> <span class="PreProc">var</span> xcurr/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy x
|
||||
<span id="L126" class="LineNr">126 </span> <span class="Delimiter">{</span>
|
||||
<span id="L127" class="LineNr">127 </span> <span class="PreProc">var</span> g/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L236'>read-grapheme</a> stream
|
||||
<span id="L128" class="LineNr">128 </span> compare g, <span class="Constant">0xffffffff</span>/end-of-file
|
||||
<span id="L129" class="LineNr">129 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L130" class="LineNr">130 </span> <span class="PreProc">var</span> c/eax: code-point <span class="Special"><-</span> <a href='403unicode.mu.html#L56'>to-code-point</a> g
|
||||
<span id="L131" class="LineNr">131 </span> <span class="PreProc">var</span> offset/eax: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L94'>draw-code-point</a> <a href='500fake-screen.mu.html#L16'>screen</a>, c, xcurr, y, color, background-color
|
||||
<span id="L132" class="LineNr">132 </span> xcurr <span class="Special"><-</span> add offset
|
||||
<span id="L133" class="LineNr">133 </span> <span class="PreProc">loop</span>
|
||||
<span id="L134" class="LineNr">134 </span> <span class="Delimiter">}</span>
|
||||
<span id="L135" class="LineNr">135 </span> <a href='500fake-screen.mu.html#L269'>set-cursor-position</a> <a href='500fake-screen.mu.html#L16'>screen</a>, xcurr, y
|
||||
<span id="L136" class="LineNr">136 </span> <span class="PreProc">return</span> xcurr
|
||||
<span id="L137" class="LineNr">137 </span><span class="Delimiter">}</span>
|
||||
<span id="L138" class="LineNr">138 </span>
|
||||
<span id="L139" class="LineNr">139 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L139'>draw-text-rightward-over-full-screen</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), text: (addr array byte), x: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/eax: int <span class="Delimiter">{</span>
|
||||
<span id="L140" class="LineNr">140 </span> <span class="PreProc">var</span> width/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L141" class="LineNr">141 </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="L142" class="LineNr">142 </span> width, height <span class="Special"><-</span> <a href='500fake-screen.mu.html#L75'>screen-size</a> <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L143" class="LineNr">143 </span> <span class="PreProc">var</span> result/eax: int <span class="Special"><-</span> <a href='501draw-text.mu.html#L113'>draw-text-rightward</a> <a href='500fake-screen.mu.html#L16'>screen</a>, text, x, width, y, color, background-color
|
||||
<span id="L144" class="LineNr">144 </span> <span class="PreProc">return</span> result
|
||||
<span id="L145" class="LineNr">145 </span><span class="Delimiter">}</span>
|
||||
<span id="L146" class="LineNr">146 </span>
|
||||
<span id="L147" class="LineNr">147 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L147'>draw-text-rightward-from-cursor</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), text: (addr array byte), xmax: int, color: int, background-color: int <span class="Delimiter">{</span>
|
||||
<span id="L148" class="LineNr">148 </span> <span class="PreProc">var</span> cursor-x/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L149" class="LineNr">149 </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="L150" class="LineNr">150 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L253'>cursor-position</a> <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L151" class="LineNr">151 </span> cursor-x <span class="Special"><-</span> <a href='501draw-text.mu.html#L113'>draw-text-rightward</a> <a href='500fake-screen.mu.html#L16'>screen</a>, text, cursor-x, xmax, cursor-y, color, background-color
|
||||
<span id="L152" class="LineNr">152 </span> <a href='500fake-screen.mu.html#L269'>set-cursor-position</a> <a href='500fake-screen.mu.html#L16'>screen</a>, cursor-x, cursor-y
|
||||
<span id="L88" class="LineNr"> 88 </span> <span class="PreProc">var</span> _offset/eax: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L94'>draw-code-point</a> <a href='500fake-screen.mu.html#L16'>screen</a>, c, cursor-x, cursor-y, color, background-color
|
||||
<span id="L89" class="LineNr"> 89 </span> <span class="PreProc">var</span> offset/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy _offset
|
||||
<span id="L90" class="LineNr"> 90 </span> <span class="PreProc">var</span> width/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L91" class="LineNr"> 91 </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="L92" class="LineNr"> 92 </span> width, dummy <span class="Special"><-</span> <a href='500fake-screen.mu.html#L75'>screen-size</a> <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L93" class="LineNr"> 93 </span> <a href='501draw-text.mu.html#L295'>move-cursor-rightward-and-downward</a> <a href='500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0</span> width
|
||||
<span id="L94" class="LineNr"> 94 </span> offset <span class="Special"><-</span> decrement
|
||||
<span id="L95" class="LineNr"> 95 </span> compare offset, <span class="Constant">0</span>
|
||||
<span id="L96" class="LineNr"> 96 </span> <span class="Delimiter">{</span>
|
||||
<span id="L97" class="LineNr"> 97 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L98" class="LineNr"> 98 </span> <span class="muComment"># should never move downward here</span>
|
||||
<span id="L99" class="LineNr"> 99 </span> <a href='501draw-text.mu.html#L295'>move-cursor-rightward-and-downward</a> <a href='500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0</span> width
|
||||
<span id="L100" class="LineNr">100 </span> <span class="Delimiter">}</span>
|
||||
<span id="L101" class="LineNr">101 </span><span class="Delimiter">}</span>
|
||||
<span id="L102" class="LineNr">102 </span>
|
||||
<span id="L103" class="LineNr">103 </span><span class="muComment"># draw a single line of text from x, y to xmax</span>
|
||||
<span id="L104" class="LineNr">104 </span><span class="muComment"># return the next 'x' coordinate</span>
|
||||
<span id="L105" class="LineNr">105 </span><span class="muComment"># if there isn't enough space, truncate</span>
|
||||
<span id="L106" class="LineNr">106 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L106'>draw-text-rightward</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), text: (addr array byte), x: int, xmax: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/eax: int <span class="Delimiter">{</span>
|
||||
<span id="L107" class="LineNr">107 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x400</span>/print-buffer-size)
|
||||
<span id="L108" class="LineNr">108 </span> <span class="PreProc">var</span> stream/<span class="muRegEsi">esi</span>: (addr stream byte) <span class="Special"><-</span> address stream-storage
|
||||
<span id="L109" class="LineNr">109 </span> <a href='108write.subx.html#L11'>write</a> stream, text
|
||||
<span id="L110" class="LineNr">110 </span> <span class="PreProc">var</span> xcurr/eax: int <span class="Special"><-</span> <a href='501draw-text.mu.html#L117'>draw-stream-rightward</a> <a href='500fake-screen.mu.html#L16'>screen</a>, stream, x, xmax, y, color, background-color
|
||||
<span id="L111" class="LineNr">111 </span> <span class="PreProc">return</span> xcurr
|
||||
<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="muComment"># draw a single-line stream from x, y to xmax</span>
|
||||
<span id="L115" class="LineNr">115 </span><span class="muComment"># return the next 'x' coordinate</span>
|
||||
<span id="L116" class="LineNr">116 </span><span class="muComment"># if there isn't enough space, truncate</span>
|
||||
<span id="L117" class="LineNr">117 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L117'>draw-stream-rightward</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), stream: (addr stream byte), x: int, xmax: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/eax: int <span class="Delimiter">{</span>
|
||||
<span id="L118" class="LineNr">118 </span> <span class="PreProc">var</span> xcurr/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy x
|
||||
<span id="L119" class="LineNr">119 </span> <span class="Delimiter">{</span>
|
||||
<span id="L120" class="LineNr">120 </span> <span class="PreProc">var</span> g/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L229'>read-code-point-utf8</a> stream
|
||||
<span id="L121" class="LineNr">121 </span> compare g, <span class="Constant">0xffffffff</span>/end-of-file
|
||||
<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> c/eax: code-point <span class="Special"><-</span> <a href='403unicode.mu.html#L49'>to-code-point</a> g
|
||||
<span id="L124" class="LineNr">124 </span> <span class="PreProc">var</span> offset/eax: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L94'>draw-code-point</a> <a href='500fake-screen.mu.html#L16'>screen</a>, c, xcurr, y, color, background-color
|
||||
<span id="L125" class="LineNr">125 </span> xcurr <span class="Special"><-</span> add offset
|
||||
<span id="L126" class="LineNr">126 </span> <span class="PreProc">loop</span>
|
||||
<span id="L127" class="LineNr">127 </span> <span class="Delimiter">}</span>
|
||||
<span id="L128" class="LineNr">128 </span> <a href='500fake-screen.mu.html#L269'>set-cursor-position</a> <a href='500fake-screen.mu.html#L16'>screen</a>, xcurr, y
|
||||
<span id="L129" class="LineNr">129 </span> <span class="PreProc">return</span> xcurr
|
||||
<span id="L130" class="LineNr">130 </span><span class="Delimiter">}</span>
|
||||
<span id="L131" class="LineNr">131 </span>
|
||||
<span id="L132" class="LineNr">132 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L132'>draw-text-rightward-over-full-screen</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), text: (addr array byte), x: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/eax: int <span class="Delimiter">{</span>
|
||||
<span id="L133" class="LineNr">133 </span> <span class="PreProc">var</span> width/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L134" class="LineNr">134 </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="L135" class="LineNr">135 </span> width, height <span class="Special"><-</span> <a href='500fake-screen.mu.html#L75'>screen-size</a> <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L136" class="LineNr">136 </span> <span class="PreProc">var</span> result/eax: int <span class="Special"><-</span> <a href='501draw-text.mu.html#L106'>draw-text-rightward</a> <a href='500fake-screen.mu.html#L16'>screen</a>, text, x, width, y, color, background-color
|
||||
<span id="L137" class="LineNr">137 </span> <span class="PreProc">return</span> result
|
||||
<span id="L138" class="LineNr">138 </span><span class="Delimiter">}</span>
|
||||
<span id="L139" class="LineNr">139 </span>
|
||||
<span id="L140" class="LineNr">140 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L140'>draw-text-rightward-from-cursor</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), text: (addr array byte), xmax: int, color: int, background-color: int <span class="Delimiter">{</span>
|
||||
<span id="L141" class="LineNr">141 </span> <span class="PreProc">var</span> cursor-x/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L142" class="LineNr">142 </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="L143" class="LineNr">143 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L253'>cursor-position</a> <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L144" class="LineNr">144 </span> cursor-x <span class="Special"><-</span> <a href='501draw-text.mu.html#L106'>draw-text-rightward</a> <a href='500fake-screen.mu.html#L16'>screen</a>, text, cursor-x, xmax, cursor-y, color, background-color
|
||||
<span id="L145" class="LineNr">145 </span> <a href='500fake-screen.mu.html#L269'>set-cursor-position</a> <a href='500fake-screen.mu.html#L16'>screen</a>, cursor-x, cursor-y
|
||||
<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'>draw-text-rightward-from-cursor-over-full-screen</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), text: (addr array byte), color: int, background-color: int <span class="Delimiter">{</span>
|
||||
<span id="L149" class="LineNr">149 </span> <span class="PreProc">var</span> width/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L150" class="LineNr">150 </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="L151" class="LineNr">151 </span> width, height <span class="Special"><-</span> <a href='500fake-screen.mu.html#L75'>screen-size</a> <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L152" class="LineNr">152 </span> <a href='501draw-text.mu.html#L140'>draw-text-rightward-from-cursor</a> <a href='500fake-screen.mu.html#L16'>screen</a>, text, width, color, background-color
|
||||
<span id="L153" class="LineNr">153 </span><span class="Delimiter">}</span>
|
||||
<span id="L154" class="LineNr">154 </span>
|
||||
<span id="L155" class="LineNr">155 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L155'>draw-text-rightward-from-cursor-over-full-screen</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), text: (addr array byte), color: int, background-color: int <span class="Delimiter">{</span>
|
||||
<span id="L156" class="LineNr">156 </span> <span class="PreProc">var</span> width/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L157" class="LineNr">157 </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="L158" class="LineNr">158 </span> width, height <span class="Special"><-</span> <a href='500fake-screen.mu.html#L75'>screen-size</a> <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L159" class="LineNr">159 </span> <a href='501draw-text.mu.html#L147'>draw-text-rightward-from-cursor</a> <a href='500fake-screen.mu.html#L16'>screen</a>, text, width, color, background-color
|
||||
<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='501draw-text.mu.html#L162'>render-code-point</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), c: code-point, xmin: int, ymin: int, xmax: int, ymax: int, x: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/eax: int, _/<span class="muRegEcx">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L163" class="LineNr">163 </span> <span class="PreProc">var</span> x/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy x
|
||||
<span id="L164" class="LineNr">164 </span> compare c, <span class="Constant">0xa</span>/newline
|
||||
<span id="L165" class="LineNr">165 </span> <span class="Delimiter">{</span>
|
||||
<span id="L166" class="LineNr">166 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L167" class="LineNr">167 </span> <span class="muComment"># minimum effort to clear cursor</span>
|
||||
<span id="L168" class="LineNr">168 </span> <span class="PreProc">var</span> dummy/eax: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L94'>draw-code-point</a> <a href='500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x20</span>/space, x, y, color, background-color
|
||||
<span id="L169" class="LineNr">169 </span> x <span class="Special"><-</span> copy xmin
|
||||
<span id="L170" class="LineNr">170 </span> increment y
|
||||
<span id="L171" class="LineNr">171 </span> <span class="PreProc">return</span> x, y
|
||||
<span id="L172" class="LineNr">172 </span> <span class="Delimiter">}</span>
|
||||
<span id="L173" class="LineNr">173 </span> <span class="PreProc">var</span> offset/eax: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L94'>draw-code-point</a> <a href='500fake-screen.mu.html#L16'>screen</a>, c, x, y, color, background-color
|
||||
<span id="L174" class="LineNr">174 </span> x <span class="Special"><-</span> add offset
|
||||
<span id="L175" class="LineNr">175 </span> compare x, xmax
|
||||
<span id="L176" class="LineNr">176 </span> <span class="Delimiter">{</span>
|
||||
<span id="L177" class="LineNr">177 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L178" class="LineNr">178 </span> x <span class="Special"><-</span> copy xmin
|
||||
<span id="L179" class="LineNr">179 </span> increment y
|
||||
<span id="L180" class="LineNr">180 </span> <span class="Delimiter">}</span>
|
||||
<span id="L181" class="LineNr">181 </span> <span class="PreProc">return</span> x, y
|
||||
<span id="L182" class="LineNr">182 </span><span class="Delimiter">}</span>
|
||||
<span id="L183" class="LineNr">183 </span>
|
||||
<span id="L184" class="LineNr">184 </span><span class="muComment"># draw text in the rectangle from (xmin, ymin) to (xmax, ymax), starting from (x, y), wrapping as necessary</span>
|
||||
<span id="L185" class="LineNr">185 </span><span class="muComment"># return the next (x, y) coordinate in raster order where drawing stopped</span>
|
||||
<span id="L186" class="LineNr">186 </span><span class="muComment"># that way the caller can draw more if given the same min and max bounding-box.</span>
|
||||
<span id="L187" class="LineNr">187 </span><span class="muComment"># if there isn't enough space, truncate</span>
|
||||
<span id="L188" class="LineNr">188 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L188'>draw-text-wrapping-right-then-down</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>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>_/eax: int, _/<span class="muRegEcx">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L189" class="LineNr">189 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x200</span>/print-buffer-size)
|
||||
<span id="L190" class="LineNr">190 </span> <span class="PreProc">var</span> stream/<span class="muRegEdi">edi</span>: (addr stream byte) <span class="Special"><-</span> address stream-storage
|
||||
<span id="L191" class="LineNr">191 </span> <span class="PreProc">var</span> text/<span class="muRegEsi">esi</span>: (addr array byte) <span class="Special"><-</span> copy _text
|
||||
<span id="L192" class="LineNr">192 </span> <span class="PreProc">var</span> len/eax: int <span class="Special"><-</span> length text
|
||||
<span id="L193" class="LineNr">193 </span> compare len, <span class="Constant">0x200</span>/print-buffer-size
|
||||
<span id="L194" class="LineNr">194 </span> <span class="Delimiter">{</span>
|
||||
<span id="L195" class="LineNr">195 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L196" class="LineNr">196 </span> <a href='108write.subx.html#L11'>write</a> stream, <span class="Constant">"ERROR: stream too small in draw-text-wrapping-right-then-down"</span>
|
||||
<span id="L197" class="LineNr">197 </span> <span class="Delimiter">}</span>
|
||||
<span id="L198" class="LineNr">198 </span> compare len, <span class="Constant">0x200</span>/print-buffer-size
|
||||
<span id="L199" class="LineNr">199 </span> <span class="Delimiter">{</span>
|
||||
<span id="L200" class="LineNr">200 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L201" class="LineNr">201 </span> <a href='108write.subx.html#L11'>write</a> stream, text
|
||||
<span id="L202" class="LineNr">202 </span> <span class="Delimiter">}</span>
|
||||
<span id="L203" class="LineNr">203 </span> <span class="PreProc">var</span> x/eax: int <span class="Special"><-</span> copy _x
|
||||
<span id="L204" class="LineNr">204 </span> <span class="PreProc">var</span> y/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy _y
|
||||
<span id="L205" class="LineNr">205 </span> x, y <span class="Special"><-</span> <a href='501draw-text.mu.html#L213'>draw-stream-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L16'>screen</a>, stream, xmin, ymin, xmax, ymax, x, y, color, background-color
|
||||
<span id="L206" class="LineNr">206 </span> <span class="PreProc">return</span> x, y
|
||||
<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"># draw a stream in the rectangle from (xmin, ymin) to (xmax, ymax), starting from (x, y), wrapping as necessary</span>
|
||||
<span id="L210" class="LineNr">210 </span><span class="muComment"># return the next (x, y) coordinate in raster order where drawing stopped</span>
|
||||
<span id="L211" class="LineNr">211 </span><span class="muComment"># that way the caller can draw more if given the same min and max bounding-box.</span>
|
||||
<span id="L212" class="LineNr">212 </span><span class="muComment"># if there isn't enough space, truncate</span>
|
||||
<span id="L213" class="LineNr">213 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L213'>draw-stream-wrapping-right-then-down</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>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>_/eax: int, _/<span class="muRegEcx">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L214" class="LineNr">214 </span> <span class="PreProc">var</span> xcurr/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy x
|
||||
<span id="L215" class="LineNr">215 </span> <span class="PreProc">var</span> ycurr/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy y
|
||||
<span id="L216" class="LineNr">216 </span> <span class="PreProc">var</span> c/<span class="muRegEbx">ebx</span>: code-point <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L217" class="LineNr">217 </span> <span class="PreProc">var</span> next-c/<span class="muRegEsi">esi</span>: code-point <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L218" class="LineNr">218 </span> $draw-stream-wrapping-right-then-down:<span class="PreProc">loop</span>: <span class="Delimiter">{</span>
|
||||
<span id="L219" class="LineNr">219 </span> <span class="muComment"># read c from either next-c or stream</span>
|
||||
<span id="L220" class="LineNr">220 </span> $draw-stream-wrapping-right-then-down:read-base: <span class="Delimiter">{</span>
|
||||
<span id="L221" class="LineNr">221 </span> compare next-c, <span class="Constant">0</span>
|
||||
<span id="L222" class="LineNr">222 </span> <span class="Delimiter">{</span>
|
||||
<span id="L223" class="LineNr">223 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L224" class="LineNr">224 </span> c <span class="Special"><-</span> copy next-c
|
||||
<span id="L225" class="LineNr">225 </span> next-c <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L226" class="LineNr">226 </span> <span class="PreProc">break</span> $draw-stream-wrapping-right-then-down:read-base
|
||||
<span id="L227" class="LineNr">227 </span> <span class="Delimiter">}</span>
|
||||
<span id="L228" class="LineNr">228 </span> <span class="PreProc">var</span> g/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L236'>read-grapheme</a> stream
|
||||
<span id="L229" class="LineNr">229 </span> <span class="PreProc">var</span> _c/eax: code-point <span class="Special"><-</span> <a href='403unicode.mu.html#L56'>to-code-point</a> g
|
||||
<span id="L230" class="LineNr">230 </span> c <span class="Special"><-</span> copy _c
|
||||
<span id="L231" class="LineNr">231 </span> <span class="Delimiter">}</span>
|
||||
<span id="L232" class="LineNr">232 </span> compare c, <span class="Constant">0xffffffff</span>/end-of-file
|
||||
<span id="L233" class="LineNr">233 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L234" class="LineNr">234 </span> compare c, <span class="Constant">0xa</span>/newline
|
||||
<span id="L235" class="LineNr">235 </span> <span class="Delimiter">{</span>
|
||||
<span id="L236" class="LineNr">236 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L237" class="LineNr">237 </span> <span class="muComment"># minimum effort to clear cursor</span>
|
||||
<span id="L238" class="LineNr">238 </span> <span class="PreProc">var</span> dummy/eax: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L94'>draw-code-point</a> <a href='500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x20</span>/space, xcurr, ycurr, color, background-color
|
||||
<span id="L239" class="LineNr">239 </span> xcurr <span class="Special"><-</span> copy xmin
|
||||
<span id="L240" class="LineNr">240 </span> ycurr <span class="Special"><-</span> increment
|
||||
<span id="L241" class="LineNr">241 </span> <span class="PreProc">loop</span> $draw-stream-wrapping-right-then-down:<span class="PreProc">loop</span>
|
||||
<span id="L242" class="LineNr">242 </span> <span class="Delimiter">}</span>
|
||||
<span id="L243" class="LineNr">243 </span> <span class="PreProc">var</span> offset/eax: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L94'>draw-code-point</a> <a href='500fake-screen.mu.html#L16'>screen</a>, c, xcurr, ycurr, color, background-color
|
||||
<span id="L244" class="LineNr">244 </span> <span class="muComment"># overlay a combining character if necessary</span>
|
||||
<span id="L245" class="LineNr">245 </span> $draw-stream-wrapping-right-then-down:read-combiner: <span class="Delimiter">{</span>
|
||||
<span id="L246" class="LineNr">246 </span> <span class="PreProc">var</span> done?/eax: boolean <span class="Special"><-</span> <a href='309stream.subx.html#L6'>stream-empty?</a> stream
|
||||
<span id="L247" class="LineNr">247 </span> compare done?, <span class="Constant">0</span>/false
|
||||
<span id="L248" class="LineNr">248 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L249" class="LineNr">249 </span> <span class="muComment"># read a character</span>
|
||||
<span id="L250" class="LineNr">250 </span> <span class="PreProc">var</span> g/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L236'>read-grapheme</a> stream
|
||||
<span id="L251" class="LineNr">251 </span> <span class="PreProc">var</span> c/eax: code-point <span class="Special"><-</span> <a href='403unicode.mu.html#L56'>to-code-point</a> g
|
||||
<span id="L252" class="LineNr">252 </span> <span class="muComment"># if not a combining character, save for next iteration and loop</span>
|
||||
<span id="L253" class="LineNr">253 </span> <span class="Delimiter">{</span>
|
||||
<span id="L254" class="LineNr">254 </span> <span class="PreProc">var</span> <a href='103glyph.subx.html#L157'>combining-code-point?</a>/eax: boolean <span class="Special"><-</span> <a href='103glyph.subx.html#L157'>combining-code-point?</a> c
|
||||
<span id="L255" class="LineNr">255 </span> compare <a href='103glyph.subx.html#L157'>combining-code-point?</a>, <span class="Constant">0</span>/false
|
||||
<span id="L256" class="LineNr">256 </span> <span class="Delimiter">}</span>
|
||||
<span id="L257" class="LineNr">257 </span> <span class="Delimiter">{</span>
|
||||
<span id="L258" class="LineNr">258 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L259" class="LineNr">259 </span> next-c <span class="Special"><-</span> copy c
|
||||
<span id="L260" class="LineNr">260 </span> <span class="PreProc">break</span> $draw-stream-wrapping-right-then-down:read-combiner
|
||||
<span id="L261" class="LineNr">261 </span> <span class="Delimiter">}</span>
|
||||
<span id="L262" class="LineNr">262 </span> <span class="muComment"># otherwise overlay it without saving its width</span>
|
||||
<span id="L263" class="LineNr">263 </span> <span class="muComment"># This means strange results if a base and its combiner have different</span>
|
||||
<span id="L264" class="LineNr">264 </span> <span class="muComment"># widths. We'll always follow the base width.</span>
|
||||
<span id="L265" class="LineNr">265 </span> <span class="PreProc">var</span> dummy/eax: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L114'>overlay-code-point</a> <a href='500fake-screen.mu.html#L16'>screen</a>, c, xcurr, ycurr, color, background-color
|
||||
<span id="L155" class="LineNr">155 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L155'>render-code-point</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), c: code-point, xmin: int, ymin: int, xmax: int, ymax: int, x: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/eax: int, _/<span class="muRegEcx">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L156" class="LineNr">156 </span> <span class="PreProc">var</span> x/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy x
|
||||
<span id="L157" class="LineNr">157 </span> compare c, <span class="Constant">0xa</span>/newline
|
||||
<span id="L158" class="LineNr">158 </span> <span class="Delimiter">{</span>
|
||||
<span id="L159" class="LineNr">159 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L160" class="LineNr">160 </span> <span class="muComment"># minimum effort to clear cursor</span>
|
||||
<span id="L161" class="LineNr">161 </span> <span class="PreProc">var</span> dummy/eax: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L94'>draw-code-point</a> <a href='500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x20</span>/space, x, y, color, background-color
|
||||
<span id="L162" class="LineNr">162 </span> x <span class="Special"><-</span> copy xmin
|
||||
<span id="L163" class="LineNr">163 </span> increment y
|
||||
<span id="L164" class="LineNr">164 </span> <span class="PreProc">return</span> x, y
|
||||
<span id="L165" class="LineNr">165 </span> <span class="Delimiter">}</span>
|
||||
<span id="L166" class="LineNr">166 </span> <span class="PreProc">var</span> offset/eax: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L94'>draw-code-point</a> <a href='500fake-screen.mu.html#L16'>screen</a>, c, x, y, color, background-color
|
||||
<span id="L167" class="LineNr">167 </span> x <span class="Special"><-</span> add offset
|
||||
<span id="L168" class="LineNr">168 </span> compare x, xmax
|
||||
<span id="L169" class="LineNr">169 </span> <span class="Delimiter">{</span>
|
||||
<span id="L170" class="LineNr">170 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L171" class="LineNr">171 </span> x <span class="Special"><-</span> copy xmin
|
||||
<span id="L172" class="LineNr">172 </span> increment y
|
||||
<span id="L173" class="LineNr">173 </span> <span class="Delimiter">}</span>
|
||||
<span id="L174" class="LineNr">174 </span> <span class="PreProc">return</span> x, y
|
||||
<span id="L175" class="LineNr">175 </span><span class="Delimiter">}</span>
|
||||
<span id="L176" class="LineNr">176 </span>
|
||||
<span id="L177" class="LineNr">177 </span><span class="muComment"># draw text in the rectangle from (xmin, ymin) to (xmax, ymax), starting from (x, y), wrapping as necessary</span>
|
||||
<span id="L178" class="LineNr">178 </span><span class="muComment"># return the next (x, y) coordinate in raster order where drawing stopped</span>
|
||||
<span id="L179" class="LineNr">179 </span><span class="muComment"># that way the caller can draw more if given the same min and max bounding-box.</span>
|
||||
<span id="L180" class="LineNr">180 </span><span class="muComment"># if there isn't enough space, truncate</span>
|
||||
<span id="L181" class="LineNr">181 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L181'>draw-text-wrapping-right-then-down</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>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>_/eax: int, _/<span class="muRegEcx">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L182" class="LineNr">182 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x200</span>/print-buffer-size)
|
||||
<span id="L183" class="LineNr">183 </span> <span class="PreProc">var</span> stream/<span class="muRegEdi">edi</span>: (addr stream byte) <span class="Special"><-</span> address stream-storage
|
||||
<span id="L184" class="LineNr">184 </span> <span class="PreProc">var</span> text/<span class="muRegEsi">esi</span>: (addr array byte) <span class="Special"><-</span> copy _text
|
||||
<span id="L185" class="LineNr">185 </span> <span class="PreProc">var</span> len/eax: int <span class="Special"><-</span> length text
|
||||
<span id="L186" class="LineNr">186 </span> compare len, <span class="Constant">0x200</span>/print-buffer-size
|
||||
<span id="L187" class="LineNr">187 </span> <span class="Delimiter">{</span>
|
||||
<span id="L188" class="LineNr">188 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L189" class="LineNr">189 </span> <a href='108write.subx.html#L11'>write</a> stream, <span class="Constant">"ERROR: stream too small in draw-text-wrapping-right-then-down"</span>
|
||||
<span id="L190" class="LineNr">190 </span> <span class="Delimiter">}</span>
|
||||
<span id="L191" class="LineNr">191 </span> compare len, <span class="Constant">0x200</span>/print-buffer-size
|
||||
<span id="L192" class="LineNr">192 </span> <span class="Delimiter">{</span>
|
||||
<span id="L193" class="LineNr">193 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L194" class="LineNr">194 </span> <a href='108write.subx.html#L11'>write</a> stream, text
|
||||
<span id="L195" class="LineNr">195 </span> <span class="Delimiter">}</span>
|
||||
<span id="L196" class="LineNr">196 </span> <span class="PreProc">var</span> x/eax: int <span class="Special"><-</span> copy _x
|
||||
<span id="L197" class="LineNr">197 </span> <span class="PreProc">var</span> y/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy _y
|
||||
<span id="L198" class="LineNr">198 </span> x, y <span class="Special"><-</span> <a href='501draw-text.mu.html#L206'>draw-stream-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L16'>screen</a>, stream, xmin, ymin, xmax, ymax, x, y, color, background-color
|
||||
<span id="L199" class="LineNr">199 </span> <span class="PreProc">return</span> x, y
|
||||
<span id="L200" class="LineNr">200 </span><span class="Delimiter">}</span>
|
||||
<span id="L201" class="LineNr">201 </span>
|
||||
<span id="L202" class="LineNr">202 </span><span class="muComment"># draw a stream in the rectangle from (xmin, ymin) to (xmax, ymax), starting from (x, y), wrapping as necessary</span>
|
||||
<span id="L203" class="LineNr">203 </span><span class="muComment"># return the next (x, y) coordinate in raster order where drawing stopped</span>
|
||||
<span id="L204" class="LineNr">204 </span><span class="muComment"># that way the caller can draw more if given the same min and max bounding-box.</span>
|
||||
<span id="L205" class="LineNr">205 </span><span class="muComment"># if there isn't enough space, truncate</span>
|
||||
<span id="L206" class="LineNr">206 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L206'>draw-stream-wrapping-right-then-down</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>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>_/eax: int, _/<span class="muRegEcx">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L207" class="LineNr">207 </span> <span class="PreProc">var</span> xcurr/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy x
|
||||
<span id="L208" class="LineNr">208 </span> <span class="PreProc">var</span> ycurr/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy y
|
||||
<span id="L209" class="LineNr">209 </span> <span class="PreProc">var</span> c/<span class="muRegEbx">ebx</span>: code-point <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L210" class="LineNr">210 </span> <span class="PreProc">var</span> next-c/<span class="muRegEsi">esi</span>: code-point <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L211" class="LineNr">211 </span> $draw-stream-wrapping-right-then-down:<span class="PreProc">loop</span>: <span class="Delimiter">{</span>
|
||||
<span id="L212" class="LineNr">212 </span> <span class="muComment"># read c from either next-c or stream</span>
|
||||
<span id="L213" class="LineNr">213 </span> $draw-stream-wrapping-right-then-down:read-base: <span class="Delimiter">{</span>
|
||||
<span id="L214" class="LineNr">214 </span> compare next-c, <span class="Constant">0</span>
|
||||
<span id="L215" class="LineNr">215 </span> <span class="Delimiter">{</span>
|
||||
<span id="L216" class="LineNr">216 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L217" class="LineNr">217 </span> c <span class="Special"><-</span> copy next-c
|
||||
<span id="L218" class="LineNr">218 </span> next-c <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L219" class="LineNr">219 </span> <span class="PreProc">break</span> $draw-stream-wrapping-right-then-down:read-base
|
||||
<span id="L220" class="LineNr">220 </span> <span class="Delimiter">}</span>
|
||||
<span id="L221" class="LineNr">221 </span> <span class="PreProc">var</span> g/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L229'>read-code-point-utf8</a> stream
|
||||
<span id="L222" class="LineNr">222 </span> <span class="PreProc">var</span> _c/eax: code-point <span class="Special"><-</span> <a href='403unicode.mu.html#L49'>to-code-point</a> g
|
||||
<span id="L223" class="LineNr">223 </span> c <span class="Special"><-</span> copy _c
|
||||
<span id="L224" class="LineNr">224 </span> <span class="Delimiter">}</span>
|
||||
<span id="L225" class="LineNr">225 </span> compare c, <span class="Constant">0xffffffff</span>/end-of-file
|
||||
<span id="L226" class="LineNr">226 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L227" class="LineNr">227 </span> compare c, <span class="Constant">0xa</span>/newline
|
||||
<span id="L228" class="LineNr">228 </span> <span class="Delimiter">{</span>
|
||||
<span id="L229" class="LineNr">229 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L230" class="LineNr">230 </span> <span class="muComment"># minimum effort to clear cursor</span>
|
||||
<span id="L231" class="LineNr">231 </span> <span class="PreProc">var</span> dummy/eax: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L94'>draw-code-point</a> <a href='500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x20</span>/space, xcurr, ycurr, color, background-color
|
||||
<span id="L232" class="LineNr">232 </span> xcurr <span class="Special"><-</span> copy xmin
|
||||
<span id="L233" class="LineNr">233 </span> ycurr <span class="Special"><-</span> increment
|
||||
<span id="L234" class="LineNr">234 </span> <span class="PreProc">loop</span> $draw-stream-wrapping-right-then-down:<span class="PreProc">loop</span>
|
||||
<span id="L235" class="LineNr">235 </span> <span class="Delimiter">}</span>
|
||||
<span id="L236" class="LineNr">236 </span> <span class="PreProc">var</span> offset/eax: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L94'>draw-code-point</a> <a href='500fake-screen.mu.html#L16'>screen</a>, c, xcurr, ycurr, color, background-color
|
||||
<span id="L237" class="LineNr">237 </span> <span class="muComment"># overlay a combining character if necessary</span>
|
||||
<span id="L238" class="LineNr">238 </span> $draw-stream-wrapping-right-then-down:read-combiner: <span class="Delimiter">{</span>
|
||||
<span id="L239" class="LineNr">239 </span> <span class="PreProc">var</span> done?/eax: boolean <span class="Special"><-</span> <a href='309stream.subx.html#L6'>stream-empty?</a> stream
|
||||
<span id="L240" class="LineNr">240 </span> compare done?, <span class="Constant">0</span>/false
|
||||
<span id="L241" class="LineNr">241 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L242" class="LineNr">242 </span> <span class="muComment"># read a character</span>
|
||||
<span id="L243" class="LineNr">243 </span> <span class="PreProc">var</span> g/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L229'>read-code-point-utf8</a> stream
|
||||
<span id="L244" class="LineNr">244 </span> <span class="PreProc">var</span> c/eax: code-point <span class="Special"><-</span> <a href='403unicode.mu.html#L49'>to-code-point</a> g
|
||||
<span id="L245" class="LineNr">245 </span> <span class="muComment"># if not a combining character, save for next iteration and loop</span>
|
||||
<span id="L246" class="LineNr">246 </span> <span class="Delimiter">{</span>
|
||||
<span id="L247" class="LineNr">247 </span> <span class="PreProc">var</span> <a href='103glyph.subx.html#L157'>combining-code-point?</a>/eax: boolean <span class="Special"><-</span> <a href='103glyph.subx.html#L157'>combining-code-point?</a> c
|
||||
<span id="L248" class="LineNr">248 </span> compare <a href='103glyph.subx.html#L157'>combining-code-point?</a>, <span class="Constant">0</span>/false
|
||||
<span id="L249" class="LineNr">249 </span> <span class="Delimiter">}</span>
|
||||
<span id="L250" class="LineNr">250 </span> <span class="Delimiter">{</span>
|
||||
<span id="L251" class="LineNr">251 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L252" class="LineNr">252 </span> next-c <span class="Special"><-</span> copy c
|
||||
<span id="L253" class="LineNr">253 </span> <span class="PreProc">break</span> $draw-stream-wrapping-right-then-down:read-combiner
|
||||
<span id="L254" class="LineNr">254 </span> <span class="Delimiter">}</span>
|
||||
<span id="L255" class="LineNr">255 </span> <span class="muComment"># otherwise overlay it without saving its width</span>
|
||||
<span id="L256" class="LineNr">256 </span> <span class="muComment"># This means strange results if a base and its combiner have different</span>
|
||||
<span id="L257" class="LineNr">257 </span> <span class="muComment"># widths. We'll always follow the base width.</span>
|
||||
<span id="L258" class="LineNr">258 </span> <span class="PreProc">var</span> dummy/eax: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L114'>overlay-code-point</a> <a href='500fake-screen.mu.html#L16'>screen</a>, c, xcurr, ycurr, color, background-color
|
||||
<span id="L259" class="LineNr">259 </span> <span class="Delimiter">}</span>
|
||||
<span id="L260" class="LineNr">260 </span> xcurr <span class="Special"><-</span> add offset
|
||||
<span id="L261" class="LineNr">261 </span> compare xcurr, xmax
|
||||
<span id="L262" class="LineNr">262 </span> <span class="Delimiter">{</span>
|
||||
<span id="L263" class="LineNr">263 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L264" class="LineNr">264 </span> xcurr <span class="Special"><-</span> copy xmin
|
||||
<span id="L265" class="LineNr">265 </span> ycurr <span class="Special"><-</span> increment
|
||||
<span id="L266" class="LineNr">266 </span> <span class="Delimiter">}</span>
|
||||
<span id="L267" class="LineNr">267 </span> xcurr <span class="Special"><-</span> add offset
|
||||
<span id="L268" class="LineNr">268 </span> compare xcurr, xmax
|
||||
<span id="L269" class="LineNr">269 </span> <span class="Delimiter">{</span>
|
||||
<span id="L270" class="LineNr">270 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L271" class="LineNr">271 </span> xcurr <span class="Special"><-</span> copy xmin
|
||||
<span id="L272" class="LineNr">272 </span> ycurr <span class="Special"><-</span> increment
|
||||
<span id="L273" class="LineNr">273 </span> <span class="Delimiter">}</span>
|
||||
<span id="L274" class="LineNr">274 </span> <span class="PreProc">loop</span>
|
||||
<span id="L275" class="LineNr">275 </span> <span class="Delimiter">}</span>
|
||||
<span id="L276" class="LineNr">276 </span> <a href='500fake-screen.mu.html#L269'>set-cursor-position</a> <a href='500fake-screen.mu.html#L16'>screen</a>, xcurr, ycurr
|
||||
<span id="L277" class="LineNr">277 </span> <span class="PreProc">return</span> xcurr, ycurr
|
||||
<span id="L278" class="LineNr">278 </span><span class="Delimiter">}</span>
|
||||
<span id="L279" class="LineNr">279 </span>
|
||||
<span id="L280" class="LineNr">280 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L280'>draw-stream-wrapping-right-then-down-from-cursor</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>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="L281" class="LineNr">281 </span> <span class="PreProc">var</span> cursor-x/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L282" class="LineNr">282 </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="L283" class="LineNr">283 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L253'>cursor-position</a> <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L284" class="LineNr">284 </span> <span class="PreProc">var</span> end-x/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy cursor-x
|
||||
<span id="L285" class="LineNr">285 </span> end-x <span class="Special"><-</span> increment
|
||||
<span id="L286" class="LineNr">286 </span> compare end-x, xmax
|
||||
<span id="L287" class="LineNr">287 </span> <span class="Delimiter">{</span>
|
||||
<span id="L288" class="LineNr">288 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L289" class="LineNr">289 </span> cursor-x <span class="Special"><-</span> copy xmin
|
||||
<span id="L290" class="LineNr">290 </span> cursor-y <span class="Special"><-</span> increment
|
||||
<span id="L291" class="LineNr">291 </span> <span class="Delimiter">}</span>
|
||||
<span id="L292" class="LineNr">292 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='501draw-text.mu.html#L213'>draw-stream-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L16'>screen</a>, stream, xmin, ymin, xmax, ymax, cursor-x, cursor-y, color, background-color
|
||||
<span id="L267" class="LineNr">267 </span> <span class="PreProc">loop</span>
|
||||
<span id="L268" class="LineNr">268 </span> <span class="Delimiter">}</span>
|
||||
<span id="L269" class="LineNr">269 </span> <a href='500fake-screen.mu.html#L269'>set-cursor-position</a> <a href='500fake-screen.mu.html#L16'>screen</a>, xcurr, ycurr
|
||||
<span id="L270" class="LineNr">270 </span> <span class="PreProc">return</span> xcurr, ycurr
|
||||
<span id="L271" class="LineNr">271 </span><span class="Delimiter">}</span>
|
||||
<span id="L272" class="LineNr">272 </span>
|
||||
<span id="L273" class="LineNr">273 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L273'>draw-stream-wrapping-right-then-down-from-cursor</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>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="L274" class="LineNr">274 </span> <span class="PreProc">var</span> cursor-x/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L275" class="LineNr">275 </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="L276" class="LineNr">276 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L253'>cursor-position</a> <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L277" class="LineNr">277 </span> <span class="PreProc">var</span> end-x/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy cursor-x
|
||||
<span id="L278" class="LineNr">278 </span> end-x <span class="Special"><-</span> increment
|
||||
<span id="L279" class="LineNr">279 </span> compare end-x, xmax
|
||||
<span id="L280" class="LineNr">280 </span> <span class="Delimiter">{</span>
|
||||
<span id="L281" class="LineNr">281 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L282" class="LineNr">282 </span> cursor-x <span class="Special"><-</span> copy xmin
|
||||
<span id="L283" class="LineNr">283 </span> cursor-y <span class="Special"><-</span> increment
|
||||
<span id="L284" class="LineNr">284 </span> <span class="Delimiter">}</span>
|
||||
<span id="L285" class="LineNr">285 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='501draw-text.mu.html#L206'>draw-stream-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L16'>screen</a>, stream, xmin, ymin, xmax, ymax, cursor-x, cursor-y, color, background-color
|
||||
<span id="L286" class="LineNr">286 </span><span class="Delimiter">}</span>
|
||||
<span id="L287" class="LineNr">287 </span>
|
||||
<span id="L288" class="LineNr">288 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L288'>draw-stream-wrapping-right-then-down-from-cursor-over-full-screen</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), stream: (addr stream byte), color: int, background-color: int <span class="Delimiter">{</span>
|
||||
<span id="L289" class="LineNr">289 </span> <span class="PreProc">var</span> width/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L290" class="LineNr">290 </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="L291" class="LineNr">291 </span> width, height <span class="Special"><-</span> <a href='500fake-screen.mu.html#L75'>screen-size</a> <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L292" class="LineNr">292 </span> <a href='501draw-text.mu.html#L273'>draw-stream-wrapping-right-then-down-from-cursor</a> <a href='500fake-screen.mu.html#L16'>screen</a>, stream, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, width, height, color, background-color
|
||||
<span id="L293" class="LineNr">293 </span><span class="Delimiter">}</span>
|
||||
<span id="L294" class="LineNr">294 </span>
|
||||
<span id="L295" class="LineNr">295 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L295'>draw-stream-wrapping-right-then-down-from-cursor-over-full-screen</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), stream: (addr stream byte), color: int, background-color: int <span class="Delimiter">{</span>
|
||||
<span id="L296" class="LineNr">296 </span> <span class="PreProc">var</span> width/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L297" class="LineNr">297 </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="L298" class="LineNr">298 </span> width, height <span class="Special"><-</span> <a href='500fake-screen.mu.html#L75'>screen-size</a> <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L299" class="LineNr">299 </span> <a href='501draw-text.mu.html#L280'>draw-stream-wrapping-right-then-down-from-cursor</a> <a href='500fake-screen.mu.html#L16'>screen</a>, stream, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, width, height, color, background-color
|
||||
<span id="L300" class="LineNr">300 </span><span class="Delimiter">}</span>
|
||||
<span id="L301" class="LineNr">301 </span>
|
||||
<span id="L302" class="LineNr">302 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L302'>move-cursor-rightward-and-downward</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), xmin: int, xmax: int <span class="Delimiter">{</span>
|
||||
<span id="L303" class="LineNr">303 </span> <span class="PreProc">var</span> cursor-x/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L304" class="LineNr">304 </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="L305" class="LineNr">305 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L253'>cursor-position</a> <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L306" class="LineNr">306 </span> cursor-x <span class="Special"><-</span> increment
|
||||
<span id="L307" class="LineNr">307 </span> compare cursor-x, xmax
|
||||
<span id="L308" class="LineNr">308 </span> <span class="Delimiter">{</span>
|
||||
<span id="L309" class="LineNr">309 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L310" class="LineNr">310 </span> cursor-x <span class="Special"><-</span> copy xmin
|
||||
<span id="L311" class="LineNr">311 </span> cursor-y <span class="Special"><-</span> increment
|
||||
<span id="L312" class="LineNr">312 </span> <span class="Delimiter">}</span>
|
||||
<span id="L313" class="LineNr">313 </span> <a href='500fake-screen.mu.html#L269'>set-cursor-position</a> <a href='500fake-screen.mu.html#L16'>screen</a>, cursor-x, cursor-y
|
||||
<span id="L314" class="LineNr">314 </span><span class="Delimiter">}</span>
|
||||
<span id="L315" class="LineNr">315 </span>
|
||||
<span id="L316" class="LineNr">316 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L316'>draw-text-wrapping-right-then-down-over-full-screen</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), text: (addr array byte), x: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/eax: int, _/<span class="muRegEcx">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L317" class="LineNr">317 </span> <span class="PreProc">var</span> x2/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L318" class="LineNr">318 </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="L319" class="LineNr">319 </span> x2, y2 <span class="Special"><-</span> <a href='500fake-screen.mu.html#L75'>screen-size</a> <a href='500fake-screen.mu.html#L16'>screen</a> <span class="muComment"># width, height</span>
|
||||
<span id="L320" class="LineNr">320 </span> x2, y2 <span class="Special"><-</span> <a href='501draw-text.mu.html#L188'>draw-text-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L16'>screen</a>, text, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, x2, y2, x, y, color, background-color
|
||||
<span id="L321" class="LineNr">321 </span> <span class="PreProc">return</span> x2, y2 <span class="muComment"># cursor-x, cursor-y</span>
|
||||
<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="muFunction"><a href='501draw-text.mu.html#L324'>draw-text-wrapping-right-then-down-from-cursor</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>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="L325" class="LineNr">325 </span> <span class="PreProc">var</span> cursor-x/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L326" class="LineNr">326 </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="L327" class="LineNr">327 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L253'>cursor-position</a> <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L328" class="LineNr">328 </span> <span class="PreProc">var</span> end-x/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy cursor-x
|
||||
<span id="L329" class="LineNr">329 </span> end-x <span class="Special"><-</span> increment
|
||||
<span id="L330" class="LineNr">330 </span> compare end-x, xmax
|
||||
<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> cursor-x <span class="Special"><-</span> copy xmin
|
||||
<span id="L334" class="LineNr">334 </span> cursor-y <span class="Special"><-</span> increment
|
||||
<span id="L335" class="LineNr">335 </span> <span class="Delimiter">}</span>
|
||||
<span id="L336" class="LineNr">336 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='501draw-text.mu.html#L188'>draw-text-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L16'>screen</a>, text, xmin, ymin, xmax, ymax, cursor-x, cursor-y, color, background-color
|
||||
<span id="L295" class="LineNr">295 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L295'>move-cursor-rightward-and-downward</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), xmin: int, xmax: int <span class="Delimiter">{</span>
|
||||
<span id="L296" class="LineNr">296 </span> <span class="PreProc">var</span> cursor-x/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L297" class="LineNr">297 </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="L298" class="LineNr">298 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L253'>cursor-position</a> <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L299" class="LineNr">299 </span> cursor-x <span class="Special"><-</span> increment
|
||||
<span id="L300" class="LineNr">300 </span> compare cursor-x, xmax
|
||||
<span id="L301" class="LineNr">301 </span> <span class="Delimiter">{</span>
|
||||
<span id="L302" class="LineNr">302 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L303" class="LineNr">303 </span> cursor-x <span class="Special"><-</span> copy xmin
|
||||
<span id="L304" class="LineNr">304 </span> cursor-y <span class="Special"><-</span> increment
|
||||
<span id="L305" class="LineNr">305 </span> <span class="Delimiter">}</span>
|
||||
<span id="L306" class="LineNr">306 </span> <a href='500fake-screen.mu.html#L269'>set-cursor-position</a> <a href='500fake-screen.mu.html#L16'>screen</a>, cursor-x, cursor-y
|
||||
<span id="L307" class="LineNr">307 </span><span class="Delimiter">}</span>
|
||||
<span id="L308" class="LineNr">308 </span>
|
||||
<span id="L309" class="LineNr">309 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L309'>draw-text-wrapping-right-then-down-over-full-screen</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), text: (addr array byte), x: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/eax: int, _/<span class="muRegEcx">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L310" class="LineNr">310 </span> <span class="PreProc">var</span> x2/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L311" class="LineNr">311 </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="L312" class="LineNr">312 </span> x2, y2 <span class="Special"><-</span> <a href='500fake-screen.mu.html#L75'>screen-size</a> <a href='500fake-screen.mu.html#L16'>screen</a> <span class="muComment"># width, height</span>
|
||||
<span id="L313" class="LineNr">313 </span> x2, y2 <span class="Special"><-</span> <a href='501draw-text.mu.html#L181'>draw-text-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L16'>screen</a>, text, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, x2, y2, x, y, color, background-color
|
||||
<span id="L314" class="LineNr">314 </span> <span class="PreProc">return</span> x2, y2 <span class="muComment"># cursor-x, cursor-y</span>
|
||||
<span id="L315" class="LineNr">315 </span><span class="Delimiter">}</span>
|
||||
<span id="L316" class="LineNr">316 </span>
|
||||
<span id="L317" class="LineNr">317 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L317'>draw-text-wrapping-right-then-down-from-cursor</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>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="L318" class="LineNr">318 </span> <span class="PreProc">var</span> cursor-x/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L319" class="LineNr">319 </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="L320" class="LineNr">320 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L253'>cursor-position</a> <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L321" class="LineNr">321 </span> <span class="PreProc">var</span> end-x/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy cursor-x
|
||||
<span id="L322" class="LineNr">322 </span> end-x <span class="Special"><-</span> increment
|
||||
<span id="L323" class="LineNr">323 </span> compare end-x, xmax
|
||||
<span id="L324" class="LineNr">324 </span> <span class="Delimiter">{</span>
|
||||
<span id="L325" class="LineNr">325 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L326" class="LineNr">326 </span> cursor-x <span class="Special"><-</span> copy xmin
|
||||
<span id="L327" class="LineNr">327 </span> cursor-y <span class="Special"><-</span> increment
|
||||
<span id="L328" class="LineNr">328 </span> <span class="Delimiter">}</span>
|
||||
<span id="L329" class="LineNr">329 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='501draw-text.mu.html#L181'>draw-text-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L16'>screen</a>, text, xmin, ymin, xmax, ymax, cursor-x, cursor-y, color, background-color
|
||||
<span id="L330" class="LineNr">330 </span><span class="Delimiter">}</span>
|
||||
<span id="L331" class="LineNr">331 </span>
|
||||
<span id="L332" class="LineNr">332 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), text: (addr array byte), color: int, background-color: int <span class="Delimiter">{</span>
|
||||
<span id="L333" class="LineNr">333 </span> <span class="PreProc">var</span> width/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L334" class="LineNr">334 </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="L335" class="LineNr">335 </span> width, height <span class="Special"><-</span> <a href='500fake-screen.mu.html#L75'>screen-size</a> <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L336" class="LineNr">336 </span> <a href='501draw-text.mu.html#L317'>draw-text-wrapping-right-then-down-from-cursor</a> <a href='500fake-screen.mu.html#L16'>screen</a>, text, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, width, height, color, background-color
|
||||
<span id="L337" class="LineNr">337 </span><span class="Delimiter">}</span>
|
||||
<span id="L338" class="LineNr">338 </span>
|
||||
<span id="L339" class="LineNr">339 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), text: (addr array byte), color: int, background-color: int <span class="Delimiter">{</span>
|
||||
<span id="L340" class="LineNr">340 </span> <span class="PreProc">var</span> width/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L341" class="LineNr">341 </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="L342" class="LineNr">342 </span> width, height <span class="Special"><-</span> <a href='500fake-screen.mu.html#L75'>screen-size</a> <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L343" class="LineNr">343 </span> <a href='501draw-text.mu.html#L324'>draw-text-wrapping-right-then-down-from-cursor</a> <a href='500fake-screen.mu.html#L16'>screen</a>, text, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, width, height, color, background-color
|
||||
<span id="L344" class="LineNr">344 </span><span class="Delimiter">}</span>
|
||||
<span id="L345" class="LineNr">345 </span>
|
||||
<span id="L346" class="LineNr">346 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L346'>draw-int32-hex-wrapping-right-then-down</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>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>_/eax: int, _/<span class="muRegEcx">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L347" class="LineNr">347 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x100</span>)
|
||||
<span id="L348" class="LineNr">348 </span> <span class="PreProc">var</span> stream/<span class="muRegEsi">esi</span>: (addr stream byte) <span class="Special"><-</span> address stream-storage
|
||||
<span id="L349" class="LineNr">349 </span> <a href='117write-int-hex.subx.html#L92'>write-int32-hex</a> stream, n
|
||||
<span id="L350" class="LineNr">350 </span> <span class="PreProc">var</span> xcurr/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy x
|
||||
<span id="L351" class="LineNr">351 </span> <span class="PreProc">var</span> ycurr/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy y
|
||||
<span id="L352" class="LineNr">352 </span> <span class="Delimiter">{</span>
|
||||
<span id="L353" class="LineNr">353 </span> <span class="PreProc">var</span> g/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L236'>read-grapheme</a> stream
|
||||
<span id="L354" class="LineNr">354 </span> compare g, <span class="Constant">0xffffffff</span>/end-of-file
|
||||
<span id="L355" class="LineNr">355 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L356" class="LineNr">356 </span> <span class="PreProc">var</span> c/eax: code-point <span class="Special"><-</span> <a href='403unicode.mu.html#L56'>to-code-point</a> g
|
||||
<span id="L357" class="LineNr">357 </span> <span class="PreProc">var</span> offset/eax: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L94'>draw-code-point</a> <a href='500fake-screen.mu.html#L16'>screen</a>, c, xcurr, ycurr, color, background-color
|
||||
<span id="L358" class="LineNr">358 </span> xcurr <span class="Special"><-</span> add offset
|
||||
<span id="L359" class="LineNr">359 </span> compare xcurr, xmax
|
||||
<span id="L360" class="LineNr">360 </span> <span class="Delimiter">{</span>
|
||||
<span id="L361" class="LineNr">361 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L362" class="LineNr">362 </span> xcurr <span class="Special"><-</span> copy xmin
|
||||
<span id="L363" class="LineNr">363 </span> ycurr <span class="Special"><-</span> increment
|
||||
<span id="L364" class="LineNr">364 </span> <span class="Delimiter">}</span>
|
||||
<span id="L365" class="LineNr">365 </span> <span class="PreProc">loop</span>
|
||||
<span id="L366" class="LineNr">366 </span> <span class="Delimiter">}</span>
|
||||
<span id="L367" class="LineNr">367 </span> <a href='500fake-screen.mu.html#L269'>set-cursor-position</a> <a href='500fake-screen.mu.html#L16'>screen</a>, xcurr, ycurr
|
||||
<span id="L368" class="LineNr">368 </span> <span class="PreProc">return</span> xcurr, ycurr
|
||||
<span id="L369" class="LineNr">369 </span><span class="Delimiter">}</span>
|
||||
<span id="L370" class="LineNr">370 </span>
|
||||
<span id="L371" class="LineNr">371 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L371'>draw-int32-hex-wrapping-right-then-down-over-full-screen</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), n: int, x: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/eax: int, _/<span class="muRegEcx">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L372" class="LineNr">372 </span> <span class="PreProc">var</span> x2/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L373" class="LineNr">373 </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="L374" class="LineNr">374 </span> x2, y2 <span class="Special"><-</span> <a href='500fake-screen.mu.html#L75'>screen-size</a> <a href='500fake-screen.mu.html#L16'>screen</a> <span class="muComment"># width, height</span>
|
||||
<span id="L375" class="LineNr">375 </span> x2, y2 <span class="Special"><-</span> <a href='501draw-text.mu.html#L346'>draw-int32-hex-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L16'>screen</a>, n, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, x2, y2, x, y, color, background-color
|
||||
<span id="L376" class="LineNr">376 </span> <span class="PreProc">return</span> x2, y2 <span class="muComment"># cursor-x, cursor-y</span>
|
||||
<span id="L377" class="LineNr">377 </span><span class="Delimiter">}</span>
|
||||
<span id="L378" class="LineNr">378 </span>
|
||||
<span id="L379" class="LineNr">379 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L379'>draw-int32-hex-wrapping-right-then-down-from-cursor</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), n: int, xmin: int, ymin: int, xmax: int, ymax: int, color: int, background-color: int <span class="Delimiter">{</span>
|
||||
<span id="L380" class="LineNr">380 </span> <span class="PreProc">var</span> cursor-x/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L381" class="LineNr">381 </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="L382" class="LineNr">382 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L253'>cursor-position</a> <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L383" class="LineNr">383 </span> <span class="PreProc">var</span> end-x/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy cursor-x
|
||||
<span id="L384" class="LineNr">384 </span> end-x <span class="Special"><-</span> increment
|
||||
<span id="L385" class="LineNr">385 </span> compare end-x, xmax
|
||||
<span id="L386" class="LineNr">386 </span> <span class="Delimiter">{</span>
|
||||
<span id="L387" class="LineNr">387 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L388" class="LineNr">388 </span> cursor-x <span class="Special"><-</span> copy xmin
|
||||
<span id="L389" class="LineNr">389 </span> cursor-y <span class="Special"><-</span> increment
|
||||
<span id="L390" class="LineNr">390 </span> <span class="Delimiter">}</span>
|
||||
<span id="L391" class="LineNr">391 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='501draw-text.mu.html#L346'>draw-int32-hex-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L16'>screen</a>, n, xmin, ymin, xmax, ymax, cursor-x, cursor-y, color, background-color
|
||||
<span id="L339" class="LineNr">339 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L339'>draw-int32-hex-wrapping-right-then-down</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>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>_/eax: int, _/<span class="muRegEcx">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L340" class="LineNr">340 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x100</span>)
|
||||
<span id="L341" class="LineNr">341 </span> <span class="PreProc">var</span> stream/<span class="muRegEsi">esi</span>: (addr stream byte) <span class="Special"><-</span> address stream-storage
|
||||
<span id="L342" class="LineNr">342 </span> <a href='117write-int-hex.subx.html#L92'>write-int32-hex</a> stream, n
|
||||
<span id="L343" class="LineNr">343 </span> <span class="PreProc">var</span> xcurr/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy x
|
||||
<span id="L344" class="LineNr">344 </span> <span class="PreProc">var</span> ycurr/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy y
|
||||
<span id="L345" class="LineNr">345 </span> <span class="Delimiter">{</span>
|
||||
<span id="L346" class="LineNr">346 </span> <span class="PreProc">var</span> g/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L229'>read-code-point-utf8</a> stream
|
||||
<span id="L347" class="LineNr">347 </span> compare g, <span class="Constant">0xffffffff</span>/end-of-file
|
||||
<span id="L348" class="LineNr">348 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L349" class="LineNr">349 </span> <span class="PreProc">var</span> c/eax: code-point <span class="Special"><-</span> <a href='403unicode.mu.html#L49'>to-code-point</a> g
|
||||
<span id="L350" class="LineNr">350 </span> <span class="PreProc">var</span> offset/eax: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L94'>draw-code-point</a> <a href='500fake-screen.mu.html#L16'>screen</a>, c, xcurr, ycurr, color, background-color
|
||||
<span id="L351" class="LineNr">351 </span> xcurr <span class="Special"><-</span> add offset
|
||||
<span id="L352" class="LineNr">352 </span> compare xcurr, xmax
|
||||
<span id="L353" class="LineNr">353 </span> <span class="Delimiter">{</span>
|
||||
<span id="L354" class="LineNr">354 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L355" class="LineNr">355 </span> xcurr <span class="Special"><-</span> copy xmin
|
||||
<span id="L356" class="LineNr">356 </span> ycurr <span class="Special"><-</span> increment
|
||||
<span id="L357" class="LineNr">357 </span> <span class="Delimiter">}</span>
|
||||
<span id="L358" class="LineNr">358 </span> <span class="PreProc">loop</span>
|
||||
<span id="L359" class="LineNr">359 </span> <span class="Delimiter">}</span>
|
||||
<span id="L360" class="LineNr">360 </span> <a href='500fake-screen.mu.html#L269'>set-cursor-position</a> <a href='500fake-screen.mu.html#L16'>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-hex-wrapping-right-then-down-over-full-screen</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), n: int, x: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/eax: int, _/<span class="muRegEcx">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L365" class="LineNr">365 </span> <span class="PreProc">var</span> x2/eax: 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#L75'>screen-size</a> <a href='500fake-screen.mu.html#L16'>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#L339'>draw-int32-hex-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L16'>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-hex-wrapping-right-then-down-from-cursor</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>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/eax: 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#L253'>cursor-position</a> <a href='500fake-screen.mu.html#L16'>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>
|
||||
<span id="L380" class="LineNr">380 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L381" class="LineNr">381 </span> cursor-x <span class="Special"><-</span> copy xmin
|
||||
<span id="L382" class="LineNr">382 </span> cursor-y <span class="Special"><-</span> increment
|
||||
<span id="L383" class="LineNr">383 </span> <span class="Delimiter">}</span>
|
||||
<span id="L384" class="LineNr">384 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='501draw-text.mu.html#L339'>draw-int32-hex-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L16'>screen</a>, n, xmin, ymin, xmax, ymax, cursor-x, cursor-y, color, background-color
|
||||
<span id="L385" class="LineNr">385 </span><span class="Delimiter">}</span>
|
||||
<span id="L386" class="LineNr">386 </span>
|
||||
<span id="L387" class="LineNr">387 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L387'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>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/eax: 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#L75'>screen-size</a> <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L391" class="LineNr">391 </span> <a href='501draw-text.mu.html#L372'>draw-int32-hex-wrapping-right-then-down-from-cursor</a> <a href='500fake-screen.mu.html#L16'>screen</a>, n, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, width, height, color, background-color
|
||||
<span id="L392" class="LineNr">392 </span><span class="Delimiter">}</span>
|
||||
<span id="L393" class="LineNr">393 </span>
|
||||
<span id="L394" class="LineNr">394 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L394'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), n: int, color: int, background-color: int <span class="Delimiter">{</span>
|
||||
<span id="L395" class="LineNr">395 </span> <span class="PreProc">var</span> width/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L396" class="LineNr">396 </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="L397" class="LineNr">397 </span> width, height <span class="Special"><-</span> <a href='500fake-screen.mu.html#L75'>screen-size</a> <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L398" class="LineNr">398 </span> <a href='501draw-text.mu.html#L379'>draw-int32-hex-wrapping-right-then-down-from-cursor</a> <a href='500fake-screen.mu.html#L16'>screen</a>, n, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, width, height, color, background-color
|
||||
<span id="L399" class="LineNr">399 </span><span class="Delimiter">}</span>
|
||||
<span id="L400" class="LineNr">400 </span>
|
||||
<span id="L401" class="LineNr">401 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L401'>draw-int32-decimal-wrapping-right-then-down</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>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>_/eax: int, _/<span class="muRegEcx">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L402" class="LineNr">402 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x100</span>)
|
||||
<span id="L403" class="LineNr">403 </span> <span class="PreProc">var</span> stream/<span class="muRegEsi">esi</span>: (addr stream byte) <span class="Special"><-</span> address stream-storage
|
||||
<span id="L404" class="LineNr">404 </span> <a href='126write-int-decimal.subx.html#L8'>write-int32-decimal</a> stream, n
|
||||
<span id="L405" class="LineNr">405 </span> <span class="PreProc">var</span> xcurr/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy x
|
||||
<span id="L406" class="LineNr">406 </span> <span class="PreProc">var</span> ycurr/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy y
|
||||
<span id="L407" class="LineNr">407 </span> <span class="Delimiter">{</span>
|
||||
<span id="L408" class="LineNr">408 </span> <span class="PreProc">var</span> g/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L236'>read-grapheme</a> stream
|
||||
<span id="L409" class="LineNr">409 </span> compare g, <span class="Constant">0xffffffff</span>/end-of-file
|
||||
<span id="L410" class="LineNr">410 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L411" class="LineNr">411 </span> <span class="PreProc">var</span> c/eax: code-point <span class="Special"><-</span> <a href='403unicode.mu.html#L56'>to-code-point</a> g
|
||||
<span id="L412" class="LineNr">412 </span> <span class="PreProc">var</span> offset/eax: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L94'>draw-code-point</a> <a href='500fake-screen.mu.html#L16'>screen</a>, c, xcurr, ycurr, color, background-color
|
||||
<span id="L413" class="LineNr">413 </span> xcurr <span class="Special"><-</span> add offset
|
||||
<span id="L414" class="LineNr">414 </span> compare xcurr, xmax
|
||||
<span id="L415" class="LineNr">415 </span> <span class="Delimiter">{</span>
|
||||
<span id="L416" class="LineNr">416 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L417" class="LineNr">417 </span> xcurr <span class="Special"><-</span> copy xmin
|
||||
<span id="L418" class="LineNr">418 </span> ycurr <span class="Special"><-</span> increment
|
||||
<span id="L419" class="LineNr">419 </span> <span class="Delimiter">}</span>
|
||||
<span id="L420" class="LineNr">420 </span> <span class="PreProc">loop</span>
|
||||
<span id="L421" class="LineNr">421 </span> <span class="Delimiter">}</span>
|
||||
<span id="L422" class="LineNr">422 </span> <a href='500fake-screen.mu.html#L269'>set-cursor-position</a> <a href='500fake-screen.mu.html#L16'>screen</a>, xcurr, ycurr
|
||||
<span id="L423" class="LineNr">423 </span> <span class="PreProc">return</span> xcurr, ycurr
|
||||
<span id="L424" class="LineNr">424 </span><span class="Delimiter">}</span>
|
||||
<span id="L425" class="LineNr">425 </span>
|
||||
<span id="L426" class="LineNr">426 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L426'>draw-int32-decimal-wrapping-right-then-down-over-full-screen</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), n: int, x: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/eax: int, _/<span class="muRegEcx">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L427" class="LineNr">427 </span> <span class="PreProc">var</span> x2/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L428" class="LineNr">428 </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="L429" class="LineNr">429 </span> x2, y2 <span class="Special"><-</span> <a href='500fake-screen.mu.html#L75'>screen-size</a> <a href='500fake-screen.mu.html#L16'>screen</a> <span class="muComment"># width, height</span>
|
||||
<span id="L430" class="LineNr">430 </span> x2, y2 <span class="Special"><-</span> <a href='501draw-text.mu.html#L401'>draw-int32-decimal-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L16'>screen</a>, n, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, x2, y2, x, y, color, background-color
|
||||
<span id="L431" class="LineNr">431 </span> <span class="PreProc">return</span> x2, y2 <span class="muComment"># cursor-x, cursor-y</span>
|
||||
<span id="L432" class="LineNr">432 </span><span class="Delimiter">}</span>
|
||||
<span id="L433" class="LineNr">433 </span>
|
||||
<span id="L434" class="LineNr">434 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L434'>draw-int32-decimal-wrapping-right-then-down-from-cursor</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), n: int, xmin: int, ymin: int, xmax: int, ymax: int, color: int, background-color: int <span class="Delimiter">{</span>
|
||||
<span id="L435" class="LineNr">435 </span> <span class="PreProc">var</span> cursor-x/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L436" class="LineNr">436 </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="L437" class="LineNr">437 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L253'>cursor-position</a> <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L438" class="LineNr">438 </span> <span class="PreProc">var</span> end-x/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy cursor-x
|
||||
<span id="L439" class="LineNr">439 </span> end-x <span class="Special"><-</span> increment
|
||||
<span id="L440" class="LineNr">440 </span> compare end-x, xmax
|
||||
<span id="L441" class="LineNr">441 </span> <span class="Delimiter">{</span>
|
||||
<span id="L442" class="LineNr">442 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L443" class="LineNr">443 </span> cursor-x <span class="Special"><-</span> copy xmin
|
||||
<span id="L444" class="LineNr">444 </span> cursor-y <span class="Special"><-</span> increment
|
||||
<span id="L445" class="LineNr">445 </span> <span class="Delimiter">}</span>
|
||||
<span id="L446" class="LineNr">446 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='501draw-text.mu.html#L401'>draw-int32-decimal-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L16'>screen</a>, n, xmin, ymin, xmax, ymax, cursor-x, cursor-y, color, background-color
|
||||
<span id="L394" class="LineNr">394 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L394'>draw-int32-decimal-wrapping-right-then-down</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>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>_/eax: int, _/<span class="muRegEcx">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L395" class="LineNr">395 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x100</span>)
|
||||
<span id="L396" class="LineNr">396 </span> <span class="PreProc">var</span> stream/<span class="muRegEsi">esi</span>: (addr stream byte) <span class="Special"><-</span> address stream-storage
|
||||
<span id="L397" class="LineNr">397 </span> <a href='126write-int-decimal.subx.html#L8'>write-int32-decimal</a> stream, n
|
||||
<span id="L398" class="LineNr">398 </span> <span class="PreProc">var</span> xcurr/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy x
|
||||
<span id="L399" class="LineNr">399 </span> <span class="PreProc">var</span> ycurr/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy y
|
||||
<span id="L400" class="LineNr">400 </span> <span class="Delimiter">{</span>
|
||||
<span id="L401" class="LineNr">401 </span> <span class="PreProc">var</span> g/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L229'>read-code-point-utf8</a> stream
|
||||
<span id="L402" class="LineNr">402 </span> compare g, <span class="Constant">0xffffffff</span>/end-of-file
|
||||
<span id="L403" class="LineNr">403 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L404" class="LineNr">404 </span> <span class="PreProc">var</span> c/eax: code-point <span class="Special"><-</span> <a href='403unicode.mu.html#L49'>to-code-point</a> g
|
||||
<span id="L405" class="LineNr">405 </span> <span class="PreProc">var</span> offset/eax: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L94'>draw-code-point</a> <a href='500fake-screen.mu.html#L16'>screen</a>, c, xcurr, ycurr, color, background-color
|
||||
<span id="L406" class="LineNr">406 </span> xcurr <span class="Special"><-</span> add offset
|
||||
<span id="L407" class="LineNr">407 </span> compare xcurr, xmax
|
||||
<span id="L408" class="LineNr">408 </span> <span class="Delimiter">{</span>
|
||||
<span id="L409" class="LineNr">409 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L410" class="LineNr">410 </span> xcurr <span class="Special"><-</span> copy xmin
|
||||
<span id="L411" class="LineNr">411 </span> ycurr <span class="Special"><-</span> increment
|
||||
<span id="L412" class="LineNr">412 </span> <span class="Delimiter">}</span>
|
||||
<span id="L413" class="LineNr">413 </span> <span class="PreProc">loop</span>
|
||||
<span id="L414" class="LineNr">414 </span> <span class="Delimiter">}</span>
|
||||
<span id="L415" class="LineNr">415 </span> <a href='500fake-screen.mu.html#L269'>set-cursor-position</a> <a href='500fake-screen.mu.html#L16'>screen</a>, xcurr, ycurr
|
||||
<span id="L416" class="LineNr">416 </span> <span class="PreProc">return</span> xcurr, ycurr
|
||||
<span id="L417" class="LineNr">417 </span><span class="Delimiter">}</span>
|
||||
<span id="L418" class="LineNr">418 </span>
|
||||
<span id="L419" class="LineNr">419 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L419'>draw-int32-decimal-wrapping-right-then-down-over-full-screen</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), n: int, x: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/eax: int, _/<span class="muRegEcx">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L420" class="LineNr">420 </span> <span class="PreProc">var</span> x2/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L421" class="LineNr">421 </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="L422" class="LineNr">422 </span> x2, y2 <span class="Special"><-</span> <a href='500fake-screen.mu.html#L75'>screen-size</a> <a href='500fake-screen.mu.html#L16'>screen</a> <span class="muComment"># width, height</span>
|
||||
<span id="L423" class="LineNr">423 </span> x2, y2 <span class="Special"><-</span> <a href='501draw-text.mu.html#L394'>draw-int32-decimal-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L16'>screen</a>, n, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, x2, y2, x, y, color, background-color
|
||||
<span id="L424" class="LineNr">424 </span> <span class="PreProc">return</span> x2, y2 <span class="muComment"># cursor-x, cursor-y</span>
|
||||
<span id="L425" class="LineNr">425 </span><span class="Delimiter">}</span>
|
||||
<span id="L426" class="LineNr">426 </span>
|
||||
<span id="L427" class="LineNr">427 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L427'>draw-int32-decimal-wrapping-right-then-down-from-cursor</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), n: int, xmin: int, ymin: int, xmax: int, ymax: int, color: int, background-color: int <span class="Delimiter">{</span>
|
||||
<span id="L428" class="LineNr">428 </span> <span class="PreProc">var</span> cursor-x/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L429" class="LineNr">429 </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="L430" class="LineNr">430 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L253'>cursor-position</a> <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L431" class="LineNr">431 </span> <span class="PreProc">var</span> end-x/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy cursor-x
|
||||
<span id="L432" class="LineNr">432 </span> end-x <span class="Special"><-</span> increment
|
||||
<span id="L433" class="LineNr">433 </span> compare end-x, xmax
|
||||
<span id="L434" class="LineNr">434 </span> <span class="Delimiter">{</span>
|
||||
<span id="L435" class="LineNr">435 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L436" class="LineNr">436 </span> cursor-x <span class="Special"><-</span> copy xmin
|
||||
<span id="L437" class="LineNr">437 </span> cursor-y <span class="Special"><-</span> increment
|
||||
<span id="L438" class="LineNr">438 </span> <span class="Delimiter">}</span>
|
||||
<span id="L439" class="LineNr">439 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='501draw-text.mu.html#L394'>draw-int32-decimal-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L16'>screen</a>, n, xmin, ymin, xmax, ymax, cursor-x, cursor-y, color, background-color
|
||||
<span id="L440" class="LineNr">440 </span><span class="Delimiter">}</span>
|
||||
<span id="L441" class="LineNr">441 </span>
|
||||
<span id="L442" class="LineNr">442 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L442'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), n: int, color: int, background-color: int <span class="Delimiter">{</span>
|
||||
<span id="L443" class="LineNr">443 </span> <span class="PreProc">var</span> width/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L444" class="LineNr">444 </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="L445" class="LineNr">445 </span> width, height <span class="Special"><-</span> <a href='500fake-screen.mu.html#L75'>screen-size</a> <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L446" class="LineNr">446 </span> <a href='501draw-text.mu.html#L427'>draw-int32-decimal-wrapping-right-then-down-from-cursor</a> <a href='500fake-screen.mu.html#L16'>screen</a>, n, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, width, height, color, background-color
|
||||
<span id="L447" class="LineNr">447 </span><span class="Delimiter">}</span>
|
||||
<span id="L448" class="LineNr">448 </span>
|
||||
<span id="L449" class="LineNr">449 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L449'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), n: int, color: int, background-color: int <span class="Delimiter">{</span>
|
||||
<span id="L450" class="LineNr">450 </span> <span class="PreProc">var</span> width/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L451" class="LineNr">451 </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="L452" class="LineNr">452 </span> width, height <span class="Special"><-</span> <a href='500fake-screen.mu.html#L75'>screen-size</a> <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L453" class="LineNr">453 </span> <a href='501draw-text.mu.html#L434'>draw-int32-decimal-wrapping-right-then-down-from-cursor</a> <a href='500fake-screen.mu.html#L16'>screen</a>, n, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, width, height, color, background-color
|
||||
<span id="L454" class="LineNr">454 </span><span class="Delimiter">}</span>
|
||||
<span id="L455" class="LineNr">455 </span>
|
||||
<span id="L456" class="LineNr">456 </span><span class="muComment">## Text direction: down then right</span>
|
||||
<span id="L457" class="LineNr">457 </span>
|
||||
<span id="L458" class="LineNr">458 </span><span class="muComment"># draw a single line of text vertically from x, y to ymax</span>
|
||||
<span id="L459" class="LineNr">459 </span><span class="muComment"># return the next 'y' coordinate</span>
|
||||
<span id="L460" class="LineNr">460 </span><span class="muComment"># if there isn't enough space, truncate</span>
|
||||
<span id="L461" class="LineNr">461 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L461'>draw-text-downward</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), text: (addr array byte), x: int, y: int, ymax: int, color: int, background-color: int<span class="PreProc"> -> </span>_/eax: int <span class="Delimiter">{</span>
|
||||
<span id="L462" class="LineNr">462 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x100</span>)
|
||||
<span id="L463" class="LineNr">463 </span> <span class="PreProc">var</span> stream/<span class="muRegEsi">esi</span>: (addr stream byte) <span class="Special"><-</span> address stream-storage
|
||||
<span id="L464" class="LineNr">464 </span> <a href='108write.subx.html#L11'>write</a> stream, text
|
||||
<span id="L465" class="LineNr">465 </span> <span class="PreProc">var</span> ycurr/eax: int <span class="Special"><-</span> <a href='501draw-text.mu.html#L473'>draw-stream-downward</a> <a href='500fake-screen.mu.html#L16'>screen</a>, stream, x, y, ymax, color, background-color
|
||||
<span id="L466" class="LineNr">466 </span> <span class="PreProc">return</span> ycurr
|
||||
<span id="L467" class="LineNr">467 </span><span class="Delimiter">}</span>
|
||||
<span id="L468" class="LineNr">468 </span>
|
||||
<span id="L469" class="LineNr">469 </span><span class="muComment"># draw a single-line stream vertically from x, y to ymax</span>
|
||||
<span id="L470" class="LineNr">470 </span><span class="muComment"># return the next 'y' coordinate</span>
|
||||
<span id="L471" class="LineNr">471 </span><span class="muComment"># if there isn't enough space, truncate</span>
|
||||
<span id="L472" class="LineNr">472 </span><span class="muComment"># TODO: should we track horizontal width?</span>
|
||||
<span id="L473" class="LineNr">473 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L473'>draw-stream-downward</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), stream: (addr stream byte), x: int, y: int, ymax: int, color: int, background-color: int<span class="PreProc"> -> </span>_/eax: int <span class="Delimiter">{</span>
|
||||
<span id="L474" class="LineNr">474 </span> <span class="PreProc">var</span> ycurr/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy y
|
||||
<span id="L475" class="LineNr">475 </span> <span class="Delimiter">{</span>
|
||||
<span id="L476" class="LineNr">476 </span> <span class="PreProc">var</span> g/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L236'>read-grapheme</a> stream
|
||||
<span id="L477" class="LineNr">477 </span> compare g, <span class="Constant">0xffffffff</span>/end-of-file
|
||||
<span id="L478" class="LineNr">478 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L479" class="LineNr">479 </span> <span class="PreProc">var</span> c/eax: code-point <span class="Special"><-</span> <a href='403unicode.mu.html#L56'>to-code-point</a> g
|
||||
<span id="L480" class="LineNr">480 </span> <span class="PreProc">var</span> dummy/eax: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L94'>draw-code-point</a> <a href='500fake-screen.mu.html#L16'>screen</a>, c, x, ycurr, color, background-color
|
||||
<span id="L481" class="LineNr">481 </span> ycurr <span class="Special"><-</span> increment
|
||||
<span id="L482" class="LineNr">482 </span> <span class="PreProc">loop</span>
|
||||
<span id="L483" class="LineNr">483 </span> <span class="Delimiter">}</span>
|
||||
<span id="L484" class="LineNr">484 </span> <a href='500fake-screen.mu.html#L269'>set-cursor-position</a> <a href='500fake-screen.mu.html#L16'>screen</a>, x, ycurr
|
||||
<span id="L485" class="LineNr">485 </span> <span class="PreProc">return</span> ycurr
|
||||
<span id="L449" class="LineNr">449 </span><span class="muComment">## Text direction: down then right</span>
|
||||
<span id="L450" class="LineNr">450 </span>
|
||||
<span id="L451" class="LineNr">451 </span><span class="muComment"># draw a single line of text vertically from x, y to ymax</span>
|
||||
<span id="L452" class="LineNr">452 </span><span class="muComment"># return the next 'y' coordinate</span>
|
||||
<span id="L453" class="LineNr">453 </span><span class="muComment"># if there isn't enough space, truncate</span>
|
||||
<span id="L454" class="LineNr">454 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L454'>draw-text-downward</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), text: (addr array byte), x: int, y: int, ymax: int, color: int, background-color: int<span class="PreProc"> -> </span>_/eax: int <span class="Delimiter">{</span>
|
||||
<span id="L455" class="LineNr">455 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x100</span>)
|
||||
<span id="L456" class="LineNr">456 </span> <span class="PreProc">var</span> stream/<span class="muRegEsi">esi</span>: (addr stream byte) <span class="Special"><-</span> address stream-storage
|
||||
<span id="L457" class="LineNr">457 </span> <a href='108write.subx.html#L11'>write</a> stream, text
|
||||
<span id="L458" class="LineNr">458 </span> <span class="PreProc">var</span> ycurr/eax: int <span class="Special"><-</span> <a href='501draw-text.mu.html#L466'>draw-stream-downward</a> <a href='500fake-screen.mu.html#L16'>screen</a>, stream, x, y, ymax, color, background-color
|
||||
<span id="L459" class="LineNr">459 </span> <span class="PreProc">return</span> ycurr
|
||||
<span id="L460" class="LineNr">460 </span><span class="Delimiter">}</span>
|
||||
<span id="L461" class="LineNr">461 </span>
|
||||
<span id="L462" class="LineNr">462 </span><span class="muComment"># draw a single-line stream vertically from x, y to ymax</span>
|
||||
<span id="L463" class="LineNr">463 </span><span class="muComment"># return the next 'y' coordinate</span>
|
||||
<span id="L464" class="LineNr">464 </span><span class="muComment"># if there isn't enough space, truncate</span>
|
||||
<span id="L465" class="LineNr">465 </span><span class="muComment"># TODO: should we track horizontal width?</span>
|
||||
<span id="L466" class="LineNr">466 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L466'>draw-stream-downward</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), stream: (addr stream byte), x: int, y: int, ymax: int, color: int, background-color: int<span class="PreProc"> -> </span>_/eax: int <span class="Delimiter">{</span>
|
||||
<span id="L467" class="LineNr">467 </span> <span class="PreProc">var</span> ycurr/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy y
|
||||
<span id="L468" class="LineNr">468 </span> <span class="Delimiter">{</span>
|
||||
<span id="L469" class="LineNr">469 </span> <span class="PreProc">var</span> g/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L229'>read-code-point-utf8</a> stream
|
||||
<span id="L470" class="LineNr">470 </span> compare g, <span class="Constant">0xffffffff</span>/end-of-file
|
||||
<span id="L471" class="LineNr">471 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L472" class="LineNr">472 </span> <span class="PreProc">var</span> c/eax: code-point <span class="Special"><-</span> <a href='403unicode.mu.html#L49'>to-code-point</a> g
|
||||
<span id="L473" class="LineNr">473 </span> <span class="PreProc">var</span> dummy/eax: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L94'>draw-code-point</a> <a href='500fake-screen.mu.html#L16'>screen</a>, c, x, ycurr, color, background-color
|
||||
<span id="L474" class="LineNr">474 </span> ycurr <span class="Special"><-</span> increment
|
||||
<span id="L475" class="LineNr">475 </span> <span class="PreProc">loop</span>
|
||||
<span id="L476" class="LineNr">476 </span> <span class="Delimiter">}</span>
|
||||
<span id="L477" class="LineNr">477 </span> <a href='500fake-screen.mu.html#L269'>set-cursor-position</a> <a href='500fake-screen.mu.html#L16'>screen</a>, x, ycurr
|
||||
<span id="L478" class="LineNr">478 </span> <span class="PreProc">return</span> ycurr
|
||||
<span id="L479" class="LineNr">479 </span><span class="Delimiter">}</span>
|
||||
<span id="L480" class="LineNr">480 </span>
|
||||
<span id="L481" class="LineNr">481 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L481'>draw-text-downward-from-cursor</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), text: (addr array byte), ymax: int, color: int, background-color: int <span class="Delimiter">{</span>
|
||||
<span id="L482" class="LineNr">482 </span> <span class="PreProc">var</span> cursor-x/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L483" class="LineNr">483 </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="L484" class="LineNr">484 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L253'>cursor-position</a> <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L485" class="LineNr">485 </span> <span class="PreProc">var</span> result/eax: int <span class="Special"><-</span> <a href='501draw-text.mu.html#L454'>draw-text-downward</a> <a href='500fake-screen.mu.html#L16'>screen</a>, text, cursor-x, cursor-y, ymax, color, background-color
|
||||
<span id="L486" class="LineNr">486 </span><span class="Delimiter">}</span>
|
||||
<span id="L487" class="LineNr">487 </span>
|
||||
<span id="L488" class="LineNr">488 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L488'>draw-text-downward-from-cursor</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), text: (addr array byte), ymax: int, color: int, background-color: int <span class="Delimiter">{</span>
|
||||
<span id="L489" class="LineNr">489 </span> <span class="PreProc">var</span> cursor-x/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L490" class="LineNr">490 </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="L491" class="LineNr">491 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L253'>cursor-position</a> <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L492" class="LineNr">492 </span> <span class="PreProc">var</span> result/eax: int <span class="Special"><-</span> <a href='501draw-text.mu.html#L461'>draw-text-downward</a> <a href='500fake-screen.mu.html#L16'>screen</a>, text, cursor-x, cursor-y, ymax, color, background-color
|
||||
<span id="L493" class="LineNr">493 </span><span class="Delimiter">}</span>
|
||||
<span id="L494" class="LineNr">494 </span>
|
||||
<span id="L495" class="LineNr">495 </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="L496" class="LineNr">496 </span><span class="muComment"># return the next (x, y) coordinate in raster order where drawing stopped</span>
|
||||
<span id="L497" class="LineNr">497 </span><span class="muComment"># that way the caller can draw more if given the same min and max bounding-box.</span>
|
||||
<span id="L498" class="LineNr">498 </span><span class="muComment"># if there isn't enough space, truncate</span>
|
||||
<span id="L499" class="LineNr">499 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L499'>draw-text-wrapping-down-then-right</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>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>_/eax: int, _/<span class="muRegEcx">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L500" class="LineNr">500 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x100</span>)
|
||||
<span id="L501" class="LineNr">501 </span> <span class="PreProc">var</span> stream/<span class="muRegEsi">esi</span>: (addr stream byte) <span class="Special"><-</span> address stream-storage
|
||||
<span id="L502" class="LineNr">502 </span> <a href='108write.subx.html#L11'>write</a> stream, text
|
||||
<span id="L503" class="LineNr">503 </span> <span class="PreProc">var</span> x/eax: int <span class="Special"><-</span> copy _x
|
||||
<span id="L504" class="LineNr">504 </span> <span class="PreProc">var</span> y/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy _y
|
||||
<span id="L505" class="LineNr">505 </span> x, y <span class="Special"><-</span> <a href='501draw-text.mu.html#L514'>draw-stream-wrapping-down-then-right</a> <a href='500fake-screen.mu.html#L16'>screen</a>, stream, xmin, ymin, xmax, ymax, x, y, color, background-color
|
||||
<span id="L506" class="LineNr">506 </span> <span class="PreProc">return</span> x, y
|
||||
<span id="L507" class="LineNr">507 </span><span class="Delimiter">}</span>
|
||||
<span id="L508" class="LineNr">508 </span>
|
||||
<span id="L509" class="LineNr">509 </span><span class="muComment"># draw a stream down and right in the rectangle from (xmin, ymin) to (xmax, ymax), starting from (x, y), wrapping as necessary</span>
|
||||
<span id="L510" class="LineNr">510 </span><span class="muComment"># return the next (x, y) coordinate in raster order where drawing stopped</span>
|
||||
<span id="L511" class="LineNr">511 </span><span class="muComment"># that way the caller can draw more if given the same min and max bounding-box.</span>
|
||||
<span id="L512" class="LineNr">512 </span><span class="muComment"># if there isn't enough space, truncate</span>
|
||||
<span id="L513" class="LineNr">513 </span><span class="muComment"># TODO: should we track horizontal width? just always offset by 2 for now</span>
|
||||
<span id="L514" class="LineNr">514 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L514'>draw-stream-wrapping-down-then-right</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>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>_/eax: int, _/<span class="muRegEcx">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L515" class="LineNr">515 </span> <span class="PreProc">var</span> xcurr/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy x
|
||||
<span id="L516" class="LineNr">516 </span> <span class="PreProc">var</span> ycurr/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy y
|
||||
<span id="L517" class="LineNr">517 </span> <span class="Delimiter">{</span>
|
||||
<span id="L518" class="LineNr">518 </span> <span class="PreProc">var</span> g/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L236'>read-grapheme</a> stream
|
||||
<span id="L519" class="LineNr">519 </span> compare g, <span class="Constant">0xffffffff</span>/end-of-file
|
||||
<span id="L520" class="LineNr">520 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L521" class="LineNr">521 </span> <span class="PreProc">var</span> c/eax: code-point <span class="Special"><-</span> <a href='403unicode.mu.html#L56'>to-code-point</a> g
|
||||
<span id="L522" class="LineNr">522 </span> <span class="PreProc">var</span> offset/eax: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L94'>draw-code-point</a> <a href='500fake-screen.mu.html#L16'>screen</a>, c, xcurr, ycurr, color, background-color
|
||||
<span id="L523" class="LineNr">523 </span> ycurr <span class="Special"><-</span> increment
|
||||
<span id="L524" class="LineNr">524 </span> compare ycurr, ymax
|
||||
<span id="L525" class="LineNr">525 </span> <span class="Delimiter">{</span>
|
||||
<span id="L526" class="LineNr">526 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L527" class="LineNr">527 </span> xcurr <span class="Special"><-</span> add <span class="Constant">2</span>
|
||||
<span id="L528" class="LineNr">528 </span> ycurr <span class="Special"><-</span> copy ymin
|
||||
<span id="L529" class="LineNr">529 </span> <span class="Delimiter">}</span>
|
||||
<span id="L530" class="LineNr">530 </span> <span class="PreProc">loop</span>
|
||||
<span id="L531" class="LineNr">531 </span> <span class="Delimiter">}</span>
|
||||
<span id="L532" class="LineNr">532 </span> <a href='500fake-screen.mu.html#L269'>set-cursor-position</a> <a href='500fake-screen.mu.html#L16'>screen</a>, xcurr, ycurr
|
||||
<span id="L533" class="LineNr">533 </span> <span class="PreProc">return</span> xcurr, ycurr
|
||||
<span id="L534" class="LineNr">534 </span><span class="Delimiter">}</span>
|
||||
<span id="L535" class="LineNr">535 </span>
|
||||
<span id="L536" class="LineNr">536 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L536'>draw-text-wrapping-down-then-right-over-full-screen</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), text: (addr array byte), x: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/eax: int, _/<span class="muRegEcx">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L537" class="LineNr">537 </span> <span class="PreProc">var</span> x2/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L538" class="LineNr">538 </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="L539" class="LineNr">539 </span> x2, y2 <span class="Special"><-</span> <a href='500fake-screen.mu.html#L75'>screen-size</a> <a href='500fake-screen.mu.html#L16'>screen</a> <span class="muComment"># width, height</span>
|
||||
<span id="L540" class="LineNr">540 </span> x2, y2 <span class="Special"><-</span> <a href='501draw-text.mu.html#L499'>draw-text-wrapping-down-then-right</a> <a href='500fake-screen.mu.html#L16'>screen</a>, text, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, x2, y2, x, y, color, background-color
|
||||
<span id="L541" class="LineNr">541 </span> <span class="PreProc">return</span> x2, y2 <span class="muComment"># cursor-x, cursor-y</span>
|
||||
<span id="L542" class="LineNr">542 </span><span class="Delimiter">}</span>
|
||||
<span id="L543" class="LineNr">543 </span>
|
||||
<span id="L544" class="LineNr">544 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L544'>draw-text-wrapping-down-then-right-from-cursor</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>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="L545" class="LineNr">545 </span> <span class="PreProc">var</span> cursor-x/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L546" class="LineNr">546 </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="L547" class="LineNr">547 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L253'>cursor-position</a> <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L548" class="LineNr">548 </span> <span class="PreProc">var</span> end-y/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy cursor-y
|
||||
<span id="L549" class="LineNr">549 </span> end-y <span class="Special"><-</span> increment
|
||||
<span id="L550" class="LineNr">550 </span> compare end-y, ymax
|
||||
<span id="L551" class="LineNr">551 </span> <span class="Delimiter">{</span>
|
||||
<span id="L552" class="LineNr">552 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L553" class="LineNr">553 </span> cursor-x <span class="Special"><-</span> increment
|
||||
<span id="L554" class="LineNr">554 </span> cursor-y <span class="Special"><-</span> copy ymin
|
||||
<span id="L555" class="LineNr">555 </span> <span class="Delimiter">}</span>
|
||||
<span id="L556" class="LineNr">556 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='501draw-text.mu.html#L499'>draw-text-wrapping-down-then-right</a> <a href='500fake-screen.mu.html#L16'>screen</a>, text, xmin, ymin, xmax, ymax, cursor-x, cursor-y, color, background-color
|
||||
<span id="L488" class="LineNr">488 </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="L489" class="LineNr">489 </span><span class="muComment"># return the next (x, y) coordinate in raster order where drawing stopped</span>
|
||||
<span id="L490" class="LineNr">490 </span><span class="muComment"># that way the caller can draw more if given the same min and max bounding-box.</span>
|
||||
<span id="L491" class="LineNr">491 </span><span class="muComment"># if there isn't enough space, truncate</span>
|
||||
<span id="L492" class="LineNr">492 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L492'>draw-text-wrapping-down-then-right</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>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>_/eax: int, _/<span class="muRegEcx">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L493" class="LineNr">493 </span> <span class="PreProc">var</span> stream-storage: (stream byte <span class="Constant">0x100</span>)
|
||||
<span id="L494" class="LineNr">494 </span> <span class="PreProc">var</span> stream/<span class="muRegEsi">esi</span>: (addr stream byte) <span class="Special"><-</span> address stream-storage
|
||||
<span id="L495" class="LineNr">495 </span> <a href='108write.subx.html#L11'>write</a> stream, text
|
||||
<span id="L496" class="LineNr">496 </span> <span class="PreProc">var</span> x/eax: int <span class="Special"><-</span> copy _x
|
||||
<span id="L497" class="LineNr">497 </span> <span class="PreProc">var</span> y/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy _y
|
||||
<span id="L498" class="LineNr">498 </span> x, y <span class="Special"><-</span> <a href='501draw-text.mu.html#L507'>draw-stream-wrapping-down-then-right</a> <a href='500fake-screen.mu.html#L16'>screen</a>, stream, xmin, ymin, xmax, ymax, x, y, color, background-color
|
||||
<span id="L499" class="LineNr">499 </span> <span class="PreProc">return</span> x, y
|
||||
<span id="L500" class="LineNr">500 </span><span class="Delimiter">}</span>
|
||||
<span id="L501" class="LineNr">501 </span>
|
||||
<span id="L502" class="LineNr">502 </span><span class="muComment"># draw a stream down and right in the rectangle from (xmin, ymin) to (xmax, ymax), starting from (x, y), wrapping as necessary</span>
|
||||
<span id="L503" class="LineNr">503 </span><span class="muComment"># return the next (x, y) coordinate in raster order where drawing stopped</span>
|
||||
<span id="L504" class="LineNr">504 </span><span class="muComment"># that way the caller can draw more if given the same min and max bounding-box.</span>
|
||||
<span id="L505" class="LineNr">505 </span><span class="muComment"># if there isn't enough space, truncate</span>
|
||||
<span id="L506" class="LineNr">506 </span><span class="muComment"># TODO: should we track horizontal width? just always offset by 2 for now</span>
|
||||
<span id="L507" class="LineNr">507 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L507'>draw-stream-wrapping-down-then-right</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>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>_/eax: int, _/<span class="muRegEcx">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L508" class="LineNr">508 </span> <span class="PreProc">var</span> xcurr/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy x
|
||||
<span id="L509" class="LineNr">509 </span> <span class="PreProc">var</span> ycurr/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy y
|
||||
<span id="L510" class="LineNr">510 </span> <span class="Delimiter">{</span>
|
||||
<span id="L511" class="LineNr">511 </span> <span class="PreProc">var</span> g/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L229'>read-code-point-utf8</a> stream
|
||||
<span id="L512" class="LineNr">512 </span> compare g, <span class="Constant">0xffffffff</span>/end-of-file
|
||||
<span id="L513" class="LineNr">513 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L514" class="LineNr">514 </span> <span class="PreProc">var</span> c/eax: code-point <span class="Special"><-</span> <a href='403unicode.mu.html#L49'>to-code-point</a> g
|
||||
<span id="L515" class="LineNr">515 </span> <span class="PreProc">var</span> offset/eax: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L94'>draw-code-point</a> <a href='500fake-screen.mu.html#L16'>screen</a>, c, xcurr, ycurr, color, background-color
|
||||
<span id="L516" class="LineNr">516 </span> ycurr <span class="Special"><-</span> increment
|
||||
<span id="L517" class="LineNr">517 </span> compare ycurr, ymax
|
||||
<span id="L518" class="LineNr">518 </span> <span class="Delimiter">{</span>
|
||||
<span id="L519" class="LineNr">519 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L520" class="LineNr">520 </span> xcurr <span class="Special"><-</span> add <span class="Constant">2</span>
|
||||
<span id="L521" class="LineNr">521 </span> ycurr <span class="Special"><-</span> copy ymin
|
||||
<span id="L522" class="LineNr">522 </span> <span class="Delimiter">}</span>
|
||||
<span id="L523" class="LineNr">523 </span> <span class="PreProc">loop</span>
|
||||
<span id="L524" class="LineNr">524 </span> <span class="Delimiter">}</span>
|
||||
<span id="L525" class="LineNr">525 </span> <a href='500fake-screen.mu.html#L269'>set-cursor-position</a> <a href='500fake-screen.mu.html#L16'>screen</a>, xcurr, ycurr
|
||||
<span id="L526" class="LineNr">526 </span> <span class="PreProc">return</span> xcurr, ycurr
|
||||
<span id="L527" class="LineNr">527 </span><span class="Delimiter">}</span>
|
||||
<span id="L528" class="LineNr">528 </span>
|
||||
<span id="L529" class="LineNr">529 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L529'>draw-text-wrapping-down-then-right-over-full-screen</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), text: (addr array byte), x: int, y: int, color: int, background-color: int<span class="PreProc"> -> </span>_/eax: int, _/<span class="muRegEcx">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L530" class="LineNr">530 </span> <span class="PreProc">var</span> x2/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L531" class="LineNr">531 </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="L532" class="LineNr">532 </span> x2, y2 <span class="Special"><-</span> <a href='500fake-screen.mu.html#L75'>screen-size</a> <a href='500fake-screen.mu.html#L16'>screen</a> <span class="muComment"># width, height</span>
|
||||
<span id="L533" class="LineNr">533 </span> x2, y2 <span class="Special"><-</span> <a href='501draw-text.mu.html#L492'>draw-text-wrapping-down-then-right</a> <a href='500fake-screen.mu.html#L16'>screen</a>, text, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, x2, y2, x, y, color, background-color
|
||||
<span id="L534" class="LineNr">534 </span> <span class="PreProc">return</span> x2, y2 <span class="muComment"># cursor-x, cursor-y</span>
|
||||
<span id="L535" class="LineNr">535 </span><span class="Delimiter">}</span>
|
||||
<span id="L536" class="LineNr">536 </span>
|
||||
<span id="L537" class="LineNr">537 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L537'>draw-text-wrapping-down-then-right-from-cursor</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>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="L538" class="LineNr">538 </span> <span class="PreProc">var</span> cursor-x/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L539" class="LineNr">539 </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="L540" class="LineNr">540 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='500fake-screen.mu.html#L253'>cursor-position</a> <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L541" class="LineNr">541 </span> <span class="PreProc">var</span> end-y/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy cursor-y
|
||||
<span id="L542" class="LineNr">542 </span> end-y <span class="Special"><-</span> increment
|
||||
<span id="L543" class="LineNr">543 </span> compare end-y, ymax
|
||||
<span id="L544" class="LineNr">544 </span> <span class="Delimiter">{</span>
|
||||
<span id="L545" class="LineNr">545 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L546" class="LineNr">546 </span> cursor-x <span class="Special"><-</span> increment
|
||||
<span id="L547" class="LineNr">547 </span> cursor-y <span class="Special"><-</span> copy ymin
|
||||
<span id="L548" class="LineNr">548 </span> <span class="Delimiter">}</span>
|
||||
<span id="L549" class="LineNr">549 </span> cursor-x, cursor-y <span class="Special"><-</span> <a href='501draw-text.mu.html#L492'>draw-text-wrapping-down-then-right</a> <a href='500fake-screen.mu.html#L16'>screen</a>, text, xmin, ymin, xmax, ymax, cursor-x, cursor-y, color, background-color
|
||||
<span id="L550" class="LineNr">550 </span><span class="Delimiter">}</span>
|
||||
<span id="L551" class="LineNr">551 </span>
|
||||
<span id="L552" class="LineNr">552 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L552'>draw-text-wrapping-down-then-right-from-cursor-over-full-screen</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), text: (addr array byte), color: int, background-color: int <span class="Delimiter">{</span>
|
||||
<span id="L553" class="LineNr">553 </span> <span class="PreProc">var</span> width/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L554" class="LineNr">554 </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="L555" class="LineNr">555 </span> width, height <span class="Special"><-</span> <a href='500fake-screen.mu.html#L75'>screen-size</a> <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L556" class="LineNr">556 </span> <a href='501draw-text.mu.html#L537'>draw-text-wrapping-down-then-right-from-cursor</a> <a href='500fake-screen.mu.html#L16'>screen</a>, text, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, width, height, color, background-color
|
||||
<span id="L557" class="LineNr">557 </span><span class="Delimiter">}</span>
|
||||
<span id="L558" class="LineNr">558 </span>
|
||||
<span id="L559" class="LineNr">559 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='501draw-text.mu.html#L559'>draw-text-wrapping-down-then-right-from-cursor-over-full-screen</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), text: (addr array byte), color: int, background-color: int <span class="Delimiter">{</span>
|
||||
<span id="L560" class="LineNr">560 </span> <span class="PreProc">var</span> width/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L561" class="LineNr">561 </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="L562" class="LineNr">562 </span> width, height <span class="Special"><-</span> <a href='500fake-screen.mu.html#L75'>screen-size</a> <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L563" class="LineNr">563 </span> <a href='501draw-text.mu.html#L544'>draw-text-wrapping-down-then-right-from-cursor</a> <a href='500fake-screen.mu.html#L16'>screen</a>, text, <span class="Constant">0</span>/xmin, <span class="Constant">0</span>/ymin, width, height, color, background-color
|
||||
<span id="L564" class="LineNr">564 </span><span class="Delimiter">}</span>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -63,10 +63,10 @@ if ('onhashchange' in window) {
|
|||
<span id="L4" class="LineNr"> 4 </span> compare a, b
|
||||
<span id="L5" class="LineNr"> 5 </span> <span class="Delimiter">{</span>
|
||||
<span id="L6" class="LineNr"> 6 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L7" class="LineNr"> 7 </span> <a href='501draw-text.mu.html#L339'>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="L7" class="LineNr"> 7 </span> <a href='501draw-text.mu.html#L332'>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="L8" class="LineNr"> 8 </span> <span class="PreProc">return</span>
|
||||
<span id="L9" class="LineNr"> 9 </span> <span class="Delimiter">}</span>
|
||||
<span id="L10" class="LineNr">10 </span> <a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, msg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L10" class="LineNr">10 </span> <a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, msg, <span class="Constant">3</span>/fg=cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L11" class="LineNr">11 </span> <a href='501draw-text.mu.html#L65'>move-cursor-to-left-margin-of-next-line</a> <span class="Constant">0</span>/screen
|
||||
<span id="L12" class="LineNr">12 </span> <a href='104test.subx.html#L5'>count-test-failure</a>
|
||||
<span id="L13" class="LineNr">13 </span><span class="Delimiter">}</span>
|
||||
|
@ -80,10 +80,10 @@ if ('onhashchange' in window) {
|
|||
<span id="L21" class="LineNr">21 </span> compare a, <span class="Constant">0</span>/false
|
||||
<span id="L22" class="LineNr">22 </span> <span class="Delimiter">{</span>
|
||||
<span id="L23" class="LineNr">23 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L24" class="LineNr">24 </span> <a href='501draw-text.mu.html#L339'>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="L24" class="LineNr">24 </span> <a href='501draw-text.mu.html#L332'>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="L25" class="LineNr">25 </span> <span class="PreProc">return</span>
|
||||
<span id="L26" class="LineNr">26 </span> <span class="Delimiter">}</span>
|
||||
<span id="L27" class="LineNr">27 </span> <a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, msg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L27" class="LineNr">27 </span> <a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, msg, <span class="Constant">3</span>/fg=cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L28" class="LineNr">28 </span> <a href='501draw-text.mu.html#L65'>move-cursor-to-left-margin-of-next-line</a> <span class="Constant">0</span>/screen
|
||||
<span id="L29" class="LineNr">29 </span> <a href='104test.subx.html#L5'>count-test-failure</a>
|
||||
<span id="L30" class="LineNr">30 </span><span class="Delimiter">}</span>
|
||||
|
@ -93,10 +93,10 @@ if ('onhashchange' in window) {
|
|||
<span id="L34" class="LineNr">34 </span> compare a, <span class="Constant">0</span>/false
|
||||
<span id="L35" class="LineNr">35 </span> <span class="Delimiter">{</span>
|
||||
<span id="L36" class="LineNr">36 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L37" class="LineNr">37 </span> <a href='501draw-text.mu.html#L339'>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="L37" class="LineNr">37 </span> <a href='501draw-text.mu.html#L332'>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="L38" class="LineNr">38 </span> <span class="PreProc">return</span>
|
||||
<span id="L39" class="LineNr">39 </span> <span class="Delimiter">}</span>
|
||||
<span id="L40" class="LineNr">40 </span> <a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, msg, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L40" class="LineNr">40 </span> <a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, msg, <span class="Constant">3</span>/fg=cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L41" class="LineNr">41 </span> <a href='501draw-text.mu.html#L65'>move-cursor-to-left-margin-of-next-line</a> <span class="Constant">0</span>/screen
|
||||
<span id="L42" class="LineNr">42 </span> <a href='104test.subx.html#L5'>count-test-failure</a>
|
||||
<span id="L43" class="LineNr">43 </span><span class="Delimiter">}</span>
|
||||
|
|
|
@ -76,7 +76,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L12" class="LineNr"> 12 </span> <span class="PreProc">var</span> <a href='500fake-screen.mu.html#L16'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>) <span class="Special"><-</span> copy _screen
|
||||
<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> index/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L244'>screen-cell-index</a> <a href='500fake-screen.mu.html#L16'>screen</a>, x, y
|
||||
<span id="L15" class="LineNr"> 15 </span> <span class="muComment"># compare 'expected' with the screen contents starting at 'index', grapheme by grapheme</span>
|
||||
<span id="L15" class="LineNr"> 15 </span> <span class="muComment"># compare 'expected' with the screen contents starting at 'index', code-point-utf8 by code-point-utf8</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
|
||||
|
@ -90,32 +90,32 @@ if ('onhashchange' in window) {
|
|||
<span id="L26" class="LineNr"> 26 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L27" class="LineNr"> 27 </span> <span class="PreProc">var</span> _c/eax: code-point <span class="Special"><-</span> <a href='500fake-screen.mu.html#L531'>screen-code-point-at-index</a> <a href='500fake-screen.mu.html#L16'>screen</a>, index
|
||||
<span id="L28" class="LineNr"> 28 </span> <span class="PreProc">var</span> c/<span class="muRegEbx">ebx</span>: code-point <span class="Special"><-</span> copy _c
|
||||
<span id="L29" class="LineNr"> 29 </span> <span class="PreProc">var</span> expected-grapheme/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L236'>read-grapheme</a> e-addr
|
||||
<span id="L30" class="LineNr"> 30 </span> <span class="PreProc">var</span> expected-code-point/eax: code-point <span class="Special"><-</span> <a href='403unicode.mu.html#L56'>to-code-point</a> expected-grapheme
|
||||
<span id="L31" class="LineNr"> 31 </span> <span class="muComment"># compare graphemes</span>
|
||||
<span id="L32" class="LineNr"> 32 </span> $check-screen-row-from:compare-graphemes: <span class="Delimiter">{</span>
|
||||
<span id="L33" class="LineNr"> 33 </span> <span class="muComment"># if expected-code-point is space, null grapheme is also ok</span>
|
||||
<span id="L29" class="LineNr"> 29 </span> <span class="PreProc">var</span> expected-code-point-utf8/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L229'>read-code-point-utf8</a> e-addr
|
||||
<span id="L30" class="LineNr"> 30 </span> <span class="PreProc">var</span> expected-code-point/eax: code-point <span class="Special"><-</span> <a href='403unicode.mu.html#L49'>to-code-point</a> expected-code-point-utf8
|
||||
<span id="L31" class="LineNr"> 31 </span> <span class="muComment"># compare code-point-utf8s</span>
|
||||
<span id="L32" class="LineNr"> 32 </span> $check-screen-row-from:compare-code-point-utf8s: <span class="Delimiter">{</span>
|
||||
<span id="L33" class="LineNr"> 33 </span> <span class="muComment"># if expected-code-point is space, null code-point-utf8 is also ok</span>
|
||||
<span id="L34" class="LineNr"> 34 </span> <span class="Delimiter">{</span>
|
||||
<span id="L35" class="LineNr"> 35 </span> compare expected-code-point, <span class="Constant">0x20</span>
|
||||
<span id="L36" class="LineNr"> 36 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L37" class="LineNr"> 37 </span> compare c, <span class="Constant">0</span>
|
||||
<span id="L38" class="LineNr"> 38 </span> <span class="PreProc">break-if-=</span> $check-screen-row-from:compare-graphemes
|
||||
<span id="L38" class="LineNr"> 38 </span> <span class="PreProc">break-if-=</span> $check-screen-row-from:compare-code-point-utf8s
|
||||
<span id="L39" class="LineNr"> 39 </span> <span class="Delimiter">}</span>
|
||||
<span id="L40" class="LineNr"> 40 </span> <span class="muComment"># if (c == expected-code-point) print "."</span>
|
||||
<span id="L41" class="LineNr"> 41 </span> compare c, expected-code-point
|
||||
<span id="L42" class="LineNr"> 42 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L43" class="LineNr"> 43 </span> <span class="muComment"># otherwise print an error</span>
|
||||
<span id="L44" class="LineNr"> 44 </span> failure-count <span class="Special"><-</span> increment
|
||||
<span id="L45" class="LineNr"> 45 </span> <a href='501draw-text.mu.html#L339'>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="L46" class="LineNr"> 46 </span> <a href='501draw-text.mu.html#L339'>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="L47" class="LineNr"> 47 </span> <a href='501draw-text.mu.html#L91'>draw-code-point-at-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, expected-code-point, <span class="Constant">3</span>/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L48" class="LineNr"> 48 </span> <a href='501draw-text.mu.html#L339'>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="L49" class="LineNr"> 49 </span> <a href='501draw-text.mu.html#L394'>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="L50" class="LineNr"> 50 </span> <a href='501draw-text.mu.html#L339'>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="L51" class="LineNr"> 51 </span> <a href='501draw-text.mu.html#L394'>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="L52" class="LineNr"> 52 </span> <a href='501draw-text.mu.html#L339'>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="L53" class="LineNr"> 53 </span> <a href='501draw-text.mu.html#L91'>draw-code-point-at-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, c, <span class="Constant">3</span>/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L54" class="LineNr"> 54 </span> <a href='501draw-text.mu.html#L339'>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="L45" class="LineNr"> 45 </span> <a href='501draw-text.mu.html#L332'>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="L46" class="LineNr"> 46 </span> <a href='501draw-text.mu.html#L332'>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="L47" class="LineNr"> 47 </span> <a href='501draw-text.mu.html#L84'>draw-code-point-at-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, expected-code-point, <span class="Constant">3</span>/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L48" class="LineNr"> 48 </span> <a href='501draw-text.mu.html#L332'>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="L49" class="LineNr"> 49 </span> <a href='501draw-text.mu.html#L387'>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="L50" class="LineNr"> 50 </span> <a href='501draw-text.mu.html#L332'>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="L51" class="LineNr"> 51 </span> <a href='501draw-text.mu.html#L387'>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="L52" class="LineNr"> 52 </span> <a href='501draw-text.mu.html#L332'>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="L53" class="LineNr"> 53 </span> <a href='501draw-text.mu.html#L84'>draw-code-point-at-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, c, <span class="Constant">3</span>/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L54" class="LineNr"> 54 </span> <a href='501draw-text.mu.html#L332'>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> <span class="Delimiter">}</span>
|
||||
|
@ -131,7 +131,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L67" class="LineNr"> 67 </span> <span class="PreProc">return</span>
|
||||
<span id="L68" class="LineNr"> 68 </span> <span class="Delimiter">}</span>
|
||||
<span id="L69" class="LineNr"> 69 </span> <span class="muComment"># otherwise print a "."</span>
|
||||
<span id="L70" class="LineNr"> 70 </span> <a href='501draw-text.mu.html#L339'>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="L70" class="LineNr"> 70 </span> <a href='501draw-text.mu.html#L332'>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="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="muComment"># various variants by screen-cell attribute; spaces in the 'expected' data should not match the attribute</span>
|
||||
|
@ -143,7 +143,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L79" class="LineNr"> 79 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='504test-screen.mu.html#L79'>check-screen-row-in-color-from</a></span> _screen: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), fg: int, y: int, x: int, expected: (addr array byte), msg: (addr array byte) <span class="Delimiter">{</span>
|
||||
<span id="L80" class="LineNr"> 80 </span> <span class="PreProc">var</span> <a href='500fake-screen.mu.html#L16'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>) <span class="Special"><-</span> copy _screen
|
||||
<span id="L81" class="LineNr"> 81 </span> <span class="PreProc">var</span> index/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L244'>screen-cell-index</a> <a href='500fake-screen.mu.html#L16'>screen</a>, x, y
|
||||
<span id="L82" class="LineNr"> 82 </span> <span class="muComment"># compare 'expected' with the screen contents starting at 'index', grapheme by grapheme</span>
|
||||
<span id="L82" class="LineNr"> 82 </span> <span class="muComment"># compare 'expected' with the screen contents starting at 'index', code-point-utf8 by code-point-utf8</span>
|
||||
<span id="L83" class="LineNr"> 83 </span> <span class="PreProc">var</span> e: (stream byte <span class="Constant">0x100</span>)
|
||||
<span id="L84" class="LineNr"> 84 </span> <span class="PreProc">var</span> e-addr/<span class="muRegEdx">edx</span>: (addr stream byte) <span class="Special"><-</span> address e
|
||||
<span id="L85" class="LineNr"> 85 </span> <a href='108write.subx.html#L11'>write</a> e-addr, expected
|
||||
|
@ -157,11 +157,11 @@ if ('onhashchange' in window) {
|
|||
<span id="L93" class="LineNr"> 93 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L94" class="LineNr"> 94 </span> <span class="PreProc">var</span> _c/eax: code-point <span class="Special"><-</span> <a href='500fake-screen.mu.html#L531'>screen-code-point-at-index</a> <a href='500fake-screen.mu.html#L16'>screen</a>, index
|
||||
<span id="L95" class="LineNr"> 95 </span> <span class="PreProc">var</span> c/<span class="muRegEbx">ebx</span>: code-point <span class="Special"><-</span> copy _c
|
||||
<span id="L96" class="LineNr"> 96 </span> <span class="PreProc">var</span> expected-grapheme/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L236'>read-grapheme</a> e-addr
|
||||
<span id="L97" class="LineNr"> 97 </span> <span class="PreProc">var</span> _expected-code-point/eax: code-point <span class="Special"><-</span> <a href='403unicode.mu.html#L56'>to-code-point</a> expected-grapheme
|
||||
<span id="L96" class="LineNr"> 96 </span> <span class="PreProc">var</span> expected-code-point-utf8/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L229'>read-code-point-utf8</a> e-addr
|
||||
<span id="L97" class="LineNr"> 97 </span> <span class="PreProc">var</span> _expected-code-point/eax: code-point <span class="Special"><-</span> <a href='403unicode.mu.html#L49'>to-code-point</a> expected-code-point-utf8
|
||||
<span id="L98" class="LineNr"> 98 </span> <span class="PreProc">var</span> expected-code-point/<span class="muRegEdi">edi</span>: code-point <span class="Special"><-</span> copy _expected-code-point
|
||||
<span id="L99" class="LineNr"> 99 </span> $check-screen-row-in-color-from:compare-cells: <span class="Delimiter">{</span>
|
||||
<span id="L100" class="LineNr">100 </span> <span class="muComment"># if expected-code-point is space, null grapheme is also ok</span>
|
||||
<span id="L100" class="LineNr">100 </span> <span class="muComment"># if expected-code-point is space, null code-point-utf8 is also ok</span>
|
||||
<span id="L101" class="LineNr">101 </span> <span class="Delimiter">{</span>
|
||||
<span id="L102" class="LineNr">102 </span> compare expected-code-point, <span class="Constant">0x20</span>
|
||||
<span id="L103" class="LineNr">103 </span> <span class="PreProc">break-if-!=</span>
|
||||
|
@ -176,27 +176,27 @@ if ('onhashchange' in window) {
|
|||
<span id="L112" class="LineNr">112 </span> compare color, fg
|
||||
<span id="L113" class="LineNr">113 </span> <span class="PreProc">break-if-!=</span> $check-screen-row-in-color-from:compare-cells
|
||||
<span id="L114" class="LineNr">114 </span> <span class="Delimiter">}</span>
|
||||
<span id="L115" class="LineNr">115 </span> <span class="muComment"># compare graphemes</span>
|
||||
<span id="L116" class="LineNr">116 </span> $check-screen-row-in-color-from:compare-graphemes: <span class="Delimiter">{</span>
|
||||
<span id="L115" class="LineNr">115 </span> <span class="muComment"># compare code-point-utf8s</span>
|
||||
<span id="L116" class="LineNr">116 </span> $check-screen-row-in-color-from:compare-code-point-utf8s: <span class="Delimiter">{</span>
|
||||
<span id="L117" class="LineNr">117 </span> <span class="muComment"># if (c == expected-code-point) print "."</span>
|
||||
<span id="L118" class="LineNr">118 </span> compare c, expected-code-point
|
||||
<span id="L119" class="LineNr">119 </span> <span class="Delimiter">{</span>
|
||||
<span id="L120" class="LineNr">120 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L121" class="LineNr">121 </span> <a href='501draw-text.mu.html#L339'>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="L122" class="LineNr">122 </span> <span class="PreProc">break</span> $check-screen-row-in-color-from:compare-graphemes
|
||||
<span id="L121" class="LineNr">121 </span> <a href='501draw-text.mu.html#L332'>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="L122" class="LineNr">122 </span> <span class="PreProc">break</span> $check-screen-row-in-color-from:compare-code-point-utf8s
|
||||
<span id="L123" class="LineNr">123 </span> <span class="Delimiter">}</span>
|
||||
<span id="L124" class="LineNr">124 </span> <span class="muComment"># otherwise print an error</span>
|
||||
<span id="L125" class="LineNr">125 </span> <a href='104test.subx.html#L5'>count-test-failure</a>
|
||||
<span id="L126" class="LineNr">126 </span> <a href='501draw-text.mu.html#L339'>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="L127" class="LineNr">127 </span> <a href='501draw-text.mu.html#L339'>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="L128" class="LineNr">128 </span> <a href='501draw-text.mu.html#L91'>draw-code-point-at-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, expected-code-point, <span class="Constant">3</span>/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L129" class="LineNr">129 </span> <a href='501draw-text.mu.html#L339'>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="L130" class="LineNr">130 </span> <a href='501draw-text.mu.html#L394'>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="L131" class="LineNr">131 </span> <a href='501draw-text.mu.html#L339'>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="L132" class="LineNr">132 </span> <a href='501draw-text.mu.html#L394'>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="L133" class="LineNr">133 </span> <a href='501draw-text.mu.html#L339'>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="L134" class="LineNr">134 </span> <a href='501draw-text.mu.html#L91'>draw-code-point-at-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, c, <span class="Constant">3</span>/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L135" class="LineNr">135 </span> <a href='501draw-text.mu.html#L339'>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="L126" class="LineNr">126 </span> <a href='501draw-text.mu.html#L332'>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="L127" class="LineNr">127 </span> <a href='501draw-text.mu.html#L332'>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="L128" class="LineNr">128 </span> <a href='501draw-text.mu.html#L84'>draw-code-point-at-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, expected-code-point, <span class="Constant">3</span>/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L129" class="LineNr">129 </span> <a href='501draw-text.mu.html#L332'>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="L130" class="LineNr">130 </span> <a href='501draw-text.mu.html#L387'>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="L131" class="LineNr">131 </span> <a href='501draw-text.mu.html#L332'>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="L132" class="LineNr">132 </span> <a href='501draw-text.mu.html#L387'>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="L133" class="LineNr">133 </span> <a href='501draw-text.mu.html#L332'>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="L134" class="LineNr">134 </span> <a href='501draw-text.mu.html#L84'>draw-code-point-at-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, c, <span class="Constant">3</span>/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L135" class="LineNr">135 </span> <a href='501draw-text.mu.html#L332'>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="L136" class="LineNr">136 </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="L137" class="LineNr">137 </span> <span class="Delimiter">}</span>
|
||||
<span id="L138" class="LineNr">138 </span> $check-screen-row-in-color-from:compare-colors: <span class="Delimiter">{</span>
|
||||
|
@ -204,22 +204,22 @@ if ('onhashchange' in window) {
|
|||
<span id="L140" class="LineNr">140 </span> compare fg, color
|
||||
<span id="L141" class="LineNr">141 </span> <span class="Delimiter">{</span>
|
||||
<span id="L142" class="LineNr">142 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L143" class="LineNr">143 </span> <a href='501draw-text.mu.html#L339'>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="L143" class="LineNr">143 </span> <a href='501draw-text.mu.html#L332'>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="L144" class="LineNr">144 </span> <span class="PreProc">break</span> $check-screen-row-in-color-from:compare-colors
|
||||
<span id="L145" class="LineNr">145 </span> <span class="Delimiter">}</span>
|
||||
<span id="L146" class="LineNr">146 </span> <span class="muComment"># otherwise print an error</span>
|
||||
<span id="L147" class="LineNr">147 </span> <a href='104test.subx.html#L5'>count-test-failure</a>
|
||||
<span id="L148" class="LineNr">148 </span> <a href='501draw-text.mu.html#L339'>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="L149" class="LineNr">149 </span> <a href='501draw-text.mu.html#L339'>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="L150" class="LineNr">150 </span> <a href='501draw-text.mu.html#L91'>draw-code-point-at-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, expected-code-point, <span class="Constant">3</span>/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L151" class="LineNr">151 </span> <a href='501draw-text.mu.html#L339'>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="L152" class="LineNr">152 </span> <a href='501draw-text.mu.html#L394'>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="L153" class="LineNr">153 </span> <a href='501draw-text.mu.html#L339'>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="L154" class="LineNr">154 </span> <a href='501draw-text.mu.html#L394'>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="L155" class="LineNr">155 </span> <a href='501draw-text.mu.html#L339'>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="L156" class="LineNr">156 </span> <a href='501draw-text.mu.html#L394'>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="L157" class="LineNr">157 </span> <a href='501draw-text.mu.html#L339'>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="L158" class="LineNr">158 </span> <a href='501draw-text.mu.html#L394'>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="L148" class="LineNr">148 </span> <a href='501draw-text.mu.html#L332'>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="L149" class="LineNr">149 </span> <a href='501draw-text.mu.html#L332'>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="L150" class="LineNr">150 </span> <a href='501draw-text.mu.html#L84'>draw-code-point-at-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, expected-code-point, <span class="Constant">3</span>/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L151" class="LineNr">151 </span> <a href='501draw-text.mu.html#L332'>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="L152" class="LineNr">152 </span> <a href='501draw-text.mu.html#L387'>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="L153" class="LineNr">153 </span> <a href='501draw-text.mu.html#L332'>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="L154" class="LineNr">154 </span> <a href='501draw-text.mu.html#L387'>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="L155" class="LineNr">155 </span> <a href='501draw-text.mu.html#L332'>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="L156" class="LineNr">156 </span> <a href='501draw-text.mu.html#L387'>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="L157" class="LineNr">157 </span> <a href='501draw-text.mu.html#L332'>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="L158" class="LineNr">158 </span> <a href='501draw-text.mu.html#L387'>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="L159" class="LineNr">159 </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="L160" class="LineNr">160 </span> <span class="Delimiter">}</span>
|
||||
<span id="L161" class="LineNr">161 </span> <span class="Delimiter">}</span>
|
||||
|
@ -237,7 +237,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L173" class="LineNr">173 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='504test-screen.mu.html#L173'>check-screen-row-in-background-color-from</a></span> _screen: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), bg: int, y: int, x: int, expected: (addr array byte), msg: (addr array byte) <span class="Delimiter">{</span>
|
||||
<span id="L174" class="LineNr">174 </span> <span class="PreProc">var</span> <a href='500fake-screen.mu.html#L16'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>) <span class="Special"><-</span> copy _screen
|
||||
<span id="L175" class="LineNr">175 </span> <span class="PreProc">var</span> index/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L244'>screen-cell-index</a> <a href='500fake-screen.mu.html#L16'>screen</a>, x, y
|
||||
<span id="L176" class="LineNr">176 </span> <span class="muComment"># compare 'expected' with the screen contents starting at 'index', grapheme by grapheme</span>
|
||||
<span id="L176" class="LineNr">176 </span> <span class="muComment"># compare 'expected' with the screen contents starting at 'index', code-point-utf8 by code-point-utf8</span>
|
||||
<span id="L177" class="LineNr">177 </span> <span class="PreProc">var</span> e: (stream byte <span class="Constant">0x100</span>)
|
||||
<span id="L178" class="LineNr">178 </span> <span class="PreProc">var</span> e-addr/<span class="muRegEdx">edx</span>: (addr stream byte) <span class="Special"><-</span> address e
|
||||
<span id="L179" class="LineNr">179 </span> <a href='108write.subx.html#L11'>write</a> e-addr, expected
|
||||
|
@ -251,11 +251,11 @@ if ('onhashchange' in window) {
|
|||
<span id="L187" class="LineNr">187 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L188" class="LineNr">188 </span> <span class="PreProc">var</span> _g/eax: code-point <span class="Special"><-</span> <a href='500fake-screen.mu.html#L531'>screen-code-point-at-index</a> <a href='500fake-screen.mu.html#L16'>screen</a>, index
|
||||
<span id="L189" class="LineNr">189 </span> <span class="PreProc">var</span> g/<span class="muRegEbx">ebx</span>: code-point <span class="Special"><-</span> copy _g
|
||||
<span id="L190" class="LineNr">190 </span> <span class="PreProc">var</span> expected-grapheme/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L236'>read-grapheme</a> e-addr
|
||||
<span id="L191" class="LineNr">191 </span> <span class="PreProc">var</span> _expected-code-point/eax: code-point <span class="Special"><-</span> <a href='403unicode.mu.html#L56'>to-code-point</a> expected-grapheme
|
||||
<span id="L190" class="LineNr">190 </span> <span class="PreProc">var</span> expected-code-point-utf8/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L229'>read-code-point-utf8</a> e-addr
|
||||
<span id="L191" class="LineNr">191 </span> <span class="PreProc">var</span> _expected-code-point/eax: code-point <span class="Special"><-</span> <a href='403unicode.mu.html#L49'>to-code-point</a> expected-code-point-utf8
|
||||
<span id="L192" class="LineNr">192 </span> <span class="PreProc">var</span> expected-code-point/<span class="muRegEdi">edi</span>: code-point <span class="Special"><-</span> copy _expected-code-point
|
||||
<span id="L193" class="LineNr">193 </span> $check-screen-row-in-background-color-from:compare-cells: <span class="Delimiter">{</span>
|
||||
<span id="L194" class="LineNr">194 </span> <span class="muComment"># if expected-code-point is space, null grapheme is also ok</span>
|
||||
<span id="L194" class="LineNr">194 </span> <span class="muComment"># if expected-code-point is space, null code-point-utf8 is also ok</span>
|
||||
<span id="L195" class="LineNr">195 </span> <span class="Delimiter">{</span>
|
||||
<span id="L196" class="LineNr">196 </span> compare expected-code-point, <span class="Constant">0x20</span>
|
||||
<span id="L197" class="LineNr">197 </span> <span class="PreProc">break-if-!=</span>
|
||||
|
@ -270,51 +270,51 @@ if ('onhashchange' in window) {
|
|||
<span id="L206" class="LineNr">206 </span> compare background-color, bg
|
||||
<span id="L207" class="LineNr">207 </span> <span class="PreProc">break-if-!=</span> $check-screen-row-in-background-color-from:compare-cells
|
||||
<span id="L208" class="LineNr">208 </span> <span class="Delimiter">}</span>
|
||||
<span id="L209" class="LineNr">209 </span> <span class="muComment"># compare graphemes</span>
|
||||
<span id="L210" class="LineNr">210 </span> $check-screen-row-in-background-color-from:compare-graphemes: <span class="Delimiter">{</span>
|
||||
<span id="L209" class="LineNr">209 </span> <span class="muComment"># compare code-point-utf8s</span>
|
||||
<span id="L210" class="LineNr">210 </span> $check-screen-row-in-background-color-from:compare-code-point-utf8s: <span class="Delimiter">{</span>
|
||||
<span id="L211" class="LineNr">211 </span> <span class="muComment"># if (g == expected-code-point) print "."</span>
|
||||
<span id="L212" class="LineNr">212 </span> compare g, expected-code-point
|
||||
<span id="L213" class="LineNr">213 </span> <span class="Delimiter">{</span>
|
||||
<span id="L214" class="LineNr">214 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L215" class="LineNr">215 </span> <a href='501draw-text.mu.html#L339'>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="L216" class="LineNr">216 </span> <span class="PreProc">break</span> $check-screen-row-in-background-color-from:compare-graphemes
|
||||
<span id="L215" class="LineNr">215 </span> <a href='501draw-text.mu.html#L332'>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="L216" class="LineNr">216 </span> <span class="PreProc">break</span> $check-screen-row-in-background-color-from:compare-code-point-utf8s
|
||||
<span id="L217" class="LineNr">217 </span> <span class="Delimiter">}</span>
|
||||
<span id="L218" class="LineNr">218 </span> <span class="muComment"># otherwise print an error</span>
|
||||
<span id="L219" class="LineNr">219 </span> <a href='104test.subx.html#L5'>count-test-failure</a>
|
||||
<span id="L220" class="LineNr">220 </span> <a href='501draw-text.mu.html#L339'>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="L221" class="LineNr">221 </span> <a href='501draw-text.mu.html#L339'>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="L222" class="LineNr">222 </span> <a href='501draw-text.mu.html#L91'>draw-code-point-at-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, expected-code-point, <span class="Constant">3</span>/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L223" class="LineNr">223 </span> <a href='501draw-text.mu.html#L339'>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="L224" class="LineNr">224 </span> <a href='501draw-text.mu.html#L394'>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="L225" class="LineNr">225 </span> <a href='501draw-text.mu.html#L339'>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="L226" class="LineNr">226 </span> <a href='501draw-text.mu.html#L394'>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="L227" class="LineNr">227 </span> <a href='501draw-text.mu.html#L339'>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="L228" class="LineNr">228 </span> <a href='501draw-text.mu.html#L91'>draw-code-point-at-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, g, <span class="Constant">3</span>/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L229" class="LineNr">229 </span> <a href='501draw-text.mu.html#L339'>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#L332'>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="L221" class="LineNr">221 </span> <a href='501draw-text.mu.html#L332'>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="L222" class="LineNr">222 </span> <a href='501draw-text.mu.html#L84'>draw-code-point-at-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, expected-code-point, <span class="Constant">3</span>/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L223" class="LineNr">223 </span> <a href='501draw-text.mu.html#L332'>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="L224" class="LineNr">224 </span> <a href='501draw-text.mu.html#L387'>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="L225" class="LineNr">225 </span> <a href='501draw-text.mu.html#L332'>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="L226" class="LineNr">226 </span> <a href='501draw-text.mu.html#L387'>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="L227" class="LineNr">227 </span> <a href='501draw-text.mu.html#L332'>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="L228" class="LineNr">228 </span> <a href='501draw-text.mu.html#L84'>draw-code-point-at-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, g, <span class="Constant">3</span>/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L229" class="LineNr">229 </span> <a href='501draw-text.mu.html#L332'>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="L230" class="LineNr">230 </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="L231" class="LineNr">231 </span> <span class="PreProc">break</span> $check-screen-row-in-background-color-from:compare-graphemes
|
||||
<span id="L231" class="LineNr">231 </span> <span class="PreProc">break</span> $check-screen-row-in-background-color-from:compare-code-point-utf8s
|
||||
<span id="L232" class="LineNr">232 </span> <span class="Delimiter">}</span>
|
||||
<span id="L233" class="LineNr">233 </span> $check-screen-row-in-background-color-from:compare-background-colors: <span class="Delimiter">{</span>
|
||||
<span id="L234" class="LineNr">234 </span> <span class="PreProc">var</span> background-color/eax: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L568'>screen-background-color-at-index</a> <a href='500fake-screen.mu.html#L16'>screen</a>, index
|
||||
<span id="L235" class="LineNr">235 </span> compare bg, background-color
|
||||
<span id="L236" class="LineNr">236 </span> <span class="Delimiter">{</span>
|
||||
<span id="L237" class="LineNr">237 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L238" class="LineNr">238 </span> <a href='501draw-text.mu.html#L339'>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="L238" class="LineNr">238 </span> <a href='501draw-text.mu.html#L332'>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="L239" class="LineNr">239 </span> <span class="PreProc">break</span> $check-screen-row-in-background-color-from:compare-background-colors
|
||||
<span id="L240" class="LineNr">240 </span> <span class="Delimiter">}</span>
|
||||
<span id="L241" class="LineNr">241 </span> <span class="muComment"># otherwise print an error</span>
|
||||
<span id="L242" class="LineNr">242 </span> <a href='104test.subx.html#L5'>count-test-failure</a>
|
||||
<span id="L243" class="LineNr">243 </span> <a href='501draw-text.mu.html#L339'>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="L244" class="LineNr">244 </span> <a href='501draw-text.mu.html#L339'>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="L245" class="LineNr">245 </span> <a href='501draw-text.mu.html#L91'>draw-code-point-at-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, expected-code-point, <span class="Constant">3</span>/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L246" class="LineNr">246 </span> <a href='501draw-text.mu.html#L339'>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="L247" class="LineNr">247 </span> <a href='501draw-text.mu.html#L394'>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="L248" class="LineNr">248 </span> <a href='501draw-text.mu.html#L339'>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="L249" class="LineNr">249 </span> <a href='501draw-text.mu.html#L394'>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="L250" class="LineNr">250 </span> <a href='501draw-text.mu.html#L339'>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="L251" class="LineNr">251 </span> <a href='501draw-text.mu.html#L394'>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="L252" class="LineNr">252 </span> <a href='501draw-text.mu.html#L339'>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="L253" class="LineNr">253 </span> <a href='501draw-text.mu.html#L394'>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="L243" class="LineNr">243 </span> <a href='501draw-text.mu.html#L332'>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="L244" class="LineNr">244 </span> <a href='501draw-text.mu.html#L332'>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="L245" class="LineNr">245 </span> <a href='501draw-text.mu.html#L84'>draw-code-point-at-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, expected-code-point, <span class="Constant">3</span>/cyan, <span class="Constant">0</span>/bg
|
||||
<span id="L246" class="LineNr">246 </span> <a href='501draw-text.mu.html#L332'>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="L247" class="LineNr">247 </span> <a href='501draw-text.mu.html#L387'>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="L248" class="LineNr">248 </span> <a href='501draw-text.mu.html#L332'>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="L249" class="LineNr">249 </span> <a href='501draw-text.mu.html#L387'>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="L250" class="LineNr">250 </span> <a href='501draw-text.mu.html#L332'>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="L251" class="LineNr">251 </span> <a href='501draw-text.mu.html#L387'>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="L252" class="LineNr">252 </span> <a href='501draw-text.mu.html#L332'>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="L253" class="LineNr">253 </span> <a href='501draw-text.mu.html#L387'>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="L254" class="LineNr">254 </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="L255" class="LineNr">255 </span> <span class="Delimiter">}</span>
|
||||
<span id="L256" class="LineNr">256 </span> <span class="Delimiter">}</span>
|
||||
|
@ -348,8 +348,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L284" class="LineNr">284 </span> <span class="PreProc">var</span> unused?/eax: boolean <span class="Special"><-</span> <a href='500fake-screen.mu.html#L513'>screen-cell-unused-at-index?</a> <a href='500fake-screen.mu.html#L16'>screen</a>, index
|
||||
<span id="L285" class="LineNr">285 </span> compare unused?, <span class="Constant">0</span>/false
|
||||
<span id="L286" class="LineNr">286 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L287" class="LineNr">287 </span> <span class="PreProc">var</span> _expected-bit/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L236'>read-grapheme</a> e-addr
|
||||
<span id="L288" class="LineNr">288 </span> <span class="PreProc">var</span> expected-bit/<span class="muRegEdi">edi</span>: grapheme <span class="Special"><-</span> copy _expected-bit
|
||||
<span id="L287" class="LineNr">287 </span> <span class="PreProc">var</span> _expected-bit/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L229'>read-code-point-utf8</a> e-addr
|
||||
<span id="L288" class="LineNr">288 </span> <span class="PreProc">var</span> expected-bit/<span class="muRegEdi">edi</span>: code-point-utf8 <span class="Special"><-</span> copy _expected-bit
|
||||
<span id="L289" class="LineNr">289 </span> $check-background-color-in-screen-row-from:compare-cells: <span class="Delimiter">{</span>
|
||||
<span id="L290" class="LineNr">290 </span> <span class="PreProc">var</span> background-color/eax: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L568'>screen-background-color-at-index</a> <a href='500fake-screen.mu.html#L16'>screen</a>, index
|
||||
<span id="L291" class="LineNr">291 </span> <span class="muComment"># if expected-bit is space, assert that background is NOT bg</span>
|
||||
|
@ -359,13 +359,13 @@ if ('onhashchange' in window) {
|
|||
<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#L339'>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#L339'>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#L394'>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#L339'>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#L394'>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#L339'>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="L304" class="LineNr">304 </span> <a href='501draw-text.mu.html#L394'>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#L332'>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#L332'>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#L387'>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#L332'>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#L387'>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#L332'>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="L304" class="LineNr">304 </span> <a href='501draw-text.mu.html#L387'>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#L65'>move-cursor-to-left-margin-of-next-line</a> <span class="Constant">0</span>/screen
|
||||
<span id="L306" class="LineNr">306 </span> <span class="PreProc">break</span> $check-background-color-in-screen-row-from:compare-cells
|
||||
<span id="L307" class="LineNr">307 </span> <span class="Delimiter">}</span>
|
||||
|
@ -373,15 +373,15 @@ if ('onhashchange' in window) {
|
|||
<span id="L309" class="LineNr">309 </span> compare background-color, bg
|
||||
<span id="L310" class="LineNr">310 </span> <span class="PreProc">break-if-=</span> $check-background-color-in-screen-row-from:compare-cells
|
||||
<span id="L311" class="LineNr">311 </span> increment failure-count
|
||||
<span id="L312" class="LineNr">312 </span> <a href='501draw-text.mu.html#L339'>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="L313" class="LineNr">313 </span> <a href='501draw-text.mu.html#L339'>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="L314" class="LineNr">314 </span> <a href='501draw-text.mu.html#L394'>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="L315" class="LineNr">315 </span> <a href='501draw-text.mu.html#L339'>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="L316" class="LineNr">316 </span> <a href='501draw-text.mu.html#L394'>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="L317" class="LineNr">317 </span> <a href='501draw-text.mu.html#L339'>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="L318" class="LineNr">318 </span> <a href='501draw-text.mu.html#L394'>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="L319" class="LineNr">319 </span> <a href='501draw-text.mu.html#L339'>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="L320" class="LineNr">320 </span> <a href='501draw-text.mu.html#L394'>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="L312" class="LineNr">312 </span> <a href='501draw-text.mu.html#L332'>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="L313" class="LineNr">313 </span> <a href='501draw-text.mu.html#L332'>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="L314" class="LineNr">314 </span> <a href='501draw-text.mu.html#L387'>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="L315" class="LineNr">315 </span> <a href='501draw-text.mu.html#L332'>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="L316" class="LineNr">316 </span> <a href='501draw-text.mu.html#L387'>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="L317" class="LineNr">317 </span> <a href='501draw-text.mu.html#L332'>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="L318" class="LineNr">318 </span> <a href='501draw-text.mu.html#L387'>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="L319" class="LineNr">319 </span> <a href='501draw-text.mu.html#L332'>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="L320" class="LineNr">320 </span> <a href='501draw-text.mu.html#L387'>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="L321" class="LineNr">321 </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="L322" class="LineNr">322 </span> <span class="Delimiter">}</span>
|
||||
<span id="L323" class="LineNr">323 </span> <span class="Delimiter">}</span>
|
||||
|
@ -397,28 +397,28 @@ if ('onhashchange' in window) {
|
|||
<span id="L333" class="LineNr">333 </span> <span class="PreProc">return</span>
|
||||
<span id="L334" class="LineNr">334 </span> <span class="Delimiter">}</span>
|
||||
<span id="L335" class="LineNr">335 </span> <span class="muComment"># otherwise print a "."</span>
|
||||
<span id="L336" class="LineNr">336 </span> <a href='501draw-text.mu.html#L339'>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="L336" class="LineNr">336 </span> <a href='501draw-text.mu.html#L332'>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="L337" class="LineNr">337 </span><span class="Delimiter">}</span>
|
||||
<span id="L338" class="LineNr">338 </span>
|
||||
<span id="L339" class="LineNr">339 </span><span class="PreProc">fn</span> <span class="muTest"><a href='504test-screen.mu.html#L339'>test-draw-single-grapheme</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L339" class="LineNr">339 </span><span class="PreProc">fn</span> <span class="muTest"><a href='504test-screen.mu.html#L339'>test-draw-single-code-point-utf8</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L340" class="LineNr">340 </span> <span class="PreProc">var</span> _screen: <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L341" class="LineNr">341 </span> <span class="PreProc">var</span> <a href='500fake-screen.mu.html#L16'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>) <span class="Special"><-</span> address _screen
|
||||
<span id="L342" class="LineNr">342 </span> <a href='500fake-screen.mu.html#L34'>initialize-screen</a> <a href='500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">5</span>, <span class="Constant">4</span>, <span class="Constant">0</span>/no-pixel-graphics
|
||||
<span id="L343" class="LineNr">343 </span> <span class="PreProc">var</span> dummy/eax: int <span class="Special"><-</span> <a href='500fake-screen.mu.html#L94'>draw-code-point</a> <a href='500fake-screen.mu.html#L16'>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="L344" class="LineNr">344 </span> <a href='504test-screen.mu.html#L7'>check-screen-row</a> <a href='500fake-screen.mu.html#L16'>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="L345" class="LineNr">345 </span> <a href='504test-screen.mu.html#L75'>check-screen-row-in-color</a> <a href='500fake-screen.mu.html#L16'>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="L346" class="LineNr">346 </span> <a href='504test-screen.mu.html#L169'>check-screen-row-in-background-color</a> <a href='500fake-screen.mu.html#L16'>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="L347" class="LineNr">347 </span> <a href='504test-screen.mu.html#L267'>check-background-color-in-screen-row</a> <a href='500fake-screen.mu.html#L16'>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="L344" class="LineNr">344 </span> <a href='504test-screen.mu.html#L7'>check-screen-row</a> <a href='500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0</span>/y, <span class="Constant">"a"</span>, <span class="Constant">"F - test-draw-single-code-point-utf8"</span> <span class="muComment"># top-left corner of the screen</span>
|
||||
<span id="L345" class="LineNr">345 </span> <a href='504test-screen.mu.html#L75'>check-screen-row-in-color</a> <a href='500fake-screen.mu.html#L16'>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-code-point-utf8-fg"</span>
|
||||
<span id="L346" class="LineNr">346 </span> <a href='504test-screen.mu.html#L169'>check-screen-row-in-background-color</a> <a href='500fake-screen.mu.html#L16'>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-code-point-utf8-bg"</span>
|
||||
<span id="L347" class="LineNr">347 </span> <a href='504test-screen.mu.html#L267'>check-background-color-in-screen-row</a> <a href='500fake-screen.mu.html#L16'>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-code-point-utf8-bg2"</span>
|
||||
<span id="L348" class="LineNr">348 </span><span class="Delimiter">}</span>
|
||||
<span id="L349" class="LineNr">349 </span>
|
||||
<span id="L350" class="LineNr">350 </span><span class="PreProc">fn</span> <span class="muTest"><a href='504test-screen.mu.html#L350'>test-draw-multiple-graphemes</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L350" class="LineNr">350 </span><span class="PreProc">fn</span> <span class="muTest"><a href='504test-screen.mu.html#L350'>test-draw-multiple-code-point-utf8s</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L351" class="LineNr">351 </span> <span class="PreProc">var</span> _screen: <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L352" class="LineNr">352 </span> <span class="PreProc">var</span> <a href='500fake-screen.mu.html#L16'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>) <span class="Special"><-</span> address _screen
|
||||
<span id="L353" class="LineNr">353 </span> <a href='500fake-screen.mu.html#L34'>initialize-screen</a> <a href='500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x10</span>/rows, <span class="Constant">4</span>/cols, <span class="Constant">0</span>/no-pixel-graphics
|
||||
<span id="L354" class="LineNr">354 </span> <a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"Hello, 世界"</span>, <span class="Constant">1</span>/fg, <span class="Constant">2</span>/bg
|
||||
<span id="L355" class="LineNr">355 </span> <a href='504test-screen.mu.html#L7'>check-screen-row</a> <a href='500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0</span>/y, <span class="Constant">"Hello, 世界"</span>, <span class="Constant">"F - test-draw-multiple-graphemes"</span>
|
||||
<span id="L356" class="LineNr">356 </span> <a href='504test-screen.mu.html#L75'>check-screen-row-in-color</a> <a href='500fake-screen.mu.html#L16'>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="L357" class="LineNr">357 </span> <a href='504test-screen.mu.html#L267'>check-background-color-in-screen-row</a> <a href='500fake-screen.mu.html#L16'>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="L354" class="LineNr">354 </span> <a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"Hello, 世界"</span>, <span class="Constant">1</span>/fg, <span class="Constant">2</span>/bg
|
||||
<span id="L355" class="LineNr">355 </span> <a href='504test-screen.mu.html#L7'>check-screen-row</a> <a href='500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0</span>/y, <span class="Constant">"Hello, 世界"</span>, <span class="Constant">"F - test-draw-multiple-code-point-utf8s"</span>
|
||||
<span id="L356" class="LineNr">356 </span> <a href='504test-screen.mu.html#L75'>check-screen-row-in-color</a> <a href='500fake-screen.mu.html#L16'>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-code-point-utf8s-fg"</span>
|
||||
<span id="L357" class="LineNr">357 </span> <a href='504test-screen.mu.html#L267'>check-background-color-in-screen-row</a> <a href='500fake-screen.mu.html#L16'>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-code-point-utf8s-bg2"</span>
|
||||
<span id="L358" class="LineNr">358 </span><span class="Delimiter">}</span>
|
||||
</pre>
|
||||
</body>
|
||||
|
|
|
@ -236,9 +236,9 @@ 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">break-if-<</span>
|
||||
<span id="L173" class="LineNr"> 173 </span> <a href='500fake-screen.mu.html#L269'>set-cursor-position</a> <span class="Constant">0</span>/screen, <span class="Constant">0x20</span>/x <span class="Constant">0x20</span>/y
|
||||
<span id="L174" class="LineNr"> 174 </span> <a href='501draw-text.mu.html#L449'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, imgx, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L175" class="LineNr"> 175 </span> <a href='501draw-text.mu.html#L449'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, imgy, <span class="Constant">4</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L176" class="LineNr"> 176 </span> <a href='501draw-text.mu.html#L449'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, idx, <span class="Constant">5</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L174" class="LineNr"> 174 </span> <a href='501draw-text.mu.html#L442'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, imgx, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L175" class="LineNr"> 175 </span> <a href='501draw-text.mu.html#L442'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, imgy, <span class="Constant">4</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L176" class="LineNr"> 176 </span> <a href='501draw-text.mu.html#L442'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, idx, <span class="Constant">5</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L177" class="LineNr"> 177 </span> <span class="Delimiter">}</span>
|
||||
<span id="L178" class="LineNr"> 178 </span> <span class="PreProc">var</span> src-a/eax: (addr byte) <span class="Special"><-</span> index img-data, idx
|
||||
<span id="L179" class="LineNr"> 179 </span> <span class="PreProc">var</span> src/eax: byte <span class="Special"><-</span> copy-byte *src-a
|
||||
|
@ -279,7 +279,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L214" class="LineNr"> 214 </span> tmp <span class="Special"><-</span> <a href='311decimal-int.subx.html#L4'>parse-decimal-int-from-slice</a> curr-word
|
||||
<span id="L215" class="LineNr"> 215 </span> compare tmp, <span class="Constant">0xff</span>
|
||||
<span id="L216" class="LineNr"> 216 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L217" class="LineNr"> 217 </span> <a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">"levels of grey is not 255; continuing and hoping for the best"</span>, <span class="Constant">0x2b</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L217" class="LineNr"> 217 </span> <a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">"levels of grey is not 255; continuing and hoping for the best"</span>, <span class="Constant">0x2b</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L218" class="LineNr"> 218 </span> <span class="Delimiter">}</span>
|
||||
<span id="L219" class="LineNr"> 219 </span> <span class="PreProc">var</span> dest/<span class="muRegEdi">edi</span>: (addr int) <span class="Special"><-</span> get self, max
|
||||
<span id="L220" class="LineNr"> 220 </span> copy-to *dest, tmp
|
||||
|
@ -358,9 +358,9 @@ if ('onhashchange' in window) {
|
|||
<span id="L293" class="LineNr"> 293 </span> <span class="Delimiter">{</span>
|
||||
<span id="L294" class="LineNr"> 294 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L295" class="LineNr"> 295 </span> <a href='500fake-screen.mu.html#L269'>set-cursor-position</a> <span class="Constant">0</span>/screen, <span class="Constant">0x20</span>/x <span class="Constant">0x20</span>/y
|
||||
<span id="L296" class="LineNr"> 296 </span> <a href='501draw-text.mu.html#L449'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, imgx, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L297" class="LineNr"> 297 </span> <a href='501draw-text.mu.html#L449'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, imgy, <span class="Constant">4</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L298" class="LineNr"> 298 </span> <a href='501draw-text.mu.html#L449'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, idx, <span class="Constant">5</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L296" class="LineNr"> 296 </span> <a href='501draw-text.mu.html#L442'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, imgx, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L297" class="LineNr"> 297 </span> <a href='501draw-text.mu.html#L442'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, imgy, <span class="Constant">4</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L298" class="LineNr"> 298 </span> <a href='501draw-text.mu.html#L442'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, idx, <span class="Constant">5</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L299" class="LineNr"> 299 </span> <span class="Delimiter">}</span>
|
||||
<span id="L300" class="LineNr"> 300 </span> <span class="PreProc">var</span> src-a/eax: (addr byte) <span class="Special"><-</span> index img-data, idx
|
||||
<span id="L301" class="LineNr"> 301 </span> <span class="PreProc">var</span> src/eax: byte <span class="Special"><-</span> copy-byte *src-a
|
||||
|
@ -433,12 +433,12 @@ if ('onhashchange' in window) {
|
|||
<span id="L368" class="LineNr"> 368 </span> curr-int <span class="Special"><-</span> shift-left <span class="Constant">0x10</span> <span class="muComment"># we have 32 bits; we'll use 16 bits for the fraction and leave 8 for unanticipated overflow</span>
|
||||
<span id="L369" class="LineNr"> 369 </span> <span class="PreProc">var</span> <span class="Special">error</span>/<span class="muRegEsi">esi</span>: int <span class="Special"><-</span> <a href='511image.mu.html#L563'>_read-dithering-error</a> errors, x, y, src-width
|
||||
<span id="L370" class="LineNr"> 370 </span> <span class="Special">error</span> <span class="Special"><-</span> add curr-int
|
||||
<span id="L371" class="LineNr"> 371 </span> $_dither-pgm-unordered-monochrome:update-error: <span class="Delimiter">{</span>
|
||||
<span id="L371" class="LineNr"> 371 </span> $dither-pgm-unordered-monochrome:update-error: <span class="Delimiter">{</span>
|
||||
<span id="L372" class="LineNr"> 372 </span> compare <span class="Special">error</span>, <span class="Constant">0x800000</span>
|
||||
<span id="L373" class="LineNr"> 373 </span> <span class="Delimiter">{</span>
|
||||
<span id="L374" class="LineNr"> 374 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L375" class="LineNr"> 375 </span> <a href='511image.mu.html#L594'>_write-raw-buffer</a> dest-data, x, y, src-width, <span class="Constant">0</span>/black
|
||||
<span id="L376" class="LineNr"> 376 </span> <span class="PreProc">break</span> $_dither-pgm-unordered-monochrome:update-error
|
||||
<span id="L376" class="LineNr"> 376 </span> <span class="PreProc">break</span> $dither-pgm-unordered-monochrome:update-error
|
||||
<span id="L377" class="LineNr"> 377 </span> <span class="Delimiter">}</span>
|
||||
<span id="L378" class="LineNr"> 378 </span> <a href='511image.mu.html#L594'>_write-raw-buffer</a> dest-data, x, y, src-width, <span class="Constant">1</span>/white
|
||||
<span id="L379" class="LineNr"> 379 </span> <span class="Special">error</span> <span class="Special"><-</span> subtract <span class="Constant">0xff0000</span>
|
||||
|
@ -718,8 +718,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L653" class="LineNr"> 653 </span><span class="CommentedCode">#? break-if-<=</span>
|
||||
<span id="L654" class="LineNr"> 654 </span><span class="CommentedCode">#? return</span>
|
||||
<span id="L655" class="LineNr"> 655 </span><span class="CommentedCode">#? }</span>
|
||||
<span id="L656" class="LineNr"> 656 </span> <a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, s, <span class="Constant">7</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L657" class="LineNr"> 657 </span> <a href='501draw-text.mu.html#L449'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, d, fg <span class="Constant">0</span>/bg
|
||||
<span id="L656" class="LineNr"> 656 </span> <a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, s, <span class="Constant">7</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L657" class="LineNr"> 657 </span> <a href='501draw-text.mu.html#L442'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, d, fg <span class="Constant">0</span>/bg
|
||||
<span id="L658" class="LineNr"> 658 </span><span class="Delimiter">}</span>
|
||||
<span id="L659" class="LineNr"> 659 </span>
|
||||
<span id="L660" class="LineNr"> 660 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='511image.mu.html#L660'>psx</a></span> s: (addr array byte), d: int, fg: int, x: int, y: int <span class="Delimiter">{</span>
|
||||
|
@ -743,8 +743,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L678" class="LineNr"> 678 </span><span class="CommentedCode">#? break-if-<=</span>
|
||||
<span id="L679" class="LineNr"> 679 </span><span class="CommentedCode">#? return</span>
|
||||
<span id="L680" class="LineNr"> 680 </span><span class="CommentedCode">#? }</span>
|
||||
<span id="L681" class="LineNr"> 681 </span> <a href='501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, s, <span class="Constant">7</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L682" class="LineNr"> 682 </span> <a href='501draw-text.mu.html#L394'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, d, fg <span class="Constant">0</span>/bg
|
||||
<span id="L681" class="LineNr"> 681 </span> <a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, s, <span class="Constant">7</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L682" class="LineNr"> 682 </span> <a href='501draw-text.mu.html#L387'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, d, fg <span class="Constant">0</span>/bg
|
||||
<span id="L683" class="LineNr"> 683 </span><span class="Delimiter">}</span>
|
||||
<span id="L684" class="LineNr"> 684 </span>
|
||||
<span id="L685" class="LineNr"> 685 </span><span class="muComment"># import a color ascii "pixmap" (each pixel consists of 3 shades of r/g/b from 0 to 255)</span>
|
||||
|
@ -855,9 +855,9 @@ if ('onhashchange' in window) {
|
|||
<span id="L790" class="LineNr"> 790 </span> <span class="Delimiter">{</span>
|
||||
<span id="L791" class="LineNr"> 791 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L792" class="LineNr"> 792 </span> <a href='500fake-screen.mu.html#L269'>set-cursor-position</a> <span class="Constant">0</span>/screen, <span class="Constant">0x20</span>/x <span class="Constant">0x20</span>/y
|
||||
<span id="L793" class="LineNr"> 793 </span> <a href='501draw-text.mu.html#L449'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, imgx, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L794" class="LineNr"> 794 </span> <a href='501draw-text.mu.html#L449'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, imgy, <span class="Constant">4</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L795" class="LineNr"> 795 </span> <a href='501draw-text.mu.html#L449'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, idx, <span class="Constant">5</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L793" class="LineNr"> 793 </span> <a href='501draw-text.mu.html#L442'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, imgx, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L794" class="LineNr"> 794 </span> <a href='501draw-text.mu.html#L442'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, imgy, <span class="Constant">4</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L795" class="LineNr"> 795 </span> <a href='501draw-text.mu.html#L442'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, idx, <span class="Constant">5</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L796" class="LineNr"> 796 </span> <span class="Delimiter">}</span>
|
||||
<span id="L797" class="LineNr"> 797 </span> <span class="muComment"># r channel</span>
|
||||
<span id="L798" class="LineNr"> 798 </span> <span class="PreProc">var</span> r: int
|
||||
|
@ -1144,9 +1144,9 @@ if ('onhashchange' in window) {
|
|||
<span id="L1079" class="LineNr">1079 </span> <span class="Delimiter">{</span>
|
||||
<span id="L1080" class="LineNr">1080 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L1081" class="LineNr">1081 </span> <a href='500fake-screen.mu.html#L269'>set-cursor-position</a> <span class="Constant">0</span>/screen, <span class="Constant">0x20</span>/x <span class="Constant">0x20</span>/y
|
||||
<span id="L1082" class="LineNr">1082 </span> <a href='501draw-text.mu.html#L449'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, imgx, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L1083" class="LineNr">1083 </span> <a href='501draw-text.mu.html#L449'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, imgy, <span class="Constant">4</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L1084" class="LineNr">1084 </span> <a href='501draw-text.mu.html#L449'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, idx, <span class="Constant">5</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L1082" class="LineNr">1082 </span> <a href='501draw-text.mu.html#L442'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, imgx, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L1083" class="LineNr">1083 </span> <a href='501draw-text.mu.html#L442'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, imgy, <span class="Constant">4</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L1084" class="LineNr">1084 </span> <a href='501draw-text.mu.html#L442'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, idx, <span class="Constant">5</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L1085" class="LineNr">1085 </span> <span class="Delimiter">}</span>
|
||||
<span id="L1086" class="LineNr">1086 </span> <span class="PreProc">var</span> color-a/eax: (addr byte) <span class="Special"><-</span> index img-data, idx
|
||||
<span id="L1087" class="LineNr">1087 </span> <span class="PreProc">var</span> color/eax: byte <span class="Special"><-</span> copy-byte *color-a
|
||||
|
|
|
@ -62,29 +62,29 @@ if ('onhashchange' in window) {
|
|||
<body onload='JumpToLine();'>
|
||||
<a href='https://github.com/akkartik/mu/blob/main/513grapheme-stack.mu'>https://github.com/akkartik/mu/blob/main/513grapheme-stack.mu</a>
|
||||
<pre id='vimCodeElement'>
|
||||
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># grapheme stacks are the smallest unit of editable text</span>
|
||||
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># code-point-utf8 stacks are the smallest unit of editable text</span>
|
||||
<span id="L2" class="LineNr"> 2 </span>
|
||||
<span id="L3" class="LineNr"> 3 </span><span class="PreProc">type</span> <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a> <span class="Delimiter">{</span>
|
||||
<span id="L4" class="LineNr"> 4 </span> data: (handle array grapheme)
|
||||
<span id="L3" class="LineNr"> 3 </span><span class="PreProc">type</span> <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a> <span class="Delimiter">{</span>
|
||||
<span id="L4" class="LineNr"> 4 </span> data: (handle array code-point-utf8)
|
||||
<span id="L5" class="LineNr"> 5 </span> top: int
|
||||
<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='513grapheme-stack.mu.html#L8'>initialize-grapheme-stack</a></span> _self: (addr <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>), n: int <span class="Delimiter">{</span>
|
||||
<span id="L9" class="LineNr"> 9 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L10" class="LineNr"> 10 </span> <span class="PreProc">var</span> d/<span class="muRegEdi">edi</span>: (addr handle array grapheme) <span class="Special"><-</span> get self, data
|
||||
<span id="L8" class="LineNr"> 8 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='513grapheme-stack.mu.html#L8'>initialize-code-point-utf8-stack</a></span> _self: (addr <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>), n: int <span class="Delimiter">{</span>
|
||||
<span id="L9" class="LineNr"> 9 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L10" class="LineNr"> 10 </span> <span class="PreProc">var</span> d/<span class="muRegEdi">edi</span>: (addr handle array code-point-utf8) <span class="Special"><-</span> get self, data
|
||||
<span id="L11" class="LineNr"> 11 </span> populate d, n
|
||||
<span id="L12" class="LineNr"> 12 </span> <span class="PreProc">var</span> top/eax: (addr int) <span class="Special"><-</span> get self, top
|
||||
<span id="L13" class="LineNr"> 13 </span> copy-to *top, <span class="Constant">0</span>
|
||||
<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='513grapheme-stack.mu.html#L16'>clear-grapheme-stack</a></span> _self: (addr <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Delimiter">{</span>
|
||||
<span id="L17" class="LineNr"> 17 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L16" class="LineNr"> 16 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='513grapheme-stack.mu.html#L16'>clear-code-point-utf8-stack</a></span> _self: (addr <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>) <span class="Delimiter">{</span>
|
||||
<span id="L17" class="LineNr"> 17 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L18" class="LineNr"> 18 </span> <span class="PreProc">var</span> top/eax: (addr int) <span class="Special"><-</span> get self, top
|
||||
<span id="L19" class="LineNr"> 19 </span> copy-to *top, <span class="Constant">0</span>
|
||||
<span id="L20" class="LineNr"> 20 </span><span class="Delimiter">}</span>
|
||||
<span id="L21" class="LineNr"> 21 </span>
|
||||
<span id="L22" class="LineNr"> 22 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='513grapheme-stack.mu.html#L22'>grapheme-stack-empty?</a></span> _self: (addr <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>)<span class="PreProc"> -> </span>_/eax: boolean <span class="Delimiter">{</span>
|
||||
<span id="L23" class="LineNr"> 23 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L22" class="LineNr"> 22 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='513grapheme-stack.mu.html#L22'>code-point-utf8-stack-empty?</a></span> _self: (addr <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>)<span class="PreProc"> -> </span>_/eax: boolean <span class="Delimiter">{</span>
|
||||
<span id="L23" class="LineNr"> 23 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L24" class="LineNr"> 24 </span> <span class="PreProc">var</span> top/eax: (addr int) <span class="Special"><-</span> get self, top
|
||||
<span id="L25" class="LineNr"> 25 </span> compare *top, <span class="Constant">0</span>
|
||||
<span id="L26" class="LineNr"> 26 </span> <span class="Delimiter">{</span>
|
||||
|
@ -94,26 +94,26 @@ if ('onhashchange' in window) {
|
|||
<span id="L30" class="LineNr"> 30 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
|
||||
<span id="L31" class="LineNr"> 31 </span><span class="Delimiter">}</span>
|
||||
<span id="L32" class="LineNr"> 32 </span>
|
||||
<span id="L33" class="LineNr"> 33 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='513grapheme-stack.mu.html#L33'>grapheme-stack-length</a></span> _self: (addr <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>)<span class="PreProc"> -> </span>_/eax: int <span class="Delimiter">{</span>
|
||||
<span id="L34" class="LineNr"> 34 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L33" class="LineNr"> 33 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='513grapheme-stack.mu.html#L33'>code-point-utf8-stack-length</a></span> _self: (addr <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>)<span class="PreProc"> -> </span>_/eax: int <span class="Delimiter">{</span>
|
||||
<span id="L34" class="LineNr"> 34 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L35" class="LineNr"> 35 </span> <span class="PreProc">var</span> top/eax: (addr int) <span class="Special"><-</span> get self, top
|
||||
<span id="L36" class="LineNr"> 36 </span> <span class="PreProc">return</span> *top
|
||||
<span id="L37" class="LineNr"> 37 </span><span class="Delimiter">}</span>
|
||||
<span id="L38" class="LineNr"> 38 </span>
|
||||
<span id="L39" class="LineNr"> 39 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='513grapheme-stack.mu.html#L39'>push-grapheme-stack</a></span> _self: (addr <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>), _val: grapheme <span class="Delimiter">{</span>
|
||||
<span id="L40" class="LineNr"> 40 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L39" class="LineNr"> 39 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='513grapheme-stack.mu.html#L39'>push-code-point-utf8-stack</a></span> _self: (addr <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>), _val: code-point-utf8 <span class="Delimiter">{</span>
|
||||
<span id="L40" class="LineNr"> 40 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L41" class="LineNr"> 41 </span> <span class="PreProc">var</span> top-addr/<span class="muRegEcx">ecx</span>: (addr int) <span class="Special"><-</span> get self, top
|
||||
<span id="L42" class="LineNr"> 42 </span> <span class="PreProc">var</span> data-ah/<span class="muRegEdx">edx</span>: (addr handle array grapheme) <span class="Special"><-</span> get self, data
|
||||
<span id="L43" class="LineNr"> 43 </span> <span class="PreProc">var</span> data/eax: (addr array grapheme) <span class="Special"><-</span> <a href='120allocate.subx.html#L235'>lookup</a> *data-ah
|
||||
<span id="L42" class="LineNr"> 42 </span> <span class="PreProc">var</span> data-ah/<span class="muRegEdx">edx</span>: (addr handle array code-point-utf8) <span class="Special"><-</span> get self, data
|
||||
<span id="L43" class="LineNr"> 43 </span> <span class="PreProc">var</span> data/eax: (addr array code-point-utf8) <span class="Special"><-</span> <a href='120allocate.subx.html#L235'>lookup</a> *data-ah
|
||||
<span id="L44" class="LineNr"> 44 </span> <span class="PreProc">var</span> top/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy *top-addr
|
||||
<span id="L45" class="LineNr"> 45 </span> <span class="PreProc">var</span> dest-addr/<span class="muRegEdx">edx</span>: (addr grapheme) <span class="Special"><-</span> index data, top
|
||||
<span id="L46" class="LineNr"> 46 </span> <span class="PreProc">var</span> val/eax: grapheme <span class="Special"><-</span> copy _val
|
||||
<span id="L45" class="LineNr"> 45 </span> <span class="PreProc">var</span> dest-addr/<span class="muRegEdx">edx</span>: (addr code-point-utf8) <span class="Special"><-</span> index data, top
|
||||
<span id="L46" class="LineNr"> 46 </span> <span class="PreProc">var</span> val/eax: code-point-utf8 <span class="Special"><-</span> copy _val
|
||||
<span id="L47" class="LineNr"> 47 </span> copy-to *dest-addr, val
|
||||
<span id="L48" class="LineNr"> 48 </span> add-to *top-addr, <span class="Constant">1</span>
|
||||
<span id="L49" class="LineNr"> 49 </span><span class="Delimiter">}</span>
|
||||
<span id="L50" class="LineNr"> 50 </span>
|
||||
<span id="L51" class="LineNr"> 51 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='513grapheme-stack.mu.html#L51'>pop-grapheme-stack</a></span> _self: (addr <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>)<span class="PreProc"> -> </span>_/eax: grapheme <span class="Delimiter">{</span>
|
||||
<span id="L52" class="LineNr"> 52 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L51" class="LineNr"> 51 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='513grapheme-stack.mu.html#L51'>pop-code-point-utf8-stack</a></span> _self: (addr <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>)<span class="PreProc"> -> </span>_/eax: code-point-utf8 <span class="Delimiter">{</span>
|
||||
<span id="L52" class="LineNr"> 52 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L53" class="LineNr"> 53 </span> <span class="PreProc">var</span> top-addr/<span class="muRegEcx">ecx</span>: (addr int) <span class="Special"><-</span> get self, top
|
||||
<span id="L54" class="LineNr"> 54 </span> <span class="Delimiter">{</span>
|
||||
<span id="L55" class="LineNr"> 55 </span> compare *top-addr, <span class="Constant">0</span>
|
||||
|
@ -121,25 +121,25 @@ if ('onhashchange' in window) {
|
|||
<span id="L57" class="LineNr"> 57 </span> <span class="PreProc">return</span> <span class="Constant">-1</span>
|
||||
<span id="L58" class="LineNr"> 58 </span> <span class="Delimiter">}</span>
|
||||
<span id="L59" class="LineNr"> 59 </span> subtract-from *top-addr, <span class="Constant">1</span>
|
||||
<span id="L60" class="LineNr"> 60 </span> <span class="PreProc">var</span> data-ah/<span class="muRegEdx">edx</span>: (addr handle array grapheme) <span class="Special"><-</span> get self, data
|
||||
<span id="L61" class="LineNr"> 61 </span> <span class="PreProc">var</span> data/eax: (addr array grapheme) <span class="Special"><-</span> <a href='120allocate.subx.html#L235'>lookup</a> *data-ah
|
||||
<span id="L60" class="LineNr"> 60 </span> <span class="PreProc">var</span> data-ah/<span class="muRegEdx">edx</span>: (addr handle array code-point-utf8) <span class="Special"><-</span> get self, data
|
||||
<span id="L61" class="LineNr"> 61 </span> <span class="PreProc">var</span> data/eax: (addr array code-point-utf8) <span class="Special"><-</span> <a href='120allocate.subx.html#L235'>lookup</a> *data-ah
|
||||
<span id="L62" class="LineNr"> 62 </span> <span class="PreProc">var</span> top/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy *top-addr
|
||||
<span id="L63" class="LineNr"> 63 </span> <span class="PreProc">var</span> result-addr/eax: (addr grapheme) <span class="Special"><-</span> index data, top
|
||||
<span id="L63" class="LineNr"> 63 </span> <span class="PreProc">var</span> result-addr/eax: (addr code-point-utf8) <span class="Special"><-</span> index data, top
|
||||
<span id="L64" class="LineNr"> 64 </span> <span class="PreProc">return</span> *result-addr
|
||||
<span id="L65" class="LineNr"> 65 </span><span class="Delimiter">}</span>
|
||||
<span id="L66" class="LineNr"> 66 </span>
|
||||
<span id="L67" class="LineNr"> 67 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='513grapheme-stack.mu.html#L67'>copy-grapheme-stack</a></span> _src: (addr <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>), dest: (addr <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Delimiter">{</span>
|
||||
<span id="L68" class="LineNr"> 68 </span> <span class="PreProc">var</span> src/<span class="muRegEsi">esi</span>: (addr <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special"><-</span> copy _src
|
||||
<span id="L69" class="LineNr"> 69 </span> <span class="PreProc">var</span> data-ah/<span class="muRegEdi">edi</span>: (addr handle array grapheme) <span class="Special"><-</span> get src, data
|
||||
<span id="L70" class="LineNr"> 70 </span> <span class="PreProc">var</span> _data/eax: (addr array grapheme) <span class="Special"><-</span> <a href='120allocate.subx.html#L235'>lookup</a> *data-ah
|
||||
<span id="L71" class="LineNr"> 71 </span> <span class="PreProc">var</span> data/<span class="muRegEdi">edi</span>: (addr array grapheme) <span class="Special"><-</span> copy _data
|
||||
<span id="L67" class="LineNr"> 67 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='513grapheme-stack.mu.html#L67'>copy-code-point-utf8-stack</a></span> _src: (addr <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>), dest: (addr <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>) <span class="Delimiter">{</span>
|
||||
<span id="L68" class="LineNr"> 68 </span> <span class="PreProc">var</span> src/<span class="muRegEsi">esi</span>: (addr <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>) <span class="Special"><-</span> copy _src
|
||||
<span id="L69" class="LineNr"> 69 </span> <span class="PreProc">var</span> data-ah/<span class="muRegEdi">edi</span>: (addr handle array code-point-utf8) <span class="Special"><-</span> get src, data
|
||||
<span id="L70" class="LineNr"> 70 </span> <span class="PreProc">var</span> _data/eax: (addr array code-point-utf8) <span class="Special"><-</span> <a href='120allocate.subx.html#L235'>lookup</a> *data-ah
|
||||
<span id="L71" class="LineNr"> 71 </span> <span class="PreProc">var</span> data/<span class="muRegEdi">edi</span>: (addr array code-point-utf8) <span class="Special"><-</span> copy _data
|
||||
<span id="L72" class="LineNr"> 72 </span> <span class="PreProc">var</span> top-addr/<span class="muRegEcx">ecx</span>: (addr int) <span class="Special"><-</span> get src, top
|
||||
<span id="L73" class="LineNr"> 73 </span> <span class="PreProc">var</span> i/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L74" class="LineNr"> 74 </span> <span class="Delimiter">{</span>
|
||||
<span id="L75" class="LineNr"> 75 </span> compare i, *top-addr
|
||||
<span id="L76" class="LineNr"> 76 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L77" class="LineNr"> 77 </span> <span class="PreProc">var</span> g/<span class="muRegEdx">edx</span>: (addr grapheme) <span class="Special"><-</span> index data, i
|
||||
<span id="L78" class="LineNr"> 78 </span> <a href='513grapheme-stack.mu.html#L39'>push-grapheme-stack</a> dest, *g
|
||||
<span id="L77" class="LineNr"> 77 </span> <span class="PreProc">var</span> g/<span class="muRegEdx">edx</span>: (addr code-point-utf8) <span class="Special"><-</span> index data, i
|
||||
<span id="L78" class="LineNr"> 78 </span> <a href='513grapheme-stack.mu.html#L39'>push-code-point-utf8-stack</a> dest, *g
|
||||
<span id="L79" class="LineNr"> 79 </span> i <span class="Special"><-</span> increment
|
||||
<span id="L80" class="LineNr"> 80 </span> <span class="PreProc">loop</span>
|
||||
<span id="L81" class="LineNr"> 81 </span> <span class="Delimiter">}</span>
|
||||
|
@ -148,12 +148,12 @@ 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='513grapheme-stack.mu.html#L87'>render-stack-from-bottom-wrapping-right-then-down</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), _self: (addr <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>), xmin: int, ymin: int, xmax: int, ymax: int, _x: int, _y: int, <a href='514gap-buffer.mu.html#L942'>highlight-matching-open-paren?</a>: boolean, open-paren-depth: int, color: int, background-color: int<span class="PreProc"> -> </span>_/eax: 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='513grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L87" class="LineNr"> 87 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='513grapheme-stack.mu.html#L87'>render-stack-from-bottom-wrapping-right-then-down</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), _self: (addr <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>), xmin: int, ymin: int, xmax: int, ymax: int, _x: int, _y: int, <a href='514gap-buffer.mu.html#L942'>highlight-matching-open-paren?</a>: boolean, open-paren-depth: int, color: int, background-color: int<span class="PreProc"> -> </span>_/eax: 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='513grapheme-stack.mu.html#L3'>code-point-utf8-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='513grapheme-stack.mu.html#L449'>get-matching-open-paren-index</a> self, <a href='514gap-buffer.mu.html#L942'>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/eax: (addr array grapheme) <span class="Special"><-</span> <a href='120allocate.subx.html#L235'>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
|
||||
<span id="L90" class="LineNr"> 90 </span> <span class="PreProc">var</span> data-ah/<span class="muRegEdi">edi</span>: (addr handle array code-point-utf8) <span class="Special"><-</span> get self, data
|
||||
<span id="L91" class="LineNr"> 91 </span> <span class="PreProc">var</span> _data/eax: (addr array code-point-utf8) <span class="Special"><-</span> <a href='120allocate.subx.html#L235'>lookup</a> *data-ah
|
||||
<span id="L92" class="LineNr"> 92 </span> <span class="PreProc">var</span> data/<span class="muRegEdi">edi</span>: (addr array code-point-utf8) <span class="Special"><-</span> copy _data
|
||||
<span id="L93" class="LineNr"> 93 </span> <span class="PreProc">var</span> x/eax: int <span class="Special"><-</span> copy _x
|
||||
<span id="L94" class="LineNr"> 94 </span> <span class="PreProc">var</span> y/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy _y
|
||||
<span id="L95" class="LineNr"> 95 </span> <span class="PreProc">var</span> top-addr/<span class="muRegEsi">esi</span>: (addr int) <span class="Special"><-</span> get self, top
|
||||
|
@ -164,8 +164,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L100" class="LineNr">100 </span> <span class="Delimiter">{</span>
|
||||
<span id="L101" class="LineNr">101 </span> <span class="PreProc">var</span> c: code-point
|
||||
<span id="L102" class="LineNr">102 </span> <span class="Delimiter">{</span>
|
||||
<span id="L103" class="LineNr">103 </span> <span class="PreProc">var</span> g/eax: (addr grapheme) <span class="Special"><-</span> index data, i
|
||||
<span id="L104" class="LineNr">104 </span> <span class="PreProc">var</span> tmp/eax: code-point <span class="Special"><-</span> <a href='403unicode.mu.html#L56'>to-code-point</a> *g
|
||||
<span id="L103" class="LineNr">103 </span> <span class="PreProc">var</span> g/eax: (addr code-point-utf8) <span class="Special"><-</span> index data, i
|
||||
<span id="L104" class="LineNr">104 </span> <span class="PreProc">var</span> tmp/eax: code-point <span class="Special"><-</span> <a href='403unicode.mu.html#L49'>to-code-point</a> *g
|
||||
<span id="L105" class="LineNr">105 </span> copy-to c, tmp
|
||||
<span id="L106" class="LineNr">106 </span> <span class="Delimiter">}</span>
|
||||
<span id="L107" class="LineNr">107 </span> <span class="PreProc">var</span> fg: int
|
||||
|
@ -178,7 +178,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L114" class="LineNr">114 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L115" class="LineNr">115 </span> copy-to fg, <span class="Constant">0xf</span>/highlight
|
||||
<span id="L116" class="LineNr">116 </span> <span class="Delimiter">}</span>
|
||||
<span id="L117" class="LineNr">117 </span> x, y <span class="Special"><-</span> <a href='501draw-text.mu.html#L162'>render-code-point</a> <a href='500fake-screen.mu.html#L16'>screen</a>, c, xmin, ymin, xmax, ymax, x, y, fg, background-color <span class="muComment"># TODO: handle combining characters</span>
|
||||
<span id="L117" class="LineNr">117 </span> x, y <span class="Special"><-</span> <a href='501draw-text.mu.html#L155'>render-code-point</a> <a href='500fake-screen.mu.html#L16'>screen</a>, c, xmin, ymin, xmax, ymax, x, y, fg, background-color <span class="muComment"># TODO: handle combining characters</span>
|
||||
<span id="L118" class="LineNr">118 </span> <span class="Delimiter">}</span>
|
||||
<span id="L119" class="LineNr">119 </span> i <span class="Special"><-</span> increment
|
||||
<span id="L120" class="LineNr">120 </span> <span class="PreProc">loop</span>
|
||||
|
@ -187,7 +187,7 @@ if ('onhashchange' in window) {
|
|||
<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="muComment"># helper for small words</span>
|
||||
<span id="L126" class="LineNr">126 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='513grapheme-stack.mu.html#L126'>render-stack-from-bottom</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), self: (addr <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>), x: int, y: int, <a href='514gap-buffer.mu.html#L942'>highlight-matching-open-paren?</a>: boolean, open-paren-depth: int<span class="PreProc"> -> </span>_/eax: int <span class="Delimiter">{</span>
|
||||
<span id="L126" class="LineNr">126 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='513grapheme-stack.mu.html#L126'>render-stack-from-bottom</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), self: (addr <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>), x: int, y: int, <a href='514gap-buffer.mu.html#L942'>highlight-matching-open-paren?</a>: boolean, open-paren-depth: int<span class="PreProc"> -> </span>_/eax: int <span class="Delimiter">{</span>
|
||||
<span id="L127" class="LineNr">127 </span> <span class="PreProc">var</span> _width/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L128" class="LineNr">128 </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="L129" class="LineNr">129 </span> _width, _height <span class="Special"><-</span> <a href='500fake-screen.mu.html#L75'>screen-size</a> <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
|
@ -200,16 +200,16 @@ 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="muComment"># dump stack to screen from top to bottom</span>
|
||||
<span id="L139" class="LineNr">139 </span><span class="muComment"># optionally render a 'cursor' with the top grapheme</span>
|
||||
<span id="L139" class="LineNr">139 </span><span class="muComment"># optionally render a 'cursor' with the top code-point-utf8</span>
|
||||
<span id="L140" class="LineNr">140 </span><span class="muComment"># hard-coded colors:</span>
|
||||
<span id="L141" class="LineNr">141 </span><span class="muComment"># matching paren</span>
|
||||
<span id="L142" class="LineNr">142 </span><span class="muComment"># cursor</span>
|
||||
<span id="L143" class="LineNr">143 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='513grapheme-stack.mu.html#L143'>render-stack-from-top-wrapping-right-then-down</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), _self: (addr <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>), xmin: int, ymin: int, xmax: int, ymax: int, _x: int, _y: int, render-cursor?: boolean, color: int, background-color: int<span class="PreProc"> -> </span>_/eax: int, _/<span class="muRegEcx">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L144" class="LineNr">144 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L143" class="LineNr">143 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='513grapheme-stack.mu.html#L143'>render-stack-from-top-wrapping-right-then-down</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), _self: (addr <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>), xmin: int, ymin: int, xmax: int, ymax: int, _x: int, _y: int, render-cursor?: boolean, color: int, background-color: int<span class="PreProc"> -> </span>_/eax: int, _/<span class="muRegEcx">ecx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L144" class="LineNr">144 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L145" class="LineNr">145 </span> <span class="PreProc">var</span> matching-close-paren-index/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> <a href='513grapheme-stack.mu.html#L393'>get-matching-close-paren-index</a> self, render-cursor?
|
||||
<span id="L146" class="LineNr">146 </span> <span class="PreProc">var</span> data-ah/eax: (addr handle array grapheme) <span class="Special"><-</span> get self, data
|
||||
<span id="L147" class="LineNr">147 </span> <span class="PreProc">var</span> _data/eax: (addr array grapheme) <span class="Special"><-</span> <a href='120allocate.subx.html#L235'>lookup</a> *data-ah
|
||||
<span id="L148" class="LineNr">148 </span> <span class="PreProc">var</span> data/<span class="muRegEdi">edi</span>: (addr array grapheme) <span class="Special"><-</span> copy _data
|
||||
<span id="L146" class="LineNr">146 </span> <span class="PreProc">var</span> data-ah/eax: (addr handle array code-point-utf8) <span class="Special"><-</span> get self, data
|
||||
<span id="L147" class="LineNr">147 </span> <span class="PreProc">var</span> _data/eax: (addr array code-point-utf8) <span class="Special"><-</span> <a href='120allocate.subx.html#L235'>lookup</a> *data-ah
|
||||
<span id="L148" class="LineNr">148 </span> <span class="PreProc">var</span> data/<span class="muRegEdi">edi</span>: (addr array code-point-utf8) <span class="Special"><-</span> copy _data
|
||||
<span id="L149" class="LineNr">149 </span> <span class="PreProc">var</span> x/eax: int <span class="Special"><-</span> copy _x
|
||||
<span id="L150" class="LineNr">150 </span> <span class="PreProc">var</span> y/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy _y
|
||||
<span id="L151" class="LineNr">151 </span> <span class="PreProc">var</span> top-addr/<span class="muRegEbx">ebx</span>: (addr int) <span class="Special"><-</span> get self, top
|
||||
|
@ -223,11 +223,11 @@ if ('onhashchange' in window) {
|
|||
<span id="L159" class="LineNr">159 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L160" class="LineNr">160 </span> <span class="PreProc">var</span> c: code-point
|
||||
<span id="L161" class="LineNr">161 </span> <span class="Delimiter">{</span>
|
||||
<span id="L162" class="LineNr">162 </span> <span class="PreProc">var</span> g/eax: (addr grapheme) <span class="Special"><-</span> index data, i
|
||||
<span id="L163" class="LineNr">163 </span> <span class="PreProc">var</span> tmp/eax: code-point <span class="Special"><-</span> <a href='403unicode.mu.html#L56'>to-code-point</a> *g
|
||||
<span id="L162" class="LineNr">162 </span> <span class="PreProc">var</span> g/eax: (addr code-point-utf8) <span class="Special"><-</span> index data, i
|
||||
<span id="L163" class="LineNr">163 </span> <span class="PreProc">var</span> tmp/eax: code-point <span class="Special"><-</span> <a href='403unicode.mu.html#L49'>to-code-point</a> *g
|
||||
<span id="L164" class="LineNr">164 </span> copy-to c, tmp
|
||||
<span id="L165" class="LineNr">165 </span> <span class="Delimiter">}</span>
|
||||
<span id="L166" class="LineNr">166 </span> x, y <span class="Special"><-</span> <a href='501draw-text.mu.html#L162'>render-code-point</a> <a href='500fake-screen.mu.html#L16'>screen</a>, c, xmin, ymin, xmax, ymax, x, y, background-color, color
|
||||
<span id="L166" class="LineNr">166 </span> x, y <span class="Special"><-</span> <a href='501draw-text.mu.html#L155'>render-code-point</a> <a href='500fake-screen.mu.html#L16'>screen</a>, c, xmin, ymin, xmax, ymax, x, y, background-color, color
|
||||
<span id="L167" class="LineNr">167 </span> i <span class="Special"><-</span> decrement
|
||||
<span id="L168" class="LineNr">168 </span> <span class="Delimiter">}</span>
|
||||
<span id="L169" class="LineNr">169 </span> <span class="muComment"># remaining iterations</span>
|
||||
|
@ -248,11 +248,11 @@ if ('onhashchange' in window) {
|
|||
<span id="L184" class="LineNr">184 </span> <span class="muComment">#</span>
|
||||
<span id="L185" class="LineNr">185 </span> <span class="PreProc">var</span> c: code-point
|
||||
<span id="L186" class="LineNr">186 </span> <span class="Delimiter">{</span>
|
||||
<span id="L187" class="LineNr">187 </span> <span class="PreProc">var</span> g/eax: (addr grapheme) <span class="Special"><-</span> index data, i
|
||||
<span id="L188" class="LineNr">188 </span> <span class="PreProc">var</span> tmp/eax: code-point <span class="Special"><-</span> <a href='403unicode.mu.html#L56'>to-code-point</a> *g
|
||||
<span id="L187" class="LineNr">187 </span> <span class="PreProc">var</span> g/eax: (addr code-point-utf8) <span class="Special"><-</span> index data, i
|
||||
<span id="L188" class="LineNr">188 </span> <span class="PreProc">var</span> tmp/eax: code-point <span class="Special"><-</span> <a href='403unicode.mu.html#L49'>to-code-point</a> *g
|
||||
<span id="L189" class="LineNr">189 </span> copy-to c, tmp
|
||||
<span id="L190" class="LineNr">190 </span> <span class="Delimiter">}</span>
|
||||
<span id="L191" class="LineNr">191 </span> x, y <span class="Special"><-</span> <a href='501draw-text.mu.html#L162'>render-code-point</a> <a href='500fake-screen.mu.html#L16'>screen</a>, c, xmin, ymin, xmax, ymax, x, y, fg, background-color
|
||||
<span id="L191" class="LineNr">191 </span> x, y <span class="Special"><-</span> <a href='501draw-text.mu.html#L155'>render-code-point</a> <a href='500fake-screen.mu.html#L16'>screen</a>, c, xmin, ymin, xmax, ymax, x, y, fg, background-color
|
||||
<span id="L192" class="LineNr">192 </span> i <span class="Special"><-</span> decrement
|
||||
<span id="L193" class="LineNr">193 </span> <span class="PreProc">loop</span>
|
||||
<span id="L194" class="LineNr">194 </span> <span class="Delimiter">}</span>
|
||||
|
@ -260,7 +260,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L196" class="LineNr">196 </span><span class="Delimiter">}</span>
|
||||
<span id="L197" class="LineNr">197 </span>
|
||||
<span id="L198" class="LineNr">198 </span><span class="muComment"># helper for small words</span>
|
||||
<span id="L199" class="LineNr">199 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='513grapheme-stack.mu.html#L199'>render-stack-from-top</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), self: (addr <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>), x: int, y: int, render-cursor?: boolean<span class="PreProc"> -> </span>_/eax: int <span class="Delimiter">{</span>
|
||||
<span id="L199" class="LineNr">199 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='513grapheme-stack.mu.html#L199'>render-stack-from-top</a></span> <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), self: (addr <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>), x: int, y: int, render-cursor?: boolean<span class="PreProc"> -> </span>_/eax: int <span class="Delimiter">{</span>
|
||||
<span id="L200" class="LineNr">200 </span> <span class="PreProc">var</span> _width/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L201" class="LineNr">201 </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="L202" class="LineNr">202 </span> _width, _height <span class="Special"><-</span> <a href='500fake-screen.mu.html#L75'>screen-size</a> <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
|
@ -272,190 +272,190 @@ if ('onhashchange' in window) {
|
|||
<span id="L208" class="LineNr">208 </span> <span class="PreProc">return</span> x2 <span class="muComment"># y2? yolo</span>
|
||||
<span id="L209" class="LineNr">209 </span><span class="Delimiter">}</span>
|
||||
<span id="L210" class="LineNr">210 </span>
|
||||
<span id="L211" class="LineNr">211 </span><span class="PreProc">fn</span> <span class="muTest"><a href='513grapheme-stack.mu.html#L211'>test-render-grapheme-stack</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L211" class="LineNr">211 </span><span class="PreProc">fn</span> <span class="muTest"><a href='513grapheme-stack.mu.html#L211'>test-render-code-point-utf8-stack</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L212" class="LineNr">212 </span> <span class="muComment"># setup: gs = "abc"</span>
|
||||
<span id="L213" class="LineNr">213 </span> <span class="PreProc">var</span> gs-storage: <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>
|
||||
<span id="L214" class="LineNr">214 </span> <span class="PreProc">var</span> gs/<span class="muRegEdi">edi</span>: (addr <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special"><-</span> address gs-storage
|
||||
<span id="L215" class="LineNr">215 </span> <a href='513grapheme-stack.mu.html#L8'>initialize-grapheme-stack</a> gs, <span class="Constant">5</span>
|
||||
<span id="L216" class="LineNr">216 </span> <span class="PreProc">var</span> g/eax: grapheme <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L217" class="LineNr">217 </span> <a href='513grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
|
||||
<span id="L213" class="LineNr">213 </span> <span class="PreProc">var</span> gs-storage: <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>
|
||||
<span id="L214" class="LineNr">214 </span> <span class="PreProc">var</span> gs/<span class="muRegEdi">edi</span>: (addr <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>) <span class="Special"><-</span> address gs-storage
|
||||
<span id="L215" class="LineNr">215 </span> <a href='513grapheme-stack.mu.html#L8'>initialize-code-point-utf8-stack</a> gs, <span class="Constant">5</span>
|
||||
<span id="L216" class="LineNr">216 </span> <span class="PreProc">var</span> g/eax: code-point-utf8 <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L217" class="LineNr">217 </span> <a href='513grapheme-stack.mu.html#L39'>push-code-point-utf8-stack</a> gs, g
|
||||
<span id="L218" class="LineNr">218 </span> g <span class="Special"><-</span> copy <span class="Constant">0x62</span>/b
|
||||
<span id="L219" class="LineNr">219 </span> <a href='513grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
|
||||
<span id="L219" class="LineNr">219 </span> <a href='513grapheme-stack.mu.html#L39'>push-code-point-utf8-stack</a> gs, g
|
||||
<span id="L220" class="LineNr">220 </span> g <span class="Special"><-</span> copy <span class="Constant">0x63</span>/c
|
||||
<span id="L221" class="LineNr">221 </span> <a href='513grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
|
||||
<span id="L221" class="LineNr">221 </span> <a href='513grapheme-stack.mu.html#L39'>push-code-point-utf8-stack</a> gs, g
|
||||
<span id="L222" class="LineNr">222 </span> <span class="muComment"># setup: screen</span>
|
||||
<span id="L223" class="LineNr">223 </span> <span class="PreProc">var</span> screen-storage: <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L224" class="LineNr">224 </span> <span class="PreProc">var</span> <a href='500fake-screen.mu.html#L16'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>) <span class="Special"><-</span> address screen-storage
|
||||
<span id="L225" class="LineNr">225 </span> <a href='500fake-screen.mu.html#L34'>initialize-screen</a> <a href='500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">5</span>, <span class="Constant">4</span>, <span class="Constant">0</span>/no-pixel-graphics
|
||||
<span id="L226" class="LineNr">226 </span> <span class="muComment">#</span>
|
||||
<span id="L227" class="LineNr">227 </span> <span class="PreProc">var</span> x/eax: int <span class="Special"><-</span> <a href='513grapheme-stack.mu.html#L126'>render-stack-from-bottom</a> <a href='500fake-screen.mu.html#L16'>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="L228" class="LineNr">228 </span> <a href='504test-screen.mu.html#L7'>check-screen-row</a> <a href='500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0</span>/y, <span class="Constant">"abc "</span>, <span class="Constant">"F - <a href='513grapheme-stack.mu.html#L211'>test-render-grapheme-stack</a> from bottom"</span>
|
||||
<span id="L229" class="LineNr">229 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> x, <span class="Constant">3</span>, <span class="Constant">"F - <a href='513grapheme-stack.mu.html#L211'>test-render-grapheme-stack</a> from bottom: result"</span>
|
||||
<span id="L230" class="LineNr">230 </span> <a href='504test-screen.mu.html#L267'>check-background-color-in-screen-row</a> <a href='500fake-screen.mu.html#L16'>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='513grapheme-stack.mu.html#L211'>test-render-grapheme-stack</a> from bottom: bg"</span>
|
||||
<span id="L228" class="LineNr">228 </span> <a href='504test-screen.mu.html#L7'>check-screen-row</a> <a href='500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0</span>/y, <span class="Constant">"abc "</span>, <span class="Constant">"F - <a href='513grapheme-stack.mu.html#L211'>test-render-code-point-utf8-stack</a> from bottom"</span>
|
||||
<span id="L229" class="LineNr">229 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> x, <span class="Constant">3</span>, <span class="Constant">"F - <a href='513grapheme-stack.mu.html#L211'>test-render-code-point-utf8-stack</a> from bottom: result"</span>
|
||||
<span id="L230" class="LineNr">230 </span> <a href='504test-screen.mu.html#L267'>check-background-color-in-screen-row</a> <a href='500fake-screen.mu.html#L16'>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='513grapheme-stack.mu.html#L211'>test-render-code-point-utf8-stack</a> from bottom: bg"</span>
|
||||
<span id="L231" class="LineNr">231 </span> <span class="muComment">#</span>
|
||||
<span id="L232" class="LineNr">232 </span> <span class="PreProc">var</span> x/eax: int <span class="Special"><-</span> <a href='513grapheme-stack.mu.html#L199'>render-stack-from-top</a> <a href='500fake-screen.mu.html#L16'>screen</a>, gs, <span class="Constant">0</span>/x, <span class="Constant">1</span>/y, <span class="Constant">0</span>/cursor=false
|
||||
<span id="L233" class="LineNr">233 </span> <a href='504test-screen.mu.html#L7'>check-screen-row</a> <a href='500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">1</span>/y, <span class="Constant">"cba "</span>, <span class="Constant">"F - <a href='513grapheme-stack.mu.html#L211'>test-render-grapheme-stack</a> from top without cursor"</span>
|
||||
<span id="L234" class="LineNr">234 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> x, <span class="Constant">3</span>, <span class="Constant">"F - <a href='513grapheme-stack.mu.html#L211'>test-render-grapheme-stack</a> from top without cursor: result"</span>
|
||||
<span id="L235" class="LineNr">235 </span> <a href='504test-screen.mu.html#L267'>check-background-color-in-screen-row</a> <a href='500fake-screen.mu.html#L16'>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='513grapheme-stack.mu.html#L211'>test-render-grapheme-stack</a> from top without cursor: bg"</span>
|
||||
<span id="L233" class="LineNr">233 </span> <a href='504test-screen.mu.html#L7'>check-screen-row</a> <a href='500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">1</span>/y, <span class="Constant">"cba "</span>, <span class="Constant">"F - <a href='513grapheme-stack.mu.html#L211'>test-render-code-point-utf8-stack</a> from top without cursor"</span>
|
||||
<span id="L234" class="LineNr">234 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> x, <span class="Constant">3</span>, <span class="Constant">"F - <a href='513grapheme-stack.mu.html#L211'>test-render-code-point-utf8-stack</a> from top without cursor: result"</span>
|
||||
<span id="L235" class="LineNr">235 </span> <a href='504test-screen.mu.html#L267'>check-background-color-in-screen-row</a> <a href='500fake-screen.mu.html#L16'>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='513grapheme-stack.mu.html#L211'>test-render-code-point-utf8-stack</a> from top without cursor: bg"</span>
|
||||
<span id="L236" class="LineNr">236 </span> <span class="muComment">#</span>
|
||||
<span id="L237" class="LineNr">237 </span> <span class="PreProc">var</span> x/eax: int <span class="Special"><-</span> <a href='513grapheme-stack.mu.html#L199'>render-stack-from-top</a> <a href='500fake-screen.mu.html#L16'>screen</a>, gs, <span class="Constant">0</span>/x, <span class="Constant">2</span>/y, <span class="Constant">1</span>/cursor=true
|
||||
<span id="L238" class="LineNr">238 </span> <a href='504test-screen.mu.html#L7'>check-screen-row</a> <a href='500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">"cba "</span>, <span class="Constant">"F - <a href='513grapheme-stack.mu.html#L211'>test-render-grapheme-stack</a> from top with cursor"</span>
|
||||
<span id="L239" class="LineNr">239 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> x, <span class="Constant">3</span>, <span class="Constant">"F - <a href='513grapheme-stack.mu.html#L211'>test-render-grapheme-stack</a> from top with cursor: result"</span>
|
||||
<span id="L240" class="LineNr">240 </span> <a href='504test-screen.mu.html#L267'>check-background-color-in-screen-row</a> <a href='500fake-screen.mu.html#L16'>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='513grapheme-stack.mu.html#L211'>test-render-grapheme-stack</a> from top with cursor: bg"</span>
|
||||
<span id="L238" class="LineNr">238 </span> <a href='504test-screen.mu.html#L7'>check-screen-row</a> <a href='500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">"cba "</span>, <span class="Constant">"F - <a href='513grapheme-stack.mu.html#L211'>test-render-code-point-utf8-stack</a> from top with cursor"</span>
|
||||
<span id="L239" class="LineNr">239 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> x, <span class="Constant">3</span>, <span class="Constant">"F - <a href='513grapheme-stack.mu.html#L211'>test-render-code-point-utf8-stack</a> from top with cursor: result"</span>
|
||||
<span id="L240" class="LineNr">240 </span> <a href='504test-screen.mu.html#L267'>check-background-color-in-screen-row</a> <a href='500fake-screen.mu.html#L16'>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='513grapheme-stack.mu.html#L211'>test-render-code-point-utf8-stack</a> from top with cursor: bg"</span>
|
||||
<span id="L241" class="LineNr">241 </span><span class="Delimiter">}</span>
|
||||
<span id="L242" class="LineNr">242 </span>
|
||||
<span id="L243" class="LineNr">243 </span><span class="PreProc">fn</span> <span class="muTest"><a href='513grapheme-stack.mu.html#L243'>test-render-grapheme-stack-while-highlighting-matching-close-paren</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L243" class="LineNr">243 </span><span class="PreProc">fn</span> <span class="muTest"><a href='513grapheme-stack.mu.html#L243'>test-render-code-point-utf8-stack-while-highlighting-matching-close-paren</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L244" class="LineNr">244 </span> <span class="muComment"># setup: gs = "(b)"</span>
|
||||
<span id="L245" class="LineNr">245 </span> <span class="PreProc">var</span> gs-storage: <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>
|
||||
<span id="L246" class="LineNr">246 </span> <span class="PreProc">var</span> gs/<span class="muRegEdi">edi</span>: (addr <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special"><-</span> address gs-storage
|
||||
<span id="L247" class="LineNr">247 </span> <a href='513grapheme-stack.mu.html#L8'>initialize-grapheme-stack</a> gs, <span class="Constant">5</span>
|
||||
<span id="L248" class="LineNr">248 </span> <span class="PreProc">var</span> g/eax: grapheme <span class="Special"><-</span> copy <span class="Constant">0x29</span>/close-paren
|
||||
<span id="L249" class="LineNr">249 </span> <a href='513grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
|
||||
<span id="L245" class="LineNr">245 </span> <span class="PreProc">var</span> gs-storage: <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>
|
||||
<span id="L246" class="LineNr">246 </span> <span class="PreProc">var</span> gs/<span class="muRegEdi">edi</span>: (addr <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>) <span class="Special"><-</span> address gs-storage
|
||||
<span id="L247" class="LineNr">247 </span> <a href='513grapheme-stack.mu.html#L8'>initialize-code-point-utf8-stack</a> gs, <span class="Constant">5</span>
|
||||
<span id="L248" class="LineNr">248 </span> <span class="PreProc">var</span> g/eax: code-point-utf8 <span class="Special"><-</span> copy <span class="Constant">0x29</span>/close-paren
|
||||
<span id="L249" class="LineNr">249 </span> <a href='513grapheme-stack.mu.html#L39'>push-code-point-utf8-stack</a> gs, g
|
||||
<span id="L250" class="LineNr">250 </span> g <span class="Special"><-</span> copy <span class="Constant">0x62</span>/b
|
||||
<span id="L251" class="LineNr">251 </span> <a href='513grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
|
||||
<span id="L251" class="LineNr">251 </span> <a href='513grapheme-stack.mu.html#L39'>push-code-point-utf8-stack</a> gs, g
|
||||
<span id="L252" class="LineNr">252 </span> g <span class="Special"><-</span> copy <span class="Constant">0x28</span>/open-paren
|
||||
<span id="L253" class="LineNr">253 </span> <a href='513grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
|
||||
<span id="L253" class="LineNr">253 </span> <a href='513grapheme-stack.mu.html#L39'>push-code-point-utf8-stack</a> gs, g
|
||||
<span id="L254" class="LineNr">254 </span> <span class="muComment"># setup: screen</span>
|
||||
<span id="L255" class="LineNr">255 </span> <span class="PreProc">var</span> screen-storage: <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L256" class="LineNr">256 </span> <span class="PreProc">var</span> <a href='500fake-screen.mu.html#L16'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>) <span class="Special"><-</span> address screen-storage
|
||||
<span id="L257" class="LineNr">257 </span> <a href='500fake-screen.mu.html#L34'>initialize-screen</a> <a href='500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">5</span>, <span class="Constant">4</span>, <span class="Constant">0</span>/no-pixel-graphics
|
||||
<span id="L258" class="LineNr">258 </span> <span class="muComment">#</span>
|
||||
<span id="L259" class="LineNr">259 </span> <span class="PreProc">var</span> x/eax: int <span class="Special"><-</span> <a href='513grapheme-stack.mu.html#L199'>render-stack-from-top</a> <a href='500fake-screen.mu.html#L16'>screen</a>, gs, <span class="Constant">0</span>/x, <span class="Constant">2</span>/y, <span class="Constant">1</span>/cursor=true
|
||||
<span id="L260" class="LineNr">260 </span> <a href='504test-screen.mu.html#L7'>check-screen-row</a> <a href='500fake-screen.mu.html#L16'>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="L261" class="LineNr">261 </span> <a href='504test-screen.mu.html#L267'>check-background-color-in-screen-row</a> <a href='500fake-screen.mu.html#L16'>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='513grapheme-stack.mu.html#L243'>test-render-grapheme-stack-while-highlighting-matching-close-paren</a>: cursor"</span>
|
||||
<span id="L262" class="LineNr">262 </span> <a href='504test-screen.mu.html#L75'>check-screen-row-in-color</a> <a href='500fake-screen.mu.html#L16'>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='513grapheme-stack.mu.html#L243'>test-render-grapheme-stack-while-highlighting-matching-close-paren</a>: matching paren"</span>
|
||||
<span id="L260" class="LineNr">260 </span> <a href='504test-screen.mu.html#L7'>check-screen-row</a> <a href='500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">"(b) "</span>, <span class="Constant">"F - test-render-code-point-utf8-stack-while-highlighting-matching-close-paren"</span>
|
||||
<span id="L261" class="LineNr">261 </span> <a href='504test-screen.mu.html#L267'>check-background-color-in-screen-row</a> <a href='500fake-screen.mu.html#L16'>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='513grapheme-stack.mu.html#L243'>test-render-code-point-utf8-stack-while-highlighting-matching-close-paren</a>: cursor"</span>
|
||||
<span id="L262" class="LineNr">262 </span> <a href='504test-screen.mu.html#L75'>check-screen-row-in-color</a> <a href='500fake-screen.mu.html#L16'>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='513grapheme-stack.mu.html#L243'>test-render-code-point-utf8-stack-while-highlighting-matching-close-paren</a>: matching paren"</span>
|
||||
<span id="L263" class="LineNr">263 </span><span class="Delimiter">}</span>
|
||||
<span id="L264" class="LineNr">264 </span>
|
||||
<span id="L265" class="LineNr">265 </span><span class="PreProc">fn</span> <span class="muTest"><a href='513grapheme-stack.mu.html#L265'>test-render-grapheme-stack-while-highlighting-matching-close-paren-2</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L265" class="LineNr">265 </span><span class="PreProc">fn</span> <span class="muTest"><a href='513grapheme-stack.mu.html#L265'>test-render-code-point-utf8-stack-while-highlighting-matching-close-paren-2</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L266" class="LineNr">266 </span> <span class="muComment"># setup: gs = "(a (b)) c"</span>
|
||||
<span id="L267" class="LineNr">267 </span> <span class="PreProc">var</span> gs-storage: <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>
|
||||
<span id="L268" class="LineNr">268 </span> <span class="PreProc">var</span> gs/<span class="muRegEdi">edi</span>: (addr <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special"><-</span> address gs-storage
|
||||
<span id="L269" class="LineNr">269 </span> <a href='513grapheme-stack.mu.html#L8'>initialize-grapheme-stack</a> gs, <span class="Constant">0x10</span>
|
||||
<span id="L270" class="LineNr">270 </span> <span class="PreProc">var</span> g/eax: grapheme <span class="Special"><-</span> copy <span class="Constant">0x63</span>/c
|
||||
<span id="L271" class="LineNr">271 </span> <a href='513grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
|
||||
<span id="L267" class="LineNr">267 </span> <span class="PreProc">var</span> gs-storage: <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>
|
||||
<span id="L268" class="LineNr">268 </span> <span class="PreProc">var</span> gs/<span class="muRegEdi">edi</span>: (addr <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>) <span class="Special"><-</span> address gs-storage
|
||||
<span id="L269" class="LineNr">269 </span> <a href='513grapheme-stack.mu.html#L8'>initialize-code-point-utf8-stack</a> gs, <span class="Constant">0x10</span>
|
||||
<span id="L270" class="LineNr">270 </span> <span class="PreProc">var</span> g/eax: code-point-utf8 <span class="Special"><-</span> copy <span class="Constant">0x63</span>/c
|
||||
<span id="L271" class="LineNr">271 </span> <a href='513grapheme-stack.mu.html#L39'>push-code-point-utf8-stack</a> gs, g
|
||||
<span id="L272" class="LineNr">272 </span> g <span class="Special"><-</span> copy <span class="Constant">0x20</span>/space
|
||||
<span id="L273" class="LineNr">273 </span> <a href='513grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
|
||||
<span id="L273" class="LineNr">273 </span> <a href='513grapheme-stack.mu.html#L39'>push-code-point-utf8-stack</a> gs, g
|
||||
<span id="L274" class="LineNr">274 </span> g <span class="Special"><-</span> copy <span class="Constant">0x29</span>/close-paren
|
||||
<span id="L275" class="LineNr">275 </span> <a href='513grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
|
||||
<span id="L275" class="LineNr">275 </span> <a href='513grapheme-stack.mu.html#L39'>push-code-point-utf8-stack</a> gs, g
|
||||
<span id="L276" class="LineNr">276 </span> g <span class="Special"><-</span> copy <span class="Constant">0x29</span>/close-paren
|
||||
<span id="L277" class="LineNr">277 </span> <a href='513grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
|
||||
<span id="L277" class="LineNr">277 </span> <a href='513grapheme-stack.mu.html#L39'>push-code-point-utf8-stack</a> gs, g
|
||||
<span id="L278" class="LineNr">278 </span> g <span class="Special"><-</span> copy <span class="Constant">0x62</span>/b
|
||||
<span id="L279" class="LineNr">279 </span> <a href='513grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
|
||||
<span id="L279" class="LineNr">279 </span> <a href='513grapheme-stack.mu.html#L39'>push-code-point-utf8-stack</a> gs, g
|
||||
<span id="L280" class="LineNr">280 </span> g <span class="Special"><-</span> copy <span class="Constant">0x28</span>/open-paren
|
||||
<span id="L281" class="LineNr">281 </span> <a href='513grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
|
||||
<span id="L281" class="LineNr">281 </span> <a href='513grapheme-stack.mu.html#L39'>push-code-point-utf8-stack</a> gs, g
|
||||
<span id="L282" class="LineNr">282 </span> g <span class="Special"><-</span> copy <span class="Constant">0x20</span>/space
|
||||
<span id="L283" class="LineNr">283 </span> <a href='513grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
|
||||
<span id="L283" class="LineNr">283 </span> <a href='513grapheme-stack.mu.html#L39'>push-code-point-utf8-stack</a> gs, g
|
||||
<span id="L284" class="LineNr">284 </span> g <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L285" class="LineNr">285 </span> <a href='513grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
|
||||
<span id="L285" class="LineNr">285 </span> <a href='513grapheme-stack.mu.html#L39'>push-code-point-utf8-stack</a> gs, g
|
||||
<span id="L286" class="LineNr">286 </span> g <span class="Special"><-</span> copy <span class="Constant">0x28</span>/open-paren
|
||||
<span id="L287" class="LineNr">287 </span> <a href='513grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
|
||||
<span id="L287" class="LineNr">287 </span> <a href='513grapheme-stack.mu.html#L39'>push-code-point-utf8-stack</a> gs, g
|
||||
<span id="L288" class="LineNr">288 </span> <span class="muComment"># setup: screen</span>
|
||||
<span id="L289" class="LineNr">289 </span> <span class="PreProc">var</span> screen-storage: <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L290" class="LineNr">290 </span> <span class="PreProc">var</span> <a href='500fake-screen.mu.html#L16'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>) <span class="Special"><-</span> address screen-storage
|
||||
<span id="L291" class="LineNr">291 </span> <a href='500fake-screen.mu.html#L34'>initialize-screen</a> <a href='500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">5</span>, <span class="Constant">4</span>, <span class="Constant">0</span>/no-pixel-graphics
|
||||
<span id="L292" class="LineNr">292 </span> <span class="muComment">#</span>
|
||||
<span id="L293" class="LineNr">293 </span> <span class="PreProc">var</span> x/eax: int <span class="Special"><-</span> <a href='513grapheme-stack.mu.html#L199'>render-stack-from-top</a> <a href='500fake-screen.mu.html#L16'>screen</a>, gs, <span class="Constant">0</span>/x, <span class="Constant">2</span>/y, <span class="Constant">1</span>/cursor=true
|
||||
<span id="L294" class="LineNr">294 </span> <a href='504test-screen.mu.html#L7'>check-screen-row</a> <a href='500fake-screen.mu.html#L16'>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="L295" class="LineNr">295 </span> <a href='504test-screen.mu.html#L267'>check-background-color-in-screen-row</a> <a href='500fake-screen.mu.html#L16'>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='513grapheme-stack.mu.html#L265'>test-render-grapheme-stack-while-highlighting-matching-close-paren-2</a>: cursor"</span>
|
||||
<span id="L296" class="LineNr">296 </span> <a href='504test-screen.mu.html#L75'>check-screen-row-in-color</a> <a href='500fake-screen.mu.html#L16'>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='513grapheme-stack.mu.html#L265'>test-render-grapheme-stack-while-highlighting-matching-close-paren-2</a>: matching paren"</span>
|
||||
<span id="L294" class="LineNr">294 </span> <a href='504test-screen.mu.html#L7'>check-screen-row</a> <a href='500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">"(a (b)) c "</span>, <span class="Constant">"F - test-render-code-point-utf8-stack-while-highlighting-matching-close-paren-2"</span>
|
||||
<span id="L295" class="LineNr">295 </span> <a href='504test-screen.mu.html#L267'>check-background-color-in-screen-row</a> <a href='500fake-screen.mu.html#L16'>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='513grapheme-stack.mu.html#L265'>test-render-code-point-utf8-stack-while-highlighting-matching-close-paren-2</a>: cursor"</span>
|
||||
<span id="L296" class="LineNr">296 </span> <a href='504test-screen.mu.html#L75'>check-screen-row-in-color</a> <a href='500fake-screen.mu.html#L16'>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='513grapheme-stack.mu.html#L265'>test-render-code-point-utf8-stack-while-highlighting-matching-close-paren-2</a>: matching paren"</span>
|
||||
<span id="L297" class="LineNr">297 </span><span class="Delimiter">}</span>
|
||||
<span id="L298" class="LineNr">298 </span>
|
||||
<span id="L299" class="LineNr">299 </span><span class="PreProc">fn</span> <span class="muTest"><a href='513grapheme-stack.mu.html#L299'>test-render-grapheme-stack-while-highlighting-matching-open-paren-with-close-paren-at-end</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L299" class="LineNr">299 </span><span class="PreProc">fn</span> <span class="muTest"><a href='513grapheme-stack.mu.html#L299'>test-render-code-point-utf8-stack-while-highlighting-matching-open-paren-with-close-paren-at-end</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L300" class="LineNr">300 </span> <span class="muComment"># setup: gs = "(b)"</span>
|
||||
<span id="L301" class="LineNr">301 </span> <span class="PreProc">var</span> gs-storage: <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>
|
||||
<span id="L302" class="LineNr">302 </span> <span class="PreProc">var</span> gs/<span class="muRegEdi">edi</span>: (addr <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special"><-</span> address gs-storage
|
||||
<span id="L303" class="LineNr">303 </span> <a href='513grapheme-stack.mu.html#L8'>initialize-grapheme-stack</a> gs, <span class="Constant">5</span>
|
||||
<span id="L304" class="LineNr">304 </span> <span class="PreProc">var</span> g/eax: grapheme <span class="Special"><-</span> copy <span class="Constant">0x28</span>/open-paren
|
||||
<span id="L305" class="LineNr">305 </span> <a href='513grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
|
||||
<span id="L301" class="LineNr">301 </span> <span class="PreProc">var</span> gs-storage: <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>
|
||||
<span id="L302" class="LineNr">302 </span> <span class="PreProc">var</span> gs/<span class="muRegEdi">edi</span>: (addr <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>) <span class="Special"><-</span> address gs-storage
|
||||
<span id="L303" class="LineNr">303 </span> <a href='513grapheme-stack.mu.html#L8'>initialize-code-point-utf8-stack</a> gs, <span class="Constant">5</span>
|
||||
<span id="L304" class="LineNr">304 </span> <span class="PreProc">var</span> g/eax: code-point-utf8 <span class="Special"><-</span> copy <span class="Constant">0x28</span>/open-paren
|
||||
<span id="L305" class="LineNr">305 </span> <a href='513grapheme-stack.mu.html#L39'>push-code-point-utf8-stack</a> gs, g
|
||||
<span id="L306" class="LineNr">306 </span> g <span class="Special"><-</span> copy <span class="Constant">0x62</span>/b
|
||||
<span id="L307" class="LineNr">307 </span> <a href='513grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
|
||||
<span id="L307" class="LineNr">307 </span> <a href='513grapheme-stack.mu.html#L39'>push-code-point-utf8-stack</a> gs, g
|
||||
<span id="L308" class="LineNr">308 </span> g <span class="Special"><-</span> copy <span class="Constant">0x29</span>/close-paren
|
||||
<span id="L309" class="LineNr">309 </span> <a href='513grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
|
||||
<span id="L309" class="LineNr">309 </span> <a href='513grapheme-stack.mu.html#L39'>push-code-point-utf8-stack</a> gs, g
|
||||
<span id="L310" class="LineNr">310 </span> <span class="muComment"># setup: screen</span>
|
||||
<span id="L311" class="LineNr">311 </span> <span class="PreProc">var</span> screen-storage: <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L312" class="LineNr">312 </span> <span class="PreProc">var</span> <a href='500fake-screen.mu.html#L16'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>) <span class="Special"><-</span> address screen-storage
|
||||
<span id="L313" class="LineNr">313 </span> <a href='500fake-screen.mu.html#L34'>initialize-screen</a> <a href='500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">5</span>, <span class="Constant">4</span>, <span class="Constant">0</span>/no-pixel-graphics
|
||||
<span id="L314" class="LineNr">314 </span> <span class="muComment">#</span>
|
||||
<span id="L315" class="LineNr">315 </span> <span class="PreProc">var</span> x/eax: int <span class="Special"><-</span> <a href='513grapheme-stack.mu.html#L126'>render-stack-from-bottom</a> <a href='500fake-screen.mu.html#L16'>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="L316" class="LineNr">316 </span> <a href='504test-screen.mu.html#L7'>check-screen-row</a> <a href='500fake-screen.mu.html#L16'>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="L317" class="LineNr">317 </span> <a href='504test-screen.mu.html#L75'>check-screen-row-in-color</a> <a href='500fake-screen.mu.html#L16'>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='513grapheme-stack.mu.html#L299'>test-render-grapheme-stack-while-highlighting-matching-open-paren-with-close-paren-at-end</a>: matching paren"</span>
|
||||
<span id="L316" class="LineNr">316 </span> <a href='504test-screen.mu.html#L7'>check-screen-row</a> <a href='500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">"(b) "</span>, <span class="Constant">"F - test-render-code-point-utf8-stack-while-highlighting-matching-open-paren-with-close-paren-at-end"</span>
|
||||
<span id="L317" class="LineNr">317 </span> <a href='504test-screen.mu.html#L75'>check-screen-row-in-color</a> <a href='500fake-screen.mu.html#L16'>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='513grapheme-stack.mu.html#L299'>test-render-code-point-utf8-stack-while-highlighting-matching-open-paren-with-close-paren-at-end</a>: matching paren"</span>
|
||||
<span id="L318" class="LineNr">318 </span><span class="Delimiter">}</span>
|
||||
<span id="L319" class="LineNr">319 </span>
|
||||
<span id="L320" class="LineNr">320 </span><span class="PreProc">fn</span> <span class="muTest"><a href='513grapheme-stack.mu.html#L320'>test-render-grapheme-stack-while-highlighting-matching-open-paren-with-close-paren-at-end-2</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L320" class="LineNr">320 </span><span class="PreProc">fn</span> <span class="muTest"><a href='513grapheme-stack.mu.html#L320'>test-render-code-point-utf8-stack-while-highlighting-matching-open-paren-with-close-paren-at-end-2</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L321" class="LineNr">321 </span> <span class="muComment"># setup: gs = "a((b))"</span>
|
||||
<span id="L322" class="LineNr">322 </span> <span class="PreProc">var</span> gs-storage: <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>
|
||||
<span id="L323" class="LineNr">323 </span> <span class="PreProc">var</span> gs/<span class="muRegEdi">edi</span>: (addr <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special"><-</span> address gs-storage
|
||||
<span id="L324" class="LineNr">324 </span> <a href='513grapheme-stack.mu.html#L8'>initialize-grapheme-stack</a> gs, <span class="Constant">0x10</span>
|
||||
<span id="L325" class="LineNr">325 </span> <span class="PreProc">var</span> g/eax: grapheme <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L326" class="LineNr">326 </span> <a href='513grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
|
||||
<span id="L322" class="LineNr">322 </span> <span class="PreProc">var</span> gs-storage: <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>
|
||||
<span id="L323" class="LineNr">323 </span> <span class="PreProc">var</span> gs/<span class="muRegEdi">edi</span>: (addr <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>) <span class="Special"><-</span> address gs-storage
|
||||
<span id="L324" class="LineNr">324 </span> <a href='513grapheme-stack.mu.html#L8'>initialize-code-point-utf8-stack</a> gs, <span class="Constant">0x10</span>
|
||||
<span id="L325" class="LineNr">325 </span> <span class="PreProc">var</span> g/eax: code-point-utf8 <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L326" class="LineNr">326 </span> <a href='513grapheme-stack.mu.html#L39'>push-code-point-utf8-stack</a> gs, g
|
||||
<span id="L327" class="LineNr">327 </span> g <span class="Special"><-</span> copy <span class="Constant">0x28</span>/open-paren
|
||||
<span id="L328" class="LineNr">328 </span> <a href='513grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
|
||||
<span id="L328" class="LineNr">328 </span> <a href='513grapheme-stack.mu.html#L39'>push-code-point-utf8-stack</a> gs, g
|
||||
<span id="L329" class="LineNr">329 </span> g <span class="Special"><-</span> copy <span class="Constant">0x28</span>/open-paren
|
||||
<span id="L330" class="LineNr">330 </span> <a href='513grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
|
||||
<span id="L330" class="LineNr">330 </span> <a href='513grapheme-stack.mu.html#L39'>push-code-point-utf8-stack</a> gs, g
|
||||
<span id="L331" class="LineNr">331 </span> g <span class="Special"><-</span> copy <span class="Constant">0x62</span>/b
|
||||
<span id="L332" class="LineNr">332 </span> <a href='513grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
|
||||
<span id="L332" class="LineNr">332 </span> <a href='513grapheme-stack.mu.html#L39'>push-code-point-utf8-stack</a> gs, g
|
||||
<span id="L333" class="LineNr">333 </span> g <span class="Special"><-</span> copy <span class="Constant">0x29</span>/close-paren
|
||||
<span id="L334" class="LineNr">334 </span> <a href='513grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
|
||||
<span id="L334" class="LineNr">334 </span> <a href='513grapheme-stack.mu.html#L39'>push-code-point-utf8-stack</a> gs, g
|
||||
<span id="L335" class="LineNr">335 </span> g <span class="Special"><-</span> copy <span class="Constant">0x29</span>/close-paren
|
||||
<span id="L336" class="LineNr">336 </span> <a href='513grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
|
||||
<span id="L336" class="LineNr">336 </span> <a href='513grapheme-stack.mu.html#L39'>push-code-point-utf8-stack</a> gs, g
|
||||
<span id="L337" class="LineNr">337 </span> <span class="muComment"># setup: screen</span>
|
||||
<span id="L338" class="LineNr">338 </span> <span class="PreProc">var</span> screen-storage: <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L339" class="LineNr">339 </span> <span class="PreProc">var</span> <a href='500fake-screen.mu.html#L16'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>) <span class="Special"><-</span> address screen-storage
|
||||
<span id="L340" class="LineNr">340 </span> <a href='500fake-screen.mu.html#L34'>initialize-screen</a> <a href='500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">5</span>, <span class="Constant">4</span>, <span class="Constant">0</span>/no-pixel-graphics
|
||||
<span id="L341" class="LineNr">341 </span> <span class="muComment">#</span>
|
||||
<span id="L342" class="LineNr">342 </span> <span class="PreProc">var</span> x/eax: int <span class="Special"><-</span> <a href='513grapheme-stack.mu.html#L126'>render-stack-from-bottom</a> <a href='500fake-screen.mu.html#L16'>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="L343" class="LineNr">343 </span> <a href='504test-screen.mu.html#L7'>check-screen-row</a> <a href='500fake-screen.mu.html#L16'>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="L344" class="LineNr">344 </span> <a href='504test-screen.mu.html#L75'>check-screen-row-in-color</a> <a href='500fake-screen.mu.html#L16'>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='513grapheme-stack.mu.html#L320'>test-render-grapheme-stack-while-highlighting-matching-open-paren-with-close-paren-at-end-2</a>: matching paren"</span>
|
||||
<span id="L343" class="LineNr">343 </span> <a href='504test-screen.mu.html#L7'>check-screen-row</a> <a href='500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">"a((b)) "</span>, <span class="Constant">"F - test-render-code-point-utf8-stack-while-highlighting-matching-open-paren-with-close-paren-at-end-2"</span>
|
||||
<span id="L344" class="LineNr">344 </span> <a href='504test-screen.mu.html#L75'>check-screen-row-in-color</a> <a href='500fake-screen.mu.html#L16'>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='513grapheme-stack.mu.html#L320'>test-render-code-point-utf8-stack-while-highlighting-matching-open-paren-with-close-paren-at-end-2</a>: matching paren"</span>
|
||||
<span id="L345" class="LineNr">345 </span><span class="Delimiter">}</span>
|
||||
<span id="L346" class="LineNr">346 </span>
|
||||
<span id="L347" class="LineNr">347 </span><span class="PreProc">fn</span> <span class="muTest"><a href='513grapheme-stack.mu.html#L347'>test-render-grapheme-stack-while-highlighting-matching-open-paren</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L347" class="LineNr">347 </span><span class="PreProc">fn</span> <span class="muTest"><a href='513grapheme-stack.mu.html#L347'>test-render-code-point-utf8-stack-while-highlighting-matching-open-paren</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L348" class="LineNr">348 </span> <span class="muComment"># setup: gs = "(b"</span>
|
||||
<span id="L349" class="LineNr">349 </span> <span class="PreProc">var</span> gs-storage: <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>
|
||||
<span id="L350" class="LineNr">350 </span> <span class="PreProc">var</span> gs/<span class="muRegEdi">edi</span>: (addr <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special"><-</span> address gs-storage
|
||||
<span id="L351" class="LineNr">351 </span> <a href='513grapheme-stack.mu.html#L8'>initialize-grapheme-stack</a> gs, <span class="Constant">5</span>
|
||||
<span id="L352" class="LineNr">352 </span> <span class="PreProc">var</span> g/eax: grapheme <span class="Special"><-</span> copy <span class="Constant">0x28</span>/open-paren
|
||||
<span id="L353" class="LineNr">353 </span> <a href='513grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
|
||||
<span id="L349" class="LineNr">349 </span> <span class="PreProc">var</span> gs-storage: <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>
|
||||
<span id="L350" class="LineNr">350 </span> <span class="PreProc">var</span> gs/<span class="muRegEdi">edi</span>: (addr <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>) <span class="Special"><-</span> address gs-storage
|
||||
<span id="L351" class="LineNr">351 </span> <a href='513grapheme-stack.mu.html#L8'>initialize-code-point-utf8-stack</a> gs, <span class="Constant">5</span>
|
||||
<span id="L352" class="LineNr">352 </span> <span class="PreProc">var</span> g/eax: code-point-utf8 <span class="Special"><-</span> copy <span class="Constant">0x28</span>/open-paren
|
||||
<span id="L353" class="LineNr">353 </span> <a href='513grapheme-stack.mu.html#L39'>push-code-point-utf8-stack</a> gs, g
|
||||
<span id="L354" class="LineNr">354 </span> g <span class="Special"><-</span> copy <span class="Constant">0x62</span>/b
|
||||
<span id="L355" class="LineNr">355 </span> <a href='513grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
|
||||
<span id="L355" class="LineNr">355 </span> <a href='513grapheme-stack.mu.html#L39'>push-code-point-utf8-stack</a> gs, g
|
||||
<span id="L356" class="LineNr">356 </span> <span class="muComment"># setup: screen</span>
|
||||
<span id="L357" class="LineNr">357 </span> <span class="PreProc">var</span> screen-storage: <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L358" class="LineNr">358 </span> <span class="PreProc">var</span> <a href='500fake-screen.mu.html#L16'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>) <span class="Special"><-</span> address screen-storage
|
||||
<span id="L359" class="LineNr">359 </span> <a href='500fake-screen.mu.html#L34'>initialize-screen</a> <a href='500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">5</span>, <span class="Constant">4</span>, <span class="Constant">0</span>/no-pixel-graphics
|
||||
<span id="L360" class="LineNr">360 </span> <span class="muComment">#</span>
|
||||
<span id="L361" class="LineNr">361 </span> <span class="PreProc">var</span> x/eax: int <span class="Special"><-</span> <a href='513grapheme-stack.mu.html#L126'>render-stack-from-bottom</a> <a href='500fake-screen.mu.html#L16'>screen</a>, gs, <span class="Constant">0</span>/x, <span class="Constant">2</span>/y, <span class="Constant">1</span>/highlight-matching-open-paren, <span class="Constant">0</span>/open-paren-depth
|
||||
<span id="L362" class="LineNr">362 </span> <a href='504test-screen.mu.html#L7'>check-screen-row</a> <a href='500fake-screen.mu.html#L16'>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="L363" class="LineNr">363 </span> <a href='504test-screen.mu.html#L75'>check-screen-row-in-color</a> <a href='500fake-screen.mu.html#L16'>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='513grapheme-stack.mu.html#L347'>test-render-grapheme-stack-while-highlighting-matching-open-paren</a>: matching paren"</span>
|
||||
<span id="L362" class="LineNr">362 </span> <a href='504test-screen.mu.html#L7'>check-screen-row</a> <a href='500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">"(b "</span>, <span class="Constant">"F - test-render-code-point-utf8-stack-while-highlighting-matching-open-paren"</span>
|
||||
<span id="L363" class="LineNr">363 </span> <a href='504test-screen.mu.html#L75'>check-screen-row-in-color</a> <a href='500fake-screen.mu.html#L16'>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='513grapheme-stack.mu.html#L347'>test-render-code-point-utf8-stack-while-highlighting-matching-open-paren</a>: matching paren"</span>
|
||||
<span id="L364" class="LineNr">364 </span><span class="Delimiter">}</span>
|
||||
<span id="L365" class="LineNr">365 </span>
|
||||
<span id="L366" class="LineNr">366 </span><span class="PreProc">fn</span> <span class="muTest"><a href='513grapheme-stack.mu.html#L366'>test-render-grapheme-stack-while-highlighting-matching-open-paren-2</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L366" class="LineNr">366 </span><span class="PreProc">fn</span> <span class="muTest"><a href='513grapheme-stack.mu.html#L366'>test-render-code-point-utf8-stack-while-highlighting-matching-open-paren-2</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L367" class="LineNr">367 </span> <span class="muComment"># setup: gs = "a((b)"</span>
|
||||
<span id="L368" class="LineNr">368 </span> <span class="PreProc">var</span> gs-storage: <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>
|
||||
<span id="L369" class="LineNr">369 </span> <span class="PreProc">var</span> gs/<span class="muRegEdi">edi</span>: (addr <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special"><-</span> address gs-storage
|
||||
<span id="L370" class="LineNr">370 </span> <a href='513grapheme-stack.mu.html#L8'>initialize-grapheme-stack</a> gs, <span class="Constant">0x10</span>
|
||||
<span id="L371" class="LineNr">371 </span> <span class="PreProc">var</span> g/eax: grapheme <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L372" class="LineNr">372 </span> <a href='513grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
|
||||
<span id="L368" class="LineNr">368 </span> <span class="PreProc">var</span> gs-storage: <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>
|
||||
<span id="L369" class="LineNr">369 </span> <span class="PreProc">var</span> gs/<span class="muRegEdi">edi</span>: (addr <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>) <span class="Special"><-</span> address gs-storage
|
||||
<span id="L370" class="LineNr">370 </span> <a href='513grapheme-stack.mu.html#L8'>initialize-code-point-utf8-stack</a> gs, <span class="Constant">0x10</span>
|
||||
<span id="L371" class="LineNr">371 </span> <span class="PreProc">var</span> g/eax: code-point-utf8 <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L372" class="LineNr">372 </span> <a href='513grapheme-stack.mu.html#L39'>push-code-point-utf8-stack</a> gs, g
|
||||
<span id="L373" class="LineNr">373 </span> g <span class="Special"><-</span> copy <span class="Constant">0x28</span>/open-paren
|
||||
<span id="L374" class="LineNr">374 </span> <a href='513grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
|
||||
<span id="L374" class="LineNr">374 </span> <a href='513grapheme-stack.mu.html#L39'>push-code-point-utf8-stack</a> gs, g
|
||||
<span id="L375" class="LineNr">375 </span> g <span class="Special"><-</span> copy <span class="Constant">0x28</span>/open-paren
|
||||
<span id="L376" class="LineNr">376 </span> <a href='513grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
|
||||
<span id="L376" class="LineNr">376 </span> <a href='513grapheme-stack.mu.html#L39'>push-code-point-utf8-stack</a> gs, g
|
||||
<span id="L377" class="LineNr">377 </span> g <span class="Special"><-</span> copy <span class="Constant">0x62</span>/b
|
||||
<span id="L378" class="LineNr">378 </span> <a href='513grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
|
||||
<span id="L378" class="LineNr">378 </span> <a href='513grapheme-stack.mu.html#L39'>push-code-point-utf8-stack</a> gs, g
|
||||
<span id="L379" class="LineNr">379 </span> g <span class="Special"><-</span> copy <span class="Constant">0x29</span>/close-paren
|
||||
<span id="L380" class="LineNr">380 </span> <a href='513grapheme-stack.mu.html#L39'>push-grapheme-stack</a> gs, g
|
||||
<span id="L380" class="LineNr">380 </span> <a href='513grapheme-stack.mu.html#L39'>push-code-point-utf8-stack</a> gs, g
|
||||
<span id="L381" class="LineNr">381 </span> <span class="muComment"># setup: screen</span>
|
||||
<span id="L382" class="LineNr">382 </span> <span class="PreProc">var</span> screen-storage: <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L383" class="LineNr">383 </span> <span class="PreProc">var</span> <a href='500fake-screen.mu.html#L16'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>) <span class="Special"><-</span> address screen-storage
|
||||
<span id="L384" class="LineNr">384 </span> <a href='500fake-screen.mu.html#L34'>initialize-screen</a> <a href='500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">5</span>, <span class="Constant">4</span>, <span class="Constant">0</span>/no-pixel-graphics
|
||||
<span id="L385" class="LineNr">385 </span> <span class="muComment">#</span>
|
||||
<span id="L386" class="LineNr">386 </span> <span class="PreProc">var</span> x/eax: int <span class="Special"><-</span> <a href='513grapheme-stack.mu.html#L126'>render-stack-from-bottom</a> <a href='500fake-screen.mu.html#L16'>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="L387" class="LineNr">387 </span> <a href='504test-screen.mu.html#L7'>check-screen-row</a> <a href='500fake-screen.mu.html#L16'>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="L388" class="LineNr">388 </span> <a href='504test-screen.mu.html#L75'>check-screen-row-in-color</a> <a href='500fake-screen.mu.html#L16'>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='513grapheme-stack.mu.html#L366'>test-render-grapheme-stack-while-highlighting-matching-open-paren-2</a>: matching paren"</span>
|
||||
<span id="L387" class="LineNr">387 </span> <a href='504test-screen.mu.html#L7'>check-screen-row</a> <a href='500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">2</span>/y, <span class="Constant">"a((b) "</span>, <span class="Constant">"F - test-render-code-point-utf8-stack-while-highlighting-matching-open-paren-2"</span>
|
||||
<span id="L388" class="LineNr">388 </span> <a href='504test-screen.mu.html#L75'>check-screen-row-in-color</a> <a href='500fake-screen.mu.html#L16'>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='513grapheme-stack.mu.html#L366'>test-render-code-point-utf8-stack-while-highlighting-matching-open-paren-2</a>: matching paren"</span>
|
||||
<span id="L389" class="LineNr">389 </span><span class="Delimiter">}</span>
|
||||
<span id="L390" class="LineNr">390 </span>
|
||||
<span id="L391" class="LineNr">391 </span><span class="muComment"># return the index of the matching close-paren of the grapheme at cursor (top of stack)</span>
|
||||
<span id="L391" class="LineNr">391 </span><span class="muComment"># return the index of the matching close-paren of the code-point-utf8 at cursor (top of stack)</span>
|
||||
<span id="L392" class="LineNr">392 </span><span class="muComment"># or top index if there's no matching close-paren</span>
|
||||
<span id="L393" class="LineNr">393 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='513grapheme-stack.mu.html#L393'>get-matching-close-paren-index</a></span> _self: (addr <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>), render-cursor?: boolean<span class="PreProc"> -> </span>_/<span class="muRegEdx">edx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L394" class="LineNr">394 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L393" class="LineNr">393 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='513grapheme-stack.mu.html#L393'>get-matching-close-paren-index</a></span> _self: (addr <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>), render-cursor?: boolean<span class="PreProc"> -> </span>_/<span class="muRegEdx">edx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L394" class="LineNr">394 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L395" class="LineNr">395 </span> <span class="PreProc">var</span> top-addr/<span class="muRegEdx">edx</span>: (addr int) <span class="Special"><-</span> get self, top
|
||||
<span id="L396" class="LineNr">396 </span> <span class="muComment"># if not rendering cursor, return</span>
|
||||
<span id="L397" class="LineNr">397 </span> compare render-cursor?, <span class="Constant">0</span>/false
|
||||
|
@ -463,8 +463,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L399" class="LineNr">399 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L400" class="LineNr">400 </span> <span class="PreProc">return</span> *top-addr
|
||||
<span id="L401" class="LineNr">401 </span> <span class="Delimiter">}</span>
|
||||
<span id="L402" class="LineNr">402 </span> <span class="PreProc">var</span> data-ah/eax: (addr handle array grapheme) <span class="Special"><-</span> get self, data
|
||||
<span id="L403" class="LineNr">403 </span> <span class="PreProc">var</span> data/eax: (addr array grapheme) <span class="Special"><-</span> <a href='120allocate.subx.html#L235'>lookup</a> *data-ah
|
||||
<span id="L402" class="LineNr">402 </span> <span class="PreProc">var</span> data-ah/eax: (addr handle array code-point-utf8) <span class="Special"><-</span> get self, data
|
||||
<span id="L403" class="LineNr">403 </span> <span class="PreProc">var</span> data/eax: (addr array code-point-utf8) <span class="Special"><-</span> <a href='120allocate.subx.html#L235'>lookup</a> *data-ah
|
||||
<span id="L404" class="LineNr">404 </span> <span class="PreProc">var</span> i/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy *top-addr
|
||||
<span id="L405" class="LineNr">405 </span> <span class="muComment"># if stack is empty, return</span>
|
||||
<span id="L406" class="LineNr">406 </span> compare i, <span class="Constant">0</span>
|
||||
|
@ -474,7 +474,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L410" class="LineNr">410 </span> <span class="Delimiter">}</span>
|
||||
<span id="L411" class="LineNr">411 </span> <span class="muComment"># if cursor is not '(' return</span>
|
||||
<span id="L412" class="LineNr">412 </span> i <span class="Special"><-</span> decrement
|
||||
<span id="L413" class="LineNr">413 </span> <span class="PreProc">var</span> g/<span class="muRegEsi">esi</span>: (addr grapheme) <span class="Special"><-</span> index data, i
|
||||
<span id="L413" class="LineNr">413 </span> <span class="PreProc">var</span> g/<span class="muRegEsi">esi</span>: (addr code-point-utf8) <span class="Special"><-</span> index data, i
|
||||
<span id="L414" class="LineNr">414 </span> compare *g, <span class="Constant">0x28</span>/open-paren
|
||||
<span id="L415" class="LineNr">415 </span> <span class="Delimiter">{</span>
|
||||
<span id="L416" class="LineNr">416 </span> <span class="PreProc">break-if-=</span>
|
||||
|
@ -486,7 +486,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L422" class="LineNr">422 </span> <span class="Delimiter">{</span>
|
||||
<span id="L423" class="LineNr">423 </span> compare i, <span class="Constant">0</span>
|
||||
<span id="L424" class="LineNr">424 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L425" class="LineNr">425 </span> <span class="PreProc">var</span> g/<span class="muRegEsi">esi</span>: (addr grapheme) <span class="Special"><-</span> index data, i
|
||||
<span id="L425" class="LineNr">425 </span> <span class="PreProc">var</span> g/<span class="muRegEsi">esi</span>: (addr code-point-utf8) <span class="Special"><-</span> index data, i
|
||||
<span id="L426" class="LineNr">426 </span> compare *g, <span class="Constant">0x28</span>/open-paren
|
||||
<span id="L427" class="LineNr">427 </span> <span class="Delimiter">{</span>
|
||||
<span id="L428" class="LineNr">428 </span> <span class="PreProc">break-if-!=</span>
|
||||
|
@ -510,8 +510,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L446" class="LineNr">446 </span>
|
||||
<span id="L447" class="LineNr">447 </span><span class="muComment"># return the index of the first open-paren at the given depth</span>
|
||||
<span id="L448" class="LineNr">448 </span><span class="muComment"># or top index if there's no matching close-paren</span>
|
||||
<span id="L449" class="LineNr">449 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='513grapheme-stack.mu.html#L449'>get-matching-open-paren-index</a></span> _self: (addr <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>), control: boolean, depth: int<span class="PreProc"> -> </span>_/<span class="muRegEdx">edx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L450" class="LineNr">450 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L449" class="LineNr">449 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='513grapheme-stack.mu.html#L449'>get-matching-open-paren-index</a></span> _self: (addr <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>), control: boolean, depth: int<span class="PreProc"> -> </span>_/<span class="muRegEdx">edx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L450" class="LineNr">450 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L451" class="LineNr">451 </span> <span class="PreProc">var</span> top-addr/<span class="muRegEdx">edx</span>: (addr int) <span class="Special"><-</span> get self, top
|
||||
<span id="L452" class="LineNr">452 </span> <span class="muComment"># if not rendering cursor, return</span>
|
||||
<span id="L453" class="LineNr">453 </span> compare control, <span class="Constant">0</span>/false
|
||||
|
@ -519,8 +519,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L455" class="LineNr">455 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L456" class="LineNr">456 </span> <span class="PreProc">return</span> *top-addr
|
||||
<span id="L457" class="LineNr">457 </span> <span class="Delimiter">}</span>
|
||||
<span id="L458" class="LineNr">458 </span> <span class="PreProc">var</span> data-ah/eax: (addr handle array grapheme) <span class="Special"><-</span> get self, data
|
||||
<span id="L459" class="LineNr">459 </span> <span class="PreProc">var</span> data/eax: (addr array grapheme) <span class="Special"><-</span> <a href='120allocate.subx.html#L235'>lookup</a> *data-ah
|
||||
<span id="L458" class="LineNr">458 </span> <span class="PreProc">var</span> data-ah/eax: (addr handle array code-point-utf8) <span class="Special"><-</span> get self, data
|
||||
<span id="L459" class="LineNr">459 </span> <span class="PreProc">var</span> data/eax: (addr array code-point-utf8) <span class="Special"><-</span> <a href='120allocate.subx.html#L235'>lookup</a> *data-ah
|
||||
<span id="L460" class="LineNr">460 </span> <span class="PreProc">var</span> i/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy *top-addr
|
||||
<span id="L461" class="LineNr">461 </span> <span class="muComment"># if stack is empty, return</span>
|
||||
<span id="L462" class="LineNr">462 </span> compare i, <span class="Constant">0</span>
|
||||
|
@ -534,7 +534,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L470" class="LineNr">470 </span> <span class="Delimiter">{</span>
|
||||
<span id="L471" class="LineNr">471 </span> compare i, <span class="Constant">0</span>
|
||||
<span id="L472" class="LineNr">472 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L473" class="LineNr">473 </span> <span class="PreProc">var</span> g/<span class="muRegEsi">esi</span>: (addr grapheme) <span class="Special"><-</span> index data, i
|
||||
<span id="L473" class="LineNr">473 </span> <span class="PreProc">var</span> g/<span class="muRegEsi">esi</span>: (addr code-point-utf8) <span class="Special"><-</span> index data, i
|
||||
<span id="L474" class="LineNr">474 </span> compare *g, <span class="Constant">0x29</span>/close-paren
|
||||
<span id="L475" class="LineNr">475 </span> <span class="Delimiter">{</span>
|
||||
<span id="L476" class="LineNr">476 </span> <span class="PreProc">break-if-!=</span>
|
||||
|
@ -558,11 +558,11 @@ if ('onhashchange' in window) {
|
|||
<span id="L494" class="LineNr">494 </span>
|
||||
<span id="L495" class="LineNr">495 </span><span class="muComment"># compare from bottom</span>
|
||||
<span id="L496" class="LineNr">496 </span><span class="muComment"># beware: modifies 'stream', which must be disposed of after a false result</span>
|
||||
<span id="L497" class="LineNr">497 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='513grapheme-stack.mu.html#L497'>prefix-match?</a></span> _self: (addr <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>), s: (addr stream byte)<span class="PreProc"> -> </span>_/eax: boolean <span class="Delimiter">{</span>
|
||||
<span id="L498" class="LineNr">498 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L499" class="LineNr">499 </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="L500" class="LineNr">500 </span> <span class="PreProc">var</span> _data/eax: (addr array grapheme) <span class="Special"><-</span> <a href='120allocate.subx.html#L235'>lookup</a> *data-ah
|
||||
<span id="L501" class="LineNr">501 </span> <span class="PreProc">var</span> data/<span class="muRegEdi">edi</span>: (addr array grapheme) <span class="Special"><-</span> copy _data
|
||||
<span id="L497" class="LineNr">497 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='513grapheme-stack.mu.html#L497'>prefix-match?</a></span> _self: (addr <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>), s: (addr stream byte)<span class="PreProc"> -> </span>_/eax: boolean <span class="Delimiter">{</span>
|
||||
<span id="L498" class="LineNr">498 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L499" class="LineNr">499 </span> <span class="PreProc">var</span> data-ah/<span class="muRegEdi">edi</span>: (addr handle array code-point-utf8) <span class="Special"><-</span> get self, data
|
||||
<span id="L500" class="LineNr">500 </span> <span class="PreProc">var</span> _data/eax: (addr array code-point-utf8) <span class="Special"><-</span> <a href='120allocate.subx.html#L235'>lookup</a> *data-ah
|
||||
<span id="L501" class="LineNr">501 </span> <span class="PreProc">var</span> data/<span class="muRegEdi">edi</span>: (addr array code-point-utf8) <span class="Special"><-</span> copy _data
|
||||
<span id="L502" class="LineNr">502 </span> <span class="PreProc">var</span> top-addr/<span class="muRegEcx">ecx</span>: (addr int) <span class="Special"><-</span> get self, top
|
||||
<span id="L503" class="LineNr">503 </span> <span class="PreProc">var</span> i/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L504" class="LineNr">504 </span> <span class="Delimiter">{</span>
|
||||
|
@ -570,8 +570,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L506" class="LineNr">506 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L507" class="LineNr">507 </span> <span class="muComment"># if curr != expected, return false</span>
|
||||
<span id="L508" class="LineNr">508 </span> <span class="Delimiter">{</span>
|
||||
<span id="L509" class="LineNr">509 </span> <span class="PreProc">var</span> curr-a/<span class="muRegEdx">edx</span>: (addr grapheme) <span class="Special"><-</span> index data, i
|
||||
<span id="L510" class="LineNr">510 </span> <span class="PreProc">var</span> expected/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L236'>read-grapheme</a> s
|
||||
<span id="L509" class="LineNr">509 </span> <span class="PreProc">var</span> curr-a/<span class="muRegEdx">edx</span>: (addr code-point-utf8) <span class="Special"><-</span> index data, i
|
||||
<span id="L510" class="LineNr">510 </span> <span class="PreProc">var</span> expected/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L229'>read-code-point-utf8</a> s
|
||||
<span id="L511" class="LineNr">511 </span> <span class="Delimiter">{</span>
|
||||
<span id="L512" class="LineNr">512 </span> compare expected, *curr-a
|
||||
<span id="L513" class="LineNr">513 </span> <span class="PreProc">break-if-=</span>
|
||||
|
@ -586,11 +586,11 @@ if ('onhashchange' in window) {
|
|||
<span id="L522" class="LineNr">522 </span>
|
||||
<span id="L523" class="LineNr">523 </span><span class="muComment"># compare from bottom</span>
|
||||
<span id="L524" class="LineNr">524 </span><span class="muComment"># beware: modifies 'stream', which must be disposed of after a false result</span>
|
||||
<span id="L525" class="LineNr">525 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='513grapheme-stack.mu.html#L525'>suffix-match?</a></span> _self: (addr <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>), s: (addr stream byte)<span class="PreProc"> -> </span>_/eax: boolean <span class="Delimiter">{</span>
|
||||
<span id="L526" class="LineNr">526 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L527" class="LineNr">527 </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="L528" class="LineNr">528 </span> <span class="PreProc">var</span> _data/eax: (addr array grapheme) <span class="Special"><-</span> <a href='120allocate.subx.html#L235'>lookup</a> *data-ah
|
||||
<span id="L529" class="LineNr">529 </span> <span class="PreProc">var</span> data/<span class="muRegEdi">edi</span>: (addr array grapheme) <span class="Special"><-</span> copy _data
|
||||
<span id="L525" class="LineNr">525 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='513grapheme-stack.mu.html#L525'>suffix-match?</a></span> _self: (addr <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>), s: (addr stream byte)<span class="PreProc"> -> </span>_/eax: boolean <span class="Delimiter">{</span>
|
||||
<span id="L526" class="LineNr">526 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L527" class="LineNr">527 </span> <span class="PreProc">var</span> data-ah/<span class="muRegEdi">edi</span>: (addr handle array code-point-utf8) <span class="Special"><-</span> get self, data
|
||||
<span id="L528" class="LineNr">528 </span> <span class="PreProc">var</span> _data/eax: (addr array code-point-utf8) <span class="Special"><-</span> <a href='120allocate.subx.html#L235'>lookup</a> *data-ah
|
||||
<span id="L529" class="LineNr">529 </span> <span class="PreProc">var</span> data/<span class="muRegEdi">edi</span>: (addr array code-point-utf8) <span class="Special"><-</span> copy _data
|
||||
<span id="L530" class="LineNr">530 </span> <span class="PreProc">var</span> top-addr/eax: (addr int) <span class="Special"><-</span> get self, top
|
||||
<span id="L531" class="LineNr">531 </span> <span class="PreProc">var</span> i/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> copy *top-addr
|
||||
<span id="L532" class="LineNr">532 </span> i <span class="Special"><-</span> decrement
|
||||
|
@ -598,8 +598,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L534" class="LineNr">534 </span> compare i, <span class="Constant">0</span>
|
||||
<span id="L535" class="LineNr">535 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L536" class="LineNr">536 </span> <span class="Delimiter">{</span>
|
||||
<span id="L537" class="LineNr">537 </span> <span class="PreProc">var</span> curr-a/<span class="muRegEdx">edx</span>: (addr grapheme) <span class="Special"><-</span> index data, i
|
||||
<span id="L538" class="LineNr">538 </span> <span class="PreProc">var</span> expected/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L236'>read-grapheme</a> s
|
||||
<span id="L537" class="LineNr">537 </span> <span class="PreProc">var</span> curr-a/<span class="muRegEdx">edx</span>: (addr code-point-utf8) <span class="Special"><-</span> index data, i
|
||||
<span id="L538" class="LineNr">538 </span> <span class="PreProc">var</span> expected/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L229'>read-code-point-utf8</a> s
|
||||
<span id="L539" class="LineNr">539 </span> <span class="muComment"># if curr != expected, return false</span>
|
||||
<span id="L540" class="LineNr">540 </span> <span class="Delimiter">{</span>
|
||||
<span id="L541" class="LineNr">541 </span> compare expected, *curr-a
|
||||
|
@ -613,18 +613,18 @@ if ('onhashchange' in window) {
|
|||
<span id="L549" class="LineNr">549 </span> <span class="PreProc">return</span> <span class="Constant">1</span> <span class="muComment"># true</span>
|
||||
<span id="L550" class="LineNr">550 </span><span class="Delimiter">}</span>
|
||||
<span id="L551" class="LineNr">551 </span>
|
||||
<span id="L552" class="LineNr">552 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='513grapheme-stack.mu.html#L552'>grapheme-stack-is-decimal-integer?</a></span> _self: (addr <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>)<span class="PreProc"> -> </span>_/eax: boolean <span class="Delimiter">{</span>
|
||||
<span id="L553" class="LineNr">553 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='513grapheme-stack.mu.html#L3'>grapheme-stack</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L554" class="LineNr">554 </span> <span class="PreProc">var</span> data-ah/eax: (addr handle array grapheme) <span class="Special"><-</span> get self, data
|
||||
<span id="L555" class="LineNr">555 </span> <span class="PreProc">var</span> _data/eax: (addr array grapheme) <span class="Special"><-</span> <a href='120allocate.subx.html#L235'>lookup</a> *data-ah
|
||||
<span id="L556" class="LineNr">556 </span> <span class="PreProc">var</span> data/<span class="muRegEdx">edx</span>: (addr array grapheme) <span class="Special"><-</span> copy _data
|
||||
<span id="L552" class="LineNr">552 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='513grapheme-stack.mu.html#L552'>code-point-utf8-stack-is-decimal-integer?</a></span> _self: (addr <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>)<span class="PreProc"> -> </span>_/eax: boolean <span class="Delimiter">{</span>
|
||||
<span id="L553" class="LineNr">553 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='513grapheme-stack.mu.html#L3'>code-point-utf8-stack</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L554" class="LineNr">554 </span> <span class="PreProc">var</span> data-ah/eax: (addr handle array code-point-utf8) <span class="Special"><-</span> get self, data
|
||||
<span id="L555" class="LineNr">555 </span> <span class="PreProc">var</span> _data/eax: (addr array code-point-utf8) <span class="Special"><-</span> <a href='120allocate.subx.html#L235'>lookup</a> *data-ah
|
||||
<span id="L556" class="LineNr">556 </span> <span class="PreProc">var</span> data/<span class="muRegEdx">edx</span>: (addr array code-point-utf8) <span class="Special"><-</span> copy _data
|
||||
<span id="L557" class="LineNr">557 </span> <span class="PreProc">var</span> top-addr/<span class="muRegEcx">ecx</span>: (addr int) <span class="Special"><-</span> get self, top
|
||||
<span id="L558" class="LineNr">558 </span> <span class="PreProc">var</span> i/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L559" class="LineNr">559 </span> <span class="PreProc">var</span> result/eax: boolean <span class="Special"><-</span> copy <span class="Constant">1</span>/true
|
||||
<span id="L560" class="LineNr">560 </span> $grapheme-stack-is-integer?:<span class="PreProc">loop</span>: <span class="Delimiter">{</span>
|
||||
<span id="L560" class="LineNr">560 </span> $code-point-utf8-stack-is-integer?:<span class="PreProc">loop</span>: <span class="Delimiter">{</span>
|
||||
<span id="L561" class="LineNr">561 </span> compare i, *top-addr
|
||||
<span id="L562" class="LineNr">562 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L563" class="LineNr">563 </span> <span class="PreProc">var</span> g/<span class="muRegEdx">edx</span>: (addr grapheme) <span class="Special"><-</span> index data, i
|
||||
<span id="L563" class="LineNr">563 </span> <span class="PreProc">var</span> g/<span class="muRegEdx">edx</span>: (addr code-point-utf8) <span class="Special"><-</span> index data, i
|
||||
<span id="L564" class="LineNr">564 </span> result <span class="Special"><-</span> <a href='126write-int-decimal.subx.html#L327'>decimal-digit?</a> *g
|
||||
<span id="L565" class="LineNr">565 </span> compare result, <span class="Constant">0</span>/false
|
||||
<span id="L566" class="LineNr">566 </span> <span class="PreProc">break-if-=</span>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,236 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Mu - 515parse-float.mu</title>
|
||||
<meta name="Generator" content="Vim/8.2">
|
||||
<meta name="plugin-version" content="vim8.1_v2">
|
||||
<meta name="syntax" content="none">
|
||||
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
|
||||
<meta name="colorscheme" content="minimal-light">
|
||||
<style>
|
||||
<!--
|
||||
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
|
||||
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
|
||||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.PreProc { color: #c000c0; }
|
||||
.muRegEdx { color: #af5f00; }
|
||||
.Special { color: #ff6060; }
|
||||
.LineNr { }
|
||||
.muRegEsi { color: #005faf; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muRegEcx { color: #870000; }
|
||||
.Constant { color: #008787; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muTest { color: #5f8700; }
|
||||
.muComment { color: #005faf; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
<script>
|
||||
<!--
|
||||
|
||||
/* 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/515parse-float.mu'>https://github.com/akkartik/mu/blob/main/515parse-float.mu</a>
|
||||
<pre id='vimCodeElement'>
|
||||
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># no support for scientific notation yet</span>
|
||||
<span id="L2" class="LineNr"> 2 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='515parse-float.mu.html#L2'>parse-float-decimal</a></span> in: (addr stream byte)<span class="PreProc"> -> </span>_/<span class="Constant">xmm1</span>: float <span class="Delimiter">{</span>
|
||||
<span id="L3" class="LineNr"> 3 </span> <span class="PreProc">var</span> zero: float
|
||||
<span id="L4" class="LineNr"> 4 </span> <span class="PreProc">var</span> result/<span class="Constant">xmm1</span>: float <span class="Special"><-</span> copy zero
|
||||
<span id="L5" class="LineNr"> 5 </span> <span class="PreProc">var</span> first-iter?/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">1</span>/true
|
||||
<span id="L6" class="LineNr"> 6 </span> <a href='106stream.subx.html#L59'>rewind-stream</a> in
|
||||
<span id="L7" class="LineNr"> 7 </span> <span class="PreProc">var</span> negative?/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>/false
|
||||
<span id="L8" class="LineNr"> 8 </span> <span class="muComment"># first loop: integer part</span>
|
||||
<span id="L9" class="LineNr"> 9 </span> <span class="PreProc">var</span> ten/eax: int <span class="Special"><-</span> copy <span class="Constant">0xa</span>
|
||||
<span id="L10" class="LineNr"> 10 </span> <span class="PreProc">var</span> ten-f/<span class="Constant">xmm2</span>: float <span class="Special"><-</span> convert ten
|
||||
<span id="L11" class="LineNr"> 11 </span> <span class="Delimiter">{</span>
|
||||
<span id="L12" class="LineNr"> 12 </span> <span class="PreProc">var</span> done?/eax: boolean <span class="Special"><-</span> <a href='309stream.subx.html#L6'>stream-empty?</a> in
|
||||
<span id="L13" class="LineNr"> 13 </span> compare done?, <span class="Constant">0</span>/false
|
||||
<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> key/eax: byte <span class="Special"><-</span> <a href='112read-byte.subx.html#L13'>read-byte</a> in
|
||||
<span id="L16" class="LineNr"> 16 </span> compare key, <span class="Constant">0x2e</span>/decimal-point
|
||||
<span id="L17" class="LineNr"> 17 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L18" class="LineNr"> 18 </span> $parse-float-decimal:body: <span class="Delimiter">{</span>
|
||||
<span id="L19" class="LineNr"> 19 </span> compare key, <span class="Constant">0x2d</span>/-
|
||||
<span id="L20" class="LineNr"> 20 </span> <span class="Delimiter">{</span>
|
||||
<span id="L21" class="LineNr"> 21 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L22" class="LineNr"> 22 </span> compare first-iter?, <span class="Constant">0</span>/false
|
||||
<span id="L23" class="LineNr"> 23 </span> <span class="Delimiter">{</span>
|
||||
<span id="L24" class="LineNr"> 24 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L25" class="LineNr"> 25 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">"parse-float-decimal: '-' only allowed in first position"</span>
|
||||
<span id="L26" class="LineNr"> 26 </span> <span class="Delimiter">}</span>
|
||||
<span id="L27" class="LineNr"> 27 </span> negative? <span class="Special"><-</span> copy <span class="Constant">1</span>/true
|
||||
<span id="L28" class="LineNr"> 28 </span> <span class="PreProc">break</span> $parse-float-decimal:body
|
||||
<span id="L29" class="LineNr"> 29 </span> <span class="Delimiter">}</span>
|
||||
<span id="L30" class="LineNr"> 30 </span> compare key, <span class="Constant">0x30</span>/<span class="Constant">0</span>
|
||||
<span id="L31" class="LineNr"> 31 </span> <span class="Delimiter">{</span>
|
||||
<span id="L32" class="LineNr"> 32 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L33" class="LineNr"> 33 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">"parse-float-decimal: invalid character < '0'"</span>
|
||||
<span id="L34" class="LineNr"> 34 </span> <span class="Delimiter">}</span>
|
||||
<span id="L35" class="LineNr"> 35 </span> compare key, <span class="Constant">0x39</span>/<span class="Constant">9</span>
|
||||
<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='317abort.subx.html#L5'>abort</a> <span class="Constant">"parse-float-decimal: invalid character > '9'"</span>
|
||||
<span id="L39" class="LineNr"> 39 </span> <span class="Delimiter">}</span>
|
||||
<span id="L40" class="LineNr"> 40 </span> <span class="muComment"># key is now a digit</span>
|
||||
<span id="L41" class="LineNr"> 41 </span> <span class="PreProc">var</span> digit-value/eax: int <span class="Special"><-</span> copy key
|
||||
<span id="L42" class="LineNr"> 42 </span> digit-value <span class="Special"><-</span> subtract <span class="Constant">0x30</span>
|
||||
<span id="L43" class="LineNr"> 43 </span> <span class="PreProc">var</span> digit-value-f/<span class="Constant">xmm3</span>: float <span class="Special"><-</span> convert digit-value
|
||||
<span id="L44" class="LineNr"> 44 </span> result <span class="Special"><-</span> multiply ten-f
|
||||
<span id="L45" class="LineNr"> 45 </span> result <span class="Special"><-</span> add digit-value-f
|
||||
<span id="L46" class="LineNr"> 46 </span> <span class="Delimiter">}</span>
|
||||
<span id="L47" class="LineNr"> 47 </span> first-iter? <span class="Special"><-</span> copy <span class="Constant">0</span>/false
|
||||
<span id="L48" class="LineNr"> 48 </span> <span class="PreProc">loop</span>
|
||||
<span id="L49" class="LineNr"> 49 </span> <span class="Delimiter">}</span>
|
||||
<span id="L50" class="LineNr"> 50 </span> <span class="muComment"># second loop: fraction</span>
|
||||
<span id="L51" class="LineNr"> 51 </span> <span class="PreProc">var</span> current-position/<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">0xa</span>
|
||||
<span id="L52" class="LineNr"> 52 </span> <span class="Delimiter">{</span>
|
||||
<span id="L53" class="LineNr"> 53 </span> <span class="PreProc">var</span> done?/eax: boolean <span class="Special"><-</span> <a href='309stream.subx.html#L6'>stream-empty?</a> in
|
||||
<span id="L54" class="LineNr"> 54 </span> compare done?, <span class="Constant">0</span>/false
|
||||
<span id="L55" class="LineNr"> 55 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L56" class="LineNr"> 56 </span> <span class="PreProc">var</span> key/eax: byte <span class="Special"><-</span> <a href='112read-byte.subx.html#L13'>read-byte</a> in
|
||||
<span id="L57" class="LineNr"> 57 </span> compare key, <span class="Constant">0x30</span>/<span class="Constant">0</span>
|
||||
<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> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">"parse-float-decimal: invalid fraction character < '0'"</span>
|
||||
<span id="L61" class="LineNr"> 61 </span> <span class="Delimiter">}</span>
|
||||
<span id="L62" class="LineNr"> 62 </span> compare key, <span class="Constant">0x39</span>/<span class="Constant">9</span>
|
||||
<span id="L63" class="LineNr"> 63 </span> <span class="Delimiter">{</span>
|
||||
<span id="L64" class="LineNr"> 64 </span> <span class="PreProc">break-if-<=</span>
|
||||
<span id="L65" class="LineNr"> 65 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">"parse-float-decimal: invalid fraction character > '9'"</span>
|
||||
<span id="L66" class="LineNr"> 66 </span> <span class="Delimiter">}</span>
|
||||
<span id="L67" class="LineNr"> 67 </span> <span class="muComment"># key is now a digit</span>
|
||||
<span id="L68" class="LineNr"> 68 </span> <span class="PreProc">var</span> digit-value/eax: int <span class="Special"><-</span> copy key
|
||||
<span id="L69" class="LineNr"> 69 </span> digit-value <span class="Special"><-</span> subtract <span class="Constant">0x30</span>
|
||||
<span id="L70" class="LineNr"> 70 </span> <span class="PreProc">var</span> digit-value-f/<span class="Constant">xmm3</span>: float <span class="Special"><-</span> convert digit-value
|
||||
<span id="L71" class="LineNr"> 71 </span> digit-value-f <span class="Special"><-</span> multiply current-position
|
||||
<span id="L72" class="LineNr"> 72 </span> result <span class="Special"><-</span> add digit-value-f
|
||||
<span id="L73" class="LineNr"> 73 </span> current-position <span class="Special"><-</span> divide ten-f
|
||||
<span id="L74" class="LineNr"> 74 </span> <span class="muComment">#</span>
|
||||
<span id="L75" class="LineNr"> 75 </span> first-iter? <span class="Special"><-</span> copy <span class="Constant">0</span>/false
|
||||
<span id="L76" class="LineNr"> 76 </span> <span class="PreProc">loop</span>
|
||||
<span id="L77" class="LineNr"> 77 </span> <span class="Delimiter">}</span>
|
||||
<span id="L78" class="LineNr"> 78 </span> <span class="muComment"># finally, the sign</span>
|
||||
<span id="L79" class="LineNr"> 79 </span> compare negative?, <span class="Constant">0</span>/false
|
||||
<span id="L80" class="LineNr"> 80 </span> <span class="Delimiter">{</span>
|
||||
<span id="L81" class="LineNr"> 81 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L82" class="LineNr"> 82 </span> <span class="PreProc">var</span> minus-one/eax: int <span class="Special"><-</span> copy <span class="Constant">-1</span>
|
||||
<span id="L83" class="LineNr"> 83 </span> <span class="PreProc">var</span> minus-one-f/<span class="Constant">xmm2</span>: float <span class="Special"><-</span> convert minus-one
|
||||
<span id="L84" class="LineNr"> 84 </span> result <span class="Special"><-</span> multiply minus-one-f
|
||||
<span id="L85" class="LineNr"> 85 </span> <span class="Delimiter">}</span>
|
||||
<span id="L86" class="LineNr"> 86 </span> <span class="PreProc">return</span> result
|
||||
<span id="L87" class="LineNr"> 87 </span><span class="Delimiter">}</span>
|
||||
<span id="L88" class="LineNr"> 88 </span>
|
||||
<span id="L89" class="LineNr"> 89 </span><span class="PreProc">fn</span> <span class="muTest"><a href='515parse-float.mu.html#L89'>test-parse-float-decimal-zero</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L90" class="LineNr"> 90 </span> <span class="PreProc">var</span> s-storage: (stream byte <span class="Constant">0x10</span>)
|
||||
<span id="L91" class="LineNr"> 91 </span> <span class="PreProc">var</span> s/<span class="muRegEsi">esi</span>: (addr stream byte) <span class="Special"><-</span> address s-storage
|
||||
<span id="L92" class="LineNr"> 92 </span> <a href='108write.subx.html#L11'>write</a> s, <span class="Constant">"00"</span>
|
||||
<span id="L93" class="LineNr"> 93 </span> <span class="PreProc">var</span> x/<span class="Constant">xmm1</span>: float <span class="Special"><-</span> <a href='515parse-float.mu.html#L2'>parse-float-decimal</a> s
|
||||
<span id="L94" class="LineNr"> 94 </span> <span class="PreProc">var</span> expected/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L95" class="LineNr"> 95 </span> <span class="PreProc">var</span> expected-f/<span class="Constant">xmm0</span>: float <span class="Special"><-</span> convert expected
|
||||
<span id="L96" class="LineNr"> 96 </span> compare x, expected-f
|
||||
<span id="L97" class="LineNr"> 97 </span> <span class="Delimiter">{</span>
|
||||
<span id="L98" class="LineNr"> 98 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L99" class="LineNr"> 99 </span> <a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">"F - test-parse-float-decimal-zero"</span>, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L100" class="LineNr">100 </span> <a href='501draw-text.mu.html#L65'>move-cursor-to-left-margin-of-next-line</a> <span class="Constant">0</span>/screen
|
||||
<span id="L101" class="LineNr">101 </span> <a href='104test.subx.html#L5'>count-test-failure</a>
|
||||
<span id="L102" class="LineNr">102 </span> <span class="Delimiter">}</span>
|
||||
<span id="L103" class="LineNr">103 </span> <a href='501draw-text.mu.html#L332'>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="L104" class="LineNr">104 </span><span class="Delimiter">}</span>
|
||||
<span id="L105" class="LineNr">105 </span>
|
||||
<span id="L106" class="LineNr">106 </span><span class="PreProc">fn</span> <span class="muTest"><a href='515parse-float.mu.html#L106'>test-parse-float-decimal-integer</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L107" class="LineNr">107 </span> <span class="PreProc">var</span> s-storage: (stream byte <span class="Constant">0x10</span>)
|
||||
<span id="L108" class="LineNr">108 </span> <span class="PreProc">var</span> s/<span class="muRegEsi">esi</span>: (addr stream byte) <span class="Special"><-</span> address s-storage
|
||||
<span id="L109" class="LineNr">109 </span> <a href='108write.subx.html#L11'>write</a> s, <span class="Constant">"34"</span>
|
||||
<span id="L110" class="LineNr">110 </span> <span class="PreProc">var</span> x/<span class="Constant">xmm1</span>: float <span class="Special"><-</span> <a href='515parse-float.mu.html#L2'>parse-float-decimal</a> s
|
||||
<span id="L111" class="LineNr">111 </span> <span class="PreProc">var</span> expected/eax: int <span class="Special"><-</span> copy <span class="Constant">0x22</span>/<span class="Constant">34</span>
|
||||
<span id="L112" class="LineNr">112 </span> <span class="PreProc">var</span> expected-f/<span class="Constant">xmm0</span>: float <span class="Special"><-</span> convert expected
|
||||
<span id="L113" class="LineNr">113 </span> compare x, expected-f
|
||||
<span id="L114" class="LineNr">114 </span> <span class="Delimiter">{</span>
|
||||
<span id="L115" class="LineNr">115 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L116" class="LineNr">116 </span> <a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">"F - test-parse-float-decimal-integer"</span>, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L117" class="LineNr">117 </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="L118" class="LineNr">118 </span> <a href='104test.subx.html#L5'>count-test-failure</a>
|
||||
<span id="L119" class="LineNr">119 </span> <span class="Delimiter">}</span>
|
||||
<span id="L120" class="LineNr">120 </span> <a href='501draw-text.mu.html#L332'>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="L121" class="LineNr">121 </span><span class="Delimiter">}</span>
|
||||
<span id="L122" class="LineNr">122 </span>
|
||||
<span id="L123" class="LineNr">123 </span><span class="PreProc">fn</span> <span class="muTest"><a href='515parse-float.mu.html#L123'>test-parse-float-decimal-negative-integer</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L124" class="LineNr">124 </span> <span class="PreProc">var</span> s-storage: (stream byte <span class="Constant">0x10</span>)
|
||||
<span id="L125" class="LineNr">125 </span> <span class="PreProc">var</span> s/<span class="muRegEsi">esi</span>: (addr stream byte) <span class="Special"><-</span> address s-storage
|
||||
<span id="L126" class="LineNr">126 </span> <a href='108write.subx.html#L11'>write</a> s, <span class="Constant">"-34"</span>
|
||||
<span id="L127" class="LineNr">127 </span> <span class="PreProc">var</span> x/<span class="Constant">xmm1</span>: float <span class="Special"><-</span> <a href='515parse-float.mu.html#L2'>parse-float-decimal</a> s
|
||||
<span id="L128" class="LineNr">128 </span> <span class="PreProc">var</span> expected/eax: int <span class="Special"><-</span> copy <span class="Constant">-0x22</span>/<span class="Constant">-34</span>
|
||||
<span id="L129" class="LineNr">129 </span> <span class="PreProc">var</span> expected-f/<span class="Constant">xmm0</span>: float <span class="Special"><-</span> convert expected
|
||||
<span id="L130" class="LineNr">130 </span> compare x, expected-f
|
||||
<span id="L131" class="LineNr">131 </span> <span class="Delimiter">{</span>
|
||||
<span id="L132" class="LineNr">132 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L133" class="LineNr">133 </span> <a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">"F - test-parse-float-decimal-negative-integer"</span>, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L134" class="LineNr">134 </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="L135" class="LineNr">135 </span> <a href='104test.subx.html#L5'>count-test-failure</a>
|
||||
<span id="L136" class="LineNr">136 </span> <span class="Delimiter">}</span>
|
||||
<span id="L137" class="LineNr">137 </span> <a href='501draw-text.mu.html#L332'>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="L138" class="LineNr">138 </span><span class="Delimiter">}</span>
|
||||
<span id="L139" class="LineNr">139 </span>
|
||||
<span id="L140" class="LineNr">140 </span><span class="PreProc">fn</span> <span class="muTest"><a href='515parse-float.mu.html#L140'>test-parse-float-decimal-fraction</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L141" class="LineNr">141 </span> <span class="PreProc">var</span> s-storage: (stream byte <span class="Constant">0x10</span>)
|
||||
<span id="L142" class="LineNr">142 </span> <span class="PreProc">var</span> s/<span class="muRegEsi">esi</span>: (addr stream byte) <span class="Special"><-</span> address s-storage
|
||||
<span id="L143" class="LineNr">143 </span> <a href='108write.subx.html#L11'>write</a> s, <span class="Constant">"3.4"</span>
|
||||
<span id="L144" class="LineNr">144 </span> <span class="PreProc">var</span> x/<span class="Constant">xmm1</span>: float <span class="Special"><-</span> <a href='515parse-float.mu.html#L2'>parse-float-decimal</a> s
|
||||
<span id="L145" class="LineNr">145 </span> <span class="PreProc">var</span> expected-f/<span class="Constant">xmm0</span>: float <span class="Special"><-</span> <a href='408float.mu.html#L18'>rational</a> <span class="Constant">0x22</span>/<span class="Constant">34</span>, <span class="Constant">0xa</span>/<span class="Constant">10</span>
|
||||
<span id="L146" class="LineNr">146 </span> compare x, expected-f
|
||||
<span id="L147" class="LineNr">147 </span> <span class="Delimiter">{</span>
|
||||
<span id="L148" class="LineNr">148 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L149" class="LineNr">149 </span> <a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">"F - test-parse-float-decimal-fraction"</span>, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L150" class="LineNr">150 </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="L151" class="LineNr">151 </span> <a href='104test.subx.html#L5'>count-test-failure</a>
|
||||
<span id="L152" class="LineNr">152 </span> <span class="Delimiter">}</span>
|
||||
<span id="L153" class="LineNr">153 </span> <a href='501draw-text.mu.html#L332'>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="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="muTest"><a href='515parse-float.mu.html#L156'>test-parse-float-decimal-negative-fraction</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L157" class="LineNr">157 </span> <span class="PreProc">var</span> s-storage: (stream byte <span class="Constant">0x10</span>)
|
||||
<span id="L158" class="LineNr">158 </span> <span class="PreProc">var</span> s/<span class="muRegEsi">esi</span>: (addr stream byte) <span class="Special"><-</span> address s-storage
|
||||
<span id="L159" class="LineNr">159 </span> <a href='108write.subx.html#L11'>write</a> s, <span class="Constant">"-3.4"</span>
|
||||
<span id="L160" class="LineNr">160 </span> <span class="PreProc">var</span> x/<span class="Constant">xmm1</span>: float <span class="Special"><-</span> <a href='515parse-float.mu.html#L2'>parse-float-decimal</a> s
|
||||
<span id="L161" class="LineNr">161 </span> <span class="PreProc">var</span> expected-f/<span class="Constant">xmm0</span>: float <span class="Special"><-</span> <a href='408float.mu.html#L18'>rational</a> <span class="Constant">-0x22</span>/<span class="Constant">-34</span>, <span class="Constant">0xa</span>/<span class="Constant">10</span>
|
||||
<span id="L162" class="LineNr">162 </span> compare x, expected-f
|
||||
<span id="L163" class="LineNr">163 </span> <span class="Delimiter">{</span>
|
||||
<span id="L164" class="LineNr">164 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L165" class="LineNr">165 </span> <a href='501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">"F - test-parse-float-decimal-negative-fraction"</span>, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L166" class="LineNr">166 </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="L167" class="LineNr">167 </span> <a href='104test.subx.html#L5'>count-test-failure</a>
|
||||
<span id="L168" class="LineNr">168 </span> <span class="Delimiter">}</span>
|
||||
<span id="L169" class="LineNr">169 </span> <a href='501draw-text.mu.html#L332'>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="L170" class="LineNr">170 </span><span class="Delimiter">}</span>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
<!-- vim: set foldmethod=manual : -->
|
|
@ -0,0 +1,93 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Mu - 516read-line.mu</title>
|
||||
<meta name="Generator" content="Vim/8.2">
|
||||
<meta name="plugin-version" content="vim8.1_v2">
|
||||
<meta name="syntax" content="none">
|
||||
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
|
||||
<meta name="colorscheme" content="minimal-light">
|
||||
<style>
|
||||
<!--
|
||||
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
|
||||
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
|
||||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.PreProc { color: #c000c0; }
|
||||
.Special { color: #ff6060; }
|
||||
.LineNr { }
|
||||
.Constant { color: #008787; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muComment { color: #005faf; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
<script>
|
||||
<!--
|
||||
|
||||
/* 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/516read-line.mu'>https://github.com/akkartik/mu/blob/main/516read-line.mu</a>
|
||||
<pre id='vimCodeElement'>
|
||||
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># read line from keyboard into stream while also echoing to screen</span>
|
||||
<span id="L2" class="LineNr"> 2 </span><span class="muComment"># abort on stream overflow</span>
|
||||
<span id="L3" class="LineNr"> 3 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='516read-line.mu.html#L3'>read-line-from-keyboard</a></span> keyboard: (addr keyboard), out: (addr stream byte), <a href='500fake-screen.mu.html#L16'>screen</a>: (addr <a href='500fake-screen.mu.html#L16'>screen</a>), fg: int, bg: int <span class="Delimiter">{</span>
|
||||
<span id="L4" class="LineNr"> 4 </span> <a href='106stream.subx.html#L20'>clear-stream</a> out
|
||||
<span id="L5" class="LineNr"> 5 </span> $read-line-from-keyboard:<span class="PreProc">loop</span>: <span class="Delimiter">{</span>
|
||||
<span id="L6" class="LineNr"> 6 </span> <a href='500fake-screen.mu.html#L316'>draw-cursor</a> <a href='500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x20</span>/space
|
||||
<span id="L7" class="LineNr"> 7 </span> <span class="PreProc">var</span> key/eax: byte <span class="Special"><-</span> <a href='102keyboard.subx.html#L21'>read-key</a> keyboard
|
||||
<span id="L8" class="LineNr"> 8 </span> compare key, <span class="Constant">0xa</span>/newline
|
||||
<span id="L9" class="LineNr"> 9 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L10" class="LineNr">10 </span> compare key, <span class="Constant">0</span>
|
||||
<span id="L11" class="LineNr">11 </span> <span class="PreProc">loop-if-=</span>
|
||||
<span id="L12" class="LineNr">12 </span> compare key, <span class="Constant">8</span>/backspace
|
||||
<span id="L13" class="LineNr">13 </span> <span class="Delimiter">{</span>
|
||||
<span id="L14" class="LineNr">14 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L15" class="LineNr">15 </span> <a href='115write-byte.subx.html#L79'>undo-append-byte</a> out
|
||||
<span id="L16" class="LineNr">16 </span> <a href='501draw-text.mu.html#L84'>draw-code-point-at-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x20</span>/space, fg <span class="Constant">0</span>/bg <span class="muComment"># clear cursor</span>
|
||||
<span id="L17" class="LineNr">17 </span> <a href='501draw-text.mu.html#L3'>move-cursor-left</a> <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L18" class="LineNr">18 </span> <a href='501draw-text.mu.html#L3'>move-cursor-left</a> <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L19" class="LineNr">19 </span> <a href='501draw-text.mu.html#L84'>draw-code-point-at-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x20</span>/space, fg <span class="Constant">0</span>/bg <span class="muComment"># clear old cursor</span>
|
||||
<span id="L20" class="LineNr">20 </span> <a href='501draw-text.mu.html#L3'>move-cursor-left</a> <a href='500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L21" class="LineNr">21 </span> <span class="PreProc">loop</span> $read-line-from-keyboard:<span class="PreProc">loop</span>
|
||||
<span id="L22" class="LineNr">22 </span> <span class="Delimiter">}</span>
|
||||
<span id="L23" class="LineNr">23 </span> <span class="PreProc">var</span> key2/eax: int <span class="Special"><-</span> copy key
|
||||
<span id="L24" class="LineNr">24 </span> <a href='115write-byte.subx.html#L12'>append-byte</a> out, key2
|
||||
<span id="L25" class="LineNr">25 </span> <span class="PreProc">var</span> c/eax: code-point <span class="Special"><-</span> copy key2
|
||||
<span id="L26" class="LineNr">26 </span> <a href='501draw-text.mu.html#L84'>draw-code-point-at-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L16'>screen</a>, c, fg bg
|
||||
<span id="L27" class="LineNr">27 </span> <span class="PreProc">loop</span>
|
||||
<span id="L28" class="LineNr">28 </span> <span class="Delimiter">}</span>
|
||||
<span id="L29" class="LineNr">29 </span> <span class="muComment"># clear cursor</span>
|
||||
<span id="L30" class="LineNr">30 </span> <a href='501draw-text.mu.html#L84'>draw-code-point-at-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x20</span>/space, fg bg
|
||||
<span id="L31" class="LineNr">31 </span><span class="Delimiter">}</span>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
<!-- vim: set foldmethod=manual : -->
|
|
@ -78,7 +78,7 @@ if ('onhashchange' in window) {
|
|||
<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/eax: int <span class="Special"><-</span> <a href='../501draw-text.mu.html#L113'>draw-text-rightward</a> <a href='../500fake-screen.mu.html#L16'>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/eax: int <span class="Special"><-</span> <a href='../501draw-text.mu.html#L106'>draw-text-rightward</a> <a href='../500fake-screen.mu.html#L16'>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>
|
||||
|
@ -91,7 +91,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L28" class="LineNr"> 28 </span> <span class="PreProc">var</span> key2/eax: 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> c/eax: code-point <span class="Special"><-</span> copy key2 <span class="muComment"># TODO: unicode input</span>
|
||||
<span id="L31" class="LineNr"> 31 </span> <a href='../501draw-text.mu.html#L91'>draw-code-point-at-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, c, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L31" class="LineNr"> 31 </span> <a href='../501draw-text.mu.html#L84'>draw-code-point-at-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, c, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L32" class="LineNr"> 32 </span> <span class="PreProc">loop</span>
|
||||
<span id="L33" class="LineNr"> 33 </span> <span class="Delimiter">}</span>
|
||||
<span id="L34" class="LineNr"> 34 </span> <a href='../500fake-screen.mu.html#L330'>clear-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>
|
||||
|
@ -113,10 +113,10 @@ if ('onhashchange' in window) {
|
|||
<span id="L50" class="LineNr"> 50 </span> <span class="muComment"># another metric</span>
|
||||
<span id="L51" class="LineNr"> 51 </span> <span class="PreProc">var</span> color/eax: int <span class="Special"><-</span> <a href='../505colors.mu.html#L260'>nearest-color-euclidean-hsl</a> a, b, c
|
||||
<span id="L52" class="LineNr"> 52 </span> <a href='../500fake-screen.mu.html#L269'>set-cursor-position</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x10</span>/x, <span class="Constant">0x26</span>/y
|
||||
<span id="L53" class="LineNr"> 53 </span> <a href='../501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"nearest (euclidean, h/s/l): "</span>, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L54" class="LineNr"> 54 </span> <a href='../501draw-text.mu.html#L449'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, color, <span class="Constant">7</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L55" class="LineNr"> 55 </span> <a href='../501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" "</span>, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L56" class="LineNr"> 56 </span> <a href='../501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" "</span>, <span class="Constant">0</span>/fg, color
|
||||
<span id="L53" class="LineNr"> 53 </span> <a href='../501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"nearest (euclidean, h/s/l): "</span>, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L54" class="LineNr"> 54 </span> <a href='../501draw-text.mu.html#L442'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, color, <span class="Constant">7</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L55" class="LineNr"> 55 </span> <a href='../501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" "</span>, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L56" class="LineNr"> 56 </span> <a href='../501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" "</span>, <span class="Constant">0</span>/fg, color
|
||||
<span id="L57" class="LineNr"> 57 </span> <span class="muComment">#</span>
|
||||
<span id="L58" class="LineNr"> 58 </span> <span class="PreProc">loop</span>
|
||||
<span id="L59" class="LineNr"> 59 </span> <span class="Delimiter">}</span>
|
||||
|
@ -286,10 +286,10 @@ if ('onhashchange' in window) {
|
|||
<span id="L223" class="LineNr">223 </span> compare c, l
|
||||
<span id="L224" class="LineNr">224 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L225" class="LineNr">225 </span> <a href='../500fake-screen.mu.html#L269'>set-cursor-position</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x10</span>/x, y
|
||||
<span id="L226" class="LineNr">226 </span> <a href='../501draw-text.mu.html#L449'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, color, <span class="Constant">7</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L226" class="LineNr">226 </span> <a href='../501draw-text.mu.html#L442'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, color, <span class="Constant">7</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L227" class="LineNr">227 </span> <a href='../500fake-screen.mu.html#L269'>set-cursor-position</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x14</span>/x, y
|
||||
<span id="L228" class="LineNr">228 </span> <a href='../501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" "</span>, <span class="Constant">7</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L229" class="LineNr">229 </span> <a href='../501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" "</span>, <span class="Constant">0</span>/fg, color
|
||||
<span id="L228" class="LineNr">228 </span> <a href='../501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" "</span>, <span class="Constant">7</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L229" class="LineNr">229 </span> <a href='../501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" "</span>, <span class="Constant">0</span>/fg, color
|
||||
<span id="L230" class="LineNr">230 </span><span class="CommentedCode">#? draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, " ", 7/fg, 0/bg</span>
|
||||
<span id="L231" class="LineNr">231 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen, a, 7/fg, 0/bg</span>
|
||||
<span id="L232" class="LineNr">232 </span><span class="CommentedCode">#? draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, " ", 7/fg, 0/bg</span>
|
||||
|
|
|
@ -64,8 +64,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L8" class="LineNr"> 8 </span><span class="muComment"># Expected output: blank screen with no errors</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='ex1.mu.html#L10'>main</a></span> <a href='../500fake-screen.mu.html#L16'>screen</a>: (addr <a href='../500fake-screen.mu.html#L16'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
|
||||
<span id="L11" class="LineNr">11 </span> <span class="PreProc">loop</span>
|
||||
<span id="L12" class="LineNr">12 </span><span class="Delimiter">}</span>
|
||||
<span id="L11" class="LineNr">11 </span><span class="Delimiter">}</span>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -84,15 +84,15 @@ if ('onhashchange' in window) {
|
|||
<span id="L25" class="LineNr">25 </span> <span class="Delimiter">{</span>
|
||||
<span id="L26" class="LineNr">26 </span> <span class="PreProc">var</span> dummy1/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L27" class="LineNr">27 </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="L28" class="LineNr">28 </span> dummy1, dummy2 <span class="Special"><-</span> <a href='../501draw-text.mu.html#L316'>draw-text-wrapping-right-then-down-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>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="L28" class="LineNr">28 </span> dummy1, dummy2 <span class="Special"><-</span> <a href='../501draw-text.mu.html#L309'>draw-text-wrapping-right-then-down-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>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="L29" class="LineNr">29 </span> <span class="Delimiter">}</span>
|
||||
<span id="L30" class="LineNr">30 </span> <span class="Delimiter">{</span>
|
||||
<span id="L31" class="LineNr">31 </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="L32" class="LineNr">32 </span> dx, dummy <span class="Special"><-</span> <a href='../501draw-text.mu.html#L426'>draw-int32-decimal-wrapping-right-then-down-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>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="L32" class="LineNr">32 </span> dx, dummy <span class="Special"><-</span> <a href='../501draw-text.mu.html#L419'>draw-int32-decimal-wrapping-right-then-down-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>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="L33" class="LineNr">33 </span> <span class="Delimiter">}</span>
|
||||
<span id="L34" class="LineNr">34 </span> <span class="Delimiter">{</span>
|
||||
<span id="L35" class="LineNr">35 </span> <span class="PreProc">var</span> dummy/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L36" class="LineNr">36 </span> dummy, dy <span class="Special"><-</span> <a href='../501draw-text.mu.html#L426'>draw-int32-decimal-wrapping-right-then-down-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>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="L36" class="LineNr">36 </span> dummy, dy <span class="Special"><-</span> <a href='../501draw-text.mu.html#L419'>draw-int32-decimal-wrapping-right-then-down-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>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="L37" class="LineNr">37 </span> <span class="Delimiter">}</span>
|
||||
<span id="L38" class="LineNr">38 </span> <span class="PreProc">loop</span>
|
||||
<span id="L39" class="LineNr">39 </span> <span class="Delimiter">}</span>
|
||||
|
|
|
@ -71,7 +71,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L11" class="LineNr">11 </span> <span class="PreProc">var</span> fg/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L12" class="LineNr">12 </span> <span class="PreProc">var</span> prev-timer-counter/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L13" class="LineNr">13 </span> <span class="Delimiter">{</span>
|
||||
<span id="L14" class="LineNr">14 </span> <span class="PreProc">var</span> dummy/eax: int <span class="Special"><-</span> <a href='../501draw-text.mu.html#L113'>draw-text-rightward</a> <a href='../500fake-screen.mu.html#L16'>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, fg, <span class="Constant">0</span>/bg
|
||||
<span id="L14" class="LineNr">14 </span> <span class="PreProc">var</span> dummy/eax: int <span class="Special"><-</span> <a href='../501draw-text.mu.html#L106'>draw-text-rightward</a> <a href='../500fake-screen.mu.html#L16'>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, fg, <span class="Constant">0</span>/bg
|
||||
<span id="L15" class="LineNr">15 </span> <span class="muComment"># wait for timer to bump</span>
|
||||
<span id="L16" class="LineNr">16 </span> <span class="Delimiter">{</span>
|
||||
<span id="L17" class="LineNr">17 </span> <span class="PreProc">var</span> curr-timer-counter/eax: int <span class="Special"><-</span> <a href='../319timer.subx.html#L3'>timer-counter</a>
|
||||
|
|
|
@ -77,7 +77,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L18" class="LineNr">18 </span> <span class="PreProc">var</span> text-storage: (stream byte <span class="Constant">0x200</span>)
|
||||
<span id="L19" class="LineNr">19 </span> <span class="PreProc">var</span> text/<span class="muRegEsi">esi</span>: (addr stream byte) <span class="Special"><-</span> address text-storage
|
||||
<span id="L20" class="LineNr">20 </span> <a href='../510disk.mu.html#L1'>load-sectors</a> data-disk, <span class="Constant">0</span>/lba, <span class="Constant">1</span>/num-sectors, text
|
||||
<span id="L21" class="LineNr">21 </span> <span class="PreProc">var</span> dummy/eax: int <span class="Special"><-</span> <a href='../501draw-text.mu.html#L124'>draw-stream-rightward</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, text, <span class="Constant">0</span>/x <span class="Constant">0x80</span>/xmax <span class="Constant">0</span>/y, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L21" class="LineNr">21 </span> <span class="PreProc">var</span> dummy/eax: int <span class="Special"><-</span> <a href='../501draw-text.mu.html#L117'>draw-stream-rightward</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, text, <span class="Constant">0</span>/x <span class="Constant">0x80</span>/xmax <span class="Constant">0</span>/y, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L22" class="LineNr">22 </span><span class="Delimiter">}</span>
|
||||
</pre>
|
||||
</body>
|
||||
|
|
|
@ -92,13 +92,13 @@ if ('onhashchange' in window) {
|
|||
<span id="L32" class="LineNr"> 32 </span> <span class="PreProc">var</span> dummy/eax: int <span class="Special"><-</span> <a href='../103glyph.subx.html#L19'>draw-code-point-on-real-screen</a> <span class="Constant">0x61</span>/a, <span class="Constant">0</span>/x <span class="Constant">0</span>/y, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L33" class="LineNr"> 33 </span> <span class="PreProc">var</span> dummy/eax: int <span class="Special"><-</span> <a href='../103glyph.subx.html#L31'>overlay-code-point-on-real-screen</a> <span class="Constant">0x0300</span>/combining-grave-accent, <span class="Constant">0</span>/x <span class="Constant">0</span>/y, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L34" class="LineNr"> 34 </span>
|
||||
<span id="L35" class="LineNr"> 35 </span> <span class="muComment"># below a grapheme with a descender, the accent uglily overlaps</span>
|
||||
<span id="L35" class="LineNr"> 35 </span> <span class="muComment"># below a code-point-utf8 with a descender, the accent uglily overlaps</span>
|
||||
<span id="L36" class="LineNr"> 36 </span> <span class="muComment"># <a href="https://en.wikipedia.org/wiki/Descender">https://en.wikipedia.org/wiki/Descender</a></span>
|
||||
<span id="L37" class="LineNr"> 37 </span> <span class="PreProc">var</span> dummy/eax: int <span class="Special"><-</span> <a href='../103glyph.subx.html#L19'>draw-code-point-on-real-screen</a> <span class="Constant">0x67</span>/g, <span class="Constant">4</span>/x <span class="Constant">3</span>/y, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L38" class="LineNr"> 38 </span> <span class="PreProc">var</span> dummy/eax: int <span class="Special"><-</span> <a href='../103glyph.subx.html#L19'>draw-code-point-on-real-screen</a> <span class="Constant">0x61</span>/a, <span class="Constant">4</span>/x <span class="Constant">4</span>/y, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L39" class="LineNr"> 39 </span> <span class="PreProc">var</span> dummy/eax: int <span class="Special"><-</span> <a href='../103glyph.subx.html#L31'>overlay-code-point-on-real-screen</a> <span class="Constant">0x0300</span>/combining-grave-accent, <span class="Constant">4</span>/x <span class="Constant">4</span>/y, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L40" class="LineNr"> 40 </span>
|
||||
<span id="L41" class="LineNr"> 41 </span> <span class="muComment"># beside a grapheme with a descender, it becomes more obvious that monowidth fonts can't make baselines line up</span>
|
||||
<span id="L41" class="LineNr"> 41 </span> <span class="muComment"># beside a code-point-utf8 with a descender, it becomes more obvious that monowidth fonts can't make baselines line up</span>
|
||||
<span id="L42" class="LineNr"> 42 </span> <span class="muComment"># <a href="https://en.wikipedia.org/wiki/Baseline_(typography)">https://en.wikipedia.org/wiki/Baseline_(typography)</a></span>
|
||||
<span id="L43" class="LineNr"> 43 </span> <span class="PreProc">var</span> dummy/eax: int <span class="Special"><-</span> <a href='../103glyph.subx.html#L19'>draw-code-point-on-real-screen</a> <span class="Constant">0x67</span>/g, <span class="Constant">8</span>/x <span class="Constant">3</span>/y, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L44" class="LineNr"> 44 </span> <span class="PreProc">var</span> dummy/eax: int <span class="Special"><-</span> <a href='../103glyph.subx.html#L19'>draw-code-point-on-real-screen</a> <span class="Constant">0x61</span>/a, <span class="Constant">9</span>/x <span class="Constant">3</span>/y, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
|
@ -142,70 +142,70 @@ if ('onhashchange' in window) {
|
|||
<span id="L82" class="LineNr"> 82 </span> <span class="PreProc">var</span> dummy/eax: int <span class="Special"><-</span> <a href='../103glyph.subx.html#L19'>draw-code-point-on-real-screen</a> <span class="Constant">0x0915</span>/devanagari-letter-ka, <span class="Constant">0x13</span>/x <span class="Constant">9</span>/y, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L83" class="LineNr"> 83 </span> <span class="PreProc">var</span> dummy/eax: int <span class="Special"><-</span> <a href='../103glyph.subx.html#L31'>overlay-code-point-on-real-screen</a> <span class="Constant">0x0903</span>/devanagari-visarga, <span class="Constant">0x13</span>/x <span class="Constant">9</span>/y, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L84" class="LineNr"> 84 </span>
|
||||
<span id="L85" class="LineNr"> 85 </span> <span class="muComment"># render the same devanagari letters as a single stream of utf-8 graphemes rather than individual code-points.</span>
|
||||
<span id="L85" class="LineNr"> 85 </span> <span class="muComment"># render the same devanagari letters as a single stream of utf-8 code-point-utf8s rather than individual code-points.</span>
|
||||
<span id="L86" class="LineNr"> 86 </span> <span class="PreProc">var</span> text-storage: (stream byte <span class="Constant">0x200</span>)
|
||||
<span id="L87" class="LineNr"> 87 </span> <span class="PreProc">var</span> text/<span class="muRegEsi">esi</span>: (addr stream byte) <span class="Special"><-</span> address text-storage
|
||||
<span id="L88" class="LineNr"> 88 </span> <span class="PreProc">var</span> g/eax: grapheme <span class="Special"><-</span> <a href='../403unicode.mu.html#L104'>to-grapheme</a> <span class="Constant">0x0915</span>/devanagari-letter-ka
|
||||
<span id="L89" class="LineNr"> 89 </span> <span class="PreProc">var</span> ka/<span class="muRegEcx">ecx</span>: grapheme <span class="Special"><-</span> copy g
|
||||
<span id="L88" class="LineNr"> 88 </span> <span class="PreProc">var</span> g/eax: code-point-utf8 <span class="Special"><-</span> <a href='../403unicode.mu.html#L97'>to-utf8</a> <span class="Constant">0x0915</span>/devanagari-letter-ka
|
||||
<span id="L89" class="LineNr"> 89 </span> <span class="PreProc">var</span> ka/<span class="muRegEcx">ecx</span>: code-point-utf8 <span class="Special"><-</span> copy g
|
||||
<span id="L90" class="LineNr"> 90 </span> <span class="muComment"># ka</span>
|
||||
<span id="L91" class="LineNr"> 91 </span> <a href='../403unicode.mu.html#L339'>write-grapheme</a> text, ka
|
||||
<span id="L91" class="LineNr"> 91 </span> <a href='../403unicode.mu.html#L389'>write-code-point-utf8</a> text, ka
|
||||
<span id="L92" class="LineNr"> 92 </span> <span class="muComment"># kaa</span>
|
||||
<span id="L93" class="LineNr"> 93 </span> <a href='../403unicode.mu.html#L339'>write-grapheme</a> text, ka
|
||||
<span id="L94" class="LineNr"> 94 </span> g <span class="Special"><-</span> <a href='../403unicode.mu.html#L104'>to-grapheme</a> <span class="Constant">0x093e</span>/devanagari-vowel-aa
|
||||
<span id="L95" class="LineNr"> 95 </span> <a href='../403unicode.mu.html#L339'>write-grapheme</a> text, g
|
||||
<span id="L93" class="LineNr"> 93 </span> <a href='../403unicode.mu.html#L389'>write-code-point-utf8</a> text, ka
|
||||
<span id="L94" class="LineNr"> 94 </span> g <span class="Special"><-</span> <a href='../403unicode.mu.html#L97'>to-utf8</a> <span class="Constant">0x093e</span>/devanagari-vowel-aa
|
||||
<span id="L95" class="LineNr"> 95 </span> <a href='../403unicode.mu.html#L389'>write-code-point-utf8</a> text, g
|
||||
<span id="L96" class="LineNr"> 96 </span> <span class="muComment"># ki</span>
|
||||
<span id="L97" class="LineNr"> 97 </span> <a href='../403unicode.mu.html#L339'>write-grapheme</a> text, ka
|
||||
<span id="L98" class="LineNr"> 98 </span> g <span class="Special"><-</span> <a href='../403unicode.mu.html#L104'>to-grapheme</a> <span class="Constant">0x093f</span>/devanagari-vowel-i
|
||||
<span id="L99" class="LineNr"> 99 </span> <a href='../403unicode.mu.html#L339'>write-grapheme</a> text, g
|
||||
<span id="L97" class="LineNr"> 97 </span> <a href='../403unicode.mu.html#L389'>write-code-point-utf8</a> text, ka
|
||||
<span id="L98" class="LineNr"> 98 </span> g <span class="Special"><-</span> <a href='../403unicode.mu.html#L97'>to-utf8</a> <span class="Constant">0x093f</span>/devanagari-vowel-i
|
||||
<span id="L99" class="LineNr"> 99 </span> <a href='../403unicode.mu.html#L389'>write-code-point-utf8</a> text, g
|
||||
<span id="L100" class="LineNr">100 </span> <span class="muComment"># kee</span>
|
||||
<span id="L101" class="LineNr">101 </span> <a href='../403unicode.mu.html#L339'>write-grapheme</a> text, ka
|
||||
<span id="L102" class="LineNr">102 </span> g <span class="Special"><-</span> <a href='../403unicode.mu.html#L104'>to-grapheme</a> <span class="Constant">0x0940</span>/devanagari-vowel-ii
|
||||
<span id="L103" class="LineNr">103 </span> <a href='../403unicode.mu.html#L339'>write-grapheme</a> text, g
|
||||
<span id="L101" class="LineNr">101 </span> <a href='../403unicode.mu.html#L389'>write-code-point-utf8</a> text, ka
|
||||
<span id="L102" class="LineNr">102 </span> g <span class="Special"><-</span> <a href='../403unicode.mu.html#L97'>to-utf8</a> <span class="Constant">0x0940</span>/devanagari-vowel-ii
|
||||
<span id="L103" class="LineNr">103 </span> <a href='../403unicode.mu.html#L389'>write-code-point-utf8</a> text, g
|
||||
<span id="L104" class="LineNr">104 </span> <span class="muComment"># ku</span>
|
||||
<span id="L105" class="LineNr">105 </span> <a href='../403unicode.mu.html#L339'>write-grapheme</a> text, ka
|
||||
<span id="L106" class="LineNr">106 </span> g <span class="Special"><-</span> <a href='../403unicode.mu.html#L104'>to-grapheme</a> <span class="Constant">0x0941</span>/devanagari-vowel-u
|
||||
<span id="L107" class="LineNr">107 </span> <a href='../403unicode.mu.html#L339'>write-grapheme</a> text, g
|
||||
<span id="L105" class="LineNr">105 </span> <a href='../403unicode.mu.html#L389'>write-code-point-utf8</a> text, ka
|
||||
<span id="L106" class="LineNr">106 </span> g <span class="Special"><-</span> <a href='../403unicode.mu.html#L97'>to-utf8</a> <span class="Constant">0x0941</span>/devanagari-vowel-u
|
||||
<span id="L107" class="LineNr">107 </span> <a href='../403unicode.mu.html#L389'>write-code-point-utf8</a> text, g
|
||||
<span id="L108" class="LineNr">108 </span> <span class="muComment"># koo</span>
|
||||
<span id="L109" class="LineNr">109 </span> <a href='../403unicode.mu.html#L339'>write-grapheme</a> text, ka
|
||||
<span id="L110" class="LineNr">110 </span> g <span class="Special"><-</span> <a href='../403unicode.mu.html#L104'>to-grapheme</a> <span class="Constant">0x0942</span>/devanagari-vowel-oo
|
||||
<span id="L111" class="LineNr">111 </span> <a href='../403unicode.mu.html#L339'>write-grapheme</a> text, g
|
||||
<span id="L109" class="LineNr">109 </span> <a href='../403unicode.mu.html#L389'>write-code-point-utf8</a> text, ka
|
||||
<span id="L110" class="LineNr">110 </span> g <span class="Special"><-</span> <a href='../403unicode.mu.html#L97'>to-utf8</a> <span class="Constant">0x0942</span>/devanagari-vowel-oo
|
||||
<span id="L111" class="LineNr">111 </span> <a href='../403unicode.mu.html#L389'>write-code-point-utf8</a> text, g
|
||||
<span id="L112" class="LineNr">112 </span> <span class="muComment"># kay</span>
|
||||
<span id="L113" class="LineNr">113 </span> <a href='../403unicode.mu.html#L339'>write-grapheme</a> text, ka
|
||||
<span id="L114" class="LineNr">114 </span> g <span class="Special"><-</span> <a href='../403unicode.mu.html#L104'>to-grapheme</a> <span class="Constant">0x0947</span>/devanagari-vowel-E
|
||||
<span id="L115" class="LineNr">115 </span> <a href='../403unicode.mu.html#L339'>write-grapheme</a> text, g
|
||||
<span id="L113" class="LineNr">113 </span> <a href='../403unicode.mu.html#L389'>write-code-point-utf8</a> text, ka
|
||||
<span id="L114" class="LineNr">114 </span> g <span class="Special"><-</span> <a href='../403unicode.mu.html#L97'>to-utf8</a> <span class="Constant">0x0947</span>/devanagari-vowel-E
|
||||
<span id="L115" class="LineNr">115 </span> <a href='../403unicode.mu.html#L389'>write-code-point-utf8</a> text, g
|
||||
<span id="L116" class="LineNr">116 </span> <span class="muComment"># kai</span>
|
||||
<span id="L117" class="LineNr">117 </span> <a href='../403unicode.mu.html#L339'>write-grapheme</a> text, ka
|
||||
<span id="L118" class="LineNr">118 </span> g <span class="Special"><-</span> <a href='../403unicode.mu.html#L104'>to-grapheme</a> <span class="Constant">0x0948</span>/devanagari-vowel-ai
|
||||
<span id="L119" class="LineNr">119 </span> <a href='../403unicode.mu.html#L339'>write-grapheme</a> text, g
|
||||
<span id="L117" class="LineNr">117 </span> <a href='../403unicode.mu.html#L389'>write-code-point-utf8</a> text, ka
|
||||
<span id="L118" class="LineNr">118 </span> g <span class="Special"><-</span> <a href='../403unicode.mu.html#L97'>to-utf8</a> <span class="Constant">0x0948</span>/devanagari-vowel-ai
|
||||
<span id="L119" class="LineNr">119 </span> <a href='../403unicode.mu.html#L389'>write-code-point-utf8</a> text, g
|
||||
<span id="L120" class="LineNr">120 </span> <span class="muComment"># ko</span>
|
||||
<span id="L121" class="LineNr">121 </span> <a href='../403unicode.mu.html#L339'>write-grapheme</a> text, ka
|
||||
<span id="L122" class="LineNr">122 </span> g <span class="Special"><-</span> <a href='../403unicode.mu.html#L104'>to-grapheme</a> <span class="Constant">0x094b</span>/devanagari-vowel-o
|
||||
<span id="L123" class="LineNr">123 </span> <a href='../403unicode.mu.html#L339'>write-grapheme</a> text, g
|
||||
<span id="L121" class="LineNr">121 </span> <a href='../403unicode.mu.html#L389'>write-code-point-utf8</a> text, ka
|
||||
<span id="L122" class="LineNr">122 </span> g <span class="Special"><-</span> <a href='../403unicode.mu.html#L97'>to-utf8</a> <span class="Constant">0x094b</span>/devanagari-vowel-o
|
||||
<span id="L123" class="LineNr">123 </span> <a href='../403unicode.mu.html#L389'>write-code-point-utf8</a> text, g
|
||||
<span id="L124" class="LineNr">124 </span> <span class="muComment"># kow</span>
|
||||
<span id="L125" class="LineNr">125 </span> <a href='../403unicode.mu.html#L339'>write-grapheme</a> text, ka
|
||||
<span id="L126" class="LineNr">126 </span> g <span class="Special"><-</span> <a href='../403unicode.mu.html#L104'>to-grapheme</a> <span class="Constant">0x094f</span>/devanagari-vowel-aw
|
||||
<span id="L127" class="LineNr">127 </span> <a href='../403unicode.mu.html#L339'>write-grapheme</a> text, g
|
||||
<span id="L125" class="LineNr">125 </span> <a href='../403unicode.mu.html#L389'>write-code-point-utf8</a> text, ka
|
||||
<span id="L126" class="LineNr">126 </span> g <span class="Special"><-</span> <a href='../403unicode.mu.html#L97'>to-utf8</a> <span class="Constant">0x094f</span>/devanagari-vowel-aw
|
||||
<span id="L127" class="LineNr">127 </span> <a href='../403unicode.mu.html#L389'>write-code-point-utf8</a> text, g
|
||||
<span id="L128" class="LineNr">128 </span> <span class="muComment"># kan</span>
|
||||
<span id="L129" class="LineNr">129 </span> <a href='../403unicode.mu.html#L339'>write-grapheme</a> text, ka
|
||||
<span id="L130" class="LineNr">130 </span> g <span class="Special"><-</span> <a href='../403unicode.mu.html#L104'>to-grapheme</a> <span class="Constant">0x0902</span>/devanagari-anusvara
|
||||
<span id="L131" class="LineNr">131 </span> <a href='../403unicode.mu.html#L339'>write-grapheme</a> text, g
|
||||
<span id="L129" class="LineNr">129 </span> <a href='../403unicode.mu.html#L389'>write-code-point-utf8</a> text, ka
|
||||
<span id="L130" class="LineNr">130 </span> g <span class="Special"><-</span> <a href='../403unicode.mu.html#L97'>to-utf8</a> <span class="Constant">0x0902</span>/devanagari-anusvara
|
||||
<span id="L131" class="LineNr">131 </span> <a href='../403unicode.mu.html#L389'>write-code-point-utf8</a> text, g
|
||||
<span id="L132" class="LineNr">132 </span> <span class="muComment"># kaha</span>
|
||||
<span id="L133" class="LineNr">133 </span> <a href='../403unicode.mu.html#L339'>write-grapheme</a> text, ka
|
||||
<span id="L134" class="LineNr">134 </span> g <span class="Special"><-</span> <a href='../403unicode.mu.html#L104'>to-grapheme</a> <span class="Constant">0x0903</span>/devanagari-visarga
|
||||
<span id="L135" class="LineNr">135 </span> <a href='../403unicode.mu.html#L339'>write-grapheme</a> text, g
|
||||
<span id="L133" class="LineNr">133 </span> <a href='../403unicode.mu.html#L389'>write-code-point-utf8</a> text, ka
|
||||
<span id="L134" class="LineNr">134 </span> g <span class="Special"><-</span> <a href='../403unicode.mu.html#L97'>to-utf8</a> <span class="Constant">0x0903</span>/devanagari-visarga
|
||||
<span id="L135" class="LineNr">135 </span> <a href='../403unicode.mu.html#L389'>write-code-point-utf8</a> text, g
|
||||
<span id="L136" class="LineNr">136 </span> <span class="muComment"># render everything</span>
|
||||
<span id="L137" class="LineNr">137 </span> <a href='../500fake-screen.mu.html#L269'>set-cursor-position</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">4</span>/x <span class="Constant">0xe</span>/y
|
||||
<span id="L138" class="LineNr">138 </span> <a href='../501draw-text.mu.html#L295'>draw-stream-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, text, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L138" class="LineNr">138 </span> <a href='../501draw-text.mu.html#L288'>draw-stream-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, text, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L139" class="LineNr">139 </span>
|
||||
<span id="L140" class="LineNr">140 </span> <span class="muComment"># a stream of tamil graphemes (with interspersed spaces for clarity) that don't look the same in Mu</span>
|
||||
<span id="L140" class="LineNr">140 </span> <span class="muComment"># a stream of tamil code-point-utf8s (with interspersed spaces for clarity) that don't look the same in Mu</span>
|
||||
<span id="L141" class="LineNr">141 </span> <a href='../500fake-screen.mu.html#L269'>set-cursor-position</a> <span class="Constant">0</span>, <span class="Constant">4</span>/x <span class="Constant">0x12</span>/y
|
||||
<span id="L142" class="LineNr">142 </span> <a href='../501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>, <span class="Constant">"எ ஃ கு "</span>, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L142" class="LineNr">142 </span> <a href='../501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>, <span class="Constant">"எ ஃ கு "</span>, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L143" class="LineNr">143 </span> <a href='../500fake-screen.mu.html#L269'>set-cursor-position</a> <span class="Constant">0</span>, <span class="Constant">4</span>/x <span class="Constant">0x13</span>/y
|
||||
<span id="L144" class="LineNr">144 </span> <a href='../501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>, <span class="Constant">"அ ன் று "</span>, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L144" class="LineNr">144 </span> <a href='../501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>, <span class="Constant">"அ ன் று "</span>, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L145" class="LineNr">145 </span> <a href='../500fake-screen.mu.html#L269'>set-cursor-position</a> <span class="Constant">0</span>, <span class="Constant">4</span>/x <span class="Constant">0x14</span>/y
|
||||
<span id="L146" class="LineNr">146 </span> <a href='../501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>, <span class="Constant">"அ தா வ து "</span> , <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L146" class="LineNr">146 </span> <a href='../501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>, <span class="Constant">"அ தா வ து "</span> , <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L147" class="LineNr">147 </span> <a href='../500fake-screen.mu.html#L269'>set-cursor-position</a> <span class="Constant">0</span>, <span class="Constant">4</span>/x <span class="Constant">0x15</span>/y
|
||||
<span id="L148" class="LineNr">148 </span> <a href='../501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>, <span class="Constant">"அ ஃ தா ன் று "</span>, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L148" class="LineNr">148 </span> <a href='../501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>, <span class="Constant">"அ ஃ தா ன் று "</span>, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L149" class="LineNr">149 </span><span class="Delimiter">}</span>
|
||||
</pre>
|
||||
</body>
|
||||
|
|
|
@ -67,8 +67,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L9" class="LineNr"> 9 </span><span class="muComment"># Expected output: text in green near the top-left corner of screen</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='ex5.mu.html#L11'>main</a></span> <a href='../500fake-screen.mu.html#L16'>screen</a>: (addr <a href='../500fake-screen.mu.html#L16'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
|
||||
<span id="L12" class="LineNr">12 </span> <span class="PreProc">var</span> dummy/eax: int <span class="Special"><-</span> <a href='../501draw-text.mu.html#L113'>draw-text-rightward</a> <a href='../500fake-screen.mu.html#L16'>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="L13" class="LineNr">13 </span> dummy <span class="Special"><-</span> <a href='../501draw-text.mu.html#L113'>draw-text-rightward</a> <a href='../500fake-screen.mu.html#L16'>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="L12" class="LineNr">12 </span> <span class="PreProc">var</span> dummy/eax: int <span class="Special"><-</span> <a href='../501draw-text.mu.html#L106'>draw-text-rightward</a> <a href='../500fake-screen.mu.html#L16'>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="L13" class="LineNr">13 </span> dummy <span class="Special"><-</span> <a href='../501draw-text.mu.html#L106'>draw-text-rightward</a> <a href='../500fake-screen.mu.html#L16'>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="L14" class="LineNr">14 </span><span class="Delimiter">}</span>
|
||||
</pre>
|
||||
</body>
|
||||
|
|
|
@ -71,21 +71,21 @@ if ('onhashchange' in window) {
|
|||
<span id="L12" class="LineNr">12 </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="L13" class="LineNr">13 </span> <span class="PreProc">var</span> x/eax: int <span class="Special"><-</span> copy <span class="Constant">0x20</span>
|
||||
<span id="L14" class="LineNr">14 </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="L15" class="LineNr">15 </span> x, y <span class="Special"><-</span> <a href='../501draw-text.mu.html#L188'>draw-text-wrapping-right-then-down</a> <a href='../500fake-screen.mu.html#L16'>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="L16" class="LineNr">16 </span> x, y <span class="Special"><-</span> <a href='../501draw-text.mu.html#L188'>draw-text-wrapping-right-then-down</a> <a href='../500fake-screen.mu.html#L16'>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="L17" class="LineNr">17 </span> x, y <span class="Special"><-</span> <a href='../501draw-text.mu.html#L188'>draw-text-wrapping-right-then-down</a> <a href='../500fake-screen.mu.html#L16'>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
|
||||
<span id="L18" class="LineNr">18 </span> x, y <span class="Special"><-</span> <a href='../501draw-text.mu.html#L188'>draw-text-wrapping-right-then-down</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"Mu!"</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="L15" class="LineNr">15 </span> x, y <span class="Special"><-</span> <a href='../501draw-text.mu.html#L181'>draw-text-wrapping-right-then-down</a> <a href='../500fake-screen.mu.html#L16'>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="L16" class="LineNr">16 </span> x, y <span class="Special"><-</span> <a href='../501draw-text.mu.html#L181'>draw-text-wrapping-right-then-down</a> <a href='../500fake-screen.mu.html#L16'>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="L17" class="LineNr">17 </span> x, y <span class="Special"><-</span> <a href='../501draw-text.mu.html#L181'>draw-text-wrapping-right-then-down</a> <a href='../500fake-screen.mu.html#L16'>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
|
||||
<span id="L18" class="LineNr">18 </span> x, y <span class="Special"><-</span> <a href='../501draw-text.mu.html#L181'>draw-text-wrapping-right-then-down</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"Mu!"</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>
|
||||
<span id="L20" class="LineNr">20 </span> <span class="muComment"># drawing at the cursor in multiple directions</span>
|
||||
<span id="L21" class="LineNr">21 </span> <a href='../501draw-text.mu.html#L559'>draw-text-wrapping-down-then-right-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"abc"</span>, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L22" class="LineNr">22 </span> <a href='../501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"def"</span>, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L21" class="LineNr">21 </span> <a href='../501draw-text.mu.html#L552'>draw-text-wrapping-down-then-right-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"abc"</span>, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L22" class="LineNr">22 </span> <a href='../501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"def"</span>, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L23" class="LineNr">23 </span>
|
||||
<span id="L24" class="LineNr">24 </span> <span class="muComment"># test drawing near the edge</span>
|
||||
<span id="L25" class="LineNr">25 </span> x <span class="Special"><-</span> <a href='../501draw-text.mu.html#L113'>draw-text-rightward</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"R"</span>, <span class="Constant">0x7f</span>/x, <span class="Constant">0x80</span>/xmax=screen-width, <span class="Constant">0x18</span>/y, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L26" class="LineNr">26 </span> <a href='../501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"wrapped from R"</span>, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L25" class="LineNr">25 </span> x <span class="Special"><-</span> <a href='../501draw-text.mu.html#L106'>draw-text-rightward</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"R"</span>, <span class="Constant">0x7f</span>/x, <span class="Constant">0x80</span>/xmax=screen-width, <span class="Constant">0x18</span>/y, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L26" class="LineNr">26 </span> <a href='../501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"wrapped from R"</span>, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L27" class="LineNr">27 </span>
|
||||
<span id="L28" class="LineNr">28 </span> x <span class="Special"><-</span> <a href='../501draw-text.mu.html#L461'>draw-text-downward</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"D"</span>, <span class="Constant">0x20</span>/x, <span class="Constant">0x2f</span>/y, <span class="Constant">0x30</span>/ymax=screen-height, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L29" class="LineNr">29 </span> <a href='../501draw-text.mu.html#L559'>draw-text-wrapping-down-then-right-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"wrapped from D"</span>, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L28" class="LineNr">28 </span> x <span class="Special"><-</span> <a href='../501draw-text.mu.html#L454'>draw-text-downward</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"D"</span>, <span class="Constant">0x20</span>/x, <span class="Constant">0x2f</span>/y, <span class="Constant">0x30</span>/ymax=screen-height, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L29" class="LineNr">29 </span> <a href='../501draw-text.mu.html#L552'>draw-text-wrapping-down-then-right-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"wrapped from D"</span>, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L30" class="LineNr">30 </span><span class="Delimiter">}</span>
|
||||
</pre>
|
||||
</body>
|
||||
|
|
|
@ -74,26 +74,26 @@ if ('onhashchange' in window) {
|
|||
<span id="L16" class="LineNr">16 </span> <span class="Delimiter">{</span>
|
||||
<span id="L17" class="LineNr">17 </span> compare key, <span class="Constant">0x80</span>/left-arrow
|
||||
<span id="L18" class="LineNr">18 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L19" class="LineNr">19 </span> <a href='../501draw-text.mu.html#L84'>draw-code-point-at-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x2d</span>/dash, <span class="Constant">0x31</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L19" class="LineNr">19 </span> draw-code-point-at-cursor <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x2d</span>/dash, <span class="Constant">0x31</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L20" class="LineNr">20 </span> <a href='../501draw-text.mu.html#L3'>move-cursor-left</a> <span class="Constant">0</span>
|
||||
<span id="L21" class="LineNr">21 </span> <span class="Delimiter">}</span>
|
||||
<span id="L22" class="LineNr">22 </span> <span class="Delimiter">{</span>
|
||||
<span id="L23" class="LineNr">23 </span> compare key, <span class="Constant">0x81</span>/down-arrow
|
||||
<span id="L24" class="LineNr">24 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L25" class="LineNr">25 </span> <a href='../501draw-text.mu.html#L84'>draw-code-point-at-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x7c</span>/vertical-bar, <span class="Constant">0x31</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L25" class="LineNr">25 </span> draw-code-point-at-cursor <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x7c</span>/vertical-bar, <span class="Constant">0x31</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L26" class="LineNr">26 </span> <a href='../501draw-text.mu.html#L47'>move-cursor-down</a> <span class="Constant">0</span>
|
||||
<span id="L27" class="LineNr">27 </span> <span class="Delimiter">}</span>
|
||||
<span id="L28" class="LineNr">28 </span> <span class="Delimiter">{</span>
|
||||
<span id="L29" class="LineNr">29 </span> compare key, <span class="Constant">0x82</span>/up-arrow
|
||||
<span id="L30" class="LineNr">30 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L31" class="LineNr">31 </span> <a href='../501draw-text.mu.html#L84'>draw-code-point-at-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x7c</span>/vertical-bar, <span class="Constant">0x31</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L31" class="LineNr">31 </span> draw-code-point-at-cursor <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x7c</span>/vertical-bar, <span class="Constant">0x31</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L32" class="LineNr">32 </span> <a href='../501draw-text.mu.html#L34'>move-cursor-up</a> <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="Delimiter">{</span>
|
||||
<span id="L35" class="LineNr">35 </span> compare key, <span class="Constant">0x83</span>/right-arrow
|
||||
<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/eax: code-point <span class="Special"><-</span> copy <span class="Constant">0x2d</span>/dash
|
||||
<span id="L38" class="LineNr">38 </span> <a href='../501draw-text.mu.html#L84'>draw-code-point-at-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x2d</span>/dash, <span class="Constant">0x31</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L38" class="LineNr">38 </span> draw-code-point-at-cursor <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x2d</span>/dash, <span class="Constant">0x31</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L39" class="LineNr">39 </span> <a href='../501draw-text.mu.html#L16'>move-cursor-right</a> <span class="Constant">0</span>
|
||||
<span id="L40" class="LineNr">40 </span> <span class="Delimiter">}</span>
|
||||
<span id="L41" class="LineNr">41 </span> <span class="PreProc">loop</span>
|
||||
|
|
|
@ -93,7 +93,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L33" class="LineNr">33 </span> <span class="PreProc">var</span> done?/eax: boolean <span class="Special"><-</span> <a href='../309stream.subx.html#L6'>stream-empty?</a> in
|
||||
<span id="L34" class="LineNr">34 </span> compare done?, <span class="Constant">0</span>/false
|
||||
<span id="L35" class="LineNr">35 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L36" class="LineNr">36 </span> <span class="PreProc">var</span> g/eax: grapheme <span class="Special"><-</span> <a href='../403unicode.mu.html#L236'>read-grapheme</a> in
|
||||
<span id="L36" class="LineNr">36 </span> <span class="PreProc">var</span> g/eax: code-point-utf8 <span class="Special"><-</span> <a href='../403unicode.mu.html#L229'>read-code-point-utf8</a> in
|
||||
<span id="L37" class="LineNr">37 </span> <span class="Delimiter">{</span>
|
||||
<span id="L38" class="LineNr">38 </span> compare g, <span class="Constant">0x20</span>/space
|
||||
<span id="L39" class="LineNr">39 </span> <span class="PreProc">break-if-!=</span>
|
||||
|
|
|
@ -92,7 +92,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L28" class="LineNr"> 28 </span> <span class="PreProc">var</span> second-screen/<span class="muRegEdi">edi</span>: (addr <a href='../500fake-screen.mu.html#L16'>screen</a>) <span class="Special"><-</span> address second-buffer
|
||||
<span id="L29" class="LineNr"> 29 </span> <a href='../500fake-screen.mu.html#L34'>initialize-screen</a> second-screen, <span class="Constant">0x80</span>, <span class="Constant">0x30</span>, <span class="Constant">1</span>/include-pixels
|
||||
<span id="L30" class="LineNr"> 30 </span> <a href='hest-life.mu.html#L63'>render</a> second-screen, env
|
||||
<span id="L31" class="LineNr"> 31 </span> convert-graphemes-to-pixels second-screen
|
||||
<span id="L31" class="LineNr"> 31 </span> convert-code-point-utf8s-to-pixels second-screen
|
||||
<span id="L32" class="LineNr"> 32 </span> <a href='../500fake-screen.mu.html#L643'>copy-pixels</a> second-screen, <a href='../500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L33" class="LineNr"> 33 </span> <span class="Delimiter">{</span>
|
||||
<span id="L34" class="LineNr"> 34 </span> <a href='hest-life.mu.html#L595'>edit</a> keyboard, env
|
||||
|
@ -103,7 +103,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L39" class="LineNr"> 39 </span> <a href='hest-life.mu.html#L679'>step</a> env
|
||||
<span id="L40" class="LineNr"> 40 </span> <a href='../500fake-screen.mu.html#L330'>clear-screen</a> second-screen
|
||||
<span id="L41" class="LineNr"> 41 </span> <a href='hest-life.mu.html#L63'>render</a> second-screen, env
|
||||
<span id="L42" class="LineNr"> 42 </span> convert-graphemes-to-pixels second-screen
|
||||
<span id="L42" class="LineNr"> 42 </span> convert-code-point-utf8s-to-pixels second-screen
|
||||
<span id="L43" class="LineNr"> 43 </span> <a href='../500fake-screen.mu.html#L643'>copy-pixels</a> second-screen, <a href='../500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L44" class="LineNr"> 44 </span> <span class="Delimiter">}</span>
|
||||
<span id="L45" class="LineNr"> 45 </span> <a href='hest-life.mu.html#L1019'>linger</a>
|
||||
|
@ -147,7 +147,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L83" class="LineNr"> 83 </span> <span class="muComment"># clock</span>
|
||||
<span id="L84" class="LineNr"> 84 </span> <span class="PreProc">var</span> tick-a/eax: (addr int) <span class="Special"><-</span> get self, tick
|
||||
<span id="L85" class="LineNr"> 85 </span> <a href='../500fake-screen.mu.html#L269'>set-cursor-position</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x78</span>/x, <span class="Constant">0</span>/y
|
||||
<span id="L86" class="LineNr"> 86 </span> <a href='../501draw-text.mu.html#L449'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, *tick-a, <span class="Constant">7</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L86" class="LineNr"> 86 </span> <a href='../501draw-text.mu.html#L442'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, *tick-a, <span class="Constant">7</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L87" class="LineNr"> 87 </span><span class="Delimiter">}</span>
|
||||
<span id="L88" class="LineNr"> 88 </span>
|
||||
<span id="L89" class="LineNr"> 89 </span><span class="muComment"># Lots of hardcoded constants for now.</span>
|
||||
|
@ -181,7 +181,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L117" class="LineNr"> 117 </span> <span class="muComment"># sum node</span>
|
||||
<span id="L118" class="LineNr"> 118 </span> <a href='../507line.mu.html#L86'>draw-rect</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x170</span>/xsmin <span class="Constant">0x140</span>/ysmin, <span class="Constant">0x190</span>/xsmax <span class="Constant">0x160</span>/ysmax, <span class="Constant">0x40</span>/color
|
||||
<span id="L119" class="LineNr"> 119 </span> <a href='../500fake-screen.mu.html#L269'>set-cursor-position</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x2d</span>/scol, <span class="Constant">0x13</span>/srow
|
||||
<span id="L120" class="LineNr"> 120 </span> <a href='../501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"+"</span>, <span class="Constant">0xf</span>/color, <span class="Constant">0</span>/bg
|
||||
<span id="L120" class="LineNr"> 120 </span> <a href='../501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"+"</span>, <span class="Constant">0xf</span>/color, <span class="Constant">0</span>/bg
|
||||
<span id="L121" class="LineNr"> 121 </span> <span class="muComment"># conveyors from neighboring inputs to sum node</span>
|
||||
<span id="L122" class="LineNr"> 122 </span> <a href='../509bezier.mu.html#L14'>draw-monotonic-bezier</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0xa0</span>/x0 <span class="Constant">0x20</span>/y0, <span class="Constant">0x100</span>/x1 <span class="Constant">0x150</span>/ys, <span class="Constant">0x180</span>/xs <span class="Constant">0x150</span>/ys, <span class="Constant">4</span>/color
|
||||
<span id="L123" class="LineNr"> 123 </span> <a href='../509bezier.mu.html#L14'>draw-monotonic-bezier</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0xa0</span>/x0 <span class="Constant">0x180</span>/y0, <span class="Constant">0xc0</span>/x1 <span class="Constant">0x150</span>/ys, <span class="Constant">0x180</span>/xs <span class="Constant">0x150</span>/ys, <span class="Constant">4</span>/color
|
||||
|
@ -194,7 +194,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L130" class="LineNr"> 130 </span> <span class="muComment"># filter node</span>
|
||||
<span id="L131" class="LineNr"> 131 </span> <a href='../507line.mu.html#L86'>draw-rect</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x200</span>/xfmin <span class="Constant">0x1c0</span>/yfmin, <span class="Constant">0x220</span>/xfmax <span class="Constant">0x1e0</span>/yfmax, <span class="Constant">0x31</span>/color
|
||||
<span id="L132" class="LineNr"> 132 </span> <a href='../500fake-screen.mu.html#L269'>set-cursor-position</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x40</span>/fcol, <span class="Constant">0x1b</span>/frow
|
||||
<span id="L133" class="LineNr"> 133 </span> <a href='../501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"?"</span>, <span class="Constant">0xf</span>/color, <span class="Constant">0</span>/bg
|
||||
<span id="L133" class="LineNr"> 133 </span> <a href='../501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"?"</span>, <span class="Constant">0xf</span>/color, <span class="Constant">0</span>/bg
|
||||
<span id="L134" class="LineNr"> 134 </span> <span class="muComment"># conveyor from sum node to filter node</span>
|
||||
<span id="L135" class="LineNr"> 135 </span> <a href='../507line.mu.html#L1'>draw-line</a> <a href='../500fake-screen.mu.html#L16'>screen</a> <span class="Constant">0x180</span>/xs, <span class="Constant">0x150</span>/ys, <span class="Constant">0x210</span>/xf, <span class="Constant">0x1d0</span>/yf, <span class="Constant">0xa2</span>/color
|
||||
<span id="L136" class="LineNr"> 136 </span> <span class="muComment"># cell outputs at corners</span>
|
||||
|
@ -253,7 +253,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L189" class="LineNr"> 189 </span> <a href='hest-life.mu.html#L588'>draw-linear-point</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, u, <span class="Constant">0x180</span>/xs, <span class="Constant">0x150</span>/ys, <span class="Constant">0x210</span>/xf, <span class="Constant">0x1d0</span>/yf, <span class="Constant">7</span>/color, <span class="Constant">4</span>/radius
|
||||
<span id="L190" class="LineNr"> 190 </span> <a href='../500fake-screen.mu.html#L269'>set-cursor-position</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x3a</span>/scol, <span class="Constant">0x18</span>/srow
|
||||
<span id="L191" class="LineNr"> 191 </span> <span class="PreProc">var</span> n/eax: int <span class="Special"><-</span> <a href='hest-life.mu.html#L953'>num-live-neighbors</a> self, <span class="Constant">0x80</span>/curx, <span class="Constant">0x60</span>/cury
|
||||
<span id="L192" class="LineNr"> 192 </span> <a href='../501draw-text.mu.html#L449'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, n, <span class="Constant">0xf</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L192" class="LineNr"> 192 </span> <a href='../501draw-text.mu.html#L442'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, n, <span class="Constant">0xf</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L193" class="LineNr"> 193 </span> <span class="PreProc">return</span>
|
||||
<span id="L194" class="LineNr"> 194 </span> <span class="Delimiter">}</span>
|
||||
<span id="L195" class="LineNr"> 195 </span> <span class="muComment"># final 7 time steps for updating output</span>
|
||||
|
@ -370,16 +370,16 @@ if ('onhashchange' in window) {
|
|||
<span id="L306" class="LineNr"> 306 </span> <span class="muComment"># neighbor counts</span>
|
||||
<span id="L307" class="LineNr"> 307 </span> <span class="PreProc">var</span> n/eax: int <span class="Special"><-</span> <a href='hest-life.mu.html#L953'>num-live-neighbors</a> self, <span class="Constant">0x80</span>/curx, <span class="Constant">0x60</span>/cury
|
||||
<span id="L308" class="LineNr"> 308 </span> <a href='../500fake-screen.mu.html#L269'>set-cursor-position</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x2d</span>, <span class="Constant">0xe</span>
|
||||
<span id="L309" class="LineNr"> 309 </span> <a href='../501draw-text.mu.html#L449'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, n, <span class="Constant">0xf</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L309" class="LineNr"> 309 </span> <a href='../501draw-text.mu.html#L442'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, n, <span class="Constant">0xf</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L310" class="LineNr"> 310 </span> <span class="PreProc">var</span> n/eax: int <span class="Special"><-</span> <a href='hest-life.mu.html#L953'>num-live-neighbors</a> self, <span class="Constant">0x81</span>/curx, <span class="Constant">0x60</span>/cury
|
||||
<span id="L311" class="LineNr"> 311 </span> <a href='../500fake-screen.mu.html#L269'>set-cursor-position</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x52</span>, <span class="Constant">0xe</span>
|
||||
<span id="L312" class="LineNr"> 312 </span> <a href='../501draw-text.mu.html#L449'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, n, <span class="Constant">0xf</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L312" class="LineNr"> 312 </span> <a href='../501draw-text.mu.html#L442'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, n, <span class="Constant">0xf</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L313" class="LineNr"> 313 </span> <span class="PreProc">var</span> n/eax: int <span class="Special"><-</span> <a href='hest-life.mu.html#L953'>num-live-neighbors</a> self, <span class="Constant">0x80</span>/curx, <span class="Constant">0x61</span>/cury
|
||||
<span id="L314" class="LineNr"> 314 </span> <a href='../500fake-screen.mu.html#L269'>set-cursor-position</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x2d</span>, <span class="Constant">0x20</span>
|
||||
<span id="L315" class="LineNr"> 315 </span> <a href='../501draw-text.mu.html#L449'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, n, <span class="Constant">0xf</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L315" class="LineNr"> 315 </span> <a href='../501draw-text.mu.html#L442'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, n, <span class="Constant">0xf</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L316" class="LineNr"> 316 </span> <span class="PreProc">var</span> n/eax: int <span class="Special"><-</span> <a href='hest-life.mu.html#L953'>num-live-neighbors</a> self, <span class="Constant">0x81</span>/curx, <span class="Constant">0x61</span>/cury
|
||||
<span id="L317" class="LineNr"> 317 </span> <a href='../500fake-screen.mu.html#L269'>set-cursor-position</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x52</span>, <span class="Constant">0x20</span>
|
||||
<span id="L318" class="LineNr"> 318 </span> <a href='../501draw-text.mu.html#L449'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, n, <span class="Constant">0xf</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L318" class="LineNr"> 318 </span> <a href='../501draw-text.mu.html#L442'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, n, <span class="Constant">0xf</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L319" class="LineNr"> 319 </span> <span class="muComment"># cell 0: conveyors from neighboring inputs to sum node</span>
|
||||
<span id="L320" class="LineNr"> 320 </span> <a href='../509bezier.mu.html#L14'>draw-monotonic-bezier</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0xc0</span>/x0 <span class="Constant">0x40</span>/y0, <span class="Constant">0x100</span>/x1 <span class="Constant">0xd0</span>/ys, <span class="Constant">0x150</span>/xs <span class="Constant">0xd0</span>/ys, <span class="Constant">4</span>/color
|
||||
<span id="L321" class="LineNr"> 321 </span> <a href='../509bezier.mu.html#L14'>draw-monotonic-bezier</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0xc0</span>/x0 <span class="Constant">0xe8</span>/y0, <span class="Constant">0xc0</span>/x1 <span class="Constant">0xd0</span>/ys, <span class="Constant">0x150</span>/xs <span class="Constant">0xd0</span>/ys, <span class="Constant">4</span>/color
|
||||
|
|
|
@ -81,135 +81,117 @@ if ('onhashchange' in window) {
|
|||
<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="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>: code-point <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/eax: int <span class="Special"><-</span> <a href='../501draw-text.mu.html#L113'>draw-text-rightward</a> <a href='../500fake-screen.mu.html#L16'>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#L316'>draw-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, space
|
||||
<span id="L31" class="LineNr"> 31 </span> <span class="PreProc">var</span> key/eax: 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/eax: 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> c/eax: code-point <span class="Special"><-</span> copy key2
|
||||
<span id="L39" class="LineNr"> 39 </span> <a href='../501draw-text.mu.html#L91'>draw-code-point-at-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, c, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L40" class="LineNr"> 40 </span> <span class="PreProc">loop</span>
|
||||
<span id="L41" class="LineNr"> 41 </span> <span class="Delimiter">}</span>
|
||||
<span id="L42" class="LineNr"> 42 </span> <span class="muComment"># clear cursor</span>
|
||||
<span id="L43" class="LineNr"> 43 </span> <a href='../501draw-text.mu.html#L91'>draw-code-point-at-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, space, <span class="Constant">3</span>/fg/never-used, <span class="Constant">0</span>/bg
|
||||
<span id="L44" class="LineNr"> 44 </span> <span class="muComment"># parse and eval</span>
|
||||
<span id="L45" class="LineNr"> 45 </span> <span class="PreProc">var</span> out/eax: int <span class="Special"><-</span> <a href='rpn.mu.html#L61'>simplify</a> in
|
||||
<span id="L46" class="LineNr"> 46 </span> <span class="muComment"># print</span>
|
||||
<span id="L47" class="LineNr"> 47 </span> y <span class="Special"><-</span> increment
|
||||
<span id="L48" class="LineNr"> 48 </span> out, y <span class="Special"><-</span> <a href='../501draw-text.mu.html#L401'>draw-int32-decimal-wrapping-right-then-down</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, out, <span class="Constant">0</span>/xmin, y, <span class="Constant">0x80</span>/xmax, <span class="Constant">0x30</span>/ymax, <span class="Constant">0</span>/x, y, <span class="Constant">7</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L49" class="LineNr"> 49 </span> <span class="muComment"># newline</span>
|
||||
<span id="L50" class="LineNr"> 50 </span> y <span class="Special"><-</span> increment
|
||||
<span id="L51" class="LineNr"> 51 </span> <span class="muComment">#</span>
|
||||
<span id="L52" class="LineNr"> 52 </span> <span class="PreProc">loop</span>
|
||||
<span id="L53" class="LineNr"> 53 </span> <span class="Delimiter">}</span>
|
||||
<span id="L54" class="LineNr"> 54 </span><span class="Delimiter">}</span>
|
||||
<span id="L55" class="LineNr"> 55 </span>
|
||||
<span id="L56" class="LineNr"> 56 </span><span class="PreProc">type</span> <a href='rpn.mu.html#L56'>int-stack</a> <span class="Delimiter">{</span>
|
||||
<span id="L57" class="LineNr"> 57 </span> data: (handle array int)
|
||||
<span id="L58" class="LineNr"> 58 </span> top: int
|
||||
<span id="L59" class="LineNr"> 59 </span><span class="Delimiter">}</span>
|
||||
<span id="L60" class="LineNr"> 60 </span>
|
||||
<span id="L61" class="LineNr"> 61 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='rpn.mu.html#L61'>simplify</a></span> in: (addr stream byte)<span class="PreProc"> -> </span>_/eax: int <span class="Delimiter">{</span>
|
||||
<span id="L62" class="LineNr"> 62 </span> <span class="PreProc">var</span> word-storage: slice
|
||||
<span id="L63" class="LineNr"> 63 </span> <span class="PreProc">var</span> word/<span class="muRegEcx">ecx</span>: (addr slice) <span class="Special"><-</span> address word-storage
|
||||
<span id="L64" class="LineNr"> 64 </span> <span class="PreProc">var</span> stack-storage: <a href='rpn.mu.html#L56'>int-stack</a>
|
||||
<span id="L65" class="LineNr"> 65 </span> <span class="PreProc">var</span> stack/<span class="muRegEsi">esi</span>: (addr <a href='rpn.mu.html#L56'>int-stack</a>) <span class="Special"><-</span> address stack-storage
|
||||
<span id="L66" class="LineNr"> 66 </span> <a href='rpn.mu.html#L115'>initialize-int-stack</a> stack, <span class="Constant">0x10</span>
|
||||
<span id="L67" class="LineNr"> 67 </span> $simplify:word-loop: <span class="Delimiter">{</span>
|
||||
<span id="L68" class="LineNr"> 68 </span> <a href='../127next-word.subx.html#L11'>next-word</a> in, word
|
||||
<span id="L69" class="LineNr"> 69 </span> <span class="PreProc">var</span> done?/eax: boolean <span class="Special"><-</span> <a href='../123slice.subx.html#L9'>slice-empty?</a> word
|
||||
<span id="L70" class="LineNr"> 70 </span> compare done?, <span class="Constant">0</span>
|
||||
<span id="L71" class="LineNr"> 71 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L72" class="LineNr"> 72 </span> <span class="muComment"># if word is an operator, perform it</span>
|
||||
<span id="L73" class="LineNr"> 73 </span> <span class="Delimiter">{</span>
|
||||
<span id="L74" class="LineNr"> 74 </span> <span class="PreProc">var</span> is-add?/eax: 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> compare is-add?, <span class="Constant">0</span>
|
||||
<span id="L76" class="LineNr"> 76 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L77" class="LineNr"> 77 </span> <span class="PreProc">var</span> _b/eax: int <span class="Special"><-</span> <a href='rpn.mu.html#L135'>pop-int-stack</a> stack
|
||||
<span id="L78" class="LineNr"> 78 </span> <span class="PreProc">var</span> b/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy _b
|
||||
<span id="L79" class="LineNr"> 79 </span> <span class="PreProc">var</span> a/eax: int <span class="Special"><-</span> <a href='rpn.mu.html#L135'>pop-int-stack</a> stack
|
||||
<span id="L80" class="LineNr"> 80 </span> a <span class="Special"><-</span> add b
|
||||
<span id="L81" class="LineNr"> 81 </span> <a href='rpn.mu.html#L123'>push-int-stack</a> stack, a
|
||||
<span id="L82" class="LineNr"> 82 </span> <span class="PreProc">loop</span> $simplify:word-loop
|
||||
<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 class="PreProc">var</span> is-sub?/eax: 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> compare is-sub?, <span class="Constant">0</span>
|
||||
<span id="L87" class="LineNr"> 87 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L88" class="LineNr"> 88 </span> <span class="PreProc">var</span> _b/eax: int <span class="Special"><-</span> <a href='rpn.mu.html#L135'>pop-int-stack</a> stack
|
||||
<span id="L89" class="LineNr"> 89 </span> <span class="PreProc">var</span> b/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy _b
|
||||
<span id="L90" class="LineNr"> 90 </span> <span class="PreProc">var</span> a/eax: int <span class="Special"><-</span> <a href='rpn.mu.html#L135'>pop-int-stack</a> stack
|
||||
<span id="L91" class="LineNr"> 91 </span> a <span class="Special"><-</span> subtract b
|
||||
<span id="L92" class="LineNr"> 92 </span> <a href='rpn.mu.html#L123'>push-int-stack</a> stack, a
|
||||
<span id="L93" class="LineNr"> 93 </span> <span class="PreProc">loop</span> $simplify:word-loop
|
||||
<span id="L94" class="LineNr"> 94 </span> <span class="Delimiter">}</span>
|
||||
<span id="L95" class="LineNr"> 95 </span> <span class="Delimiter">{</span>
|
||||
<span id="L96" class="LineNr"> 96 </span> <span class="PreProc">var</span> is-mul?/eax: 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> compare is-mul?, <span class="Constant">0</span>
|
||||
<span id="L98" class="LineNr"> 98 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L99" class="LineNr"> 99 </span> <span class="PreProc">var</span> _b/eax: int <span class="Special"><-</span> <a href='rpn.mu.html#L135'>pop-int-stack</a> stack
|
||||
<span id="L100" class="LineNr">100 </span> <span class="PreProc">var</span> b/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy _b
|
||||
<span id="L101" class="LineNr">101 </span> <span class="PreProc">var</span> a/eax: int <span class="Special"><-</span> <a href='rpn.mu.html#L135'>pop-int-stack</a> stack
|
||||
<span id="L102" class="LineNr">102 </span> a <span class="Special"><-</span> multiply b
|
||||
<span id="L103" class="LineNr">103 </span> <a href='rpn.mu.html#L123'>push-int-stack</a> stack, a
|
||||
<span id="L104" class="LineNr">104 </span> <span class="PreProc">loop</span> $simplify:word-loop
|
||||
<span id="L105" class="LineNr">105 </span> <span class="Delimiter">}</span>
|
||||
<span id="L106" class="LineNr">106 </span> <span class="muComment"># otherwise it's an int</span>
|
||||
<span id="L107" class="LineNr">107 </span> <span class="PreProc">var</span> n/eax: 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> <a href='rpn.mu.html#L123'>push-int-stack</a> stack, n
|
||||
<span id="L109" class="LineNr">109 </span> <span class="PreProc">loop</span>
|
||||
<span id="L110" class="LineNr">110 </span> <span class="Delimiter">}</span>
|
||||
<span id="L111" class="LineNr">111 </span> <span class="PreProc">var</span> result/eax: int <span class="Special"><-</span> <a href='rpn.mu.html#L135'>pop-int-stack</a> stack
|
||||
<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="PreProc">fn</span> <span class="muFunction"><a href='rpn.mu.html#L115'>initialize-int-stack</a></span> _self: (addr <a href='rpn.mu.html#L56'>int-stack</a>), n: int <span class="Delimiter">{</span>
|
||||
<span id="L116" class="LineNr">116 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='rpn.mu.html#L56'>int-stack</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L117" class="LineNr">117 </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="L118" class="LineNr">118 </span> populate d, n
|
||||
<span id="L119" class="LineNr">119 </span> <span class="PreProc">var</span> top/eax: (addr int) <span class="Special"><-</span> get self, top
|
||||
<span id="L120" class="LineNr">120 </span> copy-to *top, <span class="Constant">0</span>
|
||||
<span id="L121" class="LineNr">121 </span><span class="Delimiter">}</span>
|
||||
<span id="L122" class="LineNr">122 </span>
|
||||
<span id="L123" class="LineNr">123 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='rpn.mu.html#L123'>push-int-stack</a></span> _self: (addr <a href='rpn.mu.html#L56'>int-stack</a>), _val: int <span class="Delimiter">{</span>
|
||||
<span id="L124" class="LineNr">124 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='rpn.mu.html#L56'>int-stack</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L125" class="LineNr">125 </span> <span class="PreProc">var</span> top-addr/<span class="muRegEcx">ecx</span>: (addr int) <span class="Special"><-</span> get self, top
|
||||
<span id="L22" class="LineNr"> 22 </span> <span class="muComment"># read-eval-print loop</span>
|
||||
<span id="L23" class="LineNr"> 23 </span> <span class="Delimiter">{</span>
|
||||
<span id="L24" class="LineNr"> 24 </span> <span class="PreProc">var</span> x/eax: int <span class="Special"><-</span> <a href='../501draw-text.mu.html#L106'>draw-text-rightward</a> <a href='../500fake-screen.mu.html#L16'>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="L25" class="LineNr"> 25 </span> <a href='../516read-line.mu.html#L3'>read-line-from-keyboard</a> keyboard, in, <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0xf</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L26" class="LineNr"> 26 </span> <span class="muComment"># parse and eval</span>
|
||||
<span id="L27" class="LineNr"> 27 </span> <span class="PreProc">var</span> out/eax: int <span class="Special"><-</span> <a href='rpn.mu.html#L43'>simplify</a> in
|
||||
<span id="L28" class="LineNr"> 28 </span> <span class="muComment"># print</span>
|
||||
<span id="L29" class="LineNr"> 29 </span> y <span class="Special"><-</span> increment
|
||||
<span id="L30" class="LineNr"> 30 </span> out, y <span class="Special"><-</span> <a href='../501draw-text.mu.html#L394'>draw-int32-decimal-wrapping-right-then-down</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, out, <span class="Constant">0</span>/xmin, y, <span class="Constant">0x80</span>/xmax, <span class="Constant">0x30</span>/ymax, <span class="Constant">0</span>/x, y, <span class="Constant">7</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L31" class="LineNr"> 31 </span> <span class="muComment"># newline</span>
|
||||
<span id="L32" class="LineNr"> 32 </span> y <span class="Special"><-</span> increment
|
||||
<span id="L33" class="LineNr"> 33 </span> <span class="muComment">#</span>
|
||||
<span id="L34" class="LineNr"> 34 </span> <span class="PreProc">loop</span>
|
||||
<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 id="L38" class="LineNr"> 38 </span><span class="PreProc">type</span> <a href='rpn.mu.html#L38'>int-stack</a> <span class="Delimiter">{</span>
|
||||
<span id="L39" class="LineNr"> 39 </span> data: (handle array int)
|
||||
<span id="L40" class="LineNr"> 40 </span> top: int
|
||||
<span id="L41" class="LineNr"> 41 </span><span class="Delimiter">}</span>
|
||||
<span id="L42" class="LineNr"> 42 </span>
|
||||
<span id="L43" class="LineNr"> 43 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='rpn.mu.html#L43'>simplify</a></span> in: (addr stream byte)<span class="PreProc"> -> </span>_/eax: int <span class="Delimiter">{</span>
|
||||
<span id="L44" class="LineNr"> 44 </span> <span class="PreProc">var</span> word-storage: slice
|
||||
<span id="L45" class="LineNr"> 45 </span> <span class="PreProc">var</span> word/<span class="muRegEcx">ecx</span>: (addr slice) <span class="Special"><-</span> address word-storage
|
||||
<span id="L46" class="LineNr"> 46 </span> <span class="PreProc">var</span> stack-storage: <a href='rpn.mu.html#L38'>int-stack</a>
|
||||
<span id="L47" class="LineNr"> 47 </span> <span class="PreProc">var</span> stack/<span class="muRegEsi">esi</span>: (addr <a href='rpn.mu.html#L38'>int-stack</a>) <span class="Special"><-</span> address stack-storage
|
||||
<span id="L48" class="LineNr"> 48 </span> <a href='rpn.mu.html#L97'>initialize-int-stack</a> stack, <span class="Constant">0x10</span>
|
||||
<span id="L49" class="LineNr"> 49 </span> $simplify:word-loop: <span class="Delimiter">{</span>
|
||||
<span id="L50" class="LineNr"> 50 </span> <a href='../127next-word.subx.html#L11'>next-word</a> in, word
|
||||
<span id="L51" class="LineNr"> 51 </span> <span class="PreProc">var</span> done?/eax: boolean <span class="Special"><-</span> <a href='../123slice.subx.html#L9'>slice-empty?</a> word
|
||||
<span id="L52" class="LineNr"> 52 </span> compare done?, <span class="Constant">0</span>
|
||||
<span id="L53" class="LineNr"> 53 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L54" class="LineNr"> 54 </span> <span class="muComment"># if word is an operator, perform it</span>
|
||||
<span id="L55" class="LineNr"> 55 </span> <span class="Delimiter">{</span>
|
||||
<span id="L56" class="LineNr"> 56 </span> <span class="PreProc">var</span> is-add?/eax: boolean <span class="Special"><-</span> <a href='../123slice.subx.html#L120'>slice-equal?</a> word, <span class="Constant">"+"</span>
|
||||
<span id="L57" class="LineNr"> 57 </span> compare is-add?, <span class="Constant">0</span>
|
||||
<span id="L58" class="LineNr"> 58 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L59" class="LineNr"> 59 </span> <span class="PreProc">var</span> _b/eax: int <span class="Special"><-</span> <a href='rpn.mu.html#L117'>pop-int-stack</a> stack
|
||||
<span id="L60" class="LineNr"> 60 </span> <span class="PreProc">var</span> b/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy _b
|
||||
<span id="L61" class="LineNr"> 61 </span> <span class="PreProc">var</span> a/eax: int <span class="Special"><-</span> <a href='rpn.mu.html#L117'>pop-int-stack</a> stack
|
||||
<span id="L62" class="LineNr"> 62 </span> a <span class="Special"><-</span> add b
|
||||
<span id="L63" class="LineNr"> 63 </span> <a href='rpn.mu.html#L105'>push-int-stack</a> stack, a
|
||||
<span id="L64" class="LineNr"> 64 </span> <span class="PreProc">loop</span> $simplify:word-loop
|
||||
<span id="L65" class="LineNr"> 65 </span> <span class="Delimiter">}</span>
|
||||
<span id="L66" class="LineNr"> 66 </span> <span class="Delimiter">{</span>
|
||||
<span id="L67" class="LineNr"> 67 </span> <span class="PreProc">var</span> is-sub?/eax: boolean <span class="Special"><-</span> <a href='../123slice.subx.html#L120'>slice-equal?</a> word, <span class="Constant">"-"</span>
|
||||
<span id="L68" class="LineNr"> 68 </span> compare is-sub?, <span class="Constant">0</span>
|
||||
<span id="L69" class="LineNr"> 69 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L70" class="LineNr"> 70 </span> <span class="PreProc">var</span> _b/eax: int <span class="Special"><-</span> <a href='rpn.mu.html#L117'>pop-int-stack</a> stack
|
||||
<span id="L71" class="LineNr"> 71 </span> <span class="PreProc">var</span> b/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy _b
|
||||
<span id="L72" class="LineNr"> 72 </span> <span class="PreProc">var</span> a/eax: int <span class="Special"><-</span> <a href='rpn.mu.html#L117'>pop-int-stack</a> stack
|
||||
<span id="L73" class="LineNr"> 73 </span> a <span class="Special"><-</span> subtract b
|
||||
<span id="L74" class="LineNr"> 74 </span> <a href='rpn.mu.html#L105'>push-int-stack</a> stack, a
|
||||
<span id="L75" class="LineNr"> 75 </span> <span class="PreProc">loop</span> $simplify:word-loop
|
||||
<span id="L76" class="LineNr"> 76 </span> <span class="Delimiter">}</span>
|
||||
<span id="L77" class="LineNr"> 77 </span> <span class="Delimiter">{</span>
|
||||
<span id="L78" class="LineNr"> 78 </span> <span class="PreProc">var</span> is-mul?/eax: boolean <span class="Special"><-</span> <a href='../123slice.subx.html#L120'>slice-equal?</a> word, <span class="Constant">"*"</span>
|
||||
<span id="L79" class="LineNr"> 79 </span> compare is-mul?, <span class="Constant">0</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> _b/eax: int <span class="Special"><-</span> <a href='rpn.mu.html#L117'>pop-int-stack</a> stack
|
||||
<span id="L82" class="LineNr"> 82 </span> <span class="PreProc">var</span> b/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy _b
|
||||
<span id="L83" class="LineNr"> 83 </span> <span class="PreProc">var</span> a/eax: int <span class="Special"><-</span> <a href='rpn.mu.html#L117'>pop-int-stack</a> stack
|
||||
<span id="L84" class="LineNr"> 84 </span> a <span class="Special"><-</span> multiply b
|
||||
<span id="L85" class="LineNr"> 85 </span> <a href='rpn.mu.html#L105'>push-int-stack</a> stack, a
|
||||
<span id="L86" class="LineNr"> 86 </span> <span class="PreProc">loop</span> $simplify:word-loop
|
||||
<span id="L87" class="LineNr"> 87 </span> <span class="Delimiter">}</span>
|
||||
<span id="L88" class="LineNr"> 88 </span> <span class="muComment"># otherwise it's an int</span>
|
||||
<span id="L89" class="LineNr"> 89 </span> <span class="PreProc">var</span> n/eax: int <span class="Special"><-</span> <a href='../311decimal-int.subx.html#L4'>parse-decimal-int-from-slice</a> word
|
||||
<span id="L90" class="LineNr"> 90 </span> <a href='rpn.mu.html#L105'>push-int-stack</a> stack, n
|
||||
<span id="L91" class="LineNr"> 91 </span> <span class="PreProc">loop</span>
|
||||
<span id="L92" class="LineNr"> 92 </span> <span class="Delimiter">}</span>
|
||||
<span id="L93" class="LineNr"> 93 </span> <span class="PreProc">var</span> result/eax: int <span class="Special"><-</span> <a href='rpn.mu.html#L117'>pop-int-stack</a> stack
|
||||
<span id="L94" class="LineNr"> 94 </span> <span class="PreProc">return</span> result
|
||||
<span id="L95" class="LineNr"> 95 </span><span class="Delimiter">}</span>
|
||||
<span id="L96" class="LineNr"> 96 </span>
|
||||
<span id="L97" class="LineNr"> 97 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='rpn.mu.html#L97'>initialize-int-stack</a></span> _self: (addr <a href='rpn.mu.html#L38'>int-stack</a>), n: int <span class="Delimiter">{</span>
|
||||
<span id="L98" class="LineNr"> 98 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='rpn.mu.html#L38'>int-stack</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L99" class="LineNr"> 99 </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="L100" class="LineNr">100 </span> populate d, n
|
||||
<span id="L101" class="LineNr">101 </span> <span class="PreProc">var</span> top/eax: (addr int) <span class="Special"><-</span> get self, top
|
||||
<span id="L102" class="LineNr">102 </span> copy-to *top, <span class="Constant">0</span>
|
||||
<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='rpn.mu.html#L105'>push-int-stack</a></span> _self: (addr <a href='rpn.mu.html#L38'>int-stack</a>), _val: int <span class="Delimiter">{</span>
|
||||
<span id="L106" class="LineNr">106 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='rpn.mu.html#L38'>int-stack</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L107" class="LineNr">107 </span> <span class="PreProc">var</span> top-addr/<span class="muRegEcx">ecx</span>: (addr int) <span class="Special"><-</span> get self, top
|
||||
<span id="L108" class="LineNr">108 </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="L109" class="LineNr">109 </span> <span class="PreProc">var</span> data/eax: (addr array int) <span class="Special"><-</span> <a href='../120allocate.subx.html#L235'>lookup</a> *data-ah
|
||||
<span id="L110" class="LineNr">110 </span> <span class="PreProc">var</span> top/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy *top-addr
|
||||
<span id="L111" class="LineNr">111 </span> <span class="PreProc">var</span> dest-addr/<span class="muRegEdx">edx</span>: (addr int) <span class="Special"><-</span> index data, top
|
||||
<span id="L112" class="LineNr">112 </span> <span class="PreProc">var</span> val/eax: int <span class="Special"><-</span> copy _val
|
||||
<span id="L113" class="LineNr">113 </span> copy-to *dest-addr, val
|
||||
<span id="L114" class="LineNr">114 </span> add-to *top-addr, <span class="Constant">1</span>
|
||||
<span id="L115" class="LineNr">115 </span><span class="Delimiter">}</span>
|
||||
<span id="L116" class="LineNr">116 </span>
|
||||
<span id="L117" class="LineNr">117 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='rpn.mu.html#L117'>pop-int-stack</a></span> _self: (addr <a href='rpn.mu.html#L38'>int-stack</a>)<span class="PreProc"> -> </span>_/eax: int <span class="Delimiter">{</span>
|
||||
<span id="L118" class="LineNr">118 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='rpn.mu.html#L38'>int-stack</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L119" class="LineNr">119 </span> <span class="PreProc">var</span> top-addr/<span class="muRegEcx">ecx</span>: (addr int) <span class="Special"><-</span> get self, top
|
||||
<span id="L120" class="LineNr">120 </span> <span class="Delimiter">{</span>
|
||||
<span id="L121" class="LineNr">121 </span> compare *top-addr, <span class="Constant">0</span>
|
||||
<span id="L122" class="LineNr">122 </span> <span class="PreProc">break-if-></span>
|
||||
<span id="L123" class="LineNr">123 </span> <span class="PreProc">return</span> <span class="Constant">0</span>
|
||||
<span id="L124" class="LineNr">124 </span> <span class="Delimiter">}</span>
|
||||
<span id="L125" class="LineNr">125 </span> subtract-from *top-addr, <span class="Constant">1</span>
|
||||
<span id="L126" class="LineNr">126 </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="L127" class="LineNr">127 </span> <span class="PreProc">var</span> data/eax: (addr array int) <span class="Special"><-</span> <a href='../120allocate.subx.html#L235'>lookup</a> *data-ah
|
||||
<span id="L128" class="LineNr">128 </span> <span class="PreProc">var</span> top/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy *top-addr
|
||||
<span id="L129" class="LineNr">129 </span> <span class="PreProc">var</span> dest-addr/<span class="muRegEdx">edx</span>: (addr int) <span class="Special"><-</span> index data, top
|
||||
<span id="L130" class="LineNr">130 </span> <span class="PreProc">var</span> val/eax: int <span class="Special"><-</span> copy _val
|
||||
<span id="L131" class="LineNr">131 </span> copy-to *dest-addr, val
|
||||
<span id="L132" class="LineNr">132 </span> add-to *top-addr, <span class="Constant">1</span>
|
||||
<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='rpn.mu.html#L135'>pop-int-stack</a></span> _self: (addr <a href='rpn.mu.html#L56'>int-stack</a>)<span class="PreProc"> -> </span>_/eax: int <span class="Delimiter">{</span>
|
||||
<span id="L136" class="LineNr">136 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='rpn.mu.html#L56'>int-stack</a>) <span class="Special"><-</span> copy _self
|
||||
<span id="L137" class="LineNr">137 </span> <span class="PreProc">var</span> top-addr/<span class="muRegEcx">ecx</span>: (addr int) <span class="Special"><-</span> get self, top
|
||||
<span id="L138" class="LineNr">138 </span> <span class="Delimiter">{</span>
|
||||
<span id="L139" class="LineNr">139 </span> compare *top-addr, <span class="Constant">0</span>
|
||||
<span id="L140" class="LineNr">140 </span> <span class="PreProc">break-if-></span>
|
||||
<span id="L141" class="LineNr">141 </span> <span class="PreProc">return</span> <span class="Constant">0</span>
|
||||
<span id="L142" class="LineNr">142 </span> <span class="Delimiter">}</span>
|
||||
<span id="L143" class="LineNr">143 </span> subtract-from *top-addr, <span class="Constant">1</span>
|
||||
<span id="L144" class="LineNr">144 </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="L145" class="LineNr">145 </span> <span class="PreProc">var</span> data/eax: (addr array int) <span class="Special"><-</span> <a href='../120allocate.subx.html#L235'>lookup</a> *data-ah
|
||||
<span id="L146" class="LineNr">146 </span> <span class="PreProc">var</span> top/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy *top-addr
|
||||
<span id="L147" class="LineNr">147 </span> <span class="PreProc">var</span> result-addr/eax: (addr int) <span class="Special"><-</span> index data, top
|
||||
<span id="L148" class="LineNr">148 </span> <span class="PreProc">var</span> val/eax: int <span class="Special"><-</span> copy *result-addr
|
||||
<span id="L149" class="LineNr">149 </span> <span class="PreProc">return</span> val
|
||||
<span id="L150" class="LineNr">150 </span><span class="Delimiter">}</span>
|
||||
<span id="L129" class="LineNr">129 </span> <span class="PreProc">var</span> result-addr/eax: (addr int) <span class="Special"><-</span> index data, top
|
||||
<span id="L130" class="LineNr">130 </span> <span class="PreProc">var</span> val/eax: int <span class="Special"><-</span> copy *result-addr
|
||||
<span id="L131" class="LineNr">131 </span> <span class="PreProc">return</span> val
|
||||
<span id="L132" class="LineNr">132 </span><span class="Delimiter">}</span>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -198,15 +198,15 @@ if ('onhashchange' in window) {
|
|||
<span id="L134" class="LineNr"> 134 </span> <span class="Delimiter">{</span>
|
||||
<span id="L135" class="LineNr"> 135 </span> compare cursor-index, i
|
||||
<span id="L136" class="LineNr"> 136 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L137" class="LineNr"> 137 </span> <a href='../501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"#"</span>, <span class="Constant">7</span>/grey <span class="Constant">0</span>/black
|
||||
<span id="L138" class="LineNr"> 138 </span> <a href='../501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, name, <span class="Constant">7</span>/grey <span class="Constant">0</span>/black
|
||||
<span id="L137" class="LineNr"> 137 </span> <a href='../501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"#"</span>, <span class="Constant">7</span>/grey <span class="Constant">0</span>/black
|
||||
<span id="L138" class="LineNr"> 138 </span> <a href='../501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, name, <span class="Constant">7</span>/grey <span class="Constant">0</span>/black
|
||||
<span id="L139" class="LineNr"> 139 </span> <span class="Delimiter">}</span>
|
||||
<span id="L140" class="LineNr"> 140 </span> <span class="Delimiter">{</span>
|
||||
<span id="L141" class="LineNr"> 141 </span> compare cursor-index, i
|
||||
<span id="L142" class="LineNr"> 142 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L143" class="LineNr"> 143 </span> <span class="muComment"># cursor; reverse video</span>
|
||||
<span id="L144" class="LineNr"> 144 </span> <a href='../501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"#"</span>, <span class="Constant">0</span>/black <span class="Constant">0xf</span>/white
|
||||
<span id="L145" class="LineNr"> 145 </span> <a href='../501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, name, <span class="Constant">0</span>/black <span class="Constant">0xf</span>/white
|
||||
<span id="L144" class="LineNr"> 144 </span> <a href='../501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"#"</span>, <span class="Constant">0</span>/black <span class="Constant">0xf</span>/white
|
||||
<span id="L145" class="LineNr"> 145 </span> <a href='../501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, name, <span class="Constant">0</span>/black <span class="Constant">0xf</span>/white
|
||||
<span id="L146" class="LineNr"> 146 </span> <span class="Delimiter">}</span>
|
||||
<span id="L147" class="LineNr"> 147 </span> y <span class="Special"><-</span> add <span class="Constant">2</span>/channel-padding
|
||||
<span id="L148" class="LineNr"> 148 </span> i <span class="Special"><-</span> increment
|
||||
|
@ -325,7 +325,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L261" class="LineNr"> 261 </span> <span class="PreProc">var</span> i/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> copy *current-channel-first-channel-item-addr
|
||||
<span id="L262" class="LineNr"> 262 </span> <span class="PreProc">var</span> current-channel-posts-first-free-addr/eax: (addr int) <span class="Special"><-</span> get current-channel, posts-first-free
|
||||
<span id="L263" class="LineNr"> 263 </span> <a href='../500fake-screen.mu.html#L269'>set-cursor-position</a> <span class="Constant">0</span>/screen, <span class="Constant">0x68</span>/x <span class="Constant">0</span>/y
|
||||
<span id="L264" class="LineNr"> 264 </span> <a href='../501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"channel"</span>, <span class="Constant">7</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L264" class="LineNr"> 264 </span> <a href='../501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"channel"</span>, <span class="Constant">7</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L265" class="LineNr"> 265 </span> <a href='environment.mu.html#L368'>render-progress</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, i, *current-channel-posts-first-free-addr
|
||||
<span id="L266" class="LineNr"> 266 </span> <span class="PreProc">var</span> items-data-ah/eax: (addr handle array <a href='main.mu.html#L14'>item</a>) <span class="Special"><-</span> get items, data
|
||||
<span id="L267" class="LineNr"> 267 </span> <span class="PreProc">var</span> _items-data/eax: (addr array <a href='main.mu.html#L14'>item</a>) <span class="Special"><-</span> <a href='../120allocate.subx.html#L235'>lookup</a> *items-data-ah
|
||||
|
@ -359,13 +359,13 @@ if ('onhashchange' in window) {
|
|||
<span id="L295" class="LineNr"> 295 </span> <span class="PreProc">var</span> i/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy *current-tab-top-item-addr
|
||||
<span id="L296" class="LineNr"> 296 </span> <span class="PreProc">var</span> current-tab-search-items-first-free-addr/eax: (addr int) <span class="Special"><-</span> get current-tab, search-items-first-free
|
||||
<span id="L297" class="LineNr"> 297 </span> <a href='../500fake-screen.mu.html#L269'>set-cursor-position</a> <span class="Constant">0</span>/screen, <span class="Constant">0x68</span>/x <span class="Constant">0</span>/y
|
||||
<span id="L298" class="LineNr"> 298 </span> <a href='../501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"search"</span>, <span class="Constant">7</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L298" class="LineNr"> 298 </span> <a href='../501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"search"</span>, <span class="Constant">7</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L299" class="LineNr"> 299 </span> <a href='environment.mu.html#L368'>render-progress</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, i, *current-tab-search-items-first-free-addr
|
||||
<span id="L300" class="LineNr"> 300 </span> <span class="Delimiter">{</span>
|
||||
<span id="L301" class="LineNr"> 301 </span> compare *current-tab-search-items-first-free-addr, <span class="Constant">0x100</span>/max-search-results
|
||||
<span id="L302" class="LineNr"> 302 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L303" class="LineNr"> 303 </span> <a href='../500fake-screen.mu.html#L269'>set-cursor-position</a> <span class="Constant">0</span>/screen, <span class="Constant">0x68</span>/x <span class="Constant">1</span>/y
|
||||
<span id="L304" class="LineNr"> 304 </span> <a href='../501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"too many results"</span>, <span class="Constant">4</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L304" class="LineNr"> 304 </span> <a href='../501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"too many results"</span>, <span class="Constant">4</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L305" class="LineNr"> 305 </span> <span class="Delimiter">}</span>
|
||||
<span id="L306" class="LineNr"> 306 </span> <span class="PreProc">var</span> items-data-ah/eax: (addr handle array <a href='main.mu.html#L14'>item</a>) <span class="Special"><-</span> get items, data
|
||||
<span id="L307" class="LineNr"> 307 </span> <span class="PreProc">var</span> _items-data/eax: (addr array <a href='main.mu.html#L14'>item</a>) <span class="Special"><-</span> <a href='../120allocate.subx.html#L235'>lookup</a> *items-data-ah
|
||||
|
@ -403,7 +403,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L339" class="LineNr"> 339 </span> <span class="PreProc">var</span> i/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy *current-tab-top-item-addr
|
||||
<span id="L340" class="LineNr"> 340 </span> <span class="PreProc">var</span> post-comments-first-free-addr/eax: (addr int) <span class="Special"><-</span> get post, comments-first-free
|
||||
<span id="L341" class="LineNr"> 341 </span> <a href='../500fake-screen.mu.html#L269'>set-cursor-position</a> <span class="Constant">0</span>/screen, <span class="Constant">0x68</span>/x <span class="Constant">0</span>/y
|
||||
<span id="L342" class="LineNr"> 342 </span> <a href='../501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"thread"</span>, <span class="Constant">7</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L342" class="LineNr"> 342 </span> <a href='../501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"thread"</span>, <span class="Constant">7</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L343" class="LineNr"> 343 </span> <a href='environment.mu.html#L368'>render-progress</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, i, *post-comments-first-free-addr
|
||||
<span id="L344" class="LineNr"> 344 </span> <span class="PreProc">var</span> post-comments-ah/eax: (addr handle array int) <span class="Special"><-</span> get post, comments
|
||||
<span id="L345" class="LineNr"> 345 </span> <span class="PreProc">var</span> post-comments/eax: (addr array int) <span class="Special"><-</span> <a href='../120allocate.subx.html#L235'>lookup</a> *post-comments-ah
|
||||
|
@ -433,16 +433,16 @@ if ('onhashchange' in window) {
|
|||
<span id="L369" class="LineNr"> 369 </span> <a href='../500fake-screen.mu.html#L269'>set-cursor-position</a> <span class="Constant">0</span>/screen, <span class="Constant">0x70</span>/x <span class="Constant">0</span>/y
|
||||
<span id="L370" class="LineNr"> 370 </span> <span class="PreProc">var</span> top-index/eax: int <span class="Special"><-</span> copy max
|
||||
<span id="L371" class="LineNr"> 371 </span> top-index <span class="Special"><-</span> subtract curr <span class="muComment"># happy accident: 1-based</span>
|
||||
<span id="L372" class="LineNr"> 372 </span> <a href='../501draw-text.mu.html#L449'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, top-index, <span class="Constant">7</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L373" class="LineNr"> 373 </span> <a href='../501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"/"</span>, <span class="Constant">7</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L374" class="LineNr"> 374 </span> <a href='../501draw-text.mu.html#L449'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, max, <span class="Constant">7</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L372" class="LineNr"> 372 </span> <a href='../501draw-text.mu.html#L442'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, top-index, <span class="Constant">7</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L373" class="LineNr"> 373 </span> <a href='../501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"/"</span>, <span class="Constant">7</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L374" class="LineNr"> 374 </span> <a href='../501draw-text.mu.html#L442'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, max, <span class="Constant">7</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L375" class="LineNr"> 375 </span><span class="Delimiter">}</span>
|
||||
<span id="L376" class="LineNr"> 376 </span>
|
||||
<span id="L377" class="LineNr"> 377 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='environment.mu.html#L377'>render-search-input</a></span> <a href='../500fake-screen.mu.html#L16'>screen</a>: (addr <a href='../500fake-screen.mu.html#L16'>screen</a>), _env: (addr <a href='environment.mu.html#L1'>environment</a>) <span class="Delimiter">{</span>
|
||||
<span id="L378" class="LineNr"> 378 </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> copy _env
|
||||
<span id="L379" class="LineNr"> 379 </span> <span class="PreProc">var</span> cursor-in-search?/<span class="muRegEcx">ecx</span>: (addr boolean) <span class="Special"><-</span> get env, cursor-in-search?
|
||||
<span id="L380" class="LineNr"> 380 </span> <a href='../500fake-screen.mu.html#L269'>set-cursor-position</a> <span class="Constant">0</span>/screen, <span class="Constant">0x22</span>/x=search-position-x <span class="Constant">1</span>/y
|
||||
<span id="L381" class="LineNr"> 381 </span> <a href='../501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"search "</span>, <span class="Constant">7</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L381" class="LineNr"> 381 </span> <a href='../501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"search "</span>, <span class="Constant">7</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L382" class="LineNr"> 382 </span> <span class="PreProc">var</span> search-terms-ah/eax: (addr handle <a href='../514gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special"><-</span> get env, search-terms
|
||||
<span id="L383" class="LineNr"> 383 </span> <span class="PreProc">var</span> search-terms/eax: (addr <a href='../514gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special"><-</span> <a href='../120allocate.subx.html#L235'>lookup</a> *search-terms-ah
|
||||
<span id="L384" class="LineNr"> 384 </span> <a href='../514gap-buffer.mu.html#L1014'>rewind-gap-buffer</a> search-terms
|
||||
|
@ -451,7 +451,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L387" class="LineNr"> 387 </span> compare x, <span class="Constant">0x4a</span>/end-search
|
||||
<span id="L388" class="LineNr"> 388 </span> <span class="PreProc">break-if-></span>
|
||||
<span id="L389" class="LineNr"> 389 </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="L390" class="LineNr"> 390 </span> x, y <span class="Special"><-</span> <a href='../501draw-text.mu.html#L162'>render-code-point</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x5f</span>/underscore, <span class="Constant">0</span>/xmin <span class="Constant">1</span>/ymin, <span class="Constant">0x80</span>/xmax, <span class="Constant">1</span>/ymax, x, <span class="Constant">1</span>/y, <span class="Constant">0xf</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L390" class="LineNr"> 390 </span> x, y <span class="Special"><-</span> <a href='../501draw-text.mu.html#L155'>render-code-point</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x5f</span>/underscore, <span class="Constant">0</span>/xmin <span class="Constant">1</span>/ymin, <span class="Constant">0x80</span>/xmax, <span class="Constant">1</span>/ymax, x, <span class="Constant">1</span>/y, <span class="Constant">0xf</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L391" class="LineNr"> 391 </span> <span class="PreProc">loop</span>
|
||||
<span id="L392" class="LineNr"> 392 </span> <span class="Delimiter">}</span>
|
||||
<span id="L393" class="LineNr"> 393 </span><span class="Delimiter">}</span>
|
||||
|
@ -487,30 +487,30 @@ if ('onhashchange' in window) {
|
|||
<span id="L423" class="LineNr"> 423 </span> <span class="PreProc">var</span> num-tabs/<span class="muRegEdi">edi</span>: (addr int) <span class="Special"><-</span> get env, current-tab-index
|
||||
<span id="L424" class="LineNr"> 424 </span> compare *num-tabs, <span class="Constant">0</span>
|
||||
<span id="L425" class="LineNr"> 425 </span> <span class="PreProc">break-if-<=</span>
|
||||
<span id="L426" class="LineNr"> 426 </span> <a href='../501draw-text.mu.html#L147'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" Esc "</span>, width, <span class="Constant">0</span>/fg <span class="Constant">0xf</span>/bg
|
||||
<span id="L427" class="LineNr"> 427 </span> <a href='../501draw-text.mu.html#L147'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" go back "</span>, width, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L426" class="LineNr"> 426 </span> <a href='../501draw-text.mu.html#L140'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" Esc "</span>, width, <span class="Constant">0</span>/fg <span class="Constant">0xf</span>/bg
|
||||
<span id="L427" class="LineNr"> 427 </span> <a href='../501draw-text.mu.html#L140'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" go back "</span>, width, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L428" class="LineNr"> 428 </span> <span class="Delimiter">}</span>
|
||||
<span id="L429" class="LineNr"> 429 </span> <a href='../501draw-text.mu.html#L147'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" / "</span>, width, <span class="Constant">0</span>/fg <span class="Constant">0xf</span>/bg
|
||||
<span id="L430" class="LineNr"> 430 </span> <a href='../501draw-text.mu.html#L147'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" search "</span>, width, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L431" class="LineNr"> 431 </span> <a href='../501draw-text.mu.html#L147'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" Tab "</span>, width, <span class="Constant">0</span>/fg <span class="Constant">0xf</span>/bg
|
||||
<span id="L432" class="LineNr"> 432 </span> <a href='../501draw-text.mu.html#L147'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" go to channels "</span>, width, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L433" class="LineNr"> 433 </span> <a href='../501draw-text.mu.html#L147'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" Enter "</span>, width, <span class="Constant">0</span>/fg <span class="Constant">0xf</span>/bg
|
||||
<span id="L434" class="LineNr"> 434 </span> <a href='../501draw-text.mu.html#L147'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" go to thread "</span>, width, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L429" class="LineNr"> 429 </span> <a href='../501draw-text.mu.html#L140'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" / "</span>, width, <span class="Constant">0</span>/fg <span class="Constant">0xf</span>/bg
|
||||
<span id="L430" class="LineNr"> 430 </span> <a href='../501draw-text.mu.html#L140'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" search "</span>, width, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L431" class="LineNr"> 431 </span> <a href='../501draw-text.mu.html#L140'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" Tab "</span>, width, <span class="Constant">0</span>/fg <span class="Constant">0xf</span>/bg
|
||||
<span id="L432" class="LineNr"> 432 </span> <a href='../501draw-text.mu.html#L140'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" go to channels "</span>, width, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L433" class="LineNr"> 433 </span> <a href='../501draw-text.mu.html#L140'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" Enter "</span>, width, <span class="Constant">0</span>/fg <span class="Constant">0xf</span>/bg
|
||||
<span id="L434" class="LineNr"> 434 </span> <a href='../501draw-text.mu.html#L140'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" go to thread "</span>, width, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L435" class="LineNr"> 435 </span> <span class="Delimiter">{</span>
|
||||
<span id="L436" class="LineNr"> 436 </span> <span class="Delimiter">{</span>
|
||||
<span id="L437" class="LineNr"> 437 </span> <span class="PreProc">var</span> is-all-items-or-channel?/eax: boolean <span class="Special"><-</span> <a href='environment.mu.html#L945'>current-tab-is-all-items-or-channel?</a> _env
|
||||
<span id="L438" class="LineNr"> 438 </span> compare is-all-items-or-channel?, <span class="Constant">0</span>/false
|
||||
<span id="L439" class="LineNr"> 439 </span> <span class="Delimiter">}</span>
|
||||
<span id="L440" class="LineNr"> 440 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L441" class="LineNr"> 441 </span> <a href='../501draw-text.mu.html#L147'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" ^h "</span>, width, <span class="Constant">0</span>/fg <span class="Constant">0xf</span>/bg
|
||||
<span id="L442" class="LineNr"> 442 </span> <a href='../501draw-text.mu.html#L147'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" hide thread "</span>, width, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L443" class="LineNr"> 443 </span> <a href='../501draw-text.mu.html#L147'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" ^u "</span>, width, <span class="Constant">0</span>/fg <span class="Constant">0xf</span>/bg
|
||||
<span id="L444" class="LineNr"> 444 </span> <a href='../501draw-text.mu.html#L147'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" unhide all "</span>, width, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L441" class="LineNr"> 441 </span> <a href='../501draw-text.mu.html#L140'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" ^h "</span>, width, <span class="Constant">0</span>/fg <span class="Constant">0xf</span>/bg
|
||||
<span id="L442" class="LineNr"> 442 </span> <a href='../501draw-text.mu.html#L140'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" hide thread "</span>, width, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L443" class="LineNr"> 443 </span> <a href='../501draw-text.mu.html#L140'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" ^u "</span>, width, <span class="Constant">0</span>/fg <span class="Constant">0xf</span>/bg
|
||||
<span id="L444" class="LineNr"> 444 </span> <a href='../501draw-text.mu.html#L140'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" unhide all "</span>, width, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L445" class="LineNr"> 445 </span> <span class="Delimiter">}</span>
|
||||
<span id="L446" class="LineNr"> 446 </span> <a href='../501draw-text.mu.html#L147'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" ^b "</span>, width, <span class="Constant">0</span>/fg <span class="Constant">0xf</span>/bg
|
||||
<span id="L447" class="LineNr"> 447 </span> <a href='../501draw-text.mu.html#L147'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" << page "</span>, width, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L448" class="LineNr"> 448 </span> <a href='../501draw-text.mu.html#L147'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" ^f "</span>, width, <span class="Constant">0</span>/fg <span class="Constant">0xf</span>/bg
|
||||
<span id="L449" class="LineNr"> 449 </span> <a href='../501draw-text.mu.html#L147'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" page >> "</span>, width, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L446" class="LineNr"> 446 </span> <a href='../501draw-text.mu.html#L140'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" ^b "</span>, width, <span class="Constant">0</span>/fg <span class="Constant">0xf</span>/bg
|
||||
<span id="L447" class="LineNr"> 447 </span> <a href='../501draw-text.mu.html#L140'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" << page "</span>, width, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L448" class="LineNr"> 448 </span> <a href='../501draw-text.mu.html#L140'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" ^f "</span>, width, <span class="Constant">0</span>/fg <span class="Constant">0xf</span>/bg
|
||||
<span id="L449" class="LineNr"> 449 </span> <a href='../501draw-text.mu.html#L140'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" page >> "</span>, width, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L450" class="LineNr"> 450 </span><span class="Delimiter">}</span>
|
||||
<span id="L451" class="LineNr"> 451 </span>
|
||||
<span id="L452" class="LineNr"> 452 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='environment.mu.html#L452'>render-channels-menu</a></span> <a href='../500fake-screen.mu.html#L16'>screen</a>: (addr <a href='../500fake-screen.mu.html#L16'>screen</a>), _env: (addr <a href='environment.mu.html#L1'>environment</a>) <span class="Delimiter">{</span>
|
||||
|
@ -524,15 +524,15 @@ if ('onhashchange' in window) {
|
|||
<span id="L460" class="LineNr"> 460 </span> <span class="PreProc">var</span> num-tabs/<span class="muRegEdi">edi</span>: (addr int) <span class="Special"><-</span> get env, current-tab-index
|
||||
<span id="L461" class="LineNr"> 461 </span> compare *num-tabs, <span class="Constant">0</span>
|
||||
<span id="L462" class="LineNr"> 462 </span> <span class="PreProc">break-if-<=</span>
|
||||
<span id="L463" class="LineNr"> 463 </span> <a href='../501draw-text.mu.html#L147'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" Esc "</span>, width, <span class="Constant">0</span>/fg <span class="Constant">0xf</span>/bg
|
||||
<span id="L464" class="LineNr"> 464 </span> <a href='../501draw-text.mu.html#L147'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" go back "</span>, width, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L463" class="LineNr"> 463 </span> <a href='../501draw-text.mu.html#L140'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" Esc "</span>, width, <span class="Constant">0</span>/fg <span class="Constant">0xf</span>/bg
|
||||
<span id="L464" class="LineNr"> 464 </span> <a href='../501draw-text.mu.html#L140'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" go back "</span>, width, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L465" class="LineNr"> 465 </span> <span class="Delimiter">}</span>
|
||||
<span id="L466" class="LineNr"> 466 </span> <a href='../501draw-text.mu.html#L147'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" / "</span>, width, <span class="Constant">0</span>/fg <span class="Constant">0xf</span>/bg
|
||||
<span id="L467" class="LineNr"> 467 </span> <a href='../501draw-text.mu.html#L147'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" search "</span>, width, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L468" class="LineNr"> 468 </span> <a href='../501draw-text.mu.html#L147'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" Tab "</span>, width, <span class="Constant">0</span>/fg <span class="Constant">0xf</span>/bg
|
||||
<span id="L469" class="LineNr"> 469 </span> <a href='../501draw-text.mu.html#L147'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" go to items "</span>, width, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L470" class="LineNr"> 470 </span> <a href='../501draw-text.mu.html#L147'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" Enter "</span>, width, <span class="Constant">0</span>/fg <span class="Constant">0xf</span>/bg
|
||||
<span id="L471" class="LineNr"> 471 </span> <a href='../501draw-text.mu.html#L147'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" select "</span>, width, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L466" class="LineNr"> 466 </span> <a href='../501draw-text.mu.html#L140'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" / "</span>, width, <span class="Constant">0</span>/fg <span class="Constant">0xf</span>/bg
|
||||
<span id="L467" class="LineNr"> 467 </span> <a href='../501draw-text.mu.html#L140'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" search "</span>, width, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L468" class="LineNr"> 468 </span> <a href='../501draw-text.mu.html#L140'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" Tab "</span>, width, <span class="Constant">0</span>/fg <span class="Constant">0xf</span>/bg
|
||||
<span id="L469" class="LineNr"> 469 </span> <a href='../501draw-text.mu.html#L140'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" go to items "</span>, width, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L470" class="LineNr"> 470 </span> <a href='../501draw-text.mu.html#L140'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" Enter "</span>, width, <span class="Constant">0</span>/fg <span class="Constant">0xf</span>/bg
|
||||
<span id="L471" class="LineNr"> 471 </span> <a href='../501draw-text.mu.html#L140'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" select "</span>, width, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<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="muFunction"><a href='environment.mu.html#L474'>render-search-menu</a></span> <a href='../500fake-screen.mu.html#L16'>screen</a>: (addr <a href='../500fake-screen.mu.html#L16'>screen</a>), _env: (addr <a href='environment.mu.html#L1'>environment</a>) <span class="Delimiter">{</span>
|
||||
|
@ -541,20 +541,20 @@ if ('onhashchange' in window) {
|
|||
<span id="L477" class="LineNr"> 477 </span> width, y <span class="Special"><-</span> <a href='../500fake-screen.mu.html#L75'>screen-size</a> <a href='../500fake-screen.mu.html#L16'>screen</a>
|
||||
<span id="L478" class="LineNr"> 478 </span> y <span class="Special"><-</span> decrement
|
||||
<span id="L479" class="LineNr"> 479 </span> <a href='../500fake-screen.mu.html#L269'>set-cursor-position</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">2</span>/x, y
|
||||
<span id="L480" class="LineNr"> 480 </span> <a href='../501draw-text.mu.html#L147'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" Esc "</span>, width, <span class="Constant">0</span>/fg <span class="Constant">0xf</span>/bg
|
||||
<span id="L481" class="LineNr"> 481 </span> <a href='../501draw-text.mu.html#L147'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" cancel "</span>, width, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L482" class="LineNr"> 482 </span> <a href='../501draw-text.mu.html#L147'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" Enter "</span>, width, <span class="Constant">0</span>/fg <span class="Constant">0xf</span>/bg
|
||||
<span id="L483" class="LineNr"> 483 </span> <a href='../501draw-text.mu.html#L147'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" select "</span>, width, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L484" class="LineNr"> 484 </span> <a href='../501draw-text.mu.html#L147'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" ^a "</span>, width, <span class="Constant">0</span>/fg, <span class="Constant">0xf</span>/bg
|
||||
<span id="L485" class="LineNr"> 485 </span> <a href='../501draw-text.mu.html#L147'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" << "</span>, width, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L486" class="LineNr"> 486 </span> <a href='../501draw-text.mu.html#L147'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" ^b "</span>, width, <span class="Constant">0</span>/fg, <span class="Constant">0xf</span>/bg
|
||||
<span id="L487" class="LineNr"> 487 </span> <a href='../501draw-text.mu.html#L147'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" <word "</span>, width, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L488" class="LineNr"> 488 </span> <a href='../501draw-text.mu.html#L147'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" ^f "</span>, width, <span class="Constant">0</span>/fg, <span class="Constant">0xf</span>/bg
|
||||
<span id="L489" class="LineNr"> 489 </span> <a href='../501draw-text.mu.html#L147'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" word> "</span>, width, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L490" class="LineNr"> 490 </span> <a href='../501draw-text.mu.html#L147'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" ^e "</span>, width, <span class="Constant">0</span>/fg, <span class="Constant">0xf</span>/bg
|
||||
<span id="L491" class="LineNr"> 491 </span> <a href='../501draw-text.mu.html#L147'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" >> "</span>, width, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L492" class="LineNr"> 492 </span> <a href='../501draw-text.mu.html#L147'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" ^u "</span>, width, <span class="Constant">0</span>/fg, <span class="Constant">0xf</span>/bg
|
||||
<span id="L493" class="LineNr"> 493 </span> <a href='../501draw-text.mu.html#L147'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" clear "</span>, width, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L480" class="LineNr"> 480 </span> <a href='../501draw-text.mu.html#L140'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" Esc "</span>, width, <span class="Constant">0</span>/fg <span class="Constant">0xf</span>/bg
|
||||
<span id="L481" class="LineNr"> 481 </span> <a href='../501draw-text.mu.html#L140'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" cancel "</span>, width, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L482" class="LineNr"> 482 </span> <a href='../501draw-text.mu.html#L140'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" Enter "</span>, width, <span class="Constant">0</span>/fg <span class="Constant">0xf</span>/bg
|
||||
<span id="L483" class="LineNr"> 483 </span> <a href='../501draw-text.mu.html#L140'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" select "</span>, width, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L484" class="LineNr"> 484 </span> <a href='../501draw-text.mu.html#L140'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" ^a "</span>, width, <span class="Constant">0</span>/fg, <span class="Constant">0xf</span>/bg
|
||||
<span id="L485" class="LineNr"> 485 </span> <a href='../501draw-text.mu.html#L140'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" << "</span>, width, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L486" class="LineNr"> 486 </span> <a href='../501draw-text.mu.html#L140'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" ^b "</span>, width, <span class="Constant">0</span>/fg, <span class="Constant">0xf</span>/bg
|
||||
<span id="L487" class="LineNr"> 487 </span> <a href='../501draw-text.mu.html#L140'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" <word "</span>, width, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L488" class="LineNr"> 488 </span> <a href='../501draw-text.mu.html#L140'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" ^f "</span>, width, <span class="Constant">0</span>/fg, <span class="Constant">0xf</span>/bg
|
||||
<span id="L489" class="LineNr"> 489 </span> <a href='../501draw-text.mu.html#L140'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" word> "</span>, width, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L490" class="LineNr"> 490 </span> <a href='../501draw-text.mu.html#L140'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" ^e "</span>, width, <span class="Constant">0</span>/fg, <span class="Constant">0xf</span>/bg
|
||||
<span id="L491" class="LineNr"> 491 </span> <a href='../501draw-text.mu.html#L140'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" >> "</span>, width, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L492" class="LineNr"> 492 </span> <a href='../501draw-text.mu.html#L140'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" ^u "</span>, width, <span class="Constant">0</span>/fg, <span class="Constant">0xf</span>/bg
|
||||
<span id="L493" class="LineNr"> 493 </span> <a href='../501draw-text.mu.html#L140'>draw-text-rightward-from-cursor</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" clear "</span>, width, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L494" class="LineNr"> 494 </span><span class="Delimiter">}</span>
|
||||
<span id="L495" class="LineNr"> 495 </span>
|
||||
<span id="L496" class="LineNr"> 496 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='environment.mu.html#L496'>render-item</a></span> <a href='../500fake-screen.mu.html#L16'>screen</a>: (addr <a href='../500fake-screen.mu.html#L16'>screen</a>), _item: (addr <a href='main.mu.html#L14'>item</a>), _users: (addr array <a href='main.mu.html#L7'>user</a>), show-cursor?: boolean, y: int, screen-height: int<span class="PreProc"> -> </span>_/<span class="muRegEcx">ecx</span>: int <span class="Delimiter">{</span>
|
||||
|
@ -586,8 +586,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L522" class="LineNr"> 522 </span> x <span class="Special"><-</span> add <span class="Constant">0x40</span>/channel-offset-x
|
||||
<span id="L523" class="LineNr"> 523 </span> <a href='../500fake-screen.mu.html#L269'>set-cursor-position</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, x y
|
||||
<span id="L524" class="LineNr"> 524 </span> <span class="Delimiter">}</span>
|
||||
<span id="L525" class="LineNr"> 525 </span> <a href='../501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"#"</span>, <span class="Constant">7</span>/grey <span class="Constant">0</span>/black
|
||||
<span id="L526" class="LineNr"> 526 </span> <a href='../501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, channel-name, <span class="Constant">7</span>/grey <span class="Constant">0</span>/black
|
||||
<span id="L525" class="LineNr"> 525 </span> <a href='../501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"#"</span>, <span class="Constant">7</span>/grey <span class="Constant">0</span>/black
|
||||
<span id="L526" class="LineNr"> 526 </span> <a href='../501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, channel-name, <span class="Constant">7</span>/grey <span class="Constant">0</span>/black
|
||||
<span id="L527" class="LineNr"> 527 </span> <span class="muComment"># author name</span>
|
||||
<span id="L528" class="LineNr"> 528 </span> <span class="Delimiter">{</span>
|
||||
<span id="L529" class="LineNr"> 529 </span> <span class="PreProc">var</span> author-real-name-ah/eax: (addr handle array byte) <span class="Special"><-</span> get author, real-name
|
||||
|
@ -595,7 +595,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L531" class="LineNr"> 531 </span> <span class="PreProc">var</span> x/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0x20</span>/main-panel-hor
|
||||
<span id="L532" class="LineNr"> 532 </span> x <span class="Special"><-</span> add <span class="Constant">0x10</span>/avatar-space-hor
|
||||
<span id="L533" class="LineNr"> 533 </span> <a href='../500fake-screen.mu.html#L269'>set-cursor-position</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, x y
|
||||
<span id="L534" class="LineNr"> 534 </span> <a href='../501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, author-real-name, <span class="Constant">0xf</span>/white <span class="Constant">0</span>/black
|
||||
<span id="L534" class="LineNr"> 534 </span> <a href='../501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, author-real-name, <span class="Constant">0xf</span>/white <span class="Constant">0</span>/black
|
||||
<span id="L535" class="LineNr"> 535 </span> <span class="Delimiter">}</span>
|
||||
<span id="L536" class="LineNr"> 536 </span> increment y
|
||||
<span id="L537" class="LineNr"> 537 </span> <span class="muComment"># text</span>
|
||||
|
@ -679,12 +679,12 @@ if ('onhashchange' in window) {
|
|||
<span id="L615" class="LineNr"> 615 </span> <span class="Delimiter">}</span>
|
||||
<span id="L616" class="LineNr"> 616 </span> compare c, <span class="Constant">0xffffffff</span>/end-of-file
|
||||
<span id="L617" class="LineNr"> 617 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L618" class="LineNr"> 618 </span> $draw-json-stream-wrapping-right-then-down:render-grapheme: <span class="Delimiter">{</span>
|
||||
<span id="L618" class="LineNr"> 618 </span> $draw-json-stream-wrapping-right-then-down:render-code-point-utf8: <span class="Delimiter">{</span>
|
||||
<span id="L619" class="LineNr"> 619 </span> compare c, <span class="Constant">0x5c</span>/backslash
|
||||
<span id="L620" class="LineNr"> 620 </span> <span class="Delimiter">{</span>
|
||||
<span id="L621" class="LineNr"> 621 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L622" class="LineNr"> 622 </span> xcurr, ycurr <span class="Special"><-</span> <a href='environment.mu.html#L682'>render-json-escaped-code-point</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, stream, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color
|
||||
<span id="L623" class="LineNr"> 623 </span> <span class="PreProc">break</span> $draw-json-stream-wrapping-right-then-down:render-grapheme
|
||||
<span id="L623" class="LineNr"> 623 </span> <span class="PreProc">break</span> $draw-json-stream-wrapping-right-then-down:render-code-point-utf8
|
||||
<span id="L624" class="LineNr"> 624 </span> <span class="Delimiter">}</span>
|
||||
<span id="L625" class="LineNr"> 625 </span> compare c, <span class="Constant">0xa</span>/newline
|
||||
<span id="L626" class="LineNr"> 626 </span> <span class="Delimiter">{</span>
|
||||
|
@ -693,7 +693,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L629" class="LineNr"> 629 </span> <span class="PreProc">var</span> dummy/eax: int <span class="Special"><-</span> <a href='../500fake-screen.mu.html#L94'>draw-code-point</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x20</span>/space, xcurr, ycurr, color, background-color
|
||||
<span id="L630" class="LineNr"> 630 </span> xcurr <span class="Special"><-</span> copy xmin
|
||||
<span id="L631" class="LineNr"> 631 </span> ycurr <span class="Special"><-</span> increment
|
||||
<span id="L632" class="LineNr"> 632 </span> <span class="PreProc">break</span> $draw-json-stream-wrapping-right-then-down:render-grapheme
|
||||
<span id="L632" class="LineNr"> 632 </span> <span class="PreProc">break</span> $draw-json-stream-wrapping-right-then-down:render-code-point-utf8
|
||||
<span id="L633" class="LineNr"> 633 </span> <span class="Delimiter">}</span>
|
||||
<span id="L634" class="LineNr"> 634 </span> <span class="PreProc">var</span> offset/eax: int <span class="Special"><-</span> <a href='../500fake-screen.mu.html#L94'>draw-code-point</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, c, xcurr, ycurr, color, background-color
|
||||
<span id="L635" class="LineNr"> 635 </span> <span class="muComment"># overlay a combining character if necessary</span>
|
||||
|
@ -703,8 +703,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L639" class="LineNr"> 639 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L640" class="LineNr"> 640 </span> <span class="muComment"># read a character</span>
|
||||
<span id="L641" class="LineNr"> 641 </span> <span class="muComment"># no combining character allowed here</span>
|
||||
<span id="L642" class="LineNr"> 642 </span> <span class="PreProc">var</span> g/eax: grapheme <span class="Special"><-</span> <a href='../403unicode.mu.html#L236'>read-grapheme</a> stream
|
||||
<span id="L643" class="LineNr"> 643 </span> <span class="PreProc">var</span> c/eax: code-point <span class="Special"><-</span> <a href='../403unicode.mu.html#L56'>to-code-point</a> g
|
||||
<span id="L642" class="LineNr"> 642 </span> <span class="PreProc">var</span> g/eax: code-point-utf8 <span class="Special"><-</span> <a href='../403unicode.mu.html#L229'>read-code-point-utf8</a> stream
|
||||
<span id="L643" class="LineNr"> 643 </span> <span class="PreProc">var</span> c/eax: code-point <span class="Special"><-</span> <a href='../403unicode.mu.html#L49'>to-code-point</a> g
|
||||
<span id="L644" class="LineNr"> 644 </span> <span class="muComment"># if not a combining character, save for next iteration and loop</span>
|
||||
<span id="L645" class="LineNr"> 645 </span> <span class="Delimiter">{</span>
|
||||
<span id="L646" class="LineNr"> 646 </span> <span class="PreProc">var</span> <a href='../103glyph.subx.html#L157'>combining-code-point?</a>/eax: boolean <span class="Special"><-</span> <a href='../103glyph.subx.html#L157'>combining-code-point?</a> c
|
||||
|
@ -736,8 +736,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L672" class="LineNr"> 672 </span>
|
||||
<span id="L673" class="LineNr"> 673 </span><span class="muComment"># just return a different register</span>
|
||||
<span id="L674" class="LineNr"> 674 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='environment.mu.html#L674'>read-json-code-point</a></span> stream: (addr stream byte)<span class="PreProc"> -> </span>_/<span class="muRegEbx">ebx</span>: code-point <span class="Delimiter">{</span>
|
||||
<span id="L675" class="LineNr"> 675 </span> <span class="PreProc">var</span> g/eax: grapheme <span class="Special"><-</span> <a href='../403unicode.mu.html#L236'>read-grapheme</a> stream
|
||||
<span id="L676" class="LineNr"> 676 </span> <span class="PreProc">var</span> result/eax: code-point <span class="Special"><-</span> <a href='../403unicode.mu.html#L56'>to-code-point</a> g
|
||||
<span id="L675" class="LineNr"> 675 </span> <span class="PreProc">var</span> g/eax: code-point-utf8 <span class="Special"><-</span> <a href='../403unicode.mu.html#L229'>read-code-point-utf8</a> stream
|
||||
<span id="L676" class="LineNr"> 676 </span> <span class="PreProc">var</span> result/eax: code-point <span class="Special"><-</span> <a href='../403unicode.mu.html#L49'>to-code-point</a> g
|
||||
<span id="L677" class="LineNr"> 677 </span> <span class="PreProc">return</span> result
|
||||
<span id="L678" class="LineNr"> 678 </span><span class="Delimiter">}</span>
|
||||
<span id="L679" class="LineNr"> 679 </span>
|
||||
|
@ -790,7 +790,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L726" class="LineNr"> 726 </span> <span class="Delimiter">}</span>
|
||||
<span id="L727" class="LineNr"> 727 </span> <span class="muComment"># most characters escape to themselves</span>
|
||||
<span id="L728" class="LineNr"> 728 </span> <span class="muComment"># combining characters not supported after backslash</span>
|
||||
<span id="L729" class="LineNr"> 729 </span> x, y <span class="Special"><-</span> <a href='../501draw-text.mu.html#L162'>render-code-point</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, g, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color
|
||||
<span id="L729" class="LineNr"> 729 </span> x, y <span class="Special"><-</span> <a href='../501draw-text.mu.html#L155'>render-code-point</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, g, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color
|
||||
<span id="L730" class="LineNr"> 730 </span> <span class="PreProc">var</span> y/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy y
|
||||
<span id="L731" class="LineNr"> 731 </span> <span class="PreProc">return</span> x, y
|
||||
<span id="L732" class="LineNr"> 732 </span><span class="Delimiter">}</span>
|
||||
|
@ -819,7 +819,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L755" class="LineNr"> 755 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L756" class="LineNr"> 756 </span> <span class="PreProc">var</span> x/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L757" class="LineNr"> 757 </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="L758" class="LineNr"> 758 </span> x, y <span class="Special"><-</span> <a href='../501draw-text.mu.html#L162'>render-code-point</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x2d</span>/dash, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color
|
||||
<span id="L758" class="LineNr"> 758 </span> x, y <span class="Special"><-</span> <a href='../501draw-text.mu.html#L155'>render-code-point</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x2d</span>/dash, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color
|
||||
<span id="L759" class="LineNr"> 759 </span> <span class="PreProc">return</span> x, y
|
||||
<span id="L760" class="LineNr"> 760 </span> <span class="Delimiter">}</span>
|
||||
<span id="L761" class="LineNr"> 761 </span> <span class="muComment"># \u2014 = -</span>
|
||||
|
@ -829,7 +829,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L765" class="LineNr"> 765 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L766" class="LineNr"> 766 </span> <span class="PreProc">var</span> x/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L767" class="LineNr"> 767 </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="L768" class="LineNr"> 768 </span> x, y <span class="Special"><-</span> <a href='../501draw-text.mu.html#L162'>render-code-point</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x2d</span>/dash, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color
|
||||
<span id="L768" class="LineNr"> 768 </span> x, y <span class="Special"><-</span> <a href='../501draw-text.mu.html#L155'>render-code-point</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x2d</span>/dash, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color
|
||||
<span id="L769" class="LineNr"> 769 </span> <span class="PreProc">return</span> x, y
|
||||
<span id="L770" class="LineNr"> 770 </span> <span class="Delimiter">}</span>
|
||||
<span id="L771" class="LineNr"> 771 </span> <span class="muComment"># \u2018 = '</span>
|
||||
|
@ -839,7 +839,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L775" class="LineNr"> 775 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L776" class="LineNr"> 776 </span> <span class="PreProc">var</span> x/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L777" class="LineNr"> 777 </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="L778" class="LineNr"> 778 </span> x, y <span class="Special"><-</span> <a href='../501draw-text.mu.html#L162'>render-code-point</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x27</span>/quote, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color
|
||||
<span id="L778" class="LineNr"> 778 </span> x, y <span class="Special"><-</span> <a href='../501draw-text.mu.html#L155'>render-code-point</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x27</span>/quote, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color
|
||||
<span id="L779" class="LineNr"> 779 </span> <span class="PreProc">return</span> x, y
|
||||
<span id="L780" class="LineNr"> 780 </span> <span class="Delimiter">}</span>
|
||||
<span id="L781" class="LineNr"> 781 </span> <span class="muComment"># \u2019 = '</span>
|
||||
|
@ -849,7 +849,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L785" class="LineNr"> 785 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L786" class="LineNr"> 786 </span> <span class="PreProc">var</span> x/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L787" class="LineNr"> 787 </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="L788" class="LineNr"> 788 </span> x, y <span class="Special"><-</span> <a href='../501draw-text.mu.html#L162'>render-code-point</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x27</span>/quote, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color
|
||||
<span id="L788" class="LineNr"> 788 </span> x, y <span class="Special"><-</span> <a href='../501draw-text.mu.html#L155'>render-code-point</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x27</span>/quote, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color
|
||||
<span id="L789" class="LineNr"> 789 </span> <span class="PreProc">return</span> x, y
|
||||
<span id="L790" class="LineNr"> 790 </span> <span class="Delimiter">}</span>
|
||||
<span id="L791" class="LineNr"> 791 </span> <span class="muComment"># \u201c = "</span>
|
||||
|
@ -859,7 +859,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L795" class="LineNr"> 795 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L796" class="LineNr"> 796 </span> <span class="PreProc">var</span> x/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L797" class="LineNr"> 797 </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="L798" class="LineNr"> 798 </span> x, y <span class="Special"><-</span> <a href='../501draw-text.mu.html#L162'>render-code-point</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x22</span>/dquote, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color
|
||||
<span id="L798" class="LineNr"> 798 </span> x, y <span class="Special"><-</span> <a href='../501draw-text.mu.html#L155'>render-code-point</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x22</span>/dquote, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color
|
||||
<span id="L799" class="LineNr"> 799 </span> <span class="PreProc">return</span> x, y
|
||||
<span id="L800" class="LineNr"> 800 </span> <span class="Delimiter">}</span>
|
||||
<span id="L801" class="LineNr"> 801 </span> <span class="muComment"># \u201d = "</span>
|
||||
|
@ -869,7 +869,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L805" class="LineNr"> 805 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L806" class="LineNr"> 806 </span> <span class="PreProc">var</span> x/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L807" class="LineNr"> 807 </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="L808" class="LineNr"> 808 </span> x, y <span class="Special"><-</span> <a href='../501draw-text.mu.html#L162'>render-code-point</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x22</span>/dquote, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color
|
||||
<span id="L808" class="LineNr"> 808 </span> x, y <span class="Special"><-</span> <a href='../501draw-text.mu.html#L155'>render-code-point</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x22</span>/dquote, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color
|
||||
<span id="L809" class="LineNr"> 809 </span> <span class="PreProc">return</span> x, y
|
||||
<span id="L810" class="LineNr"> 810 </span> <span class="Delimiter">}</span>
|
||||
<span id="L811" class="LineNr"> 811 </span> <span class="muComment"># \u2022 = *</span>
|
||||
|
@ -879,7 +879,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L815" class="LineNr"> 815 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L816" class="LineNr"> 816 </span> <span class="PreProc">var</span> x/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L817" class="LineNr"> 817 </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="L818" class="LineNr"> 818 </span> x, y <span class="Special"><-</span> <a href='../501draw-text.mu.html#L162'>render-code-point</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x2a</span>/asterisk, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color
|
||||
<span id="L818" class="LineNr"> 818 </span> x, y <span class="Special"><-</span> <a href='../501draw-text.mu.html#L155'>render-code-point</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">0x2a</span>/asterisk, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color
|
||||
<span id="L819" class="LineNr"> 819 </span> <span class="PreProc">return</span> x, y
|
||||
<span id="L820" class="LineNr"> 820 </span> <span class="Delimiter">}</span>
|
||||
<span id="L821" class="LineNr"> 821 </span> <span class="muComment"># \u2026 = ...</span>
|
||||
|
@ -889,14 +889,14 @@ if ('onhashchange' in window) {
|
|||
<span id="L825" class="LineNr"> 825 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L826" class="LineNr"> 826 </span> <span class="PreProc">var</span> x/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L827" class="LineNr"> 827 </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="L828" class="LineNr"> 828 </span> x, y <span class="Special"><-</span> <a href='../501draw-text.mu.html#L188'>draw-text-wrapping-right-then-down</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"..."</span>, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color
|
||||
<span id="L828" class="LineNr"> 828 </span> x, y <span class="Special"><-</span> <a href='../501draw-text.mu.html#L181'>draw-text-wrapping-right-then-down</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"..."</span>, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color
|
||||
<span id="L829" class="LineNr"> 829 </span> <span class="PreProc">return</span> x, y
|
||||
<span id="L830" class="LineNr"> 830 </span> <span class="Delimiter">}</span>
|
||||
<span id="L831" class="LineNr"> 831 </span> <span class="PreProc">var</span> n/eax: int <span class="Special"><-</span> <a href='../118parse-hex-int.subx.html#L354'>parse-hex-int</a> hex-digits
|
||||
<span id="L832" class="LineNr"> 832 </span> <span class="PreProc">var</span> c/<span class="muRegEdx">edx</span>: code-point <span class="Special"><-</span> copy n
|
||||
<span id="L833" class="LineNr"> 833 </span> <span class="PreProc">var</span> x/eax: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L834" class="LineNr"> 834 </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="L835" class="LineNr"> 835 </span> x, y <span class="Special"><-</span> <a href='../501draw-text.mu.html#L162'>render-code-point</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, c, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color
|
||||
<span id="L835" class="LineNr"> 835 </span> x, y <span class="Special"><-</span> <a href='../501draw-text.mu.html#L155'>render-code-point</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, c, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color
|
||||
<span id="L836" class="LineNr"> 836 </span> <span class="PreProc">return</span> x, y
|
||||
<span id="L837" class="LineNr"> 837 </span><span class="Delimiter">}</span>
|
||||
<span id="L838" class="LineNr"> 838 </span>
|
||||
|
@ -1076,7 +1076,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L1012" class="LineNr">1012 </span> <span class="muComment"># otherwise delegate</span>
|
||||
<span id="L1013" class="LineNr">1013 </span> <span class="PreProc">var</span> search-terms-ah/eax: (addr handle <a href='../514gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special"><-</span> get env, search-terms
|
||||
<span id="L1014" class="LineNr">1014 </span> <span class="PreProc">var</span> search-terms/eax: (addr <a href='../514gap-buffer.mu.html#L3'>gap-buffer</a>) <span class="Special"><-</span> <a href='../120allocate.subx.html#L235'>lookup</a> *search-terms-ah
|
||||
<span id="L1015" class="LineNr">1015 </span> <span class="PreProc">var</span> g/<span class="muRegEcx">ecx</span>: grapheme <span class="Special"><-</span> copy key
|
||||
<span id="L1015" class="LineNr">1015 </span> <span class="PreProc">var</span> g/<span class="muRegEcx">ecx</span>: code-point-utf8 <span class="Special"><-</span> copy key
|
||||
<span id="L1016" class="LineNr">1016 </span> <a href='../514gap-buffer.mu.html#L1203'>edit-gap-buffer</a> search-terms, g
|
||||
<span id="L1017" class="LineNr">1017 </span><span class="Delimiter">}</span>
|
||||
<span id="L1018" class="LineNr">1018 </span>
|
||||
|
|
|
@ -122,11 +122,11 @@ if ('onhashchange' in window) {
|
|||
<span id="L58" class="LineNr"> 58 </span> <span class="PreProc">var</span> sector-count/eax: int <span class="Special"><-</span> copy <span class="Constant">0x400</span> <span class="muComment"># test_data</span>
|
||||
<span id="L59" class="LineNr"> 59 </span><span class="CommentedCode">#? var sector-count/eax: int <- copy 0x20000 # largest size tested; slow</span>
|
||||
<span id="L60" class="LineNr"> 60 </span> <a href='../500fake-screen.mu.html#L269'>set-cursor-position</a> <span class="Constant">0</span>/screen, <span class="Constant">0x20</span>/x <span class="Constant">0</span>/y <span class="muComment"># aborts clobber the screen starting x=0</span>
|
||||
<span id="L61" class="LineNr"> 61 </span> <a href='../501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"loading "</span>, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L62" class="LineNr"> 62 </span> <a href='../501draw-text.mu.html#L449'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, sector-count, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L63" class="LineNr"> 63 </span> <a href='../501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" sectors from data disk.."</span>, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L61" class="LineNr"> 61 </span> <a href='../501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"loading "</span>, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L62" class="LineNr"> 62 </span> <a href='../501draw-text.mu.html#L442'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, sector-count, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L63" class="LineNr"> 63 </span> <a href='../501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">" sectors from data disk.."</span>, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L64" class="LineNr"> 64 </span> <a href='../510disk.mu.html#L1'>load-sectors</a> data-disk, <span class="Constant">0</span>/lba, sector-count, s
|
||||
<span id="L65" class="LineNr"> 65 </span> <a href='../501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"done"</span>, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L65" class="LineNr"> 65 </span> <a href='../501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L16'>screen</a>, <span class="Constant">"done"</span>, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L66" class="LineNr"> 66 </span> <span class="muComment"># parse global data structures out of the stream</span>
|
||||
<span id="L67" class="LineNr"> 67 </span> <span class="PreProc">var</span> users-h: (handle array <a href='main.mu.html#L7'>user</a>)
|
||||
<span id="L68" class="LineNr"> 68 </span> <span class="PreProc">var</span> users-ah/eax: (addr handle array <a href='main.mu.html#L7'>user</a>) <span class="Special"><-</span> address users-h
|
||||
|
@ -177,11 +177,11 @@ if ('onhashchange' in window) {
|
|||
<span id="L113" class="LineNr">113 </span> compare c, <span class="Constant">0</span>
|
||||
<span id="L114" class="LineNr">114 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L115" class="LineNr">115 </span> <a href='../500fake-screen.mu.html#L269'>set-cursor-position</a> <span class="Constant">0</span>/screen, <span class="Constant">0x20</span>/x <span class="Constant">1</span>/y
|
||||
<span id="L116" class="LineNr">116 </span> <a href='../501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">"parsed "</span> <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L117" class="LineNr">117 </span> <a href='../501draw-text.mu.html#L449'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, user-idx, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L118" class="LineNr">118 </span> <a href='../501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">" users, "</span> <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L119" class="LineNr">119 </span> <a href='../501draw-text.mu.html#L449'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, item-idx, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L120" class="LineNr">120 </span> <a href='../501draw-text.mu.html#L339'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">" posts/comments"</span> <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L116" class="LineNr">116 </span> <a href='../501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">"parsed "</span> <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L117" class="LineNr">117 </span> <a href='../501draw-text.mu.html#L442'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, user-idx, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L118" class="LineNr">118 </span> <a href='../501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">" users, "</span> <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L119" class="LineNr">119 </span> <a href='../501draw-text.mu.html#L442'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, item-idx, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L120" class="LineNr">120 </span> <a href='../501draw-text.mu.html#L332'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">" posts/comments"</span> <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L121" class="LineNr">121 </span> <a href='../106stream.subx.html#L20'>clear-stream</a> record
|
||||
<span id="L122" class="LineNr">122 </span> <a href='main.mu.html#L142'>parse-record</a> in, record
|
||||
<span id="L123" class="LineNr">123 </span> <span class="PreProc">var</span> user?/eax: boolean <span class="Special"><-</span> <a href='main.mu.html#L178'>user-record?</a> record
|
||||
|
@ -210,7 +210,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L146" class="LineNr">146 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L147" class="LineNr">147 </span> <a href='../500fake-screen.mu.html#L269'>set-cursor-position</a> <span class="Constant">0</span>/screen, <span class="Constant">0x20</span> <span class="Constant">0x10</span>
|
||||
<span id="L148" class="LineNr">148 </span> <span class="PreProc">var</span> c/eax: int <span class="Special"><-</span> copy paren
|
||||
<span id="L149" class="LineNr">149 </span> <a href='../501draw-text.mu.html#L449'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen c, <span class="Constant">5</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L149" class="LineNr">149 </span> <a href='../501draw-text.mu.html#L442'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen c, <span class="Constant">5</span>/fg <span class="Constant">0</span>/bg
|
||||
<span id="L150" class="LineNr">150 </span> <a href='../317abort.subx.html#L5'>abort</a> <span class="Constant">"parse-record: ("</span>
|
||||
<span id="L151" class="LineNr">151 </span> <span class="Delimiter">}</span>
|
||||
<span id="L152" class="LineNr">152 </span> <span class="PreProc">var</span> paren-int/eax: int <span class="Special"><-</span> copy paren
|
||||
|
|
|
@ -15,13 +15,13 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.subxS2Comment { color: #8a8a8a; }
|
||||
.LineNr { }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.Constant { color: #008787; }
|
||||
.SpecialChar { color: #d70000; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.subxMinorFunction { color: #875f5f; }
|
||||
.CommentedCode { color: #8a8a8a; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
@ -64,9 +64,9 @@ if ('onhashchange' in window) {
|
|||
<span id="L5" class="LineNr"> 5 </span><span class="subxS1Comment"># . op subop mod rm32 base index scale r32</span>
|
||||
<span id="L6" class="LineNr"> 6 </span><span class="subxS1Comment"># . 1-3 bytes 3 bits 2 bits 3 bits 3 bits 3 bits 2 bits 2 bits 0/1/2/4 bytes 0/1/2/4 bytes</span>
|
||||
<span id="L7" class="LineNr"> 7 </span>
|
||||
<span id="L8" class="LineNr"> 8 </span><span class="SpecialChar">Entry</span>: <span class="subxComment"># just exit; can't test _write just yet</span>
|
||||
<span id="L9" class="LineNr"> 9 </span> bb/copy-to-ebx 0/imm32
|
||||
<span id="L10" class="LineNr">10 </span> e8/call <a href='000init.subx.html#L18'>syscall_exit</a>/disp32
|
||||
<span id="L8" class="LineNr"> 8 </span><span class="CommentedCode">#? Entry: # just exit; can't test _write just yet</span>
|
||||
<span id="L9" class="LineNr"> 9 </span><span class="CommentedCode">#? bb/copy-to-ebx 0/imm32</span>
|
||||
<span id="L10" class="LineNr">10 </span><span class="CommentedCode">#? e8/call syscall_exit/disp32</span>
|
||||
<span id="L11" class="LineNr">11 </span>
|
||||
<span id="L12" class="LineNr">12 </span><span class="subxMinorFunction">_write</span>: <span class="subxComment"># fd: int, s: (addr array byte)</span>
|
||||
<span id="L13" class="LineNr">13 </span> <span class="subxS1Comment"># . prologue</span>
|
||||
|
@ -77,7 +77,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L18" class="LineNr">18 </span> 51/push-ecx
|
||||
<span id="L19" class="LineNr">19 </span> 52/push-edx
|
||||
<span id="L20" class="LineNr">20 </span> 53/push-ebx
|
||||
<span id="L21" class="LineNr">21 </span> <span class="subxComment"># syscall(write, fd, (data) s+4, (size) *s)</span>
|
||||
<span id="L21" class="LineNr">21 </span> <span class="subxComment"># syscall_write(fd, (data) s+4, (size) *s)</span>
|
||||
<span id="L22" class="LineNr">22 </span> <span class="subxS1Comment"># . ebx = fd</span>
|
||||
<span id="L23" class="LineNr">23 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 3/r32/ebx 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to ebx</span>
|
||||
<span id="L24" class="LineNr">24 </span> <span class="subxS1Comment"># . var data/ecx: (addr byte) = s+4</span>
|
||||
|
@ -104,7 +104,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L45" class="LineNr">45 </span>
|
||||
<span id="L46" class="LineNr">46 </span><span class="Constant">$_write:abort</span>:
|
||||
<span id="L47" class="LineNr">47 </span> <span class="subxComment"># can't write a message here for risk of an infinite loop, so we'll use a special exit code instead</span>
|
||||
<span id="L48" class="LineNr">48 </span> <span class="subxS1Comment"># . syscall(exit, 255)</span>
|
||||
<span id="L48" class="LineNr">48 </span> <span class="subxS1Comment"># . syscall_exit(255)</span>
|
||||
<span id="L49" class="LineNr">49 </span> bb/copy-to-ebx 0xff/imm32
|
||||
<span id="L50" class="LineNr">50 </span> e8/call <a href='000init.subx.html#L18'>syscall_exit</a>/disp32
|
||||
<span id="L51" class="LineNr">51 </span> <span class="subxComment"># never gets here</span>
|
||||
|
|
|
@ -14,14 +14,15 @@ pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
|
|||
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
|
||||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.SpecialChar { color: #d70000; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.subxS2Comment { color: #8a8a8a; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.SpecialChar { color: #d70000; }
|
||||
.Constant { color: #008787; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.CommentedCode { color: #8a8a8a; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
@ -64,19 +65,19 @@ if ('onhashchange' in window) {
|
|||
<span id="L5" class="LineNr"> 5 </span><span class="subxS1Comment"># . op subop mod rm32 base index scale r32</span>
|
||||
<span id="L6" class="LineNr"> 6 </span><span class="subxS1Comment"># . 1-3 bytes 3 bits 2 bits 3 bits 3 bits 3 bits 2 bits 2 bits 0/1/2/4 bytes 0/1/2/4 bytes</span>
|
||||
<span id="L7" class="LineNr"> 7 </span>
|
||||
<span id="L8" class="LineNr"> 8 </span><span class="SpecialChar">Entry</span>: <span class="subxComment"># manual test</span>
|
||||
<span id="L9" class="LineNr"> 9 </span> <span class="subxComment"># check-ints-equal(34, 34)</span>
|
||||
<span id="L10" class="LineNr"> 10 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L11" class="LineNr"> 11 </span> 68/push <span class="Constant">"error in check-ints-equal"</span>/imm32
|
||||
<span id="L12" class="LineNr"> 12 </span> 68/push 34/imm32
|
||||
<span id="L13" class="LineNr"> 13 </span> 68/push 34/imm32
|
||||
<span id="L14" class="LineNr"> 14 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L15" class="LineNr"> 15 </span> e8/call <a href='102test.subx.html#L23'>check-ints-equal</a>/disp32
|
||||
<span id="L16" class="LineNr"> 16 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L17" class="LineNr"> 17 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L18" class="LineNr"> 18 </span> <span class="subxComment"># syscall(exit, 0)</span>
|
||||
<span id="L19" class="LineNr"> 19 </span> bb/copy-to-ebx 0/imm32
|
||||
<span id="L20" class="LineNr"> 20 </span> e8/call <a href='000init.subx.html#L18'>syscall_exit</a>/disp32
|
||||
<span id="L8" class="LineNr"> 8 </span><span class="CommentedCode">#? Entry: # manual test</span>
|
||||
<span id="L9" class="LineNr"> 9 </span><span class="CommentedCode">#? # check-ints-equal(34, 34)</span>
|
||||
<span id="L10" class="LineNr"> 10 </span><span class="CommentedCode">#? # . . push args</span>
|
||||
<span id="L11" class="LineNr"> 11 </span><span class="CommentedCode">#? 68/push "error in check-ints-equal"/imm32</span>
|
||||
<span id="L12" class="LineNr"> 12 </span><span class="CommentedCode">#? 68/push 34/imm32</span>
|
||||
<span id="L13" class="LineNr"> 13 </span><span class="CommentedCode">#? 68/push 34/imm32</span>
|
||||
<span id="L14" class="LineNr"> 14 </span><span class="CommentedCode">#? # . . call</span>
|
||||
<span id="L15" class="LineNr"> 15 </span><span class="CommentedCode">#? e8/call check-ints-equal/disp32</span>
|
||||
<span id="L16" class="LineNr"> 16 </span><span class="CommentedCode">#? # . . discard args</span>
|
||||
<span id="L17" class="LineNr"> 17 </span><span class="CommentedCode">#? 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp</span>
|
||||
<span id="L18" class="LineNr"> 18 </span><span class="CommentedCode">#? # syscall_exit(0)</span>
|
||||
<span id="L19" class="LineNr"> 19 </span><span class="CommentedCode">#? bb/copy-to-ebx 0/imm32</span>
|
||||
<span id="L20" class="LineNr"> 20 </span><span class="CommentedCode">#? e8/call syscall_exit/disp32</span>
|
||||
<span id="L21" class="LineNr"> 21 </span>
|
||||
<span id="L22" class="LineNr"> 22 </span><span class="subxComment"># print msg to stderr if a != b, otherwise print "."</span>
|
||||
<span id="L23" class="LineNr"> 23 </span><span class="subxFunction">check-ints-equal</span>: <span class="subxComment"># a: int, b: int, msg: (addr array byte)</span>
|
||||
|
|
|
@ -14,17 +14,18 @@ pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
|
|||
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
|
||||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxH1Comment { color: #005faf; text-decoration: underline; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.subxS2Comment { color: #8a8a8a; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.Constant { color: #008787; }
|
||||
.SpecialChar { color: #d70000; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.subxMinorFunction { color: #875f5f; }
|
||||
.Constant { color: #008787; }
|
||||
.subxTest { color: #5f8700; }
|
||||
.subxH1Comment { color: #005faf; text-decoration: underline; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.CommentedCode { color: #8a8a8a; }
|
||||
.subxMinorFunction { color: #875f5f; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
@ -84,11 +85,11 @@ if ('onhashchange' in window) {
|
|||
<span id="L22" class="LineNr"> 22 </span><span class="subxS1Comment"># . op subop mod rm32 base index scale r32</span>
|
||||
<span id="L23" class="LineNr"> 23 </span><span class="subxS1Comment"># . 1-3 bytes 3 bits 2 bits 3 bits 3 bits 3 bits 2 bits 2 bits 0/1/2/4 bytes 0/1/2/4 bytes</span>
|
||||
<span id="L24" class="LineNr"> 24 </span>
|
||||
<span id="L25" class="LineNr"> 25 </span><span class="SpecialChar">Entry</span>: <span class="subxComment"># run all tests</span>
|
||||
<span id="L26" class="LineNr"> 26 </span> e8/call run-tests/disp32 <span class="subxComment"># 'run-tests' is a function created automatically by SubX. It calls all functions that start with 'test-'.</span>
|
||||
<span id="L27" class="LineNr"> 27 </span> <span class="subxComment"># syscall(exit, Num-test-failures)</span>
|
||||
<span id="L28" class="LineNr"> 28 </span> 8b/copy 0/mod/indirect 5/rm32/.disp32 <span class="Normal"> . </span> <span class="Normal"> . </span> 3/r32/ebx <span class="SpecialChar"><a href='102test.subx.html#L89'>Num-test-failures</a></span>/disp32 <span class="subxComment"># copy *Num-test-failures to ebx</span>
|
||||
<span id="L29" class="LineNr"> 29 </span> e8/call <a href='000init.subx.html#L18'>syscall_exit</a>/disp32
|
||||
<span id="L25" class="LineNr"> 25 </span><span class="CommentedCode">#? Entry: # run all tests</span>
|
||||
<span id="L26" class="LineNr"> 26 </span><span class="CommentedCode">#? e8/call run-tests/disp32 # 'run-tests' is a function created automatically by SubX. It calls all functions that start with 'test-'.</span>
|
||||
<span id="L27" class="LineNr"> 27 </span><span class="CommentedCode">#? # syscall_exit(Num-test-failures)</span>
|
||||
<span id="L28" class="LineNr"> 28 </span><span class="CommentedCode">#? 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/ebx Num-test-failures/disp32 # copy *Num-test-failures to ebx</span>
|
||||
<span id="L29" class="LineNr"> 29 </span><span class="CommentedCode">#? e8/call syscall_exit/disp32</span>
|
||||
<span id="L30" class="LineNr"> 30 </span>
|
||||
<span id="L31" class="LineNr"> 31 </span><span class="subxFunction">kernel-string-equal?</span>: <span class="subxComment"># s: (addr kernel-string), benchmark: (addr array byte) -> result/eax: boolean</span>
|
||||
<span id="L32" class="LineNr"> 32 </span> <span class="subxComment"># pseudocode:</span>
|
||||
|
|
|
@ -15,14 +15,14 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS2Comment { color: #8a8a8a; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.Constant { color: #008787; }
|
||||
.SpecialChar { color: #d70000; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.subxMinorFunction { color: #875f5f; }
|
||||
.LineNr { }
|
||||
.Constant { color: #008787; }
|
||||
.subxS2Comment { color: #8a8a8a; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.CommentedCode { color: #8a8a8a; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
@ -76,26 +76,26 @@ if ('onhashchange' in window) {
|
|||
<span id="L16" class="LineNr">16 </span><span class="subxS1Comment"># . op subop mod rm32 base index scale r32</span>
|
||||
<span id="L17" class="LineNr">17 </span><span class="subxS1Comment"># . 1-3 bytes 3 bits 2 bits 3 bits 3 bits 3 bits 2 bits 2 bits 0/1/2/4 bytes 0/1/2/4 bytes</span>
|
||||
<span id="L18" class="LineNr">18 </span>
|
||||
<span id="L19" class="LineNr">19 </span><span class="SpecialChar">Entry</span>: <span class="subxComment"># manual test</span>
|
||||
<span id="L20" class="LineNr">20 </span> <span class="subxComment"># var ad/ecx: allocation-descriptor</span>
|
||||
<span id="L21" class="LineNr">21 </span> 68/push 0/imm32/limit
|
||||
<span id="L22" class="LineNr">22 </span> 68/push 0/imm32/curr
|
||||
<span id="L23" class="LineNr">23 </span> 89/copy 3/mod/direct 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ecx</span>
|
||||
<span id="L24" class="LineNr">24 </span> <span class="subxComment"># new-segment(0x1000, ad)</span>
|
||||
<span id="L25" class="LineNr">25 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L26" class="LineNr">26 </span> 51/push-ecx
|
||||
<span id="L27" class="LineNr">27 </span> 68/push 0x1000/imm32
|
||||
<span id="L28" class="LineNr">28 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L29" class="LineNr">29 </span> e8/call <a href='104new-segment.subx.html#L40'>new-segment</a>/disp32
|
||||
<span id="L30" class="LineNr">30 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L31" class="LineNr">31 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L32" class="LineNr">32 </span> <span class="subxComment"># var eax: (addr _) = ad->curr</span>
|
||||
<span id="L33" class="LineNr">33 </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="L34" class="LineNr">34 </span> <span class="subxComment"># write to *eax to check that we have access to the newly-allocated segment</span>
|
||||
<span id="L35" class="LineNr">35 </span> c7 0/subop/copy 0/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x34/imm32 <span class="subxComment"># copy to *eax</span>
|
||||
<span id="L36" class="LineNr">36 </span> <span class="subxComment"># syscall(exit, eax)</span>
|
||||
<span id="L37" class="LineNr">37 </span> 89/copy 3/mod/direct 3/rm32/ebx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy eax to ebx</span>
|
||||
<span id="L38" class="LineNr">38 </span> e8/call <a href='000init.subx.html#L18'>syscall_exit</a>/disp32
|
||||
<span id="L19" class="LineNr">19 </span><span class="CommentedCode">#? Entry: # manual test</span>
|
||||
<span id="L20" class="LineNr">20 </span><span class="CommentedCode">#? # var ad/ecx: allocation-descriptor</span>
|
||||
<span id="L21" class="LineNr">21 </span><span class="CommentedCode">#? 68/push 0/imm32/limit</span>
|
||||
<span id="L22" class="LineNr">22 </span><span class="CommentedCode">#? 68/push 0/imm32/curr</span>
|
||||
<span id="L23" class="LineNr">23 </span><span class="CommentedCode">#? 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx</span>
|
||||
<span id="L24" class="LineNr">24 </span><span class="CommentedCode">#? # new-segment(0x1000, ad)</span>
|
||||
<span id="L25" class="LineNr">25 </span><span class="CommentedCode">#? # . . push args</span>
|
||||
<span id="L26" class="LineNr">26 </span><span class="CommentedCode">#? 51/push-ecx</span>
|
||||
<span id="L27" class="LineNr">27 </span><span class="CommentedCode">#? 68/push 0x1000/imm32</span>
|
||||
<span id="L28" class="LineNr">28 </span><span class="CommentedCode">#? # . . call</span>
|
||||
<span id="L29" class="LineNr">29 </span><span class="CommentedCode">#? e8/call new-segment/disp32</span>
|
||||
<span id="L30" class="LineNr">30 </span><span class="CommentedCode">#? # . . discard args</span>
|
||||
<span id="L31" class="LineNr">31 </span><span class="CommentedCode">#? 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp</span>
|
||||
<span id="L32" class="LineNr">32 </span><span class="CommentedCode">#? # var eax: (addr _) = ad->curr</span>
|
||||
<span id="L33" class="LineNr">33 </span><span class="CommentedCode">#? 8b/copy 0/mod/indirect 1/rm32/ecx . . . 0/r32/eax . . # copy *ecx to eax</span>
|
||||
<span id="L34" class="LineNr">34 </span><span class="CommentedCode">#? # write to *eax to check that we have access to the newly-allocated segment</span>
|
||||
<span id="L35" class="LineNr">35 </span><span class="CommentedCode">#? c7 0/subop/copy 0/mod/direct 0/rm32/eax . . . . . 0x34/imm32 # copy to *eax</span>
|
||||
<span id="L36" class="LineNr">36 </span><span class="CommentedCode">#? # syscall_exit(eax)</span>
|
||||
<span id="L37" class="LineNr">37 </span><span class="CommentedCode">#? 89/copy 3/mod/direct 3/rm32/ebx . . . 0/r32/eax . . # copy eax to ebx</span>
|
||||
<span id="L38" class="LineNr">38 </span><span class="CommentedCode">#? e8/call syscall_exit/disp32</span>
|
||||
<span id="L39" class="LineNr">39 </span>
|
||||
<span id="L40" class="LineNr">40 </span><span class="subxFunction">new-segment</span>: <span class="subxComment"># len: int, ad: (addr allocation-descriptor)</span>
|
||||
<span id="L41" class="LineNr">41 </span> <span class="subxS1Comment"># . prologue</span>
|
||||
|
|
|
@ -14,16 +14,15 @@ pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
|
|||
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
|
||||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxH1Comment { color: #005faf; text-decoration: underline; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.subxS2Comment { color: #8a8a8a; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.Constant { color: #008787; }
|
||||
.SpecialChar { color: #d70000; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.subxH1Comment { color: #005faf; text-decoration: underline; }
|
||||
.subxTest { color: #5f8700; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.CommentedCode { color: #8a8a8a; }
|
||||
-->
|
||||
</style>
|
||||
|
@ -67,12 +66,12 @@ if ('onhashchange' in window) {
|
|||
<span id="L5" class="LineNr"> 5 </span><span class="subxS1Comment"># . op subop mod rm32 base index scale r32</span>
|
||||
<span id="L6" class="LineNr"> 6 </span><span class="subxS1Comment"># . 1-3 bytes 3 bits 2 bits 3 bits 3 bits 3 bits 2 bits 2 bits 0/1/2/4 bytes 0/1/2/4 bytes</span>
|
||||
<span id="L7" class="LineNr"> 7 </span>
|
||||
<span id="L8" class="LineNr"> 8 </span><span class="SpecialChar">Entry</span>: <span class="subxComment"># run all tests</span>
|
||||
<span id="L9" class="LineNr"> 9 </span><span class="CommentedCode">#? e8/call test-compare-equal-strings/disp32</span>
|
||||
<span id="L10" class="LineNr"> 10 </span> e8/call run-tests/disp32 <span class="subxComment"># 'run-tests' is a function created automatically by SubX. It calls all functions that start with 'test-'.</span>
|
||||
<span id="L11" class="LineNr"> 11 </span> <span class="subxComment"># syscall(exit, Num-test-failures)</span>
|
||||
<span id="L12" class="LineNr"> 12 </span> 8b/copy 0/mod/indirect 5/rm32/.disp32 <span class="Normal"> . </span> <span class="Normal"> . </span> 3/r32/ebx <span class="SpecialChar"><a href='102test.subx.html#L89'>Num-test-failures</a></span>/disp32 <span class="subxComment"># copy *Num-test-failures to ebx</span>
|
||||
<span id="L13" class="LineNr"> 13 </span> e8/call <a href='000init.subx.html#L18'>syscall_exit</a>/disp32
|
||||
<span id="L8" class="LineNr"> 8 </span><span class="CommentedCode">#? Entry: # run all tests</span>
|
||||
<span id="L9" class="LineNr"> 9 </span><span class="CommentedCode">#? #? e8/call test-compare-equal-strings/disp32</span>
|
||||
<span id="L10" class="LineNr"> 10 </span><span class="CommentedCode">#? e8/call run-tests/disp32 # 'run-tests' is a function created automatically by SubX. It calls all functions that start with 'test-'.</span>
|
||||
<span id="L11" class="LineNr"> 11 </span><span class="CommentedCode">#? # syscall_exit(Num-test-failures)</span>
|
||||
<span id="L12" class="LineNr"> 12 </span><span class="CommentedCode">#? 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/ebx Num-test-failures/disp32 # copy *Num-test-failures to ebx</span>
|
||||
<span id="L13" class="LineNr"> 13 </span><span class="CommentedCode">#? e8/call syscall_exit/disp32</span>
|
||||
<span id="L14" class="LineNr"> 14 </span>
|
||||
<span id="L15" class="LineNr"> 15 </span><span class="subxFunction">string-equal?</span>: <span class="subxComment"># s: (addr array byte), benchmark: (addr array byte) -> result/eax: boolean</span>
|
||||
<span id="L16" class="LineNr"> 16 </span> <span class="subxComment"># pseudocode:</span>
|
||||
|
|
|
@ -14,14 +14,14 @@ pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
|
|||
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
|
||||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxH1Comment { color: #005faf; text-decoration: underline; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.subxS2Comment { color: #8a8a8a; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.Constant { color: #008787; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.subxH1Comment { color: #005faf; text-decoration: underline; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
|
|
@ -14,17 +14,17 @@ pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
|
|||
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
|
||||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS2Comment { color: #8a8a8a; }
|
||||
.subxH1Comment { color: #005faf; text-decoration: underline; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.subxS2Comment { color: #8a8a8a; }
|
||||
.LineNr { }
|
||||
.Constant { color: #008787; }
|
||||
.SpecialChar { color: #d70000; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.subxMinorFunction { color: #875f5f; }
|
||||
.subxTest { color: #5f8700; }
|
||||
.SpecialChar { color: #d70000; }
|
||||
.subxMinorFunction { color: #875f5f; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.CommentedCode { color: #8a8a8a; }
|
||||
-->
|
||||
</style>
|
||||
|
@ -1010,7 +1010,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L947" class="LineNr">947 </span> e8/call <a href='101_write.subx.html#L12'>_write</a>/disp32
|
||||
<span id="L948" class="LineNr">948 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L949" class="LineNr">949 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L950" class="LineNr">950 </span> <span class="subxS1Comment"># . syscall(exit, 1)</span>
|
||||
<span id="L950" class="LineNr">950 </span> <span class="subxS1Comment"># . syscall_exit(1)</span>
|
||||
<span id="L951" class="LineNr">951 </span> bb/copy-to-ebx 1/imm32
|
||||
<span id="L952" class="LineNr">952 </span> e8/call <a href='000init.subx.html#L18'>syscall_exit</a>/disp32
|
||||
<span id="L953" class="LineNr">953 </span> <span class="subxComment"># never gets here</span>
|
||||
|
|
|
@ -14,15 +14,15 @@ pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
|
|||
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
|
||||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxMinorFunction { color: #875f5f; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.subxS2Comment { color: #8a8a8a; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.Constant { color: #008787; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.subxMinorFunction { color: #875f5f; }
|
||||
.subxTest { color: #5f8700; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
|
|
@ -15,13 +15,13 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.subxS2Comment { color: #8a8a8a; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.Constant { color: #008787; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.subxTest { color: #5f8700; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
|
|
@ -14,15 +14,15 @@ pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
|
|||
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
|
||||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxMinorFunction { color: #875f5f; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.subxS2Comment { color: #8a8a8a; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.Constant { color: #008787; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.subxMinorFunction { color: #875f5f; }
|
||||
.subxTest { color: #5f8700; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.CommentedCode { color: #8a8a8a; }
|
||||
-->
|
||||
</style>
|
||||
|
@ -171,7 +171,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L110" class="LineNr">110 </span> <span class="subxComment"># never gets here</span>
|
||||
<span id="L111" class="LineNr">111 </span> c3/return <span class="subxComment"># doesn't return to caller</span>
|
||||
<span id="L112" class="LineNr">112 </span><span class="Constant">$stop:real</span>:
|
||||
<span id="L113" class="LineNr">113 </span> <span class="subxS1Comment"># . syscall(exit, value)</span>
|
||||
<span id="L113" class="LineNr">113 </span> <span class="subxS1Comment"># . syscall_exit(value)</span>
|
||||
<span id="L114" class="LineNr">114 </span> 8b/copy 1/mod/*+disp8 4/rm32/sib 4/base/esp 4/index/none <span class="Normal"> . </span> 3/r32/ebx 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(esp+8) to ebx</span>
|
||||
<span id="L115" class="LineNr">115 </span> e8/call <a href='000init.subx.html#L18'>syscall_exit</a>/disp32
|
||||
<span id="L116" class="LineNr">116 </span><span class="Constant">$stop:end2</span>:
|
||||
|
|
|
@ -14,16 +14,16 @@ pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
|
|||
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
|
||||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxH1Comment { color: #005faf; text-decoration: underline; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.subxS2Comment { color: #8a8a8a; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.Constant { color: #008787; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.subxMinorFunction { color: #875f5f; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.subxTest { color: #5f8700; }
|
||||
.subxH1Comment { color: #005faf; text-decoration: underline; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
@ -271,7 +271,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L210" class="LineNr">210 </span> 8b/copy 0/mod/indirect 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *esi to eax</span>
|
||||
<span id="L211" class="LineNr">211 </span> <span class="subxComment"># edx = s->size</span>
|
||||
<span id="L212" class="LineNr">212 </span> 8b/copy 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(esi+8) to edx</span>
|
||||
<span id="L213" class="LineNr">213 </span> <span class="subxComment"># syscall(read, fd, &s->data[s->write], s->size - s->write)</span>
|
||||
<span id="L213" class="LineNr">213 </span> <span class="subxComment"># syscall_read(fd, &s->data[s->write], s->size - s->write)</span>
|
||||
<span id="L214" class="LineNr">214 </span> <span class="subxS2Comment"># . . fd: ebx</span>
|
||||
<span id="L215" class="LineNr">215 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 3/r32/ebx 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to ebx</span>
|
||||
<span id="L216" class="LineNr">216 </span> <span class="subxS2Comment"># . . data: ecx = &s->data[s->write]</span>
|
||||
|
|
|
@ -14,17 +14,17 @@ pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
|
|||
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
|
||||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxH1Comment { color: #005faf; text-decoration: underline; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.subxS2Comment { color: #8a8a8a; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.subxMinorFunction { color: #875f5f; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.subxTest { color: #5f8700; }
|
||||
.SpecialChar { color: #d70000; }
|
||||
.Constant { color: #008787; }
|
||||
.subxMinorFunction { color: #875f5f; }
|
||||
.subxTest { color: #5f8700; }
|
||||
.subxH1Comment { color: #005faf; text-decoration: underline; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
@ -369,7 +369,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L307" class="LineNr">307 </span> e8/call <a href='101_write.subx.html#L12'>_write</a>/disp32
|
||||
<span id="L308" class="LineNr">308 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L309" class="LineNr">309 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L310" class="LineNr">310 </span> <span class="subxS1Comment"># . syscall(exit, 1)</span>
|
||||
<span id="L310" class="LineNr">310 </span> <span class="subxS1Comment"># . syscall_exit(1)</span>
|
||||
<span id="L311" class="LineNr">311 </span> bb/copy-to-ebx 1/imm32
|
||||
<span id="L312" class="LineNr">312 </span> e8/call <a href='000init.subx.html#L18'>syscall_exit</a>/disp32
|
||||
<span id="L313" class="LineNr">313 </span> <span class="subxComment"># never gets here</span>
|
||||
|
|
|
@ -15,15 +15,15 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.subxS2Comment { color: #8a8a8a; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.Constant { color: #008787; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.subxMinorFunction { color: #875f5f; }
|
||||
.subxTest { color: #5f8700; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.CommentedCode { color: #8a8a8a; }
|
||||
.subxTest { color: #5f8700; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
@ -71,7 +71,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L10" class="LineNr"> 10 </span><span class="CommentedCode">#? 68/push _test-stream2/imm32</span>
|
||||
<span id="L11" class="LineNr"> 11 </span><span class="CommentedCode">#? 68/push 1/imm32/stdout</span>
|
||||
<span id="L12" class="LineNr"> 12 </span><span class="CommentedCode">#? e8/call write-stream/disp32</span>
|
||||
<span id="L13" class="LineNr"> 13 </span><span class="CommentedCode">#? # syscall(exit, Num-test-failures)</span>
|
||||
<span id="L13" class="LineNr"> 13 </span><span class="CommentedCode">#? # syscall_exit(Num-test-failures)</span>
|
||||
<span id="L14" class="LineNr"> 14 </span><span class="CommentedCode">#? 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/ebx Num-test-failures/disp32 # copy *Num-test-failures to ebx</span>
|
||||
<span id="L15" class="LineNr"> 15 </span><span class="CommentedCode">#? e8/call syscall_exit/disp32</span>
|
||||
<span id="L16" class="LineNr"> 16 </span>
|
||||
|
@ -152,7 +152,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L91" class="LineNr"> 91 </span> 8b/copy 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 7/r32/edi 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(esi+4) to edi</span>
|
||||
<span id="L92" class="LineNr"> 92 </span> <span class="subxComment"># edx = s->write</span>
|
||||
<span id="L93" class="LineNr"> 93 </span> 8b/copy 0/mod/indirect 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 2/r32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *esi to edx</span>
|
||||
<span id="L94" class="LineNr"> 94 </span> <span class="subxComment"># syscall(write, fd, &s->data[s->read], s->write - s->read)</span>
|
||||
<span id="L94" class="LineNr"> 94 </span> <span class="subxComment"># syscall_write(fd, &s->data[s->read], s->write - s->read)</span>
|
||||
<span id="L95" class="LineNr"> 95 </span> <span class="subxS2Comment"># . . fd: ebx</span>
|
||||
<span id="L96" class="LineNr"> 96 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 3/r32/ebx 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to ebx</span>
|
||||
<span id="L97" class="LineNr"> 97 </span> <span class="subxS2Comment"># . . data: ecx = &s->data[s->read]</span>
|
||||
|
@ -187,7 +187,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L126" class="LineNr">126 </span> e8/call <a href='101_write.subx.html#L12'>_write</a>/disp32
|
||||
<span id="L127" class="LineNr">127 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L128" class="LineNr">128 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L129" class="LineNr">129 </span> <span class="subxS1Comment"># . syscall(exit, 1)</span>
|
||||
<span id="L129" class="LineNr">129 </span> <span class="subxS1Comment"># . syscall_exit(1)</span>
|
||||
<span id="L130" class="LineNr">130 </span> bb/copy-to-ebx 1/imm32
|
||||
<span id="L131" class="LineNr">131 </span> e8/call <a href='000init.subx.html#L18'>syscall_exit</a>/disp32
|
||||
<span id="L132" class="LineNr">132 </span> <span class="subxComment"># never gets here</span>
|
||||
|
|
|
@ -14,13 +14,13 @@ pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
|
|||
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
|
||||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.SpecialChar { color: #d70000; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.subxS2Comment { color: #8a8a8a; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.Constant { color: #008787; }
|
||||
.SpecialChar { color: #d70000; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
-->
|
||||
</style>
|
||||
|
|
|
@ -14,17 +14,17 @@ pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
|
|||
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
|
||||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxH1Comment { color: #005faf; text-decoration: underline; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.subxS2Comment { color: #8a8a8a; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.subxMinorFunction { color: #875f5f; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.subxTest { color: #5f8700; }
|
||||
.SpecialChar { color: #d70000; }
|
||||
.Constant { color: #008787; }
|
||||
.subxMinorFunction { color: #875f5f; }
|
||||
.subxTest { color: #5f8700; }
|
||||
.subxH1Comment { color: #005faf; text-decoration: underline; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
@ -309,7 +309,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L247" class="LineNr">247 </span> e8/call <a href='101_write.subx.html#L12'>_write</a>/disp32
|
||||
<span id="L248" class="LineNr">248 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L249" class="LineNr">249 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L250" class="LineNr">250 </span> <span class="subxS1Comment"># . syscall(exit, 1)</span>
|
||||
<span id="L250" class="LineNr">250 </span> <span class="subxS1Comment"># . syscall_exit(1)</span>
|
||||
<span id="L251" class="LineNr">251 </span> bb/copy-to-ebx 1/imm32
|
||||
<span id="L252" class="LineNr">252 </span> e8/call <a href='000init.subx.html#L18'>syscall_exit</a>/disp32
|
||||
<span id="L253" class="LineNr">253 </span> <span class="subxComment"># never gets here</span>
|
||||
|
|
|
@ -14,16 +14,16 @@ pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
|
|||
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
|
||||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxH1Comment { color: #005faf; text-decoration: underline; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.subxS2Comment { color: #8a8a8a; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.Constant { color: #008787; }
|
||||
.SpecialChar { color: #d70000; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.Constant { color: #008787; }
|
||||
.subxTest { color: #5f8700; }
|
||||
.subxH1Comment { color: #005faf; text-decoration: underline; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
|
|
@ -14,16 +14,16 @@ pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
|
|||
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
|
||||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxH1Comment { color: #005faf; text-decoration: underline; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.subxS2Comment { color: #8a8a8a; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.subxTest { color: #5f8700; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Constant { color: #008787; }
|
||||
.Folded { color: #080808; background-color: #949494; }
|
||||
.subxTest { color: #5f8700; }
|
||||
.subxH1Comment { color: #005faf; text-decoration: underline; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
@ -458,7 +458,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L397" class="LineNr">397 </span> e8/call <a href='115write-byte.subx.html#L81'>flush</a>/disp32
|
||||
<span id="L398" class="LineNr">398 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L399" class="LineNr">399 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L400" class="Folded">400 </span><span class="Folded">+-- 18 lines: #? # dump line -------------------------------------------------------------------------------------------------------------------------------------------</span>
|
||||
<span id="L400" class="Folded">400 </span><span class="Folded">+-- 18 lines: #? # dump line --------------------------------------------------------------------------------------------------------------------------------------------------------</span>
|
||||
<span id="L418" class="LineNr">418 </span> <span class="subxComment"># check-stream-equal(_test-stream, "0x008899aa", msg)</span>
|
||||
<span id="L419" class="LineNr">419 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L420" class="LineNr">420 </span> 68/push <span class="Constant">"F - test-write-int32-hex-buffered"</span>/imm32
|
||||
|
|
|
@ -14,15 +14,15 @@ pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
|
|||
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
|
||||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.SpecialChar { color: #d70000; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.subxS2Comment { color: #8a8a8a; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.Constant { color: #008787; }
|
||||
.SpecialChar { color: #d70000; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.subxTest { color: #5f8700; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
@ -990,7 +990,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L930" class="LineNr">930 </span> e8/call <a href='101_write.subx.html#L12'>_write</a>/disp32
|
||||
<span id="L931" class="LineNr">931 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L932" class="LineNr">932 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L933" class="LineNr">933 </span> <span class="subxS1Comment"># . syscall(exit, 1)</span>
|
||||
<span id="L933" class="LineNr">933 </span> <span class="subxS1Comment"># . syscall_exit(1)</span>
|
||||
<span id="L934" class="LineNr">934 </span> bb/copy-to-ebx 1/imm32
|
||||
<span id="L935" class="LineNr">935 </span> e8/call <a href='000init.subx.html#L18'>syscall_exit</a>/disp32
|
||||
<span id="L936" class="LineNr">936 </span> <span class="subxComment"># never gets here</span>
|
||||
|
|
|
@ -14,13 +14,13 @@ pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
|
|||
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
|
||||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.SpecialChar { color: #d70000; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.subxS2Comment { color: #8a8a8a; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.Constant { color: #008787; }
|
||||
.SpecialChar { color: #d70000; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.CommentedCode { color: #8a8a8a; }
|
||||
-->
|
||||
|
@ -78,7 +78,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L18" class="LineNr">18 </span><span class="CommentedCode">#? 68/push Stderr/imm32</span>
|
||||
<span id="L19" class="LineNr">19 </span><span class="CommentedCode">#? 50/push-eax</span>
|
||||
<span id="L20" class="LineNr">20 </span><span class="CommentedCode">#? e8/call error-byte/disp32</span>
|
||||
<span id="L21" class="LineNr">21 </span><span class="CommentedCode">#? # . syscall(exit, Num-test-failures)</span>
|
||||
<span id="L21" class="LineNr">21 </span><span class="CommentedCode">#? # . syscall_exit(Num-test-failures)</span>
|
||||
<span id="L22" class="LineNr">22 </span><span class="CommentedCode">#? 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/ebx Num-test-failures/disp32 # copy *Num-test-failures to ebx</span>
|
||||
<span id="L23" class="LineNr">23 </span><span class="CommentedCode">#? e8/call syscall_exit/disp32</span>
|
||||
<span id="L24" class="LineNr">24 </span>
|
||||
|
|
|
@ -14,16 +14,17 @@ pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
|
|||
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
|
||||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxMinorFunction { color: #875f5f; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.subxS2Comment { color: #8a8a8a; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.Constant { color: #008787; }
|
||||
.SpecialChar { color: #d70000; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.subxMinorFunction { color: #875f5f; }
|
||||
.subxTest { color: #5f8700; }
|
||||
.SpecialChar { color: #d70000; }
|
||||
.Constant { color: #008787; }
|
||||
.CommentedCode { color: #8a8a8a; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
@ -103,22 +104,22 @@ if ('onhashchange' in window) {
|
|||
<span id="L42" class="LineNr"> 42 </span><span class="subxS1Comment"># . op subop mod rm32 base index scale r32</span>
|
||||
<span id="L43" class="LineNr"> 43 </span><span class="subxS1Comment"># . 1-3 bytes 3 bits 2 bits 3 bits 3 bits 3 bits 2 bits 2 bits 0/1/2/4 bytes 0/1/2/4 bytes</span>
|
||||
<span id="L44" class="LineNr"> 44 </span>
|
||||
<span id="L45" class="LineNr"> 45 </span><span class="subxComment"># Let's start initializing the default allocation descriptor.</span>
|
||||
<span id="L46" class="LineNr"> 46 </span>
|
||||
<span id="L47" class="LineNr"> 47 </span><span class="SpecialChar">Entry</span>:
|
||||
<span id="L48" class="LineNr"> 48 </span> <span class="subxComment"># initialize heap</span>
|
||||
<span id="L49" class="LineNr"> 49 </span> <span class="subxS1Comment"># . Heap = new-segment(Heap-size)</span>
|
||||
<span id="L50" class="LineNr"> 50 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L51" class="LineNr"> 51 </span> 68/push <span class="SpecialChar"><a href='120allocate.subx.html#L27'>Heap</a></span>/imm32
|
||||
<span id="L52" class="LineNr"> 52 </span> ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="SpecialChar"><a href='120allocate.subx.html#L34'>Heap-size</a></span>/disp32 <span class="subxComment"># push *Heap-size</span>
|
||||
<span id="L53" class="LineNr"> 53 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L54" class="LineNr"> 54 </span> e8/call <a href='104new-segment.subx.html#L40'>new-segment</a>/disp32
|
||||
<span id="L55" class="LineNr"> 55 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L56" class="LineNr"> 56 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L45" class="LineNr"> 45 </span><span class="CommentedCode">#? # Let's start initializing the default allocation descriptor.</span>
|
||||
<span id="L46" class="LineNr"> 46 </span><span class="CommentedCode">#? </span>
|
||||
<span id="L47" class="LineNr"> 47 </span><span class="CommentedCode">#? Entry:</span>
|
||||
<span id="L48" class="LineNr"> 48 </span><span class="CommentedCode">#? # initialize heap</span>
|
||||
<span id="L49" class="LineNr"> 49 </span><span class="CommentedCode">#? # . Heap = new-segment(Heap-size)</span>
|
||||
<span id="L50" class="LineNr"> 50 </span><span class="CommentedCode">#? # . . push args</span>
|
||||
<span id="L51" class="LineNr"> 51 </span><span class="CommentedCode">#? 68/push Heap/imm32</span>
|
||||
<span id="L52" class="LineNr"> 52 </span><span class="CommentedCode">#? ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Heap-size/disp32 # push *Heap-size</span>
|
||||
<span id="L53" class="LineNr"> 53 </span><span class="CommentedCode">#? # . . call</span>
|
||||
<span id="L54" class="LineNr"> 54 </span><span class="CommentedCode">#? e8/call new-segment/disp32</span>
|
||||
<span id="L55" class="LineNr"> 55 </span><span class="CommentedCode">#? # . . discard args</span>
|
||||
<span id="L56" class="LineNr"> 56 </span><span class="CommentedCode">#? 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp</span>
|
||||
<span id="L57" class="LineNr"> 57 </span>
|
||||
<span id="L58" class="LineNr"> 58 </span> e8/call run-tests/disp32 <span class="subxComment"># 'run-tests' is a function created automatically by SubX. It calls all functions that start with 'test-'.</span>
|
||||
<span id="L59" class="LineNr"> 59 </span><span class="Constant">$array-equal-main:end</span>:
|
||||
<span id="L60" class="LineNr"> 60 </span> <span class="subxComment"># syscall(exit, Num-test-failures)</span>
|
||||
<span id="L60" class="LineNr"> 60 </span> <span class="subxComment"># syscall_exit(Num-test-failures)</span>
|
||||
<span id="L61" class="LineNr"> 61 </span> 8b/copy 0/mod/indirect 5/rm32/.disp32 <span class="Normal"> . </span> <span class="Normal"> . </span> 3/r32/ebx <span class="SpecialChar"><a href='102test.subx.html#L89'>Num-test-failures</a></span>/disp32 <span class="subxComment"># copy *Num-test-failures to ebx</span>
|
||||
<span id="L62" class="LineNr"> 62 </span> e8/call <a href='000init.subx.html#L18'>syscall_exit</a>/disp32
|
||||
<span id="L63" class="LineNr"> 63 </span>
|
||||
|
@ -222,7 +223,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L161" class="LineNr">161 </span> e8/call <a href='101_write.subx.html#L12'>_write</a>/disp32
|
||||
<span id="L162" class="LineNr">162 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L163" class="LineNr">163 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L164" class="LineNr">164 </span> <span class="subxS1Comment"># . syscall(exit, 1)</span>
|
||||
<span id="L164" class="LineNr">164 </span> <span class="subxS1Comment"># . syscall_exit(1)</span>
|
||||
<span id="L165" class="LineNr">165 </span> bb/copy-to-ebx 1/imm32
|
||||
<span id="L166" class="LineNr">166 </span> e8/call <a href='000init.subx.html#L18'>syscall_exit</a>/disp32
|
||||
<span id="L167" class="LineNr">167 </span> <span class="subxComment"># never gets here</span>
|
||||
|
@ -353,7 +354,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L292" class="LineNr">292 </span> e8/call <a href='101_write.subx.html#L12'>_write</a>/disp32
|
||||
<span id="L293" class="LineNr">293 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L294" class="LineNr">294 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L295" class="LineNr">295 </span> <span class="subxS1Comment"># . syscall(exit, 1)</span>
|
||||
<span id="L295" class="LineNr">295 </span> <span class="subxS1Comment"># . syscall_exit(1)</span>
|
||||
<span id="L296" class="LineNr">296 </span> bb/copy-to-ebx 1/imm32/exit-status
|
||||
<span id="L297" class="LineNr">297 </span> e8/call <a href='000init.subx.html#L18'>syscall_exit</a>/disp32
|
||||
<span id="L298" class="LineNr">298 </span>
|
||||
|
@ -635,7 +636,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L574" class="LineNr">574 </span> e8/call <a href='101_write.subx.html#L12'>_write</a>/disp32
|
||||
<span id="L575" class="LineNr">575 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L576" class="LineNr">576 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L577" class="LineNr">577 </span> <span class="subxS1Comment"># . syscall(exit, 1)</span>
|
||||
<span id="L577" class="LineNr">577 </span> <span class="subxS1Comment"># . syscall_exit(1)</span>
|
||||
<span id="L578" class="LineNr">578 </span> bb/copy-to-ebx 1/imm32
|
||||
<span id="L579" class="LineNr">579 </span> e8/call <a href='000init.subx.html#L18'>syscall_exit</a>/disp32
|
||||
<span id="L580" class="LineNr">580 </span> <span class="subxComment"># never gets here</span>
|
||||
|
|
|
@ -15,13 +15,13 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.subxS2Comment { color: #8a8a8a; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.Constant { color: #008787; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.subxTest { color: #5f8700; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
@ -125,7 +125,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L66" class="LineNr"> 66 </span> e8/call <a href='101_write.subx.html#L12'>_write</a>/disp32
|
||||
<span id="L67" class="LineNr"> 67 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L68" class="LineNr"> 68 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L69" class="LineNr"> 69 </span> <span class="subxS1Comment"># . syscall(exit, 1)</span>
|
||||
<span id="L69" class="LineNr"> 69 </span> <span class="subxS1Comment"># . syscall_exit(1)</span>
|
||||
<span id="L70" class="LineNr"> 70 </span> bb/copy-to-ebx 1/imm32
|
||||
<span id="L71" class="LineNr"> 71 </span> e8/call <a href='000init.subx.html#L18'>syscall_exit</a>/disp32
|
||||
<span id="L72" class="LineNr"> 72 </span> <span class="subxComment"># never gets here</span>
|
||||
|
|
|
@ -14,15 +14,15 @@ pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
|
|||
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
|
||||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxH1Comment { color: #005faf; text-decoration: underline; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.subxS2Comment { color: #8a8a8a; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.Constant { color: #008787; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.subxTest { color: #5f8700; }
|
||||
.subxH1Comment { color: #005faf; text-decoration: underline; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
@ -162,7 +162,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L102" class="LineNr">102 </span> e8/call <a href='101_write.subx.html#L12'>_write</a>/disp32
|
||||
<span id="L103" class="LineNr">103 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L104" class="LineNr">104 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L105" class="LineNr">105 </span> <span class="subxS1Comment"># . syscall(exit, 1)</span>
|
||||
<span id="L105" class="LineNr">105 </span> <span class="subxS1Comment"># . syscall_exit(1)</span>
|
||||
<span id="L106" class="LineNr">106 </span> bb/copy-to-ebx 1/imm32
|
||||
<span id="L107" class="LineNr">107 </span> e8/call <a href='000init.subx.html#L18'>syscall_exit</a>/disp32
|
||||
<span id="L108" class="LineNr">108 </span> <span class="subxComment"># never gets here</span>
|
||||
|
@ -346,7 +346,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L286" class="LineNr">286 </span> e8/call <a href='101_write.subx.html#L12'>_write</a>/disp32
|
||||
<span id="L287" class="LineNr">287 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L288" class="LineNr">288 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L289" class="LineNr">289 </span> <span class="subxS1Comment"># . syscall(exit, 1)</span>
|
||||
<span id="L289" class="LineNr">289 </span> <span class="subxS1Comment"># . syscall_exit(1)</span>
|
||||
<span id="L290" class="LineNr">290 </span> bb/copy-to-ebx 1/imm32
|
||||
<span id="L291" class="LineNr">291 </span> e8/call <a href='000init.subx.html#L18'>syscall_exit</a>/disp32
|
||||
<span id="L292" class="LineNr">292 </span> <span class="subxComment"># never gets here</span>
|
||||
|
|
|
@ -14,16 +14,16 @@ pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
|
|||
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
|
||||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxH1Comment { color: #005faf; text-decoration: underline; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.subxS2Comment { color: #8a8a8a; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.Constant { color: #008787; }
|
||||
.subxTest { color: #5f8700; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.Folded { color: #080808; background-color: #949494; }
|
||||
.subxTest { color: #5f8700; }
|
||||
.subxH1Comment { color: #005faf; text-decoration: underline; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
@ -917,7 +917,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L856" class="LineNr"> 856 </span> e8/call <a href='101_write.subx.html#L12'>_write</a>/disp32
|
||||
<span id="L857" class="LineNr"> 857 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L858" class="LineNr"> 858 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L859" class="LineNr"> 859 </span> <span class="subxS1Comment"># . syscall(exit, 1)</span>
|
||||
<span id="L859" class="LineNr"> 859 </span> <span class="subxS1Comment"># . syscall_exit(1)</span>
|
||||
<span id="L860" class="LineNr"> 860 </span> bb/copy-to-ebx 1/imm32
|
||||
<span id="L861" class="LineNr"> 861 </span> e8/call <a href='000init.subx.html#L18'>syscall_exit</a>/disp32
|
||||
<span id="L862" class="LineNr"> 862 </span> <span class="subxComment"># never gets here</span>
|
||||
|
@ -1181,7 +1181,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L1120" class="LineNr">1120 </span> e8/call <a href='101_write.subx.html#L12'>_write</a>/disp32
|
||||
<span id="L1121" class="LineNr">1121 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L1122" class="LineNr">1122 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L1123" class="LineNr">1123 </span> <span class="subxS1Comment"># . syscall(exit, 1)</span>
|
||||
<span id="L1123" class="LineNr">1123 </span> <span class="subxS1Comment"># . syscall_exit(1)</span>
|
||||
<span id="L1124" class="LineNr">1124 </span> bb/copy-to-ebx 1/imm32
|
||||
<span id="L1125" class="LineNr">1125 </span> e8/call <a href='000init.subx.html#L18'>syscall_exit</a>/disp32
|
||||
<span id="L1126" class="LineNr">1126 </span> <span class="subxComment"># never gets here</span>
|
||||
|
@ -1228,7 +1228,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L1167" class="LineNr">1167 </span> 8b/copy 1/mod/*+disp8 3/rm32/ebx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebx+4) to eax</span>
|
||||
<span id="L1168" class="LineNr">1168 </span> <span class="subxComment"># skip payload->allocid</span>
|
||||
<span id="L1169" class="LineNr">1169 </span> 05/add-to-eax 4/imm32
|
||||
<span id="L1170" class="Folded">1170 </span><span class="Folded">+-- 26 lines: #? # dump eax --------------------------------------------------------------------------------------------------------------------------------------------</span>
|
||||
<span id="L1170" class="Folded">1170 </span><span class="Folded">+-- 26 lines: #? # dump eax ---------------------------------------------------------------------------------------------------------------------------------------------------------</span>
|
||||
<span id="L1196" class="LineNr">1196 </span> <span class="subxComment"># eax = string-equal?(eax, "Abc")</span>
|
||||
<span id="L1197" class="LineNr">1197 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L1198" class="LineNr">1198 </span> 68/push <span class="Constant">"Abc"</span>/imm32
|
||||
|
|
|
@ -15,13 +15,13 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.subxS2Comment { color: #8a8a8a; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.Constant { color: #008787; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.subxTest { color: #5f8700; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
|
|
@ -15,13 +15,13 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.subxS2Comment { color: #8a8a8a; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.Constant { color: #008787; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.subxTest { color: #5f8700; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
|
|
@ -14,18 +14,18 @@ pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
|
|||
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
|
||||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxH1Comment { color: #005faf; text-decoration: underline; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.subxS2Comment { color: #8a8a8a; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.Constant { color: #008787; }
|
||||
.CommentedCode { color: #8a8a8a; }
|
||||
.SpecialChar { color: #d70000; }
|
||||
.Constant { color: #008787; }
|
||||
.subxTest { color: #5f8700; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.Folded { color: #080808; background-color: #949494; }
|
||||
.subxTest { color: #5f8700; }
|
||||
.subxH1Comment { color: #005faf; text-decoration: underline; }
|
||||
.CommentedCode { color: #8a8a8a; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
@ -94,7 +94,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L31" class="LineNr"> 31 </span> <span class="subxComment"># ++curr</span>
|
||||
<span id="L32" class="LineNr"> 32 </span> <span class="subxComment"># ++w</span>
|
||||
<span id="L33" class="LineNr"> 33 </span> <span class="subxComment"># out->write = w</span>
|
||||
<span id="L34" class="LineNr"> 34 </span> <span class="subxComment"># (based on K&R itoa: <a href="https://en.wikibooks.org/wiki/C_Programming/stdlib.h/itoa)">https://en.wikibooks.org/wiki/C_Programming/stdlib.h/itoa)</a></span>
|
||||
<span id="L34" class="LineNr"> 34 </span> <span class="subxComment"># (based on K&R itoa: <a href="https://en.wikibooks.org/wiki/C_Programming/stdlib.h/itoa">https://en.wikibooks.org/wiki/C_Programming/stdlib.h/itoa</a>)</span>
|
||||
<span id="L35" class="LineNr"> 35 </span> <span class="subxComment"># (this pseudocode contains registers because operations like division</span>
|
||||
<span id="L36" class="LineNr"> 36 </span> <span class="subxComment"># require specific registers in x86)</span>
|
||||
<span id="L37" class="LineNr"> 37 </span> <span class="subxComment">#</span>
|
||||
|
@ -185,7 +185,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L122" class="LineNr">122 </span> e8/call <a href='101_write.subx.html#L12'>_write</a>/disp32
|
||||
<span id="L123" class="LineNr">123 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L124" class="LineNr">124 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L125" class="LineNr">125 </span> <span class="subxS1Comment"># . syscall(exit, 1)</span>
|
||||
<span id="L125" class="LineNr">125 </span> <span class="subxS1Comment"># . syscall_exit(1)</span>
|
||||
<span id="L126" class="LineNr">126 </span> bb/copy-to-ebx 1/imm32
|
||||
<span id="L127" class="LineNr">127 </span> e8/call <a href='000init.subx.html#L18'>syscall_exit</a>/disp32
|
||||
<span id="L128" class="LineNr">128 </span> <span class="subxComment"># never gets here</span>
|
||||
|
@ -298,7 +298,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L235" class="LineNr">235 </span> e8/call <a href='126write-int-decimal.subx.html#L8'>write-int32-decimal</a>/disp32
|
||||
<span id="L236" class="LineNr">236 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L237" class="LineNr">237 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L238" class="Folded">238 </span><span class="Folded">+-- 26 lines: #? # dump _test-stream -----------------------------------------------------------------------------------------------------------------------------------</span>
|
||||
<span id="L238" class="Folded">238 </span><span class="Folded">+-- 26 lines: #? # dump _test-stream ------------------------------------------------------------------------------------------------------------------------------------------------</span>
|
||||
<span id="L264" class="LineNr">264 </span> <span class="subxComment"># check-stream-equal(_test-stream, "-9", msg)</span>
|
||||
<span id="L265" class="LineNr">265 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L266" class="LineNr">266 </span> 68/push <span class="Constant">"F - test-write-int32-decimal-negative"</span>/imm32
|
||||
|
@ -341,7 +341,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L303" class="LineNr">303 </span> <span class="subxS1Comment"># . end</span>
|
||||
<span id="L304" class="LineNr">304 </span> c3/return
|
||||
<span id="L305" class="LineNr">305 </span>
|
||||
<span id="L306" class="LineNr">306 </span><span class="subxFunction">decimal-digit?</span>: <span class="subxComment"># c: grapheme -> result/eax: boolean</span>
|
||||
<span id="L306" class="LineNr">306 </span><span class="subxFunction">decimal-digit?</span>: <span class="subxComment"># c: code-point-utf8 -> result/eax: boolean</span>
|
||||
<span id="L307" class="LineNr">307 </span> <span class="subxS1Comment"># . prologue</span>
|
||||
<span id="L308" class="LineNr">308 </span> 55/push-ebp
|
||||
<span id="L309" class="LineNr">309 </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>
|
||||
|
@ -440,7 +440,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L402" class="LineNr">402 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L403" class="LineNr">403 </span> c3/return
|
||||
<span id="L404" class="LineNr">404 </span>
|
||||
<span id="L405" class="LineNr">405 </span><span class="subxFunction">to-decimal-digit</span>: <span class="subxComment"># in: grapheme -> out/eax: int</span>
|
||||
<span id="L405" class="LineNr">405 </span><span class="subxFunction">to-decimal-digit</span>: <span class="subxComment"># in: code-point-utf8 -> out/eax: int</span>
|
||||
<span id="L406" class="LineNr">406 </span> <span class="subxS1Comment"># . prologue</span>
|
||||
<span id="L407" class="LineNr">407 </span> 55/push-ebp
|
||||
<span id="L408" class="LineNr">408 </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>
|
||||
|
@ -496,7 +496,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L458" class="LineNr">458 </span> e8/call <a href='115write-byte.subx.html#L81'>flush</a>/disp32
|
||||
<span id="L459" class="LineNr">459 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L460" class="LineNr">460 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L461" class="LineNr">461 </span> <span class="subxS1Comment"># . syscall(exit, 1)</span>
|
||||
<span id="L461" class="LineNr">461 </span> <span class="subxS1Comment"># . syscall_exit(1)</span>
|
||||
<span id="L462" class="LineNr">462 </span> bb/copy-to-ebx 1/imm32
|
||||
<span id="L463" class="LineNr">463 </span> e8/call <a href='000init.subx.html#L18'>syscall_exit</a>/disp32
|
||||
<span id="L464" class="LineNr">464 </span> <span class="subxComment"># never gets here</span>
|
||||
|
|
|
@ -15,13 +15,13 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.subxS2Comment { color: #8a8a8a; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.Constant { color: #008787; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.subxTest { color: #5f8700; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
@ -97,328 +97,343 @@ if ('onhashchange' in window) {
|
|||
<span id="L38" class="LineNr"> 38 </span> <span class="subxS1Comment"># . return out</span>
|
||||
<span id="L39" class="LineNr"> 39 </span> c7 0/subop/copy 0/mod/direct 7/rm32/edi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/imm32 <span class="subxComment"># copy to *edi</span>
|
||||
<span id="L40" class="LineNr"> 40 </span> c7 0/subop/copy 1/mod/*+disp8 7/rm32/edi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/disp8 0/imm32 <span class="subxComment"># copy to *(edi+4)</span>
|
||||
<span id="L41" class="LineNr"> 41 </span> eb/jump $next-word:end/disp8
|
||||
<span id="L41" class="LineNr"> 41 </span> e9/jump $next-word:end/disp32
|
||||
<span id="L42" class="LineNr"> 42 </span><span class="Constant">$next-word:check-for-comment</span>:
|
||||
<span id="L43" class="LineNr"> 43 </span> <span class="subxComment"># out->start = &line->data[line->read]</span>
|
||||
<span id="L44" class="LineNr"> 44 </span> 8b/copy 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(esi+4) to ecx</span>
|
||||
<span id="L45" class="LineNr"> 45 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/esi 1/index/ecx <span class="Normal"> . </span> 0/r32/eax 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy esi+ecx+12 to eax</span>
|
||||
<span id="L46" class="LineNr"> 46 </span> 89/copy 0/mod/indirect 7/rm32/edi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy eax to *edi</span>
|
||||
<span id="L47" class="LineNr"> 47 </span> <span class="subxComment"># if (line->data[line->read] == '#') out->end = &line->data[line->write]), skip rest of stream and return</span>
|
||||
<span id="L47" class="LineNr"> 47 </span> <span class="subxComment"># if (line->data[line->read] == '#') return rest of line</span>
|
||||
<span id="L48" class="LineNr"> 48 </span> <span class="subxS1Comment"># . eax = line->data[line->read]</span>
|
||||
<span id="L49" class="LineNr"> 49 </span> 31/xor 3/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># clear eax</span>
|
||||
<span id="L50" class="LineNr"> 50 </span> 8a/copy-byte 1/mod/*+disp8 4/rm32/sib 6/base/esi 1/index/ecx <span class="Normal"> . </span> 0/r32/AL 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy byte at *(esi+ecx+12) to AL</span>
|
||||
<span id="L51" class="LineNr"> 51 </span> <span class="subxS1Comment"># . compare</span>
|
||||
<span id="L52" class="LineNr"> 52 </span> 3d/compare-eax-and 0x23/imm32/pound
|
||||
<span id="L53" class="LineNr"> 53 </span> 75/jump-if-!= $next-word:regular-word/disp8
|
||||
<span id="L53" class="LineNr"> 53 </span> 0f 85/jump-if-!= $next-word:regular-word/disp32
|
||||
<span id="L54" class="LineNr"> 54 </span><span class="Constant">$next-word:comment</span>:
|
||||
<span id="L55" class="LineNr"> 55 </span> <span class="subxS1Comment"># . out->end = &line->data[line->write]</span>
|
||||
<span id="L56" class="LineNr"> 56 </span> 8b/copy 0/mod/indirect 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *esi to eax</span>
|
||||
<span id="L57" class="LineNr"> 57 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/esi 0/index/eax <span class="Normal"> . </span> 0/r32/eax 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy esi+eax+12 to eax</span>
|
||||
<span id="L58" class="LineNr"> 58 </span> 89/copy 1/mod/*+disp8 7/rm32/edi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy eax to *(edi+4)</span>
|
||||
<span id="L59" class="LineNr"> 59 </span> <span class="subxS1Comment"># . line->read = line->write</span>
|
||||
<span id="L60" class="LineNr"> 60 </span> 8b/copy 0/mod/indirect 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *esi to eax</span>
|
||||
<span id="L61" class="LineNr"> 61 </span> 89/copy 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy eax to *(esi+4)</span>
|
||||
<span id="L62" class="LineNr"> 62 </span> <span class="subxS1Comment"># . return</span>
|
||||
<span id="L63" class="LineNr"> 63 </span> eb/jump $next-word:end/disp8
|
||||
<span id="L64" class="LineNr"> 64 </span><span class="Constant">$next-word:regular-word</span>:
|
||||
<span id="L65" class="LineNr"> 65 </span> <span class="subxComment"># otherwise skip-chars-not-matching-whitespace(line) # including trailing newline</span>
|
||||
<span id="L66" class="LineNr"> 66 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L67" class="LineNr"> 67 </span> ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(ebp+8)</span>
|
||||
<span id="L68" class="LineNr"> 68 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L69" class="LineNr"> 69 </span> e8/call <a href='124next-token.subx.html#L716'>skip-chars-not-matching-whitespace</a>/disp32
|
||||
<span id="L70" class="LineNr"> 70 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L71" class="LineNr"> 71 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L72" class="LineNr"> 72 </span> <span class="subxComment"># out->end = &line->data[line->read]</span>
|
||||
<span id="L73" class="LineNr"> 73 </span> 8b/copy 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(esi+4) to ecx</span>
|
||||
<span id="L74" class="LineNr"> 74 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/esi 1/index/ecx <span class="Normal"> . </span> 0/r32/eax 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy esi+ecx+12 to eax</span>
|
||||
<span id="L75" class="LineNr"> 75 </span> 89/copy 1/mod/*+disp8 7/rm32/edi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy eax to *(edi+4)</span>
|
||||
<span id="L76" class="LineNr"> 76 </span><span class="Constant">$next-word:end</span>:
|
||||
<span id="L77" class="LineNr"> 77 </span> <span class="subxS1Comment"># . restore registers</span>
|
||||
<span id="L78" class="LineNr"> 78 </span> 5f/pop-to-edi
|
||||
<span id="L79" class="LineNr"> 79 </span> 5e/pop-to-esi
|
||||
<span id="L80" class="LineNr"> 80 </span> 59/pop-to-ecx
|
||||
<span id="L81" class="LineNr"> 81 </span> 58/pop-to-eax
|
||||
<span id="L82" class="LineNr"> 82 </span> <span class="subxS1Comment"># . epilogue</span>
|
||||
<span id="L83" class="LineNr"> 83 </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="L84" class="LineNr"> 84 </span> 5d/pop-to-ebp
|
||||
<span id="L85" class="LineNr"> 85 </span> c3/return
|
||||
<span id="L86" class="LineNr"> 86 </span>
|
||||
<span id="L87" class="LineNr"> 87 </span><span class="subxTest">test-next-word</span>:
|
||||
<span id="L88" class="LineNr"> 88 </span> <span class="subxS1Comment"># . prologue</span>
|
||||
<span id="L89" class="LineNr"> 89 </span> 55/push-ebp
|
||||
<span id="L90" class="LineNr"> 90 </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="L91" class="LineNr"> 91 </span> <span class="subxComment"># setup</span>
|
||||
<span id="L92" class="LineNr"> 92 </span> <span class="subxS1Comment"># . clear-stream(_test-stream)</span>
|
||||
<span id="L93" class="LineNr"> 93 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L94" class="LineNr"> 94 </span> 68/push <a href='108write.subx.html#L151'>_test-stream</a>/imm32
|
||||
<span id="L95" class="LineNr"> 95 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L96" class="LineNr"> 96 </span> e8/call <a href='106stream.subx.html#L17'>clear-stream</a>/disp32
|
||||
<span id="L97" class="LineNr"> 97 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L98" class="LineNr"> 98 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L99" class="LineNr"> 99 </span> <span class="subxComment"># var slice/ecx: slice</span>
|
||||
<span id="L100" class="LineNr">100 </span> 68/push 0/imm32/end
|
||||
<span id="L101" class="LineNr">101 </span> 68/push 0/imm32/start
|
||||
<span id="L102" class="LineNr">102 </span> 89/copy 3/mod/direct 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ecx</span>
|
||||
<span id="L103" class="LineNr">103 </span> <span class="subxComment"># write(_test-stream, " ab")</span>
|
||||
<span id="L104" class="LineNr">104 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L105" class="LineNr">105 </span> 68/push <span class="Constant">" ab"</span>/imm32
|
||||
<span id="L106" class="LineNr">106 </span> 68/push <a href='108write.subx.html#L151'>_test-stream</a>/imm32
|
||||
<span id="L107" class="LineNr">107 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L108" class="LineNr">108 </span> e8/call <a href='108write.subx.html#L24'>write</a>/disp32
|
||||
<span id="L109" class="LineNr">109 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L110" class="LineNr">110 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L111" class="LineNr">111 </span> <span class="subxComment"># next-word(_test-stream, slice)</span>
|
||||
<span id="L112" class="LineNr">112 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L113" class="LineNr">113 </span> 51/push-ecx
|
||||
<span id="L114" class="LineNr">114 </span> 68/push <a href='108write.subx.html#L151'>_test-stream</a>/imm32
|
||||
<span id="L115" class="LineNr">115 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L116" class="LineNr">116 </span> e8/call <a href='127next-word.subx.html#L11'>next-word</a>/disp32
|
||||
<span id="L117" class="LineNr">117 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L118" class="LineNr">118 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L119" class="LineNr">119 </span> <span class="subxComment"># check-ints-equal(slice->start - _test-stream->data, 2, msg)</span>
|
||||
<span id="L120" class="LineNr">120 </span> <span class="subxS1Comment"># . check-ints-equal(slice->start - _test-stream, 14, msg)</span>
|
||||
<span id="L121" class="LineNr">121 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L122" class="LineNr">122 </span> 68/push <span class="Constant">"F - <a href='127next-word.subx.html#L87'>test-next-word</a>: start"</span>/imm32
|
||||
<span id="L123" class="LineNr">123 </span> 68/push 0xe/imm32
|
||||
<span id="L124" class="LineNr">124 </span> <span class="subxS2Comment"># . . push slice->start - _test-stream</span>
|
||||
<span id="L125" class="LineNr">125 </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="L126" class="LineNr">126 </span> 81 5/subop/subtract 3/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <a href='108write.subx.html#L151'>_test-stream</a>/imm32 <span class="subxComment"># subtract from eax</span>
|
||||
<span id="L127" class="LineNr">127 </span> 50/push-eax
|
||||
<span id="L128" class="LineNr">128 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L129" class="LineNr">129 </span> e8/call <a href='102test.subx.html#L23'>check-ints-equal</a>/disp32
|
||||
<span id="L130" class="LineNr">130 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L131" class="LineNr">131 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L132" class="LineNr">132 </span> <span class="subxComment"># check-ints-equal(slice->end - _test-stream->data, 4, msg)</span>
|
||||
<span id="L133" class="LineNr">133 </span> <span class="subxS1Comment"># . check-ints-equal(slice->end - _test-stream, 16, msg)</span>
|
||||
<span id="L134" class="LineNr">134 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L135" class="LineNr">135 </span> 68/push <span class="Constant">"F - <a href='127next-word.subx.html#L87'>test-next-word</a>: end"</span>/imm32
|
||||
<span id="L136" class="LineNr">136 </span> 68/push 0x10/imm32
|
||||
<span id="L137" class="LineNr">137 </span> <span class="subxS2Comment"># . . push slice->end - _test-stream</span>
|
||||
<span id="L138" class="LineNr">138 </span> 8b/copy 1/mod/*+disp8 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ecx+4) to eax</span>
|
||||
<span id="L139" class="LineNr">139 </span> 81 5/subop/subtract 3/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <a href='108write.subx.html#L151'>_test-stream</a>/imm32 <span class="subxComment"># subtract from eax</span>
|
||||
<span id="L140" class="LineNr">140 </span> 50/push-eax
|
||||
<span id="L141" class="LineNr">141 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L142" class="LineNr">142 </span> e8/call <a href='102test.subx.html#L23'>check-ints-equal</a>/disp32
|
||||
<span id="L143" class="LineNr">143 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L144" class="LineNr">144 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L145" class="LineNr">145 </span> <span class="subxS1Comment"># . epilogue</span>
|
||||
<span id="L146" class="LineNr">146 </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="L147" class="LineNr">147 </span> 5d/pop-to-ebp
|
||||
<span id="L148" class="LineNr">148 </span> c3/return
|
||||
<span id="L149" class="LineNr">149 </span>
|
||||
<span id="L150" class="LineNr">150 </span><span class="subxTest">test-next-word-returns-whole-comment</span>:
|
||||
<span id="L151" class="LineNr">151 </span> <span class="subxS1Comment"># . prologue</span>
|
||||
<span id="L152" class="LineNr">152 </span> 55/push-ebp
|
||||
<span id="L153" class="LineNr">153 </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="L154" class="LineNr">154 </span> <span class="subxComment"># setup</span>
|
||||
<span id="L155" class="LineNr">155 </span> <span class="subxS1Comment"># . clear-stream(_test-stream)</span>
|
||||
<span id="L156" class="LineNr">156 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L157" class="LineNr">157 </span> 68/push <a href='108write.subx.html#L151'>_test-stream</a>/imm32
|
||||
<span id="L158" class="LineNr">158 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L159" class="LineNr">159 </span> e8/call <a href='106stream.subx.html#L17'>clear-stream</a>/disp32
|
||||
<span id="L160" class="LineNr">160 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L161" class="LineNr">161 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L162" class="LineNr">162 </span> <span class="subxComment"># var slice/ecx: slice</span>
|
||||
<span id="L163" class="LineNr">163 </span> 68/push 0/imm32/end
|
||||
<span id="L164" class="LineNr">164 </span> 68/push 0/imm32/start
|
||||
<span id="L165" class="LineNr">165 </span> 89/copy 3/mod/direct 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ecx</span>
|
||||
<span id="L166" class="LineNr">166 </span> <span class="subxComment"># write(_test-stream, " # a")</span>
|
||||
<span id="L167" class="LineNr">167 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L168" class="LineNr">168 </span> 68/push <span class="Constant">" # a"</span>/imm32
|
||||
<span id="L169" class="LineNr">169 </span> 68/push <a href='108write.subx.html#L151'>_test-stream</a>/imm32
|
||||
<span id="L170" class="LineNr">170 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L171" class="LineNr">171 </span> e8/call <a href='108write.subx.html#L24'>write</a>/disp32
|
||||
<span id="L172" class="LineNr">172 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L173" class="LineNr">173 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L174" class="LineNr">174 </span> <span class="subxComment"># next-word(_test-stream, slice)</span>
|
||||
<span id="L175" class="LineNr">175 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L176" class="LineNr">176 </span> 51/push-ecx
|
||||
<span id="L177" class="LineNr">177 </span> 68/push <a href='108write.subx.html#L151'>_test-stream</a>/imm32
|
||||
<span id="L178" class="LineNr">178 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L179" class="LineNr">179 </span> e8/call <a href='127next-word.subx.html#L11'>next-word</a>/disp32
|
||||
<span id="L180" class="LineNr">180 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L181" class="LineNr">181 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L182" class="LineNr">182 </span> <span class="subxComment"># check-ints-equal(slice->start - _test-stream->data, 2, msg)</span>
|
||||
<span id="L183" class="LineNr">183 </span> <span class="subxS1Comment"># . check-ints-equal(slice->start - _test-stream, 14, msg)</span>
|
||||
<span id="L184" class="LineNr">184 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L185" class="LineNr">185 </span> 68/push <span class="Constant">"F - <a href='127next-word.subx.html#L150'>test-next-word-returns-whole-comment</a>: start"</span>/imm32
|
||||
<span id="L186" class="LineNr">186 </span> 68/push 0xe/imm32
|
||||
<span id="L187" class="LineNr">187 </span> <span class="subxS2Comment"># . . push slice->start - _test-stream</span>
|
||||
<span id="L188" class="LineNr">188 </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="L189" class="LineNr">189 </span> 81 5/subop/subtract 3/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <a href='108write.subx.html#L151'>_test-stream</a>/imm32 <span class="subxComment"># subtract from eax</span>
|
||||
<span id="L190" class="LineNr">190 </span> 50/push-eax
|
||||
<span id="L191" class="LineNr">191 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L192" class="LineNr">192 </span> e8/call <a href='102test.subx.html#L23'>check-ints-equal</a>/disp32
|
||||
<span id="L193" class="LineNr">193 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L194" class="LineNr">194 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L195" class="LineNr">195 </span> <span class="subxComment"># check-ints-equal(slice->end - _test-stream->data, 5, msg)</span>
|
||||
<span id="L196" class="LineNr">196 </span> <span class="subxS1Comment"># . check-ints-equal(slice->end - _test-stream, 17, msg)</span>
|
||||
<span id="L197" class="LineNr">197 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L198" class="LineNr">198 </span> 68/push <span class="Constant">"F - <a href='127next-word.subx.html#L150'>test-next-word-returns-whole-comment</a>: end"</span>/imm32
|
||||
<span id="L199" class="LineNr">199 </span> 68/push 0x11/imm32
|
||||
<span id="L200" class="LineNr">200 </span> <span class="subxS2Comment"># . . push slice->end - _test-stream</span>
|
||||
<span id="L201" class="LineNr">201 </span> 8b/copy 1/mod/*+disp8 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ecx+4) to eax</span>
|
||||
<span id="L202" class="LineNr">202 </span> 81 5/subop/subtract 3/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <a href='108write.subx.html#L151'>_test-stream</a>/imm32 <span class="subxComment"># subtract from eax</span>
|
||||
<span id="L203" class="LineNr">203 </span> 50/push-eax
|
||||
<span id="L204" class="LineNr">204 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L205" class="LineNr">205 </span> e8/call <a href='102test.subx.html#L23'>check-ints-equal</a>/disp32
|
||||
<span id="L206" class="LineNr">206 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L207" class="LineNr">207 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L208" class="LineNr">208 </span> <span class="subxS1Comment"># . epilogue</span>
|
||||
<span id="L209" class="LineNr">209 </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="L210" class="LineNr">210 </span> 5d/pop-to-ebp
|
||||
<span id="L211" class="LineNr">211 </span> c3/return
|
||||
<span id="L212" class="LineNr">212 </span>
|
||||
<span id="L213" class="LineNr">213 </span><span class="subxTest">test-next-word-returns-empty-string-on-eof</span>:
|
||||
<span id="L214" class="LineNr">214 </span> <span class="subxS1Comment"># . prologue</span>
|
||||
<span id="L215" class="LineNr">215 </span> 55/push-ebp
|
||||
<span id="L216" class="LineNr">216 </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="L217" class="LineNr">217 </span> <span class="subxComment"># setup</span>
|
||||
<span id="L218" class="LineNr">218 </span> <span class="subxS1Comment"># . clear-stream(_test-stream)</span>
|
||||
<span id="L219" class="LineNr">219 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L220" class="LineNr">220 </span> 68/push <a href='108write.subx.html#L151'>_test-stream</a>/imm32
|
||||
<span id="L221" class="LineNr">221 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L222" class="LineNr">222 </span> e8/call <a href='106stream.subx.html#L17'>clear-stream</a>/disp32
|
||||
<span id="L223" class="LineNr">223 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L224" class="LineNr">224 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L225" class="LineNr">225 </span> <span class="subxComment"># var slice/ecx: slice</span>
|
||||
<span id="L226" class="LineNr">226 </span> 68/push 0/imm32/end
|
||||
<span id="L227" class="LineNr">227 </span> 68/push 0/imm32/start
|
||||
<span id="L228" class="LineNr">228 </span> 89/copy 3/mod/direct 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ecx</span>
|
||||
<span id="L229" class="LineNr">229 </span> <span class="subxComment"># write nothing to _test-stream</span>
|
||||
<span id="L230" class="LineNr">230 </span> <span class="subxComment"># next-word(_test-stream, slice)</span>
|
||||
<span id="L231" class="LineNr">231 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L232" class="LineNr">232 </span> 51/push-ecx
|
||||
<span id="L233" class="LineNr">233 </span> 68/push <a href='108write.subx.html#L151'>_test-stream</a>/imm32
|
||||
<span id="L234" class="LineNr">234 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L235" class="LineNr">235 </span> e8/call <a href='127next-word.subx.html#L11'>next-word</a>/disp32
|
||||
<span id="L236" class="LineNr">236 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L237" class="LineNr">237 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L238" class="LineNr">238 </span> <span class="subxComment"># check-ints-equal(slice->end - slice->start, 0, msg)</span>
|
||||
<span id="L239" class="LineNr">239 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L240" class="LineNr">240 </span> 68/push <span class="Constant">"F - test-next-word-returns-empty-string-on-eof"</span>/imm32
|
||||
<span id="L241" class="LineNr">241 </span> 68/push 0/imm32
|
||||
<span id="L242" class="LineNr">242 </span> <span class="subxS2Comment"># . . push slice->end - slice->start</span>
|
||||
<span id="L243" class="LineNr">243 </span> 8b/copy 1/mod/*+disp8 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ecx+4) to eax</span>
|
||||
<span id="L244" class="LineNr">244 </span> 2b/subtract 0/mod/indirect 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># subtract *ecx from eax</span>
|
||||
<span id="L245" class="LineNr">245 </span> 50/push-eax
|
||||
<span id="L246" class="LineNr">246 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L247" class="LineNr">247 </span> e8/call <a href='102test.subx.html#L23'>check-ints-equal</a>/disp32
|
||||
<span id="L248" class="LineNr">248 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L249" class="LineNr">249 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L250" class="LineNr">250 </span> <span class="subxS1Comment"># . epilogue</span>
|
||||
<span id="L251" class="LineNr">251 </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="L252" class="LineNr">252 </span> 5d/pop-to-ebp
|
||||
<span id="L253" class="LineNr">253 </span> c3/return
|
||||
<span id="L254" class="LineNr">254 </span>
|
||||
<span id="L255" class="LineNr">255 </span><span class="subxTest">test-next-word-returns-empty-string-on-newline</span>:
|
||||
<span id="L256" class="LineNr">256 </span> <span class="subxS1Comment"># . prologue</span>
|
||||
<span id="L257" class="LineNr">257 </span> 55/push-ebp
|
||||
<span id="L258" class="LineNr">258 </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="L259" class="LineNr">259 </span> <span class="subxComment"># setup</span>
|
||||
<span id="L260" class="LineNr">260 </span> <span class="subxS1Comment"># . clear-stream(_test-stream)</span>
|
||||
<span id="L261" class="LineNr">261 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L262" class="LineNr">262 </span> 68/push <a href='108write.subx.html#L151'>_test-stream</a>/imm32
|
||||
<span id="L263" class="LineNr">263 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L264" class="LineNr">264 </span> e8/call <a href='106stream.subx.html#L17'>clear-stream</a>/disp32
|
||||
<span id="L265" class="LineNr">265 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L266" class="LineNr">266 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L267" class="LineNr">267 </span> <span class="subxComment"># var slice/ecx: slice</span>
|
||||
<span id="L268" class="LineNr">268 </span> 68/push 0/imm32/end
|
||||
<span id="L269" class="LineNr">269 </span> 68/push 0/imm32/start
|
||||
<span id="L270" class="LineNr">270 </span> 89/copy 3/mod/direct 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ecx</span>
|
||||
<span id="L271" class="LineNr">271 </span> <span class="subxComment"># write some whitespace and a newline</span>
|
||||
<span id="L272" class="LineNr">272 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L273" class="LineNr">273 </span> 68/push <span class="Constant">" \n"</span>/imm32
|
||||
<span id="L274" class="LineNr">274 </span> 68/push <a href='108write.subx.html#L151'>_test-stream</a>/imm32
|
||||
<span id="L275" class="LineNr">275 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L276" class="LineNr">276 </span> e8/call <a href='108write.subx.html#L24'>write</a>/disp32
|
||||
<span id="L277" class="LineNr">277 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L278" class="LineNr">278 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L279" class="LineNr">279 </span> <span class="subxComment"># next-word(_test-stream, slice)</span>
|
||||
<span id="L280" class="LineNr">280 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L281" class="LineNr">281 </span> 51/push-ecx
|
||||
<span id="L282" class="LineNr">282 </span> 68/push <a href='108write.subx.html#L151'>_test-stream</a>/imm32
|
||||
<span id="L283" class="LineNr">283 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L284" class="LineNr">284 </span> e8/call <a href='127next-word.subx.html#L11'>next-word</a>/disp32
|
||||
<span id="L285" class="LineNr">285 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L286" class="LineNr">286 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L287" class="LineNr">287 </span> <span class="subxComment"># check-ints-equal(slice->end - slice->start, 0, msg)</span>
|
||||
<span id="L288" class="LineNr">288 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L289" class="LineNr">289 </span> 68/push <span class="Constant">"F - test-next-word-returns-empty-string-on-newline"</span>/imm32
|
||||
<span id="L290" class="LineNr">290 </span> 68/push 0/imm32
|
||||
<span id="L291" class="LineNr">291 </span> <span class="subxS2Comment"># . . push slice->end - slice->start</span>
|
||||
<span id="L292" class="LineNr">292 </span> 8b/copy 1/mod/*+disp8 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ecx+4) to eax</span>
|
||||
<span id="L293" class="LineNr">293 </span> 2b/subtract 0/mod/indirect 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># subtract *ecx from eax</span>
|
||||
<span id="L294" class="LineNr">294 </span> 50/push-eax
|
||||
<span id="L295" class="LineNr">295 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L296" class="LineNr">296 </span> e8/call <a href='102test.subx.html#L23'>check-ints-equal</a>/disp32
|
||||
<span id="L297" class="LineNr">297 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L298" class="LineNr">298 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L299" class="LineNr">299 </span> <span class="subxS1Comment"># . epilogue</span>
|
||||
<span id="L300" class="LineNr">300 </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="L301" class="LineNr">301 </span> 5d/pop-to-ebp
|
||||
<span id="L302" class="LineNr">302 </span> c3/return
|
||||
<span id="L303" class="LineNr">303 </span>
|
||||
<span id="L304" class="LineNr">304 </span><span class="subxComment"># (re)compute the bounds of the next word in the line (separated by whitespace)</span>
|
||||
<span id="L305" class="LineNr">305 </span><span class="subxComment"># return empty string on reaching end of file</span>
|
||||
<span id="L306" class="LineNr">306 </span><span class="subxFunction">next-raw-word</span>: <span class="subxComment"># line: (addr stream byte), out: (addr slice)</span>
|
||||
<span id="L307" class="LineNr">307 </span> <span class="subxS1Comment"># . prologue</span>
|
||||
<span id="L308" class="LineNr">308 </span> 55/push-ebp
|
||||
<span id="L309" class="LineNr">309 </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="L310" class="LineNr">310 </span> <span class="subxS1Comment"># . save registers</span>
|
||||
<span id="L311" class="LineNr">311 </span> 50/push-eax
|
||||
<span id="L312" class="LineNr">312 </span> 51/push-ecx
|
||||
<span id="L313" class="LineNr">313 </span> 56/push-esi
|
||||
<span id="L314" class="LineNr">314 </span> 57/push-edi
|
||||
<span id="L315" class="LineNr">315 </span> <span class="subxComment"># esi = line</span>
|
||||
<span id="L316" class="LineNr">316 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to esi</span>
|
||||
<span id="L317" class="LineNr">317 </span> <span class="subxComment"># edi = out</span>
|
||||
<span id="L318" class="LineNr">318 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 7/r32/edi 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+12) to edi</span>
|
||||
<span id="L319" class="LineNr">319 </span> <span class="subxComment"># skip-chars-matching-whitespace(line)</span>
|
||||
<span id="L320" class="LineNr">320 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L321" class="LineNr">321 </span> ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(ebp+8)</span>
|
||||
<span id="L322" class="LineNr">322 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L323" class="LineNr">323 </span> e8/call <a href='124next-token.subx.html#L464'>skip-chars-matching-whitespace</a>/disp32
|
||||
<span id="L324" class="LineNr">324 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L325" class="LineNr">325 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L326" class="LineNr">326 </span><span class="Constant">$next-raw-word:check0</span>:
|
||||
<span id="L327" class="LineNr">327 </span> <span class="subxComment"># if (line->read >= line->write) clear out and return</span>
|
||||
<span id="L328" class="LineNr">328 </span> <span class="subxS1Comment"># . eax = line->read</span>
|
||||
<span id="L329" class="LineNr">329 </span> 8b/copy 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(esi+4) to eax</span>
|
||||
<span id="L330" class="LineNr">330 </span> <span class="subxS1Comment"># . if (eax < line->write) goto next check</span>
|
||||
<span id="L331" class="LineNr">331 </span> 3b/compare 0/mod/indirect 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># compare eax with *esi</span>
|
||||
<span id="L332" class="LineNr">332 </span> 7c/jump-if-< $next-raw-word:word-exists/disp8
|
||||
<span id="L333" class="LineNr">333 </span> <span class="subxS1Comment"># . return out</span>
|
||||
<span id="L334" class="LineNr">334 </span> c7 0/subop/copy 0/mod/direct 7/rm32/edi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/imm32 <span class="subxComment"># copy to *edi</span>
|
||||
<span id="L335" class="LineNr">335 </span> c7 0/subop/copy 1/mod/*+disp8 7/rm32/edi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/disp8 0/imm32 <span class="subxComment"># copy to *(edi+4)</span>
|
||||
<span id="L336" class="LineNr">336 </span> eb/jump $next-raw-word:end/disp8
|
||||
<span id="L337" class="LineNr">337 </span><span class="Constant">$next-raw-word:word-exists</span>:
|
||||
<span id="L338" class="LineNr">338 </span> <span class="subxComment"># out->start = &line->data[line->read]</span>
|
||||
<span id="L339" class="LineNr">339 </span> 8b/copy 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(esi+4) to ecx</span>
|
||||
<span id="L340" class="LineNr">340 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/esi 1/index/ecx <span class="Normal"> . </span> 0/r32/eax 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy esi+ecx+12 to eax</span>
|
||||
<span id="L341" class="LineNr">341 </span> 89/copy 0/mod/indirect 7/rm32/edi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy eax to *edi</span>
|
||||
<span id="L342" class="LineNr">342 </span> <span class="subxComment"># skip-chars-not-matching-whitespace(line) # including trailing newline</span>
|
||||
<span id="L343" class="LineNr">343 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L344" class="LineNr">344 </span> ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(ebp+8)</span>
|
||||
<span id="L345" class="LineNr">345 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L346" class="LineNr">346 </span> e8/call <a href='124next-token.subx.html#L716'>skip-chars-not-matching-whitespace</a>/disp32
|
||||
<span id="L347" class="LineNr">347 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L348" class="LineNr">348 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L349" class="LineNr">349 </span> <span class="subxComment"># out->end = &line->data[line->read]</span>
|
||||
<span id="L350" class="LineNr">350 </span> 8b/copy 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(esi+4) to ecx</span>
|
||||
<span id="L351" class="LineNr">351 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/esi 1/index/ecx <span class="Normal"> . </span> 0/r32/eax 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy esi+ecx+12 to eax</span>
|
||||
<span id="L352" class="LineNr">352 </span> 89/copy 1/mod/*+disp8 7/rm32/edi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy eax to *(edi+4)</span>
|
||||
<span id="L353" class="LineNr">353 </span><span class="Constant">$next-raw-word:end</span>:
|
||||
<span id="L354" class="LineNr">354 </span> <span class="subxS1Comment"># . restore registers</span>
|
||||
<span id="L355" class="LineNr">355 </span> 5f/pop-to-edi
|
||||
<span id="L356" class="LineNr">356 </span> 5e/pop-to-esi
|
||||
<span id="L357" class="LineNr">357 </span> 59/pop-to-ecx
|
||||
<span id="L358" class="LineNr">358 </span> 58/pop-to-eax
|
||||
<span id="L359" class="LineNr">359 </span> <span class="subxS1Comment"># . epilogue</span>
|
||||
<span id="L360" class="LineNr">360 </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="L361" class="LineNr">361 </span> 5d/pop-to-ebp
|
||||
<span id="L362" class="LineNr">362 </span> c3/return
|
||||
<span id="L55" class="LineNr"> 55 </span> <span class="subxComment"># out->end = out->start</span>
|
||||
<span id="L56" class="LineNr"> 56 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/esi 1/index/ecx <span class="Normal"> . </span> 0/r32/eax 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy esi+ecx+12 to eax</span>
|
||||
<span id="L57" class="LineNr"> 57 </span> 89/copy 1/mod/*+disp8 7/rm32/edi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy eax to *(edi+4)</span>
|
||||
<span id="L58" class="LineNr"> 58 </span> <span class="subxComment"># var write/ecx: int = line->write</span>
|
||||
<span id="L59" class="LineNr"> 59 </span> 8b/copy 0/mod/indirect 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *esi to ecx</span>
|
||||
<span id="L60" class="LineNr"> 60 </span><span class="Constant">$next-word:comment-loop</span>:
|
||||
<span id="L61" class="LineNr"> 61 </span> <span class="subxComment"># if (line->read >= line->write) break</span>
|
||||
<span id="L62" class="LineNr"> 62 </span> 39/compare 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># compare *(esi+4) with ecx</span>
|
||||
<span id="L63" class="LineNr"> 63 </span> 0f 8d/jump-if->= $next-word:comment-break/disp32
|
||||
<span id="L64" class="LineNr"> 64 </span> <span class="subxComment"># ++line->read</span>
|
||||
<span id="L65" class="LineNr"> 65 </span> ff 0/subop/increment 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># increment *(esi+4)</span>
|
||||
<span id="L66" class="LineNr"> 66 </span> <span class="subxComment"># ++out->end</span>
|
||||
<span id="L67" class="LineNr"> 67 </span> ff 0/subop/increment 1/mod/*+disp8 7/rm32/edi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># increment *(edi+4)</span>
|
||||
<span id="L68" class="LineNr"> 68 </span> <span class="subxComment"># if (*out->end == newline) break</span>
|
||||
<span id="L69" class="LineNr"> 69 </span> 8b/copy 1/mod/*+disp8 7/rm32/edi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(edi+4) to eax</span>
|
||||
<span id="L70" class="LineNr"> 70 </span> 8a/copy-byte 0/mod/indirect 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/AL <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy byte at *eax to AL</span>
|
||||
<span id="L71" class="LineNr"> 71 </span> 25/and-eax-with 0xff/imm32
|
||||
<span id="L72" class="LineNr"> 72 </span> 3d/compare-eax-and 0xa/imm32/newline
|
||||
<span id="L73" class="LineNr"> 73 </span> 0f 84/jump-if-= $next-word:comment-break/disp32
|
||||
<span id="L74" class="LineNr"> 74 </span> <span class="subxComment"># loop</span>
|
||||
<span id="L75" class="LineNr"> 75 </span> e9/jump $next-word:comment-loop/disp32
|
||||
<span id="L76" class="LineNr"> 76 </span><span class="Constant">$next-word:comment-break</span>:
|
||||
<span id="L77" class="LineNr"> 77 </span> <span class="subxComment"># return</span>
|
||||
<span id="L78" class="LineNr"> 78 </span> e9/jump $next-word:end/disp32
|
||||
<span id="L79" class="LineNr"> 79 </span><span class="Constant">$next-word:regular-word</span>:
|
||||
<span id="L80" class="LineNr"> 80 </span> <span class="subxComment"># otherwise skip-chars-not-matching-whitespace(line) # including trailing newline</span>
|
||||
<span id="L81" class="LineNr"> 81 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L82" class="LineNr"> 82 </span> ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(ebp+8)</span>
|
||||
<span id="L83" class="LineNr"> 83 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L84" class="LineNr"> 84 </span> e8/call <a href='124next-token.subx.html#L716'>skip-chars-not-matching-whitespace</a>/disp32
|
||||
<span id="L85" class="LineNr"> 85 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L86" class="LineNr"> 86 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L87" class="LineNr"> 87 </span> <span class="subxComment"># out->end = &line->data[line->read]</span>
|
||||
<span id="L88" class="LineNr"> 88 </span> 8b/copy 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(esi+4) to ecx</span>
|
||||
<span id="L89" class="LineNr"> 89 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/esi 1/index/ecx <span class="Normal"> . </span> 0/r32/eax 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy esi+ecx+12 to eax</span>
|
||||
<span id="L90" class="LineNr"> 90 </span> 89/copy 1/mod/*+disp8 7/rm32/edi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy eax to *(edi+4)</span>
|
||||
<span id="L91" class="LineNr"> 91 </span><span class="Constant">$next-word:end</span>:
|
||||
<span id="L92" class="LineNr"> 92 </span> <span class="subxS1Comment"># . restore registers</span>
|
||||
<span id="L93" class="LineNr"> 93 </span> 5f/pop-to-edi
|
||||
<span id="L94" class="LineNr"> 94 </span> 5e/pop-to-esi
|
||||
<span id="L95" class="LineNr"> 95 </span> 59/pop-to-ecx
|
||||
<span id="L96" class="LineNr"> 96 </span> 58/pop-to-eax
|
||||
<span id="L97" class="LineNr"> 97 </span> <span class="subxS1Comment"># . epilogue</span>
|
||||
<span id="L98" class="LineNr"> 98 </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="L99" class="LineNr"> 99 </span> 5d/pop-to-ebp
|
||||
<span id="L100" class="LineNr">100 </span> c3/return
|
||||
<span id="L101" class="LineNr">101 </span>
|
||||
<span id="L102" class="LineNr">102 </span><span class="subxTest">test-next-word</span>:
|
||||
<span id="L103" class="LineNr">103 </span> <span class="subxS1Comment"># . prologue</span>
|
||||
<span id="L104" class="LineNr">104 </span> 55/push-ebp
|
||||
<span id="L105" class="LineNr">105 </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="L106" class="LineNr">106 </span> <span class="subxComment"># setup</span>
|
||||
<span id="L107" class="LineNr">107 </span> <span class="subxS1Comment"># . clear-stream(_test-stream)</span>
|
||||
<span id="L108" class="LineNr">108 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L109" class="LineNr">109 </span> 68/push <a href='108write.subx.html#L151'>_test-stream</a>/imm32
|
||||
<span id="L110" class="LineNr">110 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L111" class="LineNr">111 </span> e8/call <a href='106stream.subx.html#L17'>clear-stream</a>/disp32
|
||||
<span id="L112" class="LineNr">112 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L113" class="LineNr">113 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L114" class="LineNr">114 </span> <span class="subxComment"># var slice/ecx: slice</span>
|
||||
<span id="L115" class="LineNr">115 </span> 68/push 0/imm32/end
|
||||
<span id="L116" class="LineNr">116 </span> 68/push 0/imm32/start
|
||||
<span id="L117" class="LineNr">117 </span> 89/copy 3/mod/direct 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ecx</span>
|
||||
<span id="L118" class="LineNr">118 </span> <span class="subxComment"># write(_test-stream, " ab")</span>
|
||||
<span id="L119" class="LineNr">119 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L120" class="LineNr">120 </span> 68/push <span class="Constant">" ab"</span>/imm32
|
||||
<span id="L121" class="LineNr">121 </span> 68/push <a href='108write.subx.html#L151'>_test-stream</a>/imm32
|
||||
<span id="L122" class="LineNr">122 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L123" class="LineNr">123 </span> e8/call <a href='108write.subx.html#L24'>write</a>/disp32
|
||||
<span id="L124" class="LineNr">124 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L125" class="LineNr">125 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L126" class="LineNr">126 </span> <span class="subxComment"># next-word(_test-stream, slice)</span>
|
||||
<span id="L127" class="LineNr">127 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L128" class="LineNr">128 </span> 51/push-ecx
|
||||
<span id="L129" class="LineNr">129 </span> 68/push <a href='108write.subx.html#L151'>_test-stream</a>/imm32
|
||||
<span id="L130" class="LineNr">130 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L131" class="LineNr">131 </span> e8/call <a href='127next-word.subx.html#L11'>next-word</a>/disp32
|
||||
<span id="L132" class="LineNr">132 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L133" class="LineNr">133 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L134" class="LineNr">134 </span> <span class="subxComment"># check-ints-equal(slice->start - _test-stream->data, 2, msg)</span>
|
||||
<span id="L135" class="LineNr">135 </span> <span class="subxS1Comment"># . check-ints-equal(slice->start - _test-stream, 14, msg)</span>
|
||||
<span id="L136" class="LineNr">136 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L137" class="LineNr">137 </span> 68/push <span class="Constant">"F - <a href='127next-word.subx.html#L102'>test-next-word</a>: start"</span>/imm32
|
||||
<span id="L138" class="LineNr">138 </span> 68/push 0xe/imm32
|
||||
<span id="L139" class="LineNr">139 </span> <span class="subxS2Comment"># . . push slice->start - _test-stream</span>
|
||||
<span id="L140" class="LineNr">140 </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="L141" class="LineNr">141 </span> 81 5/subop/subtract 3/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <a href='108write.subx.html#L151'>_test-stream</a>/imm32 <span class="subxComment"># subtract from eax</span>
|
||||
<span id="L142" class="LineNr">142 </span> 50/push-eax
|
||||
<span id="L143" class="LineNr">143 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L144" class="LineNr">144 </span> e8/call <a href='102test.subx.html#L23'>check-ints-equal</a>/disp32
|
||||
<span id="L145" class="LineNr">145 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L146" class="LineNr">146 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L147" class="LineNr">147 </span> <span class="subxComment"># check-ints-equal(slice->end - _test-stream->data, 4, msg)</span>
|
||||
<span id="L148" class="LineNr">148 </span> <span class="subxS1Comment"># . check-ints-equal(slice->end - _test-stream, 16, msg)</span>
|
||||
<span id="L149" class="LineNr">149 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L150" class="LineNr">150 </span> 68/push <span class="Constant">"F - <a href='127next-word.subx.html#L102'>test-next-word</a>: end"</span>/imm32
|
||||
<span id="L151" class="LineNr">151 </span> 68/push 0x10/imm32
|
||||
<span id="L152" class="LineNr">152 </span> <span class="subxS2Comment"># . . push slice->end - _test-stream</span>
|
||||
<span id="L153" class="LineNr">153 </span> 8b/copy 1/mod/*+disp8 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ecx+4) to eax</span>
|
||||
<span id="L154" class="LineNr">154 </span> 81 5/subop/subtract 3/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <a href='108write.subx.html#L151'>_test-stream</a>/imm32 <span class="subxComment"># subtract from eax</span>
|
||||
<span id="L155" class="LineNr">155 </span> 50/push-eax
|
||||
<span id="L156" class="LineNr">156 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L157" class="LineNr">157 </span> e8/call <a href='102test.subx.html#L23'>check-ints-equal</a>/disp32
|
||||
<span id="L158" class="LineNr">158 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L159" class="LineNr">159 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L160" class="LineNr">160 </span> <span class="subxS1Comment"># . epilogue</span>
|
||||
<span id="L161" class="LineNr">161 </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="L162" class="LineNr">162 </span> 5d/pop-to-ebp
|
||||
<span id="L163" class="LineNr">163 </span> c3/return
|
||||
<span id="L164" class="LineNr">164 </span>
|
||||
<span id="L165" class="LineNr">165 </span><span class="subxTest">test-next-word-returns-whole-comment</span>:
|
||||
<span id="L166" class="LineNr">166 </span> <span class="subxS1Comment"># . prologue</span>
|
||||
<span id="L167" class="LineNr">167 </span> 55/push-ebp
|
||||
<span id="L168" class="LineNr">168 </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="L169" class="LineNr">169 </span> <span class="subxComment"># setup</span>
|
||||
<span id="L170" class="LineNr">170 </span> <span class="subxS1Comment"># . clear-stream(_test-stream)</span>
|
||||
<span id="L171" class="LineNr">171 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L172" class="LineNr">172 </span> 68/push <a href='108write.subx.html#L151'>_test-stream</a>/imm32
|
||||
<span id="L173" class="LineNr">173 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L174" class="LineNr">174 </span> e8/call <a href='106stream.subx.html#L17'>clear-stream</a>/disp32
|
||||
<span id="L175" class="LineNr">175 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L176" class="LineNr">176 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L177" class="LineNr">177 </span> <span class="subxComment"># var slice/ecx: slice</span>
|
||||
<span id="L178" class="LineNr">178 </span> 68/push 0/imm32/end
|
||||
<span id="L179" class="LineNr">179 </span> 68/push 0/imm32/start
|
||||
<span id="L180" class="LineNr">180 </span> 89/copy 3/mod/direct 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ecx</span>
|
||||
<span id="L181" class="LineNr">181 </span> <span class="subxComment"># write(_test-stream, " # a")</span>
|
||||
<span id="L182" class="LineNr">182 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L183" class="LineNr">183 </span> 68/push <span class="Constant">" # a"</span>/imm32
|
||||
<span id="L184" class="LineNr">184 </span> 68/push <a href='108write.subx.html#L151'>_test-stream</a>/imm32
|
||||
<span id="L185" class="LineNr">185 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L186" class="LineNr">186 </span> e8/call <a href='108write.subx.html#L24'>write</a>/disp32
|
||||
<span id="L187" class="LineNr">187 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L188" class="LineNr">188 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L189" class="LineNr">189 </span> <span class="subxComment"># next-word(_test-stream, slice)</span>
|
||||
<span id="L190" class="LineNr">190 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L191" class="LineNr">191 </span> 51/push-ecx
|
||||
<span id="L192" class="LineNr">192 </span> 68/push <a href='108write.subx.html#L151'>_test-stream</a>/imm32
|
||||
<span id="L193" class="LineNr">193 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L194" class="LineNr">194 </span> e8/call <a href='127next-word.subx.html#L11'>next-word</a>/disp32
|
||||
<span id="L195" class="LineNr">195 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L196" class="LineNr">196 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L197" class="LineNr">197 </span> <span class="subxComment"># check-ints-equal(slice->start - _test-stream->data, 2, msg)</span>
|
||||
<span id="L198" class="LineNr">198 </span> <span class="subxS1Comment"># . check-ints-equal(slice->start - _test-stream, 14, msg)</span>
|
||||
<span id="L199" class="LineNr">199 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L200" class="LineNr">200 </span> 68/push <span class="Constant">"F - <a href='127next-word.subx.html#L165'>test-next-word-returns-whole-comment</a>: start"</span>/imm32
|
||||
<span id="L201" class="LineNr">201 </span> 68/push 0xe/imm32
|
||||
<span id="L202" class="LineNr">202 </span> <span class="subxS2Comment"># . . push slice->start - _test-stream</span>
|
||||
<span id="L203" class="LineNr">203 </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="L204" class="LineNr">204 </span> 81 5/subop/subtract 3/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <a href='108write.subx.html#L151'>_test-stream</a>/imm32 <span class="subxComment"># subtract from eax</span>
|
||||
<span id="L205" class="LineNr">205 </span> 50/push-eax
|
||||
<span id="L206" class="LineNr">206 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L207" class="LineNr">207 </span> e8/call <a href='102test.subx.html#L23'>check-ints-equal</a>/disp32
|
||||
<span id="L208" class="LineNr">208 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L209" class="LineNr">209 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L210" class="LineNr">210 </span> <span class="subxComment"># check-ints-equal(slice->end - _test-stream->data, 5, msg)</span>
|
||||
<span id="L211" class="LineNr">211 </span> <span class="subxS1Comment"># . check-ints-equal(slice->end - _test-stream, 17, msg)</span>
|
||||
<span id="L212" class="LineNr">212 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L213" class="LineNr">213 </span> 68/push <span class="Constant">"F - <a href='127next-word.subx.html#L165'>test-next-word-returns-whole-comment</a>: end"</span>/imm32
|
||||
<span id="L214" class="LineNr">214 </span> 68/push 0x11/imm32
|
||||
<span id="L215" class="LineNr">215 </span> <span class="subxS2Comment"># . . push slice->end - _test-stream</span>
|
||||
<span id="L216" class="LineNr">216 </span> 8b/copy 1/mod/*+disp8 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ecx+4) to eax</span>
|
||||
<span id="L217" class="LineNr">217 </span> 81 5/subop/subtract 3/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <a href='108write.subx.html#L151'>_test-stream</a>/imm32 <span class="subxComment"># subtract from eax</span>
|
||||
<span id="L218" class="LineNr">218 </span> 50/push-eax
|
||||
<span id="L219" class="LineNr">219 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L220" class="LineNr">220 </span> e8/call <a href='102test.subx.html#L23'>check-ints-equal</a>/disp32
|
||||
<span id="L221" class="LineNr">221 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L222" class="LineNr">222 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L223" class="LineNr">223 </span> <span class="subxS1Comment"># . epilogue</span>
|
||||
<span id="L224" class="LineNr">224 </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="L225" class="LineNr">225 </span> 5d/pop-to-ebp
|
||||
<span id="L226" class="LineNr">226 </span> c3/return
|
||||
<span id="L227" class="LineNr">227 </span>
|
||||
<span id="L228" class="LineNr">228 </span><span class="subxTest">test-next-word-returns-empty-string-on-eof</span>:
|
||||
<span id="L229" class="LineNr">229 </span> <span class="subxS1Comment"># . prologue</span>
|
||||
<span id="L230" class="LineNr">230 </span> 55/push-ebp
|
||||
<span id="L231" class="LineNr">231 </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="L232" class="LineNr">232 </span> <span class="subxComment"># setup</span>
|
||||
<span id="L233" class="LineNr">233 </span> <span class="subxS1Comment"># . clear-stream(_test-stream)</span>
|
||||
<span id="L234" class="LineNr">234 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L235" class="LineNr">235 </span> 68/push <a href='108write.subx.html#L151'>_test-stream</a>/imm32
|
||||
<span id="L236" class="LineNr">236 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L237" class="LineNr">237 </span> e8/call <a href='106stream.subx.html#L17'>clear-stream</a>/disp32
|
||||
<span id="L238" class="LineNr">238 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L239" class="LineNr">239 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L240" class="LineNr">240 </span> <span class="subxComment"># var slice/ecx: slice</span>
|
||||
<span id="L241" class="LineNr">241 </span> 68/push 0/imm32/end
|
||||
<span id="L242" class="LineNr">242 </span> 68/push 0/imm32/start
|
||||
<span id="L243" class="LineNr">243 </span> 89/copy 3/mod/direct 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ecx</span>
|
||||
<span id="L244" class="LineNr">244 </span> <span class="subxComment"># write nothing to _test-stream</span>
|
||||
<span id="L245" class="LineNr">245 </span> <span class="subxComment"># next-word(_test-stream, slice)</span>
|
||||
<span id="L246" class="LineNr">246 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L247" class="LineNr">247 </span> 51/push-ecx
|
||||
<span id="L248" class="LineNr">248 </span> 68/push <a href='108write.subx.html#L151'>_test-stream</a>/imm32
|
||||
<span id="L249" class="LineNr">249 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L250" class="LineNr">250 </span> e8/call <a href='127next-word.subx.html#L11'>next-word</a>/disp32
|
||||
<span id="L251" class="LineNr">251 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L252" class="LineNr">252 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L253" class="LineNr">253 </span> <span class="subxComment"># check-ints-equal(slice->end - slice->start, 0, msg)</span>
|
||||
<span id="L254" class="LineNr">254 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L255" class="LineNr">255 </span> 68/push <span class="Constant">"F - test-next-word-returns-empty-string-on-eof"</span>/imm32
|
||||
<span id="L256" class="LineNr">256 </span> 68/push 0/imm32
|
||||
<span id="L257" class="LineNr">257 </span> <span class="subxS2Comment"># . . push slice->end - slice->start</span>
|
||||
<span id="L258" class="LineNr">258 </span> 8b/copy 1/mod/*+disp8 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ecx+4) to eax</span>
|
||||
<span id="L259" class="LineNr">259 </span> 2b/subtract 0/mod/indirect 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># subtract *ecx from eax</span>
|
||||
<span id="L260" class="LineNr">260 </span> 50/push-eax
|
||||
<span id="L261" class="LineNr">261 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L262" class="LineNr">262 </span> e8/call <a href='102test.subx.html#L23'>check-ints-equal</a>/disp32
|
||||
<span id="L263" class="LineNr">263 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L264" class="LineNr">264 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L265" class="LineNr">265 </span> <span class="subxS1Comment"># . epilogue</span>
|
||||
<span id="L266" class="LineNr">266 </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="L267" class="LineNr">267 </span> 5d/pop-to-ebp
|
||||
<span id="L268" class="LineNr">268 </span> c3/return
|
||||
<span id="L269" class="LineNr">269 </span>
|
||||
<span id="L270" class="LineNr">270 </span><span class="subxTest">test-next-word-returns-empty-string-on-newline</span>:
|
||||
<span id="L271" class="LineNr">271 </span> <span class="subxS1Comment"># . prologue</span>
|
||||
<span id="L272" class="LineNr">272 </span> 55/push-ebp
|
||||
<span id="L273" class="LineNr">273 </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="L274" class="LineNr">274 </span> <span class="subxComment"># setup</span>
|
||||
<span id="L275" class="LineNr">275 </span> <span class="subxS1Comment"># . clear-stream(_test-stream)</span>
|
||||
<span id="L276" class="LineNr">276 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L277" class="LineNr">277 </span> 68/push <a href='108write.subx.html#L151'>_test-stream</a>/imm32
|
||||
<span id="L278" class="LineNr">278 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L279" class="LineNr">279 </span> e8/call <a href='106stream.subx.html#L17'>clear-stream</a>/disp32
|
||||
<span id="L280" class="LineNr">280 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L281" class="LineNr">281 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L282" class="LineNr">282 </span> <span class="subxComment"># var slice/ecx: slice</span>
|
||||
<span id="L283" class="LineNr">283 </span> 68/push 0/imm32/end
|
||||
<span id="L284" class="LineNr">284 </span> 68/push 0/imm32/start
|
||||
<span id="L285" class="LineNr">285 </span> 89/copy 3/mod/direct 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ecx</span>
|
||||
<span id="L286" class="LineNr">286 </span> <span class="subxComment"># write some whitespace and a newline</span>
|
||||
<span id="L287" class="LineNr">287 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L288" class="LineNr">288 </span> 68/push <span class="Constant">" \n"</span>/imm32
|
||||
<span id="L289" class="LineNr">289 </span> 68/push <a href='108write.subx.html#L151'>_test-stream</a>/imm32
|
||||
<span id="L290" class="LineNr">290 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L291" class="LineNr">291 </span> e8/call <a href='108write.subx.html#L24'>write</a>/disp32
|
||||
<span id="L292" class="LineNr">292 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L293" class="LineNr">293 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L294" class="LineNr">294 </span> <span class="subxComment"># next-word(_test-stream, slice)</span>
|
||||
<span id="L295" class="LineNr">295 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L296" class="LineNr">296 </span> 51/push-ecx
|
||||
<span id="L297" class="LineNr">297 </span> 68/push <a href='108write.subx.html#L151'>_test-stream</a>/imm32
|
||||
<span id="L298" class="LineNr">298 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L299" class="LineNr">299 </span> e8/call <a href='127next-word.subx.html#L11'>next-word</a>/disp32
|
||||
<span id="L300" class="LineNr">300 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L301" class="LineNr">301 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L302" class="LineNr">302 </span> <span class="subxComment"># check-ints-equal(slice->end - slice->start, 0, msg)</span>
|
||||
<span id="L303" class="LineNr">303 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L304" class="LineNr">304 </span> 68/push <span class="Constant">"F - test-next-word-returns-empty-string-on-newline"</span>/imm32
|
||||
<span id="L305" class="LineNr">305 </span> 68/push 0/imm32
|
||||
<span id="L306" class="LineNr">306 </span> <span class="subxS2Comment"># . . push slice->end - slice->start</span>
|
||||
<span id="L307" class="LineNr">307 </span> 8b/copy 1/mod/*+disp8 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ecx+4) to eax</span>
|
||||
<span id="L308" class="LineNr">308 </span> 2b/subtract 0/mod/indirect 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># subtract *ecx from eax</span>
|
||||
<span id="L309" class="LineNr">309 </span> 50/push-eax
|
||||
<span id="L310" class="LineNr">310 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L311" class="LineNr">311 </span> e8/call <a href='102test.subx.html#L23'>check-ints-equal</a>/disp32
|
||||
<span id="L312" class="LineNr">312 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L313" class="LineNr">313 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L314" class="LineNr">314 </span> <span class="subxS1Comment"># . epilogue</span>
|
||||
<span id="L315" class="LineNr">315 </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="L316" class="LineNr">316 </span> 5d/pop-to-ebp
|
||||
<span id="L317" class="LineNr">317 </span> c3/return
|
||||
<span id="L318" class="LineNr">318 </span>
|
||||
<span id="L319" class="LineNr">319 </span><span class="subxComment"># (re)compute the bounds of the next word in the line (separated by whitespace)</span>
|
||||
<span id="L320" class="LineNr">320 </span><span class="subxComment"># return empty string on reaching end of file</span>
|
||||
<span id="L321" class="LineNr">321 </span><span class="subxFunction">next-raw-word</span>: <span class="subxComment"># line: (addr stream byte), out: (addr slice)</span>
|
||||
<span id="L322" class="LineNr">322 </span> <span class="subxS1Comment"># . prologue</span>
|
||||
<span id="L323" class="LineNr">323 </span> 55/push-ebp
|
||||
<span id="L324" class="LineNr">324 </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="L325" class="LineNr">325 </span> <span class="subxS1Comment"># . save registers</span>
|
||||
<span id="L326" class="LineNr">326 </span> 50/push-eax
|
||||
<span id="L327" class="LineNr">327 </span> 51/push-ecx
|
||||
<span id="L328" class="LineNr">328 </span> 56/push-esi
|
||||
<span id="L329" class="LineNr">329 </span> 57/push-edi
|
||||
<span id="L330" class="LineNr">330 </span> <span class="subxComment"># esi = line</span>
|
||||
<span id="L331" class="LineNr">331 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to esi</span>
|
||||
<span id="L332" class="LineNr">332 </span> <span class="subxComment"># edi = out</span>
|
||||
<span id="L333" class="LineNr">333 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 7/r32/edi 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+12) to edi</span>
|
||||
<span id="L334" class="LineNr">334 </span> <span class="subxComment"># skip-chars-matching-whitespace(line)</span>
|
||||
<span id="L335" class="LineNr">335 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L336" class="LineNr">336 </span> ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(ebp+8)</span>
|
||||
<span id="L337" class="LineNr">337 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L338" class="LineNr">338 </span> e8/call <a href='124next-token.subx.html#L464'>skip-chars-matching-whitespace</a>/disp32
|
||||
<span id="L339" class="LineNr">339 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L340" class="LineNr">340 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L341" class="LineNr">341 </span><span class="Constant">$next-raw-word:check0</span>:
|
||||
<span id="L342" class="LineNr">342 </span> <span class="subxComment"># if (line->read >= line->write) clear out and return</span>
|
||||
<span id="L343" class="LineNr">343 </span> <span class="subxS1Comment"># . eax = line->read</span>
|
||||
<span id="L344" class="LineNr">344 </span> 8b/copy 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(esi+4) to eax</span>
|
||||
<span id="L345" class="LineNr">345 </span> <span class="subxS1Comment"># . if (eax < line->write) goto next check</span>
|
||||
<span id="L346" class="LineNr">346 </span> 3b/compare 0/mod/indirect 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># compare eax with *esi</span>
|
||||
<span id="L347" class="LineNr">347 </span> 7c/jump-if-< $next-raw-word:word-exists/disp8
|
||||
<span id="L348" class="LineNr">348 </span> <span class="subxS1Comment"># . return out</span>
|
||||
<span id="L349" class="LineNr">349 </span> c7 0/subop/copy 0/mod/direct 7/rm32/edi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/imm32 <span class="subxComment"># copy to *edi</span>
|
||||
<span id="L350" class="LineNr">350 </span> c7 0/subop/copy 1/mod/*+disp8 7/rm32/edi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/disp8 0/imm32 <span class="subxComment"># copy to *(edi+4)</span>
|
||||
<span id="L351" class="LineNr">351 </span> eb/jump $next-raw-word:end/disp8
|
||||
<span id="L352" class="LineNr">352 </span><span class="Constant">$next-raw-word:word-exists</span>:
|
||||
<span id="L353" class="LineNr">353 </span> <span class="subxComment"># out->start = &line->data[line->read]</span>
|
||||
<span id="L354" class="LineNr">354 </span> 8b/copy 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(esi+4) to ecx</span>
|
||||
<span id="L355" class="LineNr">355 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/esi 1/index/ecx <span class="Normal"> . </span> 0/r32/eax 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy esi+ecx+12 to eax</span>
|
||||
<span id="L356" class="LineNr">356 </span> 89/copy 0/mod/indirect 7/rm32/edi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy eax to *edi</span>
|
||||
<span id="L357" class="LineNr">357 </span> <span class="subxComment"># skip-chars-not-matching-whitespace(line) # including trailing newline</span>
|
||||
<span id="L358" class="LineNr">358 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L359" class="LineNr">359 </span> ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># push *(ebp+8)</span>
|
||||
<span id="L360" class="LineNr">360 </span> <span class="subxS2Comment"># . . call</span>
|
||||
<span id="L361" class="LineNr">361 </span> e8/call <a href='124next-token.subx.html#L716'>skip-chars-not-matching-whitespace</a>/disp32
|
||||
<span id="L362" class="LineNr">362 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L363" class="LineNr">363 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L364" class="LineNr">364 </span> <span class="subxComment"># out->end = &line->data[line->read]</span>
|
||||
<span id="L365" class="LineNr">365 </span> 8b/copy 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(esi+4) to ecx</span>
|
||||
<span id="L366" class="LineNr">366 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/esi 1/index/ecx <span class="Normal"> . </span> 0/r32/eax 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy esi+ecx+12 to eax</span>
|
||||
<span id="L367" class="LineNr">367 </span> 89/copy 1/mod/*+disp8 7/rm32/edi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy eax to *(edi+4)</span>
|
||||
<span id="L368" class="LineNr">368 </span><span class="Constant">$next-raw-word:end</span>:
|
||||
<span id="L369" class="LineNr">369 </span> <span class="subxS1Comment"># . restore registers</span>
|
||||
<span id="L370" class="LineNr">370 </span> 5f/pop-to-edi
|
||||
<span id="L371" class="LineNr">371 </span> 5e/pop-to-esi
|
||||
<span id="L372" class="LineNr">372 </span> 59/pop-to-ecx
|
||||
<span id="L373" class="LineNr">373 </span> 58/pop-to-eax
|
||||
<span id="L374" class="LineNr">374 </span> <span class="subxS1Comment"># . epilogue</span>
|
||||
<span id="L375" class="LineNr">375 </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="L376" class="LineNr">376 </span> 5d/pop-to-ebp
|
||||
<span id="L377" class="LineNr">377 </span> c3/return
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -15,13 +15,13 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.subxS2Comment { color: #8a8a8a; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.Constant { color: #008787; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.subxTest { color: #5f8700; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
|
|
@ -15,13 +15,13 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.subxS2Comment { color: #8a8a8a; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.Constant { color: #008787; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.subxTest { color: #5f8700; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
|
|
@ -14,16 +14,16 @@ pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-
|
|||
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
|
||||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.SpecialChar { color: #d70000; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.subxS2Comment { color: #8a8a8a; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.Constant { color: #008787; }
|
||||
.SpecialChar { color: #d70000; }
|
||||
.subxTest { color: #5f8700; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.Folded { color: #080808; background-color: #949494; }
|
||||
.subxTest { color: #5f8700; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
@ -493,7 +493,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L432" class="LineNr">432 </span> e8/call <a href='115write-byte.subx.html#L81'>flush</a>/disp32
|
||||
<span id="L433" class="LineNr">433 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L434" class="LineNr">434 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L435" class="Folded">435 </span><span class="Folded">+-- 26 lines: #? # dump output -----------------------------------------------------------------------------------------------------------------------------------------</span>
|
||||
<span id="L435" class="Folded">435 </span><span class="Folded">+-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------</span>
|
||||
<span id="L461" class="LineNr">461 </span> <span class="subxComment"># check-stream-equal(_test-output-stream, "abcd/xyz")</span>
|
||||
<span id="L462" class="LineNr">462 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L463" class="LineNr">463 </span> 68/push <span class="Constant">"F - test-emit-non-number-with-all-hex-digits"</span>/imm32
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -15,13 +15,13 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.subxS2Comment { color: #8a8a8a; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.Constant { color: #008787; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.subxTest { color: #5f8700; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
@ -157,7 +157,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L98" class="LineNr"> 98 </span> e8/call <a href='101_write.subx.html#L12'>_write</a>/disp32
|
||||
<span id="L99" class="LineNr"> 99 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L100" class="LineNr">100 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L101" class="LineNr">101 </span> <span class="subxS1Comment"># . syscall(exit, 1)</span>
|
||||
<span id="L101" class="LineNr">101 </span> <span class="subxS1Comment"># . syscall_exit(1)</span>
|
||||
<span id="L102" class="LineNr">102 </span> bb/copy-to-ebx 1/imm32
|
||||
<span id="L103" class="LineNr">103 </span> e8/call <a href='000init.subx.html#L18'>syscall_exit</a>/disp32
|
||||
<span id="L104" class="LineNr">104 </span> <span class="subxComment"># never gets here</span>
|
||||
|
|
|
@ -15,13 +15,13 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.subxS2Comment { color: #8a8a8a; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.Constant { color: #008787; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.subxTest { color: #5f8700; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
|
|
@ -15,14 +15,14 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.subxS2Comment { color: #8a8a8a; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.Constant { color: #008787; }
|
||||
.subxTest { color: #5f8700; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.Folded { color: #080808; background-color: #949494; }
|
||||
.subxTest { color: #5f8700; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
@ -150,7 +150,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L90" class="LineNr"> 90 </span> e8/call <a href='115write-byte.subx.html#L81'>flush</a>/disp32
|
||||
<span id="L91" class="LineNr"> 91 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L92" class="LineNr"> 92 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L93" class="Folded"> 93 </span><span class="Folded">+-- 33 lines: #? # dump output -----------------------------------------------------------------------------------------------------------------------------------------</span>
|
||||
<span id="L93" class="Folded"> 93 </span><span class="Folded">+-- 33 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------</span>
|
||||
<span id="L126" class="LineNr">126 </span> <span class="subxComment"># check-next-stream-line-equal(_test-output-stream, "01 02 03 ", msg)</span>
|
||||
<span id="L127" class="LineNr">127 </span> <span class="subxS2Comment"># . . push args</span>
|
||||
<span id="L128" class="LineNr">128 </span> 68/push <span class="Constant">"F - test-emit-hex-array"</span>/imm32
|
||||
|
|
|
@ -15,13 +15,13 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.subxS2Comment { color: #8a8a8a; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.Constant { color: #008787; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.subxTest { color: #5f8700; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
|
|
@ -14,15 +14,15 @@ pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
|
|||
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
|
||||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxH1Comment { color: #005faf; text-decoration: underline; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.subxS2Comment { color: #8a8a8a; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.Constant { color: #008787; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.subxTest { color: #5f8700; }
|
||||
.subxH1Comment { color: #005faf; text-decoration: underline; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
@ -105,7 +105,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L45" class="LineNr"> 45 </span> e8/call <a href='101_write.subx.html#L12'>_write</a>/disp32
|
||||
<span id="L46" class="LineNr"> 46 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L47" class="LineNr"> 47 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L48" class="LineNr"> 48 </span> <span class="subxS1Comment"># . syscall(exit, 1)</span>
|
||||
<span id="L48" class="LineNr"> 48 </span> <span class="subxS1Comment"># . syscall_exit(1)</span>
|
||||
<span id="L49" class="LineNr"> 49 </span> bb/copy-to-ebx 1/imm32
|
||||
<span id="L50" class="LineNr"> 50 </span> e8/call <a href='000init.subx.html#L18'>syscall_exit</a>/disp32
|
||||
<span id="L51" class="LineNr"> 51 </span> <span class="subxComment"># never gets here</span>
|
||||
|
|
|
@ -14,15 +14,15 @@ pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
|
|||
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
|
||||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.SpecialChar { color: #d70000; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.subxS2Comment { color: #8a8a8a; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.Constant { color: #008787; }
|
||||
.SpecialChar { color: #d70000; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
.subxTest { color: #5f8700; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
@ -218,7 +218,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L158" class="LineNr">158 </span> e8/call <a href='115write-byte.subx.html#L81'>flush</a>/disp32
|
||||
<span id="L159" class="LineNr">159 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L160" class="LineNr">160 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L161" class="LineNr">161 </span> <span class="subxS1Comment"># . syscall(exit, 1)</span>
|
||||
<span id="L161" class="LineNr">161 </span> <span class="subxS1Comment"># . syscall_exit(1)</span>
|
||||
<span id="L162" class="LineNr">162 </span> bb/copy-to-ebx 1/imm32
|
||||
<span id="L163" class="LineNr">163 </span> e8/call <a href='000init.subx.html#L18'>syscall_exit</a>/disp32
|
||||
<span id="L164" class="LineNr">164 </span> <span class="subxComment"># never gets here</span>
|
||||
|
@ -336,7 +336,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L276" class="LineNr">276 </span> e8/call <a href='115write-byte.subx.html#L81'>flush</a>/disp32
|
||||
<span id="L277" class="LineNr">277 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L278" class="LineNr">278 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L279" class="LineNr">279 </span> <span class="subxS1Comment"># . syscall(exit, 1)</span>
|
||||
<span id="L279" class="LineNr">279 </span> <span class="subxS1Comment"># . syscall_exit(1)</span>
|
||||
<span id="L280" class="LineNr">280 </span> bb/copy-to-ebx 1/imm32
|
||||
<span id="L281" class="LineNr">281 </span> e8/call <a href='000init.subx.html#L18'>syscall_exit</a>/disp32
|
||||
<span id="L282" class="LineNr">282 </span> <span class="subxComment"># never gets here</span>
|
||||
|
@ -437,7 +437,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L377" class="LineNr">377 </span> e8/call <a href='115write-byte.subx.html#L81'>flush</a>/disp32
|
||||
<span id="L378" class="LineNr">378 </span> <span class="subxS2Comment"># . . discard args</span>
|
||||
<span id="L379" class="LineNr">379 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span>
|
||||
<span id="L380" class="LineNr">380 </span> <span class="subxS1Comment"># . syscall(exit, 1)</span>
|
||||
<span id="L380" class="LineNr">380 </span> <span class="subxS1Comment"># . syscall_exit(1)</span>
|
||||
<span id="L381" class="LineNr">381 </span> bb/copy-to-ebx 1/imm32
|
||||
<span id="L382" class="LineNr">382 </span> e8/call <a href='000init.subx.html#L18'>syscall_exit</a>/disp32
|
||||
<span id="L383" class="LineNr">383 </span> <span class="subxComment"># never gets here</span>
|
||||
|
|
|
@ -14,15 +14,15 @@ pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-
|
|||
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
|
||||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxComment { color: #005faf; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.SpecialChar { color: #d70000; }
|
||||
.Constant { color: #008787; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.LineNr { }
|
||||
.subxH1Comment { color: #005faf; text-decoration: underline; }
|
||||
.subxMinorFunction { color: #875f5f; }
|
||||
.subxTest { color: #5f8700; }
|
||||
.subxH1Comment { color: #005faf; text-decoration: underline; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Constant { color: #008787; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
|
|
@ -15,9 +15,9 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxComment { color: #005faf; }
|
||||
.SpecialChar { color: #d70000; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.SpecialChar { color: #d70000; }
|
||||
.Constant { color: #008787; }
|
||||
.CommentedCode { color: #8a8a8a; }
|
||||
-->
|
||||
|
|
|
@ -15,9 +15,9 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.Constant { color: #008787; }
|
||||
-->
|
||||
</style>
|
||||
|
|
|
@ -14,13 +14,13 @@ pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-
|
|||
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
|
||||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxComment { color: #005faf; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.SpecialChar { color: #d70000; }
|
||||
.Constant { color: #008787; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.LineNr { }
|
||||
.subxMinorFunction { color: #875f5f; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Constant { color: #008787; }
|
||||
.CommentedCode { color: #8a8a8a; }
|
||||
-->
|
||||
</style>
|
||||
|
@ -216,8 +216,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L157" class="LineNr">157 </span> 5d/pop-to-ebp
|
||||
<span id="L158" class="LineNr">158 </span> c3/return
|
||||
<span id="L159" class="LineNr">159 </span>
|
||||
<span id="L160" class="LineNr">160 </span><span class="subxComment"># print a grapheme in utf-8 (only up to 4 bytes so far)</span>
|
||||
<span id="L161" class="LineNr">161 </span><span class="subxFunction">print-grapheme-to-real-screen</span>: <span class="subxComment"># c: grapheme</span>
|
||||
<span id="L160" class="LineNr">160 </span><span class="subxComment"># print a code-point-utf8 in utf-8 (only up to 4 bytes so far)</span>
|
||||
<span id="L161" class="LineNr">161 </span><span class="subxFunction">print-code-point-utf8-to-real-screen</span>: <span class="subxComment"># c: code-point-utf8</span>
|
||||
<span id="L162" class="LineNr">162 </span> <span class="subxS1Comment"># . prologue</span>
|
||||
<span id="L163" class="LineNr">163 </span> 55/push-ebp
|
||||
<span id="L164" class="LineNr">164 </span> 89/<- %ebp 4/r32/esp
|
||||
|
@ -229,31 +229,31 @@ if ('onhashchange' in window) {
|
|||
<span id="L170" class="LineNr">170 </span> 8a/byte-> *(ebp+8) 0/r32/al
|
||||
<span id="L171" class="LineNr">171 </span> <span class="subxComment"># if (curr == 0) return</span>
|
||||
<span id="L172" class="LineNr">172 </span> 3d/compare-eax-and 0/imm32
|
||||
<span id="L173" class="LineNr">173 </span> 74/jump-if-= $print-grapheme-to-real-screen:end/disp8
|
||||
<span id="L173" class="LineNr">173 </span> 74/jump-if-= $print-code-point-utf8-to-real-screen:end/disp8
|
||||
<span id="L174" class="LineNr">174 </span> <span class="subxComment">#</span>
|
||||
<span id="L175" class="LineNr">175 </span> (<a href='304screen.subx.html#L205'>print-byte-to-real-screen</a> %eax)
|
||||
<span id="L176" class="LineNr">176 </span> <span class="subxComment"># curr = *(ebp+9)</span>
|
||||
<span id="L177" class="LineNr">177 </span> 8a/byte-> *(ebp+9) 0/r32/al
|
||||
<span id="L178" class="LineNr">178 </span> <span class="subxComment"># if (curr == 0) return</span>
|
||||
<span id="L179" class="LineNr">179 </span> 3d/compare-eax-and 0/imm32
|
||||
<span id="L180" class="LineNr">180 </span> 74/jump-if-= $print-grapheme-to-real-screen:end/disp8
|
||||
<span id="L180" class="LineNr">180 </span> 74/jump-if-= $print-code-point-utf8-to-real-screen:end/disp8
|
||||
<span id="L181" class="LineNr">181 </span> <span class="subxComment">#</span>
|
||||
<span id="L182" class="LineNr">182 </span> (<a href='304screen.subx.html#L205'>print-byte-to-real-screen</a> %eax)
|
||||
<span id="L183" class="LineNr">183 </span> <span class="subxComment"># curr = *(ebp+10)</span>
|
||||
<span id="L184" class="LineNr">184 </span> 8a/byte-> *(ebp+0xa) 0/r32/al
|
||||
<span id="L185" class="LineNr">185 </span> <span class="subxComment"># if (curr == 0) return</span>
|
||||
<span id="L186" class="LineNr">186 </span> 3d/compare-eax-and 0/imm32
|
||||
<span id="L187" class="LineNr">187 </span> 74/jump-if-= $print-grapheme-to-real-screen:end/disp8
|
||||
<span id="L187" class="LineNr">187 </span> 74/jump-if-= $print-code-point-utf8-to-real-screen:end/disp8
|
||||
<span id="L188" class="LineNr">188 </span> <span class="subxComment">#</span>
|
||||
<span id="L189" class="LineNr">189 </span> (<a href='304screen.subx.html#L205'>print-byte-to-real-screen</a> %eax)
|
||||
<span id="L190" class="LineNr">190 </span> <span class="subxComment"># curr = *(ebp+11)</span>
|
||||
<span id="L191" class="LineNr">191 </span> 8a/byte-> *(ebp+0xb) 0/r32/al
|
||||
<span id="L192" class="LineNr">192 </span> <span class="subxComment"># if (curr == 0) return</span>
|
||||
<span id="L193" class="LineNr">193 </span> 3d/compare-eax-and 0/imm32
|
||||
<span id="L194" class="LineNr">194 </span> 74/jump-if-= $print-grapheme-to-real-screen:end/disp8
|
||||
<span id="L194" class="LineNr">194 </span> 74/jump-if-= $print-code-point-utf8-to-real-screen:end/disp8
|
||||
<span id="L195" class="LineNr">195 </span> <span class="subxComment">#</span>
|
||||
<span id="L196" class="LineNr">196 </span> (<a href='304screen.subx.html#L205'>print-byte-to-real-screen</a> %eax)
|
||||
<span id="L197" class="LineNr">197 </span><span class="Constant">$print-grapheme-to-real-screen:end</span>:
|
||||
<span id="L197" class="LineNr">197 </span><span class="Constant">$print-code-point-utf8-to-real-screen:end</span>:
|
||||
<span id="L198" class="LineNr">198 </span> <span class="subxS1Comment"># . restore registers</span>
|
||||
<span id="L199" class="LineNr">199 </span> 58/pop-to-eax
|
||||
<span id="L200" class="LineNr">200 </span> <span class="subxS1Comment"># . epilogue</span>
|
||||
|
|
|
@ -14,13 +14,13 @@ pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-
|
|||
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
|
||||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxComment { color: #005faf; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.SpecialChar { color: #d70000; }
|
||||
.Constant { color: #008787; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.LineNr { }
|
||||
.subxH1Comment { color: #005faf; text-decoration: underline; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Constant { color: #008787; }
|
||||
.CommentedCode { color: #8a8a8a; }
|
||||
-->
|
||||
</style>
|
||||
|
@ -180,15 +180,15 @@ if ('onhashchange' in window) {
|
|||
<span id="L121" class="LineNr">121 </span>
|
||||
<span id="L122" class="LineNr">122 </span><span class="subxComment"># read keys or escapes up to 4 bytes</span>
|
||||
<span id="L123" class="LineNr">123 </span><span class="subxComment">#</span>
|
||||
<span id="L124" class="LineNr">124 </span><span class="subxComment"># fun fact: terminal escapes and graphemes in utf-8 don't conflict!</span>
|
||||
<span id="L125" class="LineNr">125 </span><span class="subxH1Comment"># - in graphemes all but the first/lowest byte will have a 1 in the MSB (be</span>
|
||||
<span id="L124" class="LineNr">124 </span><span class="subxComment"># fun fact: terminal escapes and code-point-utf8s in utf-8 don't conflict!</span>
|
||||
<span id="L125" class="LineNr">125 </span><span class="subxH1Comment"># - in code-point-utf8s all but the first/lowest byte will have a 1 in the MSB (be</span>
|
||||
<span id="L126" class="LineNr">126 </span><span class="subxComment"># greater than 0x7f)</span>
|
||||
<span id="L127" class="LineNr">127 </span><span class="subxH1Comment"># - in escapes every byte will have a 0 in the MSB</span>
|
||||
<span id="L128" class="LineNr">128 </span><span class="subxComment"># the two categories overlap only when the first/lowest byte is 0x1b or 'esc'</span>
|
||||
<span id="L129" class="LineNr">129 </span><span class="subxComment">#</span>
|
||||
<span id="L130" class="LineNr">130 </span><span class="subxComment"># Only use this in immediate mode; in type (typewriter) mode 4 bytes may get</span>
|
||||
<span id="L131" class="LineNr">131 </span><span class="subxComment"># parts of multiple keys.</span>
|
||||
<span id="L132" class="LineNr">132 </span><span class="subxFunction">read-key-from-real-keyboard</span>: <span class="subxComment"># -> result/eax: grapheme</span>
|
||||
<span id="L132" class="LineNr">132 </span><span class="subxFunction">read-key-from-real-keyboard</span>: <span class="subxComment"># -> result/eax: code-point-utf8</span>
|
||||
<span id="L133" class="LineNr">133 </span> <span class="subxS1Comment"># . prologue</span>
|
||||
<span id="L134" class="LineNr">134 </span> 55/push-ebp
|
||||
<span id="L135" class="LineNr">135 </span> 89/<- %ebp 4/r32/esp
|
||||
|
|
|
@ -14,11 +14,11 @@ pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-
|
|||
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
|
||||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.SpecialChar { color: #d70000; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.SpecialChar { color: #d70000; }
|
||||
.Constant { color: #008787; }
|
||||
-->
|
||||
</style>
|
||||
|
|
|
@ -15,9 +15,9 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.Constant { color: #008787; }
|
||||
-->
|
||||
</style>
|
||||
|
|
|
@ -15,9 +15,9 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.Constant { color: #008787; }
|
||||
-->
|
||||
</style>
|
||||
|
|
|
@ -14,11 +14,11 @@ pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-
|
|||
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
|
||||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.SpecialChar { color: #d70000; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.SpecialChar { color: #d70000; }
|
||||
.Constant { color: #008787; }
|
||||
-->
|
||||
</style>
|
||||
|
|
|
@ -14,13 +14,13 @@ pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-
|
|||
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
|
||||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxComment { color: #005faf; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.SpecialChar { color: #d70000; }
|
||||
.Constant { color: #008787; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.LineNr { }
|
||||
.subxTest { color: #5f8700; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Constant { color: #008787; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
|
|
@ -14,15 +14,15 @@ pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-
|
|||
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
|
||||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.LineNr { }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.SpecialChar { color: #d70000; }
|
||||
.Constant { color: #008787; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.LineNr { }
|
||||
.subxH1Comment { color: #005faf; text-decoration: underline; }
|
||||
.subxMinorFunction { color: #875f5f; }
|
||||
.subxTest { color: #5f8700; }
|
||||
.subxH1Comment { color: #005faf; text-decoration: underline; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Constant { color: #008787; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
|
|
@ -14,11 +14,11 @@ pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-
|
|||
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
|
||||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.SpecialChar { color: #d70000; }
|
||||
.LineNr { }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Constant { color: #008787; }
|
||||
-->
|
||||
</style>
|
||||
|
|
|
@ -15,10 +15,10 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxComment { color: #005faf; }
|
||||
.LineNr { }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.SpecialChar { color: #d70000; }
|
||||
.LineNr { }
|
||||
.Constant { color: #008787; }
|
||||
.SpecialChar { color: #d70000; }
|
||||
.subxMinorFunction { color: #875f5f; }
|
||||
.CommentedCode { color: #8a8a8a; }
|
||||
-->
|
||||
|
|
|
@ -14,10 +14,10 @@ pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-
|
|||
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
|
||||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.LineNr { }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.subxComment { color: #005faf; }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.LineNr { }
|
||||
.subxFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Constant { color: #008787; }
|
||||
-->
|
||||
</style>
|
||||
|
|
|
@ -15,8 +15,8 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.subxComment { color: #005faf; }
|
||||
.LineNr { }
|
||||
.subxS1Comment { color: #0000af; }
|
||||
.LineNr { }
|
||||
.SpecialChar { color: #d70000; }
|
||||
.subxMinorFunction { color: #875f5f; }
|
||||
-->
|
||||
|
|
|
@ -15,9 +15,9 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.PreProc { color: #c000c0; }
|
||||
.LineNr { }
|
||||
.muRegEcx { color: #870000; }
|
||||
.muRegEdx { color: #af5f00; }
|
||||
.LineNr { }
|
||||
.muComment { color: #005faf; }
|
||||
-->
|
||||
</style>
|
||||
|
@ -169,13 +169,13 @@ if ('onhashchange' in window) {
|
|||
<span id="L113" class="LineNr">113 </span><span class="muComment">#sig skip-until-close-paren-in-slice curr: (addr byte), end: (addr byte) -> _/eax: (addr byte)</span>
|
||||
<span id="L114" class="LineNr">114 </span><span class="PreProc">sig</span> <a href='125write-stream-data.subx.html#L11'>write-stream-data</a> f: (addr buffered-file), s: (addr stream byte)
|
||||
<span id="L115" class="LineNr">115 </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="L116" class="LineNr">116 </span><span class="PreProc">sig</span> <a href='126write-int-decimal.subx.html#L306'>decimal-digit?</a> c: grapheme<span class="PreProc"> -> </span>_/eax: boolean
|
||||
<span id="L117" class="LineNr">117 </span><span class="PreProc">sig</span> <a href='126write-int-decimal.subx.html#L405'>to-decimal-digit</a> in: grapheme<span class="PreProc"> -> </span>_/eax: int
|
||||
<span id="L116" class="LineNr">116 </span><span class="PreProc">sig</span> <a href='126write-int-decimal.subx.html#L306'>decimal-digit?</a> c: code-point-utf8<span class="PreProc"> -> </span>_/eax: boolean
|
||||
<span id="L117" class="LineNr">117 </span><span class="PreProc">sig</span> <a href='126write-int-decimal.subx.html#L405'>to-decimal-digit</a> in: code-point-utf8<span class="PreProc"> -> </span>_/eax: int
|
||||
<span id="L118" class="LineNr">118 </span><span class="muComment"># bad name alert</span>
|
||||
<span id="L119" class="LineNr">119 </span><span class="muComment"># next-word really tokenizes</span>
|
||||
<span id="L120" class="LineNr">120 </span><span class="muComment"># next-raw-word really reads whitespace-separated words</span>
|
||||
<span id="L121" class="LineNr">121 </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="L122" class="LineNr">122 </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="L122" class="LineNr">122 </span><span class="PreProc">sig</span> <a href='127next-word.subx.html#L321'>next-raw-word</a> line: (addr stream byte), out: (addr slice) <span class="muComment"># does not skip '#' comments</span>
|
||||
<span id="L123" class="LineNr">123 </span><span class="PreProc">sig</span> <a href='128subx-words.subx.html#L8'>has-metadata?</a> word: (addr slice), s: (addr string)<span class="PreProc"> -> </span>_/eax: boolean
|
||||
<span id="L124" class="LineNr">124 </span><span class="PreProc">sig</span> <a href='128subx-words.subx.html#L278'>valid-name?</a> in: (addr slice)<span class="PreProc"> -> </span>_/eax: boolean
|
||||
<span id="L125" class="LineNr">125 </span><span class="PreProc">sig</span> <a href='128subx-words.subx.html#L535'>label?</a> word: (addr slice)<span class="PreProc"> -> </span>_/eax: boolean
|
||||
|
@ -215,7 +215,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L159" class="LineNr">159 </span><span class="PreProc">sig</span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> s: (addr array byte)
|
||||
<span id="L160" class="LineNr">160 </span><span class="PreProc">sig</span> <a href='304screen.subx.html#L134'>print-slice-to-real-screen</a> s: (addr slice)
|
||||
<span id="L161" class="LineNr">161 </span><span class="PreProc">sig</span> <a href='304screen.subx.html#L147'>print-stream-to-real-screen</a> s: (addr stream byte)
|
||||
<span id="L162" class="LineNr">162 </span><span class="PreProc">sig</span> <a href='304screen.subx.html#L161'>print-grapheme-to-real-screen</a> c: grapheme
|
||||
<span id="L162" class="LineNr">162 </span><span class="PreProc">sig</span> <a href='304screen.subx.html#L161'>print-code-point-utf8-to-real-screen</a> c: code-point-utf8
|
||||
<span id="L163" class="LineNr">163 </span><span class="PreProc">sig</span> <a href='304screen.subx.html#L226'>print-int32-hex-to-real-screen</a> n: int
|
||||
<span id="L164" class="LineNr">164 </span><span class="PreProc">sig</span> <a href='304screen.subx.html#L239'>print-int32-hex-bits-to-real-screen</a> n: int, bits: int
|
||||
<span id="L165" class="LineNr">165 </span><span class="PreProc">sig</span> <a href='304screen.subx.html#L252'>print-int32-decimal-to-real-screen</a> n: int
|
||||
|
@ -230,7 +230,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L174" class="LineNr">174 </span><span class="PreProc">sig</span> <a href='304screen.subx.html#L405'>show-cursor-on-real-screen</a>
|
||||
<span id="L175" class="LineNr">175 </span><span class="PreProc">sig</span> <a href='305keyboard.subx.html#L6'>enable-keyboard-immediate-mode</a>
|
||||
<span id="L176" class="LineNr">176 </span><span class="PreProc">sig</span> <a href='305keyboard.subx.html#L72'>enable-keyboard-type-mode</a>
|
||||
<span id="L177" class="LineNr">177 </span><span class="PreProc">sig</span> <a href='305keyboard.subx.html#L132'>read-key-from-real-keyboard</a><span class="PreProc"> -> </span>_/eax: grapheme
|
||||
<span id="L177" class="LineNr">177 </span><span class="PreProc">sig</span> <a href='305keyboard.subx.html#L132'>read-key-from-real-keyboard</a><span class="PreProc"> -> </span>_/eax: code-point-utf8
|
||||
<span id="L178" class="LineNr">178 </span><span class="PreProc">sig</span> <a href='305keyboard.subx.html#L158'>read-line-from-real-keyboard</a> out: (addr stream byte)
|
||||
<span id="L179" class="LineNr">179 </span><span class="PreProc">sig</span> <a href='306files.subx.html#L9'>open</a> filename: (addr array byte), write?: boolean, out: (addr handle buffered-file)
|
||||
<span id="L180" class="LineNr">180 </span><span class="PreProc">sig</span> <a href='306files.subx.html#L86'>populate-buffered-file-containing</a> contents: (addr array byte), out: (addr handle buffered-file)
|
||||
|
|
|
@ -15,12 +15,12 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.PreProc { color: #c000c0; }
|
||||
.Special { color: #ff6060; }
|
||||
.LineNr { }
|
||||
.Constant { color: #008787; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muComment { color: #005faf; }
|
||||
.Special { color: #ff6060; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
|
|
@ -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; }
|
||||
.muRegEcx { color: #870000; }
|
||||
.Special { color: #ff6060; }
|
||||
.LineNr { }
|
||||
.Constant { color: #008787; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muComment { color: #005faf; }
|
||||
.muRegEbx { color: #5f00ff; }
|
||||
.Constant { color: #008787; }
|
||||
.muRegEcx { color: #870000; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muComment { color: #005faf; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
|
|
@ -15,18 +15,18 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.PreProc { color: #c000c0; }
|
||||
.muRegEbx { color: #5f00ff; }
|
||||
.muRegEcx { color: #870000; }
|
||||
.muRegEdx { color: #af5f00; }
|
||||
.Special { color: #ff6060; }
|
||||
.LineNr { }
|
||||
.muRegEsi { color: #005faf; }
|
||||
.muRegEdi { color: #00af00; }
|
||||
.muRegEbx { color: #5f00ff; }
|
||||
.Constant { color: #008787; }
|
||||
.muRegEdi { color: #00af00; }
|
||||
.muRegEcx { color: #870000; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muTest { color: #5f8700; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muComment { color: #005faf; }
|
||||
.Special { color: #ff6060; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
@ -64,393 +64,390 @@ if ('onhashchange' in window) {
|
|||
<pre id='vimCodeElement'>
|
||||
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># Helpers for Unicode.</span>
|
||||
<span id="L2" class="LineNr"> 2 </span><span class="muComment">#</span>
|
||||
<span id="L3" class="LineNr"> 3 </span><span class="muComment"># Mu has no characters, only code points and graphemes.</span>
|
||||
<span id="L3" class="LineNr"> 3 </span><span class="muComment"># Mu has no characters, only code points and code-point-utf8s.</span>
|
||||
<span id="L4" class="LineNr"> 4 </span><span class="muComment"># Code points are the indivisible atoms of text streams.</span>
|
||||
<span id="L5" class="LineNr"> 5 </span><span class="muComment"># <a href="https://en.wikipedia.org/wiki/Code_point">https://en.wikipedia.org/wiki/Code_point</a></span>
|
||||
<span id="L6" class="LineNr"> 6 </span><span class="muComment"># Graphemes are the smallest self-contained unit of text.</span>
|
||||
<span id="L7" class="LineNr"> 7 </span><span class="muComment"># Graphemes may consist of multiple code points.</span>
|
||||
<span id="L8" class="LineNr"> 8 </span><span class="muComment">#</span>
|
||||
<span id="L9" class="LineNr"> 9 </span><span class="muComment"># Mu graphemes are always represented in utf-8, and they are required to fit</span>
|
||||
<span id="L9" class="LineNr"> 9 </span><span class="muComment"># Mu code-point-utf8s are always represented in utf-8, and they are required to fit</span>
|
||||
<span id="L10" class="LineNr"> 10 </span><span class="muComment"># in 4 bytes.</span>
|
||||
<span id="L11" class="LineNr"> 11 </span><span class="muComment">#</span>
|
||||
<span id="L12" class="LineNr"> 12 </span><span class="muComment"># Mu doesn't currently support combining code points, or graphemes made of</span>
|
||||
<span id="L12" class="LineNr"> 12 </span><span class="muComment"># Mu doesn't currently support combining code points, or code-point-utf8s made of</span>
|
||||
<span id="L13" class="LineNr"> 13 </span><span class="muComment"># multiple code points. One day we will.</span>
|
||||
<span id="L14" class="LineNr"> 14 </span><span class="muComment"># We also don't currently support code points that translate into multiple</span>
|
||||
<span id="L15" class="LineNr"> 15 </span><span class="muComment"># or wide graphemes. (In particular, Tab will never be supported.)</span>
|
||||
<span id="L14" class="LineNr"> 14 </span><span class="muComment"># On Linux, we also don't currently support code points that translate into</span>
|
||||
<span id="L15" class="LineNr"> 15 </span><span class="muComment"># multiple or wide code-point-utf8s. (In particular, Tab will never be supported.)</span>
|
||||
<span id="L16" class="LineNr"> 16 </span>
|
||||
<span id="L17" class="LineNr"> 17 </span><span class="muComment"># transliterated from tb_utf8_unicode_to_char in <a href="https://github.com/nsf/termbox">https://github.com/nsf/termbox</a></span>
|
||||
<span id="L18" class="LineNr"> 18 </span><span class="muComment"># <a href="https://wiki.tcl-lang.org/page/UTF%2D8+bit+by+bit">https://wiki.tcl-lang.org/page/UTF%2D8+bit+by+bit</a> explains the algorithm</span>
|
||||
<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>_/eax: grapheme <span class="Delimiter">{</span>
|
||||
<span id="L23" class="LineNr"> 23 </span> <span class="PreProc">var</span> c/eax: 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/eax: 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>
|
||||
<span id="L35" class="LineNr"> 35 </span> compare c, <span class="Constant">0x7ff</span>
|
||||
<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> num-trailers <span class="Special"><-</span> copy <span class="Constant">1</span>
|
||||
<span id="L39" class="LineNr"> 39 </span> first <span class="Special"><-</span> copy <span class="Constant">0xc0</span>
|
||||
<span id="L40" class="LineNr"> 40 </span> <span class="PreProc">break</span> $to-grapheme:compute-length
|
||||
<span id="L41" class="LineNr"> 41 </span> <span class="Delimiter">}</span>
|
||||
<span id="L42" class="LineNr"> 42 </span> <span class="muComment"># 3 bytes</span>
|
||||
<span id="L43" class="LineNr"> 43 </span> compare c, <span class="Constant">0xffff</span>
|
||||
<span id="L44" class="LineNr"> 44 </span> <span class="Delimiter">{</span>
|
||||
<span id="L45" class="LineNr"> 45 </span> <span class="PreProc">break-if-></span>
|
||||
<span id="L46" class="LineNr"> 46 </span> num-trailers <span class="Special"><-</span> copy <span class="Constant">2</span>
|
||||
<span id="L47" class="LineNr"> 47 </span> first <span class="Special"><-</span> copy <span class="Constant">0xe0</span>
|
||||
<span id="L48" class="LineNr"> 48 </span> <span class="PreProc">break</span> $to-grapheme:compute-length
|
||||
<span id="L49" class="LineNr"> 49 </span> <span class="Delimiter">}</span>
|
||||
<span id="L50" class="LineNr"> 50 </span> <span class="muComment"># 4 bytes</span>
|
||||
<span id="L51" class="LineNr"> 51 </span> compare c, <span class="Constant">0x1fffff</span>
|
||||
<span id="L52" class="LineNr"> 52 </span> <span class="Delimiter">{</span>
|
||||
<span id="L53" class="LineNr"> 53 </span> <span class="PreProc">break-if-></span>
|
||||
<span id="L54" class="LineNr"> 54 </span> num-trailers <span class="Special"><-</span> copy <span class="Constant">3</span>
|
||||
<span id="L55" class="LineNr"> 55 </span> first <span class="Special"><-</span> copy <span class="Constant">0xf0</span>
|
||||
<span id="L56" class="LineNr"> 56 </span> <span class="PreProc">break</span> $to-grapheme:compute-length
|
||||
<span id="L57" class="LineNr"> 57 </span> <span class="Delimiter">}</span>
|
||||
<span id="L58" class="LineNr"> 58 </span> <span class="muComment"># more than 4 bytes: unsupported</span>
|
||||
<span id="L59" class="LineNr"> 59 </span> <span class="muComment"># TODO: print to stderr</span>
|
||||
<span id="L60" class="LineNr"> 60 </span> compare c, <span class="Constant">0x1fffff</span>
|
||||
<span id="L61" class="LineNr"> 61 </span> <span class="Delimiter">{</span>
|
||||
<span id="L62" class="LineNr"> 62 </span> <span class="PreProc">break-if-></span>
|
||||
<span id="L63" class="LineNr"> 63 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">"unsupported code point "</span>
|
||||
<span id="L64" class="LineNr"> 64 </span> <a href='304screen.subx.html#L226'>print-int32-hex-to-real-screen</a> c
|
||||
<span id="L65" class="LineNr"> 65 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">"\n"</span>
|
||||
<span id="L66" class="LineNr"> 66 </span> <span class="PreProc">var</span> exit-status/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> copy <span class="Constant">1</span>
|
||||
<span id="L67" class="LineNr"> 67 </span> <a href='000init.subx.html#L18'>syscall_exit</a>
|
||||
<span id="L68" class="LineNr"> 68 </span> <span class="Delimiter">}</span>
|
||||
<span id="L69" class="LineNr"> 69 </span> <span class="Delimiter">}</span>
|
||||
<span id="L70" class="LineNr"> 70 </span> <span class="muComment"># emit trailer bytes, 6 bits from 'in', first two bits '10'</span>
|
||||
<span id="L71" class="LineNr"> 71 </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="L72" class="LineNr"> 72 </span> <span class="Delimiter">{</span>
|
||||
<span id="L73" class="LineNr"> 73 </span> compare num-trailers, <span class="Constant">0</span>
|
||||
<span id="L74" class="LineNr"> 74 </span> <span class="PreProc">break-if-<=</span>
|
||||
<span id="L75" class="LineNr"> 75 </span> <span class="PreProc">var</span> tmp/<span class="muRegEsi">esi</span>: int <span class="Special"><-</span> copy c
|
||||
<span id="L76" class="LineNr"> 76 </span> tmp <span class="Special"><-</span> and <span class="Constant">0x3f</span>
|
||||
<span id="L77" class="LineNr"> 77 </span> tmp <span class="Special"><-</span> or <span class="Constant">0x80</span>
|
||||
<span id="L78" class="LineNr"> 78 </span> result <span class="Special"><-</span> shift-left <span class="Constant">8</span>
|
||||
<span id="L79" class="LineNr"> 79 </span> result <span class="Special"><-</span> or tmp
|
||||
<span id="L80" class="LineNr"> 80 </span> <span class="muComment"># update loop state</span>
|
||||
<span id="L81" class="LineNr"> 81 </span> c <span class="Special"><-</span> shift-right <span class="Constant">6</span>
|
||||
<span id="L82" class="LineNr"> 82 </span> num-trailers <span class="Special"><-</span> decrement
|
||||
<span id="L83" class="LineNr"> 83 </span> <span class="PreProc">loop</span>
|
||||
<span id="L84" class="LineNr"> 84 </span> <span class="Delimiter">}</span>
|
||||
<span id="L85" class="LineNr"> 85 </span> <span class="muComment"># emit engine</span>
|
||||
<span id="L86" class="LineNr"> 86 </span> result <span class="Special"><-</span> shift-left <span class="Constant">8</span>
|
||||
<span id="L87" class="LineNr"> 87 </span> result <span class="Special"><-</span> or c
|
||||
<span id="L88" class="LineNr"> 88 </span> result <span class="Special"><-</span> or first
|
||||
<span id="L89" class="LineNr"> 89 </span> <span class="muComment">#</span>
|
||||
<span id="L90" class="LineNr"> 90 </span> <span class="PreProc">return</span> result
|
||||
<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="muComment"># single-byte code point have identical graphemes</span>
|
||||
<span id="L94" class="LineNr"> 94 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L94'>test-to-grapheme-single-byte</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L95" class="LineNr"> 95 </span> <span class="PreProc">var</span> in-int/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L96" class="LineNr"> 96 </span> <span class="Delimiter">{</span>
|
||||
<span id="L97" class="LineNr"> 97 </span> compare in-int, <span class="Constant">0x7f</span>
|
||||
<span id="L98" class="LineNr"> 98 </span> <span class="PreProc">break-if-></span>
|
||||
<span id="L99" class="LineNr"> 99 </span> <span class="PreProc">var</span> in/eax: code-point <span class="Special"><-</span> copy in-int
|
||||
<span id="L100" class="LineNr">100 </span> <span class="PreProc">var</span> out/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L22'>to-grapheme</a> in
|
||||
<span id="L101" class="LineNr">101 </span> <span class="PreProc">var</span> out-int/eax: int <span class="Special"><-</span> copy out
|
||||
<span id="L102" class="LineNr">102 </span> <a href='102test.subx.html#L23'>check-ints-equal</a> out-int, in-int, <span class="Constant">"F - test-to-grapheme-single-byte"</span>
|
||||
<span id="L103" class="LineNr">103 </span> in-int <span class="Special"><-</span> increment
|
||||
<span id="L104" class="LineNr">104 </span> <span class="PreProc">loop</span>
|
||||
<span id="L105" class="LineNr">105 </span> <span class="Delimiter">}</span>
|
||||
<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"># byte | byte | byte | byte</span>
|
||||
<span id="L109" class="LineNr">109 </span><span class="muComment"># smallest 2-byte utf-8</span>
|
||||
<span id="L110" class="LineNr">110 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L110'>test-to-grapheme-two-bytes-min</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L111" class="LineNr">111 </span> <span class="PreProc">var</span> in/eax: code-point <span class="Special"><-</span> copy <span class="Constant">0x80</span> <span class="muComment"># 10 00-0000</span>
|
||||
<span id="L112" class="LineNr">112 </span> <span class="PreProc">var</span> out/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L22'>to-grapheme</a> in
|
||||
<span id="L113" class="LineNr">113 </span> <span class="PreProc">var</span> out-int/eax: int <span class="Special"><-</span> copy out
|
||||
<span id="L114" class="LineNr">114 </span> <a href='102test.subx.html#L23'>check-ints-equal</a> out-int, <span class="Constant">0x80c2</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L22'>to-grapheme</a>/2a"</span> <span class="muComment"># 110 0-0010 10 00-0000</span>
|
||||
<span id="L115" class="LineNr">115 </span><span class="Delimiter">}</span>
|
||||
<span id="L116" class="LineNr">116 </span>
|
||||
<span id="L117" class="LineNr">117 </span><span class="muComment"># largest 2-byte utf-8</span>
|
||||
<span id="L118" class="LineNr">118 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L118'>test-to-grapheme-two-bytes-max</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L119" class="LineNr">119 </span> <span class="PreProc">var</span> in/eax: code-point <span class="Special"><-</span> copy <span class="Constant">0x7ff</span> <span class="muComment"># 1-1111 11-1111</span>
|
||||
<span id="L120" class="LineNr">120 </span> <span class="PreProc">var</span> out/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L22'>to-grapheme</a> in
|
||||
<span id="L121" class="LineNr">121 </span> <span class="PreProc">var</span> out-int/eax: int <span class="Special"><-</span> copy out
|
||||
<span id="L122" class="LineNr">122 </span> <a href='102test.subx.html#L23'>check-ints-equal</a> out-int, <span class="Constant">0xbfdf</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L22'>to-grapheme</a>/2b"</span> <span class="muComment"># 110 1-1111 10 11-1111</span>
|
||||
<span id="L123" class="LineNr">123 </span><span class="Delimiter">}</span>
|
||||
<span id="L124" class="LineNr">124 </span>
|
||||
<span id="L125" class="LineNr">125 </span><span class="muComment"># smallest 3-byte utf-8</span>
|
||||
<span id="L126" class="LineNr">126 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L126'>test-to-grapheme-three-bytes-min</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L127" class="LineNr">127 </span> <span class="PreProc">var</span> in/eax: code-point <span class="Special"><-</span> copy <span class="Constant">0x800</span> <span class="muComment"># 10-0000 00-0000</span>
|
||||
<span id="L128" class="LineNr">128 </span> <span class="PreProc">var</span> out/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L22'>to-grapheme</a> in
|
||||
<span id="L129" class="LineNr">129 </span> <span class="PreProc">var</span> out-int/eax: int <span class="Special"><-</span> copy out
|
||||
<span id="L130" class="LineNr">130 </span> <a href='102test.subx.html#L23'>check-ints-equal</a> out-int, <span class="Constant">0x80a0e0</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L22'>to-grapheme</a>/3a"</span> <span class="muComment"># 1110 0000 10 10-0000 10 00-0000</span>
|
||||
<span id="L131" class="LineNr">131 </span><span class="Delimiter">}</span>
|
||||
<span id="L132" class="LineNr">132 </span>
|
||||
<span id="L133" class="LineNr">133 </span><span class="muComment"># largest 3-byte utf-8</span>
|
||||
<span id="L134" class="LineNr">134 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L134'>test-to-grapheme-three-bytes-max</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L135" class="LineNr">135 </span> <span class="PreProc">var</span> in/eax: code-point <span class="Special"><-</span> copy <span class="Constant">0xffff</span> <span class="muComment"># 1111 11-1111 11-1111</span>
|
||||
<span id="L136" class="LineNr">136 </span> <span class="PreProc">var</span> out/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L22'>to-grapheme</a> in
|
||||
<span id="L137" class="LineNr">137 </span> <span class="PreProc">var</span> out-int/eax: int <span class="Special"><-</span> copy out
|
||||
<span id="L138" class="LineNr">138 </span> <a href='102test.subx.html#L23'>check-ints-equal</a> out-int, <span class="Constant">0xbfbfef</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L22'>to-grapheme</a>/3b"</span> <span class="muComment"># 1110 1111 10 11-1111 10 11-1111</span>
|
||||
<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="muComment"># smallest 4-byte utf-8</span>
|
||||
<span id="L142" class="LineNr">142 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L142'>test-to-grapheme-four-bytes-min</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L143" class="LineNr">143 </span> <span class="PreProc">var</span> in/eax: code-point <span class="Special"><-</span> copy <span class="Constant">0x10000</span> <span class="muComment"># 1-0000 00-0000 00-0000</span>
|
||||
<span id="L144" class="LineNr">144 </span> <span class="PreProc">var</span> out/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L22'>to-grapheme</a> in
|
||||
<span id="L145" class="LineNr">145 </span> <span class="PreProc">var</span> out-int/eax: int <span class="Special"><-</span> copy out
|
||||
<span id="L146" class="LineNr">146 </span> <a href='102test.subx.html#L23'>check-ints-equal</a> out-int, <span class="Constant">0x808090f0</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L22'>to-grapheme</a>/4a"</span> <span class="muComment"># 1111-0 000 10 01-0000 10 00-0000 10 00-0000</span>
|
||||
<span id="L147" class="LineNr">147 </span><span class="Delimiter">}</span>
|
||||
<span id="L148" class="LineNr">148 </span>
|
||||
<span id="L149" class="LineNr">149 </span><span class="muComment"># largest 4-byte utf-8</span>
|
||||
<span id="L150" class="LineNr">150 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L150'>test-to-grapheme-four-bytes-max</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L151" class="LineNr">151 </span> <span class="PreProc">var</span> in/eax: code-point <span class="Special"><-</span> copy <span class="Constant">0x1fffff</span> <span class="muComment"># 111 11-1111 11-1111 11-1111</span>
|
||||
<span id="L152" class="LineNr">152 </span> <span class="PreProc">var</span> out/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L22'>to-grapheme</a> in
|
||||
<span id="L153" class="LineNr">153 </span> <span class="PreProc">var</span> out-int/eax: int <span class="Special"><-</span> copy out
|
||||
<span id="L154" class="LineNr">154 </span> <a href='102test.subx.html#L23'>check-ints-equal</a> out-int, <span class="Constant">0xbfbfbff7</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L22'>to-grapheme</a>/4b"</span> <span class="muComment"># 1111-0 111 10 11-1111 10 11-1111 10 11-1111</span>
|
||||
<span id="L155" class="LineNr">155 </span><span class="Delimiter">}</span>
|
||||
<span id="L156" class="LineNr">156 </span>
|
||||
<span id="L157" class="LineNr">157 </span><span class="muComment"># read the next grapheme from a stream of bytes</span>
|
||||
<span id="L158" class="LineNr">158 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='403unicode.mu.html#L158'>read-grapheme</a></span> in: (addr stream byte)<span class="PreProc"> -> </span>_/eax: grapheme <span class="Delimiter">{</span>
|
||||
<span id="L159" class="LineNr">159 </span> <span class="muComment"># if at eof, return EOF</span>
|
||||
<span id="L160" class="LineNr">160 </span> <span class="Delimiter">{</span>
|
||||
<span id="L161" class="LineNr">161 </span> <span class="PreProc">var</span> eof?/eax: boolean <span class="Special"><-</span> <a href='309stream.subx.html#L6'>stream-empty?</a> in
|
||||
<span id="L162" class="LineNr">162 </span> compare eof?, <span class="Constant">0</span>/false
|
||||
<span id="L163" class="LineNr">163 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L164" class="LineNr">164 </span> <span class="PreProc">return</span> <span class="Constant">0xffffffff</span>
|
||||
<span id="L165" class="LineNr">165 </span> <span class="Delimiter">}</span>
|
||||
<span id="L166" class="LineNr">166 </span> <span class="PreProc">var</span> c/eax: byte <span class="Special"><-</span> <a href='112read-byte.subx.html#L273'>read-byte</a> in
|
||||
<span id="L167" class="LineNr">167 </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="L168" class="LineNr">168 </span> $read-grapheme:compute-length: <span class="Delimiter">{</span>
|
||||
<span id="L169" class="LineNr">169 </span> <span class="muComment"># single byte: just return it</span>
|
||||
<span id="L170" class="LineNr">170 </span> compare c, <span class="Constant">0xc0</span>
|
||||
<span id="L171" class="LineNr">171 </span> <span class="Delimiter">{</span>
|
||||
<span id="L172" class="LineNr">172 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L173" class="LineNr">173 </span> <span class="PreProc">var</span> g/eax: grapheme <span class="Special"><-</span> copy c
|
||||
<span id="L174" class="LineNr">174 </span> <span class="PreProc">return</span> g
|
||||
<span id="L175" class="LineNr">175 </span> <span class="Delimiter">}</span>
|
||||
<span id="L176" class="LineNr">176 </span> compare c, <span class="Constant">0xfe</span>
|
||||
<span id="L177" class="LineNr">177 </span> <span class="Delimiter">{</span>
|
||||
<span id="L178" class="LineNr">178 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L179" class="LineNr">179 </span> <span class="PreProc">var</span> g/eax: grapheme <span class="Special"><-</span> copy c
|
||||
<span id="L180" class="LineNr">180 </span> <span class="PreProc">return</span> g
|
||||
<span id="L181" class="LineNr">181 </span> <span class="Delimiter">}</span>
|
||||
<span id="L182" class="LineNr">182 </span> <span class="muComment"># 2 bytes</span>
|
||||
<span id="L183" class="LineNr">183 </span> compare c, <span class="Constant">0xe0</span>
|
||||
<span id="L184" class="LineNr">184 </span> <span class="Delimiter">{</span>
|
||||
<span id="L185" class="LineNr">185 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L186" class="LineNr">186 </span> num-trailers <span class="Special"><-</span> copy <span class="Constant">1</span>
|
||||
<span id="L187" class="LineNr">187 </span> <span class="PreProc">break</span> $read-grapheme:compute-length
|
||||
<span id="L188" class="LineNr">188 </span> <span class="Delimiter">}</span>
|
||||
<span id="L189" class="LineNr">189 </span> <span class="muComment"># 3 bytes</span>
|
||||
<span id="L190" class="LineNr">190 </span> compare c, <span class="Constant">0xf0</span>
|
||||
<span id="L191" class="LineNr">191 </span> <span class="Delimiter">{</span>
|
||||
<span id="L192" class="LineNr">192 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L193" class="LineNr">193 </span> num-trailers <span class="Special"><-</span> copy <span class="Constant">2</span>
|
||||
<span id="L194" class="LineNr">194 </span> <span class="PreProc">break</span> $read-grapheme:compute-length
|
||||
<span id="L195" class="LineNr">195 </span> <span class="Delimiter">}</span>
|
||||
<span id="L196" class="LineNr">196 </span> <span class="muComment"># 4 bytes</span>
|
||||
<span id="L197" class="LineNr">197 </span> compare c, <span class="Constant">0xf8</span>
|
||||
<span id="L198" class="LineNr">198 </span> <span class="Delimiter">{</span>
|
||||
<span id="L199" class="LineNr">199 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L200" class="LineNr">200 </span> num-trailers <span class="Special"><-</span> copy <span class="Constant">3</span>
|
||||
<span id="L201" class="LineNr">201 </span> <span class="PreProc">break</span> $read-grapheme:compute-length
|
||||
<span id="L202" class="LineNr">202 </span> <span class="Delimiter">}</span>
|
||||
<span id="L203" class="LineNr">203 </span>$read-grapheme:abort: <span class="Delimiter">{</span>
|
||||
<span id="L204" class="LineNr">204 </span> <span class="muComment"># TODO: print to stderr</span>
|
||||
<span id="L205" class="LineNr">205 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">"utf-8 encodings larger than 4 bytes are not supported. First byte seen: "</span>
|
||||
<span id="L206" class="LineNr">206 </span> <span class="PreProc">var</span> n/eax: int <span class="Special"><-</span> copy c
|
||||
<span id="L207" class="LineNr">207 </span> <a href='304screen.subx.html#L226'>print-int32-hex-to-real-screen</a> n
|
||||
<span id="L208" class="LineNr">208 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">"\n"</span>
|
||||
<span id="L209" class="LineNr">209 </span> <span class="PreProc">var</span> exit-status/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> copy <span class="Constant">1</span>
|
||||
<span id="L210" class="LineNr">210 </span> <a href='000init.subx.html#L18'>syscall_exit</a>
|
||||
<span id="L211" class="LineNr">211 </span> <span class="Delimiter">}</span>
|
||||
<span id="L212" class="LineNr">212 </span> <span class="Delimiter">}</span>
|
||||
<span id="L213" class="LineNr">213 </span> <span class="muComment"># prepend trailer bytes</span>
|
||||
<span id="L214" class="LineNr">214 </span> <span class="PreProc">var</span> result/<span class="muRegEdi">edi</span>: grapheme <span class="Special"><-</span> copy c
|
||||
<span id="L215" class="LineNr">215 </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="L216" class="LineNr">216 </span> <span class="Delimiter">{</span>
|
||||
<span id="L217" class="LineNr">217 </span> compare num-trailers, <span class="Constant">0</span>
|
||||
<span id="L218" class="LineNr">218 </span> <span class="PreProc">break-if-<=</span>
|
||||
<span id="L219" class="LineNr">219 </span> <span class="PreProc">var</span> tmp/eax: byte <span class="Special"><-</span> <a href='112read-byte.subx.html#L273'>read-byte</a> in
|
||||
<span id="L220" class="LineNr">220 </span> <span class="PreProc">var</span> tmp2/eax: int <span class="Special"><-</span> copy tmp
|
||||
<span id="L221" class="LineNr">221 </span> tmp2 <span class="Special"><-</span> <a href='403unicode.mu.html#L325'>shift-left-bytes</a> tmp2, num-byte-shifts
|
||||
<span id="L222" class="LineNr">222 </span> result <span class="Special"><-</span> or tmp2
|
||||
<span id="L223" class="LineNr">223 </span> <span class="muComment"># update loop state</span>
|
||||
<span id="L224" class="LineNr">224 </span> num-byte-shifts <span class="Special"><-</span> increment
|
||||
<span id="L225" class="LineNr">225 </span> num-trailers <span class="Special"><-</span> decrement
|
||||
<span id="L226" class="LineNr">226 </span> <span class="PreProc">loop</span>
|
||||
<span id="L227" class="LineNr">227 </span> <span class="Delimiter">}</span>
|
||||
<span id="L228" class="LineNr">228 </span> <span class="PreProc">return</span> result
|
||||
<span id="L229" class="LineNr">229 </span><span class="Delimiter">}</span>
|
||||
<span id="L230" class="LineNr">230 </span>
|
||||
<span id="L231" class="LineNr">231 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L231'>test-read-grapheme</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L232" class="LineNr">232 </span> <span class="PreProc">var</span> s: (stream byte <span class="Constant">0x30</span>)
|
||||
<span id="L233" class="LineNr">233 </span> <span class="PreProc">var</span> s2/<span class="muRegEcx">ecx</span>: (addr stream byte) <span class="Special"><-</span> address s
|
||||
<span id="L234" class="LineNr">234 </span> <a href='108write.subx.html#L24'>write</a> s2, <span class="Constant">"aΒc世d界e"</span>
|
||||
<span id="L235" class="LineNr">235 </span> <span class="PreProc">var</span> c/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L158'>read-grapheme</a> s2
|
||||
<span id="L19" class="LineNr"> 19 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='403unicode.mu.html#L19'>to-utf8</a></span> in: code-point<span class="PreProc"> -> </span>_/eax: code-point-utf8 <span class="Delimiter">{</span>
|
||||
<span id="L20" class="LineNr"> 20 </span> <span class="PreProc">var</span> c/eax: int <span class="Special"><-</span> copy in
|
||||
<span id="L21" class="LineNr"> 21 </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="L22" class="LineNr"> 22 </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="L23" class="LineNr"> 23 </span> $to-utf8:compute-length: <span class="Delimiter">{</span>
|
||||
<span id="L24" class="LineNr"> 24 </span> <span class="muComment"># single byte: just return it</span>
|
||||
<span id="L25" class="LineNr"> 25 </span> compare c, <span class="Constant">0x7f</span>
|
||||
<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">var</span> g/eax: code-point-utf8 <span class="Special"><-</span> copy c
|
||||
<span id="L29" class="LineNr"> 29 </span> <span class="PreProc">return</span> g
|
||||
<span id="L30" class="LineNr"> 30 </span> <span class="Delimiter">}</span>
|
||||
<span id="L31" class="LineNr"> 31 </span> <span class="muComment"># 2 bytes</span>
|
||||
<span id="L32" class="LineNr"> 32 </span> compare c, <span class="Constant">0x7ff</span>
|
||||
<span id="L33" class="LineNr"> 33 </span> <span class="Delimiter">{</span>
|
||||
<span id="L34" class="LineNr"> 34 </span> <span class="PreProc">break-if-></span>
|
||||
<span id="L35" class="LineNr"> 35 </span> num-trailers <span class="Special"><-</span> copy <span class="Constant">1</span>
|
||||
<span id="L36" class="LineNr"> 36 </span> first <span class="Special"><-</span> copy <span class="Constant">0xc0</span>
|
||||
<span id="L37" class="LineNr"> 37 </span> <span class="PreProc">break</span> $to-utf8:compute-length
|
||||
<span id="L38" class="LineNr"> 38 </span> <span class="Delimiter">}</span>
|
||||
<span id="L39" class="LineNr"> 39 </span> <span class="muComment"># 3 bytes</span>
|
||||
<span id="L40" class="LineNr"> 40 </span> compare c, <span class="Constant">0xffff</span>
|
||||
<span id="L41" class="LineNr"> 41 </span> <span class="Delimiter">{</span>
|
||||
<span id="L42" class="LineNr"> 42 </span> <span class="PreProc">break-if-></span>
|
||||
<span id="L43" class="LineNr"> 43 </span> num-trailers <span class="Special"><-</span> copy <span class="Constant">2</span>
|
||||
<span id="L44" class="LineNr"> 44 </span> first <span class="Special"><-</span> copy <span class="Constant">0xe0</span>
|
||||
<span id="L45" class="LineNr"> 45 </span> <span class="PreProc">break</span> $to-utf8:compute-length
|
||||
<span id="L46" class="LineNr"> 46 </span> <span class="Delimiter">}</span>
|
||||
<span id="L47" class="LineNr"> 47 </span> <span class="muComment"># 4 bytes</span>
|
||||
<span id="L48" class="LineNr"> 48 </span> compare c, <span class="Constant">0x1fffff</span>
|
||||
<span id="L49" class="LineNr"> 49 </span> <span class="Delimiter">{</span>
|
||||
<span id="L50" class="LineNr"> 50 </span> <span class="PreProc">break-if-></span>
|
||||
<span id="L51" class="LineNr"> 51 </span> num-trailers <span class="Special"><-</span> copy <span class="Constant">3</span>
|
||||
<span id="L52" class="LineNr"> 52 </span> first <span class="Special"><-</span> copy <span class="Constant">0xf0</span>
|
||||
<span id="L53" class="LineNr"> 53 </span> <span class="PreProc">break</span> $to-utf8:compute-length
|
||||
<span id="L54" class="LineNr"> 54 </span> <span class="Delimiter">}</span>
|
||||
<span id="L55" class="LineNr"> 55 </span> <span class="muComment"># more than 4 bytes: unsupported</span>
|
||||
<span id="L56" class="LineNr"> 56 </span> <span class="muComment"># TODO: print to stderr</span>
|
||||
<span id="L57" class="LineNr"> 57 </span> compare c, <span class="Constant">0x1fffff</span>
|
||||
<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> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">"unsupported code point "</span>
|
||||
<span id="L61" class="LineNr"> 61 </span> <a href='304screen.subx.html#L226'>print-int32-hex-to-real-screen</a> c
|
||||
<span id="L62" class="LineNr"> 62 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">"\n"</span>
|
||||
<span id="L63" class="LineNr"> 63 </span> <span class="PreProc">var</span> exit-status/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> copy <span class="Constant">1</span>
|
||||
<span id="L64" class="LineNr"> 64 </span> <a href='000init.subx.html#L18'>syscall_exit</a>
|
||||
<span id="L65" class="LineNr"> 65 </span> <span class="Delimiter">}</span>
|
||||
<span id="L66" class="LineNr"> 66 </span> <span class="Delimiter">}</span>
|
||||
<span id="L67" class="LineNr"> 67 </span> <span class="muComment"># emit trailer bytes, 6 bits from 'in', first two bits '10'</span>
|
||||
<span id="L68" class="LineNr"> 68 </span> <span class="PreProc">var</span> result/<span class="muRegEdi">edi</span>: code-point-utf8 <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L69" class="LineNr"> 69 </span> <span class="Delimiter">{</span>
|
||||
<span id="L70" class="LineNr"> 70 </span> compare num-trailers, <span class="Constant">0</span>
|
||||
<span id="L71" class="LineNr"> 71 </span> <span class="PreProc">break-if-<=</span>
|
||||
<span id="L72" class="LineNr"> 72 </span> <span class="PreProc">var</span> tmp/<span class="muRegEsi">esi</span>: int <span class="Special"><-</span> copy c
|
||||
<span id="L73" class="LineNr"> 73 </span> tmp <span class="Special"><-</span> and <span class="Constant">0x3f</span>
|
||||
<span id="L74" class="LineNr"> 74 </span> tmp <span class="Special"><-</span> or <span class="Constant">0x80</span>
|
||||
<span id="L75" class="LineNr"> 75 </span> result <span class="Special"><-</span> shift-left <span class="Constant">8</span>
|
||||
<span id="L76" class="LineNr"> 76 </span> result <span class="Special"><-</span> or tmp
|
||||
<span id="L77" class="LineNr"> 77 </span> <span class="muComment"># update loop state</span>
|
||||
<span id="L78" class="LineNr"> 78 </span> c <span class="Special"><-</span> shift-right <span class="Constant">6</span>
|
||||
<span id="L79" class="LineNr"> 79 </span> num-trailers <span class="Special"><-</span> decrement
|
||||
<span id="L80" class="LineNr"> 80 </span> <span class="PreProc">loop</span>
|
||||
<span id="L81" class="LineNr"> 81 </span> <span class="Delimiter">}</span>
|
||||
<span id="L82" class="LineNr"> 82 </span> <span class="muComment"># emit engine</span>
|
||||
<span id="L83" class="LineNr"> 83 </span> result <span class="Special"><-</span> shift-left <span class="Constant">8</span>
|
||||
<span id="L84" class="LineNr"> 84 </span> result <span class="Special"><-</span> or c
|
||||
<span id="L85" class="LineNr"> 85 </span> result <span class="Special"><-</span> or first
|
||||
<span id="L86" class="LineNr"> 86 </span> <span class="muComment">#</span>
|
||||
<span id="L87" class="LineNr"> 87 </span> <span class="PreProc">return</span> result
|
||||
<span id="L88" class="LineNr"> 88 </span><span class="Delimiter">}</span>
|
||||
<span id="L89" class="LineNr"> 89 </span>
|
||||
<span id="L90" class="LineNr"> 90 </span><span class="muComment"># single-byte code point have identical code-point-utf8s</span>
|
||||
<span id="L91" class="LineNr"> 91 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L91'>test-to-utf8-single-byte</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L92" class="LineNr"> 92 </span> <span class="PreProc">var</span> in-int/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L93" class="LineNr"> 93 </span> <span class="Delimiter">{</span>
|
||||
<span id="L94" class="LineNr"> 94 </span> compare in-int, <span class="Constant">0x7f</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> in/eax: code-point <span class="Special"><-</span> copy in-int
|
||||
<span id="L97" class="LineNr"> 97 </span> <span class="PreProc">var</span> out/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L19'>to-utf8</a> in
|
||||
<span id="L98" class="LineNr"> 98 </span> <span class="PreProc">var</span> out-int/eax: int <span class="Special"><-</span> copy out
|
||||
<span id="L99" class="LineNr"> 99 </span> <a href='102test.subx.html#L23'>check-ints-equal</a> out-int, in-int, <span class="Constant">"F - test-to-utf8-single-byte"</span>
|
||||
<span id="L100" class="LineNr">100 </span> in-int <span class="Special"><-</span> increment
|
||||
<span id="L101" class="LineNr">101 </span> <span class="PreProc">loop</span>
|
||||
<span id="L102" class="LineNr">102 </span> <span class="Delimiter">}</span>
|
||||
<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="muComment"># byte | byte | byte | byte</span>
|
||||
<span id="L106" class="LineNr">106 </span><span class="muComment"># smallest 2-byte utf-8</span>
|
||||
<span id="L107" class="LineNr">107 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L107'>test-to-utf8-two-bytes-min</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L108" class="LineNr">108 </span> <span class="PreProc">var</span> in/eax: code-point <span class="Special"><-</span> copy <span class="Constant">0x80</span> <span class="muComment"># 10 00-0000</span>
|
||||
<span id="L109" class="LineNr">109 </span> <span class="PreProc">var</span> out/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L19'>to-utf8</a> in
|
||||
<span id="L110" class="LineNr">110 </span> <span class="PreProc">var</span> out-int/eax: int <span class="Special"><-</span> copy out
|
||||
<span id="L111" class="LineNr">111 </span> <a href='102test.subx.html#L23'>check-ints-equal</a> out-int, <span class="Constant">0x80c2</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L19'>to-utf8</a>/2a"</span> <span class="muComment"># 110 0-0010 10 00-0000</span>
|
||||
<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="muComment"># largest 2-byte utf-8</span>
|
||||
<span id="L115" class="LineNr">115 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L115'>test-to-utf8-two-bytes-max</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L116" class="LineNr">116 </span> <span class="PreProc">var</span> in/eax: code-point <span class="Special"><-</span> copy <span class="Constant">0x7ff</span> <span class="muComment"># 1-1111 11-1111</span>
|
||||
<span id="L117" class="LineNr">117 </span> <span class="PreProc">var</span> out/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L19'>to-utf8</a> in
|
||||
<span id="L118" class="LineNr">118 </span> <span class="PreProc">var</span> out-int/eax: int <span class="Special"><-</span> copy out
|
||||
<span id="L119" class="LineNr">119 </span> <a href='102test.subx.html#L23'>check-ints-equal</a> out-int, <span class="Constant">0xbfdf</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L19'>to-utf8</a>/2b"</span> <span class="muComment"># 110 1-1111 10 11-1111</span>
|
||||
<span id="L120" class="LineNr">120 </span><span class="Delimiter">}</span>
|
||||
<span id="L121" class="LineNr">121 </span>
|
||||
<span id="L122" class="LineNr">122 </span><span class="muComment"># smallest 3-byte utf-8</span>
|
||||
<span id="L123" class="LineNr">123 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L123'>test-to-utf8-three-bytes-min</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L124" class="LineNr">124 </span> <span class="PreProc">var</span> in/eax: code-point <span class="Special"><-</span> copy <span class="Constant">0x800</span> <span class="muComment"># 10-0000 00-0000</span>
|
||||
<span id="L125" class="LineNr">125 </span> <span class="PreProc">var</span> out/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L19'>to-utf8</a> in
|
||||
<span id="L126" class="LineNr">126 </span> <span class="PreProc">var</span> out-int/eax: int <span class="Special"><-</span> copy out
|
||||
<span id="L127" class="LineNr">127 </span> <a href='102test.subx.html#L23'>check-ints-equal</a> out-int, <span class="Constant">0x80a0e0</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L19'>to-utf8</a>/3a"</span> <span class="muComment"># 1110 0000 10 10-0000 10 00-0000</span>
|
||||
<span id="L128" class="LineNr">128 </span><span class="Delimiter">}</span>
|
||||
<span id="L129" class="LineNr">129 </span>
|
||||
<span id="L130" class="LineNr">130 </span><span class="muComment"># largest 3-byte utf-8</span>
|
||||
<span id="L131" class="LineNr">131 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L131'>test-to-utf8-three-bytes-max</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L132" class="LineNr">132 </span> <span class="PreProc">var</span> in/eax: code-point <span class="Special"><-</span> copy <span class="Constant">0xffff</span> <span class="muComment"># 1111 11-1111 11-1111</span>
|
||||
<span id="L133" class="LineNr">133 </span> <span class="PreProc">var</span> out/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L19'>to-utf8</a> in
|
||||
<span id="L134" class="LineNr">134 </span> <span class="PreProc">var</span> out-int/eax: int <span class="Special"><-</span> copy out
|
||||
<span id="L135" class="LineNr">135 </span> <a href='102test.subx.html#L23'>check-ints-equal</a> out-int, <span class="Constant">0xbfbfef</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L19'>to-utf8</a>/3b"</span> <span class="muComment"># 1110 1111 10 11-1111 10 11-1111</span>
|
||||
<span id="L136" class="LineNr">136 </span><span class="Delimiter">}</span>
|
||||
<span id="L137" class="LineNr">137 </span>
|
||||
<span id="L138" class="LineNr">138 </span><span class="muComment"># smallest 4-byte utf-8</span>
|
||||
<span id="L139" class="LineNr">139 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L139'>test-to-utf8-four-bytes-min</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L140" class="LineNr">140 </span> <span class="PreProc">var</span> in/eax: code-point <span class="Special"><-</span> copy <span class="Constant">0x10000</span> <span class="muComment"># 1-0000 00-0000 00-0000</span>
|
||||
<span id="L141" class="LineNr">141 </span> <span class="PreProc">var</span> out/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L19'>to-utf8</a> in
|
||||
<span id="L142" class="LineNr">142 </span> <span class="PreProc">var</span> out-int/eax: int <span class="Special"><-</span> copy out
|
||||
<span id="L143" class="LineNr">143 </span> <a href='102test.subx.html#L23'>check-ints-equal</a> out-int, <span class="Constant">0x808090f0</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L19'>to-utf8</a>/4a"</span> <span class="muComment"># 1111-0 000 10 01-0000 10 00-0000 10 00-0000</span>
|
||||
<span id="L144" class="LineNr">144 </span><span class="Delimiter">}</span>
|
||||
<span id="L145" class="LineNr">145 </span>
|
||||
<span id="L146" class="LineNr">146 </span><span class="muComment"># largest 4-byte utf-8</span>
|
||||
<span id="L147" class="LineNr">147 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L147'>test-to-utf8-four-bytes-max</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L148" class="LineNr">148 </span> <span class="PreProc">var</span> in/eax: code-point <span class="Special"><-</span> copy <span class="Constant">0x1fffff</span> <span class="muComment"># 111 11-1111 11-1111 11-1111</span>
|
||||
<span id="L149" class="LineNr">149 </span> <span class="PreProc">var</span> out/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L19'>to-utf8</a> in
|
||||
<span id="L150" class="LineNr">150 </span> <span class="PreProc">var</span> out-int/eax: int <span class="Special"><-</span> copy out
|
||||
<span id="L151" class="LineNr">151 </span> <a href='102test.subx.html#L23'>check-ints-equal</a> out-int, <span class="Constant">0xbfbfbff7</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L19'>to-utf8</a>/4b"</span> <span class="muComment"># 1111-0 111 10 11-1111 10 11-1111 10 11-1111</span>
|
||||
<span id="L152" class="LineNr">152 </span><span class="Delimiter">}</span>
|
||||
<span id="L153" class="LineNr">153 </span>
|
||||
<span id="L154" class="LineNr">154 </span><span class="muComment"># read the next code-point-utf8 from a stream of bytes</span>
|
||||
<span id="L155" class="LineNr">155 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='403unicode.mu.html#L155'>read-code-point-utf8</a></span> in: (addr stream byte)<span class="PreProc"> -> </span>_/eax: code-point-utf8 <span class="Delimiter">{</span>
|
||||
<span id="L156" class="LineNr">156 </span> <span class="muComment"># if at eof, return EOF</span>
|
||||
<span id="L157" class="LineNr">157 </span> <span class="Delimiter">{</span>
|
||||
<span id="L158" class="LineNr">158 </span> <span class="PreProc">var</span> eof?/eax: boolean <span class="Special"><-</span> <a href='309stream.subx.html#L6'>stream-empty?</a> in
|
||||
<span id="L159" class="LineNr">159 </span> compare eof?, <span class="Constant">0</span>/false
|
||||
<span id="L160" class="LineNr">160 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L161" class="LineNr">161 </span> <span class="PreProc">return</span> <span class="Constant">0xffffffff</span>
|
||||
<span id="L162" class="LineNr">162 </span> <span class="Delimiter">}</span>
|
||||
<span id="L163" class="LineNr">163 </span> <span class="PreProc">var</span> c/eax: byte <span class="Special"><-</span> <a href='112read-byte.subx.html#L273'>read-byte</a> in
|
||||
<span id="L164" class="LineNr">164 </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="L165" class="LineNr">165 </span> $read-code-point-utf8:compute-length: <span class="Delimiter">{</span>
|
||||
<span id="L166" class="LineNr">166 </span> <span class="muComment"># single byte: just return it</span>
|
||||
<span id="L167" class="LineNr">167 </span> compare c, <span class="Constant">0xc0</span>
|
||||
<span id="L168" class="LineNr">168 </span> <span class="Delimiter">{</span>
|
||||
<span id="L169" class="LineNr">169 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L170" class="LineNr">170 </span> <span class="PreProc">var</span> g/eax: code-point-utf8 <span class="Special"><-</span> copy c
|
||||
<span id="L171" class="LineNr">171 </span> <span class="PreProc">return</span> g
|
||||
<span id="L172" class="LineNr">172 </span> <span class="Delimiter">}</span>
|
||||
<span id="L173" class="LineNr">173 </span> compare c, <span class="Constant">0xfe</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>
|
||||
<span id="L176" class="LineNr">176 </span> <span class="PreProc">var</span> g/eax: code-point-utf8 <span class="Special"><-</span> copy c
|
||||
<span id="L177" class="LineNr">177 </span> <span class="PreProc">return</span> g
|
||||
<span id="L178" class="LineNr">178 </span> <span class="Delimiter">}</span>
|
||||
<span id="L179" class="LineNr">179 </span> <span class="muComment"># 2 bytes</span>
|
||||
<span id="L180" class="LineNr">180 </span> compare c, <span class="Constant">0xe0</span>
|
||||
<span id="L181" class="LineNr">181 </span> <span class="Delimiter">{</span>
|
||||
<span id="L182" class="LineNr">182 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L183" class="LineNr">183 </span> num-trailers <span class="Special"><-</span> copy <span class="Constant">1</span>
|
||||
<span id="L184" class="LineNr">184 </span> <span class="PreProc">break</span> $read-code-point-utf8:compute-length
|
||||
<span id="L185" class="LineNr">185 </span> <span class="Delimiter">}</span>
|
||||
<span id="L186" class="LineNr">186 </span> <span class="muComment"># 3 bytes</span>
|
||||
<span id="L187" class="LineNr">187 </span> compare c, <span class="Constant">0xf0</span>
|
||||
<span id="L188" class="LineNr">188 </span> <span class="Delimiter">{</span>
|
||||
<span id="L189" class="LineNr">189 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L190" class="LineNr">190 </span> num-trailers <span class="Special"><-</span> copy <span class="Constant">2</span>
|
||||
<span id="L191" class="LineNr">191 </span> <span class="PreProc">break</span> $read-code-point-utf8:compute-length
|
||||
<span id="L192" class="LineNr">192 </span> <span class="Delimiter">}</span>
|
||||
<span id="L193" class="LineNr">193 </span> <span class="muComment"># 4 bytes</span>
|
||||
<span id="L194" class="LineNr">194 </span> compare c, <span class="Constant">0xf8</span>
|
||||
<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> num-trailers <span class="Special"><-</span> copy <span class="Constant">3</span>
|
||||
<span id="L198" class="LineNr">198 </span> <span class="PreProc">break</span> $read-code-point-utf8:compute-length
|
||||
<span id="L199" class="LineNr">199 </span> <span class="Delimiter">}</span>
|
||||
<span id="L200" class="LineNr">200 </span>$read-code-point-utf8:abort: <span class="Delimiter">{</span>
|
||||
<span id="L201" class="LineNr">201 </span> <span class="muComment"># TODO: print to stderr</span>
|
||||
<span id="L202" class="LineNr">202 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">"utf-8 encodings larger than 4 bytes are not yet supported. First byte seen: "</span>
|
||||
<span id="L203" class="LineNr">203 </span> <span class="PreProc">var</span> n/eax: int <span class="Special"><-</span> copy c
|
||||
<span id="L204" class="LineNr">204 </span> <a href='304screen.subx.html#L226'>print-int32-hex-to-real-screen</a> n
|
||||
<span id="L205" class="LineNr">205 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">"\n"</span>
|
||||
<span id="L206" class="LineNr">206 </span> <span class="PreProc">var</span> exit-status/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> copy <span class="Constant">1</span>
|
||||
<span id="L207" class="LineNr">207 </span> <a href='000init.subx.html#L18'>syscall_exit</a>
|
||||
<span id="L208" class="LineNr">208 </span> <span class="Delimiter">}</span>
|
||||
<span id="L209" class="LineNr">209 </span> <span class="Delimiter">}</span>
|
||||
<span id="L210" class="LineNr">210 </span> <span class="muComment"># prepend trailer bytes</span>
|
||||
<span id="L211" class="LineNr">211 </span> <span class="PreProc">var</span> result/<span class="muRegEdi">edi</span>: code-point-utf8 <span class="Special"><-</span> copy c
|
||||
<span id="L212" class="LineNr">212 </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="L213" class="LineNr">213 </span> <span class="Delimiter">{</span>
|
||||
<span id="L214" class="LineNr">214 </span> compare num-trailers, <span class="Constant">0</span>
|
||||
<span id="L215" class="LineNr">215 </span> <span class="PreProc">break-if-<=</span>
|
||||
<span id="L216" class="LineNr">216 </span> <span class="PreProc">var</span> tmp/eax: byte <span class="Special"><-</span> <a href='112read-byte.subx.html#L273'>read-byte</a> in
|
||||
<span id="L217" class="LineNr">217 </span> <span class="PreProc">var</span> tmp2/eax: int <span class="Special"><-</span> copy tmp
|
||||
<span id="L218" class="LineNr">218 </span> tmp2 <span class="Special"><-</span> <a href='403unicode.mu.html#L322'>shift-left-bytes</a> tmp2, num-byte-shifts
|
||||
<span id="L219" class="LineNr">219 </span> result <span class="Special"><-</span> or tmp2
|
||||
<span id="L220" class="LineNr">220 </span> <span class="muComment"># update loop state</span>
|
||||
<span id="L221" class="LineNr">221 </span> num-byte-shifts <span class="Special"><-</span> increment
|
||||
<span id="L222" class="LineNr">222 </span> num-trailers <span class="Special"><-</span> decrement
|
||||
<span id="L223" class="LineNr">223 </span> <span class="PreProc">loop</span>
|
||||
<span id="L224" class="LineNr">224 </span> <span class="Delimiter">}</span>
|
||||
<span id="L225" class="LineNr">225 </span> <span class="PreProc">return</span> result
|
||||
<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='403unicode.mu.html#L228'>test-read-code-point-utf8</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L229" class="LineNr">229 </span> <span class="PreProc">var</span> s: (stream byte <span class="Constant">0x30</span>)
|
||||
<span id="L230" class="LineNr">230 </span> <span class="PreProc">var</span> s2/<span class="muRegEcx">ecx</span>: (addr stream byte) <span class="Special"><-</span> address s
|
||||
<span id="L231" class="LineNr">231 </span> <a href='108write.subx.html#L24'>write</a> s2, <span class="Constant">"aΒc世d界e"</span>
|
||||
<span id="L232" class="LineNr">232 </span> <span class="PreProc">var</span> c/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L155'>read-code-point-utf8</a> s2
|
||||
<span id="L233" class="LineNr">233 </span> <span class="PreProc">var</span> n/eax: int <span class="Special"><-</span> copy c
|
||||
<span id="L234" class="LineNr">234 </span> <a href='102test.subx.html#L23'>check-ints-equal</a> n, <span class="Constant">0x61</span>, <span class="Constant">"F - test code-point-utf8/0"</span>
|
||||
<span id="L235" class="LineNr">235 </span> <span class="PreProc">var</span> c/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L155'>read-code-point-utf8</a> s2
|
||||
<span id="L236" class="LineNr">236 </span> <span class="PreProc">var</span> n/eax: int <span class="Special"><-</span> copy c
|
||||
<span id="L237" class="LineNr">237 </span> <a href='102test.subx.html#L23'>check-ints-equal</a> n, <span class="Constant">0x61</span>, <span class="Constant">"F - test grapheme/0"</span>
|
||||
<span id="L238" class="LineNr">238 </span> <span class="PreProc">var</span> c/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L158'>read-grapheme</a> s2
|
||||
<span id="L237" class="LineNr">237 </span> <a href='102test.subx.html#L23'>check-ints-equal</a> n, <span class="Constant">0x92ce</span>/greek-capital-letter-beta, <span class="Constant">"F - test code-point-utf8/1"</span>
|
||||
<span id="L238" class="LineNr">238 </span> <span class="PreProc">var</span> c/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L155'>read-code-point-utf8</a> s2
|
||||
<span id="L239" class="LineNr">239 </span> <span class="PreProc">var</span> n/eax: int <span class="Special"><-</span> copy c
|
||||
<span id="L240" class="LineNr">240 </span> <a href='102test.subx.html#L23'>check-ints-equal</a> n, <span class="Constant">0x92ce</span>/greek-capital-letter-beta, <span class="Constant">"F - test grapheme/1"</span>
|
||||
<span id="L241" class="LineNr">241 </span> <span class="PreProc">var</span> c/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L158'>read-grapheme</a> s2
|
||||
<span id="L240" class="LineNr">240 </span> <a href='102test.subx.html#L23'>check-ints-equal</a> n, <span class="Constant">0x63</span>, <span class="Constant">"F - test code-point-utf8/2"</span>
|
||||
<span id="L241" class="LineNr">241 </span> <span class="PreProc">var</span> c/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L155'>read-code-point-utf8</a> s2
|
||||
<span id="L242" class="LineNr">242 </span> <span class="PreProc">var</span> n/eax: int <span class="Special"><-</span> copy c
|
||||
<span id="L243" class="LineNr">243 </span> <a href='102test.subx.html#L23'>check-ints-equal</a> n, <span class="Constant">0x63</span>, <span class="Constant">"F - test grapheme/2"</span>
|
||||
<span id="L244" class="LineNr">244 </span> <span class="PreProc">var</span> c/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L158'>read-grapheme</a> s2
|
||||
<span id="L243" class="LineNr">243 </span> <a href='102test.subx.html#L23'>check-ints-equal</a> n, <span class="Constant">0x96b8e4</span>, <span class="Constant">"F - test code-point-utf8/3"</span>
|
||||
<span id="L244" class="LineNr">244 </span> <span class="PreProc">var</span> c/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L155'>read-code-point-utf8</a> s2
|
||||
<span id="L245" class="LineNr">245 </span> <span class="PreProc">var</span> n/eax: int <span class="Special"><-</span> copy c
|
||||
<span id="L246" class="LineNr">246 </span> <a href='102test.subx.html#L23'>check-ints-equal</a> n, <span class="Constant">0x96b8e4</span>, <span class="Constant">"F - test grapheme/3"</span>
|
||||
<span id="L247" class="LineNr">247 </span> <span class="PreProc">var</span> c/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L158'>read-grapheme</a> s2
|
||||
<span id="L246" class="LineNr">246 </span> <a href='102test.subx.html#L23'>check-ints-equal</a> n, <span class="Constant">0x64</span>, <span class="Constant">"F - test code-point-utf8/4"</span>
|
||||
<span id="L247" class="LineNr">247 </span> <span class="PreProc">var</span> c/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L155'>read-code-point-utf8</a> s2
|
||||
<span id="L248" class="LineNr">248 </span> <span class="PreProc">var</span> n/eax: int <span class="Special"><-</span> copy c
|
||||
<span id="L249" class="LineNr">249 </span> <a href='102test.subx.html#L23'>check-ints-equal</a> n, <span class="Constant">0x64</span>, <span class="Constant">"F - test grapheme/4"</span>
|
||||
<span id="L250" class="LineNr">250 </span> <span class="PreProc">var</span> c/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L158'>read-grapheme</a> s2
|
||||
<span id="L249" class="LineNr">249 </span> <a href='102test.subx.html#L23'>check-ints-equal</a> n, <span class="Constant">0x8c95e7</span>, <span class="Constant">"F - test code-point-utf8/5"</span>
|
||||
<span id="L250" class="LineNr">250 </span> <span class="PreProc">var</span> c/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L155'>read-code-point-utf8</a> s2
|
||||
<span id="L251" class="LineNr">251 </span> <span class="PreProc">var</span> n/eax: int <span class="Special"><-</span> copy c
|
||||
<span id="L252" class="LineNr">252 </span> <a href='102test.subx.html#L23'>check-ints-equal</a> n, <span class="Constant">0x8c95e7</span>, <span class="Constant">"F - test grapheme/5"</span>
|
||||
<span id="L253" class="LineNr">253 </span> <span class="PreProc">var</span> c/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L158'>read-grapheme</a> s2
|
||||
<span id="L254" class="LineNr">254 </span> <span class="PreProc">var</span> n/eax: int <span class="Special"><-</span> copy c
|
||||
<span id="L255" class="LineNr">255 </span> <a href='102test.subx.html#L23'>check-ints-equal</a> n, <span class="Constant">0x65</span>, <span class="Constant">"F - test grapheme/6"</span>
|
||||
<span id="L256" class="LineNr">256 </span><span class="Delimiter">}</span>
|
||||
<span id="L257" class="LineNr">257 </span>
|
||||
<span id="L258" class="LineNr">258 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='403unicode.mu.html#L258'>read-grapheme-buffered</a></span> in: (addr buffered-file)<span class="PreProc"> -> </span>_/eax: grapheme <span class="Delimiter">{</span>
|
||||
<span id="L259" class="LineNr">259 </span> <span class="PreProc">var</span> c/eax: byte <span class="Special"><-</span> <a href='112read-byte.subx.html#L38'>read-byte-buffered</a> in
|
||||
<span id="L260" class="LineNr">260 </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="L261" class="LineNr">261 </span> $read-grapheme-buffered:compute-length: <span class="Delimiter">{</span>
|
||||
<span id="L262" class="LineNr">262 </span> <span class="muComment"># single byte: just return it</span>
|
||||
<span id="L263" class="LineNr">263 </span> compare c, <span class="Constant">0xc0</span>
|
||||
<span id="L264" class="LineNr">264 </span> <span class="Delimiter">{</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> g/eax: grapheme <span class="Special"><-</span> copy c
|
||||
<span id="L267" class="LineNr">267 </span> <span class="PreProc">return</span> g
|
||||
<span id="L268" class="LineNr">268 </span> <span class="Delimiter">}</span>
|
||||
<span id="L269" class="LineNr">269 </span> compare c, <span class="Constant">0xfe</span>
|
||||
<span id="L270" class="LineNr">270 </span> <span class="Delimiter">{</span>
|
||||
<span id="L271" class="LineNr">271 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L272" class="LineNr">272 </span> <span class="PreProc">var</span> g/eax: grapheme <span class="Special"><-</span> copy c
|
||||
<span id="L273" class="LineNr">273 </span> <span class="PreProc">return</span> g
|
||||
<span id="L274" class="LineNr">274 </span> <span class="Delimiter">}</span>
|
||||
<span id="L275" class="LineNr">275 </span> <span class="muComment"># 2 bytes</span>
|
||||
<span id="L276" class="LineNr">276 </span> compare c, <span class="Constant">0xe0</span>
|
||||
<span id="L277" class="LineNr">277 </span> <span class="Delimiter">{</span>
|
||||
<span id="L278" class="LineNr">278 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L279" class="LineNr">279 </span> num-trailers <span class="Special"><-</span> copy <span class="Constant">1</span>
|
||||
<span id="L280" class="LineNr">280 </span> <span class="PreProc">break</span> $read-grapheme-buffered:compute-length
|
||||
<span id="L281" class="LineNr">281 </span> <span class="Delimiter">}</span>
|
||||
<span id="L282" class="LineNr">282 </span> <span class="muComment"># 3 bytes</span>
|
||||
<span id="L283" class="LineNr">283 </span> compare c, <span class="Constant">0xf0</span>
|
||||
<span id="L284" class="LineNr">284 </span> <span class="Delimiter">{</span>
|
||||
<span id="L285" class="LineNr">285 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L286" class="LineNr">286 </span> num-trailers <span class="Special"><-</span> copy <span class="Constant">2</span>
|
||||
<span id="L287" class="LineNr">287 </span> <span class="PreProc">break</span> $read-grapheme-buffered:compute-length
|
||||
<span id="L288" class="LineNr">288 </span> <span class="Delimiter">}</span>
|
||||
<span id="L289" class="LineNr">289 </span> <span class="muComment"># 4 bytes</span>
|
||||
<span id="L290" class="LineNr">290 </span> compare c, <span class="Constant">0xf8</span>
|
||||
<span id="L291" class="LineNr">291 </span> <span class="Delimiter">{</span>
|
||||
<span id="L292" class="LineNr">292 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L293" class="LineNr">293 </span> num-trailers <span class="Special"><-</span> copy <span class="Constant">3</span>
|
||||
<span id="L294" class="LineNr">294 </span> <span class="PreProc">break</span> $read-grapheme-buffered:compute-length
|
||||
<span id="L295" class="LineNr">295 </span> <span class="Delimiter">}</span>
|
||||
<span id="L296" class="LineNr">296 </span>$read-grapheme-buffered:abort: <span class="Delimiter">{</span>
|
||||
<span id="L297" class="LineNr">297 </span> <span class="muComment"># TODO: print to stderr</span>
|
||||
<span id="L298" class="LineNr">298 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">"utf-8 encodings larger than 4 bytes are not supported. First byte seen: "</span>
|
||||
<span id="L299" class="LineNr">299 </span> <span class="PreProc">var</span> n/eax: int <span class="Special"><-</span> copy c
|
||||
<span id="L300" class="LineNr">300 </span> <a href='304screen.subx.html#L226'>print-int32-hex-to-real-screen</a> n
|
||||
<span id="L301" class="LineNr">301 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">"\n"</span>
|
||||
<span id="L302" class="LineNr">302 </span> <span class="PreProc">var</span> exit-status/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> copy <span class="Constant">1</span>
|
||||
<span id="L303" class="LineNr">303 </span> <a href='000init.subx.html#L18'>syscall_exit</a>
|
||||
<span id="L304" class="LineNr">304 </span> <span class="Delimiter">}</span>
|
||||
<span id="L305" class="LineNr">305 </span> <span class="Delimiter">}</span>
|
||||
<span id="L306" class="LineNr">306 </span> <span class="muComment"># prepend trailer bytes</span>
|
||||
<span id="L307" class="LineNr">307 </span> <span class="PreProc">var</span> result/<span class="muRegEdi">edi</span>: grapheme <span class="Special"><-</span> copy c
|
||||
<span id="L308" class="LineNr">308 </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="L309" class="LineNr">309 </span> <span class="Delimiter">{</span>
|
||||
<span id="L310" class="LineNr">310 </span> compare num-trailers, <span class="Constant">0</span>
|
||||
<span id="L311" class="LineNr">311 </span> <span class="PreProc">break-if-<=</span>
|
||||
<span id="L312" class="LineNr">312 </span> <span class="PreProc">var</span> tmp/eax: byte <span class="Special"><-</span> <a href='112read-byte.subx.html#L38'>read-byte-buffered</a> in
|
||||
<span id="L313" class="LineNr">313 </span> <span class="PreProc">var</span> tmp2/eax: int <span class="Special"><-</span> copy tmp
|
||||
<span id="L314" class="LineNr">314 </span> tmp2 <span class="Special"><-</span> <a href='403unicode.mu.html#L325'>shift-left-bytes</a> tmp2, num-byte-shifts
|
||||
<span id="L315" class="LineNr">315 </span> result <span class="Special"><-</span> or tmp2
|
||||
<span id="L316" class="LineNr">316 </span> <span class="muComment"># update loop state</span>
|
||||
<span id="L317" class="LineNr">317 </span> num-byte-shifts <span class="Special"><-</span> increment
|
||||
<span id="L318" class="LineNr">318 </span> num-trailers <span class="Special"><-</span> decrement
|
||||
<span id="L319" class="LineNr">319 </span> <span class="PreProc">loop</span>
|
||||
<span id="L320" class="LineNr">320 </span> <span class="Delimiter">}</span>
|
||||
<span id="L321" class="LineNr">321 </span> <span class="PreProc">return</span> result
|
||||
<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="muComment"># needed because available primitives only shift by a literal/constant number of bits</span>
|
||||
<span id="L325" class="LineNr">325 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='403unicode.mu.html#L325'>shift-left-bytes</a></span> n: int, k: int<span class="PreProc"> -> </span>_/eax: int <span class="Delimiter">{</span>
|
||||
<span id="L326" class="LineNr">326 </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="L327" class="LineNr">327 </span> <span class="PreProc">var</span> result/eax: int <span class="Special"><-</span> copy n
|
||||
<span id="L328" class="LineNr">328 </span> <span class="Delimiter">{</span>
|
||||
<span id="L329" class="LineNr">329 </span> compare i, k
|
||||
<span id="L330" class="LineNr">330 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L331" class="LineNr">331 </span> compare i, <span class="Constant">4</span> <span class="muComment"># only 4 bytes in 32 bits</span>
|
||||
<span id="L332" class="LineNr">332 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L333" class="LineNr">333 </span> result <span class="Special"><-</span> shift-left <span class="Constant">8</span>
|
||||
<span id="L334" class="LineNr">334 </span> i <span class="Special"><-</span> increment
|
||||
<span id="L335" class="LineNr">335 </span> <span class="PreProc">loop</span>
|
||||
<span id="L336" class="LineNr">336 </span> <span class="Delimiter">}</span>
|
||||
<span id="L337" class="LineNr">337 </span> <span class="PreProc">return</span> result
|
||||
<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="muTest"><a href='403unicode.mu.html#L340'>test-shift-left-bytes-0</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L341" class="LineNr">341 </span> <span class="PreProc">var</span> result/eax: int <span class="Special"><-</span> <a href='403unicode.mu.html#L325'>shift-left-bytes</a> <span class="Constant">1</span>, <span class="Constant">0</span>
|
||||
<span id="L342" class="LineNr">342 </span> <a href='102test.subx.html#L23'>check-ints-equal</a> result, <span class="Constant">1</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L325'>shift-left-bytes</a> 0"</span>
|
||||
<span id="L343" class="LineNr">343 </span><span class="Delimiter">}</span>
|
||||
<span id="L344" class="LineNr">344 </span>
|
||||
<span id="L345" class="LineNr">345 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L345'>test-shift-left-bytes-1</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L346" class="LineNr">346 </span> <span class="PreProc">var</span> result/eax: int <span class="Special"><-</span> <a href='403unicode.mu.html#L325'>shift-left-bytes</a> <span class="Constant">1</span>, <span class="Constant">1</span>
|
||||
<span id="L347" class="LineNr">347 </span> <a href='102test.subx.html#L23'>check-ints-equal</a> result, <span class="Constant">0x100</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L325'>shift-left-bytes</a> 1"</span>
|
||||
<span id="L348" class="LineNr">348 </span><span class="Delimiter">}</span>
|
||||
<span id="L349" class="LineNr">349 </span>
|
||||
<span id="L350" class="LineNr">350 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L350'>test-shift-left-bytes-2</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L351" class="LineNr">351 </span> <span class="PreProc">var</span> result/eax: int <span class="Special"><-</span> <a href='403unicode.mu.html#L325'>shift-left-bytes</a> <span class="Constant">1</span>, <span class="Constant">2</span>
|
||||
<span id="L352" class="LineNr">352 </span> <a href='102test.subx.html#L23'>check-ints-equal</a> result, <span class="Constant">0x10000</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L325'>shift-left-bytes</a> 2"</span>
|
||||
<span id="L353" class="LineNr">353 </span><span class="Delimiter">}</span>
|
||||
<span id="L354" class="LineNr">354 </span>
|
||||
<span id="L355" class="LineNr">355 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L355'>test-shift-left-bytes-3</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L356" class="LineNr">356 </span> <span class="PreProc">var</span> result/eax: int <span class="Special"><-</span> <a href='403unicode.mu.html#L325'>shift-left-bytes</a> <span class="Constant">1</span>, <span class="Constant">3</span>
|
||||
<span id="L357" class="LineNr">357 </span> <a href='102test.subx.html#L23'>check-ints-equal</a> result, <span class="Constant">0x1000000</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L325'>shift-left-bytes</a> 3"</span>
|
||||
<span id="L358" class="LineNr">358 </span><span class="Delimiter">}</span>
|
||||
<span id="L359" class="LineNr">359 </span>
|
||||
<span id="L360" class="LineNr">360 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L360'>test-shift-left-bytes-4</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L361" class="LineNr">361 </span> <span class="PreProc">var</span> result/eax: int <span class="Special"><-</span> <a href='403unicode.mu.html#L325'>shift-left-bytes</a> <span class="Constant">1</span>, <span class="Constant">4</span>
|
||||
<span id="L362" class="LineNr">362 </span> <a href='102test.subx.html#L23'>check-ints-equal</a> result, <span class="Constant">0</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L325'>shift-left-bytes</a> 4"</span>
|
||||
<span id="L363" class="LineNr">363 </span><span class="Delimiter">}</span>
|
||||
<span id="L364" class="LineNr">364 </span>
|
||||
<span id="L365" class="LineNr">365 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L365'>test-shift-left-bytes-5</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L366" class="LineNr">366 </span> <span class="PreProc">var</span> result/eax: int <span class="Special"><-</span> <a href='403unicode.mu.html#L325'>shift-left-bytes</a> <span class="Constant">1</span>, <span class="Constant">5</span>
|
||||
<span id="L367" class="LineNr">367 </span> <a href='102test.subx.html#L23'>check-ints-equal</a> result, <span class="Constant">0</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L325'>shift-left-bytes</a> >4"</span>
|
||||
<span id="L368" class="LineNr">368 </span><span class="Delimiter">}</span>
|
||||
<span id="L369" class="LineNr">369 </span>
|
||||
<span id="L370" class="LineNr">370 </span><span class="muComment"># write a grapheme to a stream of bytes</span>
|
||||
<span id="L371" class="LineNr">371 </span><span class="muComment"># this is like write-to-stream, except we skip leading 0 bytes</span>
|
||||
<span id="L372" class="LineNr">372 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='403unicode.mu.html#L372'>write-grapheme</a></span> out: (addr stream byte), g: grapheme <span class="Delimiter">{</span>
|
||||
<span id="L373" class="LineNr">373 </span>$write-grapheme:body: <span class="Delimiter">{</span>
|
||||
<span id="L374" class="LineNr">374 </span> <span class="PreProc">var</span> c/eax: int <span class="Special"><-</span> copy g
|
||||
<span id="L375" class="LineNr">375 </span> <a href='115write-byte.subx.html#L208'>append-byte</a> out, c <span class="muComment"># first byte is always written</span>
|
||||
<span id="L376" class="LineNr">376 </span> c <span class="Special"><-</span> shift-right <span class="Constant">8</span>
|
||||
<span id="L377" class="LineNr">377 </span> compare c, <span class="Constant">0</span>
|
||||
<span id="L378" class="LineNr">378 </span> <span class="PreProc">break-if-=</span> $write-grapheme:body
|
||||
<span id="L379" class="LineNr">379 </span> <a href='115write-byte.subx.html#L208'>append-byte</a> out, c
|
||||
<span id="L380" class="LineNr">380 </span> c <span class="Special"><-</span> shift-right <span class="Constant">8</span>
|
||||
<span id="L381" class="LineNr">381 </span> compare c, <span class="Constant">0</span>
|
||||
<span id="L382" class="LineNr">382 </span> <span class="PreProc">break-if-=</span> $write-grapheme:body
|
||||
<span id="L383" class="LineNr">383 </span> <a href='115write-byte.subx.html#L208'>append-byte</a> out, c
|
||||
<span id="L384" class="LineNr">384 </span> c <span class="Special"><-</span> shift-right <span class="Constant">8</span>
|
||||
<span id="L385" class="LineNr">385 </span> compare c, <span class="Constant">0</span>
|
||||
<span id="L386" class="LineNr">386 </span> <span class="PreProc">break-if-=</span> $write-grapheme:body
|
||||
<span id="L387" class="LineNr">387 </span> <a href='115write-byte.subx.html#L208'>append-byte</a> out, c
|
||||
<span id="L388" class="LineNr">388 </span><span class="Delimiter">}</span>
|
||||
<span id="L389" class="LineNr">389 </span><span class="Delimiter">}</span>
|
||||
<span id="L252" class="LineNr">252 </span> <a href='102test.subx.html#L23'>check-ints-equal</a> n, <span class="Constant">0x65</span>, <span class="Constant">"F - test code-point-utf8/6"</span>
|
||||
<span id="L253" class="LineNr">253 </span><span class="Delimiter">}</span>
|
||||
<span id="L254" class="LineNr">254 </span>
|
||||
<span id="L255" class="LineNr">255 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='403unicode.mu.html#L255'>read-code-point-utf8-buffered</a></span> in: (addr buffered-file)<span class="PreProc"> -> </span>_/eax: code-point-utf8 <span class="Delimiter">{</span>
|
||||
<span id="L256" class="LineNr">256 </span> <span class="PreProc">var</span> c/eax: byte <span class="Special"><-</span> <a href='112read-byte.subx.html#L38'>read-byte-buffered</a> in
|
||||
<span id="L257" class="LineNr">257 </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="L258" class="LineNr">258 </span> $read-code-point-utf8-buffered:compute-length: <span class="Delimiter">{</span>
|
||||
<span id="L259" class="LineNr">259 </span> <span class="muComment"># single byte: just return it</span>
|
||||
<span id="L260" class="LineNr">260 </span> compare c, <span class="Constant">0xc0</span>
|
||||
<span id="L261" class="LineNr">261 </span> <span class="Delimiter">{</span>
|
||||
<span id="L262" class="LineNr">262 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L263" class="LineNr">263 </span> <span class="PreProc">var</span> g/eax: code-point-utf8 <span class="Special"><-</span> copy c
|
||||
<span id="L264" class="LineNr">264 </span> <span class="PreProc">return</span> g
|
||||
<span id="L265" class="LineNr">265 </span> <span class="Delimiter">}</span>
|
||||
<span id="L266" class="LineNr">266 </span> compare c, <span class="Constant">0xfe</span>
|
||||
<span id="L267" class="LineNr">267 </span> <span class="Delimiter">{</span>
|
||||
<span id="L268" class="LineNr">268 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L269" class="LineNr">269 </span> <span class="PreProc">var</span> g/eax: code-point-utf8 <span class="Special"><-</span> copy c
|
||||
<span id="L270" class="LineNr">270 </span> <span class="PreProc">return</span> g
|
||||
<span id="L271" class="LineNr">271 </span> <span class="Delimiter">}</span>
|
||||
<span id="L272" class="LineNr">272 </span> <span class="muComment"># 2 bytes</span>
|
||||
<span id="L273" class="LineNr">273 </span> compare c, <span class="Constant">0xe0</span>
|
||||
<span id="L274" class="LineNr">274 </span> <span class="Delimiter">{</span>
|
||||
<span id="L275" class="LineNr">275 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L276" class="LineNr">276 </span> num-trailers <span class="Special"><-</span> copy <span class="Constant">1</span>
|
||||
<span id="L277" class="LineNr">277 </span> <span class="PreProc">break</span> $read-code-point-utf8-buffered:compute-length
|
||||
<span id="L278" class="LineNr">278 </span> <span class="Delimiter">}</span>
|
||||
<span id="L279" class="LineNr">279 </span> <span class="muComment"># 3 bytes</span>
|
||||
<span id="L280" class="LineNr">280 </span> compare c, <span class="Constant">0xf0</span>
|
||||
<span id="L281" class="LineNr">281 </span> <span class="Delimiter">{</span>
|
||||
<span id="L282" class="LineNr">282 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L283" class="LineNr">283 </span> num-trailers <span class="Special"><-</span> copy <span class="Constant">2</span>
|
||||
<span id="L284" class="LineNr">284 </span> <span class="PreProc">break</span> $read-code-point-utf8-buffered:compute-length
|
||||
<span id="L285" class="LineNr">285 </span> <span class="Delimiter">}</span>
|
||||
<span id="L286" class="LineNr">286 </span> <span class="muComment"># 4 bytes</span>
|
||||
<span id="L287" class="LineNr">287 </span> compare c, <span class="Constant">0xf8</span>
|
||||
<span id="L288" class="LineNr">288 </span> <span class="Delimiter">{</span>
|
||||
<span id="L289" class="LineNr">289 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L290" class="LineNr">290 </span> num-trailers <span class="Special"><-</span> copy <span class="Constant">3</span>
|
||||
<span id="L291" class="LineNr">291 </span> <span class="PreProc">break</span> $read-code-point-utf8-buffered:compute-length
|
||||
<span id="L292" class="LineNr">292 </span> <span class="Delimiter">}</span>
|
||||
<span id="L293" class="LineNr">293 </span>$read-code-point-utf8-buffered:abort: <span class="Delimiter">{</span>
|
||||
<span id="L294" class="LineNr">294 </span> <span class="muComment"># TODO: print to stderr</span>
|
||||
<span id="L295" class="LineNr">295 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">"utf-8 encodings larger than 4 bytes are not supported. First byte seen: "</span>
|
||||
<span id="L296" class="LineNr">296 </span> <span class="PreProc">var</span> n/eax: int <span class="Special"><-</span> copy c
|
||||
<span id="L297" class="LineNr">297 </span> <a href='304screen.subx.html#L226'>print-int32-hex-to-real-screen</a> n
|
||||
<span id="L298" class="LineNr">298 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">"\n"</span>
|
||||
<span id="L299" class="LineNr">299 </span> <span class="PreProc">var</span> exit-status/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> copy <span class="Constant">1</span>
|
||||
<span id="L300" class="LineNr">300 </span> <a href='000init.subx.html#L18'>syscall_exit</a>
|
||||
<span id="L301" class="LineNr">301 </span> <span class="Delimiter">}</span>
|
||||
<span id="L302" class="LineNr">302 </span> <span class="Delimiter">}</span>
|
||||
<span id="L303" class="LineNr">303 </span> <span class="muComment"># prepend trailer bytes</span>
|
||||
<span id="L304" class="LineNr">304 </span> <span class="PreProc">var</span> result/<span class="muRegEdi">edi</span>: code-point-utf8 <span class="Special"><-</span> copy c
|
||||
<span id="L305" class="LineNr">305 </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="L306" class="LineNr">306 </span> <span class="Delimiter">{</span>
|
||||
<span id="L307" class="LineNr">307 </span> compare num-trailers, <span class="Constant">0</span>
|
||||
<span id="L308" class="LineNr">308 </span> <span class="PreProc">break-if-<=</span>
|
||||
<span id="L309" class="LineNr">309 </span> <span class="PreProc">var</span> tmp/eax: byte <span class="Special"><-</span> <a href='112read-byte.subx.html#L38'>read-byte-buffered</a> in
|
||||
<span id="L310" class="LineNr">310 </span> <span class="PreProc">var</span> tmp2/eax: int <span class="Special"><-</span> copy tmp
|
||||
<span id="L311" class="LineNr">311 </span> tmp2 <span class="Special"><-</span> <a href='403unicode.mu.html#L322'>shift-left-bytes</a> tmp2, num-byte-shifts
|
||||
<span id="L312" class="LineNr">312 </span> result <span class="Special"><-</span> or tmp2
|
||||
<span id="L313" class="LineNr">313 </span> <span class="muComment"># update loop state</span>
|
||||
<span id="L314" class="LineNr">314 </span> num-byte-shifts <span class="Special"><-</span> increment
|
||||
<span id="L315" class="LineNr">315 </span> num-trailers <span class="Special"><-</span> decrement
|
||||
<span id="L316" class="LineNr">316 </span> <span class="PreProc">loop</span>
|
||||
<span id="L317" class="LineNr">317 </span> <span class="Delimiter">}</span>
|
||||
<span id="L318" class="LineNr">318 </span> <span class="PreProc">return</span> result
|
||||
<span id="L319" class="LineNr">319 </span><span class="Delimiter">}</span>
|
||||
<span id="L320" class="LineNr">320 </span>
|
||||
<span id="L321" class="LineNr">321 </span><span class="muComment"># needed because available primitives only shift by a literal/constant number of bits</span>
|
||||
<span id="L322" class="LineNr">322 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='403unicode.mu.html#L322'>shift-left-bytes</a></span> n: int, k: int<span class="PreProc"> -> </span>_/eax: int <span class="Delimiter">{</span>
|
||||
<span id="L323" class="LineNr">323 </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="L324" class="LineNr">324 </span> <span class="PreProc">var</span> result/eax: int <span class="Special"><-</span> copy n
|
||||
<span id="L325" class="LineNr">325 </span> <span class="Delimiter">{</span>
|
||||
<span id="L326" class="LineNr">326 </span> compare i, k
|
||||
<span id="L327" class="LineNr">327 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L328" class="LineNr">328 </span> compare i, <span class="Constant">4</span> <span class="muComment"># only 4 bytes in 32 bits</span>
|
||||
<span id="L329" class="LineNr">329 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L330" class="LineNr">330 </span> result <span class="Special"><-</span> shift-left <span class="Constant">8</span>
|
||||
<span id="L331" class="LineNr">331 </span> i <span class="Special"><-</span> increment
|
||||
<span id="L332" class="LineNr">332 </span> <span class="PreProc">loop</span>
|
||||
<span id="L333" class="LineNr">333 </span> <span class="Delimiter">}</span>
|
||||
<span id="L334" class="LineNr">334 </span> <span class="PreProc">return</span> result
|
||||
<span id="L335" class="LineNr">335 </span><span class="Delimiter">}</span>
|
||||
<span id="L336" class="LineNr">336 </span>
|
||||
<span id="L337" class="LineNr">337 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L337'>test-shift-left-bytes-0</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L338" class="LineNr">338 </span> <span class="PreProc">var</span> result/eax: int <span class="Special"><-</span> <a href='403unicode.mu.html#L322'>shift-left-bytes</a> <span class="Constant">1</span>, <span class="Constant">0</span>
|
||||
<span id="L339" class="LineNr">339 </span> <a href='102test.subx.html#L23'>check-ints-equal</a> result, <span class="Constant">1</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L322'>shift-left-bytes</a> 0"</span>
|
||||
<span id="L340" class="LineNr">340 </span><span class="Delimiter">}</span>
|
||||
<span id="L341" class="LineNr">341 </span>
|
||||
<span id="L342" class="LineNr">342 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L342'>test-shift-left-bytes-1</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L343" class="LineNr">343 </span> <span class="PreProc">var</span> result/eax: int <span class="Special"><-</span> <a href='403unicode.mu.html#L322'>shift-left-bytes</a> <span class="Constant">1</span>, <span class="Constant">1</span>
|
||||
<span id="L344" class="LineNr">344 </span> <a href='102test.subx.html#L23'>check-ints-equal</a> result, <span class="Constant">0x100</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L322'>shift-left-bytes</a> 1"</span>
|
||||
<span id="L345" class="LineNr">345 </span><span class="Delimiter">}</span>
|
||||
<span id="L346" class="LineNr">346 </span>
|
||||
<span id="L347" class="LineNr">347 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L347'>test-shift-left-bytes-2</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L348" class="LineNr">348 </span> <span class="PreProc">var</span> result/eax: int <span class="Special"><-</span> <a href='403unicode.mu.html#L322'>shift-left-bytes</a> <span class="Constant">1</span>, <span class="Constant">2</span>
|
||||
<span id="L349" class="LineNr">349 </span> <a href='102test.subx.html#L23'>check-ints-equal</a> result, <span class="Constant">0x10000</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L322'>shift-left-bytes</a> 2"</span>
|
||||
<span id="L350" class="LineNr">350 </span><span class="Delimiter">}</span>
|
||||
<span id="L351" class="LineNr">351 </span>
|
||||
<span id="L352" class="LineNr">352 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L352'>test-shift-left-bytes-3</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L353" class="LineNr">353 </span> <span class="PreProc">var</span> result/eax: int <span class="Special"><-</span> <a href='403unicode.mu.html#L322'>shift-left-bytes</a> <span class="Constant">1</span>, <span class="Constant">3</span>
|
||||
<span id="L354" class="LineNr">354 </span> <a href='102test.subx.html#L23'>check-ints-equal</a> result, <span class="Constant">0x1000000</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L322'>shift-left-bytes</a> 3"</span>
|
||||
<span id="L355" class="LineNr">355 </span><span class="Delimiter">}</span>
|
||||
<span id="L356" class="LineNr">356 </span>
|
||||
<span id="L357" class="LineNr">357 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L357'>test-shift-left-bytes-4</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L358" class="LineNr">358 </span> <span class="PreProc">var</span> result/eax: int <span class="Special"><-</span> <a href='403unicode.mu.html#L322'>shift-left-bytes</a> <span class="Constant">1</span>, <span class="Constant">4</span>
|
||||
<span id="L359" class="LineNr">359 </span> <a href='102test.subx.html#L23'>check-ints-equal</a> result, <span class="Constant">0</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L322'>shift-left-bytes</a> 4"</span>
|
||||
<span id="L360" class="LineNr">360 </span><span class="Delimiter">}</span>
|
||||
<span id="L361" class="LineNr">361 </span>
|
||||
<span id="L362" class="LineNr">362 </span><span class="PreProc">fn</span> <span class="muTest"><a href='403unicode.mu.html#L362'>test-shift-left-bytes-5</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L363" class="LineNr">363 </span> <span class="PreProc">var</span> result/eax: int <span class="Special"><-</span> <a href='403unicode.mu.html#L322'>shift-left-bytes</a> <span class="Constant">1</span>, <span class="Constant">5</span>
|
||||
<span id="L364" class="LineNr">364 </span> <a href='102test.subx.html#L23'>check-ints-equal</a> result, <span class="Constant">0</span>, <span class="Constant">"F - <a href='403unicode.mu.html#L322'>shift-left-bytes</a> >4"</span>
|
||||
<span id="L365" class="LineNr">365 </span><span class="Delimiter">}</span>
|
||||
<span id="L366" class="LineNr">366 </span>
|
||||
<span id="L367" class="LineNr">367 </span><span class="muComment"># write a code-point-utf8 to a stream of bytes</span>
|
||||
<span id="L368" class="LineNr">368 </span><span class="muComment"># this is like write-to-stream, except we skip leading 0 bytes</span>
|
||||
<span id="L369" class="LineNr">369 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='403unicode.mu.html#L369'>write-code-point-utf8</a></span> out: (addr stream byte), g: code-point-utf8 <span class="Delimiter">{</span>
|
||||
<span id="L370" class="LineNr">370 </span>$write-code-point-utf8:body: <span class="Delimiter">{</span>
|
||||
<span id="L371" class="LineNr">371 </span> <span class="PreProc">var</span> c/eax: int <span class="Special"><-</span> copy g
|
||||
<span id="L372" class="LineNr">372 </span> <a href='115write-byte.subx.html#L208'>append-byte</a> out, c <span class="muComment"># first byte is always written</span>
|
||||
<span id="L373" class="LineNr">373 </span> c <span class="Special"><-</span> shift-right <span class="Constant">8</span>
|
||||
<span id="L374" class="LineNr">374 </span> compare c, <span class="Constant">0</span>
|
||||
<span id="L375" class="LineNr">375 </span> <span class="PreProc">break-if-=</span> $write-code-point-utf8:body
|
||||
<span id="L376" class="LineNr">376 </span> <a href='115write-byte.subx.html#L208'>append-byte</a> out, c
|
||||
<span id="L377" class="LineNr">377 </span> c <span class="Special"><-</span> shift-right <span class="Constant">8</span>
|
||||
<span id="L378" class="LineNr">378 </span> compare c, <span class="Constant">0</span>
|
||||
<span id="L379" class="LineNr">379 </span> <span class="PreProc">break-if-=</span> $write-code-point-utf8:body
|
||||
<span id="L380" class="LineNr">380 </span> <a href='115write-byte.subx.html#L208'>append-byte</a> out, c
|
||||
<span id="L381" class="LineNr">381 </span> c <span class="Special"><-</span> shift-right <span class="Constant">8</span>
|
||||
<span id="L382" class="LineNr">382 </span> compare c, <span class="Constant">0</span>
|
||||
<span id="L383" class="LineNr">383 </span> <span class="PreProc">break-if-=</span> $write-code-point-utf8:body
|
||||
<span id="L384" class="LineNr">384 </span> <a href='115write-byte.subx.html#L208'>append-byte</a> out, c
|
||||
<span id="L385" class="LineNr">385 </span><span class="Delimiter">}</span>
|
||||
<span id="L386" class="LineNr">386 </span><span class="Delimiter">}</span>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -15,15 +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: #870000; }
|
||||
.muRegEdx { color: #af5f00; }
|
||||
.LineNr { }
|
||||
.Constant { color: #008787; }
|
||||
.muRegEbx { color: #5f00ff; }
|
||||
.muTest { color: #5f8700; }
|
||||
.Constant { color: #008787; }
|
||||
.muRegEcx { color: #870000; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muComment { color: #005faf; }
|
||||
.Special { color: #ff6060; }
|
||||
.muTest { color: #5f8700; }
|
||||
.muComment { color: #005faf; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
|
|
@ -16,8 +16,7 @@ a { color:inherit; }
|
|||
* { font-size:12pt; font-size: 1em; }
|
||||
.LineNr { }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muRegEcx { color: #870000; }
|
||||
.muRegEdx { color: #af5f00; }
|
||||
.CommentedCode { color: #8a8a8a; }
|
||||
.muRegEbx { color: #5f00ff; }
|
||||
.muRegEsi { color: #005faf; }
|
||||
.muRegEdi { color: #00af00; }
|
||||
|
@ -27,7 +26,8 @@ a { color:inherit; }
|
|||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muTest { color: #5f8700; }
|
||||
.muComment { color: #005faf; }
|
||||
.CommentedCode { color: #8a8a8a; }
|
||||
.muRegEcx { color: #870000; }
|
||||
.muRegEdx { color: #af5f00; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
@ -83,7 +83,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L18" class="LineNr"> 18 </span><span class="Delimiter">}</span>
|
||||
<span id="L19" class="LineNr"> 19 </span>
|
||||
<span id="L20" class="LineNr"> 20 </span><span class="PreProc">type</span> <a href='405screen.mu.html#L20'>screen-cell</a> <span class="Delimiter">{</span>
|
||||
<span id="L21" class="LineNr"> 21 </span> data: grapheme
|
||||
<span id="L21" class="LineNr"> 21 </span> data: code-point-utf8
|
||||
<span id="L22" class="LineNr"> 22 </span> color: int
|
||||
<span id="L23" class="LineNr"> 23 </span> background-color: int
|
||||
<span id="L24" class="LineNr"> 24 </span> bold?: boolean
|
||||
|
@ -148,7 +148,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L83" class="LineNr"> 83 </span> <span class="PreProc">return</span>
|
||||
<span id="L84" class="LineNr"> 84 </span> <span class="Delimiter">}</span>
|
||||
<span id="L85" class="LineNr"> 85 </span> <span class="muComment"># fake screen</span>
|
||||
<span id="L86" class="LineNr"> 86 </span> <span class="PreProc">var</span> space/<span class="muRegEdi">edi</span>: grapheme <span class="Special"><-</span> copy <span class="Constant">0x20</span>
|
||||
<span id="L86" class="LineNr"> 86 </span> <span class="PreProc">var</span> space/<span class="muRegEdi">edi</span>: code-point-utf8 <span class="Special"><-</span> copy <span class="Constant">0x20</span>
|
||||
<span id="L87" class="LineNr"> 87 </span> <a href='405screen.mu.html#L109'>move-cursor</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">1</span>, <span class="Constant">1</span>
|
||||
<span id="L88" class="LineNr"> 88 </span> <span class="PreProc">var</span> screen-addr/<span class="muRegEsi">esi</span>: (addr <a href='405screen.mu.html#L9'>screen</a>) <span class="Special"><-</span> copy <a href='405screen.mu.html#L9'>screen</a>
|
||||
<span id="L89" class="LineNr"> 89 </span> <span class="PreProc">var</span> i/eax: int <span class="Special"><-</span> copy <span class="Constant">1</span>
|
||||
|
@ -161,7 +161,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L96" class="LineNr"> 96 </span> <span class="Delimiter">{</span>
|
||||
<span id="L97" class="LineNr"> 97 </span> compare j, *ncols
|
||||
<span id="L98" class="LineNr"> 98 </span> <span class="PreProc">break-if-></span>
|
||||
<span id="L99" class="LineNr"> 99 </span> <a href='405screen.mu.html#L214'>print-grapheme</a> <a href='405screen.mu.html#L9'>screen</a>, space
|
||||
<span id="L99" class="LineNr"> 99 </span> <a href='405screen.mu.html#L214'>print-code-point-utf8</a> <a href='405screen.mu.html#L9'>screen</a>, space
|
||||
<span id="L100" class="LineNr"> 100 </span> j <span class="Special"><-</span> increment
|
||||
<span id="L101" class="LineNr"> 101 </span> <span class="PreProc">loop</span>
|
||||
<span id="L102" class="LineNr"> 102 </span> <span class="Delimiter">}</span>
|
||||
|
@ -251,8 +251,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L186" class="LineNr"> 186 </span> <span class="PreProc">var</span> done?/eax: boolean <span class="Special"><-</span> <a href='309stream.subx.html#L6'>stream-empty?</a> s
|
||||
<span id="L187" class="LineNr"> 187 </span> compare done?, <span class="Constant">0</span>
|
||||
<span id="L188" class="LineNr"> 188 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L189" class="LineNr"> 189 </span> <span class="PreProc">var</span> g/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L158'>read-grapheme</a> s
|
||||
<span id="L190" class="LineNr"> 190 </span> <a href='405screen.mu.html#L214'>print-grapheme</a> <a href='405screen.mu.html#L9'>screen</a>, g
|
||||
<span id="L189" class="LineNr"> 189 </span> <span class="PreProc">var</span> g/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L155'>read-code-point-utf8</a> s
|
||||
<span id="L190" class="LineNr"> 190 </span> <a href='405screen.mu.html#L214'>print-code-point-utf8</a> <a href='405screen.mu.html#L9'>screen</a>, g
|
||||
<span id="L191" class="LineNr"> 191 </span> <span class="PreProc">loop</span>
|
||||
<span id="L192" class="LineNr"> 192 </span> <span class="Delimiter">}</span>
|
||||
<span id="L193" class="LineNr"> 193 </span><span class="Delimiter">}</span>
|
||||
|
@ -276,11 +276,11 @@ if ('onhashchange' in window) {
|
|||
<span id="L211" class="LineNr"> 211 </span> <span class="Delimiter">}</span>
|
||||
<span id="L212" class="LineNr"> 212 </span><span class="Delimiter">}</span>
|
||||
<span id="L213" class="LineNr"> 213 </span>
|
||||
<span id="L214" class="LineNr"> 214 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='405screen.mu.html#L214'>print-grapheme</a></span> <a href='405screen.mu.html#L9'>screen</a>: (addr <a href='405screen.mu.html#L9'>screen</a>), c: grapheme <span class="Delimiter">{</span>
|
||||
<span id="L214" class="LineNr"> 214 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='405screen.mu.html#L214'>print-code-point-utf8</a></span> <a href='405screen.mu.html#L9'>screen</a>: (addr <a href='405screen.mu.html#L9'>screen</a>), c: code-point-utf8 <span class="Delimiter">{</span>
|
||||
<span id="L215" class="LineNr"> 215 </span> compare <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">0</span>
|
||||
<span id="L216" class="LineNr"> 216 </span> <span class="Delimiter">{</span>
|
||||
<span id="L217" class="LineNr"> 217 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L218" class="LineNr"> 218 </span> <a href='304screen.subx.html#L161'>print-grapheme-to-real-screen</a> c
|
||||
<span id="L218" class="LineNr"> 218 </span> <a href='304screen.subx.html#L161'>print-code-point-utf8-to-real-screen</a> c
|
||||
<span id="L219" class="LineNr"> 219 </span> <span class="PreProc">return</span>
|
||||
<span id="L220" class="LineNr"> 220 </span> <span class="Delimiter">}</span>
|
||||
<span id="L221" class="LineNr"> 221 </span> <span class="muComment"># fake screen</span>
|
||||
|
@ -304,7 +304,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L239" class="LineNr"> 239 </span> <span class="PreProc">break-if-<=</span>
|
||||
<span id="L240" class="LineNr"> 240 </span> copy-to *cursor-row-addr, num-rows
|
||||
<span id="L241" class="LineNr"> 241 </span> <span class="muComment"># if (top-index > data size) top-index = 0, otherwise top-index += num-cols</span>
|
||||
<span id="L242" class="LineNr"> 242 </span> $print-grapheme:perform-scroll: <span class="Delimiter">{</span>
|
||||
<span id="L242" class="LineNr"> 242 </span> $print-code-point-utf8:perform-scroll: <span class="Delimiter">{</span>
|
||||
<span id="L243" class="LineNr"> 243 </span> <span class="PreProc">var</span> top-index-addr/<span class="muRegEbx">ebx</span>: (addr int) <span class="Special"><-</span> <a href='131table.subx.html#L26'>get</a> screen-addr, top-index
|
||||
<span id="L244" class="LineNr"> 244 </span> <span class="PreProc">var</span> data-ah/eax: (addr handle array <a href='405screen.mu.html#L20'>screen-cell</a>) <span class="Special"><-</span> <a href='131table.subx.html#L26'>get</a> screen-addr, data
|
||||
<span id="L245" class="LineNr"> 245 </span> <span class="PreProc">var</span> data/eax: (addr array <a href='405screen.mu.html#L20'>screen-cell</a>) <span class="Special"><-</span> <a href='120allocate.subx.html#L258'>lookup</a> *data-ah
|
||||
|
@ -313,7 +313,7 @@ if ('onhashchange' in window) {
|
|||
<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> add-to *top-index-addr, num-cols
|
||||
<span id="L251" class="LineNr"> 251 </span> <span class="PreProc">break</span> $print-grapheme:perform-scroll
|
||||
<span id="L251" class="LineNr"> 251 </span> <span class="PreProc">break</span> $print-code-point-utf8:perform-scroll
|
||||
<span id="L252" class="LineNr"> 252 </span> <span class="Delimiter">}</span>
|
||||
<span id="L253" class="LineNr"> 253 </span> <span class="Delimiter">{</span>
|
||||
<span id="L254" class="LineNr"> 254 </span> <span class="PreProc">break-if-<</span>
|
||||
|
@ -322,7 +322,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L257" class="LineNr"> 257 </span> <span class="Delimiter">}</span>
|
||||
<span id="L258" class="LineNr"> 258 </span> <span class="Delimiter">}</span>
|
||||
<span id="L259" class="LineNr"> 259 </span> <span class="PreProc">var</span> idx/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> <a href='405screen.mu.html#L277'>current-screen-cell-index</a> screen-addr
|
||||
<span id="L260" class="LineNr"> 260 </span><span class="CommentedCode">#? print-string-to-real-screen "printing grapheme at screen index "</span>
|
||||
<span id="L260" class="LineNr"> 260 </span><span class="CommentedCode">#? print-string-to-real-screen "printing code-point-utf8 at screen index "</span>
|
||||
<span id="L261" class="LineNr"> 261 </span><span class="CommentedCode">#? print-int32-hex-to-real-screen idx</span>
|
||||
<span id="L262" class="LineNr"> 262 </span><span class="CommentedCode">#? print-string-to-real-screen ": "</span>
|
||||
<span id="L263" class="LineNr"> 263 </span> <span class="PreProc">var</span> data-ah/eax: (addr handle array <a href='405screen.mu.html#L20'>screen-cell</a>) <span class="Special"><-</span> <a href='131table.subx.html#L26'>get</a> screen-addr, data
|
||||
|
@ -331,9 +331,9 @@ if ('onhashchange' in window) {
|
|||
<span id="L266" class="LineNr"> 266 </span> <span class="PreProc">var</span> dest-cell/<span class="muRegEcx">ecx</span>: (addr <a href='405screen.mu.html#L20'>screen-cell</a>) <span class="Special"><-</span> index data, offset
|
||||
<span id="L267" class="LineNr"> 267 </span> <span class="PreProc">var</span> src-cell/eax: (addr <a href='405screen.mu.html#L20'>screen-cell</a>) <span class="Special"><-</span> <a href='131table.subx.html#L26'>get</a> screen-addr, curr-attributes
|
||||
<span id="L268" class="LineNr"> 268 </span> copy-object src-cell, dest-cell
|
||||
<span id="L269" class="LineNr"> 269 </span> <span class="PreProc">var</span> dest/eax: (addr grapheme) <span class="Special"><-</span> <a href='131table.subx.html#L26'>get</a> dest-cell, data
|
||||
<span id="L270" class="LineNr"> 270 </span> <span class="PreProc">var</span> c2/<span class="muRegEcx">ecx</span>: grapheme <span class="Special"><-</span> copy c
|
||||
<span id="L271" class="LineNr"> 271 </span><span class="CommentedCode">#? print-grapheme-to-real-screen c2</span>
|
||||
<span id="L269" class="LineNr"> 269 </span> <span class="PreProc">var</span> dest/eax: (addr code-point-utf8) <span class="Special"><-</span> <a href='131table.subx.html#L26'>get</a> dest-cell, data
|
||||
<span id="L270" class="LineNr"> 270 </span> <span class="PreProc">var</span> c2/<span class="muRegEcx">ecx</span>: code-point-utf8 <span class="Special"><-</span> copy c
|
||||
<span id="L271" class="LineNr"> 271 </span><span class="CommentedCode">#? print-code-point-utf8-to-real-screen c2</span>
|
||||
<span id="L272" class="LineNr"> 272 </span><span class="CommentedCode">#? print-string-to-real-screen "\n"</span>
|
||||
<span id="L273" class="LineNr"> 273 </span> copy-to *dest, c2
|
||||
<span id="L274" class="LineNr"> 274 </span> increment *cursor-col-addr
|
||||
|
@ -370,21 +370,21 @@ if ('onhashchange' in window) {
|
|||
<span id="L305" class="LineNr"> 305 </span> <span class="PreProc">return</span> result
|
||||
<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="muFunction"><a href='405screen.mu.html#L308'>screen-grapheme-at</a></span> screen-on-stack: (addr <a href='405screen.mu.html#L9'>screen</a>), row: int, col: int<span class="PreProc"> -> </span>_/eax: grapheme <span class="Delimiter">{</span>
|
||||
<span id="L308" class="LineNr"> 308 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='405screen.mu.html#L308'>screen-code-point-utf8-at</a></span> screen-on-stack: (addr <a href='405screen.mu.html#L9'>screen</a>), row: int, col: int<span class="PreProc"> -> </span>_/eax: code-point-utf8 <span class="Delimiter">{</span>
|
||||
<span id="L309" class="LineNr"> 309 </span> <span class="PreProc">var</span> screen-addr/<span class="muRegEsi">esi</span>: (addr <a href='405screen.mu.html#L9'>screen</a>) <span class="Special"><-</span> copy screen-on-stack
|
||||
<span id="L310" class="LineNr"> 310 </span> <span class="PreProc">var</span> idx/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> <a href='405screen.mu.html#L285'>screen-cell-index</a> screen-addr, row, col
|
||||
<span id="L311" class="LineNr"> 311 </span> <span class="PreProc">var</span> result/eax: grapheme <span class="Special"><-</span> <a href='405screen.mu.html#L315'>screen-grapheme-at-idx</a> screen-addr, idx
|
||||
<span id="L311" class="LineNr"> 311 </span> <span class="PreProc">var</span> result/eax: code-point-utf8 <span class="Special"><-</span> <a href='405screen.mu.html#L315'>screen-code-point-utf8-at-idx</a> screen-addr, idx
|
||||
<span id="L312" class="LineNr"> 312 </span> <span class="PreProc">return</span> result
|
||||
<span id="L313" class="LineNr"> 313 </span><span class="Delimiter">}</span>
|
||||
<span id="L314" class="LineNr"> 314 </span>
|
||||
<span id="L315" class="LineNr"> 315 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='405screen.mu.html#L315'>screen-grapheme-at-idx</a></span> screen-on-stack: (addr <a href='405screen.mu.html#L9'>screen</a>), idx-on-stack: int<span class="PreProc"> -> </span>_/eax: grapheme <span class="Delimiter">{</span>
|
||||
<span id="L315" class="LineNr"> 315 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='405screen.mu.html#L315'>screen-code-point-utf8-at-idx</a></span> screen-on-stack: (addr <a href='405screen.mu.html#L9'>screen</a>), idx-on-stack: int<span class="PreProc"> -> </span>_/eax: code-point-utf8 <span class="Delimiter">{</span>
|
||||
<span id="L316" class="LineNr"> 316 </span> <span class="PreProc">var</span> screen-addr/<span class="muRegEsi">esi</span>: (addr <a href='405screen.mu.html#L9'>screen</a>) <span class="Special"><-</span> copy screen-on-stack
|
||||
<span id="L317" class="LineNr"> 317 </span> <span class="PreProc">var</span> data-ah/eax: (addr handle array <a href='405screen.mu.html#L20'>screen-cell</a>) <span class="Special"><-</span> <a href='131table.subx.html#L26'>get</a> screen-addr, data
|
||||
<span id="L318" class="LineNr"> 318 </span> <span class="PreProc">var</span> data/eax: (addr array <a href='405screen.mu.html#L20'>screen-cell</a>) <span class="Special"><-</span> <a href='120allocate.subx.html#L258'>lookup</a> *data-ah
|
||||
<span id="L319" class="LineNr"> 319 </span> <span class="PreProc">var</span> idx/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> copy idx-on-stack
|
||||
<span id="L320" class="LineNr"> 320 </span> <span class="PreProc">var</span> offset/<span class="muRegEcx">ecx</span>: (offset <a href='405screen.mu.html#L20'>screen-cell</a>) <span class="Special"><-</span> compute-offset data, idx
|
||||
<span id="L321" class="LineNr"> 321 </span> <span class="PreProc">var</span> cell/eax: (addr <a href='405screen.mu.html#L20'>screen-cell</a>) <span class="Special"><-</span> index data, offset
|
||||
<span id="L322" class="LineNr"> 322 </span> <span class="PreProc">var</span> src/eax: (addr grapheme) <span class="Special"><-</span> <a href='131table.subx.html#L26'>get</a> cell, data
|
||||
<span id="L322" class="LineNr"> 322 </span> <span class="PreProc">var</span> src/eax: (addr code-point-utf8) <span class="Special"><-</span> <a href='131table.subx.html#L26'>get</a> cell, data
|
||||
<span id="L323" class="LineNr"> 323 </span> <span class="PreProc">return</span> *src
|
||||
<span id="L324" class="LineNr"> 324 </span><span class="Delimiter">}</span>
|
||||
<span id="L325" class="LineNr"> 325 </span>
|
||||
|
@ -498,8 +498,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L433" class="LineNr"> 433 </span><span class="Delimiter">}</span>
|
||||
<span id="L434" class="LineNr"> 434 </span>
|
||||
<span id="L435" class="LineNr"> 435 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='405screen.mu.html#L435'>print-code-point</a></span> <a href='405screen.mu.html#L9'>screen</a>: (addr <a href='405screen.mu.html#L9'>screen</a>), c: code-point <span class="Delimiter">{</span>
|
||||
<span id="L436" class="LineNr"> 436 </span> <span class="PreProc">var</span> g/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L22'>to-grapheme</a> c
|
||||
<span id="L437" class="LineNr"> 437 </span> <a href='405screen.mu.html#L214'>print-grapheme</a> <a href='405screen.mu.html#L9'>screen</a>, g
|
||||
<span id="L436" class="LineNr"> 436 </span> <span class="PreProc">var</span> g/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L19'>to-utf8</a> c
|
||||
<span id="L437" class="LineNr"> 437 </span> <a href='405screen.mu.html#L214'>print-code-point-utf8</a> <a href='405screen.mu.html#L9'>screen</a>, g
|
||||
<span id="L438" class="LineNr"> 438 </span><span class="Delimiter">}</span>
|
||||
<span id="L439" class="LineNr"> 439 </span>
|
||||
<span id="L440" class="LineNr"> 440 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='405screen.mu.html#L440'>print-int32-hex</a></span> <a href='405screen.mu.html#L9'>screen</a>: (addr <a href='405screen.mu.html#L9'>screen</a>), n: int <span class="Delimiter">{</span>
|
||||
|
@ -518,8 +518,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L453" class="LineNr"> 453 </span> <span class="PreProc">var</span> done?/eax: boolean <span class="Special"><-</span> <a href='309stream.subx.html#L6'>stream-empty?</a> s2-addr
|
||||
<span id="L454" class="LineNr"> 454 </span> compare done?, <span class="Constant">0</span>
|
||||
<span id="L455" class="LineNr"> 455 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L456" class="LineNr"> 456 </span> <span class="PreProc">var</span> g/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L158'>read-grapheme</a> s2-addr
|
||||
<span id="L457" class="LineNr"> 457 </span> <a href='405screen.mu.html#L214'>print-grapheme</a> <a href='405screen.mu.html#L9'>screen</a>, g
|
||||
<span id="L456" class="LineNr"> 456 </span> <span class="PreProc">var</span> g/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L155'>read-code-point-utf8</a> s2-addr
|
||||
<span id="L457" class="LineNr"> 457 </span> <a href='405screen.mu.html#L214'>print-code-point-utf8</a> <a href='405screen.mu.html#L9'>screen</a>, g
|
||||
<span id="L458" class="LineNr"> 458 </span> <span class="PreProc">loop</span>
|
||||
<span id="L459" class="LineNr"> 459 </span> <span class="Delimiter">}</span>
|
||||
<span id="L460" class="LineNr"> 460 </span><span class="Delimiter">}</span>
|
||||
|
@ -540,8 +540,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L475" class="LineNr"> 475 </span> <span class="PreProc">var</span> done?/eax: boolean <span class="Special"><-</span> <a href='309stream.subx.html#L6'>stream-empty?</a> s2-addr
|
||||
<span id="L476" class="LineNr"> 476 </span> compare done?, <span class="Constant">0</span>
|
||||
<span id="L477" class="LineNr"> 477 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L478" class="LineNr"> 478 </span> <span class="PreProc">var</span> g/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L158'>read-grapheme</a> s2-addr
|
||||
<span id="L479" class="LineNr"> 479 </span> <a href='405screen.mu.html#L214'>print-grapheme</a> <a href='405screen.mu.html#L9'>screen</a>, g
|
||||
<span id="L478" class="LineNr"> 478 </span> <span class="PreProc">var</span> g/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L155'>read-code-point-utf8</a> s2-addr
|
||||
<span id="L479" class="LineNr"> 479 </span> <a href='405screen.mu.html#L214'>print-code-point-utf8</a> <a href='405screen.mu.html#L9'>screen</a>, g
|
||||
<span id="L480" class="LineNr"> 480 </span> <span class="PreProc">loop</span>
|
||||
<span id="L481" class="LineNr"> 481 </span> <span class="Delimiter">}</span>
|
||||
<span id="L482" class="LineNr"> 482 </span><span class="Delimiter">}</span>
|
||||
|
@ -562,8 +562,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L497" class="LineNr"> 497 </span> <span class="PreProc">var</span> done?/eax: boolean <span class="Special"><-</span> <a href='309stream.subx.html#L6'>stream-empty?</a> s2-addr
|
||||
<span id="L498" class="LineNr"> 498 </span> compare done?, <span class="Constant">0</span>
|
||||
<span id="L499" class="LineNr"> 499 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L500" class="LineNr"> 500 </span> <span class="PreProc">var</span> g/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L158'>read-grapheme</a> s2-addr
|
||||
<span id="L501" class="LineNr"> 501 </span> <a href='405screen.mu.html#L214'>print-grapheme</a> <a href='405screen.mu.html#L9'>screen</a>, g
|
||||
<span id="L500" class="LineNr"> 500 </span> <span class="PreProc">var</span> g/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L155'>read-code-point-utf8</a> s2-addr
|
||||
<span id="L501" class="LineNr"> 501 </span> <a href='405screen.mu.html#L214'>print-code-point-utf8</a> <a href='405screen.mu.html#L9'>screen</a>, g
|
||||
<span id="L502" class="LineNr"> 502 </span> <span class="PreProc">loop</span>
|
||||
<span id="L503" class="LineNr"> 503 </span> <span class="Delimiter">}</span>
|
||||
<span id="L504" class="LineNr"> 504 </span><span class="Delimiter">}</span>
|
||||
|
@ -696,7 +696,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L631" class="LineNr"> 631 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='405screen.mu.html#L631'>check-screen-row-from</a></span> screen-on-stack: (addr <a href='405screen.mu.html#L9'>screen</a>), row-idx: int, col-idx: int, expected: (addr array byte), msg: (addr array byte) <span class="Delimiter">{</span>
|
||||
<span id="L632" class="LineNr"> 632 </span> <span class="PreProc">var</span> <a href='405screen.mu.html#L9'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='405screen.mu.html#L9'>screen</a>) <span class="Special"><-</span> copy screen-on-stack
|
||||
<span id="L633" class="LineNr"> 633 </span> <span class="PreProc">var</span> idx/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> <a href='405screen.mu.html#L285'>screen-cell-index</a> <a href='405screen.mu.html#L9'>screen</a>, row-idx, col-idx
|
||||
<span id="L634" class="LineNr"> 634 </span> <span class="muComment"># compare 'expected' with the screen contents starting at 'idx', grapheme by grapheme</span>
|
||||
<span id="L634" class="LineNr"> 634 </span> <span class="muComment"># compare 'expected' with the screen contents starting at 'idx', code-point-utf8 by code-point-utf8</span>
|
||||
<span id="L635" class="LineNr"> 635 </span> <span class="PreProc">var</span> e: (stream byte <span class="Constant">0x100</span>)
|
||||
<span id="L636" class="LineNr"> 636 </span> <span class="PreProc">var</span> e-addr/<span class="muRegEdx">edx</span>: (addr stream byte) <span class="Special"><-</span> address e
|
||||
<span id="L637" class="LineNr"> 637 </span> <a href='108write.subx.html#L24'>write</a> e-addr, expected
|
||||
|
@ -704,35 +704,35 @@ if ('onhashchange' in window) {
|
|||
<span id="L639" class="LineNr"> 639 </span> <span class="PreProc">var</span> done?/eax: boolean <span class="Special"><-</span> <a href='309stream.subx.html#L6'>stream-empty?</a> e-addr
|
||||
<span id="L640" class="LineNr"> 640 </span> compare done?, <span class="Constant">0</span>
|
||||
<span id="L641" class="LineNr"> 641 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L642" class="LineNr"> 642 </span> <span class="PreProc">var</span> _g/eax: grapheme <span class="Special"><-</span> <a href='405screen.mu.html#L315'>screen-grapheme-at-idx</a> <a href='405screen.mu.html#L9'>screen</a>, idx
|
||||
<span id="L643" class="LineNr"> 643 </span> <span class="PreProc">var</span> g/<span class="muRegEbx">ebx</span>: grapheme <span class="Special"><-</span> copy _g
|
||||
<span id="L644" class="LineNr"> 644 </span> <span class="PreProc">var</span> expected-grapheme/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L158'>read-grapheme</a> e-addr
|
||||
<span id="L645" class="LineNr"> 645 </span> <span class="muComment"># compare graphemes</span>
|
||||
<span id="L646" class="LineNr"> 646 </span> $check-screen-row-from:compare-graphemes: <span class="Delimiter">{</span>
|
||||
<span id="L647" class="LineNr"> 647 </span> <span class="muComment"># if expected-grapheme is space, null grapheme is also ok</span>
|
||||
<span id="L642" class="LineNr"> 642 </span> <span class="PreProc">var</span> _g/eax: code-point-utf8 <span class="Special"><-</span> <a href='405screen.mu.html#L315'>screen-code-point-utf8-at-idx</a> <a href='405screen.mu.html#L9'>screen</a>, idx
|
||||
<span id="L643" class="LineNr"> 643 </span> <span class="PreProc">var</span> g/<span class="muRegEbx">ebx</span>: code-point-utf8 <span class="Special"><-</span> copy _g
|
||||
<span id="L644" class="LineNr"> 644 </span> <span class="PreProc">var</span> expected-code-point-utf8/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L155'>read-code-point-utf8</a> e-addr
|
||||
<span id="L645" class="LineNr"> 645 </span> <span class="muComment"># compare code-point-utf8s</span>
|
||||
<span id="L646" class="LineNr"> 646 </span> $check-screen-row-from:compare-code-point-utf8s: <span class="Delimiter">{</span>
|
||||
<span id="L647" class="LineNr"> 647 </span> <span class="muComment"># if expected-code-point-utf8 is space, null code-point-utf8 is also ok</span>
|
||||
<span id="L648" class="LineNr"> 648 </span> <span class="Delimiter">{</span>
|
||||
<span id="L649" class="LineNr"> 649 </span> compare expected-grapheme, <span class="Constant">0x20</span>
|
||||
<span id="L649" class="LineNr"> 649 </span> compare expected-code-point-utf8, <span class="Constant">0x20</span>
|
||||
<span id="L650" class="LineNr"> 650 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L651" class="LineNr"> 651 </span> compare g, <span class="Constant">0</span>
|
||||
<span id="L652" class="LineNr"> 652 </span> <span class="PreProc">break-if-=</span> $check-screen-row-from:compare-graphemes
|
||||
<span id="L652" class="LineNr"> 652 </span> <span class="PreProc">break-if-=</span> $check-screen-row-from:compare-code-point-utf8s
|
||||
<span id="L653" class="LineNr"> 653 </span> <span class="Delimiter">}</span>
|
||||
<span id="L654" class="LineNr"> 654 </span> <span class="muComment"># if (g == expected-grapheme) print "."</span>
|
||||
<span id="L655" class="LineNr"> 655 </span> compare g, expected-grapheme
|
||||
<span id="L654" class="LineNr"> 654 </span> <span class="muComment"># if (g == expected-code-point-utf8) print "."</span>
|
||||
<span id="L655" class="LineNr"> 655 </span> compare g, expected-code-point-utf8
|
||||
<span id="L656" class="LineNr"> 656 </span> <span class="Delimiter">{</span>
|
||||
<span id="L657" class="LineNr"> 657 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L658" class="LineNr"> 658 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">"."</span>
|
||||
<span id="L659" class="LineNr"> 659 </span> <span class="PreProc">break</span> $check-screen-row-from:compare-graphemes
|
||||
<span id="L659" class="LineNr"> 659 </span> <span class="PreProc">break</span> $check-screen-row-from:compare-code-point-utf8s
|
||||
<span id="L660" class="LineNr"> 660 </span> <span class="Delimiter">}</span>
|
||||
<span id="L661" class="LineNr"> 661 </span> <span class="muComment"># otherwise print an error</span>
|
||||
<span id="L662" class="LineNr"> 662 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> msg
|
||||
<span id="L663" class="LineNr"> 663 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">": expected '"</span>
|
||||
<span id="L664" class="LineNr"> 664 </span> <a href='304screen.subx.html#L161'>print-grapheme-to-real-screen</a> expected-grapheme
|
||||
<span id="L664" class="LineNr"> 664 </span> <a href='304screen.subx.html#L161'>print-code-point-utf8-to-real-screen</a> expected-code-point-utf8
|
||||
<span id="L665" class="LineNr"> 665 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">"' at ("</span>
|
||||
<span id="L666" class="LineNr"> 666 </span> <a href='304screen.subx.html#L226'>print-int32-hex-to-real-screen</a> row-idx
|
||||
<span id="L667" class="LineNr"> 667 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">", "</span>
|
||||
<span id="L668" class="LineNr"> 668 </span> <a href='304screen.subx.html#L226'>print-int32-hex-to-real-screen</a> col-idx
|
||||
<span id="L669" class="LineNr"> 669 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">") but observed '"</span>
|
||||
<span id="L670" class="LineNr"> 670 </span> <a href='304screen.subx.html#L161'>print-grapheme-to-real-screen</a> g
|
||||
<span id="L670" class="LineNr"> 670 </span> <a href='304screen.subx.html#L161'>print-code-point-utf8-to-real-screen</a> g
|
||||
<span id="L671" class="LineNr"> 671 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">"'\n"</span>
|
||||
<span id="L672" class="LineNr"> 672 </span> <span class="Delimiter">}</span>
|
||||
<span id="L673" class="LineNr"> 673 </span> idx <span class="Special"><-</span> increment
|
||||
|
@ -750,7 +750,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L685" class="LineNr"> 685 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='405screen.mu.html#L685'>check-screen-row-in-color-from</a></span> screen-on-stack: (addr <a href='405screen.mu.html#L9'>screen</a>), fg: int, row-idx: int, col-idx: int, expected: (addr array byte), msg: (addr array byte) <span class="Delimiter">{</span>
|
||||
<span id="L686" class="LineNr"> 686 </span> <span class="PreProc">var</span> <a href='405screen.mu.html#L9'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='405screen.mu.html#L9'>screen</a>) <span class="Special"><-</span> copy screen-on-stack
|
||||
<span id="L687" class="LineNr"> 687 </span> <span class="PreProc">var</span> idx/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> <a href='405screen.mu.html#L285'>screen-cell-index</a> <a href='405screen.mu.html#L9'>screen</a>, row-idx, col-idx
|
||||
<span id="L688" class="LineNr"> 688 </span> <span class="muComment"># compare 'expected' with the screen contents starting at 'idx', grapheme by grapheme</span>
|
||||
<span id="L688" class="LineNr"> 688 </span> <span class="muComment"># compare 'expected' with the screen contents starting at 'idx', code-point-utf8 by code-point-utf8</span>
|
||||
<span id="L689" class="LineNr"> 689 </span> <span class="PreProc">var</span> e: (stream byte <span class="Constant">0x100</span>)
|
||||
<span id="L690" class="LineNr"> 690 </span> <span class="PreProc">var</span> e-addr/<span class="muRegEdx">edx</span>: (addr stream byte) <span class="Special"><-</span> address e
|
||||
<span id="L691" class="LineNr"> 691 </span> <a href='108write.subx.html#L24'>write</a> e-addr, expected
|
||||
|
@ -758,45 +758,45 @@ if ('onhashchange' in window) {
|
|||
<span id="L693" class="LineNr"> 693 </span> <span class="PreProc">var</span> done?/eax: boolean <span class="Special"><-</span> <a href='309stream.subx.html#L6'>stream-empty?</a> e-addr
|
||||
<span id="L694" class="LineNr"> 694 </span> compare done?, <span class="Constant">0</span>
|
||||
<span id="L695" class="LineNr"> 695 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L696" class="LineNr"> 696 </span> <span class="PreProc">var</span> _g/eax: grapheme <span class="Special"><-</span> <a href='405screen.mu.html#L315'>screen-grapheme-at-idx</a> <a href='405screen.mu.html#L9'>screen</a>, idx
|
||||
<span id="L697" class="LineNr"> 697 </span> <span class="PreProc">var</span> g/<span class="muRegEbx">ebx</span>: grapheme <span class="Special"><-</span> copy _g
|
||||
<span id="L698" class="LineNr"> 698 </span> <span class="PreProc">var</span> _expected-grapheme/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L158'>read-grapheme</a> e-addr
|
||||
<span id="L699" class="LineNr"> 699 </span> <span class="PreProc">var</span> expected-grapheme/<span class="muRegEdi">edi</span>: grapheme <span class="Special"><-</span> copy _expected-grapheme
|
||||
<span id="L696" class="LineNr"> 696 </span> <span class="PreProc">var</span> _g/eax: code-point-utf8 <span class="Special"><-</span> <a href='405screen.mu.html#L315'>screen-code-point-utf8-at-idx</a> <a href='405screen.mu.html#L9'>screen</a>, idx
|
||||
<span id="L697" class="LineNr"> 697 </span> <span class="PreProc">var</span> g/<span class="muRegEbx">ebx</span>: code-point-utf8 <span class="Special"><-</span> copy _g
|
||||
<span id="L698" class="LineNr"> 698 </span> <span class="PreProc">var</span> _expected-code-point-utf8/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L155'>read-code-point-utf8</a> e-addr
|
||||
<span id="L699" class="LineNr"> 699 </span> <span class="PreProc">var</span> expected-code-point-utf8/<span class="muRegEdi">edi</span>: code-point-utf8 <span class="Special"><-</span> copy _expected-code-point-utf8
|
||||
<span id="L700" class="LineNr"> 700 </span> $check-screen-row-in-color-from:compare-cells: <span class="Delimiter">{</span>
|
||||
<span id="L701" class="LineNr"> 701 </span> <span class="muComment"># if expected-grapheme is space, null grapheme is also ok</span>
|
||||
<span id="L701" class="LineNr"> 701 </span> <span class="muComment"># if expected-code-point-utf8 is space, null code-point-utf8 is also ok</span>
|
||||
<span id="L702" class="LineNr"> 702 </span> <span class="Delimiter">{</span>
|
||||
<span id="L703" class="LineNr"> 703 </span> compare expected-grapheme, <span class="Constant">0x20</span>
|
||||
<span id="L703" class="LineNr"> 703 </span> compare expected-code-point-utf8, <span class="Constant">0x20</span>
|
||||
<span id="L704" class="LineNr"> 704 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L705" class="LineNr"> 705 </span> compare g, <span class="Constant">0</span>
|
||||
<span id="L706" class="LineNr"> 706 </span> <span class="PreProc">break-if-=</span> $check-screen-row-in-color-from:compare-cells
|
||||
<span id="L707" class="LineNr"> 707 </span> <span class="Delimiter">}</span>
|
||||
<span id="L708" class="LineNr"> 708 </span> <span class="muComment"># if expected-grapheme is space, a different color is ok</span>
|
||||
<span id="L708" class="LineNr"> 708 </span> <span class="muComment"># if expected-code-point-utf8 is space, a different color is ok</span>
|
||||
<span id="L709" class="LineNr"> 709 </span> <span class="Delimiter">{</span>
|
||||
<span id="L710" class="LineNr"> 710 </span> compare expected-grapheme, <span class="Constant">0x20</span>
|
||||
<span id="L710" class="LineNr"> 710 </span> compare expected-code-point-utf8, <span class="Constant">0x20</span>
|
||||
<span id="L711" class="LineNr"> 711 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L712" class="LineNr"> 712 </span> <span class="PreProc">var</span> color/eax: int <span class="Special"><-</span> <a href='405screen.mu.html#L333'>screen-color-at-idx</a> <a href='405screen.mu.html#L9'>screen</a>, idx
|
||||
<span id="L713" class="LineNr"> 713 </span> compare color, fg
|
||||
<span id="L714" class="LineNr"> 714 </span> <span class="PreProc">break-if-!=</span> $check-screen-row-in-color-from:compare-cells
|
||||
<span id="L715" class="LineNr"> 715 </span> <span class="Delimiter">}</span>
|
||||
<span id="L716" class="LineNr"> 716 </span> <span class="muComment"># compare graphemes</span>
|
||||
<span id="L717" class="LineNr"> 717 </span> $check-screen-row-in-color-from:compare-graphemes: <span class="Delimiter">{</span>
|
||||
<span id="L718" class="LineNr"> 718 </span> <span class="muComment"># if (g == expected-grapheme) print "."</span>
|
||||
<span id="L719" class="LineNr"> 719 </span> compare g, expected-grapheme
|
||||
<span id="L716" class="LineNr"> 716 </span> <span class="muComment"># compare code-point-utf8s</span>
|
||||
<span id="L717" class="LineNr"> 717 </span> $check-screen-row-in-color-from:compare-code-point-utf8s: <span class="Delimiter">{</span>
|
||||
<span id="L718" class="LineNr"> 718 </span> <span class="muComment"># if (g == expected-code-point-utf8) print "."</span>
|
||||
<span id="L719" class="LineNr"> 719 </span> compare g, expected-code-point-utf8
|
||||
<span id="L720" class="LineNr"> 720 </span> <span class="Delimiter">{</span>
|
||||
<span id="L721" class="LineNr"> 721 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L722" class="LineNr"> 722 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">"."</span>
|
||||
<span id="L723" class="LineNr"> 723 </span> <span class="PreProc">break</span> $check-screen-row-in-color-from:compare-graphemes
|
||||
<span id="L723" class="LineNr"> 723 </span> <span class="PreProc">break</span> $check-screen-row-in-color-from:compare-code-point-utf8s
|
||||
<span id="L724" class="LineNr"> 724 </span> <span class="Delimiter">}</span>
|
||||
<span id="L725" class="LineNr"> 725 </span> <span class="muComment"># otherwise print an error</span>
|
||||
<span id="L726" class="LineNr"> 726 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> msg
|
||||
<span id="L727" class="LineNr"> 727 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">": expected '"</span>
|
||||
<span id="L728" class="LineNr"> 728 </span> <a href='304screen.subx.html#L161'>print-grapheme-to-real-screen</a> expected-grapheme
|
||||
<span id="L728" class="LineNr"> 728 </span> <a href='304screen.subx.html#L161'>print-code-point-utf8-to-real-screen</a> expected-code-point-utf8
|
||||
<span id="L729" class="LineNr"> 729 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">"' at ("</span>
|
||||
<span id="L730" class="LineNr"> 730 </span> <a href='304screen.subx.html#L226'>print-int32-hex-to-real-screen</a> row-idx
|
||||
<span id="L731" class="LineNr"> 731 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">", "</span>
|
||||
<span id="L732" class="LineNr"> 732 </span> <a href='304screen.subx.html#L226'>print-int32-hex-to-real-screen</a> col-idx
|
||||
<span id="L733" class="LineNr"> 733 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">") but observed '"</span>
|
||||
<span id="L734" class="LineNr"> 734 </span> <a href='304screen.subx.html#L161'>print-grapheme-to-real-screen</a> g
|
||||
<span id="L734" class="LineNr"> 734 </span> <a href='304screen.subx.html#L161'>print-code-point-utf8-to-real-screen</a> g
|
||||
<span id="L735" class="LineNr"> 735 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">"'\n"</span>
|
||||
<span id="L736" class="LineNr"> 736 </span> <span class="Delimiter">}</span>
|
||||
<span id="L737" class="LineNr"> 737 </span> $check-screen-row-in-color-from:compare-colors: <span class="Delimiter">{</span>
|
||||
|
@ -810,7 +810,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L745" class="LineNr"> 745 </span> <span class="muComment"># otherwise print an error</span>
|
||||
<span id="L746" class="LineNr"> 746 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> msg
|
||||
<span id="L747" class="LineNr"> 747 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">": expected '"</span>
|
||||
<span id="L748" class="LineNr"> 748 </span> <a href='304screen.subx.html#L161'>print-grapheme-to-real-screen</a> expected-grapheme
|
||||
<span id="L748" class="LineNr"> 748 </span> <a href='304screen.subx.html#L161'>print-code-point-utf8-to-real-screen</a> expected-code-point-utf8
|
||||
<span id="L749" class="LineNr"> 749 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">"' at ("</span>
|
||||
<span id="L750" class="LineNr"> 750 </span> <a href='304screen.subx.html#L226'>print-int32-hex-to-real-screen</a> row-idx
|
||||
<span id="L751" class="LineNr"> 751 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">", "</span>
|
||||
|
@ -837,7 +837,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L772" class="LineNr"> 772 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='405screen.mu.html#L772'>check-screen-row-in-background-color-from</a></span> screen-on-stack: (addr <a href='405screen.mu.html#L9'>screen</a>), bg: int, row-idx: int, col-idx: int, expected: (addr array byte), msg: (addr array byte) <span class="Delimiter">{</span>
|
||||
<span id="L773" class="LineNr"> 773 </span> <span class="PreProc">var</span> <a href='405screen.mu.html#L9'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='405screen.mu.html#L9'>screen</a>) <span class="Special"><-</span> copy screen-on-stack
|
||||
<span id="L774" class="LineNr"> 774 </span> <span class="PreProc">var</span> idx/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> <a href='405screen.mu.html#L285'>screen-cell-index</a> <a href='405screen.mu.html#L9'>screen</a>, row-idx, col-idx
|
||||
<span id="L775" class="LineNr"> 775 </span> <span class="muComment"># compare 'expected' with the screen contents starting at 'idx', grapheme by grapheme</span>
|
||||
<span id="L775" class="LineNr"> 775 </span> <span class="muComment"># compare 'expected' with the screen contents starting at 'idx', code-point-utf8 by code-point-utf8</span>
|
||||
<span id="L776" class="LineNr"> 776 </span> <span class="PreProc">var</span> e: (stream byte <span class="Constant">0x100</span>)
|
||||
<span id="L777" class="LineNr"> 777 </span> <span class="PreProc">var</span> e-addr/<span class="muRegEdx">edx</span>: (addr stream byte) <span class="Special"><-</span> address e
|
||||
<span id="L778" class="LineNr"> 778 </span> <a href='108write.subx.html#L24'>write</a> e-addr, expected
|
||||
|
@ -845,45 +845,45 @@ if ('onhashchange' in window) {
|
|||
<span id="L780" class="LineNr"> 780 </span> <span class="PreProc">var</span> done?/eax: boolean <span class="Special"><-</span> <a href='309stream.subx.html#L6'>stream-empty?</a> e-addr
|
||||
<span id="L781" class="LineNr"> 781 </span> compare done?, <span class="Constant">0</span>
|
||||
<span id="L782" class="LineNr"> 782 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L783" class="LineNr"> 783 </span> <span class="PreProc">var</span> _g/eax: grapheme <span class="Special"><-</span> <a href='405screen.mu.html#L315'>screen-grapheme-at-idx</a> <a href='405screen.mu.html#L9'>screen</a>, idx
|
||||
<span id="L784" class="LineNr"> 784 </span> <span class="PreProc">var</span> g/<span class="muRegEbx">ebx</span>: grapheme <span class="Special"><-</span> copy _g
|
||||
<span id="L785" class="LineNr"> 785 </span> <span class="PreProc">var</span> _expected-grapheme/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L158'>read-grapheme</a> e-addr
|
||||
<span id="L786" class="LineNr"> 786 </span> <span class="PreProc">var</span> expected-grapheme/<span class="muRegEdx">edx</span>: grapheme <span class="Special"><-</span> copy _expected-grapheme
|
||||
<span id="L783" class="LineNr"> 783 </span> <span class="PreProc">var</span> _g/eax: code-point-utf8 <span class="Special"><-</span> <a href='405screen.mu.html#L315'>screen-code-point-utf8-at-idx</a> <a href='405screen.mu.html#L9'>screen</a>, idx
|
||||
<span id="L784" class="LineNr"> 784 </span> <span class="PreProc">var</span> g/<span class="muRegEbx">ebx</span>: code-point-utf8 <span class="Special"><-</span> copy _g
|
||||
<span id="L785" class="LineNr"> 785 </span> <span class="PreProc">var</span> _expected-code-point-utf8/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L155'>read-code-point-utf8</a> e-addr
|
||||
<span id="L786" class="LineNr"> 786 </span> <span class="PreProc">var</span> expected-code-point-utf8/<span class="muRegEdx">edx</span>: code-point-utf8 <span class="Special"><-</span> copy _expected-code-point-utf8
|
||||
<span id="L787" class="LineNr"> 787 </span> $check-screen-row-in-background-color-from:compare-cells: <span class="Delimiter">{</span>
|
||||
<span id="L788" class="LineNr"> 788 </span> <span class="muComment"># if expected-grapheme is space, null grapheme is also ok</span>
|
||||
<span id="L788" class="LineNr"> 788 </span> <span class="muComment"># if expected-code-point-utf8 is space, null code-point-utf8 is also ok</span>
|
||||
<span id="L789" class="LineNr"> 789 </span> <span class="Delimiter">{</span>
|
||||
<span id="L790" class="LineNr"> 790 </span> compare expected-grapheme, <span class="Constant">0x20</span>
|
||||
<span id="L790" class="LineNr"> 790 </span> compare expected-code-point-utf8, <span class="Constant">0x20</span>
|
||||
<span id="L791" class="LineNr"> 791 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L792" class="LineNr"> 792 </span> compare g, <span class="Constant">0</span>
|
||||
<span id="L793" class="LineNr"> 793 </span> <span class="PreProc">break-if-=</span> $check-screen-row-in-background-color-from:compare-cells
|
||||
<span id="L794" class="LineNr"> 794 </span> <span class="Delimiter">}</span>
|
||||
<span id="L795" class="LineNr"> 795 </span> <span class="muComment"># if expected-grapheme is space, a different color is ok</span>
|
||||
<span id="L795" class="LineNr"> 795 </span> <span class="muComment"># if expected-code-point-utf8 is space, a different color is ok</span>
|
||||
<span id="L796" class="LineNr"> 796 </span> <span class="Delimiter">{</span>
|
||||
<span id="L797" class="LineNr"> 797 </span> compare expected-grapheme, <span class="Constant">0x20</span>
|
||||
<span id="L797" class="LineNr"> 797 </span> compare expected-code-point-utf8, <span class="Constant">0x20</span>
|
||||
<span id="L798" class="LineNr"> 798 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L799" class="LineNr"> 799 </span> <span class="PreProc">var</span> color/eax: int <span class="Special"><-</span> <a href='405screen.mu.html#L352'>screen-background-color-at-idx</a> <a href='405screen.mu.html#L9'>screen</a>, idx
|
||||
<span id="L800" class="LineNr"> 800 </span> compare color, bg
|
||||
<span id="L801" class="LineNr"> 801 </span> <span class="PreProc">break-if-!=</span> $check-screen-row-in-background-color-from:compare-cells
|
||||
<span id="L802" class="LineNr"> 802 </span> <span class="Delimiter">}</span>
|
||||
<span id="L803" class="LineNr"> 803 </span> <span class="muComment"># compare graphemes</span>
|
||||
<span id="L804" class="LineNr"> 804 </span> $check-screen-row-in-background-color-from:compare-graphemes: <span class="Delimiter">{</span>
|
||||
<span id="L805" class="LineNr"> 805 </span> <span class="muComment"># if (g == expected-grapheme) print "."</span>
|
||||
<span id="L806" class="LineNr"> 806 </span> compare g, expected-grapheme
|
||||
<span id="L803" class="LineNr"> 803 </span> <span class="muComment"># compare code-point-utf8s</span>
|
||||
<span id="L804" class="LineNr"> 804 </span> $check-screen-row-in-background-color-from:compare-code-point-utf8s: <span class="Delimiter">{</span>
|
||||
<span id="L805" class="LineNr"> 805 </span> <span class="muComment"># if (g == expected-code-point-utf8) print "."</span>
|
||||
<span id="L806" class="LineNr"> 806 </span> compare g, expected-code-point-utf8
|
||||
<span id="L807" class="LineNr"> 807 </span> <span class="Delimiter">{</span>
|
||||
<span id="L808" class="LineNr"> 808 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L809" class="LineNr"> 809 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">"."</span>
|
||||
<span id="L810" class="LineNr"> 810 </span> <span class="PreProc">break</span> $check-screen-row-in-background-color-from:compare-graphemes
|
||||
<span id="L810" class="LineNr"> 810 </span> <span class="PreProc">break</span> $check-screen-row-in-background-color-from:compare-code-point-utf8s
|
||||
<span id="L811" class="LineNr"> 811 </span> <span class="Delimiter">}</span>
|
||||
<span id="L812" class="LineNr"> 812 </span> <span class="muComment"># otherwise print an error</span>
|
||||
<span id="L813" class="LineNr"> 813 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> msg
|
||||
<span id="L814" class="LineNr"> 814 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">": expected '"</span>
|
||||
<span id="L815" class="LineNr"> 815 </span> <a href='304screen.subx.html#L161'>print-grapheme-to-real-screen</a> expected-grapheme
|
||||
<span id="L815" class="LineNr"> 815 </span> <a href='304screen.subx.html#L161'>print-code-point-utf8-to-real-screen</a> expected-code-point-utf8
|
||||
<span id="L816" class="LineNr"> 816 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">"' at ("</span>
|
||||
<span id="L817" class="LineNr"> 817 </span> <a href='304screen.subx.html#L226'>print-int32-hex-to-real-screen</a> row-idx
|
||||
<span id="L818" class="LineNr"> 818 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">", "</span>
|
||||
<span id="L819" class="LineNr"> 819 </span> <a href='304screen.subx.html#L226'>print-int32-hex-to-real-screen</a> col-idx
|
||||
<span id="L820" class="LineNr"> 820 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">") but observed '"</span>
|
||||
<span id="L821" class="LineNr"> 821 </span> <a href='304screen.subx.html#L161'>print-grapheme-to-real-screen</a> g
|
||||
<span id="L821" class="LineNr"> 821 </span> <a href='304screen.subx.html#L161'>print-code-point-utf8-to-real-screen</a> g
|
||||
<span id="L822" class="LineNr"> 822 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">"'\n"</span>
|
||||
<span id="L823" class="LineNr"> 823 </span> <span class="Delimiter">}</span>
|
||||
<span id="L824" class="LineNr"> 824 </span> $check-screen-row-in-background-color-from:compare-colors: <span class="Delimiter">{</span>
|
||||
|
@ -897,7 +897,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L832" class="LineNr"> 832 </span> <span class="muComment"># otherwise print an error</span>
|
||||
<span id="L833" class="LineNr"> 833 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> msg
|
||||
<span id="L834" class="LineNr"> 834 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">": expected '"</span>
|
||||
<span id="L835" class="LineNr"> 835 </span> <a href='304screen.subx.html#L161'>print-grapheme-to-real-screen</a> expected-grapheme
|
||||
<span id="L835" class="LineNr"> 835 </span> <a href='304screen.subx.html#L161'>print-code-point-utf8-to-real-screen</a> expected-code-point-utf8
|
||||
<span id="L836" class="LineNr"> 836 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">"' at ("</span>
|
||||
<span id="L837" class="LineNr"> 837 </span> <a href='304screen.subx.html#L226'>print-int32-hex-to-real-screen</a> row-idx
|
||||
<span id="L838" class="LineNr"> 838 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">", "</span>
|
||||
|
@ -922,7 +922,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L857" class="LineNr"> 857 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='405screen.mu.html#L857'>check-screen-row-in-bold-from</a></span> screen-on-stack: (addr <a href='405screen.mu.html#L9'>screen</a>), row-idx: int, col-idx: int, expected: (addr array byte), msg: (addr array byte) <span class="Delimiter">{</span>
|
||||
<span id="L858" class="LineNr"> 858 </span> <span class="PreProc">var</span> <a href='405screen.mu.html#L9'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='405screen.mu.html#L9'>screen</a>) <span class="Special"><-</span> copy screen-on-stack
|
||||
<span id="L859" class="LineNr"> 859 </span> <span class="PreProc">var</span> idx/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> <a href='405screen.mu.html#L285'>screen-cell-index</a> <a href='405screen.mu.html#L9'>screen</a>, row-idx, col-idx
|
||||
<span id="L860" class="LineNr"> 860 </span> <span class="muComment"># compare 'expected' with the screen contents starting at 'idx', grapheme by grapheme</span>
|
||||
<span id="L860" class="LineNr"> 860 </span> <span class="muComment"># compare 'expected' with the screen contents starting at 'idx', code-point-utf8 by code-point-utf8</span>
|
||||
<span id="L861" class="LineNr"> 861 </span> <span class="PreProc">var</span> e: (stream byte <span class="Constant">0x100</span>)
|
||||
<span id="L862" class="LineNr"> 862 </span> <span class="PreProc">var</span> e-addr/<span class="muRegEdx">edx</span>: (addr stream byte) <span class="Special"><-</span> address e
|
||||
<span id="L863" class="LineNr"> 863 </span> <a href='108write.subx.html#L24'>write</a> e-addr, expected
|
||||
|
@ -930,45 +930,45 @@ if ('onhashchange' in window) {
|
|||
<span id="L865" class="LineNr"> 865 </span> <span class="PreProc">var</span> done?/eax: boolean <span class="Special"><-</span> <a href='309stream.subx.html#L6'>stream-empty?</a> e-addr
|
||||
<span id="L866" class="LineNr"> 866 </span> compare done?, <span class="Constant">0</span>
|
||||
<span id="L867" class="LineNr"> 867 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L868" class="LineNr"> 868 </span> <span class="PreProc">var</span> _g/eax: grapheme <span class="Special"><-</span> <a href='405screen.mu.html#L315'>screen-grapheme-at-idx</a> <a href='405screen.mu.html#L9'>screen</a>, idx
|
||||
<span id="L869" class="LineNr"> 869 </span> <span class="PreProc">var</span> g/<span class="muRegEbx">ebx</span>: grapheme <span class="Special"><-</span> copy _g
|
||||
<span id="L870" class="LineNr"> 870 </span> <span class="PreProc">var</span> _expected-grapheme/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L158'>read-grapheme</a> e-addr
|
||||
<span id="L871" class="LineNr"> 871 </span> <span class="PreProc">var</span> expected-grapheme/<span class="muRegEdx">edx</span>: grapheme <span class="Special"><-</span> copy _expected-grapheme
|
||||
<span id="L868" class="LineNr"> 868 </span> <span class="PreProc">var</span> _g/eax: code-point-utf8 <span class="Special"><-</span> <a href='405screen.mu.html#L315'>screen-code-point-utf8-at-idx</a> <a href='405screen.mu.html#L9'>screen</a>, idx
|
||||
<span id="L869" class="LineNr"> 869 </span> <span class="PreProc">var</span> g/<span class="muRegEbx">ebx</span>: code-point-utf8 <span class="Special"><-</span> copy _g
|
||||
<span id="L870" class="LineNr"> 870 </span> <span class="PreProc">var</span> _expected-code-point-utf8/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L155'>read-code-point-utf8</a> e-addr
|
||||
<span id="L871" class="LineNr"> 871 </span> <span class="PreProc">var</span> expected-code-point-utf8/<span class="muRegEdx">edx</span>: code-point-utf8 <span class="Special"><-</span> copy _expected-code-point-utf8
|
||||
<span id="L872" class="LineNr"> 872 </span> $check-screen-row-in-bold-from:compare-cells: <span class="Delimiter">{</span>
|
||||
<span id="L873" class="LineNr"> 873 </span> <span class="muComment"># if expected-grapheme is space, null grapheme is also ok</span>
|
||||
<span id="L873" class="LineNr"> 873 </span> <span class="muComment"># if expected-code-point-utf8 is space, null code-point-utf8 is also ok</span>
|
||||
<span id="L874" class="LineNr"> 874 </span> <span class="Delimiter">{</span>
|
||||
<span id="L875" class="LineNr"> 875 </span> compare expected-grapheme, <span class="Constant">0x20</span>
|
||||
<span id="L875" class="LineNr"> 875 </span> compare expected-code-point-utf8, <span class="Constant">0x20</span>
|
||||
<span id="L876" class="LineNr"> 876 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L877" class="LineNr"> 877 </span> compare g, <span class="Constant">0</span>
|
||||
<span id="L878" class="LineNr"> 878 </span> <span class="PreProc">break-if-=</span> $check-screen-row-in-bold-from:compare-cells
|
||||
<span id="L879" class="LineNr"> 879 </span> <span class="Delimiter">}</span>
|
||||
<span id="L880" class="LineNr"> 880 </span> <span class="muComment"># if expected-grapheme is space, non-bold is ok</span>
|
||||
<span id="L880" class="LineNr"> 880 </span> <span class="muComment"># if expected-code-point-utf8 is space, non-bold is ok</span>
|
||||
<span id="L881" class="LineNr"> 881 </span> <span class="Delimiter">{</span>
|
||||
<span id="L882" class="LineNr"> 882 </span> compare expected-grapheme, <span class="Constant">0x20</span>
|
||||
<span id="L882" class="LineNr"> 882 </span> compare expected-code-point-utf8, <span class="Constant">0x20</span>
|
||||
<span id="L883" class="LineNr"> 883 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L884" class="LineNr"> 884 </span> <span class="PreProc">var</span> bold?/eax: boolean <span class="Special"><-</span> <a href='405screen.mu.html#L370'>screen-bold-at-idx?</a> <a href='405screen.mu.html#L9'>screen</a>, idx
|
||||
<span id="L885" class="LineNr"> 885 </span> compare bold?, <span class="Constant">1</span>
|
||||
<span id="L886" class="LineNr"> 886 </span> <span class="PreProc">break-if-!=</span> $check-screen-row-in-bold-from:compare-cells
|
||||
<span id="L887" class="LineNr"> 887 </span> <span class="Delimiter">}</span>
|
||||
<span id="L888" class="LineNr"> 888 </span> <span class="muComment"># compare graphemes</span>
|
||||
<span id="L889" class="LineNr"> 889 </span> $check-screen-row-in-bold-from:compare-graphemes: <span class="Delimiter">{</span>
|
||||
<span id="L890" class="LineNr"> 890 </span> <span class="muComment"># if (g == expected-grapheme) print "."</span>
|
||||
<span id="L891" class="LineNr"> 891 </span> compare g, expected-grapheme
|
||||
<span id="L888" class="LineNr"> 888 </span> <span class="muComment"># compare code-point-utf8s</span>
|
||||
<span id="L889" class="LineNr"> 889 </span> $check-screen-row-in-bold-from:compare-code-point-utf8s: <span class="Delimiter">{</span>
|
||||
<span id="L890" class="LineNr"> 890 </span> <span class="muComment"># if (g == expected-code-point-utf8) print "."</span>
|
||||
<span id="L891" class="LineNr"> 891 </span> compare g, expected-code-point-utf8
|
||||
<span id="L892" class="LineNr"> 892 </span> <span class="Delimiter">{</span>
|
||||
<span id="L893" class="LineNr"> 893 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L894" class="LineNr"> 894 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">"."</span>
|
||||
<span id="L895" class="LineNr"> 895 </span> <span class="PreProc">break</span> $check-screen-row-in-bold-from:compare-graphemes
|
||||
<span id="L895" class="LineNr"> 895 </span> <span class="PreProc">break</span> $check-screen-row-in-bold-from:compare-code-point-utf8s
|
||||
<span id="L896" class="LineNr"> 896 </span> <span class="Delimiter">}</span>
|
||||
<span id="L897" class="LineNr"> 897 </span> <span class="muComment"># otherwise print an error</span>
|
||||
<span id="L898" class="LineNr"> 898 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> msg
|
||||
<span id="L899" class="LineNr"> 899 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">": expected '"</span>
|
||||
<span id="L900" class="LineNr"> 900 </span> <a href='304screen.subx.html#L161'>print-grapheme-to-real-screen</a> expected-grapheme
|
||||
<span id="L900" class="LineNr"> 900 </span> <a href='304screen.subx.html#L161'>print-code-point-utf8-to-real-screen</a> expected-code-point-utf8
|
||||
<span id="L901" class="LineNr"> 901 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">"' at ("</span>
|
||||
<span id="L902" class="LineNr"> 902 </span> <a href='304screen.subx.html#L226'>print-int32-hex-to-real-screen</a> row-idx
|
||||
<span id="L903" class="LineNr"> 903 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">", "</span>
|
||||
<span id="L904" class="LineNr"> 904 </span> <a href='304screen.subx.html#L226'>print-int32-hex-to-real-screen</a> col-idx
|
||||
<span id="L905" class="LineNr"> 905 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">") but observed '"</span>
|
||||
<span id="L906" class="LineNr"> 906 </span> <a href='304screen.subx.html#L161'>print-grapheme-to-real-screen</a> g
|
||||
<span id="L906" class="LineNr"> 906 </span> <a href='304screen.subx.html#L161'>print-code-point-utf8-to-real-screen</a> g
|
||||
<span id="L907" class="LineNr"> 907 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">"'\n"</span>
|
||||
<span id="L908" class="LineNr"> 908 </span> <span class="Delimiter">}</span>
|
||||
<span id="L909" class="LineNr"> 909 </span> $check-screen-row-in-bold-from:compare-bold: <span class="Delimiter">{</span>
|
||||
|
@ -982,7 +982,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L917" class="LineNr"> 917 </span> <span class="muComment"># otherwise print an error</span>
|
||||
<span id="L918" class="LineNr"> 918 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> msg
|
||||
<span id="L919" class="LineNr"> 919 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">": expected '"</span>
|
||||
<span id="L920" class="LineNr"> 920 </span> <a href='304screen.subx.html#L161'>print-grapheme-to-real-screen</a> expected-grapheme
|
||||
<span id="L920" class="LineNr"> 920 </span> <a href='304screen.subx.html#L161'>print-code-point-utf8-to-real-screen</a> expected-code-point-utf8
|
||||
<span id="L921" class="LineNr"> 921 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">"' at ("</span>
|
||||
<span id="L922" class="LineNr"> 922 </span> <a href='304screen.subx.html#L226'>print-int32-hex-to-real-screen</a> row-idx
|
||||
<span id="L923" class="LineNr"> 923 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">", "</span>
|
||||
|
@ -1003,7 +1003,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L938" class="LineNr"> 938 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='405screen.mu.html#L938'>check-screen-row-in-underline-from</a></span> screen-on-stack: (addr <a href='405screen.mu.html#L9'>screen</a>), row-idx: int, col-idx: int, expected: (addr array byte), msg: (addr array byte) <span class="Delimiter">{</span>
|
||||
<span id="L939" class="LineNr"> 939 </span> <span class="PreProc">var</span> <a href='405screen.mu.html#L9'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='405screen.mu.html#L9'>screen</a>) <span class="Special"><-</span> copy screen-on-stack
|
||||
<span id="L940" class="LineNr"> 940 </span> <span class="PreProc">var</span> idx/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> <a href='405screen.mu.html#L285'>screen-cell-index</a> <a href='405screen.mu.html#L9'>screen</a>, row-idx, col-idx
|
||||
<span id="L941" class="LineNr"> 941 </span> <span class="muComment"># compare 'expected' with the screen contents starting at 'idx', grapheme by grapheme</span>
|
||||
<span id="L941" class="LineNr"> 941 </span> <span class="muComment"># compare 'expected' with the screen contents starting at 'idx', code-point-utf8 by code-point-utf8</span>
|
||||
<span id="L942" class="LineNr"> 942 </span> <span class="PreProc">var</span> e: (stream byte <span class="Constant">0x100</span>)
|
||||
<span id="L943" class="LineNr"> 943 </span> <span class="PreProc">var</span> e-addr/<span class="muRegEdx">edx</span>: (addr stream byte) <span class="Special"><-</span> address e
|
||||
<span id="L944" class="LineNr"> 944 </span> <a href='108write.subx.html#L24'>write</a> e-addr, expected
|
||||
|
@ -1011,45 +1011,45 @@ if ('onhashchange' in window) {
|
|||
<span id="L946" class="LineNr"> 946 </span> <span class="PreProc">var</span> done?/eax: boolean <span class="Special"><-</span> <a href='309stream.subx.html#L6'>stream-empty?</a> e-addr
|
||||
<span id="L947" class="LineNr"> 947 </span> compare done?, <span class="Constant">0</span>
|
||||
<span id="L948" class="LineNr"> 948 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L949" class="LineNr"> 949 </span> <span class="PreProc">var</span> _g/eax: grapheme <span class="Special"><-</span> <a href='405screen.mu.html#L315'>screen-grapheme-at-idx</a> <a href='405screen.mu.html#L9'>screen</a>, idx
|
||||
<span id="L950" class="LineNr"> 950 </span> <span class="PreProc">var</span> g/<span class="muRegEbx">ebx</span>: grapheme <span class="Special"><-</span> copy _g
|
||||
<span id="L951" class="LineNr"> 951 </span> <span class="PreProc">var</span> _expected-grapheme/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L158'>read-grapheme</a> e-addr
|
||||
<span id="L952" class="LineNr"> 952 </span> <span class="PreProc">var</span> expected-grapheme/<span class="muRegEdx">edx</span>: grapheme <span class="Special"><-</span> copy _expected-grapheme
|
||||
<span id="L949" class="LineNr"> 949 </span> <span class="PreProc">var</span> _g/eax: code-point-utf8 <span class="Special"><-</span> <a href='405screen.mu.html#L315'>screen-code-point-utf8-at-idx</a> <a href='405screen.mu.html#L9'>screen</a>, idx
|
||||
<span id="L950" class="LineNr"> 950 </span> <span class="PreProc">var</span> g/<span class="muRegEbx">ebx</span>: code-point-utf8 <span class="Special"><-</span> copy _g
|
||||
<span id="L951" class="LineNr"> 951 </span> <span class="PreProc">var</span> _expected-code-point-utf8/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L155'>read-code-point-utf8</a> e-addr
|
||||
<span id="L952" class="LineNr"> 952 </span> <span class="PreProc">var</span> expected-code-point-utf8/<span class="muRegEdx">edx</span>: code-point-utf8 <span class="Special"><-</span> copy _expected-code-point-utf8
|
||||
<span id="L953" class="LineNr"> 953 </span> $check-screen-row-in-underline-from:compare-cells: <span class="Delimiter">{</span>
|
||||
<span id="L954" class="LineNr"> 954 </span> <span class="muComment"># if expected-grapheme is space, null grapheme is also ok</span>
|
||||
<span id="L954" class="LineNr"> 954 </span> <span class="muComment"># if expected-code-point-utf8 is space, null code-point-utf8 is also ok</span>
|
||||
<span id="L955" class="LineNr"> 955 </span> <span class="Delimiter">{</span>
|
||||
<span id="L956" class="LineNr"> 956 </span> compare expected-grapheme, <span class="Constant">0x20</span>
|
||||
<span id="L956" class="LineNr"> 956 </span> compare expected-code-point-utf8, <span class="Constant">0x20</span>
|
||||
<span id="L957" class="LineNr"> 957 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L958" class="LineNr"> 958 </span> compare g, <span class="Constant">0</span>
|
||||
<span id="L959" class="LineNr"> 959 </span> <span class="PreProc">break-if-=</span> $check-screen-row-in-underline-from:compare-cells
|
||||
<span id="L960" class="LineNr"> 960 </span> <span class="Delimiter">}</span>
|
||||
<span id="L961" class="LineNr"> 961 </span> <span class="muComment"># if expected-grapheme is space, non-underline is ok</span>
|
||||
<span id="L961" class="LineNr"> 961 </span> <span class="muComment"># if expected-code-point-utf8 is space, non-underline is ok</span>
|
||||
<span id="L962" class="LineNr"> 962 </span> <span class="Delimiter">{</span>
|
||||
<span id="L963" class="LineNr"> 963 </span> compare expected-grapheme, <span class="Constant">0x20</span>
|
||||
<span id="L963" class="LineNr"> 963 </span> compare expected-code-point-utf8, <span class="Constant">0x20</span>
|
||||
<span id="L964" class="LineNr"> 964 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L965" class="LineNr"> 965 </span> <span class="PreProc">var</span> underline?/eax: boolean <span class="Special"><-</span> <a href='405screen.mu.html#L388'>screen-underline-at-idx?</a> <a href='405screen.mu.html#L9'>screen</a>, idx
|
||||
<span id="L966" class="LineNr"> 966 </span> compare underline?, <span class="Constant">1</span>
|
||||
<span id="L967" class="LineNr"> 967 </span> <span class="PreProc">break-if-!=</span> $check-screen-row-in-underline-from:compare-cells
|
||||
<span id="L968" class="LineNr"> 968 </span> <span class="Delimiter">}</span>
|
||||
<span id="L969" class="LineNr"> 969 </span> <span class="muComment"># compare graphemes</span>
|
||||
<span id="L970" class="LineNr"> 970 </span> $check-screen-row-in-underline-from:compare-graphemes: <span class="Delimiter">{</span>
|
||||
<span id="L971" class="LineNr"> 971 </span> <span class="muComment"># if (g == expected-grapheme) print "."</span>
|
||||
<span id="L972" class="LineNr"> 972 </span> compare g, expected-grapheme
|
||||
<span id="L969" class="LineNr"> 969 </span> <span class="muComment"># compare code-point-utf8s</span>
|
||||
<span id="L970" class="LineNr"> 970 </span> $check-screen-row-in-underline-from:compare-code-point-utf8s: <span class="Delimiter">{</span>
|
||||
<span id="L971" class="LineNr"> 971 </span> <span class="muComment"># if (g == expected-code-point-utf8) print "."</span>
|
||||
<span id="L972" class="LineNr"> 972 </span> compare g, expected-code-point-utf8
|
||||
<span id="L973" class="LineNr"> 973 </span> <span class="Delimiter">{</span>
|
||||
<span id="L974" class="LineNr"> 974 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L975" class="LineNr"> 975 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">"."</span>
|
||||
<span id="L976" class="LineNr"> 976 </span> <span class="PreProc">break</span> $check-screen-row-in-underline-from:compare-graphemes
|
||||
<span id="L976" class="LineNr"> 976 </span> <span class="PreProc">break</span> $check-screen-row-in-underline-from:compare-code-point-utf8s
|
||||
<span id="L977" class="LineNr"> 977 </span> <span class="Delimiter">}</span>
|
||||
<span id="L978" class="LineNr"> 978 </span> <span class="muComment"># otherwise print an error</span>
|
||||
<span id="L979" class="LineNr"> 979 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> msg
|
||||
<span id="L980" class="LineNr"> 980 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">": expected '"</span>
|
||||
<span id="L981" class="LineNr"> 981 </span> <a href='304screen.subx.html#L161'>print-grapheme-to-real-screen</a> expected-grapheme
|
||||
<span id="L981" class="LineNr"> 981 </span> <a href='304screen.subx.html#L161'>print-code-point-utf8-to-real-screen</a> expected-code-point-utf8
|
||||
<span id="L982" class="LineNr"> 982 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">"' at ("</span>
|
||||
<span id="L983" class="LineNr"> 983 </span> <a href='304screen.subx.html#L226'>print-int32-hex-to-real-screen</a> row-idx
|
||||
<span id="L984" class="LineNr"> 984 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">", "</span>
|
||||
<span id="L985" class="LineNr"> 985 </span> <a href='304screen.subx.html#L226'>print-int32-hex-to-real-screen</a> col-idx
|
||||
<span id="L986" class="LineNr"> 986 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">") but observed '"</span>
|
||||
<span id="L987" class="LineNr"> 987 </span> <a href='304screen.subx.html#L161'>print-grapheme-to-real-screen</a> g
|
||||
<span id="L987" class="LineNr"> 987 </span> <a href='304screen.subx.html#L161'>print-code-point-utf8-to-real-screen</a> g
|
||||
<span id="L988" class="LineNr"> 988 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">"'\n"</span>
|
||||
<span id="L989" class="LineNr"> 989 </span> <span class="Delimiter">}</span>
|
||||
<span id="L990" class="LineNr"> 990 </span> $check-screen-row-in-underline-from:compare-underline: <span class="Delimiter">{</span>
|
||||
|
@ -1063,7 +1063,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L998" class="LineNr"> 998 </span> <span class="muComment"># otherwise print an error</span>
|
||||
<span id="L999" class="LineNr"> 999 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> msg
|
||||
<span id="L1000" class="LineNr">1000 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">": expected '"</span>
|
||||
<span id="L1001" class="LineNr">1001 </span> <a href='304screen.subx.html#L161'>print-grapheme-to-real-screen</a> expected-grapheme
|
||||
<span id="L1001" class="LineNr">1001 </span> <a href='304screen.subx.html#L161'>print-code-point-utf8-to-real-screen</a> expected-code-point-utf8
|
||||
<span id="L1002" class="LineNr">1002 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">"' at ("</span>
|
||||
<span id="L1003" class="LineNr">1003 </span> <a href='304screen.subx.html#L226'>print-int32-hex-to-real-screen</a> row-idx
|
||||
<span id="L1004" class="LineNr">1004 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">", "</span>
|
||||
|
@ -1084,7 +1084,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L1019" class="LineNr">1019 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='405screen.mu.html#L1019'>check-screen-row-in-reverse-from</a></span> screen-on-stack: (addr <a href='405screen.mu.html#L9'>screen</a>), row-idx: int, col-idx: int, expected: (addr array byte), msg: (addr array byte) <span class="Delimiter">{</span>
|
||||
<span id="L1020" class="LineNr">1020 </span> <span class="PreProc">var</span> <a href='405screen.mu.html#L9'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='405screen.mu.html#L9'>screen</a>) <span class="Special"><-</span> copy screen-on-stack
|
||||
<span id="L1021" class="LineNr">1021 </span> <span class="PreProc">var</span> idx/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> <a href='405screen.mu.html#L285'>screen-cell-index</a> <a href='405screen.mu.html#L9'>screen</a>, row-idx, col-idx
|
||||
<span id="L1022" class="LineNr">1022 </span> <span class="muComment"># compare 'expected' with the screen contents starting at 'idx', grapheme by grapheme</span>
|
||||
<span id="L1022" class="LineNr">1022 </span> <span class="muComment"># compare 'expected' with the screen contents starting at 'idx', code-point-utf8 by code-point-utf8</span>
|
||||
<span id="L1023" class="LineNr">1023 </span> <span class="PreProc">var</span> e: (stream byte <span class="Constant">0x100</span>)
|
||||
<span id="L1024" class="LineNr">1024 </span> <span class="PreProc">var</span> e-addr/<span class="muRegEdx">edx</span>: (addr stream byte) <span class="Special"><-</span> address e
|
||||
<span id="L1025" class="LineNr">1025 </span> <a href='108write.subx.html#L24'>write</a> e-addr, expected
|
||||
|
@ -1092,45 +1092,45 @@ if ('onhashchange' in window) {
|
|||
<span id="L1027" class="LineNr">1027 </span> <span class="PreProc">var</span> done?/eax: boolean <span class="Special"><-</span> <a href='309stream.subx.html#L6'>stream-empty?</a> e-addr
|
||||
<span id="L1028" class="LineNr">1028 </span> compare done?, <span class="Constant">0</span>
|
||||
<span id="L1029" class="LineNr">1029 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L1030" class="LineNr">1030 </span> <span class="PreProc">var</span> _g/eax: grapheme <span class="Special"><-</span> <a href='405screen.mu.html#L315'>screen-grapheme-at-idx</a> <a href='405screen.mu.html#L9'>screen</a>, idx
|
||||
<span id="L1031" class="LineNr">1031 </span> <span class="PreProc">var</span> g/<span class="muRegEbx">ebx</span>: grapheme <span class="Special"><-</span> copy _g
|
||||
<span id="L1032" class="LineNr">1032 </span> <span class="PreProc">var</span> _expected-grapheme/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L158'>read-grapheme</a> e-addr
|
||||
<span id="L1033" class="LineNr">1033 </span> <span class="PreProc">var</span> expected-grapheme/<span class="muRegEdx">edx</span>: grapheme <span class="Special"><-</span> copy _expected-grapheme
|
||||
<span id="L1030" class="LineNr">1030 </span> <span class="PreProc">var</span> _g/eax: code-point-utf8 <span class="Special"><-</span> <a href='405screen.mu.html#L315'>screen-code-point-utf8-at-idx</a> <a href='405screen.mu.html#L9'>screen</a>, idx
|
||||
<span id="L1031" class="LineNr">1031 </span> <span class="PreProc">var</span> g/<span class="muRegEbx">ebx</span>: code-point-utf8 <span class="Special"><-</span> copy _g
|
||||
<span id="L1032" class="LineNr">1032 </span> <span class="PreProc">var</span> _expected-code-point-utf8/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L155'>read-code-point-utf8</a> e-addr
|
||||
<span id="L1033" class="LineNr">1033 </span> <span class="PreProc">var</span> expected-code-point-utf8/<span class="muRegEdx">edx</span>: code-point-utf8 <span class="Special"><-</span> copy _expected-code-point-utf8
|
||||
<span id="L1034" class="LineNr">1034 </span> $check-screen-row-in-reverse-from:compare-cells: <span class="Delimiter">{</span>
|
||||
<span id="L1035" class="LineNr">1035 </span> <span class="muComment"># if expected-grapheme is space, null grapheme is also ok</span>
|
||||
<span id="L1035" class="LineNr">1035 </span> <span class="muComment"># if expected-code-point-utf8 is space, null code-point-utf8 is also ok</span>
|
||||
<span id="L1036" class="LineNr">1036 </span> <span class="Delimiter">{</span>
|
||||
<span id="L1037" class="LineNr">1037 </span> compare expected-grapheme, <span class="Constant">0x20</span>
|
||||
<span id="L1037" class="LineNr">1037 </span> compare expected-code-point-utf8, <span class="Constant">0x20</span>
|
||||
<span id="L1038" class="LineNr">1038 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L1039" class="LineNr">1039 </span> compare g, <span class="Constant">0</span>
|
||||
<span id="L1040" class="LineNr">1040 </span> <span class="PreProc">break-if-=</span> $check-screen-row-in-reverse-from:compare-cells
|
||||
<span id="L1041" class="LineNr">1041 </span> <span class="Delimiter">}</span>
|
||||
<span id="L1042" class="LineNr">1042 </span> <span class="muComment"># if expected-grapheme is space, non-reverse is ok</span>
|
||||
<span id="L1042" class="LineNr">1042 </span> <span class="muComment"># if expected-code-point-utf8 is space, non-reverse is ok</span>
|
||||
<span id="L1043" class="LineNr">1043 </span> <span class="Delimiter">{</span>
|
||||
<span id="L1044" class="LineNr">1044 </span> compare expected-grapheme, <span class="Constant">0x20</span>
|
||||
<span id="L1044" class="LineNr">1044 </span> compare expected-code-point-utf8, <span class="Constant">0x20</span>
|
||||
<span id="L1045" class="LineNr">1045 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L1046" class="LineNr">1046 </span> <span class="PreProc">var</span> reverse?/eax: boolean <span class="Special"><-</span> <a href='405screen.mu.html#L406'>screen-reverse-at-idx?</a> <a href='405screen.mu.html#L9'>screen</a>, idx
|
||||
<span id="L1047" class="LineNr">1047 </span> compare reverse?, <span class="Constant">1</span>
|
||||
<span id="L1048" class="LineNr">1048 </span> <span class="PreProc">break-if-!=</span> $check-screen-row-in-reverse-from:compare-cells
|
||||
<span id="L1049" class="LineNr">1049 </span> <span class="Delimiter">}</span>
|
||||
<span id="L1050" class="LineNr">1050 </span> <span class="muComment"># compare graphemes</span>
|
||||
<span id="L1051" class="LineNr">1051 </span> $check-screen-row-in-reverse-from:compare-graphemes: <span class="Delimiter">{</span>
|
||||
<span id="L1052" class="LineNr">1052 </span> <span class="muComment"># if (g == expected-grapheme) print "."</span>
|
||||
<span id="L1053" class="LineNr">1053 </span> compare g, expected-grapheme
|
||||
<span id="L1050" class="LineNr">1050 </span> <span class="muComment"># compare code-point-utf8s</span>
|
||||
<span id="L1051" class="LineNr">1051 </span> $check-screen-row-in-reverse-from:compare-code-point-utf8s: <span class="Delimiter">{</span>
|
||||
<span id="L1052" class="LineNr">1052 </span> <span class="muComment"># if (g == expected-code-point-utf8) print "."</span>
|
||||
<span id="L1053" class="LineNr">1053 </span> compare g, expected-code-point-utf8
|
||||
<span id="L1054" class="LineNr">1054 </span> <span class="Delimiter">{</span>
|
||||
<span id="L1055" class="LineNr">1055 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L1056" class="LineNr">1056 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">"."</span>
|
||||
<span id="L1057" class="LineNr">1057 </span> <span class="PreProc">break</span> $check-screen-row-in-reverse-from:compare-graphemes
|
||||
<span id="L1057" class="LineNr">1057 </span> <span class="PreProc">break</span> $check-screen-row-in-reverse-from:compare-code-point-utf8s
|
||||
<span id="L1058" class="LineNr">1058 </span> <span class="Delimiter">}</span>
|
||||
<span id="L1059" class="LineNr">1059 </span> <span class="muComment"># otherwise print an error</span>
|
||||
<span id="L1060" class="LineNr">1060 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> msg
|
||||
<span id="L1061" class="LineNr">1061 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">": expected '"</span>
|
||||
<span id="L1062" class="LineNr">1062 </span> <a href='304screen.subx.html#L161'>print-grapheme-to-real-screen</a> expected-grapheme
|
||||
<span id="L1062" class="LineNr">1062 </span> <a href='304screen.subx.html#L161'>print-code-point-utf8-to-real-screen</a> expected-code-point-utf8
|
||||
<span id="L1063" class="LineNr">1063 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">"' at ("</span>
|
||||
<span id="L1064" class="LineNr">1064 </span> <a href='304screen.subx.html#L226'>print-int32-hex-to-real-screen</a> row-idx
|
||||
<span id="L1065" class="LineNr">1065 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">", "</span>
|
||||
<span id="L1066" class="LineNr">1066 </span> <a href='304screen.subx.html#L226'>print-int32-hex-to-real-screen</a> col-idx
|
||||
<span id="L1067" class="LineNr">1067 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">") but observed '"</span>
|
||||
<span id="L1068" class="LineNr">1068 </span> <a href='304screen.subx.html#L161'>print-grapheme-to-real-screen</a> g
|
||||
<span id="L1068" class="LineNr">1068 </span> <a href='304screen.subx.html#L161'>print-code-point-utf8-to-real-screen</a> g
|
||||
<span id="L1069" class="LineNr">1069 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">"'\n"</span>
|
||||
<span id="L1070" class="LineNr">1070 </span> <span class="Delimiter">}</span>
|
||||
<span id="L1071" class="LineNr">1071 </span> $check-screen-row-in-reverse-from:compare-reverse: <span class="Delimiter">{</span>
|
||||
|
@ -1144,7 +1144,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L1079" class="LineNr">1079 </span> <span class="muComment"># otherwise print an error</span>
|
||||
<span id="L1080" class="LineNr">1080 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> msg
|
||||
<span id="L1081" class="LineNr">1081 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">": expected '"</span>
|
||||
<span id="L1082" class="LineNr">1082 </span> <a href='304screen.subx.html#L161'>print-grapheme-to-real-screen</a> expected-grapheme
|
||||
<span id="L1082" class="LineNr">1082 </span> <a href='304screen.subx.html#L161'>print-code-point-utf8-to-real-screen</a> expected-code-point-utf8
|
||||
<span id="L1083" class="LineNr">1083 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">"' at ("</span>
|
||||
<span id="L1084" class="LineNr">1084 </span> <a href='304screen.subx.html#L226'>print-int32-hex-to-real-screen</a> row-idx
|
||||
<span id="L1085" class="LineNr">1085 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">", "</span>
|
||||
|
@ -1165,7 +1165,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L1100" class="LineNr">1100 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='405screen.mu.html#L1100'>check-screen-row-in-blinking-from</a></span> screen-on-stack: (addr <a href='405screen.mu.html#L9'>screen</a>), row-idx: int, col-idx: int, expected: (addr array byte), msg: (addr array byte) <span class="Delimiter">{</span>
|
||||
<span id="L1101" class="LineNr">1101 </span> <span class="PreProc">var</span> <a href='405screen.mu.html#L9'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='405screen.mu.html#L9'>screen</a>) <span class="Special"><-</span> copy screen-on-stack
|
||||
<span id="L1102" class="LineNr">1102 </span> <span class="PreProc">var</span> idx/<span class="muRegEcx">ecx</span>: int <span class="Special"><-</span> <a href='405screen.mu.html#L285'>screen-cell-index</a> <a href='405screen.mu.html#L9'>screen</a>, row-idx, col-idx
|
||||
<span id="L1103" class="LineNr">1103 </span> <span class="muComment"># compare 'expected' with the screen contents starting at 'idx', grapheme by grapheme</span>
|
||||
<span id="L1103" class="LineNr">1103 </span> <span class="muComment"># compare 'expected' with the screen contents starting at 'idx', code-point-utf8 by code-point-utf8</span>
|
||||
<span id="L1104" class="LineNr">1104 </span> <span class="PreProc">var</span> e: (stream byte <span class="Constant">0x100</span>)
|
||||
<span id="L1105" class="LineNr">1105 </span> <span class="PreProc">var</span> e-addr/<span class="muRegEdx">edx</span>: (addr stream byte) <span class="Special"><-</span> address e
|
||||
<span id="L1106" class="LineNr">1106 </span> <a href='108write.subx.html#L24'>write</a> e-addr, expected
|
||||
|
@ -1173,45 +1173,45 @@ if ('onhashchange' in window) {
|
|||
<span id="L1108" class="LineNr">1108 </span> <span class="PreProc">var</span> done?/eax: boolean <span class="Special"><-</span> <a href='309stream.subx.html#L6'>stream-empty?</a> e-addr
|
||||
<span id="L1109" class="LineNr">1109 </span> compare done?, <span class="Constant">0</span>
|
||||
<span id="L1110" class="LineNr">1110 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L1111" class="LineNr">1111 </span> <span class="PreProc">var</span> _g/eax: grapheme <span class="Special"><-</span> <a href='405screen.mu.html#L315'>screen-grapheme-at-idx</a> <a href='405screen.mu.html#L9'>screen</a>, idx
|
||||
<span id="L1112" class="LineNr">1112 </span> <span class="PreProc">var</span> g/<span class="muRegEbx">ebx</span>: grapheme <span class="Special"><-</span> copy _g
|
||||
<span id="L1113" class="LineNr">1113 </span> <span class="PreProc">var</span> _expected-grapheme/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L158'>read-grapheme</a> e-addr
|
||||
<span id="L1114" class="LineNr">1114 </span> <span class="PreProc">var</span> expected-grapheme/<span class="muRegEdx">edx</span>: grapheme <span class="Special"><-</span> copy _expected-grapheme
|
||||
<span id="L1111" class="LineNr">1111 </span> <span class="PreProc">var</span> _g/eax: code-point-utf8 <span class="Special"><-</span> <a href='405screen.mu.html#L315'>screen-code-point-utf8-at-idx</a> <a href='405screen.mu.html#L9'>screen</a>, idx
|
||||
<span id="L1112" class="LineNr">1112 </span> <span class="PreProc">var</span> g/<span class="muRegEbx">ebx</span>: code-point-utf8 <span class="Special"><-</span> copy _g
|
||||
<span id="L1113" class="LineNr">1113 </span> <span class="PreProc">var</span> _expected-code-point-utf8/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L155'>read-code-point-utf8</a> e-addr
|
||||
<span id="L1114" class="LineNr">1114 </span> <span class="PreProc">var</span> expected-code-point-utf8/<span class="muRegEdx">edx</span>: code-point-utf8 <span class="Special"><-</span> copy _expected-code-point-utf8
|
||||
<span id="L1115" class="LineNr">1115 </span> $check-screen-row-in-blinking-from:compare-cells: <span class="Delimiter">{</span>
|
||||
<span id="L1116" class="LineNr">1116 </span> <span class="muComment"># if expected-grapheme is space, null grapheme is also ok</span>
|
||||
<span id="L1116" class="LineNr">1116 </span> <span class="muComment"># if expected-code-point-utf8 is space, null code-point-utf8 is also ok</span>
|
||||
<span id="L1117" class="LineNr">1117 </span> <span class="Delimiter">{</span>
|
||||
<span id="L1118" class="LineNr">1118 </span> compare expected-grapheme, <span class="Constant">0x20</span>
|
||||
<span id="L1118" class="LineNr">1118 </span> compare expected-code-point-utf8, <span class="Constant">0x20</span>
|
||||
<span id="L1119" class="LineNr">1119 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L1120" class="LineNr">1120 </span> compare g, <span class="Constant">0</span>
|
||||
<span id="L1121" class="LineNr">1121 </span> <span class="PreProc">break-if-=</span> $check-screen-row-in-blinking-from:compare-cells
|
||||
<span id="L1122" class="LineNr">1122 </span> <span class="Delimiter">}</span>
|
||||
<span id="L1123" class="LineNr">1123 </span> <span class="muComment"># if expected-grapheme is space, non-blinking is ok</span>
|
||||
<span id="L1123" class="LineNr">1123 </span> <span class="muComment"># if expected-code-point-utf8 is space, non-blinking is ok</span>
|
||||
<span id="L1124" class="LineNr">1124 </span> <span class="Delimiter">{</span>
|
||||
<span id="L1125" class="LineNr">1125 </span> compare expected-grapheme, <span class="Constant">0x20</span>
|
||||
<span id="L1125" class="LineNr">1125 </span> compare expected-code-point-utf8, <span class="Constant">0x20</span>
|
||||
<span id="L1126" class="LineNr">1126 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L1127" class="LineNr">1127 </span> <span class="PreProc">var</span> blinking?/eax: boolean <span class="Special"><-</span> <a href='405screen.mu.html#L424'>screen-blink-at-idx?</a> <a href='405screen.mu.html#L9'>screen</a>, idx
|
||||
<span id="L1128" class="LineNr">1128 </span> compare blinking?, <span class="Constant">1</span>
|
||||
<span id="L1129" class="LineNr">1129 </span> <span class="PreProc">break-if-!=</span> $check-screen-row-in-blinking-from:compare-cells
|
||||
<span id="L1130" class="LineNr">1130 </span> <span class="Delimiter">}</span>
|
||||
<span id="L1131" class="LineNr">1131 </span> <span class="muComment"># compare graphemes</span>
|
||||
<span id="L1132" class="LineNr">1132 </span> $check-screen-row-in-blinking-from:compare-graphemes: <span class="Delimiter">{</span>
|
||||
<span id="L1133" class="LineNr">1133 </span> <span class="muComment"># if (g == expected-grapheme) print "."</span>
|
||||
<span id="L1134" class="LineNr">1134 </span> compare g, expected-grapheme
|
||||
<span id="L1131" class="LineNr">1131 </span> <span class="muComment"># compare code-point-utf8s</span>
|
||||
<span id="L1132" class="LineNr">1132 </span> $check-screen-row-in-blinking-from:compare-code-point-utf8s: <span class="Delimiter">{</span>
|
||||
<span id="L1133" class="LineNr">1133 </span> <span class="muComment"># if (g == expected-code-point-utf8) print "."</span>
|
||||
<span id="L1134" class="LineNr">1134 </span> compare g, expected-code-point-utf8
|
||||
<span id="L1135" class="LineNr">1135 </span> <span class="Delimiter">{</span>
|
||||
<span id="L1136" class="LineNr">1136 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L1137" class="LineNr">1137 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">"."</span>
|
||||
<span id="L1138" class="LineNr">1138 </span> <span class="PreProc">break</span> $check-screen-row-in-blinking-from:compare-graphemes
|
||||
<span id="L1138" class="LineNr">1138 </span> <span class="PreProc">break</span> $check-screen-row-in-blinking-from:compare-code-point-utf8s
|
||||
<span id="L1139" class="LineNr">1139 </span> <span class="Delimiter">}</span>
|
||||
<span id="L1140" class="LineNr">1140 </span> <span class="muComment"># otherwise print an error</span>
|
||||
<span id="L1141" class="LineNr">1141 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> msg
|
||||
<span id="L1142" class="LineNr">1142 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">": expected '"</span>
|
||||
<span id="L1143" class="LineNr">1143 </span> <a href='304screen.subx.html#L161'>print-grapheme-to-real-screen</a> expected-grapheme
|
||||
<span id="L1143" class="LineNr">1143 </span> <a href='304screen.subx.html#L161'>print-code-point-utf8-to-real-screen</a> expected-code-point-utf8
|
||||
<span id="L1144" class="LineNr">1144 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">"' at ("</span>
|
||||
<span id="L1145" class="LineNr">1145 </span> <a href='304screen.subx.html#L226'>print-int32-hex-to-real-screen</a> row-idx
|
||||
<span id="L1146" class="LineNr">1146 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">", "</span>
|
||||
<span id="L1147" class="LineNr">1147 </span> <a href='304screen.subx.html#L226'>print-int32-hex-to-real-screen</a> col-idx
|
||||
<span id="L1148" class="LineNr">1148 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">") but observed '"</span>
|
||||
<span id="L1149" class="LineNr">1149 </span> <a href='304screen.subx.html#L161'>print-grapheme-to-real-screen</a> g
|
||||
<span id="L1149" class="LineNr">1149 </span> <a href='304screen.subx.html#L161'>print-code-point-utf8-to-real-screen</a> g
|
||||
<span id="L1150" class="LineNr">1150 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">"'\n"</span>
|
||||
<span id="L1151" class="LineNr">1151 </span> <span class="Delimiter">}</span>
|
||||
<span id="L1152" class="LineNr">1152 </span> $check-screen-row-in-blinking-from:compare-blinking: <span class="Delimiter">{</span>
|
||||
|
@ -1225,7 +1225,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L1160" class="LineNr">1160 </span> <span class="muComment"># otherwise print an error</span>
|
||||
<span id="L1161" class="LineNr">1161 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> msg
|
||||
<span id="L1162" class="LineNr">1162 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">": expected '"</span>
|
||||
<span id="L1163" class="LineNr">1163 </span> <a href='304screen.subx.html#L161'>print-grapheme-to-real-screen</a> expected-grapheme
|
||||
<span id="L1163" class="LineNr">1163 </span> <a href='304screen.subx.html#L161'>print-code-point-utf8-to-real-screen</a> expected-code-point-utf8
|
||||
<span id="L1164" class="LineNr">1164 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">"' at ("</span>
|
||||
<span id="L1165" class="LineNr">1165 </span> <a href='304screen.subx.html#L226'>print-int32-hex-to-real-screen</a> row-idx
|
||||
<span id="L1166" class="LineNr">1166 </span> <a href='304screen.subx.html#L122'>print-string-to-real-screen</a> <span class="Constant">", "</span>
|
||||
|
@ -1240,21 +1240,21 @@ if ('onhashchange' in window) {
|
|||
<span id="L1175" class="LineNr">1175 </span> <span class="Delimiter">}</span>
|
||||
<span id="L1176" class="LineNr">1176 </span><span class="Delimiter">}</span>
|
||||
<span id="L1177" class="LineNr">1177 </span>
|
||||
<span id="L1178" class="LineNr">1178 </span><span class="PreProc">fn</span> <span class="muTest"><a href='405screen.mu.html#L1178'>test-print-single-grapheme</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L1178" class="LineNr">1178 </span><span class="PreProc">fn</span> <span class="muTest"><a href='405screen.mu.html#L1178'>test-print-single-code-point-utf8</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L1179" class="LineNr">1179 </span> <span class="PreProc">var</span> screen-on-stack: <a href='405screen.mu.html#L9'>screen</a>
|
||||
<span id="L1180" class="LineNr">1180 </span> <span class="PreProc">var</span> <a href='405screen.mu.html#L9'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='405screen.mu.html#L9'>screen</a>) <span class="Special"><-</span> address screen-on-stack
|
||||
<span id="L1181" class="LineNr">1181 </span> <a href='405screen.mu.html#L30'>initialize-screen</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">5</span>/rows, <span class="Constant">4</span>/cols
|
||||
<span id="L1182" class="LineNr">1182 </span> <span class="PreProc">var</span> c/eax: grapheme <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L1183" class="LineNr">1183 </span> <a href='405screen.mu.html#L214'>print-grapheme</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1184" class="LineNr">1184 </span> <a href='405screen.mu.html#L627'>check-screen-row</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">1</span>/row, <span class="Constant">"a"</span>, <span class="Constant">"F - test-print-single-grapheme"</span> <span class="muComment"># top-left corner of the screen</span>
|
||||
<span id="L1182" class="LineNr">1182 </span> <span class="PreProc">var</span> c/eax: code-point-utf8 <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L1183" class="LineNr">1183 </span> <a href='405screen.mu.html#L214'>print-code-point-utf8</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1184" class="LineNr">1184 </span> <a href='405screen.mu.html#L627'>check-screen-row</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">1</span>/row, <span class="Constant">"a"</span>, <span class="Constant">"F - test-print-single-code-point-utf8"</span> <span class="muComment"># top-left corner of the screen</span>
|
||||
<span id="L1185" class="LineNr">1185 </span><span class="Delimiter">}</span>
|
||||
<span id="L1186" class="LineNr">1186 </span>
|
||||
<span id="L1187" class="LineNr">1187 </span><span class="PreProc">fn</span> <span class="muTest"><a href='405screen.mu.html#L1187'>test-print-multiple-graphemes</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L1187" class="LineNr">1187 </span><span class="PreProc">fn</span> <span class="muTest"><a href='405screen.mu.html#L1187'>test-print-multiple-code-point-utf8s</a></span> <span class="Delimiter">{</span>
|
||||
<span id="L1188" class="LineNr">1188 </span> <span class="PreProc">var</span> screen-on-stack: <a href='405screen.mu.html#L9'>screen</a>
|
||||
<span id="L1189" class="LineNr">1189 </span> <span class="PreProc">var</span> <a href='405screen.mu.html#L9'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='405screen.mu.html#L9'>screen</a>) <span class="Special"><-</span> address screen-on-stack
|
||||
<span id="L1190" class="LineNr">1190 </span> <a href='405screen.mu.html#L30'>initialize-screen</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">5</span>/rows, <span class="Constant">4</span>/cols
|
||||
<span id="L1191" class="LineNr">1191 </span> <a href='405screen.mu.html#L169'>print-string</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">"Hello, 世界"</span>
|
||||
<span id="L1192" class="LineNr">1192 </span> <a href='405screen.mu.html#L627'>check-screen-row</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">1</span>/row, <span class="Constant">"Hello, 世界"</span>, <span class="Constant">"F - test-print-multiple-graphemes"</span>
|
||||
<span id="L1192" class="LineNr">1192 </span> <a href='405screen.mu.html#L627'>check-screen-row</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">1</span>/row, <span class="Constant">"Hello, 世界"</span>, <span class="Constant">"F - test-print-multiple-code-point-utf8s"</span>
|
||||
<span id="L1193" class="LineNr">1193 </span><span class="Delimiter">}</span>
|
||||
<span id="L1194" class="LineNr">1194 </span>
|
||||
<span id="L1195" class="LineNr">1195 </span><span class="PreProc">fn</span> <span class="muTest"><a href='405screen.mu.html#L1195'>test-move-cursor</a></span> <span class="Delimiter">{</span>
|
||||
|
@ -1262,8 +1262,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L1197" class="LineNr">1197 </span> <span class="PreProc">var</span> <a href='405screen.mu.html#L9'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='405screen.mu.html#L9'>screen</a>) <span class="Special"><-</span> address screen-on-stack
|
||||
<span id="L1198" class="LineNr">1198 </span> <a href='405screen.mu.html#L30'>initialize-screen</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">5</span>/rows, <span class="Constant">4</span>/cols
|
||||
<span id="L1199" class="LineNr">1199 </span> <a href='405screen.mu.html#L109'>move-cursor</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">1</span>, <span class="Constant">4</span>
|
||||
<span id="L1200" class="LineNr">1200 </span> <span class="PreProc">var</span> c/eax: grapheme <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L1201" class="LineNr">1201 </span> <a href='405screen.mu.html#L214'>print-grapheme</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1200" class="LineNr">1200 </span> <span class="PreProc">var</span> c/eax: code-point-utf8 <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L1201" class="LineNr">1201 </span> <a href='405screen.mu.html#L214'>print-code-point-utf8</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1202" class="LineNr">1202 </span> <a href='405screen.mu.html#L627'>check-screen-row</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">1</span>/row, <span class="Constant">" a"</span>, <span class="Constant">"F - test-move-cursor"</span> <span class="muComment"># top row</span>
|
||||
<span id="L1203" class="LineNr">1203 </span><span class="Delimiter">}</span>
|
||||
<span id="L1204" class="LineNr">1204 </span>
|
||||
|
@ -1272,8 +1272,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L1207" class="LineNr">1207 </span> <span class="PreProc">var</span> <a href='405screen.mu.html#L9'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='405screen.mu.html#L9'>screen</a>) <span class="Special"><-</span> address screen-on-stack
|
||||
<span id="L1208" class="LineNr">1208 </span> <a href='405screen.mu.html#L30'>initialize-screen</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">5</span>/rows, <span class="Constant">4</span>/cols
|
||||
<span id="L1209" class="LineNr">1209 </span> <a href='405screen.mu.html#L109'>move-cursor</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">0</span>, <span class="Constant">0</span>
|
||||
<span id="L1210" class="LineNr">1210 </span> <span class="PreProc">var</span> c/eax: grapheme <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L1211" class="LineNr">1211 </span> <a href='405screen.mu.html#L214'>print-grapheme</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1210" class="LineNr">1210 </span> <span class="PreProc">var</span> c/eax: code-point-utf8 <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L1211" class="LineNr">1211 </span> <a href='405screen.mu.html#L214'>print-code-point-utf8</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1212" class="LineNr">1212 </span> <a href='405screen.mu.html#L627'>check-screen-row</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">1</span>/row, <span class="Constant">"a"</span>, <span class="Constant">"F - test-move-cursor-zeroes"</span> <span class="muComment"># top-left corner of the screen</span>
|
||||
<span id="L1213" class="LineNr">1213 </span><span class="Delimiter">}</span>
|
||||
<span id="L1214" class="LineNr">1214 </span>
|
||||
|
@ -1282,8 +1282,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L1217" class="LineNr">1217 </span> <span class="PreProc">var</span> <a href='405screen.mu.html#L9'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='405screen.mu.html#L9'>screen</a>) <span class="Special"><-</span> address screen-on-stack
|
||||
<span id="L1218" class="LineNr">1218 </span> <a href='405screen.mu.html#L30'>initialize-screen</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">5</span>/rows, <span class="Constant">4</span>/cols
|
||||
<span id="L1219" class="LineNr">1219 </span> <a href='405screen.mu.html#L109'>move-cursor</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">0</span>, <span class="Constant">2</span>
|
||||
<span id="L1220" class="LineNr">1220 </span> <span class="PreProc">var</span> c/eax: grapheme <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L1221" class="LineNr">1221 </span> <a href='405screen.mu.html#L214'>print-grapheme</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1220" class="LineNr">1220 </span> <span class="PreProc">var</span> c/eax: code-point-utf8 <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L1221" class="LineNr">1221 </span> <a href='405screen.mu.html#L214'>print-code-point-utf8</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1222" class="LineNr">1222 </span> <a href='405screen.mu.html#L627'>check-screen-row</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">1</span>/row, <span class="Constant">" a"</span>, <span class="Constant">"F - test-move-cursor-zero-row"</span> <span class="muComment"># top row</span>
|
||||
<span id="L1223" class="LineNr">1223 </span><span class="Delimiter">}</span>
|
||||
<span id="L1224" class="LineNr">1224 </span>
|
||||
|
@ -1292,8 +1292,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L1227" class="LineNr">1227 </span> <span class="PreProc">var</span> <a href='405screen.mu.html#L9'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='405screen.mu.html#L9'>screen</a>) <span class="Special"><-</span> address screen-on-stack
|
||||
<span id="L1228" class="LineNr">1228 </span> <a href='405screen.mu.html#L30'>initialize-screen</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">5</span>/rows, <span class="Constant">4</span>/cols
|
||||
<span id="L1229" class="LineNr">1229 </span> <a href='405screen.mu.html#L109'>move-cursor</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">4</span>, <span class="Constant">0</span>
|
||||
<span id="L1230" class="LineNr">1230 </span> <span class="PreProc">var</span> c/eax: grapheme <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L1231" class="LineNr">1231 </span> <a href='405screen.mu.html#L214'>print-grapheme</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1230" class="LineNr">1230 </span> <span class="PreProc">var</span> c/eax: code-point-utf8 <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L1231" class="LineNr">1231 </span> <a href='405screen.mu.html#L214'>print-code-point-utf8</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1232" class="LineNr">1232 </span> <a href='405screen.mu.html#L627'>check-screen-row</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">4</span>/row, <span class="Constant">"a"</span>, <span class="Constant">"F - test-move-cursor-zero-column"</span>
|
||||
<span id="L1233" class="LineNr">1233 </span><span class="Delimiter">}</span>
|
||||
<span id="L1234" class="LineNr">1234 </span>
|
||||
|
@ -1302,8 +1302,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L1237" class="LineNr">1237 </span> <span class="PreProc">var</span> <a href='405screen.mu.html#L9'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='405screen.mu.html#L9'>screen</a>) <span class="Special"><-</span> address screen-on-stack
|
||||
<span id="L1238" class="LineNr">1238 </span> <a href='405screen.mu.html#L30'>initialize-screen</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">5</span>, <span class="Constant">3</span>
|
||||
<span id="L1239" class="LineNr">1239 </span> <a href='405screen.mu.html#L109'>move-cursor</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">-1</span>/row, <span class="Constant">2</span>/col
|
||||
<span id="L1240" class="LineNr">1240 </span> <span class="PreProc">var</span> c/eax: grapheme <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L1241" class="LineNr">1241 </span> <a href='405screen.mu.html#L214'>print-grapheme</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1240" class="LineNr">1240 </span> <span class="PreProc">var</span> c/eax: code-point-utf8 <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L1241" class="LineNr">1241 </span> <a href='405screen.mu.html#L214'>print-code-point-utf8</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1242" class="LineNr">1242 </span> <span class="muComment"># no move</span>
|
||||
<span id="L1243" class="LineNr">1243 </span> <a href='405screen.mu.html#L627'>check-screen-row</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">1</span>/row, <span class="Constant">"a"</span>, <span class="Constant">"F - test-move-cursor-negative-row"</span>
|
||||
<span id="L1244" class="LineNr">1244 </span><span class="Delimiter">}</span>
|
||||
|
@ -1313,8 +1313,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L1248" class="LineNr">1248 </span> <span class="PreProc">var</span> <a href='405screen.mu.html#L9'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='405screen.mu.html#L9'>screen</a>) <span class="Special"><-</span> address screen-on-stack
|
||||
<span id="L1249" class="LineNr">1249 </span> <a href='405screen.mu.html#L30'>initialize-screen</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">5</span>, <span class="Constant">3</span>
|
||||
<span id="L1250" class="LineNr">1250 </span> <a href='405screen.mu.html#L109'>move-cursor</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">2</span>/row, <span class="Constant">-1</span>/col
|
||||
<span id="L1251" class="LineNr">1251 </span> <span class="PreProc">var</span> c/eax: grapheme <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L1252" class="LineNr">1252 </span> <a href='405screen.mu.html#L214'>print-grapheme</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1251" class="LineNr">1251 </span> <span class="PreProc">var</span> c/eax: code-point-utf8 <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L1252" class="LineNr">1252 </span> <a href='405screen.mu.html#L214'>print-code-point-utf8</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1253" class="LineNr">1253 </span> <span class="muComment"># no move</span>
|
||||
<span id="L1254" class="LineNr">1254 </span> <a href='405screen.mu.html#L627'>check-screen-row</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">1</span>/row, <span class="Constant">"a"</span>, <span class="Constant">"F - test-move-cursor-negative-column"</span>
|
||||
<span id="L1255" class="LineNr">1255 </span><span class="Delimiter">}</span>
|
||||
|
@ -1324,8 +1324,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L1259" class="LineNr">1259 </span> <span class="PreProc">var</span> <a href='405screen.mu.html#L9'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='405screen.mu.html#L9'>screen</a>) <span class="Special"><-</span> address screen-on-stack
|
||||
<span id="L1260" class="LineNr">1260 </span> <a href='405screen.mu.html#L30'>initialize-screen</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">5</span>/rows, <span class="Constant">3</span>/cols
|
||||
<span id="L1261" class="LineNr">1261 </span> <a href='405screen.mu.html#L109'>move-cursor</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">1</span>/row, <span class="Constant">4</span>/col
|
||||
<span id="L1262" class="LineNr">1262 </span> <span class="PreProc">var</span> c/eax: grapheme <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L1263" class="LineNr">1263 </span> <a href='405screen.mu.html#L214'>print-grapheme</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1262" class="LineNr">1262 </span> <span class="PreProc">var</span> c/eax: code-point-utf8 <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L1263" class="LineNr">1263 </span> <a href='405screen.mu.html#L214'>print-code-point-utf8</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1264" class="LineNr">1264 </span> <span class="muComment"># top row is empty</span>
|
||||
<span id="L1265" class="LineNr">1265 </span> <a href='405screen.mu.html#L627'>check-screen-row</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">1</span>/row, <span class="Constant">" "</span>, <span class="Constant">"F - test-move-cursor-column-too-large"</span>
|
||||
<span id="L1266" class="LineNr">1266 </span> <span class="muComment"># character shows up on next row</span>
|
||||
|
@ -1337,8 +1337,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L1272" class="LineNr">1272 </span> <span class="PreProc">var</span> <a href='405screen.mu.html#L9'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='405screen.mu.html#L9'>screen</a>) <span class="Special"><-</span> address screen-on-stack
|
||||
<span id="L1273" class="LineNr">1273 </span> <a href='405screen.mu.html#L30'>initialize-screen</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">5</span>/rows, <span class="Constant">3</span>/cols
|
||||
<span id="L1274" class="LineNr">1274 </span> <a href='405screen.mu.html#L109'>move-cursor</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">1</span>/row, <span class="Constant">6</span>/col
|
||||
<span id="L1275" class="LineNr">1275 </span> <span class="PreProc">var</span> c/eax: grapheme <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L1276" class="LineNr">1276 </span> <a href='405screen.mu.html#L214'>print-grapheme</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1275" class="LineNr">1275 </span> <span class="PreProc">var</span> c/eax: code-point-utf8 <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L1276" class="LineNr">1276 </span> <a href='405screen.mu.html#L214'>print-code-point-utf8</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1277" class="LineNr">1277 </span> <span class="muComment"># top row is empty</span>
|
||||
<span id="L1278" class="LineNr">1278 </span> <a href='405screen.mu.html#L627'>check-screen-row</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">1</span>/row, <span class="Constant">" "</span>, <span class="Constant">"F - test-move-cursor-column-too-large-saturates"</span> <span class="muComment"># top-left corner of the screen</span>
|
||||
<span id="L1279" class="LineNr">1279 </span> <span class="muComment"># character shows up at the start of next row</span>
|
||||
|
@ -1350,8 +1350,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L1285" class="LineNr">1285 </span> <span class="PreProc">var</span> <a href='405screen.mu.html#L9'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='405screen.mu.html#L9'>screen</a>) <span class="Special"><-</span> address screen-on-stack
|
||||
<span id="L1286" class="LineNr">1286 </span> <a href='405screen.mu.html#L30'>initialize-screen</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">5</span>/rows, <span class="Constant">3</span>/cols
|
||||
<span id="L1287" class="LineNr">1287 </span> <a href='405screen.mu.html#L109'>move-cursor</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">6</span>/row, <span class="Constant">2</span>/col
|
||||
<span id="L1288" class="LineNr">1288 </span> <span class="PreProc">var</span> c/eax: grapheme <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L1289" class="LineNr">1289 </span> <a href='405screen.mu.html#L214'>print-grapheme</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1288" class="LineNr">1288 </span> <span class="PreProc">var</span> c/eax: code-point-utf8 <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L1289" class="LineNr">1289 </span> <a href='405screen.mu.html#L214'>print-code-point-utf8</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1290" class="LineNr">1290 </span> <span class="muComment"># bottom row shows the character</span>
|
||||
<span id="L1291" class="LineNr">1291 </span> <a href='405screen.mu.html#L627'>check-screen-row</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">5</span>/row, <span class="Constant">" a"</span>, <span class="Constant">"F - test-move-cursor-row-too-large"</span>
|
||||
<span id="L1292" class="LineNr">1292 </span><span class="Delimiter">}</span>
|
||||
|
@ -1361,8 +1361,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L1296" class="LineNr">1296 </span> <span class="PreProc">var</span> <a href='405screen.mu.html#L9'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='405screen.mu.html#L9'>screen</a>) <span class="Special"><-</span> address screen-on-stack
|
||||
<span id="L1297" class="LineNr">1297 </span> <a href='405screen.mu.html#L30'>initialize-screen</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">5</span>/rows, <span class="Constant">3</span>/cols
|
||||
<span id="L1298" class="LineNr">1298 </span> <a href='405screen.mu.html#L109'>move-cursor</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">9</span>/row, <span class="Constant">2</span>/col
|
||||
<span id="L1299" class="LineNr">1299 </span> <span class="PreProc">var</span> c/eax: grapheme <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L1300" class="LineNr">1300 </span> <a href='405screen.mu.html#L214'>print-grapheme</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1299" class="LineNr">1299 </span> <span class="PreProc">var</span> c/eax: code-point-utf8 <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L1300" class="LineNr">1300 </span> <a href='405screen.mu.html#L214'>print-code-point-utf8</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1301" class="LineNr">1301 </span> <span class="muComment"># bottom row shows the character</span>
|
||||
<span id="L1302" class="LineNr">1302 </span> <a href='405screen.mu.html#L627'>check-screen-row</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">5</span>/row, <span class="Constant">" a"</span>, <span class="Constant">"F - test-move-cursor-row-too-large-saturates"</span>
|
||||
<span id="L1303" class="LineNr">1303 </span><span class="Delimiter">}</span>
|
||||
|
@ -1372,8 +1372,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L1307" class="LineNr">1307 </span> <span class="PreProc">var</span> <a href='405screen.mu.html#L9'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='405screen.mu.html#L9'>screen</a>) <span class="Special"><-</span> address screen-on-stack
|
||||
<span id="L1308" class="LineNr">1308 </span> <a href='405screen.mu.html#L30'>initialize-screen</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">5</span>/rows, <span class="Constant">4</span>/cols
|
||||
<span id="L1309" class="LineNr">1309 </span> <a href='405screen.mu.html#L109'>move-cursor</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">1</span>, <span class="Constant">4</span>
|
||||
<span id="L1310" class="LineNr">1310 </span> <span class="PreProc">var</span> c/eax: grapheme <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L1311" class="LineNr">1311 </span> <a href='405screen.mu.html#L214'>print-grapheme</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1310" class="LineNr">1310 </span> <span class="PreProc">var</span> c/eax: code-point-utf8 <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L1311" class="LineNr">1311 </span> <a href='405screen.mu.html#L214'>print-code-point-utf8</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1312" class="LineNr">1312 </span> <a href='405screen.mu.html#L627'>check-screen-row</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">1</span>/row, <span class="Constant">" a"</span>, <span class="Constant">"F - <a href='405screen.mu.html#L1305'>test-check-screen-row-from</a>/baseline"</span>
|
||||
<span id="L1313" class="LineNr">1313 </span> <a href='405screen.mu.html#L631'>check-screen-row-from</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">1</span>/row, <span class="Constant">4</span>/col, <span class="Constant">"a"</span>, <span class="Constant">"F - test-check-screen-row-from"</span>
|
||||
<span id="L1314" class="LineNr">1314 </span><span class="Delimiter">}</span>
|
||||
|
@ -1393,8 +1393,8 @@ if ('onhashchange' in window) {
|
|||
<span id="L1328" class="LineNr">1328 </span> <a href='405screen.mu.html#L30'>initialize-screen</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">5</span>/rows, <span class="Constant">4</span>/cols
|
||||
<span id="L1329" class="LineNr">1329 </span> <span class="muComment"># single character starting at bottom right</span>
|
||||
<span id="L1330" class="LineNr">1330 </span> <a href='405screen.mu.html#L109'>move-cursor</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">5</span>/rows, <span class="Constant">4</span>/cols
|
||||
<span id="L1331" class="LineNr">1331 </span> <span class="PreProc">var</span> c/eax: grapheme <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L1332" class="LineNr">1332 </span> <a href='405screen.mu.html#L214'>print-grapheme</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1331" class="LineNr">1331 </span> <span class="PreProc">var</span> c/eax: code-point-utf8 <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L1332" class="LineNr">1332 </span> <a href='405screen.mu.html#L214'>print-code-point-utf8</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1333" class="LineNr">1333 </span> <a href='405screen.mu.html#L631'>check-screen-row-from</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">5</span>/row, <span class="Constant">4</span>/col, <span class="Constant">"a"</span>, <span class="Constant">"F - <a href='405screen.mu.html#L1325'>test-check-screen-scrolls-on-overflow</a>/baseline"</span> <span class="muComment"># bottom-right corner of the screen</span>
|
||||
<span id="L1334" class="LineNr">1334 </span> <span class="muComment"># multiple characters starting at bottom right</span>
|
||||
<span id="L1335" class="LineNr">1335 </span> <a href='405screen.mu.html#L109'>move-cursor</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">5</span>, <span class="Constant">4</span>
|
||||
|
@ -1413,14 +1413,14 @@ if ('onhashchange' in window) {
|
|||
<span id="L1348" class="LineNr">1348 </span> <span class="PreProc">var</span> screen-on-stack: <a href='405screen.mu.html#L9'>screen</a>
|
||||
<span id="L1349" class="LineNr">1349 </span> <span class="PreProc">var</span> <a href='405screen.mu.html#L9'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='405screen.mu.html#L9'>screen</a>) <span class="Special"><-</span> address screen-on-stack
|
||||
<span id="L1350" class="LineNr">1350 </span> <a href='405screen.mu.html#L30'>initialize-screen</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">5</span>/rows, <span class="Constant">4</span>/cols
|
||||
<span id="L1351" class="LineNr">1351 </span> <span class="PreProc">var</span> c/eax: grapheme <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L1352" class="LineNr">1352 </span> <a href='405screen.mu.html#L214'>print-grapheme</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1351" class="LineNr">1351 </span> <span class="PreProc">var</span> c/eax: code-point-utf8 <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L1352" class="LineNr">1352 </span> <a href='405screen.mu.html#L214'>print-code-point-utf8</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1353" class="LineNr">1353 </span> <a href='405screen.mu.html#L523'>start-color</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">1</span>/fg, <span class="Constant">0</span>/bg
|
||||
<span id="L1354" class="LineNr">1354 </span> c <span class="Special"><-</span> copy <span class="Constant">0x62</span>/b
|
||||
<span id="L1355" class="LineNr">1355 </span> <a href='405screen.mu.html#L214'>print-grapheme</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1355" class="LineNr">1355 </span> <a href='405screen.mu.html#L214'>print-code-point-utf8</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1356" class="LineNr">1356 </span> <a href='405screen.mu.html#L523'>start-color</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">0</span>/fg, <span class="Constant">7</span>/bg
|
||||
<span id="L1357" class="LineNr">1357 </span> c <span class="Special"><-</span> copy <span class="Constant">0x63</span>/c
|
||||
<span id="L1358" class="LineNr">1358 </span> <a href='405screen.mu.html#L214'>print-grapheme</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1358" class="LineNr">1358 </span> <a href='405screen.mu.html#L214'>print-code-point-utf8</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1359" class="LineNr">1359 </span> <a href='405screen.mu.html#L681'>check-screen-row-in-color</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">0</span>/fg, <span class="Constant">1</span>/row, <span class="Constant">"a c"</span>, <span class="Constant">"F - test-check-screen-color"</span>
|
||||
<span id="L1360" class="LineNr">1360 </span><span class="Delimiter">}</span>
|
||||
<span id="L1361" class="LineNr">1361 </span>
|
||||
|
@ -1428,14 +1428,14 @@ if ('onhashchange' in window) {
|
|||
<span id="L1363" class="LineNr">1363 </span> <span class="PreProc">var</span> screen-on-stack: <a href='405screen.mu.html#L9'>screen</a>
|
||||
<span id="L1364" class="LineNr">1364 </span> <span class="PreProc">var</span> <a href='405screen.mu.html#L9'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='405screen.mu.html#L9'>screen</a>) <span class="Special"><-</span> address screen-on-stack
|
||||
<span id="L1365" class="LineNr">1365 </span> <a href='405screen.mu.html#L30'>initialize-screen</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">5</span>/rows, <span class="Constant">4</span>/cols
|
||||
<span id="L1366" class="LineNr">1366 </span> <span class="PreProc">var</span> c/eax: grapheme <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L1367" class="LineNr">1367 </span> <a href='405screen.mu.html#L214'>print-grapheme</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1366" class="LineNr">1366 </span> <span class="PreProc">var</span> c/eax: code-point-utf8 <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L1367" class="LineNr">1367 </span> <a href='405screen.mu.html#L214'>print-code-point-utf8</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1368" class="LineNr">1368 </span> <a href='405screen.mu.html#L523'>start-color</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">0</span>/fg, <span class="Constant">1</span>/bg
|
||||
<span id="L1369" class="LineNr">1369 </span> c <span class="Special"><-</span> copy <span class="Constant">0x62</span>/b
|
||||
<span id="L1370" class="LineNr">1370 </span> <a href='405screen.mu.html#L214'>print-grapheme</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1370" class="LineNr">1370 </span> <a href='405screen.mu.html#L214'>print-code-point-utf8</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1371" class="LineNr">1371 </span> <a href='405screen.mu.html#L523'>start-color</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">0</span>/fg, <span class="Constant">7</span>/bg
|
||||
<span id="L1372" class="LineNr">1372 </span> c <span class="Special"><-</span> copy <span class="Constant">0x63</span>/c
|
||||
<span id="L1373" class="LineNr">1373 </span> <a href='405screen.mu.html#L214'>print-grapheme</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1373" class="LineNr">1373 </span> <a href='405screen.mu.html#L214'>print-code-point-utf8</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1374" class="LineNr">1374 </span> <a href='405screen.mu.html#L768'>check-screen-row-in-background-color</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">7</span>/bg, <span class="Constant">1</span>/row, <span class="Constant">"a c"</span>, <span class="Constant">"F - test-check-screen-background-color"</span>
|
||||
<span id="L1375" class="LineNr">1375 </span><span class="Delimiter">}</span>
|
||||
<span id="L1376" class="LineNr">1376 </span>
|
||||
|
@ -1444,14 +1444,14 @@ if ('onhashchange' in window) {
|
|||
<span id="L1379" class="LineNr">1379 </span> <span class="PreProc">var</span> <a href='405screen.mu.html#L9'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='405screen.mu.html#L9'>screen</a>) <span class="Special"><-</span> address screen-on-stack
|
||||
<span id="L1380" class="LineNr">1380 </span> <a href='405screen.mu.html#L30'>initialize-screen</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">5</span>/rows, <span class="Constant">4</span>/cols
|
||||
<span id="L1381" class="LineNr">1381 </span> <a href='405screen.mu.html#L541'>start-bold</a> <a href='405screen.mu.html#L9'>screen</a>
|
||||
<span id="L1382" class="LineNr">1382 </span> <span class="PreProc">var</span> c/eax: grapheme <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L1383" class="LineNr">1383 </span> <a href='405screen.mu.html#L214'>print-grapheme</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1382" class="LineNr">1382 </span> <span class="PreProc">var</span> c/eax: code-point-utf8 <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L1383" class="LineNr">1383 </span> <a href='405screen.mu.html#L214'>print-code-point-utf8</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1384" class="LineNr">1384 </span> <a href='405screen.mu.html#L506'>reset-formatting</a> <a href='405screen.mu.html#L9'>screen</a>
|
||||
<span id="L1385" class="LineNr">1385 </span> c <span class="Special"><-</span> copy <span class="Constant">0x62</span>/b
|
||||
<span id="L1386" class="LineNr">1386 </span> <a href='405screen.mu.html#L214'>print-grapheme</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1386" class="LineNr">1386 </span> <a href='405screen.mu.html#L214'>print-code-point-utf8</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1387" class="LineNr">1387 </span> <a href='405screen.mu.html#L541'>start-bold</a> <a href='405screen.mu.html#L9'>screen</a>
|
||||
<span id="L1388" class="LineNr">1388 </span> c <span class="Special"><-</span> copy <span class="Constant">0x63</span>/c
|
||||
<span id="L1389" class="LineNr">1389 </span> <a href='405screen.mu.html#L214'>print-grapheme</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1389" class="LineNr">1389 </span> <a href='405screen.mu.html#L214'>print-code-point-utf8</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1390" class="LineNr">1390 </span> <a href='405screen.mu.html#L853'>check-screen-row-in-bold</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">1</span>/row, <span class="Constant">"a c"</span>, <span class="Constant">"F - test-check-screen-bold"</span>
|
||||
<span id="L1391" class="LineNr">1391 </span><span class="Delimiter">}</span>
|
||||
<span id="L1392" class="LineNr">1392 </span>
|
||||
|
@ -1460,14 +1460,14 @@ if ('onhashchange' in window) {
|
|||
<span id="L1395" class="LineNr">1395 </span> <span class="PreProc">var</span> <a href='405screen.mu.html#L9'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='405screen.mu.html#L9'>screen</a>) <span class="Special"><-</span> address screen-on-stack
|
||||
<span id="L1396" class="LineNr">1396 </span> <a href='405screen.mu.html#L30'>initialize-screen</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">5</span>/rows, <span class="Constant">4</span>/cols
|
||||
<span id="L1397" class="LineNr">1397 </span> <a href='405screen.mu.html#L555'>start-underline</a> <a href='405screen.mu.html#L9'>screen</a>
|
||||
<span id="L1398" class="LineNr">1398 </span> <span class="PreProc">var</span> c/eax: grapheme <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L1399" class="LineNr">1399 </span> <a href='405screen.mu.html#L214'>print-grapheme</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1398" class="LineNr">1398 </span> <span class="PreProc">var</span> c/eax: code-point-utf8 <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L1399" class="LineNr">1399 </span> <a href='405screen.mu.html#L214'>print-code-point-utf8</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1400" class="LineNr">1400 </span> <a href='405screen.mu.html#L506'>reset-formatting</a> <a href='405screen.mu.html#L9'>screen</a>
|
||||
<span id="L1401" class="LineNr">1401 </span> c <span class="Special"><-</span> copy <span class="Constant">0x62</span>/b
|
||||
<span id="L1402" class="LineNr">1402 </span> <a href='405screen.mu.html#L214'>print-grapheme</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1402" class="LineNr">1402 </span> <a href='405screen.mu.html#L214'>print-code-point-utf8</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1403" class="LineNr">1403 </span> <a href='405screen.mu.html#L555'>start-underline</a> <a href='405screen.mu.html#L9'>screen</a>
|
||||
<span id="L1404" class="LineNr">1404 </span> c <span class="Special"><-</span> copy <span class="Constant">0x63</span>/c
|
||||
<span id="L1405" class="LineNr">1405 </span> <a href='405screen.mu.html#L214'>print-grapheme</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1405" class="LineNr">1405 </span> <a href='405screen.mu.html#L214'>print-code-point-utf8</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1406" class="LineNr">1406 </span> <a href='405screen.mu.html#L934'>check-screen-row-in-underline</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">1</span>/row, <span class="Constant">"a c"</span>, <span class="Constant">"F - test-check-screen-underline"</span>
|
||||
<span id="L1407" class="LineNr">1407 </span><span class="Delimiter">}</span>
|
||||
<span id="L1408" class="LineNr">1408 </span>
|
||||
|
@ -1476,14 +1476,14 @@ if ('onhashchange' in window) {
|
|||
<span id="L1411" class="LineNr">1411 </span> <span class="PreProc">var</span> <a href='405screen.mu.html#L9'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='405screen.mu.html#L9'>screen</a>) <span class="Special"><-</span> address screen-on-stack
|
||||
<span id="L1412" class="LineNr">1412 </span> <a href='405screen.mu.html#L30'>initialize-screen</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">5</span>/rows, <span class="Constant">4</span>/cols
|
||||
<span id="L1413" class="LineNr">1413 </span> <a href='405screen.mu.html#L569'>start-reverse-video</a> <a href='405screen.mu.html#L9'>screen</a>
|
||||
<span id="L1414" class="LineNr">1414 </span> <span class="PreProc">var</span> c/eax: grapheme <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L1415" class="LineNr">1415 </span> <a href='405screen.mu.html#L214'>print-grapheme</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1414" class="LineNr">1414 </span> <span class="PreProc">var</span> c/eax: code-point-utf8 <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L1415" class="LineNr">1415 </span> <a href='405screen.mu.html#L214'>print-code-point-utf8</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1416" class="LineNr">1416 </span> <a href='405screen.mu.html#L506'>reset-formatting</a> <a href='405screen.mu.html#L9'>screen</a>
|
||||
<span id="L1417" class="LineNr">1417 </span> c <span class="Special"><-</span> copy <span class="Constant">0x62</span>/b
|
||||
<span id="L1418" class="LineNr">1418 </span> <a href='405screen.mu.html#L214'>print-grapheme</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1418" class="LineNr">1418 </span> <a href='405screen.mu.html#L214'>print-code-point-utf8</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1419" class="LineNr">1419 </span> <a href='405screen.mu.html#L569'>start-reverse-video</a> <a href='405screen.mu.html#L9'>screen</a>
|
||||
<span id="L1420" class="LineNr">1420 </span> c <span class="Special"><-</span> copy <span class="Constant">0x63</span>/c
|
||||
<span id="L1421" class="LineNr">1421 </span> <a href='405screen.mu.html#L214'>print-grapheme</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1421" class="LineNr">1421 </span> <a href='405screen.mu.html#L214'>print-code-point-utf8</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1422" class="LineNr">1422 </span> <a href='405screen.mu.html#L1015'>check-screen-row-in-reverse</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">1</span>/row, <span class="Constant">"a c"</span>, <span class="Constant">"F - test-check-screen-reverse"</span>
|
||||
<span id="L1423" class="LineNr">1423 </span><span class="Delimiter">}</span>
|
||||
<span id="L1424" class="LineNr">1424 </span>
|
||||
|
@ -1492,14 +1492,14 @@ if ('onhashchange' in window) {
|
|||
<span id="L1427" class="LineNr">1427 </span> <span class="PreProc">var</span> <a href='405screen.mu.html#L9'>screen</a>/<span class="muRegEsi">esi</span>: (addr <a href='405screen.mu.html#L9'>screen</a>) <span class="Special"><-</span> address screen-on-stack
|
||||
<span id="L1428" class="LineNr">1428 </span> <a href='405screen.mu.html#L30'>initialize-screen</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">5</span>/rows, <span class="Constant">4</span>/cols
|
||||
<span id="L1429" class="LineNr">1429 </span> <a href='405screen.mu.html#L583'>start-blinking</a> <a href='405screen.mu.html#L9'>screen</a>
|
||||
<span id="L1430" class="LineNr">1430 </span> <span class="PreProc">var</span> c/eax: grapheme <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L1431" class="LineNr">1431 </span> <a href='405screen.mu.html#L214'>print-grapheme</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1430" class="LineNr">1430 </span> <span class="PreProc">var</span> c/eax: code-point-utf8 <span class="Special"><-</span> copy <span class="Constant">0x61</span>/a
|
||||
<span id="L1431" class="LineNr">1431 </span> <a href='405screen.mu.html#L214'>print-code-point-utf8</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1432" class="LineNr">1432 </span> <a href='405screen.mu.html#L506'>reset-formatting</a> <a href='405screen.mu.html#L9'>screen</a>
|
||||
<span id="L1433" class="LineNr">1433 </span> c <span class="Special"><-</span> copy <span class="Constant">0x62</span>/b
|
||||
<span id="L1434" class="LineNr">1434 </span> <a href='405screen.mu.html#L214'>print-grapheme</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1434" class="LineNr">1434 </span> <a href='405screen.mu.html#L214'>print-code-point-utf8</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1435" class="LineNr">1435 </span> <a href='405screen.mu.html#L583'>start-blinking</a> <a href='405screen.mu.html#L9'>screen</a>
|
||||
<span id="L1436" class="LineNr">1436 </span> c <span class="Special"><-</span> copy <span class="Constant">0x63</span>/c
|
||||
<span id="L1437" class="LineNr">1437 </span> <a href='405screen.mu.html#L214'>print-grapheme</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1437" class="LineNr">1437 </span> <a href='405screen.mu.html#L214'>print-code-point-utf8</a> <a href='405screen.mu.html#L9'>screen</a>, c
|
||||
<span id="L1438" class="LineNr">1438 </span> <a href='405screen.mu.html#L1096'>check-screen-row-in-blinking</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">1</span>/row, <span class="Constant">"a c"</span>, <span class="Constant">"F - test-check-screen-blinking"</span>
|
||||
<span id="L1439" class="LineNr">1439 </span><span class="Delimiter">}</span>
|
||||
<span id="L1440" class="LineNr">1440 </span>
|
||||
|
|
|
@ -15,12 +15,12 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.PreProc { color: #c000c0; }
|
||||
.Special { color: #ff6060; }
|
||||
.LineNr { }
|
||||
.Constant { color: #008787; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muComment { color: #005faf; }
|
||||
.Special { color: #ff6060; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
|
|
@ -15,13 +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: #870000; }
|
||||
.Special { color: #ff6060; }
|
||||
.LineNr { }
|
||||
.Constant { color: #008787; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muRegEcx { color: #870000; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muComment { color: #005faf; }
|
||||
.Special { color: #ff6060; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
@ -65,7 +65,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L6" class="LineNr"> 6 </span> <span class="Delimiter">{</span>
|
||||
<span id="L7" class="LineNr"> 7 </span> compare n-width, width
|
||||
<span id="L8" class="LineNr"> 8 </span> <span class="PreProc">break-if->=</span>
|
||||
<span id="L9" class="LineNr"> 9 </span> <a href='405screen.mu.html#L214'>print-grapheme</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">0x20</span>/space
|
||||
<span id="L9" class="LineNr"> 9 </span> <a href='405screen.mu.html#L214'>print-code-point-utf8</a> <a href='405screen.mu.html#L9'>screen</a>, <span class="Constant">0x20</span>/space
|
||||
<span id="L10" class="LineNr">10 </span> width <span class="Special"><-</span> decrement
|
||||
<span id="L11" class="LineNr">11 </span> <span class="PreProc">loop</span>
|
||||
<span id="L12" class="LineNr">12 </span> <span class="Delimiter">}</span>
|
||||
|
|
|
@ -15,13 +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; }
|
||||
.LineNr { }
|
||||
.muRegEdi { color: #00af00; }
|
||||
.Constant { color: #008787; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muComment { color: #005faf; }
|
||||
.Special { color: #ff6060; }
|
||||
.LineNr { }
|
||||
.Constant { color: #008787; }
|
||||
.muRegEdi { color: #00af00; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muComment { color: #005faf; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
|
|
@ -15,18 +15,18 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.PreProc { color: #c000c0; }
|
||||
.muRegEbx { color: #5f00ff; }
|
||||
.muRegEcx { color: #870000; }
|
||||
.muRegEdx { color: #af5f00; }
|
||||
.LineNr { }
|
||||
.muRegEsi { color: #005faf; }
|
||||
.CommentedCode { color: #8a8a8a; }
|
||||
.Constant { color: #008787; }
|
||||
.CommentedCode { color: #8a8a8a; }
|
||||
.muRegEbx { color: #5f00ff; }
|
||||
.muRegEsi { color: #005faf; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muTest { color: #5f8700; }
|
||||
.muRegEcx { color: #870000; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muComment { color: #005faf; }
|
||||
.Special { color: #ff6060; }
|
||||
.muTest { color: #5f8700; }
|
||||
.muComment { color: #005faf; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
|
|
@ -17,12 +17,12 @@ a { color:inherit; }
|
|||
.PreProc { color: #c000c0; }
|
||||
.LineNr { }
|
||||
.muRegEsi { color: #005faf; }
|
||||
.muRegEdi { color: #00af00; }
|
||||
.Constant { color: #008787; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.Special { color: #ff6060; }
|
||||
.muRegEdi { color: #00af00; }
|
||||
.CommentedCode { color: #8a8a8a; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.Special { color: #ff6060; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
|
|
@ -15,17 +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; }
|
||||
.CommentedCode { color: #8a8a8a; }
|
||||
.muRegEcx { color: #870000; }
|
||||
.Special { color: #ff6060; }
|
||||
.LineNr { }
|
||||
.muRegEsi { color: #005faf; }
|
||||
.muRegEdi { color: #00af00; }
|
||||
.Constant { color: #008787; }
|
||||
.muRegEdi { color: #00af00; }
|
||||
.CommentedCode { color: #8a8a8a; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muTest { color: #5f8700; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muComment { color: #005faf; }
|
||||
.Special { color: #ff6060; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
@ -61,7 +61,7 @@ if ('onhashchange' in window) {
|
|||
<body onload='JumpToLine();'>
|
||||
<a href='https://github.com/akkartik/mu/blob/main/linux/411string.mu'>https://github.com/akkartik/mu/blob/main/linux/411string.mu</a>
|
||||
<pre id='vimCodeElement'>
|
||||
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># read up to 'len' graphemes after skipping the first 'start' ones</span>
|
||||
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># read up to 'len' code-point-utf8s 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="muRegEsi">esi</span>: (addr stream byte) <span class="Special"><-</span> address in-stream
|
||||
|
@ -69,29 +69,29 @@ if ('onhashchange' in window) {
|
|||
<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="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="L9" class="LineNr"> 9 </span> <span class="muComment"># skip 'start' code-point-utf8s</span>
|
||||
<span id="L10" class="LineNr"> 10 </span> <span class="PreProc">var</span> i/eax: 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/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L158'>read-grapheme</a> in-stream-addr
|
||||
<span id="L15" class="LineNr"> 15 </span> <span class="PreProc">var</span> dummy/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L155'>read-code-point-utf8</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>
|
||||
<span id="L19" class="LineNr"> 19 </span> i <span class="Special"><-</span> increment
|
||||
<span id="L20" class="LineNr"> 20 </span> <span class="PreProc">loop</span>
|
||||
<span id="L21" class="LineNr"> 21 </span> <span class="Delimiter">}</span>
|
||||
<span id="L22" class="LineNr"> 22 </span> <span class="muComment"># copy 'len' graphemes</span>
|
||||
<span id="L22" class="LineNr"> 22 </span> <span class="muComment"># copy 'len' code-point-utf8s</span>
|
||||
<span id="L23" class="LineNr"> 23 </span> i <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L24" class="LineNr"> 24 </span> <span class="Delimiter">{</span>
|
||||
<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/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L158'>read-grapheme</a> in-stream-addr
|
||||
<span id="L28" class="LineNr"> 28 </span> <span class="PreProc">var</span> g/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L155'>read-code-point-utf8</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#L372'>write-grapheme</a> out-stream-addr, g
|
||||
<span id="L31" class="LineNr"> 31 </span> <a href='403unicode.mu.html#L369'>write-code-point-utf8</a> out-stream-addr, g
|
||||
<span id="L32" class="LineNr"> 32 </span> <span class="Delimiter">}</span>
|
||||
<span id="L33" class="LineNr"> 33 </span> i <span class="Special"><-</span> increment
|
||||
<span id="L34" class="LineNr"> 34 </span> <span class="PreProc">loop</span>
|
||||
|
@ -148,7 +148,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L85" class="LineNr"> 85 </span> <a href='105string-equal.subx.html#L220'>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="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: code-point-utf8, 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="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#L24'>write</a> in-stream-addr, in
|
||||
|
@ -157,10 +157,10 @@ if ('onhashchange' in window) {
|
|||
<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="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/eax: grapheme <span class="Special"><-</span> <a href='403unicode.mu.html#L158'>read-grapheme</a> in-stream-addr
|
||||
<span id="L97" class="LineNr"> 97 </span> <span class="PreProc">var</span> g/eax: code-point-utf8 <span class="Special"><-</span> <a href='403unicode.mu.html#L155'>read-code-point-utf8</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>
|
||||
<span id="L100" class="LineNr">100 </span><span class="CommentedCode">#? print-code-point-utf8-to-real-screen g</span>
|
||||
<span id="L101" class="LineNr">101 </span><span class="CommentedCode">#? print-string-to-real-screen "\n"</span>
|
||||
<span id="L102" class="LineNr">102 </span> compare g, delim
|
||||
<span id="L103" class="LineNr">103 </span> <span class="Delimiter">{</span>
|
||||
|
@ -173,7 +173,7 @@ if ('onhashchange' in window) {
|
|||
<span id="L110" class="LineNr">110 </span> <a href='106stream.subx.html#L17'>clear-stream</a> curr-stream-addr
|
||||
<span id="L111" class="LineNr">111 </span> <span class="PreProc">loop</span> $split-string:core
|
||||
<span id="L112" class="LineNr">112 </span> <span class="Delimiter">}</span>
|
||||
<span id="L113" class="LineNr">113 </span> <a href='403unicode.mu.html#L372'>write-grapheme</a> curr-stream-addr, g
|
||||
<span id="L113" class="LineNr">113 </span> <a href='403unicode.mu.html#L369'>write-code-point-utf8</a> curr-stream-addr, g
|
||||
<span id="L114" class="LineNr">114 </span> <span class="PreProc">loop</span>
|
||||
<span id="L115" class="LineNr">115 </span> <span class="Delimiter">}</span>
|
||||
<span id="L116" class="LineNr">116 </span> <a href='310copy-bytes.subx.html#L60'>stream-to-array</a> tokens-stream-addr, out
|
||||
|
|
|
@ -15,18 +15,18 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color:
|
|||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.PreProc { color: #c000c0; }
|
||||
.muRegEbx { color: #5f00ff; }
|
||||
.muRegEcx { color: #870000; }
|
||||
.muRegEdx { color: #af5f00; }
|
||||
.LineNr { }
|
||||
.muRegEsi { color: #005faf; }
|
||||
.muRegEdi { color: #00af00; }
|
||||
.muRegEsi { color: #005faf; }
|
||||
.muRegEbx { color: #5f00ff; }
|
||||
.Constant { color: #008787; }
|
||||
.muFunction { color: #af5f00; text-decoration: underline; }
|
||||
.muTest { color: #5f8700; }
|
||||
.muRegEcx { color: #870000; }
|
||||
.Delimiter { color: #c000c0; }
|
||||
.muComment { color: #005faf; }
|
||||
.Special { color: #ff6060; }
|
||||
.muTest { color: #5f8700; }
|
||||
.muComment { color: #005faf; }
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
|
|
@ -1,131 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<title>Mu - linux/advent2017/1a.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-light">
|
||||
<style type="text/css">
|
||||
<!--
|
||||
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
|
||||
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
|
||||
a { color:inherit; }
|
||||
* { font-size:12pt; font-size: 1em; }
|
||||
.PreProc { color: #c000c0; }
|
||||
.muRegEdx { color: #af5f00; }
|
||||
.Special { color: #ff6060; }
|
||||
.LineNr { }
|
||||
.muRegEsi { color: #005faf; }
|
||||
.muRegEbx { color: #5f00ff; }
|
||||
.Constant { color: #008787; }
|
||||
.muRegEdi { color: #00af00; }
|
||||
.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/linux/advent2017/1a.mu'>https://github.com/akkartik/mu/blob/main/linux/advent2017/1a.mu</a>
|
||||
<pre id='vimCodeElement'>
|
||||
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># Advent of code 2017, problem 1a</span>
|
||||
<span id="L2" class="LineNr"> 2 </span><span class="muComment"># <a href="https://adventofcode.com/2017/day/1">https://adventofcode.com/2017/day/1</a></span>
|
||||
<span id="L3" class="LineNr"> 3 </span><span class="muComment">#</span>
|
||||
<span id="L4" class="LineNr"> 4 </span><span class="muComment"># Mu solution by Sumeet Agarwal and Kartik Agaram</span>
|
||||
<span id="L5" class="LineNr"> 5 </span><span class="muComment"># <a href="https://archive.org/details/2021-06-02-akkartik-sumeet">https://archive.org/details/2021-06-02-akkartik-sumeet</a></span>
|
||||
<span id="L6" class="LineNr"> 6 </span><span class="muComment">#</span>
|
||||
<span id="L7" class="LineNr"> 7 </span><span class="muComment"># To build on Linux:</span>
|
||||
<span id="L8" class="LineNr"> 8 </span><span class="muComment"># $ git clone <a href="https://github.com/akkartik/mu">https://github.com/akkartik/mu</a></span>
|
||||
<span id="L9" class="LineNr"> 9 </span><span class="muComment"># $ cd mu/linux</span>
|
||||
<span id="L10" class="LineNr">10 </span><span class="muComment"># $ ./translate advent2017/1a.mu # emits a.elf</span>
|
||||
<span id="L11" class="LineNr">11 </span><span class="muComment"># To run on Linux:</span>
|
||||
<span id="L12" class="LineNr">12 </span><span class="muComment"># Download <a href="https://adventofcode.com/2017/day/1/input">https://adventofcode.com/2017/day/1/input</a></span>
|
||||
<span id="L13" class="LineNr">13 </span><span class="muComment"># $ ./a.elf < input</span>
|
||||
<span id="L14" class="LineNr">14 </span><span class="muComment"># Type in the number returned at <a href="https://adventofcode.com/2017/day/1">https://adventofcode.com/2017/day/1</a></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='1a.mu.html#L16'>main</a></span><span class="PreProc"> -> </span>_/<span class="muRegEbx">ebx</span>: int <span class="Delimiter">{</span>
|
||||
<span id="L17" class="LineNr">17 </span> <span class="PreProc">var</span> input_stream: (stream byte <span class="Constant">0x8000</span>)
|
||||
<span id="L18" class="LineNr">18 </span> <span class="PreProc">var</span> input_stream_addr/<span class="muRegEsi">esi</span>: (addr stream byte) <span class="Special"><-</span> address input_stream
|
||||
<span id="L19" class="LineNr">19 </span>
|
||||
<span id="L20" class="LineNr">20 </span> <span class="PreProc">var</span> sum/<span class="muRegEdi">edi</span>: int <span class="Special"><-</span> copy <span class="Constant">0</span>
|
||||
<span id="L21" class="LineNr">21 </span> <a href='../305keyboard.subx.html#L158'>read-line-from-real-keyboard</a> input_stream_addr
|
||||
<span id="L22" class="LineNr">22 </span>
|
||||
<span id="L23" class="LineNr">23 </span> <span class="PreProc">var</span> temp/eax: int <span class="Special"><-</span> <a href='1a.mu.html#L60'>read_digit</a> input_stream_addr
|
||||
<span id="L24" class="LineNr">24 </span> <span class="PreProc">var</span> first_digit/<span class="muRegEbx">ebx</span>: int <span class="Special"><-</span> copy temp
|
||||
<span id="L25" class="LineNr">25 </span> <span class="PreProc">var</span> this_digit/<span class="muRegEdx">edx</span>: int <span class="Special"><-</span> copy temp
|
||||
<span id="L26" class="LineNr">26 </span>
|
||||
<span id="L27" class="LineNr">27 </span> <span class="Delimiter">{</span>
|
||||
<span id="L28" class="LineNr">28 </span> <span class="PreProc">var</span> done?/eax: boolean <span class="Special"><-</span> <a href='../309stream.subx.html#L6'>stream-empty?</a> input_stream_addr
|
||||
<span id="L29" class="LineNr">29 </span> compare done?, <span class="Constant">1</span>
|
||||
<span id="L30" class="LineNr">30 </span> <span class="PreProc">break-if-=</span>
|
||||
<span id="L31" class="LineNr">31 </span>
|
||||
<span id="L32" class="LineNr">32 </span> <span class="PreProc">var</span> next_digit/eax: int <span class="Special"><-</span> <a href='1a.mu.html#L60'>read_digit</a> input_stream_addr
|
||||
<span id="L33" class="LineNr">33 </span> <span class="muComment"># hacky newline check</span>
|
||||
<span id="L34" class="LineNr">34 </span> compare next_digit, <span class="Constant">0</span>
|
||||
<span id="L35" class="LineNr">35 </span> <span class="PreProc">break-if-<</span>
|
||||
<span id="L36" class="LineNr">36 </span>
|
||||
<span id="L37" class="LineNr">37 </span> <span class="Delimiter">{</span>
|
||||
<span id="L38" class="LineNr">38 </span> compare this_digit, next_digit
|
||||
<span id="L39" class="LineNr">39 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L40" class="LineNr">40 </span> sum <span class="Special"><-</span> add this_digit
|
||||
<span id="L41" class="LineNr">41 </span> <span class="Delimiter">}</span>
|
||||
<span id="L42" class="LineNr">42 </span>
|
||||
<span id="L43" class="LineNr">43 </span> this_digit <span class="Special"><-</span> copy next_digit
|
||||
<span id="L44" class="LineNr">44 </span>
|
||||
<span id="L45" class="LineNr">45 </span> <span class="PreProc">loop</span>
|
||||
<span id="L46" class="LineNr">46 </span> <span class="Delimiter">}</span>
|
||||
<span id="L47" class="LineNr">47 </span>
|
||||
<span id="L48" class="LineNr">48 </span> <span class="muComment"># the last iteration will need to compare the last number to the first</span>
|
||||
<span id="L49" class="LineNr">49 </span> <span class="Delimiter">{</span>
|
||||
<span id="L50" class="LineNr">50 </span> compare this_digit, first_digit
|
||||
<span id="L51" class="LineNr">51 </span> <span class="PreProc">break-if-!=</span>
|
||||
<span id="L52" class="LineNr">52 </span> sum <span class="Special"><-</span> add this_digit
|
||||
<span id="L53" class="LineNr">53 </span> <span class="Delimiter">}</span>
|
||||
<span id="L54" class="LineNr">54 </span>
|
||||
<span id="L55" class="LineNr">55 </span> <a href='../405screen.mu.html#L484'>print-int32-decimal</a> <span class="Constant">0</span>, sum
|
||||
<span id="L56" class="LineNr">56 </span>
|
||||
<span id="L57" class="LineNr">57 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/ok
|
||||
<span id="L58" class="LineNr">58 </span><span class="Delimiter">}</span>
|
||||
<span id="L59" class="LineNr">59 </span>
|
||||
<span id="L60" class="LineNr">60 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='1a.mu.html#L60'>read_digit</a></span> input_stream_addr: (addr stream byte)<span class="PreProc"> -> </span>_/eax: int <span class="Delimiter">{</span>
|
||||
<span id="L61" class="LineNr">61 </span> <span class="PreProc">var</span> next_digit/eax: byte <span class="Special"><-</span> <a href='../112read-byte.subx.html#L273'>read-byte</a> input_stream_addr
|
||||
<span id="L62" class="LineNr">62 </span> next_digit <span class="Special"><-</span> subtract <span class="Constant">0x30</span>
|
||||
<span id="L63" class="LineNr">63 </span> <span class="PreProc">var</span> next_digit/eax: int <span class="Special"><-</span> copy next_digit
|
||||
<span id="L64" class="LineNr">64 </span> <span class="PreProc">return</span> next_digit
|
||||
<span id="L65" class="LineNr">65 </span><span class="Delimiter">}</span>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
<!-- vim: set foldmethod=manual : -->
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue