Digital PDFs
Documents
Guest
Register
Log In
XX-5EB16-4C
1964
17 pages
Original
0.5MB
view
download
Document:
PDP-4 Fortran UM
Order Number:
XX-5EB16-4C
Revision:
Pages:
17
Original Filename:
http://bitsavers.org/pdf/dec/pdp4/PDP-4_Fortran_UM.pdf
OCR Text
J-4FT PDP-4 FORTRAN USERS' MANUAL DIGITAL EQUIPMENT CORPORATION • MAYNARD, MASSACHUSETTS PDP-4 FORTRAN USERS' MANUAL Copyright 1964 by Digital Equipment Corporatiion INTRODUCTION This manual details standard operating procedures for the several available PDP-4 FORTRAN systems _ The procedures are standard in the s,ense that they are directed to the person who wants to write and execute FORTRAN programs with little or no attention paid to the details of the operation beyond the source language level. PDP-4 FORTRAN is written for two sig- nificantly different hardware configurations, the one an exclusively paper-tape configuration and the other a configuration which includes minimally two logical tape units (either normal magnetic tape or a dual Micro Tape unit) and an 8K memory. The principal subsections of the FORTRAN system for paper tape are: Compiler Assembler Operating System Library. The compiler accepts input in the FORTRAN language and produces an output in an inter- mediate language acceptable to the assembler. The assembler accepts the compi ler output and produces a binary relocatable version of the program and (in 8K systems) a binary version of the Iinking loader. In 4K systems this loader is too large to be kept in memory with the assembler, and it constitutes an additiona I primary element of the system. When the user is ready, he loads his main program and any sub-programs, followed by any built-in functions called from the library. Once the total program is in memory, he loads the operating system and executes his program. The operating system contains an interpreter for floating point arithmetic, an interpreter for format statements, red tape routines such as fix a floating number and vice versa, and the I/O routines. The operating system must be in memory when a FORTRAN program is execu ted. PROCEDURE FOR USING FORTRAN WITH A PDP-4 PAPER TAPE SYSTEM Since the avai lable memory is small (74, 000 bits), the FORTRAN system for 4K paper tape systems is slightly less flexible than normal systems. "AII format has been omitted as well as Hollerith input. Floating point numbers may be output in "EII format only. About 1400 decimal locations are available for program and data. The following procedure, with differences noted, applies equally well to 4K and 8K systems. In an 8K system about 4600 decimal registers are avai lable for program and data. The bootstrap loader with starting address 7770 (for 4K machines) or 17770 {for 8K machines} is called the readin mode loader or RIM loader. Pressing the START switch on the console with the ap- propriate address in the ADDRESS switches is called RIM "start." Step 1: Prepare the programs to be compi led in accordance wi th the conventions establ ished in the II Summary Description of PDP-·4 FORTRAN. II Step 2: Place the paper tape labelled FORTRAN in the reader and RIM "start. II Step 3: Place the program to be compi led in the reader (lnd press CONT I NUE. The punch must be on. FORTRAN wi II punch out the intermediate object tape. Step 4: If other programs are to be compi led, repeat step 3. If an accidental error occurs at any time, such as the punch running out of paper tape before compilation is completed, the compilation procedure may be restarted by replacing the source tape in the reader, putting octal 22 in the ADDRESS switches, and depressing START. Step 5: If an error occurs in the source language, the compiler will type a threeletter plus two-digit code on the teleprinter followed by the current (last encountered) statement number. See Appendix II for the associated error conditions. As a rule, a source language error will make any further action useless. The error must be corrected and the program compiled again. How- ever, compilation should be completed to uncover all errors in the same program. In 8K systems, the compiler will also print the offending line with the errant charac ter flagged (by Iine feed). Step 6: When all necessary compilations have been successfully completed, remove the output tape(s} from the punch. Step 7: Load the FORTRAN Assembler through RIM II start. II Step 8: Place the first program to be assembled in the reloder. If severa I programs were compiled together they will be separated from each other by a short length of blank tape. The punch must be on, and the accumulator switches must be all in the down position. punch a partial binary output. 2 Depress CONTINUE. The assembler will Step 9: Depress CONTINUE to finish punching of the binary output. Symbols which are used in the source program, but never appear on the left hand side of an arithmetic statement or in an input statement or as the argument of a subroutine call, will be printed with a relative location automatically assigned by the assembler. Any statement number which is referred to but never used as a statement label will be printed also. Step 10: If a printout of the relative locations of program symbols is desired, put the least significant (right most) switch of the ACCUMULATOR switches (test switches) to the up position and press CONTINUE. If the printout is not desired, leave the switch in the down position and press CONTINUE to restore the assembler for the next assembly. For detai Is about the assembly capabilities of the PDP-4 Assembler see Digital-4-15-S. Many of the operations possible with the FORTRAN Assembler have not been del ineated here. Should an error occur during the assembly procedure, the Assembler will print a message on the teleprinter. For a summary see Appendix II. An error printed by the assembler usually is the result of an original program error which was not detected by FORTRAN. Step 11: If more prpgrams are to be assembled, place the next tape in the reader and complete step 8. If several programs were compiled together, be sure that the blank tape area is under the reader light before continuing. Step 12: Remove the assembled programs from the punch. Each program will have its title punched in readable format at the beginning. Since t~e FORTRAN Assembler is a one-pass assembler I this will be at the physical end of the punched tape. Step 13: Load the FORTRAN linking loader through RIM "start,1I for 4K systems. Omit this step in an 8K system. Step'14: Load the main program through RIM IIstart. II program be loaded first. It is important that the main In an 8K system, the linking loader is punched on the main program tape only. The loader is a lengthy strip of tape with the eighth level punched at every frame and is unmistakable once recognized. Step 15: Place any sub-programs in the reader (readable title is always the leader), and load through RIM IIstart. 1I The loader wi II handle the problems of Iinking between programs. 3 Step 16: To obtain a printout of the-obsolute locations of sub-program labels put 5 in the ADDRESS switches and depress START. Should a subroutine call or library function call not yet be "Satisfied (i .e. not yet loaded), the symbol will be preceded on the line by a minus sign followed by an address designating the last refe:renced i ink to this symbol. Step 17: If no library functions are needed go to step 18. Place the library tape in the reader, put 6 in the ADDRESS switches and depress START. The linking loader will search i-he library for functions called by the program. When all the called functions have been loaded, the loader will halt, perhaps part way through the library tape, displaying in the accumulator lights the last program address. In general, overlays of program and common storage will not be detected by the loader; this responsibility is left to the programmer. Step 18: Load the operating system through RIM II start. II Put octal 22 in the ADDRESS switches and depress START to execute the progrom. If paper tape input to the FORTRAN program is used, this should be reDdy in the reader. THE FORTRAN SYSTEM When Micro Tape or normal magnetic tape is available, a FORTRAN oriented job-processing executive system, called DECSYS, moy be used. quired. later. A minimum of two physical tape units is re- An int'egral part of DECSYS is the FORTRAN debugging system which is described The basic jobs which DECSYS can do are detai led in the following paragraph. The sys- tem is organizationally open-ended in the sense that its executive list (job list) may readily be expanded or changed to 5U it the purposes of a given insta Ilation. The DECSYS Job-List The convention of the context in which jobs are defined is that two tapes are available, a systems tape and a scratch tape. may be read. In general, the systems tape may not be written onJthe scratch Paragraph headings are control commands and are typed in on the teleprinter. Get Name - DECSYS will retrieve the named program from the system tape and relinquish control to that program. 4 Compile N Name, Name, Name; M Name, Name~ - Nand M are both two valued; they indicate the physical source for the list of programs which follow; 11111 means paper tape, 11211 magnetic tape. If "copy" is typed before "compile;1 DECSYS will copy the systems tape onto the scratch tape and append any programs now on paper tape before proceeding. Either list of names may have one element only, and either may be omitted. If a source designation is not typed, the source is understood to be paper tape. Unless errors occur, the job will proceed .to the point of execution (load and almost go). Depress CONTI NUE to execute the program. All intermediate output is stored on the scratch tape and may be retrieved at any time by again designating the scratch tape as a systems tape and restarting DECSYS. If errors occur during compilation, the compilation will be allowed to proceed although the output will be lost and DECSYS will automatically restart. If errors occur during assembly, however, normal assembly is allowed to continue. DECSYS will return control to the programmer in the assembly error mode with the following eventualities possible: Cancel! DECSYS wi II restart Symbols~ DECSYS will print output symbol definitions. Change ~ DECSYS will prefix the lines typed following "change" to the intermediate language and reassemble. Print ~ DECSYS will print a listing of the assembly input. Ignore! DECSYS will ignore the error and continue the job. Assemble N Name, Name, Name; M Name, Name ~ - The remarks about N, M, and the lists made in the previous section apply here. If "copy" precedes lIassemble, II DECSYS wi II copy the systems tape onto the scratch tape and append a II paper tape programs before proceeding. Assembly procedure will follow the path outlined in the preceding section. Execute Name - DECSYS will search the systems tape for the named program including subprograms called by it and proceed to the point of execution. Depress CONTINUE to execute the program. 5 Edit - DECSYS will retrieve the editing program and relinquish control to it. English language sources either in FORTRAN or assembly (machine) language serve as input. Debugging in the FORTRAN System An integral part of DECSYS is the FORTRAN debug mode. word IIdebug ll is typed. In place of II comp ile,ll the control FORTRAN is then switched into the debug mode and the compi led pro- gram includes entries to the Debug routine incorporated in the (debug) opsys. All executable statement numbers are available as labels to the debugging program. When the point of ex~ ecution is reached and DECSYS is in the debug mode, the programmer may type: XXX LIST TRACE XXX MUST XXX Where XXX is a statement number, III ist ll is a I ist of variables to be printed out when the assoc iated statement number is encountered, II trace ll wi II cause the printout of the last five statement numbers encountered when the designated statement number occurs, and IImust ll designates a statement number which must be encountered in a reasonable time or else an error halt should occur. Whenever the debug program is in control, i.e . just after a printout, its II Iive II Iist of debug commands may be a Itered • 6 APPENDIX I DIAGNOSTICS The following diagnostics may be printed during compi lations. Each diagnostic is identified by a three-letter name, and a two-digit number. In addition, when using an 8K compiler, the offending statement will be printed, with a I ine feed after the last character processed. For all errors, except those which indicate storage capacity exceeded, processing will continue. For both systems, the diagnostic error print (below) will be followed by the current statement number. Name Number Why CONTROL STATEMENT CON Illegal Control Statement. The statement will be ignored. 2 Upper case character in Control Statement. The statement wi II be ignored. COMMON STATEMENT COM Illegal entry in list. The entry will be ignored. 2 Symbol appears twice in COMMON. The second occurrence will be ignored. ASSIGN ASG N not a fixed point number. Attempt to use it anyway. This will probably result in an undefined symbol at assembly. SUB 2 Number not followed by to. ment. Ignore the state- 3 No fixed point variable. Use the variable as fixed point. 4 Illega I format - variable. the statement. Ignore the rest of SUBROUTINE AND FUNCTION Name not a variable. Compi Ie anyway. 7 Name Number 'Nhy 2 Dummy symbol not a variable. Treat as a symbol. 3 Dummy symbol used twice. Use anyway. Will result in a multiple symbol definition at assembly. DIMENSION DIM Array name not a variable. Treat as a variable. 2 Array dimensioned hvice. 3 Dimension not a fixed point number. cess anyway. Process anyway. Pro- DO ST A TEME NT DO First two letters not lido. II Ignore statement. 2 No statement number. 3 No end test va lue spec ified. 4 Too many characters. characters. Process anyway. Process anyway. Ignore excessive ILLEGAL FORMAT ILF Non-statement number at left margin. cess as statement number. Pro- 2 Missing left parenthesis. Assume present. 3 Missing right parenthesis. 4 Missing left parenthesis. Assume present. 5 Missing right parenthesis. Assume present. 6 Comma missing in go to. Assume present. 7 Variable missing in ,arithmetic statements, ignore second opera tor. 11 Illegal device number in input or output statement. Process anyway • 12 Illegal format in accept statement. statement. 13 Illegal format statement number in an I/O statement. Process anyway. 8 Assume present. Ignore Name Number Why 17 Extra right parenthesis. 20 Extra characters in statement. sive charac ters. 22 Comma missing in repetitive element in I/O list. Assume present. 24 Illegal format in I/O list element. a II characters to next comma. Ignore exces- Ignore ILLEGAL CHARACTER ICH Illegal character. The character will be ignored. 2 Illegal upper case character. Treat as lower case. 4 No more characters after an illegal one. CALL DIT MORSE. Cannot proceed. DIT Immediately 2 Wrong place in table 3 Dispatch number too big 10 Too many caPs 11 Illegal cal 12 Too many exits. If any of the errors labeled DIT occurs, please note any pertinent data and send to DEC-Programming Group. UFX UNSEEN FIXED POINT Empty or punctuation. Statement done, or a punctuation character. Process as if it were fixed poinL 2 Floating point quantity, treat as fixed point. 3 Not a fixed point constant. Treat as if it were. FORMAT STATEMENT FOR Character missing. 2 Illegal format. ment. 9 Ignore remainder of state- Name Number Why 3 Characters missing. statement. 4 Illegal control chanacter. 5 Illegal punctuation .. 6 Letter other than, I, F, E, X, H. remainder of statement. 7 N too large in H. Ignore remainder of Process anyway. Ignore ILLEGAL FUNCTIO'N USAGE IFU Function name on left side outside function definition. STORAGE CAPACIlrV EXCEEDED SCE Processing may not proceed. Pol ish stack exhausted. 2 Table exceeded. 3 Table exceeded. 4 Symbol generator exhausted. 5 Table exceeded. 6 Statement too long. 7 Push down stack exceeded. dais) • 10 (too many nested APPENDIX II ERROR MESSAGES (FORTRAN ASSEMBLER) With the exception of ~ (storage capacity exceeded) and ~ (illegal parity), assembly continues after the error message nas been printed, unless assembling a Iibrary tape. An error message may occur in one of three formats. Format A ERR VALl SYM VAL2 Format A is used to indicate errors in the redefinition of symbols. ERR is a three letter mnemonic for the particular error. VALl is the old octal value of the symbol SYM. VAL2 is the value of the new definition attempted. Whether the symbol was redefined depends upon the particular error. ERR Meaning mdt The symbol was redefined with a comma. rsp A permanent symbol was redefined. rda An attempt to redefine a symbol was made. The symbol was not redefined. Format B ERR OCT SYM The general error message is printed in Format B. ERR indicates the particular error. the octal address at which the error occurred. OCT is SYM is the symbolic address at which the error occurred. ERR Meaning ifp Illegal format in parameter assignment ifc Illegal format in a comma assignment ifq Illegal format in library list ify Illegal format in internal declaration 11 tms Toomany symbols in internal declaration liq Illegal term punctuation in library list mdt The value and address disagree in an address assignment. tua Too many undefined symbols in an address as, signment. ift Illegal format in an absolute address assignment I it Illegal terminator in a pundef or external list ifl Illegal format in a Eundef or external list ifs Illegal format in a ~art ifi Illegal format in an input pseudo instruction see Storage capac i ty exceeded Ins non-symbol in a pundef list Format C ERR OCT SYM CAUSE Format C is an expanded version of Format B. CAUSE is additional information to help the programmer ascertain the cause of the error ~ For example, in the case of an error caused by an undefined symbol, the symbol wi II be printed. Meaning ERR CAUSE i Ip character Illegal parity (place correct character in ACS and "continue") ust symbol Undefined symbol in a start or pause uaa symbol Undefined symbol in an absolute address assignment upa symbol Undefined symbol in a parameter assignment ich character Illegal character sys symbol Already defined s.ymbol in internal declaration --- Undefined Symbol Assignment At the end of assembly, before the loader is punched, the undefined symbols and their definitions wi II be printed. Each undefined symbol which was used in a storage word wi II be defined 12 as the address of a register at the end of the, program, and the definition printed. If the sym- bol was not used in a storage word, then just the symbol will be printed and the symbol will not be defined. An example of the latter is a symbol which appears to the right in a parameter assignment, but nowhere else. 13 6017 Printed in U.S.A. 1.5-2/64
Home
Privacy and Data
Site structure and layout ©2025 Majenko Technologies