PICL

The Language PICL and its Implementation, Niklaus Wirth, 20. Sept. 2007

PICL is a small, experimental language for the PIC single-chip microcomputer. The class of computers which PIC represents is characterized by a wordlength of 8, a small set of simple instructions, a small memory of at most 1K cells for data and equally much for the program, and by integrated ports for input and output. They are typically used for small programs for control or data acquisition systems, also called embedded systems. Their programs are mostly permanent and do not change.
All these factors call for programming with utmost economy. The general belief is that therefore programming in a high-level language is out of the question. Engineers wish to be in total control of a program, and therefore shy away from complex languages and compiler generating code that often is unpredictable and/or obscure.
We much sympathize with this reservation and precaution, particularly in view of the overwhelming size and complexity of common languages and their compilers. We therefore decided to investigate, whether or not a language could be designed in such a way that the reservations would be unjustified, and the language would indeed be beneficial for programmers even of tiny systems.
We chose the PIC processor, because it is widely used, features the typical limitations of such single-chip systems, and seems to have been designed without consideration of high-level language application. The experiment therefore appeared as a challenge to both language design and implementation.
The requirements for such a language were that it should be small and regular, structured and not verbose, yet reflecting the characteristics of the underlying processor.

Documents:
A Microcontroller System for Experimentation, description, parts of which are published on this page.
PICL: A Programming Language for the Microcontroller PIC, EBNF
The Language PICL and its Implementation, Code generation.
PICL Scanner, Oberon source
PICL Parser, Code Generator, Oberon source

The Language PICL
The language is concisely defined in a separate report. Here we merely point out its particular characteristics which distinguish it from conventional languages. Like conventional languages, however, it consist of constant, variable, and procedure declarations, followed by statements of various forms. The simplest forms, again like in conventional languages, are the assignment and the procedure call. Assignments consist of a destination variable and an expression. The latter is restricted to be a variable, a constant, or an operator and its operand pair. No concatenation of operations and no parentheses are provided. This is in due consideration of the PIC’s simple facilities and ALU architecture. Examples can be found in the section on code patterns below. Conditional and repetitive statements are given the modern forms suggested by E. W. Dijkstra. They may appear as somewhat cryptic. However, given the small sizes of programs, this seemed to be appropriate.

Conditional statements have the form shown at the left and explained in terms of conventional notation to the right.

[cond -> StatSeq]                     IF cond THEN Statseq END
[cond -> StatSeq0|* StatSeq1 ]        IF cond THEN Statseq0 ELSE StatSeq1 END
[cond0 -> StatSeq0|cond1 -> StatSeq1] IF cond0 THEN Statseq0 ELSIF cond1 THEN StatSeq1END

Repetitive statements have the form:

{cond -> StatSeq}                     WHILE cond DO Statseq END
{cond0 -> StatSeq0|cond1 -> StatSeq1} WHILE cond0 DO Statseq0 ELSIF cond1 DO StatSeq1END

There is also the special case mirroring a restricted form of for statement. Details will be
explained in the section on code patterns below.

{| ident, xpression -> StatSeq}

The PICL Compiler
The compiler consists of two modules, the scanner, and the parser and code generator. The scanner recognizes symbols in the source text. The parser uses the straight-forward method of syntax analysis by recursive descent. It maintains a linear list of declared identifiers for constants, variables, and procedures.

Example

MODULE RepeatStat;
  INT x, y;
BEGIN
  REPEAT x := x + 10; y := y - 1 UNTIL y = 0;
  REPEAT DEC y UNTIL y = 0
END RepeatStat.

0 0000300A MOVLW 10
1 0000078C ADDWF 1 12 x := x + 10
2 00003001 MOVLW 1
3 0000028D SUBWF 1 13
4 0000080D MOVFW 0 13 y := y - 1
5 00001D03 BTFSS 2 3 = 0 ?
6 00002800 GOTO 0
7 00000B8D DECFSZ 1 13 y := y – 1; = 0?
8 00002807 GOTO 7

Example

The following procedures serve for sending and receiving a byte. Transmission occurs over a 3-wire connection, using the conventional hand-shake protocol. Port A.3 is an output. It serves for signaling a request to receive a bit. Port B.6 is an input and serves for transmittithe data. B.7 is usually in the receiving mode and switched to output only when a byte is to be sent. In the idle state, both request and acknowledge signals are high (1).

PROCEDURE Send(INT x);
  INT n;
BEGIN ?B.6;                     wait for ack = 1
  !S.5; !~B.7; !~S.5; n := 8;   switch B.7 to output
  REPEAT 
    IFx.0 -> !B.7 ELSE !~B.7 END; apply data
    !~A.3; issue request
    ?~B.6; wait for ack
    !A.3; ROR x; reset req, shift data
    ?B.6; DEC n wait for ack reset
  UNTIL n = 0;
  !S.5; !B.7;!~S.5 reset B.7 to input
END Send;

PROCEDURE Receive;
  INT n;
BEGIN d := 0; n := 8; result to global vaiable d
  REPEAT
    ?~B.6; ROR d;     wait for req
    IF B.7 THEN !d.7 ELSE !~d.7 END ; sense data
    !~A.3;           issue ack
    ?B.6;            wait for req reset
    !A.3; DEC n      reset ack
  UNTIL n = 0
