The Autocodes: Sirius to IMP, a User's Perspective


When digital computers were first invented, programming them was literally a matter of rewiring, see, e.g. [1]

When the idea of storing programs as numbers in the same type of store that was used for calculated quantities was developed, programming became very much easier. However, the programmer was still working at the basic level of the machine, and had to provide his instructions in the form of numeric codes, each of which performed a very rudimentary operation

The Ferranti Manchester Mark 1, operational from about 1949, was the first British general purpose computer, and had at first to be programmed in this way. However, RA Brooker, around 1953, developed the first (fairly) high level language, Manchester Autocode, which he described [2,3] in 1955/6.

In the USA, between 1954 and 1957, JW Backus and his coworkers at IBM developed Fortran, the first published version being issued in 1958 for the IBM 704. About the same time at IBM's competitors, Sperry Rand, Grace Hopper was developing a language called, sucessively, ARITH-Matic, MATH-MATIC and FLOW-MATIC. This became generally available for UNIVAC computers from about 1958. Grace Hopper subsequently returned to the US Navy where she further developed the language as COBOL. She retired with the rank of Rear Admiral in 1986, and acted as a consultant to DEC. See [4] and [5] fora a details of the chronology.

My personal interest lies with the autocodes, since I first learnt to program in what was essentially Brooker's original language, and spent most of the rest of my career with its descendants. Occasional forays into Fortran were necessary in order to communicate with the rest of the world, but this was avoided whenever possible. Other aspects of my work involved the programming of `small' computers such as the PDP-8 and later microprocessors. I will talk about these elsewhere.

The Early Autocodes

Manchester, Pegasus and Sirius Autocode

I was was ten years old at the time Tony Brooker was inventing Autocode for the Mark 1. However, it was the language that I learned in my first programming course in the autumn of 1964. This was because essentially the same autocode was used on the Ferranti Pegasus and Sirius computers, with little added sophistication.

At the time, the Department Chemical Technology of Edinburgh University shared premises and final year teaching with what was then Heriot-Watt College, soon to become a university. In their basement in Chamber's Street, Heriot-Watt had a Sirius; this was one computer more than Edinburgh University had at the time.

Unfortunately I don't have any of the programs I wrote that year, one to process data from my final year experimental project, and one to design a reactor for my process design project.

However, I did locate two programs written by a classmate, Stuart Stong. I have a scanned and a retyped version of this. I hope to have `Virtual Sirius Autocode machine' in due course to run the latter and also the other program. The programs are for a `flash' and a distillation calcualtion, two of the classic computaional problems in chemical engineering. Here is part of it:


n20 = TAPE
v213 = TAPE
v240 = TAPE n20
v140 = TAPE n2
v3 = 0
n0 = 4
n1 = 0
v0 = 4
43) v215 = v0 + 1
v215 = v213 / v215
v218 = v213 - v215
n1 = 0
42) v(20+n1) = v(240+n1) x v213
n1 = n1 + 1
-> 42, n1 # 0

A brief word on the language, referring to the section of program above. There were two kinds of variables. real variables were called v1, v2, v3 ... up to wherever memory ran out, which depended on how big the program was. The most complicated assignment allowed was of the form:

vNNN = -vMMM @ vLLL
where @ was one of the operators: +, -, \, x (multiply), and vNNN etc was a variable name, or on the right hand side, a positive constant. The standard functions were available, eg:
v23 = SIN v14

Additionally there was a fixed number, by default 28, of integer variables called indices, denoted by n1, n2, etc. As the name suggests these were primarily intended to index the v variables to provide an array facility. One could write:

v100 or vn10 or v(3+vn10) or v(-3+vn10)
but not:

v(3-n10) or v(n10+1)

The same type of limited arithmetic expressions could be written for indices as for variables, the two types of variables could be copied into each other, but mixed expressions were not allowed.

The only control facilities were labels and jumps. The jump was allowed to depend on a simple condition, either greater than, greater than or equal to, equal to, not equal to or approximately equal to, the last to a precision which the programmer could define.

The TAPE function read numbers from the paper tape input device, TEXT copied the subsequent lines until more instructions were detected, and there was a print instruction such as:

PRINT v10, 4023
The 4 digit number, rather cryptically, defined the printed number's format.

Programs were prepared on a 5 track paper tape using a teleprinter machine (a Creed 7b, as I recall) with a rather odd character set. The v and n letters were in fact italic and occured amongst the digits and punctuation symbols on the keyboard. The other special symbols included the multiplication sign which looked rather like a Greek `chi' as the v symbol actually looked more like a `nu'. There seems to lave been a liking for Greek letters at this time, because `phi' and sometimes `psi' appeared on Mercury autocode teleprinters.

All of these autocodes were interpreted. The first instruction punched on the five-track tape was `Jv1', a machine code jump to the start of the autocode interpreter.

Mercury and KDF Autocodes

Mercury was was developed at the same time as Pegasus, but with a quite different design philosphy. It was much larger. Pegasus had 48 (yes forty eight, no ``k' or `M' ommitted!) `fast' (126 µs access, typical instructions 300µs) nickel delay line memory locations of 42 bits and 5120 in magnetic drums (about 8 ms). Mercury had a whopping 2k of 20 bit words of the new-fangled magnetic core memory which gave typical instruction times of 60µs, and 32k of 8ms drum memory. It also had floating point hardware. Mercury was the production version of the Manchester mark 2, while Pegasus was an in-house Ferranti project to develop a `quantity production' computer, the first to make use of plug-in cards. [9]

