Google
 

Trailing-Edge - PDP-10 Archives - BB-4170G-SM - sources/ttdzdv.mac
There are 21 other files named ttdzdv.mac in the archive. Click here to see a list.
;<3A.MONITOR>TTDZDV.MAC.154, 29-Jun-78 16:56:44, Edit by MCLEAN
;FIX NOT HANGING UP PROBLEM
;<3A.MONITOR>TTDZDV.MAC.153,  8-Jun-78 17:28:37, EDIT BY MURPHY
;TCO #1894
;<3A.MONITOR>TTDZDV.MAC.152,  2-May-78 01:32:34, Edit by MCLEAN
;<3A.MONITOR>TTDZDV.MAC.151, 30-Apr-78 22:23:45, Edit by MCLEAN
;<3A.MONITOR>TTDZDV.MAC.150, 30-Apr-78 17:01:02, Edit by MCLEAN
;<3A.MONITOR>TTDZDV.MAC.149, 30-Apr-78 15:42:35, Edit by MCLEAN
;PUT IN START OF KLINIK STUFF
;<3.SM10-RELEASE-3>TTDZDV.MAC.148,  9-Apr-78 16:36:03, Edit by MCLEAN
;<3.SM10-RELEASE-3>TTDZDV.MAC.147,  5-Apr-78 18:11:25, Edit by MCLEAN
;<3.SM10-RELEASE-3>TTDZDV.MAC.146,  3-Apr-78 19:29:00, Edit by MCLEAN
;FIX SENDALL FOR CTY
;<3.SM10-RELEASE-3>TTDZDV.MAC.145, 24-Mar-78 00:04:41, Edit by MCLEAN
;<3.SM10-RELEASE-3>TTDZDV.MAC.144, 22-Mar-78 20:06:57, Edit by MCLEAN
;<3.SM10-RELEASE-3>TTDZDV.MAC.143, 22-Mar-78 19:35:42, Edit by MCLEAN
;<3.SM10-RELEASE-3>TTDZDV.MAC.142, 22-Mar-78 17:20:24, Edit by MCLEAN
;<3.SM10-RELEASE-3>TTDZDV.MAC.141, 17-Mar-78 12:56:00, Edit by MCLEAN
;<3.SM10-RELEASE-3>TTDZDV.MAC.140, 16-Mar-78 23:07:34, Edit by MCLEAN
;<3.SM10-RELEASE-3>TTDZDV.MAC.139, 16-Mar-78 23:04:53, Edit by MCLEAN
;<3.SM10-RELEASE-3>TTDZDV.MAC.138, 16-Mar-78 22:40:15, Edit by MCLEAN
;<3.SM10-RELEASE-3>TTDZDV.MAC.137, 16-Mar-78 22:38:13, Edit by MCLEAN
;FIXES FOR XON/XOFF AND BADTTY BUGHLT
;<3.SM10-RELEASE-3>TTDZDV.MAC.136,  8-Mar-78 12:31:09, Edit by MCCLURE
;CALL UBGOOD
;<3.SM10-RELEASE-3>TTDZDV.MAC.135,  7-Mar-78 14:15:13, Edit by MCLEAN
;TIGHTEN CODE
;<3.SM10-RELEASE-3>TTDZDV.MAC.134,  7-Mar-78 14:13:13, Edit by MCLEAN
;FIX SOME CALLS TO STADYN FOR -1 RETURN
;<3.SM10-RELEASE-3>TTDZDV.MAC.133, 20-Feb-78 16:03:29, Edit by MCLEAN
;CHECKD FOR VALID COMES BEFORE CHECK FOR OVER RUN
;<3.SM10-RELEASE-3>TTDZDV.MAC.132, 16-Feb-78 17:40:40, Edit by MCLEAN
;FIX CARRIER OFF TO HANGUP WHEN NOT ACTIVE
;<3.SM10-RELEASE-3>TTDZDV.MAC.131, 15-Feb-78 15:27:06, Edit by MCLEAN
;DON'T DISABLE MASTER SCAN EVER!!
;<3.SM10-RELEASE-3>TTDZDV.MAC.130, 13-Feb-78 16:49:53, Edit by MCLEAN
;<3.SM10-RELEASE-3>TTDZDV.MAC.129, 30-Jan-78 16:14:24, Edit by MCLEAN
;ADD DZCLRB BUGHLT
;<3.SM10-RELEASE-3>TTDZDV.MAC.128, 30-Jan-78 13:19:15, Edit by MCLEAN
;FIX BAUD RATE FOR 600 BAUD
;<3.SM10-RELEASE-3>TTDZDV.MAC.127, 26-Jan-78 15:05:56, Edit by MCLEAN
;CONTINUE FIX
;<3.SM10-RELEASE-3>TTDZDV.MAC.126, 25-Jan-78 19:02:00, Edit by MCLEAN
;ADD BUGCHECK FOR INTERRUPT ON INACTIVE TERMINAL
;<3.SM10-RELEASE-3>TTDZDV.MAC.125, 18-Jan-78 12:57:06, Edit by MCLEAN
; INSERT SWAPCD AND RESCD'S WHERE NECESSARY
;<3.SM10-RELEASE-3>TTDZDV.MAC.124, 10-Jan-78 00:51:55, Edit by MCLEAN
;<3.SM10-RELEASE-3>TTDZDV.MAC.123,  7-Dec-77 19:47:35, Edit by MCLEAN
;<3.SM10-RELEASE-3>TTDZDV.MAC.122,  6-Dec-77 01:21:03, Edit by MCLEAN
;<3.SM10-RELEASE-3>TTDZDV.MAC.121, 23-Nov-77 00:07:53, Edit by MCLEAN
;FIX BACKUP FOR SENDALL AT DZSND1:
;<3.SM10-RELEASE-3>TTDZDV.MAC.120, 16-Nov-77 00:20:09, Edit by MCLEAN
;<3.SM10-RELEASE-3>TTDZDV.MAC.119, 12-Nov-77 00:25:39, Edit by MCLEAN
;<3.SM10-RELEASE-3>TTDZDV.MAC.118,  2-Nov-77 00:52:30, Edit by MCLEAN
;FIX TERMINAL SPEED TO ACCOUNT FOR 8080
;<3.SM10-RELEASE-3>TTDZDV.MAC.117, 27-Oct-77 00:51:54, Edit by MCLEAN
;<3.SM10-RELEASE-3>TTDZDV.MAC.116, 27-Oct-77 00:34:00, Edit by MCLEAN
;FIX UNIBUS STATUS FOR PROTOTYPE MACHINE
;<3.SM10-RELEASE-3>TTDZDV.MAC.115, 26-Oct-77 19:31:47, Edit by MCLEAN
;<3.SM10-RELEASE-3>TTDZDV.MAC.114, 26-Oct-77 12:15:44, Edit by MCLEAN
;FIX FOR KLINIK
;<3.SM10-RELEASE-3>TTDZDV.MAC.113, 23-Oct-77 00:26:07, Edit by MCLEAN
;LEAVE ROOM FOR KLINIK
;<3.SM10-RELEASE-3>TTDZDV.MAC.112, 22-Oct-77 23:48:50, Edit by MCLEAN
;MAKE CTY CHANGES TO USE CORRECT CTY
;<3.SM10-RELEASE-3>TTDZDV.MAC.111, 22-Oct-77 18:55:46, Edit by MCLEAN
;REMOVE CONDITIONALS FOR TTYNEW
;<SM10-MONITOR>TTDZDV.MAC.107, 17-Sep-77 19:04:46, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.109, 12-Oct-77 14:18:39, EDIT BY KIRSCHEN
;UPDATE COPYRIGHT FOR RELEASE 3
;<3-MONITOR>TTDZDV.MAC.108, 20-Sep-77 09:04:55, EDIT BY MILLER
;ADD SPECIAL "SUB-CLOCK" FOR DOING PI CHECKS.
;<3-MONITOR>TTDZDV.MAC.107, 19-Sep-77 14:03:32, EDIT BY MILLER
;MAKE RING CHECK AND PI CHECK OCCUR TOGETHER
;<3-MONITOR>TTDZDV.MAC.106, 17-Sep-77 19:04:12, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.105, 15-Sep-77 23:43:34, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.104, 15-Sep-77 17:51:44, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.103, 15-Sep-77 17:03:04, Edit by MCLEAN
;PUT IN SOME FUNNY CODE FOR CTY AS DZ11 (NOTE THIS IS TEMP)
;<3-MONITOR>TTDZDV.MAC.102, 15-Sep-77 11:39:26, EDIT BY MILLER
;CHANGE TTVT12 TO SET PARITY
;<3-MONITOR>TTDZDV.MAC.101, 14-Sep-77 23:02:59, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.100, 14-Sep-77 18:17:16, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.99, 14-Sep-77 16:15:42, EDIT BY MILLER
;CHANGE "CALL DYNSTA" TO "DYNST"
;<3-MONITOR>TTDZDV.MAC.98, 14-Sep-77 14:29:41, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.97, 13-Sep-77 23:52:09, Edit by MCLEAN
;<SM10-MONITOR>TTDZDV.MAC.96, 31-Aug-77 23:46:22, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.95, 31-Aug-77 23:38:46, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.94, 31-Aug-77 21:27:11, Edit by MCLEAN
;ADD SOME KS10 CTY CHANGES
;<3-MONITOR>TTDZDV.MAC.93, 16-Aug-77 01:38:06, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.92, 15-Aug-77 13:05:09, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.91, 13-Aug-77 20:56:34, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.90, 10-Aug-77 23:42:26, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.89,  7-Aug-77 23:07:09, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.88,  7-Aug-77 21:46:20, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.87,  6-Aug-77 02:19:27, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.86,  5-Aug-77 02:01:56, Edit by MCLEAN
;<SM10-MONITOR>TTDZDV.MAC.85,  4-Aug-77 18:52:31, Edit by MCLEAN
;<SM10-MONITOR>TTDZDV.MAC.84,  3-Aug-77 20:44:06, Edit by MCLEAN
;<SM10-MONITOR>TTDZDV.MAC.83,  3-Aug-77 19:40:24, Edit by MCLEAN
;<SM10-MONITOR>TTDZDV.MAC.82, 30-Jul-77 21:58:28, Edit by MCLEAN
;<SM10-MONITOR>TTDZDV.MAC.81, 30-Jul-77 21:48:08, Edit by MCLEAN
;<SM10-MONITOR>TTDZDV.MAC.80, 30-Jul-77 21:36:41, Edit by MCLEAN
;ADD REMOTE TERMINAL SUPPORT
;<3-MONITOR>TTDZDV.MAC.79, 30-Jul-77 01:48:26, EDIT BY CROSSLAND
;REUSE TTVT11 FOR DEASIGNING DYNAMIC DATA
;<3-MONITOR>TTDZDV.MAC.78, 28-Jul-77 03:10:51, Edit by MCLEAN
;MAKE IT WORK FOR MULTIPLE UBA'S
;<3-MONITOR>TTDZDV.MAC.77, 11-Jul-77 21:18:06, Edit by MCLEAN
;CLEAN UP LISTING
;<3-MONITOR>TTDZDV.MAC.76, 24-Jun-77 10:17:47, EDIT BY MILLER
;TCO 1831. GIVE ERROR IF SET LINE SPEED REQUESTS "AUTO"
;<3-MONITOR>TTDZDV.MAC.75, 16-Jun-77 21:07:13, EDIT BY CROSSLAND
;CHANGE TTVT08 TO R SO IT WILL FALL INTO STPAR4 INSTEAD OF CALLING IT
;<3-MONITOR>TTDZDV.MAC.74,  9-Jun-77 04:30:54, EDIT BY CROSSLAND
;CHANGE TTVT12 AND TTVT19 TO FNXCT
;ADD ROUTINE DZHU0 TO SCHEDULE HANGUP.
;<3-MONITOR>TTDZDV.MAC.73,  7-Jun-77 17:18:38, EDIT BY HALL
;TCO 1740 - ADD TTVT38
;<3-MONITOR>TTDZDV.MAC.72,  5-Jun-77 02:19:52, Edit by MCLEAN
;FIX SENDALL TO CORRECTLY CHECK TTSPWD
;<3-MONITOR>TTDZDV.MAC.71, 12-May-77 00:48:34, Edit by MCLEAN
;CHANGE SO DUMMY MODULES NOT NECESSARY
;<3-MONITOR>TTDZDV.MAC.70, 12-May-77 00:11:18, Edit by MCLEAN
;FIX SEND ALL
;<3-MONITOR>TTDZDV.MAC.69,  8-May-77 15:51:31, Edit by MCLEAN
;FIX ^S AND ^Q TO NOW BE IGNORED -- NOT REALLY NECESSARY
;<3-MONITOR>TTDZDV.MAC.68,  8-May-77 15:43:56, Edit by MCLEAN
;FIX SENDALL AND MAKE TEMP TRAP FOR ILLEGAL PI INTERRUPTS
;<3-MONITOR>TTDZDV.MAC.67,  8-May-77 12:58:31, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.66,  7-May-77 23:41:28, Edit by MCLEAN
;REMOVE OLD SEND ALL CODE
;<3-MONITOR>TTDZDV.MAC.65,  6-May-77 12:32:05, EDIT BY HALL
;TCO 1740 - VECTOR CHANGES FOR TTMSG JSYS
;<3-MONITOR>TTDZDV.MAC.64,  4-May-77 22:06:15, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.63,  4-May-77 12:37:05, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.62,  4-May-77 02:46:00, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.61,  4-May-77 01:37:17, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.60,  4-May-77 00:39:02, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.59,  4-May-77 00:37:21, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.58,  3-May-77 23:46:44, EDIT BY CROSSLAND
;<3-MONITOR>TTDZDV.MAC.57,  3-May-77 18:33:52, EDIT BY CROSSLAND
;TCO 1742 MERGE ARPANET SOURCES
;<3-MONITOR>TTDZDV.MAC.56,  3-May-77 16:47:10, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.55,  3-May-77 14:40:33, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.54,  3-May-77 13:48:02, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.53,  3-May-77 01:47:58, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.52,  3-May-77 01:45:17, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.51,  3-May-77 01:41:35, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.50,  2-May-77 21:45:48, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.49,  2-May-77 14:58:52, Edit by MCLEAN
;FIX LOTS OF BUGS
;<3-MONITOR>TTDZDV.MAC.48,  2-May-77 12:41:51, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.47,  2-May-77 01:09:35, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.46,  1-May-77 14:30:52, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.45,  1-May-77 13:34:35, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.44, 30-Apr-77 23:43:54, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.43, 26-Apr-77 02:15:43, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.42, 26-Apr-77 02:05:47, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.41, 26-Apr-77 01:53:22, Edit by MCLEAN
;ADD SENDALL
;<3-MONITOR>TTDZDV.MAC.40, 24-Apr-77 14:00:44, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.39, 23-Apr-77 23:06:16, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.38, 23-Apr-77 21:30:15, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.37, 23-Apr-77 18:41:37, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.36, 23-Apr-77 16:24:14, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.35, 23-Apr-77 12:53:49, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.34, 22-Apr-77 22:18:11, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.33, 22-Apr-77 22:11:48, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.32, 22-Apr-77 16:12:33, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.31, 21-Apr-77 21:29:14, Edit by MCLEAN
;INSERT RESTART CODE
;<3-MONITOR>TTDZDV.MAC.30, 18-Apr-77 02:36:12, Edit by MCLEAN
;ADDITIONS TO STARTUP CODE
;<3-MONITOR>TTDZDV.MAC.29, 16-Apr-77 18:57:13, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.28, 13-Apr-77 01:11:18, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.27, 13-Apr-77 01:06:34, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.26, 13-Apr-77 01:01:52, Edit by MCLEAN
;WORK ON INTERRUPT ROUTINES
;<3-MONITOR>TTDZDV.MAC.25,  9-Apr-77 02:11:16, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.24,  8-Apr-77 01:47:46, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.23,  8-Apr-77 01:41:52, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.22,  8-Apr-77 01:37:46, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.21,  4-Apr-77 00:57:03, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.20, 31-Mar-77 01:29:53, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.19, 30-Mar-77 01:30:55, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.18, 30-Mar-77 01:26:01, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.17, 29-Mar-77 01:37:24, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.16, 29-Mar-77 01:35:36, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.15, 29-Mar-77 01:00:57, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.14, 29-Mar-77 00:57:57, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.13, 28-Mar-77 01:41:40, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.12, 28-Mar-77 01:35:26, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.11, 28-Mar-77 01:28:49, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.10, 28-Mar-77 01:14:43, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.9, 28-Mar-77 01:08:00, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.8, 28-Mar-77 01:04:18, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.7, 28-Mar-77 01:02:50, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.6, 28-Mar-77 00:41:16, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.5, 28-Mar-77 00:37:53, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.4, 27-Mar-77 14:06:56, Edit by MCLEAN
;ADD SUBTTL  AND COMMENTS
;<3-MONITOR>TTDZDV.MAC.3, 24-Mar-77 23:23:31, Edit by MCLEAN
;<3-MONITOR>TTDZDV.MAC.2, 22-Mar-77 01:15:19, Edit by MCLEAN
;ADD PRINTX
;<3-MONITOR>TTSMDV.MAC.3, 22-Mar-77 00:38:21, Edit by MCLEAN
;<1MCLEAN>TTSMDV.MAC.2, 20-Mar-77 23:00:15, Edit by MCLEAN

