Besides being interesting historically, the CDC 6000 compiler was also used as the basis for several other compilers on other machines. When a Pascal implementor needed a compiler, he/she could use either the P4 source as a basis, or the CDC 6000 compiler, or write it from scratch. The reason you might prefer to use the machine specific CDC 6000 compiler as a starting point is that (unlike the P4 compiler) it was a full implementation of Pascal, without any features left off. It also was a full optimizing compiler.
The following listing was provided by John Reagan, of Hewlett-Packard (he was in the division of Digital Equipment Corporation that was purchased by HP).
The 1972 Compiler was the last version of the original, unrevised Pascal language before Pascal reached the form most folks know as Standard Pascal. It is different in many ways, for example, there was no program header, write/ln and read/ln were considered CDC extentions to the language, dynamic pointers were introduced by a "class" statement, and other differences. The language of the compiler is described in the 1970 document:
The method used to create the first Pascal compiler, described by U. Ammann, was to write the compiler in a subset of unrevised Pascal itself, then hand-translate the code to SCALLOP, a CDC specific language. The compiler was then "bootstrapped", or compiled using the Pascal source code and the SCALLOP based compiler, to get a working compiler that was written in Pascal itself. Then, the compiler was extended to accept the full unrevised Pascal language.
Programmers living in the age where "programming" means to write a little bit of code, then compile and try it out, then add some more code and repeat, might be confused by the previous description. However, in the world of batch operating systems, it was not unusual to write major programs entirely on paper first, then get a card deck punched and run afterwords. The way you debugged such a thing was to test it out, find the problems with the run, then edit the original to fix any problems. Often this was done by penciling corrections to double spaced copy, then changing only the affected punch cards to fix the problems.
You might ask what occurs when problems require major sections to be rewritten. The short answer is you don't do that. The batch process provides heavy penalties for not getting it 99% correct the first time through, and when your time, paper, and pencil is much cheaper than computer time, you do what you have to do. The result is often code that is substantially correct and reliable before it is even entered into the computer.
I myself used the paper entry method to code a Basic compiler for the Z80 processor in 1978, because of a lack of adequate assembler for the machine I was coding on. Each routine was written on a page, and kept in a book of such routines, then converted to machine language by hand, and written in hex at the left of the source code. Although each routine typically required a rewrite to be correct, the final code ran on the machine with only a dozen or so corrections.
The following listings were scanned from listings provided by Mr. John Dykstra.
Runtime library code in Pascal
Runtime library code in Compass, the CDC 6000 assembly language
The compiler listing is dated 1976. The scans were taken from a greenbar listing direct from a CDC 6000 series computer, and bear some unique features to such a listing. The name and line number appears at the right of the listing. Because the listings were wider than a 8 1/2 inch sheet of paper, the limit of my scanner, the line numbers to the right have one or more digits cut off. The listings have a 6 digit page number stamped on them at the upper left, which was done by me with an incrementing stamp. This was done so that I would have a positive indication of the page number while performing the automatic feed scan.
The most unfortunate side effect of cutting down the listings was that the runtime library in Compass have the machine addresses and codes at the left of the listing cut off. This was unfortunately necessary, since the full assembly listing was far to wide to scan. However, none of the source code was lost, and the listing could be reproduced by assembling it on a CDC 6000 simulator.
If you have been following the history sections elsewhere on this site, you'll know that this compiler comes from the revised Pascal that forms the basis of the "Pascal User Manual and Report", second edition. The compiler source is not written in standard Pascal, nor would it have been even if the compiler had been written at the time of the standard. It uses several of the CDC 6000 specific extentions, and it has the generation of CDC 6000 machine instructions imbedded in it. It is a one piece compiler, it takes in Pascal on one end, and issues CDC 6000 object code out of the other.
The layout of the compiler is similar to the P4 project, which is not an accident. The P4 system was derived from this compiler.
The compiler was written in, and compiled for, the revised Pascal language that most of us think of as Standard Pascal. The documents that describe this are:
U. Ammann described the creation of the revised compiler in "The Zurich Implementation", and unfortunately unobtainable document. The 1970 compiler (above) was rewritten completely to arrive at the revised Pascal compiler. This was done both because the new Pascal language was different, and also because the experience of writing the old compiler had suggested better code structure for the new compiler.
The new compiler was written in unrevised, or 1970 Pascal code. This resulted in a compiler that compiled using the old compiler, but accepted the revised language Pascal. Then, the compiler code itself was hand translated to the new language, and translated by the new compiler that was compiled by the old compiler. This resulted in the new compiler running on itself, and thus a full bootstrap.
Of course, at this point you might well wonder what "hand translation" of the first version of the source on the new compiler from unrevised to revised Pascal might mean, which U. Ammann does not go into. Basically, it is just what you do if the unrevised and revised languages are not quite compatible. Otherwise, if the unrevised compiler was a subset of the revised language, you could just recompile it without changes. This is not nearly as much of a project as translation to SCALLOP, and used in the first compiler. It just means changing to accommodate the differences in the languages, which were stubstantially similar.
The CDC compiler continued to evolve past 1976. Most of the changes in what is contained here as the 1984 compiler were made at the University of Minnesota by Dave Bianchi and Jim Miner (who appears as a reviser of the forth edition "Pascal User manual and Report"). The material contained is marked copyright, but the University of Minnesota has graciously granted permission for it to appear on this web site. You will find the agreement for its use here:
University of Minnesota copyright use agreement
The U of M group extended the implementation in a few ways, for example it contains the "otherwise" statement on case statements. Otherwise, it appears to be a straightforward implementation of the original Zurich compiler, and it continued to be run on the CDC 6000 series computers.
The U of M implementation is important for several reasons:
For the last item, see Tom Hunters web site:
http://members.iinet.net.au/~tom-hunter/
I intend to get some snapshots of the CDC implementation running and place them here, time permitting.
The source files of the compiler appear:
Modification history - History of changes to the source.
Pascal compiler - The main compiler code
Pascal Include Generator - Program to process includes and error information.
Pascal Library - Contains runtime support library routines in Pascal.
Pascal Error Messages - Contains error messages in various languages.
Pascal Runtime Support - Contains Pascal runtime support in Compass, the CDC 6000 assembly language.
Pascal System Support - Contains the run time system in Compass, the CDC 6000 assembly language.
Pascal System Texts - Contains constants and macros used in the compiler, in Compass.
Note that the listings were created by a "card listing program" (as in punched cards), and have type and sequencing information at the right hand side. This information can be easily removed by clipping everything from collumn 75 on. It was retained here for historical purposes.
Note also that all of the sources appear in upper case text. The CDC computer native character instruction set only had one case of character.
The documentation files for the compiler appear:
Pascal-6000 Installation Handbook - Details how to install the release tape.
Pascal-6000 Internal Reference Manual - Overview of program internals.
Pascal-6000 Library Information - Details of the local library.
PASPLOT - a Pascal Plotting Package - Details of an applications package.
SUMMARY OF CHANGES TO PASCAL-6000 - As it says.
Pascal-6000 Release 4 Upgrade Guide - Surveys changes from the last to this release.
Prose Instruction Manual - Manual for Prose, a text formatter.
Pascal-6000 Writeup - The main users manual for the compiler.