OU:ST2OV.MAC;2/AU:72.=IN:[12,10]ST2OV.VGN \ -2,2 .IDENT /2.01X/ -/SA411/,, ; ; JGD32 01-JAN-83 SET /TIMEOUT COMMAND ; % -/SETEXC/,,/; JGD32/ .WORD TIMOUT ; SET /TIMEOUT ENTRY POINT -/DISPLC:/ -/50$:/,,/; JGD32/ .PAGE .SBTTL SET OR DISPLAY DEVICE TIMEOUT COUNT TIMOUT: BIT #EQUALS,$STTUS ; Check to see if '=' seen BEQ 80$ ; If EQ, no, syntax error CALL $GETDV ; Parse device name and get UCB address BCS 100$ ; CS -> error encountered .IF DF T$$CPW ; FDT only BIT #DV.PSE,U.CW1(R1); Yes, is it a pseudo-device BEQ 15$ ; NO .ENDC ; ; For HDT, always follow redirect chain 10$: MOV U.RED(R1),R1 ; Follow redirect pointer to end CMP R1,U.RED(R1) ; Are we at the end of the redirect chain? BNE 10$ ; No, continue, it ends somewhere 15$: MOV R1,$MPARS+6 ; Store UCB for later BIT #NEGATE,$STTUS ; Is it /NOTIMEOUT? BEQ 20$ ; If EQ, no CLR R1 ; NOTIMEOUT -> 0 timeout count BR 30$ ; Go set value in UCB 20$: CALL $GNBLK ; Search for next non-blank BCS DISTMT ; None, display timeout count ; Command now known to be SET /TIMEOUT=ddn:XX MOV $MUCB,R3 ; Check that issuing terminal is privileged BIT #U2.PRV,U.CW2(R3); Is it? BEQ 90$ ; It isn't, PRIVILEGE violation! ; Terminal is privleged, continue DEC R0 ; Backup to point at first character CALL $GTNUM ; Get the number BCS 80$ ; If CS, syntax error CMP #255.,R1 ; Is timeout count within the legal range? BLO 70$ ; <= 0 is an invalid value 30$: CALL $SWSTK,40$ ; Go to kernel state and set new value MOV $MPARS+6,R2 ; Get UCB address MOV U.SCB(R2),R3 ; Get SCB address MOVB R1,S.ITM(R3) ; Set the new value RETURN ; Return to user state 40$: JMP $MCR ; Return to dispatcher 70$: JMP SETE46 ; Illegal keyword value error 80$: JMP SETER2 ; SYNTAX error 90$: JMP SETE43 ; PRIVILEGE violation 100$: JMP (R5) ; R5 points to error processing routine .PAGE .SBTTL DISPLAY DEVICE TIMEOUT ; ; Display a devices timeout count from its SCB ; DISTMT: BIT #NEGATE,$STTUS ; A "NO" on the cmdline makes no sence BNE 100$ ; NE -> call it a SYNTAX ERROR CALL $DPBST ; Get ready for a write to TI: MOV #$KYTXT,R1 ; Copy timeout text CALL $MOVE ; into the display buffer MOVB #'=,(R0)+ ; Put a into output buffer MOV #$MPARS+2,R3 ; Get pointer to device name MOVB (R3)+,(R0)+ ; Copy name into output buffer MOVB (R3)+,(R0)+ ; a byte at a time MOV (R3)+,R1 ; Get unit number CLR R2 ; In order to convert to ASCII CALL $CBOMG ; Do the conversion MOVB #':,(R0)+ ; Set a ':' into the output buffer CLR R1 ; Clear for number MOV $MPARS+6,R2 ; Get UCB address MOV U.SCB(R2),R3 ; And SCB address MOVB S.ITM(R3),R1 ; Then get S.ITM from SCB CLR R2 ; Convert it to octal ASCII CALL $CBOMG ; Place it output buffer CALL $WRITE ; Display output buffer on TI: CALL $DETCH ; Detach TI: JMP $MCR ; Back to dispatcher 100$: JMP SETER2 ; SYNTAX error /