#600014 Z-80 assembler is accepting invalid instruction

Package:
z80asm
Source:
z80asm
Description:
assembler for the Zilog Z80 microprocessor
Submitter:
Ilya Dogolazky
Date:
2010-10-12 20:09:04 UTC
Severity:
normal
#600014#5
Date:
2010-10-12 20:07:47 UTC
From:
To:
When I invoke Z-80 assembler on a program containing non-existent
instrution "cp (hl),N", the compilation goes without any error (or at
least warning) messages. It seems, that even some object code is
generated for this instruction. Here is transcript:

$ echo 'cp (hl),239' > bad.asm
$ z80asm -v bad.asm -o bad.bin
Assembling....
Assembly succesful.
$ echo $?
0
$ xxd bad.bin
0000000: be                                       .
$

Note: 'be' is the opcode for 'cp (hl)', so an error message "trailing
characters ',239'" seems to be appropriate.