1982 > go to 2012. Happy Birthday Sinclair ZX Spectrum – Part One
The Sinclair ZX Spectrum home computer was launched in the UK on April 23rd 1982, thirty years ago. Though it was only one of many home computers on the market in the early 1980s, it was arguably the most influential.
Boasting 16 kilobytes of RAM (48KB if you were rich enough to afford the other model), a 3.5mhz 8-bit processor and a screen resolution of 256×192 pixels in sixteen colours (well, sort of – but that’s a whole ‘nother story for another time), you might be thinking that the Speccy is staggeringly primitive by today’s standards.
It also had 16KB of ROM, which held the entire operating system plus the Spectrum BASIC programming language. These days, 16KB would be regarded to be on the small size for an icon.
The Spectrum was extremely popular, with something in the region of five million units sold, but tended to be looked down upon by the more snobby computer magazines of the time (a note to young people: “magazines” were the equivalent of the Internet back in the 1980s – your mommies and daddies will explain), mostly because of the 40-key rubber keyboard.
Yes, the learned computer journalists in the early 1980s were frequently just as petty and snide as many of their current counterparts are about Macs or PCs. (As mentioned before, I’m a long-time PC user so I don’t know enough about Apple computers to be appropriately snide about them, but I do understand that many people consider Macs to be superior to PCs. I believe that there are support groups available.)
The Spectrum’s chief rival was the BBC Micro, built by Acorn Computers and badged by the British Broadcasting Corporation who wanted to get in on the home computer revolution. It featured a real keyboard, better graphics, more ROM, and it looked like a computer, so it was lauded as being somehow better, chiefly on TV shows made by the BBC. It was also – and this is a very important point – considerably more expensive, costing £235 for the base model: the Spectrum cost £125 at its launch, which dropped to £99 after a few months.
But the Spectrum’s affordability was not why it was so influential…
The Spectrum was relatively easy to program. OK, so it had a very idiosyncratic method of entering commands, but once you got used to that it was plain sailing. The manual was excellent: A novice user could be writing his or her own simple programs within minutes. And, if said user kept at it, pretty soon he or she would have mastered the Spectrum Basic and be looking around for something with a little more kick.
That’s where machine code came in. Machine code the language at the heart of a microprocessor. On the Spectrum, as on most computers, the BASIC language was interpreted, With an interpreted language the processor has to decipher each BASIC command before it can act on it, which can be time-consuming, especially when the same command is called over and over – the processor has to decipher the same thing each time.
One way around that is to use a compiler. This does pretty much the same thing as an interpreter, except that instead of deciphering and executing the commands one at a time, the compiler creates a whole new version of the program in machine code. This can be run many times without the need to re-compile unless the source program has been changed. Typically, a compiled program on the Spectrum would run about ten times the speed of the interpreted version.
But that’s not quite good enough, because even though the compiler creates machine code, it’s not going to be tremendously efficient. A lot of us Spectrum programmers taught ourselves how to write the machine code directly, because it resulted in much faster and much smaller programs. When you’ve only got 16KB to play with – and about 7KB of that is swallowed up by the screen memory – every byte counts.
(Think about the scale of this for a second, boys and girls: Say the average Spectrum had 48 kilobytes of RAM. That’s 49,152 bytes. With five million Spectrums sold, that’s 49,152 x 5,000,000. Which comes to 235,760,000,000 bytes of RAM in all the Spectrums ever. The PC on which I’m writing this article has a 2-terabyte hard drive. It could store the contents of all the Spectrums ever sold nine times over.)
The mark of a real programmer is one who will spend hours optimising a program in order to shave a few seconds off the run-time. Yes, that was me. I reckon I spent most of 1983 and 1984 counting clock-cycles and inventing ever more efficient algorithms that I knew I would never have call to use in real life. Especially because back in those days I was a postman.
Nowadays, PCs are so big and so fast there’s very little need for someone to write native machine code: all the big programs are written in C++ or something based on it. If a programmer wants to put a list of names into alphabetical order, he calls the “sort” routine, one of thousands of pieces of code built into his compiler’s library. He doesn’t ever need to know how the sort routine works, only that it does. Shame, really… Back in my day we did everything the hard way, partly because there was no alternative, partly because we were making it all up as we went along.
But I’m not here to complain about how the average modern programmer doesn’t know his registers from his stacks, tempting as that is. I’m here to talk about how cool the Spectrum was.
See, because it was easy to program, countless little back-bedroom companies started up, the vast majority of them writing games. Within a couple of years, the Speccy had lots of games. And by “lots” I mean tens of thousands. Most of them were rubbish, of course, but some were incredibly successful and made their programmers lots and lots of money.
The hardware industry got a boost too. The success of the Spectrum was so great that within a year of launch there were hundreds of third-party peripherals available. Admittedly, most of these were joysticks, but there was other cool stuff: speech synthesizers that made your Speccy sound like an asthmatic Dalek in a wind-tunnel, replacement keyboards that enabled the user – in one swift, easy move – to completely invalidate the computer’s warranty, a power-switch (the Spectrum didn’t come with one as standard: you had to plug it out at the wall to turn it off), and little plastic wedges that you could use to prop up the back of the machine to give it a more natural typing angle (yes, really: they were marketed as “ZX Feet” if I recall correctly – almost every Spectrum-compatible piece of hardware was called “ZX-something”, much in the manner of every current Apple-compatible piece of tat having a little “i” appended to the start of its name).
But the software industry was where the really exciting stuff was happening… More on that tomorrow, in part two of this thrilling article!