Skip to main content

The Demon Machine

Over the weekend I was reunited with the first two computers I spent extensive time programming. The Sharp MZ-80K (released in 1979) and the BBC Micro Model B (released in 1982).

Here's the BBC Micro:

with the top off you can spot that I've added my own headphone socket at the back and that this machine was upgraded with the speech synthesis module.

And I had the ROM slots maxed out with Basic II, Caretaker, and Acornsoft LISP.

And here's the Sharp MZ-80K:


Both work fine, but I was struck by my reaction to the machines. I wanted to boot them up and get programming. A little voice in each machine was speaking to me about all the unchartered lands of programs that could be written in just kilobytes of RAM. Of all the possibilities, tucked away in the Acorn MOS and the Sharp's memory.

It's the same little voice that still drives me on to write just another line of code, to perfect just another little routine. Just the other night I was dragging myself at midnight but unable to turn in until I'd got the proportional font working on this homebrew display I'm working on:



Truly, that inner voice is demonic. The seductive world inside a computer (so well captured in 1982's Tron) draws you in with just one more possibility, just a little more time. The demon voice asks that you keep going when physical strength is gone, when you know that tomorrow will come and tiredness will ruin your day. But right now, right then, the power of the machine, the power over the machine, matters more than anything.

And yet the computer is a harsh mistress. If it fails to do what you want it's because you failed. It is merely deterministic; you didn't correctly tell it what to do. As Maurice Wilkes poignantly puts it of the early days of computing:
As soon as we started programming, we found to our surprise that it wasn't as easy to get programs right as we had thought. Debugging had to be discovered. I can remember the exact instant when I realized that a large part of my life from then on was going to be spent in finding mistakes in my own programs.
The human/machine relationship is abusive. The computer tempts you with its power and possibility, then punishes you with your own failings, your own inept attempts at programming it, your own lack of knowledge. And yet you love it.

As ever Richard Feynman can be relied upon to capture the disease of computing:
“Well, Mr. Frankel, who started this program, began to suffer from the computer disease that anybody who works with computers now knows about. It's a very serious disease and it interferes completely with the work. The trouble with computers is you *play* with them. They are so wonderful. You have these switches - if it's an even number you do this, if it's an odd number you do that - and pretty soon you can do more and more elaborate things if you are clever enough, on one machine.

After a while the whole system broke down. Frankel wasn't paying any attention; he wasn't supervising anybody. The system was going very, very slowly - while he was sitting in a room figuring out how to make one tabulator automatically print arc-tangent X, and then it would start and it would print columns and then bitsi, bitsi, bitsi, and calculate the arc-tangent automatically by integrating as it went along and make a whole table in one operation.

Absolutely useless. We *had* tables of arc-tangents. But if you've ever worked with computers, you understand the disease - the *delight* in being able to see how much you can do. But he got the disease for the first time, the poor fellow who invented the thing.”
And so dear BBC Micro and Sharp MZ-80K you shall remain powered off (or at least that's what I'll tell everyone and I'll secretly fire up that LISP ROM when no one's looking and just write a little program, just one.)

Henry Kissinger has famously said that power is better than sex. Well, clearly he isn't a programmer!

PS Does anyone have a copy of the manual for the Caretaker ROM? Purely, for completeness; clearly I'm not going to actually need it :-)

Comments

Ruben Berenguel said…
When I got to the main point in your post I thought "hah! Like Feynman said!". And then you quote Feynman :) Everyone who has been biten by the programming bug knows the feeling. Start and never end, and repeat the cycle endlessly.

Ruben @mostlymaths.net
Anonymous said…
I know this feeling well. It is definitely an addiction. Strangely, though, people will pay you to engage in it! The other night a catchy phrase occurred to me: After midnight, I collapsed into bed exhausted but happy, having successfully sought and achieved Computational Consummation.
KBR said…
Ah shit. I found an old TI computer that's older than I am and my first reaction was, "I need to get the RF modulator so I can hook this thing up to a TV and get hackin'".

I wouldn't have any idea where to even start, but I know I'd get sucked in.

