.TITLE EXIT - PROGRAM EXIT FOR TECOIO .IDENT "X0211" ; ; COPYRIGHT (C) 1976 BY DIGITAL EQUIPMENT CORPORATION, ; MAYNARD, MASSACHUSETTS ; ; THIS SOFTWARE IS FURNISHED UNDER A LICENSE FOR USE ONLY ON A ; SINGLE COMPUTER SYSTEM AND MAY BE COPIED ONLY WITH THE IN- ; CLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE, OR ; ANY OTHER COPIES THEREOF, MAY NOT BE PROVIDED OR OTHERWISE ; MADE AVAILABLE TO ANY OTHER PERSON EXCEPT FOR USE ON SUCH ; SYSTEM AND TO ONE WHO AGREES TO THESE LICENSE TERMS. TITLE ; TO AND OWNERSHIP OF THE SOFTWARE SHALL AT ALL TIMES REMAIN ; IN DIGITAL. ; ; THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITH- ; OUT NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY ; DIGITAL EQUIPMENT CORPORATION. ; ; DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY FOR ; THE USE OR RELIABILITY OF ITS SOFTWARE ON EQUIPMENT WHICH IS ; NOT SUPPLIED BY DIGITAL. ; ; ANDREW C. GOLDSTEIN 3-APR-79 18:57 ; MARK H. BRAMHALL 27-MAR-79 21:02 .MCALL EXIT$S,DIR$,GLUN$C,GTSK$C EX$ERR = 2 ; EXIT WITH ERROR STATUS EX$SUC = 1 ; EXIT WITH SUCCESS STATUS .SBTTL EXIT ROUTINES ;+ ; ; *** - EXERR EXIT WITH ERROR STATUS ; ; THIS ENTRY IS CALLED BY TECO WHEN IT IS EXITING DUE TO AN ERROR AND ; THE EXIT-ON-ERROR BIT IN ETYPE IS SET. ; ; *** - TEXIT EXIT ; ; THIS ENTRY IS CALLED BY TECO TO EXIT. ; ; NO INPUTS, NO OUTPUTS, NO RETURN. ; ;- .PSECT CODE,RO .ENABL LSB EXERR:: MOV #EX$ERR,-(SP) ; SET FOR EXIT WITH ERROR STATUS BR 10$ TEXIT:: MOV #EX$SUC,-(SP) ; SET FOR EXIT WITH SUCCESS STATUS 10$: TST OUTFDB+F.BDB ; SEE IF THERE IS AN OUTPUT FILE OPEN BEQ 20$ ; BRANCH IF NOT CALL KILFIL ; IF SO, DELETE IT 20$: CALL CLOSIF ; CLOSE THE INPUT FILE IF NECESSARY CALL INDCLS ; CLOSE THE INDIRECT FILE IF OPEN CALL TDRDEL ; DELETE TEMP DIRECTORY, IF ANY CALL TTDET ; DETACH THE TERMINAL MOV #<2*256.>+29.,-(SP) ; EXIT WITH STATUS DIC DIR$ ; TRY EXIT WITH STATUS EXIT$S ; ELSE DO NORMAL EXIT .DSABL LSB ;+ ; *** - GEXIT EXIT AND GO ; ; "GEXIT" IS EXIT AND GO (IF NFLG(R5) >=0) OR SPECIAL FUNCTION ; CALL (IF NFLG(R5)<0). SINCE AN EXIT AND GO FUNCTION IS ; NOT CLEARLY DEFINED IN RSX-11, IT JUST EXITS TO THE MONITOR. ; SINCE NO SPECIAL FUNCTIONS ARE PROVIDED, ALL JUST RETURN 0. ;- GEXIT:: TST NFLG(R5) ; SPECIAL FUNCTION CALL? BPL TEXIT ; NO, JUST GO EXIT CLR N(R5) ; YES, RETURN FAILURE (0) RETURN ; AND EXIT .SBTTL MAINTAIN VT52 DISPLAY ;+ ; ; *** - WATCH MAINTAIN DISPLAY ; ; THIS ROUTINE APPEARS HERE AS A NULL ROUTINE TO MAINTAIN THE TEXT DISPLAY. ; IT OCCUPIES THE OVERLAYABLE PSECT "SCREEN" AND MAY BE OVERLAID WITH A REAL ; ROUTINE TO MAINTAIN THE DISPLAY (SUCH AS THE VT52 SCREEN MODULE). ; ; INPUTS: NONE ; ; OUTPUTS: NONE ; ; ALL REGISTARE PRESERVED ; ;- R0OFF == SR0 ; FOR WATCH MODULE... .PSECT SCREEN,RO,I,GBL,REL,OVR WATCH:: ; ROUTINE ENTRY POINT SCREEN::RETURN ; DUMMY RETURN .SBTTL FLAG READ/WRITE INTERCEPT ;+ ; ; *** - FLAGRW INTERCEPT FLAG MODIFICATIONS ; ; THIS ROUTINE IS CALLED BY ALL TECO COMMANDS READING OR WRITING THE VARIOUS ; FLAGS. THE ONLY ONE OF CONCERN IS THE SETTING AND CLEARING OF THE ; DETACH FLAG. ; ; INPUTS: (IF R2 <> 0) ; ; R0 = NEW FLAG VALUE (IF R3 = -1) ; R2 = OFFSET TO FLAG CELL FROM R5 ; R3 = -1 IF FLAG IS BEING WRITTEN ; >< -1 IF FLAG IS BEING READ ; ; OUTPUTS: ; ; NONE ; ; ALL REGISTERS PRESERVED ; ; INPUTS: (IF R2 = 0) ; ; R0 = -1 => RETURN AN OPERATING SYSTEM DEPENDENT UNIQUE VALUE ; 0 => RETURN A JOB/TASK/PROCESS UNIQUE VALUE (0 TO 99) ; 1 => RETURN JOB'S/TASK'S/PROCESS'S KEYBOARD NUMBER ; 2 => RETURN JOB'S/TASK'S/PROCESS'S PPN/UIC ; ; OUTPUTS: ; ; R0 = RETURNED VALUE ;- .PSECT CODE,RO .ENABL LSB FLAGRW:: SAVE TST R2 ; IS IT FOR EJ? BEQ 30$ ; YEP CMP R2,#ETYPE ; SEE IF WE ARE MODIFYING THE ET FLAG BNE 70$ ; BRANCH IF NOT INC R3 ; SEE IF WE ARE WRITING IT BNE 70$ ; BRANCH IF NOT MOV ETYPE(R5),R1 ; GET OLD VALUE MOV R0,R2 ; COPY NEW VALUE BIC R1,R2 ; COMPUTE XOR OF VALUES BIC R0,R1 ; IN R1 BIS R2,R1 ; BIT #ET.DET,R1 ; SEE IF THE DETACH FLAG IS CHANGING BEQ 20$ ; BRANCH IF NOT BIT #ET.DET,R0 ; IF IT IS BEING SET BEQ 10$ CALL TTDET ; DETACH THE TERMINAL AS REQUESTED BR 20$ 10$: CALL TTATT ; OR ATTACH IF IT IS BEING CLEARED 20$: TST CRTYPE(R5) ; ARE WE ALLOWING SCOPE HANDLING? BPL 25$ ; YES BIC #ET.CRT,R0 ; NO, SO DON'T ALLOW IT 25$: MOV ETYPE(R5),R1 ; GET ORIGINAL ET FLAG BIC #ET.VT11!ET.VT52,R0 ; REMOVE THESE FROM USER'S VALUE BIC #^C,R1 ; GET ONLY THOSE FROM ORIGINAL BIS R1,R0 ; AND PUT THEM IN USER'S VALUE BR 60$ ; GO EXIT 30$: DEC R0 ; WHAT EJ CALL IS THIS? BMI 50$ ; IT'S -1 OR 0 BEQ 80$ ; IT'S 1 GTSK$C GTSKBF,CODE ; IT'S 2, GET TASK PARAMETERS MOV GTSKBF+G.TSPC,R0 ; SET UIC (G.TSGC/G.TSPC) BR 60$ ; GO EXIT 50$: INC R0 ; IS IT -1 OR 0? BEQ 60$ ; IT'S 0, GO RETURN A 0... MOVB OPSYS,R0 ; IT'S -1, RETURN OP-SYS INDICATION 60$: MOV R0,SR0(SP) ; SET THE RETURNED VALUE 70$: RETURN ; EXIT 80$: GLUN$C TTYLUN,GTSKBF,CODE ; GET INFO ABOUT TTYLUN (TI:) CLR R0 ; GET THE KEYBOARD NUMBER BISB GTSKBF+G.LUNU,R0 ; WITHOUT ANY SIGN EXTENSION CMPB OPSYS,#5 ; IS IT VAX/VMS? BNE 60$ ; NOPE, VALUE O.K. AS IS MOV R0,R1 ; YEP, COPY THE VALUE BIC #^C<17>,R0 ; LEAVE ONLY UNIT (0 TO 17) HERE BIC R0,R1 ; AND TAKE UNIT AWAY FROM THE REST ASL R1 ; PUT CONTROL NUMBER INTO HIGH BYTE ASL R1 ASL R1 ASL R1 BIS R1,R0 ; .OR. CONTROL NUMBER INTO UNIT BR 60$ ; GO EXIT .DSABL LSB .SBTTL NO CONTROL/O ;+ ; ; *** - NOCTLO NO CONTROL/O ; ; THIS ROUTINE DISABLES THE AFFECT OF A PREVIOUSLY TYPED CONTROL O ; ; INPUTS: NONE ; ; OUTPUTS: NONE ; ; ALL REGISTERS ARE PRESERVED ; ;- NOCTLO:: DECB CTOFLG ; MAKE FLAG NON-ZERO RETURN .END