2019-05-18 12:22:10 +10:00
|
|
|
jp test
|
|
|
|
|
2019-10-07 05:32:23 +11:00
|
|
|
.inc "core.asm"
|
2019-11-15 01:55:31 +11:00
|
|
|
.inc "str.asm"
|
2019-11-19 07:17:56 +11:00
|
|
|
.inc "lib/util.asm"
|
2019-10-07 05:32:23 +11:00
|
|
|
.inc "zasm/util.asm"
|
2019-05-18 12:22:10 +10:00
|
|
|
|
|
|
|
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
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|