• Keine Ergebnisse gefunden

NOCODE/CODE EJECT

Im Dokument PASCAL-a6 USER'S GUIDE (Seite 164-169)

* EXT ENS ION SIN 0 EXT ENS ION 5

lIST/NOlIST

SUB

TIT l E (

I subtitle I )

4 TIT L E ( I tWe I )

* N 0 X REF / X REF

COND/NOCOND

The default values allow listing of the source program without the approximate assembly code listing (NOCODE), without the identifier cross-reference (NOXREF), and without any extension warning messages (EXTENSIONS).

These default values assume the general case. If you need the approximate assembly code listing of portions of the source file, use the CODE control. If you need to suppress certain portions of the source listing, use NOLIST. Note that the NOLIST control does not override the CODE control.

Under the default EXTENSIONS, extension warning messages are not issued (i.e., Intel extensions to standard Pascal are accepted without any warnings). If you specify NOEXTENSIONS, extension warning messages will occur if the compiler detects an Intel extension to standard Pascal. These warnings are directed to the file governed by PRINT and ERRORPRINT, and they do not stop the compilation process.

Deviations that are not supported by Pascal-86 generate real errors. Control lines in the source file (after the initial set of primary controls) are considered Intel exten-sions to standard Pascal; under NOEXTENSIONS, they cause extension warnings.

The XREF control directs the compiler to produce a symbol and identifier cross-reference, as described in 11.1.5 and in 10.3. NOXREF (the default) suppresses this action, and NOPRINT overrides XREF.

Although paging is automatic (every 60 lines), you can force a page eject on any line by using the EJECT control. An EJECT in a control line is ignored if the control line occurs in an area governed by the NOLIST control. TITLE and SUBTITLE controls specify titles and subtitles in the listing. If NOLIST is in effect, the subtitle specified

Compiler Controls Pascal-86 User's Guide

10-6

is saved until listing resumes with the LIST control. All of these controls are ignored if NOPRINT is active.

Conditional compilation allows two listing options: COND and NOCOND. COND specifies that any skipped source code will be listed (without statement or level numbers) and NOCOND specifies that skipped text will not be listed.

10.2.3 Source Selection and Processing

The following controls govern the selection and processing of source files. The default value of each pair is listed first.

*EXTENS I ONS/NOEXTENS IONS INC L U D E ( file )

Pascal-86 allows only one primary source file, but other source files may be included in the compilation by specifying them in INCLUDE controls. For instance, you can save the PUBLIC sections common to several modules in a separate source file, and you can INCLUDE this file whenever the PUBLIC sections it contains are needed by the modules being compiled.

The INCLUDE control must be the rightmost (last) control on a source control line.

The compiler issues a nonfatal error message when controls are placed to the right of the INCLUDE control.

The EXTENSIONS control (default value) allows Intel extensions to standard Pascal to pass through compilation without generating warning messages. NOEXTEN-SIONS directs the compiler to check for these extensions and to issue warnings. Use NOEXTENSIONS for programs that you want to conform to standard Pascal.

10.2.4 Conditional Compilation

The following controls pertain to conditional compilation, a process that allows the compiler to skip selected sections of the source file if specified conditions are not met.

Likewise, conditional compilation can be used to select various compiler controls by testing specified conditions in the source code. The default value of each control pair is listed first.

I F/ELSE I F/ELSE/EHDI F RESET/SET

COND/NOCOND

IF, ELSEIF, ELSE, and ENDIF are general controls that enable the actual condi-tional compilation process. An IF control and an ENDIF control delimit an IF element. An IF element has several different forms; the most complete form includes one or more ELSEIFs, followed by an optional ELSE. The operands in an IF element are not type-checked; they must be either a byte constant or predefined in a RESET

I

SET control.

RESET and SET are general controls that determine the value of various switch assignments that can be used in a limited way to form conditions. These conditions are then tested by the IF and ELSEIF controls to determine the value of the least significant bit. Based on the results of this test, the compiler determines which sections of code should be compiled. The value of the switch assignment may be any whole number constant from 0 to 255. SET establishes the value; RESET restores the value to

o.

Pascal-86 User's Guide Compiler Controls

COND/NOCOND determines whether text skipped during conditional compilation will appear in the listing. The COND control specifies that any skipped text will be listed (without statement or level numbers). A COND control cannot override a NOLIST or LIST control. Also note that a COND control is not processed if it is in a portion of skipped text. The NOCOND control specifies that skipped text will not be listed.

Conditional compilation has many useful applications. For example, conditional compilation can be used when porting a program to different architectures, or when a program contains several features that are not required for each implementation.

Rather than writing a separate program for each case, you can write one program that uses conditional compilation to select the necessary sections of code for each application.

10.2.5 Object Content and Program Checkout

The following controls govern the selection and content of the object module, and implement program checking. The default value of a control pair is listed first.

fOB J E C T ( file) I NOD B J E C T fNODEBUG/DEBUG

