diff options
author | Kartik Agaram <vc@akkartik.com> | 2020-03-24 03:49:37 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2020-03-24 03:49:56 -0700 |
commit | be19cb8772aee45c596126078a72e510cf66b471 (patch) | |
tree | 3c0d43056bf30a1e4f25320c7108b55c1db17880 | |
parent | e25b9e0a4d931141bf191340639d7232c235cdaf (diff) | |
download | mu-be19cb8772aee45c596126078a72e510cf66b471.tar.gz |
6164
-rw-r--r-- | html/mu_instructions.html | 182 | ||||
-rw-r--r-- | mu_instructions | 4 |
2 files changed, 93 insertions, 93 deletions
diff --git a/html/mu_instructions.html b/html/mu_instructions.html index d986552a..fef2054e 100644 --- a/html/mu_instructions.html +++ b/html/mu_instructions.html @@ -31,93 +31,93 @@ with the instruction they're translated to. Variables of the form <span class="C live in a register, and other variables are assumed to live on the stack at some 'stack-offset' from ebp. -<span class="PreProc">var</span>/<span class="Constant">eax</span> <span class="Special"><-</span> increment => <span class="Constant">"40/increment-eax"</span> -<span class="PreProc">var</span>/<span class="Constant">ecx</span> <span class="Special"><-</span> increment => <span class="Constant">"41/increment-ecx"</span> -<span class="PreProc">var</span>/<span class="Constant">edx</span> <span class="Special"><-</span> increment => <span class="Constant">"42/increment-edx"</span> -<span class="PreProc">var</span>/<span class="Constant">ebx</span> <span class="Special"><-</span> increment => <span class="Constant">"43/increment-ebx"</span> -<span class="PreProc">var</span>/<span class="Constant">esi</span> <span class="Special"><-</span> increment => <span class="Constant">"46/increment-esi"</span> -<span class="PreProc">var</span>/<span class="Constant">edi</span> <span class="Special"><-</span> increment => <span class="Constant">"47/increment-edi"</span> -increment <span class="PreProc">var</span> => <span class="Constant">"ff 0/subop/increment *(ebp+"</span> <span class="PreProc">var</span>.stack-offset <span class="Constant">")"</span> -increment *<span class="PreProc">var</span>/reg => <span class="Constant">"ff 0/subop/increment *"</span> reg - -<span class="PreProc">var</span>/<span class="Constant">eax</span> <span class="Special"><-</span> decrement => <span class="Constant">"48/decrement-eax"</span> -<span class="PreProc">var</span>/<span class="Constant">ecx</span> <span class="Special"><-</span> decrement => <span class="Constant">"49/decrement-ecx"</span> -<span class="PreProc">var</span>/<span class="Constant">edx</span> <span class="Special"><-</span> decrement => <span class="Constant">"4a/decrement-edx"</span> -<span class="PreProc">var</span>/<span class="Constant">ebx</span> <span class="Special"><-</span> decrement => <span class="Constant">"4b/decrement-ebx"</span> -<span class="PreProc">var</span>/<span class="Constant">esi</span> <span class="Special"><-</span> decrement => <span class="Constant">"4e/decrement-esi"</span> -<span class="PreProc">var</span>/<span class="Constant">edi</span> <span class="Special"><-</span> decrement => <span class="Constant">"4f/decrement-edi"</span> -decrement <span class="PreProc">var</span> => <span class="Constant">"ff 1/subop/decrement *(ebp+"</span> <span class="PreProc">var</span>.stack-offset <span class="Constant">")"</span> -decrement *<span class="PreProc">var</span>/reg => <span class="Constant">"ff 1/subop/decrement *"</span> reg - -<span class="PreProc">var</span>/reg <span class="Special"><-</span> add var2/reg2 => <span class="Constant">"01/add-to %"</span> reg <span class="Constant">" "</span> reg2 <span class="Constant">"/r32"</span> -<span class="PreProc">var</span>/reg <span class="Special"><-</span> add var2 => <span class="Constant">"03/add *(ebp+"</span> var2.stack-offset <span class="Constant">") "</span> reg <span class="Constant">"/r32"</span> -<span class="PreProc">var</span>/reg <span class="Special"><-</span> add *var2/reg2 => <span class="Constant">"03/add *"</span> reg2 <span class="Constant">" "</span> reg <span class="Constant">"/r32"</span> +var/<span class="Constant">eax</span> <span class="Special"><-</span> increment => <span class="Constant">"40/increment-eax"</span> +var/<span class="Constant">ecx</span> <span class="Special"><-</span> increment => <span class="Constant">"41/increment-ecx"</span> +var/<span class="Constant">edx</span> <span class="Special"><-</span> increment => <span class="Constant">"42/increment-edx"</span> +var/<span class="Constant">ebx</span> <span class="Special"><-</span> increment => <span class="Constant">"43/increment-ebx"</span> +var/<span class="Constant">esi</span> <span class="Special"><-</span> increment => <span class="Constant">"46/increment-esi"</span> +var/<span class="Constant">edi</span> <span class="Special"><-</span> increment => <span class="Constant">"47/increment-edi"</span> +increment var => <span class="Constant">"ff 0/subop/increment *(ebp+"</span> var.stack-offset <span class="Constant">")"</span> +increment *var/reg => <span class="Constant">"ff 0/subop/increment *"</span> reg + +var/<span class="Constant">eax</span> <span class="Special"><-</span> decrement => <span class="Constant">"48/decrement-eax"</span> +var/<span class="Constant">ecx</span> <span class="Special"><-</span> decrement => <span class="Constant">"49/decrement-ecx"</span> +var/<span class="Constant">edx</span> <span class="Special"><-</span> decrement => <span class="Constant">"4a/decrement-edx"</span> +var/<span class="Constant">ebx</span> <span class="Special"><-</span> decrement => <span class="Constant">"4b/decrement-ebx"</span> +var/<span class="Constant">esi</span> <span class="Special"><-</span> decrement => <span class="Constant">"4e/decrement-esi"</span> +var/<span class="Constant">edi</span> <span class="Special"><-</span> decrement => <span class="Constant">"4f/decrement-edi"</span> +decrement var => <span class="Constant">"ff 1/subop/decrement *(ebp+"</span> var.stack-offset <span class="Constant">")"</span> +decrement *var/reg => <span class="Constant">"ff 1/subop/decrement *"</span> reg + +var/reg <span class="Special"><-</span> add var2/reg2 => <span class="Constant">"01/add-to %"</span> reg <span class="Constant">" "</span> reg2 <span class="Constant">"/r32"</span> +var/reg <span class="Special"><-</span> add var2 => <span class="Constant">"03/add *(ebp+"</span> var2.stack-offset <span class="Constant">") "</span> reg <span class="Constant">"/r32"</span> +var/reg <span class="Special"><-</span> add *var2/reg2 => <span class="Constant">"03/add *"</span> reg2 <span class="Constant">" "</span> reg <span class="Constant">"/r32"</span> add-to var1, var2/reg => <span class="Constant">"01/add-to *(ebp+"</span> var1.stack-offset <span class="Constant">") "</span> reg <span class="Constant">"/r32"</span> -<span class="PreProc">var</span>/<span class="Constant">eax</span> <span class="Special"><-</span> add n => <span class="Constant">"05/add-to-eax "</span> n <span class="Constant">"/imm32"</span> -<span class="PreProc">var</span>/reg <span class="Special"><-</span> add n => <span class="Constant">"81 0/subop/add %"</span> reg <span class="Constant">" "</span> n <span class="Constant">"/imm32"</span> -add-to <span class="PreProc">var</span>, n => <span class="Constant">"81 0/subop/add *(ebp+"</span> <span class="PreProc">var</span>.stack-offset <span class="Constant">") "</span> n <span class="Constant">"/imm32"</span> -add-to *<span class="PreProc">var</span>/reg, n => <span class="Constant">"81 0/subop/add *"</span> reg <span class="Constant">" "</span> n <span class="Constant">"/imm32"</span> - -<span class="PreProc">var</span>/reg <span class="Special"><-</span> subtract var2/reg2 => <span class="Constant">"29/subtract-from %"</span> reg <span class="Constant">" "</span> reg2 <span class="Constant">"/r32"</span> -<span class="PreProc">var</span>/reg <span class="Special"><-</span> subtract var2 => <span class="Constant">"2b/subtract *(ebp+"</span> var2.stack-offset <span class="Constant">") "</span> reg <span class="Constant">"/r32"</span> -<span class="PreProc">var</span>/reg <span class="Special"><-</span> subtract *var2/reg2 => <span class="Constant">"2b/subtract *"</span> reg2 <span class="Constant">" "</span> reg1 <span class="Constant">"/r32"</span> +var/<span class="Constant">eax</span> <span class="Special"><-</span> add n => <span class="Constant">"05/add-to-eax "</span> n <span class="Constant">"/imm32"</span> +var/reg <span class="Special"><-</span> add n => <span class="Constant">"81 0/subop/add %"</span> reg <span class="Constant">" "</span> n <span class="Constant">"/imm32"</span> +add-to var, n => <span class="Constant">"81 0/subop/add *(ebp+"</span> var.stack-offset <span class="Constant">") "</span> n <span class="Constant">"/imm32"</span> +add-to *var/reg, n => <span class="Constant">"81 0/subop/add *"</span> reg <span class="Constant">" "</span> n <span class="Constant">"/imm32"</span> + +var/reg <span class="Special"><-</span> subtract var2/reg2 => <span class="Constant">"29/subtract-from %"</span> reg <span class="Constant">" "</span> reg2 <span class="Constant">"/r32"</span> +var/reg <span class="Special"><-</span> subtract var2 => <span class="Constant">"2b/subtract *(ebp+"</span> var2.stack-offset <span class="Constant">") "</span> reg <span class="Constant">"/r32"</span> +var/reg <span class="Special"><-</span> subtract *var2/reg2 => <span class="Constant">"2b/subtract *"</span> reg2 <span class="Constant">" "</span> reg1 <span class="Constant">"/r32"</span> subtract-from var1, var2/reg2 => <span class="Constant">"29/subtract-from *(ebp+"</span> var1.stack-offset <span class="Constant">") "</span> reg2 <span class="Constant">"/r32"</span> -<span class="PreProc">var</span>/<span class="Constant">eax</span> <span class="Special"><-</span> subtract n => <span class="Constant">"2d/subtract-from-eax "</span> n <span class="Constant">"/imm32"</span> -<span class="PreProc">var</span>/reg <span class="Special"><-</span> subtract n => <span class="Constant">"81 5/subop/subtract %"</span> reg <span class="Constant">" "</span> n <span class="Constant">"/imm32"</span> -subtract-from <span class="PreProc">var</span>, n => <span class="Constant">"81 5/subop/subtract *(ebp+"</span> <span class="PreProc">var</span>.stack-offset <span class="Constant">") "</span> n <span class="Constant">"/imm32"</span> -subtract-from *<span class="PreProc">var</span>/reg, n => <span class="Constant">"81 5/subop/subtract *"</span> reg <span class="Constant">" "</span> n <span class="Constant">"/imm32"</span> - -<span class="PreProc">var</span>/reg <span class="Special"><-</span> and var2/reg2 => <span class="Constant">"21/and-with %"</span> reg <span class="Constant">" "</span> reg2 <span class="Constant">"/r32"</span> -<span class="PreProc">var</span>/reg <span class="Special"><-</span> and var2 => <span class="Constant">"23/and *(ebp+"</span> var2.stack-offset <span class="Constant">" "</span> reg <span class="Constant">"/r32"</span> -<span class="PreProc">var</span>/reg <span class="Special"><-</span> and *var2/reg2 => <span class="Constant">"23/and *"</span> reg2 <span class="Constant">" "</span> reg <span class="Constant">"/r32"</span> +var/<span class="Constant">eax</span> <span class="Special"><-</span> subtract n => <span class="Constant">"2d/subtract-from-eax "</span> n <span class="Constant">"/imm32"</span> +var/reg <span class="Special"><-</span> subtract n => <span class="Constant">"81 5/subop/subtract %"</span> reg <span class="Constant">" "</span> n <span class="Constant">"/imm32"</span> +subtract-from var, n => <span class="Constant">"81 5/subop/subtract *(ebp+"</span> var.stack-offset <span class="Constant">") "</span> n <span class="Constant">"/imm32"</span> +subtract-from *var/reg, n => <span class="Constant">"81 5/subop/subtract *"</span> reg <span class="Constant">" "</span> n <span class="Constant">"/imm32"</span> + +var/reg <span class="Special"><-</span> and var2/reg2 => <span class="Constant">"21/and-with %"</span> reg <span class="Constant">" "</span> reg2 <span class="Constant">"/r32"</span> +var/reg <span class="Special"><-</span> and var2 => <span class="Constant">"23/and *(ebp+"</span> var2.stack-offset <span class="Constant">" "</span> reg <span class="Constant">"/r32"</span> +var/reg <span class="Special"><-</span> and *var2/reg2 => <span class="Constant">"23/and *"</span> reg2 <span class="Constant">" "</span> reg <span class="Constant">"/r32"</span> and-with var1, var2/reg => <span class="Constant">"21/and-with *(ebp+"</span> var1.stack-offset <span class="Constant">") "</span> reg <span class="Constant">"/r32"</span> -<span class="PreProc">var</span>/<span class="Constant">eax</span> <span class="Special"><-</span> and n => <span class="Constant">"25/and-with-eax "</span> n <span class="Constant">"/imm32"</span> -<span class="PreProc">var</span>/reg <span class="Special"><-</span> and n => <span class="Constant">"81 4/subop/and %"</span> reg <span class="Constant">" "</span> n <span class="Constant">"/imm32"</span> -and-with <span class="PreProc">var</span>, n => <span class="Constant">"81 4/subop/and *(ebp+"</span> <span class="PreProc">var</span>.stack-offset <span class="Constant">") "</span> n <span class="Constant">"/imm32"</span> -and-with *<span class="PreProc">var</span>/reg, n => <span class="Constant">"81 4/subop/and *"</span> reg <span class="Constant">" "</span> n <span class="Constant">"/imm32"</span> - -<span class="PreProc">var</span>/reg <span class="Special"><-</span> or var2/reg2 => <span class="Constant">"09/or-with %"</span> reg <span class="Constant">" "</span> reg2 <span class="Constant">"/r32"</span> -<span class="PreProc">var</span>/reg <span class="Special"><-</span> or var2 => <span class="Constant">"0b/or *(ebp+"</span> var2.stack-offset <span class="Constant">") "</span> reg <span class="Constant">"/r32"</span> -<span class="PreProc">var</span>/reg <span class="Special"><-</span> or *var2/reg2 => <span class="Constant">"0b/or *"</span> reg2 <span class="Constant">" "</span> reg <span class="Constant">"/r32"</span> +var/<span class="Constant">eax</span> <span class="Special"><-</span> and n => <span class="Constant">"25/and-with-eax "</span> n <span class="Constant">"/imm32"</span> +var/reg <span class="Special"><-</span> and n => <span class="Constant">"81 4/subop/and %"</span> reg <span class="Constant">" "</span> n <span class="Constant">"/imm32"</span> +and-with var, n => <span class="Constant">"81 4/subop/and *(ebp+"</span> var.stack-offset <span class="Constant">") "</span> n <span class="Constant">"/imm32"</span> +and-with *var/reg, n => <span class="Constant">"81 4/subop/and *"</span> reg <span class="Constant">" "</span> n <span class="Constant">"/imm32"</span> + +var/reg <span class="Special"><-</span> or var2/reg2 => <span class="Constant">"09/or-with %"</span> reg <span class="Constant">" "</span> reg2 <span class="Constant">"/r32"</span> +var/reg <span class="Special"><-</span> or var2 => <span class="Constant">"0b/or *(ebp+"</span> var2.stack-offset <span class="Constant">") "</span> reg <span class="Constant">"/r32"</span> +var/reg <span class="Special"><-</span> or *var2/reg2 => <span class="Constant">"0b/or *"</span> reg2 <span class="Constant">" "</span> reg <span class="Constant">"/r32"</span> or-with var1, var2/reg2 => <span class="Constant">"09/or-with *(ebp+"</span> var1.stack-offset <span class="Constant">" "</span> reg2 <span class="Constant">"/r32"</span> -<span class="PreProc">var</span>/<span class="Constant">eax</span> <span class="Special"><-</span> or n => <span class="Constant">"0d/or-with-eax "</span> n <span class="Constant">"/imm32"</span> -<span class="PreProc">var</span>/reg <span class="Special"><-</span> or n => <span class="Constant">"81 1/subop/or %"</span> reg <span class="Constant">" "</span> n <span class="Constant">"/imm32"</span> -or-with <span class="PreProc">var</span>, n => <span class="Constant">"81 1/subop/or *(ebp+"</span> <span class="PreProc">var</span>.stack-offset <span class="Constant">") "</span> n <span class="Constant">"/imm32"</span> -or-with *<span class="PreProc">var</span>/reg, n => <span class="Constant">"81 1/subop/or *"</span> reg <span class="Constant">" "</span> n <span class="Constant">"/imm32"</span> - -<span class="PreProc">var</span>/reg <span class="Special"><-</span> xor var2/reg2 => <span class="Constant">"31/xor-with %"</span> reg <span class="Constant">" "</span> reg2 <span class="Constant">"/r32"</span> -<span class="PreProc">var</span>/reg <span class="Special"><-</span> xor var2 => <span class="Constant">"33/xor *(ebp+"</span> var2.stack-offset <span class="Constant">") "</span> reg <span class="Constant">"/r32"</span> -<span class="PreProc">var</span>/reg <span class="Special"><-</span> xor *var2/reg2 => <span class="Constant">"33/xor *"</span> reg2 <span class="Constant">" "</span> reg <span class="Constant">"/r32"</span> +var/<span class="Constant">eax</span> <span class="Special"><-</span> or n => <span class="Constant">"0d/or-with-eax "</span> n <span class="Constant">"/imm32"</span> +var/reg <span class="Special"><-</span> or n => <span class="Constant">"81 1/subop/or %"</span> reg <span class="Constant">" "</span> n <span class="Constant">"/imm32"</span> +or-with var, n => <span class="Constant">"81 1/subop/or *(ebp+"</span> var.stack-offset <span class="Constant">") "</span> n <span class="Constant">"/imm32"</span> +or-with *var/reg, n => <span class="Constant">"81 1/subop/or *"</span> reg <span class="Constant">" "</span> n <span class="Constant">"/imm32"</span> + +var/reg <span class="Special"><-</span> xor var2/reg2 => <span class="Constant">"31/xor-with %"</span> reg <span class="Constant">" "</span> reg2 <span class="Constant">"/r32"</span> +var/reg <span class="Special"><-</span> xor var2 => <span class="Constant">"33/xor *(ebp+"</span> var2.stack-offset <span class="Constant">") "</span> reg <span class="Constant">"/r32"</span> +var/reg <span class="Special"><-</span> xor *var2/reg2 => <span class="Constant">"33/xor *"</span> reg2 <span class="Constant">" "</span> reg <span class="Constant">"/r32"</span> xor-with var1, var2/reg => <span class="Constant">"31/xor-with *(ebp+"</span> var1.stack-offset <span class="Constant">") "</span> reg <span class="Constant">"/r32"</span> -<span class="PreProc">var</span>/<span class="Constant">eax</span> <span class="Special"><-</span> xor n => <span class="Constant">"35/xor-with-eax "</span> n <span class="Constant">"/imm32"</span> -<span class="PreProc">var</span>/reg <span class="Special"><-</span> xor n => <span class="Constant">"81 6/subop/xor %"</span> reg <span class="Constant">" "</span> n <span class="Constant">"/imm32"</span> -xor-with <span class="PreProc">var</span>, n => <span class="Constant">"81 6/subop/xor *(ebp+"</span> <span class="PreProc">var</span>.stack-offset <span class="Constant">") "</span> n <span class="Constant">"/imm32"</span> -xor-with *<span class="PreProc">var</span>/reg, n => <span class="Constant">"81 6/subop/xor *"</span> reg <span class="Constant">" "</span> n <span class="Constant">"/imm32"</span> - -<span class="PreProc">var</span>/<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> -<span class="PreProc">var</span>/<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> -<span class="PreProc">var</span>/<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> -<span class="PreProc">var</span>/<span class="Constant">ebx</span> <span class="Special"><-</span> copy n => <span class="Constant">"bb/copy-to-ebx "</span> n <span class="Constant">"/imm32"</span> -<span class="PreProc">var</span>/<span class="Constant">esi</span> <span class="Special"><-</span> copy n => <span class="Constant">"be/copy-to-esi "</span> n <span class="Constant">"/imm32"</span> -<span class="PreProc">var</span>/<span class="Constant">edi</span> <span class="Special"><-</span> copy n => <span class="Constant">"bf/copy-to-edi "</span> n <span class="Constant">"/imm32"</span> -<span class="PreProc">var</span>/reg <span class="Special"><-</span> copy var2/reg2 => <span class="Constant">"89/<- %"</span> reg <span class="Constant">" "</span> reg2 <span class="Constant">"/r32"</span> +var/<span class="Constant">eax</span> <span class="Special"><-</span> xor n => <span class="Constant">"35/xor-with-eax "</span> n <span class="Constant">"/imm32"</span> +var/reg <span class="Special"><-</span> xor n => <span class="Constant">"81 6/subop/xor %"</span> reg <span class="Constant">" "</span> n <span class="Constant">"/imm32"</span> +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/<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> +var/<span class="Constant">ebx</span> <span class="Special"><-</span> copy n => <span class="Constant">"bb/copy-to-ebx "</span> n <span class="Constant">"/imm32"</span> +var/<span class="Constant">esi</span> <span class="Special"><-</span> copy n => <span class="Constant">"be/copy-to-esi "</span> n <span class="Constant">"/imm32"</span> +var/<span class="Constant">edi</span> <span class="Special"><-</span> copy n => <span class="Constant">"bf/copy-to-edi "</span> n <span class="Constant">"/imm32"</span> +var/reg <span class="Special"><-</span> copy var2/reg2 => <span class="Constant">"89/<- %"</span> reg <span class="Constant">" "</span> reg2 <span class="Constant">"/r32"</span> copy-to var1, var2/reg => <span class="Constant">"89/<- *(ebp+"</span> var1.stack-offset <span class="Constant">") "</span> reg <span class="Constant">"/r32"</span> -<span class="PreProc">var</span>/reg <span class="Special"><-</span> copy var2 => <span class="Constant">"8b/-> *(ebp+"</span> var2.stack-offset <span class="Constant">") "</span> reg <span class="Constant">"/r32"</span> -<span class="PreProc">var</span>/reg <span class="Special"><-</span> copy *var2/reg2 => <span class="Constant">"8b/-> *"</span> reg2 <span class="Constant">" "</span> reg <span class="Constant">"/r32"</span> -<span class="PreProc">var</span>/reg <span class="Special"><-</span> copy n => <span class="Constant">"c7 0/subop/copy %"</span> reg <span class="Constant">" "</span> n <span class="Constant">"/imm32"</span> -copy-to <span class="PreProc">var</span>, n => <span class="Constant">"c7 0/subop/copy *(ebp+"</span> <span class="PreProc">var</span>.stack-offset <span class="Constant">") "</span> n <span class="Constant">"/imm32"</span> -copy-to *<span class="PreProc">var</span>/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 var2 => <span class="Constant">"8b/-> *(ebp+"</span> var2.stack-offset <span class="Constant">") "</span> reg <span class="Constant">"/r32"</span> +var/reg <span class="Special"><-</span> copy *var2/reg2 => <span class="Constant">"8b/-> *"</span> reg2 <span class="Constant">" "</span> reg <span class="Constant">"/r32"</span> +var/reg <span class="Special"><-</span> copy n => <span class="Constant">"c7 0/subop/copy %"</span> reg <span class="Constant">" "</span> n <span class="Constant">"/imm32"</span> +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> 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> -compare <span class="PreProc">var</span>/reg, *var2/reg2 => <span class="Constant">"3b/compare<- *"</span> reg <span class="Constant">" "</span> n <span class="Constant">"/imm32"</span> -compare <span class="PreProc">var</span>/<span class="Constant">eax</span>, n => <span class="Constant">"3d/compare-eax-with "</span> n <span class="Constant">"/imm32"</span> -compare <span class="PreProc">var</span>, n => <span class="Constant">"81 7/subop/compare *(ebp+"</span> <span class="PreProc">var</span>.stack-offset <span class="Constant">") "</span> n <span class="Constant">"/imm32"</span> -compare *<span class="PreProc">var</span>/reg, n => <span class="Constant">"81 7/subop/compare *"</span> reg <span class="Constant">" "</span> n <span class="Constant">"/imm32"</span> +compare var/reg, *var2/reg2 => <span class="Constant">"3b/compare<- *"</span> reg <span class="Constant">" "</span> n <span class="Constant">"/imm32"</span> +compare var/<span class="Constant">eax</span>, n => <span class="Constant">"3d/compare-eax-with "</span> n <span class="Constant">"/imm32"</span> +compare var, n => <span class="Constant">"81 7/subop/compare *(ebp+"</span> var.stack-offset <span class="Constant">") "</span> n <span class="Constant">"/imm32"</span> +compare *var/reg, n => <span class="Constant">"81 7/subop/compare *"</span> reg <span class="Constant">" "</span> n <span class="Constant">"/imm32"</span> -<span class="PreProc">var</span>/reg <span class="Special"><-</span> multiply var2 => <span class="Constant">"0f af/multiply *(ebp+"</span> var2.stack-offset <span class="Constant">") "</span> reg <span class="Constant">"/r32"</span> -<span class="PreProc">var</span>/reg <span class="Special"><-</span> multiply *var2/reg2 => <span class="Constant">"0f af/multiply *"</span> reg2 <span class="Constant">" "</span> reg <span class="Constant">"/r32"</span> +var/reg <span class="Special"><-</span> multiply var2 => <span class="Constant">"0f af/multiply *(ebp+"</span> var2.stack-offset <span class="Constant">") "</span> reg <span class="Constant">"/r32"</span> +var/reg <span class="Special"><-</span> multiply *var2/reg2 => <span class="Constant">"0f af/multiply *"</span> reg2 <span class="Constant">" "</span> reg <span class="Constant">"/r32"</span> <span class="PreProc">break</span> => <span class="Constant">"e9/jump break/disp32"</span> <span class="PreProc">break</span> label => <span class="Constant">"e9/jump "</span> label <span class="Constant">":break/disp32"</span> @@ -175,41 +175,41 @@ compare *<span class="PreProc">var</span>/reg, n => <span class <span class="PreProc">loop-if-addr>=</span> label => <span class="Constant">"0f 83/jump-if-addr>= "</span> label <span class="Constant">":loop/disp32"</span> In the following instructions types are provided for clarity even if they must -be provided in an earlier '<span class="PreProc">var</span>' declaration. +be provided in an earlier 'var' declaration. Address operations -<span class="PreProc">var</span>/reg: (addr T) <span class="Special"><-</span> address <span class="PreProc">var</span>: T - => <span class="Constant">"8d/copy-address *(ebp+"</span> <span class="PreProc">var</span>.stack-offset <span class="Constant">") "</span> reg <span class="Constant">"/r32"</span> +var/reg: (addr T) <span class="Special"><-</span> address var2: T + => <span class="Constant">"8d/copy-address *(ebp+"</span> var2.stack-offset <span class="Constant">") "</span> reg <span class="Constant">"/r32"</span> Array operations (TODO: bounds-checking) -<span class="PreProc">var</span>/reg <span class="Special"><-</span> length arr/reg2: (addr array T) +var/reg <span class="Special"><-</span> length arr/reg2: (addr array T) => <span class="Constant">"8b/-> *"</span> reg2 <span class="Constant">" "</span> reg <span class="Constant">"/r32"</span> -<span class="PreProc">var</span>/reg <span class="Special"><-</span> index arr/rega: (addr array T), idx/regi: int <span class="Comment"># if size(T) is 4 or 8</span> +var/reg <span class="Special"><-</span> index arr/rega: (addr array T), idx/regi: int <span class="Comment"># if size(T) is 4 or 8</span> => <span class="Constant">"8d/copy-address *("</span> rega <span class="Constant">"+"</span> regi <span class="Constant">"<<"</span> log2(size(T)) <span class="Constant">"+4) "</span> reg <span class="Constant">"/r32"</span> -<span class="PreProc">var</span>/reg <span class="Special"><-</span> index arr: (array T sz), idx/regi: int +var/reg <span class="Special"><-</span> index arr: (array T sz), idx/regi: int => <span class="Constant">"8d/copy-address *(ebp+"</span> regi <span class="Constant">"<<"</span> log2(size(T)) <span class="Constant">"+"</span> (arr.stack-offset + <span class="Constant">4</span>) <span class="Constant">") "</span> reg <span class="Constant">"/r32"</span> -<span class="PreProc">var</span>/reg <span class="Special"><-</span> index arr/rega: (addr array T), n +var/reg <span class="Special"><-</span> index arr/rega: (addr array T), n => <span class="Constant">"8d/copy-address *("</span> rega <span class="Constant">"+"</span> (n*size(T)+<span class="Constant">4</span>) <span class="Constant">") "</span> reg <span class="Constant">"/r32"</span> -<span class="PreProc">var</span>/reg <span class="Special"><-</span> index arr: (array T sz), n +var/reg <span class="Special"><-</span> index arr: (array T sz), n => <span class="Constant">"8d/copy-address *(ebp+"</span> (arr.stack-offset+<span class="Constant">4</span>+n*size(T)) <span class="Constant">") "</span> reg <span class="Constant">"/r32"</span> -<span class="PreProc">var</span>/reg: (offset T) <span class="Special"><-</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="Special"><-</span> compute-offset arr: (addr array T), idx/regi: int <span class="Comment"># arr can be in reg or mem</span> => <span class="Constant">"69/multiply %"</span> regi <span class="Constant">" "</span> size(T) <span class="Constant">"/imm32 "</span> reg <span class="Constant">"/r32"</span> -<span class="PreProc">var</span>/reg: (offset T) <span class="Special"><-</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="Special"><-</span> compute-offset arr: (addr array T), idx: int <span class="Comment"># arr can be in reg or mem</span> => <span class="Constant">"69/multiply *(ebp+"</span> idx.stack-offset <span class="Constant">") "</span> size(T) <span class="Constant">"/imm32 "</span> reg <span class="Constant">"/r32"</span> -<span class="PreProc">var</span>/reg <span class="Special"><-</span> index arr/rega: (addr array T), o/rego: offset +var/reg <span class="Special"><-</span> index arr/rega: (addr array T), o/rego: offset => <span class="Constant">"8d/copy-address *("</span> rega <span class="Constant">"+"</span> rego <span class="Constant">"+4) "</span> reg <span class="Constant">"/r32"</span> User-defined types -If a record (product) <span class="PreProc">type</span> 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 <span class="PreProc">type</span> T_f: +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: -<span class="PreProc">var</span>/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 F), 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> -<span class="PreProc">var</span>/reg: (addr T_f) <span class="Special"><-</span> get var2: (addr F), f +var/reg: (addr T_f) <span class="Special"><-</span> get var2: (addr F), 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> Handles for safe access to the heap diff --git a/mu_instructions b/mu_instructions index 7b2d53b3..6a450ec0 100644 --- a/mu_instructions +++ b/mu_instructions @@ -154,8 +154,8 @@ be provided in an earlier 'var' declaration. Address operations -var/reg: (addr T) <- address var: T - => "8d/copy-address *(ebp+" var.stack-offset ") " reg "/r32" +var/reg: (addr T) <- address var2: T + => "8d/copy-address *(ebp+" var2.stack-offset ") " reg "/r32" Array operations (TODO: bounds-checking) |