mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-23 21:38:05 +11:00
zasm: add ERR_BAD_FMT
This commit is contained in:
parent
412b3f374a
commit
e1e6d52fea
@ -6,3 +6,5 @@
|
|||||||
; contains references to undefined symbols.
|
; contains references to undefined symbols.
|
||||||
.equ ERR_BAD_ARG 0x02
|
.equ ERR_BAD_ARG 0x02
|
||||||
|
|
||||||
|
; Code is badly formatted (comma without a following arg, unclosed quote, etc.)
|
||||||
|
.equ ERR_BAD_FMT 0x03
|
||||||
|
@ -791,7 +791,7 @@ parseInstruction:
|
|||||||
call readComma
|
call readComma
|
||||||
jr nz, .nomorearg
|
jr nz, .nomorearg
|
||||||
call readWord
|
call readWord
|
||||||
jr nz, .error
|
jr nz, .badfmt
|
||||||
ld de, curArg2
|
ld de, curArg2
|
||||||
call processArg
|
call processArg
|
||||||
jr nz, .error ; A is set to error
|
jr nz, .error ; A is set to error
|
||||||
@ -824,6 +824,8 @@ parseInstruction:
|
|||||||
djnz .loopWrite
|
djnz .loopWrite
|
||||||
cp a ; ensure Z
|
cp a ; ensure Z
|
||||||
jr .end
|
jr .end
|
||||||
|
.badfmt:
|
||||||
|
ld a, ERR_BAD_FMT
|
||||||
.error:
|
.error:
|
||||||
; A is set to error already
|
; A is set to error already
|
||||||
call unsetZ
|
call unsetZ
|
||||||
|
Binary file not shown.
@ -18,3 +18,5 @@ chkerr() {
|
|||||||
|
|
||||||
chkerr "foo" 1
|
chkerr "foo" 1
|
||||||
chkerr "ld a, foo" 2
|
chkerr "ld a, foo" 2
|
||||||
|
chkerr "ld a," 3
|
||||||
|
chkerr "ld a, 'A" 3
|
||||||
|
Loading…
Reference in New Issue
Block a user