• Aucun résultat trouvé

St3tement Label Dictionary--XREF Option

Dans le document VS FORTRAN (Page 137-143)

In the statement label dictionary, the following columns are defined:

LABEL COLUMN:

Statement labels, including compiler-generated labels, are listed in ascending order.

TAG COLUMN:

The LABEL column is followed in the second column, the column headed TAG, by its status, which can be:

A used as an argument B an object of a branch

F label for a FORMAT statement

Fixing-Compile-Time Errors--Advanced Programming 119

CROSS REFERENCE DICTIONARY

TAG: ARRAYCA). COMMONCe). EQUIVCE). DUMMY ARGCD), NAMED CONSTANTCK), STMT.FUNCTCF), EXT.FUHCTCX), INTR.FUHCTCI), EXPL.TYPECT' .It!l1L ~ ....lAL- DECLARED REFERENCEl

TAG: FORMATCF), HOH-EXECUTABLECH), USED AS ARGUMENTCA). OBJECT OF BRAHCHCB). USED IN ASSIGH STATEMEHTCS)

Figure 31. Example of a Cross-Reference Dictionary--XREF Option

N label for a nonexecutable statement S label used in an ASSIGN statement

If a label is used in more than one way, all tags that apply are printed.

DEFINED COLUMN: This column displays the internal sequence number (ISN) of the statement in which the label is defined.

REFERENCES COLUMN: This column displays the internal sequence number (ISN) of all statements in which there are references to

USING THE STANDARD LANGUAGE FLAGGER--FIPS OPTION

Through the FIPS option, you can help ensure that your program conforms to the current FORTRAN standard--American National Standard Programming Language FORTRAN, ANSI X3.9-1978.

You can specify standard language flagging either at the full language level or at the subset language level:

120 VS FORTRAN Application Programming: Guida

0-'0

FIPS=S

NOFIPS

requests the compi ler to issue a message for any language element not included in full American National Standard FORTRAN.

requests the compiler to issue a message for any language element not included in subset American National Standard FORTRAN.

requests no flagging for nonstandard language elements.

The messages tall you which language items are not included in the current American National Standard. They're all in the same format as the other diagnostic messages, and they're all at the 0(1) (information) level.

For the formats of diagnostic messages, see "Diagnostic Message Listing-FLAG Option."

Fixing Compile-Time Errors--Advanced Programming 121

LINK-EDITING YOUR PROGRA"--ADVANCED PROGRA"MING

You must link-edit any object module before you can execute your program, combining this object module with others to construct an executable load module.

For VM/370-CMS considerations on loading and executing your programs, see "Using VM/370-CMS with VS FORTRAN."

For TSO considerations on loading and executing your program, see "Using OS/VS2-TSO with VS FORTRAN."

AUTOMATIC CROSS-SYSTEM SUPPORT

LiNKAGE EDITOR INPUT

In VS FORTRAN, you can compilQ YOUr suurce prugr6m unoar any supported operating system. You can then link-edit the resulting object module under the same system, or under any other supported system.

For eXQmple, you could request compilation under VM/370-CMS and then link-edit the resulting object module for execution under DOS/VSE.

You don't have to request anything special during compilation to do this; VS FORTRAN uses the execution-time library for all system interfaces, so the operating system under which you link-edit determines the system under which you execute.

Your input to the linkage editor can be the object module in machine-language format (which you request through the OBJECT compile-time option), or as a machine-language input data set

(which you request through the DECK compile-time option).

You request the DECK option when you want to catalog the object module and save it for future link-edit runs.

Request the OBJECT option when you want to combine the link-edit task with the compilation task. You can then catalog and/or execute the load module produced.

OBJECT MODULE AS LINK-EDIT DATA SET--DECK OPTION

You use the DECK compile-time option to request an object module punched into a card deck. The deck produced is in 80-character fi xed format.

The deck is a copy of the object module-toJhi ch consi sts of dictionaries, text, and an end-of-module indicator. (Object modules are described in greater detail in the appropriate linkage editor and loader publications, as listed in the Preface.)

The object deck consists of four types of records, identified by the characters ESD, RLD, TXT, or END in columns 2 through 4.

Column 1 of each card contains a 12-2-9 punch. Columns 73 through 80 contain the first four characters of the program name followed by a four-digit sequence number. The remainder of the card

contains program information.

122 VS FORTRAN Application Programming: Guide

0".'./

, ,

)

C' ,:;.;l

ESD Record

C',,"

, ,)

TXT Record

RLD Record

ESD records describe the entries of the External Symbol

