.title CCL .ident /V9.1/ .enabl LC .NLIST BEX .SBTTL Introduction ;+ ; JAMES G. DOWNWARD ; KMS FUSION, INC ; 3941 RESEARCH PARK DR. ; ANN ARBOR, MICH ; 313-769-8500 ; ; CCL is the composite work of many authors. The origional version was ; written by Richard Kirkman and was in Fortran. He later hand coded it from ; Fortran into Macro-11. KMS converted it for RSX11M V3.1 to use an MCR driver ; rather than adding an executive directive. Later KMS updated it to use the ; V3.2 SPAWN directive. While we were at it we added a number of other useful ; features found in DEC's TDX catchall task (best of both worlds). Angle Li ; then did a major rewrite to comment the code, make it flow smoothly, and ; to add some enhancements. We retaliated by adding a few more features. Then ; Paul Sorenson did another major rewrite to add more sophisticated parsing, ; DCL like commands, and a general internal table driven section. Again ; insprired, we added a few more features, and fixed some bugs. ; ; This program is the composite of two programs. One part uses a list of pre- ; defined commands(LIST, TYPE, DELETE...etc.) and turns them into MCR commands ; to the utilities. This part was paterned after DEC'S TDX or catchall task. ; It's included in the section 'DCL' at the end of CCL.MAC. ; ; The second part of the program consists of code to open a file ; (USERCCL.CCL or SYSCCL.CCL) and see if the command entered corresponds ; to a command entered in the file. First the file USERCCL.CCL ; on the user's UIC and SY: is tried. If either the file does not exist ; or the command is not found, the scan is repeated using SYSCCL.CCL. ; ; The program starts out by seeing if it got a valid command line from MCR. ; If it did, it calls the DCL subroutine which checks to see if it matches ; the command in the command table. Note that if the first three letters ; match, DCL assumes it is a match, and will field the command, so commands ; which have the first three letters matching in a .CCL file will do no good ; at all. If a match is found the command is spawned to MCR, and ...CA. will ; stop itself until the command is executed and then will exit with the ; appropriate status. ; ; If DCL subroutine does not find the command a direct return is made to CCL ; which proceeds to open the .CCL files, and search for a command which ; matches up to the first 8 letters. If a match is found, the prototype ; command line in the file is decoded, fleshed out, and spawned to MCR. ; If the command prototype ends with a %$ (signifying ESC) the CCL will exit ; without waiting for the MCR command to finish executing. Otherwise CCL will ; hang around until the command spawned to MCR has finished. ; ; ; VERSION 7.0B/C ; ; Note on Version 7.0B: Major modifications have been made to the internal ; workings of CCL, but the ultimate result should appear exactly the same as ; previous 2 releases of CCL from KMS Fusion via DECUS RSXSIG. Several more ; enhancements have been added, including: 1) prior to opening USERCCL.CCL, ; CCL will check an internal "file" in .PSECT $TABLE which should be setup ; exactly as a CCL file would be (alternative to DCL which can be easily ; modified), 2) If no match for keyword is found, CCL will attempt to spawn ; ...CA2 as a "catchall" task for CCL, 3) 3 more parameters have been added-- ; %0%=leading switches, %B%=string up to first major delimiter (currently only ; space) %C%=string from first major delimiter to end -- these were added ; to make supporting RT-11 V3 style commands easier. ; ; Version 8.0 ; ; RSX11M V4.0 supports alternate CLI's. This version of CCL may either be ; installed as a catchall task or as a CLI. To install CCL as a CLI, ; ; INS $CCL/TASK=...CCL/CLI=YES ; CLI /INIT=CCL/DPR="<15><12>/CCL>/" ; CLI /ENABLE=CCL ; ; If the system does not support CLI's, none of the above will work but CCL ; will still work as the catchall task ...CA. CCL also uses the RPOI$ ; directive where possible so that a version of CCL (...CA.) does not have ; to be left lying about to maintain the OCB linkage. If CCL is to be used ; as a CLI, the system CCL file for use as a CLI should be created as ; ; LB1:[1,5]SYSCLI.CCL ; ; Nasty warning messages appear if the file is missing. The command flow of ; CCL is altered somewhat if it is a CLI. If the command is looked for ; (in order) in ; Internal table ; SY0:[UIC]USERCLI.CCL ; LB1:[1,5]SYSCLI.CCL ; ; If not found in LB1:[1,5]SYSCLI.CCL, the command line is sent to MCR, the ; catchall task for CCL. By installing CCL as a CLI, all MCR commands can ; be redefined. Also the responsiveness of frequently used CCL commands is ; improved. ; ; VERSION 9.0 ; ; P. Sorenson ; Pulmonary Research ; S3, Mayo Clinic ; Rochester, MN 55901 ; (507)-284-8395 ; ; The 'DCL' code has been conditionalized extensively, and is not used ; in any form by myself. So, to keep the CCL.MAC listings reasonably sized ; DCL has been split off to its own module (DCL.MAC); do with it what you may. ; ; One 'DCL' command that could not be reasonably imitated by a CCL ; file/table was "HEY". The "HEY" command may now be implemented ; using a "-tasknam%P%$" line in a CCL file/table. "-" signifies the connect, ; "%P" prints exit status, "%$" signifies exit when done. Also, the sequence ; of connecting to tasks has been altered: ; if the task name is 3 characters, try "xxxTnn" first, then "...xxx". ; if no task name is given, try "TTnn". ; The connect and wait routine "WAITCK" is now in its own module (WAITCK.MAC). ; ; The chaining of CCL catchalls has been changed to spawn a catchall ; based on current task name, e.g. if this is ...CA., spawn ...CA1; if this ; is ...CA4, spawn ...CA5. ; ; The opening of CCL's files has been conditionalized, streamlined, ; and expanded to include a group wide CCL file under LBn:[*,5]GRPCCL.CCL. ; The library device # is still conditionalized to be 1 or 0 by defining ; $LB0 to select LB0:. The preconditional assembly file CCLPRE.MAC controls ; which files are to be opened as well as the order of opening files. ; Due to the varied nature of looking on internal tables, user, group or ; system files for command matches, the error message "...Error reading file" ; when in fact the file doesn't exist has been removed; in its place is the ; ubiquitous "...syntax error, unknown command". ; ; There has also been some ambiquity over the parameter definitions ; %0-%9, and %A-%C. A new CCL file/table line begining with "~" or "^" now ; controls parameter parsing. See the expanded comments in CCL.DOC and ; PARSE.MAC for a full description of these new style lines. ; ; Another bug that has cropped up ; occurs when optional parameters are required but someone forgot to include ; a "?" CCL prompt line in the file/table. This could end up spawning ; an absolutely incorrect command line to MCR, or, at least less harmful, ; show a read failure on the CCL file. A check is now made such that a "*" ; action line will unconditionally stop scanning the file/table once a keyword ; match has been found. If required parameters are missing, CCL will fail ; with a "file/table syntax error". New parameter parsing is included ; to aid handling more complicated command syntaxes. ; ; VERSION 9.1 -- P. Sorenson ; ; This release of CCL is aimed at making the features of CCL V9.0 ; available to users of unsupported RSX-11M versions, i.e. 11M V3.2, ; and 11M-plus V1.0 (which no includes myself). ; The command line spawn to MCR has also been enhanced ala Ralph ; Stammerjohn's "CCS" (see Multi-tasker Vol. 16 # 3) for those who want ; to spawn long command lines to tasks at the price of making CCL a privileged ; task. OCB relinking is also supported for the unsupported M systems if ; CCL is privileged. The command line to enable OCB relinking and ; queing long command lines must be a valid line to INStall, and ; must use the "/CMD" switch to designate the offspring's command line. ; M V3.2 and M+ V1 will not reguire support for the "/CMD" switch ; in INStall if CCL is privileged, since this section of the INS command ; line will be queued directly to the offspring task. ;- .SBTTL The original CCL ; ; Original author: R. J. KIRKMAN ; ; The main routine also requires SPAWN, LOOKUP, FIXUP, & GETLIN ; ; MODIFIED BY: ; ??-???-78 J. Downward Modified to use MCR driver for V3.1 ; ; 15-MAR-79 J. DOWNWARD ADD VARIOUS ERROR MESSAGES, TEST FOR ; LINES TOO LONG, AND FOR SPEED BUILD IN ; ALL KINDS OF DCL-LIKE COMMANDS. ; (EG. LIST, DIR, SPOOL, TRUNCATE, ; PURGE, DELETE., ETC.) ; ; 24-SEP-79 J. DOWNWARD ADD %U,'G%,%G,%T TO DECODED VARIABLES ; ADD MULTIPLE LINE CCL COMMANDS AND A ; ABILITY FOR CCL TO WAIT FOR A SPECIFIC ; TASK TO EXIT ; ; 10-Jan-80 A. Li Performed massive edit on all source ; U of Miami files and made the program legible. ; Also made error messages upper/lower ; and lower case. Conditionalized ; generation of DCL and the PIP subset ; of DCL. Added %A - pass entire command ; line (except the keyword). ; ; Fall 80 J. Downward Bells and whistles. ; ; 10-Mar-81 P. Sorenson Rewrote much of CCL and changed ; MSU handling of parameters by using pile ; of pointers. ; Added %0 - leading switches, e.g. ; BRU/REW/VER . Added %B - first set ; of parameters (up to first space). ; Added %C - second set of parameters, ; from %B to end, minus delimiter. ; Added lookup from internal "file" as ; a compromise between DCL and .CCL ; files. USERCCL.CCL is opened on users ; protection (logon) UIC rather than ; default UIC-- most often, but not ; always, the same. ; ; ; 22-MAR-81 J. DOWNWARD Added %R (ring terminal bell on exit) ; JGD04 to provide same functionality as the ; old style (pre V7.0) %B. (JGD05) ; ; 23-MAR-81 J. Downward Added %D (debug). If encountered the ; JGD05 expanded command line (to that point) ; will be printed. ; ; JGD06 Conditionalized DEBUG code. Added ; %Q so can exit CCL without sending ; command to MCR if a required input ; field is defaulted with a null. ; ; JGD07 Conditionalized (on $DCLX) out those ; DCL commands which could easily be ; replaced by the new Internal Table ; parsing. Added %P to print a line ; to the terminal with no additional ; messages. ; ; JGD08 Required changes for RPOI$ support ; in SPAWN.MAC for RSX11M V4.0. ; CCL V7.0C ; ; Version V8.0 ; ; JGD09 Changes so that CCL can be an ; Oct 24,1981 alternate CLI. ; ; JGD10 Convert lowercase to upper case if ; the command input is from GCII$. ; ; Version V8.0B ; ; June, 1982 P. Sorenson ; ; PRS02 Add support for "HEY" type commands ; from .CCL files/tables ; ; PRS03 Split DCL code to its own module. ; Alter chaining of catchalls based ; on current task name ; ; PRS04 Change sequence for connect to task. ; ; PRS05 Don't allow CCL to wait for tasks ; if it's an alternate CLI. ; ; Version 9.0 ; Oct-Jan, 1983 ; PRS06 Add lookup on [*,5]GRPCCL.CCL, group ; wide CCL file. Conditionalize opening ; of files, and sequence of files opened ; ; PRS07 Add CCL file/table line to change ; CCL's command parameter delimiters. ; Try to streamline code, change psect's ; to read-only where applicable in hopes ; of making CCL multi-user...someday ; Move parsing/prompting for parameters ; to PARSE.MAC (consult CCL.DOC) ; ; March, 1983 PRS08 Bug fixes; make v9.0 parsing more ; transparent to users ; ; May, 1983 PRS10 Fix bug in trying to issue HELP when ; command keyword ends in "?"... ; Change it to HELP if command ends with ; "?". ; ; Version 9.1 ; October, 1983 PRS11 Conditionalize M V4, M+ V2 directives ; based on defn of "$ALCLI". Fix bug ; in error message reporter that ; would corrupt memory resident CCL ; command tables. Alter defn of "TSTRNG" ; .MCALL OPEN$R,FDBDF$,FDRC$A,CLOSE$,EXIT$S,QIOW$S,GET$ .MCALL FDOP$A,FSRSZ$,DIR$,EXST$S,GLUN$ .MCALL QIOW$,CNCT$,STSE$S,CLEF$S ;PRS11 .IFDF $ALCLI ;Code only required for alternate CLI'S ;PRS11 .MCALL GCCI$ ;JGD09 .ENDC ;$ALCLI ;PRS11 .MCALL GMCR$,GTSK$ ;PRS07 ; Move conditional assembly stuff out to its own file for easier ; manipulation. ; ; .SBTTL Define assembly conditionals ; ;$DCL = 0 ; Enable DCL ;ALI ;$PIP = 0 ; Enable PIP subset of DCL ;ALI ;$DCLX = 0 ; Enable MCR info subset of DCL ;JGD07 ;$LB0 = 0 ; Redefine device for SYSCCL.CCL to LB0: ;PRS ; DEBUG conditionals ;JGD06 ;$DBG = 0 ; Define for debug version PART 0 ;JGD06 ;$DBG1 = 0 ; " " " " PART 1 ;JGD06 ;$DBG2 = 0 ; " " " " PART 2 ;JGD06 ;$DBG3 = 0 ; " " " " PART 3 ;JGD06 ;$DBG4 = 0 ; " " " " PART 4 ;JGD06 ;$DBG5 = 0 ; " " " " PART 5 ;JGD06 ;$DBG6 = 0 ; " " " " PART 6 ;JGD06 ; ; Define buffer length..."P" now moved to end of .$$$$. Psect so ;PRS07 ; TKB EXTTSK option controls how much to allocate ; ;PARLNG = 256. ; 256 bytes for all %n% ; ; Further misc. definitions ; BELL = 7 CR = 15 ; LF = 12 ; ESC = 33 ; SPA = 40 ; Blank SWTCH = 57 ; / -- standard RSX/RT switch delimiter COMMA = 54 EQUAL = 75 LANGLE = 74 RANGLE = 76 QNMRK = 77 LBRACK = 133 RBRACK = 135 UNDSCR = 137 PCNT = 45 PLUS = 53 MINUS = 55 STAR = 52 .PAGE .SBTTL CCL - Global common data .PSECT .$$$$.,rw,d,ovr,gbl ; ; The common data area for the three routines FIXUP,LOOKUP and the MAIN ; program. NOTE: Things have been rearranged again and all symbols ;PRS07 ; have been made global so the psect does not have to be defined in ;PRS07 ; the other MACRO modules. ;PRS07 ; ;PRS07 CMD:: ;Size of output buffer depends on priv. status ;PRS11 .IFDF $PRIV ;PRS11 .BLKB 166. ;Absolute max = 79. to INS and 79. to offspring ;PRS11 .IFF ;PRS11 .blkb 80. ; Output command line ;PRS11 .ENDC ;$PRIV ;PRS11 C.LGTH=.-CMD ;Define buffer length symbolically ;PRS11 ; .IFDF $ALCLI ;CODE ONLY REQUIRED FOR ALTERNATE CLI'S ;PRS11 CLIBF:: .BLKW 3. ; CLI buffer occupies the next 88 bytes ;JGD09 .ENDC ;$ALCLI ;PRS11 GETMCR: GMCR$ ; Get MCR DPB defines DIC and reserves ;PRS07 ; 80. bytes for command buffer space ;PRS07 MCR == GETMCR+G.MCRB ; Define symbol for start of command ;PRS07 .IFDF $ALCLI ;CODE ONLY REQUIRED FOR ALTERNATE CLI'S ;PRS11 CLILN = .-CLIBF ; Length of CLI get command line buffer ;JGD09 .ENDC ;$ALCLI ;PRS11 NEXTP:: .WORD P ; Points to next free spot in P ; PRS ; ; *** WARNING -- The order of parameter definition blocks has changed ! ;PRS08 ; *** For CCL V8.0 compatible parsing, parameter definition blocks ; consist of: ; 1st word = byte count ; 2nd word = address of parameter string. ; ; *** For CCL V9.0 parsing, parameter definition blocks consist of: ; 1st word = byte count of full parameter field ; 2nd word = start address of full parameter string ; 3rd word = # subfields within parameter ; 4th word = address of n 2 word subfield definition blocks ; Each subfield definition block is allocated out of "P" space ; and have the same format as CCL V8.0 parameter definition blocks ; ;*** FOR CONSISTANCY WITH OTHER PARAMETERS, PROVIDE 2 WORD DESC. OF MCR LINE MCRL:: .WORD 0 ; Length of MCR/CLI command line ;PRS07 MCRB:: .WORD MCR ; Pointer to MCR/CLI command line buffer;PRS07 KEYL:: .WORD 0 ; Length of keyword KEYB:: .WORD MCR ; Keyword buffer address ;PRS01 PNTRA:: .WORD 0,0 ; Parameter A pointer; MCR line minus keyword PNTRB:: .WORD 0,0 ; Parameter B pointer; 1st major parameter set PNTRC:: .WORD 0,0 ; Parameter C pointer; 2nd major parameter set PNTR0:: .WORD 0,0 ; Parameter 0 pointer; leading switches ; ; *** New V9.0 parametere definition blocks ;PRS08 PNTR1:: .WORD 0,0 ; Parameter 1 pointer .WORD 0,0 ; Subfield count/pointer PNTR2:: .WORD 0,0 ; Parameter 2 pointer .WORD 0,0 ; Subfield count/pointer PNTR3:: .WORD 0,0 ; Parameter 3 pointer .WORD 0,0 ; Subfield count/pointer PNTR4:: .WORD 0,0 ; Parameter 4 pointer .WORD 0,0 ; Subfield count/pointer PNTR5:: .WORD 0,0 ; Parameter 5 pointer .WORD 0,0 ; Subfield count/pointer PNTR6:: .WORD 0,0 ; Parameter 6 pointer .WORD 0,0 ; Subfield count/pointer PNTR7:: .WORD 0,0 ; Parameter 7 pointer .WORD 0,0 ; Subfield count/pointer PNTR8:: .WORD 0,0 ; Parameter 8 pointer .WORD 0,0 ; Subfield count/pointer PNTR9:: .WORD 0,0 ; Parameter 9 pointer .WORD 0,0 ; Subfield count/pointer ; N.PRM=.-PNTRA ; DEFINE # PARAMETERS THAT HAVE TO BE CLEARED ;PRS08 ; ; EXSTAT::.WORD EX$SUC ; Assume sucessful exit .BLKW 7. ; rest of 8 word exit status block ;PRS07 DUIC:: .WORD 0 ; For terminal (default) UIC ;JGD03 GLBUF:: ; Buffer for CA.'s terminal information ;PRS07 ; ...OR... ;PRS07 INFOBF:: .BLKW 7. ; Buffer to recieve CLI information ;JGD09 INFOLN = .-INFOBF ; Make it 7 words long ;JGD09 GTBUF:: .BLKW 16. ; Buffer to inquire about CA. ;PRS07 .EVEN ; ;***** NEW -- Put global flags in common, make all flags BYTE values ;PRS07 PMIN:: .BYTE 0 ; Min # of parameters allowed PMAX:: .BYTE 0 ; Max # of parameters to prompt for LINTYP:: SAVTYP::.BYTE 0 ; Save 1st char of CCL file action line (* or +);JGD08 MORE:: .BYTE 0 ; Flag set if next line of CCL file is a continuation ; of previous line NOSTOP::.BYTE 0 ; Flag set to non-zero by FIXUP when command ; template includes %$ to allow exitting ; before spawned task exits. RING:: .BYTE 0 ; Flag to indicate that the terminal bell ;JGD04 ; when CCL exits ;JGD04 DBGFLG::.BYTE 0 ; Flag, when set the CCL command will print out ;JGD05 QTFLAG::.BYTE 0 ; Set if %Q, quit if required parm missing ;JGD06 QUIT:: .BYTE 0 ; Set if any default parameter is nulled ;JGD06 PRINT:: .BYTE 0 ; Set if %P (print line to TI:) found ;JGD07 CLIFLG::.BYTE 0 ; Set if we are a CLI ;JGD09 PRSFLG:: ; New flag controlling v8 vs. v9 parsing ;PRS08 .BYTE 0 ; 0=v8 parsing, 1=v9 parsing ;PRS08 .EVEN TINAM:: .WORD 0 ; Place for RAD50 equivalent of TSTRNG ;PRS11 TSTRNG::.BLKB 4 ; Hold terminal identifier "xnn" (X="V" or "T") ;PRS11 ; in ASCIZ ;PRS11 .EVEN ; ; P defines a buffer for holding parameters. All parameters included ; in the original MCR line are not held in P, rather, they remain ; in MCR with their pointers set to the appropriate values for their ; subsequent recovery. If new (V9.0) parsing is selected, all ; subexpression pointer blocks will also be allocated in "P". ; Size of "P" is now up to TKB EXTTSK option... ; P:: .BLKW 1 .PAGE .SBTTL CCL - Local impure data .PSECT $IDATA,RW,D,CON,LCL,REL ; SAVSP: .WORD 0 ;Save stack pointer for error recovery ;PRS07 ; ; Impure error message definitions. ;PRS07 ; MSG2: .ASCII /CCL -- Error reading / ;PRS06 MSG2A: .BLKB 30. ;FILE IN FILE SPEC AT RUN-TIME ;PRS06 MSG4: .ASCII /? ?/ .ASCIZ /CCL -- Syntax error, unknown or ambiguous command/ .EVEN ; *** Move PIP messages to DCL module ;PRS02 ; ; Define the files that may be accessed...put the addresses for ;PRS06 ; each file's data set descriptor in an ordered list. DSD's ;PRS06 ; position in list determines order it will be opened. ;PRS06 ; PRECCLASM.MAC should define symbols FILE1-FILE4 and set them ;PRS06 ; equal to a # from 1-4. FILE1 will be opened 1st, followed by ;PRS06 ; FILE2, etc. The number equated to FILEn determines which data ;PRS06 ; set descriptor will be used in opening the file: ;PRS06 ; 1 = open internal file ;PRS06 ; 2 = open SY:[ggg,mmm]USERCCL.CCL ;PRS06 ; 3 = open LBn:[ggg,5]GRPCCL.CCL ;PRS06 ; 4 = open LBn:[1,5]SYSCCL.CCL ;PRS06 ; As an example, previous releases would scan internal table, ;PRS06 ; open USERCCL.CCL, and finally SYSCCL.CCL. Therefore, define ;PRS06 ; FILE1=1, FILE2=2, FILE3=4 in PRECCLASM.MAC. ;PRS06 ; ;PRS06 ;***** ; ; Define macro to insert a 2 word entry into OPNTBL's list: ;PRS06 ; 1st word => logical unit # ;PRS06 ; (0=internal file, 1=FCS file, -1=end-of-list) ;PRS06 ; 2nd word => address of the file's data set descriptor ;PRS06 .MACRO DFNFIL A ;PRS06 .IF DF A ;PRS06 .IF EQ A-1 ;Check if internal file ;PRS06 .WORD 0 ;Yes, use lun 0 ;PRS06 .WORD INTDSD ; define DSD ;PRS06 .IIF NDF $DCLTB, $DCLTB=1 ;Show need int. file ;PRS06 .ENDC ;PRS06 .IF EQ A-2 ;Check for USER file # ;PRS06 .WORD 1 ;Use lun 1 ;PRS06 .WORD USRDSD ; define DSD ;PRS06 .IIF NDF FCSFIL, FCSFIL=1 ;Show need FCS ;PRS06 .ENDC ;PRS06 .IF EQ A-3 ;Check for GRP file # ;PRS06 .WORD 1 ;Use lun 1 ;PRS06 .WORD GRPDSD ; define DSD ;PRS06 .IIF NDF FCSFIL, FCSFIL=1 ;Show need FCS ;PRS06 .ENDC ;PRS06 .IF EQ A-4 ;Check for SYS file # ;PRS06 .WORD 1 ;Else, use lun 1 ;PRS06 .WORD SYSDSD ;Yes, define DSD ;PRS06 .IIF NDF FCSFIL, FCSFIL=1 ;Show need FCS ;PRS06 .ENDC ;PRS06 .ENDC ;A ;PRS06 .ENDM ;PRS06 ; ;PRS06 OPNTBL:: ;PRS06 ; Check for 1st file definition ;PRS06 DFNFIL FILE1 ;PRS06 ; ;PRS06 ; Check for 2nd file definition ;PRS06 DFNFIL FILE2 ;PRS06 ; ;PRS06 ; Check for 3rd file definition ;PRS06 DFNFIL FILE3 ;PRS06 ; ;PRS06 ; Check for 4th file definition ;PRS06 DFNFIL FILE4 ;PRS06 ; ;PRS06 ; set end of list = lun -1 ;PRS06 .WORD -1 ;PRS06 ; ;PRS06 ; Include file specs, reserve buffer space only if using FCS files ;PRS06 .IF DF FCSFIL ;PRS06 FSRSZ$ FCSFIL,,$IDATA ;PRS06 ; ; .EVEN USRUIC: .BLKB 9. ; Will hold users protection (logon) UIC .EVEN USRFIL:: .ASCII / USERC/ ; Name of user's files, may be changed ;PRS06 USRCL=. ; by GBLPAT @ USRFIL -- alter ;PRS06 .ASCII /CL.CCL/ ; " U" "SE" "RC" "CL" ".C" "CL" ;PRS06 ; .EVEN GRPUIC: .ASCII /[ggg/ ; Group # for group file + "[" and "," ;PRS06 GRPMEM::.ASCII /,005]/ ; Member # for group file + "]", may be ;PRS06 ; changed by GBLPAT @ GRPMEM -- words ;PRS06 ; to alter are ",0" "05" ;PRS06 .EVEN ; SET "CL" OF GRPCCL ON WORD BOUNDARY ;PRS06 GRPFIL:: ;PRS06 .ASCII / GRPC/ ; Name of group wide file, may be ;PRS06 GRPCL=. ; changed by GBLPAT @ GRPFIL -- alter ;PRS06 .ASCII /CL.CCL/ ; " " "GR" "PC" "CL" ".C" "CL";PRS06 ; .EVEN ; SET "CL" OF SYSCCL ON WORD BOUNDARY ;PRS06 SYSFIL:: .ASCII / SYSC/ ; Name of my system file, may be changed SYSCL=. ; by GBLPAT @ SYSFIL -- alter .ASCII /CL.CCL/ ; are "SY" "SC" CL" ".C" "CL" ; .ENDC ;FCSFIL ;PRS06 ; ; FDB for our CCL spec file...used by both FCS files and internal table ; FDB:: FDBDF$ FDRC$A ,INBF,80. FDOP$A 1,,,FO.RD!FA.SHR ; ; ; Input buffer for spec lines ; INBF:: .BLKB 80. ; ; Get task and terminal characteristics...issued when catchall ; GTASK: GTSK$ GTBUF ;PRS07 CCLNAM == GTBUF + G.TSTN ; Make global symbol for CCL's name ;PRS11 GLUN: GLUN$ 2,GLBUF ; ; Get CLI directives...issued when alternate CLI ; .IFDF $ALCLI ;CODE ONLY REQUIRED FOR ALTERNATE CLI'S ;PRS11 GTCMCI: GCCI$ CLIBF,CLILN,INFOBF,INFOLN,,GC.CEX ; Exit if no CMD .ENDC ;$ALCLI ;PRS11 ; ;PRS11 ; New error message QIO DPB ;PRS11 ERRQIO: QIOW$ IO.WLB!TF.WAL,2,1,,,,<,,40> ;PRS11 .PAGE .SBTTL CCL - Local pure data ; ; Pure data section...error messages, etc. ;PRS07 ; .PSECT $PDATA,RO,D,LCL,REL,CON ; MSG3: .ASCIZ /CCL -- Command line to CATCHALL missing/ ;PRS07 MSG5: .ASCIZ /CCL -- Expanded command line too long/ ;PRS07 ; *** spawn error messages now in SPAWN.MAC ;PRS11 MSG7: .ASCIZ /CCL -- Expanded command line is:/ MSG8: .ASCIZ /CCL -- CLI's cannot support "WAIT FOR" action lines/ ;PRS07 ; *** ERROR MESSAGES FOR TASK CONNECTS IN "WAITCK.MAC" ;PRS06 BELMSG: .ASCIZ <7> .EVEN ; ;PRS06 ; Pure sections of file specs., define data set descriptors for OPEN$R ;PRS07 ; Make devices, system uic, data set descriptors global...for GBLPAT's ;PRS07 ; .IF DF FCSFIL ; Only need this when using FCS files ;PRS06 LIBDEV:: .IIF NDF $LB0 .ASCII /LB1:/ ; Dev for system file .IIF DF $LB0 .ASCII /LB0:/ ; Alternate device for system file SYSDEV:: .ASCII /SY0:/ ; Dev for userccl file SYSUIC:: .ASCII /[001,005]/ ; UIC for my system file .EVEN SYSDSD::.WORD 4,LIBDEV,9.,SYSUIC,10.,SYSFIL+2 GRPDSD::.WORD 4,LIBDEV,9.,GRPUIC,10.,GRPFIL+2 ;Group file DSD ;PRS06 USRDSD::.WORD 4,SYSDEV,9.,USRUIC,11.,USRFIL+1 .ENDC ;FCSFIL ; ; Internal table/file data set descriptor used in building error msg. ;PRS06 .IF DF $DCLTB ; Only need this when use internal file ;PRS06 INTFIL: .ASCII /internal table @ $TABLE/ ; "Name" of internal table ;PRS06 .EVEN ;PRS06 INTDSD: .WORD 23.,INTFIL,0,0,0,0 ;Internal table DSD ;PRS06 .EVEN ;PRS06 .ENDC ;$DCLTB .PAGE .SBTTL CCL - Root section .PSECT $CODE1,RO,I,CON,LCL ; ;JGD09 ;***** NEW -- TRY BEING CLI 1ST !! ;PRS07 ; Attempt to pull command line queued for CLI. If it fails, we must be ;PRS07 ; a catchall. If it succeeds, change filenames to be opened from ;PRS07 ; *CCL.CCL to *CLI.CCL ;PRS07 ; ;JGD09 CLI: MOV SP,SAVSP ; Save current stack pointer ;PRS07 .IFDF $ALCLI ;Code only required for alternate CLI'S ;PRS11 DIR$ #GTCMCI ; Get command line, Exit if none. ;JGD09 BCS CCL ; If fails, probably not a CLI or ;PRS07 ; alternate CLI's not supported ;PRS07 ; try being catchall ;PRS07 TSTB CLIFLG ; Already been flagged a CLI ? ;PRS07 BNE 8$ ; Branch if yes ;PRS07 INCB CLIFLG ; Show we are a CLI ;JGD09 .IF DF FCSFIL ; Only need this if FCS files are being opened ;PRS06 MOV #CLIFIL,R0 ; Setup to change 2 chars in fil name ;PRS06 MOV R0,SYSCL ; change system file name ;PRS06 MOV R0,GRPCL ; and group file name ;PRS06 MOV R0,USRCL ; and user file name ;PRS06 .ENDC ;FCSFIL ;PRS06 8$: ; ;JGD09 MOVB CLIBF+G.CCCT,R3 ; GET # OF CHARACTERS ;PRS07 ; ; Get command line for CLI's does not convert Lower case to Upper case ; so we must do it ourselves, sigh! ; MOV R3,R2 ; Copy # chracters in command line ;PRS07 MOV #CLIBF+G.CCBF,R0; Address of start of buffer ;JGD10 10$: MOVB (R0)+,R1 ; Get character ;JGD10 CMPB R1,#141 ; Is it lower case ;JGD10 BLT 15$ ; If LT, no, check next char ;JGD10 CMPB R1,#172 ; Maybe, is it in right range ;JGD10 BGT 15$ ; If GT, no it isn't, try next char ;JGD10 SUB #40,R1 ; Yes it is, make it into upper case ;JGD10 15$: MOVB R1,-1(R0) ; Return converted character to buffer ;JGD10 SOB R2,10$ ; Loop until last character done ;JGD10 ; ; Now, setup R0-R3 with length, terminal name, unit #, and prot. UIC ;PRS07 ; MOV R3,R0 ; Copy # characters in command line ;PRS07 MOV CLIBF+G.CCDV,R1 ; Fetch physical device name of TI: ;PRS07 MOVB CLIBF+G.CCUN,R2 ; and unit # ;PRS07 MOV INFOBF+G.CCCU,DUIC ; Save default UIC ;PRS07 MOV INFOBF+G.CCPU,R3 ; Fetch protection (logon) UIC ;PRS07 BR COMCOD ; and join common code ;PRS07 .ENDC ;$ALCLI ;PRS11 ; ;***** Must be a catchall for someone...do stock get MCR line ;PRS07 CCL: CLRB CLIFLG ; MAKE SURE EVERYONE KNOWS WE'RE CA. ;PRS07 DIR$ #GETMCR ; GET COMMAND LINE ;PRS07 MOV $DSW,R0 ; GET LENGTH OF COMMAND LINE ;PRS07 BGT 5$ ; BRANCH IF COMMAND THERE ;PRS07 ; ; No command line, print a message and exit with severe status ; MOV #MSG3,R0 ; Get appropriate error message JMP TYPERR ; Write it out and exit ;ALI 5$: DIR$ #GTASK ; FILL IN TASK INFORMATION ;PRS07 DIR$ #GLUN ; AND TERMINAL INFORMATION ;PRS07 MOV GLBUF+G.LUNA,R1 ; GET PHYSICAL DEVICE NAME FOR TI: ;PRS07 MOVB GLBUF+G.LUNU,R2 ; AND UNIT # ;PRS07 MOV GTBUF+G.TSPC,DUIC ; SAVE DEFAULT UIC ;PRS07 MOV GTBUF+G.TSDU,R3 ; GET PROTECTION (LOGON) UIC ;PRS07 ; ; Whether we are a CLI or a catchall, we wind up here. ; COMCOD: MOV R0,MCRL ; Save length of MCR/CLI command line ;PRS07 MOVB #CR,MCR(R0) ; Terminate command with ;PRS07 MOV #TSTRNG,R0 ; Fetch place for "Tnn" or "Vnn" ;PRS04 MOVB R1,(R0)+ ; Save TI:'s physical device name ;PRS11 MOV R2,R1 ; Copy TI:'s unit # ;PRS07 BIC #177407,R1 ; Grab hi order unit #, 5 bits for M+ ;PRS11 BEQ 5$ ; Branch if 0 ;PRS04 ASR R1 ; Move # to bits 0-2 ;PRS04 ASR R1 ;PRS04 ASR R1 ;PRS04 CMP R1,#10 ; Unit # < 100 ?? ;PRS11 BLT 4$ ; Branch if yes ;PRS11 ADD #11,R1 ; allow M+ terminals A0-X7 ;PRS11 4$: ADD #60,R1 ; Convert it to ASCII ;PRS11 MOVB R1,(R0)+ ; and save it ;PRS04 5$: BIC #177770,R2 ; Grab lo order unit # ;PRS04 ADD #60,R2 ; Convert it to ASCII ;PRS04 MOVB R2,(R0)+ ; and save it ;PRS04 CLRB (R0) ; Make it asciz ;PRS11 MOV #TSTRNG,R0 ; Recover start address ;PRS11 CLR R1 ; "." not allowed ;PRS11 CALL $CAT5 ; Convert it to RAD50 ;PRS11 MOV R1,TINAM ; Save result ;PRS11 ; .IF DF FCSFIL ; Only need ASCII protection UIC if opening files ;PRS06 ; R3 must contain binary protection UIC !! ;PRS07 MOV #1,R4 ; Set up for no zero suppression, include [,] MOV #USRUIC,R2 ; Fetch address to put ASCII UIC CALL .PPASC ; Convert UIC to ASCII for later--User's file MOV #GRPUIC+1,R0 ; Also need to fill in group # for ;PRS06 MOV #USRUIC+1,R1 ; GRPCCL.CCL file ;PRS06 MOV #3,R2 ; Move "ggg" 10$: MOVB (R1)+,(R0)+ ; Copy UIC string ;PRS06 SOB R2,10$ ; til done ;PRS06 .ENDC ;FCSFIL ;PRS06 ; .IFDF $DBG ; If debugging ;JGD06 MOV #MCR,R0 ; ;PRS MOV MCRL,R1 ; ;PRS QIOW$S #IO.WAL,#2,#1,,,, ;PRS .ENDC ; ;JGD06 ; ; *** Slight modification to HELP for V9.0, if command line ends in ? ;PRS10 ; requeue "? (original line)". CCL file/table must then scan for "?". ;PRS10 ; NOTE: no parameters have been defined yet !! ;PRS10 ; .IFDF HELP ;PRS10 HLP: MOV #MCR,R0 ;Fetch address of MCR line ADD MCRL,R0 ; add in length CMPB -1(R0),#QNMRK ;Ends in "?" BNE 20$ ;No, do normal command lookup MOVB (R0),-1(R0) ;Get rid of ?, replicate line terminator BIC #1,R0 ;Set R0 to word boundary MOV R0,R1 ;Copy pointer ADD #2,R1 ;Point to free word in buffer 10$: MOV -(R0),-(R1) ;Shift command line right by 2 bytes CMP R0,#MCR ;Hit start of command buffer ? BHI 10$ ; loop if no MOV #"? ,(R0) ;set in new command keyword INC MCRL ;show 1 more character in command 20$: .ENDC ;HELP ;End of new HELP handling ;PRS10 ; ; Call DCL subroutine. DCL returns only if command is not a DCL one. ; .IFDF $DCL ; Sometimes useful CALL DCL ; Is it a built-in command? .ENDC; $DCL ; ; ;+ ;***** NEW -- PRS06 ; ; Split out command name from command line is now handled by ; LOOKUP which may also redefine parameter delimiters for those ; who want to get fancy with command line syntax ; ;***** ; ; Formerly a conditional "open" for internal table was done here ; followed by USERCCL.CCL and finally SYSCCL.CCL. Now, we ; will use a list defining lun # (0 for internal file, ; 1 for FCS file) and data set descriptor address. Negative ; unit number terminates list,; order of opening files ; controlled by entries in PRECCLASM.MAC ; ;***** ;- ; START: MOV #PNTRA,R0 ; Fetch address and # of ;PRS08 MOV #N.PRM/4,R1 ; 4 word blocks to clear ;PRS08 1$: CLR (R0)+ ; clear length and address ;PRS08 CLR (R0)+ ; of parameter defn. blocks ;PRS08 SOB R1,1$ ; Loop til done ;PRS08 MOV #OPNTBL,R0 ; Get address of file list 2$: MOVB (R0)+,F.LUN+FDB ; Fetch lun to try BLT CTCHAL ; Branch on end-of-list ;PRS10 INC R0 ; Align pointer MOV (R0)+,F.DSPT+FDB ; Save address of DSD CALL OPEN ; Try to open file BCC 10$ ; Branch if successful JMP FILERR ; Open failed, but not "no such file" 10$: CALL LOOKUP ; Try to match keyword BCC KEYFND ; Branch if found CALL CLOS ; Else, close file BR 2$ ; and try next one ; ; If keyword isn't for help, try spawning MCR line off to ...CAn+1, as ;PRS03 ; catchall task for ...CAn, n determined by installed task name. ;PRS03 ; If we're a CLI, go directly to default catchall defined @$CANAM... ;PRS07 ; normally "MCR..." unles altered by TKB "GBLPAT" option. ;PRS07 ; Send command line to SPAWN routine with command start address in R0, ;PRS11 ; command length in R1...SPAWN now forces immediate exit for catchall ;PRS11 ; CTCHAL: MOV #MCR,R0 ; Fetch start address MOV MCRL,R1 ; and byte count of original MCR line .IFDF $ALCLI ;Code only required for alternate CLI'S ;PRS11 TSTB CLIFLG ; Are we a CLI ;JGD09 BNE 25$ ; Branch if yes, spawn default catchall ;PRS07 .ENDC ;$ALCLI ;PRS11 15$: MOV #GTBUF+G.TSTN,R3 ; Fetch address of our taskname ;PRS03 MOV #2,R4 ; Need to check 2 words ;PRS03 17$: MOV (R3)+,R5 ; Grab word of taskname ;PRS03 CMP R5,#^RCA. ; Is it "CA." ? ;PRS03 BEQ 22$ ; Branch if yes, we're the 1st catchall ;PRS03 BLO 20$ ; Branch if no way to be "CAn" ;PRS03 CMP R5,#^RCA8 ; Is it "CA1" to "CA8" ? ;PRS03 BLOS 23$ ; Branch if yes, we're also a catchall ;PRS03 20$: SOB R4,17$ ; Loop for both parts of taskname ;PRS03 ; *** We know we're a catachall, but can't find match to "CAn" ;PRS11 ; *** in task name. Must be M+ with exec level task dispatching ;PRS11 ; *** to the 1st catchall ;PRS11 MOV #^RCA.,R5 ; Setup for spawn to ...CA1 ;PRS11 ; setup catchall taskname based on current task name ;PRS03 22$: INC R5 ; We are CA., CA0 is next ;PRS03 23$: INC R5 ; We are CAn, CAn+1 is next catchall ;PRS03 MOV #^R...,$CANAM ; Force catchall name to start "..." ;PRS07 MOV R5,$CANAM+2 ; and end "CAn" ;PRS03 25$: CALL PUTCA ; Try spawning to catchall ;JGD09 BCS 30$ ; Branch if spawn failed, simply indicate ; unknown command JMP EXIT ; catchall took it (amazing), exit CCL 30$: ; NEW -- move 8 bytes directly from command line to error message ;PRS07 MOV #MCR,R0 ; Fetch start address MOV MCRL,R1 ; and byte count of original MCR line MOV #MSG4+2,R2 ; Fetch address for error text ;PRS07 MOV #8.,R3 ; and # of bytes to copy ;PRS07 32$: DEC R1 ; Adjust # left in command line ;PRS07 BLT 35$ ; Branch if shorter than 8 ;PRS07 MOVB (R0)+,(R2)+ ; Copy byte ;PRS07 SOB R3,32$ ; Loop til done ;PRS07 BR 37$ ; Branch to finish up error process ;PRS07 35$: MOVB #SPA,(R2)+ ; Space fill error text ;PRS07 SOB R3,35$ ; Loop til done ;PRS07 37$: MOV #MSG4,R0 ; Set up error message JMP TYPERR ; Type error message and exit ; ; Keyword found...call parsing routine to define remaining parameters ;PRS07 ; and prompt for those required but not supplied. Only returns if ;PRS07 ; everything okay ;PRS07 ; KEYFND: CALL DEFPRM ; Define parameters ;PRS07 ; ; We have all necessary parameters, start building command lines. ; ALLDON: .IFDF $DBG2 ; ;JGD06 ;**** debug section, output all parameters in order ;PRS MOV #PNTRA,R2 ; ADDRESS OF FIRST PARAMETER ;PRS08 1$: MOV (R2)+,R0 ; FETCH PARAMTER LENGTH ;PRS MOV (R2)+,R1 ; AND START ADDRESS ;PRS TST R0 ; ANYTHING THERE ;PRS BLE 2$ ; SKIP WRITE ;PRS QIOW$S #IO.WLB!TF.WAL,#2,#1,,,, ;PRS 2$: CMP R2,#PNTR1 ;AT 1ST OF 4 WORD BLOCKS ? ;PRS07 BLOS 1$ ;BRANCH IF NO ;PRS08 ADD #4,R2 ;ELSE, STEP TO NEXT ;PRS07 CMP R2,#PNTR9 ;HIT END OF PARAMETERS ;PRS08 BLOS 1$ ;BRANCH IF NO ;PRS07 EXST$S ;PRS ;**** END DEBUG SECTION ;PRS .ENDC ;$DBG2 ;JGD06 ; ; Register usage for regeneration of command lines: ; R0 = pointer to new command line being created ; R1 = # bytes left available in new command line ; R2 = pointer to command line template ; R3 = # bytes remaining to check in template ; NEXT: ; Reentry point for multiple line commands MOV #CMD,R0 ; Fetch start address for command being made MOV #C.LGTH.,R1 ; Define max. length for command ;PRS11 CLR LINTYP ; Clear both SAVTYP (leading character of CCL ; file line is * or +), and MORE (flag for ; continuation line, + line terminator) CLRB NOSTOP ; Clear flag that would exit right after spawn CONTIN: ; Reentry point if next line is continuation ; of previous line (line ended with +) CALL GETLIN ; Get a line from somebody BCC 5$ ; Branch if OK JMP FILERR ; Exit on I/O error 5$: MOV FDB+F.URBD+2,R2 ; Fetch start address for command template MOV FDB+F.NRBD,R3 ; and template's length BLE CONTIN ; Branch if null line ;PRS07 .IFDF $DBG3 ; ;JGD06 ;**** DEBUG SECTION -- ; PRS QIOW$S #IO.WAL,#2,#1,,,, ; SPIT OUT TEMPLATE LINE;PRS ;**** END DEBUG SECTION ;PRS .ENDC ; ;JGD06 TSTB MORE ; Continuation from previous line? BNE 35$ ; Branch if yes, start matching immediately MOVB (R2)+,R4 ; Fetch 1st character from line ;PRS07 10$: ;PRS11 .IFDF $WAIT ;Code for "-" action lines ;PRS11 CMPB R4,#MINUS ; Is line a "Wait for task exit" line? ;PRS07 .IFDF $ALCLI ;Code only required for alternate CLI'S ;PRS11 BNE 20$ ; Branch if no ;PRS07 TSTB CLIFLG ; Is CCL a CLI ? ;PRS07 BEQ 30$ ; Branch if no, okay to wait ;PRS07 MOV #MSG8,R0 ; CLI's can't wait, setup error message ;PRS07 JMP TYPERR ; and abort the command ;PRS07 .IFF ;$ALCLI ;PRS11 BEQ 30$ ; Branch if yes, valid line type ;PRS11 .ENDC ;$ALCLI ;PRS11 .ENDC ;$WAIT ;PRS11 20$: CMPB R4,#PLUS ; Is template line a multiple line specifier? BEQ 30$ ; Branch if yes CMPB R4,#STAR ; Is it last template line to fetch from file? BNE CONTIN ; Branch if no, unknown line type ;PRS11 30$: MOVB R4,SAVTYP ; Save template line type DEC R3 ; Readjust byte counter for template line BLE ENDDUP ; Nothing else in line, check to see if ;PRS11 ; it was "*" line = exit request for ;PRS11 ; the new "matchall" keyword line ;PRS11 35$: CMPB (R2),#PCNT ; Hit special character? BNE 40$ ; Branch if no .IFDF $DBG4 ; ;JGD06 ;**** DEBUG SECTION -- ; ;PRS MOV FDB+F.URBD+2,R4 ; SET START ADDRESS ;PRS MOV FDB+F.NRBD,R5 ; FETCH TOTAL LINE LENGTH ;PRS SUB R3,R5 ; GET # BYTES DONE ;PRS QIOW$S #IO.WAL,#2,#1,,,, ; SHOW WHATS DONE IN TEMPLATE;PRS MOV #CMD,R4 ; FETCH START ADDRESS OF COMMAND ;PRS MOV #79.,R5 ; AND TOTAL # BYTES ALLOWED ;PRS SUB R1,R5 ; DETERMINE # VALID BYTES IN COMMAND ;PRS QIOW$S #IO.WAL,#2,#1,,,, ; SHOW WHATS GOING INTO COMMAND;PRS ;**** END DEBUG SECTION ;PRS .ENDC ; ;JGD06 CALL FIXUP ; Let fixup replace special characters BCS TOOLNG ; Branch if FIXUP hit a snag TST R3 ; Check status of # bytes left in template BGT 35$ ; Branch if still something there BR 45$ ; Else, get out 40$: MOVB (R2)+,(R0)+ ; Copy over directly to new command line DEC R1 ; Readjust # bytes available in command BLT TOOLNG ; Branch if command got too long DEC R3 ; Readjust # bytes in command template BGT 35$ ; Branch if still stuff in template 45$: CMPB -1(R2),#PLUS ; Was last character in template a "+" BNE TOMCR ; Branch if no, command ready for MCR... INC R1 ; Template line continuing to next line of file DEC R0 ; readjust command line pointer and byte count INCB MORE ; Set flag for continuation BR CONTIN ; Branch to fetch next line from file TOMCR: MOV R0,R1 ; Copy current pointer position MOV #CMD,R0 ; Fetch start address of command SUB R0,R1 ; and compute byte count BLE ENDDUP ; Trap bad lines before hit PUTMCR ;PRS11 .IFDF $DBG5 ; ;JGD06 ;**** DEBUG SECTION -- ; ;PRS QIOW$S #IO.WAL,#2,#1,,,, ; SEND IT TO TI: INSTEAD OF MCR CMPB SAVTYP,#STAR ; ;PRS BEQ 99$ ; ;PRS JMP NEXT ; ;PRS 99$: JMP EXIT ; WHO KNOWS WHAT TROUBLE I'M IN ;PRS07 ;**** END DEBUG SECTION ; ;PRS .ENDC ; ;JGD06 .IFDF $WAIT ; Code for "-" action line support ;PRS11 CMPB SAVTYP,#MINUS ; Was the line a "wait for task exit" line BNE 10$ ; Branch if no CALL WAITCK ; Send command to WAITCK to connect to task BCC ENDDUP ; Task exitted, see if should ;PRS02 ; keep going to another line in file ;PRS02 JMP TYPERR ; Else, error message in R0 ;PRS07 .ENDC ;$WAIT ;PRS11 10$: TSTB QTFLAG ; Was %Q seen ;JGD06 BEQ 15$ ; If EQ, no ;JGD06 TSTB QUIT ; Was a required parameter defaulted ;JGD06 BNE ENDDUP ; If NE, yes, don't send MCR a command ;JGD06 15$: TSTB DBGFLG ; Was debug (%D) found ;JGD07 BEQ 20$ ; If EQ, no ;JGD07 MOV #MSG7,R0 ; Asume is %D (debug) ;JGD05 CALL TYPEIT ; And tell user it was encountered ;JGD05 CLRB DBGFLG ; Reset DEBUG flag ;JGD05 BR 30$ ; Now print out expanded command ;JGD05 20$: TSTB PRINT ; Was print flag seen (%P) ;JGD07 BEQ 40$ ; If EQ, no ;JGD07 CLRB PRINT ; Reset PRINT flag ;JGD07 30$: MOV #CMD,R0 ; Get address ;JGD05 CLRB CMD(R1) ; Set a null to stop printout ;PRS07 CALL TYPEIT ; Tell the user the news ;JGD05 BR ENDDUP ; More lines to process? ;JGD05 40$: CALL PUTMCR ; Spawn to MCR BCC ENDDUP ; No errors, is this last line? JMP TYPERR ; Exit with error, message addr in R0 ;PRS11 ENDDUP: MOV #EX$SUC,EXSTAT ; Show successful exit status ;PRS07 CMPB SAVTYP,#'* ; Is this the final command? ;JGD03 BEQ EXIT ; Branch if done ;PRS07 JMP NEXT ; Not done yet, branch for next line TOOLNG: TSTB PRINT ; Should we just PRINT line to TI: ;JGD07 BNE 15$ ; If NE, yes ;JGD07 MOV #MSG7,R0 ; Asume is %D (debug) ;JGD05 TSTB DBGFLG ; Is it? ;JGD05 BNE 10$ ; If NE, yes ;JGD05 MOV #MSG5,R0 ; Else, say line is too long ;JGD05 10$: CALL TYPEIT ; Type on TI: 15$: CLRB CMD+116 ; Write out command causing trouble MOV #CMD,R0 ; Write out the truncated command JMP TYPERR ; and branch to finish up ;PRS07 ; .PAGE .SBTTL CCL EXIT POINTS ;PRS07 ; ;+ ;***** ; ; CCL main and accessory routines may exit via "JMP" to the following labels: ; LINERR - Types ASCIZ error message pointed to by R0, then ;PRS11 ; prints current file/table line from FDB and continues ;PRS11 ; exit process @ERROR ;PRS11 ; FILERR - Sets up error message according to file's FDB, and ; continues exit process @TYPERR ; TYPERR - Types ASCIZ error message pointed to by R0 and continues ; exit process @ERROR ; ERROR - Sets "SEVERE ERROR" status @EXSTAT and continues exit ; process @EXIT ; EXIT - Closes any open file and exits with status defined @EXSTAT ; unless its a CLI...CLI's try to empty command queue prior ; to exitting ;***** ;- LINERR:: ;PRS08 CALL TYPEIT ; Type error text ;PRS08 CALL TYPFDB ; Type current line in FDB buf ;PRS11 BR ERROR ; and continue exit ;PRS11 FILERR:: MOV #MSG2A,R0 ; Fetch place for error text MOV #3,R1 ; 3 elements in DSD MOV FDB+F.DSPT,R2 ; Fetch data set desc. address 2$: MOV (R2)+,R3 ; Fetch # bytes in field MOV (R2)+,R4 ; Fetch address of field TST R3 ; Check field length BEQ 7$ ; Branch if nothing there 5$: MOVB (R4)+,(R0)+ ; Copy field to error text SOB R3,5$ ; Loop til done 7$: SOB R1,2$ ; Do entire DSD CLRB (R0) ; Add trailer MOV #MSG2,R0 ; Fetch start address of error ; TYPERR:: CALL TYPEIT ; Tell the user the bad news ERROR:: MOV #EX$SEV,EXSTAT ; Set up severe error status EXIT:: MOV SAVSP,SP ; Make sure stack is realigned ;PRS07 CALL CLOS ; Close .CCL file TSTB CLIFLG ; Are we a CLI ;JGD09 BEQ 5$ ; No, just exit, at last ;JGD09 JMP CLI ; Back for another cmd ;JGD09 5$: TSTB RING ; Should we ring terminal bell on exit ;JGD04 BEQ 10$ ; If EQ, no ;JGD04 MOV #BELMSG,R0 ; Set to ring terminal bell ;JGD04 CALL TYPEIT ; And send it to TI: ;JGD04 10$: EXST$S EXSTAT ; Exit with status EXIT$S ; If exit with status fails, just exit .PAGE .SBTTL LOCAL SUBROUTINES ;PRS06 .ENABL LSB ;PRS11 ; ; New subroutines for typing messages to TI:... ;PRS11 ; TYPFDB picks up length and start address of message from FDB block ;PRS11 ; (used to display errors from CCL command files/tables) ;PRS11 TYPFDB:: ;PRS11 MOV FDB+F.URBD+2,ERRQIO+Q.IOPL ;Define start address ;PRS11 MOV FDB+F.NRBD,ERRQIO+Q.IOPL+2 ; and length ;PRS11 BR 10$ ;Branch to issue QIO ;PRS11 ; ; Error message typer, error text ends in null ; TYPEIT:: ; DCL module will use this routine, make it global ;PRS03 MOV R0,ERRQIO+Q.IOPL ;Save start address of text ;PRS11 5$: TSTB (R0)+ ;Check for null terminator ;PRS11 BNE 5$ ;Branch on valid chars. ;PRS11 DEC R0 ;Readjust pointer ;PRS11 MOV R0,ERRQIO+Q.IOPL+2 ;Save pointer ;PRS11 MOV ERRQIO+Q.IOPL,R0 ;Recover start address ;PRS11 SUB R0,ERRQIO+Q.IOPL+2 ;Compute string length ;PRS11 10$: DIR$ #ERRQIO ;Issue QIO to TI: ;PRS11 RETURN ;PRS11 .DSABL LSB ;PRS11 ; ; Close our 1 file ; CLOS: MOV R0,-(SP) ; Free up R0 ;PRS06 MOV #FDB,R0 ; Fetch FDB address ;PRS06 TSTB F.LUN(R0) ; Check unit # ;PRS06 BEQ 5$ ; skip close if internal "file" .IF DF FCSFIL ; Include close if using FCS ;PRS06 CLOSE$ R0 ;PRS06 .ENDC ;FCSFIL ;PRS06 5$: MOV (SP)+,R0 ; Restore R0 ;PRS06 RETURN ; ; Open a file according to FDB pointed to by R0...Special ;PRS06 ; "file" opened on unit #0, internal file. ;PRS06 ; ;PRS06 OPEN: ;PRS06 MOV R0,-(SP) ; Free up R0 ;PRS06 MOV #FDB,R0 ; Fetch FDB address ;PRS06 TSTB F.LUN(R0) ; Check unit # ;PRS06 BGT 10$ ;Branch if real FCS file ;PRS06 .IF DF $DCLTB ; Define only if include internal table ;PRS06 ; ;PRS06 ; Do psuedo open on internal file - make it look like a file by using ;PRS06 ; FDB to store next record pointer and record length. Position at ;PRS06 ; first record, 0 bytes in current record. ;PRS06 ; ;PRS06 CLR F.NRBD(R0) ; Set up initial length ;PRS06 MOV #$TABLE,F.NRBD+2(R0) ; Set up start address of $TABLE;PRS06 BR 17$ ; Show success ;PRS06 .IFF ;PRS06 BR 19$ ; Show problems, bad lun ;PRS06 .ENDC ;$DCLTB ;PRS06 10$: ;PRS06 .IF DF FCSFIL ;Include OPEN only for FCS files ;PRS06 MOV #INBF,F.URBD+2(R0) ; Must redefine user buffer ;PRS06 OPEN$R R0 ; Open file ;PRS06 BCC 20$ ; Branch on success ;PRS06 CMPB #IE.NSF,F.ERR(R0) ; Check if its "NO SUCH FILE" ;PRS06 BNE 19$ ; Branch if not ;PRS06 .ENDC ;FCSFIL ;PRS06 17$: CLC ; Show success ;PRS06 BR 20$ ;PRS06 19$: SEC ; Show problem opening file ;PRS06 20$: MOV (SP)+,R0 ; Restore R0 ;PRS06 RETURN ;PRS06 ; ;***** ; ; THIS ROUTINE FORMERLY RESIDED IN "GETLIN.MAC", PLACED HERE TO TAKE ; ADVANTAGE OF DEFINITION OF "FCSFIL" TO CONDITIONALIZE OUT THE FCS RELATED ; CODE. NOTE: THIS IS CALLED BY OTHER ROUTINES, MUST BE GLOBALLY DEFINED. ; ; New routine required for CCL V7.0A. ; ; Performs read from file open on LUN 1, or a pseudo read from a ; data table included in .PSECT $TABLE which has been "opened" on ; LUN 0. All arguments are handled via FDB, global symbol defined by ; CCL. ; ; PRS01 make sure return correct carry bit status, set on error ; clear on success. ; PRS07 put module in CCL.MAC ;***** ; GETLIN:: ; Entry point MOV R0,-(SP) ; Save registers MOV R1,-(SP) ; TSTB FDB+F.LUN ; Check LUN # in FDB BNE 10$ ; Branch if non-0, got a real file to work on .IF DF $DCLTB ;ONLY NEED THIS CODE IF SUPPORT INTERNAL TABLES ; ; Simulate a read from file but fetch data from internal table defined ; in .PSECT $TABLE. Starting point in file must already be defined ; by simulating an OPEN (done by caller) -- PRS ; MOV FDB+F.NRBD,R0 ; Fetch previous record length MOV FDB+F.NRBD+2,R1 ; and previous record pointer INC R0 ; Increment previous line length then-- BIC #1,R0 ; mask off low bit to get even word boundary ADD R0,R1 ; Set pointer to next line MOV (R1)+,FDB+F.NRBD ; Define new line length BEQ 19$ ; Branch if 0, signal for end-of-file MOV R1,FDB+F.NRBD+2 ; Save current record pointer MOV R1,FDB+F.URBD+2 ; Do a "move" by simply ; redefining user buffer address CLC ; Show success ;PRS01 BR 20$ .IFF BR 19$ .ENDC ;$DCLTB 10$: ; Reference label .IF DF FCSFIL ;ONLY NEED THIS CODE IF SUPPORT FCS FILES ; ; Do real read from file on LUN 1 ; ; For the file open on LUN 1, offset locations F.URBD (user buffer ; length) and F.URBD+2 (user buffer address) must be defined prior ; to calling GETLIN (performed in CCL by call to OPEN). ; ; GET$ #FDB ; Read a line from the file BCC 20$ ; Exit if OK .ENDC ;FCSFIL ; 19$: SEC ; Else, signal error by setting carry bit 20$: MOV (SP)+,R1 ; Restore registers MOV (SP)+,R0 ; RETURN ; ;***** NOTE: change in task start address from previous releases !! ;PRS07 .END CLI