Yeah, that evil little silver box lives in the storage unit now.
Michael Gruen said…
Wow... so TRUE ! :-) I still have my Zilog Z-80 from 1982, with wires all hanging out from a phone dialer... and a notebook with tens of pages of handwritten assembly code... Ha ha almost 30 years later now... and seriously, the play aspect to this day requires deliberate self-control... thanks for the article.
Dan Sutton said…
Yes! Yes! That's right! Ah... this takes me back to the good old days, when everyone programmed in machine code and lived in the forest... and nobody lived anywhere else...
Mark Agius said…
Plug in to the mains, turn on 'beep' and you can start using it,
unlike modern computers that take ages to turn on.
I'm sure BBC micros can crash, but I can't remember mine ever crashing.
The only computer that knows how to spell the word colour.
Richard Langner said…
My business still runs on a BBC micro!

Way back in the 80s I wrote an accounting program (in a 16k ROM), and I still use it today to make a living as an accountant.

There is still nothing like it that runs on a PC.

I wrote the program in 6502 assembler, and it assembled into sideways RAM, which occupies the same address space as the BASIC ROM.

The program finished up as a relational database, with data compression (and decompression on-the-fly) and I used my own version of virtual memory to assemble the code which was in 13 parts as it would not all fit into ram at the same time.

The BBC's RS485 connects nicely with the RS232 on the PC so I can publish the results in MS Word.

The good old days!
@Richard

That's a wonderful story. Do you have a web site write up of what you are doing? I'd love to see pictures of your set up. Sounds brilliant.

John.
frilijibican said…
I still have the punched cards for an eternal calender program run on the Illiac IV in Urbana Illinois - The creator of "Hal" in "2001 A Space Odyssey"

Popular posts from this blog

Your last name contains invalid characters

My last name is "Graham-Cumming". But here's a typical form response when I enter it:


Does the web site have any idea how rude it is to claim that my last name contains invalid characters? Clearly not. What they actually meant is: our web site will not accept that hyphen in your last name. But do they say that? No, of course not. They decide to shove in my face the claim that there's something wrong with my name.

There's nothing wrong with my name, just as there's nothing wrong with someone whose first name is Jean-Marie, or someone whose last name is O'Reilly.

What is wrong is that way this is being handled. If the system can't cope with non-letters and spaces it needs to say that. How about the following error message:

Our system is unable to process last names that contain non-letters, please replace them with spaces.

Don't blame me for having a last name that your system doesn't like, whose fault is that? Saying "Your last name …

Importing an existing SSL key/certificate pair into a Java keystore

I'm writing this blog post in case anyone else has to Google that. In Java 6 keytool has been improved so that it now becomes possible to import an existing key and certificate (say one you generated outside of the Java world) into a keystore.

You need: Java 6 and openssl.

1. Suppose you have a certificate and key in PEM format. The key is named host.key and the certificate host.crt.

2. The first step is to convert them into a single PKCS12 file using the command: openssl pkcs12 -export -in host.crt -inkey host.key > host.p12. You will be asked for various passwords (the password to access the key (if set) and then the password for the PKCS12 file being created).

3. Then import the PKCS12 file into a keystore using the command: keytool -importkeystore -srckeystore host.p12 -destkeystore host.jks -srcstoretype pkcs12. You now have a keystore named host.jks containing the certificate/key you need.

For the sake of completeness here's the output of a full session I performe…

More fun with toys: the Ikea LILLABO Train Set

As further proof of my unsuitability to be a child minder (see previous post) I found myself playing with an Ikea LILLABO 20-piece basic set train.


The train set has 16 pieces of track (12 curves, two straight pieces and a two part bridge) and 4 pieces of train. What I wondered was... how many possible looping train tracks can be made using all 16 pieces?

The answer is... 9. Here's a picture of the 9 different layouts.


The picture was generated using a little program written in Processing. The bridge is red, the straight pieces are green and the curves are blue or magenta depending on whether they are oriented clockwise or anticlockwise. The curved pieces can be oriented in either way.

To generate those layouts I wrote a small program which runs through all the possible layouts and determines which form a loop. The program eliminates duplicate layouts (such as those that are mirror images of each other).

It outputs a list of instructions for building loops. These instructions con…