about summary refs log tree commit diff stats
path: root/html/310copy-bytes.subx.html
diff options
context:
space:
mode:
Diffstat (limited to 'html/310copy-bytes.subx.html')
-rw-r--r--html/310copy-bytes.subx.html49
1 files changed, 45 insertions, 4 deletions
diff --git a/html/310copy-bytes.subx.html b/html/310copy-bytes.subx.html
index 6f799a95..4290fcba 100644
--- a/html/310copy-bytes.subx.html
+++ b/html/310copy-bytes.subx.html
@@ -114,7 +114,7 @@ if ('onhashchange' in window) {
 <span id="L56" class="LineNr"> 56 </span>    5d/pop-to-ebp
 <span id="L57" class="LineNr"> 57 </span>    c3/return
 <span id="L58" class="LineNr"> 58 </span>
-<span id="L59" class="LineNr"> 59 </span><span class="subxFunction">stream-to-string</span>:  <span class="subxComment"># in: (addr stream _), out: (addr handle array _)</span>
+<span id="L59" class="LineNr"> 59 </span><span class="subxFunction">stream-to-array</span>:  <span class="subxComment"># in: (addr stream _), out: (addr handle array _)</span>
 <span id="L60" class="LineNr"> 60 </span>    <span class="subxS1Comment"># . prologue</span>
 <span id="L61" class="LineNr"> 61 </span>    55/push-ebp
 <span id="L62" class="LineNr"> 62 </span>    89/&lt;- %ebp 4/r32/esp
@@ -139,7 +139,7 @@ if ('onhashchange' in window) {
 <span id="L81" class="LineNr"> 81 </span>    8d/copy-address *(eax+4) 0/r32/eax
 <span id="L82" class="LineNr"> 82 </span>    <span class="subxComment">#</span>
 <span id="L83" class="LineNr"> 83 </span>    (<a href='310copy-bytes.subx.html#L5'>copy-bytes</a> %edx %eax %ecx)
-<span id="L84" class="LineNr"> 84 </span><span class="Constant">$stream-to-string:end</span>:
+<span id="L84" class="LineNr"> 84 </span><span class="Constant">$stream-to-array:end</span>:
 <span id="L85" class="LineNr"> 85 </span>    <span class="subxS1Comment"># . restore registers</span>
 <span id="L86" class="LineNr"> 86 </span>    5e/pop-to-esi
 <span id="L87" class="LineNr"> 87 </span>    5a/pop-to-edx
@@ -150,7 +150,7 @@ if ('onhashchange' in window) {
 <span id="L92" class="LineNr"> 92 </span>    5d/pop-to-ebp
 <span id="L93" class="LineNr"> 93 </span>    c3/return
 <span id="L94" class="LineNr"> 94 </span>
-<span id="L95" class="LineNr"> 95 </span><span class="subxTest">test-stream-to-string</span>:
+<span id="L95" class="LineNr"> 95 </span><span class="subxTest">test-stream-to-array</span>:
 <span id="L96" class="LineNr"> 96 </span>    <span class="subxS1Comment"># . prologue</span>
 <span id="L97" class="LineNr"> 97 </span>    55/push-ebp
 <span id="L98" class="LineNr"> 98 </span>    89/&lt;- %ebp 4/r32/esp
@@ -164,13 +164,54 @@ if ('onhashchange' in window) {
 <span id="L106" class="LineNr">106 </span>    68/push 0/imm32
 <span id="L107" class="LineNr">107 </span>    89/&lt;- %ecx 4/r32/esp
 <span id="L108" class="LineNr">108 </span>    <span class="subxComment">#</span>
-<span id="L109" class="LineNr">109 </span>    (<a href='310copy-bytes.subx.html#L59'>stream-to-string</a> <a href='112read-byte.subx.html#L331'>_test-input-stream</a> %ecx)
+<span id="L109" class="LineNr">109 </span>    (<a href='310copy-bytes.subx.html#L59'>stream-to-array</a> <a href='112read-byte.subx.html#L331'>_test-input-stream</a> %ecx)
 <span id="L110" class="LineNr">110 </span>    (<a href='120allocate.subx.html#L256'>lookup</a> *ecx *(ecx+4))  <span class="subxComment"># =&gt; eax</span>
 <span id="L111" class="LineNr">111 </span>    (<a href='105string-equal.subx.html#L220'>check-strings-equal</a> %eax <span class="Constant">&quot;bc&quot;</span>)
 <span id="L112" class="LineNr">112 </span>    <span class="subxS1Comment"># . epilogue</span>
 <span id="L113" class="LineNr">113 </span>    89/&lt;- %esp 5/r32/ebp
 <span id="L114" class="LineNr">114 </span>    5d/pop-to-ebp
 <span id="L115" class="LineNr">115 </span>    c3/return
+<span id="L116" class="LineNr">116 </span>
+<span id="L117" class="LineNr">117 </span><span class="subxComment"># like stream-to-array but ignore surrounding quotes</span>
+<span id="L118" class="LineNr">118 </span><span class="subxComment"># we might do other stuff here later</span>
+<span id="L119" class="LineNr">119 </span><span class="subxFunction">unquote-stream-to-array</span>:  <span class="subxComment"># in: (addr stream _), out: (addr handle array _)</span>
+<span id="L120" class="LineNr">120 </span>    <span class="subxS1Comment"># . prologue</span>
+<span id="L121" class="LineNr">121 </span>    55/push-ebp
+<span id="L122" class="LineNr">122 </span>    89/&lt;- %ebp 4/r32/esp
+<span id="L123" class="LineNr">123 </span>    <span class="subxS1Comment"># . save registers</span>
+<span id="L124" class="LineNr">124 </span>    50/push-eax
+<span id="L125" class="LineNr">125 </span>    51/push-ecx
+<span id="L126" class="LineNr">126 </span>    52/push-edx
+<span id="L127" class="LineNr">127 </span>    56/push-esi
+<span id="L128" class="LineNr">128 </span>    <span class="subxComment"># esi = s</span>
+<span id="L129" class="LineNr">129 </span>    8b/-&gt; *(ebp+8) 6/r32/esi
+<span id="L130" class="LineNr">130 </span>    <span class="subxComment"># var len/ecx: int = s-&gt;write - s-&gt;read - 2</span>
+<span id="L131" class="LineNr">131 </span>    8b/-&gt; *esi 1/r32/ecx
+<span id="L132" class="LineNr">132 </span>    2b/subtract *(esi+4) 1/r32/ecx
+<span id="L133" class="LineNr">133 </span>    81 7/subop/compare %ecx 2/imm32
+<span id="L134" class="LineNr">134 </span>    7c/jump-if-&lt; $unquote-stream-to-array:end/disp8
+<span id="L135" class="LineNr">135 </span>    81 5/subop/subtract %ecx 2/imm32
+<span id="L136" class="LineNr">136 </span>    <span class="subxComment"># allocate</span>
+<span id="L137" class="LineNr">137 </span>    (<a href='120allocate.subx.html#L576'>allocate-array</a> <span class="SpecialChar"><a href='120allocate.subx.html#L27'>Heap</a></span> %ecx *(ebp+0xc))
+<span id="L138" class="LineNr">138 </span>    <span class="subxComment"># var in/edx: (addr byte) = s-&gt;data + s-&gt;read + 1</span>
+<span id="L139" class="LineNr">139 </span>    8b/-&gt; *(esi+4) 2/r32/edx
+<span id="L140" class="LineNr">140 </span>    8d/copy-address *(esi+edx+0xd) 2/r32/edx  <span class="subxComment"># Stream-data + 1</span>
+<span id="L141" class="LineNr">141 </span>    <span class="subxComment"># var dest/eax: (addr byte) = data for out</span>
+<span id="L142" class="LineNr">142 </span>    8b/-&gt; *(ebp+0xc) 0/r32/eax
+<span id="L143" class="LineNr">143 </span>    (<a href='120allocate.subx.html#L256'>lookup</a> *eax *(eax+4))  <span class="subxComment"># =&gt; eax</span>
+<span id="L144" class="LineNr">144 </span>    8d/copy-address *(eax+4) 0/r32/eax
+<span id="L145" class="LineNr">145 </span>    <span class="subxComment">#</span>
+<span id="L146" class="LineNr">146 </span>    (<a href='310copy-bytes.subx.html#L5'>copy-bytes</a> %edx %eax %ecx)
+<span id="L147" class="LineNr">147 </span><span class="Constant">$unquote-stream-to-array:end</span>:
+<span id="L148" class="LineNr">148 </span>    <span class="subxS1Comment"># . restore registers</span>
+<span id="L149" class="LineNr">149 </span>    5e/pop-to-esi
+<span id="L150" class="LineNr">150 </span>    5a/pop-to-edx
+<span id="L151" class="LineNr">151 </span>    59/pop-to-ecx
+<span id="L152" class="LineNr">152 </span>    58/pop-to-eax
+<span id="L153" class="LineNr">153 </span>    <span class="subxS1Comment"># . epilogue</span>
+<span id="L154" class="LineNr">154 </span>    89/&lt;- %esp 5/r32/ebp
+<span id="L155" class="LineNr">155 </span>    5d/pop-to-ebp
+<span id="L156" class="LineNr">156 </span>    c3/return
 </pre>
 </body>
 </html>