REFERENCE

<;

f-'

Vau of "J

NBS TECHNICAL NOTE 849

-
NATIONAL BUREAU OF STANDARDS

The National Bureau of Standards' was established by an act of Congress March 3, 1901. The Bureau's overall goal is to strengthen and advance the Nation's science and technology and facilitate their effective application for public benefit. To this end, the Bureau conducts

research and provides: (1) a basis for the Nation's physical measurement system, (2) scientific and technological services for industry and government, (3) a technical basis for equity in trade, and (4) technical services to promote public safety. The Bureau consists of the Institute for Basic Standards, the Institute for Materials Research, the Institute for Applied Technology,

the Institute for Computer Sciences and Technology, and the Office for Information Programs. THE INSTITUTE FOR BASIC STANDARDS provides the central basis within the United

States of a complete and consistent system of physical measurement; coordinates that system

with measurement systems of other nations; and furnishes essential services leading to accurate and uniform physical measurements throughout the Nation's scientific community, industry, and commerce. The Institute consists of a Center for Radiation Research, an Office of Measurement Services and the following divisions; Applied Mathematics — Electricity — Mechanics — Heat — Optical Physics — Nuclear

Sciences 2 — Applied Radiation ' — Quantum Electronics * — Electromagnetics 3 — Time

and Frequency n — Laboratory Astrophysics " — Cryogenics *. THE INSTITUTE FOR MATERIALS RESEARCH conducts materials research leading to improved methods of measurement, standards, and data on the properties of well-characterized

materials needed by industry, commerce, educational institutions, and Government; provides

advisory and research services to other Government agencies; and develops, produces, and

distributes standard reference materials. The Institute consists of the Office of Standard Reference Materials and the following divisions: Analytical Chemistry — Polymers — Metallurgy — Inorganic Materials — Reactor

Radiation — Physical Chemistry.

THE INSTITUTE FOR APPLIED TECHNOLOGY provides technical services to promote

the use of available technology and to facilitate technological innovation in industry and Government; cooperates with public and private organizations leading to the development of

technological standards (including mandatory safety standards), codes and methods of test; and provides technical advice and services to Government agencies upon request. The Institute consists of a Center for Building Technology and the following divisions and offices: Engineering and Product Standards — Weights and Measures — Invention and Innovation — Product Evaluation Technology — Electronic Technology — Technical Analysis — Measurement Engineering — Structures, Materials, and Life Safety ' — Building Environment * — Technical Evaluation and Application * — Fire Technology.

THE INSTITUTE FOR COMPUTER SCIENCES AND TECHNOLOGY conducts research and provides technical services designed to aid Government agencies in improving cost effec- tiveness in the conduct of their programs through the selection, acquisition, and effective

utilization of automatic data processing equipment; and serves as the principal focus within

the executive branch for the development of Federal standards for automatic data processing equipment, techniques, and computer languages. The Institute consists of the following

divisions: Computer Services — Systems and Software — Computer Systems Engineering — Information Technology.

THE OFFICE FOR INFORMATION PROGRAMS promotes optimum dissemination and

accessibility of scientific information generated within NBS and other agencies of the Federal Government; promotes the development of the National Standard Reference Data System and

a system of information analysis centers dealing with the broader aspects of the National Measurement System; provides appropriate services to ensure that the NBS staff has optimum

accessibility to the scientific information of the world. The Office consists of the following

organizational units: Office of Standard Reference Data — Office of Information Activities — Office of Technical

Publications — Library — Office of International Relations.

1 Headquarters and Laboratories at Gaithersburg. Maryland, unless otherwise noted; mailing address Washington, D.C. 20234.

2 Part of the Center for Radiation Research.

3 Located at Boulder, Colorado 80302.

« Part of the Center for Building Technology.
mil Bureau of Standards i 1 1974

IlOO

§753

i W A FORTRAN Analyzer

Gordon Lyon and

Rona B. Stillman

Institute for Computer Sciences and Technology

\J i f> . National Bureau of Standards Washington, D.C. 20234

Supported by

National Science Foundation

Washington, D.C. 20550

and

National Bureau of Standards Washington, D.C. 20234

"•fAU Of

U.S. DEPARTMENT OF COMMERCE, Frederick B. Dent, Secretary

NATIONAL BUREAU OF STANDARDS, Richard W. Roberts, Director

Issued October 1974
Library of Congress Catalog Card Number: 74-600144

National Bureau of Standards Technical Note 849

Nat. Bur. Stand. (U.S.), Tech. Note 849, 28 pages (Oct. 1974) CODEN: NBTNAE

U.S. GOVERNMENT PRINTING OFFICE WASHINGTON: 1974

For sale by the Superintendent of Documents, U.S. Government Printing Office, Washington, D.C. 20402 (Order by SD Catalog No. C13.46:849). Price 80 cents.
CONTENTS

Page

1. Introduction . . . „ ... „ -1

2. A Programmer's Aid 1

3. Dynamic Analysis : A FORTRAN Program Monitor 2

3.1 Simple Labelled (Executable) Statements ........ k

3.2 Simple Logical IF „ . . . . h

3.3 Computed GOTO 5

3.*t Logical IF with Arithmetic IF as Consequent 5 3.5 DO Statements 6

3.6 DO Loop Terminators 6

3.7 Implicit or Explicit STOP 6

h. Analyzer Details 7

l+.l Runs, Examples 7

k.2 Results from the Analyzer: An Example 10

5. Remarks and Restrictions 10

6. Conclusion 12

7. References 12

TABLES AND FIGURES

Table I 9

Figure 1 3 Figure 2 8

Figure 3 13

Figure h Ik

Figure 5a .... <, . 15

Figure 5b l6

Figure 6 17

Figure 7 18

Figure 8 21

Figure 9 23

in

A FORTRAN ANALYZER

Gordon Lyon and Rona B. Stillman

Details of a FORTRAN analysis package are presented. Examples illustrate a current operational

level which gathers FORTRAN statement and frequency

of execution statistics. Arguments support a simple

technique for monitoring FORTRAN executions.

Key words: Computation and flow analysis; FORTRAN

language use; programming aids; syntax analysis.

1. INTRODUCTION

A FORTRAN language analyzer was developed to lay ground work for

a reasonable FORTRAN language utilization analysis package. Such a utility would provide performance records to managers and FORTRAN

language development groups. Statistics would be available to measure

processes of creation and maintenance of computer software. The package

provides additional information to each user on his FORTRAN deck's

pattern of execution; this service may be of some value in itself:

Perhaps the most fundamental way to measure

the speed of an algorithm in a reasonably

machine-independent manner is to count how

frequently each part... is executed [k].

The following terms are meaningful in the sequel:

Static analysis denotes a source statement examination applicable to

some class of programs, and in particular, FORTRAN source programs.

Static analysis does not pertain in any way to execution aspects.

Dynamic analysis denotes an analysis of program behavior during

execution. No use is made of a hardware or system clock. For a good discussion of problems in elapsed-time measurements, see [l],

2. A PROGRAMMER'S AID

Among possible methods of gaining reliable information on FORTRAN

usage, a program analyzer (a preprocessor) was selected as being

convenient and effective [6]. A rudimentary static analyzer (based upon

a FORTRAN precompiler written by Don Orser, Applied Mathematics Division,

N.B.S.) has been available for several months. It collects from

individual programs 118 frequency statistics on FORTRAN statement types,

and accumulates these statistics over all programs analyzed. Such

accumulations could be useful to language studies and FORTRAN standards

committees, for system benchmark characterizations, and for studies in

1
software portability and conversion.