END Receive;

Another version of the same procedures also uses three lines. But it is asymmetric: There is a master and a slave. The clock is always delivered by the master on B.6 independent of the direction of the data transmission on A3 and B7.

When sending, the data is applied to A.3, when receiving, the data is on B.7. The advantage of this scheme is that no line ever switches its direction, the disadvantage is its dependence on the relative speeds of the two partners. The clock must be sufficiently slow so that the slave may follow. There is no acknowledgement.

Master                              Slave
PROCEDURE Send(INT x);              PROCEDURE Receive;
  INT n;                              INT n;
BEGIN n := 8;                       BEGIN d := 0; n := 8;  result to global vaiable d
  REPEAT                              REPEAT ?~B.6; !>d;   wait for clock low
    IF x.0 THEN !A.3 ELSE !~A.3 END;    IF B.7 THEN !d.7 ELSE ~d.7 END; sense data
    !~B.6; !>x; !B.6; DEC n             ?B.6; DEC n        wait for clock high
  UNTIL n = 0                         UNTIL n = 0
END Send;                           END Receive;

PROCEDURE Receive;                  PROCEDURE Send(INT x);
  INT n;                              INT n;
BEGIN d := 0; n := 8;               BEGIN n := 8;
  REPEAT !~B.6; ROR d;                REPEAT ?~B.6;        wait for clock low
    IF B.7 THEN !d.7 ELSE ~d.7 END;     IF x.0 THEN !A.3 ELSE !~A.3 END; apply data
    !B.6; DEC n                         ROR x ?B.6; DEC n  wait for clock high
  UNTIL n = 0                         UNTIL n = 0
END Receive;                        END Send;

Conclusions
The motivation behind this experiment in language design and implementation had been thequestion: Are high-level languages truly inappropriate for very small computers? The answer is: Not really, if the language is designed in consideration of the stringent limitations. I justify my answer out of the experience made in using the language for some small sample programs. The corresponding assembler code is rather long, and it is not readily understandable. Convincing oneself of its correctness is rather tedious (and itself error-prone). In the new notation, it is not easy either, but definitely easier due to the structure of the text.
In order to let the regularity of this notation stand out as its main characteristic, completeness was sacrificed, that is, a few of the PIC’s facilities were left out. For example, indirect addressing, or adding multiple-byte values (adding with carry). Corresponding constructs can easily be added.
One might complain that this notation is rather cryptic too, almost like assembler code. However, the command (!) and query (?) facilities are compact and useful, not just cryptic. Programs for computers with 64 bytes of data and 2K of program storage are inherently short; their descriptions should therefore not be longwinded. After my initial doubts, the new notation appears as a definite improvement over conventional assembler code.
The compiler was written in the language Oberon. It consists of a scanner and a parser module of 2 and 4 pages of source code respectively (including the routines for loading and verifying the generated code into the PIC’s ROM). The parser uses the time-honored principle of top-down, recursive descent. Parsing and code generation occur in a single pass.

P2 Pascal Compiler

As the name implies, P2 is the second version of the Portable Pascal compiler. It seems to be the first one widely distributed and also the first one to have surviving sources.

One of the distributions of P2 went to California, UCSD. And that version evolved into the UCSD Pascal system.

Mark Rustad took the P2 source, stripped it (no reals e.g.) and changed the p-code to a compact bytecode in Pascal-M.

 (*********************************************************         
  *                                                       *         
  *                                                       *         
  *     STEP-WISE DEVELOPMENT OF A PASCAL COMPILER        *         
  *     ******************************************        *         
  *                                                       *         
  *                                                       *         
  *     STEP 5:   SYNTAX ANALYSIS INCLUDING ERROR         *         
  *               HANDLING; CHECKS BASED ON DECLARA-      *         
  *     10/7/73   TIONS; ADDRESS AND CODE GENERATION      *         
  *               FOR A HYPOTHETICAL STACK COMPUTER       *         
  *                                                       *         
  *                                                       *         
  *     AUTHOR:   URS AMMANN                              *         
  *               FACHGRUPPE COMPUTERWISSENSCHAFTEN       *         
  *               EIDG. TECHNISCHE HOCHSCHULE             *         
  *               CH-8006 ZUERICH                         *         
  *                                                       *         
  *                                                       *         
  *                                                       *         
  *     MODIFICATION OF STEP 5 OF PASCAL COMPILER         *         
  *     *****************************************         *         
  *                                                       *         
  *     THE COMPILER IS NOW WRITTEN IN A SUBSET OF        *         
  *     STANDARD PASCAL  -  AS DEFINED IN THE NEW         *         
  *     MANUAL BY K. JENSEN AND N. WIRTH  - AND IT        *         
  *     PROCESSES EXACTLY THIS SUBSET.                    *         
  *                                                       *         
  *     AUTHOR OF CHANGES:   KESAV NORI                   *         
  *                          COMPUTER GROUP               *         
  *                          T.I.F.R.                     *         
  *                          HOMI BHABHA ROAD             *         
  *                          BOMBAY - 400005              *         
  *                          INDIA                        *         
  *                                                       *         
  *     THESE CHANGES WERE COMPLETED AT ETH, ZURICH       *         
  *     ON 20/5/74.                                       *         
  *                                                       *         
  *                                                       *         
  *********************************************************)        

