Woodstock's Z80 disassembler for the PC-E220
I started writing a Z80 disassembler in BASIC
in late 2001 and finished it in spring of 2003. Its code is ugly (can BASIC
code be any different?), it is quite bloated for a machine with 32kb of RAM,
it is dog slow and still has a few minor bugs that I'm too lazy to fix,
but it works.
In 12/2003 I started experimenting with a disassembly routine written in
assembly language to address the shortcomings of the BASIC-only version.
It is now finished and debugged, and together with a small BASIC program
implementing a user interface it is a quite fast and complete disassembler
providing the same features as the old BASIC-only version.
- This is the user interface written in BASIC. It PEEKs locations 0x010a,
0x010b, 0x010e and 0x010f to get the addresses to which it will POKE the
addresses of the instruction to disassemble and the place where to write the
result. Note that the field variable LI$(0) which is used to hold the result
of a disassembly call is located at 0x77d0 and ends on 0x77ff iff it is the
first field variable declared in BASIC.
- this is the assembly language source for the disassembly routine containing
comments (in german) and indentation because of which it is too big to fit in
the RAM of the PC-E220
- this is the assembly language source for the disassembly routine without any
unnecessary parts like comments and the more than 5000 spaces used for indentation
in the .asm-file. This one does fit in the RAM of the PC-E220
- this is the object code produced by the PC-E220's assembler, located at 0x0100,
output as Intel Hex by the PC-E220's monitor. Basically you only need this file and
the BASIC user interface above to get a working disassembler.
- this is the output of the disassembler when disassembling itself (except the data
part following location 0x0ace, this one was done differently)
Note that this disassembler is my first try at writing a program in assembly language,
so it surely can be optimized and shortened alot. It may also output mnemonics that are
minimally different from what a Z80 assembler expects (e.g. ADD B instead of ADD A,B),
but then it should always be obvious what is meant there.