;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
;  OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
;
;COPYRIGHT (C) 1977 BY DIGITAL EQUIPMENT CORPORATION

	SUBTTL DZ11 DEVICE DEPENDENT CODE FOR SM10


; DZ11 TTY SERVICE MODULE FOR SM10 CONFIGURATIONS

	EXTN <DZCHCT>		;SPECIAL "CLOCK" FOR PI CHECKS

;DEFINITIONS FOR TTDEV FOR DZ TYPE LINES


;DEFINITIONS FOR TT.DZ LINE TYPE
TT%DZI==1B0			;DZ INTERRUPT SERVICE FLAG
MSKSTR TTDZI,TTDEV,TT%DZI

	RESCD

SCDTMZ==^D50			;TIME FOR RING CHECKS
DZTMCK==^D5000/SCDTMZ		;WHEN TO DO PI CHECK
DZCRDL==^D8000			;TIME DELAY FOR CARRIER HANGUP

;VECTOR TABLE FOR DEVICE DEPENDENT ROUTINES

TTDZVT=.
	TTDDLN			;LENGTH OF DYNAMIC DATA FOR THIS TYPE
	-1			;FIRST LINE OF THIS TYPE/-1 NO LINES
	IFIW!DZINIT		;TTVT00 -INITALIZATION
	IFIW!DZRSTR		;RESTART
	IFIW!TTCOB5		;CLEAR OUTPUT BUFFER
	IFIW!DZSSP2		;SET LINE SPEED
	IFIW!TTRSP1		;READ TTY SPEED
	IFIW!DZSNT1		;SET NON-TERM STATUS
	IFIW!DZRNT1		;READ NON-TERM STATUS
	IFIW!TTSTO3		;REMOVE CHAR FROM OUTPUT BUFFER
	IFIW!R			;STPAR JSYS
	IFIW!RSKP		;CHECK PHYSICAL LINE
	IFIW!TTXON2		;TTVT10 -XON
	IFIW!TTYDE0		;DEASIGN DYNAMIC DATA
	TRO 1,200		;SET PARITY
	IFIW!STRTO1		;START OUTPUT LINE
	IFIW!DZSXOF		;XOFF
	IFIW!DZSXON		;XON
	IFIW!DZRING		;EMPTY BUFFER
	IFIW!DZ7CX2		;CARRIER ON
	IFIW!DZCX2		;CARRIER OFF
	IFIW!DZHU0		;HANGUP
	IFIW!R			;TTVT20 -^S
	IFIW!TTC7S1		;NO LOGINS
	IFIW!DZBST		;STORE CHARACTER
	IFIW!DZSND1		;SEND CHARACTER
	IFIW!TTDAL7		;DEALLOCATE LINE
	IFIW!DLSSX2		;BUFFER OVERFLOW
	IFIW!R			;EMPTY BUFFER
	IFIW!DZSNSA		;TTVT27 - ALLOW TTMSG FOR SINGLE LINE
	IFIW!R			;ENABLE/DISABLE DATASETS
	IFIW!DZCH7D		;PIA ETC CHECKS
	IFIW!R			;30  CLEAR INPUT BUFFER
	IFIW!R			;31  DOBE
	IFIW!R			;32  INPUT GA
	IFIW!TTSET1		;33  SET INIT. VALUES FOR A LINE
	IFIW!TTSBE1		;34  SOBE
	IFIW!TTOBE1		;35  WAKEUP IF OUTPUT BUFFER EMPTY
	IFIW!DZSNSN		;TTVT36 - ALLOW TTMSG FOR SINGLE LINE
	IFIW!DZSNDL		;TTVT37 - ALLOW TTMSG FOR ALL LINES
	JFCL			;TTVT38 - ADJUST WAKEUP CLASS

   IFN <.-TTVTMX>-TTDZVT,<PRINTX %% INVALID DEVICE DEPENDTNT TABLE SIZE>
