Google
 

Trailing-Edge - PDP-10 Archives - BB-J724A-SM_1980 - sources/hdefin.p11
There are 2 other files named hdefin.p11 in the archive. Click here to see a list.
.SBTTL	DN60 SERIES DEFINITIONS
;
.REPT 0


                          COPYRIGHT (c) 1980, 1979
            DIGITAL EQUIPMENT CORPORATION, maynard, mass.

THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND  COPIED
ONLY  IN  ACCORDANCE  WITH  THE  TERMS  OF  SUCH  LICENSE AND WITH THE
INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR  ANY  OTHER
COPIES  THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY
OTHER PERSON.  NO TITLE TO AND OWNERSHIP OF  THE  SOFTWARE  IS  HEREBY
TRANSFERRED.

THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT  NOTICE
AND  SHOULD  NOT  BE  CONSTRUED  AS  A COMMITMENT BY DIGITAL EQUIPMENT
CORPORATION.

DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR  RELIABILITY  OF  ITS
SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.

.ENDR
;
;
;
;MODULE REVISION HISTORY
;
;
; 3(000) BS		ADDED COUNTER FOR INCOMIG MESSAGES QUEUED TO XLATE TASK
;
; 3(001) 18-Apr-79 JW	Add some definitions for the 2020
;
; 3(002)  3-MAY-79 BS	MODIFIED TO SAVE REGISTERS ON STOPCODE WITH DEBUG OFF
;
; 3(003)  3-MAY-79 BS	ADD EBCDIC TO ASCII TRANSLATE TABLE SWITCH
;
; 3(004)  7-MAY-79 JW	ADD ROOM IN 2020 DMC LCB FOR SOME STATISTICS
;
; 3(005) 15-MAY-79 BS	ADD SPACE IN LINE CONTROL BLOCK FOR LINE SIGNATURE
;
; 3(006) 01-JUN-79 BS	ADD FLAG FOR H/W ABORT TO LINE FLAGS
;
; 3(007) 08-JUN-79 BS	ADD VERSION NUMBERS TO MODULE
;
; 3(010) 22-Jun-79 KR	add TCIRH bit to TCFG1 for device TCB's
;
; 3(011) 26-JUN-79 BS	MAKE LINE DRIVER TYPE LAST ENTRY IN PDP-10 STATISTICS
;
; 4(012) 26-JUN-79 BS	UPGRADE MAJOR TO VERSION 4 AND TURN DEBUG OFF
;
; 4(013) 21-AUG-79 BS	ADD POINTER TO LINE ENABLE TCB FOR DL10 DRIVER
;
VDEFIN=013
;
VEDIT=VEDIT+VDEFIN
;
;
;
;
;
;
;
; VERSION VMAJOR.VMINOR(2400) -- MAY 1, 1979 /JBS/MM/BS
;
VMAJOR=4
VMINOR=0
VWHO=0		;WHO LAST EDITED THIS PROGRAM
;3(007)VEDIT=2400	;EDIT NUMBER
;3(007)VMAJOR=VMAJOR	;MAJOR VERSION NUMBER
;3(007)VMINOR=VMINOR	;MINOR VERSION NUMBER