Original P2 compiler source
Original P2 interpreter source

Scott Moore’s ISO7185 version of P2

Zürich Pascal compilers

The first Pascal compiler was developed during the years 1969-1971 for Control Data 6000 series hardware at the Institut für Informatik, Eidgenössische Technische Hochschule Zürich. As result of experience with the system and a new implementation begun in July, 1972, resulting in a family of two compilers, Pascal_P and Pascal-6000, having a single overall design.

Pascal-P is a portable compiler that produces code for a hypothetical stack computer, the system is implemented by writing an interpreter for this machine.

Pascal-6000 produces relocatable code for Contrl Data 600 series computers.

Descendants of these two compilers comprised the bulk of the Pascal implementations in existence after 1980.

CDC 6000 Pascal compilers

Pascal Px compilers

Pascal-S compiler

Pascal PL/0 compiler

See the Articles and Books pages for more information!

CDC 6000 Pascal compilers

The CDC 6000 compiler was 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.

Read this report written by Niklaus Wirth, On “PASCAL” Code generation, and the CDC6000 Computer, Stanford University, 1972

On this page listings from 1972, 1974, 1976 of the Zürich compilers and the surviving (1986) CDC 6000 compiler at Minnesota University.

The 1972 Compiler

The following listing was provided by John Reagan, currently Master Compiler Engineer at VMS Software, formally of Digital Equipment (DEC), Compaq and 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 statement, and other differences.
The language of the compiler is described in the 1970 document, see the Articles page.
The method used to create the first Pascal compiler, described by U. Ammann in The Zurich Implementation, 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.

The 1974 compiler

The following listings were scanned from listings provided by Bob Felts: CDC 6000 Pascal 3.4 Update 10 compiler.
Main compiler code in Pascal
Cross-reference
Runtime library code in Compass, the CDC 6000 assembly language
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 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 line numbers to the right have one or more digits cut off. 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 described on the Articles page.
U. Ammann described the creation of the revised compiler in The Zürich Implementation, 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 substantially 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. The University of Minnesota 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 Zürich compiler, and it continued to be run on the CDC 6000 series computers. The University of Minnesota implementation is important for several reasons:

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

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 column 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:
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.surveys changes from the last to this release
Pascal-6000 Release 4 Upgrade Guide
Prose Instruction Manual – Manual for Prose, a text formatter.
Pascal-6000 Writeup – The main users manual for the compiler.

Based upon a page and files supplied by by Scott A. Moore

P4 Pascal Compiler


Relevant articles about the portable Pascal Px compilers (see also the Articles page for Pascal Reports etc)

Book by Martin Daniels and Steven Pemberton Pascal implementation: The P4 Compiler, online version, local copy
A line by line description of the source.

ETH Pascal Programming Language Technical information:

Portable Compiler project New Edition H.H. Naegeli, 16.02.77
Portable Compiler project Pascal P4 Urs Ammann, Kesav Nori, Christian Jacoby May 76
Pascal P4 interpreter
Lists binary codes P-codes
Cross referencer
P4 Pascal Compiler P-Code listing
Procedural Cross Referencer

Downloads

Pascal P4 adapted to more standard Pascal
The files in this archive are:

  • int.p – P4 code interpreter
  • comp0.p – original compiler as distributed
  • comp1.p – same compiler with bugs fixed up to Pascal Newsletter #12
  • comp2.p – as above but with experimental changes to eliminate the last of the machine dependent code
  • comp.p – lower case, entabbed and stripped version of comp2.p some typos in comp?.p have been fixed
  • compvax.p – essentially the same as comp.p but with changes to allow it to compile under ‘pc’
  • compdiffs – differences between compvax.p and comp.p
  • compvax.errs – warning messages
  • compvax.map – line numbers of procedures and functions

Note that the characters for ^ and ‘ are ‘ and # in the compiler sources.

Pascal P4 adapted to ISO7185 Pascal by Scott Moore

Pascal P4 adapted to more standard Pascal, with examples

Pascal-S Concurrent Pascal-S

Pascal-S is a subset of Pascal, and was originally written by Niklaus Wirth.
Moti Ben-Ari has built on Pascal-S in his Principles of Concurrent Programming, resulting in Concurrent Pascal-S.

Compared to Wirth’s version of Pascal-S, case statement, records and reals are swiped from this edition of Pascal-S. M. Ben-Ari modified Wirth’s original compiler/interpreter in 1980 to include some basic features that were able to simulate concurrent programming.

First, a cobegin s1; …; sn coend block structure was added, allowing concurrent execution of the statements s1 … sn, which were required to be global procedure calls. These cobegin … coend blocks could not be nested within one another.

Second, the use of semaphores was introduced, with a semaphore data type (really synonymous with the integer data type) and the semaphore operations wait(s) and signal(s), corresponding to Dijkstra’s P(s) and V(s), respectively.

Downloads:

post

Pascal-S

Pascal-S is a subset of Pascal selected for introductory programming courses. The implementation is especially designed to provide comprehensive and transparant error diagnostics and economical service for small jobs.
The system consists of a compiler and an interpreter and is defined as a single, self-contained Pascal program.
Pascal-S is written in Pascal, and forms an excellent introduction to the art of designing small compilers.

