Add storeimm32 and storeimm64 syntax

These explicitly allow usage of storeimm32 and storeimm64 in the
assembler syntax. It will also warn you if you try to store a value
that's too large using the storeimm32 instruction

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2020-02-10 18:59:23 -05:00
parent 15423502f3
commit 0ea3406b71
4 changed files with 29 additions and 7 deletions

View File

@@ -1,25 +1,25 @@
code $0x0 {
main:
storeimm %r00, $0xDEAD
storeimm %r01, $16
storeimm32 %r00, $0xDEAD
storeimm64 %r01, $16
shl %r00, %r01
storeimm %r01, $0xBEEF
storeimm32 %r01, $0xBEEF
or %r00, %r01
storeimm %r01, $0xDEADBEEF
storeimm64 %r01, $0xDEADBEEF
cmpeq %r00, %r01
storeimm %r00, failure
storeimm %r01, ok
storeimm32 %r00, failure
storeimm64 %r01, ok
jz %r00
jmp %r01
failure:
storeimm %status, $1
storeimm32 %status, $1
ok: halt