Two observations motivated expansion of the static analyzer to

perform dynamic analysis. First, a dynamic analyzer is a very useful programmer's tool. By identifying heavily used portions of

code, it facilitates program optimization. In addition, untested

segments of code are isolated, thereby promoting more thorough testing.

Second, the dynamic analysis capability encourages widespread use of the

whole analysis package, since static analysis is a prerequisite to

dynamic analysis. This latter point is highly desirable, since

meaningful statistics on FORTRAN usage can be obtained only with a broad and representative sample of programs.

A basic philosophy has been to keep the analyzer design

simple. Instrumentation techniques described in Section 3 were developed in response to cumbersome methods frequently used in available

commercial packages. Changes, extensions, and enhancements of the

analyzer will be made as future experience dictates.

3. DYNAMIC ANALYSIS: A FORTRAN PROGRAM MONITOR

Execution activity of a FORTRAN program is treated here as a series of invocations of code segments. Each code segment is

defined as a non-empty sequence (S^, S^+i , . .

. , S^+n ) of statements

where S^ is a unique entry statement in the sequence, and S^+ the sole exit. Control flows from S^+a to S. for - j ^n, i.e.,

is strictly sequential. A segment continues until a rule of ending or starting a new segment can apply. Certain statements always begin a new

segment, e.g., labelled statements. Other statements always end a

segment, e.g., unconditional GO TO statements, RETURNS, and STOPs . Some

statements are themselves one or more segments. Among these are IF statements, computed GOTOs, and DO-loop terminators. The analyzer

assigns segment numbers sequentially throughout the program text.

Dynamic analysis includes both computation and control activity

analyses. In computation activity analysis, execution frequencies of

each code segment are monitored independent of other program segments.

Control activity analysis records flow from segment to segment as well.

There are many packages available which monitor FORTRAN program

executions. Some are quite elaborate and expensive. Packages which

analyze program structure (i.e., all except those which just interrupt

execution at intervals and record the contents of the instruction

counter) consist essentially of two phases. The original source code

is first accepted as input to the analyzer, and an "instrumented" or augmented version of the program is produced as output. Instrumentation

consists of inserting calls to a tallying function into the original

source code. A second phase occurs when the augmented version

is actually run, the tallying function causing the program to compute

and report execution frequency statistics in addition to performing its

normal function. The entire process is represented in Figure 1.
PHASE ONE. ORIGINAL SOURCE

PROGRAM TEXT

FORTRAN

ANALYZER

ANNOTATED

PROGRAM

LISTING

PHASE TWO.

INSTRUMENTED

SOURCE

PROGRAM 7

/

/

/

/

jL

/

INSTRUMENTED

SOURCE

PROGRAM

COMPILER

PROGRAM

EXECUTION c

USER'S

INPUT

NORMAL

OUTPUT

EXECUTION

FREQUENCY

STATISTICS

FIGURE 1. Dynamic Analysis
FORTRAN ls lack of any compound-statement facility (such as BEGINEND brackets in ALGOL) often has forced FORTRAN analyzers to he inelegant

and unwieldy. Many dynamic analyzers introduce new variables and labels,

and require a symbol table and (sometimes) multiple passes to avoid

naming collisions. The analyzer presented here aims at simplicity, with

some sacrifice in performance and analysis power (these weaknesses are detailed later). Instrumentation is a single pass operation. No new

labels or variables are introduced into the source code; only one function name and a few additional statements are added.

The analyzer does change many statements into a "statistics

collecting" form which calls an integer function

with the reserved name IY2L9T (IY2L9T was chosen so as to avoid collision

with usual FORTRAN names). The function IY2L9T, which is included as part of the instrumented program, maintains and prints execution

frequency statistics. To avoid complicated interactions through COMMON

and BLOCK DATA, statistics are kept in an array (SEGFRQ) which is local

to IY2L9T. The dimension of SEGFRQ is fixed after a program has been

analyzed, and is, of course, equal to the number of segments in the

program. This approach implicitly assumes that local variables are

invariant across calls to a subprogram, i.e. they have properties of

ALGOL own variables or PL/I STATIC variables [5].

The monitoring philosophy is best explained by examples.

3.1 Simple Labelled (Executable) Statements

The labelled statement

xxxxx S

begins a new segment, say segment (i). S is any statement except an IF, a computed GOTO, a DO, or a STOP. (These latter cases are discussed

below.) The instrumented version of xxxxx S is

xxxxx IF(lY2L9T(i,.TRUE.,0.D0,6).EQ.0)S

where IY2L9T returns zero and as a side effect, adds one to SEGFRQ(i), the counter for segment (i). The second and third

parameters are not meaningful in this call. The fourth parameter

controls the entry into IY2L9T.

3.2 Simple Logical IF

Let S be any FORTRAN statement which can occur as a consequent of a logical IF except the following: arithmetic IF, STOP, computed GOTO.

Then a (possibly labelled) logical IF,
[xxxxx] IF(boolean expression ) S

is monitored as two segments. Segment (i) is the "decision portion" of

the statement. Segment (i+l) is the consequent S. The statement

following the logical IF begins segment (i+2). The execution frequency

of segment (i) indicates how many times control reached the IF statement,

while that of segment (i+l) indicates the number of times that

the boolean expression evaluated to .TRUE. .

The instrumented version of a simple logical IF is

[xxxxx] IF (!Y2L9T(i,boolean expression , 0. DO, l).EQ.O) S

IY2L9T returns zero whenever boolean expression evaluates to .TRUE., and

one otherwise. As a side effect, IY2L9T adds one to SEGFRQ(i)

and, if boolean expression is .TRUE., increments SEGFRQ(i+l) by one as well. The third parameter has no meaning in this call. The fourth

parameter effects a proper entry into IY2L9T.

3.3 Computed GOTO

The (possibly labelled) GOTO statement

[xxxxx] G0T0Cn12n , n„, ..., n ), VAR

p

is monitored as (p+l) segments. Segment (i) is the "decision portion"

of the statement. Segments (i+l) through (i+p) are transfers to n, through n , respectively. The instrumented statement appears below:

[xxxxx] IF(lY2L9T(i,.TRUE.,0.D0+VAR,3).EQ.0)GOT0(n

1 ,..,n ) ,VAR

where IY2L9T returns zero. IY2L9T also increments SEGFRQ(i) and

SEGFRQ( i+VAR ) . The second parameter is not meaningful in this call, and

the last determines which parts of IY2L9T are used. The third actual

argument is forced to double precision.

IY2L9T's third formal parameter is DOUBLE PRECISION, which allows

FORTRAN values of greatest significance to be passed. A DOUBLE PRECISION

zero (0.D0) is added to every actual argument in the third position to ensure compatibility between formal and actual arguments.

3.1* Logical IF with an Arithmetic IF as Consequent

The possibly labelled statement

[xxxxx] IF(boolean expression )lF( arithmetic

* expression )n, ,n_,n_

is treated as five segments: segment (i) is the decision portion of the

logical IF, segment (i+l) is the decision portion of the arithmetic IF,

and segments (i+2), (i+3), (i+U) are transfers to n through n .

5
The instrumented statement calls IY2L9T twice:

[xxxxx] IF ( IY2L9T(i,boolean expression , 0. DO «U).EQ.O)

* IF(lY2L9T(i+l». TRUE. ,0.00+

(

arithmetic expression ). * 2))nlS n

2

,n

3

The first call to IY2L9T is similar to that described in Section 3.2.

The second call returns -1, 0, or 1 determined by arithmetic expression