Ben-Ari built on Pascal-S in the first version of his “Principles of concurrent programming” and introduced concurrency, see the Pascal-S Copascal page.

It is a interesting to see how many CDC-Pascal specialities are built into this compiler/interpreter.

  • Keywords are recognized by a binary search through a list of alfa’s (a standard datatype in CDC-Pascal) which are a 60-bit machine word packed with 10 6-bit characters. Since both DO and DOWNTO are keywords it is apparent from the ordering of the list that space comes after letters in the CDC character set <.li>
  • Some of the handling of large integers will only succeed on a CDC pascal implementation programs data gave the desired results
  • In Simpleexpression a 36 is emitted to negate both reals and integers, but the interpreter does this for both reals and integers s(.t.).i := – s(.t.).i;
    On the CDC this actually works for reals too

Corrections to the original (Jan van de Snepscheut):

  • line 295 (counting from 1 starting at program Pascal-S) is
    gen1(mulc, ttab[t].size); gen0(add)
    whereas the version printed in the book accidentally reads
    gen1(mulc, ttab[t].size)
    the corrected versions also implements boolean negation
  • the procedure funcdeclaration in the version printed in the book is
    erroneous. The first line on page 376 in the book should read
    if lev>1 then dx:=-1
    the last line of the procedure should read
    gen1(exit,itab[f].resultadr-dx); lev:=lev-1; dx:=odx

Wirth’s original paper is reprinted in Barrons book. Another version of Pascal-S appears in Snepscheut’s book and this uses symbolic names and contains a small peephole optimizer.
Publications where Pascal-S appeared in source format are:

  • PASCAL-S: A Subset and its Implementation, by Niklaus Wirth, Zurich : Eidgenossische Technische Hochschule, 1975. 61 s., Berichte des Instituts fur Informatik;
  • Pascal – The Language and its Implementation, by D. W. Barron, Chichester :
    John Wiley and Sons, 1980. 201 s. , ill., Wiley Series in Computing
  • Principles of Concurrent Programming, by M. Ben-Ari, Englewood Cliffs, N.J. :
    Prentice-Hall, Inc., 1982, 172 s. , ill.
  • What Computing is All About, by Jan L. A. van de Snepscheut



Downloads:


Some information on this page has been published by Scott Moore on the Standard Pascal pages and by Birger Nielsen (pages now lost).

Edison – a Multiprocessor Language

The Edison System, 1982, is comprised of both an operating system and programming environment. The system language, also named Edison, is simple yet powerful. The Edison language is comprised of only a few basic commands and structures. However, these basic fundamentals have been carefully chosen to establish the necessary foundation to produce powerful and extensive applications. The Edison System possesses adequate development facilities, yet is contained in a very small quantity of code. Per Brinch Hansen’s final development system for a PDP-11 contains approximately 10,000 lines of program text. This text includes the operating system, the compiler, the editor, the diskette formatting program, necessary assembly code, and other utility programs. This establishes a powerful yet small environment for the development of concurrent programs.

On this page:

Documents

Software Practice and Experience, Volume 11 No 4.
Devoted to the Edison papers, Per Brinch Hansen.
Programming a Personal Computer, Per Brinch Hansen
The book describing thee Edison system, design, development, and listing of programs including compiler in the Edison language, and the interpreter/runtime written in PDP-11 Alva language.
The Design of Edison
(from Software Practice and Experience Vol 11, No 4), Per Brinch Hansen
The Development of Edison, Michael Wonderlich
The EDISON Multiprocessor Language and it’s port to OpenVMS
The Edison-ES programming language

Disk images of the PDP-11/23 version of Edison

Jos Dreessen received a disk set of the Edison system from Günter Dotzel of Modulaware. And he made images of it.

This diskset contains the whole Edison system, binaries and sources of all programs.
Even the sources not published in the book Programming a Personal Computer by per Brinch Hansen like the Alva PDP-11 ‘assembler’.

All these images, the files extracted and the simh runtime are in this archive.
Note that the user disks (edison_bu1, edison_bu2) contain bad blocks.
The only text file that is affected is edison1text and therefore also edison1text.txt on edison_bu1.
On edison_bu2 systemtext and systemtext.txt are damaged.

The program edisonFiledump is written to extract the files from the disk images.
Therefore the structure of the disk was studied, most of it was somehow documented in the book.
A detailed look with an hex editor was helpful also!
The relevant information is available in the document ‘edison disk structure.txt’.

The program runs as a command line.

Syntax: edisonfiledump <name of diskfile with files to dump> [<name of output disk de-interleaved> [verbose]]'

With only the name of the disk image the files on the disk are extracted as binary files.
If a filename contains the string ‘text’ or ‘txt’ it is assumed to be a source file and also extracted in normal text format.
This appears to be true for all text files in the disk images.

If the second optional argument is given, the disk image is written into it as file but without the interleaving. Useful for study/debugging, not for running!

A third parameter ‘verbose’ shows a lot of the internal dats structures of the disk. That was very helpful, in combination with a hex editor,
to find out how the disk structure really works and is interpreted the right way.

The program is written in portable Freepascal. A Windows and Ubuntu executable is included. For other Linux or Mac use Freepascal and the source to compile to a command line program.

Here an example of the basic usage:

