.TITLE CCSROT - CCS MAIN ROUTINE .SBTTL CCSROT - TITLE PAGE .IDENT /V01.00/ .ENABL LC ; ; Main routine for CCS catch-all task. ; ; CCS is based on CCL, a DECUS program than came from the KMS Fusion ; submissions to the RSX SIG tapes. Many people were involved with CCL, ; including Jim Downward, Richard Kirkman, Paul Sorerson, and Angle Li. ; ; Version: V01.00 ; ; Author: R.W. Stamerjohn ; ; Modification history: ; ; V01.00 RWS 14-Oct-1984 Initial version .SBTTL CCSROT - DECLARATIONS .DSABL GBL .DSABL CRF ; ; Macro library calls: ; ; Executive directives. ; .MCALL DIR$ ;Issue directive .MCALL GTSK$S ;Get task parameters .MCALL EXST$S ;Exit task with status ; ; Global declarations: ; .GLOBL CCSROT ;Task entry point ; ; Global references: ; ; CCS routines. ; .GLOBL CCSERR ;Declare CCS error and exit .GLOBL FNDPRM ;Scan command for parameters .GLOBL GETKEY ;Get missing keys .GLOBL GETCMD ;Get next MCR command .GLOBL MCRCMD ;Issue MCR command ; ; FCS routines. ; .GLOBL .PPASC ;Convert UIC to ASCII ; ; Data variables. ; .GLOBL GMCR ;Get MCR command .GLOBL MBUF ;MCR command buffer .GLOBL CMDMAX ;Maximum command line .GLOBL SEARCH ;Search path DSD, action table .GLOBL DEFUIC ;Default UIC string .GLOBL HOMUIC ;Login UIC string .GLOBL XITSTS ;Exit status ; ; Other references. ; .GLOBL $DSW ;Task directive status .GLOBL G.MCRB ;Offset to MCR command .GLOBL EX$SUC ;Exit with success .ENABL CRF .SBTTL CCSROT - LOCAL DATA ; ; Local Symbols: ; ; None. ; ; Local Data: ; ; GTSK$ buffer. ; TSKBUF: .BLKW 16. ; ; Error messages. ; .NLIST BEX ERNCMD: .ASCIZ /CCS - No command line/ ERIKEY: .ASCIZ /CCS - Illegal command keyword/ ERICMD: .ASCIZ /CCS - Unknown command or task/ .LIST BEX .EVEN .SBTTL CCSROT * CCS MAIN ROUTINE ; ;+ ; This is the main routine for CCS. It obtains the MCR command line and ; attempts to do something useful with it. Useful is defined as follows: ; ; 1. Parse out the command keyword, defined as the string of alpha- ; numeric characters at the start of the line. ; ; 2. Using command keyword as verb, try to match using various actions. ; The table at label SEARCH has a list of DSD,routines to try. The ; routines are in FNDVRB and include internal file, find .TSK, and ; search through CCS file. ; ; 3. Use the matching command and prompt for undefined parameters. ; ; 4. Construct MCR commands and issue to MCR. ; ; 5. Tell user there is no such command. ; ;- CCSROT:: ;Ref. label MOV #EX$SUC,XITSTS ;Preset success ; ; Get our task parameters and setup for M+/M processing. ; GTSK$S #TSKBUF ;Get our task parameters. CMP #6,TSKBUF+G.TSSY ;Is this M+ system? BNE 2000$ ; If EQ - no, treat as 11M ; ; RSX-11M-Plus allows multiple MCR lines and maximum length of 255. ; 1000$: MOV #255.,CMDMAX ;Set command maximum MOV #MBUF,R3 ;Set command buffer 1100$: DIR$ #GMCR ;Get MCR command line MOV $DSW,R1 ;Get length of command line BPL 1200$ ; If GT - command found CALL CCSERR ;Output error and exit .WORD ERNCMD ; *** No command error *** 1200$: MOV #GMCR+G.MCRB,R2 ;Get start of command 1201$: DEC R1 ;Count a character BMI 1300$ ; If MI - no more MOVB (R2)+,(R3)+ ;Move a character BR 1201$ ; ... until done 1300$: CMPB #<'->,-(R3) ;Was last character continuation BEQ 1100$ ; If EQ - get next line MOV #MBUF,R4 ;Get command line SUB R4,R3 ;Get command length INC R3 ; ... and correct BR 3000$ ;Continue in common ; ; RSX-11M only as one MCR input line. Also, set maximum to 79 characters. ; 2000$: MOV #79.,CMDMAX ;Set command maximum DIR$ #GMCR ;Get MCR command line MOV #GMCR+G.MCRB,R4 ;Get start of command MOV $DSW,R3 ;Get length of command line BGT 3000$ ; If GT - command found CALL CCSERR ;Output error and exit .WORD ERNCMD ; *** No command error *** ; ; *** NOTE *** ; The GMCR$ directive guarentees command ends in either or , ; all tabs and spaces are converted to single spaces, and all lower ; case is converted to upper case. The command length does not include ; the terminator. The logic depends on these guarentees. ; 3000$: CALL FNDPRM ;Parse into parameters BCC 4000$ ; If CC - keyword found CALL CCSERR ;Output error and exit .WORD ERIKEY ; *** Illegal command key *** ; ; Got a command. Initialize FCS and get various UIC strings. ; 4000$: MOV #DEFUIC,R2 ;Get string address MOV TSKBUF+G.TSPC,R3 ;Get default UIC MOV #1,R4 ;Set for no zero suppression, [] CALL .PPASC ;Convert UIC to string MOV #HOMUIC,R2 ;Get string address MOV TSKBUF+G.TSDU,R3 ;Get login UIC MOV #1,R4 ;Set for no zero suppression, [] CALL .PPASC ;Convert UIC to string ; ; Now loop and try to find the keyword. ; MOV #SEARCH,R5 ;Get start of table 5000$: MOV (R5)+,R2 ;Get next DSD string BEQ 9998$ ; If EQ - no match for verb CALL @(R5)+ ;Dispatch on type of routine BCS 5000$ ; If CS - not found, continue ; ; If any missing keys, issue prompts and input. ; CALL GETKEY ;Input any needed keys BCS 9999$ ; If CS - none exit. ; ; Get a command and setup as MCR command. Stay in this loop unit no more. ; 5100$: CALL GETCMD ;Get next command CALL MCRCMD ;Issue commmand to MCR BCC 5100$ ; If CC - not done yet 9999$: EXST$S XITSTS ;Exit task ; ; Cannot resolve command, tell user and exit. ; 9998$: CALL CCSERR ;Output error and exit. .WORD ERICMD ; *** Illegal command *** .END CCSROT