mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-27 14:28:06 +11:00
zasm: implement error conditions in .dw
This commit is contained in:
parent
f5d4321ece
commit
436ff51c39
@ -79,8 +79,10 @@ handleDW:
|
|||||||
push hl
|
push hl
|
||||||
.loop:
|
.loop:
|
||||||
call readWord
|
call readWord
|
||||||
|
jr nz, .badfmt
|
||||||
ld hl, scratchpad
|
ld hl, scratchpad
|
||||||
call parseExpr
|
call parseExpr
|
||||||
|
jr nz, .badarg
|
||||||
push ix \ pop hl
|
push ix \ pop hl
|
||||||
ld a, l
|
ld a, l
|
||||||
call ioPutC
|
call ioPutC
|
||||||
@ -91,6 +93,15 @@ handleDW:
|
|||||||
cp a ; ensure Z
|
cp a ; ensure Z
|
||||||
pop hl
|
pop hl
|
||||||
ret
|
ret
|
||||||
|
.badfmt:
|
||||||
|
ld a, ERR_BAD_FMT
|
||||||
|
jr .error
|
||||||
|
.badarg:
|
||||||
|
ld a, ERR_BAD_ARG
|
||||||
|
.error:
|
||||||
|
call unsetZ
|
||||||
|
pop hl
|
||||||
|
ret
|
||||||
|
|
||||||
handleEQU:
|
handleEQU:
|
||||||
push hl
|
push hl
|
||||||
|
@ -20,8 +20,10 @@ chkerr "foo" 1
|
|||||||
chkerr "ld a, foo" 2
|
chkerr "ld a, foo" 2
|
||||||
chkerr "ld a, hl" 2
|
chkerr "ld a, hl" 2
|
||||||
chkerr ".db foo" 2
|
chkerr ".db foo" 2
|
||||||
|
chkerr ".dw foo" 2
|
||||||
chkerr "ld a," 3
|
chkerr "ld a," 3
|
||||||
chkerr "ld a, 'A" 3
|
chkerr "ld a, 'A" 3
|
||||||
chkerr ".db 0x42," 3
|
chkerr ".db 0x42," 3
|
||||||
|
chkerr ".dw 0x4242," 3
|
||||||
chkerr "ld a, 0x100" 4
|
chkerr "ld a, 0x100" 4
|
||||||
chkerr ".db 0x100" 4
|
chkerr ".db 0x100" 4
|
||||||
|
Loading…
Reference in New Issue
Block a user