Some C64 Observations

Reading up on the C64. Interesting things learned so far:

  • The memory map of the C64 leaves the assembler programmer with 3 bytes of zero page memory to use. I’m sure there are other addresses that could be abused on the assumption that, for example, the RS-232 port won’t be used during a game. But - 3 bytes?!
  • BASIC code begins at $0800 and ends at $9FFF, which explains why the C64 code I’ve seen so far positions the code at $0800.
  • The C64 Programmer’s Reference Guide looks like it contains everything I need to get started (except for the C64 asm header code, and some way of producing a file that’ll run in an emulator).
  • The C64’s 6510 CPU lets you bank in and out extra RAM if you don’t need the BASIC ROM or the character set, just by setting a bit at a particular address. Clever!
  • The C64 has a set of built-in functions that control all of the I/O you’d need to perform. For example, printing to the screen is just a matter of loading a hex value representing an ASCII code into the accumulator, then jumping to the memory address for the print subroutine. The memory address is in something called a “jump table” (a list of pointers to the subroutines themselves, I’d imagine) near the end of the 64K address space. The jump table apparently forms the C64’s kernal.

I’ve also noticed that “Introduction to Assembly Language for the Commodore 64” by Stan Krute is selling for $194.94 (roughly £100 if you use the official exchange rate, or £194.94 if you use the Apple exchange rate) on the US Amazon site. As far as I can tell, it is second-hand, and it’s not made of gold. Those crazy Amazon guys!