being negative, zero, or positive. As a side effect, the second call

increments SEGFRQ(i+l) and one of SEGFRQ(i+2) through SEGFRQ(i+U), as appropriate. The second parameter is not used, and the last controls

entry into IY2L9T.

3.5 DO Statements

A labelled DO statement

xxxxx DO N IHDEX=INIT,I]JCR,ITERM

is monitored as a single-statement segment, (i). The execution

frequency of segment (i) indicates how many times the DO loop was entered.

The statement following the DO, i.e., the first statement within the loop,

always begins segment (i+l).

Because a DO statement cannot occur as the consequent of a logical

IF, the DO must be monitored as a pair of statements:

xxxxx DO N INDEX=INIT , INCR , 1TEKM

IF(lY2L9T(i,(lNDEX.EQ.INIT),0.D0,10).EQ.0)C0NTINUE

IY2L9T always returns zero. SEGFRQ(i) is incremented whenever INDEX

equals INIT. Clearly, this instrumentation is effective because neither

control parameters INIT, INCR, ITERM nor control variable INDEX of a

FORTRAN DO loop can be redefined within the loop; also every loop executes

at least once. The third call parameter is not meaningful in this

instance. The fourth effects a proper entry into IY2L9T.

3.6 DO Loop Terminators

DO statements always refer to labelled termination statements,

xxxxx S

where S is any executable statment except an arithmetic IF, RETURN, STOP,

PAUSE, DO, any GOTO form, or logical IF with any of these as a consequent.

Because of these restrictions, .DO terminators need not be treated as a

special case; they are instrumented routinely according to statement

type (i.e., according to S). DO loop terminators, however, always end a

segement. Thus DO loop terminators are single statement segments.

3.7 Implicit or Explicit STOP
Every possible halt statement is replaced by a call to IY2L9T which

outputs the execution frequency results. For example, the instrumented

version of an END statement is a pair of statements

IF(lY2L9T(i,.TRUE.,0.D0 ) 9).EQ.0))ST0P

END

where IY2L9T always returns zero and, as a side effect, prints execution

frequencies. The second and third parameters are not meaningful in this

call, and the fourth effects the proper entry into IY2L9T. END

statements in BLOCK DATA are ignored, of course.

k. ANALYZER DETAILS

INIT initializes tables and logical units when it is called by main

control (PRECOM—see Figure 2). PASS1 calls INITP1, and then begins

processing input. Control returns to main only after the last statement

has been processed. FORTRAN statements are picked up card by card through

NXTLIN and NXTSTM. For each statement, nonessential blanks are removed

and each character is converted to an internal code; results lie in an array ITEXT. With one character per word, represented in an internal

form, some degree of machine independence can be realized. PASS1 then

calls STYPE to identify the statement in ITEXT. PASS1 records the type

returned by STYPE and calls OUTPUT to add the statement to the annotated

program listing, and to add the instrumented version of the statement to

the instrumented program file. PASS1 then initiates new calls through

NXTSTM, etc.

4.1 Runs, Examples

Data is read on INUNIT, output is printed on COMUNT and LSTUNT and

punched on OUTUNT. (These variables are initialized in BLOCK DATA to

indicate FORTRAN logical units 5» 6, 6, and 1, respectively.) Unit 10

functions as a system file to accumulate statistics on FORTRAN usage.

It is read and written as one unformatted record which must be

initialized to zero before attempting to accumulate meaningful statistics.

The analyzer develops and outputs an instrumented program as a stream of card images. For occasional use these images can be sent

directly to a punch, but more often, as for large programs, the

stream should be directed to a suitable on-line file. Details of the

handling of the stream will vary considerably among different systems.

For purposes of this note, a Univac 1108/EXEC-8 is assumed. In this

environment, only very simple additions to subroutines OUTPUT and WRTIY2

are required to produce an on-line file rather than a card deck, and

these are indicated clearly in the program text. In addition, some control cards must be added to the run stream. A typical first run,

i.e., a run which initializes the cumulative statistics file 10, is

depicted in Figure 3. Runs subsequent to the first need not initialize

unit 10. For later runs, unit 10 is assigned [ @ASG,A 10.] as
INITP1

SCRATCH FILE (not used)

SCRUNT (is disabled code)

PRINT main (PRECOM)

INIT

PASS1

WRTIY2

STYPE

NXTSTM

OUTUNT NXTLIN

S\.

OUTPUT

OUTUNT LSTUNT

_i

instrumented prog.

Data input stream (INUNT) annotated

program

listing —

ETEXT holds statements in external code.

ITEXT holds internally coded statements.

ITEXT Format:

BITEXT EITEXT

(end text)

Binary form of label

Statements in ETEXT are transformed to internal code and placed in ITEXT.

FIGURE 2.

8
Decks are listed below, with details.

INITP1 PASS1 initialization

NXTSTM Get next statement

NXTLIN Get next line

BLKDAT BLOCK DATA

PASS1 Pass 1, static analysis

statistics (no Pass 2 included), appropriate calls

to OUTPUT.

STYPE Statement classifier

PRINTF Two copies used for output

ENCOD Converts for symbol table

(not presently used)

XERROR Error handler , rather crude

* INTERN Converts to internal code

POSID Keyword checker for STYPE

INIT Has rules for extending

statement types

ITALLY Used in recording static

data types (Pass l)

PRECOM Program main control

* NEWPC Text

* SPROC Text also. This INCLUDE'd

Cf . Note 1., below

TESTDAT A bit of test data

* OUTPUT Produces annotated program

listing and instrumented

program

ECONVT Converts integer to Hollerith

* WRTIY2 Punches IY2L9T as last

routine in instrumented

program

* May need modification for machines other than 1108 with EXEC 8.

Note.

(l) INCLUDE statement is merely a copy-text command to the compiler.

It is similar to a parameterless macro call, and is very easy to

replace.

TABLE I.

9
a catalogued file.

The dynamic analysis function can "be disabled by changing just

one statement in subroutine PASS1. This is explained in the program

source listing. An EXEC-8 setup for a static analysis run (only) is

shown in Figure h.

h.2 Results from the Analyzer: An Example

Figure 5-a is a listing of a FORTRAN program to be analyzed. The

annotated source, identifying code segments, is presented in 5-b. Notice

that the arithmetic IF in the middle of Figure 5-b is monitored as four

segments, segment 7 being the expression evaluation, and 8 through 10

labelling the branches. Similarly, each logical IF is treated as two

segments, a predicate and a consequent segment. Redundancies which

appear in segmentations in Figure 5-b are a result of deliberate choices

to keep low the effort in segmenting the program.

Figure 6 provides a static description of the program in 5-a.

Each statement of original FORTRAN source code contributes to a collection of 118 FORTRAN statistics. Only non-zero tallies are actually

printed. Observe that each logical IF is analyzed as two statements,

one being the IF, and the other the consequent. Consequent statements

resolve no closer than the entry CODE which is listed to the right of

each statement type. Statements of similar nature share a code number.

Figure 7 is similar to 6, except that statistics are accumulative

over all submissions since unit 10 was initialized.

A listing of the instrumented program, including function IY2L9T,

is displayed in Figure 8. Execution of this program produced the matrix

of segment execution frequencies shown in Figure 9. Each matrix row

is labelled under heading "X" and specifies ten segments. The execution

statistics of each segment within a decade appear in columns 0-9.

(Code constituting each segment is defined via annotated listing, as

in Figure 5-b. ) Figure 9 says that segment 11 —the DO-loop entry

was used once. Contrast this to ten passes for segment 12, a statement

within the loop. Note also that segment 12, a decision portion

