about summary refs log tree commit diff stats
path: root/html/070new-stream.subx.html
diff options
context:
space:
mode:
Diffstat (limited to 'html/070new-stream.subx.html')
-rw-r--r--html/070new-stream.subx.html14
1 files changed, 7 insertions, 7 deletions
diff --git a/html/070new-stream.subx.html b/html/070new-stream.subx.html
index 086f4a81..b9ff3660 100644
--- a/html/070new-stream.subx.html
+++ b/html/070new-stream.subx.html
@@ -64,13 +64,13 @@ 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="subxFunction">new-stream</span>:  <span class="subxComment"># ad : (address allocation-descriptor), length : int, elemsize : int -&gt; address/eax</span>
+<span id="L8" class="LineNr">  8 </span><span class="subxFunction">new-stream</span>:  <span class="subxComment"># ad : (address allocation-descriptor), length : int, elemsize : int -&gt; address/eax : (handle stream _)</span>
 <span id="L9" class="LineNr">  9 </span>    <span class="subxS1Comment"># . prologue</span>
 <span id="L10" class="LineNr"> 10 </span>    55/push-ebp
 <span id="L11" class="LineNr"> 11 </span>    89/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="L12" class="LineNr"> 12 </span>    <span class="subxS1Comment"># . save registers</span>
 <span id="L13" class="LineNr"> 13 </span>    52/push-edx
-<span id="L14" class="LineNr"> 14 </span>    <span class="subxComment"># n = elemsize * length + 12 (for read, write and length)</span>
+<span id="L14" class="LineNr"> 14 </span>    <span class="subxComment"># var n/eax : int = elemsize * length + 12 (for read, write and length)</span>
 <span id="L15" class="LineNr"> 15 </span>    <span class="subxS1Comment"># . eax = elemsize</span>
 <span id="L16" class="LineNr"> 16 </span>    8b/copy                         1/mod/*+disp8   5/rm32/ebp   <span class="Normal"> . </span>         <span class="Normal"> . </span>           <span class="Normal"> . </span>          0/r32/eax   0x10/disp8     <span class="Normal"> . </span>                <span class="subxComment"># copy *(ebp+16) to eax</span>
 <span id="L17" class="LineNr"> 17 </span>    <span class="subxS1Comment"># . eax *= length</span>
@@ -83,12 +83,12 @@ if ('onhashchange' in window) {
 <span id="L24" class="LineNr"> 24 </span>    89/copy                         3/mod/direct    2/rm32/edx   <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 edx</span>
 <span id="L25" class="LineNr"> 25 </span>    <span class="subxS1Comment"># . eax += 12</span>
 <span id="L26" class="LineNr"> 26 </span>    05/add-to-eax  0xc/imm32
-<span id="L27" class="LineNr"> 27 </span>    <span class="subxComment"># allocate(ad, n)</span>
+<span id="L27" class="LineNr"> 27 </span>    <span class="subxComment"># var eax : (handle stream _) = allocate(ad, n)</span>
 <span id="L28" class="LineNr"> 28 </span>    <span class="subxS2Comment"># . . push args</span>
 <span id="L29" class="LineNr"> 29 </span>    50/push-eax
 <span id="L30" class="LineNr"> 30 </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="L31" class="LineNr"> 31 </span>    <span class="subxS2Comment"># . . call</span>
-<span id="L32" class="LineNr"> 32 </span>    e8/call  <a href='069allocate.subx.html#L61'>allocate</a>/disp32
+<span id="L32" class="LineNr"> 32 </span>    e8/call  <a href='069allocate.subx.html#L59'>allocate</a>/disp32
 <span id="L33" class="LineNr"> 33 </span>    <span class="subxS2Comment"># . . discard args</span>
 <span id="L34" class="LineNr"> 34 </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="L35" class="LineNr"> 35 </span>    <span class="subxComment"># eax-&gt;length = elemsize*length</span>
@@ -114,7 +114,7 @@ if ('onhashchange' in window) {
 <span id="L55" class="LineNr"> 55 </span>    68/push  <span class="Constant">&quot;new-stream: size too large\n&quot;</span>/imm32
 <span id="L56" class="LineNr"> 56 </span>    68/push  2/imm32/stderr
 <span id="L57" class="LineNr"> 57 </span>    <span class="subxS2Comment"># . . call</span>
-<span id="L58" class="LineNr"> 58 </span>    e8/call  <a href='050_write.subx.html#L14'>_write</a>/disp32
+<span id="L58" class="LineNr"> 58 </span>    e8/call  <a href='050_write.subx.html#L34'>_write</a>/disp32
 <span id="L59" class="LineNr"> 59 </span>    <span class="subxS2Comment"># . . discard args</span>
 <span id="L60" class="LineNr"> 60 </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="L61" class="LineNr"> 61 </span>    <span class="subxS1Comment"># . syscall(exit, 1)</span>
@@ -127,7 +127,7 @@ if ('onhashchange' in window) {
 <span id="L68" class="LineNr"> 68 </span>    <span class="subxS1Comment"># . prologue</span>
 <span id="L69" class="LineNr"> 69 </span>    55/push-ebp
 <span id="L70" class="LineNr"> 70 </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="L71" class="LineNr"> 71 </span>    <span class="subxComment"># var heap/ecx : (address allocation-descriptor) = {0, 0}</span>
+<span id="L71" class="LineNr"> 71 </span>    <span class="subxComment"># var heap/ecx : (ref allocation-descriptor)</span>
 <span id="L72" class="LineNr"> 72 </span>    68/push  0/imm32/limit
 <span id="L73" class="LineNr"> 73 </span>    68/push  0/imm32/curr
 <span id="L74" class="LineNr"> 74 </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>
@@ -141,7 +141,7 @@ if ('onhashchange' in window) {
 <span id="L82" class="LineNr"> 82 </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="L83" class="LineNr"> 83 </span>    <span class="subxComment"># var start/edx = ad-&gt;curr</span>
 <span id="L84" class="LineNr"> 84 </span>    8b/copy                         0/mod/indirect  1/rm32/ecx   <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 *ecx to edx</span>
-<span id="L85" class="LineNr"> 85 </span>    <span class="subxComment"># eax = new-stream(heap, 3, 2)</span>
+<span id="L85" class="LineNr"> 85 </span>    <span class="subxComment"># var eax : (handle stream byte) = new-stream(heap, 3, 2)</span>
 <span id="L86" class="LineNr"> 86 </span>    <span class="subxS2Comment"># . . push args</span>
 <span id="L87" class="LineNr"> 87 </span>    68/push  2/imm32
 <span id="L88" class="LineNr"> 88 </span>    68/push  3/imm32