.TITLE MCM -- SET INTO "REAL" MCR MODE .IDENT -000000- ;+ ; Abstract: MCM ; ; This program will set the user's terminal into real MCR mode. ; It will then suspend itself to prevent ...PDX from prompting ; again; when it is resumed (usually via the "DCM" command) ; it exits to allow ...PDX to return. ; ; Operating procedures: ; ; This program can be run from ...PDX or CATALOG, simply by ; typing "MCM". It prevents itself from being run under MCR ; mode. ; ; Errors: ; ; The program cannot set the terminal completely into MCR ; mode; in particular, ...PDX and $$$MCM are still running ; on the user's terminal. If the user tries to execute a ; second ...PDX (from ...MCR), then when he logs out from the ; second ...PDX, he will be logged off but the first ...PDX ; and $$$MCM will still be running, locking up the terminal. The ; only way to unlock it is to resume $$$MCM from the system ; console. Since this mode should be restricted to privileged ; users (who are supposed to know what they're doing), this is ; not regarded as being a fatal flaw. ; ; Limitations: ; ; This will only work on an IAS V3.0 or IAS V3.1 multi-user ; system. It will not work under timesharing because its ; method of changint the current CLI only works under a multi- ; user system. ; ; Written: 08-May-79, -0.0.0-, Bruce C. Wright ; Modified: ; Verified: 01-Mar-1981, -0.0.0-, Bruce C. Wright ;- ; .MCALL SPND$S,EXST$S,DIR$,RQST$,QIOW$,GMCR$ ; GMCR: GMCR$ RQST: RQST$ ...MCR MSG: QIOW$ IO.WVB,1,1,,,, BUFFER: .ASCII /MCM -- Illegal function for non-privileged user/ BUFLEN = .-BUFFER DEVMSG: .ASCII /MCM -- Cannot be run from batch terminal/ DEVLEN = .-DEVMSG .EVEN ; MCM:: DIR$ #GMCR ; Pick up MCR node. MOV .CRTSK,R0 ; Get our ATL node. MOV A.TI(R0),R1 ; Get our PUD block. BITB #UT.PR,U.TF(R1) ; This guy privileged? BEQ 20$ ; No -- error. MOV #DEVMSG,MSG+Q.IOPL ; Set device message. MOV #DEVLEN,MSG+Q.IOPL+2 ; And length. CMP U.DN(R1),#"BA ; Is it a batch terminal? BEQ 20$ ; Yes -- error. MOV U.DACP(R1),R2 ; Save default ACP. CMP R2,#<^RMCR> ; Is MCR already the default ACP? BEQ 10$ ; Yes -- don't fiddle with it. MOV #<^RMCR>,U.DACP(R1) ; Set default ACP to MCR. MOV U.UI(R1),R3 ; Pick up the UIC. MOVB U.TF(R1),R4 ; Get the terminal privileges. MOV R3,RQST+R.QSPC ; Set the UIC of execution. DIR$ #RQST ; Request MCR. BCS 5$ ; On error, don't suspend ourselves. SPND$S ; Suspend ourselves. 5$: MOV R2,U.DACP(R1) ; Reset the default ACP. MOV R3,U.UI(R1) ; Reset the UIC in the PUD. MOVB R4,U.TF(R1) ; Reset the terminal privileges. 10$: EXST$S #EX$SUC ; And exit. 20$: DIR$ #MSG ; Error message BR 10$ ; And leave. .END MCM ;