Mercury Autocode, also developed by Brooker is descibed in [6] and [7]. This was the first British compiler, as opposed to an interpreter. (It may have been the very first compiler ever; although FORTRAN was proposed in 1954, the actual compiler did not appear until 1957.) The form of expressions, in particular, was more sophisticated, but was constrained by the limited character set on 5-track paper tape. The original language was not syntax-based, although Brooker susequently [8] defined it in the notation which Backus and Naur were developing at about this time.

I never actually had to write in Mercury autocode, but here is a scanned program from [6]. Those familiar with Atlas Autocode or Imp will see here the orins of the cycle..repeat construction, as well as the output instructions.

The two variable names of the earlier autocode were expanded to a-h and u-z for reals, and i-t for indices. The Greek symbol `pi' was also on the keyboard and could be used as a variable name. The single letter name could be follewed by a prime, so that a', b', etc were also variables (this convention also descended to Atlas). All of these were scalar, unsubscripted variables. Distinct sets of subscripted variables were declared by an instruction such as:

v' -> 180
which defined an array v'(0) to v'(180).

The expression syntax takes a certain amount of getting used to. There was no multiply symbol.

nx would nowadays be written n*x . xn meant x(n) and could have been written that way.

vxnny3 quite unambiguously (when you think about it!) meant v*x(n)*n*y(3)

Writing a compiler for Mercury must have been a significant challenge. The machine instruction set and adressing system was complicated as well as limited in power. There were minimal facilities for integer operations, this being primarily a floating point machine, and no character operations. There was not even a specific subroutine jump instruction; the user had to use the following:

(calling sequence)
101 2*          (put current address *, + 2 words, in register B1)
590 v1          (unconditional jump to subroutine at label 1)
.               (come back to here)
(subroutine labelled 1)
011 0+v10 (1    (save B1 in address part of instruction at label 10)
(subroutine code)
590 0     (10  (label 10, return unconditional jump with dummy address)

Here is part of a Mercury program written by Harry Whitfield to plot contours on a printer.

chapter 1



The complete program is here.

Atlas Autocode programmers will notice the origins of the cycle..repeat construct as well as similarity of input-output instructions. The all numeric instructions are embedded machine code. The language appears to have offered no text printing facilities, and so the three `620' instructions punch the codes for Letter shift, character `C' and Figure shift.

KDF-9 K-Autocode

The English Electric KDF9 was one of the most interesting computers ever built. Its designers invented many of the features which are current today: the byte (which was called a `syllable', multiple length instructions, the hardware stack or nesting store, and its use as a recursive subroutine jump facility. On the software side its `usercode' may well have been the first symbolic assembler, as opposed to requiring numerical instruction codes as in the above example, and it may have been the first computer to implement the Algol language, see below.

K-Autocode was originally developed by ICI as a means of running its large number of Mercury autocode programs on KDF-9. The first version in 1964 was simply Mercury autocode typed on 8-track tape using the KDF-9 character set, but subsequent versions added many features of Atlas Autocode and indeed others, such as string handling, which were not in that language [10]. ICI continued to use the language for many years, producing a compiler for the IBM 360.

For most programmers, the main improvement was the ability to use brackets in arithmetic expressions. However, these had to be square brackets to distinguish them from subscript and function brackets. This suggests that early versions of the compiler were not syntax based, although I believe that later versions were.

Here is a scan of the main `chapter', essentially the main program segment, of a significantly complicated multicomponent distillation program written by Roger Fletcher for ICI.

Atlas Autocode and the Algol Connection

(To be continued.)

Imp - the Ultimate Refinement

(To be continued.)

The Autocode Today


[1] M.R. Williams, `A History of Computer Technology', IEEE Computer Society press, 1997

[2] R.A. Brooker, `The programming strategy used with the Manchester University mark 1 computer', Proc IEE, 103B Supp, 151-157, 1956

[3] Brooker, R "An attempt to simplify coding for the Manchester electronic computer" pp307-311 in British Journal of Applied Physics 6 (1955)

[4] In Wikipedia at:

[5] In `Encyclopedia of Computer languages' at:

[6] Brooker, R.A. "The Autocode Programs Developed for the Manchester University Computer", The Computer Journal 1(1) 1958

[7] RA Brooker, B Richards, E Berg, RH Kerr, `Mercury Autocode Manual', CS 242A, Ferranti Ltd, 2nd ed 1961

[8] Brooker, R. A. and Morris, D., "A Description Of MERCURY Autocode in Terms of a Phrase Structure Language", pp29-67 in Goodman, Richard (ed) "Annual Review in Automatic Programming" (2) 1961 Pergamon Press, Oxford (1960)

[9] Elliot WS, CE Owen, CH Devonald, and BG Maudsley, `The design philosophy of Pegasus, a quantity production computer', University mark 1 computer', Proc IEE, 103B Supp, 188-196, 1956

[10] A Gibbons, 'K Autocode', Computer Journal, 11, 2, 160-168, 1968 [11] A. Gibbons, "Running Pegasus Autocode Programs on Mercury", Computer Journal 3 , 4, 232-236, (1961) [12] [13] Naur, P. (ed.) Report on the algorithmic language ALGOL 60 Comm. A.C.M. 3, 5 (May 1960) 299-314.