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>
32 lines
429 B
NASM
32 lines
429 B
NASM
code $0x0 {
|
|
main:
|
|
storeimm32 %r00, $0xDEAD
|
|
storeimm64 %r01, $16
|
|
|
|
shl %r00, %r01
|
|
|
|
storeimm32 %r01, $0xBEEF
|
|
or %r00, %r01
|
|
|
|
storeimm64 %r01, $0xDEADBEEF
|
|
|
|
cmpeq %r00, %r01
|
|
storeimm32 %r00, failure
|
|
storeimm64 %r01, ok
|
|
|
|
jz %r00
|
|
|
|
jmp %r01
|
|
|
|
failure:
|
|
storeimm32 %status, $1
|
|
|
|
ok: halt
|
|
|
|
.export main
|
|
}
|
|
|
|
meta {
|
|
entry: main
|
|
}
|