diff options
author | Kartik Agaram <vc@akkartik.com> | 2020-07-16 22:34:57 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2020-07-16 22:34:57 -0700 |
commit | 28b25a489338f31f291832e8dc94174619387e95 (patch) | |
tree | 2bb64dedeb89f7618913f38184ae6e796417a18a /html/mu_instructions.html | |
parent | 571dd3e23c2cfd4c3665c073a248cee4e1acd594 (diff) | |
download | mu-28b25a489338f31f291832e8dc94174619387e95.tar.gz |
6657
Diffstat (limited to 'html/mu_instructions.html')
-rw-r--r-- | html/mu_instructions.html | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/html/mu_instructions.html b/html/mu_instructions.html index 0353f35b..6d91ec55 100644 --- a/html/mu_instructions.html +++ b/html/mu_instructions.html @@ -101,6 +101,13 @@ var/reg <span class="Special"><-</span> xor n => <span cl xor-with var, n => <span class="Constant">"81 6/subop/xor *(ebp+"</span> var.stack-offset <span class="Constant">") "</span> n <span class="Constant">"/imm32"</span> xor-with *var/reg, n => <span class="Constant">"81 6/subop/xor *"</span> reg <span class="Constant">" "</span> n <span class="Constant">"/imm32"</span> +var/reg <span class="Special"><-</span> shift-left n +var/reg <span class="Special"><-</span> shift-right n +var/reg <span class="Special"><-</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"><-</span> copy n => <span class="Constant">"b8/copy-to-eax "</span> n <span class="Constant">"/imm32"</span> var/<span class="Constant">ecx</span> <span class="Special"><-</span> copy n => <span class="Constant">"b9/copy-to-ecx "</span> n <span class="Constant">"/imm32"</span> var/<span class="Constant">edx</span> <span class="Special"><-</span> copy n => <span class="Constant">"ba/copy-to-edx "</span> n <span class="Constant">"/imm32"</span> @@ -115,6 +122,10 @@ var/reg <span class="Special"><-</span> copy n => <span cl copy-to var, n => <span class="Constant">"c7 0/subop/copy *(ebp+"</span> var.stack-offset <span class="Constant">") "</span> n <span class="Constant">"/imm32"</span> copy-to *var/reg, n => <span class="Constant">"c7 0/subop/copy *"</span> reg <span class="Constant">" "</span> n <span class="Constant">"/imm32"</span> +var/reg <span class="Special"><-</span> copy-byte var2/reg2 => <span class="Constant">"8a/byte-> %"</span> reg2 <span class="Constant">" "</span> reg <span class="Constant">"/r32"</span> +var/reg <span class="Special"><-</span> copy-byte *var2/reg2 => <span class="Constant">"8a/byte-> *"</span> reg2 <span class="Constant">" "</span> reg <span class="Constant">"/r32"</span> +copy-byte-to *var1/reg1, var2/reg2 => <span class="Constant">"88/byte<- *"</span> reg1 <span class="Constant">" "</span> reg2 <span class="Constant">"/r32"</span> + compare var1, var2/reg2 => <span class="Constant">"39/compare *(ebp+"</span> var1.stack-offset <span class="Constant">") "</span> reg2 <span class="Constant">"/r32"</span> compare *var1/reg1, var2/reg2 => <span class="Constant">"39/compare *"</span> reg1 <span class="Constant">" "</span> reg2 <span class="Constant">"/r32"</span> compare var1/reg1, var2 => <span class="Constant">"3b/compare<- *(ebp+"</span> var2.stack-offset <span class="Constant">") "</span> reg1 <span class="Constant">"/r32"</span> @@ -245,29 +256,13 @@ var/reg <span class="Special"><-</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"><-</span> get var2/reg2: (addr F), f +var/reg: (addr T_f) <span class="Special"><-</span> get var2/reg2: (addr T), f => <span class="Constant">"8d/copy-address *("</span> reg2 <span class="Constant">"+"</span> offset(f) <span class="Constant">") "</span> reg <span class="Constant">"/r32"</span> -var/reg: (addr T_f) <span class="Special"><-</span> get var2: (addr F), f +var/reg: (addr T_f) <span class="Special"><-</span> get var2: T, f => <span class="Constant">"8d/copy-address *(ebp+"</span> var2.stack-offset <span class="Constant">"+"</span> offset(f) <span class="Constant">") "</span> reg <span class="Constant">"/r32"</span> <span class="Comment"># Handles for safe access to the heap</span> -copy-handle-to dest: (handle T), src: (handle T) - => <span class="Constant">"50/push-eax"</span> - <span class="Constant">"8b/-> *(ebp+"</span> src.stack-offset <span class="Constant">") 0/r32/eax"</span> - <span class="Constant">"89/<- *(ebp+"</span> dest.stack-offset <span class="Constant">") 0/r32/eax"</span> - <span class="Constant">"8b/-> *(ebp+"</span> src.stack-offset+<span class="Constant">4</span> <span class="Constant">") 0/r32/eax"</span> - <span class="Constant">"89/<- *(ebp+"</span> dest.stack-offset+<span class="Constant">4</span> <span class="Constant">") 0/r32/eax"</span> - <span class="Constant">"58/pop-to-eax"</span> - -copy-handle-to *dest/reg: (addr handle T), src: (handle T) - => <span class="Constant">"50/push-eax"</span> - <span class="Constant">"8b/-> *(ebp+"</span> src.stack-offset <span class="Constant">") 0/r32/eax"</span> - <span class="Constant">"89/<- *"</span> reg <span class="Constant">" 0/r32/eax"</span> - <span class="Constant">"8b/-> *(ebp+"</span> src.stack-offset+<span class="Constant">4</span> <span class="Constant">") 0/r32/eax"</span> - <span class="Constant">"89/<- *("</span> reg <span class="Constant">"+4) 0/r32/eax"</span> - <span class="Constant">"58/pop-to-eax"</span> - out/reg: (addr T) <span class="Special"><-</span> lookup in: (handle T) => <span class="Comment"># payload_allocid = in->address->allocid</span> <span class="Constant">"8b/-> *(epb+"</span> (in.stack-offset+<span class="Constant">4</span>) <span class="Constant">") "</span> reg <span class="Constant">"/r32"</span> @@ -279,6 +274,14 @@ out/reg: (addr T) <span class="Special"><-</span> lookup in: (handle T) <span class="Constant">"8b/-> *(epb+"</span> (in.stack-offset+<span class="Constant">4</span>) <span class="Constant">") "</span> reg <span class="Constant">"/r32"</span> <span class="Constant">"81 0/subop/add %"</span> reg <span class="Constant">" 4/imm32"</span> <span class="Comment"># skip payload->allocid</span> +<span class="Comment"># Allocating memory</span> + +allocate in: (addr handle T) + => <span class="Constant">"(allocate Heap "</span> size-of(T) <span class="Constant">" "</span> in <span class="Constant">")"</span> + +populate in: (addr handle array T), num <span class="Comment"># can be literal or variable on stack or register</span> + => <span class="Constant">"(allocate-array2 Heap "</span> size-of(T) <span class="Constant">" "</span> num <span class="Constant">" "</span> in <span class="Constant">")"</span> + vim:ft=mu:nowrap:textwidth=<span class="Constant">0</span> </pre> </body> |