;
; SEND CHARACTER TO LINE
; CURRENTLY ONLY CTY IN SECONDARY PROTOCOL IS IMPLEMENTED


DZSND1:	PUSH P,T2
	DYNST	
	CAME T2,KLILNO		;KLINIK?
	JRST NOTDZK		;NOT KLINIK
	JN KLIOVL,,[	POP P,T2	;BACKUP STILL BUSY
			JRST DZBKUP]
	JN TTXOC,(T2),DZXOC	;XON/OFF REQUESTED?
	STOR T3,KLIOCH		;STORE OUTPUT CHARACTER
	SETONE KLIOVL		;SET VALID
	JRST CTYCOM		;AND DO COMMON STUFF

NOTDZK:CAME T2,CTYLNO
	JRST [	SKIPE DZLNCT	;IF NO DZ LINES MUST RETURN
		SKIPN FEFLG	;SECONDARY PROTOCOL?
		JRST PB2	;NO -- RETURN IT IS NOT LEGAL NOW
		JRST DZPRNC]	;NOT CTY BUT PRIMARY PROTOCOL
	JN CTYOVL,,[	POP P,T2	;RESTORE T2
			JRST DZBKUP] ;AND BACKUP
	JN TTXOC,(T2),DZXOC	;XON/OFF REQUIRED?
	STOR T3,CTYOCH		;SET OUTPUT CHARACTER
	SETONE CTYOVL		;SET VALID CHARACTER AVAILABLE
