Browse Source

zasm: add ERR_BAD_FMT

pull/10/head
Virgil Dupras 5 years ago
parent
commit
e1e6d52fea
4 changed files with 7 additions and 1 deletions
  1. +2
    -0
      apps/zasm/const.asm
  2. +3
    -1
      apps/zasm/instr.asm
  3. BIN
      tools/emul/zasm/zasm.bin
  4. +2
    -0
      tools/tests/zasm/errtests.sh

+ 2
- 0
apps/zasm/const.asm View File

@@ -6,3 +6,5 @@
; contains references to undefined symbols.
.equ ERR_BAD_ARG 0x02

; Code is badly formatted (comma without a following arg, unclosed quote, etc.)
.equ ERR_BAD_FMT 0x03

+ 3
- 1
apps/zasm/instr.asm View File

@@ -791,7 +791,7 @@ parseInstruction:
call readComma
jr nz, .nomorearg
call readWord
jr nz, .error
jr nz, .badfmt
ld de, curArg2
call processArg
jr nz, .error ; A is set to error
@@ -824,6 +824,8 @@ parseInstruction:
djnz .loopWrite
cp a ; ensure Z
jr .end
.badfmt:
ld a, ERR_BAD_FMT
.error:
; A is set to error already
call unsetZ


BIN
tools/emul/zasm/zasm.bin View File


+ 2
- 0
tools/tests/zasm/errtests.sh View File

@@ -18,3 +18,5 @@ chkerr() {

chkerr "foo" 1
chkerr "ld a, foo" 2
chkerr "ld a," 3
chkerr "ld a, 'A" 3

Loading…
Cancel
Save