Friday, 7 March 2014

When Computing Was Exciting (and may become again)

This is  how my addiction to computing in general, and software engineering in particular, developed.

Hewlett-Packard HP-25

This was the very first programmable I ever put my hands on and at the tender age of thirteen. Glorious numeric only red LED display, 49 programming steps, rechargeable battery -- but no constant memory. It belonged to my father, or rather the scientific institution he worked for obtained one for him, but he was kind enough to let me use it in his spare time. Interestingly, my father never really used it as more than a powerful calculator. I had to learn about the programming it all on my own. Luckily HP at the time provided manuals of the quality and breadth not often seen since.

As for how fun it was to use, if you powered the thing off, every single time you wanted to run a program you had to punch it in again. Also, the display only ever showed command codes, not immediately human readable. However, in their magnanimity, HP decided to make codes relate to the position of the key used to punch them in so you could in fact "read" your program off the screen. One instruction at a time, of course. Still, I am still amazed at how useful and complex programs (I almost said applications) could have been written -- even by a thirteen year old.

I forgot most of what I wrote back then (even though that notebook must still be somewhere in my parents' "archives"), but I do remember using some simple aerodynamic equations from a fluid dynamics textbook to write a reasonably usable and fun "airplane" simulator. It was, in matter of fact, more like a disembodied wing profile simulator, but at least it seemed to obey "thrust" and "brake" commands in generally not-too-unrealistic manner. It actually was fun trying to take of, reach a desired altitude, and then land. Yes, the only output were speed and altitude being flashed at you between each discreet step of modifying thrust/brake, but for an eager thriteen year old with just enough imagination it was quite enough.

For much more information on HP-25 go see The Museum of HP Calculators.

Casio PB-100

Having caught the programming bug with the HP-25 I soon developed a veritable fever to learn more about the stuff. To that end I managed to get my hands on an introductory textbook on BASIC, then the language of choice for beginners. It didn't even describe any particular flavour of BASIC. Rather, it presented and "idealised" BASIC interpreter which borrowed bits and bobs from all over the place. Quite a useful concept in fact, considering at the time most people didn't actually have access to a real computer. Having goen through the thing probably at least three times I was ready for the real thing.

Luckily, my parents either didn't quite realise the depths of my addiction, chose to ignore it, or quite far-sightedly decided it will all turn out for the good in the end. So, without me having to do very much of prodding, begging, or even vacuuming, they agreed to furnish me with the entry level BASIC pocket computer, the above pictured Casio PB-100.

With more foresight -- or just dumb luck -- they went and got a memory expansion OR-1 for it, too. Which was all for the good as the poor thing would have been next to unusable without one. I mean, even without it you only got 1568 bytes (yes, bytes) of memory for you programs, and you had to share that with the data if you wanted to use more than the 26 pre-assigned variables (the clever thing about these was they were either used as A, B, ..., Z, or as arrays where A(0) was A, A(1) was B, and so on, plus, C(0) was C -- or A(2), and so on).

Anyway, much fun ensued and notebooks filled in with BASIC programs. Notebooks, because while there was a cassette tape/printer port on the thing, I was never able to make a good case for actually getting one, and any serious editing on the 12 character LCD was limited, and that's a serious understatement. So, pen and paper have become the main way of software development for me and that has never really disappeared. Even today I find that jotting down pseudo-code on a piece of paper helps focus the mind to no end.

Again, I can't remember much of what I developed, but one things seems to have stuck in mind: Having just started university, I remember I developed a very simple circuit simulation program. It could only work with passive elements (RLC, as it were), and it was modelled a bit after then-popular big software package SPICE. It was simple, almost just a proof of concept, but it worked. In 1568 bytes of memory and with a 12 character display. I also remember later updating and augmenting it to be able to handle transistors, and diodes as well, but that was on a Sharp PC-1403 (I think) which had vastly more memory and a significantly larger display. It also didn't belong to me, but to my then girlfriend, never a fiancee, but now wife of almost 15 years, and a mother of our beautiful 2 year old.

More information on the PB-100 can be found on the

ZX Spectrum

Oh, the Sinclair ZX Spectrum!

There probably never was, and almost certainly never will be, a computer I have awaited so eagerly (I had a calendar on my wall, crossing the days to its delivery), and which I had so much affection for. Nor will there ever be just such a kind of community, both very local to me, and very global, too. And I am not alone. Just have a little look around the inter-tubes and you will see that this is still very much a living machine. Best thing? I'm soon going to have a brand new one again, this time ready for the twenty-first century.

Anyway, renewed excitement to one side, this was where my addiction really, really, took off. Yes, I was also sucked into seemingly endless hours of gaming (Arcadia being one of the favourites), but this is probably where I also started diverging from the purely higher level language development (even though it gave me my first flavour of Pascal). Yes, ZX Spectrum BASIC was fun and powerful (no, it really was both), but there always seemed to be a few things that it just couldn't do.

For example, ZX Spectrum also marked the point where my family saw the whole enterprise as potentially really useful so we invested in a full fledged dot matrix printer (I think it was a Seikosha FX-800 or something, in any case it was Epson FX-80 compatible), together with the odd contraption it needed to talk to the Spectrum. While the thing would happily print text straight out of the box, the graphics were another matter altogether, and I wanted both graphs and screenshots. While the former could be obtained by tickling the BASIC just-so, the latter was a different matter altogether. What ensued was a dive into the deep end of Spectrum's architecture and Z80 assembly language, resulting -- eventually -- in a "memory resident" (to use the DOS jargon) little program which would garb -- and print! -- the screenshot in glorious 256x192 black and white graphics. It worked even for same games' opening titles, and was later improved to enable 2x and 4x zooming (and possibly some non-linear magnification, but my memory is too vague on that point).

This having been a happy-go-lucky ere of not too strict attitudes towards copying, I also developed another nifty assembler program to do the tape read/copy magic. It was nowhere near so feature packed as the best of class pirate tools of the time, but it did well what it was designed to do and, much more importantly, got me invaluable experience in bit fiddling and generally messing up with the OS innards. You can probably think of this and the printer "driver" as my first dip into embedded software engineering.

You can find more information about ZX Spectrum at the, aptly named, World of Spectrum.

Hewlett-Packard HP-15C

While I dearly love this calculator I didn't really get it with software development in mind. At the time I have just started studies of Electronics Engineering and HP-15C was a logical choice for someone facing shed-loads of equation laden science.

Still, I managed to have an awful lot of fun with the HP-15C, and, truth be told, did really fall in love with the whole series. I especially coveted the "programmer's" HP-16C -- I only managed to get my hands on it recently, when I started collecting. At home we also had an HP-11C banging around, used mostly by my mother in her biochemistry lab. The fact that she actually bothered to learn RPN to be able to use it is as much an endorsement as can be had for the Marmite of the calculation models.

In any case, I did manage to fill in two decent notebook worth of more or less useful, and more or less complex, programs for the HP-15C (some would even work on the 11C, too). I remember both games (a maze/dungeon style space adventure being one vague memory) and maths, physics, electrical problem solvers and helpers. I think I still know where these notebooks are and should really dust them off i ffor no other reason then to show how I could, at the time, write some actually legible handwriting.

More on the HP-15C at the The Museum of HP Calculators.

Hewelett Packard HP-6400 (for Motorola 6800/2)

The last of the machines here is neither small (let alone pocketable) and neither did I ever own it. However, I have used it in anger (and with some anger, too) on my very first job out of the university.

For those not familiar with the subject, this is a, so called, development station, where you use something not unlike a dedicated PC to develop software for microcontrollers found in various devices. You store your programs on floppy disks, and "burn" them into EEPROM chips using the kit that could be plugged in the back of the pictured system. I seem to remember "my" version had a burner to the right of the keyboard, but in any case we used "gang"-burners as we usually needed to program a few chips at a time.

Long story short, there was nothing glorious about this thing. It had a rudimentary -- and quirky -- environment (I hesitate to call it an OS), and you used the small green-on-black screen to edit assembler programs, compile, then flash them. This was also an emulator/debugger, but I remember that it wasn't good enough for our purposes (or our hardware design wasn't good enough for it) so the debugging meant burning an EEPROM, sticking it into the device, having a go, and then trying to figure out what went wrong. The device having a total of 16 alphanumeric characters as a display (four groups of four), and possibly a LED or three, putting "debugging" into the program was something of a challenge, especially seeing as it was all pure assembler and large enough to almost fill the whole memory, leaving little for optional extras (although I did manage to hide a tiny Easter egg there).

