Leo III software demonstration

Overview

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:

There are four demonstration packages:

Instructions for the Realistic demo on a single Windows computer

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. Most of the output is genuine Leo III output and appears on a white background, whereas comments from the emulator are probably on a blackground. 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 bottstrap from the system tape.

Leo III operators’ console

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. 1/1/9 would be set up as:

and once the values are set up the operator presses STACK to “stack” the data into the machine.

Completing the bootstrap of the Leo III Master Routine

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 11 September. Click GO.

The GO and TURBO buttons

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.

Running “Hello World!”

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.)

Translating and then running “Hello World!”

The source text ot the program is here, along with control data to run the Intercode translator and also the resulting program.

Before we can run the Intercode Translator we have to load up the appropriate program tape. 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
        PREFER SP
        PTAPE

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 paper tape file. Just stack 4/1/1 in order to read it. The typewriter should reply with
        R T I

Load hello.txt into the paper tape reader, and stack 4/1/2.

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. Select TempA6. 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 a few 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:
         END 08000
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.

Translating and then running a genuine old program

The source text ot the program is here, 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.

When it all goes wrong — or you have better things to do

If nothing on the console seems to provoke a response, try 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.

Explanation of the workings of the demo

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.