33 lines
544 B
NASM
33 lines
544 B
NASM
.section data $0x1000 {
|
|
beef: .u16 $0xBEEF
|
|
; TODO(syntax)
|
|
; bytes: .u8 [
|
|
; $0xEF,
|
|
; $0xBE,
|
|
; $0xAD,
|
|
; $0xDE,
|
|
; ]
|
|
.export beef
|
|
}
|
|
|
|
.section code $0x0 {
|
|
main:
|
|
mov %r0, $0xDEAD
|
|
shl %r0, $16
|
|
; move 32 bits at 'beef' to %r01
|
|
; TODO(syntax)
|
|
mov %r1, (beef)u32
|
|
or %r0, %r01
|
|
cmpeq %r0, $0xDEADBEEF
|
|
; jump to the address 'end'
|
|
jz end
|
|
mov %status, $1
|
|
end:
|
|
halt
|
|
.export main
|
|
}
|
|
|
|
.meta {
|
|
entry: main
|
|
}
|