Classic Computer Magazine Archive ANTIC VOL. 2, NO. 1 / APRIL 1983

ASSEMBLY LANGUAGE

Disassembler

by Sheila Neece Spencer

This program was designed for you to learn more about Assembly Language programming without investing in an assembler editor. It is used to display the contents of memory in disassembled form, with opcodes and their mnemonics, just as an assembler editor displays it. You enter the address to be examined in decimal code, and the address will be displayed in hexadecimal code. For example, memory location 1536 (decimal) will be displayed as memory location 600 (hex).

After the screen fills with code, the display will stop. Press "S" to clear the screen and display the next full screen of data or "J" to request a new address or "P" to dump the contents of the screen to a printer. Any other key will display only the next line and the rest of the display will scroll upward.

You might find it interesting to load up a machine language program from disk or tape with the BASIC cartridge installed, then run the disassembler and examine various memory locations. (CAUTION: Many machine language programs won't load with the BASIC cartridge installed.)

If you have a disk, check the following locations:

3033-3119 (BD9-C2F hex)

3122-3193 (C32-C79 hex)

3196-3255 (C7C-C67 hex)

3352-3498 (D18-DAA hex)

3501-3741 (DAD-E9D hex)

4618-4762 (120A-129A hex)

These are the RENAME, DELETE, LOCK & UNLOCK, FORMAT DISK, DISK DIRECTORY, and WRITE DOS functions, respectively.

There are several programs which poke Assembly Language subroutines into the memory from BASIC. (See ANTIC #4, p. 44 or #5, p. 57.) After running such a program, run this disassembler to see exactly what the Assembly Language routine looks like.

NOTE: This program takes advantage of ATARI BASIC's unique ability to GOTO an arithmetic expression- see lines 71 and 1010. Without this powerful feature, each opcode would have to be an IF statement, costing both memory and execution time. In line #10, the string variable PS$ should contain 39 spaces.

Listing 1: DISASEM1.BAS Download

Listing 2: DISASEM2.BAS Download