Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home

HP Pascal/HP-UX Programmer's Guide

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

HP Part Number: 92431-90014

Edition: Sixth Edition

Published: August 1992


Table of Contents

Printing History
Preface
Conventions
1 Introduction
Introduction
2 Program Structure
Introduction
Syntactic Structure
Program Heading
Program Block
Compilation Unit Structure
Modules
Global, Subprogram, and External Compilation Units
Separate Compilation
Using Modules
Using SUBPROGRAM
Using GLOBAL/EXTERNAL
Using SUBPROGRAM with GLOBAL
External Interfaces
3 Input/Output
Introduction
General File Information
Physical Files
Logical Files
Textfiles
Current Position Indexes
File Buffer Variables and Selectors
Opening Files
Associate Procedure
Disassociate Procedure
Sequential Input/Output
Textfile Input/Output
Direct Input/Output
Closing Files
4 Predefined Pascal Constants, Data Types, and Modules
Introduction
Values of Predefined Constants
Ranges of Predefined Data Types
Bit16
Bit32
Bit52
Shortint
Longint
Predefined Modules
stdinput
stdoutput
stderr
arg
pas_hp1000
5 Allocation and Alignment
Introduction
Allocation, Alignment, and Packing Algorithm
Unpacked Variables
Packed Variables
Arrays
Records
Packed Arrays
Packed Records
Crunched Arrays and Records
Crunched Sets
Enumerations and Subranges
Unpacked Enumeration or Unsigned Subranges
Packed Array Elements of Enumeration or Subrange Types
Packed Record Elements of Enumeration or Subrange Types
Files
Sets
Strings
6 Dynamic Variables
Introduction
GLOBALANYPTR Variables
LOCALANYPTR Variables
New Procedure
Dispose Procedure
Mark and Release Procedures
P_getheap and P_rtnheap Procedures
Getheap and Rtnheap Procedures
7 Parameters
Introduction
Value versus Reference Parameters
ANYVAR Parameters
READONLY Parameters
Conformant Array Parameters
Routines as Parameters
Routine Parameters
Parameters of Routine Types
Variables of Routine Types
Call Procedure
Fcall Function
Congruent Parameter Lists
Hidden Parameters
ANYVAR Parameters
Generic String Parameters
Extensible Parameter List
Multidimensional Conformant Array Parameters
Routine Parameters
EXTERNAL SPL VARIABLE
8 Procedure Options
Introduction
EXTENSIBLE
DEFAULT_PARMS
Haveoptvarparm Function
Haveextension Function
UNCHECKABLE ANYVAR
UNRESOLVED
INLINE
9 External Routines
Introduction
EXTERNAL Directive
Calling HP C from HP Pascal
Calling COBOL II from HP Pascal
Calling FORTRAN 77 from HP Pascal
Calling FORTRAN 66/V from HP Pascal
Calling SPL from HP Pascal
Switch Stubs
How Non-Pascal Programs Call Pascal Routines
How To Do Pascal I/O with a Non-Pascal Outer Block
10 Intrinsics
Introduction
Using Intrinsics
Specifying Intrinsic Files
INTRINSIC Directive
Actual and Intrinsic Parameter Compatibility
Formal and Intrinsic Function Type Compatibility
User-Defined Formal Parameters
Using Intrinsic Functions as Procedures
Defining Intrinsics
How to Build or Change an Intrinsic File
11 Error Recovery and Debugging
Introduction
Error Recovery
Escape Procedure
Escapecode Function
TRY-RECOVER Construct
TRY-RECOVER and Optimization
Assert Procedure
Traps
ARITRAP and HPENBLTRAP Intrinsics
XLIBTRAP Intrinsic
XARITRAP Intrinsic
XCONTRAP Intrinsic
HP TOOLSET/XL and HP Symbolic Debuggers
System Debuggers
12 The Optimizer
Introduction
When to Use the Optimizer
Invoking the Optimizer
Basic Blocks
Level One Optimization
Branch Optimization
Dead Code Elimination
Faster Register Allocation
Instruction Scheduling
Peephole Optimization
Real Expression Folding
Level Two Optimization
Coloring Register Allocation
Induction Variable Elaboration and Strength Reduction
Common Subexpression Elimination
Constant Folding
Loop-Invariant Code Motion
Store-Copy Optimization
Unused Definition Elimination
Optimizer Assumptions
Writing Programs That Are Easily Optimized
What to Do If the Optimized Program Fails
A MPE/iX Dependencies
System-Dependent Features
Compiler Options
File Names
Associating Logical and Physical Files
Using File Equations
Default File Attributes
Standard Modules
Additional Features
Restrictions on Using Executable Libraries (XLs)
MPE/iX Extensions
ccode Function
Fnum Function
Get_alignment Function
Statement_number Function
Setconvert Procedure
Strconvert Procedure
Pascal/V Packing Algorithm
Compiling, Linking, and Running Your Program
Command Files
:RUN PASCALXL.PUB.SYS
Run-Time Parameters
B HP-UX Dependencies
System Dependent Features
Compiler Options
File Names
Standard Modules
Additional Features
HP-UX Extensions
Accessing Special Global Variables
Fnum Function
Get_alignment Function
Statement_number Function
Compiling, Linking, and Running Your Program
pc Command
Run-Time Parameters
Associating Program Header Files with Run-Time Parameters
Interrupt Handling
Run-Time Error Handling
Compiling for Different Versions of the PA-RISC Architecture
Using +DA to Generate Code for a Specific Version of PA-RISC
Using +DS to Specify Instruction Scheduling
Guidelines for Using +DA and +DS
Compiling in Networked Environments
Glossary
Index

