mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-30 20:38:05 +11:00
zasm: implement error conditions for #inc
This commit is contained in:
parent
31f7c7771d
commit
b298e607bd
@ -11,3 +11,5 @@
|
|||||||
|
|
||||||
; Value specified doesn't fit in its destination byte or word
|
; Value specified doesn't fit in its destination byte or word
|
||||||
.equ ERR_OVFL 0x04
|
.equ ERR_OVFL 0x04
|
||||||
|
|
||||||
|
.equ ERR_FILENOTFOUND 0x05
|
||||||
|
@ -184,13 +184,21 @@ handleFIL:
|
|||||||
|
|
||||||
handleINC:
|
handleINC:
|
||||||
call readWord
|
call readWord
|
||||||
jr nz, .end
|
jr nz, .badfmt
|
||||||
; HL points to scratchpad
|
; HL points to scratchpad
|
||||||
call enterDoubleQuotes
|
call enterDoubleQuotes
|
||||||
jr nz, .end
|
jr nz, .badfmt
|
||||||
call ioOpenInclude
|
call ioOpenInclude
|
||||||
.end:
|
jr nz, .badfn
|
||||||
xor a ; zero bytes written
|
cp a ; ensure Z
|
||||||
|
ret
|
||||||
|
.badfmt:
|
||||||
|
ld a, ERR_BAD_FMT
|
||||||
|
jr .error
|
||||||
|
.badfn:
|
||||||
|
ld a, ERR_FILENOTFOUND
|
||||||
|
.error:
|
||||||
|
call unsetZ
|
||||||
ret
|
ret
|
||||||
|
|
||||||
; Reads string in (HL) and returns the corresponding ID (D_*) in A. Sets Z if
|
; Reads string in (HL) and returns the corresponding ID (D_*) in A. Sets Z if
|
||||||
|
@ -32,5 +32,8 @@ chkerr ".equ" 3
|
|||||||
chkerr ".equ foo" 3
|
chkerr ".equ foo" 3
|
||||||
chkerr ".org" 3
|
chkerr ".org" 3
|
||||||
chkerr ".fill" 3
|
chkerr ".fill" 3
|
||||||
|
chkerr "#inc" 3
|
||||||
|
chkerr "#inc foo" 3
|
||||||
chkerr "ld a, 0x100" 4
|
chkerr "ld a, 0x100" 4
|
||||||
chkerr ".db 0x100" 4
|
chkerr ".db 0x100" 4
|
||||||
|
chkerr "#inc \"doesnotexist\"" 5
|
||||||
|
Loading…
Reference in New Issue
Block a user