about summary refs log tree commit diff stats
path: root/mu_instructions
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-06-13 20:23:51 -0700
committerKartik Agaram <vc@akkartik.com>2020-06-13 20:23:51 -0700
commitef845524e90c736b6cbab9320bc41114d421ff63 (patch)
treecd9d0e11b1cba8fa035340e697ee0fa9ca0ae0e2 /mu_instructions
parent7e55a20ff4c9bdb64b55daddd551f19cd7a51bcb (diff)
downloadmu-ef845524e90c736b6cbab9320bc41114d421ff63.tar.gz
6516 - operations on bytes
Byte-oriented addressing is only supported in a couple of instructions
in SubX. As a result, variables of type 'byte' can't live on the stack,
or in registers 'esi' and 'edi'.
Diffstat (limited to 'mu_instructions')
-rw-r--r--mu_instructions4
1 files changed, 4 insertions, 0 deletions
diff --git a/mu_instructions b/mu_instructions
index 5ce9e07c..7b38a1f8 100644
--- a/mu_instructions
+++ b/mu_instructions
@@ -90,6 +90,10 @@ var/reg <- copy n                 => "c7 0/subop/copy %" reg " " n "/imm32"
 copy-to var, n                    => "c7 0/subop/copy *(ebp+" var.stack-offset ") " n "/imm32"
 copy-to *var/reg, n               => "c7 0/subop/copy *" reg " " n "/imm32"
 
+var/reg <- copy-byte var2/reg2    => "8a/byte-> %" reg2 " " reg "/r32"
+var/reg <- copy-byte *var2/reg2   => "8a/byte-> *" reg2 " " reg "/r32"
+copy-byte-to *var1/reg1, var2/reg2  => "88/byte<- *" reg1 " " reg2 "/r32"
+
 compare var1, var2/reg2           => "39/compare *(ebp+" var1.stack-offset ") " reg2 "/r32"
 compare *var1/reg1, var2/reg2     => "39/compare *" reg1 " " reg2 "/r32"
 compare var1/reg1, var2           => "3b/compare<- *(ebp+" var2.stack-offset ") " reg1 "/r32"