!lm10
!rm76
A Beautiful Dump . . . . . . . . . . . . . . . Robert H. Bernard

The old saying, "You can't tell the players without a scorecard," is certainly true for program debugging, and sometimes the only way is to look into memory and see what is there.  The Apple II Monitor has a memory dump command, but I found it inadequate:  it's formatted for a 40-column screen, it doesn't show ASCII codes, and getting output on a printer is a hassle.

So I sat down and wrote a quick assembly language memory dump modeled after a System/360 core dump (remember when computer memory was called "core"?), with both hex and ASCII.  My first attempt took up more than one page of memory and was trapped where I assembled it by absolute internal references.  I massaged it until it fit in less than a page and made it relocatable ("run anywhere") by making all internal jumps into relative branches.  (A "page" in 6502 jargon is 256 bytes, with addresses running from xx00 through xxFF.)

Next I decided to add a printer feature; while I was at it I made it use 80 columns on the printer, 40 on the screen.

Next I made it print the bytes in groups of four, with a space between every four bytes.  Sixteen bytes are printed per line on the screen, 32 on an 80-column printer.  Spacing in groups of four makes it easier to spot certain address locations.  If a byte value is a printable ASCII code, I print the character above the hexadecimal value.  (Values $00-$1F and $80-$9F do not print.)

Then I wanted options to browze one screenful at a time, and backup when I passed the place I wanted to look at.

You probably think that by now the program is at least two, and maybe more, pages long.  Not so!  All the while I was able to keep it in only one page (which doesn't say much for my original code).

The end result (after 21 versions!) is listed here for your examination and pleasure.

Operating Instructions:  BRUN the program anywhere in memory that you have a free page (256 bytes).  When the "?" prompt appears, enter the address of the memory you want to dump in any of the following ways.  After the address or address range, type the return key.

S.E        To dump memory from S to E on the screen.

S-E        To dump memory from S to E on the printer.

S,E        To dump memory from S to E on the screen,
           but pauses after each screenful;
           press space bar to continue,
           or press control-C to stop.

S          To dump from S, pausing after each line;
           press space bar to dump next line,
           press letter "B" to back up one line,
           or press control-C to stop.
