about summary refs log tree commit diff stats
path: root/html/mu_instructions.html
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-08-01 16:25:34 -0700
committerKartik Agaram <vc@akkartik.com>2020-08-01 16:25:34 -0700
commitaf983921f6c4170584d5e2a60e0c04556c3f621f (patch)
tree2c1ec449795cd0fc89d927647c41c61b7f6e1110 /html/mu_instructions.html
parentd01d4f0c9faaa45117ae7eef0287c5872746b4d5 (diff)
downloadmu-af983921f6c4170584d5e2a60e0c04556c3f621f.tar.gz
6697
Diffstat (limited to 'html/mu_instructions.html')
-rw-r--r--html/mu_instructions.html156
1 files changed, 76 insertions, 80 deletions
diff --git a/html/mu_instructions.html b/html/mu_instructions.html
index 6d91ec55..a6b0f37c 100644
--- a/html/mu_instructions.html
+++ b/html/mu_instructions.html
@@ -14,8 +14,8 @@ pre { font-family: monospace; color: #000000; background-color: #c6c6c6; }
 body { font-family: monospace; color: #000000; background-color: #c6c6c6; }
 * { font-size: 1em; }
 .Comment { color: #005faf; }
+.SpecialChar { color: #d70000; }
 .Constant { color: #008787; }
-.Special { color: #d70000; }
 .PreProc { color: #c000c0; }
 .SalientComment { color: #0000af; }
 -->
@@ -28,7 +28,7 @@ body { font-family: monospace; color: #000000; background-color: #c6c6c6; }
 See <a href="http://akkartik.name/akkartik-convivial-20200315.pdf">http://akkartik.name/akkartik-convivial-20200315.pdf</a> for the complete
 story. In brief: Mu is a statement-oriented language. Blocks consist of flat
 lists of instructions. Instructions can have inputs after the operation, and
-outputs to the left of a '<span class="Special">&lt;-</span>'. Inputs and outputs must be variables. They can't
+outputs to the left of a '<span class="SpecialChar">&lt;-</span>'. Inputs and outputs must be variables. They can't
 include nested expressions. Variables can be literals ('n'), or live in a
 register ('var/reg') or in memory ('var') at some 'stack-offset' from the 'ebp'
 register. Outputs must be registers. To modify a variable in memory, pass it in
@@ -38,92 +38,92 @@ Conversely, registers that are just read from must not be passed as inputs.
 The following chart shows all the instruction forms supported by Mu, along with
 the SubX instruction they're translated to.
 
-var/<span class="Constant">eax</span> <span class="Special">&lt;-</span> increment              =&gt; <span class="Constant">&quot;40/increment-eax&quot;</span>
-var/<span class="Constant">ecx</span> <span class="Special">&lt;-</span> increment              =&gt; <span class="Constant">&quot;41/increment-ecx&quot;</span>
-var/<span class="Constant">edx</span> <span class="Special">&lt;-</span> increment              =&gt; <span class="Constant">&quot;42/increment-edx&quot;</span>
-var/<span class="Constant">ebx</span> <span class="Special">&lt;-</span> increment              =&gt; <span class="Constant">&quot;43/increment-ebx&quot;</span>
-var/<span class="Constant">esi</span> <span class="Special">&lt;-</span> increment              =&gt; <span class="Constant">&quot;46/increment-esi&quot;</span>
-var/<span class="Constant">edi</span> <span class="Special">&lt;-</span> increment              =&gt; <span class="Constant">&quot;47/increment-edi&quot;</span>
+var/<span class="Constant">eax</span> <span class="SpecialChar">&lt;-</span> increment              =&gt; <span class="Constant">&quot;40/increment-eax&quot;</span>
+var/<span class="Constant">ecx</span> <span class="SpecialChar">&lt;-</span> increment              =&gt; <span class="Constant">&quot;41/increment-ecx&quot;</span>
+var/<span class="Constant">edx</span> <span class="SpecialChar">&lt;-</span> increment              =&gt; <span class="Constant">&quot;42/increment-edx&quot;</span>
+var/<span class="Constant">ebx</span> <span class="SpecialChar">&lt;-</span> increment              =&gt; <span class="Constant">&quot;43/increment-ebx&quot;</span>
+var/<span class="Constant">esi</span> <span class="SpecialChar">&lt;-</span> increment              =&gt; <span class="Constant">&quot;46/increment-esi&quot;</span>
+var/<span class="Constant">edi</span> <span class="SpecialChar">&lt;-</span> increment              =&gt; <span class="Constant">&quot;47/increment-edi&quot;</span>
 increment var                     =&gt; <span class="Constant">&quot;ff 0/subop/increment *(ebp+&quot;</span> var.stack-offset <span class="Constant">&quot;)&quot;</span>
 increment *var/reg                =&gt; <span class="Constant">&quot;ff 0/subop/increment *&quot;</span> reg
 
-var/<span class="Constant">eax</span> <span class="Special">&lt;-</span> decrement              =&gt; <span class="Constant">&quot;48/decrement-eax&quot;</span>
-var/<span class="Constant">ecx</span> <span class="Special">&lt;-</span> decrement              =&gt; <span class="Constant">&quot;49/decrement-ecx&quot;</span>
-var/<span class="Constant">edx</span> <span class="Special">&lt;-</span> decrement              =&gt; <span class="Constant">&quot;4a/decrement-edx&quot;</span>
-var/<span class="Constant">ebx</span> <span class="Special">&lt;-</span> decrement              =&gt; <span class="Constant">&quot;4b/decrement-ebx&quot;</span>
-var/<span class="Constant">esi</span> <span class="Special">&lt;-</span> decrement              =&gt; <span class="Constant">&quot;4e/decrement-esi&quot;</span>
-var/<span class="Constant">edi</span> <span class="Special">&lt;-</span> decrement              =&gt; <span class="Constant">&quot;4f/decrement-edi&quot;</span>
+var/<span class="Constant">eax</span> <span class="SpecialChar">&lt;-</span> decrement              =&gt; <span class="Constant">&quot;48/decrement-eax&quot;</span>
+var/<span class="Constant">ecx</span> <span class="SpecialChar">&lt;-</span> decrement              =&gt; <span class="Constant">&quot;49/decrement-ecx&quot;</span>
+var/<span class="Constant">edx</span> <span class="SpecialChar">&lt;-</span> decrement              =&gt; <span class="Constant">&quot;4a/decrement-edx&quot;</span>
+var/<span class="Constant">ebx</span> <span class="SpecialChar">&lt;-</span> decrement              =&gt; <span class="Constant">&quot;4b/decrement-ebx&quot;</span>
+var/<span class="Constant">esi</span> <span class="SpecialChar">&lt;-</span> decrement              =&gt; <span class="Constant">&quot;4e/decrement-esi&quot;</span>
+var/<span class="Constant">edi</span> <span class="SpecialChar">&lt;-</span> decrement              =&gt; <span class="Constant">&quot;4f/decrement-edi&quot;</span>
 decrement var                     =&gt; <span class="Constant">&quot;ff 1/subop/decrement *(ebp+&quot;</span> var.stack-offset <span class="Constant">&quot;)&quot;</span>
 decrement *var/reg                =&gt; <span class="Constant">&quot;ff 1/subop/decrement *&quot;</span> reg
 
-var/reg <span class="Special">&lt;-</span> add var2/reg2          =&gt; <span class="Constant">&quot;01/add-to %&quot;</span> reg <span class="Constant">&quot; &quot;</span> reg2 <span class="Constant">&quot;/r32&quot;</span>
-var/reg <span class="Special">&lt;-</span> add var2               =&gt; <span class="Constant">&quot;03/add *(ebp+&quot;</span> var2.stack-offset <span class="Constant">&quot;) &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
-var/reg <span class="Special">&lt;-</span> add *var2/reg2         =&gt; <span class="Constant">&quot;03/add *&quot;</span> reg2 <span class="Constant">&quot; &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
+var/reg <span class="SpecialChar">&lt;-</span> add var2/reg2          =&gt; <span class="Constant">&quot;01/add-to %&quot;</span> reg <span class="Constant">&quot; &quot;</span> reg2 <span class="Constant">&quot;/r32&quot;</span>
+var/reg <span class="SpecialChar">&lt;-</span> add var2               =&gt; <span class="Constant">&quot;03/add *(ebp+&quot;</span> var2.stack-offset <span class="Constant">&quot;) &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
+var/reg <span class="SpecialChar">&lt;-</span> add *var2/reg2         =&gt; <span class="Constant">&quot;03/add *&quot;</span> reg2 <span class="Constant">&quot; &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
 add-to var1, var2/reg             =&gt; <span class="Constant">&quot;01/add-to *(ebp+&quot;</span> var1.stack-offset <span class="Constant">&quot;) &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
-var/<span class="Constant">eax</span> <span class="Special">&lt;-</span> add n                  =&gt; <span class="Constant">&quot;05/add-to-eax &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
-var/reg <span class="Special">&lt;-</span> add n                  =&gt; <span class="Constant">&quot;81 0/subop/add %&quot;</span> reg <span class="Constant">&quot; &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
+var/<span class="Constant">eax</span> <span class="SpecialChar">&lt;-</span> add n                  =&gt; <span class="Constant">&quot;05/add-to-eax &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
+var/reg <span class="SpecialChar">&lt;-</span> add n                  =&gt; <span class="Constant">&quot;81 0/subop/add %&quot;</span> reg <span class="Constant">&quot; &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
 add-to var, n                     =&gt; <span class="Constant">&quot;81 0/subop/add *(ebp+&quot;</span> var.stack-offset <span class="Constant">&quot;) &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
 add-to *var/reg, n                =&gt; <span class="Constant">&quot;81 0/subop/add *&quot;</span> reg <span class="Constant">&quot; &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
 
-var/reg <span class="Special">&lt;-</span> subtract var2/reg2     =&gt; <span class="Constant">&quot;29/subtract-from %&quot;</span> reg <span class="Constant">&quot; &quot;</span> reg2 <span class="Constant">&quot;/r32&quot;</span>
-var/reg <span class="Special">&lt;-</span> subtract var2          =&gt; <span class="Constant">&quot;2b/subtract *(ebp+&quot;</span> var2.stack-offset <span class="Constant">&quot;) &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
-var/reg <span class="Special">&lt;-</span> subtract *var2/reg2    =&gt; <span class="Constant">&quot;2b/subtract *&quot;</span> reg2 <span class="Constant">&quot; &quot;</span> reg1 <span class="Constant">&quot;/r32&quot;</span>
+var/reg <span class="SpecialChar">&lt;-</span> subtract var2/reg2     =&gt; <span class="Constant">&quot;29/subtract-from %&quot;</span> reg <span class="Constant">&quot; &quot;</span> reg2 <span class="Constant">&quot;/r32&quot;</span>
+var/reg <span class="SpecialChar">&lt;-</span> subtract var2          =&gt; <span class="Constant">&quot;2b/subtract *(ebp+&quot;</span> var2.stack-offset <span class="Constant">&quot;) &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
+var/reg <span class="SpecialChar">&lt;-</span> subtract *var2/reg2    =&gt; <span class="Constant">&quot;2b/subtract *&quot;</span> reg2 <span class="Constant">&quot; &quot;</span> reg1 <span class="Constant">&quot;/r32&quot;</span>
 subtract-from var1, var2/reg2     =&gt; <span class="Constant">&quot;29/subtract-from *(ebp+&quot;</span> var1.stack-offset <span class="Constant">&quot;) &quot;</span> reg2 <span class="Constant">&quot;/r32&quot;</span>
-var/<span class="Constant">eax</span> <span class="Special">&lt;-</span> subtract n             =&gt; <span class="Constant">&quot;2d/subtract-from-eax &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
-var/reg <span class="Special">&lt;-</span> subtract n             =&gt; <span class="Constant">&quot;81 5/subop/subtract %&quot;</span> reg <span class="Constant">&quot; &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
+var/<span class="Constant">eax</span> <span class="SpecialChar">&lt;-</span> subtract n             =&gt; <span class="Constant">&quot;2d/subtract-from-eax &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
+var/reg <span class="SpecialChar">&lt;-</span> subtract n             =&gt; <span class="Constant">&quot;81 5/subop/subtract %&quot;</span> reg <span class="Constant">&quot; &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
 subtract-from var, n              =&gt; <span class="Constant">&quot;81 5/subop/subtract *(ebp+&quot;</span> var.stack-offset <span class="Constant">&quot;) &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
 subtract-from *var/reg, n         =&gt; <span class="Constant">&quot;81 5/subop/subtract *&quot;</span> reg <span class="Constant">&quot; &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
 
-var/reg <span class="Special">&lt;-</span> and var2/reg2          =&gt; <span class="Constant">&quot;21/and-with %&quot;</span> reg <span class="Constant">&quot; &quot;</span> reg2 <span class="Constant">&quot;/r32&quot;</span>
-var/reg <span class="Special">&lt;-</span> and var2               =&gt; <span class="Constant">&quot;23/and *(ebp+&quot;</span> var2.stack-offset <span class="Constant">&quot; &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
-var/reg <span class="Special">&lt;-</span> and *var2/reg2         =&gt; <span class="Constant">&quot;23/and *&quot;</span> reg2 <span class="Constant">&quot; &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
+var/reg <span class="SpecialChar">&lt;-</span> and var2/reg2          =&gt; <span class="Constant">&quot;21/and-with %&quot;</span> reg <span class="Constant">&quot; &quot;</span> reg2 <span class="Constant">&quot;/r32&quot;</span>
+var/reg <span class="SpecialChar">&lt;-</span> and var2               =&gt; <span class="Constant">&quot;23/and *(ebp+&quot;</span> var2.stack-offset <span class="Constant">&quot; &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
+var/reg <span class="SpecialChar">&lt;-</span> and *var2/reg2         =&gt; <span class="Constant">&quot;23/and *&quot;</span> reg2 <span class="Constant">&quot; &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
 and-with var1, var2/reg           =&gt; <span class="Constant">&quot;21/and-with *(ebp+&quot;</span> var1.stack-offset <span class="Constant">&quot;) &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
-var/<span class="Constant">eax</span> <span class="Special">&lt;-</span> and n                  =&gt; <span class="Constant">&quot;25/and-with-eax &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
-var/reg <span class="Special">&lt;-</span> and n                  =&gt; <span class="Constant">&quot;81 4/subop/and %&quot;</span> reg <span class="Constant">&quot; &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
+var/<span class="Constant">eax</span> <span class="SpecialChar">&lt;-</span> and n                  =&gt; <span class="Constant">&quot;25/and-with-eax &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
+var/reg <span class="SpecialChar">&lt;-</span> and n                  =&gt; <span class="Constant">&quot;81 4/subop/and %&quot;</span> reg <span class="Constant">&quot; &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
 and-with var, n                   =&gt; <span class="Constant">&quot;81 4/subop/and *(ebp+&quot;</span> var.stack-offset <span class="Constant">&quot;) &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
 and-with *var/reg, n              =&gt; <span class="Constant">&quot;81 4/subop/and *&quot;</span> reg <span class="Constant">&quot; &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
 
-var/reg <span class="Special">&lt;-</span> or var2/reg2           =&gt; <span class="Constant">&quot;09/or-with %&quot;</span> reg <span class="Constant">&quot; &quot;</span> reg2 <span class="Constant">&quot;/r32&quot;</span>
-var/reg <span class="Special">&lt;-</span> or var2                =&gt; <span class="Constant">&quot;0b/or *(ebp+&quot;</span> var2.stack-offset <span class="Constant">&quot;) &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
-var/reg <span class="Special">&lt;-</span> or *var2/reg2          =&gt; <span class="Constant">&quot;0b/or *&quot;</span> reg2 <span class="Constant">&quot; &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
+var/reg <span class="SpecialChar">&lt;-</span> or var2/reg2           =&gt; <span class="Constant">&quot;09/or-with %&quot;</span> reg <span class="Constant">&quot; &quot;</span> reg2 <span class="Constant">&quot;/r32&quot;</span>
+var/reg <span class="SpecialChar">&lt;-</span> or var2                =&gt; <span class="Constant">&quot;0b/or *(ebp+&quot;</span> var2.stack-offset <span class="Constant">&quot;) &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
+var/reg <span class="SpecialChar">&lt;-</span> or *var2/reg2          =&gt; <span class="Constant">&quot;0b/or *&quot;</span> reg2 <span class="Constant">&quot; &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
 or-with var1, var2/reg2           =&gt; <span class="Constant">&quot;09/or-with *(ebp+&quot;</span> var1.stack-offset <span class="Constant">&quot; &quot;</span> reg2 <span class="Constant">&quot;/r32&quot;</span>
-var/<span class="Constant">eax</span> <span class="Special">&lt;-</span> or n                   =&gt; <span class="Constant">&quot;0d/or-with-eax &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
-var/reg <span class="Special">&lt;-</span> or n                   =&gt; <span class="Constant">&quot;81 1/subop/or %&quot;</span> reg <span class="Constant">&quot; &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
+var/<span class="Constant">eax</span> <span class="SpecialChar">&lt;-</span> or n                   =&gt; <span class="Constant">&quot;0d/or-with-eax &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
+var/reg <span class="SpecialChar">&lt;-</span> or n                   =&gt; <span class="Constant">&quot;81 1/subop/or %&quot;</span> reg <span class="Constant">&quot; &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
 or-with var, n                    =&gt; <span class="Constant">&quot;81 1/subop/or *(ebp+&quot;</span> var.stack-offset <span class="Constant">&quot;) &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
 or-with *var/reg, n               =&gt; <span class="Constant">&quot;81 1/subop/or *&quot;</span> reg <span class="Constant">&quot; &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
 
-var/reg <span class="Special">&lt;-</span> xor var2/reg2          =&gt; <span class="Constant">&quot;31/xor-with %&quot;</span> reg <span class="Constant">&quot; &quot;</span> reg2 <span class="Constant">&quot;/r32&quot;</span>
-var/reg <span class="Special">&lt;-</span> xor var2               =&gt; <span class="Constant">&quot;33/xor *(ebp+&quot;</span> var2.stack-offset <span class="Constant">&quot;) &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
-var/reg <span class="Special">&lt;-</span> xor *var2/reg2         =&gt; <span class="Constant">&quot;33/xor *&quot;</span> reg2 <span class="Constant">&quot; &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
+var/reg <span class="SpecialChar">&lt;-</span> xor var2/reg2          =&gt; <span class="Constant">&quot;31/xor-with %&quot;</span> reg <span class="Constant">&quot; &quot;</span> reg2 <span class="Constant">&quot;/r32&quot;</span>
+var/reg <span class="SpecialChar">&lt;-</span> xor var2               =&gt; <span class="Constant">&quot;33/xor *(ebp+&quot;</span> var2.stack-offset <span class="Constant">&quot;) &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
+var/reg <span class="SpecialChar">&lt;-</span> xor *var2/reg2         =&gt; <span class="Constant">&quot;33/xor *&quot;</span> reg2 <span class="Constant">&quot; &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
 xor-with var1, var2/reg           =&gt; <span class="Constant">&quot;31/xor-with *(ebp+&quot;</span> var1.stack-offset <span class="Constant">&quot;) &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
-var/<span class="Constant">eax</span> <span class="Special">&lt;-</span> xor n                  =&gt; <span class="Constant">&quot;35/xor-with-eax &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
-var/reg <span class="Special">&lt;-</span> xor n                  =&gt; <span class="Constant">&quot;81 6/subop/xor %&quot;</span> reg <span class="Constant">&quot; &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
+var/<span class="Constant">eax</span> <span class="SpecialChar">&lt;-</span> xor n                  =&gt; <span class="Constant">&quot;35/xor-with-eax &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
+var/reg <span class="SpecialChar">&lt;-</span> xor n                  =&gt; <span class="Constant">&quot;81 6/subop/xor %&quot;</span> reg <span class="Constant">&quot; &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
 xor-with var, n                   =&gt; <span class="Constant">&quot;81 6/subop/xor *(ebp+&quot;</span> var.stack-offset <span class="Constant">&quot;) &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
 xor-with *var/reg, n              =&gt; <span class="Constant">&quot;81 6/subop/xor *&quot;</span> reg <span class="Constant">&quot; &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
 
-var/reg <span class="Special">&lt;-</span> shift-left n
-var/reg <span class="Special">&lt;-</span> shift-right n
-var/reg <span class="Special">&lt;-</span> shift-right-signed n
+var/reg <span class="SpecialChar">&lt;-</span> shift-left n
+var/reg <span class="SpecialChar">&lt;-</span> shift-right n
+var/reg <span class="SpecialChar">&lt;-</span> shift-right-signed n
 shift-left var, n
 shift-right var, n
 shift-right-signed var, n
 
-var/<span class="Constant">eax</span> <span class="Special">&lt;-</span> copy n                 =&gt; <span class="Constant">&quot;b8/copy-to-eax &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
-var/<span class="Constant">ecx</span> <span class="Special">&lt;-</span> copy n                 =&gt; <span class="Constant">&quot;b9/copy-to-ecx &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
-var/<span class="Constant">edx</span> <span class="Special">&lt;-</span> copy n                 =&gt; <span class="Constant">&quot;ba/copy-to-edx &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
-var/<span class="Constant">ebx</span> <span class="Special">&lt;-</span> copy n                 =&gt; <span class="Constant">&quot;bb/copy-to-ebx &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
-var/<span class="Constant">esi</span> <span class="Special">&lt;-</span> copy n                 =&gt; <span class="Constant">&quot;be/copy-to-esi &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
-var/<span class="Constant">edi</span> <span class="Special">&lt;-</span> copy n                 =&gt; <span class="Constant">&quot;bf/copy-to-edi &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
-var/reg <span class="Special">&lt;-</span> copy var2/reg2         =&gt; <span class="Constant">&quot;89/&lt;- %&quot;</span> reg <span class="Constant">&quot; &quot;</span> reg2 <span class="Constant">&quot;/r32&quot;</span>
+var/<span class="Constant">eax</span> <span class="SpecialChar">&lt;-</span> copy n                 =&gt; <span class="Constant">&quot;b8/copy-to-eax &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
+var/<span class="Constant">ecx</span> <span class="SpecialChar">&lt;-</span> copy n                 =&gt; <span class="Constant">&quot;b9/copy-to-ecx &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
+var/<span class="Constant">edx</span> <span class="SpecialChar">&lt;-</span> copy n                 =&gt; <span class="Constant">&quot;ba/copy-to-edx &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
+var/<span class="Constant">ebx</span> <span class="SpecialChar">&lt;-</span> copy n                 =&gt; <span class="Constant">&quot;bb/copy-to-ebx &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
+var/<span class="Constant">esi</span> <span class="SpecialChar">&lt;-</span> copy n                 =&gt; <span class="Constant">&quot;be/copy-to-esi &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
+var/<span class="Constant">edi</span> <span class="SpecialChar">&lt;-</span> copy n                 =&gt; <span class="Constant">&quot;bf/copy-to-edi &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
+var/reg <span class="SpecialChar">&lt;-</span> copy var2/reg2         =&gt; <span class="Constant">&quot;89/&lt;- %&quot;</span> reg <span class="Constant">&quot; &quot;</span> reg2 <span class="Constant">&quot;/r32&quot;</span>
 copy-to var1, var2/reg            =&gt; <span class="Constant">&quot;89/&lt;- *(ebp+&quot;</span> var1.stack-offset <span class="Constant">&quot;) &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
-var/reg <span class="Special">&lt;-</span> copy var2              =&gt; <span class="Constant">&quot;8b/-&gt; *(ebp+&quot;</span> var2.stack-offset <span class="Constant">&quot;) &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
-var/reg <span class="Special">&lt;-</span> copy *var2/reg2        =&gt; <span class="Constant">&quot;8b/-&gt; *&quot;</span> reg2 <span class="Constant">&quot; &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
-var/reg <span class="Special">&lt;-</span> copy n                 =&gt; <span class="Constant">&quot;c7 0/subop/copy %&quot;</span> reg <span class="Constant">&quot; &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
+var/reg <span class="SpecialChar">&lt;-</span> copy var2              =&gt; <span class="Constant">&quot;8b/-&gt; *(ebp+&quot;</span> var2.stack-offset <span class="Constant">&quot;) &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
+var/reg <span class="SpecialChar">&lt;-</span> copy *var2/reg2        =&gt; <span class="Constant">&quot;8b/-&gt; *&quot;</span> reg2 <span class="Constant">&quot; &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
+var/reg <span class="SpecialChar">&lt;-</span> copy n                 =&gt; <span class="Constant">&quot;c7 0/subop/copy %&quot;</span> reg <span class="Constant">&quot; &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
 copy-to var, n                    =&gt; <span class="Constant">&quot;c7 0/subop/copy *(ebp+&quot;</span> var.stack-offset <span class="Constant">&quot;) &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
 copy-to *var/reg, n               =&gt; <span class="Constant">&quot;c7 0/subop/copy *&quot;</span> reg <span class="Constant">&quot; &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
 
-var/reg <span class="Special">&lt;-</span> copy-byte var2/reg2    =&gt; <span class="Constant">&quot;8a/byte-&gt; %&quot;</span> reg2 <span class="Constant">&quot; &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
-var/reg <span class="Special">&lt;-</span> copy-byte *var2/reg2   =&gt; <span class="Constant">&quot;8a/byte-&gt; *&quot;</span> reg2 <span class="Constant">&quot; &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
+var/reg <span class="SpecialChar">&lt;-</span> copy-byte var2/reg2    =&gt; <span class="Constant">&quot;8a/byte-&gt; %&quot;</span> reg2 <span class="Constant">&quot; &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
+var/reg <span class="SpecialChar">&lt;-</span> copy-byte *var2/reg2   =&gt; <span class="Constant">&quot;8a/byte-&gt; *&quot;</span> reg2 <span class="Constant">&quot; &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
 copy-byte-to *var1/reg1, var2/reg2  =&gt; <span class="Constant">&quot;88/byte&lt;- *&quot;</span> reg1 <span class="Constant">&quot; &quot;</span> reg2 <span class="Constant">&quot;/r32&quot;</span>
 
 compare var1, var2/reg2           =&gt; <span class="Constant">&quot;39/compare *(ebp+&quot;</span> var1.stack-offset <span class="Constant">&quot;) &quot;</span> reg2 <span class="Constant">&quot;/r32&quot;</span>
@@ -135,8 +135,8 @@ compare var/reg, n                =&gt; <span class="Constant">&quot;81 7/subop/
 compare var, n                    =&gt; <span class="Constant">&quot;81 7/subop/compare *(ebp+&quot;</span> var.stack-offset <span class="Constant">&quot;) &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
 compare *var/reg, n               =&gt; <span class="Constant">&quot;81 7/subop/compare *&quot;</span> reg <span class="Constant">&quot; &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
 
-var/reg <span class="Special">&lt;-</span> multiply var2          =&gt; <span class="Constant">&quot;0f af/multiply *(ebp+&quot;</span> var2.stack-offset <span class="Constant">&quot;) &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
-var/reg <span class="Special">&lt;-</span> multiply *var2/reg2    =&gt; <span class="Constant">&quot;0f af/multiply *&quot;</span> reg2 <span class="Constant">&quot; &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
+var/reg <span class="SpecialChar">&lt;-</span> multiply var2          =&gt; <span class="Constant">&quot;0f af/multiply *(ebp+&quot;</span> var2.stack-offset <span class="Constant">&quot;) &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
+var/reg <span class="SpecialChar">&lt;-</span> multiply *var2/reg2    =&gt; <span class="Constant">&quot;0f af/multiply *&quot;</span> reg2 <span class="Constant">&quot; &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
 
 <span class="PreProc">break</span>                             =&gt; <span class="Constant">&quot;e9/jump break/disp32&quot;</span>
 <span class="PreProc">break</span> label                       =&gt; <span class="Constant">&quot;e9/jump &quot;</span> label <span class="Constant">&quot;:break/disp32&quot;</span>
@@ -198,32 +198,32 @@ be provided in an earlier 'var' declaration.
 
 <span class="Comment"># Address operations</span>
 
-var/reg: (addr T) <span class="Special">&lt;-</span> address var2: T
+var/reg: (addr T) <span class="SpecialChar">&lt;-</span> address var2: T
   =&gt; <span class="Constant">&quot;8d/copy-address *(ebp+&quot;</span> var2.stack-offset <span class="Constant">&quot;) &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
 
 <span class="Comment"># Array operations</span>
 (TODO: bounds-checking)
 
-var/reg <span class="Special">&lt;-</span> index arr/rega: (addr array T), idx/regi: int
+var/reg <span class="SpecialChar">&lt;-</span> index arr/rega: (addr array T), idx/regi: int
   | if size-of(T) is <span class="Constant">4</span> or <span class="Constant">8</span>
       =&gt; <span class="Constant">&quot;8d/copy-address *(&quot;</span> rega <span class="Constant">&quot;+&quot;</span> regi <span class="Constant">&quot;&lt;&lt;&quot;</span> log2(size-of(T)) <span class="Constant">&quot;+4) &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
-var/reg <span class="Special">&lt;-</span> index arr: (array T sz), idx/regi: int
+var/reg <span class="SpecialChar">&lt;-</span> index arr: (array T sz), idx/regi: int
   =&gt; <span class="Constant">&quot;8d/copy-address *(ebp+&quot;</span> regi <span class="Constant">&quot;&lt;&lt;&quot;</span> log2(size-of(T)) <span class="Constant">&quot;+&quot;</span> (arr.stack-offset + <span class="Constant">4</span>) <span class="Constant">&quot;) &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
-var/reg <span class="Special">&lt;-</span> index arr/rega: (addr array T), n
+var/reg <span class="SpecialChar">&lt;-</span> index arr/rega: (addr array T), n
   =&gt; <span class="Constant">&quot;8d/copy-address *(&quot;</span> rega <span class="Constant">&quot;+&quot;</span> (n*size-of(T)+<span class="Constant">4</span>) <span class="Constant">&quot;) &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
-var/reg <span class="Special">&lt;-</span> index arr: (array T sz), n
+var/reg <span class="SpecialChar">&lt;-</span> index arr: (array T sz), n
   =&gt; <span class="Constant">&quot;8d/copy-address *(ebp+&quot;</span> (arr.stack-offset+<span class="Constant">4</span>+n*size-of(T)) <span class="Constant">&quot;) &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
 
-var/reg: (offset T) <span class="Special">&lt;-</span> compute-offset arr: (addr array T), idx/regi: int  <span class="Comment"># arr can be in reg or mem</span>
+var/reg: (offset T) <span class="SpecialChar">&lt;-</span> compute-offset arr: (addr array T), idx/regi: int  <span class="Comment"># arr can be in reg or mem</span>
   =&gt; <span class="Constant">&quot;69/multiply %&quot;</span> regi <span class="Constant">&quot; &quot;</span> size-of(T) <span class="Constant">&quot;/imm32 &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
-var/reg: (offset T) <span class="Special">&lt;-</span> compute-offset arr: (addr array T), idx: int       <span class="Comment"># arr can be in reg or mem</span>
+var/reg: (offset T) <span class="SpecialChar">&lt;-</span> compute-offset arr: (addr array T), idx: int       <span class="Comment"># arr can be in reg or mem</span>
   =&gt; <span class="Constant">&quot;69/multiply *(ebp+&quot;</span> idx.stack-offset <span class="Constant">&quot;) &quot;</span> size-of(T) <span class="Constant">&quot;/imm32 &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
-var/reg <span class="Special">&lt;-</span> index arr/rega: (addr array T), o/rego: offset
+var/reg <span class="SpecialChar">&lt;-</span> index arr/rega: (addr array T), o/rego: offset
   =&gt; <span class="Constant">&quot;8d/copy-address *(&quot;</span> rega <span class="Constant">&quot;+&quot;</span> rego <span class="Constant">&quot;+4) &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
 
 Computing the length of an array is complex.
 
-var/reg <span class="Special">&lt;-</span> length arr/reg2: (addr array T)
+var/reg <span class="SpecialChar">&lt;-</span> length arr/reg2: (addr array T)
   | if T is byte (TODO)
       =&gt; <span class="Constant">&quot;8b/-&gt; *&quot;</span> reg2 <span class="Constant">&quot; &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
   | if size-of(T) is <span class="Constant">4</span> or <span class="Constant">8</span> or <span class="Constant">16</span> or <span class="Constant">32</span> or <span class="Constant">64</span> or <span class="Constant">128</span>
@@ -256,24 +256,11 @@ var/reg <span class="Special">&lt;-</span> length arr/reg2: (addr array T)
 If a record (product) type T was defined to have elements a, b, c, ... of
 types T_a, T_b, T_c, ..., then accessing one of those elements f of type T_f:
 
-var/reg: (addr T_f) <span class="Special">&lt;-</span> get var2/reg2: (addr T), f
+var/reg: (addr T_f) <span class="SpecialChar">&lt;-</span> get var2/reg2: (addr T), f
   =&gt; <span class="Constant">&quot;8d/copy-address *(&quot;</span> reg2 <span class="Constant">&quot;+&quot;</span> offset(f) <span class="Constant">&quot;) &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
-var/reg: (addr T_f) <span class="Special">&lt;-</span> get var2: T, f
+var/reg: (addr T_f) <span class="SpecialChar">&lt;-</span> get var2: T, f
   =&gt; <span class="Constant">&quot;8d/copy-address *(ebp+&quot;</span> var2.stack-offset <span class="Constant">&quot;+&quot;</span> offset(f) <span class="Constant">&quot;) &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
 
-<span class="Comment"># Handles for safe access to the heap</span>
-
-out/reg: (addr T) <span class="Special">&lt;-</span> lookup in: (handle T)
-  =&gt; <span class="Comment"># payload_allocid = in-&gt;address-&gt;allocid</span>
-     <span class="Constant">&quot;8b/-&gt; *(epb+&quot;</span> (in.stack-offset+<span class="Constant">4</span>) <span class="Constant">&quot;) &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
-     <span class="Constant">&quot;8b/-&gt; *&quot;</span> reg <span class="Constant">&quot; &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
-     <span class="Comment"># if (payload_allocid != handle-&gt;allocid) abort</span>
-     <span class="Constant">&quot;39/compare *(ebp+&quot;</span> in.stack-offset <span class="Constant">&quot;) &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
-     <span class="Constant">&quot;0f 85/jump-if-!= $lookup:abort/disp32&quot;</span>
-     <span class="Comment"># return payload</span>
-     <span class="Constant">&quot;8b/-&gt; *(epb+&quot;</span> (in.stack-offset+<span class="Constant">4</span>) <span class="Constant">&quot;) &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
-     <span class="Constant">&quot;81 0/subop/add %&quot;</span> reg <span class="Constant">&quot; 4/imm32&quot;</span>  <span class="Comment"># skip payload-&gt;allocid</span>
-
 <span class="Comment"># Allocating memory</span>
 
 allocate in: (addr handle T)
@@ -282,6 +269,15 @@ allocate in: (addr handle T)
 populate in: (addr handle array T), num  <span class="Comment"># can be literal or variable on stack or register</span>
   =&gt; <span class="Constant">&quot;(allocate-array2 Heap &quot;</span> size-of(T) <span class="Constant">&quot; &quot;</span> num <span class="Constant">&quot; &quot;</span> in <span class="Constant">&quot;)&quot;</span>
 
+populate-stream in: (addr handle stream T), num  <span class="Comment"># can be literal or variable on stack or register</span>
+  =&gt; <span class="Constant">&quot;(new-stream Heap &quot;</span> size-of(T) <span class="Constant">&quot; &quot;</span> num <span class="Constant">&quot; &quot;</span> in <span class="Constant">&quot;)&quot;</span>
+
+read-from-stream s: (addr stream T), out: (addr T)
+  =&gt; <span class="Constant">&quot;(read-from-stream &quot;</span> s <span class="Constant">&quot; &quot;</span> out <span class="Constant">&quot; &quot;</span> size-of(T) <span class="Constant">&quot;)&quot;</span>
+
+write-to-stream s: (addr stream T), in: (addr T)
+  =&gt; <span class="Constant">&quot;(write-to-stream &quot;</span> s <span class="Constant">&quot; &quot;</span> in <span class="Constant">&quot; &quot;</span> size-of(T) <span class="Constant">&quot;)&quot;</span>
+
 vim&#0058;ft=mu:nowrap:textwidth=<span class="Constant">0</span>
 </pre>
 </body>