ICL 1900 BCPL compiler

As described in Computer Resurrection issue 75 (Autumn 2016) a tape from Galdor Computing has been found that contains a copy of Martin Richards' BCPL compiler for the ICT/ICL 1900 series computers.

The compiler is available in both source and binary format. It was initally assumed that the the code generator was written by Bernard Sufrin, but it appears it was written elsewhere, possibly at QMC (Queen Mary College, now Queen Mary University of London). It is not currently known who wrote the code generator, or of they used Bernard Surfin's code generator for the bootstrap).

On investigation of the files obtained from Galdor Computing it appeared that the full source of the compiler (BCPL to OCODE) was present and it proved possible to recompile the compiler, producing identical OCODE and a working second generation compiler.

Unfortunately the source of some functions found in the BCPL library is missing. This is not too serious as PLAN versions of the routines can be generated from the existing semicompiled library using my disassembler program.

More seriously, parts of the code generator, CGMX, (which converts OCODE to semicompiled) were missing, a simple recompilation of the code generator produced a binary that was significantly shorter than the original and which halted on a missing function when run. It has proved possible to recreate the missing parts of CGMX, as documented here.

The language compiled is the pre-PDP10 dialect of BCPL, without the later additions of the byte indexing operator "%" and the field access operators "SLCT" and "OF", which makes it rather a good fit for the word-oriented 1900 architecture. In contrast with some other non-ICL written compilers (Algol 68R, Fortran 77, Pascal) it compiles to standard semicompiled format, making it relatively easy to include non-BCPL code in BCPL programs. Like Salford's Fortran 77 it uses the ASCII character set internally, making programming with such advanced features as lower case rather easier than standard 1900 six bit 3 shift code.

The compiler is case sensitive, all BCPL keywords are in uppercase and all global symbols in the run time library are in uppercase. User programs can use lowercase for variable and function names.

The runtime includes support for running under EXECUTIVE, MAXIMOP and GEORGE.

The runtime has no support for heap memory allocation, only the stack and static memory is supported. The runtime supports dynamic extension of the stack, which would conflict with heap memory.

The code generator generates DBM, 15 or 22AM mode. No provision for EBM seems to be present.

I'll add more information about the run time library later.

A NEWCOPYOUT format magnetic tape containing the working BCPL system is available: mt5250010-2.zip. To install do:


MK directory
DY directory
NEWCOPYIN (5250010),TRAPOPEN
NEWCOPYINPAR
****
NEWCOPYIN (5250010),*CR NEWCOPYINPAR,TRAPOPEN
INSTALL
The original compiler can be installed by logging in in turn as user :LIB and :MACROS and re-runing the INSTALL macro, or the compiler and library can be recompiled using the BUILD-BCPL command in the source directory and then installed using the INSTALL STAGE2 command. (Note that compilation errors will be reported from some of the PLAN code, the PLAN compiler is very, very stupid).

To compile a BCPL program the BCPLGO macro can be used:

    BCPLGO PROG source, SAVEBIN compiled
Documentation on the BCPLGO macro and the compiler options can be found here.

All questions to john@AtlanTech.com