[an error occurred while processing this directive]
HP OpenVMS Systems Documentation |
HP Pascal for OpenVMSUser ManualOrder Number: AA-PXSND-TK
January 2005
This manual contains information about selected programming tasks using the HP Pascal programming language. Revision/Update Information: This revised manual supersedes the Compaq Pascal User Manual for OpenVMS Systems, Version 5.7.
Operating System:
OpenVMS I64 Version 8.2 or higher
Software Version:
HP Pascal for OpenVMS I64 Systems Version 5.9
© Copyright 2005 Hewlett-Packard Development Company, L.P. Confidential computer software. Valid license from HP required for possession, use or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor's standard commercial license. The information contained herein is subject to change without notice. The only warranties for HP products and services are set forth in the express warranty statements accompanying such products and services. Nothing herein should be construed as constituting an additional warranty. HP shall not be liable for technical or editorial errors or omissions contained herein. Intel and Itanium are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries. Printed in the US
ZK6140 This manual is available on CD-ROM.
PrefaceThis manual describes selected programming tasks using the HP Pascal programming language. It contains information on using some HP Pascal language elements in combination, and it provides examples of how to improve programming efficiency. You can use the information in this manual to write programs or modules for the OpenVMS operating system. If you need to write HP Pascal programs or modules that must be compiled by another compiler, see the HP Pascal for OpenVMS Language Reference Manual for a checklist of language extensions not included in the Pascal standard. The HP Pascal for OpenVMS Language Reference Manual also provides information on the Pascal standard. Intended AudienceThis manual is intended for experienced applications programmers with a firm understanding of the Pascal language. Some familiarity with the operating system is helpful. Document StructureThis manual contains the following chapters and appendixes:
Related DocumentsThe following manuals are also part of the HP Pascal documentation set:
Reader's CommentsHP welcomes your comments on this manual. Please send comments to either of the following addresses:
HP Pascal Home PageYou can access the HP Pascal home page at:
ConventionsThe following product names may appear in this manual:
All three names---the longer form and the two abbreviated forms---refer to the version of the OpenVMS operating system that runs on the Intel® Itanium® architecture. The following typographic conventions might be used in this manual:
Chapter 1
|
PASCAL [[{/command-qualifier}...]] {file-spec[[{/file-qualifier}...]]}
/qualifier [[=
|
/command-qualifier
The name of a qualifier that indicates special processing to be performed by the compiler on all files listed.file-spec
The name of one of the following:
- The input source file that contains the program or module to be compiled. If you separate multiple source file specifications with commas, the programs are compiled separately. If you separate the file specifications with plus signs, the files are concatenated and compiled as one program.
The default file type for an input file is either .PAS (source file) or .TLB (text-library module).- The output file used only with the /ANALYSIS_DATA, /ENVIRONMENT, /LIST, /OBJECT, or /DIAGNOSTICS qualifiers.
/file-qualifier
The name of a qualifier that indicates special processing to be performed by the compiler on the files to which the qualifier is attached.identifier
The name of one or more options that modify the /ALIGN, /CHECK, /DEBUG, /DESIGN, /FLOAT, /OPTIMIZE, /SHOW, /STANDARD, /TERMINAL, and /USAGE qualifiers.n
The value of an integer constant. When used with the /ERROR_LIMIT qualifier, this parameter indicates the maximum number of errors to be detected before compilation ceases. When used with the /OPTIMIZATION=LEVEL=n qualifier, this parameter indicates a specific level of optimization.name=value
The definition of a constant or name with the specified value when used with the /CONSTANT qualifier.directory
The input directory that contains the include file, environment file, or text library processed by a %INCLUDE directive or [INHERIT] attribute when used with the /INCLUDE qualifier.
This section contains examples of PASCAL command lines.
$ PASCAL/LIST [DIR]M |
The source file M.PAS in directory [DIR] is compiled, producing an object file named M.OBJ and a listing file named M.LIS. The compiler places the object and listing files in the default directory.
$ PASCAL/LIST A, B, C |
Source files A.PAS, B.PAS, and C.PAS are compiled as separate files, producing object files named A.OBJ, B.OBJ, and C.OBJ, and listing files named A.LIS, B.LIS, and C.LIS.
$ PASCAL X + Y + Z |
$ PASCAL A, B, C+D/LIST, F |
$ PASCAL A + CIRC/NOOBJECT + X |
This command completely suppresses the object file; that is, source
files A.PAS, CIRC.PAS, and X.PAS are concatenated and compiled, but no
object file is produced.
1.1.2 PASCAL Qualifiers
This section describes the command and file qualifiers that you can use when compiling code.
/ALIGN=keyword
Controls the default alignment rules. Note that specifying the ALIGN attribute overrides any value that was previously specified for the /ALIGN qualifier.Table 1-1 lists the values for keyword.
Table 1-1 /ALIGN Qualifier Options Option Action Default Information NATURAL 1 Uses natural alignment when positioning record fields or array components. Natural alignment is when a record field or an array component is positioned on a boundary based on its size. For example, 32-bit integers are aligned on the nearest 32-bit boundary. Default on OpenVMS I64 and OpenVMS Alpha systems if /ALIGN is not specified. VAX Uses byte alignment when positioning record fields or array components. Record fields or array components larger than 32 bits are positioned on the nearest byte boundary. Default on OpenVMS VAX systems if /ALIGN is not specified.
Option | Action | Default Information |
---|---|---|
GENERIC | Generate instructions that are appropriate for all Alpha processors. | This option is the default. |
HOST | Generate instructions for the processor on which the compiler is running (for example, EV56 instructions on an EV56 processor, and EV4 instructions on an EV4 processor). | |
EV4,
EV5 |
Generate instructions for the EV4 processor (21064, 20164A, 21066, and 21068 chips) and EV5 processor (some 21164 chips). (Note that the EV5 and EV56 processors both have the same chip number - 21164.) | |
EV56 |
Generate instructions for EV56 processors (some 21164 chips). This
option permits the compiler to generate any EV4 instruction, plus any
instructions contained in the BWX extension.
Applications compiled with this option may incur emulation overhead on EV4 and EV5 processors. |
|
PCA56 | Generate instructions for PCA56 processors (21164PC chips). This option permits the compiler to generate any EV4 instruction, plus any instructions contained in the BWX and MAX extensions. However, HP Pascal does not generate any of the instructions in the MAX (multimedia) extension to the Alpha architecture. | |
EV6 |
Generate instructions for EV6 processors (21264 chips). This option
permits the compiler to generate any EV4 instruction, any instruction
contained in the BWX and MAX extensions, plus any instructions added
for the EV6 chip. These new instructions include a floating-point
square root instruction (SQRT), integer/floating-point register
transfer instructions, and additional instructions to identify
extensions and processor groups.
Applications compiled with this option may incur emulation overhead on EV4, EV5, EV56, and PCA56 processors. |
|
EV6 |
Generate instructions for EV7 processors (21364 chips).
This option permits the compiler to generate any EV67 instruction. There are no additional instructions available on the EV7 processor, but the compiler does have different instruction scheduling and prefetch rules for tuning code for the EV7. Applications compiled with this option may incur emulation overhead on EV4, EV5, EV56, and PCA56 processors. |
|
EV67,
EV68 |
Generate instructions for EV67 and EV68 processors (21264A chips).
This option permits the compiler to generate any EV6 instruction, plus the new bit count instructions (CTLZ, CTPOP, and CTTZ). However, HP Pascal does not currently generate any of the new bit count instructions, and the EV67 and EV68 have identical instruction scheduling models, so the EV67 and EV68 are essentially identical to the EV6. Applications compiled with this option may incur emulation overhead on EV4, EV5, EV56, and PCA56 processors. |
Beginning with OpenVMS Alpha V7.1 and continuing with subsequent versions, the operating system includes an instruction emulator. This capability allows any Alpha chip to execute and produce correct results from Alpha instructions, regardless of whether some of the instructions are not implemented on the chip. Applications using emulated instructions will run correctly, but may incur significant emulation overhead at run time.
If you specify NOACCURACY_SENSITIVE, the compiler is free to reorder floating-point operations based on algebraic identities (inverses, associativity, and distribution). This allows the compiler to move additional floating-point operations outside of loops or reduce or remove floating-point operations totally, thereby improving performance.
The default, ACCURACY_SENSITIVE, directs the compiler to avoid certain floating-point trasformations that might slighly affect the program's accuracy.
The system issues an error message and normally terminates execution if any of the conditions in the options list occur. Table 1-3 lists the available checking options, their corresponding actions, and their negations.
Option | Action | Negation |
---|---|---|
ALL | Generates checking code for all options. | NONE |
BOUNDS | Verifies that an index expression is within the bounds of an array's index type, that character-string sizes are compatible with the operations being performed, and that schemata are compatible. | NOBOUNDS |
CASE_SELECTORS | Verifies that the value of a case selector is contained in the corresponding case-label list. | NOCASE_SELECTORS |
DECLARATIONS | Verifies that schema definitions yield valid types and that uses of GOTO from one block to an enclosing block are correct. Also controls whether the ASSERT statement is processed. | NODECLARATIONS |
OVERFLOW | Verifies that the result of an integer computation does not exceed the machine representation. | NOOVERFLOW |
POINTERS | Verifies that the value of a pointer variable is not NIL. | NOPOINTERS |
SUBRANGE | Verifies that values assigned to variables of subrange types are within the subrange; verifies that a set expression is assignment compatible with a set variable; verifies that MOD operates on positive numbers. | NOSUBRANGE |
The BOUNDS and DECLARATIONS options are the only checking options enabled by default. The /CHECK qualifier without options is equivalent to /CHECK=ALL. The negation /NOCHECK is equivalent to /CHECK=NONE.
The CHECK attribute in the source program or module overrides the /CHECK qualifier on the command line.
name is the name of a Pascal constant to create. You cannot define any predeclared Pascal name by the command line.
value can be one of the following:
Nonbase-10 integer literals are not supported on the command line. For example:
$ PASCAL/CONSTANT=(DEBUG=TRUE,MAXSIZE=10,OFFSET=-10,IDENT="V1.0") |
Note that the definition of /CONSTANT is such that DCL does not remove any double-quote characters used in the name=value clauses. All characters are literally passed to the compiler for processing. This behavior is slightly different from the usual behavior of putting items in double quotes on DCL commands to preserve the case, but not to pass the double quotes to the target application.
This definition of /CONSTANT allows you to define Pascal string literals with embedded single quotes and for DCL symbol substitutions. For example,
$ PASCAL/CONSTANT=MSG="Special compile run for Monday" $ IDENT = "V1.0" $ PASCAL/CONSTANT=MSG="''IDENT'" |
Inserting double-quote characters and inserting adjacent single-quote characters can be accomplished by using the \ escape character allowed in HP Pascal double-quoted string constants.
Next | Contents | Index |