RSX 11M V1 Fortran IV_Users_Guide IV Users Guide
RSX-11M-V1-Fortran-IV_Users_Guide RSX-11M-V1-Fortran-IV_Users_Guide
User Manual: RSX-11M-V1-Fortran-IV_Users_Guide
Open the PDF directly: View PDF .
Page Count: 96
Download | |
Open PDF In Browser | View PDF |
RSX-11M FORTRAN-IV User's Guide Order No. DEC-II-LMFUA-A-D RSX-IIM Version 1 Order additional copies as directed on the Software Information page at the back of this document. digital equipment. corporation · maynard. massachusetts The information in this document is subject to change without notice and should not be construed as a commitment by Digital Equipment Corporation. Digital Equipment Corporation assumes no responsibility for any errors that may appear in this manual. The software described in thi. s document is furnished to the purchaser under a license for use on a single computer system and can be copied (with inclusion of DIGITAL's copyright notice) only for use in such system, except as may otherwise be provided in writing by DIGITAL. Digital Equipment Corporation assumes no responsibility for the use or reliability of its software on equipment that is not supplied by DIGITAL. ASSOCIATED DOCUMENTS Refer to User's Guide to RSX-llM Manuals, DEC-ll-OMUGA-A-D. Copyright ~ 1974, by Digital Equipment Corporation, Maynard, Mass. The HOW TO OBTAIN SOFTWARE INFORMATION page, located at the back of this document, explains the various services available to DIGITAL software users. The postage prepaid READER'S COMMENTS form on the last page of this document requests the user's critical evaluation to assist us in preparing future documentation. ( The following are trademarks of Digital Equipment Corporation: COP COMPUTER LAB COMSYST COMTEX DOT DEC DECCOMM DECTAPE DIBOL DIGITAL DNC EDGRIN EDUSYSTEM FLIP CHIP FOCAL GLC-8 IDAC IDACS INDAC KA10 LAB-8 LAB-8/e LAB-K OMNIBUS OS/8 PDP PHA PS/8 QUICKPOINT RAD-8 RSTS RSX RTM RT-ll SABR TYPESET 8 UNI~US CONTENTS CHAPTER CHAPTER CHAPTER 1 OPERATING PROCEDURES 1.1 1.1.1 1.1.2 USING THE FORTRAN-IV SYSTEM Command Strinq File Specifications 1-1 1-1 1-2 1.2 1.2.1 1.2.2 1.2.2.1 1.2.2.2 1.2.2.3 1.2.3 USING THE FORTRAN-IV COMPILER Compiler Switches / List Formats Source Listing Storaqe Map Listinq Generated Code Listinq Compiler Memory Requirements 1-4 1-6 1-7 1-7 1-7 1-8 1-10 1.3 1.3.1 1.3.2 1.3.2.1 1.3.2.2 1.3.2.3 1.3.2.4 1.3.2.5 1.3.2.6 1.3.2.7 1.3.2.8 1.3.2.9 1.3.2.10 1.3.3 1.3.3.1 1.3.3.2 1.3.3.3 1.3 ct 3.4 1.3.4 USING THE TASK BUILDER TO LINK FORTRAN PROGRAMS Task Builder Switch Options for FORTRAN Proqrams Task Builder Options for FORTRAN Proqrams ACTFIL COMMON LIBR MAXBUF TASK UIC UNITS FMTBUF ASG FORTRAN Library Usage Re1ocatab1e Libraries Shared Libraries System Libraries User Libraries Overlays 1-10 1-11 1'!'"11 1-12 1-12 1-12 1-13 1-13 1-13 1-13 1-13 1-14 1-14 1-14 1-14 1-15 1-15 1-15 1-15 1.4 USING MCR TO INITIATE TASK EXECUTION 1-17 1.5 EXAMPLES 1-18 1.6 DEBUGGING A FORTRAN PROGRAM 1-19 2 FORTRAN-IV OPERATING ENVIRONMENT 2.1 FORTRAN-IV OBJECT TIME SYSTEM 2-1 OBJECT CODE 2-1 2.3 SUBROUTINE LINKAGE 2-3 2.4 SUBPROGRAM REGISTER USAGE 2-4 2.5 VECTORED ARRAYS 2-5 3 RSX-11M FORTRAN-IV SPECIFIC CHARACTERISTICS 3.1 VARIABLE NAMES 3-1 3.2 INITIALIZATION OF COMMON 3-1 PAR iii APPENDIX APPENDIX 3.3 CONTINUATION LINES 3-1 3.4 DEFAULT LOGICAL UNIT-DEIVCE!FILE NAMES 3-1 3.5 STATEMENT ORDERING RESTRICTIONS 3-2 3.6 OTS/FCS FILE OPEN CONVENTIONS 3-3 A FORTRAN DATA REPRESENTATION A-l A.l INTEGER FORMAT A-l A.2 A.2.l A.2.2 A-l A-2 A-2 A. 2.3 FLOATING-POINT FORMATS Real Format Double-Precision Format Complex Format A.3 LOGICAL*l A-3 A.4 HOLLERITH FORMAT A-3 A.5 LOGICAL FORMAT A-4 A.6 RADIX-50 FORMAT A-4 B SYSTEM SUBROUTINES B-1 B.l SYSTEM SUBROUTINE SUMMARY B-1 B.2 ASSIGN B-2 CLOSE B-3 DATE B-3 B.5 I DATE B-4 B.6 ERRSET B-4 B.? ERRSNS B-5 B.8 ERRTST B-6 B.9 EXIT B-6 B.10 USEREX B-6 B.ll FDBSET B-? B.12 RAD50 B-8 B.13 lRAD50 B-8 B.14 R50ASC B-9 B.15 RANDU, RAN B-10 B.16 SECNDS B-10 B.l? TIME B-ll iv A-3 ( " ( APPENDIX C FORTRAN ERROR DIAGNOSTICS C-l C.l C.l.l C-l C.l.3 C.l.4 COMPILER ERROR DIAGNOSTICS Errors Reported by the Initial Phase of the Compiler Errors Reported by Secondary Phases of the Compiler Warning Diagnostics Fatal Compiler Error Diagnostics C.2 C.2.l C.2.2 C.2.2.l C.2.3 C.2.3.l C.2.3.2 C.2.4 OBJECT TIME SYSTEM ERROR DIAGNOSTICS Error Processing Algorithm Object Time System Error Message Format Short Message File Object Time System Error Codes Initial Control Bit Settings Error Messages Notes on OTS Error Processing Implementation 0 COMPATIBILITY WITH OTHER PDP-II FORTRANS D-l 0.1 0.1.1 0.1.2 0.1.3 0.1.4 COMPATIBILITY WITH PDP-II FORTRAN V08.04 UNDER RSX-IID V4A Language Differences Object Time System Differences Implementation Differences Operational Differences 0-1 0-1 0-2 D-2 D-3 0.2 COMPATIBILITY WITH PDP-II FORTRAN IV-PLUS 0-4 E BIT STRING MANIPULATIONS E-l E.l E.l.l E.l.2 E.l.3 E.l.4 LOGICAL OPERATIONS Inclusive OR Logical Product Logical Complement Exclusive OR E-l E-l E-l E-l E-2 E.2 SHIFT OPERATIONS E-2 F SOFTWARE PERFORMANCE REPORTS F-l C.l.2 APPENDIX APPENDIX APPENDIX v C-3 C-4 C-8 C-9 C-lO C-lO C-12 C-13 C-13 C-13 C-lS C-2·1 (,- P~F~E This document provides information necessary to compile, task build, execute, and debug a FORTRAN program under the RSX-llM operating system. Chapter one describes the operational procedures. Chapter two provides information about the Object Time System (OTS). This system is a collection of routines selectively linked to the user's program which perform certain arithmetic input/output, and system dependent service operations. It also detects and reports run-time error conditions. Chapter three describes system dependent information not included in the PDP-ll FORTRAN Language Reference Manual. The Appendices provide reference information about internal data representations, system subroutines, error diagnostics, and compatibility of FORTRAN-IV with otherPDP-ll FORTRAN processors. This manual should be used only after some knowledge of the FORTRAN Language, as implemented on the PDP-ll, has been acquired. The associated document which may be used for this purpose is titled PDP-ll FORTRAN Reference Manual (DEC-ll-LFLRA-A-D). The user should also be familiar with the RSX-llM Operating System as described in the RSX-llM Operations Procedure Manual (DEC-ll-OMOGA-A-D). NOTE Subroutines are provided in the FORTRAN library to enable real-time process control, process I/O, and RSX-llM system directives to be performed by means of FOR~RAN. These routines and their ISA-standard calls are fully described in the RSX-llM Executive Reference Manual and the RSX-llM I/O Drivers Manual. DOCUMENTATION CONVENTIONS All RSX-llM executive and system program command lines are terminated by a RETURN. Since this is a non-printing character, at certain places in the text the notationrepresents the RETURN key. Some special keyboard characters require that the CTRL (control) key be pressed simultaneously with a second character. These characters are denoted by t (up arrow): e.g., tz (CTRL Z). In all examples, text printed by the RSX-llM executive or system program is underlined, text typed by the user is not underlined. vii CHAPTER 1 OPERATING PRocEDURES 1.1 USING THE FORTRAN~IV SYSTEM Three steps are required to transform a F()RTRAN source program int.o an executing Task. These steps are: 1. 2. 3. Compilation Task Build (or Linkage) Initiation of Execution Compilation is accomplished by invoking the FORTRAN-IV C:o*,plle:r. Next, the Task Builder is used to construct a task image. Finally, task execu~ion is. ini tiated by using. th~,. ~ppropri~te Monitor Console Routine (MCR) commands. Each step in this procedure involves several required and optional command inputs and produces an output to be used in the next step. Other optionaL outputs are also possible. A di.agram depicting this process is giveh in Figure l-l.The remainder of this chapter discusses each step of' the process ih detail and gives some simple examples. MeR COMMANDS ( \. Figure i-l Preparing a FORTRAN Source for Execution 1.1.1 Command String System programs rUnning under RSX-llM usually require a command string to specify such things as input files and various options. A standard command string has one of the following formsi output-files-listminput-files-list or @command-file 1-1 CHAPTER 1. OPERATING PROCEDURES Both output-files-list and input-files-list are strings consisting of file specifications separated by commas. Each file specification selects a file to be used as an output or input file by the system program. A @command-file is an indirect command file which contains multiple command strings. Any number of file specifiers is possible, the actual number being determined by the system program which will use the file command string. 1.1.2 File Specifications Each file specifier format: (whether input or output) has the following dev:[g,o]filename.type;version!switchl ••• /switchn where: dev: = The physical device unit on which the volume containing the desired file is mounted, e.g., ORO:. The name consists of two ASCII characters followed by an optional one or two digit (octal) unit number and a colon. The default value is SY:, the system disk. Table 1-1 depicts the legal device list. [g ,0] = The User Identification Code (UIC) associated with the user file directory containing the desired file. This consists of a group number and a user number. The default value of UIC is the identification code under which the system program is running, usually [200,200] • filename = The type = A means version m /switch = A one or two character ASCII name identifying name of the file. In RSX-llM, a filename can be up to nine alphanumeric characters in length. Filename and type are always separated by a period (.). of distinguishing among forms of one file. System programs default the file type to an appropriate standard type, (e.g., FTN) so the typical user will not need to explicitly specify it. File type and version are always separated by a semicolon (;). An octal number used to differentiate among versions of a file. When a file is first created using the editor, it is assigned a version number of 1. If the file is subsequently opened for editing, the file system retains the original file for backup and creates a new file with the same filename and type, but with a version number of 2. Version is in the range 0-77777. the switch 1-2 option. The switch itself may ( CHAPTER 1. OPERATING PROCEDURES have three forms. If the switch for example, is SW. Then: designator, /SW sets the switch action; /-SW, negates the switch action, and /NOSW also negates the switch action. in addition the switch identifier may be followed by any number of values. The permitted values are ASCII strings, octal numbers, and decimal numbers. The default for a value is octal. Decimal values must be terminated by a decimal point. Values preceded by a number sign (I) are octal; the octal option is included for explicit documentation purposes. Any numeric value may be preceded with a + or - sign; if the number sign (I) is used, the + or must precede it. The following are valid switch specifications. /SW:27:MAP:29. /-SW /NOSW:NOSWITCH:-#50 the Although the filename command string has a standard syntax, interpretation of the string and permissible options is program dependent. 1-3 CHAPTER 1. OPERATING PROCEDURES Table 1-1 RSX-llM Devices PERIPHERAL DEVICES DEVICE-UNIT Analog to Digital Converter (ADO I-D) ADnn: Analog to Digital Converter (AFCll) AFnn: Card Reader (CRll) CRnn: Cassette (TAll) CTnn: DECtape (TCll) DTnn: Disk (RP04) DBnn: (RFll) DFnn: (RKll) DKnn: (RPOJ) DPnn: (RSOJ/RS04) DSnn: Laboratory Peripheral System (LPSll) LSnn: Line Printer (LPll/LSll/LVll) LPnn: Magtape (TU16) MMnn: Magtape (TMll) MTnn: Synchronous Line Interface (DP-ll) XPnn: (DU-ll) XUnn: Asynchronous Line Interface (DLIl-E) XLnn: Terminal (DLll/DHll/DJll) TTnn: Universal Digital Controller (UDell) UDnn: PSEUDO DEVICES 1.2 Console Listing CL: Console Output CO: Pseudo Input Terminal TI: System Default Device SY: USING THE FORTRAN-IV COMPILER The FORTRAN-IV Compiler is an RSX-llM system program initiated via the FOR MCR-command. It produces relocatable object modules from FORTRAN source programs. 1-4 - ( CHAPTER 1. OPERATING PROCEDURES To invoke the Compiler enter the following characters typed by the system are underlined). MCR command. (All tC MCR)FOR TKB The Task Builder then prints "TKB)" to indicate that it is ready to accept a command string. Alternatively the command string may be typed on the same line as the TKB MeR command. The command string should be a standard string as described in Section 1.1.1. The first output file specifies the task image file. A second file may be specified if a memory allocation map is desired. A third file may be specified to contain the program sections and global symbol definitions in relocatable object module format. This file is described in the RSX-llM Task Builder Reference Manual. The input files contain the object modules to be linked. Additional lines of input file specifications may also be entered. After all input files have been typed, the user should type a line consisting only of "II" (unnecessary if command string is specified as part of MCR command). The Task Builder will then build the task image. The default file types used by the Task Builder are shown in Table 1-3. Standard indirect command file specifications are also the Task Builder. 1-10 ,,-- . qz'~~~ acceptable to ( CHAPTER 1. OPERATING PROCEDURES Table 1-3 Task Builder Default File Types File Default Type Task Image Map Input Library Overlay Description Command TSK MAP OBJ OLB ODL CMD The following simple example builds a task image for the OBJECT.OBJ created by the first example in Section 1.2. HCIDTKB or object file 2TKB TASK ,LP: -OBJECT ~TASK,LP:-OBJECT TKB>/I This creates the task image file TASK.TSK on the system device and lists the memory allocation map on the line printer. Any references , in OBJECT.OBJ to FORTRAN OTS routines are resolved automatically because the OTS resides in the system object module library. 1.3.1 Task Builder Switch options for FORTRAN Programs A FORTRAN programmer should be aware of several Task Builder switch options. Some of these are necessary for correct linking of FORTRAN programs. Others select options which some users may find useful. Detailed descriptions of these switches and other Task Builder switches may be found in the Task Builder Reference Manual. The lEA switch must be used on the task image file if the KEll Extended Arithmetic Element. the task uses The /FP switch must be used on the task image file if the PDP-ll/45 Floating Point Processor. the task uses abbreviated form of memory allocation map may be selected by specifying ISH on the map file. See the Task Builder Reference Manual for a description of both the long and short map formats. An The ILB and /MP switches when specified with an input file indicate an object module library and overlay description file, respectively. These two switches will be discussed in more detail in the following sections. The /SP switch may be used to cause automatic Builder map file. 1.3.2 spooling of the Task Task Builder Options for FORTRAN Programs The Task Builder allows numerous keyword options to be' specified in addi tion to the swi tches described above. Several of these are of particular interest to the FORTRAN user. 1-11 CHAPTER 1. OPERATING PROCEDURES If keyword options are to be specified,the user must not specify the command string with the MCR command and must terminate his command input with a line consisting of a single slash, "I", instead of a double slash as described previously. This causes the Task Builder to solicit option information by printing: ENTER OPTIONS: ~ At this point Task Builder options may be entered, one option per line. After each option is entered the Task Builder prompts with "TKB)" indicating that it is ready to accept the next option. After specifying the desired options a single slash, "I", should be entered to indicate no more options. The Task Builder then proceeds to build the task and produce the requested output files. When it has finished it again types "TKB)" and is ready to accept a new command string. To exit from the Task Builder type tz (Control Z). The Task Builder options particularly relevant to FORTRAN are described below. programmers 1.3.2.1 ACTFIL - The number of files that may be simultaneously open by a task is defaulted to 4. Buffer space is allocated in the task image for this many files. When multibuffering is used via a call to FDBSET, the number of buffers needed by the FORTRAN task will be greater than the number of files. The number of buffers may be made smaller to conserve memory or larger to allow more files to be open simultaneously by means of the Task Builder option: ACTFIL .. n where n is the decimal number of buffers desired. (An attempt to open a file when space is not available may cause a fatal error at run-time.) 1.3.2.2 COMMON - If a shared common block is to be referenced by the FORTRAN program this intention must be declared by specifying the following option: COMMON a name:access where name is the name associated with the resident common block and access is either RO for Read Only (meaningful for mapped systems only) or RW for Read/Write. The FORTRAN common with the same name is used to refere~ce the data in the resident common. 1.3.2.3 LIBR - If a shared library is to be referenced by the program the following option must be used: FORT~ LIBR- name:access where name is the library' s name and access is either RO for Read Only (meaningful for mapped systems only) or RW for Read/Write. Libraries are discussed in more detail in Section 1.3.3. 1-12 ( CHAPTER 1. OPERATING PROCEDURES 1.3.2.4 MAXBUF - The maximum record size that can be handled by the FORTRAN object time system for input/output is defaulted to 132 (decimal) bytes. This may be increased by specifying the Task Builder option: MAXBUF = n where n is the number of bytes. The default generally is adequate for formatted input/output. If direct access operations are performed using records larger than 132 bytes, the user must employ this option to specify the size of the largest record which will be handled. 1.3.2.5 TASK - The task image being built may be task name by specifying the following option: given an explicit TASK == name where name may be from one to six alphanumeric characters the first of which must be alphabetic. If no task name is specified at task build time, it may be explicitly specified at install time, or the Task Builder will use the first six characters of the task image file name as the task name. 1.3.2.6 UIC - The default Ule under which the task will be set by specifying the option: execute may Ule - [g,o] where g,o is a valid group and owner number combination. option is not specified the default Ule is [200,200]. If this 1.3.2.7 UNITS - The default number of logical units available to the FORTRAN program is 6, that is, logical units 1 through 6 inclusive. This number may be set explicitly smaller or larger at task build time by specifying the option: UNITS =- n where n is the number of logical units desired. The default device and file name associated with a logical unit number is discussed in Section 3.4. If a smaller number of units than the default is desired, a UNITS command must be given before any ASG commands. 1.3.2.8 FMTBUF - The default size (32 words) of the buffer used for object time format compilation may be changed by use of the following Task Builder option: 1-13 CHAPTER 1. OPERATING PROCEDURES FMTBUF - n where n is the decimal size, in words, of the object time format compilation buffer. The total size needed for format compilation is approximately equal to the number of characters in the largest object time format used by the program. 1.3.2.9 ASG - Logical unit numbers may be assigned to physical device units by use of the following option: ASG - devl:nlln21 ••• ,dev2:ml:m2: ••• , ••• where each dev is a physical device unit name and each n and m i8 a valid logical unit number. The default device assignments would appear as: ASG - SY:l:2:3:4,TI:5,CL:6 1.3.2.10 PAR - A task may be built to execute in a specific partition by use of the following option: PAR - pname[:start:length] where: pname - is the name of the partition for which this task is being built. In unmapped systems, the task must run in this partition. start - the octal starting address of the partition. This address must be on a 32-word boundary if unmapped, 4K boundary if mapped. length - the octal length of the partition in specified length must be divisible by 64. bytes. The The optional argument's start and length must be specified when the task is being built on a system that does not have the partition named by the pname parameter. Normally a task is built to execute from the default When PAR is not specified the default assumed is: 1.3.3 partition GEN. FORTRAN Library Usage RSX-llM Library consists of a collection of object modules. Two kinds of libraries exist, shared and relocatable. The Task Builder is used to include modules from relocatable libraries in a task image. An 1.3.3.1 Relocatable Libraries - Relocatable libraries are stored in files on a file structured volume such as a disk. Object modules from 1-14 CHAPTER 1. OPERATING PROCEDURES relocatable libraries are copied into the task image of each task referencing the module. A relocatable library may be specified as an input file to the Task Builder. Such a file specification must include the /LB switch to indicate that the file is a library file. When a library specification is encountered, those modules in the library which contain definitions of any currently undefined global symbols are included in the task image. 1.3.3.2 Shared Libraries - Shared libraries are located in main memory and a single copy of each library is utilized by all referencing tasks. Access to a shared library is gained by using the LIBR option as described in Section 1.3.2.3. Shared libraries are built by the user with the Task Builder; they must contain shareable (reentrant) code. 1.3.3.3 §ystem Libraries - Each RSX-llM system has a system re10catable library. The system relocatable library, SY:[l,l] SYSLIB.OLB is automatically searched by the Task Builder if any undefined global references are left after processing all user specified input files. If the definition of one of these undefined global symbols is found, the appropriate object module is included in the task. The FORTRAN OTS is included in the system object library and hence is loaded automatically with FORTRAN programs. 1.3.3.4 User Libraries - The user can construct his own relocatab1e libraries of assembly language and FORTRAN routines by using the RSX-llM Librarian. These libraries are accessed by using the /LB switch as described in preceding sections. If MATRIXLIB.OLB is a relocatable library containing matrix manipulation routines and PROG.OBJ is the object file of a compiled FORTRAN program which calls the matrix routines, the following command string might be given to the Task Builder: ' TKB>PROG,LP:aPROG.OBJ,MATRIXLIB.OLB/LB TKB>// 1.3.4 Overlays The ov~rlay facility supplied by RSX-llM allows large programs to be executed in relatively small partitions of main memory. The overlay system is virtually invisible to the FORTRAN programmer. All he must do is specify the overall overlay structure, indicate which subprograms are to reside in various parts of the structure and specify, using the overlay description language COOL), which routines are to be autoloadable. Overlay loading may be performed automatically (autoload) or via explicit load requests (manual load). A complete description of manual loading can be found in the Task Builder Reference Manual. The overlay structure is specified as a tree structure in terms of the Task Builder's Overlay Description Language' (ODL). If an overlay structure is to be built then only one input file can be specified to 1-15 CHAPTER 1. OPERATING PROCEDURES the Task Builder. This file must contain the appropriate ODL statements. The specification of this file in a command string must be followed by the IMP switch to identify it as an ODL file. Simple overlay structures may be constructed using only two ODL statements, .ROOT and .END. The following short examples demonstrate how to build overlays. For a more detailed explanation of this facility refer to the Task Builder Reference Manual. Suppose a FORTRAN program consists of a main program (MAIN.OBJ) which performs input and output and calls three subroutines, one which does pre-processing of the data (PRE.OBJ), one which performs the primary processing function of the program (PROC.OBJ), and one which does post-processing of the data (POST.OBJ). The following ODL statements specity an overlay structure which has a resident portion which consists of the main program and three overlays which share the same memory locations. Each overlay contains a single subroutine. Figure 1-4 is a diagram of the overlay structure. The ODL statements to create this structure, are as followS1 • ROOT .END MAIN-* (PRE,PROC,POST) The .ROOT statement is used to declare the tree structure. The • END statement indicates the end of the ODL statements. The names specify object file names (default file type is OBJ). Commas separate descriptions of overlay segments which occupy the same storage. Parentheses are used to group these descriptions. Dashes separate descriptions of modules which are concatenated. If automatic loading of overlays is desired, an asterisk must precede the name of each file which contains a subprogram invoked from a point in the overlay structure which is closer to the root of the structure than the subprogram. If all files within a pair of parentheses are to be automatically loaded, a single asterisk placed in front of the opening parenthesis may be used instead. This indicates that the segment containing the module will be automatically loaded whenever a call is made to a subroutine in the file. / d \ / \ MAIN B ------~-------~ PRE PROC Figure 1-3 Simple OVerlay Structure 1-16 POST CHAPTER 1. OPERATING PROCEDURES A path of an overlay structure is any route from the root of the structure which follows a series of branches to an outermost segment of the tree. Figure 1-4 has only three short paths, MAIN-PRE, MAIN-PROC, and MAIN-POST. A program in one overlay segment may call a subprogram in another segment if and only if the two segments occur on a common path. Thus, MAIN may call PRE, PROC or POST, but the three subroutines cannot call each other. A more complex structure is given in Figure 1-5 and the ODL statements • ROOT is specified by A-B-*(C,D-(E,F,G» • END The paths in this structure are A-B-C, A-B-D-E, A-B-D-F, and A possible sequence of calls is the following, A calls G, G calls B, A-B-D-G. B calls D A B I I I 0 c I I F E G Figure 1-4 OVerlay Structure 1.4 USING MCR TO INITIATE TASK EXECUTION Once a task image has been built, MCR may be utilized to start the execution of that task. First, the task must be installed in the system by typing 1-17 CHAPTER 1. OPERATING PROCEDURES lINS Filespec where Filespec is a specification of the file containing the task image. The default device is the system disk and the default file type is TSK. The task is installed in the partition to. which it is bound. In an unmapped system it may be installed in this partition only. In a mapped system the /pAR - pamame keyword may be used to install the task in any partition of sufficient size. An error will result if the partition is larger than the checkpoint area in which the task was built. The default task priority is 50. The task name may be specified by using the /TASK-name switch. The execution of an installed task is initiated by typing the RUN command: MeR 2RUN tsk where tsk is the task name which was specified when the task was installed or, if none was given then, the name specified when the task was built, or if none was given then, the first six characters of the task image filename. A task may be terminated prior to its normal termination by typing the ABORT MeR commands 1ABO tsk Execution of a task may be suspended by a FORTRAN pause statement, or ended by a STOP statement. When this occurs, the Object Time System will type a line with the task name, the statement which caused the execution halt, and the contents of the display (text following STOP or PAUSE). To continue execution after a pause, type in the RESUME MeR conunand, which takes the form s >RES ts~ A task which terminates as a result of a CALL EXIT statement will produce any output indicating it is terminating. 1.5 not EXAMPLES The following sequence might be used to compile, link FORTRAN task consisting of: and execute a a. the FORTRAN main program MAIN.FTN, b. the FORTRAN subroutine SOORl. FTN , c. several FORTRAN subroutines in the file UTILITY .FTN, d. some subroutines in the object module library MATLIB.OLB, and e. the resident common block named PARM. ,2 FOR FOR)MAIN,MAIN-MAIN ~SUBR1,SOORl-SUBRl ZQB}UTILITY,UTILITY-UTILITY 1-18 CHAPTER 1. OPERATING PROCEDURES FOR>tz >TKB TKB>TSKIMAGE=MAIN,SUBRl,UTILITY,MATLIB.OLB/LB TKB>/ ENTER OPTIONS: TKB>COMMON=PARM:RO TKB>TASK=FSYS TKB>// 2INS TSKIMAGE 2RUN FSYS The listing files produced by the Compiler, MAIN.LST, SUBRl.LST and UTILITY.LST, are automatically printed by the line printer spooler task and are deleted after printing. All files reside or are created on the system disk. The preceding procedure could be accomplished through the use of indirect command files. Suppose the file COMPILE.CMD contains the following: MAIN,MAIN=MAIN SUBR1,SUBR1=SUBR1 UTILITY,UTILITY=UTILITY and the file TASKBLD.CMD contains the following: TSKIMAGE=MAIN,SUBR1,UTILITY,MATLIB.OLB/LB / COMMONaaPARM:RO The following is then equivalent to the previous example. 2FOR @COMPILE >TKB ~@TASKBLD TKB>TASK=FSYS TKB>// 2INS TSKIMAGE 2RUN FSYS 1.6 DEBUGGING A FORTRAN PROGRAM The RSX-11M debugging program, ODT, usually cannot be effectively used with a FORTRAN program due to the nature of the object code generated by the FORTRAN Compiler (see section 2.2). However, in addition to the FORTRAN OTS error diagnostics which include the Traceback Feature (see section 2.5), there is another debugging tool available to the FORTRAN programmer. Placing a D in column one of a FORTRAN statement allows that statement to be conditionally compiled. These statements are considered comment lines by the FORTRAN Compiler unless the /DE switch is used in the Compiler command string. In this case the lines are compiled as reg~lar FORTRAN statements. Liberal use of PAUSE statements and selective variable printout can provide the user with a method of monitoring program execution. This feature allows the inclusion of debugging aids that can be compiled in the early program development stages and later treated as comment lines. 1-19 CHAPTER 2 FORTRAN-IV OPERATING ENVIRONMENT 2.1 FORTRAN-IV OBJECT TIME SYSTEM The FORTRAN Object Time System (OTS) is composed of the following: 1. Math routines, including the FORTRAN library functions and other arithmetic routines (e.g., floating point routines), 2. Miscellaneous utility routines (ASSIGN, DATE, ERRSET, etc.), 3. Routines which handle various types of FORTRAN I/O, 4. Error handling routines which process arithmetic errors, errors, and system errors, 5. Miscellaneous routines required by the compiled code, 6. Process I/O routines (AFC, UDC, etc), 7. Laboratory Peripheral Routines (LPS), and 8. RSX-1IM executive directives. I/O The FORTRAN Library is designed as a collection of many small modules so that unnecessary routines can be omitted during task building. For example, if the user program performs only sequential formatted I/O, none of the direct access I/O routines are included in the task. 2.2 OBJECT COPE Typical FORTRAN operations often require common sequences of PDP-ll machine instructions. For example, at the end of any DO-loop, the index variable must be incremented, compared with the limit value, and Other standard sequences might be a conditional branch taken. generated to locate an element of a multidimensional array, initialize an input/output operation, or simulate a floating-point operation not supported by the hardware configuration. These common sequences of PDP-ll instructions are contained in a library known as the Object Time System. The FORTRAN Compiler selects 2-1 CHAPTER 2. OPERATING ENVIRONMENT a certain combination of these instruction sequences to implement a FORTRAN program. During program execution, these sequences are threaded together and effect the desired result. The Compiler references a library instruction sequence by generating a word containing the address of the first instruction in the sequence, followed by information upon which the instructions are to operate. In the case of the end-of-Do-loop sequence the information required is the location of the index variable, the limit value, and the address of the beginning of the loop. At runtime, register R4 is used to thread together the various references to library instruction sequencesJ the last instruction executed by each instruction sequence is JMP @(R4)+, which transfers control to the next library instruction sequence. The mnemonics (global names) used for the library routine names follow a logically consistent format. The mnemonics are usually six characters in length. The first two characters specify an operation. The third character specifies the mOde of the operation, i.e., integer, floating, double precision, complex, or logical. The fourth character is always a dollar sign ($). The fifth and sixth characters, if present, specify, respectively, a source and destination for the operation. The source element for the operation can be a memory location, the hardware stack, the hardware registers, or an in-line argument which can be referenced through R4. The destination element for an operation can be a memory location, the hardware stack, or a location specified' as an in-line argument which can be referenced through R4. The library routines perform arithmetic operations, compare values, test values, calculate subscripts, convert from one mode type to another, and trans~.er program control. There are special routines to handle internal statement numbers (ISNs), enabling the FORTRAN Traceback feature, a routine to handle subprogram control transfer, ~d a routine to push the address of variables on the hardware stack. There are also sever~l routines to handle special FORTRAN runtime operations such as PAUSE, STOP, I/O initialization, and I/O data transfers. For example, the following FORTRAN program: c C C PROGRAM TO DEMONSTRATE THE CODE GENERATED BY THE FORTRAN COMPILER. C 0001 0002 0003 0004 0005 0006 DIMENSION RARRAY (10,10) I - (3*2 - 5) + I J = (I+100)*(N**2) A - 2.0 RARRAY(2,1) = RARRAY(l,l) + A END I ALLOCATE A REAL*4 ARRAY I I I I ADD ONE TO I COMPUTE AN EXPRESSION ASSIGN A VALUE TO A REAL SUM OF TWO REAL VALUES would generate object code that can be symbolically follows (the storage map is included for reference): STORAGE MAP FORTRAN NAME OFFSET ATTRIBUTES RARRAY 000006 000626 REAL * 4 I INTEGER*2 ARRAY (10,10) VARIABLE 2-2 represented as / \ CHAPTER 2. OPERATING ENVIRONMENT 000630 000632 000634 J N A IN'l'EGER*2 INTEGER*2 REAL * 4 FORTRAN VARIABLE VARIABLE VARIABLE GENERATED CODE ISN 10002 000640 ICI$M 000626 INCREMENT THE INTEGER WHOSE ADDRESS , IS 000626 (I) 1 ISN 10003 000644 000650 000654 000660 000664 000666 MOI$MS ADI$IS MOI$MS MUI$MS MUI$SS MOI$SM 000626 '000144 000632 000632 MOVE VALUE OF INTEGER I ONTO STACK ADD 100 TO VALUE ON TOP OF STACK MOVE VALUE OF INTEGER N ONTO STACK AND SQUARE IT (MULTIPLY BY ITSELF) MULTIPLY (I+100) AND (N**2) 1 STORE VALUE ON TOP OF STACK INTO J ; ; , , 000630 ISN 10004 000672 MOF$IM 1040400 000634 , MOVE AN IMMEDIATE FLOATING CONSTANT , (2.0) TO A 000006 000634 1 ISN 10005 000700 000706 MOF$MM ADF$MM 000012 000012 MOVE RARRAY (1,1) TO RARRAY (2,1) , AND ADD A TO RARRAY (2,1) ISN 10006 000714 ( 2.3 RETURN TO RSX-11M (EXIT FROM PROGRAM) RET$ SUBROUTINE LINKAGE All instances of subprogram linkage are performed in the same manner, including linkage of user written FORTRAN subprograms, and Assembly language subprograms. Control is passed to the subprogram via the following instruction: JSR PC,routine Register 5 (RS) contains the address of an argument following formatz 2-3 list having the CHAPTER 2. OPERATING ENVIRONMENT , R5 I I of arquments Undefined address of argument 11 address of argument 12 ··· address of argument In The value -1 is stored in the argument list as the address of any null arguments. Null argwnents in CALL statements appear as successive commas, e.g., CALL SUB (A"B) Control is returned to the calling program via the instruction I RTS PC An assembly language subroutine to find integers using the following calli CALL the sum of any number of IADD (numl,num2, ••• ,numn,isum) might look like the following: IADD: : 1$: 2.4 • TITLE MOV CLR DECB ADD DECB BNE MOV RTS .END lADDER (RS) +,RO Rl RO @(R5) +,Rl RO 1$ Rl,@(RS)+ PC ,GET t OF ARGUMENTS , PREPARE WORKING REG. I CALCULATE t OF TERMS TO ADD ,ADD NEXT TERM , DECREMENT COUNTER , LOOP IP NOT DONE ,RETURN RESULT , RETURN CONTROL SUBPROGRAM REGISTER USAGE A subprogram that is called by e FORTRAN program need not preserve any registers. However, the contents of the hardwar~ stack must be kept such that each 'push' onto the stack will be matched by a 'pop' from the stack prior to exiting the routine. User-written assembly language programs that call FORTRAN subprograms must preserve any pertinent registers before calling the PORT RAN routine and restore the registers, if necessary, upon return. Function subprograms return a single result in the hardware registers. The register assignments for returning the different variable types are listed below: 2-4 CHAPTER 2. OPERATING ENVIRONMENT Integer and Logical functions - result in RO Real functions - high order result in RO, low order result in Rl Double Precision functions - result in RO-R3, lowest order result in R3 Complex functions - high order real result in RO, low order real result in Rl, high order imaginary result in R2, low order imaginary result in R3 2.5 VECTORED ARRAYS Array vectoring is a process which decreases the time necessary to reference elements of a multidimensional array by using additional memory to store the array. Multidimensional arrays, which are actually stored sequentially in memory, require certain address calculations to determine the location of individual elements of the array. Typically, a mapping function is used to perform this calculation. For example to locate the element LIST(1,2,3) in an array dimensioned LIST(4,5,6) a function equivalent to the following may be used. This function identifies a location as an offset from the origin of the array storage. (sl-l) + dl 0) + 4 ( * (s2 - 1) + dl 1 ) + 4 * ( * * d2 5 * (s3 * ( - 1) 2 ) - 44 where si - subscript i di - dimension i Since such a mapping function requires multiplication operation(s), and since some PDP-ll hardware configurations do not have the MOL instruction, the compiler may 'vector' some arrays and thereby reduce execution time at the expense of memory storage. ,f ~, If an array is vectored, a particular element in the array can be located by a simplified mapping function, without the need for multiplication. Instead, a table lookup is performed to determine the location of a particular element. For example, a vectored, two dimensional array B(5,5) automatically has associated with it a one dimensional vector that would contain relative pointers to each column of array B. The location of the element B(m.n), relative to the beginning of the array, could then be computed as: Vector(n) + m using only addition operations. array vectoring process. Figure 2-2 graphically depicts the The compiler decides whether to vector a multi-dimensional array based on the ratio of the amount of space required to vector the array to the total storage space required by the array. If this ratio is greater than 251, the array is not vectored and a standard mapping function is used instead. Arrays with adjustable dimensions are never vectored. vectored arrays are noted as such in the storage map listing. 2-5 CHAPTER 2. OPERATING ENVIRONMENT The Compiler I-VA switch can be used to suppress all array vectoring. The amount of memory required to vector an array can be computed as the sum of all array dimensions except the first. Por example, the array X(50,10,30) requires 10+30-40 words of vector table. Note that the array V(5,100) requires 100 words of vector storage, whereas the array Y(lOO,S) requires only 5 words of vector storage. It is therefore advantageous to place an array's largest dimension first if it is to be vectored. Wherever possible, vector tables are shared among several different arrays. The compiler arranges sharable vectors under the following conditions: 1. Arrays are in the same program unit 2. For the i th dimension vector to be shared by the arrays, dimensions to the left of the ith dimension must be equivalent in each array_ For example, given the statement DIMENSION A(10,10),B(10,20), A and B share a 20 word vector for the second dimension that contains the values 0, 10, 20, 30, 40, SO, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, of which the array A uses only the first ten elements. Array B B (1 ,1) B(2,1) B(3,1) B(4,1) B (5 ,1) B(1,2) B(2,2) B(3,2) Associated Vector P1 P2 P3 P4 P5 P1 P2 · • • • B(1,5) B(2,5) B(3,5) B(4,5) B(5,5) The location of element B(m,n) Vector(n) + m P5 Figure 2-2 Array Vectoring 2-6 CHAPTER 3 ~X-llM FORTRAN-IV SPECIFIC CHARACTERISTICS 'l'hie chapter deals with information specific to RSX-llH FORTRAN-IV that ~s Q~i.tted from or relaxes r.est~iQtion8 included in the PDP-ll FORTRAN Language Referenqe Manual. It S~9~~d b~ noted that d~vi,ations f~om FORTRAN syntax requirements outlil.l~d ip the PDP-ll FORT~ Lanqu~ge Reference Manual, even if accept~~~ ~n RSX-llM FORTRAN, 4ecrease the portability of the prog;am, and may J?~Ohibit successful execution on another PDP-ll system. ~ 4! ~ VNUMLEf .. ~~s. ~.~~l..~.r.t 'QR'l'~ ~.llQWt:I v~~i.~le names t.o extend Past six characters in ~@l.lg1;~. flow,'VEtl;', Qnly the. ti,rsi; si.x Qhaxoaoters are significant and should be upi,q~e. ~Qng· ~ll var-iable n8Jlles in the program unit. A warning diagnostic is given for each variable name which exceeds six characters in length. The diagnostic will be suppressed if (/-WR) is included in the compiler command string'. 3.2 INITIALIZATION OF COMMON VARIABLES RSX-llM FORTRAN be CO~o~, to ~tatement. 3~~ allows any ini.ti_lize.d variables in COMMON, i.ncluding blank i.n any program uni.t by use of the DATA CONTINUATION LINES RSX-llM FORTRAN does not place any limi.ts on continuation iines that a statement may oont.ain. ~.~ 4 DEFAUL~' the number of LOGI.CAL WIT .. J):EVl.CEIFlLE ASS·I,GNMBNTS Liste.d: in table 3-1 axe the default 109ica.l. unit. - device and filename assignments. . The default device assignments may be changed at task build time via the ASG keyword option or prior to execution via the REASSIGN MCR command. For example the command: 2REA tsk 3 LP: 3-1 CHAPTER 3. SPECIFIC CHARACTERISTICS connects logical unit 3 to the physical device unit line printer in the task named tsk. The device and/or filename assignments may be changed at execution time by use of the ASSIGN library routine (see section B.2). The default filename conventions hold for logical units not listed below, i.e., unit number 12 will have a default filename of FOR012.DAT. Table 3-1 FORTRAN Logical Device Assignments Logical unit Number Default Device 1 2 3 4 5 6 System disk, SY: System disk, SY: System disk, SY: System disk, SY: Requestor terminal,TI: Console listing, CL: Default Filename FOROO1.DAT FOROO2.DAT FOROO3.DAT FOROO4.0AT FOROO5.0AT FOROO6.0AT Although any combination of valid logical unit numbers may be used, there is an imposed maximum number of units which may be simultaneously active. By default, four file structured logical units may be concurrently active, i.e., four files may be open simultaneously. The number may be changed by use of the ACTFIL Task Builder option (see section 1.3.2.1). It should be noted that logical unit numbers are allocated consecutively. For example, if logical units 2 and 17 are used, units 1 through 17 will be allocated. A formatted READ statement of the form: READ f,list is equivalent to: READ (l,f)list For all purposes these two forms function identically. Assigning logical unit number 1 to the terminal, for example, in both cases causes input to come from the terminal. The ACCEPT, TYPE, and PRINT statements also have similar functional analogies. Assigning devices to logical units 5, 5, and 6 affects respectively the ACCEPT, TYPE, and PRINT statements. 3.5 STATEMENT ORDERING RESTRICTIONS statement RSX-llM FORTRAN does not impose as strict requirements as those outlined in the PDP-ll FORTRAN only three statement Reference Manual. There are requirements that must be met: 3-2 ordering Language ordering CHAPTER 3. SPECIFIC CHARACTERISTICS 1. In a Subprogram, the first non-comment line FUNCTION, SUBROUTINE or BLOCK DATA statement. 2. The last line in a program unit must be an END statement. 3. Statement Functions referenced. must be defined before must they be a are However, if the statement ordering requirements as outlined in the POP-ll FORTRAN Language Reference Manual are not followed, a warning diagnostic will be included with the source listing. A /-WR specified in the Compiler command will surpress the diagnostic. 3.6 FCS/OTS FILE OPEN CONVENTIONS A file or device is opened for I/O activity (if no file or device is already open on that logical unit) by the execution of a READ or a WRITE statement. The type of File Control Services (FCS) open operation invoked depends upon the type of file being opened. The file may be explicitly specified as "OLD" or "NEW" in a call to FDBSET; these specifications are implicit in the use of the READ and WRITE statements. When no explicit specification is made, and a READ is the first I/O operation performed on a unit, "OLD" is assumed. If a WRITE is the first I/O operations, then "NEW" is assumed. 3-3 ( \ { \ APPENDIX A FORTRAN DATA REPRESENTATION A.l INTEGER FORMAT Sign B-inary number 15 14 o Integers are stored in a two's complement representation. If the /I4 compiler switch (see section 1.2.1) is used, an integer is assigned two words, although only the high-order word (i.e., the word having the lower address) is significant. By default, integers will be assigned to a single storage word. Explicit length integer specifications (INTEGER*2 and INTEGER*4) will always take precedence over the setting of the /14 switch. Integer constants must lie in the range -32768 to +32767. For example: +22 = 00026 8 -7 = 177718 A.2 ( FLOATING-POINT FORMATS The exponent for both 2-word and 4-word floating-point formats is stored in excess 128 (12008) notation. Binary. exponents from -128 to +127 are represented by the binary equivalents of 0 through 255 (0 through 377 8 ). Fractions are represented in sign-magnitude notation with the binary radix point to the left. Numbers are assumed to be normalized and, therefore, the most significant bit is not stored because it is redundant (this is called -hidden bit normalization-). This bit is assumed to be a 1 unless the exponent is 0 (corresponding to 2- 128 ) in which case it is assumed to be O. The value 0 is represented by two or four words of zeros. For example, +1.0 would be represented by: 40200 o in the 2-word format, or: 40200 o o o A-I. APPENDIX A. DATA REPRESENTATION in the 4-word format. -5 would be: 140640 0 in the 2-word format, or: 140640 0 0 0 in the 4-word format. A.2.1 Real Format (2-Word Floating Point) word 1: Low-order mantissa word 2: 15 since the giving an accuracy. and .17 X A.2.2 o high-order bit of the mantissa is always 1, it is discarded, effective precision of 24 bits, or approximately 7 digits of The magnitude range lies between approximately .29 X 10- 38 10 39 • f i \ Double Precision Format (4-Word Floating Point) word 1: ( word 2: word 3: word 4: I15 Low-order mantissa I15 I15 Lower-order mantissa 0 0 Lowest-order mantissa 0 I I I The effective precision is 56 bits or approximately 17 decimal digits of accuracy. The magnitude range lies between .29 X 10- 8 and .17 X 10 39 • A-2 "- APPENDIX A. DATA REPRESENTATION A.2.3 Complex Format Si~n word 1: 10B~nary excess 1= 1 8 ~xeQngnt 15 14 7 word 2: I15 word 3: Sir Binary excess 10= 11~8 eX2Qngnt 15 14 7 word 4: A.3 I15 H!:h-order m t;L&UIA 6 ° Low-order mantissa ° ;Las I mH~~-or:er 6 Real Part I ° Low-order mantissa ° Imaginary Part I LOGI'CAL*l I Data item I 7 Any non-zero value is considered to have a logical value of .TRUE. The range of numbers from +127 to -128 can be represented in LOGICAL*l Format. LOGICAL*l array elements are stored in adjacent bytes. A.4 ° HOLLERITH FORMAT word 1: word 2: I char 2 is char 4 15 I char 1 ] char 3 8 7 I b1ank= 4O a 15 I 0 8 7 • • • I 0 Ichar n (n~255)1 0 8 7 A-3 APPENDIX A. DATA REPRESENTATION Hollerith constants are stored internally one charac~er per byte. Hollerith values are padded on the right with blanks to fill the associated data item if necessary. Hollerith constants can only be used in DATA, FORMAT, and CALL statements. Only the quoted form of Hollerith constants can be used in STOP and PAUSE statements. A.5 LOGICAL FORMAT I word 1 True: 15 I word 2 112121212111 0 uns~cIfIed False: I word 1 t word 2 5 15 I 0 15 I unsEecified I 01010101010 0 0 Logical (LOGlCAL*4) data items are treated as LOGICAL*l values for use with arithmetic and logical operators. Any non-zero value in the low order byte is considered to have a logical value of true in logical expressions. A.6 RADIX-50 FORMAT Radix-50 character set Character ASCII Octal Equivalent Radix-50 Equivalent space A-Z 40 101-132 44 56 0 1-32 33 34 35 36-47 $ • unused 0-9 60-71 The following table provides a convenient means of translating between the ASCII character set and its Radix-50 equivalents. For example, given the ASCII string X2B, the Radix-50 equivalent is (arithmetic is performed in octal): X-113000 2=002400 B-000002 X2B=-115402 A-4 APPENDIX A. DATA. REPRESENTATION Single Char. or First Char. Second Character -------- -------- A B C D E F G H I A B C D E F G H I A 000001 B 000002 C 000003 D 000004 E 000005 F 000006 G 000007 H 000010 I 000011 J 000012 K 000013 L 000014 M 000015 N 000016 o 000017 P 000020 Q 000021 R 000022 S 000023 T 000024 U 000025 V 000026 W 000027 x 000030 Y 000031 z 000032 $ 000033 • 000034 000035 0 000036 1 000037 2 000040 3 000041 4 000042 5 000043 6 000044 7 000045 8 000046 9 000047 -----------003100 006200 011300 014400 017500 022600 025700 031000 034100 J 037200 K 042300 L 045400 M 050500 N 053600 o 056700 P 062000 Q 065100 R 070200 S 073300 T 076400 U 101500 V 104600 W 107700 x 113000 y 116100 z 121200 $ 124300 • 127400 132500 0 135600 1 140700 2 144000 3 147100 4 152200 5 155300 6 160400 7 163500 8 166600 9 171700 Third Character 000050 000120 000170 000240 000310 000360 000430 000500 000550 J 000620 K 000670 L 000740 M 001010 N 001060 o 001130 P 001200 o 001250 R 001320 S 001370 T 001440 U 001510 V 001560 W 001630 x 001700 Y 001750 z 002020 $ 002070 • 002140 002210 0 002260 1 002330 2 002400 3 00245'0 4 002520 5 002570 6 002640 7 002710 8 002760 9 003030 A-5 APPENDIX B LIBRARY SUBROUTINES -j"' ... t_>~ / B.l LIBRARY SUBROUTINE SUMMARY In addition to the functions intrinsic to the FORTRAN system, there are subroutines in the FORTRAN library which the user may call in the same manner as a user-written subroutine. These subroutines are: ASSIGN Allows specification at run-time of filename or device and filename to be associated with a FORTRAN logical unit number. CLOSE Allows the file on a specified logical unit to be closed. DATE Returns a 9-byte string containing representation of the current date. the ASCII I DATE Returns three integer month, day and year. the current ERRSET Allows the user to specify the detection of certain errors. ERRSNS Allows the user to obtain information recently detected error condition. ERRTST Allows monitoring of certain error types execution. EXIT Terminates the execution of a program and returns control to the RSX-I1M executive. USEREX Allows specification of a routine to be invoked of program termination. FDBSET Allows specification of special associated with a logical unit. RADSO Performs conversion of up to six character Hollerith strings and returns the result as a function value. IRADSO Performs conversion representation. RSOASC Converts Radix-50 strings to Hollerith strings. ( \. values of B-1 representing action Hollerith I/O to be about during options strings to taken the on most program as to part be Radix-50 APPENDIX B. SYSTEM· SUBROUTINES RANDU, RAN Returns a random real number with a uniform between 0 and 1. SECNDS Provides system time of day or elapsed time as a floating point value in seconds. TIME Returns an a-byte string containing the ASCII representation of the current time in hours, minutes and seconds. B.2 distribution ASSIGN The ASSIGN subroutine allows the association of filename information with a logical unit number. The ASSIGN call, if present, must be executed before the logical unit is opened for I/O operations (by READ or WRITE) for sequential access files, or before the associated DEFINE FILE statement for random-access files. The device assiqnment remains in effect until a new CALL ASSIGN is performed. The filename assignment remains in effect only until the file is closed by a CALL CLOSE. The call to ASSIGN has the general form: ~I I I CALL ASSIGN (n, name, icnt) ASSIGN requires only the first argument, all others are optional, and if omitted are replaced by the default values as noted in the argument descriptions. However, if any argument is to be included, all arguments that precede it must also be included. CALL A description of the arguments to the ASSIGN routine follows: logical unit number expressed as an variable, or expression. integer constant, name Hollerith or literal string containing any standard RSX-llM device/filename specification. If the device is not specified, then the device remains unchanged from the d~fault assignments, or the MeR REASSIGN command. If a filename is not specified, the default names as described in section 3.4 are used. ient specifies the number of characters in the string 'name'. If 'icnt' is zero, the string 'name' will be processed until the first null character is encountered. An argument is allowed forms of CALL ASSIGN. - I after icnt to be compatible For example, in the following program: CALL ASSIGN (3, 'TT:') WRITE (3,-) •••• CALL CLOSE (3) WRITE (3,-) •••• B-2 with previous I I ~ ~ APPENDIX B. SYSTEM SUBROUTINES both WRITE operations will occur on the terminal. To cause the second WRITE to revert back to SY:, another CALL ASSIGN must be used, explicitly setting SY: to unit 3. B.3 CLOSE The CLOSE subroutine allows the currently open file on a logical to be closed. The form of the call is: unit CALL CLOSE (n) where n is an integer value specifying the logical unit. When the close is completed the buffers and FDB associated with the file are again available for use. B.4 The DATE subroutine can be used in a FORTRAN program to obtain the current date as maintained within the system. The DATE subroutine is called as follows: CALL DATE (array) where array is an array capable of holding a 9-~te string. The array specification in the call may be expressed as the array name alone: CALL DATE (a) in which the first three elements of the real array a are used to hold the date string, or as: CALL DATE (a(i» which causes the 9-byte string to begin at the i(th) array a. The date is returned as a 9-~te element of (9-character) string in the form: dd-mrnm-yy where: dd is the 2-digit date mmm is the 3-letter month specification yy is the last two digits of the year B-3 the APPENDIX B. SYSTEM SUBROU'l'INES For example: l5-NOV-75 In the case where the array is a real array, 4-1/2 words are used to contain the data string with the remaining array storage being untouched. Therefore, the date string is stored in the first nine bytes in the elements a(i), a(i+l), and a(i+2). The last three bytes of a(i+2) are untouched and should be filled with blanks by the user if he intends to print the date with a JA4 format. B.5 I DATE IDATE returns three integer values representing day, and year. The call has the form: the current month, CALL IDATE (i, j, k) If the current date were March 19, 1975 variables upon return would be: the values of the integer i = 3 j 19 = k = 75 B.6 ERRSET The ERRSET subroutine allows specification of the action to be taken when an error is detected by the OTS. The error action to be taken is specified individually for each error, independent of other errors. The general form of the call is: CALL ERRSET (number, contin, count, type, log, maxlim) where number is an integer value specifying the error number to which the following parameters apply. con tin is a Logical value specifying whether or not to continue after an error. .TRUE. means continue, .FALSE. means exit if this error occurs. count is a Logical value specifying whether to count this error against the task maximum error limit • • TRUE. means count, • FALSE. means don • t count it. type is a logical value specifying the type of continuation to perform. • TRUE. means that an ERR a transfer is to be taken if available. If this action is indicated and an ERR - keyword is not specified in the I/O statement, then the task will exit when the error occurs. .FALSE. means B-4 APPENDIX B. SYSTEM SUBROUTINES return to the routine that detected the error default error recovery. log is a logical value specifying whether to produce an error message for this error. .TRUE. means produce message, .FALSE. means don't produce a message. maxlim is a positive integer value used to set the task's maximum error limit. The default value is set to 31 at task initialization. Consult section C.2, OTS Error Processing, for a complete of the allowed values and meanings of these arguments. description Null arguments are permitted for all but the first argument and no change in the current state of that control code. B.7 for cause ERRSNS The ERRSNS subroutine allows the user to obtain information about most recent error that has occurred during program execution. general form of the call is: the The CALL ERRSNS (nurn, fcserr, fcserl, iunit) where is an INTEGER*2 variable or array element into which will be stored the most recent error number. num (A zero will be returned if no error has occurred.) If the last error occurred as a result of an error indication from File Control Services, then the next three parameters will receive selected values from the file descriptor block (FOB). Otherwise, values of zero will be returned. Consult the I/O Operations Reference Manual (DEC-ll-OXFSA-A-D) for definitions of the interpretation of the FCS error return codes. fcserr is an INTEGER*2 variable or array element will be stored the F.ERR field of the FOB. into which fcserl is an INTEGER*2 variable or array element into will be stored the F.ERR+l field of the FOB which iunit is an INTEGER*2 variable or array element will be stored the logical unit number. which into Specifying zero From zero to four arguments may be specified. arguments serves to clear ERRSNS from previous calls. To determine if an error occurs in a given section of a program, the fol~owing technique is suggested; 1. Call ERRSNS immediately prior to clear any previous error data: 2. Execute the section B-5 the segment in order to APPENDIX B. SYSTEM SUBROUTINES 3. Call ERRSNS again and branch on a non-zero argument to analysis code. error For example: CALL ERRSNS CALL ASSIGN (1, 'NAME.DAT') CALL FDBSET (l,'OLD','SHARE') CALL ERRSNS (IERR) IF (IERR.NE.O) GO TO 100 B.8 ERRTST The ERRTST subroutine allows the user program to monitor the types of errors detected during program execution. The call is of the form: CALL ERRTST (i, j) where i is the error number and the value of j is returned as: j=l if an error number i has occurred j=2 if an error number i has not occurred The sequence: CALL ERRTST (43,J) GO TO (lO,20),J CONTINUE 20 transfers control to statement 10 if an error 43 has occurred. section C.2.3. for a discussion of error codes and messages. The ERRTST routine also resets to 0 the error flag for that class (but not the error count used by ERRSET). For example: See error CALL ERRTST (I,J) CALL ERRTST (I,J) • The second call is guaranteed to return J-2. The ERRTST subroutine is independent of the ERRSET subroutine; neither directly influences the other except that ERRSET can cause execution to terminate. B.9 EXIT A call to the EXIT subroutine, in the form: CALL EXIT terminates execution. It causes issuing task to be terminated. all B-6 files to be closed and the ( " APPENDIX B. SYSTEM SUBROUTINES B.lO USEREX USEREX is a subroutine which allows specification of a routine to be invoked as part of program termination. This allows clean up operations in non-FORTRAN routines. The form of the subroutine call is: CALL USEREX (name) Where 'name' is the routine which will be called at exit time and should appear in an EXTERNAL statement somewhere in the program unit. Control is transferred with a JSR PC,name instruction after all procedures required for FORTRAN program termination have been completed. The transfer of control takes place instead of the normal exit to the RSX-llM executive. The routine specified by USEREX may perform the exit procedure itself or return with an RTS PC. Boll FDBSET The FDBSET subroutine permits specification of special input/output options available through File Control Services under RSX-llM. CALL FDBSET (unit, mode, share, numbuf, initsz, extend) where ( unit is an integer value specifying the logical unit to which the subsequent arguments apply mode is one of the following literals specifying the type of access to be used (only the first letter is checked for validity): 'READONLY' 'NEW' 'OLD' 'APPEND' 'UNKNOWN' 'MODIFY' 'ISUP' For read only access For creating a new file For accessing an existing file For appending to an existing file (meaningful) for sequential files only) When it is not known whether a file exists: this option searches for it, opens it if it already exists, or creates the file if it does not. Open an old file for updating. The file can not be extended. Open a new file (for output) but inhibit superseding of the previous version. This file will replace the current version. If this argument is omitted the default is determined by the first I/O operation performed on that unit. If a WRITE operation is the first I/O operation performed on that unit, 'NEW' is assumed. If a READ operation is the first I/O operation performed on that unit, 'OLD' is assumed. share is the literal 'SHARE' indicating shared access bit should be set. B-7 the FCS APPENDIX B. SYSTEM SUBROUTINES numbuf* is an integer value indicating the number of internal buffers to be used for multibuffered input/output. If this argument is omitted, one internal buffer is used. The ACTFIL option in the Task Builder command sequence is used to extend the buffer area. initsz is an integer value indicating the initial allocation, in disk blocks, of a new file. extend is an integer value specifying the number blocks by which to extend a file. of FDBSET may only be called prior to opening the unit specified in the first argument. CALL FDBSET, CALL ASSIGN, and the DEFINEFILE statement may be used together. The unit number argument is required. All other arguments may be null or missing to indicate no specification for that argument. B.12 RADSO The RADSO function subprogram provides a simplified way to encode RSX-ILM task names in Radix-50 notation. The form of the call is RADSO (name) where name is the variable name or array element corresponding to an ASCII string. Note that the RADSO function may be used as an argument to an system directive sUbroutine, e.g., RSX-llM DATA A/'JOE'/ CALL REQUES (RADSO(A), ••• ) THE RADSO function is equivalent to subprogram: the following FORTRAN function FUNCTION RADSO(A) CALL IRADSO (6,A,RADSO) RETURN END B.13 IRADSO The IRADSO subprogram performs conversions between Hollerith (text) strings and Radix-50 representation. Radix-50 representation is *Multi-buffering is not implemented in the current release of RSX-llM. It will be included in a subsequent release. B-8 APPENDIX B. SYSTEM SUBROUTINES required by the ISA Process Control and System Directives Subroutines for the specification of task names within the RSX-llM system. (See the PDP-II FORTRAN Language Manual for details of the Radix-50 representation.) lRADSO may be called as a FUNCTION subprogram if the return value is desired, or as a SUBROUTINE subprogram if no return value is desired. The form of the call is n a lRADSO (icnt, input, output) or CALL lRADSO (icnt, input, output) where icnt is the (integer) maximum number of convert. input is an ASCII (Hollerith) converted to Radix-50. output is the location for storing conversion. n is the number of characters actually converted. characters to text string to be the results of the Three characters of text are packed into each word of output. The number of output words modified is computed by the expression (in integer mode) (ICNT+2) /3 Thus if a count of four is specified, two words of output will be written even if only a l-character input string is given as an argument. Scanning of input characters will terminate on the first character encountered in the input string. B.14 non-radix-SO RSOASC The RSOASC subprogram provides decoding of Radix-50 into ASCII strings. The form of the call is: encoded values CALL RSOASC (icnt, input, output) where of to is the number converted. input is the variable or array containing the encoded input. Note that (icnt+2)/3 words will be read for conversion. B-9 output characters icnt be APPENDIX B. SYSTEM SUBROUTINES output is the variable or array into characters (bytes) will be placed. which If the undefined Radix-50 code is detected, or the Radix-50 exceeds the maximum value 174777 (octal) then question mark(s) will be placed in the output. B.15 icnt word (ft?ft)· RANDU,RAN The random number generator can be called as a subroutine, RANDU, or as an intrinsic function, RAN. The subroutine call is performed as follows: CALL RANDU (iI, i2, x) where il and i2 are previously defined integer variables and x is the real variable name in which is returned a random number between 0 and 1. il and i2 should be initially set to O. II and i2 are updated to a new generator base during each call. Resetting il and i2 to 0 repeats the random number sequence. The values of il and i2 have a special form; only 0 or saved values of il and i2 should be stored in these variables. Use of the random number subroutines is similar to the use of the function where: x = RAN RAN (iI, i2) is the functional form of the random number generator. B.16 ( SECNDS The SECNDS FUNCTION subprogram returns the system time as a single precision floating point value less the value of its single argument. For example: TIM=SECNDS (0.) will return the number of seconds since midnight, that is, the current time of day. It may be called with a non-zero argument for performing elapsed time computations as in C START OF TIMED SEQUENCE Tl SECNDS(O.) II: C C C CODE TO BE TIMED DELTA = SECNDS(Tl) where DELTA will give the elapsed time. B-lO APPENDIX B. SYSTEM SUBROUTINES The value of SECNDS is accurate to not less than the resolution of the system clock: 0.0166 ••• seconds for a 60-cycle clock and 0.02 seconds for a 50-cycle clock. Systems with a programmable clock have resolution not less than the clock tick as set at SYSGEN. With 24 bits of precision for real accurate to the clock tick for duration. B.17 values, this representation is values up to about two days in TIME The TIME subroutine allows the user to access the current system as an ASCII String. Its form is as follows: time CALL TIME (a) The TIME call returns the time as an colons) ASCII string of the form: 8-byte (8-character, including hh:mm:ss where hh is the two-digit hour indication mm is the two-digit minute indication ss is the two-digit second indication For example: 10:45:23 A 24-hour clock is used. format specification. This quantity is typically output with a 2A4 B-ll ( \ APPENDIX C FORTRAN ERROR DIAGNOSTICS C.l COMPILER ERROR DIAGNOSTICS The RSX-llM FORTRAN Compiler, while reading and processing the FORTRAN source program, can detect syntax errors (or errors in general form) such as unmatched parentheses, illegal characters, unrecognizable key words, missing or illegal statement parameters. The error diagnosti'cs are generally clear in specifying the exact nature of the error. In most cases, a check of the general form of the statement in question as described in the PDP-II FORTRAN Language Reference Manual will help determine the location of the error. Some of the most common causes of syntax errors, however, are typing mistakes. A typing mistake can sometimes cause the Compiler to give very misleading error diagnostics. The user should be careful of the following common typing mistakesl 1. Missing commas or parentheses in a complicated expression FORMAT Statement. 2. Misspelling of particular instances of variable names. If the Compiler does not detect this error (it usually cannot), execution may also be affected. 3. An 4. If the user terminal does not clearly differentiate between 0 (zero) and the letter 0, what appear to be identical spellings of variable names may not appear so to the Compiler, and what appears to be a constant expression may not appear so to the Compiler. ( \. or inadvertent line continuation signal on the line following the statement in error. If any errors were detected in a compilation, the message: ERRORS DETECTED: n will be printed on the initiating terminal; n is the errors, not including warnings, detected by the compiler. number of The next three sections describe the initial phase and secondary phase error diagnostics and the fatal FORTRAN Compiler error diagnostics. C-l APPENDIX C. ERROR DIAGNOSTICS The following is an example of issued by the Compiler. FORTRAN IV 0001 0002 0003 0004 0005 0006 10 10 .* •• * M .* •• * C E 0007 FORTRAN IV M01-01 FORTRAN SOURCf LISTING program with diagnostics PAGE 001 DOUBLE P~!CIStON OBlE D8l£2 DATA INT/100/0BLE/500.1 OBLE2 • INT/2. 5 •• 0SlE WRITE,(6,10) DeLE,oelE FORMAT(lX,2F12.6) . STOP lABEL DEFINEO PREVIOUSLY INTEGER INT END NOT STANDARD ORDERING NO END STATEMENT MISSING COMMA MISSING COMMA EXTRA COMMA DIAGNOSTICS tN lINE 0002 MSG *030 I~ a lINE 0004 MSG *049 [ ~'RNING] MSG *091 [ WARNING J MSG *093 EXTRA CHARACTERS AT END OF STATEMENT SYNTAX ERROR VA~I'BlE "DBlEOB" NAME EXCEEOS 6 C~'RACTERS NON-STANDARD STATEMENT ORDERING C-2 APPENDIX C. ERROR DIAGNOSTICS C.l.l Errors Reported by the Initial Phase of the Compiler Some of the easily recognizable FORTRAN syntax errors are detected by the initial phase of the Compiler. These errors are reported in the source program listing. They are not reported if a source listing is not requested. The error diagnostics are printed after the source statement to which they apply (the L error diagnostic is an exception). The general form of the diagnostic is as follows: ***** c Where c i2 a code letter whose meaning is described below: INITIAL PHASE ERROR DIAGNOSTICS Code Letter Description B Columns 1-5 of continuation line are not blank. Columns 1-5 of a continuation line must be blank except for a possible '0' in column 1. C Illegal continuation. Comments cannot be continued and the first line of any program unit cannot be a continuation line. E Missing END statement. An supplied by the Compiler encountered. H Hollerith string or quoted literal string longer than 255 characters or longer than the remainder of the statement. I Non-FORTRAN character used. The line contains a character that is not in the FORTRAN character set and is not used in a Hollerith string or comment line. K Illegal statement label definition. Illegal (non-numeric) character in statement label. L Line too long to print. There are more than 80 characters (including spaces and tabs) in a line. Note: this diagnostic is issued preceding the line containing too many characters. M Multiply defined label. P Statement contains unbalanced parentheses. S Syntax error. Statement not form. u Statement could not FORTRAN statement. END statement if end-of-file is is Multiple equal signs, etc. of the general FORTRAN statement C-3 be identified as a legal APPENDIX C. ERROR DIAGNOSTICS C.l.2 Errors Reported by Secondary Phases of the Compiler Those Compiler error diagnostics not reported by the initial phase of the Compiler will appear immediately after the source listing and immediately before the storage map. Since the diagnostics appear after the entire source program has been listed, they must reference the statement to which they apply by using the internal sequence numbers assigned by the Compiler. The general form of the diagnostic is: IN LINE nnnn'MSGlm text Where nnnn is the internal sequence number of the statement in question, m is an integer constant specifying the error number, and text is a short description of the error. Below, listed alphabetically, are the error diagnostics. Included with each diagnostic is a brief explanation. Refer to the PDP-ll FORTRAN Language Reference Manual for information to help correct the error. The notation **** signifies that a particular variable statement label will appear at that place in the text. name or SECONDARY PHASE ERROR DIAGNOSTICS ADJUSTABLE DIMENSIONS ILLEGAL FOR ARRAY **** All arrays must be dimensioned with integer constants except as specified in the Language Reference Manual. ARRAY **** HAS TOO MANY DIMENSIONS An array can have up to seven dimensions. ATTEMPT TO EXTEND COMMON BACKWARDS While attempting to equivalence arrays in COMMON, an attempt was made to extend COMMON past the recognized beginning of COMMON storage. COMMON BLOCK EXCEEDS MAXIMUM SIZE An attempt was made to allocate more space to than is physically addressable ()32k words). DANGLING OPERATOR An operator (+,-,*,/, Example: I=J+ etc.) is missing an COMMON operand. DEFECTIVE DOTTED KEYWORD A dotted relational operator was not recognized. possible misuse of decimal point. Also, DO TERMINATOR **** PRECEDES DO STATEMENT The statement specified as the terminator of a DO must come after the DO statement. EXPECTING LEFT PARENTHESES AFTER **** An array name or Function name followed by a left parenthesis. C-4 reference is loop not APPENDIX C. ERROR DIAGNOSTICS EXTRA CHARACTERS AT END OF STATEMENT All the necessary information for a syntactically correct FORTRAN statement has been found on this line, but more information exists. Possibly due to inadvertent continuation signal on next line, or a missing comma. FLOATING CONSTANT TOO SMALL A floating constant in an expression is too close to zero to be represented in the internal format. Use zero if possible. ILLEGAL ADJACENT OPERATOR Two operators (*,/, logical operators, etc.) are illegally placed next to each other. Example I I/*J. ILLEGAL ELEMENT IN I/O LIST An item, expression, or implied DO specifier in an list is of illegal syntax. I/O ILLEGAL DO TERMINATOR STATEMENT **** A DO statement terminator must not be a GO TO, arithmetic IF, RETURN, or DO statement or logical IF containing one of these statements. ILLEGAL STATEMENT ON LOGICAL IF The statement contained in a logical another logical IF or DO statement. IF ILLEGAL TYPE FOR OPERATOR An illegal variable type has been exponentiation or logical operator. must used not with be an ILLEGAL USAGE OF OR MISSING LEFT PARENTHESIS A left parenthesis was required but not found, or a variable reference or constant is illegally followed by a left parenthesis. INTEGER OVERFLOW An integer constant or expression value must outside the range -32767 to +32767. not fall INVALID COMPLEX CONSTANT A complex constant has been improperly formed. INVALID DIMENSIONS FOR ARRAY An attempt was made while dimensioning an array explicitly specify zero as one of the dimensions. to INVALID DO TERMINATOR ORDERING AT LABEL **** Do loops are incorrectly nested. INVALID EQUIVALENCE Illegal equivalence, or equivalence contradictory to a previous equivalence. INVALID FORMAT SPECIFIER A format specifier is not statement or an array name. c-s the label that of a is FORMAT APPENDIX C. ERROR DIAGNOSTICS INVALID IMPLICIT RANGE SPECIFIER Illegal implicit range specifier, i.e., non-alphabetic specifier, or specifier range is in reverse alphabetic order. INVALID LOGICAL UNIT A logical unit reference must be an integer variable or constant in the range 1 to 99. INVALID OCTAL CONSTANT An octal constant is too other than 0-7. large or contains a digit INVALID OPTIONAL LENGTH SPECIFIER A data type declaration optional length specifier is illegal. For example, REAL*4 and REAL*8 are legal, but REAL*6 is not. INVALID RADIXSO CONSTANT Illegal character detected in a RADIXSO constant. INVALID RECORD FORMAT The third parenthetical argument in a statement must be the single character U. INVALID STATEMENT IN BLOCK DATA It is illegal to have any executable statements in a BLOCK DATA Subprogram. DEFINE or FILE FORMAT INVALID STATEMENT LABEL REFERENCE Reference has been made to a statement number that is of illegal construction. GO TO 999999 is illegal since the statement number is too long. INVALID SUBROUTINE OR FUNCTION NAME A name used in a CALL statement or function reference is not valid. Example: use of an array name in a CALL statement routine name reference. INVALID TARGET FOR ASSIGNMENT The left side of an arithmetic assignment statement not a variable name or array element reference. is INVALID TYPE SPECIFIER An unrecognizable data type was used. INVALID USAGE OF FUNCTION OR SUBROUTINE NAME A function name cannot appear in a DATA, OR EQUIVALENCE statement. DIMENSION, COMMON, INVALID VARIABLE NAME A variable name contains an illegal character. LABEL ON DECLARATIVE STATEMENT It is illegal to place statement. a label on a declarative MISSING ASSIGNMENT OPERATOR The first operator seen in an arithmetic assignment statement was not an equal sign (=). Example: I+J=K. C-6 APPENDIX C. ERROR DIAGNOSTICS MISSING COMMA The conuna delimiter was expected but was not found. See the section of the FORTRAN Reference Manual that describes the general form of the statement in question. MISSING DELIMITER IN EXPRESSION Two operands have been placed next to each other in expression with no operator between them. an MISSING LABEL Expecting a statement label but one was not found. Example: ASSIGN J TO I. A valid statement label reference should precede 'TO' but does not. MISSING RIGHT PARENTHESIS Expecting a right parenthesis but one was not found. Example: READ(5,100,). The first non-blank character after the format reference should be a right parenthesis but is not. MISSING QUOTATION MARK In a FIND statement, the logical unit number and record number must be separated by a single quotation mark. MISSING VARIABLE Expecting a variable, but one was not found. Example: ASSIGN 100 TO 1. A variable name should follow the 'TO' but one does not. MISSING VARIABLE OR CONSTANT Looking for an operand (variable or constant) but found a delimiter (comma, parenthesis, etc.). Example: WRITE(). A unit number should follow the open parenthesis, but a delimiter (close parenthesis) is encountered instead. MODES OF VARIABLE **** AND DATA ITEM DIFFER The data type of each variable and its associated list item must agree in a DATA Statement. MULTIPLE DECLARATION FOR VARIABLE **** A variable cannot appear in more than one declaration statement or dimensioning Subsequent declarations are ignored. NUMBER IN FORMAT STATEMENT NOT IN RANGE An integer constant in a FORMAT than 255 or is zero. statement PARENTHESES NESTED TOO DEEPLY Group repeats in a FORMAT statement too deeply. have data data type statement. is greater been nested P-SCALE FACTOR NOT IN RANGE -127 TO +127 P-scale factors must fall in the range -127 to +127. REFERENCE TO INCORRECT TYPE OF LABEL **** A statement label reference that should be a label on a FORMAT statement is not such a label, or a statement label reference that should be a label on an executable statement is not such a label. C-7 REFERENCE TO UNDEFINED STATEMENT LABEL A reference has been made to a statement number that has not been defined anywhere in the program unit. STATEMENT MUST BE UNLABELED A DATA, SUBROUTINE, FUNCTION, BLOCK DATA, arithmetic statement function definition, or declarative statement must not be labeled. STATEMENT TOO COMPLEX An arithmetic statement function has more than 10 dummy arguments. Or the statement is too long to compile. Break it up into 2 or more smaller statements. SUBROUTINE OR FUNCTION STATEMENT MUST BE FIRST A SUBROUTINE, FUNCTION or BLOCK DATA Statement, if present, must be the first statement in a program unit. SYNTAX ERROR Check the general form of the statement with the general form outlined in the Language Reference Manual section that describes that type of statement. TARGET MUST BE ARRAY The third argument in an must be an array name. ENCODE or DECODE statement SYNTAX ERROR IN INTEGER OR FLOATING CONSTANT An integer or floating constant has been incorrectly formed. For example, 1.23.4 is an illegal floating constant because it contains two decimal points. UNLABELED FORMAT STATEMENT All FORMAT Statements must be labeled. USAGE OF VARIABLE **** INVALID An attempt was made to EXT!RNAL a common variable, an array variable, or a dummy argument. Or an attempt was made to place in COMMON a dummy argument or external name. VARIABLE **** INVALID IN ADJUSTABLE DIMENSION A variable used as an adjustable dimension must integer dummy argument in the subprogram unit. be an WRONG NUMBER OF SUBSCRIPTS FOR ARRAY **** An array reference does not have the same number of subscripts as specified when the array was dimensioned. C.l.3 Warning Diagnostics Warning diagnostics report conditions which are not true error conditions, but which may be potentially dangerous at execution time, or which may present compatibility problems with FORTRAN Compilers running on other PDP-ll Operating Systems. The warning diagnostics are normally enabled, but may be suppressed by use of the /-WR C-8 ( APPENDIX C. ERROR DIAGNOSTICS Compiler switch. The form and placement of the warning diagnostics are the same as those for the secondary phase error diagnostics (see section C.l.2) except that the line number reference is replaced with "WARNING". A listing of the warning diagnostics follows: ADJUSTABLE DIMENSIONS ILLEGAL FOR ARRAY **** Adjustable arrays must be a dummy argument in a subprogram, and the adjustable dimensions must be integer dummy arguments in the subprogram. Any variation from this rule will cause a dimension of 1 to be used and this warning message to be issued. STATEMENT ORDERING Although the RSX-llM FORTRAN IV Compiler has less-restrictive statement ordering requirements than those outlined in chapter 7 of the PDP-ll FORTRAN Language Reference Manual, non-adherence to the stricter requirements may cause error conditions on other FORTRAN Compilers. See section 3.5 of this document. NON~STANDARD VARIABLE **** IS NOT WORD ALIGNED Placing a non-LOGICAL*l variable or array after a LOGICAL*l variable or array in COMMON or equivalencing non-LOGICAL*l variables or arrays to LOGICAL*l variables or arrays may cause this condition. An attempt to reference the variable at runtime will cause an error condition. VARIABLE **** NAME EXCEEDS SIX CHARACTERS A variable name of more than six characters was specified. The first six characters were used as the true variable name. Other FORTRAN Compilers may treat this as an error condition. See section 3.1 of this document. ( C.l.4 Fatal Compiler Error Diagnostics Listed below are the fatal Compiler error diagnostics. These diagnostics, which are sent directly to the initiating terminal, report hardware error conditions, conditions which may require rewriting of the source program, and conditions which may require attention from DEC Software Support. The form of the diagnostic is: FATAL ERROR n where n is an error code having one of the following values: Code C Meaning Constant subscript overflow. Too many subscripts have been employed in a statement. constant SOLUTION - simplify the statement L More than 80 characters in input record. SOLUTION - simplify lines. statement C-9 or use continuation APPENDIX C. ERROR DIAGNOSTICS o Unrecoverable error occurred while the Compiler was writing the object file (.OBJ). Possibly, insufficient output file space. SOLUTION - rectify hardware problem, or make more space available for output by deleting unnecessary files. P Optimizer push down overflow - statement too complex, or too many common subexpressions occurred in one basic block of a program. SOLUTION - simplify complex statements; report the error to your local software support representative. R Unrecoverable hardware error occurred Compiler was reading ,source file. while the SOLUTION - rectify hardware problem. S Subexpression stack overflow - statement too complex. SOLUTION - simplify complex statements. T Memory Overflow SOLUTION - break up program into subprograms or compile in a larger partition. w Unrecoverable error occurred while the Compiler was writing listing file. Possibly, listing file space is not large enough. SOLUTION - rectify hardware problem, or make more space available for listing file by deleting unnecessary files. Y Code generation stack overflow - statement too complex. SOLUTION - simplify complex statements. Z Compiler error SOLUTION - report this error to your local support representative. Please include listing. C.2 C.2.l software program OBJECT TIME SYSTEM ERROR DIAGNOSTICS Error Processing Algorithm The Object Time System detects many Input/Output, arithmetic, invalid argument and other kinds of errors and reports them on the user's terminal via logical device TI:. The action taken for each error is determined by an error control table within the OTS. (This table may be modified during program execution by means of the ERRSET subroutine, see section B.S.) C-10 ( \ APPENDIX C. ERROR DIAGNOSTICS Error processing for each error is Significant bits are as followsz controlled by a control byte. Continuation Bit If not set, this bit directs the task to exit as a result of this error. If set, the task will continue provided certain other conditions are met. Count Bit If set, this error is counted against the task error count limit. If that limit is exceeded, the task will exit. Continuation Type Bit Two types possible: 1) continuation action are Return to routine that reported the error to take appropriate recovery action and proceed, or Take an ERR- transfer in an I/O statement. If an ERR = transfer is specified for the error and none was included in the Input/Output statement, the task will exit. 2) The above three conditions must all continue. Log Bit of be satisfied for the task to If the task continues, then the log bit is tested. If the bit is set, an error message is produced before continuing; otherwise, the task continues. If any of the above conditions is not satisfied, the task will exit an error message will always be produced. In this case, the additional text "EXITING DUE TO" is included in the error message so that it is clear why a task is abnormally terminating. ~d Two additional bits are of interest acceptability of ERRSET arguments. Return permitted bit ERRa permitted bit here since they control the If set, then the continuatio~ type bit may be set by ERRSET to specify return. If set, then the contination type bit may be set by ERRSET to specify that an ERR- transfer is to occur. These two bits are used by ERRSET to check the validity of ERRSET arquments. At least one of these must be set in order to set the continuation bit. Also the continuation type argument is checked against these bits for acceptability. All four combinations of these two bits occur most errors are in one of two groups. 1) 2) in the OTS, although I/O errors generally permit ERR- continuation type but not return continuation. Most other errors per.mit return continuation but not ERRa transfer continuation (even if they occur during I/O statement processing.) C-ll APPENDIX Cs ERROR DIAGNOSTICS Notable exceptions are the synchronous system trap errors (numbers 3 through 10) and recursive Input/Output error (number 40) which will always result in task termination, and the Input and Output Formatted Conversion Errors (numbers 63 and 64) which allow both types of continuation. The initial setting of the error control bits is shown error messages in section C.2.3. C.2.2 together with Object Time System Error Message Format OTS error message formatted as follows: An consists of several lines of information tsknarn [EXISTING DUE TO] ERROR number text [AT PC = address] [FCS: f.err f.errl filename unit] IN xxxxxx AT yyy FROM xxxxxx AT yyy ••• FROM • MAIN. AT yyy (In the above message prototype, fixed parts of the message are in capital letters and variable parts in lower case letters.) shown The variable parts of the message are: tsknam -the name of the task in which the error occurred. number -the error number text -a one-line description of the error. ( If the OTS error resulted from one of the synchronous system traps, then the program counter will be shown in the line "AT PC =". This line is only produced for errors numbered 5 through 12. If the OTS error resulted from an error reported to it by File Control Services, the line beginning "FCS:" will be included. Consult the I/O Operations Reference Manual for a description of the FCS error codes. the value of the F.ERR Descriptor Block (FDB). f.errl the value of the F.ERR+l field of the FDB. filename the name version) unit the logical unit on which this error occurred. of the file field (not of the f.err including type File or Next follows a traceback of the subprogram calling nest at the time of the error. Each line represents one level of subprogram call and shows xxxxxx the name of the subprogram. C-12 ( APPENDIX C. ERROR DIAGNOSTICS The name of the main program is shown as .MAIN. The name of a subprogram is the same as the name used in the SUBROUTINE or FUNCTION statement. Arithmetic statement functions, OTS system routines and routines written in assembly language will not be shown in the traceback. the internal sequence number of the subprogram at which the error, call statement, or function reference occurred. A question mark, "?", instead of a number indicates that the subprogram was compiled with the /-SN compiler switch (suppress sequence number accounting) in effect and hence the line number is not known for that program unit. C.2.2.1 Short Message File - In order to save space, a short message file may be included which prints only the error number. This may be used by specifying the module $SHORT at task build time; e.g., >TKB TKB>MAIN=[l,l]SYSLIB/LB:$SHORT,MAIN C.2.3 Object Time System Error Codes C.2.3.1 Initial Control Bit Settings - The following table shows the initial settings of the significant bits in the error control byte as described in section C.2.l. ( C-13 APPENDIX C. ERROR DIAGNOSTICS Table C-l Error Control Bit Settings ERROR NUMBER 1 2 3 4 5 ft 7 8 q 10 20 21 22 23 24 25 2ft 27 28 2q 30 31 32 33 34 37 38 3q 40 41 42 43 44 CONTINUE? COUNT? CONTINUE TYPE L.OG? PERMITTED ERRa? RETURN? NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO FATAL FATAL FATAL FATAL. FATAL, FATAL. FATAL FATAL FATAL FATAL YES YES YES VES VES YES YES YES YES YES NO NO NO NO NO NO NO NO NO NO NO NO NQ NO NO NO NO NO NO NO YES VES VES YES YES YES YES VES YES VES YES YES VES YES VES YES YES YES YES YES YES YES YES YES YES VES YES YES NO YES ERRERR= ERR. ERR. ERRa ERR. ERRERR. ERR= ERRERR_ ERR= ERR. RETURN ERRD VES VES YES YES YES VES YES VES YES YES YES YES YES YES YES YES VES YES YES YES YES YES YES YES YES VES YES YES NO YES NO NO NO NO NO NO NO NO NO NO YES YES YES NO VES VES VES YES YES VES VES NO YES YES YES YES ERR. ERRERR. FATAL. ERR= ERR= RETURN ERR. YES YES YES YES YES VES YES YES YES C-14 YES YES NO YEI YES NO YEI NO NO NO ¥€S NO NO NO NO NO NO NG YES NO APPENDIX C. ERROR DIAGNOSTICS Table C-l (Cont.) Error Control Bit Settings COUNT? CONTINUE TYPE 1.0G? P(RMITTEO ERR:? RETURN? ERROR NUMBER CONTINUE? 60 61 6c 63 64 65 66 67 YES YES YES YES YES YES YES YES YES YES YES NO YES YES YES YES ERRc ERRc ERR: RETURN ERR= ERRc ERRERRI: YES YES YES NO YES YES YES YES YES YES YES YES YES YES YES YES NO YES NO YES YES NO NO NO 70 71 72 73 74 YES YES YES YES YES YES YES YES YES NO RETURN RETURN RETURN RETURN RETURN YES YES YES YES NO NO NO NO NO NO YES YES YES YES YES 80 81 8e 83 84 85 86 YES YES YES YES YES YES YES YES YES YES YES YES YES YES RETURN RETURN RETURN RETURN RETURN RETURN RETURN YES YES YES YES YES YES YES NO NO NO NO NO NO NO YES YES YES YES YES YES YES q0 CJl NO YES NO NO FATAl. RETURN YES NO NO NO NO YES 100 101 NO NO NO NO FATAl. FATAl. YES YES NO NO NO NO C.2.3.2 Error Messages Group 0 - Severe Errors These messages result from severe error conditions for which no error recovery is possible. Consult the RSX-llM Executive Reference Manual for details of what error conditions will cause traps to the System Synchronous Trap Table entries cited below. C-lS APPENDIX C. ERROR DIAGNOSTICS 1 INVALID ERROR CALL A TRAP instruction has been executed whose low byte is within the range used by the OTS for error reporting (see Section C.2.4) but for which no error condition is defined. 2 TASK INITIALIZATION FAILURE Task start up has failed for one of the reasons: following 1. The directive to initialize synchronous system trap handling (SVTK$S) has returned an error indication. 2. The executive directive to asynchronous trap (SFPA$S) error indication. 3. The File Control Services initialization call (FINIT$) has returned an error indication. enable the FPP has returned an 3 ODD ADDRESS TRAP (SST 0) 4 SEGMENT FAULT (SST 1) This is most likely due to a subscript of range on an array reference. value out 5 T-BIT OR BPT TRAP (SST 2) 6 lOT TRAP (SST 3) 7 RESERVED INSTRUCTION (SST 4) The program has attempted to execute an illegal instruction. This may be caused by task building with the wrong FORTRAN library for the given hardware configuration. Hardware may have been linked. 8 NON-RSX EMT (SST 5) The program has executed an EMT instruction whose low byte is not in the range used by the RSX-llM executive. 9 TRAP INSTRUCTION TRAP (SST 6) A trap instruction has been executed whose low byte is outside the range used for OTS error messages (see C.2.4 below). 10 PDPll/40 FIS TRAP (SST 7) A module using FIS was linked FORTRAN library. ( with a non-FIS 11 FPP HARDWARE FAULT The FPP Floating Exception Code (FEC) register contained the value 0 following an FPP interrupt. This is probably a hardware malfunction. 12 FPP ILLEGAL OPCODE TRAP The FPP has detected an instruction. C-16 illegal floating point APPENDIX C. ERROR DIAGNOSTICS 13 FPP UNDEFINED VARIABLE TRAP The FPP loaded an illegal value (-0.0). This trap should not occur since the OTS initialization routine does not enable this trap condition. A negative zero value should never be produced by any FORTRAN operation. 14 FPP MAINTENANCE MODE TRAP The FPP has interrupted with a Floating Point Exception Code register value of 14 (octal). This is probably a hardware malfunction. Group 1 - General Input/Output Errors These messages result from errors related to the file system. 20 REWIND ERROR error condition was detected by FCS during the .POINT operation used to position to the beginning of a file. An 21 DEFINEFILE ALREADY DONE A DEFINEFILE statement was attempted on which one has already been done. DEFINEFILE is ignored. To change a specification a CLOSE operation may be a unit for The second DEFINEFILE performed. 22 RECORD TOO LONG A record has been read which is too large to fit into the buffer specified by the MAXBUF TKB option. Rebuild the task using a larger MAXBUF specification. 23 BACKSPACE ERROR One of the following errors has occurred: a. b. c. BACKSPACE was attempted on a file opened for appending FCS has detected an error condition during the .POINT operation used to rewind the file FCS has detected an error condition while reading forward to the desired record. 24 END-OF-FILE DURING READ Either an end-file record produced by the ENDFILE statement or the FCS end-of-file condition has been encountered during a READ statement and no END= transfer specification was provided. 25 INVALID RECORD NUMBER A direct-access READ, WRITE, or FIND statement has specified a record number outside the rang~ from one to the value specified in a DEFINEFILE statement. 26 DEFINEFILE NOT DONE A direct access READ, WRITE, or FIND operation was attempted before a DEFINE FILE was performed. C-17 APPENDIX C. ERROR DIAGNOSTICS 27 MORE THAN ONE RECORD attempt was made to read or write more than single record in an ENCODE or DECODE statement. An 28 a CLOSE ERROR error condition has been detected by FCS during a CLOSE operation when attempting to close a file. An 29 30 31 NO SUCH FILE A file with the specified name could not be during an open operation. found OPEN FAILURE FCS has detected an error condition during an open operation. (This message is used when the error condition is not one of the more common conditions for which specific error messages are provided.) MIXED ACCESS MODES attempt was made to use both formatted and unformatted operations, or both sequential and direct access operations, on the same unit. An 32 INVALID LOGICAL UNIT NUMBER A logical unit number was used which is outside the range specified by the TKB UNITS= option. 33 ENDFILE TO DIRECT ACCESS FILE An end-file record may not be written to a access file. direct 34 UNIT ALREADY OPEN A DEFlNEFlLE statement, CALL ASSIGN, or CALL FDBSET was attempted which specified a logical unit already opened for input/output. 37 INCONSISTENT RECORD LENGTH existing direct access file has been opened whose record length attribute is not the same as specified in the DEFINEFILE or OPEN statement. The record length is not changed. An 38 ERROR DURING WRITE FCS has detected an error condition while writing. 39 ERROR DURING READ FCS has detected an error condition while reading. 40 RECURS lVE I/O ATTEMPT An expression in the I/O list of a READ or WRITE statement has caused initiation of another READ or WRITE operation. This can happen if a FUNCTION that performs I/O is referenced in an expression in a READ or WRITE statement I/O list. 41 NO FCS BUFFER ROOM There is not enough free core left in the File Control Services buffer area to set up required I/O buffers •. Rebuild the task with a larger ACTFIL declaration or reduce the level of multibuffering. C-18 APPENDIX C. ERROR DIAGNOSTICS 42 DE~CE HANDLER NOT RESIDENT During open operation, the filename specifiction included a device for which no handler task is resident. 43 FILE NAME SPECIFICATION ERROR The file name string used in a CALL ASSIGN is syntactically invalid, contains a switch specification, references an undefined device mnemonic -, or is _ otherwise not acceptable to the RSX-IIM operating system. 44 RECORDSIZE TOO BIG FOR 'MAXBUF' A DEFINEFILE statement has specified a record size which exceeds the size available in the record buffer. Rebuild the task using a larger TKB MAXBUF specification. Group 2 - Element Transmission Errors These messages result from errors related to transmitting data between a FORTRAN program and an internal record. 60 61 INFINITE FORMAT LOOP The format associated with an I/O statement that includes an I/O list has no field descriptors to use in transferring those variables. FORMAT/VARIABLE - TYPE MISMATCH An attempt was made to output a real variable with an integer field descriptor or an integer variable with a real field descriptor. 62 SYNTAX ERROR IN FORMAT A syntax error was encountered while the OTS was scanning format specifications stored in an array. 63 OUTPUT CONVERSION ERROR During a formatted output operation, the value of a particular number could not be output in the specified field length without loss of significant digits. The field is filled with ·'s. 64 INPUT CONVERSION ERROR During a formatted input operation an illegal character was detected in an input field or the input value overflowed the range representable in the input variable. The value of the variable is set to zero. 65 FORMAT TOO BIG FOR 'FMTBUP' The OTS has run out of memory while scanning an array format that was generated at run time. The default internal format buffer length is 64 bytes. This may be increased by using the FMTBUF TKB option (see section 1.3.2.8). 66 RECORD TOO BIG FOR 'MAXBUP' During an output operation a record was specifie~ that was longer than the maximum record length. The default maximum record length is 132 (decimal) ( C-l9 APPENDIX C. ERROR DIAGNOSTICS bytes. This may be changed by use of the MAXBUF Task Builder option (see section 1.3.2.4). 67 RECORD TOO SMALL FOR I/O LIST A READ statement has attempted to input more than existed in the record being read. example, the I/O list might have too elements. data For many Group 3 - Arithmetic Errors These messages conditions. 70 71 result from arithmetic overflow INTEGER OVERFLOW During an arithmetic operation magnitude has exceeded 32767. INTEGER ZERO DIVIDE During an integer mode arithmetic attempt was made to divide by zero. and underflow an integer's operation an 72 FLOATING OVERFLOW During an arithmetic operation a real value has exceeded the largest representable real number. The result of the operation is set to zero. 73 FLOATING ZERO DIVIDE During a real mode arithmetic operation an attempt was made to divide by zero. The result of the operation is set to zero. 74 FLOATING UNDERFLOW During an arithmetic operation a real value has become less than the smallest representable real number, and has been replaced with a value of zero. 75 FPP FLOATING TO INTEGER CONVERSION OVERFLOW During a type conversion, an FPP overflow occurred. trap Group 4 - Argument Errors These messages result from functions or subprograms. incorrect calls to FORTRAN-IV supplied 80 WRONG NUMBER OF ARGUMENTS An improper number of arguments were used in a call to a FORTRAN library function or system subroutine. 81 INVALID ARGUMENT One of the FORTRAN Library Subroutines has detected value. See Appendix B. 82 Functions or System an invalid argument UNDEFINED EXPONENTIATION An exponentiation has been attempted mathematically undefined: e.g., 0.**0. C-20 which is APPENDIX C. ERROR DIAGNOSTICS LOGARITHM OF NEGATIVE VALUE 83 An attempt was made to take negative number. the logarithm of The result returned is zero. a 84 ,SQUARE ROOT OF NEGATIVE VALUE An attempt was made to evaluate the square root of a negative value. Zero is returned as the result. 85 INVALID ARGUMENT TO LIBRARY FUNCTION An invalid argument was used in a call to a FORTRAN library function. 86 INVALID ERROR NUMBER The error number argument to one of the subroutines ERRSET or ERRTST is not a valid error number. Group 7 - Miscellaneous Errors 90 COMPILER DETECTED ERROR If an attempt is made to link and run an object file, with errors reported during compilation, generated by the FORTRAN Compiler, this error will result when the illegal source statement is executed. 91 COMPUTED GO TO OUT OF RANGE The integer variable or express~on in a computed GO TO statement was less than 1 or greater than the number of statement label references in the list. Control is passed to the next executable statement (see the PDP-II FORTRAN Language Reference Manual). Group 8 - System Directive Subroutine Errors These messages result from incorrect calls to RSX-lIM system directive subroutines. 100 DIRECTIVE: MISSING ARGUMENTS call to a system directive subroutine was made in which one or more of the arguments required for directive execution was not given. A 101 DIRECTIVE: INVALID EVENT FLAG NUMBER. A call to a system directive subroutine was made in which the argument used for event flag specification was not in the valid range (1 to 64) • C.2.4 Notes on OTS Error Processing Implementation OTS error reports are initiated by execution of a TRAP instruction in which the low byte of the instruction contains the internal error code. Internal error codes are 128 (decimal) greater than the externally printed error code. C-2l APPENDIX C. ERROR DIAGNOSTICS UsaX's who wish to do 110 may use the fir.t 128 (0 to 127) trap codes .a follows. TRAP instruetions tran.fer control to the OTS error proce.sor by means of a System Synohronou8 Trap Table locAted in the O'l'S impure work area. The first word of this table ha~ the q10bal symbol $SST. Codin9 similar to the following miqht be used to interoept aontrol. , , INITIALIZATION ,INtTI MOV MOV ,SAVE a~s TRAP ADDR , PU'l' NEW ADDR IN SST TABLE $SST+14,S~T6 • ItfrCEP , $S8T+14 ••• SST61 , • WORD 0 ••• , TRAP HANDLER , INTCEP. 1$. CMP f128.*2,@SP BHI JMP 1$ @SST6 ,LOW BYTE *2 OF TRAP INSTRC. ,BRANCH IF USER CODE ,00'1'0 OTS ,USER PROCESSING ••• TST RTI ,DISCARD EXTRA WORD ,EXIT INTERRUPT (SP)+ Similar techniques could be used to intercept traps. the other synchronous OTS error m8S8aqes are output to loqical devic.e TI. by means of a LON automatically provided by the task builder in addition to those specified by the UNITS direotive. If for any reason the QIO direotive used to write the error lines reoeives an error condition return, then an immediate exit is taken to the RSX-1IM Executive. C-22 APPENDIX 0 COMPATIBILITY WITH OTHER PDP-II FORTRANS COMPATIBILITY WITH PDP-II FORTRAN V08.04 UNDER RSX-IID V4A 0.1 FORTRAN IV (FOR) is a new implementation of FORTRAN for the PDP-II. It has been designed to be compatible with the earlier FORTRAN (MOP, FTN) on RSX-IID. However, some differences exist as a result of 1. Correcting deficiencies in 2. Language specification decisions necessary to promote the goal of an upward compatible line of FORTRANs, including FORTRAN IV under RT-ll and RSX-IIM, FORTRAN IV-PLUS under RSX-IID,' and FORTRAN-IO on the DECsystem-lO. 3. Providing significant extensions to FTN FORTRAN in a manner consistent with the remainder of the FORTRAN language. FTN FORTRAN. This section summarizes the differences that may affect conversion programs from FTN to FOR. 0.1.1 of Language Differences 1. FTN permits transfer of control to FORMAT' statements, which execute as CONTINUE statements. FOR does not, and will issue compile-time error messages. 2. FTN V07.14 provides an uncounted form for Radix-SO constants used in DATA statements. V08.04 added the counted form and promised de-support of the uncounted form. Only the counted form is provided in FOR. 3. FTN logical tests treat any non-zero bit pattern as .TRUE. and an all-zero bit pattern as .FALSE •• FOR tests only the lowest-order byte of a variable. 4. The FTN BYTE statement and data type do not exist' in FOR. LOGI CAL *1 is equivalent to BYTE in most respects, LOGICAL *1 does not force alignment on a word boundary. S. The syntax of the IMPLICIT statement is not the same and FTN. 0-1 in FOR APPENDIX D. COMPATIBILITIES 6. FTN provides expressions in FORMAT statements variable format expressions): FOR does not. 7. FTN permits Hollerith strings in certain expressions: FOR does not. DATA statements may be used to initialize variable with strings to achieve the same result. D.l.2 (called Object Time System Differences 1. FTN allows both formatted and unformatted records in the same file by means of the MXDFUF subroutine call. This is not supported by FOR. 2. The FTN service subroutines PDUMP and SETPDU are not provided in FOR. Similar but more flexible debugging output may be obtained by using WRITE statements in debug lines. 3. The TRCLIB library for statement level execution not available in FOR. 4. Some FTN service subroutines are not available, function is provided in a different manner: FTN FOR SETERR TSTERR APPEND ERRSET subroutine ERRTST subroutine FDSSET subroutine tracing but is F-" their 5. Default format width and number of digits for A, 0, E, F, G, I, L, and 0 formats are supported in FTN. There are no format defaults under FOR. 6. Under FTN, Q format returns the number of characters in the input record (i.e., the record length) independent of the current scan position. Under FOR, Q format returns the number of characters remaining in the input record following the scan position. The record length may be obtained by using the Q format first in the format specification. ( / { '\ 0.1.3 Implementation Differences 1. FTN performs the following actions when opening a unit for direct access I/O: first check if a file already exists: if so, use it. If not, create a new file for use. In FOR the type of open depends on whether a READ or WRITE statement is causing the open operation. If it is a READ, then the file must already exist, or an error will result. If it is a WRITE, then a new file is created. The action sequence described above for FTN may by using 'UNKNOWN' as the second argument FDBSET. 2. be obtained in a call to The implementation of error handling in FOR is significantly different from that in FTN. In particular, the use of error 0-2 APPENDIX D. COMPATIBILITIES classes fo~ controlling error handling is replaced by control over each individual error condition. FOR provides much more complete error information to the executing program if desired. 3. The FTN ASSIGN service subroutine returns a success/error indication in its fourth argument. The FOR ASSIGN subroutine ignores the fourth argument. Errors may be detected by means of CALL ERRTST or CALL ERRSNS. 4. FTN does not compile format specifications for run-time, whereas FOR does. Two differences result: at a. A special internal buffer is provided in FOR to contain the compiled form of format specifications stored in arrays which must be compiled at run-time. This may require the use of the FMTBUF TKB option to obtain a sufficiently large buffer area for this purpose. b. Format specifications stored in arrays are re-compiled at run-time each time they are used. If an H format is used in a READ statement to read data into the format itself, that data does not get copied back into the original array. Hence, it will not be available on a subsequent use of that array as a format specification in FOR. These considerations do not apply defined in FORMAT statements. ( use to format specifications 5. FTN does 'not enforce the restriction against using a statement referring to an existing file to DEFlNEFILE designate a record size different from that specified when the file was created. Most of the time the new record size appeared to work as expected, but it was subject to obscure errors if references were made to records nearly at the end-of-file. This restriction is detected and enforced by FOR. 6. FOR FTN implements REWIND as a close, open sequence. repositions the file at its beginning by means of an FCS .POINT operation. 7. FTN implements the ENDFILE statement as a close operation. FOR implements the ENDFILE statement by writing an end-of-file record on a file. 8. FOR checks that the labels used in an assigned GO TO are valid labels in the program unit, but it does not check at run time whether an assigned label is in the list in the GO TO statement. FTN checks at run time. 0.1.4 Operational Differences 1. Under FTN a task which has suspended execution as a result of a PAUSE statement resumes execution by means of the CON (continue) MeR command. Under FOR, the RES (reswne) MCR command must be used. 0-3 APPENDIX D. COMPATIBILITIES 2. D.2 The default device assignments for logical units 5 and 6 are CL: and TI: respectively on RSX-llD V4A. The default assignments on RSX-llM are TI:S and CL:6. COMPATIBILITY WITH PDP-II FORTRAN IV-PLUS 1. FORTRAN IV-PLUS (F4P) logical tests check only the highest-order bit of the value, and it treats a one as .TRUE. and a zero as • FALSE. FOR treats any non-zero bit pattern in the lowest-order byte of a variable as .TRUE. and an all-zero bit pattern as .FALSE •• 2. The FOR implementation of DO loops does not enforce the restrictions, stated in the language manual, concerning changing DO loop parameters, including the control variable, within the range of the loop. FORTRAN IV-PLUS permits DO parameters other than the control variable to be changed. Such changes do not affect the number of times the loop is executed (the iteration count computed at the start for the loop). FORTRAN programs which violate the FOR rules but execute as desired may behave differently under F4P. 3. FOR defines named common blocks in terms of named .CSECTs. F4P uses .PSECTs with an explicit D attribute. Since .CSECTs are equivalent to .PSECTs with I attribute specification assembly language programs which communicate with FORTRAN programs by means of COMMON blocks must be changed in order to be successfully linked by TKB. (TKB treats such conflicting attribute specifications as non-fatal errors.) 4. In F4P, INTEGER*4 causes both 32 bit allocation and 32 bit computation. Only 16 bits are used for computation in FOR. S. F4P provides the BYTE statement and data type as a synonym for LOGICAL*l; F4P also provides LOGlCAL*27 FOR does not. 6. F4P checks the label list in an assigned GO TO at FOR checks only for the validity of the labels. D-4 run time; APPENDIX E BIT STRING MANIPULATIONS Realtime Process Control, Process I/O, and most of the RSX-IIM system directives may be performed by means of FORTRAN callable subroutines. These routines are described in the RSX-llM Executive Reference Manual, DEC-ll-OMERA-A-D. Two types of bit string ~anipulations are provided in order to support these calls: logical and shifting. In order to process words from arrays it is necessary to be able to manipulate information on a bit by bit basis. E.l LOGICAL OPERATIONS These operations are implemented as function subprograms. In the following functions, m and n specify integer variables or array elements. Operations are performed on a full word, bit by bit. These operations are supported for compatibility purposes only. FORTRAN logical operators .AND., .OR., .XOR., X!QV., and ,NOT. simpler to use and generate better code. E.l.l Inclusive OR lOR (m, n) Where m and n designate arguments which are logically added. E.l.2 Logical Product lAND (m, n) Where m and n designate arguments which are logically multiplied. E-I The are APPENDIX E. BIT STRING MANIPULATIONS E.l.3 Logical Complement NOT (m) Where m designates the argument which is logically complemented. E.l.4 Exclusive OR IEOR (m, n) Where m and n designate arguments which are exclusively added. E.2 SHIFT OPERATIONS The logical shift is implemented as a function subprogram. A right or left shift can be specified. Zeros are propagated following the shifted value and the argument's sign is not extended. ISHFT (m, n) m designates the argument to be shifted n n specifies the number of positions to the direction of the shift: n)O shift right n(O shift left naO no shift be The absolute value of n, n, should not exceed fifteen. the function result will be zero. E-2 shifted If it and does, APPENDIX F SOFTWARE PERFORMANCE REPORTS From time to time problems and/or errors will be encountered in the use of the FORTRAN-IV Compiler or Object Time System. These should be communicated to Digital Equipment Corporation by means of a Software Performance Report (SPR). Software Performance Report Forms, such as the one shown at the end of this section, may be obtained from the local Digital office. Software Performance Reports should be submitted directly to Software Communications, P. O. Box F, Maynard, Mass., 01754 for handling. Software Support Specialists in each Digital office receive regular reports on known software problems and will in many cases be able to provide software ·patches for correcting the problem and/or an alternate programming technique for temporarily avoiding the problem. Reports which appear to be new will be dealt with by the appropriate group within the Software Engineering Department. Every SPR will be acknowledged upon receipt, and every SPR will be answered in writing. SPR's that are of general i~terest will be published so that other Software Specialists and customers may benefit. In preparing a Software Performance Report, the are recommended: following guidelines 1. Give as complete a description as possible of the problem encountered. Often a detail that may seem irrelevant will give a clue to solving the problem. 2. If possible, isolate the problem to a small example. Large, unfamiliar programs are difficult to work with and may result in a misunderstanding of what the problem is or an inability to duplicate the problem. 3. Include console samples, listings, link maps, and so on with the SPR. Annotations showing where the error occurred are extremely helpful. 4. If a program reads input data, include sample input and, if possible, sample output. S. If an error example cannot be isolated to a single program unit, include listings, etc., on all program units involved. F-l listings APPENDIX F. SOFTWARE PERFORMANCE REPORTS Experience shows that as many as one-third of all SPR's db not contain sufficient information to duplicate the problem. Complete and concise information will help Digital give accurate and timely service to software problems. The OTS version and edit number should be specified when communicating with DEC Software Support concerning the OTS. The version and edit numbers can be found in the Task Builder map. They ~ill appear as a symbol and associated value in the <. ABS.) program section of the $OTI module map listing and will have the following form: VOOxc where nnnnnn x - a decimal digit c = an alphabetic character n = an octal digit The Compiler version number appears in the <. ABS.) section of the module $FORT, and takes the form MF4xxx, where x is a decimal digit. A system may crash if Task Builder switches such as used which do not match the hardware configuration. F-2 IFP or lEA are APPENDIX F. SOFTWARE PERFORMANCE REPORTS mamalma SPR Field Name Saftware Specialist Company Office Cost Center Report type o Logic/coding error' o Documentation error o Suggestion o Inquiry Zip Phone /Date sent Computer IMemory ISystem device System program & version Attachments # _ _ _ _ _ _ __ Page _ _ _ of _ _ _ __ SOFTWARE PERFORMANCE REPORT Address # _ _ _ _ _ _ __ .0 Other hardware o source o obJect terminal printout Page Document / Monitor & version o Jlstlng o example tape tape ~«, ....~V C-.~' -J ( FOR SOFTWARE SPECIALIST USE ONLY DATE REC'O DATE ANS'O TO S.C" TO CUSTOMER FOR SOFTWARE COMMUNICATIONS USE ONLY DATE REC'O TO MAINTAINER DATE ANS"D TO DEC 7-(380)-1044B-R373 Y' __ , •• ' UARCO FORM NO. 81-307-34 F-3 INDEX ABORT, 1-19 ACCEPT, 3-2 Accessing an existing file, B-8 ACTFIL (task builder option), 1-12 Algorithm, error processing, C-12 Appending to a file, B-8 Arrays, multi-dimensional, 2-5 Arrays, vectored, 2-5 ASG (task builder option), 1-14 Assembly language programs, 2-5 Assembly language subprograms, 2-3 ASSIGN subroutine, 3-2, B-2 Assignments, logical device, 3-2 Assignment, logical unit, 3-2 Asterisk used in ODL, 1-17 Bit string manipulations, E-l Blank COMMON, 1-8 Buffers, 1-12 ( CALL EXIT statement, 1-19 Clock, programmable, B~12 Clocks, line frequency, B-12 CLOSE, B-3 Command string, 1-1 Command file, indirect, 1-2 Command files example, indirect, 1-20 COMMON (task builder option), 1-12 COMMON, blank, 1-8 COMMON, initialization, 3-1 Compatibility with other FORTRANs, D-l Compiler, 1-5 Error diagnostics, C-l Memory requirements, 1-10 Switches, 1-6 See also Switches, compiler Version number, F-2 Complex format, A-3 Continuation lines, 3-1 Control returned to calling program, 2-4 Conventions, documentation, vii Conversion from FTN to FOR, D-l from F4P to FOR, D-l Creating a new file, B-8 Data representation, A-I DATE, B-3 IDE switch, 1-6, 1-20 Debugging, 1-20 Default file types, 1-5 DEFINEFILE, B-9 Devices, Peripheral, 1-4 Pseudo, 1-4 Diagnostics Error, C-l Warning, C-lO Documentation conventions, v~~ Double precision format, A-2 lEA switch, 1-11 11/45 Floating point processor, 1-11 .END statement, 1-16 ERR=transfer, C-12 Error action, B-4 Error codes, OTS, C-15 Error control bits, C-12, C-15 Error diagnostics, Compiler, C-l Fatal, C-lO Initial Phase,C-3 OTS, C-12 Secondary phase, C-4 Warning, C-lO Error handling, OTS, B-4, B-6 Error message, OTS, C-13 Short file, C-14 Error processing, Algorithm, C-12 Implementation, C-22 Errors, syntax, C-l ERRSET subroutine, B-4 ERRSNS subroutine, B-5 ERRTST subroutine, B-6 lEX switch, 1-7 EXIT subroutine, B-7 Extended arithmetic element, 1-11 Fatal error diagnostics, C-lO FCS, B-8, C-14 FCS file control conventions, 3-3 FDBSET subroutine, B-8 File control services (FCS) , B-8, C-14 File control conventions, FCS, 3-3 File descriptor block (FOB), C-14 Filename, 1-2 File search, B-8 File specifications, 1-2 File type, 1-2 INDEX-l File types, default, 1-5 File updating, B-8 Floating-point formats, A-I Floating point processor, 11/45, 1-11 FMTBUF (task bui1d~r option), 1-14 FOR MCR command, 1-5 Format compilation, object time, 1-14 FORTRAN libraries, 1-15 FORTRAN subprograms, 2-3 FTN, D-1 Function subprograms, 2-5 F4P, D-1 Generated code listing, 1-8 [.-.. Hollerith, Format, A-4 Strings, B-9 /I4 switch, 1-7, A-I lAND, E-1 /ID switch, 1-7 IDATE subroutine, B-4 lEaR, E-2 Image, task, 1-10 Implementation differences, FTN-FOR, D-2 Implementation, error processing, C-22 ' Ipdirect command file, 1-2 example, 1-20 Initial phase error diagnostics, C-3 Input file, 1-5 Installing a task, 1-18 Integer .format, A-I Internal buffers, B-8 Internal Sequence Numbers (ISN), 1-8, 2-2 lOR, E-1 lRAD50 subroutine, B-9 ISNs, internal sequence numbers, 1-8, 2-2 Keyword options, 1-12 Languages differences, FTN-FOR, D-l /LB switch, 1-11, 1-15 /LI switch, 1-6 LIBR option, 1-15 Libraries, 1-13, 1-15 Relocatable, 1-15 Shared, 1-13, 1-15 System, 1-15 User, 1-15 Library subroutines, B-1 Summary, B-1 List file, 1-7 List formats, 1-7 Listing Generated code, 1-8 Source, 1-8 Storage Map, 1-8 Local symbols, 1-8 LOGICAL*l, A-3 Logical device assignments, 3-2 Logical format, A-4 Logical operations, E-1 Logical operators, E-1 Logical shift, E-2 Logical unit numbers, 1-14, B-2 Logical units, 1-13 LUN assignments, 1-14, 3-2, B-2 Map, memory allocation, 1-10 MAXBUF (task builder option), 1-13 Maximum record size, 1-13 MCR, monitor console routine, 1-1, 1-5, 1-10 Memory allocation map, 1-10 Memory requirements, compiler, 1-10 IMP switch, 1-11, 1-16 Monitor console routine, (MCR), 1-1, 1-5, 1-10 Multi-dimensional arrays, 2-5 NOT, E-2 Null arguments, 2-4 Object code, 2-1 Object time format compilation, 1-14 Object time system (OTS), 2-1, see OTS ODL, overlay description language, 1-16 ODT, (on-line Debugging Technique) , 1-20 /Op switch, 1-7 Operational differences, FTN-FOR, 0-4 Operations ,. Logical, E-1 Shift, E-2 Operators, logical, E-1 Options, keyword, 1-12 Options, task builder, 1-12 COTS), object time system, 2-1 Differences, FTN-FOR, D-2 Edit number, F-2 Error codes, C-15 Error diagnostics, C-12 Error handling, B-4, B-6 Error message format, C-13 Version number, F-2 Output file, 1-5 INDEX-2 - :', ~ r---:.. .' \. j '- Overlays, 1-16 Overlay description language (ODL) I 1-16 Overlay structure, 1-16 Overlay structure, examples, 1-17, 1-18 Object code, 2-1 Object time format compilation, 1-14 Object time system (OTS) , 2-1 See OTS ODL, overlay description language, 1-16 ODT, (On-line Debugging Technique) , 1-20 lop switch, 1-7 Operational differences, FTN-FOR, 0-4 Operations, Logical, E-1 Shift, E-2 Operators, logical, E-l Options, keyword, 1-12 Options, task builder, 1-12 (OTS) , object time system, 2-1 Differences, FTN-FORm 0-2 Edit number, F-2 Error codes, C-15 Error diagnostics, C-12 Error handling, B-4, B-6 Error message format, C-13 Version number, F-2 Partition, 1-14 PAUSE statements, 1-20 Peripheral devices, 1-4 PRINT, 3-2 Program termination, B-7 Pseudo devices, 1-4 SECNDS subroutine, B-ll Secondary phase error diagnostics, C-4 ISH switch, 1-11 Shared access, B-8 Shared library, 1-13, 1-15 Shift, logical, E-2 Shift operati9ns, E-2 Short message file, C-14 ISN switch, 1-7 Software performance reports, F-1 Source listing, 1-8 ISP switch, 1-6, 1-11 Statement ordering, 3-3 STOP, 1-19 Storage map listing, 1-8 Subprograms, Assembly language, 2-3 Function, 2-5 FORTRAN, 2-3 Register usage, 2-4 Subroutines, library, B-1 Subroutine linkage, 2-3 Switches, compiler, 1-6 IDE, 1-6 lEX, 1-7 lID, 1-7 1I4, 1-7, A-I ILl, 1-6 lop, 1-7 ISN, 1-7 Isp, 1-6 IVA, 1-7, 2-6 IWR, 1-7, C-10 Switch default summary, 1-7 Switch format, 1-3 Switch options, task Builder, 1-11 lEA, 1-11 IFP, 1-11 ILB, 1-11, 1-15 IMP, 1-11, 1-16 ISH, 1-11 Isp, 1-11 Syntax errors, C-1 SYSLIB.OLB (system object library), 1-10, 1-15 System Libraries, 1-15 R50ASC subroutine, B-10 RAD50 subroutine, B-9 RADIX-50 Character set, A-4 Format, A-4 Notation, B-9 RANDU, RAN subroutine, B-11 REASSIGN, 3-2, B-2 TASK (task builder option), 1-13 Read only access, B-8 Task builder, 1-10 Real format (2-word floating point), Exit, 1-10 A-2 Task builder options, 1-12 Record size, maximum, 1-13 ACTFIL, 1-12, 3-2 Relocatable libraries, 1-15 ASG, 1-14 Register usage, subprogram, 2-4 COMMON, 1-12 RESUME, 1-19 FMTBUF, 1-14 RETURN, vii LIBR, 1-13 .ROOT statement, 1-16 MAXBUF, 1-13 RUN, 1-19 PAR, 1-14 INDEX-3 TASK, 1-13 Ule, 1-2, 1-13 UNITS, 1-13 Task Builder switch options, 1-11 See also Switch options, Task Builder Task execution, 1-19 Task image, 1-10 Task Image file, 1-10 Task name, 1-13 TIME subroutine, B-12 TYPE, 3-2 Ule (task builder option), 1-13 UNITS (task builder option), 1-13 Units, logical, 1-13 Unit numbers, logical, 1-14 USEREX subroutine, B-7 User libraries, 1-15 /VA switch, 1-7, 2-6 Variable names, 3-1 Vectored arrays, 2-5 Version, 1-2 Warning diagnostics, e-10 /WR switch, 1-7, e-10 { \ INDEX-4 HOW TO OBTAIN SOFTWARE INFORMATION SOFTWARE NEWSLETTERS, MAILING LIST The Software Communications Group, located at corporate headquarters in Maynard, publishes newsletters and Software Performance Summaries (SPS) for the various Digital products. Newsletters are published monthly, and contain announcements of new and revised software, programming notes, software problems and solutions, and documentation corrections. Software Performance Summaries are a collection of existing problems and solutions for a given software system, and are published periodically. For information on the distribution of these documents and how to get on the software newsletter mailing list, write to: Software Communications P. O. Box F Maynard, Massachusetts 01754 SOFTWARE PROBLEMS Questions or problems relating to Digital's software should be reported to a Software Support Specialist. A specialist is located in each Digital Sales Office in the United States. In Europe, software problem reporting centers are in the following cities. Reading, England Paris, France The Hague, Holland Tel Aviv, Israel Milan, Italy Solna, Sweden Geneva, Switzerland Munich, West Germany Software Problem Report (SPR) forms are available from the specialists or from the Software Distribution Centers cited below. PROGRAMS AND MANUALS Software and manuals should be ordered by title and order number. In the United States, send orders to the nearest distribution center. Digital Equipment Corporation Software Distribution Center 146 Main Street Maynard, Massachusetts 01754 Digital Equipment Corporation Software Distribution Center 1400 Terra Bella Mountain View, California 94043 Outside of the United States, orders should be directed to the nearest Digital Field Sales Office or representative. USERS SOCIETY DECUS, Digital Equipment Computer Users Society, maintains a user exchange center for user-written programs and technical application information. A catalog of existing programs is available. The society publishes a periodical, DECUSCOPE, and holds technical seminars in the United States, Canada, Europe, and Australia. For information on the society and membership application forms, write to: DECUS Digital Equipment Corporation 146 Main Street Maynard, Massachusetts 01754 DECUS Digital Equipment, S.A. Sl Route de l'Aire 1211 Geneva 26 Switzerland F READER'S COMMENTS NOTE: RSX-IIM FORTRAN-IV USER'S GUIDE DEC-II-LMFUA-A-D This form is for document comments only. Problems with software should be reported on a Software Problem Report (SPR) form (see the HOW TO OBTAIN SOFTWARE INFORMATION page). Did you find errors in this manual? If so, specify by page. Did you find this manual understandable, usable, and well-organized? Please make suggestions for improvement. Is there sufficient documentation on associated system programs required for use of the software described in this manual? If not, what material is missing and where should it be placed? ( Please indicate the type of user/reader that you most nearly represent: o o Assembly language programmer Higher-level language programmer [] Occasional programmer (experienced) User with little programming experience Student programmer Non-programmer interested in computer concepts and capabilities o o o Name.,...,..---,...,---.....-________________ Oat.e _____________ Organization __--_._-.....--___- - - - - - - - - - - - - - - - - - - - Street_.....-,---___- - - - - - - - - - - - - - - - - - - - - - - - - - - - Ci ty_~-.,..----~----- State ____- - - Zip Code _ _ _ _ _ __ or Country If you do not require a written reply, please check here. 0 -------------------------------------------------------------Fold lIere------------------------------------------------------------ ----------------------------------------------..- Do Not Tear - Fold lIere and Staple ------------------------------~---------------- FIRST CLASS PERMIT NO. 33 MAYNARD, MASS. BUSINESS REPLY MAIL NO POSTAGE STAMP NECESSARY IF MAILED IN THE UNITED STATES Postage will be paid by: Software Communications P. O. Box F Maynard, Massachusetts 01754
Source Exif Data:
File Type : PDF File Type Extension : pdf MIME Type : application/pdf PDF Version : 1.3 Linearized : No XMP Toolkit : Adobe XMP Core 4.2.1-c041 52.342996, 2008/05/07-21:37:19 Create Date : 2005:09:20 17:56:41Z Modify Date : 2016:12:05 11:26:39-08:00 Metadata Date : 2016:12:05 11:26:39-08:00 Producer : Adobe Acrobat 9.0 Paper Capture Plug-in Format : application/pdf Document ID : uuid:fb201990-7cfa-7a43-9c1d-308d7e4b6fc4 Instance ID : uuid:088838e5-153e-f04d-b528-bfa38100d7fa Page Count : 96EXIF Metadata provided by EXIF.tools