1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-24 10:38:06 +11:00
collapseos/tools/tests/unit/test_util_z.asm

44 lines
401 B
NASM
Raw Normal View History

2019-05-18 12:22:10 +10:00
jp test
#include "core.asm"
#include "parse.asm"
#include "zasm/util.asm"
testNum: .db 1
2019-07-23 23:28:39 +10:00
sFoo: .db "foo", 0
2019-05-18 12:22:10 +10:00
test:
ld hl, 0xffff
ld sp, hl
ld de, 12
ld bc, 4
call multDEBC
ld a, l
cp 48
jp nz, fail
call nexttest
2019-07-23 23:28:39 +10:00
ld hl, sFoo
call strlen
cp 3
jp nz, fail
call nexttest
2019-05-18 12:22:10 +10:00
; success
xor a
halt
nexttest:
ld a, (testNum)
inc a
ld (testNum), a
ret
fail:
ld a, (testNum)
halt