of a logical IF, has frequency counts which equal the sum of those for

segments 13 and lk t the potential branches from the IF.

5. Remarks and Restrictions

The analyzer was built with few frills. As a result,

control activity analysis for assigned GOTOs is somewhat incomplete.

Flow out of the GOTO is not recorded. In our opinion assigned GOTOs

contribute little to the quality of a FORTRAN program and are, like ALTER

in COBOL, best avoided.

Because no symbol table is maintained, the analyzer can not

distinguish an arithmetic statement function definition

10
X(I,J,K) = I+J+K (i)

from an array element assignment

X(l,J,K) = I+J+K (ia)

Since statement function definitions should precede the first executable

statement of a FORTRAN program unit, a special comment card

C+ *BEGIN EXECUTABLES*

could be used to trigger instrumentation of executable code in a unit of

code. Some FORTRAN variants allow a more explicit statement function

definition:

DEFINE X(l,J,K) = I+J+K (ii)

Definitions of form (ii) are handled correctly.

Non-standard FORTRAN constructs which seemed inconvenient or difficult to handle were ignored. For example, the analyzer assumes

that all calls to subprograms have standard returns; READ(. . . ,END=. ..

)

and READ(.. . ,ERR=.. . ) are treated as simple READs; IF statements are not

expected to contain Hollerith fields.

The analyzer expects valid American National Standard FORTRAN with

mixed mode arithmetic, and with some exceptions, has very limited error handling and recovery. It is prudent, therefore, that programs be

syntactically correct before submission.

No attempt has been made to minimize segmentation [k], END

statements are always monitored, even when preceded by a STOP or RETURN;

decision portions of IFs and computed GOTOs are monitored as segments

even when the statements are unlabelled; a DO loop terminator is always

instrumented as a separate segment, even when there are no explicit

transfers to it inside the loop. Whether reachable or not, STOPs

are modified to call for a printout. Until more experience is gained

with the analyzer, the significance of these points is uncertain. It should not be difficult to modify or extend the analyzer whenever

appropriate.

Portability was an important goal in the analyzer's design,.

Streams of card images were chosen because they appeared most flexible.

The analyzer expects pure FORTRAN source code submitted on punched cards.

(The input cards or images should contain no job control language.)

The instrumented program is a stream of card images. Machine

independence was compromised only when common sense so dictated. COMMON

declarations are INCLUDEd in subprograms, so that changes can be made

uniformly by modifying COMMON text in just one place. The

FORTRAN FLD [field selection] and READ( . . . ,END=. . ,ERR=.. ,) are used

11
as well, but sparingly.

6. CONCLUSION

Elements of an extant FORTRAN analyzer have been described. The

analysis package will be useful to three distinct groups. Programmers

will find the analyzer useful for improving their program's speed of

execution and for finding some flow anomalies which might have been

missed otherwise. Managers and systems people will know more about

FORTRAN use in their installations. Finally, individuals charged

with testing, certifying, or accepting software packages will have

an additional tool to measure aspects of interest in reliability testing.

7. REFERENCES

[l] Gentleman, W.M. , and Wichmann, B.A. Timing on computers. SIGARCH 2,

(October, 1973), 20-23.

[2] Hoffmann, R.H. Automated Verification System User's Guide , TRW Note

# 72-FMT-8 Project Appollo, Task MSC/TRW A-5 27, (January, 1972).

[3] Ingalls, D. The execution time profile as a programming tool. In

R. Rustin (ed.), Compiler Optimization , 2nd Courant Computer

Science Symposium (1970), Prentice-Hall, 1972, 107-128.

[k] Knuth, D.E. , and Stevenson, F.R. Optimal measurement points for

program frequency counts. B.I.T. 13, (1973), 313-322.

[5] Larmouth, J. Serious FORTRAN. Software-Practice and Experience 3,

2 (April-June, 1973), 87-10o\

16] Lyon, G.E. Static language analysis. National Bureau of Standards

(U.S.), Technical Note 797, (October, 1973).

[7] Stucki, L.G. Automatic generation of self-metric software.

Proc, 1973 IEEE Symposium on Computer Software Reliability , New York, N.Y. , April 30-May 2, 1973.

12
@RUN

gASG.UP 10.,F///1

@FOR,ISF

INTEGER 1(198)

DATA 1/198*0/

WRITE (10) I REWIND 10

STOP

END

@MAP,ISF A,

A

@XQT A

@ASG,A ANALYZER*FILE

@ASG,T X.

@ASG,UP USER-NAMED*INSTRUFILE.

@USE Y. ,USER-NAMED*INSTRUFILE.

@BRKPT PUNCH$/X

@MAP,ISF B,B

IN ANALYZER*FILE.

@XQT B

.... subject program here ....

@E0F

@ADD PRINTF

@ADD PRINTF

@BRKPT PUNCH$

@ADD X.

@MAP,ISF C,C

IN Y. @XQT C .... test data

@FIN

Run command

Assign and catalog file 10

Compile the FORTRAN program

that follows. It will write

a record of unformatted zeros

on unit 10, a file. This is

done only for the first run; subsequent analyzer results

add to values stored in 10.

Link above compilation

Run above (write 10)

Assign analyzer program file.

Assign a temporary (card image

file) named X. Assign a file (named by user)

for the instrumented source

program.

Refer to it also as Y. Send card punch to file X.

Link analyzer routines.

Load object modules as indicated.

Run the analysis

Analysis reads on unit 5> prints on 6, reads and writes

on 10, writes file X via

unit 1—the punch.

End-of-file on unit 5

PRINTF—need two copies for

output

Close breakpoint ed file X. File X. consists of card

images including IIO8/EXEC-8

control cards, which when

ADDed write the instrumented

source as a program file in Y. Link instrumented version

Load object modules from Y. Run instrumented version

Execution frequencies print

on unit 6 End-of-job

FIGURE 3. Typical first run on HO8/EXEC-8

13
@RUN Run command

@ASG,A 10.

@ASG,A MODIFIED*ANALYZER.

@MAP,ISF A,A

IN MODIFIED*ANALYZER

@XQT A

.... subject program here

@E0F

@ADD PRINTF.

@ADD PRINTF.

@FIN

Assign file 10.

Assign modified analyzer

program file

Link modified analyzer

routines

Load object modules

Run modified analyzer

Analysis reads on unit 5» prints on 6, reads and

writes 10.

Two copies of PRINTF.

End-of-job

FIGURE k. Typical static analysis-only run on EXEC-8

1^
INTEGER LENGTH, TABLE (tOO), ITEM, INDEX, TEMP

RE AOI5,IO)(LENGTH,(TABLE(I>,I«l, LENGTH), ITEM)

10 FORMAT! 12IS) TEMP « LENGTH

CALL FIND? (ITEM, INDEX .LENGTH, TABLE) IFITEMP .NE. LENGTH) GOTO 100 WRITEI6, I I > ( ITEM, INDEX ) 11 F0RMATI1H ,IS,8H IS THE .I5.I7HTH ENTRY IN TABLE)

GOTO 200

100 KRITEI6, 101 ) ITEM

101 FORMATUH ,I5,I9H NOT FOUND IN TABLE)

200 STOP

END SUBROUTINE FIND7I ITEM, INDEX .LENGTH, TABLE)

C FIN07 ATTEMPTS TO LOCATE ITEM IN TABLE .RETURN I NG ITS INDEX IN INDEX

C IF SUCCESSFUL. OTHERWISE, IT PLACES ITEM AT THE END OF TABLE,

