DASMx Version 1.
Introduction DASMx is a disassembler for a range of common 8-bit microprocessors. The following main processor families are supported: ❏ Motorola 6800 family and single chip variants (including Hitachi 630X devices); ❏ Motorola 6809; ❏ MOS Technology 6502 and Rockwell 65C0X; ❏ Zilog Z80; ❏ Sharp LR35902 (single chip Z80 variant as used in the Nintendo GameBoy); ❏ Intel MCS-80/85TM family (i.e. 8080 and 8085); ❏ Intel MCS-48TM family (i.e. 8048 et al); ❏ Intel MCS-51TM family (i.e.
Summarising, the key features of DASMx are: ❏ Disassembly of object code images for the following microprocessors: • Motorola 6800, 6802 and 6808; • Motorola 6801 and 6803; • Hitachi 6301 and 6303; • Motorola 6809 and Hitachi 6309; • MOS Technology/Rockwell 6502; • Rockwell 65C00/21 and 65C59; • Rockwell 65C02, 65C102 and 65C112; • Zilog Z80; • Intel 8080 and 8085; • Sharp LR35902 (i.e. GameBoy processor); • Intel 8048; • Intel 8051; • Signetics 2650.
Version history Version Date Comments 0.90 28th July 1996 1.00 25th January 1997 1.10 16th July 1997 Third release (now renamed DASMx): 6502, Z80 and 8048 processor support added; minor improvements and bug fixes. 1.20 2nd April 1998 8080, 8085 and 2650 processor support added; improvements and bug fixes. 1.30 6th October 1999 First public release (as dasm6800): with support for 6800/6802/6808 only.
❏ User messages can now be specified and generated from the symbol file; ❏ Symbol file includes (which may be nested) now permitted. The changes between versions 1.10 and 1.
Copyright DASMx and all associated documentation are copyright Conquest Consultants. Disclaimer DASMx comes without any express or implied warranty. You use this software at your own risk. Conquest Consultants have no obligation to support or upgrade this software. Conquest Consultants cannot be held responsible for any act of copyright infringement or other violation of applicable law that results from use of this disassembler software. Distribution DASMx is copyright software. This version (1.
power of two and will correspond to the length of the ROM. For example, the file size of a complete image of a 27256 EPROM will be 32,768 bytes. Assuming at this stage that you do not know which areas of the binary image are code and which are data, it is sensible to use the code threading feature. For code threading to work, you must provide at least one code entry point. This requires code, vector or vectab entries in a symbol file.
Command line options DASMx has the following command line options: -a generate assembler output (default is to generate a full listing file); -cTYPE set the CPU processor type – overrides any cpu statement in the symbol file, where TYPE is one of the types reported by the -l option (6800, 6809, 6502, Z80 etc.
Symbol file syntax The symbol file is a plain text file that may be created/modified with any text editor. The file contains lines that fall into one of three categories: ❏ comment lines; ❏ command lines; ❏ blank lines. Comment lines are denoted by ';' as the first non-whitespace character on the line. Command lines start with one of the specified keywords. Parameters follow the command keyword, separated by spaces or tabs. A comment may be added to the end of a command, preceded by the ';' character.
Command Function/syntax cpu Specify the processor type. Syntax: cpu 2650 | 6502 | 65C00 | 65C59 | 65C02 | 65C102 | 65C112 | 6301 | 6303 | 6800 | 6801 | 6802 | 6803 | 6808 | 6809 | 8048 | 8051 | 8080 | 8085 | Z80 | LR35902 numformat Specify number format (overriding default for processor) as Intel, Motorola, Signetics, C language hex (i.e. 0x prefix) or decimal. Syntax: numformat I | M | S | C | D include Include a file containing additional symbol commands. Include filess may be nested.
Output files By default, DASMx generates a disassembly listing file. This is similar to the full listing file generated by most assemblers. Optionally, DASMx can be made to produce an assembly file instead. This could then be used as a source file to an assembler of your choice (with certain provisos concerning pseudo-ops and number formats noted later). As an aid to readability, DASMx inserts a comment line after all breaks in a sequence of instructions (e.g.
❏ pushing an address onto the stack and then, later, performing a return from subroutine instruction (i.e. as a method of performing a jump); ❏ performing an indexed branch instruction (e.g. using addresses taken from a vector table); ❏ use of undocumented instruction opcodes – since threads are abandoned when an invalid opcode is detected; ❏ self-modifying code. Indexed branch instructions are highlighted in the output listing by automatically generated comments.
Microprocessor specifics The following sub-sections detail items of note relating to disassembly for the specific microprocessors (and their variants) supported by DASMx. Motorola 6800, 6802 and 6808 The Motorola 6800, 6802 and 6808 share an identical instruction set. Assembler mnemonics follow the Motorola standard definitions (see reference [1]).
MOS Technology/Rockwell 6502 The MOS Technology/Rockwell 6502 has a similar instruction set to that of the 6800 (but totally opcode incompatible). A number of 6502 variants, with expanded instruction sets and addressing capabilities have appeared over the years. DASMx copes with some, but not all, of these variants (see next sections). If you know that a processor is based on the 6502 architecture, but are unsure of the variant then try disassembling with the CPU type set to 6502, 65C02 and 65C00.
The Z80 has a great many (so called) undocumented instructions that (sometimes) perform useful functions. DASMx does not currently support these additional instructions. Like the 6502, the Z80 has spawned many variants with opcode compatible instruction supersets. DASMx can be used on code for these devices with the standard caveat that any of the new instructions will not be disassembled as valid code (and therefore code threading is not advised.
Generating Zilog Z80 style mnemonics from Intel 8080 code is possible because the 8080 has an instruction set that is a compatible binary subset of those of the Z80. Simply specify the CPU type is as Z80 and DASMx will correctly disassemble 8080 code into Zilog mnemonics. This will not suit Intel assembler die-hards, but may be preferred by those more familiar with the Z80.
currently beyond the capabilities of DASMx. For this reason, it is advised that code threading be not used if the size of the 8048 source image exceeds 2 Kbytes. If images greater than this are disassembled, even with threading disabled, some errors in automatically generated labels may be expected. Intel MCS-51™ family (8051 etc.) Intel introduced the 8051 to provide an upgrade path from the 8048. It would do all that the 8048 would do and more.
Number format Microprocessor manufacturers have chosen a variety of different formats for representing hexadecimal numbers. [Some sort of formatting is essential, otherwise a hex number starting with an alpha character could be confused with a label or symbol name.] DASMx supports five different hex number format styles. These are summarised in the table below, with an example in each case for the hex number F12C.
Manufacturer Signetics MOS Technology Rockwell Rockwell Rockwell Rockwell Rockwell Hitachi Hitachi Motorola Motorola Motorola Motorola Motorola Motorola Intel Intel Intel Intel Zilog Sharp cpu parameter 2650 6502 65C00 65C02 65C29 65C102 65C112 6301 6303 6800 6801 6802 6803 6808 6809 8048 8051 8080 8085 Z80 LR35902 Format Signetics Motorola Motorola Motorola Motorola Motorola Motorola Motorola Motorola Motorola Motorola Motorola Motorola Motorola Motorola Intel Intel Intel Intel Intel Intel The number fo
❏ improved code threading (through use of a more complete emulation of the processor); ❏ improved symbol table output in listing file; ❏ specifying comments in the symbol file for inclusion in the output files; ❏ additional memory map output in listing file; ❏ better support for 8048 code greater than 2 Kbytes and for 8048 variants; ❏ support for additional microprocessors; ❏ support for further variants of the currently supported processors; ❏ disassembly of commonly known "undocumented" ins
[5] 6502 Assembly Language Programming, Second Edition, Lance A.Leventhal, Osborne/McGraw-Hill, ISBN 0-07-881216-X, 1986. [6] R650X and R651X Microprocessors (CPU), Rockwell, 29000D39, Data Sheet D39, Revision 6, February 1984. [7] MCS6500 Microcomputer Family Programming Manual, MOS Technology Inc., Second Edition, Publication Number 6500-50A, January 1976. [8] 1984 Data Book, Semiconductor Products Division, Rockwell International, March 1984.