Add some integration tests and runner
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
34
tests/test_mul.asm
Normal file
34
tests/test_mul.asm
Normal file
@@ -0,0 +1,34 @@
|
||||
.section data $0x0 {
|
||||
number: .u8 $10
|
||||
|
||||
main:
|
||||
; Test multiplication
|
||||
mov %status, $1
|
||||
mov %r0, (number)u8
|
||||
mul %r0, $1
|
||||
cmpeq %r0, $10
|
||||
jz end
|
||||
|
||||
; Test multiplication from a register
|
||||
mov %status, $2
|
||||
mov %r1, $2
|
||||
mul %r0, %r1
|
||||
cmpeq %r0, $20
|
||||
jz end
|
||||
|
||||
; Test negative multiplication
|
||||
mov %status, $3
|
||||
mul %r0, $0xFFFFFFFFFFFFFFFF ; -1
|
||||
cmpeq %r0, $0xFFFFFFFFFFFFFFEC ; -20
|
||||
jz end
|
||||
|
||||
mov %status, $0
|
||||
end:
|
||||
halt
|
||||
|
||||
.export main
|
||||
}
|
||||
|
||||
.meta {
|
||||
entry: main
|
||||
}
|
||||
Reference in New Issue
Block a user