collapseos/tests/unit/test_util_z.asm

37 рядки
326 B
NASM

2019-05-17 22:22:10 -04:00
jp test
.inc "core.asm"
.inc "str.asm"
.inc "lib/util.asm"
.inc "zasm/util.asm"
2019-05-17 22:22:10 -04:00
testNum: .db 1
2019-07-23 09:28:39 -04:00
sFoo: .db "foo", 0
2019-05-17 22:22:10 -04:00
test:
ld hl, 0xffff
ld sp, hl
2019-07-23 09:28:39 -04:00
ld hl, sFoo
call strlen
cp 3
jp nz, fail
call nexttest
2019-05-17 22:22:10 -04:00
; success
xor a
halt
nexttest:
ld a, (testNum)
inc a
ld (testNum), a
ret
fail:
ld a, (testNum)
halt