(Conway's) Life on 6502

I don’t know where I got it, but I remember having access to a Life program for the PET written in 6502.

It was basically a hex dump as I recall. And it was not a short one.

It’s notable because I typed the thing in twice, once with a friend to help ensure that we got it right, but in the end it never worked. It never did anything. And we had no idea what we did wrong.

But I was motivated enough to do it twice.

1 Like

I guess, this was probably due to lots of bit shifting. Conway’s Game of Life is rather demanding on memory for early machines, if you do it just by one cell = one byte. (E.g., on a PET in best block graphics resolution, this would be 8,000 bytes to store two fields of 50 x 80, and there are just 8K of memory guaranteed). So bit-vectors to the rescue. But this is also, where the 6502’s limited amount of registers bites…

P.S.: On second thought, you could also store the two fields encoded as, say, 1 and 2 in a single byte vector, which amounts just to 4K, which is pretty doable and no intermediate storing of shifted values required.

Ooh, Life on 6502 - two of my favourite things! I can point you at a couple of very productive threads:
Conway’s Game of Life for Atom, Beeb, Elk?
Conway’s Life on 6502
and if you follow this link you’ll then find P-a Bäckström’s 256 byte Life for C64:

1 Like

I’ve just rediscovered a 6502 version of Life which fits in a tweet, by Eben Upton. It runs a fixed pattern - see here to run it in-browser.

The two lines of Basic which encode the machine code, an explanation of the content, and the annotated assembly source, can be seen here and here:

1 Like

And for those not yet familiar with the XKCD online comics, then the current one is also quite poignant: