Mark 1 version 0.1   

This page is an offshoot of JsSSEM, my Manchester SSEM emulator. Just like Williams, Kilburn, etc., I am cannibalizing bits of the SSEM into what I hope will eventually be a more powerful and more generally usable machine. You are explicitly warned that the result does not currently—and may never—correspond to any specific computer that existed in Manchester in 1949 or at any other time. In some respects it is more primitive and SSEM-like than anything called the Mark 1 ever was: it has no multiply instruction, no double-length accumulator, no magnetic drum memory, etc. It does have a ‘B‑line’ or address modification register, which the SSEM did not; but it only has one, and the behaviour has been simplified. The bulk of the order code is taken straight from the Manchester Mark 1 in its early phase. But it has the later machine’s expanded store capacity of 10,240 binary digits (1¼ kilobytes in today’s terms), and the odd subsequent addition has been incorporated as well: the random number generator did not appear until the Ferranti Mark I of 1951. I hope you will find it interesting all the same; but if you would prefer a program that is reasonably stable, has proper documentation, and at least tries to be moderately historically authentic, you may do better to stick with JsSSEM.

Like JsSSEM, this page uses Courier Prime Code, a font designed by Alan Dague-Greene that can be downloaded from here.

Edmund Griffiths, 2019

Order code

The store is divided into 256 long lines of forty binary digits, each of which can hold either (a) a number in the range from -549,755,813,888 to 549,755,813,887 inclusive or (b) two instructions. The first two teleprint characters (ten digits) of an instruction give a store address for the operand, if any; the third character is always / and is ignored; and the fourth is the function symbol itself. For example, ://H is decoded as A’ = S(:/) and causes the accumulator to be loaded with the forty-digit number held at store addresses 4 and 5 (assuming B = 0). Notice that addressing is by twenty-digit short line, even though numbers are stored across a full forty-digit long line: the operand address should therefore always be an even number in the range // to VK inclusive. Stated jump targets can be even or odd but need to be one before the target that is in fact wanted, because C (the control) is incremented after each instruction is executed rather than before. An asterisk (*) in the description of an instruction indicates that the actual operand address is obtained by adding B to the address named in the instruction itself; in this case, it is B + the stated address that needs to be a non-negative even number less than 512.

E Time waster No operation
@ B’ = S Load B
½ A’0..19 = R Randomize the twenty least significant digits of A
D S’ = A Store A*
R Test Skip next instruction if A is negative
N Stop
T A’ = A ∨ S Logical inclusive OR with A*
L C’ = S Unconditional jump to the address specified at the given store location (NB. not to that location itself)
W C’ = C + S Unconditional relative jump
H A’ = S Load A*
Y A’ = -S Unary minus*
P A’ = 2S Shift left (in our terms; physically right)*
Q A’ = 0 Clear A
M A’ = A + S Add to A*
X A’ = A - S Subtract from A*
V A’ = A ≢ S Logical exclusive OR with A*
£ A’ = A ∧ S Logical AND with A*

Teleprint encoding

  0 /   1 E   2 @   3 A   4 :   5 S   6 I   7 U
8 ½ 9 D 10 R 11 J 12 N 13 F 14 C 15 K
16 T 17 Z 18 L 19 W 20 H 21 Y 22 P 23 Q
24 O 25 B 26 G 27 " 28 M 29 X 30 V 31 £
The emulator accepts ; and ! as alternatives for ½ and £ respectively. Anything inside (non-nested) curly brackets {} is treated as a comment; teleprint characters are not case-sensitive. Whitespace is ignored. For your convenience, a simple decimal-to-teleprint converter is provided here.

Getting started

The program is intended above all for use with smartphones, although it may well work on other types of device too. Users of iOS or Android can save it to the home screen and run it as though it were an installed app. (If you aren’t sure how to do that, consult online help pages for your particular operating system.) If you want to program the emulator yourself, the best way is probably to begin with a completely simple program like
  { :/ } @///////
  { I/ } A///////
This doesn’t do anything: it just consists of three time wasters and a stop order, with the number 2 in store(:/) and 3 in store(I/). But you can try replacing the time wasters with load, store, add, subtract, XOR, randomize, etc., to get the hang of the order code and the emulator’s user interface, and it shouldn’t be too long before you are ready to program independently. Two sample programs are also provided. ‘Fibonacci 57’ is quite straightforward; the other, ‘Qui habet intellectum computet numerum,’ is slightly more involved and in fact could perhaps have been written more tidily. Both are supplied with pseudocode translations to clarify how they work. Click one of the buttons at the foot of the screen and your chosen program will appear in the Source box at the top—which is also, of course, where you can type or paste your own programs. Use Read program into store to reset the registers and load the program, then Single instruction to step through it or Run program to run straight through. The contents of the store are displayed graphically and also symbolically (in the scrollable listing to the right). You can watch two Williams tubes—2,560 binary digits, 128 addresses—of the store at a time: use the buttons directly above the store to choose. Everything else should be reasonably self-explanatory, if it works at all. One final point: Turing, writing in 1950, estimated that he could produce ‘a thousand digits of programme’ for the Manchester Mark 1 in a working day. Now a thousand digits is fifty machine instructions. Unless you are a much better programmer than A. M. Turing, you should not expect to be able to get even small Mark 1 programs working without putting in a certain amount of time and effort.



Primality by trial division


A = B = C =