diff options
author | Kartik Agaram <vc@akkartik.com> | 2020-01-27 00:39:46 -0800 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2020-01-27 00:39:46 -0800 |
commit | 2104d1a75b76dbffc0b15a96c98d94e7a16594e8 (patch) | |
tree | 2a839b86e76431a9bbe4bf155f7411171a26d7f8 /html/apps/assort.subx.html | |
parent | 71eb22a5bf94f5fa0a3c95212450e3c6a1a6a990 (diff) | |
download | mu-2104d1a75b76dbffc0b15a96c98d94e7a16594e8.tar.gz |
5925
Diffstat (limited to 'html/apps/assort.subx.html')
-rw-r--r-- | html/apps/assort.subx.html | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/html/apps/assort.subx.html b/html/apps/assort.subx.html index 662db279..6f2c21bd 100644 --- a/html/apps/assort.subx.html +++ b/html/apps/assort.subx.html @@ -122,7 +122,7 @@ if ('onhashchange' in window) { <span id="L60" class="LineNr"> 60 </span> eb/jump $subx-assort-main:end/disp8 <span id="L61" class="LineNr"> 61 </span><span class="Constant">$subx-assort-main:interactive</span>: <span id="L62" class="LineNr"> 62 </span> <span class="subxH1Comment"># - otherwise convert stdin</span> -<span id="L63" class="LineNr"> 63 </span> <span class="subxComment"># var ed/eax : exit-descriptor</span> +<span id="L63" class="LineNr"> 63 </span> <span class="subxComment"># var ed/eax: exit-descriptor</span> <span id="L64" class="LineNr"> 64 </span> 81 5/subop/subtract 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"># subtract from esp</span> <span id="L65" class="LineNr"> 65 </span> 89/copy 3/mod/direct 0/rm32/eax <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 eax</span> <span id="L66" class="LineNr"> 66 </span> <span class="subxComment"># configure ed to really exit()</span> @@ -148,9 +148,9 @@ if ('onhashchange' in window) { <span id="L86" class="LineNr"> 86 </span><span class="subxComment"># table: (addr stream {string, (addr stream byte)}) (8 bytes per row)</span> <span id="L87" class="LineNr"> 87 </span><span class="subxComment"># inefficient; uses sequential search for looking up segments by name</span> <span id="L88" class="LineNr"> 88 </span> -<span id="L89" class="LineNr"> 89 </span><span class="subxFunction">subx-assort</span>: <span class="subxComment"># in : (addr buffered-file), out : (addr buffered-file)</span> +<span id="L89" class="LineNr"> 89 </span><span class="subxFunction">subx-assort</span>: <span class="subxComment"># in: (addr buffered-file), out: (addr buffered-file)</span> <span id="L90" class="LineNr"> 90 </span> <span class="subxComment"># pseudocode:</span> -<span id="L91" class="LineNr"> 91 </span> <span class="subxComment"># var table : (addr stream {string, (addr stream byte)} 10/rows)</span> +<span id="L91" class="LineNr"> 91 </span> <span class="subxComment"># var table: (addr stream {string, (addr stream byte)} 10/rows)</span> <span id="L92" class="LineNr"> 92 </span> <span class="subxComment"># read-segments(in, table)</span> <span id="L93" class="LineNr"> 93 </span> <span class="subxComment"># write-segments(out, table)</span> <span id="L94" class="LineNr"> 94 </span> <span class="subxComment">#</span> @@ -159,7 +159,7 @@ if ('onhashchange' in window) { <span id="L97" class="LineNr"> 97 </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="L98" class="LineNr"> 98 </span> <span class="subxS1Comment"># . save registers</span> <span id="L99" class="LineNr"> 99 </span> 51/push-ecx -<span id="L100" class="LineNr">100 </span> <span class="subxComment"># var table/ecx : (stream {string, (addr stream byte)} 80) # 10 rows * 8 bytes/row</span> +<span id="L100" class="LineNr">100 </span> <span class="subxComment"># var table/ecx: (stream {string, (addr stream byte)} 80) # 10 rows * 8 bytes/row</span> <span id="L101" class="LineNr">101 </span> 81 5/subop/subtract 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> 0x50/imm32 <span class="subxComment"># subtract from esp</span> <span id="L102" class="LineNr">102 </span> 68/push 0x50/imm32/length <span id="L103" class="LineNr">103 </span> 68/push 0/imm32/read @@ -467,10 +467,10 @@ if ('onhashchange' in window) { <span id="L453" class="LineNr">453 </span><span class="subxComment"># type string_key = (addr array byte)</span> <span id="L454" class="LineNr">454 </span> <span id="L455" class="LineNr">455 </span><span class="subxComment"># beware: leaks memory (one name per segment read)</span> -<span id="L456" class="LineNr">456 </span><span class="subxFunction">read-segments</span>: <span class="subxComment"># in : (addr buffered-file), table : (addr stream {string_key, (handle stream byte)})</span> +<span id="L456" class="LineNr">456 </span><span class="subxFunction">read-segments</span>: <span class="subxComment"># in: (addr buffered-file), table: (addr stream {string_key, (handle stream byte)})</span> <span id="L457" class="LineNr">457 </span> <span class="subxComment"># pseudocode:</span> -<span id="L458" class="LineNr">458 </span> <span class="subxComment"># var curr-segment : (handle stream byte) = 0</span> -<span id="L459" class="LineNr">459 </span> <span class="subxComment"># var line : (stream byte 512)</span> +<span id="L458" class="LineNr">458 </span> <span class="subxComment"># var curr-segment: (handle stream byte) = 0</span> +<span id="L459" class="LineNr">459 </span> <span class="subxComment"># var line: (stream byte 512)</span> <span id="L460" class="LineNr">460 </span> <span class="subxComment"># while true</span> <span id="L461" class="LineNr">461 </span> <span class="subxComment"># clear-stream(line)</span> <span id="L462" class="LineNr">462 </span> <span class="subxComment"># read-line-buffered(in, line)</span> @@ -510,13 +510,13 @@ if ('onhashchange' in window) { <span id="L496" class="LineNr">496 </span> 52/push-edx <span id="L497" class="LineNr">497 </span> 53/push-ebx <span id="L498" class="LineNr">498 </span> 56/push-esi -<span id="L499" class="LineNr">499 </span> <span class="subxComment"># var line/ecx : (stream byte 512)</span> +<span id="L499" class="LineNr">499 </span> <span class="subxComment"># var line/ecx: (stream byte 512)</span> <span id="L500" class="LineNr">500 </span> 81 5/subop/subtract 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> 0x200/imm32 <span class="subxComment"># subtract from esp</span> <span id="L501" class="LineNr">501 </span> 68/push 0x200/imm32/length <span id="L502" class="LineNr">502 </span> 68/push 0/imm32/read <span id="L503" class="LineNr">503 </span> 68/push 0/imm32/write <span id="L504" class="LineNr">504 </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="L505" class="LineNr">505 </span> <span class="subxComment"># var word-slice/edx : slice</span> +<span id="L505" class="LineNr">505 </span> <span class="subxComment"># var word-slice/edx: slice</span> <span id="L506" class="LineNr">506 </span> 68/push 0/imm32/end <span id="L507" class="LineNr">507 </span> 68/push 0/imm32/start <span id="L508" class="LineNr">508 </span> 89/copy 3/mod/direct 2/rm32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to edx</span> @@ -565,9 +565,9 @@ if ('onhashchange' in window) { <span id="L591" class="LineNr">591 </span><span class="Constant">$read-segments:check-for-comment</span>: <span id="L592" class="Folded">592 </span><span class="Folded">+-- 9 lines: #? # print("check for comment\n") ----------------------------------------------------------------------------------------------------------</span> <span id="L601" class="LineNr">601 </span> <span class="subxComment"># if (slice-starts-with?(word-slice, "#")) continue</span> -<span id="L602" class="LineNr">602 </span> <span class="subxS1Comment"># . var start/esi : (addr byte) = word-slice->start</span> +<span id="L602" class="LineNr">602 </span> <span class="subxS1Comment"># . var start/esi: (addr byte) = word-slice->start</span> <span id="L603" class="LineNr">603 </span> 8b/copy 0/mod/indirect 2/rm32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *ecx to esi</span> -<span id="L604" class="LineNr">604 </span> <span class="subxS1Comment"># . var c/eax : byte = *start</span> +<span id="L604" class="LineNr">604 </span> <span class="subxS1Comment"># . var c/eax: byte = *start</span> <span id="L605" class="LineNr">605 </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="L606" class="LineNr">606 </span> 8a/copy-byte 0/mod/indirect 6/rm32/esi <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 *esi to AL</span> <span id="L607" class="LineNr">607 </span> <span class="subxS1Comment"># . if (c == '#') continue</span> @@ -597,7 +597,7 @@ if ('onhashchange' in window) { <span id="L678" class="LineNr">678 </span> <span class="subxS2Comment"># . . discard args</span> <span id="L679" class="LineNr">679 </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="L680" class="Folded">680 </span><span class="Folded">+-- 40 lines: #? # dump segment name ---------------------------------------------------------------------------------------------------------------------</span> -<span id="L720" class="LineNr">720 </span> <span class="subxComment"># var segment-slot/eax : (addr handle stream byte) = leaky-get-or-insert-slice(table, segment-name, row-size=8)</span> +<span id="L720" class="LineNr">720 </span> <span class="subxComment"># var segment-slot/eax: (addr handle stream byte) = leaky-get-or-insert-slice(table, segment-name, row-size=8)</span> <span id="L721" class="LineNr">721 </span> <span class="subxS2Comment"># . . push args</span> <span id="L722" class="LineNr">722 </span> 68/push 8/imm32/row-size <span id="L723" class="LineNr">723 </span> 52/push-edx @@ -606,7 +606,7 @@ if ('onhashchange' in window) { <span id="L726" class="LineNr">726 </span> e8/call <a href='../081table.subx.html#L655'>leaky-get-or-insert-slice</a>/disp32 <span id="L727" class="LineNr">727 </span> <span class="subxS2Comment"># . . discard args</span> <span id="L728" class="LineNr">728 </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="L729" class="LineNr">729 </span> <span class="subxComment"># var curr-segment/ebx : (handle stream byte) = *segment-slot</span> +<span id="L729" class="LineNr">729 </span> <span class="subxComment"># var curr-segment/ebx: (handle stream byte) = *segment-slot</span> <span id="L730" class="LineNr">730 </span> 8b/copy 0/mod/indirect 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 3/r32/ebx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *eax to ebx</span> <span id="L731" class="LineNr">731 </span> <span class="subxComment"># if (curr-segment != 0) continue</span> <span id="L732" class="LineNr">732 </span> 81 7/subop/compare 3/mod/direct 3/rm32/ebx <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 ebx</span> @@ -667,7 +667,7 @@ if ('onhashchange' in window) { <span id="L843" class="LineNr">843 </span> 5d/pop-to-ebp <span id="L844" class="LineNr">844 </span> c3/return <span id="L845" class="LineNr">845 </span> -<span id="L846" class="LineNr">846 </span><span class="subxFunction">write-segments</span>: <span class="subxComment"># out : (addr buffered-file), table : (addr stream {string_key, (handle stream byte)})</span> +<span id="L846" class="LineNr">846 </span><span class="subxFunction">write-segments</span>: <span class="subxComment"># out: (addr buffered-file), table: (addr stream {string_key, (handle stream byte)})</span> <span id="L847" class="LineNr">847 </span> <span class="subxComment"># pseudocode:</span> <span id="L848" class="LineNr">848 </span> <span class="subxComment"># var curr = table->data</span> <span id="L849" class="LineNr">849 </span> <span class="subxComment"># var max = &table->data[table->write]</span> @@ -686,17 +686,17 @@ if ('onhashchange' in window) { <span id="L862" class="LineNr">862 </span> 56/push-esi <span id="L863" class="LineNr">863 </span> <span class="subxComment"># esi = table</span> <span id="L864" class="LineNr">864 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+12) to esi</span> -<span id="L865" class="LineNr">865 </span> <span class="subxComment"># var write/edx : int = table->write</span> +<span id="L865" class="LineNr">865 </span> <span class="subxComment"># var write/edx: int = table->write</span> <span id="L866" class="LineNr">866 </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="L867" class="LineNr">867 </span> <span class="subxComment"># var curr/esi : (addr byte) = table->data</span> +<span id="L867" class="LineNr">867 </span> <span class="subxComment"># var curr/esi: (addr byte) = table->data</span> <span id="L868" class="LineNr">868 </span> 81 0/subop/add 3/mod/direct 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to eax</span> -<span id="L869" class="LineNr">869 </span> <span class="subxComment"># var max/edx : (addr byte) = curr + write</span> +<span id="L869" class="LineNr">869 </span> <span class="subxComment"># var max/edx: (addr byte) = curr + write</span> <span id="L870" class="LineNr">870 </span> 01/add 3/mod/direct 2/rm32/edx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># add esi to edx</span> <span id="L871" class="LineNr">871 </span><span class="Constant">$write-segments:loop</span>: <span id="L872" class="LineNr">872 </span> <span class="subxComment"># if (curr >= max) break</span> <span id="L873" class="LineNr">873 </span> 39/compare 3/mod/direct 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"># compare esi with edx</span> <span id="L874" class="LineNr">874 </span> 73/jump-if-addr>= $write-segments:<span class="Constant">break</span>/disp8 -<span id="L875" class="LineNr">875 </span> <span class="subxComment"># var stream/eax : (addr stream byte) = table[i].stream</span> +<span id="L875" class="LineNr">875 </span> <span class="subxComment"># var stream/eax: (addr stream byte) = table[i].stream</span> <span id="L876" class="LineNr">876 </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="L877" class="LineNr">877 </span> <span class="subxComment"># write-stream-data(out, stream)</span> <span id="L878" class="LineNr">878 </span> <span class="subxS2Comment"># . . push args</span> |