System software on Leo III was written in Intercode. This is a machine-level language for a fictitious machine which resembles a Leo III, but which has a more extensive order code. Some Leo III systems software has been rescued from line-printer listings. It can be browsed on-line and also executed in emulation.
The sofware that we have so far rescued is all written in Intercode and consists of:
When the ZIP file is unzipped, it produces a directory LeoIIIdemo3 which includes the source text of the emulator program, leo3.c. A binary program for MS Windows (leo3.exe) is included in the this distribution. It was developed using gcc, but this is compiled using Microsoft software courtesy of Bill Gallagher.
Before running the demo system, you need to initial ise some mag tapes, which you do by a double click on init.bat. If your machine will not run the included version of leo3.exe you will need to compile the source, leo3.c.
In order to start the demo, you merely needs to double click the file go.bat, or open a command window and type go. If this does not work, open a command window with LeoIIIdemo3 as the current directory, and typo go.
A pause will appear in the command window. Wait until two new windows appear, one for the printer, and one for the operator’s console, When you hit a key to clear the pause the command window will becomde the Leo III operators’ typewriter. Also, the two initial windows will light up.
Click the button labelled MT. This must be your very first click and it causes the machine to bootstrap from the system tape.
Most of the output is genuine Leo III output and appears highlighted.on a Windows system. There is a slightly more realistic appearance on a system where the command window emulatoes a VT100 (e.g. Linux, Mac). There the genuine Leo III output appears on a white or light grey background (emulating the paper in the typewriter) and in mostly black text, with some red bits as happened on a real LeoIII. The rest of the output is composed of comments from the emulator.
On the real machine there were 12 switches, which operated in three groups of four,
In the manuracturer’s manual the switch settings are specified as 3 numbers, which must be set on the switches in binary. E.Gg. 2/5/12 would be set up as:
and once the values are set up the operator presses STACK to “stack” the data into the machine.
Click the button labelled GO.
You now need to complete the bootstrap process.
The typewriter will be showing:
* 77 09001 00401
In Leo speak this is ALARM 77 and the numbers are the version of the Master Routine.
Set the console switches to 0/0/1 and click STACK, and then GO.
You will be asked to give the date. Set this on the switches as d/d/m, e.g. The switch settings in the above example would signify 25 December. Click STACK.
These buttons do not exist on a real Leo III. Originally they came about on account of timing deficiencies with the emulation, but are quite useful in seeing what is happening at one’s own speed.
The GO button runs the emulation for several thousand Leo III instructions. In the early stages of using this system it helps to go though things one GO at a time.
The TURBO button lets the machine run continuously. It is a toggle and can be clicked to turn off TURBO if things are going too fast for comfort.
The bottom section of the control window is basically for dealing with paper tape and magnetic tape. The PT button loads the paper tape whose name is in the pull-down menu box to its left. The MT button is for mounting mag tapes. It has two pull down menu boxes, one for the name of the file emulating the tape, and one for the unit number upon which the tape is to be mounted.
To run any program the machine needs a mag tape containing the program, and a paper tape (or card) containing the “control data”.
The control data for running the Hello World program is in a paper tape image called runHello.txt. It should already be selected in the bottom left-hand of the console window. Click PT to load the tape into the paper tape reader.
Select the mag tape with the program on it. This is called HelloA2. Then click the MT button to load the mag tape, onto route 00 (sometimes called 0/0).
To allocate and run the program you need to set the switches to 4/1/2, and click STACK. You may need a click of GO to see the full effect, when the words HELLO WORLD appear on the typewriter window.
For neatness, you can unload the program tape by stacking 1/0/6. (This is Leo speak for setting the switches and then pressing STACK.)
The source text,of the program is in a file hello.txt, along with control data to run the Intercode translator and also the resulting program. Select this file in the left-hand menu box, and click PT to load it in the paper tape reader.
Before we can run the Intercode Translator we have to load up the appropriate program tape on route 00.
The Intercode Translator is program 8000, and so it is to be found on tape 08000.
Select this in the MT window, and click MT.
We also need to tell the system that
output will be on the special Analex printer, and that
input will be on paper tape.
Stack 1/1/11 and stack 1/0/4.
The typewriter should reply with
You also need to tell it which mag tapes are available for use.
You do this by reading the Released Tapes Index which is at the start of the source text
on paper tape file hello.txt,
Just stack 4/1/1 in order to read it.
The typewriter should reply with
R T I
Things are all set to run the translation. Stack 4/1/2 to load and enter (called allocate in the original manuals). the Intercode Translator 08000 then reads the paper tape.
You will need to press GO from time to time to make it all happen.
You will be asked to load a mag tape on unit 02.
Best to use a temporary tape this time.
When asked for a tape on unit 13, load TempA2.
Note: the A6 tape goes on unit 02 and the A2 tape on unit 13, not 02. On a real installation the mag tapes would be put up ahead of time.
After several stabs of the GO button.
You will see the program listed in the printer.
The translation should end with ALARM *06.
which appears on the typewriter as:
* 06 08000
The answer to this option is 1, which involves stacking 0/0/1. You should soon see:
Your newly translated program is now on tape TempA2.
If you would like to run it, unload the 8000 program tape (stack 1/0/6), and follow the instructions above, by using tape TempA2 rather than HelloA2.
Actually there is control data for the program on the end of the hello.txt paper tape, but you need replace the program tape, The program tape goes on route 0/0, so you will have to change the route to 00 on the left of the MT button, before clicking the MT button. Next just stack 4/1/2, press GO a time or two, and it should all happen.
The source text ot the program is in a file called numbers.txt, along with control data to run the Intercode translator and also the resulting program.
You can translate and run this using the same steps as for the “Hello World”. It was on a paper tape among several others in a tin box, found as a result of a garage clear-out of an ex-Leo person. It prints out values of integers as represented in different radices. This printout is aimed at a wider printer, so just move the RH border of the printer window to improve the layout. This printout is rather boring, and you can suspend the printer by hitting space. Hit space again to turn it back on.
If nothing on the console seems to provoke a response, you have probably hit a known (but unsolved) timing problem. An escape from this is available by clicking the Leo2¾ button at the top left of the console window. You can always shut the emulation down via control-C on the typewriter window.
If you want to stop the emulator and start again or go and do something else, there is a command window immediately above the pink message line. Put a letter x in there and press enter twice.
If that does not produce a clean closure, do multiple control-C on the typewriter window.
If that does not stop it, reboot is the only answer (never happened yet).
The console and printer windows can be closed down in the normal way.
The source text of the emulator starts with 100+ lines of comment describing its action.
The particular demonstration here uses the command:
leo3 -d -V -o -p -b1500 -i2 -c MT-start.bin
Alongside the emulator are two Java programs, one for the printer and one for the console. These must be started first. They listen on TCP/IP ports 8889 and 8888 respectively. They can be left running across multiple runs of leo3.c.