Google
 

Trailing-Edge - PDP-10 Archives - bb-kl11c-bm_tops20_v6_1_atpch1_16 - autopatch/ptycon.c16
There are no other files named ptycon.c16 in the archive.
 INS 1/1	;16C1
	; *** Edit 32 to PTYCON.MAC by GSCOTT on 14-Apr-87, for SPR #21346
	; Fix PTYCON not to generate extra PTYOPC interrupts, not to enable PTYOPC when
	; connected to a subjob, and to reenter a WAIT JSYS instead of going back to
	; COMND when PTYOPC interrupts us causing a PTY Hungry interrupt. 
 REP 83/1	;16C2
	VEDIT==VI%DEC+^D31	;EDIT NUMBER
 WIT
	VEDIT==VI%DEC+^D32	;EDIT NUMBER
 REP 60/3	;16C3
		HRLI A,.TICTI		;FLAG TERMINAL INPUT
		HRRI A,TINCHN		;INTERRUPT CHANNEL
		ATI			;ASSIGN INTERRUPT
		  ERJMP .+1		;IGNORE ERROR
 WIT
	;**;[32] Remove 4 lines at PTYCON+34			GAS	14-Apr-87
 INS 34/4	;16C4
	;**;[32] Add 1 line at COMSTR-1				GAS	14-Apr-87
		SETZM TIWATF		;[32] We need to go back into terminal input
 REP 38/4	;16C5
		MOVEI A,CMDSBK		;GET COMMAND STATE BLOCK
		MOVEI B,[FLDDB. .CMINI]	;GET INITIALIZE FUNC. DESC. BLOCK
 WIT
	;**;[32] Add 8 lines and label COM1 at COMSTR+4		GAS	14-Apr-87
		SKIPN TIWATF		;[32] Do we need to go into ti wait?
		JRST COM1		;[32] Yes, go into terminal input wait
		SETOM WAITF		;[32] Indicate to TYPIN we are waiting
					;[32] Most interrupts will return here
		WAIT%			;[32] No, just wait here
		SETZM WAITF		;[32] No longer waiting
	;[32] Here when ready to read a command from file or terminal.

	COM1:	MOVEI A,CMDSBK		;[32] Get command state block
		MOVEI B,[FLDDB. .CMINI]	;GET INITIALIZE FUNC. DESC. BLOCK
	;**;[32] Add 1 line at COM1+2				GAS	14-Apr-87
		SETOM TIWATF		;[32] No need to go back into TI wait
 INS 46/4	;16C6

 INS 70/4	;16C7
	;**;[32] Add 1 line at COM2+4				GAS	14-Apr-87
		SETZM TIWATF		;[32] Need to go back into terminal input wait
 INS 82/4	;16C8
 DEL 98/4	;16C9
 INS 44/6	;16C10
 INS 84/6	;16C11
 INS 106/6	;16C12
	;**;[32] Add 4 lines at TYPIN+4				GAS	14-Apr-87
		SKIPN WAITF		;[32] Inside the wait?
		DEBRK			;[32] No, dismiss interrupt
		MOVX A,PC%USR		;[32] We were waiting and "A" is free 
		IORM A,RETSAV		;[32] Return getting out of the WAIT JSYS
 INS 41/7	;16C13
 INS 65/8	;16C14
 REP 36/11	;16C15
		MOVEI A,PTYCON		;START FROM SCRATCH
		MOVEM A,RETSAV		;  AFTER DEBRK
		DEBRK
 WIT
	;**;[32] Replace 1 line with 2 at PANIC-3		GAS	14-Apr-87
		SETZM NOINT		;[32] OK for pty output interrupts now
		MOVEI A,COMLVL		;[32] Return to get another command
		MOVEM A,RETSAV		;  AFTER DEBRK
		DEBRK
 INS 43/12	;16C16
 INS 100/12	;16C17
 INS 6/34	;16C18
	;**;[32] Add 1 line at PTYLOP+2				GAS	14-Apr-87
		SETOM NOINT		;[32] Don't interrupt for pty output check now
 REP 10/40	;16C19
	;TTY INPUT INTERRUPT COMES HERE TO WAKE UP MAIN LEVEL

		SKIPL NOINT		;IS PTY INTERRUPT UNCONDITIONALLY DISALLOWED?
		JRST [ MOVEI A,.FHSLF
		       MOVX B,1B<PTYOCN>
		       IIC		;INITIATE PTY OUTPUT CHECK
		       JRST PTYIN0]	
 WIT
	;**;[32] Remove 7 lines at PTYINT+7			GAS	14-Apr-87
 INS 42/40	;16C20
 REP 18/41	;16C21
	         ENDIF.              
		HRL A,0(P)
 WIT
	         ENDIF.
		HRL A,0(P)
 REP 27/41	;16C22
		MOVE A,TRPCHR
		DTI			;DEACTIVATE INTERRUPT CHARACTER
		MOVEI A,400000		;TURN OFF THE TRAP CHANNEL
		MOVE B,[1B<TRPCHN>+CNTRLC]  ;AND CONTROL-C CHANNEL
 WIT
	;**;[32] Replace 4 lines with 2 at PUSHE+24		GAS	14-Apr-87
		MOVEI A,.FHSLF		;[32] Load this fork's handle
		MOVX B,1B<TRPCHN>+1B<CTLCHN> ;[32] Disable control c and escape char
 INS 52/41	;16C23
 REP 55/41	;16C24
		JRST PTYCON		;RESTART
 WIT
	;**;[32] Replace 1 line with 10 at PUSHE1+3		GAS	14-Apr-87
		MOVEI A,.FHSLF		;[32] Load this fork's handle
		MOVX B,1B<TRPCHN>+1B<CTLCHN> ;[32] Channels to enable
		AIC			;[32] Activate ^C and ^X channels 
		MOVEI A,.PRIIN		;[32] Load code for primary input terminal
		RFMOD			;[32] Get the current mode
		MOVEM B,SAVMOD		;[32] Save it for later restoration
		TRO B,TT%WKF!TT%WKN!TT%WKP!TT%WKA!FLD(.TTATE,TT%DAM)!TT%LIC
		SFMOD			;[32] Set to wake on all, raise lowercase,
		STPAR			;[32]  and translate echo only
		JRST COMLVL		;[32] Get a new command
 INS 8/43	;16C25
	;**;[32] Add 2 lines after MAXPTY==30			GAS	14-Apr-87
	CBUFSZ==400			;[32] Command buffer size
	ABUFSZ==50			;[32] Atom buffer size
 INS 60/43	;16C26
	;**;[32] Add 6 lines after ALC NOINT,1			GAS	14-Apr-87
	ALC WAITF,1			;[32] Set to -1 when in WAIT JSYS
	ALC TIWATF,1			;[32] Set to -1 when no need to go into ti wait
	ALC CMDBUF,CBUFSZ		;[32] Command buffer
	ALC ATMBUF,ABUFSZ		;[32] Atom buffer
	ALC GTJBLK,.GJATR+1		;[32] GTJFN block
	ALC LOGBUF,200			;[32] Log filename kept here
 REP 46/44	;16C27
	LOGBUF:	BLOCK 200		;TEXT BUFFER FOR LOG COMMAND
	GETBUF:	BLOCK 200		;BUFFER FOR GET COMMAND FILENAME


	CBUFSZ==400			;COMMAND BUFFER SIZE
	ABUFSZ==50			;ATOM BUFFER SIZE

	CMDSBK:	CM%RAI+CM%XIF+COM0	;COMMAND STATE BLOCK
		.PRIIN,,.PRIOU		
		-1,,[ASCIZ "PTYCON> "]	
		-1,,CMDBUF		
		-1,,CMDBUF		
 WIT
	;**;[32] Delete 4 lines at ONCHNS+2			GAS	14-Apr-87
	CMDSBK:	CM%RAI+CM%XIF+COM0	;COMMAND STATE BLOCK
		.PRIIN,,.PRIOU		
	;**;[32] Change 3 lines at CMDSBK+2			GAS	14-Apr-87
	PMTPR:	POINT 7,[ASCIZ "PTYCON> "] ;[32] (.CMRTY) Prompt string
		POINT 7,CMDBUF		;[32] (.CMBFP) Pointer to start of buffer
		POINT 7,CMDBUF		;[32] (.CMPTR) Pointer to next input
 REP 80/44	;16C28
	CMDBUF:	BLOCK CBUFSZ		;COMMAND BUFFER
	ATMBUF:	BLOCK ABUFSZ		;ATOM BUFFER
	GTJBLK:	BLOCK 17		;GTJFN BLOCK

	PMTPR:	-1,,[ASCIZ "PTYCON> "]	;POINTER TO PROMPT


 WIT
	;**;[32] Remove 1 line at GTJBLK+1			GAS	14-Apr-87
 SUM 222428