Google
 

Trailing-Edge - PDP-10 Archives - AP-D543V_SB - dlsint.mac
There are 9 other files named dlsint.mac in the archive. Click here to see a list.
	SEARCH	F,S
	$RELOC
	$HIGH

;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
;  OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
;
;COPYRIGHT (C) 1973,1974,1975,1976,1977,1978 BY DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
DEFINE	ISRNAM(N),<

TITLE	DL'N'INT	-- INTERRUPT SERVICE FOR DC10 - NUMBER N - V534
SUBTTL	/RCC/DAL -11 NOV 75
XP	VDL'N'IT,534

IFG N-1,<	PRINTX	?ONLY 2 DC10S ON ANY DECSYSTEM-10>

	ENTRY	DL'N'INT	;FOR LINK-10
DL'N'INT::CONSO	DLS,30
	JRST	.-1
	JRST	DLSINT


DSCOFS==DSCOF'N##		;OFFSET INTO DSCTAB
DL'N'DSP::JRST	SCNTYP		;DATA OUT
IFN FTMODM,<
	JRST	DSCTYP		;DATA SET CONTROL
>
IFE FTMODM,<
	POPJ	P,0
>
	JRST	SCNCHK		;PI TEST
	JRST	DLSINI		;INIT
IFN FTD10H <
	JRST	DLSCHP		;CHANGE HARDWARE PARAMETERS
	JRST	DLSLPC		;SEND LINE PARAMETER CONTOL MSG
	JRST	DLSELE		;SET ELEMENT #
>;END OF IFN FTD10H
IFE FTD10H,<
	POPJ	P,		;CHANGE HARDWARE PARMS
	POPJ	P,		;LINE PARM CTL
	POPJ	P,		;SET ELEMENT
>;END IFE FTD10H
	POPJ	P,		;REMOTE STATION STUFF
	JRST	DLSOFL		;OFF LINE TEST
DLSMXD==DL'N'MXD##		;MAX LINE NUMBER
DLSMXL==DL'N'MXL##		;MAXIMUM DATASET NUMBER
DLSOFS==DL'N'OFS##		;OFFSET FROM HARDWARE TO LINTAB

IFE	N,<
	DLS==240		;HARDWARE ADDRESS
>

IFE	<N-1>,<
	DLS==244
>>

IFNDEF	DLSNUM,<DLSNUM==0>
	ISRNAM(\DLSNUM)

;BITS IN T3 TO COMMUNICATE WITH THE HARDWARE (CONSIDERING 680 AS HARDWARE)

USDRLN==100				;USE DIRECTED LINE NUMBER
TDSABL==400				;TRANSMIT DISABLE
RCVBIT==400				;DATAI FROM DLS OR 680 WAS RECEIVE
					;INT, NOT XMT DONE
DLSOHE==100				;OFF-HOOK ENABLE TO DC10E
DLSART==200				;REQUEST ARTIFICIAL INTERRUPT FROM DC10E
DLSCAR==4				;CARRIER IS ON, IN DC10E DATAI
DLSRNG==2				;LINE RINGING, IN DC10E DATAI
DLSCRQ==40				;CALL REQUEST, DATAO
DLSDPR==20				;DIGIT PRESENT, DATAO
DLSPND==20				;PRESENT NEXT DIGIT, DATAI
IFN FTD10H,<
;TRANSLATION TABLES
; BIT 100 IS UPSHIFT
; BITS 77 ARE CHARACTER
BCDEOA==64	;START OF MESSAGE
BCDEOT==174	;END OF MESSAGE
BCDUCS==034	;UPPERCASE SHIFT
BCDLCS==037	;LOWERCASE SHIFT


BCDETS:	BYTE	(9)400+BCDLCS,400+BCDEOT,0
BCDEAS:	BYTE	(9)400+BCDEOA,400+BCDLCS,0
;THE FOLLOWING DEFINES SOME BCD CODES
; OTHERS COULD BE SUBSTITUTED
;
; COLUMN 1 IS ASCII EQUIVALENT
; COLUMN 2 IS APL(CORRESPONDENCE)
; COLUMN 3 IS CORRESPONDENCE
; COLUMN 4 IS CALL 360 BASIC
; COLUMN 5 IS EBCD
; COLUMN 6 IS APL(EBCD)
; COLUMN 7 IS BCD
; COLUMN 8 IS RESERVED FOR CUSTOMER DEFINITION

DEFINE BCDELM,<
	X	^D0,^D987,^D029,^D087,^D963,^D988,^D938,^D000
