Kidsgrove Algol on the Web

Typing Algol60 in the 21st century

Algol60 programs intended for input to kAlgol are typed with the following conventions:
typescriptKDF9 Algolofficial Algol60
'begin' etcbeginbegin
>=>
<=<
!=
%÷÷ integer divide
*×× multiply
~1010 subscript 10
_ underline for space in a string (i.e. a * in KDF9 paper tape code)
@ for end message (because it is involved in message)
{} curly brackets for underlined square ones (Algol60 string quotes).
$ asterisk in a Usercode body -- used to print as $ on KDF9 line-printer
Note: The rationale for these conventions can be seen here.

Compiler options

In the real KDF9 world the Kidsgrove Compiler was invoked from within the POST system and offered various options. This web version offers some of the same facility, by selecting the appropriate row of the table.

The Algol compiler generated KDF9 assembly language (Usercode) and this was then translated into a binary object program by a component callad KAB84. Sadly this is among the missing parts of the system. We have modified the system to use the paper tape version of the Usercode compiler, which is as near as we can get to an authentic compilation. However, you can choose to use the version of Usercode that was written this century. It gives a listing showing the generated machine code. There is a radio button to choose.

Caveats

We are now fairly confident that the version of the compiler that we have is not quite the finished product, and several defects remain. This is particularly true of the optimiser.

The runtime library was also missing from the preserved listing, but we have hopes of reconstructing a fairly authentic version by picking out from Whetstone Algol and a listing of a program that has survived with chunks of the library routines. For the present, all the standard functions work using code taken from Whetstone Algol, but the KDF9 I/O is rather a shadow of the real thing. The library inclusion requirements are described in the Algol Users Manual. Look at §3.8.

The present implementation of A6 is minimal. Only the following routines work:
        open(20); open(30); close(20); close(30); read(20); output(30,num); writetext(30,[Words of wisdom]);
The output from output(30,...) is of limited range and precision.

However, it has proved possible to implement the proper output routines output(dv, val), format(layout) and write(dv, layout, val). These are incorporated into the individual libraries, and can be accessed by replacing A6 with A1, A5, A15.

The implementation of read(20) is in A4, and this is currently the same limited implementation as is included in A6. The total amount of data is limited to 320 characters. Only streams 20 and 30 work.

The currently available libraries are: The contents of these libraries are as described in §3.8 of the Algol Users Manual (except A105). A library number greater than 100 indicates a newly written substitute that is much simpler, and may be useful in investigation of bugs.

Some of the runtime errors lead to a deliberate execution of an unimplemented instruction, so as to invoke the emulator’s diagnostic facilities — useful for developing the compiler, but not very helpful to the Algol programmer.