CTYCOM:	CALL INTETY		;INTERRUPT 8080
	POP P,T2		;RESTORE
	SETONE TTOTP,(T2)	;SET LINE ACTIVE
	RET			;RETURN

DZPRNC:	POP P,T2		;RESTORE REGISTER
	MOVEI T4,0(T3)		;SAVE CHARACTER
	
	CALL GETEXL		;GET EXTERNAL PAGE INFO
	JN TTDZI,(T2),[	SETZRO TTDZI,(T2) ;ZERO INTERRUPT FLAG
			TION T1,DZTCR(T3) ;CHECK FOR NOT ENABLED
			BUG(CHK,DZNENB,<DZSND1 - TRANSMIT NOT ENABLED ON INTERRUPT>)
			PUSH P,T2
			DYNST	;GET STATIC ADDRESS
			JN TTXOC,(T2),DZXOCA ;XON/XOFF REQUIRED
			WRIOB T4,DZTBUF(T3) ;WRITE CHARACTER
			JRST PB2]	; RETURN
	SETONE TTOTP,(T2)	;SET LINE ACTIVE
	BSIOB T1,DZTCR(T3)	;LINE NOT ENABLED DO IT AND WAIT FOR INTERRUPT
DZBKUP:	JN TTSAL,(T2),[	MOVNI T3,1	;BACK UP SENDALL
			LOAD T1,TSALP,(T2)
			ADJBP T3,T1	;BACKUP POINTER
			STOR T3,TSALP,(T2) ;RESTORE COUNTER
			INCR TSALC,(T2)	;UPDATE CHARACTER COUNT
			RET]		;RETURN
	MOVE T3,OBFFR		;RESET ORIG BUFFER POINTER
	MOVEM T3,TTOOUT(T2)	;RESTORE IT
	AOS TTOCT(T2)		;RESET COUNT
	RET



DZXOC:	JN TTFXF,(T2),DZPRXO	;DO XON
DZPRXF:	MOVEI T4,XOFFC		;GET XOFF CHARACTER
	SKIPA			;COMMON
DZPRXO:	MOVEI T4,XONC		;GET CHARACTER
	SETZRO <TTXOC>,(T2)	;CLEAR FLAGS
	CAMN T2,KLILNO		;KLINIK?
	JRST [	STOR T4,KLIOCH	;YES STORE IN KLINIK BUFFER
		SETONE KLIOVL	;SET VALID CHARACTER
		JRST DZPRXA]
	STOR T4,CTYOCH		;STORE CHARACTER IN 8080 BUFFER
	SETONE CTYOVL		;SET VALID CHARACTER
DZPRXA:	CALL INTETY		;INTERRUPT 8080
	POP P,T2		;RESTORE T2
	SETONE TTOTP,(T2)	;SET LINE ACTIVE
	JRST DZBKUP		;AND BACKUP
;
DZXOCA:	JN TTFXO,(T2),DZDZXF	;XOFF?
DZDZXO:	MOVEI T4,XONC		;GET CHARACTER
	SKIPA			;COMMON ENTRY
DZDZXF:	MOVEI T4,XOFFC		;GET XOFF CHARACTER
	SETZRO <TTXOC>,(T2)	;CLEAR FLAGS
	WRIOB T4,DZTBUF(T3)	;WRITE CHARACTER
	POP P,T2		;RESTORE T2
	JRST DZBKUP		;BACKUP
; SET/CLEAR NON-TERMINAL STATUS
	SWAPCD

DZSNT1:	STOR T3,TTNTS,(T2)	;SET/CLEAR FLAG
	RET

; READ NON-TERMINAL STATUS

DZRNT1:	LOAD T3,TTNTS,(T2)	;RETURN STATUS
	RET
	RESCD

DZBST:	LOAD T3,TTFBB,(T2)	;GET COUNT
	AOS T3			;INCREASE COUNT OF CHARACTERS IN TTBBUF
	CAIL T3,MAXABC		;OVER RUN (IGNORE IT TOO MANY)
	RET			;YOU HAVE BEEN WARNED
	STOR T3,TTFBB,(T2)	;STORE COUNT
	CAIL T3,MAXBBC		;CHECK FOR MAX BEFORE SHUT OFF
	CALL SNDXOF		;SEND XOFF
	JRST BIGST1		;STORE CHARACTER


DZSXOF:	MOVEI T4,XOFFC		;GET XOFF CHARACTER
	SETONE <TTXOC,TTFXO>,(T2) ;SET XOFF
	SETZRO TTFXF,(T2)
	JRST DZXCM		;GO TO COMMON STUFF

DZSXON:	MOVEI T4,XONC		;GET XON CHARACTER
	JE TTFXO,(T2),R		;RETURN IF NOTHING TO DO
	SETONE <TTXOC,TTFXF>,(T2)	;SET XON REQUIRED
	SETZRO TTFXO,(T2)	;CLEAR OLD SWITCH