I also seem to remember it being possible to swap disks between the station and a PC, at least enabling you to edit in a more comfortable environment, but I also seem to remember it never quite worked and me deciding that doing everything on the HP 64000 was the way to go.

The high point: going to a top of a hill, secret location of a secret military relay station to insert a few dozen EEPROMs with new code into as many devices, plugging them all in, and seeing the system come alive. Baats lab testing I can tell thee!

The low point: on completion of the project, this being a military one, we had to print out the whole blinkin' 400+ pages of the assembly listing into a prescribed format -- and on not-very-heat resistant drafting paper -- and then having to sign each and every of those 400+ pages, myself as the developer, my project manager, and finally, our manager. It made for a very, very long day (or probably a couple of days, but at least the beer at the end of it was cold and plentiful -- as was the bonus, for that matter).

All this said, and despite the pain of the whole thing, fun was had, experience was gained, and my love for embedded software engineering was set in stone. The HP 64000 was the proverbial nail in the coffin of it, and once you're nailed into a coffin there's really no escape. Ever.

A bit about HP 64000 can be found here and here (the second page links to a PDF of the manual!).

The busy years

In what can be called the busy years I swapped some of the excitement described above for a more pedestrian day-to-day job of embedded software development. Not that it was not fun, and I did truly enjoy it, but it was a job, it paid the bills, and had to be planned at the future of some sort. I went through various projects, from taxi meters, through industrial protection and measurement, to protocol stack for mobile communications. It was in this last bit where I thought I might want to give software development a miss and try my hand at various kinds and levels of management. Looking back, this was partly because of a, mistaken, idea that one may end up earning more, and partly because, frankly, protocol stacks for mobile phones are, not necessarily boring, but they do get to grow old quite quickly.

The detox years

This a a period of several years where I haven't touched or seen any source code, at least not on the job. Not a single line. A sort of a wake up call (even if it did take me a few years to fully wake up) came when an eager teenager said "Wow! You work for Nokia R&D! What software tools are you using?" A bit embarrassingly my answer was "Outlook and Excel". Go figure.

Still, as I said, while the idea was born, the inertia and hopes of maybe jumping up one more level on the greasy pole kept me from actually doing anything about it apart from developing one or two mediocre (but still useful to me) PC applications. Not very much exciting for someone who used to eat, breathe, and dream bits, pins, and interrupts.

And then, an almost literal kick in the arse led to a new job, and...

The revival (or so I hope)

So, here I am again, with a couple of development boards on my desk, with exposed chips and pins, and LEDs blinking in patterns I set. There's also a gaggle of seemingly random cables, papers, and Post-It notes with cryptic things scribbled on them. And I have just finished the initial design and development of a tiny little new feature for some tiny little new (and old) chips. Who knows in a few months time you may have my ode running under your TV, in your earpiece, or even a mobile phone.

I'm back in business. Wish me fun!