{Home}

What's this?…

6502 Assembly

It's a fragment of 6502 assembly code.  I spent a lot of time programming in 6502 on my first personal computer, an Acorn Electron.  This excerpt is from one of the many versions of Life I've written.
  We've already added the number of living cells around this one, and the sum is in the A register.
TAY   We transfer A to Y (TAY)
LDA liveRule, Y   We load A (LDA) with the appropriate rule value, using Y as an index.
BEQ cell_dies   Then we branch to the appropriate code if the value is equal to zero (BEQ); the rule says the cell must die.

I have lovingly re-created the Electron's font from Appendix F of the User Guide.   Actually, I wrote a small Windows program with the font coded into it as an array of bytes representing each character's bit-pattern (laboriously hand-entered from a faxed copy of the manual -- thanks for the fax, Dad).  The program rendered strings using the font, so I could build my little assembler fragment image:
BeebFont.