.TITLE PRSCMD ; This routine is used to parse an MCR command line for the ; PAC task. ; ; Inputs: R4 Address of string to parse ; ; Outputs:R3 Options word for the $CBTA routine ; R4 Next address in string ; .MCALL ISTAT$,STATE$,TRAN$ SETFLG = 1 ; Used to set flag fields DEFINT = 3. ; Default interval is three seconds PRSCMD:: MOV R0,-(SP) MOV R1,-(SP) MOV R2,-(SP) MOV R5,-(SP) ; Save registers we will be using ; Set up default values CLR FULL ; Clear the full flag CLR CONTIN ; Clear the continuous display flag MOV #DEFINT,INTERV ; Set the default interval MOV #CMDKTB,R2 ; Move address of keyword table MOV #100.,R3 ; Move an arbitrary length to R3 MOV #CMDSTB,R5 ; Address of start in state table CALL .TPARS ; Call the parsing routine BCS RET RET: MOV (SP)+,R5 MOV (SP)+,R2 MOV (SP)+,R1 MOV (SP)+,R0 ; Restore registers we used RETURN .GLOBL CMDSTB ISTAT$ CMDSTB,CMDKTB ; Beginning of the MCR command state table STATE$ CMDSTB ; Discard task name in command line TRAN$ $STRNG STATE$ NXTPRM ; Get the next paramter from command line TRAN$ $EOS,$EXIT ; We're done if we found end of line TRAN$ !DEVICE,NXTPRM ; Get a device name if one present TRAN$ !SWITCH ; Get a switch STATE$ DEVICE ; Get a device name TRAN$ $ALPHA ; First character of device name STATE$ TRAN$ $ALPHA ; Second characer of device name STATE$ TRAN$ ':,$EXIT STATE$ SWITCH ; Get a switch TRAN$ '/ ; All switches begin with a slash STATE$ TRAN$ "CONTINUOUS",$EXIT,,SETFLG,CONTIN TRAN$ "INTERVAL",INTER ; Look for the RATE switch TRAN$ "FULL",$EXIT,,SETFLG,FULL STATE$ INTER TRAN$ '= TRAN$ ': STATE$ TRAN$ $DNUMB,$EXIT,STRINT STATE$ ; Action routines STRINT: TST .PNUMB BLE ACTERR MOV .PNUMB,INTERV ; Good interval value; store it RETURN STRWID: CMP .PNUMB,#1 ; Check radix for correct range BLT ACTERR CMP .PNUMB,#32. BGT ACTERR MOV .PNUMB,FWIDTH ; It's good; store it RETURN ACTERR: ADD #2,(SP) ; Signal error RETURN .END