Disassembling "Crazy Gobbler," or Creating 100% Accurate Arcadia 2001 ROM image
By Adam Trionfo

     Introduction: What are We Trying to Do Here?

I have disassembled the "Crazy Gobbler" ROM image using a software tool.  When assembled by VACS, the source file creates a 100% identical ROM image.  To test for 100% compatibility I used Ward Shrake's program 'howdif' to make sure that there are no differences between the two ROM images.  For those that get sleepy when you hear references to disassemblers or assemblers, you may want to stop reading now.  All others that are interested in how I did this (and how to do it yourself, using this article as an example), read on.

     Source: Commented or Not Commented?

There are two kinds of assembler source files (as far as this article is concerned): one type of source is created with a disassembler (not commented and it is therefore hard to follow and understand) and the other type of assembly source is either original source from a cartridge [I've not seen any of this for the Arcadia, has anyone?], or source that someone disassembled and then commented.  The source file I created is of the former kind (it has no comments), but it is the first step toward actually going through the source by hand and making comments.

     Potential Pitfalls

The second line of the 100% compatible "Crazy Gobbler" assembly source is a "define byte" (db) statement, even though the second line of code ISN'T data.  This doesn't create an error in the assembled ROM image because, basically, we're saying, "Hey, Mr. Assembler, ignore this for now- just create the new object code the way the other one was done."  As the code is followed through by hand (THAT'S the time consuming part), changes can be made to areas that need work.

     Creating the "Crazy Gobbler" Assembly File.

DASMx came very close to creating an assembly file that the VACS 2650 assembler could accept and assemble right away.  When disassembling 2650 code, DASMx automatically creates an assembly file that uses Signetics Number Format- but the assembler will not accept source in this format.  In order to change this, I needed to create a symbol file (just a plain text file) called 'crazyg.sym' that contains this one line:

numformat I

This line tells DASMx to use the Intel number format instead of the default Signetics format (0FFH [Intel] instead of H'FF' [Signetics]).  Once I created 'crazyg.sym,' I used this command line to execute DASMx and disassemble the "Crazy Gobbler" ROM image:

dasmx -c2650 -t -a -e0000 -o0000 crazyg.bin

I renamed the output (crazyg.asm) to "crazytst.asm" so as not to accidentally erase or confuse my (eventual) newly assembled "Crazy Gobbler" ROM image.  I used VACS to assemble "crazytst.asm" and I got about 250 errors.  No problem- a quick look at the VACS output listing (crazytst.lst) told me that I needed to add some equates to the "crazytst.asm" file that was created by DASMx.  I added these equates near the top of the file:

z     equ  0
eq    equ  z
p     equ  1
gt    equ  p
n     equ  2
lt    equ  n
un    equ  3

Now I assembled the file again and I got about 150 errors.  This time a look at "crazytst.lst" told me that VACS doesn't like the format that DASMx uses for memory addresses.  DASMx places an X in front of all memory addresses (i.e. X1234 refers to memory address 1234H).  I read the docs for DASMx and couldn't find anyway to change this.  I also looked over the docs for VACS and couldn't find anyway to make it like the X format.  In the end I had to change all the references in the assembly file by hand, that took about half an hour.  When I was done I assembled the file again.

Wow!  No errors!  I managed to get all of those X address format changes done without any problems, but then there were four warnings.  A look at the assembly listing file confirms a suspicion I already had; VACS doesn't like the way that DASMx sets up automatic indexing.  Here's what DASM writes to the assembly file for an automatic indexed memory address:

	coma,r0	1800H,r3,+

VACS doesn't see the plus sign after the comma, so it complains.  I just had to change the above to this:

	coma,r0	1800H,r3+

This change assembles correctly.  "Crazy Gobbler" makes three uses of the above memory indexing (and another that used decrementing addresses, which had to be changed too).  I assembled the source again and got a perfect assembly- no errors or warnings at all.

     Disassembly Done: Now It's All Downhill

After getting an VACS assemble with no errors, I was elated.  "It's all downhill from here," I thought.  Happily, I was right.  But I still had some work to do.

The object file output of VACS is in the Intel format; I changed the Intel hex format file to plain binary and got a 2048 byte file (I used Win Hex to do this).  2048 Bytes!  Yes!  That matches the "Super Gobbler" ROM size perfectly!  Now, I really didn't expect that the ROM image files would be exactly the same (that would be asking too much) but they are: I confirmed this with Ward Shrake's 'howdif' program (available on his technical website).

     One-Hundred Percent Compatible: Yes and No

Now, just because the two ROM images match, doesn't mean that the assembly listing is perfectly usable.  The ROM images are exactly the same, and anyone who plays the two ROM images wouldn't notice a difference (because there isn't any), but the source file is a whole other story.  It may contain areas that are marked as data, but are really code.  It may contain areas that are marked as code but are really data.  If Choi Andrew, the programmer of "Crazy Gobbler," saw this assembly listing he probably wouldn't recognize it (well, it's been twenty years, he probably wouldn't recognize it even if it was the exact file he wrote himself).

An assembler doesn't care what's data and what's not data.  As long as the assembler syntax is correct VACS will assemble anything-- it doesn't care if the code is data or the data is really code; it's up to the programmer to know what is going on inside the microprocessor.

     "Crazy Gobbler" Source Not Available?!?

I have decided not to upload the "Crazy Gobbler" source into the message board file section because it won't do most people any good without comments.  If several people ask for the source, then I'll upload it- but don't expect to be able to breeze through the file-- it'll be work to understand it.  I have no plans to comment the whole file; I plan to pick a couple of obvious routines to get a feel for what is going on.  When I'm "done" I'll upload what I have.

     Now, Go Get Started!

The "Technical Information about the Emerson Arcadia 2001" makes reference to some cartridge ROM routines, so Paul and PeT, in creating the emulators, have already done some investigation in this area (disassembling ROM images); they may have commented some code.  Has anyone else jumped in and taken a look at Arcadia ROM images?  If not, then following the steps in this document will take you a through all the steps that you need to get started.  What are you waiting for?


End of Document