Dictionary, which contains one entry for each external symbol defined or referred to within a module. For example, if program MAIN calls subprogram SUBA, the symbol SUBA will appear as an entry in the External Symbol Dictionaries of both the program MAIN and the subprogram SUBA. .

The Ii nkage edi tor matches the entri es in the di ct i onari es of other included subprograms and, when necessary, to the automatic call library.

ESD records are divided into four types, identified by the digits 0, 1, 2, or 5 in column 25 of the first entry, and column 57 of a third entry (there can be 1, 2, or 3 external-symbol entries in a record) .

The contents of each type of ESD record are:

ESD Type contents

o

Name of the program or subprogram and indicates the beginning of the module.

1 Entry point name appearing in an ENTRY statement of a subprogram.

2 Name of a subprogram referred to by the source module through CALL statements, EXTERNAL statements, and explicit and implicit function references. (Some VS FORTRAN intrinsic functions are so complex that a function subprogram is called in place of iri-line coding. Such calls are defined as implicit function references).

5 Information about a COMMON block.

TXT records contain the constants and variables your source program uses, any constants and variables generated by the compiler, coded information for FORMAT statements, and the machine instructions generated by the compiler from the source module.

RlD records describe entries in the Relocation Dictionary, which contains one entry for each address that the linkage editor or loader must resolve before the module can be executed.

The Relocation Dictionary contains information that enabl~s

absolute storage addresses to be established when the module is loaded into main storage for execution. These addresses cannot be determined earlier because the absolute starting address of a module cannot be known until the module is loaded.

The linkage editor or loader consolidates RLD entries in the input modules into a single relocation dictionary when it creates a load module.

RLD records contain the storage addresses of subprograms called through ESD type 2 records.

Link-Editing Your Program--Advanced Programming 123

END Record

The END record indicates:

• The end of the object module to the 1 i nkege edi tor

• The relative location· of the main entry point

• The length (in bytes) of the object module.

The structural order of a typical VS FORTRAN object module is shown in Figure 32.

Record Type ESD (Type 0)

ESD

' T •• ", .... "'YI"'''" 1)

TXT TXT

ESD (Type 5) ESD (Type 2)

RlD

TXT

ESD (Type 2) RlD

TXT TXT RlD END

Usage

Names object module

U!!'ll. ... , ... ; .... '-e 1.& ... a::UTDV

,1gll.'C_ ~I'~'" """"'I"'~ ,. II " ' I I I " " " ' "

statements)

For FORMAT statements

For compiler-generated constants For COMMON areas

For external references in CAll and EXTERNAL statements, and statements using subprograms For external references in CAll and EXTERNAL statements, and statements using subprograms For source program constants For compiler-generated external references

For compiler-generated external references

For object module instructions For the branch list

For the branch list End of object module Figure 32. Object Module Structure

PRODUCING A LOAD HODULE--OBJECT OPTION

Specify the OBJECT option when you want either to link-edit and execute your program immediately, or to link-edit the program and catalog the load module for execution at some later time.

LINK-EDITING FOR IMMEDIATE EXECUTION

The simplest way to link-edit for immediate execution is to use a link-edit-execute cataloged procedure. See "Executing Your

Program-Advanced.Programming" for details.

You can al so execute thg program i mmedi atelv after 1 i nk-edi t i ng by including the execution step immediately after the link-edit 124 VS FORTRAN Application Programming: Guide

I~}

\~)

o

o

step. Sea "Executi ng Your Program-Advanced Programmi ng" for details on the execution step.

LINK-EDITING YOUR PROGRAM--OS/VS

The following sections show how to catal~g you~object module or load module under OS/VS, and how to use the OS/VS linkage editor or loader.

CATALOGInG YOUR LOAD "ODULE--OS/VS

You can catalog the data set containing the l~ad module by defining it in a SYSLMOD DD statement during link-edit processing.

See the VS FORTRAN Application Development: System Servic~s

Reference Supplement for details.

EXECUTING A LINK-EOIT--OS/VS

Under OS/VS, there are two different programs you can use to perform the link-edit: the linkage editor or the loader. Which one you use depends upon the output you want produced.

THE lINKAGE EDITOR: Use the linkage editor when you want to reduce storage requirements through overlays, or to use additional libraries as input, or to define the structural segments of the program.

THE lOADER: Use the loader when your input is a small object module that doesn't require overlay, that doesn't require

additional linkage editor control statements, and that you'll be executing immediately.

VS FORTRAN supplies you with cataloged procedures that let you Ii nk-ed; tor load your programs eas i I ~/. See "U sing and Modi fy i ng Cataloged Procedures-OS/VS" for detai Is.

Dans le document VS FORTRAN (Page 137-143)