MITTEILUNG NR. 37 PASCAL for the DECSystem-10 by E. KISICKI and H.-H. NAGEL IFI - HH - M - 37 / 76 NOVEMBER 1976 - 1- Contents ======== 1. Usage of the PASCAL Compiler 1.1. How to Use the Concise Command Language for PASCAL 1.2. How to Use the Compiler Directly 1.3. How to Run a PASCAL Program 1.4. Lexical Issues 1.5. Compiler Directives 1.5.1. Summary 1.5.2. Selective Use of Compiler-Options 2. The Program Heading 2.1. Substitution of the Program Parameters 2.2. Passing Parameters with CMD- and TEMPCORE-files 3. Labels 4. Input and Output 4.1. Standard Files 4.2. Formatted Input/Output 4.2.1. Formatted Input 4.2.2. Formatted Output 4.3. The Use of Printer Control Characters 5. Extensions to PASCAL 5.1. Standard Constants 5.2. Standard Types 5.3. Standard Files 5.4. The INITPROCEDURE 5.5. The Extended CASE Statement 5.6. The LOOP Statement 5.7. Standard Procedures and Functions 5.7.1. PACK and UNPACK 5.7.2. DATE and TIME 5.7.3. CLOCK and REALTIME 5.7.4. FIRST and LAST 5.7.5. LOWERBOUND and UPPERBOUND 5.7.6. MIN and MAX 5.7.7. NEW and DISPOSE 5.7.8. TRUNC, ROUND and EXPO 5.7.9. OPTION and GETOPTION 5.7.10. HALT and CALL 5.7.11. GETFILENAME and GETSTATUS 5.7.12. RESET and REWRITE 5.7.13. BREAK and MESSAGE 5.7.14. GETLN and GETLINENR 5.7.15. PUTLN and PAGE 5.7.16. EOLN and EOF 5.8. Procedures and Functions as Parameters 6. External Programs 6.1. Declaration of External Procedures and Functions 6.2. How to Compile External Programs 6.3. How to Create a Program Library 7. The PASCAL DEBUG-system 7.1. Commands 7.2. Program Interrupts 7.3. How to Debug External Programs - 2- 8. Tables 8.1. Operations 8.1.1. Summary 8.1.2. Precedence 8.2. Reserved Words 8.3. Standard Procedures and Functions 8.3.1. Procedures 8.3.2. Functions 8.4. Run-time Error Messages 8.5. ASCII Table 9. Miscellaneous 9.1. Implementation Restrictions 9.2. Known Bugs 9.3. Utility Programs 10. References - 3- Preface ======= The PASCAL compilers for the DECSystem-10 were developed at the university of Hamburg, Germany, based on an early version of the transportable PASCAL-P compiler [4,5,6]. Work still continues on improving this compiler with respect to efficiency, standardization and the addition of still missing or desirable language features [7]. This report is intended to familiarize the reader with the PASCAL dialect on the DECSystem-10. This description refers to a DECSystem-10 compiler with the name PASCAL that will accept STANDARD PASCAL (and some features of PASCAL 6000-3.4) as defined by Wirth in [2] as a subset. It should be noted that earlier compiler versions or special purpose Load-and-Go PASCAL compilers might accept a modified PASCAL language not compatible with STANDARD PASCAL and its extensions as accepted by this compiler. It is assumed that the reader has a basic knowledge about PASCAL. Within syntax definitions, terms enclosed in "[]" are optional and terms enclosed in "[]*" may appear zero or more times. The word "or" or a vertical bar "|" indicate alternative terms. This report evolved from a PASCAL HELP file originally written in German which has been translated into English by Burger [11]. This version has been completely reworked from the english version. We gratefully acknowledge the help of B.Gisch and H.Linde in editing this report. - 4- 1. Usage of the PASCAL Compiler ================================ 1.1. How to Use the Concise Command Language for PASCAL ------------------------------------------------------- If the installation has modified the DECSystem-10 Concise Command Language (CCL) handler [8] to detect the extension PAS and activate the PASCAL compiler, one simply has to use the standard CCL commands. Options, as described in Section 1.5., may be appended according to the CCL conventions. These commands, called "COMPIL-class" commands, are defined as follows: ::= [=] [@] [] [] ::= COMPILE or LOAD or EXECUTE ::= (