C INCREMENTS LENGTH, AND RETURNS THIS NE* VALUE ALSO AS INDEX. IMPLICIT INTEGER (A-Z) INTEGER TABLE! I ) IF (LENGTH 1300, 200, 100

100 00 ISO 1*1 .LENGTH IFITABLE(I) .NE. ITEM) GOTO ISO INDEX - I RETURN

150 CONTINUE

200 LENGTH « LENGTH | 1FILENGTH ,GT. 100) GOTO MOO TABLEILENGTH) « ITEM INDEX LENGTH

RETURN

300 NRITEI6.30I ) 301 FORMATUH .32HNEGATIVE VALUE OF LENGTH ILLEGAL) RETURN

100 WRITEI6.H0I ) 101 FORMATUH , 2MH ALLOC A TED SPACE EXCEEDED)

RETURN

END

FIGURE 5a. The program to be analyzed

15
FORTRAN FREQUENCIES, OCT73, N|.

INTEGER UE NGTH, TABLE! 100). ITEM, INDEX, TF MP <:•••••••••••••••••*•••••*••• SEGMENT I ••••••••••••••••••*••••••••<

READ (5, 10) (LENGTH, (TABLE (I I, I«I, LENGTH), ITEM)

10 FORMAT( I 2151 TEMP » LENGTH

CALL FIND7IITE", INDEX, LENGTH, TABLE)

C«. ••*.••••»••••••••••» SEGMENTS 2 THRU ' 3 ••••••••••••••••••••.

IF(TfMP .NE. LENGTH) GOTO 10" C« •«••••••••••... SEGMENT 1 ••••• ••••••••••••••••«

WRITE)*, 1 I ) I ITEM, INDEX ) 11 FORMATIIH ,15, BH IS THF .IS.I7HTH ENTRY IN TABLE) GOTO 200

C« SEGMENT 5 •• •••••• ••••••••«

100 WRITE (6, 101 ) ITEM

101 FORMATMH , 1 5 , I 9H NOT FOUND IN TABLE)

C»» • ....«• • SEGMENT 6 ••••••••••••••••••••••••••••

200 STOP

END END PASSI , VALUE* I 3 SUBROUTINE FIND7I ITEM, INDEX, LENGTH, TABLE I C FIND7 ATTEMPTS TO LOCATE ITEM IN TABLE , RETURN I NG ITS INOEX IN INDEX

C IF SUCCESSFUL. OTHERWISE, IT PLACES ITEM AT THF END OF TABLE,

C INCREMENTS LENGTH, .AND RETURNS THIS NE* VALUE ALSO AS INOEX. IMPLICIT INTEGER (A-Z) INTEGER TABLE! I ) ^••••••••••••••••••••a SEGMENTS 7 THRU 10 •••••• ••••••••c •••••<

IF (LENGTH | 300,200, 100 €••••••••••••••••••••••••••• SEGMENT II •••••••••••••••••••••••••••<

100 DO ISO I»i .LENGTH C.o.c.a ,.„„.,... •• SEGMENTS 12 THRU 13 ••••»•••••••••••••••<

IF(TABLEII) .NE. ITEM) GOTO ISO C«..«,oi<>o ••>,,••,>. SEGMENT I M •••••••••••••••••••••••••••<

INOEX - I RETURN

C»«»» ...••...•.....•.•• SEGMENT IS •••••••••••••••••••••••••••<

150 CONTINUE

C» .«•• •••••••• SEGMENT 16 •••••••••••••••••••••••••••<

200 LENGTH » LENGTH 1 C*««***.*.e». «..*•••*.• SEGMENTS 17 THRU 18 ••••••••••••••••••••<

IFILENGTH .GT. 100) GOTO HOO C»**«*>****«***«*« ••••• SEGMENT 1? •••••••••••••••••••••••••••<

TABLE(LENGTH) « ITEM

INOEX » LENGTH

RETURN C»»»««« .•....••....... SEGMENT 20 •••••••••••••••••••••••••.

300 WR!TE(6,30I ) 301 FORMATIIH .32HNFGATIVE VALUE OF LENGTH ILLEGAL) RETURN €••••••••••••••••••••••••••• SEGMENT 21 •••••••••••••••••••••••••••<

"•00 WRITE (6, HOI ) *0I FORMAT(|H ,2"»HALL0CATED SPACE EXCEEOEOI

RETURN

END

FIGURE 5b. The annotated source listing

16
LOCAL ANALYSIS-

. 1 OCCURRENCES OF

. 1 OCCURRENCES OF

. 1 OCCURRENCES OF

. 1 OCCURRENCES OF

. 1 OCCURRENCES OF

2 OCCURRENCES OF

5 OCCURRENCES OF

. 4 OCCURRENCES OF

. 3 OCCURRENCES OF <STATEMEN

3

. 1 OCCURRENCES OF

1 OCCURRENCES OF

. 1 OCCURRENCES OF

. 1 OCCURRENCES OF

. 1 OCCURRENCES OF

. <t OCCURRENCES OF

1 OCCURRENCES OF

1 OCCURRENCES OF

• I OCCURRENCES OF

. 3 OCCURRENCES OF

3 OCCURRENCES OF 10 OCCURRENCES OF

12 OCCURRENCES OF

ALSO IF( <S»ITCH>) ,

<ASSIGNMENT> X»... <A5SIGNMENT> XI..)' CALL XI...) CONTINUE

00ENO FORMAT

goto x 1FKBE>KST«TEMENT>

STATEMENT) DATA FOR BOOLEAN IF ARE-- OCCURRENCES OF CODE 59 <ST ATEMENT>S . ILL FORMFD <STATFMENT>S AND IMPROPER <STATEMENT>S. IFKARITH. EXPRESS. >1 NI.N2....

IMPLICIT (..

)

INTEGER X, INTEGER X(..) REAO (..!( RETURN

STOP SUBROUTINE XI..

I

• RITE I .. I I WRI TE I . . I COMMENTS STATEMENTS

LABELED STATEMENTS

COOE

3636

38ss

37

Si

II59

IS

11

2126

26

13

6165

0112

12

FIGURE 6. Static analysis results

IT
TOTAL ANALYSES--

COUNT

, 7 OCCURRENCES OF ACCEPT X

. 7 OCCURRENCES OE ACCEPT I,

. SI 91 OCCURRENCES OE <ASSIGNMENT> X«...

_. 7 OCCURRENCES OF <ASSIGNMENT> D0?..»..

. 7 OCCURRENCES OE <ASSIG'I«*ENT> D09..««.

. 7 OCCURRENCES OF <A5SIGNMF.NT> 009. .'IA

. 7 OCCURRENCES OF <ASSIGNMENT> 001..-A*

esR OCCURRENCES or <ASSIGNMENT> XI..I...

. 7 OCCURRENCES OF ASSIGN

. 7 OCCURRENCES OF BACKSPACE

. 103 OCCURRENCES OF CALL X 20 OCCURRENCES OF CALL <(...)

. 7 OCCURRENCES OF COMMON X 31 OCCURRENCES OF COMMON X,...

. 7 OCCURRENCES OF COMMON X ( .. 1 , . . . _• . 7. OCCURRENCES OF C0.1M0N XC..-1

. 7 OCCURRENCES OF COMMON /../

. 7 OCCURRENCES OF COMPLEX X

. 7 OCCURRENCES OF COMPLEX !,..

. 7 OCCURRENCES OE COMPLEX X (..),..

. 7 OCCURRENCES OE COMPLEX X(..l

.. 10t* OCCURRENCES OF CONTINUE

bih OCCURRENCES OF OATA /../

, 7 OCCURRENCES OF DATA ( .. ) / 23 OCCURRENCES OF DATA X , . . . . 7 OCCURRENCES OF OFCOOE (...)(

11 OCCURRENCES OF 0EF1NE .....

..35 OCCURRENCES OF DIMENSION X (..),. ..

. 7 OCCURRENCES OF DIMENSION X<..)

. MMS OCCURRENCES OF 00

. 7 OCCURRENCES OF DOUBLE COMPLEX X

. 7 OCCURRENCES OF DOUBLE COMPLEX X,

. 7 OCCURRENCES OF OOUBLE COMPLEX XI..),.

_•. . y OCCURRENCES OF DOUBLE COMPLEX XI..)

• 7 OCCURRENCES OF DOUBLF PRECISION X 7 OCCURRENCES OF DOUBLE PRECISION X,

. 7 OCCURRENCES OF DOUBLE PRECISION XI..)

. 7 OCCURRENCES OE DOUBLF PRECISION XI..)

