about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-10-01 00:46:38 -0700
committerKartik Agaram <vc@akkartik.com>2020-10-01 00:46:38 -0700
commit3d053e34b71832b38d77bb777e7acabcb1e63e76 (patch)
tree374b1c32ebe5cfb6d3a12bb228f44a2c7cb62471
parentdf04b364a689a4eb970087da253e93fb6ee3f22d (diff)
downloadmu-3d053e34b71832b38d77bb777e7acabcb1e63e76.tar.gz
6919
-rw-r--r--html/mu_instructions.html104
1 files changed, 98 insertions, 6 deletions
diff --git a/html/mu_instructions.html b/html/mu_instructions.html
index 0c66bc97..3a2313c5 100644
--- a/html/mu_instructions.html
+++ b/html/mu_instructions.html
@@ -60,6 +60,7 @@ var/reg <span class="SpecialChar">&lt;-</span> add var2/reg2          =&gt; <spa
 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>
+add-to *var1/reg1, var2/reg2      =&gt; <span class="Constant">&quot;01/add-to *&quot;</span> reg1 <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> 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>
@@ -69,6 +70,7 @@ var/reg <span class="SpecialChar">&lt;-</span> subtract var2/reg2     =&gt; <spa
 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>
+subtract-from *var1/reg1, var2/reg2 =&gt; <span class="Constant">&quot;29/subtract-from *&quot;</span> reg1 <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> 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>
@@ -78,6 +80,7 @@ var/reg <span class="SpecialChar">&lt;-</span> and var2/reg2          =&gt; <spa
 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>
+and-with *var1/reg1, var2/reg2    =&gt; <span class="Constant">&quot;21/and-with *&quot;</span> reg1 <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> 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>
@@ -87,6 +90,7 @@ var/reg <span class="SpecialChar">&lt;-</span> or var2/reg2           =&gt; <spa
 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>
+or-with *var1/reg1, var2/reg2     =&gt; <span class="Constant">&quot;09/or-with *&quot;</span> reg1 <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> 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>
@@ -96,17 +100,21 @@ var/reg <span class="SpecialChar">&lt;-</span> xor var2/reg2          =&gt; <spa
 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>
+xor-with *var1/reg1, var2/reg2    =&gt; <span class="Constant">&quot;31/xor-with *&quot;</span> reg1 <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> 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="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/reg <span class="SpecialChar">&lt;-</span> shift-left n           =&gt; <span class="Constant">&quot;c1/shift 4/subop/left %&quot;</span> reg <span class="Constant">&quot; &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
+var/reg <span class="SpecialChar">&lt;-</span> shift-right n          =&gt; <span class="Constant">&quot;c1/shift 5/subop/right %&quot;</span> reg <span class="Constant">&quot; &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
+var/reg <span class="SpecialChar">&lt;-</span> shift-right-signed n   =&gt; <span class="Constant">&quot;c1/shift 7/subop/right-signed %&quot;</span> reg <span class="Constant">&quot; &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
+shift-left var, n                 =&gt; <span class="Constant">&quot;c1/shift 4/subop/left *(ebp+&quot;</span> var.stack-offset <span class="Constant">&quot;) &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
+shift-left *var/reg, n            =&gt; <span class="Constant">&quot;c1/shift 4/subop/left *&quot;</span> reg <span class="Constant">&quot; &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
+shift-right var, n                =&gt; <span class="Constant">&quot;c1/shift 5/subop/right *(ebp+&quot;</span> var.stack-offset <span class="Constant">&quot;) &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
+shift-right *var/reg, n           =&gt; <span class="Constant">&quot;c1/shift 5/subop/right *&quot;</span> reg <span class="Constant">&quot; &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
+shift-right-signed var, n         =&gt; <span class="Constant">&quot;c1/shift 7/subop/right-signed *(ebp+&quot;</span> var.stack-offset <span class="Constant">&quot;) &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span>
+shift-right-signed *var/reg, n    =&gt; <span class="Constant">&quot;c1/shift 7/subop/right-signed *&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> 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>
@@ -116,6 +124,7 @@ var/<span class="Constant">esi</span> <span class="SpecialChar">&lt;-</span> cop
 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>
+copy-to *var1/reg1, var2/reg2     =&gt; <span class="Constant">&quot;89/&lt;- *&quot;</span> reg1 <span class="Constant">&quot; &quot;</span> reg2 <span class="Constant">&quot;/r32&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>
@@ -193,6 +202,12 @@ var/reg <span class="SpecialChar">&lt;-</span> multiply *var2/reg2    =&gt; <spa
 <span class="PreProc">loop-if-addr&gt;=</span>                    =&gt; <span class="Constant">&quot;0f 83/jump-if-addr&gt;= loop/disp32&quot;</span>
 <span class="PreProc">loop-if-addr&gt;=</span> label              =&gt; <span class="Constant">&quot;0f 83/jump-if-addr&gt;= &quot;</span> label <span class="Constant">&quot;:loop/disp32&quot;</span>
 
