Mastermind 6502

Very many years ago (!) I was learning about and experimenting with electronics; back in 1978 I was for example cycling to CN Stevensons in Bromley to purchase electronic components – here’s an advert from back then:

Into 1979 I was reading about computers and microprocessors in magazines, discussing them with friends at school – our school had no computer capability at all although the next door school did have a teletype terminal connected to a mainframe computer somewhere in London that we were occasionally allowed to use. In mid 1979 I remember reading about an amazing Compukit 101 computer kit in Practical Electronics magazine, which no doubt was formative in my future …

At school we had a “Radio Club” (a regular gathering of what would now I suppose be “nerds” or “geeks”) and my friend Derek there had built a computer based on the 6800 microprocessor – that was fascinating! But the 6800 was very expensive and I was reading about the 6502 that was so much less expensive … and in October 1979 I bought a 6502 microprocessor!

On veroboard I built the microprocessor along with some RAM and a power supply, and a complicated switch input device that could load bytes of data into the RAM – there was no display / keyboard back then, when power is turned on the microprocessor has no code to run, so the switches allowed me to slowly byte-by-byte and bit-by-bit enter code into the RAM! Sadly for a long time a couple of poor solder joints meant that the microprocessor worked but was unreliable (I eventually fixed the issue).

By then my Uncle was also getting interested in computers and had purchased the Acorn System One kit, which was the same 6502 microprocessor but with a display and keypad and a 512 byte ROM so that when it was powered, it could do something!

The kit included schematics and accidentally included a duplicate PCB; I managed to buy copy ROM chips from someone and so was able to adapt my 6502 design into a clone of this Acorn System One! I learned a lot on this and even today I can see 6502 machine code and decode some of it. I’m sure I wrote lots of code but sadly over time everything I owned has gone (for sure there was a big clear out when I emigrated from UK to USA!)

However the Acorn System One in the photo above, which was owned by my Uncle, was given to me after he died – and included a single 6502 “program” that I clearly posted to him and which he kept; you can see it on the right in the box and I recently photo’ed it with a plan to try and decode it:

Over the weekend, I wondered what AI could do with it (our company has been experimenting with AI, finding that it’s very good for creating documentation but not so good for creating code!); I gave the above photo to Anthropic CLAUDE AI with the very limited instructions “This is a photo of a table of hex numbers in a grid. Can you convert to a spreadsheet format?“.

CLAUDE AI did surprisingly well here, not only producing a spreadsheet output of the hex, but also identifying “A fun piece of computing history — this looks like a hand-assembled 6502 machine code program for a Mastermind game, dated April 2, 1981“. The output was a spreadsheet like this:

(turns out there is a single error in this conversion, at $034E, but I didn’t know it yet – it looked pretty good to me, managing to cope with my even-then-poor handwriting!)

I now decided to get really ambitious and told CLAUDE AI “These are 6502 assembly code bytes, are you able to disassemble to 6502 mnemonics? The target computer was Acorn System 1“; the response took a couple of minutes but was really impressive. CLAUDE AI not only knew what hex values corresponded to what 6502 assembly instructions but also identified the ROM calls to Acorn System One!

At this point I had a second spreadsheet with decoded 6502 assembly code instructions and a reasonable attempt at understanding what the code did. Today I worked through the disassembly, fixed a few things and added additional comments. I converted the two blocks of display data from wrongly disassembled code back to hex bytes (which I suspect I could have told CLAUDE AI to do, on a second run); I also discovered the one byte that had been wrongly read from my handwriting, and corrected that section of disassembly. Here is the resulting code:

If anyone is interested here is the actual spreadsheet which could be used to extract the code:

The CLAUDE AI results are quite impressive. First of all the Acorn System One is quite obscure and yet it was known (I suppose since AI is taught by what already exists, there might be a bias to old things, but even so I’m surprised). While CLAUDE AI did not get everything correct, in the less-than-ten-minutes it took, it achieved what would probably have taken me at least half a day! And I was amused by the inferences it had in recognizing that my game was called “mastermind”, and referring to “colors” in a few places in the disassembly (because there is/was a “mastermind” board game that used colored pegs and which no doubt was inspiration for my program)

It is also worth thinking about the computer power comparison of Acorn System One running at 1MHz with 1K RAM, 0.5K ROM, while CLAUDE AI is running on who knows what that but likely some millions of times more powerful!

PS: The back of the letter I had written to my Uncle Keith included “how to play” instructions which I never gave to CLAUDE AI but here they are for reference …

Winter Garden Farmers Market

Here are some of the products on offer at todays Farmers Market downtown … you can see we have two “fruit & veg” stands, the big one under the pavilion and a smaller “organic” one – but so many other items from donuts to dresses, belts to bread, and more. It was early when I took these photos but much busier by 10am:

Wild Florida #4

We returned to Wild Florida today to drive their safari park, always a nice time and of course lots of photos!

We also of course fed the Giraffe!

We then drove a little to the “zoo” walk through area, which had some great views of a sloth family and also ring tailed lemurs!

And finally, video from throughout the day …