List of Figures

1-1 Relationship Between HP Pascal and Other Pascals
2-1 Syntactic Structure of a Program
2-2 Program Block Example
2-3 Syntactic Structure of a Module
2-4 Program Structure Example
2-5 What a Module Can Access
3-1 Relationships Between I/O Varieties and File Types
3-2 File Relationships
3-3 Relationship Between Current Position Index and Current Component
3-4 Associate Procedure Example
3-5 Effect of Associate Procedure on Open File
3-6 Effect of Associate Procedure on Open File
5-1 Allocation and Alignment Example 1
5-2 Allocation and Alignment Example 2
5-3 Allocation and Alignment Example 3
5-4 Array Example 1
5-5 Array Example 2
5-6 TRUE Variant
5-7 FALSE Variant
5-8 Records Example 1
5-9 Records Example 2
5-10 Records Example 3
5-11 Records Example 4
5-12 Packed Array Example 1
5-13 Packed Array Example 2
5-14 Crunched Arrays and Records Example 1
5-15 Crunched Arrays and Records Example 2
5-16 Crunched Arrays and Records Example 3
5-17 Crunched Arrays and Records Example 4
5-18 Enumerations and Subranges Example 1
5-19 Enumerations and Subranges Example 2
5-20 Enumerations and Subranges Example 3
5-21 Sets Example 1
5-22 Sets Example 2
5-23 String Byte Allocation
5-24 Strings Example 1
5-25 Strings Example 2
9-1 How a Switch Stub Works
11-1 Title not available (TRY-RECOVER Construct )
11-2 Title not available (TRY-RECOVER Construct )
11-3 How the Predefined Procedure Assert Works
12-1 Title not available (Instruction Scheduling )
12-2 Title not available (Instruction Scheduling )
A-1 Title not available (File Names )
A-2 Title not available (Arrays )
A-3 Title not available (Arrays )
A-4 Title not available (Records )
A-5 Title not available (Records )
A-6 Title not available (Records )
A-7 Title not available (Records )
A-8 Title not available (Sets )
A-9 Title not available (Sets )
A-10 Title not available (Strings )
A-11 Title not available (Strings )
A-12 Title not available (Strings )
A-13 Title not available (Packed Enumerations )
A-14 Title not available (Packed Enumerations )
A-15 Title not available (Packed Enumerations )
A-16 Title not available (Packed Enumerations )
A-17 Title not available (Packed Subranges of Enumerations )
A-18 Title not available (Packed Subranges of Enumerations )
A-19 Title not available (Packed Subranges of Enumerations )
A-20 Title not available (Packed Subranges of Enumerations )
A-21 Title not available (Packed Subranges of Integers )
A-22 Title not available (Packed Subranges of Integers )
A-23 Title not available (Packed Subranges of Integers )
A-24 How Source Code Becomes a Running Program on MPE/iX
B-1 How a File Becomes a Running Program on HP-UX

List of Tables

