Wednesday, 26 August 2009

So Long PCW, and belatedly, Sub Set

It's The End Of The World

Groundbreaking and trailblazing, Personal Computer World magazine, at age 31 the UK's first and oldest, has finally ceased to be.

The August 2009 issue (published on 8th June) gave no indication that it would be the last. It even contained the usual advertisement for the "next" issue.

Lifelong contributor Guy Kewney has already provided the definitive, if typically idiosyncratic, personal obituary. But I want here to say a few words about one of the magazine's lesser known innovations.

I'm not going to claim that PCW was my lifelong companion. My friends and I were already a few years into our careers in microelectronics and computing, thanks to the National Semiconductor SC/MP prototyping board system (1974-6) among others, well before PCW first appeared on the newsstands in February 1978.

Needless to say, the "Scamp" was uniquely innovative for its time. For example, it was the first system to provide for multiprocessor architecture--up to three of these processors could share the same address and data buses. Not that we first year undergraduates could afford more than one between three of us!

Through magazines like Elektor and Practical Electronics, carefully collected and stored in custom binders, we all learned the black art of machine code programming. And while I still owe PCW's editors my greatest debt in that lowest basement of Babel, actually they gave me my first "break" by publishing articles in various other areas; articles about micros, pocket computers, and higher-level technical subjects. In 1980, I bet a friend one pint of Guinness, that I could get a line drawing of a locomotive engine published in PCW. Maybe you can guess the subsequent shape of the state diagram in my "Complex Number Calculator" for the Sharp PC-1211 pocket computer. [Update, 12 March 2011: see it here]

I Know All About Them

Thus spake Spock, when asked "…You know a great deal about computers, don't you?"

The instruction sets of these early up-to-8-bit processors, while not exactly RISC, were quite manageable. By which I mean, anyone could quickly become a master machine code programmer; able to write on a first pass, a perfectly optimized program for any given task. And like Spock, to do it directly in binary, without the need for an assembler (compilers were things the universities used on their minis and mainframes). The "secret" was simply to take the full set of opcodes for the processor, each corresponding to some ordered pair of hexadecimal digits, and construct an "instruction map" - a 16x16 chart - with the digits 0-9, A-F along each axis. This could then be memorised quite easily.

The Zilog Z80 (Tandy TRS-80, Sinclair ZX-80/81/Spectrum, Amstrad CPC-464/PCW) yielded the largest map; firstly because it used up all 256 available opcode bytes, and secondly because it used several of these as prefixes for 16-bit instructions, which obviously opened up more maps (more pages), extending the instruction set of its progenitor, the Intel 8080, e.g. to include new operations utilising its new index registers. Other favourites were the 6502 (Aim-65, Commodore Pet/Vic-20/64, BBC Micro) and of course the Motorola 6809 (in Mettoy's Dragon 32 home computer), the first to include a Multiply instruction.

PCW Sub Set

Apart from this token attempt by the 6809, none of these 8-bit processors had much out-of-the-box support for adding and subtracting numbers above 127, never mind multiplying and dividing them, or allowing fractions. Even when supplied in the form of a home computer, i.e. with interpreted BASIC in ROM, their arithmetic and other subroutines were often very far from optimal.

Personal Computer World provided a great service to the micro development community via its Sub Set series of articles, curated initially by Alan Tootill, joined later by David Barrow. Here we could all meet to set down the gold standard for 32-bit arithmetic routines, signal processing and interfacing, random number generation, development tooling, and a hundred other hotly contested library projects. Simultaneously, the Datasheet format provided a respectable standard for documenting material of this type.

I became a regular contributor, Alan and David frequent pen pals. When I eventually landed my first full-time job in the industry, it was purely 100% as a result of the work published here, and 0% thanks to my undergraduate degree.

Later I'd be tempted more than once, while en route to maybe York or London, to arrive on David's West Yorkshire doorstep with an oft-promised bottle of Talisker. As yet undelivered, I regret. Well, that would have looked like bribery, wouldn't it?

Sub Set was a viciously competitive environment, a forum for developers throughout the UK and beyond, where regular challenges were posted, and we raced to submit the fastest or shortest solution, or to improve on an earlier one. Having one byte trimmed, one clock cycle shaved, from your code - this could mean utter, instant, humiliation.

Naming Isn't Everything

Once I complained to David about his choice of a variable name. His response was the most beautiful utility routine I have ever seen for any processor. It was for the 6502, a device severely impoverished in terms both of instruction set, and of memory addressing modes. It virtually rewrote the silicon. What it did was to expose full leverage of an obscure debug mode "Break" instruction, transparently to add (1) streamlined interrupt processing, and (2) a brand new, unbelievably useful, relative address mode "Call" pseudo-instruction. Not content to name his routine BIRCH (for Break, Interrupt & Relative Call Handler), David went on to supply five-letter tree names, each somehow meaningful, for every label in that code.

Century Communications eventually published their Best of PCW: Assembler Routines for the 6502, and the companion volume for the Z80, in book form. For a little while, I knew the pleasure of getting regular royalty cheques through the post, thanks to machine code subroutines... that I'd already been paid for!

Again, thank you PCW. I'm still pleasantly surprised even today, when surfing for fruit scone recipes, to chance upon namechecks and acknowledgements in projects like MAMEs and homebrew emulators (although "Contains the John Kerr disassembler" nearly scared the shine off of me, first time I saw it).

Coda

Like type-in listings of text-only adventures, Sub Set was discontinued some years ago. Since then, machine code has actually remained surprisingly manageable on a human scale, partly due to the emergence of RISC and the ARM, P-Code, and now MSIL and the Jitter; but the quantity has changed, and all the short essential jobs have been done and documented. Much of what we did back then, is now performed in multicore cathedrals of silicon, and even embedded systems developers have any number of compilers to choose from.

For a lot of hobbyists, the demise of PCW Sub Set was one sign of maturity in the industry, similar to the emergence of the standards-defining IBM PC and its Microsoft operating system, begetter of many clones, that signalled time to move on to something more interesting. Leaving the machines, and their league of magazines, to continue a headlong rush into their demarcated business and gaming arenas. And their ultimate obsolescence.

1 comment:

  1. I often wonder what became of David Barrow after the demise of Subset ...

    ReplyDelete