Gwyn ap Harri

January 15, 2026

Programming the Z80

It was my twelfth birthday, 27th July 1983 and I had finally persuaded my dad to buy me a ZX Spectrum 48k. The price had dropped from £175 to £129 and he had no more reasons to rebuff my incessant begging.


We lived in a caravan on the grounds of an old dilapidated farmhouse in Kirkhouse Green, a small rural hamlet outside Doncaster, near Sykehouse. My dad’s project was to renovate the roofless house into our family home, but at the time of the arrival of my beloved Speccy, we had no electricity.

He had a friend who was handy at electronics and I remember having to connect a brown plastic soap box full of wires and a transformer to a car battery, which our TV was also connected to, to fire it all up. We had half an Austin Maxi (also brown) outside the caravan that acted as our generator for the car battery. I am not making any of this up.
I had a few games, JetPac being my favourite, but I was more interested - well, obsessed - with programming it. But how did I learn how to do this, without the internet etc? I’m a bit ashamed to say that I used to catch the bus to town for 2p and go into WH Smiths. They had stacks of magazines, the best and shiniest being SInclair User, but it was 75p. I didn't have that kind of money so I tried to read as much as I could and catch the bus home and type in what I could remember into my Spectrum, often ending up being frustrated when it didn't work and I didn't know how to fix it.

One day, I picked up the magazine and wandered around the shop, and walked out, forgetting I still had hold of the magazine. I had inadvertently shoplifted this precious oracle. I looked back at the shop, knowing the right thing to do was to return it, but in that moment I turned and walked out of the Arnedale Shopping centre and caught the bus home, hiding the magazine that I would never have been able to afford from my dad and sister.

Every month, for a while at least, I repeated this criminal act. I remember feeling hot and dizzy, with my excuse in hand, “Oh, sorry, I didn’t realise…”, but I never had to use it and I learnt how to program in BASIC (Beginner’s All-purpose Symbolic Instruction Code). This was enough for me to win a book from school for the best program in a competition they held, which I still have today.
I had made an educational program where you had to answer mathematical questions, and every time you got an answer right, a person would get on the bus until the bus was full, and then it would drive off, with a smooth scroll enabled through something called ‘machine code’. The thing was, while I programmed the maths and drawing of the bus, I copied the machine code from the magazine. I didn’t know how to program in machine code and it became my dream.

It was now 1984, in the midst of the miners strike and I went to school at Stainforth Middle School, which was a pit village. As you can imagine, the community was being ripped apart. In this chaos, my obsession was a book called ‘Programming the Z80’ - a curious, really thick book that stared at me from the top shelf of the big 'Computer Store' in town and it was £12.95. I didn’t have 75p for Sinclair User, never mind thirteen quid for this behemoth! But it had been Christmas, and I had received a few gift vouchers for the now defunct Woolworths store, to the tune of £15…! But my book was not, and would never be, sold in Woolworths, what could I do…? I hatched a plan.
I told three of my friends the plan. They had no clue why I needed this book so badly, or why I didn’t just buy loads of chocolate with my vouchers like a normal kid, but they for some reason bought into my mission. They recruited seven more kids I had never met.

On one Saturday morning, we met in Stainforth and I gave each person 2 pence for the bus ride into town. We assembled outside Woolworths and I divvied up the vouchers between them. I had recce’d the whole shop and the cheapest item at the time was a 7p packet of Polos. The deal was, each kid would go in, one at a time and buy a packet of polos with the £1 vouchers and they would get the Polos and I would get 93p in change. I guess this was sort of money laundering!
It worked a charm until one cashier figured out what we were doing and gave us a 50p voucher and 43p in cash! How stingy is that..!? Not to be knocked back, our youthful resilience and resulting ingenuity to this terrible injustice was to reassemble and take the polos to a different cashier on a different floor. Miraculously, after about an hour of Polo buying, I had enough money for my book. I offered the kids the spare money, but they refused and said I had been more than generous with the bus ticket and Polos. I thought they would then disappear into the ether of the town, but they marched with me to complete the mission.

Walking round from the Arnedale Centre to the Computer Store took about 5 minutes and I had to ask a guy to get me the book because I couldn’t reach it. After he told me it was a book for adults, I said, “that’s ok, I understand. I want to buy it anyway.” and I handed over my cash. I couldn’t believe it. My plan had worked and I was visibly excited. The kids who helped me were as excited as I was and looked into the book with confusion and excitement to be greeted with loads of ineligible text and technical data. Looking back, I’d have expected them to laugh at me or think I was weird, but they didn’t. They looked proudly back at me, patted me on the back and wished me luck.

I never saw them again.

I proceeded to learn Z80 machine code on my ZX Spectrum powered by a car battery which was in turn powered by half an Austin Maxi.
Nine years later, at the University of York, I was into my second year studying Computer Science and we went to the first lecture of a new course. Some students were excited, "I've always wanted to learn this!". The first thing the lecturer did was show a mesmerising slide of hexadecimal numbers and asked the befuddled students what it was. I was the only person to put their hand up. Surprised, the lecturer prompted me to answer.

“It’s Z80 machine code”

I obviously passed that course with flying colours, and I have some random kids from Stainy to thank for that.

Enjoy the Polos!
This post is dedicated to Damian and Mark who made me remember this story that still defines who I am today.




About Gwyn ap Harri

Hi, nice to meet you! My name is Gwyn ap Harri - thanks for dropping by and showing some interest in this stuff. I am the CEO of XP School Trust, a group of schools in the UK that allow kids to express who they are through their work. I am also the CEO of realsmart, an edtech company that empowers us to learn more and learn it faster.

Subscribe below to keep up with the ideas I’d like to share with you. Best wishes!