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

      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 

      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
                           & 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
         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
         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,
         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-
         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-
         Institut fur Informatik der Universitat Hamburg, Dezember