Comparison of HP FORTRAN 77 and FORTRAN 66/V [ HP FORTRAN 77/iX Reference ] MPE/iX 5.0 Documentation
HP FORTRAN 77/iX Reference
Comparison of HP FORTRAN 77 and FORTRAN 66/V
FORTRAN 66/V is an implementation of ANSI FORTRAN (X3.9-1966) with
several extensions to the standard. Listed below are some of the
differences between FORTRAN 66/V and HP FORTRAN 77. This is not a
complete list of differences, but most of the significant features are
compared. For more information about differences between FORTRAN 66/V
and HP FORTRAN 77, see the FORTRAN 66/V to HP FORTRAN 77/V Migration
Guide.
* Free-format source code is allowed in FORTRAN 66/V, but not in HP
FORTRAN 77.
* Identifiers in HP FORTRAN 77 can contain an underscore (_) or a
dollar sign ($). Neither of these is allowed in FORTRAN 66/V.
* The default size of integers in FORTRAN 66/V is two bytes
(INTEGER*2), while in HP FORTRAN 77 it is four bytes (INTEGER*4).
INTEGER*4 is termed DOUBLE INTEGER in FORTRAN 66/V.
* The default size of logicals in FORTRAN 66/V is two bytes
(LOGICAL*2). In HP FORTRAN 77 it is four bytes (LOGICAL*4).
FORTRAN 66/V does not support LOGICAL*4.
* HP FORTRAN 77 has DOUBLE COMPLEX and BYTE data types.
* Both HP FORTRAN 77 and FORTRAN 66/V support character substrings;
however, the notation is different in the two compilers. In HP
FORTRAN 77, the size of the array and length of the string for
character variables are in the opposite order from FORTRAN 66/V.
* The syntax and semantics of substring designators are different in
FORTRAN 66/V and FORTRAN 77.
* Partial word designators exist in FORTRAN 66/V but not FORTRAN 77.
Bit extraction is accomplished in FORTRAN 77 by the IBITS and
MVBITS functions.
* The notation for octal, character, and hexadecimal constants is
different in the two compilers.
* In FORTRAN 66/V, only the upper bound of an array is specified.
The lower bound is always assumed to be 1. In HP FORTRAN 77, both
upper and lower bounds can be given. If the lower bound is
omitted, it is assumed to be 1.
* FORTRAN 66/V has a symbol table size limit of 8191 words. This
restriction does not exist in HP FORTRAN 77.
* HP FORTRAN 77 provides a concatenation operator for character
variables. This feature is not available in FORTRAN 66/V.
* HP FORTRAN 77 provides the additional logical operators .EQV. and
.NEQV..
* The order of evaluating comparisons using the logical IF statement
is different in the two compilers.
* The order for evaluating arithmetic expressions with two or more
operators of the same precedence is different in the two
compilers. In HP FORTRAN 77, the evaluation is right to left for
exponential and left to right for all other operations.
* Mixed mode expressions are evaluated differently in the two
compilers.
* The PROGRAM statement in HP FORTRAN 77 can include parameters that
enable the program to access the PARM value and the INFO string of
the run string. The PROGRAM statement in FORTRAN 66/V has no
parameters.
* The PARAMETER statement in HP FORTRAN 77 allows the use of
constant expressions. In FORTRAN 66/V, only a simple constant can
be assigned.
* HP FORTRAN 77 has a SAVE statement that is not available in
FORTRAN 66/V. It allows variables in a subroutine to be saved from
one call of the subroutine to the next.
* In HP FORTRAN 77, the IF and DO statements are greatly expanded to
provide more structured programming constructs. These statements
are a superset of those provided in FORTRAN 66/V.
* HP FORTRAN 77 provides an INCLUDE statement and an $INCLUDE
compiler directive that allow source from another file to be
included. This feature is not available in FORTRAN 66/V, which
uses MASTERFILES and NEWFILES for source control.
* HP FORTRAN 77 has a number of I/O statements not available in
FORTRAN 66/V. In HP FORTRAN 77, OPEN, CLOSE, and INQUIRE
statements are provided, so there is no need to call system
intrinsics to do routine I/O operations.
* In HP FORTRAN 77, all I/O statements allow a status word and error
label as optional parameters. In FORTRAN 66/V, the error label is
allowed in some (but not all) of the I/O statements, and status
words are not allowed.
* HP FORTRAN 77 does not contain the ACCEPT and DISPLAY statements,
as FORTRAN 66/V does.
* There are significant differences in the format and edit
descriptors of HP FORTRAN 77 and FORTRAN 66/V.
* The S edit descriptor has different meanings in the two compilers.
* In HP FORTRAN 77, functions can have empty parameter lists. This
is denoted by (). In FORTRAN 66/V, a formal parameter has to be
passed to a function for which there would otherwise be no
parameter.
* These compiler directives and options are part of FORTRAN 66/V but
not HP FORTRAN 77:
CONTROL CROSSREF ALL CONTROL FIXED CONTROL NOSTAT ERRORS
CONTROL CROSSREF CONTROL FREE CONTROL SOURCE TRACE
CONTROL ERRORS CONTROL LABEL CONTROL STAT
CONTROL FILE CONTROL NOLABEL EDIT
* The syntax of many compiler directives differs between FORTRAN
66/V and HP FORTRAN 77. Also, some FORTRAN 66/V compiler
directives are system dependent in FORTRAN 77 and may not be
available on all operating systems. See Chapter 7 for
details.
* In FORTRAN 66/V, the condition code is accessed by using .CC. in
an arithmetic IF statement. HP FORTRAN 77 provides an INTEGER*2
function, CCODE, that can be used wherever an integer expression
is allowed.
* In FORTRAN 77 parentheses are required around parameters in
PARAMETER statements.
* Some functions have different names in FORTRAN 66/V and FORTRAN 77
because of different default parameter types.
* While FORTRAN 66/V reserves one word for constants passed as
parameters, FORTRAN 77 reserves two words. Therefore you must use
caution in FORTRAN 77 when passing parameter constants from
procedures in other languages.
* Logical items are implemented very differently in FORTRAN 66/V and
FORTRAN 77. (However, compiler directives that eliminate this
incompatibility are available. See Chapter 7 for further
information.)
* Some FORTRAN 66/V functions don't exist in FORTRAN 77. See the
FORTRAN 66/V to HP FORTRAN 77/V Migration Guide for a list of
these functions.
* When FORTRAN 66/V passes a character variable to a subprogram, it
passes a character pointer alone. When FORTRAN 77 passes a
character variable, it passes a length parameter in addition to
the character pointer. (The extra length parameter should be
taken into account to avoid exceeding parameter limits in FORTRAN
77.)
* FORTRAN 66/V allows composite numbers, whereas FORTRAN 77 does not
allow them.
* Debug line notation is different in FORTRAN 66/V and FORTRAN 77.
MPE/iX 5.0 Documentation