+Similar float variants like `<span class="PreProc">break-if-loop&lt;`</span> are aliases for the corresponding
+`addr` equivalents. The x86 instruction set stupidly has floating-point
+operations only update a subset of flags.
+
+---
+
 In the following instructions types are provided for clarity even if they must
 be provided in an earlier 'var' declaration.
 
@@ -278,6 +293,83 @@ read-from-stream s: (addr stream T), out: (addr T)
 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>
 
+<span class="Comment"># Floating-point operations</span>
+
+All the instructions so far use Intel's general-purpose integer registers.
+However, some of them translate to different SubX if their arguments are in
+floating-point registers.
+
+var/xreg <span class="SpecialChar">&lt;-</span> add var2/xreg2        =&gt; <span class="Constant">&quot;f3 0f 58/add 3/mod &quot;</span> xreg2 <span class="Constant">&quot;/xm32 &quot;</span> xreg1 <span class="Constant">&quot;/x32&quot;</span>
+var/xreg <span class="SpecialChar">&lt;-</span> add var2              =&gt; <span class="Constant">&quot;f3 0f 58/add *(ebp+&quot;</span> var2.stack-offset <span class="Constant">&quot;) &quot;</span> xreg <span class="Constant">&quot;/x32&quot;</span>
+var/xreg <span class="SpecialChar">&lt;-</span> add *var2/reg2        =&gt; <span class="Constant">&quot;f3 0f 58/add *&quot;</span> reg2 <span class="Constant">&quot; &quot;</span> xreg <span class="Constant">&quot;/x32&quot;</span>
+
+var/xreg <span class="SpecialChar">&lt;-</span> subtract var2/xreg2   =&gt; <span class="Constant">&quot;f3 0f 5c/subtract 3/mod &quot;</span> xreg2 <span class="Constant">&quot;/xm32 &quot;</span> xreg1 <span class="Constant">&quot;/x32&quot;</span>
+var/xreg <span class="SpecialChar">&lt;-</span> subtract var2         =&gt; <span class="Constant">&quot;f3 0f 5c/subtract *(ebp+&quot;</span> var2.stack-offset <span class="Constant">&quot;) &quot;</span> xreg <span class="Constant">&quot;/x32&quot;</span>
+var/xreg <span class="SpecialChar">&lt;-</span> subtract *var2/reg2   =&gt; <span class="Constant">&quot;f3 0f 5c/subtract *&quot;</span> reg2 <span class="Constant">&quot; &quot;</span> xreg <span class="Constant">&quot;/x32&quot;</span>
+
+var/xreg <span class="SpecialChar">&lt;-</span> multiply var2/xreg2   =&gt; <span class="Constant">&quot;f3 0f 59/multiply 3/mod &quot;</span> xreg2 <span class="Constant">&quot;/xm32 &quot;</span> xreg1 <span class="Constant">&quot;/x32&quot;</span>
+var/xreg <span class="SpecialChar">&lt;-</span> multiply var2         =&gt; <span class="Constant">&quot;f3 0f 59/multiply *(ebp+&quot;</span> var2.stack-offset <span class="Constant">&quot;) &quot;</span> xreg <span class="Constant">&quot;/x32&quot;</span>
+var/xreg <span class="SpecialChar">&lt;-</span> multiply *var2/reg2   =&gt; <span class="Constant">&quot;f3 0f 59/multiply *&quot;</span> reg2 <span class="Constant">&quot; &quot;</span> xreg <span class="Constant">&quot;/x32&quot;</span>
+
+var/xreg <span class="SpecialChar">&lt;-</span> divide var2/xreg2     =&gt; <span class="Constant">&quot;f3 0f 5e/divide 3/mod &quot;</span> xreg2 <span class="Constant">&quot;/xm32 &quot;</span> xreg1 <span class="Constant">&quot;/x32&quot;</span>
+var/xreg <span class="SpecialChar">&lt;-</span> divide var2           =&gt; <span class="Constant">&quot;f3 0f 5e/divide *(ebp+&quot;</span> var2.stack-offset <span class="Constant">&quot;) &quot;</span> xreg <span class="Constant">&quot;/x32&quot;</span>
+var/xreg <span class="SpecialChar">&lt;-</span> divide *var2/reg2     =&gt; <span class="Constant">&quot;f3 0f 5e/divide *&quot;</span> reg2 <span class="Constant">&quot; &quot;</span> xreg <span class="Constant">&quot;/x32&quot;</span>
+
+There are also some exclusively floating-point instructions:
+
+var/xreg <span class="SpecialChar">&lt;-</span> reciprocal var2/xreg2 =&gt; <span class="Constant">&quot;f3 0f 53/reciprocal 3/mod &quot;</span> xreg2 <span class="Constant">&quot;/xm32 &quot;</span> xreg1 <span class="Constant">&quot;/x32&quot;</span>
+var/xreg <span class="SpecialChar">&lt;-</span> reciprocal var2       =&gt; <span class="Constant">&quot;f3 0f 53/reciprocal *(ebp+&quot;</span> var2.stack-offset <span class="Constant">&quot;) &quot;</span> xreg <span class="Constant">&quot;/x32&quot;</span>
+var/xreg <span class="SpecialChar">&lt;-</span> reciprocal *var2/reg2 =&gt; <span class="Constant">&quot;f3 0f 53/reciprocal *&quot;</span> reg2 <span class="Constant">&quot; &quot;</span> xreg <span class="Constant">&quot;/x32&quot;</span>
+
+var/xreg <span class="SpecialChar">&lt;-</span> square-root var2/xreg2 =&gt; <span class="Constant">&quot;f3 0f 51/square-root 3/mod &quot;</span> xreg2 <span class="Constant">&quot;/xm32 &quot;</span> xreg1 <span class="Constant">&quot;/x32&quot;</span>
+var/xreg <span class="SpecialChar">&lt;-</span> square-root var2       =&gt; <span class="Constant">&quot;f3 0f 51/square-root *(ebp+&quot;</span> var2.stack-offset <span class="Constant">&quot;) &quot;</span> xreg <span class="Constant">&quot;/x32&quot;</span>
+var/xreg <span class="SpecialChar">&lt;-</span> square-root *var2/reg2 =&gt; <span class="Constant">&quot;f3 0f 51/square-root *&quot;</span> reg2 <span class="Constant">&quot; &quot;</span> xreg <span class="Constant">&quot;/x32&quot;</span>
+
+var/xreg <span class="SpecialChar">&lt;-</span> inverse-square-root var2/xreg2 =&gt; <span class="Constant">&quot;f3 0f 52/inverse-square-root 3/mod &quot;</span> xreg2 <span class="Constant">&quot;/xm32 &quot;</span> xreg1 <span class="Constant">&quot;/x32&quot;</span>
+var/xreg <span class="SpecialChar">&lt;-</span> inverse-square-root var2       =&gt; <span class="Constant">&quot;f3 0f 52/inverse-square-root *(ebp+&quot;</span> var2.stack-offset <span class="Constant">&quot;) &quot;</span> xreg <span class="Constant">&quot;/x32&quot;</span>
+var/xreg <span class="SpecialChar">&lt;-</span> inverse-square-root *var2/reg2 =&gt; <span class="Constant">&quot;f3 0f 52/inverse-square-root *&quot;</span> reg2 <span class="Constant">&quot; &quot;</span> xreg <span class="Constant">&quot;/x32&quot;</span>
+
+var/xreg <span class="SpecialChar">&lt;-</span> min var2/xreg2        =&gt; <span class="Constant">&quot;f3 0f 5d/min 3/mod &quot;</span> xreg2 <span class="Constant">&quot;/xm32 &quot;</span> xreg1 <span class="Constant">&quot;/x32&quot;</span>
+var/xreg <span class="SpecialChar">&lt;-</span> min var2              =&gt; <span class="Constant">&quot;f3 0f 5d/min *(ebp+&quot;</span> var2.stack-offset <span class="Constant">&quot;) &quot;</span> xreg <span class="Constant">&quot;/x32&quot;</span>
+var/xreg <span class="SpecialChar">&lt;-</span> min *var2/reg2        =&gt; <span class="Constant">&quot;f3 0f 5d/min *&quot;</span> reg2 <span class="Constant">&quot; &quot;</span> xreg <span class="Constant">&quot;/x32&quot;</span>
+
+var/xreg <span class="SpecialChar">&lt;-</span> max var2/xreg2        =&gt; <span class="Constant">&quot;f3 0f 5f/max 3/mod &quot;</span> xreg2 <span class="Constant">&quot;/xm32 &quot;</span> xreg1 <span class="Constant">&quot;/x32&quot;</span>
+var/xreg <span class="SpecialChar">&lt;-</span> max var2              =&gt; <span class="Constant">&quot;f3 0f 5f/max *(ebp+&quot;</span> var2.stack-offset <span class="Constant">&quot;) &quot;</span> xreg <span class="Constant">&quot;/x32&quot;</span>
+var/xreg <span class="SpecialChar">&lt;-</span> max *var2/reg2        =&gt; <span class="Constant">&quot;f3 0f 5f/max *&quot;</span> reg2 <span class="Constant">&quot; &quot;</span> xreg <span class="Constant">&quot;/x32&quot;</span>
+
+Remember, when these instructions use indirect mode, they still use an integer
+register. Floating-point registers can't hold addresses.
+
+Most instructions operate exclusively on integer or floating-point operands.
+The only exceptions are the instructions for converting between integers and
+floating-point numbers.
+
+var/xreg <span class="SpecialChar">&lt;-</span> convert var2/reg2     =&gt; <span class="Constant">&quot;f3 0f 2a/convert-to-float %&quot;</span> reg2 <span class="Constant">&quot; &quot;</span> xreg <span class="Constant">&quot;/x32&quot;</span>
+var/xreg <span class="SpecialChar">&lt;-</span> convert var2          =&gt; <span class="Constant">&quot;f3 0f 2a/convert-to-float *(ebp+&quot;</span> var2.stack-offset <span class="Constant">&quot;) &quot;</span> xreg <span class="Constant">&quot;/x32&quot;</span>
+var/xreg <span class="SpecialChar">&lt;-</span> convert *var2/reg2    =&gt; <span class="Constant">&quot;f3 0f 2a/convert-to-float *&quot;</span> reg2 <span class="Constant">&quot; &quot;</span> xreg <span class="Constant">&quot;/x32&quot;</span>
+
+var/reg <span class="SpecialChar">&lt;-</span> convert var2/xreg2     =&gt; <span class="Constant">&quot;f3 0f 2d/convert-to-int 3/mod &quot;</span> xreg2 <span class="Constant">&quot;/xm32 &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
+var/reg <span class="SpecialChar">&lt;-</span> convert var2           =&gt; <span class="Constant">&quot;f3 0f 2d/convert-to-int *(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> convert *var2/reg2     =&gt; <span class="Constant">&quot;f3 0f 2d/convert-to-int *&quot;</span> reg2 <span class="Constant">&quot; &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span>
+
+There are no instructions accepting floating-point literals. To obtain integer
+literals in floating-point registers, copy them to general-purpose registers
+and then convert them to floating-point.
+
+One pattern you may have noticed above is that the floating-point instructions
+above always write to registers. The only exceptions are `copy` instructions,
+which can write to memory locations.
+
+var/xreg <span class="SpecialChar">&lt;-</span> copy var2/xreg2       =&gt; <span class="Constant">&quot;f3 0f 11/&lt;- 3/mod &quot;</span> xreg <span class="Constant">&quot;/xm32 &quot;</span> xreg2 <span class="Constant">&quot;/x32&quot;</span>
+copy-to var1, var2/xreg           =&gt; <span class="Constant">&quot;f3 0f 11/&lt;- *(ebp+&quot;</span> var1.stack-offset <span class="Constant">&quot;) &quot;</span> xreg <span class="Constant">&quot;/x32&quot;</span>
+var/xreg <span class="SpecialChar">&lt;-</span> copy var2             =&gt; <span class="Constant">&quot;f3 0f 10/-&gt; *(ebp+&quot;</span> var2.stack-offset <span class="Constant">&quot;) &quot;</span> xreg <span class="Constant">&quot;/x32&quot;</span>
+var/xreg <span class="SpecialChar">&lt;-</span> copy *var2/reg2       =&gt; <span class="Constant">&quot;f3 0f 10/-&gt; *&quot;</span> reg2 <span class="Constant">&quot; &quot;</span> xreg <span class="Constant">&quot;/x32&quot;</span>
+
+Comparisons must always start with a register:
+
+compare var1/xreg1, var2/xreg2    =&gt; <span class="Constant">&quot;0f 2f/compare 3/mod &quot;</span> xreg2 <span class="Constant">&quot;/xm32 &quot;</span> xreg1 <span class="Constant">&quot;/x32&quot;</span>
+compare var1/xreg1, var2          =&gt; <span class="Constant">&quot;0f 2f/compare 2/mod *(ebp+&quot;</span> var2.stack-offset <span class="Constant">&quot;) &quot;</span> xreg1 <span class="Constant">&quot;/x32&quot;</span>
+
 vim&#0058;ft=mu:nowrap:textwidth=<span class="Constant">0</span>
 </pre>
 </body>