.ENABLE QUIET !****************************** F77.IND ********************************! .DISABLE LOWERCASE .IF P1 = "" .ASKS P1 Input file .IF P1 = "" .GOTO HELP .IF P1 = "?" .GOTO HELP .; F77 ? will go to help section .IF P1 = "HELP" .GOTO HELP .; F77 HELP will go to help section .IF P1 = "help" .GOTO HELP .; F77 help will go to help section .NOHELP: ! This will test to see if the switches are directly after the file ! name, or after the command F77. If they are after F77 ! (i.e. F77/switch) then concatenate them after the file name. .SETS SP1 P1[1:1] .IF SP1 <> "/" .GOTO REMOVE .TEST P2 .IF = 0 .ASKS P2 Input file .SETS P1 P2+P1 .REMOVE: ! Remove any compiler switches from the filename. .PARSE P1 "/" SPEC S1 S2 S3 S4 S5 S6 S7 S8 S9 S10 S11 S12 S13 S14 S15 S16 S17 .SETN SWINUM (-1.) .;SWINUM is the number of switches ! Extract the device, file name, and extension from FILE .SETS DEFDEV "DK:" .;default device .SETS DEFNAM "" .SETS DEFEXT ".$$$" .;dummy default extension .GOSUB EXTRAC .IF EXT <> DEFEXT .GOTO FNLCHK .SETS EXT ".F77" .;first default extension .SETT CHECK .;return if the file does not exist .GOSUB TESNAM .IFT CHECK .GOTO SETDEF .;if TRUE, file was found .SETS EXT ".FOR" .;second default extension .FNLCHK: .;final check on source file specification .SETF CHECK .;error if the file does not exist .GOSUB TESNAM .SETDEF: ! Set the file specs to the returned variables .SETS FILDEV DEV .SETS FILNAM NAME .SETS FILEXT EXT .TRANSL: ! This routine translates the switches into their CSI equivalents and builds ! up a string known as SWITCH which will be used by the compiler. ! Note that /A, /L, /Noo, and /O do not have CSI equivalents. Instead, flags ! are created which specify whether or not list and object files are created. ! Since /F and /T operate on the same CSI switch, that switch is stored in ! TRACEB until all switches have been processed, then is appended to SWITCH. .SETS SWITCH "" .SETS TRACEB "/S:NON" .;Default is no traceback .SETT OBJF .;Default is to create an object file .SETS OBJDEV FILDEV .;Default object device is source code device .SETS OBJNAM FILNAM .;Default object file name is source code name .SETS OBJEXT ".OBJ" .;Default object file extension is .OBJ .SETF LIST .;Default is no listing .SETS LSTDEV FILDEV .;Default list device is source code device .SETS LSTNAM FILNAM .;Default list file name is source code name .SETS LSTEXT ".LST" .;Default list file extension is .LST .SETN INDEX 1. .LOOP: .IF INDEX > SWINUM .GOTO COMPLE .SETS Sn S'INDEX' .;Set Sn equal to switch S(n) .SETS CH1 Sn[1.:1.] .;Set CH1 equal to the first char of Sn ! Call the proper string handling subroutine. ! Sn and SWITCH are the parameters to be passed to ! and from the subroutine. .GOSUB 'CH1': .INC INDEX .GOTO LOOP .COMPLE: ! Complete the CSI switch string by appending the proper traceback ! switch to it. .SETS SWITCH SWITCH+TRACEB .GOTO COMPIL .A: .SETS SWITCH SWITCH+"/L:3" .;Select full listing plus assembly code .GOTO L1 .;Process in the same way as /L .B: .SETS SWITCH SWITCH+"/I" .RETURN .C: .PARSE Sn "=" Sn CONTIN .;Extract CONTIN from /Continue=n .IF CONTIN = "" .RETURN .SETS SWITCH SWITCH+"/C:"+CONTIN .RETURN .D: .SETS SWITCH SWITCH+"/D" .RETURN .E: .SETS SWITCH SWITCH+"/E" .RETURN .F: .SETS TRACEB "/S:ALL" .RETURN .G: .H: .I: .J: .K: .RETURN .L: .IFT LIST .RETURN .L1: .SETT LIST .;LST file wanted: set the listing flag to true .PARSE Sn "=" Sn SPEC .SETS DEFDEV LSTDEV .;set the defaults for the list file specs .SETS DEFNAM LSTNAM .SETS DEFEXT LSTEXT .GOSUB EXTRAC .;extract list device, file name, and extension .SETT CHECK .;return if file not found .GOSUB TESNAM .;check validity of given filespec .SETS LSTDEV DEV .SETS LSTNAM NAME .SETS LSTEXT EXT .RETURN .M: .RETURN .N: .SETS FIRST3 Sn[1.:3.] .TEST "NOO NOS" FIRST3 .IF <> 0 .GOTO 'FIRST3' .RETURN .NOO: .SETF OBJF .;object not wanted: set the object flag to false .RETURN .NOS: .SETS SWITCH SWITCH+"/U" .RETURN .O: .PARSE Sn "=" Sn SPEC .SETS DEFDEV OBJDEV .;set the defaults for the object file specs .SETS DEFNAM OBJNAM .SETS DEFEXT OBJEXT .GOSUB EXTRAC .;extract object device, file name, and extension .SETT CHECK .;return if file not found .GOSUB TESNAM .;check validity of given filespec .SETS OBJDEV DEV .SETS OBJNAM NAME .SETS OBJEXT EXT .RETURN .P: .Q: .RETURN .R: .PARSE Sn "=" Sn RECLEN .;Extract RECLEN from /Recordlength=n .IF RECLEN = "" .RETURN .SETS SWITCH SWITCH+"/R:"+RECLEN .RETURN .S: .SETS SWITCH SWITCH+"/A" .RETURN .T: .TEST TRACEB "/S:ALL" .IF = 0 .SETS TRACEB "/S:BLO" .RETURN .U: .PARSE Sn "=" Sn NUNITS .;Extract NUNITS from /Units=n .IF NUNITS = "" .RETURN .SETS SWITCH SWITCH+"/N:"+NUNITS .RETURN .V: .RETURN .W: .SETS FIRST2 Sn[1.:2.] .TEST "WA WI WO" FIRST2 .IF <> 0 .GOTO 'FIRST2' .RETURN .WA: .SETS SWITCH SWITCH+"/W" .RETURN .WI: .SETS SWITCH SWITCH+"/Q" .RETURN .WO: .PARSE Sn "=" Sn NWORKF .;Extract NWORKF from /Workfile=n .IF NWORKF = "" .RETURN .SETS SWITCH SWITCH+"/F:"+NWORKF .RETURN .X: .Y: .Z: .RETURN .EXTRAC: ! This subroutine extracts a device name, a file name, and a file extension ! from the string SPEC and returns the strings DEV, NAME, and EXT. .TEST SPEC ":" .IF = 0 .SETS SPEC DEFDEV+SPEC .;Use the default device if one is not given .TEST SPEC "." .IF = 0 .SETS SPEC SPEC+DEFEXT .;Use the default extension if one is not given .PARSE SPEC ":." DEV NAME EXT .TEST EXT .IFF .GOTO EXTERR .SETS EXT "."+EXT .TEST DEV .IFF .GOTO DEVERR .SETS DEV DEV+":" .TEST NAME .IFF .GOTO NAMERR .IF = 0 .SETS NAME DEFNAM .RETURN .TESNAM: .RETURN ! This subroutine checks the validity of a given device and file name. ! If not valid, print an error message and exit the program. .IF DEV = "NL:" .RETURN .IF DEV = "LN:" .RETURN .IF DEV = "LP:" .RETURN .TESTFILE 'DEV''NAME''EXT' .IF = 1 .RETURN .IF <> 346 .GOTO '' .IFF CHECK .GOTO 346 .SETF CHECK .;Given file does not exist. .RETURN .;If CHECK was originally true, return. ! Error messages: .DEVERR: @sy:DISPLA.Ind -- F77.Ind ERROR: device ('DEV':) contains non-Radix-50 characters .EXIT .EXTERR: @sy:DISPLA.Ind -- F77.Ind ERROR: extension (.'EXT') contains non-Radix-50 characters .EXIT .NAMERR: @sy:DISPLA.Ind -- F77.Ind ERROR: file name ('NAME') contains non-Radix-50 characters .EXIT ! IND error messages .346: @sy:DISPLA.Ind -- F77.Ind ERROR: file 'DEV''NAME''EXT' not found. .EXIT .340: @sy:DISPLA.Ind -- F77.Ind ERROR: device ('DEV') read error. .EXIT .312: @sy:DISPLA.Ind -- F77.Ind ERROR: bad file name ('NAME'). .EXIT .244: @sy:DISPLA.Ind -- F77.Ind ERROR: invalid device ('DEV'). .EXIT .372: .366: .363: .351: .343: .337: .333: .327: .325: .324: .313: @sy:DISPLA.Ind -- F77 IND ERROR: = '' @sy:DISPLA.Ind See Table 5.6 (IND special symbols) of RT-11 System Users Guide .EXIT .COMPIL: ! Compile the program, using the switches given ! Create the command string: .SETS CMND "" .IFT OBJF .SETS CMND CMND+OBJDEV+OBJNAM+OBJEXT .;Include object file unless otherwise requested .SETS CMND CMND+"," .IFT LIST .SETS CMND CMND+LSTDEV+LSTNAM+LSTEXT .;Include .LST file if requested .SETS CMND CMND+"="+FILDEV+FILNAM+FILEXT+SWITCH ! Compile .Disable quiet ! ! 'FILDEV''FILNAM''FILEXT' .Enable Quiet .OPEN WF:'FILNAM'.WRK .ENABLE DATA R F77DEF 'CMND'  .DISABLE DATA .CLOSE $@WF:'FILNAM'.WRK DELETE/NOQUERY WF:'FILNAM'.WRK .DONE: .EXIT ! ! END OF !******************************** F77.IND **********************************! ! F77.IND Documentation .HELP: .DISABLE QUIET .SETN INDEX 1. .HLOOP: .GOSUB PAGE'INDEX' .INC INDEX .IF INDEX > 5. .SETN INDEX 1. .ASK [] CONTIN Continue .IFF CONTIN .EXIT .GOTO HLOOP .PAGE1: !****************************** F77.IND ********************************! ! Help module #1 ! ! F77 IND indirect command procedure to run the RT-11 FORTRAN 77 compiler. ! ! ! ! Version 6.0 by John Beyer 8-Aug-86, Updated 24-Apr-87 DVJensen. ! ! ! ! .F77 :== Ind Sy:F77.Ind ^ -- Define a procedure to process F77 commands.! ! .F77 -- Invoke the compiler, Sy:F77def.Sav . ! ! Note: (For RT-11 UCL) To define an F77 command, remove Sy:F77.Sav . ! ! .RENAME Sy:F77.Sav Sy:F77FB.Sav ! ! .COPY SY:F77DEF.SAV ! Required.! ! ! ! Up to seventeen switches may be specified at one time. For some RT UCLs ! ! the switches must follow the filename. In general, use the format: ! ! ! ! .F77 [:][.][/sw1[=]][/sw2[=]]... ! ! or: .F77[/sw1[=]][/sw2[=]]... [:][.] ! ! ! ! Example: .F77 TEST/Debug/Bounds/Wide/List=.LIS ! ! or: .F77/Debug/Bounds/Wide/List=TEST1.LST TEST ! ! or: .F77 TEST/d/wi/t/a=DY0: ! ! or: .F77/t/d/a=.ASL/wi TEST ! !***************************************************************************! .RETURN .PAGE2: !****************************** F77.IND ********************************! ! ! ! Help module #2 ! ! Switches available: ! ! ! ! /A*ssemblylist[=] ! ! -- Same as /L but includes a listing of assembly code.! ! /B*ounds -- Checks for array references out of bounds. ! ! /C*ontinue=n -- Sets the maximum number of continuation lines. ! ! /D*ebug -- Lines with D in column 1 are compiled. ! ! /E*xtendlines -- Compiler interprets source text in columns 73-132 ! ! /F*ulltrace -- Generates very detailed traceback (see Trace) ! ! /L*ist[=] ! ! -- Creates a list file with source listing, program ! ! section summary, and storage map. ! ! /Nos*wap -- Inhibits swapping of USR routines over the program.! ! /Noo*bject -- Suppresses creation of an object file. ! ! ! !***************************************************************************! ! ! ! ! .RETURN .PAGE3: !****************************** F77.IND ********************************! ! ! ! Help module #3 ! ! Switches available (cont): ! ! ! ! /O*bject= ! ! -- Change the default device, name, and/or extension ! ! of the object file. ! ! /R*ecordlength=n ! ! -- Specifies the maximum record length (in bytes) ! ! for run time I/O (4 < n < 4095). ! ! /S*tatistics -- Produces a stat report at the end of each module. ! ! /T*race -- Generates extra code for OTS error traceback. ! ! /U*nits=n -- Sets the number of logical units available. ! ! /Wa*rnings -- Enables printing of W-class warning diagnostics. ! ! /Wi*demap -- Produces a 132-column map listing (instead of 80). ! ! /Wo*rkfile=n -- Sets the length of the workfile in disk blocks. ! ! ! !***************************************************************************! ! ! ! ! .RETURN .PAGE4: !****************************** F77.IND ********************************! ! ! ! Help module #4 ! ! ! ! Notes: Only those letters appearing before the "*", plus any ! ! parameters, are needed. ! ! The ordering of the switches is not significant. ! ! Invalid switches are ignored. ! ! There should be NO spaces between "=" and the parameter. ! ! The parameter n in all cases is an OCTAL integer unless it is ! ! specified to be decimal (by a decimal point). ! ! Example: "/U=14" is equivalent to "/U=12.". ! ! The filespec parameter is used to specify file specifications ! ! for object and listing files that are different from defaults. ! ! In a filespec, a device name must be followed by a colon, and ! ! an extension must be preceeded by a period. ! ! The filespecs in /A and /L are optional. ! ! /Assemblylist has precedence over /List. ! ! /Noobject has precedence over /Object= ! ! /Fulltrace has precedence over /Trace. ! ! ! !***************************************************************************! ! .RETURN .PAGE5: !****************************** F77.IND ********************************! ! ! ! Help module #5 ! ! Examples of legal filespec use: ! ! /O=DU1:TEST.OB7 /A=DY1:.LIS /O=.TRA /L=NEWNAM ! ! /L=DL1: /O=DK:STUFF /A=JUNK.ASS ! ! Defaults: ! ! The default device for source code is DK:. ! ! The first default extension for source code files is .F77. ! ! If the file is not found with .F77, it is searched for with ! ! the .FOR extension. If neither is found, an error message ! ! is printed and F77 is exited. ! ! The default filespec for an object file is: ! ! :.OBJ ! ! The default filespec for a list file is: ! ! :.LST ! ! /Units default to a decimal value of 6 (/u=6.). ! ! /Workfile defaults to a decimal value of 128 (/wo=128.). ! ! /Continue defaults to a decimal value of 19 (/c=19.). ! ! /Recordlength defaults to a decimal value of 136 (/r=136.). ! ! ! !***************************************************************************! ! .RETURN