COSMAC 1802 Disassemblers


This page last updated June 28 2020. Edited by Herb Johnson, (c) Herb Johnson, except for content written by others.This is a discussion and reference for COSMAC 1802-related disassemblers. It's part of general support for the "COSMAC 1802 Membership Card".Read the "Membership Card" Home page for more information and how to order.

There was a Discussion in Yahoo group cosmacelf about 1802 disassemblers in Oct 2013. The target was a chess program which only existed in binary or hex. A number of people discussed how to convert this code back to assembly language, including their choice of tools. I wrote this Web page at that time, to list the disassemblers found useful I added other disassemblers since. A disassembler, converts an executable program into an assembly program, but a human has to decide what parts get disassembled, in what way. Check the "strategy and tactics" notes on this page, if this process isn't familar to you.

1802 disassemblers

Marcel van Tongeren is the producer of EMMA 2, an 1802 emulator. It's a Windows 1802 emulato, it operates like actual 1802 computers. Also, it can disassemble as it executes. I discuss how Marcel disassembled some RCA 1802 ROM programs on my MCDS Web page.

The Windows program DASM on this linked site has been recommended. Apparently written by "pete" of Conquest Consultants. It supports many classic 8-bit microprocessors. It was noted that this disassembler puts lables on a text line before the code addressed by that label; a macro word processor fixed that output. The code apparently was distributed originally on the Simtel WinME/Win98/Win95/Programming Utilities folder. (?)

This Web page about the Nokia 1806 by Herman Robers in 1998 includes a disassembler with C source code which he wrote. A Win32 command-line executable is also included. The author says "it's early and incomplete but it does something". Apparently the author is interested in the "Nokia carphone as used in the former Benelux ATF-II network" which used a Nokia version of the 1806. I (Herb) used this disassembler on a hand-edited hex ROM dump: all I had to do was fake the Intel hex format, simply using 00 as the checksum as the disassembler ignores the checksum. It may ignore the address field too.

A native disassembler was written by John Beringer for a Kilobaud article published in July 1980. Here's a copy of that Kilobaud article.

Ted Rossin has written a number of 1802 support programs. Here is Rossin's RCA 1802 Web site, with a Windows assembler and disassembler. In addition, Ted has some useful hardware projects on his site.

Ted's hardware of note, is a PIC processor used to emulate an audio cassette recorder for data storage and retrival. In "the old days" before even floppy disk drives, audio cassettes were used to store digital data. Binary values were represented as one of two frequencies, usually as a few cycles in length. Rossin's PIC cassette interface, also on his Web site, converts the computer's casssette input and output into serial data that a desktop computer can produce and save.

"my" DIS1802

I have an 1802 disassembler. Well, it's actually a 8085 disassembler by Bill Beech, in C language, that I reworked for the 1802. Here's a ZIP file of my version for the 1802. It's an MS-DOS 16-bit command line version. That is, if you run it in Windows, do it from the command-line window. If that explanation is unclear, check how to run "my" 1802 cross-Assembler A18, same procedures.

It's a little clunky, but it's table driven and works adequately. The nice-enough feature is, you tell it "at this address, start doing X", and just keep changing what it does at each disassembled address. If you hack at the C source and make it less clunky, let me know accordingly. One thing that might be done, is to save and read back a symbol table file say *.SYM, so that one can create meaningful lables. Another thing, would be to add 1804/5/6 instructions. - Herb

DIS1802 bugs June 28 2020. Instruction 68H was disassembled as "????". It should be disassembled as "INP 0". Also: 7DH was disassembled as "SBCI". It should be "SDBI". Again, patch the EXE. I"ve fixed this in the C source and recompiled.

notes

Strategy for use

Whatever disassembler one uses, one follows a process. YOu have a binary, an executable program. You know something about how it runs, where it is in memory address. YOu know what the processor's code, and data, LOOK LIKE in hex. You can dump the program in ASCII, and in hex, and see where ASCII or other data is, empty space, and code. YOu make guesses, modify your command file, disassemble, and observe results. Guess, modify, disassemble, observe: repeat.

Many disassemblers don't allow retaining comments or symbol names for the next disassembly. So one keeps a seperate file of notes, probably editing a previous disassembly file. Eventually you'll have enough notes and enough disassembly to create an ASM file that makes some sense. Most disassmbler outputs can be reassembled, so you can test results. But the disassembly output is generally readable with code and data displayed.

It's useful to have a simple table of 1802 op codes, for "hand disassembly". Here's Lee Hart's cheat sheet for the 1802. Lee provides one inside his 1802 MC manual. There's also one on the Herman Robers site. A little hand disassembly lets you know, you are working with the right data.

Tactics for use

Sometimes programs have non-coded parts of memory. These are empty memory spaces that are used later, or just unused parts of the program file. They are not code; they are not data. So they may have zeros in them, or FFH's, or just junk (whatever happened to be there when the program was last used or created).

EPROMs of course, have something in every byte. Parts of EPROMs which aren't programmed, usually have FFH in them. Very early 1802 or 1801 systems used 1702 PROMs. They produce inverted data when read with a PROM reader. That means you have to binary invert the bytes to get "proper" executable data. That is, "FF" becomes "00", "B5" becomes "4A", and so on.

Herb Johnson


Contact information:
Herb Johnson
New Jersey, USA
To email @ me, see
see my home Web page.

This page and edited content is copyright Herb Johnson (c) 2020. Copyright of other contents beyond brief quotes, is held by those authors. Contact Herb at www.retrotechnology.com, an email address is available on that page..