.TITLE FNDVRB - FIND VERB ROUTINES .SBTTL FNDVRB - TITLE PAGE .IDENT /V01.00/ .ENABL LC ; ; Routines to find match to command verb. ; ; Version: V01.00 ; ; Author: R.W. Stamerjohn ; ; Modification history: ; ; V01.00 RWS 14-Oct-1984 Initial version .SBTTL FNDVRB - DECLARATIONS .DSABL GBL .DSABL CRF ; ; Macro library calls: ; ; FCS macros. ; .MCALL FDOF$L ;Define FCS offsets FDOF$L .MCALL FCSBT$ ;Define FCS bits FCSBT$ .MCALL OPEN$R ;Open file for read .MCALL CLOSE$ ;Close file ; ; Global declarations: ; .GLOBL VRBINT ;Search internal table .GLOBL VRBTSK ;Search for .TSK file .GLOBL VRBCCL ;Search through .CCL file ; ; Global references: ; ; CCS routines. ; .GLOBL FNDCMD ;Scan for command keyword ; ; FCS routines. ; .GLOBL .FIND ;Find filename .GLOBL .PARSE ;Parse file specification ; ; Internal file labels. ; .GLOBL FLYINS ;String for flying task installs .GLOBL ITABLE ;Internal lookup table ; ; Data variables. ; .GLOBL GMCR ;Get MCR command .GLOBL KEYL ;Length of keyword .GLOBL KEYB ;Start of keyword .GLOBL PMIN ;Minimum number of parameters .GLOBL PNTR1 ;%1 parameter .GLOBL ILUN ;Input file lun .GLOBL IBUF ;Input file buffer .GLOBL ISIZ ;Input file buffer size .GLOBL INPFDB ;Input file FDB .GLOBL TSKFNB ;.TSK FNB .GLOBL XITSTS ;Exit status .ENABL CRF .SBTTL FNDVRB - LOCAL DATA ; ; Local Symbols: ; ; None. ; ; Local Data: ; ; None. .LIST BEX .EVEN .SBTTL VRBTSK * SEARCH FOR TASK IMAGE ; ;+ ; This routine searches the for verb.TSK in the directory named by ; the DSD. If found, it sets an internal command. ; ; Call with: R2 = DSD value ; R5 = Search table address ; ; Exits with: CC Command find and setup for execution ; CS No command found, R5 saved. ;- VRBTSK:: ;Ref. label MOV KEYL,10(R2) ;Set length of command keyword MOV KEYB,12(R2) ;Set address of command keyword MOV #INPFDB,R0 ;Get input file FDB MOVB #ILUN,F.LUN(R0) ;Set lun number MOV #INPFDB+F.FNB,R1 ;Get input file FNB MOV #TSKFNB,R3 ;Get default filename block CALL .PARSE ;Parse specification BCS 9999$ ; If CS - no such file CALL .FIND ;Try to find file BCS 9999$ ; If CS - no such file ; ; We have a winner. Construct command line for flying install and try ; to use it. This is done by setting %1 first three characters of command ; keyword (if that many), %A to rest of command, and %2 - %4 to the DSD ; that found the file and setting an internal file pointer to the following ; line. ; ; *INS %2%%3%%4%/TASK=%1%%T%/CMD="%4% %A%" ; MOV #PNTR1,R0 ;Get parameter table MOV KEYL,(R0) ;Set %1 to keyword name CMP #3,(R0)+ ;Is keyword longer than 3? BGE 1000$ ; If GE - no, skip MOV #3,-2(R0) ;Only use first three characters 1000$: MOV KEYB,(R0)+ ;Store address of keyword MOV (R2)+,(R0)+ ;Set DSD to %3 - %5 MOV (R2)+,(R0)+ ; ... MOV (R2)+,(R0)+ ; ... MOV (R2)+,(R0)+ ; ... MOV (R2)+,(R0)+ ; ... MOV (R2)+,(R0)+ ; ... CLR PMIN ;Set no parameters needed CLRB INPFDB+F.LUN ;Flag working on internal file CLR INPFDB+F.URBD+0 ;Set first record size to zero (zero C) MOV #FLYINS,INPFDB+F.URBD+2 ;Set start of fake record 9999$: RETURN ;Return to caller .SBTTL VRBINT * SEARCH INTERNAL TABLE ; ;+ ; This routine searches the internal table for a verb match. If found, ; It processes any remaining keys. ; ; Call with: R2 = DSD value ; R5 = Search table address ; ; Exits with: CC Command find and setup for execution ; CS No command found, R5 saved. ;- VRBINT:: ;Ref. label CLRB INPFDB+F.LUN ;Flag working on internal file CLR INPFDB+F.URBD+0 ;Set first record size to zero MOV #ITABLE,INPFDB+F.URBD+2 ;Set start of first record MOV R5,-(SP) ;Save R5 CALL FNDCMD ;Scan for command match MOV (SP)+,R5 ;Restore R5 RETURN ;Return to caller. .SBTTL VRBCCL * SEARCH CCL FILE ; ;+ ; This routine searches .CCL files for a verb match. If found, ; it leaves the file open and returns to caller. ; ; Call with: R2 = DSD value ; R5 = Search table address ; ; Exits with: CC Command find and setup for execution ; CS No command found, R5 saved. ;- VRBCCL:: ;Ref. label OPEN$R #INPFDB,#ILUN,R2,,#IBUF,#ISIZ BCS 9999$ ;If CS - no file found MOV R5,-(SP) ;Save DSD list accross call CALL FNDCMD ;Scan for command match MOV (SP)+,R5 ;Restore DSD list BCC 9999$ ; If CC - exit (leave file open) CLOSE$ #INPFDB ;Close the file SEC ; and set error 9999$: RETURN ;Return to caller .END