Hacker News new | ask | show | jobs
by stevep98 1810 days ago
I wasn’t bad with programming BASIC, but the true epiphany came when I went on vacation to Spain (very common for UK kids). I took the programmers reference manual which not only had info about BASIC, which I already understood, but it included info on all the 6502 opcodes and all the c64 registers. It really took me a long time to understand what this was. It would have been much easier to have a mentor to help me through this… it was a reference, not a tutorial.

But at some point, it clicked, and I started writing out the assembly… there was a register to control the screen background color… so I just blasted 0 into that register to make it black. In what was probably my greatest ever fear of engineering, I then hand-assembled my two-line assembly into 5 bytes of machine code. But I had to wait until I got back from vacation to try it.

It worked… it changed the background color, but it crashed the machine… I had forgotten to add ‘return from subroutine’, after that it worked, and that was the beginning of my journey.

I regret not spending more on proper tooling early on. But all the good assemblers were cross-assemblers that ran on pc’s.

There’s was also a really good book by Raeto Collin West that went into more details, and that’s where I got some of the drive register info. There is a command you can send to the printer to dump its memory, so that’s what I did. (To get it’s ROM to see what it’s drivers are doing)

The printer was critical to being able to read through the assembly and annotate it. You learn how to read ASCII in your head, etc.