Friday, December 11, 2015

Day 2. High Def Monitor

Downloaded and currently running through Hesmon to play around with the C64 memory and assembly language. Hesmon is not an assembler, is more of a monitor: it has some tracing and memory dump functionality that may help you understand what and how to use the C64 memory, and is surely not as fully featured as other cartridges like The Final Cartridge III.

I chosed it because I am somehow familiar with it, having owned the original hesmon cartridge and remembering a little how to operate it.

There's something magic about the hesmon manual. It's colloquial and it rushes through the various functions asking you to pay attention, to be prepared on the subject matter and to be interested to dig out more from the system by yourself.

I also love the naivetè of some notes, like the following passage

Exception: if you attempt to use RS232 files all bets are off. Also, correct operation of RS232 files is not guaranteed with HESMON installed.

That's something you don't see anymore, companies peddling software are better at lying and denying there is any kind of problem with their software, expecially if they are videogame companies. Or banks. Maybe hesware at the time wasn't thinking that the RS232 would not have been so impoetant, or there was not enough time to iron out the kinks to launch the software on the market on 1983.

Anyway, here is a useful list of mnemonics.

The ; (semicolon) command sets the registers.

You can use the : (colon) command to set the memory contents at a certain address directly.

To write a short program you must use the A command. A takes a memory location, so you have to write A1200 to start writing at the $1200 memory adddress.
You can operate the A command like this.

A1200 LDX #01
A1202 STX 0384
A1205 LDA #02 
A1207 ADC 0384 
A120A RTS 
As the manual states, to stop inserting the program you need to insert an empty line at the end of your program. Hesmon won't recognize your line and won't alter memory location A120B. Note that after inserting the first line the program will alter your currently input line, if recognized, with the final memory layou, with both the op and the values you are passing to them. The program will provide you the memory locations successive to A1200 by calculating the space taken by your current line and opcode. Convenient.

To run this little program you use the command G (go) followed by the memory address: G1200. It will not print out anything on screen yet, however you will see that hesmon will report that the content of the accumulator is 03.

To save the program you need to write S followed by the starting memory area, and the first unused memory area. Our program occupies between the $1200 and $120A, the first unused area therefore will be $120B. So we need to use

S "SUM" 08 1200 120B

The next time we will need to load our program we will use.

L "SUM" 08

Addendum: the example listing was taken from Commodore 64 Assembly Language Programming by Derek Bush and Peter Holmes, published by Hayden.

1 comment:

  1. Sto per mettermi a piangere dall'emozione, leggere L "SUM" 08 30 anni dopo... :*-)