Classic Computer Magazine Archive COMPUTE! ISSUE 67 / DECEMBER 1985 / PAGE 122

Disassembler For Atari

William Casner

This versatile utility disassembles any machine language program in memory or on disk. It can also display a memory dump and check disks for bad sectors. The program works on any 400/800, XL, or XE with at least 16K RAM for tape or 24K for disk.

Here is a BASIC utility for disassembling machine language (ML) programs and examining the contents of your Atari's memory. Type in "Disassembler" and save it to disk or tape before running it for the first time. Since this program is largely self-prompting, you should be able to use it with little or no instruction. To choose one of its three main options, press the OPTION, SELECT, or START keys as prompted. In each case, you may choose to send output to a printer rather than to the screen.

Using The Disassembler

The first option, disassembly, translates ML object code into its 6502 mnemonics. After you choose this option, the computer asks whether you wish to disassemble a particular memory area, a particular sector on the disk, or a binary file stored on disk. This allows you the freedom to disassemble virtually any ML program, even autoboot programs that normally take control of the computer as soon as you load them into memory.

The size of the disk file you can disassemble depends on the memory capacity of your computer: With 48K or 64K, you can disassemble files as large as 21K (more than 21,000 bytes). When disassembling memory, you must provide hexadecimal starting and ending addresses of the area you wish to disassemble.

The second option is a listing, or memory dump. Again, you can look at a particular memory area, a particular disk sector, or a binary file. In this case, however, the disassembler displays each byte in ASCII form rather than as a 6502 mnemonic. This function is useful for examining parts of a program that contain data rather than ML instructions.

Finally, you can scan a disk for bad sectors. After you select this option, the program checks every sector on the disk, listing the type and sector location of any errors that are found.

As you may know, CTRL-1 can be used to pause any scrolling screen display. Press Q at any input point (except the menus themselves) to return to the main menu. If you wish to abort a disassembly or memory dump, press the START key: The computer asks you to press any key to continue, then returns you to the main menu.

Take special care while typing the DATA statements in lines 1230–1310. Don't omit any commas or spaces, but don't add any extra ones, either. Mistakes could lead to incorrectly decoded mnemonics. If the program stops with an ERROR 3, 6, or 8 message in line 1220, it probably means you have a typing error somewhere in the DATA lines.