DZXCM:	CHNOFF DLSCHN		;SET CHANNEL OFF
	CAMN T2,KLILNO		;KLINIK?
	JRST [	JN KLIOVL,,DZCXR	;CHECK TO SEE IF READY
		STOR T4,KLIOCH	;STORE CHARACTER
		SETONE KLIOVL	;SET VALID
		JRST DZXCM1]
	CAME T2,CTYLNO		;CTY?
	JRST DZXDZ		;REAL DZ
	JN CTYOVL,,DZCXR	;CHECK TO SEE IF READY FOR A CHARACTER
	STOR T4,CTYOCH		;SET OUTPUT CHARACTER
	SETONE CTYOVL		;SET VALID
DZXCM1:	SETZRO TTXOC,(T2)	;CLEAR BOTH SINCE ALL IS DONE
	CALL INTETY		;INTERRUPT 8080
DZCXR:	CHNON DLSCHN		;TURN CHANNEL BACK ON
	RET			;AND RETURN

DZXDZ:	PUSH P,T2		;SAVE STATIC ADDRESS
	CALL STADYN		;FIND DYNAMIC STORAGE ADDRESS
	JRST DZDZX		;NOT SETUP YET FORGET IT
	JN TTDZI,(T2),DZDZX	;QUIT IF BUSY (IT WILL GET CLEARED)
	CALL GETEXL		;FIND EXTERNAL PAGE ADDRESS
	SETONE TTOTP,(T2)	;SET LINE ACTIVE
	BSIOB T1,DZTCR(T3)	;REQUEST INTERRUPT
DZDZX:	CHNON DLSCHN
	JRST PB2		;AND QUIT
;DZINIT -- ROUTINE TO INITALIZE DZ11
;DZRSTR -- SAME ROUTINE TO RESTART DZ11

DZINIT:	SETZM CTYINT		;SET ALIAS (FOR NOW IT IS 0) FOR CTY
	MOVE T4,SMTEPT+DZUBN	;FIND THE TRAP VECTORS
	ADDI T4,DZ110V/4	;OFFSET TO INTERRUPT VECTORS
	MOVEI T1,DZMAX		;FIND THE MAX DZ11
	MOVE T2,[XPCW DZRDIB]	;SET INTERRUPT BLOCK
	MOVE T3,[XPCW DZXINB]	;OUTPUT INTERRUPT BLOCK
DZIVLP:	MOVEM T2,0(T4)		;MAKE AN ENTRY IN THE INTERRUPT VECTOR BLOCK
	MOVEM T3,1(T4)		;GET OUTPUT INTERRUPT VECTOR
	ADDI T4,2		;POINT TO NEXT INTERRUPT BLOCK
	SOJN T1,DZIVLP		;DO ALL DZ11'S
	MOVE T1,[MSEC1,,DZRDIN]	;SET UP THE INTERRUPT BLOCK
	MOVEM T1,DZRDIB+3	;SET UP VECTOR ADDRESS
	SETZM DZRDIB+2		;SET FLAGS TO 0
	MOVE T1,[MSEC1,,DZTXIN]	;SET UP OUTPUT INTERRUPT BLOCK
	MOVEM T1,DZXINB+3
	SETZM DZXINB+2		;SET FLAGS TO 0
	MOVE T1,CTYINT		;GET CTY LINE NUMBER
	AOS T1			;MAKE KLINIK CTY+1
	MOVEM T1,KLILNO		;SAVE KLINIK LINE NUMBER
	RET

; RESTART CODE ALSO RUN FOR INITILIZATION IT SETS UP THE INTERRUPT ENABLES

DZRSTR:	SAVEP			;SAVE THE P'S
	MOVSI P1,-DZMAX		;MAXIMUNM NUMBER OF DZ11'S TO HANDLE
	MOVE P2,[DZ11BA]	;GET BASE ADDRESS OF DZ11
DZINLP:	MOVE T1,P2		;ADDRESS OF DZ11
	CALL UBGOOD		;DOES IT EXIST ?
	 JRST DZNOUB		;NO
	MOVEI T1,DZCLR		;INIT THE DZ11
	WRIO T1,DZCSR(P2)	;RESET THE DZ
	MOVSI T2,1		;SET UP LOOP COUNT
DZCLRK:	SOJE T2,[BUG(HLT,DZCLRB,<UNABLE TO RESET DZ11>)]
	TIOE T1,DZCSR(P2)	;WAIT FOR FINISH
	JRST DZCLRK
	MOVEI T1,DZRIEN+DZTIEN+DZMSCN ;SET INTERRUPT ENABLES AND SCANNER
	WRIO T1,DZCSR(P2)	;START DZ11
	ADDI P2,DZMNV		;ADD THE VECTOR SIZE
	AOBJN P1,DZINLP		;AND TRY THE NEXT ONE
DZNOUB:	HRRZM P1,DZLNCT		;SAVE NUMBER OF DZ11'S FOUND
	IMULI P1,10		;COUNT OF LINES
	HRRZM P1,DZLNNO
	MOVE T1,TTLINV+TT.DZ	;FIND THE OFFSET AND KEEP IT HANDY
	MOVE T1,TT1LIN(T1)
	ADDI T1,FELNS		;ADD IN PSEUDO LINES
	MOVEM T1,DZLNOF
	RET			;RETURN

; DZHU0 -- ROUTINE TO SCHEDULE A HANGUP

DZHU0:	SETZ T1,		;T1/ INDICATE DO IT IMMEDIATELY
	MOVE T3,[DZHU2]		;T3/ ROUTINE TO HANGUP THE LINE
	CALL TTQAD		;SCHEDULE HANGUP AS SOON AS POSSIBLE
	RET


; DZHU2 -- ROUTINE TO DO A HANGUP

DZHU2:	JE TTFEM,(T2),R		;RETURN IF NO DATASET
	SAVET			;SAVE TEMP'S
	CALL GETEXA		;GET EXTERNAL ADDRESS
	BCIOB T1,DZLPR(T3)	;CLEAR LINE ENABLE
	BCIOB T1,DZDTR(T3)	;CLEAR CARRIER
	RET			;RETURN

;DZ7CX2 -- CARRIER ON


;DZCX2 -- CARRIER OFF

DZ7CX2:	SKIPA T3,[TTCON1]	;CARRIER ON
DZCX2:	MOVE T3,[TTCOF]		;CARRIER OFF
	MOVEI T1,DZCRDL		;8 SEC
	CALL TTQAD
	JRST TTCH7


;DZCH7D -- PIA CHECK TO SEE IF INTERRUPTS ENABLES HAVE BEEN LOST

