Game Development Thoughts

C64 Assembly

When I visited Germany this year, I found that my mom had dug up a few of my really old computer books. I only have marginal interest in the original Amiga manuals that she found, but there was one book that stirred some seriously cool memories: “Commodore 64&128 – Maschinensprache für Einsteiger”. It’s a book about programming the C64 In 6502 assembly, and as luck would have it, that’s how I spent most of 1988!

Even though I never turned into a professional programmer, my first real contact with the computer (other playing than games, of course) was programming the C64. My dad had bought the system under the usual pretense: we were going to use it for bookkeeping and other useful tasks, and he even took a BASIC programming course. c64assemblyBut in the end, it was I who got the most use out of the machine, and I used my dad’s coursework to learn how to program various simple games in BASIC. The programs were simple because all this happened when I was only 9 or 10 years old. But the first English words that I ever learned were “if”, “then” and “print”.

A couple of years later, I had met an older neighbor kid who had a few connections to the local cracker scene. That’s how I learned about this newly released book, “Maschinensprache für Einsteiger”, advertised as the ultimate way of learning how to program the C64 at its core level, Assembly. Since my friend was all over it I saved my allowance, bought the book, and found myself programming C64 assembly when I was about 12 years old.

Rereading this book after all these years put me in a weird twilight state: a lot of my fundamental computer understanding stems from this book (even though in 1988 I didn’t realize that I was learning fundamental concepts like base-2 &base-16 number systems, CPU registers, cycles, op codes and stack frames). A lot of these ideas never fully registered back then, and I certainly didn’t gain a holistic understanding of the C64 system. I was just using assembly loops and instruction that made pretty lines appear on screen.

Which is why revisiting C64 programming today is a bit of a revelation. Now that I can fully understand what the book is telling me, the C64 is delightfully simple to work with. 65384 bytes of RAM, unified memory – it doesn’t get much easier than that. Programming is procedural to a fault. Memory allocation isn’t even abstracted into variables, and I can directly address the video memory of the C64. I can test the state of the keyboard and move around  register contents to create a simple text processor. What you see is what you get – and it’s as close to the hardware as possible. All of this is possible because the C64 is an incredibly simple and straight-forward machine – at least compared to today’s consoles.

Reading “Maschinensprache für Einsteiger” inspired me to download one of the popular C64 emulators and do just a bit of C64 assembly code again. My programs didn’t turn out much more complex than what I did back in 1988. But at age 33, it only took me a day to (re)gain all the knowledge required, and I feel that if I kept going, I could create something that actually uses the C64′s capabilities.

I won’t. It’s just cool to think that I could!

Leave a Reply

Your email address will not be published. Required fields are marked *

Please verify that you're not a bot *