The Elliott 803 had an excellent compiler for the then new ALGOL 60 programming language. ALGOL 60 was one of the first "block structured" languages and was hugely influential on just about everything that has come since. For more information on ALGOL 60 itself try Wikipedia http://en.wikipedia.org/wiki/ALGOL.
These notes contain the following sections:
The Elliott ALGOL compiler was an almost complete implementation of ALGOL 60, however there were a few limitations and some changes from the defined reference language. In no particular order:
... and several others Three particularly important (but slightly odd) substitutions are:
£(GB pound sign)
‘(open string quote)
’(close string quote)
As an example here's a simple program in the ALGOL reference notation and in the Elliott format:
|ALGOL reference language||Elliott Representation|
To run ALGOL programs on the Elliott 803 you must first load the ALGOL compiler. The compiler was supplied as two large reels of paper tape - tape 1 was the compiler itself and tape 2 was a set of run-time routines used by both the compiler and the executing program. Getting everything to fit in 8K of store was something of a miracle and large programs would often need to overwrite some of the compiler space when they ran, requiring the compiler tapes to be loaded again before the next program could be run. Loading, and particularly re-winding, those large reels of tape was a slow and rather tiresome process - this is something that is much quicker and simpler using the simulator!
Short programs, such as the included samples, were normally run in a "compile, load and go" mode. Once the compiler was loaded, a program source tape was put in the reader and compiled in-store, when compiled it was run and its output was printed to the output teletype. As long as the compiler was not overwritten, further programs could then be compiled and run without the need to reload the compiler tapes.
Use this sequence of operations to load the ALGOL compiler.
tapes/algoland is called
a104-1.tape(A104 was the name of the ALGOL library tapes).
tapes/algoland is called
At this point the system is ready to compile a program. It will be in the System Wait state with a high pitch tone coming from the speaker.
As an alternative to loading the two compiler tapes each time they are
required it is possible to either start the simulator using a machine image
parameter or use the Load... button on
the simulation control window to restore a machine image containing a pre-loaded
A pre-loaded compiler image can be found in
If the pre-loaded image is used you will need to execute a 40 7 instruction to begin compiling a new program.
When the compiler has been loaded it is ready to compile and run programs.
FREE STOREwill be printed.
The program is now in what is known as a Data Wait indicated by a two-tone siren sound coming from the speaker. If the program requires additional data tapes they should be loaded into the readers at this point.
END OF PROGRAMmessage will be produced on the teletype.
If all went well the system is now back in a System Wait (high pitch tone) ready to compile and run another program. You can repeat from step (1) above.
If things didn't quite go to plan you may need to press the Reset key on the operator console to get control back. You may then execute a jump (i.e. a 40 instruction to one of several locations to continue. The two most useful are probably:
If things go very wrong the simplest action is to Reset and to reload the whole ALGOL system starting again from Loading the Compiler.
For full details of the compiler (and there is a lot more detail) you can refer to Bill Purvis' scans of the 803 ALGOL Library Program A104 reference manual.
This is a very simple ALGOL "hello world" program. It just prints a short message to the output teletype.
The source code for this program uses only characters from the
standard Elliott telecode character set, so it looks exactly like a
genuine 803 ALGOL program, with the slight exception that it uses the
# (number sign) in place of the £ (GB pound sign), as the GB pound
sign can cause problems with PC character encodings.
Note that it is all in uppercase and has apostrophes (rather than semicolons)
as statement separators and uses the # and ? characters as string quotes.
PUNCH(3) command on the
This program prints out a table of sine and cosine values for some angles between 0 and 360 degrees.
The source code for the program makes use of the extended mapping from Java system characters to telecode characters provided by the simulator to provide better looking source code. In particular both upper- and lowercase characters can be used (though they are treated identically), semicolons can be used as statement separators (rather than apostrophes) and square brackets can be used for array subscripts. The code also uses the number sign (#) instead of the GB pound sign (£) for the open string quote, for easier use on non UK keyboards.
This program creates a array of small random integers then sorts them into ascending order using the recursive Quicksort algorithm.
The source code for the program also makes use of the extended mapping from Java system characters to telecode characters provided by the simulator to provide better looking source code.
A few comments on the code:
|Line 17:||This procedure declaration uses the somewhat odd and obscure
"long comma" that was unique to ALGOL 60.
In a procedure declaration or procedure call the sequence of characters
|Lines 21 and 57:||All labels have to be declared on a |
|Lines 28 and 29:||ALGOL 60 does not have a "while" loop as such, only a |
|Line 51:||A rather pointless function procedure definition, but it does demonstrate some aspects of the language, such as assigning the function result to the procedure name.|
|Line 53:||This statement reads two integer values from the tape reader.
The actual values to be read are appended to the source code tape after
the final |
|Line 60:||The |
|Lines 63 to 67:||These lines use the simulator's random number
device to generate some random numbers (between 0 and 511).
|Lines 80 and 81:||These are the data values for the program that are read by the
|Various places:||There are a number of semicolons before after some of the |
The QuickSort program is a particularly nice example, since the Quicksort algorithm was invented by Tony Hoare and it was the same Tony Hoare who was responsible for much of the implementation of the Elliott 803 ALGOL compiler.
This is a variation on the previous Quicksort program but it is coded using the exact algorithms originally published in the Communications of the ACM, Volume 4, Issue 7 from July 1961. These algorithms (number 63 "Partition" and number 64 "Quicksort" from page 321) were published as ALGOL 60 programs, so have simply been copied from the original journal (and re-formatted a little to help with readability).
In addtion this one is written using only Elliott telecode characters, so looks exactly as an original 803 ALGOL source program would look.
This program demonstrates a simple use of the graph plotter to draw approximate sine and cosine functions. The mechanism used to draw lines on the plotter is deliberately done in a very simple manner, but it seems perfectly adequate for this application.
ELLIOTT() statements are used to insert specific
machine code instructions to drive the plotter.
The plotter had paper that was 11 inches wide and a pen that could be
moved in steps of 1/100 inch in any of 8 directions using special machine
Raise the pen
Lower the pen
Move one step EAST
Move one step WEST
Move one step NORTH
Move one step SOUTH
Move one step NORTH-EAST
Move one step NORTH-WEST
Move one step SOUTH-EAST
Move one step SOUTH-WEST
The Elliott ALGOL compiler included a pre-compiled Plotter Package that would normally be used to drive the plotter. This provided a set of procedures that could be used to set the origin, scale output, draw lines and various other options - including directing the output of PRINT statements to the plotter to add text and labels to graphs. The sample program however does not use the plotter package, mostly because I simply can't remember exactly how it all worked!
Note that the plotFn() procedure in this sample exploits the ALGOL 60 parameter convention of call by name and makes use of a technique known as Jensen's Device to provide the function whose output is to be plotted.
These are some rather more complex example ALGOL programs that have been kindly contributed by Bob Firth. Both these programs do a lot of intensive calculation and both will run very much faster if the CPU and Core Store windows are minimized and the Real time option is deselected.
This will calculate factorials of large integers (e.g. 1000!). The value to be calculated should be provided on a tape placed into reader 2.
This will calculate the value of PI to many decimal places (e.g. 1000). The number of places required should be provided on a tape placed into reader 2.
|Return to index
© Tim Baldwin 2009,2013