DZCH7D:	MOVEI T1,SCDTMZ		;TIME FOR NEXT CHECK
	MOVEM T1,TTYTIM		;TELL SCHEDULER
	SOSLE DZCHCT		;TIME FOR PI CHECK?
	JRST DZRING		;NO. DO RING POLL ONLY THEN
	MOVEI T1,DZTMCK		;YES. SET UP NEXT TIME CHECK
	MOVEM T1,DZCHCT		;AND SET UP "CLOCK"
	CHNOFF DLSCHN		;TURN OFF DLS CHANNEL
	MOVE T1,DZLNCT		;GET LINE COUNTS
	JUMPE T1,DZCH7E		;IF NO DZ'S THEN NO CHECK
	MOVE T2,[DZ11BA]	;GET BASE ADDRESS
	MOVEI T3,DZRIEN!DZTIEN!DZMSCN
DZCH7L:	TION T3,DZCSR(T2)	;CHECK FOR ENABLES
	JRST [	BUG(CHK,DZLINT,<DZ11 LOST INTERRUPT ENABLE>,<T2>)
		MOVEI T4,377	;SET ALL LINES TO INTERRUPT ASSUMING LOST ONE
		WRIOB T4,DZTCR(T2)
		BSIO T3,DZCSR(T2) ;SET INTERRUPT ENABLES AGAIN
		JRST .+1]
	ADDI T2,DZMNV		;LOOK AT NEXT DEVICE
	SOJN T1,DZCH7L		;TRY NEXT ONE
DZCH7E:	CHNON DLSCHN		;TURN ON CHANNEL

;NOW CHECK FOR RING ON ANY OF THE LINES

DZRING:	MOVE T2,TTLINV+TT.DZ	;GET VECTOR FOR THIS LINE TYPE
	SKIPE DZLNCT		;IF NO DZ LINES FORGET IT
	SKIPGE T2,TT1LIN(T2)	;GET FIRST LINE NUMBER
	RET			;NONE THERE
	MOVN T4,DZLNNO		;FIND COUNT OF LINES
	HRL T2,T4		;GET - NUMBER OF LINES
	ADDI T2,FELNS		;UPDATE FOR CTY AND KLINIK
DZRNG0:	JE TTFEM,(T2),DZRNG7	;NOT A REMOTE LINE - NO PROCESSING NECESSARY
	PUSH P,T2		;SAVE ARGS
	CALL GETEXA		;GET EXTERNAL PAGE ADDRESS
	TIONB T1,DZRNG(T3)	;CHECK FOR RING
	JRST NORNG		;NOT RING
	JN TTCON,(T2),[	SETZRO TTCON,(T2) ;HANG UP IMMEDIATELY
			MOVE T3,[NTYCOF] ;HANGUP ROUTINE
			SETZ T1,0	;DO ASAP
			CALL TTQAD
			JRST DZRRTN] ;IMPLIES NEW CALL
	JN TROUT,(T2),DZRRTN	;IGNORE RING IF LINE HAS ROUTINE QUEUE'D (JOB DETACH)
	BSIOB T1,DZDTR(T3)	;SET CARRIER ON
	JRST DZRSCO		;INDICATE CARRIER SET ON

DZRRTN:	POP P,T2
DZRNG7:	AOBJN T2,DZRNG0		;DO THEM ALL
	RET			;AND DONE

NORNG:	TIONB T1,DZCAR(T3)	;CHECK FOR CARRIER ON
	JRST CARNON		;CARRIER NOT ON
	JN TTCON,(T2),DZRRTN	;CARRIER  EXPECTED TO BE ON
DZRSCO:	SETONE TTCON,(T2)
	MOVE T3,[TTCON1]	;SET CARRIER ON
	MOVEI T1,DZCRDL		;8 SEC
	CALL TTQAD		;SCHEDULE IT
	JRST DZRRTN		;AND QUIT

CARNON:	JE TTCON,(T2),DZRRTN	;CARRIER NOT EXPECTED TO BE ON
	CALL STADYN		;ACTIVE?
	JRST DZCAR1		;NOT ACTIVE AND QUIT BETTER KILL IT
	JE TTPRM,(T2),DZRRTN	;NOT PERM --WAIT
DZCAR1:	HRRZ 2,0(P)		;GET UNIT NUMBER BACK
	SETZRO TTCON,(T2)
	MOVE T3,[TTCOF]		;SET CARRIER OFF FLAG
	MOVEI T1,DZCRDL		;8 SEC
	CALL TTQAD		;SCHEDULE IT
	JRST DZRRTN		;AND QUIT
;READ INTERRUPT ROUTINE

DZRDIN: MOVEM P,DZSAVP		;SAVE A REGISTER
	MOVEI P,DZSVAC		;POINT TO AC SAVE AREA
	BLT P,DZSVAC+16		;SAVE AC'S
	MOVE P,DZPDL		;SET UP STACK
	MOVE Q1,DZLNCT		;FIND THE NUMBER OF LINES
	MOVE Q2,[DZ11BA]	;FIND FIRST EXTERNAL PAGE ADDRESS
	SKIPE FEFLG		;CHECK FOR PRIMARY PROTOCOL
	JRST DZINPP		;YES -- GO DUMP ALL DZ'S
DZCTRD:	RDIO T1,DZRBUF(Q2)	;READ A CHARACTER
	TRNE T1,DZRDVL		;VALID?
	JRST DZCTRD		;LOOP AND TRY FOR ANOTHER
DZNXCL:	SOJE Q1,DZRXIT		;CHECK TO SEE IF ALL DZS DONE
	ADDI Q2,DZMNV		;LOOK AT NEXT DZ TO DUMP ALL CHARACTERS
	MOVEI T1,DZRDVL		;IN THE BUFFERS TO STOP THEIR INTERRUPTING
	TIOE T1,DZRBUF(Q2)	;THIS WILL READ A CHARACTER AND DUMP IT
	JRST .-1		;THIS WILL CAUSE ALL CHARACTERS TO BE DUMPED
	JRST DZNXCL		;GO DO NEXT DZ