Document Print History
1-1 HP Pascal/HP Subsystem Interface Examples
1-2 HP Pascal/Debugger Interface Examples
3-1 Categories of Input/Output Routines
3-2 Characteristics of File-Opening Procedures
3-3 Characteristics of Associate Procedure
3-4 Characteristics of Sequential I/O Procedures
3-5 Characteristics of Sequential File Functions
3-6 Characteristics of Textfile I/O Procedures
3-7 Characteristics of Textfile Functions
3-8 Characteristics of Direct I/O Procedures
3-9 Characteristics of Direct File Functions
4-1 Title not available (Values of Predefined Constants )
4-2 Ranges and Sizes of Predefined HP Pascal Types
5-1 Allocation and Alignment of Unpacked Variables (HP Pascal Packing Algorithm)
5-2 Allocation and Alignment of Packed Variables (HP Pascal Packing Algorithm)
5-3 Title not available (Arrays )
5-4 Array Documentation Map
5-5 Allocation and Alignment of Packed Array Elements (HP Pascal Packing Algorithm)
5-6 Allocation and Alignment of Packed Record Fields (HP Pascal Packing Algorithm)
5-7 Allocation of Crunched Array Elements and Record Fields (HP Pascal Packing Algorithm)
5-8 Allocation and Alignment of Crunched Sets in Arrays and Records (HP Pascal Packing Algorithm)
5-9 Allocation and Alignment of Unpacked Enumeration or Unsigned Subrange Variables (HP Pascal Packing Algorithm)
5-10 Allocation and Alignment of Packed Array Elements of Enumeration or Subrange Type (HP Pascal Packing Algorithm)
5-11 Allocation of File Components (HP Pascal Packing Algorithm)
5-12 Title not available (Files )
5-13 How Set Chunk Size Is Determined (HP Pascal Packing Algorithm)
5-14 Bit and Set Chunk Requirements for Boolean, Char, and Integer Types (HP Pascal Packing Algorithm)
6-1 Dynamic versus Static Variables
7-1 Comparison of Kinds of Formal Parameters
7-2 Routine Parameters versus Parameters of Routine Type
7-3 Hidden Parameters
7-4 Title not available (ANYVAR Parameters )
7-5 Title not available (Multidimensional Conformant Array Parameters )
7-6 Title not available (Routine Parameters )
7-7 Title not available (EXTERNAL SPL VARIABLE )
8-1 Title not available (EXTENSIBLE )
8-2 Values Passed to Formal Parameter x
8-3 Title not available (Haveoptvarparm Function )
8-4 Values Returned by Haveoptvarparm(x)
8-5 Title not available (Haveextension Function )
8-6 Values Returned by Haveextension(x)
9-1 Corresponding HP Pascal and HP C Types
9-2 Corresponding HP Pascal and Cobol II Types
9-3 Corresponding HP Pascal and FORTRAN 77 or FORTRAN 66/V Types
9-4 Corresponding HP Pascal and SPL Types
10-1 Intrinsic-Compatible Intrinsic and Actual Reference Parameter Types
10-2 Intrinsic-Compatible Intrinsic and Actual Value Parameter Types
10-3 Intrinsic-Compatible Intrinsic and Formal Reference Parameter Types
10-4 Compatible Intrinsic and Formal Reference Parameter Types
10-5 Intrinsic-Compatible Intrinsic and Formal Value Parameter Types
12-1 Unoptimized and Optimized Branch Instruction Sequences
12-2 Title not available (Real Expression Folding )
A-1 Default File Attributes
A-2 Allocation and Alignment of Unpacked Variables (Pascal/V Packing Algorithm)
A-3 Allocation and Alignment of Packed Array Elements (Pascal/V Packing Algorithm)
A-4 Allocation and Alignment of Packed Record Fields (Pascal/V Packing Algorithm)
A-5 Bit and Byte Pair Requirements for Boolean, Char, and Integer Base Types (Pascal/V Packing Algorithm)
A-6 Allocation and Alignment of Enumeration Elements of Packed Arrays (Pascal/V Packing Algorithm)
A-7 Allocation and Alignment of Enumeration Fields of Packed Records (Pascal/V Packing Algorithm)
A-8 Allocation and Alignment of Enumeration-of-Subrange Elements of Packed Arrays (Pascal/V Packing Algorithm)
A-9 Allocation and Alignment of Elements of Packed Arrays of Subrange Type (Pascal/V Packing Algorithm)
A-10 MPE/iX Command Files That Compile, Link, and Run a Program
A-11 Equivalent MPE V Commands and MPE/iX Command Files
A-12 PARM Values and Their Meanings
Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.