Files
rasp/tests/test_mod.asm

35 lines
534 B
NASM
Raw Normal View History

.section data $0x0 {
number: .u8 $10
main:
; Test modulo
mov %status, $1
mov %r0, (number)u8
mod $r0, $4
cmpeq %r0, $2
jz end
; Test modulo from a register
mov %status, $2
add %r0, %r0
cmpeq %r0, $2
jz end
; Test mod by zero
mov %status, $4
add %r0, $0xFFFFFFFFFFFFFFFF
cmpeq %r0, $11
jz end
mov %status, $0
end:
halt
.export main
}
.meta {
entry: main
}