. 7 OCCURRENCES OE ENCODE (..)(

-•_ 65 OCCURRENCES OF END

. 7 OCCURRENCES OF ENTRY X

. 7 OCCURRENCES OE ENTRY X|,..)

. 7 OCCURRENCES OF ENDFILE

. 31 OCCURRENCES OF EQUIVALENCE 1 . . ) , . ..

. 7 OCCURRENCES OE EQUIVALENCE! ..

. 7 OCCURRENCES OF EXTFRNAL X

. 7 OCCURRENCES OF EXTERNAL X, 1033 OCCURRENCES OF FORMAT

. 7 OCCURRENCES OF <FUNCTION> COMPLEX

. 7 OCCURRENCES OF <FUNCTION> OBL PRFC

. 7 OCCURRENCES OF <FUNCTION> OBL CO*PLX

. 9 OCCURRENCES OF <FUNCTION> INTEGER

. 11 OCCURRENCES OF <FUNCTION> LOGICAL

. 7 OCCURRENCES OF <FUNCTION> REAL

1H,

CODE

1696

36

36

36

36

3616

SIS3 « 3838

10

10

1010

1022

2?

22

22SS

11

II

IIIT

1618

18 37

29

21

21

_. 21 - 23

23

23

23

19S6

39

39S820

392S

25

9102

0309

OS

0607

FIGURE 7. Cumulative static results

18
• A OCCURRENCES OE BLOCK OAT* 08

. Ml OCCURRENCES OF GOTO! ... ) , I 90

.' 7 OCCURRENCES OF GOTO I , I ... ) 17 2271 OCCURRENCES OF GOTO I 59 21IS OCCURRENCES OF IF <<BE>KST«TEMENT> ALSO IFKS*ITCH>) ... 15 <STATEMENT> DATA FOR BOOLEAN If »RE —

7 I I 3454

7

OCCURRFNCES OF CODE 36 OCCURRFNCES OF COOE 38 OCCURRENCES OF COOE 12 OCCURRENCES OF COOE 91<STATEMENT>S.

<STATEMENT>S.

<STATEMENT>S.

<STATEMENT>S.

I50S OCCURRENCES OF COOE 59 <STATEMENT>S.

ILL FORMED <ST«TFMENT>S AND IMPROPER <STATEMFNT>S.

. 7 OCCURRENCES OF IFKARITH. EXPRESS. >) ,NI ,N2....

. 9 OCCURRENCES OF IFKARITH. EXPRFSS.>> Nl ,N2, ...

. 7 OCCURRENCES OF IMPLICIT (..!,...

. 9 OCCURRENCES OF IMPLICIT (..)

2 OCCURRENCES OF INTEGER X

• 96 OCCURRENCES OF INTEGER X, •_ *Z OCCURRENCES OF INTEGER XI .. ) , • 2S OCCURRENCES OF INTEGER XI..

• I* OCCURRENCES OF LOGICAL X

. 15 OCCURRENCES OF LOGICAL X,

. 7 OCCURRENCES OF LOGICAL XI..)

,

. 7 OCCURRENCES OF LOGICAL XI. .1

•.... t OCCURRENCES OF NAMELIST

• 7 OCCURRENCES OF PARAMETER

. It OCCURRENCES OF PAUSE

. 7 OCCURRENCES OF PRINT X

. 7 OCCURRENCES OF PRINT X,

. 7 OCCURRENCES OF PUNCH X

. _ 7 OCCURRENCES OF PUNCH X,

.'" 7 OCCURRENCES OF RFAO X

. 7 OCCURRENCES OF READ X,

. IS OCCURRENCES OF READ I..II

55 OCCURRENCES OF READ l..|

. 7 OCCURRENCES OF REAL X

• 19 OCCURRENCES OF REAL X,

. 7 OCCURRENCES OF REAL XI..),

. 7 OCCURRENCES OF REAL XI. .1

. 52 OCCURRENCES OF RETURN

. 7 OCCURRENCES OF RFHINO

. 7 OCCURRENCES OF SKIP FILE

. 7 OCCURRENCES OF SK|P RECORD -. A3 V 39 OCCURRENCES OF STOP

• 19 OCCURRENCES OF SUBROUTINE X

. 18 OCCURRENCES OF SUBROUTINE XI..)

. 7 OCCURRENCES OF TYPE X 7 OCCURRENCES OF TTPE X,

. 7 OCCURRENCES OF UNLOAD V "97 OCCURRENCES OF, •RITE (..)(

. 989 OCCURRENCES OF WRITE I..I

. 2365 OCCURRENCES OF COMMENTS

. '18935 OCCURRENCES OF STATEMENTS

. 3091 OCCURRENCES OF LABELEO STATEMENTS

. 51 OCCURRENCES OF FUNCTIONS OEFINED

. 3 OCCURRENCES OF STATEMENTS IN ERROR 1R OF TTPE UNKNOWN

. 7 OCCURRENCES OF ABNORMAL X 31

FIGURE 7. (continuation)

19
. 7 OCCURRENCES OF ABNORMAL X,

, 7 OCCURRENCES OF ABNORMAL

. 7 OCCURRENCES OF DFLETE N It OCCURRENCES OF OFLETE N,L H OCCURRENCES OF INCLUDE X

• 1? OCCURRENCES OF INCLUDE X.LIST

. 7 OCCURRENCES OF DECODE! 1,

. 7 OCCURRENCES OF OPCODE! ( . 7 OCCURRENCES OF ENCODE! ) , . 7 OCCURRENCES OF ENCODE! )

113151

5152

52

1717

19

19 ««N0RMAL TERMINATION.

FIGURE 7. (continuation)

20
TECH*EXAMPLE .ELT00002

1 SUBROUTINE FIND7C I TEH. INDEX .LENGTH .TABLE)

2 INTEGER IY2L9T 3 IMPLICIT INTEGER <A-Z>

4 INTEGER TABLEvl)

5 IF<.IY2L97< 7. .TRUE. .0.P0-KLEN6TH) ,2))300»£00»100 6 100 DO ISO I=lsLEN6TH

7 IF<IY2L9T< 1 1 . I .EO. 1 .O.DO » 1 0> .EG. 0>CONTINUE

8 IF<IY2L9T< 12.TABLE<I ) .NE . ITEM. 0. DO. 1 ) .EQ.O)60T0130

9 IF<IY2L9T< 14 . .TRUE. .0. DO. 6> .EQ . 0) INDEX«I

1 RETURN

11 150 IF<IY2L9T< 15 . .TRUE . .O.DO . 6) .EQ.0> CONTINUE