> EdisonFiledump rx02_system.bin
Dump Edison PDP=11/23 files from RX01 floppy dumps
V1.0 Hans Otten, 2026

Catalog of edison_progs1.bin
alva1text    58698 bytes
alva2text    9616 bytes
assembletext 14326 bytes
compiletext  16404 bytes
edison1text  18928 bytes
edison2text  49726 bytes
Number of files = 6

Created alva1text, also created text file alva1text.txt
Created alva2text, also created text file alva2text.txt
Created assembletext, also created text file assembletext.txt
Created compiletext, also created text file compiletext.txt
Created edison1text, also created text file edison1text.txt
Created edison2text, also created text file edison2text.txt

In the folder diskimages you find all the disk images as dumped by Jos Dreessen and the files extracted with EdisonFiledump as binaries without type and with type .txt as sources.

Run the Edison system in simh PDP-11 emulator

In the Edison archive you find a folder called simh.
In it is the PDP-11 simh windows precompiled executable and a simh config file called config.simh.
You can also compile simh yourself on other systems.
The config file contains the bootloader, Peter de Wachter constructed this.

With this and the disk images dumped you can run the Edison system.

>pdp11 config.simh
PDP-11 simulator Open SIMH V4.1-0 Current        git commit id: 6e9324e0+uncommitted-changes
#
# Load two disk images using the commands:
#
#     attach ry0 disk1.dsk
#     attach ry1 disk2.dsk
#
# and boot using:
#
#     go 0
#
%SIM-INFO: RY0: buffering file in memory
sim> att ry0 rx02_kernel.bin
%SIM-INFO: RY0: buffering file in memory
sim> att ry1 rx02_system.bin
%SIM-INFO: RY1: buffering file in memory
sim> go 0

The Edison system

insert two disks and type

s if both disks are standard
0 if only disk 0 is standard
1 if only disk 1 is standard
b if both disks are blank
s

Command =

The bootloader in the config.simh file is sector 26 on the disk (location D000-D07F).

In simh the numbers are in octal
deposit 0000000 000240 = A0 00
deposit 0000002 000412 = 0A 01
etc

Other Edison systems

Edison v1 compiler/interpreter
1987, R Kym Horsell
Compiler/interpreter for the Edison language, written in C.
Edisonv1 includes:
– a C preprocessor, cpp, which handles #include and #define commands inside Edison programs.
– an Edison compiler, edcomp, that translates Edison source code into a virtual (stack) machine code.
– an Edison interpreter, edrun, that loads and links machine code files.
– a runtime system stub.
– example programs culled from various textbooks on parallel and concurrent programming.
Local copy of the archive now lost on the internet

Peter de Wachter Edison compiler archive
Compiler for Edison in C and lex

Sources of Edison (compiler, operating system)



(photos by Jos Dreessen of the disks given by Günter Dotzel)

PDP-10 Pascal compiler

Archive with the DECUS DEC-System-10 Pascal compiler, including sources.

