about summary refs log tree commit diff stats
path: root/mu_instructions
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-03-14 14:46:45 -0700
committerKartik Agaram <vc@akkartik.com>2020-03-14 14:46:45 -0700
commit114641e2c81805bd99a5713237af3fb16d7ddc10 (patch)
tree0b709296b72184a430e149f44c665bd58bbe79c4 /mu_instructions
parent6db056110bc9bab90092b29908085a9befd5956e (diff)
downloadmu-114641e2c81805bd99a5713237af3fb16d7ddc10.tar.gz
6145 - 'address' operator
This could be a can of worms, but I think I have a set of checks that will
keep use of addresses type-safe.
Diffstat (limited to 'mu_instructions')
-rw-r--r--mu_instructions5
1 files changed, 5 insertions, 0 deletions
diff --git a/mu_instructions b/mu_instructions
index a66ea67e..430a4651 100644
--- a/mu_instructions
+++ b/mu_instructions
@@ -205,6 +205,11 @@ loop-if-addr<= label        {.name="loop-if-addr<=",  .inouts=[label],
 loop-if-addr>=              {.name="loop-if-addr>=",                                    .subx-name="0f 83/jump-if-addr>= loop/disp32"}
 loop-if-addr>= label        {.name="loop-if-addr>=",  .inouts=[label],                  .subx-name="0f 83/jump-if-addr>=",                .disp32=inouts[0] ":loop"}
 
+Address operations
+
+var/reg: (addr T) <- address var: T
+                            {.name="address",         .inouts=[var],  .outputs=[reg],   .subx-name="8d/copy-address",       .rm32="*(ebp+" inouts[0].stack-offset ")",  .r32=outputs[0]}
+
 Array operations
 
 var/reg <- length arr/reg2: (addr array T)