7 years, 2 months ago

CEGMON – a blast from the past

Link: http://weblog.tetradian.com/2014/03/16/cegmon-a-blast-from-the-past/

You can blame Phil Beauvoir for this one. :-)

A few days back, the grand-master of the justly-famed Archi Open-Source toolset for Archimate (version 2.7 just released, by the way) put out a tweet that, in essence, said that his earliest experiences of programming went back to the Sinclair ZX-81, first released in 1981. Which sent me off on a kind of Wikipedia-trail through old memories…

My own programming experience perhaps goes back a few years further: my first microcomputer – if it can be called that – was the Acorn-1, with its 25-key keypad, 8-LED display, and – gasp! – 256-byte memory. (Not 256Mb – these days considered pathetically small even for a phone – nor 256Kb – considered somewhat limited for a micro even by the mid-1980s – but just plain 256-bytes. And yet one could do quite a bit even with that. In those days, anyway.)

The reason I’d got involved – apart from being fascinated by all things computing-ish for decades anyway – was that we’d recently bought a photototypesetting machine. Which was ludicrously underutilised: it could typeset far faster than an operator could type. If we were going to get a decent return from that very expensive machine (I’m not joking when I say that it cost more than my house), we would need to have more input. But it ran on paper-tape, and the only add-on terminal available was a blind (no-display) paper-tape punch that cost literally ten times as much as even the upper end of the hobbyist computers coming onto the market at that time. And yet the typesetting-machine itself was all electronic; the interfaces were all electronic; there had to be some way to link it to a relatively-cheap external micro (with display) rather than only to an antiquated and hugely-overpriced paper-tape punch (without display).

The Acorn-1 was enough to demonstrate that the idea was feasible, but nothing more than that. At the very least, we’d need something that had a decent keyboard and display – a lot better than, say, that of the original Commodore PET, let alone the Acorn’s. After some hunting around, we settled on the Ohio Scientific Challenger 2 – though in our case initially without the (then) ruinously-expensive disk-drives:

Nice machine, very nice keyboard: it worked really well. After not all that much tinkering, and some help from a friendly electronics engineer, we got it patched-in to the typesetter, using a simple lookup-table to do the code-translation between character-sets. All a bit wobbly and experimental, but that worked well enough, too. So much so that we were soon hankering for more.

There’s another whole stream to this story that I won’t go into here, that ultimately led to my/our work on the first true precursor to present-day desktop-publishing, way back before even the Macintosh itself existed. (By 1982 or thereabouts we were able to typeset a reasonable-sized book from WordStar files in less than an hour, and even typeset crossword-puzzles, too – and yeah, we paid the usual penalty for being way ahead of our time on that… Oh well…) But perhaps the key point was that in those days, anything non-trivial on micros was all in assembly-language – which is where CEGMON comes into the picture.

The whole Ohio Scientific community loved their machines – especially the cheaper single-board Superboard and its UK-101 clone – but almost all of us bitched about the inadequacy of the SYSMON ‘monitor’, the boot-program and its very limited machine-code viewer and editor. Eventually, Dave Graham at Mutek – the main UK dealer for Ohio Scientific – decided to do something about it. He called on me, and two sound-engineers – George Chkiantz (inventor of the phasing sound-effect, first used to great effect in the Small Faces’ hit ‘Itchykoo Park‘) and Richard Elen (later best-known for his work on sound-field recording) – and commissioned us to write a better monitor.

The original was tiny. Despite the Wikipedia description, it was not 2Kb, but only 1Kb – and of that, some 256bytes were the boot-code for the disk-drive, of which we could make no sense at all, so had to leave it exactly intact. Dave Graham had shown, though, that the board would support a 2Kb EPROM chip: so 2Kb – less that incomprehensible disk-boot code – was the (huge!) space that we had to play with.

And as the Wikipedia entry says, we packed a lot into that space:

at least two third-party companies produced their own version of the OS. One version was called ‘CEGMON’, the other was ‘WEMON’ produced by Watford Electronics in the UK. Both featured full screen editing (almost identical to the commodore PET), named cassette file handling (like the PET) and a greatly improved machine code monitor (also very similar to the Commodore PET).

It may ultimately have seemed similar to the PET: I have no idea. What I do know is that we didn’t look at the PET at all, but instead went right back to first-principles, concentrating only on what we wanted in that monitor. For example, we put in a dual-cursor editor – later replicated in concept if not in code in Acorn’s very popular BBC Micro – and a full windowing display that allowed the programmer to set and write to subsets of the screen-area. I think we managed to squeeze in a rudimentary disassembler to show machine-code as assembly-language, but I’m not sure of that. We kept on squeezing, trimming, adding new features, until eventually there was nothing more we could do. We still had three bytes of space left over, so in effect we signed our work, putting in our surname-initials as the three-byte hex-string #434547 – ‘CEG‘, for Chkiantz, Elen and Graves. That EPROM was what Dave Graham sold as CEGMON – again, our surname-initials, and then ‘MON’ for ‘monitor’.

We didn’t make much money out of it, of course – certainly not enough to cover the enormous cost in time and effort that went into our making it. But in its own way it was a real achievement – something in itself, we might say – and, for me, definitely helped with laying down the disciplines that I’d need when I moved on to the much larger and much more complex software-development (all assembly-language, again) for the later work on desktop-publishing.

One reason we didn’t make much money was that we soon had competitors – other monitor-EPROMs for the Superboard and suchlike. For our amusement, we decided to disassemble one of them – it might have been WEMON, as per Wikipedia, but I really can’t remember now, and it’s probably best not to say anyway – and we got quite a shock. There were a handful of additional features, to be sure, but all of those were squeezed into the 256-byte space made available by discarding the disk-boot code. The rest of it – all of the rest of it – was our CEGMON: an exact byte-for-byte copy, in fact, including that #434547 ’CEG‘ signature-string – a real giveaway! We complained about it, loudly, and publicly, but there was nothing we could do – such were the joyous business-practices of the time…

But there it is: CEGMON – my one-and-only Wikipedia claim to fame!

Okay, to be precise, only the letter ‘G’ in that name.

And even that only as a kind of secondhand-aside in someone else’s Wikipedia page.

But hey, at least someone remembers some of what we did back then! :-)

The rest, as they say, is history. Mostly-forgotten history, by now, but history nonetheless.

Blast-from-the-past indeed… Thanks, Phil!