12 200 IF<IY2L9TC 16 . .TRUE. .O.DO. 6) .EQ.0>LENGTH--=LErtG7H+l 13 IF<IY2L9T< 17.LEN6TH.GT. 100. O.DO. 1 > .EQ . 0>GOTC400

14 IFCIY2L9TC 19 . .TRUE . .0 .DO . 6) .EG. OTABLEiLENGTH ) = ITEH

15 INDEX * LENGTH

16 RETURN

17 300 IF<IY2L9T< 20. .TRUE. .O.DO. 6) .EO.0)KRITE<6.301)

18 301 FQRMATCIH .32HNE6A7IVE VALUE OF LENGTH ILLEGAL)

19 RETURN

20 400 IF<IY2L9T< 21 . .TRUE . .O.DO. 6) .EQ.0)WRITE<6.401>

21 401 FORMA7C1H .24HALLOCA7ED SPACE EXCEEDED)

22 RETURN

23 IFCIY2L9TC 21 . .TRUE . .O.DO. 9>.EQ.0)STOP

24 END

TECH»EXAMPLE .ELT00001

1 INTEGER LENGTH. TABLEUOO). ITEM. INDEX. TEMP

2 INTEGER IY2L9T

3 IFCIY2L9TC 1 , .TRUE. .0 .DO . 6> .EQ. 0>PEAIK5.1 0)LENGTH.< TABLE < I

)

»I» 4 »1. LENGTH). ITEM

5 10 F0FMAT<12I3>

6 TEMP = LENGTH

7 CALL FIND7CITEM. INDEX. LENGTH. TABLE)

8 IF<IY2L9T< 2 .TEMF .NE .LENGTH . .DO . 1 > .EQ. 0>GDTOl CO 9 IF<IY2L9T< 4 . .TRUE . .0 .DO . 6> .EQ. 0>WPITE<6 . 1 1 )< ITEM. INDEX)

10 II FORMATC1H .I5.8H IS THE .I5.17HTH ENTRY IN TABLE)

11 GOTO 200

12 100 IFCIY2L9TC 5 . .TRUE . .O.DO. 6) .EQ. 0)WRITE<6.1 01 )ITEM

13 101 FORMATOH .I5.19H NOT FOUND IN TABLE)

14 200 IF<IY2L9T< G, .TRUE . .O.DO. 8).EG.0)STDP

15 IFUY2L9TC 6. .TRUE. .O.DO. 9).EQ.0)STOP

16 END

FIGURE 8. Additional instrumented-prograra elements

21
TECH»EXRHPl.E .ELTIY2L9T

1 INTEGEP FUNCTION IY2L9T<:::EGNa.BE .RE.EHT)

2 INTEGER rEGM0.£NT,IRE,SE6FR<3< 21)

3 DOUBLE PRECISION RE

4 LOG I CfiL BE

5 DRTR 3EGFRQ^ 21*0^

6 INTE6EP HLINES.HPRGES.PTPRGE.LPERPG.flULT.ENIILIN

7 DRTfl LPEPP6'50'

8 SEGFPQ < SEGNO > =3EGFPO < SEGNO t * 1 9 GOTO' 10 .2 0.3 0.40. 50. 60 .70. 80. 90. 100) »ENT

10 10 IF<BE>GOTO 11 11 IY2L9T=1

12 RETURN

13 11 3EGFPG<.SEGI10+l>=3EGFRQ<SEGND*i)*l

14 IY2L9T«0

15 RETURN

16 20 IF<RE>21. 22. 23

1? 21 -egfro<segno+i>=segfrq<segno+i>+i

18 IY2L9T=-1

19 RETURN

20 22 3EGFPOCSE6N0+2)=SEGFRO<:SE6N0+2> + l 21 IY2L9T=0

22 RETURN

23 23 3EGFRGK3EGNO+3>=SE6FRO<SE6NO*3>*1

24 IY2L9T=1 25 RETURN

26 30 IRE=RE+DSI6N<: .2D0.RE) 27 3EGFRCKSE6N0+IRE>=SEGFPQ< SEGNO* IfiE>*l 28 IY2L9T=0

29 RETURN

30 40 IF<BE)GOTO 41

31 IY2L9T*1

32 RETURN

33 41 IY2L9T=0

34 RETURtt 35 50 IFCEE>GOTO 51 36 IY2L9T=1

37 RETUPN

38 51 3EGFPQ<.SEGH0*l> = iE6FRC<3E6N0+l>*l.

39 IRE=RE+DSIGNf .2D0.RE> 40 • SEGFPQ < SEGNO* l* I RE > = SEGFR0<:SE6N0-i-l + IRE > + l 41 IY2L9T=0

42 RETUPN

43 60 IY2L9T=0

44 RETUPN

45 70 IF<BE>GOTO 71 46 IY2L9T=1

47 RETURN

48 71 SE6FPGK SEGNO* 1>=SE6FRQ< SEGNO* 1>*1 49 80 IY2L9T=0

50 NLINES= 21^10+1

51 PTPRGE=NLINEi-<:NLINES^LPERPG;.*LPERP6

52 IF<PTPRGE.NE.0)PTPRGE»1

53 NPRGES=<NLINES'LPERP6>+PTPft6E

54 MULT=0

55 DO 88 IPR6E=1 .NPR6ES 56 yRITEk 6.81) 57 81 FORHRTOH1 .4 0X .29HSEGHENT EXECUTION FREQUENCIES.

58 MRI7EC 6.82X1.1 = 1.9) 59 82 FOPMRTCIH ,4X > 1HX .5X.7H 0>9<2X.I7) .•> 60 DO 87 ILINE=1 .LPEPP6

61 IFCHULT.GT. 21>GDTO 89 "62 IF<MULT.NE.0''GOTO 84 63 MPITE< 6.83XMULT>CSEGFRtKI>.I-1.9>>

64 83 FOPMRTOH .I5.5X.7H ,9<2X»I7>) 65 GOTO 86

66 84 ENDLIN=flULT+9 67 IFCENDLIN.GT. 21>ENDLIN= 21 68 UIPITE< G.SSXNULT.CSEGFRef I > . I*HULT .ENDLIH)) 69 85 FOPMRTfiH ,I5»3X.10(2X.I7))

70 86 MULT=nULT+10

71 87 CONTINUE

72 88 CONTINUE

73 S9 RETUPN

74 90 SEGFPQ<SE6N0)=SEGFPQ<SE6NO)-l

73 GOTO 8 76 100 IF<.N0T.BE)SE6FP0<SEGN0)=SEGFP0fSE6N0>-t

77 IY2L9T=0

78 RETURN

79 END

FIGURE 8. (continuation)

22
•o — —

— - — a

FIGURE 9. Dynamic analysis results

23
NBS-114A (REV. 7-73)

U.S. DEPT. OF COMM. BIBLIOGRAPHIC DATA

SHEET

1. PUBLK ATION OR REPORT NO. NBS TN-8492. Gov't Ac

No.

3. Recipient's Accession No.

4. title ami subtitle

A FORTRAN ANALYZER

5. Publication Date- October 1974

6. Performing Organization Code

7. AUTHOR(S)

Gordon Lyon & Rona B. Stillman

I. Performing Organ. Report No.

9. PERFORMING ORGANIZATION NAME AND ADDRESS NATIONAL BUREAU OF STANDARDS DEPARTMENT OF COMMERCE

WASHINGTON. D.C. 20234

10. Project/Task/Work Unit No. 640-1125

11. Contract/Grant No. AG-350

12. Sponsoring Organization Name and Complete Address (Street, City, State, ZIP)

