CONTENTS Title Page Copyright Page Preface 1 Compiling DEC Pascal Programs 1.1 PASCAL Command 1.1.1 PASCAL Command Examples 1.1.2 PASCAL Qualifiers 1.1.3 Contents of the Compilation Listing File 1.1.3.1 Table of Contents (OpenVMS VAX systems only) 1.1.3.2 Source Code 1.1.3.3 Cross-Reference Section 1.1.3.4 Machine Code Section 1.1.3.5 Structured Layout Section 1.1.3.6 Inline Summary (OpenVMS VAX systems only) 1.1.3.7 Compilation Statistics 1.1.4 Text Libraries 1.1.4.1 Using the %INCLUDE Directive for Text Libraries 1.1.4.2 Specifying Text Libraries on the PASCAL Command Line 1.1.4.3 Defining Default Libraries 1.2 LINK Command 1.2.1 LINK Command Examples 1.2.2 LINK Qualifiers 1.2.3 Object Module Libraries 1.3 RUN Command 1.4 Error Messages 2 Separate Compilation 2.1 The ENVIRONMENT, HIDDEN, and INHERIT Attributes 2.2 Interfaces and Implementations 2.3 Data Models 2.4 Separate Compilation Examples 3 Program Correctness, Optimization and Efficiency 3.1 Compiler Optimizations 3.1.1 Compile-Time Evaluation of Constants 3.1.2 Elimination of Common Subexpressions 3.1.3 Elimination of Unreachable Code 3.1.4 Code Hoisting from Structured Statements 3.1.5 Inline Code Expansion for Predeclared Functions 3.1.6 Inline Code Expansion for User-Declared Routines 3.1.7 Testing for Inline Expansion on OpenVMS VAX Systems 3.1.8 Operation Rearrangement 3.1.9 Partial Evaluation of Logical Expressions 3.1.10 Value Propagation 3.1.11 Strength Reduction (OpenVMS Alpha systems only) 3.1.12 Split Lifetime Analysis (OpenVMS Alpha systems only) 3.1.13 Code Scheduling (OpenVMS Alpha systems only) 3.1.14 Loop Unrolling (OpenVMS Alpha systems only) 3.1.15 Alignment of Compiler-Generated Labels 3.1.16 Error Reduction Through Optimization 3.1.17 Software Pipelining (OpenVMS Alpha systems only) 3.1.18 Processor Tuning (OpenVMS Alpha systems only) 3.1.19 Compiling for Optimal Performance 3.2 Programming Considerations 3.3 Implementation-Dependent Behavior 3.3.1 Subexpression Evaluation Order 3.3.2 MAXINT and MAXINT64 Predeclared Constants 3.3.3 Pointer References 3.3.4 Variant Records 3.3.5 Atomicity, Granularity, Volatility, and Write Ordering 3.3.6 Debugging Considerations 4 Programming Tools 4.1 Debugger Support for DEC Pascal 4.2 DEC Language-Sensitive Editor/Source Code Analyzer Support for DEC Pascal 4.2.1 Programming Language Placeholders and Tokens 4.2.2 Placeholder and Design Comment Processing 4.2.3 LSE and SCA Examples 4.3 Accessing CDD/Repository from DEC Pascal 4.3.1 Equivalent DEC Pascal and CDDL Data Types 4.3.2 CDD/Repository Example 5 Calling Conventions 5.1 OpenVMS Calling Standard 5.1.1 Parameter Lists 5.1.2 Function Return Values 5.1.3 Contents of the OpenVMS Alpha Call Stack 5.1.4 Contents of the OpenVMS VAX Call Stack 5.1.5 Unbound Routines 5.2 Parameter-Passing Semantics 5.3 Parameter-Passing Mechanisms 5.3.1 By Immediate Value Passing Mechanism 5.3.2 By Reference Passing Mechanism 5.3.3 By Descriptor Passing Mechanism 5.3.3.1 CLASS_S Attribute 5.3.3.2 CLASS_A and CLASS_NCA Attributes 5.3.3.3 %STDESCR Mechanism Specifier 5.3.3.4 %DESCR Mechanism Specifier 5.3.4 Summary of Passing Mechanisms and Passing Semantics 5.4 Passing Parameters between DEC Pascal and Other Languages 5.4.1 Parameter Mechanisms Versus Parameter Semantics 5.4.2 Passing Non-routine Parameters between DEC Pascal and Other Languages 5.4.3 Passing Routine Parameters between DEC Pascal and Other Languages 6 Programming on OpenVMS Systems 6.1 Using System Definitions Files 6.2 Declaring System Routines 6.2.1 Methods Used to Obtain OpenVMS Data Types 6.2.2 Methods Used to Obtain Access Methods 6.2.3 Methods Used to Obtain Passing Mechanisms 6.2.4 Data Structure Parameters 6.2.5 Default Parameters 6.2.6 Arbitrary Length Parameter Lists 6.3 Calling System Routines 6.4 Using Attributes 6.5 Using Item Lists 6.6 Using Foreign Mechanism Specifiers on Actual Parameters 7 Input and Output Processing 7.1 Environment I/O Support 7.1.1 Indexed Files 7.1.2 OpenVMS Components and RMS Records 7.1.3 Count Fields for Variable-Length Components 7.1.4 Variable-Length with Fixed-Length Control Field (VFC) Component Format 7.1.5 Random Access by Record File Address (RFA) 7.1.6 OPEN Procedure 7.1.6.1 OPEN Defaults 7.1.6.2 OPEN and RMS Data Structures 7.1.7 Default Line Limits 7.2 User-Action Functions 7.3 File Sharing 7.4 Record Locking 8 Error Processing and Condition Handling 8.1 Condition Handling Terms 8.2 Overview of Condition Handling 8.2.1 Condition Signals 8.2.2 Handler Responses 8.3 Writing Condition Handlers 8.3.1 Establishing and Removing Handlers 8.3.2 Declaring Parameters for Condition Handlers 8.3.3 Handler Function Return Values 8.3.4 Condition Values and Symbols 8.4 Fault and Trap Handling (OpenVMS VAX systems only) 8.5 Examples of Condition Handlers 9 Migrating from OpenVMS VAX to OpenVMS Alpha 9.1 Sharing Environment Files Across Platforms 9.2 Default Size for Enumerated Types and Booleans 9.3 Default Data Layout for Unpacked Arrays and Records 9.4 Overflow Checking 9.5 Bound Procedure Values 9.6 Different Descriptor Classes for Conformant Array Parameters 9.7 Data Layout and Conversion 9.7.1 Natural Alignment, VAX Alignment, and Enumeration Sizes 9.7.2 DEC Pascal Features Affecting Data Alignment and Size 9.7.3 Optimal Record Layout 9.7.4 Optimal Data Size 9.7.5 Converting Existing Records 9.7.6 Applications with No External Data Dependencies 9.7.7 Applications with External Data Dependencies A Errors Returned by STATUS and STATUSV Functions B Entry Points to DEC Pascal Utilities B.1 PAS$FAB( f ) B.2 PAS$RAB( f ) B.3 PAS$MARK2( s ) B.4 PAS$RELEASE2( p ) C Diagnostic Messages C.1 Compiler Diagnostics C.2 Run-Time Diagnostics