đ INKEY$ and his 8 legs
Back in the 80s, some kids who had a ZX Spectrum or ZX-81 learned to program before they could read and write. This doesnât sound very believable, but itâs the main reason Eben Upton and co. created the Raspberry Pi. I thought Iâd say something about how that worked.
Budget computing
The Speccyâs crude operating system was a BASIC command line interpreter, with a simple line editor. When you switched the thing on, its cheap capacitors whistled with a coil whine inaudible to adults, the screen flashed black as the memoryâs graphics region was reset, and about a second later you were presented with Sinclair BASICâs operating system:

Well, to be more accurate, it wasnât when you switched it on, it was when you plugged it in. Luxuries like an on/off switch had no place in Sinclairâs quest for affordable home computing.
A power button wasnât the only missing feature - budget home computers of the 80s outsourced their peripherals to existing consumer electronics. Cathode ray tube monitors were expensive, ones with digital inputs cost twice as much and had no other function. So, like gaming machines before it in the 70âs, the Spectrum came with an RF modulator. Youâd connect it to the family TVâs aerial port with a coaxial cable, and tune it in the best you could.
More expensive computers had disk drives, but on machines like the Spectrum, Commodore 64 and Amstrad CPC series, games came on audio cassette tapes. You split the mono EAR and MIC channels with a splitter cable, plugging them into your mumâs radio cassette player, then played the game into the machineâs EAR port while carefully avoiding the record switch.

A conflict of interest
Engineers built home computers to bring the glory of computing into the home, but the main reason to buy one was to play games.
So gaming was the killer app and also a grubby, degenerate, secondary
function, kind of like porn was to the early Internet. Just like that conflict
caused Flash and QuickTime to dominate the early web, this one led to a user
experience few would stand for today: To load a game, youâd actually instruct
the thing to do the loading; you had to enter the LOAD keyword into the CLI.
This sounds simple enough, but Spectrumâs budget constraints came with more quirks, quirks that made the process famously awkward and different to every other home computer.
The ZX character set
Short on RAM, CPU and long on ideas, the boffins at Nine Tiles decided that
their BASIC interpreter could do without the text part of a lexical parser,
it instead dealt with tokens. They assigned all possible functions to an
extended character set. Characters 0xA5 to 0xFF became entire words rather
than a single character, and to input them, the text cursor switched between
modes depending on context. A flashing K meant keyword input, an L for
letters and so on. These modes acted as extended forms of the SHIFT key, not
as many as the modern Macâs 8-bit chorded keyboard, but enough to be pretty
confusing.
Hereâs the output of a BASIC program that prints the âlettersâ of the ZX character set, taken from Wikipedia:

To help with the task of input, the budget rubber keyboard had all the keywords
printed on it. So, getting back to the loading ritual, to load a game youâd find
and squidge down the key with the word LOAD on it.

If you didnât spot it, LOAD was conveniently located on the J key. And next
we just tap ENTER, right?
Nope! You also had to pass the name of the program you wanted to load. Not that
anyone actually used this name filter, tapes were slow and filtering by name
would mean sitting for 4 minutes listening to some other programâs memory dump.
I like to think it was a psyop by Steve Vickers to teach programming by stealth.
Unlike the LOAD keyword, there were other commands that had optional string
parameters. It felt like an act of spite: this thing didnât want you to load
games.
If, like everyone, you didnât care about the programâs name, then you just
entered an empty string: a pair of double quotes. These, even more conveniently
than LOAD, were inserted by holding down the aptly named SYMBOL SHIFT and
squishing the P key twice. Then you finally pressed ENTER and clunked down the
play mechanism on your cassette player.
If the tape wasnât too worn, too stretched and hadnât got too hot or too damp, it wasnât wound too tight, and wasnât an 8th generation copy from a chain of peopleâs mumsâ dual cassette decks (the ones with Hi-Speed Dubbing) it might load. But only if the impatient kids didnât shock the tape heads by jumping about the room, or squabbling too roughly. If you passed the test of patience then your game would be ready to play in 3 to 4 minutes.
That 4 minutes felt like a whole day.
GOTO 10
The looming 4 minute eternity made the flashing K cursor an open invitation
to play with the other keys. If you pressed P it typed PRINT, and if you put
some letters between the quotes after it then itâd print whatever you wrote to
the screen (in CAPS, because the CAPS SHIFT key was for the exotic and alien
lower-case letters, a rare sight on the device).
If you wanted some real fun, you could put a number before the keyword and itâd
get saved to one of the 9,999 available line numbers instead of just running it.
Then youâd run them in line-order with the R key, or GOTO one of them with the
G key. So we did.
10 PRINT "HELLO"
20 GOTO 10
And thatâs how I became an illiterate programmer. I couldnât spell LOAD or
CLEAR on my own at the age of 6, but I could see what colour they were and
that they were different to the other allowed keywords. BEEP is written as
bip when youâre 6, but you can read BEEP and it made music if you gave it
some numbers.
This is how Sir Clive Sinclair earned his knighthood. He created a generation of programmers who could code before they could write. Ones who went on to ⯠transform the world.
An imaginary friend
If you wanted to take a key from the keyboard without waiting for someone to
ENTER it, which you had to do if you wanted to move a âââ around the bottom
of the screen, youâd use the INKEY$ keyword to save it to a variable. Or a
âlittle boxâ. INput KEY, dollar meaning it returns a string.
If youâre 6 years old, donât know what âinputâ means and call your keys
âbuttonsâ then INKEY$ conjures up images of a friendly octopus with his arms
all over your buttons catching the ones you press. Legs actually, because only
humans have arms.
To me, INKEY$ is a cartoon octopus printed on 4 inches of thin card with
SEE INLAY FOR DETAILS written along the side.
Ah.. memories!