The CDC 6000 Pascal Compiler


Though the existence of CDC/Cray computer history presentation projects on the web, we can now display several scans and other material from the original CDC 6000 Pascal compiler, the first Pascal compiler in existence.

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 CDC compiler and the P4 compiler were developed from the same source at one time. The first version here of the CDC 6000 compiler, the 1972 "unrevised" compiler, was unique, but the "revised"compilers branched off the Pascal-P compiler. This is detailed in "Pascal: The language and its implementation" [D. W. Barron] (which was available on Amazon for $1 at the time of this writing). The first CDC 6000 compiler was used to develop Pascal-P, a processor independent Pascal porting "kit", and then the CDC 6000 compiler was created as its first official "port". Thus, you will find that the Pascal-P2 compiler and the 1974 CDC 6000 compiler are fairly similar.

Unfortunately, although the CDC 6000 compiler is an example of the Pascal-P compiler with the full language implemented, it is basically dead for any purpose except as an example, because the CDC 6000 machine is also dead, as far as a working computer currently available. Fortunately, there is now a complete and machine independent compiler, Pascal-P5, and works on current machines.

The versions of the CDC 6000 compiler presented here are:

1972    Unrevised Pascal - The first version of Pascal, with differences from what is commonly known as "Pascal".

1974    Revised Pascal - This is the earliest version of the revised Pascal compiler, just after being ported from the Pascal-P compiler.

1976    Revised Pascal - The revised compiler, using the most widely known version of the language.

1984    ISO 7185 Pascal - The language brought up to the ISO 7185 standard.

 


The CDC 6000 Series machines

This page goes over the architecture and history of the CDC 6000 series machines.


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

Main compiler code in Pascal

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:

Pascal User Manual (1970)

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 1974 Compiler


The following listings were scanned from listings provided by Mr. Bob Felts. They were taken from his web site, and he scanned them to .PDF.

Main compiler code in Pascal

Runtime library code in Compass, the CDC 6000 assembly language

These files are extremely large files because they are whole scans of the greenbar copies. I have found they generate errors when I try to view them from the web page directly, apparently it times out. If you have this problem, try saving the file to your computer, then opening it with a .pdf reader.

The compiler listing is dated 1974. The scans were taken from a greenbar listing direct from a CDC 6000 series computer. Mr. Felts managed to scan the full wide greenbar listing, a real feat!

The 1974 compiler was the first of the revised compilers. That is, it was rewritten in the "revised Pascal" language that was the Pascal language we recognize today. The "Pascal-P implementation notes" imply that the compiler was Pascal-P ported specifically to the CDC 6000 series computer, and indeed the 1974 CDC Pascal compiler appears to match P2 better than any of the other compilers. As the CDC compiler was modified, it resembled Pascal-P less and less, which is natural.


The 1976 Compiler


The following listings were scanned from listings provided by Mr. John Dykstra.

Main compiler code in Pascal

Runtime library code in Pascal

Runtime library code in Compass, the CDC 6000 assembly language

An error translation routine

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.

In "Pascal-P implementation notes" [K.V.Nori, U. Ammann, K Jensen, H. H. Nageli, and Ch. Jacobi] the authors strongly imply that this compiler was derived from the Pascal-P implementation, and many sections of the code are strongly similar to P2. This imples that the 1976 Pascal compiler was derived from either P2 Pascal compiler or from the (presently unobtainable) P1 Pascal compiler that both the 1976 Pascal compiler and the P2 Pascal compiler have as a common root.

This means that the CDC 6000 compiler series is not dead, but lives on as a functional compiler in the Pascal-P series compilers.

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 1984 Compiler


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:

  1. It contains the last known code revision of the CDC compiler.
  2. It is well documented.
  3. It is exists in machine readable and runnable form.
  4. It obeys, with compiler options, the ISO 7185 Pascal Standard.

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.


For more information contact: Scott A. Moore samiam@moorecad.com