Institute for Computer Science and Technology

National Bureau of Standards

13. Type of Report & Period Covered

14. Sponsoring Agency Code

15. SUPPLEMENTARY NO 1 1 S

Library of Congress Catalog Card Number: 74-600144

16. ABSTRACT (A 200-word or less factual summary of most significant information. If document includes a significant bibliography or literature survey, mention it here.) Details of a FORTRAN analysis package are presented . Examples illustrate

a current operational level which gathers FORTRAN statement and frequencyof-execution statistics. Arguments support a simple technique for

monitoring FORTRAN executions.

17. KE1

! WORDS (six to twelve entries: alphabetical order; capitalize only the first letter of the first key word unless a proper name; separated by semicolons

Computation and flow analysis; FORTRAN language use; programming aids;

syntax analysis.

18. AVAILABILITY Unlimited

For Official Distribution. Do Not Release to NTIS

Washington, D.C. 20102, SD Cat. No. CI? 'mm

Order From National Technical Information Service (NTIS1

Springfield, Virginia 22 I M

19. SECURITY CLASS

(THIS REPORT)

UNCLASSIFIED

20. SECURITY CLASS

(THIS PAGE)

UNCLASSIFIED

21. NO. OF PAGES

28

22. Pricecents

JSCOMM.DC 29042-P74

US GOVERNMENT PRINTING OFFICE: m*—583 012:20
NBS TECHNICAL PUBLICATIONS

PERIODICALS JOURNAL OF RESEARCH reports National Bureau

of Standards research and development in physics, mathematics, and chemistry. Comprehensive scientific papers give complete details of the work, including laboratory data, experimental procedures, and theoretical and mathematical analyses. Illustrated with photographs, drawings, and charts. Includes listings of other NBS papers as issued. Published in two sections, available separately:

• Physics and Chemistry (Section A)

Papers of interest primarily to scientists working in these fields. This section covers a broad range of physical and chemical research, with major emphasis on

standards of physical measurement, fundamental constants, and properties of matter. Issued six times a

year. Annual subscription: Domestic, $17.00; Foreign,

$21.25. • Mathematical Sciences (Section B)

Studies and compilations designed mainly for the mathematician and theoretical physicist. Topics in mathematical statistics, theory of experiment design, numerical analysis, theoretical physics and chemistry, logical design and programming of computers and computer

systems. Short numerical tables. Issued quarterly. Annual subscription: Domestic, $9.00; Foreign, $11.25. DIMENSIONS/NBS (formerly Technical News Bulletin) —This monthly magazine is published to inform

scientists, engineers, businessmen, industry, teachers,

students, and consumers of the latest advances in science and technology, with primary emphasis on the work at NBS. " DIMENSIONS/NBS highlights and reviews such

issues as energy research, fire protection, building technology, metric conversion, pollution abatement,

health and safety, and consumer product performance.

In addition, DIMENSIONS/NBS reports the results of Bureau programs in measurement standards and techniques, properties of matter and materials, engineering standards and services, instrumentation, and automatic

data processing. Annual subscription: Domestic, $6.50; Foreign, $8.25.

N0NPERI0DICALS Monographs—Major contributions to the technical liter- ature on various subjects related to the Bureau's scientific and technical activities. Handbooks—Recommended codes of engineering and

industrial practice (including safety codes) developed

in cooperation with interested industries, professional organizations, and regulatory bodies. Special Publications—Include proceedings of high-level national and international conferences sponsored by NBS, precision measurement and calibration volumes, NBS annual reports, and other special publications appropriate to this grouping such as wall charts and

bibliographies. Applied Mathematics Series—Mathematical tables, manuals, and studies of special interest to physicists, engineers, chemists, biologists, mathematicians, computer programmers, and others engaged in scientific and technical work.

National Standard Reference Data Series—Provides

quantitative data on the physical and chemical properties of materials, compiled from the world's literature and critically evaluated. Developed under a world-wide program coordinated by NBS. Program under authority

of National Standard Data Act (Public Law 90-396). See also Section 1.2.3.

Building Science Series—Disseminates technical infor- mation developed at the Bureau on building materials, components, systems, and whole structures. The series presents research results, test methods, and performance criteria related to the structural and environmental functions and the durability and safety characteristics of building elements and systems.

Technical Notes—Studies or reports which are complete

in themselves but restrictive in their treatment of a

subject. Analogous to monographs but not so comprehensive in scope or definitive in treatment of the subject area. Often serve as a vehicle for final reports of work performed at NBS under the sponsorship of other government agencies. Voluntary Product Standards—Developed under pro- cedures published by the Department of Commerce in Part 10, Title 15, of the Code of Federal Regulations. The purpose of the standards is to establish nationally recognized requirements for products, and to provide

all concerned interests with a basis for common under- standing of the characteristics of the products. The

National Bureau of Standards administers the Voluntary Product Standards program as a supplement to the activities of the private sector standardizing

organizations. Federal Information Processing Standards Publications (FIPS PUBS)—Publications in this series collectively constitute the Federal Information Processing Standards Register. The purpose of the Register is to serve

as the official source of information in the Federal Gov- ernment regarding standards issued by NBS pursuant

to the Federal Property and Administrative Services Act of 1949 as amended, Public Law 89-306 (79 Stat. 1127), and as implemented by Executive Order 11717

(38 FR 12315, dated May 11, 1973) and Part 6 of Title 15 CFR (Code of Federal Regulations). FIPS PUBS

will include approved Federal information processing standards information of general interest, and a complete index of relevant standards publications. Consumer Information Series—Practical information, based on NBS research and experience, covering areas

of interest to the consumer. Easily understandable language and illustrations provide useful background

knowledge for shopping in today's technological marketplace. NBS Interagency Reports—A special series of interim

or final reports on work performed by NBS for outside sponsors (both government and non-government). In

general, initial distribution is handled by the sponsor;

public distribution is by the National Technical Infor- mation Service (Springfield, Va. 22151) in paper copy

or microfiche form. Order NBS publications (except Bibliographic Subscription Services) from: Superintendent of Documents, Government Printing Office, Washington, D.C. 20402. BIBLIOGRAPHIC SUBSCRIPTION SERVICES

The following current-awareness and literature-survey bibliographies are issued periodically by the Bureau:

Cryogenic Data Center Current Awareness Service

(Publications and Reports of Interest in Cryogenics). A literature survey issued weekly. Annual subscription: Domestic, $20.00; foreign, $25.00. Liquefied Natural Gas. A literature survey issued quarterly. Annual subscription: $20.00. Superconducting Devices and Materials. A literature survey issued quarterly. Annual subscription: $20.00. Send subscription orders and remittances for the preceding bibliographic services to the U.S. Department

of Commerce, National Technical Information Service, Springfield, Va. 22151. Electromagnetic Metrology Current Awareness Service (Abstracts of Selected Articles on Measurement

Techniques and Standards of Electromagnetic Quantities from D-C to Millimeter-Wave Frequencies).

Issued monthly. Annual subscription: $100.00 (Special rates for multi-subscriptions). Send subscription order and remittance to the Electromagnetic Metrol- ogy Information Center, Electromagnetics Division, National Bureau of Standards, Boulder, Colo. 80302.
U.S. DEPARTMENT OF COMMERCE

National Bureau of Standards

i/Vashington, O.C. 20334

OFFICIAL BUSINESS

Penalty for Private Use. $300

POSTAGE AND FEES PAID

U.S. DEPARTMENT OF COMMERCE COM-215 PSO&MAIL

|

•

'^6-19l6