The system recently mounted on the PDP15 is RSX PLUS III which includes as a subset a new version of DOS. This has the benefit that existing users can continue to use DOS and also RSX software development can take place without having to dump and restore operating systems. It is possible to switch to RSX simply by typing the DOS system command RSX.
It is hoped that this new version of DOS will be the regular system. Users can easily recognize whether the new system is there or not as it identifies itself as DOS V3A000 (the previous system was DOS V2A) and the LOGOUT command clears the screen if 'VT ON' is in force.
The important difference for existing users of DOS concerns FORTRAN programs. The FORTRAN compiler version 44 and subsequent versions produce compiled code which is incompatible with previous versions. Some MACRO-15 routines which are called by FORTRAN programs will also have to be changed.
Full details if you need them are given in the document from DEC "PD15 FORTRAN IV F4 V3A000 Improvements, Changes and Conversions Aids", which is attached to this paper.
Some obvious benefits are that a FORTRAN subroutine can include a dummy array with adjustable dimensions and that an array in COMMON can now be greater than 8192 integers. For example, it would appear that a subroutine can include the following code (if there was 32K of available space!).
SUBROUTINE SUB (ARRAY, N) DIMENSION ARRAY (AN), ICOM (32000) COMMON /BLK/ ICOM
The full list of improvements is in the attached document.
A program that is used by calling 'E program-name' and which was last CHAIN'd under DOS V2A can be left alone.
In any other case, the following points MUST be considered:
(1) All FORTRAN files must be recompiled, including your own copies of "PDPI5 FORTRAN library routines".
(2) A11 MACRO routines that used FORTRAN array headers (as distinct from array element) should be rewritten (see the attached document).
(3) All MACRO routines that make calls to the FORTRAN I/O system OTS and the library routine .SS will probably have to be rewritten (see attached document). This also applies to all FORTRAN files using ADJ1 to adjust dimension.
(4) There are new compile-time and run-time diagnostics (see attached document).
If there are any problems with the FORTRAN compiler, see JRG.
Product Code: DEC--15-LFCMA--A-D Product Name: PDP-15 FORTRAN IV FA V3A000: Improvements, Changes and Conversion Aids Date Created: February 1974 Maintainer: Development CONTENTS INTRODUCTION OVERVIEW Improvements to FORTRAN Language Improvements to FORTRAN Operation FORTRAN IV V3A000 CONVERSION AIDS Basic Conversions New Compiler Switch, H Passing Array Addresses to FORTRAN Subprograms Receiving Array Addresses from FORTRAN Calling Programs Dummy Arrays and Adjustable Arrays In Line Subscript Calculations Revisions Input/Output Routine Calling Sequences Behavioural Changes in .SS DIAGNOSTICS New and Changed Compiler Diagnostics CORRECTIONS TO FORTRAN OPERATION
This document has been prepared to aid in the change over from PDP-15 FORTRAN IV Language version F4 036 to that supplied with RSX PLUS III and DOS-15 (version 3A) software systems, version F4 V3A000. It was written for the experienced programmer and should not be thought of as a user's guide or operating guide. For that information the reader is referred to the PDP-15 FORTRAN IV LANGUAGE MANUAL (DEC-15-LFLMA-A-D) and the PDP-15 FORTRAN IV OPERATING ENVIRONMENT MANUAL (DEC-15-LFEMA-A--D).
Herein the experienced programmer will find the necessary instructions required to have existing FORTRAN and other programs operate under the revised system.
It should be noted that the Conversion Aids section of this document is written for the systems programmer or advanced programmer only.
1. Any valid form of a Hollerith constant may be used in a DATA statement; these forms are 'CHARS', $CHARS$, "CHARS", or nHCHARS. CHARS is a string of one to five characters, and when used, n is the number of characters. These Hollerith constants may initialize elements of any data type; if the element is an integer, only one or two characters may be used in the Hollerith constant.
2. A and R conversion types may now be used in FORMAT statements when input or output is of an integer type element. They cannot be used interchangeably; data input to an integer in A format must be output in A format (or similarly for R format); and only A format may be used to output an integer initialized with a Hollerith constant in a DATA statement.
3. Either Real or Double Precision variables may be input or output with any of the E, F, D, or G type format conversions. On input, any form of the possibilities for floating point numbers may be used for any of the above format specifications for data input to either Real or Double Precision variables. Similarly, any such variable may be output with any of the above format types, which format type describes the form in which the value will be output.
4. The real parameters of subprogram calls allow the interchangeable use of array names with any other possible real parameter. When the array name is used, the address of the first element of the array is passed. Further if the subprogram uses a dummy array parameter, the address passed to it is used as the address of the first element of the dummy array.
5. Dummy arrays may contain adjustable dimensions; that is, the dimensioning declaration statement of a dummy array may contain any combination of integer constant and dummy integer variable size declarators. Adjustable dimensioning is made only when entry is made via a SUBROUTINE or FUNCTION statement. The values of the adjustable dimensions may be changed in the subprogram without changing the dimension to which the array was initially set. The subroutines ADJ1, ADJ2, and ADJ3 are deleted from the library, as the adjustable dimension feature performs their function.
6. Arrays that are declared to exist in a Common Block may be dimensioned to be larger than 8K (8192) machine words. In conjunction with this, EQUIVALENCE and DATA may specify locations up to 32K machine words of a Common Block array or element. Dummy arrays may also be declared or adjusted to larger than 8K, although it is the programmer's responsibility to see that the corresponding real array has sufficient space to accommodate this.
7. Dummy parameters may now appear in an EXTERNAL statement, so long as all the other requirements on a variable so declared are met.
8. Dummy array names may be used in object time specification of FORMAT statements.
1. A new compilation control switch, H, is provided. When not specified, the calculation of addresses of subscripted elements is done by in line code, except where such elements appear in an I/O statement list. For the latter case, or when the H switch is specified, the subroutine .SS is called to perform subscripted element address calculation. This pertains to 2- and 3-dimensional subscripted element references only; in line code is always used for 1-dimensional subscripted element address calculation.
2. The form of the calls of subroutines that perform I/O is changed to increase speed and decrease the size of these subroutines.
In adding to and changing the features of the FORTRAN IV compiler and run time systems implemented on the PDP-9/15 computers, certain incompatibilities are produced in the object code of the revised compiler as compared to the previous version. In this section, only an outline of the changed features is given, with an emphasis toward the steps necessary to convert users' FORTRAN and MACRO programs to be compatible with the new FORTRAN. Details on the form of the changed features may be found in the manual PDP-15 FORTRAN IV OPERATING ENVIRONMENT, order number DEC-15-LFEMA-A-D.
All the recommendations made below are to be considered of an advisory nature, especially in the realm of adapting MACRO programs to interface with FORTRAN programs. The flexibility of the MACRO language will usually leave the programmer with more options than can practically be discussed here. The set of recommendations made here are primarily those which would make a MACRO program most like the object code of a FORTRAN program, at least with respect to the programming features covered.
The basic operation that has to be performed to adapt existing user programs written in FORTRAN is to re-compile all source programs and, as appropriate, rebuild user libraries from the binaries so obtained. In fact, if there are no user programs written in MACRO, this will be all the conversions that are necessary. This basic conversion will also be sufficient in the case of users who either have no MACRO programs that interface with FORTRAN programs, or do have MACRO programs which interface with FORTRAN programs but do not make use of any of the following:
a. Passing to, or receiving from FORTRAN programs, addresses of arrays or array descriptor blocks
b. Access to array descriptor blocks
c. OTS input/output routines
d. Subroutine .SS
e. Subroutines ADJ, ADJ1, ADJ2, Or ADJ3
With the new version of the compiler, there is provided a new switch option, which, when specified, results in .SS subroutine calls to be used to compute 2- and 3-dimensional subscripted variable addresses. When the H switch is not specified, in line code performs this function except for subscripted variables that appear in an I/O statement parameter list. Use of the H switch will usually result in a smaller object program, but one that will not run as fast when the in line subscripted variable address calculation code is present.
If a MACRO program calls a FORTRAN subprogram, through any SUBROUTINE, FUNCTION, or ENTRY statement entry point, and that entry point contains a parameter list which contains an array name, then the address of the first word of the array must be passed to that parameter. The former behaviour was to pass the last word of the array descriptor block for that array. For example, to call
SUBROUTINE SUB (X,ARRAY,Y) DIMENSION ARRAY (5,6) the call should appear JMS* SUB JMP .+4 .DSA address of X .DSA address of first word of ARRAY .DSA address of Y
where "address" is the location the subprogram will reference. Alternatively, a '.DSA address of ··....' may be replaced by '.DSA 400000+pointer to address of ....'; on entry, the get argument subroutine .DA discriminates between a direct address and a pointer to a direct address (called a transfer vector) on the basis of the latter having bit 0 on.
It is no longer valid to pass an array descriptor block address to a FORTRAN subprogram. If the subprogram needs to know at each call what the maximum dimensions of ·the array are to be, these must also be passed as parameters, and the subprogram must make use of the new adjustable array feature. This is discussed below.
When a FORTRAN program or subprogram calls a MACRO subprogram, and the calling statement's parameter list includes an array address, the MACRO subprogram must be prepared to receive the address of the first word of that array in the corresponding location of its entry point's parameter list if .DA is used. For example, if the entry point of subroutine SUB in the above example is coded in MACRO, it will appear:
SUB 0 JMS* . DA JMP .+4 .DSA address of X put here by .DA .DSA address of first word of ARRAY put here by .DA .DSA address of Y put here by .DA
Addresses are put right into the entry point's parameter list locations by .DA if the parameter list locations originally do not have bit 0 on; but if bit 0 is on, the remaining bits of the word are taken as a pointer to a location into which the address is to be placed.
If the MACRO program needs to know the array dimensions, either they must be passed as parameters or .DA must not be used. The parameter list entry in a calling FORTRAN program for an array reads .DSA 400000+address of last word of the Array Descriptor Block (ADB). From this, if .DA is not used at the called entry point, the address of·the ADD can be obtained.
FORTRAN subprograms now maintain an array descriptor block that is local for every array declared, including dummy arrays. Further, the dimensioning information of a dummy array may include integer dummy parameters, such as in
SUBROUTINE SUB (X,ARRAY,Y,I,J) DIMENSION ARRAY (5,I,J)
Such arrays are called adjustable arrays. Formerly it was necessary to use the subroutine ADJ, ADJ1, ADJ2, or ADJ3 to perform this type of operation; it is now handled automatically, by implicitly generated calls to the OTS subroutine .DJ. The MACRO program which can no longer have access to the ADB in a calling program will probably need a local ADB, and to make use of .DJ.
The code generated to calculate the address of a subscripted element reference to a 1-dimensional array has been changed. The results produced are the same; only if a MACRO program made any assumption about the appearance of this code will any adaptation be necessary. Its form is presently, for arrays of mode
Integer Real or Dbl. Intg. Double Precision CMA!CLA CMA!CLA CMA!CLA TAD subscript value TAD subscript value TAD subscript value RCL DAC temporary location RCL TAD array base address TAD array base address TAD temporary location DAC location of use DAC location of use DAC location of use
For subscripted element reference to 2- and 3-dimensional arrays, in line calculation of the element's address is performed except when the H switch is specified when compiling. In line calculation is not done when the element address is to be used by any of the I/O routines listed below. Subroutine .SS is used whenever in line calculation is not performed. If a MACRO program interfacing with a FORTRAN program requires the existing form of the .SS call, then it is best to specify the H switch. Note also the paragraph on .SS below.
Certain I/O routines in the OTS library require the one's complement of the mode to be in the AC when called, where this is the mode of the simple or subscripted element that is being transferred. These same routines also return in the AC the same value that was passed to them; it must be a valid LAW instruction. The entry points exhibiting this requirement are:
.FE(BCDIO) ; .RE if random access .FJ(BINIO) ; .RJ if random access .GD, .GA, .GC (DDIO)
The calling sequence of .SS remains the same, but its treatment of the passed parameters is altered somewhat. For example, a call to generate the address of the element A(3,3) will appear:
JMS* .SS .DSA address of last ADB word of A LAC (000003 LAC (000003 DAC location at which address is to be used
The following behaviour is significant:
a. The DAC that appears in the calling sequence is XCT'd by .SS, and return is made from .SS at the location following the DAC.
b. When return is made, the one's complement of the mode of A is in the accumulator.
c. The program counter value placed into the entry point of .SS remains unchanged from that which is set on entry.
d. A transfer vector that points to a pointer to the last ADB word of A may not be used as the first parameter.
Items a. and b. are made to suit the new calling conventions of the I/0 routines listed above. Item c.is utilized internally in DDIO.
The following diagnostics either are new to the FORTRAN Compiler (indicated by *) or their usage has been changed or extended, as of F4 V3A000. These come about both from changes that correct errors and from changes that extend the capability of the compiler.
01E Variable in EXTERNAL statement not simple non-common variable 07F Missing left parenthesis 02H More than two characters in Integer or Logical Hollerith constant 03M Local array length larger than 8K 04M Element position in local array larger than 8K, or in Common array larger than 32K (EQUIVALENCE, DATA) 09N* Invalid statement label or continuation 12S Adjustable dimension not in dummy array. (Original use of this diagnostic replaced by #4S.) 13S Adjustable dimension not a dummy integer. (Original use of this diagnostic replaced by #5S.). 31X* Illegal operator sequence 32X Illegal use of =
The following run time diagnostics either are new to the OTS library (indicated by *), or revise or extend the meaning of existing diagnostics. (T) indicates an error that will terminate program execution; (R) indicates an error that will allow program execution to continue.
OTS Error Meaning Routine that may Cause Error 16* (R) ATAN2 (0.6,9.6) attempted ATAN2 pi/2 returned 17* (R) DATAN2(0.6,9.6) attempted DATAN2 pi/2 returned 24 (T) Too many records per file, DEFINE,RANCOM or, illegal record numberATAN2
The following are corrections made to the operation of the FORTRAN compiler, or the execution of FORTRAN programs. The corrections are to problems that were found to exist in the previous release of the compiler and object time. system F4 36. Articles that have been published in the Digital Software News for 18 Bit Computers pertinent to these changes will be obsoleted; a list of the articles affected will be published as a separate article in the DSN. The statement of only the problem is given in each item below - correction of the problem is implied. All corrections are implemented in version FA V3A000.
1.0 Corrections to compiler operation, DOS-15 and RSX PLUS III
1.1 Improper code would be generated for a construction with imbedded subscripts, such as A(J(I)), or for unbalanced parentheses in Subroutine call statements.
1.2 If the data type of dummy parameters in a Statement Function definition was specified in an IMPLICIT statement, the default data type of the dummy parameters would have been used anyway.
1.3 Any function name given in an EXTERNAL statement would be taken to be an integer type function, regardless of any explicit or implicit mode declarations.1.4 The DATA statement did not function properly when initializing a Double Integer array with an implied DO construction. For example, in the sequence
DOUBLE INTEGER J(100) DATA J /100*10/
all elements after the first in J would not be initialized to the value 10.
1.5 Negative double integer constants, such as would appear in a DATA statement, were not being correctly defined.
1.6 Variables that were declared in an INTEGER statement were being defined as LOGICAL.
1.7 Many illegal uses of the characters being detected by the compiler. # @ were not 1.8 FORMAT statements that contained the illegal construction FORMAT 5( ... were not being detected as in error.
1.9 Usage of the equal sign, = , within the parentheses of an IF statement was not being detected as an error.
1.10 Source code lines whose first character was a line feed (such as would occur if the source code were generated by a FORTRAN program) would not be printed in a compilation listing generated on a line printer.
1.11 Unclosed DO loops resulted in the failure to define symbol table values. This caused spurious errors in pass two, including program greater than 8K diagnostic, and memory protect violations in the RSX PLUS (now RSX PLUS III) environment.
1.12 Unbalanced parentheses in an assignment statement that followed the parenthesized portion of an IF statement were not being detected.
1.13 Illegal characters in the statement number field of a source line went undetected.
1.14 In a multiple assignment statement, which is legally constructed in the form A=B=C expression, assignment to a constant was not being prohibited. That is, the following illegal statement would go undetected: A=3.0=C=expression.
2.0 Corrections to Compiler Operation, RSX PLUS III only
2.1 A binary file was generated by the compiler (if the B option was specified) even when there were errors detected during compilation; such a binary file would not be executable.
2.2 When successive sources were being compiled, all having been specified in the same command string, and if any of these contained compilation errors, no binary files would be generated for any source files specified after that in which the error occurred. This would occur regardless of whether or not the later sources contained compilation errors.
3.0 Corrections to OTS Library Operation, DOS-15 and RSX PLUS III.
3.1 Subroutine DDIO did not correctly determine the data type (i.e., mode) of variables to be input or output. In the Floating Point Processor (FPP) version only, significance loss would occur when inputting floating point numbers with large exponents.
3.2 Subroutines ATAN2 and DATAN2 had several errors: 1. Incorrect values of pi were used. 2. The case of the second argument being zero was not treated; the value now returned is pi/2 if the first argument is positive, or -pi/2 if the first argument is negative. 3. The case of both arguments being zero was not treated; a recoverable OTS error is now generated (OTS 16 if ATAN2 and OTS 17 if DATAN2), and the value pi/2 is returned.
3.3 Subroutine DCOS used an incorrect value of pi.
3.4 Subroutine .DD used an incorrect value of pi.
3.5 Subroutine JMOD did not work because the value which should have been stored in the AC on subroutine completion was lost due to the erroneous calculation of the return address.
4.0 Corrections to OTS Library Operation, DOS-15 only.
4.1l Subroutine BCDIO would print only 129 characters on a 132-column line printer. The corrected version allows a forms control character plus 132 printing characters.
4.2 When using double buffered FIOPS, the last .DAT slot could not ·be used, and the sequence of records read after a REWIND or BACKSPACE was incorrect.
4.3 Subroutine DEFINE contained constant definitions that did not remain constant. This caused OTS 24 errors to be indicated.
4.4 The Tab format specification, T, did not allow tabbing up to 132 character positions on the l32-column line printer.
5.0 Corrections to OS Library, RSX PLUS III Only.
5.1 Subroutines .BC, .BD and .DI, which perform exponentiation to Integer or Double Integer powers could have caused a memory protect violation when the exponent was an integer that occupied the last word of the area used by the task being executed.
5.2 On bad input data to DDIO, a WAITFOR would be done using an improper location, causing the task to hang at that point.
5.3 The second call to any entry point in IMNMX (MAX0, MIN0, AMAX0, or AMIN0) or to any entry point in RMNMX (MAX1, MIN1, AMAX1, or AMIN1) would result in a non-existent memory reference, the result of a coding error in these subroutines.
5.4 The utility routine UNFIX caused a memory protect error, the result of a coding error.