>
DEFINE BCDXOU <	XLIST
X 000,075,075,075,075,075,075,075	;NULL OR BREAK
X 001,075,075,075,075,075,075,075	; ^A
X 002,064,064,064,064,064,064,064	;EOA START OF TEXT
X 003,075,075,075,075,075,075,075	; ^C
X 004,074,074,074,074,074,074,074	;EOT
X 005,075,075,075,075,075,075,075	; ^E
X 006,075,075,075,075,075,075,075	; ^F
X 007,075,075,075,075,075,075,075	; ^G
X 010,035,035,035,035,035,035,035	; ^H BACKSPACE
X 011,057,057,057,057,057,057,057	; TAB
X 012,056,056,056,056,056,056,056	;LF - INDEX
X 013,075,075,075,075,075,075,075	; ^K
X 014,075,075,075,075,075,075,075	; ^L
X 015,055,055,055,055,055,055,055	;CR
X 016,075,075,075,075,075,075,075	; ^N
X 017,075,075,075,075,075,075,075	; ^O
X 020,075,075,075,075,075,075,075	; ^P
X 021,075,075,075,075,075,075,075	; ^Q
X 022,075,075,075,075,075,075,075	; ^R
X 023,075,075,075,075,075,075,075	; ^S
X 024,075,075,075,075,075,075,075	; ^T
X 025,075,075,075,075,075,075,075	; ^U
X 026,075,075,075,075,075,075,075	; ^V
X 027,075,075,075,075,075,075,075	; ^W
X 030,075,075,075,075,075,075,075	; ^X
X 031,075,075,075,075,075,075,075	; ^Y
X 032,075,075,075,075,075,075,075	; ^Z
X 033,075,075,075,075,075,075,121	;ALTMODE
X 034,075,075,075,075,075,075,075	; ^\
X 035,075,075,075,075,075,075,075	;^]
X 036,075,075,075,075,075,075,075	; ^^
X 037,075,075,075,075,075,075,075	;^_
X 040,000,000,000,000,000,000,000	;SPACE
X 041,141,001,142,165,111,165,153	;"!" (APL-BALL SHIFT M)
X 042,140,111,120,164,140,170,111	; DOUBLE QUOTE
X 043,130,160,145,064,130,102,011	;"#"
X 044,170,104,152,065,104,065,053	;"$"
X 045,123,110,124,150,103,110,110	;"%"
X 046,101,150,144,003,102,164,023	;"&"
X 047,132,011,140,130,121,002,130	;APOSTROPHE(APL-BALL SHIFT K)
X 050,153,164,053,144,165,150,164	;"("
X 051,111,144,011,124,164,120,144	;")"
X 052,113,170,023,104,171,104,170	;"*" (APL-BALL SHIFT P)
X 053,067,123,067,103,001,003,123	;"+"
X 054,073,073,073,066,066,066,073	;","
X 055,167,067,167,001,101,001,067	;"-"
X 056,021,021,021,067,067,067,021	;"."
X 057,007,007,123,042,042,042,007	;"/"
X 060,044,044,044,024,024,024,044	;"0"
X 061,040,040,040,040,040,040,040	;"1"
X 062,020,020,020,020,020,020,020	;"2"
X 063,060,060,060,060,060,060,060	;"3"
X 064,004,004,004,010,010,010,004	;"4"
X 065,010,010,010,050,050,050,010	;"5"
X 066,030,030,030,030,030,030,030	;"6"
X 067,050,050,050,070,070,070,050	;"7"
X 070,070,070,070,004,004,004,070	;"8"
X 071,064,064,064,044,044,044,064	;"9"
X 072,121,153,121,110,167,130,104	;":"
X 073,173,053,173,160,166,160,160	;";"
X 074,160,130,160,120,160,103,120	; LEFT ANGLE BRACKET
X 075,110,023,001,140,150,064,140	;"="
X 076,150,101,150,170,170,140,150	; RIGHT ANGLE BRACKET
X 077,133,107,161,142,105,142,107	;"?"(APL-BALL SHIFT Q)
X 100,171,120,171,002,143,043,001	;"@"(APL-BALL IS ALPHA)
X 101,071,171,071,143,043,143,171	;"A"
X 102,066,166,066,123,023,123,166	;"B"
X 103,072,172,072,163,063,163,172	;"C"
X 104,052,152,052,113,013,113,152	;"D"
X 105,012,112,012,153,053,153,112	;"E"
X 106,063,163,063,133,033,133,163	;"F"
X 107,043,143,043,173,073,173,143	;"G"
X 110,046,146,046,107,007,107,146	;"H"
X 111,031,131,031,147,047,147,131	;"I"
X 112,003,103,003,141,041,141,103	;"J"
X 113,032,132,032,121,021,121,132	;"K"
X 114,006,106,006,161,061,161,106	;"L"
X 115,041,141,041,111,011,111,141	;"M"
X 116,022,122,022,151,051,151,122	;"N"
X 117,005,105,005,131,031,131,105	;"O"
X 120,013,113,013,171,071,171,113	;"P"
X 121,033,133,033,105,005,105,133	;"Q"
X 122,051,151,051,145,045,145,151	;"R"
X 123,045,145,045,122,022,122,145	;"S"
X 124,002,102,002,162,062,162,102	;"T"
X 125,062,162,062,112,012,112,162	;"U"
X 126,061,161,061,152,052,152,161	;"V"
X 127,065,165,065,132,032,132,165	;"W"
X 130,042,142,042,172,072,172,142	;"X"
X 131,047,147,047,106,006,106,147	;"Y"
X 132,024,124,024,146,046,146,124	;"Z"
X 133,053,130,104,102,065,144,130	;"["
X 134,107,007,164,166,142,101,007	;"\"
X 135,011,101,130,167,064,124,101	;"]"
X 136,147,140,113,166,106,165,173	;"^"(APL-BALL SHIFT Y)
X 137,001,167,163,101,002,164,167	;"_"
X 140,025,011,103,130,141,002,101	; ACCENT GRAVE
X 141,101,071,071,043,102,043,071	;LC "A"(APL-BALL IS RT ARROW)
X 142,166,066,066,023,123,023,066	;LC "B"
X 143,172,072,072,063,163,063,072	;LC "C"
X 144,152,052,052,013,113,013,052	;LC "D"
X 145,112,012,012,053,153,053,012	;LC "E"
X 146,163,063,063,033,133,033,063	;LC "F"
X 147,143,043,043,073,173,073,043	;LC "G"
X 150,146,046,046,007,107,007,046	;LC "H"
X 151,131,031,031,047,147,047,031	;LC "I"
X 152,103,003,003,041,141,041,003	;LC "J"
X 153,104,032,032,021,110,021,032	;LC "K"(APL-BALL SHIFT 4)
X 154,106,006,006,061,161,061,006	;LC "L"
X 155,120,041,041,011,120,011,041	;LC "M"(APL-BALL SHIFT 2)
X 156,122,022,022,051,151,051,022	;LC "N"
X 157,105,005,005,031,131,031,005	;LC "O"
X 160,023,013,013,071,003,071,013	;LC "P"(APL-BALL MULTIPLY SIGN
X 161,164,033,033,005,144,005,033	;LC "Q"(APL BALL SHIFT 9)
X 162,151,051,051,045,145,045,051	;LC "R"
X 163,145,045,045,022,122,022,045	;LC "S"
X 164,102,002,002,062,162,062,002	;LC "T"
X 165,162,062,062,012,112,012,062	;LC "U"
X 166,161,061,061,052,152,052,061	;LC "V"
X 167,165,065,065,032,132,032,065	;LC "W"
X 170,142,042,042,072,172,072,042	;LC "X"
X 171,144,047,047,006,124,006,047	;LC "Y"(APL-BALL IS TEEPEE)
X 172,124,024,024,046,146,046,024	;LC "Z"
X 173,075,075,075,075,075,075,075	;173
X 174,075,075,075,075,075,075,075	;174
X 175,075,075,075,075,075,075,075	;175 = ALTMODE
X 176,075,075,075,075,075,075,075	;176 = ALTMODE
X 177,075,075,075,075,075,075,035	;RUBOUT - BECOMES IDLE
LIST	>	;END OF BCDXOU
;THE FOLLOWING DEFINES THE TRANSLATION OF CHARACTERS ON INPUT FROM A BCD LINE
;

IFNDEF STDALT,<XP STDALT,033>
DEFINE BCDXIN <	XLIST
X 000,040,040,040,040,040,040,040	;SPACE
X 001,137,041,075,055,053,055,100
X 002,124,164,124,100,137,047,164
X 003,112,152,112,046,160,053,152
X 004,064,064,064,070,070,070,064
X 005,117,157,117,161,121,161,157
X 006,114,154,114,171,131,171,154
X 007,057,057,000,150,110,150,057
X 010,065,065,065,064,064,064,065
X 011,135,047,051,155,115,155,043
X 012,105,145,105,165,125,165,145
X 013,120,160,120,144,104,144,160
X 014,000,000,000,000,000,000,000
X 015,000,000,000,000,000,000,000
X 016,000,000,000,000,000,000,000
X 017,000,000,000,000,000,000,000
X 020,062,062,062,062,062,062,062
X 021,056,056,056,153,113,153,056
X 022,116,156,116,163,123,163,156
X 023,160,075,052,142,102,142,046
X 024,132,172,132,060,060,060,172
X 025,000,000,000,000,000,000,000
X 026,000,000,000,000,000,000,000
X 027,000,000,000,000,000,000,000
X 030,066,066,066,066,066,066,066
X 031,111,151,111,157,117,157,151
X 032,113,153,113,167,127,167,153
X 033,121,161,121,146,106,146,161
X 034,000,000,000,000,000,000,000	;UC SHIFT
X 035,177,177,177,177,177,177,010	;BACKSPACE
X 036,000,000,000,000,000,000,000
X 037,000,000,000,000,000,000,000	;LC SHIFT
X 040,061,061,061,061,061,061,061
X 041,115,155,115,152,112,152,155
X 042,130,170,130,057,057,057,170
X 043,107,147,107,141,101,141,147
X 044,060,060,060,071,071,071,060
X 045,123,163,123,162,122,162,163
X 046,110,150,110,172,132,172,150
X 047,131,171,131,151,111,151,171
X 050,067,067,067,065,065,065,067
X 051,122,162,122,156,116,156,162
X 052,104,144,104,166,126,166,144
X 053,133,073,050,145,105,145,044
X 054,000,000,000,000,000,000,000
X 055,015,015,015,015,015,015,015	;CARRIAGE RETURN/LF
X 056,012,012,012,012,012,012,012	;LINE FEED
X 057,011,011,011,011,011,011,011	;TAB
X 060,063,063,063,063,063,063,063
X 061,126,166,126,154,114,154,000
X 062,125,165,125,164,124,164,000
X 063,106,146,106,143,103,143,000
X 064,071,071,071,043,135,075,000
X 065,127,167,127,044,133,044,000
X 066,102,142,102,054,054,054,000
X 067,053,055,053,056,056,056,000
X 070,070,070,070,067,067,067,000
X 071,101,141,101,160,120,160,000
X 072,103,143,103,170,130,170,000
X 073,054,054,054,147,107,147,000
X 074,000,000,000,000,000,000,000	;EOT
X 075,000,000,000,000,000,000,000	;IDLE
X 076,000,000,000,000,000,000,000
X 077,000,000,000,000,000,000,000	;CD
X 100,040,040,040,040,040,040,040	;SPACE
X 101,141,135,000,137,055,134,000
X 102,164,124,000,133,141,043,000
X 103,152,112,140,053,045,074,000
X 104,153,044,133,052,044,052,072
X 105,157,117,000,121,077,121,117
X 106,154,114,000,131,136,131,114
X 107,134,077,000,110,150,110,077
X 110,075,045,075,072,153,000,045
X 111,051,042,000,115,041,115,042
X 112,145,105,000,125,165,125,105
X 113,052,120,136,104,144,104,120
X 114,000,000,000,000,000,000,000
X 115,000,000,000,000,000,000,000
X 116,000,000,000,000,000,000,000
X 117,000,000,000,000,000,000,000
X 120,155,100,042,074,155,051,074
X 121,072,056,072,113,047,113,033
X 122,156,116,000,123,163,123,116
X 123,045,053,057,102,142,102,053
X 124,172,132,045,051,171,000,132
X 125,000,000,000,000,000,000,000
X 126,000,000,000,000,000,000,000
X 127,000,000,000,000,000,000,000
X 130,043,133,135,047,043,072,047
X 131,151,111,000,117,157,117,111
X 132,047,113,000,127,167,127,113
X 133,077,121,000,106,146,106,121
X 134,000,000,000,000,000,000,000
X 135,177,177,177,177,177,177,177
X 136,000,000,000,000,000,000,000
X 137,000,000,000,000,000,000,000
X 140,042,136,047,075,042,076,075
X 141,041,115,000,112,152,112,115
X 142,170,130,041,077,134,077,130
X 143,147,107,000,101,100,101,107
X 144,171,051,046,050,161,133,051
X 145,163,123,043,122,162,122,123
X 146,150,110,000,132,172,132,110
X 147,136,131,000,111,151,111,131
X 150,076,046,076,045,075,050,076
X 151,162,122,000,116,156,116,122
X 152,144,104,044,126,166,126,104
X 153,050,072,000,105,145,105,041
X 154,000,000,000,000,000,000,000
X 155,015,015,015,015,015,015,015	;CARRIAGE RETURN/LF
X 156,012,012,012,012,012,012,012	;LINE FEED
X 157,011,011,011,011,011,011,011	;TAB
X 160,074,043,074,073,074,073,073
X 161,166,126,077,114,154,114,126
X 162,165,125,000,124,164,124,125
X 163,146,106,137,103,143,103,106
X 164,161,050,134,042,051,000,050
X 165,167,127,000,041,050,041,127
X 166,142,102,000,136,073,054,102
X 167,055,137,055,135,072,056,137
X 170,044,052,044,076,076,042,052
X 171,100,101,100,120,052,120,101
X 172,143,103,143,130,170,130,103
X 173,073,054,073,107,147,107,136
X 174,000,000,000,000,000,000,000	;EOT
X 175,000,000,000,000,000,000,000	;IDLE
X 176,000,000,000,000,000,000,000
X 177,000,000,000,000,000,000,000	;CD
LIST	>	;END OF DEFINITION OF BCDXIN
;THE FOLLOWING IS THE EXPANSION OF THE TRANSLATION TABLES
;
;
;TO CHANGE WHICH CHARACTER SETS ARE USED CHANGE THE DEFINITION OF
; THE X MACRO BELOW
; NOTE THAT LAST SET IN Y MACRO IS DEFAULT ON MONITOR RELOAD AND DATASET ANSWER


DEFINE X(A,APL.CR,CORR,CBASIC,EBCD,APL.EB,BCD,CUST),<
	Y	CBASIC, BCD, CORR, APL.EB, EBCD>

DEFINE Y(CD4,CD3,CD2,CD1,CD0),<
	EXP	CD0, CD1, CD2, CD3, CD4	>


BCDSET:	BCDELM

DEFINE Y(CD4,CD3,CD2,CD1,CD0),<
	BYTE (1)0(7)CD4,CD3,CD2,CD1,CD0	>

BCDIN:	BCDXIN

BCDOUT:	BCDXOU
EXTERN	LDBBCD
			; LH 400000 IF LINE IS BCD
	BCDKBL==200000	;IF KEYBOARD IS LOCKED
	BCDPRL==100000	;IF PRINTER IS LOCKED
	BCDUPS==040000	;IF IN UPPERSHIFT MODE
	BCDMSK==020000	;LINE TURNING AROUND
			; IE WE HAVE A REQUEST IN CLOCK QUEUE
	BCDXRB==010000	;SENDING REVERSE BREAK
;	BCDHDB==004000	;TERMINAL DOESN'T HAVE  DEBREAK FEATURE
	BCDOCR==002000	;LAST CHARACTER OUT WAS A CR
	BCDRCR==001000	;LAST CHARACTER RECEIVED WAS A CR
	BCDCON==000400	;LAST CHARACTER IN WAS "CONTROL" FAN
	BCDCDB==000200	;LAST TIME WE REVERSED LINE IT WAS BECAUSE
			; WE NEEDED INPUT
	BCDAPL==000100	;BREAK IS TO BE TREATED AS ^C^C
			;BITS 15-17 SPECIFY CHARACTER SET.
			;RH BITS 18-24 CHAR TO BE TYPED AS SOON
			; AS SHIFT HAS BEEN SENT
			;RH BITS 25-31 ARE ZERO.
			;BITS 32-35 ARE HPOS/8

;BCDVRG=400000!BCDHDB!BCDPRL	;VIRGIN BITS FOR A BCD LINE

BCDPCD:	POINT 3,LDBBCD(U),17
BCDPCH:	POINT 7,LDBBCD(U),24
BCDPC1:	POINT 7,LDBBCD(U),17

;FILLERS FOR DC10H
;
BCDF13:	BYTE	(9) 377,377,377,377
	BYTE	(9) 377,377,377,377
	BYTE	(9) 377,377,377,377
BCDF01:	BYTE	(9) 377,0,0,0
>		;END OF FTD10H CONDITIONAL
;DEVICE-DEPENDENT PORTION OF INITIALIZATION CODE
;CALL:	PUSHJ P,SCNINI

DLSINI:	CONO	DLS,40		;I/O RESET TO DC10
	SETZM	DLSERR		;CLEAR COUNT OF LOST PI ERRORS
	CONO	DLS,SCNCHN##	;ASSIGN ITS PI
	POPJ	P,0		;RETURN FROM DLSINI
DLSOFL:	CONSZ	DLS,7
	JRST	CPOPJ1##
	PUSHJ	P,SCNCHK
	CONSZ	DLS,7
	AOS	(P)
	POPJ	P,0
DLSINT:	JSR	SCNSAV##	;YES. GET AC'S AND P
	DATAI	DLS,T3		;GET WHAT THE DC10 SAID
SCNNT1:	HLRZ	U,T3		;GET THE HARDWARE LINE NUMBER
	TRNE	T3,RCVBIT	;RECEIVE OR TRANSMIT?
	JRST	SCNREC		;RECEIVE.
	DATAO	DLS,[TDSABL]	;TRANSMIT. FIRST CLEAR FLAG
	CAILE	U,DLSMXD	;LEGAL LINE NUMBER?
	POPJ	P,		;NO--DO NOT KICK SCNSER
	ADDI	U,DLSOFS	;YES--CONVERT TO LINTAB INDEX
IFE FTD10H <
	JRST	XMTINT##	;CALL SCNSER
>;END OF IFE FTD10H
IFN FTD10H <
	MOVE	T2,LINTAB(U)	;GET LDB ADR
	HLL	T2,LDBBCD(T2)	;GET 2741 STATUS BITS
	MOVEI	T1,LDR274	;FLAG FOR 2741 LINES
	TDNE	T1,LDBDCH(T2)	;IS LINE A 2741 ?
	TLNN	T2,BCDPRL!BCDXRB!BCDMSK ;IS LINE SENDING A REVERSE BREAK ?
	  JRST	XMTINT##	;CALL SCNSER
	TLNN	T2,BCDXRB!BCDMSK	;CHECK FOR SPECIAL TIMERS
	SKIPN	T1,LDBXNP(T2)	;GET XOF(EOT, ETC) LEVEL POINTER
	  POPJ	P,		;IGNORE XMT INTERRUPT
	ILDB	T1,T1		;GET IT
	JUMPN	T1,XMTINT##
	SETZM	LDBXNP(T2)	;CLEAR XOF POINTER
	MOVSI	T1,LDLOIP	;BIT FOR OUTPUT IN PROGRESS
	ANDCAM	T1,LDBDCH(T2)	;CLEAR IT
	POPJ	P,
>;END OF IFN FTD10H
IFN FTD10H,<
;CHANGE HARDWARE PARAMETERS
DLSCHP:	POPJ	P,

;SEND LINE PARAMETER CONTOL MSG
; SUBFUNCTION IS IN T3
DLSLPC:	CAIN	T3,<LPCUKB>B27	;WANT TO UNLOCK KYBD ?
	  JRST	BCDGIV		;GIVE UP LINE
	POPJ	P,		;NO IGNORE

;SET ELEMENT #
DLSELE:	MOVSI	T2,-5			;SO WE DON'T CHECK BEYOND TABLE END
	CAME	T3,BCDSET(T2)		;ELEMENT MATCH ONE IN TABLE?
	  AOBJN	T2,.-1			;NO, LOOP FOR MORE.
	JUMPGE	T2,CPOPJ##		;EXIT IF NOT FOUND.
	DPB	T2,BCDPCD		;PUT ELEMENT CODE IN LDB
	PJRST	CPOPJ1##		;GIVE GOOD RETURN (+1)
>;END FTD10H
SCNREC:	CAIG	U,DLSMXD	;DATASET CONTROL OR JUST DATA?
	JRST	SCNRC0		;HAVE RECEIVED DATA
IFE FTMODM,<
	POPJ	P,0		;JUNK
>
IFN FTMODM,<
	CAILE	U,DLSMXL	;LEGAL DC10E LINE?
	POPJ	P,0		;NO. JUNK IT.
DSCRCV:	SUBI	U,DSCOFS	;CONVERT TO TABLE ADDRESS
IFN FTDIAL,<
	ANDI	T3,DLSCAR!DLSRNG!DLSPND
>
IFE FTDIAL,<
	ANDI	T3,DLSCAR!DLSRNG
>				;SELECT MEANINGFUL BITS
	MOVE	T1,DSCTAB##(U)	;GET CONTROL BITS
IFN FTDIAL,<
	TLNN	T1,DSCDLW##	;IN DIALLER CODE?
	TRZ	T3,DLSPND	;NO, IGNORE DIALLER
>
	HRR	T1,T3		;COPY HARDWARE BITS
	TRNE	T3,DLSCAR	;CARRIER ON?
	TLC	T1,DSCHWC##	;YES. XOR THE TWO BITS
	TLNE	T1,DSCHWC##	;CARRIER CHANGE?
	JRST	DSCRC1		;YES. THATS MAIN FLAG.
IFN FTDIAL,<
	MOVEI	T3,DSTPND##	;PRESENT NEXT DIGIT
	TRNE	T1,DLSPND	;IS THAT IT?
	JRST	DSCREC##	;YES.
>
	MOVEI	T3,DSTRNG##	;RING TRANSACTION CODE
	TRNE	T1,DLSRNG	;IS IT A RING?
	JRST	DSCREC##		;YES. INFORM SCNSER
DSCRC1:	MOVEI	T3,DSTOFF##	;NO. TRY OFF TRANSACTION
	TRNE	T1,DLSCAR	;CARRIER ON?
	MOVEI	T3,DSTON	;YES. ON-COMING TRANSACTION
	JRST	DSCREC##		;PASS TO SCNSER
>				;END OF FTMODM
SCNRC0:	ADDI U,DLSOFS		;CONVERT TO LINTAB INDEX

IFN FTD10H <
	MOVE	U,LINTAB(U)
	MOVEI	T1,LDR274##	;BIT FOR 2741 LINES
	TDNN	T1,LDBDCH##(U)	;IS LINE A 2741 ?
	  JRST	BCDRC9		;NO
	HLL	U,LDBBCD(U)	;GET SPECIAL BITS FOR 2741'S
	ANDI	T3,177		;STRIP HDW BITS
	JUMPE	T3,BCDRBK	;SPECIAL HANDLING FOR BREAK

	ANDI	T3,0077		;FLUSH PARITY
	TLNN	U,BCDRCR	;IF LAST CHAR WAS CR THEN THIS MUST BE EOT
	CAIN	T3,BCDEOT&077
	  JRST	BCDREO
	TLNE	U,BCDKBL	;KEYBOARD LOCKED?
	  JRST	BCDREA		;YES SO IT MIGHT BE AN EOA
	CAIN	T3,BCDUCS&077	;UPSHIFT?
	  JRST	BCDRUS
	CAIN	T3,BCDLCS&077	;DOWNSHIFT?
	JRST	BCDRDS
	MOVSI	T1,BCDOCR!BCDRCR
	CAIN	T3,155&077	;WAS THIS A CRLF?
	IORM	T1,LDBBCD(U)	;REMEMBER IT
	TLNE	U,BCDUPS	;IN UPPERCASE SHIFT?
	SKIPA	T3,BCDIN+100(T3) ;INCREASE DISPLACEMENT IN TABLE
	MOVE	T3,BCDIN(T3)	;GET TRANSLATION WORD
	LDB	T1,BCDPCD	;GET CODE #
	SOJL	T1,.+3
	LSH	T3,-7
	JRST	.-2
	ANDI	T3,177		;LEAVE ONLY 7 ASCII BITS
	TLNE	U,BCDAPL	;APL MODE?
	JRST	BCDRC6		;YES SO NO "CONTROL" TESTS
	TLZN	U,BCDCON	;IS THIS REALLY A CONTROL CHAR?
	JRST	BCDRC5
	HLLM	U,LDBBCD(U)
	CAIL	T3,"A"
	CAILE	T3,"Z"+40
	JRST	BCDRV4
	CAIGE	T3,"A"+40
	CAIG	T3,"Z"
	ANDI	T3,37		;MAKE INTO CONTROL CHAR
BCDRV4:	CAIN	T3,"$"
	MOVEI	T3,STDALT		;HE WINS A ALTMODE
	CAIE	T3,"("
	CAIN	T3,"<"
	JRST	BCDCB1
	CAIE	T3,")"
	CAIN	T3,">"
	JRST	BCDCB2
	CAIN	T3,"["
	MOVEI	T3,"<"
	CAIN	T3,"]"
	MOVEI	T3,">"
	CAIN	T3,"/"
	MOVEI	T3,"\"
	JRST	BCDRC7
BCDCB1:	SKIPA	T3,["["]
BCDCB2:	MOVEI	T3,"]"
	JRST	BCDRC7		;SO A SECOND ^ IS AN ^
BCDRC5:	CAIE	T3,"^"		;WAS THIS THE MAGIC CHAR?
	JRST	BCDRC7		;NO
	MOVSI	T1,BCDCON
	IORM	T1,LDBBCD(U)
	POPJ	P,
;HERE FOR SPECIAL TRANSLATIONS FOR APL MODE
BCDRC6:	CAIN	T3,177		;DID USER STRIKE BACKSPACE KEY ?
	  MOVEI	T3,010		;YES SO GIVE HIM A BACKSPACE
	CAIN	T3,STDALT	;DID USER STRIKE NOT EQUAL ?
	  MOVEI	T3,044		;YES SO GIVE HIM A "$"
BCDRC7:	JUMPE	T3,BCDRC8	;IGNORE IDLES ETC
	MOVSI	T1,BCDRCR	;IF NOT A CR CLEAR
	CAIE	T3,15
	ANDCAM	T1,LDBBCD(U)
	PUSHJ	P,BCDRC9	;PUT CHAR IN BUFFERS
BCDRC8:	;SKIPLE	LDBECC##(U)	;CHARS TO ECHO?
	;PJRST	XMTECH		;SHIFT THROUGH ECHO PROCESS
	POPJ	P,		;NO
BCDRC9:	LDB	U,LDPLNO	;GET LINE NUMBER AGAIN

>;END OF IFN FTD10H

	 JRST RECINT##		;CALL SCNSER
IFN FTD10H <
;HERE IF RECEIVE AN UPSHIFT CHARACTER
BCDRUS:	TLOA	U,BCDUPS
BCDRDS:	TLZ	U,BCDUPS
	HLLM	U,LDBBCD(U)
	POPJ	P,

;HERE WHEN RECEIVE EOT FROM BCD TERMINAL
BCDREO:	TLNN	U,BCDRCR	;IS THIS THE EOT AFTER A CR?
	TLNN	U,BCDAPL	;NO SO IF APL MODE ^C
	JRST	BCDRE2
	MOVEI	T3,3		;CONTROL C
	PUSHJ	P,BCDRC9	;PUT IN BUFFER
	HLL	U,LDBBCD(U)	;RESTORE STATUS BITS
BCDRE2:	TLON	U,BCDMSK	;MARK WE HAVE A REQUEST IN QUEUE
	TLNE	U,BCDXRB	;WERE WE SENDING A DBREAK
	  POPJ	P,		;YES SO IGNORE THIS
	TLO	U,BCDKBL!BCDPRL	;MARK ALL LOCKED
	TLZ	U,BCDUPS!BCDRCR	;BACK TO LOWERCASE
	HLLM	U,LDBBCD(U)
	MOVE	T3,[BCDWEO,,^D10]	;TIME TO TURN AROUND
	PJRST	BCDCLK
BCDWEO:	MOVE	U,LINTAB(T1)
	MOVSI	T1,BCDMSK!BCDPRL
	ANDCAM	T1,LDBBCD(U)	;CLEAR MASK
	MOVSI	T1,LDLOIP##	;FLAG OUTPUT IN PROGRESS
	IORM	T1,LDBDCH(U)
	MOVEI	T1,LDRSHC##	;RENABLE IRMA CATCHER
	ANDCAM	T1,LDBDCH(U)
	MOVE	T1,[POINT 9,BCDEAS]
	MOVEM	T1,LDBXNP##(U)
;FAKE AN XMT INTERRUPT
XMTFAK:	LDB	U,LDPLNO##	;GET LINE NUMBER
	PJRST	XMTINT

;HERE TO GIVE UP LINE CONTROL BECAUSE WE NEED INPUT
BCDGIV:	HLL	T1,LDBBCD(U)	;GET BCD STATUS BITS
	SKIPL	LDBDCH(U)	;DON'T IF ACTIVELY OUTPUTING
	TLNE	T1,BCDMSK!BCDPRL	;DON'T INTERRUPT IMPORTANT STUFF
	  POPJ	P,
	MOVSI	T1,LDLOIP##	;FLAG OUTPUT IN PROGRESS
	IORM	T1,LDBDCH(U)
	HRRZI	T1,LDRSHC	;DISABLE IRMA CATCHER
	IORM	T1,LDBDCH(U)
	MOVSI	T1,BCDCDB	;MARK THAT WE GAVE IT UP
	IORM	T1,LDBBCD(U)	; VOLUNTARILY
	MOVE	T1,[POINT 9,BCDETS]
	MOVEM	T1,LDBXNP(U)
	PJRST	XMTFAK

;HERE WHEN RECEIVE A BREAK FROM BCD TERMINAL
BCDRBK:	TLNE	U,BCDAPL	;IS THIS REALLY A CONTROL C?
	JRST	[MOVEI	T3,3	;YES
		JRST	BCDRC7]
	TLOE	U,BCDMSK	;ALREADY SEEN IT?
	POPJ	P,
	MOVSI	T1,LDLOIP##	;MARK OUTPUT IN PROGRESS
	HRRI	T1,LDRSHC	;DISABLE IRMA CATCHER
	IORM	T1,LDBDCH(U)	;SO SOMEONE DOESN'T SNEAK IN
	TLO	U,BCDPRL	;CONSIDER PRINTER LOCKED
	TLZ	U,BCDUPS!BCDCDB	;BACK TO LOWER SHIFT
	HLLM	U,LDBBCD(U)
	MOVE	T3,[BCDWBK,,^D16]	;WAIT BEFORE SENDING EOT
	PJRST	BCDCLK
BCDWBK:	MOVE	U,LINTAB(T1)
	MOVSI	T1,BCDMSK	;NO LONGER HAVE REQUEST IN QUEUE
	ANDCAM	T1,LDBBCD(U)
	MOVE	T1,[POINT 9,BCDETS]	;GIVE LINE TO TERMINAL
	MOVEM	T1,LDBXNP(U)
	PJRST	XMTFAK

;HERE IF INPUT MIGHT BE AN EOA
BCDREA:	TLOE	U,BCDPRL	;PRINTER MUST ALREADY BE LOCKED
	CAIE	T3,BCDEOA&077	;IS IT?
	POPJ	P,		;NO SO IGNORE IT
	TLZ	U,BCDKBL!BCDUPS	;MARK KEYBOARD ACTIVE
	HLLM	U,LDBBCD(U)	;MARK NOW UNLOCKED
	POPJ	P,
;HERE TO SEND A REVERSE BREAK TO A 2741 TO GET LINE CONTROL BACK.
; CALLED AT UUO LEVEL
; CALL WITH LDBBCD IN T1
BCDDBK:	DPB	T3,BCDPCH	;SAVE CHARACTER TO TYPE LATER
	MOVE	T3,BCDPC1	;GET POINTER TO CHARACTER
	MOVEM	T3,LDBFLP##(U)	;SO WE TYPE IT LATER
	TLNE	T1,BCDCDB	;IF USER TOOK IT DON'T TAKE IT BACK
	TLNE	T1,BCDXRB	; & BE SURE WE HAVEN'T ALREADY DONE THIS
	  JRST	BCDKDB
	TLNN	T1,BCDMSK!BCDRCR ;BE SURE NOT ALREADY DOING SOMETHING
				; AND WE HAVE HARDWARE FEATURE
	TLNN	T1,BCDPRL	;IS PRINTER LOCKED?
	  JRST	BCDKDB		;NOPE
	MOVSI	T1,LILDBK##	;BIT FOR HAS REVERSE BREAK FEATURE
	TDNN	T1,LDBISR##(U)	;DO WE HAVE IT
	  JRST	BCDKDB
	MOVSI	T1,BCDXRB	;SET TRYING TO DEBREAK BIT IN
	IORM	T1,LDBBCD(U)	; STATUS WORD
	MOVE	T3,[BCDWDB,,^D13]	;200-240MS OF SPACE
	PUSHJ	P,BCDCLK
	MOVEI	T3,200
	PJRST	BCDTY9
BCDWDB:	MOVE	U,LINTAB(T1)
	MOVSI	T1,BCDXRB	;MARK NO REQUEST IN QUEUE
	ANDCAM	T1,LDBBCD(U)	; LOWER SHIFT  PRINTER UNLOCKED
	MOVEI	T3,177		;SEND BITS TO FINISH BREAK
	PUSHJ	P,BCDTY9
	HLL	U,LDBBCD(U)	;GET STATUS BITS
	PJRST	BCDRE2		;NOW PRETEND WE RECEIVED AN EOT
BCDKDB:	MOVEI	T1,LDRSHC	;DISABLE IRMA
	IORM	T1,LDBDCH(U)
	POPJ	P,

BCDCLK:	LDB	T1,LDPLNO	;GET LINE #
	CONO	PI,PIOFF##
	IDPB	T3,CLOCK##
	IDPB	T1,CLOCK##	;REMEMBER LINE #
	CONO	PI,PION##
	POPJ	P,
>;END OF IFN FTD10H
IFN FTMODM,<
;HERE TO EXERCISE CONTROL OVER A DATASET. TRANSACTION CODE IN T3,
; DSCTAB INDEX IN LINE. ENTERED FROM SCNSER ONLY.

DSCTYP:	CAIN	T3,DSTON##	;IS CODE FOR ON?
	JRST	DSDON		;YES. DRIVEN ON FLAG
	CAIN	T3,DSTOFF##	;NO. FOR OFF?
	JRST	DSDOFF		;YES. DISPATCH.
IFN FTDIAL,<
	CAIN	T3,DSTCRQ##	;PLACE OUTGOING CALL REQUEST?
	JRST	DSDCRQ		;YES
	CAIG	T3,DSTPND##+17	;DIGIT TO DIAL?
	CAIGE	T3,DSTPND##	; ..
	SKIPA			; NO.
	JRST	DSDPND		;YES.
>
	CAIE	T3,DSTREQ##	;REQUEST SATATUS?
	POPJ	P,0		;NO. ERRONEOUS CODE. DISMISS.

DSDREQ:	;HERE TO REQUEST STATUS OF A LINE, ONLY DURING TTYINI. THUS
; IT IS OK TO GO INTO A WAIT-LOOP TO ACCOMPLISH THIS, AND TO IGNORE 
; ANY OTHER ACTIVITY.

	MOVSI	T3,USDRLN+DSCOFS(U)	;PUT DIRECTED LINE NUMBER IN LH
	HRRI	T3,DLSOHE+DLSART	;REQUEST ARTIFICIAL INT, KEEP OFFHOOK ENABLE
	DATAO	DLS,T3		;SEND TO DC10
	MOVEI	T1,1000		;TIMEOUT, IN CASE DC10E DEAD
DSCIL2:	CONSZ	DLS,30		;WAIT FOR INTERRUPT
	JRST	DSDRQ1		;GOT A FLAG. SEE WHAT IT IS
	SOJG	T1,DSCIL2	;WAIT FOR FLAG
DSRQOF:	MOVEI	T3,DSTOFF	;TELL SCNSER IT'S OFF.
	POPJ	P,0		;RETURN TO SCNSER

DSDRQ1:	DATAI	DLS,T3		;SEE WHAT THE DC10 SAYS
	TRNE	T3,RCVBIT	;IS IT A RECEIVE FLAG?
	JRST	DSDRQ2		;YES. GOOD.
	DATAO	DLS,[EXP TDSABL]	;NO. RANDOM XMT FLAG. JUNK IT.
	JRST	DSCIL2		;AND KEEP WAITING
DSDRQ2:	HLRZ	T2,T3		;GET LINE NUMBER FROM DC10 INT.
	CAIE	T2,DSCOFS(U)	;CORRECT FOR THIS REQUEST?
	JRST	DSCIL2		;NO. IGNORE IT.
	TRNN	T3,DLSCAR	;YES. IS CARRIER ON?
	JRST	DSRQOF		;NO. TELL SCNSER ITS OFF
DSRQON:	MOVEI	T3,DSTON	;YES. TELL SCNSER.
	POPJ	P,0		;RETURN FROM DSCTYP

;STILL IN FTMODM
;HERE TO DRIVE A DATASET ON.

DSDON:	MOVEI	T2,DLSOHE	;BIT FOR DC10E
	JRST	DSDOF1		;SEE WHICH TO USE

;HERE TO DRIVE A DATASET OFF.

DSDOFF:	MOVEI	T2,0		;BIT FOR DC10E OFF
DSDOF1:	MOVEI	T1,0(U)		;GET COPY OF LINE NUMBER
	ADDI	T1,DSCOFS	;CORRECT TO DC10E NUMBER
	MOVE	T3,T2		;GET BIT (OR NOT) FOR DC10E
	JRST	SCNTY1		;SEND TO DC10

IFN FTDIAL,<

DSDCRQ:	MOVEI	T1,0(U)		;COPY DSCTAB INDEX
	ADDI	T1,DSCOFS	;CONVERT TO DC10E PHYSICAL LINE NUMBER
	MOVEI	T3,DLSOHE!DLSCRQ ;REQUEST LINE
	JRST	SCNTY1		;SEND TO HARDWARE

DSDPND:	MOVEI	T1,0(U)		;COPY DSCTAB INDEX
	ADDI	T1,DSCOFS	;CONVERT TO PHYSICAL LINE IN DC10E
	ANDI	T3,17		;JUST THE DESIRED DIGIT
	CAIN	T3,16		;FLAG FOR SECOND DIAL TONE DELAY?
	JRST	DSDSDT		;YES. GO WAIT FOR SECOND DIAL TONE
	TRO	T3,DLSOHE!DLSDPR!DLSCRQ
	JRST	SCNTY1		;SEND THE DIGIT TO DC10E

DSDSDT:	MOVE	T1,TICSEC##	;ONE SECOND
	IMULI	T1,5		;FIVE SECONDS
	HRLI	T1,DLSCLK	;WHERE TO COME ON CLK LEVEL
	CONO	PI,PI.OFF	;FOR CLOCK REQUEST
	IDPB	T1,CLOCK##	;PUT IN QUEUE
	IBP	CLOCK##		;TWO WORDS/ENTRY
	CONO	PI,PI.ON	;OK FOR INT'S NOW
	POPJ	P,0		;DISMISS, WAIT FOR CLOCK.

;HERE ON CLOCK LEVEL AFTER WAITING FOR SECOND DIAL TONE

DLSCLK:	MOVE	T3,DSDUNI##	;GET TTY NUMBER FOR DIALLER
	MOVE	U,LINTAB##(T3)	;LINE TABLE ENTRY IS LDB ADDRESS
	LDB	T3,LDPDSC##	;GET THE DATASET CONTROLLER INDEX
	MOVSI	T3,DSCOFS(T3)	;DC10E LINE NUMBER TO LEFT HALF
	HRRI	T3,RCVBIT!DLSPND ;PRETEND IT WAS RECEIPT OF NEXT DIGIT
	JRST	SCNNT1		;AND JUMP INTO RECEIVE INTERRUPT CODE
>				;END OF FTDIAL
>				;END OF FTMODM
;ROUTINE TO OUTPUT A CHARACTER TO A LINE
;CALLED FROM TYPE IN SCNSER
;WITH 8-BITS OF CHARACTER IN T3

SCNTYP:	IFN FTD10H <
	MOVEI	T1,LDR274	;BIT FOR 2741 LINES
	TDNN	T1,LDBDCH(U)	;IS LINE A 2741 ?
	  JRST	BCDTY9		;NO
	MOVE	T1,LDBBCD(U)	;GET 2741 STATUS BITS
	TLNE	T1,BCDPRL	;CHECK FOR PRINTER LOCKED
	TLNE	T1,BCDKBL	;CHECK FOR KEYBOARD LOCKED
	  JRST	BCDTY0
	  JRST	BCDDBK		;SEND DEBREAK TO UNLOCK PRINTER
BCDTY0:	ANDI	T3,577		;LEAVE ONLY 7BIT ASCII
	TRZN	T3,400		;IMAGE MODE?
	  JRST	BCDTY1		;NO
	ANDI	T3,77
	CAIN	T3,BCDUCS&77	;UPSHIFT?
	TLO	T1,BCDUPS
	CAIN	T3,BCDLCS&77	;DOWNSHIFT?
	TLZ	T1,BCDUPS
	CAIN	T3,BCDEOT&77
	TLO	T1,BCDPRL	;YES MARK PRINTER LOCKED
	HLLM	T1,LDBBCD(U)	;SAVE NEW STATUS
	JRST	BCDTY8		;YES - SO DON'T TRANSLATE
BCDTY1:	CAIL	T3,"A"+40	;IS IT LOWER CASE?
	CAILE	T3,"Z"+40
	JRST	BCDTY2
	TLNE	U,LDLLCT##	;IS TTY LC SET?
	ANDI	T3,137		;CONVERT TO UPPER CASE
BCDTY2:	MOVE	T1,BCDOUT(T3)	;TRANSLATE
	PUSH	P,T3
	LDB	T3,BCDPCD	;GET CODE NUMBER
	SOJL	T3,.+3
	LSH	T1,-7
	JRST	.-2
	ANDI	T1,177
	POP	P,T3
	HRL	T3,T1
	TRNE	T1,04		;DOES THIS CHARACTER
	TRNN	T1,10		;NEED SHIFT CHECKED?
	JRST	.+3		;YES
	TRNE	T1,60		;MAYBE
	JRST	BCDTY6		;NO
	HLLZ	T1,LDBBCD(U)	;GET BCD STATUS BITS
	TLZE	T3,100		;DO WE NEED AN UPSHIFT?
	JRST	BCDTUP		;YES
	TLZN	T1,BCDUPS	;NO - DO WE ALREADY HAVE ONE?
	JRST	BCDTY6		;NO
	PUSH	P,[BCDLCS,,0]
	JRST	BCDTY5
BCDTUP:	TLOE	T1,BCDUPS	;DO WE ALREADY HAVE UC?
	JRST	BCDTY6		;YES
	PUSH	P,[BCDUCS,,0]
BCDTY5:	HLLM	T1,LDBBCD(U)
	DPB	T3,BCDPCH
	MOVE	T3,BCDPC1
	MOVEM	T3,LDBFLP##(U)	;SO WE SEND CHAR LATER
	POP	P,T3
BCDTY6:	HLRZS	T3		;RESTORE CHR TO TYPE
	MOVSI	T1,BCDOCR
	CAIE	T3,055		;CR?
	JRST	BCDTY7
	IORM	T1,LDBBCD(U)	;SO WE FLUSH NEXT LF
	PUSH	P,T3		;SAVE T3
	MOVE	T3,[POINT 9,BCDF13]	;POINT TO 13 FILLERS (377)
	MOVEM	T3,LDBFLP(U)	;PUT POINTER IN LDB
	POP	P,T3		;RESTORE T3
	JRST	BCDTY8
BCDTY7:	CAIN	T3,075		;SENDING IDLE?
	JRST	BCDTY8
	CAIN	T3,056		;LF?
	TDNN	T1,LDBBCD(U)
	CAIA
	MOVEI	T3,075		;SEND AN IDLE INSTEAD
	CAIG	T3,057		;LOOK FOR A TAB (057) OR
	 CAIGE	T3,056		; A LINE FEED (056)
	  JRST	.+5		;NO, ITS SOMETHING ELSE.
	PUSH	P,T3		;SAVE T3
	MOVE	T3,[POINT 9,BCDF01]	;POINT TO 1 FILLER (377)
	MOVEM	T3,LDBFLP(U)	;PUT POINTER TO FILLER IN LDB
	POP	P,T3		;RESTORE T3
	ANDCAM	T1,LDBBCD(U)
BCDTY8:	PUSHJ	P,PEVEN8##	;GET PARITY FOR CHARACTER
	TRZN	T3,200		;WAS PARITY ALREADY ODD?
	TRC	T3,100		;NO
BCDTY9:
>;END OF IFN FTD10H
	ANDI	T3,377		;MAKE SURE NO JUNK
IFN FTHDPX!FTTRACK,<
	DPB	T3,LDPECK##	;SAVE FOR ECHO CHECK
>
	LDB	T1,LDPLNO##	;PICK UP LINE NUMBER
	SUBI	T1,DLSOFS	;CONVERT LINE #
SCNTY1:	HRL	T3,T1		;SET UP LINE NUMBER IN T3 LH
	TLO	T3,USDRLN	;AND DIRECT TO THAT LINE
	DATAO	DLS,T3		;OUT TO SCANNER
	POPJ	P,0		;AND RETURN

SCNCHK:	CONSZ	DLS,7		;ANY PI CHAN ON DC10?
	POPJ	P,0		;YES. OK
	CONO	DLS,SCNCHN	;NO. RE ASSIGN IT
	AOS	DLSERR		;AND COUNT OCCURRENCE OF ERROR
	POPJ	P,0		;RETURN TO CLOCK

	$LOW
DLSERR:	0				;COUNT OF LOST PI CHANNEL ERRORS

	$LIT

DLSEND:	END