collapseos/tools/tests/unit/test_util_z.asm
Virgil Dupras 7cf3ed38da Extract str.asm from core.asm and make core included by userspace
Most of register fiddling routines (which is now the only thing contained
in care.asm) are used by almost all userspace apps, often in inner loops.

That makes the penalty of using jump tables for those a bit too high.
Moreover, it burdens jump tables needlessly.

Because this unit is very small (now that string routines are out), it makes
sense to always include it in binaries.
2019-11-14 10:14:15 -05:00

45 lines
404 B
NASM

jp test
.inc "core.asm"
.inc "str.asm"
.inc "parse.asm"
.inc "zasm/util.asm"
testNum: .db 1
sFoo: .db "foo", 0
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
ld hl, sFoo
call strlen
cp 3
jp nz, fail
call nexttest
; success
xor a
halt
nexttest:
ld a, (testNum)
inc a
ld (testNum), a
ret
fail:
ld a, (testNum)
halt