fTYPE/NOTYPE NOCHECK/CHECK

The OBJECT control selects a file to receive the object module. The default file has the same root name as the source file, with the extension OBJ (i.e., if PROG I.SRC is the source file, PROGI.OBJ becomes the object file). NOOBJECT prevents the generation of an object module and directs the compiler to perform only a quick syntax and semantic check of the source file. It also inhibits the execution of the OBJECT phase, overriding CODE and CHECK.

The DEBUG control generates debug records in the object module that are used by symbolic debuggers such as PSCOPE, DEBUG-86, and the ICE-86 emulator. The default value NODEBUG suppresses the generation of debug records. NOOBJECT overrides DEBUG. The DEBUG control generates debug records and does not affect any program checkout features.

The TYPE control (default value) generates type records in the object module that are used for type checking by the linker. TYPE is the default, because type checking is one of the advantages of using Pascal. Type records provide the mechanism for enforcing type compatibility between separately-compiled modules. TYPE informa-tion is also used by PSCOPE to display or modify memory variables. The NOTYPE control suppresses the generation of type records. NOOBJECT overrides TYPE.

The CH ECK control directs the compiler to check for of-range assignments, out-of-bounds array subscripts, stack overflow, and integer overflow. If possible, viola-tions are checked at compile time, but some run-time checking may be required.

NOCHECK suppresses all checking activity. NOOBJECT overrides the compile-time checking performed by CH ECK.

Compiler Controls Pascal-86 User's Guide

10-8

10.2.6 Program Optimization and Run-Time Environment

The following controls optimize code and memory size requirements and affect the run-time environment of a particular program. The default value of the control is listed first.

*OPTIMIZE(n)

LARGE/COMPACT/SMALL I Ii T ERR U P T (proc [ = n][, ... ]>

The OPTIMIZE control allows you to specify the level of optimization you want the compiler to perform when it generates object code. Two optimization levels are provided: OPTIMIZE(l) (the default), and OPTIMIZE(O). OPTIMIZE(O) performs more limited optimization and is recommended when debugging programs with PSCOPE or DEBUG-86.

The LARGE, COMPACT, and SMALL controls determine the memory addressing techniques of a given object module. If you are unsure of the memory requirements of your program, LARGE (the default) is recommended because it directs the compi-ler to make no special assumptions. You can improve code efficiency by using the smallest control possible, given your program's specific run-time memory require-ments. Note that every module in a program must be compiled with the same control.

(Appendix I outlines extensions to these controls.)

The INTERRUPT control enables you to compile specific procedures as interrupt procedures. Dynamic interrupt number assignments (set by the SETINTERRUPT procedure) within the source program override the assignments made in the INTER-RUPT control. If an interrupt occurs during run time, and is associated by number with an interrupt procedure, the interrupt procedure gains control. (Interrupt handling is described in detail in Appendix K.)

10.2.7 Use of Controls in Stages of Development

When you are compiling a program for the first time, use the default control settings with the following exceptions:

Use CHECK, OPTIMIZE(O), and DEBUG for program checkout; then use PSCOPE, DEBUG-86, or ICE-86A for symbolic program debugging.

Use XREF to generate a symbol and identifier cross-reference to aid your debug-ging and maintenance efforts.

Definitions of PUBLIC procedures and functions (needed for an interface specifica-tion that is common to several modules) can be maintained in a separate file and included with the source file by using the INCLUDE control. (For information on interface specifications, see 4.2.3.)

For quick compiling and error reporting, you can maximize compile speed by using default settings for all but one control; use NOPRINT to supress printed output.

(Errors will be reported at the console, or use ERRORPRINT to redirect errors to a file.)

When preparing programs to test with the ICE-86A or ICE-88 emulator, use the CODE control during compilation to list the pseudo-assembly instructions and addresses. The CODE control can help you recode certain portions in assembly language.

Pascal-86 User's Guide Compiler Controls

Use the NOLIST control to save time by not listing portions of the source code that are already debugged. To make your listing more readable, use EJECT, TITLE, and SUBTITLE. You can direct the final listing to a specific output file using the PRINT control, and direct the final object module to a specific output file using the OBJECT control.

To enforce compatibility with the Pascal standard, use the NO EXTENSIONS control early in program development to generate warning messages whenever the compiler encounters an Intel extension to standard Pascal. You can also use the CODE control to help recodc non-standard areas in assembly language.

10.3 Descriptions of Individual Controls

NOTE

Sample invocation lines for most compiler controls are provided on a foldout page in your specific operating-system appendix.

Compiler Controls Pascal-86 User's Guide

10-10

10.3.1 CHECK/NOCHECK

Checks for invalid references, overflow, and out-of-range assignments and subscripts during compilation or at run time.

Syntax

CHECK HOCHECK

Abbreviation

CH/HOCH

Default

HOCHECK

Type

Im Dokument PASCAL-a6 USER'S GUIDE (Seite 164-169)