This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: How to handle undocumented opcodes
- From: Nick Clifton <nickc at redhat dot com>
- To: Arnold Metselaar <arnold dot metselaar at planet dot nl>
- Cc: binutils at sources dot redhat dot com
- Date: Mon, 10 Oct 2005 16:50:33 +0100
- Subject: Re: How to handle undocumented opcodes
- References: <200510011738.12987.arnold.metselaar@planet.nl>
Hi Arnold,
I use different machine numbers to distinguish between z80 code
with and without undocumented instructions. My current naming
scheme for processor variants is:
z80strict - only documented Z80 instructions
z80 - adds support for undocumented instructions that are
legal on R800
z80full - all Z80 instructions
r800 - documented r800 instructions
What is the difference between "z80" and "z80full" ?
I'm not completely satisfied with this scheme as it may be too
finegrained, and "z80" should probably refer to the documented
instructions only.
If the undocumented instructions are actually well known and used then I
think that it is fair that you include them in the default z80 target.
Are there any standards or conventions I should adhere to?
No :-) But in general you should try to make your port both flexible
and functional. So by default I would recommend accepting all Z80
instructions, but producing a warning when assembling undocumented
instructions. Provide a command line switch to disable the warnings,
and a separate switch to enforce strict adherence to the Z80
specification (ie effectively turning the warnings into errors).
The disassembler should be agnostic - it should disassemble anything.
The linker ought to accept mixed (Z80) format input files, but select
the output format based on the most permissive of the input formats.
Cheers
Nick