This compiler is a descendent of the Zürich Pascal compilers.

      
      
                            Mitteilung 40
      
                        On DECSystem-10 Pascal
      
                              H.-H. Nagel
     
      
                            IFI-HH-M-40/76
      
      
                    Auf der DECUS-Konferenz am 9.9.76
      
                    in Munchen gehaltern Vortrag
      
                            On DECSystem-10 PASCAL

                                  H.-H. Nagel
                            Institute fuer Informatik
                              Universitaet Hamburg
                              Schlueterstrasse 70
                               D-2000 Hamburg 13
      
      
      These notes attempt to give some information about the pro-
      gramming language PASCAL and its implementation for the DEC-
      System-10 with the intent to induce the reader to make himself
      acquainted with the literature quoted and possibly to explore
      the applicability of PASCAL for his own programming tasks.
      
      The programming language PASCAL has been defined by Wirth /1,2/
      and implemented several times in his group /3,4,5/.  It is
      strongly recommended to read "PASCAL - User Manual and Report"
      /6/ since it contains an introduction to the language and the
      definition of Standard PASCAL together with the options im-
      plemented for the CDC 6000 series computers.  Our DECSystem-10
      implementation of PASCAL strives to contain Standard PASCAL as a 
      subset and as many of the CDC 6000 PASCAL options as possible.
      
      These short notes will not be able to convey a flavor of this
      language - for that the reader is referred to the literature
      quoted.  It may suffice to indicate the intentions behind the
      design of PASCAL by relating it to two other programming lan-
      guages which - as PASCAL - consider ALGOL 60 as their root.
      
      - SIMULA /7/ is a superset of ALGOL-60 which has been developped
        originally to provide extensions for the simulation of multiple
        process systems.  The CLASS concept has been introduced with
        SIMULA.  This concept has later proven to be a very powerful
        and fruitful addition to the field of programming languages.

        Moreover, SIMULA broadens the scope of applicability by
        introducing e.g. the character type as a basic ingredient.
        Whereas SIMULA retained ALGOL-60 as a subset and the ensue-
        ing restrictions.

      - PASCAL has been designed without accepting the preceding
        ALGOL-60 as a subset thus gaining the freedom to explore
        new grounds.  The overriding design principle has been to
        strike a balance between the language capabilities and the
        resulting implementation efforts as well as the requirements
        for the runtime support.  Therefore, PASCAL emphasizes the
        practical aspects of going beyond ALGOL-60, in contrast to

      - ALGOL 68 /8/ which emphasizes the theoretical aspects of 
        exploring the design possibilities for programming languages
        beyond ALGOL-60.


      Any attempt to strike a balance is likely to leave somebody unsatisfied.  
      It is not surprising, therefore, that the publication of PASCAL has resulted 
      in a protracted discussion of its advantages and shortcomings /9-14, 
      to quote but a few/.  This can be taken as a very healthy sign of life 
      - PASCAL is one of the very few languages which have fought their way to 
      general acceptance and wide use without the backing of a manufacture. 
      This claim is supported by the following list of computer systems for 
      which a PASCAL implementation is available

      - Burroughs B5700 and B6700
      - CDC 6000 and CDC 3600 and CDC 7600
      - CII 10070
      - HITAC 8700/8800
      - IBM 360 and IBM 370
      - ICL 1900
      - DECSystem-10 (and DECSystem-20)
      - PDP-11
      - Philips P1400
      - Systems Engineering Laboratories SEL 8600
      - TI 980 A
      - Telefunken TR 440
      - UNIVAC 1100 under EXEC 8 and 1108
      - Xerox Sigma 7
      - Dietz MINCAL 621

      Further information about PASCAL activities can be obtained
      by writing to

             PASCAL User's Group
             c/o Andy Mickel
             University Computer Center
             227 Experimental Engineering Building
             University of Minnesota
             Minneapolis/Minnesota 55455
             USA

      PASCAL has not only been accepted as a practical programming language.  
      It has - in addition - exerted a profound influence upon the design of 
      programming languages.  To give a few examples for this claim:

      - Systems Implementation Languages /e.g. 15, 16/
      - Data Base Language Extensions /e.g. 17, 18/
      - Research into Program Proving /e.g. 19, 20, 21/
          amoungst other things based upon the axiomatic definition
          of PASCAL /22/
      - Language Portability /e.g. 23, 24, 25/
      - Programming languages to facilitate the formulation of par-
          allel processes:  CONCURRENT PASCAL /26/


      Having indicated some of the more general implications of PASCAL 
      I would like to concentrate the remaining remarks on the PASCAL 
      implementation for the DECSystem-10 and the application of this 
      implementation.

      The historical development of our implementation is given in
      the following diagram

        1972        }
                }
                 }        Bootstrap attempt with CDC-6400 PASCAL compiler
                  }           (simulating a CDC-6400 on a PDP-10:
                 }                         90 minutes for compilation)
                }
                }
                }
        1973         }
                  }        Bootstrap of PASCAL-compiler for
                 }           hypothetical stack machine by simulating
                }           this stack machine on the PDP-10:  10 minutes
                }
                }
        1974         }        Upgrading the compiler into a competitive
                  }           tool for small program development
                 }
                }        Development of a version which generates
                }        relocatable object code compatible with
                }         LINK-10 and an interactive source level debugging
                }          option
                } 
                }
        1975        }
                 }        Fully implement STANDARD PASCAL
                  }
                 }
                }
        1976        }
                 }        Adapt to DECSystem-10 Concise Command Language
                  }        Add large range of options (including most of
                 }        the PASCAL-6000. ones) to provice a
                }        comfortable programming environment for
                }        large systems.


      The first two steps up until November 1973 have been described in /24/.  
      The following upgrading step and the related experiences are documented in /27/.  
      The work done since autumn 1974 has been described in /28-32/.

      Today, the DECSystem-10 PASCAL is used at our institute for
      a wide variety of teaching and research purposes as indicated
      by the following examples:


      - Introductory programming courses for students in Informatik
          since autumn 1973
      - Transfer of the Montreal Portable Compiler Writing System
          /33, 34/
      - Natural Language Understanding
      - Embedding of Relational Data Base Systems /18/
      - Dialogue Language Research /35/
      - Scene Analysis /36, 37/

      A version of our PASCAL compiler distributed in July 1975 has found 
      widespread use as exemplified by a tabulation of installations:

          Other Users of our PDP-10 PASCAL-system
          _______________________________________

                           Universities              Industry         Total
                           &amp; Colleges
        Europe                        11                 4                 15
        USA + Canada                22                15                 37
        South America                 2                                  2
        Australia                 1                                  1
                           __________________________________________
                                36                19                 55

                      e.g. Brandeis         e.g. BBN
                           Caltech              E.I. Du Pont
                           Carnegie-Mellon    Tektronix
                           Univ. of Pittsburgh
                           UC at Irvine
                           Univ. of Illinois
                           Cornell University


      One should notice the remarkable number of non-university installations 
      as an indication that PASCAL has clearly outgrown any categorization as 
      an "academic" language.  This widespread acceptance has motivated further 
      work on improving our implementation /29/.  
      This work has been completed in December 1976 including removal of errors 
      brought to our attention and incorporating formal procedure/function parameters. 
      The latter has been implemented by H. Linde at our institute based upon an 
      addition by G. V. D. Kraats under the supervision of Dr. C. Bron at Twente 
      Technical Hoogeschool /38/.  
      
      Our current PASCAL compiler version may be characterized as follows:

      Features of current PDP-10 PASCAL-system
      ________________________________________

      - 1 pass compiler for superset of STANDARD PASCAL
                High segment 28K  -  reentrant
                Low segment  19K
        compiles 62 lines per sec ( ~ 37 characters/line)
                 on KA-10
        compiler and significant part of runtime support written in
        PASCAL, rest of runtime support in well-commented MACRO-10.
      - generates relocatable object code compatible with LINK-10
      - access to FORTRAN-Library (SIN, COS, EXP, ...) built in
      - Interactive source level debugging system
      - Post Mortem Dump Facility
           covering all declared varables
           and the content of stack and heap
           can be activated interactively, too
      - Automatic Conversion of Scalar and SET-Variables for TEST-I/O!
      - Optional runtime checks for
        - value out of (sub)range
        - array indices
        - arithmetic overflow
        - zero divide
      - Can be activated via Concise Command Language
        e.g. COMPILE        LOAD        EXECUTE
      - Separate Compilation of Procedures
      - Cross reference and Indentation Program
      - PASCAL Manual for DECSystem-10 Implementation

      According to a very recent agreement with DEC, this signifi-
      cantly improved compiler version is being distributed by DECUS
      starting January 1977.

      It may be mentioned that PASCAL has been implemented as a
      cross-compiler for Dietz MINCAL 621 minicomputers at our instal-
      lation.  Moreover, a two-pass cross-compiler for CONCURRENT
      PASCAL /26/ incorporating an intermediate code step of very
      general structure for easy adaptation to byte-oriented mini-
      computers like Dietz MINCAL 621, DEC PDP-11, Interdata M85 has
      been written in PASCAL /39/.  This Concurrent PASCAL compiler
      is being used already for prociding production programs in a
      local minicomputer network for scene analysis.

     /1/ N. Wirth, The Programming Language PASCAL,
         Acta Informatica vol. 1, 35-63 (1971)

     /2/ N. Wirth, The Programming Language PASCAL, (Revised Report),
         Berichte der Fachgruppe Computerwissenschaften Nr. 5, ETH
         Zurich, July 1973

     /3/ N. Wirth, The Design of a PASCAL Compiler,
         Software - Practice and Experience vol. 1, 309-333 (1971)

     /4/ U. Ammann, The Method of Structured Programming Applied 
         to the Development of a Compiler,
         International Computing Symposium 1973, A. Gunther et al.
         (eds.), North Holland Publishing Co., Amsterdam 1974

     /5/ U. Ammann, Die Entwicklung eines PASCAL Compilers nach
         der Methode des Strukturierten Programmierens,
         Dissertation ETH Zurich 5456, Juris Druck und Verlag,
         Zurich 1975

     /6/ K. Jensen and N. Wirth, PASCAL - User Manual and Report,
         Lecture Notes in Computer Science vol. 18(1974) and Springer
         Study Edition (1975), both Springer Verlag, Berlin-Heidelberg-
         New York

     /7/ O.J. Dahl and K. Nygaard, SIMULA - an ALGOL-Based Simula-
         tion Language
         Comm. ACM vol. 9, 671-678 (1966)

     /8/ A. van Wijngaarden (ed.), B.J. Mailloux, J.E.L. Peck,
         C.H.A. Koster, Report on the Algorithmic Language Algol 68,
         Numerische Mathematik vol. 14, 79-218 (1969)

     /9/ A.N. Habermann, Critical comments on the Programming Lan-
         guage PASCAL,
         Acta Informatica vol. 3, 47-57 (1973)

    /10/ O. Lecarme and P. Desjardins, Reply to a Paper by
         A.N. Habermann on the Programming Language PASCAL,
         SIGPLAN Notices vol. 9, number 10, pp. 21-27 (1974)

    /11/ O. Lecarme and P. Desjardins, More Comments on the Pro-
         gramming Language PASCAL,
         Acta Informatica vol. 4, 231-243 (1975)

    /12/ R. Conradi, Further Critical Comments on PASCAL, Particular-
         ly as a Systems Programming Language,
         SIGPLAN Notices vol. 11, number 11, pp. 8-25 (Nov. 1976)

    /13/ N. Wirth, On the Design of Programming Languages,
         Information Processing 1974, J.L. Rosenfeld (ed.), pp. 386-
         393, North-Holland Publ. Co., Amsterdam 1974

    /14/ N. Wirth, An Assessment of the Programming Language PASCAL,
         IEEE Trans. on Software Engineering vol. 1, 192-198 (1975)

    /15/ B.L. Clark and F.J.B. Ham, The Project SUE, System Lan-
         guage Reference Manual, Techn. Report CSRG-42,
         Computer Systems Research Group, Univ. of Toronto, Canada, 1974
         
    /16/ M. Rain et al., MARY - a Portable Machine Oriented Pro-
         gramming Language,
         MOL Bulletin No. 3, 1973, Computing Centre at the Univer-
         sity, N-7034 Trondheim NTH Norway

    /17/ J.M. Smith and D.C.P. Smith, Data Base Abstraction,
         Proc. Conference on Data:  Abstraction, Definition and
         Structure, Salt Lake City/Utah, March 22-24, 1976;
         appeared in SIGPLAN Notices vol. 11 (1976) (special issue)p.71

    /18/ J.W. Schmidt, Extending PASCAL by a Data Structure Re-
         lation:  PASCAL as a Host Language for a Relational Data
         Base,
         Kurzvortrag aug der GI-Jahrestagung 29. Sept.- 1. Okt.
         1976, Stuttgart
         see also
         J.W. Schmidt, Untersuchung einer Erweiterung von PASCAL 
         zu einer Datenbanksprache,
         IfI-HH-M-28/76, Institut fuer Informatik der Universitaet
         Hamburg, Marz 1976

    /19/ Shigeru Igarashi, R.L. London and D.C. Luckham, Automatic
         Program Verification I:  A Logical Basis and its Implemen-
         tation, STAN-CS-73-365
         Stanford/Calif., May 1973

    /20/ F.W. v. Henke and D.C. Luckham, Automatic Program Verifi-
         cation III:  A Methodology for Verifying Programs,
         STAN-CS-74-474, Stanford/Calif., December 1974

    /21/ E. Marmier, Automatic Verification of PASCAL Programs,
         Dissertation ETH Zurich Nr. 5629 (1975)

    /22/ C.A.R. Hoare and N. Wirth, An Axiomatic Definition of
         the Programming Language PASCAL, Acta Informatica vol. 2,
         335-355 (1973)

    /23/ J. Welsh and C. Quinn, A PASCAL compiler for the ICL 1900
         series computer,
         Software - Practice and Experience, vol. 2, 73-77 (1972)

    /24/ G. Friesland et al., A PASCAL Compiler Bootstrapped on
         a DECSystem-10,
         Lecture Notes in Computer Science vol. 7, 101-113, Springer
         Verlag, Berlin-heidelberg-New York 1974

    /25/ K.V. Nori et al., The PASCAL-(P)-Compiler Implementation Notes
         Berichte der Fachgruppe Computerwissenschaften Nr. 10, ETH
         Zurich, Dezember 1974

    /26/ P. Brinch Hansen, The Programming Language CONNCURRENT PASCAL,
         IEEE Trans. on Software Engineering vol. 1, 199-207 (1975)

    /27/ C.-O. Grosse-Lindemann and H.-H. Nagel, Postlude to a
         PASCAL-Compiler Bootstrap on a DECSystem-10,
         Software - Practice and Experience vol. 6, 29-42 (1976)

    /28/ Erweiterung von Sprachdefinition, Compiler und Laufzeit-
         unterstutzung bei PASCAL-Erfahrungen und Ergebnisse eines
         Praktikumsprojektes im Informatik-Grundstudium, studenti-
         sche Beitrage, uberarbeitet und erganzt von H.-H. Nagel,
         Mitteilung Nr. 16 des Instituts fur Informatik der Uni-
         versitat Hamburg, Mai 1975

    /29/ H.-H. Nagel, PASCAL for the DECSystem-10:  Experiences
         and further Plans,
         Mitteilung Nr. 21 des Instituts fur Informatik der Univer
         sitat Hamburg, November 1975

    /30/ B. Nebel and B. Pretschner, Erweiterung des DECSystem-10
         PASCAL-Compilers um eine Moglichkeit zur Erzeugung eines
         Post-Mortem-Dump,
         Mitteilung IfI-HH-M-34/76, Institut fur Informatik der
         Universitat Hamburg, Juni 1976

    /31/ P. Putfarken, Pruefhilfen fuer PASCAL-Programme, Diplom-
         arbeit, Institut fur Informatik der Universitat Hamburg,
         November 1976

    /32/ E. Kisicki and H.-H. Nagel, PASCAL for the DECSystem-10,
         Manual,
         Mitteilung IfI-HH-M-37/76, Institut fur Informatik der
         Universitat Hamburg, Dezember 1976
         (This manual is available as a computer readable file)

    /33/ O. Lecarme and G.V. Bockmann, A (truly) Usable and Port-
         able Compiler Writing System,
         Information Processing 1974, J.L. Rosenfeld (ed.),
         North-Holland Publ. Co., Amsterdam 1974, pp. 218-221

    /34/ M. Behrens and G. Friesland, Benutzungsanleitung fuer das 
         Compiler-Writing-System Montreal, angepasst an das DEC-
         System-10,
         IfI-HH-M-30/76, Institut fur Informatik der Universitat
         Hamburg, April 1976

    /35/ I. Kupka, H. Oberquelle and N. Wilsing, Projekt einer
         Rahmendialogsprache - RDS,
         IfI-HH-M-9/74, Institut fur Informatik der Universitat
         Hamburg, Oktober 1974

    /36/ H.-H. Nagel, Experiences with Yakimovsky's Algorithm
         for Boundary and Object Detection in Real World Images,
         Proc. 3rd International Joint conference on Pattern Re-
         cognition, Coronado/Cal., November 8-11, 1976, pp. 753-758


    /37/ H.-H. Nagel, Formation of an Object Concept by Analysis
         of Systematic Time Variations in the Optically Percep-
         tible Environment,
         Computer Graphics and Image Processing (in press)

    /38/ G.V.D. Kraats, Diploma Thesis, Dr. Bron (Supervisor),
         Technische Hogeschool Twente, Enschede

    /39/ B. Bruegge et al., Concurrent Pascal Compiler fuer Klein-
         rechner,
         Institut fur Informatik der Universitat Hamburg, Dezember
         1976