mirror of
https://github.com/hsoft/collapseos.git
synced 2024-12-24 14:38:05 +11:00
zasm: add ERR_OVFL
This commit is contained in:
parent
f9118ef88e
commit
d76dd54f4b
@ -8,3 +8,6 @@
|
||||
|
||||
; Code is badly formatted (comma without a following arg, unclosed quote, etc.)
|
||||
.equ ERR_BAD_FMT 0x03
|
||||
|
||||
; Value specified doesn't fit in its destination byte or word
|
||||
.equ ERR_OVFL 0x04
|
||||
|
@ -559,7 +559,9 @@ handleLDrr:
|
||||
|
||||
; Compute the upcode for argspec row at (DE) and arguments in curArg{1,2} and
|
||||
; writes the resulting upcode in instrUpcode. A is the number if bytes written
|
||||
; to instrUpcode (can be zero if something went wrong).
|
||||
; to instrUpcode.
|
||||
; A is zero on error. The only thing that can go wrong in this routine is
|
||||
; overflow.
|
||||
getUpcode:
|
||||
push ix
|
||||
push de
|
||||
@ -814,7 +816,7 @@ parseInstruction:
|
||||
; goal here!
|
||||
call getUpcode
|
||||
or a ; is zero?
|
||||
jr z, .error
|
||||
jr z, .overflow
|
||||
ld b, a ; save output byte count
|
||||
ld hl, instrUpcode
|
||||
.loopWrite:
|
||||
@ -824,6 +826,9 @@ parseInstruction:
|
||||
djnz .loopWrite
|
||||
cp a ; ensure Z
|
||||
jr .end
|
||||
.overflow:
|
||||
ld a, ERR_OVFL
|
||||
jr .error
|
||||
.badfmt:
|
||||
ld a, ERR_BAD_FMT
|
||||
.error:
|
||||
|
@ -21,3 +21,4 @@ chkerr "ld a, foo" 2
|
||||
chkerr "ld a, hl" 2
|
||||
chkerr "ld a," 3
|
||||
chkerr "ld a, 'A" 3
|
||||
chkerr "ld a, 0x100" 4
|
||||
|
Loading…
Reference in New Issue
Block a user