;
;
;
;
;
; DN60 REVISION HISTORY:
;
; INITIALLY CODED IN SUMMER, FALL AND WINTER OF 1976
;  AS PART OF THE DN60 PROJECT BY THE
;  ADVANCED SYSTEMS GROUP.
;
; TAKEN OVER APRIL 4, 1977, BY THE LCG ADVANCED SOFTWARE GROUP.
;
; TAKEN OVER JULY 5, 1977, BY ASG SOFTWARE ENGINEERING.
;
; TAKEN OVER DECEMBER 1, 1977, BY LCG COMM/NETS SOFTWARE GROUP.
;
; --------------------------------
;
; VERSION 1(622) SENT TO A CUSTOMER IN FULFILMENT
;  OF A CONTRACT FOR "IBM 3780" SUPPORT.
;
;EDIT	DATE		DESCRIPTION
;
; 0623	20-DEC-76	CHANGED "DEBUG" TO "-1" TO LOOK FOR A
;			 NXM PROBLEM AT IDLE+52.  IT SEEMS TO
;			 HAPPEN VERY RARELY. /JBS
;
; 0624	20-DEC-76	FIXED ABOVE PROBLEM: LB.MSG WAS NOT
;			 BEING CLEARED WHEN THE STREAM WAS
;			 ABORTED.
;			 ALSO, SET "DEBUG" BACK TO 00. /JBS
;
; 0625	29-DEC-76	ADDED CODE TO LIMIT TRANSMISSION RATE
;			 TO AVOID ALLOCATING ALL THE FREE CHUNKS
;			 TO ONE LINE.  ALSO, HALT ON POWER FAIL
;			 AND ADD SOME DN61-S CODE TO 
;			 CHK11. /JBS
;
; 0626	30-DEC-76	MORE CODE TO LIMIT TRANSMISSION RATE
;			 TO AVOID BOTTLENECKS RUNNING THREE
;			 LINES AT 19.2 K BAUD. /JBS
;
; 0627	07-JAN-77	ADD "OUTPUT DUMP" FEATURE SO D60SPL CAN
;			 PRINT FORMS MOUNT REQUEST FOR
;			 REMOTE OPERATOR.  /JBS
;
; 0630	21-JAN-77	SEPARATE DQ11 DRIVER BETTER AND IMPROVE
; TO 0636		 PERFORMANCE ON 0 TURN-AROUND-TIME
;			 MODEMS.  /JBS
;
;
; REVISION HISTORY CONTINUED
;
; 0637	07-FEB-77	CHANGE TWO CALLS TO XMTSTP TO DQKILL
;			 TO ALLOW FOR VERY LONG TURN-AROUND-TIME
;			 MODEMS.  /JBS
;
; 0640	11-FEB-77	FIX AN XL3780 BUG THAT CAUSED LF'S TO BE
;			 CONVERTED TO DC3'S UNNECESSAIRILY AND
;			 REARRANGE XLIMSG TO IMPROVE SPEED. /JBS
;
; 0641	14-FEB-77	UPDATE COPYRIGHT NOTICE BASED ON
;			 005-003-286-03.  /JBS
;
; 0642	17-FEB-77	USE CLEVERER XOR MACRO, IMPROVE MTPS
; TO 0643		 AND MFPS MACROS, CORRECT SOME DTE20
;			 SYMBOL ERRORS, REMOVE SWITCH REG /JBS
;
; 0644	22-FEB-77	FIX A RACE CONDITION INVOLVING
;			 A CHUNK BEING QUEUED TO BSC JUST
;			 BEFORE THE CALL TO DQKILL. /JBS
;
; 0645	22-FEB-77	ADD A MISSING INSTRUCTION IN DQRQIP
;			 THAT CAUSED STOP CODE 13.  /JBS
;
; 0646	02-MAR-77	BEGIN INTEGRATION OF DN61-S CODE
; TO 651		 (INDEPENDENT EFFORT) /JBS/MM
;
; 0652	08-MAR-77	DISPLAY STOP CODE IN LIGHTS ON
;			 PDP-11/40 FOR DN61-S /JBS
;
; 0653	17-MAR-77	CONTINUE DEVELOPMENT OF DN61-S /MM
; TO 0655
;
; 0656	17-MAR-77	ADD TWO BITS TO LINE STATUS FOR DUP11 /JBS
;
; 0657	18-MAR-77	ADD KG11-A SIMULATOR /JBS
; TO 0660
;
; 0661	18-MAR-77	ONLY ASSEMBLE DTE DATA BASE IF NEEDED. /JBS
;
; 0662	21-MAR-77	CONTINUE DEVELOPMENT OF DN61-S.  /MM
;
; 0663	21-MAR-77	CORRECT ERROR IN MTPS, MFPS AND KGACUM
;			 MACROS INVOLVING MOVB X,-(SP). /JBS
;
; 0664	28-MAR-77	CONTINUE DEVELOPMENT OF DN61-S /MM
;
;
; CONTINUATION OF REVISION HISTORY
;
; 0665	29-MAR-77	FIX CALL TO DQDTR0 FROM DL10 AND DTE /JBS
;
; 0666	30-MAR-77	FIX WRITE DN60 FUNCTION IMPLEMENTATION  /MM
;
; 0667  31-MAR-77	FIX READ DN60 FUNCTION IMPLEMENTATION /MM
;
; 0670	01-APR-77	CHANGED NAME TO "DN60".  /JBS
;
; 0671	04-APR-77	REARRANGED DTE20 DATA BASE IN TCB /MM
;
; 0672	09-APR-77	RECODED DL10 READ AND WRITE DATA TO IMPROVE
;			 SPEED AND ALLOW SHORT READS.  /JBS
;
; 0673	12-APR-77	FIXED BYPASS OF KG11-A MSG IN CHK11 /JBS
;
; 0674	13-APR-77	FIX READ FUNCTION FOR END OF MESSAGES  /MM
;
; 0675	13-APR-77	FIX QUEING DEBUG ERROR IN DEQMID  /JBS
;
; 0676	14-APR-77	FIX DUP11 CODE IN CHK11 AND ADD KMC11 
;			 AND LIMIT TRANSMISSIONS TO 1000 BYTES /JBS
;
; 0677	15-APR-77	DIVIDE DTE INTO DTE10 AND DTE20  /MM
;
; 0700	25-APR-77	SET DEBUG=0 FOR PERFORMANCE TESTING /JBS
;
; 0701	27-APR-77	CONTINUE DEVELOPMENT OF THE DN64 /MM
;
; 0702	29-APR-77	CONTINUE DEVELOPMENT OF THE DN64 /MM
;
; 0703	30-APR-77	COMPLICATE STATE TABLE IN DTE20 MODULE /JBS
;
; 0704	01-MAY-77	CORRECT ORDER OF BYTES FOR HEADERS IN DTE20 /JBS/MM
;
; 0705	03-MAY-77	CLEAN-UP DATA BASE AND CODE /MM
;
; 0706	04-MAY-77	FINAL CLEANUPS BEFORE SECOND FIELD TEST
;			 AND FIX STATE 26 IN DTE20 /JBS/MM
;
; 0707	04-MAY-77	TURN ON DEBUG TO TRACE DN64A PROBLEM /JBS
;
;
; CONTINUATION OF REVISION HISTORY
;
; 0710	05-MAY-77	BEGIN DEBUGGING DUP11 CODE /JBS
;
; 0711	07-MAY-77	CONTINUE DEBUGGING DUP11 CODE /JBS
;  TO 0713
;
; 0714	11-MAY-77	FIX DTE20 TO TAKE TRANSMISSIONS LARGER 
;			 THAN 127 BYTES  /JBS
;
; 0715	14-MAY-77	IN XL3780, BE SURE WHEN ABORTING OUTPUT
;			 THE BSC TASKS'S ABORT BIT IS SET.
;			 (THERE IS APPARENTLY A RACE CONDITION
;			 THAT CLEARS IT UNDER MYSTERIOUS
;			 CIRCUMSTANCES).  /JBS
;
; 0716	14-MAY-77	PUT IN DEFENSIVE CODE FOR XMIT DATA LATE ERROR RECOVERY
;			 IN DUP11.  /JBS
;
; 0717	14-MAY-77	RESTORE R3 AND R4 IN DQKILL (DUP11) IN CASE RECEIVER
;			 ALSO HAS TO BE STOPPED.  /JBS
;
; 0720	15-MAY-77	CHECK FOR ABORT WHILE IN OUTPUT EOF PROCESSING /JBS
;
; 0721	17-MAY-77	REWRITE DUP11 INPUT INTERRUPT FOR SPEED /JBS
;
; 0722	17-MAY-77	MODIFY DUP11 OUTPUT INTERRUPT TO FIX THE
;			 OUTPUT DATA LATE PROBLEM.
;			  (REQUIRES REV. F DUP11'S)  /JBS
;
; 0723	20-MAY-77	ENABLE INTERRUPTS DURING PART OF DUP11 RECEIVER
;			 AND TRANSMITTER INTERRUPT CODE TO IMPROVE 
;			 BUS LATENCY.  /JBS
;
; 0724	20-MAY-77	TURN OFF DEBUG TO CHECK PERFORMANCE.  /JBS
;
; 0725	25-MAY-77	DO LAST-MINUTE CLEANUP PRIOR TO FIELD TEST
;			 OF DN64-A /JBS
;
; *** THIS VERSION RELEASED AS VERSION 1 OF DN61-D AND DN61-S.
;
;
; 0726	15-JUN-77	IMPROVE CRC SIMULATION ALGORITHM IN DTE20. /MM
;
; 0727  17-JUN-77	RIDE ACK ON FEH FOR PERFORMANCE IN DTE20. /MM
;
;
; CONTINUATION OF REVISION HISTORY
;
; 0730	21-JUN-77	FIX A BUG IN BSC WHICH CAUSED BUS TRAPS
;			 WHEN RUNNING FOUR LINES /JBS
;
; *** THIS VERSION RELEASED AS VERSION 1A FOR FIELD
;	TEST OF THE DN64-A.
;
; 0731	27-JUN-77	BEGIN ADDING KMC11 SUPPORT /JBS
;
; 0732	28-JUN-77	CONTINUE DEBUGGING KMC11 SUPPORT /JBS
;  TO 0734
;
; 0735	18-JUL-77	CHANGE VERSION NUMBER TO 2 AND USE VERSION
;			 2(40) OF CHK11.  DON'T LOAD MICROCODE
;			 (LET SIZE11 DO IT). /JBS
;
; 0736	21-JUL-77	REMOVE KMC11 (MICROCODE NOT READY IN TIME
;			 FOR TOPS-20 RELEASE 3 CODE FREEZE) /JBS
;
; 0737	21-JUL-77	SET DEBUG TO 0 TO TUNE FOR 4 LINES /JBS
;
; 0740	26-JUL-77	DO TEXTUAL CLEANUP FOR TOPS-20 REL 3
;			 CODE FREEZE. /JBS
;
; 0741	09-AUG-77	WHEN STARTING A KMC11, WAIT FOR IT TO
;			 SET ITS "RUN" BIT. /JBS
;
; 0742	11-AUG-77	REARRANGE LCB STATUS BITS FOR MORE
;			 CONVENIENT TESTING BY THE KMC11. /JBS
;
; 0743	17-AUG-77	CONTINUE DEBUGGING KMC11 DRIVER /JBS
;  TO 0746
;
; 0747	19-AUG-77	MAKE MSGGTE SAVE AND RESTORE KG11-A
;			 IN CASE DQKILL WAITS (KMC11) /JBS
;
; 0750	22-AUG-77	CONTINUE DEBUGGING KMC11 DRIVER /JBS
;  TO 0754
;
; 0755	24-AUG-77	INCREASE TIMEOUT TO KMC11 TO 
;			 EIGHT SECONDS /JBS
;
;
; CONTINUATION OF REVISION HISTORY
;
; 0756	25-AUG-77	CONTINUE DEBUGGING KMC11 DRIVER /JBS
;  TO 0763
;
; 0764	30-AUG-77	INCREASE SILO WARNING AREA TO 48 FOR 
;			 19.2KB LINES. /JBS
;
; 0765	30-AUG-77	CONTINUE DEBUGGING KMC11 DRIVER /JBS
;
; 0766	01-SEP-77	INCREASE SILO WARNING AREA TO 64 FOR TWO
;			 19.2KB LINES. /JBS
;
; 0767	01-SEP-77	CONTINUE DEBUGGING KMC11 DRIVER /JBS
;
; 0770	06-SEP-77	ADD "INPUT PERMISSION WAS REQUESTED"
;			 BIT TO SLOW DOWN D60SPL POLLING 
;			 CYCLE. /JBS
;
; 0771	09-SEP-77	ADD SILO SEPTH SETTING, SILO OVERFLOW
;			 RECORDING AND REPORTING OF LINE DRIVER
;			 TYPE AND XLATE OPTIONS AVAIL. /JBS
;
; 0772	09-SEP-77	INSERT A MISSING INSTRUCTION IN XL3780
;			 WHICH CAUSED FAILURES RECEIVING
;			 TRANSPARENT MESSAGES. /JBS
;
; 0773	12-SEP-77	FIX A BUG IN BSC THAT CAUSED A STOP
;			 IF THE LAST TTD REPLY BEFORE EOF
;			 WAS UNRECOGNIZABLE /JBS
;
; 0774	12-SEP-77	ADD KMC11 VERSION NUMBER TO
;			 DN60 STATUS /JBS
;
; 0775	13-SEP-77	FIX FAILURE INVOLVING DOUBLE TRAPS
;			 INTO KMC11 INTERRUPT DUE TO CLOCK
;			 TRAP AT INTERRUPT LEVEL 4.  /JBS
;
; 0776	13-SEP-77	SET DEBUG = 0 TO CHECK PERFORMANCE.
;			 ALSO, USE CHK11 2(42) WITH 'P'
;			 REMOVED. /JBS
;
;
; CONTINUATION OF REVISION HISTORY
;
; 0777	13-SEP-77	ADD CODE TO KMC11'S DQINWQ TO SLOW
;			 DOWN THE BSC TASK SO THAT THE LOWER
;			 PRIORITY TASKS CAN GET TIME.
;			 ESSENTIALLY, DONT PROCESS DATA
;			 UNLESS WE HAVE CROSSED A CHUNK
;			 BOUNDRY OR WE HAVE USED VERY
;			 LITTLE CPU TIME. /JBS
;
; 1000	14-SEP-77	RECORD AND REPORT MAX USED SILO DEPTH
;			 AND PUT MAJOR AND MINOR EDIT NUMBERS
;			 IN PREFIX SECTIONS.  /JBS
;
; 1001	14-SEP-77	REPORT CHUNK SIZE IN DN60 STATUS /JBS
;
; 1002	15-SEP-77	INCORPORATE KMC11 MICROCODE
;  TO 1003		 VERSION 1(5) AND PREPARE FOR
;			 THE SECOND FIELD TEST RELEASE
;			 OF THE DN64. /JBS
;
; 1004	16-SEP-77	EXERCISE KMC11 AFTER ESTABLISHING A
;			 NEW LCB EVEN IF NOT DEBUGGING.
;			 /JBS
;
; *** THIS VERSION RELEASED AS VERSION 1 FOR FIELD TEST
;	OF THE DN64-A.
;
; EDITS 1005 TO 1777 ARE RESERVED FOR SOFTWARE SUPPORT.
;
; 2000	10-MAY-78	CHANGES FOR HASP-MULTILEAVING FOR 
;			THE DN62/65. /MPM
;
	; 1006 22-JUN-78	BUILD INTO XL3780 A CHECK FOR MESSAGES
	;			WITH NO DATA CHUNKS SO THAT 11 DOES NOT
	;			DIE LOOKING FOR CHUNKS THAT ARE NOT THERE. /JW
	;
	; 1007 26-jun-78	2780/3780's recognize SOH as STX so make the
	;			DN60 code do it too.(don't do after IUS however)/JW
	;
	; 1010 6-JUL-78		Do not insert IRS for XLATE when doing transparent
	;			messages in SUPPORT mode otherwise blanks will be
	;			inserted in card data. /JW
	; 1011 6-JULY-78	In processing of RVI R4 gets clobbered but is needed
	;			later.  Use R1 instead. /JW
	; 1012 6-JULY-78	The routine XLASTF does not correctly report an
	;			out-of-chunks condition.
	; 1013 14-SEP-78	Correct a bug in the DL10 service for the case when
	;			the data length is exactly a multiple of the chunk
	;			size. /JW
	;
;
; 2400 	03-JAN-79	CHANGES FOR RELEASE 4.0 INTERFACE
;

;
;
;
; PARAMETERS: (THESE MAY NOT BE CHANGED; THEY ARE PRESENTED
;		HERE TO GUIDE THE READER BY AVOIDING MAGIC
;		CONSTANTS IN THE BODY OF THE CODE)
;
DEBUG=0		;SET TO 1 TO INCLUDE DEBUGGING CODE
		; OR 00 FOR PRODUCTION
FT.CHK=-1	;INCLUDE CHECKING (ALWAYS!)
FTRACE=0	;OMIT TRACING
.IIF NE,DEBUG,FTRACE=-1 ;UNLESS DEBUGGING.
CHOWNR=0	;OMIT CHUNK OWNER RECORDING
.IIF NE,DEBUG,CHOWNR=-1 ;UNLESS DEBUGGING.
JIFSEC=^D60	;CLOCK TICKS PER SECOND (APPROX)
STKLEN=76	;STACK LENGTH FOR EACH TASK
STKLEN=<<<<STKLEN+1>/CHSIZE>+1>*CHSIZE>-2
		; ROUND UP TO CHUNK SIZE
DLGNWT=^D10	;WAIT THIS MANY SECONDS AFTER A PDP-10
		; CRASH BEFORE TRYING TO COME BACK.
TRCTBL=^D1000	;ENTRIES IN TRACE TABLE (ONLY USED IF DEBUGGING)
CHOWNL=400	;ENTRIES IN CHUNK OWNER TABLE
CHLABD=^D10	;IF WE HAVE FEWER CHUNKS THAN THIS, REPLY "NAK"
		; TO A BID.
CHLACK=^D20	;IF WE HAVE FEWER CHUNKS THAN THIS, REPLY "WACK"
		; TO GOOD DATA.
CHLXLT=^D04	;IF WE HAVE FEWER CHUNKS THAN THIS, 
		; SUSPEND TRANSLATION.
CHLTEN=^D40	;IF WE HAVE FEWER CHUNKS THAN THIS, DON'T ACCEPT
		; ANY MORE MESSAGES FROM THE PDP-10.
MSGXML=2	;IF THERE ARE MORE THAN THIS MANY MESSAGES WAITING
		; TO BE TRANSMITTED BY THE BSC TASK, DON'T
		; ACCEPT ANY MORE MESSAGES FROM THE PDP-10.
DLWLMT=^D1000	;DON'T LET THE PDP-10 WRITE MORE THAN THIS MANY
		; BYTES IN ONE TRANSFER.
DQRLMT=600.	;DON'T LET THE DQ11S READ MORE THAN THIS
		; MANY BYTES IN ONE MESSAGE (OTHERWISE WILL
		; FILL CORE WITH TRAILING PADS, REDUCING
		; THROUGHPUT BADLY).
;
SYNLEN=^D100	;NUMBER OF DATA CHARACTERS PER SYNC CHARACTER
		; INSERTED TO BE SURE LINE IS SYNCHRONIZED.
;
NDHASP=6	;MAXIMUM # OF DEVICE TYPES SUPPORTED ON HASP
;
MDMXTT=^D100	;WAIT THIS LONG FOR KMC11 TO FOLLOW "ACTIVE" TOGGLE
MDMXSD=^D64	;LEAVE THIS MUCH ROOM AT THE END
		; OF THE CURRENT CHUNK FOR A RECEIVE SILO.
		; (I.E., SET SILO WARNING THIS FAR FROM END
		;  OF THE CHUNK.)
;
.IIF GE,<MDMXSD-CHDATL>,.ERROR	MDMXSD-CHDATL ;SILO WARNING AREA TOO LARGE
;
;
; LISTING CONTROL
;
	.DSABL		AMA	;USE RELATIVE ADDRESSING
.IIF NE,DEBUG,.ENABL	AMA	;UNLESS DEBUGGING
				; (MAKES LISTING LOOK BETTER)
;
	.LIST		MEB	;SEE MACRO EXPANSIONS WHEN THEY
				; GENERATE BINARY
;
.IIF NDF,FTTRLS,FTTRLS=0	;DEFAULT TO SHORT TRANSLATE TABLE LISTING
;
;
;
; DEFINITIONS OF SPECIAL EBCDIC CHARACTERS
;
EBCSOH=001	;START OF HEADER
EBCSTX=002	;START OF TEXT
EBCETX=003	;END OF TEXT
EBCHT =005	;HORIZONTAL TAB
EBCDLE=020	;DATA LINK ESCAPE
EBCNL =025	;NEW LINE
EBCIGS=035	;INTERCHANGE GROUP SEPARATOR
EBCIRS=036	;INTERCHANGE RECORD SEPARATOR
EBCIUS=037	;INTERCHANGE UNIT SEPARATOR
EBCETB=046	;END OF TEXT BLOCK
EBCESC=047	;ESCAPE (CARRIAGE CONTROL)
EBCENQ=055	;ENQUIRY
EBCSYN=062	;SYNCHRONOUS IDLE
EBCEOT=067	;END OF TRANSMISSION
EBCNAK=075	;NEGATIVE ACKNOWLEDGMENT
EBCBLK=100	;BLANK
EBCLPD=125	;LEADING PAD CHARACTER
EBCAK1=141	;ACK 1 (FOLLOWING DLE)
EBCWAK=153	;WAIT AND ACK (FOLLOWING DLE)
EBCAK0=160	;ACK 0 (FOLLOWING DLE)
EBCRVI=174	;REVERSE INTERRUPT (FOLLOWING DLE)
EBCPAD=377	;PAD AT END OF MESSAGES
;
.SBTTL	DL10 WINDOW DEFINITION
;
	.=DLBASE		; ESTABLISH BASE IN UPPER 16K
	.BLKW	1		; DL10 STATUS REGISTER
	.BLKW	2		; NOT USED
DLXNAM:	.BLKW	1		; PROGRAM NAME BYTE POINTER (SIXBIT)
	.BLKW	1		; NOT USED
DLXOK:	.BLKW	1		; PDP-11 ALIVE INDICATOR.  INCREMENTED
				;	BY 10 ONCE/SECOND.  SET 0 BY 11.
				;	IF .LT.2, 11 IS ALIVE.
DLXHLT:	.BLKW	1		; DN60 11->10 STOP CODE
DLXDWN:	.BLKW	1		; 1=>UP, 0=>DOWN & TELL OPR, -1=>DOWN & QUIET
DLXUPT:	.BLKW	1		; NOT USED
DLXSWD:	.BLKW	1		; GLOBAL STATUS WORD
	DLS.DP=1		;DEPOSIT 11 CORE
	DLS.EX=2		;EXAMIN 11 CORE
	GBADDR=4		; DLXADR IS BAD
	GHOLD=10		; HOLD EVERYTHING
DLXADR:	.BLKW	1		; ADDRESS FOR LOAD/STORE IN 11 CORE
DLXDAT:	.BLKW	1		; CONTENTS OF CONTENTS OF DLXADR
DLXREC:	.BLKW	1		;MAX RECORD LENGTH
DLXMOD:	.BLKW	1		; MODIFICATION NUMBER
	WINVER=3		;WINDOW VERSION NUMVER
DLXTA:	.BLKW	1		; PDP-10 ALIVE INDICATOR.  INCREMENTED
				;	BY 11 ONCE/SECOND.  SET -1 BY
				;	10.  IF .LE.1, 10 IS ALIVE.
DLXTS:	.BLKW	1		; STATUS OF 10.  0 INITIALLY
				;		+1 STARTED INITIALIZATION
				;		-1 RUNNING
DLXES:	.BLKW	1		; STATUS OF 11.  0 INITIALLY
				;		+1 STARTED INITIALIZATION
				;		-1 RUNNING
DLXMXL:	.BLKW	1		; MAXIMUM NUMBER OF LINES ON DN60
DLXLT1:	.BLKW	1		;PLACE TO PUT "NULL TIME" LIGHTS
DLXLT2:	.BLKW	1		; (TWO WORDS FOR 32 BITS)
;
;
; CONTINUATION OF DL10 WINDOW
;
DLXOPE:	.BLKW	1		;11-OPERATION:
				; 0 = IDLE
				; 1 = REQUEST TO READ DATA
				; 2 = REQUEST TO WRITE DATA
				; 3 = REQUEST TO READ DEVICE STATUS
				; 4 = REQUEST TO WRITE DEVICE STATUS
				; 5 = REQUEST TO READ LINE STATUS
				; 6 = REQUEST TO WRITE LINE STATUS
DLXLNE:	.BLKW	1		;LINE NUMBER OF OPERATION
DLXDVE:	.BLKW	1		;DEVICE NUMBER OF OPERATION
DLXOPX:	.BLKW	1		;10-OPERATION CODE
				; 0 = IDLE
				; 1 = READ DATA (INTO 10)
				; 2 = WRITE DATA (FROM 10)
				; 3 = READ DEVICE STATUS
				; 4 = WRITE DEVICE COMMAND
				; 5 = READ LINE STATUS
				; 6 = WRITE LINE COMMAND
				; 7 = READ DN60 STATUS
				; 8 = WRITE DN60 COMMAND
DLXLNX:	.BLKW	1		;LINE NUMBER OF OPERATION
DLXDVX:	.BLKW	1		;DEVICE NUMBER OF OPERATION
DLXRST:	.BLKW	1		;RESULT CODE
DLXXFR:	.BLKW	1		;NUMBER OF BYTES TRANSFERED
DLXCBP:	.BLKW	40		;PAIRS OF COUNT,BYTE POINTER
;
; EACH PAIR WORKS AS FOLLOWS:
;
;  WHEN A DATA TRANSFER IS SET UP, THE 10 USES AS MANY
;  PAIRS AS NEEDED TO FOLLOW THE USER'S PAGE MAP.  WHEN A
;  COUNT IS DECREMENTED TO ZERO THE NEXT PAIR IS USED.
;  IF A COUNT IS FOUND TO BE ZERO, THIS IS THE END.
;
DLEND:	.BLKW	0		; END OF WINDOW USED PART
;
	.BLKB	DLBASE+128.-DLEND ;UNUSED PART OF 64. WORD WINDOW
;
;THIS DEFINES THE DEVICE QUEUE POINTERS AND FUNCTION CODES
; FOR THE RSX-20F QUEUED PROTOCOL.
;
;	DEVICE QUEUE POINTERS
;
DLDCTY	=1	;DEVICE CODE FOR CTY
DLDL11	=2	;DEVICE CODE FOR DL11
DLDH11	=3	;DEVICE CODE FOR DH11 (1)
DLDDLS	=4	;DEVICE CODE FOR DATA LINE SCANNER (1)
DLDLPT	=5	;DEVICE CODE FOR LPT
DLDCDR	=6	;DEVICE CODE FOR CDR
DLDCLK	=7	;DEVICE CODE FOR CLOCK
DLDPFE	=10	;PSEUDO DEVICE FOR FE
DLDDAS	=12	;DN61 DEVICE CODE 
;
DLDCPU	=200	;PSEUDO DEVICE PDP10 CPU
DLDKLE	=201	;KL ERROR PSEUDO DEVICE
;
; TO ELEVEN QUEUE ENTRY
;
;	FUNCTION CODE DEFINITIONS
;
DTFRQD	=1	;REQUEST DEVICES
DTFHAD	=2	;HERE ARE DEVICES
DTFSTR	=3	;STRING DATA
DTFLNC	=4	;LINE/CHARACTER DATA
DTFRDS	=5	;RETURN DEVICE STATUS
DTFSDS	=6	;SET DEVICE STATUS
DTFHDS	=7	;HERE IS DEVICE STATUS
DTFDES	=10	;DEVICE ERROR STATUS
DTFRTD	=11	;RETURN TIME OF DAY
DTFHTD	=12	;HERE IS TIME OF DAY
DTFFOD	=13	;FLUSH OUTPUT DEVICE QUEUE
DTFSNA	=14	;SEND ALL 
DTFTDU	=15	;DEVICE DIAL UP
DTFTHU	=16	;DEVICE HANG UP
DTFSAK	=17	;ACKNOWLEDGE DEVICE DONE
DTFXOF	=20	;X-OFF (TTY ONLY)
DTFXON	=21	;X-ON (TTY ONLY)
DTFSTS	=22	;SET TTY SPEED
DTFSLA	=23	;set line allocation
DTFBTP	=24	;11 REBOOT WORD
DTFAKA	=25	;ACK ALL
DTFSPT	=26	;START/STOP LINE
DTFEDR	=27	;ENABLE/DISABLE REMOTES
DTFLDR	=30	;LOAD LP RAM
DTFLDV	=31	;LOAD LP VFU
DTFDAS	=32	;DN60 FUNCTION DATA
DTFFNM	=33	;1 GREATER THAN MAX FUNCTION
;
;
;	DTE20 COMMUNICATION AREA OFFSETTS (WORD NAMES)
;
DLPID=0	;PROCESSOR IDENTIFICATION WORD
DLPNA=1	;POINTER TO COMM AREA OF NEXT PROCESSOR (CIRC LIST)
DLCPS=2		;CLOCK CPS COUNT
DLTOD=3		;TIME OF DAY
DLDATE=4		;DLDATE
DLPW1=5		;PROCESSOR STATUS WORD1
DLPW2=6		;PROCESSOR STATUS WORD2
DLPW3=7		;PROCESSOR STATUS WORD3
DLPW4=10	;PROCESSOR STATUS WORD4
DLPW5=11	;PROCESSOR STATUS WORD5
DLPW6=12	;PROCESSOR STATUS WORD6
DLPW7=13	;PROCESSOR STATUS WORD7
DLPW10=14	;PROCESSOR STATUS WORD10
DLPW11=15	;PROCESSOR STATUS WORD11
DLPW12=16	;PROCESSOR STATUS WORD12
DLPW13=17	;PROCESSOR STATUS WORD13
DLPIN=20	;FOR PROCESSOR IDENTIFICATON WORD
DLPCA=21	;POINTER TO COMM AREA OF THE PROCESSOR ASSOC WITH THIS BLOCK
DLSTAT=22	;COMMUNICATION STATUS WORD
DLXFSZ=23	;QUEUE SIZE WORD
;DLT0CW=24	;CTY #0 COMMAND WORD
;DLT0RW=25	;CTY #0 RESPONSE WORD
;DLT1CW=26	;CTY #1 COMMAND WORD
;DLT1RW=27	;CTY #1 RESPONSE WORD
;MISCW=30	;MISCELLANEOUS COMMAND WORD FOR NON-QUEUE PROTOCOL
;MISRW=31	;MISCELLANEOUS RESPONSE WORD
DLUNS1=32	;UNASSIGNED WORD1
DLUNS2=33	;UNASSIGNED WORD2
DLUNS3=34	;UNASSIGNED WORD3
DLUNS4=35	;UNASSIGNED WORD4
DLUNS5=36	;UNASSIGNED WORD5
DLUNS6=37	;UNASSIGNED WORD6
;
;
; FOR SENDING TO TEN, THE FOLLOWING STATUS DEFINITIONS ARE USED
;	STATUS DEFINITONS
;
DLTOIT=1		;IN PROGRESS OF PROCESSING QUEUE
DLTHIP=2		;TO HIM INDIRECT IN PROGRESS
DLTHBM=4		;TO HIM WORD MODE REQUESTED
DLLD11=4		;LOAD ELEVEN
;
.SBTTL	INPUT SILO CONTROL BLOCK
;
; THIS MUST BE DEFINED BEFORE THE LINE CONTROL BLOCK, SINCE
;  THE LCB CONTAINS TWO OF THEM.
;
.=0
;
MDSLFG:	.BLKW	1	;FLAGS
MDSLFE=B0		;KMC11 SHOULD INTERRUPT THE
			; PDP-11 WHEN STORING DATA IN THE SILO
MDSLFF=B1		;SILO IS FULL
MDSLFO=B2		;SILO HAS OVERFLOWED
MDSLFW=B4		;SILO HAS REACHED WARNING LEVEL
MDSLPG=B7		;KMC11 HAS GOTTEN THE POINTERS BELOW
MDSLPT:	.BLKW	1	;SILO POINTER - NEXT CHAR GOES HERE
MDSLPW:	.BLKW	1	;SILO WARNING LEVEL
MDSLPL:	.BLKW	1	;SILO LIMIT
;
; END OF AREA KNOWN TO THE KMC11 MICROCODE
;
MDSLCC:	.BLKW	1	;POINTER TO CURRENT CHUNK
	.EVEN
MDSLLN:	.BLKW	0	;LENGTH OF SILO AREA
;
.SBTTL	LINE BLOCK OFFSETS
;
.=0
;
LB.STS:	.BLKW	1	;STATUS BITS - SOME KNOWN TO KMC11
;
	LS.ENB=B15	;THE LINE HAS BEEN "ENABLED"
	LS.ERR=B14	;THERE HAS BEEN AN ERROR ON THE LINE
	LS.RSE=B13	;THE RECEIVE SILO HAS BEEN EMPTIED
			; (KMC11 ONLY)
	LS.KLC=B12	;THE "KILL" OPERATION HAS COMPLETED
			; (ONLY ON KMC11)
	LS.RGO=B11	;WAITING FOR CARRIER TO START RECEIVER
			; (ON KMC11, WAITING FOR WRITE INITIATION
			; TO START RECEIVER)
	LS.XGO=B10	;WAITING FOR DELAYED CLEAR-TO-SEND TO
			;  START TRANSMITTER
	LS.RRN=B9	;RECEIVER RUNNING
	LS.XRN=B8	;TRANSMITTER RUNNING
;
	LS.ACT=LS.RGO!LS.RRN!LS.XGO!LS.XRN ;NON-ZERO = ACTIVITY
;
	LS.MDE=B7	;THE KMC11 HAS DETECTED AN ERROR
			; (KMC11 ONLY)
	LS.XND=B6	;TRANSMISSION IS ENDING
			; (ONLY WITH DUP11) 
	LS.CAR=B5	;WE HAVE SEEN CARRIER SINCE STARTING RECEIVER
			; (ONLY WITH DUP11 AND KMC11) 
	LS.CTL=B4	;THE WRITE IS OF A CONTROL MESSAGE
	LS.LWR=B3	;LAST WRITE - DONT FOLLOW BY A READ
	LS.CIE=B2	;POST BSC TASK ON NEXT CHARACTER
			; (ONLY WITH DUP11 AND KMC11) 
	LS.CMP=B1	;FUNCTION COMPLETE
			; (ONLY WITH KMC11) 
	LS.KIL=B0	;KILL CURRENT FUNCTION
			; (ONLY WITH KMC11) 
;
LB.LNU:	.BLKW	1	;LINE NUMBER
LB.SLA:	.BLKW	1	;ADDRESS OF DQ11/DUP11 CSR
LB.SLV:	.BLKW	1	;ADDRESS OF DQ11/DUP11 INTERRUPT VECTOR
LB.MSG:	.BLKW	1	;POINTER TO MESSAGE BEING SENT 
LB.CMA:	.BLKW	1	;POINTER TO CONTROL MESSAGE BEING SENT 
LB.CMC:	.BLKW	1	;LENGTH OF CONTROL MESSAGE BEING SENT 
.IF NE,FT.KMC
LB.SLO:	.BLKW	1	;POINTER TO INPUT SILO CONTROL BLOCK
;
; END OF AREA KNOWN TO THE KMC11 MICROCODE
;
;
; LINE BLOCK CONTINUED
;
LB.SO1:	.BLKB	MDSLLN	;FIRST KMC11 SILO
LB.SO2:	.BLKB	MDSLLN	;SECOND KMC11 SILO
LB.MD:	.BLKW	1	;POINTER TO KMC11 CONTROL BLOCK
.ENDC ;.IF NE,FT.KMC
;
LB.ST1:	.BLKW	0	;BEGINNING OF BSC STATISTICS SENT TO '10
LB.SE1:	.BLKW	1	;COUNT OF LINE ERROR INTERRUPTS
LB.SE2:	.BLKW	1	;STATUS REG 1 AT LAST ERROR
LB.SE3:	.BLKW	1	;STATUS REG 2 AT LAST ERROR
LB.SE4:	.BLKW	1	;COUNT OF RECEIVER "NOT FAST ENOUGH"
LB.SE5:	.BLKW	1	;COUNT OF TRANSMITTER "NOT FAST ENOUGH"
LB.SE6:	.BLKW	1	;COUNT OF CLEAR-TO-SEND FAILURES
;
; BSC STATISTICS RECORDED DURING OUTPUT
;
LB.OC1:	.BLKW	1	;COUNT OF MESSAGES SENT AND ACKED
LB.OC2:	.BLKW	1	;COUNT OF NAKS RECEIVED (+WRONG ACK AFTER TIMEOUT)
LB.OC3:	.BLKW	1	;COUNT OF INVALID RESPONSES TO TTD
LB.OC4:	.BLKW	1	;COUNT OF INVALID RESPONSES TO MESSAGES
LB.OC5:	.BLKW	1	;COUNT OF TTDS SENT
LB.OC6:	.BLKW	1	;COUNT OF WACKS RECEIVED IN RESPONSE TO MESSAGES
LB.OC7:	.BLKW	1	;COUNT OF EOTS (ABORTS) IN RESPONSE TO MESSAGES
LB.OC8:	.BLKW	1	;COUNT OF INVALID BIDS OR RESPONSES TO BIDS
LB.OC9:	.BLKW	1	;COUNT OF RVIS RECEIVED WHILE TRANSMITTING
;
; STATISTICS RECORDED DURING INPUT
;
LB.IC1:	.BLKW	1	;COUNT OF MESSAGES RECEIVED OK
LB.IC2:	.BLKW	1	;COUNT OF BAD BCCS
LB.IC3:	.BLKW	1	;COUNT OF NAKS SENT IN RESPONSE TO DATA MESSAGES
LB.IC4:	.BLKW	1	;COUNT OF WACKS SENT
LB.IC5:	.BLKW	1	;COUNT OF TTDS RECEIVED
LB.IC6:	.BLKW	1	;COUNT OF EOTS SENT OR RECEIVED WHICH ABORT THE STREAM
LB.IC7:	.BLKW	1	;COUNT OF MESSAGES IGNORED (OUT OF CHUNKS,
			;  UNRECOGNIZABLE OR TIMEOUT)
LB.IC8:	.BLKW	1	;COUNT OF MESSAGES WITH INVALID CHAR AFTER DLE
			; (TRANSPARENT ONLY)
LB.IC9:	.BLKW	1	;COUNT OF ATTEMPTS TO CHANGE BETWEEN
			;  TRANSPARENT AND NORMAL MODE IN A
			;  MESSAGE (BLOCKED MESSAGES ONLY)
LB.TTO:	.BLKW	1	;COUNT OF TRANSMITTER TIME-OUTS.
LB.CSD:	.BLKW	1	;CLEAR-TO-SEND DELAY IN JIFFYS
;
;
; CONTINUATION OF LINE CONTROL BLOCK
;
; MISCELLANEOUS INFORMATION REPORTED TO THE -10
;
LB.SE7:	.BLKW	1	;COUNT OF SILO OVERFLOWS
LB.MDS:	.BLKW	1	;LENGTH OF SILO WARNING AREA
LB.MDU:	.BLKW	1	;MAX AMOUNT OF SILO WARNING AREA USED
LB.MBL:	.BLKW	1	;MAXIMUM TRANSMISSION BLOCK LENGTH
			; 0 MEANS NO BLOCKING
			; MUST BE SET TO 400. FOR 2780 AND HASP
			; AND 512. FOR 3780 MODE OF RJE OPERATION
LB.MLR:	.BLKW	1	;MAXIMUM  LOGICAL RECORDS PER MESSAGE
			; 0 = UNLIMITED
			; NORMALLY SET AS FOLLOWS:
			;   0 FOR IBM 3780 AND HASP
			;   2 FOR IBM 2780 WITHOUT MULTI-RECORD
			;   7 FOR IBM 2780 WITH MULTI-RECORD
			; SINCE DEPTH LAST SET.


LB.SIG:	.BLKW	1	;;++BS- LINE SIGNATURE

LB.TYP:	.BLKW	1	;LINE DRIVER TYPE 3(011)
			; 1 = DQ11,
			; 2 = KMC11/DUP11,
			; 3 = DUP11 WITHOUT KMC11

LB.ST2:	.BLKW	0	;END OF BSC STATISTICS SENT TO '10
;
;
; LINE BLOCK CONTINUED
;
LB.NTC:	.BLKW	1	;NUMBER OF TCB'S BUILT FOR XLATE TASKS
LB.EQW:	.BLKW	1	;TIME TO WAIT FOR ENQ (DEFAULT = 1 SEC)
LB.EQN:	.BLKW	1	;NUMBER OF ENQ'S TO SEND (DEFAULT = 3)
LB.DEW:	.BLKW	1	;TICKS TO WAIT BEFORE ENABLING MODEM INTERRUPTS
LB.RTY:	.BLKW	1	;TIMES TO RETRY TRANSMISSION OPERATION
LB.RRY:	.BLKW	1	;TIMES TO RETRY RECEIVE OPERATION
LB.CH1:	.BLKW	1	;POINTER TO PRIMARY CHUNK (INPUT)
LB.CH2:	.BLKW	1	;POINTER TO SECONDARY CHUNK (INPUT)
LB.CH3:	.BLKW	1	;POINTER TO PRIMARY CHUNK (OUTPUT)
LB.CH4:	.BLKW	1	;POINTER TO SECONDARY CHUNK (OUTPUT)
LB.MSC:	.BLKW	1	;COUNT OF MESSAGES WAITING TO BE SENT
			; (INCLUDES MESSAGE IN LB.MSG, IF ANY)
LB.CHD:	.BLKW	1	;COUNT OF TIMES CHUNKS DEPLETED
LB.TC1:	.BLKW	1	;POINTER TO TCB FOR BSC DRIVER
LB.TCD:	.BLKW	NDHASP	;POINTER TO TCB FOR TRANSLATER (FOR ALL DEVICES)
LB.DIC:	.BLKW	1	;COUNT OF DATASET INTERRUPTS
LB.DIS:	.BLKW	1	;STATUS OF DATASET INTERRUPT
LB.DIP:	.BLKW	1	;STATUS OF DATASET INTERRUPT
			; PROCESSED (DUP11 ONLY)
LB.ERS:	.BLKW	1	;ERROR BITS STORED HERE
LB.XCL:	.BLKW	1	;COUNT OF TIMES TRANSMITTER CLOCK LOST
LB.RCL:	.BLKW	1	;COUNT OF TIMES RECEIVER CLOCK LOST
LB.XST:	.BLKW	1	;LAST TRANSMITTER STATUS REGISTER
LB.XCT:	.BLKW	1	;COUNT OF TRANSMIT AND STATUS INTERRUPTS
LB.RST:	.BLKW	1	;LAST RECEIVER STATUS REGISTER
LB.RCT:	.BLKW	1	;COUNT OF RECEIVER INTERRUPTS
LB.CCH:	.BLKW	1	;CHUNK CURRENTLY BEING RECEIVED
LB.CCR:	.BLKW	1	;POINTER TO CURRENT RECEIVE COUNT REG IN DQ11
			; (IN DUP11, POINTER TO LENGTH FIELD OF CHUNK
			; BEING FILLED)
LB.CCD:	.BLKW	1	;IN DUP11, POINTER TO CURRENT DATA LOCATION
			; IN CHUNK BEING FILLED.
LB.DVT:	.BLKW	1	;DEVICE TYPE (1 = IBM 3780, 2=IBM 2780
			; 3 = HASP-MULTILEAVING)
LB.FGS:	.BLKW	1	;FLAGS (VISIBLE TO 10):
	LF.SIM=B0	;SIMULATE (AS OPPOSED TO SUPPORT) MODE
	LF.PRI=B1	;PRIMARY (AS OPPOSED TO SECONDARY) BSC
	LF.SON=B2	;LINE IS SIGNED ON
	LF.TSP=B3	;OUTPUT TRANSPARENT ON THE LINE
	LF.DIP=B4	;LINE DISABLE IN PROGRESS
	LF.ENC=B5	;LINE ENABLE COMPLETE
	LF.ABC=B6	;LINE ABORT COMPLETE
	LF.OFL=B7	;OUTPUT DEVICE OFF LINE
	LF.DAC=B8	;LINE DISABLE COMPLETE
	LF.DIS=B9	;DISABLE DONE BY DTE FAILURE
	LF.HWA=B10	;HARDWARE ABORT DUE TO LINE CONDITION 4(006)
	LF.CME=B11	;COMMUNICATIONS ESTABLISHED,MESSAGE WAS TX OR RX 4(006)
LB.CRD:	.BLKW	1	;NUMBER OF CHARACTERS READ SO FAR IN THIS
			; MESSAGE.
.IF NE,DEBUG
LB.RG0:	.BLKW	1	;SPACE TO STORE DQ11 REGS ON STOP CODE
LB.RG1:	.BLKW	1
LB.RG2:	.BLKW	1
LB.RG3:	.BLKW	1
LB.RGI:	.BLKW	20	;SPACE FOR DQ11 INTERNAL REGISTERS
.ENDC ;.IF NE,DEBUG
;
LB.SIZ:	.BLKW	0	;LENGTH OF LINE BLOCK
;
.IF DF,FT2020
;SPECIAL LINE BLOCK DEFINITIONS FOR THE DMC11( ON A 2020)
.MACRO	X	Q,L
	LB.'Q=$BEG+$OFFSET
.IF NB,L
	$OFFSET=$OFFSET+'L
.IFF
	$OFFSET=$OFFSET+2
.ENDC
.ENDM
$BEG=LB.OC1	;[4(004)]START DMC11 LCB DEFINITIONS HERE
$OFFSET=0
X	IUC	;# INPUT BUFFERS CURRENTLY QUEUED TO DMC11
X	OUC	;# OUTPUT BUFFERS CURRENTLY QUEUED TO DMC11
X	IB,4	;QUEUE OF INPUT BUFFERS READY FOR DMC TASK
X	IN,4	;QUEUE IF INPUT BUFFERS QUEUED TO DMC11
X	BAS	;ADDRESS OF DMC BASE AREA
X	POR,4	;PORT DATA FOR DMC11
X	OBF,6	;QUEUE OF BUFFERS READY TO OUTPUT TO DMC11
X	FR,4	;QUEUE OF FREE DMC BUFFERS
DM.SIZ=$BEG+$OFFSET	;SIZE OF LCB FOR DMC SYNCHRONOUS LINE

;BITS DEFINITIONS FOR LB.STS FOR DMC LINE TO 2020 
	LS2MAI=B0			;maintenance mode
	LS2INI=B1			;DMC11 has been initialized
	LS2RST=B2			;start message received
	LS2WAI=B3			;waiting for chunks
	LS2EMM=B4			;entering maintenance mode
	LS2IBY=B7			;input port busy (must be byte sign)
	LS2DMC=LS2MAI!LS2INI!LS2RST!LS2WAI!LS2IBY
.ENDC
.SBTTL	KMC11 CONTROL BLOCK
;
; THERE IS ONE OF THESE CONTROL BLOCKS FOR EACH KMC11.
;
.=0
;
MDFGE:	.BLKW	1		;11-FLAGS:
MDFER=B0			;11-RUNNING (SET WHEN FIRST LINE
				; IS ENABLED)
MDFEA=B4			;ACTIVE TOGGLE
;
MDFGK:	.BLKW	1		;KMC FLAGS:
MDFKR=B0			;KMC RUNNING
MDFKA=B4			;KMC ACTIVE RESPONSE
;
MDALE:	.BLKW	1		;11-ALIVE COUNTER
MDALK:	.BLKW	1		;KMC-ALIVE COUNTER
MDLCB:	.BLKW	4		;LCB POINTERS (UP TO 4)
;
; END OF THE AREA KNOWN TO KMC11 MICROCODE
;
MDTIC:	.BLKW	1		;COUNTER FOR ONE SECOND CODE
MDALKS:	.BLKW	1		;PREVIOUS COPY OF KMC ALIVE COUNTER
;
MDTLN:	.BLKW	0		;LENGTH OF KMC11 CONTROL BLOCK
;
.SBTTL	TASK CONTROL BLOCK
;
.=0
TCEW:	.BLKW	1	;EVENT WORD
;
;	WAIT BIT DEFINITIONS
;
EBFCHK=000100		;WAITING FOR FREE CHUNK
EBQCHK=040000		;WAITING FOR QUE-ED CHUNK
EBINTR=020000		;WAITING FOR DEVICE INTERRUPT ROUTINES
EBCOMP=010000		;WAITING FOR $COMPQ TO DRAIN
EBTENI=004000		;WAITING FOR TEN INTERRUPT
EBQMSG=002000		;WAITING FOR A MESSAGE
EBPERM=001000		;WAITING FOR PERMISSION FROM HASP
EBDATA=000400		;WAITING FOR QUE TO NEED DATA
EBREQP=000200		;WAITING FOR HASP TO REQUEST PERMISSION
EBOPER=000040		;WAITING FOR OPERATOR RESPONSE
EBTIME=000020		;WAITING FOR TIMER
EBTXDN=000010		;WAITING FOR TO TEN DONE INTERRUPT
.IIF NDF,FT2020, EBTEDN=000004		;WAITING FOR TO ELEVEN DONE INTP
.IIF DF,FT2020, EBINP=4	;WAITING FOR DMC INPUT
EBVALE=000002		;WAITING FOR VALID EXAMINE
EBWAIT=000001		;WAITING
;
TCHAIN:	.BLKW	1	;POINTER TO NEXT TASK CONTROL BLOCK
TCPC:	.BLKW	1	;TASK'S PC WHEN INACTIVE
TCPS:	.BLKW	1	;TASK'S PS WHEN INACTIVE
TCSP:	.BLKW	1	;TASK'S STACK POINTER WHEN INACTIVE
TCSPT:	.BLKW	1	;POINTER TO BASE OF STACK STORAGE
TCMSG1:	.BLKW	1	;POINTER TO OLDEST MSG QUEUED TO THIS TASK
TCMSG2:	.BLKW	1	;POINTER TO NEWEST MSG QUEUED TO THIS TASK
.IF NE,DEBUG
TCMSG3:	.BLKW	1	;COUNT OF MESSAGES QUEUED TO THIS TASK
.ENDC ;.IF NE,DEBUG
TCCHK1:	.BLKW	1	;POINTER TO NEWEST CHUNK QUEUED TO THIS TASK
TCGMC:	.BLKW	1	;COUNTER FOR WAITING FOR STORAGE
TCLCB:	.BLKW	1	;POINTER TO LCB FOR THIS TASK
TCTIM:	.BLKW	1	;WAIT TIME IN JIFFIES
;
;
; CONTINUATION OF TASK CONTROL BLOCK DEFINITION
;
TCST2:	.BLKW	1	;SECONDARY STATUS BITS:
;
TCLBK=B0		;THE CURRENT OUTPUT PRINT LINE HAS BEEN
			; BROKEN.
TCDTA=B1		;THERE IS SOME DATA IN THIS RECORD (USED
			; TO DISTINGUISH TTD FROM IMBEDDED ENQ).
TCEOT=B2		;AN EOT HAS BEEN SENT OR RECEIVED
			; SO IT IS NOT NECESSARY TO SEND ANOTHER
			; TO ABORT THE TRANSMISSION.
TCESC=B3		;SET IF THE LAST CHARACTER FOR INPUT
			; TRANSLATION IN PRINTER MODE
			; WAS AN ESCAPE.
TCIGS=B4		;SET IF THE LAST CHARACTER FOR INPUT
			; TRANSLATION WAS AN IGS.
TCXET=B5		;RECEIVED BLOCK ENDED IN ETX, EXPECT
			; AN EOT NEXT.
TCAK1=B6		;SENDING: NEXT ACK EXPECTED IS ACK1
			;RECEIVING: LAST ACK RESPONSE WAS ACK1
TCNRD=B7		;NO RESPONSE TO DATA MESSAGE.  AFTER
			; SENDING AN ENQ, ACCEPT WRONG ACK AS
			; MEANING NAK.
TCHGST=B8		;ON INDICATES HASP STATUS CHANGED IN FCS
			;THIS ENABLES LATEST STATUS TO BE TRANSMITTED
			;TO THE HASP SIDE
TCEOR=B9		;INDICATES E-O-R RECEIVED FROM HASP
TCETB=B10		;INDICATES ETB RECEIVED FROM HASP
;
;
; CONTINUATION OF THE TASK CONTROL BLOCK
;
TCFG1:	.BLKW	1	;FLAG BITS (VISIBLE TO THE PDP-10):
;
TCIRH=B3		;;++KR-input permission request held 3(010)
TCPRI=B4		;INTERPRET PRINTER CARRIAGE CONTROL ON INPUT
TCPRO=B5		;INTERPRET PRINTER CARRIAGE CONTROL ON OUTPUT
TCTSP=B6		;DO OUTPUT IN TRANSPARENT BSC
TCCMP=B7		;DO COMPONENT SELECTION
TCCPS=B8		;USE COMPRESS/EXPAND FUNCTIONS
TCPCO=B9		;PAGE COUNTER HAS OVERFLOWED
TCPCE=B10		;PAGE COUNTER INTERRUPTS ENABLED
TCOBS=B11		;USE OLD BSC PROTOCOL: IUS, ETB AND ETX IMPLY
			; IRS, THERE IS NO "PRINT-NOSPACE" FUNCTION,
			; AND CARDS ARE PADDED TO 80 CHARACTERS
TCDMP=B12		;OUTPUT BEING DUMPED [1(627)]
TCIPH=B13		;SEND INPUT PERMISSION GRANTED TO HASP =1
TCIOM=B14		;FLAG FOR INPUT MODE (=1) FOR HASP DEVICES
TCOTC=B15		;FLAG FOR OUTPUT EOF OR DUMP SET BY XALTE
			;CLEARED BY BSC TASK WHEN ALL DATA IS SHIPPED
;
TCFG2:	.BLKW	1	;MORE FLAG BITS (ALSO VISIBLE TO THE PDP-10)
;
TCOPR=B0		;OUTPUT PERMISSION REQUESTED
TCOPG=B1		;OUTPUT PERMISSION GRANTED
TCORN=B2		;OUTPUT RUNNING
TCOEF=B3		;OUTPUT EOF SIGNALED
TCIEF=B3		;INPUT EOF RECEIVED
TCOEC=B4		;OUTPUT EOF COMPLETE
TCOAB=B5		;OUTPUT ABORT STARTED
TCOAC=B6		;OUTPUT ABORT COMPLETE
TCIPR=B7		;INPUT PERMISSION REQUESTED
TCIPG=B8		;INPUT PERMISSION GRANTED
TCIRN=B9		;INPUT RUNNING
TCIAB=B10		;INPUT ABORT STARTED
TCIAC=B11		;INPUT ABORT COMPLETED
TCIEC=B12		;INPUT EOF COMPLETED
TCIWR=B13		;INPUT PERMISSION WAS REQUESTED [2(770)]
TCOWR=B14		;OUPUT PERMISSION WAS REQUESTED (HASP)
TCDSP=B15		;DEVICE'S OUTPUT SUSPENDED BY HASP
			;IN BSC TCB TCDSP SET IMPLIES UNIVERSAL SUSPENSION OF ALL DEVICES
;
TCMSG:	.BLKW	1	;POINTER TO CURRENT MESSAGE
;
; CONTINUATION OF TASK CONTROL BLOCK
;
TCSSA:			;START OF AREA SPECIFIC TO EACH TASK TYPE
;
; THE FOLLOWING ARE USED ONLY BY THE TRANSLATION TASKS
;
.=TCSSA
TCBFP:	.BLKW	1	;POINTER TO LINE BUFFER
TCBFC:	.BLKW	1	;LENGTH OF LINE BUFFER
TCHPS:	.BLKW	1	;CURRENT HORIZONTAL POSITION (0 = LEFT MARGIN)
TCVPS:	.BLKW	1	;CURRENT VERTICAL POSITION (0 = TOP OF PAGE)
TCRSZ:	.BLKW	1	;DEVICE RECORD SIZE ( DEFAULT = 132 FOR LPT
			; AND = 80 FOR CARD READER AND PUNCH UNITS)
TCPGC:	.BLKW	1	;PAGE COUNT REGISTER
TCDVT:	.BLKW	1	;DEVICE TYPE
TCDEV:	.BLKW	1	;DEVICE NUMBER FOR THIS XLATE TASK
TCIMC:	.BLKW	1	;COUNT OF INCOMING MESSAGES QUEUED TO XLATE TASK
TCCCI:	.BLKW	1	;INPUT CARRIAGE CONTROL CHARACTER
TCCTP:	.BLKW	1	;COMPONENT TYPE: 0 = UNKNOWN,
			; 1 = PRINTER, 2 = PUNCH.
TCHFU:	.BLKW	160./16. ;HORIZONTAL TAB STOPS (1 BIT PER
			; POSITION, SET = STOP.)
TCSBF:	.BLKW	1	;START OF BUFFER FOR COMPRESSED DATA
TCEBF:	.BLKW	1	;END OF BUFFER FOR COMPR DATA
TCELB:	.BLKW	1	;PTR TO THE END OF LINE BUFFER
TCPRCB:	.BLKW	1	;POINTER TO THE RCB
TCCSCB:	.BLKW	1	;CURRENT  SCB BEING FORMED
TCPSCB:	.BLKW	1	;POINTER TO SCB
TCXPCH:	.BLKW	1	;POINTER TO RECEIVED DATA CHUNK (NEXT)
TCMSC:	.BLKW	1	;COUNT OF MESSAGES QUEUED BY THIS DEVICE
TCCEOF:	.BLKW	1	;COUNT EOF SENT TO BSC
TCCRQT:	.BLKW	1	;COUNT REQUESTS SENT TO REMOTE
TCCDPG:	.BLKW	1	;COUNT PERMISSION GRANTS RECEIVED
TCHCNT:	.BLKW	1	;COUNT OF CHARACTERS RECEIVED IN RECORD
;
TCSIZE=.		;LENGTH OF A TASK CONTROL BLOCK
;
; THE FOLLOWING ARE USED ONLY BY THE BSC TASKS
;
.=TCSSA
;
TCCMA:	.BLKW	1	;CONTROL MESSAGE TO PROMPT FOR NEXT DATA
			; MESSAGE WHEN READING, OR 0
TCCMC:	.BLKW	1	;LENGTH OF THE ABOVE CONTROL MESSAGE
TCRDVT:	.BLKW	1	;CURRENT DEVICE #
TCBSCF:	.BLKW	1	;MISCELLANEOUS FLAGS
;
TCITSP=B0		;INPUT RECEIVED IN TRANSPARENT MODE
TCDIDO=B1		;LAST OPERATION XMIT=1 (RECEIVE=0)
TCSTMS=B2		;STATUS OR MESSAGE WAS SENT IN XMIT
TCSONM=B3		;SIGNON WAS QUEUED TO BSC TASK TO XMIT
TCDTMS=B4		;FLAG TO INDICATE DATA MESSAGE WAS IN T.B.
TCSLMS=B5		;FLAG TO INDICATE CONSOLE MESSAGE
;
TCSTB:	.BLKW	1	;PTR TO START OF TRANSMISSION BLOCK
TCRBCB:	.BLKW	1	;CURRENT RECEIVED BLOCK COUNT
TCXBCB:	.BLKW	1	;EXPECTED BLOCK COUNT
TCTBCB:	.BLKW	1	;BLOCK COUNT FOR TRANSMIT
TCPBCB:	.BLKW	1	;BLOCK COUNT FOR REPRTING BCB ERROR
TCRFCS:	.BLKW	1	;RECEIVED FUNCTION CONTOL BYTE 1
TCTFCS:	.BLKW	1	;FUNCTION CONTROL WORD TO TRANSMIT
TCPFCS:	.BLKW	1	;FOR PREV FCS
TCCRCB:	.BLKW	1	;CURRENT RECEIVED RECORD CONTROL BYTE
TCSRCB:	.BLKW	1	;CURRENT RECEIVED SRCB
TCRQPT:	.BLKW	1	;SRCB FOR REQUEST PERMISSION TO TRANSMIT
TCDPG:	.BLKW	1	;SRCB FOR DEVICE WHOSE PERMISSION IS GRANTED
TCSDM:	.BLKW	1	;START OF DEVICE MESSAGE FROM XLATE
TCDTB:	.BLKW	1	;CURRENT DEVICE FOR TRANSMISSION BLOCK
TCCDVT:	.BLKW	1	;CUURENT DEVICE
TCSLFT:	.BLKW	1	;SPACE LEFT IN TRANSMISSION BLOCK
TCRMSG:	.BLKW	1	;START OF CHAIN OF RECEIVED MESSAGES FOR 
			;DIFFERENT HASP DEVICES
TCRCID:	.BLKW	1	;RECEIVED I.D. FOR CURRENT BLOCK
TCERB:	.BLKW	1	;SAVE BCB FOR ERROR REPORTING
TCBCBE:	.BLKW	1	;COUNT BCB ERRORS RECVD
.IIF LT TCSIZE-.,TCSIZE=. ;LENGTH OF A TASK CONTROL BLOCK
;
; THE FOLLOWING ARE USED ONLY BY THE DL10 DRIVER TASK
;
.=TCSSA
;
TCXLT:	.BLKW	1		;POINTER TO TRANSLATE TASK BEING FED
TCXFR:	.BLKW	1		;COUNT OF BYTES TRANSFERED ACROSS THE DL10
TCVPP:	.BLKW	1		;IN E3780, VERTICAL POSITION ON PRINTER.
TCPDM:	.BLKW	1		;CURRENT PTR TO DEV MSG
TCCMSG:	.BLKW	NLINES		;POINTER TO MESSAGE BEING SENT TO 10,
				; OR ZERO.
TCDMSG:	.BLKW	NLINES*NDHASP	;TO KEEP PTRS FOR DEVICE MESSAGES (HASP)
.IF NE FTDTE20			;STATUS BLOCKS DEFINED FOR DTE20 ONLY
;
; QUEUED PROTOCOL DATA AND SYMBOLS
;
DT11HD:	.BLKW	1		;COUNT OF BYTES IN THIS QUEUE
DT11FN:	.BLKW	1		;TO ELEVEN FUNCTION CODE
DT11DV:	.BLKW	1		;TO ELEVEN DEVICE NUMBER
	.BLKW	1		;SPACE
.IF NE,FTFEDV
DT11UC:	.BLKW	1		;FE#,,BYTE COUNT TO FOLLOW
.ENDC				;DEFINED ONLY FOR FE DEVICES
DT11DF:	.BLKW	1		;DN60 FUNCTION CODE
DT11AD:	.BLKW	1		;ADR FOR EX/DEP OR LINE #,DEV
DT11DT:	.BLKW	1		;DATA FOR DEPOSIT OR LENGTH OF IND  MSG
;
	
DT11GW:	.BLKW	1		;GUARD WORD FOR DTE20
DT11QP:	.BLKW	1
DT11AS:	.BLKW	1		;ADDRESS SAVE
DT11BS:	.BLKW	1		;BYTE COUNT SAVE
DTXTSZ:	.BLKW	1		;BYTE COUNT OF XFER
DTXTAS:	.BLKW	1
;
.IIF NE,DEBUG,DTO10Q:.BLKW 1	;STARTING ADDRESS OF HEADER
DTEQSZ:	.BLKW	1		;ELEVEN Q SIZE
DLCMSG:	.BLKW	1		;CHUNK ADDR OF DN61 MESSAGE BEING BUILT
DLMBCT:	.BLKW	1		;MESSAGE BYTE COUNT
DLMCTL:	.BLKW	1		;MESSAGE COUNT LEFT-OVER FOR NEXT XFER
DTXADR:	.BLKW	1		;SAVE INDIRECT DATA ADR HERE
DT11Q:	.BLKW	1		;TO 11 QUEUE
DLPMST:	.BLKW	1		;POINTER TO CURRENT TO-10 MSG
;
TCSTFX:	.BLKW	3		;FOR EXAMINE/DEPOSIT OF STATUS TO TEN
;
;
; THIS HEADER IS FOR SENDING "ACK" TO THE TEN
;  EACH TIME 11 RECEIVED INDIRECT DATA.
;
.IF NE,FTFEDV
DTAKHD:	.BLKW	1		;NO OF BYTES IN THIS HEADER
DTAKFN:	.BLKW	1		;ACK FUNCTION CODE
DTAKDV:	.BLKW	1		;FE DEVICE CODE
DTAKSP:	.BLKW	1		;SPARE
DTAKUC:	.BLKW	1		;HAS FE# RIGHT JUSTIFIED
.ENDC ;.IF NE,FTFEDV
;
; THIS HEADER IS FOR SENDING MESSAGES TO THE TEN.
;  IT DEPENDS ON ITS LINE #,ADDRESS,DEVICE,DATA AND OTHER
;  INFO SOLELY FROM THE DIRECT MESSAGES SENT BEFORE-HAND 
;  BY THE -10 WHICH HAVE BEEN RECEVED BY THE -11
;
DT10HD:	.BLKW	1		;COUNT OF BYTES IN THIS HEADER
DT10FN:	.BLKW	1		;QPR FUNCTION CODE;MUST BE 32
DT10DV:	.BLKW	1		;DEVICE CODE;MUST BE DLDDAS
DT10SP:	.BLKW	1		;DONT FORGET THE SPARE
.IF NE,FTFEDV			;DEFINED ONLY FOR FE DEVICES
DT10UC:	.BLKW	1		;FE#,,BYTE COUNT TO FOLLOW
.ENDC ;NE FTFEDV
DT10DF:	.BLKW	1		;DN60 FUNCTION CODE
DT10AD:	.BLKW	1		;ADDRESS FOR EXAMINE/DEPOSIT
DT10DT:	.BLKW	1		;EX/DEP DATA OR LENGTH OF IND MSG
;
.ENDC	; .IF NE FTDTE20
.IIF LT TCSIZE-.,TCSIZE=. 	;LENGTH OF A TASK CONTROL BLOCK
;
.SBTTL	CHUNKS
;
.=0
CHNXT:	.BLKW	1	;POINTER TO NEXT CHUNK (0 IF NONE)
CHLEN:	.BLKW	1	;BYTES OF DATA IN THIS CHUNK
CHDAT:	.BLKW	0	;FIRST BYTE OF DATA IN THIS CHUNK
;
; THE FIRST CHUNK IN A MESSAGE HAS NO DATA; JUST CONTROL INFO
;  AS DESCRIBED BELOW.
;
MSGNXT:	.BLKW	1	;POINTER TO NEXT MESSAGE IN QUEUE (0 IF NONE)
MSGPRV:	.BLKW	1	;POINTER TO PREV MSG IN QUEUE (0 IF NONE)
MSGLCH:	.BLKW	1	;POINTER TO LAST CHUNK OF MESSAGE
MSGCLP:	.BLKW	1	;POINTER TO "CHUNK LENGTH" FIELD OF LAST CHUNK
MSGPTR:	.BLKW	1	;POINTER TO FIRST EMPTY CHAR POSITION
			; IN MESSAGE (IN LAST CHUNK)
MSGCNT:	.BLKW	1	;COUNT OF BYTES LEFT IN LAST CHUNK
MSGBCC:	.BLKW	1	;ACCUMULATED BCC (ONLY USED BY XLATE)
MSGSNL:	.BLKW	1	;BYTES TO GO BEFORE INSERTING A SYN
MSGLEN:	.BLKW	1	;OVERALL LENGTH OF MESSAGE
MSGID:	.BLKW	1	;MESSAGE IDENTIFICATION (USED FROM XLATE
			; TO DL10 TASKS TO IDENTIFY SOURCE LINE)
MSGFGS:	.BLKW	1	;FLAGS
MSGTSP=B0		;MESSAGE WAS RECEIVED IN BSC TRANSPARENT MODE
MSGBIN=B1		;MESSAGE WAS RECEIVED IN BINARY MODE
;
MSGNLR:	.BLKW	1	;NUMBER OF LOGICAL RECORDS IN THIS MESSAGE
			; (USED ONLY BY XLATE)
.IF NE,DEBUG
MSGQUE:	.BLKW	1	;POINTER TO TCB OF TASK OWNING MSG
			; (OTHER THAN CREATOR -- SET BY QUEMSG)
.ENDC ;.IF NE,DEBUG
	.BLKB	CHSIZE-. ;UNUSED BYTES IN FIRST CHUNK OF MSG
CHDATL=.-CHDAT		;MAX DATA IN A CHUNK
;
; FOR A CHUNK ON THE FREE LIST, OFFSET 0 POINTS TO THE
;  NEXT CHUNK ON THE FREE LIST AND OFFSET 2 POINTS TO
;  THE PREVIOUS.  THE FIRST AND LAST CHUNKS HAVE "0" IN
;  THE RESPECTIVE POINTERS.  ALSO, BIT 0 IS SET TO 1 IN
;  THE FIRST WORD OF EACH CHUNK ON THE FREE LIST AS A FLAG.
;
.SBTTL	HASP-MULTILEAVING DEFINITIONS
;
; RECORD-CONTROL-BYTE DEFINITIONS
;
RCBRD1=223		;RCB FOR CARD READER 1
RCBRD2=243		;RCB FOR CARD READER 2
RCBRD3=263		;RCB FOR CARD READER 3
RCBRD4=303		;RCB FOR CARD READER 4
;
RCBPR1=224		;RCB FOR LINE PRINTER 1
RCBPR2=244		;RCB FOR LINE PRINTER 2
RCBPR3=264		;RCB FOR LINE PRINTER 3
RCBPR4=304		;RCB FOR LINE PRINTER 3
;
RCBPU1=225		;RCB FOR CARD PUNCH 1
RCBPU2=245		;RCB FOR CARD PUNCH 2
RCBPU3=265		;RCB FOR CARD PUNCH 3
RCBPU4=305		;RCB FOR CARD PUNCH 4
;
RCBCI= 222		;RCB FOR CONSOLE INPUT(OPERATOR COMMANDS)
RCBCO= 221		;RCB FOR CONSOLE OUTPUT
RCBRQP=220		;RCB FOR REQUEST PERMISSION FOR DEVICE
RCBPRG=240		;RCB FOR PERMISSION GRANTED FOR DEVICE
RCBCBE=340		;RCB FOR BCB ERROR REPORTED IN XMIT
RCBCTL=360		;RCB FOR CONTROL RECORD (SIGNON)
RCBSON=301		;SRCB FOR SIGNON
RCBSOF=302		;SRCB FOR SIGNOFF
RCBRTE=227		;RCB FOR CONSOLE ROUTING
RCBINQ=242		;RCB FOR CONSOLE INQUIRY WITH ROUTING
;
;
; FUNCTION CONTROL SEQUENCE ARE DEFINED BELOW:
;
FCSRD1=B11		;FCS FOR CARD  READER 1
FCSRD2=B10		;FCS FOR CARD READER 2
FCSRD3=B9		;FCS FOR CARD READER 3
FCSRD4=B8		;FCS FOR CARD  READER 4
;
FCSPR1=B11		;FCS FOR LINE PRINTER 1
FCSPR2=B10		;FCS FOR LINE PRINTER 2
FCSPR3=B9		;FCS FOR LINE PRINTER 3
FCSPR4=B8		;FCS FOR LINE PRINTER 4
;
FCSPU1=B0		;FCS FOR CARD PUNCH 1
FCSPU2=B1		;FCS FOR CARD PUNCH 2
FCSPU3=B2		;FCS FOR CARD PUNCH 3
FCSPU4=B3		;FCS FOR CARD PUNCH 4
;
FCSCSL=B6		;FCS FOR CONSOLE DEVICE
FCSUNV=B14		;FCS FOR TOTAL SUSPENSION
FCSINI=107617		;ALL STREAMS GOING
FCSYSP=140200		;SHUT OFF ALL STREAMS
FCSADS=100200		;ALL DEVICES SUSPENDED
FCSAGO=104301		;FOR LPT1,CSL AND PUNCH1 GOING
;
; BLOCK COUNT BYTE DEFINITIONS
;
BCBINI=240		;THIS RESETS THE BCB COUNT TO ZERO
BCBINB=240		;SAME AS ABOVE
;
; TERMINAL TYPE DEFINITIONS
;
TT3780=1		;TERMINAL TYPE IS AN IBM 3780
TT2780=2		;TERMINAL TYPE IS AN IBM 2780
TTHASP=3		;TERMINAL TYPE HASP-MULTILEAVING
;
; TRANSLATION OPTION DEFINITIONS
; USED BY EACH ASSEMBLED TRANSLATE TASK TO SET ITS BIT
;
XLOP37=B0		;FOR 2780/3780 TRANSLATE OPTION
			; ON FOR DN61/DN64
XLOPHS=B1		;FOR HASP TRANSLATION OPTION
			; ON FOR DN62/DN65
XLOP32=B2		;FOR IBM 3270 TRANSLATE OPTION
;
;
.SBTTL	TRACE DEFINITIONS
;
; MACRO TO CAUSE A VALUE TO BE PLACED IN THE TRACE TABLE,
;  ALONG WITH THE PC OF THE CALLER, AS AN INDICATION OF THE
;  MEANING OF THE ENTRY.
;
	.MACRO	TRACE	BITS,ARG,?LBL
.IF NE,FTRACE
	BIT	#BITS,TRCBTS	;SHOULD THIS THING BE TRACED?
	BEQ	LBL		;NO.
	MOV	ARG,-(SP)	;YES, PLACE VALUE ON STACK
	JSR	PC,TRCSBR	;CALL TRACE SUBROUTINE
LBL:
.ENDC ;.IF NE,FTRACE
	.ENDM	TRACE
;
; VALUES OF "BITS" IN TRACE MACRO, AND VALUES IN GLOBAL CELLS
;  "TRCBTS" AND "TRCHLT".
;
TRCDQD=B0		;TRACE ALL BSC TASK DATA, ONE CHAR AT A TIME
TRCDQF=B1		;TRACE ALL DQ11 FUNCTIONS
TRCCNK=B2		;TRACE CHUNK MANIPULATIONS
TRCDSP=B3		;TRACE DISPATCHER FUNCTIONS
TRCQUE=B4		;TRACE QUEUEING OF MESSAGES AND CHUNKS
TRCXLD=B5		;TRACE ALL XLATE DATA, ONE CHAR AT A TIME
TRCBCC=B6		;TRACE BCC COMPUTATIONS
TRCABO=B7		;TRACE MESSAGE STREAM ABNORMAL TERMINATION (CAN ALSO HALT)
TRCPAD=B8		;STOP ON RECEIVING AN EBCDIC PAD CHARACTER
			; IN NON-TRANSPARENT DATA
TRCTEN=B9		;TRACE PDP-10 DATA FLOW
TRCTER=B10		;STOP ON PDP-10 PROTOCOL ERROR
TRCMDF=B11		;TRACE KMC11 FUNCTIONS
TRCBCB=B12		;TRACE BCB FOR HASP
.IIF DF,FT2020, TRCDMC=B13	;TRACE DMC FUNCTIONS
.IIF DF,FT2020, TRCSPC=B14	;SPECIAL TRACER
;
TRCTBO=B15		;STOP WHEN TRACE BUFFER OVERFLOWS
;
.SBTTL	GLOBAL DATA STORAGE
;
.=0			;NOW DEFINE STORAGE FOR REAL
	.BLKW	LVPDVC	;WORDS TO LEAVE FOR PDL AND VECTORS
PDL:			;PUSH-DOWN LIST ENDS HERE
;
; THE FIRST FEW WORDS ARE SENT TO THE PDP-10 ON A "READ DN60
;  STATUS" FUNCTION, AND MUST NOT, THEREFORE, BE CHANGED.
;
D60ST1:	.BLKW	0	;BEGINNING OF DN60 STATUS
JOBVER:	.WORD	VMAJOR,VMINOR,VEDIT,VWHO ;VERSION NUMBER
	.WORD	WINVER	;VERSION NUMBER OF DL10 WINDOW
LOWZ1:	.BLKW	0	;START OF AREA TO CLEAR ON INITIALIZATION
CHFREC:	.BLKW	1	;COUNT OF FREE CHUNKS
NDQ11S:	.BLKW	1	;NUMBER OF DQ11S
D60CSZ:	.BLKW	1	;CHUNK SIZE (FOR REPORTING TO -10)
D60OPN:	.BLKW	1	;DN60 OPTIONS
MDVER:	.BLKW	4	;KMC11 VERSION NUMBER
D60ERC:	.BLKW	1	;ERROR CODE ON LAST ERROR
D60ERL:	.BLKW	1	;LINE NUMBER IN ERROR LAST
D60ERD:	.BLKW	1	;DEVICE NUMBER (OR RCB) ON LAST ERROR
D60ACT:	.BLKW	12.*2	;ACTIVE DEVICE MAP FOR 12 LINES
			; 2 WORDS PER LINE
D60ST2:	.BLKW	0	;END OF DN60 STATUS
CHFST:	.BLKW	1	;POINTER TO FIRST FREE CHUNK
CHLST:	.BLKW	1	;POINTER TO LAST FREE CHUNK
CHHGH:	.BLKW	1	;ADDRESS OF HIGHEST CHUNK
PHYLIM:	.BLKW	1	;NUMBER OF BYTES OF MAIN MEMORY
MEMERR:	.BLKW	1	;MF11-UP ERROR REGISTER
NXMPC:	.BLKW	1	;PC ON LAST BUS TRAP
NXMGO:	.BLKW	1	;WHERE TO GO ON BUS TRAP
NXMSP:	.BLKW	1	;SP TO USE ON BUS TRAP (0=FATAL)
ILSERR:	.BLKW	2	;PS AND PC ON ILL INSTR (ETC) TRAP
TRPERR:	.BLKW	2	;PC AND PS ON TRAP INSTR (STOPCD)

STOPR0:	.BLKW	1	;R0 ON LAST STOPCODE
STOPR1:	.BLKW	1	;R1 ON LAST STOPCODE
STOPR2:	.BLKW	1	;R2 ON LAST STOPCODE
STOPR3:	.BLKW	1	;R3 ON LAST STOPCODE
STOPR4:	.BLKW	1	;R4 ON LAST STOPCODE
STOPR5:	.BLKW	1	;R5 ON LAST STOPCODE
STOPSP:	.BLKW	1	;SP ON LAST STOPCODE

.IF NE,DEBUG
.IF EQ,FTKG11		;IF WE HAVE A KG11-A...
STOPKG:	.BLKW	3	;KG11-A REGS ON LAST STOPCODE
.ENDC ;.IF EQ,FTKG11
.ENDC ;.IF NE,DEBUG
TRPCOD:	.BLKW	1	;VALUE OF LAST STOPCODE
;
;
; CONTINUATION OF GLOBAL DATA STORAGE
;
DSPCLK:	.BLKW	1	;CLOCK MAINTAINED BY DISPATCHER
JIFCLK:	.BLKW	1	;CLOCK MAINTAINED BY KW11-L
DSPSEC:	.BLKW	1	;COUNTS TO JIFSEC TO MEASURE ONE SECOND
DLGONE:	.BLKW	1	; = -1 IF DL10 GONE (PDP-10 CRASHED)
DSPMTY:	.BLKW	1	;IDLE TIME IN THE DISPATCHER
DSPMTT:	.BLKW	1	;RECENT IDLE TIME
DSPMTX:	.BLKW	1	;MAX IDLE TIME
TCBP1:	.BLKW	1	;POINTER TO HIGHEST-PRIORITY TASK CONTROL BLOCKS
			;  (DQ11 DRIVERS)
TCBP2:	.BLKW	1	;POINTER TO MEDIUM-PRIORITY TASK CONTROL BLOCKS
			;  (DL10 DRIVER)
TCBP3:	.BLKW	1	;POINTER TO LOWEST-PRIORITY TASK CONTROL BLOCKS
			;  (ALL OTHERS)
DSPUPT:	.BLKW	2	;UP TIME IN SECONDS (32 BITS)
TCDLDR:	.BLKW	1	;POINTER TO THE DL10 DRIVER TCB
TCIDLE:	.BLKW	1	;POINTER TO THE "IDLE" TCB

.IF NE, FT.D87		; 4(013)
TCNABL:	.BLKW	1	;POINTER TO THE LINE ENABLE TCB FOR DL10 DRIVER 4(013)
.ENDC			;.IF NE, FT.D87 4(013)

DLGNTM:	.BLKW	1	;TIME (SECONDS) DL10 HAS BEEN GONE
DSPTCB:	.BLKW	1	;CURRENTLY RUNNING TASK'S TCB
DSPI10:	.BLKW	1	;NON-ZERO TO INTERRUPT THE 10
DLSSAV:	.BLKW	1	;STATUS OF DL10 ON LAST INTERRUPT
WAKE10:	.BLKW	1	;BITS FOR WAKING UP EACH LINE'S 10 PGM
DQCSR:	.BLKW	NLINES	;POINTER TO CSR FOR EACH DQ11
DQVEC:	.BLKW	NLINES	;POINTER TO INTERRUPT FOR EACH DQ11
DQLCB:	.BLKW	16.	;POINTER TO LCB FOR EACH ENABLED LINE
.IF NE,FTRACE
TRCPTR:	.BLKW	1	;POINTER TO NEXT TRACE TABLE ENTRY
TRCTBS:	.BLKW	TRCTBL*2 ;THE TRACE TABLE (2 WORDS PER ENTRY)
TRCTBE:	.BLKW	0	;END OF TRACE TABLE (FOR WRAP-AROUND)
TRCFLG:	.BLKW	1	;PATCH BIT 4 ON TO CAUSE CREATED TASKS
			; TO BE TRACED.
TRCBTS:	.BLKW	1	;PATCH BITS ON TO TRACE EVENTS
TRCHLT:	.BLKW	1	;PATCH BITS ON TO ENABLE DEBUGGING STOPS
.ENDC ;.IF NE,FTRACE
.IF NE,CHOWNR
CHOWNT:	.BLKW	CHOWNL	;TABLE FOR RECORDING CHUNK OWNERS
.ENDC ;.IF NE,CHOWNR
.IF NE,FTKG11
KGSIMW:	.BLKW	1	;BCC ACCUMULATOR FOR KG11-A SIMULATION
.ENDC ;.IF NE,FTKG11
;
;
; THE DTE DATA BASE.  THIS IS ASSEMBLED ONLY IF WE HAVE A DTE.
;
.IF NE,FTDTE20

DTIDBL:	.BLKW	1	;KEEP DOORBELL INTERRUPT COUNT HERE
DTIXDN:	.BLKW	1	;KEEP TEN DONE INTERRUPT COUNT HERE
DTIEDN:	.BLKW	1	;ELEVEN DONE INTERRUPT COUNT HERE
DTEPCA:	.BLKW	1		;ADDRESS OF PRIV OFFSET TABLE ENTRY
DTPSTA:	.BLKW	1		;OUR DTE20 STATUS WORD AND
DTEBAD:	.BLKW	1		; DTE ADDRESS (INITTED AT STARTUP)
DTEDTO:	.BLKW	1		;DEPOSIT/EXAMINE  TIMEOUT
				;ALSO USED FOR STORING
				;INTERRUPT VECTOR LOCATION
				;IN CHK11.P11 MODULE
DLACKF:	.BLKW	1		;NON-ZERO WHEN IN PRIMARY PROTOCOL
DTQSTA:				;ZEROED AT STARTUP
DT11ST:	.BLKB	1		;STATE OF TO-11 MECHANISM
DT10ST:	.BLKB	1		;AND OF TO-10
;
DT10AK:	.BLKW	1		;IF NON-ZERO, ED DATA EXPECTED AND MUST BE ACKED
DTPTCT:	.BLKW	1		;COUNT OF MESSGES PUNTED
;
;	POINTERS TO COMMUNICATIONS AREA
;
DLCMBS:	.BLKW	1	;BASE OF COMMUNICATION AREA
DLMYPN:	.BLKW	1	;MY PROCESSOR NUMBER
DLDPOF:	.BLKW	1	;DEPOSIT OFFSET FROM EXAMINE
;
; AREA TO STORE DN60, LINE OR DEVICE STATUS PRIOR TO SENDING THEM
;  OVER THE DTE20.
;
DTTTSB:	.BLKW	D60ST2-D60ST1+10 ;DN60 STATUS HAS MAX LENGTH
DTSBLN=.-DTTTSB			;BUFFER LENGTH FOR TESTING
;
;
;	PROCESSOR IDENTIFICATION TABLE
;
;	DTPIDT FORMAT:
;
;	5 WORDS/ENTRY
;	16 ENTRYS IN THE TABLE ONE FOR EACH PROCESSOR IN COMMUNICATION 
;	COMMUNICATION NUMBERS ARE LIMITED TO THE RANGE 0-15.
;
;	(PROCESSOR 0) DTPIDT:	ADDRESS OF DTE20 TO ACCESS THIS PROCESSOR
DTENM=0
;	(PROCESOR 0)		ADDRESS TO COMMUNICATE TO PROCESSOR 0
DTEMYN	=2
;	(PROCESSOR 0)		ADDRESS TO COMMUNICATE TO PROCESSOR 0 (WRITE)
DTDMYN	=4
;	(PROCESSOR 0)		ADDRESS FROM GENERAL 
DTEHSG	=6
;	(PROCESSOR 0)		ADDRESS FROM SPECIFIC
DTEHSM	=10
;
;	(PROCESSOR 1)	ADDRESS OF DTE20 TO USE TO ACCESS THIS PROCESSOR
;	...........
;
DTPIDT:	.BLKW	16.*5.
;
; CONTINUATION OF DTE20 DATA BASE
;
DTXTM3:	.BLKW	1		;EXAMINE WORD 3 (TEMP STORAGE) TO BE
DTXTM2:	.BLKW	1		;EXAMINE WORD 2 -USED ONLY BECAUSE EXAMINE
DTXTM1:	.BLKW	1		;EXAMINE WORD 1 - OR DEPOSIT 
				;		MAY FAIL AND 
				;		MUST BE REDONE
DTSTT:	.BLKW	3		;TO 10 STATUS
DTQCNT	=DTSTT+4		;BOTH OF BELOW
DT10QC	=DTSTT+4		;TO 10 QUEUE COUNT
DT11QC	=DTSTT+5		;TO 11 QUEUE COUNT
DTKPLV:	.BLKW	3		;11 KEEP ALIVE
;
.IF NE,DEBUG
DTESAV:	.BLKW	20		;FOR SAVING DTE20 REGISTERS
.ENDC ;.IF NE,DEBUG
;
.ENDC ;.IF NE,FTDTE20
;
;
.IF NE,FT.KMC
;
; THE KMC11 CONTROL BLOCKS.  SINCE WE SUPPORT UP TO 12 LINES,
;  AND SINCE EACH KMC11 HANDLES UP TO 4 OF THEM, WE CAN HAVE
;  UP TO 3 KMC11'S.
;
MDTBL:	.BLKW	MDTLN*<NLINES/4> ;KMC11 CONTROL BLOCKS
MDCSR:	.BLKW	NLINES/4	;CSR FOR EACH KMC11
MDVEC:	.BLKW	NLINES/4	;VECTOR FOR EACH KMC11
NKMCS:	.BLKW	1		;NUMBER OF KMC11'S FOUND BY CHK11
.IF NE,DEBUG
MDMUTT:	.BLKW	1		;MAX VALUE OF MDMXTT REQUIRED
.ENDC ;.IF NE,DEBUG
;
.ENDC ;.IF NE,FT.KMC
;
.SBTTL	DEFINITIONS FOR DMC11 ON A 2020
.IF DF,FT2020
DMCIBF=7		;MAXIMUM # INPUT BUFFERS QUEUED TO DMC
DMCOBF=7		;MAXIMUM # OUTPUT BUFFERS QUEUED TO DMC
DMCBLN=CHSIZE		;DMC BUFFER SIZE
MSGMAX=CHSIZE-CHDAT	;MAXIMUM MESSAGE SIZE TO THE DMC
TCDMDR=TCDLDR		;TCB ADDRESS OF DMC
DMCLCB:	.WORD	0	;LCB ADDRESS FOR THE DMC
DMCSR:	.WORD	0	;CSR ADDRESS FOR THE DMC
DMCVEC:	.WORD	0	;VECTOR ADDRESS FOR THE DMC
DMCBAS:	.BLKB	256.	;BASE ADDRESS FOR THE DMC
.ENDC
LOWZ2:	.BLKW	0	;END OF AREA TO CLEAR
;