Univac super-Fortran for the 1108
Series of extensions to Fortran IV by UNIVAC for the 1103 Scientific computer
from the 1108 system guide:
"FORTRAN V is an algebraic language designed primarily for scientific and engineering computations. It closely resembles the language of mathematics. It is the logical outgrowth of the earlier FORTRAN languages and is generally compatible with them (although the earlier languages are not a proper subset of FORTRAN V). The FORTRAN V language has been extended to provide more flexibility in data handling and to make programming easier. FORTRAN V, being an outgrowth of the earlier FORTRAN languages (in particular, UNIVAC 1107 FORTRAN IV and IBM FORTRAN IV as announced in IBM form C-28-6274-1), accepts these languages as compatible although the reverse is not necessarily true.
FORTRAN V has all the features of the proposed ANSI FORTRAN IV language plus many valuable extensions which significantly increase the power and flexibility of the language, particularly in the areas of data handling. For further information, consult the FORTRAN V Programmers Reference Manual, VP-4060 (current revision)."
10.4. FORTRAN V
FORTRAN V is an algebraic language designed primarily for scientific and engineering computations. It closely resembles the language of mathematics. It is the logical outgrowth of the earlier FORTRAN languages and is generally compatible with them (although the earlier languages are not a proper subset of FORTRAN V). The FORTRAN V language has been extended to provide more flexibility in data handling and to make programming easier. FORTRAN V, being an outgrowth of the earlier FORTRAN languages (in particular, UNIVAC 1107 FORTRAN IV and IBM FORTRAN IV as announced in IBM form C-28-6274-1), accepts these languages as compatible although the reverse is not necessarily true.
FORTRAN V has all the features of the proposed ANSI FORTRAN IV language plus many valuable extensions which significantly increase the power and flexibility of the language, particularly in the areas of data handling. For further information, consult the FORTRAN V Programmers Reference Manual, VP-4060 (current revision).
10.4.1. Language Extensions and Enhancements
The following extensions and enhancements are currently available in UNIVAC 1108 FORTRAN V.
? The PARAMETER statement assigns specified integer values to specified variables at the time of compiling; PARAMETER I = 2 replaces I with the integer 2 whenever it occurs in the source program. This facilitates the assign ment of different values to frequently used parameters in different compilations of the same program.
? The ABNORMAL statement permits increased optimization of object programs. Where common subexpressions occur within a program unit, it is obviously desirable to evaluate each subexpression only once. Where the common sub expressions contain function references, however, there is a possibility that the function will produce a different result upon successive references with the same arguments. Because of this possibility, most FORTRAN systems are forced to reevaluate subexpressions containing function references at each occurrence. UNIVAC FORTRAN V permits all functions that can produce different results from identical sets of arguments to be designated ABNORMAL, All common expressions except those that reference ABNORMAL functions are evaluated only once. When the ABNORMAL statement does not appear at all in a program, all function references except library functions are considered ABNORMAL and are reevaluated at each occurrence, as in most other FORTRAN systems.
? Nonstandard subroutine returns (of the form RETURN k) are permitted where k specifies the subroutine argument to which a return is made.
? In conjunction with RETURN statements, statement labels may be used as subprogram arguments.
? A variable may have up to seven subscripts.
? Internal subprograms are permitted; that is, main program or subprogram and internal subprograms are part of the same program unit, which requires only one compilation.
? Variables of different types may occur in the same expression with two exceptions: Logical variables cannot be mixed with other types. Double precision and complex variables cannot be mixed.
? Extended subscript expressions are permissible having the form ±M^±M2.--±M^ where M is of the form Ki*K2*K3...Kj. The K's represent either an integer constant, an unsubscripted integer variable, or a parameter variable. No more than one K may be a DO index.
? Forward and Backward DO Loops (that is, increasing and decreasing index variable) are permitted.
? A generalized assigned GO TO may be used; the assigned GO TO need not have a list of possible assignments.
The following language extensions and enhancements, not available with FORTRAN IV or earlier versions, are now available with FORTRAN V:
? A string of consecutive bits, called a field, may be defined and operated on by making use of the FLD (e1,e2,e3) intrinsic function, where e1 and e2 determine a field of the expression e3. In this instance, e1 and e2 are integer expressions which give the starting position (e1) and the length (e2) of the field being defined. The FLD function may be used for extraction and insertion of bit fields.
? The NAMELIST statement which is nonexecutable provides data-characteristic information at object time, and may be used instead of specifying LIST on an INPUT/OUTPUT statement and the associated FORMAT. A NAMELIST name (1?6 alphanumeric characters) is defined by its appearance in a NAMELIST statement, and thereafter may appear only in formatted READ and WRITE statements.
? The DEFINE statement is of the form DEFINE R(a1, ..., an) = e or DEFINE R = e, where R and ai are variable names and e is any expression not involving any undefined R's. Inline code is generated when a DEFINE is referenced, thereby eliminating the overhead of a subroutine and enabling the optimizing capabilities to apply.
Such a statement provides the following benefits:
? All statement functions of FORTRAN IV operate more efficiently at object time.
? Mathematical equivalence between arrays and variables can be attained.
? Subscripting of subscripts is in effect, permitted to any level.
? Any legal FORTRAN V expression can be treated as a subscript expression.
? Dynamic storage allocation can be achieved.
? The INCLUDE statement is of the form INCLUDE n, LIST where n is the name assigned to a set of FORTRAN statements previously filed with the procedure definition processor which are to be included in the program at this point. The word LIST is optional and if entered, the "included" statements will be listed whenever the source program is listed. Thus, a frequently used number of state ments (for example, specification statements or a set of internal subprograms) may be added to the source code from an internally available element.
? The IMPLICIT type statement of the form IMPLICIT type (a1,a2,an), type (b1, b2, ...bn) where type is INTEGER, REAL, LOGICAL, DOUBLE PRECISION or COMPLEX and the ai represent alphabetic characters or a range of alphabetic characters. The IMPLICIT type statement allows the user to declare the type of variables by specifying that variables beginning with certain designated letters (the ai) are of a certain type.
? The ENTRY statement is of the form ENTRY name (a1,a2, ..., an) where name is the name of an entry point and where the aj are dummy arguments. The entry statement permits an entry to an internal or external subroutine or function by a CALL statement or a function reference to an ENTRY statement. Entry is made at the first executable statement following the ENTRY statement.
? The compile time-interpretive DELETE statement provides the programmer with a simple facility to prevent compilation of a section of source code. It is of the form DELETE n or DELETE n, V where n is a statement label and V is the integer 0 or 1 (or is a name assigned the value 0 or 1 by the PARAMETER statement). V=0 implies that the DELETE statement is not effective while V = l implies that DELETE is effective.
? FORTRAN V processes double precision quantities in 1108 double precision format, within:
- The FORTRAN V Compiler
- Mathematical function routines (where appropriate)
? The I/O Conversion routines
- Compiled FORTRAN V programs
? The arithmetic type of the argument to library and intrinsic functions is used by the compiler to determine the correct function routine to be called (namely, SQRT, DSQRT or CSQRT for REAL, DOUBLE PRECISION or COMPLEX arguments, respectively.)
? The 1108 FORMAT Control has been augmented by the addition of new FORMAT control specifications in the following forms:
Gw.d - used for input and output of any of the five types of variables. If the output item is REAL, E or F editing code is used depending on magnitude.
Tw - causes the pointer in an input or output record to point to the wth character in the record.
Lw - is logical field specification.
? A "Master Space" character (7?8 keypunch) will cause the compiler to ignore all subsequent information on the line. The space thus ignored may be used for comments.
? Hollerith Strings may have the form 'c1,c2,..., Ci' where cj is any Hollerith character, including blank.
? In a typeless expression the computer word (36 bits) is considered as a bit string. Permissible typeless expressions are alphanumeric constants and Boolean functions. The Boolean functions are AND (e1, e2), OR(e1, e2), BOOL(e1), COMPL(e1), and XOR(e1, e2).
An additional input statement of the form READ (unit, format, ERR=n, END=m) is included. The END and ERR clauses can only be indicated in the third or fourth argument positions. Control changes to statement number n if an input error is encountered. Control goes to statement number m if an end-of-file is encountered.
? Free-field input is specified by an empty FORMAT statement:
READ (5,100) A,B,C 100 FORMAT ( )
? In a subroutine or function subprogram the maximum dimension for an array may be transferred as an argument. In FORTRAN V, the information may be provided by COMMON.
? An array may be dimensioned in an explicit type statement by including the dimension parameters in parentheses.
? The EDIT .statement provides the user the option of suppressing and restoring compiler listings for any part of the program, overriding control card listing options. Valid forms of the statement are: START EDIT SOURCE START EDIT CODE STOP EDIT SOURCE STOP EDIT CODE
? FORTRAN V accepts & (2 ? 8 punch) preceding a label as an argument for use in a subroutine or function subprogram to indicate the transmission of a statement label.
? Data will be accepted in the explicit type statement or DIMENSION statements; for example, REAL A/1. 51/,B(2,3)/6*1.01/.
10.4.2. Compiler Organization
The 1108 FORTRAN V source language processor accepts FORTRAN statements and produces a highly efficient relocatable object code element. FORTRAN, like all other UNIVAC 1108 processors, generates its own code and does not require an assembler pass.
The FORTRAN V compiler is modular and consists of six phases. Although the phases have been separated on the basis of general operations performed on the source program, not every phase processes the entire program.
The compiler, while quite as rapid as a processor, produces an object program optimized with respect to both storage requirements and execution time.
The compilation process involves the successive execution of the six phases summarized in the following list:
Phase 1 transforms the FORTRAN V program source code into an internal format. Files and tables of relational information, implicit in the source program but not easily accessed, are constructed.
Phase 2 deals with storage assignments for variables and performs an analysis of loops.
Phase 3 deals with arithmetic optimization and index register optimization. Phase 4 deals with loop optimization.
Phase 5 deals with code generation and storage assignment for those quantities not assigned storage by Phase 2.
Phase 6 the final phase, completes the generated instructions in a relocatable binary format and optionally edits all output, including error messages.
The compiler performs several types of optimization on a source program:
? Local Optimization
This involves the reduction of expressions involving nothing but constants to a single constant.
? Inter-statement Arithmetic Optimization
This optimization has three forms: (a) the elimination of redundancies in loading of index and arithmetic registers, (b) the recognition of common subexpressions from previous statements, and (c) the removal from a loop of those computations within a loop structure which are constant relative to the loop.
? Inter-statement Indexing Optimization
This involves a study of the DO-loop structure, entries and exits from loops, the form of subscripts and the loop parameters. pdf