Saturday, April 19, 2014


C64 Tokasm

Back in 1984 I did a lot of programming in assembly language using Tokasm a 6502 assembler from local programming god and good friend Mark Sibly.

Tokasm was a light weight hack that replaced the C64 BASIC token table with 6502 mnemonics allowing an elegant inline assembler to exist in a small corner of the 65536 bytes of RAM that was the Commodore 64 home computer.

Source code for the music player used in my unpublished game Space Flowers is attached. Note the tightly packed assembly allowing a large amount of logic to be viewed on the screen at once and the line number management system inherited from the hacked BASIC environment.

The 6502 CPU has three 8 bit registers A, X and Y. The first 256 bytes of RAM are known as zero page and double as 16 bit pointers.

Interesting story, Space Flowers was originally and naively called Castle Kingdom and a sale was attempted to none other than Commodore themselves. 

Unable to avoid being deported to the South Island, hacking got replaced with musical drinking games and my 8 bit coding years were over.