DZINPP:	MOVE P1,DZLNOF		;SET UP LINE NUMBER (MUST START AT 1
DZINPL:	RDIO T1,DZRBUF(Q2)	;GET A CHARACTER
	TRNN T1,DZRDVL		;VALID?
	JRST DZNXLN		;NO -- GO TO NEXT LINE
	TRNE T1,DZROVR		;OVER RUN
	BUG(CHK,DZOVER,<DZ11 SILO OVERRUN>,T1)
	LOAD T2,DZTXLN,T1	;GET THE LINE NUMBER
	ADD T2,P1		;FIND ITS INTERNAL LINE NUMBER
	ANDI T1,377		;MASK TO CHARACTER ONLY
	CALL TTIDON		;GO PUT IN BUFFER
	JRST DZINPL		;GET ANOTHER CHARACTER

DZNXLN:	ADDI P1,10		;8 LINES PER DZ
	ADDI Q2,DZMNV		;LOOK AT NEXT DZ
	SOJN Q1,DZINPL		;CHECK TO SEE IF COUNT DONE
	JRST DZRXIT		;GO TO READ EXIT (DONE)


DZRXIT:	MOVSI P,DZSVAC		;RESTORE ACS
	BLT P,CX		;RESTORE
	MOVE P,DZSAVP		;RESTORE P
	XJEN DZRDIB		;RETURN
;INTERRUPT ROUTINE FOR THE CTY FOR THE KS10

DZCTIN::CLSB DLSCHN		;CLEAR CHANNEL INTERRUPT REQUEST
	MOVEM P,DZSAVP		;SAVE STACK REGISTER
	MOVEI P,DZSVAC		;POINT TO SC SAVE AREA
	BLT P,DZSVAC+16		;SAVE ACS
	MOVE P,DZPDL		;SET UP STACK
	JE KLIIVL,,DZNOKL	;CHECK FOR KLINIK INPUT
	LOAD T1,KLIICH		;GET THE CHARACTER
	MOVE T2,KLILNO		;GET LINE NUMBER
	SETZRO KLIIVL		;CLEAR VALID BIT
	CALL TTIDON		;OUTPUT CHARACTER
	CALL INTETY		;INTERRUPT EIGHTY EIGHTY
DZNOKL:	JN KLIOVL,,DZNXT	;OUTPUT VALID?
	MOVE T2,KLILNO		;YES GET LINE NUMBER
	CALL STADYN		;GET DYN ADDR
	JUMPLE T2,DZNXT		;TRY NEXT
	CALL TTSND		;DONE DO NEXT CHARCTER
DZNXT:	JE CTYIVL,,DZNOCT	;CHECK FOR CTY INPUT
	LOAD T1,CTYICH		;PICK UP THE CHACTER
	MOVE T2,CTYLNO		;GET THE CTY LINE NUMBER
	SETZRO CTYIVL		;CLEAR  CHARACTER IN BUFFER FLAG
	CALL TTIDON		;OUTPUT CHARACTER
	CALL INTETY		;INTERRUPT EIGHTY EIGHTY
DZNOCT:	JN CTYOVL,,DZNXIT	;NO CTY
	MOVE T2,CTYLNO		;GET LINE NUMBER
	CALL STADYN		;CONVERT TO DYNAMIC STORAGE
	JUMPLE T2,DZNXIT	;QUIT IF NO DYNAMIC STORAGE
	CALL TTSND		;DO DONE STUFF
DZNXIT:	MOVSI P,DZSVAC		;RESTORE
	BLT P,CX
	MOVE P,DZSAVP
	RET			;RETURN
DZPDL:	IOWD 40,DZISTK		;I/O STACK SIZE
RS (DZISTK,40)			;STACK FOR INTERRUPT SERVICE
RS (DZRDIB,4)			;INPUT INTERRUPT BLOCK
RS (DZXINB,4)			;INTERRUPT BLOCK FOR OUTPUT
RS (DZSVAC,17)			;SAVE AC FOR READ INTERRUPT
RS (DZSAVP,1)			;SAVE AC 17
RS (DZLNCT,1)			;COUNT OF DZ'S FOUND
RS (DZLNNO,1)			;COUNT OF LINES FOUND
RS (DZLNOF,1)			;OFFSET TO FIRST LINE NUMBER

DZTXIN::MOVEM P,DZSAVP		;SAVE A REGISTER
	DMOVEM T1,DZSVAC+T1
	DMOVEM T3,DZSVAC+T3
	DMOVEM Q1,DZSVAC+Q1
	DMOVEM P6,DZSVAC+P6
	MOVE P,DZPDL		;SET UP STACK SIZE
	MOVE P6,DZLNOF		;SET UP LINE COUNT
	MOVE Q2,[DZ11BA]	;BASE ADDRESS
	MOVE Q1,DZLNCT		;NUMBER OF DZ11'S
DZTNXO:	RDIO T2,DZCSR(Q2)	;READ THE STATUS
	TRNN T2,DZTRDY		;CHECK FOR TRANSMIT DONN
	JRST DZNXMT		;NOT THIS DZ TRY NEXT ONE
	LDB T2,[POINT 3,T2,27]	;PICK UP LINE NUMBER
	ADD T2,P6		;MAKE ABSOLUTE NUMBER
	CALL STADYN		;GET DYNAMIC STORAGE
	JUMPLE T2,DZNXMT	;IF NO BLOCK THIS IS AN EXTRNAEOUS INTERRUPT
	SETONE TTDZI,(T2)	;SET INTERRUPT FLAG
	PUSH P,T2		;SAVE DYN STORAGE ADDRESS
	CALL TTSND		;DO TTY DONE (ASSUME THIS MUST BE CTY FOR NOW)
	POP P,T2		;GET DYN STORAGE ADDRESS
	SETZRO TTDZI,(T2)
	JN TTOTP,(T2),DZNXMT 	;DONE?
	CALL GETEXL 		;YES --GET EXTERNAL LINE ADDRESS
	BCIOB T1,DZTCR(T3)  	;CLEAR THE ACTIVE BITS
				;THIS WILL STOP INTERRUPTING DZ AND END OUTPUT

DZNXMT:	ADDI P6,DZMNV		;LOOK AT NEXT GROUP
	ADDI Q2,10		;NEXT DZ
	SOJG Q1,DZTNXO		;TRY NEXT
DZTXIT:	DMOVE T1,DZSVAC+T1
	DMOVE T3,DZSVAC+T3
	DMOVE Q1,DZSVAC+Q1
	DMOVE P6,DZSVAC+P6
	MOVE P,DZSAVP		;RESTORE AC
	XJEN DZXINB		;AND RETURN
; SENDALL
	SWAPCD

DZSNDL:	CAME T2,KLILNO
	CAMN T2,CTYINT		;CHECK FOR REAL CTY
	RET			;CAN'T DO THIS LINE
	PUSH P,T2
	SUB T2,DZLNOF		;FIND IF LINE A LEGAL DZ LINE
	CAML T2,DZLNNO		;LGAL? (DZ'S +CTY)
	JRST [	ADD T2,DZLNOF	;PUT LINE NUMBER BACK
		CAME T2,KLILNO	;CHECK FOR KLINIK
		CAMN T2,CTYLNO	;CHECK FOR CTY
		JRST .+1	;YUP ALL OK TO DO SENDALL
		JRST PB2]	;NOPE QUIT
DZCTOK:	POP P,T2		;RESTORE LINE NUMBER
	SKIPE FEFLG		;SECONDARY PROTOCOL?
	RETSKP			;YES RETURN OK
	SETO T2,0		;NO SKIP GROUP
	RETSKP


; SENDALL TO SPECIFIC LINE


;
DZSNSA:
DZSNSN:	CAME T2,KLILNO		;NOT KLINIK YET
	CAMN T2,CTYINT		;CHECK FOR CTY
	RET			;YES NOT THIS ONE
	SKIPL TTSPWD(T2)	;IF NO SPEED SET CAN'T DO SEND ALL
	SKIPN FEFLG		;CHECK FOR PRIMARY PROTOCOL
	RET			;NO SEND ALL LEGAL HERE
	PUSH P,T2		;SAVE REGISTER
	SUB T2,DZLNOF		;FIND BEGINNING OF LINES
	CAML T2,DZLNNO		;LGAL? (DZ'S + CTY)
	JRST [	ADD T2,DZLNOF	;PUT LINE NUMBER BACK
		CAME T2,KLILNO	;CHECK FOR KLINIK
		CAMN T2,CTYLNO	;CHECK FOR CTY
		JRST .+1	;YUP DO SENDALL
		JRST PB2]	;NO ON SENDALL
	POP P,T2		;YES
	RETSKP			;RETURN SEND ALL LEGAL

	RESCD
;
	SWAPCD
; SET SPEED FOR A DZ11 LINE
;

DZSSP2:	UMOVE T4,2		;GET FLAGS
	TXNE T4,MO%AUT		;REQUESTING AUTO?
	RETBAD			;YES. CAN'T HAVE IT ON THIS DEVICE
	SKIPN DZLNCT		;IF NO DZ LINES CAN'T SET SPEED
	RET
	UMOVE T4,T3		;GET THE SPEED
	HLRZ T1,T4		;CHECK TO SEE BOTH HALF THE SAME
	CAME T2,KLILNO		;NOT KLINIK LINE NUMBER EITHER
	CAMN T2,CTYINT		;CHECK FOR CTY
	RET			;NOT LEGAL ON THIS MACHINE
	CAME T2,CTYLNO		;CHECK TO SEE IF CTY <CAN'T SET THAT ONE)
	CAIE T1,0(T4)		;IF NOT SAME THEN FORGET IT HARDWARE
	RET			;SUPPORTS INPUT/OUTPUT SAME
	NOINT			;SET NOINT
	CHNOFF DLSCHN		;TURN OFF CHANNEL WHILE PLAYING WITH LINE SPEEDS
	JN TTFEM,(T2),DZSSP1	;IF REMOTE DON'T SET PERM SPEED
	XCTU [SKIPGE 2]		;REMOTE REQUESTED?
	JRST [	MOVX T3,SC%OPR!SC%WHL	;CHECK CAPBILITIES
		TDNN T3,CAPENB
		JRST DZSSP1		;NO CAPABILITIES FORGET IT
		SETONE TTFEM,(T2)	;SET ONCE ONLY FLAG
		JRST .+1]
	MOVEM T4,TTSPWD(T2)	;SAVE TTY SPEED
DZSSP1:	HRRZS T4		;SET SPEED IN RIGHT HALF ONLY
	MOVEI T1,DZSPTB		;FIND POINTER TO TABLE POINTER
DZSPLP:	MOVE T3,0(T1)		;GET A TABLE ENTRY
	JUMPE T3,NOLNSP		;NO LINE SPEED FOUND
	CAIE T4,0(T3)		;CORRECT ENTRY?
	AOJA T1,DZSPLP		;NO -- TRY NEXT ONE
	HLRZ T4,T3		;GET LINE SPEED
	MOVE T3,T2		;GET LINE NUMBER
	SUB T3,DZLNOF		;SUBTRACT FRONT-END LINES
	CAML T3,DZLNNO		;CHECK TO SEE IF LEGAL LINE NUMBER
	JRST NOLNSP		;NOPE -- QUIT WHILE AHEAD
	ANDI T3,7		;MASK TO 3 BITS
	IOR T4,T3		;SET UNIT NUMBER
	CALL GETEXA		;GET THE EXTERNAL PAGE ADDRESS OF THIS DZ
	WRIO T4,DZLPR(T3)	;SET THE LINE PARAMETER REGISTER
NOLNSP:	CHNON DLSCHN		;ENABLE CHANNEL
	OKINT			;ENABLE INTERRUPTS
	RET			;RETURN

DZSPTB:	DZ1RXO+DZ1OPA+DZ8BIT+DZ1STP+0,,^D50
	DZ1RXO+DZ1OPA+DZ8BIT+DZ1STP+400,,^D75
	DZ1RXO+DZ1OPA+DZ8BIT+DZ1STP+1000,,^D110
	DZ1RXO+DZ1OPA+DZ8BIT+DZ2STP+1400,,^D134
	DZ1RXO+DZ1OPA+DZ8BIT+DZ2STP+2000,,^D150
	DZ1RXO+DZ1OPA+DZ8BIT+DZ2STP+2400,,^D300
	DZ1RXO+DZ1OPA+DZ8BIT+DZ2STP+3000,,^D600
	DZ1RXO+DZ1OPA+DZ8BIT+DZ2STP+3400,,^D1200
	DZ1RXO+DZ1OPA+DZ8BIT+DZ2STP+4000,,^D1800
	DZ1RXO+DZ1OPA+DZ8BIT+DZ2STP+4400,,^D2000
	DZ1RXO+DZ1OPA+DZ8BIT+DZ2STP+5000,,^D2400
	DZ1RXO+DZ1OPA+DZ8BIT+DZ2STP+5400,,^D3600
	DZ1RXO+DZ1OPA+DZ8BIT+DZ2STP+6000,,^D4800
	DZ1RXO+DZ1OPA+DZ8BIT+DZ2STP+6400,,^D7200
	DZ1RXO+DZ1OPA+DZ8BIT+DZ2STP+7000,,^D9600
	0,,0			;END OF TABLE
	RESCD
;GETEXA -- SUBROUTINE TO FIND THE EXTERNAL PAGE ADDRESS OF 
; THE SPECIFIED DZ11

; CALLING SEQUENCE:
; T2 -- LINE NUMBER
;
;	CALL GETLIN
; T1 -- LINE BIT POSITION (LINE 0=1B35 ETC)
; T3 -- EXTERNAL PAGE ADDRESS OF FIRST REGISTER FOR THIS DZ11
; RETURNS +1 ALWAYS

GETEXA:	PUSH P,T2		;SAVE LINE NUMBER
GETEX1:	SUB T2,DZLNOF		;BACKUP TO POINT TO REAL  NUMBER
	MOVE 3,2		;GET LINE NUMBER
	ANDI T3,777770		;MASK OF LOW ORDER 3 BITS (8 PER DZ)
	ADD T3,[DZ11BA]		;ADD DZ11 BASE ADDRESS
	MOVE T1,T2
	ANDI T1,7		;MASK OFF UNIT
	MOVNS T1
	MOVE T1,BITS+^D35(T1)
	POP P,T2		;RESTORE
	RET

;
;  GETEXL -- SUBROUTINE TO FIND EXTERNAL PAGE AND LINE NUMBER
;
;	CALLING SEQUENCE:
;	B -- DYNAMIC STORAGE ADDRESS
;	CALL GETEXL
;	RETURNS:
;	A -- LINE BIT POSITION (LINE 0=1B35 1,1B34 ETC)
;	C -- EXTERNAL PAGE ADDRESS OF THIS DZ11
;

GETEXL:	PUSH P,T2		;SAVE DYNAMIC ADDRESS
	DYNST			;GET LINE NUMBER
	CALLRET GETEX1		;GET EXTERNAL PAGE ADDRESS