The Baby Emulator

The Manchester Small-Scale Experimental Machine (SSEM) aka: "the Baby" lay the foundations for all modern computing, being the first stored-program computer, and built to demonstrate the viability of the Williams-Kilburn tube.

Despite being a breakthrough computer during its lifetime, it had a very limited instruction set and store. Presenting only 32 words of memory (that's 1024 bits) to store both program & data and only 7 instructions to program in, it was still Turing complete and ran its first program on June 21, 1948.

Seeing it as a valuable history lesson (and because the other emulator, a Java applet, is very cumbersome to use), I decided to write a nice (and fast) emulator that can be used from the command line. And here it is:

# It's on Github, of course:
$ gobaby -t -l 27 -p=f examples/factor.asm
Execution took: 14.160445ms
Value at location #27: 131072

This trivial program (finding the largest factor of 2^18, by going through each number down, starting with 2^18-1) was the first to be run on the Baby and it took ~52 minutes to get the answer back then.

The emulator also supports printing out the memory contents as their equivalent assembly mnemonics (which is the default behaviour after execution), which makes it particularly useful when having to keep re-running programs, like this sucessive prime generator:

$ gobaby examples/primegen.asm | gobaby | gobaby -l 21 -p=f
Value at location #21: 5

Running this will give you the 3rd prime, and for all the ones following that, you've just got to keep on adding successive calls to gobaby.

So that's all there is to say about the emulator, to find out more about the Baby you should read David Sharp's Technical Introduction To Programming The Baby and of course its Wikipedia article.

Share and enjoy!