Listing Buried Messages....................Bob Sander-Cederlof

Do you like treasure hunts?  Dis-assembling, analyzing, understanding, and modifying programs written in assembly language, with nothing to go by but the program in memory and maybe a user's manual ... to me it is a treasure hunt.

Last week I desperately need to make full use of a Novation Cat II Modem.  "Full use" of almost any peripheral device implies the use of assembly language.  Even though Novation includes a very nice manual for the purpose, it did not answer half my questions.

Novation also includes a disk with a program called Com-Ware II.  This program is assembly language, and takes 74 sectors on the disk.  Somewhere, hidden in a small, dark corner, guarded by gnomes, surrounded by wild beasts, lay the answers to all my questions.

I started by BLOADing the file.  Then "CALL -151" to get into the monitor, and typed "AA60.AA73".  The first two bytes diplayed the length of the file, and the last two bytes are the starting address.  I learned it loaded at $900, and was $4825 bytes long.

I started using the monitor L command to scan through the program, and discovered that the programmer had placed all the screen messages "in line".  That is, rather than putting all the screen text at the end of the whole program, or in the middle, or wherever, he coded the ASCII strings right in place.  Each message was preceded by "JSR $3866", and ended with a $00 byte.  The subroutine at $3866 retrieved the return address from the stack, used it to address the message text while printing it out, and then placed a new return address on the stack to continue execution right after the $00 byte.

This makes it difficult to use a program like Rak-Ware's wonderful DISASM, because you have to tell the boundaries of all non-executable code.  And there seemed to be LOTS of messages.

On the other hand, it also makes it easier to follow the flow of the program.  The buried messages are almost like living comments, telling me exactly what is going on in every section of code.

I decided to get my Apple to help.  I wrote a "quick and dirty" program to scan through the whole image from $900 through $5125, looking for every occurrence of "JSR $3866".  I printed out the address of the next byte, which is the first byte of message text.  Then I searched for the terminating $00 byte, and printed out its address.  Then I went back and printed out the message text.

After several tries, I even made my quick and dirty program nice and clean.  I printed all the messages out, nicely formated for easy visual scanning.  I set my printer on 8 lines/inch and 12 chars/inch to save paper, and let 'er rip.  Six whole pages!  I think a third of Com-Ware is taken up by messages!

Here is a sample of the printout.  Notice that I printed control characters, including <RETURN>, as "^" followed by the printing form of the character.  Thus "^M" means <RETURN>.


<<<sample printout here>>>


I believe a lot of programs of interest use a similar technique for message printing, and slight adaptation of my MESSAGE SEARCH program could help YOU find some buried treasure!
