Caveat: 6502

When I was in middle school, we had an Apple ][ computer. I messed around with programming – not very seriously, but I taught myself the rudiments of the MOS 6502 Assembler ("machine language"). The 6502 is perhaps one of the most famous CPUs in the history of personal computing, since not only was it the CPU in the first Apple computers, it was also the heart of early Nintendo and Atari game systems. Even today, there are "6502 fan clubs" and "retro computing hobbyists" focused on the platform.

A2_redbookLater, in college, I took a few computer science courses (enough to make a minor), including an assembly language programming class, at that point in time based on the platform of the Motorola 68000 (the CPU in the Macintoshes of the era). I'd had some chance to experience one of that chip's ancestors when in middle school, too, because my uncle had brought home a project he was working on involving a Motorola 6800.

That assembly language class was undoubtedly the most valuable computer science class I took, because if you can make something work in assembly language, you have a genuine understanding of how computers actually work, and this provides an excellent foundation for any future programming efforts.  I have long believed that assembly programming should be a foundational course in high school curricula – for all students, at the same level as courses like math, physics or biology. 

During the time I was taking that course (1988?), I dug out an already-at-that-time antiquated Apple , and with some help from my friend Mark (who at that time was starting his career in embedded systems), I began writing a Lisp language interpreter for the Apple, using the 6502 Assembler directly, and using my battered, red-covered reference manual preserved from the middle school years (the picture at right was found using an online image search, but it looks exactly like my old copy).

I didn't really get much further than the rudiments of my interpreter – I think I got it to respond to some kind of "hello world" instruction, in the vein of

(DEFUN HELLO ()
"HELLO WORLD"
)
(HELLO)

I was unable to solve the "garbage collection" problem (memory management), and I never took the Operating Systems Design course that could have given me the understanding necessary to do that. But it was fun. Recently, remembering this activity, and aware that your average internet browser tab has much more abstract computing power than a 6502 chip, I was curious if there were 6502 emulators available.

Sure enough, there are. Many, many emulators – google is your friend, if you're interested. 

Apple_Invaders_AP2Not only are there emulators, but someone has taken the time to construct a fully-functioning "virtual 6502" which is visual – meaning you can watch the signals step through the fully mapped processor as it executes its instructions. You could run Space Invaders on the emulator (if you could find a compiled code for it), and watch the processor step through the execuation of the classic game.

Given I am a nerdly geek, this was interesting to me.

[daily log: walking, 7km]

 

Back to Top